diff --git a/backend-rewrite-tasklist/02_M3_RUNTIME_PROFILE.md b/backend-rewrite-tasklist/02_M3_RUNTIME_PROFILE.md index b5a9528c..7c15286a 100644 --- a/backend-rewrite-tasklist/02_M3_RUNTIME_PROFILE.md +++ b/backend-rewrite-tasklist/02_M3_RUNTIME_PROFILE.md @@ -2,27 +2,27 @@ ## 1. SpacetimeDB 运行时主表 -- [ ] 设计 `runtime_snapshot` +- [x] 设计 `runtime_snapshot` - [x] 设计 `runtime_setting` - [x] 设计 `profile_dashboard_state` - [x] 设计 `profile_wallet_ledger` - [x] 设计 `profile_played_world` -- [ ] 设计 `profile_save_archive` +- [x] 设计 `profile_save_archive` - [x] 设计 `user_browse_history` ## 2. 兼容快照策略 -- [ ] 设计“领域表真相 + 兼容聚合快照”策略 -- [ ] 设计 snapshot projection 刷新机制 -- [ ] 迁移当前 snapshot hydration / normalize 规则 -- [ ] 迁移当前 save archive 聚合逻辑 +- [x] 设计“领域表真相 + 兼容聚合快照”策略 +- [x] 设计 snapshot projection 刷新机制 +- [x] 迁移当前 snapshot hydration / normalize 规则 +- [x] 迁移当前 save archive 聚合逻辑 - [x] 迁移当前 browse history 去重与排序逻辑 ## 3. Axum facade -- [ ] 兼容 `GET /api/runtime/save/snapshot` -- [ ] 兼容 `PUT /api/runtime/save/snapshot` -- [ ] 兼容 `DELETE /api/runtime/save/snapshot` +- [x] 兼容 `GET /api/runtime/save/snapshot` +- [x] 兼容 `PUT /api/runtime/save/snapshot` +- [x] 兼容 `DELETE /api/runtime/save/snapshot` - [x] 兼容 `GET /api/runtime/settings` - [x] 兼容 `PUT /api/runtime/settings` - [x] 兼容 `GET /api/runtime/profile/dashboard` @@ -31,10 +31,10 @@ - [x] 兼容 `GET /api/profile/wallet-ledger` - [x] 兼容 `GET /api/runtime/profile/play-stats` - [x] 兼容 `GET /api/profile/play-stats` -- [ ] 兼容 `GET /api/runtime/profile/save-archives` -- [ ] 兼容 `GET /api/profile/save-archives` -- [ ] 兼容 `POST /api/runtime/profile/save-archives/:worldKey` -- [ ] 兼容 `POST /api/profile/save-archives/:worldKey` +- [x] 兼容 `GET /api/runtime/profile/save-archives` +- [x] 兼容 `GET /api/profile/save-archives` +- [x] 兼容 `POST /api/runtime/profile/save-archives/:worldKey` +- [x] 兼容 `POST /api/profile/save-archives/:worldKey` - [x] 兼容 `GET /api/runtime/profile/browse-history` - [x] 兼容 `POST /api/runtime/profile/browse-history` - [x] 兼容 `DELETE /api/runtime/profile/browse-history` @@ -45,8 +45,8 @@ ## 4. 阶段验收 - [ ] 登录用户可正常保存、读取、删除存档 -- [ ] 兼容路径与主路径返回一致 -- [ ] profile dashboard / browse history / save archive 行为一致 +- [x] 兼容路径与主路径返回一致 +- [x] profile dashboard / browse history / save archive 行为一致 - [ ] 前端当前恢复流程可在不改 UI 的前提下跑通 ## 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 读链。 - 详细设计见: - [../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) diff --git a/docs/technical/M3_RUNTIME_SNAPSHOT_SAVE_ARCHIVE_AXUM_SPACETIMEDB_DESIGN_2026-04-22.md b/docs/technical/M3_RUNTIME_SNAPSHOT_SAVE_ARCHIVE_AXUM_SPACETIMEDB_DESIGN_2026-04-22.md new file mode 100644 index 00000000..d17c3ac7 --- /dev/null +++ b/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` | 原始 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` | 当前先冻结为 `None` | +| `profile_id` | `Option` | 自定义世界 profile ID | +| `world_type` | `Option` | 世界类型 | +| `world_name` | `String` | 存档展示名 | +| `subtitle` | `String` | 副标题 | +| `summary_text` | `String` | 摘要 | +| `cover_image_src` | `Option` | 封面 | +| `saved_at` | `Timestamp` | 最近一次保存时间 | +| `bottom_tab` | `String` | 存档时所在 tab | +| `game_state_json` | `String` | 最近一次存档快照 JSON | +| `current_story_json` | `Option` | 最近一次剧情 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` 三组行为可并存,不互相覆盖 diff --git a/server-rs/Cargo.lock b/server-rs/Cargo.lock index 1528fb93..cc989914 100644 --- a/server-rs/Cargo.lock +++ b/server-rs/Cargo.lock @@ -1485,6 +1485,7 @@ name = "module-runtime" version = "0.1.0" dependencies = [ "serde", + "serde_json", "shared-kernel", "spacetimedb", "time", @@ -2515,6 +2516,7 @@ dependencies = [ "module-runtime", "module-runtime-item", "module-story", + "serde_json", "spacetimedb", ] diff --git a/server-rs/crates/api-server/src/app.rs b/server-rs/crates/api-server/src/app.rs index 3c177a0f..658d34a8 100644 --- a/server-rs/crates/api-server/src/app.rs +++ b/server-rs/crates/api-server/src/app.rs @@ -49,6 +49,10 @@ use crate::{ }, runtime_inventory::get_runtime_inventory_state, 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_story::resolve_runtime_story_state, state::AppState, @@ -227,6 +231,16 @@ pub fn build_router(state: AppState) -> Router { "/api/runtime/settings", get(get_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( state.clone(), require_bearer_auth, @@ -366,6 +380,34 @@ pub fn build_router(state: AppState) -> Router { 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( "/api/runtime/sessions/{runtime_session_id}/inventory", get(get_runtime_inventory_state).route_layer(middleware::from_fn_with_state( diff --git a/server-rs/crates/api-server/src/main.rs b/server-rs/crates/api-server/src/main.rs index ff9b336f..2979773f 100644 --- a/server-rs/crates/api-server/src/main.rs +++ b/server-rs/crates/api-server/src/main.rs @@ -23,6 +23,7 @@ mod response_headers; mod runtime_browse_history; mod runtime_inventory; mod runtime_profile; +mod runtime_save; mod runtime_settings; mod runtime_story; mod session_client; diff --git a/server-rs/crates/api-server/src/runtime_save.rs b/server-rs/crates/api-server/src/runtime_save.rs new file mode 100644 index 00000000..505aa4b8 --- /dev/null +++ b/server-rs/crates/api-server/src/runtime_save.rs @@ -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, + Extension(request_context): Extension, + Extension(authenticated): Extension, +) -> Result, 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, + Extension(request_context): Extension, + Extension(authenticated): Extension, + Json(payload): Json, +) -> Result, 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, + Extension(request_context): Extension, + Extension(authenticated): Extension, +) -> Result, 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, + Extension(request_context): Extension, + Extension(authenticated): Extension, +) -> Result, 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, + Extension(request_context): Extension, + Extension(authenticated): Extension, + Path(path): Path, +) -> Result, 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") + } +} diff --git a/server-rs/crates/module-runtime/Cargo.toml b/server-rs/crates/module-runtime/Cargo.toml index 5f3c5ac0..8e69e4ca 100644 --- a/server-rs/crates/module-runtime/Cargo.toml +++ b/server-rs/crates/module-runtime/Cargo.toml @@ -10,6 +10,7 @@ spacetime-types = ["dep:spacetimedb"] [dependencies] serde = { version = "1", features = ["derive"] } +serde_json = "1" shared-kernel = { path = "../shared-kernel" } spacetimedb = { workspace = true, optional = true } time = { version = "0.3", features = ["formatting", "parsing"] } diff --git a/server-rs/crates/module-runtime/src/lib.rs b/server-rs/crates/module-runtime/src/lib.rs index 6ceac34a..7fcae203 100644 --- a/server-rs/crates/module-runtime/src/lib.rs +++ b/server-rs/crates/module-runtime/src/lib.rs @@ -1,6 +1,7 @@ use std::collections::HashSet; use serde::{Deserialize, Serialize}; +use serde_json::Value; use shared_kernel::{ format_rfc3339 as format_shared_rfc3339, normalize_optional_string, normalize_required_string, 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 MAX_BROWSE_HISTORY_BATCH_SIZE: usize = 100; 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 两种主题,避免各层散落字符串字面量。 #[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))] @@ -29,6 +32,94 @@ pub struct RuntimeSettings { 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, + 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, + pub error_message: Option, +} + +#[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, + 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, + pub profile_id: Option, + pub world_type: Option, + pub world_name: String, + pub subtitle: String, + pub summary_text: String, + pub cover_image_src: Option, + pub saved_at_micros: i64, + pub bottom_tab: String, + pub game_state_json: String, + pub current_story_json: Option, + 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, + pub record: Option, + pub current_snapshot: Option, + pub error_message: Option, +} + +#[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。 #[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))] #[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)] @@ -242,6 +333,10 @@ pub enum RuntimeBrowseHistoryFieldError { #[derive(Clone, Debug, PartialEq, Eq)] pub enum RuntimeProfileFieldError { MissingUserId, + MissingWorldKey, + MissingBottomTab, + InvalidGameStateJson, + InvalidCurrentStoryJson, } #[derive(Clone, Debug, PartialEq)] @@ -444,6 +539,44 @@ pub struct RuntimeProfilePlayStatsRecord { pub updated_at_micros: Option, } +#[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, + pub game_state_json: String, + pub current_story_json: Option, + 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, + pub profile_id: Option, + pub world_type: Option, + pub world_name: String, + pub subtitle: String, + pub summary_text: String, + pub cover_image_src: Option, + pub saved_at: String, + pub saved_at_micros: i64, + pub bottom_tab: String, + pub game_state: Value, + pub current_story: Option, + pub game_state_json: String, + pub current_story_json: Option, + pub created_at_micros: i64, + pub updated_at_micros: i64, +} + pub fn build_runtime_browse_history_list_input( user_id: String, ) -> Result { @@ -472,6 +605,37 @@ pub fn build_runtime_profile_play_stats_get_input( Ok(RuntimeProfilePlayStatsGetInput { user_id }) } +pub fn build_runtime_snapshot_get_input( + user_id: String, +) -> Result { + 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 { + 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 { + 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 { + 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( user_id: String, ) -> Result { @@ -479,6 +643,31 @@ pub fn build_runtime_browse_history_clear_input( 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, + updated_at_micros: i64, +) -> Result { + 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( user_id: String, entries: Vec, @@ -669,6 +858,64 @@ pub fn build_runtime_profile_play_stats_record( } } +pub fn build_runtime_snapshot_record( + snapshot: RuntimeSnapshot, +) -> Result { + let game_state = serde_json::from_str::(&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 { + let game_state = serde_json::from_str::(&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( user_id: &str, owner_user_id: &str, @@ -693,6 +940,43 @@ fn parse_utc_rfc3339_to_micros(value: &str) -> Option { i64::try_from(nanos / 1_000).ok() } +fn normalize_bottom_tab(value: String) -> Option { + 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, +) -> Result, 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, RuntimeProfileFieldError> { + match raw.map(str::trim).filter(|value| !value.is_empty()) { + Some(value) => serde_json::from_str::(value) + .map(Some) + .map_err(|_| error), + None => Ok(None), + } +} + impl std::fmt::Display for RuntimeSettingsFieldError { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { @@ -726,6 +1010,12 @@ impl std::fmt::Display for RuntimeProfileFieldError { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { 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") + } } } } diff --git a/server-rs/crates/shared-contracts/src/runtime.rs b/server-rs/crates/shared-contracts/src/runtime.rs index 06fd4934..87a02abf 100644 --- a/server-rs/crates/shared-contracts/src/runtime.rs +++ b/server-rs/crates/shared-contracts/src/runtime.rs @@ -2,6 +2,7 @@ use serde::{Deserialize, Serialize}; pub const RUNTIME_PLATFORM_THEME_LIGHT: &str = "light"; 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 BROWSE_HISTORY_THEME_MODE_MARTIAL: &str = "martial"; pub const BROWSE_HISTORY_THEME_MODE_ARCANE: &str = "arcane"; @@ -26,6 +27,33 @@ pub struct PutRuntimeSettingsRequest { 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, +} + +#[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(default)] + pub saved_at: Option, +} + +#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] +#[serde(rename_all = "camelCase")] +pub struct BasicOkResponse { + pub ok: bool, +} + #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] #[serde(rename_all = "camelCase")] pub struct PlatformBrowseHistoryEntryResponse { @@ -135,6 +163,33 @@ pub struct ProfilePlayStatsResponse { pub updated_at: Option, } +#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] +#[serde(rename_all = "camelCase")] +pub struct ProfileSaveArchiveSummaryResponse { + pub world_key: String, + pub owner_user_id: Option, + pub profile_id: Option, + pub world_type: Option, + pub world_name: String, + pub subtitle: String, + pub summary_text: String, + pub cover_image_src: Option, + pub last_played_at: String, +} + +#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] +#[serde(rename_all = "camelCase")] +pub struct ProfileSaveArchiveListResponse { + pub entries: Vec, +} + +#[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)] #[serde(rename_all = "camelCase")] pub struct RuntimeInventorySlotResponse { @@ -234,6 +289,43 @@ pub struct CustomWorldGalleryDetailResponse { 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, + #[serde(default)] + pub cover_render_mode: Option, + #[serde(default)] + pub cover_character_image_srcs: Vec, + pub updated_at: String, + pub published_at: Option, + pub stage: Option, + pub stage_label: Option, + pub playable_npc_count: u32, + pub landmark_count: u32, + pub role_visual_ready_count: Option, + pub role_animation_ready_count: Option, + pub role_asset_summary_label: Option, + pub session_id: Option, + pub profile_id: Option, + 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, +} + #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] #[serde(rename_all = "camelCase")] pub struct CreateCustomWorldAgentSessionRequest { @@ -293,6 +385,36 @@ pub struct CustomWorldDraftCardSummaryResponse { pub asset_status_label: Option, } +#[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, + pub linked_ids: Vec, + pub locked: bool, + pub editable: bool, + pub editable_section_ids: Vec, + pub warning_messages: Vec, + pub asset_status: Option, + pub asset_status_label: Option, +} + +#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] +#[serde(rename_all = "camelCase")] +pub struct CustomWorldAgentCardDetailResponse { + pub card: CustomWorldDraftCardDetailResponse, +} + #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] #[serde(rename_all = "camelCase")] pub struct CustomWorldAgentCheckpointResponse { @@ -309,6 +431,24 @@ pub struct CustomWorldSupportedActionResponse { pub reason: Option, } +#[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, + pub blocker_count: u32, + pub publish_ready: bool, + pub can_enter_world: bool, +} + #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] #[serde(rename_all = "camelCase")] pub struct CustomWorldAgentSessionSnapshotResponse { @@ -333,6 +473,7 @@ pub struct CustomWorldAgentSessionSnapshotResponse { pub asset_coverage: serde_json::Value, pub checkpoints: Vec, pub supported_actions: Vec, + pub publish_gate: Option, pub result_preview: Option, pub updated_at: String, } @@ -343,6 +484,67 @@ pub struct CustomWorldAgentSessionResponse { 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, + #[serde(default)] + pub draft_profile: Option, + #[serde(default)] + pub legacy_result_profile: Option, + #[serde(default)] + pub setting_text: Option, + #[serde(default)] + pub card_id: Option, + #[serde(default)] + pub sections: Option>, + #[serde(default)] + pub profile: Option, + #[serde(default)] + pub count: Option, + #[serde(default)] + pub prompt_text: Option, + #[serde(default)] + pub anchor_card_ids: Option>, + #[serde(default)] + pub role_ids: Option>, + #[serde(default)] + pub role_id: Option, + #[serde(default)] + pub portrait_path: Option, + #[serde(default)] + pub generated_visual_asset_id: Option, + #[serde(default)] + pub generated_animation_set_id: Option, + #[serde(default)] + pub animation_map: Option, + #[serde(default)] + pub scene_ids: Option>, + #[serde(default)] + pub scene_id: Option, + #[serde(default)] + pub scene_kind: Option, + #[serde(default)] + pub image_src: Option, + #[serde(default)] + pub generated_scene_asset_id: Option, + #[serde(default)] + pub generated_scene_prompt: Option, + #[serde(default)] + pub generated_scene_model: Option, + #[serde(default)] + pub checkpoint_id: Option, +} + +#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] +#[serde(rename_all = "camelCase")] +pub struct ExecuteCustomWorldAgentDraftCardSectionPatch { + pub section_id: String, + pub value: String, +} + #[cfg(test)] mod tests { use super::*; diff --git a/server-rs/crates/shared-kernel/src/lib.rs b/server-rs/crates/shared-kernel/src/lib.rs index ad773b9c..ba9d6725 100644 --- a/server-rs/crates/shared-kernel/src/lib.rs +++ b/server-rs/crates/shared-kernel/src/lib.rs @@ -65,6 +65,11 @@ pub fn format_timestamp_micros(micros: i64) -> String { 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 字符串,避免每个模块自己拼格式化错误文案。 pub fn format_rfc3339(value: OffsetDateTime) -> Result { 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] fn format_and_parse_rfc3339_round_trip() { let now = OffsetDateTime::UNIX_EPOCH + time::Duration::seconds(1_713_686_400); diff --git a/server-rs/crates/spacetime-client/src/lib.rs b/server-rs/crates/spacetime-client/src/lib.rs index 3d51cf2c..deb2076e 100644 --- a/server-rs/crates/spacetime-client/src/lib.rs +++ b/server-rs/crates/spacetime-client/src/lib.rs @@ -49,14 +49,19 @@ use module_npc::{ use module_runtime::{ RuntimeBrowseHistoryRecord, RuntimeBrowseHistoryThemeMode, RuntimePlatformTheme, RuntimeProfileDashboardRecord, RuntimeProfilePlayStatsRecord, + RuntimeProfileSaveArchiveRecord, 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_sync_input, build_runtime_profile_dashboard_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_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::{ RuntimeItemEquipmentSlot as DomainRuntimeItemEquipmentSlot, @@ -160,6 +165,10 @@ use crate::module_bindings::{ RuntimeProfileDashboardGetInput as BindingRuntimeProfileDashboardGetInput, RuntimeProfileDashboardProcedureResult as BindingRuntimeProfileDashboardProcedureResult, RuntimeProfileDashboardSnapshot as BindingRuntimeProfileDashboardSnapshot, + RuntimeProfileSaveArchiveListInput as BindingRuntimeProfileSaveArchiveListInput, + RuntimeProfileSaveArchiveProcedureResult as BindingRuntimeProfileSaveArchiveProcedureResult, + RuntimeProfileSaveArchiveResumeInput as BindingRuntimeProfileSaveArchiveResumeInput, + RuntimeProfileSaveArchiveSnapshot as BindingRuntimeProfileSaveArchiveSnapshot, RuntimeProfilePlayStatsGetInput as BindingRuntimeProfilePlayStatsGetInput, RuntimeProfilePlayStatsProcedureResult as BindingRuntimeProfilePlayStatsProcedureResult, RuntimeProfilePlayStatsSnapshot as BindingRuntimeProfilePlayStatsSnapshot, @@ -172,6 +181,11 @@ use crate::module_bindings::{ RuntimeSettingProcedureResult as BindingRuntimeSettingProcedureResult, RuntimeSettingSnapshot as BindingRuntimeSettingSnapshot, RuntimeSettingUpsertInput as BindingRuntimeSettingUpsertInput, + RuntimeSnapshotDeleteInput as BindingRuntimeSnapshotDeleteInput, + RuntimeSnapshotGetInput as BindingRuntimeSnapshotGetInput, + RuntimeSnapshotProcedureResult as BindingRuntimeSnapshotProcedureResult, + RuntimeSnapshot as BindingRuntimeSnapshot, + RuntimeSnapshotUpsertInput as BindingRuntimeSnapshotUpsertInput, StoryContinueInput as BindingStoryContinueInput, StoryEventKind as BindingStoryEventKind, StoryEventSnapshot as BindingStoryEventSnapshot, StorySessionInput as BindingStorySessionInput, StorySessionProcedureResult as BindingStorySessionProcedureResult, @@ -192,6 +206,7 @@ use crate::module_bindings::{ 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_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 _, get_battle_state_procedure::get_battle_state 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_runtime_inventory_state_procedure::get_runtime_inventory_state 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 _, list_custom_world_gallery_entries_procedure::list_custom_world_gallery_entries as _, list_custom_world_profiles_procedure::list_custom_world_profiles 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 _, publish_custom_world_profile_and_return_procedure::publish_custom_world_profile_and_return as _, publish_custom_world_world_procedure::publish_custom_world_world 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 _, + 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_stage_reducer::start_ai_task_stage 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_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_snapshot_and_return_procedure::upsert_runtime_snapshot_and_return as _, }; #[derive(Clone, Debug)] @@ -888,6 +907,136 @@ impl SpacetimeClient { .await } + pub async fn get_runtime_snapshot( + &self, + user_id: String, + ) -> Result, 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, + updated_at_micros: i64, + ) -> Result { + 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 { + 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, 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( &self, 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 { BindingAiTaskCreateInput { 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, 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 { + 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 { + map_runtime_snapshot_procedure_result(result).map(|record| record.is_some()) +} + +fn map_runtime_profile_save_archive_list_procedure_result( + result: BindingRuntimeProfileSaveArchiveProcedureResult, +) -> Result, 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( result: BindingAiTaskProcedureResult, ) -> Result { @@ -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( snapshot: BindingCustomWorldProfileSnapshot, ) -> Result { diff --git a/server-rs/crates/spacetime-client/src/module_bindings/accept_quest_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/accept_quest_reducer.rs index dfebf903..b9e670d6 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/accept_quest_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/accept_quest_reducer.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -14,8 +19,10 @@ pub(super) struct AcceptQuestArgs { impl From for super::Reducer { fn from(args: AcceptQuestArgs) -> Self { - Self::AcceptQuest { input: args.input } - } + Self::AcceptQuest { + input: args.input, +} +} } impl __sdk::InModule for AcceptQuestArgs { @@ -33,8 +40,9 @@ pub trait accept_quest { /// The reducer will run asynchronously in the future, /// 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. - fn accept_quest(&self, input: QuestRecordInput) -> __sdk::Result<()> { - self.accept_quest_then(input, |_, _| {}) + fn accept_quest(&self, input: QuestRecordInput, +) -> __sdk::Result<()> { + self.accept_quest_then(input, |_, _| {}) } /// 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 + 'static, ) -> __sdk::Result<()> { - self.imp - .invoke_reducer_with_callback(AcceptQuestArgs { input }, callback) + self.imp.invoke_reducer_with_callback(AcceptQuestArgs { input, }, callback) } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/acknowledge_quest_completion_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/acknowledge_quest_completion_reducer.rs index 6ae2fd10..6027c9f6 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/acknowledge_quest_completion_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/acknowledge_quest_completion_reducer.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -14,8 +19,10 @@ pub(super) struct AcknowledgeQuestCompletionArgs { impl From for super::Reducer { fn from(args: AcknowledgeQuestCompletionArgs) -> Self { - Self::AcknowledgeQuestCompletion { input: args.input } - } + Self::AcknowledgeQuestCompletion { + input: args.input, +} +} } impl __sdk::InModule for AcknowledgeQuestCompletionArgs { @@ -33,8 +40,9 @@ pub trait acknowledge_quest_completion { /// The reducer will run asynchronously in the future, /// 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. - fn acknowledge_quest_completion(&self, input: QuestCompletionAckInput) -> __sdk::Result<()> { - self.acknowledge_quest_completion_then(input, |_, _| {}) + fn acknowledge_quest_completion(&self, input: QuestCompletionAckInput, +) -> __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, @@ -62,7 +70,7 @@ impl acknowledge_quest_completion for super::RemoteReducers { + Send + 'static, ) -> __sdk::Result<()> { - self.imp - .invoke_reducer_with_callback(AcknowledgeQuestCompletionArgs { input }, callback) + self.imp.invoke_reducer_with_callback(AcknowledgeQuestCompletionArgs { input, }, callback) } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/ai_result_reference_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/ai_result_reference_input_type.rs index b63aad41..c22d39dd 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/ai_result_reference_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/ai_result_reference_input_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -12,10 +17,12 @@ pub struct AiResultReferenceInput { pub task_id: String, pub reference_kind: AiResultReferenceKind, pub reference_id: String, - pub label: Option, + pub label: Option::, pub created_at_micros: i64, } + impl __sdk::InModule for AiResultReferenceInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/ai_result_reference_kind_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/ai_result_reference_kind_type.rs index 0e5f045b..9b9a5a43 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/ai_result_reference_kind_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/ai_result_reference_kind_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -19,8 +24,12 @@ pub enum AiResultReferenceKind { RuntimeItemRecord, AssetObject, + } + + impl __sdk::InModule for AiResultReferenceKind { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/ai_result_reference_snapshot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/ai_result_reference_snapshot_type.rs index f949db7f..7522ac4c 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/ai_result_reference_snapshot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/ai_result_reference_snapshot_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -13,10 +18,12 @@ pub struct AiResultReferenceSnapshot { pub task_id: String, pub reference_kind: AiResultReferenceKind, pub reference_id: String, - pub label: Option, + pub label: Option::, pub created_at_micros: i64, } + impl __sdk::InModule for AiResultReferenceSnapshot { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/ai_result_reference_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/ai_result_reference_table.rs index 09b7c492..6a648b5b 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/ai_result_reference_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/ai_result_reference_table.rs @@ -2,9 +2,14 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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 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`. /// @@ -32,9 +37,7 @@ pub trait AiResultReferenceTableAccess { impl AiResultReferenceTableAccess for super::RemoteTables { fn ai_result_reference(&self) -> AiResultReferenceTableHandle<'_> { AiResultReferenceTableHandle { - imp: self - .imp - .get_table::("ai_result_reference"), + imp: self.imp.get_table::("ai_result_reference"), ctx: std::marker::PhantomData, } } @@ -47,12 +50,8 @@ impl<'ctx> __sdk::Table for AiResultReferenceTableHandle<'ctx> { type Row = AiResultReference; type EventContext = super::EventContext; - fn count(&self) -> u64 { - self.imp.count() - } - fn iter(&self) -> impl Iterator + '_ { - self.imp.iter() - } + fn count(&self) -> u64 { self.imp.count() } + fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } 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`, -/// which allows point queries on the field of the same name -/// via the [`AiResultReferenceResultReferenceRowIdUnique::find`] method. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.ai_result_reference().result_reference_row_id().find(...)`. -pub struct AiResultReferenceResultReferenceRowIdUnique<'ctx> { - imp: __sdk::UniqueConstraintHandle, - 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::("result_reference_row_id"), - phantom: std::marker::PhantomData, + /// 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 + /// via the [`AiResultReferenceResultReferenceRowIdUnique::find`] method. + /// + /// Users are encouraged not to explicitly reference this type, + /// but to directly chain method calls, + /// like `ctx.db.ai_result_reference().result_reference_row_id().find(...)`. + pub struct AiResultReferenceResultReferenceRowIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } - } -} -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 { - self.imp.find(col_val) - } -} + 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::("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 { + self.imp.find(col_val) + } + } + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("ai_result_reference"); - _table.add_unique_constraint::("result_reference_row_id", |row| { - &row.result_reference_row_id - }); + _table.add_unique_constraint::("result_reference_row_id", |row| &row.result_reference_row_id); } #[doc(hidden)] @@ -143,24 +139,26 @@ pub(super) fn parse_table_update( raw_updates: __ws::v2::TableUpdate, ) -> __sdk::Result<__sdk::TableUpdate> { __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { - __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") - .with_cause(e) - .into() + __sdk::InternalError::failed_parse( + "TableUpdate", + "TableUpdate", + ).with_cause(e).into() }) } -#[allow(non_camel_case_types)] -/// Extension trait for query builder access to the table `AiResultReference`. -/// -/// Implemented for [`__sdk::QueryTableAccessor`]. -pub trait ai_result_referenceQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `AiResultReference`. - fn ai_result_reference(&self) -> __sdk::__query_builder::Table; -} + #[allow(non_camel_case_types)] + /// Extension trait for query builder access to the table `AiResultReference`. + /// + /// Implemented for [`__sdk::QueryTableAccessor`]. + pub trait ai_result_referenceQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `AiResultReference`. + fn ai_result_reference(&self) -> __sdk::__query_builder::Table; + } + + impl ai_result_referenceQueryTableAccess for __sdk::QueryTableAccessor { + fn ai_result_reference(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("ai_result_reference") + } + } -impl ai_result_referenceQueryTableAccess for __sdk::QueryTableAccessor { - fn ai_result_reference(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("ai_result_reference") - } -} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/ai_result_reference_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/ai_result_reference_type.rs index 3b1121b0..d9e32eaf 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/ai_result_reference_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/ai_result_reference_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -14,14 +19,16 @@ pub struct AiResultReference { pub task_id: String, pub reference_kind: AiResultReferenceKind, pub reference_id: String, - pub label: Option, + pub label: Option::, pub created_at: __sdk::Timestamp, } + impl __sdk::InModule for AiResultReference { type Module = super::RemoteModule; } + /// Column accessor struct for the table `AiResultReference`. /// /// Provides typed access to columns for query building. @@ -31,7 +38,7 @@ pub struct AiResultReferenceCols { pub task_id: __sdk::__query_builder::Col, pub reference_kind: __sdk::__query_builder::Col, pub reference_id: __sdk::__query_builder::Col, - pub label: __sdk::__query_builder::Col>, + pub label: __sdk::__query_builder::Col>, pub created_at: __sdk::__query_builder::Col, } @@ -39,16 +46,14 @@ impl __sdk::__query_builder::HasCols for AiResultReference { type Cols = AiResultReferenceCols; fn cols(table_name: &'static str) -> Self::Cols { AiResultReferenceCols { - result_reference_row_id: __sdk::__query_builder::Col::new( - table_name, - "result_reference_row_id", - ), + result_reference_row_id: __sdk::__query_builder::Col::new(table_name, "result_reference_row_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"), reference_kind: __sdk::__query_builder::Col::new(table_name, "reference_kind"), reference_id: __sdk::__query_builder::Col::new(table_name, "reference_id"), label: __sdk::__query_builder::Col::new(table_name, "label"), 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; fn ix_cols(table_name: &'static str) -> Self::IxCols { AiResultReferenceIxCols { - result_reference_row_id: __sdk::__query_builder::IxCol::new( - table_name, - "result_reference_row_id", - ), + result_reference_row_id: __sdk::__query_builder::IxCol::new(table_name, "result_reference_row_id"), task_id: __sdk::__query_builder::IxCol::new(table_name, "task_id"), + } } } impl __sdk::__query_builder::CanBeLookupTable for AiResultReference {} + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/ai_stage_completion_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/ai_stage_completion_input_type.rs index 7ce33006..c165fc55 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/ai_stage_completion_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/ai_stage_completion_input_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -11,12 +16,14 @@ use super::ai_task_stage_kind_type::AiTaskStageKind; pub struct AiStageCompletionInput { pub task_id: String, pub stage_kind: AiTaskStageKind, - pub text_output: Option, - pub structured_payload_json: Option, - pub warning_messages: Vec, + pub text_output: Option::, + pub structured_payload_json: Option::, + pub warning_messages: Vec::, pub completed_at_micros: i64, } + impl __sdk::InModule for AiStageCompletionInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/ai_task_cancel_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/ai_task_cancel_input_type.rs index 93b697a6..1c5af5fa 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/ai_task_cancel_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/ai_task_cancel_input_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -11,6 +17,8 @@ pub struct AiTaskCancelInput { pub completed_at_micros: i64, } + impl __sdk::InModule for AiTaskCancelInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/ai_task_create_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/ai_task_create_input_type.rs index 95b0506a..2d53ad93 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/ai_task_create_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/ai_task_create_input_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_stage_blueprint_type::AiTaskStageBlueprint; @@ -15,12 +20,14 @@ pub struct AiTaskCreateInput { pub owner_user_id: String, pub request_label: String, pub source_module: String, - pub source_entity_id: Option, - pub request_payload_json: Option, - pub stages: Vec, + pub source_entity_id: Option::, + pub request_payload_json: Option::, + pub stages: Vec::, pub created_at_micros: i64, } + impl __sdk::InModule for AiTaskCreateInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/ai_task_failure_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/ai_task_failure_input_type.rs index 91a87cf5..dfdd6ee6 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/ai_task_failure_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/ai_task_failure_input_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -12,6 +18,8 @@ pub struct AiTaskFailureInput { pub completed_at_micros: i64, } + impl __sdk::InModule for AiTaskFailureInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/ai_task_finish_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/ai_task_finish_input_type.rs index d8fe6713..f7bc9735 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/ai_task_finish_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/ai_task_finish_input_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -11,6 +17,8 @@ pub struct AiTaskFinishInput { pub completed_at_micros: i64, } + impl __sdk::InModule for AiTaskFinishInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/ai_task_kind_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/ai_task_kind_type.rs index 9468bc95..7724e312 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/ai_task_kind_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/ai_task_kind_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -19,8 +24,12 @@ pub enum AiTaskKind { QuestIntent, RuntimeItemIntent, + } + + impl __sdk::InModule for AiTaskKind { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/ai_task_procedure_result_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/ai_task_procedure_result_type.rs index 57728f6e..f0457945 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/ai_task_procedure_result_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/ai_task_procedure_result_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_text_chunk_snapshot_type::AiTextChunkSnapshot; @@ -11,11 +16,13 @@ use super::ai_text_chunk_snapshot_type::AiTextChunkSnapshot; #[sats(crate = __lib)] pub struct AiTaskProcedureResult { pub ok: bool, - pub task: Option, - pub text_chunk: Option, - pub error_message: Option, + pub task: Option::, + pub text_chunk: Option::, + pub error_message: Option::, } + impl __sdk::InModule for AiTaskProcedureResult { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/ai_task_snapshot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/ai_task_snapshot_type.rs index 66fa9a15..c0259393 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/ai_task_snapshot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/ai_task_snapshot_type.rs @@ -2,12 +2,17 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_stage_snapshot_type::AiTaskStageSnapshot; 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)] #[sats(crate = __lib)] @@ -17,21 +22,23 @@ pub struct AiTaskSnapshot { pub owner_user_id: String, pub request_label: String, pub source_module: String, - pub source_entity_id: Option, - pub request_payload_json: Option, + pub source_entity_id: Option::, + pub request_payload_json: Option::, pub status: AiTaskStatus, - pub failure_message: Option, - pub stages: Vec, - pub result_references: Vec, - pub latest_text_output: Option, - pub latest_structured_payload_json: Option, + pub failure_message: Option::, + pub stages: Vec::, + pub result_references: Vec::, + pub latest_text_output: Option::, + pub latest_structured_payload_json: Option::, pub version: u32, pub created_at_micros: i64, - pub started_at_micros: Option, - pub completed_at_micros: Option, + pub started_at_micros: Option::, + pub completed_at_micros: Option::, pub updated_at_micros: i64, } + impl __sdk::InModule for AiTaskSnapshot { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/ai_task_stage_blueprint_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/ai_task_stage_blueprint_type.rs index 8ed04d04..366ca586 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/ai_task_stage_blueprint_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/ai_task_stage_blueprint_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -15,6 +20,8 @@ pub struct AiTaskStageBlueprint { pub order: u32, } + impl __sdk::InModule for AiTaskStageBlueprint { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/ai_task_stage_kind_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/ai_task_stage_kind_type.rs index 1d7405de..679241ae 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/ai_task_stage_kind_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/ai_task_stage_kind_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -17,8 +22,12 @@ pub enum AiTaskStageKind { NormalizeResult, PersistResult, + } + + impl __sdk::InModule for AiTaskStageKind { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/ai_task_stage_snapshot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/ai_task_stage_snapshot_type.rs index 30cdb845..9d449d38 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/ai_task_stage_snapshot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/ai_task_stage_snapshot_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_status_type::AiTaskStageStatus; @@ -15,13 +20,15 @@ pub struct AiTaskStageSnapshot { pub detail: String, pub order: u32, pub status: AiTaskStageStatus, - pub text_output: Option, - pub structured_payload_json: Option, - pub warning_messages: Vec, - pub started_at_micros: Option, - pub completed_at_micros: Option, + pub text_output: Option::, + pub structured_payload_json: Option::, + pub warning_messages: Vec::, + pub started_at_micros: Option::, + pub completed_at_micros: Option::, } + impl __sdk::InModule for AiTaskStageSnapshot { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/ai_task_stage_start_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/ai_task_stage_start_input_type.rs index 956fff88..8571c6d8 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/ai_task_stage_start_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/ai_task_stage_start_input_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -14,6 +19,8 @@ pub struct AiTaskStageStartInput { pub started_at_micros: i64, } + impl __sdk::InModule for AiTaskStageStartInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/ai_task_stage_status_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/ai_task_stage_status_type.rs index e1a28d7c..3f60897b 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/ai_task_stage_status_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/ai_task_stage_status_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -15,8 +20,12 @@ pub enum AiTaskStageStatus { Completed, Skipped, + } + + impl __sdk::InModule for AiTaskStageStatus { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/ai_task_stage_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/ai_task_stage_table.rs index 0bd84f77..ae1617de 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/ai_task_stage_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/ai_task_stage_table.rs @@ -2,10 +2,15 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_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`. /// @@ -46,12 +51,8 @@ impl<'ctx> __sdk::Table for AiTaskStageTableHandle<'ctx> { type Row = AiTaskStage; type EventContext = super::EventContext; - fn count(&self) -> u64 { - self.imp.count() - } - fn iter(&self) -> impl Iterator + '_ { - self.imp.iter() - } + fn count(&self) -> u64 { self.imp.count() } + fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } 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`, -/// which allows point queries on the field of the same name -/// via the [`AiTaskStageTaskStageIdUnique::find`] method. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.ai_task_stage().task_stage_id().find(...)`. -pub struct AiTaskStageTaskStageIdUnique<'ctx> { - imp: __sdk::UniqueConstraintHandle, - 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::("task_stage_id"), - phantom: std::marker::PhantomData, + /// 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 + /// via the [`AiTaskStageTaskStageIdUnique::find`] method. + /// + /// Users are encouraged not to explicitly reference this type, + /// but to directly chain method calls, + /// like `ctx.db.ai_task_stage().task_stage_id().find(...)`. + pub struct AiTaskStageTaskStageIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } - } -} -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 { - self.imp.find(col_val) - } -} + 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::("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 { + self.imp.find(col_val) + } + } + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("ai_task_stage"); _table.add_unique_constraint::("task_stage_id", |row| &row.task_stage_id); } @@ -138,24 +140,26 @@ pub(super) fn parse_table_update( raw_updates: __ws::v2::TableUpdate, ) -> __sdk::Result<__sdk::TableUpdate> { __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { - __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") - .with_cause(e) - .into() + __sdk::InternalError::failed_parse( + "TableUpdate", + "TableUpdate", + ).with_cause(e).into() }) } -#[allow(non_camel_case_types)] -/// Extension trait for query builder access to the table `AiTaskStage`. -/// -/// Implemented for [`__sdk::QueryTableAccessor`]. -pub trait ai_task_stageQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `AiTaskStage`. - fn ai_task_stage(&self) -> __sdk::__query_builder::Table; -} + #[allow(non_camel_case_types)] + /// Extension trait for query builder access to the table `AiTaskStage`. + /// + /// Implemented for [`__sdk::QueryTableAccessor`]. + pub trait ai_task_stageQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `AiTaskStage`. + fn ai_task_stage(&self) -> __sdk::__query_builder::Table; + } + + impl ai_task_stageQueryTableAccess for __sdk::QueryTableAccessor { + fn ai_task_stage(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("ai_task_stage") + } + } -impl ai_task_stageQueryTableAccess for __sdk::QueryTableAccessor { - fn ai_task_stage(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("ai_task_stage") - } -} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/ai_task_stage_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/ai_task_stage_type.rs index f4c902de..56a4094e 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/ai_task_stage_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/ai_task_stage_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_status_type::AiTaskStageStatus; @@ -17,17 +22,19 @@ pub struct AiTaskStage { pub detail: String, pub stage_order: u32, pub status: AiTaskStageStatus, - pub text_output: Option, - pub structured_payload_json: Option, - pub warning_messages: Vec, - pub started_at: Option<__sdk::Timestamp>, - pub completed_at: Option<__sdk::Timestamp>, + pub text_output: Option::, + pub structured_payload_json: Option::, + pub warning_messages: Vec::, + pub started_at: Option::<__sdk::Timestamp>, + pub completed_at: Option::<__sdk::Timestamp>, } + impl __sdk::InModule for AiTaskStage { type Module = super::RemoteModule; } + /// Column accessor struct for the table `AiTaskStage`. /// /// Provides typed access to columns for query building. @@ -39,11 +46,11 @@ pub struct AiTaskStageCols { pub detail: __sdk::__query_builder::Col, pub stage_order: __sdk::__query_builder::Col, pub status: __sdk::__query_builder::Col, - pub text_output: __sdk::__query_builder::Col>, - pub structured_payload_json: __sdk::__query_builder::Col>, - pub warning_messages: __sdk::__query_builder::Col>, - pub started_at: __sdk::__query_builder::Col>, - pub completed_at: __sdk::__query_builder::Col>, + pub text_output: __sdk::__query_builder::Col>, + pub structured_payload_json: __sdk::__query_builder::Col>, + pub warning_messages: __sdk::__query_builder::Col>, + pub started_at: __sdk::__query_builder::Col>, + pub completed_at: __sdk::__query_builder::Col>, } 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"), status: __sdk::__query_builder::Col::new(table_name, "status"), text_output: __sdk::__query_builder::Col::new(table_name, "text_output"), - structured_payload_json: __sdk::__query_builder::Col::new( - table_name, - "structured_payload_json", - ), + structured_payload_json: __sdk::__query_builder::Col::new(table_name, "structured_payload_json"), warning_messages: __sdk::__query_builder::Col::new(table_name, "warning_messages"), started_at: __sdk::__query_builder::Col::new(table_name, "started_at"), completed_at: __sdk::__query_builder::Col::new(table_name, "completed_at"), + } } } @@ -83,8 +88,10 @@ impl __sdk::__query_builder::HasIxCols for AiTaskStage { AiTaskStageIxCols { task_id: __sdk::__query_builder::IxCol::new(table_name, "task_id"), task_stage_id: __sdk::__query_builder::IxCol::new(table_name, "task_stage_id"), + } } } impl __sdk::__query_builder::CanBeLookupTable for AiTaskStage {} + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/ai_task_start_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/ai_task_start_input_type.rs index d2145e81..14fa5acb 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/ai_task_start_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/ai_task_start_input_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -11,6 +17,8 @@ pub struct AiTaskStartInput { pub started_at_micros: i64, } + impl __sdk::InModule for AiTaskStartInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/ai_task_status_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/ai_task_status_type.rs index 3c59cd6a..58f1f7a2 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/ai_task_status_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/ai_task_status_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -17,8 +22,12 @@ pub enum AiTaskStatus { Failed, Cancelled, + } + + impl __sdk::InModule for AiTaskStatus { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/ai_task_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/ai_task_table.rs index 83c04b8a..60172196 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/ai_task_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/ai_task_table.rs @@ -2,10 +2,15 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_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`. /// @@ -46,12 +51,8 @@ impl<'ctx> __sdk::Table for AiTaskTableHandle<'ctx> { type Row = AiTask; type EventContext = super::EventContext; - fn count(&self) -> u64 { - self.imp.count() - } - fn iter(&self) -> impl Iterator + '_ { - self.imp.iter() - } + fn count(&self) -> u64 { self.imp.count() } + fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } 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`, -/// which allows point queries on the field of the same name -/// via the [`AiTaskTaskIdUnique::find`] method. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.ai_task().task_id().find(...)`. -pub struct AiTaskTaskIdUnique<'ctx> { - imp: __sdk::UniqueConstraintHandle, - 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::("task_id"), - phantom: std::marker::PhantomData, + /// Access to the `task_id` unique index on the table `ai_task`, + /// which allows point queries on the field of the same name + /// via the [`AiTaskTaskIdUnique::find`] method. + /// + /// Users are encouraged not to explicitly reference this type, + /// but to directly chain method calls, + /// like `ctx.db.ai_task().task_id().find(...)`. + pub struct AiTaskTaskIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } - } -} -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 { - self.imp.find(col_val) - } -} + 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::("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 { + self.imp.find(col_val) + } + } + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("ai_task"); _table.add_unique_constraint::("task_id", |row| &row.task_id); } @@ -138,24 +140,26 @@ pub(super) fn parse_table_update( raw_updates: __ws::v2::TableUpdate, ) -> __sdk::Result<__sdk::TableUpdate> { __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { - __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") - .with_cause(e) - .into() + __sdk::InternalError::failed_parse( + "TableUpdate", + "TableUpdate", + ).with_cause(e).into() }) } -#[allow(non_camel_case_types)] -/// Extension trait for query builder access to the table `AiTask`. -/// -/// Implemented for [`__sdk::QueryTableAccessor`]. -pub trait ai_taskQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `AiTask`. - fn ai_task(&self) -> __sdk::__query_builder::Table; -} + #[allow(non_camel_case_types)] + /// Extension trait for query builder access to the table `AiTask`. + /// + /// Implemented for [`__sdk::QueryTableAccessor`]. + pub trait ai_taskQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `AiTask`. + fn ai_task(&self) -> __sdk::__query_builder::Table; + } + + impl ai_taskQueryTableAccess for __sdk::QueryTableAccessor { + fn ai_task(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("ai_task") + } + } -impl ai_taskQueryTableAccess for __sdk::QueryTableAccessor { - fn ai_task(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("ai_task") - } -} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/ai_task_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/ai_task_type.rs index 6b2845fc..96d4077f 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/ai_task_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/ai_task_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_status_type::AiTaskStatus; @@ -15,23 +20,25 @@ pub struct AiTask { pub owner_user_id: String, pub request_label: String, pub source_module: String, - pub source_entity_id: Option, - pub request_payload_json: Option, + pub source_entity_id: Option::, + pub request_payload_json: Option::, pub status: AiTaskStatus, - pub failure_message: Option, - pub latest_text_output: Option, - pub latest_structured_payload_json: Option, + pub failure_message: Option::, + pub latest_text_output: Option::, + pub latest_structured_payload_json: Option::, pub version: u32, pub created_at: __sdk::Timestamp, - pub started_at: Option<__sdk::Timestamp>, - pub completed_at: Option<__sdk::Timestamp>, + pub started_at: Option::<__sdk::Timestamp>, + pub completed_at: Option::<__sdk::Timestamp>, pub updated_at: __sdk::Timestamp, } + impl __sdk::InModule for AiTask { type Module = super::RemoteModule; } + /// Column accessor struct for the table `AiTask`. /// /// Provides typed access to columns for query building. @@ -41,16 +48,16 @@ pub struct AiTaskCols { pub owner_user_id: __sdk::__query_builder::Col, pub request_label: __sdk::__query_builder::Col, pub source_module: __sdk::__query_builder::Col, - pub source_entity_id: __sdk::__query_builder::Col>, - pub request_payload_json: __sdk::__query_builder::Col>, + pub source_entity_id: __sdk::__query_builder::Col>, + pub request_payload_json: __sdk::__query_builder::Col>, pub status: __sdk::__query_builder::Col, - pub failure_message: __sdk::__query_builder::Col>, - pub latest_text_output: __sdk::__query_builder::Col>, - pub latest_structured_payload_json: __sdk::__query_builder::Col>, + pub failure_message: __sdk::__query_builder::Col>, + pub latest_text_output: __sdk::__query_builder::Col>, + pub latest_structured_payload_json: __sdk::__query_builder::Col>, pub version: __sdk::__query_builder::Col, pub created_at: __sdk::__query_builder::Col, - pub started_at: __sdk::__query_builder::Col>, - pub completed_at: __sdk::__query_builder::Col>, + pub started_at: __sdk::__query_builder::Col>, + pub completed_at: __sdk::__query_builder::Col>, pub updated_at: __sdk::__query_builder::Col, } @@ -64,22 +71,17 @@ impl __sdk::__query_builder::HasCols for AiTask { request_label: __sdk::__query_builder::Col::new(table_name, "request_label"), source_module: __sdk::__query_builder::Col::new(table_name, "source_module"), source_entity_id: __sdk::__query_builder::Col::new(table_name, "source_entity_id"), - request_payload_json: __sdk::__query_builder::Col::new( - table_name, - "request_payload_json", - ), + request_payload_json: __sdk::__query_builder::Col::new(table_name, "request_payload_json"), status: __sdk::__query_builder::Col::new(table_name, "status"), 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_structured_payload_json: __sdk::__query_builder::Col::new( - table_name, - "latest_structured_payload_json", - ), + latest_structured_payload_json: __sdk::__query_builder::Col::new(table_name, "latest_structured_payload_json"), version: __sdk::__query_builder::Col::new(table_name, "version"), created_at: __sdk::__query_builder::Col::new(table_name, "created_at"), started_at: __sdk::__query_builder::Col::new(table_name, "started_at"), completed_at: __sdk::__query_builder::Col::new(table_name, "completed_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"), task_id: __sdk::__query_builder::IxCol::new(table_name, "task_id"), task_kind: __sdk::__query_builder::IxCol::new(table_name, "task_kind"), + } } } impl __sdk::__query_builder::CanBeLookupTable for AiTask {} + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/ai_text_chunk_append_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/ai_text_chunk_append_input_type.rs index 0f462690..11b5da68 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/ai_text_chunk_append_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/ai_text_chunk_append_input_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -16,6 +21,8 @@ pub struct AiTextChunkAppendInput { pub created_at_micros: i64, } + impl __sdk::InModule for AiTextChunkAppendInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/ai_text_chunk_snapshot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/ai_text_chunk_snapshot_type.rs index f386071c..81cb2ce9 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/ai_text_chunk_snapshot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/ai_text_chunk_snapshot_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -17,6 +22,8 @@ pub struct AiTextChunkSnapshot { pub created_at_micros: i64, } + impl __sdk::InModule for AiTextChunkSnapshot { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/ai_text_chunk_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/ai_text_chunk_table.rs index 7311d79f..2ef5c6ad 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/ai_text_chunk_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/ai_text_chunk_table.rs @@ -2,9 +2,14 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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 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`. /// @@ -45,12 +50,8 @@ impl<'ctx> __sdk::Table for AiTextChunkTableHandle<'ctx> { type Row = AiTextChunk; type EventContext = super::EventContext; - fn count(&self) -> u64 { - self.imp.count() - } - fn iter(&self) -> impl Iterator + '_ { - self.imp.iter() - } + fn count(&self) -> u64 { self.imp.count() } + fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } 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`, -/// which allows point queries on the field of the same name -/// via the [`AiTextChunkTextChunkRowIdUnique::find`] method. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.ai_text_chunk().text_chunk_row_id().find(...)`. -pub struct AiTextChunkTextChunkRowIdUnique<'ctx> { - imp: __sdk::UniqueConstraintHandle, - 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::("text_chunk_row_id"), - phantom: std::marker::PhantomData, + /// 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 + /// via the [`AiTextChunkTextChunkRowIdUnique::find`] method. + /// + /// Users are encouraged not to explicitly reference this type, + /// but to directly chain method calls, + /// like `ctx.db.ai_text_chunk().text_chunk_row_id().find(...)`. + pub struct AiTextChunkTextChunkRowIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } - } -} -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 { - self.imp.find(col_val) - } -} + 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::("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 { + self.imp.find(col_val) + } + } + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("ai_text_chunk"); _table.add_unique_constraint::("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, ) -> __sdk::Result<__sdk::TableUpdate> { __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { - __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") - .with_cause(e) - .into() + __sdk::InternalError::failed_parse( + "TableUpdate", + "TableUpdate", + ).with_cause(e).into() }) } -#[allow(non_camel_case_types)] -/// Extension trait for query builder access to the table `AiTextChunk`. -/// -/// Implemented for [`__sdk::QueryTableAccessor`]. -pub trait ai_text_chunkQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `AiTextChunk`. - fn ai_text_chunk(&self) -> __sdk::__query_builder::Table; -} + #[allow(non_camel_case_types)] + /// Extension trait for query builder access to the table `AiTextChunk`. + /// + /// Implemented for [`__sdk::QueryTableAccessor`]. + pub trait ai_text_chunkQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `AiTextChunk`. + fn ai_text_chunk(&self) -> __sdk::__query_builder::Table; + } + + impl ai_text_chunkQueryTableAccess for __sdk::QueryTableAccessor { + fn ai_text_chunk(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("ai_text_chunk") + } + } -impl ai_text_chunkQueryTableAccess for __sdk::QueryTableAccessor { - fn ai_text_chunk(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("ai_text_chunk") - } -} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/ai_text_chunk_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/ai_text_chunk_type.rs index 8a1a8c93..df60c3a7 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/ai_text_chunk_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/ai_text_chunk_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -18,10 +23,12 @@ pub struct AiTextChunk { pub created_at: __sdk::Timestamp, } + impl __sdk::InModule for AiTextChunk { type Module = super::RemoteModule; } + /// Column accessor struct for the table `AiTextChunk`. /// /// 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"), delta_text: __sdk::__query_builder::Col::new(table_name, "delta_text"), created_at: __sdk::__query_builder::Col::new(table_name, "created_at"), + } } } @@ -64,8 +72,10 @@ impl __sdk::__query_builder::HasIxCols for AiTextChunk { AiTextChunkIxCols { 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"), + } } } impl __sdk::__query_builder::CanBeLookupTable for AiTextChunk {} + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/append_ai_text_chunk_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/append_ai_text_chunk_and_return_procedure.rs index 11323392..2edd4cbc 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/append_ai_text_chunk_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/append_ai_text_chunk_and_return_procedure.rs @@ -2,17 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_task_procedure_result_type::AiTaskProcedureResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct AppendAiTextChunkAndReturnArgs { + struct AppendAiTextChunkAndReturnArgs { pub input: AiTextChunkAppendInput, } + impl __sdk::InModule for AppendAiTextChunkAndReturnArgs { type Module = super::RemoteModule; } @@ -22,19 +28,16 @@ impl __sdk::InModule for AppendAiTextChunkAndReturnArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait append_ai_text_chunk_and_return { - fn append_ai_text_chunk_and_return(&self, input: AiTextChunkAppendInput) { - self.append_ai_text_chunk_and_return_then(input, |_, _| {}); + fn append_ai_text_chunk_and_return(&self, input: AiTextChunkAppendInput, +) { + self.append_ai_text_chunk_and_return_then(input, |_, _| {}); } fn append_ai_text_chunk_and_return_then( &self, input: AiTextChunkAppendInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } @@ -43,17 +46,13 @@ impl append_ai_text_chunk_and_return for super::RemoteProcedures { &self, input: AiTextChunkAppendInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, AiTaskProcedureResult>( - "append_ai_text_chunk_and_return", - AppendAiTextChunkAndReturnArgs { input }, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, AiTaskProcedureResult>( + "append_ai_text_chunk_and_return", + AppendAiTextChunkAndReturnArgs { input, }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/apply_chapter_progression_ledger_entry_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/apply_chapter_progression_ledger_entry_and_return_procedure.rs index bba4c841..e76eac6e 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/apply_chapter_progression_ledger_entry_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/apply_chapter_progression_ledger_entry_and_return_procedure.rs @@ -2,17 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_procedure_result_type::ChapterProgressionProcedureResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct ApplyChapterProgressionLedgerEntryAndReturnArgs { + struct ApplyChapterProgressionLedgerEntryAndReturnArgs { pub input: ChapterProgressionLedgerInput, } + impl __sdk::InModule for ApplyChapterProgressionLedgerEntryAndReturnArgs { type Module = super::RemoteModule; } @@ -22,22 +28,16 @@ impl __sdk::InModule for ApplyChapterProgressionLedgerEntryAndReturnArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait apply_chapter_progression_ledger_entry_and_return { - fn apply_chapter_progression_ledger_entry_and_return( - &self, - input: ChapterProgressionLedgerInput, - ) { - self.apply_chapter_progression_ledger_entry_and_return_then(input, |_, _| {}); + fn apply_chapter_progression_ledger_entry_and_return(&self, input: ChapterProgressionLedgerInput, +) { + self.apply_chapter_progression_ledger_entry_and_return_then(input, |_, _| {}); } fn apply_chapter_progression_ledger_entry_and_return_then( &self, input: ChapterProgressionLedgerInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } @@ -46,17 +46,13 @@ impl apply_chapter_progression_ledger_entry_and_return for super::RemoteProcedur &self, input: ChapterProgressionLedgerInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, ChapterProgressionProcedureResult>( - "apply_chapter_progression_ledger_entry_and_return", - ApplyChapterProgressionLedgerEntryAndReturnArgs { input }, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, ChapterProgressionProcedureResult>( + "apply_chapter_progression_ledger_entry_and_return", + ApplyChapterProgressionLedgerEntryAndReturnArgs { input, }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/apply_chapter_progression_ledger_entry_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/apply_chapter_progression_ledger_entry_reducer.rs index 98f821ef..04f54e54 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/apply_chapter_progression_ledger_entry_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/apply_chapter_progression_ledger_entry_reducer.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -14,8 +19,10 @@ pub(super) struct ApplyChapterProgressionLedgerEntryArgs { impl From for super::Reducer { fn from(args: ApplyChapterProgressionLedgerEntryArgs) -> Self { - Self::ApplyChapterProgressionLedgerEntry { input: args.input } - } + Self::ApplyChapterProgressionLedgerEntry { + input: args.input, +} +} } impl __sdk::InModule for ApplyChapterProgressionLedgerEntryArgs { @@ -33,11 +40,9 @@ pub trait apply_chapter_progression_ledger_entry { /// The reducer will run asynchronously in the future, /// 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. - fn apply_chapter_progression_ledger_entry( - &self, - input: ChapterProgressionLedgerInput, - ) -> __sdk::Result<()> { - self.apply_chapter_progression_ledger_entry_then(input, |_, _| {}) + fn apply_chapter_progression_ledger_entry(&self, input: ChapterProgressionLedgerInput, +) -> __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, @@ -65,9 +70,7 @@ impl apply_chapter_progression_ledger_entry for super::RemoteReducers { + Send + 'static, ) -> __sdk::Result<()> { - self.imp.invoke_reducer_with_callback( - ApplyChapterProgressionLedgerEntryArgs { input }, - callback, - ) + self.imp.invoke_reducer_with_callback(ApplyChapterProgressionLedgerEntryArgs { input, }, callback) } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/apply_inventory_mutation_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/apply_inventory_mutation_reducer.rs index 91f7d2c0..4270f52a 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/apply_inventory_mutation_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/apply_inventory_mutation_reducer.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -14,8 +19,10 @@ pub(super) struct ApplyInventoryMutationArgs { impl From for super::Reducer { fn from(args: ApplyInventoryMutationArgs) -> Self { - Self::ApplyInventoryMutation { input: args.input } - } + Self::ApplyInventoryMutation { + input: args.input, +} +} } impl __sdk::InModule for ApplyInventoryMutationArgs { @@ -33,8 +40,9 @@ pub trait apply_inventory_mutation { /// The reducer will run asynchronously in the future, /// 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. - fn apply_inventory_mutation(&self, input: InventoryMutationInput) -> __sdk::Result<()> { - self.apply_inventory_mutation_then(input, |_, _| {}) + fn apply_inventory_mutation(&self, input: InventoryMutationInput, +) -> __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, @@ -62,7 +70,7 @@ impl apply_inventory_mutation for super::RemoteReducers { + Send + 'static, ) -> __sdk::Result<()> { - self.imp - .invoke_reducer_with_callback(ApplyInventoryMutationArgs { input }, callback) + self.imp.invoke_reducer_with_callback(ApplyInventoryMutationArgs { input, }, callback) } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/apply_quest_signal_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/apply_quest_signal_reducer.rs index afb452b5..6976f6aa 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/apply_quest_signal_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/apply_quest_signal_reducer.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -14,8 +19,10 @@ pub(super) struct ApplyQuestSignalArgs { impl From for super::Reducer { fn from(args: ApplyQuestSignalArgs) -> Self { - Self::ApplyQuestSignal { input: args.input } - } + Self::ApplyQuestSignal { + input: args.input, +} +} } impl __sdk::InModule for ApplyQuestSignalArgs { @@ -33,8 +40,9 @@ pub trait apply_quest_signal { /// The reducer will run asynchronously in the future, /// 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. - fn apply_quest_signal(&self, input: QuestSignalApplyInput) -> __sdk::Result<()> { - self.apply_quest_signal_then(input, |_, _| {}) + fn apply_quest_signal(&self, input: QuestSignalApplyInput, +) -> __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, @@ -62,7 +70,7 @@ impl apply_quest_signal for super::RemoteReducers { + Send + 'static, ) -> __sdk::Result<()> { - self.imp - .invoke_reducer_with_callback(ApplyQuestSignalArgs { input }, callback) + self.imp.invoke_reducer_with_callback(ApplyQuestSignalArgs { input, }, callback) } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/asset_entity_binding_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/asset_entity_binding_input_type.rs index 10a39937..10dab835 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/asset_entity_binding_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/asset_entity_binding_input_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -13,11 +19,13 @@ pub struct AssetEntityBindingInput { pub entity_id: String, pub slot: String, pub asset_kind: String, - pub owner_user_id: Option, - pub profile_id: Option, + pub owner_user_id: Option::, + pub profile_id: Option::, pub updated_at_micros: i64, } + impl __sdk::InModule for AssetEntityBindingInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/asset_entity_binding_procedure_result_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/asset_entity_binding_procedure_result_type.rs index 1c51596f..73eff3a6 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/asset_entity_binding_procedure_result_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/asset_entity_binding_procedure_result_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -10,10 +15,12 @@ use super::asset_entity_binding_snapshot_type::AssetEntityBindingSnapshot; #[sats(crate = __lib)] pub struct AssetEntityBindingProcedureResult { pub ok: bool, - pub record: Option, - pub error_message: Option, + pub record: Option::, + pub error_message: Option::, } + impl __sdk::InModule for AssetEntityBindingProcedureResult { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/asset_entity_binding_snapshot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/asset_entity_binding_snapshot_type.rs index d559ea04..862d1b14 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/asset_entity_binding_snapshot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/asset_entity_binding_snapshot_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -13,12 +19,14 @@ pub struct AssetEntityBindingSnapshot { pub entity_id: String, pub slot: String, pub asset_kind: String, - pub owner_user_id: Option, - pub profile_id: Option, + pub owner_user_id: Option::, + pub profile_id: Option::, pub created_at_micros: i64, pub updated_at_micros: i64, } + impl __sdk::InModule for AssetEntityBindingSnapshot { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/asset_entity_binding_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/asset_entity_binding_table.rs index 971704ae..13f7b47f 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/asset_entity_binding_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/asset_entity_binding_table.rs @@ -2,8 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![allow(unused, clippy::all)] +use spacetimedb_sdk::__codegen::{ + self as __sdk, + __lib, + __sats, + __ws, +}; 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`. /// @@ -31,9 +36,7 @@ pub trait AssetEntityBindingTableAccess { impl AssetEntityBindingTableAccess for super::RemoteTables { fn asset_entity_binding(&self) -> AssetEntityBindingTableHandle<'_> { AssetEntityBindingTableHandle { - imp: self - .imp - .get_table::("asset_entity_binding"), + imp: self.imp.get_table::("asset_entity_binding"), ctx: std::marker::PhantomData, } } @@ -46,12 +49,8 @@ impl<'ctx> __sdk::Table for AssetEntityBindingTableHandle<'ctx> { type Row = AssetEntityBinding; type EventContext = super::EventContext; - fn count(&self) -> u64 { - self.imp.count() - } - fn iter(&self) -> impl Iterator + '_ { - self.imp.iter() - } + fn count(&self) -> u64 { self.imp.count() } + fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } 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`, -/// which allows point queries on the field of the same name -/// via the [`AssetEntityBindingBindingIdUnique::find`] method. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.asset_entity_binding().binding_id().find(...)`. -pub struct AssetEntityBindingBindingIdUnique<'ctx> { - imp: __sdk::UniqueConstraintHandle, - 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::("binding_id"), - phantom: std::marker::PhantomData, + /// Access to the `binding_id` unique index on the table `asset_entity_binding`, + /// which allows point queries on the field of the same name + /// via the [`AssetEntityBindingBindingIdUnique::find`] method. + /// + /// Users are encouraged not to explicitly reference this type, + /// but to directly chain method calls, + /// like `ctx.db.asset_entity_binding().binding_id().find(...)`. + pub struct AssetEntityBindingBindingIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } - } -} -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 { - self.imp.find(col_val) - } -} + 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::("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 { + self.imp.find(col_val) + } + } + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("asset_entity_binding"); _table.add_unique_constraint::("binding_id", |row| &row.binding_id); } @@ -138,24 +138,26 @@ pub(super) fn parse_table_update( raw_updates: __ws::v2::TableUpdate, ) -> __sdk::Result<__sdk::TableUpdate> { __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { - __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") - .with_cause(e) - .into() + __sdk::InternalError::failed_parse( + "TableUpdate", + "TableUpdate", + ).with_cause(e).into() }) } -#[allow(non_camel_case_types)] -/// Extension trait for query builder access to the table `AssetEntityBinding`. -/// -/// Implemented for [`__sdk::QueryTableAccessor`]. -pub trait asset_entity_bindingQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `AssetEntityBinding`. - fn asset_entity_binding(&self) -> __sdk::__query_builder::Table; -} + #[allow(non_camel_case_types)] + /// Extension trait for query builder access to the table `AssetEntityBinding`. + /// + /// Implemented for [`__sdk::QueryTableAccessor`]. + pub trait asset_entity_bindingQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `AssetEntityBinding`. + fn asset_entity_binding(&self) -> __sdk::__query_builder::Table; + } + + impl asset_entity_bindingQueryTableAccess for __sdk::QueryTableAccessor { + fn asset_entity_binding(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("asset_entity_binding") + } + } -impl asset_entity_bindingQueryTableAccess for __sdk::QueryTableAccessor { - fn asset_entity_binding(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("asset_entity_binding") - } -} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/asset_entity_binding_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/asset_entity_binding_type.rs index f12154e1..8f5423b6 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/asset_entity_binding_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/asset_entity_binding_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -13,16 +19,18 @@ pub struct AssetEntityBinding { pub entity_id: String, pub slot: String, pub asset_kind: String, - pub owner_user_id: Option, - pub profile_id: Option, + pub owner_user_id: Option::, + pub profile_id: Option::, pub created_at: __sdk::Timestamp, pub updated_at: __sdk::Timestamp, } + impl __sdk::InModule for AssetEntityBinding { type Module = super::RemoteModule; } + /// Column accessor struct for the table `AssetEntityBinding`. /// /// Provides typed access to columns for query building. @@ -33,8 +41,8 @@ pub struct AssetEntityBindingCols { pub entity_id: __sdk::__query_builder::Col, pub slot: __sdk::__query_builder::Col, pub asset_kind: __sdk::__query_builder::Col, - pub owner_user_id: __sdk::__query_builder::Col>, - pub profile_id: __sdk::__query_builder::Col>, + pub owner_user_id: __sdk::__query_builder::Col>, + pub profile_id: __sdk::__query_builder::Col>, pub created_at: __sdk::__query_builder::Col, pub updated_at: __sdk::__query_builder::Col, } @@ -53,6 +61,7 @@ impl __sdk::__query_builder::HasCols for AssetEntityBinding { profile_id: __sdk::__query_builder::Col::new(table_name, "profile_id"), created_at: __sdk::__query_builder::Col::new(table_name, "created_at"), updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"), + } } } @@ -71,8 +80,10 @@ impl __sdk::__query_builder::HasIxCols for AssetEntityBinding { AssetEntityBindingIxCols { asset_object_id: __sdk::__query_builder::IxCol::new(table_name, "asset_object_id"), binding_id: __sdk::__query_builder::IxCol::new(table_name, "binding_id"), + } } } impl __sdk::__query_builder::CanBeLookupTable for AssetEntityBinding {} + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/asset_object_access_policy_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/asset_object_access_policy_type.rs index 17d02930..3d6203bb 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/asset_object_access_policy_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/asset_object_access_policy_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -11,8 +16,12 @@ pub enum AssetObjectAccessPolicy { Private, PublicRead, + } + + impl __sdk::InModule for AssetObjectAccessPolicy { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/asset_object_procedure_result_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/asset_object_procedure_result_type.rs index 9ccf22ed..ea327af9 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/asset_object_procedure_result_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/asset_object_procedure_result_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -10,10 +15,12 @@ use super::asset_object_upsert_snapshot_type::AssetObjectUpsertSnapshot; #[sats(crate = __lib)] pub struct AssetObjectProcedureResult { pub ok: bool, - pub record: Option, - pub error_message: Option, + pub record: Option::, + pub error_message: Option::, } + impl __sdk::InModule for AssetObjectProcedureResult { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/asset_object_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/asset_object_table.rs index 526fa287..2aeb9a22 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/asset_object_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/asset_object_table.rs @@ -2,9 +2,14 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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 spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; +use super::asset_object_access_policy_type::AssetObjectAccessPolicy; /// Table handle for the table `asset_object`. /// @@ -45,12 +50,8 @@ impl<'ctx> __sdk::Table for AssetObjectTableHandle<'ctx> { type Row = AssetObject; type EventContext = super::EventContext; - fn count(&self) -> u64 { - self.imp.count() - } - fn iter(&self) -> impl Iterator + '_ { - self.imp.iter() - } + fn count(&self) -> u64 { self.imp.count() } + fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } 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`, -/// which allows point queries on the field of the same name -/// via the [`AssetObjectAssetObjectIdUnique::find`] method. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.asset_object().asset_object_id().find(...)`. -pub struct AssetObjectAssetObjectIdUnique<'ctx> { - imp: __sdk::UniqueConstraintHandle, - 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::("asset_object_id"), - phantom: std::marker::PhantomData, + /// Access to the `asset_object_id` unique index on the table `asset_object`, + /// which allows point queries on the field of the same name + /// via the [`AssetObjectAssetObjectIdUnique::find`] method. + /// + /// Users are encouraged not to explicitly reference this type, + /// but to directly chain method calls, + /// like `ctx.db.asset_object().asset_object_id().find(...)`. + pub struct AssetObjectAssetObjectIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } - } -} -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 { - self.imp.find(col_val) - } -} + 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::("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 { + self.imp.find(col_val) + } + } + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("asset_object"); _table.add_unique_constraint::("asset_object_id", |row| &row.asset_object_id); } @@ -137,24 +139,26 @@ pub(super) fn parse_table_update( raw_updates: __ws::v2::TableUpdate, ) -> __sdk::Result<__sdk::TableUpdate> { __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { - __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") - .with_cause(e) - .into() + __sdk::InternalError::failed_parse( + "TableUpdate", + "TableUpdate", + ).with_cause(e).into() }) } -#[allow(non_camel_case_types)] -/// Extension trait for query builder access to the table `AssetObject`. -/// -/// Implemented for [`__sdk::QueryTableAccessor`]. -pub trait asset_objectQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `AssetObject`. - fn asset_object(&self) -> __sdk::__query_builder::Table; -} + #[allow(non_camel_case_types)] + /// Extension trait for query builder access to the table `AssetObject`. + /// + /// Implemented for [`__sdk::QueryTableAccessor`]. + pub trait asset_objectQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `AssetObject`. + fn asset_object(&self) -> __sdk::__query_builder::Table; + } + + impl asset_objectQueryTableAccess for __sdk::QueryTableAccessor { + fn asset_object(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("asset_object") + } + } -impl asset_objectQueryTableAccess for __sdk::QueryTableAccessor { - fn asset_object(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("asset_object") - } -} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/asset_object_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/asset_object_type.rs index c9d57ac5..75935935 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/asset_object_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/asset_object_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -13,23 +18,25 @@ pub struct AssetObject { pub bucket: String, pub object_key: String, pub access_policy: AssetObjectAccessPolicy, - pub content_type: Option, + pub content_type: Option::, pub content_length: u64, - pub content_hash: Option, + pub content_hash: Option::, pub version: u32, - pub source_job_id: Option, - pub owner_user_id: Option, - pub profile_id: Option, - pub entity_id: Option, + pub source_job_id: Option::, + pub owner_user_id: Option::, + pub profile_id: Option::, + pub entity_id: Option::, pub asset_kind: String, pub created_at: __sdk::Timestamp, pub updated_at: __sdk::Timestamp, } + impl __sdk::InModule for AssetObject { type Module = super::RemoteModule; } + /// Column accessor struct for the table `AssetObject`. /// /// Provides typed access to columns for query building. @@ -38,14 +45,14 @@ pub struct AssetObjectCols { pub bucket: __sdk::__query_builder::Col, pub object_key: __sdk::__query_builder::Col, pub access_policy: __sdk::__query_builder::Col, - pub content_type: __sdk::__query_builder::Col>, + pub content_type: __sdk::__query_builder::Col>, pub content_length: __sdk::__query_builder::Col, - pub content_hash: __sdk::__query_builder::Col>, + pub content_hash: __sdk::__query_builder::Col>, pub version: __sdk::__query_builder::Col, - pub source_job_id: __sdk::__query_builder::Col>, - pub owner_user_id: __sdk::__query_builder::Col>, - pub profile_id: __sdk::__query_builder::Col>, - pub entity_id: __sdk::__query_builder::Col>, + pub source_job_id: __sdk::__query_builder::Col>, + pub owner_user_id: __sdk::__query_builder::Col>, + pub profile_id: __sdk::__query_builder::Col>, + pub entity_id: __sdk::__query_builder::Col>, pub asset_kind: __sdk::__query_builder::Col, pub created_at: __sdk::__query_builder::Col, pub updated_at: __sdk::__query_builder::Col, @@ -70,6 +77,7 @@ impl __sdk::__query_builder::HasCols for AssetObject { asset_kind: __sdk::__query_builder::Col::new(table_name, "asset_kind"), created_at: __sdk::__query_builder::Col::new(table_name, "created_at"), updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"), + } } } @@ -88,8 +96,10 @@ impl __sdk::__query_builder::HasIxCols for AssetObject { AssetObjectIxCols { asset_kind: __sdk::__query_builder::IxCol::new(table_name, "asset_kind"), asset_object_id: __sdk::__query_builder::IxCol::new(table_name, "asset_object_id"), + } } } impl __sdk::__query_builder::CanBeLookupTable for AssetObject {} + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/asset_object_upsert_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/asset_object_upsert_input_type.rs index 85fcadc6..7e48cffa 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/asset_object_upsert_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/asset_object_upsert_input_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -13,18 +18,20 @@ pub struct AssetObjectUpsertInput { pub bucket: String, pub object_key: String, pub access_policy: AssetObjectAccessPolicy, - pub content_type: Option, + pub content_type: Option::, pub content_length: u64, - pub content_hash: Option, + pub content_hash: Option::, pub version: u32, - pub source_job_id: Option, - pub owner_user_id: Option, - pub profile_id: Option, - pub entity_id: Option, + pub source_job_id: Option::, + pub owner_user_id: Option::, + pub profile_id: Option::, + pub entity_id: Option::, pub asset_kind: String, pub updated_at_micros: i64, } + impl __sdk::InModule for AssetObjectUpsertInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/asset_object_upsert_snapshot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/asset_object_upsert_snapshot_type.rs index b349f18d..7b5d3860 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/asset_object_upsert_snapshot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/asset_object_upsert_snapshot_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -13,19 +18,21 @@ pub struct AssetObjectUpsertSnapshot { pub bucket: String, pub object_key: String, pub access_policy: AssetObjectAccessPolicy, - pub content_type: Option, + pub content_type: Option::, pub content_length: u64, - pub content_hash: Option, + pub content_hash: Option::, pub version: u32, - pub source_job_id: Option, - pub owner_user_id: Option, - pub profile_id: Option, - pub entity_id: Option, + pub source_job_id: Option::, + pub owner_user_id: Option::, + pub profile_id: Option::, + pub entity_id: Option::, pub asset_kind: String, pub created_at_micros: i64, pub updated_at_micros: i64, } + impl __sdk::InModule for AssetObjectUpsertSnapshot { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/attach_ai_result_reference_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/attach_ai_result_reference_and_return_procedure.rs index 2f3edbe2..c7eb0e22 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/attach_ai_result_reference_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/attach_ai_result_reference_and_return_procedure.rs @@ -2,17 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_result_reference_input_type::AiResultReferenceInput; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct AttachAiResultReferenceAndReturnArgs { + struct AttachAiResultReferenceAndReturnArgs { pub input: AiResultReferenceInput, } + impl __sdk::InModule for AttachAiResultReferenceAndReturnArgs { type Module = super::RemoteModule; } @@ -22,19 +28,16 @@ impl __sdk::InModule for AttachAiResultReferenceAndReturnArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait attach_ai_result_reference_and_return { - fn attach_ai_result_reference_and_return(&self, input: AiResultReferenceInput) { - self.attach_ai_result_reference_and_return_then(input, |_, _| {}); + fn attach_ai_result_reference_and_return(&self, input: AiResultReferenceInput, +) { + self.attach_ai_result_reference_and_return_then(input, |_, _| {}); } fn attach_ai_result_reference_and_return_then( &self, input: AiResultReferenceInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } @@ -43,17 +46,13 @@ impl attach_ai_result_reference_and_return for super::RemoteProcedures { &self, input: AiResultReferenceInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, AiTaskProcedureResult>( - "attach_ai_result_reference_and_return", - AttachAiResultReferenceAndReturnArgs { input }, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, AiTaskProcedureResult>( + "attach_ai_result_reference_and_return", + AttachAiResultReferenceAndReturnArgs { input, }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/battle_mode_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/battle_mode_type.rs index a88c25f4..1961ac69 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/battle_mode_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/battle_mode_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -11,8 +16,12 @@ pub enum BattleMode { Fight, Spar, + } + + impl __sdk::InModule for BattleMode { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/battle_state_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/battle_state_input_type.rs index 6a176e2d..104b96cb 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/battle_state_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/battle_state_input_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::runtime_item_reward_item_snapshot_type::RuntimeItemRewardItemSnapshot; @@ -14,7 +19,7 @@ pub struct BattleStateInput { pub story_session_id: String, pub runtime_session_id: String, pub actor_user_id: String, - pub chapter_id: Option, + pub chapter_id: Option::, pub target_npc_id: String, pub target_name: String, pub battle_mode: BattleMode, @@ -25,10 +30,12 @@ pub struct BattleStateInput { pub target_hp: i32, pub target_max_hp: i32, pub experience_reward: u32, - pub reward_items: Vec, + pub reward_items: Vec::, pub created_at_micros: i64, } + impl __sdk::InModule for BattleStateInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/battle_state_procedure_result_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/battle_state_procedure_result_type.rs index e66352ad..cadc80d8 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/battle_state_procedure_result_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/battle_state_procedure_result_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -10,10 +15,12 @@ use super::battle_state_snapshot_type::BattleStateSnapshot; #[sats(crate = __lib)] pub struct BattleStateProcedureResult { pub ok: bool, - pub snapshot: Option, - pub error_message: Option, + pub snapshot: Option::, + pub error_message: Option::, } + impl __sdk::InModule for BattleStateProcedureResult { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/battle_state_query_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/battle_state_query_input_type.rs index 53053cca..6b9298d4 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/battle_state_query_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/battle_state_query_input_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -10,6 +16,8 @@ pub struct BattleStateQueryInput { pub battle_state_id: String, } + impl __sdk::InModule for BattleStateQueryInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/battle_state_snapshot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/battle_state_snapshot_type.rs index 925d8468..c20ec25c 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/battle_state_snapshot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/battle_state_snapshot_type.rs @@ -2,12 +2,17 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_status_type::BattleStatus; -use super::combat_outcome_type::CombatOutcome; 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)] #[sats(crate = __lib)] @@ -16,7 +21,7 @@ pub struct BattleStateSnapshot { pub story_session_id: String, pub runtime_session_id: String, pub actor_user_id: String, - pub chapter_id: Option, + pub chapter_id: Option::, pub target_npc_id: String, pub target_name: String, pub battle_mode: BattleMode, @@ -28,11 +33,11 @@ pub struct BattleStateSnapshot { pub target_hp: i32, pub target_max_hp: i32, pub experience_reward: u32, - pub reward_items: Vec, + pub reward_items: Vec::, pub turn_index: u32, - pub last_action_function_id: Option, - pub last_action_text: Option, - pub last_result_text: Option, + pub last_action_function_id: Option::, + pub last_action_text: Option::, + pub last_result_text: Option::, pub last_damage_dealt: i32, pub last_damage_taken: i32, pub last_outcome: CombatOutcome, @@ -41,6 +46,8 @@ pub struct BattleStateSnapshot { pub updated_at_micros: i64, } + impl __sdk::InModule for BattleStateSnapshot { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/battle_state_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/battle_state_table.rs index 98a289a4..53dc1ebb 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/battle_state_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/battle_state_table.rs @@ -2,12 +2,17 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_mode_type::BattleMode; use super::battle_status_type::BattleStatus; -use super::combat_outcome_type::CombatOutcome; 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`. /// @@ -48,12 +53,8 @@ impl<'ctx> __sdk::Table for BattleStateTableHandle<'ctx> { type Row = BattleState; type EventContext = super::EventContext; - fn count(&self) -> u64 { - self.imp.count() - } - fn iter(&self) -> impl Iterator + '_ { - self.imp.iter() - } + fn count(&self) -> u64 { self.imp.count() } + fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } 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`, -/// which allows point queries on the field of the same name -/// via the [`BattleStateBattleStateIdUnique::find`] method. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.battle_state().battle_state_id().find(...)`. -pub struct BattleStateBattleStateIdUnique<'ctx> { - imp: __sdk::UniqueConstraintHandle, - 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::("battle_state_id"), - phantom: std::marker::PhantomData, + /// Access to the `battle_state_id` unique index on the table `battle_state`, + /// which allows point queries on the field of the same name + /// via the [`BattleStateBattleStateIdUnique::find`] method. + /// + /// Users are encouraged not to explicitly reference this type, + /// but to directly chain method calls, + /// like `ctx.db.battle_state().battle_state_id().find(...)`. + pub struct BattleStateBattleStateIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } - } -} -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 { - self.imp.find(col_val) - } -} + 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::("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 { + self.imp.find(col_val) + } + } + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("battle_state"); _table.add_unique_constraint::("battle_state_id", |row| &row.battle_state_id); } @@ -140,24 +142,26 @@ pub(super) fn parse_table_update( raw_updates: __ws::v2::TableUpdate, ) -> __sdk::Result<__sdk::TableUpdate> { __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { - __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") - .with_cause(e) - .into() + __sdk::InternalError::failed_parse( + "TableUpdate", + "TableUpdate", + ).with_cause(e).into() }) } -#[allow(non_camel_case_types)] -/// Extension trait for query builder access to the table `BattleState`. -/// -/// Implemented for [`__sdk::QueryTableAccessor`]. -pub trait battle_stateQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `BattleState`. - fn battle_state(&self) -> __sdk::__query_builder::Table; -} + #[allow(non_camel_case_types)] + /// Extension trait for query builder access to the table `BattleState`. + /// + /// Implemented for [`__sdk::QueryTableAccessor`]. + pub trait battle_stateQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `BattleState`. + fn battle_state(&self) -> __sdk::__query_builder::Table; + } + + impl battle_stateQueryTableAccess for __sdk::QueryTableAccessor { + fn battle_state(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("battle_state") + } + } -impl battle_stateQueryTableAccess for __sdk::QueryTableAccessor { - fn battle_state(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("battle_state") - } -} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/battle_state_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/battle_state_type.rs index 9d9b852f..1b7e0420 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/battle_state_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/battle_state_type.rs @@ -2,12 +2,17 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_status_type::BattleStatus; -use super::combat_outcome_type::CombatOutcome; 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)] #[sats(crate = __lib)] @@ -16,7 +21,7 @@ pub struct BattleState { pub story_session_id: String, pub runtime_session_id: String, pub actor_user_id: String, - pub chapter_id: Option, + pub chapter_id: Option::, pub target_npc_id: String, pub target_name: String, pub battle_mode: BattleMode, @@ -28,11 +33,11 @@ pub struct BattleState { pub target_hp: i32, pub target_max_hp: i32, pub experience_reward: u32, - pub reward_items: Vec, + pub reward_items: Vec::, pub turn_index: u32, - pub last_action_function_id: Option, - pub last_action_text: Option, - pub last_result_text: Option, + pub last_action_function_id: Option::, + pub last_action_text: Option::, + pub last_result_text: Option::, pub last_damage_dealt: i32, pub last_damage_taken: i32, pub last_outcome: CombatOutcome, @@ -41,10 +46,12 @@ pub struct BattleState { pub updated_at: __sdk::Timestamp, } + impl __sdk::InModule for BattleState { type Module = super::RemoteModule; } + /// Column accessor struct for the table `BattleState`. /// /// Provides typed access to columns for query building. @@ -53,7 +60,7 @@ pub struct BattleStateCols { pub story_session_id: __sdk::__query_builder::Col, pub runtime_session_id: __sdk::__query_builder::Col, pub actor_user_id: __sdk::__query_builder::Col, - pub chapter_id: __sdk::__query_builder::Col>, + pub chapter_id: __sdk::__query_builder::Col>, pub target_npc_id: __sdk::__query_builder::Col, pub target_name: __sdk::__query_builder::Col, pub battle_mode: __sdk::__query_builder::Col, @@ -65,11 +72,11 @@ pub struct BattleStateCols { pub target_hp: __sdk::__query_builder::Col, pub target_max_hp: __sdk::__query_builder::Col, pub experience_reward: __sdk::__query_builder::Col, - pub reward_items: __sdk::__query_builder::Col>, + pub reward_items: __sdk::__query_builder::Col>, pub turn_index: __sdk::__query_builder::Col, - pub last_action_function_id: __sdk::__query_builder::Col>, - pub last_action_text: __sdk::__query_builder::Col>, - pub last_result_text: __sdk::__query_builder::Col>, + pub last_action_function_id: __sdk::__query_builder::Col>, + pub last_action_text: __sdk::__query_builder::Col>, + pub last_result_text: __sdk::__query_builder::Col>, pub last_damage_dealt: __sdk::__query_builder::Col, pub last_damage_taken: __sdk::__query_builder::Col, pub last_outcome: __sdk::__query_builder::Col, @@ -100,10 +107,7 @@ impl __sdk::__query_builder::HasCols for BattleState { experience_reward: __sdk::__query_builder::Col::new(table_name, "experience_reward"), reward_items: __sdk::__query_builder::Col::new(table_name, "reward_items"), turn_index: __sdk::__query_builder::Col::new(table_name, "turn_index"), - last_action_function_id: __sdk::__query_builder::Col::new( - table_name, - "last_action_function_id", - ), + last_action_function_id: __sdk::__query_builder::Col::new(table_name, "last_action_function_id"), 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_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"), created_at: __sdk::__query_builder::Col::new(table_name, "created_at"), updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"), + } } } @@ -132,13 +137,12 @@ impl __sdk::__query_builder::HasIxCols for BattleState { BattleStateIxCols { 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"), - runtime_session_id: __sdk::__query_builder::IxCol::new( - table_name, - "runtime_session_id", - ), + runtime_session_id: __sdk::__query_builder::IxCol::new(table_name, "runtime_session_id"), story_session_id: __sdk::__query_builder::IxCol::new(table_name, "story_session_id"), + } } } impl __sdk::__query_builder::CanBeLookupTable for BattleState {} + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/battle_status_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/battle_status_type.rs index 0aba4f43..e869befe 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/battle_status_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/battle_status_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -13,8 +18,12 @@ pub enum BattleStatus { Resolved, Aborted, + } + + impl __sdk::InModule for BattleStatus { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/begin_story_session_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/begin_story_session_and_return_procedure.rs index eef3de0f..75c19e04 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/begin_story_session_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/begin_story_session_and_return_procedure.rs @@ -2,17 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_procedure_result_type::StorySessionProcedureResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct BeginStorySessionAndReturnArgs { + struct BeginStorySessionAndReturnArgs { pub input: StorySessionInput, } + impl __sdk::InModule for BeginStorySessionAndReturnArgs { type Module = super::RemoteModule; } @@ -22,19 +28,16 @@ impl __sdk::InModule for BeginStorySessionAndReturnArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait begin_story_session_and_return { - fn begin_story_session_and_return(&self, input: StorySessionInput) { - self.begin_story_session_and_return_then(input, |_, _| {}); + fn begin_story_session_and_return(&self, input: StorySessionInput, +) { + self.begin_story_session_and_return_then(input, |_, _| {}); } fn begin_story_session_and_return_then( &self, input: StorySessionInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } @@ -43,17 +46,13 @@ impl begin_story_session_and_return for super::RemoteProcedures { &self, input: StorySessionInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, StorySessionProcedureResult>( - "begin_story_session_and_return", - BeginStorySessionAndReturnArgs { input }, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, StorySessionProcedureResult>( + "begin_story_session_and_return", + BeginStorySessionAndReturnArgs { input, }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/begin_story_session_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/begin_story_session_reducer.rs index 6a082f41..582bb850 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/begin_story_session_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/begin_story_session_reducer.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -14,8 +19,10 @@ pub(super) struct BeginStorySessionArgs { impl From for super::Reducer { fn from(args: BeginStorySessionArgs) -> Self { - Self::BeginStorySession { input: args.input } - } + Self::BeginStorySession { + input: args.input, +} +} } impl __sdk::InModule for BeginStorySessionArgs { @@ -33,8 +40,9 @@ pub trait begin_story_session { /// The reducer will run asynchronously in the future, /// 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. - fn begin_story_session(&self, input: StorySessionInput) -> __sdk::Result<()> { - self.begin_story_session_then(input, |_, _| {}) + fn begin_story_session(&self, input: StorySessionInput, +) -> __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, @@ -62,7 +70,7 @@ impl begin_story_session for super::RemoteReducers { + Send + 'static, ) -> __sdk::Result<()> { - self.imp - .invoke_reducer_with_callback(BeginStorySessionArgs { input }, callback) + self.imp.invoke_reducer_with_callback(BeginStorySessionArgs { input, }, callback) } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/bind_asset_object_to_entity_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/bind_asset_object_to_entity_and_return_procedure.rs index b709d5c2..aebf2217 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/bind_asset_object_to_entity_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/bind_asset_object_to_entity_and_return_procedure.rs @@ -2,17 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_procedure_result_type::AssetEntityBindingProcedureResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct BindAssetObjectToEntityAndReturnArgs { + struct BindAssetObjectToEntityAndReturnArgs { pub input: AssetEntityBindingInput, } + impl __sdk::InModule for BindAssetObjectToEntityAndReturnArgs { type Module = super::RemoteModule; } @@ -22,19 +28,16 @@ impl __sdk::InModule for BindAssetObjectToEntityAndReturnArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait bind_asset_object_to_entity_and_return { - fn bind_asset_object_to_entity_and_return(&self, input: AssetEntityBindingInput) { - self.bind_asset_object_to_entity_and_return_then(input, |_, _| {}); + fn bind_asset_object_to_entity_and_return(&self, input: AssetEntityBindingInput, +) { + self.bind_asset_object_to_entity_and_return_then(input, |_, _| {}); } fn bind_asset_object_to_entity_and_return_then( &self, input: AssetEntityBindingInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } @@ -43,17 +46,13 @@ impl bind_asset_object_to_entity_and_return for super::RemoteProcedures { &self, input: AssetEntityBindingInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, AssetEntityBindingProcedureResult>( - "bind_asset_object_to_entity_and_return", - BindAssetObjectToEntityAndReturnArgs { input }, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, AssetEntityBindingProcedureResult>( + "bind_asset_object_to_entity_and_return", + BindAssetObjectToEntityAndReturnArgs { input, }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/bind_asset_object_to_entity_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/bind_asset_object_to_entity_reducer.rs index b20bc5b2..ca2154f7 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/bind_asset_object_to_entity_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/bind_asset_object_to_entity_reducer.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -14,8 +19,10 @@ pub(super) struct BindAssetObjectToEntityArgs { impl From for super::Reducer { fn from(args: BindAssetObjectToEntityArgs) -> Self { - Self::BindAssetObjectToEntity { input: args.input } - } + Self::BindAssetObjectToEntity { + input: args.input, +} +} } impl __sdk::InModule for BindAssetObjectToEntityArgs { @@ -33,8 +40,9 @@ pub trait bind_asset_object_to_entity { /// The reducer will run asynchronously in the future, /// 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. - fn bind_asset_object_to_entity(&self, input: AssetEntityBindingInput) -> __sdk::Result<()> { - self.bind_asset_object_to_entity_then(input, |_, _| {}) + fn bind_asset_object_to_entity(&self, input: AssetEntityBindingInput, +) -> __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, @@ -62,7 +70,7 @@ impl bind_asset_object_to_entity for super::RemoteReducers { + Send + 'static, ) -> __sdk::Result<()> { - self.imp - .invoke_reducer_with_callback(BindAssetObjectToEntityArgs { input }, callback) + self.imp.invoke_reducer_with_callback(BindAssetObjectToEntityArgs { input, }, callback) } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/cancel_ai_task_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/cancel_ai_task_and_return_procedure.rs index b239e060..1a4a6394 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/cancel_ai_task_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/cancel_ai_task_and_return_procedure.rs @@ -2,17 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_cancel_input_type::AiTaskCancelInput; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct CancelAiTaskAndReturnArgs { + struct CancelAiTaskAndReturnArgs { pub input: AiTaskCancelInput, } + impl __sdk::InModule for CancelAiTaskAndReturnArgs { type Module = super::RemoteModule; } @@ -22,19 +28,16 @@ impl __sdk::InModule for CancelAiTaskAndReturnArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait cancel_ai_task_and_return { - fn cancel_ai_task_and_return(&self, input: AiTaskCancelInput) { - self.cancel_ai_task_and_return_then(input, |_, _| {}); + fn cancel_ai_task_and_return(&self, input: AiTaskCancelInput, +) { + self.cancel_ai_task_and_return_then(input, |_, _| {}); } fn cancel_ai_task_and_return_then( &self, input: AiTaskCancelInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } @@ -43,17 +46,13 @@ impl cancel_ai_task_and_return for super::RemoteProcedures { &self, input: AiTaskCancelInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, AiTaskProcedureResult>( - "cancel_ai_task_and_return", - CancelAiTaskAndReturnArgs { input }, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, AiTaskProcedureResult>( + "cancel_ai_task_and_return", + CancelAiTaskAndReturnArgs { input, }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/chapter_pace_band_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/chapter_pace_band_type.rs index effbeb9d..fe7d5e3a 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/chapter_pace_band_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/chapter_pace_band_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -15,8 +20,12 @@ pub enum ChapterPaceBand { Pressure, FinaleDense, + } + + impl __sdk::InModule for ChapterPaceBand { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/chapter_progression_get_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/chapter_progression_get_input_type.rs index 927a4b04..cc88d00b 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/chapter_progression_get_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/chapter_progression_get_input_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -11,6 +17,8 @@ pub struct ChapterProgressionGetInput { pub chapter_id: String, } + impl __sdk::InModule for ChapterProgressionGetInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/chapter_progression_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/chapter_progression_input_type.rs index dae51fa0..ed9aa5ca 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/chapter_progression_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/chapter_progression_input_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -26,6 +31,8 @@ pub struct ChapterProgressionInput { pub updated_at_micros: i64, } + impl __sdk::InModule for ChapterProgressionInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/chapter_progression_ledger_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/chapter_progression_ledger_input_type.rs index a599ffc9..a9e0a8c3 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/chapter_progression_ledger_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/chapter_progression_ledger_input_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -12,10 +18,12 @@ pub struct ChapterProgressionLedgerInput { pub granted_quest_xp: u32, pub granted_hostile_xp: u32, pub hostile_defeat_increment: u32, - pub level_at_exit: Option, + pub level_at_exit: Option::, pub updated_at_micros: i64, } + impl __sdk::InModule for ChapterProgressionLedgerInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/chapter_progression_procedure_result_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/chapter_progression_procedure_result_type.rs index 276b3a26..6a7d01af 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/chapter_progression_procedure_result_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/chapter_progression_procedure_result_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -10,10 +15,12 @@ use super::chapter_progression_snapshot_type::ChapterProgressionSnapshot; #[sats(crate = __lib)] pub struct ChapterProgressionProcedureResult { pub ok: bool, - pub record: Option, - pub error_message: Option, + pub record: Option::, + pub error_message: Option::, } + impl __sdk::InModule for ChapterProgressionProcedureResult { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/chapter_progression_snapshot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/chapter_progression_snapshot_type.rs index e1fde7fe..d1eaad92 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/chapter_progression_snapshot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/chapter_progression_snapshot_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -25,12 +30,14 @@ pub struct ChapterProgressionSnapshot { pub expected_hostile_defeat_count: u32, pub actual_hostile_defeat_count: u32, pub level_at_entry: u32, - pub level_at_exit: Option, + pub level_at_exit: Option::, pub pace_band: ChapterPaceBand, pub created_at_micros: i64, pub updated_at_micros: i64, } + impl __sdk::InModule for ChapterProgressionSnapshot { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/chapter_progression_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/chapter_progression_table.rs index 2fb6c042..5bd5c38c 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/chapter_progression_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/chapter_progression_table.rs @@ -2,9 +2,14 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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 spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; +use super::chapter_pace_band_type::ChapterPaceBand; /// Table handle for the table `chapter_progression`. /// @@ -32,9 +37,7 @@ pub trait ChapterProgressionTableAccess { impl ChapterProgressionTableAccess for super::RemoteTables { fn chapter_progression(&self) -> ChapterProgressionTableHandle<'_> { ChapterProgressionTableHandle { - imp: self - .imp - .get_table::("chapter_progression"), + imp: self.imp.get_table::("chapter_progression"), ctx: std::marker::PhantomData, } } @@ -47,12 +50,8 @@ impl<'ctx> __sdk::Table for ChapterProgressionTableHandle<'ctx> { type Row = ChapterProgression; type EventContext = super::EventContext; - fn count(&self) -> u64 { - self.imp.count() - } - fn iter(&self) -> impl Iterator + '_ { - self.imp.iter() - } + fn count(&self) -> u64 { self.imp.count() } + fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } 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`, -/// which allows point queries on the field of the same name -/// via the [`ChapterProgressionChapterProgressionIdUnique::find`] method. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.chapter_progression().chapter_progression_id().find(...)`. -pub struct ChapterProgressionChapterProgressionIdUnique<'ctx> { - imp: __sdk::UniqueConstraintHandle, - 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::("chapter_progression_id"), - phantom: std::marker::PhantomData, + /// Access to the `chapter_progression_id` unique index on the table `chapter_progression`, + /// which allows point queries on the field of the same name + /// via the [`ChapterProgressionChapterProgressionIdUnique::find`] method. + /// + /// Users are encouraged not to explicitly reference this type, + /// but to directly chain method calls, + /// like `ctx.db.chapter_progression().chapter_progression_id().find(...)`. + pub struct ChapterProgressionChapterProgressionIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } - } -} -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 { - self.imp.find(col_val) - } -} + 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::("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 { + self.imp.find(col_val) + } + } + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("chapter_progression"); - _table.add_unique_constraint::("chapter_progression_id", |row| { - &row.chapter_progression_id - }); + _table.add_unique_constraint::("chapter_progression_id", |row| &row.chapter_progression_id); } #[doc(hidden)] @@ -143,24 +139,26 @@ pub(super) fn parse_table_update( raw_updates: __ws::v2::TableUpdate, ) -> __sdk::Result<__sdk::TableUpdate> { __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { - __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") - .with_cause(e) - .into() + __sdk::InternalError::failed_parse( + "TableUpdate", + "TableUpdate", + ).with_cause(e).into() }) } -#[allow(non_camel_case_types)] -/// Extension trait for query builder access to the table `ChapterProgression`. -/// -/// Implemented for [`__sdk::QueryTableAccessor`]. -pub trait chapter_progressionQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `ChapterProgression`. - fn chapter_progression(&self) -> __sdk::__query_builder::Table; -} + #[allow(non_camel_case_types)] + /// Extension trait for query builder access to the table `ChapterProgression`. + /// + /// Implemented for [`__sdk::QueryTableAccessor`]. + pub trait chapter_progressionQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `ChapterProgression`. + fn chapter_progression(&self) -> __sdk::__query_builder::Table; + } + + impl chapter_progressionQueryTableAccess for __sdk::QueryTableAccessor { + fn chapter_progression(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("chapter_progression") + } + } -impl chapter_progressionQueryTableAccess for __sdk::QueryTableAccessor { - fn chapter_progression(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("chapter_progression") - } -} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/chapter_progression_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/chapter_progression_type.rs index c94a7196..c5600eb7 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/chapter_progression_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/chapter_progression_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -26,16 +31,18 @@ pub struct ChapterProgression { pub expected_hostile_defeat_count: u32, pub actual_hostile_defeat_count: u32, pub level_at_entry: u32, - pub level_at_exit: Option, + pub level_at_exit: Option::, pub pace_band: ChapterPaceBand, pub created_at: __sdk::Timestamp, pub updated_at: __sdk::Timestamp, } + impl __sdk::InModule for ChapterProgression { type Module = super::RemoteModule; } + /// Column accessor struct for the table `ChapterProgression`. /// /// Provides typed access to columns for query building. @@ -57,7 +64,7 @@ pub struct ChapterProgressionCols { pub expected_hostile_defeat_count: __sdk::__query_builder::Col, pub actual_hostile_defeat_count: __sdk::__query_builder::Col, pub level_at_entry: __sdk::__query_builder::Col, - pub level_at_exit: __sdk::__query_builder::Col>, + pub level_at_exit: __sdk::__query_builder::Col>, pub pace_band: __sdk::__query_builder::Col, pub created_at: __sdk::__query_builder::Col, pub updated_at: __sdk::__query_builder::Col, @@ -67,22 +74,13 @@ impl __sdk::__query_builder::HasCols for ChapterProgression { type Cols = ChapterProgressionCols; fn cols(table_name: &'static str) -> Self::Cols { ChapterProgressionCols { - chapter_progression_id: __sdk::__query_builder::Col::new( - table_name, - "chapter_progression_id", - ), + chapter_progression_id: __sdk::__query_builder::Col::new(table_name, "chapter_progression_id"), user_id: __sdk::__query_builder::Col::new(table_name, "user_id"), chapter_id: __sdk::__query_builder::Col::new(table_name, "chapter_id"), chapter_index: __sdk::__query_builder::Col::new(table_name, "chapter_index"), total_chapters: __sdk::__query_builder::Col::new(table_name, "total_chapters"), - entry_pseudo_level_millis: __sdk::__query_builder::Col::new( - table_name, - "entry_pseudo_level_millis", - ), - exit_pseudo_level_millis: __sdk::__query_builder::Col::new( - table_name, - "exit_pseudo_level_millis", - ), + entry_pseudo_level_millis: __sdk::__query_builder::Col::new(table_name, "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"), exit_level: __sdk::__query_builder::Col::new(table_name, "exit_level"), 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"), 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"), - expected_hostile_defeat_count: __sdk::__query_builder::Col::new( - table_name, - "expected_hostile_defeat_count", - ), - actual_hostile_defeat_count: __sdk::__query_builder::Col::new( - table_name, - "actual_hostile_defeat_count", - ), + expected_hostile_defeat_count: __sdk::__query_builder::Col::new(table_name, "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_exit: __sdk::__query_builder::Col::new(table_name, "level_at_exit"), pace_band: __sdk::__query_builder::Col::new(table_name, "pace_band"), created_at: __sdk::__query_builder::Col::new(table_name, "created_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 { ChapterProgressionIxCols { chapter_id: __sdk::__query_builder::IxCol::new(table_name, "chapter_id"), - chapter_progression_id: __sdk::__query_builder::IxCol::new( - table_name, - "chapter_progression_id", - ), + chapter_progression_id: __sdk::__query_builder::IxCol::new(table_name, "chapter_progression_id"), user_id: __sdk::__query_builder::IxCol::new(table_name, "user_id"), + } } } impl __sdk::__query_builder::CanBeLookupTable for ChapterProgression {} + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/clear_platform_browse_history_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/clear_platform_browse_history_and_return_procedure.rs index 2e623845..5b9a2c9e 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/clear_platform_browse_history_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/clear_platform_browse_history_and_return_procedure.rs @@ -2,17 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_procedure_result_type::RuntimeBrowseHistoryProcedureResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct ClearPlatformBrowseHistoryAndReturnArgs { + struct ClearPlatformBrowseHistoryAndReturnArgs { pub input: RuntimeBrowseHistoryClearInput, } + impl __sdk::InModule for ClearPlatformBrowseHistoryAndReturnArgs { type Module = super::RemoteModule; } @@ -22,19 +28,16 @@ impl __sdk::InModule for ClearPlatformBrowseHistoryAndReturnArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait clear_platform_browse_history_and_return { - fn clear_platform_browse_history_and_return(&self, input: RuntimeBrowseHistoryClearInput) { - self.clear_platform_browse_history_and_return_then(input, |_, _| {}); + fn clear_platform_browse_history_and_return(&self, input: RuntimeBrowseHistoryClearInput, +) { + self.clear_platform_browse_history_and_return_then(input, |_, _| {}); } fn clear_platform_browse_history_and_return_then( &self, input: RuntimeBrowseHistoryClearInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } @@ -43,17 +46,13 @@ impl clear_platform_browse_history_and_return for super::RemoteProcedures { &self, input: RuntimeBrowseHistoryClearInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, RuntimeBrowseHistoryProcedureResult>( - "clear_platform_browse_history_and_return", - ClearPlatformBrowseHistoryAndReturnArgs { input }, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, RuntimeBrowseHistoryProcedureResult>( + "clear_platform_browse_history_and_return", + ClearPlatformBrowseHistoryAndReturnArgs { input, }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/combat_outcome_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/combat_outcome_type.rs index 731563dd..5ef77940 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/combat_outcome_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/combat_outcome_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -15,8 +20,12 @@ pub enum CombatOutcome { SparComplete, Escaped, + } + + impl __sdk::InModule for CombatOutcome { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/compile_custom_world_published_profile_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/compile_custom_world_published_profile_procedure.rs index aefbe602..767a3954 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/compile_custom_world_published_profile_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/compile_custom_world_published_profile_procedure.rs @@ -2,17 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_result_type::CustomWorldPublishedProfileCompileResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct CompileCustomWorldPublishedProfileArgs { + struct CompileCustomWorldPublishedProfileArgs { pub input: CustomWorldPublishedProfileCompileInput, } + impl __sdk::InModule for CompileCustomWorldPublishedProfileArgs { type Module = super::RemoteModule; } @@ -22,22 +28,16 @@ impl __sdk::InModule for CompileCustomWorldPublishedProfileArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait compile_custom_world_published_profile { - fn compile_custom_world_published_profile( - &self, - input: CustomWorldPublishedProfileCompileInput, - ) { - self.compile_custom_world_published_profile_then(input, |_, _| {}); + fn compile_custom_world_published_profile(&self, input: CustomWorldPublishedProfileCompileInput, +) { + self.compile_custom_world_published_profile_then(input, |_, _| {}); } fn compile_custom_world_published_profile_then( &self, input: CustomWorldPublishedProfileCompileInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } @@ -46,17 +46,13 @@ impl compile_custom_world_published_profile for super::RemoteProcedures { &self, input: CustomWorldPublishedProfileCompileInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, CustomWorldPublishedProfileCompileResult>( - "compile_custom_world_published_profile", - CompileCustomWorldPublishedProfileArgs { input }, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, CustomWorldPublishedProfileCompileResult>( + "compile_custom_world_published_profile", + CompileCustomWorldPublishedProfileArgs { input, }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/complete_ai_stage_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/complete_ai_stage_and_return_procedure.rs index 51375935..f921c224 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/complete_ai_stage_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/complete_ai_stage_and_return_procedure.rs @@ -2,17 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_stage_completion_input_type::AiStageCompletionInput; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct CompleteAiStageAndReturnArgs { + struct CompleteAiStageAndReturnArgs { pub input: AiStageCompletionInput, } + impl __sdk::InModule for CompleteAiStageAndReturnArgs { type Module = super::RemoteModule; } @@ -22,19 +28,16 @@ impl __sdk::InModule for CompleteAiStageAndReturnArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait complete_ai_stage_and_return { - fn complete_ai_stage_and_return(&self, input: AiStageCompletionInput) { - self.complete_ai_stage_and_return_then(input, |_, _| {}); + fn complete_ai_stage_and_return(&self, input: AiStageCompletionInput, +) { + self.complete_ai_stage_and_return_then(input, |_, _| {}); } fn complete_ai_stage_and_return_then( &self, input: AiStageCompletionInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } @@ -43,17 +46,13 @@ impl complete_ai_stage_and_return for super::RemoteProcedures { &self, input: AiStageCompletionInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, AiTaskProcedureResult>( - "complete_ai_stage_and_return", - CompleteAiStageAndReturnArgs { input }, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, AiTaskProcedureResult>( + "complete_ai_stage_and_return", + CompleteAiStageAndReturnArgs { input, }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/complete_ai_task_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/complete_ai_task_and_return_procedure.rs index 040af639..47ae2af1 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/complete_ai_task_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/complete_ai_task_and_return_procedure.rs @@ -2,17 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_finish_input_type::AiTaskFinishInput; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct CompleteAiTaskAndReturnArgs { + struct CompleteAiTaskAndReturnArgs { pub input: AiTaskFinishInput, } + impl __sdk::InModule for CompleteAiTaskAndReturnArgs { type Module = super::RemoteModule; } @@ -22,19 +28,16 @@ impl __sdk::InModule for CompleteAiTaskAndReturnArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait complete_ai_task_and_return { - fn complete_ai_task_and_return(&self, input: AiTaskFinishInput) { - self.complete_ai_task_and_return_then(input, |_, _| {}); + fn complete_ai_task_and_return(&self, input: AiTaskFinishInput, +) { + self.complete_ai_task_and_return_then(input, |_, _| {}); } fn complete_ai_task_and_return_then( &self, input: AiTaskFinishInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } @@ -43,17 +46,13 @@ impl complete_ai_task_and_return for super::RemoteProcedures { &self, input: AiTaskFinishInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, AiTaskProcedureResult>( - "complete_ai_task_and_return", - CompleteAiTaskAndReturnArgs { input }, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, AiTaskProcedureResult>( + "complete_ai_task_and_return", + CompleteAiTaskAndReturnArgs { input, }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/confirm_asset_object_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/confirm_asset_object_and_return_procedure.rs index 0b4f26b2..11c079e4 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/confirm_asset_object_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/confirm_asset_object_and_return_procedure.rs @@ -2,17 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_procedure_result_type::AssetObjectProcedureResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct ConfirmAssetObjectAndReturnArgs { + struct ConfirmAssetObjectAndReturnArgs { pub input: AssetObjectUpsertInput, } + impl __sdk::InModule for ConfirmAssetObjectAndReturnArgs { type Module = super::RemoteModule; } @@ -22,19 +28,16 @@ impl __sdk::InModule for ConfirmAssetObjectAndReturnArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait confirm_asset_object_and_return { - fn confirm_asset_object_and_return(&self, input: AssetObjectUpsertInput) { - self.confirm_asset_object_and_return_then(input, |_, _| {}); + fn confirm_asset_object_and_return(&self, input: AssetObjectUpsertInput, +) { + self.confirm_asset_object_and_return_then(input, |_, _| {}); } fn confirm_asset_object_and_return_then( &self, input: AssetObjectUpsertInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } @@ -43,17 +46,13 @@ impl confirm_asset_object_and_return for super::RemoteProcedures { &self, input: AssetObjectUpsertInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, AssetObjectProcedureResult>( - "confirm_asset_object_and_return", - ConfirmAssetObjectAndReturnArgs { input }, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, AssetObjectProcedureResult>( + "confirm_asset_object_and_return", + ConfirmAssetObjectAndReturnArgs { input, }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/confirm_asset_object_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/confirm_asset_object_reducer.rs index 183c2efa..fb6acde2 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/confirm_asset_object_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/confirm_asset_object_reducer.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -14,8 +19,10 @@ pub(super) struct ConfirmAssetObjectArgs { impl From for super::Reducer { fn from(args: ConfirmAssetObjectArgs) -> Self { - Self::ConfirmAssetObject { input: args.input } - } + Self::ConfirmAssetObject { + input: args.input, +} +} } impl __sdk::InModule for ConfirmAssetObjectArgs { @@ -33,8 +40,9 @@ pub trait confirm_asset_object { /// The reducer will run asynchronously in the future, /// 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. - fn confirm_asset_object(&self, input: AssetObjectUpsertInput) -> __sdk::Result<()> { - self.confirm_asset_object_then(input, |_, _| {}) + fn confirm_asset_object(&self, input: AssetObjectUpsertInput, +) -> __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, @@ -62,7 +70,7 @@ impl confirm_asset_object for super::RemoteReducers { + Send + 'static, ) -> __sdk::Result<()> { - self.imp - .invoke_reducer_with_callback(ConfirmAssetObjectArgs { input }, callback) + self.imp.invoke_reducer_with_callback(ConfirmAssetObjectArgs { input, }, callback) } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/consume_inventory_item_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/consume_inventory_item_input_type.rs index 0e867e21..3bd69ba8 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/consume_inventory_item_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/consume_inventory_item_input_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -11,6 +17,8 @@ pub struct ConsumeInventoryItemInput { pub quantity: u32, } + impl __sdk::InModule for ConsumeInventoryItemInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/continue_story_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/continue_story_and_return_procedure.rs index 0d58ec1b..0713f423 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/continue_story_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/continue_story_and_return_procedure.rs @@ -2,17 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_continue_input_type::StoryContinueInput; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct ContinueStoryAndReturnArgs { + struct ContinueStoryAndReturnArgs { pub input: StoryContinueInput, } + impl __sdk::InModule for ContinueStoryAndReturnArgs { type Module = super::RemoteModule; } @@ -22,19 +28,16 @@ impl __sdk::InModule for ContinueStoryAndReturnArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait continue_story_and_return { - fn continue_story_and_return(&self, input: StoryContinueInput) { - self.continue_story_and_return_then(input, |_, _| {}); + fn continue_story_and_return(&self, input: StoryContinueInput, +) { + self.continue_story_and_return_then(input, |_, _| {}); } fn continue_story_and_return_then( &self, input: StoryContinueInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } @@ -43,17 +46,13 @@ impl continue_story_and_return for super::RemoteProcedures { &self, input: StoryContinueInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, StorySessionProcedureResult>( - "continue_story_and_return", - ContinueStoryAndReturnArgs { input }, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, StorySessionProcedureResult>( + "continue_story_and_return", + ContinueStoryAndReturnArgs { input, }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/continue_story_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/continue_story_reducer.rs index 4117cfae..9c2b310a 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/continue_story_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/continue_story_reducer.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -14,8 +19,10 @@ pub(super) struct ContinueStoryArgs { impl From for super::Reducer { fn from(args: ContinueStoryArgs) -> Self { - Self::ContinueStory { input: args.input } - } + Self::ContinueStory { + input: args.input, +} +} } impl __sdk::InModule for ContinueStoryArgs { @@ -33,8 +40,9 @@ pub trait continue_story { /// The reducer will run asynchronously in the future, /// 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. - fn continue_story(&self, input: StoryContinueInput) -> __sdk::Result<()> { - self.continue_story_then(input, |_, _| {}) + fn continue_story(&self, input: StoryContinueInput, +) -> __sdk::Result<()> { + self.continue_story_then(input, |_, _| {}) } /// 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 + 'static, ) -> __sdk::Result<()> { - self.imp - .invoke_reducer_with_callback(ContinueStoryArgs { input }, callback) + self.imp.invoke_reducer_with_callback(ContinueStoryArgs { input, }, callback) } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/create_ai_task_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/create_ai_task_and_return_procedure.rs index 20d8ceee..cee9ffd8 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/create_ai_task_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/create_ai_task_and_return_procedure.rs @@ -2,17 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_create_input_type::AiTaskCreateInput; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct CreateAiTaskAndReturnArgs { + struct CreateAiTaskAndReturnArgs { pub input: AiTaskCreateInput, } + impl __sdk::InModule for CreateAiTaskAndReturnArgs { type Module = super::RemoteModule; } @@ -22,19 +28,16 @@ impl __sdk::InModule for CreateAiTaskAndReturnArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait create_ai_task_and_return { - fn create_ai_task_and_return(&self, input: AiTaskCreateInput) { - self.create_ai_task_and_return_then(input, |_, _| {}); + fn create_ai_task_and_return(&self, input: AiTaskCreateInput, +) { + self.create_ai_task_and_return_then(input, |_, _| {}); } fn create_ai_task_and_return_then( &self, input: AiTaskCreateInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } @@ -43,17 +46,13 @@ impl create_ai_task_and_return for super::RemoteProcedures { &self, input: AiTaskCreateInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, AiTaskProcedureResult>( - "create_ai_task_and_return", - CreateAiTaskAndReturnArgs { input }, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, AiTaskProcedureResult>( + "create_ai_task_and_return", + CreateAiTaskAndReturnArgs { input, }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/create_ai_task_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/create_ai_task_reducer.rs index 213f28e5..d57e7291 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/create_ai_task_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/create_ai_task_reducer.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -14,8 +19,10 @@ pub(super) struct CreateAiTaskArgs { impl From for super::Reducer { fn from(args: CreateAiTaskArgs) -> Self { - Self::CreateAiTask { input: args.input } - } + Self::CreateAiTask { + input: args.input, +} +} } impl __sdk::InModule for CreateAiTaskArgs { @@ -33,8 +40,9 @@ pub trait create_ai_task { /// The reducer will run asynchronously in the future, /// 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. - fn create_ai_task(&self, input: AiTaskCreateInput) -> __sdk::Result<()> { - self.create_ai_task_then(input, |_, _| {}) + fn create_ai_task(&self, input: AiTaskCreateInput, +) -> __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, @@ -62,7 +70,7 @@ impl create_ai_task for super::RemoteReducers { + Send + 'static, ) -> __sdk::Result<()> { - self.imp - .invoke_reducer_with_callback(CreateAiTaskArgs { input }, callback) + self.imp.invoke_reducer_with_callback(CreateAiTaskArgs { input, }, callback) } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/create_battle_state_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/create_battle_state_and_return_procedure.rs index ef11107a..bfee133e 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/create_battle_state_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/create_battle_state_and_return_procedure.rs @@ -2,17 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_procedure_result_type::BattleStateProcedureResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct CreateBattleStateAndReturnArgs { + struct CreateBattleStateAndReturnArgs { pub input: BattleStateInput, } + impl __sdk::InModule for CreateBattleStateAndReturnArgs { type Module = super::RemoteModule; } @@ -22,19 +28,16 @@ impl __sdk::InModule for CreateBattleStateAndReturnArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait create_battle_state_and_return { - fn create_battle_state_and_return(&self, input: BattleStateInput) { - self.create_battle_state_and_return_then(input, |_, _| {}); + fn create_battle_state_and_return(&self, input: BattleStateInput, +) { + self.create_battle_state_and_return_then(input, |_, _| {}); } fn create_battle_state_and_return_then( &self, input: BattleStateInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } @@ -43,17 +46,13 @@ impl create_battle_state_and_return for super::RemoteProcedures { &self, input: BattleStateInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, BattleStateProcedureResult>( - "create_battle_state_and_return", - CreateBattleStateAndReturnArgs { input }, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, BattleStateProcedureResult>( + "create_battle_state_and_return", + CreateBattleStateAndReturnArgs { input, }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/create_battle_state_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/create_battle_state_reducer.rs index 1072f8a5..258d5af2 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/create_battle_state_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/create_battle_state_reducer.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -14,8 +19,10 @@ pub(super) struct CreateBattleStateArgs { impl From for super::Reducer { fn from(args: CreateBattleStateArgs) -> Self { - Self::CreateBattleState { input: args.input } - } + Self::CreateBattleState { + input: args.input, +} +} } impl __sdk::InModule for CreateBattleStateArgs { @@ -33,8 +40,9 @@ pub trait create_battle_state { /// The reducer will run asynchronously in the future, /// 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. - fn create_battle_state(&self, input: BattleStateInput) -> __sdk::Result<()> { - self.create_battle_state_then(input, |_, _| {}) + fn create_battle_state(&self, input: BattleStateInput, +) -> __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, @@ -62,7 +70,7 @@ impl create_battle_state for super::RemoteReducers { + Send + 'static, ) -> __sdk::Result<()> { - self.imp - .invoke_reducer_with_callback(CreateBattleStateArgs { input }, callback) + self.imp.invoke_reducer_with_callback(CreateBattleStateArgs { input, }, callback) } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/create_custom_world_agent_session_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/create_custom_world_agent_session_procedure.rs index 6a08bcc7..18065e71 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/create_custom_world_agent_session_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/create_custom_world_agent_session_procedure.rs @@ -2,17 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_procedure_result_type::CustomWorldAgentSessionProcedureResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct CreateCustomWorldAgentSessionArgs { + struct CreateCustomWorldAgentSessionArgs { pub input: CustomWorldAgentSessionCreateInput, } + impl __sdk::InModule for CreateCustomWorldAgentSessionArgs { type Module = super::RemoteModule; } @@ -22,19 +28,16 @@ impl __sdk::InModule for CreateCustomWorldAgentSessionArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait create_custom_world_agent_session { - fn create_custom_world_agent_session(&self, input: CustomWorldAgentSessionCreateInput) { - self.create_custom_world_agent_session_then(input, |_, _| {}); + fn create_custom_world_agent_session(&self, input: CustomWorldAgentSessionCreateInput, +) { + self.create_custom_world_agent_session_then(input, |_, _| {}); } fn create_custom_world_agent_session_then( &self, input: CustomWorldAgentSessionCreateInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } @@ -43,17 +46,13 @@ impl create_custom_world_agent_session for super::RemoteProcedures { &self, input: CustomWorldAgentSessionCreateInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, CustomWorldAgentSessionProcedureResult>( - "create_custom_world_agent_session", - CreateCustomWorldAgentSessionArgs { input }, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, CustomWorldAgentSessionProcedureResult>( + "create_custom_world_agent_session", + CreateCustomWorldAgentSessionArgs { input, }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_message_snapshot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_message_snapshot_type.rs index 69368214..e57b9839 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_message_snapshot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_message_snapshot_type.rs @@ -2,10 +2,15 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_kind_type::RpgAgentMessageKind; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] @@ -15,10 +20,12 @@ pub struct CustomWorldAgentMessageSnapshot { pub role: RpgAgentMessageRole, pub kind: RpgAgentMessageKind, pub text: String, - pub related_operation_id: Option, + pub related_operation_id: Option::, pub created_at_micros: i64, } + impl __sdk::InModule for CustomWorldAgentMessageSnapshot { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_message_submit_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_message_submit_input_type.rs index cf3a4230..bc2da116 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_message_submit_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_message_submit_input_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -15,6 +21,8 @@ pub struct CustomWorldAgentMessageSubmitInput { pub submitted_at_micros: i64, } + impl __sdk::InModule for CustomWorldAgentMessageSubmitInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_message_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_message_table.rs index 1d0886e7..12cae6f1 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_message_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_message_table.rs @@ -2,10 +2,15 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![allow(unused, clippy::all)] +use spacetimedb_sdk::__codegen::{ + self as __sdk, + __lib, + __sats, + __ws, +}; 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 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`. /// @@ -33,9 +38,7 @@ pub trait CustomWorldAgentMessageTableAccess { impl CustomWorldAgentMessageTableAccess for super::RemoteTables { fn custom_world_agent_message(&self) -> CustomWorldAgentMessageTableHandle<'_> { CustomWorldAgentMessageTableHandle { - imp: self - .imp - .get_table::("custom_world_agent_message"), + imp: self.imp.get_table::("custom_world_agent_message"), ctx: std::marker::PhantomData, } } @@ -48,12 +51,8 @@ impl<'ctx> __sdk::Table for CustomWorldAgentMessageTableHandle<'ctx> { type Row = CustomWorldAgentMessage; type EventContext = super::EventContext; - fn count(&self) -> u64 { - self.imp.count() - } - fn iter(&self) -> impl Iterator + '_ { - self.imp.iter() - } + fn count(&self) -> u64 { self.imp.count() } + fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } 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`, -/// which allows point queries on the field of the same name -/// via the [`CustomWorldAgentMessageMessageIdUnique::find`] method. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.custom_world_agent_message().message_id().find(...)`. -pub struct CustomWorldAgentMessageMessageIdUnique<'ctx> { - imp: __sdk::UniqueConstraintHandle, - 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::("message_id"), - phantom: std::marker::PhantomData, + /// 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 + /// via the [`CustomWorldAgentMessageMessageIdUnique::find`] method. + /// + /// Users are encouraged not to explicitly reference this type, + /// but to directly chain method calls, + /// like `ctx.db.custom_world_agent_message().message_id().find(...)`. + pub struct CustomWorldAgentMessageMessageIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } - } -} -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 { - self.imp.find(col_val) - } -} + 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::("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 { + self.imp.find(col_val) + } + } + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { - let _table = - client_cache.get_or_make_table::("custom_world_agent_message"); + + let _table = client_cache.get_or_make_table::("custom_world_agent_message"); _table.add_unique_constraint::("message_id", |row| &row.message_id); } @@ -141,24 +140,26 @@ pub(super) fn parse_table_update( raw_updates: __ws::v2::TableUpdate, ) -> __sdk::Result<__sdk::TableUpdate> { __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { - __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") - .with_cause(e) - .into() + __sdk::InternalError::failed_parse( + "TableUpdate", + "TableUpdate", + ).with_cause(e).into() }) } -#[allow(non_camel_case_types)] -/// Extension trait for query builder access to the table `CustomWorldAgentMessage`. -/// -/// Implemented for [`__sdk::QueryTableAccessor`]. -pub trait custom_world_agent_messageQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `CustomWorldAgentMessage`. - fn custom_world_agent_message(&self) -> __sdk::__query_builder::Table; -} + #[allow(non_camel_case_types)] + /// Extension trait for query builder access to the table `CustomWorldAgentMessage`. + /// + /// Implemented for [`__sdk::QueryTableAccessor`]. + pub trait custom_world_agent_messageQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `CustomWorldAgentMessage`. + fn custom_world_agent_message(&self) -> __sdk::__query_builder::Table; + } + + impl custom_world_agent_messageQueryTableAccess for __sdk::QueryTableAccessor { + fn custom_world_agent_message(&self) -> __sdk::__query_builder::Table { + __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 { - __sdk::__query_builder::Table::new("custom_world_agent_message") - } -} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_message_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_message_type.rs index 75110860..e33b5c4a 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_message_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_message_type.rs @@ -2,10 +2,15 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_kind_type::RpgAgentMessageKind; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] @@ -15,14 +20,16 @@ pub struct CustomWorldAgentMessage { pub role: RpgAgentMessageRole, pub kind: RpgAgentMessageKind, pub text: String, - pub related_operation_id: Option, + pub related_operation_id: Option::, pub created_at: __sdk::Timestamp, } + impl __sdk::InModule for CustomWorldAgentMessage { type Module = super::RemoteModule; } + /// Column accessor struct for the table `CustomWorldAgentMessage`. /// /// Provides typed access to columns for query building. @@ -32,7 +39,7 @@ pub struct CustomWorldAgentMessageCols { pub role: __sdk::__query_builder::Col, pub kind: __sdk::__query_builder::Col, pub text: __sdk::__query_builder::Col, - pub related_operation_id: __sdk::__query_builder::Col>, + pub related_operation_id: __sdk::__query_builder::Col>, pub created_at: __sdk::__query_builder::Col, } @@ -45,11 +52,9 @@ impl __sdk::__query_builder::HasCols for CustomWorldAgentMessage { role: __sdk::__query_builder::Col::new(table_name, "role"), kind: __sdk::__query_builder::Col::new(table_name, "kind"), text: __sdk::__query_builder::Col::new(table_name, "text"), - related_operation_id: __sdk::__query_builder::Col::new( - table_name, - "related_operation_id", - ), + related_operation_id: __sdk::__query_builder::Col::new(table_name, "related_operation_id"), created_at: __sdk::__query_builder::Col::new(table_name, "created_at"), + } } } @@ -68,8 +73,10 @@ impl __sdk::__query_builder::HasIxCols for CustomWorldAgentMessage { CustomWorldAgentMessageIxCols { message_id: __sdk::__query_builder::IxCol::new(table_name, "message_id"), session_id: __sdk::__query_builder::IxCol::new(table_name, "session_id"), + } } } impl __sdk::__query_builder::CanBeLookupTable for CustomWorldAgentMessage {} + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_operation_get_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_operation_get_input_type.rs index 1e249edf..2aa3b05b 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_operation_get_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_operation_get_input_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -12,6 +18,8 @@ pub struct CustomWorldAgentOperationGetInput { pub operation_id: String, } + impl __sdk::InModule for CustomWorldAgentOperationGetInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_operation_procedure_result_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_operation_procedure_result_type.rs index 39d0e493..f9bf13da 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_operation_procedure_result_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_operation_procedure_result_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -10,10 +15,12 @@ use super::custom_world_agent_operation_snapshot_type::CustomWorldAgentOperation #[sats(crate = __lib)] pub struct CustomWorldAgentOperationProcedureResult { pub ok: bool, - pub operation: Option, - pub error_message: Option, + pub operation: Option::, + pub error_message: Option::, } + impl __sdk::InModule for CustomWorldAgentOperationProcedureResult { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_operation_snapshot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_operation_snapshot_type.rs index 61e86eb3..954a809c 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_operation_snapshot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_operation_snapshot_type.rs @@ -2,10 +2,15 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_operation_status_type::RpgAgentOperationStatus; use super::rpg_agent_operation_type_type::RpgAgentOperationType; +use super::rpg_agent_operation_status_type::RpgAgentOperationStatus; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] @@ -17,11 +22,13 @@ pub struct CustomWorldAgentOperationSnapshot { pub phase_label: String, pub phase_detail: String, pub progress: u32, - pub error_message: Option, + pub error_message: Option::, pub created_at_micros: i64, pub updated_at_micros: i64, } + impl __sdk::InModule for CustomWorldAgentOperationSnapshot { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_operation_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_operation_table.rs index 316a95b1..7e6b6b11 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_operation_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_operation_table.rs @@ -2,10 +2,15 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![allow(unused, clippy::all)] +use spacetimedb_sdk::__codegen::{ + self as __sdk, + __lib, + __sats, + __ws, +}; use super::custom_world_agent_operation_type::CustomWorldAgentOperation; -use super::rpg_agent_operation_status_type::RpgAgentOperationStatus; use super::rpg_agent_operation_type_type::RpgAgentOperationType; -use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; +use super::rpg_agent_operation_status_type::RpgAgentOperationStatus; /// Table handle for the table `custom_world_agent_operation`. /// @@ -33,9 +38,7 @@ pub trait CustomWorldAgentOperationTableAccess { impl CustomWorldAgentOperationTableAccess for super::RemoteTables { fn custom_world_agent_operation(&self) -> CustomWorldAgentOperationTableHandle<'_> { CustomWorldAgentOperationTableHandle { - imp: self - .imp - .get_table::("custom_world_agent_operation"), + imp: self.imp.get_table::("custom_world_agent_operation"), ctx: std::marker::PhantomData, } } @@ -48,12 +51,8 @@ impl<'ctx> __sdk::Table for CustomWorldAgentOperationTableHandle<'ctx> { type Row = CustomWorldAgentOperation; type EventContext = super::EventContext; - fn count(&self) -> u64 { - self.imp.count() - } - fn iter(&self) -> impl Iterator + '_ { - self.imp.iter() - } + fn count(&self) -> u64 { self.imp.count() } + fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } type InsertCallbackId = CustomWorldAgentOperationInsertCallbackId; @@ -99,40 +98,40 @@ impl<'ctx> __sdk::TableWithPrimaryKey for CustomWorldAgentOperationTableHandle<' } } -/// Access to the `operation_id` unique index on the table `custom_world_agent_operation`, -/// which allows point queries on the field of the same name -/// via the [`CustomWorldAgentOperationOperationIdUnique::find`] method. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.custom_world_agent_operation().operation_id().find(...)`. -pub struct CustomWorldAgentOperationOperationIdUnique<'ctx> { - imp: __sdk::UniqueConstraintHandle, - phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, -} - -impl<'ctx> CustomWorldAgentOperationTableHandle<'ctx> { - /// Get a handle on the `operation_id` unique index on the table `custom_world_agent_operation`. - pub fn operation_id(&self) -> CustomWorldAgentOperationOperationIdUnique<'ctx> { - CustomWorldAgentOperationOperationIdUnique { - imp: self.imp.get_unique_constraint::("operation_id"), - phantom: std::marker::PhantomData, + /// Access to the `operation_id` unique index on the table `custom_world_agent_operation`, + /// which allows point queries on the field of the same name + /// via the [`CustomWorldAgentOperationOperationIdUnique::find`] method. + /// + /// Users are encouraged not to explicitly reference this type, + /// but to directly chain method calls, + /// like `ctx.db.custom_world_agent_operation().operation_id().find(...)`. + pub struct CustomWorldAgentOperationOperationIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } - } -} -impl<'ctx> CustomWorldAgentOperationOperationIdUnique<'ctx> { - /// Find the subscribed row whose `operation_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 { - self.imp.find(col_val) - } -} + impl<'ctx> CustomWorldAgentOperationTableHandle<'ctx> { + /// Get a handle on the `operation_id` unique index on the table `custom_world_agent_operation`. + pub fn operation_id(&self) -> CustomWorldAgentOperationOperationIdUnique<'ctx> { + CustomWorldAgentOperationOperationIdUnique { + imp: self.imp.get_unique_constraint::("operation_id"), + phantom: std::marker::PhantomData, + } + } + } + impl<'ctx> CustomWorldAgentOperationOperationIdUnique<'ctx> { + /// Find the subscribed row whose `operation_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 { + self.imp.find(col_val) + } + } + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { - let _table = - client_cache.get_or_make_table::("custom_world_agent_operation"); + + let _table = client_cache.get_or_make_table::("custom_world_agent_operation"); _table.add_unique_constraint::("operation_id", |row| &row.operation_id); } @@ -141,28 +140,26 @@ pub(super) fn parse_table_update( raw_updates: __ws::v2::TableUpdate, ) -> __sdk::Result<__sdk::TableUpdate> { __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { - __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") - .with_cause(e) - .into() + __sdk::InternalError::failed_parse( + "TableUpdate", + "TableUpdate", + ).with_cause(e).into() }) } -#[allow(non_camel_case_types)] -/// Extension trait for query builder access to the table `CustomWorldAgentOperation`. -/// -/// Implemented for [`__sdk::QueryTableAccessor`]. -pub trait custom_world_agent_operationQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `CustomWorldAgentOperation`. - fn custom_world_agent_operation( - &self, - ) -> __sdk::__query_builder::Table; -} + #[allow(non_camel_case_types)] + /// Extension trait for query builder access to the table `CustomWorldAgentOperation`. + /// + /// Implemented for [`__sdk::QueryTableAccessor`]. + pub trait custom_world_agent_operationQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `CustomWorldAgentOperation`. + fn custom_world_agent_operation(&self) -> __sdk::__query_builder::Table; + } + + impl custom_world_agent_operationQueryTableAccess for __sdk::QueryTableAccessor { + fn custom_world_agent_operation(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("custom_world_agent_operation") + } + } -impl custom_world_agent_operationQueryTableAccess for __sdk::QueryTableAccessor { - fn custom_world_agent_operation( - &self, - ) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("custom_world_agent_operation") - } -} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_operation_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_operation_type.rs index 41957317..b195855d 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_operation_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_operation_type.rs @@ -2,10 +2,15 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_operation_status_type::RpgAgentOperationStatus; use super::rpg_agent_operation_type_type::RpgAgentOperationType; +use super::rpg_agent_operation_status_type::RpgAgentOperationStatus; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] @@ -17,28 +22,29 @@ pub struct CustomWorldAgentOperation { pub phase_label: String, pub phase_detail: String, pub progress: u32, - pub error_message: Option, + pub error_message: Option::, pub created_at: __sdk::Timestamp, pub updated_at: __sdk::Timestamp, } + impl __sdk::InModule for CustomWorldAgentOperation { type Module = super::RemoteModule; } + /// Column accessor struct for the table `CustomWorldAgentOperation`. /// /// Provides typed access to columns for query building. pub struct CustomWorldAgentOperationCols { pub operation_id: __sdk::__query_builder::Col, pub session_id: __sdk::__query_builder::Col, - pub operation_type: - __sdk::__query_builder::Col, + pub operation_type: __sdk::__query_builder::Col, pub status: __sdk::__query_builder::Col, pub phase_label: __sdk::__query_builder::Col, pub phase_detail: __sdk::__query_builder::Col, pub progress: __sdk::__query_builder::Col, - pub error_message: __sdk::__query_builder::Col>, + pub error_message: __sdk::__query_builder::Col>, pub created_at: __sdk::__query_builder::Col, pub updated_at: __sdk::__query_builder::Col, } @@ -57,6 +63,7 @@ impl __sdk::__query_builder::HasCols for CustomWorldAgentOperation { error_message: __sdk::__query_builder::Col::new(table_name, "error_message"), created_at: __sdk::__query_builder::Col::new(table_name, "created_at"), updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"), + } } } @@ -75,8 +82,10 @@ impl __sdk::__query_builder::HasIxCols for CustomWorldAgentOperation { CustomWorldAgentOperationIxCols { operation_id: __sdk::__query_builder::IxCol::new(table_name, "operation_id"), session_id: __sdk::__query_builder::IxCol::new(table_name, "session_id"), + } } } impl __sdk::__query_builder::CanBeLookupTable for CustomWorldAgentOperation {} + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_session_create_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_session_create_input_type.rs index d2ea6be9..7a36c77b 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_session_create_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_session_create_input_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -13,11 +19,11 @@ pub struct CustomWorldAgentSessionCreateInput { pub welcome_message_id: String, pub welcome_message_text: String, pub anchor_content_json: String, - pub creator_intent_json: Option, + pub creator_intent_json: Option::, pub creator_intent_readiness_json: String, - pub anchor_pack_json: Option, - pub lock_state_json: Option, - pub draft_profile_json: Option, + pub anchor_pack_json: Option::, + pub lock_state_json: Option::, + pub draft_profile_json: Option::, pub pending_clarifications_json: String, pub suggested_actions_json: String, pub recommended_replies_json: String, @@ -27,6 +33,8 @@ pub struct CustomWorldAgentSessionCreateInput { pub created_at_micros: i64, } + impl __sdk::InModule for CustomWorldAgentSessionCreateInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_session_get_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_session_get_input_type.rs index 733eaecb..0e4f3319 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_session_get_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_session_get_input_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -11,6 +17,8 @@ pub struct CustomWorldAgentSessionGetInput { pub owner_user_id: String, } + impl __sdk::InModule for CustomWorldAgentSessionGetInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_session_procedure_result_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_session_procedure_result_type.rs index 1ca24f19..4da0e11a 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_session_procedure_result_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_session_procedure_result_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_snapshot_type::CustomWorldAgentSessionSnapshot; @@ -10,10 +15,12 @@ use super::custom_world_agent_session_snapshot_type::CustomWorldAgentSessionSnap #[sats(crate = __lib)] pub struct CustomWorldAgentSessionProcedureResult { pub ok: bool, - pub session: Option, - pub error_message: Option, + pub session: Option::, + pub error_message: Option::, } + impl __sdk::InModule for CustomWorldAgentSessionProcedureResult { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_session_snapshot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_session_snapshot_type.rs index 5982c401..9d094d20 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_session_snapshot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_session_snapshot_type.rs @@ -2,12 +2,17 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_message_snapshot_type::CustomWorldAgentMessageSnapshot; -use super::custom_world_agent_operation_snapshot_type::CustomWorldAgentOperationSnapshot; -use super::custom_world_draft_card_snapshot_type::CustomWorldDraftCardSnapshot; use super::rpg_agent_stage_type::RpgAgentStage; +use super::custom_world_agent_message_snapshot_type::CustomWorldAgentMessageSnapshot; +use super::custom_world_draft_card_snapshot_type::CustomWorldDraftCardSnapshot; +use super::custom_world_agent_operation_snapshot_type::CustomWorldAgentOperationSnapshot; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] @@ -18,28 +23,30 @@ pub struct CustomWorldAgentSessionSnapshot { pub current_turn: u32, pub progress_percent: u32, pub stage: RpgAgentStage, - pub focus_card_id: Option, + pub focus_card_id: Option::, pub anchor_content_json: String, - pub creator_intent_json: Option, + pub creator_intent_json: Option::, pub creator_intent_readiness_json: String, - pub anchor_pack_json: Option, - pub lock_state_json: Option, - pub draft_profile_json: Option, - pub last_assistant_reply: Option, - pub result_preview_json: Option, + pub anchor_pack_json: Option::, + pub lock_state_json: Option::, + pub draft_profile_json: Option::, + pub last_assistant_reply: Option::, + pub result_preview_json: Option::, pub pending_clarifications_json: String, pub quality_findings_json: String, pub suggested_actions_json: String, pub recommended_replies_json: String, pub asset_coverage_json: String, pub checkpoints_json: String, - pub messages: Vec, - pub draft_cards: Vec, - pub operations: Vec, + pub messages: Vec::, + pub draft_cards: Vec::, + pub operations: Vec::, pub created_at_micros: i64, pub updated_at_micros: i64, } + impl __sdk::InModule for CustomWorldAgentSessionSnapshot { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_session_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_session_table.rs index d63d156c..8b907a69 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_session_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_session_table.rs @@ -2,9 +2,14 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![allow(unused, clippy::all)] +use spacetimedb_sdk::__codegen::{ + self as __sdk, + __lib, + __sats, + __ws, +}; use super::custom_world_agent_session_type::CustomWorldAgentSession; use super::rpg_agent_stage_type::RpgAgentStage; -use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; /// Table handle for the table `custom_world_agent_session`. /// @@ -32,9 +37,7 @@ pub trait CustomWorldAgentSessionTableAccess { impl CustomWorldAgentSessionTableAccess for super::RemoteTables { fn custom_world_agent_session(&self) -> CustomWorldAgentSessionTableHandle<'_> { CustomWorldAgentSessionTableHandle { - imp: self - .imp - .get_table::("custom_world_agent_session"), + imp: self.imp.get_table::("custom_world_agent_session"), ctx: std::marker::PhantomData, } } @@ -47,12 +50,8 @@ impl<'ctx> __sdk::Table for CustomWorldAgentSessionTableHandle<'ctx> { type Row = CustomWorldAgentSession; type EventContext = super::EventContext; - fn count(&self) -> u64 { - self.imp.count() - } - fn iter(&self) -> impl Iterator + '_ { - self.imp.iter() - } + fn count(&self) -> u64 { self.imp.count() } + fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } type InsertCallbackId = CustomWorldAgentSessionInsertCallbackId; @@ -98,40 +97,40 @@ impl<'ctx> __sdk::TableWithPrimaryKey for CustomWorldAgentSessionTableHandle<'ct } } -/// Access to the `session_id` unique index on the table `custom_world_agent_session`, -/// which allows point queries on the field of the same name -/// via the [`CustomWorldAgentSessionSessionIdUnique::find`] method. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.custom_world_agent_session().session_id().find(...)`. -pub struct CustomWorldAgentSessionSessionIdUnique<'ctx> { - imp: __sdk::UniqueConstraintHandle, - phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, -} - -impl<'ctx> CustomWorldAgentSessionTableHandle<'ctx> { - /// Get a handle on the `session_id` unique index on the table `custom_world_agent_session`. - pub fn session_id(&self) -> CustomWorldAgentSessionSessionIdUnique<'ctx> { - CustomWorldAgentSessionSessionIdUnique { - imp: self.imp.get_unique_constraint::("session_id"), - phantom: std::marker::PhantomData, + /// Access to the `session_id` unique index on the table `custom_world_agent_session`, + /// which allows point queries on the field of the same name + /// via the [`CustomWorldAgentSessionSessionIdUnique::find`] method. + /// + /// Users are encouraged not to explicitly reference this type, + /// but to directly chain method calls, + /// like `ctx.db.custom_world_agent_session().session_id().find(...)`. + pub struct CustomWorldAgentSessionSessionIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } - } -} -impl<'ctx> CustomWorldAgentSessionSessionIdUnique<'ctx> { - /// Find the subscribed row whose `session_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 { - self.imp.find(col_val) - } -} + impl<'ctx> CustomWorldAgentSessionTableHandle<'ctx> { + /// Get a handle on the `session_id` unique index on the table `custom_world_agent_session`. + pub fn session_id(&self) -> CustomWorldAgentSessionSessionIdUnique<'ctx> { + CustomWorldAgentSessionSessionIdUnique { + imp: self.imp.get_unique_constraint::("session_id"), + phantom: std::marker::PhantomData, + } + } + } + impl<'ctx> CustomWorldAgentSessionSessionIdUnique<'ctx> { + /// Find the subscribed row whose `session_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 { + self.imp.find(col_val) + } + } + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { - let _table = - client_cache.get_or_make_table::("custom_world_agent_session"); + + let _table = client_cache.get_or_make_table::("custom_world_agent_session"); _table.add_unique_constraint::("session_id", |row| &row.session_id); } @@ -140,24 +139,26 @@ pub(super) fn parse_table_update( raw_updates: __ws::v2::TableUpdate, ) -> __sdk::Result<__sdk::TableUpdate> { __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { - __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") - .with_cause(e) - .into() + __sdk::InternalError::failed_parse( + "TableUpdate", + "TableUpdate", + ).with_cause(e).into() }) } -#[allow(non_camel_case_types)] -/// Extension trait for query builder access to the table `CustomWorldAgentSession`. -/// -/// Implemented for [`__sdk::QueryTableAccessor`]. -pub trait custom_world_agent_sessionQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `CustomWorldAgentSession`. - fn custom_world_agent_session(&self) -> __sdk::__query_builder::Table; -} + #[allow(non_camel_case_types)] + /// Extension trait for query builder access to the table `CustomWorldAgentSession`. + /// + /// Implemented for [`__sdk::QueryTableAccessor`]. + pub trait custom_world_agent_sessionQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `CustomWorldAgentSession`. + fn custom_world_agent_session(&self) -> __sdk::__query_builder::Table; + } + + impl custom_world_agent_sessionQueryTableAccess for __sdk::QueryTableAccessor { + fn custom_world_agent_session(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("custom_world_agent_session") + } + } -impl custom_world_agent_sessionQueryTableAccess for __sdk::QueryTableAccessor { - fn custom_world_agent_session(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("custom_world_agent_session") - } -} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_session_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_session_type.rs index c787f102..ddba70f3 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_session_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_session_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_stage_type::RpgAgentStage; @@ -15,15 +20,15 @@ pub struct CustomWorldAgentSession { pub current_turn: u32, pub progress_percent: u32, pub stage: RpgAgentStage, - pub focus_card_id: Option, + pub focus_card_id: Option::, pub anchor_content_json: String, - pub creator_intent_json: Option, + pub creator_intent_json: Option::, pub creator_intent_readiness_json: String, - pub anchor_pack_json: Option, - pub lock_state_json: Option, - pub draft_profile_json: Option, - pub last_assistant_reply: Option, - pub result_preview_json: Option, + pub anchor_pack_json: Option::, + pub lock_state_json: Option::, + pub draft_profile_json: Option::, + pub last_assistant_reply: Option::, + pub result_preview_json: Option::, pub pending_clarifications_json: String, pub quality_findings_json: String, pub suggested_actions_json: String, @@ -34,10 +39,12 @@ pub struct CustomWorldAgentSession { pub updated_at: __sdk::Timestamp, } + impl __sdk::InModule for CustomWorldAgentSession { type Module = super::RemoteModule; } + /// Column accessor struct for the table `CustomWorldAgentSession`. /// /// Provides typed access to columns for query building. @@ -48,15 +55,15 @@ pub struct CustomWorldAgentSessionCols { pub current_turn: __sdk::__query_builder::Col, pub progress_percent: __sdk::__query_builder::Col, pub stage: __sdk::__query_builder::Col, - pub focus_card_id: __sdk::__query_builder::Col>, + pub focus_card_id: __sdk::__query_builder::Col>, pub anchor_content_json: __sdk::__query_builder::Col, - pub creator_intent_json: __sdk::__query_builder::Col>, + pub creator_intent_json: __sdk::__query_builder::Col>, pub creator_intent_readiness_json: __sdk::__query_builder::Col, - pub anchor_pack_json: __sdk::__query_builder::Col>, - pub lock_state_json: __sdk::__query_builder::Col>, - pub draft_profile_json: __sdk::__query_builder::Col>, - pub last_assistant_reply: __sdk::__query_builder::Col>, - pub result_preview_json: __sdk::__query_builder::Col>, + pub anchor_pack_json: __sdk::__query_builder::Col>, + pub lock_state_json: __sdk::__query_builder::Col>, + pub draft_profile_json: __sdk::__query_builder::Col>, + pub last_assistant_reply: __sdk::__query_builder::Col>, + pub result_preview_json: __sdk::__query_builder::Col>, pub pending_clarifications_json: __sdk::__query_builder::Col, pub quality_findings_json: __sdk::__query_builder::Col, pub suggested_actions_json: __sdk::__query_builder::Col, @@ -78,52 +85,23 @@ impl __sdk::__query_builder::HasCols for CustomWorldAgentSession { progress_percent: __sdk::__query_builder::Col::new(table_name, "progress_percent"), stage: __sdk::__query_builder::Col::new(table_name, "stage"), focus_card_id: __sdk::__query_builder::Col::new(table_name, "focus_card_id"), - anchor_content_json: __sdk::__query_builder::Col::new( - table_name, - "anchor_content_json", - ), - creator_intent_json: __sdk::__query_builder::Col::new( - table_name, - "creator_intent_json", - ), - creator_intent_readiness_json: __sdk::__query_builder::Col::new( - table_name, - "creator_intent_readiness_json", - ), + anchor_content_json: __sdk::__query_builder::Col::new(table_name, "anchor_content_json"), + creator_intent_json: __sdk::__query_builder::Col::new(table_name, "creator_intent_json"), + creator_intent_readiness_json: __sdk::__query_builder::Col::new(table_name, "creator_intent_readiness_json"), anchor_pack_json: __sdk::__query_builder::Col::new(table_name, "anchor_pack_json"), lock_state_json: __sdk::__query_builder::Col::new(table_name, "lock_state_json"), draft_profile_json: __sdk::__query_builder::Col::new(table_name, "draft_profile_json"), - last_assistant_reply: __sdk::__query_builder::Col::new( - table_name, - "last_assistant_reply", - ), - result_preview_json: __sdk::__query_builder::Col::new( - table_name, - "result_preview_json", - ), - pending_clarifications_json: __sdk::__query_builder::Col::new( - table_name, - "pending_clarifications_json", - ), - quality_findings_json: __sdk::__query_builder::Col::new( - table_name, - "quality_findings_json", - ), - suggested_actions_json: __sdk::__query_builder::Col::new( - table_name, - "suggested_actions_json", - ), - recommended_replies_json: __sdk::__query_builder::Col::new( - table_name, - "recommended_replies_json", - ), - asset_coverage_json: __sdk::__query_builder::Col::new( - table_name, - "asset_coverage_json", - ), + last_assistant_reply: __sdk::__query_builder::Col::new(table_name, "last_assistant_reply"), + result_preview_json: __sdk::__query_builder::Col::new(table_name, "result_preview_json"), + pending_clarifications_json: __sdk::__query_builder::Col::new(table_name, "pending_clarifications_json"), + quality_findings_json: __sdk::__query_builder::Col::new(table_name, "quality_findings_json"), + suggested_actions_json: __sdk::__query_builder::Col::new(table_name, "suggested_actions_json"), + recommended_replies_json: __sdk::__query_builder::Col::new(table_name, "recommended_replies_json"), + asset_coverage_json: __sdk::__query_builder::Col::new(table_name, "asset_coverage_json"), checkpoints_json: __sdk::__query_builder::Col::new(table_name, "checkpoints_json"), created_at: __sdk::__query_builder::Col::new(table_name, "created_at"), updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"), + } } } @@ -144,8 +122,10 @@ impl __sdk::__query_builder::HasIxCols for CustomWorldAgentSession { owner_user_id: __sdk::__query_builder::IxCol::new(table_name, "owner_user_id"), session_id: __sdk::__query_builder::IxCol::new(table_name, "session_id"), stage: __sdk::__query_builder::IxCol::new(table_name, "stage"), + } } } impl __sdk::__query_builder::CanBeLookupTable for CustomWorldAgentSession {} + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_draft_card_snapshot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_draft_card_snapshot_type.rs index 84108f6e..c9497003 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_draft_card_snapshot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_draft_card_snapshot_type.rs @@ -2,11 +2,16 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_role_asset_status_type::CustomWorldRoleAssetStatus; use super::rpg_agent_draft_card_kind_type::RpgAgentDraftCardKind; use super::rpg_agent_draft_card_status_type::RpgAgentDraftCardStatus; +use super::custom_world_role_asset_status_type::CustomWorldRoleAssetStatus; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] @@ -20,13 +25,15 @@ pub struct CustomWorldDraftCardSnapshot { pub summary: String, pub linked_ids_json: String, pub warning_count: u32, - pub asset_status: Option, - pub asset_status_label: Option, - pub detail_payload_json: Option, + pub asset_status: Option::, + pub asset_status_label: Option::, + pub detail_payload_json: Option::, pub created_at_micros: i64, pub updated_at_micros: i64, } + impl __sdk::InModule for CustomWorldDraftCardSnapshot { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_draft_card_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_draft_card_table.rs index 6f175998..9d197db6 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_draft_card_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_draft_card_table.rs @@ -2,11 +2,16 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![allow(unused, clippy::all)] +use spacetimedb_sdk::__codegen::{ + self as __sdk, + __lib, + __sats, + __ws, +}; use super::custom_world_draft_card_type::CustomWorldDraftCard; -use super::custom_world_role_asset_status_type::CustomWorldRoleAssetStatus; use super::rpg_agent_draft_card_kind_type::RpgAgentDraftCardKind; use super::rpg_agent_draft_card_status_type::RpgAgentDraftCardStatus; -use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; +use super::custom_world_role_asset_status_type::CustomWorldRoleAssetStatus; /// Table handle for the table `custom_world_draft_card`. /// @@ -34,9 +39,7 @@ pub trait CustomWorldDraftCardTableAccess { impl CustomWorldDraftCardTableAccess for super::RemoteTables { fn custom_world_draft_card(&self) -> CustomWorldDraftCardTableHandle<'_> { CustomWorldDraftCardTableHandle { - imp: self - .imp - .get_table::("custom_world_draft_card"), + imp: self.imp.get_table::("custom_world_draft_card"), ctx: std::marker::PhantomData, } } @@ -49,12 +52,8 @@ impl<'ctx> __sdk::Table for CustomWorldDraftCardTableHandle<'ctx> { type Row = CustomWorldDraftCard; type EventContext = super::EventContext; - fn count(&self) -> u64 { - self.imp.count() - } - fn iter(&self) -> impl Iterator + '_ { - self.imp.iter() - } + fn count(&self) -> u64 { self.imp.count() } + fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } type InsertCallbackId = CustomWorldDraftCardInsertCallbackId; @@ -100,38 +99,39 @@ impl<'ctx> __sdk::TableWithPrimaryKey for CustomWorldDraftCardTableHandle<'ctx> } } -/// Access to the `card_id` unique index on the table `custom_world_draft_card`, -/// which allows point queries on the field of the same name -/// via the [`CustomWorldDraftCardCardIdUnique::find`] method. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.custom_world_draft_card().card_id().find(...)`. -pub struct CustomWorldDraftCardCardIdUnique<'ctx> { - imp: __sdk::UniqueConstraintHandle, - phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, -} - -impl<'ctx> CustomWorldDraftCardTableHandle<'ctx> { - /// Get a handle on the `card_id` unique index on the table `custom_world_draft_card`. - pub fn card_id(&self) -> CustomWorldDraftCardCardIdUnique<'ctx> { - CustomWorldDraftCardCardIdUnique { - imp: self.imp.get_unique_constraint::("card_id"), - phantom: std::marker::PhantomData, + /// Access to the `card_id` unique index on the table `custom_world_draft_card`, + /// which allows point queries on the field of the same name + /// via the [`CustomWorldDraftCardCardIdUnique::find`] method. + /// + /// Users are encouraged not to explicitly reference this type, + /// but to directly chain method calls, + /// like `ctx.db.custom_world_draft_card().card_id().find(...)`. + pub struct CustomWorldDraftCardCardIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } - } -} -impl<'ctx> CustomWorldDraftCardCardIdUnique<'ctx> { - /// Find the subscribed row whose `card_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 { - self.imp.find(col_val) - } -} + impl<'ctx> CustomWorldDraftCardTableHandle<'ctx> { + /// Get a handle on the `card_id` unique index on the table `custom_world_draft_card`. + pub fn card_id(&self) -> CustomWorldDraftCardCardIdUnique<'ctx> { + CustomWorldDraftCardCardIdUnique { + imp: self.imp.get_unique_constraint::("card_id"), + phantom: std::marker::PhantomData, + } + } + } + impl<'ctx> CustomWorldDraftCardCardIdUnique<'ctx> { + /// Find the subscribed row whose `card_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 { + self.imp.find(col_val) + } + } + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("custom_world_draft_card"); _table.add_unique_constraint::("card_id", |row| &row.card_id); } @@ -141,24 +141,26 @@ pub(super) fn parse_table_update( raw_updates: __ws::v2::TableUpdate, ) -> __sdk::Result<__sdk::TableUpdate> { __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { - __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") - .with_cause(e) - .into() + __sdk::InternalError::failed_parse( + "TableUpdate", + "TableUpdate", + ).with_cause(e).into() }) } -#[allow(non_camel_case_types)] -/// Extension trait for query builder access to the table `CustomWorldDraftCard`. -/// -/// Implemented for [`__sdk::QueryTableAccessor`]. -pub trait custom_world_draft_cardQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `CustomWorldDraftCard`. - fn custom_world_draft_card(&self) -> __sdk::__query_builder::Table; -} + #[allow(non_camel_case_types)] + /// Extension trait for query builder access to the table `CustomWorldDraftCard`. + /// + /// Implemented for [`__sdk::QueryTableAccessor`]. + pub trait custom_world_draft_cardQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `CustomWorldDraftCard`. + fn custom_world_draft_card(&self) -> __sdk::__query_builder::Table; + } + + impl custom_world_draft_cardQueryTableAccess for __sdk::QueryTableAccessor { + fn custom_world_draft_card(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("custom_world_draft_card") + } + } -impl custom_world_draft_cardQueryTableAccess for __sdk::QueryTableAccessor { - fn custom_world_draft_card(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("custom_world_draft_card") - } -} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_draft_card_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_draft_card_type.rs index 600c1f31..64dd162a 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_draft_card_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_draft_card_type.rs @@ -2,11 +2,16 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_role_asset_status_type::CustomWorldRoleAssetStatus; use super::rpg_agent_draft_card_kind_type::RpgAgentDraftCardKind; use super::rpg_agent_draft_card_status_type::RpgAgentDraftCardStatus; +use super::custom_world_role_asset_status_type::CustomWorldRoleAssetStatus; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] @@ -20,17 +25,19 @@ pub struct CustomWorldDraftCard { pub summary: String, pub linked_ids_json: String, pub warning_count: u32, - pub asset_status: Option, - pub asset_status_label: Option, - pub detail_payload_json: Option, + pub asset_status: Option::, + pub asset_status_label: Option::, + pub detail_payload_json: Option::, pub created_at: __sdk::Timestamp, pub updated_at: __sdk::Timestamp, } + impl __sdk::InModule for CustomWorldDraftCard { type Module = super::RemoteModule; } + /// Column accessor struct for the table `CustomWorldDraftCard`. /// /// Provides typed access to columns for query building. @@ -44,10 +51,9 @@ pub struct CustomWorldDraftCardCols { pub summary: __sdk::__query_builder::Col, pub linked_ids_json: __sdk::__query_builder::Col, pub warning_count: __sdk::__query_builder::Col, - pub asset_status: - __sdk::__query_builder::Col>, - pub asset_status_label: __sdk::__query_builder::Col>, - pub detail_payload_json: __sdk::__query_builder::Col>, + pub asset_status: __sdk::__query_builder::Col>, + pub asset_status_label: __sdk::__query_builder::Col>, + pub detail_payload_json: __sdk::__query_builder::Col>, pub created_at: __sdk::__query_builder::Col, pub updated_at: __sdk::__query_builder::Col, } @@ -67,12 +73,10 @@ impl __sdk::__query_builder::HasCols for CustomWorldDraftCard { warning_count: __sdk::__query_builder::Col::new(table_name, "warning_count"), asset_status: __sdk::__query_builder::Col::new(table_name, "asset_status"), asset_status_label: __sdk::__query_builder::Col::new(table_name, "asset_status_label"), - detail_payload_json: __sdk::__query_builder::Col::new( - table_name, - "detail_payload_json", - ), + detail_payload_json: __sdk::__query_builder::Col::new(table_name, "detail_payload_json"), created_at: __sdk::__query_builder::Col::new(table_name, "created_at"), updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"), + } } } @@ -93,8 +97,10 @@ impl __sdk::__query_builder::HasIxCols for CustomWorldDraftCard { card_id: __sdk::__query_builder::IxCol::new(table_name, "card_id"), kind: __sdk::__query_builder::IxCol::new(table_name, "kind"), session_id: __sdk::__query_builder::IxCol::new(table_name, "session_id"), + } } } impl __sdk::__query_builder::CanBeLookupTable for CustomWorldDraftCard {} + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_gallery_detail_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_gallery_detail_input_type.rs index 64724446..5df002ea 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_gallery_detail_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_gallery_detail_input_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -11,6 +17,8 @@ pub struct CustomWorldGalleryDetailInput { pub profile_id: String, } + impl __sdk::InModule for CustomWorldGalleryDetailInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_gallery_entry_snapshot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_gallery_entry_snapshot_type.rs index c2a84ee3..9d81b728 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_gallery_entry_snapshot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_gallery_entry_snapshot_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_theme_mode_type::CustomWorldThemeMode; @@ -15,7 +20,7 @@ pub struct CustomWorldGalleryEntrySnapshot { pub world_name: String, pub subtitle: String, pub summary_text: String, - pub cover_image_src: Option, + pub cover_image_src: Option::, pub theme_mode: CustomWorldThemeMode, pub playable_npc_count: u32, pub landmark_count: u32, @@ -23,6 +28,8 @@ pub struct CustomWorldGalleryEntrySnapshot { pub updated_at_micros: i64, } + impl __sdk::InModule for CustomWorldGalleryEntrySnapshot { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_gallery_entry_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_gallery_entry_table.rs index 425b6a12..f215d0c9 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_gallery_entry_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_gallery_entry_table.rs @@ -2,9 +2,14 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![allow(unused, clippy::all)] +use spacetimedb_sdk::__codegen::{ + self as __sdk, + __lib, + __sats, + __ws, +}; use super::custom_world_gallery_entry_type::CustomWorldGalleryEntry; use super::custom_world_theme_mode_type::CustomWorldThemeMode; -use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; /// Table handle for the table `custom_world_gallery_entry`. /// @@ -32,9 +37,7 @@ pub trait CustomWorldGalleryEntryTableAccess { impl CustomWorldGalleryEntryTableAccess for super::RemoteTables { fn custom_world_gallery_entry(&self) -> CustomWorldGalleryEntryTableHandle<'_> { CustomWorldGalleryEntryTableHandle { - imp: self - .imp - .get_table::("custom_world_gallery_entry"), + imp: self.imp.get_table::("custom_world_gallery_entry"), ctx: std::marker::PhantomData, } } @@ -47,12 +50,8 @@ impl<'ctx> __sdk::Table for CustomWorldGalleryEntryTableHandle<'ctx> { type Row = CustomWorldGalleryEntry; type EventContext = super::EventContext; - fn count(&self) -> u64 { - self.imp.count() - } - fn iter(&self) -> impl Iterator + '_ { - self.imp.iter() - } + fn count(&self) -> u64 { self.imp.count() } + fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } type InsertCallbackId = CustomWorldGalleryEntryInsertCallbackId; @@ -98,40 +97,40 @@ impl<'ctx> __sdk::TableWithPrimaryKey for CustomWorldGalleryEntryTableHandle<'ct } } -/// Access to the `profile_id` unique index on the table `custom_world_gallery_entry`, -/// which allows point queries on the field of the same name -/// via the [`CustomWorldGalleryEntryProfileIdUnique::find`] method. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.custom_world_gallery_entry().profile_id().find(...)`. -pub struct CustomWorldGalleryEntryProfileIdUnique<'ctx> { - imp: __sdk::UniqueConstraintHandle, - phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, -} - -impl<'ctx> CustomWorldGalleryEntryTableHandle<'ctx> { - /// Get a handle on the `profile_id` unique index on the table `custom_world_gallery_entry`. - pub fn profile_id(&self) -> CustomWorldGalleryEntryProfileIdUnique<'ctx> { - CustomWorldGalleryEntryProfileIdUnique { - imp: self.imp.get_unique_constraint::("profile_id"), - phantom: std::marker::PhantomData, + /// Access to the `profile_id` unique index on the table `custom_world_gallery_entry`, + /// which allows point queries on the field of the same name + /// via the [`CustomWorldGalleryEntryProfileIdUnique::find`] method. + /// + /// Users are encouraged not to explicitly reference this type, + /// but to directly chain method calls, + /// like `ctx.db.custom_world_gallery_entry().profile_id().find(...)`. + pub struct CustomWorldGalleryEntryProfileIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } - } -} -impl<'ctx> CustomWorldGalleryEntryProfileIdUnique<'ctx> { - /// Find the subscribed row whose `profile_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 { - self.imp.find(col_val) - } -} + impl<'ctx> CustomWorldGalleryEntryTableHandle<'ctx> { + /// Get a handle on the `profile_id` unique index on the table `custom_world_gallery_entry`. + pub fn profile_id(&self) -> CustomWorldGalleryEntryProfileIdUnique<'ctx> { + CustomWorldGalleryEntryProfileIdUnique { + imp: self.imp.get_unique_constraint::("profile_id"), + phantom: std::marker::PhantomData, + } + } + } + impl<'ctx> CustomWorldGalleryEntryProfileIdUnique<'ctx> { + /// Find the subscribed row whose `profile_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 { + self.imp.find(col_val) + } + } + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { - let _table = - client_cache.get_or_make_table::("custom_world_gallery_entry"); + + let _table = client_cache.get_or_make_table::("custom_world_gallery_entry"); _table.add_unique_constraint::("profile_id", |row| &row.profile_id); } @@ -140,24 +139,26 @@ pub(super) fn parse_table_update( raw_updates: __ws::v2::TableUpdate, ) -> __sdk::Result<__sdk::TableUpdate> { __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { - __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") - .with_cause(e) - .into() + __sdk::InternalError::failed_parse( + "TableUpdate", + "TableUpdate", + ).with_cause(e).into() }) } -#[allow(non_camel_case_types)] -/// Extension trait for query builder access to the table `CustomWorldGalleryEntry`. -/// -/// Implemented for [`__sdk::QueryTableAccessor`]. -pub trait custom_world_gallery_entryQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `CustomWorldGalleryEntry`. - fn custom_world_gallery_entry(&self) -> __sdk::__query_builder::Table; -} + #[allow(non_camel_case_types)] + /// Extension trait for query builder access to the table `CustomWorldGalleryEntry`. + /// + /// Implemented for [`__sdk::QueryTableAccessor`]. + pub trait custom_world_gallery_entryQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `CustomWorldGalleryEntry`. + fn custom_world_gallery_entry(&self) -> __sdk::__query_builder::Table; + } + + impl custom_world_gallery_entryQueryTableAccess for __sdk::QueryTableAccessor { + fn custom_world_gallery_entry(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("custom_world_gallery_entry") + } + } -impl custom_world_gallery_entryQueryTableAccess for __sdk::QueryTableAccessor { - fn custom_world_gallery_entry(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("custom_world_gallery_entry") - } -} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_gallery_entry_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_gallery_entry_type.rs index 03ad4584..471ad9fb 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_gallery_entry_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_gallery_entry_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_theme_mode_type::CustomWorldThemeMode; @@ -15,7 +20,7 @@ pub struct CustomWorldGalleryEntry { pub world_name: String, pub subtitle: String, pub summary_text: String, - pub cover_image_src: Option, + pub cover_image_src: Option::, pub theme_mode: CustomWorldThemeMode, pub playable_npc_count: u32, pub landmark_count: u32, @@ -23,10 +28,12 @@ pub struct CustomWorldGalleryEntry { pub updated_at: __sdk::Timestamp, } + impl __sdk::InModule for CustomWorldGalleryEntry { type Module = super::RemoteModule; } + /// Column accessor struct for the table `CustomWorldGalleryEntry`. /// /// Provides typed access to columns for query building. @@ -37,7 +44,7 @@ pub struct CustomWorldGalleryEntryCols { pub world_name: __sdk::__query_builder::Col, pub subtitle: __sdk::__query_builder::Col, pub summary_text: __sdk::__query_builder::Col, - pub cover_image_src: __sdk::__query_builder::Col>, + pub cover_image_src: __sdk::__query_builder::Col>, pub theme_mode: __sdk::__query_builder::Col, pub playable_npc_count: __sdk::__query_builder::Col, pub landmark_count: __sdk::__query_builder::Col, @@ -51,10 +58,7 @@ impl __sdk::__query_builder::HasCols for CustomWorldGalleryEntry { CustomWorldGalleryEntryCols { profile_id: __sdk::__query_builder::Col::new(table_name, "profile_id"), owner_user_id: __sdk::__query_builder::Col::new(table_name, "owner_user_id"), - author_display_name: __sdk::__query_builder::Col::new( - table_name, - "author_display_name", - ), + author_display_name: __sdk::__query_builder::Col::new(table_name, "author_display_name"), world_name: __sdk::__query_builder::Col::new(table_name, "world_name"), subtitle: __sdk::__query_builder::Col::new(table_name, "subtitle"), summary_text: __sdk::__query_builder::Col::new(table_name, "summary_text"), @@ -64,6 +68,7 @@ impl __sdk::__query_builder::HasCols for CustomWorldGalleryEntry { landmark_count: __sdk::__query_builder::Col::new(table_name, "landmark_count"), published_at: __sdk::__query_builder::Col::new(table_name, "published_at"), updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"), + } } } @@ -84,8 +89,10 @@ impl __sdk::__query_builder::HasIxCols for CustomWorldGalleryEntry { owner_user_id: __sdk::__query_builder::IxCol::new(table_name, "owner_user_id"), profile_id: __sdk::__query_builder::IxCol::new(table_name, "profile_id"), theme_mode: __sdk::__query_builder::IxCol::new(table_name, "theme_mode"), + } } } impl __sdk::__query_builder::CanBeLookupTable for CustomWorldGalleryEntry {} + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_gallery_list_result_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_gallery_list_result_type.rs index bf101ef1..357c32c5 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_gallery_list_result_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_gallery_list_result_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_gallery_entry_snapshot_type::CustomWorldGalleryEntrySnapshot; @@ -10,10 +15,12 @@ use super::custom_world_gallery_entry_snapshot_type::CustomWorldGalleryEntrySnap #[sats(crate = __lib)] pub struct CustomWorldGalleryListResult { pub ok: bool, - pub entries: Vec, - pub error_message: Option, + pub entries: Vec::, + pub error_message: Option::, } + impl __sdk::InModule for CustomWorldGalleryListResult { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_generation_mode_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_generation_mode_type.rs index 8b424a9a..375a464c 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_generation_mode_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_generation_mode_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -11,8 +16,12 @@ pub enum CustomWorldGenerationMode { Fast, Full, + } + + impl __sdk::InModule for CustomWorldGenerationMode { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_library_detail_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_library_detail_input_type.rs index 472c1b80..e29dbaa9 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_library_detail_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_library_detail_input_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -11,6 +17,8 @@ pub struct CustomWorldLibraryDetailInput { pub profile_id: String, } + impl __sdk::InModule for CustomWorldLibraryDetailInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_library_mutation_result_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_library_mutation_result_type.rs index 3c3bb3b3..6fd0d2ff 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_library_mutation_result_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_library_mutation_result_type.rs @@ -2,20 +2,27 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_gallery_entry_snapshot_type::CustomWorldGalleryEntrySnapshot; use super::custom_world_profile_snapshot_type::CustomWorldProfileSnapshot; +use super::custom_world_gallery_entry_snapshot_type::CustomWorldGalleryEntrySnapshot; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] pub struct CustomWorldLibraryMutationResult { pub ok: bool, - pub entry: Option, - pub gallery_entry: Option, - pub error_message: Option, + pub entry: Option::, + pub gallery_entry: Option::, + pub error_message: Option::, } + impl __sdk::InModule for CustomWorldLibraryMutationResult { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_profile_list_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_profile_list_input_type.rs index 53c46830..2d4b431e 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_profile_list_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_profile_list_input_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -10,6 +16,8 @@ pub struct CustomWorldProfileListInput { pub owner_user_id: String, } + impl __sdk::InModule for CustomWorldProfileListInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_profile_list_result_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_profile_list_result_type.rs index 10db7d0e..4e6a5a4a 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_profile_list_result_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_profile_list_result_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_profile_snapshot_type::CustomWorldProfileSnapshot; @@ -10,10 +15,12 @@ use super::custom_world_profile_snapshot_type::CustomWorldProfileSnapshot; #[sats(crate = __lib)] pub struct CustomWorldProfileListResult { pub ok: bool, - pub entries: Vec, - pub error_message: Option, + pub entries: Vec::, + pub error_message: Option::, } + impl __sdk::InModule for CustomWorldProfileListResult { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_profile_publish_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_profile_publish_input_type.rs index 16d06654..42b63f84 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_profile_publish_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_profile_publish_input_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -13,6 +19,8 @@ pub struct CustomWorldProfilePublishInput { pub published_at_micros: i64, } + impl __sdk::InModule for CustomWorldProfilePublishInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_profile_snapshot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_profile_snapshot_type.rs index d5d81918..dd75571e 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_profile_snapshot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_profile_snapshot_type.rs @@ -2,32 +2,39 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_publication_status_type::CustomWorldPublicationStatus; use super::custom_world_theme_mode_type::CustomWorldThemeMode; +use super::custom_world_publication_status_type::CustomWorldPublicationStatus; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] pub struct CustomWorldProfileSnapshot { pub profile_id: String, pub owner_user_id: String, - pub source_agent_session_id: Option, + pub source_agent_session_id: Option::, pub publication_status: CustomWorldPublicationStatus, pub world_name: String, pub subtitle: String, pub summary_text: String, pub theme_mode: CustomWorldThemeMode, - pub cover_image_src: Option, + pub cover_image_src: Option::, pub profile_payload_json: String, pub playable_npc_count: u32, pub landmark_count: u32, pub author_display_name: String, - pub published_at_micros: Option, + pub published_at_micros: Option::, pub created_at_micros: i64, pub updated_at_micros: i64, } + impl __sdk::InModule for CustomWorldProfileSnapshot { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_profile_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_profile_table.rs index 22692434..69639bf3 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_profile_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_profile_table.rs @@ -2,10 +2,15 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![allow(unused, clippy::all)] +use spacetimedb_sdk::__codegen::{ + self as __sdk, + __lib, + __sats, + __ws, +}; use super::custom_world_profile_type::CustomWorldProfile; -use super::custom_world_publication_status_type::CustomWorldPublicationStatus; use super::custom_world_theme_mode_type::CustomWorldThemeMode; -use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; +use super::custom_world_publication_status_type::CustomWorldPublicationStatus; /// Table handle for the table `custom_world_profile`. /// @@ -33,9 +38,7 @@ pub trait CustomWorldProfileTableAccess { impl CustomWorldProfileTableAccess for super::RemoteTables { fn custom_world_profile(&self) -> CustomWorldProfileTableHandle<'_> { CustomWorldProfileTableHandle { - imp: self - .imp - .get_table::("custom_world_profile"), + imp: self.imp.get_table::("custom_world_profile"), ctx: std::marker::PhantomData, } } @@ -48,12 +51,8 @@ impl<'ctx> __sdk::Table for CustomWorldProfileTableHandle<'ctx> { type Row = CustomWorldProfile; type EventContext = super::EventContext; - fn count(&self) -> u64 { - self.imp.count() - } - fn iter(&self) -> impl Iterator + '_ { - self.imp.iter() - } + fn count(&self) -> u64 { self.imp.count() } + fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } type InsertCallbackId = CustomWorldProfileInsertCallbackId; @@ -99,38 +98,39 @@ impl<'ctx> __sdk::TableWithPrimaryKey for CustomWorldProfileTableHandle<'ctx> { } } -/// Access to the `profile_id` unique index on the table `custom_world_profile`, -/// which allows point queries on the field of the same name -/// via the [`CustomWorldProfileProfileIdUnique::find`] method. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.custom_world_profile().profile_id().find(...)`. -pub struct CustomWorldProfileProfileIdUnique<'ctx> { - imp: __sdk::UniqueConstraintHandle, - phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, -} - -impl<'ctx> CustomWorldProfileTableHandle<'ctx> { - /// Get a handle on the `profile_id` unique index on the table `custom_world_profile`. - pub fn profile_id(&self) -> CustomWorldProfileProfileIdUnique<'ctx> { - CustomWorldProfileProfileIdUnique { - imp: self.imp.get_unique_constraint::("profile_id"), - phantom: std::marker::PhantomData, + /// Access to the `profile_id` unique index on the table `custom_world_profile`, + /// which allows point queries on the field of the same name + /// via the [`CustomWorldProfileProfileIdUnique::find`] method. + /// + /// Users are encouraged not to explicitly reference this type, + /// but to directly chain method calls, + /// like `ctx.db.custom_world_profile().profile_id().find(...)`. + pub struct CustomWorldProfileProfileIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } - } -} -impl<'ctx> CustomWorldProfileProfileIdUnique<'ctx> { - /// Find the subscribed row whose `profile_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 { - self.imp.find(col_val) - } -} + impl<'ctx> CustomWorldProfileTableHandle<'ctx> { + /// Get a handle on the `profile_id` unique index on the table `custom_world_profile`. + pub fn profile_id(&self) -> CustomWorldProfileProfileIdUnique<'ctx> { + CustomWorldProfileProfileIdUnique { + imp: self.imp.get_unique_constraint::("profile_id"), + phantom: std::marker::PhantomData, + } + } + } + impl<'ctx> CustomWorldProfileProfileIdUnique<'ctx> { + /// Find the subscribed row whose `profile_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 { + self.imp.find(col_val) + } + } + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("custom_world_profile"); _table.add_unique_constraint::("profile_id", |row| &row.profile_id); } @@ -140,24 +140,26 @@ pub(super) fn parse_table_update( raw_updates: __ws::v2::TableUpdate, ) -> __sdk::Result<__sdk::TableUpdate> { __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { - __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") - .with_cause(e) - .into() + __sdk::InternalError::failed_parse( + "TableUpdate", + "TableUpdate", + ).with_cause(e).into() }) } -#[allow(non_camel_case_types)] -/// Extension trait for query builder access to the table `CustomWorldProfile`. -/// -/// Implemented for [`__sdk::QueryTableAccessor`]. -pub trait custom_world_profileQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `CustomWorldProfile`. - fn custom_world_profile(&self) -> __sdk::__query_builder::Table; -} + #[allow(non_camel_case_types)] + /// Extension trait for query builder access to the table `CustomWorldProfile`. + /// + /// Implemented for [`__sdk::QueryTableAccessor`]. + pub trait custom_world_profileQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `CustomWorldProfile`. + fn custom_world_profile(&self) -> __sdk::__query_builder::Table; + } + + impl custom_world_profileQueryTableAccess for __sdk::QueryTableAccessor { + fn custom_world_profile(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("custom_world_profile") + } + } -impl custom_world_profileQueryTableAccess for __sdk::QueryTableAccessor { - fn custom_world_profile(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("custom_world_profile") - } -} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_profile_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_profile_type.rs index 6f91923a..fdfe7a2f 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_profile_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_profile_type.rs @@ -2,55 +2,61 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_publication_status_type::CustomWorldPublicationStatus; use super::custom_world_theme_mode_type::CustomWorldThemeMode; +use super::custom_world_publication_status_type::CustomWorldPublicationStatus; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] pub struct CustomWorldProfile { pub profile_id: String, pub owner_user_id: String, - pub source_agent_session_id: Option, + pub source_agent_session_id: Option::, pub publication_status: CustomWorldPublicationStatus, pub world_name: String, pub subtitle: String, pub summary_text: String, pub theme_mode: CustomWorldThemeMode, - pub cover_image_src: Option, + pub cover_image_src: Option::, pub profile_payload_json: String, pub playable_npc_count: u32, pub landmark_count: u32, pub author_display_name: String, - pub published_at: Option<__sdk::Timestamp>, + pub published_at: Option::<__sdk::Timestamp>, pub created_at: __sdk::Timestamp, pub updated_at: __sdk::Timestamp, } + impl __sdk::InModule for CustomWorldProfile { type Module = super::RemoteModule; } + /// Column accessor struct for the table `CustomWorldProfile`. /// /// Provides typed access to columns for query building. pub struct CustomWorldProfileCols { pub profile_id: __sdk::__query_builder::Col, pub owner_user_id: __sdk::__query_builder::Col, - pub source_agent_session_id: __sdk::__query_builder::Col>, - pub publication_status: - __sdk::__query_builder::Col, + pub source_agent_session_id: __sdk::__query_builder::Col>, + pub publication_status: __sdk::__query_builder::Col, pub world_name: __sdk::__query_builder::Col, pub subtitle: __sdk::__query_builder::Col, pub summary_text: __sdk::__query_builder::Col, pub theme_mode: __sdk::__query_builder::Col, - pub cover_image_src: __sdk::__query_builder::Col>, + pub cover_image_src: __sdk::__query_builder::Col>, pub profile_payload_json: __sdk::__query_builder::Col, pub playable_npc_count: __sdk::__query_builder::Col, pub landmark_count: __sdk::__query_builder::Col, pub author_display_name: __sdk::__query_builder::Col, - pub published_at: __sdk::__query_builder::Col>, + pub published_at: __sdk::__query_builder::Col>, pub created_at: __sdk::__query_builder::Col, pub updated_at: __sdk::__query_builder::Col, } @@ -61,29 +67,21 @@ impl __sdk::__query_builder::HasCols for CustomWorldProfile { CustomWorldProfileCols { profile_id: __sdk::__query_builder::Col::new(table_name, "profile_id"), owner_user_id: __sdk::__query_builder::Col::new(table_name, "owner_user_id"), - source_agent_session_id: __sdk::__query_builder::Col::new( - table_name, - "source_agent_session_id", - ), + source_agent_session_id: __sdk::__query_builder::Col::new(table_name, "source_agent_session_id"), publication_status: __sdk::__query_builder::Col::new(table_name, "publication_status"), world_name: __sdk::__query_builder::Col::new(table_name, "world_name"), subtitle: __sdk::__query_builder::Col::new(table_name, "subtitle"), summary_text: __sdk::__query_builder::Col::new(table_name, "summary_text"), theme_mode: __sdk::__query_builder::Col::new(table_name, "theme_mode"), cover_image_src: __sdk::__query_builder::Col::new(table_name, "cover_image_src"), - profile_payload_json: __sdk::__query_builder::Col::new( - table_name, - "profile_payload_json", - ), + profile_payload_json: __sdk::__query_builder::Col::new(table_name, "profile_payload_json"), playable_npc_count: __sdk::__query_builder::Col::new(table_name, "playable_npc_count"), landmark_count: __sdk::__query_builder::Col::new(table_name, "landmark_count"), - author_display_name: __sdk::__query_builder::Col::new( - table_name, - "author_display_name", - ), + author_display_name: __sdk::__query_builder::Col::new(table_name, "author_display_name"), published_at: __sdk::__query_builder::Col::new(table_name, "published_at"), created_at: __sdk::__query_builder::Col::new(table_name, "created_at"), updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"), + } } } @@ -94,8 +92,7 @@ impl __sdk::__query_builder::HasCols for CustomWorldProfile { pub struct CustomWorldProfileIxCols { pub owner_user_id: __sdk::__query_builder::IxCol, pub profile_id: __sdk::__query_builder::IxCol, - pub publication_status: - __sdk::__query_builder::IxCol, + pub publication_status: __sdk::__query_builder::IxCol, } impl __sdk::__query_builder::HasIxCols for CustomWorldProfile { @@ -104,12 +101,11 @@ impl __sdk::__query_builder::HasIxCols for CustomWorldProfile { CustomWorldProfileIxCols { owner_user_id: __sdk::__query_builder::IxCol::new(table_name, "owner_user_id"), profile_id: __sdk::__query_builder::IxCol::new(table_name, "profile_id"), - publication_status: __sdk::__query_builder::IxCol::new( - table_name, - "publication_status", - ), + publication_status: __sdk::__query_builder::IxCol::new(table_name, "publication_status"), + } } } impl __sdk::__query_builder::CanBeLookupTable for CustomWorldProfile {} + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_profile_unpublish_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_profile_unpublish_input_type.rs index 7d688d96..79aa9ff6 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_profile_unpublish_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_profile_unpublish_input_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -13,6 +19,8 @@ pub struct CustomWorldProfileUnpublishInput { pub updated_at_micros: i64, } + impl __sdk::InModule for CustomWorldProfileUnpublishInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_profile_upsert_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_profile_upsert_input_type.rs index f9a00111..53761a14 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_profile_upsert_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_profile_upsert_input_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_theme_mode_type::CustomWorldThemeMode; @@ -11,12 +16,12 @@ use super::custom_world_theme_mode_type::CustomWorldThemeMode; pub struct CustomWorldProfileUpsertInput { pub profile_id: String, pub owner_user_id: String, - pub source_agent_session_id: Option, + pub source_agent_session_id: Option::, pub world_name: String, pub subtitle: String, pub summary_text: String, pub theme_mode: CustomWorldThemeMode, - pub cover_image_src: Option, + pub cover_image_src: Option::, pub profile_payload_json: String, pub playable_npc_count: u32, pub landmark_count: u32, @@ -24,6 +29,8 @@ pub struct CustomWorldProfileUpsertInput { pub updated_at_micros: i64, } + impl __sdk::InModule for CustomWorldProfileUpsertInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_publication_status_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_publication_status_type.rs index f21186ff..d81681f4 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_publication_status_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_publication_status_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -11,8 +16,12 @@ pub enum CustomWorldPublicationStatus { Draft, Published, + } + + impl __sdk::InModule for CustomWorldPublicationStatus { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_publish_world_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_publish_world_input_type.rs index 206dffb9..f59454ef 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_publish_world_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_publish_world_input_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -11,12 +17,14 @@ pub struct CustomWorldPublishWorldInput { pub profile_id: String, pub owner_user_id: String, pub draft_profile_json: String, - pub legacy_result_profile_json: Option, + pub legacy_result_profile_json: Option::, pub setting_text: String, pub author_display_name: String, pub published_at_micros: i64, } + impl __sdk::InModule for CustomWorldPublishWorldInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_publish_world_result_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_publish_world_result_type.rs index a44ca2b1..542810a3 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_publish_world_result_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_publish_world_result_type.rs @@ -2,24 +2,31 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_gallery_entry_snapshot_type::CustomWorldGalleryEntrySnapshot; -use super::custom_world_profile_snapshot_type::CustomWorldProfileSnapshot; use super::custom_world_published_profile_compile_snapshot_type::CustomWorldPublishedProfileCompileSnapshot; use super::rpg_agent_stage_type::RpgAgentStage; +use super::custom_world_profile_snapshot_type::CustomWorldProfileSnapshot; +use super::custom_world_gallery_entry_snapshot_type::CustomWorldGalleryEntrySnapshot; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] pub struct CustomWorldPublishWorldResult { pub ok: bool, - pub compiled_record: Option, - pub entry: Option, - pub gallery_entry: Option, - pub session_stage: Option, - pub error_message: Option, + pub compiled_record: Option::, + pub entry: Option::, + pub gallery_entry: Option::, + pub session_stage: Option::, + pub error_message: Option::, } + impl __sdk::InModule for CustomWorldPublishWorldResult { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_published_profile_compile_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_published_profile_compile_input_type.rs index fda3d08b..c78399a4 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_published_profile_compile_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_published_profile_compile_input_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -11,12 +17,14 @@ pub struct CustomWorldPublishedProfileCompileInput { pub profile_id: String, pub owner_user_id: String, pub draft_profile_json: String, - pub legacy_result_profile_json: Option, + pub legacy_result_profile_json: Option::, pub setting_text: String, pub author_display_name: String, pub updated_at_micros: i64, } + impl __sdk::InModule for CustomWorldPublishedProfileCompileInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_published_profile_compile_result_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_published_profile_compile_result_type.rs index 4783f889..42d770b5 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_published_profile_compile_result_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_published_profile_compile_result_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_snapshot_type::CustomWorldPublishedProfileCompileSnapshot; @@ -10,10 +15,12 @@ use super::custom_world_published_profile_compile_snapshot_type::CustomWorldPubl #[sats(crate = __lib)] pub struct CustomWorldPublishedProfileCompileResult { pub ok: bool, - pub record: Option, - pub error_message: Option, + pub record: Option::, + pub error_message: Option::, } + impl __sdk::InModule for CustomWorldPublishedProfileCompileResult { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_published_profile_compile_snapshot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_published_profile_compile_snapshot_type.rs index 0af4d59e..9214b492 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_published_profile_compile_snapshot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_published_profile_compile_snapshot_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_theme_mode_type::CustomWorldThemeMode; @@ -15,7 +20,7 @@ pub struct CustomWorldPublishedProfileCompileSnapshot { pub subtitle: String, pub summary_text: String, pub theme_mode: CustomWorldThemeMode, - pub cover_image_src: Option, + pub cover_image_src: Option::, pub playable_npc_count: u32, pub landmark_count: u32, pub author_display_name: String, @@ -23,6 +28,8 @@ pub struct CustomWorldPublishedProfileCompileSnapshot { pub updated_at_micros: i64, } + impl __sdk::InModule for CustomWorldPublishedProfileCompileSnapshot { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_role_asset_status_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_role_asset_status_type.rs index 1ab238e9..a969aa55 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_role_asset_status_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_role_asset_status_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -15,8 +20,12 @@ pub enum CustomWorldRoleAssetStatus { AnimationsReady, Complete, + } + + impl __sdk::InModule for CustomWorldRoleAssetStatus { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_session_status_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_session_status_type.rs index 9b640e4f..f7fe499d 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_session_status_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_session_status_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -17,8 +22,12 @@ pub enum CustomWorldSessionStatus { Completed, GenerationError, + } + + impl __sdk::InModule for CustomWorldSessionStatus { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_session_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_session_table.rs index 2813b6e2..4d44d0ff 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_session_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_session_table.rs @@ -2,10 +2,15 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![allow(unused, clippy::all)] +use spacetimedb_sdk::__codegen::{ + self as __sdk, + __lib, + __sats, + __ws, +}; +use super::custom_world_session_type::CustomWorldSession; use super::custom_world_generation_mode_type::CustomWorldGenerationMode; use super::custom_world_session_status_type::CustomWorldSessionStatus; -use super::custom_world_session_type::CustomWorldSession; -use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; /// Table handle for the table `custom_world_session`. /// @@ -33,9 +38,7 @@ pub trait CustomWorldSessionTableAccess { impl CustomWorldSessionTableAccess for super::RemoteTables { fn custom_world_session(&self) -> CustomWorldSessionTableHandle<'_> { CustomWorldSessionTableHandle { - imp: self - .imp - .get_table::("custom_world_session"), + imp: self.imp.get_table::("custom_world_session"), ctx: std::marker::PhantomData, } } @@ -48,12 +51,8 @@ impl<'ctx> __sdk::Table for CustomWorldSessionTableHandle<'ctx> { type Row = CustomWorldSession; type EventContext = super::EventContext; - fn count(&self) -> u64 { - self.imp.count() - } - fn iter(&self) -> impl Iterator + '_ { - self.imp.iter() - } + fn count(&self) -> u64 { self.imp.count() } + fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } type InsertCallbackId = CustomWorldSessionInsertCallbackId; @@ -99,38 +98,39 @@ impl<'ctx> __sdk::TableWithPrimaryKey for CustomWorldSessionTableHandle<'ctx> { } } -/// Access to the `session_id` unique index on the table `custom_world_session`, -/// which allows point queries on the field of the same name -/// via the [`CustomWorldSessionSessionIdUnique::find`] method. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.custom_world_session().session_id().find(...)`. -pub struct CustomWorldSessionSessionIdUnique<'ctx> { - imp: __sdk::UniqueConstraintHandle, - phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, -} - -impl<'ctx> CustomWorldSessionTableHandle<'ctx> { - /// Get a handle on the `session_id` unique index on the table `custom_world_session`. - pub fn session_id(&self) -> CustomWorldSessionSessionIdUnique<'ctx> { - CustomWorldSessionSessionIdUnique { - imp: self.imp.get_unique_constraint::("session_id"), - phantom: std::marker::PhantomData, + /// Access to the `session_id` unique index on the table `custom_world_session`, + /// which allows point queries on the field of the same name + /// via the [`CustomWorldSessionSessionIdUnique::find`] method. + /// + /// Users are encouraged not to explicitly reference this type, + /// but to directly chain method calls, + /// like `ctx.db.custom_world_session().session_id().find(...)`. + pub struct CustomWorldSessionSessionIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } - } -} -impl<'ctx> CustomWorldSessionSessionIdUnique<'ctx> { - /// Find the subscribed row whose `session_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 { - self.imp.find(col_val) - } -} + impl<'ctx> CustomWorldSessionTableHandle<'ctx> { + /// Get a handle on the `session_id` unique index on the table `custom_world_session`. + pub fn session_id(&self) -> CustomWorldSessionSessionIdUnique<'ctx> { + CustomWorldSessionSessionIdUnique { + imp: self.imp.get_unique_constraint::("session_id"), + phantom: std::marker::PhantomData, + } + } + } + impl<'ctx> CustomWorldSessionSessionIdUnique<'ctx> { + /// Find the subscribed row whose `session_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 { + self.imp.find(col_val) + } + } + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("custom_world_session"); _table.add_unique_constraint::("session_id", |row| &row.session_id); } @@ -140,24 +140,26 @@ pub(super) fn parse_table_update( raw_updates: __ws::v2::TableUpdate, ) -> __sdk::Result<__sdk::TableUpdate> { __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { - __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") - .with_cause(e) - .into() + __sdk::InternalError::failed_parse( + "TableUpdate", + "TableUpdate", + ).with_cause(e).into() }) } -#[allow(non_camel_case_types)] -/// Extension trait for query builder access to the table `CustomWorldSession`. -/// -/// Implemented for [`__sdk::QueryTableAccessor`]. -pub trait custom_world_sessionQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `CustomWorldSession`. - fn custom_world_session(&self) -> __sdk::__query_builder::Table; -} + #[allow(non_camel_case_types)] + /// Extension trait for query builder access to the table `CustomWorldSession`. + /// + /// Implemented for [`__sdk::QueryTableAccessor`]. + pub trait custom_world_sessionQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `CustomWorldSession`. + fn custom_world_session(&self) -> __sdk::__query_builder::Table; + } + + impl custom_world_sessionQueryTableAccess for __sdk::QueryTableAccessor { + fn custom_world_session(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("custom_world_session") + } + } -impl custom_world_sessionQueryTableAccess for __sdk::QueryTableAccessor { - fn custom_world_session(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("custom_world_session") - } -} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_session_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_session_type.rs index 58e9f40c..2646073e 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_session_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_session_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_generation_mode_type::CustomWorldGenerationMode; use super::custom_world_session_status_type::CustomWorldSessionStatus; @@ -15,18 +20,20 @@ pub struct CustomWorldSession { pub generation_mode: CustomWorldGenerationMode, pub status: CustomWorldSessionStatus, pub setting_text: String, - pub creator_intent_json: Option, + pub creator_intent_json: Option::, pub question_snapshot_json: String, - pub result_payload_json: Option, - pub last_error_message: Option, + pub result_payload_json: Option::, + pub last_error_message: Option::, pub created_at: __sdk::Timestamp, pub updated_at: __sdk::Timestamp, } + impl __sdk::InModule for CustomWorldSession { type Module = super::RemoteModule; } + /// Column accessor struct for the table `CustomWorldSession`. /// /// Provides typed access to columns for query building. @@ -36,10 +43,10 @@ pub struct CustomWorldSessionCols { pub generation_mode: __sdk::__query_builder::Col, pub status: __sdk::__query_builder::Col, pub setting_text: __sdk::__query_builder::Col, - pub creator_intent_json: __sdk::__query_builder::Col>, + pub creator_intent_json: __sdk::__query_builder::Col>, pub question_snapshot_json: __sdk::__query_builder::Col, - pub result_payload_json: __sdk::__query_builder::Col>, - pub last_error_message: __sdk::__query_builder::Col>, + pub result_payload_json: __sdk::__query_builder::Col>, + pub last_error_message: __sdk::__query_builder::Col>, pub created_at: __sdk::__query_builder::Col, pub updated_at: __sdk::__query_builder::Col, } @@ -53,21 +60,13 @@ impl __sdk::__query_builder::HasCols for CustomWorldSession { generation_mode: __sdk::__query_builder::Col::new(table_name, "generation_mode"), status: __sdk::__query_builder::Col::new(table_name, "status"), setting_text: __sdk::__query_builder::Col::new(table_name, "setting_text"), - creator_intent_json: __sdk::__query_builder::Col::new( - table_name, - "creator_intent_json", - ), - question_snapshot_json: __sdk::__query_builder::Col::new( - table_name, - "question_snapshot_json", - ), - result_payload_json: __sdk::__query_builder::Col::new( - table_name, - "result_payload_json", - ), + creator_intent_json: __sdk::__query_builder::Col::new(table_name, "creator_intent_json"), + question_snapshot_json: __sdk::__query_builder::Col::new(table_name, "question_snapshot_json"), + result_payload_json: __sdk::__query_builder::Col::new(table_name, "result_payload_json"), last_error_message: __sdk::__query_builder::Col::new(table_name, "last_error_message"), created_at: __sdk::__query_builder::Col::new(table_name, "created_at"), updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"), + } } } @@ -86,8 +85,10 @@ impl __sdk::__query_builder::HasIxCols for CustomWorldSession { CustomWorldSessionIxCols { owner_user_id: __sdk::__query_builder::IxCol::new(table_name, "owner_user_id"), session_id: __sdk::__query_builder::IxCol::new(table_name, "session_id"), + } } } impl __sdk::__query_builder::CanBeLookupTable for CustomWorldSession {} + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_theme_mode_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_theme_mode_type.rs index 2084ea04..766d1d08 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_theme_mode_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_theme_mode_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -19,8 +24,12 @@ pub enum CustomWorldThemeMode { Rift, Mythic, + } + + impl __sdk::InModule for CustomWorldThemeMode { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/delete_runtime_snapshot_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/delete_runtime_snapshot_and_return_procedure.rs new file mode 100644 index 00000000..6c38b74b --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/delete_runtime_snapshot_and_return_procedure.rs @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use spacetimedb_sdk::__codegen::{ + self as __sdk, + __lib, + __sats, + __ws, +}; + +use super::runtime_snapshot_delete_input_type::RuntimeSnapshotDeleteInput; +use super::runtime_snapshot_procedure_result_type::RuntimeSnapshotProcedureResult; + +#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] +#[sats(crate = __lib)] + struct DeleteRuntimeSnapshotAndReturnArgs { + pub input: RuntimeSnapshotDeleteInput, +} + + +impl __sdk::InModule for DeleteRuntimeSnapshotAndReturnArgs { + type Module = super::RemoteModule; +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the procedure `delete_runtime_snapshot_and_return`. +/// +/// Implemented for [`super::RemoteProcedures`]. +pub trait delete_runtime_snapshot_and_return { + fn delete_runtime_snapshot_and_return(&self, input: RuntimeSnapshotDeleteInput, +) { + self.delete_runtime_snapshot_and_return_then(input, |_, _| {}); + } + + fn delete_runtime_snapshot_and_return_then( + &self, + input: RuntimeSnapshotDeleteInput, + + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + ); +} + +impl delete_runtime_snapshot_and_return for super::RemoteProcedures { + fn delete_runtime_snapshot_and_return_then( + &self, + input: RuntimeSnapshotDeleteInput, + + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + ) { + self.imp.invoke_procedure_with_callback::<_, RuntimeSnapshotProcedureResult>( + "delete_runtime_snapshot_and_return", + DeleteRuntimeSnapshotAndReturnArgs { input, }, + __callback, + ); + } +} + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/equip_inventory_item_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/equip_inventory_item_input_type.rs index 775ad7fa..19545699 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/equip_inventory_item_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/equip_inventory_item_input_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -10,6 +16,8 @@ pub struct EquipInventoryItemInput { pub slot_id: String, } + impl __sdk::InModule for EquipInventoryItemInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/fail_ai_task_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/fail_ai_task_and_return_procedure.rs index 46090a01..b92e796d 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/fail_ai_task_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/fail_ai_task_and_return_procedure.rs @@ -2,17 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_failure_input_type::AiTaskFailureInput; use super::ai_task_procedure_result_type::AiTaskProcedureResult; +use super::ai_task_failure_input_type::AiTaskFailureInput; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct FailAiTaskAndReturnArgs { + struct FailAiTaskAndReturnArgs { pub input: AiTaskFailureInput, } + impl __sdk::InModule for FailAiTaskAndReturnArgs { type Module = super::RemoteModule; } @@ -22,19 +28,16 @@ impl __sdk::InModule for FailAiTaskAndReturnArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait fail_ai_task_and_return { - fn fail_ai_task_and_return(&self, input: AiTaskFailureInput) { - self.fail_ai_task_and_return_then(input, |_, _| {}); + fn fail_ai_task_and_return(&self, input: AiTaskFailureInput, +) { + self.fail_ai_task_and_return_then(input, |_, _| {}); } fn fail_ai_task_and_return_then( &self, input: AiTaskFailureInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } @@ -43,17 +46,13 @@ impl fail_ai_task_and_return for super::RemoteProcedures { &self, input: AiTaskFailureInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, AiTaskProcedureResult>( - "fail_ai_task_and_return", - FailAiTaskAndReturnArgs { input }, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, AiTaskProcedureResult>( + "fail_ai_task_and_return", + FailAiTaskAndReturnArgs { input, }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/get_battle_state_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_battle_state_procedure.rs index a737fbdf..c6f93416 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_battle_state_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_battle_state_procedure.rs @@ -2,17 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_procedure_result_type::BattleStateProcedureResult; use super::battle_state_query_input_type::BattleStateQueryInput; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct GetBattleStateArgs { + struct GetBattleStateArgs { pub input: BattleStateQueryInput, } + impl __sdk::InModule for GetBattleStateArgs { type Module = super::RemoteModule; } @@ -22,19 +28,16 @@ impl __sdk::InModule for GetBattleStateArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait get_battle_state { - fn get_battle_state(&self, input: BattleStateQueryInput) { - self.get_battle_state_then(input, |_, _| {}); + fn get_battle_state(&self, input: BattleStateQueryInput, +) { + self.get_battle_state_then(input, |_, _| {}); } fn get_battle_state_then( &self, input: BattleStateQueryInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } @@ -43,17 +46,13 @@ impl get_battle_state for super::RemoteProcedures { &self, input: BattleStateQueryInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, BattleStateProcedureResult>( - "get_battle_state", - GetBattleStateArgs { input }, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, BattleStateProcedureResult>( + "get_battle_state", + GetBattleStateArgs { input, }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/get_chapter_progression_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_chapter_progression_procedure.rs index eef158dc..dc75dc77 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_chapter_progression_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_chapter_progression_procedure.rs @@ -2,17 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_get_input_type::ChapterProgressionGetInput; use super::chapter_progression_procedure_result_type::ChapterProgressionProcedureResult; +use super::chapter_progression_get_input_type::ChapterProgressionGetInput; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct GetChapterProgressionArgs { + struct GetChapterProgressionArgs { pub input: ChapterProgressionGetInput, } + impl __sdk::InModule for GetChapterProgressionArgs { type Module = super::RemoteModule; } @@ -22,19 +28,16 @@ impl __sdk::InModule for GetChapterProgressionArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait get_chapter_progression { - fn get_chapter_progression(&self, input: ChapterProgressionGetInput) { - self.get_chapter_progression_then(input, |_, _| {}); + fn get_chapter_progression(&self, input: ChapterProgressionGetInput, +) { + self.get_chapter_progression_then(input, |_, _| {}); } fn get_chapter_progression_then( &self, input: ChapterProgressionGetInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } @@ -43,17 +46,13 @@ impl get_chapter_progression for super::RemoteProcedures { &self, input: ChapterProgressionGetInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, ChapterProgressionProcedureResult>( - "get_chapter_progression", - GetChapterProgressionArgs { input }, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, ChapterProgressionProcedureResult>( + "get_chapter_progression", + GetChapterProgressionArgs { input, }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/get_custom_world_agent_operation_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_custom_world_agent_operation_procedure.rs index 1c4ffd6a..e8a4f855 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_custom_world_agent_operation_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_custom_world_agent_operation_procedure.rs @@ -2,17 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_get_input_type::CustomWorldAgentOperationGetInput; use super::custom_world_agent_operation_procedure_result_type::CustomWorldAgentOperationProcedureResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct GetCustomWorldAgentOperationArgs { + struct GetCustomWorldAgentOperationArgs { pub input: CustomWorldAgentOperationGetInput, } + impl __sdk::InModule for GetCustomWorldAgentOperationArgs { type Module = super::RemoteModule; } @@ -22,19 +28,16 @@ impl __sdk::InModule for GetCustomWorldAgentOperationArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait get_custom_world_agent_operation { - fn get_custom_world_agent_operation(&self, input: CustomWorldAgentOperationGetInput) { - self.get_custom_world_agent_operation_then(input, |_, _| {}); + fn get_custom_world_agent_operation(&self, input: CustomWorldAgentOperationGetInput, +) { + self.get_custom_world_agent_operation_then(input, |_, _| {}); } fn get_custom_world_agent_operation_then( &self, input: CustomWorldAgentOperationGetInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } @@ -43,17 +46,13 @@ impl get_custom_world_agent_operation for super::RemoteProcedures { &self, input: CustomWorldAgentOperationGetInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, CustomWorldAgentOperationProcedureResult>( - "get_custom_world_agent_operation", - GetCustomWorldAgentOperationArgs { input }, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, CustomWorldAgentOperationProcedureResult>( + "get_custom_world_agent_operation", + GetCustomWorldAgentOperationArgs { input, }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/get_custom_world_agent_session_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_custom_world_agent_session_procedure.rs index 212987e4..e1660a95 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_custom_world_agent_session_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_custom_world_agent_session_procedure.rs @@ -2,17 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_get_input_type::CustomWorldAgentSessionGetInput; use super::custom_world_agent_session_procedure_result_type::CustomWorldAgentSessionProcedureResult; +use super::custom_world_agent_session_get_input_type::CustomWorldAgentSessionGetInput; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct GetCustomWorldAgentSessionArgs { + struct GetCustomWorldAgentSessionArgs { pub input: CustomWorldAgentSessionGetInput, } + impl __sdk::InModule for GetCustomWorldAgentSessionArgs { type Module = super::RemoteModule; } @@ -22,19 +28,16 @@ impl __sdk::InModule for GetCustomWorldAgentSessionArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait get_custom_world_agent_session { - fn get_custom_world_agent_session(&self, input: CustomWorldAgentSessionGetInput) { - self.get_custom_world_agent_session_then(input, |_, _| {}); + fn get_custom_world_agent_session(&self, input: CustomWorldAgentSessionGetInput, +) { + self.get_custom_world_agent_session_then(input, |_, _| {}); } fn get_custom_world_agent_session_then( &self, input: CustomWorldAgentSessionGetInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } @@ -43,17 +46,13 @@ impl get_custom_world_agent_session for super::RemoteProcedures { &self, input: CustomWorldAgentSessionGetInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, CustomWorldAgentSessionProcedureResult>( - "get_custom_world_agent_session", - GetCustomWorldAgentSessionArgs { input }, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, CustomWorldAgentSessionProcedureResult>( + "get_custom_world_agent_session", + GetCustomWorldAgentSessionArgs { input, }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/get_custom_world_gallery_detail_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_custom_world_gallery_detail_procedure.rs index f5127dcf..79050c11 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_custom_world_gallery_detail_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_custom_world_gallery_detail_procedure.rs @@ -2,17 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_gallery_detail_input_type::CustomWorldGalleryDetailInput; use super::custom_world_library_mutation_result_type::CustomWorldLibraryMutationResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct GetCustomWorldGalleryDetailArgs { + struct GetCustomWorldGalleryDetailArgs { pub input: CustomWorldGalleryDetailInput, } + impl __sdk::InModule for GetCustomWorldGalleryDetailArgs { type Module = super::RemoteModule; } @@ -22,19 +28,16 @@ impl __sdk::InModule for GetCustomWorldGalleryDetailArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait get_custom_world_gallery_detail { - fn get_custom_world_gallery_detail(&self, input: CustomWorldGalleryDetailInput) { - self.get_custom_world_gallery_detail_then(input, |_, _| {}); + fn get_custom_world_gallery_detail(&self, input: CustomWorldGalleryDetailInput, +) { + self.get_custom_world_gallery_detail_then(input, |_, _| {}); } fn get_custom_world_gallery_detail_then( &self, input: CustomWorldGalleryDetailInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } @@ -43,17 +46,13 @@ impl get_custom_world_gallery_detail for super::RemoteProcedures { &self, input: CustomWorldGalleryDetailInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, CustomWorldLibraryMutationResult>( - "get_custom_world_gallery_detail", - GetCustomWorldGalleryDetailArgs { input }, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, CustomWorldLibraryMutationResult>( + "get_custom_world_gallery_detail", + GetCustomWorldGalleryDetailArgs { input, }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/get_custom_world_library_detail_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_custom_world_library_detail_procedure.rs index ab99274a..175758c2 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_custom_world_library_detail_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_custom_world_library_detail_procedure.rs @@ -2,17 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_library_detail_input_type::CustomWorldLibraryDetailInput; use super::custom_world_library_mutation_result_type::CustomWorldLibraryMutationResult; +use super::custom_world_library_detail_input_type::CustomWorldLibraryDetailInput; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct GetCustomWorldLibraryDetailArgs { + struct GetCustomWorldLibraryDetailArgs { pub input: CustomWorldLibraryDetailInput, } + impl __sdk::InModule for GetCustomWorldLibraryDetailArgs { type Module = super::RemoteModule; } @@ -22,19 +28,16 @@ impl __sdk::InModule for GetCustomWorldLibraryDetailArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait get_custom_world_library_detail { - fn get_custom_world_library_detail(&self, input: CustomWorldLibraryDetailInput) { - self.get_custom_world_library_detail_then(input, |_, _| {}); + fn get_custom_world_library_detail(&self, input: CustomWorldLibraryDetailInput, +) { + self.get_custom_world_library_detail_then(input, |_, _| {}); } fn get_custom_world_library_detail_then( &self, input: CustomWorldLibraryDetailInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } @@ -43,17 +46,13 @@ impl get_custom_world_library_detail for super::RemoteProcedures { &self, input: CustomWorldLibraryDetailInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, CustomWorldLibraryMutationResult>( - "get_custom_world_library_detail", - GetCustomWorldLibraryDetailArgs { input }, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, CustomWorldLibraryMutationResult>( + "get_custom_world_library_detail", + GetCustomWorldLibraryDetailArgs { input, }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/get_player_progression_or_default_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_player_progression_or_default_procedure.rs index 97c139fb..73490884 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_player_progression_or_default_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_player_progression_or_default_procedure.rs @@ -2,17 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::player_progression_get_input_type::PlayerProgressionGetInput; use super::player_progression_procedure_result_type::PlayerProgressionProcedureResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct GetPlayerProgressionOrDefaultArgs { + struct GetPlayerProgressionOrDefaultArgs { pub input: PlayerProgressionGetInput, } + impl __sdk::InModule for GetPlayerProgressionOrDefaultArgs { type Module = super::RemoteModule; } @@ -22,19 +28,16 @@ impl __sdk::InModule for GetPlayerProgressionOrDefaultArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait get_player_progression_or_default { - fn get_player_progression_or_default(&self, input: PlayerProgressionGetInput) { - self.get_player_progression_or_default_then(input, |_, _| {}); + fn get_player_progression_or_default(&self, input: PlayerProgressionGetInput, +) { + self.get_player_progression_or_default_then(input, |_, _| {}); } fn get_player_progression_or_default_then( &self, input: PlayerProgressionGetInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } @@ -43,17 +46,13 @@ impl get_player_progression_or_default for super::RemoteProcedures { &self, input: PlayerProgressionGetInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, PlayerProgressionProcedureResult>( - "get_player_progression_or_default", - GetPlayerProgressionOrDefaultArgs { input }, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, PlayerProgressionProcedureResult>( + "get_player_progression_or_default", + GetPlayerProgressionOrDefaultArgs { input, }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/get_profile_dashboard_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_profile_dashboard_procedure.rs index 38200b75..616a11b8 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_profile_dashboard_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_profile_dashboard_procedure.rs @@ -2,17 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_profile_dashboard_get_input_type::RuntimeProfileDashboardGetInput; use super::runtime_profile_dashboard_procedure_result_type::RuntimeProfileDashboardProcedureResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct GetProfileDashboardArgs { + struct GetProfileDashboardArgs { pub input: RuntimeProfileDashboardGetInput, } + impl __sdk::InModule for GetProfileDashboardArgs { type Module = super::RemoteModule; } @@ -22,19 +28,16 @@ impl __sdk::InModule for GetProfileDashboardArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait get_profile_dashboard { - fn get_profile_dashboard(&self, input: RuntimeProfileDashboardGetInput) { - self.get_profile_dashboard_then(input, |_, _| {}); + fn get_profile_dashboard(&self, input: RuntimeProfileDashboardGetInput, +) { + self.get_profile_dashboard_then(input, |_, _| {}); } fn get_profile_dashboard_then( &self, input: RuntimeProfileDashboardGetInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } @@ -43,17 +46,13 @@ impl get_profile_dashboard for super::RemoteProcedures { &self, input: RuntimeProfileDashboardGetInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, RuntimeProfileDashboardProcedureResult>( - "get_profile_dashboard", - GetProfileDashboardArgs { input }, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, RuntimeProfileDashboardProcedureResult>( + "get_profile_dashboard", + GetProfileDashboardArgs { input, }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/get_profile_play_stats_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_profile_play_stats_procedure.rs index 2ad47ed2..466c6902 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_profile_play_stats_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_profile_play_stats_procedure.rs @@ -2,17 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_profile_play_stats_get_input_type::RuntimeProfilePlayStatsGetInput; use super::runtime_profile_play_stats_procedure_result_type::RuntimeProfilePlayStatsProcedureResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct GetProfilePlayStatsArgs { + struct GetProfilePlayStatsArgs { pub input: RuntimeProfilePlayStatsGetInput, } + impl __sdk::InModule for GetProfilePlayStatsArgs { type Module = super::RemoteModule; } @@ -22,19 +28,16 @@ impl __sdk::InModule for GetProfilePlayStatsArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait get_profile_play_stats { - fn get_profile_play_stats(&self, input: RuntimeProfilePlayStatsGetInput) { - self.get_profile_play_stats_then(input, |_, _| {}); + fn get_profile_play_stats(&self, input: RuntimeProfilePlayStatsGetInput, +) { + self.get_profile_play_stats_then(input, |_, _| {}); } fn get_profile_play_stats_then( &self, input: RuntimeProfilePlayStatsGetInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } @@ -43,17 +46,13 @@ impl get_profile_play_stats for super::RemoteProcedures { &self, input: RuntimeProfilePlayStatsGetInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, RuntimeProfilePlayStatsProcedureResult>( - "get_profile_play_stats", - GetProfilePlayStatsArgs { input }, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, RuntimeProfilePlayStatsProcedureResult>( + "get_profile_play_stats", + GetProfilePlayStatsArgs { input, }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/get_runtime_inventory_state_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_runtime_inventory_state_procedure.rs index abbf4f20..d5137496 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_runtime_inventory_state_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_runtime_inventory_state_procedure.rs @@ -2,17 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_inventory_state_procedure_result_type::RuntimeInventoryStateProcedureResult; use super::runtime_inventory_state_query_input_type::RuntimeInventoryStateQueryInput; +use super::runtime_inventory_state_procedure_result_type::RuntimeInventoryStateProcedureResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct GetRuntimeInventoryStateArgs { + struct GetRuntimeInventoryStateArgs { pub input: RuntimeInventoryStateQueryInput, } + impl __sdk::InModule for GetRuntimeInventoryStateArgs { type Module = super::RemoteModule; } @@ -22,19 +28,16 @@ impl __sdk::InModule for GetRuntimeInventoryStateArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait get_runtime_inventory_state { - fn get_runtime_inventory_state(&self, input: RuntimeInventoryStateQueryInput) { - self.get_runtime_inventory_state_then(input, |_, _| {}); + fn get_runtime_inventory_state(&self, input: RuntimeInventoryStateQueryInput, +) { + self.get_runtime_inventory_state_then(input, |_, _| {}); } fn get_runtime_inventory_state_then( &self, input: RuntimeInventoryStateQueryInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } @@ -43,17 +46,13 @@ impl get_runtime_inventory_state for super::RemoteProcedures { &self, input: RuntimeInventoryStateQueryInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, RuntimeInventoryStateProcedureResult>( - "get_runtime_inventory_state", - GetRuntimeInventoryStateArgs { input }, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, RuntimeInventoryStateProcedureResult>( + "get_runtime_inventory_state", + GetRuntimeInventoryStateArgs { input, }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/get_runtime_setting_or_default_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_runtime_setting_or_default_procedure.rs index 261caed1..a58e515c 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_runtime_setting_or_default_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_runtime_setting_or_default_procedure.rs @@ -2,17 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_setting_get_input_type::RuntimeSettingGetInput; use super::runtime_setting_procedure_result_type::RuntimeSettingProcedureResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct GetRuntimeSettingOrDefaultArgs { + struct GetRuntimeSettingOrDefaultArgs { pub input: RuntimeSettingGetInput, } + impl __sdk::InModule for GetRuntimeSettingOrDefaultArgs { type Module = super::RemoteModule; } @@ -22,19 +28,16 @@ impl __sdk::InModule for GetRuntimeSettingOrDefaultArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait get_runtime_setting_or_default { - fn get_runtime_setting_or_default(&self, input: RuntimeSettingGetInput) { - self.get_runtime_setting_or_default_then(input, |_, _| {}); + fn get_runtime_setting_or_default(&self, input: RuntimeSettingGetInput, +) { + self.get_runtime_setting_or_default_then(input, |_, _| {}); } fn get_runtime_setting_or_default_then( &self, input: RuntimeSettingGetInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } @@ -43,17 +46,13 @@ impl get_runtime_setting_or_default for super::RemoteProcedures { &self, input: RuntimeSettingGetInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, RuntimeSettingProcedureResult>( - "get_runtime_setting_or_default", - GetRuntimeSettingOrDefaultArgs { input }, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, RuntimeSettingProcedureResult>( + "get_runtime_setting_or_default", + GetRuntimeSettingOrDefaultArgs { input, }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/get_runtime_snapshot_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_runtime_snapshot_procedure.rs new file mode 100644 index 00000000..75117d98 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_runtime_snapshot_procedure.rs @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use spacetimedb_sdk::__codegen::{ + self as __sdk, + __lib, + __sats, + __ws, +}; + +use super::runtime_snapshot_procedure_result_type::RuntimeSnapshotProcedureResult; +use super::runtime_snapshot_get_input_type::RuntimeSnapshotGetInput; + +#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] +#[sats(crate = __lib)] + struct GetRuntimeSnapshotArgs { + pub input: RuntimeSnapshotGetInput, +} + + +impl __sdk::InModule for GetRuntimeSnapshotArgs { + type Module = super::RemoteModule; +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the procedure `get_runtime_snapshot`. +/// +/// Implemented for [`super::RemoteProcedures`]. +pub trait get_runtime_snapshot { + fn get_runtime_snapshot(&self, input: RuntimeSnapshotGetInput, +) { + self.get_runtime_snapshot_then(input, |_, _| {}); + } + + fn get_runtime_snapshot_then( + &self, + input: RuntimeSnapshotGetInput, + + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + ); +} + +impl get_runtime_snapshot for super::RemoteProcedures { + fn get_runtime_snapshot_then( + &self, + input: RuntimeSnapshotGetInput, + + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + ) { + self.imp.invoke_procedure_with_callback::<_, RuntimeSnapshotProcedureResult>( + "get_runtime_snapshot", + GetRuntimeSnapshotArgs { input, }, + __callback, + ); + } +} + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/get_story_session_state_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_story_session_state_procedure.rs index 7e566dc9..b454ab5d 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_story_session_state_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_story_session_state_procedure.rs @@ -2,17 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_state_input_type::StorySessionStateInput; use super::story_session_state_procedure_result_type::StorySessionStateProcedureResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct GetStorySessionStateArgs { + struct GetStorySessionStateArgs { pub input: StorySessionStateInput, } + impl __sdk::InModule for GetStorySessionStateArgs { type Module = super::RemoteModule; } @@ -22,19 +28,16 @@ impl __sdk::InModule for GetStorySessionStateArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait get_story_session_state { - fn get_story_session_state(&self, input: StorySessionStateInput) { - self.get_story_session_state_then(input, |_, _| {}); + fn get_story_session_state(&self, input: StorySessionStateInput, +) { + self.get_story_session_state_then(input, |_, _| {}); } fn get_story_session_state_then( &self, input: StorySessionStateInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } @@ -43,17 +46,13 @@ impl get_story_session_state for super::RemoteProcedures { &self, input: StorySessionStateInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, StorySessionStateProcedureResult>( - "get_story_session_state", - GetStorySessionStateArgs { input }, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, StorySessionStateProcedureResult>( + "get_story_session_state", + GetStorySessionStateArgs { input, }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/grant_inventory_item_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/grant_inventory_item_input_type.rs index 553aff65..c9389060 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/grant_inventory_item_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/grant_inventory_item_input_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_item_snapshot_type::InventoryItemSnapshot; @@ -13,6 +18,8 @@ pub struct GrantInventoryItemInput { pub item: InventoryItemSnapshot, } + impl __sdk::InModule for GrantInventoryItemInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/grant_player_progression_experience_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/grant_player_progression_experience_and_return_procedure.rs index 4c67da63..04e0ae9a 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/grant_player_progression_experience_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/grant_player_progression_experience_and_return_procedure.rs @@ -2,17 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::player_progression_grant_input_type::PlayerProgressionGrantInput; use super::player_progression_procedure_result_type::PlayerProgressionProcedureResult; +use super::player_progression_grant_input_type::PlayerProgressionGrantInput; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct GrantPlayerProgressionExperienceAndReturnArgs { + struct GrantPlayerProgressionExperienceAndReturnArgs { pub input: PlayerProgressionGrantInput, } + impl __sdk::InModule for GrantPlayerProgressionExperienceAndReturnArgs { type Module = super::RemoteModule; } @@ -22,19 +28,16 @@ impl __sdk::InModule for GrantPlayerProgressionExperienceAndReturnArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait grant_player_progression_experience_and_return { - fn grant_player_progression_experience_and_return(&self, input: PlayerProgressionGrantInput) { - self.grant_player_progression_experience_and_return_then(input, |_, _| {}); + fn grant_player_progression_experience_and_return(&self, input: PlayerProgressionGrantInput, +) { + self.grant_player_progression_experience_and_return_then(input, |_, _| {}); } fn grant_player_progression_experience_and_return_then( &self, input: PlayerProgressionGrantInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } @@ -43,17 +46,13 @@ impl grant_player_progression_experience_and_return for super::RemoteProcedures &self, input: PlayerProgressionGrantInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, PlayerProgressionProcedureResult>( - "grant_player_progression_experience_and_return", - GrantPlayerProgressionExperienceAndReturnArgs { input }, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, PlayerProgressionProcedureResult>( + "grant_player_progression_experience_and_return", + GrantPlayerProgressionExperienceAndReturnArgs { input, }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/grant_player_progression_experience_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/grant_player_progression_experience_reducer.rs index 83b48cf7..324bb57f 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/grant_player_progression_experience_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/grant_player_progression_experience_reducer.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::player_progression_grant_input_type::PlayerProgressionGrantInput; @@ -14,8 +19,10 @@ pub(super) struct GrantPlayerProgressionExperienceArgs { impl From for super::Reducer { fn from(args: GrantPlayerProgressionExperienceArgs) -> Self { - Self::GrantPlayerProgressionExperience { input: args.input } - } + Self::GrantPlayerProgressionExperience { + input: args.input, +} +} } impl __sdk::InModule for GrantPlayerProgressionExperienceArgs { @@ -33,11 +40,9 @@ pub trait grant_player_progression_experience { /// The reducer will run asynchronously in the future, /// and this method provides no way to listen for its completion status. /// /// Use [`grant_player_progression_experience:grant_player_progression_experience_then`] to run a callback after the reducer completes. - fn grant_player_progression_experience( - &self, - input: PlayerProgressionGrantInput, - ) -> __sdk::Result<()> { - self.grant_player_progression_experience_then(input, |_, _| {}) + fn grant_player_progression_experience(&self, input: PlayerProgressionGrantInput, +) -> __sdk::Result<()> { + self.grant_player_progression_experience_then(input, |_, _| {}) } /// Request that the remote module invoke the reducer `grant_player_progression_experience` to run as soon as possible, @@ -65,7 +70,7 @@ impl grant_player_progression_experience for super::RemoteReducers { + Send + 'static, ) -> __sdk::Result<()> { - self.imp - .invoke_reducer_with_callback(GrantPlayerProgressionExperienceArgs { input }, callback) + self.imp.invoke_reducer_with_callback(GrantPlayerProgressionExperienceArgs { input, }, callback) } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/inventory_container_kind_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/inventory_container_kind_type.rs index 45522ce7..23de3559 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/inventory_container_kind_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/inventory_container_kind_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -11,8 +16,12 @@ pub enum InventoryContainerKind { Backpack, Equipment, + } + + impl __sdk::InModule for InventoryContainerKind { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/inventory_equipment_slot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/inventory_equipment_slot_type.rs index e2055f6a..81154f9f 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/inventory_equipment_slot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/inventory_equipment_slot_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -13,8 +18,12 @@ pub enum InventoryEquipmentSlot { Armor, Relic, + } + + impl __sdk::InModule for InventoryEquipmentSlot { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/inventory_item_rarity_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/inventory_item_rarity_type.rs index 85b46090..e277c402 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/inventory_item_rarity_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/inventory_item_rarity_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -17,8 +22,12 @@ pub enum InventoryItemRarity { Epic, Legendary, + } + + impl __sdk::InModule for InventoryItemRarity { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/inventory_item_snapshot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/inventory_item_snapshot_type.rs index 3769735e..7e962e4d 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/inventory_item_snapshot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/inventory_item_snapshot_type.rs @@ -2,10 +2,15 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_equipment_slot_type::InventoryEquipmentSlot; use super::inventory_item_rarity_type::InventoryItemRarity; +use super::inventory_equipment_slot_type::InventoryEquipmentSlot; use super::inventory_item_source_kind_type::InventoryItemSourceKind; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] @@ -14,17 +19,19 @@ pub struct InventoryItemSnapshot { pub item_id: String, pub category: String, pub name: String, - pub description: Option, + pub description: Option::, pub quantity: u32, pub rarity: InventoryItemRarity, - pub tags: Vec, + pub tags: Vec::, pub stackable: bool, pub stack_key: String, - pub equipment_slot_id: Option, + pub equipment_slot_id: Option::, pub source_kind: InventoryItemSourceKind, - pub source_reference_id: Option, + pub source_reference_id: Option::, } + impl __sdk::InModule for InventoryItemSnapshot { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/inventory_item_source_kind_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/inventory_item_source_kind_type.rs index 1d3961bc..5303c581 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/inventory_item_source_kind_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/inventory_item_source_kind_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -25,8 +30,12 @@ pub enum InventoryItemSourceKind { ForgeReforge, ManualPatch, + } + + impl __sdk::InModule for InventoryItemSourceKind { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/inventory_mutation_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/inventory_mutation_input_type.rs index 3540ad3b..c696e383 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/inventory_mutation_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/inventory_mutation_input_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_type::InventoryMutation; @@ -11,12 +16,14 @@ use super::inventory_mutation_type::InventoryMutation; pub struct InventoryMutationInput { pub mutation_id: String, pub runtime_session_id: String, - pub story_session_id: Option, + pub story_session_id: Option::, pub actor_user_id: String, pub mutation: InventoryMutation, pub updated_at_micros: i64, } + impl __sdk::InModule for InventoryMutationInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/inventory_mutation_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/inventory_mutation_type.rs index 3d0d0e4f..d7b64029 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/inventory_mutation_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/inventory_mutation_type.rs @@ -2,11 +2,16 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::grant_inventory_item_input_type::GrantInventoryItemInput; use super::consume_inventory_item_input_type::ConsumeInventoryItemInput; use super::equip_inventory_item_input_type::EquipInventoryItemInput; -use super::grant_inventory_item_input_type::GrantInventoryItemInput; use super::unequip_inventory_item_input_type::UnequipInventoryItemInput; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] @@ -19,8 +24,12 @@ pub enum InventoryMutation { EquipItem(EquipInventoryItemInput), UnequipItem(UnequipInventoryItemInput), + } + + impl __sdk::InModule for InventoryMutation { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/inventory_slot_snapshot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/inventory_slot_snapshot_type.rs index f20e5451..4ce26de5 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/inventory_slot_snapshot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/inventory_slot_snapshot_type.rs @@ -2,38 +2,45 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_container_kind_type::InventoryContainerKind; -use super::inventory_equipment_slot_type::InventoryEquipmentSlot; use super::inventory_item_rarity_type::InventoryItemRarity; +use super::inventory_equipment_slot_type::InventoryEquipmentSlot; use super::inventory_item_source_kind_type::InventoryItemSourceKind; +use super::inventory_container_kind_type::InventoryContainerKind; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] pub struct InventorySlotSnapshot { pub slot_id: String, pub runtime_session_id: String, - pub story_session_id: Option, + pub story_session_id: Option::, pub actor_user_id: String, pub container_kind: InventoryContainerKind, pub slot_key: String, pub item_id: String, pub category: String, pub name: String, - pub description: Option, + pub description: Option::, pub quantity: u32, pub rarity: InventoryItemRarity, - pub tags: Vec, + pub tags: Vec::, pub stackable: bool, pub stack_key: String, - pub equipment_slot_id: Option, + pub equipment_slot_id: Option::, pub source_kind: InventoryItemSourceKind, - pub source_reference_id: Option, + pub source_reference_id: Option::, pub created_at_micros: i64, pub updated_at_micros: i64, } + impl __sdk::InModule for InventorySlotSnapshot { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/inventory_slot_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/inventory_slot_table.rs index 277df68a..da04ff99 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/inventory_slot_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/inventory_slot_table.rs @@ -2,12 +2,17 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![allow(unused, clippy::all)] -use super::inventory_container_kind_type::InventoryContainerKind; -use super::inventory_equipment_slot_type::InventoryEquipmentSlot; -use super::inventory_item_rarity_type::InventoryItemRarity; -use super::inventory_item_source_kind_type::InventoryItemSourceKind; +use spacetimedb_sdk::__codegen::{ + self as __sdk, + __lib, + __sats, + __ws, +}; use super::inventory_slot_type::InventorySlot; -use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; +use super::inventory_item_rarity_type::InventoryItemRarity; +use super::inventory_equipment_slot_type::InventoryEquipmentSlot; +use super::inventory_item_source_kind_type::InventoryItemSourceKind; +use super::inventory_container_kind_type::InventoryContainerKind; /// Table handle for the table `inventory_slot`. /// @@ -48,12 +53,8 @@ impl<'ctx> __sdk::Table for InventorySlotTableHandle<'ctx> { type Row = InventorySlot; type EventContext = super::EventContext; - fn count(&self) -> u64 { - self.imp.count() - } - fn iter(&self) -> impl Iterator + '_ { - self.imp.iter() - } + fn count(&self) -> u64 { self.imp.count() } + fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } type InsertCallbackId = InventorySlotInsertCallbackId; @@ -99,38 +100,39 @@ impl<'ctx> __sdk::TableWithPrimaryKey for InventorySlotTableHandle<'ctx> { } } -/// Access to the `slot_id` unique index on the table `inventory_slot`, -/// which allows point queries on the field of the same name -/// via the [`InventorySlotSlotIdUnique::find`] method. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.inventory_slot().slot_id().find(...)`. -pub struct InventorySlotSlotIdUnique<'ctx> { - imp: __sdk::UniqueConstraintHandle, - phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, -} - -impl<'ctx> InventorySlotTableHandle<'ctx> { - /// Get a handle on the `slot_id` unique index on the table `inventory_slot`. - pub fn slot_id(&self) -> InventorySlotSlotIdUnique<'ctx> { - InventorySlotSlotIdUnique { - imp: self.imp.get_unique_constraint::("slot_id"), - phantom: std::marker::PhantomData, + /// Access to the `slot_id` unique index on the table `inventory_slot`, + /// which allows point queries on the field of the same name + /// via the [`InventorySlotSlotIdUnique::find`] method. + /// + /// Users are encouraged not to explicitly reference this type, + /// but to directly chain method calls, + /// like `ctx.db.inventory_slot().slot_id().find(...)`. + pub struct InventorySlotSlotIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } - } -} -impl<'ctx> InventorySlotSlotIdUnique<'ctx> { - /// Find the subscribed row whose `slot_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 { - self.imp.find(col_val) - } -} + impl<'ctx> InventorySlotTableHandle<'ctx> { + /// Get a handle on the `slot_id` unique index on the table `inventory_slot`. + pub fn slot_id(&self) -> InventorySlotSlotIdUnique<'ctx> { + InventorySlotSlotIdUnique { + imp: self.imp.get_unique_constraint::("slot_id"), + phantom: std::marker::PhantomData, + } + } + } + impl<'ctx> InventorySlotSlotIdUnique<'ctx> { + /// Find the subscribed row whose `slot_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 { + self.imp.find(col_val) + } + } + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("inventory_slot"); _table.add_unique_constraint::("slot_id", |row| &row.slot_id); } @@ -140,24 +142,26 @@ pub(super) fn parse_table_update( raw_updates: __ws::v2::TableUpdate, ) -> __sdk::Result<__sdk::TableUpdate> { __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { - __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") - .with_cause(e) - .into() + __sdk::InternalError::failed_parse( + "TableUpdate", + "TableUpdate", + ).with_cause(e).into() }) } -#[allow(non_camel_case_types)] -/// Extension trait for query builder access to the table `InventorySlot`. -/// -/// Implemented for [`__sdk::QueryTableAccessor`]. -pub trait inventory_slotQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `InventorySlot`. - fn inventory_slot(&self) -> __sdk::__query_builder::Table; -} + #[allow(non_camel_case_types)] + /// Extension trait for query builder access to the table `InventorySlot`. + /// + /// Implemented for [`__sdk::QueryTableAccessor`]. + pub trait inventory_slotQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `InventorySlot`. + fn inventory_slot(&self) -> __sdk::__query_builder::Table; + } + + impl inventory_slotQueryTableAccess for __sdk::QueryTableAccessor { + fn inventory_slot(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("inventory_slot") + } + } -impl inventory_slotQueryTableAccess for __sdk::QueryTableAccessor { - fn inventory_slot(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("inventory_slot") - } -} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/inventory_slot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/inventory_slot_type.rs index fcfbab6a..c824c438 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/inventory_slot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/inventory_slot_type.rs @@ -2,65 +2,71 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_container_kind_type::InventoryContainerKind; -use super::inventory_equipment_slot_type::InventoryEquipmentSlot; use super::inventory_item_rarity_type::InventoryItemRarity; +use super::inventory_equipment_slot_type::InventoryEquipmentSlot; use super::inventory_item_source_kind_type::InventoryItemSourceKind; +use super::inventory_container_kind_type::InventoryContainerKind; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] pub struct InventorySlot { pub slot_id: String, pub runtime_session_id: String, - pub story_session_id: Option, + pub story_session_id: Option::, pub actor_user_id: String, pub container_kind: InventoryContainerKind, pub slot_key: String, pub item_id: String, pub category: String, pub name: String, - pub description: Option, + pub description: Option::, pub quantity: u32, pub rarity: InventoryItemRarity, - pub tags: Vec, + pub tags: Vec::, pub stackable: bool, pub stack_key: String, - pub equipment_slot_id: Option, + pub equipment_slot_id: Option::, pub source_kind: InventoryItemSourceKind, - pub source_reference_id: Option, + pub source_reference_id: Option::, pub created_at: __sdk::Timestamp, pub updated_at: __sdk::Timestamp, } + impl __sdk::InModule for InventorySlot { type Module = super::RemoteModule; } + /// Column accessor struct for the table `InventorySlot`. /// /// Provides typed access to columns for query building. pub struct InventorySlotCols { pub slot_id: __sdk::__query_builder::Col, pub runtime_session_id: __sdk::__query_builder::Col, - pub story_session_id: __sdk::__query_builder::Col>, + pub story_session_id: __sdk::__query_builder::Col>, pub actor_user_id: __sdk::__query_builder::Col, pub container_kind: __sdk::__query_builder::Col, pub slot_key: __sdk::__query_builder::Col, pub item_id: __sdk::__query_builder::Col, pub category: __sdk::__query_builder::Col, pub name: __sdk::__query_builder::Col, - pub description: __sdk::__query_builder::Col>, + pub description: __sdk::__query_builder::Col>, pub quantity: __sdk::__query_builder::Col, pub rarity: __sdk::__query_builder::Col, - pub tags: __sdk::__query_builder::Col>, + pub tags: __sdk::__query_builder::Col>, pub stackable: __sdk::__query_builder::Col, pub stack_key: __sdk::__query_builder::Col, - pub equipment_slot_id: - __sdk::__query_builder::Col>, + pub equipment_slot_id: __sdk::__query_builder::Col>, pub source_kind: __sdk::__query_builder::Col, - pub source_reference_id: __sdk::__query_builder::Col>, + pub source_reference_id: __sdk::__query_builder::Col>, pub created_at: __sdk::__query_builder::Col, pub updated_at: __sdk::__query_builder::Col, } @@ -86,12 +92,10 @@ impl __sdk::__query_builder::HasCols for InventorySlot { stack_key: __sdk::__query_builder::Col::new(table_name, "stack_key"), equipment_slot_id: __sdk::__query_builder::Col::new(table_name, "equipment_slot_id"), source_kind: __sdk::__query_builder::Col::new(table_name, "source_kind"), - source_reference_id: __sdk::__query_builder::Col::new( - table_name, - "source_reference_id", - ), + source_reference_id: __sdk::__query_builder::Col::new(table_name, "source_reference_id"), created_at: __sdk::__query_builder::Col::new(table_name, "created_at"), updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"), + } } } @@ -112,13 +116,12 @@ impl __sdk::__query_builder::HasIxCols for InventorySlot { InventorySlotIxCols { actor_user_id: __sdk::__query_builder::IxCol::new(table_name, "actor_user_id"), item_id: __sdk::__query_builder::IxCol::new(table_name, "item_id"), - runtime_session_id: __sdk::__query_builder::IxCol::new( - table_name, - "runtime_session_id", - ), + runtime_session_id: __sdk::__query_builder::IxCol::new(table_name, "runtime_session_id"), slot_id: __sdk::__query_builder::IxCol::new(table_name, "slot_id"), + } } } impl __sdk::__query_builder::CanBeLookupTable for InventorySlot {} + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/list_custom_world_gallery_entries_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/list_custom_world_gallery_entries_procedure.rs index 63ee059f..507757cf 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/list_custom_world_gallery_entries_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/list_custom_world_gallery_entries_procedure.rs @@ -2,13 +2,20 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_gallery_list_result_type::CustomWorldGalleryListResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct ListCustomWorldGalleryEntriesArgs {} + struct ListCustomWorldGalleryEntriesArgs { + } + impl __sdk::InModule for ListCustomWorldGalleryEntriesArgs { type Module = super::RemoteModule; @@ -19,36 +26,28 @@ impl __sdk::InModule for ListCustomWorldGalleryEntriesArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait list_custom_world_gallery_entries { - fn list_custom_world_gallery_entries(&self) { - self.list_custom_world_gallery_entries_then(|_, _| {}); + fn list_custom_world_gallery_entries(&self, ) { + self.list_custom_world_gallery_entries_then( |_, _| {}); } fn list_custom_world_gallery_entries_then( &self, - - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } impl list_custom_world_gallery_entries for super::RemoteProcedures { fn list_custom_world_gallery_entries_then( &self, - - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, CustomWorldGalleryListResult>( - "list_custom_world_gallery_entries", - ListCustomWorldGalleryEntriesArgs {}, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, CustomWorldGalleryListResult>( + "list_custom_world_gallery_entries", + ListCustomWorldGalleryEntriesArgs { }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/list_custom_world_profiles_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/list_custom_world_profiles_procedure.rs index f8834945..4008b0b0 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/list_custom_world_profiles_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/list_custom_world_profiles_procedure.rs @@ -2,17 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_profile_list_input_type::CustomWorldProfileListInput; use super::custom_world_profile_list_result_type::CustomWorldProfileListResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct ListCustomWorldProfilesArgs { + struct ListCustomWorldProfilesArgs { pub input: CustomWorldProfileListInput, } + impl __sdk::InModule for ListCustomWorldProfilesArgs { type Module = super::RemoteModule; } @@ -22,19 +28,16 @@ impl __sdk::InModule for ListCustomWorldProfilesArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait list_custom_world_profiles { - fn list_custom_world_profiles(&self, input: CustomWorldProfileListInput) { - self.list_custom_world_profiles_then(input, |_, _| {}); + fn list_custom_world_profiles(&self, input: CustomWorldProfileListInput, +) { + self.list_custom_world_profiles_then(input, |_, _| {}); } fn list_custom_world_profiles_then( &self, input: CustomWorldProfileListInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } @@ -43,17 +46,13 @@ impl list_custom_world_profiles for super::RemoteProcedures { &self, input: CustomWorldProfileListInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, CustomWorldProfileListResult>( - "list_custom_world_profiles", - ListCustomWorldProfilesArgs { input }, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, CustomWorldProfileListResult>( + "list_custom_world_profiles", + ListCustomWorldProfilesArgs { input, }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/list_platform_browse_history_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/list_platform_browse_history_procedure.rs index 0d368a99..0c10f6c3 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/list_platform_browse_history_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/list_platform_browse_history_procedure.rs @@ -2,17 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_list_input_type::RuntimeBrowseHistoryListInput; use super::runtime_browse_history_procedure_result_type::RuntimeBrowseHistoryProcedureResult; +use super::runtime_browse_history_list_input_type::RuntimeBrowseHistoryListInput; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct ListPlatformBrowseHistoryArgs { + struct ListPlatformBrowseHistoryArgs { pub input: RuntimeBrowseHistoryListInput, } + impl __sdk::InModule for ListPlatformBrowseHistoryArgs { type Module = super::RemoteModule; } @@ -22,19 +28,16 @@ impl __sdk::InModule for ListPlatformBrowseHistoryArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait list_platform_browse_history { - fn list_platform_browse_history(&self, input: RuntimeBrowseHistoryListInput) { - self.list_platform_browse_history_then(input, |_, _| {}); + fn list_platform_browse_history(&self, input: RuntimeBrowseHistoryListInput, +) { + self.list_platform_browse_history_then(input, |_, _| {}); } fn list_platform_browse_history_then( &self, input: RuntimeBrowseHistoryListInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } @@ -43,17 +46,13 @@ impl list_platform_browse_history for super::RemoteProcedures { &self, input: RuntimeBrowseHistoryListInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, RuntimeBrowseHistoryProcedureResult>( - "list_platform_browse_history", - ListPlatformBrowseHistoryArgs { input }, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, RuntimeBrowseHistoryProcedureResult>( + "list_platform_browse_history", + ListPlatformBrowseHistoryArgs { input, }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/list_profile_save_archives_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/list_profile_save_archives_procedure.rs new file mode 100644 index 00000000..6476c3ac --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/list_profile_save_archives_procedure.rs @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use spacetimedb_sdk::__codegen::{ + self as __sdk, + __lib, + __sats, + __ws, +}; + +use super::runtime_profile_save_archive_list_input_type::RuntimeProfileSaveArchiveListInput; +use super::runtime_profile_save_archive_procedure_result_type::RuntimeProfileSaveArchiveProcedureResult; + +#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] +#[sats(crate = __lib)] + struct ListProfileSaveArchivesArgs { + pub input: RuntimeProfileSaveArchiveListInput, +} + + +impl __sdk::InModule for ListProfileSaveArchivesArgs { + type Module = super::RemoteModule; +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the procedure `list_profile_save_archives`. +/// +/// Implemented for [`super::RemoteProcedures`]. +pub trait list_profile_save_archives { + fn list_profile_save_archives(&self, input: RuntimeProfileSaveArchiveListInput, +) { + self.list_profile_save_archives_then(input, |_, _| {}); + } + + fn list_profile_save_archives_then( + &self, + input: RuntimeProfileSaveArchiveListInput, + + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + ); +} + +impl list_profile_save_archives for super::RemoteProcedures { + fn list_profile_save_archives_then( + &self, + input: RuntimeProfileSaveArchiveListInput, + + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + ) { + self.imp.invoke_procedure_with_callback::<_, RuntimeProfileSaveArchiveProcedureResult>( + "list_profile_save_archives", + ListProfileSaveArchivesArgs { input, }, + __callback, + ); + } +} + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/list_profile_wallet_ledger_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/list_profile_wallet_ledger_procedure.rs index 23496701..4ae618f0 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/list_profile_wallet_ledger_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/list_profile_wallet_ledger_procedure.rs @@ -2,17 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_profile_wallet_ledger_list_input_type::RuntimeProfileWalletLedgerListInput; use super::runtime_profile_wallet_ledger_procedure_result_type::RuntimeProfileWalletLedgerProcedureResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct ListProfileWalletLedgerArgs { + struct ListProfileWalletLedgerArgs { pub input: RuntimeProfileWalletLedgerListInput, } + impl __sdk::InModule for ListProfileWalletLedgerArgs { type Module = super::RemoteModule; } @@ -22,19 +28,16 @@ impl __sdk::InModule for ListProfileWalletLedgerArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait list_profile_wallet_ledger { - fn list_profile_wallet_ledger(&self, input: RuntimeProfileWalletLedgerListInput) { - self.list_profile_wallet_ledger_then(input, |_, _| {}); + fn list_profile_wallet_ledger(&self, input: RuntimeProfileWalletLedgerListInput, +) { + self.list_profile_wallet_ledger_then(input, |_, _| {}); } fn list_profile_wallet_ledger_then( &self, input: RuntimeProfileWalletLedgerListInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } @@ -43,17 +46,13 @@ impl list_profile_wallet_ledger for super::RemoteProcedures { &self, input: RuntimeProfileWalletLedgerListInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, RuntimeProfileWalletLedgerProcedureResult>( - "list_profile_wallet_ledger", - ListProfileWalletLedgerArgs { input }, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, RuntimeProfileWalletLedgerProcedureResult>( + "list_profile_wallet_ledger", + ListProfileWalletLedgerArgs { input, }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/mod.rs b/server-rs/crates/spacetime-client/src/module_bindings/mod.rs index b718ee1e..f51667d3 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/mod.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/mod.rs @@ -4,16 +4,19 @@ // This was generated using spacetimedb cli version 2.1.0 (commit 6981f48b4bc1a71c8dd9bdfe5a2c343f6370243d). #![allow(unused, clippy::all)] -use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; +use spacetimedb_sdk::__codegen::{ + self as __sdk, + __lib, + __sats, + __ws, +}; -pub mod accept_quest_reducer; -pub mod acknowledge_quest_completion_reducer; +pub mod ai_result_reference_type; pub mod ai_result_reference_input_type; pub mod ai_result_reference_kind_type; pub mod ai_result_reference_snapshot_type; -pub mod ai_result_reference_table; -pub mod ai_result_reference_type; pub mod ai_stage_completion_input_type; +pub mod ai_task_type; pub mod ai_task_cancel_input_type; pub mod ai_task_create_input_type; pub mod ai_task_failure_input_type; @@ -21,106 +24,68 @@ pub mod ai_task_finish_input_type; pub mod ai_task_kind_type; pub mod ai_task_procedure_result_type; pub mod ai_task_snapshot_type; +pub mod ai_task_stage_type; pub mod ai_task_stage_blueprint_type; pub mod ai_task_stage_kind_type; pub mod ai_task_stage_snapshot_type; pub mod ai_task_stage_start_input_type; pub mod ai_task_stage_status_type; -pub mod ai_task_stage_table; -pub mod ai_task_stage_type; pub mod ai_task_start_input_type; pub mod ai_task_status_type; -pub mod ai_task_table; -pub mod ai_task_type; +pub mod ai_text_chunk_type; pub mod ai_text_chunk_append_input_type; pub mod ai_text_chunk_snapshot_type; -pub mod ai_text_chunk_table; -pub mod ai_text_chunk_type; -pub mod append_ai_text_chunk_and_return_procedure; -pub mod apply_chapter_progression_ledger_entry_and_return_procedure; -pub mod apply_chapter_progression_ledger_entry_reducer; -pub mod apply_inventory_mutation_reducer; -pub mod apply_quest_signal_reducer; +pub mod asset_entity_binding_type; pub mod asset_entity_binding_input_type; pub mod asset_entity_binding_procedure_result_type; pub mod asset_entity_binding_snapshot_type; -pub mod asset_entity_binding_table; -pub mod asset_entity_binding_type; +pub mod asset_object_type; pub mod asset_object_access_policy_type; pub mod asset_object_procedure_result_type; -pub mod asset_object_table; -pub mod asset_object_type; pub mod asset_object_upsert_input_type; pub mod asset_object_upsert_snapshot_type; -pub mod attach_ai_result_reference_and_return_procedure; pub mod battle_mode_type; +pub mod battle_state_type; pub mod battle_state_input_type; pub mod battle_state_procedure_result_type; pub mod battle_state_query_input_type; pub mod battle_state_snapshot_type; -pub mod battle_state_table; -pub mod battle_state_type; pub mod battle_status_type; -pub mod begin_story_session_and_return_procedure; -pub mod begin_story_session_reducer; -pub mod bind_asset_object_to_entity_and_return_procedure; -pub mod bind_asset_object_to_entity_reducer; -pub mod cancel_ai_task_and_return_procedure; pub mod chapter_pace_band_type; +pub mod chapter_progression_type; pub mod chapter_progression_get_input_type; pub mod chapter_progression_input_type; pub mod chapter_progression_ledger_input_type; pub mod chapter_progression_procedure_result_type; pub mod chapter_progression_snapshot_type; -pub mod chapter_progression_table; -pub mod chapter_progression_type; -pub mod clear_platform_browse_history_and_return_procedure; pub mod combat_outcome_type; -pub mod compile_custom_world_published_profile_procedure; -pub mod complete_ai_stage_and_return_procedure; -pub mod complete_ai_task_and_return_procedure; -pub mod confirm_asset_object_and_return_procedure; -pub mod confirm_asset_object_reducer; pub mod consume_inventory_item_input_type; -pub mod continue_story_and_return_procedure; -pub mod continue_story_reducer; -pub mod create_ai_task_and_return_procedure; -pub mod create_ai_task_reducer; -pub mod create_battle_state_and_return_procedure; -pub mod create_battle_state_reducer; -pub mod create_custom_world_agent_session_procedure; +pub mod custom_world_agent_message_type; pub mod custom_world_agent_message_snapshot_type; pub mod custom_world_agent_message_submit_input_type; -pub mod custom_world_agent_message_table; -pub mod custom_world_agent_message_type; +pub mod custom_world_agent_operation_type; pub mod custom_world_agent_operation_get_input_type; pub mod custom_world_agent_operation_procedure_result_type; pub mod custom_world_agent_operation_snapshot_type; -pub mod custom_world_agent_operation_table; -pub mod custom_world_agent_operation_type; +pub mod custom_world_agent_session_type; pub mod custom_world_agent_session_create_input_type; pub mod custom_world_agent_session_get_input_type; pub mod custom_world_agent_session_procedure_result_type; pub mod custom_world_agent_session_snapshot_type; -pub mod custom_world_agent_session_table; -pub mod custom_world_agent_session_type; -pub mod custom_world_draft_card_snapshot_type; -pub mod custom_world_draft_card_table; pub mod custom_world_draft_card_type; +pub mod custom_world_draft_card_snapshot_type; pub mod custom_world_gallery_detail_input_type; -pub mod custom_world_gallery_entry_snapshot_type; -pub mod custom_world_gallery_entry_table; pub mod custom_world_gallery_entry_type; +pub mod custom_world_gallery_entry_snapshot_type; pub mod custom_world_gallery_list_result_type; pub mod custom_world_generation_mode_type; pub mod custom_world_library_detail_input_type; pub mod custom_world_library_mutation_result_type; +pub mod custom_world_profile_type; pub mod custom_world_profile_list_input_type; pub mod custom_world_profile_list_result_type; pub mod custom_world_profile_publish_input_type; pub mod custom_world_profile_snapshot_type; -pub mod custom_world_profile_table; -pub mod custom_world_profile_type; pub mod custom_world_profile_unpublish_input_type; pub mod custom_world_profile_upsert_input_type; pub mod custom_world_publication_status_type; @@ -130,41 +95,20 @@ pub mod custom_world_published_profile_compile_input_type; pub mod custom_world_published_profile_compile_result_type; pub mod custom_world_published_profile_compile_snapshot_type; pub mod custom_world_role_asset_status_type; -pub mod custom_world_session_status_type; -pub mod custom_world_session_table; pub mod custom_world_session_type; +pub mod custom_world_session_status_type; pub mod custom_world_theme_mode_type; pub mod equip_inventory_item_input_type; -pub mod fail_ai_task_and_return_procedure; -pub mod get_battle_state_procedure; -pub mod get_chapter_progression_procedure; -pub mod get_custom_world_agent_operation_procedure; -pub mod get_custom_world_agent_session_procedure; -pub mod get_custom_world_gallery_detail_procedure; -pub mod get_custom_world_library_detail_procedure; -pub mod get_player_progression_or_default_procedure; -pub mod get_profile_dashboard_procedure; -pub mod get_profile_play_stats_procedure; -pub mod get_runtime_inventory_state_procedure; -pub mod get_runtime_setting_or_default_procedure; -pub mod get_story_session_state_procedure; pub mod grant_inventory_item_input_type; -pub mod grant_player_progression_experience_and_return_procedure; -pub mod grant_player_progression_experience_reducer; pub mod inventory_container_kind_type; pub mod inventory_equipment_slot_type; pub mod inventory_item_rarity_type; pub mod inventory_item_snapshot_type; pub mod inventory_item_source_kind_type; -pub mod inventory_mutation_input_type; pub mod inventory_mutation_type; -pub mod inventory_slot_snapshot_type; -pub mod inventory_slot_table; +pub mod inventory_mutation_input_type; pub mod inventory_slot_type; -pub mod list_custom_world_gallery_entries_procedure; -pub mod list_custom_world_profiles_procedure; -pub mod list_platform_browse_history_procedure; -pub mod list_profile_wallet_ledger_procedure; +pub mod inventory_slot_snapshot_type; pub mod npc_battle_interaction_procedure_result_type; pub mod npc_battle_interaction_result_type; pub mod npc_interaction_battle_mode_type; @@ -175,33 +119,25 @@ pub mod npc_relation_stance_type; pub mod npc_relation_state_type; pub mod npc_social_action_kind_type; pub mod npc_stance_profile_type; +pub mod npc_state_type; pub mod npc_state_procedure_result_type; pub mod npc_state_snapshot_type; -pub mod npc_state_table; -pub mod npc_state_type; pub mod npc_state_upsert_input_type; +pub mod player_progression_type; pub mod player_progression_get_input_type; pub mod player_progression_grant_input_type; pub mod player_progression_grant_source_type; pub mod player_progression_procedure_result_type; pub mod player_progression_snapshot_type; -pub mod player_progression_table; -pub mod player_progression_type; -pub mod profile_dashboard_state_table; pub mod profile_dashboard_state_type; -pub mod profile_played_world_table; pub mod profile_played_world_type; -pub mod profile_wallet_ledger_table; +pub mod profile_save_archive_type; pub mod profile_wallet_ledger_type; -pub mod publish_custom_world_profile_and_return_procedure; -pub mod publish_custom_world_profile_reducer; -pub mod publish_custom_world_world_procedure; pub mod quest_completion_ack_input_type; pub mod quest_hostile_npc_defeated_signal_type; pub mod quest_item_delivered_signal_type; -pub mod quest_log_event_kind_type; -pub mod quest_log_table; pub mod quest_log_type; +pub mod quest_log_event_kind_type; pub mod quest_narrative_binding_snapshot_type; pub mod quest_narrative_origin_type; pub mod quest_narrative_type_type; @@ -210,13 +146,12 @@ pub mod quest_npc_talk_completed_signal_type; pub mod quest_objective_kind_type; pub mod quest_objective_snapshot_type; pub mod quest_progress_signal_type; -pub mod quest_record_input_type; -pub mod quest_record_table; pub mod quest_record_type; +pub mod quest_record_input_type; pub mod quest_reward_equipment_slot_type; pub mod quest_reward_intel_type; -pub mod quest_reward_item_rarity_type; pub mod quest_reward_item_type; +pub mod quest_reward_item_rarity_type; pub mod quest_reward_snapshot_type; pub mod quest_scene_reached_signal_type; pub mod quest_signal_apply_input_type; @@ -225,21 +160,12 @@ pub mod quest_status_type; pub mod quest_step_snapshot_type; pub mod quest_treasure_inspected_signal_type; pub mod quest_turn_in_input_type; -pub mod resolve_combat_action_and_return_procedure; pub mod resolve_combat_action_input_type; pub mod resolve_combat_action_procedure_result_type; -pub mod resolve_combat_action_reducer; pub mod resolve_combat_action_result_type; -pub mod resolve_npc_battle_interaction_and_return_procedure; pub mod resolve_npc_battle_interaction_input_type; -pub mod resolve_npc_interaction_and_return_procedure; pub mod resolve_npc_interaction_input_type; -pub mod resolve_npc_interaction_reducer; -pub mod resolve_npc_social_action_and_return_procedure; pub mod resolve_npc_social_action_input_type; -pub mod resolve_npc_social_action_reducer; -pub mod resolve_treasure_interaction_and_return_procedure; -pub mod resolve_treasure_interaction_reducer; pub mod rpg_agent_draft_card_kind_type; pub mod rpg_agent_draft_card_status_type; pub mod rpg_agent_message_kind_type; @@ -268,61 +194,156 @@ pub mod runtime_profile_play_stats_get_input_type; pub mod runtime_profile_play_stats_procedure_result_type; pub mod runtime_profile_play_stats_snapshot_type; pub mod runtime_profile_played_world_snapshot_type; +pub mod runtime_profile_save_archive_list_input_type; +pub mod runtime_profile_save_archive_procedure_result_type; +pub mod runtime_profile_save_archive_resume_input_type; +pub mod runtime_profile_save_archive_snapshot_type; pub mod runtime_profile_wallet_ledger_entry_snapshot_type; pub mod runtime_profile_wallet_ledger_list_input_type; pub mod runtime_profile_wallet_ledger_procedure_result_type; pub mod runtime_profile_wallet_ledger_source_type_type; +pub mod runtime_setting_type; pub mod runtime_setting_get_input_type; pub mod runtime_setting_procedure_result_type; pub mod runtime_setting_snapshot_type; -pub mod runtime_setting_table; -pub mod runtime_setting_type; pub mod runtime_setting_upsert_input_type; -pub mod start_ai_task_reducer; -pub mod start_ai_task_stage_reducer; +pub mod runtime_snapshot_type; +pub mod runtime_snapshot_delete_input_type; +pub mod runtime_snapshot_get_input_type; +pub mod runtime_snapshot_procedure_result_type; +pub mod runtime_snapshot_row_type; +pub mod runtime_snapshot_upsert_input_type; pub mod story_continue_input_type; +pub mod story_event_type; pub mod story_event_kind_type; pub mod story_event_snapshot_type; -pub mod story_event_table; -pub mod story_event_type; +pub mod story_session_type; pub mod story_session_input_type; pub mod story_session_procedure_result_type; pub mod story_session_snapshot_type; pub mod story_session_state_input_type; pub mod story_session_state_procedure_result_type; pub mod story_session_status_type; -pub mod story_session_table; -pub mod story_session_type; -pub mod submit_custom_world_agent_message_procedure; pub mod treasure_interaction_action_type; +pub mod treasure_record_type; pub mod treasure_record_procedure_result_type; pub mod treasure_record_snapshot_type; -pub mod treasure_record_table; -pub mod treasure_record_type; pub mod treasure_resolve_input_type; -pub mod turn_in_quest_reducer; pub mod unequip_inventory_item_input_type; -pub mod unpublish_custom_world_profile_and_return_procedure; +pub mod user_browse_history_type; +pub mod accept_quest_reducer; +pub mod acknowledge_quest_completion_reducer; +pub mod apply_chapter_progression_ledger_entry_reducer; +pub mod apply_inventory_mutation_reducer; +pub mod apply_quest_signal_reducer; +pub mod begin_story_session_reducer; +pub mod bind_asset_object_to_entity_reducer; +pub mod confirm_asset_object_reducer; +pub mod continue_story_reducer; +pub mod create_ai_task_reducer; +pub mod create_battle_state_reducer; +pub mod grant_player_progression_experience_reducer; +pub mod publish_custom_world_profile_reducer; +pub mod resolve_combat_action_reducer; +pub mod resolve_npc_interaction_reducer; +pub mod resolve_npc_social_action_reducer; +pub mod resolve_treasure_interaction_reducer; +pub mod start_ai_task_reducer; +pub mod start_ai_task_stage_reducer; +pub mod turn_in_quest_reducer; pub mod unpublish_custom_world_profile_reducer; -pub mod upsert_chapter_progression_and_return_procedure; pub mod upsert_chapter_progression_reducer; -pub mod upsert_custom_world_profile_and_return_procedure; pub mod upsert_custom_world_profile_reducer; -pub mod upsert_npc_state_and_return_procedure; pub mod upsert_npc_state_reducer; +pub mod ai_result_reference_table; +pub mod ai_task_table; +pub mod ai_task_stage_table; +pub mod ai_text_chunk_table; +pub mod asset_entity_binding_table; +pub mod asset_object_table; +pub mod battle_state_table; +pub mod chapter_progression_table; +pub mod custom_world_agent_message_table; +pub mod custom_world_agent_operation_table; +pub mod custom_world_agent_session_table; +pub mod custom_world_draft_card_table; +pub mod custom_world_gallery_entry_table; +pub mod custom_world_profile_table; +pub mod custom_world_session_table; +pub mod inventory_slot_table; +pub mod npc_state_table; +pub mod player_progression_table; +pub mod profile_dashboard_state_table; +pub mod profile_played_world_table; +pub mod profile_save_archive_table; +pub mod profile_wallet_ledger_table; +pub mod quest_log_table; +pub mod quest_record_table; +pub mod runtime_setting_table; +pub mod runtime_snapshot_table; +pub mod story_event_table; +pub mod story_session_table; +pub mod treasure_record_table; +pub mod user_browse_history_table; +pub mod append_ai_text_chunk_and_return_procedure; +pub mod apply_chapter_progression_ledger_entry_and_return_procedure; +pub mod attach_ai_result_reference_and_return_procedure; +pub mod begin_story_session_and_return_procedure; +pub mod bind_asset_object_to_entity_and_return_procedure; +pub mod cancel_ai_task_and_return_procedure; +pub mod clear_platform_browse_history_and_return_procedure; +pub mod compile_custom_world_published_profile_procedure; +pub mod complete_ai_stage_and_return_procedure; +pub mod complete_ai_task_and_return_procedure; +pub mod confirm_asset_object_and_return_procedure; +pub mod continue_story_and_return_procedure; +pub mod create_ai_task_and_return_procedure; +pub mod create_battle_state_and_return_procedure; +pub mod create_custom_world_agent_session_procedure; +pub mod delete_runtime_snapshot_and_return_procedure; +pub mod fail_ai_task_and_return_procedure; +pub mod get_battle_state_procedure; +pub mod get_chapter_progression_procedure; +pub mod get_custom_world_agent_operation_procedure; +pub mod get_custom_world_agent_session_procedure; +pub mod get_custom_world_gallery_detail_procedure; +pub mod get_custom_world_library_detail_procedure; +pub mod get_player_progression_or_default_procedure; +pub mod get_profile_dashboard_procedure; +pub mod get_profile_play_stats_procedure; +pub mod get_runtime_inventory_state_procedure; +pub mod get_runtime_setting_or_default_procedure; +pub mod get_runtime_snapshot_procedure; +pub mod get_story_session_state_procedure; +pub mod grant_player_progression_experience_and_return_procedure; +pub mod list_custom_world_gallery_entries_procedure; +pub mod list_custom_world_profiles_procedure; +pub mod list_platform_browse_history_procedure; +pub mod list_profile_save_archives_procedure; +pub mod list_profile_wallet_ledger_procedure; +pub mod publish_custom_world_profile_and_return_procedure; +pub mod publish_custom_world_world_procedure; +pub mod resolve_combat_action_and_return_procedure; +pub mod resolve_npc_battle_interaction_and_return_procedure; +pub mod resolve_npc_interaction_and_return_procedure; +pub mod resolve_npc_social_action_and_return_procedure; +pub mod resolve_treasure_interaction_and_return_procedure; +pub mod resume_profile_save_archive_and_return_procedure; +pub mod submit_custom_world_agent_message_procedure; +pub mod unpublish_custom_world_profile_and_return_procedure; +pub mod upsert_chapter_progression_and_return_procedure; +pub mod upsert_custom_world_profile_and_return_procedure; +pub mod upsert_npc_state_and_return_procedure; pub mod upsert_platform_browse_history_and_return_procedure; pub mod upsert_runtime_setting_and_return_procedure; -pub mod user_browse_history_table; -pub mod user_browse_history_type; +pub mod upsert_runtime_snapshot_and_return_procedure; -pub use accept_quest_reducer::accept_quest; -pub use acknowledge_quest_completion_reducer::acknowledge_quest_completion; +pub use ai_result_reference_type::AiResultReference; pub use ai_result_reference_input_type::AiResultReferenceInput; pub use ai_result_reference_kind_type::AiResultReferenceKind; pub use ai_result_reference_snapshot_type::AiResultReferenceSnapshot; -pub use ai_result_reference_table::*; -pub use ai_result_reference_type::AiResultReference; pub use ai_stage_completion_input_type::AiStageCompletionInput; +pub use ai_task_type::AiTask; pub use ai_task_cancel_input_type::AiTaskCancelInput; pub use ai_task_create_input_type::AiTaskCreateInput; pub use ai_task_failure_input_type::AiTaskFailureInput; @@ -330,106 +351,68 @@ pub use ai_task_finish_input_type::AiTaskFinishInput; pub use ai_task_kind_type::AiTaskKind; pub use ai_task_procedure_result_type::AiTaskProcedureResult; pub use ai_task_snapshot_type::AiTaskSnapshot; +pub use ai_task_stage_type::AiTaskStage; pub use ai_task_stage_blueprint_type::AiTaskStageBlueprint; pub use ai_task_stage_kind_type::AiTaskStageKind; pub use ai_task_stage_snapshot_type::AiTaskStageSnapshot; pub use ai_task_stage_start_input_type::AiTaskStageStartInput; pub use ai_task_stage_status_type::AiTaskStageStatus; -pub use ai_task_stage_table::*; -pub use ai_task_stage_type::AiTaskStage; pub use ai_task_start_input_type::AiTaskStartInput; pub use ai_task_status_type::AiTaskStatus; -pub use ai_task_table::*; -pub use ai_task_type::AiTask; +pub use ai_text_chunk_type::AiTextChunk; pub use ai_text_chunk_append_input_type::AiTextChunkAppendInput; pub use ai_text_chunk_snapshot_type::AiTextChunkSnapshot; -pub use ai_text_chunk_table::*; -pub use ai_text_chunk_type::AiTextChunk; -pub use append_ai_text_chunk_and_return_procedure::append_ai_text_chunk_and_return; -pub use apply_chapter_progression_ledger_entry_and_return_procedure::apply_chapter_progression_ledger_entry_and_return; -pub use apply_chapter_progression_ledger_entry_reducer::apply_chapter_progression_ledger_entry; -pub use apply_inventory_mutation_reducer::apply_inventory_mutation; -pub use apply_quest_signal_reducer::apply_quest_signal; +pub use asset_entity_binding_type::AssetEntityBinding; pub use asset_entity_binding_input_type::AssetEntityBindingInput; pub use asset_entity_binding_procedure_result_type::AssetEntityBindingProcedureResult; pub use asset_entity_binding_snapshot_type::AssetEntityBindingSnapshot; -pub use asset_entity_binding_table::*; -pub use asset_entity_binding_type::AssetEntityBinding; +pub use asset_object_type::AssetObject; pub use asset_object_access_policy_type::AssetObjectAccessPolicy; pub use asset_object_procedure_result_type::AssetObjectProcedureResult; -pub use asset_object_table::*; -pub use asset_object_type::AssetObject; pub use asset_object_upsert_input_type::AssetObjectUpsertInput; pub use asset_object_upsert_snapshot_type::AssetObjectUpsertSnapshot; -pub use attach_ai_result_reference_and_return_procedure::attach_ai_result_reference_and_return; pub use battle_mode_type::BattleMode; +pub use battle_state_type::BattleState; pub use battle_state_input_type::BattleStateInput; pub use battle_state_procedure_result_type::BattleStateProcedureResult; pub use battle_state_query_input_type::BattleStateQueryInput; pub use battle_state_snapshot_type::BattleStateSnapshot; -pub use battle_state_table::*; -pub use battle_state_type::BattleState; pub use battle_status_type::BattleStatus; -pub use begin_story_session_and_return_procedure::begin_story_session_and_return; -pub use begin_story_session_reducer::begin_story_session; -pub use bind_asset_object_to_entity_and_return_procedure::bind_asset_object_to_entity_and_return; -pub use bind_asset_object_to_entity_reducer::bind_asset_object_to_entity; -pub use cancel_ai_task_and_return_procedure::cancel_ai_task_and_return; pub use chapter_pace_band_type::ChapterPaceBand; +pub use chapter_progression_type::ChapterProgression; pub use chapter_progression_get_input_type::ChapterProgressionGetInput; pub use chapter_progression_input_type::ChapterProgressionInput; pub use chapter_progression_ledger_input_type::ChapterProgressionLedgerInput; pub use chapter_progression_procedure_result_type::ChapterProgressionProcedureResult; pub use chapter_progression_snapshot_type::ChapterProgressionSnapshot; -pub use chapter_progression_table::*; -pub use chapter_progression_type::ChapterProgression; -pub use clear_platform_browse_history_and_return_procedure::clear_platform_browse_history_and_return; pub use combat_outcome_type::CombatOutcome; -pub use compile_custom_world_published_profile_procedure::compile_custom_world_published_profile; -pub use complete_ai_stage_and_return_procedure::complete_ai_stage_and_return; -pub use complete_ai_task_and_return_procedure::complete_ai_task_and_return; -pub use confirm_asset_object_and_return_procedure::confirm_asset_object_and_return; -pub use confirm_asset_object_reducer::confirm_asset_object; pub use consume_inventory_item_input_type::ConsumeInventoryItemInput; -pub use continue_story_and_return_procedure::continue_story_and_return; -pub use continue_story_reducer::continue_story; -pub use create_ai_task_and_return_procedure::create_ai_task_and_return; -pub use create_ai_task_reducer::create_ai_task; -pub use create_battle_state_and_return_procedure::create_battle_state_and_return; -pub use create_battle_state_reducer::create_battle_state; -pub use create_custom_world_agent_session_procedure::create_custom_world_agent_session; +pub use custom_world_agent_message_type::CustomWorldAgentMessage; pub use custom_world_agent_message_snapshot_type::CustomWorldAgentMessageSnapshot; pub use custom_world_agent_message_submit_input_type::CustomWorldAgentMessageSubmitInput; -pub use custom_world_agent_message_table::*; -pub use custom_world_agent_message_type::CustomWorldAgentMessage; +pub use custom_world_agent_operation_type::CustomWorldAgentOperation; pub use custom_world_agent_operation_get_input_type::CustomWorldAgentOperationGetInput; pub use custom_world_agent_operation_procedure_result_type::CustomWorldAgentOperationProcedureResult; pub use custom_world_agent_operation_snapshot_type::CustomWorldAgentOperationSnapshot; -pub use custom_world_agent_operation_table::*; -pub use custom_world_agent_operation_type::CustomWorldAgentOperation; +pub use custom_world_agent_session_type::CustomWorldAgentSession; pub use custom_world_agent_session_create_input_type::CustomWorldAgentSessionCreateInput; pub use custom_world_agent_session_get_input_type::CustomWorldAgentSessionGetInput; pub use custom_world_agent_session_procedure_result_type::CustomWorldAgentSessionProcedureResult; pub use custom_world_agent_session_snapshot_type::CustomWorldAgentSessionSnapshot; -pub use custom_world_agent_session_table::*; -pub use custom_world_agent_session_type::CustomWorldAgentSession; -pub use custom_world_draft_card_snapshot_type::CustomWorldDraftCardSnapshot; -pub use custom_world_draft_card_table::*; pub use custom_world_draft_card_type::CustomWorldDraftCard; +pub use custom_world_draft_card_snapshot_type::CustomWorldDraftCardSnapshot; pub use custom_world_gallery_detail_input_type::CustomWorldGalleryDetailInput; -pub use custom_world_gallery_entry_snapshot_type::CustomWorldGalleryEntrySnapshot; -pub use custom_world_gallery_entry_table::*; pub use custom_world_gallery_entry_type::CustomWorldGalleryEntry; +pub use custom_world_gallery_entry_snapshot_type::CustomWorldGalleryEntrySnapshot; pub use custom_world_gallery_list_result_type::CustomWorldGalleryListResult; pub use custom_world_generation_mode_type::CustomWorldGenerationMode; pub use custom_world_library_detail_input_type::CustomWorldLibraryDetailInput; pub use custom_world_library_mutation_result_type::CustomWorldLibraryMutationResult; +pub use custom_world_profile_type::CustomWorldProfile; pub use custom_world_profile_list_input_type::CustomWorldProfileListInput; pub use custom_world_profile_list_result_type::CustomWorldProfileListResult; pub use custom_world_profile_publish_input_type::CustomWorldProfilePublishInput; pub use custom_world_profile_snapshot_type::CustomWorldProfileSnapshot; -pub use custom_world_profile_table::*; -pub use custom_world_profile_type::CustomWorldProfile; pub use custom_world_profile_unpublish_input_type::CustomWorldProfileUnpublishInput; pub use custom_world_profile_upsert_input_type::CustomWorldProfileUpsertInput; pub use custom_world_publication_status_type::CustomWorldPublicationStatus; @@ -439,41 +422,20 @@ pub use custom_world_published_profile_compile_input_type::CustomWorldPublishedP pub use custom_world_published_profile_compile_result_type::CustomWorldPublishedProfileCompileResult; pub use custom_world_published_profile_compile_snapshot_type::CustomWorldPublishedProfileCompileSnapshot; pub use custom_world_role_asset_status_type::CustomWorldRoleAssetStatus; -pub use custom_world_session_status_type::CustomWorldSessionStatus; -pub use custom_world_session_table::*; pub use custom_world_session_type::CustomWorldSession; +pub use custom_world_session_status_type::CustomWorldSessionStatus; pub use custom_world_theme_mode_type::CustomWorldThemeMode; pub use equip_inventory_item_input_type::EquipInventoryItemInput; -pub use fail_ai_task_and_return_procedure::fail_ai_task_and_return; -pub use get_battle_state_procedure::get_battle_state; -pub use get_chapter_progression_procedure::get_chapter_progression; -pub use get_custom_world_agent_operation_procedure::get_custom_world_agent_operation; -pub use get_custom_world_agent_session_procedure::get_custom_world_agent_session; -pub use get_custom_world_gallery_detail_procedure::get_custom_world_gallery_detail; -pub use get_custom_world_library_detail_procedure::get_custom_world_library_detail; -pub use get_player_progression_or_default_procedure::get_player_progression_or_default; -pub use get_profile_dashboard_procedure::get_profile_dashboard; -pub use get_profile_play_stats_procedure::get_profile_play_stats; -pub use get_runtime_inventory_state_procedure::get_runtime_inventory_state; -pub use get_runtime_setting_or_default_procedure::get_runtime_setting_or_default; -pub use get_story_session_state_procedure::get_story_session_state; pub use grant_inventory_item_input_type::GrantInventoryItemInput; -pub use grant_player_progression_experience_and_return_procedure::grant_player_progression_experience_and_return; -pub use grant_player_progression_experience_reducer::grant_player_progression_experience; pub use inventory_container_kind_type::InventoryContainerKind; pub use inventory_equipment_slot_type::InventoryEquipmentSlot; pub use inventory_item_rarity_type::InventoryItemRarity; pub use inventory_item_snapshot_type::InventoryItemSnapshot; pub use inventory_item_source_kind_type::InventoryItemSourceKind; -pub use inventory_mutation_input_type::InventoryMutationInput; pub use inventory_mutation_type::InventoryMutation; -pub use inventory_slot_snapshot_type::InventorySlotSnapshot; -pub use inventory_slot_table::*; +pub use inventory_mutation_input_type::InventoryMutationInput; pub use inventory_slot_type::InventorySlot; -pub use list_custom_world_gallery_entries_procedure::list_custom_world_gallery_entries; -pub use list_custom_world_profiles_procedure::list_custom_world_profiles; -pub use list_platform_browse_history_procedure::list_platform_browse_history; -pub use list_profile_wallet_ledger_procedure::list_profile_wallet_ledger; +pub use inventory_slot_snapshot_type::InventorySlotSnapshot; pub use npc_battle_interaction_procedure_result_type::NpcBattleInteractionProcedureResult; pub use npc_battle_interaction_result_type::NpcBattleInteractionResult; pub use npc_interaction_battle_mode_type::NpcInteractionBattleMode; @@ -484,33 +446,25 @@ pub use npc_relation_stance_type::NpcRelationStance; pub use npc_relation_state_type::NpcRelationState; pub use npc_social_action_kind_type::NpcSocialActionKind; pub use npc_stance_profile_type::NpcStanceProfile; +pub use npc_state_type::NpcState; pub use npc_state_procedure_result_type::NpcStateProcedureResult; pub use npc_state_snapshot_type::NpcStateSnapshot; -pub use npc_state_table::*; -pub use npc_state_type::NpcState; pub use npc_state_upsert_input_type::NpcStateUpsertInput; +pub use player_progression_type::PlayerProgression; pub use player_progression_get_input_type::PlayerProgressionGetInput; pub use player_progression_grant_input_type::PlayerProgressionGrantInput; pub use player_progression_grant_source_type::PlayerProgressionGrantSource; pub use player_progression_procedure_result_type::PlayerProgressionProcedureResult; pub use player_progression_snapshot_type::PlayerProgressionSnapshot; -pub use player_progression_table::*; -pub use player_progression_type::PlayerProgression; -pub use profile_dashboard_state_table::*; pub use profile_dashboard_state_type::ProfileDashboardState; -pub use profile_played_world_table::*; pub use profile_played_world_type::ProfilePlayedWorld; -pub use profile_wallet_ledger_table::*; +pub use profile_save_archive_type::ProfileSaveArchive; pub use profile_wallet_ledger_type::ProfileWalletLedger; -pub use publish_custom_world_profile_and_return_procedure::publish_custom_world_profile_and_return; -pub use publish_custom_world_profile_reducer::publish_custom_world_profile; -pub use publish_custom_world_world_procedure::publish_custom_world_world; pub use quest_completion_ack_input_type::QuestCompletionAckInput; pub use quest_hostile_npc_defeated_signal_type::QuestHostileNpcDefeatedSignal; pub use quest_item_delivered_signal_type::QuestItemDeliveredSignal; -pub use quest_log_event_kind_type::QuestLogEventKind; -pub use quest_log_table::*; pub use quest_log_type::QuestLog; +pub use quest_log_event_kind_type::QuestLogEventKind; pub use quest_narrative_binding_snapshot_type::QuestNarrativeBindingSnapshot; pub use quest_narrative_origin_type::QuestNarrativeOrigin; pub use quest_narrative_type_type::QuestNarrativeType; @@ -519,13 +473,12 @@ pub use quest_npc_talk_completed_signal_type::QuestNpcTalkCompletedSignal; pub use quest_objective_kind_type::QuestObjectiveKind; pub use quest_objective_snapshot_type::QuestObjectiveSnapshot; pub use quest_progress_signal_type::QuestProgressSignal; -pub use quest_record_input_type::QuestRecordInput; -pub use quest_record_table::*; pub use quest_record_type::QuestRecord; +pub use quest_record_input_type::QuestRecordInput; pub use quest_reward_equipment_slot_type::QuestRewardEquipmentSlot; pub use quest_reward_intel_type::QuestRewardIntel; -pub use quest_reward_item_rarity_type::QuestRewardItemRarity; pub use quest_reward_item_type::QuestRewardItem; +pub use quest_reward_item_rarity_type::QuestRewardItemRarity; pub use quest_reward_snapshot_type::QuestRewardSnapshot; pub use quest_scene_reached_signal_type::QuestSceneReachedSignal; pub use quest_signal_apply_input_type::QuestSignalApplyInput; @@ -534,21 +487,12 @@ pub use quest_status_type::QuestStatus; pub use quest_step_snapshot_type::QuestStepSnapshot; pub use quest_treasure_inspected_signal_type::QuestTreasureInspectedSignal; pub use quest_turn_in_input_type::QuestTurnInInput; -pub use resolve_combat_action_and_return_procedure::resolve_combat_action_and_return; pub use resolve_combat_action_input_type::ResolveCombatActionInput; pub use resolve_combat_action_procedure_result_type::ResolveCombatActionProcedureResult; -pub use resolve_combat_action_reducer::resolve_combat_action; pub use resolve_combat_action_result_type::ResolveCombatActionResult; -pub use resolve_npc_battle_interaction_and_return_procedure::resolve_npc_battle_interaction_and_return; pub use resolve_npc_battle_interaction_input_type::ResolveNpcBattleInteractionInput; -pub use resolve_npc_interaction_and_return_procedure::resolve_npc_interaction_and_return; pub use resolve_npc_interaction_input_type::ResolveNpcInteractionInput; -pub use resolve_npc_interaction_reducer::resolve_npc_interaction; -pub use resolve_npc_social_action_and_return_procedure::resolve_npc_social_action_and_return; pub use resolve_npc_social_action_input_type::ResolveNpcSocialActionInput; -pub use resolve_npc_social_action_reducer::resolve_npc_social_action; -pub use resolve_treasure_interaction_and_return_procedure::resolve_treasure_interaction_and_return; -pub use resolve_treasure_interaction_reducer::resolve_treasure_interaction; pub use rpg_agent_draft_card_kind_type::RpgAgentDraftCardKind; pub use rpg_agent_draft_card_status_type::RpgAgentDraftCardStatus; pub use rpg_agent_message_kind_type::RpgAgentMessageKind; @@ -577,52 +521,149 @@ pub use runtime_profile_play_stats_get_input_type::RuntimeProfilePlayStatsGetInp pub use runtime_profile_play_stats_procedure_result_type::RuntimeProfilePlayStatsProcedureResult; pub use runtime_profile_play_stats_snapshot_type::RuntimeProfilePlayStatsSnapshot; pub use runtime_profile_played_world_snapshot_type::RuntimeProfilePlayedWorldSnapshot; +pub use runtime_profile_save_archive_list_input_type::RuntimeProfileSaveArchiveListInput; +pub use runtime_profile_save_archive_procedure_result_type::RuntimeProfileSaveArchiveProcedureResult; +pub use runtime_profile_save_archive_resume_input_type::RuntimeProfileSaveArchiveResumeInput; +pub use runtime_profile_save_archive_snapshot_type::RuntimeProfileSaveArchiveSnapshot; pub use runtime_profile_wallet_ledger_entry_snapshot_type::RuntimeProfileWalletLedgerEntrySnapshot; pub use runtime_profile_wallet_ledger_list_input_type::RuntimeProfileWalletLedgerListInput; pub use runtime_profile_wallet_ledger_procedure_result_type::RuntimeProfileWalletLedgerProcedureResult; pub use runtime_profile_wallet_ledger_source_type_type::RuntimeProfileWalletLedgerSourceType; +pub use runtime_setting_type::RuntimeSetting; pub use runtime_setting_get_input_type::RuntimeSettingGetInput; pub use runtime_setting_procedure_result_type::RuntimeSettingProcedureResult; pub use runtime_setting_snapshot_type::RuntimeSettingSnapshot; -pub use runtime_setting_table::*; -pub use runtime_setting_type::RuntimeSetting; pub use runtime_setting_upsert_input_type::RuntimeSettingUpsertInput; -pub use start_ai_task_reducer::start_ai_task; -pub use start_ai_task_stage_reducer::start_ai_task_stage; +pub use runtime_snapshot_type::RuntimeSnapshot; +pub use runtime_snapshot_delete_input_type::RuntimeSnapshotDeleteInput; +pub use runtime_snapshot_get_input_type::RuntimeSnapshotGetInput; +pub use runtime_snapshot_procedure_result_type::RuntimeSnapshotProcedureResult; +pub use runtime_snapshot_row_type::RuntimeSnapshotRow; +pub use runtime_snapshot_upsert_input_type::RuntimeSnapshotUpsertInput; pub use story_continue_input_type::StoryContinueInput; +pub use story_event_type::StoryEvent; pub use story_event_kind_type::StoryEventKind; pub use story_event_snapshot_type::StoryEventSnapshot; -pub use story_event_table::*; -pub use story_event_type::StoryEvent; +pub use story_session_type::StorySession; pub use story_session_input_type::StorySessionInput; pub use story_session_procedure_result_type::StorySessionProcedureResult; pub use story_session_snapshot_type::StorySessionSnapshot; pub use story_session_state_input_type::StorySessionStateInput; pub use story_session_state_procedure_result_type::StorySessionStateProcedureResult; pub use story_session_status_type::StorySessionStatus; -pub use story_session_table::*; -pub use story_session_type::StorySession; -pub use submit_custom_world_agent_message_procedure::submit_custom_world_agent_message; pub use treasure_interaction_action_type::TreasureInteractionAction; +pub use treasure_record_type::TreasureRecord; pub use treasure_record_procedure_result_type::TreasureRecordProcedureResult; pub use treasure_record_snapshot_type::TreasureRecordSnapshot; -pub use treasure_record_table::*; -pub use treasure_record_type::TreasureRecord; pub use treasure_resolve_input_type::TreasureResolveInput; -pub use turn_in_quest_reducer::turn_in_quest; pub use unequip_inventory_item_input_type::UnequipInventoryItemInput; -pub use unpublish_custom_world_profile_and_return_procedure::unpublish_custom_world_profile_and_return; +pub use user_browse_history_type::UserBrowseHistory; +pub use ai_result_reference_table::*; +pub use ai_task_table::*; +pub use ai_task_stage_table::*; +pub use ai_text_chunk_table::*; +pub use asset_entity_binding_table::*; +pub use asset_object_table::*; +pub use battle_state_table::*; +pub use chapter_progression_table::*; +pub use custom_world_agent_message_table::*; +pub use custom_world_agent_operation_table::*; +pub use custom_world_agent_session_table::*; +pub use custom_world_draft_card_table::*; +pub use custom_world_gallery_entry_table::*; +pub use custom_world_profile_table::*; +pub use custom_world_session_table::*; +pub use inventory_slot_table::*; +pub use npc_state_table::*; +pub use player_progression_table::*; +pub use profile_dashboard_state_table::*; +pub use profile_played_world_table::*; +pub use profile_save_archive_table::*; +pub use profile_wallet_ledger_table::*; +pub use quest_log_table::*; +pub use quest_record_table::*; +pub use runtime_setting_table::*; +pub use runtime_snapshot_table::*; +pub use story_event_table::*; +pub use story_session_table::*; +pub use treasure_record_table::*; +pub use user_browse_history_table::*; +pub use accept_quest_reducer::accept_quest; +pub use acknowledge_quest_completion_reducer::acknowledge_quest_completion; +pub use apply_chapter_progression_ledger_entry_reducer::apply_chapter_progression_ledger_entry; +pub use apply_inventory_mutation_reducer::apply_inventory_mutation; +pub use apply_quest_signal_reducer::apply_quest_signal; +pub use begin_story_session_reducer::begin_story_session; +pub use bind_asset_object_to_entity_reducer::bind_asset_object_to_entity; +pub use confirm_asset_object_reducer::confirm_asset_object; +pub use continue_story_reducer::continue_story; +pub use create_ai_task_reducer::create_ai_task; +pub use create_battle_state_reducer::create_battle_state; +pub use grant_player_progression_experience_reducer::grant_player_progression_experience; +pub use publish_custom_world_profile_reducer::publish_custom_world_profile; +pub use resolve_combat_action_reducer::resolve_combat_action; +pub use resolve_npc_interaction_reducer::resolve_npc_interaction; +pub use resolve_npc_social_action_reducer::resolve_npc_social_action; +pub use resolve_treasure_interaction_reducer::resolve_treasure_interaction; +pub use start_ai_task_reducer::start_ai_task; +pub use start_ai_task_stage_reducer::start_ai_task_stage; +pub use turn_in_quest_reducer::turn_in_quest; pub use unpublish_custom_world_profile_reducer::unpublish_custom_world_profile; -pub use upsert_chapter_progression_and_return_procedure::upsert_chapter_progression_and_return; pub use upsert_chapter_progression_reducer::upsert_chapter_progression; -pub use upsert_custom_world_profile_and_return_procedure::upsert_custom_world_profile_and_return; pub use upsert_custom_world_profile_reducer::upsert_custom_world_profile; -pub use upsert_npc_state_and_return_procedure::upsert_npc_state_and_return; pub use upsert_npc_state_reducer::upsert_npc_state; +pub use append_ai_text_chunk_and_return_procedure::append_ai_text_chunk_and_return; +pub use apply_chapter_progression_ledger_entry_and_return_procedure::apply_chapter_progression_ledger_entry_and_return; +pub use attach_ai_result_reference_and_return_procedure::attach_ai_result_reference_and_return; +pub use begin_story_session_and_return_procedure::begin_story_session_and_return; +pub use bind_asset_object_to_entity_and_return_procedure::bind_asset_object_to_entity_and_return; +pub use cancel_ai_task_and_return_procedure::cancel_ai_task_and_return; +pub use clear_platform_browse_history_and_return_procedure::clear_platform_browse_history_and_return; +pub use compile_custom_world_published_profile_procedure::compile_custom_world_published_profile; +pub use complete_ai_stage_and_return_procedure::complete_ai_stage_and_return; +pub use complete_ai_task_and_return_procedure::complete_ai_task_and_return; +pub use confirm_asset_object_and_return_procedure::confirm_asset_object_and_return; +pub use continue_story_and_return_procedure::continue_story_and_return; +pub use create_ai_task_and_return_procedure::create_ai_task_and_return; +pub use create_battle_state_and_return_procedure::create_battle_state_and_return; +pub use create_custom_world_agent_session_procedure::create_custom_world_agent_session; +pub use delete_runtime_snapshot_and_return_procedure::delete_runtime_snapshot_and_return; +pub use fail_ai_task_and_return_procedure::fail_ai_task_and_return; +pub use get_battle_state_procedure::get_battle_state; +pub use get_chapter_progression_procedure::get_chapter_progression; +pub use get_custom_world_agent_operation_procedure::get_custom_world_agent_operation; +pub use get_custom_world_agent_session_procedure::get_custom_world_agent_session; +pub use get_custom_world_gallery_detail_procedure::get_custom_world_gallery_detail; +pub use get_custom_world_library_detail_procedure::get_custom_world_library_detail; +pub use get_player_progression_or_default_procedure::get_player_progression_or_default; +pub use get_profile_dashboard_procedure::get_profile_dashboard; +pub use get_profile_play_stats_procedure::get_profile_play_stats; +pub use get_runtime_inventory_state_procedure::get_runtime_inventory_state; +pub use get_runtime_setting_or_default_procedure::get_runtime_setting_or_default; +pub use get_runtime_snapshot_procedure::get_runtime_snapshot; +pub use get_story_session_state_procedure::get_story_session_state; +pub use grant_player_progression_experience_and_return_procedure::grant_player_progression_experience_and_return; +pub use list_custom_world_gallery_entries_procedure::list_custom_world_gallery_entries; +pub use list_custom_world_profiles_procedure::list_custom_world_profiles; +pub use list_platform_browse_history_procedure::list_platform_browse_history; +pub use list_profile_save_archives_procedure::list_profile_save_archives; +pub use list_profile_wallet_ledger_procedure::list_profile_wallet_ledger; +pub use publish_custom_world_profile_and_return_procedure::publish_custom_world_profile_and_return; +pub use publish_custom_world_world_procedure::publish_custom_world_world; +pub use resolve_combat_action_and_return_procedure::resolve_combat_action_and_return; +pub use resolve_npc_battle_interaction_and_return_procedure::resolve_npc_battle_interaction_and_return; +pub use resolve_npc_interaction_and_return_procedure::resolve_npc_interaction_and_return; +pub use resolve_npc_social_action_and_return_procedure::resolve_npc_social_action_and_return; +pub use resolve_treasure_interaction_and_return_procedure::resolve_treasure_interaction_and_return; +pub use resume_profile_save_archive_and_return_procedure::resume_profile_save_archive_and_return; +pub use submit_custom_world_agent_message_procedure::submit_custom_world_agent_message; +pub use unpublish_custom_world_profile_and_return_procedure::unpublish_custom_world_profile_and_return; +pub use upsert_chapter_progression_and_return_procedure::upsert_chapter_progression_and_return; +pub use upsert_custom_world_profile_and_return_procedure::upsert_custom_world_profile_and_return; +pub use upsert_npc_state_and_return_procedure::upsert_npc_state_and_return; pub use upsert_platform_browse_history_and_return_procedure::upsert_platform_browse_history_and_return; pub use upsert_runtime_setting_and_return_procedure::upsert_runtime_setting_and_return; -pub use user_browse_history_table::*; -pub use user_browse_history_type::UserBrowseHistory; +pub use upsert_runtime_snapshot_and_return_procedure::upsert_runtime_snapshot_and_return; #[derive(Clone, PartialEq, Debug)] @@ -632,80 +673,81 @@ pub use user_browse_history_type::UserBrowseHistory; /// to indicate which reducer caused the event. pub enum Reducer { - AcceptQuest { + AcceptQuest { input: QuestRecordInput, - }, +} , AcknowledgeQuestCompletion { input: QuestCompletionAckInput, - }, +} , ApplyChapterProgressionLedgerEntry { input: ChapterProgressionLedgerInput, - }, +} , ApplyInventoryMutation { input: InventoryMutationInput, - }, +} , ApplyQuestSignal { input: QuestSignalApplyInput, - }, +} , BeginStorySession { input: StorySessionInput, - }, +} , BindAssetObjectToEntity { input: AssetEntityBindingInput, - }, +} , ConfirmAssetObject { input: AssetObjectUpsertInput, - }, +} , ContinueStory { input: StoryContinueInput, - }, +} , CreateAiTask { input: AiTaskCreateInput, - }, +} , CreateBattleState { input: BattleStateInput, - }, +} , GrantPlayerProgressionExperience { input: PlayerProgressionGrantInput, - }, +} , PublishCustomWorldProfile { input: CustomWorldProfilePublishInput, - }, +} , ResolveCombatAction { input: ResolveCombatActionInput, - }, +} , ResolveNpcInteraction { input: ResolveNpcInteractionInput, - }, +} , ResolveNpcSocialAction { input: ResolveNpcSocialActionInput, - }, +} , ResolveTreasureInteraction { input: TreasureResolveInput, - }, +} , StartAiTask { input: AiTaskStartInput, - }, +} , StartAiTaskStage { input: AiTaskStageStartInput, - }, +} , TurnInQuest { input: QuestTurnInInput, - }, +} , UnpublishCustomWorldProfile { input: CustomWorldProfileUnpublishInput, - }, +} , UpsertChapterProgression { input: ChapterProgressionInput, - }, +} , UpsertCustomWorldProfile { input: CustomWorldProfileUpsertInput, - }, +} , UpsertNpcState { input: NpcStateUpsertInput, - }, +} , } + impl __sdk::InModule for Reducer { type Module = RemoteModule; } @@ -713,11 +755,9 @@ impl __sdk::InModule for Reducer { impl __sdk::Reducer for Reducer { fn reducer_name(&self) -> &'static str { match self { - Reducer::AcceptQuest { .. } => "accept_quest", + Reducer::AcceptQuest { .. } => "accept_quest", Reducer::AcknowledgeQuestCompletion { .. } => "acknowledge_quest_completion", - Reducer::ApplyChapterProgressionLedgerEntry { .. } => { - "apply_chapter_progression_ledger_entry" - } + Reducer::ApplyChapterProgressionLedgerEntry { .. } => "apply_chapter_progression_ledger_entry", Reducer::ApplyInventoryMutation { .. } => "apply_inventory_mutation", Reducer::ApplyQuestSignal { .. } => "apply_quest_signal", Reducer::BeginStorySession { .. } => "begin_story_session", @@ -726,9 +766,7 @@ impl __sdk::Reducer for Reducer { Reducer::ContinueStory { .. } => "continue_story", Reducer::CreateAiTask { .. } => "create_ai_task", Reducer::CreateBattleState { .. } => "create_battle_state", - Reducer::GrantPlayerProgressionExperience { .. } => { - "grant_player_progression_experience" - } + Reducer::GrantPlayerProgressionExperience { .. } => "grant_player_progression_experience", Reducer::PublishCustomWorldProfile { .. } => "publish_custom_world_profile", Reducer::ResolveCombatAction { .. } => "resolve_combat_action", Reducer::ResolveNpcInteraction { .. } => "resolve_npc_interaction", @@ -742,10 +780,10 @@ impl __sdk::Reducer for Reducer { Reducer::UpsertCustomWorldProfile { .. } => "upsert_custom_world_profile", Reducer::UpsertNpcState { .. } => "upsert_npc_state", _ => unreachable!(), - } - } +} +} #[allow(clippy::clone_on_copy)] - fn args_bsatn(&self) -> Result, __sats::bsatn::EncodeError> { +fn args_bsatn(&self) -> Result, __sats::bsatn::EncodeError> { match self { Reducer::AcceptQuest{ input, @@ -869,14 +907,14 @@ impl __sdk::Reducer for Reducer { }), _ => unreachable!(), } - } +} } #[derive(Default, Debug)] #[allow(non_snake_case)] #[doc(hidden)] pub struct DbUpdate { - ai_result_reference: __sdk::TableUpdate, + ai_result_reference: __sdk::TableUpdate, ai_task: __sdk::TableUpdate, ai_task_stage: __sdk::TableUpdate, ai_text_chunk: __sdk::TableUpdate, @@ -896,114 +934,63 @@ pub struct DbUpdate { player_progression: __sdk::TableUpdate, profile_dashboard_state: __sdk::TableUpdate, profile_played_world: __sdk::TableUpdate, + profile_save_archive: __sdk::TableUpdate, profile_wallet_ledger: __sdk::TableUpdate, quest_log: __sdk::TableUpdate, quest_record: __sdk::TableUpdate, runtime_setting: __sdk::TableUpdate, + runtime_snapshot: __sdk::TableUpdate, story_event: __sdk::TableUpdate, story_session: __sdk::TableUpdate, treasure_record: __sdk::TableUpdate, user_browse_history: __sdk::TableUpdate, } + impl TryFrom<__ws::v2::TransactionUpdate> for DbUpdate { type Error = __sdk::Error; fn try_from(raw: __ws::v2::TransactionUpdate) -> Result { let mut db_update = DbUpdate::default(); for table_update in __sdk::transaction_update_iter_table_updates(raw) { match &table_update.table_name[..] { - "ai_result_reference" => db_update - .ai_result_reference - .append(ai_result_reference_table::parse_table_update(table_update)?), - "ai_task" => db_update - .ai_task - .append(ai_task_table::parse_table_update(table_update)?), - "ai_task_stage" => db_update - .ai_task_stage - .append(ai_task_stage_table::parse_table_update(table_update)?), - "ai_text_chunk" => db_update - .ai_text_chunk - .append(ai_text_chunk_table::parse_table_update(table_update)?), - "asset_entity_binding" => db_update.asset_entity_binding.append( - asset_entity_binding_table::parse_table_update(table_update)?, - ), - "asset_object" => db_update - .asset_object - .append(asset_object_table::parse_table_update(table_update)?), - "battle_state" => db_update - .battle_state - .append(battle_state_table::parse_table_update(table_update)?), - "chapter_progression" => db_update - .chapter_progression - .append(chapter_progression_table::parse_table_update(table_update)?), - "custom_world_agent_message" => db_update.custom_world_agent_message.append( - custom_world_agent_message_table::parse_table_update(table_update)?, - ), - "custom_world_agent_operation" => db_update.custom_world_agent_operation.append( - custom_world_agent_operation_table::parse_table_update(table_update)?, - ), - "custom_world_agent_session" => db_update.custom_world_agent_session.append( - custom_world_agent_session_table::parse_table_update(table_update)?, - ), - "custom_world_draft_card" => db_update.custom_world_draft_card.append( - custom_world_draft_card_table::parse_table_update(table_update)?, - ), - "custom_world_gallery_entry" => db_update.custom_world_gallery_entry.append( - custom_world_gallery_entry_table::parse_table_update(table_update)?, - ), - "custom_world_profile" => db_update.custom_world_profile.append( - custom_world_profile_table::parse_table_update(table_update)?, - ), - "custom_world_session" => db_update.custom_world_session.append( - custom_world_session_table::parse_table_update(table_update)?, - ), - "inventory_slot" => db_update - .inventory_slot - .append(inventory_slot_table::parse_table_update(table_update)?), - "npc_state" => db_update - .npc_state - .append(npc_state_table::parse_table_update(table_update)?), - "player_progression" => db_update - .player_progression - .append(player_progression_table::parse_table_update(table_update)?), - "profile_dashboard_state" => db_update.profile_dashboard_state.append( - profile_dashboard_state_table::parse_table_update(table_update)?, - ), - "profile_played_world" => db_update.profile_played_world.append( - profile_played_world_table::parse_table_update(table_update)?, - ), - "profile_wallet_ledger" => db_update.profile_wallet_ledger.append( - profile_wallet_ledger_table::parse_table_update(table_update)?, - ), - "quest_log" => db_update - .quest_log - .append(quest_log_table::parse_table_update(table_update)?), - "quest_record" => db_update - .quest_record - .append(quest_record_table::parse_table_update(table_update)?), - "runtime_setting" => db_update - .runtime_setting - .append(runtime_setting_table::parse_table_update(table_update)?), - "story_event" => db_update - .story_event - .append(story_event_table::parse_table_update(table_update)?), - "story_session" => db_update - .story_session - .append(story_session_table::parse_table_update(table_update)?), - "treasure_record" => db_update - .treasure_record - .append(treasure_record_table::parse_table_update(table_update)?), - "user_browse_history" => db_update - .user_browse_history - .append(user_browse_history_table::parse_table_update(table_update)?), + + "ai_result_reference" => db_update.ai_result_reference.append(ai_result_reference_table::parse_table_update(table_update)?), + "ai_task" => db_update.ai_task.append(ai_task_table::parse_table_update(table_update)?), + "ai_task_stage" => db_update.ai_task_stage.append(ai_task_stage_table::parse_table_update(table_update)?), + "ai_text_chunk" => db_update.ai_text_chunk.append(ai_text_chunk_table::parse_table_update(table_update)?), + "asset_entity_binding" => db_update.asset_entity_binding.append(asset_entity_binding_table::parse_table_update(table_update)?), + "asset_object" => db_update.asset_object.append(asset_object_table::parse_table_update(table_update)?), + "battle_state" => db_update.battle_state.append(battle_state_table::parse_table_update(table_update)?), + "chapter_progression" => db_update.chapter_progression.append(chapter_progression_table::parse_table_update(table_update)?), + "custom_world_agent_message" => db_update.custom_world_agent_message.append(custom_world_agent_message_table::parse_table_update(table_update)?), + "custom_world_agent_operation" => db_update.custom_world_agent_operation.append(custom_world_agent_operation_table::parse_table_update(table_update)?), + "custom_world_agent_session" => db_update.custom_world_agent_session.append(custom_world_agent_session_table::parse_table_update(table_update)?), + "custom_world_draft_card" => db_update.custom_world_draft_card.append(custom_world_draft_card_table::parse_table_update(table_update)?), + "custom_world_gallery_entry" => db_update.custom_world_gallery_entry.append(custom_world_gallery_entry_table::parse_table_update(table_update)?), + "custom_world_profile" => db_update.custom_world_profile.append(custom_world_profile_table::parse_table_update(table_update)?), + "custom_world_session" => db_update.custom_world_session.append(custom_world_session_table::parse_table_update(table_update)?), + "inventory_slot" => db_update.inventory_slot.append(inventory_slot_table::parse_table_update(table_update)?), + "npc_state" => db_update.npc_state.append(npc_state_table::parse_table_update(table_update)?), + "player_progression" => db_update.player_progression.append(player_progression_table::parse_table_update(table_update)?), + "profile_dashboard_state" => db_update.profile_dashboard_state.append(profile_dashboard_state_table::parse_table_update(table_update)?), + "profile_played_world" => db_update.profile_played_world.append(profile_played_world_table::parse_table_update(table_update)?), + "profile_save_archive" => db_update.profile_save_archive.append(profile_save_archive_table::parse_table_update(table_update)?), + "profile_wallet_ledger" => db_update.profile_wallet_ledger.append(profile_wallet_ledger_table::parse_table_update(table_update)?), + "quest_log" => db_update.quest_log.append(quest_log_table::parse_table_update(table_update)?), + "quest_record" => db_update.quest_record.append(quest_record_table::parse_table_update(table_update)?), + "runtime_setting" => db_update.runtime_setting.append(runtime_setting_table::parse_table_update(table_update)?), + "runtime_snapshot" => db_update.runtime_snapshot.append(runtime_snapshot_table::parse_table_update(table_update)?), + "story_event" => db_update.story_event.append(story_event_table::parse_table_update(table_update)?), + "story_session" => db_update.story_session.append(story_session_table::parse_table_update(table_update)?), + "treasure_record" => db_update.treasure_record.append(treasure_record_table::parse_table_update(table_update)?), + "user_browse_history" => db_update.user_browse_history.append(user_browse_history_table::parse_table_update(table_update)?), unknown => { return Err(__sdk::InternalError::unknown_name( "table", unknown, "DatabaseUpdate", - ) - .into()); + ).into()); } } } @@ -1016,345 +1003,123 @@ impl __sdk::InModule for DbUpdate { } impl __sdk::DbUpdate for DbUpdate { - fn apply_to_client_cache( - &self, - cache: &mut __sdk::ClientCache, - ) -> AppliedDiff<'_> { - let mut diff = AppliedDiff::default(); + fn apply_to_client_cache(&self, cache: &mut __sdk::ClientCache) -> AppliedDiff<'_> { + let mut diff = AppliedDiff::default(); + + diff.ai_result_reference = cache.apply_diff_to_table::("ai_result_reference", &self.ai_result_reference).with_updates_by_pk(|row| &row.result_reference_row_id); + diff.ai_task = cache.apply_diff_to_table::("ai_task", &self.ai_task).with_updates_by_pk(|row| &row.task_id); + diff.ai_task_stage = cache.apply_diff_to_table::("ai_task_stage", &self.ai_task_stage).with_updates_by_pk(|row| &row.task_stage_id); + diff.ai_text_chunk = cache.apply_diff_to_table::("ai_text_chunk", &self.ai_text_chunk).with_updates_by_pk(|row| &row.text_chunk_row_id); + diff.asset_entity_binding = cache.apply_diff_to_table::("asset_entity_binding", &self.asset_entity_binding).with_updates_by_pk(|row| &row.binding_id); + diff.asset_object = cache.apply_diff_to_table::("asset_object", &self.asset_object).with_updates_by_pk(|row| &row.asset_object_id); + diff.battle_state = cache.apply_diff_to_table::("battle_state", &self.battle_state).with_updates_by_pk(|row| &row.battle_state_id); + diff.chapter_progression = cache.apply_diff_to_table::("chapter_progression", &self.chapter_progression).with_updates_by_pk(|row| &row.chapter_progression_id); + diff.custom_world_agent_message = cache.apply_diff_to_table::("custom_world_agent_message", &self.custom_world_agent_message).with_updates_by_pk(|row| &row.message_id); + diff.custom_world_agent_operation = cache.apply_diff_to_table::("custom_world_agent_operation", &self.custom_world_agent_operation).with_updates_by_pk(|row| &row.operation_id); + diff.custom_world_agent_session = cache.apply_diff_to_table::("custom_world_agent_session", &self.custom_world_agent_session).with_updates_by_pk(|row| &row.session_id); + diff.custom_world_draft_card = cache.apply_diff_to_table::("custom_world_draft_card", &self.custom_world_draft_card).with_updates_by_pk(|row| &row.card_id); + diff.custom_world_gallery_entry = cache.apply_diff_to_table::("custom_world_gallery_entry", &self.custom_world_gallery_entry).with_updates_by_pk(|row| &row.profile_id); + diff.custom_world_profile = cache.apply_diff_to_table::("custom_world_profile", &self.custom_world_profile).with_updates_by_pk(|row| &row.profile_id); + diff.custom_world_session = cache.apply_diff_to_table::("custom_world_session", &self.custom_world_session).with_updates_by_pk(|row| &row.session_id); + diff.inventory_slot = cache.apply_diff_to_table::("inventory_slot", &self.inventory_slot).with_updates_by_pk(|row| &row.slot_id); + diff.npc_state = cache.apply_diff_to_table::("npc_state", &self.npc_state).with_updates_by_pk(|row| &row.npc_state_id); + diff.player_progression = cache.apply_diff_to_table::("player_progression", &self.player_progression).with_updates_by_pk(|row| &row.user_id); + diff.profile_dashboard_state = cache.apply_diff_to_table::("profile_dashboard_state", &self.profile_dashboard_state).with_updates_by_pk(|row| &row.user_id); + diff.profile_played_world = cache.apply_diff_to_table::("profile_played_world", &self.profile_played_world).with_updates_by_pk(|row| &row.played_world_id); + diff.profile_save_archive = cache.apply_diff_to_table::("profile_save_archive", &self.profile_save_archive).with_updates_by_pk(|row| &row.archive_id); + diff.profile_wallet_ledger = cache.apply_diff_to_table::("profile_wallet_ledger", &self.profile_wallet_ledger).with_updates_by_pk(|row| &row.wallet_ledger_id); + diff.quest_log = cache.apply_diff_to_table::("quest_log", &self.quest_log).with_updates_by_pk(|row| &row.log_id); + diff.quest_record = cache.apply_diff_to_table::("quest_record", &self.quest_record).with_updates_by_pk(|row| &row.quest_id); + diff.runtime_setting = cache.apply_diff_to_table::("runtime_setting", &self.runtime_setting).with_updates_by_pk(|row| &row.user_id); + diff.runtime_snapshot = cache.apply_diff_to_table::("runtime_snapshot", &self.runtime_snapshot).with_updates_by_pk(|row| &row.user_id); + diff.story_event = cache.apply_diff_to_table::("story_event", &self.story_event).with_updates_by_pk(|row| &row.event_id); + diff.story_session = cache.apply_diff_to_table::("story_session", &self.story_session).with_updates_by_pk(|row| &row.story_session_id); + diff.treasure_record = cache.apply_diff_to_table::("treasure_record", &self.treasure_record).with_updates_by_pk(|row| &row.treasure_record_id); + diff.user_browse_history = cache.apply_diff_to_table::("user_browse_history", &self.user_browse_history).with_updates_by_pk(|row| &row.browse_history_id); - diff.ai_result_reference = cache - .apply_diff_to_table::( - "ai_result_reference", - &self.ai_result_reference, - ) - .with_updates_by_pk(|row| &row.result_reference_row_id); - diff.ai_task = cache - .apply_diff_to_table::("ai_task", &self.ai_task) - .with_updates_by_pk(|row| &row.task_id); - diff.ai_task_stage = cache - .apply_diff_to_table::("ai_task_stage", &self.ai_task_stage) - .with_updates_by_pk(|row| &row.task_stage_id); - diff.ai_text_chunk = cache - .apply_diff_to_table::("ai_text_chunk", &self.ai_text_chunk) - .with_updates_by_pk(|row| &row.text_chunk_row_id); - diff.asset_entity_binding = cache - .apply_diff_to_table::( - "asset_entity_binding", - &self.asset_entity_binding, - ) - .with_updates_by_pk(|row| &row.binding_id); - diff.asset_object = cache - .apply_diff_to_table::("asset_object", &self.asset_object) - .with_updates_by_pk(|row| &row.asset_object_id); - diff.battle_state = cache - .apply_diff_to_table::("battle_state", &self.battle_state) - .with_updates_by_pk(|row| &row.battle_state_id); - diff.chapter_progression = cache - .apply_diff_to_table::( - "chapter_progression", - &self.chapter_progression, - ) - .with_updates_by_pk(|row| &row.chapter_progression_id); - diff.custom_world_agent_message = cache - .apply_diff_to_table::( - "custom_world_agent_message", - &self.custom_world_agent_message, - ) - .with_updates_by_pk(|row| &row.message_id); - diff.custom_world_agent_operation = cache - .apply_diff_to_table::( - "custom_world_agent_operation", - &self.custom_world_agent_operation, - ) - .with_updates_by_pk(|row| &row.operation_id); - diff.custom_world_agent_session = cache - .apply_diff_to_table::( - "custom_world_agent_session", - &self.custom_world_agent_session, - ) - .with_updates_by_pk(|row| &row.session_id); - diff.custom_world_draft_card = cache - .apply_diff_to_table::( - "custom_world_draft_card", - &self.custom_world_draft_card, - ) - .with_updates_by_pk(|row| &row.card_id); - diff.custom_world_gallery_entry = cache - .apply_diff_to_table::( - "custom_world_gallery_entry", - &self.custom_world_gallery_entry, - ) - .with_updates_by_pk(|row| &row.profile_id); - diff.custom_world_profile = cache - .apply_diff_to_table::( - "custom_world_profile", - &self.custom_world_profile, - ) - .with_updates_by_pk(|row| &row.profile_id); - diff.custom_world_session = cache - .apply_diff_to_table::( - "custom_world_session", - &self.custom_world_session, - ) - .with_updates_by_pk(|row| &row.session_id); - diff.inventory_slot = cache - .apply_diff_to_table::("inventory_slot", &self.inventory_slot) - .with_updates_by_pk(|row| &row.slot_id); - diff.npc_state = cache - .apply_diff_to_table::("npc_state", &self.npc_state) - .with_updates_by_pk(|row| &row.npc_state_id); - diff.player_progression = cache - .apply_diff_to_table::( - "player_progression", - &self.player_progression, - ) - .with_updates_by_pk(|row| &row.user_id); - diff.profile_dashboard_state = cache - .apply_diff_to_table::( - "profile_dashboard_state", - &self.profile_dashboard_state, - ) - .with_updates_by_pk(|row| &row.user_id); - diff.profile_played_world = cache - .apply_diff_to_table::( - "profile_played_world", - &self.profile_played_world, - ) - .with_updates_by_pk(|row| &row.played_world_id); - diff.profile_wallet_ledger = cache - .apply_diff_to_table::( - "profile_wallet_ledger", - &self.profile_wallet_ledger, - ) - .with_updates_by_pk(|row| &row.wallet_ledger_id); - diff.quest_log = cache - .apply_diff_to_table::("quest_log", &self.quest_log) - .with_updates_by_pk(|row| &row.log_id); - diff.quest_record = cache - .apply_diff_to_table::("quest_record", &self.quest_record) - .with_updates_by_pk(|row| &row.quest_id); - diff.runtime_setting = cache - .apply_diff_to_table::("runtime_setting", &self.runtime_setting) - .with_updates_by_pk(|row| &row.user_id); - diff.story_event = cache - .apply_diff_to_table::("story_event", &self.story_event) - .with_updates_by_pk(|row| &row.event_id); - diff.story_session = cache - .apply_diff_to_table::("story_session", &self.story_session) - .with_updates_by_pk(|row| &row.story_session_id); - diff.treasure_record = cache - .apply_diff_to_table::("treasure_record", &self.treasure_record) - .with_updates_by_pk(|row| &row.treasure_record_id); - diff.user_browse_history = cache - .apply_diff_to_table::( - "user_browse_history", - &self.user_browse_history, - ) - .with_updates_by_pk(|row| &row.browse_history_id); - - diff - } - fn parse_initial_rows(raw: __ws::v2::QueryRows) -> __sdk::Result { - let mut db_update = DbUpdate::default(); - for table_rows in raw.tables { - match &table_rows.table[..] { - "ai_result_reference" => db_update - .ai_result_reference - .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), - "ai_task" => db_update - .ai_task - .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), - "ai_task_stage" => db_update - .ai_task_stage - .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), - "ai_text_chunk" => db_update - .ai_text_chunk - .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), - "asset_entity_binding" => db_update - .asset_entity_binding - .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), - "asset_object" => db_update - .asset_object - .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), - "battle_state" => db_update - .battle_state - .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), - "chapter_progression" => db_update - .chapter_progression - .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), - "custom_world_agent_message" => db_update - .custom_world_agent_message - .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), - "custom_world_agent_operation" => db_update - .custom_world_agent_operation - .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), - "custom_world_agent_session" => db_update - .custom_world_agent_session - .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), - "custom_world_draft_card" => db_update - .custom_world_draft_card - .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), - "custom_world_gallery_entry" => db_update - .custom_world_gallery_entry - .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), - "custom_world_profile" => db_update - .custom_world_profile - .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), - "custom_world_session" => db_update - .custom_world_session - .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), - "inventory_slot" => db_update - .inventory_slot - .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), - "npc_state" => db_update - .npc_state - .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), - "player_progression" => db_update - .player_progression - .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), - "profile_dashboard_state" => db_update - .profile_dashboard_state - .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), - "profile_played_world" => db_update - .profile_played_world - .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), - "profile_wallet_ledger" => db_update - .profile_wallet_ledger - .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), - "quest_log" => db_update - .quest_log - .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), - "quest_record" => db_update - .quest_record - .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), - "runtime_setting" => db_update - .runtime_setting - .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), - "story_event" => db_update - .story_event - .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), - "story_session" => db_update - .story_session - .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), - "treasure_record" => db_update - .treasure_record - .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), - "user_browse_history" => db_update - .user_browse_history - .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), - unknown => { - return Err( - __sdk::InternalError::unknown_name("table", unknown, "QueryRows").into(), - ); + diff } - } - } - Ok(db_update) - } - fn parse_unsubscribe_rows(raw: __ws::v2::QueryRows) -> __sdk::Result { - let mut db_update = DbUpdate::default(); - for table_rows in raw.tables { +fn parse_initial_rows(raw: __ws::v2::QueryRows) -> __sdk::Result { + let mut db_update = DbUpdate::default(); +for table_rows in raw.tables { match &table_rows.table[..] { - "ai_result_reference" => db_update - .ai_result_reference - .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), - "ai_task" => db_update - .ai_task - .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), - "ai_task_stage" => db_update - .ai_task_stage - .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), - "ai_text_chunk" => db_update - .ai_text_chunk - .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), - "asset_entity_binding" => db_update - .asset_entity_binding - .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), - "asset_object" => db_update - .asset_object - .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), - "battle_state" => db_update - .battle_state - .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), - "chapter_progression" => db_update - .chapter_progression - .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), - "custom_world_agent_message" => db_update - .custom_world_agent_message - .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), - "custom_world_agent_operation" => db_update - .custom_world_agent_operation - .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), - "custom_world_agent_session" => db_update - .custom_world_agent_session - .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), - "custom_world_draft_card" => db_update - .custom_world_draft_card - .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), - "custom_world_gallery_entry" => db_update - .custom_world_gallery_entry - .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), - "custom_world_profile" => db_update - .custom_world_profile - .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), - "custom_world_session" => db_update - .custom_world_session - .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), - "inventory_slot" => db_update - .inventory_slot - .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), - "npc_state" => db_update - .npc_state - .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), - "player_progression" => db_update - .player_progression - .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), - "profile_dashboard_state" => db_update - .profile_dashboard_state - .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), - "profile_played_world" => db_update - .profile_played_world - .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), - "profile_wallet_ledger" => db_update - .profile_wallet_ledger - .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), - "quest_log" => db_update - .quest_log - .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), - "quest_record" => db_update - .quest_record - .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), - "runtime_setting" => db_update - .runtime_setting - .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), - "story_event" => db_update - .story_event - .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), - "story_session" => db_update - .story_session - .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), - "treasure_record" => db_update - .treasure_record - .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), - "user_browse_history" => db_update - .user_browse_history - .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), - unknown => { - return Err( - __sdk::InternalError::unknown_name("table", unknown, "QueryRows").into(), - ); - } - } - } - Ok(db_update) - } + "ai_result_reference" => db_update.ai_result_reference.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "ai_task" => db_update.ai_task.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "ai_task_stage" => db_update.ai_task_stage.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "ai_text_chunk" => db_update.ai_text_chunk.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "asset_entity_binding" => db_update.asset_entity_binding.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "asset_object" => db_update.asset_object.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "battle_state" => db_update.battle_state.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "chapter_progression" => db_update.chapter_progression.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "custom_world_agent_message" => db_update.custom_world_agent_message.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "custom_world_agent_operation" => db_update.custom_world_agent_operation.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "custom_world_agent_session" => db_update.custom_world_agent_session.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "custom_world_draft_card" => db_update.custom_world_draft_card.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "custom_world_gallery_entry" => db_update.custom_world_gallery_entry.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "custom_world_profile" => db_update.custom_world_profile.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "custom_world_session" => db_update.custom_world_session.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "inventory_slot" => db_update.inventory_slot.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "npc_state" => db_update.npc_state.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "player_progression" => db_update.player_progression.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "profile_dashboard_state" => db_update.profile_dashboard_state.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "profile_played_world" => db_update.profile_played_world.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "profile_save_archive" => db_update.profile_save_archive.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "profile_wallet_ledger" => db_update.profile_wallet_ledger.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "quest_log" => db_update.quest_log.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "quest_record" => db_update.quest_record.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "runtime_setting" => db_update.runtime_setting.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "runtime_snapshot" => db_update.runtime_snapshot.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "story_event" => db_update.story_event.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "story_session" => db_update.story_session.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "treasure_record" => db_update.treasure_record.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "user_browse_history" => db_update.user_browse_history.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + unknown => { return Err(__sdk::InternalError::unknown_name("table", unknown, "QueryRows").into()); } +}} Ok(db_update) +} +fn parse_unsubscribe_rows(raw: __ws::v2::QueryRows) -> __sdk::Result { + let mut db_update = DbUpdate::default(); +for table_rows in raw.tables { + match &table_rows.table[..] { + "ai_result_reference" => db_update.ai_result_reference.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "ai_task" => db_update.ai_task.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "ai_task_stage" => db_update.ai_task_stage.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "ai_text_chunk" => db_update.ai_text_chunk.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "asset_entity_binding" => db_update.asset_entity_binding.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "asset_object" => db_update.asset_object.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "battle_state" => db_update.battle_state.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "chapter_progression" => db_update.chapter_progression.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "custom_world_agent_message" => db_update.custom_world_agent_message.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "custom_world_agent_operation" => db_update.custom_world_agent_operation.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "custom_world_agent_session" => db_update.custom_world_agent_session.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "custom_world_draft_card" => db_update.custom_world_draft_card.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "custom_world_gallery_entry" => db_update.custom_world_gallery_entry.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "custom_world_profile" => db_update.custom_world_profile.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "custom_world_session" => db_update.custom_world_session.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "inventory_slot" => db_update.inventory_slot.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "npc_state" => db_update.npc_state.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "player_progression" => db_update.player_progression.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "profile_dashboard_state" => db_update.profile_dashboard_state.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "profile_played_world" => db_update.profile_played_world.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "profile_save_archive" => db_update.profile_save_archive.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "profile_wallet_ledger" => db_update.profile_wallet_ledger.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "quest_log" => db_update.quest_log.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "quest_record" => db_update.quest_record.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "runtime_setting" => db_update.runtime_setting.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "runtime_snapshot" => db_update.runtime_snapshot.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "story_event" => db_update.story_event.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "story_session" => db_update.story_session.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "treasure_record" => db_update.treasure_record.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "user_browse_history" => db_update.user_browse_history.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + unknown => { return Err(__sdk::InternalError::unknown_name("table", unknown, "QueryRows").into()); } +}} Ok(db_update) +} } #[derive(Default)] #[allow(non_snake_case)] #[doc(hidden)] pub struct AppliedDiff<'r> { - ai_result_reference: __sdk::TableAppliedDiff<'r, AiResultReference>, + ai_result_reference: __sdk::TableAppliedDiff<'r, AiResultReference>, ai_task: __sdk::TableAppliedDiff<'r, AiTask>, ai_task_stage: __sdk::TableAppliedDiff<'r, AiTaskStage>, ai_text_chunk: __sdk::TableAppliedDiff<'r, AiTextChunk>, @@ -1374,10 +1139,12 @@ pub struct AppliedDiff<'r> { player_progression: __sdk::TableAppliedDiff<'r, PlayerProgression>, profile_dashboard_state: __sdk::TableAppliedDiff<'r, ProfileDashboardState>, profile_played_world: __sdk::TableAppliedDiff<'r, ProfilePlayedWorld>, + profile_save_archive: __sdk::TableAppliedDiff<'r, ProfileSaveArchive>, profile_wallet_ledger: __sdk::TableAppliedDiff<'r, ProfileWalletLedger>, quest_log: __sdk::TableAppliedDiff<'r, QuestLog>, quest_record: __sdk::TableAppliedDiff<'r, QuestRecord>, runtime_setting: __sdk::TableAppliedDiff<'r, RuntimeSetting>, + runtime_snapshot: __sdk::TableAppliedDiff<'r, RuntimeSnapshotRow>, story_event: __sdk::TableAppliedDiff<'r, StoryEvent>, story_session: __sdk::TableAppliedDiff<'r, StorySession>, treasure_record: __sdk::TableAppliedDiff<'r, TreasureRecord>, @@ -1385,142 +1152,46 @@ pub struct AppliedDiff<'r> { __unused: std::marker::PhantomData<&'r ()>, } + impl __sdk::InModule for AppliedDiff<'_> { type Module = RemoteModule; } impl<'r> __sdk::AppliedDiff<'r> for AppliedDiff<'r> { - fn invoke_row_callbacks( - &self, - event: &EventContext, - callbacks: &mut __sdk::DbCallbacks, - ) { - callbacks.invoke_table_row_callbacks::( - "ai_result_reference", - &self.ai_result_reference, - event, - ); + fn invoke_row_callbacks(&self, event: &EventContext, callbacks: &mut __sdk::DbCallbacks) { + callbacks.invoke_table_row_callbacks::("ai_result_reference", &self.ai_result_reference, event); callbacks.invoke_table_row_callbacks::("ai_task", &self.ai_task, event); - callbacks.invoke_table_row_callbacks::( - "ai_task_stage", - &self.ai_task_stage, - event, - ); - callbacks.invoke_table_row_callbacks::( - "ai_text_chunk", - &self.ai_text_chunk, - event, - ); - callbacks.invoke_table_row_callbacks::( - "asset_entity_binding", - &self.asset_entity_binding, - event, - ); - callbacks.invoke_table_row_callbacks::( - "asset_object", - &self.asset_object, - event, - ); - callbacks.invoke_table_row_callbacks::( - "battle_state", - &self.battle_state, - event, - ); - callbacks.invoke_table_row_callbacks::( - "chapter_progression", - &self.chapter_progression, - event, - ); - callbacks.invoke_table_row_callbacks::( - "custom_world_agent_message", - &self.custom_world_agent_message, - event, - ); - callbacks.invoke_table_row_callbacks::( - "custom_world_agent_operation", - &self.custom_world_agent_operation, - event, - ); - callbacks.invoke_table_row_callbacks::( - "custom_world_agent_session", - &self.custom_world_agent_session, - event, - ); - callbacks.invoke_table_row_callbacks::( - "custom_world_draft_card", - &self.custom_world_draft_card, - event, - ); - callbacks.invoke_table_row_callbacks::( - "custom_world_gallery_entry", - &self.custom_world_gallery_entry, - event, - ); - callbacks.invoke_table_row_callbacks::( - "custom_world_profile", - &self.custom_world_profile, - event, - ); - callbacks.invoke_table_row_callbacks::( - "custom_world_session", - &self.custom_world_session, - event, - ); - callbacks.invoke_table_row_callbacks::( - "inventory_slot", - &self.inventory_slot, - event, - ); + callbacks.invoke_table_row_callbacks::("ai_task_stage", &self.ai_task_stage, event); + callbacks.invoke_table_row_callbacks::("ai_text_chunk", &self.ai_text_chunk, event); + callbacks.invoke_table_row_callbacks::("asset_entity_binding", &self.asset_entity_binding, event); + callbacks.invoke_table_row_callbacks::("asset_object", &self.asset_object, event); + callbacks.invoke_table_row_callbacks::("battle_state", &self.battle_state, event); + callbacks.invoke_table_row_callbacks::("chapter_progression", &self.chapter_progression, event); + callbacks.invoke_table_row_callbacks::("custom_world_agent_message", &self.custom_world_agent_message, event); + callbacks.invoke_table_row_callbacks::("custom_world_agent_operation", &self.custom_world_agent_operation, event); + callbacks.invoke_table_row_callbacks::("custom_world_agent_session", &self.custom_world_agent_session, event); + callbacks.invoke_table_row_callbacks::("custom_world_draft_card", &self.custom_world_draft_card, event); + callbacks.invoke_table_row_callbacks::("custom_world_gallery_entry", &self.custom_world_gallery_entry, event); + callbacks.invoke_table_row_callbacks::("custom_world_profile", &self.custom_world_profile, event); + callbacks.invoke_table_row_callbacks::("custom_world_session", &self.custom_world_session, event); + callbacks.invoke_table_row_callbacks::("inventory_slot", &self.inventory_slot, event); callbacks.invoke_table_row_callbacks::("npc_state", &self.npc_state, event); - callbacks.invoke_table_row_callbacks::( - "player_progression", - &self.player_progression, - event, - ); - callbacks.invoke_table_row_callbacks::( - "profile_dashboard_state", - &self.profile_dashboard_state, - event, - ); - callbacks.invoke_table_row_callbacks::( - "profile_played_world", - &self.profile_played_world, - event, - ); - callbacks.invoke_table_row_callbacks::( - "profile_wallet_ledger", - &self.profile_wallet_ledger, - event, - ); + callbacks.invoke_table_row_callbacks::("player_progression", &self.player_progression, event); + callbacks.invoke_table_row_callbacks::("profile_dashboard_state", &self.profile_dashboard_state, event); + callbacks.invoke_table_row_callbacks::("profile_played_world", &self.profile_played_world, event); + callbacks.invoke_table_row_callbacks::("profile_save_archive", &self.profile_save_archive, event); + callbacks.invoke_table_row_callbacks::("profile_wallet_ledger", &self.profile_wallet_ledger, event); callbacks.invoke_table_row_callbacks::("quest_log", &self.quest_log, event); - callbacks.invoke_table_row_callbacks::( - "quest_record", - &self.quest_record, - event, - ); - callbacks.invoke_table_row_callbacks::( - "runtime_setting", - &self.runtime_setting, - event, - ); + callbacks.invoke_table_row_callbacks::("quest_record", &self.quest_record, event); + callbacks.invoke_table_row_callbacks::("runtime_setting", &self.runtime_setting, event); + callbacks.invoke_table_row_callbacks::("runtime_snapshot", &self.runtime_snapshot, event); callbacks.invoke_table_row_callbacks::("story_event", &self.story_event, event); - callbacks.invoke_table_row_callbacks::( - "story_session", - &self.story_session, - event, - ); - callbacks.invoke_table_row_callbacks::( - "treasure_record", - &self.treasure_record, - event, - ); - callbacks.invoke_table_row_callbacks::( - "user_browse_history", - &self.user_browse_history, - event, - ); - } + callbacks.invoke_table_row_callbacks::("story_session", &self.story_session, event); + callbacks.invoke_table_row_callbacks::("treasure_record", &self.treasure_record, event); + callbacks.invoke_table_row_callbacks::("user_browse_history", &self.user_browse_history, event); } +} + #[doc(hidden)] #[derive(Debug)] @@ -1569,16 +1240,10 @@ impl __sdk::InModule for RemoteTables { /// /// - [`DbConnection::frame_tick`]. #[cfg_attr(not(target_arch = "wasm32"), doc = "- [`DbConnection::run_threaded`].")] -#[cfg_attr( - target_arch = "wasm32", - doc = "- [`DbConnection::run_background_task`]." -)] +#[cfg_attr(target_arch = "wasm32", doc = "- [`DbConnection::run_background_task`].")] /// - [`DbConnection::run_async`]. /// - [`DbConnection::advance_one_message`]. -#[cfg_attr( - not(target_arch = "wasm32"), - doc = "- [`DbConnection::advance_one_message_blocking`]." -)] +#[cfg_attr(not(target_arch = "wasm32"), doc = "- [`DbConnection::advance_one_message_blocking`].")] /// - [`DbConnection::advance_one_message_async`]. /// /// Which of these methods you should call depends on the specific needs of your application, @@ -1765,6 +1430,7 @@ impl __sdk::SubscriptionHandle for SubscriptionHandle { fn unsubscribe(self) -> __sdk::Result<()> { self.imp.unsubscribe_then(None) } + } /// Alias trait for a [`__sdk::DbContext`] connected to this module, @@ -1772,23 +1438,17 @@ impl __sdk::SubscriptionHandle for SubscriptionHandle { /// /// Users can use this trait as a boundary on definitions which should accept /// either a [`DbConnection`] or an [`EventContext`] and operate on either. -pub trait RemoteDbContext: - __sdk::DbContext< +pub trait RemoteDbContext: __sdk::DbContext< DbView = RemoteTables, Reducers = RemoteReducers, SubscriptionBuilder = __sdk::SubscriptionBuilder, -> -{ -} -impl< - Ctx: __sdk::DbContext< - DbView = RemoteTables, - Reducers = RemoteReducers, - SubscriptionBuilder = __sdk::SubscriptionBuilder, - >, - > RemoteDbContext for Ctx -{ -} +> {} +impl, +>> RemoteDbContext for Ctx {} + /// An [`__sdk::DbContext`] augmented with a [`__sdk::Event`], /// passed to [`__sdk::Table::on_insert`], [`__sdk::Table::on_delete`] and [`__sdk::TableWithPrimaryKey::on_update`] callbacks. @@ -2163,6 +1823,7 @@ impl __sdk::DbContext for ErrorContext { impl __sdk::ErrorContext for ErrorContext {} impl __sdk::SpacetimeModule for RemoteModule { + type DbConnection = DbConnection; type EventContext = EventContext; type ReducerEventContext = ReducerEventContext; @@ -2178,8 +1839,8 @@ impl __sdk::SpacetimeModule for RemoteModule { type SubscriptionHandle = SubscriptionHandle; type QueryBuilder = __sdk::QueryBuilder; - fn register_tables(client_cache: &mut __sdk::ClientCache) { - ai_result_reference_table::register_table(client_cache); +fn register_tables(client_cache: &mut __sdk::ClientCache) { + ai_result_reference_table::register_table(client_cache); ai_task_table::register_table(client_cache); ai_task_stage_table::register_table(client_cache); ai_text_chunk_table::register_table(client_cache); @@ -2199,17 +1860,19 @@ impl __sdk::SpacetimeModule for RemoteModule { player_progression_table::register_table(client_cache); profile_dashboard_state_table::register_table(client_cache); profile_played_world_table::register_table(client_cache); + profile_save_archive_table::register_table(client_cache); profile_wallet_ledger_table::register_table(client_cache); quest_log_table::register_table(client_cache); quest_record_table::register_table(client_cache); runtime_setting_table::register_table(client_cache); + runtime_snapshot_table::register_table(client_cache); story_event_table::register_table(client_cache); story_session_table::register_table(client_cache); treasure_record_table::register_table(client_cache); user_browse_history_table::register_table(client_cache); - } - const ALL_TABLE_NAMES: &'static [&'static str] = &[ - "ai_result_reference", +} +const ALL_TABLE_NAMES: &'static [&'static str] = &[ + "ai_result_reference", "ai_task", "ai_task_stage", "ai_text_chunk", @@ -2229,13 +1892,15 @@ impl __sdk::SpacetimeModule for RemoteModule { "player_progression", "profile_dashboard_state", "profile_played_world", + "profile_save_archive", "profile_wallet_ledger", "quest_log", "quest_record", "runtime_setting", + "runtime_snapshot", "story_event", "story_session", "treasure_record", "user_browse_history", - ]; +]; } diff --git a/server-rs/crates/spacetime-client/src/module_bindings/npc_battle_interaction_procedure_result_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/npc_battle_interaction_procedure_result_type.rs index d5f16a3f..1682f3ac 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/npc_battle_interaction_procedure_result_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/npc_battle_interaction_procedure_result_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::npc_battle_interaction_result_type::NpcBattleInteractionResult; @@ -10,10 +15,12 @@ use super::npc_battle_interaction_result_type::NpcBattleInteractionResult; #[sats(crate = __lib)] pub struct NpcBattleInteractionProcedureResult { pub ok: bool, - pub result: Option, - pub error_message: Option, + pub result: Option::, + pub error_message: Option::, } + impl __sdk::InModule for NpcBattleInteractionProcedureResult { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/npc_battle_interaction_result_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/npc_battle_interaction_result_type.rs index c276f969..fc8ca1c9 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/npc_battle_interaction_result_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/npc_battle_interaction_result_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::npc_interaction_result_type::NpcInteractionResult; @@ -14,6 +19,8 @@ pub struct NpcBattleInteractionResult { pub battle_state: BattleStateSnapshot, } + impl __sdk::InModule for NpcBattleInteractionResult { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/npc_interaction_battle_mode_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/npc_interaction_battle_mode_type.rs index dc8e8819..e891d6a9 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/npc_interaction_battle_mode_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/npc_interaction_battle_mode_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -11,8 +16,12 @@ pub enum NpcInteractionBattleMode { Fight, Spar, + } + + impl __sdk::InModule for NpcInteractionBattleMode { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/npc_interaction_procedure_result_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/npc_interaction_procedure_result_type.rs index 383dce2a..ef11fa63 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/npc_interaction_procedure_result_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/npc_interaction_procedure_result_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::npc_interaction_result_type::NpcInteractionResult; @@ -10,10 +15,12 @@ use super::npc_interaction_result_type::NpcInteractionResult; #[sats(crate = __lib)] pub struct NpcInteractionProcedureResult { pub ok: bool, - pub result: Option, - pub error_message: Option, + pub result: Option::, + pub error_message: Option::, } + impl __sdk::InModule for NpcInteractionProcedureResult { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/npc_interaction_result_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/npc_interaction_result_type.rs index 83624807..d457b697 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/npc_interaction_result_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/npc_interaction_result_type.rs @@ -2,11 +2,16 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::npc_interaction_battle_mode_type::NpcInteractionBattleMode; -use super::npc_interaction_status_type::NpcInteractionStatus; use super::npc_state_snapshot_type::NpcStateSnapshot; +use super::npc_interaction_status_type::NpcInteractionStatus; +use super::npc_interaction_battle_mode_type::NpcInteractionBattleMode; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] @@ -15,14 +20,16 @@ pub struct NpcInteractionResult { pub interaction_status: NpcInteractionStatus, pub action_text: String, pub result_text: String, - pub story_text: Option, - pub battle_mode: Option, + pub story_text: Option::, + pub battle_mode: Option::, pub encounter_closed: bool, pub affinity_changed: bool, pub previous_affinity: i32, pub next_affinity: i32, } + impl __sdk::InModule for NpcInteractionResult { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/npc_interaction_status_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/npc_interaction_status_type.rs index 8032abf9..cba6b5ac 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/npc_interaction_status_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/npc_interaction_status_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -19,8 +24,12 @@ pub enum NpcInteractionStatus { BattlePending, Left, + } + + impl __sdk::InModule for NpcInteractionStatus { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/npc_relation_stance_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/npc_relation_stance_type.rs index 48e8ac70..2a45f52c 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/npc_relation_stance_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/npc_relation_stance_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -17,8 +22,12 @@ pub enum NpcRelationStance { Cooperative, Bonded, + } + + impl __sdk::InModule for NpcRelationStance { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/npc_relation_state_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/npc_relation_state_type.rs index b6bbc07d..cccb0cc5 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/npc_relation_state_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/npc_relation_state_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::npc_relation_stance_type::NpcRelationStance; @@ -13,6 +18,8 @@ pub struct NpcRelationState { pub stance: NpcRelationStance, } + impl __sdk::InModule for NpcRelationState { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/npc_social_action_kind_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/npc_social_action_kind_type.rs index 9c6d2c1e..cc79b8c5 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/npc_social_action_kind_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/npc_social_action_kind_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -17,8 +22,12 @@ pub enum NpcSocialActionKind { Recruit, QuestAccept, + } + + impl __sdk::InModule for NpcSocialActionKind { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/npc_stance_profile_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/npc_stance_profile_type.rs index 73177673..5a0d7497 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/npc_stance_profile_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/npc_stance_profile_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -12,11 +18,13 @@ pub struct NpcStanceProfile { pub ideological_fit: u8, pub fear_or_guard: u8, pub loyalty: u8, - pub current_conflict_tag: Option, - pub recent_approvals: Vec, - pub recent_disapprovals: Vec, + pub current_conflict_tag: Option::, + pub recent_approvals: Vec::, + pub recent_disapprovals: Vec::, } + impl __sdk::InModule for NpcStanceProfile { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/npc_state_procedure_result_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/npc_state_procedure_result_type.rs index c4e60bef..39a8ed60 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/npc_state_procedure_result_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/npc_state_procedure_result_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::npc_state_snapshot_type::NpcStateSnapshot; @@ -10,10 +15,12 @@ use super::npc_state_snapshot_type::NpcStateSnapshot; #[sats(crate = __lib)] pub struct NpcStateProcedureResult { pub ok: bool, - pub record: Option, - pub error_message: Option, + pub record: Option::, + pub error_message: Option::, } + impl __sdk::InModule for NpcStateProcedureResult { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/npc_state_snapshot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/npc_state_snapshot_type.rs index 351b45ae..c11e0ef8 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/npc_state_snapshot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/npc_state_snapshot_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::npc_relation_state_type::NpcRelationState; use super::npc_stance_profile_type::NpcStanceProfile; @@ -20,16 +25,18 @@ pub struct NpcStateSnapshot { pub chatted_count: u32, pub gifts_given: u32, pub recruited: bool, - pub trade_stock_signature: Option, - pub revealed_facts: Vec, - pub known_attribute_rumors: Vec, + pub trade_stock_signature: Option::, + pub revealed_facts: Vec::, + pub known_attribute_rumors: Vec::, pub first_meaningful_contact_resolved: bool, - pub seen_backstory_chapter_ids: Vec, + pub seen_backstory_chapter_ids: Vec::, pub stance_profile: NpcStanceProfile, pub created_at_micros: i64, pub updated_at_micros: i64, } + impl __sdk::InModule for NpcStateSnapshot { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/npc_state_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/npc_state_table.rs index 26e7fcf5..917742d6 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/npc_state_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/npc_state_table.rs @@ -2,10 +2,15 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![allow(unused, clippy::all)] +use spacetimedb_sdk::__codegen::{ + self as __sdk, + __lib, + __sats, + __ws, +}; +use super::npc_state_type::NpcState; use super::npc_relation_state_type::NpcRelationState; use super::npc_stance_profile_type::NpcStanceProfile; -use super::npc_state_type::NpcState; -use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; /// Table handle for the table `npc_state`. /// @@ -46,12 +51,8 @@ impl<'ctx> __sdk::Table for NpcStateTableHandle<'ctx> { type Row = NpcState; type EventContext = super::EventContext; - fn count(&self) -> u64 { - self.imp.count() - } - fn iter(&self) -> impl Iterator + '_ { - self.imp.iter() - } + fn count(&self) -> u64 { self.imp.count() } + fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } type InsertCallbackId = NpcStateInsertCallbackId; @@ -97,38 +98,39 @@ impl<'ctx> __sdk::TableWithPrimaryKey for NpcStateTableHandle<'ctx> { } } -/// Access to the `npc_state_id` unique index on the table `npc_state`, -/// which allows point queries on the field of the same name -/// via the [`NpcStateNpcStateIdUnique::find`] method. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.npc_state().npc_state_id().find(...)`. -pub struct NpcStateNpcStateIdUnique<'ctx> { - imp: __sdk::UniqueConstraintHandle, - phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, -} - -impl<'ctx> NpcStateTableHandle<'ctx> { - /// Get a handle on the `npc_state_id` unique index on the table `npc_state`. - pub fn npc_state_id(&self) -> NpcStateNpcStateIdUnique<'ctx> { - NpcStateNpcStateIdUnique { - imp: self.imp.get_unique_constraint::("npc_state_id"), - phantom: std::marker::PhantomData, + /// Access to the `npc_state_id` unique index on the table `npc_state`, + /// which allows point queries on the field of the same name + /// via the [`NpcStateNpcStateIdUnique::find`] method. + /// + /// Users are encouraged not to explicitly reference this type, + /// but to directly chain method calls, + /// like `ctx.db.npc_state().npc_state_id().find(...)`. + pub struct NpcStateNpcStateIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } - } -} -impl<'ctx> NpcStateNpcStateIdUnique<'ctx> { - /// Find the subscribed row whose `npc_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 { - self.imp.find(col_val) - } -} + impl<'ctx> NpcStateTableHandle<'ctx> { + /// Get a handle on the `npc_state_id` unique index on the table `npc_state`. + pub fn npc_state_id(&self) -> NpcStateNpcStateIdUnique<'ctx> { + NpcStateNpcStateIdUnique { + imp: self.imp.get_unique_constraint::("npc_state_id"), + phantom: std::marker::PhantomData, + } + } + } + impl<'ctx> NpcStateNpcStateIdUnique<'ctx> { + /// Find the subscribed row whose `npc_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 { + self.imp.find(col_val) + } + } + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("npc_state"); _table.add_unique_constraint::("npc_state_id", |row| &row.npc_state_id); } @@ -138,24 +140,26 @@ pub(super) fn parse_table_update( raw_updates: __ws::v2::TableUpdate, ) -> __sdk::Result<__sdk::TableUpdate> { __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { - __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") - .with_cause(e) - .into() + __sdk::InternalError::failed_parse( + "TableUpdate", + "TableUpdate", + ).with_cause(e).into() }) } -#[allow(non_camel_case_types)] -/// Extension trait for query builder access to the table `NpcState`. -/// -/// Implemented for [`__sdk::QueryTableAccessor`]. -pub trait npc_stateQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `NpcState`. - fn npc_state(&self) -> __sdk::__query_builder::Table; -} + #[allow(non_camel_case_types)] + /// Extension trait for query builder access to the table `NpcState`. + /// + /// Implemented for [`__sdk::QueryTableAccessor`]. + pub trait npc_stateQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `NpcState`. + fn npc_state(&self) -> __sdk::__query_builder::Table; + } + + impl npc_stateQueryTableAccess for __sdk::QueryTableAccessor { + fn npc_state(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("npc_state") + } + } -impl npc_stateQueryTableAccess for __sdk::QueryTableAccessor { - fn npc_state(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("npc_state") - } -} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/npc_state_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/npc_state_type.rs index 1ddeec42..9e8f87ae 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/npc_state_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/npc_state_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::npc_relation_state_type::NpcRelationState; use super::npc_stance_profile_type::NpcStanceProfile; @@ -20,20 +25,22 @@ pub struct NpcState { pub chatted_count: u32, pub gifts_given: u32, pub recruited: bool, - pub trade_stock_signature: Option, - pub revealed_facts: Vec, - pub known_attribute_rumors: Vec, + pub trade_stock_signature: Option::, + pub revealed_facts: Vec::, + pub known_attribute_rumors: Vec::, pub first_meaningful_contact_resolved: bool, - pub seen_backstory_chapter_ids: Vec, + pub seen_backstory_chapter_ids: Vec::, pub stance_profile: NpcStanceProfile, pub created_at: __sdk::Timestamp, pub updated_at: __sdk::Timestamp, } + impl __sdk::InModule for NpcState { type Module = super::RemoteModule; } + /// Column accessor struct for the table `NpcState`. /// /// Provides typed access to columns for query building. @@ -48,11 +55,11 @@ pub struct NpcStateCols { pub chatted_count: __sdk::__query_builder::Col, pub gifts_given: __sdk::__query_builder::Col, pub recruited: __sdk::__query_builder::Col, - pub trade_stock_signature: __sdk::__query_builder::Col>, - pub revealed_facts: __sdk::__query_builder::Col>, - pub known_attribute_rumors: __sdk::__query_builder::Col>, + pub trade_stock_signature: __sdk::__query_builder::Col>, + pub revealed_facts: __sdk::__query_builder::Col>, + pub known_attribute_rumors: __sdk::__query_builder::Col>, pub first_meaningful_contact_resolved: __sdk::__query_builder::Col, - pub seen_backstory_chapter_ids: __sdk::__query_builder::Col>, + pub seen_backstory_chapter_ids: __sdk::__query_builder::Col>, pub stance_profile: __sdk::__query_builder::Col, pub created_at: __sdk::__query_builder::Col, pub updated_at: __sdk::__query_builder::Col, @@ -72,26 +79,15 @@ impl __sdk::__query_builder::HasCols for NpcState { chatted_count: __sdk::__query_builder::Col::new(table_name, "chatted_count"), gifts_given: __sdk::__query_builder::Col::new(table_name, "gifts_given"), recruited: __sdk::__query_builder::Col::new(table_name, "recruited"), - trade_stock_signature: __sdk::__query_builder::Col::new( - table_name, - "trade_stock_signature", - ), + trade_stock_signature: __sdk::__query_builder::Col::new(table_name, "trade_stock_signature"), revealed_facts: __sdk::__query_builder::Col::new(table_name, "revealed_facts"), - known_attribute_rumors: __sdk::__query_builder::Col::new( - table_name, - "known_attribute_rumors", - ), - first_meaningful_contact_resolved: __sdk::__query_builder::Col::new( - table_name, - "first_meaningful_contact_resolved", - ), - seen_backstory_chapter_ids: __sdk::__query_builder::Col::new( - table_name, - "seen_backstory_chapter_ids", - ), + known_attribute_rumors: __sdk::__query_builder::Col::new(table_name, "known_attribute_rumors"), + first_meaningful_contact_resolved: __sdk::__query_builder::Col::new(table_name, "first_meaningful_contact_resolved"), + seen_backstory_chapter_ids: __sdk::__query_builder::Col::new(table_name, "seen_backstory_chapter_ids"), stance_profile: __sdk::__query_builder::Col::new(table_name, "stance_profile"), created_at: __sdk::__query_builder::Col::new(table_name, "created_at"), updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"), + } } } @@ -111,12 +107,11 @@ impl __sdk::__query_builder::HasIxCols for NpcState { NpcStateIxCols { npc_id: __sdk::__query_builder::IxCol::new(table_name, "npc_id"), npc_state_id: __sdk::__query_builder::IxCol::new(table_name, "npc_state_id"), - runtime_session_id: __sdk::__query_builder::IxCol::new( - table_name, - "runtime_session_id", - ), + runtime_session_id: __sdk::__query_builder::IxCol::new(table_name, "runtime_session_id"), + } } } impl __sdk::__query_builder::CanBeLookupTable for NpcState {} + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/npc_state_upsert_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/npc_state_upsert_input_type.rs index c31346e7..ff59315a 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/npc_state_upsert_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/npc_state_upsert_input_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::npc_stance_profile_type::NpcStanceProfile; @@ -17,15 +22,17 @@ pub struct NpcStateUpsertInput { pub chatted_count: u32, pub gifts_given: u32, pub recruited: bool, - pub trade_stock_signature: Option, - pub revealed_facts: Vec, - pub known_attribute_rumors: Vec, + pub trade_stock_signature: Option::, + pub revealed_facts: Vec::, + pub known_attribute_rumors: Vec::, pub first_meaningful_contact_resolved: bool, - pub seen_backstory_chapter_ids: Vec, - pub stance_profile: Option, + pub seen_backstory_chapter_ids: Vec::, + pub stance_profile: Option::, pub updated_at_micros: i64, } + impl __sdk::InModule for NpcStateUpsertInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/player_progression_get_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/player_progression_get_input_type.rs index a4dd27f5..eb031dc3 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/player_progression_get_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/player_progression_get_input_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -10,6 +16,8 @@ pub struct PlayerProgressionGetInput { pub user_id: String, } + impl __sdk::InModule for PlayerProgressionGetInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/player_progression_grant_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/player_progression_grant_input_type.rs index b5761753..66a8696c 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/player_progression_grant_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/player_progression_grant_input_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::player_progression_grant_source_type::PlayerProgressionGrantSource; @@ -15,6 +20,8 @@ pub struct PlayerProgressionGrantInput { pub updated_at_micros: i64, } + impl __sdk::InModule for PlayerProgressionGrantInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/player_progression_grant_source_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/player_progression_grant_source_type.rs index bf3ae257..c45b9dd6 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/player_progression_grant_source_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/player_progression_grant_source_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -11,8 +16,12 @@ pub enum PlayerProgressionGrantSource { Quest, HostileNpc, + } + + impl __sdk::InModule for PlayerProgressionGrantSource { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/player_progression_procedure_result_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/player_progression_procedure_result_type.rs index 413c1208..0f3686ec 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/player_progression_procedure_result_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/player_progression_procedure_result_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::player_progression_snapshot_type::PlayerProgressionSnapshot; @@ -10,10 +15,12 @@ use super::player_progression_snapshot_type::PlayerProgressionSnapshot; #[sats(crate = __lib)] pub struct PlayerProgressionProcedureResult { pub ok: bool, - pub record: Option, - pub error_message: Option, + pub record: Option::, + pub error_message: Option::, } + impl __sdk::InModule for PlayerProgressionProcedureResult { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/player_progression_snapshot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/player_progression_snapshot_type.rs index 1361178e..116938c5 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/player_progression_snapshot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/player_progression_snapshot_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::player_progression_grant_source_type::PlayerProgressionGrantSource; @@ -15,11 +20,13 @@ pub struct PlayerProgressionSnapshot { pub total_xp: u32, pub xp_to_next_level: u32, pub pending_level_ups: u32, - pub last_granted_source: Option, + pub last_granted_source: Option::, pub created_at_micros: i64, pub updated_at_micros: i64, } + impl __sdk::InModule for PlayerProgressionSnapshot { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/player_progression_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/player_progression_table.rs index 66961930..27262e2f 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/player_progression_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/player_progression_table.rs @@ -2,9 +2,14 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![allow(unused, clippy::all)] -use super::player_progression_grant_source_type::PlayerProgressionGrantSource; +use spacetimedb_sdk::__codegen::{ + self as __sdk, + __lib, + __sats, + __ws, +}; use super::player_progression_type::PlayerProgression; -use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; +use super::player_progression_grant_source_type::PlayerProgressionGrantSource; /// Table handle for the table `player_progression`. /// @@ -32,9 +37,7 @@ pub trait PlayerProgressionTableAccess { impl PlayerProgressionTableAccess for super::RemoteTables { fn player_progression(&self) -> PlayerProgressionTableHandle<'_> { PlayerProgressionTableHandle { - imp: self - .imp - .get_table::("player_progression"), + imp: self.imp.get_table::("player_progression"), ctx: std::marker::PhantomData, } } @@ -47,12 +50,8 @@ impl<'ctx> __sdk::Table for PlayerProgressionTableHandle<'ctx> { type Row = PlayerProgression; type EventContext = super::EventContext; - fn count(&self) -> u64 { - self.imp.count() - } - fn iter(&self) -> impl Iterator + '_ { - self.imp.iter() - } + fn count(&self) -> u64 { self.imp.count() } + fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } type InsertCallbackId = PlayerProgressionInsertCallbackId; @@ -98,38 +97,39 @@ impl<'ctx> __sdk::TableWithPrimaryKey for PlayerProgressionTableHandle<'ctx> { } } -/// Access to the `user_id` unique index on the table `player_progression`, -/// which allows point queries on the field of the same name -/// via the [`PlayerProgressionUserIdUnique::find`] method. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.player_progression().user_id().find(...)`. -pub struct PlayerProgressionUserIdUnique<'ctx> { - imp: __sdk::UniqueConstraintHandle, - phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, -} - -impl<'ctx> PlayerProgressionTableHandle<'ctx> { - /// Get a handle on the `user_id` unique index on the table `player_progression`. - pub fn user_id(&self) -> PlayerProgressionUserIdUnique<'ctx> { - PlayerProgressionUserIdUnique { - imp: self.imp.get_unique_constraint::("user_id"), - phantom: std::marker::PhantomData, + /// Access to the `user_id` unique index on the table `player_progression`, + /// which allows point queries on the field of the same name + /// via the [`PlayerProgressionUserIdUnique::find`] method. + /// + /// Users are encouraged not to explicitly reference this type, + /// but to directly chain method calls, + /// like `ctx.db.player_progression().user_id().find(...)`. + pub struct PlayerProgressionUserIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } - } -} -impl<'ctx> PlayerProgressionUserIdUnique<'ctx> { - /// Find the subscribed row whose `user_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 { - self.imp.find(col_val) - } -} + impl<'ctx> PlayerProgressionTableHandle<'ctx> { + /// Get a handle on the `user_id` unique index on the table `player_progression`. + pub fn user_id(&self) -> PlayerProgressionUserIdUnique<'ctx> { + PlayerProgressionUserIdUnique { + imp: self.imp.get_unique_constraint::("user_id"), + phantom: std::marker::PhantomData, + } + } + } + impl<'ctx> PlayerProgressionUserIdUnique<'ctx> { + /// Find the subscribed row whose `user_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 { + self.imp.find(col_val) + } + } + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("player_progression"); _table.add_unique_constraint::("user_id", |row| &row.user_id); } @@ -139,24 +139,26 @@ pub(super) fn parse_table_update( raw_updates: __ws::v2::TableUpdate, ) -> __sdk::Result<__sdk::TableUpdate> { __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { - __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") - .with_cause(e) - .into() + __sdk::InternalError::failed_parse( + "TableUpdate", + "TableUpdate", + ).with_cause(e).into() }) } -#[allow(non_camel_case_types)] -/// Extension trait for query builder access to the table `PlayerProgression`. -/// -/// Implemented for [`__sdk::QueryTableAccessor`]. -pub trait player_progressionQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `PlayerProgression`. - fn player_progression(&self) -> __sdk::__query_builder::Table; -} + #[allow(non_camel_case_types)] + /// Extension trait for query builder access to the table `PlayerProgression`. + /// + /// Implemented for [`__sdk::QueryTableAccessor`]. + pub trait player_progressionQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `PlayerProgression`. + fn player_progression(&self) -> __sdk::__query_builder::Table; + } + + impl player_progressionQueryTableAccess for __sdk::QueryTableAccessor { + fn player_progression(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("player_progression") + } + } -impl player_progressionQueryTableAccess for __sdk::QueryTableAccessor { - fn player_progression(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("player_progression") - } -} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/player_progression_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/player_progression_type.rs index c734d1c2..04af99cc 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/player_progression_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/player_progression_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::player_progression_grant_source_type::PlayerProgressionGrantSource; @@ -15,15 +20,17 @@ pub struct PlayerProgression { pub total_xp: u32, pub xp_to_next_level: u32, pub pending_level_ups: u32, - pub last_granted_source: Option, + pub last_granted_source: Option::, pub created_at: __sdk::Timestamp, pub updated_at: __sdk::Timestamp, } + impl __sdk::InModule for PlayerProgression { type Module = super::RemoteModule; } + /// Column accessor struct for the table `PlayerProgression`. /// /// Provides typed access to columns for query building. @@ -34,8 +41,7 @@ pub struct PlayerProgressionCols { pub total_xp: __sdk::__query_builder::Col, pub xp_to_next_level: __sdk::__query_builder::Col, pub pending_level_ups: __sdk::__query_builder::Col, - pub last_granted_source: - __sdk::__query_builder::Col>, + pub last_granted_source: __sdk::__query_builder::Col>, pub created_at: __sdk::__query_builder::Col, pub updated_at: __sdk::__query_builder::Col, } @@ -50,12 +56,10 @@ impl __sdk::__query_builder::HasCols for PlayerProgression { total_xp: __sdk::__query_builder::Col::new(table_name, "total_xp"), xp_to_next_level: __sdk::__query_builder::Col::new(table_name, "xp_to_next_level"), pending_level_ups: __sdk::__query_builder::Col::new(table_name, "pending_level_ups"), - last_granted_source: __sdk::__query_builder::Col::new( - table_name, - "last_granted_source", - ), + last_granted_source: __sdk::__query_builder::Col::new(table_name, "last_granted_source"), created_at: __sdk::__query_builder::Col::new(table_name, "created_at"), updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"), + } } } @@ -72,8 +76,10 @@ impl __sdk::__query_builder::HasIxCols for PlayerProgression { fn ix_cols(table_name: &'static str) -> Self::IxCols { PlayerProgressionIxCols { user_id: __sdk::__query_builder::IxCol::new(table_name, "user_id"), + } } } impl __sdk::__query_builder::CanBeLookupTable for PlayerProgression {} + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_dashboard_state_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_dashboard_state_table.rs index c79f8b0c..4e1d2abd 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/profile_dashboard_state_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_dashboard_state_table.rs @@ -2,8 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![allow(unused, clippy::all)] +use spacetimedb_sdk::__codegen::{ + self as __sdk, + __lib, + __sats, + __ws, +}; use super::profile_dashboard_state_type::ProfileDashboardState; -use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; /// Table handle for the table `profile_dashboard_state`. /// @@ -31,9 +36,7 @@ pub trait ProfileDashboardStateTableAccess { impl ProfileDashboardStateTableAccess for super::RemoteTables { fn profile_dashboard_state(&self) -> ProfileDashboardStateTableHandle<'_> { ProfileDashboardStateTableHandle { - imp: self - .imp - .get_table::("profile_dashboard_state"), + imp: self.imp.get_table::("profile_dashboard_state"), ctx: std::marker::PhantomData, } } @@ -46,12 +49,8 @@ impl<'ctx> __sdk::Table for ProfileDashboardStateTableHandle<'ctx> { type Row = ProfileDashboardState; type EventContext = super::EventContext; - fn count(&self) -> u64 { - self.imp.count() - } - fn iter(&self) -> impl Iterator + '_ { - self.imp.iter() - } + fn count(&self) -> u64 { self.imp.count() } + fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } type InsertCallbackId = ProfileDashboardStateInsertCallbackId; @@ -97,38 +96,39 @@ impl<'ctx> __sdk::TableWithPrimaryKey for ProfileDashboardStateTableHandle<'ctx> } } -/// Access to the `user_id` unique index on the table `profile_dashboard_state`, -/// which allows point queries on the field of the same name -/// via the [`ProfileDashboardStateUserIdUnique::find`] method. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.profile_dashboard_state().user_id().find(...)`. -pub struct ProfileDashboardStateUserIdUnique<'ctx> { - imp: __sdk::UniqueConstraintHandle, - phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, -} - -impl<'ctx> ProfileDashboardStateTableHandle<'ctx> { - /// Get a handle on the `user_id` unique index on the table `profile_dashboard_state`. - pub fn user_id(&self) -> ProfileDashboardStateUserIdUnique<'ctx> { - ProfileDashboardStateUserIdUnique { - imp: self.imp.get_unique_constraint::("user_id"), - phantom: std::marker::PhantomData, + /// Access to the `user_id` unique index on the table `profile_dashboard_state`, + /// which allows point queries on the field of the same name + /// via the [`ProfileDashboardStateUserIdUnique::find`] method. + /// + /// Users are encouraged not to explicitly reference this type, + /// but to directly chain method calls, + /// like `ctx.db.profile_dashboard_state().user_id().find(...)`. + pub struct ProfileDashboardStateUserIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } - } -} -impl<'ctx> ProfileDashboardStateUserIdUnique<'ctx> { - /// Find the subscribed row whose `user_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 { - self.imp.find(col_val) - } -} + impl<'ctx> ProfileDashboardStateTableHandle<'ctx> { + /// Get a handle on the `user_id` unique index on the table `profile_dashboard_state`. + pub fn user_id(&self) -> ProfileDashboardStateUserIdUnique<'ctx> { + ProfileDashboardStateUserIdUnique { + imp: self.imp.get_unique_constraint::("user_id"), + phantom: std::marker::PhantomData, + } + } + } + impl<'ctx> ProfileDashboardStateUserIdUnique<'ctx> { + /// Find the subscribed row whose `user_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 { + self.imp.find(col_val) + } + } + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("profile_dashboard_state"); _table.add_unique_constraint::("user_id", |row| &row.user_id); } @@ -138,24 +138,26 @@ pub(super) fn parse_table_update( raw_updates: __ws::v2::TableUpdate, ) -> __sdk::Result<__sdk::TableUpdate> { __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { - __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") - .with_cause(e) - .into() + __sdk::InternalError::failed_parse( + "TableUpdate", + "TableUpdate", + ).with_cause(e).into() }) } -#[allow(non_camel_case_types)] -/// Extension trait for query builder access to the table `ProfileDashboardState`. -/// -/// Implemented for [`__sdk::QueryTableAccessor`]. -pub trait profile_dashboard_stateQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `ProfileDashboardState`. - fn profile_dashboard_state(&self) -> __sdk::__query_builder::Table; -} + #[allow(non_camel_case_types)] + /// Extension trait for query builder access to the table `ProfileDashboardState`. + /// + /// Implemented for [`__sdk::QueryTableAccessor`]. + pub trait profile_dashboard_stateQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `ProfileDashboardState`. + fn profile_dashboard_state(&self) -> __sdk::__query_builder::Table; + } + + impl profile_dashboard_stateQueryTableAccess for __sdk::QueryTableAccessor { + fn profile_dashboard_state(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("profile_dashboard_state") + } + } -impl profile_dashboard_stateQueryTableAccess for __sdk::QueryTableAccessor { - fn profile_dashboard_state(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("profile_dashboard_state") - } -} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_dashboard_state_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_dashboard_state_type.rs index e5124048..3abd8b06 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/profile_dashboard_state_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_dashboard_state_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -14,10 +20,12 @@ pub struct ProfileDashboardState { pub updated_at: __sdk::Timestamp, } + impl __sdk::InModule for ProfileDashboardState { type Module = super::RemoteModule; } + /// Column accessor struct for the table `ProfileDashboardState`. /// /// Provides typed access to columns for query building. @@ -38,6 +46,7 @@ impl __sdk::__query_builder::HasCols for ProfileDashboardState { total_play_time_ms: __sdk::__query_builder::Col::new(table_name, "total_play_time_ms"), created_at: __sdk::__query_builder::Col::new(table_name, "created_at"), updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"), + } } } @@ -54,8 +63,10 @@ impl __sdk::__query_builder::HasIxCols for ProfileDashboardState { fn ix_cols(table_name: &'static str) -> Self::IxCols { ProfileDashboardStateIxCols { user_id: __sdk::__query_builder::IxCol::new(table_name, "user_id"), + } } } impl __sdk::__query_builder::CanBeLookupTable for ProfileDashboardState {} + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_played_world_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_played_world_table.rs index 0f147bd5..944de27b 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/profile_played_world_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_played_world_table.rs @@ -2,8 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![allow(unused, clippy::all)] +use spacetimedb_sdk::__codegen::{ + self as __sdk, + __lib, + __sats, + __ws, +}; use super::profile_played_world_type::ProfilePlayedWorld; -use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; /// Table handle for the table `profile_played_world`. /// @@ -31,9 +36,7 @@ pub trait ProfilePlayedWorldTableAccess { impl ProfilePlayedWorldTableAccess for super::RemoteTables { fn profile_played_world(&self) -> ProfilePlayedWorldTableHandle<'_> { ProfilePlayedWorldTableHandle { - imp: self - .imp - .get_table::("profile_played_world"), + imp: self.imp.get_table::("profile_played_world"), ctx: std::marker::PhantomData, } } @@ -46,12 +49,8 @@ impl<'ctx> __sdk::Table for ProfilePlayedWorldTableHandle<'ctx> { type Row = ProfilePlayedWorld; type EventContext = super::EventContext; - fn count(&self) -> u64 { - self.imp.count() - } - fn iter(&self) -> impl Iterator + '_ { - self.imp.iter() - } + fn count(&self) -> u64 { self.imp.count() } + fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } type InsertCallbackId = ProfilePlayedWorldInsertCallbackId; @@ -97,38 +96,39 @@ impl<'ctx> __sdk::TableWithPrimaryKey for ProfilePlayedWorldTableHandle<'ctx> { } } -/// Access to the `played_world_id` unique index on the table `profile_played_world`, -/// which allows point queries on the field of the same name -/// via the [`ProfilePlayedWorldPlayedWorldIdUnique::find`] method. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.profile_played_world().played_world_id().find(...)`. -pub struct ProfilePlayedWorldPlayedWorldIdUnique<'ctx> { - imp: __sdk::UniqueConstraintHandle, - phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, -} - -impl<'ctx> ProfilePlayedWorldTableHandle<'ctx> { - /// Get a handle on the `played_world_id` unique index on the table `profile_played_world`. - pub fn played_world_id(&self) -> ProfilePlayedWorldPlayedWorldIdUnique<'ctx> { - ProfilePlayedWorldPlayedWorldIdUnique { - imp: self.imp.get_unique_constraint::("played_world_id"), - phantom: std::marker::PhantomData, + /// Access to the `played_world_id` unique index on the table `profile_played_world`, + /// which allows point queries on the field of the same name + /// via the [`ProfilePlayedWorldPlayedWorldIdUnique::find`] method. + /// + /// Users are encouraged not to explicitly reference this type, + /// but to directly chain method calls, + /// like `ctx.db.profile_played_world().played_world_id().find(...)`. + pub struct ProfilePlayedWorldPlayedWorldIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } - } -} -impl<'ctx> ProfilePlayedWorldPlayedWorldIdUnique<'ctx> { - /// Find the subscribed row whose `played_world_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 { - self.imp.find(col_val) - } -} + impl<'ctx> ProfilePlayedWorldTableHandle<'ctx> { + /// Get a handle on the `played_world_id` unique index on the table `profile_played_world`. + pub fn played_world_id(&self) -> ProfilePlayedWorldPlayedWorldIdUnique<'ctx> { + ProfilePlayedWorldPlayedWorldIdUnique { + imp: self.imp.get_unique_constraint::("played_world_id"), + phantom: std::marker::PhantomData, + } + } + } + impl<'ctx> ProfilePlayedWorldPlayedWorldIdUnique<'ctx> { + /// Find the subscribed row whose `played_world_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 { + self.imp.find(col_val) + } + } + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("profile_played_world"); _table.add_unique_constraint::("played_world_id", |row| &row.played_world_id); } @@ -138,24 +138,26 @@ pub(super) fn parse_table_update( raw_updates: __ws::v2::TableUpdate, ) -> __sdk::Result<__sdk::TableUpdate> { __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { - __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") - .with_cause(e) - .into() + __sdk::InternalError::failed_parse( + "TableUpdate", + "TableUpdate", + ).with_cause(e).into() }) } -#[allow(non_camel_case_types)] -/// Extension trait for query builder access to the table `ProfilePlayedWorld`. -/// -/// Implemented for [`__sdk::QueryTableAccessor`]. -pub trait profile_played_worldQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `ProfilePlayedWorld`. - fn profile_played_world(&self) -> __sdk::__query_builder::Table; -} + #[allow(non_camel_case_types)] + /// Extension trait for query builder access to the table `ProfilePlayedWorld`. + /// + /// Implemented for [`__sdk::QueryTableAccessor`]. + pub trait profile_played_worldQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `ProfilePlayedWorld`. + fn profile_played_world(&self) -> __sdk::__query_builder::Table; + } + + impl profile_played_worldQueryTableAccess for __sdk::QueryTableAccessor { + fn profile_played_world(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("profile_played_world") + } + } -impl profile_played_worldQueryTableAccess for __sdk::QueryTableAccessor { - fn profile_played_world(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("profile_played_world") - } -} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_played_world_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_played_world_type.rs index 3b94036c..b58b66c1 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/profile_played_world_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_played_world_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -10,9 +16,9 @@ pub struct ProfilePlayedWorld { pub played_world_id: String, pub user_id: String, pub world_key: String, - pub owner_user_id: Option, - pub profile_id: Option, - pub world_type: Option, + pub owner_user_id: Option::, + pub profile_id: Option::, + pub world_type: Option::, pub world_title: String, pub world_subtitle: String, pub first_played_at: __sdk::Timestamp, @@ -20,10 +26,12 @@ pub struct ProfilePlayedWorld { pub last_observed_play_time_ms: u64, } + impl __sdk::InModule for ProfilePlayedWorld { type Module = super::RemoteModule; } + /// Column accessor struct for the table `ProfilePlayedWorld`. /// /// Provides typed access to columns for query building. @@ -31,9 +39,9 @@ pub struct ProfilePlayedWorldCols { pub played_world_id: __sdk::__query_builder::Col, pub user_id: __sdk::__query_builder::Col, pub world_key: __sdk::__query_builder::Col, - pub owner_user_id: __sdk::__query_builder::Col>, - pub profile_id: __sdk::__query_builder::Col>, - pub world_type: __sdk::__query_builder::Col>, + pub owner_user_id: __sdk::__query_builder::Col>, + pub profile_id: __sdk::__query_builder::Col>, + pub world_type: __sdk::__query_builder::Col>, pub world_title: __sdk::__query_builder::Col, pub world_subtitle: __sdk::__query_builder::Col, pub first_played_at: __sdk::__query_builder::Col, @@ -55,10 +63,8 @@ impl __sdk::__query_builder::HasCols for ProfilePlayedWorld { world_subtitle: __sdk::__query_builder::Col::new(table_name, "world_subtitle"), first_played_at: __sdk::__query_builder::Col::new(table_name, "first_played_at"), last_played_at: __sdk::__query_builder::Col::new(table_name, "last_played_at"), - last_observed_play_time_ms: __sdk::__query_builder::Col::new( - table_name, - "last_observed_play_time_ms", - ), + last_observed_play_time_ms: __sdk::__query_builder::Col::new(table_name, "last_observed_play_time_ms"), + } } } @@ -77,8 +83,10 @@ impl __sdk::__query_builder::HasIxCols for ProfilePlayedWorld { ProfilePlayedWorldIxCols { played_world_id: __sdk::__query_builder::IxCol::new(table_name, "played_world_id"), user_id: __sdk::__query_builder::IxCol::new(table_name, "user_id"), + } } } impl __sdk::__query_builder::CanBeLookupTable for ProfilePlayedWorld {} + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_save_archive_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_save_archive_table.rs new file mode 100644 index 00000000..4d503269 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_save_archive_table.rs @@ -0,0 +1,163 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use spacetimedb_sdk::__codegen::{ + self as __sdk, + __lib, + __sats, + __ws, +}; +use super::profile_save_archive_type::ProfileSaveArchive; + +/// Table handle for the table `profile_save_archive`. +/// +/// Obtain a handle from the [`ProfileSaveArchiveTableAccess::profile_save_archive`] method on [`super::RemoteTables`], +/// like `ctx.db.profile_save_archive()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.profile_save_archive().on_insert(...)`. +pub struct ProfileSaveArchiveTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `profile_save_archive`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait ProfileSaveArchiveTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`ProfileSaveArchiveTableHandle`], which mediates access to the table `profile_save_archive`. + fn profile_save_archive(&self) -> ProfileSaveArchiveTableHandle<'_>; +} + +impl ProfileSaveArchiveTableAccess for super::RemoteTables { + fn profile_save_archive(&self) -> ProfileSaveArchiveTableHandle<'_> { + ProfileSaveArchiveTableHandle { + imp: self.imp.get_table::("profile_save_archive"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct ProfileSaveArchiveInsertCallbackId(__sdk::CallbackId); +pub struct ProfileSaveArchiveDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for ProfileSaveArchiveTableHandle<'ctx> { + type Row = ProfileSaveArchive; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { self.imp.count() } + fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } + + type InsertCallbackId = ProfileSaveArchiveInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileSaveArchiveInsertCallbackId { + ProfileSaveArchiveInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: ProfileSaveArchiveInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = ProfileSaveArchiveDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileSaveArchiveDeleteCallbackId { + ProfileSaveArchiveDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: ProfileSaveArchiveDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct ProfileSaveArchiveUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for ProfileSaveArchiveTableHandle<'ctx> { + type UpdateCallbackId = ProfileSaveArchiveUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> ProfileSaveArchiveUpdateCallbackId { + ProfileSaveArchiveUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: ProfileSaveArchiveUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + + /// Access to the `archive_id` unique index on the table `profile_save_archive`, + /// which allows point queries on the field of the same name + /// via the [`ProfileSaveArchiveArchiveIdUnique::find`] method. + /// + /// Users are encouraged not to explicitly reference this type, + /// but to directly chain method calls, + /// like `ctx.db.profile_save_archive().archive_id().find(...)`. + pub struct ProfileSaveArchiveArchiveIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, + } + + impl<'ctx> ProfileSaveArchiveTableHandle<'ctx> { + /// Get a handle on the `archive_id` unique index on the table `profile_save_archive`. + pub fn archive_id(&self) -> ProfileSaveArchiveArchiveIdUnique<'ctx> { + ProfileSaveArchiveArchiveIdUnique { + imp: self.imp.get_unique_constraint::("archive_id"), + phantom: std::marker::PhantomData, + } + } + } + + impl<'ctx> ProfileSaveArchiveArchiveIdUnique<'ctx> { + /// Find the subscribed row whose `archive_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 { + self.imp.find(col_val) + } + } + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + + let _table = client_cache.get_or_make_table::("profile_save_archive"); + _table.add_unique_constraint::("archive_id", |row| &row.archive_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse( + "TableUpdate", + "TableUpdate", + ).with_cause(e).into() + }) +} + + #[allow(non_camel_case_types)] + /// Extension trait for query builder access to the table `ProfileSaveArchive`. + /// + /// Implemented for [`__sdk::QueryTableAccessor`]. + pub trait profile_save_archiveQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `ProfileSaveArchive`. + fn profile_save_archive(&self) -> __sdk::__query_builder::Table; + } + + impl profile_save_archiveQueryTableAccess for __sdk::QueryTableAccessor { + fn profile_save_archive(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("profile_save_archive") + } + } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_save_archive_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_save_archive_type.rs new file mode 100644 index 00000000..f11c6024 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_save_archive_type.rs @@ -0,0 +1,107 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use spacetimedb_sdk::__codegen::{ + self as __sdk, + __lib, + __sats, + __ws, +}; + + +#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] +#[sats(crate = __lib)] +pub struct ProfileSaveArchive { + pub archive_id: String, + pub user_id: String, + pub world_key: String, + pub owner_user_id: Option::, + pub profile_id: Option::, + pub world_type: Option::, + pub world_name: String, + pub subtitle: String, + pub summary_text: String, + pub cover_image_src: Option::, + pub saved_at: __sdk::Timestamp, + pub bottom_tab: String, + pub game_state_json: String, + pub current_story_json: Option::, + pub created_at: __sdk::Timestamp, + pub updated_at: __sdk::Timestamp, +} + + +impl __sdk::InModule for ProfileSaveArchive { + type Module = super::RemoteModule; +} + + +/// Column accessor struct for the table `ProfileSaveArchive`. +/// +/// Provides typed access to columns for query building. +pub struct ProfileSaveArchiveCols { + pub archive_id: __sdk::__query_builder::Col, + pub user_id: __sdk::__query_builder::Col, + pub world_key: __sdk::__query_builder::Col, + pub owner_user_id: __sdk::__query_builder::Col>, + pub profile_id: __sdk::__query_builder::Col>, + pub world_type: __sdk::__query_builder::Col>, + pub world_name: __sdk::__query_builder::Col, + pub subtitle: __sdk::__query_builder::Col, + pub summary_text: __sdk::__query_builder::Col, + pub cover_image_src: __sdk::__query_builder::Col>, + pub saved_at: __sdk::__query_builder::Col, + pub bottom_tab: __sdk::__query_builder::Col, + pub game_state_json: __sdk::__query_builder::Col, + pub current_story_json: __sdk::__query_builder::Col>, + pub created_at: __sdk::__query_builder::Col, + pub updated_at: __sdk::__query_builder::Col, +} + +impl __sdk::__query_builder::HasCols for ProfileSaveArchive { + type Cols = ProfileSaveArchiveCols; + fn cols(table_name: &'static str) -> Self::Cols { + ProfileSaveArchiveCols { + archive_id: __sdk::__query_builder::Col::new(table_name, "archive_id"), + user_id: __sdk::__query_builder::Col::new(table_name, "user_id"), + world_key: __sdk::__query_builder::Col::new(table_name, "world_key"), + owner_user_id: __sdk::__query_builder::Col::new(table_name, "owner_user_id"), + profile_id: __sdk::__query_builder::Col::new(table_name, "profile_id"), + world_type: __sdk::__query_builder::Col::new(table_name, "world_type"), + world_name: __sdk::__query_builder::Col::new(table_name, "world_name"), + subtitle: __sdk::__query_builder::Col::new(table_name, "subtitle"), + summary_text: __sdk::__query_builder::Col::new(table_name, "summary_text"), + cover_image_src: __sdk::__query_builder::Col::new(table_name, "cover_image_src"), + saved_at: __sdk::__query_builder::Col::new(table_name, "saved_at"), + bottom_tab: __sdk::__query_builder::Col::new(table_name, "bottom_tab"), + game_state_json: __sdk::__query_builder::Col::new(table_name, "game_state_json"), + current_story_json: __sdk::__query_builder::Col::new(table_name, "current_story_json"), + created_at: __sdk::__query_builder::Col::new(table_name, "created_at"), + updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"), + + } + } +} + +/// Indexed column accessor struct for the table `ProfileSaveArchive`. +/// +/// Provides typed access to indexed columns for query building. +pub struct ProfileSaveArchiveIxCols { + pub archive_id: __sdk::__query_builder::IxCol, + pub user_id: __sdk::__query_builder::IxCol, +} + +impl __sdk::__query_builder::HasIxCols for ProfileSaveArchive { + type IxCols = ProfileSaveArchiveIxCols; + fn ix_cols(table_name: &'static str) -> Self::IxCols { + ProfileSaveArchiveIxCols { + archive_id: __sdk::__query_builder::IxCol::new(table_name, "archive_id"), + user_id: __sdk::__query_builder::IxCol::new(table_name, "user_id"), + + } + } +} + +impl __sdk::__query_builder::CanBeLookupTable for ProfileSaveArchive {} + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_wallet_ledger_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_wallet_ledger_table.rs index 48705ae9..1dab9684 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/profile_wallet_ledger_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_wallet_ledger_table.rs @@ -2,9 +2,14 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![allow(unused, clippy::all)] +use spacetimedb_sdk::__codegen::{ + self as __sdk, + __lib, + __sats, + __ws, +}; use super::profile_wallet_ledger_type::ProfileWalletLedger; use super::runtime_profile_wallet_ledger_source_type_type::RuntimeProfileWalletLedgerSourceType; -use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; /// Table handle for the table `profile_wallet_ledger`. /// @@ -32,9 +37,7 @@ pub trait ProfileWalletLedgerTableAccess { impl ProfileWalletLedgerTableAccess for super::RemoteTables { fn profile_wallet_ledger(&self) -> ProfileWalletLedgerTableHandle<'_> { ProfileWalletLedgerTableHandle { - imp: self - .imp - .get_table::("profile_wallet_ledger"), + imp: self.imp.get_table::("profile_wallet_ledger"), ctx: std::marker::PhantomData, } } @@ -47,12 +50,8 @@ impl<'ctx> __sdk::Table for ProfileWalletLedgerTableHandle<'ctx> { type Row = ProfileWalletLedger; type EventContext = super::EventContext; - fn count(&self) -> u64 { - self.imp.count() - } - fn iter(&self) -> impl Iterator + '_ { - self.imp.iter() - } + fn count(&self) -> u64 { self.imp.count() } + fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } type InsertCallbackId = ProfileWalletLedgerInsertCallbackId; @@ -98,38 +97,39 @@ impl<'ctx> __sdk::TableWithPrimaryKey for ProfileWalletLedgerTableHandle<'ctx> { } } -/// Access to the `wallet_ledger_id` unique index on the table `profile_wallet_ledger`, -/// which allows point queries on the field of the same name -/// via the [`ProfileWalletLedgerWalletLedgerIdUnique::find`] method. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.profile_wallet_ledger().wallet_ledger_id().find(...)`. -pub struct ProfileWalletLedgerWalletLedgerIdUnique<'ctx> { - imp: __sdk::UniqueConstraintHandle, - phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, -} - -impl<'ctx> ProfileWalletLedgerTableHandle<'ctx> { - /// Get a handle on the `wallet_ledger_id` unique index on the table `profile_wallet_ledger`. - pub fn wallet_ledger_id(&self) -> ProfileWalletLedgerWalletLedgerIdUnique<'ctx> { - ProfileWalletLedgerWalletLedgerIdUnique { - imp: self.imp.get_unique_constraint::("wallet_ledger_id"), - phantom: std::marker::PhantomData, + /// Access to the `wallet_ledger_id` unique index on the table `profile_wallet_ledger`, + /// which allows point queries on the field of the same name + /// via the [`ProfileWalletLedgerWalletLedgerIdUnique::find`] method. + /// + /// Users are encouraged not to explicitly reference this type, + /// but to directly chain method calls, + /// like `ctx.db.profile_wallet_ledger().wallet_ledger_id().find(...)`. + pub struct ProfileWalletLedgerWalletLedgerIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } - } -} -impl<'ctx> ProfileWalletLedgerWalletLedgerIdUnique<'ctx> { - /// Find the subscribed row whose `wallet_ledger_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 { - self.imp.find(col_val) - } -} + impl<'ctx> ProfileWalletLedgerTableHandle<'ctx> { + /// Get a handle on the `wallet_ledger_id` unique index on the table `profile_wallet_ledger`. + pub fn wallet_ledger_id(&self) -> ProfileWalletLedgerWalletLedgerIdUnique<'ctx> { + ProfileWalletLedgerWalletLedgerIdUnique { + imp: self.imp.get_unique_constraint::("wallet_ledger_id"), + phantom: std::marker::PhantomData, + } + } + } + impl<'ctx> ProfileWalletLedgerWalletLedgerIdUnique<'ctx> { + /// Find the subscribed row whose `wallet_ledger_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 { + self.imp.find(col_val) + } + } + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("profile_wallet_ledger"); _table.add_unique_constraint::("wallet_ledger_id", |row| &row.wallet_ledger_id); } @@ -139,24 +139,26 @@ pub(super) fn parse_table_update( raw_updates: __ws::v2::TableUpdate, ) -> __sdk::Result<__sdk::TableUpdate> { __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { - __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") - .with_cause(e) - .into() + __sdk::InternalError::failed_parse( + "TableUpdate", + "TableUpdate", + ).with_cause(e).into() }) } -#[allow(non_camel_case_types)] -/// Extension trait for query builder access to the table `ProfileWalletLedger`. -/// -/// Implemented for [`__sdk::QueryTableAccessor`]. -pub trait profile_wallet_ledgerQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `ProfileWalletLedger`. - fn profile_wallet_ledger(&self) -> __sdk::__query_builder::Table; -} + #[allow(non_camel_case_types)] + /// Extension trait for query builder access to the table `ProfileWalletLedger`. + /// + /// Implemented for [`__sdk::QueryTableAccessor`]. + pub trait profile_wallet_ledgerQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `ProfileWalletLedger`. + fn profile_wallet_ledger(&self) -> __sdk::__query_builder::Table; + } + + impl profile_wallet_ledgerQueryTableAccess for __sdk::QueryTableAccessor { + fn profile_wallet_ledger(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("profile_wallet_ledger") + } + } -impl profile_wallet_ledgerQueryTableAccess for __sdk::QueryTableAccessor { - fn profile_wallet_ledger(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("profile_wallet_ledger") - } -} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_wallet_ledger_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_wallet_ledger_type.rs index 78364d5a..b5535645 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/profile_wallet_ledger_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_wallet_ledger_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_profile_wallet_ledger_source_type_type::RuntimeProfileWalletLedgerSourceType; @@ -17,10 +22,12 @@ pub struct ProfileWalletLedger { pub created_at: __sdk::Timestamp, } + impl __sdk::InModule for ProfileWalletLedger { type Module = super::RemoteModule; } + /// Column accessor struct for the table `ProfileWalletLedger`. /// /// Provides typed access to columns for query building. @@ -29,8 +36,7 @@ pub struct ProfileWalletLedgerCols { pub user_id: __sdk::__query_builder::Col, pub amount_delta: __sdk::__query_builder::Col, pub balance_after: __sdk::__query_builder::Col, - pub source_type: - __sdk::__query_builder::Col, + pub source_type: __sdk::__query_builder::Col, pub created_at: __sdk::__query_builder::Col, } @@ -44,6 +50,7 @@ impl __sdk::__query_builder::HasCols for ProfileWalletLedger { balance_after: __sdk::__query_builder::Col::new(table_name, "balance_after"), source_type: __sdk::__query_builder::Col::new(table_name, "source_type"), created_at: __sdk::__query_builder::Col::new(table_name, "created_at"), + } } } @@ -62,8 +69,10 @@ impl __sdk::__query_builder::HasIxCols for ProfileWalletLedger { ProfileWalletLedgerIxCols { user_id: __sdk::__query_builder::IxCol::new(table_name, "user_id"), wallet_ledger_id: __sdk::__query_builder::IxCol::new(table_name, "wallet_ledger_id"), + } } } impl __sdk::__query_builder::CanBeLookupTable for ProfileWalletLedger {} + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/publish_custom_world_profile_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/publish_custom_world_profile_and_return_procedure.rs index e5434aca..2dcaf010 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/publish_custom_world_profile_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/publish_custom_world_profile_and_return_procedure.rs @@ -2,17 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_library_mutation_result_type::CustomWorldLibraryMutationResult; use super::custom_world_profile_publish_input_type::CustomWorldProfilePublishInput; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct PublishCustomWorldProfileAndReturnArgs { + struct PublishCustomWorldProfileAndReturnArgs { pub input: CustomWorldProfilePublishInput, } + impl __sdk::InModule for PublishCustomWorldProfileAndReturnArgs { type Module = super::RemoteModule; } @@ -22,19 +28,16 @@ impl __sdk::InModule for PublishCustomWorldProfileAndReturnArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait publish_custom_world_profile_and_return { - fn publish_custom_world_profile_and_return(&self, input: CustomWorldProfilePublishInput) { - self.publish_custom_world_profile_and_return_then(input, |_, _| {}); + fn publish_custom_world_profile_and_return(&self, input: CustomWorldProfilePublishInput, +) { + self.publish_custom_world_profile_and_return_then(input, |_, _| {}); } fn publish_custom_world_profile_and_return_then( &self, input: CustomWorldProfilePublishInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } @@ -43,17 +46,13 @@ impl publish_custom_world_profile_and_return for super::RemoteProcedures { &self, input: CustomWorldProfilePublishInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, CustomWorldLibraryMutationResult>( - "publish_custom_world_profile_and_return", - PublishCustomWorldProfileAndReturnArgs { input }, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, CustomWorldLibraryMutationResult>( + "publish_custom_world_profile_and_return", + PublishCustomWorldProfileAndReturnArgs { input, }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/publish_custom_world_profile_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/publish_custom_world_profile_reducer.rs index 84e6b339..f6d34d5c 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/publish_custom_world_profile_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/publish_custom_world_profile_reducer.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_profile_publish_input_type::CustomWorldProfilePublishInput; @@ -14,8 +19,10 @@ pub(super) struct PublishCustomWorldProfileArgs { impl From for super::Reducer { fn from(args: PublishCustomWorldProfileArgs) -> Self { - Self::PublishCustomWorldProfile { input: args.input } - } + Self::PublishCustomWorldProfile { + input: args.input, +} +} } impl __sdk::InModule for PublishCustomWorldProfileArgs { @@ -33,11 +40,9 @@ pub trait publish_custom_world_profile { /// The reducer will run asynchronously in the future, /// and this method provides no way to listen for its completion status. /// /// Use [`publish_custom_world_profile:publish_custom_world_profile_then`] to run a callback after the reducer completes. - fn publish_custom_world_profile( - &self, - input: CustomWorldProfilePublishInput, - ) -> __sdk::Result<()> { - self.publish_custom_world_profile_then(input, |_, _| {}) + fn publish_custom_world_profile(&self, input: CustomWorldProfilePublishInput, +) -> __sdk::Result<()> { + self.publish_custom_world_profile_then(input, |_, _| {}) } /// Request that the remote module invoke the reducer `publish_custom_world_profile` to run as soon as possible, @@ -65,7 +70,7 @@ impl publish_custom_world_profile for super::RemoteReducers { + Send + 'static, ) -> __sdk::Result<()> { - self.imp - .invoke_reducer_with_callback(PublishCustomWorldProfileArgs { input }, callback) + self.imp.invoke_reducer_with_callback(PublishCustomWorldProfileArgs { input, }, callback) } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/publish_custom_world_world_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/publish_custom_world_world_procedure.rs index 1eb935a2..083034b9 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/publish_custom_world_world_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/publish_custom_world_world_procedure.rs @@ -2,17 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_publish_world_input_type::CustomWorldPublishWorldInput; use super::custom_world_publish_world_result_type::CustomWorldPublishWorldResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct PublishCustomWorldWorldArgs { + struct PublishCustomWorldWorldArgs { pub input: CustomWorldPublishWorldInput, } + impl __sdk::InModule for PublishCustomWorldWorldArgs { type Module = super::RemoteModule; } @@ -22,19 +28,16 @@ impl __sdk::InModule for PublishCustomWorldWorldArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait publish_custom_world_world { - fn publish_custom_world_world(&self, input: CustomWorldPublishWorldInput) { - self.publish_custom_world_world_then(input, |_, _| {}); + fn publish_custom_world_world(&self, input: CustomWorldPublishWorldInput, +) { + self.publish_custom_world_world_then(input, |_, _| {}); } fn publish_custom_world_world_then( &self, input: CustomWorldPublishWorldInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } @@ -43,17 +46,13 @@ impl publish_custom_world_world for super::RemoteProcedures { &self, input: CustomWorldPublishWorldInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, CustomWorldPublishWorldResult>( - "publish_custom_world_world", - PublishCustomWorldWorldArgs { input }, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, CustomWorldPublishWorldResult>( + "publish_custom_world_world", + PublishCustomWorldWorldArgs { input, }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/quest_completion_ack_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/quest_completion_ack_input_type.rs index 678ec032..dbe06a17 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/quest_completion_ack_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/quest_completion_ack_input_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -11,6 +17,8 @@ pub struct QuestCompletionAckInput { pub updated_at_micros: i64, } + impl __sdk::InModule for QuestCompletionAckInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/quest_hostile_npc_defeated_signal_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/quest_hostile_npc_defeated_signal_type.rs index d12363ff..08debc1e 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/quest_hostile_npc_defeated_signal_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/quest_hostile_npc_defeated_signal_type.rs @@ -2,15 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] pub struct QuestHostileNpcDefeatedSignal { - pub scene_id: Option, + pub scene_id: Option::, pub hostile_npc_id: String, } + impl __sdk::InModule for QuestHostileNpcDefeatedSignal { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/quest_item_delivered_signal_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/quest_item_delivered_signal_type.rs index 4e1d0a5d..9b69c1f7 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/quest_item_delivered_signal_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/quest_item_delivered_signal_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -12,6 +18,8 @@ pub struct QuestItemDeliveredSignal { pub quantity: u32, } + impl __sdk::InModule for QuestItemDeliveredSignal { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/quest_log_event_kind_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/quest_log_event_kind_type.rs index c3176590..2e742860 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/quest_log_event_kind_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/quest_log_event_kind_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -17,8 +22,12 @@ pub enum QuestLogEventKind { CompletionAcknowledged, TurnedIn, + } + + impl __sdk::InModule for QuestLogEventKind { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/quest_log_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/quest_log_table.rs index b1ac8c78..069f1084 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/quest_log_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/quest_log_table.rs @@ -2,12 +2,17 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![allow(unused, clippy::all)] -use super::quest_log_event_kind_type::QuestLogEventKind; +use spacetimedb_sdk::__codegen::{ + self as __sdk, + __lib, + __sats, + __ws, +}; use super::quest_log_type::QuestLog; -use super::quest_progress_signal_type::QuestProgressSignal; -use super::quest_signal_kind_type::QuestSignalKind; use super::quest_status_type::QuestStatus; -use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; +use super::quest_progress_signal_type::QuestProgressSignal; +use super::quest_log_event_kind_type::QuestLogEventKind; +use super::quest_signal_kind_type::QuestSignalKind; /// Table handle for the table `quest_log`. /// @@ -48,12 +53,8 @@ impl<'ctx> __sdk::Table for QuestLogTableHandle<'ctx> { type Row = QuestLog; type EventContext = super::EventContext; - fn count(&self) -> u64 { - self.imp.count() - } - fn iter(&self) -> impl Iterator + '_ { - self.imp.iter() - } + fn count(&self) -> u64 { self.imp.count() } + fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } type InsertCallbackId = QuestLogInsertCallbackId; @@ -99,38 +100,39 @@ impl<'ctx> __sdk::TableWithPrimaryKey for QuestLogTableHandle<'ctx> { } } -/// Access to the `log_id` unique index on the table `quest_log`, -/// which allows point queries on the field of the same name -/// via the [`QuestLogLogIdUnique::find`] method. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.quest_log().log_id().find(...)`. -pub struct QuestLogLogIdUnique<'ctx> { - imp: __sdk::UniqueConstraintHandle, - phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, -} - -impl<'ctx> QuestLogTableHandle<'ctx> { - /// Get a handle on the `log_id` unique index on the table `quest_log`. - pub fn log_id(&self) -> QuestLogLogIdUnique<'ctx> { - QuestLogLogIdUnique { - imp: self.imp.get_unique_constraint::("log_id"), - phantom: std::marker::PhantomData, + /// Access to the `log_id` unique index on the table `quest_log`, + /// which allows point queries on the field of the same name + /// via the [`QuestLogLogIdUnique::find`] method. + /// + /// Users are encouraged not to explicitly reference this type, + /// but to directly chain method calls, + /// like `ctx.db.quest_log().log_id().find(...)`. + pub struct QuestLogLogIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } - } -} -impl<'ctx> QuestLogLogIdUnique<'ctx> { - /// Find the subscribed row whose `log_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 { - self.imp.find(col_val) - } -} + impl<'ctx> QuestLogTableHandle<'ctx> { + /// Get a handle on the `log_id` unique index on the table `quest_log`. + pub fn log_id(&self) -> QuestLogLogIdUnique<'ctx> { + QuestLogLogIdUnique { + imp: self.imp.get_unique_constraint::("log_id"), + phantom: std::marker::PhantomData, + } + } + } + impl<'ctx> QuestLogLogIdUnique<'ctx> { + /// Find the subscribed row whose `log_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 { + self.imp.find(col_val) + } + } + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("quest_log"); _table.add_unique_constraint::("log_id", |row| &row.log_id); } @@ -140,24 +142,26 @@ pub(super) fn parse_table_update( raw_updates: __ws::v2::TableUpdate, ) -> __sdk::Result<__sdk::TableUpdate> { __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { - __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") - .with_cause(e) - .into() + __sdk::InternalError::failed_parse( + "TableUpdate", + "TableUpdate", + ).with_cause(e).into() }) } -#[allow(non_camel_case_types)] -/// Extension trait for query builder access to the table `QuestLog`. -/// -/// Implemented for [`__sdk::QueryTableAccessor`]. -pub trait quest_logQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `QuestLog`. - fn quest_log(&self) -> __sdk::__query_builder::Table; -} + #[allow(non_camel_case_types)] + /// Extension trait for query builder access to the table `QuestLog`. + /// + /// Implemented for [`__sdk::QueryTableAccessor`]. + pub trait quest_logQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `QuestLog`. + fn quest_log(&self) -> __sdk::__query_builder::Table; + } + + impl quest_logQueryTableAccess for __sdk::QueryTableAccessor { + fn quest_log(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("quest_log") + } + } -impl quest_logQueryTableAccess for __sdk::QueryTableAccessor { - fn quest_log(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("quest_log") - } -} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/quest_log_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/quest_log_type.rs index d893857a..d4e28a66 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/quest_log_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/quest_log_type.rs @@ -2,12 +2,17 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_log_event_kind_type::QuestLogEventKind; -use super::quest_progress_signal_type::QuestProgressSignal; -use super::quest_signal_kind_type::QuestSignalKind; use super::quest_status_type::QuestStatus; +use super::quest_progress_signal_type::QuestProgressSignal; +use super::quest_log_event_kind_type::QuestLogEventKind; +use super::quest_signal_kind_type::QuestSignalKind; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] @@ -18,17 +23,19 @@ pub struct QuestLog { pub actor_user_id: String, pub event_kind: QuestLogEventKind, pub status_after: QuestStatus, - pub signal_kind: Option, - pub signal: Option, - pub step_id: Option, - pub step_progress: Option, + pub signal_kind: Option::, + pub signal: Option::, + pub step_id: Option::, + pub step_progress: Option::, pub created_at: __sdk::Timestamp, } + impl __sdk::InModule for QuestLog { type Module = super::RemoteModule; } + /// Column accessor struct for the table `QuestLog`. /// /// Provides typed access to columns for query building. @@ -39,10 +46,10 @@ pub struct QuestLogCols { pub actor_user_id: __sdk::__query_builder::Col, pub event_kind: __sdk::__query_builder::Col, pub status_after: __sdk::__query_builder::Col, - pub signal_kind: __sdk::__query_builder::Col>, - pub signal: __sdk::__query_builder::Col>, - pub step_id: __sdk::__query_builder::Col>, - pub step_progress: __sdk::__query_builder::Col>, + pub signal_kind: __sdk::__query_builder::Col>, + pub signal: __sdk::__query_builder::Col>, + pub step_id: __sdk::__query_builder::Col>, + pub step_progress: __sdk::__query_builder::Col>, pub created_at: __sdk::__query_builder::Col, } @@ -61,6 +68,7 @@ impl __sdk::__query_builder::HasCols for QuestLog { step_id: __sdk::__query_builder::Col::new(table_name, "step_id"), step_progress: __sdk::__query_builder::Col::new(table_name, "step_progress"), created_at: __sdk::__query_builder::Col::new(table_name, "created_at"), + } } } @@ -82,12 +90,11 @@ impl __sdk::__query_builder::HasIxCols for QuestLog { actor_user_id: __sdk::__query_builder::IxCol::new(table_name, "actor_user_id"), log_id: __sdk::__query_builder::IxCol::new(table_name, "log_id"), quest_id: __sdk::__query_builder::IxCol::new(table_name, "quest_id"), - runtime_session_id: __sdk::__query_builder::IxCol::new( - table_name, - "runtime_session_id", - ), + runtime_session_id: __sdk::__query_builder::IxCol::new(table_name, "runtime_session_id"), + } } } impl __sdk::__query_builder::CanBeLookupTable for QuestLog {} + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/quest_narrative_binding_snapshot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/quest_narrative_binding_snapshot_type.rs index 730e7565..45c26c18 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/quest_narrative_binding_snapshot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/quest_narrative_binding_snapshot_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_narrative_origin_type::QuestNarrativeOrigin; use super::quest_narrative_type_type::QuestNarrativeType; @@ -16,9 +21,11 @@ pub struct QuestNarrativeBindingSnapshot { pub issuer_goal: String, pub player_hook: String, pub world_reason: String, - pub followup_hooks: Vec, + pub followup_hooks: Vec::, } + impl __sdk::InModule for QuestNarrativeBindingSnapshot { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/quest_narrative_origin_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/quest_narrative_origin_type.rs index 34ce63f3..53f324af 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/quest_narrative_origin_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/quest_narrative_origin_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -11,8 +16,12 @@ pub enum QuestNarrativeOrigin { AiCompiled, FallbackBuilder, + } + + impl __sdk::InModule for QuestNarrativeOrigin { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/quest_narrative_type_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/quest_narrative_type_type.rs index ac5319cd..e390707e 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/quest_narrative_type_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/quest_narrative_type_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -19,8 +24,12 @@ pub enum QuestNarrativeType { Relationship, Trial, + } + + impl __sdk::InModule for QuestNarrativeType { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/quest_npc_spar_completed_signal_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/quest_npc_spar_completed_signal_type.rs index a0f1f8bb..356ae48e 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/quest_npc_spar_completed_signal_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/quest_npc_spar_completed_signal_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -10,6 +16,8 @@ pub struct QuestNpcSparCompletedSignal { pub npc_id: String, } + impl __sdk::InModule for QuestNpcSparCompletedSignal { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/quest_npc_talk_completed_signal_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/quest_npc_talk_completed_signal_type.rs index 39042f37..a62032a7 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/quest_npc_talk_completed_signal_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/quest_npc_talk_completed_signal_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -10,6 +16,8 @@ pub struct QuestNpcTalkCompletedSignal { pub npc_id: String, } + impl __sdk::InModule for QuestNpcTalkCompletedSignal { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/quest_objective_kind_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/quest_objective_kind_type.rs index 665faa30..4139db37 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/quest_objective_kind_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/quest_objective_kind_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -19,8 +24,12 @@ pub enum QuestObjectiveKind { ReachScene, DeliverItem, + } + + impl __sdk::InModule for QuestObjectiveKind { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/quest_objective_snapshot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/quest_objective_snapshot_type.rs index 38682e68..e617912b 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/quest_objective_snapshot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/quest_objective_snapshot_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_objective_kind_type::QuestObjectiveKind; @@ -10,13 +15,15 @@ use super::quest_objective_kind_type::QuestObjectiveKind; #[sats(crate = __lib)] pub struct QuestObjectiveSnapshot { pub kind: QuestObjectiveKind, - pub target_hostile_npc_id: Option, - pub target_npc_id: Option, - pub target_scene_id: Option, - pub target_item_id: Option, + pub target_hostile_npc_id: Option::, + pub target_npc_id: Option::, + pub target_scene_id: Option::, + pub target_item_id: Option::, pub required_count: u32, } + impl __sdk::InModule for QuestObjectiveSnapshot { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/quest_progress_signal_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/quest_progress_signal_type.rs index 5764d273..b957a0a7 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/quest_progress_signal_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/quest_progress_signal_type.rs @@ -2,14 +2,19 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_hostile_npc_defeated_signal_type::QuestHostileNpcDefeatedSignal; -use super::quest_item_delivered_signal_type::QuestItemDeliveredSignal; +use super::quest_treasure_inspected_signal_type::QuestTreasureInspectedSignal; use super::quest_npc_spar_completed_signal_type::QuestNpcSparCompletedSignal; use super::quest_npc_talk_completed_signal_type::QuestNpcTalkCompletedSignal; use super::quest_scene_reached_signal_type::QuestSceneReachedSignal; -use super::quest_treasure_inspected_signal_type::QuestTreasureInspectedSignal; +use super::quest_item_delivered_signal_type::QuestItemDeliveredSignal; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] @@ -25,8 +30,12 @@ pub enum QuestProgressSignal { SceneReached(QuestSceneReachedSignal), ItemDelivered(QuestItemDeliveredSignal), + } + + impl __sdk::InModule for QuestProgressSignal { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/quest_record_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/quest_record_input_type.rs index d07da423..6a82982d 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/quest_record_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/quest_record_input_type.rs @@ -2,11 +2,16 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_narrative_binding_snapshot_type::QuestNarrativeBindingSnapshot; -use super::quest_reward_snapshot_type::QuestRewardSnapshot; use super::quest_status_type::QuestStatus; +use super::quest_reward_snapshot_type::QuestRewardSnapshot; +use super::quest_narrative_binding_snapshot_type::QuestNarrativeBindingSnapshot; use super::quest_step_snapshot_type::QuestStepSnapshot; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] @@ -14,15 +19,15 @@ use super::quest_step_snapshot_type::QuestStepSnapshot; pub struct QuestRecordInput { pub quest_id: String, pub runtime_session_id: String, - pub story_session_id: Option, + pub story_session_id: Option::, pub actor_user_id: String, pub issuer_npc_id: String, pub issuer_npc_name: String, - pub scene_id: Option, - pub chapter_id: Option, - pub act_id: Option, - pub thread_id: Option, - pub contract_id: Option, + pub scene_id: Option::, + pub chapter_id: Option::, + pub act_id: Option::, + pub thread_id: Option::, + pub contract_id: Option::, pub title: String, pub description: String, pub summary: String, @@ -31,16 +36,18 @@ pub struct QuestRecordInput { pub reward: QuestRewardSnapshot, pub reward_text: String, pub narrative_binding: QuestNarrativeBindingSnapshot, - pub steps: Vec, - pub active_step_id: Option, + pub steps: Vec::, + pub active_step_id: Option::, pub visible_stage: u32, - pub hidden_flags: Vec, - pub discovered_fact_ids: Vec, - pub related_carrier_ids: Vec, - pub consequence_ids: Vec, + pub hidden_flags: Vec::, + pub discovered_fact_ids: Vec::, + pub related_carrier_ids: Vec::, + pub consequence_ids: Vec::, pub created_at_micros: i64, } + impl __sdk::InModule for QuestRecordInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/quest_record_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/quest_record_table.rs index 07e6e918..3ccd7a81 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/quest_record_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/quest_record_table.rs @@ -2,13 +2,18 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![allow(unused, clippy::all)] -use super::quest_narrative_binding_snapshot_type::QuestNarrativeBindingSnapshot; -use super::quest_objective_snapshot_type::QuestObjectiveSnapshot; +use spacetimedb_sdk::__codegen::{ + self as __sdk, + __lib, + __sats, + __ws, +}; use super::quest_record_type::QuestRecord; -use super::quest_reward_snapshot_type::QuestRewardSnapshot; use super::quest_status_type::QuestStatus; +use super::quest_reward_snapshot_type::QuestRewardSnapshot; +use super::quest_narrative_binding_snapshot_type::QuestNarrativeBindingSnapshot; use super::quest_step_snapshot_type::QuestStepSnapshot; -use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; +use super::quest_objective_snapshot_type::QuestObjectiveSnapshot; /// Table handle for the table `quest_record`. /// @@ -49,12 +54,8 @@ impl<'ctx> __sdk::Table for QuestRecordTableHandle<'ctx> { type Row = QuestRecord; type EventContext = super::EventContext; - fn count(&self) -> u64 { - self.imp.count() - } - fn iter(&self) -> impl Iterator + '_ { - self.imp.iter() - } + fn count(&self) -> u64 { self.imp.count() } + fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } type InsertCallbackId = QuestRecordInsertCallbackId; @@ -100,38 +101,39 @@ impl<'ctx> __sdk::TableWithPrimaryKey for QuestRecordTableHandle<'ctx> { } } -/// Access to the `quest_id` unique index on the table `quest_record`, -/// which allows point queries on the field of the same name -/// via the [`QuestRecordQuestIdUnique::find`] method. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.quest_record().quest_id().find(...)`. -pub struct QuestRecordQuestIdUnique<'ctx> { - imp: __sdk::UniqueConstraintHandle, - phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, -} - -impl<'ctx> QuestRecordTableHandle<'ctx> { - /// Get a handle on the `quest_id` unique index on the table `quest_record`. - pub fn quest_id(&self) -> QuestRecordQuestIdUnique<'ctx> { - QuestRecordQuestIdUnique { - imp: self.imp.get_unique_constraint::("quest_id"), - phantom: std::marker::PhantomData, + /// Access to the `quest_id` unique index on the table `quest_record`, + /// which allows point queries on the field of the same name + /// via the [`QuestRecordQuestIdUnique::find`] method. + /// + /// Users are encouraged not to explicitly reference this type, + /// but to directly chain method calls, + /// like `ctx.db.quest_record().quest_id().find(...)`. + pub struct QuestRecordQuestIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } - } -} -impl<'ctx> QuestRecordQuestIdUnique<'ctx> { - /// Find the subscribed row whose `quest_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 { - self.imp.find(col_val) - } -} + impl<'ctx> QuestRecordTableHandle<'ctx> { + /// Get a handle on the `quest_id` unique index on the table `quest_record`. + pub fn quest_id(&self) -> QuestRecordQuestIdUnique<'ctx> { + QuestRecordQuestIdUnique { + imp: self.imp.get_unique_constraint::("quest_id"), + phantom: std::marker::PhantomData, + } + } + } + impl<'ctx> QuestRecordQuestIdUnique<'ctx> { + /// Find the subscribed row whose `quest_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 { + self.imp.find(col_val) + } + } + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("quest_record"); _table.add_unique_constraint::("quest_id", |row| &row.quest_id); } @@ -141,24 +143,26 @@ pub(super) fn parse_table_update( raw_updates: __ws::v2::TableUpdate, ) -> __sdk::Result<__sdk::TableUpdate> { __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { - __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") - .with_cause(e) - .into() + __sdk::InternalError::failed_parse( + "TableUpdate", + "TableUpdate", + ).with_cause(e).into() }) } -#[allow(non_camel_case_types)] -/// Extension trait for query builder access to the table `QuestRecord`. -/// -/// Implemented for [`__sdk::QueryTableAccessor`]. -pub trait quest_recordQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `QuestRecord`. - fn quest_record(&self) -> __sdk::__query_builder::Table; -} + #[allow(non_camel_case_types)] + /// Extension trait for query builder access to the table `QuestRecord`. + /// + /// Implemented for [`__sdk::QueryTableAccessor`]. + pub trait quest_recordQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `QuestRecord`. + fn quest_record(&self) -> __sdk::__query_builder::Table; + } + + impl quest_recordQueryTableAccess for __sdk::QueryTableAccessor { + fn quest_record(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("quest_record") + } + } -impl quest_recordQueryTableAccess for __sdk::QueryTableAccessor { - fn quest_record(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("quest_record") - } -} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/quest_record_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/quest_record_type.rs index 4243e91c..10f98806 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/quest_record_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/quest_record_type.rs @@ -2,28 +2,33 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_narrative_binding_snapshot_type::QuestNarrativeBindingSnapshot; -use super::quest_objective_snapshot_type::QuestObjectiveSnapshot; -use super::quest_reward_snapshot_type::QuestRewardSnapshot; use super::quest_status_type::QuestStatus; +use super::quest_reward_snapshot_type::QuestRewardSnapshot; +use super::quest_narrative_binding_snapshot_type::QuestNarrativeBindingSnapshot; use super::quest_step_snapshot_type::QuestStepSnapshot; +use super::quest_objective_snapshot_type::QuestObjectiveSnapshot; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] pub struct QuestRecord { pub quest_id: String, pub runtime_session_id: String, - pub story_session_id: Option, + pub story_session_id: Option::, pub actor_user_id: String, pub issuer_npc_id: String, pub issuer_npc_name: String, - pub scene_id: Option, - pub chapter_id: Option, - pub act_id: Option, - pub thread_id: Option, - pub contract_id: Option, + pub scene_id: Option::, + pub chapter_id: Option::, + pub act_id: Option::, + pub thread_id: Option::, + pub contract_id: Option::, pub title: String, pub description: String, pub summary: String, @@ -34,38 +39,40 @@ pub struct QuestRecord { pub reward: QuestRewardSnapshot, pub reward_text: String, pub narrative_binding: QuestNarrativeBindingSnapshot, - pub steps: Vec, - pub active_step_id: Option, + pub steps: Vec::, + pub active_step_id: Option::, pub visible_stage: u32, - pub hidden_flags: Vec, - pub discovered_fact_ids: Vec, - pub related_carrier_ids: Vec, - pub consequence_ids: Vec, + pub hidden_flags: Vec::, + pub discovered_fact_ids: Vec::, + pub related_carrier_ids: Vec::, + pub consequence_ids: Vec::, pub created_at: __sdk::Timestamp, pub updated_at: __sdk::Timestamp, - pub completed_at: Option<__sdk::Timestamp>, - pub turned_in_at: Option<__sdk::Timestamp>, + pub completed_at: Option::<__sdk::Timestamp>, + pub turned_in_at: Option::<__sdk::Timestamp>, } + impl __sdk::InModule for QuestRecord { type Module = super::RemoteModule; } + /// Column accessor struct for the table `QuestRecord`. /// /// Provides typed access to columns for query building. pub struct QuestRecordCols { pub quest_id: __sdk::__query_builder::Col, pub runtime_session_id: __sdk::__query_builder::Col, - pub story_session_id: __sdk::__query_builder::Col>, + pub story_session_id: __sdk::__query_builder::Col>, pub actor_user_id: __sdk::__query_builder::Col, pub issuer_npc_id: __sdk::__query_builder::Col, pub issuer_npc_name: __sdk::__query_builder::Col, - pub scene_id: __sdk::__query_builder::Col>, - pub chapter_id: __sdk::__query_builder::Col>, - pub act_id: __sdk::__query_builder::Col>, - pub thread_id: __sdk::__query_builder::Col>, - pub contract_id: __sdk::__query_builder::Col>, + pub scene_id: __sdk::__query_builder::Col>, + pub chapter_id: __sdk::__query_builder::Col>, + pub act_id: __sdk::__query_builder::Col>, + pub thread_id: __sdk::__query_builder::Col>, + pub contract_id: __sdk::__query_builder::Col>, pub title: __sdk::__query_builder::Col, pub description: __sdk::__query_builder::Col, pub summary: __sdk::__query_builder::Col, @@ -76,17 +83,17 @@ pub struct QuestRecordCols { pub reward: __sdk::__query_builder::Col, pub reward_text: __sdk::__query_builder::Col, pub narrative_binding: __sdk::__query_builder::Col, - pub steps: __sdk::__query_builder::Col>, - pub active_step_id: __sdk::__query_builder::Col>, + pub steps: __sdk::__query_builder::Col>, + pub active_step_id: __sdk::__query_builder::Col>, pub visible_stage: __sdk::__query_builder::Col, - pub hidden_flags: __sdk::__query_builder::Col>, - pub discovered_fact_ids: __sdk::__query_builder::Col>, - pub related_carrier_ids: __sdk::__query_builder::Col>, - pub consequence_ids: __sdk::__query_builder::Col>, + pub hidden_flags: __sdk::__query_builder::Col>, + pub discovered_fact_ids: __sdk::__query_builder::Col>, + pub related_carrier_ids: __sdk::__query_builder::Col>, + pub consequence_ids: __sdk::__query_builder::Col>, pub created_at: __sdk::__query_builder::Col, pub updated_at: __sdk::__query_builder::Col, - pub completed_at: __sdk::__query_builder::Col>, - pub turned_in_at: __sdk::__query_builder::Col>, + pub completed_at: __sdk::__query_builder::Col>, + pub turned_in_at: __sdk::__query_builder::Col>, } impl __sdk::__query_builder::HasCols for QuestRecord { @@ -110,10 +117,7 @@ impl __sdk::__query_builder::HasCols for QuestRecord { objective: __sdk::__query_builder::Col::new(table_name, "objective"), progress: __sdk::__query_builder::Col::new(table_name, "progress"), status: __sdk::__query_builder::Col::new(table_name, "status"), - completion_notified: __sdk::__query_builder::Col::new( - table_name, - "completion_notified", - ), + completion_notified: __sdk::__query_builder::Col::new(table_name, "completion_notified"), reward: __sdk::__query_builder::Col::new(table_name, "reward"), reward_text: __sdk::__query_builder::Col::new(table_name, "reward_text"), narrative_binding: __sdk::__query_builder::Col::new(table_name, "narrative_binding"), @@ -121,19 +125,14 @@ impl __sdk::__query_builder::HasCols for QuestRecord { active_step_id: __sdk::__query_builder::Col::new(table_name, "active_step_id"), visible_stage: __sdk::__query_builder::Col::new(table_name, "visible_stage"), hidden_flags: __sdk::__query_builder::Col::new(table_name, "hidden_flags"), - discovered_fact_ids: __sdk::__query_builder::Col::new( - table_name, - "discovered_fact_ids", - ), - related_carrier_ids: __sdk::__query_builder::Col::new( - table_name, - "related_carrier_ids", - ), + discovered_fact_ids: __sdk::__query_builder::Col::new(table_name, "discovered_fact_ids"), + related_carrier_ids: __sdk::__query_builder::Col::new(table_name, "related_carrier_ids"), consequence_ids: __sdk::__query_builder::Col::new(table_name, "consequence_ids"), created_at: __sdk::__query_builder::Col::new(table_name, "created_at"), updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"), completed_at: __sdk::__query_builder::Col::new(table_name, "completed_at"), turned_in_at: __sdk::__query_builder::Col::new(table_name, "turned_in_at"), + } } } @@ -155,12 +154,11 @@ impl __sdk::__query_builder::HasIxCols for QuestRecord { actor_user_id: __sdk::__query_builder::IxCol::new(table_name, "actor_user_id"), issuer_npc_id: __sdk::__query_builder::IxCol::new(table_name, "issuer_npc_id"), quest_id: __sdk::__query_builder::IxCol::new(table_name, "quest_id"), - runtime_session_id: __sdk::__query_builder::IxCol::new( - table_name, - "runtime_session_id", - ), + runtime_session_id: __sdk::__query_builder::IxCol::new(table_name, "runtime_session_id"), + } } } impl __sdk::__query_builder::CanBeLookupTable for QuestRecord {} + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/quest_reward_equipment_slot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/quest_reward_equipment_slot_type.rs index 43a942c4..333521e0 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/quest_reward_equipment_slot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/quest_reward_equipment_slot_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -13,8 +18,12 @@ pub enum QuestRewardEquipmentSlot { Armor, Relic, + } + + impl __sdk::InModule for QuestRewardEquipmentSlot { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/quest_reward_intel_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/quest_reward_intel_type.rs index 9938686a..560847bd 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/quest_reward_intel_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/quest_reward_intel_type.rs @@ -2,15 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] pub struct QuestRewardIntel { pub rumor_text: String, - pub unlocked_scene_id: Option, + pub unlocked_scene_id: Option::, } + impl __sdk::InModule for QuestRewardIntel { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/quest_reward_item_rarity_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/quest_reward_item_rarity_type.rs index 7fc4f7ec..632c46aa 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/quest_reward_item_rarity_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/quest_reward_item_rarity_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -17,8 +22,12 @@ pub enum QuestRewardItemRarity { Epic, Legendary, + } + + impl __sdk::InModule for QuestRewardItemRarity { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/quest_reward_item_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/quest_reward_item_type.rs index a62f9d93..dc0af611 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/quest_reward_item_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/quest_reward_item_type.rs @@ -2,10 +2,15 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_reward_equipment_slot_type::QuestRewardEquipmentSlot; use super::quest_reward_item_rarity_type::QuestRewardItemRarity; +use super::quest_reward_equipment_slot_type::QuestRewardEquipmentSlot; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] @@ -13,15 +18,17 @@ pub struct QuestRewardItem { pub item_id: String, pub category: String, pub name: String, - pub description: Option, + pub description: Option::, pub quantity: u32, pub rarity: QuestRewardItemRarity, - pub tags: Vec, + pub tags: Vec::, pub stackable: bool, pub stack_key: String, - pub equipment_slot_id: Option, + pub equipment_slot_id: Option::, } + impl __sdk::InModule for QuestRewardItem { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/quest_reward_snapshot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/quest_reward_snapshot_type.rs index 995e84ad..55790858 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/quest_reward_snapshot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/quest_reward_snapshot_type.rs @@ -2,22 +2,29 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_reward_intel_type::QuestRewardIntel; use super::quest_reward_item_type::QuestRewardItem; +use super::quest_reward_intel_type::QuestRewardIntel; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] pub struct QuestRewardSnapshot { pub affinity_bonus: i32, pub currency: i64, - pub experience: Option, - pub items: Vec, - pub intel: Option, - pub story_hint: Option, + pub experience: Option::, + pub items: Vec::, + pub intel: Option::, + pub story_hint: Option::, } + impl __sdk::InModule for QuestRewardSnapshot { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/quest_scene_reached_signal_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/quest_scene_reached_signal_type.rs index 723d9325..d188fab1 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/quest_scene_reached_signal_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/quest_scene_reached_signal_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -10,6 +16,8 @@ pub struct QuestSceneReachedSignal { pub scene_id: String, } + impl __sdk::InModule for QuestSceneReachedSignal { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/quest_signal_apply_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/quest_signal_apply_input_type.rs index d93ff928..89cc2c6f 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/quest_signal_apply_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/quest_signal_apply_input_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_progress_signal_type::QuestProgressSignal; @@ -14,6 +19,8 @@ pub struct QuestSignalApplyInput { pub updated_at_micros: i64, } + impl __sdk::InModule for QuestSignalApplyInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/quest_signal_kind_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/quest_signal_kind_type.rs index 04ea6661..0d36f2fa 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/quest_signal_kind_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/quest_signal_kind_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -19,8 +24,12 @@ pub enum QuestSignalKind { SceneReached, ItemDelivered, + } + + impl __sdk::InModule for QuestSignalKind { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/quest_status_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/quest_status_type.rs index f5defbb7..3ea098d8 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/quest_status_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/quest_status_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -19,8 +24,12 @@ pub enum QuestStatus { Failed, Expired, + } + + impl __sdk::InModule for QuestStatus { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/quest_step_snapshot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/quest_step_snapshot_type.rs index 0f27cb9e..c1e3bc1a 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/quest_step_snapshot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/quest_step_snapshot_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_objective_kind_type::QuestObjectiveKind; @@ -11,10 +16,10 @@ use super::quest_objective_kind_type::QuestObjectiveKind; pub struct QuestStepSnapshot { pub step_id: String, pub kind: QuestObjectiveKind, - pub target_hostile_npc_id: Option, - pub target_npc_id: Option, - pub target_scene_id: Option, - pub target_item_id: Option, + pub target_hostile_npc_id: Option::, + pub target_npc_id: Option::, + pub target_scene_id: Option::, + pub target_item_id: Option::, pub required_count: u32, pub progress: u32, pub title: String, @@ -22,6 +27,8 @@ pub struct QuestStepSnapshot { pub complete_text: String, } + impl __sdk::InModule for QuestStepSnapshot { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/quest_treasure_inspected_signal_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/quest_treasure_inspected_signal_type.rs index 51caed77..8003e616 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/quest_treasure_inspected_signal_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/quest_treasure_inspected_signal_type.rs @@ -2,14 +2,22 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] pub struct QuestTreasureInspectedSignal { - pub scene_id: Option, + pub scene_id: Option::, } + impl __sdk::InModule for QuestTreasureInspectedSignal { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/quest_turn_in_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/quest_turn_in_input_type.rs index 4f48a44a..9d87ae49 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/quest_turn_in_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/quest_turn_in_input_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -11,6 +17,8 @@ pub struct QuestTurnInInput { pub turned_in_at_micros: i64, } + impl __sdk::InModule for QuestTurnInInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/resolve_combat_action_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/resolve_combat_action_and_return_procedure.rs index ac8aa07d..9b886a0d 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/resolve_combat_action_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/resolve_combat_action_and_return_procedure.rs @@ -2,17 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::resolve_combat_action_input_type::ResolveCombatActionInput; use super::resolve_combat_action_procedure_result_type::ResolveCombatActionProcedureResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct ResolveCombatActionAndReturnArgs { + struct ResolveCombatActionAndReturnArgs { pub input: ResolveCombatActionInput, } + impl __sdk::InModule for ResolveCombatActionAndReturnArgs { type Module = super::RemoteModule; } @@ -22,19 +28,16 @@ impl __sdk::InModule for ResolveCombatActionAndReturnArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait resolve_combat_action_and_return { - fn resolve_combat_action_and_return(&self, input: ResolveCombatActionInput) { - self.resolve_combat_action_and_return_then(input, |_, _| {}); + fn resolve_combat_action_and_return(&self, input: ResolveCombatActionInput, +) { + self.resolve_combat_action_and_return_then(input, |_, _| {}); } fn resolve_combat_action_and_return_then( &self, input: ResolveCombatActionInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } @@ -43,17 +46,13 @@ impl resolve_combat_action_and_return for super::RemoteProcedures { &self, input: ResolveCombatActionInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, ResolveCombatActionProcedureResult>( - "resolve_combat_action_and_return", - ResolveCombatActionAndReturnArgs { input }, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, ResolveCombatActionProcedureResult>( + "resolve_combat_action_and_return", + ResolveCombatActionAndReturnArgs { input, }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/resolve_combat_action_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/resolve_combat_action_input_type.rs index 7dea1c21..72c6524f 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/resolve_combat_action_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/resolve_combat_action_input_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -18,6 +24,8 @@ pub struct ResolveCombatActionInput { pub updated_at_micros: i64, } + impl __sdk::InModule for ResolveCombatActionInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/resolve_combat_action_procedure_result_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/resolve_combat_action_procedure_result_type.rs index c7a13f85..f21fc0ee 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/resolve_combat_action_procedure_result_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/resolve_combat_action_procedure_result_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::resolve_combat_action_result_type::ResolveCombatActionResult; @@ -10,10 +15,12 @@ use super::resolve_combat_action_result_type::ResolveCombatActionResult; #[sats(crate = __lib)] pub struct ResolveCombatActionProcedureResult { pub ok: bool, - pub result: Option, - pub error_message: Option, + pub result: Option::, + pub error_message: Option::, } + impl __sdk::InModule for ResolveCombatActionProcedureResult { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/resolve_combat_action_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/resolve_combat_action_reducer.rs index 41340e2f..1c3f29c9 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/resolve_combat_action_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/resolve_combat_action_reducer.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::resolve_combat_action_input_type::ResolveCombatActionInput; @@ -14,8 +19,10 @@ pub(super) struct ResolveCombatActionArgs { impl From for super::Reducer { fn from(args: ResolveCombatActionArgs) -> Self { - Self::ResolveCombatAction { input: args.input } - } + Self::ResolveCombatAction { + input: args.input, +} +} } impl __sdk::InModule for ResolveCombatActionArgs { @@ -33,8 +40,9 @@ pub trait resolve_combat_action { /// The reducer will run asynchronously in the future, /// and this method provides no way to listen for its completion status. /// /// Use [`resolve_combat_action:resolve_combat_action_then`] to run a callback after the reducer completes. - fn resolve_combat_action(&self, input: ResolveCombatActionInput) -> __sdk::Result<()> { - self.resolve_combat_action_then(input, |_, _| {}) + fn resolve_combat_action(&self, input: ResolveCombatActionInput, +) -> __sdk::Result<()> { + self.resolve_combat_action_then(input, |_, _| {}) } /// Request that the remote module invoke the reducer `resolve_combat_action` to run as soon as possible, @@ -62,7 +70,7 @@ impl resolve_combat_action for super::RemoteReducers { + Send + 'static, ) -> __sdk::Result<()> { - self.imp - .invoke_reducer_with_callback(ResolveCombatActionArgs { input }, callback) + self.imp.invoke_reducer_with_callback(ResolveCombatActionArgs { input, }, callback) } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/resolve_combat_action_result_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/resolve_combat_action_result_type.rs index b47e088c..8057358f 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/resolve_combat_action_result_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/resolve_combat_action_result_type.rs @@ -2,10 +2,15 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::combat_outcome_type::CombatOutcome; +use super::battle_state_snapshot_type::BattleStateSnapshot; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] @@ -16,6 +21,8 @@ pub struct ResolveCombatActionResult { pub outcome: CombatOutcome, } + impl __sdk::InModule for ResolveCombatActionResult { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_battle_interaction_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_battle_interaction_and_return_procedure.rs index ff4cca29..150fa443 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_battle_interaction_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_battle_interaction_and_return_procedure.rs @@ -2,17 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::npc_battle_interaction_procedure_result_type::NpcBattleInteractionProcedureResult; use super::resolve_npc_battle_interaction_input_type::ResolveNpcBattleInteractionInput; +use super::npc_battle_interaction_procedure_result_type::NpcBattleInteractionProcedureResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct ResolveNpcBattleInteractionAndReturnArgs { + struct ResolveNpcBattleInteractionAndReturnArgs { pub input: ResolveNpcBattleInteractionInput, } + impl __sdk::InModule for ResolveNpcBattleInteractionAndReturnArgs { type Module = super::RemoteModule; } @@ -22,19 +28,16 @@ impl __sdk::InModule for ResolveNpcBattleInteractionAndReturnArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait resolve_npc_battle_interaction_and_return { - fn resolve_npc_battle_interaction_and_return(&self, input: ResolveNpcBattleInteractionInput) { - self.resolve_npc_battle_interaction_and_return_then(input, |_, _| {}); + fn resolve_npc_battle_interaction_and_return(&self, input: ResolveNpcBattleInteractionInput, +) { + self.resolve_npc_battle_interaction_and_return_then(input, |_, _| {}); } fn resolve_npc_battle_interaction_and_return_then( &self, input: ResolveNpcBattleInteractionInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } @@ -43,17 +46,13 @@ impl resolve_npc_battle_interaction_and_return for super::RemoteProcedures { &self, input: ResolveNpcBattleInteractionInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, NpcBattleInteractionProcedureResult>( - "resolve_npc_battle_interaction_and_return", - ResolveNpcBattleInteractionAndReturnArgs { input }, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, NpcBattleInteractionProcedureResult>( + "resolve_npc_battle_interaction_and_return", + ResolveNpcBattleInteractionAndReturnArgs { input, }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_battle_interaction_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_battle_interaction_input_type.rs index e8eba7a6..907cc7e2 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_battle_interaction_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_battle_interaction_input_type.rs @@ -2,10 +2,15 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::resolve_npc_interaction_input_type::ResolveNpcInteractionInput; use super::runtime_item_reward_item_snapshot_type::RuntimeItemRewardItemSnapshot; +use super::resolve_npc_interaction_input_type::ResolveNpcInteractionInput; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] @@ -13,7 +18,7 @@ pub struct ResolveNpcBattleInteractionInput { pub npc_interaction: ResolveNpcInteractionInput, pub story_session_id: String, pub actor_user_id: String, - pub battle_state_id: Option, + pub battle_state_id: Option::, pub player_hp: i32, pub player_max_hp: i32, pub player_mana: i32, @@ -21,9 +26,11 @@ pub struct ResolveNpcBattleInteractionInput { pub target_hp: i32, pub target_max_hp: i32, pub experience_reward: u32, - pub reward_items: Vec, + pub reward_items: Vec::, } + impl __sdk::InModule for ResolveNpcBattleInteractionInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_interaction_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_interaction_and_return_procedure.rs index aaba3d9c..4952a32a 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_interaction_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_interaction_and_return_procedure.rs @@ -2,17 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::npc_interaction_procedure_result_type::NpcInteractionProcedureResult; use super::resolve_npc_interaction_input_type::ResolveNpcInteractionInput; +use super::npc_interaction_procedure_result_type::NpcInteractionProcedureResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct ResolveNpcInteractionAndReturnArgs { + struct ResolveNpcInteractionAndReturnArgs { pub input: ResolveNpcInteractionInput, } + impl __sdk::InModule for ResolveNpcInteractionAndReturnArgs { type Module = super::RemoteModule; } @@ -22,19 +28,16 @@ impl __sdk::InModule for ResolveNpcInteractionAndReturnArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait resolve_npc_interaction_and_return { - fn resolve_npc_interaction_and_return(&self, input: ResolveNpcInteractionInput) { - self.resolve_npc_interaction_and_return_then(input, |_, _| {}); + fn resolve_npc_interaction_and_return(&self, input: ResolveNpcInteractionInput, +) { + self.resolve_npc_interaction_and_return_then(input, |_, _| {}); } fn resolve_npc_interaction_and_return_then( &self, input: ResolveNpcInteractionInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } @@ -43,17 +46,13 @@ impl resolve_npc_interaction_and_return for super::RemoteProcedures { &self, input: ResolveNpcInteractionInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, NpcInteractionProcedureResult>( - "resolve_npc_interaction_and_return", - ResolveNpcInteractionAndReturnArgs { input }, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, NpcInteractionProcedureResult>( + "resolve_npc_interaction_and_return", + ResolveNpcInteractionAndReturnArgs { input, }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_interaction_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_interaction_input_type.rs index 9a4439ce..d553ea4e 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_interaction_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_interaction_input_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -11,10 +17,12 @@ pub struct ResolveNpcInteractionInput { pub npc_id: String, pub npc_name: String, pub interaction_function_id: String, - pub release_npc_id: Option, + pub release_npc_id: Option::, pub updated_at_micros: i64, } + impl __sdk::InModule for ResolveNpcInteractionInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_interaction_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_interaction_reducer.rs index 52d213b5..37563788 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_interaction_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_interaction_reducer.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::resolve_npc_interaction_input_type::ResolveNpcInteractionInput; @@ -14,8 +19,10 @@ pub(super) struct ResolveNpcInteractionArgs { impl From for super::Reducer { fn from(args: ResolveNpcInteractionArgs) -> Self { - Self::ResolveNpcInteraction { input: args.input } - } + Self::ResolveNpcInteraction { + input: args.input, +} +} } impl __sdk::InModule for ResolveNpcInteractionArgs { @@ -33,8 +40,9 @@ pub trait resolve_npc_interaction { /// The reducer will run asynchronously in the future, /// and this method provides no way to listen for its completion status. /// /// Use [`resolve_npc_interaction:resolve_npc_interaction_then`] to run a callback after the reducer completes. - fn resolve_npc_interaction(&self, input: ResolveNpcInteractionInput) -> __sdk::Result<()> { - self.resolve_npc_interaction_then(input, |_, _| {}) + fn resolve_npc_interaction(&self, input: ResolveNpcInteractionInput, +) -> __sdk::Result<()> { + self.resolve_npc_interaction_then(input, |_, _| {}) } /// Request that the remote module invoke the reducer `resolve_npc_interaction` to run as soon as possible, @@ -62,7 +70,7 @@ impl resolve_npc_interaction for super::RemoteReducers { + Send + 'static, ) -> __sdk::Result<()> { - self.imp - .invoke_reducer_with_callback(ResolveNpcInteractionArgs { input }, callback) + self.imp.invoke_reducer_with_callback(ResolveNpcInteractionArgs { input, }, callback) } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_social_action_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_social_action_and_return_procedure.rs index c1425649..2411e620 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_social_action_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_social_action_and_return_procedure.rs @@ -2,17 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::npc_state_procedure_result_type::NpcStateProcedureResult; use super::resolve_npc_social_action_input_type::ResolveNpcSocialActionInput; +use super::npc_state_procedure_result_type::NpcStateProcedureResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct ResolveNpcSocialActionAndReturnArgs { + struct ResolveNpcSocialActionAndReturnArgs { pub input: ResolveNpcSocialActionInput, } + impl __sdk::InModule for ResolveNpcSocialActionAndReturnArgs { type Module = super::RemoteModule; } @@ -22,19 +28,16 @@ impl __sdk::InModule for ResolveNpcSocialActionAndReturnArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait resolve_npc_social_action_and_return { - fn resolve_npc_social_action_and_return(&self, input: ResolveNpcSocialActionInput) { - self.resolve_npc_social_action_and_return_then(input, |_, _| {}); + fn resolve_npc_social_action_and_return(&self, input: ResolveNpcSocialActionInput, +) { + self.resolve_npc_social_action_and_return_then(input, |_, _| {}); } fn resolve_npc_social_action_and_return_then( &self, input: ResolveNpcSocialActionInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } @@ -43,17 +46,13 @@ impl resolve_npc_social_action_and_return for super::RemoteProcedures { &self, input: ResolveNpcSocialActionInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, NpcStateProcedureResult>( - "resolve_npc_social_action_and_return", - ResolveNpcSocialActionAndReturnArgs { input }, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, NpcStateProcedureResult>( + "resolve_npc_social_action_and_return", + ResolveNpcSocialActionAndReturnArgs { input, }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_social_action_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_social_action_input_type.rs index 29487297..10df08b1 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_social_action_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_social_action_input_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::npc_social_action_kind_type::NpcSocialActionKind; @@ -13,11 +18,13 @@ pub struct ResolveNpcSocialActionInput { pub npc_id: String, pub npc_name: String, pub action_kind: NpcSocialActionKind, - pub affinity_gain_override: Option, - pub note: Option, + pub affinity_gain_override: Option::, + pub note: Option::, pub updated_at_micros: i64, } + impl __sdk::InModule for ResolveNpcSocialActionInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_social_action_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_social_action_reducer.rs index 28e5ce36..e8717b6f 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_social_action_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_social_action_reducer.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::resolve_npc_social_action_input_type::ResolveNpcSocialActionInput; @@ -14,8 +19,10 @@ pub(super) struct ResolveNpcSocialActionArgs { impl From for super::Reducer { fn from(args: ResolveNpcSocialActionArgs) -> Self { - Self::ResolveNpcSocialAction { input: args.input } - } + Self::ResolveNpcSocialAction { + input: args.input, +} +} } impl __sdk::InModule for ResolveNpcSocialActionArgs { @@ -33,8 +40,9 @@ pub trait resolve_npc_social_action { /// The reducer will run asynchronously in the future, /// and this method provides no way to listen for its completion status. /// /// Use [`resolve_npc_social_action:resolve_npc_social_action_then`] to run a callback after the reducer completes. - fn resolve_npc_social_action(&self, input: ResolveNpcSocialActionInput) -> __sdk::Result<()> { - self.resolve_npc_social_action_then(input, |_, _| {}) + fn resolve_npc_social_action(&self, input: ResolveNpcSocialActionInput, +) -> __sdk::Result<()> { + self.resolve_npc_social_action_then(input, |_, _| {}) } /// Request that the remote module invoke the reducer `resolve_npc_social_action` to run as soon as possible, @@ -62,7 +70,7 @@ impl resolve_npc_social_action for super::RemoteReducers { + Send + 'static, ) -> __sdk::Result<()> { - self.imp - .invoke_reducer_with_callback(ResolveNpcSocialActionArgs { input }, callback) + self.imp.invoke_reducer_with_callback(ResolveNpcSocialActionArgs { input, }, callback) } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/resolve_treasure_interaction_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/resolve_treasure_interaction_and_return_procedure.rs index a224c122..cc50e10f 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/resolve_treasure_interaction_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/resolve_treasure_interaction_and_return_procedure.rs @@ -2,17 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::treasure_record_procedure_result_type::TreasureRecordProcedureResult; use super::treasure_resolve_input_type::TreasureResolveInput; +use super::treasure_record_procedure_result_type::TreasureRecordProcedureResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct ResolveTreasureInteractionAndReturnArgs { + struct ResolveTreasureInteractionAndReturnArgs { pub input: TreasureResolveInput, } + impl __sdk::InModule for ResolveTreasureInteractionAndReturnArgs { type Module = super::RemoteModule; } @@ -22,19 +28,16 @@ impl __sdk::InModule for ResolveTreasureInteractionAndReturnArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait resolve_treasure_interaction_and_return { - fn resolve_treasure_interaction_and_return(&self, input: TreasureResolveInput) { - self.resolve_treasure_interaction_and_return_then(input, |_, _| {}); + fn resolve_treasure_interaction_and_return(&self, input: TreasureResolveInput, +) { + self.resolve_treasure_interaction_and_return_then(input, |_, _| {}); } fn resolve_treasure_interaction_and_return_then( &self, input: TreasureResolveInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } @@ -43,17 +46,13 @@ impl resolve_treasure_interaction_and_return for super::RemoteProcedures { &self, input: TreasureResolveInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, TreasureRecordProcedureResult>( - "resolve_treasure_interaction_and_return", - ResolveTreasureInteractionAndReturnArgs { input }, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, TreasureRecordProcedureResult>( + "resolve_treasure_interaction_and_return", + ResolveTreasureInteractionAndReturnArgs { input, }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/resolve_treasure_interaction_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/resolve_treasure_interaction_reducer.rs index 942b377a..6a830425 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/resolve_treasure_interaction_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/resolve_treasure_interaction_reducer.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::treasure_resolve_input_type::TreasureResolveInput; @@ -14,8 +19,10 @@ pub(super) struct ResolveTreasureInteractionArgs { impl From for super::Reducer { fn from(args: ResolveTreasureInteractionArgs) -> Self { - Self::ResolveTreasureInteraction { input: args.input } - } + Self::ResolveTreasureInteraction { + input: args.input, +} +} } impl __sdk::InModule for ResolveTreasureInteractionArgs { @@ -33,8 +40,9 @@ pub trait resolve_treasure_interaction { /// The reducer will run asynchronously in the future, /// and this method provides no way to listen for its completion status. /// /// Use [`resolve_treasure_interaction:resolve_treasure_interaction_then`] to run a callback after the reducer completes. - fn resolve_treasure_interaction(&self, input: TreasureResolveInput) -> __sdk::Result<()> { - self.resolve_treasure_interaction_then(input, |_, _| {}) + fn resolve_treasure_interaction(&self, input: TreasureResolveInput, +) -> __sdk::Result<()> { + self.resolve_treasure_interaction_then(input, |_, _| {}) } /// Request that the remote module invoke the reducer `resolve_treasure_interaction` to run as soon as possible, @@ -62,7 +70,7 @@ impl resolve_treasure_interaction for super::RemoteReducers { + Send + 'static, ) -> __sdk::Result<()> { - self.imp - .invoke_reducer_with_callback(ResolveTreasureInteractionArgs { input }, callback) + self.imp.invoke_reducer_with_callback(ResolveTreasureInteractionArgs { input, }, callback) } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/resume_profile_save_archive_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/resume_profile_save_archive_and_return_procedure.rs new file mode 100644 index 00000000..8505e52a --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/resume_profile_save_archive_and_return_procedure.rs @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use spacetimedb_sdk::__codegen::{ + self as __sdk, + __lib, + __sats, + __ws, +}; + +use super::runtime_profile_save_archive_procedure_result_type::RuntimeProfileSaveArchiveProcedureResult; +use super::runtime_profile_save_archive_resume_input_type::RuntimeProfileSaveArchiveResumeInput; + +#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] +#[sats(crate = __lib)] + struct ResumeProfileSaveArchiveAndReturnArgs { + pub input: RuntimeProfileSaveArchiveResumeInput, +} + + +impl __sdk::InModule for ResumeProfileSaveArchiveAndReturnArgs { + type Module = super::RemoteModule; +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the procedure `resume_profile_save_archive_and_return`. +/// +/// Implemented for [`super::RemoteProcedures`]. +pub trait resume_profile_save_archive_and_return { + fn resume_profile_save_archive_and_return(&self, input: RuntimeProfileSaveArchiveResumeInput, +) { + self.resume_profile_save_archive_and_return_then(input, |_, _| {}); + } + + fn resume_profile_save_archive_and_return_then( + &self, + input: RuntimeProfileSaveArchiveResumeInput, + + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + ); +} + +impl resume_profile_save_archive_and_return for super::RemoteProcedures { + fn resume_profile_save_archive_and_return_then( + &self, + input: RuntimeProfileSaveArchiveResumeInput, + + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + ) { + self.imp.invoke_procedure_with_callback::<_, RuntimeProfileSaveArchiveProcedureResult>( + "resume_profile_save_archive_and_return", + ResumeProfileSaveArchiveAndReturnArgs { input, }, + __callback, + ); + } +} + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/rpg_agent_draft_card_kind_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/rpg_agent_draft_card_kind_type.rs index e082dc36..3888a866 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/rpg_agent_draft_card_kind_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/rpg_agent_draft_card_kind_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -27,8 +32,12 @@ pub enum RpgAgentDraftCardKind { Carrier, SidequestSeed, + } + + impl __sdk::InModule for RpgAgentDraftCardKind { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/rpg_agent_draft_card_status_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/rpg_agent_draft_card_status_type.rs index 391625f5..f890218d 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/rpg_agent_draft_card_status_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/rpg_agent_draft_card_status_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -15,8 +20,12 @@ pub enum RpgAgentDraftCardStatus { Locked, Warning, + } + + impl __sdk::InModule for RpgAgentDraftCardStatus { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/rpg_agent_message_kind_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/rpg_agent_message_kind_type.rs index fc54a7b1..180466b0 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/rpg_agent_message_kind_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/rpg_agent_message_kind_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -19,8 +24,12 @@ pub enum RpgAgentMessageKind { Warning, ActionResult, + } + + impl __sdk::InModule for RpgAgentMessageKind { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/rpg_agent_message_role_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/rpg_agent_message_role_type.rs index 67e383f2..ad7e445b 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/rpg_agent_message_role_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/rpg_agent_message_role_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -13,8 +18,12 @@ pub enum RpgAgentMessageRole { Assistant, System, + } + + impl __sdk::InModule for RpgAgentMessageRole { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/rpg_agent_operation_status_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/rpg_agent_operation_status_type.rs index 555c0439..42cd9fc2 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/rpg_agent_operation_status_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/rpg_agent_operation_status_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -15,8 +20,12 @@ pub enum RpgAgentOperationStatus { Completed, Failed, + } + + impl __sdk::InModule for RpgAgentOperationStatus { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/rpg_agent_operation_type_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/rpg_agent_operation_type_type.rs index c3e7b8ac..60ee2ecf 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/rpg_agent_operation_type_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/rpg_agent_operation_type_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -33,8 +38,12 @@ pub enum RpgAgentOperationType { PublishWorld, RevertCheckpoint, + } + + impl __sdk::InModule for RpgAgentOperationType { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/rpg_agent_stage_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/rpg_agent_stage_type.rs index 1a94e20f..b9d0cf0e 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/rpg_agent_stage_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/rpg_agent_stage_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -25,8 +30,12 @@ pub enum RpgAgentStage { Published, Error, + } + + impl __sdk::InModule for RpgAgentStage { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_browse_history_clear_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_browse_history_clear_input_type.rs index e5bc78f0..41fc6954 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/runtime_browse_history_clear_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_browse_history_clear_input_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -10,6 +16,8 @@ pub struct RuntimeBrowseHistoryClearInput { pub user_id: String, } + impl __sdk::InModule for RuntimeBrowseHistoryClearInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_browse_history_list_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_browse_history_list_input_type.rs index cdc31641..5795bb3a 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/runtime_browse_history_list_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_browse_history_list_input_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -10,6 +16,8 @@ pub struct RuntimeBrowseHistoryListInput { pub user_id: String, } + impl __sdk::InModule for RuntimeBrowseHistoryListInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_browse_history_procedure_result_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_browse_history_procedure_result_type.rs index 3721358f..9c02dd59 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/runtime_browse_history_procedure_result_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_browse_history_procedure_result_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_snapshot_type::RuntimeBrowseHistorySnapshot; @@ -10,10 +15,12 @@ use super::runtime_browse_history_snapshot_type::RuntimeBrowseHistorySnapshot; #[sats(crate = __lib)] pub struct RuntimeBrowseHistoryProcedureResult { pub ok: bool, - pub entries: Vec, - pub error_message: Option, + pub entries: Vec::, + pub error_message: Option::, } + impl __sdk::InModule for RuntimeBrowseHistoryProcedureResult { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_browse_history_snapshot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_browse_history_snapshot_type.rs index 9222eaed..05c404c1 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/runtime_browse_history_snapshot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_browse_history_snapshot_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_theme_mode_type::RuntimeBrowseHistoryThemeMode; @@ -16,7 +21,7 @@ pub struct RuntimeBrowseHistorySnapshot { pub world_name: String, pub subtitle: String, pub summary_text: String, - pub cover_image_src: Option, + pub cover_image_src: Option::, pub theme_mode: RuntimeBrowseHistoryThemeMode, pub author_display_name: String, pub visited_at_micros: i64, @@ -24,6 +29,8 @@ pub struct RuntimeBrowseHistorySnapshot { pub updated_at_micros: i64, } + impl __sdk::InModule for RuntimeBrowseHistorySnapshot { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_browse_history_sync_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_browse_history_sync_input_type.rs index 0996e66e..09c9fb18 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/runtime_browse_history_sync_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_browse_history_sync_input_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_write_input_type::RuntimeBrowseHistoryWriteInput; @@ -10,10 +15,12 @@ use super::runtime_browse_history_write_input_type::RuntimeBrowseHistoryWriteInp #[sats(crate = __lib)] pub struct RuntimeBrowseHistorySyncInput { pub user_id: String, - pub entries: Vec, + pub entries: Vec::, pub updated_at_micros: i64, } + impl __sdk::InModule for RuntimeBrowseHistorySyncInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_browse_history_theme_mode_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_browse_history_theme_mode_type.rs index fc8a1b11..de120fac 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/runtime_browse_history_theme_mode_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_browse_history_theme_mode_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -19,8 +24,12 @@ pub enum RuntimeBrowseHistoryThemeMode { Rift, Mythic, + } + + impl __sdk::InModule for RuntimeBrowseHistoryThemeMode { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_browse_history_write_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_browse_history_write_input_type.rs index 9a54bd81..fb087aac 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/runtime_browse_history_write_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_browse_history_write_input_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -10,14 +16,16 @@ pub struct RuntimeBrowseHistoryWriteInput { pub owner_user_id: String, pub profile_id: String, pub world_name: String, - pub subtitle: Option, - pub summary_text: Option, - pub cover_image_src: Option, - pub theme_mode: Option, - pub author_display_name: Option, - pub visited_at: Option, + pub subtitle: Option::, + pub summary_text: Option::, + pub cover_image_src: Option::, + pub theme_mode: Option::, + pub author_display_name: Option::, + pub visited_at: Option::, } + impl __sdk::InModule for RuntimeBrowseHistoryWriteInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_inventory_state_procedure_result_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_inventory_state_procedure_result_type.rs index bf0e3103..09374d4c 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/runtime_inventory_state_procedure_result_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_inventory_state_procedure_result_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_inventory_state_snapshot_type::RuntimeInventoryStateSnapshot; @@ -10,10 +15,12 @@ use super::runtime_inventory_state_snapshot_type::RuntimeInventoryStateSnapshot; #[sats(crate = __lib)] pub struct RuntimeInventoryStateProcedureResult { pub ok: bool, - pub snapshot: Option, - pub error_message: Option, + pub snapshot: Option::, + pub error_message: Option::, } + impl __sdk::InModule for RuntimeInventoryStateProcedureResult { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_inventory_state_query_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_inventory_state_query_input_type.rs index e6b02ed3..75c93962 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/runtime_inventory_state_query_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_inventory_state_query_input_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -11,6 +17,8 @@ pub struct RuntimeInventoryStateQueryInput { pub actor_user_id: String, } + impl __sdk::InModule for RuntimeInventoryStateQueryInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_inventory_state_snapshot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_inventory_state_snapshot_type.rs index 624e66c6..7ab3ebea 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/runtime_inventory_state_snapshot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_inventory_state_snapshot_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_slot_snapshot_type::InventorySlotSnapshot; @@ -11,10 +16,12 @@ use super::inventory_slot_snapshot_type::InventorySlotSnapshot; pub struct RuntimeInventoryStateSnapshot { pub runtime_session_id: String, pub actor_user_id: String, - pub backpack_items: Vec, - pub equipment_items: Vec, + pub backpack_items: Vec::, + pub equipment_items: Vec::, } + impl __sdk::InModule for RuntimeInventoryStateSnapshot { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_item_equipment_slot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_item_equipment_slot_type.rs index b539d4f3..01cd4888 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/runtime_item_equipment_slot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_item_equipment_slot_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -13,8 +18,12 @@ pub enum RuntimeItemEquipmentSlot { Armor, Relic, + } + + impl __sdk::InModule for RuntimeItemEquipmentSlot { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_item_reward_item_rarity_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_item_reward_item_rarity_type.rs index dc4250ab..a3316ea0 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/runtime_item_reward_item_rarity_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_item_reward_item_rarity_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -17,8 +22,12 @@ pub enum RuntimeItemRewardItemRarity { Epic, Legendary, + } + + impl __sdk::InModule for RuntimeItemRewardItemRarity { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_item_reward_item_snapshot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_item_reward_item_snapshot_type.rs index 4df1f248..65bcb55c 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/runtime_item_reward_item_snapshot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_item_reward_item_snapshot_type.rs @@ -2,10 +2,15 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_item_equipment_slot_type::RuntimeItemEquipmentSlot; use super::runtime_item_reward_item_rarity_type::RuntimeItemRewardItemRarity; +use super::runtime_item_equipment_slot_type::RuntimeItemEquipmentSlot; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] @@ -13,15 +18,17 @@ pub struct RuntimeItemRewardItemSnapshot { pub item_id: String, pub category: String, pub item_name: String, - pub description: Option, + pub description: Option::, pub quantity: u32, pub rarity: RuntimeItemRewardItemRarity, - pub tags: Vec, + pub tags: Vec::, pub stackable: bool, pub stack_key: String, - pub equipment_slot_id: Option, + pub equipment_slot_id: Option::, } + impl __sdk::InModule for RuntimeItemRewardItemSnapshot { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_platform_theme_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_platform_theme_type.rs index cbb36c5d..7eef5e97 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/runtime_platform_theme_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_platform_theme_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -11,8 +16,12 @@ pub enum RuntimePlatformTheme { Light, Dark, + } + + impl __sdk::InModule for RuntimePlatformTheme { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_dashboard_get_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_dashboard_get_input_type.rs index 47af88ec..9be0a158 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_dashboard_get_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_dashboard_get_input_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -10,6 +16,8 @@ pub struct RuntimeProfileDashboardGetInput { pub user_id: String, } + impl __sdk::InModule for RuntimeProfileDashboardGetInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_dashboard_procedure_result_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_dashboard_procedure_result_type.rs index fa80a719..a04facbb 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_dashboard_procedure_result_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_dashboard_procedure_result_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_profile_dashboard_snapshot_type::RuntimeProfileDashboardSnapshot; @@ -10,10 +15,12 @@ use super::runtime_profile_dashboard_snapshot_type::RuntimeProfileDashboardSnaps #[sats(crate = __lib)] pub struct RuntimeProfileDashboardProcedureResult { pub ok: bool, - pub record: Option, - pub error_message: Option, + pub record: Option::, + pub error_message: Option::, } + impl __sdk::InModule for RuntimeProfileDashboardProcedureResult { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_dashboard_snapshot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_dashboard_snapshot_type.rs index a3e97b05..6a54e5ff 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_dashboard_snapshot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_dashboard_snapshot_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -11,9 +17,11 @@ pub struct RuntimeProfileDashboardSnapshot { pub wallet_balance: u64, pub total_play_time_ms: u64, pub played_world_count: u32, - pub updated_at_micros: Option, + pub updated_at_micros: Option::, } + impl __sdk::InModule for RuntimeProfileDashboardSnapshot { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_play_stats_get_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_play_stats_get_input_type.rs index 825a6707..99665ea0 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_play_stats_get_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_play_stats_get_input_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -10,6 +16,8 @@ pub struct RuntimeProfilePlayStatsGetInput { pub user_id: String, } + impl __sdk::InModule for RuntimeProfilePlayStatsGetInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_play_stats_procedure_result_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_play_stats_procedure_result_type.rs index 5572f438..24044b8b 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_play_stats_procedure_result_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_play_stats_procedure_result_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_profile_play_stats_snapshot_type::RuntimeProfilePlayStatsSnapshot; @@ -10,10 +15,12 @@ use super::runtime_profile_play_stats_snapshot_type::RuntimeProfilePlayStatsSnap #[sats(crate = __lib)] pub struct RuntimeProfilePlayStatsProcedureResult { pub ok: bool, - pub record: Option, - pub error_message: Option, + pub record: Option::, + pub error_message: Option::, } + impl __sdk::InModule for RuntimeProfilePlayStatsProcedureResult { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_play_stats_snapshot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_play_stats_snapshot_type.rs index 472a99c0..e99d2e72 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_play_stats_snapshot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_play_stats_snapshot_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_profile_played_world_snapshot_type::RuntimeProfilePlayedWorldSnapshot; @@ -11,10 +16,12 @@ use super::runtime_profile_played_world_snapshot_type::RuntimeProfilePlayedWorld pub struct RuntimeProfilePlayStatsSnapshot { pub user_id: String, pub total_play_time_ms: u64, - pub played_works: Vec, - pub updated_at_micros: Option, + pub played_works: Vec::, + pub updated_at_micros: Option::, } + impl __sdk::InModule for RuntimeProfilePlayStatsSnapshot { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_played_world_snapshot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_played_world_snapshot_type.rs index fa6c1d2c..f642a84d 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_played_world_snapshot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_played_world_snapshot_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -10,9 +16,9 @@ pub struct RuntimeProfilePlayedWorldSnapshot { pub played_world_id: String, pub user_id: String, pub world_key: String, - pub owner_user_id: Option, - pub profile_id: Option, - pub world_type: Option, + pub owner_user_id: Option::, + pub profile_id: Option::, + pub world_type: Option::, pub world_title: String, pub world_subtitle: String, pub first_played_at_micros: i64, @@ -20,6 +26,8 @@ pub struct RuntimeProfilePlayedWorldSnapshot { pub last_observed_play_time_ms: u64, } + impl __sdk::InModule for RuntimeProfilePlayedWorldSnapshot { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_save_archive_list_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_save_archive_list_input_type.rs new file mode 100644 index 00000000..89524eb1 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_save_archive_list_input_type.rs @@ -0,0 +1,23 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use spacetimedb_sdk::__codegen::{ + self as __sdk, + __lib, + __sats, + __ws, +}; + + +#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] +#[sats(crate = __lib)] +pub struct RuntimeProfileSaveArchiveListInput { + pub user_id: String, +} + + +impl __sdk::InModule for RuntimeProfileSaveArchiveListInput { + type Module = super::RemoteModule; +} + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_save_archive_procedure_result_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_save_archive_procedure_result_type.rs new file mode 100644 index 00000000..7c8e7b07 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_save_archive_procedure_result_type.rs @@ -0,0 +1,29 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use spacetimedb_sdk::__codegen::{ + self as __sdk, + __lib, + __sats, + __ws, +}; + +use super::runtime_snapshot_type::RuntimeSnapshot; +use super::runtime_profile_save_archive_snapshot_type::RuntimeProfileSaveArchiveSnapshot; + +#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] +#[sats(crate = __lib)] +pub struct RuntimeProfileSaveArchiveProcedureResult { + pub ok: bool, + pub entries: Vec::, + pub record: Option::, + pub current_snapshot: Option::, + pub error_message: Option::, +} + + +impl __sdk::InModule for RuntimeProfileSaveArchiveProcedureResult { + type Module = super::RemoteModule; +} + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_save_archive_resume_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_save_archive_resume_input_type.rs new file mode 100644 index 00000000..a290bf1f --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_save_archive_resume_input_type.rs @@ -0,0 +1,24 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use spacetimedb_sdk::__codegen::{ + self as __sdk, + __lib, + __sats, + __ws, +}; + + +#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] +#[sats(crate = __lib)] +pub struct RuntimeProfileSaveArchiveResumeInput { + pub user_id: String, + pub world_key: String, +} + + +impl __sdk::InModule for RuntimeProfileSaveArchiveResumeInput { + type Module = super::RemoteModule; +} + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_save_archive_snapshot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_save_archive_snapshot_type.rs new file mode 100644 index 00000000..d88a1fab --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_save_archive_snapshot_type.rs @@ -0,0 +1,38 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use spacetimedb_sdk::__codegen::{ + self as __sdk, + __lib, + __sats, + __ws, +}; + + +#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] +#[sats(crate = __lib)] +pub struct RuntimeProfileSaveArchiveSnapshot { + pub archive_id: String, + pub user_id: String, + pub world_key: String, + pub owner_user_id: Option::, + pub profile_id: Option::, + pub world_type: Option::, + pub world_name: String, + pub subtitle: String, + pub summary_text: String, + pub cover_image_src: Option::, + pub saved_at_micros: i64, + pub bottom_tab: String, + pub game_state_json: String, + pub current_story_json: Option::, + pub created_at_micros: i64, + pub updated_at_micros: i64, +} + + +impl __sdk::InModule for RuntimeProfileSaveArchiveSnapshot { + type Module = super::RemoteModule; +} + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_wallet_ledger_entry_snapshot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_wallet_ledger_entry_snapshot_type.rs index 8513884e..e4aa66b2 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_wallet_ledger_entry_snapshot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_wallet_ledger_entry_snapshot_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_profile_wallet_ledger_source_type_type::RuntimeProfileWalletLedgerSourceType; @@ -17,6 +22,8 @@ pub struct RuntimeProfileWalletLedgerEntrySnapshot { pub created_at_micros: i64, } + impl __sdk::InModule for RuntimeProfileWalletLedgerEntrySnapshot { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_wallet_ledger_list_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_wallet_ledger_list_input_type.rs index e8a1c111..10d9d0ff 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_wallet_ledger_list_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_wallet_ledger_list_input_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -10,6 +16,8 @@ pub struct RuntimeProfileWalletLedgerListInput { pub user_id: String, } + impl __sdk::InModule for RuntimeProfileWalletLedgerListInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_wallet_ledger_procedure_result_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_wallet_ledger_procedure_result_type.rs index 1c0a2b05..809092ae 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_wallet_ledger_procedure_result_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_wallet_ledger_procedure_result_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_profile_wallet_ledger_entry_snapshot_type::RuntimeProfileWalletLedgerEntrySnapshot; @@ -10,10 +15,12 @@ use super::runtime_profile_wallet_ledger_entry_snapshot_type::RuntimeProfileWall #[sats(crate = __lib)] pub struct RuntimeProfileWalletLedgerProcedureResult { pub ok: bool, - pub entries: Vec, - pub error_message: Option, + pub entries: Vec::, + pub error_message: Option::, } + impl __sdk::InModule for RuntimeProfileWalletLedgerProcedureResult { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_wallet_ledger_source_type_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_wallet_ledger_source_type_type.rs index 2b98f5ef..23e8f759 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_wallet_ledger_source_type_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_profile_wallet_ledger_source_type_type.rs @@ -2,15 +2,24 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] #[derive(Copy, Eq, Hash)] pub enum RuntimeProfileWalletLedgerSourceType { SnapshotSync, + } + + impl __sdk::InModule for RuntimeProfileWalletLedgerSourceType { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_setting_get_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_setting_get_input_type.rs index 1b83318a..555c7863 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/runtime_setting_get_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_setting_get_input_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -10,6 +16,8 @@ pub struct RuntimeSettingGetInput { pub user_id: String, } + impl __sdk::InModule for RuntimeSettingGetInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_setting_procedure_result_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_setting_procedure_result_type.rs index 792e33d4..e823af97 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/runtime_setting_procedure_result_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_setting_procedure_result_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_setting_snapshot_type::RuntimeSettingSnapshot; @@ -10,10 +15,12 @@ use super::runtime_setting_snapshot_type::RuntimeSettingSnapshot; #[sats(crate = __lib)] pub struct RuntimeSettingProcedureResult { pub ok: bool, - pub record: Option, - pub error_message: Option, + pub record: Option::, + pub error_message: Option::, } + impl __sdk::InModule for RuntimeSettingProcedureResult { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_setting_snapshot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_setting_snapshot_type.rs index 5d92990f..6d6ebae1 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/runtime_setting_snapshot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_setting_snapshot_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_platform_theme_type::RuntimePlatformTheme; @@ -16,6 +21,8 @@ pub struct RuntimeSettingSnapshot { pub updated_at_micros: i64, } + impl __sdk::InModule for RuntimeSettingSnapshot { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_setting_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_setting_table.rs index dc1ed5bb..cc7fac56 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/runtime_setting_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_setting_table.rs @@ -2,9 +2,14 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![allow(unused, clippy::all)] -use super::runtime_platform_theme_type::RuntimePlatformTheme; +use spacetimedb_sdk::__codegen::{ + self as __sdk, + __lib, + __sats, + __ws, +}; use super::runtime_setting_type::RuntimeSetting; -use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; +use super::runtime_platform_theme_type::RuntimePlatformTheme; /// Table handle for the table `runtime_setting`. /// @@ -45,12 +50,8 @@ impl<'ctx> __sdk::Table for RuntimeSettingTableHandle<'ctx> { type Row = RuntimeSetting; type EventContext = super::EventContext; - fn count(&self) -> u64 { - self.imp.count() - } - fn iter(&self) -> impl Iterator + '_ { - self.imp.iter() - } + fn count(&self) -> u64 { self.imp.count() } + fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } type InsertCallbackId = RuntimeSettingInsertCallbackId; @@ -96,38 +97,39 @@ impl<'ctx> __sdk::TableWithPrimaryKey for RuntimeSettingTableHandle<'ctx> { } } -/// Access to the `user_id` unique index on the table `runtime_setting`, -/// which allows point queries on the field of the same name -/// via the [`RuntimeSettingUserIdUnique::find`] method. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.runtime_setting().user_id().find(...)`. -pub struct RuntimeSettingUserIdUnique<'ctx> { - imp: __sdk::UniqueConstraintHandle, - phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, -} - -impl<'ctx> RuntimeSettingTableHandle<'ctx> { - /// Get a handle on the `user_id` unique index on the table `runtime_setting`. - pub fn user_id(&self) -> RuntimeSettingUserIdUnique<'ctx> { - RuntimeSettingUserIdUnique { - imp: self.imp.get_unique_constraint::("user_id"), - phantom: std::marker::PhantomData, + /// Access to the `user_id` unique index on the table `runtime_setting`, + /// which allows point queries on the field of the same name + /// via the [`RuntimeSettingUserIdUnique::find`] method. + /// + /// Users are encouraged not to explicitly reference this type, + /// but to directly chain method calls, + /// like `ctx.db.runtime_setting().user_id().find(...)`. + pub struct RuntimeSettingUserIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } - } -} -impl<'ctx> RuntimeSettingUserIdUnique<'ctx> { - /// Find the subscribed row whose `user_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 { - self.imp.find(col_val) - } -} + impl<'ctx> RuntimeSettingTableHandle<'ctx> { + /// Get a handle on the `user_id` unique index on the table `runtime_setting`. + pub fn user_id(&self) -> RuntimeSettingUserIdUnique<'ctx> { + RuntimeSettingUserIdUnique { + imp: self.imp.get_unique_constraint::("user_id"), + phantom: std::marker::PhantomData, + } + } + } + impl<'ctx> RuntimeSettingUserIdUnique<'ctx> { + /// Find the subscribed row whose `user_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 { + self.imp.find(col_val) + } + } + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("runtime_setting"); _table.add_unique_constraint::("user_id", |row| &row.user_id); } @@ -137,24 +139,26 @@ pub(super) fn parse_table_update( raw_updates: __ws::v2::TableUpdate, ) -> __sdk::Result<__sdk::TableUpdate> { __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { - __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") - .with_cause(e) - .into() + __sdk::InternalError::failed_parse( + "TableUpdate", + "TableUpdate", + ).with_cause(e).into() }) } -#[allow(non_camel_case_types)] -/// Extension trait for query builder access to the table `RuntimeSetting`. -/// -/// Implemented for [`__sdk::QueryTableAccessor`]. -pub trait runtime_settingQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `RuntimeSetting`. - fn runtime_setting(&self) -> __sdk::__query_builder::Table; -} + #[allow(non_camel_case_types)] + /// Extension trait for query builder access to the table `RuntimeSetting`. + /// + /// Implemented for [`__sdk::QueryTableAccessor`]. + pub trait runtime_settingQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `RuntimeSetting`. + fn runtime_setting(&self) -> __sdk::__query_builder::Table; + } + + impl runtime_settingQueryTableAccess for __sdk::QueryTableAccessor { + fn runtime_setting(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("runtime_setting") + } + } -impl runtime_settingQueryTableAccess for __sdk::QueryTableAccessor { - fn runtime_setting(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("runtime_setting") - } -} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_setting_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_setting_type.rs index 5a7b61b0..f3c72f73 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/runtime_setting_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_setting_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_platform_theme_type::RuntimePlatformTheme; @@ -16,10 +21,12 @@ pub struct RuntimeSetting { pub updated_at: __sdk::Timestamp, } + impl __sdk::InModule for RuntimeSetting { type Module = super::RemoteModule; } + /// Column accessor struct for the table `RuntimeSetting`. /// /// Provides typed access to columns for query building. @@ -40,6 +47,7 @@ impl __sdk::__query_builder::HasCols for RuntimeSetting { platform_theme: __sdk::__query_builder::Col::new(table_name, "platform_theme"), created_at: __sdk::__query_builder::Col::new(table_name, "created_at"), updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"), + } } } @@ -56,8 +64,10 @@ impl __sdk::__query_builder::HasIxCols for RuntimeSetting { fn ix_cols(table_name: &'static str) -> Self::IxCols { RuntimeSettingIxCols { user_id: __sdk::__query_builder::IxCol::new(table_name, "user_id"), + } } } impl __sdk::__query_builder::CanBeLookupTable for RuntimeSetting {} + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_setting_upsert_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_setting_upsert_input_type.rs index 7091bc8d..347e1675 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/runtime_setting_upsert_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_setting_upsert_input_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_platform_theme_type::RuntimePlatformTheme; @@ -15,6 +20,8 @@ pub struct RuntimeSettingUpsertInput { pub updated_at_micros: i64, } + impl __sdk::InModule for RuntimeSettingUpsertInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_snapshot_delete_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_snapshot_delete_input_type.rs new file mode 100644 index 00000000..251417e4 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_snapshot_delete_input_type.rs @@ -0,0 +1,23 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use spacetimedb_sdk::__codegen::{ + self as __sdk, + __lib, + __sats, + __ws, +}; + + +#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] +#[sats(crate = __lib)] +pub struct RuntimeSnapshotDeleteInput { + pub user_id: String, +} + + +impl __sdk::InModule for RuntimeSnapshotDeleteInput { + type Module = super::RemoteModule; +} + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_snapshot_get_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_snapshot_get_input_type.rs new file mode 100644 index 00000000..7340dbf6 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_snapshot_get_input_type.rs @@ -0,0 +1,23 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use spacetimedb_sdk::__codegen::{ + self as __sdk, + __lib, + __sats, + __ws, +}; + + +#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] +#[sats(crate = __lib)] +pub struct RuntimeSnapshotGetInput { + pub user_id: String, +} + + +impl __sdk::InModule for RuntimeSnapshotGetInput { + type Module = super::RemoteModule; +} + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_snapshot_procedure_result_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_snapshot_procedure_result_type.rs new file mode 100644 index 00000000..466a3e41 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_snapshot_procedure_result_type.rs @@ -0,0 +1,26 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use spacetimedb_sdk::__codegen::{ + self as __sdk, + __lib, + __sats, + __ws, +}; + +use super::runtime_snapshot_type::RuntimeSnapshot; + +#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] +#[sats(crate = __lib)] +pub struct RuntimeSnapshotProcedureResult { + pub ok: bool, + pub record: Option::, + pub error_message: Option::, +} + + +impl __sdk::InModule for RuntimeSnapshotProcedureResult { + type Module = super::RemoteModule; +} + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_snapshot_row_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_snapshot_row_type.rs new file mode 100644 index 00000000..8eec233a --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_snapshot_row_type.rs @@ -0,0 +1,81 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use spacetimedb_sdk::__codegen::{ + self as __sdk, + __lib, + __sats, + __ws, +}; + + +#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] +#[sats(crate = __lib)] +pub struct RuntimeSnapshotRow { + pub user_id: String, + pub version: u32, + pub saved_at: __sdk::Timestamp, + pub bottom_tab: String, + pub game_state_json: String, + pub current_story_json: Option::, + pub created_at: __sdk::Timestamp, + pub updated_at: __sdk::Timestamp, +} + + +impl __sdk::InModule for RuntimeSnapshotRow { + type Module = super::RemoteModule; +} + + +/// Column accessor struct for the table `RuntimeSnapshotRow`. +/// +/// Provides typed access to columns for query building. +pub struct RuntimeSnapshotRowCols { + pub user_id: __sdk::__query_builder::Col, + pub version: __sdk::__query_builder::Col, + pub saved_at: __sdk::__query_builder::Col, + pub bottom_tab: __sdk::__query_builder::Col, + pub game_state_json: __sdk::__query_builder::Col, + pub current_story_json: __sdk::__query_builder::Col>, + pub created_at: __sdk::__query_builder::Col, + pub updated_at: __sdk::__query_builder::Col, +} + +impl __sdk::__query_builder::HasCols for RuntimeSnapshotRow { + type Cols = RuntimeSnapshotRowCols; + fn cols(table_name: &'static str) -> Self::Cols { + RuntimeSnapshotRowCols { + user_id: __sdk::__query_builder::Col::new(table_name, "user_id"), + version: __sdk::__query_builder::Col::new(table_name, "version"), + saved_at: __sdk::__query_builder::Col::new(table_name, "saved_at"), + bottom_tab: __sdk::__query_builder::Col::new(table_name, "bottom_tab"), + game_state_json: __sdk::__query_builder::Col::new(table_name, "game_state_json"), + current_story_json: __sdk::__query_builder::Col::new(table_name, "current_story_json"), + created_at: __sdk::__query_builder::Col::new(table_name, "created_at"), + updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"), + + } + } +} + +/// Indexed column accessor struct for the table `RuntimeSnapshotRow`. +/// +/// Provides typed access to indexed columns for query building. +pub struct RuntimeSnapshotRowIxCols { + pub user_id: __sdk::__query_builder::IxCol, +} + +impl __sdk::__query_builder::HasIxCols for RuntimeSnapshotRow { + type IxCols = RuntimeSnapshotRowIxCols; + fn ix_cols(table_name: &'static str) -> Self::IxCols { + RuntimeSnapshotRowIxCols { + user_id: __sdk::__query_builder::IxCol::new(table_name, "user_id"), + + } + } +} + +impl __sdk::__query_builder::CanBeLookupTable for RuntimeSnapshotRow {} + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_snapshot_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_snapshot_table.rs new file mode 100644 index 00000000..ea6106d1 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_snapshot_table.rs @@ -0,0 +1,163 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use spacetimedb_sdk::__codegen::{ + self as __sdk, + __lib, + __sats, + __ws, +}; +use super::runtime_snapshot_row_type::RuntimeSnapshotRow; + +/// Table handle for the table `runtime_snapshot`. +/// +/// Obtain a handle from the [`RuntimeSnapshotTableAccess::runtime_snapshot`] method on [`super::RemoteTables`], +/// like `ctx.db.runtime_snapshot()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.runtime_snapshot().on_insert(...)`. +pub struct RuntimeSnapshotTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `runtime_snapshot`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait RuntimeSnapshotTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`RuntimeSnapshotTableHandle`], which mediates access to the table `runtime_snapshot`. + fn runtime_snapshot(&self) -> RuntimeSnapshotTableHandle<'_>; +} + +impl RuntimeSnapshotTableAccess for super::RemoteTables { + fn runtime_snapshot(&self) -> RuntimeSnapshotTableHandle<'_> { + RuntimeSnapshotTableHandle { + imp: self.imp.get_table::("runtime_snapshot"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct RuntimeSnapshotInsertCallbackId(__sdk::CallbackId); +pub struct RuntimeSnapshotDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for RuntimeSnapshotTableHandle<'ctx> { + type Row = RuntimeSnapshotRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { self.imp.count() } + fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } + + type InsertCallbackId = RuntimeSnapshotInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> RuntimeSnapshotInsertCallbackId { + RuntimeSnapshotInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: RuntimeSnapshotInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = RuntimeSnapshotDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> RuntimeSnapshotDeleteCallbackId { + RuntimeSnapshotDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: RuntimeSnapshotDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct RuntimeSnapshotUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for RuntimeSnapshotTableHandle<'ctx> { + type UpdateCallbackId = RuntimeSnapshotUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> RuntimeSnapshotUpdateCallbackId { + RuntimeSnapshotUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: RuntimeSnapshotUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + + /// Access to the `user_id` unique index on the table `runtime_snapshot`, + /// which allows point queries on the field of the same name + /// via the [`RuntimeSnapshotUserIdUnique::find`] method. + /// + /// Users are encouraged not to explicitly reference this type, + /// but to directly chain method calls, + /// like `ctx.db.runtime_snapshot().user_id().find(...)`. + pub struct RuntimeSnapshotUserIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, + } + + impl<'ctx> RuntimeSnapshotTableHandle<'ctx> { + /// Get a handle on the `user_id` unique index on the table `runtime_snapshot`. + pub fn user_id(&self) -> RuntimeSnapshotUserIdUnique<'ctx> { + RuntimeSnapshotUserIdUnique { + imp: self.imp.get_unique_constraint::("user_id"), + phantom: std::marker::PhantomData, + } + } + } + + impl<'ctx> RuntimeSnapshotUserIdUnique<'ctx> { + /// Find the subscribed row whose `user_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 { + self.imp.find(col_val) + } + } + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + + let _table = client_cache.get_or_make_table::("runtime_snapshot"); + _table.add_unique_constraint::("user_id", |row| &row.user_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse( + "TableUpdate", + "TableUpdate", + ).with_cause(e).into() + }) +} + + #[allow(non_camel_case_types)] + /// Extension trait for query builder access to the table `RuntimeSnapshotRow`. + /// + /// Implemented for [`__sdk::QueryTableAccessor`]. + pub trait runtime_snapshotQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `RuntimeSnapshotRow`. + fn runtime_snapshot(&self) -> __sdk::__query_builder::Table; + } + + impl runtime_snapshotQueryTableAccess for __sdk::QueryTableAccessor { + fn runtime_snapshot(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("runtime_snapshot") + } + } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_snapshot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_snapshot_type.rs new file mode 100644 index 00000000..e8ede33b --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_snapshot_type.rs @@ -0,0 +1,30 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use spacetimedb_sdk::__codegen::{ + self as __sdk, + __lib, + __sats, + __ws, +}; + + +#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] +#[sats(crate = __lib)] +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::, + pub created_at_micros: i64, + pub updated_at_micros: i64, +} + + +impl __sdk::InModule for RuntimeSnapshot { + type Module = super::RemoteModule; +} + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_snapshot_upsert_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_snapshot_upsert_input_type.rs new file mode 100644 index 00000000..2379473f --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_snapshot_upsert_input_type.rs @@ -0,0 +1,28 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use spacetimedb_sdk::__codegen::{ + self as __sdk, + __lib, + __sats, + __ws, +}; + + +#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] +#[sats(crate = __lib)] +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::, + pub updated_at_micros: i64, +} + + +impl __sdk::InModule for RuntimeSnapshotUpsertInput { + type Module = super::RemoteModule; +} + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/start_ai_task_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/start_ai_task_reducer.rs index 5809736b..44e89238 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/start_ai_task_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/start_ai_task_reducer.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_start_input_type::AiTaskStartInput; @@ -14,8 +19,10 @@ pub(super) struct StartAiTaskArgs { impl From for super::Reducer { fn from(args: StartAiTaskArgs) -> Self { - Self::StartAiTask { input: args.input } - } + Self::StartAiTask { + input: args.input, +} +} } impl __sdk::InModule for StartAiTaskArgs { @@ -33,8 +40,9 @@ pub trait start_ai_task { /// The reducer will run asynchronously in the future, /// and this method provides no way to listen for its completion status. /// /// Use [`start_ai_task:start_ai_task_then`] to run a callback after the reducer completes. - fn start_ai_task(&self, input: AiTaskStartInput) -> __sdk::Result<()> { - self.start_ai_task_then(input, |_, _| {}) + fn start_ai_task(&self, input: AiTaskStartInput, +) -> __sdk::Result<()> { + self.start_ai_task_then(input, |_, _| {}) } /// Request that the remote module invoke the reducer `start_ai_task` to run as soon as possible, @@ -62,7 +70,7 @@ impl start_ai_task for super::RemoteReducers { + Send + 'static, ) -> __sdk::Result<()> { - self.imp - .invoke_reducer_with_callback(StartAiTaskArgs { input }, callback) + self.imp.invoke_reducer_with_callback(StartAiTaskArgs { input, }, callback) } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/start_ai_task_stage_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/start_ai_task_stage_reducer.rs index 1d7b7582..74b85d62 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/start_ai_task_stage_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/start_ai_task_stage_reducer.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_start_input_type::AiTaskStageStartInput; @@ -14,8 +19,10 @@ pub(super) struct StartAiTaskStageArgs { impl From for super::Reducer { fn from(args: StartAiTaskStageArgs) -> Self { - Self::StartAiTaskStage { input: args.input } - } + Self::StartAiTaskStage { + input: args.input, +} +} } impl __sdk::InModule for StartAiTaskStageArgs { @@ -33,8 +40,9 @@ pub trait start_ai_task_stage { /// The reducer will run asynchronously in the future, /// and this method provides no way to listen for its completion status. /// /// Use [`start_ai_task_stage:start_ai_task_stage_then`] to run a callback after the reducer completes. - fn start_ai_task_stage(&self, input: AiTaskStageStartInput) -> __sdk::Result<()> { - self.start_ai_task_stage_then(input, |_, _| {}) + fn start_ai_task_stage(&self, input: AiTaskStageStartInput, +) -> __sdk::Result<()> { + self.start_ai_task_stage_then(input, |_, _| {}) } /// Request that the remote module invoke the reducer `start_ai_task_stage` to run as soon as possible, @@ -62,7 +70,7 @@ impl start_ai_task_stage for super::RemoteReducers { + Send + 'static, ) -> __sdk::Result<()> { - self.imp - .invoke_reducer_with_callback(StartAiTaskStageArgs { input }, callback) + self.imp.invoke_reducer_with_callback(StartAiTaskStageArgs { input, }, callback) } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/story_continue_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/story_continue_input_type.rs index e0b3f730..d84dde42 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/story_continue_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/story_continue_input_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -10,10 +16,12 @@ pub struct StoryContinueInput { pub story_session_id: String, pub event_id: String, pub narrative_text: String, - pub choice_function_id: Option, + pub choice_function_id: Option::, pub updated_at_micros: i64, } + impl __sdk::InModule for StoryContinueInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/story_event_kind_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/story_event_kind_type.rs index 29836b4a..1072867e 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/story_event_kind_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/story_event_kind_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -11,8 +16,12 @@ pub enum StoryEventKind { SessionStarted, StoryContinued, + } + + impl __sdk::InModule for StoryEventKind { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/story_event_snapshot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/story_event_snapshot_type.rs index 881799d5..4afacc4a 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/story_event_snapshot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/story_event_snapshot_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_event_kind_type::StoryEventKind; @@ -13,10 +18,12 @@ pub struct StoryEventSnapshot { pub story_session_id: String, pub event_kind: StoryEventKind, pub narrative_text: String, - pub choice_function_id: Option, + pub choice_function_id: Option::, pub created_at_micros: i64, } + impl __sdk::InModule for StoryEventSnapshot { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/story_event_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/story_event_table.rs index 232a554e..b702797b 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/story_event_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/story_event_table.rs @@ -2,9 +2,14 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![allow(unused, clippy::all)] -use super::story_event_kind_type::StoryEventKind; +use spacetimedb_sdk::__codegen::{ + self as __sdk, + __lib, + __sats, + __ws, +}; use super::story_event_type::StoryEvent; -use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; +use super::story_event_kind_type::StoryEventKind; /// Table handle for the table `story_event`. /// @@ -45,12 +50,8 @@ impl<'ctx> __sdk::Table for StoryEventTableHandle<'ctx> { type Row = StoryEvent; type EventContext = super::EventContext; - fn count(&self) -> u64 { - self.imp.count() - } - fn iter(&self) -> impl Iterator + '_ { - self.imp.iter() - } + fn count(&self) -> u64 { self.imp.count() } + fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } type InsertCallbackId = StoryEventInsertCallbackId; @@ -96,38 +97,39 @@ impl<'ctx> __sdk::TableWithPrimaryKey for StoryEventTableHandle<'ctx> { } } -/// Access to the `event_id` unique index on the table `story_event`, -/// which allows point queries on the field of the same name -/// via the [`StoryEventEventIdUnique::find`] method. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.story_event().event_id().find(...)`. -pub struct StoryEventEventIdUnique<'ctx> { - imp: __sdk::UniqueConstraintHandle, - phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, -} - -impl<'ctx> StoryEventTableHandle<'ctx> { - /// Get a handle on the `event_id` unique index on the table `story_event`. - pub fn event_id(&self) -> StoryEventEventIdUnique<'ctx> { - StoryEventEventIdUnique { - imp: self.imp.get_unique_constraint::("event_id"), - phantom: std::marker::PhantomData, + /// Access to the `event_id` unique index on the table `story_event`, + /// which allows point queries on the field of the same name + /// via the [`StoryEventEventIdUnique::find`] method. + /// + /// Users are encouraged not to explicitly reference this type, + /// but to directly chain method calls, + /// like `ctx.db.story_event().event_id().find(...)`. + pub struct StoryEventEventIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } - } -} -impl<'ctx> StoryEventEventIdUnique<'ctx> { - /// Find the subscribed row whose `event_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 { - self.imp.find(col_val) - } -} + impl<'ctx> StoryEventTableHandle<'ctx> { + /// Get a handle on the `event_id` unique index on the table `story_event`. + pub fn event_id(&self) -> StoryEventEventIdUnique<'ctx> { + StoryEventEventIdUnique { + imp: self.imp.get_unique_constraint::("event_id"), + phantom: std::marker::PhantomData, + } + } + } + impl<'ctx> StoryEventEventIdUnique<'ctx> { + /// Find the subscribed row whose `event_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 { + self.imp.find(col_val) + } + } + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("story_event"); _table.add_unique_constraint::("event_id", |row| &row.event_id); } @@ -137,24 +139,26 @@ pub(super) fn parse_table_update( raw_updates: __ws::v2::TableUpdate, ) -> __sdk::Result<__sdk::TableUpdate> { __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { - __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") - .with_cause(e) - .into() + __sdk::InternalError::failed_parse( + "TableUpdate", + "TableUpdate", + ).with_cause(e).into() }) } -#[allow(non_camel_case_types)] -/// Extension trait for query builder access to the table `StoryEvent`. -/// -/// Implemented for [`__sdk::QueryTableAccessor`]. -pub trait story_eventQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `StoryEvent`. - fn story_event(&self) -> __sdk::__query_builder::Table; -} + #[allow(non_camel_case_types)] + /// Extension trait for query builder access to the table `StoryEvent`. + /// + /// Implemented for [`__sdk::QueryTableAccessor`]. + pub trait story_eventQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `StoryEvent`. + fn story_event(&self) -> __sdk::__query_builder::Table; + } + + impl story_eventQueryTableAccess for __sdk::QueryTableAccessor { + fn story_event(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("story_event") + } + } -impl story_eventQueryTableAccess for __sdk::QueryTableAccessor { - fn story_event(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("story_event") - } -} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/story_event_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/story_event_type.rs index 4d3bdd9f..3c9c102d 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/story_event_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/story_event_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_event_kind_type::StoryEventKind; @@ -13,14 +18,16 @@ pub struct StoryEvent { pub story_session_id: String, pub event_kind: StoryEventKind, pub narrative_text: String, - pub choice_function_id: Option, + pub choice_function_id: Option::, pub created_at: __sdk::Timestamp, } + impl __sdk::InModule for StoryEvent { type Module = super::RemoteModule; } + /// Column accessor struct for the table `StoryEvent`. /// /// Provides typed access to columns for query building. @@ -29,7 +36,7 @@ pub struct StoryEventCols { pub story_session_id: __sdk::__query_builder::Col, pub event_kind: __sdk::__query_builder::Col, pub narrative_text: __sdk::__query_builder::Col, - pub choice_function_id: __sdk::__query_builder::Col>, + pub choice_function_id: __sdk::__query_builder::Col>, pub created_at: __sdk::__query_builder::Col, } @@ -43,6 +50,7 @@ impl __sdk::__query_builder::HasCols for StoryEvent { narrative_text: __sdk::__query_builder::Col::new(table_name, "narrative_text"), choice_function_id: __sdk::__query_builder::Col::new(table_name, "choice_function_id"), created_at: __sdk::__query_builder::Col::new(table_name, "created_at"), + } } } @@ -61,8 +69,10 @@ impl __sdk::__query_builder::HasIxCols for StoryEvent { StoryEventIxCols { event_id: __sdk::__query_builder::IxCol::new(table_name, "event_id"), story_session_id: __sdk::__query_builder::IxCol::new(table_name, "story_session_id"), + } } } impl __sdk::__query_builder::CanBeLookupTable for StoryEvent {} + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/story_session_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/story_session_input_type.rs index bebf3267..260fc1e4 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/story_session_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/story_session_input_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -12,10 +18,12 @@ pub struct StorySessionInput { pub actor_user_id: String, pub world_profile_id: String, pub initial_prompt: String, - pub opening_summary: Option, + pub opening_summary: Option::, pub created_at_micros: i64, } + impl __sdk::InModule for StorySessionInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/story_session_procedure_result_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/story_session_procedure_result_type.rs index 4548d9cc..3e1cfa4f 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/story_session_procedure_result_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/story_session_procedure_result_type.rs @@ -2,20 +2,27 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_event_snapshot_type::StoryEventSnapshot; use super::story_session_snapshot_type::StorySessionSnapshot; +use super::story_event_snapshot_type::StoryEventSnapshot; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] pub struct StorySessionProcedureResult { pub ok: bool, - pub session: Option, - pub event: Option, - pub error_message: Option, + pub session: Option::, + pub event: Option::, + pub error_message: Option::, } + impl __sdk::InModule for StorySessionProcedureResult { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/story_session_snapshot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/story_session_snapshot_type.rs index b8d2daf6..46f1072f 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/story_session_snapshot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/story_session_snapshot_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_status_type::StorySessionStatus; @@ -14,15 +19,17 @@ pub struct StorySessionSnapshot { pub actor_user_id: String, pub world_profile_id: String, pub initial_prompt: String, - pub opening_summary: Option, + pub opening_summary: Option::, pub latest_narrative_text: String, - pub latest_choice_function_id: Option, + pub latest_choice_function_id: Option::, pub status: StorySessionStatus, pub version: u32, pub created_at_micros: i64, pub updated_at_micros: i64, } + impl __sdk::InModule for StorySessionSnapshot { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/story_session_state_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/story_session_state_input_type.rs index d860b7db..5e4e1476 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/story_session_state_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/story_session_state_input_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -10,6 +16,8 @@ pub struct StorySessionStateInput { pub story_session_id: String, } + impl __sdk::InModule for StorySessionStateInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/story_session_state_procedure_result_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/story_session_state_procedure_result_type.rs index cf2148d6..c33c4c77 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/story_session_state_procedure_result_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/story_session_state_procedure_result_type.rs @@ -2,20 +2,27 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_event_snapshot_type::StoryEventSnapshot; use super::story_session_snapshot_type::StorySessionSnapshot; +use super::story_event_snapshot_type::StoryEventSnapshot; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] pub struct StorySessionStateProcedureResult { pub ok: bool, - pub session: Option, - pub events: Vec, - pub error_message: Option, + pub session: Option::, + pub events: Vec::, + pub error_message: Option::, } + impl __sdk::InModule for StorySessionStateProcedureResult { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/story_session_status_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/story_session_status_type.rs index f04aae19..334433fa 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/story_session_status_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/story_session_status_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -13,8 +18,12 @@ pub enum StorySessionStatus { Completed, Archived, + } + + impl __sdk::InModule for StorySessionStatus { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/story_session_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/story_session_table.rs index 142f7fa1..d3b4dd67 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/story_session_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/story_session_table.rs @@ -2,9 +2,14 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![allow(unused, clippy::all)] -use super::story_session_status_type::StorySessionStatus; +use spacetimedb_sdk::__codegen::{ + self as __sdk, + __lib, + __sats, + __ws, +}; use super::story_session_type::StorySession; -use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; +use super::story_session_status_type::StorySessionStatus; /// Table handle for the table `story_session`. /// @@ -45,12 +50,8 @@ impl<'ctx> __sdk::Table for StorySessionTableHandle<'ctx> { type Row = StorySession; type EventContext = super::EventContext; - fn count(&self) -> u64 { - self.imp.count() - } - fn iter(&self) -> impl Iterator + '_ { - self.imp.iter() - } + fn count(&self) -> u64 { self.imp.count() } + fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } type InsertCallbackId = StorySessionInsertCallbackId; @@ -96,38 +97,39 @@ impl<'ctx> __sdk::TableWithPrimaryKey for StorySessionTableHandle<'ctx> { } } -/// Access to the `story_session_id` unique index on the table `story_session`, -/// which allows point queries on the field of the same name -/// via the [`StorySessionStorySessionIdUnique::find`] method. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.story_session().story_session_id().find(...)`. -pub struct StorySessionStorySessionIdUnique<'ctx> { - imp: __sdk::UniqueConstraintHandle, - phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, -} - -impl<'ctx> StorySessionTableHandle<'ctx> { - /// Get a handle on the `story_session_id` unique index on the table `story_session`. - pub fn story_session_id(&self) -> StorySessionStorySessionIdUnique<'ctx> { - StorySessionStorySessionIdUnique { - imp: self.imp.get_unique_constraint::("story_session_id"), - phantom: std::marker::PhantomData, + /// Access to the `story_session_id` unique index on the table `story_session`, + /// which allows point queries on the field of the same name + /// via the [`StorySessionStorySessionIdUnique::find`] method. + /// + /// Users are encouraged not to explicitly reference this type, + /// but to directly chain method calls, + /// like `ctx.db.story_session().story_session_id().find(...)`. + pub struct StorySessionStorySessionIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } - } -} -impl<'ctx> StorySessionStorySessionIdUnique<'ctx> { - /// Find the subscribed row whose `story_session_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 { - self.imp.find(col_val) - } -} + impl<'ctx> StorySessionTableHandle<'ctx> { + /// Get a handle on the `story_session_id` unique index on the table `story_session`. + pub fn story_session_id(&self) -> StorySessionStorySessionIdUnique<'ctx> { + StorySessionStorySessionIdUnique { + imp: self.imp.get_unique_constraint::("story_session_id"), + phantom: std::marker::PhantomData, + } + } + } + impl<'ctx> StorySessionStorySessionIdUnique<'ctx> { + /// Find the subscribed row whose `story_session_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 { + self.imp.find(col_val) + } + } + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("story_session"); _table.add_unique_constraint::("story_session_id", |row| &row.story_session_id); } @@ -137,24 +139,26 @@ pub(super) fn parse_table_update( raw_updates: __ws::v2::TableUpdate, ) -> __sdk::Result<__sdk::TableUpdate> { __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { - __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") - .with_cause(e) - .into() + __sdk::InternalError::failed_parse( + "TableUpdate", + "TableUpdate", + ).with_cause(e).into() }) } -#[allow(non_camel_case_types)] -/// Extension trait for query builder access to the table `StorySession`. -/// -/// Implemented for [`__sdk::QueryTableAccessor`]. -pub trait story_sessionQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `StorySession`. - fn story_session(&self) -> __sdk::__query_builder::Table; -} + #[allow(non_camel_case_types)] + /// Extension trait for query builder access to the table `StorySession`. + /// + /// Implemented for [`__sdk::QueryTableAccessor`]. + pub trait story_sessionQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `StorySession`. + fn story_session(&self) -> __sdk::__query_builder::Table; + } + + impl story_sessionQueryTableAccess for __sdk::QueryTableAccessor { + fn story_session(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("story_session") + } + } -impl story_sessionQueryTableAccess for __sdk::QueryTableAccessor { - fn story_session(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("story_session") - } -} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/story_session_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/story_session_type.rs index f9534179..7fd0c7e9 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/story_session_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/story_session_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_status_type::StorySessionStatus; @@ -14,19 +19,21 @@ pub struct StorySession { pub actor_user_id: String, pub world_profile_id: String, pub initial_prompt: String, - pub opening_summary: Option, + pub opening_summary: Option::, pub latest_narrative_text: String, - pub latest_choice_function_id: Option, + pub latest_choice_function_id: Option::, pub status: StorySessionStatus, pub version: u32, pub created_at: __sdk::Timestamp, pub updated_at: __sdk::Timestamp, } + impl __sdk::InModule for StorySession { type Module = super::RemoteModule; } + /// Column accessor struct for the table `StorySession`. /// /// Provides typed access to columns for query building. @@ -36,9 +43,9 @@ pub struct StorySessionCols { pub actor_user_id: __sdk::__query_builder::Col, pub world_profile_id: __sdk::__query_builder::Col, pub initial_prompt: __sdk::__query_builder::Col, - pub opening_summary: __sdk::__query_builder::Col>, + pub opening_summary: __sdk::__query_builder::Col>, pub latest_narrative_text: __sdk::__query_builder::Col, - pub latest_choice_function_id: __sdk::__query_builder::Col>, + pub latest_choice_function_id: __sdk::__query_builder::Col>, pub status: __sdk::__query_builder::Col, pub version: __sdk::__query_builder::Col, pub created_at: __sdk::__query_builder::Col, @@ -55,18 +62,13 @@ impl __sdk::__query_builder::HasCols for StorySession { world_profile_id: __sdk::__query_builder::Col::new(table_name, "world_profile_id"), initial_prompt: __sdk::__query_builder::Col::new(table_name, "initial_prompt"), opening_summary: __sdk::__query_builder::Col::new(table_name, "opening_summary"), - latest_narrative_text: __sdk::__query_builder::Col::new( - table_name, - "latest_narrative_text", - ), - latest_choice_function_id: __sdk::__query_builder::Col::new( - table_name, - "latest_choice_function_id", - ), + latest_narrative_text: __sdk::__query_builder::Col::new(table_name, "latest_narrative_text"), + latest_choice_function_id: __sdk::__query_builder::Col::new(table_name, "latest_choice_function_id"), status: __sdk::__query_builder::Col::new(table_name, "status"), version: __sdk::__query_builder::Col::new(table_name, "version"), created_at: __sdk::__query_builder::Col::new(table_name, "created_at"), updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"), + } } } @@ -85,13 +87,12 @@ impl __sdk::__query_builder::HasIxCols for StorySession { fn ix_cols(table_name: &'static str) -> Self::IxCols { StorySessionIxCols { actor_user_id: __sdk::__query_builder::IxCol::new(table_name, "actor_user_id"), - runtime_session_id: __sdk::__query_builder::IxCol::new( - table_name, - "runtime_session_id", - ), + runtime_session_id: __sdk::__query_builder::IxCol::new(table_name, "runtime_session_id"), story_session_id: __sdk::__query_builder::IxCol::new(table_name, "story_session_id"), + } } } impl __sdk::__query_builder::CanBeLookupTable for StorySession {} + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/submit_custom_world_agent_message_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/submit_custom_world_agent_message_procedure.rs index c5e8def1..efb1c0b3 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/submit_custom_world_agent_message_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/submit_custom_world_agent_message_procedure.rs @@ -2,17 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_message_submit_input_type::CustomWorldAgentMessageSubmitInput; use super::custom_world_agent_operation_procedure_result_type::CustomWorldAgentOperationProcedureResult; +use super::custom_world_agent_message_submit_input_type::CustomWorldAgentMessageSubmitInput; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct SubmitCustomWorldAgentMessageArgs { + struct SubmitCustomWorldAgentMessageArgs { pub input: CustomWorldAgentMessageSubmitInput, } + impl __sdk::InModule for SubmitCustomWorldAgentMessageArgs { type Module = super::RemoteModule; } @@ -22,19 +28,16 @@ impl __sdk::InModule for SubmitCustomWorldAgentMessageArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait submit_custom_world_agent_message { - fn submit_custom_world_agent_message(&self, input: CustomWorldAgentMessageSubmitInput) { - self.submit_custom_world_agent_message_then(input, |_, _| {}); + fn submit_custom_world_agent_message(&self, input: CustomWorldAgentMessageSubmitInput, +) { + self.submit_custom_world_agent_message_then(input, |_, _| {}); } fn submit_custom_world_agent_message_then( &self, input: CustomWorldAgentMessageSubmitInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } @@ -43,17 +46,13 @@ impl submit_custom_world_agent_message for super::RemoteProcedures { &self, input: CustomWorldAgentMessageSubmitInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, CustomWorldAgentOperationProcedureResult>( - "submit_custom_world_agent_message", - SubmitCustomWorldAgentMessageArgs { input }, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, CustomWorldAgentOperationProcedureResult>( + "submit_custom_world_agent_message", + SubmitCustomWorldAgentMessageArgs { input, }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/treasure_interaction_action_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/treasure_interaction_action_type.rs index a9b61b0e..77e48673 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/treasure_interaction_action_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/treasure_interaction_action_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -13,8 +18,12 @@ pub enum TreasureInteractionAction { Leave, Secure, + } + + impl __sdk::InModule for TreasureInteractionAction { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/treasure_record_procedure_result_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/treasure_record_procedure_result_type.rs index d0ac0175..212c4042 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/treasure_record_procedure_result_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/treasure_record_procedure_result_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::treasure_record_snapshot_type::TreasureRecordSnapshot; @@ -10,10 +15,12 @@ use super::treasure_record_snapshot_type::TreasureRecordSnapshot; #[sats(crate = __lib)] pub struct TreasureRecordProcedureResult { pub ok: bool, - pub record: Option, - pub error_message: Option, + pub record: Option::, + pub error_message: Option::, } + impl __sdk::InModule for TreasureRecordProcedureResult { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/treasure_record_snapshot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/treasure_record_snapshot_type.rs index 8d69d10e..29677339 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/treasure_record_snapshot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/treasure_record_snapshot_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_item_reward_item_snapshot_type::RuntimeItemRewardItemSnapshot; use super::treasure_interaction_action_type::TreasureInteractionAction; @@ -16,18 +21,20 @@ pub struct TreasureRecordSnapshot { pub actor_user_id: String, pub encounter_id: String, pub encounter_name: String, - pub scene_id: Option, - pub scene_name: Option, + pub scene_id: Option::, + pub scene_name: Option::, pub action: TreasureInteractionAction, - pub reward_items: Vec, + pub reward_items: Vec::, pub reward_hp: u32, pub reward_mana: u32, pub reward_currency: u32, - pub story_hint: Option, + pub story_hint: Option::, pub created_at_micros: i64, pub updated_at_micros: i64, } + impl __sdk::InModule for TreasureRecordSnapshot { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/treasure_record_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/treasure_record_table.rs index 927e3256..c4e7b6cd 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/treasure_record_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/treasure_record_table.rs @@ -2,10 +2,15 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![allow(unused, clippy::all)] +use spacetimedb_sdk::__codegen::{ + self as __sdk, + __lib, + __sats, + __ws, +}; +use super::treasure_record_type::TreasureRecord; use super::runtime_item_reward_item_snapshot_type::RuntimeItemRewardItemSnapshot; use super::treasure_interaction_action_type::TreasureInteractionAction; -use super::treasure_record_type::TreasureRecord; -use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; /// Table handle for the table `treasure_record`. /// @@ -46,12 +51,8 @@ impl<'ctx> __sdk::Table for TreasureRecordTableHandle<'ctx> { type Row = TreasureRecord; type EventContext = super::EventContext; - fn count(&self) -> u64 { - self.imp.count() - } - fn iter(&self) -> impl Iterator + '_ { - self.imp.iter() - } + fn count(&self) -> u64 { self.imp.count() } + fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } type InsertCallbackId = TreasureRecordInsertCallbackId; @@ -97,40 +98,39 @@ impl<'ctx> __sdk::TableWithPrimaryKey for TreasureRecordTableHandle<'ctx> { } } -/// Access to the `treasure_record_id` unique index on the table `treasure_record`, -/// which allows point queries on the field of the same name -/// via the [`TreasureRecordTreasureRecordIdUnique::find`] method. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.treasure_record().treasure_record_id().find(...)`. -pub struct TreasureRecordTreasureRecordIdUnique<'ctx> { - imp: __sdk::UniqueConstraintHandle, - phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, -} - -impl<'ctx> TreasureRecordTableHandle<'ctx> { - /// Get a handle on the `treasure_record_id` unique index on the table `treasure_record`. - pub fn treasure_record_id(&self) -> TreasureRecordTreasureRecordIdUnique<'ctx> { - TreasureRecordTreasureRecordIdUnique { - imp: self - .imp - .get_unique_constraint::("treasure_record_id"), - phantom: std::marker::PhantomData, + /// Access to the `treasure_record_id` unique index on the table `treasure_record`, + /// which allows point queries on the field of the same name + /// via the [`TreasureRecordTreasureRecordIdUnique::find`] method. + /// + /// Users are encouraged not to explicitly reference this type, + /// but to directly chain method calls, + /// like `ctx.db.treasure_record().treasure_record_id().find(...)`. + pub struct TreasureRecordTreasureRecordIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } - } -} -impl<'ctx> TreasureRecordTreasureRecordIdUnique<'ctx> { - /// Find the subscribed row whose `treasure_record_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 { - self.imp.find(col_val) - } -} + impl<'ctx> TreasureRecordTableHandle<'ctx> { + /// Get a handle on the `treasure_record_id` unique index on the table `treasure_record`. + pub fn treasure_record_id(&self) -> TreasureRecordTreasureRecordIdUnique<'ctx> { + TreasureRecordTreasureRecordIdUnique { + imp: self.imp.get_unique_constraint::("treasure_record_id"), + phantom: std::marker::PhantomData, + } + } + } + impl<'ctx> TreasureRecordTreasureRecordIdUnique<'ctx> { + /// Find the subscribed row whose `treasure_record_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 { + self.imp.find(col_val) + } + } + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("treasure_record"); _table.add_unique_constraint::("treasure_record_id", |row| &row.treasure_record_id); } @@ -140,24 +140,26 @@ pub(super) fn parse_table_update( raw_updates: __ws::v2::TableUpdate, ) -> __sdk::Result<__sdk::TableUpdate> { __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { - __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") - .with_cause(e) - .into() + __sdk::InternalError::failed_parse( + "TableUpdate", + "TableUpdate", + ).with_cause(e).into() }) } -#[allow(non_camel_case_types)] -/// Extension trait for query builder access to the table `TreasureRecord`. -/// -/// Implemented for [`__sdk::QueryTableAccessor`]. -pub trait treasure_recordQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `TreasureRecord`. - fn treasure_record(&self) -> __sdk::__query_builder::Table; -} + #[allow(non_camel_case_types)] + /// Extension trait for query builder access to the table `TreasureRecord`. + /// + /// Implemented for [`__sdk::QueryTableAccessor`]. + pub trait treasure_recordQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `TreasureRecord`. + fn treasure_record(&self) -> __sdk::__query_builder::Table; + } + + impl treasure_recordQueryTableAccess for __sdk::QueryTableAccessor { + fn treasure_record(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("treasure_record") + } + } -impl treasure_recordQueryTableAccess for __sdk::QueryTableAccessor { - fn treasure_record(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("treasure_record") - } -} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/treasure_record_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/treasure_record_type.rs index 9bcd8f6d..e757734f 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/treasure_record_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/treasure_record_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_item_reward_item_snapshot_type::RuntimeItemRewardItemSnapshot; use super::treasure_interaction_action_type::TreasureInteractionAction; @@ -16,22 +21,24 @@ pub struct TreasureRecord { pub actor_user_id: String, pub encounter_id: String, pub encounter_name: String, - pub scene_id: Option, - pub scene_name: Option, + pub scene_id: Option::, + pub scene_name: Option::, pub action: TreasureInteractionAction, - pub reward_items: Vec, + pub reward_items: Vec::, pub reward_hp: u32, pub reward_mana: u32, pub reward_currency: u32, - pub story_hint: Option, + pub story_hint: Option::, pub created_at: __sdk::Timestamp, pub updated_at: __sdk::Timestamp, } + impl __sdk::InModule for TreasureRecord { type Module = super::RemoteModule; } + /// Column accessor struct for the table `TreasureRecord`. /// /// Provides typed access to columns for query building. @@ -42,15 +49,14 @@ pub struct TreasureRecordCols { pub actor_user_id: __sdk::__query_builder::Col, pub encounter_id: __sdk::__query_builder::Col, pub encounter_name: __sdk::__query_builder::Col, - pub scene_id: __sdk::__query_builder::Col>, - pub scene_name: __sdk::__query_builder::Col>, + pub scene_id: __sdk::__query_builder::Col>, + pub scene_name: __sdk::__query_builder::Col>, pub action: __sdk::__query_builder::Col, - pub reward_items: - __sdk::__query_builder::Col>, + pub reward_items: __sdk::__query_builder::Col>, pub reward_hp: __sdk::__query_builder::Col, pub reward_mana: __sdk::__query_builder::Col, pub reward_currency: __sdk::__query_builder::Col, - pub story_hint: __sdk::__query_builder::Col>, + pub story_hint: __sdk::__query_builder::Col>, pub created_at: __sdk::__query_builder::Col, pub updated_at: __sdk::__query_builder::Col, } @@ -75,6 +81,7 @@ impl __sdk::__query_builder::HasCols for TreasureRecord { story_hint: __sdk::__query_builder::Col::new(table_name, "story_hint"), created_at: __sdk::__query_builder::Col::new(table_name, "created_at"), updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"), + } } } @@ -96,17 +103,13 @@ impl __sdk::__query_builder::HasIxCols for TreasureRecord { TreasureRecordIxCols { actor_user_id: __sdk::__query_builder::IxCol::new(table_name, "actor_user_id"), encounter_id: __sdk::__query_builder::IxCol::new(table_name, "encounter_id"), - runtime_session_id: __sdk::__query_builder::IxCol::new( - table_name, - "runtime_session_id", - ), + runtime_session_id: __sdk::__query_builder::IxCol::new(table_name, "runtime_session_id"), story_session_id: __sdk::__query_builder::IxCol::new(table_name, "story_session_id"), - treasure_record_id: __sdk::__query_builder::IxCol::new( - table_name, - "treasure_record_id", - ), + treasure_record_id: __sdk::__query_builder::IxCol::new(table_name, "treasure_record_id"), + } } } impl __sdk::__query_builder::CanBeLookupTable for TreasureRecord {} + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/treasure_resolve_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/treasure_resolve_input_type.rs index ef1083df..9893c678 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/treasure_resolve_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/treasure_resolve_input_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_item_reward_item_snapshot_type::RuntimeItemRewardItemSnapshot; use super::treasure_interaction_action_type::TreasureInteractionAction; @@ -16,18 +21,20 @@ pub struct TreasureResolveInput { pub actor_user_id: String, pub encounter_id: String, pub encounter_name: String, - pub scene_id: Option, - pub scene_name: Option, + pub scene_id: Option::, + pub scene_name: Option::, pub action: TreasureInteractionAction, - pub reward_items: Vec, + pub reward_items: Vec::, pub reward_hp: u32, pub reward_mana: u32, pub reward_currency: u32, - pub story_hint: Option, + pub story_hint: Option::, pub created_at_micros: i64, pub updated_at_micros: i64, } + impl __sdk::InModule for TreasureResolveInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/turn_in_quest_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/turn_in_quest_reducer.rs index 4306a47f..2e9e88fd 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/turn_in_quest_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/turn_in_quest_reducer.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_turn_in_input_type::QuestTurnInInput; @@ -14,8 +19,10 @@ pub(super) struct TurnInQuestArgs { impl From for super::Reducer { fn from(args: TurnInQuestArgs) -> Self { - Self::TurnInQuest { input: args.input } - } + Self::TurnInQuest { + input: args.input, +} +} } impl __sdk::InModule for TurnInQuestArgs { @@ -33,8 +40,9 @@ pub trait turn_in_quest { /// The reducer will run asynchronously in the future, /// and this method provides no way to listen for its completion status. /// /// Use [`turn_in_quest:turn_in_quest_then`] to run a callback after the reducer completes. - fn turn_in_quest(&self, input: QuestTurnInInput) -> __sdk::Result<()> { - self.turn_in_quest_then(input, |_, _| {}) + fn turn_in_quest(&self, input: QuestTurnInInput, +) -> __sdk::Result<()> { + self.turn_in_quest_then(input, |_, _| {}) } /// Request that the remote module invoke the reducer `turn_in_quest` to run as soon as possible, @@ -62,7 +70,7 @@ impl turn_in_quest for super::RemoteReducers { + Send + 'static, ) -> __sdk::Result<()> { - self.imp - .invoke_reducer_with_callback(TurnInQuestArgs { input }, callback) + self.imp.invoke_reducer_with_callback(TurnInQuestArgs { input, }, callback) } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/unequip_inventory_item_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/unequip_inventory_item_input_type.rs index 227f40ec..20ca72d7 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/unequip_inventory_item_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/unequip_inventory_item_input_type.rs @@ -2,7 +2,13 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] #[sats(crate = __lib)] @@ -10,6 +16,8 @@ pub struct UnequipInventoryItemInput { pub slot_id: String, } + impl __sdk::InModule for UnequipInventoryItemInput { type Module = super::RemoteModule; } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/unpublish_custom_world_profile_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/unpublish_custom_world_profile_and_return_procedure.rs index b87880a7..45e7a4a1 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/unpublish_custom_world_profile_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/unpublish_custom_world_profile_and_return_procedure.rs @@ -2,17 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_library_mutation_result_type::CustomWorldLibraryMutationResult; use super::custom_world_profile_unpublish_input_type::CustomWorldProfileUnpublishInput; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct UnpublishCustomWorldProfileAndReturnArgs { + struct UnpublishCustomWorldProfileAndReturnArgs { pub input: CustomWorldProfileUnpublishInput, } + impl __sdk::InModule for UnpublishCustomWorldProfileAndReturnArgs { type Module = super::RemoteModule; } @@ -22,19 +28,16 @@ impl __sdk::InModule for UnpublishCustomWorldProfileAndReturnArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait unpublish_custom_world_profile_and_return { - fn unpublish_custom_world_profile_and_return(&self, input: CustomWorldProfileUnpublishInput) { - self.unpublish_custom_world_profile_and_return_then(input, |_, _| {}); + fn unpublish_custom_world_profile_and_return(&self, input: CustomWorldProfileUnpublishInput, +) { + self.unpublish_custom_world_profile_and_return_then(input, |_, _| {}); } fn unpublish_custom_world_profile_and_return_then( &self, input: CustomWorldProfileUnpublishInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } @@ -43,17 +46,13 @@ impl unpublish_custom_world_profile_and_return for super::RemoteProcedures { &self, input: CustomWorldProfileUnpublishInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, CustomWorldLibraryMutationResult>( - "unpublish_custom_world_profile_and_return", - UnpublishCustomWorldProfileAndReturnArgs { input }, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, CustomWorldLibraryMutationResult>( + "unpublish_custom_world_profile_and_return", + UnpublishCustomWorldProfileAndReturnArgs { input, }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/unpublish_custom_world_profile_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/unpublish_custom_world_profile_reducer.rs index 05274f62..adedc423 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/unpublish_custom_world_profile_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/unpublish_custom_world_profile_reducer.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_profile_unpublish_input_type::CustomWorldProfileUnpublishInput; @@ -14,8 +19,10 @@ pub(super) struct UnpublishCustomWorldProfileArgs { impl From for super::Reducer { fn from(args: UnpublishCustomWorldProfileArgs) -> Self { - Self::UnpublishCustomWorldProfile { input: args.input } - } + Self::UnpublishCustomWorldProfile { + input: args.input, +} +} } impl __sdk::InModule for UnpublishCustomWorldProfileArgs { @@ -33,11 +40,9 @@ pub trait unpublish_custom_world_profile { /// The reducer will run asynchronously in the future, /// and this method provides no way to listen for its completion status. /// /// Use [`unpublish_custom_world_profile:unpublish_custom_world_profile_then`] to run a callback after the reducer completes. - fn unpublish_custom_world_profile( - &self, - input: CustomWorldProfileUnpublishInput, - ) -> __sdk::Result<()> { - self.unpublish_custom_world_profile_then(input, |_, _| {}) + fn unpublish_custom_world_profile(&self, input: CustomWorldProfileUnpublishInput, +) -> __sdk::Result<()> { + self.unpublish_custom_world_profile_then(input, |_, _| {}) } /// Request that the remote module invoke the reducer `unpublish_custom_world_profile` to run as soon as possible, @@ -65,7 +70,7 @@ impl unpublish_custom_world_profile for super::RemoteReducers { + Send + 'static, ) -> __sdk::Result<()> { - self.imp - .invoke_reducer_with_callback(UnpublishCustomWorldProfileArgs { input }, callback) + self.imp.invoke_reducer_with_callback(UnpublishCustomWorldProfileArgs { input, }, callback) } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/upsert_chapter_progression_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/upsert_chapter_progression_and_return_procedure.rs index abc39bfe..2182ec5a 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/upsert_chapter_progression_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/upsert_chapter_progression_and_return_procedure.rs @@ -2,17 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_input_type::ChapterProgressionInput; use super::chapter_progression_procedure_result_type::ChapterProgressionProcedureResult; +use super::chapter_progression_input_type::ChapterProgressionInput; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct UpsertChapterProgressionAndReturnArgs { + struct UpsertChapterProgressionAndReturnArgs { pub input: ChapterProgressionInput, } + impl __sdk::InModule for UpsertChapterProgressionAndReturnArgs { type Module = super::RemoteModule; } @@ -22,19 +28,16 @@ impl __sdk::InModule for UpsertChapterProgressionAndReturnArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait upsert_chapter_progression_and_return { - fn upsert_chapter_progression_and_return(&self, input: ChapterProgressionInput) { - self.upsert_chapter_progression_and_return_then(input, |_, _| {}); + fn upsert_chapter_progression_and_return(&self, input: ChapterProgressionInput, +) { + self.upsert_chapter_progression_and_return_then(input, |_, _| {}); } fn upsert_chapter_progression_and_return_then( &self, input: ChapterProgressionInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } @@ -43,17 +46,13 @@ impl upsert_chapter_progression_and_return for super::RemoteProcedures { &self, input: ChapterProgressionInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, ChapterProgressionProcedureResult>( - "upsert_chapter_progression_and_return", - UpsertChapterProgressionAndReturnArgs { input }, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, ChapterProgressionProcedureResult>( + "upsert_chapter_progression_and_return", + UpsertChapterProgressionAndReturnArgs { input, }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/upsert_chapter_progression_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/upsert_chapter_progression_reducer.rs index 0cb4bb7a..a01fe892 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/upsert_chapter_progression_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/upsert_chapter_progression_reducer.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_input_type::ChapterProgressionInput; @@ -14,8 +19,10 @@ pub(super) struct UpsertChapterProgressionArgs { impl From for super::Reducer { fn from(args: UpsertChapterProgressionArgs) -> Self { - Self::UpsertChapterProgression { input: args.input } - } + Self::UpsertChapterProgression { + input: args.input, +} +} } impl __sdk::InModule for UpsertChapterProgressionArgs { @@ -33,8 +40,9 @@ pub trait upsert_chapter_progression { /// The reducer will run asynchronously in the future, /// and this method provides no way to listen for its completion status. /// /// Use [`upsert_chapter_progression:upsert_chapter_progression_then`] to run a callback after the reducer completes. - fn upsert_chapter_progression(&self, input: ChapterProgressionInput) -> __sdk::Result<()> { - self.upsert_chapter_progression_then(input, |_, _| {}) + fn upsert_chapter_progression(&self, input: ChapterProgressionInput, +) -> __sdk::Result<()> { + self.upsert_chapter_progression_then(input, |_, _| {}) } /// Request that the remote module invoke the reducer `upsert_chapter_progression` to run as soon as possible, @@ -62,7 +70,7 @@ impl upsert_chapter_progression for super::RemoteReducers { + Send + 'static, ) -> __sdk::Result<()> { - self.imp - .invoke_reducer_with_callback(UpsertChapterProgressionArgs { input }, callback) + self.imp.invoke_reducer_with_callback(UpsertChapterProgressionArgs { input, }, callback) } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/upsert_custom_world_profile_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/upsert_custom_world_profile_and_return_procedure.rs index 343e1807..e7720c06 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/upsert_custom_world_profile_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/upsert_custom_world_profile_and_return_procedure.rs @@ -2,17 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_library_mutation_result_type::CustomWorldLibraryMutationResult; use super::custom_world_profile_upsert_input_type::CustomWorldProfileUpsertInput; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct UpsertCustomWorldProfileAndReturnArgs { + struct UpsertCustomWorldProfileAndReturnArgs { pub input: CustomWorldProfileUpsertInput, } + impl __sdk::InModule for UpsertCustomWorldProfileAndReturnArgs { type Module = super::RemoteModule; } @@ -22,19 +28,16 @@ impl __sdk::InModule for UpsertCustomWorldProfileAndReturnArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait upsert_custom_world_profile_and_return { - fn upsert_custom_world_profile_and_return(&self, input: CustomWorldProfileUpsertInput) { - self.upsert_custom_world_profile_and_return_then(input, |_, _| {}); + fn upsert_custom_world_profile_and_return(&self, input: CustomWorldProfileUpsertInput, +) { + self.upsert_custom_world_profile_and_return_then(input, |_, _| {}); } fn upsert_custom_world_profile_and_return_then( &self, input: CustomWorldProfileUpsertInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } @@ -43,17 +46,13 @@ impl upsert_custom_world_profile_and_return for super::RemoteProcedures { &self, input: CustomWorldProfileUpsertInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, CustomWorldLibraryMutationResult>( - "upsert_custom_world_profile_and_return", - UpsertCustomWorldProfileAndReturnArgs { input }, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, CustomWorldLibraryMutationResult>( + "upsert_custom_world_profile_and_return", + UpsertCustomWorldProfileAndReturnArgs { input, }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/upsert_custom_world_profile_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/upsert_custom_world_profile_reducer.rs index e343b491..353bc46f 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/upsert_custom_world_profile_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/upsert_custom_world_profile_reducer.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_profile_upsert_input_type::CustomWorldProfileUpsertInput; @@ -14,8 +19,10 @@ pub(super) struct UpsertCustomWorldProfileArgs { impl From for super::Reducer { fn from(args: UpsertCustomWorldProfileArgs) -> Self { - Self::UpsertCustomWorldProfile { input: args.input } - } + Self::UpsertCustomWorldProfile { + input: args.input, +} +} } impl __sdk::InModule for UpsertCustomWorldProfileArgs { @@ -33,11 +40,9 @@ pub trait upsert_custom_world_profile { /// The reducer will run asynchronously in the future, /// and this method provides no way to listen for its completion status. /// /// Use [`upsert_custom_world_profile:upsert_custom_world_profile_then`] to run a callback after the reducer completes. - fn upsert_custom_world_profile( - &self, - input: CustomWorldProfileUpsertInput, - ) -> __sdk::Result<()> { - self.upsert_custom_world_profile_then(input, |_, _| {}) + fn upsert_custom_world_profile(&self, input: CustomWorldProfileUpsertInput, +) -> __sdk::Result<()> { + self.upsert_custom_world_profile_then(input, |_, _| {}) } /// Request that the remote module invoke the reducer `upsert_custom_world_profile` to run as soon as possible, @@ -65,7 +70,7 @@ impl upsert_custom_world_profile for super::RemoteReducers { + Send + 'static, ) -> __sdk::Result<()> { - self.imp - .invoke_reducer_with_callback(UpsertCustomWorldProfileArgs { input }, callback) + self.imp.invoke_reducer_with_callback(UpsertCustomWorldProfileArgs { input, }, callback) } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/upsert_npc_state_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/upsert_npc_state_and_return_procedure.rs index b7f3a28d..46ad5903 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/upsert_npc_state_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/upsert_npc_state_and_return_procedure.rs @@ -2,17 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::npc_state_procedure_result_type::NpcStateProcedureResult; use super::npc_state_upsert_input_type::NpcStateUpsertInput; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct UpsertNpcStateAndReturnArgs { + struct UpsertNpcStateAndReturnArgs { pub input: NpcStateUpsertInput, } + impl __sdk::InModule for UpsertNpcStateAndReturnArgs { type Module = super::RemoteModule; } @@ -22,19 +28,16 @@ impl __sdk::InModule for UpsertNpcStateAndReturnArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait upsert_npc_state_and_return { - fn upsert_npc_state_and_return(&self, input: NpcStateUpsertInput) { - self.upsert_npc_state_and_return_then(input, |_, _| {}); + fn upsert_npc_state_and_return(&self, input: NpcStateUpsertInput, +) { + self.upsert_npc_state_and_return_then(input, |_, _| {}); } fn upsert_npc_state_and_return_then( &self, input: NpcStateUpsertInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } @@ -43,17 +46,13 @@ impl upsert_npc_state_and_return for super::RemoteProcedures { &self, input: NpcStateUpsertInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, NpcStateProcedureResult>( - "upsert_npc_state_and_return", - UpsertNpcStateAndReturnArgs { input }, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, NpcStateProcedureResult>( + "upsert_npc_state_and_return", + UpsertNpcStateAndReturnArgs { input, }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/upsert_npc_state_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/upsert_npc_state_reducer.rs index f363770d..1a6f10c7 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/upsert_npc_state_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/upsert_npc_state_reducer.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::npc_state_upsert_input_type::NpcStateUpsertInput; @@ -14,8 +19,10 @@ pub(super) struct UpsertNpcStateArgs { impl From for super::Reducer { fn from(args: UpsertNpcStateArgs) -> Self { - Self::UpsertNpcState { input: args.input } - } + Self::UpsertNpcState { + input: args.input, +} +} } impl __sdk::InModule for UpsertNpcStateArgs { @@ -33,8 +40,9 @@ pub trait upsert_npc_state { /// The reducer will run asynchronously in the future, /// and this method provides no way to listen for its completion status. /// /// Use [`upsert_npc_state:upsert_npc_state_then`] to run a callback after the reducer completes. - fn upsert_npc_state(&self, input: NpcStateUpsertInput) -> __sdk::Result<()> { - self.upsert_npc_state_then(input, |_, _| {}) + fn upsert_npc_state(&self, input: NpcStateUpsertInput, +) -> __sdk::Result<()> { + self.upsert_npc_state_then(input, |_, _| {}) } /// Request that the remote module invoke the reducer `upsert_npc_state` to run as soon as possible, @@ -62,7 +70,7 @@ impl upsert_npc_state for super::RemoteReducers { + Send + 'static, ) -> __sdk::Result<()> { - self.imp - .invoke_reducer_with_callback(UpsertNpcStateArgs { input }, callback) + self.imp.invoke_reducer_with_callback(UpsertNpcStateArgs { input, }, callback) } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/upsert_platform_browse_history_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/upsert_platform_browse_history_and_return_procedure.rs index 614a6d05..eb863a2d 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/upsert_platform_browse_history_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/upsert_platform_browse_history_and_return_procedure.rs @@ -2,17 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_procedure_result_type::RuntimeBrowseHistoryProcedureResult; use super::runtime_browse_history_sync_input_type::RuntimeBrowseHistorySyncInput; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct UpsertPlatformBrowseHistoryAndReturnArgs { + struct UpsertPlatformBrowseHistoryAndReturnArgs { pub input: RuntimeBrowseHistorySyncInput, } + impl __sdk::InModule for UpsertPlatformBrowseHistoryAndReturnArgs { type Module = super::RemoteModule; } @@ -22,19 +28,16 @@ impl __sdk::InModule for UpsertPlatformBrowseHistoryAndReturnArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait upsert_platform_browse_history_and_return { - fn upsert_platform_browse_history_and_return(&self, input: RuntimeBrowseHistorySyncInput) { - self.upsert_platform_browse_history_and_return_then(input, |_, _| {}); + fn upsert_platform_browse_history_and_return(&self, input: RuntimeBrowseHistorySyncInput, +) { + self.upsert_platform_browse_history_and_return_then(input, |_, _| {}); } fn upsert_platform_browse_history_and_return_then( &self, input: RuntimeBrowseHistorySyncInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } @@ -43,17 +46,13 @@ impl upsert_platform_browse_history_and_return for super::RemoteProcedures { &self, input: RuntimeBrowseHistorySyncInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, RuntimeBrowseHistoryProcedureResult>( - "upsert_platform_browse_history_and_return", - UpsertPlatformBrowseHistoryAndReturnArgs { input }, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, RuntimeBrowseHistoryProcedureResult>( + "upsert_platform_browse_history_and_return", + UpsertPlatformBrowseHistoryAndReturnArgs { input, }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/upsert_runtime_setting_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/upsert_runtime_setting_and_return_procedure.rs index 119eab70..f820971c 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/upsert_runtime_setting_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/upsert_runtime_setting_and_return_procedure.rs @@ -2,17 +2,23 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_setting_procedure_result_type::RuntimeSettingProcedureResult; use super::runtime_setting_upsert_input_type::RuntimeSettingUpsertInput; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] -struct UpsertRuntimeSettingAndReturnArgs { + struct UpsertRuntimeSettingAndReturnArgs { pub input: RuntimeSettingUpsertInput, } + impl __sdk::InModule for UpsertRuntimeSettingAndReturnArgs { type Module = super::RemoteModule; } @@ -22,19 +28,16 @@ impl __sdk::InModule for UpsertRuntimeSettingAndReturnArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait upsert_runtime_setting_and_return { - fn upsert_runtime_setting_and_return(&self, input: RuntimeSettingUpsertInput) { - self.upsert_runtime_setting_and_return_then(input, |_, _| {}); + fn upsert_runtime_setting_and_return(&self, input: RuntimeSettingUpsertInput, +) { + self.upsert_runtime_setting_and_return_then(input, |_, _| {}); } fn upsert_runtime_setting_and_return_then( &self, input: RuntimeSettingUpsertInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ); } @@ -43,17 +46,13 @@ impl upsert_runtime_setting_and_return for super::RemoteProcedures { &self, input: RuntimeSettingUpsertInput, - __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, ) { - self.imp - .invoke_procedure_with_callback::<_, RuntimeSettingProcedureResult>( - "upsert_runtime_setting_and_return", - UpsertRuntimeSettingAndReturnArgs { input }, - __callback, - ); + self.imp.invoke_procedure_with_callback::<_, RuntimeSettingProcedureResult>( + "upsert_runtime_setting_and_return", + UpsertRuntimeSettingAndReturnArgs { input, }, + __callback, + ); } } + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/upsert_runtime_snapshot_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/upsert_runtime_snapshot_and_return_procedure.rs new file mode 100644 index 00000000..f86a0f7d --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/upsert_runtime_snapshot_and_return_procedure.rs @@ -0,0 +1,58 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use spacetimedb_sdk::__codegen::{ + self as __sdk, + __lib, + __sats, + __ws, +}; + +use super::runtime_snapshot_procedure_result_type::RuntimeSnapshotProcedureResult; +use super::runtime_snapshot_upsert_input_type::RuntimeSnapshotUpsertInput; + +#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] +#[sats(crate = __lib)] + struct UpsertRuntimeSnapshotAndReturnArgs { + pub input: RuntimeSnapshotUpsertInput, +} + + +impl __sdk::InModule for UpsertRuntimeSnapshotAndReturnArgs { + type Module = super::RemoteModule; +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the procedure `upsert_runtime_snapshot_and_return`. +/// +/// Implemented for [`super::RemoteProcedures`]. +pub trait upsert_runtime_snapshot_and_return { + fn upsert_runtime_snapshot_and_return(&self, input: RuntimeSnapshotUpsertInput, +) { + self.upsert_runtime_snapshot_and_return_then(input, |_, _| {}); + } + + fn upsert_runtime_snapshot_and_return_then( + &self, + input: RuntimeSnapshotUpsertInput, + + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + ); +} + +impl upsert_runtime_snapshot_and_return for super::RemoteProcedures { + fn upsert_runtime_snapshot_and_return_then( + &self, + input: RuntimeSnapshotUpsertInput, + + __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + ) { + self.imp.invoke_procedure_with_callback::<_, RuntimeSnapshotProcedureResult>( + "upsert_runtime_snapshot_and_return", + UpsertRuntimeSnapshotAndReturnArgs { input, }, + __callback, + ); + } +} + diff --git a/server-rs/crates/spacetime-client/src/module_bindings/user_browse_history_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/user_browse_history_table.rs index 2341921d..933556ca 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/user_browse_history_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/user_browse_history_table.rs @@ -2,9 +2,14 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![allow(unused, clippy::all)] -use super::runtime_browse_history_theme_mode_type::RuntimeBrowseHistoryThemeMode; +use spacetimedb_sdk::__codegen::{ + self as __sdk, + __lib, + __sats, + __ws, +}; use super::user_browse_history_type::UserBrowseHistory; -use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; +use super::runtime_browse_history_theme_mode_type::RuntimeBrowseHistoryThemeMode; /// Table handle for the table `user_browse_history`. /// @@ -32,9 +37,7 @@ pub trait UserBrowseHistoryTableAccess { impl UserBrowseHistoryTableAccess for super::RemoteTables { fn user_browse_history(&self) -> UserBrowseHistoryTableHandle<'_> { UserBrowseHistoryTableHandle { - imp: self - .imp - .get_table::("user_browse_history"), + imp: self.imp.get_table::("user_browse_history"), ctx: std::marker::PhantomData, } } @@ -47,12 +50,8 @@ impl<'ctx> __sdk::Table for UserBrowseHistoryTableHandle<'ctx> { type Row = UserBrowseHistory; type EventContext = super::EventContext; - fn count(&self) -> u64 { - self.imp.count() - } - fn iter(&self) -> impl Iterator + '_ { - self.imp.iter() - } + fn count(&self) -> u64 { self.imp.count() } + fn iter(&self) -> impl Iterator + '_ { self.imp.iter() } type InsertCallbackId = UserBrowseHistoryInsertCallbackId; @@ -98,40 +97,39 @@ impl<'ctx> __sdk::TableWithPrimaryKey for UserBrowseHistoryTableHandle<'ctx> { } } -/// Access to the `browse_history_id` unique index on the table `user_browse_history`, -/// which allows point queries on the field of the same name -/// via the [`UserBrowseHistoryBrowseHistoryIdUnique::find`] method. -/// -/// Users are encouraged not to explicitly reference this type, -/// but to directly chain method calls, -/// like `ctx.db.user_browse_history().browse_history_id().find(...)`. -pub struct UserBrowseHistoryBrowseHistoryIdUnique<'ctx> { - imp: __sdk::UniqueConstraintHandle, - phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, -} - -impl<'ctx> UserBrowseHistoryTableHandle<'ctx> { - /// Get a handle on the `browse_history_id` unique index on the table `user_browse_history`. - pub fn browse_history_id(&self) -> UserBrowseHistoryBrowseHistoryIdUnique<'ctx> { - UserBrowseHistoryBrowseHistoryIdUnique { - imp: self - .imp - .get_unique_constraint::("browse_history_id"), - phantom: std::marker::PhantomData, + /// Access to the `browse_history_id` unique index on the table `user_browse_history`, + /// which allows point queries on the field of the same name + /// via the [`UserBrowseHistoryBrowseHistoryIdUnique::find`] method. + /// + /// Users are encouraged not to explicitly reference this type, + /// but to directly chain method calls, + /// like `ctx.db.user_browse_history().browse_history_id().find(...)`. + pub struct UserBrowseHistoryBrowseHistoryIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, } - } -} -impl<'ctx> UserBrowseHistoryBrowseHistoryIdUnique<'ctx> { - /// Find the subscribed row whose `browse_history_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 { - self.imp.find(col_val) - } -} + impl<'ctx> UserBrowseHistoryTableHandle<'ctx> { + /// Get a handle on the `browse_history_id` unique index on the table `user_browse_history`. + pub fn browse_history_id(&self) -> UserBrowseHistoryBrowseHistoryIdUnique<'ctx> { + UserBrowseHistoryBrowseHistoryIdUnique { + imp: self.imp.get_unique_constraint::("browse_history_id"), + phantom: std::marker::PhantomData, + } + } + } + impl<'ctx> UserBrowseHistoryBrowseHistoryIdUnique<'ctx> { + /// Find the subscribed row whose `browse_history_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 { + self.imp.find(col_val) + } + } + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("user_browse_history"); _table.add_unique_constraint::("browse_history_id", |row| &row.browse_history_id); } @@ -141,24 +139,26 @@ pub(super) fn parse_table_update( raw_updates: __ws::v2::TableUpdate, ) -> __sdk::Result<__sdk::TableUpdate> { __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { - __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") - .with_cause(e) - .into() + __sdk::InternalError::failed_parse( + "TableUpdate", + "TableUpdate", + ).with_cause(e).into() }) } -#[allow(non_camel_case_types)] -/// Extension trait for query builder access to the table `UserBrowseHistory`. -/// -/// Implemented for [`__sdk::QueryTableAccessor`]. -pub trait user_browse_historyQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `UserBrowseHistory`. - fn user_browse_history(&self) -> __sdk::__query_builder::Table; -} + #[allow(non_camel_case_types)] + /// Extension trait for query builder access to the table `UserBrowseHistory`. + /// + /// Implemented for [`__sdk::QueryTableAccessor`]. + pub trait user_browse_historyQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `UserBrowseHistory`. + fn user_browse_history(&self) -> __sdk::__query_builder::Table; + } + + impl user_browse_historyQueryTableAccess for __sdk::QueryTableAccessor { + fn user_browse_history(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("user_browse_history") + } + } -impl user_browse_historyQueryTableAccess for __sdk::QueryTableAccessor { - fn user_browse_history(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("user_browse_history") - } -} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/user_browse_history_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/user_browse_history_type.rs index 3a6cf1ae..85e114be 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/user_browse_history_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/user_browse_history_type.rs @@ -2,7 +2,12 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_theme_mode_type::RuntimeBrowseHistoryThemeMode; @@ -16,7 +21,7 @@ pub struct UserBrowseHistory { pub world_name: String, pub subtitle: String, pub summary_text: String, - pub cover_image_src: Option, + pub cover_image_src: Option::, pub theme_mode: RuntimeBrowseHistoryThemeMode, pub author_display_name: String, pub visited_at: __sdk::Timestamp, @@ -24,10 +29,12 @@ pub struct UserBrowseHistory { pub updated_at: __sdk::Timestamp, } + impl __sdk::InModule for UserBrowseHistory { type Module = super::RemoteModule; } + /// Column accessor struct for the table `UserBrowseHistory`. /// /// Provides typed access to columns for query building. @@ -39,7 +46,7 @@ pub struct UserBrowseHistoryCols { pub world_name: __sdk::__query_builder::Col, pub subtitle: __sdk::__query_builder::Col, pub summary_text: __sdk::__query_builder::Col, - pub cover_image_src: __sdk::__query_builder::Col>, + pub cover_image_src: __sdk::__query_builder::Col>, pub theme_mode: __sdk::__query_builder::Col, pub author_display_name: __sdk::__query_builder::Col, pub visited_at: __sdk::__query_builder::Col, @@ -60,13 +67,11 @@ impl __sdk::__query_builder::HasCols for UserBrowseHistory { summary_text: __sdk::__query_builder::Col::new(table_name, "summary_text"), cover_image_src: __sdk::__query_builder::Col::new(table_name, "cover_image_src"), theme_mode: __sdk::__query_builder::Col::new(table_name, "theme_mode"), - author_display_name: __sdk::__query_builder::Col::new( - table_name, - "author_display_name", - ), + author_display_name: __sdk::__query_builder::Col::new(table_name, "author_display_name"), visited_at: __sdk::__query_builder::Col::new(table_name, "visited_at"), created_at: __sdk::__query_builder::Col::new(table_name, "created_at"), updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"), + } } } @@ -85,8 +90,10 @@ impl __sdk::__query_builder::HasIxCols for UserBrowseHistory { UserBrowseHistoryIxCols { browse_history_id: __sdk::__query_builder::IxCol::new(table_name, "browse_history_id"), user_id: __sdk::__query_builder::IxCol::new(table_name, "user_id"), + } } } impl __sdk::__query_builder::CanBeLookupTable for UserBrowseHistory {} + diff --git a/server-rs/crates/spacetime-module/Cargo.toml b/server-rs/crates/spacetime-module/Cargo.toml index 712c0ed2..8a27ed4e 100644 --- a/server-rs/crates/spacetime-module/Cargo.toml +++ b/server-rs/crates/spacetime-module/Cargo.toml @@ -9,6 +9,7 @@ crate-type = ["cdylib"] [dependencies] log = { workspace = true } +serde_json = "1" module-ai = { path = "../module-ai", default-features = false, features = ["spacetime-types"] } module-assets = { path = "../module-assets", default-features = false, features = ["spacetime-types"] } module-combat = { path = "../module-combat", default-features = false, features = ["spacetime-types"] } diff --git a/server-rs/crates/spacetime-module/src/lib.rs b/server-rs/crates/spacetime-module/src/lib.rs index 3f540998..aa6034b1 100644 --- a/server-rs/crates/spacetime-module/src/lib.rs +++ b/server-rs/crates/spacetime-module/src/lib.rs @@ -24,11 +24,17 @@ use module_combat::{ validate_battle_state_query_input, }; use module_custom_world::{ - CustomWorldAgentMessageSnapshot, CustomWorldAgentMessageSubmitInput, + CustomWorldAgentActionExecuteInput, CustomWorldAgentActionExecuteResult, + CustomWorldAgentCardDetailGetInput, CustomWorldAgentMessageSnapshot, + CustomWorldAgentMessageSubmitInput, CustomWorldAgentOperationGetInput, CustomWorldAgentOperationProcedureResult, CustomWorldAgentOperationSnapshot, CustomWorldAgentSessionCreateInput, CustomWorldAgentSessionGetInput, CustomWorldAgentSessionProcedureResult, - CustomWorldAgentSessionSnapshot, CustomWorldDraftCardSnapshot, + CustomWorldAgentSessionSnapshot, CustomWorldDraftCardDetailResult, + CustomWorldDraftCardDetailSectionSnapshot, CustomWorldDraftCardDetailSnapshot, + CustomWorldDraftCardSnapshot, CustomWorldPublishBlockerSnapshot, + CustomWorldPublishGateSnapshot, CustomWorldWorkSummarySnapshot, CustomWorldWorksListInput, + CustomWorldWorksListResult, CustomWorldGalleryDetailInput, CustomWorldGalleryEntrySnapshot, CustomWorldGalleryListResult, CustomWorldGenerationMode, CustomWorldLibraryDetailInput, CustomWorldLibraryMutationResult, CustomWorldProfileListInput, @@ -40,11 +46,14 @@ use module_custom_world::{ RpgAgentDraftCardKind, RpgAgentDraftCardStatus, RpgAgentMessageKind, RpgAgentMessageRole, RpgAgentOperationStatus, RpgAgentOperationType, RpgAgentStage, build_custom_world_published_profile_compile_snapshot, validate_custom_world_agent_message_submit_input, + validate_custom_world_agent_action_execute_input, + validate_custom_world_agent_card_detail_get_input, validate_custom_world_agent_operation_get_input, validate_custom_world_agent_session_create_input, validate_custom_world_agent_session_get_input, validate_custom_world_gallery_detail_input, validate_custom_world_library_detail_input, validate_custom_world_profile_list_input, validate_custom_world_profile_publish_input, validate_custom_world_profile_unpublish_input, validate_custom_world_profile_upsert_input, validate_custom_world_publish_world_input, + validate_custom_world_works_list_input, }; use module_inventory::{ GrantInventoryItemInput, INVENTORY_MUTATION_ID_PREFIX, INVENTORY_SLOT_ID_PREFIX, @@ -80,20 +89,29 @@ use module_quest::{ generate_quest_log_id, turn_in_quest_record, }; use module_runtime::{ - DEFAULT_MUSIC_VOLUME, DEFAULT_PLATFORM_THEME, PROFILE_WALLET_LEDGER_LIST_LIMIT, + DEFAULT_MUSIC_VOLUME, DEFAULT_PLATFORM_THEME, DEFAULT_SAVE_ARCHIVE_SUMMARY_TEXT, + PROFILE_WALLET_LEDGER_LIST_LIMIT, SAVE_SNAPSHOT_VERSION, RuntimeBrowseHistoryClearInput, RuntimeBrowseHistoryListInput, RuntimeBrowseHistoryProcedureResult, RuntimeBrowseHistorySnapshot, RuntimeBrowseHistorySyncInput, RuntimeBrowseHistoryThemeMode, RuntimePlatformTheme, + RuntimeProfileSaveArchiveListInput, RuntimeProfileSaveArchiveProcedureResult, + RuntimeProfileSaveArchiveResumeInput, RuntimeProfileSaveArchiveSnapshot, RuntimeProfileDashboardGetInput, RuntimeProfileDashboardProcedureResult, RuntimeProfileDashboardSnapshot, RuntimeProfilePlayStatsGetInput, RuntimeProfilePlayStatsProcedureResult, RuntimeProfilePlayStatsSnapshot, RuntimeProfilePlayedWorldSnapshot, RuntimeProfileWalletLedgerEntrySnapshot, RuntimeProfileWalletLedgerListInput, RuntimeProfileWalletLedgerProcedureResult, - RuntimeProfileWalletLedgerSourceType, RuntimeSettingGetInput, RuntimeSettingProcedureResult, - RuntimeSettingSnapshot, RuntimeSettingUpsertInput, build_runtime_browse_history_clear_input, + RuntimeProfileWalletLedgerSourceType, RuntimeSettingGetInput, + RuntimeSettingProcedureResult, RuntimeSettingSnapshot, RuntimeSettingUpsertInput, + RuntimeSnapshot, RuntimeSnapshotDeleteInput, RuntimeSnapshotGetInput, + RuntimeSnapshotProcedureResult, RuntimeSnapshotUpsertInput, + build_runtime_browse_history_clear_input, build_runtime_browse_history_list_input, build_runtime_profile_dashboard_get_input, build_runtime_profile_play_stats_get_input, build_runtime_profile_wallet_ledger_list_input, - build_runtime_setting_get_input, build_runtime_setting_upsert_input, + build_runtime_profile_save_archive_list_input, + build_runtime_profile_save_archive_resume_input, build_runtime_setting_get_input, + build_runtime_setting_upsert_input, build_runtime_snapshot_delete_input, + build_runtime_snapshot_get_input, build_runtime_snapshot_upsert_input, prepare_runtime_browse_history_entries, }; use module_runtime_item::{ @@ -109,6 +127,7 @@ use module_story::{ build_story_session_snapshot, build_story_started_event, validate_story_continue_input, validate_story_session_input, validate_story_session_state_input, }; +use serde_json::{Map as JsonMap, Value as JsonValue, json}; use spacetimedb::{ProcedureContext, ReducerContext, SpacetimeType, Table, Timestamp}; // 这层输入只服务 NPC 开战编排;普通聊天、援手、招募继续走已有 resolve_npc_interaction 接口。 @@ -196,6 +215,19 @@ pub struct RuntimeSetting { updated_at: Timestamp, } +#[spacetimedb::table(accessor = runtime_snapshot)] +pub struct RuntimeSnapshotRow { + #[primary_key] + user_id: String, + version: u32, + saved_at: Timestamp, + bottom_tab: String, + game_state_json: String, + current_story_json: Option, + created_at: Timestamp, + updated_at: Timestamp, +} + #[spacetimedb::table( accessor = user_browse_history, index(accessor = by_browse_history_user_id, btree(columns = [user_id])), @@ -276,6 +308,38 @@ pub struct ProfilePlayedWorld { last_observed_play_time_ms: u64, } +#[spacetimedb::table( + accessor = profile_save_archive, + index(accessor = by_profile_save_archive_user_id, btree(columns = [user_id])), + index( + accessor = by_profile_save_archive_user_world_key, + btree(columns = [user_id, world_key]) + ), + index( + accessor = by_profile_save_archive_user_saved_at, + btree(columns = [user_id, saved_at]) + ) +)] +pub struct ProfileSaveArchive { + #[primary_key] + archive_id: String, + user_id: String, + world_key: String, + owner_user_id: Option, + profile_id: Option, + world_type: Option, + world_name: String, + subtitle: String, + summary_text: String, + cover_image_src: Option, + saved_at: Timestamp, + bottom_tab: String, + game_state_json: String, + current_story_json: Option, + created_at: Timestamp, + updated_at: Timestamp, +} + #[spacetimedb::table(accessor = player_progression)] pub struct PlayerProgression { #[primary_key] @@ -697,6 +761,7 @@ pub struct CustomWorldAgentSession { lock_state_json: Option, draft_profile_json: Option, last_assistant_reply: Option, + publish_gate_json: Option, result_preview_json: Option, pending_clarifications_json: String, quality_findings_json: String, @@ -1635,6 +1700,7 @@ fn create_custom_world_agent_session_tx( lock_state_json: input.lock_state_json.clone(), draft_profile_json: input.draft_profile_json.clone(), last_assistant_reply: Some(input.welcome_message_text.trim().to_string()), + publish_gate_json: None, result_preview_json: None, pending_clarifications_json: input.pending_clarifications_json.clone(), quality_findings_json: input.quality_findings_json.clone(), @@ -1823,6 +1889,7 @@ fn submit_custom_world_agent_message_tx( lock_state_json: session.lock_state_json.clone(), draft_profile_json: session.draft_profile_json.clone(), last_assistant_reply: Some(assistant_reply), + publish_gate_json: session.publish_gate_json.clone(), result_preview_json: session.result_preview_json.clone(), pending_clarifications_json: next_pending_clarifications_json, quality_findings_json: session.quality_findings_json.clone(), @@ -2283,6 +2350,66 @@ pub fn get_runtime_setting_or_default( } } +// 当前快照读取保持旧 Node 语义:无快照时返回 ok=true + record=None,而不是默认空对象。 +#[spacetimedb::procedure] +pub fn get_runtime_snapshot( + ctx: &mut ProcedureContext, + input: RuntimeSnapshotGetInput, +) -> RuntimeSnapshotProcedureResult { + match ctx.try_with_tx(|tx| get_runtime_snapshot_record(tx, input.clone())) { + Ok(record) => RuntimeSnapshotProcedureResult { + ok: true, + record, + error_message: None, + }, + Err(message) => RuntimeSnapshotProcedureResult { + ok: false, + record: None, + error_message: Some(message), + }, + } +} + +// PUT snapshot 主链会同步刷新 dashboard / wallet / played_world / save_archive 四类 projection。 +#[spacetimedb::procedure] +pub fn upsert_runtime_snapshot_and_return( + ctx: &mut ProcedureContext, + input: RuntimeSnapshotUpsertInput, +) -> RuntimeSnapshotProcedureResult { + match ctx.try_with_tx(|tx| upsert_runtime_snapshot_record(tx, input.clone())) { + Ok(record) => RuntimeSnapshotProcedureResult { + ok: true, + record: Some(record), + error_message: None, + }, + Err(message) => RuntimeSnapshotProcedureResult { + ok: false, + record: None, + error_message: Some(message), + }, + } +} + +// 删除当前快照只影响 runtime_snapshot 主表,不联动清理 profile projection。 +#[spacetimedb::procedure] +pub fn delete_runtime_snapshot_and_return( + ctx: &mut ProcedureContext, + input: RuntimeSnapshotDeleteInput, +) -> RuntimeSnapshotProcedureResult { + match ctx.try_with_tx(|tx| delete_runtime_snapshot_record(tx, input.clone())) { + Ok(record) => RuntimeSnapshotProcedureResult { + ok: true, + record, + error_message: None, + }, + Err(message) => RuntimeSnapshotProcedureResult { + ok: false, + record: None, + error_message: Some(message), + }, + } +} + // procedure 面向 Axum 同步写入设置,并返回最终归一化后的持久化结果。 #[spacetimedb::procedure] pub fn upsert_runtime_setting_and_return( @@ -2303,6 +2430,54 @@ pub fn upsert_runtime_setting_and_return( } } +// save archive 列表是按世界聚合后的最近一次快照视图,读取时只做排序,不再拼装默认值。 +#[spacetimedb::procedure] +pub fn list_profile_save_archives( + ctx: &mut ProcedureContext, + input: RuntimeProfileSaveArchiveListInput, +) -> RuntimeProfileSaveArchiveProcedureResult { + match ctx.try_with_tx(|tx| list_profile_save_archive_rows(tx, input.clone())) { + Ok(entries) => RuntimeProfileSaveArchiveProcedureResult { + ok: true, + entries, + record: None, + current_snapshot: None, + error_message: None, + }, + Err(message) => RuntimeProfileSaveArchiveProcedureResult { + ok: false, + entries: Vec::new(), + record: None, + current_snapshot: None, + error_message: Some(message), + }, + } +} + +// resume 会把指定 archive 回填到当前 snapshot,并同步返回 entry + 当前 snapshot。 +#[spacetimedb::procedure] +pub fn resume_profile_save_archive_and_return( + ctx: &mut ProcedureContext, + input: RuntimeProfileSaveArchiveResumeInput, +) -> RuntimeProfileSaveArchiveProcedureResult { + match ctx.try_with_tx(|tx| resume_profile_save_archive_record(tx, input.clone())) { + Ok((record, current_snapshot)) => RuntimeProfileSaveArchiveProcedureResult { + ok: true, + entries: Vec::new(), + record: Some(record), + current_snapshot: Some(current_snapshot), + error_message: None, + }, + Err(message) => RuntimeProfileSaveArchiveProcedureResult { + ok: false, + entries: Vec::new(), + record: None, + current_snapshot: None, + error_message: Some(message), + }, + } +} + // profile dashboard 当前先作为 projection 读入口返回默认零值,等待 runtime_snapshot 写链补齐刷新。 #[spacetimedb::procedure] pub fn get_profile_dashboard( @@ -2533,6 +2708,63 @@ pub fn get_custom_world_gallery_detail( } } +#[spacetimedb::procedure] +pub fn list_custom_world_works( + ctx: &mut ProcedureContext, + input: CustomWorldWorksListInput, +) -> CustomWorldWorksListResult { + match ctx.try_with_tx(|tx| list_custom_world_work_snapshots(tx, input.clone())) { + Ok(items) => CustomWorldWorksListResult { + ok: true, + items, + error_message: None, + }, + Err(message) => CustomWorldWorksListResult { + ok: false, + items: Vec::new(), + error_message: Some(message), + }, + } +} + +#[spacetimedb::procedure] +pub fn get_custom_world_agent_card_detail( + ctx: &mut ProcedureContext, + input: CustomWorldAgentCardDetailGetInput, +) -> CustomWorldDraftCardDetailResult { + match ctx.try_with_tx(|tx| get_custom_world_agent_card_detail_tx(tx, input.clone())) { + Ok(card) => CustomWorldDraftCardDetailResult { + ok: true, + card: Some(card), + error_message: None, + }, + Err(message) => CustomWorldDraftCardDetailResult { + ok: false, + card: None, + error_message: Some(message), + }, + } +} + +#[spacetimedb::procedure] +pub fn execute_custom_world_agent_action( + ctx: &mut ProcedureContext, + input: CustomWorldAgentActionExecuteInput, +) -> CustomWorldAgentActionExecuteResult { + match ctx.try_with_tx(|tx| execute_custom_world_agent_action_tx(tx, input.clone())) { + Ok(operation) => CustomWorldAgentActionExecuteResult { + ok: true, + operation: Some(operation), + error_message: None, + }, + Err(message) => CustomWorldAgentActionExecuteResult { + ok: false, + operation: None, + error_message: Some(message), + }, + } +} + // procedure 面向 Axum 同步拉取浏览历史,继续沿用旧 Node 的 visitedAt 倒序输出语义。 #[spacetimedb::procedure] pub fn list_platform_browse_history( @@ -3274,6 +3506,657 @@ fn get_custom_world_gallery_detail_record( )) } +fn list_custom_world_work_snapshots( + ctx: &ReducerContext, + input: CustomWorldWorksListInput, +) -> Result, String> { + validate_custom_world_works_list_input(&input).map_err(|error| error.to_string())?; + + let mut items = Vec::new(); + + for session in ctx + .db + .custom_world_agent_session() + .iter() + .filter(|row| row.owner_user_id == input.owner_user_id && row.stage != RpgAgentStage::Published) + { + let gate = build_custom_world_publish_gate_from_session(&session); + let draft_profile = parse_optional_session_object(session.draft_profile_json.as_deref()); + let title = resolve_session_work_title(&session, draft_profile.as_ref()); + let summary = resolve_session_work_summary(&session, draft_profile.as_ref()); + let stage_label = Some(resolve_rpg_agent_stage_label(session.stage).to_string()); + let subtitle = resolve_session_work_subtitle(draft_profile.as_ref(), stage_label.as_deref()); + let (playable_npc_count, landmark_count) = + resolve_session_work_counts(&session, draft_profile.as_ref()); + + items.push(CustomWorldWorkSummarySnapshot { + work_id: format!("draft:{}", session.session_id), + source_type: "agent_session".to_string(), + status: "draft".to_string(), + title, + subtitle, + summary, + cover_image_src: resolve_session_work_cover_image_src(draft_profile.as_ref()), + cover_render_mode: None, + cover_character_image_srcs_json: "[]".to_string(), + updated_at_micros: session.updated_at.to_micros_since_unix_epoch(), + published_at_micros: None, + stage: Some(session.stage), + stage_label, + playable_npc_count, + landmark_count, + role_visual_ready_count: None, + role_animation_ready_count: None, + role_asset_summary_label: None, + session_id: Some(session.session_id.clone()), + profile_id: None, + can_resume: true, + can_enter_world: gate.can_enter_world, + blocker_count: gate.blocker_count, + publish_ready: gate.publish_ready, + }); + } + + for profile in ctx + .db + .custom_world_profile() + .iter() + .filter(|row| row.owner_user_id == input.owner_user_id) + { + items.push(CustomWorldWorkSummarySnapshot { + work_id: format!("published:{}", profile.profile_id), + source_type: "published_profile".to_string(), + status: profile.publication_status.as_str().to_string(), + title: profile.world_name.clone(), + subtitle: profile.subtitle.clone(), + summary: profile.summary_text.clone(), + cover_image_src: profile.cover_image_src.clone(), + cover_render_mode: None, + cover_character_image_srcs_json: "[]".to_string(), + updated_at_micros: profile.updated_at.to_micros_since_unix_epoch(), + published_at_micros: profile + .published_at + .map(|value| value.to_micros_since_unix_epoch()), + stage: None, + stage_label: None, + playable_npc_count: profile.playable_npc_count, + landmark_count: profile.landmark_count, + role_visual_ready_count: None, + role_animation_ready_count: None, + role_asset_summary_label: None, + session_id: profile.source_agent_session_id.clone(), + profile_id: Some(profile.profile_id.clone()), + can_resume: false, + can_enter_world: profile.publication_status == CustomWorldPublicationStatus::Published, + blocker_count: 0, + publish_ready: true, + }); + } + + items.sort_by(|left, right| { + right + .updated_at_micros + .cmp(&left.updated_at_micros) + .then_with(|| { + let left_rank = if left.source_type == "agent_session" { 0 } else { 1 }; + let right_rank = if right.source_type == "agent_session" { 0 } else { 1 }; + left_rank.cmp(&right_rank) + }) + .then(left.work_id.cmp(&right.work_id)) + }); + + Ok(items) +} + +fn get_custom_world_agent_card_detail_tx( + ctx: &ReducerContext, + input: CustomWorldAgentCardDetailGetInput, +) -> Result { + validate_custom_world_agent_card_detail_get_input(&input).map_err(|error| error.to_string())?; + + ctx.db + .custom_world_agent_session() + .session_id() + .find(&input.session_id) + .filter(|row| row.owner_user_id == input.owner_user_id) + .ok_or_else(|| "custom_world_agent_session 不存在".to_string())?; + + let card = ctx + .db + .custom_world_draft_card() + .card_id() + .find(&input.card_id) + .filter(|row| row.session_id == input.session_id) + .ok_or_else(|| "custom_world_draft_card 不存在".to_string())?; + + build_custom_world_draft_card_detail_snapshot(&card) +} + +fn execute_custom_world_agent_action_tx( + ctx: &ReducerContext, + input: CustomWorldAgentActionExecuteInput, +) -> Result { + validate_custom_world_agent_action_execute_input(&input).map_err(|error| error.to_string())?; + + let session = ctx + .db + .custom_world_agent_session() + .session_id() + .find(&input.session_id) + .filter(|row| row.owner_user_id == input.owner_user_id) + .ok_or_else(|| "custom_world_agent_session 不存在".to_string())?; + + if ctx + .db + .custom_world_agent_operation() + .operation_id() + .find(&input.operation_id) + .is_some() + { + return Err("custom_world_agent_operation.operation_id 已存在".to_string()); + } + + let payload = parse_optional_session_object(input.payload_json.as_deref()).unwrap_or_default(); + match input.action.trim() { + "draft_foundation" => execute_draft_foundation_action(ctx, &session, &input, &payload), + "update_draft_card" => execute_update_draft_card_action(ctx, &session, &input, &payload), + "sync_result_profile" => execute_sync_result_profile_action(ctx, &session, &input, &payload), + "publish_world" => execute_publish_world_action(ctx, &session, &input, &payload), + "revert_checkpoint" => execute_revert_checkpoint_action(ctx, &session, &input, &payload), + "generate_characters" + | "generate_landmarks" + | "generate_role_assets" + | "sync_role_assets" + | "generate_scene_assets" + | "sync_scene_assets" + | "expand_long_tail" => execute_placeholder_custom_world_action(ctx, &session, &input), + other => Err(format!("custom world action `{other}` 当前尚未支持")), + } +} + +fn execute_draft_foundation_action( + ctx: &ReducerContext, + session: &CustomWorldAgentSession, + input: &CustomWorldAgentActionExecuteInput, + payload: &JsonMap, +) -> Result { + if session.progress_percent < 100 { + return Err("draft_foundation requires progressPercent >= 100".to_string()); + } + + let updated_at = input.submitted_at_micros; + let draft_profile = if let Some(profile) = payload.get("draftProfile").and_then(JsonValue::as_object) { + profile.clone() + } else if let Some(existing) = parse_optional_session_object(session.draft_profile_json.as_deref()) { + ensure_minimal_draft_profile(existing, &session.seed_text) + } else { + build_minimal_draft_profile_from_seed(&session.seed_text) + }; + + let draft_profile_json = + serde_json::to_string(&JsonValue::Object(draft_profile.clone())).map_err(|error| { + format!("draft_foundation 无法序列化 draft_profile_json: {error}") + })?; + let gate = summarize_publish_gate_from_json( + &input.session_id, + RpgAgentStage::ObjectRefining, + Some(&draft_profile), + &parse_json_array_or_empty(&session.quality_findings_json), + ); + let next_session = rebuild_custom_world_agent_session_row( + session, + CustomWorldAgentSessionPatch { + progress_percent: Some(100), + stage: Some(RpgAgentStage::ObjectRefining), + draft_profile_json: Some(Some(draft_profile_json.clone())), + last_assistant_reply: Some(Some("世界底稿已整理完成,接下来可以继续细化卡片和发布预览。".to_string())), + publish_gate_json: Some(Some(serialize_json_value(&publish_gate_to_json_value(&gate))?)), + result_preview_json: Some(build_result_preview_json( + Some(&draft_profile), + &gate, + &parse_json_array_or_empty(&session.quality_findings_json), + updated_at, + )?), + checkpoints_json: Some(append_checkpoint_json( + &session.checkpoints_json, + &build_session_checkpoint_value("foundation-ready", "底稿整理完成", session), + )?), + updated_at_micros: Some(updated_at), + ..CustomWorldAgentSessionPatch::default() + }, + )?; + replace_custom_world_agent_session(ctx, session, next_session); + + upsert_world_foundation_card(ctx, &session.session_id, &draft_profile, updated_at)?; + append_custom_world_action_result_message( + ctx, + &session.session_id, + &input.operation_id, + "已整理出第一版世界底稿,并同步生成世界基础卡片。", + updated_at, + ); + + let operation = build_and_insert_custom_world_operation( + ctx, + &input.operation_id, + &session.session_id, + RpgAgentOperationType::DraftFoundation, + "底稿已整理", + "第一版 foundation draft 已写入会话与世界卡。", + updated_at, + ); + + Ok(build_custom_world_agent_operation_snapshot(&operation)) +} + +fn execute_update_draft_card_action( + ctx: &ReducerContext, + session: &CustomWorldAgentSession, + input: &CustomWorldAgentActionExecuteInput, + payload: &JsonMap, +) -> Result { + ensure_refining_stage(session.stage, "update_draft_card")?; + + let card_id = read_required_payload_text(payload, "cardId", "update_draft_card requires cardId")?; + let card = ctx + .db + .custom_world_draft_card() + .card_id() + .find(&card_id) + .filter(|row| row.session_id == session.session_id) + .ok_or_else(|| "update_draft_card target card does not exist".to_string())?; + let sections = payload + .get("sections") + .and_then(JsonValue::as_array) + .ok_or_else(|| "update_draft_card requires sections".to_string())?; + if sections.is_empty() { + return Err("update_draft_card requires sections".to_string()); + } + + let mut detail_object = parse_optional_session_object(card.detail_payload_json.as_deref()).unwrap_or_default(); + let mut detail_sections = detail_object + .get("sections") + .and_then(JsonValue::as_array) + .cloned() + .unwrap_or_else(|| build_fallback_card_sections_json(&card)); + + for patch in sections { + let patch_object = patch + .as_object() + .ok_or_else(|| "update_draft_card.sections 必须是 object 数组".to_string())?; + let section_id = read_required_payload_text( + patch_object, + "sectionId", + "update_draft_card section.sectionId is required", + )?; + let value = patch_object + .get("value") + .and_then(JsonValue::as_str) + .unwrap_or_default() + .trim() + .to_string(); + + let mut updated = false; + for existing in &mut detail_sections { + if existing.get("id").and_then(JsonValue::as_str) == Some(section_id.as_str()) { + if let Some(object) = existing.as_object_mut() { + object.insert("value".to_string(), JsonValue::String(value.clone())); + } + updated = true; + break; + } + } + + if !updated { + detail_sections.push(json!({ + "id": section_id, + "label": section_id, + "value": value, + })); + } + } + + detail_object.insert("id".to_string(), JsonValue::String(card.card_id.clone())); + detail_object.insert("kind".to_string(), JsonValue::String(card.kind.as_str().to_string())); + detail_object.insert("title".to_string(), JsonValue::String(card.title.clone())); + detail_object.insert("sections".to_string(), JsonValue::Array(detail_sections.clone())); + detail_object.insert( + "linkedIds".to_string(), + serde_json::from_str::(&card.linked_ids_json).unwrap_or_else(|_| JsonValue::Array(Vec::new())), + ); + detail_object.insert("locked".to_string(), JsonValue::Bool(false)); + detail_object.insert("editable".to_string(), JsonValue::Bool(false)); + detail_object.insert("editableSectionIds".to_string(), JsonValue::Array(Vec::new())); + detail_object.insert("warningMessages".to_string(), JsonValue::Array(Vec::new())); + + let updated_title = extract_detail_section_value(&detail_sections, "title").unwrap_or_else(|| card.title.clone()); + let updated_subtitle = + extract_detail_section_value(&detail_sections, "subtitle").unwrap_or_else(|| card.subtitle.clone()); + let updated_summary = + extract_detail_section_value(&detail_sections, "summary").unwrap_or_else(|| card.summary.clone()); + let detail_payload_json = + serde_json::to_string(&JsonValue::Object(detail_object)).map_err(|error| { + format!("update_draft_card 无法序列化 detail_payload_json: {error}") + })?; + + replace_custom_world_draft_card( + ctx, + &card, + CustomWorldDraftCard { + card_id: card.card_id.clone(), + session_id: card.session_id.clone(), + kind: card.kind, + status: card.status, + title: updated_title.clone(), + subtitle: updated_subtitle.clone(), + summary: updated_summary.clone(), + linked_ids_json: card.linked_ids_json.clone(), + warning_count: card.warning_count, + asset_status: card.asset_status, + asset_status_label: card.asset_status_label.clone(), + detail_payload_json: Some(detail_payload_json), + created_at: card.created_at, + updated_at: Timestamp::from_micros_since_unix_epoch(input.submitted_at_micros), + }, + ); + + let next_session = sync_session_draft_profile_from_card_update(session, &card, &updated_title, &updated_subtitle, &updated_summary, input.submitted_at_micros)?; + replace_custom_world_agent_session(ctx, session, next_session); + + append_custom_world_action_result_message( + ctx, + &session.session_id, + &input.operation_id, + &format!("已更新卡片《{}》的草稿内容。", updated_title), + input.submitted_at_micros, + ); + + let operation = build_and_insert_custom_world_operation( + ctx, + &input.operation_id, + &session.session_id, + RpgAgentOperationType::UpdateDraftCard, + "卡片已更新", + &format!("卡片 {} 的 detail 与摘要字段已同步更新。", card_id), + input.submitted_at_micros, + ); + + Ok(build_custom_world_agent_operation_snapshot(&operation)) +} + +fn execute_sync_result_profile_action( + ctx: &ReducerContext, + session: &CustomWorldAgentSession, + input: &CustomWorldAgentActionExecuteInput, + payload: &JsonMap, +) -> Result { + ensure_refining_stage(session.stage, "sync_result_profile")?; + let profile = payload + .get("profile") + .and_then(JsonValue::as_object) + .cloned() + .ok_or_else(|| "sync_result_profile requires profile".to_string())?; + let draft_profile = ensure_minimal_draft_profile(profile, &session.seed_text); + let gate = summarize_publish_gate_from_json( + &session.session_id, + session.stage, + Some(&draft_profile), + &parse_json_array_or_empty(&session.quality_findings_json), + ); + + let next_session = rebuild_custom_world_agent_session_row( + session, + CustomWorldAgentSessionPatch { + draft_profile_json: Some(Some(serialize_json_value(&JsonValue::Object(draft_profile.clone()))?)), + last_assistant_reply: Some(Some("结果页草稿已同步回当前会话。".to_string())), + publish_gate_json: Some(Some(serialize_json_value(&publish_gate_to_json_value(&gate))?)), + result_preview_json: Some(build_result_preview_json( + Some(&draft_profile), + &gate, + &parse_json_array_or_empty(&session.quality_findings_json), + input.submitted_at_micros, + )?), + checkpoints_json: Some(append_checkpoint_json( + &session.checkpoints_json, + &build_session_checkpoint_value("sync-result-profile", "同步结果页草稿", session), + )?), + updated_at_micros: Some(input.submitted_at_micros), + ..CustomWorldAgentSessionPatch::default() + }, + )?; + replace_custom_world_agent_session(ctx, session, next_session); + + append_custom_world_action_result_message( + ctx, + &session.session_id, + &input.operation_id, + "结果页 profile 已回写当前会话,并重建预览。", + input.submitted_at_micros, + ); + + let operation = build_and_insert_custom_world_operation( + ctx, + &input.operation_id, + &session.session_id, + RpgAgentOperationType::SyncResultProfile, + "结果页已同步", + "draft_profile_json 与 result_preview 已更新。", + input.submitted_at_micros, + ); + + Ok(build_custom_world_agent_operation_snapshot(&operation)) +} + +fn execute_publish_world_action( + ctx: &ReducerContext, + session: &CustomWorldAgentSession, + input: &CustomWorldAgentActionExecuteInput, + payload: &JsonMap, +) -> Result { + ensure_publishable_stage(session.stage, "publish_world")?; + + let draft_profile = if let Some(explicit) = payload.get("draftProfile").and_then(JsonValue::as_object) { + explicit.clone() + } else { + parse_optional_session_object(session.draft_profile_json.as_deref()) + .ok_or_else(|| "publish_world requires draft_profile_json".to_string())? + }; + let gate = summarize_publish_gate_from_json( + &session.session_id, + session.stage, + Some(&draft_profile), + &parse_json_array_or_empty(&session.quality_findings_json), + ); + if !gate.publish_ready { + return Err(format!( + "当前世界仍有 {} 个 blocker,暂时不能发布", + gate.blocker_count + )); + } + + let profile_id = payload + .get("profileId") + .and_then(JsonValue::as_str) + .map(str::trim) + .filter(|value| !value.is_empty()) + .map(ToOwned::to_owned) + .unwrap_or_else(|| gate.profile_id.clone()); + let setting_text = payload + .get("settingText") + .and_then(JsonValue::as_str) + .map(str::trim) + .filter(|value| !value.is_empty()) + .map(ToOwned::to_owned) + .unwrap_or_else(|| session.seed_text.clone()); + let legacy_result_profile_json = payload + .get("legacyResultProfile") + .map(serialize_json_value) + .transpose()?; + let publish_result = publish_custom_world_world_record( + ctx, + CustomWorldPublishWorldInput { + session_id: session.session_id.clone(), + profile_id, + owner_user_id: session.owner_user_id.clone(), + draft_profile_json: serialize_json_value(&JsonValue::Object(draft_profile.clone()))?, + legacy_result_profile_json, + setting_text, + author_display_name: "创作者".to_string(), + published_at_micros: input.submitted_at_micros, + }, + )?; + + append_custom_world_action_result_message( + ctx, + &session.session_id, + &input.operation_id, + &format!("正式世界档案已发布:{}。", publish_result.1.profile_id), + input.submitted_at_micros, + ); + + let operation = build_and_insert_custom_world_operation( + ctx, + &input.operation_id, + &session.session_id, + RpgAgentOperationType::PublishWorld, + "世界已发布", + &format!("正式世界档案已写入作品库:{}。", publish_result.1.profile_id), + input.submitted_at_micros, + ); + + Ok(build_custom_world_agent_operation_snapshot(&operation)) +} + +fn execute_revert_checkpoint_action( + ctx: &ReducerContext, + session: &CustomWorldAgentSession, + input: &CustomWorldAgentActionExecuteInput, + payload: &JsonMap, +) -> Result { + ensure_long_tail_stage(session.stage, "revert_checkpoint")?; + let checkpoint_id = read_required_payload_text( + payload, + "checkpointId", + "revert_checkpoint requires checkpointId", + )?; + let checkpoint = parse_json_array_or_empty(&session.checkpoints_json) + .into_iter() + .find(|entry| { + entry + .get("checkpointId") + .and_then(JsonValue::as_str) + .map(str::trim) + == Some(checkpoint_id.as_str()) + }) + .ok_or_else(|| "revert_checkpoint target checkpoint does not exist".to_string())?; + let snapshot = checkpoint + .get("snapshot") + .and_then(JsonValue::as_object) + .cloned() + .ok_or_else(|| { + "revert_checkpoint target checkpoint does not contain a restorable snapshot".to_string() + })?; + + let restored_stage = snapshot + .get("stage") + .and_then(JsonValue::as_str) + .and_then(parse_rpg_agent_stage) + .unwrap_or(session.stage); + let restored_progress = snapshot + .get("progressPercent") + .and_then(JsonValue::as_u64) + .and_then(|value| u32::try_from(value).ok()) + .unwrap_or(session.progress_percent); + let restored_draft_profile = snapshot + .get("draftProfile") + .and_then(JsonValue::as_object) + .cloned(); + let restored_quality_findings = snapshot + .get("qualityFindings") + .and_then(JsonValue::as_array) + .cloned() + .unwrap_or_else(Vec::new); + let gate = summarize_publish_gate_from_json( + &session.session_id, + restored_stage, + restored_draft_profile.as_ref(), + &restored_quality_findings, + ); + + let next_session = rebuild_custom_world_agent_session_row( + session, + CustomWorldAgentSessionPatch { + progress_percent: Some(restored_progress), + stage: Some(restored_stage), + draft_profile_json: Some(restored_draft_profile.map(|value| serialize_json_value(&JsonValue::Object(value))).transpose()?), + last_assistant_reply: Some(Some("已恢复到所选 checkpoint 的世界草稿状态。".to_string())), + quality_findings_json: Some(serialize_json_value(&JsonValue::Array(restored_quality_findings))?), + publish_gate_json: Some(Some(serialize_json_value(&publish_gate_to_json_value(&gate))?)), + result_preview_json: Some(build_result_preview_json( + restored_draft_profile.as_ref(), + &gate, + &parse_json_array_or_empty(&serialize_json_value(&JsonValue::Array( + snapshot + .get("qualityFindings") + .and_then(JsonValue::as_array) + .cloned() + .unwrap_or_else(Vec::new), + ))?), + input.submitted_at_micros, + )?), + updated_at_micros: Some(input.submitted_at_micros), + ..CustomWorldAgentSessionPatch::default() + }, + )?; + replace_custom_world_agent_session(ctx, session, next_session); + + append_custom_world_action_result_message( + ctx, + &session.session_id, + &input.operation_id, + "已恢复到所选 checkpoint。", + input.submitted_at_micros, + ); + + let operation = build_and_insert_custom_world_operation( + ctx, + &input.operation_id, + &session.session_id, + RpgAgentOperationType::RevertCheckpoint, + "已回滚 checkpoint", + &format!("会话已恢复到 checkpoint {}。", checkpoint_id), + input.submitted_at_micros, + ); + + Ok(build_custom_world_agent_operation_snapshot(&operation)) +} + +fn execute_placeholder_custom_world_action( + ctx: &ReducerContext, + session: &CustomWorldAgentSession, + input: &CustomWorldAgentActionExecuteInput, +) -> Result { + let operation_type = map_action_name_to_operation_type(input.action.as_str()) + .ok_or_else(|| format!("action {} 无法映射到 operation type", input.action))?; + append_custom_world_action_result_message( + ctx, + &session.session_id, + &input.operation_id, + &format!("动作 {} 已接入最小兼容占位,后续会继续补真实编排。", input.action), + input.submitted_at_micros, + ); + let operation = build_and_insert_custom_world_operation( + ctx, + &input.operation_id, + &session.session_id, + operation_type, + "动作已完成", + &format!("{} 当前已走最小兼容闭环。", input.action), + input.submitted_at_micros, + ); + Ok(build_custom_world_agent_operation_snapshot(&operation)) +} + fn mark_custom_world_agent_session_published( ctx: &ReducerContext, session_id: &str, @@ -3308,6 +4191,7 @@ fn mark_custom_world_agent_session_published( lock_state_json: existing.lock_state_json.clone(), draft_profile_json: existing.draft_profile_json.clone(), last_assistant_reply: existing.last_assistant_reply.clone(), + publish_gate_json: existing.publish_gate_json.clone(), result_preview_json: existing.result_preview_json.clone(), pending_clarifications_json: existing.pending_clarifications_json.clone(), quality_findings_json: existing.quality_findings_json.clone(), @@ -3427,6 +4311,7 @@ fn build_custom_world_agent_session_snapshot( lock_state_json: row.lock_state_json.clone(), draft_profile_json: row.draft_profile_json.clone(), last_assistant_reply: row.last_assistant_reply.clone(), + publish_gate_json: row.publish_gate_json.clone(), result_preview_json: row.result_preview_json.clone(), pending_clarifications_json: row.pending_clarifications_json.clone(), quality_findings_json: row.quality_findings_json.clone(), @@ -4862,6 +5747,597 @@ fn upsert_runtime_setting( Ok(snapshot) } +fn get_runtime_snapshot_record( + ctx: &ReducerContext, + input: RuntimeSnapshotGetInput, +) -> Result, String> { + let validated_input = + build_runtime_snapshot_get_input(input.user_id).map_err(|error| error.to_string())?; + + Ok(ctx + .db + .runtime_snapshot() + .user_id() + .find(&validated_input.user_id) + .map(|row| build_runtime_snapshot_from_row(&row))) +} + +fn upsert_runtime_snapshot_record( + ctx: &ReducerContext, + input: RuntimeSnapshotUpsertInput, +) -> Result { + let current_story_value = parse_optional_json_str(input.current_story_json.as_deref())?; + let game_state = parse_json_str(&input.game_state_json)?; + let prepared = build_runtime_snapshot_upsert_input( + input.user_id, + input.saved_at_micros, + input.bottom_tab, + game_state.clone(), + current_story_value.clone(), + input.updated_at_micros, + ) + .map_err(|error| error.to_string())?; + let updated_at = Timestamp::from_micros_since_unix_epoch(prepared.updated_at_micros); + let saved_at = Timestamp::from_micros_since_unix_epoch(prepared.saved_at_micros); + + let snapshot = match ctx.db.runtime_snapshot().user_id().find(&prepared.user_id) { + Some(existing) => { + ctx.db.runtime_snapshot().user_id().delete(&existing.user_id); + ctx.db.runtime_snapshot().insert(RuntimeSnapshotRow { + user_id: existing.user_id.clone(), + version: SAVE_SNAPSHOT_VERSION, + saved_at, + bottom_tab: prepared.bottom_tab.clone(), + game_state_json: prepared.game_state_json.clone(), + current_story_json: prepared.current_story_json.clone(), + created_at: existing.created_at, + updated_at, + }); + + RuntimeSnapshot { + user_id: existing.user_id, + version: SAVE_SNAPSHOT_VERSION, + saved_at_micros: prepared.saved_at_micros, + bottom_tab: prepared.bottom_tab, + game_state_json: prepared.game_state_json, + current_story_json: prepared.current_story_json, + created_at_micros: existing.created_at.to_micros_since_unix_epoch(), + updated_at_micros: prepared.updated_at_micros, + } + } + None => { + ctx.db.runtime_snapshot().insert(RuntimeSnapshotRow { + user_id: prepared.user_id.clone(), + version: SAVE_SNAPSHOT_VERSION, + saved_at, + bottom_tab: prepared.bottom_tab.clone(), + game_state_json: prepared.game_state_json.clone(), + current_story_json: prepared.current_story_json.clone(), + created_at: updated_at, + updated_at, + }); + + RuntimeSnapshot { + user_id: prepared.user_id, + version: SAVE_SNAPSHOT_VERSION, + saved_at_micros: prepared.saved_at_micros, + bottom_tab: prepared.bottom_tab, + game_state_json: prepared.game_state_json, + current_story_json: prepared.current_story_json, + created_at_micros: prepared.updated_at_micros, + updated_at_micros: prepared.updated_at_micros, + } + } + }; + + sync_profile_projections_from_snapshot(ctx, &snapshot)?; + + Ok(snapshot) +} + +fn delete_runtime_snapshot_record( + ctx: &ReducerContext, + input: RuntimeSnapshotDeleteInput, +) -> Result, String> { + let validated_input = + build_runtime_snapshot_delete_input(input.user_id).map_err(|error| error.to_string())?; + + let existing = ctx + .db + .runtime_snapshot() + .user_id() + .find(&validated_input.user_id); + if let Some(existing) = existing { + let snapshot = build_runtime_snapshot_from_row(&existing); + ctx.db.runtime_snapshot().user_id().delete(&existing.user_id); + return Ok(Some(snapshot)); + } + + Ok(None) +} + +fn list_profile_save_archive_rows( + ctx: &ReducerContext, + input: RuntimeProfileSaveArchiveListInput, +) -> Result, String> { + let validated_input = + build_runtime_profile_save_archive_list_input(input.user_id).map_err(|error| error.to_string())?; + + let mut entries = ctx + .db + .profile_save_archive() + .iter() + .filter(|row| row.user_id == validated_input.user_id) + .map(|row| build_profile_save_archive_snapshot_from_row(&row)) + .collect::>(); + + entries.sort_by(|left, right| { + right + .saved_at_micros + .cmp(&left.saved_at_micros) + .then_with(|| left.archive_id.cmp(&right.archive_id)) + }); + + Ok(entries) +} + +fn resume_profile_save_archive_record( + ctx: &ReducerContext, + input: RuntimeProfileSaveArchiveResumeInput, +) -> Result<(RuntimeProfileSaveArchiveSnapshot, RuntimeSnapshot), String> { + let validated_input = build_runtime_profile_save_archive_resume_input(input.user_id, input.world_key) + .map_err(|error| error.to_string())?; + let archive = ctx + .db + .profile_save_archive() + .iter() + .find(|row| row.user_id == validated_input.user_id && row.world_key == validated_input.world_key) + .ok_or_else(|| "profile_save_archive 对应 world_key 不存在".to_string())?; + + let existing_snapshot = ctx + .db + .runtime_snapshot() + .user_id() + .find(&validated_input.user_id); + let created_at = existing_snapshot + .as_ref() + .map(|row| row.created_at) + .unwrap_or(archive.saved_at); + + if let Some(existing) = existing_snapshot { + ctx.db.runtime_snapshot().user_id().delete(&existing.user_id); + } + + ctx.db.runtime_snapshot().insert(RuntimeSnapshotRow { + user_id: archive.user_id.clone(), + version: SAVE_SNAPSHOT_VERSION, + saved_at: archive.saved_at, + bottom_tab: archive.bottom_tab.clone(), + game_state_json: archive.game_state_json.clone(), + current_story_json: archive.current_story_json.clone(), + created_at, + updated_at: archive.saved_at, + }); + + Ok(( + build_profile_save_archive_snapshot_from_row(&archive), + RuntimeSnapshot { + user_id: archive.user_id.clone(), + version: SAVE_SNAPSHOT_VERSION, + saved_at_micros: archive.saved_at.to_micros_since_unix_epoch(), + bottom_tab: archive.bottom_tab.clone(), + game_state_json: archive.game_state_json.clone(), + current_story_json: archive.current_story_json.clone(), + created_at_micros: created_at.to_micros_since_unix_epoch(), + updated_at_micros: archive.saved_at.to_micros_since_unix_epoch(), + }, + )) +} + +fn sync_profile_projections_from_snapshot( + ctx: &ReducerContext, + snapshot: &RuntimeSnapshot, +) -> Result<(), String> { + let game_state = parse_json_str(&snapshot.game_state_json)?; + let game_state_object = game_state.as_object(); + let saved_at = Timestamp::from_micros_since_unix_epoch(snapshot.saved_at_micros); + + sync_profile_dashboard_from_snapshot(ctx, snapshot, game_state_object, saved_at); + sync_profile_save_archive_from_snapshot(ctx, snapshot, &game_state, saved_at)?; + + Ok(()) +} + +fn sync_profile_dashboard_from_snapshot( + ctx: &ReducerContext, + snapshot: &RuntimeSnapshot, + game_state: Option<&serde_json::Map>, + saved_at: Timestamp, +) { + let current_state = ctx + .db + .profile_dashboard_state() + .user_id() + .find(&snapshot.user_id); + let previous_wallet_balance = current_state.as_ref().map(|row| row.wallet_balance).unwrap_or(0); + let previous_total_play_time_ms = current_state + .as_ref() + .map(|row| row.total_play_time_ms) + .unwrap_or(0); + let next_wallet_balance = read_non_negative_u64(game_state.and_then(|state| state.get("playerCurrency"))); + let mut next_total_play_time_ms = previous_total_play_time_ms; + + if next_wallet_balance != previous_wallet_balance { + ctx.db.profile_wallet_ledger().insert(ProfileWalletLedger { + wallet_ledger_id: format!( + "{}:{}:{}", + snapshot.user_id, + snapshot.saved_at_micros, + next_wallet_balance + ), + user_id: snapshot.user_id.clone(), + amount_delta: next_wallet_balance as i64 - previous_wallet_balance as i64, + balance_after: next_wallet_balance, + source_type: RuntimeProfileWalletLedgerSourceType::SnapshotSync, + created_at: saved_at, + }); + } + + if let Some(world_meta) = resolve_profile_world_snapshot_meta(game_state) { + let current_play_time_ms = read_non_negative_u64( + game_state + .and_then(|state| state.get("runtimeStats")) + .and_then(JsonValue::as_object) + .and_then(|stats| stats.get("playTimeMs")), + ); + let played_world_id = format!("{}:{}", snapshot.user_id, world_meta.world_key); + let existing = ctx.db.profile_played_world().played_world_id().find(&played_world_id); + let previous_observed_play_time_ms = existing + .as_ref() + .map(|row| row.last_observed_play_time_ms) + .unwrap_or(0); + let incremental_play_time_ms = current_play_time_ms.saturating_sub(previous_observed_play_time_ms); + next_total_play_time_ms = next_total_play_time_ms.saturating_add(incremental_play_time_ms); + + if let Some(existing) = existing { + ctx.db + .profile_played_world() + .played_world_id() + .delete(&existing.played_world_id); + ctx.db.profile_played_world().insert(ProfilePlayedWorld { + played_world_id, + user_id: snapshot.user_id.clone(), + world_key: world_meta.world_key, + owner_user_id: world_meta.owner_user_id, + profile_id: world_meta.profile_id, + world_type: world_meta.world_type, + world_title: world_meta.world_title, + world_subtitle: world_meta.world_subtitle, + first_played_at: existing.first_played_at, + last_played_at: saved_at, + last_observed_play_time_ms: current_play_time_ms.max(existing.last_observed_play_time_ms), + }); + } else { + ctx.db.profile_played_world().insert(ProfilePlayedWorld { + played_world_id, + user_id: snapshot.user_id.clone(), + world_key: world_meta.world_key, + owner_user_id: world_meta.owner_user_id, + profile_id: world_meta.profile_id, + world_type: world_meta.world_type, + world_title: world_meta.world_title, + world_subtitle: world_meta.world_subtitle, + first_played_at: saved_at, + last_played_at: saved_at, + last_observed_play_time_ms: current_play_time_ms, + }); + } + } + + if let Some(existing) = current_state { + ctx.db + .profile_dashboard_state() + .user_id() + .delete(&existing.user_id); + ctx.db.profile_dashboard_state().insert(ProfileDashboardState { + user_id: snapshot.user_id.clone(), + wallet_balance: next_wallet_balance, + total_play_time_ms: next_total_play_time_ms, + created_at: existing.created_at, + updated_at: saved_at, + }); + } else { + ctx.db.profile_dashboard_state().insert(ProfileDashboardState { + user_id: snapshot.user_id.clone(), + wallet_balance: next_wallet_balance, + total_play_time_ms: next_total_play_time_ms, + created_at: saved_at, + updated_at: saved_at, + }); + } +} + +fn sync_profile_save_archive_from_snapshot( + ctx: &ReducerContext, + snapshot: &RuntimeSnapshot, + game_state: &JsonValue, + saved_at: Timestamp, +) -> Result<(), String> { + let Some(archive_meta) = resolve_profile_save_archive_meta(game_state, snapshot.current_story_json.as_deref()) else { + return Ok(()); + }; + + let archive_id = format!("{}:{}", snapshot.user_id, archive_meta.world_key); + let existing = ctx + .db + .profile_save_archive() + .archive_id() + .find(&archive_id); + let created_at = existing.as_ref().map(|row| row.created_at).unwrap_or(saved_at); + + if let Some(existing) = existing { + ctx.db + .profile_save_archive() + .archive_id() + .delete(&existing.archive_id); + } + + ctx.db.profile_save_archive().insert(ProfileSaveArchive { + archive_id, + user_id: snapshot.user_id.clone(), + world_key: archive_meta.world_key, + owner_user_id: archive_meta.owner_user_id, + profile_id: archive_meta.profile_id, + world_type: archive_meta.world_type, + world_name: archive_meta.world_name, + subtitle: archive_meta.subtitle, + summary_text: archive_meta.summary_text, + cover_image_src: archive_meta.cover_image_src, + saved_at, + bottom_tab: snapshot.bottom_tab.clone(), + game_state_json: snapshot.game_state_json.clone(), + current_story_json: snapshot.current_story_json.clone(), + created_at, + updated_at: saved_at, + }); + + Ok(()) +} + +#[derive(Clone, Debug)] +struct ProfileWorldSnapshotMeta { + world_key: String, + owner_user_id: Option, + profile_id: Option, + world_type: Option, + world_title: String, + world_subtitle: String, +} + +#[derive(Clone, Debug)] +struct ProfileSaveArchiveMeta { + world_key: String, + owner_user_id: Option, + profile_id: Option, + world_type: Option, + world_name: String, + subtitle: String, + summary_text: String, + cover_image_src: Option, +} + +fn build_runtime_snapshot_from_row(row: &RuntimeSnapshotRow) -> RuntimeSnapshot { + RuntimeSnapshot { + user_id: row.user_id.clone(), + version: row.version, + saved_at_micros: row.saved_at.to_micros_since_unix_epoch(), + bottom_tab: row.bottom_tab.clone(), + game_state_json: row.game_state_json.clone(), + current_story_json: row.current_story_json.clone(), + created_at_micros: row.created_at.to_micros_since_unix_epoch(), + updated_at_micros: row.updated_at.to_micros_since_unix_epoch(), + } +} + +fn build_profile_save_archive_snapshot_from_row( + row: &ProfileSaveArchive, +) -> RuntimeProfileSaveArchiveSnapshot { + RuntimeProfileSaveArchiveSnapshot { + archive_id: row.archive_id.clone(), + user_id: row.user_id.clone(), + world_key: row.world_key.clone(), + owner_user_id: row.owner_user_id.clone(), + profile_id: row.profile_id.clone(), + world_type: row.world_type.clone(), + world_name: row.world_name.clone(), + subtitle: row.subtitle.clone(), + summary_text: row.summary_text.clone(), + cover_image_src: row.cover_image_src.clone(), + saved_at_micros: row.saved_at.to_micros_since_unix_epoch(), + bottom_tab: row.bottom_tab.clone(), + game_state_json: row.game_state_json.clone(), + current_story_json: row.current_story_json.clone(), + created_at_micros: row.created_at.to_micros_since_unix_epoch(), + updated_at_micros: row.updated_at.to_micros_since_unix_epoch(), + } +} + +fn parse_json_str(raw: &str) -> Result { + serde_json::from_str::(raw).map_err(|error| format!("game_state_json 解析失败: {error}")) +} + +fn parse_optional_json_str(raw: Option<&str>) -> Result, String> { + match raw.map(str::trim).filter(|value| !value.is_empty()) { + Some(value) => serde_json::from_str::(value) + .map(Some) + .map_err(|error| format!("current_story_json 解析失败: {error}")), + None => Ok(None), + } +} + +fn read_non_negative_u64(value: Option<&JsonValue>) -> u64 { + match value { + Some(JsonValue::Number(number)) => { + if let Some(raw) = number.as_u64() { + raw + } else if let Some(raw) = number.as_i64() { + raw.max(0) as u64 + } else if let Some(raw) = number.as_f64() { + if raw.is_finite() && raw > 0.0 { + raw.floor() as u64 + } else { + 0 + } + } else { + 0 + } + } + Some(JsonValue::String(raw)) => raw.trim().parse::().ok().unwrap_or(0), + _ => 0, + } +} + +fn read_string_from_json(value: Option<&JsonValue>) -> Option { + value + .and_then(JsonValue::as_str) + .map(str::trim) + .filter(|value| !value.is_empty()) + .map(ToString::to_string) +} + +fn resolve_profile_world_snapshot_meta( + game_state: Option<&serde_json::Map>, +) -> Option { + let game_state = game_state?; + let custom_world_profile = game_state.get("customWorldProfile").and_then(JsonValue::as_object); + + if let Some(custom_world_profile) = custom_world_profile { + let profile_id = read_string_from_json(custom_world_profile.get("id")); + let world_title = read_string_from_json(custom_world_profile.get("name")) + .or_else(|| read_string_from_json(custom_world_profile.get("title"))); + if profile_id.is_some() || world_title.is_some() { + let world_title = world_title.unwrap_or_else(|| "自定义世界".to_string()); + return Some(ProfileWorldSnapshotMeta { + world_key: profile_id + .as_ref() + .map(|profile_id| format!("custom:{profile_id}")) + .unwrap_or_else(|| format!("custom:{world_title}")), + owner_user_id: None, + profile_id, + world_type: Some("CUSTOM".to_string()), + world_title, + world_subtitle: read_string_from_json(custom_world_profile.get("summary")) + .or_else(|| read_string_from_json(custom_world_profile.get("settingText"))) + .unwrap_or_default(), + }); + } + } + + let world_type = read_string_from_json(game_state.get("worldType"))?; + let current_scene_preset = game_state.get("currentScenePreset").and_then(JsonValue::as_object); + + Some(ProfileWorldSnapshotMeta { + world_key: format!("builtin:{world_type}"), + owner_user_id: None, + profile_id: None, + world_type: Some(world_type.clone()), + world_title: current_scene_preset + .and_then(|preset| read_string_from_json(preset.get("name"))) + .unwrap_or_else(|| build_builtin_world_title(&world_type)), + world_subtitle: current_scene_preset + .and_then(|preset| { + read_string_from_json(preset.get("summary")) + .or_else(|| read_string_from_json(preset.get("description"))) + }) + .unwrap_or_default(), + }) +} + +fn resolve_profile_save_archive_meta( + game_state: &JsonValue, + current_story_json: Option<&str>, +) -> Option { + let game_state_object = game_state.as_object(); + let world_meta = resolve_profile_world_snapshot_meta(game_state_object)?; + let story_engine_memory = game_state_object + .and_then(|state| state.get("storyEngineMemory")) + .and_then(JsonValue::as_object); + let continue_game_digest = + story_engine_memory.and_then(|memory| read_string_from_json(memory.get("continueGameDigest"))); + let current_story_text = parse_optional_json_str(current_story_json) + .ok() + .flatten() + .and_then(|story| story.as_object().cloned()) + .and_then(|story| read_string_from_json(story.get("text"))); + let custom_world_profile = game_state_object + .and_then(|state| state.get("customWorldProfile")) + .and_then(JsonValue::as_object); + + if let Some(custom_world_profile) = custom_world_profile { + let world_name = read_string_from_json(custom_world_profile.get("name")) + .or_else(|| read_string_from_json(custom_world_profile.get("title"))) + .unwrap_or_else(|| world_meta.world_title.clone()); + let subtitle = read_string_from_json(custom_world_profile.get("summary")) + .or_else(|| read_string_from_json(custom_world_profile.get("settingText"))) + .unwrap_or_else(|| world_meta.world_subtitle.clone()); + let summary_text = continue_game_digest + .or(current_story_text) + .or_else(|| { + if subtitle.is_empty() { + None + } else { + Some(subtitle.clone()) + } + }) + .unwrap_or_else(|| DEFAULT_SAVE_ARCHIVE_SUMMARY_TEXT.to_string()); + + return Some(ProfileSaveArchiveMeta { + world_key: world_meta.world_key, + owner_user_id: world_meta.owner_user_id, + profile_id: world_meta.profile_id, + world_type: world_meta.world_type, + world_name, + subtitle, + summary_text, + cover_image_src: read_string_from_json(custom_world_profile.get("coverImageSrc")), + }); + } + + let summary_text = continue_game_digest + .or(current_story_text) + .or_else(|| { + if world_meta.world_subtitle.is_empty() { + None + } else { + Some(world_meta.world_subtitle.clone()) + } + }) + .unwrap_or_else(|| DEFAULT_SAVE_ARCHIVE_SUMMARY_TEXT.to_string()); + let current_scene_preset = game_state_object + .and_then(|state| state.get("currentScenePreset")) + .and_then(JsonValue::as_object); + + Some(ProfileSaveArchiveMeta { + world_key: world_meta.world_key, + owner_user_id: world_meta.owner_user_id, + profile_id: world_meta.profile_id, + world_type: world_meta.world_type, + world_name: world_meta.world_title, + subtitle: world_meta.world_subtitle.clone(), + summary_text, + cover_image_src: current_scene_preset + .and_then(|preset| read_string_from_json(preset.get("imageSrc"))), + }) +} + +fn build_builtin_world_title(world_type: &str) -> String { + match world_type { + "WUXIA" => "武侠世界".to_string(), + "XIANXIA" => "仙侠世界".to_string(), + _ => "叙事世界".to_string(), + } +} + fn get_profile_dashboard_snapshot( ctx: &ReducerContext, input: RuntimeProfileDashboardGetInput,