This commit is contained in:
2026-04-22 23:44:57 +08:00
parent 76ac9d22a5
commit 84dc92646a
484 changed files with 9598 additions and 9135 deletions

View File

@@ -152,6 +152,45 @@
2. 无会话时会正常落回未登录分支 2. 无会话时会正常落回未登录分支
3. 不会因为探测型 401 把自己重新唤醒并刷爆控制台 3. 不会因为探测型 401 把自己重新唤醒并刷爆控制台
## 4.2 2026-04-22 补充修正:公开认证入口误触发 refresh
在登录弹窗链路继续联调时,又暴露出一条更细的请求边界问题:
1. 用户处于未登录态,浏览器本地没有 access token
2. 点击“获取验证码”会调用 `sendPhoneLoginCode()`
3. `authService.ts` 复用了通用 `requestJson(...)`
4. `apiClient.ts` 在“无本地 token 且未显式关闭 refresh”时会先尝试 `POST /api/auth/refresh`
5. 若当前浏览器本来也没有 refresh session cookie就会先打出一条 `401 Unauthorized`
6. 最终表现成:验证码接口真正发送前,前端控制台先报一次 `/api/auth/refresh 401`
这条链的问题不在“验证码接口失败”,而在:
**登录前公开认证入口被错误当成了需要先补票的受保护请求。**
因此这里再补一条明确约束:
1. `sendPhoneLoginCode()`
2. `loginWithPhoneCode()`
3. `authEntry()`
4. `getAuthLoginOptions()`
5. `startWechatLogin()`
以上这些“获取登录态之前”的公开认证入口,统一显式传入:
1. `skipAuth: true`
2. `skipRefresh: true`
这样修完后:
1. 未登录用户点击“获取验证码”不会先打 `/api/auth/refresh`
2. 公开认证入口不会误带旧 token也不会制造无意义的 401 噪音
3. 真正需要 refresh 的仍然只有已拿到登录态后的受保护请求
本次补修的定向验证:
1. `npx vitest run src/services/authService.test.ts`
2. `npm run check:encoding`
--- ---
## 5. 本批次完成后的实际收益 ## 5. 本批次完成后的实际收益

View File

@@ -114,6 +114,11 @@
- `ready`:渲染平台内容和账号能力 - `ready`:渲染平台内容和账号能力
- `pending_bind_phone`:继续保留当前绑定手机号流程,不在这次入口改造里拆散 - `pending_bind_phone`:继续保留当前绑定手机号流程,不在这次入口改造里拆散
首屏之后的鉴权刷新补充约束:
- 平台内容已经渲染后,后续 access token 刷新、401 后重试、账号状态后台重算不能再把整棵平台应用卸载成 `checking / recovering` 加载页。
- 后台鉴权重算期间需要保持当前平台页与主 Tab 状态,避免用户手动切到“创作 / 存档 / 我的”后因为鉴权事件闪屏回到首页。
同时需要在 context 中提供: 同时需要在 context 中提供:
- 当前用户 - 当前用户

View File

@@ -163,6 +163,7 @@
注意: 注意:
- 这个默认进入逻辑只在平台首屏初始化时执行,不能覆盖用户手动切换后的选择。 - 这个默认进入逻辑只在平台首屏初始化时执行,不能覆盖用户手动切换后的选择。
- 若平台首页的公开作品、个人数据、存档列表仍在异步加载中,用户已经手动切到“创作 / 存档 / 我的”时,请求完成后也不能把当前 Tab 回刷成默认 Tab。
--- ---

View File

@@ -0,0 +1,89 @@
# 创作类别开启超时兜底修复记录
日期:`2026-04-22`
## 1. 问题现象
创作中心点击某个创作类别后,入口卡片会进入 `正在开启` 状态,但在后端创建会话迟迟不返回时,界面没有明确失败反馈,用户体感就是“卡死”。
本次定位覆盖入口:
1. `角色扮演 RPG`
2. `大鱼吃小鱼`
3. `拼图玩法`
## 2. 根因结论
这次问题不是前端少写了 `finally`
真实根因是:
1. 创作类别点击后会立即把入口置为 busy。
2. 会话创建请求如果在运行时后端 / Rust 代理 / Spacetime client 这一段长时间无返回,前端 Promise 就不会及时结束。
3. 旧实现缺少“创作入口启动阶段”的独立超时兜底,所以 busy 会持续停留在 `正在开启`
## 3. 本次修复口径
本轮只修“类别开启阶段不能无限等待”,不改创作工作区内部消息流与生成流的超时策略。
冻结口径如下:
1. 创作类别创建会话请求统一增加启动超时。
2. 超时后必须退出 `正在开启` busy 状态。
3. UI 必须展示中文可读错误,不能直接显示底层 `TimeoutError` 或毫秒数字。
4. Node 代理转发 Rust 新玩法接口时也必须有上游超时,避免代理层持续悬挂。
## 4. 具体落地
### 4.1 前端请求层
`src/services/apiClient.ts` 增加 `timeoutMs` 能力:
1. 请求可选传入超时毫秒数。
2. 到达超时后通过 `AbortController` 中断请求。
3. 向上抛出统一 `TimeoutError`
### 4.2 创作类别入口
以下创建会话入口统一使用 `15000ms` 启动超时:
1. `src/services/rpg-creation/rpgCreationAgentClient.ts`
2. `src/services/big-fish-creation/bigFishCreationClient.ts`
3. `src/services/puzzle-agent/puzzleAgentClient.ts`
### 4.3 错误文案
`src/components/rpg-entry/rpgEntryShared.ts` 中统一把超时错误映射为中文提示:
1. RPG`开启创作工作台超时,请确认运行时后端已启动后重试。`
2. Big Fish`开启大鱼吃小鱼创作工作台超时,请确认运行时后端已启动后重试。`
3. 拼图:`开启拼图创作工作台超时,请确认运行时后端已启动后重试。`
### 4.4 Node 代理
以下代理路由新增上游超时:
1. `server-node/src/routes/bigFishProxyRoutes.ts`
2. `server-node/src/routes/puzzleProxyRoutes.ts`
超时后返回:
1. `大鱼吃小鱼后端响应超时`
2. `拼图后端响应超时`
## 5. 验收标准
修复后需要满足:
1. 点击创作类别时,后端长时间无返回不会无限停留在 `正在开启`
2. 超时后入口按钮恢复可点击。
3. 页面展示中文错误提示。
4. Big Fish / 拼图的新玩法代理链同样不会无限挂起。
## 6. 本轮回归
本轮至少补以下回归:
1. `apiClient` 请求超时回归。
2. Big Fish 类别开启超时回归。
3. 拼图类别开启超时回归。

View File

@@ -0,0 +1,85 @@
# 创作入口鉴权错误串味修复
日期:`2026-04-22`
## 1. 问题现象
平台首页点击“创作”后,用户在创作入口浮层或创作中心起始卡片中会看到:
- `缺少 Authorization Bearer Token`
该文案直接暴露了后端鉴权实现细节,不符合平台入口的产品语义,也会让用户误以为“点击创作弹窗本身就失败了”。
## 2. 根因拆解
本次问题实际由两层叠加造成:
1. `useRpgCreationSessionController` 把“恢复旧 Agent 会话失败”的错误写入 `creationTypeError`
2. `PlatformEntryFlowShellImpl` 又把 `creationTypeError` 同时透传给:
- 创作中心起始卡片 `createError`
- 创作类型浮窗 `error`
- 平台首页 `platformError`
结果是:
- 旧会话恢复失败
- 未登录态残留会话恢复
- 本地 access token 丢失但 refresh cookie 仍在
这些与“当前点击新建创作”并不完全等价的错误,被错误地展示到了新建创作入口上。
## 3. 修复策略
### 3.1 错误分层
`useRpgCreationSessionController` 中新增:
- `agentWorkspaceRestoreError`
约束:
1. 旧 Agent 会话恢复失败只写入 `agentWorkspaceRestoreError`
2. 用户主动点击新建创作失败才写入 `creationTypeError`
3. 创作中心起始卡片和创作类型浮窗只展示“新建入口错误”
4. 平台页和工作区恢复占位文案展示“恢复态错误”
### 3.2 鉴权兜底
`fetchWithApiAuth` 中补充规则:
1. 受保护请求若本地没有 bearer token
2. 且请求未声明 `skipAuth / skipRefresh`
3. 先尝试 `ensureStoredAccessToken()` 静默补票
4. 补票失败再继续原始请求
这样可以覆盖“refresh cookie 仍有效,但本地 access token 丢失”的场景,避免后端直接返回“缺少 Authorization Bearer Token”。
### 3.3 用户态错误文案收敛
`resolveRpgEntryErrorMessage``401 UNAUTHORIZED``缺少 Authorization Bearer Token` 统一映射为:
- `当前登录状态已失效,请重新登录后继续。`
目标是把后端实现细节收束成平台用户可理解的恢复动作。
## 4. 影响范围
本轮覆盖:
1. RPG / Custom World 创作入口
2. 平台创作中心起始卡片
3. 平台创作类型浮窗
4. 统一前端 API 鉴权请求层
本轮不改:
1. 后端 `401` 契约
2. 登录弹窗交互
3. Big Fish / Puzzle 的后端路由鉴权策略
## 5. 验收
1. 点击“创作”后,不再出现原始 `Authorization Bearer Token` 报错文案
2. 旧会话恢复失败时,错误只停留在恢复上下文,不污染新建创作入口
3. 本地 token 丢失但 refresh 仍有效时,前端可自动补票后继续请求
4. 相关测试与编码检查通过

View File

@@ -0,0 +1,58 @@
# 创作中心作品卡操作入口落地说明
日期:`2026-04-22`
## 1. 本次目标
创作中心作品卡需要补齐两个直接操作入口:
1. **体验**:对已经满足运行条件的作品,直接从卡片启动对应玩法,不再必须先进详情页。
2. **删除**:对已有正式删除契约的 RPG 已发布作品,直接从卡片删除并刷新创作中心。
## 2. 操作语义
| 作品类型 | 状态 | 主按钮 | 体验入口 | 删除入口 |
| --- | --- | --- | --- | --- |
| RPG Agent 草稿 | `draft` | `继续创作` / `继续完善` | 不展示,草稿需要先走发布链 | 不展示,本轮不新增 Agent session 物理删除 |
| RPG 已发布作品 | `published``canEnterWorld=true` | `查看详情` | 展示 `体验`,直接调用现有进入世界链 | 展示 `删除`,走 owner-only 软删除 |
| 拼图草稿 | `draft` | `查看详情` | 不展示 | 不展示,本轮不新增拼图删除契约 |
| 拼图已发布作品 | `published` | `查看详情` | 展示 `体验`,直接调用 `startPuzzleRun` | 不展示,本轮不新增拼图删除契约 |
## 3. 后端边界
RPG 删除必须继续遵守后端治理里的软删除规则:
1. `custom_world_profile` 增加 `deleted_at` 语义字段。
2. 删除时不物理删除 profile只设置 `deleted_at`、把发布态回退为 `draft`、清空 `published_at`,并删除公开 gallery projection。
3. `library / gallery detail / works` 读取默认过滤 `deleted_at != null` 的作品。
4. 重复删除同一 profile 保持幂等,返回当前可见作品列表。
## 4. 前端边界
1. 卡片只做表现和动作分发,不在前端拼删除逻辑。
2. 删除前使用浏览器确认,避免移动端误触。
3. 卡片按钮移动端优先换行铺开,避免小屏幕上三个按钮拥挤。
4. 不在 UI 中默认展示大段规则说明,失败信息沿用创作中心现有错误 banner。
## 5. 本轮不做
1. 不新增 Agent session 草稿删除。
2. 不新增拼图作品删除。
3. 不新增独立删除面板。
4. 不新建创作页或运行时页面,只复用现有 `CustomWorldCreationHub`、RPG 进入世界链和拼图运行时链。
## 6. 已落地结果
1. 创作中心 RPG 已发布作品卡主按钮统一调整为 `查看详情`,避免和直接进入玩法的动作混淆。
2. RPG 与拼图已发布作品卡新增独立 `体验` 入口,直接复用各自现有运行时进入链路。
3. RPG 已发布作品卡新增 `删除` 入口,调用 `/api/runtime/custom-world-library/{profile_id}``DELETE` 路由,按 owner-only 软删除规则刷新作品列表与公开广场。
4. 创作中心详情页原有删除链路继续保留,和卡片删除共用同一后端删除契约。
## 7. 已验证
1. `corepack pnpm vitest run src/components/rpg-entry/RpgEntryFlowShell.agent.interaction.test.tsx`
2. 交互测试已覆盖:
- 创作卡点击 `查看详情` 进入详情页。
- 创作卡点击 `体验` 直接进入世界选择链路。
- 创作卡点击 `删除` 直接从作品列表移除。
- 详情页删除入口在新卡片动作语义下仍然可用。

View File

@@ -0,0 +1,62 @@
# 世界底稿可选文本字段缺省防护修复 2026-04-22
更新时间:`2026-04-22`
## 1. 问题背景
用户在生成世界底稿时,进度在“补全场景角色细节”前后暂停,最终 operation 进入失败态。
数据库中的失败记录为:
```text
sessionId = custom-world-agent-session-c8fc39e07da4537cce75314bf4a5f92b
operation = draft_foundation
status = failed
phaseLabel = 编译世界底稿
error = Cannot read properties of undefined (reading 'replace')
```
这说明模型分批生成链路已经推进到末端,失败点不是“补全场景角色细节”模型请求本身,而是后续把分批结果编译成 foundation draft / 兼容结果快照时遇到可选文本字段缺省。
## 2. 根因
`server-node/src/services/customWorldAgentFoundationDraftService.ts` 内部的 `clampText(value: string, maxLength: number)` 直接调用:
```ts
value.replace(...)
```
`CustomWorldGenerationRoleOutline` 中以下字段是可选字段:
1. `visualDescription`
2. `actionDescription`
3. `sceneVisualDescription`
模型在“场景角色叙事基础 / 档案细节”批次中允许只补关键叙事字段,不保证每批都回传所有可选视觉字段。合并详情后,某些角色仍可能缺少这些字段。
当编译函数执行:
```ts
clampText(role.visualDescription, 36)
```
如果 `role.visualDescription``undefined`,就会触发 `Cannot read properties of undefined (reading 'replace')`,导致整版世界底稿失败。
## 3. 修复原则
1. 可选文本字段缺省属于正常模型输出波动,不应阻断世界底稿主链。
2. 编译层必须把 `undefined/null/非字符串` 统一归一为空文本,再进入裁剪逻辑。
3. foundation draft 主链应继续保留中文 fallback不能用英文占位替代中文内容。
4. 回归测试需要覆盖“场景角色详情批次缺省可选视觉字段”的真实失败形态。
## 4. 本次落地范围
1. 加固 `customWorldAgentFoundationDraftService.ts` 的本地文本裁剪入口。
2. 加固 `runtime-profile/normalizeShared.ts` 的公共文本裁剪入口,避免兼容 runtime profile 后续遇到同类缺省字段。
3. 新增回归测试,模拟场景角色详情批次省略可选视觉字段时仍能成功生成世界底稿。
## 5. 验收标准
1. 同类模型输出缺省 `visualDescription/actionDescription/sceneVisualDescription` 时,底稿生成不再抛出 `.replace` undefined。
2. operation 应继续推进到 `completed`,并进入结果页可浏览的草稿卡链路。
3. 测试覆盖这次失败的核心路径。

View File

@@ -0,0 +1,121 @@
# 平台入口鉴权守卫与资源 404 去重修复
日期:`2026-04-22`
## 1. 问题现象
平台入口当前存在两类前端噪音:
1. 登录态正在 `checking / recovering` 时,首页内容为了避免闪烁会继续保留旧 `user`,但部分受保护请求直接以 `user.id` 作为触发条件,导致 `Puzzle works` 列表仍会提前请求并打出 `401 Unauthorized`
2. 卡面、封面和角色图命中旧 `/generated-*` 路径且后端确认对象不存在时,前端每次渲染都会重新请求 `/api/assets/read-url`,导致控制台重复刷 `404 Not Found`
## 2. 根因拆解
### 2.1 受保护请求误判
`AuthGate` 当前为了保持平台内容稳定,会在鉴权自检阶段继续向子树暴露 `readyUser`
这本来只该影响展示层,但 `PlatformEntryFlowShellImpl``useRpgEntryBootstrap` 里部分逻辑直接用:
1. `Boolean(user)`
2. `user?.id`
来判断是否可以读取受保护数据,结果把“展示继续挂载”误当成“鉴权已经稳定”。
### 2.2 旧资源路径重复换签
`assetReadUrlService` 只缓存成功返回的签名 URL没有缓存“对象不存在”这一失败结果。
当 UI 多次渲染同一个缺失资源时,会持续对同一 legacy path 重复调用:
1. `GET /api/assets/read-url?...`
2. 后端稳定返回 `404`
3. 前端再次重试同一路径
## 3. 修复策略
### 3.1 显式区分展示态与可读保护数据态
`AuthUiContext` 中新增:
1. `canAccessProtectedData`
约束:
1. `user` 仍可在 `checking / recovering` 阶段用于保持 UI 挂载。
2. 只有 `status === 'ready' && Boolean(user)` 时,`canAccessProtectedData` 才为 `true`
3. 平台入口 bootstrap 与拼图作品列表请求统一改为依赖 `canAccessProtectedData`,不再直接拿 `user.id` 当鉴权就绪条件。
### 3.2 为 404 旧资源增加短期失败缓存
`assetReadUrlService` 中新增失败缓存:
1. 仅针对 `ApiClientError.status === 404` 的 legacy path 读取失败进行缓存。
2. 默认缓存窗口为 `60s`
3. 同一路径在失败缓存有效期内直接短路,不再重复向 `/api/assets/read-url` 发请求。
4. 成功读取后清理对应失败缓存。
说明:
1. 本轮只做“404 去重”,不改原始图片回退逻辑。
2. `ResolvedAssetImage` 仍会在换签失败时保留原路径回退,避免界面直接空白。
## 4. 影响范围
本轮覆盖:
1. `AuthGate` 鉴权 UI 上下文
2. 平台入口 bootstrap
3. 拼图作品列表预取
4. 旧 generated 资源换签服务
5. 相关交互测试与资源服务测试
本轮不改:
1. 后端 `401 / 404` 契约
2. 登录弹窗流程
3.`/generated-*` 同源代理路由
## 5. 验收
1. 鉴权自检阶段平台内容可继续显示,但不会再误发 `Puzzle works` 受保护请求。
2. `当前登录状态已失效,请重新登录后继续。` 仍是入口层统一错误文案。
3. 同一条缺失的 legacy 资源路径在短时间内不会重复刷 `/api/assets/read-url``404`
4. 相关测试通过,编码检查通过。
## 6. 2026-04-22 补充修正:登录成功后拼图作品列表 401 循环
### 6.1 问题现象
用户已经完成登录,但平台入口进入创作区后,控制台仍持续出现:
1. `GET /api/runtime/puzzle/works 401 (Unauthorized)`
2. `AuthGate` 被动收到全局鉴权变更事件
3. 平台壳层重新 hydrate
4. 拼图作品列表再次自动请求
最终表现成“登录成功后仍循环刷 401”。
### 6.2 根因拆解
这次实际是前后端两层边界叠加:
1. Node 代理路由 `server-node/src/routes/puzzleProxyRoutes.ts` 已经完成外层 JWT 校验,并把用户 id 通过内部转发头带给 Rust API。
2. Rust API `server-rs/crates/api-server/src/auth.rs` 之前只允许 `big-fish` 路径信任这类内部转发头,没有把 `/api/runtime/puzzle/**` 纳入白名单。
3. 因此拼图代理链路会在 Node 首层通过后Rust 二跳再次因为“缺少 Bearer”返回 `401`
4. 前端 `fetchWithApiAuth(...)` 在“首个 401 -> refresh 成功 -> 重试后的业务请求仍 401”时又会把刚刷新到的 token 清掉并广播一次全局鉴权变更。
5. `AuthGate` 监听到事件后重新 hydrate平台入口又重新预取拼图作品列表于是形成循环。
### 6.3 修复策略
1. Rust `require_bearer_auth` 新增 `allows_internal_forwarded_auth(...)`,显式允许:
- `/api/runtime/big-fish/**`
- `/api/runtime/puzzle/**`
2. 前端 `fetchWithApiAuth(...)` 调整 401 后置处理:
- 只有“尚未尝试 refresh”的 401才清 token 并广播鉴权变化
- 若 refresh 已成功,但重试请求仍返回 401则保留新 token把失败收敛为当前业务请求自身错误
3. 补充请求层回归测试覆盖“refresh 成功但重试仍 401”的场景。
### 6.4 修后约束
1. 拼图运行时代理链路与大鱼链路统一使用同一套内部已鉴权转发约束。
2. 单个业务接口的 401 不再自动放大成整个平台的登录态震荡。
3. 平台首页和创作区仍保留原有 `canAccessProtectedData` 守卫,不会在未登录态预取拼图私有数据。

View File

@@ -0,0 +1,36 @@
# 平台主 Tab 渲染稳定性修复
日期:`2026-04-22`
## 问题现象
平台首页在“首页 / 创作 / 存档 / 我的”之间切换时,页面组件会出现短暂闪烁、错位或像是先渲染上一页元素再变成当前页的感觉。
## 根因拆解
本次问题集中在表现层:
1. 四个主 Tab 共用同一个 `content` 根节点React 在条件分支切换时会按位置复用上一页 DOM图片卡片、面板和按钮容易在首帧被改造成新页面结构。
2. 移动端和桌面端都共用一个滚动容器,切到新 Tab 时会继承上一页的 `scrollTop`,用户会先看到错位位置或短暂空白。
3. 创作中心等重页面被卸载后再挂载,内部筛选状态、图片加载状态和布局测量会重新跑一遍,来回切换时会放大闪烁。
## 修复策略
1. 主 Tab 内容改为稳定面板栈,四个 Tab 各自拥有独立的内容根节点。
2. 非当前 Tab 使用隐藏类保留挂载,不参与布局和交互,避免每次切换销毁再重建页面。
3. 每个 Tab 面板自带独立滚动容器,切换时不再继承其他 Tab 的滚动位置。
4. 桌面端首页保留控制台化布局,非首页 Tab 继续复用移动端内容结构,但放入桌面独立滚动面板中。
## 后续约束
1. 平台主 Tab 新增页面时,优先加入现有面板栈,不要恢复成单个 `content` 条件分支。
2. Tab 切换只做可见性切换,不要默认触发页面级 `AnimatePresence` 进出场。
3. 需要展示加载态时,优先在当前 Tab 内部局部展示骨架,不要把整页替换为空白加载页。
4. UI 中不增加规则说明类文案,只保留入口、状态和业务信息。
## 验收要点
1. 手机端连续点击四个底部 Tab不出现上一页元素先闪一下再变成当前页。
2. 在首页滚动后切到“我的 / 存档”,新页面不继承首页滚动位置。
3. 创作 Tab 来回切换后,创作中心内部筛选和已加载卡片保持稳定。
4. 桌面端左侧导航切换时,顶部栏和左侧导航不重挂载,主内容不出现整页淡入闪烁。

View File

