diff --git a/.env.example b/.env.example index 904f5a5b..5470d4ea 100644 --- a/.env.example +++ b/.env.example @@ -28,6 +28,9 @@ GENARRATIVE_RUNTIME_SERVER_TARGET="" # and by the standalone Rust dev / deploy scripts. GENARRATIVE_API_PORT="3100" GENARRATIVE_API_TARGET="http://127.0.0.1:3100" +GENARRATIVE_ADMIN_USERNAME="" +GENARRATIVE_ADMIN_PASSWORD="" +GENARRATIVE_ADMIN_TOKEN_TTL_SECONDS="14400" GENARRATIVE_INTERNAL_API_SECRET="CHANGE_ME_FOR_PRODUCTION" GENARRATIVE_SPACETIME_SERVER_URL="http://127.0.0.1:3001" GENARRATIVE_SPACETIME_DATABASE="genarrative-dev" diff --git a/docs/technical/ADMIN_CONSOLE_SERVICE_DESIGN_2026-04-23.md b/docs/technical/ADMIN_CONSOLE_SERVICE_DESIGN_2026-04-23.md new file mode 100644 index 00000000..db1635d9 --- /dev/null +++ b/docs/technical/ADMIN_CONSOLE_SERVICE_DESIGN_2026-04-23.md @@ -0,0 +1,260 @@ +# 后台管理服务设计 + +日期:`2026-04-23` + +## 1. 目标 + +为当前 Rust `api-server` 增加一套同源后台管理服务,满足以下首版目标: + +1. 支持管理员用户名密码登录。 +2. 支持独立的管理员鉴权,不允许普通玩家 JWT 越权访问。 +3. 支持在后台查看当前服务与数据库概览信息。 +4. 支持在后台测试当前 `api-server` 已挂载接口。 +5. 保持首版工程足够轻量,不新建额外独立服务进程,不引入第二套前端工程。 + +## 2. 背景与约束 + +当前仓库已具备: + +1. Rust `api-server` 主链。 +2. 基于 JWT + refresh session 的普通用户登录体系。 +3. `SpacetimeDB + spacetime-client` 的主数据面。 + +本次后台管理服务必须继续遵守: + +1. 后端统一落在 `server-rs`,不回退到 `server-node`。 +2. 不额外新起独立管理服务进程。 +3. 首版以“一个受保护管理域 + 一个同源后台页面”为落地形态。 +4. 数据库信息必须尽量读取真实数据库侧信息,不能只展示硬编码假数据。 + +## 3. 首版范围 + +### 3.1 包含 + +1. `GET /admin`:后台管理页面入口。 +2. `POST /admin/api/login`:管理员用户名密码登录。 +3. `GET /admin/api/me`:当前管理员会话信息。 +4. `GET /admin/api/overview`:服务与数据库概览。 +5. `POST /admin/api/debug/http`:受控 HTTP 接口调试。 +6. 基于 Bearer JWT 的管理员鉴权中间件。 + +### 3.2 不包含 + +1. 多角色管理员体系。 +2. 管理员 refresh cookie / 多端会话管理。 +3. 后台直接写库、删库、执行 reducer。 +4. 任意 SQL 执行器。 +5. 新建独立 React/Vite 管理端工程。 + +## 4. 总体方案 + +### 4.1 部署形态 + +后台管理服务直接挂载在现有 `server-rs/crates/api-server` 内,作为同一个 Axum 进程的一部分。 + +原因: + +1. 当前 `api-server` 已具备配置、JWT、错误包裹、日志与同源路由能力。 +2. 后台本质上是服务运维与调试面,不值得单独再起一个网关或 BFF。 +3. 同源可以避免开发期额外 CORS 和 cookie 域问题。 + +### 4.2 页面形态 + +后台管理页面采用 `api-server` 直接返回一份内嵌 HTML/CSS/JS 的管理页。 + +原因: + +1. 首版目标是“可用的后台能力”,不是新建一套复杂前端基建。 +2. 管理页面交互相对简单,直接内嵌更易随服务端一起部署。 +3. 可以避免新增构建链和静态资源发布路径。 + +### 4.3 数据库信息来源 + +数据库概览不走本地 CLI shell,也不依赖前端直接访问数据库。 + +首版采用两类信息源: + +1. 服务端配置与连接信息:来自 `api-server` 当前 `AppConfig`。 +2. SpacetimeDB 真正的数据库元信息与表行数:由 `api-server` 通过 SpacetimeDB 官方 HTTP API 读取。 + +读取口径: + +1. `/v1/database/{database}`:读取数据库基础信息。 +2. `/v1/database/{database}/schema`:读取 schema 信息。 +3. `/v1/database/{database}/sql`:对受控表执行 `SELECT COUNT(*)` 统计。 + +说明: + +1. 首版只做只读概览,不暴露任意 SQL 输入。 +2. 表清单由后端显式维护,避免用户在后台拼接任意查询。 + +## 5. 管理员鉴权设计 + +### 5.1 管理员账号来源 + +首版不复用普通玩家账号仓储,不把管理员账号混进 `module-auth` 用户表。 + +管理员账号来自环境变量: + +1. `GENARRATIVE_ADMIN_USERNAME` +2. `GENARRATIVE_ADMIN_PASSWORD` + +原因: + +1. 管理员是平台运维身份,不等于玩家账号。 +2. 首版目标是尽快落地可靠后台,不引入额外管理员表迁移。 +3. 环境变量方案最适合当前阶段的单后台入口。 + +### 5.2 管理员 JWT + +后台登录成功后签发独立管理员 Bearer JWT。 + +claims 设计: + +1. 继续复用 `platform-auth::AccessTokenClaims`。 +2. `roles` 固定包含 `admin`。 +3. `sub` 使用稳定管理员主体,例如 `admin:`。 +4. `sid` 使用后台会话 ID。 +5. 不写 refresh cookie。 + +### 5.3 权限校验 + +新增 `require_admin_auth` 中间件,校验规则如下: + +1. Bearer token 必须可被当前 JWT 配置正确验签。 +2. `roles` 中必须包含 `admin`。 +3. `sub` 必须匹配当前管理员配置主体。 + +普通用户 token 即使同样由本服务签发,只要不带 `admin` 角色,也一律拒绝访问后台接口。 + +## 6. 后台页面设计 + +首版页面包含三个主区域: + +1. 登录卡片。 +2. 数据库概览面板。 +3. API 调试面板。 + +交互原则: + +1. 页面简洁,不默认塞说明性长文案。 +2. 移动端优先,窄屏下卡片改纵向堆叠。 +3. API 调试结果在独立结果面板展示,不在按钮下方临时插一段文本。 + +## 7. 数据库概览设计 + +`GET /admin/api/overview` 返回以下信息: + +1. 当前服务监听信息。 +2. 当前 `SpacetimeDB server/database` 配置。 +3. `SpacetimeDB` 数据库基础信息。 +4. 当前 schema 表清单。 +5. 首批关键表的行数统计。 + +首批关键表固定覆盖: + +1. `runtime_setting` +2. `runtime_snapshot` +3. `user_browse_history` +4. `profile_dashboard_state` +5. `profile_wallet_ledger` +6. `profile_played_world` +7. `profile_save_archive` +8. `story_session` +9. `story_event` +10. `battle_state` +11. `inventory_slot` +12. `quest_record` +13. `quest_log` +14. `treasure_record` +15. `npc_state` +16. `custom_world_profile` +17. `custom_world_gallery_entry` +18. `custom_world_agent_session` +19. `custom_world_agent_message` +20. `custom_world_agent_operation` +21. `custom_world_draft_card` +22. `big_fish_creation_session` +23. `big_fish_agent_message` +24. `big_fish_asset_slot` +25. `big_fish_runtime_run` +26. `puzzle_work_profile` +27. `puzzle_agent_session` +28. `puzzle_agent_message` +29. `puzzle_runtime_run` +30. `ai_task` +31. `ai_task_stage` +32. `ai_text_chunk` +33. `ai_result_reference` +34. `asset_object` +35. `asset_entity_binding` + +返回中的计数失败项必须带错误信息,不能静默吞掉。 + +## 8. API 调试设计 + +`POST /admin/api/debug/http` 提供一个受控 HTTP 调试代理。 + +请求参数: + +1. `method` +2. `path` +3. `headers` +4. `body` + +限制: + +1. 只允许访问当前服务同源相对路径。 +2. 调试回环地址由服务端按当前 `bind_host` 解析;若服务监听在 `0.0.0.0` 或 `::`,后台自动改走 loopback,避免把通配监听地址直接当成调试目标。 +2. 禁止调 `/admin/api/login` 本身,避免自套娃。 +3. 禁止覆盖 `host`、`content-length` 等危险头。 +4. 请求超时固定收口。 +5. 返回调试结果时回显状态码、响应头、响应文本预览。 + +该能力用于验证当前服务端接口,不等价于通用代理工具。 + +## 9. 配置项 + +新增以下环境变量: + +1. `GENARRATIVE_ADMIN_USERNAME` +2. `GENARRATIVE_ADMIN_PASSWORD` +3. `GENARRATIVE_ADMIN_TOKEN_TTL_SECONDS` + +默认策略: + +1. 若未配置用户名或密码,则后台登录接口返回 `503`,后台页面显示“后台未启用”。 +2. 默认管理员 token TTL 为 `4` 小时。 + +## 10. 测试要求 + +至少覆盖: + +1. 管理员登录成功。 +2. 管理员密码错误返回 `401`。 +3. 普通用户 token 访问后台接口返回 `403`。 +4. 未登录访问后台接口返回 `401`。 +5. 后台概览接口在未启用管理员配置时返回 `503`。 +6. API 调试接口能成功访问 `/healthz`。 +7. API 调试接口拒绝绝对 URL 和后台自身登录接口。 + +## 11. 路由清单 + +首版新增路由: + +1. `GET /admin` +2. `POST /admin/api/login` +3. `GET /admin/api/me` +4. `GET /admin/api/overview` +5. `POST /admin/api/debug/http` + +## 12. 完成定义 + +满足以下条件时,本任务视为完成: + +1. `api-server` 内存在受保护后台管理域。 +2. 管理员用户名密码可登录。 +3. 普通用户 token 无法访问后台接口。 +4. 后台能看到服务和数据库真实概览。 +5. 后台能调试当前服务 HTTP 接口。 +6. 路由索引与技术文档已同步更新。 diff --git a/docs/technical/CREATION_AGENT_PUBLISH_GATE_SCHEMA_ALIGNMENT_FIX_2026-04-23.md b/docs/technical/CREATION_AGENT_PUBLISH_GATE_SCHEMA_ALIGNMENT_FIX_2026-04-23.md index 78fa43fe..5d247f17 100644 --- a/docs/technical/CREATION_AGENT_PUBLISH_GATE_SCHEMA_ALIGNMENT_FIX_2026-04-23.md +++ b/docs/technical/CREATION_AGENT_PUBLISH_GATE_SCHEMA_ALIGNMENT_FIX_2026-04-23.md @@ -23,7 +23,9 @@ RPG 创作结果页已经能看到完整草稿内容,但页面底部仍然持 2. 场景章节主链字段为 `sceneChapterBlueprints` 3. `settingText` 也会承载世界总体一句话设定 -但 `server-rs/crates/spacetime-module/src/custom_world/mod.rs` 中的 `summarize_publish_gate_from_json(...)` 仍只检查旧字段: +问题最初在拆分后的 `server-rs/crates/spacetime-module/src/custom_world/mod.rs` 中被修过一版,但当前线上实际执行入口仍保留在 `server-rs/crates/spacetime-module/src/lib.rs`。 + +也就是说,真正参与 Agent session snapshot、结果页 publish gate 刷新和 `publish_world` 动作校验的,仍然是 `lib.rs` 里的历史实现;而它还只检查旧字段: 1. `worldHook` 2. `playerPremise` @@ -36,11 +38,13 @@ RPG 创作结果页已经能看到完整草稿内容,但页面底部仍然持 2. 发布门槛检查读的是旧字段 3. 同一个草稿在 UI 看起来“已经有内容”,但 gate 仍然误判为缺失 -此外,正式发布编译在把 session draft 编译成发布 profile 时,也只把 `sceneChapters` 映射为 `sceneChapterBlueprints`,没有兼容当前更常见的 `sceneChapterBlueprints` 输入。 +因此会出现“拆分模块里的代码已经对齐,但页面实际 blocker 仍然不消失”的假象。 + +此外,`lib.rs` 里的最小草稿兜底结构也没有补上 `sceneChapterBlueprints` 默认槽位,导致部分恢复、回滚和草稿兜底链路继续偏向旧 schema。 ## 3. 修复策略 -本轮统一把发布门槛与发布编译对齐到当前前端主链 schema: +本轮统一把实际入口 `server-rs/crates/spacetime-module/src/lib.rs` 的发布门槛与最小草稿结构对齐到当前前端主链 schema: 1. `world hook` 检查同时兼容: - `worldHook` @@ -60,11 +64,12 @@ RPG 创作结果页已经能看到完整草稿内容,但页面底部仍然持 4. 主线第一幕检查优先读取: - `sceneChapterBlueprints[*].acts` - `sceneChapters[*].acts` -5. 发布编译时,`sceneChapterBlueprints` 与旧 `sceneChapters` 都能写入最终 profile。 +5. 最小草稿兜底结构同时补上 `sceneChapterBlueprints` 空数组,避免恢复链路重新回落到旧字段集合。 ## 4. 验收标准 1. 结果页已包含 `anchorContent / creatorIntent / sceneChapterBlueprints` 的草稿,不再被旧 blocker 误判。 2. `publishReady` 会随当前 session 最新 preview 正确刷新。 3. “发布并进入世界”在 blocker 清空后恢复可点击。 -4. 正式发布后的 compiled profile 仍保留 `sceneChapterBlueprints`。 +4. `ensure_minimal_draft_profile(...)` 生成的兜底草稿也包含 `sceneChapterBlueprints`。 +5. 新增 Rust 单测,覆盖“当前 Agent 结果 schema 不应再误报 blocker”与“最小草稿必须保留 `sceneChapterBlueprints` 默认槽位”。 diff --git a/docs/technical/CUSTOM_WORLD_DRAFT_FOUNDATION_API_SERVER_LLM_MIGRATION_2026-04-23.md b/docs/technical/CUSTOM_WORLD_DRAFT_FOUNDATION_API_SERVER_LLM_MIGRATION_2026-04-23.md new file mode 100644 index 00000000..c024877b --- /dev/null +++ b/docs/technical/CUSTOM_WORLD_DRAFT_FOUNDATION_API_SERVER_LLM_MIGRATION_2026-04-23.md @@ -0,0 +1,175 @@ +# Custom World `draft_foundation` 迁移到 `api-server + platform-llm` 方案 + +日期:`2026-04-23` + +## 1. 背景 + +当前 RPG 创作 Agent 的 `draft_foundation` 虽然已经能把会话推进到结果页,但真实执行位置仍在 `spacetime-module` 的 `execute_draft_foundation_action(...)`。 + +这条链路的问题是: + +1. `draft_foundation` 没有走 `platform-llm`。 +2. SpacetimeDB reducer 内部自己从 `seed_text / session.draft_profile_json` 兜底拼草稿,属于规则编译,不是“真实 LLM 生成”。 +3. reducer 按 SpacetimeDB 约束不应承担外部网络副作用,因此“让 reducer 里直接调 LLM”本身也是错误方向。 + +验证清单第三项要求是: + +1. 草稿编译需要真实走 LLM。 +2. 不能再用本地占位 compile 去冒充真实生成。 + +因此这条链必须改成: + +```text +前端 action +-> api-server 接收 draft_foundation +-> platform-llm 真实生成 foundation draft +-> spacetime-client 调用 SpacetimeDB action/procedure 写回 session / card / gate / preview +-> 前端继续通过 operation 轮询完成态 +``` + +## 2. 本轮目标 + +本轮只解决第三项验证要求最核心的问题: + +1. `draft_foundation` 的草稿生成必须在 `api-server` 中完成。 +2. `api-server` 必须真实调用 `platform-llm`。 +3. `spacetime-module` 只负责: + - 校验 action 执行条件 + - 落库 session / draft card / checkpoint / publish gate / result preview +4. 前端协议尽量不变,继续保留: + - `POST /api/runtime/custom-world/agent/sessions/:sessionId/actions` + - `GET /api/runtime/custom-world/agent/sessions/:sessionId/operations/:operationId` + +本轮不做: + +1. 把旧 Node 的 foundation draft 全量多阶段 pipeline 一次性 1:1 搬到 Rust。 +2. 额外新增前端 action 接口。 +3. 在 SpacetimeDB 内新增“可联网 procedure”去直接调 LLM。 +4. 把 `legacyResultProfile` 兼容双重编译一起迁回主链。 + +## 3. 迁移后的职责边界 + +### 3.1 `api-server` + +负责: + +1. 识别 `draft_foundation` action。 +2. 读取当前 session snapshot。 +3. 基于真实 `seed_text` 与 `anchor_content / creator_intent / anchor_pack / draft_profile` 组织 foundation draft prompt。 +4. 调用 `platform-llm::LlmClient` 获取首版草稿 JSON。 +5. 做最小字段归一化,保证至少满足当前 `publish gate / result preview` 所需字段。 +6. 把生成结果作为 `payload_json.draftProfile` 传给 `spacetime-client.execute_custom_world_agent_action(...)`。 + +### 3.2 `spacetime-module` + +负责: + +1. 校验 session 是否允许执行 `draft_foundation`。 +2. 校验 payload 中必须带有外部已生成的 `draftProfile`。 +3. 把 `draftProfile` 写入: + - `custom_world_agent_session.draft_profile_json` + - `custom_world_draft_card` + - `publish_gate_json` + - `result_preview_json` + - `checkpoints_json` + - `custom_world_agent_message` + - `custom_world_agent_operation` +4. 不再自己从 `seed_text` 兜底编译 `draftProfile`。 +5. 不再对 `draft_foundation` 的外部 `draftProfile` 做二次补全编译,避免责任边界重新漂回 SpacetimeDB。 + +### 3.3 `platform-llm` + +负责: + +1. 提供统一文本模型网关。 +2. 返回 foundation draft JSON 文本。 + +## 4. 最小实现策略 + +## 4.1 先保留当前 action / operation 协议 + +前端现在的行为是: + +1. `POST /actions` 拿到一个 `operation` +2. 进入“世界草稿生成进度”页 +3. 轮询 `GET /operations/:operationId` +4. operation 完成后拉最新 session + +因此本轮不改协议,只改服务端编排。 + +## 4.2 `draft_foundation` 的执行口径 + +`api-server` 接收到 `draft_foundation` 时: + +1. 先读取当前 session。 +2. 必须使用 session 中真实的 `seed_text` 与当前锚点组织 prompt,不能误把 `session_id` 当作 seed 传给 LLM。 +3. 若 `progressPercent < 100`,直接返回错误。 +4. 调 `platform-llm` 生成 `draftProfile`。 +5. 用当前时间戳作为 action 提交时间。 +6. 调 `spacetime-client.execute_custom_world_agent_action(...)`,把 `draftProfile` 放进 payload。 +7. 返回 SpacetimeDB 已落库的 operation。 + +首版保持同步完成,不额外引入新的 action finalize procedure。 + +原因: + +1. 这样改动范围最小。 +2. 已满足“LLM 在 api-server、SpacetimeDB 只负责落库”的验证要求。 +3. 前端没有全局短超时,本轮可先接受单次 action 等待 LLM 返回。 + +如果后续需要更强的可观测性和更长耗时容忍,再把这条链拆成 submit/finalize 两段式后台任务。 + +## 4.3 foundation draft 的最小字段要求 + +本轮生成结果至少保证以下字段存在: + +1. `name` +2. `subtitle` +3. `summary` +4. `worldHook` +5. `playerPremise` +6. `coreConflicts` +7. `playableNpcs` +8. `storyNpcs` +9. `landmarks` +10. `chapters` +11. `sceneChapterBlueprints` + +这样可以直接满足当前 Rust `publish gate` 的最小校验,不会再次出现: + +1. 草稿明明生成了 +2. 但结果页仍然提示缺少 world hook / player premise / 主线章节 / 第一幕 + +## 5. 与旧 Node foundation draft 服务的关系 + +旧 Node 版本已经证明下面几点是成立的: + +1. foundation draft 必须由后端调用真实 LLM。 +2. foundation draft 与 preview compiler 应该拆边界。 +3. `legacyResultProfile` 不应继续主导草稿主字段。 + +Rust 首版沿用这些结论,但不要求一次性照搬旧 Node 的全部多阶段拆分。 + +本轮只迁移: + +1. “真实 LLM 生成 draft 主字段”这条主要求。 +2. “结果落库由 SpacetimeDB 负责”这条边界。 + +## 6. 验收标准 + +满足以下条件时,这次迁移视为完成: + +1. `draft_foundation` 从 `api-server` 真实调用 `platform-llm`。 +2. `spacetime-module` 中 `draft_foundation` 不再允许无 `draftProfile` 自行兜底编译。 +3. 点击“生成游戏设定草稿”后,session 的 `draft_profile_json / publish_gate_json / result_preview_json` 正常写回。 +4. 结果页不再因为缺少最小底稿字段而错误阻断。 +5. 定向测试通过。 +6. 编码检查通过。 + +## 7. 相关文件 + +1. `server-rs/crates/api-server/src/custom_world.rs` +2. `server-rs/crates/api-server/src/custom_world_foundation_draft.rs` +3. `server-rs/crates/spacetime-module/src/lib.rs` +4. `server-rs/crates/module-custom-world/src/lib.rs` +5. `docs/technical/SPACETIMEDB_CUSTOM_WORLD_WORKS_AND_AGENT_EXTENSION_STAGE9_DESIGN_2026-04-22.md` diff --git a/docs/technical/PUBLIC_ID_USER_AND_GALLERY_SEARCH_DESIGN_2026-04-23.md b/docs/technical/PUBLIC_ID_USER_AND_GALLERY_SEARCH_DESIGN_2026-04-23.md new file mode 100644 index 00000000..2491e7fa --- /dev/null +++ b/docs/technical/PUBLIC_ID_USER_AND_GALLERY_SEARCH_DESIGN_2026-04-23.md @@ -0,0 +1,331 @@ +# 公开编号用户搜索与广场作品搜索设计 + +## 1. 背景 + +当前前端展示的“叙世号”由前端基于 `AuthUser.id` 临时拼装: + +- 前缀固定为 `SY-` +- 取 `user.id` 或 `username` 去除非字母数字字符后的末 8 位 +- 不足 8 位左侧补零 + +该方案只适合展示,不适合作为正式检索键,主要问题: + +1. 它不是后端持久化字段,前后端对同一编号没有统一语义。 +2. 它依赖 `user.id` 当前格式,一旦账号 ID 生成规则调整,展示号会漂移。 +3. 只截取末 8 位存在潜在碰撞风险,不适合作为用户搜索主键。 +4. 广场作品当前仅能通过 `ownerUserId + profileId` 读取详情,不利于做公开搜索和分享。 + +本次目标是把“公开编号”升级为后端一等字段,并同时支持: + +1. 按用户公开编号搜索用户 +2. 按作品公开编号搜索广场作品 +3. 前端统一展示后端返回的公开编号,不再本地拼接 + +## 2. 目标与非目标 + +### 2.1 目标 + +1. 为用户增加稳定唯一的公开编号 `public_user_code` +2. 为发布到广场的作品增加稳定唯一的公开编号 `public_work_code` +3. 提供匿名可读的公开搜索接口 +4. 平台首页 / 广场搜索框支持输入公开编号直达用户或作品 +5. 搜索兼容用户输入的不同格式,如大小写、带不带前缀、是否包含空格 + +### 2.2 非目标 + +1. 本期不实现复杂全文搜索排序系统 +2. 本期不做“用户主页”完整社交系统,只返回搜索命中的公开资料摘要 +3. 本期不把所有广场列表改造成关键词后端分页搜索 +4. 本期不修改既有业务主键 `user.id / profile_id` + +## 3. 核心设计原则 + +1. **公开编号必须后端生成并持久化** +2. **公开编号只做公开检索键,不替代内部主键** +3. **前端只展示和透传公开编号,不自行拼装** +4. **公开接口只暴露最小必要公开信息** +5. **SpacetimeDB 查询走唯一索引或明确索引,不做无界扫描** + +## 4. 数据模型设计 + +## 4.1 用户公开编号 + +在认证用户模型中新增字段: + +- `public_user_code: String` + +格式定义: + +- 标准展示格式:`SY-00000001` +- 前缀固定:`SY-` +- 数字部分固定 8 位,左侧补零 + +生成规则: + +1. 新建账号时,从认证存储中的 `next_user_id` 派生 +2. 若用户内部 ID 为 `user_{:08}`,则公开编号同步使用同一序号生成 +3. 一旦生成后永久不变 + +示例: + +- `user_00000001` -> `SY-00000001` +- `user_00001234` -> `SY-00001234` + +原因: + +1. 与当前展示习惯兼容,用户认知成本最低 +2. 不再依赖前端截断逻辑 +3. 可在后端保证唯一性与稳定性 + +## 4.2 广场作品公开编号 + +在作品真相模型与广场快照中分别新增字段: + +- `CustomWorldProfile.public_work_code: String` +- `CustomWorldProfile.author_public_user_code: String` + +在广场作品快照模型 `CustomWorldGalleryEntry` 中新增字段: + +- `public_work_code: String` +- `author_public_user_code: String` + +格式定义: + +- 标准展示格式:`CW-00000001` +- 前缀固定:`CW-` +- 数字部分固定 8 位,左侧补零 + +生成规则: + +1. 作品第一次发布到广场时分配 +2. 编号先写入 `CustomWorldProfile` 真相表,再同步到 `CustomWorldGalleryEntry` +3. 同一 `profile_id` 重复发布、更新、重新上架时沿用原编号 +4. 删除后不回收编号 + +原因: + +1. 作品公开检索和分享应使用作品级稳定编号,而不是 `ownerUserId + profileId` +2. 同一作品反复编辑发布不应导致公开编号变化 + +## 4.3 归一化规则 + +用户与作品公开编号搜索都应在后端统一做归一化,前端仅做轻提示,不做最终判定。 + +### 用户编号归一化 + +输入样例: + +- `SY-00000001` +- `sy00000001` +- `00000001` +- ` sy-00000001 ` + +归一化步骤: + +1. 去掉首尾空白 +2. 转大写 +3. 去掉所有非字母数字字符 +4. 若结果以 `SY` 开头,则去掉前缀 +5. 剩余部分必须为 1~8 位数字 +6. 左侧补零到 8 位 +7. 最终重建为标准格式 `SY-XXXXXXXX` + +### 作品编号归一化 + +输入样例: + +- `CW-00000001` +- `cw00000001` +- `00000001` + +归一化步骤: + +1. 去掉首尾空白 +2. 转大写 +3. 去掉所有非字母数字字符 +4. 若结果以 `CW` 开头,则去掉前缀 +5. 剩余部分必须为 1~8 位数字 +6. 左侧补零到 8 位 +7. 最终重建为标准格式 `CW-XXXXXXXX` + +## 5. 后端接口设计 + +## 5.1 用户公开编号搜索 + +新增匿名可读接口: + +- `GET /api/auth/public-users/by-code/{code}` +- `GET /api/auth/public-users/by-id/{userId}` + +响应: + +```json +{ + "user": { + "id": "user_00000001", + "publicUserCode": "SY-00000001", + "displayName": "旅人一号" + } +} +``` + +说明: + +1. `id` 返回内部 ID 仅供当前工程内部跳转与资源读取使用,不在 UI 上直接暴露为文案 +2. 不返回手机号、登录方式、绑定状态、tokenVersion 等敏感字段 +3. 未命中返回 `404` +4. `by-id` 仅接受内部 `user_XXXXXXXX` 这类用户 ID,用于工程内跳转、运营排查或已有资源引用,不替代公开叙世号主搜索语义 + +## 5.2 广场作品公开编号搜索 + +新增匿名可读接口: + +- `GET /api/runtime/custom-world-gallery/by-code/{code}` + +响应结构与现有广场详情接口一致: + +```json +{ + "entry": { + "ownerUserId": "user_00000001", + "profileId": "world-public-1", + "publicWorkCode": "CW-00000001", + "publicUserCode": "SY-00000001", + "authorDisplayName": "旅人一号", + "worldName": "雾港旧梦" + } +} +``` + +说明: + +1. 作品搜索命中后仍使用现有详情页承载 +2. 详情返回里补入 `publicWorkCode` 和作者 `publicUserCode` + +## 6. SpacetimeDB 与认证存储改造 + +## 6.1 认证域 + +认证域目前是 `module-auth` 内存存储,不是 SpacetimeDB 表。 + +需要改造: + +1. `AuthUser` 增加 `public_user_code` +2. `create_user / create_phone_user / create_pending_wechat_user` 统一生成公开编号 +3. `AuthUserPayload` / 前端 `AuthUser` 合约增加 `publicUserCode` +4. `auth/me`、密码登录、手机登录、微信登录、绑手机返回都补齐该字段 + +## 6.2 广场作品表 + +`CustomWorldProfile` 增加: + +1. `public_work_code: String` +2. `author_public_user_code: String` + +`CustomWorldGalleryEntry` 增加: + +1. `public_work_code: String` +2. `author_public_user_code: String` + +索引建议: + +1. `public_work_code` 唯一索引 +2. 保留现有 `owner_user_id` 索引 +3. `profile_id` 仍作为主键 / 唯一查找键之一 + +其中 `author_public_user_code` 本期可先不建索引,除非后续明确需要“按用户公开号列出该作者作品”。 + +## 6.3 作品公开编号分配策略 + +需要在模块内新增稳定计数状态,例如: + +- `gallery_public_work_counter` + +要求: + +1. 每次首次发布作品时分配一次 +2. 若作品已存在公开编号,则从 `CustomWorldProfile` 直接复用并同步到广场快照 +3. 不因下架、删除、重新发布而重新编号 + +## 7. 前端交互设计 + +## 7.1 账号展示 + +当前首页资料卡和桌面顶部都展示前端拼装叙世号,改为: + +1. 直接展示 `authUi.user.publicUserCode` +2. 复制按钮复制后端返回值 +3. 若字段缺失才进入兼容兜底逻辑,但兼容逻辑仅作过渡 + +## 7.2 广场作品卡 + +广场作品卡和详情页增加: + +1. 作品号 `CW-XXXXXXXX` +2. 作者叙世号 `SY-XXXXXXXX` + +展示要求: + +1. 以轻量辅助信息形式出现 +2. 不在卡片默认堆过多说明文字 +3. 移动端优先,避免挤压主要标题和摘要 + +## 7.3 搜索入口 + +平台首页顶部搜索框当前只是静态文案,需要接成真实输入与行为: + +1. 当输入命中 `SY` 格式时,优先走用户公开号搜索 +2. 当输入命中 `CW` 格式时,优先走作品公开号搜索 +3. 当输入纯 1~8 位数字时: + - 先尝试作品号 + - 未命中再尝试用户号 +4. 暂不命中公开编号格式时,保持当前占位,不在本期强做全文关键词搜索 + +用户搜索命中后的最小行为: + +1. 打开独立用户搜索结果面板或对话框 +2. 展示头像字母、显示名、叙世号 +3. 提供“查看该作者作品”入口 + +作品搜索命中后的行为: + +1. 直接打开广场作品详情 + +## 8. 安全与边界 + +1. 用户公开搜索接口只允许返回公开资料摘要 +2. 不允许通过公开接口枚举登录方式、绑定状态、设备信息、手机号掩码 +3. 作品公开搜索接口只返回已公开发布的作品 +4. 对不存在的编号统一返回未找到,避免泄露更多状态差异 + +## 9. 实现步骤 + +1. 改 `module-auth` 用户模型与返回合约,补 `public_user_code` +2. 改 `shared-contracts / packages/shared`,前后端统一 `publicUserCode` +3. 改首页展示,去掉前端本地拼装依赖 +4. 改 SpacetimeDB `CustomWorldGalleryEntry` 表与快照,补 `public_work_code / author_public_user_code` +5. 新增广场按公开作品号读取 procedure / api-server 路由 +6. 新增认证域按公开用户号读取接口 +7. 改平台首页搜索框,支持按公开编号跳转 +8. 补测试: + - 公开编号归一化 + - 用户搜索命中/未命中 + - 作品搜索命中/未命中 + - 前端展示与复制 + +## 10. 验收标准 + +1. 新注册、游客自动登录、手机号登录、微信登录用户都能拿到稳定 `publicUserCode` +2. 首页与账户入口展示统一使用后端 `publicUserCode` +3. 新发布广场作品自动获得稳定 `publicWorkCode` +4. 输入 `SY-00000001` 可命中对应用户 +5. 输入 `CW-00000001` 可命中对应广场作品并打开详情 +6. 输入 `00000001` 时仍能归一化识别并命中 +7. 既有广场列表、详情和发布流程不回归 + +## 11. 当前落地说明 + +1. 首页叙世号展示已优先读取后端 `publicUserCode`,原本基于 `AuthUser.id/username` 的前端拼装仅保留为兼容兜底,避免老会话未刷新时界面直接空白。 +2. 用户公开搜索与广场作品公开搜索均已改为调用后端匿名接口,前端只负责输入、展示与跳转,不再自行决定最终编号格式。 +3. 自定义世界发布链路已改为从认证服务读取真实 `public_user_code` 写入作品真相与广场读模型,不再从内部 `user_id` 临时反推 `SY-XXXXXXXX`。 +4. 当前作品号 `public_work_code` 仍采用基于 `profile_id` 的稳定 fallback 方案生成 `CW-XXXXXXXX`;若后续补独立计数表,需要在不改变读写接口的前提下替换生成来源。 diff --git a/docs/technical/PUZZLE_AGENT_LLM_REPLY_INTEGRATION_2026-04-23.md b/docs/technical/PUZZLE_AGENT_LLM_REPLY_INTEGRATION_2026-04-23.md new file mode 100644 index 00000000..1894198a --- /dev/null +++ b/docs/technical/PUZZLE_AGENT_LLM_REPLY_INTEGRATION_2026-04-23.md @@ -0,0 +1,230 @@ +# 拼图 Agent 聊天接入大模型设计 + +日期:`2026-04-23` + +## 1. 背景 + +当前拼图创作链已经具备: + +1. `PuzzleAgentWorkspace` 前端聊天壳层 +2. Rust `api-server` 的 `submit / stream / action` HTTP facade +3. `spacetime-module` 的 `puzzle_agent_session / puzzle_agent_message` 真相表 +4. `module-puzzle` 的锚点推断、草稿编译、发布校验与运行态规则 + +但 `submit_puzzle_agent_message` 仍然是 deterministic 占位逻辑: + +1. 用户发言后,`spacetime-module` 直接推断 `anchor_pack` +2. 同一事务里直接写入固定 assistant 总结文案 +3. SSE `/messages/stream` 只是把 `last_assistant_reply` 一次性回放给前端 + +这导致拼图 Agent 看起来有聊天面板,但没有真实 LLM 共创能力。 + +## 2. 目标 + +本轮只恢复拼图 Agent 聊天主链的真实 LLM 接入,不扩到图片模型和复杂多阶段编排: + +1. 用户发消息后,assistant 回复必须来自 LLM +2. LLM 输出必须同时产出: + - `replyText` + - `progressPercent` + - `nextAnchorPack` +3. SSE `reply_delta` 必须来自真实流式增量解析 +4. finalize 后一次性回写最新 session 真相 +5. LLM 不可用或解析失败时,不再写固定 assistant 假回复 + +## 3. 分层边界 + +### 3.1 `module-puzzle` + +只负责: + +1. `PuzzleAnchorPack`、`PuzzleCreatorIntent`、`PuzzleResultDraft` 纯领域模型 +2. 锚点清洗、草稿编译、发布校验 +3. 运行态拼图规则 + +明确不负责: + +1. 网络请求 +2. LLM prompt 组织 +3. SSE 推流 + +### 3.2 `spacetime-module` + +只负责: + +1. `submit_puzzle_agent_message` + - 校验 session / ownership / message id + - 只写入 user message + - 不再直接写 assistant message + - 不再直接推进 `current_turn / progress_percent / anchor_pack_json` +2. `finalize_puzzle_agent_message_turn` + - 追加 assistant message + - 覆盖 `anchor_pack_json` + - 回写 `current_turn / progress_percent / stage / last_assistant_reply / updated_at` + +### 3.3 `api-server` + +负责: + +1. 读取拼图 session 快照 +2. 组织 LLM prompt +3. 流式截取 `replyText` +4. 回合结束后组装 finalize 输入 +5. 调用 SpacetimeDB finalize procedure + +## 4. 目标链路 + +### 4.1 阶段 A:提交消息 + +`submit_puzzle_agent_message` + +职责: + +1. 写入 user message +2. 返回 submit 后的 session 快照 +3. 该快照中尚未新增 assistant message +4. 该快照中的 `anchorPack / progressPercent / currentTurn` 保持提交前真相 + +### 4.2 阶段 B:完成单轮推理 + +`finalize_puzzle_agent_message_turn` + +职责: + +1. 追加 assistant message +2. 回写: + - `current_turn` + - `progress_percent` + - `stage` + - `anchor_pack_json` + - `last_assistant_reply` + - `updated_at` +3. 若已存在 `draft_json`,允许继续保留,不在聊天 finalize 中改写结果页草稿 + +## 5. LLM 输出契约 + +拼图聊天不需要复刻 Custom World 那么重的多层结构,本轮冻结为单个 JSON: + +```json +{ + "replyText": "我已经收住画面方向了,接下来你更想强调夜雨反光,还是猫咪本身的奇幻感?", + "progressPercent": 46, + "nextAnchorPack": { + "themePromise": { + "key": "themePromise", + "label": "题材承诺", + "value": "雨夜中的奇幻探索", + "status": "confirmed" + }, + "visualSubject": { + "key": "visualSubject", + "label": "画面主体", + "value": "发光猫咪站在遗迹台阶上", + "status": "confirmed" + }, + "visualMood": { + "key": "visualMood", + "label": "视觉气质", + "value": "潮湿、梦幻、带轻微悬疑", + "status": "confirmed" + }, + "compositionHooks": { + "key": "compositionHooks", + "label": "拼图记忆点", + "value": "台阶透视、倒影、远处遗迹门洞", + "status": "inferred" + }, + "tagsAndForbidden": { + "key": "tagsAndForbidden", + "label": "标签与禁忌", + "value": "雨夜、猫咪、神庙遗迹;禁止文字水印", + "status": "inferred" + } + } +} +``` + +要求: + +1. 只能输出 JSON +2. `progressPercent` 范围固定 `0..100` +3. `nextAnchorPack` 必须是完整对象,不允许只给增量 patch + +## 6. Prompt 设计 + +本轮不追求“复杂创作状态识别器”,只做拼图场景最小可用 prompt: + +1. system prompt 明确模型角色是“拼图视觉共创策划” +2. 明确 5 个锚点: + - 题材承诺 + - 画面主体 + - 视觉气质 + - 拼图记忆点 + - 标签与禁忌 +3. 明确回复必须: + - 自然中文 + - 一次只推进一个最关键问题 + - 不提“字段”“锚点”“JSON 结构”等内部词 +4. user prompt 携带: + - 当前 turn / progress + - 当前 anchor pack + - 最近聊天记录 + - 输出 JSON 契约 + +## 7. SSE 口径 + +`POST /api/runtime/puzzle/agent/sessions/:sessionId/messages/stream` + +成功时按顺序输出: + +1. 多个 `reply_delta` +2. 一个 `session` +3. 一个 `done` + +失败时输出: + +1. `error` + +要求: + +1. `reply_delta.text` 来自真实流式累计 `replyText` +2. `session` 必须来自 finalize 后重新读取的最新 session + +## 8. 错误策略 + +1. 如果 `llm_client` 未配置: + - 普通接口返回 `502` + - SSE 返回 `error` + - 不写 assistant message +2. 如果 LLM 响应解析失败: + - 普通接口返回 `502` + - SSE 返回 `error` + - 只保留 user message +3. 如果 finalize 失败: + - 普通接口返回 `502` + - SSE 返回 `error` + - 以前端重新拉 session 为准 + +## 9. 实现清单 + +1. `module-puzzle` + - 新增 `PuzzleAgentMessageFinalizeInput` +2. `spacetime-module/src/puzzle.rs` + - 新增 `finalize_puzzle_agent_message_turn` + - 修改 `submit_puzzle_agent_message` +3. `spacetime-client` + - 刷新 Rust bindings + - 新增 `finalize_puzzle_agent_message(...)` +4. `api-server` + - 新增 `puzzle_agent_turn.rs` + - `puzzle.rs` 的普通消息与 SSE 改接 turn service +5. `docs/technical/README.md` + - 补入本文档索引 + +## 10. 验收 + +1. 拼图 Agent 普通发送接口不再返回固定 assistant 文案 +2. 拼图 Agent SSE 可看到逐步增长的 `reply_delta` +3. finalize 后 `session.messages` 中新增 assistant chat 消息 +4. `session.anchorPack / progressPercent / currentTurn / lastAssistantReply` 已真实更新 +5. LLM 关闭时不会再写入伪造 assistant 回复 diff --git a/docs/technical/README.md b/docs/technical/README.md index a7f309cf..7802752d 100644 --- a/docs/technical/README.md +++ b/docs/technical/README.md @@ -4,7 +4,13 @@ ## 文档列表 +- [ADMIN_CONSOLE_SERVICE_DESIGN_2026-04-23.md](./ADMIN_CONSOLE_SERVICE_DESIGN_2026-04-23.md):冻结 Rust `api-server` 内后台管理服务首版方案,明确管理员用户名密码登录、管理员 JWT 鉴权、数据库概览、受控 API 调试台与同源管理页面的落地边界。 +- [SPACETIME_MODULE_LIB_RS_SPLIT_EXECUTION_2026-04-23.md](./SPACETIME_MODULE_LIB_RS_SPLIT_EXECUTION_2026-04-23.md):冻结 `server-rs/crates/spacetime-module/src/lib.rs` 的模块地图、二级落位点与迁移顺序,要求后续 SpacetimeDB 主工程改动按对应模块落位,不再继续堆回单大文件。 +- [CUSTOM_WORLD_DRAFT_FOUNDATION_API_SERVER_LLM_MIGRATION_2026-04-23.md](./CUSTOM_WORLD_DRAFT_FOUNDATION_API_SERVER_LLM_MIGRATION_2026-04-23.md):冻结 `draft_foundation` 从 SpacetimeDB 内部规则编译迁到 `api-server + platform-llm` 的边界,明确草稿必须由 `api-server` 真实调 LLM 生成,SpacetimeDB 只负责落库。 - [CUSTOM_WORLD_AGENT_LLM_REPLY_RESTORE_2026-04-22.md](./CUSTOM_WORLD_AGENT_LLM_REPLY_RESTORE_2026-04-22.md):恢复 Custom World Agent 聊天必须走大模型推理的 Rust 落地方案,冻结 submit/finalize 两阶段职责、旧 Node 提示词原样搬运、SSE 流式回复与 session 回写边界。 +- [PUZZLE_AGENT_LLM_REPLY_INTEGRATION_2026-04-23.md](./PUZZLE_AGENT_LLM_REPLY_INTEGRATION_2026-04-23.md):冻结拼图 Agent 聊天接入真实 LLM 的最小 Rust 落地方案,明确 submit 只写 user message、`api-server` 承接推理、SSE 流式回放与 finalize 回写 session 真相的边界。 +- [UNIFIED_CREATION_DRAFT_SESSION_RESTORE_2026-04-23.md](./UNIFIED_CREATION_DRAFT_SESSION_RESTORE_2026-04-23.md):冻结创作中心全草稿恢复 Agent 会话的统一口径,覆盖 RPG、Big Fish、Puzzle 三类草稿的会话索引、结果页分流和 Big Fish works 最小投影边界。 +- [PUZZLE_DRAFT_SESSION_RESTORE_2026-04-23.md](./PUZZLE_DRAFT_SESSION_RESTORE_2026-04-23.md):冻结拼图结果页草稿进入创作中心后的恢复口径,明确 draft 作品投影、`sourceSessionId` 反查 Agent session、编译时同步落草稿卡与发布复用同一作品记录。 - [RUST_LOCAL_DEV_SPACETIMEDB_PUBLISH_GUARD_AND_AGENT_LLM_FAILURE_POLICY_2026-04-23.md](./RUST_LOCAL_DEV_SPACETIMEDB_PUBLISH_GUARD_AND_AGENT_LLM_FAILURE_POLICY_2026-04-23.md):冻结 Rust 本地联调启动前必须 publish/generate 最新 `spacetime-module` 的守卫,以及 Custom World Agent 在 LLM 失败时禁止写固定 assistant 回复的 finalize 与 HTTP/SSE 错误策略。 - [CREATION_AGENT_CHAT_SCROLL_FOLLOW_POLICY_FIX_2026-04-23.md](./CREATION_AGENT_CHAT_SCROLL_FOLLOW_POLICY_FIX_2026-04-23.md):记录统一创作聊天工作区从“每次更新都强制滚到底”改为“仅在用户仍停留在底部附近时跟随”的滚动策略修复,避免流式回复持续抢走阅读位置。 - [CREATION_AGENT_STREAMING_MESSAGE_STABILITY_FIX_2026-04-23.md](./CREATION_AGENT_STREAMING_MESSAGE_STABILITY_FIX_2026-04-23.md):记录创作 Agent 聊天流式文本、玩家乐观消息、最终 session 回写和草稿切换的展示稳定性修复,避免乱码、闪消、插队和旧草稿闪烁。 @@ -14,7 +20,7 @@ - [CREATION_CATEGORY_OPENING_TIMEOUT_GUARD_FIX_2026-04-22.md](./CREATION_CATEGORY_OPENING_TIMEOUT_GUARD_FIX_2026-04-22.md):记录创作中心点击类别后长时间停留在“正在开启”的根因与修复口径,收口前端创建会话启动超时、中文错误提示以及 Big Fish / 拼图代理上游超时兜底。 - [JENKINS_RUST_BUILD_DEPLOY_PIPELINES_2026-04-23.md](./JENKINS_RUST_BUILD_DEPLOY_PIPELINES_2026-04-23.md):冻结 Jenkins `构建 / 部署 / 构建并部署` 三条流水线的职责、版本号传递、上游触发门禁、本地目录部署脚本与 `/home/ubuntu/Genarrative-deploy/` 覆盖策略。 - [RUST_LOCAL_AND_REMOTE_DEPLOYMENT_SCRIPTS_2026-04-22.md](./RUST_LOCAL_AND_REMOTE_DEPLOYMENT_SCRIPTS_2026-04-22.md):冻结 Rust 本地一键联调脚本与 Ubuntu 发布包构建脚本的执行口径,覆盖 `npm run dev:rust`、`npm run build:rust:ubuntu`、Vite release、Linux `api-server`、SpacetimeDB wasm、启动停止脚本、默认 scp 上传和安全清库开关。 -- [RUST_API_SERVER_ROUTE_INDEX_2026-04-22.md](./RUST_API_SERVER_ROUTE_INDEX_2026-04-22.md):记录当前 Rust `api-server` 已挂载的 96 条 Axum 路由,按 auth、assets、runtime、custom world、story、generated path 等挂载面归类,用于对照 Node 能力基线与切流 smoke 清单。 +- [RUST_API_SERVER_ROUTE_INDEX_2026-04-22.md](./RUST_API_SERVER_ROUTE_INDEX_2026-04-22.md):记录当前 Rust `api-server` 已挂载的 101 条 Axum 路由,并补充管理后台入口与管理接口索引,按 auth、assets、runtime、custom world、story、generated path 等挂载面归类,用于对照 Node 能力基线与切流 smoke 清单。 - [BACKEND_REWRITE_CROSS_CUTTING_GOVERNANCE_2026-04-22.md](./BACKEND_REWRITE_CROSS_CUTTING_GOVERNANCE_2026-04-22.md):冻结后端重写收口阶段的横向治理规则,覆盖 TypeScript contract 到 Rust DTO 映射、SpacetimeDB schema 演进、大对象 / workflow cache 存储边界和文档维护门禁。 - [PLATFORM_LLM_TEXT_GATEWAY_DESIGN_2026-04-21.md](./PLATFORM_LLM_TEXT_GATEWAY_DESIGN_2026-04-21.md):`platform-llm` 文本模型网关首版设计,冻结 OpenAI 兼容 `/chat/completions`、SSE 增量解析、错误模型与重试边界。 - [API_SERVER_PLATFORM_LLM_PROXY_DESIGN_2026-04-21.md](./API_SERVER_PLATFORM_LLM_PROXY_DESIGN_2026-04-21.md):`api-server` 接入 `platform-llm` 的最小代理设计,冻结 `/api/llm/chat/completions` 的配置、状态注入与首版非流式兼容边界。 @@ -30,6 +36,10 @@ - [PHONE_SMS_SEND_CODE_OBSERVABILITY_FIX_2026-04-23.md](./PHONE_SMS_SEND_CODE_OBSERVABILITY_FIX_2026-04-23.md):冻结手机号验证码发送链路的日志补强口径,确保 `api-server`、`module-auth`、`platform-auth` 能直接暴露发送前后与错误分类关键字段。 - [PHONE_SMS_DELIVERY_OBSERVABILITY_AND_RECEIPT_DESIGN_2026-04-22.md](./PHONE_SMS_DELIVERY_OBSERVABILITY_AND_RECEIPT_DESIGN_2026-04-22.md):冻结短信平台受理成功与最终送达状态的区分方式、追踪字段、送达回执接口和前端提示文案边界。 - [PHONE_SMS_REAL_PROVIDER_MANUAL_VERIFICATION_RUNBOOK_2026-04-23.md](./PHONE_SMS_REAL_PROVIDER_MANUAL_VERIFICATION_RUNBOOK_2026-04-23.md):冻结验证清单第一项“真实短信验证码链路”的本地启动、前端操作、日志观察点、通过标准与失败排查步骤。 +- [ASSET_EXTERNAL_GENERATION_MANUAL_VERIFICATION_RUNBOOK_2026-04-23.md](./ASSET_EXTERNAL_GENERATION_MANUAL_VERIFICATION_RUNBOOK_2026-04-23.md):冻结验证清单第四项“图片、视频、动作真实外部生成”的人工联调口径,明确哪些入口已接真实外部图片服务、哪些入口仍是 Stage 1 占位链,以及前端点击路径、日志观察点和通过标准。 +- [M6_CHARACTER_VISUAL_ASSET_EXTERNAL_GENERATION_STAGE2_2026-04-23.md](./M6_CHARACTER_VISUAL_ASSET_EXTERNAL_GENERATION_STAGE2_2026-04-23.md):冻结角色主形象从 Stage 1 SVG 占位草稿切到 DashScope 真实出图的 Stage 2 口径,覆盖模型、参考图解析、去底处理、OSS 草稿存储和失败策略。 +- [M6_CHARACTER_ANIMATION_ASSET_EXTERNAL_GENERATION_STAGE2_2026-04-23.md](./M6_CHARACTER_ANIMATION_ASSET_EXTERNAL_GENERATION_STAGE2_2026-04-23.md):冻结角色动作从 Stage 1 占位视频切到真实 Ark/DashScope 生成的 Stage 2 口径,优先明确 image-to-video 主链、Ark 固定参数、媒体上传与错误回退规则。 +- [M6_CHARACTER_ANIMATION_BACKEND_FRAME_EXTRACTION_AND_PUBLISH_STAGE3_2026-04-23.md](./M6_CHARACTER_ANIMATION_BACKEND_FRAME_EXTRACTION_AND_PUBLISH_STAGE3_2026-04-23.md):冻结角色动作正式发布链从“前端抽帧回传”继续迁到“后端抽帧、去绿幕、上传 OSS、落库绑定”的 Stage 3 口径,明确 `ffmpeg/ffprobe` 依赖、contract 扩展与兼容策略。 - [WECHAT_LOGIN_AXUM_IMPLEMENTATION_DESIGN_2026-04-21.md](./WECHAT_LOGIN_AXUM_IMPLEMENTATION_DESIGN_2026-04-21.md):Rust `api-server` 微信登录实现设计,冻结微信 provider 接入、系统 JWT 签发边界、`wechat/start` / `wechat/callback` / `wechat/bind-phone` 闭环,以及与后续 `SpacetimeDB` claims 透传的关系。 - [WECHAT_LOGIN_REAL_INTEGRATION_RUNBOOK_2026-04-21.md](./WECHAT_LOGIN_REAL_INTEGRATION_RUNBOOK_2026-04-21.md):微信登录从本地 mock 到真实微信开放平台联调的执行手册,覆盖环境变量、回调域名、代理头要求、验证步骤与常见失败排查。 - [PASSWORD_ENTRY_FLOW_DESIGN_2026-04-21.md](./PASSWORD_ENTRY_FLOW_DESIGN_2026-04-21.md):密码登录与自动建号落地设计,冻结 `/api/auth/entry`、幂等兼容策略、模块边界以及与 JWT / refresh cookie 的衔接方式。 diff --git a/docs/technical/RUST_API_SERVER_ROUTE_INDEX_2026-04-22.md b/docs/technical/RUST_API_SERVER_ROUTE_INDEX_2026-04-22.md index 8d7195c1..753fc251 100644 --- a/docs/technical/RUST_API_SERVER_ROUTE_INDEX_2026-04-22.md +++ b/docs/technical/RUST_API_SERVER_ROUTE_INDEX_2026-04-22.md @@ -1,6 +1,6 @@ -# Rust API Server 路由索引(2026-04-22) +# Rust API Server 路由索引(2026-04-23) -更新时间:`2026-04-22` +更新时间:`2026-04-23` ## 1. 文档目标 @@ -10,27 +10,36 @@ ## 2. 当前统计 -当前 Rust `api-server` 从 `app.rs` 可抽取到 `96` 条路由: +当前 Rust `api-server` 从 `app.rs` 可抽取到 `101` 条路由: -1. 内部鉴权调试接口:`2` 条。 -2. AI task 接口:`9` 条。 -3. assets / OSS 接口:`15` 条。 -4. auth 接口:`12` 条。 -5. custom world / agent 接口:`23` 条。 -6. llm proxy 接口:`1` 条。 -7. profile / runtime profile 接口:`12` 条。 -8. runtime story / story gameplay 接口:`15` 条。 -9. legacy generated 静态路径兼容:`6` 条。 -10. health check:`1` 条。 +1. 管理后台接口:`5` 条。 +2. 内部鉴权调试接口:`2` 条。 +3. AI task 接口:`9` 条。 +4. assets / OSS 接口:`15` 条。 +5. auth 接口:`12` 条。 +6. custom world / agent 接口:`23` 条。 +7. llm proxy 接口:`1` 条。 +8. profile / runtime profile 接口:`12` 条。 +9. runtime story / story gameplay 接口:`15` 条。 +10. legacy generated 静态路径兼容:`6` 条。 +11. health check:`1` 条。 ## 3. 路由清单 -### 3.1 内部鉴权调试 +### 3.1 管理后台 + +1. `GET /admin` +2. `POST /admin/api/login` +3. `GET /admin/api/me` +4. `GET /admin/api/overview` +5. `POST /admin/api/debug/http` + +### 3.2 内部鉴权调试 1. `GET /_internal/auth/claims` 2. `GET /_internal/auth/refresh-cookie` -### 3.2 AI Task +### 3.3 AI Task 1. `POST /api/ai/tasks` 2. `POST /api/ai/tasks/{task_id}/start` @@ -42,7 +51,7 @@ 8. `POST /api/ai/tasks/{task_id}/stages/{stage_kind}/start` 9. `POST /api/ai/tasks/{task_id}/stages/{stage_kind}/complete` -### 3.3 Assets / OSS +### 3.4 Assets / OSS 1. `POST /api/assets/direct-upload-tickets` 2. `POST /api/assets/sts-upload-credentials` @@ -60,7 +69,7 @@ 14. `GET /api/assets/character-workflow-cache/{character_id}` 15. `GET / POST /api/assets/character-workflow-cache` -### 3.4 Auth +### 3.5 Auth 1. `GET /api/auth/login-options` 2. `GET /api/auth/me` @@ -75,7 +84,7 @@ 11. `POST /api/auth/wechat/bind-phone` 12. `POST /api/auth/entry` -### 3.5 Custom World / Agent +### 3.6 Custom World / Agent 1. `GET /api/runtime/custom-world-library` 2. `GET /api/runtime/custom-world-library/{profile_id}` @@ -101,11 +110,11 @@ 22. `POST /api/runtime/custom-world/cover-image` 23. `POST /api/runtime/custom-world/cover-upload` -### 3.6 LLM Proxy +### 3.7 LLM Proxy 1. `POST /api/llm/chat/completions` -### 3.7 Profile / Runtime Profile +### 3.8 Profile / Runtime Profile 1. `GET /api/profile/dashboard` 2. `GET /api/runtime/profile/dashboard` @@ -120,7 +129,7 @@ 11. `POST /api/profile/save-archives/{world_key}` 12. `POST /api/runtime/profile/save-archives/{world_key}` -### 3.8 Runtime Story / Gameplay +### 3.9 Runtime Story / Gameplay 1. `POST /api/runtime/save/snapshot` 2. `GET /api/runtime/settings` @@ -138,7 +147,7 @@ 14. `POST /api/story/npc/battle` 15. `GET /api/runtime/sessions/{runtime_session_id}/inventory` -### 3.9 Legacy Generated 路径 +### 3.10 Legacy Generated 路径 1. `GET /generated-character-drafts/{*path}` 2. `GET /generated-characters/{*path}` @@ -147,7 +156,7 @@ 5. `GET /generated-custom-world-covers/{*path}` 6. `GET /generated-qwen-sprites/{*path}` -### 3.10 Health +### 3.11 Health 1. `GET /healthz` diff --git a/docs/technical/SPACETIME_MODULE_LIB_RS_SPLIT_EXECUTION_2026-04-23.md b/docs/technical/SPACETIME_MODULE_LIB_RS_SPLIT_EXECUTION_2026-04-23.md new file mode 100644 index 00000000..543d2fb8 --- /dev/null +++ b/docs/technical/SPACETIME_MODULE_LIB_RS_SPLIT_EXECUTION_2026-04-23.md @@ -0,0 +1,241 @@ +# spacetime-module `lib.rs` 拆分执行方案 + +日期:`2026-04-23` + +## 1. 背景 + +当前 `server-rs/crates/spacetime-module/src/lib.rs` 已经超过 `9000` 行,同时混合了承载: + +1. SpacetimeDB 主工程入口 +2. 跨域共享类型 +3. Big Fish +4. Asset Metadata +5. Runtime +6. Gameplay +7. Custom World +8. AI +9. Puzzle +10. 测试 + +这会直接导致: + +1. 任意一个领域改动都要在同一个超大文件里定位 +2. 不同玩法与领域的 reducer / procedure / helper 互相缠绕 +3. 结构上已经与 `M7` 冻结的“按业务与 SpacetimeDB 聚合层次拆分目录”目标不一致 + +## 2. 本轮约束 + +本轮拆分严格遵守以下规则: + +1. 只做物理结构收口,不改 table 名、reducer 名、procedure 名。 +2. 不改现有 schema 字段名、字段顺序语义与已有对外 contract。 +3. 不把外部副作用搬进 SpacetimeDB reducer / procedure。 +4. 允许在过渡期继续保留少量跨域 helper 在 `lib.rs`,但新增内容禁止继续直接堆回 `lib.rs`。 + +## 3. 模块地图 + +### 3.1 根入口 + +`server-rs/crates/spacetime-module/src/lib.rs` + +后续只允许保留: + +1. `use` 聚合 +2. `mod` 声明 +3. 少量跨域共享 helper +4. 迁移过渡期测试 + +禁止继续新增某个具体业务域的 table / reducer / procedure / tx helper。 + +导入导出风格同步冻结为: + +1. `src/lib.rs` 对外统一优先使用 `pub use xxx::*;` 重新导出主工程模块与外部模块 crate 内容。 +2. 已拆出的业务模块内部统一优先使用 `use crate::*;`,避免每个文件重复维护大段显式 `use` 列表。 +3. 子模块只有遇到命名冲突、宏限制或无法从 crate 根重导出的外部符号时,才允许补局部显式 `use`。 +4. 后续拆分时不再因为导入列表变长而把业务实现留在 `lib.rs`。 + +### 3.2 已冻结的一级模块 + +1. `src/entry.rs` + - 模块初始化入口 + - `#[spacetimedb::reducer(init)]` +2. `src/domain_types.rs` + - 跨域共享的 SpacetimeDB 类型 + - 目前主要承载 NPC 开战桥接输入输出 +3. `src/asset_metadata/mod.rs` + - `asset_object` + - `asset_entity_binding` + - 资产确认与绑定 reducer / procedure +4. `src/big_fish/mod.rs` + - Big Fish session / message / asset slot / runtime run + - Big Fish procedure 与 tx helper +5. `src/runtime/mod.rs` + - Runtime settings / snapshots / browse history / dashboard / wallet / save archive +6. `src/gameplay/mod.rs` + - `story / combat / inventory / npc / quest / runtime_item / progression` +7. `src/custom_world/mod.rs` + - profile / session / agent / publish / gallery / works +8. `src/ai/mod.rs` + - ai task / stage / chunk / reference +9. `src/puzzle.rs` + - 拼图玩法当前仍为单文件域模块,后续再决定是否继续拆目录 + +### 3.3 本轮先创建的二级落位点 + +#### `asset_metadata/` + +1. `objects.rs` +2. `bindings.rs` + +#### `big_fish/` + +1. `tables.rs` +2. `session.rs` +3. `assets.rs` +4. `runtime.rs` + +#### `runtime/` + +1. `settings.rs` +2. `snapshots.rs` +3. `browse_history.rs` +4. `profile.rs` + +#### `gameplay/` + +1. `combat.rs` +2. `inventory.rs` +3. `npc.rs` +4. `progression.rs` +5. `quest.rs` +6. `runtime_item.rs` +7. `story.rs` + +#### `custom_world/` + +1. `profile.rs` +2. `session.rs` +3. `agent.rs` +4. `publishing.rs` +5. `gallery.rs` +6. `works.rs` + +#### `ai/` + +1. `tasks.rs` +2. `stages.rs` +3. `snapshots.rs` + +## 4. 迁移顺序 + +为了降低脏工作区下的冲突风险,本轮按下面顺序推进: + +1. 先冻结文档与 README 路由规则。 +2. 先创建二级空模块文件,作为后续内容落位点。 +3. 第一批先迁: + - `entry.rs` + - `domain_types.rs` + - `asset_metadata/mod.rs` + - `big_fish/mod.rs` +4. 第二批再迁: + - `runtime/mod.rs` + - `gameplay/mod.rs` +5. 第三批再迁: + - `custom_world/mod.rs` + - `ai/mod.rs` +6. `puzzle.rs` 暂时保持单文件,不在本轮强拆。 + +## 5. 本轮完成标准 + +1. `README.md` 明确声明后续新增逻辑的落位规则。 +2. 一级模块与二级空模块文件创建完成。 +3. `lib.rs` 不再承载 `init`、共享 domain types、asset metadata、big fish 的实现细节。 +4. `cargo check -p spacetime-module --lib` 继续通过。 +5. 中文文档与 Rust 文件经过编码检查,没有写坏。 + +## 6. `runtime` 域实拆记录 + +`2026-04-23` 追加执行 `runtime` 域真实内容拆分,目标是把根入口中的 runtime 表、procedure 与同域 tx helper 收口到 `src/runtime/`,同时保持对外 API 名称不变。 + +### 6.1 已落位文件 + +1. `server-rs/crates/spacetime-module/src/runtime/mod.rs` + - 仅保留二级模块声明与 `pub use xxx::*;` 聚合导出。 +2. `server-rs/crates/spacetime-module/src/runtime/settings.rs` + - 承载 `RuntimeSetting` + - 承载 runtime setting 的读取、upsert procedure 与快照构建 helper。 +3. `server-rs/crates/spacetime-module/src/runtime/snapshots.rs` + - 承载 `RuntimeSnapshotRow` + - 承载 runtime snapshot 的读取、upsert、delete 与 JSON 解析 helper。 +4. `server-rs/crates/spacetime-module/src/runtime/browse_history.rs` + - 承载 `UserBrowseHistory` + - 承载平台浏览历史 list、upsert、clear procedure 与行转换 helper。 +5. `server-rs/crates/spacetime-module/src/runtime/profile.rs` + - 承载 `ProfileDashboardState` + - 承载 `ProfileWalletLedger` + - 承载 `ProfilePlayedWorld` + - 承载 `ProfileSaveArchive` + - 承载 profile dashboard、wallet ledger、play stats、save archive 投影与 snapshot 同步 helper。 + +### 6.2 根入口调整 + +`server-rs/crates/spacetime-module/src/lib.rs` 当前只通过下面方式接入 runtime 域: + +1. `mod runtime;` +2. `pub use runtime::*;` + +原先留在 `lib.rs` 的 runtime setting、snapshot、profile、browse history 旧 helper 已删除,避免同名实现重复存在,也避免后续继续在根入口堆叠 runtime 业务逻辑。 + +### 6.3 后续维护规则 + +1. 对外导出继续通过 `pub use runtime::*;` 以及 `src/runtime/mod.rs` 中的 `pub use xxx::*;` 透出。 +2. `runtime` 子文件内部优先使用 `use crate::*;`,只有 SpacetimeDB table accessor trait、命名冲突或宏限制需要时才补最小显式导入。 +3. 新增 runtime 相关表、procedure、reducer 或 tx helper 时,必须先按 `settings / snapshots / browse_history / profile` 判断二级落位点;不匹配时先更新本文件与 README,再新增二级模块。 +4. `lib.rs` 只保留跨域共享 helper 和尚未迁出的过渡代码,不再接收 runtime 域新增实现。 + +## 7. `ai` 域实拆记录 + +`2026-04-23` 追加执行 `ai` 域真实内容拆分,目标是把根入口中的 AI 表、procedure 与同域 tx helper 收口到 `src/ai/`,同时保持 `module-ai` 对外输入输出 contract 与 SpacetimeDB reducer / procedure 名称不变。 + +### 7.1 已落位文件 + +1. `server-rs/crates/spacetime-module/src/ai/mod.rs` + - 仅保留二级模块声明与聚合导出。 + - public API 通过 `pub use stages::*;` 和 `pub use tasks::*;` 透出。 + - 内部转换 helper 通过 `pub(crate) use snapshots::*;` 供 AI 子模块共享。 +2. `server-rs/crates/spacetime-module/src/ai/tasks.rs` + - 承载 `AiTask` + - 承载 `create_ai_task` + - 承载 `create_ai_task_and_return` + - 承载 `start_ai_task` + - 承载 `complete_ai_task_and_return` + - 承载 `fail_ai_task_and_return` + - 承载 `cancel_ai_task_and_return` + - 承载 task 状态迁移、读取与持久化 helper。 +3. `server-rs/crates/spacetime-module/src/ai/stages.rs` + - 承载 `AiTaskStage` + - 承载 `AiTextChunk` + - 承载 `AiResultReference` + - 承载 `start_ai_task_stage` + - 承载 `append_ai_text_chunk_and_return` + - 承载 `complete_ai_stage_and_return` + - 承载 `attach_ai_result_reference_and_return` + - 承载阶段流式文本聚合、阶段替换与 result reference 写入 helper。 +4. `server-rs/crates/spacetime-module/src/ai/snapshots.rs` + - 承载 `AiTask / AiTaskStage / AiTextChunk / AiResultReference` 的 row 与 snapshot 转换 helper。 + +### 7.2 根入口调整 + +`server-rs/crates/spacetime-module/src/lib.rs` 当前只通过下面方式接入 AI 域: + +1. `mod ai;` +2. `pub use ai::*;` + +原先留在 `lib.rs` 的 AI 表、procedure 与 helper 已删除,避免根入口继续堆叠 AI 业务实现。 + +### 7.3 后续维护规则 + +1. 对外导出继续通过 `pub use ai::*;` 以及 `src/ai/mod.rs` 中的 `pub use xxx::*;` 透出。 +2. `ai` 子文件内部优先使用 `use crate::*;`,只有 `module_ai` 中的归一化函数、校验函数、ID 前缀常量等需要避免 glob 歧义的符号才补最小显式导入。 +3. 新增 AI 相关表、procedure、reducer 或 tx helper 时,必须先按 `tasks / stages / snapshots` 判断二级落位点;不匹配时先更新本文件与 README,再新增二级模块。 +4. `lib.rs` 不再接收 AI 域新增实现。 diff --git a/packages/shared/src/contracts/auth.ts b/packages/shared/src/contracts/auth.ts index 7054bba5..c39f053c 100644 --- a/packages/shared/src/contracts/auth.ts +++ b/packages/shared/src/contracts/auth.ts @@ -3,6 +3,7 @@ export type AuthLoginMethod = 'password' | 'phone' | 'wechat'; export type AuthUser = { id: string; + publicUserCode: string; username: string; displayName: string; phoneNumberMasked: string | null; @@ -11,6 +12,16 @@ export type AuthUser = { wechatBound: boolean; }; +export type PublicUserSummary = { + id: string; + publicUserCode: string; + displayName: string; +}; + +export type PublicUserSearchResponse = { + user: PublicUserSummary; +}; + export type AuthEntryRequest = { username: string; password: string; diff --git a/packages/shared/src/contracts/rpgCreationFixtures.ts b/packages/shared/src/contracts/rpgCreationFixtures.ts index 697c2276..07f38d3b 100644 --- a/packages/shared/src/contracts/rpgCreationFixtures.ts +++ b/packages/shared/src/contracts/rpgCreationFixtures.ts @@ -629,6 +629,8 @@ export function createRpgWorldLibraryEntryFixture(): CustomWorldLibraryEntry = { ownerUserId: string; profileId: string; + publicWorkCode: string | null; + authorPublicUserCode: string | null; profile: TProfile; visibility: CustomWorldPublicationStatus; publishedAt: string | null; diff --git a/server-rs/crates/api-server/src/admin.rs b/server-rs/crates/api-server/src/admin.rs index afecb122..69489b8c 100644 --- a/server-rs/crates/api-server/src/admin.rs +++ b/server-rs/crates/api-server/src/admin.rs @@ -1,4 +1,7 @@ -use std::collections::BTreeSet; +use std::{ + collections::BTreeSet, + net::{IpAddr, Ipv4Addr, Ipv6Addr}, +}; use axum::{ Json, @@ -21,10 +24,13 @@ use shared_contracts::admin::{ use time::{OffsetDateTime, format_description::well_known::Rfc3339}; use crate::{ - api_response::json_success_body, http_error::AppError, request_context::RequestContext, + api_response::json_success_body, + http_error::AppError, + request_context::RequestContext, state::{AdminRuntime, AppState}, }; +// 首版调试台只允许有限大小的请求体,避免把后台当作通用代理大包转发器。 const MAX_DEBUG_BODY_BYTES: usize = 128 * 1024; const BLOCKED_DEBUG_HEADERS: &[&str] = &[ "host", @@ -33,6 +39,7 @@ const BLOCKED_DEBUG_HEADERS: &[&str] = &[ "transfer-encoding", "expect", ]; +// 数据库概览首版只统计受控白名单表,禁止后台页面直接输入任意 SQL。 const DATABASE_OVERVIEW_TABLES: &[&str] = &[ "runtime_setting", "runtime_snapshot", @@ -124,9 +131,9 @@ pub async fn admin_login( Extension(request_context): Extension, Json(payload): Json, ) -> Result, AppError> { - let runtime = state - .admin_runtime() - .ok_or_else(|| AppError::from_status(StatusCode::SERVICE_UNAVAILABLE).with_message("后台管理未启用"))?; + let runtime = state.admin_runtime().ok_or_else(|| { + AppError::from_status(StatusCode::SERVICE_UNAVAILABLE).with_message("后台管理未启用") + })?; let expected_username = runtime.username().trim(); let expected_password = runtime.password().trim(); @@ -139,16 +146,18 @@ pub async fn admin_login( } if submitted_username != expected_username || submitted_password != expected_password { - return Err(AppError::from_status(StatusCode::UNAUTHORIZED).with_message("管理员用户名或密码错误")); + return Err( + AppError::from_status(StatusCode::UNAUTHORIZED).with_message("管理员用户名或密码错误") + ); } let now = OffsetDateTime::now_utc(); - let claims = runtime - .build_claims(now) - .map_err(|error| AppError::from_status(StatusCode::INTERNAL_SERVER_ERROR).with_message(error))?; - let token = runtime - .sign_token(&claims) - .map_err(|error| AppError::from_status(StatusCode::INTERNAL_SERVER_ERROR).with_message(error))?; + let claims = runtime.build_claims(now).map_err(|error| { + AppError::from_status(StatusCode::INTERNAL_SERVER_ERROR).with_message(error) + })?; + let token = runtime.sign_token(&claims).map_err(|error| { + AppError::from_status(StatusCode::INTERNAL_SERVER_ERROR).with_message(error) + })?; Ok(json_success_body( Some(&request_context), @@ -176,9 +185,9 @@ pub async fn admin_overview( Extension(request_context): Extension, Extension(_admin): Extension, ) -> Result, AppError> { - let runtime = state - .admin_runtime() - .ok_or_else(|| AppError::from_status(StatusCode::SERVICE_UNAVAILABLE).with_message("后台管理未启用"))?; + let runtime = state.admin_runtime().ok_or_else(|| { + AppError::from_status(StatusCode::SERVICE_UNAVAILABLE).with_message("后台管理未启用") + })?; let overview = build_admin_overview(&state, runtime).await?; Ok(json_success_body(Some(&request_context), overview)) @@ -199,9 +208,10 @@ pub async fn require_admin_auth( mut request: Request, next: Next, ) -> Result { - let runtime = state - .admin_runtime() - .ok_or_else(|| AppError::from_status(StatusCode::SERVICE_UNAVAILABLE).with_message("后台管理未启用"))?; + // 后台鉴权必须同时满足:令牌验签通过、主体匹配当前管理员、roles 含 admin。 + let runtime = state.admin_runtime().ok_or_else(|| { + AppError::from_status(StatusCode::SERVICE_UNAVAILABLE).with_message("后台管理未启用") + })?; let bearer_token = extract_bearer_token(request.headers())?; let claims = runtime .verify_token(&bearer_token) @@ -213,7 +223,9 @@ pub async fn require_admin_auth( request .extensions_mut() - .insert(AuthenticatedAdmin::new(build_admin_session_payload(admin_session))); + .insert(AuthenticatedAdmin::new(build_admin_session_payload( + admin_session, + ))); Ok(next.run(request).await) } @@ -252,10 +264,16 @@ async fn build_admin_overview( } async fn fetch_database_overview(state: &AppState) -> AdminDatabaseOverviewPayload { + // 概览直接读取 SpacetimeDB HTTP API,保证后台看到的是真实数据库元信息而不是本地缓存。 let client = Client::new(); let server_root = state.config.spacetime_server_url.trim_end_matches('/'); let database = state.config.spacetime_database.trim(); - let token = state.config.spacetime_token.as_deref().map(str::trim).filter(|value| !value.is_empty()); + let token = state + .config + .spacetime_token + .as_deref() + .map(str::trim) + .filter(|value| !value.is_empty()); let mut fetch_errors = Vec::new(); let database_info = fetch_spacetime_json::( @@ -321,9 +339,15 @@ async fn fetch_database_overview(state: &AppState) -> AdminDatabaseOverviewPaylo schema_table_names.sort(); AdminDatabaseOverviewPayload { - database_identity: database_info.as_ref().and_then(|value| value.database_identity.clone()), - owner_identity: database_info.as_ref().and_then(|value| value.owner_identity.clone()), - host_type: database_info.as_ref().and_then(|value| value.host_type.clone()), + database_identity: database_info + .as_ref() + .and_then(|value| value.database_identity.clone()), + owner_identity: database_info + .as_ref() + .and_then(|value| value.owner_identity.clone()), + host_type: database_info + .as_ref() + .and_then(|value| value.host_type.clone()), schema_table_names, table_stats, fetch_errors, @@ -426,15 +450,12 @@ async fn execute_admin_debug_http( state: &AppState, payload: AdminDebugHttpRequest, ) -> Result { + // 调试请求始终回打当前 api-server,同源受控,不允许作为外部代理使用。 let method = Method::from_bytes(payload.method.trim().as_bytes()).map_err(|_| { AppError::from_status(StatusCode::BAD_REQUEST).with_message("HTTP 方法不合法") })?; let path = normalize_debug_path(&payload.path)?; - let base_url = format!( - "http://{}:{}", - state.config.bind_host.trim(), - state.config.bind_port - ); + let base_url = build_debug_base_url(&state.config.bind_host, state.config.bind_port); let target_url = format!("{base_url}{path}"); let body_text = payload.body.unwrap_or_default(); if body_text.len() > MAX_DEBUG_BODY_BYTES { @@ -451,7 +472,10 @@ async fn execute_admin_debug_http( for header in payload.headers.unwrap_or_default() { let header_name = header.name.trim().to_ascii_lowercase(); - if BLOCKED_DEBUG_HEADERS.iter().any(|blocked| *blocked == header_name) { + if BLOCKED_DEBUG_HEADERS + .iter() + .any(|blocked| *blocked == header_name) + { continue; } let name = HeaderName::from_bytes(header_name.as_bytes()).map_err(|_| { @@ -464,7 +488,8 @@ async fn execute_admin_debug_http( } let response = request.send().await.map_err(|error| { - AppError::from_status(StatusCode::BAD_GATEWAY).with_message(format!("调试请求失败:{error}")) + AppError::from_status(StatusCode::BAD_GATEWAY) + .with_message(format!("调试请求失败:{error}")) })?; let status = response.status(); let headers = response @@ -476,7 +501,8 @@ async fn execute_admin_debug_http( }) .collect::>(); let response_body = response.bytes().await.map_err(|error| { - AppError::from_status(StatusCode::BAD_GATEWAY).with_message(format!("调试响应读取失败:{error}")) + AppError::from_status(StatusCode::BAD_GATEWAY) + .with_message(format!("调试响应读取失败:{error}")) })?; let body_preview = build_body_preview(&response_body); let body_json = serde_json::from_slice::(&response_body).ok(); @@ -490,19 +516,56 @@ async fn execute_admin_debug_http( }) } +fn build_debug_base_url(bind_host: &str, bind_port: u16) -> String { + let debug_host = resolve_debug_host(bind_host); + let authority_host = format_http_authority_host(&debug_host); + format!("http://{authority_host}:{bind_port}") +} + +fn resolve_debug_host(bind_host: &str) -> String { + let trimmed = bind_host.trim(); + if trimmed.is_empty() { + return Ipv4Addr::LOCALHOST.to_string(); + } + + match trimmed.parse::() { + Ok(IpAddr::V4(ip)) if ip.is_unspecified() => Ipv4Addr::LOCALHOST.to_string(), + Ok(IpAddr::V6(ip)) if ip.is_unspecified() => Ipv6Addr::LOCALHOST.to_string(), + Ok(ip) => ip.to_string(), + Err(_) => trimmed.to_string(), + } +} + +fn format_http_authority_host(host: &str) -> String { + if host.starts_with('[') && host.ends_with(']') { + return host.to_string(); + } + if host.parse::().is_ok() { + return format!("[{host}]"); + } + host.to_string() +} + fn normalize_debug_path(path: &str) -> Result { + // 只允许 `/xxx` 形式的同源相对路径,明确拒绝绝对 URL 与后台登录接口。 let trimmed = path.trim(); if trimmed.is_empty() { return Err(AppError::from_status(StatusCode::BAD_REQUEST).with_message("调试路径不能为空")); } if trimmed.starts_with("http://") || trimmed.starts_with("https://") { - return Err(AppError::from_status(StatusCode::BAD_REQUEST).with_message("只允许调试同源相对路径")); + return Err( + AppError::from_status(StatusCode::BAD_REQUEST).with_message("只允许调试同源相对路径") + ); } if !trimmed.starts_with('/') { - return Err(AppError::from_status(StatusCode::BAD_REQUEST).with_message("调试路径必须以 / 开头")); + return Err( + AppError::from_status(StatusCode::BAD_REQUEST).with_message("调试路径必须以 / 开头") + ); } if trimmed == "/admin/api/login" { - return Err(AppError::from_status(StatusCode::BAD_REQUEST).with_message("禁止调试后台登录接口")); + return Err( + AppError::from_status(StatusCode::BAD_REQUEST).with_message("禁止调试后台登录接口") + ); } Ok(trimmed.to_string()) } @@ -540,6 +603,7 @@ fn build_admin_session_payload(session: crate::state::AdminSession) -> AdminSess } } +// 首版后台页面内嵌在 api-server,避免新增独立前端工程与静态资源发布链。 static ADMIN_CONSOLE_HTML: &str = r#" @@ -1051,23 +1115,46 @@ static ADMIN_CONSOLE_HTML: &str = r#" #[cfg(test)] mod tests { - use super::{build_body_preview, normalize_debug_path, trim_preview}; - use axum::http::StatusCode; + use super::{build_body_preview, build_debug_base_url, normalize_debug_path, trim_preview}; + use axum::{http::StatusCode, response::IntoResponse}; #[test] fn normalize_debug_path_rejects_absolute_url() { - let error = normalize_debug_path("https://example.com/api").expect_err("absolute url should fail"); + let error = + normalize_debug_path("https://example.com/api").expect_err("absolute url should fail"); assert_eq!(error.into_response().status(), StatusCode::BAD_REQUEST); } #[test] fn normalize_debug_path_rejects_admin_login_route() { - let error = normalize_debug_path("/admin/api/login").expect_err("admin login route should fail"); + let error = + normalize_debug_path("/admin/api/login").expect_err("admin login route should fail"); assert_eq!(error.into_response().status(), StatusCode::BAD_REQUEST); } + #[test] + fn normalize_debug_path_accepts_healthz() { + let path = normalize_debug_path("/healthz").expect("healthz path should pass validation"); + + assert_eq!(path, "/healthz"); + } + + #[test] + fn build_debug_base_url_rewrites_wildcard_ipv4_to_loopback() { + let url = build_debug_base_url("0.0.0.0", 3200); + + assert_eq!(url, "http://127.0.0.1:3200"); + } + + #[test] + fn build_debug_base_url_wraps_ipv6_host() { + let url = build_debug_base_url("::1", 3200); + + assert_eq!(url, "http://[::1]:3200"); + } + #[test] fn trim_preview_limits_length() { let text = "a".repeat(5000); diff --git a/server-rs/crates/api-server/src/app.rs b/server-rs/crates/api-server/src/app.rs index ce7f5278..4a4e53b3 100644 --- a/server-rs/crates/api-server/src/app.rs +++ b/server-rs/crates/api-server/src/app.rs @@ -30,7 +30,7 @@ use crate::{ require_bearer_auth, }, auth_me::auth_me, - auth_public_user::get_public_user_by_code, + auth_public_user::{get_public_user_by_code, get_public_user_by_id}, auth_sessions::auth_sessions, big_fish::{ create_big_fish_session, execute_big_fish_action, get_big_fish_run, get_big_fish_session, @@ -159,6 +159,10 @@ pub fn build_router(state: AppState) -> Router { "/api/auth/public-users/by-code/{code}", get(get_public_user_by_code), ) + .route( + "/api/auth/public-users/by-id/{user_id}", + get(get_public_user_by_id), + ) .route( "/generated-character-drafts/{*path}", get(proxy_generated_character_drafts), @@ -959,8 +963,10 @@ mod tests { use platform_auth::{ AccessTokenClaims, AccessTokenClaimsInput, AuthProvider, BindingStatus, sign_access_token, }; + use reqwest::Client; use serde_json::Value; use time::OffsetDateTime; + use tokio::net::TcpListener; use tower::ServiceExt; use crate::{config::AppConfig, state::AppState}; @@ -1018,7 +1024,7 @@ mod tests { assert_eq!(payload["ok"], Value::Bool(true)); assert_eq!( payload["service"], - Value::String("genarrative-node-server".to_string()) + Value::String("genarrative-api-server".to_string()) ); } @@ -1052,7 +1058,7 @@ mod tests { assert_eq!(payload["ok"], Value::Bool(true)); assert_eq!( payload["data"]["service"], - Value::String("genarrative-node-server".to_string()) + Value::String("genarrative-api-server".to_string()) ); assert_eq!( payload["meta"]["requestId"], @@ -2986,7 +2992,10 @@ mod tests { serde_json::from_slice(&body).expect("response body should be valid json"); assert!(payload["token"].as_str().is_some()); - assert_eq!(payload["admin"]["username"], Value::String("root".to_string())); + assert_eq!( + payload["admin"]["username"], + Value::String("root".to_string()) + ); } #[tokio::test] @@ -3043,49 +3052,78 @@ mod tests { } #[tokio::test] - async fn admin_debug_http_can_probe_healthz() { + async fn admin_debug_http_can_probe_healthz_when_authenticated() { let mut config = AppConfig::default(); config.admin_username = Some("root".to_string()); config.admin_password = Some("secret123".to_string()); + let listener = TcpListener::bind("127.0.0.1:0") + .await + .expect("listener should bind"); + let local_addr = listener + .local_addr() + .expect("listener should expose local addr"); + config.bind_host = "127.0.0.1".to_string(); + config.bind_port = local_addr.port(); let app = build_router(AppState::new(config).expect("state should build")); + let server = tokio::spawn(async move { + axum::serve(listener, app) + .await + .expect("test admin server should serve"); + }); + let http_client = Client::new(); + let base_url = format!("http://{}", local_addr); - let login_response = app - .clone() - .oneshot( - Request::builder() - .method("POST") - .uri("/admin/api/login") - .header("content-type", "application/json") - .body(Body::from( - serde_json::json!({ - "username": "root", - "password": "secret123" - }) - .to_string(), - )) - .expect("login request should build"), - ) + let login_payload: Value = http_client + .post(format!("{base_url}/admin/api/login")) + .json(&serde_json::json!({ + "username": "root", + "password": "secret123" + })) + .send() .await - .expect("login should succeed"); - let login_body = login_response - .into_body() - .collect() + .expect("login request should succeed") + .json() .await - .expect("login body should collect") - .to_bytes(); - let login_payload: Value = - serde_json::from_slice(&login_body).expect("login payload should be json"); + .expect("login payload should be json"); let access_token = login_payload["token"] .as_str() .expect("token should exist") .to_string(); + let payload: Value = http_client + .post(format!("{base_url}/admin/api/debug/http")) + .bearer_auth(access_token) + .json(&serde_json::json!({ + "method": "GET", + "path": "/healthz", + "headers": [], + "body": "" + })) + .send() + .await + .expect("debug request should succeed") + .json() + .await + .expect("debug payload should be json"); + + server.abort(); + let _ = server.await; + + assert_eq!(payload["status"], Value::Number(200.into())); + } + + #[tokio::test] + async fn admin_debug_http_requires_authentication() { + let mut config = AppConfig::default(); + config.admin_username = Some("root".to_string()); + config.admin_password = Some("secret123".to_string()); + let app = build_router(AppState::new(config).expect("state should build")); + let debug_response = app .oneshot( Request::builder() .method("POST") .uri("/admin/api/debug/http") - .header("authorization", format!("Bearer {access_token}")) .header("content-type", "application/json") .body(Body::from( serde_json::json!({ @@ -3101,16 +3139,6 @@ mod tests { .await .expect("debug request should succeed"); - assert_eq!(debug_response.status(), StatusCode::OK); - let body = debug_response - .into_body() - .collect() - .await - .expect("debug body should collect") - .to_bytes(); - let payload: Value = - serde_json::from_slice(&body).expect("debug payload should be json"); - - assert_eq!(payload["status"], Value::Number(200.into())); + assert_eq!(debug_response.status(), StatusCode::UNAUTHORIZED); } } diff --git a/server-rs/crates/api-server/src/auth_public_user.rs b/server-rs/crates/api-server/src/auth_public_user.rs index e975ba68..efa27da3 100644 --- a/server-rs/crates/api-server/src/auth_public_user.rs +++ b/server-rs/crates/api-server/src/auth_public_user.rs @@ -6,11 +6,8 @@ use axum::{ use shared_contracts::auth::PublicUserSearchResponse; use crate::{ - api_response::json_success_body, - auth_payload::map_public_user_summary_payload, - http_error::AppError, - request_context::RequestContext, - state::AppState, + api_response::json_success_body, auth_payload::map_public_user_summary_payload, + http_error::AppError, request_context::RequestContext, state::AppState, }; pub async fn get_public_user_by_code( @@ -34,6 +31,32 @@ pub async fn get_public_user_by_code( )) } +pub async fn get_public_user_by_id( + State(state): State, + Extension(request_context): Extension, + Path(user_id): Path, +) -> Result, AppError> { + let user_id = user_id.trim(); + if user_id.is_empty() { + return Err(AppError::from_status(StatusCode::BAD_REQUEST).with_message("用户 ID 不能为空")); + } + + let user = state + .auth_user_service() + .get_user_by_id(user_id) + .map_err(map_public_user_id_search_error)? + .ok_or_else(|| { + AppError::from_status(StatusCode::NOT_FOUND).with_message("未找到对应用户") + })?; + + Ok(json_success_body( + Some(&request_context), + PublicUserSearchResponse { + user: map_public_user_summary_payload(user), + }, + )) +} + fn map_public_user_search_error(error: module_auth::PasswordEntryError) -> AppError { match error { module_auth::PasswordEntryError::InvalidPublicUserCode => { @@ -48,3 +71,14 @@ fn map_public_user_search_error(error: module_auth::PasswordEntryError) -> AppEr } } } + +fn map_public_user_id_search_error(error: module_auth::LogoutError) -> AppError { + match error { + module_auth::LogoutError::UserNotFound => { + AppError::from_status(StatusCode::NOT_FOUND).with_message("未找到对应用户") + } + module_auth::LogoutError::Store(_) => { + AppError::from_status(StatusCode::INTERNAL_SERVER_ERROR).with_message(error.to_string()) + } + } +} diff --git a/server-rs/crates/api-server/src/big_fish.rs b/server-rs/crates/api-server/src/big_fish.rs index 11ad02b3..ebc167f9 100644 --- a/server-rs/crates/api-server/src/big_fish.rs +++ b/server-rs/crates/api-server/src/big_fish.rs @@ -13,9 +13,7 @@ use module_assets::{ AssetObjectAccessPolicy, AssetObjectFieldError, build_asset_entity_binding_input, build_asset_object_upsert_input, generate_asset_binding_id, generate_asset_object_id, }; -use platform_oss::{ - LegacyAssetPrefix, OssHeadObjectRequest, OssObjectAccess, OssPutObjectRequest, -}; +use platform_oss::{LegacyAssetPrefix, OssHeadObjectRequest, OssObjectAccess, OssPutObjectRequest}; use serde_json::{Map, Value, json}; use shared_contracts::big_fish::{ BigFishActionResponse, BigFishAgentMessageResponse, BigFishAnchorItemResponse, @@ -711,8 +709,7 @@ struct BigFishFormalAssetContext { const BIG_FISH_TEXT_TO_IMAGE_MODEL: &str = "wan2.2-t2i-flash"; const BIG_FISH_ENTITY_KIND: &str = "big_fish_session"; -const BIG_FISH_DEFAULT_NEGATIVE_PROMPT: &str = - "文字,水印,logo,UI界面,对话框,边框,多余肢体,畸形鱼体,低清晰度,模糊,压缩噪点,现代摄影棚,写实照片背景"; +const BIG_FISH_DEFAULT_NEGATIVE_PROMPT: &str = "文字,水印,logo,UI界面,对话框,边框,多余肢体,畸形鱼体,低清晰度,模糊,压缩噪点,现代摄影棚,写实照片背景"; async fn generate_big_fish_formal_asset( state: &AppState, @@ -839,10 +836,12 @@ fn build_big_fish_formal_asset_context( asset_id, ], }), - _ => Err(AppError::from_status(StatusCode::BAD_REQUEST).with_details(json!({ - "provider": "big-fish", - "message": format!("assetKind `{asset_kind}` 不支持正式图片生成。"), - }))), + _ => Err( + AppError::from_status(StatusCode::BAD_REQUEST).with_details(json!({ + "provider": "big-fish", + "message": format!("assetKind `{asset_kind}` 不支持正式图片生成。"), + })), + ), } } @@ -1028,9 +1027,9 @@ async fn create_big_fish_text_to_image_generation( })) .send() .await - .map_err(|error| map_big_fish_dashscope_request_error(format!( - "创建 Big Fish 图片生成任务失败:{error}" - )))?; + .map_err(|error| { + map_big_fish_dashscope_request_error(format!("创建 Big Fish 图片生成任务失败:{error}")) + })?; let status = response.status(); let response_text = response.text().await.map_err(|error| { map_big_fish_dashscope_request_error(format!("读取 Big Fish 图片生成响应失败:{error}")) @@ -1041,7 +1040,8 @@ async fn create_big_fish_text_to_image_generation( "创建 Big Fish 图片生成任务失败", )); } - let payload = parse_big_fish_json_payload(response_text.as_str(), "解析 Big Fish 图片生成响应失败")?; + let payload = + parse_big_fish_json_payload(response_text.as_str(), "解析 Big Fish 图片生成响应失败")?; let task_id = extract_big_fish_task_id(&payload).ok_or_else(|| { AppError::from_status(StatusCode::BAD_GATEWAY).with_details(json!({ "provider": "dashscope", @@ -1059,9 +1059,11 @@ async fn create_big_fish_text_to_image_generation( ) .send() .await - .map_err(|error| map_big_fish_dashscope_request_error(format!( - "查询 Big Fish 图片生成任务失败:{error}" - )))?; + .map_err(|error| { + map_big_fish_dashscope_request_error(format!( + "查询 Big Fish 图片生成任务失败:{error}" + )) + })?; let poll_status = poll_response.status(); let poll_text = poll_response.text().await.map_err(|error| { map_big_fish_dashscope_request_error(format!( @@ -1115,11 +1117,9 @@ async fn download_big_fish_remote_image( image_url: &str, fallback_message: &str, ) -> Result { - let response = http_client - .get(image_url) - .send() - .await - .map_err(|error| map_big_fish_dashscope_request_error(format!("{fallback_message}:{error}")))?; + let response = http_client.get(image_url).send().await.map_err(|error| { + map_big_fish_dashscope_request_error(format!("{fallback_message}:{error}")) + })?; let status = response.status(); let content_type = response .headers() @@ -1127,10 +1127,9 @@ async fn download_big_fish_remote_image( .and_then(|value| value.to_str().ok()) .unwrap_or("image/jpeg") .to_string(); - let bytes = response - .bytes() - .await - .map_err(|error| map_big_fish_dashscope_request_error(format!("{fallback_message}:{error}")))?; + let bytes = response.bytes().await.map_err(|error| { + map_big_fish_dashscope_request_error(format!("{fallback_message}:{error}")) + })?; if !status.is_success() { return Err( AppError::from_status(StatusCode::BAD_GATEWAY).with_details(json!({ diff --git a/server-rs/crates/api-server/src/character_animation_assets.rs b/server-rs/crates/api-server/src/character_animation_assets.rs index bbb66038..e02caca2 100644 --- a/server-rs/crates/api-server/src/character_animation_assets.rs +++ b/server-rs/crates/api-server/src/character_animation_assets.rs @@ -735,7 +735,7 @@ async fn persist_animation_preview_video( "provider": "character-animation", "message": "当前策略需要真实生成视频结果,不再支持回退到仓库占位预览视频。", })), - ) + ); } }; let put_result = put_character_animation_object( @@ -1005,7 +1005,9 @@ async fn send_ark_image_to_video_request( })) .send() .await - .map_err(|error| map_character_animation_upstream_error(format!("请求 Ark 视频服务失败:{error}"))) + .map_err(|error| { + map_character_animation_upstream_error(format!("请求 Ark 视频服务失败:{error}")) + }) } async fn wait_for_ark_content_generation_task( @@ -1026,7 +1028,9 @@ async fn wait_for_ark_content_generation_task( ) .send() .await - .map_err(|error| map_character_animation_upstream_error(format!("查询 Ark 视频任务失败:{error}")))?; + .map_err(|error| { + map_character_animation_upstream_error(format!("查询 Ark 视频任务失败:{error}")) + })?; let status = response.status(); let text = response.text().await.map_err(|error| { map_character_animation_upstream_error(format!("读取 Ark 视频任务响应失败:{error}")) @@ -1062,11 +1066,13 @@ async fn wait_for_ark_content_generation_task( sleep(Duration::from_millis(ARK_VIDEO_TASK_POLL_INTERVAL_MS)).await; } - Err(AppError::from_status(StatusCode::BAD_GATEWAY).with_details(json!({ - "provider": "ark", - "message": "视频生成任务执行超时,请稍后重试。", - "taskId": task_id, - }))) + Err( + AppError::from_status(StatusCode::BAD_GATEWAY).with_details(json!({ + "provider": "ark", + "message": "视频生成任务执行超时,请稍后重试。", + "taskId": task_id, + })), + ) } async fn download_generated_video( @@ -1074,11 +1080,9 @@ async fn download_generated_video( video_url: &str, fallback_message: &str, ) -> Result { - let response = http_client - .get(video_url) - .send() - .await - .map_err(|error| map_character_animation_upstream_error(format!("{fallback_message}:{error}")))?; + let response = http_client.get(video_url).send().await.map_err(|error| { + map_character_animation_upstream_error(format!("{fallback_message}:{error}")) + })?; let status = response.status(); let content_type = response .headers() @@ -1090,11 +1094,13 @@ async fn download_generated_video( map_character_animation_upstream_error(format!("{fallback_message}:{error}")) })?; if !status.is_success() { - return Err(AppError::from_status(StatusCode::BAD_GATEWAY).with_details(json!({ - "provider": "character-animation", - "message": fallback_message, - "status": status.as_u16(), - }))); + return Err( + AppError::from_status(StatusCode::BAD_GATEWAY).with_details(json!({ + "provider": "character-animation", + "message": fallback_message, + "status": status.as_u16(), + })), + ); } Ok(MediaPayload { mime_type: content_type.clone(), @@ -1728,12 +1734,9 @@ fn build_character_animation_prompt( loop_, use_chroma_key, ), - CharacterAnimationStrategy::ImageSequence => build_image_sequence_prompt( - animation, - prompt_text, - frame_count, - use_chroma_key, - ), + CharacterAnimationStrategy::ImageSequence => { + build_image_sequence_prompt(animation, prompt_text, frame_count, use_chroma_key) + } CharacterAnimationStrategy::MotionTransfer | CharacterAnimationStrategy::ReferenceToVideo => build_npc_animation_prompt( animation, @@ -1755,7 +1758,10 @@ fn build_image_sequence_prompt( use_chroma_key: bool, ) -> String { [ - format!("同一角色连续 {} 帧动作序列,动作主题是 {}。", frame_count, animation), + format!( + "同一角色连续 {} 帧动作序列,动作主题是 {}。", + frame_count, animation + ), "固定机位,单人,全身,侧身朝右,保持同一套服装、发型、武器和体型。".to_string(), "帧间动作连续,姿态逐步推进,不要换人,不要跳变,不要多余物体。".to_string(), if use_chroma_key { @@ -1784,16 +1790,16 @@ fn build_npc_animation_prompt( let character_brief = build_compact_animation_character_brief(character_brief_text); let action_detail_text = sanitize_animation_prompt_text(prompt_text, 140); let loop_rule = if loop_ { - "这是循环动作,直接进入动作循环中段,不要开场静止站桩,不要把主参考图原样作为第一帧。".to_string() + "这是循环动作,直接进入动作循环中段,不要开场静止站桩,不要把主参考图原样作为第一帧。" + .to_string() } else if animation == "die" { - "这是死亡终结动作,首帧参考主图角色形象即可,尾帧停在死亡结束姿态,不要回到主图形象。".to_string() + "这是死亡终结动作,首帧参考主图角色形象即可,尾帧停在死亡结束姿态,不要回到主图形象。" + .to_string() } else { "这是非循环动作,首帧和尾帧都要回到参考主图角色形象,中段完成动作变化。".to_string() }; - if let Some(template) = action_template_id - .and_then(|id| find_motion_template(id)) - { + if let Some(template) = action_template_id.and_then(|id| find_motion_template(id)) { return [ format!( "单人 NPC 全身动作视频,动作主题是 {}。角色固定为同一人,右向斜侧身,镜头稳定,轮廓清晰,武器不可丢失。", @@ -1843,7 +1849,11 @@ fn build_npc_animation_prompt( } else { action_detail_text }, - format!("目标帧率 {} fps,时长约 {} 秒。", fps.clamp(1, 60), duration_seconds.clamp(1, 8)), + format!( + "目标帧率 {} fps,时长约 {} 秒。", + fps.clamp(1, 60), + duration_seconds.clamp(1, 8) + ), loop_rule, ] .into_iter() @@ -1906,8 +1916,12 @@ fn build_ark_character_animation_prompt( } [ - format!("单人 NPC 全身动作视频,动作英文名是 {}。", normalized_animation_name), - "角色固定为图片1和图片2中的同一人,侧身朝右,镜头稳定,轮廓清晰,武器不可丢失。".to_string(), + format!( + "单人 NPC 全身动作视频,动作英文名是 {}。", + normalized_animation_name + ), + "角色固定为图片1和图片2中的同一人,侧身朝右,镜头稳定,轮廓清晰,武器不可丢失。" + .to_string(), "动作连贯,避免服装、发型、面部、武器随机漂移,不要多角色,不要镜头切换。".to_string(), if use_chroma_key { "背景为纯绿色绿幕,无其他人物和场景元素,方便后期抠像。".to_string() @@ -2341,11 +2355,7 @@ fn finalize_animation_frame_payload( ); } - let normalized = contain_rgba_image( - &image, - frame_width.max(1), - frame_height.max(1), - ); + let normalized = contain_rgba_image(&image, frame_width.max(1), frame_height.max(1)); let mut encoded = Vec::new(); let encoder = PngEncoder::new(&mut encoded); encoder @@ -2665,7 +2675,14 @@ fn is_completed_generation_task_status(status: &str) -> bool { fn is_failed_generation_task_status(status: &str) -> bool { matches!( status, - "failed" | "canceled" | "cancelled" | "error" | "aborted" | "rejected" | "expired" | "unknown" + "failed" + | "canceled" + | "cancelled" + | "error" + | "aborted" + | "rejected" + | "expired" + | "unknown" ) } @@ -3110,9 +3127,8 @@ fn remove_background_from_rgba(pixels: &mut [u8], width: usize, height: usize) - } let offset = pixel_index * 4; let alpha = pixels[offset + 3]; - let strong_candidate = alpha < 40 - || green_scores[pixel_index] > 0.12 - || white_scores[pixel_index] > 0.32; + let strong_candidate = + alpha < 40 || green_scores[pixel_index] > 0.12 || white_scores[pixel_index] > 0.32; if !strong_candidate { return; } @@ -3137,9 +3153,21 @@ fn remove_background_from_rgba(pixels: &mut [u8], width: usize, height: usize) - let y = pixel_index / width; let neighbor_indexes = [ if x > 0 { Some(pixel_index - 1) } else { None }, - if x + 1 < width { Some(pixel_index + 1) } else { None }, - if y > 0 { Some(pixel_index - width) } else { None }, - if y + 1 < height { Some(pixel_index + width) } else { None }, + if x + 1 < width { + Some(pixel_index + 1) + } else { + None + }, + if y > 0 { + Some(pixel_index - width) + } else { + None + }, + if y + 1 < height { + Some(pixel_index + width) + } else { + None + }, ]; for next_pixel_index in neighbor_indexes.into_iter().flatten() { @@ -3153,9 +3181,7 @@ fn remove_background_from_rgba(pixels: &mut [u8], width: usize, height: usize) - let next_hint = background_hints[next_pixel_index]; let reachable_soft_edge = next_hint > 0.08 && next_alpha < SOFT_EDGE_ALPHA_THRESHOLD - && (next_green_score > 0.04 - || next_white_score > 0.08 - || next_alpha < 180); + && (next_green_score > 0.04 || next_white_score > 0.08 || next_alpha < 180); if next_alpha < 40 || next_green_score > 0.12 @@ -3203,8 +3229,7 @@ fn remove_background_from_rgba(pixels: &mut [u8], width: usize, height: usize) - } } - if adjacent_background_count >= 2 - || (adjacent_background_count >= 1 && hint > 0.18) + if adjacent_background_count >= 2 || (adjacent_background_count >= 1 && hint > 0.18) { expanded_mask[pixel_index] = 1; } @@ -3237,10 +3262,7 @@ fn remove_background_from_rgba(pixels: &mut [u8], width: usize, height: usize) - } let next_x = x as i32 + offset_x; let next_y = y as i32 + offset_y; - if next_x < 0 - || next_x >= width as i32 - || next_y < 0 - || next_y >= height as i32 + if next_x < 0 || next_x >= width as i32 || next_y < 0 || next_y >= height as i32 { continue; } @@ -3295,10 +3317,7 @@ fn remove_background_from_rgba(pixels: &mut [u8], width: usize, height: usize) - } let next_x = x as i32 + offset_x; let next_y = y as i32 + offset_y; - if next_x < 0 - || next_x >= width as i32 - || next_y < 0 - || next_y >= height as i32 + if next_x < 0 || next_x >= width as i32 || next_y < 0 || next_y >= height as i32 { touches_transparent_edge = true; continue; @@ -3320,7 +3339,11 @@ fn remove_background_from_rgba(pixels: &mut [u8], width: usize, height: usize) - let white_score = white_scores[pixel_index]; let contamination = green_score .max(white_score) - .max(if background_mask[pixel_index] != 0 { 0.35 } else { 0.0 }) + .max(if background_mask[pixel_index] != 0 { + 0.35 + } else { + 0.0 + }) .max(if alpha < 220 { ((220 - alpha) as f32 / 220.0) * 0.25 } else { @@ -3343,7 +3366,8 @@ fn remove_background_from_rgba(pixels: &mut [u8], width: usize, height: usize) - &background_mask, &background_hints, ); - let blend = clamp01(contamination.max(if touches_transparent_edge { 0.22 } else { 0.0 })); + let blend = + clamp01(contamination.max(if touches_transparent_edge { 0.22 } else { 0.0 })); if let Some((sample_red, sample_green, sample_blue)) = sample { red = lerp(red, sample_red as f32, blend); @@ -3360,7 +3384,8 @@ fn remove_background_from_rgba(pixels: &mut [u8], width: usize, height: usize) - } } else { if green_score > 0.04 { - green = green.max(red.max(blue)) + green = green + .max(red.max(blue)) .max((green - (green - red.max(blue)) * 0.78).round()); } diff --git a/server-rs/crates/api-server/src/character_visual_assets.rs b/server-rs/crates/api-server/src/character_visual_assets.rs index 2f8d04c2..9aba2d50 100644 --- a/server-rs/crates/api-server/src/character_visual_assets.rs +++ b/server-rs/crates/api-server/src/character_visual_assets.rs @@ -104,11 +104,11 @@ pub async fn generate_character_visual( text_output: Some(prompt.clone()), structured_payload_json: Some( json!({ - "characterId": character_id, - "sourceMode": payload.source_mode, - "size": size, - "referenceImageCount": payload.reference_image_data_urls.len(), - }) + "characterId": character_id, + "sourceMode": payload.source_mode, + "size": size, + "referenceImageCount": payload.reference_image_data_urls.len(), + }) .to_string(), ), warning_messages: Vec::new(), @@ -832,12 +832,9 @@ async fn resolve_reference_image_as_data_url( .and_then(|value| value.to_str().ok()) .unwrap_or("image/png") .to_string(); - let body = response - .bytes() - .await - .map_err(|error| { - map_dashscope_request_error(format!("读取角色主形象参考图内容失败:{error}")) - })?; + let body = response.bytes().await.map_err(|error| { + map_dashscope_request_error(format!("读取角色主形象参考图内容失败:{error}")) + })?; if !status.is_success() { return Err( AppError::from_status(StatusCode::BAD_GATEWAY).with_details(json!({ @@ -911,9 +908,7 @@ async fn create_character_visual_generation( })) .send() .await - .map_err(|error| { - map_dashscope_request_error(format!("创建角色主形象任务失败:{error}")) - })?; + .map_err(|error| map_dashscope_request_error(format!("创建角色主形象任务失败:{error}")))?; let response_status = response.status(); let response_text = response.text().await.map_err(|error| { map_dashscope_request_error(format!("读取角色主形象任务响应失败:{error}")) @@ -963,19 +958,23 @@ async fn create_character_visual_generation( if task_status == "SUCCEEDED" { let image_urls = extract_image_urls(&poll_json.payload); if image_urls.is_empty() { - return Err(AppError::from_status(StatusCode::BAD_GATEWAY).with_details( - json!({ + return Err( + AppError::from_status(StatusCode::BAD_GATEWAY).with_details(json!({ "provider": "dashscope", "message": "角色主形象生成成功,但没有返回可下载图片。", - }), - )); + })), + ); } let mut images = Vec::with_capacity(image_urls.len()); for image_url in image_urls { images.push( - download_generated_image(http_client, image_url.as_str(), "下载角色主形象候选图失败。") - .await?, + download_generated_image( + http_client, + image_url.as_str(), + "下载角色主形象候选图失败。", + ) + .await?, ); } @@ -992,13 +991,18 @@ async fn create_character_visual_generation( )); } - sleep(Duration::from_millis(CHARACTER_VISUAL_TASK_POLL_INTERVAL_MS)).await; + sleep(Duration::from_millis( + CHARACTER_VISUAL_TASK_POLL_INTERVAL_MS, + )) + .await; } - Err(AppError::from_status(StatusCode::BAD_GATEWAY).with_details(json!({ - "provider": "dashscope", - "message": "角色主形象任务执行超时,请稍后重试。", - }))) + Err( + AppError::from_status(StatusCode::BAD_GATEWAY).with_details(json!({ + "provider": "dashscope", + "message": "角色主形象任务执行超时,请稍后重试。", + })), + ) } async fn download_generated_image( @@ -1023,11 +1027,13 @@ async fn download_generated_image( .await .map_err(|error| map_dashscope_request_error(format!("{fallback_message}:{error}")))?; if !status.is_success() { - return Err(AppError::from_status(StatusCode::BAD_GATEWAY).with_details(json!({ - "provider": "dashscope", - "message": fallback_message, - "status": status.as_u16(), - }))); + return Err( + AppError::from_status(StatusCode::BAD_GATEWAY).with_details(json!({ + "provider": "dashscope", + "message": fallback_message, + "status": status.as_u16(), + })), + ); } let normalized_mime_type = normalize_downloaded_image_mime_type(content_type.as_str()); @@ -1244,7 +1250,10 @@ fn map_character_visual_oss_error(error: platform_oss::OssError) -> AppError { })) } -fn parse_json_payload(raw_text: &str, fallback_message: &str) -> Result { +fn parse_json_payload( + raw_text: &str, + fallback_message: &str, +) -> Result { serde_json::from_str::(raw_text) .map(|payload| ParsedJsonPayload { payload }) .map_err(|error| { @@ -1541,11 +1550,7 @@ fn collect_foreground_neighbor_color( )) } -pub(crate) fn remove_background_from_rgba( - pixels: &mut [u8], - width: usize, - height: usize, -) -> bool { +pub(crate) fn remove_background_from_rgba(pixels: &mut [u8], width: usize, height: usize) -> bool { const SOFT_EDGE_ALPHA_THRESHOLD: u8 = 224; const FOREGROUND_NEIGHBOR_ALPHA_THRESHOLD: u8 = 96; @@ -1574,26 +1579,24 @@ pub(crate) fn remove_background_from_rgba( green_scores[pixel_index] = green_score; white_scores[pixel_index] = white_score; - background_hints[pixel_index] = - green_score.max(white_score).max(transparency_hint); + background_hints[pixel_index] = green_score.max(white_score).max(transparency_hint); } let try_seed_background = |pixel_index: usize, background_mask: &mut [u8], queue: &mut Vec| { - if background_mask[pixel_index] != 0 { - return; - } - let offset = pixel_index * 4; - let alpha = pixels[offset + 3]; - let strong_candidate = alpha < 40 - || green_scores[pixel_index] > 0.12 - || white_scores[pixel_index] > 0.32; - if !strong_candidate { - return; - } - background_mask[pixel_index] = 1; - queue.push(pixel_index); - }; + if background_mask[pixel_index] != 0 { + return; + } + let offset = pixel_index * 4; + let alpha = pixels[offset + 3]; + let strong_candidate = + alpha < 40 || green_scores[pixel_index] > 0.12 || white_scores[pixel_index] > 0.32; + if !strong_candidate { + return; + } + background_mask[pixel_index] = 1; + queue.push(pixel_index); + }; for x in 0..width { try_seed_background(x, &mut background_mask, &mut queue); @@ -1612,9 +1615,21 @@ pub(crate) fn remove_background_from_rgba( let y = pixel_index / width; let neighbor_indexes = [ if x > 0 { Some(pixel_index - 1) } else { None }, - if x + 1 < width { Some(pixel_index + 1) } else { None }, - if y > 0 { Some(pixel_index - width) } else { None }, - if y + 1 < height { Some(pixel_index + width) } else { None }, + if x + 1 < width { + Some(pixel_index + 1) + } else { + None + }, + if y > 0 { + Some(pixel_index - width) + } else { + None + }, + if y + 1 < height { + Some(pixel_index + width) + } else { + None + }, ]; for next_pixel_index in neighbor_indexes.into_iter().flatten() { @@ -1628,9 +1643,7 @@ pub(crate) fn remove_background_from_rgba( let next_hint = background_hints[next_pixel_index]; let reachable_soft_edge = next_hint > 0.08 && next_alpha < SOFT_EDGE_ALPHA_THRESHOLD - && (next_green_score > 0.04 - || next_white_score > 0.08 - || next_alpha < 180); + && (next_green_score > 0.04 || next_white_score > 0.08 || next_alpha < 180); if next_alpha < 40 || next_green_score > 0.12 @@ -1678,8 +1691,7 @@ pub(crate) fn remove_background_from_rgba( } } - if adjacent_background_count >= 2 - || (adjacent_background_count >= 1 && hint > 0.18) + if adjacent_background_count >= 2 || (adjacent_background_count >= 1 && hint > 0.18) { expanded_mask[pixel_index] = 1; } @@ -1712,10 +1724,7 @@ pub(crate) fn remove_background_from_rgba( } let next_x = x as i32 + offset_x; let next_y = y as i32 + offset_y; - if next_x < 0 - || next_x >= width as i32 - || next_y < 0 - || next_y >= height as i32 + if next_x < 0 || next_x >= width as i32 || next_y < 0 || next_y >= height as i32 { continue; } @@ -1770,10 +1779,7 @@ pub(crate) fn remove_background_from_rgba( } let next_x = x as i32 + offset_x; let next_y = y as i32 + offset_y; - if next_x < 0 - || next_x >= width as i32 - || next_y < 0 - || next_y >= height as i32 + if next_x < 0 || next_x >= width as i32 || next_y < 0 || next_y >= height as i32 { touches_transparent_edge = true; continue; @@ -1795,7 +1801,11 @@ pub(crate) fn remove_background_from_rgba( let white_score = white_scores[pixel_index]; let contamination = green_score .max(white_score) - .max(if background_mask[pixel_index] != 0 { 0.35 } else { 0.0 }) + .max(if background_mask[pixel_index] != 0 { + 0.35 + } else { + 0.0 + }) .max(if alpha < 220 { ((220 - alpha) as f32 / 220.0) * 0.25 } else { @@ -1818,7 +1828,8 @@ pub(crate) fn remove_background_from_rgba( &background_mask, &background_hints, ); - let blend = clamp01(contamination.max(if touches_transparent_edge { 0.22 } else { 0.0 })); + let blend = + clamp01(contamination.max(if touches_transparent_edge { 0.22 } else { 0.0 })); if let Some((sample_red, sample_green, sample_blue)) = sample { red = lerp(red, sample_red as f32, blend); @@ -1835,7 +1846,8 @@ pub(crate) fn remove_background_from_rgba( } } else { if green_score > 0.04 { - green = green.max(red.max(blue)) + green = green + .max(red.max(blue)) .max((green - (green - red.max(blue)) * 0.78).round()); } diff --git a/server-rs/crates/api-server/src/config.rs b/server-rs/crates/api-server/src/config.rs index 054b9974..42eac88b 100644 --- a/server-rs/crates/api-server/src/config.rs +++ b/server-rs/crates/api-server/src/config.rs @@ -478,8 +478,7 @@ impl AppConfig { "ARK_CHARACTER_VIDEO_REQUEST_TIMEOUT_MS", "DASHSCOPE_CHARACTER_VIDEO_REQUEST_TIMEOUT_MS", ]) { - config.ark_character_video_request_timeout_ms = - ark_character_video_request_timeout_ms; + config.ark_character_video_request_timeout_ms = ark_character_video_request_timeout_ms; } if let Some(ark_character_video_model) = read_first_non_empty_env(&[ @@ -501,9 +500,9 @@ impl AppConfig { config.character_animation_ffprobe_path = character_animation_ffprobe_path; } - if let Some(character_animation_frame_extract_timeout_ms) = read_first_positive_u64_env(&[ - "CHARACTER_ANIMATION_FRAME_EXTRACT_TIMEOUT_MS", - ]) { + if let Some(character_animation_frame_extract_timeout_ms) = + read_first_positive_u64_env(&["CHARACTER_ANIMATION_FRAME_EXTRACT_TIMEOUT_MS"]) + { config.character_animation_frame_extract_timeout_ms = character_animation_frame_extract_timeout_ms; } diff --git a/server-rs/crates/api-server/src/custom_world_agent_turn.rs b/server-rs/crates/api-server/src/custom_world_agent_turn.rs index d6e08f50..1743c1c0 100644 --- a/server-rs/crates/api-server/src/custom_world_agent_turn.rs +++ b/server-rs/crates/api-server/src/custom_world_agent_turn.rs @@ -611,7 +611,10 @@ where empty_json_array() }; let asset_coverage_json = if should_stay_in_draft_stage { - serialize_json(&request.session.asset_coverage, &empty_agent_asset_coverage_json()) + serialize_json( + &request.session.asset_coverage, + &empty_agent_asset_coverage_json(), + ) } else { empty_agent_asset_coverage_json() }; @@ -732,7 +735,10 @@ pub(crate) fn build_failed_finalize_record_input( stage: session.stage.clone(), progress_percent: session.progress_percent, focus_card_id: session.focus_card_id.clone(), - anchor_content_json: serialize_json(&session.anchor_content, &empty_agent_anchor_content_json()), + anchor_content_json: serialize_json( + &session.anchor_content, + &empty_agent_anchor_content_json(), + ), creator_intent_json: serialize_optional_json_object(&session.creator_intent), creator_intent_readiness_json: serialize_json( &session.creator_intent_readiness, @@ -753,7 +759,10 @@ pub(crate) fn build_failed_finalize_record_input( &JsonValue::Array(session.quality_findings.clone()), &empty_json_array(), ), - asset_coverage_json: serialize_json(&session.asset_coverage, &empty_agent_asset_coverage_json()), + asset_coverage_json: serialize_json( + &session.asset_coverage, + &empty_agent_asset_coverage_json(), + ), error_message: Some(error_message), updated_at_micros, } @@ -771,13 +780,18 @@ async fn stream_single_turn( where F: FnMut(&str), { - let llm_client = llm_client.ok_or_else(|| { - CustomWorldTurnError::new("当前模型不可用,请稍后重试。") - })?; + let llm_client = + llm_client.ok_or_else(|| CustomWorldTurnError::new("当前模型不可用,请稍后重试。"))?; let chat_history = build_chat_history(messages); - let dynamic_state = - resolve_dynamic_state(llm_client, current_turn, progress_percent, quick_fill_requested, current_anchor_content, &chat_history) - .await; + let dynamic_state = resolve_dynamic_state( + llm_client, + current_turn, + progress_percent, + quick_fill_requested, + current_anchor_content, + &chat_history, + ) + .await; let prompt = build_eight_anchor_single_turn_prompt( current_turn, progress_percent, @@ -806,27 +820,21 @@ where ) .await; - let response = response.map_err(|_| { - CustomWorldTurnError::new("这一轮设定生成失败,请稍后重试。") - })?; + let response = + response.map_err(|_| CustomWorldTurnError::new("这一轮设定生成失败,请稍后重试。"))?; - let parsed = parse_json_response_text(response.content.as_str()).map_err(|_| { - CustomWorldTurnError::new("模型返回结果解析失败,请稍后重试。") - })?; + let parsed = parse_json_response_text(response.content.as_str()) + .map_err(|_| CustomWorldTurnError::new("模型返回结果解析失败,请稍后重试。"))?; - let next_anchor_content = normalize_eight_anchor_content( - parsed - .get("nextAnchorContent") - .unwrap_or(&JsonValue::Null), - ); + let next_anchor_content = + normalize_eight_anchor_content(parsed.get("nextAnchorContent").unwrap_or(&JsonValue::Null)); let progress_percent = if quick_fill_requested { 100 } else { clamp_progress_percent(parsed.get("progressPercent")) }; - let reply_text = to_text(parsed.get("replyText")).ok_or_else(|| { - CustomWorldTurnError::new("模型返回结果缺少有效回复,请稍后重试。") - })?; + let reply_text = to_text(parsed.get("replyText")) + .ok_or_else(|| CustomWorldTurnError::new("模型返回结果缺少有效回复,请稍后重试。"))?; if reply_text != latest_reply_text { on_reply_update(reply_text.as_str()); } @@ -907,13 +915,19 @@ fn build_prompt_dynamic_state( let Some(inference) = inference else { return fallback; }; - let user_input_signal = inference.user_input_signal.unwrap_or(fallback.user_input_signal); + let user_input_signal = inference + .user_input_signal + .unwrap_or(fallback.user_input_signal); let drift_risk = inference.drift_risk.unwrap_or(fallback.drift_risk); - let conversation_mode = inference.conversation_mode.unwrap_or(fallback.conversation_mode); + let conversation_mode = inference + .conversation_mode + .unwrap_or(fallback.conversation_mode); let judgement_summary = inference .judgement_summary .filter(|value| !value.trim().is_empty()) - .unwrap_or_else(|| summarize_dynamic_state(user_input_signal, drift_risk, conversation_mode)); + .unwrap_or_else(|| { + summarize_dynamic_state(user_input_signal, drift_risk, conversation_mode) + }); PromptDynamicState { current_turn, @@ -966,7 +980,11 @@ fn build_prompt_dynamic_state_inference_prompt( chat_history: &[JsonValue], ) -> (String, String) { ( - [STATE_INFERENCE_SYSTEM_PROMPT, STATE_INFERENCE_OUTPUT_CONTRACT].join("\n\n"), + [ + STATE_INFERENCE_SYSTEM_PROMPT, + STATE_INFERENCE_OUTPUT_CONTRACT, + ] + .join("\n\n"), [ format!("当前轮次:{current_turn}"), format!("当前完成度:{progress_percent}"), @@ -1010,7 +1028,8 @@ fn build_chat_history(messages: &[CustomWorldAgentMessageRecord]) -> Vec>() }) @@ -1205,7 +1223,10 @@ fn evaluate_creator_intent_readiness(intent: &CreatorIntentRecord) -> CreatorInt } } -fn resolve_creator_intent_stage(has_user_input: bool, readiness: &CreatorIntentReadiness) -> &'static str { +fn resolve_creator_intent_stage( + has_user_input: bool, + readiness: &CreatorIntentReadiness, +) -> &'static str { if readiness.is_ready { "foundation_review" } else if has_user_input { @@ -1509,11 +1530,16 @@ fn detect_user_input_signal(chat_history: &[JsonValue]) -> PromptUserInputSignal if latest_user_text.is_empty() { return PromptUserInputSignal::Sparse; } - if contains_any(&latest_user_text, &["不是", "改成", "改为", "换成", "重来", "推翻", "修正"]) - { + if contains_any( + &latest_user_text, + &["不是", "改成", "改为", "换成", "重来", "推翻", "修正"], + ) { return PromptUserInputSignal::Correction; } - if contains_any(&latest_user_text, &["你帮我想", "你来定", "你决定", "你补完"]) { + if contains_any( + &latest_user_text, + &["你帮我想", "你来定", "你决定", "你补完"], + ) { return PromptUserInputSignal::Delegate; } let segments = split_sentences(&latest_user_text); @@ -1535,8 +1561,14 @@ fn detect_drift_risk( let recent_user_messages = chat_history .iter() .filter_map(|entry| { - (entry.get("role").and_then(JsonValue::as_str) == Some("user")) - .then(|| entry.get("content").and_then(JsonValue::as_str).unwrap_or("").trim().to_string()) + (entry.get("role").and_then(JsonValue::as_str) == Some("user")).then(|| { + entry + .get("content") + .and_then(JsonValue::as_str) + .unwrap_or("") + .trim() + .to_string() + }) }) .filter(|value| !value.is_empty()) .rev() @@ -1545,11 +1577,19 @@ fn detect_drift_risk( let correction_count = recent_user_messages .iter() - .filter(|entry| contains_any(entry, &["不是", "改成", "改为", "换成", "推翻", "重来", "修正"])) + .filter(|entry| { + contains_any( + entry, + &["不是", "改成", "改为", "换成", "推翻", "重来", "修正"], + ) + }) .count(); if correction_count >= 2 || (progress_percent >= 65 - && contains_any(&latest_user_text, &["不是", "改成", "改为", "换成", "重来", "推翻"])) + && contains_any( + &latest_user_text, + &["不是", "改成", "改为", "换成", "重来", "推翻"], + )) { return PromptDriftRisk::High; } @@ -1652,7 +1692,8 @@ fn render_dynamic_state_context(dynamic_state: &PromptDynamicState) -> String { fn render_current_anchor_context(anchor_content: &EightAnchorContent) -> String { format!( "当前完整设定结构如下。\n你必须把它视为上一版有效世界底子。\n\n如果用户没有否定其中某部分内容,且该部分仍然成立,可以继续保留。\n如果用户明确修正了某部分内容,新的完整设定结构必须体现修正后的版本。\n\n当前完整设定结构:\n{}", - serde_json::to_string_pretty(anchor_content).unwrap_or_else(|_| empty_agent_anchor_content_json()) + serde_json::to_string_pretty(anchor_content) + .unwrap_or_else(|_| empty_agent_anchor_content_json()) ) } @@ -1757,7 +1798,8 @@ fn parse_conversation_mode(value: Option<&JsonValue>) -> Option &'static str { match mode { - PromptConversationMode::Bootstrap => r#"当前模式:bootstrap + PromptConversationMode::Bootstrap => { + r#"当前模式:bootstrap 目标: 1. 先把世界的基本方向抓住 @@ -1777,8 +1819,10 @@ fn mode_rules(mode: PromptConversationMode) -> &'static str { 1. 让用户觉得“现在很容易继续往下说” 2. 不要制造被考试、被拷问、被策划问卷追着跑的感觉 3. replyText 最好短、稳、可接话 -4. 如果用户信息很少,也不要显得冷淡或机械"#, - PromptConversationMode::Expand => r#"当前模式:expand +4. 如果用户信息很少,也不要显得冷淡或机械"# + } + PromptConversationMode::Expand => { + r#"当前模式:expand 目标: 1. 在保持现有方向的前提下,把设定结构逐步补全 @@ -1797,8 +1841,10 @@ fn mode_rules(mode: PromptConversationMode) -> &'static str { 1. 让用户感到“我刚说的内容都被接住了” 2. 回复里可以带一点顺势整理感,但不要太像会议纪要 3. 不要无视用户刚提供的高价值细节 -4. 不要让用户觉得系统在自顾自重写世界"#, - PromptConversationMode::Compress => r#"当前模式:compress +4. 不要让用户觉得系统在自顾自重写世界"# + } + PromptConversationMode::Compress => { + r#"当前模式:compress 目标: 1. 开始收束当前设定 @@ -1818,8 +1864,10 @@ fn mode_rules(mode: PromptConversationMode) -> &'static str { 1. 让用户感觉世界正在变得更稳,而不是越来越散 2. 让推进感更明确,但不要显得催促 3. 回复语气应更笃定一些,减少反复横跳 -4. 不要把用户刚补进来的细节又冲淡掉"#, - PromptConversationMode::RepairDirection => r#"当前模式:repair_direction +4. 不要把用户刚补进来的细节又冲淡掉"# + } + PromptConversationMode::RepairDirection => { + r#"当前模式:repair_direction 目标: 1. 处理用户对既有设定的修正 @@ -1838,8 +1886,10 @@ fn mode_rules(mode: PromptConversationMode) -> &'static str { 1. 让用户感到“我刚刚的纠偏真的生效了” 2. 不要和用户辩论旧方案为什么也行 3. 不要表现出对修正的不情愿 -4. 回复要体现重心已经切到新方向,而不是停留在旧世界观惯性里"#, - PromptConversationMode::ForceComplete => r#"当前模式:force_complete +4. 回复要体现重心已经切到新方向,而不是停留在旧世界观惯性里"# + } + PromptConversationMode::ForceComplete => { + r#"当前模式:force_complete 目标: 1. 基于当前方向直接补齐剩余设定 @@ -1860,8 +1910,10 @@ fn mode_rules(mode: PromptConversationMode) -> &'static str { 1. 让用户感到“系统已经帮我把能补的补好了” 2. 不要在这一步突然冒出很多陌生设定把用户吓出戏 3. 回复要有完成感,但不要太官话 -4. 清楚告诉用户下一步可以做什么"#, - PromptConversationMode::Closing => r#"当前模式:closing +4. 清楚告诉用户下一步可以做什么"# + } + PromptConversationMode::Closing => { + r#"当前模式:closing 目标: 1. 尽量形成一版可用的设定底子 @@ -1880,26 +1932,37 @@ fn mode_rules(mode: PromptConversationMode) -> &'static str { 1. 让用户感觉作品已经快成了,而不是还在无穷试探 2. 回复可以更像确认和轻推,不要继续像前期那样频繁试探 3. 保持留白感,不要把所有东西都一次说死 -4. 让用户自然过渡到下一阶段,而不是突然被切断对话"#, +4. 让用户自然过渡到下一阶段,而不是突然被切断对话"# + } } } fn user_signal_rules(signal: PromptUserInputSignal) -> &'static str { match signal { - PromptUserInputSignal::Rich => r#"本轮用户输入信息密度高。 + PromptUserInputSignal::Rich => { + r#"本轮用户输入信息密度高。 请尽量从这一轮里提取多个锚点,不要只更新单一方向。 -如果一条输入同时影响世界方向、冲突和关系,请在新的完整设定结构中一起体现。"#, - PromptUserInputSignal::Normal => r#"本轮用户输入为正常补充。 -请优先顺着当前方向稳定更新,不要主动扩写太多新设定。"#, - PromptUserInputSignal::Sparse => r#"本轮用户输入较少或较虚。 +如果一条输入同时影响世界方向、冲突和关系,请在新的完整设定结构中一起体现。"# + } + PromptUserInputSignal::Normal => { + r#"本轮用户输入为正常补充。 +请优先顺着当前方向稳定更新,不要主动扩写太多新设定。"# + } + PromptUserInputSignal::Sparse => { + r#"本轮用户输入较少或较虚。 请保留上一版中仍然成立的内容,不要为了凑完整度而强行发明过多新设定。 -replyText 要让用户容易继续往下说。"#, - PromptUserInputSignal::Correction => r#"本轮用户在修正或推翻旧设定。 +replyText 要让用户容易继续往下说。"# + } + PromptUserInputSignal::Correction => { + r#"本轮用户在修正或推翻旧设定。 请优先吸收修正,不要机械复读旧版本。 -新的完整设定结构必须以修正后的方向为准。"#, - PromptUserInputSignal::Delegate => r#"本轮用户把部分决定权交给你。 +新的完整设定结构必须以修正后的方向为准。"# + } + PromptUserInputSignal::Delegate => { + r#"本轮用户把部分决定权交给你。 你可以在 replyText 中给出有限度的建议,但不要突然补满整套设定。 -新的完整设定结构仍应尽量建立在已有世界方向上,而不是完全重做。"#, +新的完整设定结构仍应尽量建立在已有世界方向上,而不是完全重做。"# + } } } @@ -1985,7 +2048,11 @@ fn clamp_text(value: &str, max_length: usize) -> String { if normalized.chars().count() <= max_length { return normalized; } - normalized.chars().take(max_length.saturating_sub(1)).collect::() + "…" + normalized + .chars() + .take(max_length.saturating_sub(1)) + .collect::() + + "…" } fn clamp_progress_percent(value: Option<&JsonValue>) -> u32 { @@ -1996,7 +2063,8 @@ fn clamp_progress_percent(value: Option<&JsonValue>) -> u32 { } fn to_text(value: Option<&JsonValue>) -> Option { - value.and_then(JsonValue::as_str) + value + .and_then(JsonValue::as_str) .map(str::trim) .filter(|value| !value.is_empty()) .map(str::to_string) diff --git a/server-rs/crates/api-server/src/phone_auth.rs b/server-rs/crates/api-server/src/phone_auth.rs index 30503e25..80bce49e 100644 --- a/server-rs/crates/api-server/src/phone_auth.rs +++ b/server-rs/crates/api-server/src/phone_auth.rs @@ -16,10 +16,10 @@ use tracing::{info, warn}; use crate::{ api_response::json_success_body, + auth_payload::map_auth_user_payload, auth_session::{ attach_set_cookie_header, build_refresh_session_cookie_header, create_auth_session, }, - auth_payload::map_auth_user_payload, http_error::AppError, request_context::RequestContext, session_client::resolve_session_client_context, diff --git a/server-rs/crates/api-server/src/puzzle.rs b/server-rs/crates/api-server/src/puzzle.rs index 01a99157..a094c8bd 100644 --- a/server-rs/crates/api-server/src/puzzle.rs +++ b/server-rs/crates/api-server/src/puzzle.rs @@ -52,12 +52,15 @@ use spacetime_client::{ use std::convert::Infallible; use crate::{ - api_response::json_success_body, auth::AuthenticatedAccessToken, http_error::AppError, + api_response::json_success_body, + auth::AuthenticatedAccessToken, + http_error::AppError, puzzle_agent_turn::{ PuzzleAgentTurnRequest, build_failed_finalize_record_input, build_finalize_record_input, run_puzzle_agent_turn, }, - request_context::RequestContext, state::AppState, + request_context::RequestContext, + state::AppState, }; const PUZZLE_AGENT_API_BASE_PROVIDER: &str = "puzzle-agent"; @@ -1269,7 +1272,9 @@ fn build_puzzle_welcome_text(seed_text: &str) -> String { } fn build_stable_puzzle_work_ids(session_id: &str) -> (String, String) { - let stable_suffix = session_id.strip_prefix("puzzle-session-").unwrap_or(session_id); + let stable_suffix = session_id + .strip_prefix("puzzle-session-") + .unwrap_or(session_id); ( format!("puzzle-work-{stable_suffix}"), format!("puzzle-profile-{stable_suffix}"), diff --git a/server-rs/crates/api-server/src/puzzle_agent_turn.rs b/server-rs/crates/api-server/src/puzzle_agent_turn.rs index 3d61a074..e9394e89 100644 --- a/server-rs/crates/api-server/src/puzzle_agent_turn.rs +++ b/server-rs/crates/api-server/src/puzzle_agent_turn.rs @@ -1,6 +1,4 @@ -use module_puzzle::{ - PuzzleAgentStage, PuzzleAnchorPack, PuzzleAnchorStatus, empty_anchor_pack, -}; +use module_puzzle::{PuzzleAgentStage, PuzzleAnchorPack, PuzzleAnchorStatus, empty_anchor_pack}; use platform_llm::{LlmClient, LlmMessage, LlmStreamDelta, LlmTextRequest}; use serde::{Deserialize, Serialize}; use serde_json::{Value as JsonValue, json}; @@ -157,10 +155,13 @@ where Ok(PuzzleAgentTurnResult { assistant_reply_text: output.reply_text, - stage: resolve_puzzle_agent_stage(output.progress_percent).as_str().to_string(), + stage: resolve_puzzle_agent_stage(output.progress_percent) + .as_str() + .to_string(), progress_percent: output.progress_percent, - anchor_pack_json: serde_json::to_string(&output.next_anchor_pack) - .unwrap_or_else(|_| serde_json::to_string(&empty_anchor_pack()).unwrap_or_else(|_| "{}".to_string())), + anchor_pack_json: serde_json::to_string(&output.next_anchor_pack).unwrap_or_else(|_| { + serde_json::to_string(&empty_anchor_pack()).unwrap_or_else(|_| "{}".to_string()) + }), error_message: None, }) } @@ -193,7 +194,9 @@ pub(crate) fn build_failed_finalize_record_input( updated_at_micros: i64, ) -> PuzzleAgentMessageFinalizeRecordInput { let anchor_pack_json = serde_json::to_string(&map_record_anchor_pack(&session.anchor_pack)) - .unwrap_or_else(|_| serde_json::to_string(&empty_anchor_pack()).unwrap_or_else(|_| "{}".to_string())); + .unwrap_or_else(|_| { + serde_json::to_string(&empty_anchor_pack()).unwrap_or_else(|_| "{}".to_string()) + }); PuzzleAgentMessageFinalizeRecordInput { session_id, owner_user_id, @@ -214,8 +217,9 @@ fn build_puzzle_agent_prompt(session: &PuzzleAgentSessionRecord) -> String { progress = session.progress_percent, anchor_pack = serde_json::to_string_pretty(&map_record_anchor_pack(&session.anchor_pack)) .unwrap_or_else(|_| "{}".to_string()), - chat_history = serde_json::to_string_pretty(&build_chat_history(session.messages.as_slice())) - .unwrap_or_else(|_| "[]".to_string()), + chat_history = + serde_json::to_string_pretty(&build_chat_history(session.messages.as_slice())) + .unwrap_or_else(|_| "[]".to_string()), contract = PUZZLE_AGENT_OUTPUT_CONTRACT, ) } @@ -279,7 +283,9 @@ fn map_record_anchor_pack(record: &spacetime_client::PuzzleAnchorPackRecord) -> } } -fn map_record_anchor_item(record: &spacetime_client::PuzzleAnchorItemRecord) -> module_puzzle::PuzzleAnchorItem { +fn map_record_anchor_item( + record: &spacetime_client::PuzzleAnchorItemRecord, +) -> module_puzzle::PuzzleAnchorItem { module_puzzle::PuzzleAnchorItem { key: record.key.clone(), label: record.label.clone(), diff --git a/server-rs/crates/api-server/src/state.rs b/server-rs/crates/api-server/src/state.rs index 19309aca..8ef0dfeb 100644 --- a/server-rs/crates/api-server/src/state.rs +++ b/server-rs/crates/api-server/src/state.rs @@ -1,10 +1,7 @@ use std::{error::Error, fmt, sync::Arc}; #[cfg(test)] -use std::{ - collections::HashMap, - sync::{Arc, Mutex}, -}; +use std::{collections::HashMap, sync::Mutex}; use module_ai::{AiTaskService, InMemoryAiTaskStore}; use module_auth::{ @@ -16,9 +13,8 @@ use module_runtime::RuntimeSnapshotRecord; use module_runtime::{SAVE_SNAPSHOT_VERSION, format_utc_micros}; use platform_auth::{ AccessTokenClaims, AccessTokenClaimsInput, AuthProvider, BindingStatus, JwtConfig, JwtError, - RefreshCookieConfig, RefreshCookieError, RefreshCookieSameSite, - sign_access_token, verify_access_token, - SmsAuthConfig, SmsAuthProvider, SmsAuthProviderKind, SmsProviderError, + RefreshCookieConfig, RefreshCookieError, RefreshCookieSameSite, SmsAuthConfig, SmsAuthProvider, + SmsAuthProviderKind, SmsProviderError, sign_access_token, verify_access_token, }; use platform_llm::{LlmClient, LlmConfig, LlmError}; use platform_oss::{OssClient, OssConfig, OssError}; @@ -57,6 +53,7 @@ pub struct AppState { test_runtime_snapshot_store: Arc>>, } +// 后台管理员运行态独立于普通玩家登录体系,只从环境变量构造。 #[derive(Clone, Debug)] pub struct AdminRuntime { username: Arc, @@ -565,6 +562,7 @@ fn build_llm_client(config: &AppConfig) -> Result, AppStateIni Ok(Some(LlmClient::new(llm_config)?)) } +// 只有在用户名和密码都已配置时才启用后台,避免半配置状态暴露伪入口。 fn build_admin_runtime( config: &AppConfig, base_jwt_config: &JwtConfig, diff --git a/server-rs/crates/module-auth/src/lib.rs b/server-rs/crates/module-auth/src/lib.rs index 93c7ec62..3b8d7325 100644 --- a/server-rs/crates/module-auth/src/lib.rs +++ b/server-rs/crates/module-auth/src/lib.rs @@ -636,8 +636,14 @@ impl PhoneAuthService { phone_national_masked = normalized_phone.masked_national_number.as_str(), cooldown_seconds = provider_result.cooldown_seconds, expires_in_seconds = provider_result.expires_in_seconds, - provider_request_id = provider_result.provider_request_id.as_deref().unwrap_or("unknown"), - provider_out_id = provider_result.provider_out_id.as_deref().unwrap_or("unknown"), + provider_request_id = provider_result + .provider_request_id + .as_deref() + .unwrap_or("unknown"), + provider_out_id = provider_result + .provider_out_id + .as_deref() + .unwrap_or("unknown"), "手机号验证码 provider 调用成功,准备写入本地快照" ); diff --git a/server-rs/crates/module-big-fish/src/lib.rs b/server-rs/crates/module-big-fish/src/lib.rs index 330085ff..8e29274f 100644 --- a/server-rs/crates/module-big-fish/src/lib.rs +++ b/server-rs/crates/module-big-fish/src/lib.rs @@ -874,7 +874,10 @@ fn build_level_blueprint(level: u32, level_count: u32, theme: &str) -> BigFishLe } else { format!("第 {level} 阶实体,继续吞噬同级和低级个体成长") }, - silhouette_direction: format!("体型约为初始的 {:.1} 倍,轮廓更清晰", 1.0 + level as f32 * 0.22), + silhouette_direction: format!( + "体型约为初始的 {:.1} 倍,轮廓更清晰", + 1.0 + level as f32 * 0.22 + ), size_ratio: 1.0 + (level.saturating_sub(1) as f32 * 0.22), visual_prompt_seed: format!("{theme} 第 {level} 级实体主图,透明背景,清晰轮廓"), motion_prompt_seed: format!("{theme} 第 {level} 级实体 idle_float 与 move_swim 动作"), @@ -909,7 +912,10 @@ fn build_asset_prompt_snapshot( .find(|item| item.level == level) .ok_or(BigFishFieldError::InvalidLevel)?; let motion_key = motion_key.ok_or(BigFishFieldError::InvalidAssetKind)?; - Ok(format!("{},动作位:{}", blueprint.motion_prompt_seed, motion_key)) + Ok(format!( + "{},动作位:{}", + blueprint.motion_prompt_seed, motion_key + )) } BigFishAssetKind::StageBackground => Ok(draft.background.background_prompt_seed.clone()), } @@ -990,8 +996,14 @@ fn move_owned_entities( ) { let input = snapshot.last_input.clone(); if let Some(leader) = snapshot.owned_entities.first_mut() { - leader.position.x = clamp_world(leader.position.x + input.x * params.leader_move_speed * step_seconds, true); - leader.position.y = clamp_world(leader.position.y + input.y * params.leader_move_speed * step_seconds, false); + leader.position.x = clamp_world( + leader.position.x + input.x * params.leader_move_speed * step_seconds, + true, + ); + leader.position.y = clamp_world( + leader.position.y + input.y * params.leader_move_speed * step_seconds, + false, + ); snapshot.camera_center = leader.position.clone(); } @@ -1038,10 +1050,15 @@ fn resolve_collisions(snapshot: &mut BigFishRuntimeSnapshot, _params: &BigFishRu radius: entity_radius(wild.level), offscreen_seconds: 0.0, }); - snapshot.event_log.push(format!("收编 {} 级实体", wild.level)); + snapshot + .event_log + .push(format!("收编 {} 级实体", wild.level)); } else { owned_to_remove.push(owned_index); - snapshot.event_log.push(format!("{} 级己方实体被 {} 级野生实体吃掉", owned.level, wild.level)); + snapshot.event_log.push(format!( + "{} 级己方实体被 {} 级野生实体吃掉", + owned.level, wild.level + )); } } } @@ -1075,7 +1092,9 @@ fn apply_chain_merges(snapshot: &mut BigFishRuntimeSnapshot, params: &BigFishRun radius: entity_radius(level + 1), offscreen_seconds: 0.0, }); - snapshot.event_log.push(format!("3 个 {} 级实体合成 {} 级", level, level + 1)); + snapshot + .event_log + .push(format!("3 个 {} 级实体合成 {} 级", level, level + 1)); merged = true; break; } @@ -1098,7 +1117,10 @@ fn refresh_player_leader(snapshot: &mut BigFishRuntimeSnapshot) { }) .then_with(|| left.entity_id.cmp(&right.entity_id)) }); - snapshot.leader_entity_id = snapshot.owned_entities.first().map(|entity| entity.entity_id.clone()); + snapshot.leader_entity_id = snapshot + .owned_entities + .first() + .map(|entity| entity.entity_id.clone()); snapshot.player_level = snapshot .owned_entities .iter() @@ -1113,12 +1135,16 @@ fn refresh_player_leader(snapshot: &mut BigFishRuntimeSnapshot) { fn apply_win_or_fail(snapshot: &mut BigFishRuntimeSnapshot, params: &BigFishRuntimeParams) { if snapshot.owned_entities.is_empty() { snapshot.status = BigFishRunStatus::Failed; - snapshot.event_log.push("己方实体归零,本局失败".to_string()); + snapshot + .event_log + .push("己方实体归零,本局失败".to_string()); return; } if snapshot.player_level >= params.win_level { snapshot.status = BigFishRunStatus::Won; - snapshot.event_log.push("获得最高等级实体,通关".to_string()); + snapshot + .event_log + .push("获得最高等级实体,通关".to_string()); } } @@ -1282,7 +1308,12 @@ mod tests { assert_eq!(draft.runtime_params.offscreen_cull_seconds, 3.0); assert_eq!(draft.runtime_params.prey_spawn_delta_levels, vec![1, 2]); assert_eq!(draft.runtime_params.threat_spawn_delta_levels, vec![1, 2]); - assert!(draft.levels.last().is_some_and(|level| level.is_final_level)); + assert!( + draft + .levels + .last() + .is_some_and(|level| level.is_final_level) + ); } #[test] @@ -1292,20 +1323,26 @@ mod tests { assert!(!coverage.publish_ready); assert_eq!(coverage.required_level_count, 8); - assert!(coverage.blockers.iter().any(|item| item.contains("等级主图"))); - assert!(coverage.blockers.iter().any(|item| item.contains("基础动作"))); + assert!( + coverage + .blockers + .iter() + .any(|item| item.contains("等级主图")) + ); + assert!( + coverage + .blockers + .iter() + .any(|item| item.contains("基础动作")) + ); assert!(coverage.blockers.iter().any(|item| item.contains("背景图"))); } #[test] fn same_level_wild_entity_can_be_collected_at_start() { let draft = compile_default_draft(&infer_anchor_pack("深海", None)); - let mut snapshot = build_initial_runtime_snapshot( - "run-1".to_string(), - "session-1".to_string(), - &draft, - 1, - ); + let mut snapshot = + build_initial_runtime_snapshot("run-1".to_string(), "session-1".to_string(), &draft, 1); snapshot.wild_entities[0].position = BigFishVector2 { x: 1.0, y: 0.0 }; let next = advance_runtime_snapshot(snapshot, &draft.runtime_params, 0.0, 0.0, 2); @@ -1383,15 +1420,14 @@ mod tests { }); snapshot.updated_at_micros = 1_000_000; - let next = advance_runtime_snapshot( - snapshot, - &draft.runtime_params, - 0.0, - 0.0, - 1_250_000, - ); + let next = advance_runtime_snapshot(snapshot, &draft.runtime_params, 0.0, 0.0, 1_250_000); - assert!(!next.wild_entities.iter().any(|entity| entity.entity_id == "wild-cull")); + assert!( + !next + .wild_entities + .iter() + .any(|entity| entity.entity_id == "wild-cull") + ); } #[test] @@ -1413,17 +1449,12 @@ mod tests { }); snapshot.updated_at_micros = 1_000_000; - let next = advance_runtime_snapshot( - snapshot, - &draft.runtime_params, - 0.0, - 0.0, - 1_200_000, - ); + let next = advance_runtime_snapshot(snapshot, &draft.runtime_params, 0.0, 0.0, 1_200_000); - assert!(next - .wild_entities - .iter() - .any(|entity| entity.entity_id == "wild-cull-safe")); + assert!( + next.wild_entities + .iter() + .any(|entity| entity.entity_id == "wild-cull-safe") + ); } } diff --git a/server-rs/crates/module-puzzle/src/lib.rs b/server-rs/crates/module-puzzle/src/lib.rs index 963d3156..84cc74b0 100644 --- a/server-rs/crates/module-puzzle/src/lib.rs +++ b/server-rs/crates/module-puzzle/src/lib.rs @@ -1,4 +1,8 @@ -use std::{collections::{BTreeMap, BTreeSet, VecDeque}, error::Error, fmt}; +use std::{ + collections::{BTreeMap, BTreeSet, VecDeque}, + error::Error, + fmt, +}; use serde::{Deserialize, Serialize}; use shared_kernel::{normalize_required_string, normalize_string_list}; @@ -606,7 +610,10 @@ pub fn infer_anchor_pack(seed_text: &str, latest_message: Option<&str>) -> Puzzl pack } -pub fn build_creator_intent(anchor_pack: &PuzzleAnchorPack, messages: &[PuzzleAgentMessageSnapshot]) -> PuzzleCreatorIntent { +pub fn build_creator_intent( + anchor_pack: &PuzzleAnchorPack, + messages: &[PuzzleAgentMessageSnapshot], +) -> PuzzleCreatorIntent { PuzzleCreatorIntent { source_mode: "agent_chat".to_string(), raw_messages_summary: messages @@ -624,11 +631,16 @@ pub fn build_creator_intent(anchor_pack: &PuzzleAnchorPack, messages: &[PuzzleAg .into_iter() .take(PUZZLE_MAX_TAG_COUNT) .collect(), - forbidden_directives: vec![extract_forbidden_directive(&anchor_pack.tags_and_forbidden.value)], + forbidden_directives: vec![extract_forbidden_directive( + &anchor_pack.tags_and_forbidden.value, + )], } } -pub fn compile_result_draft(anchor_pack: &PuzzleAnchorPack, messages: &[PuzzleAgentMessageSnapshot]) -> PuzzleResultDraft { +pub fn compile_result_draft( + anchor_pack: &PuzzleAnchorPack, + messages: &[PuzzleAgentMessageSnapshot], +) -> PuzzleResultDraft { let creator_intent = build_creator_intent(anchor_pack, messages); let normalized_tags = normalize_theme_tags(creator_intent.theme_tags.clone()); let level_name = build_level_name(anchor_pack, &normalized_tags); @@ -714,7 +726,10 @@ pub fn apply_selected_candidate( Ok(draft) } -pub fn build_result_preview(draft: &PuzzleResultDraft, author_display_name: Option<&str>) -> PuzzleResultPreviewEnvelope { +pub fn build_result_preview( + draft: &PuzzleResultDraft, + author_display_name: Option<&str>, +) -> PuzzleResultPreviewEnvelope { let blockers = validate_publish_requirements(draft, author_display_name); PuzzleResultPreviewEnvelope { draft: draft.clone(), @@ -736,14 +751,22 @@ pub fn validate_publish_requirements( message: "关卡名不能为空".to_string(), }); } - if draft.cover_image_src.as_deref().map(str::trim).unwrap_or("").is_empty() { + if draft + .cover_image_src + .as_deref() + .map(str::trim) + .unwrap_or("") + .is_empty() + { blockers.push(PuzzleResultPreviewBlocker { id: "missing-cover-image".to_string(), code: "MISSING_COVER_IMAGE".to_string(), message: "正式拼图图片尚未确定".to_string(), }); } - if draft.theme_tags.len() < PUZZLE_MIN_TAG_COUNT || draft.theme_tags.len() > PUZZLE_MAX_TAG_COUNT { + if draft.theme_tags.len() < PUZZLE_MIN_TAG_COUNT + || draft.theme_tags.len() > PUZZLE_MAX_TAG_COUNT + { blockers.push(PuzzleResultPreviewBlocker { id: "invalid-tag-count".to_string(), code: "INVALID_TAG_COUNT".to_string(), @@ -927,7 +950,10 @@ pub fn swap_pieces( normalize_required_string(first_piece_id).ok_or(PuzzleFieldError::MissingPieceId)?; let second_piece_id = normalize_required_string(second_piece_id).ok_or(PuzzleFieldError::MissingPieceId)?; - let current_level = run.current_level.clone().ok_or(PuzzleFieldError::InvalidOperation)?; + let current_level = run + .current_level + .clone() + .ok_or(PuzzleFieldError::InvalidOperation)?; if current_level.status == PuzzleRuntimeLevelStatus::Cleared { return Err(PuzzleFieldError::InvalidOperation); } @@ -941,9 +967,14 @@ pub fn swap_pieces( .position(|piece| piece.piece_id == second_piece_id) .ok_or(PuzzleFieldError::MissingPieceId)?; - let (first_row, first_col) = (pieces[first_index].current_row, pieces[first_index].current_col); - let (second_row, second_col) = - (pieces[second_index].current_row, pieces[second_index].current_col); + let (first_row, first_col) = ( + pieces[first_index].current_row, + pieces[first_index].current_col, + ); + let (second_row, second_col) = ( + pieces[second_index].current_row, + pieces[second_index].current_col, + ); pieces[first_index].current_row = second_row; pieces[first_index].current_col = second_col; pieces[second_index].current_row = first_row; @@ -960,7 +991,10 @@ pub fn drag_piece_or_group( target_col: u32, ) -> Result { let piece_id = normalize_required_string(piece_id).ok_or(PuzzleFieldError::MissingPieceId)?; - let current_level = run.current_level.clone().ok_or(PuzzleFieldError::InvalidOperation)?; + let current_level = run + .current_level + .clone() + .ok_or(PuzzleFieldError::InvalidOperation)?; if current_level.status == PuzzleRuntimeLevelStatus::Cleared { return Err(PuzzleFieldError::InvalidOperation); } @@ -989,7 +1023,10 @@ pub fn advance_next_level( run: &PuzzleRunSnapshot, next_profile: &PuzzleWorkProfile, ) -> Result { - let current_level = run.current_level.clone().ok_or(PuzzleFieldError::InvalidOperation)?; + let current_level = run + .current_level + .clone() + .ok_or(PuzzleFieldError::InvalidOperation)?; if current_level.status != PuzzleRuntimeLevelStatus::Cleared { return Err(PuzzleFieldError::InvalidOperation); } @@ -1057,7 +1094,10 @@ pub fn select_next_profile<'a>( .unwrap_or(std::cmp::Ordering::Equal) .then_with(|| { tag_similarity_score(¤t_profile.theme_tags, &left.theme_tags) - .partial_cmp(&tag_similarity_score(¤t_profile.theme_tags, &right.theme_tags)) + .partial_cmp(&tag_similarity_score( + ¤t_profile.theme_tags, + &right.theme_tags, + )) .unwrap_or(std::cmp::Ordering::Equal) }) .then_with(|| right.play_count.cmp(&left.play_count)) @@ -1065,7 +1105,10 @@ pub fn select_next_profile<'a>( }) } -pub fn recommendation_score(current_profile: &PuzzleWorkProfile, candidate: &PuzzleWorkProfile) -> f32 { +pub fn recommendation_score( + current_profile: &PuzzleWorkProfile, + candidate: &PuzzleWorkProfile, +) -> f32 { let tag_similarity = tag_similarity_score(¤t_profile.theme_tags, &candidate.theme_tags); let same_author_score = if current_profile.owner_user_id == candidate.owner_user_id { 1.0 @@ -1076,8 +1119,12 @@ pub fn recommendation_score(current_profile: &PuzzleWorkProfile, candidate: &Puz } pub fn tag_similarity_score(left_tags: &[String], right_tags: &[String]) -> f32 { - let left_set = normalize_theme_tags(left_tags.to_vec()).into_iter().collect::>(); - let right_set = normalize_theme_tags(right_tags.to_vec()).into_iter().collect::>(); + let left_set = normalize_theme_tags(left_tags.to_vec()) + .into_iter() + .collect::>(); + let right_set = normalize_theme_tags(right_tags.to_vec()) + .into_iter() + .collect::>(); if left_set.is_empty() && right_set.is_empty() { return 0.0; } @@ -1211,7 +1258,11 @@ fn rebuild_board_snapshot( let group_by_piece = merged_groups .iter() .flat_map(|group| { - group.piece_ids.iter().cloned().map(|piece_id| (piece_id, group.group_id.clone())) + group + .piece_ids + .iter() + .cloned() + .map(|piece_id| (piece_id, group.group_id.clone())) }) .collect::>(); @@ -1263,7 +1314,9 @@ fn resolve_merged_groups(pieces: &[PuzzlePieceState]) -> Vec>(); if group_indices.is_empty() { return Err(PuzzleFieldError::InvalidOperation); @@ -1368,7 +1429,11 @@ fn drag_group( for &index in &group_indices { let next_row = pieces[index].current_row as i32 + row_offset; let next_col = pieces[index].current_col as i32 + col_offset; - if next_row < 0 || next_col < 0 || next_row >= grid_size as i32 || next_col >= grid_size as i32 { + if next_row < 0 + || next_col < 0 + || next_row >= grid_size as i32 + || next_col >= grid_size as i32 + { return Err(PuzzleFieldError::InvalidTargetCell); } target_positions.push((index, next_row as u32, next_col as u32)); @@ -1433,7 +1498,11 @@ fn with_next_board(run: &PuzzleRunSnapshot, next_board: PuzzleBoardSnapshot) -> mod tests { use super::*; - fn build_published_profile(profile_id: &str, owner_user_id: &str, tags: Vec<&str>) -> PuzzleWorkProfile { + fn build_published_profile( + profile_id: &str, + owner_user_id: &str, + tags: Vec<&str>, + ) -> PuzzleWorkProfile { PuzzleWorkProfile { work_id: format!("work-{profile_id}"), profile_id: profile_id.to_string(), @@ -1490,8 +1559,8 @@ mod tests { build_published_profile("b", "owner-a", vec!["蒸汽城市", "雨夜"]), build_published_profile("c", "owner-c", vec!["猫咪", "森林"]), ]; - let selected = select_next_profile(¤t, &["a".to_string()], &candidates) - .expect("should select"); + let selected = + select_next_profile(¤t, &["a".to_string()], &candidates).expect("should select"); assert_eq!(selected.profile_id, "b"); } @@ -1502,8 +1571,18 @@ mod tests { let current_level = run.current_level.clone().expect("level"); let first_piece = current_level.board.pieces[0].clone(); let second_piece = current_level.board.pieces[1].clone(); - let swapped = swap_pieces(&run, &first_piece.piece_id, &second_piece.piece_id).expect("swap"); - assert_eq!(swapped.current_level.as_ref().expect("level").board.pieces.len(), 9); + let swapped = + swap_pieces(&run, &first_piece.piece_id, &second_piece.piece_id).expect("swap"); + assert_eq!( + swapped + .current_level + .as_ref() + .expect("level") + .board + .pieces + .len(), + 9 + ); } #[test] @@ -1539,13 +1618,9 @@ mod tests { fn apply_publish_overrides_rejects_invalid_tag_count() { let anchor_pack = infer_anchor_pack("蒸汽城市", Some("蒸汽城市")); let draft = compile_result_draft(&anchor_pack, &[]); - let error = apply_publish_overrides_to_draft( - &draft, - None, - None, - Some(vec!["蒸汽".to_string()]), - ) - .expect_err("invalid tag count should fail"); + let error = + apply_publish_overrides_to_draft(&draft, None, None, Some(vec!["蒸汽".to_string()])) + .expect_err("invalid tag count should fail"); assert_eq!(error, PuzzleFieldError::InvalidTagCount); } diff --git a/server-rs/crates/module-runtime-story-compat/src/battle.rs b/server-rs/crates/module-runtime-story-compat/src/battle.rs index 39c49075..a380d118 100644 --- a/server-rs/crates/module-runtime-story-compat/src/battle.rs +++ b/server-rs/crates/module-runtime-story-compat/src/battle.rs @@ -1,8 +1,7 @@ use serde_json::{Map, Value, json}; use shared_contracts::runtime_story::{ - RuntimeBattlePresentation, RuntimeStoryActionRequest, RuntimeStoryOptionView, - RuntimeStoryPatch, + RuntimeBattlePresentation, RuntimeStoryActionRequest, RuntimeStoryOptionView, RuntimeStoryPatch, }; use crate::{ @@ -471,7 +470,10 @@ fn read_player_inventory_items(game_state: &Value) -> Vec Option { +fn find_player_inventory_item( + game_state: &Value, + item_id: &str, +) -> Option { read_player_inventory_items(game_state) .into_iter() .find(|item| item.id == item_id) @@ -798,10 +800,7 @@ fn build_inventory_use_battle_action_plan( }) } -fn battle_action_toast( - function_id: &str, - request: &RuntimeStoryActionRequest, -) -> Option { +fn battle_action_toast(function_id: &str, request: &RuntimeStoryActionRequest) -> Option { if function_id != "inventory_use" { return None; } diff --git a/server-rs/crates/module-runtime-story-compat/src/forge_actions.rs b/server-rs/crates/module-runtime-story-compat/src/forge_actions.rs index 03d3c6b5..ba2cde78 100644 --- a/server-rs/crates/module-runtime-story-compat/src/forge_actions.rs +++ b/server-rs/crates/module-runtime-story-compat/src/forge_actions.rs @@ -115,7 +115,10 @@ pub fn resolve_forge_dismantle_action( next_inventory = remove_inventory_item_from_list(next_inventory, item_id.as_str(), 1); next_inventory = add_inventory_items_to_list(next_inventory, outputs.clone()); write_player_inventory_values(game_state, next_inventory); - let output_names = outputs.iter().map(read_inventory_item_name).collect::>(); + let output_names = outputs + .iter() + .map(read_inventory_item_name) + .collect::>(); Ok(StoryResolution { action_text: resolve_action_text( diff --git a/server-rs/crates/module-runtime-story-compat/src/lib.rs b/server-rs/crates/module-runtime-story-compat/src/lib.rs index cf655652..af4758a1 100644 --- a/server-rs/crates/module-runtime-story-compat/src/lib.rs +++ b/server-rs/crates/module-runtime-story-compat/src/lib.rs @@ -13,6 +13,9 @@ pub mod npc_support; pub mod options; pub mod view_model; +pub use battle::{ + build_battle_runtime_story_options, resolve_battle_action, restore_player_resource, +}; pub use core::{ MAX_PLAYER_LEVEL, add_player_currency, add_player_inventory_items, append_active_build_buffs, append_story_history, clear_encounter_only, clear_encounter_state, cumulative_xp_required, @@ -25,27 +28,26 @@ pub use core::{ write_first_hostile_npc_i32_field, write_i32_field, write_null_field, write_string_field, write_u32_field, xp_to_next_level_for, }; +pub use forge::{build_runtime_equipment_item, build_runtime_material_item, format_currency_text}; +pub use forge_actions::{ + resolve_forge_craft_action, resolve_forge_dismantle_action, resolve_forge_reforge_action, +}; pub use game_state::{ add_inventory_items_to_list, apply_equipment_loadout_to_state, battle_mode_text, build_current_build_toast, clone_inventory_item_with_quantity, current_encounter_id, current_encounter_name, current_encounter_name_from_battle, ensure_inventory_action_available, equipment_bonus_fallbacks, equipment_item_bonuses, equipment_slot_label, find_player_inventory_entry, has_giftable_player_inventory, item_rarity_key, - normalize_equipped_item, normalize_equipment_slot_id, read_equipment_total_bonuses, + normalize_equipment_slot_id, normalize_equipped_item, read_equipment_total_bonuses, read_inventory_item_name, read_player_equipment_item, read_player_inventory_values, read_runtime_equipment_bonus_cache, remove_inventory_item_from_list, resolve_equipment_slot_for_item, write_player_equipment_item, write_player_inventory_values, write_runtime_equipment_bonus_cache, }; -pub use forge::{build_runtime_equipment_item, build_runtime_material_item, format_currency_text}; -pub use forge_actions::{ - resolve_forge_craft_action, resolve_forge_dismantle_action, resolve_forge_reforge_action, -}; pub use npc_support::{ build_npc_gift_result_text, npc_buyback_price, npc_purchase_price, recruit_companion_to_party, resolve_npc_gift_affinity_gain, trade_quantity_suffix, }; -pub use battle::{build_battle_runtime_story_options, resolve_battle_action, restore_player_resource}; pub use options::{ build_disabled_runtime_story_option, build_runtime_story_option_from_story_option, build_runtime_story_option_interaction, build_runtime_story_option_with_payload, diff --git a/server-rs/crates/module-runtime-story-compat/src/options.rs b/server-rs/crates/module-runtime-story-compat/src/options.rs index ad74056a..b2970a1a 100644 --- a/server-rs/crates/module-runtime-story-compat/src/options.rs +++ b/server-rs/crates/module-runtime-story-compat/src/options.rs @@ -1,12 +1,8 @@ use serde_json::Value; -use shared_contracts::runtime_story::{ - RuntimeStoryOptionInteraction, RuntimeStoryOptionView, -}; +use shared_contracts::runtime_story::{RuntimeStoryOptionInteraction, RuntimeStoryOptionView}; -use crate::{ - read_bool_field, read_field, read_optional_string_field, read_required_string_field, -}; +use crate::{read_bool_field, read_field, read_optional_string_field, read_required_string_field}; /// 这批 helper 只负责 runtime story option 的纯 DTO 编译,不触碰 HTTP / AppState。 pub fn infer_option_scope(function_id: &str) -> &'static str { diff --git a/server-rs/crates/module-runtime-story-compat/src/view_model.rs b/server-rs/crates/module-runtime-story-compat/src/view_model.rs index 0e7d3322..e8bce211 100644 --- a/server-rs/crates/module-runtime-story-compat/src/view_model.rs +++ b/server-rs/crates/module-runtime-story-compat/src/view_model.rs @@ -38,9 +38,7 @@ pub fn build_runtime_story_view_model( } } -pub fn build_runtime_story_companions( - game_state: &Value, -) -> Vec { +pub fn build_runtime_story_companions(game_state: &Value) -> Vec { read_array_field(game_state, "companions") .into_iter() .filter_map(|entry| { @@ -54,9 +52,7 @@ pub fn build_runtime_story_companions( .collect() } -pub fn build_runtime_story_encounter( - game_state: &Value, -) -> Option { +pub fn build_runtime_story_encounter(game_state: &Value) -> Option { let encounter = read_object_field(game_state, "currentEncounter")?; let npc_name = read_required_string_field(encounter, "npcName") .or_else(|| read_required_string_field(encounter, "name")) diff --git a/server-rs/crates/module-runtime/src/lib.rs b/server-rs/crates/module-runtime/src/lib.rs index 7fcae203..85ffa19f 100644 --- a/server-rs/crates/module-runtime/src/lib.rs +++ b/server-rs/crates/module-runtime/src/lib.rs @@ -652,10 +652,10 @@ pub fn build_runtime_snapshot_upsert_input( 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 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 { @@ -1012,7 +1012,9 @@ impl std::fmt::Display for RuntimeProfileFieldError { 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::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/platform-auth/src/lib.rs b/server-rs/crates/platform-auth/src/lib.rs index 21f1cd69..214c91fb 100644 --- a/server-rs/crates/platform-auth/src/lib.rs +++ b/server-rs/crates/platform-auth/src/lib.rs @@ -504,10 +504,7 @@ impl SmsAuthProvider { } } - pub async fn verify_code( - &self, - request: SmsVerifyCodeRequest, - ) -> Result<(), SmsProviderError> { + pub async fn verify_code(&self, request: SmsVerifyCodeRequest) -> Result<(), SmsProviderError> { match self { Self::Mock(provider) => provider.verify_code(request).await, Self::Aliyun(provider) => provider.verify_code(request).await, @@ -520,7 +517,8 @@ impl MockSmsAuthProvider { &self, request: SmsSendCodeRequest, ) -> Result { - let provider_out_id = build_sms_provider_out_id(&request.scene, &request.national_phone_number); + let provider_out_id = + build_sms_provider_out_id(&request.scene, &request.national_phone_number); Ok(SmsSendCodeResult { cooldown_seconds: self.config.interval_seconds, @@ -530,10 +528,7 @@ impl MockSmsAuthProvider { }) } - async fn verify_code( - &self, - request: SmsVerifyCodeRequest, - ) -> Result<(), SmsProviderError> { + async fn verify_code(&self, request: SmsVerifyCodeRequest) -> Result<(), SmsProviderError> { if request.verify_code.trim() != self.config.mock_verify_code { return Err(SmsProviderError::InvalidVerifyCode); } @@ -546,7 +541,8 @@ impl AliyunSmsAuthProvider { &self, request: SmsSendCodeRequest, ) -> Result { - let provider_out_id = build_sms_provider_out_id(&request.scene, &request.national_phone_number); + let provider_out_id = + build_sms_provider_out_id(&request.scene, &request.national_phone_number); let phone_masked = mask_phone_number(&request.national_phone_number); let template_param = serde_json::json!({ self.config.template_param_key.clone(): "##code##", @@ -577,26 +573,23 @@ impl AliyunSmsAuthProvider { query.insert("SignatureVersion".to_string(), "1.0".to_string()); query.insert( "AccessKeyId".to_string(), - self.config - .access_key_id - .clone() - .unwrap_or_default(), + self.config.access_key_id.clone().unwrap_or_default(), ); query.insert( "PhoneNumber".to_string(), request.national_phone_number.trim().to_string(), ); - query.insert( - "CountryCode".to_string(), - self.config.country_code.clone(), - ); + query.insert("CountryCode".to_string(), self.config.country_code.clone()); query.insert("SignName".to_string(), self.config.sign_name.clone()); query.insert( "TemplateCode".to_string(), self.config.template_code.clone(), ); query.insert("TemplateParam".to_string(), template_param); - query.insert("CodeLength".to_string(), self.config.code_length.to_string()); + query.insert( + "CodeLength".to_string(), + self.config.code_length.to_string(), + ); query.insert("CodeType".to_string(), self.config.code_type.to_string()); query.insert( "ValidTime".to_string(), @@ -640,7 +633,10 @@ impl AliyunSmsAuthProvider { provider_request_id = body .request_id .as_deref() - .or_else(|| body.model.as_ref().and_then(|model| model.request_id.as_deref())) + .or_else(|| body + .model + .as_ref() + .and_then(|model| model.request_id.as_deref())) .unwrap_or("unknown"), provider_out_id = body .model @@ -661,7 +657,10 @@ impl AliyunSmsAuthProvider { provider_request_id = body .request_id .as_deref() - .or_else(|| body.model.as_ref().and_then(|model| model.request_id.as_deref())) + .or_else(|| body + .model + .as_ref() + .and_then(|model| model.request_id.as_deref())) .unwrap_or("unknown"), provider_out_id = body .model @@ -680,17 +679,16 @@ impl AliyunSmsAuthProvider { Ok(SmsSendCodeResult { cooldown_seconds: self.config.interval_seconds, expires_in_seconds: self.config.valid_time_seconds, - provider_request_id: body - .request_id - .or_else(|| body.model.as_ref().and_then(|model| model.request_id.clone())), + provider_request_id: body.request_id.or_else(|| { + body.model + .as_ref() + .and_then(|model| model.request_id.clone()) + }), provider_out_id: body.model.and_then(|model| model.out_id), }) } - async fn verify_code( - &self, - request: SmsVerifyCodeRequest, - ) -> Result<(), SmsProviderError> { + async fn verify_code(&self, request: SmsVerifyCodeRequest) -> Result<(), SmsProviderError> { let mut query = BTreeMap::new(); query.insert("Action".to_string(), "CheckSmsVerifyCode".to_string()); query.insert("Format".to_string(), "json".to_string()); @@ -701,19 +699,13 @@ impl AliyunSmsAuthProvider { query.insert("SignatureVersion".to_string(), "1.0".to_string()); query.insert( "AccessKeyId".to_string(), - self.config - .access_key_id - .clone() - .unwrap_or_default(), + self.config.access_key_id.clone().unwrap_or_default(), ); query.insert( "PhoneNumber".to_string(), request.national_phone_number.trim().to_string(), ); - query.insert( - "CountryCode".to_string(), - self.config.country_code.clone(), - ); + query.insert("CountryCode".to_string(), self.config.country_code.clone()); query.insert( "VerifyCode".to_string(), request.verify_code.trim().to_string(), @@ -746,12 +738,7 @@ impl AliyunSmsAuthProvider { body.code, )); } - if body - .model - .and_then(|model| model.verify_result) - .as_deref() - != Some("PASS") - { + if body.model.and_then(|model| model.verify_result).as_deref() != Some("PASS") { return Err(SmsProviderError::InvalidVerifyCode); } @@ -759,11 +746,9 @@ impl AliyunSmsAuthProvider { } fn sign_query(&self, query: &mut BTreeMap) -> Result<(), SmsProviderError> { - let access_key_secret = self - .config - .access_key_secret - .as_deref() - .ok_or_else(|| SmsProviderError::InvalidConfig("阿里云短信 AccessKeySecret 未配置".to_string()))?; + let access_key_secret = self.config.access_key_secret.as_deref().ok_or_else(|| { + SmsProviderError::InvalidConfig("阿里云短信 AccessKeySecret 未配置".to_string()) + })?; let canonicalized = canonicalize_aliyun_rpc_params(query); let string_to_sign = format!( "POST&{}&{}", @@ -771,7 +756,9 @@ impl AliyunSmsAuthProvider { aliyun_percent_encode(&canonicalized) ); let mut signer = HmacSha1::new_from_slice(format!("{access_key_secret}&").as_bytes()) - .map_err(|error| SmsProviderError::InvalidConfig(format!("初始化短信签名器失败:{error}")))?; + .map_err(|error| { + SmsProviderError::InvalidConfig(format!("初始化短信签名器失败:{error}")) + })?; signer.update(string_to_sign.as_bytes()); let signature = BASE64_STANDARD.encode(signer.finalize().into_bytes()); query.insert("Signature".to_string(), signature); @@ -1138,9 +1125,10 @@ async fn parse_aliyun_json_response( .text() .await .map_err(|error| SmsProviderError::Upstream(format!("{fallback_message}:{error}")))?; - let payload = serde_json::from_str::(&body).map_err(|error| { - SmsProviderError::Upstream(format!("{fallback_message}:响应解析失败:{error}")) - })?; + let payload = + serde_json::from_str::(&body).map_err(|error| { + SmsProviderError::Upstream(format!("{fallback_message}:响应解析失败:{error}")) + })?; if status.is_client_error() || status.is_server_error() { return Err(map_http_status_to_sms_provider_error( fallback_message, @@ -1160,8 +1148,10 @@ async fn parse_aliyun_json_response_for_verify( .text() .await .map_err(|error| SmsProviderError::Upstream(format!("验证码校验失败:{error}")))?; - let payload = serde_json::from_str::(&body) - .map_err(|error| SmsProviderError::Upstream(format!("验证码校验失败:响应解析失败:{error}")))?; + let payload = + serde_json::from_str::(&body).map_err(|error| { + SmsProviderError::Upstream(format!("验证码校验失败:响应解析失败:{error}")) + })?; if status.is_client_error() || status.is_server_error() { return Err(map_http_status_to_sms_provider_error( "验证码校验失败", @@ -1461,7 +1451,10 @@ mod tests { #[test] fn sms_auth_provider_kind_parses_supported_values() { - assert_eq!(SmsAuthProviderKind::parse("mock"), Some(SmsAuthProviderKind::Mock)); + assert_eq!( + SmsAuthProviderKind::parse("mock"), + Some(SmsAuthProviderKind::Mock) + ); assert_eq!( SmsAuthProviderKind::parse("aliyun"), Some(SmsAuthProviderKind::Aliyun) @@ -1482,7 +1475,10 @@ mod tests { .expect("send code should succeed"); assert_eq!(send_result.cooldown_seconds, DEFAULT_SMS_INTERVAL_SECONDS); - assert_eq!(send_result.expires_in_seconds, DEFAULT_SMS_VALID_TIME_SECONDS); + assert_eq!( + send_result.expires_in_seconds, + DEFAULT_SMS_VALID_TIME_SECONDS + ); assert_eq!( send_result.provider_request_id.as_deref(), Some("mock-request-id") @@ -1548,7 +1544,10 @@ mod tests { #[test] fn canonicalize_aliyun_rpc_params_keeps_sorted_percent_encoded_order() { let mut params = BTreeMap::new(); - params.insert("TemplateParam".to_string(), "{\"code\":\"##code##\"}".to_string()); + params.insert( + "TemplateParam".to_string(), + "{\"code\":\"##code##\"}".to_string(), + ); params.insert("Action".to_string(), "SendSmsVerifyCode".to_string()); params.insert("PhoneNumber".to_string(), "13800138000".to_string()); @@ -1580,7 +1579,10 @@ mod tests { assert_eq!(payload.request_id.as_deref(), Some("req_123")); assert_eq!(payload.success, Some(true)); assert_eq!( - payload.model.as_ref().and_then(|model| model.out_id.as_deref()), + payload + .model + .as_ref() + .and_then(|model| model.out_id.as_deref()), Some("out_789") ); assert_eq!( diff --git a/server-rs/crates/platform-llm/src/lib.rs b/server-rs/crates/platform-llm/src/lib.rs index 1c141b8e..311c4452 100644 --- a/server-rs/crates/platform-llm/src/lib.rs +++ b/server-rs/crates/platform-llm/src/lib.rs @@ -458,11 +458,9 @@ impl LlmClient { } if !undecoded_chunk_bytes.is_empty() { - let trailing_text = std_str::from_utf8(undecoded_chunk_bytes.as_slice()) - .map_err(|error| { - LlmError::Deserialize(format!( - "解析 LLM 流式 UTF-8 响应失败:{error}" - )) + let trailing_text = + std_str::from_utf8(undecoded_chunk_bytes.as_slice()).map_err(|error| { + LlmError::Deserialize(format!("解析 LLM 流式 UTF-8 响应失败:{error}")) })?; if !trailing_text.is_empty() { for event in parser.push_chunk(trailing_text)? { @@ -761,9 +759,7 @@ fn decode_utf8_stream_chunk(bytes: &[u8]) -> Result<(String, Vec), LlmError> let valid_up_to = error.valid_up_to(); let Some(_) = error.error_len() else { let decoded = std_str::from_utf8(&bytes[..valid_up_to]).map_err(|inner_error| { - LlmError::Deserialize(format!( - "解析 LLM 流式 UTF-8 响应失败:{inner_error}" - )) + LlmError::Deserialize(format!("解析 LLM 流式 UTF-8 响应失败:{inner_error}")) })?; return Ok((decoded.to_string(), bytes[valid_up_to..].to_vec())); }; diff --git a/server-rs/crates/shared-contracts/src/admin.rs b/server-rs/crates/shared-contracts/src/admin.rs index c23632b3..66ea8486 100644 --- a/server-rs/crates/shared-contracts/src/admin.rs +++ b/server-rs/crates/shared-contracts/src/admin.rs @@ -1,6 +1,7 @@ use serde::{Deserialize, Serialize}; use serde_json::Value; +// 管理后台协议统一收口在 shared-contracts,避免页面脚本和 Rust handler 各自手拼字段。 #[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct AdminLoginRequest { @@ -8,6 +9,7 @@ pub struct AdminLoginRequest { pub password: String, } +// 登录成功后返回管理员访问令牌与基础会话信息。 #[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct AdminLoginResponse { @@ -15,6 +17,7 @@ pub struct AdminLoginResponse { pub admin: AdminSessionPayload, } +// 管理员会话只暴露页面展示和鉴权调试所需的最小字段。 #[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct AdminSessionPayload { @@ -26,12 +29,14 @@ pub struct AdminSessionPayload { pub expires_at: String, } +// 页面恢复登录态时读取当前管理员会话。 #[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct AdminMeResponse { pub admin: AdminSessionPayload, } +// 后台概览统一返回服务信息与数据库信息两块,前端不再额外拼装。 #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] #[serde(rename_all = "camelCase")] pub struct AdminOverviewResponse { @@ -39,6 +44,7 @@ pub struct AdminOverviewResponse { pub database: AdminDatabaseOverviewPayload, } +// 服务概览描述当前 api-server 与 SpacetimeDB 连接配置。 #[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct AdminServiceOverviewPayload { @@ -50,6 +56,7 @@ pub struct AdminServiceOverviewPayload { pub spacetime_database: String, } +// 数据库概览返回真实数据库元信息、表清单与统计错误。 #[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct AdminDatabaseOverviewPayload { @@ -61,6 +68,7 @@ pub struct AdminDatabaseOverviewPayload { pub fetch_errors: Vec, } +// 单表统计允许成功和失败并存,避免某张表失败导致整页概览不可用。 #[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct AdminDatabaseTableStatPayload { @@ -69,6 +77,7 @@ pub struct AdminDatabaseTableStatPayload { pub error_message: Option, } +// 调试请求只允许同源路径、受控请求头和有限请求体。 #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] #[serde(rename_all = "camelCase")] pub struct AdminDebugHttpRequest { @@ -78,6 +87,7 @@ pub struct AdminDebugHttpRequest { pub body: Option, } +// 调试请求头使用显式结构,避免页面直接塞任意对象。 #[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct AdminDebugHeaderInput { @@ -85,6 +95,7 @@ pub struct AdminDebugHeaderInput { pub value: String, } +// 调试响应回显状态、响应头与文本/JSON 预览,便于后台排查接口问题。 #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] #[serde(rename_all = "camelCase")] pub struct AdminDebugHttpResponse { diff --git a/server-rs/crates/spacetime-client/src/lib.rs b/server-rs/crates/spacetime-client/src/lib.rs index 5ed09a76..891a079b 100644 --- a/server-rs/crates/spacetime-client/src/lib.rs +++ b/server-rs/crates/spacetime-client/src/lib.rs @@ -155,8 +155,7 @@ use crate::module_bindings::{ BigFishSessionGetInput as BindingBigFishSessionGetInput, BigFishSessionProcedureResult as BindingBigFishSessionProcedureResult, BigFishSessionSnapshot as BindingBigFishSessionSnapshot, - BigFishVector2 as BindingBigFishVector2, - BigFishWorksListInput as BindingBigFishWorksListInput, + BigFishVector2 as BindingBigFishVector2, BigFishWorksListInput as BindingBigFishWorksListInput, BigFishWorksProcedureResult as BindingBigFishWorksProcedureResult, CombatOutcome as BindingCombatOutcome, CustomWorldAgentActionExecuteInput as BindingCustomWorldAgentActionExecuteInput, @@ -323,10 +322,10 @@ use crate::module_bindings::{ 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_big_fish_works_procedure::list_big_fish_works as _, list_custom_world_gallery_entries_procedure::list_custom_world_gallery_entries as _, list_custom_world_profiles_procedure::list_custom_world_profiles as _, list_custom_world_works_procedure::list_custom_world_works as _, - list_big_fish_works_procedure::list_big_fish_works 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 _, @@ -1534,15 +1533,14 @@ impl SpacetimeClient { let procedure_input = BindingBigFishWorksListInput { owner_user_id }; self.call_after_connect(move |connection, sender| { - connection.procedures().list_big_fish_works_then( - procedure_input, - move |_, result| { + connection + .procedures() + .list_big_fish_works_then(procedure_input, move |_, result| { let mapped = result .map_err(|error| SpacetimeClientError::Procedure(error.to_string())) .and_then(map_big_fish_works_procedure_result); send_once(&sender, mapped); - }, - ); + }); }) .await } @@ -3582,8 +3580,9 @@ fn map_big_fish_works_procedure_result( "SpacetimeDB procedure 未返回 big fish works 快照".to_string(), ) })?; - serde_json::from_str::>(&items_json) - .map_err(|error| SpacetimeClientError::Runtime(format!("big fish works items_json 非法: {error}"))) + serde_json::from_str::>(&items_json).map_err(|error| { + SpacetimeClientError::Runtime(format!("big fish works items_json 非法: {error}")) + }) } fn map_big_fish_run_procedure_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 b9e670d6..61e6b9c5 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -19,10 +14,8 @@ 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 { @@ -40,9 +33,8 @@ 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, @@ -55,9 +47,11 @@ pub trait accept_quest { &self, input: QuestRecordInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + Send + + 'static, ) -> __sdk::Result<()>; } @@ -66,11 +60,13 @@ impl accept_quest for super::RemoteReducers { &self, input: QuestRecordInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + 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 6027c9f6..b1419fb7 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -19,10 +14,8 @@ 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 { @@ -40,9 +33,8 @@ 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, @@ -55,9 +47,11 @@ pub trait acknowledge_quest_completion { &self, input: QuestCompletionAckInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + Send + + 'static, ) -> __sdk::Result<()>; } @@ -66,11 +60,13 @@ impl acknowledge_quest_completion for super::RemoteReducers { &self, input: QuestCompletionAckInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + 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/advance_puzzle_next_level_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/advance_puzzle_next_level_procedure.rs index 4a7804c7..7cb4f8f4 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/advance_puzzle_next_level_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/advance_puzzle_next_level_procedure.rs @@ -2,23 +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::puzzle_run_next_level_input_type::PuzzleRunNextLevelInput; use super::puzzle_run_procedure_result_type::PuzzleRunProcedureResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] - struct AdvancePuzzleNextLevelArgs { +struct AdvancePuzzleNextLevelArgs { pub input: PuzzleRunNextLevelInput, } - impl __sdk::InModule for AdvancePuzzleNextLevelArgs { type Module = super::RemoteModule; } @@ -28,16 +22,19 @@ impl __sdk::InModule for AdvancePuzzleNextLevelArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait advance_puzzle_next_level { - fn advance_puzzle_next_level(&self, input: PuzzleRunNextLevelInput, -) { - self.advance_puzzle_next_level_then(input, |_, _| {}); + fn advance_puzzle_next_level(&self, input: PuzzleRunNextLevelInput) { + self.advance_puzzle_next_level_then(input, |_, _| {}); } fn advance_puzzle_next_level_then( &self, input: PuzzleRunNextLevelInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -46,13 +43,17 @@ impl advance_puzzle_next_level for super::RemoteProcedures { &self, input: PuzzleRunNextLevelInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { - self.imp.invoke_procedure_with_callback::<_, PuzzleRunProcedureResult>( - "advance_puzzle_next_level", - AdvancePuzzleNextLevelArgs { input, }, - __callback, - ); + self.imp + .invoke_procedure_with_callback::<_, PuzzleRunProcedureResult>( + "advance_puzzle_next_level", + AdvancePuzzleNextLevelArgs { 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 c22d39dd..b63aad41 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -17,12 +12,10 @@ 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 9b9a5a43..0e5f045b 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -24,12 +19,8 @@ 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 7522ac4c..f949db7f 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -18,12 +13,10 @@ 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 6a648b5b..09b7c492 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,14 +2,9 @@ // WILL NOT BE 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_result_reference_type::AiResultReference; use super::ai_result_reference_kind_type::AiResultReferenceKind; +use super::ai_result_reference_type::AiResultReference; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; /// Table handle for the table `ai_result_reference`. /// @@ -37,7 +32,9 @@ 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, } } @@ -50,8 +47,12 @@ 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; @@ -97,41 +98,44 @@ 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>, - } +/// 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, - } - } +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) + } +} - 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)] @@ -139,26 +143,24 @@ 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; - } - - impl ai_result_referenceQueryTableAccess for __sdk::QueryTableAccessor { - fn ai_result_reference(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("ai_result_reference") - } - } +#[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") + } +} 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 d9e32eaf..3b1121b0 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -19,16 +14,14 @@ 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. @@ -38,7 +31,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, } @@ -46,14 +39,16 @@ 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"), - } } } @@ -70,12 +65,13 @@ 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 c165fc55..7ce33006 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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,14 +11,12 @@ 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 1c5af5fa..93b697a6 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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 +11,6 @@ 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 2d53ad93..95b0506a 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -20,14 +15,12 @@ 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 dfdd6ee6..91a87cf5 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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,8 +12,6 @@ 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 f7bc9735..d8fe6713 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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 +11,6 @@ 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 7724e312..9468bc95 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -24,12 +19,8 @@ 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 f0457945..57728f6e 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -16,13 +11,11 @@ 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 c0259393..66fa9a15 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,17 +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; -use super::ai_task_stage_snapshot_type::AiTaskStageSnapshot; 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; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] @@ -22,23 +17,21 @@ 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 366ca586..8ed04d04 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -20,8 +15,6 @@ 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 679241ae..1d7405de 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -22,12 +17,8 @@ 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 9d449d38..30cdb845 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -20,15 +15,13 @@ 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 8571c6d8..956fff88 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -19,8 +14,6 @@ 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 3f60897b..e1a28d7c 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -20,12 +15,8 @@ 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 ae1617de..0bd84f77 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,15 +2,10 @@ // WILL NOT BE 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`. /// @@ -51,8 +46,12 @@ 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; @@ -98,39 +97,38 @@ 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>, - } +/// 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, - } - } +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) + } +} - 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); } @@ -140,26 +138,24 @@ 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; - } - - impl ai_task_stageQueryTableAccess for __sdk::QueryTableAccessor { - fn ai_task_stage(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("ai_task_stage") - } - } +#[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") + } +} 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 56a4094e..f4c902de 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -22,19 +17,17 @@ 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. @@ -46,11 +39,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 { @@ -65,11 +58,13 @@ 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"), - } } } @@ -88,10 +83,8 @@ 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 14fa5acb..d2145e81 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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 +11,6 @@ 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 58f1f7a2..3c59cd6a 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -22,12 +17,8 @@ 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 60172196..83c04b8a 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,15 +2,10 @@ // WILL NOT BE 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`. /// @@ -51,8 +46,12 @@ 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; @@ -98,39 +97,38 @@ 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>, - } +/// 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, - } - } +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) + } +} - 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); } @@ -140,26 +138,24 @@ 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; - } - - impl ai_taskQueryTableAccess for __sdk::QueryTableAccessor { - fn ai_task(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("ai_task") - } - } +#[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") + } +} 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 96d4077f..6b2845fc 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -20,25 +15,23 @@ 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. @@ -48,16 +41,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, } @@ -71,17 +64,22 @@ 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"), - } } } @@ -104,10 +102,8 @@ 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 11b5da68..0f462690 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -21,8 +16,6 @@ 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 81cb2ce9..f386071c 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -22,8 +17,6 @@ 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 2ef5c6ad..7311d79f 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,14 +2,9 @@ // WILL NOT BE 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_text_chunk_type::AiTextChunk; use super::ai_task_stage_kind_type::AiTaskStageKind; +use super::ai_text_chunk_type::AiTextChunk; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; /// Table handle for the table `ai_text_chunk`. /// @@ -50,8 +45,12 @@ 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; @@ -97,39 +96,40 @@ 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>, - } +/// 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, - } - } +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) + } +} - 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,26 +139,24 @@ 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; - } - - impl ai_text_chunkQueryTableAccess for __sdk::QueryTableAccessor { - fn ai_text_chunk(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("ai_text_chunk") - } - } +#[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") + } +} 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 df60c3a7..8a1a8c93 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -23,12 +18,10 @@ 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. @@ -53,7 +46,6 @@ 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"), - } } } @@ -72,10 +64,8 @@ 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 2edd4cbc..191e2ea7 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,23 +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_text_chunk_append_input_type::AiTextChunkAppendInput; use super::ai_task_procedure_result_type::AiTaskProcedureResult; +use super::ai_text_chunk_append_input_type::AiTextChunkAppendInput; #[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; } @@ -28,16 +22,19 @@ 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, ); } @@ -46,13 +43,17 @@ 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 e76eac6e..4a949906 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,23 +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::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; } @@ -28,16 +22,22 @@ 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,13 +46,17 @@ 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 04f54e54..44596083 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -19,10 +14,8 @@ 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 { @@ -40,9 +33,11 @@ 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, @@ -55,9 +50,11 @@ pub trait apply_chapter_progression_ledger_entry { &self, input: ChapterProgressionLedgerInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + Send + + 'static, ) -> __sdk::Result<()>; } @@ -66,11 +63,15 @@ impl apply_chapter_progression_ledger_entry for super::RemoteReducers { &self, input: ChapterProgressionLedgerInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + 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 4270f52a..d9b4240d 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -19,10 +14,8 @@ 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 { @@ -40,9 +33,8 @@ 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, @@ -55,9 +47,11 @@ pub trait apply_inventory_mutation { &self, input: InventoryMutationInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + Send + + 'static, ) -> __sdk::Result<()>; } @@ -66,11 +60,13 @@ impl apply_inventory_mutation for super::RemoteReducers { &self, input: InventoryMutationInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + 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 6976f6aa..6b4c310b 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -19,10 +14,8 @@ 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 { @@ -40,9 +33,8 @@ 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, @@ -55,9 +47,11 @@ pub trait apply_quest_signal { &self, input: QuestSignalApplyInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + Send + + 'static, ) -> __sdk::Result<()>; } @@ -66,11 +60,13 @@ impl apply_quest_signal for super::RemoteReducers { &self, input: QuestSignalApplyInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + 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 10dab835..10a39937 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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,13 +13,11 @@ 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 73eff3a6..1c51596f 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -15,12 +10,10 @@ 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 862d1b14..d559ea04 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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,14 +13,12 @@ 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 13f7b47f..971704ae 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,13 +2,8 @@ // WILL NOT BE 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`. /// @@ -36,7 +31,9 @@ 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, } } @@ -49,8 +46,12 @@ 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; @@ -96,39 +97,38 @@ 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>, - } +/// 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, - } - } +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) + } +} - 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,26 +138,24 @@ 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; - } - - impl asset_entity_bindingQueryTableAccess for __sdk::QueryTableAccessor { - fn asset_entity_binding(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("asset_entity_binding") - } - } +#[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") + } +} 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 8f5423b6..f12154e1 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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,18 +13,16 @@ 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. @@ -41,8 +33,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, } @@ -61,7 +53,6 @@ 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"), - } } } @@ -80,10 +71,8 @@ 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 3d6203bb..17d02930 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -16,12 +11,8 @@ 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 ea327af9..9ccf22ed 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -15,12 +10,10 @@ 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 2aeb9a22..526fa287 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,14 +2,9 @@ // WILL NOT BE 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_object_type::AssetObject; use super::asset_object_access_policy_type::AssetObjectAccessPolicy; +use super::asset_object_type::AssetObject; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; /// Table handle for the table `asset_object`. /// @@ -50,8 +45,12 @@ 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; @@ -97,39 +96,38 @@ 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>, - } +/// 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, - } - } +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) + } +} - 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); } @@ -139,26 +137,24 @@ 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; - } - - impl asset_objectQueryTableAccess for __sdk::QueryTableAccessor { - fn asset_object(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("asset_object") - } - } +#[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") + } +} 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 75935935..c9d57ac5 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -18,25 +13,23 @@ 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. @@ -45,14 +38,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, @@ -77,7 +70,6 @@ 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"), - } } } @@ -96,10 +88,8 @@ 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 7e48cffa..85fcadc6 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -18,20 +13,18 @@ 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 7b5d3860..b349f18d 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -18,21 +13,19 @@ 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 c7eb0e22..94d41850 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,23 +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_task_procedure_result_type::AiTaskProcedureResult; use super::ai_result_reference_input_type::AiResultReferenceInput; +use super::ai_task_procedure_result_type::AiTaskProcedureResult; #[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; } @@ -28,16 +22,19 @@ 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, ); } @@ -46,13 +43,17 @@ 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 1961ac69..a88c25f4 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -16,12 +11,8 @@ 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 104b96cb..6a176e2d 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -19,7 +14,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, @@ -30,12 +25,10 @@ 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 cadc80d8..e66352ad 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -15,12 +10,10 @@ 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 6b9298d4..53053cca 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -16,8 +10,6 @@ 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 c20ec25c..925d8468 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,17 +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::battle_status_type::BattleStatus; -use super::runtime_item_reward_item_snapshot_type::RuntimeItemRewardItemSnapshot; use super::combat_outcome_type::CombatOutcome; +use super::runtime_item_reward_item_snapshot_type::RuntimeItemRewardItemSnapshot; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] @@ -21,7 +16,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, @@ -33,11 +28,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, @@ -46,8 +41,6 @@ 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 53dc1ebb..98a289a4 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,17 +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 super::battle_state_type::BattleState; use super::battle_mode_type::BattleMode; +use super::battle_state_type::BattleState; use super::battle_status_type::BattleStatus; -use super::runtime_item_reward_item_snapshot_type::RuntimeItemRewardItemSnapshot; 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}; /// Table handle for the table `battle_state`. /// @@ -53,8 +48,12 @@ 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; @@ -100,39 +99,38 @@ 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>, - } +/// 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, - } - } +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) + } +} - 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); } @@ -142,26 +140,24 @@ 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; - } - - impl battle_stateQueryTableAccess for __sdk::QueryTableAccessor { - fn battle_state(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("battle_state") - } - } +#[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") + } +} 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 1b7e0420..9d9b852f 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,17 +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::battle_status_type::BattleStatus; -use super::runtime_item_reward_item_snapshot_type::RuntimeItemRewardItemSnapshot; use super::combat_outcome_type::CombatOutcome; +use super::runtime_item_reward_item_snapshot_type::RuntimeItemRewardItemSnapshot; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] @@ -21,7 +16,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, @@ -33,11 +28,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, @@ -46,12 +41,10 @@ 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. @@ -60,7 +53,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, @@ -72,11 +65,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, @@ -107,7 +100,10 @@ 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"), @@ -116,7 +112,6 @@ 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"), - } } } @@ -137,12 +132,13 @@ 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 e869befe..0aba4f43 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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,12 +13,8 @@ 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 75c19e04..304b2e0c 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,23 +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::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; } @@ -28,16 +22,19 @@ 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, ); } @@ -46,13 +43,17 @@ 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 582bb850..22bc4add 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -19,10 +14,8 @@ 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 { @@ -40,9 +33,8 @@ 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, @@ -55,9 +47,11 @@ pub trait begin_story_session { &self, input: StorySessionInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + Send + + 'static, ) -> __sdk::Result<()>; } @@ -66,11 +60,13 @@ impl begin_story_session for super::RemoteReducers { &self, input: StorySessionInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + 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/big_fish_agent_message_kind_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_agent_message_kind_type.rs index 174e55f8..00f36e4e 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_agent_message_kind_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_agent_message_kind_type.rs @@ -2,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -20,12 +15,8 @@ pub enum BigFishAgentMessageKind { ActionResult, Warning, - } - - impl __sdk::InModule for BigFishAgentMessageKind { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_agent_message_role_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_agent_message_role_type.rs index 9f8a0458..d8a1a82c 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_agent_message_role_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_agent_message_role_type.rs @@ -2,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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,12 +13,8 @@ pub enum BigFishAgentMessageRole { Assistant, System, - } - - impl __sdk::InModule for BigFishAgentMessageRole { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_agent_message_snapshot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_agent_message_snapshot_type.rs index d6b00fc5..acc31e57 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_agent_message_snapshot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_agent_message_snapshot_type.rs @@ -2,15 +2,10 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::big_fish_agent_message_role_type::BigFishAgentMessageRole; use super::big_fish_agent_message_kind_type::BigFishAgentMessageKind; +use super::big_fish_agent_message_role_type::BigFishAgentMessageRole; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] @@ -23,8 +18,6 @@ pub struct BigFishAgentMessageSnapshot { pub created_at_micros: i64, } - impl __sdk::InModule for BigFishAgentMessageSnapshot { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_agent_message_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_agent_message_table.rs index 59185a0b..cbb48abe 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_agent_message_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_agent_message_table.rs @@ -2,15 +2,10 @@ // WILL NOT BE 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::big_fish_agent_message_type::BigFishAgentMessage; -use super::big_fish_agent_message_role_type::BigFishAgentMessageRole; use super::big_fish_agent_message_kind_type::BigFishAgentMessageKind; +use super::big_fish_agent_message_role_type::BigFishAgentMessageRole; +use super::big_fish_agent_message_type::BigFishAgentMessage; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; /// Table handle for the table `big_fish_agent_message`. /// @@ -38,7 +33,9 @@ pub trait BigFishAgentMessageTableAccess { impl BigFishAgentMessageTableAccess for super::RemoteTables { fn big_fish_agent_message(&self) -> BigFishAgentMessageTableHandle<'_> { BigFishAgentMessageTableHandle { - imp: self.imp.get_table::("big_fish_agent_message"), + imp: self + .imp + .get_table::("big_fish_agent_message"), ctx: std::marker::PhantomData, } } @@ -51,8 +48,12 @@ impl<'ctx> __sdk::Table for BigFishAgentMessageTableHandle<'ctx> { type Row = BigFishAgentMessage; 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 = BigFishAgentMessageInsertCallbackId; @@ -98,39 +99,38 @@ impl<'ctx> __sdk::TableWithPrimaryKey for BigFishAgentMessageTableHandle<'ctx> { } } - /// Access to the `message_id` unique index on the table `big_fish_agent_message`, - /// which allows point queries on the field of the same name - /// via the [`BigFishAgentMessageMessageIdUnique::find`] method. - /// - /// Users are encouraged not to explicitly reference this type, - /// but to directly chain method calls, - /// like `ctx.db.big_fish_agent_message().message_id().find(...)`. - pub struct BigFishAgentMessageMessageIdUnique<'ctx> { - imp: __sdk::UniqueConstraintHandle, - phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, - } +/// Access to the `message_id` unique index on the table `big_fish_agent_message`, +/// which allows point queries on the field of the same name +/// via the [`BigFishAgentMessageMessageIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.big_fish_agent_message().message_id().find(...)`. +pub struct BigFishAgentMessageMessageIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} - impl<'ctx> BigFishAgentMessageTableHandle<'ctx> { - /// Get a handle on the `message_id` unique index on the table `big_fish_agent_message`. - pub fn message_id(&self) -> BigFishAgentMessageMessageIdUnique<'ctx> { - BigFishAgentMessageMessageIdUnique { - imp: self.imp.get_unique_constraint::("message_id"), - phantom: std::marker::PhantomData, - } - } +impl<'ctx> BigFishAgentMessageTableHandle<'ctx> { + /// Get a handle on the `message_id` unique index on the table `big_fish_agent_message`. + pub fn message_id(&self) -> BigFishAgentMessageMessageIdUnique<'ctx> { + BigFishAgentMessageMessageIdUnique { + imp: self.imp.get_unique_constraint::("message_id"), + phantom: std::marker::PhantomData, } + } +} + +impl<'ctx> BigFishAgentMessageMessageIdUnique<'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> BigFishAgentMessageMessageIdUnique<'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::("big_fish_agent_message"); _table.add_unique_constraint::("message_id", |row| &row.message_id); } @@ -140,26 +140,24 @@ 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 `BigFishAgentMessage`. - /// - /// Implemented for [`__sdk::QueryTableAccessor`]. - pub trait big_fish_agent_messageQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `BigFishAgentMessage`. - fn big_fish_agent_message(&self) -> __sdk::__query_builder::Table; - } - - impl big_fish_agent_messageQueryTableAccess for __sdk::QueryTableAccessor { - fn big_fish_agent_message(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("big_fish_agent_message") - } - } +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `BigFishAgentMessage`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait big_fish_agent_messageQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `BigFishAgentMessage`. + fn big_fish_agent_message(&self) -> __sdk::__query_builder::Table; +} +impl big_fish_agent_messageQueryTableAccess for __sdk::QueryTableAccessor { + fn big_fish_agent_message(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("big_fish_agent_message") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_agent_message_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_agent_message_type.rs index c55ecc3d..a5e70272 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_agent_message_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_agent_message_type.rs @@ -2,15 +2,10 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::big_fish_agent_message_role_type::BigFishAgentMessageRole; use super::big_fish_agent_message_kind_type::BigFishAgentMessageKind; +use super::big_fish_agent_message_role_type::BigFishAgentMessageRole; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] @@ -23,12 +18,10 @@ pub struct BigFishAgentMessage { pub created_at: __sdk::Timestamp, } - impl __sdk::InModule for BigFishAgentMessage { type Module = super::RemoteModule; } - /// Column accessor struct for the table `BigFishAgentMessage`. /// /// Provides typed access to columns for query building. @@ -51,7 +44,6 @@ impl __sdk::__query_builder::HasCols for BigFishAgentMessage { kind: __sdk::__query_builder::Col::new(table_name, "kind"), text: __sdk::__query_builder::Col::new(table_name, "text"), created_at: __sdk::__query_builder::Col::new(table_name, "created_at"), - } } } @@ -70,10 +62,8 @@ impl __sdk::__query_builder::HasIxCols for BigFishAgentMessage { BigFishAgentMessageIxCols { 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 BigFishAgentMessage {} - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_anchor_item_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_anchor_item_type.rs index 80ecc407..d876588e 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_anchor_item_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_anchor_item_type.rs @@ -2,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::big_fish_anchor_status_type::BigFishAnchorStatus; @@ -20,8 +15,6 @@ pub struct BigFishAnchorItem { pub status: BigFishAnchorStatus, } - impl __sdk::InModule for BigFishAnchorItem { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_anchor_pack_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_anchor_pack_type.rs index 6f93262e..5d93c291 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_anchor_pack_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_anchor_pack_type.rs @@ -2,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::big_fish_anchor_item_type::BigFishAnchorItem; @@ -20,8 +15,6 @@ pub struct BigFishAnchorPack { pub risk_tempo: BigFishAnchorItem, } - impl __sdk::InModule for BigFishAnchorPack { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_anchor_status_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_anchor_status_type.rs index d1ed8bb3..bcfe701e 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_anchor_status_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_anchor_status_type.rs @@ -2,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -20,12 +15,8 @@ pub enum BigFishAnchorStatus { Missing, Locked, - } - - impl __sdk::InModule for BigFishAnchorStatus { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_asset_coverage_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_asset_coverage_type.rs index c1b3429a..607a8c39 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_asset_coverage_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_asset_coverage_type.rs @@ -2,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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,11 +12,9 @@ pub struct BigFishAssetCoverage { pub background_ready: bool, pub required_level_count: u32, pub publish_ready: bool, - pub blockers: Vec::, + pub blockers: Vec, } - impl __sdk::InModule for BigFishAssetCoverage { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_asset_generate_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_asset_generate_input_type.rs index ba67939a..e7589076 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_asset_generate_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_asset_generate_input_type.rs @@ -2,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::big_fish_asset_kind_type::BigFishAssetKind; @@ -17,14 +12,12 @@ pub struct BigFishAssetGenerateInput { pub session_id: String, pub owner_user_id: String, pub asset_kind: BigFishAssetKind, - pub level: Option::, - pub motion_key: Option::, - pub asset_url: Option::, + pub level: Option, + pub motion_key: Option, + pub asset_url: Option, pub generated_at_micros: i64, } - impl __sdk::InModule for BigFishAssetGenerateInput { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_asset_kind_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_asset_kind_type.rs index a5d6c3ed..b4c9dcd1 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_asset_kind_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_asset_kind_type.rs @@ -2,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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,12 +13,8 @@ pub enum BigFishAssetKind { LevelMotion, StageBackground, - } - - impl __sdk::InModule for BigFishAssetKind { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_asset_slot_snapshot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_asset_slot_snapshot_type.rs index 911e51fc..200b1a6d 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_asset_slot_snapshot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_asset_slot_snapshot_type.rs @@ -2,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::big_fish_asset_kind_type::BigFishAssetKind; use super::big_fish_asset_status_type::BigFishAssetStatus; @@ -18,16 +13,14 @@ pub struct BigFishAssetSlotSnapshot { pub slot_id: String, pub session_id: String, pub asset_kind: BigFishAssetKind, - pub level: Option::, - pub motion_key: Option::, + pub level: Option, + pub motion_key: Option, pub status: BigFishAssetStatus, - pub asset_url: Option::, + pub asset_url: Option, pub prompt_snapshot: String, pub updated_at_micros: i64, } - impl __sdk::InModule for BigFishAssetSlotSnapshot { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_asset_slot_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_asset_slot_table.rs index 8b296390..d4817cf0 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_asset_slot_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_asset_slot_table.rs @@ -2,15 +2,10 @@ // WILL NOT BE 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::big_fish_asset_slot_type::BigFishAssetSlot; use super::big_fish_asset_kind_type::BigFishAssetKind; +use super::big_fish_asset_slot_type::BigFishAssetSlot; use super::big_fish_asset_status_type::BigFishAssetStatus; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; /// Table handle for the table `big_fish_asset_slot`. /// @@ -38,7 +33,9 @@ pub trait BigFishAssetSlotTableAccess { impl BigFishAssetSlotTableAccess for super::RemoteTables { fn big_fish_asset_slot(&self) -> BigFishAssetSlotTableHandle<'_> { BigFishAssetSlotTableHandle { - imp: self.imp.get_table::("big_fish_asset_slot"), + imp: self + .imp + .get_table::("big_fish_asset_slot"), ctx: std::marker::PhantomData, } } @@ -51,8 +48,12 @@ impl<'ctx> __sdk::Table for BigFishAssetSlotTableHandle<'ctx> { type Row = BigFishAssetSlot; 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 = BigFishAssetSlotInsertCallbackId; @@ -98,39 +99,38 @@ impl<'ctx> __sdk::TableWithPrimaryKey for BigFishAssetSlotTableHandle<'ctx> { } } - /// Access to the `slot_id` unique index on the table `big_fish_asset_slot`, - /// which allows point queries on the field of the same name - /// via the [`BigFishAssetSlotSlotIdUnique::find`] method. - /// - /// Users are encouraged not to explicitly reference this type, - /// but to directly chain method calls, - /// like `ctx.db.big_fish_asset_slot().slot_id().find(...)`. - pub struct BigFishAssetSlotSlotIdUnique<'ctx> { - imp: __sdk::UniqueConstraintHandle, - phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, - } +/// Access to the `slot_id` unique index on the table `big_fish_asset_slot`, +/// which allows point queries on the field of the same name +/// via the [`BigFishAssetSlotSlotIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.big_fish_asset_slot().slot_id().find(...)`. +pub struct BigFishAssetSlotSlotIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} - impl<'ctx> BigFishAssetSlotTableHandle<'ctx> { - /// Get a handle on the `slot_id` unique index on the table `big_fish_asset_slot`. - pub fn slot_id(&self) -> BigFishAssetSlotSlotIdUnique<'ctx> { - BigFishAssetSlotSlotIdUnique { - imp: self.imp.get_unique_constraint::("slot_id"), - phantom: std::marker::PhantomData, - } - } +impl<'ctx> BigFishAssetSlotTableHandle<'ctx> { + /// Get a handle on the `slot_id` unique index on the table `big_fish_asset_slot`. + pub fn slot_id(&self) -> BigFishAssetSlotSlotIdUnique<'ctx> { + BigFishAssetSlotSlotIdUnique { + imp: self.imp.get_unique_constraint::("slot_id"), + phantom: std::marker::PhantomData, } + } +} + +impl<'ctx> BigFishAssetSlotSlotIdUnique<'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> BigFishAssetSlotSlotIdUnique<'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::("big_fish_asset_slot"); _table.add_unique_constraint::("slot_id", |row| &row.slot_id); } @@ -140,26 +140,24 @@ 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 `BigFishAssetSlot`. - /// - /// Implemented for [`__sdk::QueryTableAccessor`]. - pub trait big_fish_asset_slotQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `BigFishAssetSlot`. - fn big_fish_asset_slot(&self) -> __sdk::__query_builder::Table; - } - - impl big_fish_asset_slotQueryTableAccess for __sdk::QueryTableAccessor { - fn big_fish_asset_slot(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("big_fish_asset_slot") - } - } +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `BigFishAssetSlot`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait big_fish_asset_slotQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `BigFishAssetSlot`. + fn big_fish_asset_slot(&self) -> __sdk::__query_builder::Table; +} +impl big_fish_asset_slotQueryTableAccess for __sdk::QueryTableAccessor { + fn big_fish_asset_slot(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("big_fish_asset_slot") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_asset_slot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_asset_slot_type.rs index a6cb0813..406c151d 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_asset_slot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_asset_slot_type.rs @@ -2,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::big_fish_asset_kind_type::BigFishAssetKind; use super::big_fish_asset_status_type::BigFishAssetStatus; @@ -18,20 +13,18 @@ pub struct BigFishAssetSlot { pub slot_id: String, pub session_id: String, pub asset_kind: BigFishAssetKind, - pub level: Option::, - pub motion_key: Option::, + pub level: Option, + pub motion_key: Option, pub status: BigFishAssetStatus, - pub asset_url: Option::, + pub asset_url: Option, pub prompt_snapshot: String, pub updated_at: __sdk::Timestamp, } - impl __sdk::InModule for BigFishAssetSlot { type Module = super::RemoteModule; } - /// Column accessor struct for the table `BigFishAssetSlot`. /// /// Provides typed access to columns for query building. @@ -39,10 +32,10 @@ pub struct BigFishAssetSlotCols { pub slot_id: __sdk::__query_builder::Col, pub session_id: __sdk::__query_builder::Col, pub asset_kind: __sdk::__query_builder::Col, - pub level: __sdk::__query_builder::Col>, - pub motion_key: __sdk::__query_builder::Col>, + pub level: __sdk::__query_builder::Col>, + pub motion_key: __sdk::__query_builder::Col>, pub status: __sdk::__query_builder::Col, - pub asset_url: __sdk::__query_builder::Col>, + pub asset_url: __sdk::__query_builder::Col>, pub prompt_snapshot: __sdk::__query_builder::Col, pub updated_at: __sdk::__query_builder::Col, } @@ -60,7 +53,6 @@ impl __sdk::__query_builder::HasCols for BigFishAssetSlot { asset_url: __sdk::__query_builder::Col::new(table_name, "asset_url"), prompt_snapshot: __sdk::__query_builder::Col::new(table_name, "prompt_snapshot"), updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"), - } } } @@ -79,10 +71,8 @@ impl __sdk::__query_builder::HasIxCols for BigFishAssetSlot { BigFishAssetSlotIxCols { session_id: __sdk::__query_builder::IxCol::new(table_name, "session_id"), slot_id: __sdk::__query_builder::IxCol::new(table_name, "slot_id"), - } } } impl __sdk::__query_builder::CanBeLookupTable for BigFishAssetSlot {} - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_asset_status_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_asset_status_type.rs index 25ed0f6a..c673f0f3 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_asset_status_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_asset_status_type.rs @@ -2,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -16,12 +11,8 @@ pub enum BigFishAssetStatus { Missing, Ready, - } - - impl __sdk::InModule for BigFishAssetStatus { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_background_blueprint_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_background_blueprint_type.rs index bda8e3be..b28e3196 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_background_blueprint_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_background_blueprint_type.rs @@ -2,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -23,8 +17,6 @@ pub struct BigFishBackgroundBlueprint { pub background_prompt_seed: String, } - impl __sdk::InModule for BigFishBackgroundBlueprint { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_creation_session_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_creation_session_table.rs index 3eff808d..d7b82298 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_creation_session_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_creation_session_table.rs @@ -2,14 +2,9 @@ // WILL NOT BE 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::big_fish_creation_session_type::BigFishCreationSession; use super::big_fish_creation_stage_type::BigFishCreationStage; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; /// Table handle for the table `big_fish_creation_session`. /// @@ -37,7 +32,9 @@ pub trait BigFishCreationSessionTableAccess { impl BigFishCreationSessionTableAccess for super::RemoteTables { fn big_fish_creation_session(&self) -> BigFishCreationSessionTableHandle<'_> { BigFishCreationSessionTableHandle { - imp: self.imp.get_table::("big_fish_creation_session"), + imp: self + .imp + .get_table::("big_fish_creation_session"), ctx: std::marker::PhantomData, } } @@ -50,8 +47,12 @@ impl<'ctx> __sdk::Table for BigFishCreationSessionTableHandle<'ctx> { type Row = BigFishCreationSession; 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 = BigFishCreationSessionInsertCallbackId; @@ -97,40 +98,40 @@ impl<'ctx> __sdk::TableWithPrimaryKey for BigFishCreationSessionTableHandle<'ctx } } - /// Access to the `session_id` unique index on the table `big_fish_creation_session`, - /// which allows point queries on the field of the same name - /// via the [`BigFishCreationSessionSessionIdUnique::find`] method. - /// - /// Users are encouraged not to explicitly reference this type, - /// but to directly chain method calls, - /// like `ctx.db.big_fish_creation_session().session_id().find(...)`. - pub struct BigFishCreationSessionSessionIdUnique<'ctx> { - imp: __sdk::UniqueConstraintHandle, - phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, - } +/// Access to the `session_id` unique index on the table `big_fish_creation_session`, +/// which allows point queries on the field of the same name +/// via the [`BigFishCreationSessionSessionIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.big_fish_creation_session().session_id().find(...)`. +pub struct BigFishCreationSessionSessionIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} - impl<'ctx> BigFishCreationSessionTableHandle<'ctx> { - /// Get a handle on the `session_id` unique index on the table `big_fish_creation_session`. - pub fn session_id(&self) -> BigFishCreationSessionSessionIdUnique<'ctx> { - BigFishCreationSessionSessionIdUnique { - imp: self.imp.get_unique_constraint::("session_id"), - phantom: std::marker::PhantomData, - } - } +impl<'ctx> BigFishCreationSessionTableHandle<'ctx> { + /// Get a handle on the `session_id` unique index on the table `big_fish_creation_session`. + pub fn session_id(&self) -> BigFishCreationSessionSessionIdUnique<'ctx> { + BigFishCreationSessionSessionIdUnique { + imp: self.imp.get_unique_constraint::("session_id"), + phantom: std::marker::PhantomData, } + } +} + +impl<'ctx> BigFishCreationSessionSessionIdUnique<'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> BigFishCreationSessionSessionIdUnique<'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::("big_fish_creation_session"); + let _table = + client_cache.get_or_make_table::("big_fish_creation_session"); _table.add_unique_constraint::("session_id", |row| &row.session_id); } @@ -139,26 +140,24 @@ 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 `BigFishCreationSession`. - /// - /// Implemented for [`__sdk::QueryTableAccessor`]. - pub trait big_fish_creation_sessionQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `BigFishCreationSession`. - fn big_fish_creation_session(&self) -> __sdk::__query_builder::Table; - } - - impl big_fish_creation_sessionQueryTableAccess for __sdk::QueryTableAccessor { - fn big_fish_creation_session(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("big_fish_creation_session") - } - } +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `BigFishCreationSession`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait big_fish_creation_sessionQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `BigFishCreationSession`. + fn big_fish_creation_session(&self) -> __sdk::__query_builder::Table; +} +impl big_fish_creation_sessionQueryTableAccess for __sdk::QueryTableAccessor { + fn big_fish_creation_session(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("big_fish_creation_session") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_creation_session_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_creation_session_type.rs index b45590fe..353343fd 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_creation_session_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_creation_session_type.rs @@ -2,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::big_fish_creation_stage_type::BigFishCreationStage; @@ -21,20 +16,18 @@ pub struct BigFishCreationSession { pub progress_percent: u32, pub stage: BigFishCreationStage, pub anchor_pack_json: String, - pub draft_json: Option::, + pub draft_json: Option, pub asset_coverage_json: String, - pub last_assistant_reply: Option::, + pub last_assistant_reply: Option, pub publish_ready: bool, pub created_at: __sdk::Timestamp, pub updated_at: __sdk::Timestamp, } - impl __sdk::InModule for BigFishCreationSession { type Module = super::RemoteModule; } - /// Column accessor struct for the table `BigFishCreationSession`. /// /// Provides typed access to columns for query building. @@ -46,9 +39,9 @@ pub struct BigFishCreationSessionCols { pub progress_percent: __sdk::__query_builder::Col, pub stage: __sdk::__query_builder::Col, pub anchor_pack_json: __sdk::__query_builder::Col, - pub draft_json: __sdk::__query_builder::Col>, + pub draft_json: __sdk::__query_builder::Col>, pub asset_coverage_json: __sdk::__query_builder::Col, - pub last_assistant_reply: __sdk::__query_builder::Col>, + pub last_assistant_reply: __sdk::__query_builder::Col>, pub publish_ready: __sdk::__query_builder::Col, pub created_at: __sdk::__query_builder::Col, pub updated_at: __sdk::__query_builder::Col, @@ -66,12 +59,17 @@ impl __sdk::__query_builder::HasCols for BigFishCreationSession { stage: __sdk::__query_builder::Col::new(table_name, "stage"), anchor_pack_json: __sdk::__query_builder::Col::new(table_name, "anchor_pack_json"), draft_json: __sdk::__query_builder::Col::new(table_name, "draft_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"), + 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", + ), publish_ready: __sdk::__query_builder::Col::new(table_name, "publish_ready"), created_at: __sdk::__query_builder::Col::new(table_name, "created_at"), updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"), - } } } @@ -90,10 +88,8 @@ impl __sdk::__query_builder::HasIxCols for BigFishCreationSession { BigFishCreationSessionIxCols { 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 BigFishCreationSession {} - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_creation_stage_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_creation_stage_type.rs index b96fb5e4..c878d467 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_creation_stage_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_creation_stage_type.rs @@ -2,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -22,12 +17,8 @@ pub enum BigFishCreationStage { ReadyToPublish, Published, - } - - impl __sdk::InModule for BigFishCreationStage { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_draft_compile_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_draft_compile_input_type.rs index 25792484..9cf25ddc 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_draft_compile_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_draft_compile_input_type.rs @@ -2,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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,8 +12,6 @@ pub struct BigFishDraftCompileInput { pub compiled_at_micros: i64, } - impl __sdk::InModule for BigFishDraftCompileInput { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_game_draft_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_game_draft_type.rs index 43810d9b..0c661176 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_game_draft_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_game_draft_type.rs @@ -2,15 +2,10 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::big_fish_level_blueprint_type::BigFishLevelBlueprint; use super::big_fish_background_blueprint_type::BigFishBackgroundBlueprint; +use super::big_fish_level_blueprint_type::BigFishLevelBlueprint; use super::big_fish_runtime_params_type::BigFishRuntimeParams; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] @@ -20,13 +15,11 @@ pub struct BigFishGameDraft { pub subtitle: String, pub core_fun: String, pub ecology_theme: String, - pub levels: Vec::, + pub levels: Vec, pub background: BigFishBackgroundBlueprint, pub runtime_params: BigFishRuntimeParams, } - impl __sdk::InModule for BigFishGameDraft { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_level_blueprint_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_level_blueprint_type.rs index 3953e1ff..b8ea2493 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_level_blueprint_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_level_blueprint_type.rs @@ -2,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -20,14 +14,12 @@ pub struct BigFishLevelBlueprint { pub size_ratio: f32, pub visual_prompt_seed: String, pub motion_prompt_seed: String, - pub merge_source_level: Option::, - pub prey_window: Vec::, - pub threat_window: Vec::, + pub merge_source_level: Option, + pub prey_window: Vec, + pub threat_window: Vec, pub is_final_level: bool, } - impl __sdk::InModule for BigFishLevelBlueprint { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_message_submit_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_message_submit_input_type.rs index 40dfe964..b0e41147 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_message_submit_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_message_submit_input_type.rs @@ -2,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -21,8 +15,6 @@ pub struct BigFishMessageSubmitInput { pub submitted_at_micros: i64, } - impl __sdk::InModule for BigFishMessageSubmitInput { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_publish_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_publish_input_type.rs index a1a0fcca..ec00bf84 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_publish_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_publish_input_type.rs @@ -2,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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,8 +12,6 @@ pub struct BigFishPublishInput { pub published_at_micros: i64, } - impl __sdk::InModule for BigFishPublishInput { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_run_get_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_run_get_input_type.rs index 0940b187..8e0d0d8d 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_run_get_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_run_get_input_type.rs @@ -2,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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 +11,6 @@ pub struct BigFishRunGetInput { pub owner_user_id: String, } - impl __sdk::InModule for BigFishRunGetInput { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_run_input_submit_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_run_input_submit_input_type.rs index ae5f1367..f3175d40 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_run_input_submit_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_run_input_submit_input_type.rs @@ -2,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -20,8 +14,6 @@ pub struct BigFishRunInputSubmitInput { pub submitted_at_micros: i64, } - impl __sdk::InModule for BigFishRunInputSubmitInput { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_run_procedure_result_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_run_procedure_result_type.rs index 12e6eb95..86d73fc2 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_run_procedure_result_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_run_procedure_result_type.rs @@ -2,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::big_fish_runtime_snapshot_type::BigFishRuntimeSnapshot; @@ -15,12 +10,10 @@ use super::big_fish_runtime_snapshot_type::BigFishRuntimeSnapshot; #[sats(crate = __lib)] pub struct BigFishRunProcedureResult { pub ok: bool, - pub run: Option::, - pub error_message: Option::, + pub run: Option, + pub error_message: Option, } - impl __sdk::InModule for BigFishRunProcedureResult { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_run_start_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_run_start_input_type.rs index 4e166892..944fa6da 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_run_start_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_run_start_input_type.rs @@ -2,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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 +13,6 @@ pub struct BigFishRunStartInput { pub started_at_micros: i64, } - impl __sdk::InModule for BigFishRunStartInput { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_run_status_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_run_status_type.rs index ab1b80cd..6bb94f36 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_run_status_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_run_status_type.rs @@ -2,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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,12 +13,8 @@ pub enum BigFishRunStatus { Won, Failed, - } - - impl __sdk::InModule for BigFishRunStatus { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_runtime_entity_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_runtime_entity_type.rs index f1a82061..ee7c160c 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_runtime_entity_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_runtime_entity_type.rs @@ -2,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::big_fish_vector_2_type::BigFishVector2; @@ -21,8 +16,6 @@ pub struct BigFishRuntimeEntity { pub offscreen_seconds: f32, } - impl __sdk::InModule for BigFishRuntimeEntity { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_runtime_params_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_runtime_params_type.rs index 1fece110..78117371 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_runtime_params_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_runtime_params_type.rs @@ -2,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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,13 +13,11 @@ pub struct BigFishRuntimeParams { pub leader_move_speed: f32, pub follower_catch_up_speed: f32, pub offscreen_cull_seconds: f32, - pub prey_spawn_delta_levels: Vec::, - pub threat_spawn_delta_levels: Vec::, + pub prey_spawn_delta_levels: Vec, + pub threat_spawn_delta_levels: Vec, pub win_level: u32, } - impl __sdk::InModule for BigFishRuntimeParams { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_runtime_run_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_runtime_run_table.rs index 9ed2da19..bbf7ef94 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_runtime_run_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_runtime_run_table.rs @@ -2,14 +2,9 @@ // WILL NOT BE 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::big_fish_runtime_run_type::BigFishRuntimeRun; use super::big_fish_run_status_type::BigFishRunStatus; +use super::big_fish_runtime_run_type::BigFishRuntimeRun; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; /// Table handle for the table `big_fish_runtime_run`. /// @@ -37,7 +32,9 @@ pub trait BigFishRuntimeRunTableAccess { impl BigFishRuntimeRunTableAccess for super::RemoteTables { fn big_fish_runtime_run(&self) -> BigFishRuntimeRunTableHandle<'_> { BigFishRuntimeRunTableHandle { - imp: self.imp.get_table::("big_fish_runtime_run"), + imp: self + .imp + .get_table::("big_fish_runtime_run"), ctx: std::marker::PhantomData, } } @@ -50,8 +47,12 @@ impl<'ctx> __sdk::Table for BigFishRuntimeRunTableHandle<'ctx> { type Row = BigFishRuntimeRun; 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 = BigFishRuntimeRunInsertCallbackId; @@ -97,39 +98,38 @@ impl<'ctx> __sdk::TableWithPrimaryKey for BigFishRuntimeRunTableHandle<'ctx> { } } - /// Access to the `run_id` unique index on the table `big_fish_runtime_run`, - /// which allows point queries on the field of the same name - /// via the [`BigFishRuntimeRunRunIdUnique::find`] method. - /// - /// Users are encouraged not to explicitly reference this type, - /// but to directly chain method calls, - /// like `ctx.db.big_fish_runtime_run().run_id().find(...)`. - pub struct BigFishRuntimeRunRunIdUnique<'ctx> { - imp: __sdk::UniqueConstraintHandle, - phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, - } +/// Access to the `run_id` unique index on the table `big_fish_runtime_run`, +/// which allows point queries on the field of the same name +/// via the [`BigFishRuntimeRunRunIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.big_fish_runtime_run().run_id().find(...)`. +pub struct BigFishRuntimeRunRunIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} - impl<'ctx> BigFishRuntimeRunTableHandle<'ctx> { - /// Get a handle on the `run_id` unique index on the table `big_fish_runtime_run`. - pub fn run_id(&self) -> BigFishRuntimeRunRunIdUnique<'ctx> { - BigFishRuntimeRunRunIdUnique { - imp: self.imp.get_unique_constraint::("run_id"), - phantom: std::marker::PhantomData, - } - } +impl<'ctx> BigFishRuntimeRunTableHandle<'ctx> { + /// Get a handle on the `run_id` unique index on the table `big_fish_runtime_run`. + pub fn run_id(&self) -> BigFishRuntimeRunRunIdUnique<'ctx> { + BigFishRuntimeRunRunIdUnique { + imp: self.imp.get_unique_constraint::("run_id"), + phantom: std::marker::PhantomData, } + } +} + +impl<'ctx> BigFishRuntimeRunRunIdUnique<'ctx> { + /// Find the subscribed row whose `run_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> BigFishRuntimeRunRunIdUnique<'ctx> { - /// Find the subscribed row whose `run_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::("big_fish_runtime_run"); _table.add_unique_constraint::("run_id", |row| &row.run_id); } @@ -139,26 +139,24 @@ 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 `BigFishRuntimeRun`. - /// - /// Implemented for [`__sdk::QueryTableAccessor`]. - pub trait big_fish_runtime_runQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `BigFishRuntimeRun`. - fn big_fish_runtime_run(&self) -> __sdk::__query_builder::Table; - } - - impl big_fish_runtime_runQueryTableAccess for __sdk::QueryTableAccessor { - fn big_fish_runtime_run(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("big_fish_runtime_run") - } - } +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `BigFishRuntimeRun`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait big_fish_runtime_runQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `BigFishRuntimeRun`. + fn big_fish_runtime_run(&self) -> __sdk::__query_builder::Table; +} +impl big_fish_runtime_runQueryTableAccess for __sdk::QueryTableAccessor { + fn big_fish_runtime_run(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("big_fish_runtime_run") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_runtime_run_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_runtime_run_type.rs index 20ac1aa1..01852b9c 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_runtime_run_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_runtime_run_type.rs @@ -2,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::big_fish_run_status_type::BigFishRunStatus; @@ -26,12 +21,10 @@ pub struct BigFishRuntimeRun { pub updated_at: __sdk::Timestamp, } - impl __sdk::InModule for BigFishRuntimeRun { type Module = super::RemoteModule; } - /// Column accessor struct for the table `BigFishRuntimeRun`. /// /// Provides typed access to columns for query building. @@ -62,7 +55,6 @@ impl __sdk::__query_builder::HasCols for BigFishRuntimeRun { tick: __sdk::__query_builder::Col::new(table_name, "tick"), created_at: __sdk::__query_builder::Col::new(table_name, "created_at"), updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"), - } } } @@ -83,10 +75,8 @@ impl __sdk::__query_builder::HasIxCols for BigFishRuntimeRun { owner_user_id: __sdk::__query_builder::IxCol::new(table_name, "owner_user_id"), run_id: __sdk::__query_builder::IxCol::new(table_name, "run_id"), session_id: __sdk::__query_builder::IxCol::new(table_name, "session_id"), - } } } impl __sdk::__query_builder::CanBeLookupTable for BigFishRuntimeRun {} - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_runtime_snapshot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_runtime_snapshot_type.rs index 0a367449..32f2a80c 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_runtime_snapshot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_runtime_snapshot_type.rs @@ -2,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::big_fish_run_status_type::BigFishRunStatus; use super::big_fish_runtime_entity_type::BigFishRuntimeEntity; @@ -22,17 +17,15 @@ pub struct BigFishRuntimeSnapshot { pub tick: u64, pub player_level: u32, pub win_level: u32, - pub leader_entity_id: Option::, - pub owned_entities: Vec::, - pub wild_entities: Vec::, + pub leader_entity_id: Option, + pub owned_entities: Vec, + pub wild_entities: Vec, pub camera_center: BigFishVector2, pub last_input: BigFishVector2, - pub event_log: Vec::, + pub event_log: Vec, pub updated_at_micros: i64, } - impl __sdk::InModule for BigFishRuntimeSnapshot { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_session_create_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_session_create_input_type.rs index f7ae7eb7..13533785 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_session_create_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_session_create_input_type.rs @@ -2,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -21,8 +15,6 @@ pub struct BigFishSessionCreateInput { pub created_at_micros: i64, } - impl __sdk::InModule for BigFishSessionCreateInput { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_session_get_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_session_get_input_type.rs index 88ef9cfa..396808f4 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_session_get_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_session_get_input_type.rs @@ -2,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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 +11,6 @@ pub struct BigFishSessionGetInput { pub owner_user_id: String, } - impl __sdk::InModule for BigFishSessionGetInput { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_session_procedure_result_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_session_procedure_result_type.rs index db8af7c7..1f2f7666 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_session_procedure_result_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_session_procedure_result_type.rs @@ -2,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::big_fish_session_snapshot_type::BigFishSessionSnapshot; @@ -15,12 +10,10 @@ use super::big_fish_session_snapshot_type::BigFishSessionSnapshot; #[sats(crate = __lib)] pub struct BigFishSessionProcedureResult { pub ok: bool, - pub session: Option::, - pub error_message: Option::, + pub session: Option, + pub error_message: Option, } - impl __sdk::InModule for BigFishSessionProcedureResult { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_session_snapshot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_session_snapshot_type.rs index abff56b6..11e6a141 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_session_snapshot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_session_snapshot_type.rs @@ -2,19 +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 spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; -use super::big_fish_creation_stage_type::BigFishCreationStage; -use super::big_fish_anchor_pack_type::BigFishAnchorPack; -use super::big_fish_game_draft_type::BigFishGameDraft; -use super::big_fish_asset_slot_snapshot_type::BigFishAssetSlotSnapshot; -use super::big_fish_asset_coverage_type::BigFishAssetCoverage; use super::big_fish_agent_message_snapshot_type::BigFishAgentMessageSnapshot; +use super::big_fish_anchor_pack_type::BigFishAnchorPack; +use super::big_fish_asset_coverage_type::BigFishAssetCoverage; +use super::big_fish_asset_slot_snapshot_type::BigFishAssetSlotSnapshot; +use super::big_fish_creation_stage_type::BigFishCreationStage; +use super::big_fish_game_draft_type::BigFishGameDraft; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] @@ -26,18 +21,16 @@ pub struct BigFishSessionSnapshot { pub progress_percent: u32, pub stage: BigFishCreationStage, pub anchor_pack: BigFishAnchorPack, - pub draft: Option::, - pub asset_slots: Vec::, + pub draft: Option, + pub asset_slots: Vec, pub asset_coverage: BigFishAssetCoverage, - pub messages: Vec::, - pub last_assistant_reply: Option::, + pub messages: Vec, + pub last_assistant_reply: Option, pub publish_ready: bool, pub created_at_micros: i64, pub updated_at_micros: i64, } - impl __sdk::InModule for BigFishSessionSnapshot { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_vector_2_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_vector_2_type.rs index 534f83e9..745063ad 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_vector_2_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_vector_2_type.rs @@ -2,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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 +11,6 @@ pub struct BigFishVector2 { pub y: f32, } - impl __sdk::InModule for BigFishVector2 { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_works_list_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_works_list_input_type.rs index 72220ff9..240ce46a 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_works_list_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_works_list_input_type.rs @@ -2,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -16,8 +10,6 @@ pub struct BigFishWorksListInput { pub owner_user_id: String, } - impl __sdk::InModule for BigFishWorksListInput { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_works_procedure_result_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_works_procedure_result_type.rs index a8fbe37b..37d7c7b6 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_works_procedure_result_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_works_procedure_result_type.rs @@ -2,24 +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}; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] pub struct BigFishWorksProcedureResult { pub ok: bool, - pub items_json: Option::, - pub error_message: Option::, + pub items_json: Option, + pub error_message: Option, } - impl __sdk::InModule for BigFishWorksProcedureResult { type Module = super::RemoteModule; } - 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 aebf2217..78c80aee 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,23 +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::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; } @@ -28,16 +22,19 @@ 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, ); } @@ -46,13 +43,17 @@ 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 ca2154f7..caf48b26 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -19,10 +14,8 @@ 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 { @@ -40,9 +33,8 @@ 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, @@ -55,9 +47,11 @@ pub trait bind_asset_object_to_entity { &self, input: AssetEntityBindingInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + Send + + 'static, ) -> __sdk::Result<()>; } @@ -66,11 +60,13 @@ impl bind_asset_object_to_entity for super::RemoteReducers { &self, input: AssetEntityBindingInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + 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 1a4a6394..0c5dc3eb 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,23 +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_task_procedure_result_type::AiTaskProcedureResult; use super::ai_task_cancel_input_type::AiTaskCancelInput; +use super::ai_task_procedure_result_type::AiTaskProcedureResult; #[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; } @@ -28,16 +22,19 @@ 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, ); } @@ -46,13 +43,17 @@ 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 fe7d5e3a..effbeb9d 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -20,12 +15,8 @@ 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 cc88d00b..927a4b04 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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 +11,6 @@ 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 ed9aa5ca..dae51fa0 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -31,8 +26,6 @@ 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 a9e0a8c3..a599ffc9 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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,12 +12,10 @@ 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 6a7d01af..276b3a26 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -15,12 +10,10 @@ 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 d1eaad92..e1fde7fe 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -30,14 +25,12 @@ 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 5bd5c38c..2fb6c042 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,14 +2,9 @@ // WILL NOT BE 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::chapter_progression_type::ChapterProgression; use super::chapter_pace_band_type::ChapterPaceBand; +use super::chapter_progression_type::ChapterProgression; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; /// Table handle for the table `chapter_progression`. /// @@ -37,7 +32,9 @@ 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, } } @@ -50,8 +47,12 @@ 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; @@ -97,41 +98,44 @@ 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>, - } +/// 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, - } - } +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) + } +} - 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)] @@ -139,26 +143,24 @@ 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; - } - - impl chapter_progressionQueryTableAccess for __sdk::QueryTableAccessor { - fn chapter_progression(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("chapter_progression") - } - } +#[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") + } +} 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 c5600eb7..c94a7196 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -31,18 +26,16 @@ 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. @@ -64,7 +57,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, @@ -74,13 +67,22 @@ 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"), @@ -88,14 +90,19 @@ 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"), - } } } @@ -114,12 +121,13 @@ 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 5b9a2c9e..c8ba8d49 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,23 +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::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; } @@ -28,16 +22,19 @@ 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, ); } @@ -46,13 +43,17 @@ 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 5ef77940..731563dd 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -20,12 +15,8 @@ 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_big_fish_draft_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/compile_big_fish_draft_procedure.rs index ba45db0a..bafe95a6 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/compile_big_fish_draft_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/compile_big_fish_draft_procedure.rs @@ -2,23 +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::big_fish_draft_compile_input_type::BigFishDraftCompileInput; use super::big_fish_session_procedure_result_type::BigFishSessionProcedureResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] - struct CompileBigFishDraftArgs { +struct CompileBigFishDraftArgs { pub input: BigFishDraftCompileInput, } - impl __sdk::InModule for CompileBigFishDraftArgs { type Module = super::RemoteModule; } @@ -28,16 +22,19 @@ impl __sdk::InModule for CompileBigFishDraftArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait compile_big_fish_draft { - fn compile_big_fish_draft(&self, input: BigFishDraftCompileInput, -) { - self.compile_big_fish_draft_then(input, |_, _| {}); + fn compile_big_fish_draft(&self, input: BigFishDraftCompileInput) { + self.compile_big_fish_draft_then(input, |_, _| {}); } fn compile_big_fish_draft_then( &self, input: BigFishDraftCompileInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -46,13 +43,17 @@ impl compile_big_fish_draft for super::RemoteProcedures { &self, input: BigFishDraftCompileInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { - self.imp.invoke_procedure_with_callback::<_, BigFishSessionProcedureResult>( - "compile_big_fish_draft", - CompileBigFishDraftArgs { input, }, - __callback, - ); + self.imp + .invoke_procedure_with_callback::<_, BigFishSessionProcedureResult>( + "compile_big_fish_draft", + CompileBigFishDraftArgs { input }, + __callback, + ); } } - 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 767a3954..67706fab 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,23 +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_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; } @@ -28,16 +22,22 @@ 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,13 +46,17 @@ 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/compile_puzzle_agent_draft_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/compile_puzzle_agent_draft_procedure.rs index d90769dc..177c0c40 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/compile_puzzle_agent_draft_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/compile_puzzle_agent_draft_procedure.rs @@ -2,23 +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::puzzle_draft_compile_input_type::PuzzleDraftCompileInput; use super::puzzle_agent_session_procedure_result_type::PuzzleAgentSessionProcedureResult; +use super::puzzle_draft_compile_input_type::PuzzleDraftCompileInput; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] - struct CompilePuzzleAgentDraftArgs { +struct CompilePuzzleAgentDraftArgs { pub input: PuzzleDraftCompileInput, } - impl __sdk::InModule for CompilePuzzleAgentDraftArgs { type Module = super::RemoteModule; } @@ -28,16 +22,19 @@ impl __sdk::InModule for CompilePuzzleAgentDraftArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait compile_puzzle_agent_draft { - fn compile_puzzle_agent_draft(&self, input: PuzzleDraftCompileInput, -) { - self.compile_puzzle_agent_draft_then(input, |_, _| {}); + fn compile_puzzle_agent_draft(&self, input: PuzzleDraftCompileInput) { + self.compile_puzzle_agent_draft_then(input, |_, _| {}); } fn compile_puzzle_agent_draft_then( &self, input: PuzzleDraftCompileInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -46,13 +43,17 @@ impl compile_puzzle_agent_draft for super::RemoteProcedures { &self, input: PuzzleDraftCompileInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { - self.imp.invoke_procedure_with_callback::<_, PuzzleAgentSessionProcedureResult>( - "compile_puzzle_agent_draft", - CompilePuzzleAgentDraftArgs { input, }, - __callback, - ); + self.imp + .invoke_procedure_with_callback::<_, PuzzleAgentSessionProcedureResult>( + "compile_puzzle_agent_draft", + CompilePuzzleAgentDraftArgs { 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 f921c224..e59ab8f0 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,23 +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_task_procedure_result_type::AiTaskProcedureResult; use super::ai_stage_completion_input_type::AiStageCompletionInput; +use super::ai_task_procedure_result_type::AiTaskProcedureResult; #[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; } @@ -28,16 +22,19 @@ 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, ); } @@ -46,13 +43,17 @@ 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 47ae2af1..ca7eab9f 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,23 +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_task_procedure_result_type::AiTaskProcedureResult; use super::ai_task_finish_input_type::AiTaskFinishInput; +use super::ai_task_procedure_result_type::AiTaskProcedureResult; #[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; } @@ -28,16 +22,19 @@ 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, ); } @@ -46,13 +43,17 @@ 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 11c079e4..cc65f744 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,23 +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::asset_object_upsert_input_type::AssetObjectUpsertInput; use super::asset_object_procedure_result_type::AssetObjectProcedureResult; +use super::asset_object_upsert_input_type::AssetObjectUpsertInput; #[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; } @@ -28,16 +22,19 @@ 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, ); } @@ -46,13 +43,17 @@ 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 fb6acde2..f5edb63a 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -19,10 +14,8 @@ 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 { @@ -40,9 +33,8 @@ 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, @@ -55,9 +47,11 @@ pub trait confirm_asset_object { &self, input: AssetObjectUpsertInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + Send + + 'static, ) -> __sdk::Result<()>; } @@ -66,11 +60,13 @@ impl confirm_asset_object for super::RemoteReducers { &self, input: AssetObjectUpsertInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + 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 3bd69ba8..0e867e21 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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 +11,6 @@ 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 0713f423..1c2b51d8 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,23 +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::story_session_procedure_result_type::StorySessionProcedureResult; use super::story_continue_input_type::StoryContinueInput; +use super::story_session_procedure_result_type::StorySessionProcedureResult; #[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; } @@ -28,16 +22,19 @@ 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, ); } @@ -46,13 +43,17 @@ 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 9c2b310a..fb35bd1f 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -19,10 +14,8 @@ 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 { @@ -40,9 +33,8 @@ 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, @@ -55,9 +47,11 @@ pub trait continue_story { &self, input: StoryContinueInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + Send + + 'static, ) -> __sdk::Result<()>; } @@ -66,11 +60,13 @@ impl continue_story for super::RemoteReducers { &self, input: StoryContinueInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + 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 cee9ffd8..a2f40fd0 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,23 +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_task_procedure_result_type::AiTaskProcedureResult; use super::ai_task_create_input_type::AiTaskCreateInput; +use super::ai_task_procedure_result_type::AiTaskProcedureResult; #[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; } @@ -28,16 +22,19 @@ 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, ); } @@ -46,13 +43,17 @@ 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 d57e7291..b87207f0 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -19,10 +14,8 @@ 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 { @@ -40,9 +33,8 @@ 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, @@ -55,9 +47,11 @@ pub trait create_ai_task { &self, input: AiTaskCreateInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + Send + + 'static, ) -> __sdk::Result<()>; } @@ -66,11 +60,13 @@ impl create_ai_task for super::RemoteReducers { &self, input: AiTaskCreateInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + 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 bfee133e..c028ba4e 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,23 +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_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; } @@ -28,16 +22,19 @@ 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, ); } @@ -46,13 +43,17 @@ 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 258d5af2..7f34eab2 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -19,10 +14,8 @@ 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 { @@ -40,9 +33,8 @@ 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, @@ -55,9 +47,11 @@ pub trait create_battle_state { &self, input: BattleStateInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + Send + + 'static, ) -> __sdk::Result<()>; } @@ -66,11 +60,13 @@ impl create_battle_state for super::RemoteReducers { &self, input: BattleStateInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + 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_big_fish_session_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/create_big_fish_session_procedure.rs index cf4398e6..6e48521a 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/create_big_fish_session_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/create_big_fish_session_procedure.rs @@ -2,23 +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::big_fish_session_procedure_result_type::BigFishSessionProcedureResult; use super::big_fish_session_create_input_type::BigFishSessionCreateInput; +use super::big_fish_session_procedure_result_type::BigFishSessionProcedureResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] - struct CreateBigFishSessionArgs { +struct CreateBigFishSessionArgs { pub input: BigFishSessionCreateInput, } - impl __sdk::InModule for CreateBigFishSessionArgs { type Module = super::RemoteModule; } @@ -28,16 +22,19 @@ impl __sdk::InModule for CreateBigFishSessionArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait create_big_fish_session { - fn create_big_fish_session(&self, input: BigFishSessionCreateInput, -) { - self.create_big_fish_session_then(input, |_, _| {}); + fn create_big_fish_session(&self, input: BigFishSessionCreateInput) { + self.create_big_fish_session_then(input, |_, _| {}); } fn create_big_fish_session_then( &self, input: BigFishSessionCreateInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -46,13 +43,17 @@ impl create_big_fish_session for super::RemoteProcedures { &self, input: BigFishSessionCreateInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { - self.imp.invoke_procedure_with_callback::<_, BigFishSessionProcedureResult>( - "create_big_fish_session", - CreateBigFishSessionArgs { input, }, - __callback, - ); + self.imp + .invoke_procedure_with_callback::<_, BigFishSessionProcedureResult>( + "create_big_fish_session", + CreateBigFishSessionArgs { 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 18065e71..96a21162 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,23 +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_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; } @@ -28,16 +22,19 @@ 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, ); } @@ -46,13 +43,17 @@ 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/create_puzzle_agent_session_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/create_puzzle_agent_session_procedure.rs index d5c79fa4..62b77081 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/create_puzzle_agent_session_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/create_puzzle_agent_session_procedure.rs @@ -2,23 +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::puzzle_agent_session_procedure_result_type::PuzzleAgentSessionProcedureResult; use super::puzzle_agent_session_create_input_type::PuzzleAgentSessionCreateInput; +use super::puzzle_agent_session_procedure_result_type::PuzzleAgentSessionProcedureResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] - struct CreatePuzzleAgentSessionArgs { +struct CreatePuzzleAgentSessionArgs { pub input: PuzzleAgentSessionCreateInput, } - impl __sdk::InModule for CreatePuzzleAgentSessionArgs { type Module = super::RemoteModule; } @@ -28,16 +22,19 @@ impl __sdk::InModule for CreatePuzzleAgentSessionArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait create_puzzle_agent_session { - fn create_puzzle_agent_session(&self, input: PuzzleAgentSessionCreateInput, -) { - self.create_puzzle_agent_session_then(input, |_, _| {}); + fn create_puzzle_agent_session(&self, input: PuzzleAgentSessionCreateInput) { + self.create_puzzle_agent_session_then(input, |_, _| {}); } fn create_puzzle_agent_session_then( &self, input: PuzzleAgentSessionCreateInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -46,13 +43,17 @@ impl create_puzzle_agent_session for super::RemoteProcedures { &self, input: PuzzleAgentSessionCreateInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { - self.imp.invoke_procedure_with_callback::<_, PuzzleAgentSessionProcedureResult>( - "create_puzzle_agent_session", - CreatePuzzleAgentSessionArgs { input, }, - __callback, - ); + self.imp + .invoke_procedure_with_callback::<_, PuzzleAgentSessionProcedureResult>( + "create_puzzle_agent_session", + CreatePuzzleAgentSessionArgs { input }, + __callback, + ); } } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_action_execute_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_action_execute_input_type.rs index 3281a80a..9663e12d 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_action_execute_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_action_execute_input_type.rs @@ -2,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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,12 +11,10 @@ pub struct CustomWorldAgentActionExecuteInput { pub owner_user_id: String, pub operation_id: String, pub action: String, - pub payload_json: Option::, + pub payload_json: Option, pub submitted_at_micros: i64, } - impl __sdk::InModule for CustomWorldAgentActionExecuteInput { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_action_execute_result_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_action_execute_result_type.rs index 6729b4db..39aeb7e0 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_action_execute_result_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_action_execute_result_type.rs @@ -2,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -15,12 +10,10 @@ use super::custom_world_agent_operation_snapshot_type::CustomWorldAgentOperation #[sats(crate = __lib)] pub struct CustomWorldAgentActionExecuteResult { pub ok: bool, - pub operation: Option::, - pub error_message: Option::, + pub operation: Option, + pub error_message: Option, } - impl __sdk::InModule for CustomWorldAgentActionExecuteResult { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_card_detail_get_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_card_detail_get_input_type.rs index c6cdeb3b..2b8cde47 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_card_detail_get_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_card_detail_get_input_type.rs @@ -2,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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,8 +12,6 @@ pub struct CustomWorldAgentCardDetailGetInput { pub card_id: String, } - impl __sdk::InModule for CustomWorldAgentCardDetailGetInput { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_message_finalize_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_message_finalize_input_type.rs index d0153b44..25184d85 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_message_finalize_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_message_finalize_input_type.rs @@ -2,15 +2,10 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; use super::rpg_agent_operation_status_type::RpgAgentOperationStatus; +use super::rpg_agent_stage_type::RpgAgentStage; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] @@ -18,31 +13,29 @@ pub struct CustomWorldAgentMessageFinalizeInput { pub session_id: String, pub owner_user_id: String, pub operation_id: String, - pub assistant_message_id: Option::, - pub assistant_reply_text: Option::, + pub assistant_message_id: Option, + pub assistant_reply_text: Option, pub phase_label: String, pub phase_detail: String, pub operation_status: RpgAgentOperationStatus, pub operation_progress: u32, pub stage: RpgAgentStage, pub progress_percent: u32, - 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 draft_profile_json: Option::, + pub anchor_pack_json: Option, + pub draft_profile_json: Option, pub pending_clarifications_json: String, pub suggested_actions_json: String, pub recommended_replies_json: String, pub quality_findings_json: String, pub asset_coverage_json: String, - pub error_message: Option::, + pub error_message: Option, pub updated_at_micros: i64, } - impl __sdk::InModule for CustomWorldAgentMessageFinalizeInput { type Module = super::RemoteModule; } - 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 e57b9839..69368214 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,15 +2,10 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_role_type::RpgAgentMessageRole; use super::rpg_agent_message_kind_type::RpgAgentMessageKind; +use super::rpg_agent_message_role_type::RpgAgentMessageRole; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] @@ -20,12 +15,10 @@ 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 bc2da116..cf3a4230 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -21,8 +15,6 @@ 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 12cae6f1..1d0886e7 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,15 +2,10 @@ // WILL NOT BE 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_role_type::RpgAgentMessageRole; 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}; /// Table handle for the table `custom_world_agent_message`. /// @@ -38,7 +33,9 @@ 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, } } @@ -51,8 +48,12 @@ 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; @@ -98,40 +99,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>, - } +/// 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, - } - } +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) + } +} - 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); } @@ -140,26 +141,24 @@ 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; - } - - 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") - } - } +#[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") + } +} 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 e33b5c4a..75110860 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,15 +2,10 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_role_type::RpgAgentMessageRole; use super::rpg_agent_message_kind_type::RpgAgentMessageKind; +use super::rpg_agent_message_role_type::RpgAgentMessageRole; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] @@ -20,16 +15,14 @@ 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. @@ -39,7 +32,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, } @@ -52,9 +45,11 @@ 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"), - } } } @@ -73,10 +68,8 @@ 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 2aa3b05b..1e249edf 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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,8 +12,6 @@ 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 f9bf13da..39d0e493 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -15,12 +10,10 @@ 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 954a809c..61e86eb3 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,15 +2,10 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_type_type::RpgAgentOperationType; use super::rpg_agent_operation_status_type::RpgAgentOperationStatus; +use super::rpg_agent_operation_type_type::RpgAgentOperationType; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] @@ -22,13 +17,11 @@ 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 7e6b6b11..316a95b1 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,15 +2,10 @@ // WILL NOT BE 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_type_type::RpgAgentOperationType; 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}; /// Table handle for the table `custom_world_agent_operation`. /// @@ -38,7 +33,9 @@ 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, } } @@ -51,8 +48,12 @@ 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; @@ -98,40 +99,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>, - } +/// 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, - } - } +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) + } +} - 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); } @@ -140,26 +141,28 @@ 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; - } - - 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") - } - } +#[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") + } +} 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 b195855d..41957317 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,15 +2,10 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_type_type::RpgAgentOperationType; use super::rpg_agent_operation_status_type::RpgAgentOperationStatus; +use super::rpg_agent_operation_type_type::RpgAgentOperationType; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] @@ -22,29 +17,28 @@ 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, } @@ -63,7 +57,6 @@ 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"), - } } } @@ -82,10 +75,8 @@ 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 7a36c77b..d2ea6be9 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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,11 +13,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, @@ -33,8 +27,6 @@ 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 0e4f3319..733eaecb 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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 +11,6 @@ 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 4da0e11a..1ca24f19 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -15,12 +10,10 @@ 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 e263df53..6a50455e 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,17 +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; 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; +use super::custom_world_draft_card_snapshot_type::CustomWorldDraftCardSnapshot; +use super::rpg_agent_stage_type::RpgAgentStage; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] @@ -23,16 +18,16 @@ 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 publish_gate_json: 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 publish_gate_json: Option, + pub result_preview_json: Option, pub pending_clarifications_json: String, pub quality_findings_json: String, pub suggested_actions_json: String, @@ -40,15 +35,13 @@ pub struct CustomWorldAgentSessionSnapshot { pub asset_coverage_json: String, pub checkpoints_json: String, pub supported_actions_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 8b907a69..d63d156c 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,14 +2,9 @@ // WILL NOT BE 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`. /// @@ -37,7 +32,9 @@ 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, } } @@ -50,8 +47,12 @@ 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; @@ -97,40 +98,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>, - } +/// 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, - } - } +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) + } +} - 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); } @@ -139,26 +140,24 @@ 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; - } - - 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") - } - } +#[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") + } +} 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 128d93e3..105bc924 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -20,16 +15,16 @@ 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 publish_gate_json: 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 publish_gate_json: Option, + pub result_preview_json: Option, pub pending_clarifications_json: String, pub quality_findings_json: String, pub suggested_actions_json: String, @@ -40,12 +35,10 @@ 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. @@ -56,16 +49,16 @@ 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 publish_gate_json: __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 publish_gate_json: __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, @@ -87,24 +80,53 @@ 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"), + last_assistant_reply: __sdk::__query_builder::Col::new( + table_name, + "last_assistant_reply", + ), publish_gate_json: __sdk::__query_builder::Col::new(table_name, "publish_gate_json"), - 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"), + 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"), - } } } @@ -125,10 +147,8 @@ 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_detail_result_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_draft_card_detail_result_type.rs index 384a2c8c..ee8f9ba4 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_draft_card_detail_result_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_draft_card_detail_result_type.rs @@ -2,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_draft_card_detail_snapshot_type::CustomWorldDraftCardDetailSnapshot; @@ -15,12 +10,10 @@ use super::custom_world_draft_card_detail_snapshot_type::CustomWorldDraftCardDet #[sats(crate = __lib)] pub struct CustomWorldDraftCardDetailResult { pub ok: bool, - pub card: Option::, - pub error_message: Option::, + pub card: Option, + pub error_message: Option, } - impl __sdk::InModule for CustomWorldDraftCardDetailResult { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_draft_card_detail_section_snapshot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_draft_card_detail_section_snapshot_type.rs index 2e256890..b7f30c00 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_draft_card_detail_section_snapshot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_draft_card_detail_section_snapshot_type.rs @@ -2,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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,8 +12,6 @@ pub struct CustomWorldDraftCardDetailSectionSnapshot { pub value: String, } - impl __sdk::InModule for CustomWorldDraftCardDetailSectionSnapshot { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_draft_card_detail_snapshot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_draft_card_detail_snapshot_type.rs index 6bb20096..fab895fe 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_draft_card_detail_snapshot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_draft_card_detail_snapshot_type.rs @@ -2,16 +2,11 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_draft_card_kind_type::RpgAgentDraftCardKind; -use super::custom_world_role_asset_status_type::CustomWorldRoleAssetStatus; use super::custom_world_draft_card_detail_section_snapshot_type::CustomWorldDraftCardDetailSectionSnapshot; +use super::custom_world_role_asset_status_type::CustomWorldRoleAssetStatus; +use super::rpg_agent_draft_card_kind_type::RpgAgentDraftCardKind; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] @@ -19,18 +14,16 @@ pub struct CustomWorldDraftCardDetailSnapshot { pub card_id: String, pub kind: RpgAgentDraftCardKind, pub title: String, - pub sections: Vec::, + pub sections: Vec, pub linked_ids_json: String, pub locked: bool, pub editable: bool, pub editable_section_ids_json: String, pub warning_messages_json: String, - pub asset_status: Option::, - pub asset_status_label: Option::, + pub asset_status: Option, + pub asset_status_label: Option, } - impl __sdk::InModule for CustomWorldDraftCardDetailSnapshot { type Module = super::RemoteModule; } - 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 c9497003..84108f6e 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,16 +2,11 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -25,15 +20,13 @@ 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 9d197db6..6f175998 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,16 +2,11 @@ // WILL NOT BE 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 super::custom_world_role_asset_status_type::CustomWorldRoleAssetStatus; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; /// Table handle for the table `custom_world_draft_card`. /// @@ -39,7 +34,9 @@ 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, } } @@ -52,8 +49,12 @@ 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; @@ -99,39 +100,38 @@ 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>, - } +/// 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, - } - } +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) + } +} - 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,26 +141,24 @@ 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; - } - - 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") - } - } +#[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") + } +} 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 64dd162a..600c1f31 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,16 +2,11 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -25,19 +20,17 @@ 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. @@ -51,9 +44,10 @@ 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, } @@ -73,10 +67,12 @@ 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"), - } } } @@ -97,10 +93,8 @@ 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_by_code_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_gallery_detail_by_code_input_type.rs index acdc32d0..0dd8127b 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_gallery_detail_by_code_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_gallery_detail_by_code_input_type.rs @@ -2,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -16,8 +10,6 @@ pub struct CustomWorldGalleryDetailByCodeInput { pub public_work_code: String, } - impl __sdk::InModule for CustomWorldGalleryDetailByCodeInput { type Module = super::RemoteModule; } - 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 5df002ea..64724446 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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 +11,6 @@ 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 04616d88..ac3cf555 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -22,7 +17,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, @@ -30,8 +25,6 @@ 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 f215d0c9..425b6a12 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,14 +2,9 @@ // WILL NOT BE 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`. /// @@ -37,7 +32,9 @@ 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, } } @@ -50,8 +47,12 @@ 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; @@ -97,40 +98,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>, - } +/// 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, - } - } +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) + } +} - 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); } @@ -139,26 +140,24 @@ 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; - } - - 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") - } - } +#[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") + } +} 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 976ccc10..a1fc0481 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -22,7 +17,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, @@ -30,12 +25,10 @@ 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. @@ -48,7 +41,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, @@ -63,8 +56,14 @@ impl __sdk::__query_builder::HasCols for CustomWorldGalleryEntry { profile_id: __sdk::__query_builder::Col::new(table_name, "profile_id"), owner_user_id: __sdk::__query_builder::Col::new(table_name, "owner_user_id"), public_work_code: __sdk::__query_builder::Col::new(table_name, "public_work_code"), - author_public_user_code: __sdk::__query_builder::Col::new(table_name, "author_public_user_code"), - author_display_name: __sdk::__query_builder::Col::new(table_name, "author_display_name"), + author_public_user_code: __sdk::__query_builder::Col::new( + table_name, + "author_public_user_code", + ), + 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"), @@ -74,7 +73,6 @@ 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"), - } } } @@ -97,10 +95,8 @@ impl __sdk::__query_builder::HasIxCols for CustomWorldGalleryEntry { profile_id: __sdk::__query_builder::IxCol::new(table_name, "profile_id"), public_work_code: __sdk::__query_builder::IxCol::new(table_name, "public_work_code"), 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 357c32c5..bf101ef1 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -15,12 +10,10 @@ 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 375a464c..8b424a9a 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -16,12 +11,8 @@ 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 e29dbaa9..472c1b80 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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 +11,6 @@ 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 6fd0d2ff..3c3bb3b3 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,27 +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_profile_snapshot_type::CustomWorldProfileSnapshot; use super::custom_world_gallery_entry_snapshot_type::CustomWorldGalleryEntrySnapshot; +use super::custom_world_profile_snapshot_type::CustomWorldProfileSnapshot; #[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_delete_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_profile_delete_input_type.rs index 65a7d4ab..f9d4a10f 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_profile_delete_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_profile_delete_input_type.rs @@ -2,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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,8 +12,6 @@ pub struct CustomWorldProfileDeleteInput { pub deleted_at_micros: i64, } - impl __sdk::InModule for CustomWorldProfileDeleteInput { 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 2d4b431e..53c46830 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -16,8 +10,6 @@ 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 4e6a5a4a..10db7d0e 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -15,12 +10,10 @@ 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 3a88edf7..0190e015 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,27 +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}; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] pub struct CustomWorldProfilePublishInput { pub profile_id: String, pub owner_user_id: String, - pub public_work_code: Option::, + pub public_work_code: Option, pub author_public_user_code: String, pub author_display_name: String, 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 0d404e2b..3b9f8b5a 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,42 +2,35 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; use super::custom_world_publication_status_type::CustomWorldPublicationStatus; +use super::custom_world_theme_mode_type::CustomWorldThemeMode; #[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 public_work_code: Option::, - pub author_public_user_code: Option::, - pub source_agent_session_id: Option::, + pub public_work_code: Option, + pub author_public_user_code: 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 deleted_at_micros: Option::, + pub published_at_micros: Option, + pub deleted_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 69639bf3..22692434 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,15 +2,10 @@ // WILL NOT BE 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_theme_mode_type::CustomWorldThemeMode; 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}; /// Table handle for the table `custom_world_profile`. /// @@ -38,7 +33,9 @@ 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, } } @@ -51,8 +48,12 @@ 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; @@ -98,39 +99,38 @@ 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>, - } +/// 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, - } - } +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) + } +} - 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,26 +140,24 @@ 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; - } - - impl custom_world_profileQueryTableAccess for __sdk::QueryTableAccessor { - fn custom_world_profile(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("custom_world_profile") - } - } +#[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") + } +} 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 ebcb964a..8923286f 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,67 +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_theme_mode_type::CustomWorldThemeMode; use super::custom_world_publication_status_type::CustomWorldPublicationStatus; +use super::custom_world_theme_mode_type::CustomWorldThemeMode; #[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 public_work_code: Option::, - pub author_public_user_code: Option::, - pub source_agent_session_id: Option::, + pub public_work_code: Option, + pub author_public_user_code: 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 deleted_at: Option::<__sdk::Timestamp>, + pub published_at: Option<__sdk::Timestamp>, + pub deleted_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 public_work_code: __sdk::__query_builder::Col>, - pub author_public_user_code: __sdk::__query_builder::Col>, - pub source_agent_session_id: __sdk::__query_builder::Col>, - pub publication_status: __sdk::__query_builder::Col, + pub public_work_code: __sdk::__query_builder::Col>, + pub author_public_user_code: __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 deleted_at: __sdk::__query_builder::Col>, + pub published_at: __sdk::__query_builder::Col>, + pub deleted_at: __sdk::__query_builder::Col>, pub created_at: __sdk::__query_builder::Col, pub updated_at: __sdk::__query_builder::Col, } @@ -74,23 +68,34 @@ impl __sdk::__query_builder::HasCols for CustomWorldProfile { profile_id: __sdk::__query_builder::Col::new(table_name, "profile_id"), owner_user_id: __sdk::__query_builder::Col::new(table_name, "owner_user_id"), public_work_code: __sdk::__query_builder::Col::new(table_name, "public_work_code"), - author_public_user_code: __sdk::__query_builder::Col::new(table_name, "author_public_user_code"), - source_agent_session_id: __sdk::__query_builder::Col::new(table_name, "source_agent_session_id"), + author_public_user_code: __sdk::__query_builder::Col::new( + table_name, + "author_public_user_code", + ), + 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"), deleted_at: __sdk::__query_builder::Col::new(table_name, "deleted_at"), created_at: __sdk::__query_builder::Col::new(table_name, "created_at"), updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"), - } } } @@ -101,7 +106,8 @@ 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 { @@ -110,11 +116,12 @@ 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 79aa9ff6..7d688d96 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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 +13,6 @@ 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 0ea2ef8c..323a72f3 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -16,14 +11,14 @@ use super::custom_world_theme_mode_type::CustomWorldThemeMode; pub struct CustomWorldProfileUpsertInput { pub profile_id: String, pub owner_user_id: String, - pub public_work_code: Option::, - pub author_public_user_code: Option::, - pub source_agent_session_id: Option::, + pub public_work_code: Option, + pub author_public_user_code: 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, @@ -31,8 +26,6 @@ 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 d81681f4..f21186ff 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -16,12 +11,8 @@ 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 74160cd9..a95c0561 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -16,17 +10,15 @@ pub struct CustomWorldPublishWorldInput { pub session_id: String, pub profile_id: String, pub owner_user_id: String, - pub public_work_code: Option::, + pub public_work_code: Option, pub author_public_user_code: 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 542810a3..a44ca2b1 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,31 +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}; +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 c78399a4..fda3d08b 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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,14 +11,12 @@ 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 42d770b5..4783f889 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -15,12 +10,10 @@ 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 9214b492..0af4d59e 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -20,7 +15,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, @@ -28,8 +23,6 @@ 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 a969aa55..1ab238e9 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -20,12 +15,8 @@ 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 f7fe499d..9b640e4f 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -22,12 +17,8 @@ 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 4d44d0ff..2813b6e2 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,15 +2,10 @@ // WILL NOT BE 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`. /// @@ -38,7 +33,9 @@ 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, } } @@ -51,8 +48,12 @@ 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; @@ -98,39 +99,38 @@ 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>, - } +/// 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, - } - } +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) + } +} - 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,26 +140,24 @@ 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; - } - - impl custom_world_sessionQueryTableAccess for __sdk::QueryTableAccessor { - fn custom_world_session(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("custom_world_session") - } - } +#[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") + } +} 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 2646073e..58e9f40c 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -20,20 +15,18 @@ 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. @@ -43,10 +36,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, } @@ -60,13 +53,21 @@ 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"), - } } } @@ -85,10 +86,8 @@ 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 766d1d08..2084ea04 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -24,12 +19,8 @@ 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/custom_world_work_summary_snapshot_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_work_summary_snapshot_type.rs index e81345b0..ed735fc3 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_work_summary_snapshot_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_work_summary_snapshot_type.rs @@ -2,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -20,28 +15,26 @@ pub struct CustomWorldWorkSummarySnapshot { pub title: String, pub subtitle: String, pub summary: String, - pub cover_image_src: Option::, - pub cover_render_mode: Option::, + pub cover_image_src: Option, + pub cover_render_mode: Option, pub cover_character_image_srcs_json: String, pub updated_at_micros: i64, - pub published_at_micros: Option::, - pub stage: Option::, - pub stage_label: Option::, + pub published_at_micros: 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 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, } - impl __sdk::InModule for CustomWorldWorkSummarySnapshot { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_works_list_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_works_list_input_type.rs index 073faecf..a007007b 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_works_list_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_works_list_input_type.rs @@ -2,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -16,8 +10,6 @@ pub struct CustomWorldWorksListInput { pub owner_user_id: String, } - impl __sdk::InModule for CustomWorldWorksListInput { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_works_list_result_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_works_list_result_type.rs index 937b450e..9296740e 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_works_list_result_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_works_list_result_type.rs @@ -2,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_work_summary_snapshot_type::CustomWorldWorkSummarySnapshot; @@ -15,12 +10,10 @@ use super::custom_world_work_summary_snapshot_type::CustomWorldWorkSummarySnapsh #[sats(crate = __lib)] pub struct CustomWorldWorksListResult { pub ok: bool, - pub items: Vec::, - pub error_message: Option::, + pub items: Vec, + pub error_message: Option, } - impl __sdk::InModule for CustomWorldWorksListResult { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/delete_custom_world_profile_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/delete_custom_world_profile_and_return_procedure.rs index 4dfc8daf..5dc9da2f 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/delete_custom_world_profile_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/delete_custom_world_profile_and_return_procedure.rs @@ -2,23 +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_profile_delete_input_type::CustomWorldProfileDeleteInput; use super::custom_world_profile_list_result_type::CustomWorldProfileListResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] - struct DeleteCustomWorldProfileAndReturnArgs { +struct DeleteCustomWorldProfileAndReturnArgs { pub input: CustomWorldProfileDeleteInput, } - impl __sdk::InModule for DeleteCustomWorldProfileAndReturnArgs { type Module = super::RemoteModule; } @@ -28,16 +22,19 @@ impl __sdk::InModule for DeleteCustomWorldProfileAndReturnArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait delete_custom_world_profile_and_return { - fn delete_custom_world_profile_and_return(&self, input: CustomWorldProfileDeleteInput, -) { - self.delete_custom_world_profile_and_return_then(input, |_, _| {}); + fn delete_custom_world_profile_and_return(&self, input: CustomWorldProfileDeleteInput) { + self.delete_custom_world_profile_and_return_then(input, |_, _| {}); } fn delete_custom_world_profile_and_return_then( &self, input: CustomWorldProfileDeleteInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -46,13 +43,17 @@ impl delete_custom_world_profile_and_return for super::RemoteProcedures { &self, input: CustomWorldProfileDeleteInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { - self.imp.invoke_procedure_with_callback::<_, CustomWorldProfileListResult>( - "delete_custom_world_profile_and_return", - DeleteCustomWorldProfileAndReturnArgs { input, }, - __callback, - ); + self.imp + .invoke_procedure_with_callback::<_, CustomWorldProfileListResult>( + "delete_custom_world_profile_and_return", + DeleteCustomWorldProfileAndReturnArgs { input }, + __callback, + ); } } - 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 index 6c38b74b..9173255a 100644 --- 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 @@ -2,23 +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::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 { +struct DeleteRuntimeSnapshotAndReturnArgs { pub input: RuntimeSnapshotDeleteInput, } - impl __sdk::InModule for DeleteRuntimeSnapshotAndReturnArgs { type Module = super::RemoteModule; } @@ -28,16 +22,19 @@ impl __sdk::InModule for DeleteRuntimeSnapshotAndReturnArgs { /// /// 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(&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, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -46,13 +43,17 @@ impl delete_runtime_snapshot_and_return for super::RemoteProcedures { &self, input: RuntimeSnapshotDeleteInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { - self.imp.invoke_procedure_with_callback::<_, RuntimeSnapshotProcedureResult>( - "delete_runtime_snapshot_and_return", - DeleteRuntimeSnapshotAndReturnArgs { input, }, - __callback, - ); + 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/drag_puzzle_piece_or_group_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/drag_puzzle_piece_or_group_procedure.rs index 49c4ee1c..1207f7b5 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/drag_puzzle_piece_or_group_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/drag_puzzle_piece_or_group_procedure.rs @@ -2,23 +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::puzzle_run_procedure_result_type::PuzzleRunProcedureResult; use super::puzzle_run_drag_input_type::PuzzleRunDragInput; +use super::puzzle_run_procedure_result_type::PuzzleRunProcedureResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] - struct DragPuzzlePieceOrGroupArgs { +struct DragPuzzlePieceOrGroupArgs { pub input: PuzzleRunDragInput, } - impl __sdk::InModule for DragPuzzlePieceOrGroupArgs { type Module = super::RemoteModule; } @@ -28,16 +22,19 @@ impl __sdk::InModule for DragPuzzlePieceOrGroupArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait drag_puzzle_piece_or_group { - fn drag_puzzle_piece_or_group(&self, input: PuzzleRunDragInput, -) { - self.drag_puzzle_piece_or_group_then(input, |_, _| {}); + fn drag_puzzle_piece_or_group(&self, input: PuzzleRunDragInput) { + self.drag_puzzle_piece_or_group_then(input, |_, _| {}); } fn drag_puzzle_piece_or_group_then( &self, input: PuzzleRunDragInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -46,13 +43,17 @@ impl drag_puzzle_piece_or_group for super::RemoteProcedures { &self, input: PuzzleRunDragInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { - self.imp.invoke_procedure_with_callback::<_, PuzzleRunProcedureResult>( - "drag_puzzle_piece_or_group", - DragPuzzlePieceOrGroupArgs { input, }, - __callback, - ); + self.imp + .invoke_procedure_with_callback::<_, PuzzleRunProcedureResult>( + "drag_puzzle_piece_or_group", + DragPuzzlePieceOrGroupArgs { 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 19545699..775ad7fa 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -16,8 +10,6 @@ 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/execute_custom_world_agent_action_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/execute_custom_world_agent_action_procedure.rs index 390871f5..c1008466 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/execute_custom_world_agent_action_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/execute_custom_world_agent_action_procedure.rs @@ -2,23 +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_action_execute_input_type::CustomWorldAgentActionExecuteInput; use super::custom_world_agent_action_execute_result_type::CustomWorldAgentActionExecuteResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] - struct ExecuteCustomWorldAgentActionArgs { +struct ExecuteCustomWorldAgentActionArgs { pub input: CustomWorldAgentActionExecuteInput, } - impl __sdk::InModule for ExecuteCustomWorldAgentActionArgs { type Module = super::RemoteModule; } @@ -28,16 +22,19 @@ impl __sdk::InModule for ExecuteCustomWorldAgentActionArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait execute_custom_world_agent_action { - fn execute_custom_world_agent_action(&self, input: CustomWorldAgentActionExecuteInput, -) { - self.execute_custom_world_agent_action_then(input, |_, _| {}); + fn execute_custom_world_agent_action(&self, input: CustomWorldAgentActionExecuteInput) { + self.execute_custom_world_agent_action_then(input, |_, _| {}); } fn execute_custom_world_agent_action_then( &self, input: CustomWorldAgentActionExecuteInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -46,13 +43,17 @@ impl execute_custom_world_agent_action for super::RemoteProcedures { &self, input: CustomWorldAgentActionExecuteInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { - self.imp.invoke_procedure_with_callback::<_, CustomWorldAgentActionExecuteResult>( - "execute_custom_world_agent_action", - ExecuteCustomWorldAgentActionArgs { input, }, - __callback, - ); + self.imp + .invoke_procedure_with_callback::<_, CustomWorldAgentActionExecuteResult>( + "execute_custom_world_agent_action", + ExecuteCustomWorldAgentActionArgs { input }, + __callback, + ); } } - 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 b92e796d..3194799b 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,23 +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_task_procedure_result_type::AiTaskProcedureResult; use super::ai_task_failure_input_type::AiTaskFailureInput; +use super::ai_task_procedure_result_type::AiTaskProcedureResult; #[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; } @@ -28,16 +22,19 @@ 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, ); } @@ -46,13 +43,17 @@ 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/finalize_custom_world_agent_message_turn_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/finalize_custom_world_agent_message_turn_procedure.rs index e9b3f1d9..f670f9b6 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/finalize_custom_world_agent_message_turn_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/finalize_custom_world_agent_message_turn_procedure.rs @@ -2,23 +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_finalize_input_type::CustomWorldAgentMessageFinalizeInput; use super::custom_world_agent_operation_procedure_result_type::CustomWorldAgentOperationProcedureResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] - struct FinalizeCustomWorldAgentMessageTurnArgs { +struct FinalizeCustomWorldAgentMessageTurnArgs { pub input: CustomWorldAgentMessageFinalizeInput, } - impl __sdk::InModule for FinalizeCustomWorldAgentMessageTurnArgs { type Module = super::RemoteModule; } @@ -28,16 +22,22 @@ impl __sdk::InModule for FinalizeCustomWorldAgentMessageTurnArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait finalize_custom_world_agent_message_turn { - fn finalize_custom_world_agent_message_turn(&self, input: CustomWorldAgentMessageFinalizeInput, -) { - self.finalize_custom_world_agent_message_turn_then(input, |_, _| {}); + fn finalize_custom_world_agent_message_turn( + &self, + input: CustomWorldAgentMessageFinalizeInput, + ) { + self.finalize_custom_world_agent_message_turn_then(input, |_, _| {}); } fn finalize_custom_world_agent_message_turn_then( &self, input: CustomWorldAgentMessageFinalizeInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -46,13 +46,17 @@ impl finalize_custom_world_agent_message_turn for super::RemoteProcedures { &self, input: CustomWorldAgentMessageFinalizeInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { - self.imp.invoke_procedure_with_callback::<_, CustomWorldAgentOperationProcedureResult>( - "finalize_custom_world_agent_message_turn", - FinalizeCustomWorldAgentMessageTurnArgs { input, }, - __callback, - ); + self.imp + .invoke_procedure_with_callback::<_, CustomWorldAgentOperationProcedureResult>( + "finalize_custom_world_agent_message_turn", + FinalizeCustomWorldAgentMessageTurnArgs { input }, + __callback, + ); } } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/finalize_puzzle_agent_message_turn_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/finalize_puzzle_agent_message_turn_procedure.rs index e2d6566c..7f06aafa 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/finalize_puzzle_agent_message_turn_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/finalize_puzzle_agent_message_turn_procedure.rs @@ -2,23 +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::puzzle_agent_session_procedure_result_type::PuzzleAgentSessionProcedureResult; use super::puzzle_agent_message_finalize_input_type::PuzzleAgentMessageFinalizeInput; +use super::puzzle_agent_session_procedure_result_type::PuzzleAgentSessionProcedureResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] - struct FinalizePuzzleAgentMessageTurnArgs { +struct FinalizePuzzleAgentMessageTurnArgs { pub input: PuzzleAgentMessageFinalizeInput, } - impl __sdk::InModule for FinalizePuzzleAgentMessageTurnArgs { type Module = super::RemoteModule; } @@ -28,16 +22,19 @@ impl __sdk::InModule for FinalizePuzzleAgentMessageTurnArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait finalize_puzzle_agent_message_turn { - fn finalize_puzzle_agent_message_turn(&self, input: PuzzleAgentMessageFinalizeInput, -) { - self.finalize_puzzle_agent_message_turn_then(input, |_, _| {}); + fn finalize_puzzle_agent_message_turn(&self, input: PuzzleAgentMessageFinalizeInput) { + self.finalize_puzzle_agent_message_turn_then(input, |_, _| {}); } fn finalize_puzzle_agent_message_turn_then( &self, input: PuzzleAgentMessageFinalizeInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -46,13 +43,17 @@ impl finalize_puzzle_agent_message_turn for super::RemoteProcedures { &self, input: PuzzleAgentMessageFinalizeInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { - self.imp.invoke_procedure_with_callback::<_, PuzzleAgentSessionProcedureResult>( - "finalize_puzzle_agent_message_turn", - FinalizePuzzleAgentMessageTurnArgs { input, }, - __callback, - ); + self.imp + .invoke_procedure_with_callback::<_, PuzzleAgentSessionProcedureResult>( + "finalize_puzzle_agent_message_turn", + FinalizePuzzleAgentMessageTurnArgs { input }, + __callback, + ); } } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/generate_big_fish_asset_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/generate_big_fish_asset_procedure.rs index 6ee820f7..144c5d40 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/generate_big_fish_asset_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/generate_big_fish_asset_procedure.rs @@ -2,23 +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::big_fish_session_procedure_result_type::BigFishSessionProcedureResult; use super::big_fish_asset_generate_input_type::BigFishAssetGenerateInput; +use super::big_fish_session_procedure_result_type::BigFishSessionProcedureResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] - struct GenerateBigFishAssetArgs { +struct GenerateBigFishAssetArgs { pub input: BigFishAssetGenerateInput, } - impl __sdk::InModule for GenerateBigFishAssetArgs { type Module = super::RemoteModule; } @@ -28,16 +22,19 @@ impl __sdk::InModule for GenerateBigFishAssetArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait generate_big_fish_asset { - fn generate_big_fish_asset(&self, input: BigFishAssetGenerateInput, -) { - self.generate_big_fish_asset_then(input, |_, _| {}); + fn generate_big_fish_asset(&self, input: BigFishAssetGenerateInput) { + self.generate_big_fish_asset_then(input, |_, _| {}); } fn generate_big_fish_asset_then( &self, input: BigFishAssetGenerateInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -46,13 +43,17 @@ impl generate_big_fish_asset for super::RemoteProcedures { &self, input: BigFishAssetGenerateInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { - self.imp.invoke_procedure_with_callback::<_, BigFishSessionProcedureResult>( - "generate_big_fish_asset", - GenerateBigFishAssetArgs { input, }, - __callback, - ); + self.imp + .invoke_procedure_with_callback::<_, BigFishSessionProcedureResult>( + "generate_big_fish_asset", + GenerateBigFishAssetArgs { 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 c6f93416..0fcc276c 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,23 +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_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; } @@ -28,16 +22,19 @@ 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, ); } @@ -46,13 +43,17 @@ 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_big_fish_run_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_big_fish_run_procedure.rs index a16bbc76..9a601ff2 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_big_fish_run_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_big_fish_run_procedure.rs @@ -2,23 +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::big_fish_run_get_input_type::BigFishRunGetInput; use super::big_fish_run_procedure_result_type::BigFishRunProcedureResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] - struct GetBigFishRunArgs { +struct GetBigFishRunArgs { pub input: BigFishRunGetInput, } - impl __sdk::InModule for GetBigFishRunArgs { type Module = super::RemoteModule; } @@ -28,16 +22,19 @@ impl __sdk::InModule for GetBigFishRunArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait get_big_fish_run { - fn get_big_fish_run(&self, input: BigFishRunGetInput, -) { - self.get_big_fish_run_then(input, |_, _| {}); + fn get_big_fish_run(&self, input: BigFishRunGetInput) { + self.get_big_fish_run_then(input, |_, _| {}); } fn get_big_fish_run_then( &self, input: BigFishRunGetInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -46,13 +43,17 @@ impl get_big_fish_run for super::RemoteProcedures { &self, input: BigFishRunGetInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { - self.imp.invoke_procedure_with_callback::<_, BigFishRunProcedureResult>( - "get_big_fish_run", - GetBigFishRunArgs { input, }, - __callback, - ); + self.imp + .invoke_procedure_with_callback::<_, BigFishRunProcedureResult>( + "get_big_fish_run", + GetBigFishRunArgs { input }, + __callback, + ); } } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/get_big_fish_session_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_big_fish_session_procedure.rs index f54dc9e4..7f52f94b 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_big_fish_session_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_big_fish_session_procedure.rs @@ -2,23 +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::big_fish_session_procedure_result_type::BigFishSessionProcedureResult; use super::big_fish_session_get_input_type::BigFishSessionGetInput; +use super::big_fish_session_procedure_result_type::BigFishSessionProcedureResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] - struct GetBigFishSessionArgs { +struct GetBigFishSessionArgs { pub input: BigFishSessionGetInput, } - impl __sdk::InModule for GetBigFishSessionArgs { type Module = super::RemoteModule; } @@ -28,16 +22,19 @@ impl __sdk::InModule for GetBigFishSessionArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait get_big_fish_session { - fn get_big_fish_session(&self, input: BigFishSessionGetInput, -) { - self.get_big_fish_session_then(input, |_, _| {}); + fn get_big_fish_session(&self, input: BigFishSessionGetInput) { + self.get_big_fish_session_then(input, |_, _| {}); } fn get_big_fish_session_then( &self, input: BigFishSessionGetInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -46,13 +43,17 @@ impl get_big_fish_session for super::RemoteProcedures { &self, input: BigFishSessionGetInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { - self.imp.invoke_procedure_with_callback::<_, BigFishSessionProcedureResult>( - "get_big_fish_session", - GetBigFishSessionArgs { input, }, - __callback, - ); + self.imp + .invoke_procedure_with_callback::<_, BigFishSessionProcedureResult>( + "get_big_fish_session", + GetBigFishSessionArgs { 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 dc75dc77..18f9ae27 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,23 +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::chapter_progression_procedure_result_type::ChapterProgressionProcedureResult; use super::chapter_progression_get_input_type::ChapterProgressionGetInput; +use super::chapter_progression_procedure_result_type::ChapterProgressionProcedureResult; #[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; } @@ -28,16 +22,19 @@ 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, ); } @@ -46,13 +43,17 @@ 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_card_detail_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_custom_world_agent_card_detail_procedure.rs index f0e38f3b..e1034345 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_custom_world_agent_card_detail_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_custom_world_agent_card_detail_procedure.rs @@ -2,23 +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_card_detail_get_input_type::CustomWorldAgentCardDetailGetInput; use super::custom_world_draft_card_detail_result_type::CustomWorldDraftCardDetailResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] - struct GetCustomWorldAgentCardDetailArgs { +struct GetCustomWorldAgentCardDetailArgs { pub input: CustomWorldAgentCardDetailGetInput, } - impl __sdk::InModule for GetCustomWorldAgentCardDetailArgs { type Module = super::RemoteModule; } @@ -28,16 +22,19 @@ impl __sdk::InModule for GetCustomWorldAgentCardDetailArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait get_custom_world_agent_card_detail { - fn get_custom_world_agent_card_detail(&self, input: CustomWorldAgentCardDetailGetInput, -) { - self.get_custom_world_agent_card_detail_then(input, |_, _| {}); + fn get_custom_world_agent_card_detail(&self, input: CustomWorldAgentCardDetailGetInput) { + self.get_custom_world_agent_card_detail_then(input, |_, _| {}); } fn get_custom_world_agent_card_detail_then( &self, input: CustomWorldAgentCardDetailGetInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -46,13 +43,17 @@ impl get_custom_world_agent_card_detail for super::RemoteProcedures { &self, input: CustomWorldAgentCardDetailGetInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { - self.imp.invoke_procedure_with_callback::<_, CustomWorldDraftCardDetailResult>( - "get_custom_world_agent_card_detail", - GetCustomWorldAgentCardDetailArgs { input, }, - __callback, - ); + self.imp + .invoke_procedure_with_callback::<_, CustomWorldDraftCardDetailResult>( + "get_custom_world_agent_card_detail", + GetCustomWorldAgentCardDetailArgs { 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 45ffda03..cce1dbb5 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,23 +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_operation_procedure_result_type::CustomWorldAgentOperationProcedureResult; 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; } @@ -28,16 +22,19 @@ 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, ); } @@ -46,13 +43,17 @@ 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 e1660a95..f4b678e9 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,23 +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_session_procedure_result_type::CustomWorldAgentSessionProcedureResult; use super::custom_world_agent_session_get_input_type::CustomWorldAgentSessionGetInput; +use super::custom_world_agent_session_procedure_result_type::CustomWorldAgentSessionProcedureResult; #[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; } @@ -28,16 +22,19 @@ 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, ); } @@ -46,13 +43,17 @@ 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_by_code_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_custom_world_gallery_detail_by_code_procedure.rs index 455eb2fc..a387cbaf 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_custom_world_gallery_detail_by_code_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_custom_world_gallery_detail_by_code_procedure.rs @@ -2,23 +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_library_mutation_result_type::CustomWorldLibraryMutationResult; use super::custom_world_gallery_detail_by_code_input_type::CustomWorldGalleryDetailByCodeInput; +use super::custom_world_library_mutation_result_type::CustomWorldLibraryMutationResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] - struct GetCustomWorldGalleryDetailByCodeArgs { +struct GetCustomWorldGalleryDetailByCodeArgs { pub input: CustomWorldGalleryDetailByCodeInput, } - impl __sdk::InModule for GetCustomWorldGalleryDetailByCodeArgs { type Module = super::RemoteModule; } @@ -28,16 +22,19 @@ impl __sdk::InModule for GetCustomWorldGalleryDetailByCodeArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait get_custom_world_gallery_detail_by_code { - fn get_custom_world_gallery_detail_by_code(&self, input: CustomWorldGalleryDetailByCodeInput, -) { - self.get_custom_world_gallery_detail_by_code_then(input, |_, _| {}); + fn get_custom_world_gallery_detail_by_code(&self, input: CustomWorldGalleryDetailByCodeInput) { + self.get_custom_world_gallery_detail_by_code_then(input, |_, _| {}); } fn get_custom_world_gallery_detail_by_code_then( &self, input: CustomWorldGalleryDetailByCodeInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -46,13 +43,17 @@ impl get_custom_world_gallery_detail_by_code for super::RemoteProcedures { &self, input: CustomWorldGalleryDetailByCodeInput, - __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_by_code", - GetCustomWorldGalleryDetailByCodeArgs { input, }, - __callback, - ); + self.imp + .invoke_procedure_with_callback::<_, CustomWorldLibraryMutationResult>( + "get_custom_world_gallery_detail_by_code", + GetCustomWorldGalleryDetailByCodeArgs { 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 79050c11..d0e029ff 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,23 +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_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; } @@ -28,16 +22,19 @@ 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, ); } @@ -46,13 +43,17 @@ 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 175758c2..82bd1c3c 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,23 +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_library_mutation_result_type::CustomWorldLibraryMutationResult; use super::custom_world_library_detail_input_type::CustomWorldLibraryDetailInput; +use super::custom_world_library_mutation_result_type::CustomWorldLibraryMutationResult; #[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; } @@ -28,16 +22,19 @@ 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, ); } @@ -46,13 +43,17 @@ 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 73490884..38a1525a 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,23 +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::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; } @@ -28,16 +22,19 @@ 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, ); } @@ -46,13 +43,17 @@ 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 616a11b8..6c48fafb 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,23 +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::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; } @@ -28,16 +22,19 @@ 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, ); } @@ -46,13 +43,17 @@ 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 466c6902..088f4812 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,23 +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::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; } @@ -28,16 +22,19 @@ 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, ); } @@ -46,13 +43,17 @@ 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_puzzle_agent_session_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_puzzle_agent_session_procedure.rs index 8946764b..8aa5a78f 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_puzzle_agent_session_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_puzzle_agent_session_procedure.rs @@ -2,23 +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::puzzle_agent_session_procedure_result_type::PuzzleAgentSessionProcedureResult; use super::puzzle_agent_session_get_input_type::PuzzleAgentSessionGetInput; +use super::puzzle_agent_session_procedure_result_type::PuzzleAgentSessionProcedureResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] - struct GetPuzzleAgentSessionArgs { +struct GetPuzzleAgentSessionArgs { pub input: PuzzleAgentSessionGetInput, } - impl __sdk::InModule for GetPuzzleAgentSessionArgs { type Module = super::RemoteModule; } @@ -28,16 +22,19 @@ impl __sdk::InModule for GetPuzzleAgentSessionArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait get_puzzle_agent_session { - fn get_puzzle_agent_session(&self, input: PuzzleAgentSessionGetInput, -) { - self.get_puzzle_agent_session_then(input, |_, _| {}); + fn get_puzzle_agent_session(&self, input: PuzzleAgentSessionGetInput) { + self.get_puzzle_agent_session_then(input, |_, _| {}); } fn get_puzzle_agent_session_then( &self, input: PuzzleAgentSessionGetInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -46,13 +43,17 @@ impl get_puzzle_agent_session for super::RemoteProcedures { &self, input: PuzzleAgentSessionGetInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { - self.imp.invoke_procedure_with_callback::<_, PuzzleAgentSessionProcedureResult>( - "get_puzzle_agent_session", - GetPuzzleAgentSessionArgs { input, }, - __callback, - ); + self.imp + .invoke_procedure_with_callback::<_, PuzzleAgentSessionProcedureResult>( + "get_puzzle_agent_session", + GetPuzzleAgentSessionArgs { input }, + __callback, + ); } } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/get_puzzle_gallery_detail_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_puzzle_gallery_detail_procedure.rs index 0c78ac7c..85b70081 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_puzzle_gallery_detail_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_puzzle_gallery_detail_procedure.rs @@ -2,23 +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::puzzle_work_get_input_type::PuzzleWorkGetInput; use super::puzzle_work_procedure_result_type::PuzzleWorkProcedureResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] - struct GetPuzzleGalleryDetailArgs { +struct GetPuzzleGalleryDetailArgs { pub input: PuzzleWorkGetInput, } - impl __sdk::InModule for GetPuzzleGalleryDetailArgs { type Module = super::RemoteModule; } @@ -28,16 +22,19 @@ impl __sdk::InModule for GetPuzzleGalleryDetailArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait get_puzzle_gallery_detail { - fn get_puzzle_gallery_detail(&self, input: PuzzleWorkGetInput, -) { - self.get_puzzle_gallery_detail_then(input, |_, _| {}); + fn get_puzzle_gallery_detail(&self, input: PuzzleWorkGetInput) { + self.get_puzzle_gallery_detail_then(input, |_, _| {}); } fn get_puzzle_gallery_detail_then( &self, input: PuzzleWorkGetInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -46,13 +43,17 @@ impl get_puzzle_gallery_detail for super::RemoteProcedures { &self, input: PuzzleWorkGetInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { - self.imp.invoke_procedure_with_callback::<_, PuzzleWorkProcedureResult>( - "get_puzzle_gallery_detail", - GetPuzzleGalleryDetailArgs { input, }, - __callback, - ); + self.imp + .invoke_procedure_with_callback::<_, PuzzleWorkProcedureResult>( + "get_puzzle_gallery_detail", + GetPuzzleGalleryDetailArgs { input }, + __callback, + ); } } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/get_puzzle_run_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_puzzle_run_procedure.rs index c409b79d..d09fc285 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_puzzle_run_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_puzzle_run_procedure.rs @@ -2,23 +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::puzzle_run_procedure_result_type::PuzzleRunProcedureResult; use super::puzzle_run_get_input_type::PuzzleRunGetInput; +use super::puzzle_run_procedure_result_type::PuzzleRunProcedureResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] - struct GetPuzzleRunArgs { +struct GetPuzzleRunArgs { pub input: PuzzleRunGetInput, } - impl __sdk::InModule for GetPuzzleRunArgs { type Module = super::RemoteModule; } @@ -28,16 +22,19 @@ impl __sdk::InModule for GetPuzzleRunArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait get_puzzle_run { - fn get_puzzle_run(&self, input: PuzzleRunGetInput, -) { - self.get_puzzle_run_then(input, |_, _| {}); + fn get_puzzle_run(&self, input: PuzzleRunGetInput) { + self.get_puzzle_run_then(input, |_, _| {}); } fn get_puzzle_run_then( &self, input: PuzzleRunGetInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -46,13 +43,17 @@ impl get_puzzle_run for super::RemoteProcedures { &self, input: PuzzleRunGetInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { - self.imp.invoke_procedure_with_callback::<_, PuzzleRunProcedureResult>( - "get_puzzle_run", - GetPuzzleRunArgs { input, }, - __callback, - ); + self.imp + .invoke_procedure_with_callback::<_, PuzzleRunProcedureResult>( + "get_puzzle_run", + GetPuzzleRunArgs { input }, + __callback, + ); } } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/get_puzzle_work_detail_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_puzzle_work_detail_procedure.rs index c21d1048..0d6c4f70 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_puzzle_work_detail_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_puzzle_work_detail_procedure.rs @@ -2,23 +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::puzzle_work_get_input_type::PuzzleWorkGetInput; use super::puzzle_work_procedure_result_type::PuzzleWorkProcedureResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] - struct GetPuzzleWorkDetailArgs { +struct GetPuzzleWorkDetailArgs { pub input: PuzzleWorkGetInput, } - impl __sdk::InModule for GetPuzzleWorkDetailArgs { type Module = super::RemoteModule; } @@ -28,16 +22,19 @@ impl __sdk::InModule for GetPuzzleWorkDetailArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait get_puzzle_work_detail { - fn get_puzzle_work_detail(&self, input: PuzzleWorkGetInput, -) { - self.get_puzzle_work_detail_then(input, |_, _| {}); + fn get_puzzle_work_detail(&self, input: PuzzleWorkGetInput) { + self.get_puzzle_work_detail_then(input, |_, _| {}); } fn get_puzzle_work_detail_then( &self, input: PuzzleWorkGetInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -46,13 +43,17 @@ impl get_puzzle_work_detail for super::RemoteProcedures { &self, input: PuzzleWorkGetInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { - self.imp.invoke_procedure_with_callback::<_, PuzzleWorkProcedureResult>( - "get_puzzle_work_detail", - GetPuzzleWorkDetailArgs { input, }, - __callback, - ); + self.imp + .invoke_procedure_with_callback::<_, PuzzleWorkProcedureResult>( + "get_puzzle_work_detail", + GetPuzzleWorkDetailArgs { 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 d5137496..c8dfefac 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,23 +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::runtime_inventory_state_query_input_type::RuntimeInventoryStateQueryInput; use super::runtime_inventory_state_procedure_result_type::RuntimeInventoryStateProcedureResult; +use super::runtime_inventory_state_query_input_type::RuntimeInventoryStateQueryInput; #[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; } @@ -28,16 +22,19 @@ 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, ); } @@ -46,13 +43,17 @@ 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 a58e515c..4ca8b03e 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,23 +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::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; } @@ -28,16 +22,19 @@ 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, ); } @@ -46,13 +43,17 @@ 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 index 75117d98..7f9feb4f 100644 --- 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 @@ -2,23 +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::runtime_snapshot_procedure_result_type::RuntimeSnapshotProcedureResult; use super::runtime_snapshot_get_input_type::RuntimeSnapshotGetInput; +use super::runtime_snapshot_procedure_result_type::RuntimeSnapshotProcedureResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] - struct GetRuntimeSnapshotArgs { +struct GetRuntimeSnapshotArgs { pub input: RuntimeSnapshotGetInput, } - impl __sdk::InModule for GetRuntimeSnapshotArgs { type Module = super::RemoteModule; } @@ -28,16 +22,19 @@ impl __sdk::InModule for GetRuntimeSnapshotArgs { /// /// 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(&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, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -46,13 +43,17 @@ impl get_runtime_snapshot for super::RemoteProcedures { &self, input: RuntimeSnapshotGetInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { - self.imp.invoke_procedure_with_callback::<_, RuntimeSnapshotProcedureResult>( - "get_runtime_snapshot", - GetRuntimeSnapshotArgs { input, }, - __callback, - ); + 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 b454ab5d..44b48ada 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,23 +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::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; } @@ -28,16 +22,19 @@ 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, ); } @@ -46,13 +43,17 @@ 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 c9389060..553aff65 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -18,8 +13,6 @@ 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 04e0ae9a..a3f2aa9e 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,23 +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::player_progression_procedure_result_type::PlayerProgressionProcedureResult; use super::player_progression_grant_input_type::PlayerProgressionGrantInput; +use super::player_progression_procedure_result_type::PlayerProgressionProcedureResult; #[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; } @@ -28,16 +22,19 @@ 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, ); } @@ -46,13 +43,17 @@ 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 324bb57f..bd07115e 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -19,10 +14,8 @@ 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 { @@ -40,9 +33,11 @@ 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, @@ -55,9 +50,11 @@ pub trait grant_player_progression_experience { &self, input: PlayerProgressionGrantInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + Send + + 'static, ) -> __sdk::Result<()>; } @@ -66,11 +63,13 @@ impl grant_player_progression_experience for super::RemoteReducers { &self, input: PlayerProgressionGrantInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + 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 23de3559..45522ce7 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -16,12 +11,8 @@ 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 81154f9f..e2055f6a 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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,12 +13,8 @@ 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 e277c402..85b46090 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -22,12 +17,8 @@ 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 7e962e4d..3769735e 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,15 +2,10 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_rarity_type::InventoryItemRarity; use super::inventory_equipment_slot_type::InventoryEquipmentSlot; +use super::inventory_item_rarity_type::InventoryItemRarity; use super::inventory_item_source_kind_type::InventoryItemSourceKind; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] @@ -19,19 +14,17 @@ 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 5303c581..1d3961bc 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -30,12 +25,8 @@ 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 c696e383..3540ad3b 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -16,14 +11,12 @@ 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 d7b64029..3d0d0e4f 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,16 +2,11 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -24,12 +19,8 @@ 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 4ce26de5..f20e5451 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,45 +2,38 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_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; +use super::inventory_equipment_slot_type::InventoryEquipmentSlot; +use super::inventory_item_rarity_type::InventoryItemRarity; +use super::inventory_item_source_kind_type::InventoryItemSourceKind; #[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 da04ff99..277df68a 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,17 +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 super::inventory_slot_type::InventorySlot; -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; +use super::inventory_equipment_slot_type::InventoryEquipmentSlot; +use super::inventory_item_rarity_type::InventoryItemRarity; +use super::inventory_item_source_kind_type::InventoryItemSourceKind; +use super::inventory_slot_type::InventorySlot; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; /// Table handle for the table `inventory_slot`. /// @@ -53,8 +48,12 @@ 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; @@ -100,39 +99,38 @@ 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>, - } +/// 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, - } - } +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) + } +} - 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); } @@ -142,26 +140,24 @@ 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; - } - - impl inventory_slotQueryTableAccess for __sdk::QueryTableAccessor { - fn inventory_slot(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("inventory_slot") - } - } +#[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") + } +} 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 c824c438..fcfbab6a 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,71 +2,65 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_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; +use super::inventory_equipment_slot_type::InventoryEquipmentSlot; +use super::inventory_item_rarity_type::InventoryItemRarity; +use super::inventory_item_source_kind_type::InventoryItemSourceKind; #[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, } @@ -92,10 +86,12 @@ 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"), - } } } @@ -116,12 +112,13 @@ 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_big_fish_works_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/list_big_fish_works_procedure.rs index 26eb3b8a..45ba04af 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/list_big_fish_works_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/list_big_fish_works_procedure.rs @@ -2,23 +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::big_fish_works_list_input_type::BigFishWorksListInput; use super::big_fish_works_procedure_result_type::BigFishWorksProcedureResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] - struct ListBigFishWorksArgs { +struct ListBigFishWorksArgs { pub input: BigFishWorksListInput, } - impl __sdk::InModule for ListBigFishWorksArgs { type Module = super::RemoteModule; } @@ -28,16 +22,19 @@ impl __sdk::InModule for ListBigFishWorksArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait list_big_fish_works { - fn list_big_fish_works(&self, input: BigFishWorksListInput, -) { - self.list_big_fish_works_then(input, |_, _| {}); + fn list_big_fish_works(&self, input: BigFishWorksListInput) { + self.list_big_fish_works_then(input, |_, _| {}); } fn list_big_fish_works_then( &self, input: BigFishWorksListInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -46,13 +43,17 @@ impl list_big_fish_works for super::RemoteProcedures { &self, input: BigFishWorksListInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { - self.imp.invoke_procedure_with_callback::<_, BigFishWorksProcedureResult>( - "list_big_fish_works", - ListBigFishWorksArgs { input, }, - __callback, - ); + self.imp + .invoke_procedure_with_callback::<_, BigFishWorksProcedureResult>( + "list_big_fish_works", + ListBigFishWorksArgs { input }, + __callback, + ); } } - 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 507757cf..01f6cb0c 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,20 +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}; 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; @@ -26,28 +19,36 @@ 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 2a591015..c42ce2c6 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,23 +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_profile_list_result_type::CustomWorldProfileListResult; 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; } @@ -28,16 +22,19 @@ 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, ); } @@ -46,13 +43,17 @@ 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_custom_world_works_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/list_custom_world_works_procedure.rs index aca87254..77f48ba6 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/list_custom_world_works_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/list_custom_world_works_procedure.rs @@ -2,23 +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_works_list_input_type::CustomWorldWorksListInput; use super::custom_world_works_list_result_type::CustomWorldWorksListResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] - struct ListCustomWorldWorksArgs { +struct ListCustomWorldWorksArgs { pub input: CustomWorldWorksListInput, } - impl __sdk::InModule for ListCustomWorldWorksArgs { type Module = super::RemoteModule; } @@ -28,16 +22,19 @@ impl __sdk::InModule for ListCustomWorldWorksArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait list_custom_world_works { - fn list_custom_world_works(&self, input: CustomWorldWorksListInput, -) { - self.list_custom_world_works_then(input, |_, _| {}); + fn list_custom_world_works(&self, input: CustomWorldWorksListInput) { + self.list_custom_world_works_then(input, |_, _| {}); } fn list_custom_world_works_then( &self, input: CustomWorldWorksListInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -46,13 +43,17 @@ impl list_custom_world_works for super::RemoteProcedures { &self, input: CustomWorldWorksListInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { - self.imp.invoke_procedure_with_callback::<_, CustomWorldWorksListResult>( - "list_custom_world_works", - ListCustomWorldWorksArgs { input, }, - __callback, - ); + self.imp + .invoke_procedure_with_callback::<_, CustomWorldWorksListResult>( + "list_custom_world_works", + ListCustomWorldWorksArgs { 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 0c10f6c3..00176656 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,23 +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::runtime_browse_history_procedure_result_type::RuntimeBrowseHistoryProcedureResult; use super::runtime_browse_history_list_input_type::RuntimeBrowseHistoryListInput; +use super::runtime_browse_history_procedure_result_type::RuntimeBrowseHistoryProcedureResult; #[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; } @@ -28,16 +22,19 @@ 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, ); } @@ -46,13 +43,17 @@ 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 index 6476c3ac..1c7176cf 100644 --- 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 @@ -2,23 +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::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 { +struct ListProfileSaveArchivesArgs { pub input: RuntimeProfileSaveArchiveListInput, } - impl __sdk::InModule for ListProfileSaveArchivesArgs { type Module = super::RemoteModule; } @@ -28,16 +22,19 @@ impl __sdk::InModule for ListProfileSaveArchivesArgs { /// /// 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(&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, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -46,13 +43,17 @@ impl list_profile_save_archives for super::RemoteProcedures { &self, input: RuntimeProfileSaveArchiveListInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { - self.imp.invoke_procedure_with_callback::<_, RuntimeProfileSaveArchiveProcedureResult>( - "list_profile_save_archives", - ListProfileSaveArchivesArgs { input, }, - __callback, - ); + 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 4ae618f0..d51f0df2 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,23 +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::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; } @@ -28,16 +22,19 @@ 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, ); } @@ -46,13 +43,17 @@ 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/list_puzzle_gallery_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/list_puzzle_gallery_procedure.rs index 329e53a4..e62fd064 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/list_puzzle_gallery_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/list_puzzle_gallery_procedure.rs @@ -2,20 +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}; use super::puzzle_works_procedure_result_type::PuzzleWorksProcedureResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] - struct ListPuzzleGalleryArgs { - } - +struct ListPuzzleGalleryArgs {} impl __sdk::InModule for ListPuzzleGalleryArgs { type Module = super::RemoteModule; @@ -26,28 +19,36 @@ impl __sdk::InModule for ListPuzzleGalleryArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait list_puzzle_gallery { - fn list_puzzle_gallery(&self, ) { - self.list_puzzle_gallery_then( |_, _| {}); + fn list_puzzle_gallery(&self) { + self.list_puzzle_gallery_then(|_, _| {}); } fn list_puzzle_gallery_then( &self, - - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } impl list_puzzle_gallery for super::RemoteProcedures { fn list_puzzle_gallery_then( &self, - - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { - self.imp.invoke_procedure_with_callback::<_, PuzzleWorksProcedureResult>( - "list_puzzle_gallery", - ListPuzzleGalleryArgs { }, - __callback, - ); + self.imp + .invoke_procedure_with_callback::<_, PuzzleWorksProcedureResult>( + "list_puzzle_gallery", + ListPuzzleGalleryArgs {}, + __callback, + ); } } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/list_puzzle_works_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/list_puzzle_works_procedure.rs index 980a3698..1da004e9 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/list_puzzle_works_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/list_puzzle_works_procedure.rs @@ -2,23 +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::puzzle_works_procedure_result_type::PuzzleWorksProcedureResult; use super::puzzle_works_list_input_type::PuzzleWorksListInput; +use super::puzzle_works_procedure_result_type::PuzzleWorksProcedureResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] - struct ListPuzzleWorksArgs { +struct ListPuzzleWorksArgs { pub input: PuzzleWorksListInput, } - impl __sdk::InModule for ListPuzzleWorksArgs { type Module = super::RemoteModule; } @@ -28,16 +22,19 @@ impl __sdk::InModule for ListPuzzleWorksArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait list_puzzle_works { - fn list_puzzle_works(&self, input: PuzzleWorksListInput, -) { - self.list_puzzle_works_then(input, |_, _| {}); + fn list_puzzle_works(&self, input: PuzzleWorksListInput) { + self.list_puzzle_works_then(input, |_, _| {}); } fn list_puzzle_works_then( &self, input: PuzzleWorksListInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -46,13 +43,17 @@ impl list_puzzle_works for super::RemoteProcedures { &self, input: PuzzleWorksListInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { - self.imp.invoke_procedure_with_callback::<_, PuzzleWorksProcedureResult>( - "list_puzzle_works", - ListPuzzleWorksArgs { input, }, - __callback, - ); + self.imp + .invoke_procedure_with_callback::<_, PuzzleWorksProcedureResult>( + "list_puzzle_works", + ListPuzzleWorksArgs { 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 34e0702a..5f689c97 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/mod.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/mod.rs @@ -4,19 +4,17 @@ // 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 ai_result_reference_type; +pub mod accept_quest_reducer; +pub mod acknowledge_quest_completion_reducer; +pub mod advance_puzzle_next_level_procedure; 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; @@ -24,47 +22,65 @@ 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_text_chunk_type; +pub mod ai_task_table; +pub mod ai_task_type; pub mod ai_text_chunk_append_input_type; pub mod ai_text_chunk_snapshot_type; -pub mod asset_entity_binding_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_input_type; pub mod asset_entity_binding_procedure_result_type; pub mod asset_entity_binding_snapshot_type; -pub mod asset_object_type; +pub mod asset_entity_binding_table; +pub mod asset_entity_binding_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 big_fish_agent_message_type; +pub mod begin_story_session_and_return_procedure; +pub mod begin_story_session_reducer; pub mod big_fish_agent_message_kind_type; pub mod big_fish_agent_message_role_type; pub mod big_fish_agent_message_snapshot_type; +pub mod big_fish_agent_message_table; +pub mod big_fish_agent_message_type; pub mod big_fish_anchor_item_type; pub mod big_fish_anchor_pack_type; pub mod big_fish_anchor_status_type; pub mod big_fish_asset_coverage_type; pub mod big_fish_asset_generate_input_type; pub mod big_fish_asset_kind_type; -pub mod big_fish_asset_slot_type; pub mod big_fish_asset_slot_snapshot_type; +pub mod big_fish_asset_slot_table; +pub mod big_fish_asset_slot_type; pub mod big_fish_asset_status_type; pub mod big_fish_background_blueprint_type; +pub mod big_fish_creation_session_table; pub mod big_fish_creation_session_type; pub mod big_fish_creation_stage_type; pub mod big_fish_draft_compile_input_type; @@ -79,6 +95,7 @@ pub mod big_fish_run_start_input_type; pub mod big_fish_run_status_type; pub mod big_fish_runtime_entity_type; pub mod big_fish_runtime_params_type; +pub mod big_fish_runtime_run_table; pub mod big_fish_runtime_run_type; pub mod big_fish_runtime_snapshot_type; pub mod big_fish_session_create_input_type; @@ -88,50 +105,77 @@ pub mod big_fish_session_snapshot_type; pub mod big_fish_vector_2_type; pub mod big_fish_works_list_input_type; pub mod big_fish_works_procedure_result_type; +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_big_fish_draft_procedure; +pub mod compile_custom_world_published_profile_procedure; +pub mod compile_puzzle_agent_draft_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_big_fish_session_procedure; +pub mod create_custom_world_agent_session_procedure; +pub mod create_puzzle_agent_session_procedure; pub mod custom_world_agent_action_execute_input_type; pub mod custom_world_agent_action_execute_result_type; pub mod custom_world_agent_card_detail_get_input_type; -pub mod custom_world_agent_message_type; pub mod custom_world_agent_message_finalize_input_type; pub mod custom_world_agent_message_snapshot_type; pub mod custom_world_agent_message_submit_input_type; -pub mod custom_world_agent_operation_type; +pub mod custom_world_agent_message_table; +pub mod custom_world_agent_message_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_session_type; +pub mod custom_world_agent_operation_table; +pub mod custom_world_agent_operation_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_draft_card_type; +pub mod custom_world_agent_session_table; +pub mod custom_world_agent_session_type; pub mod custom_world_draft_card_detail_result_type; pub mod custom_world_draft_card_detail_section_snapshot_type; pub mod custom_world_draft_card_detail_snapshot_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_gallery_detail_by_code_input_type; pub mod custom_world_gallery_detail_input_type; -pub mod custom_world_gallery_entry_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_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_delete_input_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; @@ -141,23 +185,65 @@ 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_type; pub mod custom_world_session_status_type; +pub mod custom_world_session_table; +pub mod custom_world_session_type; pub mod custom_world_theme_mode_type; pub mod custom_world_work_summary_snapshot_type; pub mod custom_world_works_list_input_type; pub mod custom_world_works_list_result_type; +pub mod delete_custom_world_profile_and_return_procedure; +pub mod delete_runtime_snapshot_and_return_procedure; +pub mod drag_puzzle_piece_or_group_procedure; pub mod equip_inventory_item_input_type; +pub mod execute_custom_world_agent_action_procedure; +pub mod fail_ai_task_and_return_procedure; +pub mod finalize_custom_world_agent_message_turn_procedure; +pub mod finalize_puzzle_agent_message_turn_procedure; +pub mod generate_big_fish_asset_procedure; +pub mod get_battle_state_procedure; +pub mod get_big_fish_run_procedure; +pub mod get_big_fish_session_procedure; +pub mod get_chapter_progression_procedure; +pub mod get_custom_world_agent_card_detail_procedure; +pub mod get_custom_world_agent_operation_procedure; +pub mod get_custom_world_agent_session_procedure; +pub mod get_custom_world_gallery_detail_by_code_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_puzzle_agent_session_procedure; +pub mod get_puzzle_gallery_detail_procedure; +pub mod get_puzzle_run_procedure; +pub mod get_puzzle_work_detail_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_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_type; pub mod inventory_mutation_input_type; -pub mod inventory_slot_type; +pub mod inventory_mutation_type; pub mod inventory_slot_snapshot_type; +pub mod inventory_slot_table; +pub mod inventory_slot_type; +pub mod list_big_fish_works_procedure; +pub mod list_custom_world_gallery_entries_procedure; +pub mod list_custom_world_profiles_procedure; +pub mod list_custom_world_works_procedure; +pub mod list_platform_browse_history_procedure; +pub mod list_profile_save_archives_procedure; +pub mod list_profile_wallet_ledger_procedure; +pub mod list_puzzle_gallery_procedure; +pub mod list_puzzle_works_procedure; pub mod npc_battle_interaction_procedure_result_type; pub mod npc_battle_interaction_result_type; pub mod npc_interaction_battle_mode_type; @@ -168,29 +254,42 @@ 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_save_archive_table; pub mod profile_save_archive_type; +pub mod profile_wallet_ledger_table; pub mod profile_wallet_ledger_type; +pub mod publish_big_fish_game_procedure; +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 publish_puzzle_work_procedure; pub mod puzzle_agent_message_finalize_input_type; pub mod puzzle_agent_message_kind_type; pub mod puzzle_agent_message_role_type; pub mod puzzle_agent_message_row_type; pub mod puzzle_agent_message_submit_input_type; +pub mod puzzle_agent_message_table; pub mod puzzle_agent_session_create_input_type; pub mod puzzle_agent_session_get_input_type; pub mod puzzle_agent_session_procedure_result_type; pub mod puzzle_agent_session_row_type; +pub mod puzzle_agent_session_table; pub mod puzzle_agent_stage_type; pub mod puzzle_draft_compile_input_type; pub mod puzzle_generated_images_save_input_type; @@ -203,18 +302,21 @@ pub mod puzzle_run_procedure_result_type; pub mod puzzle_run_start_input_type; pub mod puzzle_run_swap_input_type; pub mod puzzle_runtime_run_row_type; +pub mod puzzle_runtime_run_table; pub mod puzzle_select_cover_image_input_type; pub mod puzzle_work_get_input_type; pub mod puzzle_work_procedure_result_type; pub mod puzzle_work_profile_row_type; +pub mod puzzle_work_profile_table; pub mod puzzle_work_upsert_input_type; pub mod puzzle_works_list_input_type; pub mod puzzle_works_procedure_result_type; 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_type; pub mod quest_log_event_kind_type; +pub mod quest_log_table; +pub mod quest_log_type; pub mod quest_narrative_binding_snapshot_type; pub mod quest_narrative_origin_type; pub mod quest_narrative_type_type; @@ -223,12 +325,13 @@ 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_type; pub mod quest_record_input_type; +pub mod quest_record_table; +pub mod quest_record_type; pub mod quest_reward_equipment_slot_type; pub mod quest_reward_intel_type; -pub mod quest_reward_item_type; pub mod quest_reward_item_rarity_type; +pub mod quest_reward_item_type; pub mod quest_reward_snapshot_type; pub mod quest_scene_reached_signal_type; pub mod quest_signal_apply_input_type; @@ -237,12 +340,22 @@ 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 resume_profile_save_archive_and_return_procedure; pub mod rpg_agent_draft_card_kind_type; pub mod rpg_agent_draft_card_status_type; pub mod rpg_agent_message_kind_type; @@ -279,190 +392,75 @@ 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 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_table; +pub mod runtime_snapshot_type; pub mod runtime_snapshot_upsert_input_type; +pub mod save_puzzle_generated_images_procedure; +pub mod select_puzzle_cover_image_procedure; +pub mod start_ai_task_reducer; +pub mod start_ai_task_stage_reducer; +pub mod start_big_fish_run_procedure; +pub mod start_puzzle_run_procedure; 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_session_type; +pub mod story_event_table; +pub mod story_event_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 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_resolve_input_type; -pub mod unequip_inventory_item_input_type; -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_reducer; -pub mod upsert_custom_world_profile_reducer; -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 big_fish_agent_message_table; -pub mod big_fish_asset_slot_table; -pub mod big_fish_creation_session_table; -pub mod big_fish_runtime_run_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 puzzle_agent_message_table; -pub mod puzzle_agent_session_table; -pub mod puzzle_runtime_run_table; -pub mod puzzle_work_profile_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 advance_puzzle_next_level_procedure; -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_big_fish_draft_procedure; -pub mod compile_custom_world_published_profile_procedure; -pub mod compile_puzzle_agent_draft_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_big_fish_session_procedure; -pub mod create_custom_world_agent_session_procedure; -pub mod create_puzzle_agent_session_procedure; -pub mod delete_custom_world_profile_and_return_procedure; -pub mod delete_runtime_snapshot_and_return_procedure; -pub mod drag_puzzle_piece_or_group_procedure; -pub mod execute_custom_world_agent_action_procedure; -pub mod fail_ai_task_and_return_procedure; -pub mod finalize_custom_world_agent_message_turn_procedure; -pub mod finalize_puzzle_agent_message_turn_procedure; -pub mod generate_big_fish_asset_procedure; -pub mod get_battle_state_procedure; -pub mod get_big_fish_run_procedure; -pub mod get_big_fish_session_procedure; -pub mod get_chapter_progression_procedure; -pub mod get_custom_world_agent_card_detail_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_gallery_detail_by_code_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_puzzle_agent_session_procedure; -pub mod get_puzzle_gallery_detail_procedure; -pub mod get_puzzle_run_procedure; -pub mod get_puzzle_work_detail_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_big_fish_works_procedure; -pub mod list_custom_world_gallery_entries_procedure; -pub mod list_custom_world_profiles_procedure; -pub mod list_custom_world_works_procedure; -pub mod list_platform_browse_history_procedure; -pub mod list_profile_save_archives_procedure; -pub mod list_profile_wallet_ledger_procedure; -pub mod list_puzzle_gallery_procedure; -pub mod list_puzzle_works_procedure; -pub mod publish_big_fish_game_procedure; -pub mod publish_custom_world_profile_and_return_procedure; -pub mod publish_custom_world_world_procedure; -pub mod publish_puzzle_work_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 save_puzzle_generated_images_procedure; -pub mod select_puzzle_cover_image_procedure; -pub mod start_big_fish_run_procedure; -pub mod start_puzzle_run_procedure; +pub mod story_session_type; pub mod submit_big_fish_input_procedure; pub mod submit_big_fish_message_procedure; pub mod submit_custom_world_agent_message_procedure; pub mod submit_puzzle_agent_message_procedure; pub mod swap_puzzle_pieces_procedure; +pub mod treasure_interaction_action_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 unpublish_custom_world_profile_reducer; pub mod update_puzzle_work_procedure; 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 upsert_platform_browse_history_and_return_procedure; pub mod upsert_runtime_setting_and_return_procedure; pub mod upsert_runtime_snapshot_and_return_procedure; +pub mod user_browse_history_table; +pub mod user_browse_history_type; -pub use ai_result_reference_type::AiResultReference; +pub use accept_quest_reducer::accept_quest; +pub use acknowledge_quest_completion_reducer::acknowledge_quest_completion; +pub use advance_puzzle_next_level_procedure::advance_puzzle_next_level; 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; @@ -470,47 +468,65 @@ 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_text_chunk_type::AiTextChunk; +pub use ai_task_table::*; +pub use ai_task_type::AiTask; pub use ai_text_chunk_append_input_type::AiTextChunkAppendInput; pub use ai_text_chunk_snapshot_type::AiTextChunkSnapshot; -pub use asset_entity_binding_type::AssetEntityBinding; +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_input_type::AssetEntityBindingInput; pub use asset_entity_binding_procedure_result_type::AssetEntityBindingProcedureResult; pub use asset_entity_binding_snapshot_type::AssetEntityBindingSnapshot; -pub use asset_object_type::AssetObject; +pub use asset_entity_binding_table::*; +pub use asset_entity_binding_type::AssetEntityBinding; 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 big_fish_agent_message_type::BigFishAgentMessage; +pub use begin_story_session_and_return_procedure::begin_story_session_and_return; +pub use begin_story_session_reducer::begin_story_session; pub use big_fish_agent_message_kind_type::BigFishAgentMessageKind; pub use big_fish_agent_message_role_type::BigFishAgentMessageRole; pub use big_fish_agent_message_snapshot_type::BigFishAgentMessageSnapshot; +pub use big_fish_agent_message_table::*; +pub use big_fish_agent_message_type::BigFishAgentMessage; pub use big_fish_anchor_item_type::BigFishAnchorItem; pub use big_fish_anchor_pack_type::BigFishAnchorPack; pub use big_fish_anchor_status_type::BigFishAnchorStatus; pub use big_fish_asset_coverage_type::BigFishAssetCoverage; pub use big_fish_asset_generate_input_type::BigFishAssetGenerateInput; pub use big_fish_asset_kind_type::BigFishAssetKind; -pub use big_fish_asset_slot_type::BigFishAssetSlot; pub use big_fish_asset_slot_snapshot_type::BigFishAssetSlotSnapshot; +pub use big_fish_asset_slot_table::*; +pub use big_fish_asset_slot_type::BigFishAssetSlot; pub use big_fish_asset_status_type::BigFishAssetStatus; pub use big_fish_background_blueprint_type::BigFishBackgroundBlueprint; +pub use big_fish_creation_session_table::*; pub use big_fish_creation_session_type::BigFishCreationSession; pub use big_fish_creation_stage_type::BigFishCreationStage; pub use big_fish_draft_compile_input_type::BigFishDraftCompileInput; @@ -525,6 +541,7 @@ pub use big_fish_run_start_input_type::BigFishRunStartInput; pub use big_fish_run_status_type::BigFishRunStatus; pub use big_fish_runtime_entity_type::BigFishRuntimeEntity; pub use big_fish_runtime_params_type::BigFishRuntimeParams; +pub use big_fish_runtime_run_table::*; pub use big_fish_runtime_run_type::BigFishRuntimeRun; pub use big_fish_runtime_snapshot_type::BigFishRuntimeSnapshot; pub use big_fish_session_create_input_type::BigFishSessionCreateInput; @@ -534,50 +551,77 @@ pub use big_fish_session_snapshot_type::BigFishSessionSnapshot; pub use big_fish_vector_2_type::BigFishVector2; pub use big_fish_works_list_input_type::BigFishWorksListInput; pub use big_fish_works_procedure_result_type::BigFishWorksProcedureResult; +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_big_fish_draft_procedure::compile_big_fish_draft; +pub use compile_custom_world_published_profile_procedure::compile_custom_world_published_profile; +pub use compile_puzzle_agent_draft_procedure::compile_puzzle_agent_draft; +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_big_fish_session_procedure::create_big_fish_session; +pub use create_custom_world_agent_session_procedure::create_custom_world_agent_session; +pub use create_puzzle_agent_session_procedure::create_puzzle_agent_session; pub use custom_world_agent_action_execute_input_type::CustomWorldAgentActionExecuteInput; pub use custom_world_agent_action_execute_result_type::CustomWorldAgentActionExecuteResult; pub use custom_world_agent_card_detail_get_input_type::CustomWorldAgentCardDetailGetInput; -pub use custom_world_agent_message_type::CustomWorldAgentMessage; pub use custom_world_agent_message_finalize_input_type::CustomWorldAgentMessageFinalizeInput; pub use custom_world_agent_message_snapshot_type::CustomWorldAgentMessageSnapshot; pub use custom_world_agent_message_submit_input_type::CustomWorldAgentMessageSubmitInput; -pub use custom_world_agent_operation_type::CustomWorldAgentOperation; +pub use custom_world_agent_message_table::*; +pub use custom_world_agent_message_type::CustomWorldAgentMessage; 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_session_type::CustomWorldAgentSession; +pub use custom_world_agent_operation_table::*; +pub use custom_world_agent_operation_type::CustomWorldAgentOperation; 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_draft_card_type::CustomWorldDraftCard; +pub use custom_world_agent_session_table::*; +pub use custom_world_agent_session_type::CustomWorldAgentSession; pub use custom_world_draft_card_detail_result_type::CustomWorldDraftCardDetailResult; pub use custom_world_draft_card_detail_section_snapshot_type::CustomWorldDraftCardDetailSectionSnapshot; pub use custom_world_draft_card_detail_snapshot_type::CustomWorldDraftCardDetailSnapshot; 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_gallery_detail_by_code_input_type::CustomWorldGalleryDetailByCodeInput; pub use custom_world_gallery_detail_input_type::CustomWorldGalleryDetailInput; -pub use custom_world_gallery_entry_type::CustomWorldGalleryEntry; 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_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_delete_input_type::CustomWorldProfileDeleteInput; 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; @@ -587,23 +631,65 @@ 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_type::CustomWorldSession; 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_theme_mode_type::CustomWorldThemeMode; pub use custom_world_work_summary_snapshot_type::CustomWorldWorkSummarySnapshot; pub use custom_world_works_list_input_type::CustomWorldWorksListInput; pub use custom_world_works_list_result_type::CustomWorldWorksListResult; +pub use delete_custom_world_profile_and_return_procedure::delete_custom_world_profile_and_return; +pub use delete_runtime_snapshot_and_return_procedure::delete_runtime_snapshot_and_return; +pub use drag_puzzle_piece_or_group_procedure::drag_puzzle_piece_or_group; pub use equip_inventory_item_input_type::EquipInventoryItemInput; +pub use execute_custom_world_agent_action_procedure::execute_custom_world_agent_action; +pub use fail_ai_task_and_return_procedure::fail_ai_task_and_return; +pub use finalize_custom_world_agent_message_turn_procedure::finalize_custom_world_agent_message_turn; +pub use finalize_puzzle_agent_message_turn_procedure::finalize_puzzle_agent_message_turn; +pub use generate_big_fish_asset_procedure::generate_big_fish_asset; +pub use get_battle_state_procedure::get_battle_state; +pub use get_big_fish_run_procedure::get_big_fish_run; +pub use get_big_fish_session_procedure::get_big_fish_session; +pub use get_chapter_progression_procedure::get_chapter_progression; +pub use get_custom_world_agent_card_detail_procedure::get_custom_world_agent_card_detail; +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_by_code_procedure::get_custom_world_gallery_detail_by_code; +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_puzzle_agent_session_procedure::get_puzzle_agent_session; +pub use get_puzzle_gallery_detail_procedure::get_puzzle_gallery_detail; +pub use get_puzzle_run_procedure::get_puzzle_run; +pub use get_puzzle_work_detail_procedure::get_puzzle_work_detail; +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_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_type::InventoryMutation; pub use inventory_mutation_input_type::InventoryMutationInput; -pub use inventory_slot_type::InventorySlot; +pub use inventory_mutation_type::InventoryMutation; pub use inventory_slot_snapshot_type::InventorySlotSnapshot; +pub use inventory_slot_table::*; +pub use inventory_slot_type::InventorySlot; +pub use list_big_fish_works_procedure::list_big_fish_works; +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_custom_world_works_procedure::list_custom_world_works; +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 list_puzzle_gallery_procedure::list_puzzle_gallery; +pub use list_puzzle_works_procedure::list_puzzle_works; 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; @@ -614,29 +700,42 @@ 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_save_archive_table::*; pub use profile_save_archive_type::ProfileSaveArchive; +pub use profile_wallet_ledger_table::*; pub use profile_wallet_ledger_type::ProfileWalletLedger; +pub use publish_big_fish_game_procedure::publish_big_fish_game; +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 publish_puzzle_work_procedure::publish_puzzle_work; pub use puzzle_agent_message_finalize_input_type::PuzzleAgentMessageFinalizeInput; pub use puzzle_agent_message_kind_type::PuzzleAgentMessageKind; pub use puzzle_agent_message_role_type::PuzzleAgentMessageRole; pub use puzzle_agent_message_row_type::PuzzleAgentMessageRow; pub use puzzle_agent_message_submit_input_type::PuzzleAgentMessageSubmitInput; +pub use puzzle_agent_message_table::*; pub use puzzle_agent_session_create_input_type::PuzzleAgentSessionCreateInput; pub use puzzle_agent_session_get_input_type::PuzzleAgentSessionGetInput; pub use puzzle_agent_session_procedure_result_type::PuzzleAgentSessionProcedureResult; pub use puzzle_agent_session_row_type::PuzzleAgentSessionRow; +pub use puzzle_agent_session_table::*; pub use puzzle_agent_stage_type::PuzzleAgentStage; pub use puzzle_draft_compile_input_type::PuzzleDraftCompileInput; pub use puzzle_generated_images_save_input_type::PuzzleGeneratedImagesSaveInput; @@ -649,18 +748,21 @@ pub use puzzle_run_procedure_result_type::PuzzleRunProcedureResult; pub use puzzle_run_start_input_type::PuzzleRunStartInput; pub use puzzle_run_swap_input_type::PuzzleRunSwapInput; pub use puzzle_runtime_run_row_type::PuzzleRuntimeRunRow; +pub use puzzle_runtime_run_table::*; pub use puzzle_select_cover_image_input_type::PuzzleSelectCoverImageInput; pub use puzzle_work_get_input_type::PuzzleWorkGetInput; pub use puzzle_work_procedure_result_type::PuzzleWorkProcedureResult; pub use puzzle_work_profile_row_type::PuzzleWorkProfileRow; +pub use puzzle_work_profile_table::*; pub use puzzle_work_upsert_input_type::PuzzleWorkUpsertInput; pub use puzzle_works_list_input_type::PuzzleWorksListInput; pub use puzzle_works_procedure_result_type::PuzzleWorksProcedureResult; 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_type::QuestLog; pub use quest_log_event_kind_type::QuestLogEventKind; +pub use quest_log_table::*; +pub use quest_log_type::QuestLog; pub use quest_narrative_binding_snapshot_type::QuestNarrativeBindingSnapshot; pub use quest_narrative_origin_type::QuestNarrativeOrigin; pub use quest_narrative_type_type::QuestNarrativeType; @@ -669,12 +771,13 @@ 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_type::QuestRecord; pub use quest_record_input_type::QuestRecordInput; +pub use quest_record_table::*; +pub use quest_record_type::QuestRecord; pub use quest_reward_equipment_slot_type::QuestRewardEquipmentSlot; pub use quest_reward_intel_type::QuestRewardIntel; -pub use quest_reward_item_type::QuestRewardItem; pub use quest_reward_item_rarity_type::QuestRewardItemRarity; +pub use quest_reward_item_type::QuestRewardItem; pub use quest_reward_snapshot_type::QuestRewardSnapshot; pub use quest_scene_reached_signal_type::QuestSceneReachedSignal; pub use quest_signal_apply_input_type::QuestSignalApplyInput; @@ -683,12 +786,22 @@ 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 resume_profile_save_archive_and_return_procedure::resume_profile_save_archive_and_return; 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; @@ -725,183 +838,65 @@ pub use runtime_profile_wallet_ledger_entry_snapshot_type::RuntimeProfileWalletL 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 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_table::*; +pub use runtime_snapshot_type::RuntimeSnapshot; pub use runtime_snapshot_upsert_input_type::RuntimeSnapshotUpsertInput; +pub use save_puzzle_generated_images_procedure::save_puzzle_generated_images; +pub use select_puzzle_cover_image_procedure::select_puzzle_cover_image; +pub use start_ai_task_reducer::start_ai_task; +pub use start_ai_task_stage_reducer::start_ai_task_stage; +pub use start_big_fish_run_procedure::start_big_fish_run; +pub use start_puzzle_run_procedure::start_puzzle_run; 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_session_type::StorySession; +pub use story_event_table::*; +pub use story_event_type::StoryEvent; 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 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_resolve_input_type::TreasureResolveInput; -pub use unequip_inventory_item_input_type::UnequipInventoryItemInput; -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 big_fish_agent_message_table::*; -pub use big_fish_asset_slot_table::*; -pub use big_fish_creation_session_table::*; -pub use big_fish_runtime_run_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 puzzle_agent_message_table::*; -pub use puzzle_agent_session_table::*; -pub use puzzle_runtime_run_table::*; -pub use puzzle_work_profile_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_reducer::upsert_chapter_progression; -pub use upsert_custom_world_profile_reducer::upsert_custom_world_profile; -pub use upsert_npc_state_reducer::upsert_npc_state; -pub use advance_puzzle_next_level_procedure::advance_puzzle_next_level; -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_big_fish_draft_procedure::compile_big_fish_draft; -pub use compile_custom_world_published_profile_procedure::compile_custom_world_published_profile; -pub use compile_puzzle_agent_draft_procedure::compile_puzzle_agent_draft; -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_big_fish_session_procedure::create_big_fish_session; -pub use create_custom_world_agent_session_procedure::create_custom_world_agent_session; -pub use create_puzzle_agent_session_procedure::create_puzzle_agent_session; -pub use delete_custom_world_profile_and_return_procedure::delete_custom_world_profile_and_return; -pub use delete_runtime_snapshot_and_return_procedure::delete_runtime_snapshot_and_return; -pub use drag_puzzle_piece_or_group_procedure::drag_puzzle_piece_or_group; -pub use execute_custom_world_agent_action_procedure::execute_custom_world_agent_action; -pub use fail_ai_task_and_return_procedure::fail_ai_task_and_return; -pub use finalize_custom_world_agent_message_turn_procedure::finalize_custom_world_agent_message_turn; -pub use finalize_puzzle_agent_message_turn_procedure::finalize_puzzle_agent_message_turn; -pub use generate_big_fish_asset_procedure::generate_big_fish_asset; -pub use get_battle_state_procedure::get_battle_state; -pub use get_big_fish_run_procedure::get_big_fish_run; -pub use get_big_fish_session_procedure::get_big_fish_session; -pub use get_chapter_progression_procedure::get_chapter_progression; -pub use get_custom_world_agent_card_detail_procedure::get_custom_world_agent_card_detail; -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_gallery_detail_by_code_procedure::get_custom_world_gallery_detail_by_code; -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_puzzle_agent_session_procedure::get_puzzle_agent_session; -pub use get_puzzle_gallery_detail_procedure::get_puzzle_gallery_detail; -pub use get_puzzle_run_procedure::get_puzzle_run; -pub use get_puzzle_work_detail_procedure::get_puzzle_work_detail; -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_big_fish_works_procedure::list_big_fish_works; -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_custom_world_works_procedure::list_custom_world_works; -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 list_puzzle_gallery_procedure::list_puzzle_gallery; -pub use list_puzzle_works_procedure::list_puzzle_works; -pub use publish_big_fish_game_procedure::publish_big_fish_game; -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 publish_puzzle_work_procedure::publish_puzzle_work; -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 save_puzzle_generated_images_procedure::save_puzzle_generated_images; -pub use select_puzzle_cover_image_procedure::select_puzzle_cover_image; -pub use start_big_fish_run_procedure::start_big_fish_run; -pub use start_puzzle_run_procedure::start_puzzle_run; +pub use story_session_type::StorySession; pub use submit_big_fish_input_procedure::submit_big_fish_input; pub use submit_big_fish_message_procedure::submit_big_fish_message; pub use submit_custom_world_agent_message_procedure::submit_custom_world_agent_message; pub use submit_puzzle_agent_message_procedure::submit_puzzle_agent_message; pub use swap_puzzle_pieces_procedure::swap_puzzle_pieces; +pub use treasure_interaction_action_type::TreasureInteractionAction; +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 unpublish_custom_world_profile_reducer::unpublish_custom_world_profile; pub use update_puzzle_work_procedure::update_puzzle_work; 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 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 upsert_runtime_snapshot_and_return_procedure::upsert_runtime_snapshot_and_return; +pub use user_browse_history_table::*; +pub use user_browse_history_type::UserBrowseHistory; #[derive(Clone, PartialEq, Debug)] @@ -911,81 +906,80 @@ pub use upsert_runtime_snapshot_and_return_procedure::upsert_runtime_snapshot_an /// 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; } @@ -993,9 +987,11 @@ 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", @@ -1004,7 +1000,9 @@ 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", @@ -1018,10 +1016,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, @@ -1145,14 +1143,14 @@ fn args_bsatn(&self) -> Result, __sats::bsatn::EncodeError> { }), _ => 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, @@ -1192,59 +1190,134 @@ pub struct DbUpdate { 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)?), - "big_fish_agent_message" => db_update.big_fish_agent_message.append(big_fish_agent_message_table::parse_table_update(table_update)?), - "big_fish_asset_slot" => db_update.big_fish_asset_slot.append(big_fish_asset_slot_table::parse_table_update(table_update)?), - "big_fish_creation_session" => db_update.big_fish_creation_session.append(big_fish_creation_session_table::parse_table_update(table_update)?), - "big_fish_runtime_run" => db_update.big_fish_runtime_run.append(big_fish_runtime_run_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)?), - "puzzle_agent_message" => db_update.puzzle_agent_message.append(puzzle_agent_message_table::parse_table_update(table_update)?), - "puzzle_agent_session" => db_update.puzzle_agent_session.append(puzzle_agent_session_table::parse_table_update(table_update)?), - "puzzle_runtime_run" => db_update.puzzle_runtime_run.append(puzzle_runtime_run_table::parse_table_update(table_update)?), - "puzzle_work_profile" => db_update.puzzle_work_profile.append(puzzle_work_profile_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)?), + "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)?), + "big_fish_agent_message" => db_update.big_fish_agent_message.append( + big_fish_agent_message_table::parse_table_update(table_update)?, + ), + "big_fish_asset_slot" => db_update + .big_fish_asset_slot + .append(big_fish_asset_slot_table::parse_table_update(table_update)?), + "big_fish_creation_session" => db_update.big_fish_creation_session.append( + big_fish_creation_session_table::parse_table_update(table_update)?, + ), + "big_fish_runtime_run" => db_update.big_fish_runtime_run.append( + big_fish_runtime_run_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)?, + ), + "puzzle_agent_message" => db_update.puzzle_agent_message.append( + puzzle_agent_message_table::parse_table_update(table_update)?, + ), + "puzzle_agent_session" => db_update.puzzle_agent_session.append( + puzzle_agent_session_table::parse_table_update(table_update)?, + ), + "puzzle_runtime_run" => db_update + .puzzle_runtime_run + .append(puzzle_runtime_run_table::parse_table_update(table_update)?), + "puzzle_work_profile" => db_update + .puzzle_work_profile + .append(puzzle_work_profile_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()); } } } @@ -1257,147 +1330,462 @@ 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(); - - 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.big_fish_agent_message = cache.apply_diff_to_table::("big_fish_agent_message", &self.big_fish_agent_message).with_updates_by_pk(|row| &row.message_id); - diff.big_fish_asset_slot = cache.apply_diff_to_table::("big_fish_asset_slot", &self.big_fish_asset_slot).with_updates_by_pk(|row| &row.slot_id); - diff.big_fish_creation_session = cache.apply_diff_to_table::("big_fish_creation_session", &self.big_fish_creation_session).with_updates_by_pk(|row| &row.session_id); - diff.big_fish_runtime_run = cache.apply_diff_to_table::("big_fish_runtime_run", &self.big_fish_runtime_run).with_updates_by_pk(|row| &row.run_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.puzzle_agent_message = cache.apply_diff_to_table::("puzzle_agent_message", &self.puzzle_agent_message).with_updates_by_pk(|row| &row.message_id); - diff.puzzle_agent_session = cache.apply_diff_to_table::("puzzle_agent_session", &self.puzzle_agent_session).with_updates_by_pk(|row| &row.session_id); - diff.puzzle_runtime_run = cache.apply_diff_to_table::("puzzle_runtime_run", &self.puzzle_runtime_run).with_updates_by_pk(|row| &row.run_id); - diff.puzzle_work_profile = cache.apply_diff_to_table::("puzzle_work_profile", &self.puzzle_work_profile).with_updates_by_pk(|row| &row.profile_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); + fn apply_to_client_cache( + &self, + cache: &mut __sdk::ClientCache, + ) -> AppliedDiff<'_> { + let mut diff = AppliedDiff::default(); - diff + 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.big_fish_agent_message = cache + .apply_diff_to_table::( + "big_fish_agent_message", + &self.big_fish_agent_message, + ) + .with_updates_by_pk(|row| &row.message_id); + diff.big_fish_asset_slot = cache + .apply_diff_to_table::( + "big_fish_asset_slot", + &self.big_fish_asset_slot, + ) + .with_updates_by_pk(|row| &row.slot_id); + diff.big_fish_creation_session = cache + .apply_diff_to_table::( + "big_fish_creation_session", + &self.big_fish_creation_session, + ) + .with_updates_by_pk(|row| &row.session_id); + diff.big_fish_runtime_run = cache + .apply_diff_to_table::( + "big_fish_runtime_run", + &self.big_fish_runtime_run, + ) + .with_updates_by_pk(|row| &row.run_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.puzzle_agent_message = cache + .apply_diff_to_table::( + "puzzle_agent_message", + &self.puzzle_agent_message, + ) + .with_updates_by_pk(|row| &row.message_id); + diff.puzzle_agent_session = cache + .apply_diff_to_table::( + "puzzle_agent_session", + &self.puzzle_agent_session, + ) + .with_updates_by_pk(|row| &row.session_id); + diff.puzzle_runtime_run = cache + .apply_diff_to_table::( + "puzzle_runtime_run", + &self.puzzle_runtime_run, + ) + .with_updates_by_pk(|row| &row.run_id); + diff.puzzle_work_profile = cache + .apply_diff_to_table::( + "puzzle_work_profile", + &self.puzzle_work_profile, + ) + .with_updates_by_pk(|row| &row.profile_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 + } + 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)?), + "big_fish_agent_message" => db_update + .big_fish_agent_message + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "big_fish_asset_slot" => db_update + .big_fish_asset_slot + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "big_fish_creation_session" => db_update + .big_fish_creation_session + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "big_fish_runtime_run" => db_update + .big_fish_runtime_run + .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)?), + "puzzle_agent_message" => db_update + .puzzle_agent_message + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "puzzle_agent_session" => db_update + .puzzle_agent_session + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "puzzle_runtime_run" => db_update + .puzzle_runtime_run + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "puzzle_work_profile" => db_update + .puzzle_work_profile + .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(), + ); } -fn parse_initial_rows(raw: __ws::v2::QueryRows) -> __sdk::Result { - let mut db_update = DbUpdate::default(); -for table_rows in raw.tables { + } + } + 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_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)?), - "big_fish_agent_message" => db_update.big_fish_agent_message.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), - "big_fish_asset_slot" => db_update.big_fish_asset_slot.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), - "big_fish_creation_session" => db_update.big_fish_creation_session.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), - "big_fish_runtime_run" => db_update.big_fish_runtime_run.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)?), - "puzzle_agent_message" => db_update.puzzle_agent_message.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), - "puzzle_agent_session" => db_update.puzzle_agent_session.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), - "puzzle_runtime_run" => db_update.puzzle_runtime_run.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), - "puzzle_work_profile" => db_update.puzzle_work_profile.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)?), - "big_fish_agent_message" => db_update.big_fish_agent_message.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), - "big_fish_asset_slot" => db_update.big_fish_asset_slot.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), - "big_fish_creation_session" => db_update.big_fish_creation_session.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), - "big_fish_runtime_run" => db_update.big_fish_runtime_run.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)?), - "puzzle_agent_message" => db_update.puzzle_agent_message.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), - "puzzle_agent_session" => db_update.puzzle_agent_session.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), - "puzzle_runtime_run" => db_update.puzzle_runtime_run.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), - "puzzle_work_profile" => db_update.puzzle_work_profile.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) -} + "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)?), + "big_fish_agent_message" => db_update + .big_fish_agent_message + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "big_fish_asset_slot" => db_update + .big_fish_asset_slot + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "big_fish_creation_session" => db_update + .big_fish_creation_session + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "big_fish_runtime_run" => db_update + .big_fish_runtime_run + .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)?), + "puzzle_agent_message" => db_update + .puzzle_agent_message + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "puzzle_agent_session" => db_update + .puzzle_agent_session + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "puzzle_runtime_run" => db_update + .puzzle_runtime_run + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "puzzle_work_profile" => db_update + .puzzle_work_profile + .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>, @@ -1438,54 +1826,192 @@ 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::("big_fish_agent_message", &self.big_fish_agent_message, event); - callbacks.invoke_table_row_callbacks::("big_fish_asset_slot", &self.big_fish_asset_slot, event); - callbacks.invoke_table_row_callbacks::("big_fish_creation_session", &self.big_fish_creation_session, event); - callbacks.invoke_table_row_callbacks::("big_fish_runtime_run", &self.big_fish_runtime_run, 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::( + "big_fish_agent_message", + &self.big_fish_agent_message, + event, + ); + callbacks.invoke_table_row_callbacks::( + "big_fish_asset_slot", + &self.big_fish_asset_slot, + event, + ); + callbacks.invoke_table_row_callbacks::( + "big_fish_creation_session", + &self.big_fish_creation_session, + event, + ); + callbacks.invoke_table_row_callbacks::( + "big_fish_runtime_run", + &self.big_fish_runtime_run, + 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_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::("puzzle_agent_message", &self.puzzle_agent_message, event); - callbacks.invoke_table_row_callbacks::("puzzle_agent_session", &self.puzzle_agent_session, event); - callbacks.invoke_table_row_callbacks::("puzzle_runtime_run", &self.puzzle_runtime_run, event); - callbacks.invoke_table_row_callbacks::("puzzle_work_profile", &self.puzzle_work_profile, 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::( + "puzzle_agent_message", + &self.puzzle_agent_message, + event, + ); + callbacks.invoke_table_row_callbacks::( + "puzzle_agent_session", + &self.puzzle_agent_session, + event, + ); + callbacks.invoke_table_row_callbacks::( + "puzzle_runtime_run", + &self.puzzle_runtime_run, + event, + ); + callbacks.invoke_table_row_callbacks::( + "puzzle_work_profile", + &self.puzzle_work_profile, + 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::("runtime_snapshot", &self.runtime_snapshot, 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)] @@ -1534,10 +2060,16 @@ 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, @@ -1724,7 +2256,6 @@ 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, @@ -1732,17 +2263,23 @@ 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< - DbView = RemoteTables, - Reducers = RemoteReducers, - SubscriptionBuilder = __sdk::SubscriptionBuilder, -> {} -impl, ->> RemoteDbContext for Ctx {} - +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 +{ +} /// An [`__sdk::DbContext`] augmented with a [`__sdk::Event`], /// passed to [`__sdk::Table::on_insert`], [`__sdk::Table::on_delete`] and [`__sdk::TableWithPrimaryKey::on_update`] callbacks. @@ -2117,7 +2654,6 @@ impl __sdk::DbContext for ErrorContext { impl __sdk::ErrorContext for ErrorContext {} impl __sdk::SpacetimeModule for RemoteModule { - type DbConnection = DbConnection; type EventContext = EventContext; type ReducerEventContext = ReducerEventContext; @@ -2133,8 +2669,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); @@ -2172,9 +2708,9 @@ fn register_tables(client_cache: &mut __sdk::ClientCache) { 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", @@ -2212,5 +2748,5 @@ const ALL_TABLE_NAMES: &'static [&'static str] = &[ "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 1682f3ac..d5f16a3f 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -15,12 +10,10 @@ 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 fc8ca1c9..c276f969 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -19,8 +14,6 @@ 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 e891d6a9..dc8e8819 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -16,12 +11,8 @@ 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 ef11fa63..383dce2a 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -15,12 +10,10 @@ 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 d457b697..83624807 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,16 +2,11 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; -use super::npc_interaction_status_type::NpcInteractionStatus; use super::npc_interaction_battle_mode_type::NpcInteractionBattleMode; +use super::npc_interaction_status_type::NpcInteractionStatus; +use super::npc_state_snapshot_type::NpcStateSnapshot; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] @@ -20,16 +15,14 @@ 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 cba6b5ac..8032abf9 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -24,12 +19,8 @@ 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 2a45f52c..48e8ac70 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -22,12 +17,8 @@ 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 cccb0cc5..b6bbc07d 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -18,8 +13,6 @@ 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 cc79b8c5..9c6d2c1e 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -22,12 +17,8 @@ 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 5a0d7497..73177673 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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,13 +12,11 @@ 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 39a8ed60..c4e60bef 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -15,12 +10,10 @@ 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 c11e0ef8..351b45ae 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -25,18 +20,16 @@ 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 917742d6..26e7fcf5 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,15 +2,10 @@ // WILL NOT BE 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`. /// @@ -51,8 +46,12 @@ 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; @@ -98,39 +97,38 @@ 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>, - } +/// 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, - } - } +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) + } +} - 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); } @@ -140,26 +138,24 @@ 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; - } - - impl npc_stateQueryTableAccess for __sdk::QueryTableAccessor { - fn npc_state(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("npc_state") - } - } +#[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") + } +} 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 9e8f87ae..1ddeec42 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -25,22 +20,20 @@ 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. @@ -55,11 +48,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, @@ -79,15 +72,26 @@ 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"), - } } } @@ -107,11 +111,12 @@ 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 ff59315a..c31346e7 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -22,17 +17,15 @@ 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 eb031dc3..a4dd27f5 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -16,8 +10,6 @@ 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 66a8696c..b5761753 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -20,8 +15,6 @@ 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 c45b9dd6..bf3ae257 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -16,12 +11,8 @@ 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 0f3686ec..413c1208 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -15,12 +10,10 @@ 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 116938c5..1361178e 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -20,13 +15,11 @@ 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 27262e2f..66961930 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,14 +2,9 @@ // WILL NOT BE 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::player_progression_type::PlayerProgression; use super::player_progression_grant_source_type::PlayerProgressionGrantSource; +use super::player_progression_type::PlayerProgression; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; /// Table handle for the table `player_progression`. /// @@ -37,7 +32,9 @@ 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, } } @@ -50,8 +47,12 @@ 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; @@ -97,39 +98,38 @@ 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>, - } +/// 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, - } - } +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) + } +} - 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,26 +139,24 @@ 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; - } - - impl player_progressionQueryTableAccess for __sdk::QueryTableAccessor { - fn player_progression(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("player_progression") - } - } +#[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") + } +} 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 04af99cc..c734d1c2 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -20,17 +15,15 @@ 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. @@ -41,7 +34,8 @@ 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, } @@ -56,10 +50,12 @@ 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"), - } } } @@ -76,10 +72,8 @@ 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 4e1d2abd..c79f8b0c 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,13 +2,8 @@ // WILL NOT BE 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`. /// @@ -36,7 +31,9 @@ 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, } } @@ -49,8 +46,12 @@ 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; @@ -96,39 +97,38 @@ 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>, - } +/// 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, - } - } +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) + } +} - 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,26 +138,24 @@ 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; - } - - impl profile_dashboard_stateQueryTableAccess for __sdk::QueryTableAccessor { - fn profile_dashboard_state(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("profile_dashboard_state") - } - } +#[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") + } +} 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 3abd8b06..e5124048 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -20,12 +14,10 @@ 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. @@ -46,7 +38,6 @@ 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"), - } } } @@ -63,10 +54,8 @@ 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 944de27b..0f147bd5 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,13 +2,8 @@ // WILL NOT BE 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`. /// @@ -36,7 +31,9 @@ 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, } } @@ -49,8 +46,12 @@ 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; @@ -96,39 +97,38 @@ 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>, - } +/// 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, - } - } +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) + } +} - 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,26 +138,24 @@ 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; - } - - impl profile_played_worldQueryTableAccess for __sdk::QueryTableAccessor { - fn profile_played_world(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("profile_played_world") - } - } +#[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") + } +} 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 b58b66c1..3b94036c 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -16,9 +10,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, @@ -26,12 +20,10 @@ 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. @@ -39,9 +31,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, @@ -63,8 +55,10 @@ 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", + ), } } } @@ -83,10 +77,8 @@ 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 index 4d503269..fc9c83e1 100644 --- 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 @@ -2,13 +2,8 @@ // WILL NOT BE 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; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; /// Table handle for the table `profile_save_archive`. /// @@ -36,7 +31,9 @@ pub trait ProfileSaveArchiveTableAccess { impl ProfileSaveArchiveTableAccess for super::RemoteTables { fn profile_save_archive(&self) -> ProfileSaveArchiveTableHandle<'_> { ProfileSaveArchiveTableHandle { - imp: self.imp.get_table::("profile_save_archive"), + imp: self + .imp + .get_table::("profile_save_archive"), ctx: std::marker::PhantomData, } } @@ -49,8 +46,12 @@ 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() } + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } type InsertCallbackId = ProfileSaveArchiveInsertCallbackId; @@ -96,39 +97,38 @@ impl<'ctx> __sdk::TableWithPrimaryKey for ProfileSaveArchiveTableHandle<'ctx> { } } - /// 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>, - } +/// 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> 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) + } +} - 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); } @@ -138,26 +138,24 @@ 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 `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") - } - } +#[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 index f11c6024..5244fe4e 100644 --- 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 @@ -2,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -16,27 +10,25 @@ 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 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 cover_image_src: Option, pub saved_at: __sdk::Timestamp, pub bottom_tab: String, pub game_state_json: String, - pub current_story_json: Option::, + 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. @@ -44,17 +36,17 @@ 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 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 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 current_story_json: __sdk::__query_builder::Col>, pub created_at: __sdk::__query_builder::Col, pub updated_at: __sdk::__query_builder::Col, } @@ -79,7 +71,6 @@ impl __sdk::__query_builder::HasCols for ProfileSaveArchive { 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"), - } } } @@ -98,10 +89,8 @@ impl __sdk::__query_builder::HasIxCols for ProfileSaveArchive { 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 1dab9684..48705ae9 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,14 +2,9 @@ // WILL NOT BE 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`. /// @@ -37,7 +32,9 @@ 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, } } @@ -50,8 +47,12 @@ 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; @@ -97,39 +98,38 @@ 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>, - } +/// 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, - } - } +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) + } +} - 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,26 +139,24 @@ 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; - } - - impl profile_wallet_ledgerQueryTableAccess for __sdk::QueryTableAccessor { - fn profile_wallet_ledger(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("profile_wallet_ledger") - } - } +#[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") + } +} 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 b5535645..78364d5a 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -22,12 +17,10 @@ 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. @@ -36,7 +29,8 @@ 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, } @@ -50,7 +44,6 @@ 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"), - } } } @@ -69,10 +62,8 @@ 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_big_fish_game_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/publish_big_fish_game_procedure.rs index 6a2bfdd8..d4507ad8 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/publish_big_fish_game_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/publish_big_fish_game_procedure.rs @@ -2,23 +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::big_fish_session_procedure_result_type::BigFishSessionProcedureResult; use super::big_fish_publish_input_type::BigFishPublishInput; +use super::big_fish_session_procedure_result_type::BigFishSessionProcedureResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] - struct PublishBigFishGameArgs { +struct PublishBigFishGameArgs { pub input: BigFishPublishInput, } - impl __sdk::InModule for PublishBigFishGameArgs { type Module = super::RemoteModule; } @@ -28,16 +22,19 @@ impl __sdk::InModule for PublishBigFishGameArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait publish_big_fish_game { - fn publish_big_fish_game(&self, input: BigFishPublishInput, -) { - self.publish_big_fish_game_then(input, |_, _| {}); + fn publish_big_fish_game(&self, input: BigFishPublishInput) { + self.publish_big_fish_game_then(input, |_, _| {}); } fn publish_big_fish_game_then( &self, input: BigFishPublishInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -46,13 +43,17 @@ impl publish_big_fish_game for super::RemoteProcedures { &self, input: BigFishPublishInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { - self.imp.invoke_procedure_with_callback::<_, BigFishSessionProcedureResult>( - "publish_big_fish_game", - PublishBigFishGameArgs { input, }, - __callback, - ); + self.imp + .invoke_procedure_with_callback::<_, BigFishSessionProcedureResult>( + "publish_big_fish_game", + PublishBigFishGameArgs { input }, + __callback, + ); } } - 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 2dcaf010..d5741922 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,23 +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_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; } @@ -28,16 +22,19 @@ 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, ); } @@ -46,13 +43,17 @@ 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 f6d34d5c..2e2f71f6 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -19,10 +14,8 @@ 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 { @@ -40,9 +33,11 @@ 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, @@ -55,9 +50,11 @@ pub trait publish_custom_world_profile { &self, input: CustomWorldProfilePublishInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + Send + + 'static, ) -> __sdk::Result<()>; } @@ -66,11 +63,13 @@ impl publish_custom_world_profile for super::RemoteReducers { &self, input: CustomWorldProfilePublishInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + 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 083034b9..42c76aad 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,23 +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_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; } @@ -28,16 +22,19 @@ 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, ); } @@ -46,13 +43,17 @@ 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/publish_puzzle_work_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/publish_puzzle_work_procedure.rs index 4592d939..932b66d6 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/publish_puzzle_work_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/publish_puzzle_work_procedure.rs @@ -2,23 +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::puzzle_work_procedure_result_type::PuzzleWorkProcedureResult; use super::puzzle_publish_input_type::PuzzlePublishInput; +use super::puzzle_work_procedure_result_type::PuzzleWorkProcedureResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] - struct PublishPuzzleWorkArgs { +struct PublishPuzzleWorkArgs { pub input: PuzzlePublishInput, } - impl __sdk::InModule for PublishPuzzleWorkArgs { type Module = super::RemoteModule; } @@ -28,16 +22,19 @@ impl __sdk::InModule for PublishPuzzleWorkArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait publish_puzzle_work { - fn publish_puzzle_work(&self, input: PuzzlePublishInput, -) { - self.publish_puzzle_work_then(input, |_, _| {}); + fn publish_puzzle_work(&self, input: PuzzlePublishInput) { + self.publish_puzzle_work_then(input, |_, _| {}); } fn publish_puzzle_work_then( &self, input: PuzzlePublishInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -46,13 +43,17 @@ impl publish_puzzle_work for super::RemoteProcedures { &self, input: PuzzlePublishInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { - self.imp.invoke_procedure_with_callback::<_, PuzzleWorkProcedureResult>( - "publish_puzzle_work", - PublishPuzzleWorkArgs { input, }, - __callback, - ); + self.imp + .invoke_procedure_with_callback::<_, PuzzleWorkProcedureResult>( + "publish_puzzle_work", + PublishPuzzleWorkArgs { input }, + __callback, + ); } } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_message_finalize_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_message_finalize_input_type.rs index 22dfb32e..486919f2 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_message_finalize_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_message_finalize_input_type.rs @@ -2,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::puzzle_agent_stage_type::PuzzleAgentStage; @@ -16,17 +11,15 @@ use super::puzzle_agent_stage_type::PuzzleAgentStage; pub struct PuzzleAgentMessageFinalizeInput { pub session_id: String, pub owner_user_id: String, - pub assistant_message_id: Option::, - pub assistant_reply_text: Option::, + pub assistant_message_id: Option, + pub assistant_reply_text: Option, pub stage: PuzzleAgentStage, pub progress_percent: u32, pub anchor_pack_json: String, - pub error_message: Option::, + pub error_message: Option, pub updated_at_micros: i64, } - impl __sdk::InModule for PuzzleAgentMessageFinalizeInput { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_message_kind_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_message_kind_type.rs index 56f8df2d..ca46edeb 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_message_kind_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_message_kind_type.rs @@ -2,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -20,12 +15,8 @@ pub enum PuzzleAgentMessageKind { ActionResult, Warning, - } - - impl __sdk::InModule for PuzzleAgentMessageKind { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_message_role_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_message_role_type.rs index b34f41c4..5dd7eb51 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_message_role_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_message_role_type.rs @@ -2,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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,12 +13,8 @@ pub enum PuzzleAgentMessageRole { Assistant, System, - } - - impl __sdk::InModule for PuzzleAgentMessageRole { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_message_row_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_message_row_type.rs index ceb74765..b0bb85f2 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_message_row_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_message_row_type.rs @@ -2,15 +2,10 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::puzzle_agent_message_role_type::PuzzleAgentMessageRole; use super::puzzle_agent_message_kind_type::PuzzleAgentMessageKind; +use super::puzzle_agent_message_role_type::PuzzleAgentMessageRole; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] @@ -23,12 +18,10 @@ pub struct PuzzleAgentMessageRow { pub created_at: __sdk::Timestamp, } - impl __sdk::InModule for PuzzleAgentMessageRow { type Module = super::RemoteModule; } - /// Column accessor struct for the table `PuzzleAgentMessageRow`. /// /// Provides typed access to columns for query building. @@ -51,7 +44,6 @@ impl __sdk::__query_builder::HasCols for PuzzleAgentMessageRow { kind: __sdk::__query_builder::Col::new(table_name, "kind"), text: __sdk::__query_builder::Col::new(table_name, "text"), created_at: __sdk::__query_builder::Col::new(table_name, "created_at"), - } } } @@ -70,10 +62,8 @@ impl __sdk::__query_builder::HasIxCols for PuzzleAgentMessageRow { PuzzleAgentMessageRowIxCols { 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 PuzzleAgentMessageRow {} - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_message_submit_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_message_submit_input_type.rs index 3a9fa169..93086643 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_message_submit_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_message_submit_input_type.rs @@ -2,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -20,8 +14,6 @@ pub struct PuzzleAgentMessageSubmitInput { pub submitted_at_micros: i64, } - impl __sdk::InModule for PuzzleAgentMessageSubmitInput { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_message_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_message_table.rs index e282d9e9..0f54e13b 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_message_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_message_table.rs @@ -2,15 +2,10 @@ // WILL NOT BE 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::puzzle_agent_message_row_type::PuzzleAgentMessageRow; -use super::puzzle_agent_message_role_type::PuzzleAgentMessageRole; use super::puzzle_agent_message_kind_type::PuzzleAgentMessageKind; +use super::puzzle_agent_message_role_type::PuzzleAgentMessageRole; +use super::puzzle_agent_message_row_type::PuzzleAgentMessageRow; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; /// Table handle for the table `puzzle_agent_message`. /// @@ -38,7 +33,9 @@ pub trait PuzzleAgentMessageTableAccess { impl PuzzleAgentMessageTableAccess for super::RemoteTables { fn puzzle_agent_message(&self) -> PuzzleAgentMessageTableHandle<'_> { PuzzleAgentMessageTableHandle { - imp: self.imp.get_table::("puzzle_agent_message"), + imp: self + .imp + .get_table::("puzzle_agent_message"), ctx: std::marker::PhantomData, } } @@ -51,8 +48,12 @@ impl<'ctx> __sdk::Table for PuzzleAgentMessageTableHandle<'ctx> { type Row = PuzzleAgentMessageRow; 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 = PuzzleAgentMessageInsertCallbackId; @@ -98,39 +99,38 @@ impl<'ctx> __sdk::TableWithPrimaryKey for PuzzleAgentMessageTableHandle<'ctx> { } } - /// Access to the `message_id` unique index on the table `puzzle_agent_message`, - /// which allows point queries on the field of the same name - /// via the [`PuzzleAgentMessageMessageIdUnique::find`] method. - /// - /// Users are encouraged not to explicitly reference this type, - /// but to directly chain method calls, - /// like `ctx.db.puzzle_agent_message().message_id().find(...)`. - pub struct PuzzleAgentMessageMessageIdUnique<'ctx> { - imp: __sdk::UniqueConstraintHandle, - phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, - } +/// Access to the `message_id` unique index on the table `puzzle_agent_message`, +/// which allows point queries on the field of the same name +/// via the [`PuzzleAgentMessageMessageIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.puzzle_agent_message().message_id().find(...)`. +pub struct PuzzleAgentMessageMessageIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} - impl<'ctx> PuzzleAgentMessageTableHandle<'ctx> { - /// Get a handle on the `message_id` unique index on the table `puzzle_agent_message`. - pub fn message_id(&self) -> PuzzleAgentMessageMessageIdUnique<'ctx> { - PuzzleAgentMessageMessageIdUnique { - imp: self.imp.get_unique_constraint::("message_id"), - phantom: std::marker::PhantomData, - } - } +impl<'ctx> PuzzleAgentMessageTableHandle<'ctx> { + /// Get a handle on the `message_id` unique index on the table `puzzle_agent_message`. + pub fn message_id(&self) -> PuzzleAgentMessageMessageIdUnique<'ctx> { + PuzzleAgentMessageMessageIdUnique { + imp: self.imp.get_unique_constraint::("message_id"), + phantom: std::marker::PhantomData, } + } +} + +impl<'ctx> PuzzleAgentMessageMessageIdUnique<'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> PuzzleAgentMessageMessageIdUnique<'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::("puzzle_agent_message"); _table.add_unique_constraint::("message_id", |row| &row.message_id); } @@ -140,26 +140,24 @@ 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 `PuzzleAgentMessageRow`. - /// - /// Implemented for [`__sdk::QueryTableAccessor`]. - pub trait puzzle_agent_messageQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `PuzzleAgentMessageRow`. - fn puzzle_agent_message(&self) -> __sdk::__query_builder::Table; - } - - impl puzzle_agent_messageQueryTableAccess for __sdk::QueryTableAccessor { - fn puzzle_agent_message(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("puzzle_agent_message") - } - } +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `PuzzleAgentMessageRow`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait puzzle_agent_messageQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `PuzzleAgentMessageRow`. + fn puzzle_agent_message(&self) -> __sdk::__query_builder::Table; +} +impl puzzle_agent_messageQueryTableAccess for __sdk::QueryTableAccessor { + fn puzzle_agent_message(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("puzzle_agent_message") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_session_create_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_session_create_input_type.rs index f07fcd6b..c3ccc7d2 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_session_create_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_session_create_input_type.rs @@ -2,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -21,8 +15,6 @@ pub struct PuzzleAgentSessionCreateInput { pub created_at_micros: i64, } - impl __sdk::InModule for PuzzleAgentSessionCreateInput { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_session_get_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_session_get_input_type.rs index e411bead..af4159c6 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_session_get_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_session_get_input_type.rs @@ -2,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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 +11,6 @@ pub struct PuzzleAgentSessionGetInput { pub owner_user_id: String, } - impl __sdk::InModule for PuzzleAgentSessionGetInput { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_session_procedure_result_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_session_procedure_result_type.rs index f19f290d..39506659 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_session_procedure_result_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_session_procedure_result_type.rs @@ -2,24 +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}; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] pub struct PuzzleAgentSessionProcedureResult { pub ok: bool, - pub session_json: Option::, - pub error_message: Option::, + pub session_json: Option, + pub error_message: Option, } - impl __sdk::InModule for PuzzleAgentSessionProcedureResult { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_session_row_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_session_row_type.rs index 96e98e56..e056ada1 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_session_row_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_session_row_type.rs @@ -2,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::puzzle_agent_stage_type::PuzzleAgentStage; @@ -21,19 +16,17 @@ pub struct PuzzleAgentSessionRow { pub progress_percent: u32, pub stage: PuzzleAgentStage, pub anchor_pack_json: String, - pub draft_json: Option::, - pub last_assistant_reply: Option::, - pub published_profile_id: Option::, + pub draft_json: Option, + pub last_assistant_reply: Option, + pub published_profile_id: Option, pub created_at: __sdk::Timestamp, pub updated_at: __sdk::Timestamp, } - impl __sdk::InModule for PuzzleAgentSessionRow { type Module = super::RemoteModule; } - /// Column accessor struct for the table `PuzzleAgentSessionRow`. /// /// Provides typed access to columns for query building. @@ -45,9 +38,9 @@ pub struct PuzzleAgentSessionRowCols { pub progress_percent: __sdk::__query_builder::Col, pub stage: __sdk::__query_builder::Col, pub anchor_pack_json: __sdk::__query_builder::Col, - pub draft_json: __sdk::__query_builder::Col>, - pub last_assistant_reply: __sdk::__query_builder::Col>, - pub published_profile_id: __sdk::__query_builder::Col>, + pub draft_json: __sdk::__query_builder::Col>, + pub last_assistant_reply: __sdk::__query_builder::Col>, + pub published_profile_id: __sdk::__query_builder::Col>, pub created_at: __sdk::__query_builder::Col, pub updated_at: __sdk::__query_builder::Col, } @@ -64,11 +57,16 @@ impl __sdk::__query_builder::HasCols for PuzzleAgentSessionRow { stage: __sdk::__query_builder::Col::new(table_name, "stage"), anchor_pack_json: __sdk::__query_builder::Col::new(table_name, "anchor_pack_json"), draft_json: __sdk::__query_builder::Col::new(table_name, "draft_json"), - last_assistant_reply: __sdk::__query_builder::Col::new(table_name, "last_assistant_reply"), - published_profile_id: __sdk::__query_builder::Col::new(table_name, "published_profile_id"), + last_assistant_reply: __sdk::__query_builder::Col::new( + table_name, + "last_assistant_reply", + ), + published_profile_id: __sdk::__query_builder::Col::new( + table_name, + "published_profile_id", + ), created_at: __sdk::__query_builder::Col::new(table_name, "created_at"), updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"), - } } } @@ -87,10 +85,8 @@ impl __sdk::__query_builder::HasIxCols for PuzzleAgentSessionRow { PuzzleAgentSessionRowIxCols { 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 PuzzleAgentSessionRow {} - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_session_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_session_table.rs index 0272d915..08c05360 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_session_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_session_table.rs @@ -2,14 +2,9 @@ // WILL NOT BE 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::puzzle_agent_session_row_type::PuzzleAgentSessionRow; use super::puzzle_agent_stage_type::PuzzleAgentStage; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; /// Table handle for the table `puzzle_agent_session`. /// @@ -37,7 +32,9 @@ pub trait PuzzleAgentSessionTableAccess { impl PuzzleAgentSessionTableAccess for super::RemoteTables { fn puzzle_agent_session(&self) -> PuzzleAgentSessionTableHandle<'_> { PuzzleAgentSessionTableHandle { - imp: self.imp.get_table::("puzzle_agent_session"), + imp: self + .imp + .get_table::("puzzle_agent_session"), ctx: std::marker::PhantomData, } } @@ -50,8 +47,12 @@ impl<'ctx> __sdk::Table for PuzzleAgentSessionTableHandle<'ctx> { type Row = PuzzleAgentSessionRow; 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 = PuzzleAgentSessionInsertCallbackId; @@ -97,39 +98,38 @@ impl<'ctx> __sdk::TableWithPrimaryKey for PuzzleAgentSessionTableHandle<'ctx> { } } - /// Access to the `session_id` unique index on the table `puzzle_agent_session`, - /// which allows point queries on the field of the same name - /// via the [`PuzzleAgentSessionSessionIdUnique::find`] method. - /// - /// Users are encouraged not to explicitly reference this type, - /// but to directly chain method calls, - /// like `ctx.db.puzzle_agent_session().session_id().find(...)`. - pub struct PuzzleAgentSessionSessionIdUnique<'ctx> { - imp: __sdk::UniqueConstraintHandle, - phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, - } +/// Access to the `session_id` unique index on the table `puzzle_agent_session`, +/// which allows point queries on the field of the same name +/// via the [`PuzzleAgentSessionSessionIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.puzzle_agent_session().session_id().find(...)`. +pub struct PuzzleAgentSessionSessionIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} - impl<'ctx> PuzzleAgentSessionTableHandle<'ctx> { - /// Get a handle on the `session_id` unique index on the table `puzzle_agent_session`. - pub fn session_id(&self) -> PuzzleAgentSessionSessionIdUnique<'ctx> { - PuzzleAgentSessionSessionIdUnique { - imp: self.imp.get_unique_constraint::("session_id"), - phantom: std::marker::PhantomData, - } - } +impl<'ctx> PuzzleAgentSessionTableHandle<'ctx> { + /// Get a handle on the `session_id` unique index on the table `puzzle_agent_session`. + pub fn session_id(&self) -> PuzzleAgentSessionSessionIdUnique<'ctx> { + PuzzleAgentSessionSessionIdUnique { + imp: self.imp.get_unique_constraint::("session_id"), + phantom: std::marker::PhantomData, } + } +} + +impl<'ctx> PuzzleAgentSessionSessionIdUnique<'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> PuzzleAgentSessionSessionIdUnique<'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::("puzzle_agent_session"); _table.add_unique_constraint::("session_id", |row| &row.session_id); } @@ -139,26 +139,24 @@ 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 `PuzzleAgentSessionRow`. - /// - /// Implemented for [`__sdk::QueryTableAccessor`]. - pub trait puzzle_agent_sessionQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `PuzzleAgentSessionRow`. - fn puzzle_agent_session(&self) -> __sdk::__query_builder::Table; - } - - impl puzzle_agent_sessionQueryTableAccess for __sdk::QueryTableAccessor { - fn puzzle_agent_session(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("puzzle_agent_session") - } - } +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `PuzzleAgentSessionRow`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait puzzle_agent_sessionQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `PuzzleAgentSessionRow`. + fn puzzle_agent_session(&self) -> __sdk::__query_builder::Table; +} +impl puzzle_agent_sessionQueryTableAccess for __sdk::QueryTableAccessor { + fn puzzle_agent_session(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("puzzle_agent_session") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_stage_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_stage_type.rs index 00cbc81b..9d41ea54 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_stage_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_stage_type.rs @@ -2,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -22,12 +17,8 @@ pub enum PuzzleAgentStage { ReadyToPublish, Published, - } - - impl __sdk::InModule for PuzzleAgentStage { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_draft_compile_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_draft_compile_input_type.rs index 703538e4..3b5f565f 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_draft_compile_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_draft_compile_input_type.rs @@ -2,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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,8 +12,6 @@ pub struct PuzzleDraftCompileInput { pub compiled_at_micros: i64, } - impl __sdk::InModule for PuzzleDraftCompileInput { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_generated_images_save_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_generated_images_save_input_type.rs index 0c2196b4..8c409aed 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_generated_images_save_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_generated_images_save_input_type.rs @@ -2,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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 +13,6 @@ pub struct PuzzleGeneratedImagesSaveInput { pub saved_at_micros: i64, } - impl __sdk::InModule for PuzzleGeneratedImagesSaveInput { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_publication_status_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_publication_status_type.rs index 7ff8b5c6..38ece3cf 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_publication_status_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_publication_status_type.rs @@ -2,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -16,12 +11,8 @@ pub enum PuzzlePublicationStatus { Draft, Published, - } - - impl __sdk::InModule for PuzzlePublicationStatus { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_publish_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_publish_input_type.rs index d3a5d26d..83cbc37c 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_publish_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_publish_input_type.rs @@ -2,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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,14 +12,12 @@ pub struct PuzzlePublishInput { pub work_id: String, pub profile_id: String, pub author_display_name: String, - pub level_name: Option::, - pub summary: Option::, - pub theme_tags: Option::>, + pub level_name: Option, + pub summary: Option, + pub theme_tags: Option>, pub published_at_micros: i64, } - impl __sdk::InModule for PuzzlePublishInput { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_run_drag_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_run_drag_input_type.rs index 753e2932..b5036117 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_run_drag_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_run_drag_input_type.rs @@ -2,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -21,8 +15,6 @@ pub struct PuzzleRunDragInput { pub dragged_at_micros: i64, } - impl __sdk::InModule for PuzzleRunDragInput { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_run_get_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_run_get_input_type.rs index cf15f8b3..b3961e57 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_run_get_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_run_get_input_type.rs @@ -2,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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 +11,6 @@ pub struct PuzzleRunGetInput { pub owner_user_id: String, } - impl __sdk::InModule for PuzzleRunGetInput { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_run_next_level_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_run_next_level_input_type.rs index d6a9a285..18258482 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_run_next_level_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_run_next_level_input_type.rs @@ -2,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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,8 +12,6 @@ pub struct PuzzleRunNextLevelInput { pub advanced_at_micros: i64, } - impl __sdk::InModule for PuzzleRunNextLevelInput { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_run_procedure_result_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_run_procedure_result_type.rs index 215490dc..54f6349b 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_run_procedure_result_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_run_procedure_result_type.rs @@ -2,24 +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}; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] pub struct PuzzleRunProcedureResult { pub ok: bool, - pub run_json: Option::, - pub error_message: Option::, + pub run_json: Option, + pub error_message: Option, } - impl __sdk::InModule for PuzzleRunProcedureResult { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_run_start_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_run_start_input_type.rs index 55e0a93e..7b4bed29 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_run_start_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_run_start_input_type.rs @@ -2,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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 +13,6 @@ pub struct PuzzleRunStartInput { pub started_at_micros: i64, } - impl __sdk::InModule for PuzzleRunStartInput { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_run_swap_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_run_swap_input_type.rs index 3b5baa18..e92ca711 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_run_swap_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_run_swap_input_type.rs @@ -2,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -20,8 +14,6 @@ pub struct PuzzleRunSwapInput { pub swapped_at_micros: i64, } - impl __sdk::InModule for PuzzleRunSwapInput { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_runtime_run_row_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_runtime_run_row_type.rs index daf67f5b..e610dfbf 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_runtime_run_row_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_runtime_run_row_type.rs @@ -2,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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,12 +21,10 @@ pub struct PuzzleRuntimeRunRow { pub updated_at: __sdk::Timestamp, } - impl __sdk::InModule for PuzzleRuntimeRunRow { type Module = super::RemoteModule; } - /// Column accessor struct for the table `PuzzleRuntimeRunRow`. /// /// Provides typed access to columns for query building. @@ -59,15 +51,26 @@ impl __sdk::__query_builder::HasCols for PuzzleRuntimeRunRow { owner_user_id: __sdk::__query_builder::Col::new(table_name, "owner_user_id"), entry_profile_id: __sdk::__query_builder::Col::new(table_name, "entry_profile_id"), current_profile_id: __sdk::__query_builder::Col::new(table_name, "current_profile_id"), - cleared_level_count: __sdk::__query_builder::Col::new(table_name, "cleared_level_count"), - current_level_index: __sdk::__query_builder::Col::new(table_name, "current_level_index"), + cleared_level_count: __sdk::__query_builder::Col::new( + table_name, + "cleared_level_count", + ), + current_level_index: __sdk::__query_builder::Col::new( + table_name, + "current_level_index", + ), current_grid_size: __sdk::__query_builder::Col::new(table_name, "current_grid_size"), - played_profile_ids_json: __sdk::__query_builder::Col::new(table_name, "played_profile_ids_json"), - previous_level_tags_json: __sdk::__query_builder::Col::new(table_name, "previous_level_tags_json"), + played_profile_ids_json: __sdk::__query_builder::Col::new( + table_name, + "played_profile_ids_json", + ), + previous_level_tags_json: __sdk::__query_builder::Col::new( + table_name, + "previous_level_tags_json", + ), snapshot_json: __sdk::__query_builder::Col::new(table_name, "snapshot_json"), created_at: __sdk::__query_builder::Col::new(table_name, "created_at"), updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"), - } } } @@ -86,10 +89,8 @@ impl __sdk::__query_builder::HasIxCols for PuzzleRuntimeRunRow { PuzzleRuntimeRunRowIxCols { owner_user_id: __sdk::__query_builder::IxCol::new(table_name, "owner_user_id"), run_id: __sdk::__query_builder::IxCol::new(table_name, "run_id"), - } } } impl __sdk::__query_builder::CanBeLookupTable for PuzzleRuntimeRunRow {} - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_runtime_run_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_runtime_run_table.rs index 5447392d..1cd988cc 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_runtime_run_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_runtime_run_table.rs @@ -2,13 +2,8 @@ // WILL NOT BE 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::puzzle_runtime_run_row_type::PuzzleRuntimeRunRow; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; /// Table handle for the table `puzzle_runtime_run`. /// @@ -36,7 +31,9 @@ pub trait PuzzleRuntimeRunTableAccess { impl PuzzleRuntimeRunTableAccess for super::RemoteTables { fn puzzle_runtime_run(&self) -> PuzzleRuntimeRunTableHandle<'_> { PuzzleRuntimeRunTableHandle { - imp: self.imp.get_table::("puzzle_runtime_run"), + imp: self + .imp + .get_table::("puzzle_runtime_run"), ctx: std::marker::PhantomData, } } @@ -49,8 +46,12 @@ impl<'ctx> __sdk::Table for PuzzleRuntimeRunTableHandle<'ctx> { type Row = PuzzleRuntimeRunRow; 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 = PuzzleRuntimeRunInsertCallbackId; @@ -96,39 +97,38 @@ impl<'ctx> __sdk::TableWithPrimaryKey for PuzzleRuntimeRunTableHandle<'ctx> { } } - /// Access to the `run_id` unique index on the table `puzzle_runtime_run`, - /// which allows point queries on the field of the same name - /// via the [`PuzzleRuntimeRunRunIdUnique::find`] method. - /// - /// Users are encouraged not to explicitly reference this type, - /// but to directly chain method calls, - /// like `ctx.db.puzzle_runtime_run().run_id().find(...)`. - pub struct PuzzleRuntimeRunRunIdUnique<'ctx> { - imp: __sdk::UniqueConstraintHandle, - phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, - } +/// Access to the `run_id` unique index on the table `puzzle_runtime_run`, +/// which allows point queries on the field of the same name +/// via the [`PuzzleRuntimeRunRunIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.puzzle_runtime_run().run_id().find(...)`. +pub struct PuzzleRuntimeRunRunIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} - impl<'ctx> PuzzleRuntimeRunTableHandle<'ctx> { - /// Get a handle on the `run_id` unique index on the table `puzzle_runtime_run`. - pub fn run_id(&self) -> PuzzleRuntimeRunRunIdUnique<'ctx> { - PuzzleRuntimeRunRunIdUnique { - imp: self.imp.get_unique_constraint::("run_id"), - phantom: std::marker::PhantomData, - } - } +impl<'ctx> PuzzleRuntimeRunTableHandle<'ctx> { + /// Get a handle on the `run_id` unique index on the table `puzzle_runtime_run`. + pub fn run_id(&self) -> PuzzleRuntimeRunRunIdUnique<'ctx> { + PuzzleRuntimeRunRunIdUnique { + imp: self.imp.get_unique_constraint::("run_id"), + phantom: std::marker::PhantomData, } + } +} + +impl<'ctx> PuzzleRuntimeRunRunIdUnique<'ctx> { + /// Find the subscribed row whose `run_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> PuzzleRuntimeRunRunIdUnique<'ctx> { - /// Find the subscribed row whose `run_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::("puzzle_runtime_run"); _table.add_unique_constraint::("run_id", |row| &row.run_id); } @@ -138,26 +138,24 @@ 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 `PuzzleRuntimeRunRow`. - /// - /// Implemented for [`__sdk::QueryTableAccessor`]. - pub trait puzzle_runtime_runQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `PuzzleRuntimeRunRow`. - fn puzzle_runtime_run(&self) -> __sdk::__query_builder::Table; - } - - impl puzzle_runtime_runQueryTableAccess for __sdk::QueryTableAccessor { - fn puzzle_runtime_run(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("puzzle_runtime_run") - } - } +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `PuzzleRuntimeRunRow`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait puzzle_runtime_runQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `PuzzleRuntimeRunRow`. + fn puzzle_runtime_run(&self) -> __sdk::__query_builder::Table; +} +impl puzzle_runtime_runQueryTableAccess for __sdk::QueryTableAccessor { + fn puzzle_runtime_run(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("puzzle_runtime_run") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_select_cover_image_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_select_cover_image_input_type.rs index 847ac3a4..516d16b9 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_select_cover_image_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_select_cover_image_input_type.rs @@ -2,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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 +13,6 @@ pub struct PuzzleSelectCoverImageInput { pub selected_at_micros: i64, } - impl __sdk::InModule for PuzzleSelectCoverImageInput { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_work_get_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_work_get_input_type.rs index 74cf57a1..5f37e13f 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_work_get_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_work_get_input_type.rs @@ -2,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -16,8 +10,6 @@ pub struct PuzzleWorkGetInput { pub profile_id: String, } - impl __sdk::InModule for PuzzleWorkGetInput { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_work_procedure_result_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_work_procedure_result_type.rs index 0da3b49c..d59a56cc 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_work_procedure_result_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_work_procedure_result_type.rs @@ -2,24 +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}; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] pub struct PuzzleWorkProcedureResult { pub ok: bool, - pub item_json: Option::, - pub error_message: Option::, + pub item_json: Option, + pub error_message: Option, } - impl __sdk::InModule for PuzzleWorkProcedureResult { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_work_profile_row_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_work_profile_row_type.rs index e5482282..be53fc17 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_work_profile_row_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_work_profile_row_type.rs @@ -2,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::puzzle_publication_status_type::PuzzlePublicationStatus; @@ -17,28 +12,26 @@ pub struct PuzzleWorkProfileRow { pub profile_id: String, pub work_id: String, pub owner_user_id: String, - pub source_session_id: Option::, + pub source_session_id: Option, pub author_display_name: String, pub level_name: String, pub summary: String, pub theme_tags_json: String, - pub cover_image_src: Option::, - pub cover_asset_id: Option::, + pub cover_image_src: Option, + pub cover_asset_id: Option, pub publication_status: PuzzlePublicationStatus, pub play_count: u32, pub anchor_pack_json: String, pub publish_ready: bool, pub created_at: __sdk::Timestamp, pub updated_at: __sdk::Timestamp, - pub published_at: Option::<__sdk::Timestamp>, + pub published_at: Option<__sdk::Timestamp>, } - impl __sdk::InModule for PuzzleWorkProfileRow { type Module = super::RemoteModule; } - /// Column accessor struct for the table `PuzzleWorkProfileRow`. /// /// Provides typed access to columns for query building. @@ -46,20 +39,21 @@ pub struct PuzzleWorkProfileRowCols { pub profile_id: __sdk::__query_builder::Col, pub work_id: __sdk::__query_builder::Col, pub owner_user_id: __sdk::__query_builder::Col, - pub source_session_id: __sdk::__query_builder::Col>, + pub source_session_id: __sdk::__query_builder::Col>, pub author_display_name: __sdk::__query_builder::Col, pub level_name: __sdk::__query_builder::Col, pub summary: __sdk::__query_builder::Col, pub theme_tags_json: __sdk::__query_builder::Col, - pub cover_image_src: __sdk::__query_builder::Col>, - pub cover_asset_id: __sdk::__query_builder::Col>, - pub publication_status: __sdk::__query_builder::Col, + pub cover_image_src: __sdk::__query_builder::Col>, + pub cover_asset_id: __sdk::__query_builder::Col>, + pub publication_status: + __sdk::__query_builder::Col, pub play_count: __sdk::__query_builder::Col, pub anchor_pack_json: __sdk::__query_builder::Col, pub publish_ready: __sdk::__query_builder::Col, pub created_at: __sdk::__query_builder::Col, pub updated_at: __sdk::__query_builder::Col, - pub published_at: __sdk::__query_builder::Col>, + pub published_at: __sdk::__query_builder::Col>, } impl __sdk::__query_builder::HasCols for PuzzleWorkProfileRow { @@ -70,7 +64,10 @@ impl __sdk::__query_builder::HasCols for PuzzleWorkProfileRow { work_id: __sdk::__query_builder::Col::new(table_name, "work_id"), owner_user_id: __sdk::__query_builder::Col::new(table_name, "owner_user_id"), source_session_id: __sdk::__query_builder::Col::new(table_name, "source_session_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", + ), level_name: __sdk::__query_builder::Col::new(table_name, "level_name"), summary: __sdk::__query_builder::Col::new(table_name, "summary"), theme_tags_json: __sdk::__query_builder::Col::new(table_name, "theme_tags_json"), @@ -83,7 +80,6 @@ impl __sdk::__query_builder::HasCols for PuzzleWorkProfileRow { created_at: __sdk::__query_builder::Col::new(table_name, "created_at"), updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"), published_at: __sdk::__query_builder::Col::new(table_name, "published_at"), - } } } @@ -94,7 +90,8 @@ impl __sdk::__query_builder::HasCols for PuzzleWorkProfileRow { pub struct PuzzleWorkProfileRowIxCols { 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 PuzzleWorkProfileRow { @@ -103,11 +100,12 @@ impl __sdk::__query_builder::HasIxCols for PuzzleWorkProfileRow { PuzzleWorkProfileRowIxCols { 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 PuzzleWorkProfileRow {} - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_work_profile_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_work_profile_table.rs index c5f14f0f..673a9841 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_work_profile_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_work_profile_table.rs @@ -2,14 +2,9 @@ // WILL NOT BE 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::puzzle_work_profile_row_type::PuzzleWorkProfileRow; use super::puzzle_publication_status_type::PuzzlePublicationStatus; +use super::puzzle_work_profile_row_type::PuzzleWorkProfileRow; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; /// Table handle for the table `puzzle_work_profile`. /// @@ -37,7 +32,9 @@ pub trait PuzzleWorkProfileTableAccess { impl PuzzleWorkProfileTableAccess for super::RemoteTables { fn puzzle_work_profile(&self) -> PuzzleWorkProfileTableHandle<'_> { PuzzleWorkProfileTableHandle { - imp: self.imp.get_table::("puzzle_work_profile"), + imp: self + .imp + .get_table::("puzzle_work_profile"), ctx: std::marker::PhantomData, } } @@ -50,8 +47,12 @@ impl<'ctx> __sdk::Table for PuzzleWorkProfileTableHandle<'ctx> { type Row = PuzzleWorkProfileRow; 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 = PuzzleWorkProfileInsertCallbackId; @@ -97,39 +98,38 @@ impl<'ctx> __sdk::TableWithPrimaryKey for PuzzleWorkProfileTableHandle<'ctx> { } } - /// Access to the `profile_id` unique index on the table `puzzle_work_profile`, - /// which allows point queries on the field of the same name - /// via the [`PuzzleWorkProfileProfileIdUnique::find`] method. - /// - /// Users are encouraged not to explicitly reference this type, - /// but to directly chain method calls, - /// like `ctx.db.puzzle_work_profile().profile_id().find(...)`. - pub struct PuzzleWorkProfileProfileIdUnique<'ctx> { - imp: __sdk::UniqueConstraintHandle, - phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, - } +/// Access to the `profile_id` unique index on the table `puzzle_work_profile`, +/// which allows point queries on the field of the same name +/// via the [`PuzzleWorkProfileProfileIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.puzzle_work_profile().profile_id().find(...)`. +pub struct PuzzleWorkProfileProfileIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} - impl<'ctx> PuzzleWorkProfileTableHandle<'ctx> { - /// Get a handle on the `profile_id` unique index on the table `puzzle_work_profile`. - pub fn profile_id(&self) -> PuzzleWorkProfileProfileIdUnique<'ctx> { - PuzzleWorkProfileProfileIdUnique { - imp: self.imp.get_unique_constraint::("profile_id"), - phantom: std::marker::PhantomData, - } - } +impl<'ctx> PuzzleWorkProfileTableHandle<'ctx> { + /// Get a handle on the `profile_id` unique index on the table `puzzle_work_profile`. + pub fn profile_id(&self) -> PuzzleWorkProfileProfileIdUnique<'ctx> { + PuzzleWorkProfileProfileIdUnique { + imp: self.imp.get_unique_constraint::("profile_id"), + phantom: std::marker::PhantomData, } + } +} + +impl<'ctx> PuzzleWorkProfileProfileIdUnique<'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> PuzzleWorkProfileProfileIdUnique<'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::("puzzle_work_profile"); _table.add_unique_constraint::("profile_id", |row| &row.profile_id); } @@ -139,26 +139,24 @@ 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 `PuzzleWorkProfileRow`. - /// - /// Implemented for [`__sdk::QueryTableAccessor`]. - pub trait puzzle_work_profileQueryTableAccess { - #[allow(non_snake_case)] - /// Get a query builder for the table `PuzzleWorkProfileRow`. - fn puzzle_work_profile(&self) -> __sdk::__query_builder::Table; - } - - impl puzzle_work_profileQueryTableAccess for __sdk::QueryTableAccessor { - fn puzzle_work_profile(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("puzzle_work_profile") - } - } +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `PuzzleWorkProfileRow`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait puzzle_work_profileQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `PuzzleWorkProfileRow`. + fn puzzle_work_profile(&self) -> __sdk::__query_builder::Table; +} +impl puzzle_work_profileQueryTableAccess for __sdk::QueryTableAccessor { + fn puzzle_work_profile(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("puzzle_work_profile") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_work_upsert_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_work_upsert_input_type.rs index ae412d68..809ce64d 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_work_upsert_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_work_upsert_input_type.rs @@ -2,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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,14 +11,12 @@ pub struct PuzzleWorkUpsertInput { pub owner_user_id: String, pub level_name: String, pub summary: String, - pub theme_tags: Vec::, - pub cover_image_src: Option::, - pub cover_asset_id: Option::, + pub theme_tags: Vec, + pub cover_image_src: Option, + pub cover_asset_id: Option, pub updated_at_micros: i64, } - impl __sdk::InModule for PuzzleWorkUpsertInput { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_works_list_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_works_list_input_type.rs index e1d55a5f..4ad5ef5b 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_works_list_input_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_works_list_input_type.rs @@ -2,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -16,8 +10,6 @@ pub struct PuzzleWorksListInput { pub owner_user_id: String, } - impl __sdk::InModule for PuzzleWorksListInput { type Module = super::RemoteModule; } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_works_procedure_result_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_works_procedure_result_type.rs index 80a1c401..6a34c60f 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_works_procedure_result_type.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_works_procedure_result_type.rs @@ -2,24 +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}; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] pub struct PuzzleWorksProcedureResult { pub ok: bool, - pub items_json: Option::, - pub error_message: Option::, + pub items_json: Option, + pub error_message: Option, } - impl __sdk::InModule for PuzzleWorksProcedureResult { type Module = super::RemoteModule; } - 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 dbe06a17..678ec032 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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 +11,6 @@ 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 08debc1e..d12363ff 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,23 +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}; #[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 9b69c1f7..4e1d0a5d 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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,8 +12,6 @@ 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 2e742860..c3176590 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -22,12 +17,8 @@ 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 069f1084..b1ac8c78 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,17 +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 super::quest_log_type::QuestLog; -use super::quest_status_type::QuestStatus; -use super::quest_progress_signal_type::QuestProgressSignal; use super::quest_log_event_kind_type::QuestLogEventKind; +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}; /// Table handle for the table `quest_log`. /// @@ -53,8 +48,12 @@ 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; @@ -100,39 +99,38 @@ 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>, - } +/// 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, - } - } +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) + } +} - 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); } @@ -142,26 +140,24 @@ 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; - } - - impl quest_logQueryTableAccess for __sdk::QueryTableAccessor { - fn quest_log(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("quest_log") - } - } +#[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") + } +} 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 d4e28a66..d893857a 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,17 +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_status_type::QuestStatus; -use super::quest_progress_signal_type::QuestProgressSignal; 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; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] @@ -23,19 +18,17 @@ 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. @@ -46,10 +39,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, } @@ -68,7 +61,6 @@ 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"), - } } } @@ -90,11 +82,12 @@ 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 45c26c18..730e7565 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -21,11 +16,9 @@ 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 53f324af..34ce63f3 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -16,12 +11,8 @@ 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 e390707e..ac5319cd 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -24,12 +19,8 @@ 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 356ae48e..a0f1f8bb 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -16,8 +10,6 @@ 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 a62032a7..39042f37 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -16,8 +10,6 @@ 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 4139db37..665faa30 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -24,12 +19,8 @@ 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 e617912b..38682e68 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -15,15 +10,13 @@ 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 b957a0a7..5764d273 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,19 +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 spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; use super::quest_hostile_npc_defeated_signal_type::QuestHostileNpcDefeatedSignal; -use super::quest_treasure_inspected_signal_type::QuestTreasureInspectedSignal; +use super::quest_item_delivered_signal_type::QuestItemDeliveredSignal; 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_item_delivered_signal_type::QuestItemDeliveredSignal; +use super::quest_treasure_inspected_signal_type::QuestTreasureInspectedSignal; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] @@ -30,12 +25,8 @@ 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 6a82982d..d07da423 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,16 +2,11 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_status_type::QuestStatus; -use super::quest_reward_snapshot_type::QuestRewardSnapshot; use super::quest_narrative_binding_snapshot_type::QuestNarrativeBindingSnapshot; +use super::quest_reward_snapshot_type::QuestRewardSnapshot; +use super::quest_status_type::QuestStatus; use super::quest_step_snapshot_type::QuestStepSnapshot; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] @@ -19,15 +14,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, @@ -36,18 +31,16 @@ 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 3ccd7a81..07e6e918 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,18 +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::quest_record_type::QuestRecord; -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; +use super::quest_record_type::QuestRecord; +use super::quest_reward_snapshot_type::QuestRewardSnapshot; +use super::quest_status_type::QuestStatus; +use super::quest_step_snapshot_type::QuestStepSnapshot; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; /// Table handle for the table `quest_record`. /// @@ -54,8 +49,12 @@ 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; @@ -101,39 +100,38 @@ 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>, - } +/// 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, - } - } +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) + } +} - 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); } @@ -143,26 +141,24 @@ 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; - } - - impl quest_recordQueryTableAccess for __sdk::QueryTableAccessor { - fn quest_record(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("quest_record") - } - } +#[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") + } +} 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 10f98806..4243e91c 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,33 +2,28 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_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; +use super::quest_reward_snapshot_type::QuestRewardSnapshot; +use super::quest_status_type::QuestStatus; +use super::quest_step_snapshot_type::QuestStepSnapshot; #[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, @@ -39,40 +34,38 @@ 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, @@ -83,17 +76,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 { @@ -117,7 +110,10 @@ 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"), @@ -125,14 +121,19 @@ 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"), - } } } @@ -154,11 +155,12 @@ 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 333521e0..43a942c4 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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,12 +13,8 @@ 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 560847bd..9938686a 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,23 +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}; #[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 632c46aa..7fc4f7ec 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -22,12 +17,8 @@ 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 dc0af611..a62f9d93 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,15 +2,10 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_item_rarity_type::QuestRewardItemRarity; use super::quest_reward_equipment_slot_type::QuestRewardEquipmentSlot; +use super::quest_reward_item_rarity_type::QuestRewardItemRarity; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] @@ -18,17 +13,15 @@ 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 55790858..995e84ad 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,29 +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}; -use super::quest_reward_item_type::QuestRewardItem; use super::quest_reward_intel_type::QuestRewardIntel; +use super::quest_reward_item_type::QuestRewardItem; #[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 d188fab1..723d9325 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -16,8 +10,6 @@ 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 89cc2c6f..d93ff928 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -19,8 +14,6 @@ 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 0d36f2fa..04ea6661 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -24,12 +19,8 @@ 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 3ea098d8..f5defbb7 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -24,12 +19,8 @@ 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 c1e3bc1a..0f27cb9e 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -16,10 +11,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, @@ -27,8 +22,6 @@ 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 8003e616..51caed77 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,22 +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 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 9d87ae49..4f48a44a 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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 +11,6 @@ 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 9b886a0d..7d6fbfd1 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,23 +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::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; } @@ -28,16 +22,19 @@ 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, ); } @@ -46,13 +43,17 @@ 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 72c6524f..7dea1c21 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -24,8 +18,6 @@ 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 f21fc0ee..c7a13f85 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -15,12 +10,10 @@ 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 1c3f29c9..8398db8c 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -19,10 +14,8 @@ 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 { @@ -40,9 +33,8 @@ 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, @@ -55,9 +47,11 @@ pub trait resolve_combat_action { &self, input: ResolveCombatActionInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + Send + + 'static, ) -> __sdk::Result<()>; } @@ -66,11 +60,13 @@ impl resolve_combat_action for super::RemoteReducers { &self, input: ResolveCombatActionInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + 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 8057358f..b47e088c 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,15 +2,10 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::combat_outcome_type::CombatOutcome; use super::battle_state_snapshot_type::BattleStateSnapshot; +use super::combat_outcome_type::CombatOutcome; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] @@ -21,8 +16,6 @@ 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 150fa443..268483bf 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,23 +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::resolve_npc_battle_interaction_input_type::ResolveNpcBattleInteractionInput; use super::npc_battle_interaction_procedure_result_type::NpcBattleInteractionProcedureResult; +use super::resolve_npc_battle_interaction_input_type::ResolveNpcBattleInteractionInput; #[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; } @@ -28,16 +22,19 @@ 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, ); } @@ -46,13 +43,17 @@ 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 907cc7e2..e8eba7a6 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,15 +2,10 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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::resolve_npc_interaction_input_type::ResolveNpcInteractionInput; +use super::runtime_item_reward_item_snapshot_type::RuntimeItemRewardItemSnapshot; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] @@ -18,7 +13,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, @@ -26,11 +21,9 @@ 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 4952a32a..4604fc30 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,23 +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::resolve_npc_interaction_input_type::ResolveNpcInteractionInput; use super::npc_interaction_procedure_result_type::NpcInteractionProcedureResult; +use super::resolve_npc_interaction_input_type::ResolveNpcInteractionInput; #[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; } @@ -28,16 +22,19 @@ 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, ); } @@ -46,13 +43,17 @@ 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 d553ea4e..9a4439ce 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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,12 +11,10 @@ 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 37563788..352f5a93 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -19,10 +14,8 @@ 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 { @@ -40,9 +33,8 @@ 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, @@ -55,9 +47,11 @@ pub trait resolve_npc_interaction { &self, input: ResolveNpcInteractionInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + Send + + 'static, ) -> __sdk::Result<()>; } @@ -66,11 +60,13 @@ impl resolve_npc_interaction for super::RemoteReducers { &self, input: ResolveNpcInteractionInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + 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 2411e620..65b1690e 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,23 +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::resolve_npc_social_action_input_type::ResolveNpcSocialActionInput; use super::npc_state_procedure_result_type::NpcStateProcedureResult; +use super::resolve_npc_social_action_input_type::ResolveNpcSocialActionInput; #[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; } @@ -28,16 +22,19 @@ 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, ); } @@ -46,13 +43,17 @@ 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 10df08b1..29487297 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -18,13 +13,11 @@ 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 e8717b6f..9b326931 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -19,10 +14,8 @@ 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 { @@ -40,9 +33,8 @@ 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, @@ -55,9 +47,11 @@ pub trait resolve_npc_social_action { &self, input: ResolveNpcSocialActionInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + Send + + 'static, ) -> __sdk::Result<()>; } @@ -66,11 +60,13 @@ impl resolve_npc_social_action for super::RemoteReducers { &self, input: ResolveNpcSocialActionInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + 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 cc50e10f..0b8f6bad 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,23 +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::treasure_resolve_input_type::TreasureResolveInput; use super::treasure_record_procedure_result_type::TreasureRecordProcedureResult; +use super::treasure_resolve_input_type::TreasureResolveInput; #[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; } @@ -28,16 +22,19 @@ 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, ); } @@ -46,13 +43,17 @@ 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 6a830425..221ac39d 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -19,10 +14,8 @@ 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 { @@ -40,9 +33,8 @@ 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, @@ -55,9 +47,11 @@ pub trait resolve_treasure_interaction { &self, input: TreasureResolveInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + Send + + 'static, ) -> __sdk::Result<()>; } @@ -66,11 +60,13 @@ impl resolve_treasure_interaction for super::RemoteReducers { &self, input: TreasureResolveInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + 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 index 8505e52a..73e6d668 100644 --- 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 @@ -2,23 +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::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 { +struct ResumeProfileSaveArchiveAndReturnArgs { pub input: RuntimeProfileSaveArchiveResumeInput, } - impl __sdk::InModule for ResumeProfileSaveArchiveAndReturnArgs { type Module = super::RemoteModule; } @@ -28,16 +22,19 @@ impl __sdk::InModule for ResumeProfileSaveArchiveAndReturnArgs { /// /// 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(&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, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -46,13 +43,17 @@ impl resume_profile_save_archive_and_return for super::RemoteProcedures { &self, input: RuntimeProfileSaveArchiveResumeInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { - self.imp.invoke_procedure_with_callback::<_, RuntimeProfileSaveArchiveProcedureResult>( - "resume_profile_save_archive_and_return", - ResumeProfileSaveArchiveAndReturnArgs { input, }, - __callback, - ); + 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 3888a866..e082dc36 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -32,12 +27,8 @@ 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 f890218d..391625f5 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -20,12 +15,8 @@ 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 180466b0..fc54a7b1 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -24,12 +19,8 @@ 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 ad7e445b..67e383f2 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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,12 +13,8 @@ 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 42cd9fc2..555c0439 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -20,12 +15,8 @@ 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 60ee2ecf..c3e7b8ac 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -38,12 +33,8 @@ 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 b9d0cf0e..1a94e20f 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -30,12 +25,8 @@ 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 41fc6954..e5bc78f0 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -16,8 +10,6 @@ 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 5795bb3a..cdc31641 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -16,8 +10,6 @@ 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 9c02dd59..3721358f 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -15,12 +10,10 @@ 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 05c404c1..9222eaed 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -21,7 +16,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, @@ -29,8 +24,6 @@ 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 09c9fb18..0996e66e 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -15,12 +10,10 @@ 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 de120fac..fc8a1b11 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -24,12 +19,8 @@ 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 fb087aac..9a54bd81 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -16,16 +10,14 @@ 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 09374d4c..bf0e3103 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -15,12 +10,10 @@ 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 75c93962..e6b02ed3 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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 +11,6 @@ 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 7ab3ebea..624e66c6 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -16,12 +11,10 @@ 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 01cd4888..b539d4f3 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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,12 +13,8 @@ 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 a3316ea0..dc4250ab 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -22,12 +17,8 @@ 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 65bcb55c..4df1f248 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,15 +2,10 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_rarity_type::RuntimeItemRewardItemRarity; use super::runtime_item_equipment_slot_type::RuntimeItemEquipmentSlot; +use super::runtime_item_reward_item_rarity_type::RuntimeItemRewardItemRarity; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] @@ -18,17 +13,15 @@ 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 7eef5e97..cbb36c5d 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -16,12 +11,8 @@ 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 9be0a158..47af88ec 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -16,8 +10,6 @@ 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 a04facbb..fa80a719 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -15,12 +10,10 @@ 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 6a54e5ff..a3e97b05 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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,11 +11,9 @@ 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 99665ea0..825a6707 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -16,8 +10,6 @@ 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 24044b8b..5572f438 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -15,12 +10,10 @@ 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 e99d2e72..472a99c0 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -16,12 +11,10 @@ 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 f642a84d..fa6c1d2c 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -16,9 +10,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, @@ -26,8 +20,6 @@ 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 index 89524eb1..29eea52e 100644 --- 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 @@ -2,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -16,8 +10,6 @@ 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 index 7c8e7b07..4f4d5c0c 100644 --- 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 @@ -2,28 +2,21 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_snapshot_type::RuntimeSnapshot; use super::runtime_profile_save_archive_snapshot_type::RuntimeProfileSaveArchiveSnapshot; +use super::runtime_snapshot_type::RuntimeSnapshot; #[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::, + 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 index a290bf1f..186de3e0 100644 --- 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 @@ -2,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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 +11,6 @@ pub struct RuntimeProfileSaveArchiveResumeInput { 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 index d88a1fab..9843ec8c 100644 --- 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 @@ -2,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -16,23 +10,21 @@ 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 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 cover_image_src: Option, pub saved_at_micros: i64, pub bottom_tab: String, pub game_state_json: String, - pub current_story_json: Option::, + 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 e4aa66b2..8513884e 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -22,8 +17,6 @@ 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 10d9d0ff..e8a1c111 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -16,8 +10,6 @@ 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 809092ae..1c0a2b05 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -15,12 +10,10 @@ 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 23e8f759..2b98f5ef 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,24 +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}; #[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 555c7863..1b83318a 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -16,8 +10,6 @@ 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 e823af97..792e33d4 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -15,12 +10,10 @@ 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 6d6ebae1..5d92990f 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -21,8 +16,6 @@ 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 cc7fac56..dc1ed5bb 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,14 +2,9 @@ // WILL NOT BE 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_setting_type::RuntimeSetting; use super::runtime_platform_theme_type::RuntimePlatformTheme; +use super::runtime_setting_type::RuntimeSetting; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; /// Table handle for the table `runtime_setting`. /// @@ -50,8 +45,12 @@ 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; @@ -97,39 +96,38 @@ 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>, - } +/// 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, - } - } +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) + } +} - 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); } @@ -139,26 +137,24 @@ 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; - } - - impl runtime_settingQueryTableAccess for __sdk::QueryTableAccessor { - fn runtime_setting(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("runtime_setting") - } - } +#[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") + } +} 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 f3c72f73..5a7b61b0 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -21,12 +16,10 @@ 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. @@ -47,7 +40,6 @@ 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"), - } } } @@ -64,10 +56,8 @@ 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 347e1675..7091bc8d 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -20,8 +15,6 @@ 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 index 251417e4..53bb194c 100644 --- 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 @@ -2,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -16,8 +10,6 @@ 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 index 7340dbf6..c19034c6 100644 --- 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 @@ -2,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -16,8 +10,6 @@ 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 index 466a3e41..4066d915 100644 --- 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 @@ -2,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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_snapshot_type::RuntimeSnapshot; @@ -15,12 +10,10 @@ use super::runtime_snapshot_type::RuntimeSnapshot; #[sats(crate = __lib)] pub struct RuntimeSnapshotProcedureResult { pub ok: bool, - pub record: Option::, - pub error_message: Option::, + 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 index 8eec233a..da66941e 100644 --- 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 @@ -2,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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,17 +12,15 @@ pub struct RuntimeSnapshotRow { pub saved_at: __sdk::Timestamp, pub bottom_tab: String, pub game_state_json: String, - pub current_story_json: Option::, + 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. @@ -38,7 +30,7 @@ pub struct RuntimeSnapshotRowCols { 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 current_story_json: __sdk::__query_builder::Col>, pub created_at: __sdk::__query_builder::Col, pub updated_at: __sdk::__query_builder::Col, } @@ -55,7 +47,6 @@ impl __sdk::__query_builder::HasCols for RuntimeSnapshotRow { 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"), - } } } @@ -72,10 +63,8 @@ impl __sdk::__query_builder::HasIxCols for RuntimeSnapshotRow { 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 index ea6106d1..9d105016 100644 --- 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 @@ -2,13 +2,8 @@ // WILL NOT BE 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; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; /// Table handle for the table `runtime_snapshot`. /// @@ -49,8 +44,12 @@ 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() } + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } type InsertCallbackId = RuntimeSnapshotInsertCallbackId; @@ -96,39 +95,38 @@ impl<'ctx> __sdk::TableWithPrimaryKey for RuntimeSnapshotTableHandle<'ctx> { } } - /// 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>, - } +/// 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> 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) + } +} - 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); } @@ -138,26 +136,24 @@ 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 `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") - } - } +#[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 index e8ede33b..1e9e14ad 100644 --- 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 @@ -2,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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,13 +12,11 @@ pub struct RuntimeSnapshot { pub saved_at_micros: i64, pub bottom_tab: String, pub game_state_json: String, - pub current_story_json: Option::, + 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 index 2379473f..9b3c75df 100644 --- 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 @@ -2,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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,12 +11,10 @@ pub struct RuntimeSnapshotUpsertInput { pub saved_at_micros: i64, pub bottom_tab: String, pub game_state_json: String, - pub current_story_json: Option::, + 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/save_puzzle_generated_images_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/save_puzzle_generated_images_procedure.rs index 15ccc81f..870d6d51 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/save_puzzle_generated_images_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/save_puzzle_generated_images_procedure.rs @@ -2,23 +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::puzzle_agent_session_procedure_result_type::PuzzleAgentSessionProcedureResult; use super::puzzle_generated_images_save_input_type::PuzzleGeneratedImagesSaveInput; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] - struct SavePuzzleGeneratedImagesArgs { +struct SavePuzzleGeneratedImagesArgs { pub input: PuzzleGeneratedImagesSaveInput, } - impl __sdk::InModule for SavePuzzleGeneratedImagesArgs { type Module = super::RemoteModule; } @@ -28,16 +22,19 @@ impl __sdk::InModule for SavePuzzleGeneratedImagesArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait save_puzzle_generated_images { - fn save_puzzle_generated_images(&self, input: PuzzleGeneratedImagesSaveInput, -) { - self.save_puzzle_generated_images_then(input, |_, _| {}); + fn save_puzzle_generated_images(&self, input: PuzzleGeneratedImagesSaveInput) { + self.save_puzzle_generated_images_then(input, |_, _| {}); } fn save_puzzle_generated_images_then( &self, input: PuzzleGeneratedImagesSaveInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -46,13 +43,17 @@ impl save_puzzle_generated_images for super::RemoteProcedures { &self, input: PuzzleGeneratedImagesSaveInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { - self.imp.invoke_procedure_with_callback::<_, PuzzleAgentSessionProcedureResult>( - "save_puzzle_generated_images", - SavePuzzleGeneratedImagesArgs { input, }, - __callback, - ); + self.imp + .invoke_procedure_with_callback::<_, PuzzleAgentSessionProcedureResult>( + "save_puzzle_generated_images", + SavePuzzleGeneratedImagesArgs { input }, + __callback, + ); } } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/select_puzzle_cover_image_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/select_puzzle_cover_image_procedure.rs index b12bb89a..fd4dd93c 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/select_puzzle_cover_image_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/select_puzzle_cover_image_procedure.rs @@ -2,23 +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::puzzle_agent_session_procedure_result_type::PuzzleAgentSessionProcedureResult; use super::puzzle_select_cover_image_input_type::PuzzleSelectCoverImageInput; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] - struct SelectPuzzleCoverImageArgs { +struct SelectPuzzleCoverImageArgs { pub input: PuzzleSelectCoverImageInput, } - impl __sdk::InModule for SelectPuzzleCoverImageArgs { type Module = super::RemoteModule; } @@ -28,16 +22,19 @@ impl __sdk::InModule for SelectPuzzleCoverImageArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait select_puzzle_cover_image { - fn select_puzzle_cover_image(&self, input: PuzzleSelectCoverImageInput, -) { - self.select_puzzle_cover_image_then(input, |_, _| {}); + fn select_puzzle_cover_image(&self, input: PuzzleSelectCoverImageInput) { + self.select_puzzle_cover_image_then(input, |_, _| {}); } fn select_puzzle_cover_image_then( &self, input: PuzzleSelectCoverImageInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -46,13 +43,17 @@ impl select_puzzle_cover_image for super::RemoteProcedures { &self, input: PuzzleSelectCoverImageInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { - self.imp.invoke_procedure_with_callback::<_, PuzzleAgentSessionProcedureResult>( - "select_puzzle_cover_image", - SelectPuzzleCoverImageArgs { input, }, - __callback, - ); + self.imp + .invoke_procedure_with_callback::<_, PuzzleAgentSessionProcedureResult>( + "select_puzzle_cover_image", + SelectPuzzleCoverImageArgs { input }, + __callback, + ); } } - 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 44e89238..c5cc5256 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -19,10 +14,8 @@ 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 { @@ -40,9 +33,8 @@ 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, @@ -55,9 +47,11 @@ pub trait start_ai_task { &self, input: AiTaskStartInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + Send + + 'static, ) -> __sdk::Result<()>; } @@ -66,11 +60,13 @@ impl start_ai_task for super::RemoteReducers { &self, input: AiTaskStartInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + 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 74b85d62..24ed5b3f 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -19,10 +14,8 @@ 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 { @@ -40,9 +33,8 @@ 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, @@ -55,9 +47,11 @@ pub trait start_ai_task_stage { &self, input: AiTaskStageStartInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + Send + + 'static, ) -> __sdk::Result<()>; } @@ -66,11 +60,13 @@ impl start_ai_task_stage for super::RemoteReducers { &self, input: AiTaskStageStartInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + 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/start_big_fish_run_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/start_big_fish_run_procedure.rs index b9b3b28c..6a149f03 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/start_big_fish_run_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/start_big_fish_run_procedure.rs @@ -2,23 +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::big_fish_run_procedure_result_type::BigFishRunProcedureResult; use super::big_fish_run_start_input_type::BigFishRunStartInput; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] - struct StartBigFishRunArgs { +struct StartBigFishRunArgs { pub input: BigFishRunStartInput, } - impl __sdk::InModule for StartBigFishRunArgs { type Module = super::RemoteModule; } @@ -28,16 +22,19 @@ impl __sdk::InModule for StartBigFishRunArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait start_big_fish_run { - fn start_big_fish_run(&self, input: BigFishRunStartInput, -) { - self.start_big_fish_run_then(input, |_, _| {}); + fn start_big_fish_run(&self, input: BigFishRunStartInput) { + self.start_big_fish_run_then(input, |_, _| {}); } fn start_big_fish_run_then( &self, input: BigFishRunStartInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -46,13 +43,17 @@ impl start_big_fish_run for super::RemoteProcedures { &self, input: BigFishRunStartInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { - self.imp.invoke_procedure_with_callback::<_, BigFishRunProcedureResult>( - "start_big_fish_run", - StartBigFishRunArgs { input, }, - __callback, - ); + self.imp + .invoke_procedure_with_callback::<_, BigFishRunProcedureResult>( + "start_big_fish_run", + StartBigFishRunArgs { input }, + __callback, + ); } } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/start_puzzle_run_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/start_puzzle_run_procedure.rs index 849856c8..c3d6d457 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/start_puzzle_run_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/start_puzzle_run_procedure.rs @@ -2,23 +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::puzzle_run_procedure_result_type::PuzzleRunProcedureResult; use super::puzzle_run_start_input_type::PuzzleRunStartInput; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] - struct StartPuzzleRunArgs { +struct StartPuzzleRunArgs { pub input: PuzzleRunStartInput, } - impl __sdk::InModule for StartPuzzleRunArgs { type Module = super::RemoteModule; } @@ -28,16 +22,19 @@ impl __sdk::InModule for StartPuzzleRunArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait start_puzzle_run { - fn start_puzzle_run(&self, input: PuzzleRunStartInput, -) { - self.start_puzzle_run_then(input, |_, _| {}); + fn start_puzzle_run(&self, input: PuzzleRunStartInput) { + self.start_puzzle_run_then(input, |_, _| {}); } fn start_puzzle_run_then( &self, input: PuzzleRunStartInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -46,13 +43,17 @@ impl start_puzzle_run for super::RemoteProcedures { &self, input: PuzzleRunStartInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { - self.imp.invoke_procedure_with_callback::<_, PuzzleRunProcedureResult>( - "start_puzzle_run", - StartPuzzleRunArgs { input, }, - __callback, - ); + self.imp + .invoke_procedure_with_callback::<_, PuzzleRunProcedureResult>( + "start_puzzle_run", + StartPuzzleRunArgs { 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 d84dde42..e0b3f730 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -16,12 +10,10 @@ 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 1072867e..29836b4a 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -16,12 +11,8 @@ 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 4afacc4a..881799d5 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -18,12 +13,10 @@ 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 b702797b..232a554e 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,14 +2,9 @@ // WILL NOT BE 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::story_event_type::StoryEvent; use super::story_event_kind_type::StoryEventKind; +use super::story_event_type::StoryEvent; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; /// Table handle for the table `story_event`. /// @@ -50,8 +45,12 @@ 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; @@ -97,39 +96,38 @@ 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>, - } +/// 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, - } - } +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) + } +} - 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); } @@ -139,26 +137,24 @@ 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; - } - - impl story_eventQueryTableAccess for __sdk::QueryTableAccessor { - fn story_event(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("story_event") - } - } +#[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") + } +} 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 3c9c102d..4d3bdd9f 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -18,16 +13,14 @@ 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. @@ -36,7 +29,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, } @@ -50,7 +43,6 @@ 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"), - } } } @@ -69,10 +61,8 @@ 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 260fc1e4..bebf3267 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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,12 +12,10 @@ 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 3e1cfa4f..4548d9cc 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,27 +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::story_session_snapshot_type::StorySessionSnapshot; use super::story_event_snapshot_type::StoryEventSnapshot; +use super::story_session_snapshot_type::StorySessionSnapshot; #[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 46f1072f..b8d2daf6 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -19,17 +14,15 @@ 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 5e4e1476..d860b7db 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -16,8 +10,6 @@ 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 c33c4c77..cf2148d6 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,27 +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::story_session_snapshot_type::StorySessionSnapshot; use super::story_event_snapshot_type::StoryEventSnapshot; +use super::story_session_snapshot_type::StorySessionSnapshot; #[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 334433fa..f04aae19 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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,12 +13,8 @@ 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 d3b4dd67..142f7fa1 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,14 +2,9 @@ // WILL NOT BE 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::story_session_type::StorySession; use super::story_session_status_type::StorySessionStatus; +use super::story_session_type::StorySession; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; /// Table handle for the table `story_session`. /// @@ -50,8 +45,12 @@ 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; @@ -97,39 +96,38 @@ 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>, - } +/// 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, - } - } +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) + } +} - 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); } @@ -139,26 +137,24 @@ 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; - } - - impl story_sessionQueryTableAccess for __sdk::QueryTableAccessor { - fn story_session(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("story_session") - } - } +#[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") + } +} 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 7fd0c7e9..f9534179 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -19,21 +14,19 @@ 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. @@ -43,9 +36,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, @@ -62,13 +55,18 @@ 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"), - } } } @@ -87,12 +85,13 @@ 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_big_fish_input_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/submit_big_fish_input_procedure.rs index b6e481b4..e09583f4 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/submit_big_fish_input_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/submit_big_fish_input_procedure.rs @@ -2,23 +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::big_fish_run_procedure_result_type::BigFishRunProcedureResult; use super::big_fish_run_input_submit_input_type::BigFishRunInputSubmitInput; +use super::big_fish_run_procedure_result_type::BigFishRunProcedureResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] - struct SubmitBigFishInputArgs { +struct SubmitBigFishInputArgs { pub input: BigFishRunInputSubmitInput, } - impl __sdk::InModule for SubmitBigFishInputArgs { type Module = super::RemoteModule; } @@ -28,16 +22,19 @@ impl __sdk::InModule for SubmitBigFishInputArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait submit_big_fish_input { - fn submit_big_fish_input(&self, input: BigFishRunInputSubmitInput, -) { - self.submit_big_fish_input_then(input, |_, _| {}); + fn submit_big_fish_input(&self, input: BigFishRunInputSubmitInput) { + self.submit_big_fish_input_then(input, |_, _| {}); } fn submit_big_fish_input_then( &self, input: BigFishRunInputSubmitInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -46,13 +43,17 @@ impl submit_big_fish_input for super::RemoteProcedures { &self, input: BigFishRunInputSubmitInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { - self.imp.invoke_procedure_with_callback::<_, BigFishRunProcedureResult>( - "submit_big_fish_input", - SubmitBigFishInputArgs { input, }, - __callback, - ); + self.imp + .invoke_procedure_with_callback::<_, BigFishRunProcedureResult>( + "submit_big_fish_input", + SubmitBigFishInputArgs { input }, + __callback, + ); } } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/submit_big_fish_message_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/submit_big_fish_message_procedure.rs index 0fd8dc0d..307d7755 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/submit_big_fish_message_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/submit_big_fish_message_procedure.rs @@ -2,23 +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::big_fish_session_procedure_result_type::BigFishSessionProcedureResult; use super::big_fish_message_submit_input_type::BigFishMessageSubmitInput; +use super::big_fish_session_procedure_result_type::BigFishSessionProcedureResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] - struct SubmitBigFishMessageArgs { +struct SubmitBigFishMessageArgs { pub input: BigFishMessageSubmitInput, } - impl __sdk::InModule for SubmitBigFishMessageArgs { type Module = super::RemoteModule; } @@ -28,16 +22,19 @@ impl __sdk::InModule for SubmitBigFishMessageArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait submit_big_fish_message { - fn submit_big_fish_message(&self, input: BigFishMessageSubmitInput, -) { - self.submit_big_fish_message_then(input, |_, _| {}); + fn submit_big_fish_message(&self, input: BigFishMessageSubmitInput) { + self.submit_big_fish_message_then(input, |_, _| {}); } fn submit_big_fish_message_then( &self, input: BigFishMessageSubmitInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -46,13 +43,17 @@ impl submit_big_fish_message for super::RemoteProcedures { &self, input: BigFishMessageSubmitInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { - self.imp.invoke_procedure_with_callback::<_, BigFishSessionProcedureResult>( - "submit_big_fish_message", - SubmitBigFishMessageArgs { input, }, - __callback, - ); + self.imp + .invoke_procedure_with_callback::<_, BigFishSessionProcedureResult>( + "submit_big_fish_message", + SubmitBigFishMessageArgs { input }, + __callback, + ); } } - 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 efb1c0b3..5debac19 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,23 +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_operation_procedure_result_type::CustomWorldAgentOperationProcedureResult; use super::custom_world_agent_message_submit_input_type::CustomWorldAgentMessageSubmitInput; +use super::custom_world_agent_operation_procedure_result_type::CustomWorldAgentOperationProcedureResult; #[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; } @@ -28,16 +22,19 @@ 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, ); } @@ -46,13 +43,17 @@ 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/submit_puzzle_agent_message_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/submit_puzzle_agent_message_procedure.rs index 4bca696e..0d9e94e5 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/submit_puzzle_agent_message_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/submit_puzzle_agent_message_procedure.rs @@ -2,23 +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::puzzle_agent_session_procedure_result_type::PuzzleAgentSessionProcedureResult; use super::puzzle_agent_message_submit_input_type::PuzzleAgentMessageSubmitInput; +use super::puzzle_agent_session_procedure_result_type::PuzzleAgentSessionProcedureResult; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] - struct SubmitPuzzleAgentMessageArgs { +struct SubmitPuzzleAgentMessageArgs { pub input: PuzzleAgentMessageSubmitInput, } - impl __sdk::InModule for SubmitPuzzleAgentMessageArgs { type Module = super::RemoteModule; } @@ -28,16 +22,19 @@ impl __sdk::InModule for SubmitPuzzleAgentMessageArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait submit_puzzle_agent_message { - fn submit_puzzle_agent_message(&self, input: PuzzleAgentMessageSubmitInput, -) { - self.submit_puzzle_agent_message_then(input, |_, _| {}); + fn submit_puzzle_agent_message(&self, input: PuzzleAgentMessageSubmitInput) { + self.submit_puzzle_agent_message_then(input, |_, _| {}); } fn submit_puzzle_agent_message_then( &self, input: PuzzleAgentMessageSubmitInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -46,13 +43,17 @@ impl submit_puzzle_agent_message for super::RemoteProcedures { &self, input: PuzzleAgentMessageSubmitInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { - self.imp.invoke_procedure_with_callback::<_, PuzzleAgentSessionProcedureResult>( - "submit_puzzle_agent_message", - SubmitPuzzleAgentMessageArgs { input, }, - __callback, - ); + self.imp + .invoke_procedure_with_callback::<_, PuzzleAgentSessionProcedureResult>( + "submit_puzzle_agent_message", + SubmitPuzzleAgentMessageArgs { input }, + __callback, + ); } } - diff --git a/server-rs/crates/spacetime-client/src/module_bindings/swap_puzzle_pieces_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/swap_puzzle_pieces_procedure.rs index dfcb2750..f5835607 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/swap_puzzle_pieces_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/swap_puzzle_pieces_procedure.rs @@ -2,23 +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::puzzle_run_procedure_result_type::PuzzleRunProcedureResult; use super::puzzle_run_swap_input_type::PuzzleRunSwapInput; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] - struct SwapPuzzlePiecesArgs { +struct SwapPuzzlePiecesArgs { pub input: PuzzleRunSwapInput, } - impl __sdk::InModule for SwapPuzzlePiecesArgs { type Module = super::RemoteModule; } @@ -28,16 +22,19 @@ impl __sdk::InModule for SwapPuzzlePiecesArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait swap_puzzle_pieces { - fn swap_puzzle_pieces(&self, input: PuzzleRunSwapInput, -) { - self.swap_puzzle_pieces_then(input, |_, _| {}); + fn swap_puzzle_pieces(&self, input: PuzzleRunSwapInput) { + self.swap_puzzle_pieces_then(input, |_, _| {}); } fn swap_puzzle_pieces_then( &self, input: PuzzleRunSwapInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -46,13 +43,17 @@ impl swap_puzzle_pieces for super::RemoteProcedures { &self, input: PuzzleRunSwapInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { - self.imp.invoke_procedure_with_callback::<_, PuzzleRunProcedureResult>( - "swap_puzzle_pieces", - SwapPuzzlePiecesArgs { input, }, - __callback, - ); + self.imp + .invoke_procedure_with_callback::<_, PuzzleRunProcedureResult>( + "swap_puzzle_pieces", + SwapPuzzlePiecesArgs { 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 77e48673..a9b61b0e 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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,12 +13,8 @@ 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 212c4042..d0ac0175 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -15,12 +10,10 @@ 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 29677339..8d69d10e 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -21,20 +16,18 @@ 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 c4e7b6cd..927e3256 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,15 +2,10 @@ // WILL NOT BE 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`. /// @@ -51,8 +46,12 @@ 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; @@ -98,39 +97,40 @@ 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>, - } +/// 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, - } - } +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) + } +} - 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,26 +140,24 @@ 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; - } - - impl treasure_recordQueryTableAccess for __sdk::QueryTableAccessor { - fn treasure_record(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("treasure_record") - } - } +#[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") + } +} 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 e757734f..9bcd8f6d 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -21,24 +16,22 @@ 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. @@ -49,14 +42,15 @@ 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, } @@ -81,7 +75,6 @@ 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"), - } } } @@ -103,13 +96,17 @@ 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 9893c678..ef1083df 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -21,20 +16,18 @@ 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 2e9e88fd..08727f04 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -19,10 +14,8 @@ 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 { @@ -40,9 +33,8 @@ 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, @@ -55,9 +47,11 @@ pub trait turn_in_quest { &self, input: QuestTurnInInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + Send + + 'static, ) -> __sdk::Result<()>; } @@ -66,11 +60,13 @@ impl turn_in_quest for super::RemoteReducers { &self, input: QuestTurnInInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + 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 20ca72d7..227f40ec 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,13 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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)] @@ -16,8 +10,6 @@ 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 45e7a4a1..31acccce 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,23 +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_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; } @@ -28,16 +22,19 @@ 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, ); } @@ -46,13 +43,17 @@ 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 adedc423..51af927f 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -19,10 +14,8 @@ 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 { @@ -40,9 +33,11 @@ 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, @@ -55,9 +50,11 @@ pub trait unpublish_custom_world_profile { &self, input: CustomWorldProfileUnpublishInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + Send + + 'static, ) -> __sdk::Result<()>; } @@ -66,11 +63,13 @@ impl unpublish_custom_world_profile for super::RemoteReducers { &self, input: CustomWorldProfileUnpublishInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + 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/update_puzzle_work_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/update_puzzle_work_procedure.rs index 14a134df..80571241 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/update_puzzle_work_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/update_puzzle_work_procedure.rs @@ -2,23 +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::puzzle_work_procedure_result_type::PuzzleWorkProcedureResult; use super::puzzle_work_upsert_input_type::PuzzleWorkUpsertInput; #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[sats(crate = __lib)] - struct UpdatePuzzleWorkArgs { +struct UpdatePuzzleWorkArgs { pub input: PuzzleWorkUpsertInput, } - impl __sdk::InModule for UpdatePuzzleWorkArgs { type Module = super::RemoteModule; } @@ -28,16 +22,19 @@ impl __sdk::InModule for UpdatePuzzleWorkArgs { /// /// Implemented for [`super::RemoteProcedures`]. pub trait update_puzzle_work { - fn update_puzzle_work(&self, input: PuzzleWorkUpsertInput, -) { - self.update_puzzle_work_then(input, |_, _| {}); + fn update_puzzle_work(&self, input: PuzzleWorkUpsertInput) { + self.update_puzzle_work_then(input, |_, _| {}); } fn update_puzzle_work_then( &self, input: PuzzleWorkUpsertInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -46,13 +43,17 @@ impl update_puzzle_work for super::RemoteProcedures { &self, input: PuzzleWorkUpsertInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { - self.imp.invoke_procedure_with_callback::<_, PuzzleWorkProcedureResult>( - "update_puzzle_work", - UpdatePuzzleWorkArgs { input, }, - __callback, - ); + self.imp + .invoke_procedure_with_callback::<_, PuzzleWorkProcedureResult>( + "update_puzzle_work", + UpdatePuzzleWorkArgs { 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 2182ec5a..be3ff473 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,23 +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::chapter_progression_procedure_result_type::ChapterProgressionProcedureResult; use super::chapter_progression_input_type::ChapterProgressionInput; +use super::chapter_progression_procedure_result_type::ChapterProgressionProcedureResult; #[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; } @@ -28,16 +22,19 @@ 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, ); } @@ -46,13 +43,17 @@ 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 a01fe892..de37e994 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -19,10 +14,8 @@ 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 { @@ -40,9 +33,8 @@ 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, @@ -55,9 +47,11 @@ pub trait upsert_chapter_progression { &self, input: ChapterProgressionInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + Send + + 'static, ) -> __sdk::Result<()>; } @@ -66,11 +60,13 @@ impl upsert_chapter_progression for super::RemoteReducers { &self, input: ChapterProgressionInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + 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 e7720c06..a761ab95 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,23 +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_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; } @@ -28,16 +22,19 @@ 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, ); } @@ -46,13 +43,17 @@ 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 353bc46f..91ca2652 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -19,10 +14,8 @@ 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 { @@ -40,9 +33,11 @@ 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, @@ -55,9 +50,11 @@ pub trait upsert_custom_world_profile { &self, input: CustomWorldProfileUpsertInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + Send + + 'static, ) -> __sdk::Result<()>; } @@ -66,11 +63,13 @@ impl upsert_custom_world_profile for super::RemoteReducers { &self, input: CustomWorldProfileUpsertInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + 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 46ad5903..91ba0d0e 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,23 +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::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; } @@ -28,16 +22,19 @@ 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, ); } @@ -46,13 +43,17 @@ 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 1a6f10c7..afbe61f8 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -19,10 +14,8 @@ 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 { @@ -40,9 +33,8 @@ 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, @@ -55,9 +47,11 @@ pub trait upsert_npc_state { &self, input: NpcStateUpsertInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + Send + + 'static, ) -> __sdk::Result<()>; } @@ -66,11 +60,13 @@ impl upsert_npc_state for super::RemoteReducers { &self, input: NpcStateUpsertInput, - callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) - + Send - + 'static, + callback: impl FnOnce( + &super::ReducerEventContext, + Result, __sdk::InternalError>, + ) + 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 eb863a2d..36e5f464 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,23 +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::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; } @@ -28,16 +22,19 @@ 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, ); } @@ -46,13 +43,17 @@ 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 f820971c..f8fa0351 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,23 +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::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; } @@ -28,16 +22,19 @@ 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, ); } @@ -46,13 +43,17 @@ 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 index f86a0f7d..fe0746ba 100644 --- 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 @@ -2,23 +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::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 { +struct UpsertRuntimeSnapshotAndReturnArgs { pub input: RuntimeSnapshotUpsertInput, } - impl __sdk::InModule for UpsertRuntimeSnapshotAndReturnArgs { type Module = super::RemoteModule; } @@ -28,16 +22,19 @@ impl __sdk::InModule for UpsertRuntimeSnapshotAndReturnArgs { /// /// 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(&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, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -46,13 +43,17 @@ impl upsert_runtime_snapshot_and_return for super::RemoteProcedures { &self, input: RuntimeSnapshotUpsertInput, - __callback: impl FnOnce(&super::ProcedureEventContext, Result) + Send + 'static, + __callback: impl FnOnce( + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { - self.imp.invoke_procedure_with_callback::<_, RuntimeSnapshotProcedureResult>( - "upsert_runtime_snapshot_and_return", - UpsertRuntimeSnapshotAndReturnArgs { input, }, - __callback, - ); + 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 933556ca..2341921d 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,14 +2,9 @@ // WILL NOT BE 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::user_browse_history_type::UserBrowseHistory; use super::runtime_browse_history_theme_mode_type::RuntimeBrowseHistoryThemeMode; +use super::user_browse_history_type::UserBrowseHistory; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; /// Table handle for the table `user_browse_history`. /// @@ -37,7 +32,9 @@ 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, } } @@ -50,8 +47,12 @@ 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; @@ -97,39 +98,40 @@ 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>, - } +/// 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, - } - } +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) + } +} - 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); } @@ -139,26 +141,24 @@ 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; - } - - impl user_browse_historyQueryTableAccess for __sdk::QueryTableAccessor { - fn user_browse_history(&self) -> __sdk::__query_builder::Table { - __sdk::__query_builder::Table::new("user_browse_history") - } - } +#[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") + } +} 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 85e114be..3a6cf1ae 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,12 +2,7 @@ // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. #![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; @@ -21,7 +16,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, @@ -29,12 +24,10 @@ 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. @@ -46,7 +39,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, @@ -67,11 +60,13 @@ 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"), - } } } @@ -90,10 +85,8 @@ 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/README.md b/server-rs/crates/spacetime-module/README.md index d87a0411..b55c6852 100644 --- a/server-rs/crates/spacetime-module/README.md +++ b/server-rs/crates/spacetime-module/README.md @@ -55,6 +55,61 @@ - `cancel_ai_task_and_return` 18. `turn_in_quest` 与 `resolve_combat_action(Victory)` 到 `player_progression / chapter_progression` 的最小经验联动 +### 2.0.1 `runtime` 域拆分进度 + +截至 `2026-04-23`,`runtime` 域已完成第一轮真实内容拆分,根入口不再保留该域的业务 helper 实现。 + +当前 `src/runtime/` 的实际落位如下: + +1. `src/runtime/settings.rs` + - `runtime_setting` 表 + - setting 读取 / upsert procedure 与快照 helper +2. `src/runtime/snapshots.rs` + - `runtime_snapshot` 表 + - snapshot 读取 / upsert / delete helper +3. `src/runtime/browse_history.rs` + - `user_browse_history` 表 + - 浏览历史 list / upsert / clear procedure 与行转换 helper +4. `src/runtime/profile.rs` + - `profile_dashboard_state` + - `profile_wallet_ledger` + - `profile_played_world` + - `profile_save_archive` + - profile dashboard / ledger / play stats / save archive 投影与同步 helper + +`src/runtime/mod.rs` 当前只承担聚合职责: + +1. 声明 `settings / snapshots / browse_history / profile` +2. 对外统一使用 `pub use xxx::*;` 重新导出 + +后续新增 runtime 相关 table / reducer / procedure / helper 时,必须直接落到上述二级文件,禁止回写到 `src/lib.rs`。 + +### 2.0.2 `ai` 域拆分进度 + +截至 `2026-04-23`,`ai` 域也已完成第一轮真实内容拆分,根入口不再保留 `ai_task / ai_task_stage / ai_text_chunk / ai_result_reference` 的业务实现。 + +当前 `src/ai/` 的实际落位如下: + +1. `src/ai/tasks.rs` + - `ai_task` 表 + - task 创建、启动、完成、失败、取消的 reducer / procedure + - task 状态迁移与持久化 helper +2. `src/ai/stages.rs` + - `ai_task_stage` + - `ai_text_chunk` + - `ai_result_reference` + - stage 启动、chunk 追加、stage 完成、result reference 绑定的 procedure / helper +3. `src/ai/snapshots.rs` + - AI 任务、阶段、chunk、reference 的 row / snapshot 转换 helper + +`src/ai/mod.rs` 当前只承担聚合职责: + +1. 声明 `tasks / stages / snapshots` +2. 对外统一使用 `pub use xxx::*;` +3. 对内部共享的 row / snapshot helper 使用 `pub(crate) use snapshots::*;` + +后续新增 AI 相关 table / reducer / procedure / helper 时,必须直接落到上述二级文件,禁止回写到 `src/lib.rs`。 + ## 2.1 `src/lib.rs` 拆分路由规则 从 `2026-04-23` 起,`src/lib.rs` 不再允许继续承载具体业务域的 table / reducer / procedure / tx helper。 diff --git a/server-rs/crates/spacetime-module/src/ai/mod.rs b/server-rs/crates/spacetime-module/src/ai/mod.rs index 627b3711..8b2abdcf 100644 --- a/server-rs/crates/spacetime-module/src/ai/mod.rs +++ b/server-rs/crates/spacetime-module/src/ai/mod.rs @@ -1,753 +1,7 @@ -#[spacetimedb::table( - accessor = ai_task, - index(accessor = by_ai_task_owner_user_id, btree(columns = [owner_user_id])), - index(accessor = by_ai_task_status, btree(columns = [status])), - index(accessor = by_ai_task_kind, btree(columns = [task_kind])) -)] -pub struct AiTask { - #[primary_key] - task_id: String, - task_kind: AiTaskKind, - owner_user_id: String, - request_label: String, - source_module: String, - source_entity_id: Option, - request_payload_json: Option, - status: AiTaskStatus, - failure_message: Option, - latest_text_output: Option, - latest_structured_payload_json: Option, - version: u32, - created_at: Timestamp, - started_at: Option, - completed_at: Option, - updated_at: Timestamp, -} +mod snapshots; +mod stages; +mod tasks; -#[spacetimedb::table( - accessor = ai_task_stage, - index(accessor = by_ai_task_stage_task_id, btree(columns = [task_id])), - index(accessor = by_ai_task_stage_task_order, btree(columns = [task_id, stage_order])) -)] -pub struct AiTaskStage { - #[primary_key] - task_stage_id: String, - task_id: String, - stage_kind: AiTaskStageKind, - label: String, - detail: String, - stage_order: u32, - status: AiTaskStageStatus, - text_output: Option, - structured_payload_json: Option, - warning_messages: Vec, - started_at: Option, - completed_at: Option, -} - -#[spacetimedb::table( - accessor = ai_text_chunk, - index(accessor = by_ai_text_chunk_task_id, btree(columns = [task_id])), - index( - accessor = by_ai_text_chunk_task_stage_sequence, - btree(columns = [task_id, stage_kind, sequence]) - ) -)] -pub struct AiTextChunk { - #[primary_key] - text_chunk_row_id: String, - chunk_id: String, - task_id: String, - stage_kind: AiTaskStageKind, - sequence: u32, - delta_text: String, - created_at: Timestamp, -} - -#[spacetimedb::table( - accessor = ai_result_reference, - index(accessor = by_ai_result_reference_task_id, btree(columns = [task_id])) -)] -pub struct AiResultReference { - #[primary_key] - result_reference_row_id: String, - result_ref_id: String, - task_id: String, - reference_kind: AiResultReferenceKind, - reference_id: String, - label: Option, - created_at: Timestamp, -} - -// AI 任务当前先固定成 private 真相表,后续由 Axum / platform-llm 再往外包一层 HTTP 与 SSE 协议。 -#[spacetimedb::reducer] -pub fn create_ai_task(ctx: &ReducerContext, input: AiTaskCreateInput) -> Result<(), String> { - create_ai_task_tx(ctx, input).map(|_| ()) -} - -#[spacetimedb::procedure] -pub fn create_ai_task_and_return( - ctx: &mut ProcedureContext, - input: AiTaskCreateInput, -) -> AiTaskProcedureResult { - match ctx.try_with_tx(|tx| create_ai_task_tx(tx, input.clone())) { - Ok(task) => AiTaskProcedureResult { - ok: true, - task: Some(task), - text_chunk: None, - error_message: None, - }, - Err(message) => AiTaskProcedureResult { - ok: false, - task: None, - text_chunk: None, - error_message: Some(message), - }, - } -} - -#[spacetimedb::reducer] -pub fn start_ai_task(ctx: &ReducerContext, input: AiTaskStartInput) -> Result<(), String> { - start_ai_task_tx(ctx, input).map(|_| ()) -} - -#[spacetimedb::reducer] -pub fn start_ai_task_stage( - ctx: &ReducerContext, - input: AiTaskStageStartInput, -) -> Result<(), String> { - start_ai_task_stage_tx(ctx, input).map(|_| ()) -} - -// 流式增量写入需要同步返回 chunk 与聚合后的任务快照,方便后续 Axum facade 直接复用。 -#[spacetimedb::procedure] -pub fn append_ai_text_chunk_and_return( - ctx: &mut ProcedureContext, - input: AiTextChunkAppendInput, -) -> AiTaskProcedureResult { - match ctx.try_with_tx(|tx| append_ai_text_chunk_tx(tx, input.clone())) { - Ok((task, text_chunk)) => AiTaskProcedureResult { - ok: true, - task: Some(task), - text_chunk: Some(text_chunk), - error_message: None, - }, - Err(message) => AiTaskProcedureResult { - ok: false, - task: None, - text_chunk: None, - error_message: Some(message), - }, - } -} - -#[spacetimedb::procedure] -pub fn complete_ai_stage_and_return( - ctx: &mut ProcedureContext, - input: AiStageCompletionInput, -) -> AiTaskProcedureResult { - match ctx.try_with_tx(|tx| complete_ai_stage_tx(tx, input.clone())) { - Ok(task) => AiTaskProcedureResult { - ok: true, - task: Some(task), - text_chunk: None, - error_message: None, - }, - Err(message) => AiTaskProcedureResult { - ok: false, - task: None, - text_chunk: None, - error_message: Some(message), - }, - } -} - -#[spacetimedb::procedure] -pub fn attach_ai_result_reference_and_return( - ctx: &mut ProcedureContext, - input: AiResultReferenceInput, -) -> AiTaskProcedureResult { - match ctx.try_with_tx(|tx| attach_ai_result_reference_tx(tx, input.clone())) { - Ok(task) => AiTaskProcedureResult { - ok: true, - task: Some(task), - text_chunk: None, - error_message: None, - }, - Err(message) => AiTaskProcedureResult { - ok: false, - task: None, - text_chunk: None, - error_message: Some(message), - }, - } -} - -#[spacetimedb::procedure] -pub fn complete_ai_task_and_return( - ctx: &mut ProcedureContext, - input: AiTaskFinishInput, -) -> AiTaskProcedureResult { - match ctx.try_with_tx(|tx| complete_ai_task_tx(tx, input.clone())) { - Ok(task) => AiTaskProcedureResult { - ok: true, - task: Some(task), - text_chunk: None, - error_message: None, - }, - Err(message) => AiTaskProcedureResult { - ok: false, - task: None, - text_chunk: None, - error_message: Some(message), - }, - } -} - -#[spacetimedb::procedure] -pub fn fail_ai_task_and_return( - ctx: &mut ProcedureContext, - input: AiTaskFailureInput, -) -> AiTaskProcedureResult { - match ctx.try_with_tx(|tx| fail_ai_task_tx(tx, input.clone())) { - Ok(task) => AiTaskProcedureResult { - ok: true, - task: Some(task), - text_chunk: None, - error_message: None, - }, - Err(message) => AiTaskProcedureResult { - ok: false, - task: None, - text_chunk: None, - error_message: Some(message), - }, - } -} - -#[spacetimedb::procedure] -pub fn cancel_ai_task_and_return( - ctx: &mut ProcedureContext, - input: AiTaskCancelInput, -) -> AiTaskProcedureResult { - match ctx.try_with_tx(|tx| cancel_ai_task_tx(tx, input.clone())) { - Ok(task) => AiTaskProcedureResult { - ok: true, - task: Some(task), - text_chunk: None, - error_message: None, - }, - Err(message) => AiTaskProcedureResult { - ok: false, - task: None, - text_chunk: None, - error_message: Some(message), - }, - } -} -fn create_ai_task_tx( - ctx: &ReducerContext, - input: AiTaskCreateInput, -) -> Result { - validate_task_create_input(&input).map_err(|error| error.to_string())?; - - if ctx.db.ai_task().task_id().find(&input.task_id).is_some() { - return Err("ai_task.task_id 已存在".to_string()); - } - - let task_snapshot = build_ai_task_snapshot_from_create_input(&input); - ctx.db.ai_task().insert(build_ai_task_row(&task_snapshot)); - replace_ai_task_stages(ctx, &task_snapshot.task_id, &task_snapshot.stages); - - get_ai_task_snapshot_tx(ctx, &task_snapshot.task_id) -} - -fn start_ai_task_tx( - ctx: &ReducerContext, - input: AiTaskStartInput, -) -> Result { - let mut snapshot = get_ai_task_snapshot_tx(ctx, &input.task_id)?; - ensure_ai_task_can_transition(snapshot.status)?; - - snapshot.status = AiTaskStatus::Running; - if snapshot.started_at_micros.is_none() { - snapshot.started_at_micros = Some(input.started_at_micros); - } - snapshot.updated_at_micros = input.started_at_micros; - snapshot.version += 1; - - persist_ai_task_snapshot(ctx, &snapshot)?; - Ok(snapshot) -} - -fn start_ai_task_stage_tx( - ctx: &ReducerContext, - input: AiTaskStageStartInput, -) -> Result { - let mut snapshot = get_ai_task_snapshot_tx(ctx, &input.task_id)?; - ensure_ai_task_can_transition(snapshot.status)?; - - let stage = snapshot - .stages - .iter_mut() - .find(|stage| stage.stage_kind == input.stage_kind) - .ok_or_else(|| "ai_task.stage 不存在".to_string())?; - - snapshot.status = AiTaskStatus::Running; - if snapshot.started_at_micros.is_none() { - snapshot.started_at_micros = Some(input.started_at_micros); - } - stage.status = AiTaskStageStatus::Running; - if stage.started_at_micros.is_none() { - stage.started_at_micros = Some(input.started_at_micros); - } - snapshot.updated_at_micros = input.started_at_micros; - snapshot.version += 1; - - persist_ai_task_snapshot(ctx, &snapshot)?; - Ok(snapshot) -} - -fn append_ai_text_chunk_tx( - ctx: &ReducerContext, - input: AiTextChunkAppendInput, -) -> Result<(AiTaskSnapshot, AiTextChunkSnapshot), String> { - if input.delta_text.trim().is_empty() { - return Err("ai_text_chunk.delta_text 不能为空".to_string()); - } - if input.sequence == 0 { - return Err("ai_text_chunk.sequence 必须大于 0".to_string()); - } - - let mut snapshot = get_ai_task_snapshot_tx(ctx, &input.task_id)?; - ensure_ai_task_can_transition(snapshot.status)?; - - let stage = snapshot - .stages - .iter_mut() - .find(|stage| stage.stage_kind == input.stage_kind) - .ok_or_else(|| "ai_task.stage 不存在".to_string())?; - - let chunk = AiTextChunkSnapshot { - chunk_id: generate_ai_text_chunk_id(input.created_at_micros, input.sequence), - task_id: input.task_id.trim().to_string(), - stage_kind: input.stage_kind, - sequence: input.sequence, - delta_text: input.delta_text.trim().to_string(), - created_at_micros: input.created_at_micros, - }; - ctx.db - .ai_text_chunk() - .insert(build_ai_text_chunk_row(&chunk)); - - let aggregated_text = collect_ai_stage_text_output(ctx, &chunk.task_id, chunk.stage_kind); - - snapshot.status = AiTaskStatus::Running; - if snapshot.started_at_micros.is_none() { - snapshot.started_at_micros = Some(input.created_at_micros); - } - stage.status = AiTaskStageStatus::Running; - if stage.started_at_micros.is_none() { - stage.started_at_micros = Some(input.created_at_micros); - } - stage.text_output = aggregated_text.clone(); - snapshot.latest_text_output = aggregated_text; - snapshot.updated_at_micros = input.created_at_micros; - snapshot.version += 1; - - persist_ai_task_snapshot(ctx, &snapshot)?; - Ok((snapshot, chunk)) -} - -fn complete_ai_stage_tx( - ctx: &ReducerContext, - input: AiStageCompletionInput, -) -> Result { - let mut snapshot = get_ai_task_snapshot_tx(ctx, &input.task_id)?; - ensure_ai_task_can_transition(snapshot.status)?; - - let stage = snapshot - .stages - .iter_mut() - .find(|stage| stage.stage_kind == input.stage_kind) - .ok_or_else(|| "ai_task.stage 不存在".to_string())?; - - stage.status = AiTaskStageStatus::Completed; - stage.completed_at_micros = Some(input.completed_at_micros); - stage.text_output = normalize_optional_text(input.text_output.clone()); - stage.structured_payload_json = normalize_optional_text(input.structured_payload_json.clone()); - stage.warning_messages = normalize_string_list(input.warning_messages.clone()); - - snapshot.latest_text_output = stage.text_output.clone(); - snapshot.latest_structured_payload_json = stage.structured_payload_json.clone(); - snapshot.updated_at_micros = input.completed_at_micros; - snapshot.version += 1; - - persist_ai_task_snapshot(ctx, &snapshot)?; - Ok(snapshot) -} - -fn attach_ai_result_reference_tx( - ctx: &ReducerContext, - input: AiResultReferenceInput, -) -> Result { - let reference_id = input.reference_id.trim().to_string(); - if reference_id.is_empty() { - return Err("ai_result_reference.reference_id 不能为空".to_string()); - } - - let mut snapshot = get_ai_task_snapshot_tx(ctx, &input.task_id)?; - ensure_ai_task_can_transition(snapshot.status)?; - - let reference = AiResultReferenceSnapshot { - result_ref_id: generate_ai_result_ref_id(input.created_at_micros), - task_id: input.task_id.trim().to_string(), - reference_kind: input.reference_kind, - reference_id, - label: normalize_optional_text(input.label), - created_at_micros: input.created_at_micros, - }; - ctx.db - .ai_result_reference() - .insert(build_ai_result_reference_row(&reference)); - - snapshot.result_references.push(reference); - snapshot.updated_at_micros = input.created_at_micros; - snapshot.version += 1; - - persist_ai_task_snapshot(ctx, &snapshot)?; - Ok(snapshot) -} - -fn complete_ai_task_tx( - ctx: &ReducerContext, - input: AiTaskFinishInput, -) -> Result { - let mut snapshot = get_ai_task_snapshot_tx(ctx, &input.task_id)?; - ensure_ai_task_can_transition(snapshot.status)?; - - snapshot.status = AiTaskStatus::Completed; - snapshot.completed_at_micros = Some(input.completed_at_micros); - snapshot.updated_at_micros = input.completed_at_micros; - snapshot.version += 1; - - persist_ai_task_snapshot(ctx, &snapshot)?; - Ok(snapshot) -} - -fn fail_ai_task_tx( - ctx: &ReducerContext, - input: AiTaskFailureInput, -) -> Result { - let failure_message = input.failure_message.trim().to_string(); - if failure_message.is_empty() { - return Err("ai_task.failure_message 不能为空".to_string()); - } - - let mut snapshot = get_ai_task_snapshot_tx(ctx, &input.task_id)?; - ensure_ai_task_can_transition(snapshot.status)?; - - snapshot.status = AiTaskStatus::Failed; - snapshot.failure_message = Some(failure_message); - snapshot.completed_at_micros = Some(input.completed_at_micros); - snapshot.updated_at_micros = input.completed_at_micros; - snapshot.version += 1; - - persist_ai_task_snapshot(ctx, &snapshot)?; - Ok(snapshot) -} - -fn cancel_ai_task_tx( - ctx: &ReducerContext, - input: AiTaskCancelInput, -) -> Result { - let mut snapshot = get_ai_task_snapshot_tx(ctx, &input.task_id)?; - ensure_ai_task_can_transition(snapshot.status)?; - - snapshot.status = AiTaskStatus::Cancelled; - snapshot.completed_at_micros = Some(input.completed_at_micros); - snapshot.updated_at_micros = input.completed_at_micros; - snapshot.version += 1; - - persist_ai_task_snapshot(ctx, &snapshot)?; - Ok(snapshot) -} - -fn get_ai_task_snapshot_tx(ctx: &ReducerContext, task_id: &str) -> Result { - let row = ctx - .db - .ai_task() - .task_id() - .find(&task_id.trim().to_string()) - .ok_or_else(|| "ai_task 不存在".to_string())?; - - Ok(build_ai_task_snapshot_from_row(ctx, &row)) -} - -fn persist_ai_task_snapshot(ctx: &ReducerContext, snapshot: &AiTaskSnapshot) -> Result<(), String> { - ctx.db.ai_task().task_id().delete(&snapshot.task_id); - ctx.db.ai_task().insert(build_ai_task_row(snapshot)); - replace_ai_task_stages(ctx, &snapshot.task_id, &snapshot.stages); - Ok(()) -} - -fn replace_ai_task_stages(ctx: &ReducerContext, task_id: &str, stages: &[AiTaskStageSnapshot]) { - let stage_ids = ctx - .db - .ai_task_stage() - .iter() - .filter(|row| row.task_id == task_id) - .map(|row| row.task_stage_id.clone()) - .collect::>(); - for stage_id in stage_ids { - ctx.db.ai_task_stage().task_stage_id().delete(&stage_id); - } - - for stage in stages { - ctx.db - .ai_task_stage() - .insert(build_ai_task_stage_row(task_id, stage)); - } -} - -fn collect_ai_stage_text_output( - ctx: &ReducerContext, - task_id: &str, - stage_kind: AiTaskStageKind, -) -> Option { - let mut chunks = ctx - .db - .ai_text_chunk() - .iter() - .filter(|row| row.task_id == task_id && row.stage_kind == stage_kind) - .map(|row| build_ai_text_chunk_snapshot_from_row(&row)) - .collect::>(); - chunks.sort_by_key(|chunk| chunk.sequence); - - let aggregated = chunks - .into_iter() - .map(|chunk| chunk.delta_text) - .collect::>() - .join(""); - if aggregated.trim().is_empty() { - None - } else { - Some(aggregated) - } -} - -fn ensure_ai_task_can_transition(status: AiTaskStatus) -> Result<(), String> { - if matches!( - status, - AiTaskStatus::Completed | AiTaskStatus::Failed | AiTaskStatus::Cancelled - ) { - Err("当前 ai_task 状态不允许执行该操作".to_string()) - } else { - Ok(()) - } -} - -fn build_ai_task_snapshot_from_create_input(input: &AiTaskCreateInput) -> AiTaskSnapshot { - AiTaskSnapshot { - task_id: input.task_id.trim().to_string(), - task_kind: input.task_kind, - owner_user_id: input.owner_user_id.trim().to_string(), - request_label: input.request_label.trim().to_string(), - source_module: input.source_module.trim().to_string(), - source_entity_id: normalize_optional_text(input.source_entity_id.clone()), - request_payload_json: normalize_optional_text(input.request_payload_json.clone()), - status: AiTaskStatus::Pending, - failure_message: None, - stages: input - .stages - .iter() - .map(|stage| AiTaskStageSnapshot { - stage_kind: stage.stage_kind, - label: stage.label.trim().to_string(), - detail: stage.detail.trim().to_string(), - order: stage.order, - status: AiTaskStageStatus::Pending, - text_output: None, - structured_payload_json: None, - warning_messages: Vec::new(), - started_at_micros: None, - completed_at_micros: None, - }) - .collect(), - result_references: Vec::new(), - latest_text_output: None, - latest_structured_payload_json: None, - version: INITIAL_AI_TASK_VERSION, - created_at_micros: input.created_at_micros, - started_at_micros: None, - completed_at_micros: None, - updated_at_micros: input.created_at_micros, - } -} - -fn build_ai_task_row(snapshot: &AiTaskSnapshot) -> AiTask { - AiTask { - task_id: snapshot.task_id.clone(), - task_kind: snapshot.task_kind, - owner_user_id: snapshot.owner_user_id.clone(), - request_label: snapshot.request_label.clone(), - source_module: snapshot.source_module.clone(), - source_entity_id: snapshot.source_entity_id.clone(), - request_payload_json: snapshot.request_payload_json.clone(), - status: snapshot.status, - failure_message: snapshot.failure_message.clone(), - latest_text_output: snapshot.latest_text_output.clone(), - latest_structured_payload_json: snapshot.latest_structured_payload_json.clone(), - version: snapshot.version, - created_at: Timestamp::from_micros_since_unix_epoch(snapshot.created_at_micros), - started_at: snapshot - .started_at_micros - .map(Timestamp::from_micros_since_unix_epoch), - completed_at: snapshot - .completed_at_micros - .map(Timestamp::from_micros_since_unix_epoch), - updated_at: Timestamp::from_micros_since_unix_epoch(snapshot.updated_at_micros), - } -} - -fn build_ai_task_snapshot_from_row(ctx: &ReducerContext, row: &AiTask) -> AiTaskSnapshot { - let mut stages = ctx - .db - .ai_task_stage() - .iter() - .filter(|stage| stage.task_id == row.task_id) - .map(|stage| build_ai_task_stage_snapshot_from_row(&stage)) - .collect::>(); - stages.sort_by_key(|stage| stage.order); - - let mut result_references = ctx - .db - .ai_result_reference() - .iter() - .filter(|reference| reference.task_id == row.task_id) - .map(|reference| build_ai_result_reference_snapshot_from_row(&reference)) - .collect::>(); - result_references.sort_by_key(|reference| reference.created_at_micros); - - AiTaskSnapshot { - task_id: row.task_id.clone(), - task_kind: row.task_kind, - owner_user_id: row.owner_user_id.clone(), - request_label: row.request_label.clone(), - source_module: row.source_module.clone(), - source_entity_id: row.source_entity_id.clone(), - request_payload_json: row.request_payload_json.clone(), - status: row.status, - failure_message: row.failure_message.clone(), - stages, - result_references, - latest_text_output: row.latest_text_output.clone(), - latest_structured_payload_json: row.latest_structured_payload_json.clone(), - version: row.version, - created_at_micros: row.created_at.to_micros_since_unix_epoch(), - started_at_micros: row - .started_at - .map(|value| value.to_micros_since_unix_epoch()), - completed_at_micros: row - .completed_at - .map(|value| value.to_micros_since_unix_epoch()), - updated_at_micros: row.updated_at.to_micros_since_unix_epoch(), - } -} - -fn build_ai_task_stage_row(task_id: &str, snapshot: &AiTaskStageSnapshot) -> AiTaskStage { - AiTaskStage { - task_stage_id: generate_ai_task_stage_id(task_id, snapshot.stage_kind), - task_id: task_id.to_string(), - stage_kind: snapshot.stage_kind, - label: snapshot.label.clone(), - detail: snapshot.detail.clone(), - stage_order: snapshot.order, - status: snapshot.status, - text_output: snapshot.text_output.clone(), - structured_payload_json: snapshot.structured_payload_json.clone(), - warning_messages: snapshot.warning_messages.clone(), - started_at: snapshot - .started_at_micros - .map(Timestamp::from_micros_since_unix_epoch), - completed_at: snapshot - .completed_at_micros - .map(Timestamp::from_micros_since_unix_epoch), - } -} - -fn build_ai_task_stage_snapshot_from_row(row: &AiTaskStage) -> AiTaskStageSnapshot { - AiTaskStageSnapshot { - stage_kind: row.stage_kind, - label: row.label.clone(), - detail: row.detail.clone(), - order: row.stage_order, - status: row.status, - text_output: row.text_output.clone(), - structured_payload_json: row.structured_payload_json.clone(), - warning_messages: row.warning_messages.clone(), - started_at_micros: row - .started_at - .map(|value| value.to_micros_since_unix_epoch()), - completed_at_micros: row - .completed_at - .map(|value| value.to_micros_since_unix_epoch()), - } -} - -fn build_ai_text_chunk_row(snapshot: &AiTextChunkSnapshot) -> AiTextChunk { - AiTextChunk { - text_chunk_row_id: format!( - "{}{}_{}_{}", - AI_TEXT_CHUNK_ID_PREFIX, - snapshot.task_id, - snapshot.stage_kind.as_str(), - snapshot.sequence - ), - chunk_id: snapshot.chunk_id.clone(), - task_id: snapshot.task_id.clone(), - stage_kind: snapshot.stage_kind, - sequence: snapshot.sequence, - delta_text: snapshot.delta_text.clone(), - created_at: Timestamp::from_micros_since_unix_epoch(snapshot.created_at_micros), - } -} - -fn build_ai_text_chunk_snapshot_from_row(row: &AiTextChunk) -> AiTextChunkSnapshot { - AiTextChunkSnapshot { - chunk_id: row.chunk_id.clone(), - task_id: row.task_id.clone(), - stage_kind: row.stage_kind, - sequence: row.sequence, - delta_text: row.delta_text.clone(), - created_at_micros: row.created_at.to_micros_since_unix_epoch(), - } -} - -fn build_ai_result_reference_row(snapshot: &AiResultReferenceSnapshot) -> AiResultReference { - AiResultReference { - result_reference_row_id: format!( - "{}{}_{}", - AI_RESULT_REF_ID_PREFIX, snapshot.task_id, snapshot.result_ref_id - ), - result_ref_id: snapshot.result_ref_id.clone(), - task_id: snapshot.task_id.clone(), - reference_kind: snapshot.reference_kind, - reference_id: snapshot.reference_id.clone(), - label: snapshot.label.clone(), - created_at: Timestamp::from_micros_since_unix_epoch(snapshot.created_at_micros), - } -} - -fn build_ai_result_reference_snapshot_from_row( - row: &AiResultReference, -) -> AiResultReferenceSnapshot { - AiResultReferenceSnapshot { - result_ref_id: row.result_ref_id.clone(), - task_id: row.task_id.clone(), - reference_kind: row.reference_kind, - reference_id: row.reference_id.clone(), - label: row.label.clone(), - created_at_micros: row.created_at.to_micros_since_unix_epoch(), - } -} +pub(crate) use snapshots::*; +pub use stages::*; +pub use tasks::*; diff --git a/server-rs/crates/spacetime-module/src/ai/snapshots.rs b/server-rs/crates/spacetime-module/src/ai/snapshots.rs index 4ecf75e6..f30fdc30 100644 --- a/server-rs/crates/spacetime-module/src/ai/snapshots.rs +++ b/server-rs/crates/spacetime-module/src/ai/snapshots.rs @@ -1 +1,174 @@ -// AI snapshot / row 转换 helper 落位点。 +use crate::*; +use module_ai::{AI_RESULT_REF_ID_PREFIX, AI_TEXT_CHUNK_ID_PREFIX}; + +pub(crate) fn build_ai_task_row(snapshot: &AiTaskSnapshot) -> AiTask { + AiTask { + task_id: snapshot.task_id.clone(), + task_kind: snapshot.task_kind, + owner_user_id: snapshot.owner_user_id.clone(), + request_label: snapshot.request_label.clone(), + source_module: snapshot.source_module.clone(), + source_entity_id: snapshot.source_entity_id.clone(), + request_payload_json: snapshot.request_payload_json.clone(), + status: snapshot.status, + failure_message: snapshot.failure_message.clone(), + latest_text_output: snapshot.latest_text_output.clone(), + latest_structured_payload_json: snapshot.latest_structured_payload_json.clone(), + version: snapshot.version, + created_at: Timestamp::from_micros_since_unix_epoch(snapshot.created_at_micros), + started_at: snapshot + .started_at_micros + .map(Timestamp::from_micros_since_unix_epoch), + completed_at: snapshot + .completed_at_micros + .map(Timestamp::from_micros_since_unix_epoch), + updated_at: Timestamp::from_micros_since_unix_epoch(snapshot.updated_at_micros), + } +} + +pub(crate) fn build_ai_task_snapshot_from_row( + ctx: &ReducerContext, + row: &AiTask, +) -> AiTaskSnapshot { + let mut stages = ctx + .db + .ai_task_stage() + .iter() + .filter(|stage| stage.task_id == row.task_id) + .map(|stage| build_ai_task_stage_snapshot_from_row(&stage)) + .collect::>(); + stages.sort_by_key(|stage| stage.order); + + let mut result_references = ctx + .db + .ai_result_reference() + .iter() + .filter(|reference| reference.task_id == row.task_id) + .map(|reference| build_ai_result_reference_snapshot_from_row(&reference)) + .collect::>(); + result_references.sort_by_key(|reference| reference.created_at_micros); + + AiTaskSnapshot { + task_id: row.task_id.clone(), + task_kind: row.task_kind, + owner_user_id: row.owner_user_id.clone(), + request_label: row.request_label.clone(), + source_module: row.source_module.clone(), + source_entity_id: row.source_entity_id.clone(), + request_payload_json: row.request_payload_json.clone(), + status: row.status, + failure_message: row.failure_message.clone(), + stages, + result_references, + latest_text_output: row.latest_text_output.clone(), + latest_structured_payload_json: row.latest_structured_payload_json.clone(), + version: row.version, + created_at_micros: row.created_at.to_micros_since_unix_epoch(), + started_at_micros: row + .started_at + .map(|value| value.to_micros_since_unix_epoch()), + completed_at_micros: row + .completed_at + .map(|value| value.to_micros_since_unix_epoch()), + updated_at_micros: row.updated_at.to_micros_since_unix_epoch(), + } +} + +pub(crate) fn build_ai_task_stage_row(task_id: &str, snapshot: &AiTaskStageSnapshot) -> AiTaskStage { + AiTaskStage { + task_stage_id: generate_ai_task_stage_id(task_id, snapshot.stage_kind), + task_id: task_id.to_string(), + stage_kind: snapshot.stage_kind, + label: snapshot.label.clone(), + detail: snapshot.detail.clone(), + stage_order: snapshot.order, + status: snapshot.status, + text_output: snapshot.text_output.clone(), + structured_payload_json: snapshot.structured_payload_json.clone(), + warning_messages: snapshot.warning_messages.clone(), + started_at: snapshot + .started_at_micros + .map(Timestamp::from_micros_since_unix_epoch), + completed_at: snapshot + .completed_at_micros + .map(Timestamp::from_micros_since_unix_epoch), + } +} + +pub(crate) fn build_ai_task_stage_snapshot_from_row(row: &AiTaskStage) -> AiTaskStageSnapshot { + AiTaskStageSnapshot { + stage_kind: row.stage_kind, + label: row.label.clone(), + detail: row.detail.clone(), + order: row.stage_order, + status: row.status, + text_output: row.text_output.clone(), + structured_payload_json: row.structured_payload_json.clone(), + warning_messages: row.warning_messages.clone(), + started_at_micros: row + .started_at + .map(|value| value.to_micros_since_unix_epoch()), + completed_at_micros: row + .completed_at + .map(|value| value.to_micros_since_unix_epoch()), + } +} + +pub(crate) fn build_ai_text_chunk_row(snapshot: &AiTextChunkSnapshot) -> AiTextChunk { + AiTextChunk { + text_chunk_row_id: format!( + "{}{}_{}_{}", + AI_TEXT_CHUNK_ID_PREFIX, + snapshot.task_id, + snapshot.stage_kind.as_str(), + snapshot.sequence + ), + chunk_id: snapshot.chunk_id.clone(), + task_id: snapshot.task_id.clone(), + stage_kind: snapshot.stage_kind, + sequence: snapshot.sequence, + delta_text: snapshot.delta_text.clone(), + created_at: Timestamp::from_micros_since_unix_epoch(snapshot.created_at_micros), + } +} + +pub(crate) fn build_ai_text_chunk_snapshot_from_row(row: &AiTextChunk) -> AiTextChunkSnapshot { + AiTextChunkSnapshot { + chunk_id: row.chunk_id.clone(), + task_id: row.task_id.clone(), + stage_kind: row.stage_kind, + sequence: row.sequence, + delta_text: row.delta_text.clone(), + created_at_micros: row.created_at.to_micros_since_unix_epoch(), + } +} + +pub(crate) fn build_ai_result_reference_row( + snapshot: &AiResultReferenceSnapshot, +) -> AiResultReference { + AiResultReference { + result_reference_row_id: format!( + "{}{}_{}", + AI_RESULT_REF_ID_PREFIX, snapshot.task_id, snapshot.result_ref_id + ), + result_ref_id: snapshot.result_ref_id.clone(), + task_id: snapshot.task_id.clone(), + reference_kind: snapshot.reference_kind, + reference_id: snapshot.reference_id.clone(), + label: snapshot.label.clone(), + created_at: Timestamp::from_micros_since_unix_epoch(snapshot.created_at_micros), + } +} + +pub(crate) fn build_ai_result_reference_snapshot_from_row( + row: &AiResultReference, +) -> AiResultReferenceSnapshot { + AiResultReferenceSnapshot { + result_ref_id: row.result_ref_id.clone(), + task_id: row.task_id.clone(), + reference_kind: row.reference_kind, + reference_id: row.reference_id.clone(), + label: row.label.clone(), + created_at_micros: row.created_at.to_micros_since_unix_epoch(), + } +} diff --git a/server-rs/crates/spacetime-module/src/ai/stages.rs b/server-rs/crates/spacetime-module/src/ai/stages.rs index 0d91d412..625cc505 100644 --- a/server-rs/crates/spacetime-module/src/ai/stages.rs +++ b/server-rs/crates/spacetime-module/src/ai/stages.rs @@ -1 +1,315 @@ -// AI stage、chunk、reference 与阶段级 helper 落位点。 +use crate::*; +use module_ai::{generate_ai_result_ref_id, generate_ai_text_chunk_id, normalize_optional_text, normalize_string_list}; + +#[spacetimedb::table( + accessor = ai_task_stage, + index(accessor = by_ai_task_stage_task_id, btree(columns = [task_id])), + index(accessor = by_ai_task_stage_task_order, btree(columns = [task_id, stage_order])) +)] +pub struct AiTaskStage { + #[primary_key] + pub(crate) task_stage_id: String, + pub(crate) task_id: String, + pub(crate) stage_kind: AiTaskStageKind, + pub(crate) label: String, + pub(crate) detail: String, + pub(crate) stage_order: u32, + pub(crate) status: AiTaskStageStatus, + pub(crate) text_output: Option, + pub(crate) structured_payload_json: Option, + pub(crate) warning_messages: Vec, + pub(crate) started_at: Option, + pub(crate) completed_at: Option, +} + +#[spacetimedb::table( + accessor = ai_text_chunk, + index(accessor = by_ai_text_chunk_task_id, btree(columns = [task_id])), + index( + accessor = by_ai_text_chunk_task_stage_sequence, + btree(columns = [task_id, stage_kind, sequence]) + ) +)] +pub struct AiTextChunk { + #[primary_key] + pub(crate) text_chunk_row_id: String, + pub(crate) chunk_id: String, + pub(crate) task_id: String, + pub(crate) stage_kind: AiTaskStageKind, + pub(crate) sequence: u32, + pub(crate) delta_text: String, + pub(crate) created_at: Timestamp, +} + +#[spacetimedb::table( + accessor = ai_result_reference, + index(accessor = by_ai_result_reference_task_id, btree(columns = [task_id])) +)] +pub struct AiResultReference { + #[primary_key] + pub(crate) result_reference_row_id: String, + pub(crate) result_ref_id: String, + pub(crate) task_id: String, + pub(crate) reference_kind: AiResultReferenceKind, + pub(crate) reference_id: String, + pub(crate) label: Option, + pub(crate) created_at: Timestamp, +} + +#[spacetimedb::reducer] +pub fn start_ai_task_stage( + ctx: &ReducerContext, + input: AiTaskStageStartInput, +) -> Result<(), String> { + start_ai_task_stage_tx(ctx, input).map(|_| ()) +} + +// 流式增量写入需要同步返回 chunk 与聚合后的任务快照,方便后续 Axum facade 直接复用。 +#[spacetimedb::procedure] +pub fn append_ai_text_chunk_and_return( + ctx: &mut ProcedureContext, + input: AiTextChunkAppendInput, +) -> AiTaskProcedureResult { + match ctx.try_with_tx(|tx| append_ai_text_chunk_tx(tx, input.clone())) { + Ok((task, text_chunk)) => AiTaskProcedureResult { + ok: true, + task: Some(task), + text_chunk: Some(text_chunk), + error_message: None, + }, + Err(message) => AiTaskProcedureResult { + ok: false, + task: None, + text_chunk: None, + error_message: Some(message), + }, + } +} + +#[spacetimedb::procedure] +pub fn complete_ai_stage_and_return( + ctx: &mut ProcedureContext, + input: AiStageCompletionInput, +) -> AiTaskProcedureResult { + match ctx.try_with_tx(|tx| complete_ai_stage_tx(tx, input.clone())) { + Ok(task) => AiTaskProcedureResult { + ok: true, + task: Some(task), + text_chunk: None, + error_message: None, + }, + Err(message) => AiTaskProcedureResult { + ok: false, + task: None, + text_chunk: None, + error_message: Some(message), + }, + } +} + +#[spacetimedb::procedure] +pub fn attach_ai_result_reference_and_return( + ctx: &mut ProcedureContext, + input: AiResultReferenceInput, +) -> AiTaskProcedureResult { + match ctx.try_with_tx(|tx| attach_ai_result_reference_tx(tx, input.clone())) { + Ok(task) => AiTaskProcedureResult { + ok: true, + task: Some(task), + text_chunk: None, + error_message: None, + }, + Err(message) => AiTaskProcedureResult { + ok: false, + task: None, + text_chunk: None, + error_message: Some(message), + }, + } +} + +pub(crate) fn start_ai_task_stage_tx( + ctx: &ReducerContext, + input: AiTaskStageStartInput, +) -> Result { + let mut snapshot = get_ai_task_snapshot_tx(ctx, &input.task_id)?; + ensure_ai_task_can_transition(snapshot.status)?; + + let stage = snapshot + .stages + .iter_mut() + .find(|stage| stage.stage_kind == input.stage_kind) + .ok_or_else(|| "ai_task.stage 不存在".to_string())?; + + snapshot.status = AiTaskStatus::Running; + if snapshot.started_at_micros.is_none() { + snapshot.started_at_micros = Some(input.started_at_micros); + } + stage.status = AiTaskStageStatus::Running; + if stage.started_at_micros.is_none() { + stage.started_at_micros = Some(input.started_at_micros); + } + snapshot.updated_at_micros = input.started_at_micros; + snapshot.version += 1; + + persist_ai_task_snapshot(ctx, &snapshot)?; + Ok(snapshot) +} + +pub(crate) fn append_ai_text_chunk_tx( + ctx: &ReducerContext, + input: AiTextChunkAppendInput, +) -> Result<(AiTaskSnapshot, AiTextChunkSnapshot), String> { + if input.delta_text.trim().is_empty() { + return Err("ai_text_chunk.delta_text 不能为空".to_string()); + } + if input.sequence == 0 { + return Err("ai_text_chunk.sequence 必须大于 0".to_string()); + } + + let mut snapshot = get_ai_task_snapshot_tx(ctx, &input.task_id)?; + ensure_ai_task_can_transition(snapshot.status)?; + + let stage = snapshot + .stages + .iter_mut() + .find(|stage| stage.stage_kind == input.stage_kind) + .ok_or_else(|| "ai_task.stage 不存在".to_string())?; + + let chunk = AiTextChunkSnapshot { + chunk_id: generate_ai_text_chunk_id(input.created_at_micros, input.sequence), + task_id: input.task_id.trim().to_string(), + stage_kind: input.stage_kind, + sequence: input.sequence, + delta_text: input.delta_text.trim().to_string(), + created_at_micros: input.created_at_micros, + }; + ctx.db.ai_text_chunk().insert(build_ai_text_chunk_row(&chunk)); + + let aggregated_text = collect_ai_stage_text_output(ctx, &chunk.task_id, chunk.stage_kind); + + snapshot.status = AiTaskStatus::Running; + if snapshot.started_at_micros.is_none() { + snapshot.started_at_micros = Some(input.created_at_micros); + } + stage.status = AiTaskStageStatus::Running; + if stage.started_at_micros.is_none() { + stage.started_at_micros = Some(input.created_at_micros); + } + stage.text_output = aggregated_text.clone(); + snapshot.latest_text_output = aggregated_text; + snapshot.updated_at_micros = input.created_at_micros; + snapshot.version += 1; + + persist_ai_task_snapshot(ctx, &snapshot)?; + Ok((snapshot, chunk)) +} + +pub(crate) fn complete_ai_stage_tx( + ctx: &ReducerContext, + input: AiStageCompletionInput, +) -> Result { + let mut snapshot = get_ai_task_snapshot_tx(ctx, &input.task_id)?; + ensure_ai_task_can_transition(snapshot.status)?; + + let stage = snapshot + .stages + .iter_mut() + .find(|stage| stage.stage_kind == input.stage_kind) + .ok_or_else(|| "ai_task.stage 不存在".to_string())?; + + stage.status = AiTaskStageStatus::Completed; + stage.completed_at_micros = Some(input.completed_at_micros); + stage.text_output = normalize_optional_text(input.text_output.clone()); + stage.structured_payload_json = normalize_optional_text(input.structured_payload_json.clone()); + stage.warning_messages = normalize_string_list(input.warning_messages.clone()); + + snapshot.latest_text_output = stage.text_output.clone(); + snapshot.latest_structured_payload_json = stage.structured_payload_json.clone(); + snapshot.updated_at_micros = input.completed_at_micros; + snapshot.version += 1; + + persist_ai_task_snapshot(ctx, &snapshot)?; + Ok(snapshot) +} + +pub(crate) fn attach_ai_result_reference_tx( + ctx: &ReducerContext, + input: AiResultReferenceInput, +) -> Result { + let reference_id = input.reference_id.trim().to_string(); + if reference_id.is_empty() { + return Err("ai_result_reference.reference_id 不能为空".to_string()); + } + + let mut snapshot = get_ai_task_snapshot_tx(ctx, &input.task_id)?; + ensure_ai_task_can_transition(snapshot.status)?; + + let reference = AiResultReferenceSnapshot { + result_ref_id: generate_ai_result_ref_id(input.created_at_micros), + task_id: input.task_id.trim().to_string(), + reference_kind: input.reference_kind, + reference_id, + label: normalize_optional_text(input.label), + created_at_micros: input.created_at_micros, + }; + ctx.db + .ai_result_reference() + .insert(build_ai_result_reference_row(&reference)); + + snapshot.result_references.push(reference); + snapshot.updated_at_micros = input.created_at_micros; + snapshot.version += 1; + + persist_ai_task_snapshot(ctx, &snapshot)?; + Ok(snapshot) +} + +pub(crate) fn replace_ai_task_stages( + ctx: &ReducerContext, + task_id: &str, + stages: &[AiTaskStageSnapshot], +) { + let stage_ids = ctx + .db + .ai_task_stage() + .iter() + .filter(|row| row.task_id == task_id) + .map(|row| row.task_stage_id.clone()) + .collect::>(); + for stage_id in stage_ids { + ctx.db.ai_task_stage().task_stage_id().delete(&stage_id); + } + + for stage in stages { + ctx.db + .ai_task_stage() + .insert(build_ai_task_stage_row(task_id, stage)); + } +} + +pub(crate) fn collect_ai_stage_text_output( + ctx: &ReducerContext, + task_id: &str, + stage_kind: AiTaskStageKind, +) -> Option { + let mut chunks = ctx + .db + .ai_text_chunk() + .iter() + .filter(|row| row.task_id == task_id && row.stage_kind == stage_kind) + .map(|row| build_ai_text_chunk_snapshot_from_row(&row)) + .collect::>(); + chunks.sort_by_key(|chunk| chunk.sequence); + + let aggregated = chunks + .into_iter() + .map(|chunk| chunk.delta_text) + .collect::>() + .join(""); + if aggregated.trim().is_empty() { + None + } else { + Some(aggregated) + } +} diff --git a/server-rs/crates/spacetime-module/src/ai/tasks.rs b/server-rs/crates/spacetime-module/src/ai/tasks.rs index 084b05f6..95bb4055 100644 --- a/server-rs/crates/spacetime-module/src/ai/tasks.rs +++ b/server-rs/crates/spacetime-module/src/ai/tasks.rs @@ -1 +1,285 @@ -// AI task reducer / procedure 与任务状态迁移落位点。 +use crate::*; +use module_ai::{normalize_optional_text, validate_task_create_input, INITIAL_AI_TASK_VERSION}; + +#[spacetimedb::table( + accessor = ai_task, + index(accessor = by_ai_task_owner_user_id, btree(columns = [owner_user_id])), + index(accessor = by_ai_task_status, btree(columns = [status])), + index(accessor = by_ai_task_kind, btree(columns = [task_kind])) +)] +pub struct AiTask { + #[primary_key] + pub(crate) task_id: String, + pub(crate) task_kind: AiTaskKind, + pub(crate) owner_user_id: String, + pub(crate) request_label: String, + pub(crate) source_module: String, + pub(crate) source_entity_id: Option, + pub(crate) request_payload_json: Option, + pub(crate) status: AiTaskStatus, + pub(crate) failure_message: Option, + pub(crate) latest_text_output: Option, + pub(crate) latest_structured_payload_json: Option, + pub(crate) version: u32, + pub(crate) created_at: Timestamp, + pub(crate) started_at: Option, + pub(crate) completed_at: Option, + pub(crate) updated_at: Timestamp, +} + +// AI 任务当前先固定成 private 真相表,后续由 Axum / platform-llm 再往外包一层 HTTP 与 SSE 协议。 +#[spacetimedb::reducer] +pub fn create_ai_task(ctx: &ReducerContext, input: AiTaskCreateInput) -> Result<(), String> { + create_ai_task_tx(ctx, input).map(|_| ()) +} + +#[spacetimedb::procedure] +pub fn create_ai_task_and_return( + ctx: &mut ProcedureContext, + input: AiTaskCreateInput, +) -> AiTaskProcedureResult { + match ctx.try_with_tx(|tx| create_ai_task_tx(tx, input.clone())) { + Ok(task) => AiTaskProcedureResult { + ok: true, + task: Some(task), + text_chunk: None, + error_message: None, + }, + Err(message) => AiTaskProcedureResult { + ok: false, + task: None, + text_chunk: None, + error_message: Some(message), + }, + } +} + +#[spacetimedb::reducer] +pub fn start_ai_task(ctx: &ReducerContext, input: AiTaskStartInput) -> Result<(), String> { + start_ai_task_tx(ctx, input).map(|_| ()) +} + +#[spacetimedb::procedure] +pub fn complete_ai_task_and_return( + ctx: &mut ProcedureContext, + input: AiTaskFinishInput, +) -> AiTaskProcedureResult { + match ctx.try_with_tx(|tx| complete_ai_task_tx(tx, input.clone())) { + Ok(task) => AiTaskProcedureResult { + ok: true, + task: Some(task), + text_chunk: None, + error_message: None, + }, + Err(message) => AiTaskProcedureResult { + ok: false, + task: None, + text_chunk: None, + error_message: Some(message), + }, + } +} + +#[spacetimedb::procedure] +pub fn fail_ai_task_and_return( + ctx: &mut ProcedureContext, + input: AiTaskFailureInput, +) -> AiTaskProcedureResult { + match ctx.try_with_tx(|tx| fail_ai_task_tx(tx, input.clone())) { + Ok(task) => AiTaskProcedureResult { + ok: true, + task: Some(task), + text_chunk: None, + error_message: None, + }, + Err(message) => AiTaskProcedureResult { + ok: false, + task: None, + text_chunk: None, + error_message: Some(message), + }, + } +} + +#[spacetimedb::procedure] +pub fn cancel_ai_task_and_return( + ctx: &mut ProcedureContext, + input: AiTaskCancelInput, +) -> AiTaskProcedureResult { + match ctx.try_with_tx(|tx| cancel_ai_task_tx(tx, input.clone())) { + Ok(task) => AiTaskProcedureResult { + ok: true, + task: Some(task), + text_chunk: None, + error_message: None, + }, + Err(message) => AiTaskProcedureResult { + ok: false, + task: None, + text_chunk: None, + error_message: Some(message), + }, + } +} + +fn create_ai_task_tx( + ctx: &ReducerContext, + input: AiTaskCreateInput, +) -> Result { + validate_task_create_input(&input).map_err(|error| error.to_string())?; + + if ctx.db.ai_task().task_id().find(&input.task_id).is_some() { + return Err("ai_task.task_id 已存在".to_string()); + } + + let task_snapshot = build_ai_task_snapshot_from_create_input(&input); + ctx.db.ai_task().insert(build_ai_task_row(&task_snapshot)); + replace_ai_task_stages(ctx, &task_snapshot.task_id, &task_snapshot.stages); + + get_ai_task_snapshot_tx(ctx, &task_snapshot.task_id) +} + +fn start_ai_task_tx( + ctx: &ReducerContext, + input: AiTaskStartInput, +) -> Result { + let mut snapshot = get_ai_task_snapshot_tx(ctx, &input.task_id)?; + ensure_ai_task_can_transition(snapshot.status)?; + + snapshot.status = AiTaskStatus::Running; + if snapshot.started_at_micros.is_none() { + snapshot.started_at_micros = Some(input.started_at_micros); + } + snapshot.updated_at_micros = input.started_at_micros; + snapshot.version += 1; + + persist_ai_task_snapshot(ctx, &snapshot)?; + Ok(snapshot) +} + +fn complete_ai_task_tx( + ctx: &ReducerContext, + input: AiTaskFinishInput, +) -> Result { + let mut snapshot = get_ai_task_snapshot_tx(ctx, &input.task_id)?; + ensure_ai_task_can_transition(snapshot.status)?; + + snapshot.status = AiTaskStatus::Completed; + snapshot.completed_at_micros = Some(input.completed_at_micros); + snapshot.updated_at_micros = input.completed_at_micros; + snapshot.version += 1; + + persist_ai_task_snapshot(ctx, &snapshot)?; + Ok(snapshot) +} + +fn fail_ai_task_tx( + ctx: &ReducerContext, + input: AiTaskFailureInput, +) -> Result { + let failure_message = input.failure_message.trim().to_string(); + if failure_message.is_empty() { + return Err("ai_task.failure_message 不能为空".to_string()); + } + + let mut snapshot = get_ai_task_snapshot_tx(ctx, &input.task_id)?; + ensure_ai_task_can_transition(snapshot.status)?; + + snapshot.status = AiTaskStatus::Failed; + snapshot.failure_message = Some(failure_message); + snapshot.completed_at_micros = Some(input.completed_at_micros); + snapshot.updated_at_micros = input.completed_at_micros; + snapshot.version += 1; + + persist_ai_task_snapshot(ctx, &snapshot)?; + Ok(snapshot) +} + +fn cancel_ai_task_tx( + ctx: &ReducerContext, + input: AiTaskCancelInput, +) -> Result { + let mut snapshot = get_ai_task_snapshot_tx(ctx, &input.task_id)?; + ensure_ai_task_can_transition(snapshot.status)?; + + snapshot.status = AiTaskStatus::Cancelled; + snapshot.completed_at_micros = Some(input.completed_at_micros); + snapshot.updated_at_micros = input.completed_at_micros; + snapshot.version += 1; + + persist_ai_task_snapshot(ctx, &snapshot)?; + Ok(snapshot) +} + +pub(crate) fn get_ai_task_snapshot_tx( + ctx: &ReducerContext, + task_id: &str, +) -> Result { + let row = ctx + .db + .ai_task() + .task_id() + .find(&task_id.trim().to_string()) + .ok_or_else(|| "ai_task 不存在".to_string())?; + + Ok(build_ai_task_snapshot_from_row(ctx, &row)) +} + +pub(crate) fn persist_ai_task_snapshot( + ctx: &ReducerContext, + snapshot: &AiTaskSnapshot, +) -> Result<(), String> { + ctx.db.ai_task().task_id().delete(&snapshot.task_id); + ctx.db.ai_task().insert(build_ai_task_row(snapshot)); + replace_ai_task_stages(ctx, &snapshot.task_id, &snapshot.stages); + Ok(()) +} + +pub(crate) fn ensure_ai_task_can_transition(status: AiTaskStatus) -> Result<(), String> { + if matches!( + status, + AiTaskStatus::Completed | AiTaskStatus::Failed | AiTaskStatus::Cancelled + ) { + Err("当前 ai_task 状态不允许执行该操作".to_string()) + } else { + Ok(()) + } +} + +fn build_ai_task_snapshot_from_create_input(input: &AiTaskCreateInput) -> AiTaskSnapshot { + AiTaskSnapshot { + task_id: input.task_id.trim().to_string(), + task_kind: input.task_kind, + owner_user_id: input.owner_user_id.trim().to_string(), + request_label: input.request_label.trim().to_string(), + source_module: input.source_module.trim().to_string(), + source_entity_id: normalize_optional_text(input.source_entity_id.clone()), + request_payload_json: normalize_optional_text(input.request_payload_json.clone()), + status: AiTaskStatus::Pending, + failure_message: None, + stages: input + .stages + .iter() + .map(|stage| AiTaskStageSnapshot { + stage_kind: stage.stage_kind, + label: stage.label.trim().to_string(), + detail: stage.detail.trim().to_string(), + order: stage.order, + status: AiTaskStageStatus::Pending, + text_output: None, + structured_payload_json: None, + warning_messages: Vec::new(), + started_at_micros: None, + completed_at_micros: None, + }) + .collect(), + result_references: Vec::new(), + latest_text_output: None, + latest_structured_payload_json: None, + version: INITIAL_AI_TASK_VERSION, + created_at_micros: input.created_at_micros, + started_at_micros: None, + completed_at_micros: None, + updated_at_micros: input.created_at_micros, + } +} diff --git a/server-rs/crates/spacetime-module/src/big_fish/assets.rs b/server-rs/crates/spacetime-module/src/big_fish/assets.rs index c3c4902e..f63f8648 100644 --- a/server-rs/crates/spacetime-module/src/big_fish/assets.rs +++ b/server-rs/crates/spacetime-module/src/big_fish/assets.rs @@ -1,5 +1,5 @@ -use crate::*; use crate::big_fish::tables::{big_fish_asset_slot, big_fish_creation_session}; +use crate::*; #[spacetimedb::procedure] pub fn generate_big_fish_asset( diff --git a/server-rs/crates/spacetime-module/src/big_fish/runtime.rs b/server-rs/crates/spacetime-module/src/big_fish/runtime.rs index 31bc57f9..67b80056 100644 --- a/server-rs/crates/spacetime-module/src/big_fish/runtime.rs +++ b/server-rs/crates/spacetime-module/src/big_fish/runtime.rs @@ -1,5 +1,5 @@ -use crate::*; use crate::big_fish::tables::{big_fish_creation_session, big_fish_runtime_run}; +use crate::*; #[spacetimedb::procedure] pub fn start_big_fish_run( diff --git a/server-rs/crates/spacetime-module/src/big_fish/session.rs b/server-rs/crates/spacetime-module/src/big_fish/session.rs index 2cb4287c..fcf4536e 100644 --- a/server-rs/crates/spacetime-module/src/big_fish/session.rs +++ b/server-rs/crates/spacetime-module/src/big_fish/session.rs @@ -1,5 +1,5 @@ -use crate::*; use crate::big_fish::tables::{big_fish_agent_message, big_fish_creation_session}; +use crate::*; #[spacetimedb::procedure] pub fn create_big_fish_session( diff --git a/server-rs/crates/spacetime-module/src/lib.rs b/server-rs/crates/spacetime-module/src/lib.rs index cb2dbb80..33ef5f07 100644 --- a/server-rs/crates/spacetime-module/src/lib.rs +++ b/server-rs/crates/spacetime-module/src/lib.rs @@ -17,158 +17,25 @@ use module_npc::resolve_npc_interaction as resolve_npc_interaction_domain; use module_quest::{ acknowledge_quest_completion as acknowledge_quest_record_completion, apply_quest_signal as apply_quest_record_signal, - normalize_optional_text as normalize_quest_optional_text, - normalize_string_list as normalize_quest_string_list, }; -pub(crate) use serde_json::{json, Map as JsonMap, Value as JsonValue}; +pub(crate) use serde_json::{Map as JsonMap, Value as JsonValue, json}; pub(crate) use shared_kernel::format_timestamp_micros; pub use spacetimedb::{ProcedureContext, ReducerContext, SpacetimeType, Table, Timestamp}; +mod ai; mod asset_metadata; mod big_fish; mod domain_types; mod entry; mod puzzle; +mod runtime; +pub use ai::*; pub use asset_metadata::*; pub use big_fish::*; pub use domain_types::*; pub use entry::*; - -#[spacetimedb::table(accessor = runtime_setting)] -pub struct RuntimeSetting { - #[primary_key] - user_id: String, - music_volume: f32, - platform_theme: RuntimePlatformTheme, - created_at: Timestamp, - 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])), - index( - accessor = by_browse_history_user_owner_profile, - btree(columns = [user_id, owner_user_id, profile_id]) - ) -)] -pub struct UserBrowseHistory { - #[primary_key] - browse_history_id: String, - user_id: String, - owner_user_id: String, - profile_id: String, - world_name: String, - subtitle: String, - summary_text: String, - cover_image_src: Option, - theme_mode: RuntimeBrowseHistoryThemeMode, - author_display_name: String, - visited_at: Timestamp, - created_at: Timestamp, - updated_at: Timestamp, -} - -#[spacetimedb::table(accessor = profile_dashboard_state)] -pub struct ProfileDashboardState { - #[primary_key] - user_id: String, - wallet_balance: u64, - total_play_time_ms: u64, - created_at: Timestamp, - updated_at: Timestamp, -} - -#[spacetimedb::table( - accessor = profile_wallet_ledger, - index(accessor = by_profile_wallet_ledger_user_id, btree(columns = [user_id])), - index( - accessor = by_profile_wallet_ledger_user_created_at, - btree(columns = [user_id, created_at]) - ) -)] -pub struct ProfileWalletLedger { - #[primary_key] - wallet_ledger_id: String, - user_id: String, - amount_delta: i64, - balance_after: u64, - source_type: RuntimeProfileWalletLedgerSourceType, - created_at: Timestamp, -} - -#[spacetimedb::table( - accessor = profile_played_world, - index(accessor = by_profile_played_world_user_id, btree(columns = [user_id])), - index( - accessor = by_profile_played_world_user_world_key, - btree(columns = [user_id, world_key]) - ), - index( - accessor = by_profile_played_world_user_last_played_at, - btree(columns = [user_id, last_played_at]) - ) -)] -pub struct ProfilePlayedWorld { - #[primary_key] - played_world_id: String, - user_id: String, - world_key: String, - owner_user_id: Option, - profile_id: Option, - world_type: Option, - world_title: String, - world_subtitle: String, - first_played_at: Timestamp, - last_played_at: Timestamp, - 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, -} +pub use runtime::*; #[spacetimedb::table(accessor = player_progression)] pub struct PlayerProgression { @@ -278,87 +145,6 @@ pub struct StoryEvent { created_at: Timestamp, } -#[spacetimedb::table( - accessor = ai_task, - index(accessor = by_ai_task_owner_user_id, btree(columns = [owner_user_id])), - index(accessor = by_ai_task_status, btree(columns = [status])), - index(accessor = by_ai_task_kind, btree(columns = [task_kind])) -)] -pub struct AiTask { - #[primary_key] - task_id: String, - task_kind: AiTaskKind, - owner_user_id: String, - request_label: String, - source_module: String, - source_entity_id: Option, - request_payload_json: Option, - status: AiTaskStatus, - failure_message: Option, - latest_text_output: Option, - latest_structured_payload_json: Option, - version: u32, - created_at: Timestamp, - started_at: Option, - completed_at: Option, - updated_at: Timestamp, -} - -#[spacetimedb::table( - accessor = ai_task_stage, - index(accessor = by_ai_task_stage_task_id, btree(columns = [task_id])), - index(accessor = by_ai_task_stage_task_order, btree(columns = [task_id, stage_order])) -)] -pub struct AiTaskStage { - #[primary_key] - task_stage_id: String, - task_id: String, - stage_kind: AiTaskStageKind, - label: String, - detail: String, - stage_order: u32, - status: AiTaskStageStatus, - text_output: Option, - structured_payload_json: Option, - warning_messages: Vec, - started_at: Option, - completed_at: Option, -} - -#[spacetimedb::table( - accessor = ai_text_chunk, - index(accessor = by_ai_text_chunk_task_id, btree(columns = [task_id])), - index( - accessor = by_ai_text_chunk_task_stage_sequence, - btree(columns = [task_id, stage_kind, sequence]) - ) -)] -pub struct AiTextChunk { - #[primary_key] - text_chunk_row_id: String, - chunk_id: String, - task_id: String, - stage_kind: AiTaskStageKind, - sequence: u32, - delta_text: String, - created_at: Timestamp, -} - -#[spacetimedb::table( - accessor = ai_result_reference, - index(accessor = by_ai_result_reference_task_id, btree(columns = [task_id])) -)] -pub struct AiResultReference { - #[primary_key] - result_reference_row_id: String, - result_ref_id: String, - task_id: String, - reference_kind: AiResultReferenceKind, - reference_id: String, - label: Option, - created_at: Timestamp, -} - #[spacetimedb::table( accessor = inventory_slot, index(accessor = by_inventory_runtime_session_id, btree(columns = [runtime_session_id])), @@ -1790,173 +1576,6 @@ fn finalize_custom_world_agent_message_turn_tx( Ok(build_custom_world_agent_operation_snapshot(&next_operation)) } -// AI 任务当前先固定成 private 真相表,后续由 Axum / platform-llm 再往外包一层 HTTP 与 SSE 协议。 -#[spacetimedb::reducer] -pub fn create_ai_task(ctx: &ReducerContext, input: AiTaskCreateInput) -> Result<(), String> { - create_ai_task_tx(ctx, input).map(|_| ()) -} - -#[spacetimedb::procedure] -pub fn create_ai_task_and_return( - ctx: &mut ProcedureContext, - input: AiTaskCreateInput, -) -> AiTaskProcedureResult { - match ctx.try_with_tx(|tx| create_ai_task_tx(tx, input.clone())) { - Ok(task) => AiTaskProcedureResult { - ok: true, - task: Some(task), - text_chunk: None, - error_message: None, - }, - Err(message) => AiTaskProcedureResult { - ok: false, - task: None, - text_chunk: None, - error_message: Some(message), - }, - } -} - -#[spacetimedb::reducer] -pub fn start_ai_task(ctx: &ReducerContext, input: AiTaskStartInput) -> Result<(), String> { - start_ai_task_tx(ctx, input).map(|_| ()) -} - -#[spacetimedb::reducer] -pub fn start_ai_task_stage( - ctx: &ReducerContext, - input: AiTaskStageStartInput, -) -> Result<(), String> { - start_ai_task_stage_tx(ctx, input).map(|_| ()) -} - -// 流式增量写入需要同步返回 chunk 与聚合后的任务快照,方便后续 Axum facade 直接复用。 -#[spacetimedb::procedure] -pub fn append_ai_text_chunk_and_return( - ctx: &mut ProcedureContext, - input: AiTextChunkAppendInput, -) -> AiTaskProcedureResult { - match ctx.try_with_tx(|tx| append_ai_text_chunk_tx(tx, input.clone())) { - Ok((task, text_chunk)) => AiTaskProcedureResult { - ok: true, - task: Some(task), - text_chunk: Some(text_chunk), - error_message: None, - }, - Err(message) => AiTaskProcedureResult { - ok: false, - task: None, - text_chunk: None, - error_message: Some(message), - }, - } -} - -#[spacetimedb::procedure] -pub fn complete_ai_stage_and_return( - ctx: &mut ProcedureContext, - input: AiStageCompletionInput, -) -> AiTaskProcedureResult { - match ctx.try_with_tx(|tx| complete_ai_stage_tx(tx, input.clone())) { - Ok(task) => AiTaskProcedureResult { - ok: true, - task: Some(task), - text_chunk: None, - error_message: None, - }, - Err(message) => AiTaskProcedureResult { - ok: false, - task: None, - text_chunk: None, - error_message: Some(message), - }, - } -} - -#[spacetimedb::procedure] -pub fn attach_ai_result_reference_and_return( - ctx: &mut ProcedureContext, - input: AiResultReferenceInput, -) -> AiTaskProcedureResult { - match ctx.try_with_tx(|tx| attach_ai_result_reference_tx(tx, input.clone())) { - Ok(task) => AiTaskProcedureResult { - ok: true, - task: Some(task), - text_chunk: None, - error_message: None, - }, - Err(message) => AiTaskProcedureResult { - ok: false, - task: None, - text_chunk: None, - error_message: Some(message), - }, - } -} - -#[spacetimedb::procedure] -pub fn complete_ai_task_and_return( - ctx: &mut ProcedureContext, - input: AiTaskFinishInput, -) -> AiTaskProcedureResult { - match ctx.try_with_tx(|tx| complete_ai_task_tx(tx, input.clone())) { - Ok(task) => AiTaskProcedureResult { - ok: true, - task: Some(task), - text_chunk: None, - error_message: None, - }, - Err(message) => AiTaskProcedureResult { - ok: false, - task: None, - text_chunk: None, - error_message: Some(message), - }, - } -} - -#[spacetimedb::procedure] -pub fn fail_ai_task_and_return( - ctx: &mut ProcedureContext, - input: AiTaskFailureInput, -) -> AiTaskProcedureResult { - match ctx.try_with_tx(|tx| fail_ai_task_tx(tx, input.clone())) { - Ok(task) => AiTaskProcedureResult { - ok: true, - task: Some(task), - text_chunk: None, - error_message: None, - }, - Err(message) => AiTaskProcedureResult { - ok: false, - task: None, - text_chunk: None, - error_message: Some(message), - }, - } -} - -#[spacetimedb::procedure] -pub fn cancel_ai_task_and_return( - ctx: &mut ProcedureContext, - input: AiTaskCancelInput, -) -> AiTaskProcedureResult { - match ctx.try_with_tx(|tx| cancel_ai_task_tx(tx, input.clone())) { - Ok(task) => AiTaskProcedureResult { - ok: true, - task: Some(task), - text_chunk: None, - error_message: None, - }, - Err(message) => AiTaskProcedureResult { - ok: false, - task: None, - text_chunk: None, - error_message: Some(message), - }, - } -} - // 当前阶段先把 quest_record / quest_log 立成最小任务真相源,后续再把奖励结算和 story action 总分发接进来。 #[spacetimedb::reducer] pub fn accept_quest(ctx: &ReducerContext, input: QuestRecordInput) -> Result<(), String> { @@ -2127,213 +1746,6 @@ pub fn turn_in_quest(ctx: &ReducerContext, input: QuestTurnInInput) -> Result<() Ok(()) } -// procedure 面向 Axum 同步读取设置;若没有持久化记录则返回默认值快照,但不产生额外写入。 -#[spacetimedb::procedure] -pub fn get_runtime_setting_or_default( - ctx: &mut ProcedureContext, - input: RuntimeSettingGetInput, -) -> RuntimeSettingProcedureResult { - match ctx.try_with_tx(|tx| get_runtime_setting_snapshot(tx, input.clone())) { - Ok(record) => RuntimeSettingProcedureResult { - ok: true, - record: Some(record), - error_message: None, - }, - Err(message) => RuntimeSettingProcedureResult { - ok: false, - record: None, - error_message: Some(message), - }, - } -} - -// 当前快照读取保持旧 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( - ctx: &mut ProcedureContext, - input: RuntimeSettingUpsertInput, -) -> RuntimeSettingProcedureResult { - match ctx.try_with_tx(|tx| upsert_runtime_setting(tx, input.clone())) { - Ok(record) => RuntimeSettingProcedureResult { - ok: true, - record: Some(record), - error_message: None, - }, - Err(message) => RuntimeSettingProcedureResult { - ok: false, - record: None, - error_message: Some(message), - }, - } -} - -// 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( - ctx: &mut ProcedureContext, - input: RuntimeProfileDashboardGetInput, -) -> RuntimeProfileDashboardProcedureResult { - match ctx.try_with_tx(|tx| get_profile_dashboard_snapshot(tx, input.clone())) { - Ok(record) => RuntimeProfileDashboardProcedureResult { - ok: true, - record: Some(record), - error_message: None, - }, - Err(message) => RuntimeProfileDashboardProcedureResult { - ok: false, - record: None, - error_message: Some(message), - }, - } -} - -// 钱包流水当前只暴露最近 50 条只读视图,排序与截断逻辑在 procedure 内统一收口。 -#[spacetimedb::procedure] -pub fn list_profile_wallet_ledger( - ctx: &mut ProcedureContext, - input: RuntimeProfileWalletLedgerListInput, -) -> RuntimeProfileWalletLedgerProcedureResult { - match ctx.try_with_tx(|tx| list_profile_wallet_ledger_entries(tx, input.clone())) { - Ok(entries) => RuntimeProfileWalletLedgerProcedureResult { - ok: true, - entries, - error_message: None, - }, - Err(message) => RuntimeProfileWalletLedgerProcedureResult { - ok: false, - entries: Vec::new(), - error_message: Some(message), - }, - } -} - -// play stats 与 dashboard 共用 dashboard projection 的 total_play_time / updated_at,避免 Axum 侧拼装。 -#[spacetimedb::procedure] -pub fn get_profile_play_stats( - ctx: &mut ProcedureContext, - input: RuntimeProfilePlayStatsGetInput, -) -> RuntimeProfilePlayStatsProcedureResult { - match ctx.try_with_tx(|tx| get_profile_play_stats_snapshot(tx, input.clone())) { - Ok(record) => RuntimeProfilePlayStatsProcedureResult { - ok: true, - record: Some(record), - error_message: None, - }, - Err(message) => RuntimeProfilePlayStatsProcedureResult { - ok: false, - record: None, - error_message: Some(message), - }, - } -} // M5 Stage 2 先把 library profile upsert 固定成最小正式写入口;已发布作品在这里同步刷新 gallery 投影。 #[spacetimedb::reducer] @@ -2611,65 +2023,6 @@ pub fn execute_custom_world_agent_action( } } -// procedure 面向 Axum 同步拉取浏览历史,继续沿用旧 Node 的 visitedAt 倒序输出语义。 -#[spacetimedb::procedure] -pub fn list_platform_browse_history( - ctx: &mut ProcedureContext, - input: RuntimeBrowseHistoryListInput, -) -> RuntimeBrowseHistoryProcedureResult { - match ctx.try_with_tx(|tx| list_platform_browse_history_rows(tx, input.clone())) { - Ok(entries) => RuntimeBrowseHistoryProcedureResult { - ok: true, - entries, - error_message: None, - }, - Err(message) => RuntimeBrowseHistoryProcedureResult { - ok: false, - entries: Vec::new(), - error_message: Some(message), - }, - } -} - -// procedure 面向 Axum 承接 browse history 的单条/批量 POST,同步返回当前用户的完整列表。 -#[spacetimedb::procedure] -pub fn upsert_platform_browse_history_and_return( - ctx: &mut ProcedureContext, - input: RuntimeBrowseHistorySyncInput, -) -> RuntimeBrowseHistoryProcedureResult { - match ctx.try_with_tx(|tx| upsert_platform_browse_history_rows(tx, input.clone())) { - Ok(entries) => RuntimeBrowseHistoryProcedureResult { - ok: true, - entries, - error_message: None, - }, - Err(message) => RuntimeBrowseHistoryProcedureResult { - ok: false, - entries: Vec::new(), - error_message: Some(message), - }, - } -} - -// procedure 面向 Axum 清空当前用户浏览历史,并直接返回空列表响应。 -#[spacetimedb::procedure] -pub fn clear_platform_browse_history_and_return( - ctx: &mut ProcedureContext, - input: RuntimeBrowseHistoryClearInput, -) -> RuntimeBrowseHistoryProcedureResult { - match ctx.try_with_tx(|tx| clear_platform_browse_history_rows(tx, input.clone())) { - Ok(entries) => RuntimeBrowseHistoryProcedureResult { - ok: true, - entries, - error_message: None, - }, - Err(message) => RuntimeBrowseHistoryProcedureResult { - ok: false, - entries: Vec::new(), - error_message: Some(message), - }, - } -} // Stage 3 先把 published profile compile 作为独立 procedure 暴露,避免把编译逻辑和表写入、发布动作强耦合。 #[spacetimedb::procedure] @@ -5354,16 +4707,12 @@ fn sync_custom_world_gallery_entry_from_profile( let row = CustomWorldGalleryEntry { profile_id: profile.profile_id.clone(), owner_user_id: profile.owner_user_id.clone(), - public_work_code: profile - .public_work_code - .clone() - .ok_or_else(|| "published profile 缺少 public_work_code,无法同步 gallery".to_string())?, - author_public_user_code: profile - .author_public_user_code - .clone() - .ok_or_else(|| { - "published profile 缺少 author_public_user_code,无法同步 gallery".to_string() - })?, + public_work_code: profile.public_work_code.clone().ok_or_else(|| { + "published profile 缺少 public_work_code,无法同步 gallery".to_string() + })?, + author_public_user_code: profile.author_public_user_code.clone().ok_or_else(|| { + "published profile 缺少 author_public_user_code,无法同步 gallery".to_string() + })?, author_display_name: profile.author_display_name.clone(), world_name: profile.world_name.clone(), subtitle: profile.subtitle.clone(), @@ -5562,9 +4911,9 @@ fn build_public_work_code_from_profile_id(profile_id: &str) -> String { .filter(|character| character.is_ascii_digit()) .collect::(); let normalized_digits = if digits.is_empty() { - let checksum = profile_id - .bytes() - .fold(0u32, |accumulator, value| accumulator.wrapping_mul(131) + u32::from(value)); + let checksum = profile_id.bytes().fold(0u32, |accumulator, value| { + accumulator.wrapping_mul(131) + u32::from(value) + }); format!("{:08}", checksum % 100_000_000) } else { format!("{:0>8}", &digits[digits.len().saturating_sub(8)..]) @@ -5591,513 +4940,6 @@ fn normalize_public_work_code(input: &str) -> Option { Some(format!("CW-{digits:0>8}")) } -fn create_ai_task_tx( - ctx: &ReducerContext, - input: AiTaskCreateInput, -) -> Result { - validate_task_create_input(&input).map_err(|error| error.to_string())?; - - if ctx.db.ai_task().task_id().find(&input.task_id).is_some() { - return Err("ai_task.task_id 已存在".to_string()); - } - - let task_snapshot = build_ai_task_snapshot_from_create_input(&input); - ctx.db.ai_task().insert(build_ai_task_row(&task_snapshot)); - replace_ai_task_stages(ctx, &task_snapshot.task_id, &task_snapshot.stages); - - get_ai_task_snapshot_tx(ctx, &task_snapshot.task_id) -} - -fn start_ai_task_tx( - ctx: &ReducerContext, - input: AiTaskStartInput, -) -> Result { - let mut snapshot = get_ai_task_snapshot_tx(ctx, &input.task_id)?; - ensure_ai_task_can_transition(snapshot.status)?; - - snapshot.status = AiTaskStatus::Running; - if snapshot.started_at_micros.is_none() { - snapshot.started_at_micros = Some(input.started_at_micros); - } - snapshot.updated_at_micros = input.started_at_micros; - snapshot.version += 1; - - persist_ai_task_snapshot(ctx, &snapshot)?; - Ok(snapshot) -} - -fn start_ai_task_stage_tx( - ctx: &ReducerContext, - input: AiTaskStageStartInput, -) -> Result { - let mut snapshot = get_ai_task_snapshot_tx(ctx, &input.task_id)?; - ensure_ai_task_can_transition(snapshot.status)?; - - let stage = snapshot - .stages - .iter_mut() - .find(|stage| stage.stage_kind == input.stage_kind) - .ok_or_else(|| "ai_task.stage 不存在".to_string())?; - - snapshot.status = AiTaskStatus::Running; - if snapshot.started_at_micros.is_none() { - snapshot.started_at_micros = Some(input.started_at_micros); - } - stage.status = AiTaskStageStatus::Running; - if stage.started_at_micros.is_none() { - stage.started_at_micros = Some(input.started_at_micros); - } - snapshot.updated_at_micros = input.started_at_micros; - snapshot.version += 1; - - persist_ai_task_snapshot(ctx, &snapshot)?; - Ok(snapshot) -} - -fn append_ai_text_chunk_tx( - ctx: &ReducerContext, - input: AiTextChunkAppendInput, -) -> Result<(AiTaskSnapshot, AiTextChunkSnapshot), String> { - if input.delta_text.trim().is_empty() { - return Err("ai_text_chunk.delta_text 不能为空".to_string()); - } - if input.sequence == 0 { - return Err("ai_text_chunk.sequence 必须大于 0".to_string()); - } - - let mut snapshot = get_ai_task_snapshot_tx(ctx, &input.task_id)?; - ensure_ai_task_can_transition(snapshot.status)?; - - let stage = snapshot - .stages - .iter_mut() - .find(|stage| stage.stage_kind == input.stage_kind) - .ok_or_else(|| "ai_task.stage 不存在".to_string())?; - - let chunk = AiTextChunkSnapshot { - chunk_id: generate_ai_text_chunk_id(input.created_at_micros, input.sequence), - task_id: input.task_id.trim().to_string(), - stage_kind: input.stage_kind, - sequence: input.sequence, - delta_text: input.delta_text.trim().to_string(), - created_at_micros: input.created_at_micros, - }; - ctx.db - .ai_text_chunk() - .insert(build_ai_text_chunk_row(&chunk)); - - let aggregated_text = collect_ai_stage_text_output(ctx, &chunk.task_id, chunk.stage_kind); - - snapshot.status = AiTaskStatus::Running; - if snapshot.started_at_micros.is_none() { - snapshot.started_at_micros = Some(input.created_at_micros); - } - stage.status = AiTaskStageStatus::Running; - if stage.started_at_micros.is_none() { - stage.started_at_micros = Some(input.created_at_micros); - } - stage.text_output = aggregated_text.clone(); - snapshot.latest_text_output = aggregated_text; - snapshot.updated_at_micros = input.created_at_micros; - snapshot.version += 1; - - persist_ai_task_snapshot(ctx, &snapshot)?; - Ok((snapshot, chunk)) -} - -fn complete_ai_stage_tx( - ctx: &ReducerContext, - input: AiStageCompletionInput, -) -> Result { - let mut snapshot = get_ai_task_snapshot_tx(ctx, &input.task_id)?; - ensure_ai_task_can_transition(snapshot.status)?; - - let stage = snapshot - .stages - .iter_mut() - .find(|stage| stage.stage_kind == input.stage_kind) - .ok_or_else(|| "ai_task.stage 不存在".to_string())?; - - stage.status = AiTaskStageStatus::Completed; - stage.completed_at_micros = Some(input.completed_at_micros); - stage.text_output = normalize_quest_optional_text(input.text_output.clone()); - stage.structured_payload_json = normalize_quest_optional_text(input.structured_payload_json.clone()); - stage.warning_messages = normalize_quest_string_list(input.warning_messages.clone()); - - snapshot.latest_text_output = stage.text_output.clone(); - snapshot.latest_structured_payload_json = stage.structured_payload_json.clone(); - snapshot.updated_at_micros = input.completed_at_micros; - snapshot.version += 1; - - persist_ai_task_snapshot(ctx, &snapshot)?; - Ok(snapshot) -} - -fn attach_ai_result_reference_tx( - ctx: &ReducerContext, - input: AiResultReferenceInput, -) -> Result { - let reference_id = input.reference_id.trim().to_string(); - if reference_id.is_empty() { - return Err("ai_result_reference.reference_id 不能为空".to_string()); - } - - let mut snapshot = get_ai_task_snapshot_tx(ctx, &input.task_id)?; - ensure_ai_task_can_transition(snapshot.status)?; - - let reference = AiResultReferenceSnapshot { - result_ref_id: generate_ai_result_ref_id(input.created_at_micros), - task_id: input.task_id.trim().to_string(), - reference_kind: input.reference_kind, - reference_id, - label: normalize_quest_optional_text(input.label), - created_at_micros: input.created_at_micros, - }; - ctx.db - .ai_result_reference() - .insert(build_ai_result_reference_row(&reference)); - - snapshot.result_references.push(reference); - snapshot.updated_at_micros = input.created_at_micros; - snapshot.version += 1; - - persist_ai_task_snapshot(ctx, &snapshot)?; - Ok(snapshot) -} - -fn complete_ai_task_tx( - ctx: &ReducerContext, - input: AiTaskFinishInput, -) -> Result { - let mut snapshot = get_ai_task_snapshot_tx(ctx, &input.task_id)?; - ensure_ai_task_can_transition(snapshot.status)?; - - snapshot.status = AiTaskStatus::Completed; - snapshot.completed_at_micros = Some(input.completed_at_micros); - snapshot.updated_at_micros = input.completed_at_micros; - snapshot.version += 1; - - persist_ai_task_snapshot(ctx, &snapshot)?; - Ok(snapshot) -} - -fn fail_ai_task_tx( - ctx: &ReducerContext, - input: AiTaskFailureInput, -) -> Result { - let failure_message = input.failure_message.trim().to_string(); - if failure_message.is_empty() { - return Err("ai_task.failure_message 不能为空".to_string()); - } - - let mut snapshot = get_ai_task_snapshot_tx(ctx, &input.task_id)?; - ensure_ai_task_can_transition(snapshot.status)?; - - snapshot.status = AiTaskStatus::Failed; - snapshot.failure_message = Some(failure_message); - snapshot.completed_at_micros = Some(input.completed_at_micros); - snapshot.updated_at_micros = input.completed_at_micros; - snapshot.version += 1; - - persist_ai_task_snapshot(ctx, &snapshot)?; - Ok(snapshot) -} - -fn cancel_ai_task_tx( - ctx: &ReducerContext, - input: AiTaskCancelInput, -) -> Result { - let mut snapshot = get_ai_task_snapshot_tx(ctx, &input.task_id)?; - ensure_ai_task_can_transition(snapshot.status)?; - - snapshot.status = AiTaskStatus::Cancelled; - snapshot.completed_at_micros = Some(input.completed_at_micros); - snapshot.updated_at_micros = input.completed_at_micros; - snapshot.version += 1; - - persist_ai_task_snapshot(ctx, &snapshot)?; - Ok(snapshot) -} - -fn get_ai_task_snapshot_tx(ctx: &ReducerContext, task_id: &str) -> Result { - let row = ctx - .db - .ai_task() - .task_id() - .find(&task_id.trim().to_string()) - .ok_or_else(|| "ai_task 不存在".to_string())?; - - Ok(build_ai_task_snapshot_from_row(ctx, &row)) -} - -fn persist_ai_task_snapshot(ctx: &ReducerContext, snapshot: &AiTaskSnapshot) -> Result<(), String> { - ctx.db.ai_task().task_id().delete(&snapshot.task_id); - ctx.db.ai_task().insert(build_ai_task_row(snapshot)); - replace_ai_task_stages(ctx, &snapshot.task_id, &snapshot.stages); - Ok(()) -} - -fn replace_ai_task_stages(ctx: &ReducerContext, task_id: &str, stages: &[AiTaskStageSnapshot]) { - let stage_ids = ctx - .db - .ai_task_stage() - .iter() - .filter(|row| row.task_id == task_id) - .map(|row| row.task_stage_id.clone()) - .collect::>(); - for stage_id in stage_ids { - ctx.db.ai_task_stage().task_stage_id().delete(&stage_id); - } - - for stage in stages { - ctx.db - .ai_task_stage() - .insert(build_ai_task_stage_row(task_id, stage)); - } -} - -fn collect_ai_stage_text_output( - ctx: &ReducerContext, - task_id: &str, - stage_kind: AiTaskStageKind, -) -> Option { - let mut chunks = ctx - .db - .ai_text_chunk() - .iter() - .filter(|row| row.task_id == task_id && row.stage_kind == stage_kind) - .map(|row| build_ai_text_chunk_snapshot_from_row(&row)) - .collect::>(); - chunks.sort_by_key(|chunk| chunk.sequence); - - let aggregated = chunks - .into_iter() - .map(|chunk| chunk.delta_text) - .collect::>() - .join(""); - if aggregated.trim().is_empty() { - None - } else { - Some(aggregated) - } -} - -fn ensure_ai_task_can_transition(status: AiTaskStatus) -> Result<(), String> { - if matches!( - status, - AiTaskStatus::Completed | AiTaskStatus::Failed | AiTaskStatus::Cancelled - ) { - Err("当前 ai_task 状态不允许执行该操作".to_string()) - } else { - Ok(()) - } -} - -fn build_ai_task_snapshot_from_create_input(input: &AiTaskCreateInput) -> AiTaskSnapshot { - AiTaskSnapshot { - task_id: input.task_id.trim().to_string(), - task_kind: input.task_kind, - owner_user_id: input.owner_user_id.trim().to_string(), - request_label: input.request_label.trim().to_string(), - source_module: input.source_module.trim().to_string(), - source_entity_id: normalize_quest_optional_text(input.source_entity_id.clone()), - request_payload_json: normalize_quest_optional_text(input.request_payload_json.clone()), - status: AiTaskStatus::Pending, - failure_message: None, - stages: input - .stages - .iter() - .map(|stage| AiTaskStageSnapshot { - stage_kind: stage.stage_kind, - label: stage.label.trim().to_string(), - detail: stage.detail.trim().to_string(), - order: stage.order, - status: AiTaskStageStatus::Pending, - text_output: None, - structured_payload_json: None, - warning_messages: Vec::new(), - started_at_micros: None, - completed_at_micros: None, - }) - .collect(), - result_references: Vec::new(), - latest_text_output: None, - latest_structured_payload_json: None, - version: INITIAL_AI_TASK_VERSION, - created_at_micros: input.created_at_micros, - started_at_micros: None, - completed_at_micros: None, - updated_at_micros: input.created_at_micros, - } -} - -fn build_ai_task_row(snapshot: &AiTaskSnapshot) -> AiTask { - AiTask { - task_id: snapshot.task_id.clone(), - task_kind: snapshot.task_kind, - owner_user_id: snapshot.owner_user_id.clone(), - request_label: snapshot.request_label.clone(), - source_module: snapshot.source_module.clone(), - source_entity_id: snapshot.source_entity_id.clone(), - request_payload_json: snapshot.request_payload_json.clone(), - status: snapshot.status, - failure_message: snapshot.failure_message.clone(), - latest_text_output: snapshot.latest_text_output.clone(), - latest_structured_payload_json: snapshot.latest_structured_payload_json.clone(), - version: snapshot.version, - created_at: Timestamp::from_micros_since_unix_epoch(snapshot.created_at_micros), - started_at: snapshot - .started_at_micros - .map(Timestamp::from_micros_since_unix_epoch), - completed_at: snapshot - .completed_at_micros - .map(Timestamp::from_micros_since_unix_epoch), - updated_at: Timestamp::from_micros_since_unix_epoch(snapshot.updated_at_micros), - } -} - -fn build_ai_task_snapshot_from_row(ctx: &ReducerContext, row: &AiTask) -> AiTaskSnapshot { - let mut stages = ctx - .db - .ai_task_stage() - .iter() - .filter(|stage| stage.task_id == row.task_id) - .map(|stage| build_ai_task_stage_snapshot_from_row(&stage)) - .collect::>(); - stages.sort_by_key(|stage| stage.order); - - let mut result_references = ctx - .db - .ai_result_reference() - .iter() - .filter(|reference| reference.task_id == row.task_id) - .map(|reference| build_ai_result_reference_snapshot_from_row(&reference)) - .collect::>(); - result_references.sort_by_key(|reference| reference.created_at_micros); - - AiTaskSnapshot { - task_id: row.task_id.clone(), - task_kind: row.task_kind, - owner_user_id: row.owner_user_id.clone(), - request_label: row.request_label.clone(), - source_module: row.source_module.clone(), - source_entity_id: row.source_entity_id.clone(), - request_payload_json: row.request_payload_json.clone(), - status: row.status, - failure_message: row.failure_message.clone(), - stages, - result_references, - latest_text_output: row.latest_text_output.clone(), - latest_structured_payload_json: row.latest_structured_payload_json.clone(), - version: row.version, - created_at_micros: row.created_at.to_micros_since_unix_epoch(), - started_at_micros: row - .started_at - .map(|value| value.to_micros_since_unix_epoch()), - completed_at_micros: row - .completed_at - .map(|value| value.to_micros_since_unix_epoch()), - updated_at_micros: row.updated_at.to_micros_since_unix_epoch(), - } -} - -fn build_ai_task_stage_row(task_id: &str, snapshot: &AiTaskStageSnapshot) -> AiTaskStage { - AiTaskStage { - task_stage_id: generate_ai_task_stage_id(task_id, snapshot.stage_kind), - task_id: task_id.to_string(), - stage_kind: snapshot.stage_kind, - label: snapshot.label.clone(), - detail: snapshot.detail.clone(), - stage_order: snapshot.order, - status: snapshot.status, - text_output: snapshot.text_output.clone(), - structured_payload_json: snapshot.structured_payload_json.clone(), - warning_messages: snapshot.warning_messages.clone(), - started_at: snapshot - .started_at_micros - .map(Timestamp::from_micros_since_unix_epoch), - completed_at: snapshot - .completed_at_micros - .map(Timestamp::from_micros_since_unix_epoch), - } -} - -fn build_ai_task_stage_snapshot_from_row(row: &AiTaskStage) -> AiTaskStageSnapshot { - AiTaskStageSnapshot { - stage_kind: row.stage_kind, - label: row.label.clone(), - detail: row.detail.clone(), - order: row.stage_order, - status: row.status, - text_output: row.text_output.clone(), - structured_payload_json: row.structured_payload_json.clone(), - warning_messages: row.warning_messages.clone(), - started_at_micros: row - .started_at - .map(|value| value.to_micros_since_unix_epoch()), - completed_at_micros: row - .completed_at - .map(|value| value.to_micros_since_unix_epoch()), - } -} - -fn build_ai_text_chunk_row(snapshot: &AiTextChunkSnapshot) -> AiTextChunk { - AiTextChunk { - text_chunk_row_id: format!( - "{}{}_{}_{}", - AI_TEXT_CHUNK_ID_PREFIX, - snapshot.task_id, - snapshot.stage_kind.as_str(), - snapshot.sequence - ), - chunk_id: snapshot.chunk_id.clone(), - task_id: snapshot.task_id.clone(), - stage_kind: snapshot.stage_kind, - sequence: snapshot.sequence, - delta_text: snapshot.delta_text.clone(), - created_at: Timestamp::from_micros_since_unix_epoch(snapshot.created_at_micros), - } -} - -fn build_ai_text_chunk_snapshot_from_row(row: &AiTextChunk) -> AiTextChunkSnapshot { - AiTextChunkSnapshot { - chunk_id: row.chunk_id.clone(), - task_id: row.task_id.clone(), - stage_kind: row.stage_kind, - sequence: row.sequence, - delta_text: row.delta_text.clone(), - created_at_micros: row.created_at.to_micros_since_unix_epoch(), - } -} - -fn build_ai_result_reference_row(snapshot: &AiResultReferenceSnapshot) -> AiResultReference { - AiResultReference { - result_reference_row_id: format!( - "{}{}_{}", - AI_RESULT_REF_ID_PREFIX, snapshot.task_id, snapshot.result_ref_id - ), - result_ref_id: snapshot.result_ref_id.clone(), - task_id: snapshot.task_id.clone(), - reference_kind: snapshot.reference_kind, - reference_id: snapshot.reference_id.clone(), - label: snapshot.label.clone(), - created_at: Timestamp::from_micros_since_unix_epoch(snapshot.created_at_micros), - } -} - -fn build_ai_result_reference_snapshot_from_row( - row: &AiResultReference, -) -> AiResultReferenceSnapshot { - AiResultReferenceSnapshot { - result_ref_id: row.result_ref_id.clone(), - task_id: row.task_id.clone(), - reference_kind: row.reference_kind, - reference_id: row.reference_id.clone(), - label: row.label.clone(), - created_at_micros: row.created_at.to_micros_since_unix_epoch(), - } -} - fn build_quest_record_row(snapshot: QuestRecordSnapshot) -> QuestRecord { QuestRecord { quest_id: snapshot.quest_id, @@ -6751,983 +5593,6 @@ fn try_update_chapter_progression_ledger_tx( update_chapter_progression_ledger_tx(ctx, input).map(Some) } -fn get_runtime_setting_snapshot( - ctx: &ReducerContext, - input: RuntimeSettingGetInput, -) -> Result { - let validated_input = - build_runtime_setting_get_input(input.user_id).map_err(|error| error.to_string())?; - - if let Some(existing) = ctx - .db - .runtime_setting() - .user_id() - .find(&validated_input.user_id) - { - return Ok(RuntimeSettingSnapshot { - user_id: existing.user_id, - music_volume: existing.music_volume, - platform_theme: existing.platform_theme, - created_at_micros: existing.created_at.to_micros_since_unix_epoch(), - updated_at_micros: existing.updated_at.to_micros_since_unix_epoch(), - }); - } - - Ok(RuntimeSettingSnapshot { - user_id: validated_input.user_id, - music_volume: DEFAULT_MUSIC_VOLUME, - platform_theme: DEFAULT_PLATFORM_THEME, - created_at_micros: 0, - updated_at_micros: 0, - }) -} - -fn upsert_runtime_setting( - ctx: &ReducerContext, - input: RuntimeSettingUpsertInput, -) -> Result { - let validated_input = build_runtime_setting_upsert_input( - input.user_id, - input.music_volume, - input.platform_theme, - input.updated_at_micros, - ) - .map_err(|error| error.to_string())?; - let updated_at = Timestamp::from_micros_since_unix_epoch(validated_input.updated_at_micros); - - let snapshot = match ctx - .db - .runtime_setting() - .user_id() - .find(&validated_input.user_id) - { - Some(existing) => { - ctx.db.runtime_setting().user_id().delete(&existing.user_id); - ctx.db.runtime_setting().insert(RuntimeSetting { - user_id: existing.user_id.clone(), - music_volume: validated_input.music_volume, - platform_theme: validated_input.platform_theme, - created_at: existing.created_at, - updated_at, - }); - - RuntimeSettingSnapshot { - user_id: existing.user_id, - music_volume: validated_input.music_volume, - platform_theme: validated_input.platform_theme, - created_at_micros: existing.created_at.to_micros_since_unix_epoch(), - updated_at_micros: validated_input.updated_at_micros, - } - } - None => { - ctx.db.runtime_setting().insert(RuntimeSetting { - user_id: validated_input.user_id.clone(), - music_volume: validated_input.music_volume, - platform_theme: validated_input.platform_theme, - created_at: updated_at, - updated_at, - }); - - RuntimeSettingSnapshot { - user_id: validated_input.user_id, - music_volume: validated_input.music_volume, - platform_theme: validated_input.platform_theme, - created_at_micros: validated_input.updated_at_micros, - updated_at_micros: validated_input.updated_at_micros, - } - } - }; - - 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, -) -> Result { - let validated_input = build_runtime_profile_dashboard_get_input(input.user_id) - .map_err(|error| error.to_string())?; - let state = ctx - .db - .profile_dashboard_state() - .user_id() - .find(&validated_input.user_id); - let played_world_count = ctx - .db - .profile_played_world() - .iter() - .filter(|row| row.user_id == validated_input.user_id) - .count() as u32; - - Ok(match state { - Some(existing) => RuntimeProfileDashboardSnapshot { - user_id: existing.user_id, - wallet_balance: existing.wallet_balance, - total_play_time_ms: existing.total_play_time_ms, - played_world_count, - updated_at_micros: Some(existing.updated_at.to_micros_since_unix_epoch()), - }, - None => RuntimeProfileDashboardSnapshot { - user_id: validated_input.user_id, - wallet_balance: 0, - total_play_time_ms: 0, - played_world_count, - updated_at_micros: None, - }, - }) -} - -fn list_profile_wallet_ledger_entries( - ctx: &ReducerContext, - input: RuntimeProfileWalletLedgerListInput, -) -> Result, String> { - let validated_input = build_runtime_profile_wallet_ledger_list_input(input.user_id) - .map_err(|error| error.to_string())?; - - let mut entries = ctx - .db - .profile_wallet_ledger() - .iter() - .filter(|row| row.user_id == validated_input.user_id) - .map(|row| build_profile_wallet_ledger_snapshot_from_row(&row)) - .collect::>(); - - entries.sort_by(|left, right| { - right - .created_at_micros - .cmp(&left.created_at_micros) - .then_with(|| left.wallet_ledger_id.cmp(&right.wallet_ledger_id)) - }); - entries.truncate(PROFILE_WALLET_LEDGER_LIST_LIMIT); - - Ok(entries) -} - -fn get_profile_play_stats_snapshot( - ctx: &ReducerContext, - input: RuntimeProfilePlayStatsGetInput, -) -> Result { - let validated_input = build_runtime_profile_play_stats_get_input(input.user_id) - .map_err(|error| error.to_string())?; - let dashboard_state = ctx - .db - .profile_dashboard_state() - .user_id() - .find(&validated_input.user_id); - let mut played_works = ctx - .db - .profile_played_world() - .iter() - .filter(|row| row.user_id == validated_input.user_id) - .map(|row| build_profile_played_world_snapshot_from_row(&row)) - .collect::>(); - - played_works.sort_by(|left, right| { - right - .last_played_at_micros - .cmp(&left.last_played_at_micros) - .then_with(|| left.played_world_id.cmp(&right.played_world_id)) - }); - - Ok(RuntimeProfilePlayStatsSnapshot { - user_id: validated_input.user_id, - total_play_time_ms: dashboard_state - .as_ref() - .map(|row| row.total_play_time_ms) - .unwrap_or(0), - played_works, - updated_at_micros: dashboard_state - .as_ref() - .map(|row| row.updated_at.to_micros_since_unix_epoch()), - }) -} - -fn list_platform_browse_history_rows( - ctx: &ReducerContext, - input: RuntimeBrowseHistoryListInput, -) -> Result, String> { - let validated_input = build_runtime_browse_history_list_input(input.user_id) - .map_err(|error| error.to_string())?; - - let mut entries = ctx - .db - .user_browse_history() - .iter() - .filter(|row| row.user_id == validated_input.user_id) - .map(|row| build_runtime_browse_history_snapshot_from_row(&row)) - .collect::>(); - - entries.sort_by(|left, right| { - right - .visited_at_micros - .cmp(&left.visited_at_micros) - .then_with(|| left.browse_history_id.cmp(&right.browse_history_id)) - }); - - Ok(entries) -} - -fn upsert_platform_browse_history_rows( - ctx: &ReducerContext, - input: RuntimeBrowseHistorySyncInput, -) -> Result, String> { - let user_id = input.user_id.clone(); - let prepared_entries = - prepare_runtime_browse_history_entries(input).map_err(|error| error.to_string())?; - - for prepared in prepared_entries { - let existing = ctx - .db - .user_browse_history() - .browse_history_id() - .find(&prepared.browse_history_id); - let created_at = existing - .as_ref() - .map(|row| row.created_at) - .unwrap_or_else(|| Timestamp::from_micros_since_unix_epoch(prepared.updated_at_micros)); - - if let Some(existing) = existing { - ctx.db - .user_browse_history() - .browse_history_id() - .delete(&existing.browse_history_id); - } - - ctx.db.user_browse_history().insert(UserBrowseHistory { - browse_history_id: prepared.browse_history_id, - user_id: prepared.user_id, - owner_user_id: prepared.owner_user_id, - profile_id: prepared.profile_id, - world_name: prepared.world_name, - subtitle: prepared.subtitle, - summary_text: prepared.summary_text, - cover_image_src: prepared.cover_image_src, - theme_mode: prepared.theme_mode, - author_display_name: prepared.author_display_name, - visited_at: Timestamp::from_micros_since_unix_epoch(prepared.visited_at_micros), - created_at, - updated_at: Timestamp::from_micros_since_unix_epoch(prepared.updated_at_micros), - }); - } - - list_platform_browse_history_rows(ctx, RuntimeBrowseHistoryListInput { user_id }) -} - -fn clear_platform_browse_history_rows( - ctx: &ReducerContext, - input: RuntimeBrowseHistoryClearInput, -) -> Result, String> { - let validated_input = build_runtime_browse_history_clear_input(input.user_id) - .map_err(|error| error.to_string())?; - let row_ids = ctx - .db - .user_browse_history() - .iter() - .filter(|row| row.user_id == validated_input.user_id) - .map(|row| row.browse_history_id.clone()) - .collect::>(); - - for row_id in row_ids { - ctx.db - .user_browse_history() - .browse_history_id() - .delete(&row_id); - } - - Ok(Vec::new()) -} - -fn build_runtime_browse_history_snapshot_from_row( - row: &UserBrowseHistory, -) -> RuntimeBrowseHistorySnapshot { - RuntimeBrowseHistorySnapshot { - browse_history_id: row.browse_history_id.clone(), - user_id: row.user_id.clone(), - owner_user_id: row.owner_user_id.clone(), - profile_id: row.profile_id.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(), - theme_mode: row.theme_mode, - author_display_name: row.author_display_name.clone(), - visited_at_micros: row.visited_at.to_micros_since_unix_epoch(), - 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_wallet_ledger_snapshot_from_row( - row: &ProfileWalletLedger, -) -> RuntimeProfileWalletLedgerEntrySnapshot { - RuntimeProfileWalletLedgerEntrySnapshot { - wallet_ledger_id: row.wallet_ledger_id.clone(), - user_id: row.user_id.clone(), - amount_delta: row.amount_delta, - balance_after: row.balance_after, - source_type: row.source_type, - created_at_micros: row.created_at.to_micros_since_unix_epoch(), - } -} - -fn build_profile_played_world_snapshot_from_row( - row: &ProfilePlayedWorld, -) -> RuntimeProfilePlayedWorldSnapshot { - RuntimeProfilePlayedWorldSnapshot { - played_world_id: row.played_world_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_title: row.world_title.clone(), - world_subtitle: row.world_subtitle.clone(), - first_played_at_micros: row.first_played_at.to_micros_since_unix_epoch(), - last_played_at_micros: row.last_played_at.to_micros_since_unix_epoch(), - last_observed_play_time_ms: row.last_observed_play_time_ms, - } -} - -#[allow(dead_code)] -fn build_runtime_browse_history_row(snapshot: RuntimeBrowseHistorySnapshot) -> UserBrowseHistory { - UserBrowseHistory { - browse_history_id: snapshot.browse_history_id, - user_id: snapshot.user_id, - owner_user_id: snapshot.owner_user_id, - profile_id: snapshot.profile_id, - world_name: snapshot.world_name, - subtitle: snapshot.subtitle, - summary_text: snapshot.summary_text, - cover_image_src: snapshot.cover_image_src, - theme_mode: snapshot.theme_mode, - author_display_name: snapshot.author_display_name, - visited_at: Timestamp::from_micros_since_unix_epoch(snapshot.visited_at_micros), - created_at: Timestamp::from_micros_since_unix_epoch(snapshot.created_at_micros), - updated_at: Timestamp::from_micros_since_unix_epoch(snapshot.updated_at_micros), - } -} - fn build_battle_state_row(snapshot: BattleStateSnapshot) -> BattleState { BattleState { battle_state_id: snapshot.battle_state_id, diff --git a/server-rs/crates/spacetime-module/src/runtime/browse_history.rs b/server-rs/crates/spacetime-module/src/runtime/browse_history.rs index 622f8e3e..a4886067 100644 --- a/server-rs/crates/spacetime-module/src/runtime/browse_history.rs +++ b/server-rs/crates/spacetime-module/src/runtime/browse_history.rs @@ -1 +1,220 @@ -// Browse history 相关表、procedure 与 helper 落位点。 +use crate::*; + +#[spacetimedb::table( + accessor = user_browse_history, + index(accessor = by_browse_history_user_id, btree(columns = [user_id])), + index( + accessor = by_browse_history_user_owner_profile, + btree(columns = [user_id, owner_user_id, profile_id]) + ) +)] +pub struct UserBrowseHistory { + #[primary_key] + pub(crate) browse_history_id: String, + pub(crate) user_id: String, + pub(crate) owner_user_id: String, + pub(crate) profile_id: String, + pub(crate) world_name: String, + pub(crate) subtitle: String, + pub(crate) summary_text: String, + pub(crate) cover_image_src: Option, + pub(crate) theme_mode: RuntimeBrowseHistoryThemeMode, + pub(crate) author_display_name: String, + pub(crate) visited_at: Timestamp, + pub(crate) created_at: Timestamp, + pub(crate) updated_at: Timestamp, +} + +// procedure 面向 Axum 同步拉取浏览历史,继续沿用旧 Node 的 visitedAt 倒序输出语义。 +#[spacetimedb::procedure] +pub fn list_platform_browse_history( + ctx: &mut ProcedureContext, + input: RuntimeBrowseHistoryListInput, +) -> RuntimeBrowseHistoryProcedureResult { + match ctx.try_with_tx(|tx| list_platform_browse_history_rows(tx, input.clone())) { + Ok(entries) => RuntimeBrowseHistoryProcedureResult { + ok: true, + entries, + error_message: None, + }, + Err(message) => RuntimeBrowseHistoryProcedureResult { + ok: false, + entries: Vec::new(), + error_message: Some(message), + }, + } +} + +// procedure 面向 Axum 承接 browse history 的单条/批量 POST,同步返回当前用户的完整列表。 +#[spacetimedb::procedure] +pub fn upsert_platform_browse_history_and_return( + ctx: &mut ProcedureContext, + input: RuntimeBrowseHistorySyncInput, +) -> RuntimeBrowseHistoryProcedureResult { + match ctx.try_with_tx(|tx| upsert_platform_browse_history_rows(tx, input.clone())) { + Ok(entries) => RuntimeBrowseHistoryProcedureResult { + ok: true, + entries, + error_message: None, + }, + Err(message) => RuntimeBrowseHistoryProcedureResult { + ok: false, + entries: Vec::new(), + error_message: Some(message), + }, + } +} + +// procedure 面向 Axum 清空当前用户浏览历史,并直接返回空列表响应。 +#[spacetimedb::procedure] +pub fn clear_platform_browse_history_and_return( + ctx: &mut ProcedureContext, + input: RuntimeBrowseHistoryClearInput, +) -> RuntimeBrowseHistoryProcedureResult { + match ctx.try_with_tx(|tx| clear_platform_browse_history_rows(tx, input.clone())) { + Ok(entries) => RuntimeBrowseHistoryProcedureResult { + ok: true, + entries, + error_message: None, + }, + Err(message) => RuntimeBrowseHistoryProcedureResult { + ok: false, + entries: Vec::new(), + error_message: Some(message), + }, + } +} + +fn list_platform_browse_history_rows( + ctx: &ReducerContext, + input: RuntimeBrowseHistoryListInput, +) -> Result, String> { + let validated_input = build_runtime_browse_history_list_input(input.user_id) + .map_err(|error| error.to_string())?; + + let mut entries = ctx + .db + .user_browse_history() + .iter() + .filter(|row| row.user_id == validated_input.user_id) + .map(|row| build_runtime_browse_history_snapshot_from_row(&row)) + .collect::>(); + + entries.sort_by(|left, right| { + right + .visited_at_micros + .cmp(&left.visited_at_micros) + .then_with(|| left.browse_history_id.cmp(&right.browse_history_id)) + }); + + Ok(entries) +} + +fn upsert_platform_browse_history_rows( + ctx: &ReducerContext, + input: RuntimeBrowseHistorySyncInput, +) -> Result, String> { + let user_id = input.user_id.clone(); + let prepared_entries = + prepare_runtime_browse_history_entries(input).map_err(|error| error.to_string())?; + + for prepared in prepared_entries { + let existing = ctx + .db + .user_browse_history() + .browse_history_id() + .find(&prepared.browse_history_id); + let created_at = existing + .as_ref() + .map(|row| row.created_at) + .unwrap_or_else(|| Timestamp::from_micros_since_unix_epoch(prepared.updated_at_micros)); + + if let Some(existing) = existing { + ctx.db + .user_browse_history() + .browse_history_id() + .delete(&existing.browse_history_id); + } + + ctx.db.user_browse_history().insert(UserBrowseHistory { + browse_history_id: prepared.browse_history_id, + user_id: prepared.user_id, + owner_user_id: prepared.owner_user_id, + profile_id: prepared.profile_id, + world_name: prepared.world_name, + subtitle: prepared.subtitle, + summary_text: prepared.summary_text, + cover_image_src: prepared.cover_image_src, + theme_mode: prepared.theme_mode, + author_display_name: prepared.author_display_name, + visited_at: Timestamp::from_micros_since_unix_epoch(prepared.visited_at_micros), + created_at, + updated_at: Timestamp::from_micros_since_unix_epoch(prepared.updated_at_micros), + }); + } + + list_platform_browse_history_rows(ctx, RuntimeBrowseHistoryListInput { user_id }) +} + +fn clear_platform_browse_history_rows( + ctx: &ReducerContext, + input: RuntimeBrowseHistoryClearInput, +) -> Result, String> { + let validated_input = build_runtime_browse_history_clear_input(input.user_id) + .map_err(|error| error.to_string())?; + let row_ids = ctx + .db + .user_browse_history() + .iter() + .filter(|row| row.user_id == validated_input.user_id) + .map(|row| row.browse_history_id.clone()) + .collect::>(); + + for row_id in row_ids { + ctx.db + .user_browse_history() + .browse_history_id() + .delete(&row_id); + } + + Ok(Vec::new()) +} + +fn build_runtime_browse_history_snapshot_from_row( + row: &UserBrowseHistory, +) -> RuntimeBrowseHistorySnapshot { + RuntimeBrowseHistorySnapshot { + browse_history_id: row.browse_history_id.clone(), + user_id: row.user_id.clone(), + owner_user_id: row.owner_user_id.clone(), + profile_id: row.profile_id.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(), + theme_mode: row.theme_mode, + author_display_name: row.author_display_name.clone(), + visited_at_micros: row.visited_at.to_micros_since_unix_epoch(), + created_at_micros: row.created_at.to_micros_since_unix_epoch(), + updated_at_micros: row.updated_at.to_micros_since_unix_epoch(), + } +} + +#[allow(dead_code)] +fn build_runtime_browse_history_row(snapshot: RuntimeBrowseHistorySnapshot) -> UserBrowseHistory { + UserBrowseHistory { + browse_history_id: snapshot.browse_history_id, + user_id: snapshot.user_id, + owner_user_id: snapshot.owner_user_id, + profile_id: snapshot.profile_id, + world_name: snapshot.world_name, + subtitle: snapshot.subtitle, + summary_text: snapshot.summary_text, + cover_image_src: snapshot.cover_image_src, + theme_mode: snapshot.theme_mode, + author_display_name: snapshot.author_display_name, + visited_at: Timestamp::from_micros_since_unix_epoch(snapshot.visited_at_micros), + created_at: Timestamp::from_micros_since_unix_epoch(snapshot.created_at_micros), + updated_at: Timestamp::from_micros_since_unix_epoch(snapshot.updated_at_micros), + } +} diff --git a/server-rs/crates/spacetime-module/src/runtime/mod.rs b/server-rs/crates/spacetime-module/src/runtime/mod.rs index 69ebd8ce..ecb19130 100644 --- a/server-rs/crates/spacetime-module/src/runtime/mod.rs +++ b/server-rs/crates/spacetime-module/src/runtime/mod.rs @@ -1,1288 +1,9 @@ -#[spacetimedb::table(accessor = runtime_setting)] -pub struct RuntimeSetting { - #[primary_key] - user_id: String, - music_volume: f32, - platform_theme: RuntimePlatformTheme, - created_at: Timestamp, - 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])), - index( - accessor = by_browse_history_user_owner_profile, - btree(columns = [user_id, owner_user_id, profile_id]) - ) -)] -pub struct UserBrowseHistory { - #[primary_key] - browse_history_id: String, - user_id: String, - owner_user_id: String, - profile_id: String, - world_name: String, - subtitle: String, - summary_text: String, - cover_image_src: Option, - theme_mode: RuntimeBrowseHistoryThemeMode, - author_display_name: String, - visited_at: Timestamp, - created_at: Timestamp, - updated_at: Timestamp, -} - -#[spacetimedb::table(accessor = profile_dashboard_state)] -pub struct ProfileDashboardState { - #[primary_key] - user_id: String, - wallet_balance: u64, - total_play_time_ms: u64, - created_at: Timestamp, - updated_at: Timestamp, -} - -#[spacetimedb::table( - accessor = profile_wallet_ledger, - index(accessor = by_profile_wallet_ledger_user_id, btree(columns = [user_id])), - index( - accessor = by_profile_wallet_ledger_user_created_at, - btree(columns = [user_id, created_at]) - ) -)] -pub struct ProfileWalletLedger { - #[primary_key] - wallet_ledger_id: String, - user_id: String, - amount_delta: i64, - balance_after: u64, - source_type: RuntimeProfileWalletLedgerSourceType, - created_at: Timestamp, -} - -#[spacetimedb::table( - accessor = profile_played_world, - index(accessor = by_profile_played_world_user_id, btree(columns = [user_id])), - index( - accessor = by_profile_played_world_user_world_key, - btree(columns = [user_id, world_key]) - ), - index( - accessor = by_profile_played_world_user_last_played_at, - btree(columns = [user_id, last_played_at]) - ) -)] -pub struct ProfilePlayedWorld { - #[primary_key] - played_world_id: String, - user_id: String, - world_key: String, - owner_user_id: Option, - profile_id: Option, - world_type: Option, - world_title: String, - world_subtitle: String, - first_played_at: Timestamp, - last_played_at: Timestamp, - 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, -} - -// procedure 面向 Axum 同步读取设置;若没有持久化记录则返回默认值快照,但不产生额外写入。 -#[spacetimedb::procedure] -pub fn get_runtime_setting_or_default( - ctx: &mut ProcedureContext, - input: RuntimeSettingGetInput, -) -> RuntimeSettingProcedureResult { - match ctx.try_with_tx(|tx| get_runtime_setting_snapshot(tx, input.clone())) { - Ok(record) => RuntimeSettingProcedureResult { - ok: true, - record: Some(record), - error_message: None, - }, - Err(message) => RuntimeSettingProcedureResult { - ok: false, - record: None, - error_message: Some(message), - }, - } -} - -// 当前快照读取保持旧 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( - ctx: &mut ProcedureContext, - input: RuntimeSettingUpsertInput, -) -> RuntimeSettingProcedureResult { - match ctx.try_with_tx(|tx| upsert_runtime_setting(tx, input.clone())) { - Ok(record) => RuntimeSettingProcedureResult { - ok: true, - record: Some(record), - error_message: None, - }, - Err(message) => RuntimeSettingProcedureResult { - ok: false, - record: None, - error_message: Some(message), - }, - } -} - -// 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( - ctx: &mut ProcedureContext, - input: RuntimeProfileDashboardGetInput, -) -> RuntimeProfileDashboardProcedureResult { - match ctx.try_with_tx(|tx| get_profile_dashboard_snapshot(tx, input.clone())) { - Ok(record) => RuntimeProfileDashboardProcedureResult { - ok: true, - record: Some(record), - error_message: None, - }, - Err(message) => RuntimeProfileDashboardProcedureResult { - ok: false, - record: None, - error_message: Some(message), - }, - } -} - -// 钱包流水当前只暴露最近 50 条只读视图,排序与截断逻辑在 procedure 内统一收口。 -#[spacetimedb::procedure] -pub fn list_profile_wallet_ledger( - ctx: &mut ProcedureContext, - input: RuntimeProfileWalletLedgerListInput, -) -> RuntimeProfileWalletLedgerProcedureResult { - match ctx.try_with_tx(|tx| list_profile_wallet_ledger_entries(tx, input.clone())) { - Ok(entries) => RuntimeProfileWalletLedgerProcedureResult { - ok: true, - entries, - error_message: None, - }, - Err(message) => RuntimeProfileWalletLedgerProcedureResult { - ok: false, - entries: Vec::new(), - error_message: Some(message), - }, - } -} - -// play stats 与 dashboard 共用 dashboard projection 的 total_play_time / updated_at,避免 Axum 侧拼装。 -#[spacetimedb::procedure] -pub fn get_profile_play_stats( - ctx: &mut ProcedureContext, - input: RuntimeProfilePlayStatsGetInput, -) -> RuntimeProfilePlayStatsProcedureResult { - match ctx.try_with_tx(|tx| get_profile_play_stats_snapshot(tx, input.clone())) { - Ok(record) => RuntimeProfilePlayStatsProcedureResult { - ok: true, - record: Some(record), - error_message: None, - }, - Err(message) => RuntimeProfilePlayStatsProcedureResult { - ok: false, - record: None, - error_message: Some(message), - }, - } -} -fn get_runtime_setting_snapshot( - ctx: &ReducerContext, - input: RuntimeSettingGetInput, -) -> Result { - let validated_input = - build_runtime_setting_get_input(input.user_id).map_err(|error| error.to_string())?; - - if let Some(existing) = ctx - .db - .runtime_setting() - .user_id() - .find(&validated_input.user_id) - { - return Ok(RuntimeSettingSnapshot { - user_id: existing.user_id, - music_volume: existing.music_volume, - platform_theme: existing.platform_theme, - created_at_micros: existing.created_at.to_micros_since_unix_epoch(), - updated_at_micros: existing.updated_at.to_micros_since_unix_epoch(), - }); - } - - Ok(RuntimeSettingSnapshot { - user_id: validated_input.user_id, - music_volume: DEFAULT_MUSIC_VOLUME, - platform_theme: DEFAULT_PLATFORM_THEME, - created_at_micros: 0, - updated_at_micros: 0, - }) -} - -fn upsert_runtime_setting( - ctx: &ReducerContext, - input: RuntimeSettingUpsertInput, -) -> Result { - let validated_input = build_runtime_setting_upsert_input( - input.user_id, - input.music_volume, - input.platform_theme, - input.updated_at_micros, - ) - .map_err(|error| error.to_string())?; - let updated_at = Timestamp::from_micros_since_unix_epoch(validated_input.updated_at_micros); - - let snapshot = match ctx - .db - .runtime_setting() - .user_id() - .find(&validated_input.user_id) - { - Some(existing) => { - ctx.db.runtime_setting().user_id().delete(&existing.user_id); - ctx.db.runtime_setting().insert(RuntimeSetting { - user_id: existing.user_id.clone(), - music_volume: validated_input.music_volume, - platform_theme: validated_input.platform_theme, - created_at: existing.created_at, - updated_at, - }); - - RuntimeSettingSnapshot { - user_id: existing.user_id, - music_volume: validated_input.music_volume, - platform_theme: validated_input.platform_theme, - created_at_micros: existing.created_at.to_micros_since_unix_epoch(), - updated_at_micros: validated_input.updated_at_micros, - } - } - None => { - ctx.db.runtime_setting().insert(RuntimeSetting { - user_id: validated_input.user_id.clone(), - music_volume: validated_input.music_volume, - platform_theme: validated_input.platform_theme, - created_at: updated_at, - updated_at, - }); - - RuntimeSettingSnapshot { - user_id: validated_input.user_id, - music_volume: validated_input.music_volume, - platform_theme: validated_input.platform_theme, - created_at_micros: validated_input.updated_at_micros, - updated_at_micros: validated_input.updated_at_micros, - } - } - }; - - 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, -) -> Result { - let validated_input = build_runtime_profile_dashboard_get_input(input.user_id) - .map_err(|error| error.to_string())?; - let state = ctx - .db - .profile_dashboard_state() - .user_id() - .find(&validated_input.user_id); - let played_world_count = ctx - .db - .profile_played_world() - .iter() - .filter(|row| row.user_id == validated_input.user_id) - .count() as u32; - - Ok(match state { - Some(existing) => RuntimeProfileDashboardSnapshot { - user_id: existing.user_id, - wallet_balance: existing.wallet_balance, - total_play_time_ms: existing.total_play_time_ms, - played_world_count, - updated_at_micros: Some(existing.updated_at.to_micros_since_unix_epoch()), - }, - None => RuntimeProfileDashboardSnapshot { - user_id: validated_input.user_id, - wallet_balance: 0, - total_play_time_ms: 0, - played_world_count, - updated_at_micros: None, - }, - }) -} - -fn list_profile_wallet_ledger_entries( - ctx: &ReducerContext, - input: RuntimeProfileWalletLedgerListInput, -) -> Result, String> { - let validated_input = build_runtime_profile_wallet_ledger_list_input(input.user_id) - .map_err(|error| error.to_string())?; - - let mut entries = ctx - .db - .profile_wallet_ledger() - .iter() - .filter(|row| row.user_id == validated_input.user_id) - .map(|row| build_profile_wallet_ledger_snapshot_from_row(&row)) - .collect::>(); - - entries.sort_by(|left, right| { - right - .created_at_micros - .cmp(&left.created_at_micros) - .then_with(|| left.wallet_ledger_id.cmp(&right.wallet_ledger_id)) - }); - entries.truncate(PROFILE_WALLET_LEDGER_LIST_LIMIT); - - Ok(entries) -} - -fn get_profile_play_stats_snapshot( - ctx: &ReducerContext, - input: RuntimeProfilePlayStatsGetInput, -) -> Result { - let validated_input = build_runtime_profile_play_stats_get_input(input.user_id) - .map_err(|error| error.to_string())?; - let dashboard_state = ctx - .db - .profile_dashboard_state() - .user_id() - .find(&validated_input.user_id); - let mut played_works = ctx - .db - .profile_played_world() - .iter() - .filter(|row| row.user_id == validated_input.user_id) - .map(|row| build_profile_played_world_snapshot_from_row(&row)) - .collect::>(); - - played_works.sort_by(|left, right| { - right - .last_played_at_micros - .cmp(&left.last_played_at_micros) - .then_with(|| left.played_world_id.cmp(&right.played_world_id)) - }); - - Ok(RuntimeProfilePlayStatsSnapshot { - user_id: validated_input.user_id, - total_play_time_ms: dashboard_state - .as_ref() - .map(|row| row.total_play_time_ms) - .unwrap_or(0), - played_works, - updated_at_micros: dashboard_state - .as_ref() - .map(|row| row.updated_at.to_micros_since_unix_epoch()), - }) -} - -fn list_platform_browse_history_rows( - ctx: &ReducerContext, - input: RuntimeBrowseHistoryListInput, -) -> Result, String> { - let validated_input = build_runtime_browse_history_list_input(input.user_id) - .map_err(|error| error.to_string())?; - - let mut entries = ctx - .db - .user_browse_history() - .iter() - .filter(|row| row.user_id == validated_input.user_id) - .map(|row| build_runtime_browse_history_snapshot_from_row(&row)) - .collect::>(); - - entries.sort_by(|left, right| { - right - .visited_at_micros - .cmp(&left.visited_at_micros) - .then_with(|| left.browse_history_id.cmp(&right.browse_history_id)) - }); - - Ok(entries) -} - -fn upsert_platform_browse_history_rows( - ctx: &ReducerContext, - input: RuntimeBrowseHistorySyncInput, -) -> Result, String> { - let user_id = input.user_id.clone(); - let prepared_entries = - prepare_runtime_browse_history_entries(input).map_err(|error| error.to_string())?; - - for prepared in prepared_entries { - let existing = ctx - .db - .user_browse_history() - .browse_history_id() - .find(&prepared.browse_history_id); - let created_at = existing - .as_ref() - .map(|row| row.created_at) - .unwrap_or_else(|| Timestamp::from_micros_since_unix_epoch(prepared.updated_at_micros)); - - if let Some(existing) = existing { - ctx.db - .user_browse_history() - .browse_history_id() - .delete(&existing.browse_history_id); - } - - ctx.db.user_browse_history().insert(UserBrowseHistory { - browse_history_id: prepared.browse_history_id, - user_id: prepared.user_id, - owner_user_id: prepared.owner_user_id, - profile_id: prepared.profile_id, - world_name: prepared.world_name, - subtitle: prepared.subtitle, - summary_text: prepared.summary_text, - cover_image_src: prepared.cover_image_src, - theme_mode: prepared.theme_mode, - author_display_name: prepared.author_display_name, - visited_at: Timestamp::from_micros_since_unix_epoch(prepared.visited_at_micros), - created_at, - updated_at: Timestamp::from_micros_since_unix_epoch(prepared.updated_at_micros), - }); - } - - list_platform_browse_history_rows(ctx, RuntimeBrowseHistoryListInput { user_id }) -} - -fn clear_platform_browse_history_rows( - ctx: &ReducerContext, - input: RuntimeBrowseHistoryClearInput, -) -> Result, String> { - let validated_input = build_runtime_browse_history_clear_input(input.user_id) - .map_err(|error| error.to_string())?; - let row_ids = ctx - .db - .user_browse_history() - .iter() - .filter(|row| row.user_id == validated_input.user_id) - .map(|row| row.browse_history_id.clone()) - .collect::>(); - - for row_id in row_ids { - ctx.db - .user_browse_history() - .browse_history_id() - .delete(&row_id); - } - - Ok(Vec::new()) -} - -fn build_runtime_browse_history_snapshot_from_row( - row: &UserBrowseHistory, -) -> RuntimeBrowseHistorySnapshot { - RuntimeBrowseHistorySnapshot { - browse_history_id: row.browse_history_id.clone(), - user_id: row.user_id.clone(), - owner_user_id: row.owner_user_id.clone(), - profile_id: row.profile_id.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(), - theme_mode: row.theme_mode, - author_display_name: row.author_display_name.clone(), - visited_at_micros: row.visited_at.to_micros_since_unix_epoch(), - 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_wallet_ledger_snapshot_from_row( - row: &ProfileWalletLedger, -) -> RuntimeProfileWalletLedgerEntrySnapshot { - RuntimeProfileWalletLedgerEntrySnapshot { - wallet_ledger_id: row.wallet_ledger_id.clone(), - user_id: row.user_id.clone(), - amount_delta: row.amount_delta, - balance_after: row.balance_after, - source_type: row.source_type, - created_at_micros: row.created_at.to_micros_since_unix_epoch(), - } -} - -fn build_profile_played_world_snapshot_from_row( - row: &ProfilePlayedWorld, -) -> RuntimeProfilePlayedWorldSnapshot { - RuntimeProfilePlayedWorldSnapshot { - played_world_id: row.played_world_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_title: row.world_title.clone(), - world_subtitle: row.world_subtitle.clone(), - first_played_at_micros: row.first_played_at.to_micros_since_unix_epoch(), - last_played_at_micros: row.last_played_at.to_micros_since_unix_epoch(), - last_observed_play_time_ms: row.last_observed_play_time_ms, - } -} - -#[allow(dead_code)] -fn build_runtime_browse_history_row(snapshot: RuntimeBrowseHistorySnapshot) -> UserBrowseHistory { - UserBrowseHistory { - browse_history_id: snapshot.browse_history_id, - user_id: snapshot.user_id, - owner_user_id: snapshot.owner_user_id, - profile_id: snapshot.profile_id, - world_name: snapshot.world_name, - subtitle: snapshot.subtitle, - summary_text: snapshot.summary_text, - cover_image_src: snapshot.cover_image_src, - theme_mode: snapshot.theme_mode, - author_display_name: snapshot.author_display_name, - visited_at: Timestamp::from_micros_since_unix_epoch(snapshot.visited_at_micros), - created_at: Timestamp::from_micros_since_unix_epoch(snapshot.created_at_micros), - updated_at: Timestamp::from_micros_since_unix_epoch(snapshot.updated_at_micros), - } -} +mod browse_history; +mod profile; +mod settings; +mod snapshots; + +pub use browse_history::*; +pub use profile::*; +pub use settings::*; +pub use snapshots::*; diff --git a/server-rs/crates/spacetime-module/src/runtime/profile.rs b/server-rs/crates/spacetime-module/src/runtime/profile.rs index d1f1a06c..93ffa3f2 100644 --- a/server-rs/crates/spacetime-module/src/runtime/profile.rs +++ b/server-rs/crates/spacetime-module/src/runtime/profile.rs @@ -1 +1,806 @@ -// Profile dashboard、wallet 与 played world 投影落位点。 +use crate::*; + +#[spacetimedb::table(accessor = profile_dashboard_state)] +pub struct ProfileDashboardState { + #[primary_key] + pub(crate) user_id: String, + pub(crate) wallet_balance: u64, + pub(crate) total_play_time_ms: u64, + pub(crate) created_at: Timestamp, + pub(crate) updated_at: Timestamp, +} + +#[spacetimedb::table( + accessor = profile_wallet_ledger, + index(accessor = by_profile_wallet_ledger_user_id, btree(columns = [user_id])), + index( + accessor = by_profile_wallet_ledger_user_created_at, + btree(columns = [user_id, created_at]) + ) +)] +pub struct ProfileWalletLedger { + #[primary_key] + pub(crate) wallet_ledger_id: String, + pub(crate) user_id: String, + pub(crate) amount_delta: i64, + pub(crate) balance_after: u64, + pub(crate) source_type: RuntimeProfileWalletLedgerSourceType, + pub(crate) created_at: Timestamp, +} + +#[spacetimedb::table( + accessor = profile_played_world, + index(accessor = by_profile_played_world_user_id, btree(columns = [user_id])), + index( + accessor = by_profile_played_world_user_world_key, + btree(columns = [user_id, world_key]) + ), + index( + accessor = by_profile_played_world_user_last_played_at, + btree(columns = [user_id, last_played_at]) + ) +)] +pub struct ProfilePlayedWorld { + #[primary_key] + pub(crate) played_world_id: String, + pub(crate) user_id: String, + pub(crate) world_key: String, + pub(crate) owner_user_id: Option, + pub(crate) profile_id: Option, + pub(crate) world_type: Option, + pub(crate) world_title: String, + pub(crate) world_subtitle: String, + pub(crate) first_played_at: Timestamp, + pub(crate) last_played_at: Timestamp, + pub(crate) 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] + pub(crate) archive_id: String, + pub(crate) user_id: String, + pub(crate) world_key: String, + pub(crate) owner_user_id: Option, + pub(crate) profile_id: Option, + pub(crate) world_type: Option, + pub(crate) world_name: String, + pub(crate) subtitle: String, + pub(crate) summary_text: String, + pub(crate) cover_image_src: Option, + pub(crate) saved_at: Timestamp, + pub(crate) bottom_tab: String, + pub(crate) game_state_json: String, + pub(crate) current_story_json: Option, + pub(crate) created_at: Timestamp, + pub(crate) updated_at: Timestamp, +} + +// 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( + ctx: &mut ProcedureContext, + input: RuntimeProfileDashboardGetInput, +) -> RuntimeProfileDashboardProcedureResult { + match ctx.try_with_tx(|tx| get_profile_dashboard_snapshot(tx, input.clone())) { + Ok(record) => RuntimeProfileDashboardProcedureResult { + ok: true, + record: Some(record), + error_message: None, + }, + Err(message) => RuntimeProfileDashboardProcedureResult { + ok: false, + record: None, + error_message: Some(message), + }, + } +} + +// 钱包流水当前只暴露最近 50 条只读视图,排序与截断逻辑在 procedure 内统一收口。 +#[spacetimedb::procedure] +pub fn list_profile_wallet_ledger( + ctx: &mut ProcedureContext, + input: RuntimeProfileWalletLedgerListInput, +) -> RuntimeProfileWalletLedgerProcedureResult { + match ctx.try_with_tx(|tx| list_profile_wallet_ledger_entries(tx, input.clone())) { + Ok(entries) => RuntimeProfileWalletLedgerProcedureResult { + ok: true, + entries, + error_message: None, + }, + Err(message) => RuntimeProfileWalletLedgerProcedureResult { + ok: false, + entries: Vec::new(), + error_message: Some(message), + }, + } +} + +// play stats 与 dashboard 共用 dashboard projection 的 total_play_time / updated_at,避免 Axum 侧拼装。 +#[spacetimedb::procedure] +pub fn get_profile_play_stats( + ctx: &mut ProcedureContext, + input: RuntimeProfilePlayStatsGetInput, +) -> RuntimeProfilePlayStatsProcedureResult { + match ctx.try_with_tx(|tx| get_profile_play_stats_snapshot(tx, input.clone())) { + Ok(record) => RuntimeProfilePlayStatsProcedureResult { + ok: true, + record: Some(record), + error_message: None, + }, + Err(message) => RuntimeProfilePlayStatsProcedureResult { + ok: false, + record: None, + error_message: Some(message), + }, + } +} + +pub(crate) 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) +} + +pub(crate) 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(), + }, + )) +} + +pub(crate) 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, +} + +pub(crate) 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 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, +) -> Result { + let validated_input = build_runtime_profile_dashboard_get_input(input.user_id) + .map_err(|error| error.to_string())?; + let state = ctx + .db + .profile_dashboard_state() + .user_id() + .find(&validated_input.user_id); + let played_world_count = ctx + .db + .profile_played_world() + .iter() + .filter(|row| row.user_id == validated_input.user_id) + .count() as u32; + + Ok(match state { + Some(existing) => RuntimeProfileDashboardSnapshot { + user_id: existing.user_id, + wallet_balance: existing.wallet_balance, + total_play_time_ms: existing.total_play_time_ms, + played_world_count, + updated_at_micros: Some(existing.updated_at.to_micros_since_unix_epoch()), + }, + None => RuntimeProfileDashboardSnapshot { + user_id: validated_input.user_id, + wallet_balance: 0, + total_play_time_ms: 0, + played_world_count, + updated_at_micros: None, + }, + }) +} + +fn list_profile_wallet_ledger_entries( + ctx: &ReducerContext, + input: RuntimeProfileWalletLedgerListInput, +) -> Result, String> { + let validated_input = build_runtime_profile_wallet_ledger_list_input(input.user_id) + .map_err(|error| error.to_string())?; + + let mut entries = ctx + .db + .profile_wallet_ledger() + .iter() + .filter(|row| row.user_id == validated_input.user_id) + .map(|row| build_profile_wallet_ledger_snapshot_from_row(&row)) + .collect::>(); + + entries.sort_by(|left, right| { + right + .created_at_micros + .cmp(&left.created_at_micros) + .then_with(|| left.wallet_ledger_id.cmp(&right.wallet_ledger_id)) + }); + entries.truncate(PROFILE_WALLET_LEDGER_LIST_LIMIT); + + Ok(entries) +} + +fn get_profile_play_stats_snapshot( + ctx: &ReducerContext, + input: RuntimeProfilePlayStatsGetInput, +) -> Result { + let validated_input = build_runtime_profile_play_stats_get_input(input.user_id) + .map_err(|error| error.to_string())?; + let dashboard_state = ctx + .db + .profile_dashboard_state() + .user_id() + .find(&validated_input.user_id); + let mut played_works = ctx + .db + .profile_played_world() + .iter() + .filter(|row| row.user_id == validated_input.user_id) + .map(|row| build_profile_played_world_snapshot_from_row(&row)) + .collect::>(); + + played_works.sort_by(|left, right| { + right + .last_played_at_micros + .cmp(&left.last_played_at_micros) + .then_with(|| left.played_world_id.cmp(&right.played_world_id)) + }); + + Ok(RuntimeProfilePlayStatsSnapshot { + user_id: validated_input.user_id, + total_play_time_ms: dashboard_state + .as_ref() + .map(|row| row.total_play_time_ms) + .unwrap_or(0), + played_works, + updated_at_micros: dashboard_state + .as_ref() + .map(|row| row.updated_at.to_micros_since_unix_epoch()), + }) +} + +fn build_profile_wallet_ledger_snapshot_from_row( + row: &ProfileWalletLedger, +) -> RuntimeProfileWalletLedgerEntrySnapshot { + RuntimeProfileWalletLedgerEntrySnapshot { + wallet_ledger_id: row.wallet_ledger_id.clone(), + user_id: row.user_id.clone(), + amount_delta: row.amount_delta, + balance_after: row.balance_after, + source_type: row.source_type, + created_at_micros: row.created_at.to_micros_since_unix_epoch(), + } +} + +fn build_profile_played_world_snapshot_from_row( + row: &ProfilePlayedWorld, +) -> RuntimeProfilePlayedWorldSnapshot { + RuntimeProfilePlayedWorldSnapshot { + played_world_id: row.played_world_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_title: row.world_title.clone(), + world_subtitle: row.world_subtitle.clone(), + first_played_at_micros: row.first_played_at.to_micros_since_unix_epoch(), + last_played_at_micros: row.last_played_at.to_micros_since_unix_epoch(), + last_observed_play_time_ms: row.last_observed_play_time_ms, + } +} diff --git a/server-rs/crates/spacetime-module/src/runtime/settings.rs b/server-rs/crates/spacetime-module/src/runtime/settings.rs index e779b9a4..5a0bf42d 100644 --- a/server-rs/crates/spacetime-module/src/runtime/settings.rs +++ b/server-rs/crates/spacetime-module/src/runtime/settings.rs @@ -1 +1,141 @@ -// Runtime settings 相关表、procedure 与 helper 落位点。 +use crate::*; + +#[spacetimedb::table(accessor = runtime_setting)] +pub struct RuntimeSetting { + #[primary_key] + pub(crate) user_id: String, + pub(crate) music_volume: f32, + pub(crate) platform_theme: RuntimePlatformTheme, + pub(crate) created_at: Timestamp, + pub(crate) updated_at: Timestamp, +} + +// procedure 面向 Axum 同步读取设置;若没有持久化记录则返回默认值快照,但不产生额外写入。 +#[spacetimedb::procedure] +pub fn get_runtime_setting_or_default( + ctx: &mut ProcedureContext, + input: RuntimeSettingGetInput, +) -> RuntimeSettingProcedureResult { + match ctx.try_with_tx(|tx| get_runtime_setting_snapshot(tx, input.clone())) { + Ok(record) => RuntimeSettingProcedureResult { + ok: true, + record: Some(record), + error_message: None, + }, + Err(message) => RuntimeSettingProcedureResult { + ok: false, + record: None, + error_message: Some(message), + }, + } +} + +// procedure 面向 Axum 同步写入设置,并返回最终归一化后的持久化结果。 +#[spacetimedb::procedure] +pub fn upsert_runtime_setting_and_return( + ctx: &mut ProcedureContext, + input: RuntimeSettingUpsertInput, +) -> RuntimeSettingProcedureResult { + match ctx.try_with_tx(|tx| upsert_runtime_setting(tx, input.clone())) { + Ok(record) => RuntimeSettingProcedureResult { + ok: true, + record: Some(record), + error_message: None, + }, + Err(message) => RuntimeSettingProcedureResult { + ok: false, + record: None, + error_message: Some(message), + }, + } +} + +fn get_runtime_setting_snapshot( + ctx: &ReducerContext, + input: RuntimeSettingGetInput, +) -> Result { + let validated_input = + build_runtime_setting_get_input(input.user_id).map_err(|error| error.to_string())?; + + if let Some(existing) = ctx + .db + .runtime_setting() + .user_id() + .find(&validated_input.user_id) + { + return Ok(RuntimeSettingSnapshot { + user_id: existing.user_id, + music_volume: existing.music_volume, + platform_theme: existing.platform_theme, + created_at_micros: existing.created_at.to_micros_since_unix_epoch(), + updated_at_micros: existing.updated_at.to_micros_since_unix_epoch(), + }); + } + + Ok(RuntimeSettingSnapshot { + user_id: validated_input.user_id, + music_volume: DEFAULT_MUSIC_VOLUME, + platform_theme: DEFAULT_PLATFORM_THEME, + created_at_micros: 0, + updated_at_micros: 0, + }) +} + +fn upsert_runtime_setting( + ctx: &ReducerContext, + input: RuntimeSettingUpsertInput, +) -> Result { + let validated_input = build_runtime_setting_upsert_input( + input.user_id, + input.music_volume, + input.platform_theme, + input.updated_at_micros, + ) + .map_err(|error| error.to_string())?; + let updated_at = Timestamp::from_micros_since_unix_epoch(validated_input.updated_at_micros); + + let snapshot = match ctx + .db + .runtime_setting() + .user_id() + .find(&validated_input.user_id) + { + Some(existing) => { + ctx.db.runtime_setting().user_id().delete(&existing.user_id); + ctx.db.runtime_setting().insert(RuntimeSetting { + user_id: existing.user_id.clone(), + music_volume: validated_input.music_volume, + platform_theme: validated_input.platform_theme, + created_at: existing.created_at, + updated_at, + }); + + RuntimeSettingSnapshot { + user_id: existing.user_id, + music_volume: validated_input.music_volume, + platform_theme: validated_input.platform_theme, + created_at_micros: existing.created_at.to_micros_since_unix_epoch(), + updated_at_micros: validated_input.updated_at_micros, + } + } + None => { + ctx.db.runtime_setting().insert(RuntimeSetting { + user_id: validated_input.user_id.clone(), + music_volume: validated_input.music_volume, + platform_theme: validated_input.platform_theme, + created_at: updated_at, + updated_at, + }); + + RuntimeSettingSnapshot { + user_id: validated_input.user_id, + music_volume: validated_input.music_volume, + platform_theme: validated_input.platform_theme, + created_at_micros: validated_input.updated_at_micros, + updated_at_micros: validated_input.updated_at_micros, + } + } + }; + + Ok(snapshot) +} diff --git a/server-rs/crates/spacetime-module/src/runtime/snapshots.rs b/server-rs/crates/spacetime-module/src/runtime/snapshots.rs index fcac58af..562b8f59 100644 --- a/server-rs/crates/spacetime-module/src/runtime/snapshots.rs +++ b/server-rs/crates/spacetime-module/src/runtime/snapshots.rs @@ -1 +1,215 @@ -// Runtime snapshot 与 save archive 相关表、procedure 与 helper 落位点。 +use crate::*; + +#[spacetimedb::table(accessor = runtime_snapshot)] +pub struct RuntimeSnapshotRow { + #[primary_key] + pub(crate) user_id: String, + pub(crate) version: u32, + pub(crate) saved_at: Timestamp, + pub(crate) bottom_tab: String, + pub(crate) game_state_json: String, + pub(crate) current_story_json: Option, + pub(crate) created_at: Timestamp, + pub(crate) updated_at: Timestamp, +} + +// 当前快照读取保持旧 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), + }, + } +} + +pub(crate) 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))) +} + +pub(crate) 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) +} + +pub(crate) 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) +} + +pub(crate) 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(), + } +} + +pub(crate) fn parse_json_str(raw: &str) -> Result { + serde_json::from_str::(raw).map_err(|error| format!("game_state_json 解析失败: {error}")) +} + +pub(crate) 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), + } +} diff --git a/src/components/auth/AccountModal.test.tsx b/src/components/auth/AccountModal.test.tsx index 1ea09812..a508ca8d 100644 --- a/src/components/auth/AccountModal.test.tsx +++ b/src/components/auth/AccountModal.test.tsx @@ -16,6 +16,7 @@ const baseUser: AuthUser = { id: 'user-1', username: 'tester', displayName: '138****8000', + publicUserCode: 'user-tester', phoneNumberMasked: '138****8000', loginMethod: 'phone', bindingStatus: 'active', diff --git a/src/components/auth/AuthGate.test.tsx b/src/components/auth/AuthGate.test.tsx index d81b8e70..d20b88c6 100644 --- a/src/components/auth/AuthGate.test.tsx +++ b/src/components/auth/AuthGate.test.tsx @@ -70,6 +70,7 @@ const mockUser: AuthUser = { id: 'user-1', username: 'tester', displayName: '测试玩家', + publicUserCode: 'user-tester', phoneNumberMasked: '138****8000', loginMethod: 'phone', bindingStatus: 'active', diff --git a/src/components/platform-entry/PlatformEntryFlowShellImpl.tsx b/src/components/platform-entry/PlatformEntryFlowShellImpl.tsx index 45ba9227..99af984e 100644 --- a/src/components/platform-entry/PlatformEntryFlowShellImpl.tsx +++ b/src/components/platform-entry/PlatformEntryFlowShellImpl.tsx @@ -27,8 +27,16 @@ import type { } from '../../../packages/shared/src/contracts/puzzleAgentSession'; import type { PuzzleRunSnapshot } from '../../../packages/shared/src/contracts/puzzleRuntimeSession'; import type { PuzzleWorkSummary } from '../../../packages/shared/src/contracts/puzzleWorkSummary'; -import type { CustomWorldLibraryEntry } from '../../../packages/shared/src/contracts/runtime'; +import type { + CustomWorldGalleryCard, + CustomWorldLibraryEntry, +} from '../../../packages/shared/src/contracts/runtime'; +import type { PublicUserSummary } from '../../../packages/shared/src/contracts/auth'; import { buildCustomWorldPlayableCharacters } from '../../data/characterPresets'; +import { + getPublicAuthUserByCode, + getPublicAuthUserById, +} from '../../services/authService'; import { createBigFishCreationSession, executeBigFishCreationAction, @@ -57,6 +65,7 @@ import { } from '../../services/puzzle-runtime'; import { listPuzzleWorks } from '../../services/puzzle-works'; import { deleteRpgEntryWorldProfile } from '../../services/rpg-entry'; +import { getRpgEntryWorldGalleryDetailByCode } from '../../services/rpg-entry/rpgEntryLibraryClient'; import { rpgCreationPreviewAdapter } from '../../services/rpg-creation/rpgCreationPreviewAdapter'; import type { CustomWorldProfile } from '../../types'; import { useAuthUi } from '../auth/AuthUiContext'; @@ -173,6 +182,10 @@ export function PlatformEntryFlowShellImpl({ const [puzzleError, setPuzzleError] = useState(null); const [isPuzzleBusy, setIsPuzzleBusy] = useState(false); const [isPuzzleLoadingLibrary, setIsPuzzleLoadingLibrary] = useState(false); + const [isSearchingPublicCode, setIsSearchingPublicCode] = useState(false); + const [publicSearchError, setPublicSearchError] = useState(null); + const [searchedPublicUser, setSearchedPublicUser] = + useState(null); const [deletingCreationWorkId, setDeletingCreationWorkId] = useState< string | null >(null); @@ -377,6 +390,86 @@ export function PlatformEntryFlowShellImpl({ [authUi], ); + const handlePublicCodeSearch = useCallback( + async (keyword: string) => { + const normalizedKeyword = keyword.trim(); + if (!normalizedKeyword) { + return; + } + + setIsSearchingPublicCode(true); + setPublicSearchError(null); + setSearchedPublicUser(null); + + const upperKeyword = normalizedKeyword.toUpperCase(); + const shouldSearchUserIdFirst = /^user[_-][a-z0-9_-]+$/iu.test(normalizedKeyword); + const shouldSearchWorkFirst = + !shouldSearchUserIdFirst && + (upperKeyword.startsWith('CW') || /^\d{1,8}$/u.test(normalizedKeyword)); + const shouldSearchUserFirst = + shouldSearchUserIdFirst || upperKeyword.startsWith('SY') || !shouldSearchWorkFirst; + + const tryOpenGalleryEntry = async () => { + const entry = await getRpgEntryWorldGalleryDetailByCode(normalizedKeyword); + await detailNavigation.openGalleryDetail({ + ownerUserId: entry.ownerUserId, + profileId: entry.profileId, + publicWorkCode: entry.publicWorkCode, + authorPublicUserCode: entry.authorPublicUserCode, + visibility: 'published', + publishedAt: entry.publishedAt, + updatedAt: entry.updatedAt, + authorDisplayName: entry.authorDisplayName, + worldName: entry.worldName, + subtitle: entry.subtitle, + summaryText: entry.summaryText, + coverImageSrc: entry.coverImageSrc, + themeMode: entry.themeMode, + playableNpcCount: entry.playableNpcCount, + landmarkCount: entry.landmarkCount, + } satisfies CustomWorldGalleryCard); + }; + + try { + if (shouldSearchUserIdFirst) { + const user = await getPublicAuthUserById(normalizedKeyword); + setSearchedPublicUser(user); + return; + } + + if (shouldSearchWorkFirst) { + try { + await tryOpenGalleryEntry(); + return; + } catch {} + } + + if (shouldSearchUserFirst) { + try { + const user = await getPublicAuthUserByCode(normalizedKeyword); + setSearchedPublicUser(user); + return; + } catch {} + } + + if (!shouldSearchWorkFirst) { + await tryOpenGalleryEntry(); + return; + } + + const user = await getPublicAuthUserByCode(normalizedKeyword); + setSearchedPublicUser(user); + } catch (error) { + setPublicSearchError( + resolveRpgCreationErrorMessage(error, '未找到对应的叙世号或作品号。'), + ); + } finally { + setIsSearchingPublicCode(false); + } + }, + [detailNavigation], + ); + const prepareCreationLaunch = useCallback(() => { if (sessionController.isCreatingAgentSession) { return false; @@ -1309,6 +1402,10 @@ export function PlatformEntryFlowShellImpl({ detailNavigation.openLibraryDetail(entry); }); }} + onSearchPublicCode={(keyword) => { + void handlePublicCodeSearch(keyword); + }} + isSearchingPublicCode={isSearchingPublicCode} onOpenProfileDashboardCard={() => { if (platformBootstrap.dashboardError) { void platformBootstrap.refreshProfileDashboard(); @@ -1795,6 +1892,54 @@ export function PlatformEntryFlowShellImpl({ }); }} /> + + {(searchedPublicUser || publicSearchError) && ( + +
+
+
+
+ 公开编号搜索 +
+
+ {publicSearchError ? '未找到结果' : '命中用户'} +
+
+ +
+ {publicSearchError ? ( +
+ {publicSearchError} +
+ ) : searchedPublicUser ? ( +
+
+ {searchedPublicUser.displayName} +
+
+ 叙世号 {searchedPublicUser.publicUserCode} +
+
+ ) : null} +
+
+ )} +
); } diff --git a/src/components/rpg-entry/RpgEntryFlowShell.agent.interaction.test.tsx b/src/components/rpg-entry/RpgEntryFlowShell.agent.interaction.test.tsx index ecfab17b..acc0ce3e 100644 --- a/src/components/rpg-entry/RpgEntryFlowShell.agent.interaction.test.tsx +++ b/src/components/rpg-entry/RpgEntryFlowShell.agent.interaction.test.tsx @@ -287,6 +287,7 @@ const mockAuthUser: AuthUser = { id: 'user-1', username: 'tester', displayName: '测试玩家', + publicUserCode: 'user-tester', phoneNumberMasked: null, loginMethod: 'password', bindingStatus: 'active', @@ -569,6 +570,8 @@ beforeEach(() => { entry: { ownerUserId: 'user-1', profileId: 'agent-draft-custom-world-agent-session-1', + publicWorkCode: null, + authorPublicUserCode: null, profile: { id: 'agent-draft-custom-world-agent-session-1', name: '潮雾列岛', @@ -1204,6 +1207,8 @@ test('clicking a public work while logged out routes through requireAuth', async { ownerUserId: 'author-1', profileId: 'world-public-1', + publicWorkCode: 'work-public-1', + authorPublicUserCode: 'author-1', visibility: 'published', publishedAt: '2026-04-16T12:00:00.000Z', updatedAt: '2026-04-16T12:00:00.000Z', @@ -2378,6 +2383,8 @@ test('creation hub published work can open detail view before deleting from deta const publishedLibraryEntry = { ownerUserId: 'user-1', profileId: 'world-delete-1', + publicWorkCode: 'work-delete-1', + authorPublicUserCode: 'user-1', profile: { id: 'world-delete-1', name: '潮雾列岛', @@ -2463,6 +2470,8 @@ test('creation hub published work enters existing detail view', async () => { { ownerUserId: 'user-1', profileId: 'world-public-1', + publicWorkCode: 'work-public-1', + authorPublicUserCode: 'user-1', profile: { id: 'world-public-1', name: '潮雾列岛', @@ -2534,6 +2543,8 @@ test('creation hub published work experience button enters world directly', asyn { ownerUserId: 'user-1', profileId: 'world-experience-1', + publicWorkCode: 'work-experience-1', + authorPublicUserCode: 'user-1', profile: { id: 'world-experience-1', name: '潮雾列岛', @@ -2609,7 +2620,9 @@ test('creation hub published work delete button removes the work directly from c }; const publishedLibraryEntry = { ownerUserId: 'user-1', - profileId: 'world-card-delete-1',, + profileId: 'world-card-delete-1', + publicWorkCode: 'work-card-delete-1', + authorPublicUserCode: 'user-1', profile: { id: 'world-card-delete-1', name: '潮雾列岛', diff --git a/src/components/rpg-entry/RpgEntryHomeView.tsx b/src/components/rpg-entry/RpgEntryHomeView.tsx index c54b6dde..97f2a72f 100644 --- a/src/components/rpg-entry/RpgEntryHomeView.tsx +++ b/src/components/rpg-entry/RpgEntryHomeView.tsx @@ -76,6 +76,8 @@ export interface RpgEntryHomeViewProps { onOpenLibraryDetail: ( entry: CustomWorldLibraryEntry, ) => void; + onSearchPublicCode?: (keyword: string) => void | Promise; + isSearchingPublicCode?: boolean; onOpenProfileDashboardCard?: (cardKey: ProfileDashboardCardKey) => void; createTabContent?: ReactNode; } @@ -665,6 +667,10 @@ function formatDashboardUpdatedAt(value: string | null | undefined) { } function buildPublicUserCode(user: AuthUser | null | undefined) { + if (user?.publicUserCode?.trim()) { + return user.publicUserCode.trim(); + } + const raw = user?.id.replace(/[^a-zA-Z0-9]/gu, '').toUpperCase() || user?.username.replace(/[^a-zA-Z0-9]/gu, '').toUpperCase() || @@ -778,10 +784,13 @@ export function RpgEntryHomeView({ onOpenCreateTypePicker, onOpenGalleryDetail, onOpenLibraryDetail, + onSearchPublicCode, + isSearchingPublicCode = false, onOpenProfileDashboardCard, createTabContent, }: RpgEntryHomeViewProps) { const authUi = useAuthUi(); + const [desktopSearchKeyword, setDesktopSearchKeyword] = useState(''); const isAuthenticated = Boolean(authUi?.user); const isDesktopLayout = usePlatformDesktopLayout(); const featuredShelf = useMemo( @@ -821,6 +830,14 @@ export function RpgEntryHomeView({ } authUi?.openLoginModal(); }; + const submitDesktopSearch = () => { + const keyword = desktopSearchKeyword.trim(); + if (!keyword || !onSearchPublicCode || isSearchingPublicCode) { + return; + } + + void onSearchPublicCode(keyword); + }; const desktopHeroEntry = featuredShelf[0] ?? latestEntries[0] ?? myEntries[0] ?? null; const desktopHeroCover = desktopHeroEntry @@ -1440,6 +1457,8 @@ export function RpgEntryHomeView({ onOpenGalleryDetail({ ownerUserId: entry.ownerUserId, profileId: entry.profileId, + publicWorkCode: null, + authorPublicUserCode: null, visibility: 'published', publishedAt: entry.visitedAt, updatedAt: entry.visitedAt, @@ -1572,9 +1591,30 @@ export function RpgEntryHomeView({
- - 搜索世界、角色、主题或灵感 - + setDesktopSearchKeyword(event.target.value)} + onKeyDown={(event) => { + if (event.key === 'Enter') { + event.preventDefault(); + submitDesktopSearch(); + } + }} + placeholder="输入 SY 或 CW 编号" + className="w-full min-w-0 bg-transparent text-sm text-[var(--platform-text-strong)] outline-none placeholder:text-[var(--platform-text-soft)]" + /> +
diff --git a/src/services/authService.test.ts b/src/services/authService.test.ts index 393bc850..23a3bd88 100644 --- a/src/services/authService.test.ts +++ b/src/services/authService.test.ts @@ -27,6 +27,7 @@ import { getAuthLoginOptions, getAuthRiskBlocks, getAuthSessions, + getPublicAuthUserById, getCaptchaChallengeFromError, getCurrentAuthUser, liftAuthRiskBlock, @@ -92,6 +93,7 @@ describe('authService', () => { token: 'jwt-entry-token', user: { id: 'user_1', + publicUserCode: 'SY-00000001', username: 'guest_abc123abc123', displayName: 'guest_abc123abc123', phoneNumberMasked: null, @@ -130,6 +132,7 @@ describe('authService', () => { token: 'jwt-auto-token', user: { id: 'user_saved', + publicUserCode: 'SY-00000002', username: 'guest_saveduser01', displayName: 'guest_saveduser01', phoneNumberMasked: null, @@ -161,6 +164,7 @@ describe('authService', () => { token: 'jwt-auto-shared-token', user: { id: 'user_auto', + publicUserCode: 'SY-00000003', username: 'guest_auto', displayName: 'guest_auto', phoneNumberMasked: null, @@ -236,6 +240,7 @@ describe('authService', () => { token: 'jwt-phone-token', user: { id: 'user_phone', + publicUserCode: 'SY-00000004', username: '138****8000', displayName: '138****8000', phoneNumberMasked: '138****8000', @@ -271,6 +276,7 @@ describe('authService', () => { token: 'jwt-wechat-bind-token', user: { id: 'user_wechat', + publicUserCode: 'SY-00000005', username: '138****8000', displayName: '138****8000', phoneNumberMasked: '138****8000', @@ -291,6 +297,7 @@ describe('authService', () => { apiClientMocks.requestJson.mockResolvedValue({ user: { id: 'user_phone', + publicUserCode: 'SY-00000006', username: '139****9000', displayName: '139****9000', phoneNumberMasked: '139****9000', @@ -415,6 +422,35 @@ describe('authService', () => { ); }); + it('loads public user summary by internal user id', async () => { + apiClientMocks.requestJson.mockResolvedValue({ + user: { + id: 'user_00000001', + publicUserCode: 'SY-00000001', + displayName: '旅人一号', + }, + }); + + const user = await getPublicAuthUserById(' user_00000001 '); + + expect(user).toEqual({ + id: 'user_00000001', + publicUserCode: 'SY-00000001', + displayName: '旅人一号', + }); + expect(apiClientMocks.requestJson).toHaveBeenCalledWith( + '/api/auth/public-users/by-id/user_00000001', + expect.objectContaining({ + method: 'GET', + }), + '读取用户信息失败', + { + skipAuth: true, + skipRefresh: true, + }, + ); + }); + it('loads auth sessions from account center endpoint', async () => { apiClientMocks.requestJson.mockResolvedValue({ sessions: [ diff --git a/src/services/authService.ts b/src/services/authService.ts index 079a51f9..ddca7d8f 100644 --- a/src/services/authService.ts +++ b/src/services/authService.ts @@ -16,6 +16,7 @@ import type { AuthRiskBlockSummary, AuthSessionsResponse, AuthSessionSummary, + PublicUserSearchResponse, AuthUser, AuthWechatBindPhoneResponse, AuthWechatStartResponse, @@ -347,6 +348,32 @@ export async function getCurrentAuthUser(): Promise { }; } +export async function getPublicAuthUserByCode(code: string) { + const response = await requestJson( + `/api/auth/public-users/by-code/${encodeURIComponent(code.trim())}`, + { + method: 'GET', + }, + '读取用户信息失败', + PUBLIC_AUTH_REQUEST_OPTIONS, + ); + + return response.user; +} + +export async function getPublicAuthUserById(userId: string) { + const response = await requestJson( + `/api/auth/public-users/by-id/${encodeURIComponent(userId.trim())}`, + { + method: 'GET', + }, + '读取用户信息失败', + PUBLIC_AUTH_REQUEST_OPTIONS, + ); + + return response.user; +} + export async function getAuthSessions() { const response = await requestJson( '/api/auth/sessions', diff --git a/src/services/rpg-entry/rpgEntryLibraryClient.ts b/src/services/rpg-entry/rpgEntryLibraryClient.ts index b69a5ef9..0f399121 100644 --- a/src/services/rpg-entry/rpgEntryLibraryClient.ts +++ b/src/services/rpg-entry/rpgEntryLibraryClient.ts @@ -62,6 +62,22 @@ export async function getRpgEntryWorldGalleryDetail( return response.entry; } +export async function getRpgEntryWorldGalleryDetailByCode( + code: string, + options: RuntimeRequestOptions = {}, +) { + const response = await requestPublicRpgRuntimeJson< + CustomWorldGalleryDetailResponse + >( + `/custom-world-gallery/by-code/${encodeURIComponent(code)}`, + { method: 'GET' }, + '读取作品详情失败', + options, + ); + + return response.entry; +} + export async function upsertRpgEntryWorldProfile( profile: CustomWorldProfile, options: RuntimeRequestOptions = {}, @@ -145,6 +161,7 @@ export const rpgEntryLibraryClient = { listWorldLibrary: listRpgEntryWorldLibrary, listWorldGallery: listRpgEntryWorldGallery, getWorldGalleryDetail: getRpgEntryWorldGalleryDetail, + getWorldGalleryDetailByCode: getRpgEntryWorldGalleryDetailByCode, upsertWorldProfile: upsertRpgEntryWorldProfile, deleteWorldProfile: deleteRpgEntryWorldProfile, publishWorldProfile: publishRpgEntryWorldProfile, diff --git a/验证清单.md b/验证清单.md index 5940c2a9..fd2edd82 100644 --- a/验证清单.md +++ b/验证清单.md @@ -3,6 +3,6 @@ 鉴于重构规模庞大,而且有非常多的细节未能落地实现,而是使用mock或者魔数来糊弄过去的,而且测试也没有起到本应有的作用,故此有个本清单,用于手动验证每个环节。 - [x] 短信验证功能,要保证真实走到阿里云的服务上,你启动服务,我来通过前端输入手机号和验证码,你查看日志。`2026-04-23` 已通过。 -- [ ] 创作中心里目前先保证RPG入口的畅通,聊天引导部分需要真实接入到LLM,不得使用固定模板来回答。 +- [x] 创作中心里目前先保证RPG入口的畅通,聊天引导部分需要真实接入到LLM,不得使用固定模板来回答。`2026-04-23` 已通过。 - [ ] 草稿的编译也需要真实走LLM去生成对应信息。 - [ ] 图片、视频、动作的生成要真实走到外部服务的生成服务上,而不是用占位符来敷衍。