feat: complete M3 runtime snapshot and profile save archive
This commit is contained in:
@@ -2,27 +2,27 @@
|
|||||||
|
|
||||||
## 1. SpacetimeDB 运行时主表
|
## 1. SpacetimeDB 运行时主表
|
||||||
|
|
||||||
- [ ] 设计 `runtime_snapshot`
|
- [x] 设计 `runtime_snapshot`
|
||||||
- [x] 设计 `runtime_setting`
|
- [x] 设计 `runtime_setting`
|
||||||
- [x] 设计 `profile_dashboard_state`
|
- [x] 设计 `profile_dashboard_state`
|
||||||
- [x] 设计 `profile_wallet_ledger`
|
- [x] 设计 `profile_wallet_ledger`
|
||||||
- [x] 设计 `profile_played_world`
|
- [x] 设计 `profile_played_world`
|
||||||
- [ ] 设计 `profile_save_archive`
|
- [x] 设计 `profile_save_archive`
|
||||||
- [x] 设计 `user_browse_history`
|
- [x] 设计 `user_browse_history`
|
||||||
|
|
||||||
## 2. 兼容快照策略
|
## 2. 兼容快照策略
|
||||||
|
|
||||||
- [ ] 设计“领域表真相 + 兼容聚合快照”策略
|
- [x] 设计“领域表真相 + 兼容聚合快照”策略
|
||||||
- [ ] 设计 snapshot projection 刷新机制
|
- [x] 设计 snapshot projection 刷新机制
|
||||||
- [ ] 迁移当前 snapshot hydration / normalize 规则
|
- [x] 迁移当前 snapshot hydration / normalize 规则
|
||||||
- [ ] 迁移当前 save archive 聚合逻辑
|
- [x] 迁移当前 save archive 聚合逻辑
|
||||||
- [x] 迁移当前 browse history 去重与排序逻辑
|
- [x] 迁移当前 browse history 去重与排序逻辑
|
||||||
|
|
||||||
## 3. Axum facade
|
## 3. Axum facade
|
||||||
|
|
||||||
- [ ] 兼容 `GET /api/runtime/save/snapshot`
|
- [x] 兼容 `GET /api/runtime/save/snapshot`
|
||||||
- [ ] 兼容 `PUT /api/runtime/save/snapshot`
|
- [x] 兼容 `PUT /api/runtime/save/snapshot`
|
||||||
- [ ] 兼容 `DELETE /api/runtime/save/snapshot`
|
- [x] 兼容 `DELETE /api/runtime/save/snapshot`
|
||||||
- [x] 兼容 `GET /api/runtime/settings`
|
- [x] 兼容 `GET /api/runtime/settings`
|
||||||
- [x] 兼容 `PUT /api/runtime/settings`
|
- [x] 兼容 `PUT /api/runtime/settings`
|
||||||
- [x] 兼容 `GET /api/runtime/profile/dashboard`
|
- [x] 兼容 `GET /api/runtime/profile/dashboard`
|
||||||
@@ -31,10 +31,10 @@
|
|||||||
- [x] 兼容 `GET /api/profile/wallet-ledger`
|
- [x] 兼容 `GET /api/profile/wallet-ledger`
|
||||||
- [x] 兼容 `GET /api/runtime/profile/play-stats`
|
- [x] 兼容 `GET /api/runtime/profile/play-stats`
|
||||||
- [x] 兼容 `GET /api/profile/play-stats`
|
- [x] 兼容 `GET /api/profile/play-stats`
|
||||||
- [ ] 兼容 `GET /api/runtime/profile/save-archives`
|
- [x] 兼容 `GET /api/runtime/profile/save-archives`
|
||||||
- [ ] 兼容 `GET /api/profile/save-archives`
|
- [x] 兼容 `GET /api/profile/save-archives`
|
||||||
- [ ] 兼容 `POST /api/runtime/profile/save-archives/:worldKey`
|
- [x] 兼容 `POST /api/runtime/profile/save-archives/:worldKey`
|
||||||
- [ ] 兼容 `POST /api/profile/save-archives/:worldKey`
|
- [x] 兼容 `POST /api/profile/save-archives/:worldKey`
|
||||||
- [x] 兼容 `GET /api/runtime/profile/browse-history`
|
- [x] 兼容 `GET /api/runtime/profile/browse-history`
|
||||||
- [x] 兼容 `POST /api/runtime/profile/browse-history`
|
- [x] 兼容 `POST /api/runtime/profile/browse-history`
|
||||||
- [x] 兼容 `DELETE /api/runtime/profile/browse-history`
|
- [x] 兼容 `DELETE /api/runtime/profile/browse-history`
|
||||||
@@ -45,8 +45,8 @@
|
|||||||
## 4. 阶段验收
|
## 4. 阶段验收
|
||||||
|
|
||||||
- [ ] 登录用户可正常保存、读取、删除存档
|
- [ ] 登录用户可正常保存、读取、删除存档
|
||||||
- [ ] 兼容路径与主路径返回一致
|
- [x] 兼容路径与主路径返回一致
|
||||||
- [ ] profile dashboard / browse history / save archive 行为一致
|
- [x] profile dashboard / browse history / save archive 行为一致
|
||||||
- [ ] 前端当前恢复流程可在不改 UI 的前提下跑通
|
- [ ] 前端当前恢复流程可在不改 UI 的前提下跑通
|
||||||
|
|
||||||
## 5. 本轮进展记录
|
## 5. 本轮进展记录
|
||||||
@@ -63,3 +63,7 @@
|
|||||||
- `2026-04-22`:已通过 `cargo check -p api-server --tests --message-format short`、`cargo test -p shared-contracts --lib`、`cargo test -p api-server runtime_profile::tests:: -- --nocapture` 验证本轮 profile projection 读链。
|
- `2026-04-22`:已通过 `cargo check -p api-server --tests --message-format short`、`cargo test -p shared-contracts --lib`、`cargo test -p api-server runtime_profile::tests:: -- --nocapture` 验证本轮 profile projection 读链。
|
||||||
- 详细设计见:
|
- 详细设计见:
|
||||||
- [../docs/technical/M3_PROFILE_DASHBOARD_AXUM_SPACETIMEDB_DESIGN_2026-04-22.md](../docs/technical/M3_PROFILE_DASHBOARD_AXUM_SPACETIMEDB_DESIGN_2026-04-22.md)
|
- [../docs/technical/M3_PROFILE_DASHBOARD_AXUM_SPACETIMEDB_DESIGN_2026-04-22.md](../docs/technical/M3_PROFILE_DASHBOARD_AXUM_SPACETIMEDB_DESIGN_2026-04-22.md)
|
||||||
|
- `2026-04-22`:已完成 `runtime_snapshot`、`profile_save_archive` 与“领域表真相 + 兼容聚合快照”方案落地,接通 `/api/runtime/save/snapshot`、`/api/runtime/profile/save-archives`、`/api/profile/save-archives` 与恢复存档双路径 facade。
|
||||||
|
- `2026-04-22`:已通过 `cargo test -p shared-kernel --lib`、`cargo test -p module-runtime --lib`、`cargo check -p spacetime-module --message-format short`、`cargo build -p spacetime-module --target wasm32-unknown-unknown --release --message-format short`、`cargo check -p spacetime-client --message-format short`、`cargo check -p api-server --tests --message-format short`、`cargo test -p api-server runtime_save::tests:: -- --nocapture` 验证 snapshot/save archive 主链编译与 facade。
|
||||||
|
- 详细设计见:
|
||||||
|
- [../docs/technical/M3_RUNTIME_SNAPSHOT_SAVE_ARCHIVE_AXUM_SPACETIMEDB_DESIGN_2026-04-22.md](../docs/technical/M3_RUNTIME_SNAPSHOT_SAVE_ARCHIVE_AXUM_SPACETIMEDB_DESIGN_2026-04-22.md)
|
||||||
|
|||||||
@@ -0,0 +1,274 @@
|
|||||||
|
# M3:runtime snapshot / save archive Axum + SpacetimeDB 落地设计
|
||||||
|
|
||||||
|
日期:`2026-04-22`
|
||||||
|
|
||||||
|
关联任务:
|
||||||
|
|
||||||
|
- [../../backend-rewrite-tasklist/02_M3_RUNTIME_PROFILE.md](../../backend-rewrite-tasklist/02_M3_RUNTIME_PROFILE.md)
|
||||||
|
- [../../backend-rewrite-tasklist/M0_PHASE_ACCEPTANCE_MATRIX_2026-04-20.md](../../backend-rewrite-tasklist/M0_PHASE_ACCEPTANCE_MATRIX_2026-04-20.md)
|
||||||
|
|
||||||
|
关联现状:
|
||||||
|
|
||||||
|
- [M3_RUNTIME_SETTINGS_AXUM_SPACETIMEDB_DESIGN_2026-04-21.md](./M3_RUNTIME_SETTINGS_AXUM_SPACETIMEDB_DESIGN_2026-04-21.md)
|
||||||
|
- [M3_BROWSE_HISTORY_AXUM_SPACETIMEDB_DESIGN_2026-04-21.md](./M3_BROWSE_HISTORY_AXUM_SPACETIMEDB_DESIGN_2026-04-21.md)
|
||||||
|
- [M3_PROFILE_DASHBOARD_AXUM_SPACETIMEDB_DESIGN_2026-04-22.md](./M3_PROFILE_DASHBOARD_AXUM_SPACETIMEDB_DESIGN_2026-04-22.md)
|
||||||
|
- `server-node/src/routes/rpg-entry/rpgEntrySaveRoutes.ts`
|
||||||
|
- `server-node/src/repositories/runtimeRepository.ts`
|
||||||
|
- `server-node/src/modules/runtime/runtimeSnapshotHydration.ts`
|
||||||
|
|
||||||
|
## 1. 文档目的
|
||||||
|
|
||||||
|
M3 剩余未完成的主链集中在三组能力:
|
||||||
|
|
||||||
|
1. `runtime_snapshot`
|
||||||
|
2. `profile_save_archive`
|
||||||
|
3. “领域表真相 + 兼容聚合快照”策略
|
||||||
|
|
||||||
|
本文件补足这些能力落地到 Rust 所需的编码级语义,确保可以直接实现:
|
||||||
|
|
||||||
|
1. `GET /api/runtime/save/snapshot`
|
||||||
|
2. `PUT /api/runtime/save/snapshot`
|
||||||
|
3. `DELETE /api/runtime/save/snapshot`
|
||||||
|
4. `GET /api/runtime/profile/save-archives`
|
||||||
|
5. `GET /api/profile/save-archives`
|
||||||
|
6. `POST /api/runtime/profile/save-archives/:worldKey`
|
||||||
|
7. `POST /api/profile/save-archives/:worldKey`
|
||||||
|
|
||||||
|
## 2. 旧 Node 行为冻结
|
||||||
|
|
||||||
|
### 2.1 当前 snapshot
|
||||||
|
|
||||||
|
路由:
|
||||||
|
|
||||||
|
1. `GET /api/runtime/save/snapshot`
|
||||||
|
2. `PUT /api/runtime/save/snapshot`
|
||||||
|
3. `DELETE /api/runtime/save/snapshot`
|
||||||
|
|
||||||
|
语义:
|
||||||
|
|
||||||
|
1. `GET` 无记录时返回 `null`,不是默认空快照。
|
||||||
|
2. `PUT` 请求体要求:
|
||||||
|
- `gameState: unknown`
|
||||||
|
- `bottomTab: string`
|
||||||
|
- `currentStory?: unknown | null`
|
||||||
|
- `savedAt?: string`
|
||||||
|
3. `PUT` 会先执行 snapshot normalize,再写入当前快照。
|
||||||
|
4. `DELETE` 只删除当前快照,不删除 `profile_save_archive`、`profile_dashboard_state`、`profile_wallet_ledger`、`profile_played_world`。
|
||||||
|
|
||||||
|
### 2.2 save archive
|
||||||
|
|
||||||
|
路由:
|
||||||
|
|
||||||
|
1. `GET /api/runtime/profile/save-archives`
|
||||||
|
2. `GET /api/profile/save-archives`
|
||||||
|
3. `POST /api/runtime/profile/save-archives/:worldKey`
|
||||||
|
4. `POST /api/profile/save-archives/:worldKey`
|
||||||
|
|
||||||
|
语义:
|
||||||
|
|
||||||
|
1. save archive 是“按世界聚合”的最近一次快照,不是多版本列表。
|
||||||
|
2. `worldKey` 冻结规则:
|
||||||
|
- 内置世界:`builtin:{worldType}`
|
||||||
|
- 自定义世界:优先 `custom:{profileId}`,否则 `custom:{worldTitle}`
|
||||||
|
3. `GET list` 按 `savedAt DESC` 排序。
|
||||||
|
4. `POST resume` 找不到记录时返回 `404`。
|
||||||
|
5. `POST resume` 命中后会把 archive 重新写回当前 snapshot,并返回:
|
||||||
|
- `entry`
|
||||||
|
- `snapshot`
|
||||||
|
6. 旧 Node 在 `resume` 时只回填当前 snapshot,不再次刷新 dashboard / save archive / custom world profile projection。
|
||||||
|
|
||||||
|
## 3. 兼容聚合快照策略
|
||||||
|
|
||||||
|
### 3.1 领域表真相
|
||||||
|
|
||||||
|
M3 当前统一采用:
|
||||||
|
|
||||||
|
1. `runtime_snapshot` 承接前端兼容恢复所需的原始运行时快照。
|
||||||
|
2. `profile_dashboard_state`
|
||||||
|
3. `profile_wallet_ledger`
|
||||||
|
4. `profile_played_world`
|
||||||
|
5. `profile_save_archive`
|
||||||
|
|
||||||
|
其中:
|
||||||
|
|
||||||
|
1. 当前快照真相是 `runtime_snapshot`。
|
||||||
|
2. profile 聚合真相分别是各自 projection 表。
|
||||||
|
3. `profile_save_archive` 是“按世界聚合的最近一次快照副本”,用于列表恢复入口。
|
||||||
|
|
||||||
|
### 3.2 本轮策略
|
||||||
|
|
||||||
|
本轮不把 Node 里的超大 hydration 逻辑逐字段翻译进 `module-runtime`。
|
||||||
|
|
||||||
|
本轮冻结为:
|
||||||
|
|
||||||
|
1. `PUT snapshot` 仍接收任意 JSON。
|
||||||
|
2. Axum 层只做最小兼容校验:
|
||||||
|
- `bottomTab` 非空
|
||||||
|
- `savedAt` 缺失时补当前时间
|
||||||
|
3. `bottomTab` 只接受:
|
||||||
|
- `adventure`
|
||||||
|
- `character`
|
||||||
|
- `inventory`
|
||||||
|
- 其他值统一回退到 `adventure`
|
||||||
|
4. `currentStory` 若不是 JSON object,则回退为 `null`
|
||||||
|
5. `gameState` 必须可序列化为 JSON;如不是 object,仍允许原样存储 JSON 值
|
||||||
|
6. profile projection 刷新只依赖旧 Node 已冻结的少数字段抽取:
|
||||||
|
- `gameState.playerCurrency`
|
||||||
|
- `gameState.runtimeStats.playTimeMs`
|
||||||
|
- `gameState.worldType`
|
||||||
|
- `gameState.currentScenePreset`
|
||||||
|
- `gameState.customWorldProfile`
|
||||||
|
- `gameState.storyEngineMemory.continueGameDigest`
|
||||||
|
- `currentStory.text`
|
||||||
|
|
||||||
|
这样做的原因:
|
||||||
|
|
||||||
|
1. 先保证 M3 的保存、读取、恢复主链跑通。
|
||||||
|
2. 避免把 `runtimeSnapshotHydration.ts` 的大量历史兼容逻辑一次性搬进 Rust,造成 M3 范围膨胀。
|
||||||
|
3. 不阻断当前前端恢复链路,因为前端写入的主体仍是 JSON 快照。
|
||||||
|
|
||||||
|
## 4. SpacetimeDB 表设计
|
||||||
|
|
||||||
|
### 4.1 `runtime_snapshot`
|
||||||
|
|
||||||
|
字段:
|
||||||
|
|
||||||
|
| 字段 | 类型 | 说明 |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| `user_id` | `String` | 主键 |
|
||||||
|
| `version` | `u32` | 当前固定 `2` |
|
||||||
|
| `saved_at` | `Timestamp` | 快照保存时间 |
|
||||||
|
| `bottom_tab` | `String` | 当前底部标签 |
|
||||||
|
| `game_state_json` | `String` | 原始 gameState JSON 字符串 |
|
||||||
|
| `current_story_json` | `Option<String>` | 原始 currentStory JSON 字符串 |
|
||||||
|
| `created_at` | `Timestamp` | 首次创建时间 |
|
||||||
|
| `updated_at` | `Timestamp` | 最近更新时间 |
|
||||||
|
|
||||||
|
### 4.2 `profile_save_archive`
|
||||||
|
|
||||||
|
字段:
|
||||||
|
|
||||||
|
| 字段 | 类型 | 说明 |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| `archive_id` | `String` | 主键,固定为 `user_id:world_key` |
|
||||||
|
| `user_id` | `String` | 用户 ID |
|
||||||
|
| `world_key` | `String` | 世界唯一键 |
|
||||||
|
| `owner_user_id` | `Option<String>` | 当前先冻结为 `None` |
|
||||||
|
| `profile_id` | `Option<String>` | 自定义世界 profile ID |
|
||||||
|
| `world_type` | `Option<String>` | 世界类型 |
|
||||||
|
| `world_name` | `String` | 存档展示名 |
|
||||||
|
| `subtitle` | `String` | 副标题 |
|
||||||
|
| `summary_text` | `String` | 摘要 |
|
||||||
|
| `cover_image_src` | `Option<String>` | 封面 |
|
||||||
|
| `saved_at` | `Timestamp` | 最近一次保存时间 |
|
||||||
|
| `bottom_tab` | `String` | 存档时所在 tab |
|
||||||
|
| `game_state_json` | `String` | 最近一次存档快照 JSON |
|
||||||
|
| `current_story_json` | `Option<String>` | 最近一次剧情 JSON |
|
||||||
|
| `created_at` | `Timestamp` | 首次创建时间 |
|
||||||
|
| `updated_at` | `Timestamp` | 最近更新时间 |
|
||||||
|
|
||||||
|
## 5. Projection 刷新规则
|
||||||
|
|
||||||
|
### 5.1 `PUT /api/runtime/save/snapshot`
|
||||||
|
|
||||||
|
写入顺序冻结为:
|
||||||
|
|
||||||
|
1. upsert `runtime_snapshot`
|
||||||
|
2. 刷新 `profile_dashboard_state`
|
||||||
|
3. 刷新 `profile_wallet_ledger`
|
||||||
|
4. 刷新 `profile_played_world`
|
||||||
|
5. 刷新 `profile_save_archive`
|
||||||
|
|
||||||
|
### 5.2 dashboard / wallet / played world
|
||||||
|
|
||||||
|
沿用已冻结 Node 规则:
|
||||||
|
|
||||||
|
1. `playerCurrency` 映射到 `wallet_balance`
|
||||||
|
2. 钱包变化时写一条 `snapshot_sync` ledger
|
||||||
|
3. `runtimeStats.playTimeMs` 与 `profile_played_world.last_observed_play_time_ms` 做增量比较
|
||||||
|
4. `total_play_time_ms` 为累积值
|
||||||
|
|
||||||
|
### 5.3 save archive metadata
|
||||||
|
|
||||||
|
规则:
|
||||||
|
|
||||||
|
1. 若存在 `customWorldProfile`:
|
||||||
|
- `worldType = "CUSTOM"`
|
||||||
|
- `worldKey = custom:{profileId or worldTitle}`
|
||||||
|
- `worldName` 优先 `customWorldProfile.name/title`
|
||||||
|
- `subtitle` 优先 `customWorldProfile.summary/settingText`
|
||||||
|
2. 若是内置世界:
|
||||||
|
- `worldKey = builtin:{worldType}`
|
||||||
|
- `worldName` 优先 `currentScenePreset.name`,否则 `worldType` 对应默认中文名
|
||||||
|
- `subtitle` 优先 `currentScenePreset.summary/description`
|
||||||
|
3. `summaryText` 优先级:
|
||||||
|
- `storyEngineMemory.continueGameDigest`
|
||||||
|
- `currentStory.text`
|
||||||
|
- `subtitle`
|
||||||
|
- `继续推进上一次保存的故事。`
|
||||||
|
4. `coverImageSrc`:
|
||||||
|
- 自定义世界优先 `customWorldProfile.coverImageSrc`
|
||||||
|
- 内置世界优先 `currentScenePreset.imageSrc`
|
||||||
|
|
||||||
|
## 6. Axum facade 设计
|
||||||
|
|
||||||
|
### 6.1 `GET /api/runtime/save/snapshot`
|
||||||
|
|
||||||
|
返回:
|
||||||
|
|
||||||
|
1. 有记录时返回标准 snapshot object
|
||||||
|
2. 无记录时返回 `null`
|
||||||
|
|
||||||
|
### 6.2 `PUT /api/runtime/save/snapshot`
|
||||||
|
|
||||||
|
返回:
|
||||||
|
|
||||||
|
1. 归一化后并已持久化的 snapshot
|
||||||
|
|
||||||
|
### 6.3 `DELETE /api/runtime/save/snapshot`
|
||||||
|
|
||||||
|
返回:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"ok": true
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 6.4 save archive list
|
||||||
|
|
||||||
|
主路径与兼容路径:
|
||||||
|
|
||||||
|
1. `GET /api/runtime/profile/save-archives`
|
||||||
|
2. `GET /api/profile/save-archives`
|
||||||
|
|
||||||
|
返回:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"entries": []
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 6.5 save archive resume
|
||||||
|
|
||||||
|
主路径与兼容路径:
|
||||||
|
|
||||||
|
1. `POST /api/runtime/profile/save-archives/:worldKey`
|
||||||
|
2. `POST /api/profile/save-archives/:worldKey`
|
||||||
|
|
||||||
|
行为:
|
||||||
|
|
||||||
|
1. `worldKey` 为空返回 `400`
|
||||||
|
2. 找不到 archive 返回 `404`
|
||||||
|
3. 返回 `entry + snapshot`
|
||||||
|
|
||||||
|
## 7. 本轮验收口径
|
||||||
|
|
||||||
|
完成后需满足:
|
||||||
|
|
||||||
|
1. 登录用户可 `PUT/GET/DELETE` 当前 snapshot
|
||||||
|
2. `PUT snapshot` 后可以从 `save-archives` 看到按世界聚合的恢复入口
|
||||||
|
3. `POST save-archives/:worldKey` 可恢复当前 snapshot
|
||||||
|
4. `/api/runtime/profile/save-archives` 与 `/api/profile/save-archives` 返回一致
|
||||||
|
5. `profile dashboard / browse history / save archive` 三组行为可并存,不互相覆盖
|
||||||
2
server-rs/Cargo.lock
generated
2
server-rs/Cargo.lock
generated
@@ -1485,6 +1485,7 @@ name = "module-runtime"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
|
"serde_json",
|
||||||
"shared-kernel",
|
"shared-kernel",
|
||||||
"spacetimedb",
|
"spacetimedb",
|
||||||
"time",
|
"time",
|
||||||
@@ -2515,6 +2516,7 @@ dependencies = [
|
|||||||
"module-runtime",
|
"module-runtime",
|
||||||
"module-runtime-item",
|
"module-runtime-item",
|
||||||
"module-story",
|
"module-story",
|
||||||
|
"serde_json",
|
||||||
"spacetimedb",
|
"spacetimedb",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -49,6 +49,10 @@ use crate::{
|
|||||||
},
|
},
|
||||||
runtime_inventory::get_runtime_inventory_state,
|
runtime_inventory::get_runtime_inventory_state,
|
||||||
runtime_profile::{get_profile_dashboard, get_profile_play_stats, get_profile_wallet_ledger},
|
runtime_profile::{get_profile_dashboard, get_profile_play_stats, get_profile_wallet_ledger},
|
||||||
|
runtime_save::{
|
||||||
|
delete_runtime_snapshot, get_runtime_snapshot, list_profile_save_archives,
|
||||||
|
put_runtime_snapshot, resume_profile_save_archive,
|
||||||
|
},
|
||||||
runtime_settings::{get_runtime_settings, put_runtime_settings},
|
runtime_settings::{get_runtime_settings, put_runtime_settings},
|
||||||
runtime_story::resolve_runtime_story_state,
|
runtime_story::resolve_runtime_story_state,
|
||||||
state::AppState,
|
state::AppState,
|
||||||
@@ -227,6 +231,16 @@ pub fn build_router(state: AppState) -> Router {
|
|||||||
"/api/runtime/settings",
|
"/api/runtime/settings",
|
||||||
get(get_runtime_settings)
|
get(get_runtime_settings)
|
||||||
.put(put_runtime_settings)
|
.put(put_runtime_settings)
|
||||||
|
.route_layer(middleware::from_fn_with_state(
|
||||||
|
state.clone(),
|
||||||
|
require_bearer_auth,
|
||||||
|
)),
|
||||||
|
)
|
||||||
|
.route(
|
||||||
|
"/api/runtime/save/snapshot",
|
||||||
|
get(get_runtime_snapshot)
|
||||||
|
.put(put_runtime_snapshot)
|
||||||
|
.delete(delete_runtime_snapshot)
|
||||||
.route_layer(middleware::from_fn_with_state(
|
.route_layer(middleware::from_fn_with_state(
|
||||||
state.clone(),
|
state.clone(),
|
||||||
require_bearer_auth,
|
require_bearer_auth,
|
||||||
@@ -366,6 +380,34 @@ pub fn build_router(state: AppState) -> Router {
|
|||||||
require_bearer_auth,
|
require_bearer_auth,
|
||||||
)),
|
)),
|
||||||
)
|
)
|
||||||
|
.route(
|
||||||
|
"/api/runtime/profile/save-archives",
|
||||||
|
get(list_profile_save_archives).route_layer(middleware::from_fn_with_state(
|
||||||
|
state.clone(),
|
||||||
|
require_bearer_auth,
|
||||||
|
)),
|
||||||
|
)
|
||||||
|
.route(
|
||||||
|
"/api/profile/save-archives",
|
||||||
|
get(list_profile_save_archives).route_layer(middleware::from_fn_with_state(
|
||||||
|
state.clone(),
|
||||||
|
require_bearer_auth,
|
||||||
|
)),
|
||||||
|
)
|
||||||
|
.route(
|
||||||
|
"/api/runtime/profile/save-archives/{world_key}",
|
||||||
|
post(resume_profile_save_archive).route_layer(middleware::from_fn_with_state(
|
||||||
|
state.clone(),
|
||||||
|
require_bearer_auth,
|
||||||
|
)),
|
||||||
|
)
|
||||||
|
.route(
|
||||||
|
"/api/profile/save-archives/{world_key}",
|
||||||
|
post(resume_profile_save_archive).route_layer(middleware::from_fn_with_state(
|
||||||
|
state.clone(),
|
||||||
|
require_bearer_auth,
|
||||||
|
)),
|
||||||
|
)
|
||||||
.route(
|
.route(
|
||||||
"/api/runtime/sessions/{runtime_session_id}/inventory",
|
"/api/runtime/sessions/{runtime_session_id}/inventory",
|
||||||
get(get_runtime_inventory_state).route_layer(middleware::from_fn_with_state(
|
get(get_runtime_inventory_state).route_layer(middleware::from_fn_with_state(
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ mod response_headers;
|
|||||||
mod runtime_browse_history;
|
mod runtime_browse_history;
|
||||||
mod runtime_inventory;
|
mod runtime_inventory;
|
||||||
mod runtime_profile;
|
mod runtime_profile;
|
||||||
|
mod runtime_save;
|
||||||
mod runtime_settings;
|
mod runtime_settings;
|
||||||
mod runtime_story;
|
mod runtime_story;
|
||||||
mod session_client;
|
mod session_client;
|
||||||
|
|||||||
401
server-rs/crates/api-server/src/runtime_save.rs
Normal file
401
server-rs/crates/api-server/src/runtime_save.rs
Normal file
@@ -0,0 +1,401 @@
|
|||||||
|
use axum::{
|
||||||
|
Json,
|
||||||
|
extract::{Extension, Path, State},
|
||||||
|
http::StatusCode,
|
||||||
|
response::Response,
|
||||||
|
};
|
||||||
|
use serde::Deserialize;
|
||||||
|
use serde_json::{Value, json};
|
||||||
|
use shared_contracts::runtime::{
|
||||||
|
BasicOkResponse, ProfileSaveArchiveListResponse, ProfileSaveArchiveResumeResponse,
|
||||||
|
ProfileSaveArchiveSummaryResponse, PutSavedGameSnapshotRequest, SavedGameSnapshotResponse,
|
||||||
|
};
|
||||||
|
use shared_kernel::{offset_datetime_to_unix_micros, parse_rfc3339};
|
||||||
|
use spacetime_client::SpacetimeClientError;
|
||||||
|
use time::OffsetDateTime;
|
||||||
|
|
||||||
|
use crate::{
|
||||||
|
api_response::json_success_body, auth::AuthenticatedAccessToken, http_error::AppError,
|
||||||
|
request_context::RequestContext, state::AppState,
|
||||||
|
};
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, Deserialize)]
|
||||||
|
pub struct WorldKeyPath {
|
||||||
|
#[serde(rename = "world_key")]
|
||||||
|
pub world_key: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
pub async fn get_runtime_snapshot(
|
||||||
|
State(state): State<AppState>,
|
||||||
|
Extension(request_context): Extension<RequestContext>,
|
||||||
|
Extension(authenticated): Extension<AuthenticatedAccessToken>,
|
||||||
|
) -> Result<Json<Value>, Response> {
|
||||||
|
let user_id = authenticated.claims().user_id().to_string();
|
||||||
|
let record = state
|
||||||
|
.spacetime_client()
|
||||||
|
.get_runtime_snapshot(user_id)
|
||||||
|
.await
|
||||||
|
.map_err(|error| runtime_save_error_response(&request_context, map_runtime_save_client_error(error)))?;
|
||||||
|
|
||||||
|
Ok(json_success_body(
|
||||||
|
Some(&request_context),
|
||||||
|
record.as_ref().map(build_saved_game_snapshot_response),
|
||||||
|
))
|
||||||
|
}
|
||||||
|
|
||||||
|
pub async fn put_runtime_snapshot(
|
||||||
|
State(state): State<AppState>,
|
||||||
|
Extension(request_context): Extension<RequestContext>,
|
||||||
|
Extension(authenticated): Extension<AuthenticatedAccessToken>,
|
||||||
|
Json(payload): Json<PutSavedGameSnapshotRequest>,
|
||||||
|
) -> Result<Json<Value>, Response> {
|
||||||
|
let user_id = authenticated.claims().user_id().to_string();
|
||||||
|
let now = OffsetDateTime::now_utc();
|
||||||
|
let saved_at = payload
|
||||||
|
.saved_at
|
||||||
|
.as_deref()
|
||||||
|
.map(parse_rfc3339)
|
||||||
|
.transpose()
|
||||||
|
.map_err(|error| {
|
||||||
|
runtime_save_error_response(
|
||||||
|
&request_context,
|
||||||
|
AppError::from_status(StatusCode::BAD_REQUEST).with_details(json!({
|
||||||
|
"provider": "runtime-save",
|
||||||
|
"message": format!("savedAt 非法: {error}"),
|
||||||
|
})),
|
||||||
|
)
|
||||||
|
})?
|
||||||
|
.unwrap_or(now);
|
||||||
|
let updated_at_micros = offset_datetime_to_unix_micros(now);
|
||||||
|
let saved_at_micros = offset_datetime_to_unix_micros(saved_at);
|
||||||
|
|
||||||
|
let record = state
|
||||||
|
.spacetime_client()
|
||||||
|
.put_runtime_snapshot(
|
||||||
|
user_id,
|
||||||
|
saved_at_micros,
|
||||||
|
payload.bottom_tab,
|
||||||
|
payload.game_state,
|
||||||
|
payload.current_story,
|
||||||
|
updated_at_micros,
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
.map_err(|error| runtime_save_error_response(&request_context, map_runtime_save_client_error(error)))?;
|
||||||
|
|
||||||
|
Ok(json_success_body(
|
||||||
|
Some(&request_context),
|
||||||
|
build_saved_game_snapshot_response(&record),
|
||||||
|
))
|
||||||
|
}
|
||||||
|
|
||||||
|
pub async fn delete_runtime_snapshot(
|
||||||
|
State(state): State<AppState>,
|
||||||
|
Extension(request_context): Extension<RequestContext>,
|
||||||
|
Extension(authenticated): Extension<AuthenticatedAccessToken>,
|
||||||
|
) -> Result<Json<Value>, Response> {
|
||||||
|
let user_id = authenticated.claims().user_id().to_string();
|
||||||
|
state
|
||||||
|
.spacetime_client()
|
||||||
|
.delete_runtime_snapshot(user_id)
|
||||||
|
.await
|
||||||
|
.map_err(|error| runtime_save_error_response(&request_context, map_runtime_save_client_error(error)))?;
|
||||||
|
|
||||||
|
Ok(json_success_body(
|
||||||
|
Some(&request_context),
|
||||||
|
BasicOkResponse { ok: true },
|
||||||
|
))
|
||||||
|
}
|
||||||
|
|
||||||
|
pub async fn list_profile_save_archives(
|
||||||
|
State(state): State<AppState>,
|
||||||
|
Extension(request_context): Extension<RequestContext>,
|
||||||
|
Extension(authenticated): Extension<AuthenticatedAccessToken>,
|
||||||
|
) -> Result<Json<Value>, Response> {
|
||||||
|
let user_id = authenticated.claims().user_id().to_string();
|
||||||
|
let entries = state
|
||||||
|
.spacetime_client()
|
||||||
|
.list_profile_save_archives(user_id)
|
||||||
|
.await
|
||||||
|
.map_err(|error| runtime_save_error_response(&request_context, map_runtime_save_client_error(error)))?;
|
||||||
|
|
||||||
|
Ok(json_success_body(
|
||||||
|
Some(&request_context),
|
||||||
|
ProfileSaveArchiveListResponse {
|
||||||
|
entries: entries
|
||||||
|
.iter()
|
||||||
|
.map(build_profile_save_archive_summary_response)
|
||||||
|
.collect(),
|
||||||
|
},
|
||||||
|
))
|
||||||
|
}
|
||||||
|
|
||||||
|
pub async fn resume_profile_save_archive(
|
||||||
|
State(state): State<AppState>,
|
||||||
|
Extension(request_context): Extension<RequestContext>,
|
||||||
|
Extension(authenticated): Extension<AuthenticatedAccessToken>,
|
||||||
|
Path(path): Path<WorldKeyPath>,
|
||||||
|
) -> Result<Json<Value>, Response> {
|
||||||
|
let world_key = path.world_key.trim().to_string();
|
||||||
|
if world_key.is_empty() {
|
||||||
|
return Err(runtime_save_error_response(
|
||||||
|
&request_context,
|
||||||
|
AppError::from_status(StatusCode::BAD_REQUEST).with_details(json!({
|
||||||
|
"provider": "runtime-save",
|
||||||
|
"message": "worldKey 不能为空",
|
||||||
|
})),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
let user_id = authenticated.claims().user_id().to_string();
|
||||||
|
let (entry, snapshot) = state
|
||||||
|
.spacetime_client()
|
||||||
|
.resume_profile_save_archive(user_id, world_key)
|
||||||
|
.await
|
||||||
|
.map_err(|error| runtime_save_error_response(&request_context, map_runtime_save_resume_client_error(error)))?;
|
||||||
|
|
||||||
|
Ok(json_success_body(
|
||||||
|
Some(&request_context),
|
||||||
|
ProfileSaveArchiveResumeResponse {
|
||||||
|
entry: build_profile_save_archive_summary_response(&entry),
|
||||||
|
snapshot: build_saved_game_snapshot_response(&snapshot),
|
||||||
|
},
|
||||||
|
))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn build_saved_game_snapshot_response(
|
||||||
|
record: &module_runtime::RuntimeSnapshotRecord,
|
||||||
|
) -> SavedGameSnapshotResponse {
|
||||||
|
SavedGameSnapshotResponse {
|
||||||
|
version: record.version,
|
||||||
|
saved_at: record.saved_at.clone(),
|
||||||
|
game_state: record.game_state.clone(),
|
||||||
|
bottom_tab: record.bottom_tab.clone(),
|
||||||
|
current_story: record.current_story.clone(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn build_profile_save_archive_summary_response(
|
||||||
|
record: &module_runtime::RuntimeProfileSaveArchiveRecord,
|
||||||
|
) -> ProfileSaveArchiveSummaryResponse {
|
||||||
|
ProfileSaveArchiveSummaryResponse {
|
||||||
|
world_key: record.world_key.clone(),
|
||||||
|
owner_user_id: record.owner_user_id.clone(),
|
||||||
|
profile_id: record.profile_id.clone(),
|
||||||
|
world_type: record.world_type.clone(),
|
||||||
|
world_name: record.world_name.clone(),
|
||||||
|
subtitle: record.subtitle.clone(),
|
||||||
|
summary_text: record.summary_text.clone(),
|
||||||
|
cover_image_src: record.cover_image_src.clone(),
|
||||||
|
last_played_at: record.saved_at.clone(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn map_runtime_save_client_error(error: SpacetimeClientError) -> AppError {
|
||||||
|
let (status, provider) = match error {
|
||||||
|
SpacetimeClientError::Runtime(_) => (StatusCode::BAD_REQUEST, "runtime-save"),
|
||||||
|
_ => (StatusCode::BAD_GATEWAY, "spacetimedb"),
|
||||||
|
};
|
||||||
|
|
||||||
|
AppError::from_status(status).with_details(json!({
|
||||||
|
"provider": provider,
|
||||||
|
"message": error.to_string(),
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn map_runtime_save_resume_client_error(error: SpacetimeClientError) -> AppError {
|
||||||
|
let (status, provider) = match &error {
|
||||||
|
SpacetimeClientError::Procedure(message)
|
||||||
|
if message.contains("world_key 不存在") || message.contains("对应 world_key 不存在") =>
|
||||||
|
{
|
||||||
|
(StatusCode::NOT_FOUND, "runtime-save")
|
||||||
|
}
|
||||||
|
SpacetimeClientError::Runtime(_) => (StatusCode::BAD_REQUEST, "runtime-save"),
|
||||||
|
_ => (StatusCode::BAD_GATEWAY, "spacetimedb"),
|
||||||
|
};
|
||||||
|
|
||||||
|
AppError::from_status(status).with_details(json!({
|
||||||
|
"provider": provider,
|
||||||
|
"message": error.to_string(),
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn runtime_save_error_response(request_context: &RequestContext, error: AppError) -> Response {
|
||||||
|
error.into_response_with_context(Some(request_context))
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use axum::{
|
||||||
|
body::Body,
|
||||||
|
http::{Request, StatusCode},
|
||||||
|
};
|
||||||
|
use http_body_util::BodyExt;
|
||||||
|
use platform_auth::{
|
||||||
|
AccessTokenClaims, AccessTokenClaimsInput, AuthProvider, BindingStatus, sign_access_token,
|
||||||
|
};
|
||||||
|
use serde_json::Value;
|
||||||
|
use time::OffsetDateTime;
|
||||||
|
use tower::ServiceExt;
|
||||||
|
|
||||||
|
use crate::{app::build_router, config::AppConfig, state::AppState};
|
||||||
|
|
||||||
|
#[tokio::test]
|
||||||
|
async fn runtime_snapshot_requires_authentication() {
|
||||||
|
let app = build_router(AppState::new(AppConfig::default()).expect("state should build"));
|
||||||
|
let response = app
|
||||||
|
.oneshot(
|
||||||
|
Request::builder()
|
||||||
|
.method("GET")
|
||||||
|
.uri("/api/runtime/save/snapshot")
|
||||||
|
.body(Body::empty())
|
||||||
|
.expect("request should build"),
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
.expect("request should succeed");
|
||||||
|
|
||||||
|
assert_eq!(response.status(), StatusCode::UNAUTHORIZED);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[tokio::test]
|
||||||
|
async fn profile_save_archives_requires_authentication() {
|
||||||
|
let app = build_router(AppState::new(AppConfig::default()).expect("state should build"));
|
||||||
|
let response = app
|
||||||
|
.oneshot(
|
||||||
|
Request::builder()
|
||||||
|
.method("GET")
|
||||||
|
.uri("/api/runtime/profile/save-archives")
|
||||||
|
.body(Body::empty())
|
||||||
|
.expect("request should build"),
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
.expect("request should succeed");
|
||||||
|
|
||||||
|
assert_eq!(response.status(), StatusCode::UNAUTHORIZED);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[tokio::test]
|
||||||
|
async fn profile_save_archives_compat_route_matches_main_route_error_shape() {
|
||||||
|
assert_compat_route_matches_main_route_error_shape(
|
||||||
|
"/api/runtime/profile/save-archives",
|
||||||
|
"/api/profile/save-archives",
|
||||||
|
)
|
||||||
|
.await;
|
||||||
|
}
|
||||||
|
|
||||||
|
#[tokio::test]
|
||||||
|
async fn resume_profile_save_archive_rejects_blank_world_key() {
|
||||||
|
let state = seed_authenticated_state().await;
|
||||||
|
let token = issue_access_token(&state);
|
||||||
|
let app = build_router(state);
|
||||||
|
|
||||||
|
let response = app
|
||||||
|
.oneshot(
|
||||||
|
Request::builder()
|
||||||
|
.method("POST")
|
||||||
|
.uri("/api/runtime/profile/save-archives/%20%20")
|
||||||
|
.header("authorization", format!("Bearer {token}"))
|
||||||
|
.header("x-genarrative-response-envelope", "v1")
|
||||||
|
.body(Body::empty())
|
||||||
|
.expect("request should build"),
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
.expect("request should succeed");
|
||||||
|
|
||||||
|
assert_eq!(response.status(), StatusCode::BAD_REQUEST);
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn assert_compat_route_matches_main_route_error_shape(
|
||||||
|
main_route: &str,
|
||||||
|
compat_route: &str,
|
||||||
|
) {
|
||||||
|
let state = seed_authenticated_state().await;
|
||||||
|
let token = issue_access_token(&state);
|
||||||
|
let app = build_router(state);
|
||||||
|
|
||||||
|
let main_response = app
|
||||||
|
.clone()
|
||||||
|
.oneshot(
|
||||||
|
Request::builder()
|
||||||
|
.method("GET")
|
||||||
|
.uri(main_route)
|
||||||
|
.header("authorization", format!("Bearer {token}"))
|
||||||
|
.header("x-genarrative-response-envelope", "v1")
|
||||||
|
.body(Body::empty())
|
||||||
|
.expect("request should build"),
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
.expect("request should succeed");
|
||||||
|
|
||||||
|
let compat_response = app
|
||||||
|
.oneshot(
|
||||||
|
Request::builder()
|
||||||
|
.method("GET")
|
||||||
|
.uri(compat_route)
|
||||||
|
.header("authorization", format!("Bearer {token}"))
|
||||||
|
.header("x-genarrative-response-envelope", "v1")
|
||||||
|
.body(Body::empty())
|
||||||
|
.expect("request should build"),
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
.expect("request should succeed");
|
||||||
|
|
||||||
|
assert_eq!(main_response.status(), compat_response.status());
|
||||||
|
|
||||||
|
let main_payload: Value = serde_json::from_slice(
|
||||||
|
&main_response
|
||||||
|
.into_body()
|
||||||
|
.collect()
|
||||||
|
.await
|
||||||
|
.expect("body should collect")
|
||||||
|
.to_bytes(),
|
||||||
|
)
|
||||||
|
.expect("response body should be valid json");
|
||||||
|
let compat_payload: Value = serde_json::from_slice(
|
||||||
|
&compat_response
|
||||||
|
.into_body()
|
||||||
|
.collect()
|
||||||
|
.await
|
||||||
|
.expect("body should collect")
|
||||||
|
.to_bytes(),
|
||||||
|
)
|
||||||
|
.expect("response body should be valid json");
|
||||||
|
|
||||||
|
assert_eq!(
|
||||||
|
main_payload["error"]["details"]["provider"],
|
||||||
|
compat_payload["error"]["details"]["provider"]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn seed_authenticated_state() -> AppState {
|
||||||
|
let state = AppState::new(AppConfig::default()).expect("state should build");
|
||||||
|
state
|
||||||
|
.password_entry_service()
|
||||||
|
.execute(module_auth::PasswordEntryInput {
|
||||||
|
username: "runtime_save_user".to_string(),
|
||||||
|
password: "secret123".to_string(),
|
||||||
|
})
|
||||||
|
.await
|
||||||
|
.expect("seed login should succeed");
|
||||||
|
state
|
||||||
|
}
|
||||||
|
|
||||||
|
fn issue_access_token(state: &AppState) -> String {
|
||||||
|
let claims = AccessTokenClaims::from_input(
|
||||||
|
AccessTokenClaimsInput {
|
||||||
|
user_id: "user_00000001".to_string(),
|
||||||
|
session_id: "sess_runtime_save".to_string(),
|
||||||
|
provider: AuthProvider::Password,
|
||||||
|
roles: vec!["user".to_string()],
|
||||||
|
token_version: 1,
|
||||||
|
phone_verified: true,
|
||||||
|
binding_status: BindingStatus::Active,
|
||||||
|
display_name: Some("存档用户".to_string()),
|
||||||
|
},
|
||||||
|
state.auth_jwt_config(),
|
||||||
|
OffsetDateTime::now_utc(),
|
||||||
|
)
|
||||||
|
.expect("claims should build");
|
||||||
|
|
||||||
|
sign_access_token(&claims, state.auth_jwt_config()).expect("token should sign")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -10,6 +10,7 @@ spacetime-types = ["dep:spacetimedb"]
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
serde = { version = "1", features = ["derive"] }
|
serde = { version = "1", features = ["derive"] }
|
||||||
|
serde_json = "1"
|
||||||
shared-kernel = { path = "../shared-kernel" }
|
shared-kernel = { path = "../shared-kernel" }
|
||||||
spacetimedb = { workspace = true, optional = true }
|
spacetimedb = { workspace = true, optional = true }
|
||||||
time = { version = "0.3", features = ["formatting", "parsing"] }
|
time = { version = "0.3", features = ["formatting", "parsing"] }
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
use serde_json::Value;
|
||||||
use shared_kernel::{
|
use shared_kernel::{
|
||||||
format_rfc3339 as format_shared_rfc3339, normalize_optional_string, normalize_required_string,
|
format_rfc3339 as format_shared_rfc3339, normalize_optional_string, normalize_required_string,
|
||||||
parse_rfc3339 as parse_shared_rfc3339,
|
parse_rfc3339 as parse_shared_rfc3339,
|
||||||
@@ -14,6 +15,8 @@ pub const DEFAULT_PLATFORM_THEME: RuntimePlatformTheme = RuntimePlatformTheme::L
|
|||||||
pub const DEFAULT_BROWSE_HISTORY_AUTHOR_DISPLAY_NAME: &str = "玩家";
|
pub const DEFAULT_BROWSE_HISTORY_AUTHOR_DISPLAY_NAME: &str = "玩家";
|
||||||
pub const MAX_BROWSE_HISTORY_BATCH_SIZE: usize = 100;
|
pub const MAX_BROWSE_HISTORY_BATCH_SIZE: usize = 100;
|
||||||
pub const PROFILE_WALLET_LEDGER_LIST_LIMIT: usize = 50;
|
pub const PROFILE_WALLET_LEDGER_LIST_LIMIT: usize = 50;
|
||||||
|
pub const SAVE_SNAPSHOT_VERSION: u32 = 2;
|
||||||
|
pub const DEFAULT_SAVE_ARCHIVE_SUMMARY_TEXT: &str = "继续推进上一次保存的故事。";
|
||||||
|
|
||||||
// 运行时设置目前只冻结 light/dark 两种主题,避免各层散落字符串字面量。
|
// 运行时设置目前只冻结 light/dark 两种主题,避免各层散落字符串字面量。
|
||||||
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
||||||
@@ -29,6 +32,94 @@ pub struct RuntimeSettings {
|
|||||||
pub platform_theme: RuntimePlatformTheme,
|
pub platform_theme: RuntimePlatformTheme,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
||||||
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
|
pub struct RuntimeSnapshot {
|
||||||
|
pub user_id: String,
|
||||||
|
pub version: u32,
|
||||||
|
pub saved_at_micros: i64,
|
||||||
|
pub bottom_tab: String,
|
||||||
|
pub game_state_json: String,
|
||||||
|
pub current_story_json: Option<String>,
|
||||||
|
pub created_at_micros: i64,
|
||||||
|
pub updated_at_micros: i64,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
||||||
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
|
pub struct RuntimeSnapshotProcedureResult {
|
||||||
|
pub ok: bool,
|
||||||
|
pub record: Option<RuntimeSnapshot>,
|
||||||
|
pub error_message: Option<String>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
||||||
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
|
pub struct RuntimeSnapshotGetInput {
|
||||||
|
pub user_id: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
||||||
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
|
pub struct RuntimeSnapshotUpsertInput {
|
||||||
|
pub user_id: String,
|
||||||
|
pub saved_at_micros: i64,
|
||||||
|
pub bottom_tab: String,
|
||||||
|
pub game_state_json: String,
|
||||||
|
pub current_story_json: Option<String>,
|
||||||
|
pub updated_at_micros: i64,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
||||||
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
|
pub struct RuntimeSnapshotDeleteInput {
|
||||||
|
pub user_id: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
||||||
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
|
pub struct RuntimeProfileSaveArchiveSnapshot {
|
||||||
|
pub archive_id: String,
|
||||||
|
pub user_id: String,
|
||||||
|
pub world_key: String,
|
||||||
|
pub owner_user_id: Option<String>,
|
||||||
|
pub profile_id: Option<String>,
|
||||||
|
pub world_type: Option<String>,
|
||||||
|
pub world_name: String,
|
||||||
|
pub subtitle: String,
|
||||||
|
pub summary_text: String,
|
||||||
|
pub cover_image_src: Option<String>,
|
||||||
|
pub saved_at_micros: i64,
|
||||||
|
pub bottom_tab: String,
|
||||||
|
pub game_state_json: String,
|
||||||
|
pub current_story_json: Option<String>,
|
||||||
|
pub created_at_micros: i64,
|
||||||
|
pub updated_at_micros: i64,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
||||||
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
|
pub struct RuntimeProfileSaveArchiveProcedureResult {
|
||||||
|
pub ok: bool,
|
||||||
|
pub entries: Vec<RuntimeProfileSaveArchiveSnapshot>,
|
||||||
|
pub record: Option<RuntimeProfileSaveArchiveSnapshot>,
|
||||||
|
pub current_snapshot: Option<RuntimeSnapshot>,
|
||||||
|
pub error_message: Option<String>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
||||||
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
|
pub struct RuntimeProfileSaveArchiveListInput {
|
||||||
|
pub user_id: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
||||||
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
|
pub struct RuntimeProfileSaveArchiveResumeInput {
|
||||||
|
pub user_id: String,
|
||||||
|
pub world_key: String,
|
||||||
|
}
|
||||||
|
|
||||||
// 浏览历史沿用平台已有的六种世界主题,但独立冻结在 runtime 领域内,避免反向耦合创作域 crate。
|
// 浏览历史沿用平台已有的六种世界主题,但独立冻结在 runtime 领域内,避免反向耦合创作域 crate。
|
||||||
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
||||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
@@ -242,6 +333,10 @@ pub enum RuntimeBrowseHistoryFieldError {
|
|||||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||||
pub enum RuntimeProfileFieldError {
|
pub enum RuntimeProfileFieldError {
|
||||||
MissingUserId,
|
MissingUserId,
|
||||||
|
MissingWorldKey,
|
||||||
|
MissingBottomTab,
|
||||||
|
InvalidGameStateJson,
|
||||||
|
InvalidCurrentStoryJson,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq)]
|
#[derive(Clone, Debug, PartialEq)]
|
||||||
@@ -444,6 +539,44 @@ pub struct RuntimeProfilePlayStatsRecord {
|
|||||||
pub updated_at_micros: Option<i64>,
|
pub updated_at_micros: Option<i64>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, PartialEq)]
|
||||||
|
pub struct RuntimeSnapshotRecord {
|
||||||
|
pub user_id: String,
|
||||||
|
pub version: u32,
|
||||||
|
pub saved_at: String,
|
||||||
|
pub saved_at_micros: i64,
|
||||||
|
pub bottom_tab: String,
|
||||||
|
pub game_state: Value,
|
||||||
|
pub current_story: Option<Value>,
|
||||||
|
pub game_state_json: String,
|
||||||
|
pub current_story_json: Option<String>,
|
||||||
|
pub created_at_micros: i64,
|
||||||
|
pub updated_at_micros: i64,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, PartialEq)]
|
||||||
|
pub struct RuntimeProfileSaveArchiveRecord {
|
||||||
|
pub archive_id: String,
|
||||||
|
pub user_id: String,
|
||||||
|
pub world_key: String,
|
||||||
|
pub owner_user_id: Option<String>,
|
||||||
|
pub profile_id: Option<String>,
|
||||||
|
pub world_type: Option<String>,
|
||||||
|
pub world_name: String,
|
||||||
|
pub subtitle: String,
|
||||||
|
pub summary_text: String,
|
||||||
|
pub cover_image_src: Option<String>,
|
||||||
|
pub saved_at: String,
|
||||||
|
pub saved_at_micros: i64,
|
||||||
|
pub bottom_tab: String,
|
||||||
|
pub game_state: Value,
|
||||||
|
pub current_story: Option<Value>,
|
||||||
|
pub game_state_json: String,
|
||||||
|
pub current_story_json: Option<String>,
|
||||||
|
pub created_at_micros: i64,
|
||||||
|
pub updated_at_micros: i64,
|
||||||
|
}
|
||||||
|
|
||||||
pub fn build_runtime_browse_history_list_input(
|
pub fn build_runtime_browse_history_list_input(
|
||||||
user_id: String,
|
user_id: String,
|
||||||
) -> Result<RuntimeBrowseHistoryListInput, RuntimeBrowseHistoryFieldError> {
|
) -> Result<RuntimeBrowseHistoryListInput, RuntimeBrowseHistoryFieldError> {
|
||||||
@@ -472,6 +605,37 @@ pub fn build_runtime_profile_play_stats_get_input(
|
|||||||
Ok(RuntimeProfilePlayStatsGetInput { user_id })
|
Ok(RuntimeProfilePlayStatsGetInput { user_id })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn build_runtime_snapshot_get_input(
|
||||||
|
user_id: String,
|
||||||
|
) -> Result<RuntimeSnapshotGetInput, RuntimeProfileFieldError> {
|
||||||
|
let user_id = normalize_runtime_profile_user_id(user_id)?;
|
||||||
|
Ok(RuntimeSnapshotGetInput { user_id })
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn build_runtime_snapshot_delete_input(
|
||||||
|
user_id: String,
|
||||||
|
) -> Result<RuntimeSnapshotDeleteInput, RuntimeProfileFieldError> {
|
||||||
|
let user_id = normalize_runtime_profile_user_id(user_id)?;
|
||||||
|
Ok(RuntimeSnapshotDeleteInput { user_id })
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn build_runtime_profile_save_archive_list_input(
|
||||||
|
user_id: String,
|
||||||
|
) -> Result<RuntimeProfileSaveArchiveListInput, RuntimeProfileFieldError> {
|
||||||
|
let user_id = normalize_runtime_profile_user_id(user_id)?;
|
||||||
|
Ok(RuntimeProfileSaveArchiveListInput { user_id })
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn build_runtime_profile_save_archive_resume_input(
|
||||||
|
user_id: String,
|
||||||
|
world_key: String,
|
||||||
|
) -> Result<RuntimeProfileSaveArchiveResumeInput, RuntimeProfileFieldError> {
|
||||||
|
let user_id = normalize_runtime_profile_user_id(user_id)?;
|
||||||
|
let world_key =
|
||||||
|
normalize_required_string(world_key).ok_or(RuntimeProfileFieldError::MissingWorldKey)?;
|
||||||
|
Ok(RuntimeProfileSaveArchiveResumeInput { user_id, world_key })
|
||||||
|
}
|
||||||
|
|
||||||
pub fn build_runtime_browse_history_clear_input(
|
pub fn build_runtime_browse_history_clear_input(
|
||||||
user_id: String,
|
user_id: String,
|
||||||
) -> Result<RuntimeBrowseHistoryClearInput, RuntimeBrowseHistoryFieldError> {
|
) -> Result<RuntimeBrowseHistoryClearInput, RuntimeBrowseHistoryFieldError> {
|
||||||
@@ -479,6 +643,31 @@ pub fn build_runtime_browse_history_clear_input(
|
|||||||
Ok(RuntimeBrowseHistoryClearInput { user_id })
|
Ok(RuntimeBrowseHistoryClearInput { user_id })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn build_runtime_snapshot_upsert_input(
|
||||||
|
user_id: String,
|
||||||
|
saved_at_micros: i64,
|
||||||
|
bottom_tab: String,
|
||||||
|
game_state: Value,
|
||||||
|
current_story: Option<Value>,
|
||||||
|
updated_at_micros: i64,
|
||||||
|
) -> Result<RuntimeSnapshotUpsertInput, RuntimeProfileFieldError> {
|
||||||
|
let user_id = normalize_runtime_profile_user_id(user_id)?;
|
||||||
|
let bottom_tab = normalize_bottom_tab(bottom_tab)
|
||||||
|
.ok_or(RuntimeProfileFieldError::MissingBottomTab)?;
|
||||||
|
let game_state_json =
|
||||||
|
serde_json::to_string(&game_state).map_err(|_| RuntimeProfileFieldError::InvalidGameStateJson)?;
|
||||||
|
let current_story_json = normalize_current_story_json(current_story)?;
|
||||||
|
|
||||||
|
Ok(RuntimeSnapshotUpsertInput {
|
||||||
|
user_id,
|
||||||
|
saved_at_micros,
|
||||||
|
bottom_tab,
|
||||||
|
game_state_json,
|
||||||
|
current_story_json,
|
||||||
|
updated_at_micros,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
pub fn build_runtime_browse_history_sync_input(
|
pub fn build_runtime_browse_history_sync_input(
|
||||||
user_id: String,
|
user_id: String,
|
||||||
entries: Vec<RuntimeBrowseHistoryWriteInput>,
|
entries: Vec<RuntimeBrowseHistoryWriteInput>,
|
||||||
@@ -669,6 +858,64 @@ pub fn build_runtime_profile_play_stats_record(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn build_runtime_snapshot_record(
|
||||||
|
snapshot: RuntimeSnapshot,
|
||||||
|
) -> Result<RuntimeSnapshotRecord, RuntimeProfileFieldError> {
|
||||||
|
let game_state = serde_json::from_str::<Value>(&snapshot.game_state_json)
|
||||||
|
.map_err(|_| RuntimeProfileFieldError::InvalidGameStateJson)?;
|
||||||
|
let current_story = parse_optional_json_value(
|
||||||
|
snapshot.current_story_json.as_deref(),
|
||||||
|
RuntimeProfileFieldError::InvalidCurrentStoryJson,
|
||||||
|
)?;
|
||||||
|
|
||||||
|
Ok(RuntimeSnapshotRecord {
|
||||||
|
user_id: snapshot.user_id,
|
||||||
|
version: snapshot.version,
|
||||||
|
saved_at: format_utc_micros(snapshot.saved_at_micros),
|
||||||
|
saved_at_micros: snapshot.saved_at_micros,
|
||||||
|
bottom_tab: snapshot.bottom_tab,
|
||||||
|
game_state,
|
||||||
|
current_story,
|
||||||
|
game_state_json: snapshot.game_state_json,
|
||||||
|
current_story_json: snapshot.current_story_json,
|
||||||
|
created_at_micros: snapshot.created_at_micros,
|
||||||
|
updated_at_micros: snapshot.updated_at_micros,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn build_runtime_profile_save_archive_record(
|
||||||
|
snapshot: RuntimeProfileSaveArchiveSnapshot,
|
||||||
|
) -> Result<RuntimeProfileSaveArchiveRecord, RuntimeProfileFieldError> {
|
||||||
|
let game_state = serde_json::from_str::<Value>(&snapshot.game_state_json)
|
||||||
|
.map_err(|_| RuntimeProfileFieldError::InvalidGameStateJson)?;
|
||||||
|
let current_story = parse_optional_json_value(
|
||||||
|
snapshot.current_story_json.as_deref(),
|
||||||
|
RuntimeProfileFieldError::InvalidCurrentStoryJson,
|
||||||
|
)?;
|
||||||
|
|
||||||
|
Ok(RuntimeProfileSaveArchiveRecord {
|
||||||
|
archive_id: snapshot.archive_id,
|
||||||
|
user_id: snapshot.user_id,
|
||||||
|
world_key: snapshot.world_key,
|
||||||
|
owner_user_id: snapshot.owner_user_id,
|
||||||
|
profile_id: snapshot.profile_id,
|
||||||
|
world_type: snapshot.world_type,
|
||||||
|
world_name: snapshot.world_name,
|
||||||
|
subtitle: snapshot.subtitle,
|
||||||
|
summary_text: snapshot.summary_text,
|
||||||
|
cover_image_src: snapshot.cover_image_src,
|
||||||
|
saved_at: format_utc_micros(snapshot.saved_at_micros),
|
||||||
|
saved_at_micros: snapshot.saved_at_micros,
|
||||||
|
bottom_tab: snapshot.bottom_tab,
|
||||||
|
game_state,
|
||||||
|
current_story,
|
||||||
|
game_state_json: snapshot.game_state_json,
|
||||||
|
current_story_json: snapshot.current_story_json,
|
||||||
|
created_at_micros: snapshot.created_at_micros,
|
||||||
|
updated_at_micros: snapshot.updated_at_micros,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
pub fn build_runtime_browse_history_id(
|
pub fn build_runtime_browse_history_id(
|
||||||
user_id: &str,
|
user_id: &str,
|
||||||
owner_user_id: &str,
|
owner_user_id: &str,
|
||||||
@@ -693,6 +940,43 @@ fn parse_utc_rfc3339_to_micros(value: &str) -> Option<i64> {
|
|||||||
i64::try_from(nanos / 1_000).ok()
|
i64::try_from(nanos / 1_000).ok()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn normalize_bottom_tab(value: String) -> Option<String> {
|
||||||
|
let trimmed = normalize_required_string(value)?;
|
||||||
|
let normalized = match trimmed.as_str() {
|
||||||
|
"character" | "inventory" => trimmed,
|
||||||
|
_ => "adventure".to_string(),
|
||||||
|
};
|
||||||
|
|
||||||
|
Some(normalized)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn normalize_current_story_json(
|
||||||
|
current_story: Option<Value>,
|
||||||
|
) -> Result<Option<String>, RuntimeProfileFieldError> {
|
||||||
|
let Some(current_story) = current_story else {
|
||||||
|
return Ok(None);
|
||||||
|
};
|
||||||
|
if !current_story.is_object() {
|
||||||
|
return Ok(None);
|
||||||
|
}
|
||||||
|
|
||||||
|
serde_json::to_string(¤t_story)
|
||||||
|
.map(Some)
|
||||||
|
.map_err(|_| RuntimeProfileFieldError::InvalidCurrentStoryJson)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn parse_optional_json_value(
|
||||||
|
raw: Option<&str>,
|
||||||
|
error: RuntimeProfileFieldError,
|
||||||
|
) -> Result<Option<Value>, RuntimeProfileFieldError> {
|
||||||
|
match raw.map(str::trim).filter(|value| !value.is_empty()) {
|
||||||
|
Some(value) => serde_json::from_str::<Value>(value)
|
||||||
|
.map(Some)
|
||||||
|
.map_err(|_| error),
|
||||||
|
None => Ok(None),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl std::fmt::Display for RuntimeSettingsFieldError {
|
impl std::fmt::Display for RuntimeSettingsFieldError {
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
match self {
|
match self {
|
||||||
@@ -726,6 +1010,12 @@ impl std::fmt::Display for RuntimeProfileFieldError {
|
|||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
match self {
|
match self {
|
||||||
Self::MissingUserId => f.write_str("profile.user_id 不能为空"),
|
Self::MissingUserId => f.write_str("profile.user_id 不能为空"),
|
||||||
|
Self::MissingWorldKey => f.write_str("profile.world_key 不能为空"),
|
||||||
|
Self::MissingBottomTab => f.write_str("runtime_snapshot.bottom_tab 不能为空"),
|
||||||
|
Self::InvalidGameStateJson => f.write_str("runtime_snapshot.game_state 必须是合法 JSON"),
|
||||||
|
Self::InvalidCurrentStoryJson => {
|
||||||
|
f.write_str("runtime_snapshot.current_story 必须是合法 JSON object 或 null")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ use serde::{Deserialize, Serialize};
|
|||||||
|
|
||||||
pub const RUNTIME_PLATFORM_THEME_LIGHT: &str = "light";
|
pub const RUNTIME_PLATFORM_THEME_LIGHT: &str = "light";
|
||||||
pub const RUNTIME_PLATFORM_THEME_DARK: &str = "dark";
|
pub const RUNTIME_PLATFORM_THEME_DARK: &str = "dark";
|
||||||
|
pub const SAVE_SNAPSHOT_VERSION: u32 = 2;
|
||||||
pub const PROFILE_WALLET_LEDGER_SOURCE_TYPE_SNAPSHOT_SYNC: &str = "snapshot_sync";
|
pub const PROFILE_WALLET_LEDGER_SOURCE_TYPE_SNAPSHOT_SYNC: &str = "snapshot_sync";
|
||||||
pub const BROWSE_HISTORY_THEME_MODE_MARTIAL: &str = "martial";
|
pub const BROWSE_HISTORY_THEME_MODE_MARTIAL: &str = "martial";
|
||||||
pub const BROWSE_HISTORY_THEME_MODE_ARCANE: &str = "arcane";
|
pub const BROWSE_HISTORY_THEME_MODE_ARCANE: &str = "arcane";
|
||||||
@@ -26,6 +27,33 @@ pub struct PutRuntimeSettingsRequest {
|
|||||||
pub platform_theme: String,
|
pub platform_theme: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||||
|
#[serde(rename_all = "camelCase")]
|
||||||
|
pub struct SavedGameSnapshotResponse {
|
||||||
|
pub version: u32,
|
||||||
|
pub saved_at: String,
|
||||||
|
pub game_state: serde_json::Value,
|
||||||
|
pub bottom_tab: String,
|
||||||
|
pub current_story: Option<serde_json::Value>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||||
|
#[serde(rename_all = "camelCase")]
|
||||||
|
pub struct PutSavedGameSnapshotRequest {
|
||||||
|
pub game_state: serde_json::Value,
|
||||||
|
pub bottom_tab: String,
|
||||||
|
#[serde(default)]
|
||||||
|
pub current_story: Option<serde_json::Value>,
|
||||||
|
#[serde(default)]
|
||||||
|
pub saved_at: Option<String>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||||
|
#[serde(rename_all = "camelCase")]
|
||||||
|
pub struct BasicOkResponse {
|
||||||
|
pub ok: bool,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct PlatformBrowseHistoryEntryResponse {
|
pub struct PlatformBrowseHistoryEntryResponse {
|
||||||
@@ -135,6 +163,33 @@ pub struct ProfilePlayStatsResponse {
|
|||||||
pub updated_at: Option<String>,
|
pub updated_at: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||||
|
#[serde(rename_all = "camelCase")]
|
||||||
|
pub struct ProfileSaveArchiveSummaryResponse {
|
||||||
|
pub world_key: String,
|
||||||
|
pub owner_user_id: Option<String>,
|
||||||
|
pub profile_id: Option<String>,
|
||||||
|
pub world_type: Option<String>,
|
||||||
|
pub world_name: String,
|
||||||
|
pub subtitle: String,
|
||||||
|
pub summary_text: String,
|
||||||
|
pub cover_image_src: Option<String>,
|
||||||
|
pub last_played_at: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||||
|
#[serde(rename_all = "camelCase")]
|
||||||
|
pub struct ProfileSaveArchiveListResponse {
|
||||||
|
pub entries: Vec<ProfileSaveArchiveSummaryResponse>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||||
|
#[serde(rename_all = "camelCase")]
|
||||||
|
pub struct ProfileSaveArchiveResumeResponse {
|
||||||
|
pub entry: ProfileSaveArchiveSummaryResponse,
|
||||||
|
pub snapshot: SavedGameSnapshotResponse,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct RuntimeInventorySlotResponse {
|
pub struct RuntimeInventorySlotResponse {
|
||||||
@@ -234,6 +289,43 @@ pub struct CustomWorldGalleryDetailResponse {
|
|||||||
pub entry: CustomWorldLibraryEntryResponse,
|
pub entry: CustomWorldLibraryEntryResponse,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||||
|
#[serde(rename_all = "camelCase")]
|
||||||
|
pub struct CustomWorldWorkSummaryResponse {
|
||||||
|
pub work_id: String,
|
||||||
|
pub source_type: String,
|
||||||
|
pub status: String,
|
||||||
|
pub title: String,
|
||||||
|
pub subtitle: String,
|
||||||
|
pub summary: String,
|
||||||
|
pub cover_image_src: Option<String>,
|
||||||
|
#[serde(default)]
|
||||||
|
pub cover_render_mode: Option<String>,
|
||||||
|
#[serde(default)]
|
||||||
|
pub cover_character_image_srcs: Vec<String>,
|
||||||
|
pub updated_at: String,
|
||||||
|
pub published_at: Option<String>,
|
||||||
|
pub stage: Option<String>,
|
||||||
|
pub stage_label: Option<String>,
|
||||||
|
pub playable_npc_count: u32,
|
||||||
|
pub landmark_count: u32,
|
||||||
|
pub role_visual_ready_count: Option<u32>,
|
||||||
|
pub role_animation_ready_count: Option<u32>,
|
||||||
|
pub role_asset_summary_label: Option<String>,
|
||||||
|
pub session_id: Option<String>,
|
||||||
|
pub profile_id: Option<String>,
|
||||||
|
pub can_resume: bool,
|
||||||
|
pub can_enter_world: bool,
|
||||||
|
pub blocker_count: u32,
|
||||||
|
pub publish_ready: bool,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||||
|
#[serde(rename_all = "camelCase")]
|
||||||
|
pub struct CustomWorldWorksResponse {
|
||||||
|
pub items: Vec<CustomWorldWorkSummaryResponse>,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct CreateCustomWorldAgentSessionRequest {
|
pub struct CreateCustomWorldAgentSessionRequest {
|
||||||
@@ -293,6 +385,36 @@ pub struct CustomWorldDraftCardSummaryResponse {
|
|||||||
pub asset_status_label: Option<String>,
|
pub asset_status_label: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||||
|
#[serde(rename_all = "camelCase")]
|
||||||
|
pub struct CustomWorldDraftCardDetailSectionResponse {
|
||||||
|
pub id: String,
|
||||||
|
pub label: String,
|
||||||
|
pub value: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||||
|
#[serde(rename_all = "camelCase")]
|
||||||
|
pub struct CustomWorldDraftCardDetailResponse {
|
||||||
|
pub id: String,
|
||||||
|
pub kind: String,
|
||||||
|
pub title: String,
|
||||||
|
pub sections: Vec<CustomWorldDraftCardDetailSectionResponse>,
|
||||||
|
pub linked_ids: Vec<String>,
|
||||||
|
pub locked: bool,
|
||||||
|
pub editable: bool,
|
||||||
|
pub editable_section_ids: Vec<String>,
|
||||||
|
pub warning_messages: Vec<String>,
|
||||||
|
pub asset_status: Option<String>,
|
||||||
|
pub asset_status_label: Option<String>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||||
|
#[serde(rename_all = "camelCase")]
|
||||||
|
pub struct CustomWorldAgentCardDetailResponse {
|
||||||
|
pub card: CustomWorldDraftCardDetailResponse,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct CustomWorldAgentCheckpointResponse {
|
pub struct CustomWorldAgentCheckpointResponse {
|
||||||
@@ -309,6 +431,24 @@ pub struct CustomWorldSupportedActionResponse {
|
|||||||
pub reason: Option<String>,
|
pub reason: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||||
|
#[serde(rename_all = "camelCase")]
|
||||||
|
pub struct CustomWorldResultPreviewBlockerResponse {
|
||||||
|
pub id: String,
|
||||||
|
pub code: String,
|
||||||
|
pub message: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||||
|
#[serde(rename_all = "camelCase")]
|
||||||
|
pub struct CustomWorldPublishGateResponse {
|
||||||
|
pub profile_id: String,
|
||||||
|
pub blockers: Vec<CustomWorldResultPreviewBlockerResponse>,
|
||||||
|
pub blocker_count: u32,
|
||||||
|
pub publish_ready: bool,
|
||||||
|
pub can_enter_world: bool,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct CustomWorldAgentSessionSnapshotResponse {
|
pub struct CustomWorldAgentSessionSnapshotResponse {
|
||||||
@@ -333,6 +473,7 @@ pub struct CustomWorldAgentSessionSnapshotResponse {
|
|||||||
pub asset_coverage: serde_json::Value,
|
pub asset_coverage: serde_json::Value,
|
||||||
pub checkpoints: Vec<CustomWorldAgentCheckpointResponse>,
|
pub checkpoints: Vec<CustomWorldAgentCheckpointResponse>,
|
||||||
pub supported_actions: Vec<CustomWorldSupportedActionResponse>,
|
pub supported_actions: Vec<CustomWorldSupportedActionResponse>,
|
||||||
|
pub publish_gate: Option<CustomWorldPublishGateResponse>,
|
||||||
pub result_preview: Option<serde_json::Value>,
|
pub result_preview: Option<serde_json::Value>,
|
||||||
pub updated_at: String,
|
pub updated_at: String,
|
||||||
}
|
}
|
||||||
@@ -343,6 +484,67 @@ pub struct CustomWorldAgentSessionResponse {
|
|||||||
pub session: CustomWorldAgentSessionSnapshotResponse,
|
pub session: CustomWorldAgentSessionSnapshotResponse,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||||
|
#[serde(rename_all = "camelCase")]
|
||||||
|
pub struct ExecuteCustomWorldAgentActionRequest {
|
||||||
|
pub action: String,
|
||||||
|
#[serde(default)]
|
||||||
|
pub profile_id: Option<String>,
|
||||||
|
#[serde(default)]
|
||||||
|
pub draft_profile: Option<serde_json::Value>,
|
||||||
|
#[serde(default)]
|
||||||
|
pub legacy_result_profile: Option<serde_json::Value>,
|
||||||
|
#[serde(default)]
|
||||||
|
pub setting_text: Option<String>,
|
||||||
|
#[serde(default)]
|
||||||
|
pub card_id: Option<String>,
|
||||||
|
#[serde(default)]
|
||||||
|
pub sections: Option<Vec<ExecuteCustomWorldAgentDraftCardSectionPatch>>,
|
||||||
|
#[serde(default)]
|
||||||
|
pub profile: Option<serde_json::Value>,
|
||||||
|
#[serde(default)]
|
||||||
|
pub count: Option<u32>,
|
||||||
|
#[serde(default)]
|
||||||
|
pub prompt_text: Option<String>,
|
||||||
|
#[serde(default)]
|
||||||
|
pub anchor_card_ids: Option<Vec<String>>,
|
||||||
|
#[serde(default)]
|
||||||
|
pub role_ids: Option<Vec<String>>,
|
||||||
|
#[serde(default)]
|
||||||
|
pub role_id: Option<String>,
|
||||||
|
#[serde(default)]
|
||||||
|
pub portrait_path: Option<String>,
|
||||||
|
#[serde(default)]
|
||||||
|
pub generated_visual_asset_id: Option<String>,
|
||||||
|
#[serde(default)]
|
||||||
|
pub generated_animation_set_id: Option<String>,
|
||||||
|
#[serde(default)]
|
||||||
|
pub animation_map: Option<serde_json::Value>,
|
||||||
|
#[serde(default)]
|
||||||
|
pub scene_ids: Option<Vec<String>>,
|
||||||
|
#[serde(default)]
|
||||||
|
pub scene_id: Option<String>,
|
||||||
|
#[serde(default)]
|
||||||
|
pub scene_kind: Option<String>,
|
||||||
|
#[serde(default)]
|
||||||
|
pub image_src: Option<String>,
|
||||||
|
#[serde(default)]
|
||||||
|
pub generated_scene_asset_id: Option<String>,
|
||||||
|
#[serde(default)]
|
||||||
|
pub generated_scene_prompt: Option<String>,
|
||||||
|
#[serde(default)]
|
||||||
|
pub generated_scene_model: Option<String>,
|
||||||
|
#[serde(default)]
|
||||||
|
pub checkpoint_id: Option<String>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||||
|
#[serde(rename_all = "camelCase")]
|
||||||
|
pub struct ExecuteCustomWorldAgentDraftCardSectionPatch {
|
||||||
|
pub section_id: String,
|
||||||
|
pub value: String,
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|||||||
@@ -65,6 +65,11 @@ pub fn format_timestamp_micros(micros: i64) -> String {
|
|||||||
format!("{seconds}.{subsec_micros:06}Z")
|
format!("{seconds}.{subsec_micros:06}Z")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// 统一把 `OffsetDateTime` 转成 Unix 微秒时间戳,避免各模块重复手写纳秒除法。
|
||||||
|
pub fn offset_datetime_to_unix_micros(value: OffsetDateTime) -> i64 {
|
||||||
|
(value.unix_timestamp_nanos() / 1_000) as i64
|
||||||
|
}
|
||||||
|
|
||||||
/// 统一格式化 RFC3339 字符串,避免每个模块自己拼格式化错误文案。
|
/// 统一格式化 RFC3339 字符串,避免每个模块自己拼格式化错误文案。
|
||||||
pub fn format_rfc3339(value: OffsetDateTime) -> Result<String, String> {
|
pub fn format_rfc3339(value: OffsetDateTime) -> Result<String, String> {
|
||||||
value
|
value
|
||||||
@@ -127,6 +132,15 @@ mod tests {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn offset_datetime_to_unix_micros_is_stable() {
|
||||||
|
let value = OffsetDateTime::UNIX_EPOCH
|
||||||
|
+ time::Duration::seconds(1_713_686_401)
|
||||||
|
+ time::Duration::microseconds(234_567);
|
||||||
|
|
||||||
|
assert_eq!(offset_datetime_to_unix_micros(value), 1_713_686_401_234_567);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn format_and_parse_rfc3339_round_trip() {
|
fn format_and_parse_rfc3339_round_trip() {
|
||||||
let now = OffsetDateTime::UNIX_EPOCH + time::Duration::seconds(1_713_686_400);
|
let now = OffsetDateTime::UNIX_EPOCH + time::Duration::seconds(1_713_686_400);
|
||||||
|
|||||||
@@ -49,14 +49,19 @@ use module_npc::{
|
|||||||
use module_runtime::{
|
use module_runtime::{
|
||||||
RuntimeBrowseHistoryRecord, RuntimeBrowseHistoryThemeMode, RuntimePlatformTheme,
|
RuntimeBrowseHistoryRecord, RuntimeBrowseHistoryThemeMode, RuntimePlatformTheme,
|
||||||
RuntimeProfileDashboardRecord, RuntimeProfilePlayStatsRecord,
|
RuntimeProfileDashboardRecord, RuntimeProfilePlayStatsRecord,
|
||||||
|
RuntimeProfileSaveArchiveRecord,
|
||||||
RuntimeProfileWalletLedgerEntryRecord, RuntimeProfileWalletLedgerSourceType,
|
RuntimeProfileWalletLedgerEntryRecord, RuntimeProfileWalletLedgerSourceType,
|
||||||
RuntimeSettingsRecord, build_runtime_browse_history_clear_input,
|
RuntimeSettingsRecord, RuntimeSnapshotRecord, build_runtime_browse_history_clear_input,
|
||||||
build_runtime_browse_history_list_input, build_runtime_browse_history_record,
|
build_runtime_browse_history_list_input, build_runtime_browse_history_record,
|
||||||
build_runtime_browse_history_sync_input, build_runtime_profile_dashboard_get_input,
|
build_runtime_browse_history_sync_input, build_runtime_profile_dashboard_get_input,
|
||||||
build_runtime_profile_dashboard_record, build_runtime_profile_play_stats_get_input,
|
build_runtime_profile_dashboard_record, build_runtime_profile_play_stats_get_input,
|
||||||
build_runtime_profile_play_stats_record, build_runtime_profile_wallet_ledger_entry_record,
|
build_runtime_profile_play_stats_record, build_runtime_profile_save_archive_list_input,
|
||||||
|
build_runtime_profile_save_archive_record, build_runtime_profile_save_archive_resume_input,
|
||||||
|
build_runtime_profile_wallet_ledger_entry_record,
|
||||||
build_runtime_profile_wallet_ledger_list_input, build_runtime_setting_get_input,
|
build_runtime_profile_wallet_ledger_list_input, build_runtime_setting_get_input,
|
||||||
build_runtime_setting_record, build_runtime_setting_upsert_input,
|
build_runtime_setting_record, build_runtime_setting_upsert_input,
|
||||||
|
build_runtime_snapshot_delete_input, build_runtime_snapshot_get_input,
|
||||||
|
build_runtime_snapshot_record, build_runtime_snapshot_upsert_input,
|
||||||
};
|
};
|
||||||
use module_runtime_item::{
|
use module_runtime_item::{
|
||||||
RuntimeItemEquipmentSlot as DomainRuntimeItemEquipmentSlot,
|
RuntimeItemEquipmentSlot as DomainRuntimeItemEquipmentSlot,
|
||||||
@@ -160,6 +165,10 @@ use crate::module_bindings::{
|
|||||||
RuntimeProfileDashboardGetInput as BindingRuntimeProfileDashboardGetInput,
|
RuntimeProfileDashboardGetInput as BindingRuntimeProfileDashboardGetInput,
|
||||||
RuntimeProfileDashboardProcedureResult as BindingRuntimeProfileDashboardProcedureResult,
|
RuntimeProfileDashboardProcedureResult as BindingRuntimeProfileDashboardProcedureResult,
|
||||||
RuntimeProfileDashboardSnapshot as BindingRuntimeProfileDashboardSnapshot,
|
RuntimeProfileDashboardSnapshot as BindingRuntimeProfileDashboardSnapshot,
|
||||||
|
RuntimeProfileSaveArchiveListInput as BindingRuntimeProfileSaveArchiveListInput,
|
||||||
|
RuntimeProfileSaveArchiveProcedureResult as BindingRuntimeProfileSaveArchiveProcedureResult,
|
||||||
|
RuntimeProfileSaveArchiveResumeInput as BindingRuntimeProfileSaveArchiveResumeInput,
|
||||||
|
RuntimeProfileSaveArchiveSnapshot as BindingRuntimeProfileSaveArchiveSnapshot,
|
||||||
RuntimeProfilePlayStatsGetInput as BindingRuntimeProfilePlayStatsGetInput,
|
RuntimeProfilePlayStatsGetInput as BindingRuntimeProfilePlayStatsGetInput,
|
||||||
RuntimeProfilePlayStatsProcedureResult as BindingRuntimeProfilePlayStatsProcedureResult,
|
RuntimeProfilePlayStatsProcedureResult as BindingRuntimeProfilePlayStatsProcedureResult,
|
||||||
RuntimeProfilePlayStatsSnapshot as BindingRuntimeProfilePlayStatsSnapshot,
|
RuntimeProfilePlayStatsSnapshot as BindingRuntimeProfilePlayStatsSnapshot,
|
||||||
@@ -172,6 +181,11 @@ use crate::module_bindings::{
|
|||||||
RuntimeSettingProcedureResult as BindingRuntimeSettingProcedureResult,
|
RuntimeSettingProcedureResult as BindingRuntimeSettingProcedureResult,
|
||||||
RuntimeSettingSnapshot as BindingRuntimeSettingSnapshot,
|
RuntimeSettingSnapshot as BindingRuntimeSettingSnapshot,
|
||||||
RuntimeSettingUpsertInput as BindingRuntimeSettingUpsertInput,
|
RuntimeSettingUpsertInput as BindingRuntimeSettingUpsertInput,
|
||||||
|
RuntimeSnapshotDeleteInput as BindingRuntimeSnapshotDeleteInput,
|
||||||
|
RuntimeSnapshotGetInput as BindingRuntimeSnapshotGetInput,
|
||||||
|
RuntimeSnapshotProcedureResult as BindingRuntimeSnapshotProcedureResult,
|
||||||
|
RuntimeSnapshot as BindingRuntimeSnapshot,
|
||||||
|
RuntimeSnapshotUpsertInput as BindingRuntimeSnapshotUpsertInput,
|
||||||
StoryContinueInput as BindingStoryContinueInput, StoryEventKind as BindingStoryEventKind,
|
StoryContinueInput as BindingStoryContinueInput, StoryEventKind as BindingStoryEventKind,
|
||||||
StoryEventSnapshot as BindingStoryEventSnapshot, StorySessionInput as BindingStorySessionInput,
|
StoryEventSnapshot as BindingStoryEventSnapshot, StorySessionInput as BindingStorySessionInput,
|
||||||
StorySessionProcedureResult as BindingStorySessionProcedureResult,
|
StorySessionProcedureResult as BindingStorySessionProcedureResult,
|
||||||
@@ -192,6 +206,7 @@ use crate::module_bindings::{
|
|||||||
create_ai_task_and_return_procedure::create_ai_task_and_return as _,
|
create_ai_task_and_return_procedure::create_ai_task_and_return as _,
|
||||||
create_battle_state_and_return_procedure::create_battle_state_and_return as _,
|
create_battle_state_and_return_procedure::create_battle_state_and_return as _,
|
||||||
create_custom_world_agent_session_procedure::create_custom_world_agent_session as _,
|
create_custom_world_agent_session_procedure::create_custom_world_agent_session as _,
|
||||||
|
delete_runtime_snapshot_and_return_procedure::delete_runtime_snapshot_and_return as _,
|
||||||
fail_ai_task_and_return_procedure::fail_ai_task_and_return as _,
|
fail_ai_task_and_return_procedure::fail_ai_task_and_return as _,
|
||||||
get_battle_state_procedure::get_battle_state as _,
|
get_battle_state_procedure::get_battle_state as _,
|
||||||
get_custom_world_agent_operation_procedure::get_custom_world_agent_operation as _,
|
get_custom_world_agent_operation_procedure::get_custom_world_agent_operation as _,
|
||||||
@@ -202,15 +217,18 @@ use crate::module_bindings::{
|
|||||||
get_profile_play_stats_procedure::get_profile_play_stats as _,
|
get_profile_play_stats_procedure::get_profile_play_stats as _,
|
||||||
get_runtime_inventory_state_procedure::get_runtime_inventory_state as _,
|
get_runtime_inventory_state_procedure::get_runtime_inventory_state as _,
|
||||||
get_runtime_setting_or_default_procedure::get_runtime_setting_or_default as _,
|
get_runtime_setting_or_default_procedure::get_runtime_setting_or_default as _,
|
||||||
|
get_runtime_snapshot_procedure::get_runtime_snapshot as _,
|
||||||
get_story_session_state_procedure::get_story_session_state as _,
|
get_story_session_state_procedure::get_story_session_state as _,
|
||||||
list_custom_world_gallery_entries_procedure::list_custom_world_gallery_entries as _,
|
list_custom_world_gallery_entries_procedure::list_custom_world_gallery_entries as _,
|
||||||
list_custom_world_profiles_procedure::list_custom_world_profiles as _,
|
list_custom_world_profiles_procedure::list_custom_world_profiles as _,
|
||||||
list_platform_browse_history_procedure::list_platform_browse_history as _,
|
list_platform_browse_history_procedure::list_platform_browse_history as _,
|
||||||
|
list_profile_save_archives_procedure::list_profile_save_archives as _,
|
||||||
list_profile_wallet_ledger_procedure::list_profile_wallet_ledger as _,
|
list_profile_wallet_ledger_procedure::list_profile_wallet_ledger as _,
|
||||||
publish_custom_world_profile_and_return_procedure::publish_custom_world_profile_and_return as _,
|
publish_custom_world_profile_and_return_procedure::publish_custom_world_profile_and_return as _,
|
||||||
publish_custom_world_world_procedure::publish_custom_world_world as _,
|
publish_custom_world_world_procedure::publish_custom_world_world as _,
|
||||||
resolve_combat_action_and_return_procedure::resolve_combat_action_and_return as _,
|
resolve_combat_action_and_return_procedure::resolve_combat_action_and_return as _,
|
||||||
resolve_npc_battle_interaction_and_return_procedure::resolve_npc_battle_interaction_and_return as _,
|
resolve_npc_battle_interaction_and_return_procedure::resolve_npc_battle_interaction_and_return as _,
|
||||||
|
resume_profile_save_archive_and_return_procedure::resume_profile_save_archive_and_return as _,
|
||||||
start_ai_task_reducer::start_ai_task as _,
|
start_ai_task_reducer::start_ai_task as _,
|
||||||
start_ai_task_stage_reducer::start_ai_task_stage as _,
|
start_ai_task_stage_reducer::start_ai_task_stage as _,
|
||||||
submit_custom_world_agent_message_procedure::submit_custom_world_agent_message as _,
|
submit_custom_world_agent_message_procedure::submit_custom_world_agent_message as _,
|
||||||
@@ -218,6 +236,7 @@ use crate::module_bindings::{
|
|||||||
upsert_custom_world_profile_and_return_procedure::upsert_custom_world_profile_and_return as _,
|
upsert_custom_world_profile_and_return_procedure::upsert_custom_world_profile_and_return as _,
|
||||||
upsert_platform_browse_history_and_return_procedure::upsert_platform_browse_history_and_return as _,
|
upsert_platform_browse_history_and_return_procedure::upsert_platform_browse_history_and_return as _,
|
||||||
upsert_runtime_setting_and_return_procedure::upsert_runtime_setting_and_return as _,
|
upsert_runtime_setting_and_return_procedure::upsert_runtime_setting_and_return as _,
|
||||||
|
upsert_runtime_snapshot_and_return_procedure::upsert_runtime_snapshot_and_return as _,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
@@ -888,6 +907,136 @@ impl SpacetimeClient {
|
|||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub async fn get_runtime_snapshot(
|
||||||
|
&self,
|
||||||
|
user_id: String,
|
||||||
|
) -> Result<Option<RuntimeSnapshotRecord>, SpacetimeClientError> {
|
||||||
|
let procedure_input = map_runtime_snapshot_get_input(
|
||||||
|
build_runtime_snapshot_get_input(user_id)
|
||||||
|
.map_err(|error| SpacetimeClientError::Runtime(error.to_string()))?,
|
||||||
|
);
|
||||||
|
|
||||||
|
self.call_after_connect(move |connection, sender| {
|
||||||
|
connection.procedures().get_runtime_snapshot_then(
|
||||||
|
procedure_input,
|
||||||
|
move |_, result| {
|
||||||
|
let mapped = result
|
||||||
|
.map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
|
||||||
|
.and_then(map_runtime_snapshot_procedure_result);
|
||||||
|
send_once(&sender, mapped);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
})
|
||||||
|
.await
|
||||||
|
}
|
||||||
|
|
||||||
|
pub async fn put_runtime_snapshot(
|
||||||
|
&self,
|
||||||
|
user_id: String,
|
||||||
|
saved_at_micros: i64,
|
||||||
|
bottom_tab: String,
|
||||||
|
game_state: serde_json::Value,
|
||||||
|
current_story: Option<serde_json::Value>,
|
||||||
|
updated_at_micros: i64,
|
||||||
|
) -> Result<RuntimeSnapshotRecord, SpacetimeClientError> {
|
||||||
|
let procedure_input = map_runtime_snapshot_upsert_input(
|
||||||
|
build_runtime_snapshot_upsert_input(
|
||||||
|
user_id,
|
||||||
|
saved_at_micros,
|
||||||
|
bottom_tab,
|
||||||
|
game_state,
|
||||||
|
current_story,
|
||||||
|
updated_at_micros,
|
||||||
|
)
|
||||||
|
.map_err(|error| SpacetimeClientError::Runtime(error.to_string()))?,
|
||||||
|
);
|
||||||
|
|
||||||
|
self.call_after_connect(move |connection, sender| {
|
||||||
|
connection.procedures().upsert_runtime_snapshot_and_return_then(
|
||||||
|
procedure_input,
|
||||||
|
move |_, result| {
|
||||||
|
let mapped = result
|
||||||
|
.map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
|
||||||
|
.and_then(map_runtime_snapshot_required_procedure_result);
|
||||||
|
send_once(&sender, mapped);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
})
|
||||||
|
.await
|
||||||
|
}
|
||||||
|
|
||||||
|
pub async fn delete_runtime_snapshot(
|
||||||
|
&self,
|
||||||
|
user_id: String,
|
||||||
|
) -> Result<bool, SpacetimeClientError> {
|
||||||
|
let procedure_input = map_runtime_snapshot_delete_input(
|
||||||
|
build_runtime_snapshot_delete_input(user_id)
|
||||||
|
.map_err(|error| SpacetimeClientError::Runtime(error.to_string()))?,
|
||||||
|
);
|
||||||
|
|
||||||
|
self.call_after_connect(move |connection, sender| {
|
||||||
|
connection.procedures().delete_runtime_snapshot_and_return_then(
|
||||||
|
procedure_input,
|
||||||
|
move |_, result| {
|
||||||
|
let mapped = result
|
||||||
|
.map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
|
||||||
|
.and_then(map_runtime_snapshot_delete_procedure_result);
|
||||||
|
send_once(&sender, mapped);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
})
|
||||||
|
.await
|
||||||
|
}
|
||||||
|
|
||||||
|
pub async fn list_profile_save_archives(
|
||||||
|
&self,
|
||||||
|
user_id: String,
|
||||||
|
) -> Result<Vec<RuntimeProfileSaveArchiveRecord>, SpacetimeClientError> {
|
||||||
|
let procedure_input = map_runtime_profile_save_archive_list_input(
|
||||||
|
build_runtime_profile_save_archive_list_input(user_id)
|
||||||
|
.map_err(|error| SpacetimeClientError::Runtime(error.to_string()))?,
|
||||||
|
);
|
||||||
|
|
||||||
|
self.call_after_connect(move |connection, sender| {
|
||||||
|
connection.procedures().list_profile_save_archives_then(
|
||||||
|
procedure_input,
|
||||||
|
move |_, result| {
|
||||||
|
let mapped = result
|
||||||
|
.map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
|
||||||
|
.and_then(map_runtime_profile_save_archive_list_procedure_result);
|
||||||
|
send_once(&sender, mapped);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
})
|
||||||
|
.await
|
||||||
|
}
|
||||||
|
|
||||||
|
pub async fn resume_profile_save_archive(
|
||||||
|
&self,
|
||||||
|
user_id: String,
|
||||||
|
world_key: String,
|
||||||
|
) -> Result<(RuntimeProfileSaveArchiveRecord, RuntimeSnapshotRecord), SpacetimeClientError> {
|
||||||
|
let procedure_input = map_runtime_profile_save_archive_resume_input(
|
||||||
|
build_runtime_profile_save_archive_resume_input(user_id, world_key)
|
||||||
|
.map_err(|error| SpacetimeClientError::Runtime(error.to_string()))?,
|
||||||
|
);
|
||||||
|
|
||||||
|
self.call_after_connect(move |connection, sender| {
|
||||||
|
connection
|
||||||
|
.procedures()
|
||||||
|
.resume_profile_save_archive_and_return_then(
|
||||||
|
procedure_input,
|
||||||
|
move |_, result| {
|
||||||
|
let mapped = result
|
||||||
|
.map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
|
||||||
|
.and_then(map_runtime_profile_save_archive_resume_procedure_result);
|
||||||
|
send_once(&sender, mapped);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
})
|
||||||
|
.await
|
||||||
|
}
|
||||||
|
|
||||||
pub async fn begin_story_session(
|
pub async fn begin_story_session(
|
||||||
&self,
|
&self,
|
||||||
story_session_id: String,
|
story_session_id: String,
|
||||||
@@ -1411,6 +1560,52 @@ fn map_runtime_profile_play_stats_get_input(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn map_runtime_snapshot_get_input(
|
||||||
|
input: module_runtime::RuntimeSnapshotGetInput,
|
||||||
|
) -> BindingRuntimeSnapshotGetInput {
|
||||||
|
BindingRuntimeSnapshotGetInput {
|
||||||
|
user_id: input.user_id,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn map_runtime_snapshot_upsert_input(
|
||||||
|
input: module_runtime::RuntimeSnapshotUpsertInput,
|
||||||
|
) -> BindingRuntimeSnapshotUpsertInput {
|
||||||
|
BindingRuntimeSnapshotUpsertInput {
|
||||||
|
user_id: input.user_id,
|
||||||
|
saved_at_micros: input.saved_at_micros,
|
||||||
|
bottom_tab: input.bottom_tab,
|
||||||
|
game_state_json: input.game_state_json,
|
||||||
|
current_story_json: input.current_story_json,
|
||||||
|
updated_at_micros: input.updated_at_micros,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn map_runtime_snapshot_delete_input(
|
||||||
|
input: module_runtime::RuntimeSnapshotDeleteInput,
|
||||||
|
) -> BindingRuntimeSnapshotDeleteInput {
|
||||||
|
BindingRuntimeSnapshotDeleteInput {
|
||||||
|
user_id: input.user_id,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn map_runtime_profile_save_archive_list_input(
|
||||||
|
input: module_runtime::RuntimeProfileSaveArchiveListInput,
|
||||||
|
) -> BindingRuntimeProfileSaveArchiveListInput {
|
||||||
|
BindingRuntimeProfileSaveArchiveListInput {
|
||||||
|
user_id: input.user_id,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn map_runtime_profile_save_archive_resume_input(
|
||||||
|
input: module_runtime::RuntimeProfileSaveArchiveResumeInput,
|
||||||
|
) -> BindingRuntimeProfileSaveArchiveResumeInput {
|
||||||
|
BindingRuntimeProfileSaveArchiveResumeInput {
|
||||||
|
user_id: input.user_id,
|
||||||
|
world_key: input.world_key,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn map_ai_task_create_input(input: DomainAiTaskCreateInput) -> BindingAiTaskCreateInput {
|
fn map_ai_task_create_input(input: DomainAiTaskCreateInput) -> BindingAiTaskCreateInput {
|
||||||
BindingAiTaskCreateInput {
|
BindingAiTaskCreateInput {
|
||||||
task_id: input.task_id,
|
task_id: input.task_id,
|
||||||
@@ -1786,6 +1981,89 @@ fn map_runtime_profile_play_stats_procedure_result(
|
|||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn map_runtime_snapshot_procedure_result(
|
||||||
|
result: BindingRuntimeSnapshotProcedureResult,
|
||||||
|
) -> Result<Option<RuntimeSnapshotRecord>, SpacetimeClientError> {
|
||||||
|
if !result.ok {
|
||||||
|
return Err(SpacetimeClientError::Procedure(
|
||||||
|
result
|
||||||
|
.error_message
|
||||||
|
.unwrap_or_else(|| "SpacetimeDB procedure 返回未知错误".to_string()),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
result
|
||||||
|
.record
|
||||||
|
.map(|snapshot| {
|
||||||
|
build_runtime_snapshot_record(map_runtime_snapshot_snapshot(snapshot))
|
||||||
|
.map_err(|error| SpacetimeClientError::Runtime(error.to_string()))
|
||||||
|
})
|
||||||
|
.transpose()
|
||||||
|
}
|
||||||
|
|
||||||
|
fn map_runtime_snapshot_required_procedure_result(
|
||||||
|
result: BindingRuntimeSnapshotProcedureResult,
|
||||||
|
) -> Result<RuntimeSnapshotRecord, SpacetimeClientError> {
|
||||||
|
map_runtime_snapshot_procedure_result(result)?.ok_or_else(|| {
|
||||||
|
SpacetimeClientError::Procedure("SpacetimeDB procedure 未返回 runtime snapshot 快照".to_string())
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
fn map_runtime_snapshot_delete_procedure_result(
|
||||||
|
result: BindingRuntimeSnapshotProcedureResult,
|
||||||
|
) -> Result<bool, SpacetimeClientError> {
|
||||||
|
map_runtime_snapshot_procedure_result(result).map(|record| record.is_some())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn map_runtime_profile_save_archive_list_procedure_result(
|
||||||
|
result: BindingRuntimeProfileSaveArchiveProcedureResult,
|
||||||
|
) -> Result<Vec<RuntimeProfileSaveArchiveRecord>, SpacetimeClientError> {
|
||||||
|
if !result.ok {
|
||||||
|
return Err(SpacetimeClientError::Procedure(
|
||||||
|
result
|
||||||
|
.error_message
|
||||||
|
.unwrap_or_else(|| "SpacetimeDB procedure 返回未知错误".to_string()),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
result
|
||||||
|
.entries
|
||||||
|
.into_iter()
|
||||||
|
.map(|snapshot| {
|
||||||
|
build_runtime_profile_save_archive_record(
|
||||||
|
map_runtime_profile_save_archive_snapshot(snapshot),
|
||||||
|
)
|
||||||
|
.map_err(|error| SpacetimeClientError::Runtime(error.to_string()))
|
||||||
|
})
|
||||||
|
.collect()
|
||||||
|
}
|
||||||
|
|
||||||
|
fn map_runtime_profile_save_archive_resume_procedure_result(
|
||||||
|
result: BindingRuntimeProfileSaveArchiveProcedureResult,
|
||||||
|
) -> Result<(RuntimeProfileSaveArchiveRecord, RuntimeSnapshotRecord), SpacetimeClientError> {
|
||||||
|
if !result.ok {
|
||||||
|
return Err(SpacetimeClientError::Procedure(
|
||||||
|
result
|
||||||
|
.error_message
|
||||||
|
.unwrap_or_else(|| "SpacetimeDB procedure 返回未知错误".to_string()),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
let archive = result.record.ok_or_else(|| {
|
||||||
|
SpacetimeClientError::Procedure("SpacetimeDB procedure 未返回 save archive 快照".to_string())
|
||||||
|
})?;
|
||||||
|
let snapshot = result.current_snapshot.ok_or_else(|| {
|
||||||
|
SpacetimeClientError::Procedure("SpacetimeDB procedure 未返回恢复后的 runtime snapshot".to_string())
|
||||||
|
})?;
|
||||||
|
|
||||||
|
Ok((
|
||||||
|
build_runtime_profile_save_archive_record(map_runtime_profile_save_archive_snapshot(archive))
|
||||||
|
.map_err(|error| SpacetimeClientError::Runtime(error.to_string()))?,
|
||||||
|
build_runtime_snapshot_record(map_runtime_snapshot_snapshot(snapshot))
|
||||||
|
.map_err(|error| SpacetimeClientError::Runtime(error.to_string()))?,
|
||||||
|
))
|
||||||
|
}
|
||||||
|
|
||||||
fn map_ai_task_procedure_result(
|
fn map_ai_task_procedure_result(
|
||||||
result: BindingAiTaskProcedureResult,
|
result: BindingAiTaskProcedureResult,
|
||||||
) -> Result<AiTaskMutationRecord, SpacetimeClientError> {
|
) -> Result<AiTaskMutationRecord, SpacetimeClientError> {
|
||||||
@@ -2247,6 +2525,44 @@ fn map_runtime_profile_play_stats_snapshot(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn map_runtime_snapshot_snapshot(
|
||||||
|
snapshot: BindingRuntimeSnapshot,
|
||||||
|
) -> module_runtime::RuntimeSnapshot {
|
||||||
|
module_runtime::RuntimeSnapshot {
|
||||||
|
user_id: snapshot.user_id,
|
||||||
|
version: snapshot.version,
|
||||||
|
saved_at_micros: snapshot.saved_at_micros,
|
||||||
|
bottom_tab: snapshot.bottom_tab,
|
||||||
|
game_state_json: snapshot.game_state_json,
|
||||||
|
current_story_json: snapshot.current_story_json,
|
||||||
|
created_at_micros: snapshot.created_at_micros,
|
||||||
|
updated_at_micros: snapshot.updated_at_micros,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn map_runtime_profile_save_archive_snapshot(
|
||||||
|
snapshot: BindingRuntimeProfileSaveArchiveSnapshot,
|
||||||
|
) -> module_runtime::RuntimeProfileSaveArchiveSnapshot {
|
||||||
|
module_runtime::RuntimeProfileSaveArchiveSnapshot {
|
||||||
|
archive_id: snapshot.archive_id,
|
||||||
|
user_id: snapshot.user_id,
|
||||||
|
world_key: snapshot.world_key,
|
||||||
|
owner_user_id: snapshot.owner_user_id,
|
||||||
|
profile_id: snapshot.profile_id,
|
||||||
|
world_type: snapshot.world_type,
|
||||||
|
world_name: snapshot.world_name,
|
||||||
|
subtitle: snapshot.subtitle,
|
||||||
|
summary_text: snapshot.summary_text,
|
||||||
|
cover_image_src: snapshot.cover_image_src,
|
||||||
|
saved_at_micros: snapshot.saved_at_micros,
|
||||||
|
bottom_tab: snapshot.bottom_tab,
|
||||||
|
game_state_json: snapshot.game_state_json,
|
||||||
|
current_story_json: snapshot.current_story_json,
|
||||||
|
created_at_micros: snapshot.created_at_micros,
|
||||||
|
updated_at_micros: snapshot.updated_at_micros,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn map_custom_world_library_entry_from_profile_snapshot(
|
fn map_custom_world_library_entry_from_profile_snapshot(
|
||||||
snapshot: BindingCustomWorldProfileSnapshot,
|
snapshot: BindingCustomWorldProfileSnapshot,
|
||||||
) -> Result<CustomWorldLibraryEntryRecord, SpacetimeClientError> {
|
) -> Result<CustomWorldLibraryEntryRecord, SpacetimeClientError> {
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::quest_record_input_type::QuestRecordInput;
|
use super::quest_record_input_type::QuestRecordInput;
|
||||||
|
|
||||||
@@ -14,8 +19,10 @@ pub(super) struct AcceptQuestArgs {
|
|||||||
|
|
||||||
impl From<AcceptQuestArgs> for super::Reducer {
|
impl From<AcceptQuestArgs> for super::Reducer {
|
||||||
fn from(args: AcceptQuestArgs) -> Self {
|
fn from(args: AcceptQuestArgs) -> Self {
|
||||||
Self::AcceptQuest { input: args.input }
|
Self::AcceptQuest {
|
||||||
}
|
input: args.input,
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl __sdk::InModule for AcceptQuestArgs {
|
impl __sdk::InModule for AcceptQuestArgs {
|
||||||
@@ -33,8 +40,9 @@ pub trait accept_quest {
|
|||||||
/// The reducer will run asynchronously in the future,
|
/// The reducer will run asynchronously in the future,
|
||||||
/// and this method provides no way to listen for its completion status.
|
/// and this method provides no way to listen for its completion status.
|
||||||
/// /// Use [`accept_quest:accept_quest_then`] to run a callback after the reducer completes.
|
/// /// Use [`accept_quest:accept_quest_then`] to run a callback after the reducer completes.
|
||||||
fn accept_quest(&self, input: QuestRecordInput) -> __sdk::Result<()> {
|
fn accept_quest(&self, input: QuestRecordInput,
|
||||||
self.accept_quest_then(input, |_, _| {})
|
) -> __sdk::Result<()> {
|
||||||
|
self.accept_quest_then(input, |_, _| {})
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Request that the remote module invoke the reducer `accept_quest` to run as soon as possible,
|
/// Request that the remote module invoke the reducer `accept_quest` to run as soon as possible,
|
||||||
@@ -62,7 +70,7 @@ impl accept_quest for super::RemoteReducers {
|
|||||||
+ Send
|
+ Send
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()> {
|
) -> __sdk::Result<()> {
|
||||||
self.imp
|
self.imp.invoke_reducer_with_callback(AcceptQuestArgs { input, }, callback)
|
||||||
.invoke_reducer_with_callback(AcceptQuestArgs { input }, callback)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::quest_completion_ack_input_type::QuestCompletionAckInput;
|
use super::quest_completion_ack_input_type::QuestCompletionAckInput;
|
||||||
|
|
||||||
@@ -14,8 +19,10 @@ pub(super) struct AcknowledgeQuestCompletionArgs {
|
|||||||
|
|
||||||
impl From<AcknowledgeQuestCompletionArgs> for super::Reducer {
|
impl From<AcknowledgeQuestCompletionArgs> for super::Reducer {
|
||||||
fn from(args: AcknowledgeQuestCompletionArgs) -> Self {
|
fn from(args: AcknowledgeQuestCompletionArgs) -> Self {
|
||||||
Self::AcknowledgeQuestCompletion { input: args.input }
|
Self::AcknowledgeQuestCompletion {
|
||||||
}
|
input: args.input,
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl __sdk::InModule for AcknowledgeQuestCompletionArgs {
|
impl __sdk::InModule for AcknowledgeQuestCompletionArgs {
|
||||||
@@ -33,8 +40,9 @@ pub trait acknowledge_quest_completion {
|
|||||||
/// The reducer will run asynchronously in the future,
|
/// The reducer will run asynchronously in the future,
|
||||||
/// and this method provides no way to listen for its completion status.
|
/// and this method provides no way to listen for its completion status.
|
||||||
/// /// Use [`acknowledge_quest_completion:acknowledge_quest_completion_then`] to run a callback after the reducer completes.
|
/// /// Use [`acknowledge_quest_completion:acknowledge_quest_completion_then`] to run a callback after the reducer completes.
|
||||||
fn acknowledge_quest_completion(&self, input: QuestCompletionAckInput) -> __sdk::Result<()> {
|
fn acknowledge_quest_completion(&self, input: QuestCompletionAckInput,
|
||||||
self.acknowledge_quest_completion_then(input, |_, _| {})
|
) -> __sdk::Result<()> {
|
||||||
|
self.acknowledge_quest_completion_then(input, |_, _| {})
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Request that the remote module invoke the reducer `acknowledge_quest_completion` to run as soon as possible,
|
/// Request that the remote module invoke the reducer `acknowledge_quest_completion` to run as soon as possible,
|
||||||
@@ -62,7 +70,7 @@ impl acknowledge_quest_completion for super::RemoteReducers {
|
|||||||
+ Send
|
+ Send
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()> {
|
) -> __sdk::Result<()> {
|
||||||
self.imp
|
self.imp.invoke_reducer_with_callback(AcknowledgeQuestCompletionArgs { input, }, callback)
|
||||||
.invoke_reducer_with_callback(AcknowledgeQuestCompletionArgs { input }, callback)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::ai_result_reference_kind_type::AiResultReferenceKind;
|
use super::ai_result_reference_kind_type::AiResultReferenceKind;
|
||||||
|
|
||||||
@@ -12,10 +17,12 @@ pub struct AiResultReferenceInput {
|
|||||||
pub task_id: String,
|
pub task_id: String,
|
||||||
pub reference_kind: AiResultReferenceKind,
|
pub reference_kind: AiResultReferenceKind,
|
||||||
pub reference_id: String,
|
pub reference_id: String,
|
||||||
pub label: Option<String>,
|
pub label: Option::<String>,
|
||||||
pub created_at_micros: i64,
|
pub created_at_micros: i64,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for AiResultReferenceInput {
|
impl __sdk::InModule for AiResultReferenceInput {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
@@ -19,8 +24,12 @@ pub enum AiResultReferenceKind {
|
|||||||
RuntimeItemRecord,
|
RuntimeItemRecord,
|
||||||
|
|
||||||
AssetObject,
|
AssetObject,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for AiResultReferenceKind {
|
impl __sdk::InModule for AiResultReferenceKind {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::ai_result_reference_kind_type::AiResultReferenceKind;
|
use super::ai_result_reference_kind_type::AiResultReferenceKind;
|
||||||
|
|
||||||
@@ -13,10 +18,12 @@ pub struct AiResultReferenceSnapshot {
|
|||||||
pub task_id: String,
|
pub task_id: String,
|
||||||
pub reference_kind: AiResultReferenceKind,
|
pub reference_kind: AiResultReferenceKind,
|
||||||
pub reference_id: String,
|
pub reference_id: String,
|
||||||
pub label: Option<String>,
|
pub label: Option::<String>,
|
||||||
pub created_at_micros: i64,
|
pub created_at_micros: i64,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for AiResultReferenceSnapshot {
|
impl __sdk::InModule for AiResultReferenceSnapshot {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,14 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use super::ai_result_reference_kind_type::AiResultReferenceKind;
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
use super::ai_result_reference_type::AiResultReference;
|
use super::ai_result_reference_type::AiResultReference;
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use super::ai_result_reference_kind_type::AiResultReferenceKind;
|
||||||
|
|
||||||
/// Table handle for the table `ai_result_reference`.
|
/// Table handle for the table `ai_result_reference`.
|
||||||
///
|
///
|
||||||
@@ -32,9 +37,7 @@ pub trait AiResultReferenceTableAccess {
|
|||||||
impl AiResultReferenceTableAccess for super::RemoteTables {
|
impl AiResultReferenceTableAccess for super::RemoteTables {
|
||||||
fn ai_result_reference(&self) -> AiResultReferenceTableHandle<'_> {
|
fn ai_result_reference(&self) -> AiResultReferenceTableHandle<'_> {
|
||||||
AiResultReferenceTableHandle {
|
AiResultReferenceTableHandle {
|
||||||
imp: self
|
imp: self.imp.get_table::<AiResultReference>("ai_result_reference"),
|
||||||
.imp
|
|
||||||
.get_table::<AiResultReference>("ai_result_reference"),
|
|
||||||
ctx: std::marker::PhantomData,
|
ctx: std::marker::PhantomData,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -47,12 +50,8 @@ impl<'ctx> __sdk::Table for AiResultReferenceTableHandle<'ctx> {
|
|||||||
type Row = AiResultReference;
|
type Row = AiResultReference;
|
||||||
type EventContext = super::EventContext;
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
fn count(&self) -> u64 {
|
fn count(&self) -> u64 { self.imp.count() }
|
||||||
self.imp.count()
|
fn iter(&self) -> impl Iterator<Item = AiResultReference> + '_ { self.imp.iter() }
|
||||||
}
|
|
||||||
fn iter(&self) -> impl Iterator<Item = AiResultReference> + '_ {
|
|
||||||
self.imp.iter()
|
|
||||||
}
|
|
||||||
|
|
||||||
type InsertCallbackId = AiResultReferenceInsertCallbackId;
|
type InsertCallbackId = AiResultReferenceInsertCallbackId;
|
||||||
|
|
||||||
@@ -98,44 +97,41 @@ impl<'ctx> __sdk::TableWithPrimaryKey for AiResultReferenceTableHandle<'ctx> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Access to the `result_reference_row_id` unique index on the table `ai_result_reference`,
|
/// Access to the `result_reference_row_id` unique index on the table `ai_result_reference`,
|
||||||
/// which allows point queries on the field of the same name
|
/// which allows point queries on the field of the same name
|
||||||
/// via the [`AiResultReferenceResultReferenceRowIdUnique::find`] method.
|
/// via the [`AiResultReferenceResultReferenceRowIdUnique::find`] method.
|
||||||
///
|
///
|
||||||
/// Users are encouraged not to explicitly reference this type,
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
/// but to directly chain method calls,
|
/// but to directly chain method calls,
|
||||||
/// like `ctx.db.ai_result_reference().result_reference_row_id().find(...)`.
|
/// like `ctx.db.ai_result_reference().result_reference_row_id().find(...)`.
|
||||||
pub struct AiResultReferenceResultReferenceRowIdUnique<'ctx> {
|
pub struct AiResultReferenceResultReferenceRowIdUnique<'ctx> {
|
||||||
imp: __sdk::UniqueConstraintHandle<AiResultReference, String>,
|
imp: __sdk::UniqueConstraintHandle<AiResultReference, String>,
|
||||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
}
|
|
||||||
|
|
||||||
impl<'ctx> AiResultReferenceTableHandle<'ctx> {
|
|
||||||
/// Get a handle on the `result_reference_row_id` unique index on the table `ai_result_reference`.
|
|
||||||
pub fn result_reference_row_id(&self) -> AiResultReferenceResultReferenceRowIdUnique<'ctx> {
|
|
||||||
AiResultReferenceResultReferenceRowIdUnique {
|
|
||||||
imp: self
|
|
||||||
.imp
|
|
||||||
.get_unique_constraint::<String>("result_reference_row_id"),
|
|
||||||
phantom: std::marker::PhantomData,
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'ctx> AiResultReferenceResultReferenceRowIdUnique<'ctx> {
|
impl<'ctx> AiResultReferenceTableHandle<'ctx> {
|
||||||
/// Find the subscribed row whose `result_reference_row_id` column value is equal to `col_val`,
|
/// Get a handle on the `result_reference_row_id` unique index on the table `ai_result_reference`.
|
||||||
/// if such a row is present in the client cache.
|
pub fn result_reference_row_id(&self) -> AiResultReferenceResultReferenceRowIdUnique<'ctx> {
|
||||||
pub fn find(&self, col_val: &String) -> Option<AiResultReference> {
|
AiResultReferenceResultReferenceRowIdUnique {
|
||||||
self.imp.find(col_val)
|
imp: self.imp.get_unique_constraint::<String>("result_reference_row_id"),
|
||||||
}
|
phantom: std::marker::PhantomData,
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> AiResultReferenceResultReferenceRowIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `result_reference_row_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<AiResultReference> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
|
||||||
let _table = client_cache.get_or_make_table::<AiResultReference>("ai_result_reference");
|
let _table = client_cache.get_or_make_table::<AiResultReference>("ai_result_reference");
|
||||||
_table.add_unique_constraint::<String>("result_reference_row_id", |row| {
|
_table.add_unique_constraint::<String>("result_reference_row_id", |row| &row.result_reference_row_id);
|
||||||
&row.result_reference_row_id
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
@@ -143,24 +139,26 @@ pub(super) fn parse_table_update(
|
|||||||
raw_updates: __ws::v2::TableUpdate,
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
) -> __sdk::Result<__sdk::TableUpdate<AiResultReference>> {
|
) -> __sdk::Result<__sdk::TableUpdate<AiResultReference>> {
|
||||||
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
__sdk::InternalError::failed_parse("TableUpdate<AiResultReference>", "TableUpdate")
|
__sdk::InternalError::failed_parse(
|
||||||
.with_cause(e)
|
"TableUpdate<AiResultReference>",
|
||||||
.into()
|
"TableUpdate",
|
||||||
|
).with_cause(e).into()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(non_camel_case_types)]
|
#[allow(non_camel_case_types)]
|
||||||
/// Extension trait for query builder access to the table `AiResultReference`.
|
/// Extension trait for query builder access to the table `AiResultReference`.
|
||||||
///
|
///
|
||||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
pub trait ai_result_referenceQueryTableAccess {
|
pub trait ai_result_referenceQueryTableAccess {
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
/// Get a query builder for the table `AiResultReference`.
|
/// Get a query builder for the table `AiResultReference`.
|
||||||
fn ai_result_reference(&self) -> __sdk::__query_builder::Table<AiResultReference>;
|
fn ai_result_reference(&self) -> __sdk::__query_builder::Table<AiResultReference>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl ai_result_referenceQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn ai_result_reference(&self) -> __sdk::__query_builder::Table<AiResultReference> {
|
||||||
|
__sdk::__query_builder::Table::new("ai_result_reference")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl ai_result_referenceQueryTableAccess for __sdk::QueryTableAccessor {
|
|
||||||
fn ai_result_reference(&self) -> __sdk::__query_builder::Table<AiResultReference> {
|
|
||||||
__sdk::__query_builder::Table::new("ai_result_reference")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::ai_result_reference_kind_type::AiResultReferenceKind;
|
use super::ai_result_reference_kind_type::AiResultReferenceKind;
|
||||||
|
|
||||||
@@ -14,14 +19,16 @@ pub struct AiResultReference {
|
|||||||
pub task_id: String,
|
pub task_id: String,
|
||||||
pub reference_kind: AiResultReferenceKind,
|
pub reference_kind: AiResultReferenceKind,
|
||||||
pub reference_id: String,
|
pub reference_id: String,
|
||||||
pub label: Option<String>,
|
pub label: Option::<String>,
|
||||||
pub created_at: __sdk::Timestamp,
|
pub created_at: __sdk::Timestamp,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for AiResultReference {
|
impl __sdk::InModule for AiResultReference {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Column accessor struct for the table `AiResultReference`.
|
/// Column accessor struct for the table `AiResultReference`.
|
||||||
///
|
///
|
||||||
/// Provides typed access to columns for query building.
|
/// Provides typed access to columns for query building.
|
||||||
@@ -31,7 +38,7 @@ pub struct AiResultReferenceCols {
|
|||||||
pub task_id: __sdk::__query_builder::Col<AiResultReference, String>,
|
pub task_id: __sdk::__query_builder::Col<AiResultReference, String>,
|
||||||
pub reference_kind: __sdk::__query_builder::Col<AiResultReference, AiResultReferenceKind>,
|
pub reference_kind: __sdk::__query_builder::Col<AiResultReference, AiResultReferenceKind>,
|
||||||
pub reference_id: __sdk::__query_builder::Col<AiResultReference, String>,
|
pub reference_id: __sdk::__query_builder::Col<AiResultReference, String>,
|
||||||
pub label: __sdk::__query_builder::Col<AiResultReference, Option<String>>,
|
pub label: __sdk::__query_builder::Col<AiResultReference, Option::<String>>,
|
||||||
pub created_at: __sdk::__query_builder::Col<AiResultReference, __sdk::Timestamp>,
|
pub created_at: __sdk::__query_builder::Col<AiResultReference, __sdk::Timestamp>,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,16 +46,14 @@ impl __sdk::__query_builder::HasCols for AiResultReference {
|
|||||||
type Cols = AiResultReferenceCols;
|
type Cols = AiResultReferenceCols;
|
||||||
fn cols(table_name: &'static str) -> Self::Cols {
|
fn cols(table_name: &'static str) -> Self::Cols {
|
||||||
AiResultReferenceCols {
|
AiResultReferenceCols {
|
||||||
result_reference_row_id: __sdk::__query_builder::Col::new(
|
result_reference_row_id: __sdk::__query_builder::Col::new(table_name, "result_reference_row_id"),
|
||||||
table_name,
|
|
||||||
"result_reference_row_id",
|
|
||||||
),
|
|
||||||
result_ref_id: __sdk::__query_builder::Col::new(table_name, "result_ref_id"),
|
result_ref_id: __sdk::__query_builder::Col::new(table_name, "result_ref_id"),
|
||||||
task_id: __sdk::__query_builder::Col::new(table_name, "task_id"),
|
task_id: __sdk::__query_builder::Col::new(table_name, "task_id"),
|
||||||
reference_kind: __sdk::__query_builder::Col::new(table_name, "reference_kind"),
|
reference_kind: __sdk::__query_builder::Col::new(table_name, "reference_kind"),
|
||||||
reference_id: __sdk::__query_builder::Col::new(table_name, "reference_id"),
|
reference_id: __sdk::__query_builder::Col::new(table_name, "reference_id"),
|
||||||
label: __sdk::__query_builder::Col::new(table_name, "label"),
|
label: __sdk::__query_builder::Col::new(table_name, "label"),
|
||||||
created_at: __sdk::__query_builder::Col::new(table_name, "created_at"),
|
created_at: __sdk::__query_builder::Col::new(table_name, "created_at"),
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -65,13 +70,12 @@ impl __sdk::__query_builder::HasIxCols for AiResultReference {
|
|||||||
type IxCols = AiResultReferenceIxCols;
|
type IxCols = AiResultReferenceIxCols;
|
||||||
fn ix_cols(table_name: &'static str) -> Self::IxCols {
|
fn ix_cols(table_name: &'static str) -> Self::IxCols {
|
||||||
AiResultReferenceIxCols {
|
AiResultReferenceIxCols {
|
||||||
result_reference_row_id: __sdk::__query_builder::IxCol::new(
|
result_reference_row_id: __sdk::__query_builder::IxCol::new(table_name, "result_reference_row_id"),
|
||||||
table_name,
|
|
||||||
"result_reference_row_id",
|
|
||||||
),
|
|
||||||
task_id: __sdk::__query_builder::IxCol::new(table_name, "task_id"),
|
task_id: __sdk::__query_builder::IxCol::new(table_name, "task_id"),
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl __sdk::__query_builder::CanBeLookupTable for AiResultReference {}
|
impl __sdk::__query_builder::CanBeLookupTable for AiResultReference {}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::ai_task_stage_kind_type::AiTaskStageKind;
|
use super::ai_task_stage_kind_type::AiTaskStageKind;
|
||||||
|
|
||||||
@@ -11,12 +16,14 @@ use super::ai_task_stage_kind_type::AiTaskStageKind;
|
|||||||
pub struct AiStageCompletionInput {
|
pub struct AiStageCompletionInput {
|
||||||
pub task_id: String,
|
pub task_id: String,
|
||||||
pub stage_kind: AiTaskStageKind,
|
pub stage_kind: AiTaskStageKind,
|
||||||
pub text_output: Option<String>,
|
pub text_output: Option::<String>,
|
||||||
pub structured_payload_json: Option<String>,
|
pub structured_payload_json: Option::<String>,
|
||||||
pub warning_messages: Vec<String>,
|
pub warning_messages: Vec::<String>,
|
||||||
pub completed_at_micros: i64,
|
pub completed_at_micros: i64,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for AiStageCompletionInput {
|
impl __sdk::InModule for AiStageCompletionInput {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,13 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
@@ -11,6 +17,8 @@ pub struct AiTaskCancelInput {
|
|||||||
pub completed_at_micros: i64,
|
pub completed_at_micros: i64,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for AiTaskCancelInput {
|
impl __sdk::InModule for AiTaskCancelInput {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::ai_task_kind_type::AiTaskKind;
|
use super::ai_task_kind_type::AiTaskKind;
|
||||||
use super::ai_task_stage_blueprint_type::AiTaskStageBlueprint;
|
use super::ai_task_stage_blueprint_type::AiTaskStageBlueprint;
|
||||||
@@ -15,12 +20,14 @@ pub struct AiTaskCreateInput {
|
|||||||
pub owner_user_id: String,
|
pub owner_user_id: String,
|
||||||
pub request_label: String,
|
pub request_label: String,
|
||||||
pub source_module: String,
|
pub source_module: String,
|
||||||
pub source_entity_id: Option<String>,
|
pub source_entity_id: Option::<String>,
|
||||||
pub request_payload_json: Option<String>,
|
pub request_payload_json: Option::<String>,
|
||||||
pub stages: Vec<AiTaskStageBlueprint>,
|
pub stages: Vec::<AiTaskStageBlueprint>,
|
||||||
pub created_at_micros: i64,
|
pub created_at_micros: i64,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for AiTaskCreateInput {
|
impl __sdk::InModule for AiTaskCreateInput {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,13 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
@@ -12,6 +18,8 @@ pub struct AiTaskFailureInput {
|
|||||||
pub completed_at_micros: i64,
|
pub completed_at_micros: i64,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for AiTaskFailureInput {
|
impl __sdk::InModule for AiTaskFailureInput {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,13 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
@@ -11,6 +17,8 @@ pub struct AiTaskFinishInput {
|
|||||||
pub completed_at_micros: i64,
|
pub completed_at_micros: i64,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for AiTaskFinishInput {
|
impl __sdk::InModule for AiTaskFinishInput {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
@@ -19,8 +24,12 @@ pub enum AiTaskKind {
|
|||||||
QuestIntent,
|
QuestIntent,
|
||||||
|
|
||||||
RuntimeItemIntent,
|
RuntimeItemIntent,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for AiTaskKind {
|
impl __sdk::InModule for AiTaskKind {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::ai_task_snapshot_type::AiTaskSnapshot;
|
use super::ai_task_snapshot_type::AiTaskSnapshot;
|
||||||
use super::ai_text_chunk_snapshot_type::AiTextChunkSnapshot;
|
use super::ai_text_chunk_snapshot_type::AiTextChunkSnapshot;
|
||||||
@@ -11,11 +16,13 @@ use super::ai_text_chunk_snapshot_type::AiTextChunkSnapshot;
|
|||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
pub struct AiTaskProcedureResult {
|
pub struct AiTaskProcedureResult {
|
||||||
pub ok: bool,
|
pub ok: bool,
|
||||||
pub task: Option<AiTaskSnapshot>,
|
pub task: Option::<AiTaskSnapshot>,
|
||||||
pub text_chunk: Option<AiTextChunkSnapshot>,
|
pub text_chunk: Option::<AiTextChunkSnapshot>,
|
||||||
pub error_message: Option<String>,
|
pub error_message: Option::<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for AiTaskProcedureResult {
|
impl __sdk::InModule for AiTaskProcedureResult {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,12 +2,17 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::ai_result_reference_snapshot_type::AiResultReferenceSnapshot;
|
|
||||||
use super::ai_task_kind_type::AiTaskKind;
|
use super::ai_task_kind_type::AiTaskKind;
|
||||||
use super::ai_task_stage_snapshot_type::AiTaskStageSnapshot;
|
|
||||||
use super::ai_task_status_type::AiTaskStatus;
|
use super::ai_task_status_type::AiTaskStatus;
|
||||||
|
use super::ai_task_stage_snapshot_type::AiTaskStageSnapshot;
|
||||||
|
use super::ai_result_reference_snapshot_type::AiResultReferenceSnapshot;
|
||||||
|
|
||||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
@@ -17,21 +22,23 @@ pub struct AiTaskSnapshot {
|
|||||||
pub owner_user_id: String,
|
pub owner_user_id: String,
|
||||||
pub request_label: String,
|
pub request_label: String,
|
||||||
pub source_module: String,
|
pub source_module: String,
|
||||||
pub source_entity_id: Option<String>,
|
pub source_entity_id: Option::<String>,
|
||||||
pub request_payload_json: Option<String>,
|
pub request_payload_json: Option::<String>,
|
||||||
pub status: AiTaskStatus,
|
pub status: AiTaskStatus,
|
||||||
pub failure_message: Option<String>,
|
pub failure_message: Option::<String>,
|
||||||
pub stages: Vec<AiTaskStageSnapshot>,
|
pub stages: Vec::<AiTaskStageSnapshot>,
|
||||||
pub result_references: Vec<AiResultReferenceSnapshot>,
|
pub result_references: Vec::<AiResultReferenceSnapshot>,
|
||||||
pub latest_text_output: Option<String>,
|
pub latest_text_output: Option::<String>,
|
||||||
pub latest_structured_payload_json: Option<String>,
|
pub latest_structured_payload_json: Option::<String>,
|
||||||
pub version: u32,
|
pub version: u32,
|
||||||
pub created_at_micros: i64,
|
pub created_at_micros: i64,
|
||||||
pub started_at_micros: Option<i64>,
|
pub started_at_micros: Option::<i64>,
|
||||||
pub completed_at_micros: Option<i64>,
|
pub completed_at_micros: Option::<i64>,
|
||||||
pub updated_at_micros: i64,
|
pub updated_at_micros: i64,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for AiTaskSnapshot {
|
impl __sdk::InModule for AiTaskSnapshot {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::ai_task_stage_kind_type::AiTaskStageKind;
|
use super::ai_task_stage_kind_type::AiTaskStageKind;
|
||||||
|
|
||||||
@@ -15,6 +20,8 @@ pub struct AiTaskStageBlueprint {
|
|||||||
pub order: u32,
|
pub order: u32,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for AiTaskStageBlueprint {
|
impl __sdk::InModule for AiTaskStageBlueprint {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
@@ -17,8 +22,12 @@ pub enum AiTaskStageKind {
|
|||||||
NormalizeResult,
|
NormalizeResult,
|
||||||
|
|
||||||
PersistResult,
|
PersistResult,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for AiTaskStageKind {
|
impl __sdk::InModule for AiTaskStageKind {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::ai_task_stage_kind_type::AiTaskStageKind;
|
use super::ai_task_stage_kind_type::AiTaskStageKind;
|
||||||
use super::ai_task_stage_status_type::AiTaskStageStatus;
|
use super::ai_task_stage_status_type::AiTaskStageStatus;
|
||||||
@@ -15,13 +20,15 @@ pub struct AiTaskStageSnapshot {
|
|||||||
pub detail: String,
|
pub detail: String,
|
||||||
pub order: u32,
|
pub order: u32,
|
||||||
pub status: AiTaskStageStatus,
|
pub status: AiTaskStageStatus,
|
||||||
pub text_output: Option<String>,
|
pub text_output: Option::<String>,
|
||||||
pub structured_payload_json: Option<String>,
|
pub structured_payload_json: Option::<String>,
|
||||||
pub warning_messages: Vec<String>,
|
pub warning_messages: Vec::<String>,
|
||||||
pub started_at_micros: Option<i64>,
|
pub started_at_micros: Option::<i64>,
|
||||||
pub completed_at_micros: Option<i64>,
|
pub completed_at_micros: Option::<i64>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for AiTaskStageSnapshot {
|
impl __sdk::InModule for AiTaskStageSnapshot {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::ai_task_stage_kind_type::AiTaskStageKind;
|
use super::ai_task_stage_kind_type::AiTaskStageKind;
|
||||||
|
|
||||||
@@ -14,6 +19,8 @@ pub struct AiTaskStageStartInput {
|
|||||||
pub started_at_micros: i64,
|
pub started_at_micros: i64,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for AiTaskStageStartInput {
|
impl __sdk::InModule for AiTaskStageStartInput {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
@@ -15,8 +20,12 @@ pub enum AiTaskStageStatus {
|
|||||||
Completed,
|
Completed,
|
||||||
|
|
||||||
Skipped,
|
Skipped,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for AiTaskStageStatus {
|
impl __sdk::InModule for AiTaskStageStatus {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,10 +2,15 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
use super::ai_task_stage_type::AiTaskStage;
|
||||||
use super::ai_task_stage_kind_type::AiTaskStageKind;
|
use super::ai_task_stage_kind_type::AiTaskStageKind;
|
||||||
use super::ai_task_stage_status_type::AiTaskStageStatus;
|
use super::ai_task_stage_status_type::AiTaskStageStatus;
|
||||||
use super::ai_task_stage_type::AiTaskStage;
|
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
|
||||||
|
|
||||||
/// Table handle for the table `ai_task_stage`.
|
/// Table handle for the table `ai_task_stage`.
|
||||||
///
|
///
|
||||||
@@ -46,12 +51,8 @@ impl<'ctx> __sdk::Table for AiTaskStageTableHandle<'ctx> {
|
|||||||
type Row = AiTaskStage;
|
type Row = AiTaskStage;
|
||||||
type EventContext = super::EventContext;
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
fn count(&self) -> u64 {
|
fn count(&self) -> u64 { self.imp.count() }
|
||||||
self.imp.count()
|
fn iter(&self) -> impl Iterator<Item = AiTaskStage> + '_ { self.imp.iter() }
|
||||||
}
|
|
||||||
fn iter(&self) -> impl Iterator<Item = AiTaskStage> + '_ {
|
|
||||||
self.imp.iter()
|
|
||||||
}
|
|
||||||
|
|
||||||
type InsertCallbackId = AiTaskStageInsertCallbackId;
|
type InsertCallbackId = AiTaskStageInsertCallbackId;
|
||||||
|
|
||||||
@@ -97,38 +98,39 @@ impl<'ctx> __sdk::TableWithPrimaryKey for AiTaskStageTableHandle<'ctx> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Access to the `task_stage_id` unique index on the table `ai_task_stage`,
|
/// Access to the `task_stage_id` unique index on the table `ai_task_stage`,
|
||||||
/// which allows point queries on the field of the same name
|
/// which allows point queries on the field of the same name
|
||||||
/// via the [`AiTaskStageTaskStageIdUnique::find`] method.
|
/// via the [`AiTaskStageTaskStageIdUnique::find`] method.
|
||||||
///
|
///
|
||||||
/// Users are encouraged not to explicitly reference this type,
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
/// but to directly chain method calls,
|
/// but to directly chain method calls,
|
||||||
/// like `ctx.db.ai_task_stage().task_stage_id().find(...)`.
|
/// like `ctx.db.ai_task_stage().task_stage_id().find(...)`.
|
||||||
pub struct AiTaskStageTaskStageIdUnique<'ctx> {
|
pub struct AiTaskStageTaskStageIdUnique<'ctx> {
|
||||||
imp: __sdk::UniqueConstraintHandle<AiTaskStage, String>,
|
imp: __sdk::UniqueConstraintHandle<AiTaskStage, String>,
|
||||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
}
|
|
||||||
|
|
||||||
impl<'ctx> AiTaskStageTableHandle<'ctx> {
|
|
||||||
/// Get a handle on the `task_stage_id` unique index on the table `ai_task_stage`.
|
|
||||||
pub fn task_stage_id(&self) -> AiTaskStageTaskStageIdUnique<'ctx> {
|
|
||||||
AiTaskStageTaskStageIdUnique {
|
|
||||||
imp: self.imp.get_unique_constraint::<String>("task_stage_id"),
|
|
||||||
phantom: std::marker::PhantomData,
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'ctx> AiTaskStageTaskStageIdUnique<'ctx> {
|
impl<'ctx> AiTaskStageTableHandle<'ctx> {
|
||||||
/// Find the subscribed row whose `task_stage_id` column value is equal to `col_val`,
|
/// Get a handle on the `task_stage_id` unique index on the table `ai_task_stage`.
|
||||||
/// if such a row is present in the client cache.
|
pub fn task_stage_id(&self) -> AiTaskStageTaskStageIdUnique<'ctx> {
|
||||||
pub fn find(&self, col_val: &String) -> Option<AiTaskStage> {
|
AiTaskStageTaskStageIdUnique {
|
||||||
self.imp.find(col_val)
|
imp: self.imp.get_unique_constraint::<String>("task_stage_id"),
|
||||||
}
|
phantom: std::marker::PhantomData,
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> AiTaskStageTaskStageIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `task_stage_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<AiTaskStage> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
|
||||||
let _table = client_cache.get_or_make_table::<AiTaskStage>("ai_task_stage");
|
let _table = client_cache.get_or_make_table::<AiTaskStage>("ai_task_stage");
|
||||||
_table.add_unique_constraint::<String>("task_stage_id", |row| &row.task_stage_id);
|
_table.add_unique_constraint::<String>("task_stage_id", |row| &row.task_stage_id);
|
||||||
}
|
}
|
||||||
@@ -138,24 +140,26 @@ pub(super) fn parse_table_update(
|
|||||||
raw_updates: __ws::v2::TableUpdate,
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
) -> __sdk::Result<__sdk::TableUpdate<AiTaskStage>> {
|
) -> __sdk::Result<__sdk::TableUpdate<AiTaskStage>> {
|
||||||
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
__sdk::InternalError::failed_parse("TableUpdate<AiTaskStage>", "TableUpdate")
|
__sdk::InternalError::failed_parse(
|
||||||
.with_cause(e)
|
"TableUpdate<AiTaskStage>",
|
||||||
.into()
|
"TableUpdate",
|
||||||
|
).with_cause(e).into()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(non_camel_case_types)]
|
#[allow(non_camel_case_types)]
|
||||||
/// Extension trait for query builder access to the table `AiTaskStage`.
|
/// Extension trait for query builder access to the table `AiTaskStage`.
|
||||||
///
|
///
|
||||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
pub trait ai_task_stageQueryTableAccess {
|
pub trait ai_task_stageQueryTableAccess {
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
/// Get a query builder for the table `AiTaskStage`.
|
/// Get a query builder for the table `AiTaskStage`.
|
||||||
fn ai_task_stage(&self) -> __sdk::__query_builder::Table<AiTaskStage>;
|
fn ai_task_stage(&self) -> __sdk::__query_builder::Table<AiTaskStage>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl ai_task_stageQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn ai_task_stage(&self) -> __sdk::__query_builder::Table<AiTaskStage> {
|
||||||
|
__sdk::__query_builder::Table::new("ai_task_stage")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl ai_task_stageQueryTableAccess for __sdk::QueryTableAccessor {
|
|
||||||
fn ai_task_stage(&self) -> __sdk::__query_builder::Table<AiTaskStage> {
|
|
||||||
__sdk::__query_builder::Table::new("ai_task_stage")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::ai_task_stage_kind_type::AiTaskStageKind;
|
use super::ai_task_stage_kind_type::AiTaskStageKind;
|
||||||
use super::ai_task_stage_status_type::AiTaskStageStatus;
|
use super::ai_task_stage_status_type::AiTaskStageStatus;
|
||||||
@@ -17,17 +22,19 @@ pub struct AiTaskStage {
|
|||||||
pub detail: String,
|
pub detail: String,
|
||||||
pub stage_order: u32,
|
pub stage_order: u32,
|
||||||
pub status: AiTaskStageStatus,
|
pub status: AiTaskStageStatus,
|
||||||
pub text_output: Option<String>,
|
pub text_output: Option::<String>,
|
||||||
pub structured_payload_json: Option<String>,
|
pub structured_payload_json: Option::<String>,
|
||||||
pub warning_messages: Vec<String>,
|
pub warning_messages: Vec::<String>,
|
||||||
pub started_at: Option<__sdk::Timestamp>,
|
pub started_at: Option::<__sdk::Timestamp>,
|
||||||
pub completed_at: Option<__sdk::Timestamp>,
|
pub completed_at: Option::<__sdk::Timestamp>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for AiTaskStage {
|
impl __sdk::InModule for AiTaskStage {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Column accessor struct for the table `AiTaskStage`.
|
/// Column accessor struct for the table `AiTaskStage`.
|
||||||
///
|
///
|
||||||
/// Provides typed access to columns for query building.
|
/// Provides typed access to columns for query building.
|
||||||
@@ -39,11 +46,11 @@ pub struct AiTaskStageCols {
|
|||||||
pub detail: __sdk::__query_builder::Col<AiTaskStage, String>,
|
pub detail: __sdk::__query_builder::Col<AiTaskStage, String>,
|
||||||
pub stage_order: __sdk::__query_builder::Col<AiTaskStage, u32>,
|
pub stage_order: __sdk::__query_builder::Col<AiTaskStage, u32>,
|
||||||
pub status: __sdk::__query_builder::Col<AiTaskStage, AiTaskStageStatus>,
|
pub status: __sdk::__query_builder::Col<AiTaskStage, AiTaskStageStatus>,
|
||||||
pub text_output: __sdk::__query_builder::Col<AiTaskStage, Option<String>>,
|
pub text_output: __sdk::__query_builder::Col<AiTaskStage, Option::<String>>,
|
||||||
pub structured_payload_json: __sdk::__query_builder::Col<AiTaskStage, Option<String>>,
|
pub structured_payload_json: __sdk::__query_builder::Col<AiTaskStage, Option::<String>>,
|
||||||
pub warning_messages: __sdk::__query_builder::Col<AiTaskStage, Vec<String>>,
|
pub warning_messages: __sdk::__query_builder::Col<AiTaskStage, Vec::<String>>,
|
||||||
pub started_at: __sdk::__query_builder::Col<AiTaskStage, Option<__sdk::Timestamp>>,
|
pub started_at: __sdk::__query_builder::Col<AiTaskStage, Option::<__sdk::Timestamp>>,
|
||||||
pub completed_at: __sdk::__query_builder::Col<AiTaskStage, Option<__sdk::Timestamp>>,
|
pub completed_at: __sdk::__query_builder::Col<AiTaskStage, Option::<__sdk::Timestamp>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl __sdk::__query_builder::HasCols for AiTaskStage {
|
impl __sdk::__query_builder::HasCols for AiTaskStage {
|
||||||
@@ -58,13 +65,11 @@ impl __sdk::__query_builder::HasCols for AiTaskStage {
|
|||||||
stage_order: __sdk::__query_builder::Col::new(table_name, "stage_order"),
|
stage_order: __sdk::__query_builder::Col::new(table_name, "stage_order"),
|
||||||
status: __sdk::__query_builder::Col::new(table_name, "status"),
|
status: __sdk::__query_builder::Col::new(table_name, "status"),
|
||||||
text_output: __sdk::__query_builder::Col::new(table_name, "text_output"),
|
text_output: __sdk::__query_builder::Col::new(table_name, "text_output"),
|
||||||
structured_payload_json: __sdk::__query_builder::Col::new(
|
structured_payload_json: __sdk::__query_builder::Col::new(table_name, "structured_payload_json"),
|
||||||
table_name,
|
|
||||||
"structured_payload_json",
|
|
||||||
),
|
|
||||||
warning_messages: __sdk::__query_builder::Col::new(table_name, "warning_messages"),
|
warning_messages: __sdk::__query_builder::Col::new(table_name, "warning_messages"),
|
||||||
started_at: __sdk::__query_builder::Col::new(table_name, "started_at"),
|
started_at: __sdk::__query_builder::Col::new(table_name, "started_at"),
|
||||||
completed_at: __sdk::__query_builder::Col::new(table_name, "completed_at"),
|
completed_at: __sdk::__query_builder::Col::new(table_name, "completed_at"),
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -83,8 +88,10 @@ impl __sdk::__query_builder::HasIxCols for AiTaskStage {
|
|||||||
AiTaskStageIxCols {
|
AiTaskStageIxCols {
|
||||||
task_id: __sdk::__query_builder::IxCol::new(table_name, "task_id"),
|
task_id: __sdk::__query_builder::IxCol::new(table_name, "task_id"),
|
||||||
task_stage_id: __sdk::__query_builder::IxCol::new(table_name, "task_stage_id"),
|
task_stage_id: __sdk::__query_builder::IxCol::new(table_name, "task_stage_id"),
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl __sdk::__query_builder::CanBeLookupTable for AiTaskStage {}
|
impl __sdk::__query_builder::CanBeLookupTable for AiTaskStage {}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,13 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
@@ -11,6 +17,8 @@ pub struct AiTaskStartInput {
|
|||||||
pub started_at_micros: i64,
|
pub started_at_micros: i64,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for AiTaskStartInput {
|
impl __sdk::InModule for AiTaskStartInput {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
@@ -17,8 +22,12 @@ pub enum AiTaskStatus {
|
|||||||
Failed,
|
Failed,
|
||||||
|
|
||||||
Cancelled,
|
Cancelled,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for AiTaskStatus {
|
impl __sdk::InModule for AiTaskStatus {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,10 +2,15 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
use super::ai_task_type::AiTask;
|
||||||
use super::ai_task_kind_type::AiTaskKind;
|
use super::ai_task_kind_type::AiTaskKind;
|
||||||
use super::ai_task_status_type::AiTaskStatus;
|
use super::ai_task_status_type::AiTaskStatus;
|
||||||
use super::ai_task_type::AiTask;
|
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
|
||||||
|
|
||||||
/// Table handle for the table `ai_task`.
|
/// Table handle for the table `ai_task`.
|
||||||
///
|
///
|
||||||
@@ -46,12 +51,8 @@ impl<'ctx> __sdk::Table for AiTaskTableHandle<'ctx> {
|
|||||||
type Row = AiTask;
|
type Row = AiTask;
|
||||||
type EventContext = super::EventContext;
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
fn count(&self) -> u64 {
|
fn count(&self) -> u64 { self.imp.count() }
|
||||||
self.imp.count()
|
fn iter(&self) -> impl Iterator<Item = AiTask> + '_ { self.imp.iter() }
|
||||||
}
|
|
||||||
fn iter(&self) -> impl Iterator<Item = AiTask> + '_ {
|
|
||||||
self.imp.iter()
|
|
||||||
}
|
|
||||||
|
|
||||||
type InsertCallbackId = AiTaskInsertCallbackId;
|
type InsertCallbackId = AiTaskInsertCallbackId;
|
||||||
|
|
||||||
@@ -97,38 +98,39 @@ impl<'ctx> __sdk::TableWithPrimaryKey for AiTaskTableHandle<'ctx> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Access to the `task_id` unique index on the table `ai_task`,
|
/// Access to the `task_id` unique index on the table `ai_task`,
|
||||||
/// which allows point queries on the field of the same name
|
/// which allows point queries on the field of the same name
|
||||||
/// via the [`AiTaskTaskIdUnique::find`] method.
|
/// via the [`AiTaskTaskIdUnique::find`] method.
|
||||||
///
|
///
|
||||||
/// Users are encouraged not to explicitly reference this type,
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
/// but to directly chain method calls,
|
/// but to directly chain method calls,
|
||||||
/// like `ctx.db.ai_task().task_id().find(...)`.
|
/// like `ctx.db.ai_task().task_id().find(...)`.
|
||||||
pub struct AiTaskTaskIdUnique<'ctx> {
|
pub struct AiTaskTaskIdUnique<'ctx> {
|
||||||
imp: __sdk::UniqueConstraintHandle<AiTask, String>,
|
imp: __sdk::UniqueConstraintHandle<AiTask, String>,
|
||||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
}
|
|
||||||
|
|
||||||
impl<'ctx> AiTaskTableHandle<'ctx> {
|
|
||||||
/// Get a handle on the `task_id` unique index on the table `ai_task`.
|
|
||||||
pub fn task_id(&self) -> AiTaskTaskIdUnique<'ctx> {
|
|
||||||
AiTaskTaskIdUnique {
|
|
||||||
imp: self.imp.get_unique_constraint::<String>("task_id"),
|
|
||||||
phantom: std::marker::PhantomData,
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'ctx> AiTaskTaskIdUnique<'ctx> {
|
impl<'ctx> AiTaskTableHandle<'ctx> {
|
||||||
/// Find the subscribed row whose `task_id` column value is equal to `col_val`,
|
/// Get a handle on the `task_id` unique index on the table `ai_task`.
|
||||||
/// if such a row is present in the client cache.
|
pub fn task_id(&self) -> AiTaskTaskIdUnique<'ctx> {
|
||||||
pub fn find(&self, col_val: &String) -> Option<AiTask> {
|
AiTaskTaskIdUnique {
|
||||||
self.imp.find(col_val)
|
imp: self.imp.get_unique_constraint::<String>("task_id"),
|
||||||
}
|
phantom: std::marker::PhantomData,
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> AiTaskTaskIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `task_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<AiTask> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
|
||||||
let _table = client_cache.get_or_make_table::<AiTask>("ai_task");
|
let _table = client_cache.get_or_make_table::<AiTask>("ai_task");
|
||||||
_table.add_unique_constraint::<String>("task_id", |row| &row.task_id);
|
_table.add_unique_constraint::<String>("task_id", |row| &row.task_id);
|
||||||
}
|
}
|
||||||
@@ -138,24 +140,26 @@ pub(super) fn parse_table_update(
|
|||||||
raw_updates: __ws::v2::TableUpdate,
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
) -> __sdk::Result<__sdk::TableUpdate<AiTask>> {
|
) -> __sdk::Result<__sdk::TableUpdate<AiTask>> {
|
||||||
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
__sdk::InternalError::failed_parse("TableUpdate<AiTask>", "TableUpdate")
|
__sdk::InternalError::failed_parse(
|
||||||
.with_cause(e)
|
"TableUpdate<AiTask>",
|
||||||
.into()
|
"TableUpdate",
|
||||||
|
).with_cause(e).into()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(non_camel_case_types)]
|
#[allow(non_camel_case_types)]
|
||||||
/// Extension trait for query builder access to the table `AiTask`.
|
/// Extension trait for query builder access to the table `AiTask`.
|
||||||
///
|
///
|
||||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
pub trait ai_taskQueryTableAccess {
|
pub trait ai_taskQueryTableAccess {
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
/// Get a query builder for the table `AiTask`.
|
/// Get a query builder for the table `AiTask`.
|
||||||
fn ai_task(&self) -> __sdk::__query_builder::Table<AiTask>;
|
fn ai_task(&self) -> __sdk::__query_builder::Table<AiTask>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl ai_taskQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn ai_task(&self) -> __sdk::__query_builder::Table<AiTask> {
|
||||||
|
__sdk::__query_builder::Table::new("ai_task")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl ai_taskQueryTableAccess for __sdk::QueryTableAccessor {
|
|
||||||
fn ai_task(&self) -> __sdk::__query_builder::Table<AiTask> {
|
|
||||||
__sdk::__query_builder::Table::new("ai_task")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::ai_task_kind_type::AiTaskKind;
|
use super::ai_task_kind_type::AiTaskKind;
|
||||||
use super::ai_task_status_type::AiTaskStatus;
|
use super::ai_task_status_type::AiTaskStatus;
|
||||||
@@ -15,23 +20,25 @@ pub struct AiTask {
|
|||||||
pub owner_user_id: String,
|
pub owner_user_id: String,
|
||||||
pub request_label: String,
|
pub request_label: String,
|
||||||
pub source_module: String,
|
pub source_module: String,
|
||||||
pub source_entity_id: Option<String>,
|
pub source_entity_id: Option::<String>,
|
||||||
pub request_payload_json: Option<String>,
|
pub request_payload_json: Option::<String>,
|
||||||
pub status: AiTaskStatus,
|
pub status: AiTaskStatus,
|
||||||
pub failure_message: Option<String>,
|
pub failure_message: Option::<String>,
|
||||||
pub latest_text_output: Option<String>,
|
pub latest_text_output: Option::<String>,
|
||||||
pub latest_structured_payload_json: Option<String>,
|
pub latest_structured_payload_json: Option::<String>,
|
||||||
pub version: u32,
|
pub version: u32,
|
||||||
pub created_at: __sdk::Timestamp,
|
pub created_at: __sdk::Timestamp,
|
||||||
pub started_at: Option<__sdk::Timestamp>,
|
pub started_at: Option::<__sdk::Timestamp>,
|
||||||
pub completed_at: Option<__sdk::Timestamp>,
|
pub completed_at: Option::<__sdk::Timestamp>,
|
||||||
pub updated_at: __sdk::Timestamp,
|
pub updated_at: __sdk::Timestamp,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for AiTask {
|
impl __sdk::InModule for AiTask {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Column accessor struct for the table `AiTask`.
|
/// Column accessor struct for the table `AiTask`.
|
||||||
///
|
///
|
||||||
/// Provides typed access to columns for query building.
|
/// Provides typed access to columns for query building.
|
||||||
@@ -41,16 +48,16 @@ pub struct AiTaskCols {
|
|||||||
pub owner_user_id: __sdk::__query_builder::Col<AiTask, String>,
|
pub owner_user_id: __sdk::__query_builder::Col<AiTask, String>,
|
||||||
pub request_label: __sdk::__query_builder::Col<AiTask, String>,
|
pub request_label: __sdk::__query_builder::Col<AiTask, String>,
|
||||||
pub source_module: __sdk::__query_builder::Col<AiTask, String>,
|
pub source_module: __sdk::__query_builder::Col<AiTask, String>,
|
||||||
pub source_entity_id: __sdk::__query_builder::Col<AiTask, Option<String>>,
|
pub source_entity_id: __sdk::__query_builder::Col<AiTask, Option::<String>>,
|
||||||
pub request_payload_json: __sdk::__query_builder::Col<AiTask, Option<String>>,
|
pub request_payload_json: __sdk::__query_builder::Col<AiTask, Option::<String>>,
|
||||||
pub status: __sdk::__query_builder::Col<AiTask, AiTaskStatus>,
|
pub status: __sdk::__query_builder::Col<AiTask, AiTaskStatus>,
|
||||||
pub failure_message: __sdk::__query_builder::Col<AiTask, Option<String>>,
|
pub failure_message: __sdk::__query_builder::Col<AiTask, Option::<String>>,
|
||||||
pub latest_text_output: __sdk::__query_builder::Col<AiTask, Option<String>>,
|
pub latest_text_output: __sdk::__query_builder::Col<AiTask, Option::<String>>,
|
||||||
pub latest_structured_payload_json: __sdk::__query_builder::Col<AiTask, Option<String>>,
|
pub latest_structured_payload_json: __sdk::__query_builder::Col<AiTask, Option::<String>>,
|
||||||
pub version: __sdk::__query_builder::Col<AiTask, u32>,
|
pub version: __sdk::__query_builder::Col<AiTask, u32>,
|
||||||
pub created_at: __sdk::__query_builder::Col<AiTask, __sdk::Timestamp>,
|
pub created_at: __sdk::__query_builder::Col<AiTask, __sdk::Timestamp>,
|
||||||
pub started_at: __sdk::__query_builder::Col<AiTask, Option<__sdk::Timestamp>>,
|
pub started_at: __sdk::__query_builder::Col<AiTask, Option::<__sdk::Timestamp>>,
|
||||||
pub completed_at: __sdk::__query_builder::Col<AiTask, Option<__sdk::Timestamp>>,
|
pub completed_at: __sdk::__query_builder::Col<AiTask, Option::<__sdk::Timestamp>>,
|
||||||
pub updated_at: __sdk::__query_builder::Col<AiTask, __sdk::Timestamp>,
|
pub updated_at: __sdk::__query_builder::Col<AiTask, __sdk::Timestamp>,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,22 +71,17 @@ impl __sdk::__query_builder::HasCols for AiTask {
|
|||||||
request_label: __sdk::__query_builder::Col::new(table_name, "request_label"),
|
request_label: __sdk::__query_builder::Col::new(table_name, "request_label"),
|
||||||
source_module: __sdk::__query_builder::Col::new(table_name, "source_module"),
|
source_module: __sdk::__query_builder::Col::new(table_name, "source_module"),
|
||||||
source_entity_id: __sdk::__query_builder::Col::new(table_name, "source_entity_id"),
|
source_entity_id: __sdk::__query_builder::Col::new(table_name, "source_entity_id"),
|
||||||
request_payload_json: __sdk::__query_builder::Col::new(
|
request_payload_json: __sdk::__query_builder::Col::new(table_name, "request_payload_json"),
|
||||||
table_name,
|
|
||||||
"request_payload_json",
|
|
||||||
),
|
|
||||||
status: __sdk::__query_builder::Col::new(table_name, "status"),
|
status: __sdk::__query_builder::Col::new(table_name, "status"),
|
||||||
failure_message: __sdk::__query_builder::Col::new(table_name, "failure_message"),
|
failure_message: __sdk::__query_builder::Col::new(table_name, "failure_message"),
|
||||||
latest_text_output: __sdk::__query_builder::Col::new(table_name, "latest_text_output"),
|
latest_text_output: __sdk::__query_builder::Col::new(table_name, "latest_text_output"),
|
||||||
latest_structured_payload_json: __sdk::__query_builder::Col::new(
|
latest_structured_payload_json: __sdk::__query_builder::Col::new(table_name, "latest_structured_payload_json"),
|
||||||
table_name,
|
|
||||||
"latest_structured_payload_json",
|
|
||||||
),
|
|
||||||
version: __sdk::__query_builder::Col::new(table_name, "version"),
|
version: __sdk::__query_builder::Col::new(table_name, "version"),
|
||||||
created_at: __sdk::__query_builder::Col::new(table_name, "created_at"),
|
created_at: __sdk::__query_builder::Col::new(table_name, "created_at"),
|
||||||
started_at: __sdk::__query_builder::Col::new(table_name, "started_at"),
|
started_at: __sdk::__query_builder::Col::new(table_name, "started_at"),
|
||||||
completed_at: __sdk::__query_builder::Col::new(table_name, "completed_at"),
|
completed_at: __sdk::__query_builder::Col::new(table_name, "completed_at"),
|
||||||
updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"),
|
updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"),
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -102,8 +104,10 @@ impl __sdk::__query_builder::HasIxCols for AiTask {
|
|||||||
status: __sdk::__query_builder::IxCol::new(table_name, "status"),
|
status: __sdk::__query_builder::IxCol::new(table_name, "status"),
|
||||||
task_id: __sdk::__query_builder::IxCol::new(table_name, "task_id"),
|
task_id: __sdk::__query_builder::IxCol::new(table_name, "task_id"),
|
||||||
task_kind: __sdk::__query_builder::IxCol::new(table_name, "task_kind"),
|
task_kind: __sdk::__query_builder::IxCol::new(table_name, "task_kind"),
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl __sdk::__query_builder::CanBeLookupTable for AiTask {}
|
impl __sdk::__query_builder::CanBeLookupTable for AiTask {}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::ai_task_stage_kind_type::AiTaskStageKind;
|
use super::ai_task_stage_kind_type::AiTaskStageKind;
|
||||||
|
|
||||||
@@ -16,6 +21,8 @@ pub struct AiTextChunkAppendInput {
|
|||||||
pub created_at_micros: i64,
|
pub created_at_micros: i64,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for AiTextChunkAppendInput {
|
impl __sdk::InModule for AiTextChunkAppendInput {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::ai_task_stage_kind_type::AiTaskStageKind;
|
use super::ai_task_stage_kind_type::AiTaskStageKind;
|
||||||
|
|
||||||
@@ -17,6 +22,8 @@ pub struct AiTextChunkSnapshot {
|
|||||||
pub created_at_micros: i64,
|
pub created_at_micros: i64,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for AiTextChunkSnapshot {
|
impl __sdk::InModule for AiTextChunkSnapshot {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,14 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use super::ai_task_stage_kind_type::AiTaskStageKind;
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
use super::ai_text_chunk_type::AiTextChunk;
|
use super::ai_text_chunk_type::AiTextChunk;
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use super::ai_task_stage_kind_type::AiTaskStageKind;
|
||||||
|
|
||||||
/// Table handle for the table `ai_text_chunk`.
|
/// Table handle for the table `ai_text_chunk`.
|
||||||
///
|
///
|
||||||
@@ -45,12 +50,8 @@ impl<'ctx> __sdk::Table for AiTextChunkTableHandle<'ctx> {
|
|||||||
type Row = AiTextChunk;
|
type Row = AiTextChunk;
|
||||||
type EventContext = super::EventContext;
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
fn count(&self) -> u64 {
|
fn count(&self) -> u64 { self.imp.count() }
|
||||||
self.imp.count()
|
fn iter(&self) -> impl Iterator<Item = AiTextChunk> + '_ { self.imp.iter() }
|
||||||
}
|
|
||||||
fn iter(&self) -> impl Iterator<Item = AiTextChunk> + '_ {
|
|
||||||
self.imp.iter()
|
|
||||||
}
|
|
||||||
|
|
||||||
type InsertCallbackId = AiTextChunkInsertCallbackId;
|
type InsertCallbackId = AiTextChunkInsertCallbackId;
|
||||||
|
|
||||||
@@ -96,40 +97,39 @@ impl<'ctx> __sdk::TableWithPrimaryKey for AiTextChunkTableHandle<'ctx> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Access to the `text_chunk_row_id` unique index on the table `ai_text_chunk`,
|
/// Access to the `text_chunk_row_id` unique index on the table `ai_text_chunk`,
|
||||||
/// which allows point queries on the field of the same name
|
/// which allows point queries on the field of the same name
|
||||||
/// via the [`AiTextChunkTextChunkRowIdUnique::find`] method.
|
/// via the [`AiTextChunkTextChunkRowIdUnique::find`] method.
|
||||||
///
|
///
|
||||||
/// Users are encouraged not to explicitly reference this type,
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
/// but to directly chain method calls,
|
/// but to directly chain method calls,
|
||||||
/// like `ctx.db.ai_text_chunk().text_chunk_row_id().find(...)`.
|
/// like `ctx.db.ai_text_chunk().text_chunk_row_id().find(...)`.
|
||||||
pub struct AiTextChunkTextChunkRowIdUnique<'ctx> {
|
pub struct AiTextChunkTextChunkRowIdUnique<'ctx> {
|
||||||
imp: __sdk::UniqueConstraintHandle<AiTextChunk, String>,
|
imp: __sdk::UniqueConstraintHandle<AiTextChunk, String>,
|
||||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
}
|
|
||||||
|
|
||||||
impl<'ctx> AiTextChunkTableHandle<'ctx> {
|
|
||||||
/// Get a handle on the `text_chunk_row_id` unique index on the table `ai_text_chunk`.
|
|
||||||
pub fn text_chunk_row_id(&self) -> AiTextChunkTextChunkRowIdUnique<'ctx> {
|
|
||||||
AiTextChunkTextChunkRowIdUnique {
|
|
||||||
imp: self
|
|
||||||
.imp
|
|
||||||
.get_unique_constraint::<String>("text_chunk_row_id"),
|
|
||||||
phantom: std::marker::PhantomData,
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'ctx> AiTextChunkTextChunkRowIdUnique<'ctx> {
|
impl<'ctx> AiTextChunkTableHandle<'ctx> {
|
||||||
/// Find the subscribed row whose `text_chunk_row_id` column value is equal to `col_val`,
|
/// Get a handle on the `text_chunk_row_id` unique index on the table `ai_text_chunk`.
|
||||||
/// if such a row is present in the client cache.
|
pub fn text_chunk_row_id(&self) -> AiTextChunkTextChunkRowIdUnique<'ctx> {
|
||||||
pub fn find(&self, col_val: &String) -> Option<AiTextChunk> {
|
AiTextChunkTextChunkRowIdUnique {
|
||||||
self.imp.find(col_val)
|
imp: self.imp.get_unique_constraint::<String>("text_chunk_row_id"),
|
||||||
}
|
phantom: std::marker::PhantomData,
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> AiTextChunkTextChunkRowIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `text_chunk_row_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<AiTextChunk> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
|
||||||
let _table = client_cache.get_or_make_table::<AiTextChunk>("ai_text_chunk");
|
let _table = client_cache.get_or_make_table::<AiTextChunk>("ai_text_chunk");
|
||||||
_table.add_unique_constraint::<String>("text_chunk_row_id", |row| &row.text_chunk_row_id);
|
_table.add_unique_constraint::<String>("text_chunk_row_id", |row| &row.text_chunk_row_id);
|
||||||
}
|
}
|
||||||
@@ -139,24 +139,26 @@ pub(super) fn parse_table_update(
|
|||||||
raw_updates: __ws::v2::TableUpdate,
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
) -> __sdk::Result<__sdk::TableUpdate<AiTextChunk>> {
|
) -> __sdk::Result<__sdk::TableUpdate<AiTextChunk>> {
|
||||||
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
__sdk::InternalError::failed_parse("TableUpdate<AiTextChunk>", "TableUpdate")
|
__sdk::InternalError::failed_parse(
|
||||||
.with_cause(e)
|
"TableUpdate<AiTextChunk>",
|
||||||
.into()
|
"TableUpdate",
|
||||||
|
).with_cause(e).into()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(non_camel_case_types)]
|
#[allow(non_camel_case_types)]
|
||||||
/// Extension trait for query builder access to the table `AiTextChunk`.
|
/// Extension trait for query builder access to the table `AiTextChunk`.
|
||||||
///
|
///
|
||||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
pub trait ai_text_chunkQueryTableAccess {
|
pub trait ai_text_chunkQueryTableAccess {
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
/// Get a query builder for the table `AiTextChunk`.
|
/// Get a query builder for the table `AiTextChunk`.
|
||||||
fn ai_text_chunk(&self) -> __sdk::__query_builder::Table<AiTextChunk>;
|
fn ai_text_chunk(&self) -> __sdk::__query_builder::Table<AiTextChunk>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl ai_text_chunkQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn ai_text_chunk(&self) -> __sdk::__query_builder::Table<AiTextChunk> {
|
||||||
|
__sdk::__query_builder::Table::new("ai_text_chunk")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl ai_text_chunkQueryTableAccess for __sdk::QueryTableAccessor {
|
|
||||||
fn ai_text_chunk(&self) -> __sdk::__query_builder::Table<AiTextChunk> {
|
|
||||||
__sdk::__query_builder::Table::new("ai_text_chunk")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::ai_task_stage_kind_type::AiTaskStageKind;
|
use super::ai_task_stage_kind_type::AiTaskStageKind;
|
||||||
|
|
||||||
@@ -18,10 +23,12 @@ pub struct AiTextChunk {
|
|||||||
pub created_at: __sdk::Timestamp,
|
pub created_at: __sdk::Timestamp,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for AiTextChunk {
|
impl __sdk::InModule for AiTextChunk {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Column accessor struct for the table `AiTextChunk`.
|
/// Column accessor struct for the table `AiTextChunk`.
|
||||||
///
|
///
|
||||||
/// Provides typed access to columns for query building.
|
/// Provides typed access to columns for query building.
|
||||||
@@ -46,6 +53,7 @@ impl __sdk::__query_builder::HasCols for AiTextChunk {
|
|||||||
sequence: __sdk::__query_builder::Col::new(table_name, "sequence"),
|
sequence: __sdk::__query_builder::Col::new(table_name, "sequence"),
|
||||||
delta_text: __sdk::__query_builder::Col::new(table_name, "delta_text"),
|
delta_text: __sdk::__query_builder::Col::new(table_name, "delta_text"),
|
||||||
created_at: __sdk::__query_builder::Col::new(table_name, "created_at"),
|
created_at: __sdk::__query_builder::Col::new(table_name, "created_at"),
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -64,8 +72,10 @@ impl __sdk::__query_builder::HasIxCols for AiTextChunk {
|
|||||||
AiTextChunkIxCols {
|
AiTextChunkIxCols {
|
||||||
task_id: __sdk::__query_builder::IxCol::new(table_name, "task_id"),
|
task_id: __sdk::__query_builder::IxCol::new(table_name, "task_id"),
|
||||||
text_chunk_row_id: __sdk::__query_builder::IxCol::new(table_name, "text_chunk_row_id"),
|
text_chunk_row_id: __sdk::__query_builder::IxCol::new(table_name, "text_chunk_row_id"),
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl __sdk::__query_builder::CanBeLookupTable for AiTextChunk {}
|
impl __sdk::__query_builder::CanBeLookupTable for AiTextChunk {}
|
||||||
|
|
||||||
|
|||||||
@@ -2,17 +2,23 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::ai_task_procedure_result_type::AiTaskProcedureResult;
|
|
||||||
use super::ai_text_chunk_append_input_type::AiTextChunkAppendInput;
|
use super::ai_text_chunk_append_input_type::AiTextChunkAppendInput;
|
||||||
|
use super::ai_task_procedure_result_type::AiTaskProcedureResult;
|
||||||
|
|
||||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
struct AppendAiTextChunkAndReturnArgs {
|
struct AppendAiTextChunkAndReturnArgs {
|
||||||
pub input: AiTextChunkAppendInput,
|
pub input: AiTextChunkAppendInput,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for AppendAiTextChunkAndReturnArgs {
|
impl __sdk::InModule for AppendAiTextChunkAndReturnArgs {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
@@ -22,19 +28,16 @@ impl __sdk::InModule for AppendAiTextChunkAndReturnArgs {
|
|||||||
///
|
///
|
||||||
/// Implemented for [`super::RemoteProcedures`].
|
/// Implemented for [`super::RemoteProcedures`].
|
||||||
pub trait append_ai_text_chunk_and_return {
|
pub trait append_ai_text_chunk_and_return {
|
||||||
fn append_ai_text_chunk_and_return(&self, input: AiTextChunkAppendInput) {
|
fn append_ai_text_chunk_and_return(&self, input: AiTextChunkAppendInput,
|
||||||
self.append_ai_text_chunk_and_return_then(input, |_, _| {});
|
) {
|
||||||
|
self.append_ai_text_chunk_and_return_then(input, |_, _| {});
|
||||||
}
|
}
|
||||||
|
|
||||||
fn append_ai_text_chunk_and_return_then(
|
fn append_ai_text_chunk_and_return_then(
|
||||||
&self,
|
&self,
|
||||||
input: AiTextChunkAppendInput,
|
input: AiTextChunkAppendInput,
|
||||||
|
|
||||||
__callback: impl FnOnce(
|
__callback: impl FnOnce(&super::ProcedureEventContext, Result<AiTaskProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||||
&super::ProcedureEventContext,
|
|
||||||
Result<AiTaskProcedureResult, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,17 +46,13 @@ impl append_ai_text_chunk_and_return for super::RemoteProcedures {
|
|||||||
&self,
|
&self,
|
||||||
input: AiTextChunkAppendInput,
|
input: AiTextChunkAppendInput,
|
||||||
|
|
||||||
__callback: impl FnOnce(
|
__callback: impl FnOnce(&super::ProcedureEventContext, Result<AiTaskProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||||
&super::ProcedureEventContext,
|
|
||||||
Result<AiTaskProcedureResult, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
|
||||||
) {
|
) {
|
||||||
self.imp
|
self.imp.invoke_procedure_with_callback::<_, AiTaskProcedureResult>(
|
||||||
.invoke_procedure_with_callback::<_, AiTaskProcedureResult>(
|
"append_ai_text_chunk_and_return",
|
||||||
"append_ai_text_chunk_and_return",
|
AppendAiTextChunkAndReturnArgs { input, },
|
||||||
AppendAiTextChunkAndReturnArgs { input },
|
__callback,
|
||||||
__callback,
|
);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,17 +2,23 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::chapter_progression_ledger_input_type::ChapterProgressionLedgerInput;
|
use super::chapter_progression_ledger_input_type::ChapterProgressionLedgerInput;
|
||||||
use super::chapter_progression_procedure_result_type::ChapterProgressionProcedureResult;
|
use super::chapter_progression_procedure_result_type::ChapterProgressionProcedureResult;
|
||||||
|
|
||||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
struct ApplyChapterProgressionLedgerEntryAndReturnArgs {
|
struct ApplyChapterProgressionLedgerEntryAndReturnArgs {
|
||||||
pub input: ChapterProgressionLedgerInput,
|
pub input: ChapterProgressionLedgerInput,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for ApplyChapterProgressionLedgerEntryAndReturnArgs {
|
impl __sdk::InModule for ApplyChapterProgressionLedgerEntryAndReturnArgs {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
@@ -22,22 +28,16 @@ impl __sdk::InModule for ApplyChapterProgressionLedgerEntryAndReturnArgs {
|
|||||||
///
|
///
|
||||||
/// Implemented for [`super::RemoteProcedures`].
|
/// Implemented for [`super::RemoteProcedures`].
|
||||||
pub trait apply_chapter_progression_ledger_entry_and_return {
|
pub trait apply_chapter_progression_ledger_entry_and_return {
|
||||||
fn apply_chapter_progression_ledger_entry_and_return(
|
fn apply_chapter_progression_ledger_entry_and_return(&self, input: ChapterProgressionLedgerInput,
|
||||||
&self,
|
) {
|
||||||
input: ChapterProgressionLedgerInput,
|
self.apply_chapter_progression_ledger_entry_and_return_then(input, |_, _| {});
|
||||||
) {
|
|
||||||
self.apply_chapter_progression_ledger_entry_and_return_then(input, |_, _| {});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn apply_chapter_progression_ledger_entry_and_return_then(
|
fn apply_chapter_progression_ledger_entry_and_return_then(
|
||||||
&self,
|
&self,
|
||||||
input: ChapterProgressionLedgerInput,
|
input: ChapterProgressionLedgerInput,
|
||||||
|
|
||||||
__callback: impl FnOnce(
|
__callback: impl FnOnce(&super::ProcedureEventContext, Result<ChapterProgressionProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||||
&super::ProcedureEventContext,
|
|
||||||
Result<ChapterProgressionProcedureResult, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,17 +46,13 @@ impl apply_chapter_progression_ledger_entry_and_return for super::RemoteProcedur
|
|||||||
&self,
|
&self,
|
||||||
input: ChapterProgressionLedgerInput,
|
input: ChapterProgressionLedgerInput,
|
||||||
|
|
||||||
__callback: impl FnOnce(
|
__callback: impl FnOnce(&super::ProcedureEventContext, Result<ChapterProgressionProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||||
&super::ProcedureEventContext,
|
|
||||||
Result<ChapterProgressionProcedureResult, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
|
||||||
) {
|
) {
|
||||||
self.imp
|
self.imp.invoke_procedure_with_callback::<_, ChapterProgressionProcedureResult>(
|
||||||
.invoke_procedure_with_callback::<_, ChapterProgressionProcedureResult>(
|
"apply_chapter_progression_ledger_entry_and_return",
|
||||||
"apply_chapter_progression_ledger_entry_and_return",
|
ApplyChapterProgressionLedgerEntryAndReturnArgs { input, },
|
||||||
ApplyChapterProgressionLedgerEntryAndReturnArgs { input },
|
__callback,
|
||||||
__callback,
|
);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::chapter_progression_ledger_input_type::ChapterProgressionLedgerInput;
|
use super::chapter_progression_ledger_input_type::ChapterProgressionLedgerInput;
|
||||||
|
|
||||||
@@ -14,8 +19,10 @@ pub(super) struct ApplyChapterProgressionLedgerEntryArgs {
|
|||||||
|
|
||||||
impl From<ApplyChapterProgressionLedgerEntryArgs> for super::Reducer {
|
impl From<ApplyChapterProgressionLedgerEntryArgs> for super::Reducer {
|
||||||
fn from(args: ApplyChapterProgressionLedgerEntryArgs) -> Self {
|
fn from(args: ApplyChapterProgressionLedgerEntryArgs) -> Self {
|
||||||
Self::ApplyChapterProgressionLedgerEntry { input: args.input }
|
Self::ApplyChapterProgressionLedgerEntry {
|
||||||
}
|
input: args.input,
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl __sdk::InModule for ApplyChapterProgressionLedgerEntryArgs {
|
impl __sdk::InModule for ApplyChapterProgressionLedgerEntryArgs {
|
||||||
@@ -33,11 +40,9 @@ pub trait apply_chapter_progression_ledger_entry {
|
|||||||
/// The reducer will run asynchronously in the future,
|
/// The reducer will run asynchronously in the future,
|
||||||
/// and this method provides no way to listen for its completion status.
|
/// and this method provides no way to listen for its completion status.
|
||||||
/// /// Use [`apply_chapter_progression_ledger_entry:apply_chapter_progression_ledger_entry_then`] to run a callback after the reducer completes.
|
/// /// Use [`apply_chapter_progression_ledger_entry:apply_chapter_progression_ledger_entry_then`] to run a callback after the reducer completes.
|
||||||
fn apply_chapter_progression_ledger_entry(
|
fn apply_chapter_progression_ledger_entry(&self, input: ChapterProgressionLedgerInput,
|
||||||
&self,
|
) -> __sdk::Result<()> {
|
||||||
input: ChapterProgressionLedgerInput,
|
self.apply_chapter_progression_ledger_entry_then(input, |_, _| {})
|
||||||
) -> __sdk::Result<()> {
|
|
||||||
self.apply_chapter_progression_ledger_entry_then(input, |_, _| {})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Request that the remote module invoke the reducer `apply_chapter_progression_ledger_entry` to run as soon as possible,
|
/// Request that the remote module invoke the reducer `apply_chapter_progression_ledger_entry` to run as soon as possible,
|
||||||
@@ -65,9 +70,7 @@ impl apply_chapter_progression_ledger_entry for super::RemoteReducers {
|
|||||||
+ Send
|
+ Send
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()> {
|
) -> __sdk::Result<()> {
|
||||||
self.imp.invoke_reducer_with_callback(
|
self.imp.invoke_reducer_with_callback(ApplyChapterProgressionLedgerEntryArgs { input, }, callback)
|
||||||
ApplyChapterProgressionLedgerEntryArgs { input },
|
|
||||||
callback,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::inventory_mutation_input_type::InventoryMutationInput;
|
use super::inventory_mutation_input_type::InventoryMutationInput;
|
||||||
|
|
||||||
@@ -14,8 +19,10 @@ pub(super) struct ApplyInventoryMutationArgs {
|
|||||||
|
|
||||||
impl From<ApplyInventoryMutationArgs> for super::Reducer {
|
impl From<ApplyInventoryMutationArgs> for super::Reducer {
|
||||||
fn from(args: ApplyInventoryMutationArgs) -> Self {
|
fn from(args: ApplyInventoryMutationArgs) -> Self {
|
||||||
Self::ApplyInventoryMutation { input: args.input }
|
Self::ApplyInventoryMutation {
|
||||||
}
|
input: args.input,
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl __sdk::InModule for ApplyInventoryMutationArgs {
|
impl __sdk::InModule for ApplyInventoryMutationArgs {
|
||||||
@@ -33,8 +40,9 @@ pub trait apply_inventory_mutation {
|
|||||||
/// The reducer will run asynchronously in the future,
|
/// The reducer will run asynchronously in the future,
|
||||||
/// and this method provides no way to listen for its completion status.
|
/// and this method provides no way to listen for its completion status.
|
||||||
/// /// Use [`apply_inventory_mutation:apply_inventory_mutation_then`] to run a callback after the reducer completes.
|
/// /// Use [`apply_inventory_mutation:apply_inventory_mutation_then`] to run a callback after the reducer completes.
|
||||||
fn apply_inventory_mutation(&self, input: InventoryMutationInput) -> __sdk::Result<()> {
|
fn apply_inventory_mutation(&self, input: InventoryMutationInput,
|
||||||
self.apply_inventory_mutation_then(input, |_, _| {})
|
) -> __sdk::Result<()> {
|
||||||
|
self.apply_inventory_mutation_then(input, |_, _| {})
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Request that the remote module invoke the reducer `apply_inventory_mutation` to run as soon as possible,
|
/// Request that the remote module invoke the reducer `apply_inventory_mutation` to run as soon as possible,
|
||||||
@@ -62,7 +70,7 @@ impl apply_inventory_mutation for super::RemoteReducers {
|
|||||||
+ Send
|
+ Send
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()> {
|
) -> __sdk::Result<()> {
|
||||||
self.imp
|
self.imp.invoke_reducer_with_callback(ApplyInventoryMutationArgs { input, }, callback)
|
||||||
.invoke_reducer_with_callback(ApplyInventoryMutationArgs { input }, callback)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::quest_signal_apply_input_type::QuestSignalApplyInput;
|
use super::quest_signal_apply_input_type::QuestSignalApplyInput;
|
||||||
|
|
||||||
@@ -14,8 +19,10 @@ pub(super) struct ApplyQuestSignalArgs {
|
|||||||
|
|
||||||
impl From<ApplyQuestSignalArgs> for super::Reducer {
|
impl From<ApplyQuestSignalArgs> for super::Reducer {
|
||||||
fn from(args: ApplyQuestSignalArgs) -> Self {
|
fn from(args: ApplyQuestSignalArgs) -> Self {
|
||||||
Self::ApplyQuestSignal { input: args.input }
|
Self::ApplyQuestSignal {
|
||||||
}
|
input: args.input,
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl __sdk::InModule for ApplyQuestSignalArgs {
|
impl __sdk::InModule for ApplyQuestSignalArgs {
|
||||||
@@ -33,8 +40,9 @@ pub trait apply_quest_signal {
|
|||||||
/// The reducer will run asynchronously in the future,
|
/// The reducer will run asynchronously in the future,
|
||||||
/// and this method provides no way to listen for its completion status.
|
/// and this method provides no way to listen for its completion status.
|
||||||
/// /// Use [`apply_quest_signal:apply_quest_signal_then`] to run a callback after the reducer completes.
|
/// /// Use [`apply_quest_signal:apply_quest_signal_then`] to run a callback after the reducer completes.
|
||||||
fn apply_quest_signal(&self, input: QuestSignalApplyInput) -> __sdk::Result<()> {
|
fn apply_quest_signal(&self, input: QuestSignalApplyInput,
|
||||||
self.apply_quest_signal_then(input, |_, _| {})
|
) -> __sdk::Result<()> {
|
||||||
|
self.apply_quest_signal_then(input, |_, _| {})
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Request that the remote module invoke the reducer `apply_quest_signal` to run as soon as possible,
|
/// Request that the remote module invoke the reducer `apply_quest_signal` to run as soon as possible,
|
||||||
@@ -62,7 +70,7 @@ impl apply_quest_signal for super::RemoteReducers {
|
|||||||
+ Send
|
+ Send
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()> {
|
) -> __sdk::Result<()> {
|
||||||
self.imp
|
self.imp.invoke_reducer_with_callback(ApplyQuestSignalArgs { input, }, callback)
|
||||||
.invoke_reducer_with_callback(ApplyQuestSignalArgs { input }, callback)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,13 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
@@ -13,11 +19,13 @@ pub struct AssetEntityBindingInput {
|
|||||||
pub entity_id: String,
|
pub entity_id: String,
|
||||||
pub slot: String,
|
pub slot: String,
|
||||||
pub asset_kind: String,
|
pub asset_kind: String,
|
||||||
pub owner_user_id: Option<String>,
|
pub owner_user_id: Option::<String>,
|
||||||
pub profile_id: Option<String>,
|
pub profile_id: Option::<String>,
|
||||||
pub updated_at_micros: i64,
|
pub updated_at_micros: i64,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for AssetEntityBindingInput {
|
impl __sdk::InModule for AssetEntityBindingInput {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::asset_entity_binding_snapshot_type::AssetEntityBindingSnapshot;
|
use super::asset_entity_binding_snapshot_type::AssetEntityBindingSnapshot;
|
||||||
|
|
||||||
@@ -10,10 +15,12 @@ use super::asset_entity_binding_snapshot_type::AssetEntityBindingSnapshot;
|
|||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
pub struct AssetEntityBindingProcedureResult {
|
pub struct AssetEntityBindingProcedureResult {
|
||||||
pub ok: bool,
|
pub ok: bool,
|
||||||
pub record: Option<AssetEntityBindingSnapshot>,
|
pub record: Option::<AssetEntityBindingSnapshot>,
|
||||||
pub error_message: Option<String>,
|
pub error_message: Option::<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for AssetEntityBindingProcedureResult {
|
impl __sdk::InModule for AssetEntityBindingProcedureResult {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,13 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
@@ -13,12 +19,14 @@ pub struct AssetEntityBindingSnapshot {
|
|||||||
pub entity_id: String,
|
pub entity_id: String,
|
||||||
pub slot: String,
|
pub slot: String,
|
||||||
pub asset_kind: String,
|
pub asset_kind: String,
|
||||||
pub owner_user_id: Option<String>,
|
pub owner_user_id: Option::<String>,
|
||||||
pub profile_id: Option<String>,
|
pub profile_id: Option::<String>,
|
||||||
pub created_at_micros: i64,
|
pub created_at_micros: i64,
|
||||||
pub updated_at_micros: i64,
|
pub updated_at_micros: i64,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for AssetEntityBindingSnapshot {
|
impl __sdk::InModule for AssetEntityBindingSnapshot {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,13 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
use super::asset_entity_binding_type::AssetEntityBinding;
|
use super::asset_entity_binding_type::AssetEntityBinding;
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
|
||||||
|
|
||||||
/// Table handle for the table `asset_entity_binding`.
|
/// Table handle for the table `asset_entity_binding`.
|
||||||
///
|
///
|
||||||
@@ -31,9 +36,7 @@ pub trait AssetEntityBindingTableAccess {
|
|||||||
impl AssetEntityBindingTableAccess for super::RemoteTables {
|
impl AssetEntityBindingTableAccess for super::RemoteTables {
|
||||||
fn asset_entity_binding(&self) -> AssetEntityBindingTableHandle<'_> {
|
fn asset_entity_binding(&self) -> AssetEntityBindingTableHandle<'_> {
|
||||||
AssetEntityBindingTableHandle {
|
AssetEntityBindingTableHandle {
|
||||||
imp: self
|
imp: self.imp.get_table::<AssetEntityBinding>("asset_entity_binding"),
|
||||||
.imp
|
|
||||||
.get_table::<AssetEntityBinding>("asset_entity_binding"),
|
|
||||||
ctx: std::marker::PhantomData,
|
ctx: std::marker::PhantomData,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -46,12 +49,8 @@ impl<'ctx> __sdk::Table for AssetEntityBindingTableHandle<'ctx> {
|
|||||||
type Row = AssetEntityBinding;
|
type Row = AssetEntityBinding;
|
||||||
type EventContext = super::EventContext;
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
fn count(&self) -> u64 {
|
fn count(&self) -> u64 { self.imp.count() }
|
||||||
self.imp.count()
|
fn iter(&self) -> impl Iterator<Item = AssetEntityBinding> + '_ { self.imp.iter() }
|
||||||
}
|
|
||||||
fn iter(&self) -> impl Iterator<Item = AssetEntityBinding> + '_ {
|
|
||||||
self.imp.iter()
|
|
||||||
}
|
|
||||||
|
|
||||||
type InsertCallbackId = AssetEntityBindingInsertCallbackId;
|
type InsertCallbackId = AssetEntityBindingInsertCallbackId;
|
||||||
|
|
||||||
@@ -97,38 +96,39 @@ impl<'ctx> __sdk::TableWithPrimaryKey for AssetEntityBindingTableHandle<'ctx> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Access to the `binding_id` unique index on the table `asset_entity_binding`,
|
/// Access to the `binding_id` unique index on the table `asset_entity_binding`,
|
||||||
/// which allows point queries on the field of the same name
|
/// which allows point queries on the field of the same name
|
||||||
/// via the [`AssetEntityBindingBindingIdUnique::find`] method.
|
/// via the [`AssetEntityBindingBindingIdUnique::find`] method.
|
||||||
///
|
///
|
||||||
/// Users are encouraged not to explicitly reference this type,
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
/// but to directly chain method calls,
|
/// but to directly chain method calls,
|
||||||
/// like `ctx.db.asset_entity_binding().binding_id().find(...)`.
|
/// like `ctx.db.asset_entity_binding().binding_id().find(...)`.
|
||||||
pub struct AssetEntityBindingBindingIdUnique<'ctx> {
|
pub struct AssetEntityBindingBindingIdUnique<'ctx> {
|
||||||
imp: __sdk::UniqueConstraintHandle<AssetEntityBinding, String>,
|
imp: __sdk::UniqueConstraintHandle<AssetEntityBinding, String>,
|
||||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
}
|
|
||||||
|
|
||||||
impl<'ctx> AssetEntityBindingTableHandle<'ctx> {
|
|
||||||
/// Get a handle on the `binding_id` unique index on the table `asset_entity_binding`.
|
|
||||||
pub fn binding_id(&self) -> AssetEntityBindingBindingIdUnique<'ctx> {
|
|
||||||
AssetEntityBindingBindingIdUnique {
|
|
||||||
imp: self.imp.get_unique_constraint::<String>("binding_id"),
|
|
||||||
phantom: std::marker::PhantomData,
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'ctx> AssetEntityBindingBindingIdUnique<'ctx> {
|
impl<'ctx> AssetEntityBindingTableHandle<'ctx> {
|
||||||
/// Find the subscribed row whose `binding_id` column value is equal to `col_val`,
|
/// Get a handle on the `binding_id` unique index on the table `asset_entity_binding`.
|
||||||
/// if such a row is present in the client cache.
|
pub fn binding_id(&self) -> AssetEntityBindingBindingIdUnique<'ctx> {
|
||||||
pub fn find(&self, col_val: &String) -> Option<AssetEntityBinding> {
|
AssetEntityBindingBindingIdUnique {
|
||||||
self.imp.find(col_val)
|
imp: self.imp.get_unique_constraint::<String>("binding_id"),
|
||||||
}
|
phantom: std::marker::PhantomData,
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> AssetEntityBindingBindingIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `binding_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<AssetEntityBinding> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
|
||||||
let _table = client_cache.get_or_make_table::<AssetEntityBinding>("asset_entity_binding");
|
let _table = client_cache.get_or_make_table::<AssetEntityBinding>("asset_entity_binding");
|
||||||
_table.add_unique_constraint::<String>("binding_id", |row| &row.binding_id);
|
_table.add_unique_constraint::<String>("binding_id", |row| &row.binding_id);
|
||||||
}
|
}
|
||||||
@@ -138,24 +138,26 @@ pub(super) fn parse_table_update(
|
|||||||
raw_updates: __ws::v2::TableUpdate,
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
) -> __sdk::Result<__sdk::TableUpdate<AssetEntityBinding>> {
|
) -> __sdk::Result<__sdk::TableUpdate<AssetEntityBinding>> {
|
||||||
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
__sdk::InternalError::failed_parse("TableUpdate<AssetEntityBinding>", "TableUpdate")
|
__sdk::InternalError::failed_parse(
|
||||||
.with_cause(e)
|
"TableUpdate<AssetEntityBinding>",
|
||||||
.into()
|
"TableUpdate",
|
||||||
|
).with_cause(e).into()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(non_camel_case_types)]
|
#[allow(non_camel_case_types)]
|
||||||
/// Extension trait for query builder access to the table `AssetEntityBinding`.
|
/// Extension trait for query builder access to the table `AssetEntityBinding`.
|
||||||
///
|
///
|
||||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
pub trait asset_entity_bindingQueryTableAccess {
|
pub trait asset_entity_bindingQueryTableAccess {
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
/// Get a query builder for the table `AssetEntityBinding`.
|
/// Get a query builder for the table `AssetEntityBinding`.
|
||||||
fn asset_entity_binding(&self) -> __sdk::__query_builder::Table<AssetEntityBinding>;
|
fn asset_entity_binding(&self) -> __sdk::__query_builder::Table<AssetEntityBinding>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl asset_entity_bindingQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn asset_entity_binding(&self) -> __sdk::__query_builder::Table<AssetEntityBinding> {
|
||||||
|
__sdk::__query_builder::Table::new("asset_entity_binding")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl asset_entity_bindingQueryTableAccess for __sdk::QueryTableAccessor {
|
|
||||||
fn asset_entity_binding(&self) -> __sdk::__query_builder::Table<AssetEntityBinding> {
|
|
||||||
__sdk::__query_builder::Table::new("asset_entity_binding")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -2,7 +2,13 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
@@ -13,16 +19,18 @@ pub struct AssetEntityBinding {
|
|||||||
pub entity_id: String,
|
pub entity_id: String,
|
||||||
pub slot: String,
|
pub slot: String,
|
||||||
pub asset_kind: String,
|
pub asset_kind: String,
|
||||||
pub owner_user_id: Option<String>,
|
pub owner_user_id: Option::<String>,
|
||||||
pub profile_id: Option<String>,
|
pub profile_id: Option::<String>,
|
||||||
pub created_at: __sdk::Timestamp,
|
pub created_at: __sdk::Timestamp,
|
||||||
pub updated_at: __sdk::Timestamp,
|
pub updated_at: __sdk::Timestamp,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for AssetEntityBinding {
|
impl __sdk::InModule for AssetEntityBinding {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Column accessor struct for the table `AssetEntityBinding`.
|
/// Column accessor struct for the table `AssetEntityBinding`.
|
||||||
///
|
///
|
||||||
/// Provides typed access to columns for query building.
|
/// Provides typed access to columns for query building.
|
||||||
@@ -33,8 +41,8 @@ pub struct AssetEntityBindingCols {
|
|||||||
pub entity_id: __sdk::__query_builder::Col<AssetEntityBinding, String>,
|
pub entity_id: __sdk::__query_builder::Col<AssetEntityBinding, String>,
|
||||||
pub slot: __sdk::__query_builder::Col<AssetEntityBinding, String>,
|
pub slot: __sdk::__query_builder::Col<AssetEntityBinding, String>,
|
||||||
pub asset_kind: __sdk::__query_builder::Col<AssetEntityBinding, String>,
|
pub asset_kind: __sdk::__query_builder::Col<AssetEntityBinding, String>,
|
||||||
pub owner_user_id: __sdk::__query_builder::Col<AssetEntityBinding, Option<String>>,
|
pub owner_user_id: __sdk::__query_builder::Col<AssetEntityBinding, Option::<String>>,
|
||||||
pub profile_id: __sdk::__query_builder::Col<AssetEntityBinding, Option<String>>,
|
pub profile_id: __sdk::__query_builder::Col<AssetEntityBinding, Option::<String>>,
|
||||||
pub created_at: __sdk::__query_builder::Col<AssetEntityBinding, __sdk::Timestamp>,
|
pub created_at: __sdk::__query_builder::Col<AssetEntityBinding, __sdk::Timestamp>,
|
||||||
pub updated_at: __sdk::__query_builder::Col<AssetEntityBinding, __sdk::Timestamp>,
|
pub updated_at: __sdk::__query_builder::Col<AssetEntityBinding, __sdk::Timestamp>,
|
||||||
}
|
}
|
||||||
@@ -53,6 +61,7 @@ impl __sdk::__query_builder::HasCols for AssetEntityBinding {
|
|||||||
profile_id: __sdk::__query_builder::Col::new(table_name, "profile_id"),
|
profile_id: __sdk::__query_builder::Col::new(table_name, "profile_id"),
|
||||||
created_at: __sdk::__query_builder::Col::new(table_name, "created_at"),
|
created_at: __sdk::__query_builder::Col::new(table_name, "created_at"),
|
||||||
updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"),
|
updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"),
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -71,8 +80,10 @@ impl __sdk::__query_builder::HasIxCols for AssetEntityBinding {
|
|||||||
AssetEntityBindingIxCols {
|
AssetEntityBindingIxCols {
|
||||||
asset_object_id: __sdk::__query_builder::IxCol::new(table_name, "asset_object_id"),
|
asset_object_id: __sdk::__query_builder::IxCol::new(table_name, "asset_object_id"),
|
||||||
binding_id: __sdk::__query_builder::IxCol::new(table_name, "binding_id"),
|
binding_id: __sdk::__query_builder::IxCol::new(table_name, "binding_id"),
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl __sdk::__query_builder::CanBeLookupTable for AssetEntityBinding {}
|
impl __sdk::__query_builder::CanBeLookupTable for AssetEntityBinding {}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
@@ -11,8 +16,12 @@ pub enum AssetObjectAccessPolicy {
|
|||||||
Private,
|
Private,
|
||||||
|
|
||||||
PublicRead,
|
PublicRead,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for AssetObjectAccessPolicy {
|
impl __sdk::InModule for AssetObjectAccessPolicy {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::asset_object_upsert_snapshot_type::AssetObjectUpsertSnapshot;
|
use super::asset_object_upsert_snapshot_type::AssetObjectUpsertSnapshot;
|
||||||
|
|
||||||
@@ -10,10 +15,12 @@ use super::asset_object_upsert_snapshot_type::AssetObjectUpsertSnapshot;
|
|||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
pub struct AssetObjectProcedureResult {
|
pub struct AssetObjectProcedureResult {
|
||||||
pub ok: bool,
|
pub ok: bool,
|
||||||
pub record: Option<AssetObjectUpsertSnapshot>,
|
pub record: Option::<AssetObjectUpsertSnapshot>,
|
||||||
pub error_message: Option<String>,
|
pub error_message: Option::<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for AssetObjectProcedureResult {
|
impl __sdk::InModule for AssetObjectProcedureResult {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,14 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use super::asset_object_access_policy_type::AssetObjectAccessPolicy;
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
use super::asset_object_type::AssetObject;
|
use super::asset_object_type::AssetObject;
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use super::asset_object_access_policy_type::AssetObjectAccessPolicy;
|
||||||
|
|
||||||
/// Table handle for the table `asset_object`.
|
/// Table handle for the table `asset_object`.
|
||||||
///
|
///
|
||||||
@@ -45,12 +50,8 @@ impl<'ctx> __sdk::Table for AssetObjectTableHandle<'ctx> {
|
|||||||
type Row = AssetObject;
|
type Row = AssetObject;
|
||||||
type EventContext = super::EventContext;
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
fn count(&self) -> u64 {
|
fn count(&self) -> u64 { self.imp.count() }
|
||||||
self.imp.count()
|
fn iter(&self) -> impl Iterator<Item = AssetObject> + '_ { self.imp.iter() }
|
||||||
}
|
|
||||||
fn iter(&self) -> impl Iterator<Item = AssetObject> + '_ {
|
|
||||||
self.imp.iter()
|
|
||||||
}
|
|
||||||
|
|
||||||
type InsertCallbackId = AssetObjectInsertCallbackId;
|
type InsertCallbackId = AssetObjectInsertCallbackId;
|
||||||
|
|
||||||
@@ -96,38 +97,39 @@ impl<'ctx> __sdk::TableWithPrimaryKey for AssetObjectTableHandle<'ctx> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Access to the `asset_object_id` unique index on the table `asset_object`,
|
/// Access to the `asset_object_id` unique index on the table `asset_object`,
|
||||||
/// which allows point queries on the field of the same name
|
/// which allows point queries on the field of the same name
|
||||||
/// via the [`AssetObjectAssetObjectIdUnique::find`] method.
|
/// via the [`AssetObjectAssetObjectIdUnique::find`] method.
|
||||||
///
|
///
|
||||||
/// Users are encouraged not to explicitly reference this type,
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
/// but to directly chain method calls,
|
/// but to directly chain method calls,
|
||||||
/// like `ctx.db.asset_object().asset_object_id().find(...)`.
|
/// like `ctx.db.asset_object().asset_object_id().find(...)`.
|
||||||
pub struct AssetObjectAssetObjectIdUnique<'ctx> {
|
pub struct AssetObjectAssetObjectIdUnique<'ctx> {
|
||||||
imp: __sdk::UniqueConstraintHandle<AssetObject, String>,
|
imp: __sdk::UniqueConstraintHandle<AssetObject, String>,
|
||||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
}
|
|
||||||
|
|
||||||
impl<'ctx> AssetObjectTableHandle<'ctx> {
|
|
||||||
/// Get a handle on the `asset_object_id` unique index on the table `asset_object`.
|
|
||||||
pub fn asset_object_id(&self) -> AssetObjectAssetObjectIdUnique<'ctx> {
|
|
||||||
AssetObjectAssetObjectIdUnique {
|
|
||||||
imp: self.imp.get_unique_constraint::<String>("asset_object_id"),
|
|
||||||
phantom: std::marker::PhantomData,
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'ctx> AssetObjectAssetObjectIdUnique<'ctx> {
|
impl<'ctx> AssetObjectTableHandle<'ctx> {
|
||||||
/// Find the subscribed row whose `asset_object_id` column value is equal to `col_val`,
|
/// Get a handle on the `asset_object_id` unique index on the table `asset_object`.
|
||||||
/// if such a row is present in the client cache.
|
pub fn asset_object_id(&self) -> AssetObjectAssetObjectIdUnique<'ctx> {
|
||||||
pub fn find(&self, col_val: &String) -> Option<AssetObject> {
|
AssetObjectAssetObjectIdUnique {
|
||||||
self.imp.find(col_val)
|
imp: self.imp.get_unique_constraint::<String>("asset_object_id"),
|
||||||
}
|
phantom: std::marker::PhantomData,
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> AssetObjectAssetObjectIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `asset_object_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<AssetObject> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
|
||||||
let _table = client_cache.get_or_make_table::<AssetObject>("asset_object");
|
let _table = client_cache.get_or_make_table::<AssetObject>("asset_object");
|
||||||
_table.add_unique_constraint::<String>("asset_object_id", |row| &row.asset_object_id);
|
_table.add_unique_constraint::<String>("asset_object_id", |row| &row.asset_object_id);
|
||||||
}
|
}
|
||||||
@@ -137,24 +139,26 @@ pub(super) fn parse_table_update(
|
|||||||
raw_updates: __ws::v2::TableUpdate,
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
) -> __sdk::Result<__sdk::TableUpdate<AssetObject>> {
|
) -> __sdk::Result<__sdk::TableUpdate<AssetObject>> {
|
||||||
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
__sdk::InternalError::failed_parse("TableUpdate<AssetObject>", "TableUpdate")
|
__sdk::InternalError::failed_parse(
|
||||||
.with_cause(e)
|
"TableUpdate<AssetObject>",
|
||||||
.into()
|
"TableUpdate",
|
||||||
|
).with_cause(e).into()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(non_camel_case_types)]
|
#[allow(non_camel_case_types)]
|
||||||
/// Extension trait for query builder access to the table `AssetObject`.
|
/// Extension trait for query builder access to the table `AssetObject`.
|
||||||
///
|
///
|
||||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
pub trait asset_objectQueryTableAccess {
|
pub trait asset_objectQueryTableAccess {
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
/// Get a query builder for the table `AssetObject`.
|
/// Get a query builder for the table `AssetObject`.
|
||||||
fn asset_object(&self) -> __sdk::__query_builder::Table<AssetObject>;
|
fn asset_object(&self) -> __sdk::__query_builder::Table<AssetObject>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl asset_objectQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn asset_object(&self) -> __sdk::__query_builder::Table<AssetObject> {
|
||||||
|
__sdk::__query_builder::Table::new("asset_object")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl asset_objectQueryTableAccess for __sdk::QueryTableAccessor {
|
|
||||||
fn asset_object(&self) -> __sdk::__query_builder::Table<AssetObject> {
|
|
||||||
__sdk::__query_builder::Table::new("asset_object")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::asset_object_access_policy_type::AssetObjectAccessPolicy;
|
use super::asset_object_access_policy_type::AssetObjectAccessPolicy;
|
||||||
|
|
||||||
@@ -13,23 +18,25 @@ pub struct AssetObject {
|
|||||||
pub bucket: String,
|
pub bucket: String,
|
||||||
pub object_key: String,
|
pub object_key: String,
|
||||||
pub access_policy: AssetObjectAccessPolicy,
|
pub access_policy: AssetObjectAccessPolicy,
|
||||||
pub content_type: Option<String>,
|
pub content_type: Option::<String>,
|
||||||
pub content_length: u64,
|
pub content_length: u64,
|
||||||
pub content_hash: Option<String>,
|
pub content_hash: Option::<String>,
|
||||||
pub version: u32,
|
pub version: u32,
|
||||||
pub source_job_id: Option<String>,
|
pub source_job_id: Option::<String>,
|
||||||
pub owner_user_id: Option<String>,
|
pub owner_user_id: Option::<String>,
|
||||||
pub profile_id: Option<String>,
|
pub profile_id: Option::<String>,
|
||||||
pub entity_id: Option<String>,
|
pub entity_id: Option::<String>,
|
||||||
pub asset_kind: String,
|
pub asset_kind: String,
|
||||||
pub created_at: __sdk::Timestamp,
|
pub created_at: __sdk::Timestamp,
|
||||||
pub updated_at: __sdk::Timestamp,
|
pub updated_at: __sdk::Timestamp,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for AssetObject {
|
impl __sdk::InModule for AssetObject {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Column accessor struct for the table `AssetObject`.
|
/// Column accessor struct for the table `AssetObject`.
|
||||||
///
|
///
|
||||||
/// Provides typed access to columns for query building.
|
/// Provides typed access to columns for query building.
|
||||||
@@ -38,14 +45,14 @@ pub struct AssetObjectCols {
|
|||||||
pub bucket: __sdk::__query_builder::Col<AssetObject, String>,
|
pub bucket: __sdk::__query_builder::Col<AssetObject, String>,
|
||||||
pub object_key: __sdk::__query_builder::Col<AssetObject, String>,
|
pub object_key: __sdk::__query_builder::Col<AssetObject, String>,
|
||||||
pub access_policy: __sdk::__query_builder::Col<AssetObject, AssetObjectAccessPolicy>,
|
pub access_policy: __sdk::__query_builder::Col<AssetObject, AssetObjectAccessPolicy>,
|
||||||
pub content_type: __sdk::__query_builder::Col<AssetObject, Option<String>>,
|
pub content_type: __sdk::__query_builder::Col<AssetObject, Option::<String>>,
|
||||||
pub content_length: __sdk::__query_builder::Col<AssetObject, u64>,
|
pub content_length: __sdk::__query_builder::Col<AssetObject, u64>,
|
||||||
pub content_hash: __sdk::__query_builder::Col<AssetObject, Option<String>>,
|
pub content_hash: __sdk::__query_builder::Col<AssetObject, Option::<String>>,
|
||||||
pub version: __sdk::__query_builder::Col<AssetObject, u32>,
|
pub version: __sdk::__query_builder::Col<AssetObject, u32>,
|
||||||
pub source_job_id: __sdk::__query_builder::Col<AssetObject, Option<String>>,
|
pub source_job_id: __sdk::__query_builder::Col<AssetObject, Option::<String>>,
|
||||||
pub owner_user_id: __sdk::__query_builder::Col<AssetObject, Option<String>>,
|
pub owner_user_id: __sdk::__query_builder::Col<AssetObject, Option::<String>>,
|
||||||
pub profile_id: __sdk::__query_builder::Col<AssetObject, Option<String>>,
|
pub profile_id: __sdk::__query_builder::Col<AssetObject, Option::<String>>,
|
||||||
pub entity_id: __sdk::__query_builder::Col<AssetObject, Option<String>>,
|
pub entity_id: __sdk::__query_builder::Col<AssetObject, Option::<String>>,
|
||||||
pub asset_kind: __sdk::__query_builder::Col<AssetObject, String>,
|
pub asset_kind: __sdk::__query_builder::Col<AssetObject, String>,
|
||||||
pub created_at: __sdk::__query_builder::Col<AssetObject, __sdk::Timestamp>,
|
pub created_at: __sdk::__query_builder::Col<AssetObject, __sdk::Timestamp>,
|
||||||
pub updated_at: __sdk::__query_builder::Col<AssetObject, __sdk::Timestamp>,
|
pub updated_at: __sdk::__query_builder::Col<AssetObject, __sdk::Timestamp>,
|
||||||
@@ -70,6 +77,7 @@ impl __sdk::__query_builder::HasCols for AssetObject {
|
|||||||
asset_kind: __sdk::__query_builder::Col::new(table_name, "asset_kind"),
|
asset_kind: __sdk::__query_builder::Col::new(table_name, "asset_kind"),
|
||||||
created_at: __sdk::__query_builder::Col::new(table_name, "created_at"),
|
created_at: __sdk::__query_builder::Col::new(table_name, "created_at"),
|
||||||
updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"),
|
updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"),
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -88,8 +96,10 @@ impl __sdk::__query_builder::HasIxCols for AssetObject {
|
|||||||
AssetObjectIxCols {
|
AssetObjectIxCols {
|
||||||
asset_kind: __sdk::__query_builder::IxCol::new(table_name, "asset_kind"),
|
asset_kind: __sdk::__query_builder::IxCol::new(table_name, "asset_kind"),
|
||||||
asset_object_id: __sdk::__query_builder::IxCol::new(table_name, "asset_object_id"),
|
asset_object_id: __sdk::__query_builder::IxCol::new(table_name, "asset_object_id"),
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl __sdk::__query_builder::CanBeLookupTable for AssetObject {}
|
impl __sdk::__query_builder::CanBeLookupTable for AssetObject {}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::asset_object_access_policy_type::AssetObjectAccessPolicy;
|
use super::asset_object_access_policy_type::AssetObjectAccessPolicy;
|
||||||
|
|
||||||
@@ -13,18 +18,20 @@ pub struct AssetObjectUpsertInput {
|
|||||||
pub bucket: String,
|
pub bucket: String,
|
||||||
pub object_key: String,
|
pub object_key: String,
|
||||||
pub access_policy: AssetObjectAccessPolicy,
|
pub access_policy: AssetObjectAccessPolicy,
|
||||||
pub content_type: Option<String>,
|
pub content_type: Option::<String>,
|
||||||
pub content_length: u64,
|
pub content_length: u64,
|
||||||
pub content_hash: Option<String>,
|
pub content_hash: Option::<String>,
|
||||||
pub version: u32,
|
pub version: u32,
|
||||||
pub source_job_id: Option<String>,
|
pub source_job_id: Option::<String>,
|
||||||
pub owner_user_id: Option<String>,
|
pub owner_user_id: Option::<String>,
|
||||||
pub profile_id: Option<String>,
|
pub profile_id: Option::<String>,
|
||||||
pub entity_id: Option<String>,
|
pub entity_id: Option::<String>,
|
||||||
pub asset_kind: String,
|
pub asset_kind: String,
|
||||||
pub updated_at_micros: i64,
|
pub updated_at_micros: i64,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for AssetObjectUpsertInput {
|
impl __sdk::InModule for AssetObjectUpsertInput {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::asset_object_access_policy_type::AssetObjectAccessPolicy;
|
use super::asset_object_access_policy_type::AssetObjectAccessPolicy;
|
||||||
|
|
||||||
@@ -13,19 +18,21 @@ pub struct AssetObjectUpsertSnapshot {
|
|||||||
pub bucket: String,
|
pub bucket: String,
|
||||||
pub object_key: String,
|
pub object_key: String,
|
||||||
pub access_policy: AssetObjectAccessPolicy,
|
pub access_policy: AssetObjectAccessPolicy,
|
||||||
pub content_type: Option<String>,
|
pub content_type: Option::<String>,
|
||||||
pub content_length: u64,
|
pub content_length: u64,
|
||||||
pub content_hash: Option<String>,
|
pub content_hash: Option::<String>,
|
||||||
pub version: u32,
|
pub version: u32,
|
||||||
pub source_job_id: Option<String>,
|
pub source_job_id: Option::<String>,
|
||||||
pub owner_user_id: Option<String>,
|
pub owner_user_id: Option::<String>,
|
||||||
pub profile_id: Option<String>,
|
pub profile_id: Option::<String>,
|
||||||
pub entity_id: Option<String>,
|
pub entity_id: Option::<String>,
|
||||||
pub asset_kind: String,
|
pub asset_kind: String,
|
||||||
pub created_at_micros: i64,
|
pub created_at_micros: i64,
|
||||||
pub updated_at_micros: i64,
|
pub updated_at_micros: i64,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for AssetObjectUpsertSnapshot {
|
impl __sdk::InModule for AssetObjectUpsertSnapshot {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,17 +2,23 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::ai_result_reference_input_type::AiResultReferenceInput;
|
|
||||||
use super::ai_task_procedure_result_type::AiTaskProcedureResult;
|
use super::ai_task_procedure_result_type::AiTaskProcedureResult;
|
||||||
|
use super::ai_result_reference_input_type::AiResultReferenceInput;
|
||||||
|
|
||||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
struct AttachAiResultReferenceAndReturnArgs {
|
struct AttachAiResultReferenceAndReturnArgs {
|
||||||
pub input: AiResultReferenceInput,
|
pub input: AiResultReferenceInput,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for AttachAiResultReferenceAndReturnArgs {
|
impl __sdk::InModule for AttachAiResultReferenceAndReturnArgs {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
@@ -22,19 +28,16 @@ impl __sdk::InModule for AttachAiResultReferenceAndReturnArgs {
|
|||||||
///
|
///
|
||||||
/// Implemented for [`super::RemoteProcedures`].
|
/// Implemented for [`super::RemoteProcedures`].
|
||||||
pub trait attach_ai_result_reference_and_return {
|
pub trait attach_ai_result_reference_and_return {
|
||||||
fn attach_ai_result_reference_and_return(&self, input: AiResultReferenceInput) {
|
fn attach_ai_result_reference_and_return(&self, input: AiResultReferenceInput,
|
||||||
self.attach_ai_result_reference_and_return_then(input, |_, _| {});
|
) {
|
||||||
|
self.attach_ai_result_reference_and_return_then(input, |_, _| {});
|
||||||
}
|
}
|
||||||
|
|
||||||
fn attach_ai_result_reference_and_return_then(
|
fn attach_ai_result_reference_and_return_then(
|
||||||
&self,
|
&self,
|
||||||
input: AiResultReferenceInput,
|
input: AiResultReferenceInput,
|
||||||
|
|
||||||
__callback: impl FnOnce(
|
__callback: impl FnOnce(&super::ProcedureEventContext, Result<AiTaskProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||||
&super::ProcedureEventContext,
|
|
||||||
Result<AiTaskProcedureResult, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,17 +46,13 @@ impl attach_ai_result_reference_and_return for super::RemoteProcedures {
|
|||||||
&self,
|
&self,
|
||||||
input: AiResultReferenceInput,
|
input: AiResultReferenceInput,
|
||||||
|
|
||||||
__callback: impl FnOnce(
|
__callback: impl FnOnce(&super::ProcedureEventContext, Result<AiTaskProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||||
&super::ProcedureEventContext,
|
|
||||||
Result<AiTaskProcedureResult, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
|
||||||
) {
|
) {
|
||||||
self.imp
|
self.imp.invoke_procedure_with_callback::<_, AiTaskProcedureResult>(
|
||||||
.invoke_procedure_with_callback::<_, AiTaskProcedureResult>(
|
"attach_ai_result_reference_and_return",
|
||||||
"attach_ai_result_reference_and_return",
|
AttachAiResultReferenceAndReturnArgs { input, },
|
||||||
AttachAiResultReferenceAndReturnArgs { input },
|
__callback,
|
||||||
__callback,
|
);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
@@ -11,8 +16,12 @@ pub enum BattleMode {
|
|||||||
Fight,
|
Fight,
|
||||||
|
|
||||||
Spar,
|
Spar,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for BattleMode {
|
impl __sdk::InModule for BattleMode {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::battle_mode_type::BattleMode;
|
use super::battle_mode_type::BattleMode;
|
||||||
use super::runtime_item_reward_item_snapshot_type::RuntimeItemRewardItemSnapshot;
|
use super::runtime_item_reward_item_snapshot_type::RuntimeItemRewardItemSnapshot;
|
||||||
@@ -14,7 +19,7 @@ pub struct BattleStateInput {
|
|||||||
pub story_session_id: String,
|
pub story_session_id: String,
|
||||||
pub runtime_session_id: String,
|
pub runtime_session_id: String,
|
||||||
pub actor_user_id: String,
|
pub actor_user_id: String,
|
||||||
pub chapter_id: Option<String>,
|
pub chapter_id: Option::<String>,
|
||||||
pub target_npc_id: String,
|
pub target_npc_id: String,
|
||||||
pub target_name: String,
|
pub target_name: String,
|
||||||
pub battle_mode: BattleMode,
|
pub battle_mode: BattleMode,
|
||||||
@@ -25,10 +30,12 @@ pub struct BattleStateInput {
|
|||||||
pub target_hp: i32,
|
pub target_hp: i32,
|
||||||
pub target_max_hp: i32,
|
pub target_max_hp: i32,
|
||||||
pub experience_reward: u32,
|
pub experience_reward: u32,
|
||||||
pub reward_items: Vec<RuntimeItemRewardItemSnapshot>,
|
pub reward_items: Vec::<RuntimeItemRewardItemSnapshot>,
|
||||||
pub created_at_micros: i64,
|
pub created_at_micros: i64,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for BattleStateInput {
|
impl __sdk::InModule for BattleStateInput {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::battle_state_snapshot_type::BattleStateSnapshot;
|
use super::battle_state_snapshot_type::BattleStateSnapshot;
|
||||||
|
|
||||||
@@ -10,10 +15,12 @@ use super::battle_state_snapshot_type::BattleStateSnapshot;
|
|||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
pub struct BattleStateProcedureResult {
|
pub struct BattleStateProcedureResult {
|
||||||
pub ok: bool,
|
pub ok: bool,
|
||||||
pub snapshot: Option<BattleStateSnapshot>,
|
pub snapshot: Option::<BattleStateSnapshot>,
|
||||||
pub error_message: Option<String>,
|
pub error_message: Option::<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for BattleStateProcedureResult {
|
impl __sdk::InModule for BattleStateProcedureResult {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,13 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
@@ -10,6 +16,8 @@ pub struct BattleStateQueryInput {
|
|||||||
pub battle_state_id: String,
|
pub battle_state_id: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for BattleStateQueryInput {
|
impl __sdk::InModule for BattleStateQueryInput {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,12 +2,17 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::battle_mode_type::BattleMode;
|
use super::battle_mode_type::BattleMode;
|
||||||
use super::battle_status_type::BattleStatus;
|
use super::battle_status_type::BattleStatus;
|
||||||
use super::combat_outcome_type::CombatOutcome;
|
|
||||||
use super::runtime_item_reward_item_snapshot_type::RuntimeItemRewardItemSnapshot;
|
use super::runtime_item_reward_item_snapshot_type::RuntimeItemRewardItemSnapshot;
|
||||||
|
use super::combat_outcome_type::CombatOutcome;
|
||||||
|
|
||||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
@@ -16,7 +21,7 @@ pub struct BattleStateSnapshot {
|
|||||||
pub story_session_id: String,
|
pub story_session_id: String,
|
||||||
pub runtime_session_id: String,
|
pub runtime_session_id: String,
|
||||||
pub actor_user_id: String,
|
pub actor_user_id: String,
|
||||||
pub chapter_id: Option<String>,
|
pub chapter_id: Option::<String>,
|
||||||
pub target_npc_id: String,
|
pub target_npc_id: String,
|
||||||
pub target_name: String,
|
pub target_name: String,
|
||||||
pub battle_mode: BattleMode,
|
pub battle_mode: BattleMode,
|
||||||
@@ -28,11 +33,11 @@ pub struct BattleStateSnapshot {
|
|||||||
pub target_hp: i32,
|
pub target_hp: i32,
|
||||||
pub target_max_hp: i32,
|
pub target_max_hp: i32,
|
||||||
pub experience_reward: u32,
|
pub experience_reward: u32,
|
||||||
pub reward_items: Vec<RuntimeItemRewardItemSnapshot>,
|
pub reward_items: Vec::<RuntimeItemRewardItemSnapshot>,
|
||||||
pub turn_index: u32,
|
pub turn_index: u32,
|
||||||
pub last_action_function_id: Option<String>,
|
pub last_action_function_id: Option::<String>,
|
||||||
pub last_action_text: Option<String>,
|
pub last_action_text: Option::<String>,
|
||||||
pub last_result_text: Option<String>,
|
pub last_result_text: Option::<String>,
|
||||||
pub last_damage_dealt: i32,
|
pub last_damage_dealt: i32,
|
||||||
pub last_damage_taken: i32,
|
pub last_damage_taken: i32,
|
||||||
pub last_outcome: CombatOutcome,
|
pub last_outcome: CombatOutcome,
|
||||||
@@ -41,6 +46,8 @@ pub struct BattleStateSnapshot {
|
|||||||
pub updated_at_micros: i64,
|
pub updated_at_micros: i64,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for BattleStateSnapshot {
|
impl __sdk::InModule for BattleStateSnapshot {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,12 +2,17 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use super::battle_mode_type::BattleMode;
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
use super::battle_state_type::BattleState;
|
use super::battle_state_type::BattleState;
|
||||||
|
use super::battle_mode_type::BattleMode;
|
||||||
use super::battle_status_type::BattleStatus;
|
use super::battle_status_type::BattleStatus;
|
||||||
use super::combat_outcome_type::CombatOutcome;
|
|
||||||
use super::runtime_item_reward_item_snapshot_type::RuntimeItemRewardItemSnapshot;
|
use super::runtime_item_reward_item_snapshot_type::RuntimeItemRewardItemSnapshot;
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use super::combat_outcome_type::CombatOutcome;
|
||||||
|
|
||||||
/// Table handle for the table `battle_state`.
|
/// Table handle for the table `battle_state`.
|
||||||
///
|
///
|
||||||
@@ -48,12 +53,8 @@ impl<'ctx> __sdk::Table for BattleStateTableHandle<'ctx> {
|
|||||||
type Row = BattleState;
|
type Row = BattleState;
|
||||||
type EventContext = super::EventContext;
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
fn count(&self) -> u64 {
|
fn count(&self) -> u64 { self.imp.count() }
|
||||||
self.imp.count()
|
fn iter(&self) -> impl Iterator<Item = BattleState> + '_ { self.imp.iter() }
|
||||||
}
|
|
||||||
fn iter(&self) -> impl Iterator<Item = BattleState> + '_ {
|
|
||||||
self.imp.iter()
|
|
||||||
}
|
|
||||||
|
|
||||||
type InsertCallbackId = BattleStateInsertCallbackId;
|
type InsertCallbackId = BattleStateInsertCallbackId;
|
||||||
|
|
||||||
@@ -99,38 +100,39 @@ impl<'ctx> __sdk::TableWithPrimaryKey for BattleStateTableHandle<'ctx> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Access to the `battle_state_id` unique index on the table `battle_state`,
|
/// Access to the `battle_state_id` unique index on the table `battle_state`,
|
||||||
/// which allows point queries on the field of the same name
|
/// which allows point queries on the field of the same name
|
||||||
/// via the [`BattleStateBattleStateIdUnique::find`] method.
|
/// via the [`BattleStateBattleStateIdUnique::find`] method.
|
||||||
///
|
///
|
||||||
/// Users are encouraged not to explicitly reference this type,
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
/// but to directly chain method calls,
|
/// but to directly chain method calls,
|
||||||
/// like `ctx.db.battle_state().battle_state_id().find(...)`.
|
/// like `ctx.db.battle_state().battle_state_id().find(...)`.
|
||||||
pub struct BattleStateBattleStateIdUnique<'ctx> {
|
pub struct BattleStateBattleStateIdUnique<'ctx> {
|
||||||
imp: __sdk::UniqueConstraintHandle<BattleState, String>,
|
imp: __sdk::UniqueConstraintHandle<BattleState, String>,
|
||||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
}
|
|
||||||
|
|
||||||
impl<'ctx> BattleStateTableHandle<'ctx> {
|
|
||||||
/// Get a handle on the `battle_state_id` unique index on the table `battle_state`.
|
|
||||||
pub fn battle_state_id(&self) -> BattleStateBattleStateIdUnique<'ctx> {
|
|
||||||
BattleStateBattleStateIdUnique {
|
|
||||||
imp: self.imp.get_unique_constraint::<String>("battle_state_id"),
|
|
||||||
phantom: std::marker::PhantomData,
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'ctx> BattleStateBattleStateIdUnique<'ctx> {
|
impl<'ctx> BattleStateTableHandle<'ctx> {
|
||||||
/// Find the subscribed row whose `battle_state_id` column value is equal to `col_val`,
|
/// Get a handle on the `battle_state_id` unique index on the table `battle_state`.
|
||||||
/// if such a row is present in the client cache.
|
pub fn battle_state_id(&self) -> BattleStateBattleStateIdUnique<'ctx> {
|
||||||
pub fn find(&self, col_val: &String) -> Option<BattleState> {
|
BattleStateBattleStateIdUnique {
|
||||||
self.imp.find(col_val)
|
imp: self.imp.get_unique_constraint::<String>("battle_state_id"),
|
||||||
}
|
phantom: std::marker::PhantomData,
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> BattleStateBattleStateIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `battle_state_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<BattleState> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
|
||||||
let _table = client_cache.get_or_make_table::<BattleState>("battle_state");
|
let _table = client_cache.get_or_make_table::<BattleState>("battle_state");
|
||||||
_table.add_unique_constraint::<String>("battle_state_id", |row| &row.battle_state_id);
|
_table.add_unique_constraint::<String>("battle_state_id", |row| &row.battle_state_id);
|
||||||
}
|
}
|
||||||
@@ -140,24 +142,26 @@ pub(super) fn parse_table_update(
|
|||||||
raw_updates: __ws::v2::TableUpdate,
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
) -> __sdk::Result<__sdk::TableUpdate<BattleState>> {
|
) -> __sdk::Result<__sdk::TableUpdate<BattleState>> {
|
||||||
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
__sdk::InternalError::failed_parse("TableUpdate<BattleState>", "TableUpdate")
|
__sdk::InternalError::failed_parse(
|
||||||
.with_cause(e)
|
"TableUpdate<BattleState>",
|
||||||
.into()
|
"TableUpdate",
|
||||||
|
).with_cause(e).into()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(non_camel_case_types)]
|
#[allow(non_camel_case_types)]
|
||||||
/// Extension trait for query builder access to the table `BattleState`.
|
/// Extension trait for query builder access to the table `BattleState`.
|
||||||
///
|
///
|
||||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
pub trait battle_stateQueryTableAccess {
|
pub trait battle_stateQueryTableAccess {
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
/// Get a query builder for the table `BattleState`.
|
/// Get a query builder for the table `BattleState`.
|
||||||
fn battle_state(&self) -> __sdk::__query_builder::Table<BattleState>;
|
fn battle_state(&self) -> __sdk::__query_builder::Table<BattleState>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl battle_stateQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn battle_state(&self) -> __sdk::__query_builder::Table<BattleState> {
|
||||||
|
__sdk::__query_builder::Table::new("battle_state")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl battle_stateQueryTableAccess for __sdk::QueryTableAccessor {
|
|
||||||
fn battle_state(&self) -> __sdk::__query_builder::Table<BattleState> {
|
|
||||||
__sdk::__query_builder::Table::new("battle_state")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -2,12 +2,17 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::battle_mode_type::BattleMode;
|
use super::battle_mode_type::BattleMode;
|
||||||
use super::battle_status_type::BattleStatus;
|
use super::battle_status_type::BattleStatus;
|
||||||
use super::combat_outcome_type::CombatOutcome;
|
|
||||||
use super::runtime_item_reward_item_snapshot_type::RuntimeItemRewardItemSnapshot;
|
use super::runtime_item_reward_item_snapshot_type::RuntimeItemRewardItemSnapshot;
|
||||||
|
use super::combat_outcome_type::CombatOutcome;
|
||||||
|
|
||||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
@@ -16,7 +21,7 @@ pub struct BattleState {
|
|||||||
pub story_session_id: String,
|
pub story_session_id: String,
|
||||||
pub runtime_session_id: String,
|
pub runtime_session_id: String,
|
||||||
pub actor_user_id: String,
|
pub actor_user_id: String,
|
||||||
pub chapter_id: Option<String>,
|
pub chapter_id: Option::<String>,
|
||||||
pub target_npc_id: String,
|
pub target_npc_id: String,
|
||||||
pub target_name: String,
|
pub target_name: String,
|
||||||
pub battle_mode: BattleMode,
|
pub battle_mode: BattleMode,
|
||||||
@@ -28,11 +33,11 @@ pub struct BattleState {
|
|||||||
pub target_hp: i32,
|
pub target_hp: i32,
|
||||||
pub target_max_hp: i32,
|
pub target_max_hp: i32,
|
||||||
pub experience_reward: u32,
|
pub experience_reward: u32,
|
||||||
pub reward_items: Vec<RuntimeItemRewardItemSnapshot>,
|
pub reward_items: Vec::<RuntimeItemRewardItemSnapshot>,
|
||||||
pub turn_index: u32,
|
pub turn_index: u32,
|
||||||
pub last_action_function_id: Option<String>,
|
pub last_action_function_id: Option::<String>,
|
||||||
pub last_action_text: Option<String>,
|
pub last_action_text: Option::<String>,
|
||||||
pub last_result_text: Option<String>,
|
pub last_result_text: Option::<String>,
|
||||||
pub last_damage_dealt: i32,
|
pub last_damage_dealt: i32,
|
||||||
pub last_damage_taken: i32,
|
pub last_damage_taken: i32,
|
||||||
pub last_outcome: CombatOutcome,
|
pub last_outcome: CombatOutcome,
|
||||||
@@ -41,10 +46,12 @@ pub struct BattleState {
|
|||||||
pub updated_at: __sdk::Timestamp,
|
pub updated_at: __sdk::Timestamp,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for BattleState {
|
impl __sdk::InModule for BattleState {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Column accessor struct for the table `BattleState`.
|
/// Column accessor struct for the table `BattleState`.
|
||||||
///
|
///
|
||||||
/// Provides typed access to columns for query building.
|
/// Provides typed access to columns for query building.
|
||||||
@@ -53,7 +60,7 @@ pub struct BattleStateCols {
|
|||||||
pub story_session_id: __sdk::__query_builder::Col<BattleState, String>,
|
pub story_session_id: __sdk::__query_builder::Col<BattleState, String>,
|
||||||
pub runtime_session_id: __sdk::__query_builder::Col<BattleState, String>,
|
pub runtime_session_id: __sdk::__query_builder::Col<BattleState, String>,
|
||||||
pub actor_user_id: __sdk::__query_builder::Col<BattleState, String>,
|
pub actor_user_id: __sdk::__query_builder::Col<BattleState, String>,
|
||||||
pub chapter_id: __sdk::__query_builder::Col<BattleState, Option<String>>,
|
pub chapter_id: __sdk::__query_builder::Col<BattleState, Option::<String>>,
|
||||||
pub target_npc_id: __sdk::__query_builder::Col<BattleState, String>,
|
pub target_npc_id: __sdk::__query_builder::Col<BattleState, String>,
|
||||||
pub target_name: __sdk::__query_builder::Col<BattleState, String>,
|
pub target_name: __sdk::__query_builder::Col<BattleState, String>,
|
||||||
pub battle_mode: __sdk::__query_builder::Col<BattleState, BattleMode>,
|
pub battle_mode: __sdk::__query_builder::Col<BattleState, BattleMode>,
|
||||||
@@ -65,11 +72,11 @@ pub struct BattleStateCols {
|
|||||||
pub target_hp: __sdk::__query_builder::Col<BattleState, i32>,
|
pub target_hp: __sdk::__query_builder::Col<BattleState, i32>,
|
||||||
pub target_max_hp: __sdk::__query_builder::Col<BattleState, i32>,
|
pub target_max_hp: __sdk::__query_builder::Col<BattleState, i32>,
|
||||||
pub experience_reward: __sdk::__query_builder::Col<BattleState, u32>,
|
pub experience_reward: __sdk::__query_builder::Col<BattleState, u32>,
|
||||||
pub reward_items: __sdk::__query_builder::Col<BattleState, Vec<RuntimeItemRewardItemSnapshot>>,
|
pub reward_items: __sdk::__query_builder::Col<BattleState, Vec::<RuntimeItemRewardItemSnapshot>>,
|
||||||
pub turn_index: __sdk::__query_builder::Col<BattleState, u32>,
|
pub turn_index: __sdk::__query_builder::Col<BattleState, u32>,
|
||||||
pub last_action_function_id: __sdk::__query_builder::Col<BattleState, Option<String>>,
|
pub last_action_function_id: __sdk::__query_builder::Col<BattleState, Option::<String>>,
|
||||||
pub last_action_text: __sdk::__query_builder::Col<BattleState, Option<String>>,
|
pub last_action_text: __sdk::__query_builder::Col<BattleState, Option::<String>>,
|
||||||
pub last_result_text: __sdk::__query_builder::Col<BattleState, Option<String>>,
|
pub last_result_text: __sdk::__query_builder::Col<BattleState, Option::<String>>,
|
||||||
pub last_damage_dealt: __sdk::__query_builder::Col<BattleState, i32>,
|
pub last_damage_dealt: __sdk::__query_builder::Col<BattleState, i32>,
|
||||||
pub last_damage_taken: __sdk::__query_builder::Col<BattleState, i32>,
|
pub last_damage_taken: __sdk::__query_builder::Col<BattleState, i32>,
|
||||||
pub last_outcome: __sdk::__query_builder::Col<BattleState, CombatOutcome>,
|
pub last_outcome: __sdk::__query_builder::Col<BattleState, CombatOutcome>,
|
||||||
@@ -100,10 +107,7 @@ impl __sdk::__query_builder::HasCols for BattleState {
|
|||||||
experience_reward: __sdk::__query_builder::Col::new(table_name, "experience_reward"),
|
experience_reward: __sdk::__query_builder::Col::new(table_name, "experience_reward"),
|
||||||
reward_items: __sdk::__query_builder::Col::new(table_name, "reward_items"),
|
reward_items: __sdk::__query_builder::Col::new(table_name, "reward_items"),
|
||||||
turn_index: __sdk::__query_builder::Col::new(table_name, "turn_index"),
|
turn_index: __sdk::__query_builder::Col::new(table_name, "turn_index"),
|
||||||
last_action_function_id: __sdk::__query_builder::Col::new(
|
last_action_function_id: __sdk::__query_builder::Col::new(table_name, "last_action_function_id"),
|
||||||
table_name,
|
|
||||||
"last_action_function_id",
|
|
||||||
),
|
|
||||||
last_action_text: __sdk::__query_builder::Col::new(table_name, "last_action_text"),
|
last_action_text: __sdk::__query_builder::Col::new(table_name, "last_action_text"),
|
||||||
last_result_text: __sdk::__query_builder::Col::new(table_name, "last_result_text"),
|
last_result_text: __sdk::__query_builder::Col::new(table_name, "last_result_text"),
|
||||||
last_damage_dealt: __sdk::__query_builder::Col::new(table_name, "last_damage_dealt"),
|
last_damage_dealt: __sdk::__query_builder::Col::new(table_name, "last_damage_dealt"),
|
||||||
@@ -112,6 +116,7 @@ impl __sdk::__query_builder::HasCols for BattleState {
|
|||||||
version: __sdk::__query_builder::Col::new(table_name, "version"),
|
version: __sdk::__query_builder::Col::new(table_name, "version"),
|
||||||
created_at: __sdk::__query_builder::Col::new(table_name, "created_at"),
|
created_at: __sdk::__query_builder::Col::new(table_name, "created_at"),
|
||||||
updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"),
|
updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"),
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -132,13 +137,12 @@ impl __sdk::__query_builder::HasIxCols for BattleState {
|
|||||||
BattleStateIxCols {
|
BattleStateIxCols {
|
||||||
actor_user_id: __sdk::__query_builder::IxCol::new(table_name, "actor_user_id"),
|
actor_user_id: __sdk::__query_builder::IxCol::new(table_name, "actor_user_id"),
|
||||||
battle_state_id: __sdk::__query_builder::IxCol::new(table_name, "battle_state_id"),
|
battle_state_id: __sdk::__query_builder::IxCol::new(table_name, "battle_state_id"),
|
||||||
runtime_session_id: __sdk::__query_builder::IxCol::new(
|
runtime_session_id: __sdk::__query_builder::IxCol::new(table_name, "runtime_session_id"),
|
||||||
table_name,
|
|
||||||
"runtime_session_id",
|
|
||||||
),
|
|
||||||
story_session_id: __sdk::__query_builder::IxCol::new(table_name, "story_session_id"),
|
story_session_id: __sdk::__query_builder::IxCol::new(table_name, "story_session_id"),
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl __sdk::__query_builder::CanBeLookupTable for BattleState {}
|
impl __sdk::__query_builder::CanBeLookupTable for BattleState {}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
@@ -13,8 +18,12 @@ pub enum BattleStatus {
|
|||||||
Resolved,
|
Resolved,
|
||||||
|
|
||||||
Aborted,
|
Aborted,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for BattleStatus {
|
impl __sdk::InModule for BattleStatus {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,17 +2,23 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::story_session_input_type::StorySessionInput;
|
use super::story_session_input_type::StorySessionInput;
|
||||||
use super::story_session_procedure_result_type::StorySessionProcedureResult;
|
use super::story_session_procedure_result_type::StorySessionProcedureResult;
|
||||||
|
|
||||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
struct BeginStorySessionAndReturnArgs {
|
struct BeginStorySessionAndReturnArgs {
|
||||||
pub input: StorySessionInput,
|
pub input: StorySessionInput,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for BeginStorySessionAndReturnArgs {
|
impl __sdk::InModule for BeginStorySessionAndReturnArgs {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
@@ -22,19 +28,16 @@ impl __sdk::InModule for BeginStorySessionAndReturnArgs {
|
|||||||
///
|
///
|
||||||
/// Implemented for [`super::RemoteProcedures`].
|
/// Implemented for [`super::RemoteProcedures`].
|
||||||
pub trait begin_story_session_and_return {
|
pub trait begin_story_session_and_return {
|
||||||
fn begin_story_session_and_return(&self, input: StorySessionInput) {
|
fn begin_story_session_and_return(&self, input: StorySessionInput,
|
||||||
self.begin_story_session_and_return_then(input, |_, _| {});
|
) {
|
||||||
|
self.begin_story_session_and_return_then(input, |_, _| {});
|
||||||
}
|
}
|
||||||
|
|
||||||
fn begin_story_session_and_return_then(
|
fn begin_story_session_and_return_then(
|
||||||
&self,
|
&self,
|
||||||
input: StorySessionInput,
|
input: StorySessionInput,
|
||||||
|
|
||||||
__callback: impl FnOnce(
|
__callback: impl FnOnce(&super::ProcedureEventContext, Result<StorySessionProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||||
&super::ProcedureEventContext,
|
|
||||||
Result<StorySessionProcedureResult, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,17 +46,13 @@ impl begin_story_session_and_return for super::RemoteProcedures {
|
|||||||
&self,
|
&self,
|
||||||
input: StorySessionInput,
|
input: StorySessionInput,
|
||||||
|
|
||||||
__callback: impl FnOnce(
|
__callback: impl FnOnce(&super::ProcedureEventContext, Result<StorySessionProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||||
&super::ProcedureEventContext,
|
|
||||||
Result<StorySessionProcedureResult, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
|
||||||
) {
|
) {
|
||||||
self.imp
|
self.imp.invoke_procedure_with_callback::<_, StorySessionProcedureResult>(
|
||||||
.invoke_procedure_with_callback::<_, StorySessionProcedureResult>(
|
"begin_story_session_and_return",
|
||||||
"begin_story_session_and_return",
|
BeginStorySessionAndReturnArgs { input, },
|
||||||
BeginStorySessionAndReturnArgs { input },
|
__callback,
|
||||||
__callback,
|
);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::story_session_input_type::StorySessionInput;
|
use super::story_session_input_type::StorySessionInput;
|
||||||
|
|
||||||
@@ -14,8 +19,10 @@ pub(super) struct BeginStorySessionArgs {
|
|||||||
|
|
||||||
impl From<BeginStorySessionArgs> for super::Reducer {
|
impl From<BeginStorySessionArgs> for super::Reducer {
|
||||||
fn from(args: BeginStorySessionArgs) -> Self {
|
fn from(args: BeginStorySessionArgs) -> Self {
|
||||||
Self::BeginStorySession { input: args.input }
|
Self::BeginStorySession {
|
||||||
}
|
input: args.input,
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl __sdk::InModule for BeginStorySessionArgs {
|
impl __sdk::InModule for BeginStorySessionArgs {
|
||||||
@@ -33,8 +40,9 @@ pub trait begin_story_session {
|
|||||||
/// The reducer will run asynchronously in the future,
|
/// The reducer will run asynchronously in the future,
|
||||||
/// and this method provides no way to listen for its completion status.
|
/// and this method provides no way to listen for its completion status.
|
||||||
/// /// Use [`begin_story_session:begin_story_session_then`] to run a callback after the reducer completes.
|
/// /// Use [`begin_story_session:begin_story_session_then`] to run a callback after the reducer completes.
|
||||||
fn begin_story_session(&self, input: StorySessionInput) -> __sdk::Result<()> {
|
fn begin_story_session(&self, input: StorySessionInput,
|
||||||
self.begin_story_session_then(input, |_, _| {})
|
) -> __sdk::Result<()> {
|
||||||
|
self.begin_story_session_then(input, |_, _| {})
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Request that the remote module invoke the reducer `begin_story_session` to run as soon as possible,
|
/// Request that the remote module invoke the reducer `begin_story_session` to run as soon as possible,
|
||||||
@@ -62,7 +70,7 @@ impl begin_story_session for super::RemoteReducers {
|
|||||||
+ Send
|
+ Send
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()> {
|
) -> __sdk::Result<()> {
|
||||||
self.imp
|
self.imp.invoke_reducer_with_callback(BeginStorySessionArgs { input, }, callback)
|
||||||
.invoke_reducer_with_callback(BeginStorySessionArgs { input }, callback)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,17 +2,23 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::asset_entity_binding_input_type::AssetEntityBindingInput;
|
use super::asset_entity_binding_input_type::AssetEntityBindingInput;
|
||||||
use super::asset_entity_binding_procedure_result_type::AssetEntityBindingProcedureResult;
|
use super::asset_entity_binding_procedure_result_type::AssetEntityBindingProcedureResult;
|
||||||
|
|
||||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
struct BindAssetObjectToEntityAndReturnArgs {
|
struct BindAssetObjectToEntityAndReturnArgs {
|
||||||
pub input: AssetEntityBindingInput,
|
pub input: AssetEntityBindingInput,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for BindAssetObjectToEntityAndReturnArgs {
|
impl __sdk::InModule for BindAssetObjectToEntityAndReturnArgs {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
@@ -22,19 +28,16 @@ impl __sdk::InModule for BindAssetObjectToEntityAndReturnArgs {
|
|||||||
///
|
///
|
||||||
/// Implemented for [`super::RemoteProcedures`].
|
/// Implemented for [`super::RemoteProcedures`].
|
||||||
pub trait bind_asset_object_to_entity_and_return {
|
pub trait bind_asset_object_to_entity_and_return {
|
||||||
fn bind_asset_object_to_entity_and_return(&self, input: AssetEntityBindingInput) {
|
fn bind_asset_object_to_entity_and_return(&self, input: AssetEntityBindingInput,
|
||||||
self.bind_asset_object_to_entity_and_return_then(input, |_, _| {});
|
) {
|
||||||
|
self.bind_asset_object_to_entity_and_return_then(input, |_, _| {});
|
||||||
}
|
}
|
||||||
|
|
||||||
fn bind_asset_object_to_entity_and_return_then(
|
fn bind_asset_object_to_entity_and_return_then(
|
||||||
&self,
|
&self,
|
||||||
input: AssetEntityBindingInput,
|
input: AssetEntityBindingInput,
|
||||||
|
|
||||||
__callback: impl FnOnce(
|
__callback: impl FnOnce(&super::ProcedureEventContext, Result<AssetEntityBindingProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||||
&super::ProcedureEventContext,
|
|
||||||
Result<AssetEntityBindingProcedureResult, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,17 +46,13 @@ impl bind_asset_object_to_entity_and_return for super::RemoteProcedures {
|
|||||||
&self,
|
&self,
|
||||||
input: AssetEntityBindingInput,
|
input: AssetEntityBindingInput,
|
||||||
|
|
||||||
__callback: impl FnOnce(
|
__callback: impl FnOnce(&super::ProcedureEventContext, Result<AssetEntityBindingProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||||
&super::ProcedureEventContext,
|
|
||||||
Result<AssetEntityBindingProcedureResult, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
|
||||||
) {
|
) {
|
||||||
self.imp
|
self.imp.invoke_procedure_with_callback::<_, AssetEntityBindingProcedureResult>(
|
||||||
.invoke_procedure_with_callback::<_, AssetEntityBindingProcedureResult>(
|
"bind_asset_object_to_entity_and_return",
|
||||||
"bind_asset_object_to_entity_and_return",
|
BindAssetObjectToEntityAndReturnArgs { input, },
|
||||||
BindAssetObjectToEntityAndReturnArgs { input },
|
__callback,
|
||||||
__callback,
|
);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::asset_entity_binding_input_type::AssetEntityBindingInput;
|
use super::asset_entity_binding_input_type::AssetEntityBindingInput;
|
||||||
|
|
||||||
@@ -14,8 +19,10 @@ pub(super) struct BindAssetObjectToEntityArgs {
|
|||||||
|
|
||||||
impl From<BindAssetObjectToEntityArgs> for super::Reducer {
|
impl From<BindAssetObjectToEntityArgs> for super::Reducer {
|
||||||
fn from(args: BindAssetObjectToEntityArgs) -> Self {
|
fn from(args: BindAssetObjectToEntityArgs) -> Self {
|
||||||
Self::BindAssetObjectToEntity { input: args.input }
|
Self::BindAssetObjectToEntity {
|
||||||
}
|
input: args.input,
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl __sdk::InModule for BindAssetObjectToEntityArgs {
|
impl __sdk::InModule for BindAssetObjectToEntityArgs {
|
||||||
@@ -33,8 +40,9 @@ pub trait bind_asset_object_to_entity {
|
|||||||
/// The reducer will run asynchronously in the future,
|
/// The reducer will run asynchronously in the future,
|
||||||
/// and this method provides no way to listen for its completion status.
|
/// and this method provides no way to listen for its completion status.
|
||||||
/// /// Use [`bind_asset_object_to_entity:bind_asset_object_to_entity_then`] to run a callback after the reducer completes.
|
/// /// Use [`bind_asset_object_to_entity:bind_asset_object_to_entity_then`] to run a callback after the reducer completes.
|
||||||
fn bind_asset_object_to_entity(&self, input: AssetEntityBindingInput) -> __sdk::Result<()> {
|
fn bind_asset_object_to_entity(&self, input: AssetEntityBindingInput,
|
||||||
self.bind_asset_object_to_entity_then(input, |_, _| {})
|
) -> __sdk::Result<()> {
|
||||||
|
self.bind_asset_object_to_entity_then(input, |_, _| {})
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Request that the remote module invoke the reducer `bind_asset_object_to_entity` to run as soon as possible,
|
/// Request that the remote module invoke the reducer `bind_asset_object_to_entity` to run as soon as possible,
|
||||||
@@ -62,7 +70,7 @@ impl bind_asset_object_to_entity for super::RemoteReducers {
|
|||||||
+ Send
|
+ Send
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()> {
|
) -> __sdk::Result<()> {
|
||||||
self.imp
|
self.imp.invoke_reducer_with_callback(BindAssetObjectToEntityArgs { input, }, callback)
|
||||||
.invoke_reducer_with_callback(BindAssetObjectToEntityArgs { input }, callback)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,17 +2,23 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::ai_task_cancel_input_type::AiTaskCancelInput;
|
|
||||||
use super::ai_task_procedure_result_type::AiTaskProcedureResult;
|
use super::ai_task_procedure_result_type::AiTaskProcedureResult;
|
||||||
|
use super::ai_task_cancel_input_type::AiTaskCancelInput;
|
||||||
|
|
||||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
struct CancelAiTaskAndReturnArgs {
|
struct CancelAiTaskAndReturnArgs {
|
||||||
pub input: AiTaskCancelInput,
|
pub input: AiTaskCancelInput,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for CancelAiTaskAndReturnArgs {
|
impl __sdk::InModule for CancelAiTaskAndReturnArgs {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
@@ -22,19 +28,16 @@ impl __sdk::InModule for CancelAiTaskAndReturnArgs {
|
|||||||
///
|
///
|
||||||
/// Implemented for [`super::RemoteProcedures`].
|
/// Implemented for [`super::RemoteProcedures`].
|
||||||
pub trait cancel_ai_task_and_return {
|
pub trait cancel_ai_task_and_return {
|
||||||
fn cancel_ai_task_and_return(&self, input: AiTaskCancelInput) {
|
fn cancel_ai_task_and_return(&self, input: AiTaskCancelInput,
|
||||||
self.cancel_ai_task_and_return_then(input, |_, _| {});
|
) {
|
||||||
|
self.cancel_ai_task_and_return_then(input, |_, _| {});
|
||||||
}
|
}
|
||||||
|
|
||||||
fn cancel_ai_task_and_return_then(
|
fn cancel_ai_task_and_return_then(
|
||||||
&self,
|
&self,
|
||||||
input: AiTaskCancelInput,
|
input: AiTaskCancelInput,
|
||||||
|
|
||||||
__callback: impl FnOnce(
|
__callback: impl FnOnce(&super::ProcedureEventContext, Result<AiTaskProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||||
&super::ProcedureEventContext,
|
|
||||||
Result<AiTaskProcedureResult, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,17 +46,13 @@ impl cancel_ai_task_and_return for super::RemoteProcedures {
|
|||||||
&self,
|
&self,
|
||||||
input: AiTaskCancelInput,
|
input: AiTaskCancelInput,
|
||||||
|
|
||||||
__callback: impl FnOnce(
|
__callback: impl FnOnce(&super::ProcedureEventContext, Result<AiTaskProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||||
&super::ProcedureEventContext,
|
|
||||||
Result<AiTaskProcedureResult, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
|
||||||
) {
|
) {
|
||||||
self.imp
|
self.imp.invoke_procedure_with_callback::<_, AiTaskProcedureResult>(
|
||||||
.invoke_procedure_with_callback::<_, AiTaskProcedureResult>(
|
"cancel_ai_task_and_return",
|
||||||
"cancel_ai_task_and_return",
|
CancelAiTaskAndReturnArgs { input, },
|
||||||
CancelAiTaskAndReturnArgs { input },
|
__callback,
|
||||||
__callback,
|
);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
@@ -15,8 +20,12 @@ pub enum ChapterPaceBand {
|
|||||||
Pressure,
|
Pressure,
|
||||||
|
|
||||||
FinaleDense,
|
FinaleDense,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for ChapterPaceBand {
|
impl __sdk::InModule for ChapterPaceBand {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,13 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
@@ -11,6 +17,8 @@ pub struct ChapterProgressionGetInput {
|
|||||||
pub chapter_id: String,
|
pub chapter_id: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for ChapterProgressionGetInput {
|
impl __sdk::InModule for ChapterProgressionGetInput {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::chapter_pace_band_type::ChapterPaceBand;
|
use super::chapter_pace_band_type::ChapterPaceBand;
|
||||||
|
|
||||||
@@ -26,6 +31,8 @@ pub struct ChapterProgressionInput {
|
|||||||
pub updated_at_micros: i64,
|
pub updated_at_micros: i64,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for ChapterProgressionInput {
|
impl __sdk::InModule for ChapterProgressionInput {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,13 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
@@ -12,10 +18,12 @@ pub struct ChapterProgressionLedgerInput {
|
|||||||
pub granted_quest_xp: u32,
|
pub granted_quest_xp: u32,
|
||||||
pub granted_hostile_xp: u32,
|
pub granted_hostile_xp: u32,
|
||||||
pub hostile_defeat_increment: u32,
|
pub hostile_defeat_increment: u32,
|
||||||
pub level_at_exit: Option<u32>,
|
pub level_at_exit: Option::<u32>,
|
||||||
pub updated_at_micros: i64,
|
pub updated_at_micros: i64,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for ChapterProgressionLedgerInput {
|
impl __sdk::InModule for ChapterProgressionLedgerInput {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::chapter_progression_snapshot_type::ChapterProgressionSnapshot;
|
use super::chapter_progression_snapshot_type::ChapterProgressionSnapshot;
|
||||||
|
|
||||||
@@ -10,10 +15,12 @@ use super::chapter_progression_snapshot_type::ChapterProgressionSnapshot;
|
|||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
pub struct ChapterProgressionProcedureResult {
|
pub struct ChapterProgressionProcedureResult {
|
||||||
pub ok: bool,
|
pub ok: bool,
|
||||||
pub record: Option<ChapterProgressionSnapshot>,
|
pub record: Option::<ChapterProgressionSnapshot>,
|
||||||
pub error_message: Option<String>,
|
pub error_message: Option::<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for ChapterProgressionProcedureResult {
|
impl __sdk::InModule for ChapterProgressionProcedureResult {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::chapter_pace_band_type::ChapterPaceBand;
|
use super::chapter_pace_band_type::ChapterPaceBand;
|
||||||
|
|
||||||
@@ -25,12 +30,14 @@ pub struct ChapterProgressionSnapshot {
|
|||||||
pub expected_hostile_defeat_count: u32,
|
pub expected_hostile_defeat_count: u32,
|
||||||
pub actual_hostile_defeat_count: u32,
|
pub actual_hostile_defeat_count: u32,
|
||||||
pub level_at_entry: u32,
|
pub level_at_entry: u32,
|
||||||
pub level_at_exit: Option<u32>,
|
pub level_at_exit: Option::<u32>,
|
||||||
pub pace_band: ChapterPaceBand,
|
pub pace_band: ChapterPaceBand,
|
||||||
pub created_at_micros: i64,
|
pub created_at_micros: i64,
|
||||||
pub updated_at_micros: i64,
|
pub updated_at_micros: i64,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for ChapterProgressionSnapshot {
|
impl __sdk::InModule for ChapterProgressionSnapshot {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,9 +2,14 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use super::chapter_pace_band_type::ChapterPaceBand;
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
use super::chapter_progression_type::ChapterProgression;
|
use super::chapter_progression_type::ChapterProgression;
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use super::chapter_pace_band_type::ChapterPaceBand;
|
||||||
|
|
||||||
/// Table handle for the table `chapter_progression`.
|
/// Table handle for the table `chapter_progression`.
|
||||||
///
|
///
|
||||||
@@ -32,9 +37,7 @@ pub trait ChapterProgressionTableAccess {
|
|||||||
impl ChapterProgressionTableAccess for super::RemoteTables {
|
impl ChapterProgressionTableAccess for super::RemoteTables {
|
||||||
fn chapter_progression(&self) -> ChapterProgressionTableHandle<'_> {
|
fn chapter_progression(&self) -> ChapterProgressionTableHandle<'_> {
|
||||||
ChapterProgressionTableHandle {
|
ChapterProgressionTableHandle {
|
||||||
imp: self
|
imp: self.imp.get_table::<ChapterProgression>("chapter_progression"),
|
||||||
.imp
|
|
||||||
.get_table::<ChapterProgression>("chapter_progression"),
|
|
||||||
ctx: std::marker::PhantomData,
|
ctx: std::marker::PhantomData,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -47,12 +50,8 @@ impl<'ctx> __sdk::Table for ChapterProgressionTableHandle<'ctx> {
|
|||||||
type Row = ChapterProgression;
|
type Row = ChapterProgression;
|
||||||
type EventContext = super::EventContext;
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
fn count(&self) -> u64 {
|
fn count(&self) -> u64 { self.imp.count() }
|
||||||
self.imp.count()
|
fn iter(&self) -> impl Iterator<Item = ChapterProgression> + '_ { self.imp.iter() }
|
||||||
}
|
|
||||||
fn iter(&self) -> impl Iterator<Item = ChapterProgression> + '_ {
|
|
||||||
self.imp.iter()
|
|
||||||
}
|
|
||||||
|
|
||||||
type InsertCallbackId = ChapterProgressionInsertCallbackId;
|
type InsertCallbackId = ChapterProgressionInsertCallbackId;
|
||||||
|
|
||||||
@@ -98,44 +97,41 @@ impl<'ctx> __sdk::TableWithPrimaryKey for ChapterProgressionTableHandle<'ctx> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Access to the `chapter_progression_id` unique index on the table `chapter_progression`,
|
/// Access to the `chapter_progression_id` unique index on the table `chapter_progression`,
|
||||||
/// which allows point queries on the field of the same name
|
/// which allows point queries on the field of the same name
|
||||||
/// via the [`ChapterProgressionChapterProgressionIdUnique::find`] method.
|
/// via the [`ChapterProgressionChapterProgressionIdUnique::find`] method.
|
||||||
///
|
///
|
||||||
/// Users are encouraged not to explicitly reference this type,
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
/// but to directly chain method calls,
|
/// but to directly chain method calls,
|
||||||
/// like `ctx.db.chapter_progression().chapter_progression_id().find(...)`.
|
/// like `ctx.db.chapter_progression().chapter_progression_id().find(...)`.
|
||||||
pub struct ChapterProgressionChapterProgressionIdUnique<'ctx> {
|
pub struct ChapterProgressionChapterProgressionIdUnique<'ctx> {
|
||||||
imp: __sdk::UniqueConstraintHandle<ChapterProgression, String>,
|
imp: __sdk::UniqueConstraintHandle<ChapterProgression, String>,
|
||||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
}
|
|
||||||
|
|
||||||
impl<'ctx> ChapterProgressionTableHandle<'ctx> {
|
|
||||||
/// Get a handle on the `chapter_progression_id` unique index on the table `chapter_progression`.
|
|
||||||
pub fn chapter_progression_id(&self) -> ChapterProgressionChapterProgressionIdUnique<'ctx> {
|
|
||||||
ChapterProgressionChapterProgressionIdUnique {
|
|
||||||
imp: self
|
|
||||||
.imp
|
|
||||||
.get_unique_constraint::<String>("chapter_progression_id"),
|
|
||||||
phantom: std::marker::PhantomData,
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'ctx> ChapterProgressionChapterProgressionIdUnique<'ctx> {
|
impl<'ctx> ChapterProgressionTableHandle<'ctx> {
|
||||||
/// Find the subscribed row whose `chapter_progression_id` column value is equal to `col_val`,
|
/// Get a handle on the `chapter_progression_id` unique index on the table `chapter_progression`.
|
||||||
/// if such a row is present in the client cache.
|
pub fn chapter_progression_id(&self) -> ChapterProgressionChapterProgressionIdUnique<'ctx> {
|
||||||
pub fn find(&self, col_val: &String) -> Option<ChapterProgression> {
|
ChapterProgressionChapterProgressionIdUnique {
|
||||||
self.imp.find(col_val)
|
imp: self.imp.get_unique_constraint::<String>("chapter_progression_id"),
|
||||||
}
|
phantom: std::marker::PhantomData,
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> ChapterProgressionChapterProgressionIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `chapter_progression_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<ChapterProgression> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
|
||||||
let _table = client_cache.get_or_make_table::<ChapterProgression>("chapter_progression");
|
let _table = client_cache.get_or_make_table::<ChapterProgression>("chapter_progression");
|
||||||
_table.add_unique_constraint::<String>("chapter_progression_id", |row| {
|
_table.add_unique_constraint::<String>("chapter_progression_id", |row| &row.chapter_progression_id);
|
||||||
&row.chapter_progression_id
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
@@ -143,24 +139,26 @@ pub(super) fn parse_table_update(
|
|||||||
raw_updates: __ws::v2::TableUpdate,
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
) -> __sdk::Result<__sdk::TableUpdate<ChapterProgression>> {
|
) -> __sdk::Result<__sdk::TableUpdate<ChapterProgression>> {
|
||||||
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
__sdk::InternalError::failed_parse("TableUpdate<ChapterProgression>", "TableUpdate")
|
__sdk::InternalError::failed_parse(
|
||||||
.with_cause(e)
|
"TableUpdate<ChapterProgression>",
|
||||||
.into()
|
"TableUpdate",
|
||||||
|
).with_cause(e).into()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(non_camel_case_types)]
|
#[allow(non_camel_case_types)]
|
||||||
/// Extension trait for query builder access to the table `ChapterProgression`.
|
/// Extension trait for query builder access to the table `ChapterProgression`.
|
||||||
///
|
///
|
||||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
pub trait chapter_progressionQueryTableAccess {
|
pub trait chapter_progressionQueryTableAccess {
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
/// Get a query builder for the table `ChapterProgression`.
|
/// Get a query builder for the table `ChapterProgression`.
|
||||||
fn chapter_progression(&self) -> __sdk::__query_builder::Table<ChapterProgression>;
|
fn chapter_progression(&self) -> __sdk::__query_builder::Table<ChapterProgression>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl chapter_progressionQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn chapter_progression(&self) -> __sdk::__query_builder::Table<ChapterProgression> {
|
||||||
|
__sdk::__query_builder::Table::new("chapter_progression")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl chapter_progressionQueryTableAccess for __sdk::QueryTableAccessor {
|
|
||||||
fn chapter_progression(&self) -> __sdk::__query_builder::Table<ChapterProgression> {
|
|
||||||
__sdk::__query_builder::Table::new("chapter_progression")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::chapter_pace_band_type::ChapterPaceBand;
|
use super::chapter_pace_band_type::ChapterPaceBand;
|
||||||
|
|
||||||
@@ -26,16 +31,18 @@ pub struct ChapterProgression {
|
|||||||
pub expected_hostile_defeat_count: u32,
|
pub expected_hostile_defeat_count: u32,
|
||||||
pub actual_hostile_defeat_count: u32,
|
pub actual_hostile_defeat_count: u32,
|
||||||
pub level_at_entry: u32,
|
pub level_at_entry: u32,
|
||||||
pub level_at_exit: Option<u32>,
|
pub level_at_exit: Option::<u32>,
|
||||||
pub pace_band: ChapterPaceBand,
|
pub pace_band: ChapterPaceBand,
|
||||||
pub created_at: __sdk::Timestamp,
|
pub created_at: __sdk::Timestamp,
|
||||||
pub updated_at: __sdk::Timestamp,
|
pub updated_at: __sdk::Timestamp,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for ChapterProgression {
|
impl __sdk::InModule for ChapterProgression {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Column accessor struct for the table `ChapterProgression`.
|
/// Column accessor struct for the table `ChapterProgression`.
|
||||||
///
|
///
|
||||||
/// Provides typed access to columns for query building.
|
/// Provides typed access to columns for query building.
|
||||||
@@ -57,7 +64,7 @@ pub struct ChapterProgressionCols {
|
|||||||
pub expected_hostile_defeat_count: __sdk::__query_builder::Col<ChapterProgression, u32>,
|
pub expected_hostile_defeat_count: __sdk::__query_builder::Col<ChapterProgression, u32>,
|
||||||
pub actual_hostile_defeat_count: __sdk::__query_builder::Col<ChapterProgression, u32>,
|
pub actual_hostile_defeat_count: __sdk::__query_builder::Col<ChapterProgression, u32>,
|
||||||
pub level_at_entry: __sdk::__query_builder::Col<ChapterProgression, u32>,
|
pub level_at_entry: __sdk::__query_builder::Col<ChapterProgression, u32>,
|
||||||
pub level_at_exit: __sdk::__query_builder::Col<ChapterProgression, Option<u32>>,
|
pub level_at_exit: __sdk::__query_builder::Col<ChapterProgression, Option::<u32>>,
|
||||||
pub pace_band: __sdk::__query_builder::Col<ChapterProgression, ChapterPaceBand>,
|
pub pace_band: __sdk::__query_builder::Col<ChapterProgression, ChapterPaceBand>,
|
||||||
pub created_at: __sdk::__query_builder::Col<ChapterProgression, __sdk::Timestamp>,
|
pub created_at: __sdk::__query_builder::Col<ChapterProgression, __sdk::Timestamp>,
|
||||||
pub updated_at: __sdk::__query_builder::Col<ChapterProgression, __sdk::Timestamp>,
|
pub updated_at: __sdk::__query_builder::Col<ChapterProgression, __sdk::Timestamp>,
|
||||||
@@ -67,22 +74,13 @@ impl __sdk::__query_builder::HasCols for ChapterProgression {
|
|||||||
type Cols = ChapterProgressionCols;
|
type Cols = ChapterProgressionCols;
|
||||||
fn cols(table_name: &'static str) -> Self::Cols {
|
fn cols(table_name: &'static str) -> Self::Cols {
|
||||||
ChapterProgressionCols {
|
ChapterProgressionCols {
|
||||||
chapter_progression_id: __sdk::__query_builder::Col::new(
|
chapter_progression_id: __sdk::__query_builder::Col::new(table_name, "chapter_progression_id"),
|
||||||
table_name,
|
|
||||||
"chapter_progression_id",
|
|
||||||
),
|
|
||||||
user_id: __sdk::__query_builder::Col::new(table_name, "user_id"),
|
user_id: __sdk::__query_builder::Col::new(table_name, "user_id"),
|
||||||
chapter_id: __sdk::__query_builder::Col::new(table_name, "chapter_id"),
|
chapter_id: __sdk::__query_builder::Col::new(table_name, "chapter_id"),
|
||||||
chapter_index: __sdk::__query_builder::Col::new(table_name, "chapter_index"),
|
chapter_index: __sdk::__query_builder::Col::new(table_name, "chapter_index"),
|
||||||
total_chapters: __sdk::__query_builder::Col::new(table_name, "total_chapters"),
|
total_chapters: __sdk::__query_builder::Col::new(table_name, "total_chapters"),
|
||||||
entry_pseudo_level_millis: __sdk::__query_builder::Col::new(
|
entry_pseudo_level_millis: __sdk::__query_builder::Col::new(table_name, "entry_pseudo_level_millis"),
|
||||||
table_name,
|
exit_pseudo_level_millis: __sdk::__query_builder::Col::new(table_name, "exit_pseudo_level_millis"),
|
||||||
"entry_pseudo_level_millis",
|
|
||||||
),
|
|
||||||
exit_pseudo_level_millis: __sdk::__query_builder::Col::new(
|
|
||||||
table_name,
|
|
||||||
"exit_pseudo_level_millis",
|
|
||||||
),
|
|
||||||
entry_level: __sdk::__query_builder::Col::new(table_name, "entry_level"),
|
entry_level: __sdk::__query_builder::Col::new(table_name, "entry_level"),
|
||||||
exit_level: __sdk::__query_builder::Col::new(table_name, "exit_level"),
|
exit_level: __sdk::__query_builder::Col::new(table_name, "exit_level"),
|
||||||
planned_total_xp: __sdk::__query_builder::Col::new(table_name, "planned_total_xp"),
|
planned_total_xp: __sdk::__query_builder::Col::new(table_name, "planned_total_xp"),
|
||||||
@@ -90,19 +88,14 @@ impl __sdk::__query_builder::HasCols for ChapterProgression {
|
|||||||
planned_hostile_xp: __sdk::__query_builder::Col::new(table_name, "planned_hostile_xp"),
|
planned_hostile_xp: __sdk::__query_builder::Col::new(table_name, "planned_hostile_xp"),
|
||||||
actual_quest_xp: __sdk::__query_builder::Col::new(table_name, "actual_quest_xp"),
|
actual_quest_xp: __sdk::__query_builder::Col::new(table_name, "actual_quest_xp"),
|
||||||
actual_hostile_xp: __sdk::__query_builder::Col::new(table_name, "actual_hostile_xp"),
|
actual_hostile_xp: __sdk::__query_builder::Col::new(table_name, "actual_hostile_xp"),
|
||||||
expected_hostile_defeat_count: __sdk::__query_builder::Col::new(
|
expected_hostile_defeat_count: __sdk::__query_builder::Col::new(table_name, "expected_hostile_defeat_count"),
|
||||||
table_name,
|
actual_hostile_defeat_count: __sdk::__query_builder::Col::new(table_name, "actual_hostile_defeat_count"),
|
||||||
"expected_hostile_defeat_count",
|
|
||||||
),
|
|
||||||
actual_hostile_defeat_count: __sdk::__query_builder::Col::new(
|
|
||||||
table_name,
|
|
||||||
"actual_hostile_defeat_count",
|
|
||||||
),
|
|
||||||
level_at_entry: __sdk::__query_builder::Col::new(table_name, "level_at_entry"),
|
level_at_entry: __sdk::__query_builder::Col::new(table_name, "level_at_entry"),
|
||||||
level_at_exit: __sdk::__query_builder::Col::new(table_name, "level_at_exit"),
|
level_at_exit: __sdk::__query_builder::Col::new(table_name, "level_at_exit"),
|
||||||
pace_band: __sdk::__query_builder::Col::new(table_name, "pace_band"),
|
pace_band: __sdk::__query_builder::Col::new(table_name, "pace_band"),
|
||||||
created_at: __sdk::__query_builder::Col::new(table_name, "created_at"),
|
created_at: __sdk::__query_builder::Col::new(table_name, "created_at"),
|
||||||
updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"),
|
updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"),
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -121,13 +114,12 @@ impl __sdk::__query_builder::HasIxCols for ChapterProgression {
|
|||||||
fn ix_cols(table_name: &'static str) -> Self::IxCols {
|
fn ix_cols(table_name: &'static str) -> Self::IxCols {
|
||||||
ChapterProgressionIxCols {
|
ChapterProgressionIxCols {
|
||||||
chapter_id: __sdk::__query_builder::IxCol::new(table_name, "chapter_id"),
|
chapter_id: __sdk::__query_builder::IxCol::new(table_name, "chapter_id"),
|
||||||
chapter_progression_id: __sdk::__query_builder::IxCol::new(
|
chapter_progression_id: __sdk::__query_builder::IxCol::new(table_name, "chapter_progression_id"),
|
||||||
table_name,
|
|
||||||
"chapter_progression_id",
|
|
||||||
),
|
|
||||||
user_id: __sdk::__query_builder::IxCol::new(table_name, "user_id"),
|
user_id: __sdk::__query_builder::IxCol::new(table_name, "user_id"),
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl __sdk::__query_builder::CanBeLookupTable for ChapterProgression {}
|
impl __sdk::__query_builder::CanBeLookupTable for ChapterProgression {}
|
||||||
|
|
||||||
|
|||||||
@@ -2,17 +2,23 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::runtime_browse_history_clear_input_type::RuntimeBrowseHistoryClearInput;
|
use super::runtime_browse_history_clear_input_type::RuntimeBrowseHistoryClearInput;
|
||||||
use super::runtime_browse_history_procedure_result_type::RuntimeBrowseHistoryProcedureResult;
|
use super::runtime_browse_history_procedure_result_type::RuntimeBrowseHistoryProcedureResult;
|
||||||
|
|
||||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
struct ClearPlatformBrowseHistoryAndReturnArgs {
|
struct ClearPlatformBrowseHistoryAndReturnArgs {
|
||||||
pub input: RuntimeBrowseHistoryClearInput,
|
pub input: RuntimeBrowseHistoryClearInput,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for ClearPlatformBrowseHistoryAndReturnArgs {
|
impl __sdk::InModule for ClearPlatformBrowseHistoryAndReturnArgs {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
@@ -22,19 +28,16 @@ impl __sdk::InModule for ClearPlatformBrowseHistoryAndReturnArgs {
|
|||||||
///
|
///
|
||||||
/// Implemented for [`super::RemoteProcedures`].
|
/// Implemented for [`super::RemoteProcedures`].
|
||||||
pub trait clear_platform_browse_history_and_return {
|
pub trait clear_platform_browse_history_and_return {
|
||||||
fn clear_platform_browse_history_and_return(&self, input: RuntimeBrowseHistoryClearInput) {
|
fn clear_platform_browse_history_and_return(&self, input: RuntimeBrowseHistoryClearInput,
|
||||||
self.clear_platform_browse_history_and_return_then(input, |_, _| {});
|
) {
|
||||||
|
self.clear_platform_browse_history_and_return_then(input, |_, _| {});
|
||||||
}
|
}
|
||||||
|
|
||||||
fn clear_platform_browse_history_and_return_then(
|
fn clear_platform_browse_history_and_return_then(
|
||||||
&self,
|
&self,
|
||||||
input: RuntimeBrowseHistoryClearInput,
|
input: RuntimeBrowseHistoryClearInput,
|
||||||
|
|
||||||
__callback: impl FnOnce(
|
__callback: impl FnOnce(&super::ProcedureEventContext, Result<RuntimeBrowseHistoryProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||||
&super::ProcedureEventContext,
|
|
||||||
Result<RuntimeBrowseHistoryProcedureResult, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,17 +46,13 @@ impl clear_platform_browse_history_and_return for super::RemoteProcedures {
|
|||||||
&self,
|
&self,
|
||||||
input: RuntimeBrowseHistoryClearInput,
|
input: RuntimeBrowseHistoryClearInput,
|
||||||
|
|
||||||
__callback: impl FnOnce(
|
__callback: impl FnOnce(&super::ProcedureEventContext, Result<RuntimeBrowseHistoryProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||||
&super::ProcedureEventContext,
|
|
||||||
Result<RuntimeBrowseHistoryProcedureResult, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
|
||||||
) {
|
) {
|
||||||
self.imp
|
self.imp.invoke_procedure_with_callback::<_, RuntimeBrowseHistoryProcedureResult>(
|
||||||
.invoke_procedure_with_callback::<_, RuntimeBrowseHistoryProcedureResult>(
|
"clear_platform_browse_history_and_return",
|
||||||
"clear_platform_browse_history_and_return",
|
ClearPlatformBrowseHistoryAndReturnArgs { input, },
|
||||||
ClearPlatformBrowseHistoryAndReturnArgs { input },
|
__callback,
|
||||||
__callback,
|
);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
@@ -15,8 +20,12 @@ pub enum CombatOutcome {
|
|||||||
SparComplete,
|
SparComplete,
|
||||||
|
|
||||||
Escaped,
|
Escaped,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for CombatOutcome {
|
impl __sdk::InModule for CombatOutcome {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,17 +2,23 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::custom_world_published_profile_compile_input_type::CustomWorldPublishedProfileCompileInput;
|
use super::custom_world_published_profile_compile_input_type::CustomWorldPublishedProfileCompileInput;
|
||||||
use super::custom_world_published_profile_compile_result_type::CustomWorldPublishedProfileCompileResult;
|
use super::custom_world_published_profile_compile_result_type::CustomWorldPublishedProfileCompileResult;
|
||||||
|
|
||||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
struct CompileCustomWorldPublishedProfileArgs {
|
struct CompileCustomWorldPublishedProfileArgs {
|
||||||
pub input: CustomWorldPublishedProfileCompileInput,
|
pub input: CustomWorldPublishedProfileCompileInput,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for CompileCustomWorldPublishedProfileArgs {
|
impl __sdk::InModule for CompileCustomWorldPublishedProfileArgs {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
@@ -22,22 +28,16 @@ impl __sdk::InModule for CompileCustomWorldPublishedProfileArgs {
|
|||||||
///
|
///
|
||||||
/// Implemented for [`super::RemoteProcedures`].
|
/// Implemented for [`super::RemoteProcedures`].
|
||||||
pub trait compile_custom_world_published_profile {
|
pub trait compile_custom_world_published_profile {
|
||||||
fn compile_custom_world_published_profile(
|
fn compile_custom_world_published_profile(&self, input: CustomWorldPublishedProfileCompileInput,
|
||||||
&self,
|
) {
|
||||||
input: CustomWorldPublishedProfileCompileInput,
|
self.compile_custom_world_published_profile_then(input, |_, _| {});
|
||||||
) {
|
|
||||||
self.compile_custom_world_published_profile_then(input, |_, _| {});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn compile_custom_world_published_profile_then(
|
fn compile_custom_world_published_profile_then(
|
||||||
&self,
|
&self,
|
||||||
input: CustomWorldPublishedProfileCompileInput,
|
input: CustomWorldPublishedProfileCompileInput,
|
||||||
|
|
||||||
__callback: impl FnOnce(
|
__callback: impl FnOnce(&super::ProcedureEventContext, Result<CustomWorldPublishedProfileCompileResult, __sdk::InternalError>) + Send + 'static,
|
||||||
&super::ProcedureEventContext,
|
|
||||||
Result<CustomWorldPublishedProfileCompileResult, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -46,17 +46,13 @@ impl compile_custom_world_published_profile for super::RemoteProcedures {
|
|||||||
&self,
|
&self,
|
||||||
input: CustomWorldPublishedProfileCompileInput,
|
input: CustomWorldPublishedProfileCompileInput,
|
||||||
|
|
||||||
__callback: impl FnOnce(
|
__callback: impl FnOnce(&super::ProcedureEventContext, Result<CustomWorldPublishedProfileCompileResult, __sdk::InternalError>) + Send + 'static,
|
||||||
&super::ProcedureEventContext,
|
|
||||||
Result<CustomWorldPublishedProfileCompileResult, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
|
||||||
) {
|
) {
|
||||||
self.imp
|
self.imp.invoke_procedure_with_callback::<_, CustomWorldPublishedProfileCompileResult>(
|
||||||
.invoke_procedure_with_callback::<_, CustomWorldPublishedProfileCompileResult>(
|
"compile_custom_world_published_profile",
|
||||||
"compile_custom_world_published_profile",
|
CompileCustomWorldPublishedProfileArgs { input, },
|
||||||
CompileCustomWorldPublishedProfileArgs { input },
|
__callback,
|
||||||
__callback,
|
);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,17 +2,23 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::ai_stage_completion_input_type::AiStageCompletionInput;
|
|
||||||
use super::ai_task_procedure_result_type::AiTaskProcedureResult;
|
use super::ai_task_procedure_result_type::AiTaskProcedureResult;
|
||||||
|
use super::ai_stage_completion_input_type::AiStageCompletionInput;
|
||||||
|
|
||||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
struct CompleteAiStageAndReturnArgs {
|
struct CompleteAiStageAndReturnArgs {
|
||||||
pub input: AiStageCompletionInput,
|
pub input: AiStageCompletionInput,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for CompleteAiStageAndReturnArgs {
|
impl __sdk::InModule for CompleteAiStageAndReturnArgs {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
@@ -22,19 +28,16 @@ impl __sdk::InModule for CompleteAiStageAndReturnArgs {
|
|||||||
///
|
///
|
||||||
/// Implemented for [`super::RemoteProcedures`].
|
/// Implemented for [`super::RemoteProcedures`].
|
||||||
pub trait complete_ai_stage_and_return {
|
pub trait complete_ai_stage_and_return {
|
||||||
fn complete_ai_stage_and_return(&self, input: AiStageCompletionInput) {
|
fn complete_ai_stage_and_return(&self, input: AiStageCompletionInput,
|
||||||
self.complete_ai_stage_and_return_then(input, |_, _| {});
|
) {
|
||||||
|
self.complete_ai_stage_and_return_then(input, |_, _| {});
|
||||||
}
|
}
|
||||||
|
|
||||||
fn complete_ai_stage_and_return_then(
|
fn complete_ai_stage_and_return_then(
|
||||||
&self,
|
&self,
|
||||||
input: AiStageCompletionInput,
|
input: AiStageCompletionInput,
|
||||||
|
|
||||||
__callback: impl FnOnce(
|
__callback: impl FnOnce(&super::ProcedureEventContext, Result<AiTaskProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||||
&super::ProcedureEventContext,
|
|
||||||
Result<AiTaskProcedureResult, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,17 +46,13 @@ impl complete_ai_stage_and_return for super::RemoteProcedures {
|
|||||||
&self,
|
&self,
|
||||||
input: AiStageCompletionInput,
|
input: AiStageCompletionInput,
|
||||||
|
|
||||||
__callback: impl FnOnce(
|
__callback: impl FnOnce(&super::ProcedureEventContext, Result<AiTaskProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||||
&super::ProcedureEventContext,
|
|
||||||
Result<AiTaskProcedureResult, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
|
||||||
) {
|
) {
|
||||||
self.imp
|
self.imp.invoke_procedure_with_callback::<_, AiTaskProcedureResult>(
|
||||||
.invoke_procedure_with_callback::<_, AiTaskProcedureResult>(
|
"complete_ai_stage_and_return",
|
||||||
"complete_ai_stage_and_return",
|
CompleteAiStageAndReturnArgs { input, },
|
||||||
CompleteAiStageAndReturnArgs { input },
|
__callback,
|
||||||
__callback,
|
);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,17 +2,23 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::ai_task_finish_input_type::AiTaskFinishInput;
|
|
||||||
use super::ai_task_procedure_result_type::AiTaskProcedureResult;
|
use super::ai_task_procedure_result_type::AiTaskProcedureResult;
|
||||||
|
use super::ai_task_finish_input_type::AiTaskFinishInput;
|
||||||
|
|
||||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
struct CompleteAiTaskAndReturnArgs {
|
struct CompleteAiTaskAndReturnArgs {
|
||||||
pub input: AiTaskFinishInput,
|
pub input: AiTaskFinishInput,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for CompleteAiTaskAndReturnArgs {
|
impl __sdk::InModule for CompleteAiTaskAndReturnArgs {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
@@ -22,19 +28,16 @@ impl __sdk::InModule for CompleteAiTaskAndReturnArgs {
|
|||||||
///
|
///
|
||||||
/// Implemented for [`super::RemoteProcedures`].
|
/// Implemented for [`super::RemoteProcedures`].
|
||||||
pub trait complete_ai_task_and_return {
|
pub trait complete_ai_task_and_return {
|
||||||
fn complete_ai_task_and_return(&self, input: AiTaskFinishInput) {
|
fn complete_ai_task_and_return(&self, input: AiTaskFinishInput,
|
||||||
self.complete_ai_task_and_return_then(input, |_, _| {});
|
) {
|
||||||
|
self.complete_ai_task_and_return_then(input, |_, _| {});
|
||||||
}
|
}
|
||||||
|
|
||||||
fn complete_ai_task_and_return_then(
|
fn complete_ai_task_and_return_then(
|
||||||
&self,
|
&self,
|
||||||
input: AiTaskFinishInput,
|
input: AiTaskFinishInput,
|
||||||
|
|
||||||
__callback: impl FnOnce(
|
__callback: impl FnOnce(&super::ProcedureEventContext, Result<AiTaskProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||||
&super::ProcedureEventContext,
|
|
||||||
Result<AiTaskProcedureResult, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,17 +46,13 @@ impl complete_ai_task_and_return for super::RemoteProcedures {
|
|||||||
&self,
|
&self,
|
||||||
input: AiTaskFinishInput,
|
input: AiTaskFinishInput,
|
||||||
|
|
||||||
__callback: impl FnOnce(
|
__callback: impl FnOnce(&super::ProcedureEventContext, Result<AiTaskProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||||
&super::ProcedureEventContext,
|
|
||||||
Result<AiTaskProcedureResult, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
|
||||||
) {
|
) {
|
||||||
self.imp
|
self.imp.invoke_procedure_with_callback::<_, AiTaskProcedureResult>(
|
||||||
.invoke_procedure_with_callback::<_, AiTaskProcedureResult>(
|
"complete_ai_task_and_return",
|
||||||
"complete_ai_task_and_return",
|
CompleteAiTaskAndReturnArgs { input, },
|
||||||
CompleteAiTaskAndReturnArgs { input },
|
__callback,
|
||||||
__callback,
|
);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,17 +2,23 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::asset_object_procedure_result_type::AssetObjectProcedureResult;
|
|
||||||
use super::asset_object_upsert_input_type::AssetObjectUpsertInput;
|
use super::asset_object_upsert_input_type::AssetObjectUpsertInput;
|
||||||
|
use super::asset_object_procedure_result_type::AssetObjectProcedureResult;
|
||||||
|
|
||||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
struct ConfirmAssetObjectAndReturnArgs {
|
struct ConfirmAssetObjectAndReturnArgs {
|
||||||
pub input: AssetObjectUpsertInput,
|
pub input: AssetObjectUpsertInput,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for ConfirmAssetObjectAndReturnArgs {
|
impl __sdk::InModule for ConfirmAssetObjectAndReturnArgs {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
@@ -22,19 +28,16 @@ impl __sdk::InModule for ConfirmAssetObjectAndReturnArgs {
|
|||||||
///
|
///
|
||||||
/// Implemented for [`super::RemoteProcedures`].
|
/// Implemented for [`super::RemoteProcedures`].
|
||||||
pub trait confirm_asset_object_and_return {
|
pub trait confirm_asset_object_and_return {
|
||||||
fn confirm_asset_object_and_return(&self, input: AssetObjectUpsertInput) {
|
fn confirm_asset_object_and_return(&self, input: AssetObjectUpsertInput,
|
||||||
self.confirm_asset_object_and_return_then(input, |_, _| {});
|
) {
|
||||||
|
self.confirm_asset_object_and_return_then(input, |_, _| {});
|
||||||
}
|
}
|
||||||
|
|
||||||
fn confirm_asset_object_and_return_then(
|
fn confirm_asset_object_and_return_then(
|
||||||
&self,
|
&self,
|
||||||
input: AssetObjectUpsertInput,
|
input: AssetObjectUpsertInput,
|
||||||
|
|
||||||
__callback: impl FnOnce(
|
__callback: impl FnOnce(&super::ProcedureEventContext, Result<AssetObjectProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||||
&super::ProcedureEventContext,
|
|
||||||
Result<AssetObjectProcedureResult, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,17 +46,13 @@ impl confirm_asset_object_and_return for super::RemoteProcedures {
|
|||||||
&self,
|
&self,
|
||||||
input: AssetObjectUpsertInput,
|
input: AssetObjectUpsertInput,
|
||||||
|
|
||||||
__callback: impl FnOnce(
|
__callback: impl FnOnce(&super::ProcedureEventContext, Result<AssetObjectProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||||
&super::ProcedureEventContext,
|
|
||||||
Result<AssetObjectProcedureResult, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
|
||||||
) {
|
) {
|
||||||
self.imp
|
self.imp.invoke_procedure_with_callback::<_, AssetObjectProcedureResult>(
|
||||||
.invoke_procedure_with_callback::<_, AssetObjectProcedureResult>(
|
"confirm_asset_object_and_return",
|
||||||
"confirm_asset_object_and_return",
|
ConfirmAssetObjectAndReturnArgs { input, },
|
||||||
ConfirmAssetObjectAndReturnArgs { input },
|
__callback,
|
||||||
__callback,
|
);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::asset_object_upsert_input_type::AssetObjectUpsertInput;
|
use super::asset_object_upsert_input_type::AssetObjectUpsertInput;
|
||||||
|
|
||||||
@@ -14,8 +19,10 @@ pub(super) struct ConfirmAssetObjectArgs {
|
|||||||
|
|
||||||
impl From<ConfirmAssetObjectArgs> for super::Reducer {
|
impl From<ConfirmAssetObjectArgs> for super::Reducer {
|
||||||
fn from(args: ConfirmAssetObjectArgs) -> Self {
|
fn from(args: ConfirmAssetObjectArgs) -> Self {
|
||||||
Self::ConfirmAssetObject { input: args.input }
|
Self::ConfirmAssetObject {
|
||||||
}
|
input: args.input,
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl __sdk::InModule for ConfirmAssetObjectArgs {
|
impl __sdk::InModule for ConfirmAssetObjectArgs {
|
||||||
@@ -33,8 +40,9 @@ pub trait confirm_asset_object {
|
|||||||
/// The reducer will run asynchronously in the future,
|
/// The reducer will run asynchronously in the future,
|
||||||
/// and this method provides no way to listen for its completion status.
|
/// and this method provides no way to listen for its completion status.
|
||||||
/// /// Use [`confirm_asset_object:confirm_asset_object_then`] to run a callback after the reducer completes.
|
/// /// Use [`confirm_asset_object:confirm_asset_object_then`] to run a callback after the reducer completes.
|
||||||
fn confirm_asset_object(&self, input: AssetObjectUpsertInput) -> __sdk::Result<()> {
|
fn confirm_asset_object(&self, input: AssetObjectUpsertInput,
|
||||||
self.confirm_asset_object_then(input, |_, _| {})
|
) -> __sdk::Result<()> {
|
||||||
|
self.confirm_asset_object_then(input, |_, _| {})
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Request that the remote module invoke the reducer `confirm_asset_object` to run as soon as possible,
|
/// Request that the remote module invoke the reducer `confirm_asset_object` to run as soon as possible,
|
||||||
@@ -62,7 +70,7 @@ impl confirm_asset_object for super::RemoteReducers {
|
|||||||
+ Send
|
+ Send
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()> {
|
) -> __sdk::Result<()> {
|
||||||
self.imp
|
self.imp.invoke_reducer_with_callback(ConfirmAssetObjectArgs { input, }, callback)
|
||||||
.invoke_reducer_with_callback(ConfirmAssetObjectArgs { input }, callback)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,13 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
@@ -11,6 +17,8 @@ pub struct ConsumeInventoryItemInput {
|
|||||||
pub quantity: u32,
|
pub quantity: u32,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for ConsumeInventoryItemInput {
|
impl __sdk::InModule for ConsumeInventoryItemInput {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,17 +2,23 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::story_continue_input_type::StoryContinueInput;
|
|
||||||
use super::story_session_procedure_result_type::StorySessionProcedureResult;
|
use super::story_session_procedure_result_type::StorySessionProcedureResult;
|
||||||
|
use super::story_continue_input_type::StoryContinueInput;
|
||||||
|
|
||||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
struct ContinueStoryAndReturnArgs {
|
struct ContinueStoryAndReturnArgs {
|
||||||
pub input: StoryContinueInput,
|
pub input: StoryContinueInput,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for ContinueStoryAndReturnArgs {
|
impl __sdk::InModule for ContinueStoryAndReturnArgs {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
@@ -22,19 +28,16 @@ impl __sdk::InModule for ContinueStoryAndReturnArgs {
|
|||||||
///
|
///
|
||||||
/// Implemented for [`super::RemoteProcedures`].
|
/// Implemented for [`super::RemoteProcedures`].
|
||||||
pub trait continue_story_and_return {
|
pub trait continue_story_and_return {
|
||||||
fn continue_story_and_return(&self, input: StoryContinueInput) {
|
fn continue_story_and_return(&self, input: StoryContinueInput,
|
||||||
self.continue_story_and_return_then(input, |_, _| {});
|
) {
|
||||||
|
self.continue_story_and_return_then(input, |_, _| {});
|
||||||
}
|
}
|
||||||
|
|
||||||
fn continue_story_and_return_then(
|
fn continue_story_and_return_then(
|
||||||
&self,
|
&self,
|
||||||
input: StoryContinueInput,
|
input: StoryContinueInput,
|
||||||
|
|
||||||
__callback: impl FnOnce(
|
__callback: impl FnOnce(&super::ProcedureEventContext, Result<StorySessionProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||||
&super::ProcedureEventContext,
|
|
||||||
Result<StorySessionProcedureResult, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,17 +46,13 @@ impl continue_story_and_return for super::RemoteProcedures {
|
|||||||
&self,
|
&self,
|
||||||
input: StoryContinueInput,
|
input: StoryContinueInput,
|
||||||
|
|
||||||
__callback: impl FnOnce(
|
__callback: impl FnOnce(&super::ProcedureEventContext, Result<StorySessionProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||||
&super::ProcedureEventContext,
|
|
||||||
Result<StorySessionProcedureResult, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
|
||||||
) {
|
) {
|
||||||
self.imp
|
self.imp.invoke_procedure_with_callback::<_, StorySessionProcedureResult>(
|
||||||
.invoke_procedure_with_callback::<_, StorySessionProcedureResult>(
|
"continue_story_and_return",
|
||||||
"continue_story_and_return",
|
ContinueStoryAndReturnArgs { input, },
|
||||||
ContinueStoryAndReturnArgs { input },
|
__callback,
|
||||||
__callback,
|
);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::story_continue_input_type::StoryContinueInput;
|
use super::story_continue_input_type::StoryContinueInput;
|
||||||
|
|
||||||
@@ -14,8 +19,10 @@ pub(super) struct ContinueStoryArgs {
|
|||||||
|
|
||||||
impl From<ContinueStoryArgs> for super::Reducer {
|
impl From<ContinueStoryArgs> for super::Reducer {
|
||||||
fn from(args: ContinueStoryArgs) -> Self {
|
fn from(args: ContinueStoryArgs) -> Self {
|
||||||
Self::ContinueStory { input: args.input }
|
Self::ContinueStory {
|
||||||
}
|
input: args.input,
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl __sdk::InModule for ContinueStoryArgs {
|
impl __sdk::InModule for ContinueStoryArgs {
|
||||||
@@ -33,8 +40,9 @@ pub trait continue_story {
|
|||||||
/// The reducer will run asynchronously in the future,
|
/// The reducer will run asynchronously in the future,
|
||||||
/// and this method provides no way to listen for its completion status.
|
/// and this method provides no way to listen for its completion status.
|
||||||
/// /// Use [`continue_story:continue_story_then`] to run a callback after the reducer completes.
|
/// /// Use [`continue_story:continue_story_then`] to run a callback after the reducer completes.
|
||||||
fn continue_story(&self, input: StoryContinueInput) -> __sdk::Result<()> {
|
fn continue_story(&self, input: StoryContinueInput,
|
||||||
self.continue_story_then(input, |_, _| {})
|
) -> __sdk::Result<()> {
|
||||||
|
self.continue_story_then(input, |_, _| {})
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Request that the remote module invoke the reducer `continue_story` to run as soon as possible,
|
/// Request that the remote module invoke the reducer `continue_story` to run as soon as possible,
|
||||||
@@ -62,7 +70,7 @@ impl continue_story for super::RemoteReducers {
|
|||||||
+ Send
|
+ Send
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()> {
|
) -> __sdk::Result<()> {
|
||||||
self.imp
|
self.imp.invoke_reducer_with_callback(ContinueStoryArgs { input, }, callback)
|
||||||
.invoke_reducer_with_callback(ContinueStoryArgs { input }, callback)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,17 +2,23 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::ai_task_create_input_type::AiTaskCreateInput;
|
|
||||||
use super::ai_task_procedure_result_type::AiTaskProcedureResult;
|
use super::ai_task_procedure_result_type::AiTaskProcedureResult;
|
||||||
|
use super::ai_task_create_input_type::AiTaskCreateInput;
|
||||||
|
|
||||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
struct CreateAiTaskAndReturnArgs {
|
struct CreateAiTaskAndReturnArgs {
|
||||||
pub input: AiTaskCreateInput,
|
pub input: AiTaskCreateInput,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for CreateAiTaskAndReturnArgs {
|
impl __sdk::InModule for CreateAiTaskAndReturnArgs {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
@@ -22,19 +28,16 @@ impl __sdk::InModule for CreateAiTaskAndReturnArgs {
|
|||||||
///
|
///
|
||||||
/// Implemented for [`super::RemoteProcedures`].
|
/// Implemented for [`super::RemoteProcedures`].
|
||||||
pub trait create_ai_task_and_return {
|
pub trait create_ai_task_and_return {
|
||||||
fn create_ai_task_and_return(&self, input: AiTaskCreateInput) {
|
fn create_ai_task_and_return(&self, input: AiTaskCreateInput,
|
||||||
self.create_ai_task_and_return_then(input, |_, _| {});
|
) {
|
||||||
|
self.create_ai_task_and_return_then(input, |_, _| {});
|
||||||
}
|
}
|
||||||
|
|
||||||
fn create_ai_task_and_return_then(
|
fn create_ai_task_and_return_then(
|
||||||
&self,
|
&self,
|
||||||
input: AiTaskCreateInput,
|
input: AiTaskCreateInput,
|
||||||
|
|
||||||
__callback: impl FnOnce(
|
__callback: impl FnOnce(&super::ProcedureEventContext, Result<AiTaskProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||||
&super::ProcedureEventContext,
|
|
||||||
Result<AiTaskProcedureResult, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,17 +46,13 @@ impl create_ai_task_and_return for super::RemoteProcedures {
|
|||||||
&self,
|
&self,
|
||||||
input: AiTaskCreateInput,
|
input: AiTaskCreateInput,
|
||||||
|
|
||||||
__callback: impl FnOnce(
|
__callback: impl FnOnce(&super::ProcedureEventContext, Result<AiTaskProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||||
&super::ProcedureEventContext,
|
|
||||||
Result<AiTaskProcedureResult, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
|
||||||
) {
|
) {
|
||||||
self.imp
|
self.imp.invoke_procedure_with_callback::<_, AiTaskProcedureResult>(
|
||||||
.invoke_procedure_with_callback::<_, AiTaskProcedureResult>(
|
"create_ai_task_and_return",
|
||||||
"create_ai_task_and_return",
|
CreateAiTaskAndReturnArgs { input, },
|
||||||
CreateAiTaskAndReturnArgs { input },
|
__callback,
|
||||||
__callback,
|
);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::ai_task_create_input_type::AiTaskCreateInput;
|
use super::ai_task_create_input_type::AiTaskCreateInput;
|
||||||
|
|
||||||
@@ -14,8 +19,10 @@ pub(super) struct CreateAiTaskArgs {
|
|||||||
|
|
||||||
impl From<CreateAiTaskArgs> for super::Reducer {
|
impl From<CreateAiTaskArgs> for super::Reducer {
|
||||||
fn from(args: CreateAiTaskArgs) -> Self {
|
fn from(args: CreateAiTaskArgs) -> Self {
|
||||||
Self::CreateAiTask { input: args.input }
|
Self::CreateAiTask {
|
||||||
}
|
input: args.input,
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl __sdk::InModule for CreateAiTaskArgs {
|
impl __sdk::InModule for CreateAiTaskArgs {
|
||||||
@@ -33,8 +40,9 @@ pub trait create_ai_task {
|
|||||||
/// The reducer will run asynchronously in the future,
|
/// The reducer will run asynchronously in the future,
|
||||||
/// and this method provides no way to listen for its completion status.
|
/// and this method provides no way to listen for its completion status.
|
||||||
/// /// Use [`create_ai_task:create_ai_task_then`] to run a callback after the reducer completes.
|
/// /// Use [`create_ai_task:create_ai_task_then`] to run a callback after the reducer completes.
|
||||||
fn create_ai_task(&self, input: AiTaskCreateInput) -> __sdk::Result<()> {
|
fn create_ai_task(&self, input: AiTaskCreateInput,
|
||||||
self.create_ai_task_then(input, |_, _| {})
|
) -> __sdk::Result<()> {
|
||||||
|
self.create_ai_task_then(input, |_, _| {})
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Request that the remote module invoke the reducer `create_ai_task` to run as soon as possible,
|
/// Request that the remote module invoke the reducer `create_ai_task` to run as soon as possible,
|
||||||
@@ -62,7 +70,7 @@ impl create_ai_task for super::RemoteReducers {
|
|||||||
+ Send
|
+ Send
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()> {
|
) -> __sdk::Result<()> {
|
||||||
self.imp
|
self.imp.invoke_reducer_with_callback(CreateAiTaskArgs { input, }, callback)
|
||||||
.invoke_reducer_with_callback(CreateAiTaskArgs { input }, callback)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,17 +2,23 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::battle_state_input_type::BattleStateInput;
|
use super::battle_state_input_type::BattleStateInput;
|
||||||
use super::battle_state_procedure_result_type::BattleStateProcedureResult;
|
use super::battle_state_procedure_result_type::BattleStateProcedureResult;
|
||||||
|
|
||||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
struct CreateBattleStateAndReturnArgs {
|
struct CreateBattleStateAndReturnArgs {
|
||||||
pub input: BattleStateInput,
|
pub input: BattleStateInput,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for CreateBattleStateAndReturnArgs {
|
impl __sdk::InModule for CreateBattleStateAndReturnArgs {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
@@ -22,19 +28,16 @@ impl __sdk::InModule for CreateBattleStateAndReturnArgs {
|
|||||||
///
|
///
|
||||||
/// Implemented for [`super::RemoteProcedures`].
|
/// Implemented for [`super::RemoteProcedures`].
|
||||||
pub trait create_battle_state_and_return {
|
pub trait create_battle_state_and_return {
|
||||||
fn create_battle_state_and_return(&self, input: BattleStateInput) {
|
fn create_battle_state_and_return(&self, input: BattleStateInput,
|
||||||
self.create_battle_state_and_return_then(input, |_, _| {});
|
) {
|
||||||
|
self.create_battle_state_and_return_then(input, |_, _| {});
|
||||||
}
|
}
|
||||||
|
|
||||||
fn create_battle_state_and_return_then(
|
fn create_battle_state_and_return_then(
|
||||||
&self,
|
&self,
|
||||||
input: BattleStateInput,
|
input: BattleStateInput,
|
||||||
|
|
||||||
__callback: impl FnOnce(
|
__callback: impl FnOnce(&super::ProcedureEventContext, Result<BattleStateProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||||
&super::ProcedureEventContext,
|
|
||||||
Result<BattleStateProcedureResult, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,17 +46,13 @@ impl create_battle_state_and_return for super::RemoteProcedures {
|
|||||||
&self,
|
&self,
|
||||||
input: BattleStateInput,
|
input: BattleStateInput,
|
||||||
|
|
||||||
__callback: impl FnOnce(
|
__callback: impl FnOnce(&super::ProcedureEventContext, Result<BattleStateProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||||
&super::ProcedureEventContext,
|
|
||||||
Result<BattleStateProcedureResult, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
|
||||||
) {
|
) {
|
||||||
self.imp
|
self.imp.invoke_procedure_with_callback::<_, BattleStateProcedureResult>(
|
||||||
.invoke_procedure_with_callback::<_, BattleStateProcedureResult>(
|
"create_battle_state_and_return",
|
||||||
"create_battle_state_and_return",
|
CreateBattleStateAndReturnArgs { input, },
|
||||||
CreateBattleStateAndReturnArgs { input },
|
__callback,
|
||||||
__callback,
|
);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::battle_state_input_type::BattleStateInput;
|
use super::battle_state_input_type::BattleStateInput;
|
||||||
|
|
||||||
@@ -14,8 +19,10 @@ pub(super) struct CreateBattleStateArgs {
|
|||||||
|
|
||||||
impl From<CreateBattleStateArgs> for super::Reducer {
|
impl From<CreateBattleStateArgs> for super::Reducer {
|
||||||
fn from(args: CreateBattleStateArgs) -> Self {
|
fn from(args: CreateBattleStateArgs) -> Self {
|
||||||
Self::CreateBattleState { input: args.input }
|
Self::CreateBattleState {
|
||||||
}
|
input: args.input,
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl __sdk::InModule for CreateBattleStateArgs {
|
impl __sdk::InModule for CreateBattleStateArgs {
|
||||||
@@ -33,8 +40,9 @@ pub trait create_battle_state {
|
|||||||
/// The reducer will run asynchronously in the future,
|
/// The reducer will run asynchronously in the future,
|
||||||
/// and this method provides no way to listen for its completion status.
|
/// and this method provides no way to listen for its completion status.
|
||||||
/// /// Use [`create_battle_state:create_battle_state_then`] to run a callback after the reducer completes.
|
/// /// Use [`create_battle_state:create_battle_state_then`] to run a callback after the reducer completes.
|
||||||
fn create_battle_state(&self, input: BattleStateInput) -> __sdk::Result<()> {
|
fn create_battle_state(&self, input: BattleStateInput,
|
||||||
self.create_battle_state_then(input, |_, _| {})
|
) -> __sdk::Result<()> {
|
||||||
|
self.create_battle_state_then(input, |_, _| {})
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Request that the remote module invoke the reducer `create_battle_state` to run as soon as possible,
|
/// Request that the remote module invoke the reducer `create_battle_state` to run as soon as possible,
|
||||||
@@ -62,7 +70,7 @@ impl create_battle_state for super::RemoteReducers {
|
|||||||
+ Send
|
+ Send
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()> {
|
) -> __sdk::Result<()> {
|
||||||
self.imp
|
self.imp.invoke_reducer_with_callback(CreateBattleStateArgs { input, }, callback)
|
||||||
.invoke_reducer_with_callback(CreateBattleStateArgs { input }, callback)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,17 +2,23 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::custom_world_agent_session_create_input_type::CustomWorldAgentSessionCreateInput;
|
use super::custom_world_agent_session_create_input_type::CustomWorldAgentSessionCreateInput;
|
||||||
use super::custom_world_agent_session_procedure_result_type::CustomWorldAgentSessionProcedureResult;
|
use super::custom_world_agent_session_procedure_result_type::CustomWorldAgentSessionProcedureResult;
|
||||||
|
|
||||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
struct CreateCustomWorldAgentSessionArgs {
|
struct CreateCustomWorldAgentSessionArgs {
|
||||||
pub input: CustomWorldAgentSessionCreateInput,
|
pub input: CustomWorldAgentSessionCreateInput,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for CreateCustomWorldAgentSessionArgs {
|
impl __sdk::InModule for CreateCustomWorldAgentSessionArgs {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
@@ -22,19 +28,16 @@ impl __sdk::InModule for CreateCustomWorldAgentSessionArgs {
|
|||||||
///
|
///
|
||||||
/// Implemented for [`super::RemoteProcedures`].
|
/// Implemented for [`super::RemoteProcedures`].
|
||||||
pub trait create_custom_world_agent_session {
|
pub trait create_custom_world_agent_session {
|
||||||
fn create_custom_world_agent_session(&self, input: CustomWorldAgentSessionCreateInput) {
|
fn create_custom_world_agent_session(&self, input: CustomWorldAgentSessionCreateInput,
|
||||||
self.create_custom_world_agent_session_then(input, |_, _| {});
|
) {
|
||||||
|
self.create_custom_world_agent_session_then(input, |_, _| {});
|
||||||
}
|
}
|
||||||
|
|
||||||
fn create_custom_world_agent_session_then(
|
fn create_custom_world_agent_session_then(
|
||||||
&self,
|
&self,
|
||||||
input: CustomWorldAgentSessionCreateInput,
|
input: CustomWorldAgentSessionCreateInput,
|
||||||
|
|
||||||
__callback: impl FnOnce(
|
__callback: impl FnOnce(&super::ProcedureEventContext, Result<CustomWorldAgentSessionProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||||
&super::ProcedureEventContext,
|
|
||||||
Result<CustomWorldAgentSessionProcedureResult, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,17 +46,13 @@ impl create_custom_world_agent_session for super::RemoteProcedures {
|
|||||||
&self,
|
&self,
|
||||||
input: CustomWorldAgentSessionCreateInput,
|
input: CustomWorldAgentSessionCreateInput,
|
||||||
|
|
||||||
__callback: impl FnOnce(
|
__callback: impl FnOnce(&super::ProcedureEventContext, Result<CustomWorldAgentSessionProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||||
&super::ProcedureEventContext,
|
|
||||||
Result<CustomWorldAgentSessionProcedureResult, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
|
||||||
) {
|
) {
|
||||||
self.imp
|
self.imp.invoke_procedure_with_callback::<_, CustomWorldAgentSessionProcedureResult>(
|
||||||
.invoke_procedure_with_callback::<_, CustomWorldAgentSessionProcedureResult>(
|
"create_custom_world_agent_session",
|
||||||
"create_custom_world_agent_session",
|
CreateCustomWorldAgentSessionArgs { input, },
|
||||||
CreateCustomWorldAgentSessionArgs { input },
|
__callback,
|
||||||
__callback,
|
);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,10 +2,15 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::rpg_agent_message_kind_type::RpgAgentMessageKind;
|
|
||||||
use super::rpg_agent_message_role_type::RpgAgentMessageRole;
|
use super::rpg_agent_message_role_type::RpgAgentMessageRole;
|
||||||
|
use super::rpg_agent_message_kind_type::RpgAgentMessageKind;
|
||||||
|
|
||||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
@@ -15,10 +20,12 @@ pub struct CustomWorldAgentMessageSnapshot {
|
|||||||
pub role: RpgAgentMessageRole,
|
pub role: RpgAgentMessageRole,
|
||||||
pub kind: RpgAgentMessageKind,
|
pub kind: RpgAgentMessageKind,
|
||||||
pub text: String,
|
pub text: String,
|
||||||
pub related_operation_id: Option<String>,
|
pub related_operation_id: Option::<String>,
|
||||||
pub created_at_micros: i64,
|
pub created_at_micros: i64,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for CustomWorldAgentMessageSnapshot {
|
impl __sdk::InModule for CustomWorldAgentMessageSnapshot {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,13 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
@@ -15,6 +21,8 @@ pub struct CustomWorldAgentMessageSubmitInput {
|
|||||||
pub submitted_at_micros: i64,
|
pub submitted_at_micros: i64,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for CustomWorldAgentMessageSubmitInput {
|
impl __sdk::InModule for CustomWorldAgentMessageSubmitInput {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,10 +2,15 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
use super::custom_world_agent_message_type::CustomWorldAgentMessage;
|
use super::custom_world_agent_message_type::CustomWorldAgentMessage;
|
||||||
use super::rpg_agent_message_kind_type::RpgAgentMessageKind;
|
|
||||||
use super::rpg_agent_message_role_type::RpgAgentMessageRole;
|
use super::rpg_agent_message_role_type::RpgAgentMessageRole;
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use super::rpg_agent_message_kind_type::RpgAgentMessageKind;
|
||||||
|
|
||||||
/// Table handle for the table `custom_world_agent_message`.
|
/// Table handle for the table `custom_world_agent_message`.
|
||||||
///
|
///
|
||||||
@@ -33,9 +38,7 @@ pub trait CustomWorldAgentMessageTableAccess {
|
|||||||
impl CustomWorldAgentMessageTableAccess for super::RemoteTables {
|
impl CustomWorldAgentMessageTableAccess for super::RemoteTables {
|
||||||
fn custom_world_agent_message(&self) -> CustomWorldAgentMessageTableHandle<'_> {
|
fn custom_world_agent_message(&self) -> CustomWorldAgentMessageTableHandle<'_> {
|
||||||
CustomWorldAgentMessageTableHandle {
|
CustomWorldAgentMessageTableHandle {
|
||||||
imp: self
|
imp: self.imp.get_table::<CustomWorldAgentMessage>("custom_world_agent_message"),
|
||||||
.imp
|
|
||||||
.get_table::<CustomWorldAgentMessage>("custom_world_agent_message"),
|
|
||||||
ctx: std::marker::PhantomData,
|
ctx: std::marker::PhantomData,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -48,12 +51,8 @@ impl<'ctx> __sdk::Table for CustomWorldAgentMessageTableHandle<'ctx> {
|
|||||||
type Row = CustomWorldAgentMessage;
|
type Row = CustomWorldAgentMessage;
|
||||||
type EventContext = super::EventContext;
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
fn count(&self) -> u64 {
|
fn count(&self) -> u64 { self.imp.count() }
|
||||||
self.imp.count()
|
fn iter(&self) -> impl Iterator<Item = CustomWorldAgentMessage> + '_ { self.imp.iter() }
|
||||||
}
|
|
||||||
fn iter(&self) -> impl Iterator<Item = CustomWorldAgentMessage> + '_ {
|
|
||||||
self.imp.iter()
|
|
||||||
}
|
|
||||||
|
|
||||||
type InsertCallbackId = CustomWorldAgentMessageInsertCallbackId;
|
type InsertCallbackId = CustomWorldAgentMessageInsertCallbackId;
|
||||||
|
|
||||||
@@ -99,40 +98,40 @@ impl<'ctx> __sdk::TableWithPrimaryKey for CustomWorldAgentMessageTableHandle<'ct
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Access to the `message_id` unique index on the table `custom_world_agent_message`,
|
/// Access to the `message_id` unique index on the table `custom_world_agent_message`,
|
||||||
/// which allows point queries on the field of the same name
|
/// which allows point queries on the field of the same name
|
||||||
/// via the [`CustomWorldAgentMessageMessageIdUnique::find`] method.
|
/// via the [`CustomWorldAgentMessageMessageIdUnique::find`] method.
|
||||||
///
|
///
|
||||||
/// Users are encouraged not to explicitly reference this type,
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
/// but to directly chain method calls,
|
/// but to directly chain method calls,
|
||||||
/// like `ctx.db.custom_world_agent_message().message_id().find(...)`.
|
/// like `ctx.db.custom_world_agent_message().message_id().find(...)`.
|
||||||
pub struct CustomWorldAgentMessageMessageIdUnique<'ctx> {
|
pub struct CustomWorldAgentMessageMessageIdUnique<'ctx> {
|
||||||
imp: __sdk::UniqueConstraintHandle<CustomWorldAgentMessage, String>,
|
imp: __sdk::UniqueConstraintHandle<CustomWorldAgentMessage, String>,
|
||||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
}
|
|
||||||
|
|
||||||
impl<'ctx> CustomWorldAgentMessageTableHandle<'ctx> {
|
|
||||||
/// Get a handle on the `message_id` unique index on the table `custom_world_agent_message`.
|
|
||||||
pub fn message_id(&self) -> CustomWorldAgentMessageMessageIdUnique<'ctx> {
|
|
||||||
CustomWorldAgentMessageMessageIdUnique {
|
|
||||||
imp: self.imp.get_unique_constraint::<String>("message_id"),
|
|
||||||
phantom: std::marker::PhantomData,
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'ctx> CustomWorldAgentMessageMessageIdUnique<'ctx> {
|
impl<'ctx> CustomWorldAgentMessageTableHandle<'ctx> {
|
||||||
/// Find the subscribed row whose `message_id` column value is equal to `col_val`,
|
/// Get a handle on the `message_id` unique index on the table `custom_world_agent_message`.
|
||||||
/// if such a row is present in the client cache.
|
pub fn message_id(&self) -> CustomWorldAgentMessageMessageIdUnique<'ctx> {
|
||||||
pub fn find(&self, col_val: &String) -> Option<CustomWorldAgentMessage> {
|
CustomWorldAgentMessageMessageIdUnique {
|
||||||
self.imp.find(col_val)
|
imp: self.imp.get_unique_constraint::<String>("message_id"),
|
||||||
}
|
phantom: std::marker::PhantomData,
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> CustomWorldAgentMessageMessageIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `message_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<CustomWorldAgentMessage> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
let _table =
|
|
||||||
client_cache.get_or_make_table::<CustomWorldAgentMessage>("custom_world_agent_message");
|
let _table = client_cache.get_or_make_table::<CustomWorldAgentMessage>("custom_world_agent_message");
|
||||||
_table.add_unique_constraint::<String>("message_id", |row| &row.message_id);
|
_table.add_unique_constraint::<String>("message_id", |row| &row.message_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -141,24 +140,26 @@ pub(super) fn parse_table_update(
|
|||||||
raw_updates: __ws::v2::TableUpdate,
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
) -> __sdk::Result<__sdk::TableUpdate<CustomWorldAgentMessage>> {
|
) -> __sdk::Result<__sdk::TableUpdate<CustomWorldAgentMessage>> {
|
||||||
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
__sdk::InternalError::failed_parse("TableUpdate<CustomWorldAgentMessage>", "TableUpdate")
|
__sdk::InternalError::failed_parse(
|
||||||
.with_cause(e)
|
"TableUpdate<CustomWorldAgentMessage>",
|
||||||
.into()
|
"TableUpdate",
|
||||||
|
).with_cause(e).into()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(non_camel_case_types)]
|
#[allow(non_camel_case_types)]
|
||||||
/// Extension trait for query builder access to the table `CustomWorldAgentMessage`.
|
/// Extension trait for query builder access to the table `CustomWorldAgentMessage`.
|
||||||
///
|
///
|
||||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
pub trait custom_world_agent_messageQueryTableAccess {
|
pub trait custom_world_agent_messageQueryTableAccess {
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
/// Get a query builder for the table `CustomWorldAgentMessage`.
|
/// Get a query builder for the table `CustomWorldAgentMessage`.
|
||||||
fn custom_world_agent_message(&self) -> __sdk::__query_builder::Table<CustomWorldAgentMessage>;
|
fn custom_world_agent_message(&self) -> __sdk::__query_builder::Table<CustomWorldAgentMessage>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl custom_world_agent_messageQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn custom_world_agent_message(&self) -> __sdk::__query_builder::Table<CustomWorldAgentMessage> {
|
||||||
|
__sdk::__query_builder::Table::new("custom_world_agent_message")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl custom_world_agent_messageQueryTableAccess for __sdk::QueryTableAccessor {
|
|
||||||
fn custom_world_agent_message(&self) -> __sdk::__query_builder::Table<CustomWorldAgentMessage> {
|
|
||||||
__sdk::__query_builder::Table::new("custom_world_agent_message")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -2,10 +2,15 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::rpg_agent_message_kind_type::RpgAgentMessageKind;
|
|
||||||
use super::rpg_agent_message_role_type::RpgAgentMessageRole;
|
use super::rpg_agent_message_role_type::RpgAgentMessageRole;
|
||||||
|
use super::rpg_agent_message_kind_type::RpgAgentMessageKind;
|
||||||
|
|
||||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
@@ -15,14 +20,16 @@ pub struct CustomWorldAgentMessage {
|
|||||||
pub role: RpgAgentMessageRole,
|
pub role: RpgAgentMessageRole,
|
||||||
pub kind: RpgAgentMessageKind,
|
pub kind: RpgAgentMessageKind,
|
||||||
pub text: String,
|
pub text: String,
|
||||||
pub related_operation_id: Option<String>,
|
pub related_operation_id: Option::<String>,
|
||||||
pub created_at: __sdk::Timestamp,
|
pub created_at: __sdk::Timestamp,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for CustomWorldAgentMessage {
|
impl __sdk::InModule for CustomWorldAgentMessage {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Column accessor struct for the table `CustomWorldAgentMessage`.
|
/// Column accessor struct for the table `CustomWorldAgentMessage`.
|
||||||
///
|
///
|
||||||
/// Provides typed access to columns for query building.
|
/// Provides typed access to columns for query building.
|
||||||
@@ -32,7 +39,7 @@ pub struct CustomWorldAgentMessageCols {
|
|||||||
pub role: __sdk::__query_builder::Col<CustomWorldAgentMessage, RpgAgentMessageRole>,
|
pub role: __sdk::__query_builder::Col<CustomWorldAgentMessage, RpgAgentMessageRole>,
|
||||||
pub kind: __sdk::__query_builder::Col<CustomWorldAgentMessage, RpgAgentMessageKind>,
|
pub kind: __sdk::__query_builder::Col<CustomWorldAgentMessage, RpgAgentMessageKind>,
|
||||||
pub text: __sdk::__query_builder::Col<CustomWorldAgentMessage, String>,
|
pub text: __sdk::__query_builder::Col<CustomWorldAgentMessage, String>,
|
||||||
pub related_operation_id: __sdk::__query_builder::Col<CustomWorldAgentMessage, Option<String>>,
|
pub related_operation_id: __sdk::__query_builder::Col<CustomWorldAgentMessage, Option::<String>>,
|
||||||
pub created_at: __sdk::__query_builder::Col<CustomWorldAgentMessage, __sdk::Timestamp>,
|
pub created_at: __sdk::__query_builder::Col<CustomWorldAgentMessage, __sdk::Timestamp>,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,11 +52,9 @@ impl __sdk::__query_builder::HasCols for CustomWorldAgentMessage {
|
|||||||
role: __sdk::__query_builder::Col::new(table_name, "role"),
|
role: __sdk::__query_builder::Col::new(table_name, "role"),
|
||||||
kind: __sdk::__query_builder::Col::new(table_name, "kind"),
|
kind: __sdk::__query_builder::Col::new(table_name, "kind"),
|
||||||
text: __sdk::__query_builder::Col::new(table_name, "text"),
|
text: __sdk::__query_builder::Col::new(table_name, "text"),
|
||||||
related_operation_id: __sdk::__query_builder::Col::new(
|
related_operation_id: __sdk::__query_builder::Col::new(table_name, "related_operation_id"),
|
||||||
table_name,
|
|
||||||
"related_operation_id",
|
|
||||||
),
|
|
||||||
created_at: __sdk::__query_builder::Col::new(table_name, "created_at"),
|
created_at: __sdk::__query_builder::Col::new(table_name, "created_at"),
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -68,8 +73,10 @@ impl __sdk::__query_builder::HasIxCols for CustomWorldAgentMessage {
|
|||||||
CustomWorldAgentMessageIxCols {
|
CustomWorldAgentMessageIxCols {
|
||||||
message_id: __sdk::__query_builder::IxCol::new(table_name, "message_id"),
|
message_id: __sdk::__query_builder::IxCol::new(table_name, "message_id"),
|
||||||
session_id: __sdk::__query_builder::IxCol::new(table_name, "session_id"),
|
session_id: __sdk::__query_builder::IxCol::new(table_name, "session_id"),
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl __sdk::__query_builder::CanBeLookupTable for CustomWorldAgentMessage {}
|
impl __sdk::__query_builder::CanBeLookupTable for CustomWorldAgentMessage {}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,13 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
@@ -12,6 +18,8 @@ pub struct CustomWorldAgentOperationGetInput {
|
|||||||
pub operation_id: String,
|
pub operation_id: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for CustomWorldAgentOperationGetInput {
|
impl __sdk::InModule for CustomWorldAgentOperationGetInput {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
#![allow(unused, clippy::all)]
|
#![allow(unused, clippy::all)]
|
||||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
use spacetimedb_sdk::__codegen::{
|
||||||
|
self as __sdk,
|
||||||
|
__lib,
|
||||||
|
__sats,
|
||||||
|
__ws,
|
||||||
|
};
|
||||||
|
|
||||||
use super::custom_world_agent_operation_snapshot_type::CustomWorldAgentOperationSnapshot;
|
use super::custom_world_agent_operation_snapshot_type::CustomWorldAgentOperationSnapshot;
|
||||||
|
|
||||||
@@ -10,10 +15,12 @@ use super::custom_world_agent_operation_snapshot_type::CustomWorldAgentOperation
|
|||||||
#[sats(crate = __lib)]
|
#[sats(crate = __lib)]
|
||||||
pub struct CustomWorldAgentOperationProcedureResult {
|
pub struct CustomWorldAgentOperationProcedureResult {
|
||||||
pub ok: bool,
|
pub ok: bool,
|
||||||
pub operation: Option<CustomWorldAgentOperationSnapshot>,
|
pub operation: Option::<CustomWorldAgentOperationSnapshot>,
|
||||||
pub error_message: Option<String>,
|
pub error_message: Option::<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
impl __sdk::InModule for CustomWorldAgentOperationProcedureResult {
|
impl __sdk::InModule for CustomWorldAgentOperationProcedureResult {
|
||||||
type Module = super::RemoteModule;
|
type Module = super::RemoteModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user