@@ -4,6 +4,8 @@
## 文档列表 ## 文档列表
- [CREATION_HUB_CARD_ACTIONS_2026-04-22.md](./CREATION_HUB_CARD_ACTIONS_2026-04-22.md):冻结创作中心作品卡“体验 / 删除”入口的最小落地语义,明确 RPG 已发布作品软删除、卡片直达运行时,以及暂不扩草稿 / 拼图删除契约。
- [CREATION_CATEGORY_OPENING_TIMEOUT_GUARD_FIX_2026-04-22.md](./CREATION_CATEGORY_OPENING_TIMEOUT_GUARD_FIX_2026-04-22.md):记录创作中心点击类别后长时间停留在“正在开启”的根因与修复口径,收口前端创建会话启动超时、中文错误提示以及 Big Fish / 拼图代理上游超时兜底。
- [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_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` 已挂载的 96 条 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 存储边界和文档维护门禁。 - [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 存储边界和文档维护门禁。

View File

@@ -6,7 +6,7 @@
把平台内所有“先 Agent 聊天收束锚点,再生成结果页”的创作流程统一到一套前端框架: 把平台内所有“先 Agent 聊天收束锚点,再生成结果页”的创作流程统一到一套前端框架:
1. UI 交互共用一套:标题区、返回、生成结果页按钮、锚点卡片、进度条、操作横幅、聊天气泡、推荐回复、输入框。 1. UI 交互共用一套:标题区、返回、进度条、进度操作按钮、生成结果页按钮、操作横幅、聊天气泡、推荐回复、输入框。
2. 对话进度管理共用一套进度归一化、忙碌态判断、SSE `reply_delta / session / error` 解析、操作状态展示。 2. 对话进度管理共用一套进度归一化、忙碌态判断、SSE `reply_delta / session / error` 解析、操作状态展示。
3. 品类差异只允许落在配置和后端领域逻辑:锚点列表、提示词/占位文案、生成结果页 action、快捷补全/总结话术、结果页与运行态。 3. 品类差异只允许落在配置和后端领域逻辑:锚点列表、提示词/占位文案、生成结果页 action、快捷补全/总结话术、结果页与运行态。
@@ -47,6 +47,13 @@ src/services/creation-agent/
6. `streamingReplyText / isStreamingReply / isBusy / error` 6. `streamingReplyText / isStreamingReply / isBusy / error`
7. `onBack / onSubmitText / onPrimaryAction / onQuickAction` 7. `onBack / onSubmitText / onPrimaryAction / onQuickAction`
聊天页展示规则:
1. Agent 聊天页不展示锚点内容卡片,锚点只作为进度与后端生成依据。
2. 生成草稿 / 生成结果页主按钮只在 `progressPercent` 归一化后达到 `100%` 时显示。
3. 进度条下方承载“总结当前设定”“补全剩余设定”等进度操作按钮。
4. “补全剩余设定”必须配置 `minTurn: 2`,对话不足两轮时不显示。
组件内部只做表现,不读取任何 RPG、Big Fish、Puzzle 专属字段。 组件内部只做表现,不读取任何 RPG、Big Fish、Puzzle 专属字段。
### 3.2 会话 view model ### 3.2 会话 view model
@@ -121,6 +128,6 @@ src/services/creation-agent/
## 6. 验收 ## 6. 验收
1. 三个创作流程的 Agent 聊天区都通过 `CreationAgentWorkspace` 渲染。 1. 三个创作流程的 Agent 聊天区都通过 `CreationAgentWorkspace` 渲染。
2. Big Fish 与 Puzzle 不再各自复制聊天 UI、锚点卡片、输入框和进度条。 2. Big Fish 与 Puzzle 不再各自复制聊天 UI、输入框和进度条。
3. RPG / Custom World 保留原有“总结当前设定 / 补全剩余设定 / 生成游戏设定草稿”交互。 3. RPG / Custom World 保留原有“总结当前设定 / 补全剩余设定 / 生成游戏设定草稿”交互。
4. 定向 TypeScript / ESLint / 编码检查通过。 4. 定向 TypeScript / ESLint / 编码检查通过。

View File

@@ -98,8 +98,8 @@ export function normalizeTags(value: unknown, fallbackTags: string[] = []) {
].slice(0, 5); ].slice(0, 5);
} }
export function clampText(value: string, maxLength: number) { export function clampText(value: unknown, maxLength: number) {
const normalized = value.trim().replace(/\s+/g, ' '); const normalized = toText(value).replace(/\s+/g, ' ');
if (!normalized) { if (!normalized) {
return ''; return '';
} }

View File

@@ -18,6 +18,7 @@ import { routeMeta } from '../middleware/routeMeta.js';
const BIG_FISH_ROUTE_VERSION = '2026-04-22'; const BIG_FISH_ROUTE_VERSION = '2026-04-22';
const DEFAULT_RUST_API_TARGET = 'http://127.0.0.1:3100'; const DEFAULT_RUST_API_TARGET = 'http://127.0.0.1:3100';
const DEFAULT_INTERNAL_API_SECRET = 'genarrative-dev-internal-bridge'; const DEFAULT_INTERNAL_API_SECRET = 'genarrative-dev-internal-bridge';
const BIG_FISH_UPSTREAM_TIMEOUT_MS = 15000;
const INTERNAL_USER_HEADER = 'x-genarrative-authenticated-user-id'; const INTERNAL_USER_HEADER = 'x-genarrative-authenticated-user-id';
const INTERNAL_SECRET_HEADER = 'x-genarrative-internal-api-secret'; const INTERNAL_SECRET_HEADER = 'x-genarrative-internal-api-secret';
@@ -106,12 +107,17 @@ async function proxyBigFishRequest(params: {
: undefined; : undefined;
let upstreamResponse: globalThis.Response; let upstreamResponse: globalThis.Response;
const controller = new AbortController();
const timeoutId = setTimeout(() => {
controller.abort();
}, BIG_FISH_UPSTREAM_TIMEOUT_MS);
try { try {
upstreamResponse = await fetch(upstreamUrl, { upstreamResponse = await fetch(upstreamUrl, {
method, method,
// 这里显式转发“已通过 Node 校验的用户身份”,让 Big Fish 继续由 Rust 真相后端处理。 // 这里显式转发“已通过 Node 校验的用户身份”,让 Big Fish 继续由 Rust 真相后端处理。
headers: pickForwardHeaders(request, context, userId), headers: pickForwardHeaders(request, context, userId),
body, body,
signal: controller.signal,
}); });
} catch (error) { } catch (error) {
request.log?.error( request.log?.error(
@@ -122,7 +128,13 @@ async function proxyBigFishRequest(params: {
}, },
'big fish upstream request failed', 'big fish upstream request failed',
); );
throw upstreamError('大鱼吃小鱼后端暂时不可用'); throw upstreamError(
error instanceof Error && error.name === 'AbortError'
? '大鱼吃小鱼后端响应超时'
: '大鱼吃小鱼后端暂时不可用',
);
} finally {
clearTimeout(timeoutId);
} }
prepareApiResponse(request, response, { prepareApiResponse(request, response, {

View File

@@ -18,6 +18,7 @@ import { routeMeta } from '../middleware/routeMeta.js';
const PUZZLE_ROUTE_VERSION = '2026-04-22'; const PUZZLE_ROUTE_VERSION = '2026-04-22';
const DEFAULT_RUST_API_TARGET = 'http://127.0.0.1:3100'; const DEFAULT_RUST_API_TARGET = 'http://127.0.0.1:3100';
const DEFAULT_INTERNAL_API_SECRET = 'genarrative-dev-internal-bridge'; const DEFAULT_INTERNAL_API_SECRET = 'genarrative-dev-internal-bridge';
const PUZZLE_UPSTREAM_TIMEOUT_MS = 15000;
const INTERNAL_USER_HEADER = 'x-genarrative-authenticated-user-id'; const INTERNAL_USER_HEADER = 'x-genarrative-authenticated-user-id';
const INTERNAL_SECRET_HEADER = 'x-genarrative-internal-api-secret'; const INTERNAL_SECRET_HEADER = 'x-genarrative-internal-api-secret';
@@ -106,11 +107,16 @@ async function proxyPuzzleRequest(params: {
: undefined; : undefined;
let upstreamResponse: globalThis.Response; let upstreamResponse: globalThis.Response;
const controller = new AbortController();
const timeoutId = setTimeout(() => {
controller.abort();
}, PUZZLE_UPSTREAM_TIMEOUT_MS);
try { try {
upstreamResponse = await fetch(upstreamUrl, { upstreamResponse = await fetch(upstreamUrl, {
method, method,
headers: pickForwardHeaders(request, context, userId), headers: pickForwardHeaders(request, context, userId),
body, body,
signal: controller.signal,
}); });
} catch (error) { } catch (error) {
request.log?.error( request.log?.error(
@@ -121,7 +127,13 @@ async function proxyPuzzleRequest(params: {
}, },
'puzzle upstream request failed', 'puzzle upstream request failed',
); );
throw upstreamError('拼图后端暂时不可用'); throw upstreamError(
error instanceof Error && error.name === 'AbortError'
? '拼图后端响应超时'
: '拼图后端暂时不可用',
);
} finally {
clearTimeout(timeoutId);
} }
prepareApiResponse(request, response, { prepareApiResponse(request, response, {

View File

@@ -5,7 +5,11 @@ import type { UpstreamLlmClient } from './llmClient.js';
import { CustomWorldAgentFoundationDraftService } from './customWorldAgentFoundationDraftService.js'; import { CustomWorldAgentFoundationDraftService } from './customWorldAgentFoundationDraftService.js';
import { normalizeFoundationDraftProfile } from './customWorldAgentDraftCompiler.js'; import { normalizeFoundationDraftProfile } from './customWorldAgentDraftCompiler.js';
function createFoundationDraftLlmClient(): UpstreamLlmClient { function createFoundationDraftLlmClient(
options: {
omitStoryOptionalVisualFields?: boolean;
} = {},
): UpstreamLlmClient {
let roleOutlineBatch = 0; let roleOutlineBatch = 0;
let landmarkSeedBatch = 0; let landmarkSeedBatch = 0;
let landmarkNetworkBatch = 0; let landmarkNetworkBatch = 0;
@@ -68,9 +72,15 @@ function createFoundationDraftLlmClient(): UpstreamLlmClient {
title: '旧友兼宿敌', title: '旧友兼宿敌',
role: '沉船商盟引路人', role: '沉船商盟引路人',
description: '他像旧友,也像最早知道假航灯秘密的人。', description: '他像旧友,也像最早知道假航灯秘密的人。',
visualDescription: '衣角总带着潮水味,像是刚从夜雾里走出来。', ...(options.omitStoryOptionalVisualFields
actionDescription: '会不断试探玩家到底愿不愿意回到旧航路。', ? {}
sceneVisualDescription: '总在钟声停下后的空隙里现身。', : {
visualDescription:
'衣角总带着潮水味,像是刚从夜雾里走出来。',
actionDescription:
'会不断试探玩家到底愿不愿意回到旧航路。',
sceneVisualDescription: '总在钟声停下后的空隙里现身。',
}),
initialAffinity: 6, initialAffinity: 6,
relationshipHooks: ['和玩家共享一段无法翻篇的旧灯塔往事'], relationshipHooks: ['和玩家共享一段无法翻篇的旧灯塔往事'],
tags: ['旧友', '宿敌'], tags: ['旧友', '宿敌'],
@@ -80,9 +90,14 @@ function createFoundationDraftLlmClient(): UpstreamLlmClient {
title: '守灯会巡夜官', title: '守灯会巡夜官',
role: '守灯会前台接口人', role: '守灯会前台接口人',
description: '她负责把守灯会的怀疑与命令直接压到玩家面前。', description: '她负责把守灯会的怀疑与命令直接压到玩家面前。',
visualDescription: '披着潮湿斗篷,眼神总先看灯芯再看人。', ...(options.omitStoryOptionalVisualFields
actionDescription: '要求玩家立刻证明自己还配站回灯塔。', ? {}
sceneVisualDescription: '总把巡夜灯举得很高,不给人躲闪空间。', : {
visualDescription: '披着潮湿斗篷,眼神总先看灯芯再看人。',
actionDescription: '要求玩家立刻证明自己还配站回灯塔。',
sceneVisualDescription:
'总把巡夜灯举得很高,不给人躲闪空间。',
}),
initialAffinity: 6, initialAffinity: 6,
relationshipHooks: ['会逼玩家更早站队'], relationshipHooks: ['会逼玩家更早站队'],
tags: ['守灯会', '巡夜'], tags: ['守灯会', '巡夜'],
@@ -198,9 +213,15 @@ function createFoundationDraftLlmClient(): UpstreamLlmClient {
title: '旧友兼宿敌', title: '旧友兼宿敌',
role: '沉船商盟引路人', role: '沉船商盟引路人',
description: '他像旧友,也像最早知道假航灯秘密的人。', description: '他像旧友,也像最早知道假航灯秘密的人。',
visualDescription: '衣角总带着潮水味,像是刚从夜雾里走出来。', ...(options.omitStoryOptionalVisualFields
actionDescription: '会不断试探玩家到底愿不愿意回到旧航路。', ? {}
sceneVisualDescription: '总在钟声停下后的空隙里现身。', : {
visualDescription:
'衣角总带着潮水味,像是刚从夜雾里走出来。',
actionDescription:
'会不断试探玩家到底愿不愿意回到旧航路。',
sceneVisualDescription: '总在钟声停下后的空隙里现身。',
}),
relationshipHooks: ['和玩家共享一段无法翻篇的旧灯塔往事'], relationshipHooks: ['和玩家共享一段无法翻篇的旧灯塔往事'],
tags: ['旧友', '宿敌'], tags: ['旧友', '宿敌'],
}, },
@@ -209,9 +230,14 @@ function createFoundationDraftLlmClient(): UpstreamLlmClient {
title: '守灯会巡夜官', title: '守灯会巡夜官',
role: '守灯会前台接口人', role: '守灯会前台接口人',
description: '她负责把守灯会的怀疑与命令直接压到玩家面前。', description: '她负责把守灯会的怀疑与命令直接压到玩家面前。',
visualDescription: '披着潮湿斗篷,眼神总先看灯芯再看人。', ...(options.omitStoryOptionalVisualFields
actionDescription: '要求玩家立刻证明自己还配站回灯塔。', ? {}
sceneVisualDescription: '总把巡夜灯举得很高,不给人躲闪空间。', : {
visualDescription: '披着潮湿斗篷,眼神总先看灯芯再看人。',
actionDescription: '要求玩家立刻证明自己还配站回灯塔。',
sceneVisualDescription:
'总把巡夜灯举得很高,不给人躲闪空间。',
}),
relationshipHooks: ['会逼玩家更早站队'], relationshipHooks: ['会逼玩家更早站队'],
tags: ['守灯会', '巡夜'], tags: ['守灯会', '巡夜'],
}, },
@@ -228,9 +254,15 @@ function createFoundationDraftLlmClient(): UpstreamLlmClient {
title: '旧友兼宿敌', title: '旧友兼宿敌',
role: '沉船商盟引路人', role: '沉船商盟引路人',
description: '他像旧友,也像最早知道假航灯秘密的人。', description: '他像旧友,也像最早知道假航灯秘密的人。',
visualDescription: '衣角总带着潮水味,像是刚从夜雾里走出来。', ...(options.omitStoryOptionalVisualFields
actionDescription: '会不断试探玩家到底愿不愿意回到旧航路。', ? {}
sceneVisualDescription: '总在钟声停下后的空隙里现身。', : {
visualDescription:
'衣角总带着潮水味,像是刚从夜雾里走出来。',
actionDescription:
'会不断试探玩家到底愿不愿意回到旧航路。',
sceneVisualDescription: '总在钟声停下后的空隙里现身。',
}),
relationshipHooks: ['和玩家共享一段无法翻篇的旧灯塔往事'], relationshipHooks: ['和玩家共享一段无法翻篇的旧灯塔往事'],
tags: ['旧友', '宿敌'], tags: ['旧友', '宿敌'],
}, },
@@ -239,9 +271,14 @@ function createFoundationDraftLlmClient(): UpstreamLlmClient {
title: '守灯会巡夜官', title: '守灯会巡夜官',
role: '守灯会前台接口人', role: '守灯会前台接口人',
description: '她负责把守灯会的怀疑与命令直接压到玩家面前。', description: '她负责把守灯会的怀疑与命令直接压到玩家面前。',
visualDescription: '披着潮湿斗篷,眼神总先看灯芯再看人。', ...(options.omitStoryOptionalVisualFields
actionDescription: '要求玩家立刻证明自己还配站回灯塔。', ? {}
sceneVisualDescription: '总把巡夜灯举得很高,不给人躲闪空间。', : {
visualDescription: '披着潮湿斗篷,眼神总先看灯芯再看人。',
actionDescription: '要求玩家立刻证明自己还配站回灯塔。',
sceneVisualDescription:
'总把巡夜灯举得很高,不给人躲闪空间。',
}),
relationshipHooks: ['会逼玩家更早站队'], relationshipHooks: ['会逼玩家更早站队'],
tags: ['守灯会', '巡夜'], tags: ['守灯会', '巡夜'],
}, },
@@ -322,3 +359,49 @@ test('foundation draft service builds draft fields directly from framework inste
assert.equal(legacyStoryNpcs[0]?.name, '沈砺'); assert.equal(legacyStoryNpcs[0]?.name, '沈砺');
assert.equal(legacyStoryNpcs[0]?.backstory, undefined); assert.equal(legacyStoryNpcs[0]?.backstory, undefined);
}); });
test('foundation draft service tolerates missing optional scene role visual fields', async () => {
const service = new CustomWorldAgentFoundationDraftService(
createFoundationDraftLlmClient({
omitStoryOptionalVisualFields: true,
}),
);
const draft = await service.generate({
creatorIntent: {
sourceMode: 'freeform',
rawSettingText: '被海雾反复切开的列岛世界。',
worldHook: '旧灯塔、假航灯与失控航路重新把列岛撕开。',
themeKeywords: ['海岛', '悬疑'],
toneDirectives: ['冷峻', '潮湿'],
playerPremise: '玩家是被迫返乡的失职守灯人',
openingSituation: '开局时正站在即将熄灭的旧灯塔上',
coreConflicts: ['守灯会与沉船商盟争夺旧航路解释权'],
keyFactions: [],
keyCharacters: [],
keyLandmarks: [],
iconicElements: ['潮雾钟声', '盐火灯塔'],
forbiddenDirectives: [],
},
anchorPack: {
creatorIntentSummary: '潮雾、旧灯塔、假航灯和被迫返乡的守灯人。',
},
});
const normalized = normalizeFoundationDraftProfile(draft);
const legacyResultProfile = (draft as Record<string, unknown>)
.legacyResultProfile as Record<string, unknown> | undefined;
const legacyStoryNpcs = Array.isArray(legacyResultProfile?.storyNpcs)
? (legacyResultProfile?.storyNpcs as Array<Record<string, unknown>>)
: [];
assert.ok(normalized);
assert.equal(normalized?.storyNpcs.length, 2);
assert.equal(normalized?.storyNpcs[0]?.name, '沈砺');
assert.equal(
normalized?.storyNpcs[0]?.publicMask,
'他像旧友,也像最早知道假航灯秘密的人。',
);
assert.ok((normalized?.storyNpcs[0]?.currentPressure ?? '').trim());
assert.equal(legacyStoryNpcs[0]?.visualDescription, undefined);
});

View File

@@ -61,8 +61,8 @@ function toRecord(value: unknown) {
: null; : null;
} }
function clampText(value: string, maxLength: number) { function clampText(value: unknown, maxLength: number) {
const normalized = value.replace(/\s+/gu, ' ').trim(); const normalized = toText(value).replace(/\s+/gu, ' ').trim();
if (!normalized) { if (!normalized) {
return ''; return '';
} }

View File

@@ -41,13 +41,13 @@ use crate::{
generate_character_visual, get_character_visual_job, publish_character_visual, generate_character_visual, get_character_visual_job, publish_character_visual,
}, },
custom_world::{ custom_world::{
create_custom_world_agent_session, execute_custom_world_agent_action, create_custom_world_agent_session, delete_custom_world_library_profile,
get_custom_world_agent_card_detail, get_custom_world_agent_operation, execute_custom_world_agent_action, get_custom_world_agent_card_detail,
get_custom_world_agent_session, get_custom_world_gallery_detail, get_custom_world_library, get_custom_world_agent_operation, get_custom_world_agent_session,
get_custom_world_library_detail, get_custom_world_works, list_custom_world_gallery, get_custom_world_gallery_detail, get_custom_world_library, get_custom_world_library_detail,
publish_custom_world_library_profile, put_custom_world_library_profile, get_custom_world_works, list_custom_world_gallery, publish_custom_world_library_profile,
stream_custom_world_agent_message, submit_custom_world_agent_message, put_custom_world_library_profile, stream_custom_world_agent_message,
unpublish_custom_world_library_profile, submit_custom_world_agent_message, unpublish_custom_world_library_profile,
}, },
custom_world_ai::{ custom_world_ai::{
generate_custom_world_cover_image, generate_custom_world_entity, generate_custom_world_cover_image, generate_custom_world_entity,
@@ -359,6 +359,7 @@ pub fn build_router(state: AppState) -> Router {
"/api/runtime/custom-world-library/{profile_id}", "/api/runtime/custom-world-library/{profile_id}",
get(get_custom_world_library_detail) get(get_custom_world_library_detail)
.put(put_custom_world_library_profile) .put(put_custom_world_library_profile)
.delete(delete_custom_world_library_profile)
.route_layer(middleware::from_fn_with_state( .route_layer(middleware::from_fn_with_state(
state.clone(), state.clone(),
require_bearer_auth, require_bearer_auth,

View File

@@ -59,7 +59,7 @@ pub async fn require_bearer_auth(
mut request: Request, mut request: Request,
next: Next, next: Next,
) -> Result<Response, AppError> { ) -> Result<Response, AppError> {
if request.uri().path().starts_with("/api/runtime/big-fish/") if allows_internal_forwarded_auth(request.uri().path())
&& let Some(claims) = try_build_internal_forwarded_claims(&state, request.headers()) && let Some(claims) = try_build_internal_forwarded_claims(&state, request.headers())
{ {
request request
@@ -187,6 +187,11 @@ fn extract_bearer_token(headers: &HeaderMap) -> Result<String, AppError> {
Ok(token.to_string()) Ok(token.to_string())
} }
fn allows_internal_forwarded_auth(path: &str) -> bool {
// Node 代理已经完成平台账号 JWT 校验Rust 运行时只信任这些明确的内部转发路径。
path.starts_with("/api/runtime/big-fish/") || path.starts_with("/api/runtime/puzzle/")
}
fn try_build_internal_forwarded_claims( fn try_build_internal_forwarded_claims(
state: &AppState, state: &AppState,
headers: &HeaderMap, headers: &HeaderMap,
@@ -234,7 +239,7 @@ fn try_build_internal_forwarded_claims(
mod tests { mod tests {
use super::{ use super::{
INTERNAL_API_SECRET_HEADER, INTERNAL_AUTH_USER_ID_HEADER, RefreshSessionToken, INTERNAL_API_SECRET_HEADER, INTERNAL_AUTH_USER_ID_HEADER, RefreshSessionToken,
extract_bearer_token, try_build_internal_forwarded_claims, allows_internal_forwarded_auth, extract_bearer_token, try_build_internal_forwarded_claims,
}; };
use crate::{config::AppConfig, state::AppState}; use crate::{config::AppConfig, state::AppState};
use axum::{ use axum::{
@@ -272,6 +277,15 @@ mod tests {
assert_eq!(token.token(), "refresh-token-01"); assert_eq!(token.token(), "refresh-token-01");
} }
#[test]
fn internal_forwarded_auth_allows_node_proxy_runtime_paths() {
assert!(allows_internal_forwarded_auth(
"/api/runtime/big-fish/sessions"
));
assert!(allows_internal_forwarded_auth("/api/runtime/puzzle/works"));
assert!(!allows_internal_forwarded_auth("/api/auth/me"));
}
#[test] #[test]
fn internal_forwarded_claims_require_matching_secret() { fn internal_forwarded_claims_require_matching_secret() {
let mut config = AppConfig::default(); let mut config = AppConfig::default();

View File

@@ -178,6 +178,42 @@ pub async fn put_custom_world_library_profile(
)) ))
} }
pub async fn delete_custom_world_library_profile(
State(state): State<AppState>,
Extension(request_context): Extension<RequestContext>,
Extension(authenticated): Extension<AuthenticatedAccessToken>,
Path(profile_id): Path<String>,
) -> Result<Json<Value>, Response> {
let owner_user_id = authenticated.claims().user_id().to_string();
if profile_id.trim().is_empty() {
return Err(custom_world_error_response(
&request_context,
AppError::from_status(StatusCode::BAD_REQUEST).with_details(json!({
"provider": "custom-world-library",
"message": "profileId is required",
})),
));
}
let entries = state
.spacetime_client()
.delete_custom_world_profile(profile_id, owner_user_id, current_utc_micros())
.await
.map_err(|error| {
custom_world_error_response(&request_context, map_custom_world_client_error(error))
})?;
Ok(json_success_body(
Some(&request_context),
CustomWorldLibraryResponse {
entries: entries
.into_iter()
.map(map_custom_world_library_entry_response)
.collect(),
},
))
}
pub async fn publish_custom_world_library_profile( pub async fn publish_custom_world_library_profile(
State(state): State<AppState>, State(state): State<AppState>,
Extension(request_context): Extension<RequestContext>, Extension(request_context): Extension<RequestContext>,

View File

@@ -182,6 +182,7 @@ pub struct CustomWorldProfileSnapshot {
pub landmark_count: u32, pub landmark_count: u32,
pub author_display_name: String, pub author_display_name: String,
pub published_at_micros: Option<i64>, pub published_at_micros: Option<i64>,
pub deleted_at_micros: Option<i64>,
pub created_at_micros: i64, pub created_at_micros: i64,
pub updated_at_micros: i64, pub updated_at_micros: i64,
} }
@@ -438,6 +439,14 @@ pub struct CustomWorldProfileUnpublishInput {
pub updated_at_micros: i64, pub updated_at_micros: i64,
} }
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct CustomWorldProfileDeleteInput {
pub profile_id: String,
pub owner_user_id: String,
pub deleted_at_micros: i64,
}
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))] #[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct CustomWorldProfileListInput { pub struct CustomWorldProfileListInput {
@@ -887,6 +896,19 @@ pub fn validate_custom_world_profile_unpublish_input(
Ok(()) Ok(())
} }
pub fn validate_custom_world_profile_delete_input(
input: &CustomWorldProfileDeleteInput,
) -> Result<(), CustomWorldFieldError> {
if input.profile_id.trim().is_empty() {
return Err(CustomWorldFieldError::MissingProfileId);
}
if input.owner_user_id.trim().is_empty() {
return Err(CustomWorldFieldError::MissingOwnerUserId);
}
Ok(())
}
pub fn validate_custom_world_profile_list_input( pub fn validate_custom_world_profile_list_input(
input: &CustomWorldProfileListInput, input: &CustomWorldProfileListInput,
) -> Result<(), CustomWorldFieldError> { ) -> Result<(), CustomWorldFieldError> {
@@ -1622,6 +1644,18 @@ mod tests {
assert_eq!(error, CustomWorldFieldError::MissingOwnerUserId); assert_eq!(error, CustomWorldFieldError::MissingOwnerUserId);
} }
#[test]
fn profile_delete_input_requires_profile_and_owner() {
let error = validate_custom_world_profile_delete_input(&CustomWorldProfileDeleteInput {
profile_id: " ".to_string(),
owner_user_id: "user_001".to_string(),
deleted_at_micros: 1,
})
.expect_err("blank profile id should fail");
assert_eq!(error, CustomWorldFieldError::MissingProfileId);
}
#[test] #[test]
fn published_profile_compile_merges_legacy_theme_and_latest_assets() { fn published_profile_compile_merges_legacy_theme_and_latest_assets() {
let snapshot = build_custom_world_published_profile_compile_snapshot( let snapshot = build_custom_world_published_profile_compile_snapshot(

View File

@@ -66,8 +66,7 @@ use module_puzzle::{
}; };
use module_runtime::{ use module_runtime::{
RuntimeBrowseHistoryRecord, RuntimeBrowseHistoryThemeMode, RuntimePlatformTheme, RuntimeBrowseHistoryRecord, RuntimeBrowseHistoryThemeMode, RuntimePlatformTheme,
RuntimeProfileDashboardRecord, RuntimeProfilePlayStatsRecord, RuntimeProfileDashboardRecord, RuntimeProfilePlayStatsRecord, RuntimeProfileSaveArchiveRecord,
RuntimeProfileSaveArchiveRecord,
RuntimeProfileWalletLedgerEntryRecord, RuntimeProfileWalletLedgerSourceType, RuntimeProfileWalletLedgerEntryRecord, RuntimeProfileWalletLedgerSourceType,
RuntimeSettingsRecord, RuntimeSnapshotRecord, build_runtime_browse_history_clear_input, RuntimeSettingsRecord, RuntimeSnapshotRecord, build_runtime_browse_history_clear_input,
build_runtime_browse_history_list_input, build_runtime_browse_history_record, build_runtime_browse_history_list_input, build_runtime_browse_history_record,
@@ -125,8 +124,7 @@ use crate::module_bindings::{
BigFishAgentMessageKind as BindingBigFishAgentMessageKind, BigFishAgentMessageKind as BindingBigFishAgentMessageKind,
BigFishAgentMessageRole as BindingBigFishAgentMessageRole, BigFishAgentMessageRole as BindingBigFishAgentMessageRole,
BigFishAgentMessageSnapshot as BindingBigFishAgentMessageSnapshot, BigFishAgentMessageSnapshot as BindingBigFishAgentMessageSnapshot,
BigFishAnchorItem as BindingBigFishAnchorItem, BigFishAnchorItem as BindingBigFishAnchorItem, BigFishAnchorPack as BindingBigFishAnchorPack,
BigFishAnchorPack as BindingBigFishAnchorPack,
BigFishAnchorStatus as BindingBigFishAnchorStatus, BigFishAnchorStatus as BindingBigFishAnchorStatus,
BigFishAssetCoverage as BindingBigFishAssetCoverage, BigFishAssetCoverage as BindingBigFishAssetCoverage,
BigFishAssetGenerateInput as BindingBigFishAssetGenerateInput, BigFishAssetGenerateInput as BindingBigFishAssetGenerateInput,
@@ -152,12 +150,11 @@ use crate::module_bindings::{
BigFishSessionGetInput as BindingBigFishSessionGetInput, BigFishSessionGetInput as BindingBigFishSessionGetInput,
BigFishSessionProcedureResult as BindingBigFishSessionProcedureResult, BigFishSessionProcedureResult as BindingBigFishSessionProcedureResult,
BigFishSessionSnapshot as BindingBigFishSessionSnapshot, BigFishSessionSnapshot as BindingBigFishSessionSnapshot,
BigFishVector2 as BindingBigFishVector2, BigFishVector2 as BindingBigFishVector2, CombatOutcome as BindingCombatOutcome,
CombatOutcome as BindingCombatOutcome,
CustomWorldAgentMessageSnapshot as BindingCustomWorldAgentMessageSnapshot,
CustomWorldAgentActionExecuteInput as BindingCustomWorldAgentActionExecuteInput, CustomWorldAgentActionExecuteInput as BindingCustomWorldAgentActionExecuteInput,
CustomWorldAgentActionExecuteResult as BindingCustomWorldAgentActionExecuteResult, CustomWorldAgentActionExecuteResult as BindingCustomWorldAgentActionExecuteResult,
CustomWorldAgentCardDetailGetInput as BindingCustomWorldAgentCardDetailGetInput, CustomWorldAgentCardDetailGetInput as BindingCustomWorldAgentCardDetailGetInput,
CustomWorldAgentMessageSnapshot as BindingCustomWorldAgentMessageSnapshot,
CustomWorldAgentMessageSubmitInput as BindingCustomWorldAgentMessageSubmitInput, CustomWorldAgentMessageSubmitInput as BindingCustomWorldAgentMessageSubmitInput,
CustomWorldAgentOperationGetInput as BindingCustomWorldAgentOperationGetInput, CustomWorldAgentOperationGetInput as BindingCustomWorldAgentOperationGetInput,
CustomWorldAgentOperationProcedureResult as BindingCustomWorldAgentOperationProcedureResult, CustomWorldAgentOperationProcedureResult as BindingCustomWorldAgentOperationProcedureResult,
@@ -175,6 +172,7 @@ use crate::module_bindings::{
CustomWorldGalleryListResult as BindingCustomWorldGalleryListResult, CustomWorldGalleryListResult as BindingCustomWorldGalleryListResult,
CustomWorldLibraryDetailInput as BindingCustomWorldLibraryDetailInput, CustomWorldLibraryDetailInput as BindingCustomWorldLibraryDetailInput,
CustomWorldLibraryMutationResult as BindingCustomWorldLibraryMutationResult, CustomWorldLibraryMutationResult as BindingCustomWorldLibraryMutationResult,
CustomWorldProfileDeleteInput as BindingCustomWorldProfileDeleteInput,
CustomWorldProfileListInput as BindingCustomWorldProfileListInput, CustomWorldProfileListInput as BindingCustomWorldProfileListInput,
CustomWorldProfileListResult as BindingCustomWorldProfileListResult, CustomWorldProfileListResult as BindingCustomWorldProfileListResult,
CustomWorldProfilePublishInput as BindingCustomWorldProfilePublishInput, CustomWorldProfilePublishInput as BindingCustomWorldProfilePublishInput,
@@ -185,10 +183,10 @@ use crate::module_bindings::{
CustomWorldPublishWorldInput as BindingCustomWorldPublishWorldInput, CustomWorldPublishWorldInput as BindingCustomWorldPublishWorldInput,
CustomWorldPublishWorldResult as BindingCustomWorldPublishWorldResult, CustomWorldPublishWorldResult as BindingCustomWorldPublishWorldResult,
CustomWorldPublishedProfileCompileSnapshot as BindingCustomWorldPublishedProfileCompileSnapshot, CustomWorldPublishedProfileCompileSnapshot as BindingCustomWorldPublishedProfileCompileSnapshot,
CustomWorldThemeMode as BindingCustomWorldThemeMode,
CustomWorldWorkSummarySnapshot as BindingCustomWorldWorkSummarySnapshot, CustomWorldWorkSummarySnapshot as BindingCustomWorldWorkSummarySnapshot,
CustomWorldWorksListInput as BindingCustomWorldWorksListInput, CustomWorldWorksListInput as BindingCustomWorldWorksListInput,
CustomWorldWorksListResult as BindingCustomWorldWorksListResult, CustomWorldWorksListResult as BindingCustomWorldWorksListResult, DbConnection,
CustomWorldThemeMode as BindingCustomWorldThemeMode, DbConnection,
InventoryContainerKind as BindingInventoryContainerKind, InventoryContainerKind as BindingInventoryContainerKind,
InventoryEquipmentSlot as BindingInventoryEquipmentSlot, InventoryEquipmentSlot as BindingInventoryEquipmentSlot,
InventoryItemRarity as BindingInventoryItemRarity, InventoryItemRarity as BindingInventoryItemRarity,
@@ -201,6 +199,24 @@ use crate::module_bindings::{
NpcInteractionStatus as BindingNpcInteractionStatus, NpcInteractionStatus as BindingNpcInteractionStatus,
NpcRelationStance as BindingNpcRelationStance, NpcRelationState as BindingNpcRelationState, NpcRelationStance as BindingNpcRelationStance, NpcRelationState as BindingNpcRelationState,
NpcStanceProfile as BindingNpcStanceProfile, NpcStateSnapshot as BindingNpcStateSnapshot, NpcStanceProfile as BindingNpcStanceProfile, NpcStateSnapshot as BindingNpcStateSnapshot,
PuzzleAgentMessageSubmitInput as BindingPuzzleAgentMessageSubmitInput,
PuzzleAgentSessionCreateInput as BindingPuzzleAgentSessionCreateInput,
PuzzleAgentSessionGetInput as BindingPuzzleAgentSessionGetInput,
PuzzleAgentSessionProcedureResult as BindingPuzzleAgentSessionProcedureResult,
PuzzleDraftCompileInput as BindingPuzzleDraftCompileInput,
PuzzleGeneratedImagesSaveInput as BindingPuzzleGeneratedImagesSaveInput,
PuzzlePublishInput as BindingPuzzlePublishInput,
PuzzleRunDragInput as BindingPuzzleRunDragInput, PuzzleRunGetInput as BindingPuzzleRunGetInput,
PuzzleRunNextLevelInput as BindingPuzzleRunNextLevelInput,
PuzzleRunProcedureResult as BindingPuzzleRunProcedureResult,
PuzzleRunStartInput as BindingPuzzleRunStartInput,
PuzzleRunSwapInput as BindingPuzzleRunSwapInput,
PuzzleSelectCoverImageInput as BindingPuzzleSelectCoverImageInput,
PuzzleWorkGetInput as BindingPuzzleWorkGetInput,
PuzzleWorkProcedureResult as BindingPuzzleWorkProcedureResult,
PuzzleWorkUpsertInput as BindingPuzzleWorkUpsertInput,
PuzzleWorksListInput as BindingPuzzleWorksListInput,
PuzzleWorksProcedureResult as BindingPuzzleWorksProcedureResult,
ResolveCombatActionInput as BindingResolveCombatActionInput, ResolveCombatActionInput as BindingResolveCombatActionInput,
ResolveCombatActionProcedureResult as BindingResolveCombatActionProcedureResult, ResolveCombatActionProcedureResult as BindingResolveCombatActionProcedureResult,
ResolveCombatActionResult as BindingResolveCombatActionResult, ResolveCombatActionResult as BindingResolveCombatActionResult,
@@ -223,14 +239,14 @@ use crate::module_bindings::{
RuntimeProfileDashboardGetInput as BindingRuntimeProfileDashboardGetInput, RuntimeProfileDashboardGetInput as BindingRuntimeProfileDashboardGetInput,
RuntimeProfileDashboardProcedureResult as BindingRuntimeProfileDashboardProcedureResult, RuntimeProfileDashboardProcedureResult as BindingRuntimeProfileDashboardProcedureResult,
RuntimeProfileDashboardSnapshot as BindingRuntimeProfileDashboardSnapshot, RuntimeProfileDashboardSnapshot as BindingRuntimeProfileDashboardSnapshot,
RuntimeProfileSaveArchiveListInput as BindingRuntimeProfileSaveArchiveListInput,
RuntimeProfileSaveArchiveProcedureResult as BindingRuntimeProfileSaveArchiveProcedureResult,
RuntimeProfileSaveArchiveResumeInput as BindingRuntimeProfileSaveArchiveResumeInput,
RuntimeProfileSaveArchiveSnapshot as BindingRuntimeProfileSaveArchiveSnapshot,
RuntimeProfilePlayStatsGetInput as BindingRuntimeProfilePlayStatsGetInput, RuntimeProfilePlayStatsGetInput as BindingRuntimeProfilePlayStatsGetInput,
RuntimeProfilePlayStatsProcedureResult as BindingRuntimeProfilePlayStatsProcedureResult, RuntimeProfilePlayStatsProcedureResult as BindingRuntimeProfilePlayStatsProcedureResult,
RuntimeProfilePlayStatsSnapshot as BindingRuntimeProfilePlayStatsSnapshot, RuntimeProfilePlayStatsSnapshot as BindingRuntimeProfilePlayStatsSnapshot,
RuntimeProfilePlayedWorldSnapshot as BindingRuntimeProfilePlayedWorldSnapshot, RuntimeProfilePlayedWorldSnapshot as BindingRuntimeProfilePlayedWorldSnapshot,
RuntimeProfileSaveArchiveListInput as BindingRuntimeProfileSaveArchiveListInput,
RuntimeProfileSaveArchiveProcedureResult as BindingRuntimeProfileSaveArchiveProcedureResult,
RuntimeProfileSaveArchiveResumeInput as BindingRuntimeProfileSaveArchiveResumeInput,
RuntimeProfileSaveArchiveSnapshot as BindingRuntimeProfileSaveArchiveSnapshot,
RuntimeProfileWalletLedgerEntrySnapshot as BindingRuntimeProfileWalletLedgerEntrySnapshot, RuntimeProfileWalletLedgerEntrySnapshot as BindingRuntimeProfileWalletLedgerEntrySnapshot,
RuntimeProfileWalletLedgerListInput as BindingRuntimeProfileWalletLedgerListInput, RuntimeProfileWalletLedgerListInput as BindingRuntimeProfileWalletLedgerListInput,
RuntimeProfileWalletLedgerProcedureResult as BindingRuntimeProfileWalletLedgerProcedureResult, RuntimeProfileWalletLedgerProcedureResult as BindingRuntimeProfileWalletLedgerProcedureResult,
@@ -239,29 +255,10 @@ use crate::module_bindings::{
RuntimeSettingProcedureResult as BindingRuntimeSettingProcedureResult, RuntimeSettingProcedureResult as BindingRuntimeSettingProcedureResult,
RuntimeSettingSnapshot as BindingRuntimeSettingSnapshot, RuntimeSettingSnapshot as BindingRuntimeSettingSnapshot,
RuntimeSettingUpsertInput as BindingRuntimeSettingUpsertInput, RuntimeSettingUpsertInput as BindingRuntimeSettingUpsertInput,
RuntimeSnapshot as BindingRuntimeSnapshot,
RuntimeSnapshotDeleteInput as BindingRuntimeSnapshotDeleteInput, RuntimeSnapshotDeleteInput as BindingRuntimeSnapshotDeleteInput,
RuntimeSnapshotGetInput as BindingRuntimeSnapshotGetInput, RuntimeSnapshotGetInput as BindingRuntimeSnapshotGetInput,
RuntimeSnapshotProcedureResult as BindingRuntimeSnapshotProcedureResult, RuntimeSnapshotProcedureResult as BindingRuntimeSnapshotProcedureResult,
PuzzleAgentMessageSubmitInput as BindingPuzzleAgentMessageSubmitInput,
PuzzleAgentSessionCreateInput as BindingPuzzleAgentSessionCreateInput,
PuzzleAgentSessionGetInput as BindingPuzzleAgentSessionGetInput,
PuzzleAgentSessionProcedureResult as BindingPuzzleAgentSessionProcedureResult,
PuzzleDraftCompileInput as BindingPuzzleDraftCompileInput,
PuzzleGeneratedImagesSaveInput as BindingPuzzleGeneratedImagesSaveInput,
PuzzlePublishInput as BindingPuzzlePublishInput,
PuzzleRunDragInput as BindingPuzzleRunDragInput,
PuzzleRunGetInput as BindingPuzzleRunGetInput,
PuzzleRunNextLevelInput as BindingPuzzleRunNextLevelInput,
PuzzleRunProcedureResult as BindingPuzzleRunProcedureResult,
PuzzleRunStartInput as BindingPuzzleRunStartInput,
PuzzleRunSwapInput as BindingPuzzleRunSwapInput,
PuzzleSelectCoverImageInput as BindingPuzzleSelectCoverImageInput,
PuzzleWorkGetInput as BindingPuzzleWorkGetInput,
PuzzleWorkProcedureResult as BindingPuzzleWorkProcedureResult,
PuzzleWorkUpsertInput as BindingPuzzleWorkUpsertInput,
PuzzleWorksListInput as BindingPuzzleWorksListInput,
PuzzleWorksProcedureResult as BindingPuzzleWorksProcedureResult,
RuntimeSnapshot as BindingRuntimeSnapshot,
RuntimeSnapshotUpsertInput as BindingRuntimeSnapshotUpsertInput, RuntimeSnapshotUpsertInput as BindingRuntimeSnapshotUpsertInput,
StoryContinueInput as BindingStoryContinueInput, StoryEventKind as BindingStoryEventKind, StoryContinueInput as BindingStoryContinueInput, StoryEventKind as BindingStoryEventKind,
StoryEventSnapshot as BindingStoryEventSnapshot, StorySessionInput as BindingStorySessionInput, StoryEventSnapshot as BindingStoryEventSnapshot, StorySessionInput as BindingStorySessionInput,
@@ -270,8 +267,8 @@ use crate::module_bindings::{
StorySessionStateInput as BindingStorySessionStateInput, StorySessionStateInput as BindingStorySessionStateInput,
StorySessionStateProcedureResult as BindingStorySessionStateProcedureResult, StorySessionStateProcedureResult as BindingStorySessionStateProcedureResult,
StorySessionStatus as BindingStorySessionStatus, StorySessionStatus as BindingStorySessionStatus,
append_ai_text_chunk_and_return_procedure::append_ai_text_chunk_and_return as _,
advance_puzzle_next_level_procedure::advance_puzzle_next_level as _, advance_puzzle_next_level_procedure::advance_puzzle_next_level as _,
append_ai_text_chunk_and_return_procedure::append_ai_text_chunk_and_return as _,
attach_ai_result_reference_and_return_procedure::attach_ai_result_reference_and_return as _, attach_ai_result_reference_and_return_procedure::attach_ai_result_reference_and_return as _,
begin_story_session_and_return_procedure::begin_story_session_and_return as _, begin_story_session_and_return_procedure::begin_story_session_and_return as _,
bind_asset_object_to_entity_and_return_procedure::bind_asset_object_to_entity_and_return as _, bind_asset_object_to_entity_and_return_procedure::bind_asset_object_to_entity_and_return as _,
@@ -288,6 +285,7 @@ use crate::module_bindings::{
create_big_fish_session_procedure::create_big_fish_session as _, create_big_fish_session_procedure::create_big_fish_session as _,
create_custom_world_agent_session_procedure::create_custom_world_agent_session as _, create_custom_world_agent_session_procedure::create_custom_world_agent_session as _,
create_puzzle_agent_session_procedure::create_puzzle_agent_session as _, create_puzzle_agent_session_procedure::create_puzzle_agent_session as _,
delete_custom_world_profile_and_return_procedure::delete_custom_world_profile_and_return as _,
delete_runtime_snapshot_and_return_procedure::delete_runtime_snapshot_and_return as _, delete_runtime_snapshot_and_return_procedure::delete_runtime_snapshot_and_return as _,
drag_puzzle_piece_or_group_procedure::drag_puzzle_piece_or_group as _, drag_puzzle_piece_or_group_procedure::drag_puzzle_piece_or_group as _,
execute_custom_world_agent_action_procedure::execute_custom_world_agent_action as _, execute_custom_world_agent_action_procedure::execute_custom_world_agent_action as _,
@@ -328,10 +326,10 @@ use crate::module_bindings::{
resume_profile_save_archive_and_return_procedure::resume_profile_save_archive_and_return as _, resume_profile_save_archive_and_return_procedure::resume_profile_save_archive_and_return as _,
save_puzzle_generated_images_procedure::save_puzzle_generated_images as _, save_puzzle_generated_images_procedure::save_puzzle_generated_images as _,
select_puzzle_cover_image_procedure::select_puzzle_cover_image as _, select_puzzle_cover_image_procedure::select_puzzle_cover_image as _,
start_big_fish_run_procedure::start_big_fish_run as _,
start_puzzle_run_procedure::start_puzzle_run as _,
start_ai_task_reducer::start_ai_task as _, start_ai_task_reducer::start_ai_task as _,
start_ai_task_stage_reducer::start_ai_task_stage as _, start_ai_task_stage_reducer::start_ai_task_stage as _,
start_big_fish_run_procedure::start_big_fish_run as _,
start_puzzle_run_procedure::start_puzzle_run as _,
submit_big_fish_input_procedure::submit_big_fish_input as _, submit_big_fish_input_procedure::submit_big_fish_input as _,
submit_big_fish_message_procedure::submit_big_fish_message as _, submit_big_fish_message_procedure::submit_big_fish_message as _,
submit_custom_world_agent_message_procedure::submit_custom_world_agent_message as _, submit_custom_world_agent_message_procedure::submit_custom_world_agent_message as _,
@@ -749,6 +747,31 @@ impl SpacetimeClient {
.await .await
} }
pub async fn delete_custom_world_profile(
&self,
profile_id: String,
owner_user_id: String,
deleted_at_micros: i64,
) -> Result<Vec<CustomWorldLibraryEntryRecord>, SpacetimeClientError> {
let procedure_input = BindingCustomWorldProfileDeleteInput {
profile_id,
owner_user_id,
deleted_at_micros,
};
self.call_after_connect(move |connection, sender| {
connection
.procedures()
.delete_custom_world_profile_and_return_then(procedure_input, move |_, result| {
let mapped = result
.map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
.and_then(map_custom_world_profile_list_result);
send_once(&sender, mapped);
});
})
.await
}
pub async fn list_custom_world_gallery_entries( pub async fn list_custom_world_gallery_entries(
&self, &self,
) -> Result<Vec<CustomWorldGalleryEntryRecord>, SpacetimeClientError> { ) -> Result<Vec<CustomWorldGalleryEntryRecord>, SpacetimeClientError> {
@@ -877,14 +900,15 @@ impl SpacetimeClient {
let procedure_input = BindingCustomWorldWorksListInput { owner_user_id }; let procedure_input = BindingCustomWorldWorksListInput { owner_user_id };
self.call_after_connect(move |connection, sender| { self.call_after_connect(move |connection, sender| {
connection connection.procedures().list_custom_world_works_then(
.procedures() procedure_input,
.list_custom_world_works_then(procedure_input, move |_, result| { move |_, result| {
let mapped = result let mapped = result
.map_err(|error| SpacetimeClientError::Procedure(error.to_string())) .map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
.and_then(map_custom_world_works_list_result); .and_then(map_custom_world_works_list_result);
send_once(&sender, mapped); send_once(&sender, mapped);
}); },
);
}) })
.await .await
} }
@@ -954,14 +978,15 @@ impl SpacetimeClient {
}; };
self.call_after_connect(move |connection, sender| { self.call_after_connect(move |connection, sender| {
connection connection.procedures().create_puzzle_agent_session_then(
.procedures() procedure_input,
.create_puzzle_agent_session_then(procedure_input, move |_, result| { move |_, result| {
let mapped = result let mapped = result
.map_err(|error| SpacetimeClientError::Procedure(error.to_string())) .map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
.and_then(map_puzzle_agent_session_procedure_result); .and_then(map_puzzle_agent_session_procedure_result);
send_once(&sender, mapped); send_once(&sender, mapped);
}); },
);
}) })
.await .await
} }
@@ -1109,15 +1134,14 @@ impl SpacetimeClient {
}; };
self.call_after_connect(move |connection, sender| { self.call_after_connect(move |connection, sender| {
connection.procedures().publish_puzzle_work_then( connection
procedure_input, .procedures()
move |_, result| { .publish_puzzle_work_then(procedure_input, move |_, result| {
let mapped = result let mapped = result
.map_err(|error| SpacetimeClientError::Procedure(error.to_string())) .map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
.and_then(map_puzzle_work_procedure_result); .and_then(map_puzzle_work_procedure_result);
send_once(&sender, mapped); send_once(&sender, mapped);
}, });
);
}) })
.await .await
} }
@@ -1129,15 +1153,14 @@ impl SpacetimeClient {
let procedure_input = BindingPuzzleWorksListInput { owner_user_id }; let procedure_input = BindingPuzzleWorksListInput { owner_user_id };
self.call_after_connect(move |connection, sender| { self.call_after_connect(move |connection, sender| {
connection.procedures().list_puzzle_works_then( connection
procedure_input, .procedures()
move |_, result| { .list_puzzle_works_then(procedure_input, move |_, result| {
let mapped = result let mapped = result
.map_err(|error| SpacetimeClientError::Procedure(error.to_string())) .map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
.and_then(map_puzzle_works_procedure_result); .and_then(map_puzzle_works_procedure_result);
send_once(&sender, mapped); send_once(&sender, mapped);
}, });
);
}) })
.await .await
} }
@@ -1178,15 +1201,14 @@ impl SpacetimeClient {
}; };
self.call_after_connect(move |connection, sender| { self.call_after_connect(move |connection, sender| {
connection.procedures().update_puzzle_work_then( connection
procedure_input, .procedures()
move |_, result| { .update_puzzle_work_then(procedure_input, move |_, result| {
let mapped = result let mapped = result
.map_err(|error| SpacetimeClientError::Procedure(error.to_string())) .map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
.and_then(map_puzzle_work_procedure_result); .and_then(map_puzzle_work_procedure_result);
send_once(&sender, mapped); send_once(&sender, mapped);
}, });
);
}) })
.await .await
} }
@@ -1195,12 +1217,14 @@ impl SpacetimeClient {
&self, &self,
) -> Result<Vec<PuzzleWorkProfileRecord>, SpacetimeClientError> { ) -> Result<Vec<PuzzleWorkProfileRecord>, SpacetimeClientError> {
self.call_after_connect(move |connection, sender| { self.call_after_connect(move |connection, sender| {
connection.procedures().list_puzzle_gallery_then(move |_, result| { connection
let mapped = result .procedures()
.map_err(|error| SpacetimeClientError::Procedure(error.to_string())) .list_puzzle_gallery_then(move |_, result| {
.and_then(map_puzzle_works_procedure_result); let mapped = result
send_once(&sender, mapped); .map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
}); .and_then(map_puzzle_works_procedure_result);
send_once(&sender, mapped);
});
}) })
.await .await
} }
@@ -1237,15 +1261,14 @@ impl SpacetimeClient {
}; };
self.call_after_connect(move |connection, sender| { self.call_after_connect(move |connection, sender| {
connection.procedures().start_puzzle_run_then( connection
procedure_input, .procedures()
move |_, result| { .start_puzzle_run_then(procedure_input, move |_, result| {
let mapped = result let mapped = result
.map_err(|error| SpacetimeClientError::Procedure(error.to_string())) .map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
.and_then(map_puzzle_run_procedure_result); .and_then(map_puzzle_run_procedure_result);
send_once(&sender, mapped); send_once(&sender, mapped);
}, });
);
}) })
.await .await
} }
@@ -1261,15 +1284,14 @@ impl SpacetimeClient {
}; };
self.call_after_connect(move |connection, sender| { self.call_after_connect(move |connection, sender| {
connection.procedures().get_puzzle_run_then( connection
procedure_input, .procedures()
move |_, result| { .get_puzzle_run_then(procedure_input, move |_, result| {
let mapped = result let mapped = result
.map_err(|error| SpacetimeClientError::Procedure(error.to_string())) .map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
.and_then(map_puzzle_run_procedure_result); .and_then(map_puzzle_run_procedure_result);
send_once(&sender, mapped); send_once(&sender, mapped);
}, });
);
}) })
.await .await
} }
@@ -1287,15 +1309,14 @@ impl SpacetimeClient {
}; };
self.call_after_connect(move |connection, sender| { self.call_after_connect(move |connection, sender| {
connection.procedures().swap_puzzle_pieces_then( connection
procedure_input, .procedures()
move |_, result| { .swap_puzzle_pieces_then(procedure_input, move |_, result| {
let mapped = result let mapped = result
.map_err(|error| SpacetimeClientError::Procedure(error.to_string())) .map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
.and_then(map_puzzle_run_procedure_result); .and_then(map_puzzle_run_procedure_result);
send_once(&sender, mapped); send_once(&sender, mapped);
}, });
);
}) })
.await .await
} }
@@ -1365,14 +1386,15 @@ impl SpacetimeClient {
}; };
self.call_after_connect(move |connection, sender| { self.call_after_connect(move |connection, sender| {
connection connection.procedures().create_big_fish_session_then(
.procedures() procedure_input,
.create_big_fish_session_then(procedure_input, move |_, result| { move |_, result| {
let mapped = result let mapped = result
.map_err(|error| SpacetimeClientError::Procedure(error.to_string())) .map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
.and_then(map_big_fish_session_procedure_result); .and_then(map_big_fish_session_procedure_result);
send_once(&sender, mapped); send_once(&sender, mapped);
}); },
);
}) })
.await .await
} }
@@ -1388,15 +1410,14 @@ impl SpacetimeClient {
}; };
self.call_after_connect(move |connection, sender| { self.call_after_connect(move |connection, sender| {
connection.procedures().get_big_fish_session_then( connection
procedure_input, .procedures()
move |_, result| { .get_big_fish_session_then(procedure_input, move |_, result| {
let mapped = result let mapped = result
.map_err(|error| SpacetimeClientError::Procedure(error.to_string())) .map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
.and_then(map_big_fish_session_procedure_result); .and_then(map_big_fish_session_procedure_result);
send_once(&sender, mapped); send_once(&sender, mapped);
}, });
);
}) })
.await .await
} }
@@ -1519,15 +1540,14 @@ impl SpacetimeClient {
}; };
self.call_after_connect(move |connection, sender| { self.call_after_connect(move |connection, sender| {
connection.procedures().start_big_fish_run_then( connection
procedure_input, .procedures()
move |_, result| { .start_big_fish_run_then(procedure_input, move |_, result| {
let mapped = result let mapped = result
.map_err(|error| SpacetimeClientError::Procedure(error.to_string())) .map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
.and_then(map_big_fish_run_procedure_result); .and_then(map_big_fish_run_procedure_result);
send_once(&sender, mapped); send_once(&sender, mapped);
}, });
);
}) })
.await .await
} }
@@ -1734,15 +1754,14 @@ impl SpacetimeClient {
); );
self.call_after_connect(move |connection, sender| { self.call_after_connect(move |connection, sender| {
connection.procedures().get_runtime_snapshot_then( connection
procedure_input, .procedures()
move |_, result| { .get_runtime_snapshot_then(procedure_input, move |_, result| {
let mapped = result let mapped = result
.map_err(|error| SpacetimeClientError::Procedure(error.to_string())) .map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
.and_then(map_runtime_snapshot_procedure_result); .and_then(map_runtime_snapshot_procedure_result);
send_once(&sender, mapped); send_once(&sender, mapped);
}, });
);
}) })
.await .await
} }
@@ -1769,15 +1788,14 @@ impl SpacetimeClient {
); );
self.call_after_connect(move |connection, sender| { self.call_after_connect(move |connection, sender| {
connection.procedures().upsert_runtime_snapshot_and_return_then( connection
procedure_input, .procedures()
move |_, result| { .upsert_runtime_snapshot_and_return_then(procedure_input, move |_, result| {
let mapped = result let mapped = result
.map_err(|error| SpacetimeClientError::Procedure(error.to_string())) .map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
.and_then(map_runtime_snapshot_required_procedure_result); .and_then(map_runtime_snapshot_required_procedure_result);
send_once(&sender, mapped); send_once(&sender, mapped);
}, });
);
}) })
.await .await
} }
@@ -1792,15 +1810,14 @@ impl SpacetimeClient {
); );
self.call_after_connect(move |connection, sender| { self.call_after_connect(move |connection, sender| {
connection.procedures().delete_runtime_snapshot_and_return_then( connection
procedure_input, .procedures()
move |_, result| { .delete_runtime_snapshot_and_return_then(procedure_input, move |_, result| {
let mapped = result let mapped = result
.map_err(|error| SpacetimeClientError::Procedure(error.to_string())) .map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
.and_then(map_runtime_snapshot_delete_procedure_result); .and_then(map_runtime_snapshot_delete_procedure_result);
send_once(&sender, mapped); send_once(&sender, mapped);
}, });
);
}) })
.await .await
} }
@@ -1832,7 +1849,8 @@ impl SpacetimeClient {
&self, &self,
user_id: String, user_id: String,
world_key: String, world_key: String,
) -> Result<(RuntimeProfileSaveArchiveRecord, RuntimeSnapshotRecord), SpacetimeClientError> { ) -> Result<(RuntimeProfileSaveArchiveRecord, RuntimeSnapshotRecord), SpacetimeClientError>
{
let procedure_input = map_runtime_profile_save_archive_resume_input( let procedure_input = map_runtime_profile_save_archive_resume_input(
build_runtime_profile_save_archive_resume_input(user_id, world_key) build_runtime_profile_save_archive_resume_input(user_id, world_key)
.map_err(|error| SpacetimeClientError::Runtime(error.to_string()))?, .map_err(|error| SpacetimeClientError::Runtime(error.to_string()))?,
@@ -1841,15 +1859,12 @@ impl SpacetimeClient {
self.call_after_connect(move |connection, sender| { self.call_after_connect(move |connection, sender| {
connection connection
.procedures() .procedures()
.resume_profile_save_archive_and_return_then( .resume_profile_save_archive_and_return_then(procedure_input, move |_, result| {
procedure_input, let mapped = result
move |_, result| { .map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
let mapped = result .and_then(map_runtime_profile_save_archive_resume_procedure_result);
.map_err(|error| SpacetimeClientError::Procedure(error.to_string())) send_once(&sender, mapped);
.and_then(map_runtime_profile_save_archive_resume_procedure_result); });
send_once(&sender, mapped);
},
);
}) })
.await .await
} }
@@ -2822,7 +2837,9 @@ fn map_runtime_snapshot_required_procedure_result(
result: BindingRuntimeSnapshotProcedureResult, result: BindingRuntimeSnapshotProcedureResult,
) -> Result<RuntimeSnapshotRecord, SpacetimeClientError> { ) -> Result<RuntimeSnapshotRecord, SpacetimeClientError> {
map_runtime_snapshot_procedure_result(result)?.ok_or_else(|| { map_runtime_snapshot_procedure_result(result)?.ok_or_else(|| {
SpacetimeClientError::Procedure("SpacetimeDB procedure 未返回 runtime snapshot 快照".to_string()) SpacetimeClientError::Procedure(
"SpacetimeDB procedure 未返回 runtime snapshot 快照".to_string(),
)
}) })
} }
@@ -2847,9 +2864,9 @@ fn map_runtime_profile_save_archive_list_procedure_result(
.entries .entries
.into_iter() .into_iter()
.map(|snapshot| { .map(|snapshot| {
build_runtime_profile_save_archive_record( build_runtime_profile_save_archive_record(map_runtime_profile_save_archive_snapshot(
map_runtime_profile_save_archive_snapshot(snapshot), snapshot,
) ))
.map_err(|error| SpacetimeClientError::Runtime(error.to_string())) .map_err(|error| SpacetimeClientError::Runtime(error.to_string()))
}) })
.collect() .collect()
@@ -2867,15 +2884,21 @@ fn map_runtime_profile_save_archive_resume_procedure_result(
} }
let archive = result.record.ok_or_else(|| { let archive = result.record.ok_or_else(|| {
SpacetimeClientError::Procedure("SpacetimeDB procedure 未返回 save archive 快照".to_string()) SpacetimeClientError::Procedure(
"SpacetimeDB procedure 未返回 save archive 快照".to_string(),
)
})?; })?;
let snapshot = result.current_snapshot.ok_or_else(|| { let snapshot = result.current_snapshot.ok_or_else(|| {
SpacetimeClientError::Procedure("SpacetimeDB procedure 未返回恢复后的 runtime snapshot".to_string()) SpacetimeClientError::Procedure(
"SpacetimeDB procedure 未返回恢复后的 runtime snapshot".to_string(),
)
})?; })?;
Ok(( Ok((
build_runtime_profile_save_archive_record(map_runtime_profile_save_archive_snapshot(archive)) build_runtime_profile_save_archive_record(map_runtime_profile_save_archive_snapshot(
.map_err(|error| SpacetimeClientError::Runtime(error.to_string()))?, archive,
))
.map_err(|error| SpacetimeClientError::Runtime(error.to_string()))?,
build_runtime_snapshot_record(map_runtime_snapshot_snapshot(snapshot)) build_runtime_snapshot_record(map_runtime_snapshot_snapshot(snapshot))
.map_err(|error| SpacetimeClientError::Runtime(error.to_string()))?, .map_err(|error| SpacetimeClientError::Runtime(error.to_string()))?,
)) ))
@@ -3154,9 +3177,7 @@ fn map_puzzle_agent_session_procedure_result(
})?; })?;
let session: DomainPuzzleAgentSessionSnapshot = let session: DomainPuzzleAgentSessionSnapshot =
serde_json::from_str(&session_json).map_err(|error| { serde_json::from_str(&session_json).map_err(|error| {
SpacetimeClientError::Runtime(format!( SpacetimeClientError::Runtime(format!("puzzle agent session_json 非法: {error}"))
"puzzle agent session_json 非法: {error}"
))
})?; })?;
Ok(map_puzzle_agent_session_snapshot(session)) Ok(map_puzzle_agent_session_snapshot(session))
} }
@@ -3173,9 +3194,7 @@ fn map_puzzle_work_procedure_result(
} }
let item_json = result.item_json.ok_or_else(|| { let item_json = result.item_json.ok_or_else(|| {
SpacetimeClientError::Procedure( SpacetimeClientError::Procedure("SpacetimeDB procedure 未返回 puzzle work 快照".to_string())
"SpacetimeDB procedure 未返回 puzzle work 快照".to_string(),
)
})?; })?;
let item: DomainPuzzleWorkProfile = serde_json::from_str(&item_json).map_err(|error| { let item: DomainPuzzleWorkProfile = serde_json::from_str(&item_json).map_err(|error| {
SpacetimeClientError::Runtime(format!("puzzle work item_json 非法: {error}")) SpacetimeClientError::Runtime(format!("puzzle work item_json 非法: {error}"))
@@ -3218,9 +3237,7 @@ fn map_puzzle_run_procedure_result(
} }
let run_json = result.run_json.ok_or_else(|| { let run_json = result.run_json.ok_or_else(|| {
SpacetimeClientError::Procedure( SpacetimeClientError::Procedure("SpacetimeDB procedure 未返回 puzzle run 快照".to_string())
"SpacetimeDB procedure 未返回 puzzle run 快照".to_string(),
)
})?; })?;
let run: DomainPuzzleRunSnapshot = serde_json::from_str(&run_json).map_err(|error| { let run: DomainPuzzleRunSnapshot = serde_json::from_str(&run_json).map_err(|error| {
SpacetimeClientError::Runtime(format!("puzzle run run_json 非法: {error}")) SpacetimeClientError::Runtime(format!("puzzle run run_json 非法: {error}"))
@@ -4103,7 +4120,9 @@ fn map_puzzle_run_snapshot(snapshot: DomainPuzzleRunSnapshot) -> PuzzleRunRecord
current_grid_size: snapshot.current_grid_size, current_grid_size: snapshot.current_grid_size,
played_profile_ids: snapshot.played_profile_ids, played_profile_ids: snapshot.played_profile_ids,
previous_level_tags: snapshot.previous_level_tags, previous_level_tags: snapshot.previous_level_tags,
current_level: snapshot.current_level.map(map_puzzle_runtime_level_snapshot), current_level: snapshot
.current_level
.map(map_puzzle_runtime_level_snapshot),
recommended_next_profile_id: snapshot.recommended_next_profile_id, recommended_next_profile_id: snapshot.recommended_next_profile_id,
} }
} }
@@ -4243,7 +4262,9 @@ fn map_big_fish_background_blueprint(
} }
} }
fn map_big_fish_runtime_params(snapshot: BindingBigFishRuntimeParams) -> BigFishRuntimeParamsRecord { fn map_big_fish_runtime_params(
snapshot: BindingBigFishRuntimeParams,
) -> BigFishRuntimeParamsRecord {
BigFishRuntimeParamsRecord { BigFishRuntimeParamsRecord {
level_count: snapshot.level_count, level_count: snapshot.level_count,
merge_count_per_upgrade: snapshot.merge_count_per_upgrade, merge_count_per_upgrade: snapshot.merge_count_per_upgrade,
@@ -5283,17 +5304,13 @@ fn parse_custom_world_publish_gate_record(
.map(str::trim) .map(str::trim)
.filter(|value| !value.is_empty()) .filter(|value| !value.is_empty())
.ok_or_else(|| { .ok_or_else(|| {
SpacetimeClientError::Runtime( SpacetimeClientError::Runtime("custom world publish_gate.profileId 缺失".to_string())
"custom world publish_gate.profileId 缺失".to_string(),
)
})?; })?;
let blockers = object let blockers = object
.get("blockers") .get("blockers")
.and_then(serde_json::Value::as_array) .and_then(serde_json::Value::as_array)
.ok_or_else(|| { .ok_or_else(|| {
SpacetimeClientError::Runtime( SpacetimeClientError::Runtime("custom world publish_gate.blockers 缺失".to_string())
"custom world publish_gate.blockers 缺失".to_string(),
)
})? })?
.iter() .iter()
.cloned() .cloned()
@@ -5346,17 +5363,13 @@ fn parse_custom_world_publish_gate_record(
.and_then(serde_json::Value::as_u64) .and_then(serde_json::Value::as_u64)
.and_then(|value| u32::try_from(value).ok()) .and_then(|value| u32::try_from(value).ok())
.ok_or_else(|| { .ok_or_else(|| {
SpacetimeClientError::Runtime( SpacetimeClientError::Runtime("custom world publish_gate.blockerCount 缺失".to_string())
"custom world publish_gate.blockerCount 缺失".to_string(),
)
})?; })?;
let publish_ready = object let publish_ready = object
.get("publishReady") .get("publishReady")
.and_then(serde_json::Value::as_bool) .and_then(serde_json::Value::as_bool)
.ok_or_else(|| { .ok_or_else(|| {
SpacetimeClientError::Runtime( SpacetimeClientError::Runtime("custom world publish_gate.publishReady 缺失".to_string())
"custom world publish_gate.publishReady 缺失".to_string(),
)
})?; })?;
let can_enter_world = object let can_enter_world = object
.get("canEnterWorld") .get("canEnterWorld")

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
use super::quest_record_input_type::QuestRecordInput; use super::quest_record_input_type::QuestRecordInput;
@@ -19,10 +14,8 @@ pub(super) struct AcceptQuestArgs {
impl From<AcceptQuestArgs> for super::Reducer { impl From<AcceptQuestArgs> for super::Reducer {
fn from(args: AcceptQuestArgs) -> Self { fn from(args: AcceptQuestArgs) -> Self {
Self::AcceptQuest { Self::AcceptQuest { input: args.input }
input: args.input, }
}
}
} }
impl __sdk::InModule for AcceptQuestArgs { impl __sdk::InModule for AcceptQuestArgs {
@@ -40,9 +33,8 @@ pub trait accept_quest {
/// The reducer will run asynchronously in the future, /// The reducer will run asynchronously in the future,
/// and this method provides no way to listen for its completion status. /// and this method provides no way to listen for its completion status.
/// /// Use [`accept_quest:accept_quest_then`] to run a callback after the reducer completes. /// /// Use [`accept_quest:accept_quest_then`] to run a callback after the reducer completes.
fn accept_quest(&self, input: QuestRecordInput, fn accept_quest(&self, input: QuestRecordInput) -> __sdk::Result<()> {
) -> __sdk::Result<()> { self.accept_quest_then(input, |_, _| {})
self.accept_quest_then(input, |_, _| {})
} }
/// Request that the remote module invoke the reducer `accept_quest` to run as soon as possible, /// Request that the remote module invoke the reducer `accept_quest` to run as soon as possible,
@@ -55,9 +47,11 @@ pub trait accept_quest {
&self, &self,
input: QuestRecordInput, input: QuestRecordInput,
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>) callback: impl FnOnce(
+ Send &super::ReducerEventContext,
+ 'static, Result<Result<(), String>, __sdk::InternalError>,
) + Send
+ 'static,
) -> __sdk::Result<()>; ) -> __sdk::Result<()>;
} }
@@ -66,11 +60,13 @@ impl accept_quest for super::RemoteReducers {
&self, &self,
input: QuestRecordInput, input: QuestRecordInput,
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>) callback: impl FnOnce(
+ Send &super::ReducerEventContext,
+ 'static, Result<Result<(), String>, __sdk::InternalError>,
) + Send
+ 'static,
) -> __sdk::Result<()> { ) -> __sdk::Result<()> {
self.imp.invoke_reducer_with_callback(AcceptQuestArgs { input, }, callback) self.imp
.invoke_reducer_with_callback(AcceptQuestArgs { input }, callback)
} }
} }

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
use super::quest_completion_ack_input_type::QuestCompletionAckInput; use super::quest_completion_ack_input_type::QuestCompletionAckInput;
@@ -19,10 +14,8 @@ pub(super) struct AcknowledgeQuestCompletionArgs {
impl From<AcknowledgeQuestCompletionArgs> for super::Reducer { impl From<AcknowledgeQuestCompletionArgs> for super::Reducer {
fn from(args: AcknowledgeQuestCompletionArgs) -> Self { fn from(args: AcknowledgeQuestCompletionArgs) -> Self {
Self::AcknowledgeQuestCompletion { Self::AcknowledgeQuestCompletion { input: args.input }
input: args.input, }
}
}
} }
impl __sdk::InModule for AcknowledgeQuestCompletionArgs { impl __sdk::InModule for AcknowledgeQuestCompletionArgs {
@@ -40,9 +33,8 @@ pub trait acknowledge_quest_completion {
/// The reducer will run asynchronously in the future, /// The reducer will run asynchronously in the future,
/// and this method provides no way to listen for its completion status. /// and this method provides no way to listen for its completion status.
/// /// Use [`acknowledge_quest_completion:acknowledge_quest_completion_then`] to run a callback after the reducer completes. /// /// Use [`acknowledge_quest_completion:acknowledge_quest_completion_then`] to run a callback after the reducer completes.
fn acknowledge_quest_completion(&self, input: QuestCompletionAckInput, fn acknowledge_quest_completion(&self, input: QuestCompletionAckInput) -> __sdk::Result<()> {
) -> __sdk::Result<()> { self.acknowledge_quest_completion_then(input, |_, _| {})
self.acknowledge_quest_completion_then(input, |_, _| {})
} }
/// Request that the remote module invoke the reducer `acknowledge_quest_completion` to run as soon as possible, /// Request that the remote module invoke the reducer `acknowledge_quest_completion` to run as soon as possible,
@@ -55,9 +47,11 @@ pub trait acknowledge_quest_completion {
&self, &self,
input: QuestCompletionAckInput, input: QuestCompletionAckInput,
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>) callback: impl FnOnce(
+ Send &super::ReducerEventContext,
+ 'static, Result<Result<(), String>, __sdk::InternalError>,
) + Send
+ 'static,
) -> __sdk::Result<()>; ) -> __sdk::Result<()>;
} }
@@ -66,11 +60,13 @@ impl acknowledge_quest_completion for super::RemoteReducers {
&self, &self,
input: QuestCompletionAckInput, input: QuestCompletionAckInput,
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>) callback: impl FnOnce(
+ Send &super::ReducerEventContext,
+ 'static, Result<Result<(), String>, __sdk::InternalError>,
) + Send
+ 'static,
) -> __sdk::Result<()> { ) -> __sdk::Result<()> {
self.imp.invoke_reducer_with_callback(AcknowledgeQuestCompletionArgs { input, }, callback) self.imp
.invoke_reducer_with_callback(AcknowledgeQuestCompletionArgs { input }, callback)
} }
} }

View File

@@ -2,23 +2,17 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
use super::puzzle_run_next_level_input_type::PuzzleRunNextLevelInput; use super::puzzle_run_next_level_input_type::PuzzleRunNextLevelInput;
use super::puzzle_run_procedure_result_type::PuzzleRunProcedureResult; use super::puzzle_run_procedure_result_type::PuzzleRunProcedureResult;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)] #[sats(crate = __lib)]
struct AdvancePuzzleNextLevelArgs { struct AdvancePuzzleNextLevelArgs {
pub input: PuzzleRunNextLevelInput, pub input: PuzzleRunNextLevelInput,
} }
impl __sdk::InModule for AdvancePuzzleNextLevelArgs { impl __sdk::InModule for AdvancePuzzleNextLevelArgs {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }
@@ -28,16 +22,19 @@ impl __sdk::InModule for AdvancePuzzleNextLevelArgs {
/// ///
/// Implemented for [`super::RemoteProcedures`]. /// Implemented for [`super::RemoteProcedures`].
pub trait advance_puzzle_next_level { pub trait advance_puzzle_next_level {
fn advance_puzzle_next_level(&self, input: PuzzleRunNextLevelInput, fn advance_puzzle_next_level(&self, input: PuzzleRunNextLevelInput) {
) { self.advance_puzzle_next_level_then(input, |_, _| {});
self.advance_puzzle_next_level_then(input, |_, _| {});
} }
fn advance_puzzle_next_level_then( fn advance_puzzle_next_level_then(
&self, &self,
input: PuzzleRunNextLevelInput, input: PuzzleRunNextLevelInput,
__callback: impl FnOnce(&super::ProcedureEventContext, Result<PuzzleRunProcedureResult, __sdk::InternalError>) + Send + 'static, __callback: impl FnOnce(
&super::ProcedureEventContext,
Result<PuzzleRunProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
); );
} }
@@ -46,13 +43,17 @@ impl advance_puzzle_next_level for super::RemoteProcedures {
&self, &self,
input: PuzzleRunNextLevelInput, input: PuzzleRunNextLevelInput,
__callback: impl FnOnce(&super::ProcedureEventContext, Result<PuzzleRunProcedureResult, __sdk::InternalError>) + Send + 'static, __callback: impl FnOnce(
&super::ProcedureEventContext,
Result<PuzzleRunProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) { ) {
self.imp.invoke_procedure_with_callback::<_, PuzzleRunProcedureResult>( self.imp
"advance_puzzle_next_level", .invoke_procedure_with_callback::<_, PuzzleRunProcedureResult>(
AdvancePuzzleNextLevelArgs { input, }, "advance_puzzle_next_level",
__callback, AdvancePuzzleNextLevelArgs { input },
); __callback,
);
} }
} }

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
use super::ai_result_reference_kind_type::AiResultReferenceKind; use super::ai_result_reference_kind_type::AiResultReferenceKind;
@@ -17,12 +12,10 @@ pub struct AiResultReferenceInput {
pub task_id: String, pub task_id: String,
pub reference_kind: AiResultReferenceKind, pub reference_kind: AiResultReferenceKind,
pub reference_id: String, pub reference_id: String,
pub label: Option::<String>, pub label: Option<String>,
pub created_at_micros: i64, pub created_at_micros: i64,
} }
impl __sdk::InModule for AiResultReferenceInput { impl __sdk::InModule for AiResultReferenceInput {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)] #[sats(crate = __lib)]
@@ -24,12 +19,8 @@ pub enum AiResultReferenceKind {
RuntimeItemRecord, RuntimeItemRecord,
AssetObject, AssetObject,
} }
impl __sdk::InModule for AiResultReferenceKind { impl __sdk::InModule for AiResultReferenceKind {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
use super::ai_result_reference_kind_type::AiResultReferenceKind; use super::ai_result_reference_kind_type::AiResultReferenceKind;
@@ -18,12 +13,10 @@ pub struct AiResultReferenceSnapshot {
pub task_id: String, pub task_id: String,
pub reference_kind: AiResultReferenceKind, pub reference_kind: AiResultReferenceKind,
pub reference_id: String, pub reference_id: String,
pub label: Option::<String>, pub label: Option<String>,
pub created_at_micros: i64, pub created_at_micros: i64,
} }
impl __sdk::InModule for AiResultReferenceSnapshot { impl __sdk::InModule for AiResultReferenceSnapshot {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,14 +2,9 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{
self as __sdk,
__lib,
__sats,
__ws,
};
use super::ai_result_reference_type::AiResultReference;
use super::ai_result_reference_kind_type::AiResultReferenceKind; 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`. /// Table handle for the table `ai_result_reference`.
/// ///
@@ -37,7 +32,9 @@ pub trait AiResultReferenceTableAccess {
impl AiResultReferenceTableAccess for super::RemoteTables { impl AiResultReferenceTableAccess for super::RemoteTables {
fn ai_result_reference(&self) -> AiResultReferenceTableHandle<'_> { fn ai_result_reference(&self) -> AiResultReferenceTableHandle<'_> {
AiResultReferenceTableHandle { AiResultReferenceTableHandle {
imp: self.imp.get_table::<AiResultReference>("ai_result_reference"), imp: self
.imp
.get_table::<AiResultReference>("ai_result_reference"),
ctx: std::marker::PhantomData, ctx: std::marker::PhantomData,
} }
} }
@@ -50,8 +47,12 @@ impl<'ctx> __sdk::Table for AiResultReferenceTableHandle<'ctx> {
type Row = AiResultReference; type Row = AiResultReference;
type EventContext = super::EventContext; type EventContext = super::EventContext;
fn count(&self) -> u64 { self.imp.count() } fn count(&self) -> u64 {
fn iter(&self) -> impl Iterator<Item = AiResultReference> + '_ { self.imp.iter() } self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = AiResultReference> + '_ {
self.imp.iter()
}
type InsertCallbackId = AiResultReferenceInsertCallbackId; 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`, /// Access to the `result_reference_row_id` unique index on the table `ai_result_reference`,
/// which allows point queries on the field of the same name /// which allows point queries on the field of the same name
/// via the [`AiResultReferenceResultReferenceRowIdUnique::find`] method. /// via the [`AiResultReferenceResultReferenceRowIdUnique::find`] method.
/// ///
/// Users are encouraged not to explicitly reference this type, /// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls, /// but to directly chain method calls,
/// like `ctx.db.ai_result_reference().result_reference_row_id().find(...)`. /// like `ctx.db.ai_result_reference().result_reference_row_id().find(...)`.
pub struct AiResultReferenceResultReferenceRowIdUnique<'ctx> { pub struct AiResultReferenceResultReferenceRowIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<AiResultReference, String>, imp: __sdk::UniqueConstraintHandle<AiResultReference, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
} }
impl<'ctx> AiResultReferenceTableHandle<'ctx> { impl<'ctx> AiResultReferenceTableHandle<'ctx> {
/// Get a handle on the `result_reference_row_id` unique index on the table `ai_result_reference`. /// 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> { pub fn result_reference_row_id(&self) -> AiResultReferenceResultReferenceRowIdUnique<'ctx> {
AiResultReferenceResultReferenceRowIdUnique { AiResultReferenceResultReferenceRowIdUnique {
imp: self.imp.get_unique_constraint::<String>("result_reference_row_id"), imp: self
phantom: std::marker::PhantomData, .imp
} .get_unique_constraint::<String>("result_reference_row_id"),
} phantom: std::marker::PhantomData,
} }
}
}
impl<'ctx> AiResultReferenceResultReferenceRowIdUnique<'ctx> { impl<'ctx> AiResultReferenceResultReferenceRowIdUnique<'ctx> {
/// Find the subscribed row whose `result_reference_row_id` column value is equal to `col_val`, /// 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. /// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<AiResultReference> { pub fn find(&self, col_val: &String) -> Option<AiResultReference> {
self.imp.find(col_val) self.imp.find(col_val)
} }
} }
#[doc(hidden)] #[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) { pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<AiResultReference>("ai_result_reference"); let _table = client_cache.get_or_make_table::<AiResultReference>("ai_result_reference");
_table.add_unique_constraint::<String>("result_reference_row_id", |row| &row.result_reference_row_id); _table.add_unique_constraint::<String>("result_reference_row_id", |row| {
&row.result_reference_row_id
});
} }
#[doc(hidden)] #[doc(hidden)]
@@ -139,26 +143,24 @@ pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate, raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<AiResultReference>> { ) -> __sdk::Result<__sdk::TableUpdate<AiResultReference>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse( __sdk::InternalError::failed_parse("TableUpdate<AiResultReference>", "TableUpdate")
"TableUpdate<AiResultReference>", .with_cause(e)
"TableUpdate", .into()
).with_cause(e).into()
}) })
} }
#[allow(non_camel_case_types)] #[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `AiResultReference`. /// Extension trait for query builder access to the table `AiResultReference`.
/// ///
/// Implemented for [`__sdk::QueryTableAccessor`]. /// Implemented for [`__sdk::QueryTableAccessor`].
pub trait ai_result_referenceQueryTableAccess { pub trait ai_result_referenceQueryTableAccess {
#[allow(non_snake_case)] #[allow(non_snake_case)]
/// Get a query builder for the table `AiResultReference`. /// Get a query builder for the table `AiResultReference`.
fn ai_result_reference(&self) -> __sdk::__query_builder::Table<AiResultReference>; fn ai_result_reference(&self) -> __sdk::__query_builder::Table<AiResultReference>;
} }
impl ai_result_referenceQueryTableAccess for __sdk::QueryTableAccessor {
fn ai_result_reference(&self) -> __sdk::__query_builder::Table<AiResultReference> {
__sdk::__query_builder::Table::new("ai_result_reference")
}
}
impl ai_result_referenceQueryTableAccess for __sdk::QueryTableAccessor {
fn ai_result_reference(&self) -> __sdk::__query_builder::Table<AiResultReference> {
__sdk::__query_builder::Table::new("ai_result_reference")
}
}

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
use super::ai_result_reference_kind_type::AiResultReferenceKind; use super::ai_result_reference_kind_type::AiResultReferenceKind;
@@ -19,16 +14,14 @@ pub struct AiResultReference {
pub task_id: String, pub task_id: String,
pub reference_kind: AiResultReferenceKind, pub reference_kind: AiResultReferenceKind,
pub reference_id: String, pub reference_id: String,
pub label: Option::<String>, pub label: Option<String>,
pub created_at: __sdk::Timestamp, pub created_at: __sdk::Timestamp,
} }
impl __sdk::InModule for AiResultReference { impl __sdk::InModule for AiResultReference {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }
/// Column accessor struct for the table `AiResultReference`. /// Column accessor struct for the table `AiResultReference`.
/// ///
/// Provides typed access to columns for query building. /// Provides typed access to columns for query building.
@@ -38,7 +31,7 @@ pub struct AiResultReferenceCols {
pub task_id: __sdk::__query_builder::Col<AiResultReference, String>, pub task_id: __sdk::__query_builder::Col<AiResultReference, String>,
pub reference_kind: __sdk::__query_builder::Col<AiResultReference, AiResultReferenceKind>, pub reference_kind: __sdk::__query_builder::Col<AiResultReference, AiResultReferenceKind>,
pub reference_id: __sdk::__query_builder::Col<AiResultReference, String>, pub reference_id: __sdk::__query_builder::Col<AiResultReference, String>,
pub label: __sdk::__query_builder::Col<AiResultReference, Option::<String>>, pub label: __sdk::__query_builder::Col<AiResultReference, Option<String>>,
pub created_at: __sdk::__query_builder::Col<AiResultReference, __sdk::Timestamp>, pub created_at: __sdk::__query_builder::Col<AiResultReference, __sdk::Timestamp>,
} }
@@ -46,14 +39,16 @@ impl __sdk::__query_builder::HasCols for AiResultReference {
type Cols = AiResultReferenceCols; type Cols = AiResultReferenceCols;
fn cols(table_name: &'static str) -> Self::Cols { fn cols(table_name: &'static str) -> Self::Cols {
AiResultReferenceCols { AiResultReferenceCols {
result_reference_row_id: __sdk::__query_builder::Col::new(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"), result_ref_id: __sdk::__query_builder::Col::new(table_name, "result_ref_id"),
task_id: __sdk::__query_builder::Col::new(table_name, "task_id"), task_id: __sdk::__query_builder::Col::new(table_name, "task_id"),
reference_kind: __sdk::__query_builder::Col::new(table_name, "reference_kind"), reference_kind: __sdk::__query_builder::Col::new(table_name, "reference_kind"),
reference_id: __sdk::__query_builder::Col::new(table_name, "reference_id"), reference_id: __sdk::__query_builder::Col::new(table_name, "reference_id"),
label: __sdk::__query_builder::Col::new(table_name, "label"), label: __sdk::__query_builder::Col::new(table_name, "label"),
created_at: __sdk::__query_builder::Col::new(table_name, "created_at"), created_at: __sdk::__query_builder::Col::new(table_name, "created_at"),
} }
} }
} }
@@ -70,12 +65,13 @@ impl __sdk::__query_builder::HasIxCols for AiResultReference {
type IxCols = AiResultReferenceIxCols; type IxCols = AiResultReferenceIxCols;
fn ix_cols(table_name: &'static str) -> Self::IxCols { fn ix_cols(table_name: &'static str) -> Self::IxCols {
AiResultReferenceIxCols { AiResultReferenceIxCols {
result_reference_row_id: __sdk::__query_builder::IxCol::new(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"), task_id: __sdk::__query_builder::IxCol::new(table_name, "task_id"),
} }
} }
} }
impl __sdk::__query_builder::CanBeLookupTable for AiResultReference {} impl __sdk::__query_builder::CanBeLookupTable for AiResultReference {}

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
use super::ai_task_stage_kind_type::AiTaskStageKind; use super::ai_task_stage_kind_type::AiTaskStageKind;
@@ -16,14 +11,12 @@ use super::ai_task_stage_kind_type::AiTaskStageKind;
pub struct AiStageCompletionInput { pub struct AiStageCompletionInput {
pub task_id: String, pub task_id: String,
pub stage_kind: AiTaskStageKind, pub stage_kind: AiTaskStageKind,
pub text_output: Option::<String>, pub text_output: Option<String>,
pub structured_payload_json: Option::<String>, pub structured_payload_json: Option<String>,
pub warning_messages: Vec::<String>, pub warning_messages: Vec<String>,
pub completed_at_micros: i64, pub completed_at_micros: i64,
} }
impl __sdk::InModule for AiStageCompletionInput { impl __sdk::InModule for AiStageCompletionInput {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,13 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)] #[sats(crate = __lib)]
@@ -17,8 +11,6 @@ pub struct AiTaskCancelInput {
pub completed_at_micros: i64, pub completed_at_micros: i64,
} }
impl __sdk::InModule for AiTaskCancelInput { impl __sdk::InModule for AiTaskCancelInput {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
use super::ai_task_kind_type::AiTaskKind; use super::ai_task_kind_type::AiTaskKind;
use super::ai_task_stage_blueprint_type::AiTaskStageBlueprint; use super::ai_task_stage_blueprint_type::AiTaskStageBlueprint;
@@ -20,14 +15,12 @@ pub struct AiTaskCreateInput {
pub owner_user_id: String, pub owner_user_id: String,
pub request_label: String, pub request_label: String,
pub source_module: String, pub source_module: String,
pub source_entity_id: Option::<String>, pub source_entity_id: Option<String>,
pub request_payload_json: Option::<String>, pub request_payload_json: Option<String>,
pub stages: Vec::<AiTaskStageBlueprint>, pub stages: Vec<AiTaskStageBlueprint>,
pub created_at_micros: i64, pub created_at_micros: i64,
} }
impl __sdk::InModule for AiTaskCreateInput { impl __sdk::InModule for AiTaskCreateInput {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,13 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)] #[sats(crate = __lib)]
@@ -18,8 +12,6 @@ pub struct AiTaskFailureInput {
pub completed_at_micros: i64, pub completed_at_micros: i64,
} }
impl __sdk::InModule for AiTaskFailureInput { impl __sdk::InModule for AiTaskFailureInput {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,13 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)] #[sats(crate = __lib)]
@@ -17,8 +11,6 @@ pub struct AiTaskFinishInput {
pub completed_at_micros: i64, pub completed_at_micros: i64,
} }
impl __sdk::InModule for AiTaskFinishInput { impl __sdk::InModule for AiTaskFinishInput {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)] #[sats(crate = __lib)]
@@ -24,12 +19,8 @@ pub enum AiTaskKind {
QuestIntent, QuestIntent,
RuntimeItemIntent, RuntimeItemIntent,
} }
impl __sdk::InModule for AiTaskKind { impl __sdk::InModule for AiTaskKind {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
use super::ai_task_snapshot_type::AiTaskSnapshot; use super::ai_task_snapshot_type::AiTaskSnapshot;
use super::ai_text_chunk_snapshot_type::AiTextChunkSnapshot; use super::ai_text_chunk_snapshot_type::AiTextChunkSnapshot;
@@ -16,13 +11,11 @@ use super::ai_text_chunk_snapshot_type::AiTextChunkSnapshot;
#[sats(crate = __lib)] #[sats(crate = __lib)]
pub struct AiTaskProcedureResult { pub struct AiTaskProcedureResult {
pub ok: bool, pub ok: bool,
pub task: Option::<AiTaskSnapshot>, pub task: Option<AiTaskSnapshot>,
pub text_chunk: Option::<AiTextChunkSnapshot>, pub text_chunk: Option<AiTextChunkSnapshot>,
pub error_message: Option::<String>, pub error_message: Option<String>,
} }
impl __sdk::InModule for AiTaskProcedureResult { impl __sdk::InModule for AiTaskProcedureResult {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,17 +2,12 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
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_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)] #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)] #[sats(crate = __lib)]
@@ -22,23 +17,21 @@ pub struct AiTaskSnapshot {
pub owner_user_id: String, pub owner_user_id: String,
pub request_label: String, pub request_label: String,
pub source_module: String, pub source_module: String,
pub source_entity_id: Option::<String>, pub source_entity_id: Option<String>,
pub request_payload_json: Option::<String>, pub request_payload_json: Option<String>,
pub status: AiTaskStatus, pub status: AiTaskStatus,
pub failure_message: Option::<String>, pub failure_message: Option<String>,
pub stages: Vec::<AiTaskStageSnapshot>, pub stages: Vec<AiTaskStageSnapshot>,
pub result_references: Vec::<AiResultReferenceSnapshot>, pub result_references: Vec<AiResultReferenceSnapshot>,
pub latest_text_output: Option::<String>, pub latest_text_output: Option<String>,
pub latest_structured_payload_json: Option::<String>, pub latest_structured_payload_json: Option<String>,
pub version: u32, pub version: u32,
pub created_at_micros: i64, pub created_at_micros: i64,
pub started_at_micros: Option::<i64>, pub started_at_micros: Option<i64>,
pub completed_at_micros: Option::<i64>, pub completed_at_micros: Option<i64>,
pub updated_at_micros: i64, pub updated_at_micros: i64,
} }
impl __sdk::InModule for AiTaskSnapshot { impl __sdk::InModule for AiTaskSnapshot {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
use super::ai_task_stage_kind_type::AiTaskStageKind; use super::ai_task_stage_kind_type::AiTaskStageKind;
@@ -20,8 +15,6 @@ pub struct AiTaskStageBlueprint {
pub order: u32, pub order: u32,
} }
impl __sdk::InModule for AiTaskStageBlueprint { impl __sdk::InModule for AiTaskStageBlueprint {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)] #[sats(crate = __lib)]
@@ -22,12 +17,8 @@ pub enum AiTaskStageKind {
NormalizeResult, NormalizeResult,
PersistResult, PersistResult,
} }
impl __sdk::InModule for AiTaskStageKind { impl __sdk::InModule for AiTaskStageKind {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
use super::ai_task_stage_kind_type::AiTaskStageKind; use super::ai_task_stage_kind_type::AiTaskStageKind;
use super::ai_task_stage_status_type::AiTaskStageStatus; use super::ai_task_stage_status_type::AiTaskStageStatus;
@@ -20,15 +15,13 @@ pub struct AiTaskStageSnapshot {
pub detail: String, pub detail: String,
pub order: u32, pub order: u32,
pub status: AiTaskStageStatus, pub status: AiTaskStageStatus,
pub text_output: Option::<String>, pub text_output: Option<String>,
pub structured_payload_json: Option::<String>, pub structured_payload_json: Option<String>,
pub warning_messages: Vec::<String>, pub warning_messages: Vec<String>,
pub started_at_micros: Option::<i64>, pub started_at_micros: Option<i64>,
pub completed_at_micros: Option::<i64>, pub completed_at_micros: Option<i64>,
} }
impl __sdk::InModule for AiTaskStageSnapshot { impl __sdk::InModule for AiTaskStageSnapshot {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
use super::ai_task_stage_kind_type::AiTaskStageKind; use super::ai_task_stage_kind_type::AiTaskStageKind;
@@ -19,8 +14,6 @@ pub struct AiTaskStageStartInput {
pub started_at_micros: i64, pub started_at_micros: i64,
} }
impl __sdk::InModule for AiTaskStageStartInput { impl __sdk::InModule for AiTaskStageStartInput {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)] #[sats(crate = __lib)]
@@ -20,12 +15,8 @@ pub enum AiTaskStageStatus {
Completed, Completed,
Skipped, Skipped,
} }
impl __sdk::InModule for AiTaskStageStatus { impl __sdk::InModule for AiTaskStageStatus {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,15 +2,10 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{
self as __sdk,
__lib,
__sats,
__ws,
};
use super::ai_task_stage_type::AiTaskStage;
use super::ai_task_stage_kind_type::AiTaskStageKind; use super::ai_task_stage_kind_type::AiTaskStageKind;
use super::ai_task_stage_status_type::AiTaskStageStatus; use super::ai_task_stage_status_type::AiTaskStageStatus;
use super::ai_task_stage_type::AiTaskStage;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `ai_task_stage`. /// Table handle for the table `ai_task_stage`.
/// ///
@@ -51,8 +46,12 @@ impl<'ctx> __sdk::Table for AiTaskStageTableHandle<'ctx> {
type Row = AiTaskStage; type Row = AiTaskStage;
type EventContext = super::EventContext; type EventContext = super::EventContext;
fn count(&self) -> u64 { self.imp.count() } fn count(&self) -> u64 {
fn iter(&self) -> impl Iterator<Item = AiTaskStage> + '_ { self.imp.iter() } self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = AiTaskStage> + '_ {
self.imp.iter()
}
type InsertCallbackId = AiTaskStageInsertCallbackId; 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`, /// Access to the `task_stage_id` unique index on the table `ai_task_stage`,
/// which allows point queries on the field of the same name /// which allows point queries on the field of the same name
/// via the [`AiTaskStageTaskStageIdUnique::find`] method. /// via the [`AiTaskStageTaskStageIdUnique::find`] method.
/// ///
/// Users are encouraged not to explicitly reference this type, /// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls, /// but to directly chain method calls,
/// like `ctx.db.ai_task_stage().task_stage_id().find(...)`. /// like `ctx.db.ai_task_stage().task_stage_id().find(...)`.
pub struct AiTaskStageTaskStageIdUnique<'ctx> { pub struct AiTaskStageTaskStageIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<AiTaskStage, String>, imp: __sdk::UniqueConstraintHandle<AiTaskStage, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
} }
impl<'ctx> AiTaskStageTableHandle<'ctx> { impl<'ctx> AiTaskStageTableHandle<'ctx> {
/// Get a handle on the `task_stage_id` unique index on the table `ai_task_stage`. /// Get a handle on the `task_stage_id` unique index on the table `ai_task_stage`.
pub fn task_stage_id(&self) -> AiTaskStageTaskStageIdUnique<'ctx> { pub fn task_stage_id(&self) -> AiTaskStageTaskStageIdUnique<'ctx> {
AiTaskStageTaskStageIdUnique { AiTaskStageTaskStageIdUnique {
imp: self.imp.get_unique_constraint::<String>("task_stage_id"), imp: self.imp.get_unique_constraint::<String>("task_stage_id"),
phantom: std::marker::PhantomData, phantom: std::marker::PhantomData,
}
}
} }
}
}
impl<'ctx> AiTaskStageTaskStageIdUnique<'ctx> { impl<'ctx> AiTaskStageTaskStageIdUnique<'ctx> {
/// Find the subscribed row whose `task_stage_id` column value is equal to `col_val`, /// 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. /// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<AiTaskStage> { pub fn find(&self, col_val: &String) -> Option<AiTaskStage> {
self.imp.find(col_val) self.imp.find(col_val)
} }
} }
#[doc(hidden)] #[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) { pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<AiTaskStage>("ai_task_stage"); let _table = client_cache.get_or_make_table::<AiTaskStage>("ai_task_stage");
_table.add_unique_constraint::<String>("task_stage_id", |row| &row.task_stage_id); _table.add_unique_constraint::<String>("task_stage_id", |row| &row.task_stage_id);
} }
@@ -140,26 +138,24 @@ pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate, raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<AiTaskStage>> { ) -> __sdk::Result<__sdk::TableUpdate<AiTaskStage>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse( __sdk::InternalError::failed_parse("TableUpdate<AiTaskStage>", "TableUpdate")
"TableUpdate<AiTaskStage>", .with_cause(e)
"TableUpdate", .into()
).with_cause(e).into()
}) })
} }
#[allow(non_camel_case_types)] #[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `AiTaskStage`. /// Extension trait for query builder access to the table `AiTaskStage`.
/// ///
/// Implemented for [`__sdk::QueryTableAccessor`]. /// Implemented for [`__sdk::QueryTableAccessor`].
pub trait ai_task_stageQueryTableAccess { pub trait ai_task_stageQueryTableAccess {
#[allow(non_snake_case)] #[allow(non_snake_case)]
/// Get a query builder for the table `AiTaskStage`. /// Get a query builder for the table `AiTaskStage`.
fn ai_task_stage(&self) -> __sdk::__query_builder::Table<AiTaskStage>; fn ai_task_stage(&self) -> __sdk::__query_builder::Table<AiTaskStage>;
} }
impl ai_task_stageQueryTableAccess for __sdk::QueryTableAccessor {
fn ai_task_stage(&self) -> __sdk::__query_builder::Table<AiTaskStage> {
__sdk::__query_builder::Table::new("ai_task_stage")
}
}
impl ai_task_stageQueryTableAccess for __sdk::QueryTableAccessor {
fn ai_task_stage(&self) -> __sdk::__query_builder::Table<AiTaskStage> {
__sdk::__query_builder::Table::new("ai_task_stage")
}
}

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
use super::ai_task_stage_kind_type::AiTaskStageKind; use super::ai_task_stage_kind_type::AiTaskStageKind;
use super::ai_task_stage_status_type::AiTaskStageStatus; use super::ai_task_stage_status_type::AiTaskStageStatus;
@@ -22,19 +17,17 @@ pub struct AiTaskStage {
pub detail: String, pub detail: String,
pub stage_order: u32, pub stage_order: u32,
pub status: AiTaskStageStatus, pub status: AiTaskStageStatus,
pub text_output: Option::<String>, pub text_output: Option<String>,
pub structured_payload_json: Option::<String>, pub structured_payload_json: Option<String>,
pub warning_messages: Vec::<String>, pub warning_messages: Vec<String>,
pub started_at: Option::<__sdk::Timestamp>, pub started_at: Option<__sdk::Timestamp>,
pub completed_at: Option::<__sdk::Timestamp>, pub completed_at: Option<__sdk::Timestamp>,
} }
impl __sdk::InModule for AiTaskStage { impl __sdk::InModule for AiTaskStage {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }
/// Column accessor struct for the table `AiTaskStage`. /// Column accessor struct for the table `AiTaskStage`.
/// ///
/// Provides typed access to columns for query building. /// Provides typed access to columns for query building.
@@ -46,11 +39,11 @@ pub struct AiTaskStageCols {
pub detail: __sdk::__query_builder::Col<AiTaskStage, String>, pub detail: __sdk::__query_builder::Col<AiTaskStage, String>,
pub stage_order: __sdk::__query_builder::Col<AiTaskStage, u32>, pub stage_order: __sdk::__query_builder::Col<AiTaskStage, u32>,
pub status: __sdk::__query_builder::Col<AiTaskStage, AiTaskStageStatus>, pub status: __sdk::__query_builder::Col<AiTaskStage, AiTaskStageStatus>,
pub text_output: __sdk::__query_builder::Col<AiTaskStage, Option::<String>>, pub text_output: __sdk::__query_builder::Col<AiTaskStage, Option<String>>,
pub structured_payload_json: __sdk::__query_builder::Col<AiTaskStage, Option::<String>>, pub structured_payload_json: __sdk::__query_builder::Col<AiTaskStage, Option<String>>,
pub warning_messages: __sdk::__query_builder::Col<AiTaskStage, Vec::<String>>, pub warning_messages: __sdk::__query_builder::Col<AiTaskStage, Vec<String>>,
pub started_at: __sdk::__query_builder::Col<AiTaskStage, Option::<__sdk::Timestamp>>, pub started_at: __sdk::__query_builder::Col<AiTaskStage, Option<__sdk::Timestamp>>,
pub completed_at: __sdk::__query_builder::Col<AiTaskStage, Option::<__sdk::Timestamp>>, pub completed_at: __sdk::__query_builder::Col<AiTaskStage, Option<__sdk::Timestamp>>,
} }
impl __sdk::__query_builder::HasCols for AiTaskStage { impl __sdk::__query_builder::HasCols for AiTaskStage {
@@ -65,11 +58,13 @@ impl __sdk::__query_builder::HasCols for AiTaskStage {
stage_order: __sdk::__query_builder::Col::new(table_name, "stage_order"), stage_order: __sdk::__query_builder::Col::new(table_name, "stage_order"),
status: __sdk::__query_builder::Col::new(table_name, "status"), status: __sdk::__query_builder::Col::new(table_name, "status"),
text_output: __sdk::__query_builder::Col::new(table_name, "text_output"), text_output: __sdk::__query_builder::Col::new(table_name, "text_output"),
structured_payload_json: __sdk::__query_builder::Col::new(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"), warning_messages: __sdk::__query_builder::Col::new(table_name, "warning_messages"),
started_at: __sdk::__query_builder::Col::new(table_name, "started_at"), started_at: __sdk::__query_builder::Col::new(table_name, "started_at"),
completed_at: __sdk::__query_builder::Col::new(table_name, "completed_at"), completed_at: __sdk::__query_builder::Col::new(table_name, "completed_at"),
} }
} }
} }
@@ -88,10 +83,8 @@ impl __sdk::__query_builder::HasIxCols for AiTaskStage {
AiTaskStageIxCols { AiTaskStageIxCols {
task_id: __sdk::__query_builder::IxCol::new(table_name, "task_id"), task_id: __sdk::__query_builder::IxCol::new(table_name, "task_id"),
task_stage_id: __sdk::__query_builder::IxCol::new(table_name, "task_stage_id"), task_stage_id: __sdk::__query_builder::IxCol::new(table_name, "task_stage_id"),
} }
} }
} }
impl __sdk::__query_builder::CanBeLookupTable for AiTaskStage {} impl __sdk::__query_builder::CanBeLookupTable for AiTaskStage {}

View File

@@ -2,13 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)] #[sats(crate = __lib)]
@@ -17,8 +11,6 @@ pub struct AiTaskStartInput {
pub started_at_micros: i64, pub started_at_micros: i64,
} }
impl __sdk::InModule for AiTaskStartInput { impl __sdk::InModule for AiTaskStartInput {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)] #[sats(crate = __lib)]
@@ -22,12 +17,8 @@ pub enum AiTaskStatus {
Failed, Failed,
Cancelled, Cancelled,
} }
impl __sdk::InModule for AiTaskStatus { impl __sdk::InModule for AiTaskStatus {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,15 +2,10 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{
self as __sdk,
__lib,
__sats,
__ws,
};
use super::ai_task_type::AiTask;
use super::ai_task_kind_type::AiTaskKind; use super::ai_task_kind_type::AiTaskKind;
use super::ai_task_status_type::AiTaskStatus; use super::ai_task_status_type::AiTaskStatus;
use super::ai_task_type::AiTask;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `ai_task`. /// Table handle for the table `ai_task`.
/// ///
@@ -51,8 +46,12 @@ impl<'ctx> __sdk::Table for AiTaskTableHandle<'ctx> {
type Row = AiTask; type Row = AiTask;
type EventContext = super::EventContext; type EventContext = super::EventContext;
fn count(&self) -> u64 { self.imp.count() } fn count(&self) -> u64 {
fn iter(&self) -> impl Iterator<Item = AiTask> + '_ { self.imp.iter() } self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = AiTask> + '_ {
self.imp.iter()
}
type InsertCallbackId = AiTaskInsertCallbackId; 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`, /// Access to the `task_id` unique index on the table `ai_task`,
/// which allows point queries on the field of the same name /// which allows point queries on the field of the same name
/// via the [`AiTaskTaskIdUnique::find`] method. /// via the [`AiTaskTaskIdUnique::find`] method.
/// ///
/// Users are encouraged not to explicitly reference this type, /// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls, /// but to directly chain method calls,
/// like `ctx.db.ai_task().task_id().find(...)`. /// like `ctx.db.ai_task().task_id().find(...)`.
pub struct AiTaskTaskIdUnique<'ctx> { pub struct AiTaskTaskIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<AiTask, String>, imp: __sdk::UniqueConstraintHandle<AiTask, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
} }
impl<'ctx> AiTaskTableHandle<'ctx> { impl<'ctx> AiTaskTableHandle<'ctx> {
/// Get a handle on the `task_id` unique index on the table `ai_task`. /// Get a handle on the `task_id` unique index on the table `ai_task`.
pub fn task_id(&self) -> AiTaskTaskIdUnique<'ctx> { pub fn task_id(&self) -> AiTaskTaskIdUnique<'ctx> {
AiTaskTaskIdUnique { AiTaskTaskIdUnique {
imp: self.imp.get_unique_constraint::<String>("task_id"), imp: self.imp.get_unique_constraint::<String>("task_id"),
phantom: std::marker::PhantomData, phantom: std::marker::PhantomData,
}
}
} }
}
}
impl<'ctx> AiTaskTaskIdUnique<'ctx> { impl<'ctx> AiTaskTaskIdUnique<'ctx> {
/// Find the subscribed row whose `task_id` column value is equal to `col_val`, /// Find the subscribed row whose `task_id` column value is equal to `col_val`,
/// if such a row is present in the client cache. /// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<AiTask> { pub fn find(&self, col_val: &String) -> Option<AiTask> {
self.imp.find(col_val) self.imp.find(col_val)
} }
} }
#[doc(hidden)] #[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) { pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<AiTask>("ai_task"); let _table = client_cache.get_or_make_table::<AiTask>("ai_task");
_table.add_unique_constraint::<String>("task_id", |row| &row.task_id); _table.add_unique_constraint::<String>("task_id", |row| &row.task_id);
} }
@@ -140,26 +138,24 @@ pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate, raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<AiTask>> { ) -> __sdk::Result<__sdk::TableUpdate<AiTask>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse( __sdk::InternalError::failed_parse("TableUpdate<AiTask>", "TableUpdate")
"TableUpdate<AiTask>", .with_cause(e)
"TableUpdate", .into()
).with_cause(e).into()
}) })
} }
#[allow(non_camel_case_types)] #[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `AiTask`. /// Extension trait for query builder access to the table `AiTask`.
/// ///
/// Implemented for [`__sdk::QueryTableAccessor`]. /// Implemented for [`__sdk::QueryTableAccessor`].
pub trait ai_taskQueryTableAccess { pub trait ai_taskQueryTableAccess {
#[allow(non_snake_case)] #[allow(non_snake_case)]
/// Get a query builder for the table `AiTask`. /// Get a query builder for the table `AiTask`.
fn ai_task(&self) -> __sdk::__query_builder::Table<AiTask>; fn ai_task(&self) -> __sdk::__query_builder::Table<AiTask>;
} }
impl ai_taskQueryTableAccess for __sdk::QueryTableAccessor {
fn ai_task(&self) -> __sdk::__query_builder::Table<AiTask> {
__sdk::__query_builder::Table::new("ai_task")
}
}
impl ai_taskQueryTableAccess for __sdk::QueryTableAccessor {
fn ai_task(&self) -> __sdk::__query_builder::Table<AiTask> {
__sdk::__query_builder::Table::new("ai_task")
}
}

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
use super::ai_task_kind_type::AiTaskKind; use super::ai_task_kind_type::AiTaskKind;
use super::ai_task_status_type::AiTaskStatus; use super::ai_task_status_type::AiTaskStatus;
@@ -20,25 +15,23 @@ pub struct AiTask {
pub owner_user_id: String, pub owner_user_id: String,
pub request_label: String, pub request_label: String,
pub source_module: String, pub source_module: String,
pub source_entity_id: Option::<String>, pub source_entity_id: Option<String>,
pub request_payload_json: Option::<String>, pub request_payload_json: Option<String>,
pub status: AiTaskStatus, pub status: AiTaskStatus,
pub failure_message: Option::<String>, pub failure_message: Option<String>,
pub latest_text_output: Option::<String>, pub latest_text_output: Option<String>,
pub latest_structured_payload_json: Option::<String>, pub latest_structured_payload_json: Option<String>,
pub version: u32, pub version: u32,
pub created_at: __sdk::Timestamp, pub created_at: __sdk::Timestamp,
pub started_at: Option::<__sdk::Timestamp>, pub started_at: Option<__sdk::Timestamp>,
pub completed_at: Option::<__sdk::Timestamp>, pub completed_at: Option<__sdk::Timestamp>,
pub updated_at: __sdk::Timestamp, pub updated_at: __sdk::Timestamp,
} }
impl __sdk::InModule for AiTask { impl __sdk::InModule for AiTask {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }
/// Column accessor struct for the table `AiTask`. /// Column accessor struct for the table `AiTask`.
/// ///
/// Provides typed access to columns for query building. /// Provides typed access to columns for query building.
@@ -48,16 +41,16 @@ pub struct AiTaskCols {
pub owner_user_id: __sdk::__query_builder::Col<AiTask, String>, pub owner_user_id: __sdk::__query_builder::Col<AiTask, String>,
pub request_label: __sdk::__query_builder::Col<AiTask, String>, pub request_label: __sdk::__query_builder::Col<AiTask, String>,
pub source_module: __sdk::__query_builder::Col<AiTask, String>, pub source_module: __sdk::__query_builder::Col<AiTask, String>,
pub source_entity_id: __sdk::__query_builder::Col<AiTask, Option::<String>>, pub source_entity_id: __sdk::__query_builder::Col<AiTask, Option<String>>,
pub request_payload_json: __sdk::__query_builder::Col<AiTask, Option::<String>>, pub request_payload_json: __sdk::__query_builder::Col<AiTask, Option<String>>,
pub status: __sdk::__query_builder::Col<AiTask, AiTaskStatus>, pub status: __sdk::__query_builder::Col<AiTask, AiTaskStatus>,
pub failure_message: __sdk::__query_builder::Col<AiTask, Option::<String>>, pub failure_message: __sdk::__query_builder::Col<AiTask, Option<String>>,
pub latest_text_output: __sdk::__query_builder::Col<AiTask, Option::<String>>, pub latest_text_output: __sdk::__query_builder::Col<AiTask, Option<String>>,
pub latest_structured_payload_json: __sdk::__query_builder::Col<AiTask, Option::<String>>, pub latest_structured_payload_json: __sdk::__query_builder::Col<AiTask, Option<String>>,
pub version: __sdk::__query_builder::Col<AiTask, u32>, pub version: __sdk::__query_builder::Col<AiTask, u32>,
pub created_at: __sdk::__query_builder::Col<AiTask, __sdk::Timestamp>, pub created_at: __sdk::__query_builder::Col<AiTask, __sdk::Timestamp>,
pub started_at: __sdk::__query_builder::Col<AiTask, Option::<__sdk::Timestamp>>, pub started_at: __sdk::__query_builder::Col<AiTask, Option<__sdk::Timestamp>>,
pub completed_at: __sdk::__query_builder::Col<AiTask, Option::<__sdk::Timestamp>>, pub completed_at: __sdk::__query_builder::Col<AiTask, Option<__sdk::Timestamp>>,
pub updated_at: __sdk::__query_builder::Col<AiTask, __sdk::Timestamp>, pub updated_at: __sdk::__query_builder::Col<AiTask, __sdk::Timestamp>,
} }
@@ -71,17 +64,22 @@ impl __sdk::__query_builder::HasCols for AiTask {
request_label: __sdk::__query_builder::Col::new(table_name, "request_label"), request_label: __sdk::__query_builder::Col::new(table_name, "request_label"),
source_module: __sdk::__query_builder::Col::new(table_name, "source_module"), source_module: __sdk::__query_builder::Col::new(table_name, "source_module"),
source_entity_id: __sdk::__query_builder::Col::new(table_name, "source_entity_id"), source_entity_id: __sdk::__query_builder::Col::new(table_name, "source_entity_id"),
request_payload_json: __sdk::__query_builder::Col::new(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"), status: __sdk::__query_builder::Col::new(table_name, "status"),
failure_message: __sdk::__query_builder::Col::new(table_name, "failure_message"), failure_message: __sdk::__query_builder::Col::new(table_name, "failure_message"),
latest_text_output: __sdk::__query_builder::Col::new(table_name, "latest_text_output"), latest_text_output: __sdk::__query_builder::Col::new(table_name, "latest_text_output"),
latest_structured_payload_json: __sdk::__query_builder::Col::new(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"), version: __sdk::__query_builder::Col::new(table_name, "version"),
created_at: __sdk::__query_builder::Col::new(table_name, "created_at"), created_at: __sdk::__query_builder::Col::new(table_name, "created_at"),
started_at: __sdk::__query_builder::Col::new(table_name, "started_at"), started_at: __sdk::__query_builder::Col::new(table_name, "started_at"),
completed_at: __sdk::__query_builder::Col::new(table_name, "completed_at"), completed_at: __sdk::__query_builder::Col::new(table_name, "completed_at"),
updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"), updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"),
} }
} }
} }
@@ -104,10 +102,8 @@ impl __sdk::__query_builder::HasIxCols for AiTask {
status: __sdk::__query_builder::IxCol::new(table_name, "status"), status: __sdk::__query_builder::IxCol::new(table_name, "status"),
task_id: __sdk::__query_builder::IxCol::new(table_name, "task_id"), task_id: __sdk::__query_builder::IxCol::new(table_name, "task_id"),
task_kind: __sdk::__query_builder::IxCol::new(table_name, "task_kind"), task_kind: __sdk::__query_builder::IxCol::new(table_name, "task_kind"),
} }
} }
} }
impl __sdk::__query_builder::CanBeLookupTable for AiTask {} impl __sdk::__query_builder::CanBeLookupTable for AiTask {}

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
use super::ai_task_stage_kind_type::AiTaskStageKind; use super::ai_task_stage_kind_type::AiTaskStageKind;
@@ -21,8 +16,6 @@ pub struct AiTextChunkAppendInput {
pub created_at_micros: i64, pub created_at_micros: i64,
} }
impl __sdk::InModule for AiTextChunkAppendInput { impl __sdk::InModule for AiTextChunkAppendInput {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
use super::ai_task_stage_kind_type::AiTaskStageKind; use super::ai_task_stage_kind_type::AiTaskStageKind;
@@ -22,8 +17,6 @@ pub struct AiTextChunkSnapshot {
pub created_at_micros: i64, pub created_at_micros: i64,
} }
impl __sdk::InModule for AiTextChunkSnapshot { impl __sdk::InModule for AiTextChunkSnapshot {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,14 +2,9 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{
self as __sdk,
__lib,
__sats,
__ws,
};
use super::ai_text_chunk_type::AiTextChunk;
use super::ai_task_stage_kind_type::AiTaskStageKind; 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`. /// Table handle for the table `ai_text_chunk`.
/// ///
@@ -50,8 +45,12 @@ impl<'ctx> __sdk::Table for AiTextChunkTableHandle<'ctx> {
type Row = AiTextChunk; type Row = AiTextChunk;
type EventContext = super::EventContext; type EventContext = super::EventContext;
fn count(&self) -> u64 { self.imp.count() } fn count(&self) -> u64 {
fn iter(&self) -> impl Iterator<Item = AiTextChunk> + '_ { self.imp.iter() } self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = AiTextChunk> + '_ {
self.imp.iter()
}
type InsertCallbackId = AiTextChunkInsertCallbackId; 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`, /// Access to the `text_chunk_row_id` unique index on the table `ai_text_chunk`,
/// which allows point queries on the field of the same name /// which allows point queries on the field of the same name
/// via the [`AiTextChunkTextChunkRowIdUnique::find`] method. /// via the [`AiTextChunkTextChunkRowIdUnique::find`] method.
/// ///
/// Users are encouraged not to explicitly reference this type, /// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls, /// but to directly chain method calls,
/// like `ctx.db.ai_text_chunk().text_chunk_row_id().find(...)`. /// like `ctx.db.ai_text_chunk().text_chunk_row_id().find(...)`.
pub struct AiTextChunkTextChunkRowIdUnique<'ctx> { pub struct AiTextChunkTextChunkRowIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<AiTextChunk, String>, imp: __sdk::UniqueConstraintHandle<AiTextChunk, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
} }
impl<'ctx> AiTextChunkTableHandle<'ctx> { impl<'ctx> AiTextChunkTableHandle<'ctx> {
/// Get a handle on the `text_chunk_row_id` unique index on the table `ai_text_chunk`. /// 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> { pub fn text_chunk_row_id(&self) -> AiTextChunkTextChunkRowIdUnique<'ctx> {
AiTextChunkTextChunkRowIdUnique { AiTextChunkTextChunkRowIdUnique {
imp: self.imp.get_unique_constraint::<String>("text_chunk_row_id"), imp: self
phantom: std::marker::PhantomData, .imp
} .get_unique_constraint::<String>("text_chunk_row_id"),
} phantom: std::marker::PhantomData,
} }
}
}
impl<'ctx> AiTextChunkTextChunkRowIdUnique<'ctx> { impl<'ctx> AiTextChunkTextChunkRowIdUnique<'ctx> {
/// Find the subscribed row whose `text_chunk_row_id` column value is equal to `col_val`, /// 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. /// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<AiTextChunk> { pub fn find(&self, col_val: &String) -> Option<AiTextChunk> {
self.imp.find(col_val) self.imp.find(col_val)
} }
} }
#[doc(hidden)] #[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) { pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<AiTextChunk>("ai_text_chunk"); let _table = client_cache.get_or_make_table::<AiTextChunk>("ai_text_chunk");
_table.add_unique_constraint::<String>("text_chunk_row_id", |row| &row.text_chunk_row_id); _table.add_unique_constraint::<String>("text_chunk_row_id", |row| &row.text_chunk_row_id);
} }
@@ -139,26 +139,24 @@ pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate, raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<AiTextChunk>> { ) -> __sdk::Result<__sdk::TableUpdate<AiTextChunk>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse( __sdk::InternalError::failed_parse("TableUpdate<AiTextChunk>", "TableUpdate")
"TableUpdate<AiTextChunk>", .with_cause(e)
"TableUpdate", .into()
).with_cause(e).into()
}) })
} }
#[allow(non_camel_case_types)] #[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `AiTextChunk`. /// Extension trait for query builder access to the table `AiTextChunk`.
/// ///
/// Implemented for [`__sdk::QueryTableAccessor`]. /// Implemented for [`__sdk::QueryTableAccessor`].
pub trait ai_text_chunkQueryTableAccess { pub trait ai_text_chunkQueryTableAccess {
#[allow(non_snake_case)] #[allow(non_snake_case)]
/// Get a query builder for the table `AiTextChunk`. /// Get a query builder for the table `AiTextChunk`.
fn ai_text_chunk(&self) -> __sdk::__query_builder::Table<AiTextChunk>; fn ai_text_chunk(&self) -> __sdk::__query_builder::Table<AiTextChunk>;
} }
impl ai_text_chunkQueryTableAccess for __sdk::QueryTableAccessor {
fn ai_text_chunk(&self) -> __sdk::__query_builder::Table<AiTextChunk> {
__sdk::__query_builder::Table::new("ai_text_chunk")
}
}
impl ai_text_chunkQueryTableAccess for __sdk::QueryTableAccessor {
fn ai_text_chunk(&self) -> __sdk::__query_builder::Table<AiTextChunk> {
__sdk::__query_builder::Table::new("ai_text_chunk")
}
}

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
use super::ai_task_stage_kind_type::AiTaskStageKind; use super::ai_task_stage_kind_type::AiTaskStageKind;
@@ -23,12 +18,10 @@ pub struct AiTextChunk {
pub created_at: __sdk::Timestamp, pub created_at: __sdk::Timestamp,
} }
impl __sdk::InModule for AiTextChunk { impl __sdk::InModule for AiTextChunk {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }
/// Column accessor struct for the table `AiTextChunk`. /// Column accessor struct for the table `AiTextChunk`.
/// ///
/// Provides typed access to columns for query building. /// Provides typed access to columns for query building.
@@ -53,7 +46,6 @@ impl __sdk::__query_builder::HasCols for AiTextChunk {
sequence: __sdk::__query_builder::Col::new(table_name, "sequence"), sequence: __sdk::__query_builder::Col::new(table_name, "sequence"),
delta_text: __sdk::__query_builder::Col::new(table_name, "delta_text"), delta_text: __sdk::__query_builder::Col::new(table_name, "delta_text"),
created_at: __sdk::__query_builder::Col::new(table_name, "created_at"), created_at: __sdk::__query_builder::Col::new(table_name, "created_at"),
} }
} }
} }
@@ -72,10 +64,8 @@ impl __sdk::__query_builder::HasIxCols for AiTextChunk {
AiTextChunkIxCols { AiTextChunkIxCols {
task_id: __sdk::__query_builder::IxCol::new(table_name, "task_id"), task_id: __sdk::__query_builder::IxCol::new(table_name, "task_id"),
text_chunk_row_id: __sdk::__query_builder::IxCol::new(table_name, "text_chunk_row_id"), text_chunk_row_id: __sdk::__query_builder::IxCol::new(table_name, "text_chunk_row_id"),
} }
} }
} }
impl __sdk::__query_builder::CanBeLookupTable for AiTextChunk {} impl __sdk::__query_builder::CanBeLookupTable for AiTextChunk {}

View File

@@ -2,23 +2,17 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
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_task_procedure_result_type::AiTaskProcedureResult;
use super::ai_text_chunk_append_input_type::AiTextChunkAppendInput;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)] #[sats(crate = __lib)]
struct AppendAiTextChunkAndReturnArgs { struct AppendAiTextChunkAndReturnArgs {
pub input: AiTextChunkAppendInput, pub input: AiTextChunkAppendInput,
} }
impl __sdk::InModule for AppendAiTextChunkAndReturnArgs { impl __sdk::InModule for AppendAiTextChunkAndReturnArgs {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }
@@ -28,16 +22,19 @@ impl __sdk::InModule for AppendAiTextChunkAndReturnArgs {
/// ///
/// Implemented for [`super::RemoteProcedures`]. /// Implemented for [`super::RemoteProcedures`].
pub trait append_ai_text_chunk_and_return { pub trait append_ai_text_chunk_and_return {
fn append_ai_text_chunk_and_return(&self, input: AiTextChunkAppendInput, fn append_ai_text_chunk_and_return(&self, input: AiTextChunkAppendInput) {
) { self.append_ai_text_chunk_and_return_then(input, |_, _| {});
self.append_ai_text_chunk_and_return_then(input, |_, _| {});
} }
fn append_ai_text_chunk_and_return_then( fn append_ai_text_chunk_and_return_then(
&self, &self,
input: AiTextChunkAppendInput, input: AiTextChunkAppendInput,
__callback: impl FnOnce(&super::ProcedureEventContext, Result<AiTaskProcedureResult, __sdk::InternalError>) + Send + 'static, __callback: impl FnOnce(
&super::ProcedureEventContext,
Result<AiTaskProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
); );
} }
@@ -46,13 +43,17 @@ impl append_ai_text_chunk_and_return for super::RemoteProcedures {
&self, &self,
input: AiTextChunkAppendInput, input: AiTextChunkAppendInput,
__callback: impl FnOnce(&super::ProcedureEventContext, Result<AiTaskProcedureResult, __sdk::InternalError>) + Send + 'static, __callback: impl FnOnce(
&super::ProcedureEventContext,
Result<AiTaskProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) { ) {
self.imp.invoke_procedure_with_callback::<_, AiTaskProcedureResult>( self.imp
"append_ai_text_chunk_and_return", .invoke_procedure_with_callback::<_, AiTaskProcedureResult>(
AppendAiTextChunkAndReturnArgs { input, }, "append_ai_text_chunk_and_return",
__callback, AppendAiTextChunkAndReturnArgs { input },
); __callback,
);
} }
} }

View File

@@ -2,23 +2,17 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
use super::chapter_progression_ledger_input_type::ChapterProgressionLedgerInput; use super::chapter_progression_ledger_input_type::ChapterProgressionLedgerInput;
use super::chapter_progression_procedure_result_type::ChapterProgressionProcedureResult; use super::chapter_progression_procedure_result_type::ChapterProgressionProcedureResult;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)] #[sats(crate = __lib)]
struct ApplyChapterProgressionLedgerEntryAndReturnArgs { struct ApplyChapterProgressionLedgerEntryAndReturnArgs {
pub input: ChapterProgressionLedgerInput, pub input: ChapterProgressionLedgerInput,
} }
impl __sdk::InModule for ApplyChapterProgressionLedgerEntryAndReturnArgs { impl __sdk::InModule for ApplyChapterProgressionLedgerEntryAndReturnArgs {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }
@@ -28,16 +22,22 @@ impl __sdk::InModule for ApplyChapterProgressionLedgerEntryAndReturnArgs {
/// ///
/// Implemented for [`super::RemoteProcedures`]. /// Implemented for [`super::RemoteProcedures`].
pub trait apply_chapter_progression_ledger_entry_and_return { pub trait apply_chapter_progression_ledger_entry_and_return {
fn apply_chapter_progression_ledger_entry_and_return(&self, input: ChapterProgressionLedgerInput, fn apply_chapter_progression_ledger_entry_and_return(
) { &self,
self.apply_chapter_progression_ledger_entry_and_return_then(input, |_, _| {}); input: ChapterProgressionLedgerInput,
) {
self.apply_chapter_progression_ledger_entry_and_return_then(input, |_, _| {});
} }
fn apply_chapter_progression_ledger_entry_and_return_then( fn apply_chapter_progression_ledger_entry_and_return_then(
&self, &self,
input: ChapterProgressionLedgerInput, input: ChapterProgressionLedgerInput,
__callback: impl FnOnce(&super::ProcedureEventContext, Result<ChapterProgressionProcedureResult, __sdk::InternalError>) + Send + 'static, __callback: impl FnOnce(
&super::ProcedureEventContext,
Result<ChapterProgressionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
); );
} }
@@ -46,13 +46,17 @@ impl apply_chapter_progression_ledger_entry_and_return for super::RemoteProcedur
&self, &self,
input: ChapterProgressionLedgerInput, input: ChapterProgressionLedgerInput,
__callback: impl FnOnce(&super::ProcedureEventContext, Result<ChapterProgressionProcedureResult, __sdk::InternalError>) + Send + 'static, __callback: impl FnOnce(
&super::ProcedureEventContext,
Result<ChapterProgressionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) { ) {
self.imp.invoke_procedure_with_callback::<_, ChapterProgressionProcedureResult>( self.imp
"apply_chapter_progression_ledger_entry_and_return", .invoke_procedure_with_callback::<_, ChapterProgressionProcedureResult>(
ApplyChapterProgressionLedgerEntryAndReturnArgs { input, }, "apply_chapter_progression_ledger_entry_and_return",
__callback, ApplyChapterProgressionLedgerEntryAndReturnArgs { input },
); __callback,
);
} }
} }

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
use super::chapter_progression_ledger_input_type::ChapterProgressionLedgerInput; use super::chapter_progression_ledger_input_type::ChapterProgressionLedgerInput;
@@ -19,10 +14,8 @@ pub(super) struct ApplyChapterProgressionLedgerEntryArgs {
impl From<ApplyChapterProgressionLedgerEntryArgs> for super::Reducer { impl From<ApplyChapterProgressionLedgerEntryArgs> for super::Reducer {
fn from(args: ApplyChapterProgressionLedgerEntryArgs) -> Self { fn from(args: ApplyChapterProgressionLedgerEntryArgs) -> Self {
Self::ApplyChapterProgressionLedgerEntry { Self::ApplyChapterProgressionLedgerEntry { input: args.input }
input: args.input, }
}
}
} }
impl __sdk::InModule for ApplyChapterProgressionLedgerEntryArgs { impl __sdk::InModule for ApplyChapterProgressionLedgerEntryArgs {
@@ -40,9 +33,11 @@ pub trait apply_chapter_progression_ledger_entry {
/// The reducer will run asynchronously in the future, /// The reducer will run asynchronously in the future,
/// and this method provides no way to listen for its completion status. /// and this method provides no way to listen for its completion status.
/// /// Use [`apply_chapter_progression_ledger_entry:apply_chapter_progression_ledger_entry_then`] to run a callback after the reducer completes. /// /// Use [`apply_chapter_progression_ledger_entry:apply_chapter_progression_ledger_entry_then`] to run a callback after the reducer completes.
fn apply_chapter_progression_ledger_entry(&self, input: ChapterProgressionLedgerInput, fn apply_chapter_progression_ledger_entry(
) -> __sdk::Result<()> { &self,
self.apply_chapter_progression_ledger_entry_then(input, |_, _| {}) 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, /// 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, &self,
input: ChapterProgressionLedgerInput, input: ChapterProgressionLedgerInput,
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>) callback: impl FnOnce(
+ Send &super::ReducerEventContext,
+ 'static, Result<Result<(), String>, __sdk::InternalError>,
) + Send
+ 'static,
) -> __sdk::Result<()>; ) -> __sdk::Result<()>;
} }
@@ -66,11 +63,15 @@ impl apply_chapter_progression_ledger_entry for super::RemoteReducers {
&self, &self,
input: ChapterProgressionLedgerInput, input: ChapterProgressionLedgerInput,
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>) callback: impl FnOnce(
+ Send &super::ReducerEventContext,
+ 'static, Result<Result<(), String>, __sdk::InternalError>,
) + Send
+ 'static,
) -> __sdk::Result<()> { ) -> __sdk::Result<()> {
self.imp.invoke_reducer_with_callback(ApplyChapterProgressionLedgerEntryArgs { input, }, callback) self.imp.invoke_reducer_with_callback(
ApplyChapterProgressionLedgerEntryArgs { input },
callback,
)
} }
} }

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
use super::inventory_mutation_input_type::InventoryMutationInput; use super::inventory_mutation_input_type::InventoryMutationInput;
@@ -19,10 +14,8 @@ pub(super) struct ApplyInventoryMutationArgs {
impl From<ApplyInventoryMutationArgs> for super::Reducer { impl From<ApplyInventoryMutationArgs> for super::Reducer {
fn from(args: ApplyInventoryMutationArgs) -> Self { fn from(args: ApplyInventoryMutationArgs) -> Self {
Self::ApplyInventoryMutation { Self::ApplyInventoryMutation { input: args.input }
input: args.input, }
}
}
} }
impl __sdk::InModule for ApplyInventoryMutationArgs { impl __sdk::InModule for ApplyInventoryMutationArgs {
@@ -40,9 +33,8 @@ pub trait apply_inventory_mutation {
/// The reducer will run asynchronously in the future, /// The reducer will run asynchronously in the future,
/// and this method provides no way to listen for its completion status. /// and this method provides no way to listen for its completion status.
/// /// Use [`apply_inventory_mutation:apply_inventory_mutation_then`] to run a callback after the reducer completes. /// /// Use [`apply_inventory_mutation:apply_inventory_mutation_then`] to run a callback after the reducer completes.
fn apply_inventory_mutation(&self, input: InventoryMutationInput, fn apply_inventory_mutation(&self, input: InventoryMutationInput) -> __sdk::Result<()> {
) -> __sdk::Result<()> { self.apply_inventory_mutation_then(input, |_, _| {})
self.apply_inventory_mutation_then(input, |_, _| {})
} }
/// Request that the remote module invoke the reducer `apply_inventory_mutation` to run as soon as possible, /// Request that the remote module invoke the reducer `apply_inventory_mutation` to run as soon as possible,
@@ -55,9 +47,11 @@ pub trait apply_inventory_mutation {
&self, &self,
input: InventoryMutationInput, input: InventoryMutationInput,
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>) callback: impl FnOnce(
+ Send &super::ReducerEventContext,
+ 'static, Result<Result<(), String>, __sdk::InternalError>,
) + Send
+ 'static,
) -> __sdk::Result<()>; ) -> __sdk::Result<()>;
} }
@@ -66,11 +60,13 @@ impl apply_inventory_mutation for super::RemoteReducers {
&self, &self,
input: InventoryMutationInput, input: InventoryMutationInput,
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>) callback: impl FnOnce(
+ Send &super::ReducerEventContext,
+ 'static, Result<Result<(), String>, __sdk::InternalError>,
) + Send
+ 'static,
) -> __sdk::Result<()> { ) -> __sdk::Result<()> {
self.imp.invoke_reducer_with_callback(ApplyInventoryMutationArgs { input, }, callback) self.imp
.invoke_reducer_with_callback(ApplyInventoryMutationArgs { input }, callback)
} }
} }

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
use super::quest_signal_apply_input_type::QuestSignalApplyInput; use super::quest_signal_apply_input_type::QuestSignalApplyInput;
@@ -19,10 +14,8 @@ pub(super) struct ApplyQuestSignalArgs {
impl From<ApplyQuestSignalArgs> for super::Reducer { impl From<ApplyQuestSignalArgs> for super::Reducer {
fn from(args: ApplyQuestSignalArgs) -> Self { fn from(args: ApplyQuestSignalArgs) -> Self {
Self::ApplyQuestSignal { Self::ApplyQuestSignal { input: args.input }
input: args.input, }
}
}
} }
impl __sdk::InModule for ApplyQuestSignalArgs { impl __sdk::InModule for ApplyQuestSignalArgs {
@@ -40,9 +33,8 @@ pub trait apply_quest_signal {
/// The reducer will run asynchronously in the future, /// The reducer will run asynchronously in the future,
/// and this method provides no way to listen for its completion status. /// and this method provides no way to listen for its completion status.
/// /// Use [`apply_quest_signal:apply_quest_signal_then`] to run a callback after the reducer completes. /// /// Use [`apply_quest_signal:apply_quest_signal_then`] to run a callback after the reducer completes.
fn apply_quest_signal(&self, input: QuestSignalApplyInput, fn apply_quest_signal(&self, input: QuestSignalApplyInput) -> __sdk::Result<()> {
) -> __sdk::Result<()> { self.apply_quest_signal_then(input, |_, _| {})
self.apply_quest_signal_then(input, |_, _| {})
} }
/// Request that the remote module invoke the reducer `apply_quest_signal` to run as soon as possible, /// Request that the remote module invoke the reducer `apply_quest_signal` to run as soon as possible,
@@ -55,9 +47,11 @@ pub trait apply_quest_signal {
&self, &self,
input: QuestSignalApplyInput, input: QuestSignalApplyInput,
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>) callback: impl FnOnce(
+ Send &super::ReducerEventContext,
+ 'static, Result<Result<(), String>, __sdk::InternalError>,
) + Send
+ 'static,
) -> __sdk::Result<()>; ) -> __sdk::Result<()>;
} }
@@ -66,11 +60,13 @@ impl apply_quest_signal for super::RemoteReducers {
&self, &self,
input: QuestSignalApplyInput, input: QuestSignalApplyInput,
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>) callback: impl FnOnce(
+ Send &super::ReducerEventContext,
+ 'static, Result<Result<(), String>, __sdk::InternalError>,
) + Send
+ 'static,
) -> __sdk::Result<()> { ) -> __sdk::Result<()> {
self.imp.invoke_reducer_with_callback(ApplyQuestSignalArgs { input, }, callback) self.imp
.invoke_reducer_with_callback(ApplyQuestSignalArgs { input }, callback)
} }
} }

View File

@@ -2,13 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)] #[sats(crate = __lib)]
@@ -19,13 +13,11 @@ pub struct AssetEntityBindingInput {
pub entity_id: String, pub entity_id: String,
pub slot: String, pub slot: String,
pub asset_kind: String, pub asset_kind: String,
pub owner_user_id: Option::<String>, pub owner_user_id: Option<String>,
pub profile_id: Option::<String>, pub profile_id: Option<String>,
pub updated_at_micros: i64, pub updated_at_micros: i64,
} }
impl __sdk::InModule for AssetEntityBindingInput { impl __sdk::InModule for AssetEntityBindingInput {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
use super::asset_entity_binding_snapshot_type::AssetEntityBindingSnapshot; use super::asset_entity_binding_snapshot_type::AssetEntityBindingSnapshot;
@@ -15,12 +10,10 @@ use super::asset_entity_binding_snapshot_type::AssetEntityBindingSnapshot;
#[sats(crate = __lib)] #[sats(crate = __lib)]
pub struct AssetEntityBindingProcedureResult { pub struct AssetEntityBindingProcedureResult {
pub ok: bool, pub ok: bool,
pub record: Option::<AssetEntityBindingSnapshot>, pub record: Option<AssetEntityBindingSnapshot>,
pub error_message: Option::<String>, pub error_message: Option<String>,
} }
impl __sdk::InModule for AssetEntityBindingProcedureResult { impl __sdk::InModule for AssetEntityBindingProcedureResult {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,13 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)] #[sats(crate = __lib)]
@@ -19,14 +13,12 @@ pub struct AssetEntityBindingSnapshot {
pub entity_id: String, pub entity_id: String,
pub slot: String, pub slot: String,
pub asset_kind: String, pub asset_kind: String,
pub owner_user_id: Option::<String>, pub owner_user_id: Option<String>,
pub profile_id: Option::<String>, pub profile_id: Option<String>,
pub created_at_micros: i64, pub created_at_micros: i64,
pub updated_at_micros: i64, pub updated_at_micros: i64,
} }
impl __sdk::InModule for AssetEntityBindingSnapshot { impl __sdk::InModule for AssetEntityBindingSnapshot {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,13 +2,8 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{
self as __sdk,
__lib,
__sats,
__ws,
};
use super::asset_entity_binding_type::AssetEntityBinding; use super::asset_entity_binding_type::AssetEntityBinding;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `asset_entity_binding`. /// Table handle for the table `asset_entity_binding`.
/// ///
@@ -36,7 +31,9 @@ pub trait AssetEntityBindingTableAccess {
impl AssetEntityBindingTableAccess for super::RemoteTables { impl AssetEntityBindingTableAccess for super::RemoteTables {
fn asset_entity_binding(&self) -> AssetEntityBindingTableHandle<'_> { fn asset_entity_binding(&self) -> AssetEntityBindingTableHandle<'_> {
AssetEntityBindingTableHandle { AssetEntityBindingTableHandle {
imp: self.imp.get_table::<AssetEntityBinding>("asset_entity_binding"), imp: self
.imp
.get_table::<AssetEntityBinding>("asset_entity_binding"),
ctx: std::marker::PhantomData, ctx: std::marker::PhantomData,
} }
} }
@@ -49,8 +46,12 @@ impl<'ctx> __sdk::Table for AssetEntityBindingTableHandle<'ctx> {
type Row = AssetEntityBinding; type Row = AssetEntityBinding;
type EventContext = super::EventContext; type EventContext = super::EventContext;
fn count(&self) -> u64 { self.imp.count() } fn count(&self) -> u64 {
fn iter(&self) -> impl Iterator<Item = AssetEntityBinding> + '_ { self.imp.iter() } self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = AssetEntityBinding> + '_ {
self.imp.iter()
}
type InsertCallbackId = AssetEntityBindingInsertCallbackId; 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`, /// Access to the `binding_id` unique index on the table `asset_entity_binding`,
/// which allows point queries on the field of the same name /// which allows point queries on the field of the same name
/// via the [`AssetEntityBindingBindingIdUnique::find`] method. /// via the [`AssetEntityBindingBindingIdUnique::find`] method.
/// ///
/// Users are encouraged not to explicitly reference this type, /// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls, /// but to directly chain method calls,
/// like `ctx.db.asset_entity_binding().binding_id().find(...)`. /// like `ctx.db.asset_entity_binding().binding_id().find(...)`.
pub struct AssetEntityBindingBindingIdUnique<'ctx> { pub struct AssetEntityBindingBindingIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<AssetEntityBinding, String>, imp: __sdk::UniqueConstraintHandle<AssetEntityBinding, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
} }
impl<'ctx> AssetEntityBindingTableHandle<'ctx> { impl<'ctx> AssetEntityBindingTableHandle<'ctx> {
/// Get a handle on the `binding_id` unique index on the table `asset_entity_binding`. /// Get a handle on the `binding_id` unique index on the table `asset_entity_binding`.
pub fn binding_id(&self) -> AssetEntityBindingBindingIdUnique<'ctx> { pub fn binding_id(&self) -> AssetEntityBindingBindingIdUnique<'ctx> {
AssetEntityBindingBindingIdUnique { AssetEntityBindingBindingIdUnique {
imp: self.imp.get_unique_constraint::<String>("binding_id"), imp: self.imp.get_unique_constraint::<String>("binding_id"),
phantom: std::marker::PhantomData, phantom: std::marker::PhantomData,
}
}
} }
}
}
impl<'ctx> AssetEntityBindingBindingIdUnique<'ctx> { impl<'ctx> AssetEntityBindingBindingIdUnique<'ctx> {
/// Find the subscribed row whose `binding_id` column value is equal to `col_val`, /// Find the subscribed row whose `binding_id` column value is equal to `col_val`,
/// if such a row is present in the client cache. /// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<AssetEntityBinding> { pub fn find(&self, col_val: &String) -> Option<AssetEntityBinding> {
self.imp.find(col_val) self.imp.find(col_val)
} }
} }
#[doc(hidden)] #[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) { pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<AssetEntityBinding>("asset_entity_binding"); let _table = client_cache.get_or_make_table::<AssetEntityBinding>("asset_entity_binding");
_table.add_unique_constraint::<String>("binding_id", |row| &row.binding_id); _table.add_unique_constraint::<String>("binding_id", |row| &row.binding_id);
} }
@@ -138,26 +138,24 @@ pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate, raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<AssetEntityBinding>> { ) -> __sdk::Result<__sdk::TableUpdate<AssetEntityBinding>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse( __sdk::InternalError::failed_parse("TableUpdate<AssetEntityBinding>", "TableUpdate")
"TableUpdate<AssetEntityBinding>", .with_cause(e)
"TableUpdate", .into()
).with_cause(e).into()
}) })
} }
#[allow(non_camel_case_types)] #[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `AssetEntityBinding`. /// Extension trait for query builder access to the table `AssetEntityBinding`.
/// ///
/// Implemented for [`__sdk::QueryTableAccessor`]. /// Implemented for [`__sdk::QueryTableAccessor`].
pub trait asset_entity_bindingQueryTableAccess { pub trait asset_entity_bindingQueryTableAccess {
#[allow(non_snake_case)] #[allow(non_snake_case)]
/// Get a query builder for the table `AssetEntityBinding`. /// Get a query builder for the table `AssetEntityBinding`.
fn asset_entity_binding(&self) -> __sdk::__query_builder::Table<AssetEntityBinding>; fn asset_entity_binding(&self) -> __sdk::__query_builder::Table<AssetEntityBinding>;
} }
impl asset_entity_bindingQueryTableAccess for __sdk::QueryTableAccessor {
fn asset_entity_binding(&self) -> __sdk::__query_builder::Table<AssetEntityBinding> {
__sdk::__query_builder::Table::new("asset_entity_binding")
}
}
impl asset_entity_bindingQueryTableAccess for __sdk::QueryTableAccessor {
fn asset_entity_binding(&self) -> __sdk::__query_builder::Table<AssetEntityBinding> {
__sdk::__query_builder::Table::new("asset_entity_binding")
}
}

View File

@@ -2,13 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)] #[sats(crate = __lib)]
@@ -19,18 +13,16 @@ pub struct AssetEntityBinding {
pub entity_id: String, pub entity_id: String,
pub slot: String, pub slot: String,
pub asset_kind: String, pub asset_kind: String,
pub owner_user_id: Option::<String>, pub owner_user_id: Option<String>,
pub profile_id: Option::<String>, pub profile_id: Option<String>,
pub created_at: __sdk::Timestamp, pub created_at: __sdk::Timestamp,
pub updated_at: __sdk::Timestamp, pub updated_at: __sdk::Timestamp,
} }
impl __sdk::InModule for AssetEntityBinding { impl __sdk::InModule for AssetEntityBinding {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }
/// Column accessor struct for the table `AssetEntityBinding`. /// Column accessor struct for the table `AssetEntityBinding`.
/// ///
/// Provides typed access to columns for query building. /// Provides typed access to columns for query building.
@@ -41,8 +33,8 @@ pub struct AssetEntityBindingCols {
pub entity_id: __sdk::__query_builder::Col<AssetEntityBinding, String>, pub entity_id: __sdk::__query_builder::Col<AssetEntityBinding, String>,
pub slot: __sdk::__query_builder::Col<AssetEntityBinding, String>, pub slot: __sdk::__query_builder::Col<AssetEntityBinding, String>,
pub asset_kind: __sdk::__query_builder::Col<AssetEntityBinding, String>, pub asset_kind: __sdk::__query_builder::Col<AssetEntityBinding, String>,
pub owner_user_id: __sdk::__query_builder::Col<AssetEntityBinding, Option::<String>>, pub owner_user_id: __sdk::__query_builder::Col<AssetEntityBinding, Option<String>>,
pub profile_id: __sdk::__query_builder::Col<AssetEntityBinding, Option::<String>>, pub profile_id: __sdk::__query_builder::Col<AssetEntityBinding, Option<String>>,
pub created_at: __sdk::__query_builder::Col<AssetEntityBinding, __sdk::Timestamp>, pub created_at: __sdk::__query_builder::Col<AssetEntityBinding, __sdk::Timestamp>,
pub updated_at: __sdk::__query_builder::Col<AssetEntityBinding, __sdk::Timestamp>, pub updated_at: __sdk::__query_builder::Col<AssetEntityBinding, __sdk::Timestamp>,
} }
@@ -61,7 +53,6 @@ impl __sdk::__query_builder::HasCols for AssetEntityBinding {
profile_id: __sdk::__query_builder::Col::new(table_name, "profile_id"), profile_id: __sdk::__query_builder::Col::new(table_name, "profile_id"),
created_at: __sdk::__query_builder::Col::new(table_name, "created_at"), created_at: __sdk::__query_builder::Col::new(table_name, "created_at"),
updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"), updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"),
} }
} }
} }
@@ -80,10 +71,8 @@ impl __sdk::__query_builder::HasIxCols for AssetEntityBinding {
AssetEntityBindingIxCols { AssetEntityBindingIxCols {
asset_object_id: __sdk::__query_builder::IxCol::new(table_name, "asset_object_id"), asset_object_id: __sdk::__query_builder::IxCol::new(table_name, "asset_object_id"),
binding_id: __sdk::__query_builder::IxCol::new(table_name, "binding_id"), binding_id: __sdk::__query_builder::IxCol::new(table_name, "binding_id"),
} }
} }
} }
impl __sdk::__query_builder::CanBeLookupTable for AssetEntityBinding {} impl __sdk::__query_builder::CanBeLookupTable for AssetEntityBinding {}

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)] #[sats(crate = __lib)]
@@ -16,12 +11,8 @@ pub enum AssetObjectAccessPolicy {
Private, Private,
PublicRead, PublicRead,
} }
impl __sdk::InModule for AssetObjectAccessPolicy { impl __sdk::InModule for AssetObjectAccessPolicy {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
use super::asset_object_upsert_snapshot_type::AssetObjectUpsertSnapshot; use super::asset_object_upsert_snapshot_type::AssetObjectUpsertSnapshot;
@@ -15,12 +10,10 @@ use super::asset_object_upsert_snapshot_type::AssetObjectUpsertSnapshot;
#[sats(crate = __lib)] #[sats(crate = __lib)]
pub struct AssetObjectProcedureResult { pub struct AssetObjectProcedureResult {
pub ok: bool, pub ok: bool,
pub record: Option::<AssetObjectUpsertSnapshot>, pub record: Option<AssetObjectUpsertSnapshot>,
pub error_message: Option::<String>, pub error_message: Option<String>,
} }
impl __sdk::InModule for AssetObjectProcedureResult { impl __sdk::InModule for AssetObjectProcedureResult {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,14 +2,9 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{
self as __sdk,
__lib,
__sats,
__ws,
};
use super::asset_object_type::AssetObject;
use super::asset_object_access_policy_type::AssetObjectAccessPolicy; 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`. /// Table handle for the table `asset_object`.
/// ///
@@ -50,8 +45,12 @@ impl<'ctx> __sdk::Table for AssetObjectTableHandle<'ctx> {
type Row = AssetObject; type Row = AssetObject;
type EventContext = super::EventContext; type EventContext = super::EventContext;
fn count(&self) -> u64 { self.imp.count() } fn count(&self) -> u64 {
fn iter(&self) -> impl Iterator<Item = AssetObject> + '_ { self.imp.iter() } self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = AssetObject> + '_ {
self.imp.iter()
}
type InsertCallbackId = AssetObjectInsertCallbackId; 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`, /// Access to the `asset_object_id` unique index on the table `asset_object`,
/// which allows point queries on the field of the same name /// which allows point queries on the field of the same name
/// via the [`AssetObjectAssetObjectIdUnique::find`] method. /// via the [`AssetObjectAssetObjectIdUnique::find`] method.
/// ///
/// Users are encouraged not to explicitly reference this type, /// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls, /// but to directly chain method calls,
/// like `ctx.db.asset_object().asset_object_id().find(...)`. /// like `ctx.db.asset_object().asset_object_id().find(...)`.
pub struct AssetObjectAssetObjectIdUnique<'ctx> { pub struct AssetObjectAssetObjectIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<AssetObject, String>, imp: __sdk::UniqueConstraintHandle<AssetObject, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
} }
impl<'ctx> AssetObjectTableHandle<'ctx> { impl<'ctx> AssetObjectTableHandle<'ctx> {
/// Get a handle on the `asset_object_id` unique index on the table `asset_object`. /// Get a handle on the `asset_object_id` unique index on the table `asset_object`.
pub fn asset_object_id(&self) -> AssetObjectAssetObjectIdUnique<'ctx> { pub fn asset_object_id(&self) -> AssetObjectAssetObjectIdUnique<'ctx> {
AssetObjectAssetObjectIdUnique { AssetObjectAssetObjectIdUnique {
imp: self.imp.get_unique_constraint::<String>("asset_object_id"), imp: self.imp.get_unique_constraint::<String>("asset_object_id"),
phantom: std::marker::PhantomData, phantom: std::marker::PhantomData,
}
}
} }
}
}
impl<'ctx> AssetObjectAssetObjectIdUnique<'ctx> { impl<'ctx> AssetObjectAssetObjectIdUnique<'ctx> {
/// Find the subscribed row whose `asset_object_id` column value is equal to `col_val`, /// 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. /// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<AssetObject> { pub fn find(&self, col_val: &String) -> Option<AssetObject> {
self.imp.find(col_val) self.imp.find(col_val)
} }
} }
#[doc(hidden)] #[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) { pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<AssetObject>("asset_object"); let _table = client_cache.get_or_make_table::<AssetObject>("asset_object");
_table.add_unique_constraint::<String>("asset_object_id", |row| &row.asset_object_id); _table.add_unique_constraint::<String>("asset_object_id", |row| &row.asset_object_id);
} }
@@ -139,26 +137,24 @@ pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate, raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<AssetObject>> { ) -> __sdk::Result<__sdk::TableUpdate<AssetObject>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse( __sdk::InternalError::failed_parse("TableUpdate<AssetObject>", "TableUpdate")
"TableUpdate<AssetObject>", .with_cause(e)
"TableUpdate", .into()
).with_cause(e).into()
}) })
} }
#[allow(non_camel_case_types)] #[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `AssetObject`. /// Extension trait for query builder access to the table `AssetObject`.
/// ///
/// Implemented for [`__sdk::QueryTableAccessor`]. /// Implemented for [`__sdk::QueryTableAccessor`].
pub trait asset_objectQueryTableAccess { pub trait asset_objectQueryTableAccess {
#[allow(non_snake_case)] #[allow(non_snake_case)]
/// Get a query builder for the table `AssetObject`. /// Get a query builder for the table `AssetObject`.
fn asset_object(&self) -> __sdk::__query_builder::Table<AssetObject>; fn asset_object(&self) -> __sdk::__query_builder::Table<AssetObject>;
} }
impl asset_objectQueryTableAccess for __sdk::QueryTableAccessor {
fn asset_object(&self) -> __sdk::__query_builder::Table<AssetObject> {
__sdk::__query_builder::Table::new("asset_object")
}
}
impl asset_objectQueryTableAccess for __sdk::QueryTableAccessor {
fn asset_object(&self) -> __sdk::__query_builder::Table<AssetObject> {
__sdk::__query_builder::Table::new("asset_object")
}
}

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
use super::asset_object_access_policy_type::AssetObjectAccessPolicy; use super::asset_object_access_policy_type::AssetObjectAccessPolicy;
@@ -18,25 +13,23 @@ pub struct AssetObject {
pub bucket: String, pub bucket: String,
pub object_key: String, pub object_key: String,
pub access_policy: AssetObjectAccessPolicy, pub access_policy: AssetObjectAccessPolicy,
pub content_type: Option::<String>, pub content_type: Option<String>,
pub content_length: u64, pub content_length: u64,
pub content_hash: Option::<String>, pub content_hash: Option<String>,
pub version: u32, pub version: u32,
pub source_job_id: Option::<String>, pub source_job_id: Option<String>,
pub owner_user_id: Option::<String>, pub owner_user_id: Option<String>,
pub profile_id: Option::<String>, pub profile_id: Option<String>,
pub entity_id: Option::<String>, pub entity_id: Option<String>,
pub asset_kind: String, pub asset_kind: String,
pub created_at: __sdk::Timestamp, pub created_at: __sdk::Timestamp,
pub updated_at: __sdk::Timestamp, pub updated_at: __sdk::Timestamp,
} }
impl __sdk::InModule for AssetObject { impl __sdk::InModule for AssetObject {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }
/// Column accessor struct for the table `AssetObject`. /// Column accessor struct for the table `AssetObject`.
/// ///
/// Provides typed access to columns for query building. /// Provides typed access to columns for query building.
@@ -45,14 +38,14 @@ pub struct AssetObjectCols {
pub bucket: __sdk::__query_builder::Col<AssetObject, String>, pub bucket: __sdk::__query_builder::Col<AssetObject, String>,
pub object_key: __sdk::__query_builder::Col<AssetObject, String>, pub object_key: __sdk::__query_builder::Col<AssetObject, String>,
pub access_policy: __sdk::__query_builder::Col<AssetObject, AssetObjectAccessPolicy>, pub access_policy: __sdk::__query_builder::Col<AssetObject, AssetObjectAccessPolicy>,
pub content_type: __sdk::__query_builder::Col<AssetObject, Option::<String>>, pub content_type: __sdk::__query_builder::Col<AssetObject, Option<String>>,
pub content_length: __sdk::__query_builder::Col<AssetObject, u64>, pub content_length: __sdk::__query_builder::Col<AssetObject, u64>,
pub content_hash: __sdk::__query_builder::Col<AssetObject, Option::<String>>, pub content_hash: __sdk::__query_builder::Col<AssetObject, Option<String>>,
pub version: __sdk::__query_builder::Col<AssetObject, u32>, pub version: __sdk::__query_builder::Col<AssetObject, u32>,
pub source_job_id: __sdk::__query_builder::Col<AssetObject, Option::<String>>, pub source_job_id: __sdk::__query_builder::Col<AssetObject, Option<String>>,
pub owner_user_id: __sdk::__query_builder::Col<AssetObject, Option::<String>>, pub owner_user_id: __sdk::__query_builder::Col<AssetObject, Option<String>>,
pub profile_id: __sdk::__query_builder::Col<AssetObject, Option::<String>>, pub profile_id: __sdk::__query_builder::Col<AssetObject, Option<String>>,
pub entity_id: __sdk::__query_builder::Col<AssetObject, Option::<String>>, pub entity_id: __sdk::__query_builder::Col<AssetObject, Option<String>>,
pub asset_kind: __sdk::__query_builder::Col<AssetObject, String>, pub asset_kind: __sdk::__query_builder::Col<AssetObject, String>,
pub created_at: __sdk::__query_builder::Col<AssetObject, __sdk::Timestamp>, pub created_at: __sdk::__query_builder::Col<AssetObject, __sdk::Timestamp>,
pub updated_at: __sdk::__query_builder::Col<AssetObject, __sdk::Timestamp>, pub updated_at: __sdk::__query_builder::Col<AssetObject, __sdk::Timestamp>,
@@ -77,7 +70,6 @@ impl __sdk::__query_builder::HasCols for AssetObject {
asset_kind: __sdk::__query_builder::Col::new(table_name, "asset_kind"), asset_kind: __sdk::__query_builder::Col::new(table_name, "asset_kind"),
created_at: __sdk::__query_builder::Col::new(table_name, "created_at"), created_at: __sdk::__query_builder::Col::new(table_name, "created_at"),
updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"), updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"),
} }
} }
} }
@@ -96,10 +88,8 @@ impl __sdk::__query_builder::HasIxCols for AssetObject {
AssetObjectIxCols { AssetObjectIxCols {
asset_kind: __sdk::__query_builder::IxCol::new(table_name, "asset_kind"), asset_kind: __sdk::__query_builder::IxCol::new(table_name, "asset_kind"),
asset_object_id: __sdk::__query_builder::IxCol::new(table_name, "asset_object_id"), asset_object_id: __sdk::__query_builder::IxCol::new(table_name, "asset_object_id"),
} }
} }
} }
impl __sdk::__query_builder::CanBeLookupTable for AssetObject {} impl __sdk::__query_builder::CanBeLookupTable for AssetObject {}

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
use super::asset_object_access_policy_type::AssetObjectAccessPolicy; use super::asset_object_access_policy_type::AssetObjectAccessPolicy;
@@ -18,20 +13,18 @@ pub struct AssetObjectUpsertInput {
pub bucket: String, pub bucket: String,
pub object_key: String, pub object_key: String,
pub access_policy: AssetObjectAccessPolicy, pub access_policy: AssetObjectAccessPolicy,
pub content_type: Option::<String>, pub content_type: Option<String>,
pub content_length: u64, pub content_length: u64,
pub content_hash: Option::<String>, pub content_hash: Option<String>,
pub version: u32, pub version: u32,
pub source_job_id: Option::<String>, pub source_job_id: Option<String>,
pub owner_user_id: Option::<String>, pub owner_user_id: Option<String>,
pub profile_id: Option::<String>, pub profile_id: Option<String>,
pub entity_id: Option::<String>, pub entity_id: Option<String>,
pub asset_kind: String, pub asset_kind: String,
pub updated_at_micros: i64, pub updated_at_micros: i64,
} }
impl __sdk::InModule for AssetObjectUpsertInput { impl __sdk::InModule for AssetObjectUpsertInput {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
use super::asset_object_access_policy_type::AssetObjectAccessPolicy; use super::asset_object_access_policy_type::AssetObjectAccessPolicy;
@@ -18,21 +13,19 @@ pub struct AssetObjectUpsertSnapshot {
pub bucket: String, pub bucket: String,
pub object_key: String, pub object_key: String,
pub access_policy: AssetObjectAccessPolicy, pub access_policy: AssetObjectAccessPolicy,
pub content_type: Option::<String>, pub content_type: Option<String>,
pub content_length: u64, pub content_length: u64,
pub content_hash: Option::<String>, pub content_hash: Option<String>,
pub version: u32, pub version: u32,
pub source_job_id: Option::<String>, pub source_job_id: Option<String>,
pub owner_user_id: Option::<String>, pub owner_user_id: Option<String>,
pub profile_id: Option::<String>, pub profile_id: Option<String>,
pub entity_id: Option::<String>, pub entity_id: Option<String>,
pub asset_kind: String, pub asset_kind: String,
pub created_at_micros: i64, pub created_at_micros: i64,
pub updated_at_micros: i64, pub updated_at_micros: i64,
} }
impl __sdk::InModule for AssetObjectUpsertSnapshot { impl __sdk::InModule for AssetObjectUpsertSnapshot {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,23 +2,17 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
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_result_reference_input_type::AiResultReferenceInput;
use super::ai_task_procedure_result_type::AiTaskProcedureResult;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)] #[sats(crate = __lib)]
struct AttachAiResultReferenceAndReturnArgs { struct AttachAiResultReferenceAndReturnArgs {
pub input: AiResultReferenceInput, pub input: AiResultReferenceInput,
} }
impl __sdk::InModule for AttachAiResultReferenceAndReturnArgs { impl __sdk::InModule for AttachAiResultReferenceAndReturnArgs {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }
@@ -28,16 +22,19 @@ impl __sdk::InModule for AttachAiResultReferenceAndReturnArgs {
/// ///
/// Implemented for [`super::RemoteProcedures`]. /// Implemented for [`super::RemoteProcedures`].
pub trait attach_ai_result_reference_and_return { pub trait attach_ai_result_reference_and_return {
fn attach_ai_result_reference_and_return(&self, input: AiResultReferenceInput, fn attach_ai_result_reference_and_return(&self, input: AiResultReferenceInput) {
) { self.attach_ai_result_reference_and_return_then(input, |_, _| {});
self.attach_ai_result_reference_and_return_then(input, |_, _| {});
} }
fn attach_ai_result_reference_and_return_then( fn attach_ai_result_reference_and_return_then(
&self, &self,
input: AiResultReferenceInput, input: AiResultReferenceInput,
__callback: impl FnOnce(&super::ProcedureEventContext, Result<AiTaskProcedureResult, __sdk::InternalError>) + Send + 'static, __callback: impl FnOnce(
&super::ProcedureEventContext,
Result<AiTaskProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
); );
} }
@@ -46,13 +43,17 @@ impl attach_ai_result_reference_and_return for super::RemoteProcedures {
&self, &self,
input: AiResultReferenceInput, input: AiResultReferenceInput,
__callback: impl FnOnce(&super::ProcedureEventContext, Result<AiTaskProcedureResult, __sdk::InternalError>) + Send + 'static, __callback: impl FnOnce(
&super::ProcedureEventContext,
Result<AiTaskProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) { ) {
self.imp.invoke_procedure_with_callback::<_, AiTaskProcedureResult>( self.imp
"attach_ai_result_reference_and_return", .invoke_procedure_with_callback::<_, AiTaskProcedureResult>(
AttachAiResultReferenceAndReturnArgs { input, }, "attach_ai_result_reference_and_return",
__callback, AttachAiResultReferenceAndReturnArgs { input },
); __callback,
);
} }
} }

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)] #[sats(crate = __lib)]
@@ -16,12 +11,8 @@ pub enum BattleMode {
Fight, Fight,
Spar, Spar,
} }
impl __sdk::InModule for BattleMode { impl __sdk::InModule for BattleMode {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
use super::battle_mode_type::BattleMode; use super::battle_mode_type::BattleMode;
use super::runtime_item_reward_item_snapshot_type::RuntimeItemRewardItemSnapshot; use super::runtime_item_reward_item_snapshot_type::RuntimeItemRewardItemSnapshot;
@@ -19,7 +14,7 @@ pub struct BattleStateInput {
pub story_session_id: String, pub story_session_id: String,
pub runtime_session_id: String, pub runtime_session_id: String,
pub actor_user_id: String, pub actor_user_id: String,
pub chapter_id: Option::<String>, pub chapter_id: Option<String>,
pub target_npc_id: String, pub target_npc_id: String,
pub target_name: String, pub target_name: String,
pub battle_mode: BattleMode, pub battle_mode: BattleMode,
@@ -30,12 +25,10 @@ pub struct BattleStateInput {
pub target_hp: i32, pub target_hp: i32,
pub target_max_hp: i32, pub target_max_hp: i32,
pub experience_reward: u32, pub experience_reward: u32,
pub reward_items: Vec::<RuntimeItemRewardItemSnapshot>, pub reward_items: Vec<RuntimeItemRewardItemSnapshot>,
pub created_at_micros: i64, pub created_at_micros: i64,
} }
impl __sdk::InModule for BattleStateInput { impl __sdk::InModule for BattleStateInput {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
use super::battle_state_snapshot_type::BattleStateSnapshot; use super::battle_state_snapshot_type::BattleStateSnapshot;
@@ -15,12 +10,10 @@ use super::battle_state_snapshot_type::BattleStateSnapshot;
#[sats(crate = __lib)] #[sats(crate = __lib)]
pub struct BattleStateProcedureResult { pub struct BattleStateProcedureResult {
pub ok: bool, pub ok: bool,
pub snapshot: Option::<BattleStateSnapshot>, pub snapshot: Option<BattleStateSnapshot>,
pub error_message: Option::<String>, pub error_message: Option<String>,
} }
impl __sdk::InModule for BattleStateProcedureResult { impl __sdk::InModule for BattleStateProcedureResult {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,13 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)] #[sats(crate = __lib)]
@@ -16,8 +10,6 @@ pub struct BattleStateQueryInput {
pub battle_state_id: String, pub battle_state_id: String,
} }
impl __sdk::InModule for BattleStateQueryInput { impl __sdk::InModule for BattleStateQueryInput {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,17 +2,12 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
use super::battle_mode_type::BattleMode; use super::battle_mode_type::BattleMode;
use super::battle_status_type::BattleStatus; use super::battle_status_type::BattleStatus;
use super::runtime_item_reward_item_snapshot_type::RuntimeItemRewardItemSnapshot;
use super::combat_outcome_type::CombatOutcome; 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)] #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)] #[sats(crate = __lib)]
@@ -21,7 +16,7 @@ pub struct BattleStateSnapshot {
pub story_session_id: String, pub story_session_id: String,
pub runtime_session_id: String, pub runtime_session_id: String,
pub actor_user_id: String, pub actor_user_id: String,
pub chapter_id: Option::<String>, pub chapter_id: Option<String>,
pub target_npc_id: String, pub target_npc_id: String,
pub target_name: String, pub target_name: String,
pub battle_mode: BattleMode, pub battle_mode: BattleMode,
@@ -33,11 +28,11 @@ pub struct BattleStateSnapshot {
pub target_hp: i32, pub target_hp: i32,
pub target_max_hp: i32, pub target_max_hp: i32,
pub experience_reward: u32, pub experience_reward: u32,
pub reward_items: Vec::<RuntimeItemRewardItemSnapshot>, pub reward_items: Vec<RuntimeItemRewardItemSnapshot>,
pub turn_index: u32, pub turn_index: u32,
pub last_action_function_id: Option::<String>, pub last_action_function_id: Option<String>,
pub last_action_text: Option::<String>, pub last_action_text: Option<String>,
pub last_result_text: Option::<String>, pub last_result_text: Option<String>,
pub last_damage_dealt: i32, pub last_damage_dealt: i32,
pub last_damage_taken: i32, pub last_damage_taken: i32,
pub last_outcome: CombatOutcome, pub last_outcome: CombatOutcome,
@@ -46,8 +41,6 @@ pub struct BattleStateSnapshot {
pub updated_at_micros: i64, pub updated_at_micros: i64,
} }
impl __sdk::InModule for BattleStateSnapshot { impl __sdk::InModule for BattleStateSnapshot {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,17 +2,12 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{
self as __sdk,
__lib,
__sats,
__ws,
};
use super::battle_state_type::BattleState;
use super::battle_mode_type::BattleMode; use super::battle_mode_type::BattleMode;
use super::battle_state_type::BattleState;
use super::battle_status_type::BattleStatus; use super::battle_status_type::BattleStatus;
use super::runtime_item_reward_item_snapshot_type::RuntimeItemRewardItemSnapshot;
use super::combat_outcome_type::CombatOutcome; 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`. /// Table handle for the table `battle_state`.
/// ///
@@ -53,8 +48,12 @@ impl<'ctx> __sdk::Table for BattleStateTableHandle<'ctx> {
type Row = BattleState; type Row = BattleState;
type EventContext = super::EventContext; type EventContext = super::EventContext;
fn count(&self) -> u64 { self.imp.count() } fn count(&self) -> u64 {
fn iter(&self) -> impl Iterator<Item = BattleState> + '_ { self.imp.iter() } self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = BattleState> + '_ {
self.imp.iter()
}
type InsertCallbackId = BattleStateInsertCallbackId; 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`, /// Access to the `battle_state_id` unique index on the table `battle_state`,
/// which allows point queries on the field of the same name /// which allows point queries on the field of the same name
/// via the [`BattleStateBattleStateIdUnique::find`] method. /// via the [`BattleStateBattleStateIdUnique::find`] method.
/// ///
/// Users are encouraged not to explicitly reference this type, /// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls, /// but to directly chain method calls,
/// like `ctx.db.battle_state().battle_state_id().find(...)`. /// like `ctx.db.battle_state().battle_state_id().find(...)`.
pub struct BattleStateBattleStateIdUnique<'ctx> { pub struct BattleStateBattleStateIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<BattleState, String>, imp: __sdk::UniqueConstraintHandle<BattleState, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
} }
impl<'ctx> BattleStateTableHandle<'ctx> { impl<'ctx> BattleStateTableHandle<'ctx> {
/// Get a handle on the `battle_state_id` unique index on the table `battle_state`. /// Get a handle on the `battle_state_id` unique index on the table `battle_state`.
pub fn battle_state_id(&self) -> BattleStateBattleStateIdUnique<'ctx> { pub fn battle_state_id(&self) -> BattleStateBattleStateIdUnique<'ctx> {
BattleStateBattleStateIdUnique { BattleStateBattleStateIdUnique {
imp: self.imp.get_unique_constraint::<String>("battle_state_id"), imp: self.imp.get_unique_constraint::<String>("battle_state_id"),
phantom: std::marker::PhantomData, phantom: std::marker::PhantomData,
}
}
} }
}
}
impl<'ctx> BattleStateBattleStateIdUnique<'ctx> { impl<'ctx> BattleStateBattleStateIdUnique<'ctx> {
/// Find the subscribed row whose `battle_state_id` column value is equal to `col_val`, /// 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. /// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<BattleState> { pub fn find(&self, col_val: &String) -> Option<BattleState> {
self.imp.find(col_val) self.imp.find(col_val)
} }
} }
#[doc(hidden)] #[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) { pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<BattleState>("battle_state"); let _table = client_cache.get_or_make_table::<BattleState>("battle_state");
_table.add_unique_constraint::<String>("battle_state_id", |row| &row.battle_state_id); _table.add_unique_constraint::<String>("battle_state_id", |row| &row.battle_state_id);
} }
@@ -142,26 +140,24 @@ pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate, raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<BattleState>> { ) -> __sdk::Result<__sdk::TableUpdate<BattleState>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse( __sdk::InternalError::failed_parse("TableUpdate<BattleState>", "TableUpdate")
"TableUpdate<BattleState>", .with_cause(e)
"TableUpdate", .into()
).with_cause(e).into()
}) })
} }
#[allow(non_camel_case_types)] #[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `BattleState`. /// Extension trait for query builder access to the table `BattleState`.
/// ///
/// Implemented for [`__sdk::QueryTableAccessor`]. /// Implemented for [`__sdk::QueryTableAccessor`].
pub trait battle_stateQueryTableAccess { pub trait battle_stateQueryTableAccess {
#[allow(non_snake_case)] #[allow(non_snake_case)]
/// Get a query builder for the table `BattleState`. /// Get a query builder for the table `BattleState`.
fn battle_state(&self) -> __sdk::__query_builder::Table<BattleState>; fn battle_state(&self) -> __sdk::__query_builder::Table<BattleState>;
} }
impl battle_stateQueryTableAccess for __sdk::QueryTableAccessor {
fn battle_state(&self) -> __sdk::__query_builder::Table<BattleState> {
__sdk::__query_builder::Table::new("battle_state")
}
}
impl battle_stateQueryTableAccess for __sdk::QueryTableAccessor {
fn battle_state(&self) -> __sdk::__query_builder::Table<BattleState> {
__sdk::__query_builder::Table::new("battle_state")
}
}

View File

@@ -2,17 +2,12 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
use super::battle_mode_type::BattleMode; use super::battle_mode_type::BattleMode;
use super::battle_status_type::BattleStatus; use super::battle_status_type::BattleStatus;
use super::runtime_item_reward_item_snapshot_type::RuntimeItemRewardItemSnapshot;
use super::combat_outcome_type::CombatOutcome; 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)] #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)] #[sats(crate = __lib)]
@@ -21,7 +16,7 @@ pub struct BattleState {
pub story_session_id: String, pub story_session_id: String,
pub runtime_session_id: String, pub runtime_session_id: String,
pub actor_user_id: String, pub actor_user_id: String,
pub chapter_id: Option::<String>, pub chapter_id: Option<String>,
pub target_npc_id: String, pub target_npc_id: String,
pub target_name: String, pub target_name: String,
pub battle_mode: BattleMode, pub battle_mode: BattleMode,
@@ -33,11 +28,11 @@ pub struct BattleState {
pub target_hp: i32, pub target_hp: i32,
pub target_max_hp: i32, pub target_max_hp: i32,
pub experience_reward: u32, pub experience_reward: u32,
pub reward_items: Vec::<RuntimeItemRewardItemSnapshot>, pub reward_items: Vec<RuntimeItemRewardItemSnapshot>,
pub turn_index: u32, pub turn_index: u32,
pub last_action_function_id: Option::<String>, pub last_action_function_id: Option<String>,
pub last_action_text: Option::<String>, pub last_action_text: Option<String>,
pub last_result_text: Option::<String>, pub last_result_text: Option<String>,
pub last_damage_dealt: i32, pub last_damage_dealt: i32,
pub last_damage_taken: i32, pub last_damage_taken: i32,
pub last_outcome: CombatOutcome, pub last_outcome: CombatOutcome,
@@ -46,12 +41,10 @@ pub struct BattleState {
pub updated_at: __sdk::Timestamp, pub updated_at: __sdk::Timestamp,
} }
impl __sdk::InModule for BattleState { impl __sdk::InModule for BattleState {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }
/// Column accessor struct for the table `BattleState`. /// Column accessor struct for the table `BattleState`.
/// ///
/// Provides typed access to columns for query building. /// Provides typed access to columns for query building.
@@ -60,7 +53,7 @@ pub struct BattleStateCols {
pub story_session_id: __sdk::__query_builder::Col<BattleState, String>, pub story_session_id: __sdk::__query_builder::Col<BattleState, String>,
pub runtime_session_id: __sdk::__query_builder::Col<BattleState, String>, pub runtime_session_id: __sdk::__query_builder::Col<BattleState, String>,
pub actor_user_id: __sdk::__query_builder::Col<BattleState, String>, pub actor_user_id: __sdk::__query_builder::Col<BattleState, String>,
pub chapter_id: __sdk::__query_builder::Col<BattleState, Option::<String>>, pub chapter_id: __sdk::__query_builder::Col<BattleState, Option<String>>,
pub target_npc_id: __sdk::__query_builder::Col<BattleState, String>, pub target_npc_id: __sdk::__query_builder::Col<BattleState, String>,
pub target_name: __sdk::__query_builder::Col<BattleState, String>, pub target_name: __sdk::__query_builder::Col<BattleState, String>,
pub battle_mode: __sdk::__query_builder::Col<BattleState, BattleMode>, pub battle_mode: __sdk::__query_builder::Col<BattleState, BattleMode>,
@@ -72,11 +65,11 @@ pub struct BattleStateCols {
pub target_hp: __sdk::__query_builder::Col<BattleState, i32>, pub target_hp: __sdk::__query_builder::Col<BattleState, i32>,
pub target_max_hp: __sdk::__query_builder::Col<BattleState, i32>, pub target_max_hp: __sdk::__query_builder::Col<BattleState, i32>,
pub experience_reward: __sdk::__query_builder::Col<BattleState, u32>, pub experience_reward: __sdk::__query_builder::Col<BattleState, u32>,
pub reward_items: __sdk::__query_builder::Col<BattleState, Vec::<RuntimeItemRewardItemSnapshot>>, pub reward_items: __sdk::__query_builder::Col<BattleState, Vec<RuntimeItemRewardItemSnapshot>>,
pub turn_index: __sdk::__query_builder::Col<BattleState, u32>, pub turn_index: __sdk::__query_builder::Col<BattleState, u32>,
pub last_action_function_id: __sdk::__query_builder::Col<BattleState, Option::<String>>, pub last_action_function_id: __sdk::__query_builder::Col<BattleState, Option<String>>,
pub last_action_text: __sdk::__query_builder::Col<BattleState, Option::<String>>, pub last_action_text: __sdk::__query_builder::Col<BattleState, Option<String>>,
pub last_result_text: __sdk::__query_builder::Col<BattleState, Option::<String>>, pub last_result_text: __sdk::__query_builder::Col<BattleState, Option<String>>,
pub last_damage_dealt: __sdk::__query_builder::Col<BattleState, i32>, pub last_damage_dealt: __sdk::__query_builder::Col<BattleState, i32>,
pub last_damage_taken: __sdk::__query_builder::Col<BattleState, i32>, pub last_damage_taken: __sdk::__query_builder::Col<BattleState, i32>,
pub last_outcome: __sdk::__query_builder::Col<BattleState, CombatOutcome>, pub last_outcome: __sdk::__query_builder::Col<BattleState, CombatOutcome>,
@@ -107,7 +100,10 @@ impl __sdk::__query_builder::HasCols for BattleState {
experience_reward: __sdk::__query_builder::Col::new(table_name, "experience_reward"), experience_reward: __sdk::__query_builder::Col::new(table_name, "experience_reward"),
reward_items: __sdk::__query_builder::Col::new(table_name, "reward_items"), reward_items: __sdk::__query_builder::Col::new(table_name, "reward_items"),
turn_index: __sdk::__query_builder::Col::new(table_name, "turn_index"), turn_index: __sdk::__query_builder::Col::new(table_name, "turn_index"),
last_action_function_id: __sdk::__query_builder::Col::new(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_action_text: __sdk::__query_builder::Col::new(table_name, "last_action_text"),
last_result_text: __sdk::__query_builder::Col::new(table_name, "last_result_text"), last_result_text: __sdk::__query_builder::Col::new(table_name, "last_result_text"),
last_damage_dealt: __sdk::__query_builder::Col::new(table_name, "last_damage_dealt"), last_damage_dealt: __sdk::__query_builder::Col::new(table_name, "last_damage_dealt"),
@@ -116,7 +112,6 @@ impl __sdk::__query_builder::HasCols for BattleState {
version: __sdk::__query_builder::Col::new(table_name, "version"), version: __sdk::__query_builder::Col::new(table_name, "version"),
created_at: __sdk::__query_builder::Col::new(table_name, "created_at"), created_at: __sdk::__query_builder::Col::new(table_name, "created_at"),
updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"), updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"),
} }
} }
} }
@@ -137,12 +132,13 @@ impl __sdk::__query_builder::HasIxCols for BattleState {
BattleStateIxCols { BattleStateIxCols {
actor_user_id: __sdk::__query_builder::IxCol::new(table_name, "actor_user_id"), actor_user_id: __sdk::__query_builder::IxCol::new(table_name, "actor_user_id"),
battle_state_id: __sdk::__query_builder::IxCol::new(table_name, "battle_state_id"), battle_state_id: __sdk::__query_builder::IxCol::new(table_name, "battle_state_id"),
runtime_session_id: __sdk::__query_builder::IxCol::new(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"), story_session_id: __sdk::__query_builder::IxCol::new(table_name, "story_session_id"),
} }
} }
} }
impl __sdk::__query_builder::CanBeLookupTable for BattleState {} impl __sdk::__query_builder::CanBeLookupTable for BattleState {}

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)] #[sats(crate = __lib)]
@@ -18,12 +13,8 @@ pub enum BattleStatus {
Resolved, Resolved,
Aborted, Aborted,
} }
impl __sdk::InModule for BattleStatus { impl __sdk::InModule for BattleStatus {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,23 +2,17 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
use super::story_session_input_type::StorySessionInput; use super::story_session_input_type::StorySessionInput;
use super::story_session_procedure_result_type::StorySessionProcedureResult; use super::story_session_procedure_result_type::StorySessionProcedureResult;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)] #[sats(crate = __lib)]
struct BeginStorySessionAndReturnArgs { struct BeginStorySessionAndReturnArgs {
pub input: StorySessionInput, pub input: StorySessionInput,
} }
impl __sdk::InModule for BeginStorySessionAndReturnArgs { impl __sdk::InModule for BeginStorySessionAndReturnArgs {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }
@@ -28,16 +22,19 @@ impl __sdk::InModule for BeginStorySessionAndReturnArgs {
/// ///
/// Implemented for [`super::RemoteProcedures`]. /// Implemented for [`super::RemoteProcedures`].
pub trait begin_story_session_and_return { pub trait begin_story_session_and_return {
fn begin_story_session_and_return(&self, input: StorySessionInput, fn begin_story_session_and_return(&self, input: StorySessionInput) {
) { self.begin_story_session_and_return_then(input, |_, _| {});
self.begin_story_session_and_return_then(input, |_, _| {});
} }
fn begin_story_session_and_return_then( fn begin_story_session_and_return_then(
&self, &self,
input: StorySessionInput, input: StorySessionInput,
__callback: impl FnOnce(&super::ProcedureEventContext, Result<StorySessionProcedureResult, __sdk::InternalError>) + Send + 'static, __callback: impl FnOnce(
&super::ProcedureEventContext,
Result<StorySessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
); );
} }
@@ -46,13 +43,17 @@ impl begin_story_session_and_return for super::RemoteProcedures {
&self, &self,
input: StorySessionInput, input: StorySessionInput,
__callback: impl FnOnce(&super::ProcedureEventContext, Result<StorySessionProcedureResult, __sdk::InternalError>) + Send + 'static, __callback: impl FnOnce(
&super::ProcedureEventContext,
Result<StorySessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) { ) {
self.imp.invoke_procedure_with_callback::<_, StorySessionProcedureResult>( self.imp
"begin_story_session_and_return", .invoke_procedure_with_callback::<_, StorySessionProcedureResult>(
BeginStorySessionAndReturnArgs { input, }, "begin_story_session_and_return",
__callback, BeginStorySessionAndReturnArgs { input },
); __callback,
);
} }
} }

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
use super::story_session_input_type::StorySessionInput; use super::story_session_input_type::StorySessionInput;
@@ -19,10 +14,8 @@ pub(super) struct BeginStorySessionArgs {
impl From<BeginStorySessionArgs> for super::Reducer { impl From<BeginStorySessionArgs> for super::Reducer {
fn from(args: BeginStorySessionArgs) -> Self { fn from(args: BeginStorySessionArgs) -> Self {
Self::BeginStorySession { Self::BeginStorySession { input: args.input }
input: args.input, }
}
}
} }
impl __sdk::InModule for BeginStorySessionArgs { impl __sdk::InModule for BeginStorySessionArgs {
@@ -40,9 +33,8 @@ pub trait begin_story_session {
/// The reducer will run asynchronously in the future, /// The reducer will run asynchronously in the future,
/// and this method provides no way to listen for its completion status. /// and this method provides no way to listen for its completion status.
/// /// Use [`begin_story_session:begin_story_session_then`] to run a callback after the reducer completes. /// /// Use [`begin_story_session:begin_story_session_then`] to run a callback after the reducer completes.
fn begin_story_session(&self, input: StorySessionInput, fn begin_story_session(&self, input: StorySessionInput) -> __sdk::Result<()> {
) -> __sdk::Result<()> { self.begin_story_session_then(input, |_, _| {})
self.begin_story_session_then(input, |_, _| {})
} }
/// Request that the remote module invoke the reducer `begin_story_session` to run as soon as possible, /// Request that the remote module invoke the reducer `begin_story_session` to run as soon as possible,
@@ -55,9 +47,11 @@ pub trait begin_story_session {
&self, &self,
input: StorySessionInput, input: StorySessionInput,
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>) callback: impl FnOnce(
+ Send &super::ReducerEventContext,
+ 'static, Result<Result<(), String>, __sdk::InternalError>,
) + Send
+ 'static,
) -> __sdk::Result<()>; ) -> __sdk::Result<()>;
} }
@@ -66,11 +60,13 @@ impl begin_story_session for super::RemoteReducers {
&self, &self,
input: StorySessionInput, input: StorySessionInput,
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>) callback: impl FnOnce(
+ Send &super::ReducerEventContext,
+ 'static, Result<Result<(), String>, __sdk::InternalError>,
) + Send
+ 'static,
) -> __sdk::Result<()> { ) -> __sdk::Result<()> {
self.imp.invoke_reducer_with_callback(BeginStorySessionArgs { input, }, callback) self.imp
.invoke_reducer_with_callback(BeginStorySessionArgs { input }, callback)
} }
} }

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)] #[sats(crate = __lib)]
@@ -20,12 +15,8 @@ pub enum BigFishAgentMessageKind {
ActionResult, ActionResult,
Warning, Warning,
} }
impl __sdk::InModule for BigFishAgentMessageKind { impl __sdk::InModule for BigFishAgentMessageKind {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)] #[sats(crate = __lib)]
@@ -18,12 +13,8 @@ pub enum BigFishAgentMessageRole {
Assistant, Assistant,
System, System,
} }
impl __sdk::InModule for BigFishAgentMessageRole { impl __sdk::InModule for BigFishAgentMessageRole {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,15 +2,10 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
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_kind_type::BigFishAgentMessageKind;
use super::big_fish_agent_message_role_type::BigFishAgentMessageRole;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)] #[sats(crate = __lib)]
@@ -23,8 +18,6 @@ pub struct BigFishAgentMessageSnapshot {
pub created_at_micros: i64, pub created_at_micros: i64,
} }
impl __sdk::InModule for BigFishAgentMessageSnapshot { impl __sdk::InModule for BigFishAgentMessageSnapshot {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,15 +2,10 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{
self as __sdk,
__lib,
__sats,
__ws,
};
use super::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_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`. /// Table handle for the table `big_fish_agent_message`.
/// ///
@@ -38,7 +33,9 @@ pub trait BigFishAgentMessageTableAccess {
impl BigFishAgentMessageTableAccess for super::RemoteTables { impl BigFishAgentMessageTableAccess for super::RemoteTables {
fn big_fish_agent_message(&self) -> BigFishAgentMessageTableHandle<'_> { fn big_fish_agent_message(&self) -> BigFishAgentMessageTableHandle<'_> {
BigFishAgentMessageTableHandle { BigFishAgentMessageTableHandle {
imp: self.imp.get_table::<BigFishAgentMessage>("big_fish_agent_message"), imp: self
.imp
.get_table::<BigFishAgentMessage>("big_fish_agent_message"),
ctx: std::marker::PhantomData, ctx: std::marker::PhantomData,
} }
} }
@@ -51,8 +48,12 @@ impl<'ctx> __sdk::Table for BigFishAgentMessageTableHandle<'ctx> {
type Row = BigFishAgentMessage; type Row = BigFishAgentMessage;
type EventContext = super::EventContext; type EventContext = super::EventContext;
fn count(&self) -> u64 { self.imp.count() } fn count(&self) -> u64 {
fn iter(&self) -> impl Iterator<Item = BigFishAgentMessage> + '_ { self.imp.iter() } self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = BigFishAgentMessage> + '_ {
self.imp.iter()
}
type InsertCallbackId = BigFishAgentMessageInsertCallbackId; 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`, /// 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 /// which allows point queries on the field of the same name
/// via the [`BigFishAgentMessageMessageIdUnique::find`] method. /// via the [`BigFishAgentMessageMessageIdUnique::find`] method.
/// ///
/// Users are encouraged not to explicitly reference this type, /// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls, /// but to directly chain method calls,
/// like `ctx.db.big_fish_agent_message().message_id().find(...)`. /// like `ctx.db.big_fish_agent_message().message_id().find(...)`.
pub struct BigFishAgentMessageMessageIdUnique<'ctx> { pub struct BigFishAgentMessageMessageIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<BigFishAgentMessage, String>, imp: __sdk::UniqueConstraintHandle<BigFishAgentMessage, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
} }
impl<'ctx> BigFishAgentMessageTableHandle<'ctx> { impl<'ctx> BigFishAgentMessageTableHandle<'ctx> {
/// Get a handle on the `message_id` unique index on the table `big_fish_agent_message`. /// Get a handle on the `message_id` unique index on the table `big_fish_agent_message`.
pub fn message_id(&self) -> BigFishAgentMessageMessageIdUnique<'ctx> { pub fn message_id(&self) -> BigFishAgentMessageMessageIdUnique<'ctx> {
BigFishAgentMessageMessageIdUnique { BigFishAgentMessageMessageIdUnique {
imp: self.imp.get_unique_constraint::<String>("message_id"), imp: self.imp.get_unique_constraint::<String>("message_id"),
phantom: std::marker::PhantomData, phantom: std::marker::PhantomData,
}
}
} }
}
}
impl<'ctx> BigFishAgentMessageMessageIdUnique<'ctx> { impl<'ctx> BigFishAgentMessageMessageIdUnique<'ctx> {
/// Find the subscribed row whose `message_id` column value is equal to `col_val`, /// Find the subscribed row whose `message_id` column value is equal to `col_val`,
/// if such a row is present in the client cache. /// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<BigFishAgentMessage> { pub fn find(&self, col_val: &String) -> Option<BigFishAgentMessage> {
self.imp.find(col_val) self.imp.find(col_val)
} }
} }
#[doc(hidden)] #[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) { pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<BigFishAgentMessage>("big_fish_agent_message"); let _table = client_cache.get_or_make_table::<BigFishAgentMessage>("big_fish_agent_message");
_table.add_unique_constraint::<String>("message_id", |row| &row.message_id); _table.add_unique_constraint::<String>("message_id", |row| &row.message_id);
} }
@@ -140,26 +140,24 @@ pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate, raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<BigFishAgentMessage>> { ) -> __sdk::Result<__sdk::TableUpdate<BigFishAgentMessage>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse( __sdk::InternalError::failed_parse("TableUpdate<BigFishAgentMessage>", "TableUpdate")
"TableUpdate<BigFishAgentMessage>", .with_cause(e)
"TableUpdate", .into()
).with_cause(e).into()
}) })
} }
#[allow(non_camel_case_types)] #[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `BigFishAgentMessage`. /// Extension trait for query builder access to the table `BigFishAgentMessage`.
/// ///
/// Implemented for [`__sdk::QueryTableAccessor`]. /// Implemented for [`__sdk::QueryTableAccessor`].
pub trait big_fish_agent_messageQueryTableAccess { pub trait big_fish_agent_messageQueryTableAccess {
#[allow(non_snake_case)] #[allow(non_snake_case)]
/// Get a query builder for the table `BigFishAgentMessage`. /// Get a query builder for the table `BigFishAgentMessage`.
fn big_fish_agent_message(&self) -> __sdk::__query_builder::Table<BigFishAgentMessage>; fn big_fish_agent_message(&self) -> __sdk::__query_builder::Table<BigFishAgentMessage>;
} }
impl big_fish_agent_messageQueryTableAccess for __sdk::QueryTableAccessor {
fn big_fish_agent_message(&self) -> __sdk::__query_builder::Table<BigFishAgentMessage> {
__sdk::__query_builder::Table::new("big_fish_agent_message")
}
}
impl big_fish_agent_messageQueryTableAccess for __sdk::QueryTableAccessor {
fn big_fish_agent_message(&self) -> __sdk::__query_builder::Table<BigFishAgentMessage> {
__sdk::__query_builder::Table::new("big_fish_agent_message")
}
}

View File

@@ -2,15 +2,10 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
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_kind_type::BigFishAgentMessageKind;
use super::big_fish_agent_message_role_type::BigFishAgentMessageRole;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)] #[sats(crate = __lib)]
@@ -23,12 +18,10 @@ pub struct BigFishAgentMessage {
pub created_at: __sdk::Timestamp, pub created_at: __sdk::Timestamp,
} }
impl __sdk::InModule for BigFishAgentMessage { impl __sdk::InModule for BigFishAgentMessage {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }
/// Column accessor struct for the table `BigFishAgentMessage`. /// Column accessor struct for the table `BigFishAgentMessage`.
/// ///
/// Provides typed access to columns for query building. /// 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"), kind: __sdk::__query_builder::Col::new(table_name, "kind"),
text: __sdk::__query_builder::Col::new(table_name, "text"), text: __sdk::__query_builder::Col::new(table_name, "text"),
created_at: __sdk::__query_builder::Col::new(table_name, "created_at"), created_at: __sdk::__query_builder::Col::new(table_name, "created_at"),
} }
} }
} }
@@ -70,10 +62,8 @@ impl __sdk::__query_builder::HasIxCols for BigFishAgentMessage {
BigFishAgentMessageIxCols { BigFishAgentMessageIxCols {
message_id: __sdk::__query_builder::IxCol::new(table_name, "message_id"), message_id: __sdk::__query_builder::IxCol::new(table_name, "message_id"),
session_id: __sdk::__query_builder::IxCol::new(table_name, "session_id"), session_id: __sdk::__query_builder::IxCol::new(table_name, "session_id"),
} }
} }
} }
impl __sdk::__query_builder::CanBeLookupTable for BigFishAgentMessage {} impl __sdk::__query_builder::CanBeLookupTable for BigFishAgentMessage {}

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
use super::big_fish_anchor_status_type::BigFishAnchorStatus; use super::big_fish_anchor_status_type::BigFishAnchorStatus;
@@ -20,8 +15,6 @@ pub struct BigFishAnchorItem {
pub status: BigFishAnchorStatus, pub status: BigFishAnchorStatus,
} }
impl __sdk::InModule for BigFishAnchorItem { impl __sdk::InModule for BigFishAnchorItem {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
use super::big_fish_anchor_item_type::BigFishAnchorItem; use super::big_fish_anchor_item_type::BigFishAnchorItem;
@@ -20,8 +15,6 @@ pub struct BigFishAnchorPack {
pub risk_tempo: BigFishAnchorItem, pub risk_tempo: BigFishAnchorItem,
} }
impl __sdk::InModule for BigFishAnchorPack { impl __sdk::InModule for BigFishAnchorPack {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)] #[sats(crate = __lib)]
@@ -20,12 +15,8 @@ pub enum BigFishAnchorStatus {
Missing, Missing,
Locked, Locked,
} }
impl __sdk::InModule for BigFishAnchorStatus { impl __sdk::InModule for BigFishAnchorStatus {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,13 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)] #[sats(crate = __lib)]
@@ -18,11 +12,9 @@ pub struct BigFishAssetCoverage {
pub background_ready: bool, pub background_ready: bool,
pub required_level_count: u32, pub required_level_count: u32,
pub publish_ready: bool, pub publish_ready: bool,
pub blockers: Vec::<String>, pub blockers: Vec<String>,
} }
impl __sdk::InModule for BigFishAssetCoverage { impl __sdk::InModule for BigFishAssetCoverage {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
use super::big_fish_asset_kind_type::BigFishAssetKind; use super::big_fish_asset_kind_type::BigFishAssetKind;
@@ -17,13 +12,11 @@ pub struct BigFishAssetGenerateInput {
pub session_id: String, pub session_id: String,
pub owner_user_id: String, pub owner_user_id: String,
pub asset_kind: BigFishAssetKind, pub asset_kind: BigFishAssetKind,
pub level: Option::<u32>, pub level: Option<u32>,
pub motion_key: Option::<String>, pub motion_key: Option<String>,
pub generated_at_micros: i64, pub generated_at_micros: i64,
} }
impl __sdk::InModule for BigFishAssetGenerateInput { impl __sdk::InModule for BigFishAssetGenerateInput {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)] #[sats(crate = __lib)]
@@ -18,12 +13,8 @@ pub enum BigFishAssetKind {
LevelMotion, LevelMotion,
StageBackground, StageBackground,
} }
impl __sdk::InModule for BigFishAssetKind { impl __sdk::InModule for BigFishAssetKind {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
use super::big_fish_asset_kind_type::BigFishAssetKind; use super::big_fish_asset_kind_type::BigFishAssetKind;
use super::big_fish_asset_status_type::BigFishAssetStatus; use super::big_fish_asset_status_type::BigFishAssetStatus;
@@ -18,16 +13,14 @@ pub struct BigFishAssetSlotSnapshot {
pub slot_id: String, pub slot_id: String,
pub session_id: String, pub session_id: String,
pub asset_kind: BigFishAssetKind, pub asset_kind: BigFishAssetKind,
pub level: Option::<u32>, pub level: Option<u32>,
pub motion_key: Option::<String>, pub motion_key: Option<String>,
pub status: BigFishAssetStatus, pub status: BigFishAssetStatus,
pub asset_url: Option::<String>, pub asset_url: Option<String>,
pub prompt_snapshot: String, pub prompt_snapshot: String,
pub updated_at_micros: i64, pub updated_at_micros: i64,
} }
impl __sdk::InModule for BigFishAssetSlotSnapshot { impl __sdk::InModule for BigFishAssetSlotSnapshot {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,15 +2,10 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{
self as __sdk,
__lib,
__sats,
__ws,
};
use super::big_fish_asset_slot_type::BigFishAssetSlot;
use super::big_fish_asset_kind_type::BigFishAssetKind; 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 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`. /// Table handle for the table `big_fish_asset_slot`.
/// ///
@@ -38,7 +33,9 @@ pub trait BigFishAssetSlotTableAccess {
impl BigFishAssetSlotTableAccess for super::RemoteTables { impl BigFishAssetSlotTableAccess for super::RemoteTables {
fn big_fish_asset_slot(&self) -> BigFishAssetSlotTableHandle<'_> { fn big_fish_asset_slot(&self) -> BigFishAssetSlotTableHandle<'_> {
BigFishAssetSlotTableHandle { BigFishAssetSlotTableHandle {
imp: self.imp.get_table::<BigFishAssetSlot>("big_fish_asset_slot"), imp: self
.imp
.get_table::<BigFishAssetSlot>("big_fish_asset_slot"),
ctx: std::marker::PhantomData, ctx: std::marker::PhantomData,
} }
} }
@@ -51,8 +48,12 @@ impl<'ctx> __sdk::Table for BigFishAssetSlotTableHandle<'ctx> {
type Row = BigFishAssetSlot; type Row = BigFishAssetSlot;
type EventContext = super::EventContext; type EventContext = super::EventContext;
fn count(&self) -> u64 { self.imp.count() } fn count(&self) -> u64 {
fn iter(&self) -> impl Iterator<Item = BigFishAssetSlot> + '_ { self.imp.iter() } self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = BigFishAssetSlot> + '_ {
self.imp.iter()
}
type InsertCallbackId = BigFishAssetSlotInsertCallbackId; 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`, /// 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 /// which allows point queries on the field of the same name
/// via the [`BigFishAssetSlotSlotIdUnique::find`] method. /// via the [`BigFishAssetSlotSlotIdUnique::find`] method.
/// ///
/// Users are encouraged not to explicitly reference this type, /// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls, /// but to directly chain method calls,
/// like `ctx.db.big_fish_asset_slot().slot_id().find(...)`. /// like `ctx.db.big_fish_asset_slot().slot_id().find(...)`.
pub struct BigFishAssetSlotSlotIdUnique<'ctx> { pub struct BigFishAssetSlotSlotIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<BigFishAssetSlot, String>, imp: __sdk::UniqueConstraintHandle<BigFishAssetSlot, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
} }
impl<'ctx> BigFishAssetSlotTableHandle<'ctx> { impl<'ctx> BigFishAssetSlotTableHandle<'ctx> {
/// Get a handle on the `slot_id` unique index on the table `big_fish_asset_slot`. /// Get a handle on the `slot_id` unique index on the table `big_fish_asset_slot`.
pub fn slot_id(&self) -> BigFishAssetSlotSlotIdUnique<'ctx> { pub fn slot_id(&self) -> BigFishAssetSlotSlotIdUnique<'ctx> {
BigFishAssetSlotSlotIdUnique { BigFishAssetSlotSlotIdUnique {
imp: self.imp.get_unique_constraint::<String>("slot_id"), imp: self.imp.get_unique_constraint::<String>("slot_id"),
phantom: std::marker::PhantomData, phantom: std::marker::PhantomData,
}
}
} }
}
}
impl<'ctx> BigFishAssetSlotSlotIdUnique<'ctx> { impl<'ctx> BigFishAssetSlotSlotIdUnique<'ctx> {
/// Find the subscribed row whose `slot_id` column value is equal to `col_val`, /// Find the subscribed row whose `slot_id` column value is equal to `col_val`,
/// if such a row is present in the client cache. /// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<BigFishAssetSlot> { pub fn find(&self, col_val: &String) -> Option<BigFishAssetSlot> {
self.imp.find(col_val) self.imp.find(col_val)
} }
} }
#[doc(hidden)] #[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) { pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<BigFishAssetSlot>("big_fish_asset_slot"); let _table = client_cache.get_or_make_table::<BigFishAssetSlot>("big_fish_asset_slot");
_table.add_unique_constraint::<String>("slot_id", |row| &row.slot_id); _table.add_unique_constraint::<String>("slot_id", |row| &row.slot_id);
} }
@@ -140,26 +140,24 @@ pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate, raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<BigFishAssetSlot>> { ) -> __sdk::Result<__sdk::TableUpdate<BigFishAssetSlot>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse( __sdk::InternalError::failed_parse("TableUpdate<BigFishAssetSlot>", "TableUpdate")
"TableUpdate<BigFishAssetSlot>", .with_cause(e)
"TableUpdate", .into()
).with_cause(e).into()
}) })
} }
#[allow(non_camel_case_types)] #[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `BigFishAssetSlot`. /// Extension trait for query builder access to the table `BigFishAssetSlot`.
/// ///
/// Implemented for [`__sdk::QueryTableAccessor`]. /// Implemented for [`__sdk::QueryTableAccessor`].
pub trait big_fish_asset_slotQueryTableAccess { pub trait big_fish_asset_slotQueryTableAccess {
#[allow(non_snake_case)] #[allow(non_snake_case)]
/// Get a query builder for the table `BigFishAssetSlot`. /// Get a query builder for the table `BigFishAssetSlot`.
fn big_fish_asset_slot(&self) -> __sdk::__query_builder::Table<BigFishAssetSlot>; fn big_fish_asset_slot(&self) -> __sdk::__query_builder::Table<BigFishAssetSlot>;
} }
impl big_fish_asset_slotQueryTableAccess for __sdk::QueryTableAccessor {
fn big_fish_asset_slot(&self) -> __sdk::__query_builder::Table<BigFishAssetSlot> {
__sdk::__query_builder::Table::new("big_fish_asset_slot")
}
}
impl big_fish_asset_slotQueryTableAccess for __sdk::QueryTableAccessor {
fn big_fish_asset_slot(&self) -> __sdk::__query_builder::Table<BigFishAssetSlot> {
__sdk::__query_builder::Table::new("big_fish_asset_slot")
}
}

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
use super::big_fish_asset_kind_type::BigFishAssetKind; use super::big_fish_asset_kind_type::BigFishAssetKind;
use super::big_fish_asset_status_type::BigFishAssetStatus; use super::big_fish_asset_status_type::BigFishAssetStatus;
@@ -18,20 +13,18 @@ pub struct BigFishAssetSlot {
pub slot_id: String, pub slot_id: String,
pub session_id: String, pub session_id: String,
pub asset_kind: BigFishAssetKind, pub asset_kind: BigFishAssetKind,
pub level: Option::<u32>, pub level: Option<u32>,
pub motion_key: Option::<String>, pub motion_key: Option<String>,
pub status: BigFishAssetStatus, pub status: BigFishAssetStatus,
pub asset_url: Option::<String>, pub asset_url: Option<String>,
pub prompt_snapshot: String, pub prompt_snapshot: String,
pub updated_at: __sdk::Timestamp, pub updated_at: __sdk::Timestamp,
} }
impl __sdk::InModule for BigFishAssetSlot { impl __sdk::InModule for BigFishAssetSlot {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }
/// Column accessor struct for the table `BigFishAssetSlot`. /// Column accessor struct for the table `BigFishAssetSlot`.
/// ///
/// Provides typed access to columns for query building. /// Provides typed access to columns for query building.
@@ -39,10 +32,10 @@ pub struct BigFishAssetSlotCols {
pub slot_id: __sdk::__query_builder::Col<BigFishAssetSlot, String>, pub slot_id: __sdk::__query_builder::Col<BigFishAssetSlot, String>,
pub session_id: __sdk::__query_builder::Col<BigFishAssetSlot, String>, pub session_id: __sdk::__query_builder::Col<BigFishAssetSlot, String>,
pub asset_kind: __sdk::__query_builder::Col<BigFishAssetSlot, BigFishAssetKind>, pub asset_kind: __sdk::__query_builder::Col<BigFishAssetSlot, BigFishAssetKind>,
pub level: __sdk::__query_builder::Col<BigFishAssetSlot, Option::<u32>>, pub level: __sdk::__query_builder::Col<BigFishAssetSlot, Option<u32>>,
pub motion_key: __sdk::__query_builder::Col<BigFishAssetSlot, Option::<String>>, pub motion_key: __sdk::__query_builder::Col<BigFishAssetSlot, Option<String>>,
pub status: __sdk::__query_builder::Col<BigFishAssetSlot, BigFishAssetStatus>, pub status: __sdk::__query_builder::Col<BigFishAssetSlot, BigFishAssetStatus>,
pub asset_url: __sdk::__query_builder::Col<BigFishAssetSlot, Option::<String>>, pub asset_url: __sdk::__query_builder::Col<BigFishAssetSlot, Option<String>>,
pub prompt_snapshot: __sdk::__query_builder::Col<BigFishAssetSlot, String>, pub prompt_snapshot: __sdk::__query_builder::Col<BigFishAssetSlot, String>,
pub updated_at: __sdk::__query_builder::Col<BigFishAssetSlot, __sdk::Timestamp>, pub updated_at: __sdk::__query_builder::Col<BigFishAssetSlot, __sdk::Timestamp>,
} }
@@ -60,7 +53,6 @@ impl __sdk::__query_builder::HasCols for BigFishAssetSlot {
asset_url: __sdk::__query_builder::Col::new(table_name, "asset_url"), asset_url: __sdk::__query_builder::Col::new(table_name, "asset_url"),
prompt_snapshot: __sdk::__query_builder::Col::new(table_name, "prompt_snapshot"), prompt_snapshot: __sdk::__query_builder::Col::new(table_name, "prompt_snapshot"),
updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"), updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"),
} }
} }
} }
@@ -79,10 +71,8 @@ impl __sdk::__query_builder::HasIxCols for BigFishAssetSlot {
BigFishAssetSlotIxCols { BigFishAssetSlotIxCols {
session_id: __sdk::__query_builder::IxCol::new(table_name, "session_id"), session_id: __sdk::__query_builder::IxCol::new(table_name, "session_id"),
slot_id: __sdk::__query_builder::IxCol::new(table_name, "slot_id"), slot_id: __sdk::__query_builder::IxCol::new(table_name, "slot_id"),
} }
} }
} }
impl __sdk::__query_builder::CanBeLookupTable for BigFishAssetSlot {} impl __sdk::__query_builder::CanBeLookupTable for BigFishAssetSlot {}

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)] #[sats(crate = __lib)]
@@ -16,12 +11,8 @@ pub enum BigFishAssetStatus {
Missing, Missing,
Ready, Ready,
} }
impl __sdk::InModule for BigFishAssetStatus { impl __sdk::InModule for BigFishAssetStatus {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,13 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)] #[sats(crate = __lib)]
@@ -23,8 +17,6 @@ pub struct BigFishBackgroundBlueprint {
pub background_prompt_seed: String, pub background_prompt_seed: String,
} }
impl __sdk::InModule for BigFishBackgroundBlueprint { impl __sdk::InModule for BigFishBackgroundBlueprint {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,14 +2,9 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{
self as __sdk,
__lib,
__sats,
__ws,
};
use super::big_fish_creation_session_type::BigFishCreationSession; use super::big_fish_creation_session_type::BigFishCreationSession;
use super::big_fish_creation_stage_type::BigFishCreationStage; 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`. /// Table handle for the table `big_fish_creation_session`.
/// ///
@@ -37,7 +32,9 @@ pub trait BigFishCreationSessionTableAccess {
impl BigFishCreationSessionTableAccess for super::RemoteTables { impl BigFishCreationSessionTableAccess for super::RemoteTables {
fn big_fish_creation_session(&self) -> BigFishCreationSessionTableHandle<'_> { fn big_fish_creation_session(&self) -> BigFishCreationSessionTableHandle<'_> {
BigFishCreationSessionTableHandle { BigFishCreationSessionTableHandle {
imp: self.imp.get_table::<BigFishCreationSession>("big_fish_creation_session"), imp: self
.imp
.get_table::<BigFishCreationSession>("big_fish_creation_session"),
ctx: std::marker::PhantomData, ctx: std::marker::PhantomData,
} }
} }
@@ -50,8 +47,12 @@ impl<'ctx> __sdk::Table for BigFishCreationSessionTableHandle<'ctx> {
type Row = BigFishCreationSession; type Row = BigFishCreationSession;
type EventContext = super::EventContext; type EventContext = super::EventContext;
fn count(&self) -> u64 { self.imp.count() } fn count(&self) -> u64 {
fn iter(&self) -> impl Iterator<Item = BigFishCreationSession> + '_ { self.imp.iter() } self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = BigFishCreationSession> + '_ {
self.imp.iter()
}
type InsertCallbackId = BigFishCreationSessionInsertCallbackId; 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`, /// 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 /// which allows point queries on the field of the same name
/// via the [`BigFishCreationSessionSessionIdUnique::find`] method. /// via the [`BigFishCreationSessionSessionIdUnique::find`] method.
/// ///
/// Users are encouraged not to explicitly reference this type, /// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls, /// but to directly chain method calls,
/// like `ctx.db.big_fish_creation_session().session_id().find(...)`. /// like `ctx.db.big_fish_creation_session().session_id().find(...)`.
pub struct BigFishCreationSessionSessionIdUnique<'ctx> { pub struct BigFishCreationSessionSessionIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<BigFishCreationSession, String>, imp: __sdk::UniqueConstraintHandle<BigFishCreationSession, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
} }
impl<'ctx> BigFishCreationSessionTableHandle<'ctx> { impl<'ctx> BigFishCreationSessionTableHandle<'ctx> {
/// Get a handle on the `session_id` unique index on the table `big_fish_creation_session`. /// Get a handle on the `session_id` unique index on the table `big_fish_creation_session`.
pub fn session_id(&self) -> BigFishCreationSessionSessionIdUnique<'ctx> { pub fn session_id(&self) -> BigFishCreationSessionSessionIdUnique<'ctx> {
BigFishCreationSessionSessionIdUnique { BigFishCreationSessionSessionIdUnique {
imp: self.imp.get_unique_constraint::<String>("session_id"), imp: self.imp.get_unique_constraint::<String>("session_id"),
phantom: std::marker::PhantomData, phantom: std::marker::PhantomData,
}
}
} }
}
}
impl<'ctx> BigFishCreationSessionSessionIdUnique<'ctx> { impl<'ctx> BigFishCreationSessionSessionIdUnique<'ctx> {
/// Find the subscribed row whose `session_id` column value is equal to `col_val`, /// Find the subscribed row whose `session_id` column value is equal to `col_val`,
/// if such a row is present in the client cache. /// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<BigFishCreationSession> { pub fn find(&self, col_val: &String) -> Option<BigFishCreationSession> {
self.imp.find(col_val) self.imp.find(col_val)
} }
} }
#[doc(hidden)] #[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) { pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table =
let _table = client_cache.get_or_make_table::<BigFishCreationSession>("big_fish_creation_session"); client_cache.get_or_make_table::<BigFishCreationSession>("big_fish_creation_session");
_table.add_unique_constraint::<String>("session_id", |row| &row.session_id); _table.add_unique_constraint::<String>("session_id", |row| &row.session_id);
} }
@@ -139,26 +140,24 @@ pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate, raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<BigFishCreationSession>> { ) -> __sdk::Result<__sdk::TableUpdate<BigFishCreationSession>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse( __sdk::InternalError::failed_parse("TableUpdate<BigFishCreationSession>", "TableUpdate")
"TableUpdate<BigFishCreationSession>", .with_cause(e)
"TableUpdate", .into()
).with_cause(e).into()
}) })
} }
#[allow(non_camel_case_types)] #[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `BigFishCreationSession`. /// Extension trait for query builder access to the table `BigFishCreationSession`.
/// ///
/// Implemented for [`__sdk::QueryTableAccessor`]. /// Implemented for [`__sdk::QueryTableAccessor`].
pub trait big_fish_creation_sessionQueryTableAccess { pub trait big_fish_creation_sessionQueryTableAccess {
#[allow(non_snake_case)] #[allow(non_snake_case)]
/// Get a query builder for the table `BigFishCreationSession`. /// Get a query builder for the table `BigFishCreationSession`.
fn big_fish_creation_session(&self) -> __sdk::__query_builder::Table<BigFishCreationSession>; fn big_fish_creation_session(&self) -> __sdk::__query_builder::Table<BigFishCreationSession>;
} }
impl big_fish_creation_sessionQueryTableAccess for __sdk::QueryTableAccessor {
fn big_fish_creation_session(&self) -> __sdk::__query_builder::Table<BigFishCreationSession> {
__sdk::__query_builder::Table::new("big_fish_creation_session")
}
}
impl big_fish_creation_sessionQueryTableAccess for __sdk::QueryTableAccessor {
fn big_fish_creation_session(&self) -> __sdk::__query_builder::Table<BigFishCreationSession> {
__sdk::__query_builder::Table::new("big_fish_creation_session")
}
}

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
use super::big_fish_creation_stage_type::BigFishCreationStage; use super::big_fish_creation_stage_type::BigFishCreationStage;
@@ -21,20 +16,18 @@ pub struct BigFishCreationSession {
pub progress_percent: u32, pub progress_percent: u32,
pub stage: BigFishCreationStage, pub stage: BigFishCreationStage,
pub anchor_pack_json: String, pub anchor_pack_json: String,
pub draft_json: Option::<String>, pub draft_json: Option<String>,
pub asset_coverage_json: String, pub asset_coverage_json: String,
pub last_assistant_reply: Option::<String>, pub last_assistant_reply: Option<String>,
pub publish_ready: bool, pub publish_ready: bool,
pub created_at: __sdk::Timestamp, pub created_at: __sdk::Timestamp,
pub updated_at: __sdk::Timestamp, pub updated_at: __sdk::Timestamp,
} }
impl __sdk::InModule for BigFishCreationSession { impl __sdk::InModule for BigFishCreationSession {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }
/// Column accessor struct for the table `BigFishCreationSession`. /// Column accessor struct for the table `BigFishCreationSession`.
/// ///
/// Provides typed access to columns for query building. /// Provides typed access to columns for query building.
@@ -46,9 +39,9 @@ pub struct BigFishCreationSessionCols {
pub progress_percent: __sdk::__query_builder::Col<BigFishCreationSession, u32>, pub progress_percent: __sdk::__query_builder::Col<BigFishCreationSession, u32>,
pub stage: __sdk::__query_builder::Col<BigFishCreationSession, BigFishCreationStage>, pub stage: __sdk::__query_builder::Col<BigFishCreationSession, BigFishCreationStage>,
pub anchor_pack_json: __sdk::__query_builder::Col<BigFishCreationSession, String>, pub anchor_pack_json: __sdk::__query_builder::Col<BigFishCreationSession, String>,
pub draft_json: __sdk::__query_builder::Col<BigFishCreationSession, Option::<String>>, pub draft_json: __sdk::__query_builder::Col<BigFishCreationSession, Option<String>>,
pub asset_coverage_json: __sdk::__query_builder::Col<BigFishCreationSession, String>, pub asset_coverage_json: __sdk::__query_builder::Col<BigFishCreationSession, String>,
pub last_assistant_reply: __sdk::__query_builder::Col<BigFishCreationSession, Option::<String>>, pub last_assistant_reply: __sdk::__query_builder::Col<BigFishCreationSession, Option<String>>,
pub publish_ready: __sdk::__query_builder::Col<BigFishCreationSession, bool>, pub publish_ready: __sdk::__query_builder::Col<BigFishCreationSession, bool>,
pub created_at: __sdk::__query_builder::Col<BigFishCreationSession, __sdk::Timestamp>, pub created_at: __sdk::__query_builder::Col<BigFishCreationSession, __sdk::Timestamp>,
pub updated_at: __sdk::__query_builder::Col<BigFishCreationSession, __sdk::Timestamp>, pub updated_at: __sdk::__query_builder::Col<BigFishCreationSession, __sdk::Timestamp>,
@@ -66,12 +59,17 @@ impl __sdk::__query_builder::HasCols for BigFishCreationSession {
stage: __sdk::__query_builder::Col::new(table_name, "stage"), stage: __sdk::__query_builder::Col::new(table_name, "stage"),
anchor_pack_json: __sdk::__query_builder::Col::new(table_name, "anchor_pack_json"), anchor_pack_json: __sdk::__query_builder::Col::new(table_name, "anchor_pack_json"),
draft_json: __sdk::__query_builder::Col::new(table_name, "draft_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"), asset_coverage_json: __sdk::__query_builder::Col::new(
last_assistant_reply: __sdk::__query_builder::Col::new(table_name, "last_assistant_reply"), 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"), publish_ready: __sdk::__query_builder::Col::new(table_name, "publish_ready"),
created_at: __sdk::__query_builder::Col::new(table_name, "created_at"), created_at: __sdk::__query_builder::Col::new(table_name, "created_at"),
updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"), updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"),
} }
} }
} }
@@ -90,10 +88,8 @@ impl __sdk::__query_builder::HasIxCols for BigFishCreationSession {
BigFishCreationSessionIxCols { BigFishCreationSessionIxCols {
owner_user_id: __sdk::__query_builder::IxCol::new(table_name, "owner_user_id"), owner_user_id: __sdk::__query_builder::IxCol::new(table_name, "owner_user_id"),
session_id: __sdk::__query_builder::IxCol::new(table_name, "session_id"), session_id: __sdk::__query_builder::IxCol::new(table_name, "session_id"),
} }
} }
} }
impl __sdk::__query_builder::CanBeLookupTable for BigFishCreationSession {} impl __sdk::__query_builder::CanBeLookupTable for BigFishCreationSession {}

View File

@@ -2,12 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)] #[sats(crate = __lib)]
@@ -22,12 +17,8 @@ pub enum BigFishCreationStage {
ReadyToPublish, ReadyToPublish,
Published, Published,
} }
impl __sdk::InModule for BigFishCreationStage { impl __sdk::InModule for BigFishCreationStage {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,13 +2,7 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
self as __sdk,
__lib,
__sats,
__ws,
};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)] #[sats(crate = __lib)]
@@ -18,8 +12,6 @@ pub struct BigFishDraftCompileInput {
pub compiled_at_micros: i64, pub compiled_at_micros: i64,
} }
impl __sdk::InModule for BigFishDraftCompileInput { impl __sdk::InModule for BigFishDraftCompileInput {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

View File

@@ -2,15 +2,10 @@
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)] #![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
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_background_blueprint_type::BigFishBackgroundBlueprint;
use super::big_fish_level_blueprint_type::BigFishLevelBlueprint;
use super::big_fish_runtime_params_type::BigFishRuntimeParams; use super::big_fish_runtime_params_type::BigFishRuntimeParams;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] #[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
@@ -20,13 +15,11 @@ pub struct BigFishGameDraft {
pub subtitle: String, pub subtitle: String,
pub core_fun: String, pub core_fun: String,
pub ecology_theme: String, pub ecology_theme: String,
pub levels: Vec::<BigFishLevelBlueprint>, pub levels: Vec<BigFishLevelBlueprint>,
pub background: BigFishBackgroundBlueprint, pub background: BigFishBackgroundBlueprint,
pub runtime_params: BigFishRuntimeParams, pub runtime_params: BigFishRuntimeParams,
} }
impl __sdk::InModule for BigFishGameDraft { impl __sdk::InModule for BigFishGameDraft {
type Module = super::RemoteModule; type Module = super::RemoteModule;
} }

Some files were not shown because too many files have changed in this diff Show More