diff --git a/.hermes/plans/2026-05-04_022223-analytics-time-dimension-mapping.md b/.hermes/plans/2026-05-04_022223-analytics-time-dimension-mapping.md new file mode 100644 index 00000000..cbd0c8fb --- /dev/null +++ b/.hermes/plans/2026-05-04_022223-analytics-time-dimension-mapping.md @@ -0,0 +1,724 @@ +# 埋点系统新增周、月、季、年维度映射表计划 + +## 目标 + +在 Genarrative 的埋点/统计系统中新增“周、月、季、年”维度映射表,让后续统计查询可以按不同时间粒度稳定聚合,而不是只依赖运行时临时计算日期范围。 + +本计划只做设计与落地步骤,不直接修改业务代码。 + +## 当前上下文与初步发现 + +1. 当前仓库根目录为 `/home/dsk/workspace/Genarrative`。 +2. 远端更新后已定位到当前真实埋点/任务系统: + - 原始埋点表:`tracking_event` + - 日聚合投影表:`tracking_daily_stat` + - 任务配置表:`profile_task_config` + - 任务进度表:`profile_task_progress` + - 领奖记录表:`profile_task_reward_claim` +3. 相关文件: + - `server-rs/crates/spacetime-module/src/runtime/profile.rs` + - `server-rs/crates/module-runtime/src/domain.rs` + - `server-rs/crates/module-runtime/src/application.rs` + - `server-rs/crates/api-server/src/runtime_profile.rs` + - `apps/admin-web/src/pages/AdminTaskConfigPage.tsx` + - `apps/admin-web/src/api/adminApiTypes.ts` + - `apps/admin-web/src/config/trackingEventDefinitions.ts` + - `docs/technical/PROFILE_TASK_AND_TRACKING_SYSTEM_2026-05-03.md` + - `docs/tracking/TRACKING_QUERY_PLAYBOOK_2026-05-03.md` +4. 当前 `tracking_event` 是明细表,`tracking_daily_stat` 是统一日汇总表,不按范围拆表;它通过 `event_key + scope_kind + scope_id + day_key` 区分不同聚合桶。 +5. 当前任务系统是“个人任务系统”,首版任务配置均面向用户维度;后台暴露“埋点范围”选择会导致运营误配。 +6. 已决定采用任务配置方案 B: + - 后台任务配置不再让运营手动选择埋点范围。 + - 后端个人任务配置统一限制为 `RuntimeTrackingScopeKind::User`。 + - 若 API 收到非 `user` 的 `scopeKind`,应拒绝或兼容忽略但最终落库必须为 `User`;推荐直接拒绝并返回清晰错误。 +7. 已发现一个需要纳入本计划修复的语义问题:`profile_task_tracking_scope_id` 里 `RuntimeTrackingScopeKind::Work` 当前返回 `user_id`,这不符合 work 维度语义。即使个人任务暂不支持 work,也应避免错误映射继续存在。 +8. 当前日期桶使用北京时间自然日:`day_key = floor((occurred_at_micros + 8h) / 1d)`;周/月/季/年映射表应优先沿用这一业务日口径,除非产品另行确认。 +9. 如果新增正式后端表,需要同步: + - 表定义 + - reducer/procedure + - migration.rs + - 生成绑定 + - spacetime-client facade + - shared-contracts / API DTO,如有接口暴露 + +## 关键假设 + +在未定位现有埋点模块前,先按以下假设规划: + +1. 当前已有某种事件明细表或统计事实表,例如: + - `telemetry_event` + - `analytics_event` + - `metric_event` + - `narrative_telemetry` + - 或类似命名 +2. 新增的“映射表”用于把具体日期或事件时间映射到时间维度 bucket。 +3. 映射维度包括: + - 周:week + - 月:month + - 季:quarter + - 年:year +4. 已明确选择“一张通用日期维度映射表”方案:`analytics_date_dimension`。 +5. 统计口径需要明确: + - 周从周一还是周日开始 + - 是否使用 ISO week + - 季度是自然季度还是财务季度 + - 时区使用 UTC 还是业务本地时区 + +## 推荐设计方向 + +### 方案 A:单一时间维度映射表,推荐 + +新增一张日历维度表,每一行对应一个自然日,并包含它归属的周、月、季、年。 + +表概念: + +```text +analytics_date_dimension +``` + +建议字段: + +```text +date_key string 例如 2026-05-04 +calendar_date string 真实日期,按 YYYY-MM-DD 存储 +weekday u8 1-7 或 0-6,需要统一约定 +iso_week_key string 例如 2026-W19 +week_start_date_key string 例如 2026-05-04 +week_end_date_key string 例如 2026-05-10 +month_key string 例如 2026-05 +month_start_date_key string +month_end_date_key string +quarter_key string 例如 2026-Q2 +year_key string 例如 2026 +created_at timestamp/string +updated_at timestamp/string +``` + +优点: + +- 一张表即可支持日、周、月、季、年映射。 +- 便于后续新增半月、财年、节假日、自然周等维度。 +- 查询逻辑简单:事件日期 join/date_key 映射到目标粒度。 +- 数据量很小,按 20 年也只有约 7300 行。 + +缺点: + +- 需要在事件时间写入或统计查询时把 timestamp 归一为 date_key。 +- 如果要支持多时区,可能需要增加 timezone 字段或多套 calendar。 + +### 方案 B:四张独立映射表 + +分别新增: + +```text +analytics_week_dimension +analytics_month_dimension +analytics_quarter_dimension +analytics_year_dimension +``` + +优点: + +- 每个粒度表结构更纯粹。 +- 查询时可以直接针对目标粒度表。 + +缺点: + +- 表更多,维护复杂。 +- 日期归属关系仍然需要额外处理。 +- 容易出现周/月/季/年口径漂移。 + +### 最终选择 + +本计划采用方案 A:单一 `analytics_date_dimension` 日期维表,而不是四张独立映射表。 + +如业务未来明确要求“周、月、季、年各自有独立映射表”,也应优先在日期维表基础上派生视图或物化派生表,而不是一开始拆成四张重复表。 + +## 后端设计建议 + +### 1. 明确埋点领域归属 + +先定位现有埋点模块。如果没有独立模块,建议新增或归入: + +```text +server-rs/crates/module-analytics/ +``` + +或如果当前项目已有 telemetry 命名,则保持已有命名,例如: + +```text +server-rs/crates/module-telemetry/ +``` + +领域层职责: + +- 时间粒度定义 +- date_key/week_key/month_key/quarter_key/year_key 生成规则 +- 时间维度校验 +- 事件聚合查询输入的纯规则 + +不应包含: + +- SpacetimeDB 表读写 +- Axum handler +- HTTP response + +### 2. SpacetimeDB 表设计 + +在 `spacetime-module` 中新增时间维度表。 + +建议表名: + +```text +analytics_date_dimension +``` + +建议主键: + +```text +date_key +``` + +建议索引: + +```text +iso_week_key +month_key +quarter_key +year_key +``` + +如果 SpacetimeDB 表定义已有统一命名规范,应按现有规范命名。 + +### 3. 初始化/补全 reducer + +新增 reducer 或内部 procedure,用于生成指定日期范围内的维度数据。 + +建议能力: + +```text +seed_analytics_date_dimensions(start_date, end_date) +ensure_analytics_date_dimension_for_date(date_key) +ensure_analytics_date_dimensions_for_range(start_date, end_date) +``` + +设计原则: + +- 可幂等执行。 +- 已存在 date_key 时不重复插入。 +- 支持一次补一段日期。 +- 避免一次补太大范围导致事务过重。 +- 生产环境建议按年份或月份分批。 + +### 4. 事件表和映射表关系 + +如果事件表目前只有 timestamp,建议新增或计算出: + +```text +event_date_key +``` + +可选策略: + +1. 写入事件时同步写 `event_date_key`。 +2. 查询统计时从 timestamp 临时计算 date_key。 +3. 后台迁移为历史事件补 `event_date_key`。 + +推荐: + +- 新事件写入时保存 `event_date_key`。 +- 历史事件通过批量迁移 reducer 分批补齐。 + +### 5. 聚合查询设计 + +支持按粒度查询时,API 或 facade 可以接收: + +```text +granularity = day | week | month | quarter | year +start_date +end_date +metric/event_name +filters +``` + +内部根据粒度选择 bucket key: + +```text +day -> date_key +week -> iso_week_key 或 week_key +month -> month_key +quarter -> quarter_key +year -> year_key +``` + +返回结构建议统一: + +```text +bucket_key +bucket_label +bucket_start_date +bucket_end_date +value +``` + +## 可能涉及的文件 + +由于当前尚未定位明确埋点模块,以下是预计文件范围。 + +### 必查文件/目录 + +```text +./Genarrative/server-rs/crates/ +./Genarrative/server-rs/crates/spacetime-module/src/ +./Genarrative/server-rs/crates/spacetime-client/src/ +./Genarrative/server-rs/crates/shared-contracts/src/ +./Genarrative/server-rs/crates/api-server/src/ +./Genarrative/packages/shared/src/contracts/ +./Genarrative/src/services/ +``` + +### 可能新增文件 + +如果采用 analytics 命名: + +```text +server-rs/crates/module-analytics/src/domain.rs +server-rs/crates/module-analytics/src/commands.rs +server-rs/crates/module-analytics/src/application.rs +server-rs/crates/module-analytics/src/errors.rs +server-rs/crates/module-analytics/src/events.rs +server-rs/crates/shared-contracts/src/analytics.rs +server-rs/crates/spacetime-client/src/analytics.rs +server-rs/crates/api-server/src/analytics.rs +packages/shared/src/contracts/analytics.ts +``` + +如果只是新增 SpacetimeDB 映射表且暂不暴露 API,则可能只需: + +```text +server-rs/crates/spacetime-module/src/** +server-rs/crates/spacetime-module/src/migration.rs +server-rs/crates/spacetime-client/src/** # 如果查询会被 api-server 使用 +``` + +## 详细实施步骤 + +### Step 1:复核现有埋点系统与任务配置链路 + +当前已定位真实链路,实施前再做一次只读复核,确认远端最新代码没有继续变化。 + +已知核心表: + +```text +tracking_event # 原始埋点明细 +tracking_daily_stat # 日聚合投影 +profile_task_config # 个人任务配置 +profile_task_progress # 个人任务进度 +profile_task_reward_claim # 领奖记录 +``` + +已知核心文件: + +```text +server-rs/crates/spacetime-module/src/runtime/profile.rs +server-rs/crates/module-runtime/src/domain.rs +server-rs/crates/module-runtime/src/application.rs +server-rs/crates/api-server/src/runtime_profile.rs +apps/admin-web/src/pages/AdminTaskConfigPage.tsx +apps/admin-web/src/api/adminApiTypes.ts +apps/admin-web/src/config/trackingEventDefinitions.ts +docs/technical/PROFILE_TASK_AND_TRACKING_SYSTEM_2026-05-03.md +docs/tracking/TRACKING_QUERY_PLAYBOOK_2026-05-03.md +``` + +重点确认: + +1. `tracking_event` 是否仍包含 `event_key/scope_kind/scope_id/day_key/user_id/occurred_at`。 +2. `tracking_daily_stat` 是否仍按 `event_key + scope_kind + scope_id + day_key` 生成 `stat_id`。 +3. `profile_task_config` 是否仍包含 `scope_kind` 和 `sort_order`。 +4. 后台 `AdminTaskConfigPage` 是否仍暴露“埋点范围”下拉。 +5. `profile_task_tracking_scope_id` 中 `Work => user_id` 的错误映射是否仍存在。 + +### Step 1.5:先收紧个人任务配置的埋点范围,采用方案 B + +在做周/月/季/年维度映射前,先修正个人任务配置边界,避免后续在错误配置模型上继续扩展。 + +目标行为: + +```text +个人任务配置只支持用户维度埋点。 +后台页面不再展示“埋点范围”。 +后端不允许 profile_task_config 被写入 site/work/module 维度。 +``` + +建议实现: + +1. 前端隐藏 `AdminTaskConfigPage` 的“埋点范围”选择。 + - 文件:`apps/admin-web/src/pages/AdminTaskConfigPage.tsx` + - 移除或隐藏:`scopeKinds` 下拉 UI。 + - 保存请求仍可兼容传 `scopeKind: 'user'`,避免一次性改动 API contract。 +2. 后端 upsert 校验 `scopeKind` 必须为 `RuntimeTrackingScopeKind::User`。 + - 文件:`server-rs/crates/api-server/src/runtime_profile.rs` + - 或更底层:`server-rs/crates/module-runtime/src/domain.rs` / `server-rs/crates/spacetime-module/src/runtime/profile.rs` 的输入构造函数。 + - 推荐在领域输入构造处兜底校验,API 层返回清晰错误。 +3. 若暂不改 API DTO,则保持字段存在但限定值只能是 `user`。 + - 文件:`apps/admin-web/src/api/adminApiTypes.ts` + - `AdminUpsertProfileTaskConfigRequest.scopeKind` 可保留,前端固定传 `user`。 +4. 更新后台埋点定义注册表的语义: + - 文件:`apps/admin-web/src/config/trackingEventDefinitions.ts` + - 当前每个 event definition 包含 `scopeKind`,如果个人任务统一 `user`,可以保留为只读内部默认值;但不要让运营在页面改。 +5. 更新技术文档: + - `docs/technical/PROFILE_TASK_AND_TRACKING_SYSTEM_2026-05-03.md` + - 明确“个人任务首版只支持用户维度埋点,后台不开放 scope_kind 配置”。 + +验收: + +```text +后台任务配置页不再出现“埋点范围”选择。 +保存 daily_login 后落库 scope_kind 仍为 User。 +直接调用后台 upsert 接口传 site/work/module 时被拒绝,或最终不会落库为非 User;推荐拒绝。 +``` + +### Step 1.6:修复 Work 范围错误返回 user_id 的语义问题 + +当前函数: + +```text +server-rs/crates/spacetime-module/src/runtime/profile.rs +profile_task_tracking_scope_id(user_id, config) +``` + +当前问题: + +```rust +RuntimeTrackingScopeKind::Work => user_id.to_string() +``` + +这会把 work 维度错误映射为用户 ID。虽然个人任务将限制为 User,但保留这个分支会误导后续扩展。 + +推荐修复策略: + +1. 对个人任务进度计算来说,`Work` 不应进入该函数。 +2. 将 `profile_task_tracking_scope_id` 改为返回 `Result` 或 `Option`。 +3. 对不支持的范围返回错误,而不是伪造 scope_id: + +```text +Site -> "site",如果个人任务仍不允许 site,则上游先拒绝 +Module -> "profile",如果个人任务仍不允许 module,则上游先拒绝 +User -> user_id +Work -> error: personal task progress does not support work scope without work_id +``` + +更严格的推荐: + +```text +个人任务链路只接受 User。 +Work/Site/Module 在 profile_task_progress_count 前就被拒绝。 +profile_task_tracking_scope_id 只保留 User 分支,或者非 User 返回错误。 +``` + +需要同步调整调用点: + +```text +profile_task_progress_count +refresh_profile_task_progress +build_profile_task_center_snapshot +claim_profile_task_reward +``` + +避免因为函数返回 `Result` 后调用链未处理错误。 + +验收: + +```text +不存在 Work => user_id 的映射。 +个人任务配置非 User 时不会静默算出错误进度。 +相关测试覆盖:User 正常;Work/Site/Module 被拒绝。 + +``` + +### Step 2:确定时间口径 + +必须先确认: + +1. 周维度是否使用 ISO week。 +2. 周开始日是周一还是周日。 +3. 月/季/年是否按自然日历。 +4. 统计时区是 UTC、服务器时区,还是用户本地时区。 +5. 跨年周如何命名,例如 `2025-W01` 可能开始于 2024 年末。 + +推荐默认: + +```text +时区:UTC,除非产品明确要求中国时区 +周:ISO week,周一开始 +月:自然月 +季:自然季度 +年:自然年 +``` + +如果业务面向国内用户,建议考虑: + +```text +时区:Asia/Shanghai +周:周一开始 +``` + +### Step 3:设计 date dimension 表 + +设计字段和 key 格式,写入技术文档。 + +建议 key 格式: + +```text +date_key: 2026-05-04 +week_key: 2026-W19 +month_key: 2026-05 +quarter_key: 2026-Q2 +year_key: 2026 +``` + +注意: + +- `week_key` 建议使用 ISO week-year,不一定等于 calendar year。 +- `quarter_key` 使用 calendar year。 + +### Step 4:新增领域纯函数 + +在领域层或 shared-kernel 中实现纯函数: + +```text +resolve_date_dimension(date, timezone) -> AnalyticsDateDimension +resolve_bucket_key(date_dimension, granularity) -> String +resolve_bucket_range(bucket_key, granularity) -> start/end date +``` + +要求: + +- 有单元测试。 +- 覆盖跨年周。 +- 覆盖闰年 2 月。 +- 覆盖季度边界。 + +### Step 5:新增 SpacetimeDB 表 + +在 `spacetime-module` 中新增表。 + +遵守约束: + +- 新增表通常安全。 +- 不修改已有表字段。 +- 如果必须给已有事件表加 `event_date_key`,必须加在表定义末尾并提供 default。 +- 若要补历史数据,使用 reducer 分批迁移。 + +### Step 6:新增 seed/ensure reducer + +新增幂等 reducer: + +```text +seed_analytics_date_dimensions(start_date, end_date) +ensure_analytics_date_dimension_for_date(date_key) +``` + +验证点: + +- 重复执行不会重复插入。 +- 日期范围非法时返回稳定错误。 +- 单次范围过大时拒绝或分页。 + +### Step 7:接入事件写入链路 + +如果现有事件写入链路存在,新增: + +```text +event_date_key +``` + +策略: + +- 新事件写入时同步计算并保存。 +- 写入前确保对应 date dimension 存在。 +- 历史事件通过迁移 reducer 补齐。 + +如果暂不改事件表,也可以在查询阶段临时映射,但性能和一致性较差。 + +### Step 8:接入聚合查询 + +如已有统计接口,扩展请求参数: + +```text +granularity: day | week | month | quarter | year +``` + +查询逻辑改为: + +```text +事件/事实表 +→ event_date_key +→ analytics_date_dimension +→ 取对应 bucket key +→ group by bucket key +``` + +返回 bucket 时包含: + +```text +bucket_key +bucket_start_date +bucket_end_date +value +``` + +### Step 9:补 shared contracts 和前端 contracts + +如果有 API 暴露,需要补: + +```text +server-rs/crates/shared-contracts/src/analytics.rs +packages/shared/src/contracts/analytics.ts +``` + +建议 DTO: + +```text +AnalyticsGranularity = day | week | month | quarter | year +AnalyticsBucketMetric +AnalyticsMetricQueryRequest +AnalyticsMetricQueryResponse +``` + +### Step 10:补测试 + +测试范围: + +1. 领域日期映射测试 +2. SpacetimeDB reducer 幂等测试 +3. API 查询维度测试 +4. 历史事件迁移测试,如涉及 +5. 跨边界日期测试 +6. 个人任务配置 scope 限制测试 +7. `Work => user_id` 错误映射回归测试 + +重点用例: + +```text +2024-02-29 闰年 +2025-12-29 ISO week 可能属于 2026-W01 +2026-01-01 跨年周 +2026-03-31 Q1 结束 +2026-04-01 Q2 开始 +2026-12-31 年末 +``` + +任务配置重点用例: + +```text +admin upsert daily_login + scopeKind=user -> 成功 +admin upsert daily_login + scopeKind=site -> 失败,错误信息说明个人任务仅支持 user +admin upsert daily_login + scopeKind=module -> 失败 +admin upsert daily_login + scopeKind=work -> 失败 +任务中心读取 daily_login -> 按 User + 当前 user_id 查询进度 +代码中不存在 Work => user_id 的静默映射 +``` + +## 测试与验证命令 + +具体命令需在定位模块后确认。初步建议: + +```text +npm run typecheck +npm test +``` + +后端如涉及 Rust: + +```text +cargo test -p module-analytics +cargo test -p spacetime-module +cargo test -p api-server +``` + +涉及 API smoke: + +```text +npm run api-server +``` + +然后验证: + +```text +GET /healthz +``` + +涉及 SpacetimeDB schema: + +- 需要生成绑定。 +- 需要确认 migration.rs 对齐。 +- 需要确认 publish 不触发不安全 schema 变更。 + +## 风险与权衡 + +### 风险 1:个人任务 scope_kind 被误配置导致进度异常 + +当前个人任务系统本质上按用户维度计算进度。如果允许运营配置 `site/work/module`,可能导致任务进度查错 `tracking_daily_stat` 聚合桶,出现任务永远不可领取或错误可领取。 + +缓解: + +```text +采用方案 B:后台隐藏埋点范围,后端限制个人任务配置只能写入 User。 +``` + +### 风险 2:Work 维度缺少 work_id,上游却静默用 user_id 代替 + +当前 `profile_task_tracking_scope_id` 中 `Work => user_id` 是错误语义。若后续扩展作品任务,会把作品维度统计错误映射到用户维度。 + +缓解: + +```text +移除 Work => user_id 映射;非 User 的个人任务配置应被拒绝。未来做作品任务时新增明确 work_id 来源和任务类型。 +``` + +### 风险 3:时区口径影响统计结果 + +周/月/季/年映射对时区敏感。当前日桶使用北京时间自然日:`floor((occurred_at_micros + 8h) / 1d)`。新增映射表应明确沿用北京时间业务日,还是切换为 UTC/用户本地时区。 + +### 风险 4:ISO week 跨年 + +ISO week-year 与自然年不同。若前端展示按自然年理解,可能产生认知差异。 + +### 风险 5:修改已有事件表可能触发 SpacetimeDB 迁移限制 + +如果已有事件表需要新增字段: + +- 字段必须加末尾。 +- 必须提供 default。 +- 历史数据要分批迁移。 + +### 风险 5:表设计过早绑定单一业务 + +建议用通用 date dimension,而不是为某个单一埋点写死周/月/季/年表,避免后续复用困难。 + +## 待确认问题 + +1. 周维度使用 ISO week 还是自然周?周一开始还是周日开始? +2. 周/月/季/年映射是否沿用当前北京时间业务日口径? +3. 这个映射表服务的是所有埋点,还是只服务个人任务/运营后台统计? +4. 是否需要 API 暴露这些映射关系,还是只用于后端聚合? +5. 是否需要回填历史事件?历史数据规模多大? +6. 未来是否会存在非个人任务,例如整站任务、模块任务、作品任务?如果会,应另行设计任务类型和 `scope_id` 来源,不应复用当前个人任务配置页直接开放 scope。 + +## 建议结论 + +优先采用“一张通用日期维度映射表”的设计: + +```text +analytics_date_dimension +``` + +通过字段同时提供: + +```text +day / week / month / quarter / year +``` + +后续统计按 `granularity` 选择 bucket key 聚合。这样比直接新增四张独立映射表更稳定、更容易复用,也更容易处理跨年周、季度边界和历史回填。 diff --git a/docs/experience/ADMIN_TASK_CONFIG_SCOPE_LOCK_2026-05-04.md b/docs/experience/ADMIN_TASK_CONFIG_SCOPE_LOCK_2026-05-04.md new file mode 100644 index 00000000..b3632e53 --- /dev/null +++ b/docs/experience/ADMIN_TASK_CONFIG_SCOPE_LOCK_2026-05-04.md @@ -0,0 +1,20 @@ +# AdminTaskConfigPage 埋点范围收口记录(2026-05-04) + +## 变更目标 +- 前端隐藏「埋点范围」选择项。 +- 保存任务配置时固定传递 `scopeKind=user`,避免运营在后台选择其他范围。 + +## 落地结果 +- `apps/admin-web/src/pages/AdminTaskConfigPage.tsx` + - 移除了「埋点范围」下拉选择 UI。 + - 保存时改为固定提交 `scopeKind: 'user'`。 + - 回填表单时不再读取或维护 `scopeKind` 的可编辑状态。 + +## 验证结果 +- 已检查页面源码,确认不再存在「埋点范围」字段与可编辑逻辑。 +- 已执行 `npm run admin-web:typecheck`。 +- 当前验证失败原因为环境缺少 `node_modules/typescript/bin/tsc`,属于依赖安装状态问题,不是本次前端改动引入的代码错误。 + +## 遗留说明 +- `apps/admin-web/src/api/adminApiTypes.ts` 中仍保留 `TrackingScopeKind` 类型,供接口契约与其他前端模块兼容使用。 +- `apps/admin-web/src/config/trackingEventDefinitions.ts` 仍保留事件定义中的 `scopeKind` 元数据,但页面不再允许运营修改。 diff --git a/docs/technical/ANALYTICS_DATE_DIMENSION_IMPLEMENTATION_2026-05-04.md b/docs/technical/ANALYTICS_DATE_DIMENSION_IMPLEMENTATION_2026-05-04.md new file mode 100644 index 00000000..e3f62918 --- /dev/null +++ b/docs/technical/ANALYTICS_DATE_DIMENSION_IMPLEMENTATION_2026-05-04.md @@ -0,0 +1,288 @@ +# Analytics Date Dimension 与个人任务埋点范围收口记录(2026-05-04) + +## 背景 + +本记录用于收口 `.hermes/plans/2026-05-04_022223-analytics-time-dimension-mapping.md` 中当前阶段已经落地的内容,并明确尚未执行的后续范围。 + +本阶段目标不是完整上线运营统计查询,而是先完成两件基础工作: + +1. 收紧个人任务系统的埋点范围,避免运营或接口把个人任务错误配置为 `site`、`module`、`work` 等非用户维度。 +2. 新增统一日期维表 `analytics_date_dimension`,为后续按周、月、季、年聚合埋点数据提供稳定的日期 bucket 映射。 + +## 当前已完成范围 + +### 1. 个人任务埋点范围锁定为 User + +当前个人任务系统首版只支持用户维度埋点。 + +已完成: + +- Admin 任务配置页不再展示“埋点范围”选择。 +- Admin 保存任务配置时固定传 `scopeKind: 'user'`。 +- API 层拒绝非 `user` 的个人任务配置。 +- 领域输入构造层拒绝非 `User` 的个人任务配置。 +- `Work => user_id` 的错误映射已移除。 +- 任务进度刷新、任务中心快照、领奖链路遇到非 `User` 的异常个人任务配置时显式报错,不再静默按 0 进度处理。 + +相关文件: + +```text +apps/admin-web/src/pages/AdminTaskConfigPage.tsx +apps/admin-web/src/api/adminApiTypes.ts +server-rs/crates/api-server/src/runtime_profile.rs +server-rs/crates/module-runtime/src/commands.rs +server-rs/crates/module-runtime/src/errors.rs +server-rs/crates/spacetime-module/src/runtime/profile.rs +``` + +### 2. 日期维表领域模型与纯函数 + +已在 `module-runtime` 中补充日期维表快照和纯函数。 + +日期维表使用现有北京时间业务日 `day_key` 语义: + +```text +date_key = floor((occurred_at_micros + 8h) / 1d) +``` + +已完成能力: + +- 从 `YYYY-MM-DD` 解析业务日 `date_key`。 +- 从 `date_key` 构造日期维表快照。 +- 生成 ISO weekday:周一=1,周日=7。 +- 生成 ISO week key:`YYYYWW`,跨年周按 ISO week-year。 +- 生成 week/month/quarter/year 的 key 和起止 `date_key`。 +- 限制日期维表支持范围为: + - `2000-01-01` + - 到 `2100-12-31` + +相关文件: + +```text +server-rs/crates/module-runtime/src/domain.rs +server-rs/crates/module-runtime/src/application.rs +server-rs/crates/module-runtime/src/lib.rs +``` + +### 3. SpacetimeDB 日期维表与 reducer + +已新增 SpacetimeDB 表: + +```text +analytics_date_dimension +``` + +表字段包括: + +```text +date_key +calendar_date +weekday +iso_week_key +week_start_date_key +week_end_date_key +month_key +month_start_date_key +month_end_date_key +quarter_key +quarter_start_date_key +quarter_end_date_key +year_key +year_start_date_key +year_end_date_key +created_at +updated_at +``` + +已新增索引: + +```text +iso_week_key +month_key +quarter_key +year_key +``` + +已新增 reducer: + +```text +ensure_analytics_date_dimension_for_date +seed_analytics_date_dimensions +``` + +当前 reducer 行为: + +- `ensure` 单日幂等补齐。 +- `seed` 按日期范围幂等补齐。 +- `seed` 拒绝 `start_date > end_date`。 +- `seed` 单次最多允许 `ANALYTICS_DATE_DIMENSION_MAX_SEED_DAYS = 3660` 天。 +- 裸 `date_key` 进入 ensure 前先做支持范围校验,避免极端整数进入日历算法。 + +相关文件: + +```text +server-rs/crates/spacetime-module/src/runtime/analytics_date_dimension.rs +server-rs/crates/spacetime-module/src/runtime/mod.rs +server-rs/crates/spacetime-module/src/migration.rs +docs/technical/SPACETIMEDB_TABLE_CATALOG.md +``` + +### 4. SpacetimeDB Rust client bindings + +已按项目脚本生成 Rust bindings,并在生成参数中显式包含 private tables/functions: + +```bash +PATH="/tmp/spacetime-bin:$PATH" npm run spacetime:generate -- --rust-only +``` + +本次已修改生成脚本: + +```text +scripts/generate-spacetime-bindings.mjs +``` + +在 `spacetime generate` 参数中加入: + +```text +--include-private +``` + +说明:SpacetimeDB CLI 2.1.0 的参数名是 `--include-private`,不是 `--non-private`。该参数含义是将 private tables/functions 也包含进生成代码,满足 api-server 通过 Rust bindings 访问 module private table/reducer 的需求。 + +```text +spacetimedb tool version 2.1.0; spacetimedb-lib version 2.1.0 +``` + +生成脚本: + +```text +scripts/generate-spacetime-bindings.mjs +``` + +已新增 analytics date dimension 相关 bindings: + +```text +server-rs/crates/spacetime-client/src/module_bindings/analytics_date_dimension_ensure_input_type.rs +server-rs/crates/spacetime-client/src/module_bindings/analytics_date_dimension_seed_input_type.rs +server-rs/crates/spacetime-client/src/module_bindings/analytics_date_dimension_type.rs +server-rs/crates/spacetime-client/src/module_bindings/analytics_date_dimension_table.rs +server-rs/crates/spacetime-client/src/module_bindings/ensure_analytics_date_dimension_for_date_reducer.rs +server-rs/crates/spacetime-client/src/module_bindings/seed_analytics_date_dimensions_reducer.rs +``` + +并更新了: + +```text +server-rs/crates/spacetime-client/src/module_bindings/mod.rs +``` + +注意: + +- `analytics_date_dimension` 表当前是 private table;由于生成脚本已加 `--include-private`,本次 codegen 已生成 `analytics_date_dimension_table.rs`,可通过 `ctx.db.analytics_date_dimension()` 访问 client cache / query builder。 +- bindings 目录是自动生成产物,本次以项目脚本整体刷新,除新增 analytics 文件外,也带来了大量已存在 table/reducer/procedure 文件的格式化/生成器输出差异。 + +### 5. 测试覆盖 + +已新增测试: + +```text +server-rs/crates/module-runtime/tests/analytics_date_dimension.rs +server-rs/crates/module-runtime/tests/profile_task_scope.rs +server-rs/crates/shared-contracts/tests/profile_task_contract.rs +``` + +覆盖重点: + +- `2024-02-29` 闰年。 +- `2025-12-29` ISO week 跨年。 +- `2026-01-01` 跨年周。 +- `2026-03-31` Q1 结束。 +- `2026-04-01` Q2 开始。 +- `2026-12-31` 年末。 +- 非法日期解析失败。 +- 超出日期维表支持范围失败。 +- 个人任务 `scopeKind=user` 成功。 +- 个人任务 `scopeKind=site/module/work` 失败。 +- `work` scope 不会静默映射到 `user_id`。 +- Admin 个人任务配置 contract 保持 `scopeKind: user`。 + +## 已验证命令 + +从 `server-rs/` 执行: + +```bash +cargo fmt -p module-runtime -p spacetime-module -p spacetime-client +cargo test -p spacetime-client --no-run +cargo test -p spacetime-module --no-run +cargo test -p module-runtime --test analytics_date_dimension +cargo test -p module-runtime --test profile_task_scope +cargo test -p shared-contracts --test profile_task_contract +``` + +从项目根目录执行: + +```bash +npm run admin-web:typecheck +``` + +当前结果: + +- `spacetime-client --no-run` 编译通过。 +- `spacetime-module --no-run` 编译通过。 +- `analytics_date_dimension` 测试通过:8 passed。 +- `profile_task_scope` 测试通过:3 passed。 +- `profile_task_contract` 测试通过:2 passed。 +- `admin-web:typecheck` 通过。 + +已知非本阶段阻塞: + +- 完整运行 `cargo test -p spacetime-module` 时,曾出现既有 puzzle 测试失败: + +```text +puzzle::tests::puzzle_preview_is_publishable_with_complete_draft FAILED +assertion failed: preview.publish_ready +``` + +该失败与当前埋点范围和日期维表改动无直接关系,本阶段以 `cargo test -p spacetime-module --no-run` 作为编译门禁。 + +## 当前未完成 / 暂缓项 + +### 1. 暂未新增 spacetime-client facade + +当前没有新增: + +```text +SpacetimeClient::ensure_analytics_date_dimension_for_date +SpacetimeClient::seed_analytics_date_dimensions +``` + +原因: + +- 生成脚本已加入 `--include-private`,private reducer/type/table bindings 已可用于后续 facade 实现。 +- 但 Step 7/8/9 暂缓,尚未由 `api-server` 或统计查询链路调用该能力。 +- 如后续只是 SpacetimeDB module 内部写入统计时 ensure,可以直接复用 module 内部 helper,不一定需要远程 client facade。 +- 若后续需要由 API 或运维接口触发 seed/ensure,可基于本次已生成的 reducer bindings 再补 facade。 + +### 2. Step 7/8/9 暂缓 + +本阶段未接入: + +- 事件写入链路自动 ensure 日期维表。 +- 聚合查询 API 的 `granularity = day | week | month | quarter | year`。 +- shared contracts / 前端 analytics contracts。 +- 历史事件回填。 + +这些应作为后续阶段单独设计和落地。 + +## 后续建议顺序 + +1. 如需提交本阶段改动,确认是否接受 `module_bindings` 整体刷新带来的大量生成文件 diff。 +2. 如希望 diff 更小,可评估仅提交 analytics date dimension 相关生成文件与 `mod.rs`;但需要非常谨慎,因为 `module_bindings` 是自动生成产物。 +3. 如需要由 `api-server` 触发 seed/ensure,再补 `spacetime-client` facade。 +4. 进入 Step 7/8/9:事件写入链路、聚合查询 API、前端 contracts。 + +## 阶段结论 + +当前阶段已经完成“个人任务埋点范围收紧”和“日期维表 module 侧能力”的核心落地,并已生成 SpacetimeDB Rust client bindings。 + +剩余工作不再是 bindings 环境阻塞,而是后续业务接入范围:是否增加 `spacetime-client` facade,以及是否继续推进事件写入链路、聚合查询 API 和前端 analytics contracts。 diff --git a/docs/technical/RUNTIME_PROFILE_TASK_SCOPE_2026-05-04.md b/docs/technical/RUNTIME_PROFILE_TASK_SCOPE_2026-05-04.md new file mode 100644 index 00000000..5c6fead0 --- /dev/null +++ b/docs/technical/RUNTIME_PROFILE_TASK_SCOPE_2026-05-04.md @@ -0,0 +1,18 @@ +# 个人任务 scope 限制说明(2026-05-04) + +## 背景 + +个人任务配置首版只支持按用户维度统计进度,即 `RuntimeTrackingScopeKind::User` / API `scopeKind: "user"`。`site`、`module`、`work` 未来可作为全站、模块或作品维度任务扩展,但当前不应被个人任务配置接受。 + +## 后端约束 + +- HTTP 管理接口 `admin_upsert_profile_task_config` 在解析 `scopeKind` 后立即校验:非 `user` 返回 400,并提示“个人任务 scopeKind 首版仅支持 user”。 +- 领域构造函数 `build_runtime_profile_task_config_admin_upsert_input` 兜底校验:非 `RuntimeTrackingScopeKind::User` 返回 `RuntimeProfileFieldError::UnsupportedProfileTaskScopeKind`。 +- SpacetimeDB 模块内 `profile_task_tracking_scope_id` 不再把 `Work` 静默映射到 `user_id`;非 User scope 返回 `None`,个人任务进度读取按 0 处理,避免错误串桶。 + +## 测试覆盖 + +`module-runtime` 单元测试覆盖: + +- `User` scope 可成功构造个人任务配置输入。 +- `Site` / `Module` / `Work` scope 均被拒绝,错误为 `UnsupportedProfileTaskScopeKind`。 diff --git a/scripts/generate-spacetime-bindings.mjs b/scripts/generate-spacetime-bindings.mjs index 071db39c..27f391b4 100644 --- a/scripts/generate-spacetime-bindings.mjs +++ b/scripts/generate-spacetime-bindings.mjs @@ -142,6 +142,7 @@ function buildGenerateArgs(target, outDir) { outDir, '--module-path', MODULE_PATH, + '--include-private', '--yes', ]; diff --git a/server-rs/crates/module-runtime/tests/analytics_date_dimension.rs b/server-rs/crates/module-runtime/tests/analytics_date_dimension.rs new file mode 100644 index 00000000..6d89ce7a --- /dev/null +++ b/server-rs/crates/module-runtime/tests/analytics_date_dimension.rs @@ -0,0 +1,148 @@ +use module_runtime::{ + AnalyticsDateDimensionSnapshot, RuntimeProfileFieldError, + build_analytics_date_dimension_from_date_key, parse_analytics_calendar_date_key, + validate_analytics_date_dimension_date_key, +}; + +fn dimension(calendar_date: &str) -> AnalyticsDateDimensionSnapshot { + let date_key = parse_analytics_calendar_date_key(calendar_date).expect("日期应可解析"); + build_analytics_date_dimension_from_date_key(date_key) +} + +fn date_key(calendar_date: &str) -> i64 { + parse_analytics_calendar_date_key(calendar_date).expect("日期应可解析") +} + +#[test] +fn analytics_date_dimension_handles_leap_day() { + // 中文注释:2024 是闰年,2 月应包含 29 日且属于 ISO 第 9 周。 + let snapshot = dimension("2024-02-29"); + + assert_eq!(snapshot.calendar_date, "2024-02-29"); + assert_eq!(snapshot.weekday, 4); + assert_eq!(snapshot.iso_week_key, 202409); + assert_eq!(snapshot.week_start_date_key, date_key("2024-02-26")); + assert_eq!(snapshot.week_end_date_key, date_key("2024-03-03")); + assert_eq!(snapshot.month_key, 202402); + assert_eq!(snapshot.month_start_date_key, date_key("2024-02-01")); + assert_eq!(snapshot.month_end_date_key, date_key("2024-02-29")); + assert_eq!(snapshot.quarter_key, 20241); + assert_eq!(snapshot.year_key, 2024); +} + +#[test] +fn analytics_date_dimension_uses_iso_week_year_across_year_boundary() { + // 中文注释:2025-12-29 是周一,但 ISO week-year 已经进入 2026-W01。 + let snapshot = dimension("2025-12-29"); + + assert_eq!(snapshot.calendar_date, "2025-12-29"); + assert_eq!(snapshot.weekday, 1); + assert_eq!(snapshot.iso_week_key, 202601); + assert_eq!(snapshot.week_start_date_key, date_key("2025-12-29")); + assert_eq!(snapshot.week_end_date_key, date_key("2026-01-04")); + assert_eq!(snapshot.month_key, 202512); + assert_eq!(snapshot.quarter_key, 20254); + assert_eq!(snapshot.year_key, 2025); +} + +#[test] +fn analytics_date_dimension_handles_new_year_inside_iso_week() { + // 中文注释:2026-01-01 仍落在 2026-W01,周范围跨自然年。 + let snapshot = dimension("2026-01-01"); + + assert_eq!(snapshot.calendar_date, "2026-01-01"); + assert_eq!(snapshot.weekday, 4); + assert_eq!(snapshot.iso_week_key, 202601); + assert_eq!(snapshot.week_start_date_key, date_key("2025-12-29")); + assert_eq!(snapshot.week_end_date_key, date_key("2026-01-04")); + assert_eq!(snapshot.month_key, 202601); + assert_eq!(snapshot.month_start_date_key, date_key("2026-01-01")); + assert_eq!(snapshot.month_end_date_key, date_key("2026-01-31")); + assert_eq!(snapshot.quarter_key, 20261); + assert_eq!(snapshot.year_key, 2026); +} + +#[test] +fn analytics_date_dimension_handles_q1_end() { + // 中文注释:Q1 结束日应映射到 2026Q1,季度边界为 1 月 1 日到 3 月 31 日。 + let snapshot = dimension("2026-03-31"); + + assert_eq!(snapshot.calendar_date, "2026-03-31"); + assert_eq!(snapshot.weekday, 2); + assert_eq!(snapshot.iso_week_key, 202614); + assert_eq!(snapshot.month_key, 202603); + assert_eq!(snapshot.month_start_date_key, date_key("2026-03-01")); + assert_eq!(snapshot.month_end_date_key, date_key("2026-03-31")); + assert_eq!(snapshot.quarter_key, 20261); + assert_eq!(snapshot.quarter_start_date_key, date_key("2026-01-01")); + assert_eq!(snapshot.quarter_end_date_key, date_key("2026-03-31")); + assert_eq!(snapshot.year_key, 2026); +} + +#[test] +fn analytics_date_dimension_handles_q2_start() { + // 中文注释:Q2 开始日应映射到 2026Q2,季度边界为 4 月 1 日到 6 月 30 日。 + let snapshot = dimension("2026-04-01"); + + assert_eq!(snapshot.calendar_date, "2026-04-01"); + assert_eq!(snapshot.weekday, 3); + assert_eq!(snapshot.iso_week_key, 202614); + assert_eq!(snapshot.month_key, 202604); + assert_eq!(snapshot.month_start_date_key, date_key("2026-04-01")); + assert_eq!(snapshot.month_end_date_key, date_key("2026-04-30")); + assert_eq!(snapshot.quarter_key, 20262); + assert_eq!(snapshot.quarter_start_date_key, date_key("2026-04-01")); + assert_eq!(snapshot.quarter_end_date_key, date_key("2026-06-30")); + assert_eq!(snapshot.year_key, 2026); +} + +#[test] +fn analytics_date_dimension_handles_year_end() { + // 中文注释:2026 年末属于 2026-W53,且所有自然年边界应保持在 2026 年内。 + let snapshot = dimension("2026-12-31"); + + assert_eq!(snapshot.calendar_date, "2026-12-31"); + assert_eq!(snapshot.weekday, 4); + assert_eq!(snapshot.iso_week_key, 202653); + assert_eq!(snapshot.week_start_date_key, date_key("2026-12-28")); + assert_eq!(snapshot.week_end_date_key, date_key("2027-01-03")); + assert_eq!(snapshot.month_key, 202612); + assert_eq!(snapshot.month_start_date_key, date_key("2026-12-01")); + assert_eq!(snapshot.month_end_date_key, date_key("2026-12-31")); + assert_eq!(snapshot.quarter_key, 20264); + assert_eq!(snapshot.quarter_start_date_key, date_key("2026-10-01")); + assert_eq!(snapshot.quarter_end_date_key, date_key("2026-12-31")); + assert_eq!(snapshot.year_key, 2026); + assert_eq!(snapshot.year_start_date_key, date_key("2026-01-01")); + assert_eq!(snapshot.year_end_date_key, date_key("2026-12-31")); +} + +#[test] +fn analytics_date_key_parser_rejects_invalid_calendar_dates() { + // 中文注释:非法日期和非 YYYY-MM-DD 字符串都必须解析失败,避免写入脏维表。 + assert_eq!( + parse_analytics_calendar_date_key("2026-02-30"), + Err(RuntimeProfileFieldError::InvalidAnalyticsCalendarDate) + ); + assert_eq!( + parse_analytics_calendar_date_key("bad"), + Err(RuntimeProfileFieldError::InvalidAnalyticsCalendarDate) + ); +} + +#[test] +fn analytics_date_dimension_rejects_out_of_supported_range() { + // 中文注释:维表只允许受控业务日期范围,避免裸 date_key 极值进入 reducer 日历算法。 + assert_eq!( + parse_analytics_calendar_date_key("1999-12-31"), + Err(RuntimeProfileFieldError::InvalidAnalyticsCalendarDate) + ); + assert_eq!( + parse_analytics_calendar_date_key("2101-01-01"), + Err(RuntimeProfileFieldError::InvalidAnalyticsCalendarDate) + ); + assert_eq!( + validate_analytics_date_dimension_date_key(i64::MAX), + Err(RuntimeProfileFieldError::InvalidAnalyticsCalendarDate) + ); +} diff --git a/server-rs/crates/module-runtime/tests/profile_task_scope.rs b/server-rs/crates/module-runtime/tests/profile_task_scope.rs new file mode 100644 index 00000000..0ee954c1 --- /dev/null +++ b/server-rs/crates/module-runtime/tests/profile_task_scope.rs @@ -0,0 +1,83 @@ +use module_runtime::{ + RuntimeProfileFieldError, RuntimeProfileTaskCycle, RuntimeTrackingScopeKind, + build_runtime_profile_task_config_admin_upsert_input, build_runtime_tracking_daily_stat_id, +}; + +fn build_task_scope_input( + scope_kind: RuntimeTrackingScopeKind, +) -> Result { + build_runtime_profile_task_config_admin_upsert_input( + "admin-1".to_string(), + "daily-login".to_string(), + "每日登录".to_string(), + "".to_string(), + "daily_login".to_string(), + RuntimeProfileTaskCycle::Daily, + scope_kind, + 1, + 10, + true, + 10, + 1_000, + ) +} + +#[test] +fn admin_upsert_build_input_accepts_user_scope() { + let input = build_task_scope_input(RuntimeTrackingScopeKind::User) + .expect("个人任务 user scope 应允许保存"); + + assert_eq!(input.scope_kind, RuntimeTrackingScopeKind::User); +} + +#[test] +fn admin_upsert_build_input_rejects_non_user_scope_with_clear_message() { + for scope_kind in [ + RuntimeTrackingScopeKind::Site, + RuntimeTrackingScopeKind::Module, + RuntimeTrackingScopeKind::Work, + ] { + let error = build_task_scope_input(scope_kind).expect_err("非 user scope 应拒绝保存"); + + assert_eq!( + error, + RuntimeProfileFieldError::UnsupportedProfileTaskScopeKind + ); + assert!( + error.to_string().contains("仅支持 user"), + "错误信息应明确说明个人任务仅支持 user,实际为:{}", + error + ); + } +} + +#[test] +fn tracking_daily_stat_id_keeps_work_scope_separate_from_user_scope() { + let user_id = "user-1"; + let work_id = "work-1"; + let day_key = 20_000; + + let user_stat_id = build_runtime_tracking_daily_stat_id( + "daily_login", + RuntimeTrackingScopeKind::User, + user_id, + day_key, + ); + let work_stat_id = build_runtime_tracking_daily_stat_id( + "daily_login", + RuntimeTrackingScopeKind::Work, + work_id, + day_key, + ); + let invalid_work_with_user_id_stat_id = build_runtime_tracking_daily_stat_id( + "daily_login", + RuntimeTrackingScopeKind::Work, + user_id, + day_key, + ); + + // 中文注释:Work 维度必须保留独立 scope_kind,不允许被静默当作 user_id 查询用户桶。 + assert!(user_stat_id.contains(":user:user-1:")); + assert!(work_stat_id.contains(":work:work-1:")); + assert_ne!(user_stat_id, invalid_work_with_user_id_stat_id); +} diff --git a/server-rs/crates/shared-contracts/tests/profile_task_contract.rs b/server-rs/crates/shared-contracts/tests/profile_task_contract.rs new file mode 100644 index 00000000..e679e960 --- /dev/null +++ b/server-rs/crates/shared-contracts/tests/profile_task_contract.rs @@ -0,0 +1,51 @@ +use serde_json::json; +use shared_contracts::runtime::{ + AdminUpsertProfileTaskConfigRequest, ProfileTaskConfigAdminResponse, TRACKING_SCOPE_KIND_USER, +}; + +#[test] +fn admin_upsert_profile_task_config_keeps_personal_task_scope_user() { + let request: AdminUpsertProfileTaskConfigRequest = serde_json::from_value(json!({ + "taskId": "daily_login", + "title": "每日登录", + "description": "", + "eventKey": "daily_login", + "cycle": "daily", + "scopeKind": "user", + "threshold": 1, + "rewardPoints": 10, + "enabled": true, + "sortOrder": 10 + })) + .expect("个人任务配置请求应接受 user scope"); + + assert_eq!(request.scope_kind, TRACKING_SCOPE_KIND_USER); + + let value = serde_json::to_value(request).expect("个人任务配置请求应可序列化"); + assert_eq!(value["scopeKind"], json!(TRACKING_SCOPE_KIND_USER)); +} + +#[test] +fn profile_task_config_admin_response_serializes_scope_kind_as_user() { + let response = ProfileTaskConfigAdminResponse { + task_id: "daily_login".to_string(), + title: "每日登录".to_string(), + description: "".to_string(), + event_key: "daily_login".to_string(), + cycle: "daily".to_string(), + scope_kind: TRACKING_SCOPE_KIND_USER.to_string(), + threshold: 1, + reward_points: 10, + enabled: true, + sort_order: 10, + created_by: "admin".to_string(), + created_at: "2026-05-04T00:00:00Z".to_string(), + updated_by: "admin".to_string(), + updated_at: "2026-05-04T00:00:00Z".to_string(), + }; + + let value = serde_json::to_value(response).expect("个人任务配置响应应可序列化"); + assert_eq!(value["scopeKind"], json!(TRACKING_SCOPE_KIND_USER)); + assert_eq!(value["taskId"], json!("daily_login")); + assert_eq!(value["rewardPoints"], json!(10)); +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/accept_quest_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/accept_quest_reducer.rs index 61e6b9c5..dfebf903 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/accept_quest_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/accept_quest_reducer.rs @@ -47,11 +47,9 @@ pub trait accept_quest { &self, input: QuestRecordInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()>; } @@ -60,11 +58,9 @@ impl accept_quest for super::RemoteReducers { &self, input: QuestRecordInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()> { self.imp .invoke_reducer_with_callback(AcceptQuestArgs { input }, callback) diff --git a/server-rs/crates/spacetime-client/src/module_bindings/acknowledge_quest_completion_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/acknowledge_quest_completion_reducer.rs index b1419fb7..6ae2fd10 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/acknowledge_quest_completion_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/acknowledge_quest_completion_reducer.rs @@ -47,11 +47,9 @@ pub trait acknowledge_quest_completion { &self, input: QuestCompletionAckInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()>; } @@ -60,11 +58,9 @@ impl acknowledge_quest_completion for super::RemoteReducers { &self, input: QuestCompletionAckInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()> { self.imp .invoke_reducer_with_callback(AcknowledgeQuestCompletionArgs { input }, callback) diff --git a/server-rs/crates/spacetime-client/src/module_bindings/admin_disable_profile_redeem_code_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/admin_disable_profile_redeem_code_procedure.rs index 9865ace5..bbdaab4f 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/admin_disable_profile_redeem_code_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/admin_disable_profile_redeem_code_procedure.rs @@ -31,10 +31,10 @@ pub trait admin_disable_profile_redeem_code { input: RuntimeProfileRedeemCodeAdminDisableInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl admin_disable_profile_redeem_code for super::RemoteProcedures { input: RuntimeProfileRedeemCodeAdminDisableInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, RuntimeProfileRedeemCodeAdminProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/admin_disable_profile_task_config_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/admin_disable_profile_task_config_procedure.rs index 0417bd2e..c968f950 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/admin_disable_profile_task_config_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/admin_disable_profile_task_config_procedure.rs @@ -31,10 +31,10 @@ pub trait admin_disable_profile_task_config { input: RuntimeProfileTaskConfigAdminDisableInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl admin_disable_profile_task_config for super::RemoteProcedures { input: RuntimeProfileTaskConfigAdminDisableInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, RuntimeProfileTaskConfigAdminProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/admin_list_profile_invite_codes_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/admin_list_profile_invite_codes_procedure.rs index 96d2350f..cdfa27d9 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/admin_list_profile_invite_codes_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/admin_list_profile_invite_codes_procedure.rs @@ -31,10 +31,10 @@ pub trait admin_list_profile_invite_codes { input: RuntimeProfileInviteCodeAdminListInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl admin_list_profile_invite_codes for super::RemoteProcedures { input: RuntimeProfileInviteCodeAdminListInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, RuntimeProfileInviteCodeAdminListProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/admin_list_profile_redeem_codes_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/admin_list_profile_redeem_codes_procedure.rs index c7d6a78e..2c9b9dd7 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/admin_list_profile_redeem_codes_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/admin_list_profile_redeem_codes_procedure.rs @@ -31,10 +31,10 @@ pub trait admin_list_profile_redeem_codes { input: RuntimeProfileRedeemCodeAdminListInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl admin_list_profile_redeem_codes for super::RemoteProcedures { input: RuntimeProfileRedeemCodeAdminListInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, RuntimeProfileRedeemCodeAdminListProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/admin_list_profile_task_configs_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/admin_list_profile_task_configs_procedure.rs index a152116d..88ca28d5 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/admin_list_profile_task_configs_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/admin_list_profile_task_configs_procedure.rs @@ -31,10 +31,10 @@ pub trait admin_list_profile_task_configs { input: RuntimeProfileTaskConfigAdminListInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl admin_list_profile_task_configs for super::RemoteProcedures { input: RuntimeProfileTaskConfigAdminListInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, RuntimeProfileTaskConfigAdminListProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/admin_upsert_profile_invite_code_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/admin_upsert_profile_invite_code_procedure.rs index 2411092d..3601be97 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/admin_upsert_profile_invite_code_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/admin_upsert_profile_invite_code_procedure.rs @@ -31,10 +31,10 @@ pub trait admin_upsert_profile_invite_code { input: RuntimeProfileInviteCodeAdminUpsertInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl admin_upsert_profile_invite_code for super::RemoteProcedures { input: RuntimeProfileInviteCodeAdminUpsertInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, RuntimeProfileInviteCodeAdminProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/admin_upsert_profile_redeem_code_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/admin_upsert_profile_redeem_code_procedure.rs index 9c7ae92f..7e918220 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/admin_upsert_profile_redeem_code_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/admin_upsert_profile_redeem_code_procedure.rs @@ -31,10 +31,10 @@ pub trait admin_upsert_profile_redeem_code { input: RuntimeProfileRedeemCodeAdminUpsertInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl admin_upsert_profile_redeem_code for super::RemoteProcedures { input: RuntimeProfileRedeemCodeAdminUpsertInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, RuntimeProfileRedeemCodeAdminProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/admin_upsert_profile_task_config_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/admin_upsert_profile_task_config_procedure.rs index b441a808..a3d3e11a 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/admin_upsert_profile_task_config_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/admin_upsert_profile_task_config_procedure.rs @@ -31,10 +31,10 @@ pub trait admin_upsert_profile_task_config { input: RuntimeProfileTaskConfigAdminUpsertInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl admin_upsert_profile_task_config for super::RemoteProcedures { input: RuntimeProfileTaskConfigAdminUpsertInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, RuntimeProfileTaskConfigAdminProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/advance_puzzle_next_level_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/advance_puzzle_next_level_procedure.rs index 7cb4f8f4..6d3e9f79 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/advance_puzzle_next_level_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/advance_puzzle_next_level_procedure.rs @@ -31,10 +31,10 @@ pub trait advance_puzzle_next_level { input: PuzzleRunNextLevelInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl advance_puzzle_next_level for super::RemoteProcedures { input: PuzzleRunNextLevelInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, PuzzleRunProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/ai_result_reference_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/ai_result_reference_table.rs new file mode 100644 index 00000000..09b7c492 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/ai_result_reference_table.rs @@ -0,0 +1,166 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use 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`. +/// +/// Obtain a handle from the [`AiResultReferenceTableAccess::ai_result_reference`] method on [`super::RemoteTables`], +/// like `ctx.db.ai_result_reference()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.ai_result_reference().on_insert(...)`. +pub struct AiResultReferenceTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `ai_result_reference`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait AiResultReferenceTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`AiResultReferenceTableHandle`], which mediates access to the table `ai_result_reference`. + fn ai_result_reference(&self) -> AiResultReferenceTableHandle<'_>; +} + +impl AiResultReferenceTableAccess for super::RemoteTables { + fn ai_result_reference(&self) -> AiResultReferenceTableHandle<'_> { + AiResultReferenceTableHandle { + imp: self + .imp + .get_table::("ai_result_reference"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct AiResultReferenceInsertCallbackId(__sdk::CallbackId); +pub struct AiResultReferenceDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for AiResultReferenceTableHandle<'ctx> { + type Row = AiResultReference; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = AiResultReferenceInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> AiResultReferenceInsertCallbackId { + AiResultReferenceInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: AiResultReferenceInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = AiResultReferenceDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> AiResultReferenceDeleteCallbackId { + AiResultReferenceDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: AiResultReferenceDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct AiResultReferenceUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for AiResultReferenceTableHandle<'ctx> { + type UpdateCallbackId = AiResultReferenceUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> AiResultReferenceUpdateCallbackId { + AiResultReferenceUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: AiResultReferenceUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `result_reference_row_id` unique index on the table `ai_result_reference`, +/// which allows point queries on the field of the same name +/// via the [`AiResultReferenceResultReferenceRowIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.ai_result_reference().result_reference_row_id().find(...)`. +pub struct AiResultReferenceResultReferenceRowIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> AiResultReferenceTableHandle<'ctx> { + /// Get a handle on the `result_reference_row_id` unique index on the table `ai_result_reference`. + pub fn result_reference_row_id(&self) -> AiResultReferenceResultReferenceRowIdUnique<'ctx> { + AiResultReferenceResultReferenceRowIdUnique { + imp: self + .imp + .get_unique_constraint::("result_reference_row_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> AiResultReferenceResultReferenceRowIdUnique<'ctx> { + /// Find the subscribed row whose `result_reference_row_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("ai_result_reference"); + _table.add_unique_constraint::("result_reference_row_id", |row| { + &row.result_reference_row_id + }); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `AiResultReference`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait ai_result_referenceQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `AiResultReference`. + fn ai_result_reference(&self) -> __sdk::__query_builder::Table; +} + +impl ai_result_referenceQueryTableAccess for __sdk::QueryTableAccessor { + fn ai_result_reference(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("ai_result_reference") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/ai_task_stage_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/ai_task_stage_table.rs new file mode 100644 index 00000000..0bd84f77 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/ai_task_stage_table.rs @@ -0,0 +1,161 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::ai_task_stage_kind_type::AiTaskStageKind; +use super::ai_task_stage_status_type::AiTaskStageStatus; +use super::ai_task_stage_type::AiTaskStage; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `ai_task_stage`. +/// +/// Obtain a handle from the [`AiTaskStageTableAccess::ai_task_stage`] method on [`super::RemoteTables`], +/// like `ctx.db.ai_task_stage()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.ai_task_stage().on_insert(...)`. +pub struct AiTaskStageTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `ai_task_stage`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait AiTaskStageTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`AiTaskStageTableHandle`], which mediates access to the table `ai_task_stage`. + fn ai_task_stage(&self) -> AiTaskStageTableHandle<'_>; +} + +impl AiTaskStageTableAccess for super::RemoteTables { + fn ai_task_stage(&self) -> AiTaskStageTableHandle<'_> { + AiTaskStageTableHandle { + imp: self.imp.get_table::("ai_task_stage"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct AiTaskStageInsertCallbackId(__sdk::CallbackId); +pub struct AiTaskStageDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for AiTaskStageTableHandle<'ctx> { + type Row = AiTaskStage; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = AiTaskStageInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> AiTaskStageInsertCallbackId { + AiTaskStageInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: AiTaskStageInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = AiTaskStageDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> AiTaskStageDeleteCallbackId { + AiTaskStageDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: AiTaskStageDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct AiTaskStageUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for AiTaskStageTableHandle<'ctx> { + type UpdateCallbackId = AiTaskStageUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> AiTaskStageUpdateCallbackId { + AiTaskStageUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: AiTaskStageUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `task_stage_id` unique index on the table `ai_task_stage`, +/// which allows point queries on the field of the same name +/// via the [`AiTaskStageTaskStageIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.ai_task_stage().task_stage_id().find(...)`. +pub struct AiTaskStageTaskStageIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> AiTaskStageTableHandle<'ctx> { + /// Get a handle on the `task_stage_id` unique index on the table `ai_task_stage`. + pub fn task_stage_id(&self) -> AiTaskStageTaskStageIdUnique<'ctx> { + AiTaskStageTaskStageIdUnique { + imp: self.imp.get_unique_constraint::("task_stage_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> AiTaskStageTaskStageIdUnique<'ctx> { + /// Find the subscribed row whose `task_stage_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("ai_task_stage"); + _table.add_unique_constraint::("task_stage_id", |row| &row.task_stage_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `AiTaskStage`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait ai_task_stageQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `AiTaskStage`. + fn ai_task_stage(&self) -> __sdk::__query_builder::Table; +} + +impl ai_task_stageQueryTableAccess for __sdk::QueryTableAccessor { + fn ai_task_stage(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("ai_task_stage") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/ai_task_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/ai_task_table.rs new file mode 100644 index 00000000..83c04b8a --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/ai_task_table.rs @@ -0,0 +1,161 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::ai_task_kind_type::AiTaskKind; +use super::ai_task_status_type::AiTaskStatus; +use super::ai_task_type::AiTask; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `ai_task`. +/// +/// Obtain a handle from the [`AiTaskTableAccess::ai_task`] method on [`super::RemoteTables`], +/// like `ctx.db.ai_task()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.ai_task().on_insert(...)`. +pub struct AiTaskTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `ai_task`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait AiTaskTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`AiTaskTableHandle`], which mediates access to the table `ai_task`. + fn ai_task(&self) -> AiTaskTableHandle<'_>; +} + +impl AiTaskTableAccess for super::RemoteTables { + fn ai_task(&self) -> AiTaskTableHandle<'_> { + AiTaskTableHandle { + imp: self.imp.get_table::("ai_task"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct AiTaskInsertCallbackId(__sdk::CallbackId); +pub struct AiTaskDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for AiTaskTableHandle<'ctx> { + type Row = AiTask; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = AiTaskInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> AiTaskInsertCallbackId { + AiTaskInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: AiTaskInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = AiTaskDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> AiTaskDeleteCallbackId { + AiTaskDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: AiTaskDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct AiTaskUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for AiTaskTableHandle<'ctx> { + type UpdateCallbackId = AiTaskUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> AiTaskUpdateCallbackId { + AiTaskUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: AiTaskUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `task_id` unique index on the table `ai_task`, +/// which allows point queries on the field of the same name +/// via the [`AiTaskTaskIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.ai_task().task_id().find(...)`. +pub struct AiTaskTaskIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> AiTaskTableHandle<'ctx> { + /// Get a handle on the `task_id` unique index on the table `ai_task`. + pub fn task_id(&self) -> AiTaskTaskIdUnique<'ctx> { + AiTaskTaskIdUnique { + imp: self.imp.get_unique_constraint::("task_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> AiTaskTaskIdUnique<'ctx> { + /// Find the subscribed row whose `task_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("ai_task"); + _table.add_unique_constraint::("task_id", |row| &row.task_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `AiTask`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait ai_taskQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `AiTask`. + fn ai_task(&self) -> __sdk::__query_builder::Table; +} + +impl ai_taskQueryTableAccess for __sdk::QueryTableAccessor { + fn ai_task(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("ai_task") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/ai_text_chunk_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/ai_text_chunk_table.rs new file mode 100644 index 00000000..7311d79f --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/ai_text_chunk_table.rs @@ -0,0 +1,162 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use 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`. +/// +/// Obtain a handle from the [`AiTextChunkTableAccess::ai_text_chunk`] method on [`super::RemoteTables`], +/// like `ctx.db.ai_text_chunk()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.ai_text_chunk().on_insert(...)`. +pub struct AiTextChunkTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `ai_text_chunk`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait AiTextChunkTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`AiTextChunkTableHandle`], which mediates access to the table `ai_text_chunk`. + fn ai_text_chunk(&self) -> AiTextChunkTableHandle<'_>; +} + +impl AiTextChunkTableAccess for super::RemoteTables { + fn ai_text_chunk(&self) -> AiTextChunkTableHandle<'_> { + AiTextChunkTableHandle { + imp: self.imp.get_table::("ai_text_chunk"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct AiTextChunkInsertCallbackId(__sdk::CallbackId); +pub struct AiTextChunkDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for AiTextChunkTableHandle<'ctx> { + type Row = AiTextChunk; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = AiTextChunkInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> AiTextChunkInsertCallbackId { + AiTextChunkInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: AiTextChunkInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = AiTextChunkDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> AiTextChunkDeleteCallbackId { + AiTextChunkDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: AiTextChunkDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct AiTextChunkUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for AiTextChunkTableHandle<'ctx> { + type UpdateCallbackId = AiTextChunkUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> AiTextChunkUpdateCallbackId { + AiTextChunkUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: AiTextChunkUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `text_chunk_row_id` unique index on the table `ai_text_chunk`, +/// which allows point queries on the field of the same name +/// via the [`AiTextChunkTextChunkRowIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.ai_text_chunk().text_chunk_row_id().find(...)`. +pub struct AiTextChunkTextChunkRowIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> AiTextChunkTableHandle<'ctx> { + /// Get a handle on the `text_chunk_row_id` unique index on the table `ai_text_chunk`. + pub fn text_chunk_row_id(&self) -> AiTextChunkTextChunkRowIdUnique<'ctx> { + AiTextChunkTextChunkRowIdUnique { + imp: self + .imp + .get_unique_constraint::("text_chunk_row_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> AiTextChunkTextChunkRowIdUnique<'ctx> { + /// Find the subscribed row whose `text_chunk_row_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("ai_text_chunk"); + _table.add_unique_constraint::("text_chunk_row_id", |row| &row.text_chunk_row_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `AiTextChunk`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait ai_text_chunkQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `AiTextChunk`. + fn ai_text_chunk(&self) -> __sdk::__query_builder::Table; +} + +impl ai_text_chunkQueryTableAccess for __sdk::QueryTableAccessor { + fn ai_text_chunk(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("ai_text_chunk") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/analytics_date_dimension_ensure_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/analytics_date_dimension_ensure_input_type.rs new file mode 100644 index 00000000..3dbed9a1 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/analytics_date_dimension_ensure_input_type.rs @@ -0,0 +1,15 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] +#[sats(crate = __lib)] +pub struct AnalyticsDateDimensionEnsureInput { + pub date_key: i64, +} + +impl __sdk::InModule for AnalyticsDateDimensionEnsureInput { + type Module = super::RemoteModule; +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/analytics_date_dimension_seed_input_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/analytics_date_dimension_seed_input_type.rs new file mode 100644 index 00000000..3ed818d0 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/analytics_date_dimension_seed_input_type.rs @@ -0,0 +1,16 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] +#[sats(crate = __lib)] +pub struct AnalyticsDateDimensionSeedInput { + pub start_date: String, + pub end_date: String, +} + +impl __sdk::InModule for AnalyticsDateDimensionSeedInput { + type Module = super::RemoteModule; +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/analytics_date_dimension_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/analytics_date_dimension_table.rs new file mode 100644 index 00000000..a7c6515e --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/analytics_date_dimension_table.rs @@ -0,0 +1,162 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::analytics_date_dimension_type::AnalyticsDateDimension; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `analytics_date_dimension`. +/// +/// Obtain a handle from the [`AnalyticsDateDimensionTableAccess::analytics_date_dimension`] method on [`super::RemoteTables`], +/// like `ctx.db.analytics_date_dimension()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.analytics_date_dimension().on_insert(...)`. +pub struct AnalyticsDateDimensionTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `analytics_date_dimension`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait AnalyticsDateDimensionTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`AnalyticsDateDimensionTableHandle`], which mediates access to the table `analytics_date_dimension`. + fn analytics_date_dimension(&self) -> AnalyticsDateDimensionTableHandle<'_>; +} + +impl AnalyticsDateDimensionTableAccess for super::RemoteTables { + fn analytics_date_dimension(&self) -> AnalyticsDateDimensionTableHandle<'_> { + AnalyticsDateDimensionTableHandle { + imp: self + .imp + .get_table::("analytics_date_dimension"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct AnalyticsDateDimensionInsertCallbackId(__sdk::CallbackId); +pub struct AnalyticsDateDimensionDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for AnalyticsDateDimensionTableHandle<'ctx> { + type Row = AnalyticsDateDimension; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = AnalyticsDateDimensionInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> AnalyticsDateDimensionInsertCallbackId { + AnalyticsDateDimensionInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: AnalyticsDateDimensionInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = AnalyticsDateDimensionDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> AnalyticsDateDimensionDeleteCallbackId { + AnalyticsDateDimensionDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: AnalyticsDateDimensionDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct AnalyticsDateDimensionUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for AnalyticsDateDimensionTableHandle<'ctx> { + type UpdateCallbackId = AnalyticsDateDimensionUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> AnalyticsDateDimensionUpdateCallbackId { + AnalyticsDateDimensionUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: AnalyticsDateDimensionUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `date_key` unique index on the table `analytics_date_dimension`, +/// which allows point queries on the field of the same name +/// via the [`AnalyticsDateDimensionDateKeyUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.analytics_date_dimension().date_key().find(...)`. +pub struct AnalyticsDateDimensionDateKeyUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> AnalyticsDateDimensionTableHandle<'ctx> { + /// Get a handle on the `date_key` unique index on the table `analytics_date_dimension`. + pub fn date_key(&self) -> AnalyticsDateDimensionDateKeyUnique<'ctx> { + AnalyticsDateDimensionDateKeyUnique { + imp: self.imp.get_unique_constraint::("date_key"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> AnalyticsDateDimensionDateKeyUnique<'ctx> { + /// Find the subscribed row whose `date_key` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &i64) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = + client_cache.get_or_make_table::("analytics_date_dimension"); + _table.add_unique_constraint::("date_key", |row| &row.date_key); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `AnalyticsDateDimension`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait analytics_date_dimensionQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `AnalyticsDateDimension`. + fn analytics_date_dimension(&self) -> __sdk::__query_builder::Table; +} + +impl analytics_date_dimensionQueryTableAccess for __sdk::QueryTableAccessor { + fn analytics_date_dimension(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("analytics_date_dimension") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/analytics_date_dimension_type.rs b/server-rs/crates/spacetime-client/src/module_bindings/analytics_date_dimension_type.rs new file mode 100644 index 00000000..ed10075b --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/analytics_date_dimension_type.rs @@ -0,0 +1,120 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] +#[sats(crate = __lib)] +pub struct AnalyticsDateDimension { + pub date_key: i64, + pub calendar_date: String, + pub weekday: u8, + pub iso_week_key: i32, + pub week_start_date_key: i64, + pub week_end_date_key: i64, + pub month_key: i32, + pub month_start_date_key: i64, + pub month_end_date_key: i64, + pub quarter_key: i32, + pub quarter_start_date_key: i64, + pub quarter_end_date_key: i64, + pub year_key: i32, + pub year_start_date_key: i64, + pub year_end_date_key: i64, + pub created_at: __sdk::Timestamp, + pub updated_at: __sdk::Timestamp, +} + +impl __sdk::InModule for AnalyticsDateDimension { + type Module = super::RemoteModule; +} + +/// Column accessor struct for the table `AnalyticsDateDimension`. +/// +/// Provides typed access to columns for query building. +pub struct AnalyticsDateDimensionCols { + pub date_key: __sdk::__query_builder::Col, + pub calendar_date: __sdk::__query_builder::Col, + pub weekday: __sdk::__query_builder::Col, + pub iso_week_key: __sdk::__query_builder::Col, + pub week_start_date_key: __sdk::__query_builder::Col, + pub week_end_date_key: __sdk::__query_builder::Col, + pub month_key: __sdk::__query_builder::Col, + pub month_start_date_key: __sdk::__query_builder::Col, + pub month_end_date_key: __sdk::__query_builder::Col, + pub quarter_key: __sdk::__query_builder::Col, + pub quarter_start_date_key: __sdk::__query_builder::Col, + pub quarter_end_date_key: __sdk::__query_builder::Col, + pub year_key: __sdk::__query_builder::Col, + pub year_start_date_key: __sdk::__query_builder::Col, + pub year_end_date_key: __sdk::__query_builder::Col, + pub created_at: __sdk::__query_builder::Col, + pub updated_at: __sdk::__query_builder::Col, +} + +impl __sdk::__query_builder::HasCols for AnalyticsDateDimension { + type Cols = AnalyticsDateDimensionCols; + fn cols(table_name: &'static str) -> Self::Cols { + AnalyticsDateDimensionCols { + date_key: __sdk::__query_builder::Col::new(table_name, "date_key"), + calendar_date: __sdk::__query_builder::Col::new(table_name, "calendar_date"), + weekday: __sdk::__query_builder::Col::new(table_name, "weekday"), + iso_week_key: __sdk::__query_builder::Col::new(table_name, "iso_week_key"), + week_start_date_key: __sdk::__query_builder::Col::new( + table_name, + "week_start_date_key", + ), + week_end_date_key: __sdk::__query_builder::Col::new(table_name, "week_end_date_key"), + month_key: __sdk::__query_builder::Col::new(table_name, "month_key"), + month_start_date_key: __sdk::__query_builder::Col::new( + table_name, + "month_start_date_key", + ), + month_end_date_key: __sdk::__query_builder::Col::new(table_name, "month_end_date_key"), + quarter_key: __sdk::__query_builder::Col::new(table_name, "quarter_key"), + quarter_start_date_key: __sdk::__query_builder::Col::new( + table_name, + "quarter_start_date_key", + ), + quarter_end_date_key: __sdk::__query_builder::Col::new( + table_name, + "quarter_end_date_key", + ), + year_key: __sdk::__query_builder::Col::new(table_name, "year_key"), + year_start_date_key: __sdk::__query_builder::Col::new( + table_name, + "year_start_date_key", + ), + year_end_date_key: __sdk::__query_builder::Col::new(table_name, "year_end_date_key"), + created_at: __sdk::__query_builder::Col::new(table_name, "created_at"), + updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"), + } + } +} + +/// Indexed column accessor struct for the table `AnalyticsDateDimension`. +/// +/// Provides typed access to indexed columns for query building. +pub struct AnalyticsDateDimensionIxCols { + pub date_key: __sdk::__query_builder::IxCol, + pub iso_week_key: __sdk::__query_builder::IxCol, + pub month_key: __sdk::__query_builder::IxCol, + pub quarter_key: __sdk::__query_builder::IxCol, + pub year_key: __sdk::__query_builder::IxCol, +} + +impl __sdk::__query_builder::HasIxCols for AnalyticsDateDimension { + type IxCols = AnalyticsDateDimensionIxCols; + fn ix_cols(table_name: &'static str) -> Self::IxCols { + AnalyticsDateDimensionIxCols { + date_key: __sdk::__query_builder::IxCol::new(table_name, "date_key"), + iso_week_key: __sdk::__query_builder::IxCol::new(table_name, "iso_week_key"), + month_key: __sdk::__query_builder::IxCol::new(table_name, "month_key"), + quarter_key: __sdk::__query_builder::IxCol::new(table_name, "quarter_key"), + year_key: __sdk::__query_builder::IxCol::new(table_name, "year_key"), + } + } +} + +impl __sdk::__query_builder::CanBeLookupTable for AnalyticsDateDimension {} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/append_ai_text_chunk_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/append_ai_text_chunk_and_return_procedure.rs index 191e2ea7..11323392 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/append_ai_text_chunk_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/append_ai_text_chunk_and_return_procedure.rs @@ -31,10 +31,10 @@ pub trait append_ai_text_chunk_and_return { input: AiTextChunkAppendInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl append_ai_text_chunk_and_return for super::RemoteProcedures { input: AiTextChunkAppendInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, AiTaskProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/apply_chapter_progression_ledger_entry_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/apply_chapter_progression_ledger_entry_and_return_procedure.rs index 4a949906..bba4c841 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/apply_chapter_progression_ledger_entry_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/apply_chapter_progression_ledger_entry_and_return_procedure.rs @@ -34,10 +34,10 @@ pub trait apply_chapter_progression_ledger_entry_and_return { input: ChapterProgressionLedgerInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -47,10 +47,10 @@ impl apply_chapter_progression_ledger_entry_and_return for super::RemoteProcedur input: ChapterProgressionLedgerInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, ChapterProgressionProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/apply_chapter_progression_ledger_entry_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/apply_chapter_progression_ledger_entry_reducer.rs index 44596083..98f821ef 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/apply_chapter_progression_ledger_entry_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/apply_chapter_progression_ledger_entry_reducer.rs @@ -50,11 +50,9 @@ pub trait apply_chapter_progression_ledger_entry { &self, input: ChapterProgressionLedgerInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()>; } @@ -63,11 +61,9 @@ impl apply_chapter_progression_ledger_entry for super::RemoteReducers { &self, input: ChapterProgressionLedgerInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()> { self.imp.invoke_reducer_with_callback( ApplyChapterProgressionLedgerEntryArgs { input }, diff --git a/server-rs/crates/spacetime-client/src/module_bindings/apply_inventory_mutation_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/apply_inventory_mutation_reducer.rs index d9b4240d..91f7d2c0 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/apply_inventory_mutation_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/apply_inventory_mutation_reducer.rs @@ -47,11 +47,9 @@ pub trait apply_inventory_mutation { &self, input: InventoryMutationInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()>; } @@ -60,11 +58,9 @@ impl apply_inventory_mutation for super::RemoteReducers { &self, input: InventoryMutationInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()> { self.imp .invoke_reducer_with_callback(ApplyInventoryMutationArgs { input }, callback) diff --git a/server-rs/crates/spacetime-client/src/module_bindings/apply_quest_signal_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/apply_quest_signal_reducer.rs index 6b4c310b..afb452b5 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/apply_quest_signal_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/apply_quest_signal_reducer.rs @@ -47,11 +47,9 @@ pub trait apply_quest_signal { &self, input: QuestSignalApplyInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()>; } @@ -60,11 +58,9 @@ impl apply_quest_signal for super::RemoteReducers { &self, input: QuestSignalApplyInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()> { self.imp .invoke_reducer_with_callback(ApplyQuestSignalArgs { input }, callback) diff --git a/server-rs/crates/spacetime-client/src/module_bindings/asset_entity_binding_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/asset_entity_binding_table.rs new file mode 100644 index 00000000..971704ae --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/asset_entity_binding_table.rs @@ -0,0 +1,161 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::asset_entity_binding_type::AssetEntityBinding; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `asset_entity_binding`. +/// +/// Obtain a handle from the [`AssetEntityBindingTableAccess::asset_entity_binding`] method on [`super::RemoteTables`], +/// like `ctx.db.asset_entity_binding()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.asset_entity_binding().on_insert(...)`. +pub struct AssetEntityBindingTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `asset_entity_binding`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait AssetEntityBindingTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`AssetEntityBindingTableHandle`], which mediates access to the table `asset_entity_binding`. + fn asset_entity_binding(&self) -> AssetEntityBindingTableHandle<'_>; +} + +impl AssetEntityBindingTableAccess for super::RemoteTables { + fn asset_entity_binding(&self) -> AssetEntityBindingTableHandle<'_> { + AssetEntityBindingTableHandle { + imp: self + .imp + .get_table::("asset_entity_binding"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct AssetEntityBindingInsertCallbackId(__sdk::CallbackId); +pub struct AssetEntityBindingDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for AssetEntityBindingTableHandle<'ctx> { + type Row = AssetEntityBinding; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = AssetEntityBindingInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> AssetEntityBindingInsertCallbackId { + AssetEntityBindingInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: AssetEntityBindingInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = AssetEntityBindingDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> AssetEntityBindingDeleteCallbackId { + AssetEntityBindingDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: AssetEntityBindingDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct AssetEntityBindingUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for AssetEntityBindingTableHandle<'ctx> { + type UpdateCallbackId = AssetEntityBindingUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> AssetEntityBindingUpdateCallbackId { + AssetEntityBindingUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: AssetEntityBindingUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `binding_id` unique index on the table `asset_entity_binding`, +/// which allows point queries on the field of the same name +/// via the [`AssetEntityBindingBindingIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.asset_entity_binding().binding_id().find(...)`. +pub struct AssetEntityBindingBindingIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> AssetEntityBindingTableHandle<'ctx> { + /// Get a handle on the `binding_id` unique index on the table `asset_entity_binding`. + pub fn binding_id(&self) -> AssetEntityBindingBindingIdUnique<'ctx> { + AssetEntityBindingBindingIdUnique { + imp: self.imp.get_unique_constraint::("binding_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> AssetEntityBindingBindingIdUnique<'ctx> { + /// Find the subscribed row whose `binding_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("asset_entity_binding"); + _table.add_unique_constraint::("binding_id", |row| &row.binding_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `AssetEntityBinding`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait asset_entity_bindingQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `AssetEntityBinding`. + fn asset_entity_binding(&self) -> __sdk::__query_builder::Table; +} + +impl asset_entity_bindingQueryTableAccess for __sdk::QueryTableAccessor { + fn asset_entity_binding(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("asset_entity_binding") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/asset_object_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/asset_object_table.rs new file mode 100644 index 00000000..526fa287 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/asset_object_table.rs @@ -0,0 +1,160 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use 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`. +/// +/// Obtain a handle from the [`AssetObjectTableAccess::asset_object`] method on [`super::RemoteTables`], +/// like `ctx.db.asset_object()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.asset_object().on_insert(...)`. +pub struct AssetObjectTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `asset_object`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait AssetObjectTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`AssetObjectTableHandle`], which mediates access to the table `asset_object`. + fn asset_object(&self) -> AssetObjectTableHandle<'_>; +} + +impl AssetObjectTableAccess for super::RemoteTables { + fn asset_object(&self) -> AssetObjectTableHandle<'_> { + AssetObjectTableHandle { + imp: self.imp.get_table::("asset_object"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct AssetObjectInsertCallbackId(__sdk::CallbackId); +pub struct AssetObjectDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for AssetObjectTableHandle<'ctx> { + type Row = AssetObject; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = AssetObjectInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> AssetObjectInsertCallbackId { + AssetObjectInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: AssetObjectInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = AssetObjectDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> AssetObjectDeleteCallbackId { + AssetObjectDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: AssetObjectDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct AssetObjectUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for AssetObjectTableHandle<'ctx> { + type UpdateCallbackId = AssetObjectUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> AssetObjectUpdateCallbackId { + AssetObjectUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: AssetObjectUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `asset_object_id` unique index on the table `asset_object`, +/// which allows point queries on the field of the same name +/// via the [`AssetObjectAssetObjectIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.asset_object().asset_object_id().find(...)`. +pub struct AssetObjectAssetObjectIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> AssetObjectTableHandle<'ctx> { + /// Get a handle on the `asset_object_id` unique index on the table `asset_object`. + pub fn asset_object_id(&self) -> AssetObjectAssetObjectIdUnique<'ctx> { + AssetObjectAssetObjectIdUnique { + imp: self.imp.get_unique_constraint::("asset_object_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> AssetObjectAssetObjectIdUnique<'ctx> { + /// Find the subscribed row whose `asset_object_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("asset_object"); + _table.add_unique_constraint::("asset_object_id", |row| &row.asset_object_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `AssetObject`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait asset_objectQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `AssetObject`. + fn asset_object(&self) -> __sdk::__query_builder::Table; +} + +impl asset_objectQueryTableAccess for __sdk::QueryTableAccessor { + fn asset_object(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("asset_object") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/attach_ai_result_reference_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/attach_ai_result_reference_and_return_procedure.rs index 94d41850..2f3edbe2 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/attach_ai_result_reference_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/attach_ai_result_reference_and_return_procedure.rs @@ -31,10 +31,10 @@ pub trait attach_ai_result_reference_and_return { input: AiResultReferenceInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl attach_ai_result_reference_and_return for super::RemoteProcedures { input: AiResultReferenceInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, AiTaskProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/auth_identity_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/auth_identity_table.rs new file mode 100644 index 00000000..5f4a7622 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/auth_identity_table.rs @@ -0,0 +1,159 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::auth_identity_type::AuthIdentity; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `auth_identity`. +/// +/// Obtain a handle from the [`AuthIdentityTableAccess::auth_identity`] method on [`super::RemoteTables`], +/// like `ctx.db.auth_identity()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.auth_identity().on_insert(...)`. +pub struct AuthIdentityTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `auth_identity`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait AuthIdentityTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`AuthIdentityTableHandle`], which mediates access to the table `auth_identity`. + fn auth_identity(&self) -> AuthIdentityTableHandle<'_>; +} + +impl AuthIdentityTableAccess for super::RemoteTables { + fn auth_identity(&self) -> AuthIdentityTableHandle<'_> { + AuthIdentityTableHandle { + imp: self.imp.get_table::("auth_identity"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct AuthIdentityInsertCallbackId(__sdk::CallbackId); +pub struct AuthIdentityDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for AuthIdentityTableHandle<'ctx> { + type Row = AuthIdentity; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = AuthIdentityInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> AuthIdentityInsertCallbackId { + AuthIdentityInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: AuthIdentityInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = AuthIdentityDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> AuthIdentityDeleteCallbackId { + AuthIdentityDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: AuthIdentityDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct AuthIdentityUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for AuthIdentityTableHandle<'ctx> { + type UpdateCallbackId = AuthIdentityUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> AuthIdentityUpdateCallbackId { + AuthIdentityUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: AuthIdentityUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `identity_id` unique index on the table `auth_identity`, +/// which allows point queries on the field of the same name +/// via the [`AuthIdentityIdentityIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.auth_identity().identity_id().find(...)`. +pub struct AuthIdentityIdentityIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> AuthIdentityTableHandle<'ctx> { + /// Get a handle on the `identity_id` unique index on the table `auth_identity`. + pub fn identity_id(&self) -> AuthIdentityIdentityIdUnique<'ctx> { + AuthIdentityIdentityIdUnique { + imp: self.imp.get_unique_constraint::("identity_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> AuthIdentityIdentityIdUnique<'ctx> { + /// Find the subscribed row whose `identity_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("auth_identity"); + _table.add_unique_constraint::("identity_id", |row| &row.identity_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `AuthIdentity`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait auth_identityQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `AuthIdentity`. + fn auth_identity(&self) -> __sdk::__query_builder::Table; +} + +impl auth_identityQueryTableAccess for __sdk::QueryTableAccessor { + fn auth_identity(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("auth_identity") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/auth_store_snapshot_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/auth_store_snapshot_table.rs new file mode 100644 index 00000000..97b00b3d --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/auth_store_snapshot_table.rs @@ -0,0 +1,161 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::auth_store_snapshot_type::AuthStoreSnapshot; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `auth_store_snapshot`. +/// +/// Obtain a handle from the [`AuthStoreSnapshotTableAccess::auth_store_snapshot`] method on [`super::RemoteTables`], +/// like `ctx.db.auth_store_snapshot()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.auth_store_snapshot().on_insert(...)`. +pub struct AuthStoreSnapshotTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `auth_store_snapshot`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait AuthStoreSnapshotTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`AuthStoreSnapshotTableHandle`], which mediates access to the table `auth_store_snapshot`. + fn auth_store_snapshot(&self) -> AuthStoreSnapshotTableHandle<'_>; +} + +impl AuthStoreSnapshotTableAccess for super::RemoteTables { + fn auth_store_snapshot(&self) -> AuthStoreSnapshotTableHandle<'_> { + AuthStoreSnapshotTableHandle { + imp: self + .imp + .get_table::("auth_store_snapshot"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct AuthStoreSnapshotInsertCallbackId(__sdk::CallbackId); +pub struct AuthStoreSnapshotDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for AuthStoreSnapshotTableHandle<'ctx> { + type Row = AuthStoreSnapshot; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = AuthStoreSnapshotInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> AuthStoreSnapshotInsertCallbackId { + AuthStoreSnapshotInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: AuthStoreSnapshotInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = AuthStoreSnapshotDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> AuthStoreSnapshotDeleteCallbackId { + AuthStoreSnapshotDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: AuthStoreSnapshotDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct AuthStoreSnapshotUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for AuthStoreSnapshotTableHandle<'ctx> { + type UpdateCallbackId = AuthStoreSnapshotUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> AuthStoreSnapshotUpdateCallbackId { + AuthStoreSnapshotUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: AuthStoreSnapshotUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `snapshot_id` unique index on the table `auth_store_snapshot`, +/// which allows point queries on the field of the same name +/// via the [`AuthStoreSnapshotSnapshotIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.auth_store_snapshot().snapshot_id().find(...)`. +pub struct AuthStoreSnapshotSnapshotIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> AuthStoreSnapshotTableHandle<'ctx> { + /// Get a handle on the `snapshot_id` unique index on the table `auth_store_snapshot`. + pub fn snapshot_id(&self) -> AuthStoreSnapshotSnapshotIdUnique<'ctx> { + AuthStoreSnapshotSnapshotIdUnique { + imp: self.imp.get_unique_constraint::("snapshot_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> AuthStoreSnapshotSnapshotIdUnique<'ctx> { + /// Find the subscribed row whose `snapshot_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("auth_store_snapshot"); + _table.add_unique_constraint::("snapshot_id", |row| &row.snapshot_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `AuthStoreSnapshot`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait auth_store_snapshotQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `AuthStoreSnapshot`. + fn auth_store_snapshot(&self) -> __sdk::__query_builder::Table; +} + +impl auth_store_snapshotQueryTableAccess for __sdk::QueryTableAccessor { + fn auth_store_snapshot(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("auth_store_snapshot") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/authorize_database_migration_operator_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/authorize_database_migration_operator_procedure.rs index ac77f7e8..b5885022 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/authorize_database_migration_operator_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/authorize_database_migration_operator_procedure.rs @@ -34,10 +34,10 @@ pub trait authorize_database_migration_operator { input: DatabaseMigrationAuthorizeOperatorInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -47,10 +47,10 @@ impl authorize_database_migration_operator for super::RemoteProcedures { input: DatabaseMigrationAuthorizeOperatorInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, DatabaseMigrationOperatorProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/battle_state_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/battle_state_table.rs new file mode 100644 index 00000000..98a289a4 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/battle_state_table.rs @@ -0,0 +1,163 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::battle_mode_type::BattleMode; +use super::battle_state_type::BattleState; +use super::battle_status_type::BattleStatus; +use super::combat_outcome_type::CombatOutcome; +use super::runtime_item_reward_item_snapshot_type::RuntimeItemRewardItemSnapshot; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `battle_state`. +/// +/// Obtain a handle from the [`BattleStateTableAccess::battle_state`] method on [`super::RemoteTables`], +/// like `ctx.db.battle_state()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.battle_state().on_insert(...)`. +pub struct BattleStateTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `battle_state`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait BattleStateTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`BattleStateTableHandle`], which mediates access to the table `battle_state`. + fn battle_state(&self) -> BattleStateTableHandle<'_>; +} + +impl BattleStateTableAccess for super::RemoteTables { + fn battle_state(&self) -> BattleStateTableHandle<'_> { + BattleStateTableHandle { + imp: self.imp.get_table::("battle_state"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct BattleStateInsertCallbackId(__sdk::CallbackId); +pub struct BattleStateDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for BattleStateTableHandle<'ctx> { + type Row = BattleState; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = BattleStateInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> BattleStateInsertCallbackId { + BattleStateInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: BattleStateInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = BattleStateDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> BattleStateDeleteCallbackId { + BattleStateDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: BattleStateDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct BattleStateUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for BattleStateTableHandle<'ctx> { + type UpdateCallbackId = BattleStateUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> BattleStateUpdateCallbackId { + BattleStateUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: BattleStateUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `battle_state_id` unique index on the table `battle_state`, +/// which allows point queries on the field of the same name +/// via the [`BattleStateBattleStateIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.battle_state().battle_state_id().find(...)`. +pub struct BattleStateBattleStateIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> BattleStateTableHandle<'ctx> { + /// Get a handle on the `battle_state_id` unique index on the table `battle_state`. + pub fn battle_state_id(&self) -> BattleStateBattleStateIdUnique<'ctx> { + BattleStateBattleStateIdUnique { + imp: self.imp.get_unique_constraint::("battle_state_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> BattleStateBattleStateIdUnique<'ctx> { + /// Find the subscribed row whose `battle_state_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("battle_state"); + _table.add_unique_constraint::("battle_state_id", |row| &row.battle_state_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `BattleState`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait battle_stateQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `BattleState`. + fn battle_state(&self) -> __sdk::__query_builder::Table; +} + +impl battle_stateQueryTableAccess for __sdk::QueryTableAccessor { + fn battle_state(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("battle_state") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/begin_story_session_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/begin_story_session_and_return_procedure.rs index 304b2e0c..eef3de0f 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/begin_story_session_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/begin_story_session_and_return_procedure.rs @@ -31,10 +31,10 @@ pub trait begin_story_session_and_return { input: StorySessionInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl begin_story_session_and_return for super::RemoteProcedures { input: StorySessionInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, StorySessionProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/begin_story_session_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/begin_story_session_reducer.rs index 22bc4add..6a082f41 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/begin_story_session_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/begin_story_session_reducer.rs @@ -47,11 +47,9 @@ pub trait begin_story_session { &self, input: StorySessionInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()>; } @@ -60,11 +58,9 @@ impl begin_story_session for super::RemoteReducers { &self, input: StorySessionInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()> { self.imp .invoke_reducer_with_callback(BeginStorySessionArgs { input }, callback) diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_agent_message_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_agent_message_table.rs new file mode 100644 index 00000000..cbb48abe --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_agent_message_table.rs @@ -0,0 +1,163 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use 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`. +/// +/// Obtain a handle from the [`BigFishAgentMessageTableAccess::big_fish_agent_message`] method on [`super::RemoteTables`], +/// like `ctx.db.big_fish_agent_message()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.big_fish_agent_message().on_insert(...)`. +pub struct BigFishAgentMessageTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `big_fish_agent_message`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait BigFishAgentMessageTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`BigFishAgentMessageTableHandle`], which mediates access to the table `big_fish_agent_message`. + fn big_fish_agent_message(&self) -> BigFishAgentMessageTableHandle<'_>; +} + +impl BigFishAgentMessageTableAccess for super::RemoteTables { + fn big_fish_agent_message(&self) -> BigFishAgentMessageTableHandle<'_> { + BigFishAgentMessageTableHandle { + imp: self + .imp + .get_table::("big_fish_agent_message"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct BigFishAgentMessageInsertCallbackId(__sdk::CallbackId); +pub struct BigFishAgentMessageDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for BigFishAgentMessageTableHandle<'ctx> { + type Row = BigFishAgentMessage; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = BigFishAgentMessageInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> BigFishAgentMessageInsertCallbackId { + BigFishAgentMessageInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: BigFishAgentMessageInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = BigFishAgentMessageDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> BigFishAgentMessageDeleteCallbackId { + BigFishAgentMessageDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: BigFishAgentMessageDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct BigFishAgentMessageUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for BigFishAgentMessageTableHandle<'ctx> { + type UpdateCallbackId = BigFishAgentMessageUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> BigFishAgentMessageUpdateCallbackId { + BigFishAgentMessageUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: BigFishAgentMessageUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `message_id` unique index on the table `big_fish_agent_message`, +/// which allows point queries on the field of the same name +/// via the [`BigFishAgentMessageMessageIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.big_fish_agent_message().message_id().find(...)`. +pub struct BigFishAgentMessageMessageIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> BigFishAgentMessageTableHandle<'ctx> { + /// Get a handle on the `message_id` unique index on the table `big_fish_agent_message`. + pub fn message_id(&self) -> BigFishAgentMessageMessageIdUnique<'ctx> { + BigFishAgentMessageMessageIdUnique { + imp: self.imp.get_unique_constraint::("message_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> BigFishAgentMessageMessageIdUnique<'ctx> { + /// Find the subscribed row whose `message_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("big_fish_agent_message"); + _table.add_unique_constraint::("message_id", |row| &row.message_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `BigFishAgentMessage`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait big_fish_agent_messageQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `BigFishAgentMessage`. + fn big_fish_agent_message(&self) -> __sdk::__query_builder::Table; +} + +impl big_fish_agent_messageQueryTableAccess for __sdk::QueryTableAccessor { + fn big_fish_agent_message(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("big_fish_agent_message") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_asset_slot_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_asset_slot_table.rs new file mode 100644 index 00000000..d4817cf0 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_asset_slot_table.rs @@ -0,0 +1,163 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::big_fish_asset_kind_type::BigFishAssetKind; +use super::big_fish_asset_slot_type::BigFishAssetSlot; +use super::big_fish_asset_status_type::BigFishAssetStatus; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `big_fish_asset_slot`. +/// +/// Obtain a handle from the [`BigFishAssetSlotTableAccess::big_fish_asset_slot`] method on [`super::RemoteTables`], +/// like `ctx.db.big_fish_asset_slot()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.big_fish_asset_slot().on_insert(...)`. +pub struct BigFishAssetSlotTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `big_fish_asset_slot`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait BigFishAssetSlotTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`BigFishAssetSlotTableHandle`], which mediates access to the table `big_fish_asset_slot`. + fn big_fish_asset_slot(&self) -> BigFishAssetSlotTableHandle<'_>; +} + +impl BigFishAssetSlotTableAccess for super::RemoteTables { + fn big_fish_asset_slot(&self) -> BigFishAssetSlotTableHandle<'_> { + BigFishAssetSlotTableHandle { + imp: self + .imp + .get_table::("big_fish_asset_slot"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct BigFishAssetSlotInsertCallbackId(__sdk::CallbackId); +pub struct BigFishAssetSlotDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for BigFishAssetSlotTableHandle<'ctx> { + type Row = BigFishAssetSlot; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = BigFishAssetSlotInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> BigFishAssetSlotInsertCallbackId { + BigFishAssetSlotInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: BigFishAssetSlotInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = BigFishAssetSlotDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> BigFishAssetSlotDeleteCallbackId { + BigFishAssetSlotDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: BigFishAssetSlotDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct BigFishAssetSlotUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for BigFishAssetSlotTableHandle<'ctx> { + type UpdateCallbackId = BigFishAssetSlotUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> BigFishAssetSlotUpdateCallbackId { + BigFishAssetSlotUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: BigFishAssetSlotUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `slot_id` unique index on the table `big_fish_asset_slot`, +/// which allows point queries on the field of the same name +/// via the [`BigFishAssetSlotSlotIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.big_fish_asset_slot().slot_id().find(...)`. +pub struct BigFishAssetSlotSlotIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> BigFishAssetSlotTableHandle<'ctx> { + /// Get a handle on the `slot_id` unique index on the table `big_fish_asset_slot`. + pub fn slot_id(&self) -> BigFishAssetSlotSlotIdUnique<'ctx> { + BigFishAssetSlotSlotIdUnique { + imp: self.imp.get_unique_constraint::("slot_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> BigFishAssetSlotSlotIdUnique<'ctx> { + /// Find the subscribed row whose `slot_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("big_fish_asset_slot"); + _table.add_unique_constraint::("slot_id", |row| &row.slot_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `BigFishAssetSlot`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait big_fish_asset_slotQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `BigFishAssetSlot`. + fn big_fish_asset_slot(&self) -> __sdk::__query_builder::Table; +} + +impl big_fish_asset_slotQueryTableAccess for __sdk::QueryTableAccessor { + fn big_fish_asset_slot(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("big_fish_asset_slot") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_creation_session_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_creation_session_table.rs new file mode 100644 index 00000000..d7b82298 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_creation_session_table.rs @@ -0,0 +1,163 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::big_fish_creation_session_type::BigFishCreationSession; +use super::big_fish_creation_stage_type::BigFishCreationStage; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `big_fish_creation_session`. +/// +/// Obtain a handle from the [`BigFishCreationSessionTableAccess::big_fish_creation_session`] method on [`super::RemoteTables`], +/// like `ctx.db.big_fish_creation_session()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.big_fish_creation_session().on_insert(...)`. +pub struct BigFishCreationSessionTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `big_fish_creation_session`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait BigFishCreationSessionTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`BigFishCreationSessionTableHandle`], which mediates access to the table `big_fish_creation_session`. + fn big_fish_creation_session(&self) -> BigFishCreationSessionTableHandle<'_>; +} + +impl BigFishCreationSessionTableAccess for super::RemoteTables { + fn big_fish_creation_session(&self) -> BigFishCreationSessionTableHandle<'_> { + BigFishCreationSessionTableHandle { + imp: self + .imp + .get_table::("big_fish_creation_session"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct BigFishCreationSessionInsertCallbackId(__sdk::CallbackId); +pub struct BigFishCreationSessionDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for BigFishCreationSessionTableHandle<'ctx> { + type Row = BigFishCreationSession; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = BigFishCreationSessionInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> BigFishCreationSessionInsertCallbackId { + BigFishCreationSessionInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: BigFishCreationSessionInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = BigFishCreationSessionDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> BigFishCreationSessionDeleteCallbackId { + BigFishCreationSessionDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: BigFishCreationSessionDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct BigFishCreationSessionUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for BigFishCreationSessionTableHandle<'ctx> { + type UpdateCallbackId = BigFishCreationSessionUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> BigFishCreationSessionUpdateCallbackId { + BigFishCreationSessionUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: BigFishCreationSessionUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `session_id` unique index on the table `big_fish_creation_session`, +/// which allows point queries on the field of the same name +/// via the [`BigFishCreationSessionSessionIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.big_fish_creation_session().session_id().find(...)`. +pub struct BigFishCreationSessionSessionIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> BigFishCreationSessionTableHandle<'ctx> { + /// Get a handle on the `session_id` unique index on the table `big_fish_creation_session`. + pub fn session_id(&self) -> BigFishCreationSessionSessionIdUnique<'ctx> { + BigFishCreationSessionSessionIdUnique { + imp: self.imp.get_unique_constraint::("session_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> BigFishCreationSessionSessionIdUnique<'ctx> { + /// Find the subscribed row whose `session_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = + client_cache.get_or_make_table::("big_fish_creation_session"); + _table.add_unique_constraint::("session_id", |row| &row.session_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `BigFishCreationSession`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait big_fish_creation_sessionQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `BigFishCreationSession`. + fn big_fish_creation_session(&self) -> __sdk::__query_builder::Table; +} + +impl big_fish_creation_sessionQueryTableAccess for __sdk::QueryTableAccessor { + fn big_fish_creation_session(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("big_fish_creation_session") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_runtime_run_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_runtime_run_table.rs new file mode 100644 index 00000000..bbf7ef94 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_runtime_run_table.rs @@ -0,0 +1,162 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::big_fish_run_status_type::BigFishRunStatus; +use super::big_fish_runtime_run_type::BigFishRuntimeRun; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `big_fish_runtime_run`. +/// +/// Obtain a handle from the [`BigFishRuntimeRunTableAccess::big_fish_runtime_run`] method on [`super::RemoteTables`], +/// like `ctx.db.big_fish_runtime_run()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.big_fish_runtime_run().on_insert(...)`. +pub struct BigFishRuntimeRunTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `big_fish_runtime_run`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait BigFishRuntimeRunTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`BigFishRuntimeRunTableHandle`], which mediates access to the table `big_fish_runtime_run`. + fn big_fish_runtime_run(&self) -> BigFishRuntimeRunTableHandle<'_>; +} + +impl BigFishRuntimeRunTableAccess for super::RemoteTables { + fn big_fish_runtime_run(&self) -> BigFishRuntimeRunTableHandle<'_> { + BigFishRuntimeRunTableHandle { + imp: self + .imp + .get_table::("big_fish_runtime_run"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct BigFishRuntimeRunInsertCallbackId(__sdk::CallbackId); +pub struct BigFishRuntimeRunDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for BigFishRuntimeRunTableHandle<'ctx> { + type Row = BigFishRuntimeRun; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = BigFishRuntimeRunInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> BigFishRuntimeRunInsertCallbackId { + BigFishRuntimeRunInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: BigFishRuntimeRunInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = BigFishRuntimeRunDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> BigFishRuntimeRunDeleteCallbackId { + BigFishRuntimeRunDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: BigFishRuntimeRunDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct BigFishRuntimeRunUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for BigFishRuntimeRunTableHandle<'ctx> { + type UpdateCallbackId = BigFishRuntimeRunUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> BigFishRuntimeRunUpdateCallbackId { + BigFishRuntimeRunUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: BigFishRuntimeRunUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `run_id` unique index on the table `big_fish_runtime_run`, +/// which allows point queries on the field of the same name +/// via the [`BigFishRuntimeRunRunIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.big_fish_runtime_run().run_id().find(...)`. +pub struct BigFishRuntimeRunRunIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> BigFishRuntimeRunTableHandle<'ctx> { + /// Get a handle on the `run_id` unique index on the table `big_fish_runtime_run`. + pub fn run_id(&self) -> BigFishRuntimeRunRunIdUnique<'ctx> { + BigFishRuntimeRunRunIdUnique { + imp: self.imp.get_unique_constraint::("run_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> BigFishRuntimeRunRunIdUnique<'ctx> { + /// Find the subscribed row whose `run_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("big_fish_runtime_run"); + _table.add_unique_constraint::("run_id", |row| &row.run_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `BigFishRuntimeRun`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait big_fish_runtime_runQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `BigFishRuntimeRun`. + fn big_fish_runtime_run(&self) -> __sdk::__query_builder::Table; +} + +impl big_fish_runtime_runQueryTableAccess for __sdk::QueryTableAccessor { + fn big_fish_runtime_run(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("big_fish_runtime_run") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/bind_asset_object_to_entity_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/bind_asset_object_to_entity_and_return_procedure.rs index 78c80aee..b709d5c2 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/bind_asset_object_to_entity_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/bind_asset_object_to_entity_and_return_procedure.rs @@ -31,10 +31,10 @@ pub trait bind_asset_object_to_entity_and_return { input: AssetEntityBindingInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl bind_asset_object_to_entity_and_return for super::RemoteProcedures { input: AssetEntityBindingInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, AssetEntityBindingProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/bind_asset_object_to_entity_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/bind_asset_object_to_entity_reducer.rs index caf48b26..b20bc5b2 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/bind_asset_object_to_entity_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/bind_asset_object_to_entity_reducer.rs @@ -47,11 +47,9 @@ pub trait bind_asset_object_to_entity { &self, input: AssetEntityBindingInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()>; } @@ -60,11 +58,9 @@ impl bind_asset_object_to_entity for super::RemoteReducers { &self, input: AssetEntityBindingInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()> { self.imp .invoke_reducer_with_callback(BindAssetObjectToEntityArgs { input }, callback) diff --git a/server-rs/crates/spacetime-client/src/module_bindings/cancel_ai_task_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/cancel_ai_task_and_return_procedure.rs index 0c5dc3eb..b239e060 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/cancel_ai_task_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/cancel_ai_task_and_return_procedure.rs @@ -31,10 +31,10 @@ pub trait cancel_ai_task_and_return { input: AiTaskCancelInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl cancel_ai_task_and_return for super::RemoteProcedures { input: AiTaskCancelInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, AiTaskProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/chapter_progression_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/chapter_progression_table.rs new file mode 100644 index 00000000..2fb6c042 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/chapter_progression_table.rs @@ -0,0 +1,166 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::chapter_pace_band_type::ChapterPaceBand; +use super::chapter_progression_type::ChapterProgression; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `chapter_progression`. +/// +/// Obtain a handle from the [`ChapterProgressionTableAccess::chapter_progression`] method on [`super::RemoteTables`], +/// like `ctx.db.chapter_progression()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.chapter_progression().on_insert(...)`. +pub struct ChapterProgressionTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `chapter_progression`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait ChapterProgressionTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`ChapterProgressionTableHandle`], which mediates access to the table `chapter_progression`. + fn chapter_progression(&self) -> ChapterProgressionTableHandle<'_>; +} + +impl ChapterProgressionTableAccess for super::RemoteTables { + fn chapter_progression(&self) -> ChapterProgressionTableHandle<'_> { + ChapterProgressionTableHandle { + imp: self + .imp + .get_table::("chapter_progression"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct ChapterProgressionInsertCallbackId(__sdk::CallbackId); +pub struct ChapterProgressionDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for ChapterProgressionTableHandle<'ctx> { + type Row = ChapterProgression; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = ChapterProgressionInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ChapterProgressionInsertCallbackId { + ChapterProgressionInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: ChapterProgressionInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = ChapterProgressionDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ChapterProgressionDeleteCallbackId { + ChapterProgressionDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: ChapterProgressionDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct ChapterProgressionUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for ChapterProgressionTableHandle<'ctx> { + type UpdateCallbackId = ChapterProgressionUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> ChapterProgressionUpdateCallbackId { + ChapterProgressionUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: ChapterProgressionUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `chapter_progression_id` unique index on the table `chapter_progression`, +/// which allows point queries on the field of the same name +/// via the [`ChapterProgressionChapterProgressionIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.chapter_progression().chapter_progression_id().find(...)`. +pub struct ChapterProgressionChapterProgressionIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> ChapterProgressionTableHandle<'ctx> { + /// Get a handle on the `chapter_progression_id` unique index on the table `chapter_progression`. + pub fn chapter_progression_id(&self) -> ChapterProgressionChapterProgressionIdUnique<'ctx> { + ChapterProgressionChapterProgressionIdUnique { + imp: self + .imp + .get_unique_constraint::("chapter_progression_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> ChapterProgressionChapterProgressionIdUnique<'ctx> { + /// Find the subscribed row whose `chapter_progression_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("chapter_progression"); + _table.add_unique_constraint::("chapter_progression_id", |row| { + &row.chapter_progression_id + }); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `ChapterProgression`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait chapter_progressionQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `ChapterProgression`. + fn chapter_progression(&self) -> __sdk::__query_builder::Table; +} + +impl chapter_progressionQueryTableAccess for __sdk::QueryTableAccessor { + fn chapter_progression(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("chapter_progression") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/claim_profile_task_reward_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/claim_profile_task_reward_and_return_procedure.rs index ea501070..5a386f3c 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/claim_profile_task_reward_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/claim_profile_task_reward_and_return_procedure.rs @@ -31,10 +31,10 @@ pub trait claim_profile_task_reward_and_return { input: RuntimeProfileTaskClaimInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl claim_profile_task_reward_and_return for super::RemoteProcedures { input: RuntimeProfileTaskClaimInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, RuntimeProfileTaskClaimProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/claim_puzzle_work_point_incentive_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/claim_puzzle_work_point_incentive_procedure.rs index 1d787222..f7ac8d75 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/claim_puzzle_work_point_incentive_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/claim_puzzle_work_point_incentive_procedure.rs @@ -31,10 +31,10 @@ pub trait claim_puzzle_work_point_incentive { input: PuzzleWorkPointIncentiveClaimInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl claim_puzzle_work_point_incentive for super::RemoteProcedures { input: PuzzleWorkPointIncentiveClaimInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, PuzzleWorkProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/clear_database_migration_import_chunks_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/clear_database_migration_import_chunks_procedure.rs index d05fcdf2..51146e99 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/clear_database_migration_import_chunks_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/clear_database_migration_import_chunks_procedure.rs @@ -34,10 +34,10 @@ pub trait clear_database_migration_import_chunks { input: DatabaseMigrationImportChunksClearInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -47,10 +47,10 @@ impl clear_database_migration_import_chunks for super::RemoteProcedures { input: DatabaseMigrationImportChunksClearInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, DatabaseMigrationProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/clear_platform_browse_history_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/clear_platform_browse_history_and_return_procedure.rs index c8ba8d49..2e623845 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/clear_platform_browse_history_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/clear_platform_browse_history_and_return_procedure.rs @@ -31,10 +31,10 @@ pub trait clear_platform_browse_history_and_return { input: RuntimeBrowseHistoryClearInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl clear_platform_browse_history_and_return for super::RemoteProcedures { input: RuntimeBrowseHistoryClearInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, RuntimeBrowseHistoryProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/click_match_3_d_item_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/click_match_3_d_item_procedure.rs index 278845ba..6070a62d 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/click_match_3_d_item_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/click_match_3_d_item_procedure.rs @@ -31,10 +31,10 @@ pub trait click_match_3_d_item { input: Match3DRunClickInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl click_match_3_d_item for super::RemoteProcedures { input: Match3DRunClickInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, Match3DClickItemProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/compile_big_fish_draft_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/compile_big_fish_draft_procedure.rs index bafe95a6..6eea6571 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/compile_big_fish_draft_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/compile_big_fish_draft_procedure.rs @@ -31,10 +31,10 @@ pub trait compile_big_fish_draft { input: BigFishDraftCompileInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl compile_big_fish_draft for super::RemoteProcedures { input: BigFishDraftCompileInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, BigFishSessionProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/compile_custom_world_published_profile_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/compile_custom_world_published_profile_procedure.rs index 67706fab..aefbe602 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/compile_custom_world_published_profile_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/compile_custom_world_published_profile_procedure.rs @@ -34,10 +34,10 @@ pub trait compile_custom_world_published_profile { input: CustomWorldPublishedProfileCompileInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -47,10 +47,10 @@ impl compile_custom_world_published_profile for super::RemoteProcedures { input: CustomWorldPublishedProfileCompileInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, CustomWorldPublishedProfileCompileResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/compile_match_3_d_draft_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/compile_match_3_d_draft_procedure.rs index 1a7a97ed..d6db0787 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/compile_match_3_d_draft_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/compile_match_3_d_draft_procedure.rs @@ -31,10 +31,10 @@ pub trait compile_match_3_d_draft { input: Match3DDraftCompileInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl compile_match_3_d_draft for super::RemoteProcedures { input: Match3DDraftCompileInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, Match3DAgentSessionProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/compile_puzzle_agent_draft_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/compile_puzzle_agent_draft_procedure.rs index 177c0c40..7badcdae 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/compile_puzzle_agent_draft_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/compile_puzzle_agent_draft_procedure.rs @@ -31,10 +31,10 @@ pub trait compile_puzzle_agent_draft { input: PuzzleDraftCompileInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl compile_puzzle_agent_draft for super::RemoteProcedures { input: PuzzleDraftCompileInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, PuzzleAgentSessionProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/complete_ai_stage_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/complete_ai_stage_and_return_procedure.rs index e59ab8f0..51375935 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/complete_ai_stage_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/complete_ai_stage_and_return_procedure.rs @@ -31,10 +31,10 @@ pub trait complete_ai_stage_and_return { input: AiStageCompletionInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl complete_ai_stage_and_return for super::RemoteProcedures { input: AiStageCompletionInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, AiTaskProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/complete_ai_task_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/complete_ai_task_and_return_procedure.rs index ca7eab9f..040af639 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/complete_ai_task_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/complete_ai_task_and_return_procedure.rs @@ -31,10 +31,10 @@ pub trait complete_ai_task_and_return { input: AiTaskFinishInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl complete_ai_task_and_return for super::RemoteProcedures { input: AiTaskFinishInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, AiTaskProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/confirm_asset_object_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/confirm_asset_object_and_return_procedure.rs index cc65f744..0b4f26b2 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/confirm_asset_object_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/confirm_asset_object_and_return_procedure.rs @@ -31,10 +31,10 @@ pub trait confirm_asset_object_and_return { input: AssetObjectUpsertInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl confirm_asset_object_and_return for super::RemoteProcedures { input: AssetObjectUpsertInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, AssetObjectProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/confirm_asset_object_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/confirm_asset_object_reducer.rs index f5edb63a..183c2efa 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/confirm_asset_object_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/confirm_asset_object_reducer.rs @@ -47,11 +47,9 @@ pub trait confirm_asset_object { &self, input: AssetObjectUpsertInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()>; } @@ -60,11 +58,9 @@ impl confirm_asset_object for super::RemoteReducers { &self, input: AssetObjectUpsertInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()> { self.imp .invoke_reducer_with_callback(ConfirmAssetObjectArgs { input }, callback) diff --git a/server-rs/crates/spacetime-client/src/module_bindings/consume_profile_wallet_points_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/consume_profile_wallet_points_and_return_procedure.rs index 11394b66..3d3e47a2 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/consume_profile_wallet_points_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/consume_profile_wallet_points_and_return_procedure.rs @@ -31,10 +31,10 @@ pub trait consume_profile_wallet_points_and_return { input: RuntimeProfileWalletAdjustmentInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl consume_profile_wallet_points_and_return for super::RemoteProcedures { input: RuntimeProfileWalletAdjustmentInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, RuntimeProfileWalletAdjustmentProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/continue_story_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/continue_story_and_return_procedure.rs index 1c2b51d8..0d58ec1b 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/continue_story_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/continue_story_and_return_procedure.rs @@ -31,10 +31,10 @@ pub trait continue_story_and_return { input: StoryContinueInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl continue_story_and_return for super::RemoteProcedures { input: StoryContinueInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, StorySessionProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/continue_story_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/continue_story_reducer.rs index fb35bd1f..4117cfae 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/continue_story_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/continue_story_reducer.rs @@ -47,11 +47,9 @@ pub trait continue_story { &self, input: StoryContinueInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()>; } @@ -60,11 +58,9 @@ impl continue_story for super::RemoteReducers { &self, input: StoryContinueInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()> { self.imp .invoke_reducer_with_callback(ContinueStoryArgs { input }, callback) diff --git a/server-rs/crates/spacetime-client/src/module_bindings/create_ai_task_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/create_ai_task_and_return_procedure.rs index a2f40fd0..20d8ceee 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/create_ai_task_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/create_ai_task_and_return_procedure.rs @@ -31,10 +31,10 @@ pub trait create_ai_task_and_return { input: AiTaskCreateInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl create_ai_task_and_return for super::RemoteProcedures { input: AiTaskCreateInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, AiTaskProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/create_ai_task_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/create_ai_task_reducer.rs index b87207f0..213f28e5 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/create_ai_task_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/create_ai_task_reducer.rs @@ -47,11 +47,9 @@ pub trait create_ai_task { &self, input: AiTaskCreateInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()>; } @@ -60,11 +58,9 @@ impl create_ai_task for super::RemoteReducers { &self, input: AiTaskCreateInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()> { self.imp .invoke_reducer_with_callback(CreateAiTaskArgs { input }, callback) diff --git a/server-rs/crates/spacetime-client/src/module_bindings/create_battle_state_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/create_battle_state_and_return_procedure.rs index c028ba4e..ef11107a 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/create_battle_state_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/create_battle_state_and_return_procedure.rs @@ -31,10 +31,10 @@ pub trait create_battle_state_and_return { input: BattleStateInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl create_battle_state_and_return for super::RemoteProcedures { input: BattleStateInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, BattleStateProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/create_battle_state_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/create_battle_state_reducer.rs index 7f34eab2..1072f8a5 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/create_battle_state_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/create_battle_state_reducer.rs @@ -47,11 +47,9 @@ pub trait create_battle_state { &self, input: BattleStateInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()>; } @@ -60,11 +58,9 @@ impl create_battle_state for super::RemoteReducers { &self, input: BattleStateInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()> { self.imp .invoke_reducer_with_callback(CreateBattleStateArgs { input }, callback) diff --git a/server-rs/crates/spacetime-client/src/module_bindings/create_big_fish_session_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/create_big_fish_session_procedure.rs index 6e48521a..bc67436e 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/create_big_fish_session_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/create_big_fish_session_procedure.rs @@ -31,10 +31,10 @@ pub trait create_big_fish_session { input: BigFishSessionCreateInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl create_big_fish_session for super::RemoteProcedures { input: BigFishSessionCreateInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, BigFishSessionProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/create_custom_world_agent_session_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/create_custom_world_agent_session_procedure.rs index 96a21162..6a08bcc7 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/create_custom_world_agent_session_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/create_custom_world_agent_session_procedure.rs @@ -31,10 +31,10 @@ pub trait create_custom_world_agent_session { input: CustomWorldAgentSessionCreateInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl create_custom_world_agent_session for super::RemoteProcedures { input: CustomWorldAgentSessionCreateInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, CustomWorldAgentSessionProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/create_match_3_d_agent_session_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/create_match_3_d_agent_session_procedure.rs index 717ef728..c482c9c6 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/create_match_3_d_agent_session_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/create_match_3_d_agent_session_procedure.rs @@ -31,10 +31,10 @@ pub trait create_match_3_d_agent_session { input: Match3DAgentSessionCreateInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl create_match_3_d_agent_session for super::RemoteProcedures { input: Match3DAgentSessionCreateInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, Match3DAgentSessionProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/create_profile_recharge_order_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/create_profile_recharge_order_and_return_procedure.rs index 1c53f6ae..893fbdf6 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/create_profile_recharge_order_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/create_profile_recharge_order_and_return_procedure.rs @@ -34,10 +34,10 @@ pub trait create_profile_recharge_order_and_return { input: RuntimeProfileRechargeOrderCreateInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -47,10 +47,10 @@ impl create_profile_recharge_order_and_return for super::RemoteProcedures { input: RuntimeProfileRechargeOrderCreateInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, RuntimeProfileRechargeCenterProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/create_puzzle_agent_session_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/create_puzzle_agent_session_procedure.rs index 62b77081..9460692b 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/create_puzzle_agent_session_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/create_puzzle_agent_session_procedure.rs @@ -31,10 +31,10 @@ pub trait create_puzzle_agent_session { input: PuzzleAgentSessionCreateInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl create_puzzle_agent_session for super::RemoteProcedures { input: PuzzleAgentSessionCreateInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, PuzzleAgentSessionProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_message_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_message_table.rs new file mode 100644 index 00000000..1d0886e7 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_message_table.rs @@ -0,0 +1,164 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::custom_world_agent_message_type::CustomWorldAgentMessage; +use super::rpg_agent_message_kind_type::RpgAgentMessageKind; +use super::rpg_agent_message_role_type::RpgAgentMessageRole; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `custom_world_agent_message`. +/// +/// Obtain a handle from the [`CustomWorldAgentMessageTableAccess::custom_world_agent_message`] method on [`super::RemoteTables`], +/// like `ctx.db.custom_world_agent_message()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.custom_world_agent_message().on_insert(...)`. +pub struct CustomWorldAgentMessageTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `custom_world_agent_message`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait CustomWorldAgentMessageTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`CustomWorldAgentMessageTableHandle`], which mediates access to the table `custom_world_agent_message`. + fn custom_world_agent_message(&self) -> CustomWorldAgentMessageTableHandle<'_>; +} + +impl CustomWorldAgentMessageTableAccess for super::RemoteTables { + fn custom_world_agent_message(&self) -> CustomWorldAgentMessageTableHandle<'_> { + CustomWorldAgentMessageTableHandle { + imp: self + .imp + .get_table::("custom_world_agent_message"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct CustomWorldAgentMessageInsertCallbackId(__sdk::CallbackId); +pub struct CustomWorldAgentMessageDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for CustomWorldAgentMessageTableHandle<'ctx> { + type Row = CustomWorldAgentMessage; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = CustomWorldAgentMessageInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> CustomWorldAgentMessageInsertCallbackId { + CustomWorldAgentMessageInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: CustomWorldAgentMessageInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = CustomWorldAgentMessageDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> CustomWorldAgentMessageDeleteCallbackId { + CustomWorldAgentMessageDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: CustomWorldAgentMessageDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct CustomWorldAgentMessageUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for CustomWorldAgentMessageTableHandle<'ctx> { + type UpdateCallbackId = CustomWorldAgentMessageUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> CustomWorldAgentMessageUpdateCallbackId { + CustomWorldAgentMessageUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: CustomWorldAgentMessageUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `message_id` unique index on the table `custom_world_agent_message`, +/// which allows point queries on the field of the same name +/// via the [`CustomWorldAgentMessageMessageIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.custom_world_agent_message().message_id().find(...)`. +pub struct CustomWorldAgentMessageMessageIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> CustomWorldAgentMessageTableHandle<'ctx> { + /// Get a handle on the `message_id` unique index on the table `custom_world_agent_message`. + pub fn message_id(&self) -> CustomWorldAgentMessageMessageIdUnique<'ctx> { + CustomWorldAgentMessageMessageIdUnique { + imp: self.imp.get_unique_constraint::("message_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> CustomWorldAgentMessageMessageIdUnique<'ctx> { + /// Find the subscribed row whose `message_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = + client_cache.get_or_make_table::("custom_world_agent_message"); + _table.add_unique_constraint::("message_id", |row| &row.message_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `CustomWorldAgentMessage`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait custom_world_agent_messageQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `CustomWorldAgentMessage`. + fn custom_world_agent_message(&self) -> __sdk::__query_builder::Table; +} + +impl custom_world_agent_messageQueryTableAccess for __sdk::QueryTableAccessor { + fn custom_world_agent_message(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("custom_world_agent_message") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_operation_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_operation_table.rs new file mode 100644 index 00000000..316a95b1 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_operation_table.rs @@ -0,0 +1,168 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::custom_world_agent_operation_type::CustomWorldAgentOperation; +use super::rpg_agent_operation_status_type::RpgAgentOperationStatus; +use super::rpg_agent_operation_type_type::RpgAgentOperationType; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `custom_world_agent_operation`. +/// +/// Obtain a handle from the [`CustomWorldAgentOperationTableAccess::custom_world_agent_operation`] method on [`super::RemoteTables`], +/// like `ctx.db.custom_world_agent_operation()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.custom_world_agent_operation().on_insert(...)`. +pub struct CustomWorldAgentOperationTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `custom_world_agent_operation`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait CustomWorldAgentOperationTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`CustomWorldAgentOperationTableHandle`], which mediates access to the table `custom_world_agent_operation`. + fn custom_world_agent_operation(&self) -> CustomWorldAgentOperationTableHandle<'_>; +} + +impl CustomWorldAgentOperationTableAccess for super::RemoteTables { + fn custom_world_agent_operation(&self) -> CustomWorldAgentOperationTableHandle<'_> { + CustomWorldAgentOperationTableHandle { + imp: self + .imp + .get_table::("custom_world_agent_operation"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct CustomWorldAgentOperationInsertCallbackId(__sdk::CallbackId); +pub struct CustomWorldAgentOperationDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for CustomWorldAgentOperationTableHandle<'ctx> { + type Row = CustomWorldAgentOperation; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = CustomWorldAgentOperationInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> CustomWorldAgentOperationInsertCallbackId { + CustomWorldAgentOperationInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: CustomWorldAgentOperationInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = CustomWorldAgentOperationDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> CustomWorldAgentOperationDeleteCallbackId { + CustomWorldAgentOperationDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: CustomWorldAgentOperationDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct CustomWorldAgentOperationUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for CustomWorldAgentOperationTableHandle<'ctx> { + type UpdateCallbackId = CustomWorldAgentOperationUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> CustomWorldAgentOperationUpdateCallbackId { + CustomWorldAgentOperationUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: CustomWorldAgentOperationUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `operation_id` unique index on the table `custom_world_agent_operation`, +/// which allows point queries on the field of the same name +/// via the [`CustomWorldAgentOperationOperationIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.custom_world_agent_operation().operation_id().find(...)`. +pub struct CustomWorldAgentOperationOperationIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> CustomWorldAgentOperationTableHandle<'ctx> { + /// Get a handle on the `operation_id` unique index on the table `custom_world_agent_operation`. + pub fn operation_id(&self) -> CustomWorldAgentOperationOperationIdUnique<'ctx> { + CustomWorldAgentOperationOperationIdUnique { + imp: self.imp.get_unique_constraint::("operation_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> CustomWorldAgentOperationOperationIdUnique<'ctx> { + /// Find the subscribed row whose `operation_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = + client_cache.get_or_make_table::("custom_world_agent_operation"); + _table.add_unique_constraint::("operation_id", |row| &row.operation_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `CustomWorldAgentOperation`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait custom_world_agent_operationQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `CustomWorldAgentOperation`. + fn custom_world_agent_operation( + &self, + ) -> __sdk::__query_builder::Table; +} + +impl custom_world_agent_operationQueryTableAccess for __sdk::QueryTableAccessor { + fn custom_world_agent_operation( + &self, + ) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("custom_world_agent_operation") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_session_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_session_table.rs new file mode 100644 index 00000000..d63d156c --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_session_table.rs @@ -0,0 +1,163 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::custom_world_agent_session_type::CustomWorldAgentSession; +use super::rpg_agent_stage_type::RpgAgentStage; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `custom_world_agent_session`. +/// +/// Obtain a handle from the [`CustomWorldAgentSessionTableAccess::custom_world_agent_session`] method on [`super::RemoteTables`], +/// like `ctx.db.custom_world_agent_session()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.custom_world_agent_session().on_insert(...)`. +pub struct CustomWorldAgentSessionTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `custom_world_agent_session`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait CustomWorldAgentSessionTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`CustomWorldAgentSessionTableHandle`], which mediates access to the table `custom_world_agent_session`. + fn custom_world_agent_session(&self) -> CustomWorldAgentSessionTableHandle<'_>; +} + +impl CustomWorldAgentSessionTableAccess for super::RemoteTables { + fn custom_world_agent_session(&self) -> CustomWorldAgentSessionTableHandle<'_> { + CustomWorldAgentSessionTableHandle { + imp: self + .imp + .get_table::("custom_world_agent_session"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct CustomWorldAgentSessionInsertCallbackId(__sdk::CallbackId); +pub struct CustomWorldAgentSessionDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for CustomWorldAgentSessionTableHandle<'ctx> { + type Row = CustomWorldAgentSession; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = CustomWorldAgentSessionInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> CustomWorldAgentSessionInsertCallbackId { + CustomWorldAgentSessionInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: CustomWorldAgentSessionInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = CustomWorldAgentSessionDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> CustomWorldAgentSessionDeleteCallbackId { + CustomWorldAgentSessionDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: CustomWorldAgentSessionDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct CustomWorldAgentSessionUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for CustomWorldAgentSessionTableHandle<'ctx> { + type UpdateCallbackId = CustomWorldAgentSessionUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> CustomWorldAgentSessionUpdateCallbackId { + CustomWorldAgentSessionUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: CustomWorldAgentSessionUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `session_id` unique index on the table `custom_world_agent_session`, +/// which allows point queries on the field of the same name +/// via the [`CustomWorldAgentSessionSessionIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.custom_world_agent_session().session_id().find(...)`. +pub struct CustomWorldAgentSessionSessionIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> CustomWorldAgentSessionTableHandle<'ctx> { + /// Get a handle on the `session_id` unique index on the table `custom_world_agent_session`. + pub fn session_id(&self) -> CustomWorldAgentSessionSessionIdUnique<'ctx> { + CustomWorldAgentSessionSessionIdUnique { + imp: self.imp.get_unique_constraint::("session_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> CustomWorldAgentSessionSessionIdUnique<'ctx> { + /// Find the subscribed row whose `session_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = + client_cache.get_or_make_table::("custom_world_agent_session"); + _table.add_unique_constraint::("session_id", |row| &row.session_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `CustomWorldAgentSession`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait custom_world_agent_sessionQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `CustomWorldAgentSession`. + fn custom_world_agent_session(&self) -> __sdk::__query_builder::Table; +} + +impl custom_world_agent_sessionQueryTableAccess for __sdk::QueryTableAccessor { + fn custom_world_agent_session(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("custom_world_agent_session") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_draft_card_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_draft_card_table.rs new file mode 100644 index 00000000..6f175998 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_draft_card_table.rs @@ -0,0 +1,164 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::custom_world_draft_card_type::CustomWorldDraftCard; +use super::custom_world_role_asset_status_type::CustomWorldRoleAssetStatus; +use super::rpg_agent_draft_card_kind_type::RpgAgentDraftCardKind; +use super::rpg_agent_draft_card_status_type::RpgAgentDraftCardStatus; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `custom_world_draft_card`. +/// +/// Obtain a handle from the [`CustomWorldDraftCardTableAccess::custom_world_draft_card`] method on [`super::RemoteTables`], +/// like `ctx.db.custom_world_draft_card()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.custom_world_draft_card().on_insert(...)`. +pub struct CustomWorldDraftCardTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `custom_world_draft_card`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait CustomWorldDraftCardTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`CustomWorldDraftCardTableHandle`], which mediates access to the table `custom_world_draft_card`. + fn custom_world_draft_card(&self) -> CustomWorldDraftCardTableHandle<'_>; +} + +impl CustomWorldDraftCardTableAccess for super::RemoteTables { + fn custom_world_draft_card(&self) -> CustomWorldDraftCardTableHandle<'_> { + CustomWorldDraftCardTableHandle { + imp: self + .imp + .get_table::("custom_world_draft_card"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct CustomWorldDraftCardInsertCallbackId(__sdk::CallbackId); +pub struct CustomWorldDraftCardDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for CustomWorldDraftCardTableHandle<'ctx> { + type Row = CustomWorldDraftCard; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = CustomWorldDraftCardInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> CustomWorldDraftCardInsertCallbackId { + CustomWorldDraftCardInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: CustomWorldDraftCardInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = CustomWorldDraftCardDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> CustomWorldDraftCardDeleteCallbackId { + CustomWorldDraftCardDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: CustomWorldDraftCardDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct CustomWorldDraftCardUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for CustomWorldDraftCardTableHandle<'ctx> { + type UpdateCallbackId = CustomWorldDraftCardUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> CustomWorldDraftCardUpdateCallbackId { + CustomWorldDraftCardUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: CustomWorldDraftCardUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `card_id` unique index on the table `custom_world_draft_card`, +/// which allows point queries on the field of the same name +/// via the [`CustomWorldDraftCardCardIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.custom_world_draft_card().card_id().find(...)`. +pub struct CustomWorldDraftCardCardIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> CustomWorldDraftCardTableHandle<'ctx> { + /// Get a handle on the `card_id` unique index on the table `custom_world_draft_card`. + pub fn card_id(&self) -> CustomWorldDraftCardCardIdUnique<'ctx> { + CustomWorldDraftCardCardIdUnique { + imp: self.imp.get_unique_constraint::("card_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> CustomWorldDraftCardCardIdUnique<'ctx> { + /// Find the subscribed row whose `card_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("custom_world_draft_card"); + _table.add_unique_constraint::("card_id", |row| &row.card_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `CustomWorldDraftCard`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait custom_world_draft_cardQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `CustomWorldDraftCard`. + fn custom_world_draft_card(&self) -> __sdk::__query_builder::Table; +} + +impl custom_world_draft_cardQueryTableAccess for __sdk::QueryTableAccessor { + fn custom_world_draft_card(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("custom_world_draft_card") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_profile_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_profile_table.rs new file mode 100644 index 00000000..22692434 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_profile_table.rs @@ -0,0 +1,163 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::custom_world_profile_type::CustomWorldProfile; +use super::custom_world_publication_status_type::CustomWorldPublicationStatus; +use super::custom_world_theme_mode_type::CustomWorldThemeMode; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `custom_world_profile`. +/// +/// Obtain a handle from the [`CustomWorldProfileTableAccess::custom_world_profile`] method on [`super::RemoteTables`], +/// like `ctx.db.custom_world_profile()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.custom_world_profile().on_insert(...)`. +pub struct CustomWorldProfileTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `custom_world_profile`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait CustomWorldProfileTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`CustomWorldProfileTableHandle`], which mediates access to the table `custom_world_profile`. + fn custom_world_profile(&self) -> CustomWorldProfileTableHandle<'_>; +} + +impl CustomWorldProfileTableAccess for super::RemoteTables { + fn custom_world_profile(&self) -> CustomWorldProfileTableHandle<'_> { + CustomWorldProfileTableHandle { + imp: self + .imp + .get_table::("custom_world_profile"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct CustomWorldProfileInsertCallbackId(__sdk::CallbackId); +pub struct CustomWorldProfileDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for CustomWorldProfileTableHandle<'ctx> { + type Row = CustomWorldProfile; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = CustomWorldProfileInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> CustomWorldProfileInsertCallbackId { + CustomWorldProfileInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: CustomWorldProfileInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = CustomWorldProfileDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> CustomWorldProfileDeleteCallbackId { + CustomWorldProfileDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: CustomWorldProfileDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct CustomWorldProfileUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for CustomWorldProfileTableHandle<'ctx> { + type UpdateCallbackId = CustomWorldProfileUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> CustomWorldProfileUpdateCallbackId { + CustomWorldProfileUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: CustomWorldProfileUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `profile_id` unique index on the table `custom_world_profile`, +/// which allows point queries on the field of the same name +/// via the [`CustomWorldProfileProfileIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.custom_world_profile().profile_id().find(...)`. +pub struct CustomWorldProfileProfileIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> CustomWorldProfileTableHandle<'ctx> { + /// Get a handle on the `profile_id` unique index on the table `custom_world_profile`. + pub fn profile_id(&self) -> CustomWorldProfileProfileIdUnique<'ctx> { + CustomWorldProfileProfileIdUnique { + imp: self.imp.get_unique_constraint::("profile_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> CustomWorldProfileProfileIdUnique<'ctx> { + /// Find the subscribed row whose `profile_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("custom_world_profile"); + _table.add_unique_constraint::("profile_id", |row| &row.profile_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `CustomWorldProfile`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait custom_world_profileQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `CustomWorldProfile`. + fn custom_world_profile(&self) -> __sdk::__query_builder::Table; +} + +impl custom_world_profileQueryTableAccess for __sdk::QueryTableAccessor { + fn custom_world_profile(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("custom_world_profile") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_session_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_session_table.rs new file mode 100644 index 00000000..2813b6e2 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_session_table.rs @@ -0,0 +1,163 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::custom_world_generation_mode_type::CustomWorldGenerationMode; +use super::custom_world_session_status_type::CustomWorldSessionStatus; +use super::custom_world_session_type::CustomWorldSession; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `custom_world_session`. +/// +/// Obtain a handle from the [`CustomWorldSessionTableAccess::custom_world_session`] method on [`super::RemoteTables`], +/// like `ctx.db.custom_world_session()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.custom_world_session().on_insert(...)`. +pub struct CustomWorldSessionTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `custom_world_session`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait CustomWorldSessionTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`CustomWorldSessionTableHandle`], which mediates access to the table `custom_world_session`. + fn custom_world_session(&self) -> CustomWorldSessionTableHandle<'_>; +} + +impl CustomWorldSessionTableAccess for super::RemoteTables { + fn custom_world_session(&self) -> CustomWorldSessionTableHandle<'_> { + CustomWorldSessionTableHandle { + imp: self + .imp + .get_table::("custom_world_session"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct CustomWorldSessionInsertCallbackId(__sdk::CallbackId); +pub struct CustomWorldSessionDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for CustomWorldSessionTableHandle<'ctx> { + type Row = CustomWorldSession; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = CustomWorldSessionInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> CustomWorldSessionInsertCallbackId { + CustomWorldSessionInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: CustomWorldSessionInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = CustomWorldSessionDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> CustomWorldSessionDeleteCallbackId { + CustomWorldSessionDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: CustomWorldSessionDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct CustomWorldSessionUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for CustomWorldSessionTableHandle<'ctx> { + type UpdateCallbackId = CustomWorldSessionUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> CustomWorldSessionUpdateCallbackId { + CustomWorldSessionUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: CustomWorldSessionUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `session_id` unique index on the table `custom_world_session`, +/// which allows point queries on the field of the same name +/// via the [`CustomWorldSessionSessionIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.custom_world_session().session_id().find(...)`. +pub struct CustomWorldSessionSessionIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> CustomWorldSessionTableHandle<'ctx> { + /// Get a handle on the `session_id` unique index on the table `custom_world_session`. + pub fn session_id(&self) -> CustomWorldSessionSessionIdUnique<'ctx> { + CustomWorldSessionSessionIdUnique { + imp: self.imp.get_unique_constraint::("session_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> CustomWorldSessionSessionIdUnique<'ctx> { + /// Find the subscribed row whose `session_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("custom_world_session"); + _table.add_unique_constraint::("session_id", |row| &row.session_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `CustomWorldSession`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait custom_world_sessionQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `CustomWorldSession`. + fn custom_world_session(&self) -> __sdk::__query_builder::Table; +} + +impl custom_world_sessionQueryTableAccess for __sdk::QueryTableAccessor { + fn custom_world_session(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("custom_world_session") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/database_migration_import_chunk_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/database_migration_import_chunk_table.rs new file mode 100644 index 00000000..3ef15eb9 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/database_migration_import_chunk_table.rs @@ -0,0 +1,169 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::database_migration_import_chunk_type::DatabaseMigrationImportChunk; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `database_migration_import_chunk`. +/// +/// Obtain a handle from the [`DatabaseMigrationImportChunkTableAccess::database_migration_import_chunk`] method on [`super::RemoteTables`], +/// like `ctx.db.database_migration_import_chunk()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.database_migration_import_chunk().on_insert(...)`. +pub struct DatabaseMigrationImportChunkTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `database_migration_import_chunk`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait DatabaseMigrationImportChunkTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`DatabaseMigrationImportChunkTableHandle`], which mediates access to the table `database_migration_import_chunk`. + fn database_migration_import_chunk(&self) -> DatabaseMigrationImportChunkTableHandle<'_>; +} + +impl DatabaseMigrationImportChunkTableAccess for super::RemoteTables { + fn database_migration_import_chunk(&self) -> DatabaseMigrationImportChunkTableHandle<'_> { + DatabaseMigrationImportChunkTableHandle { + imp: self + .imp + .get_table::("database_migration_import_chunk"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct DatabaseMigrationImportChunkInsertCallbackId(__sdk::CallbackId); +pub struct DatabaseMigrationImportChunkDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for DatabaseMigrationImportChunkTableHandle<'ctx> { + type Row = DatabaseMigrationImportChunk; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = DatabaseMigrationImportChunkInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> DatabaseMigrationImportChunkInsertCallbackId { + DatabaseMigrationImportChunkInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: DatabaseMigrationImportChunkInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = DatabaseMigrationImportChunkDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> DatabaseMigrationImportChunkDeleteCallbackId { + DatabaseMigrationImportChunkDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: DatabaseMigrationImportChunkDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct DatabaseMigrationImportChunkUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for DatabaseMigrationImportChunkTableHandle<'ctx> { + type UpdateCallbackId = DatabaseMigrationImportChunkUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> DatabaseMigrationImportChunkUpdateCallbackId { + DatabaseMigrationImportChunkUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: DatabaseMigrationImportChunkUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `chunk_key` unique index on the table `database_migration_import_chunk`, +/// which allows point queries on the field of the same name +/// via the [`DatabaseMigrationImportChunkChunkKeyUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.database_migration_import_chunk().chunk_key().find(...)`. +pub struct DatabaseMigrationImportChunkChunkKeyUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> DatabaseMigrationImportChunkTableHandle<'ctx> { + /// Get a handle on the `chunk_key` unique index on the table `database_migration_import_chunk`. + pub fn chunk_key(&self) -> DatabaseMigrationImportChunkChunkKeyUnique<'ctx> { + DatabaseMigrationImportChunkChunkKeyUnique { + imp: self.imp.get_unique_constraint::("chunk_key"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> DatabaseMigrationImportChunkChunkKeyUnique<'ctx> { + /// Find the subscribed row whose `chunk_key` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache + .get_or_make_table::("database_migration_import_chunk"); + _table.add_unique_constraint::("chunk_key", |row| &row.chunk_key); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse( + "TableUpdate", + "TableUpdate", + ) + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `DatabaseMigrationImportChunk`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait database_migration_import_chunkQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `DatabaseMigrationImportChunk`. + fn database_migration_import_chunk( + &self, + ) -> __sdk::__query_builder::Table; +} + +impl database_migration_import_chunkQueryTableAccess for __sdk::QueryTableAccessor { + fn database_migration_import_chunk( + &self, + ) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("database_migration_import_chunk") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/database_migration_operator_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/database_migration_operator_table.rs new file mode 100644 index 00000000..9eb5c1fa --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/database_migration_operator_table.rs @@ -0,0 +1,170 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::database_migration_operator_type::DatabaseMigrationOperator; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `database_migration_operator`. +/// +/// Obtain a handle from the [`DatabaseMigrationOperatorTableAccess::database_migration_operator`] method on [`super::RemoteTables`], +/// like `ctx.db.database_migration_operator()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.database_migration_operator().on_insert(...)`. +pub struct DatabaseMigrationOperatorTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `database_migration_operator`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait DatabaseMigrationOperatorTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`DatabaseMigrationOperatorTableHandle`], which mediates access to the table `database_migration_operator`. + fn database_migration_operator(&self) -> DatabaseMigrationOperatorTableHandle<'_>; +} + +impl DatabaseMigrationOperatorTableAccess for super::RemoteTables { + fn database_migration_operator(&self) -> DatabaseMigrationOperatorTableHandle<'_> { + DatabaseMigrationOperatorTableHandle { + imp: self + .imp + .get_table::("database_migration_operator"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct DatabaseMigrationOperatorInsertCallbackId(__sdk::CallbackId); +pub struct DatabaseMigrationOperatorDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for DatabaseMigrationOperatorTableHandle<'ctx> { + type Row = DatabaseMigrationOperator; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = DatabaseMigrationOperatorInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> DatabaseMigrationOperatorInsertCallbackId { + DatabaseMigrationOperatorInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: DatabaseMigrationOperatorInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = DatabaseMigrationOperatorDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> DatabaseMigrationOperatorDeleteCallbackId { + DatabaseMigrationOperatorDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: DatabaseMigrationOperatorDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct DatabaseMigrationOperatorUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for DatabaseMigrationOperatorTableHandle<'ctx> { + type UpdateCallbackId = DatabaseMigrationOperatorUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> DatabaseMigrationOperatorUpdateCallbackId { + DatabaseMigrationOperatorUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: DatabaseMigrationOperatorUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `operator_identity` unique index on the table `database_migration_operator`, +/// which allows point queries on the field of the same name +/// via the [`DatabaseMigrationOperatorOperatorIdentityUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.database_migration_operator().operator_identity().find(...)`. +pub struct DatabaseMigrationOperatorOperatorIdentityUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> DatabaseMigrationOperatorTableHandle<'ctx> { + /// Get a handle on the `operator_identity` unique index on the table `database_migration_operator`. + pub fn operator_identity(&self) -> DatabaseMigrationOperatorOperatorIdentityUnique<'ctx> { + DatabaseMigrationOperatorOperatorIdentityUnique { + imp: self + .imp + .get_unique_constraint::<__sdk::Identity>("operator_identity"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> DatabaseMigrationOperatorOperatorIdentityUnique<'ctx> { + /// Find the subscribed row whose `operator_identity` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &__sdk::Identity) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = + client_cache.get_or_make_table::("database_migration_operator"); + _table.add_unique_constraint::<__sdk::Identity>("operator_identity", |row| { + &row.operator_identity + }); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `DatabaseMigrationOperator`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait database_migration_operatorQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `DatabaseMigrationOperator`. + fn database_migration_operator( + &self, + ) -> __sdk::__query_builder::Table; +} + +impl database_migration_operatorQueryTableAccess for __sdk::QueryTableAccessor { + fn database_migration_operator( + &self, + ) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("database_migration_operator") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/delete_big_fish_work_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/delete_big_fish_work_procedure.rs index d2be83ac..51cc224f 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/delete_big_fish_work_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/delete_big_fish_work_procedure.rs @@ -31,10 +31,10 @@ pub trait delete_big_fish_work { input: BigFishWorkDeleteInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl delete_big_fish_work for super::RemoteProcedures { input: BigFishWorkDeleteInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, BigFishWorksProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/delete_custom_world_agent_session_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/delete_custom_world_agent_session_procedure.rs index 39887830..27341561 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/delete_custom_world_agent_session_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/delete_custom_world_agent_session_procedure.rs @@ -31,10 +31,10 @@ pub trait delete_custom_world_agent_session { input: CustomWorldAgentSessionGetInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl delete_custom_world_agent_session for super::RemoteProcedures { input: CustomWorldAgentSessionGetInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, CustomWorldWorksListResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/delete_custom_world_profile_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/delete_custom_world_profile_and_return_procedure.rs index 5dc9da2f..246d4d00 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/delete_custom_world_profile_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/delete_custom_world_profile_and_return_procedure.rs @@ -31,10 +31,10 @@ pub trait delete_custom_world_profile_and_return { input: CustomWorldProfileDeleteInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl delete_custom_world_profile_and_return for super::RemoteProcedures { input: CustomWorldProfileDeleteInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, CustomWorldProfileListResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/delete_match_3_d_work_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/delete_match_3_d_work_procedure.rs index c87cd16a..c26b2dc8 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/delete_match_3_d_work_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/delete_match_3_d_work_procedure.rs @@ -31,10 +31,10 @@ pub trait delete_match_3_d_work { input: Match3DWorkDeleteInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl delete_match_3_d_work for super::RemoteProcedures { input: Match3DWorkDeleteInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, Match3DWorksProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/delete_puzzle_work_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/delete_puzzle_work_procedure.rs index fc8152c5..5b7e5375 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/delete_puzzle_work_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/delete_puzzle_work_procedure.rs @@ -31,10 +31,10 @@ pub trait delete_puzzle_work { input: PuzzleWorkDeleteInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl delete_puzzle_work for super::RemoteProcedures { input: PuzzleWorkDeleteInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, PuzzleWorksProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/delete_runtime_snapshot_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/delete_runtime_snapshot_and_return_procedure.rs index 9173255a..6373a19b 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/delete_runtime_snapshot_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/delete_runtime_snapshot_and_return_procedure.rs @@ -31,10 +31,10 @@ pub trait delete_runtime_snapshot_and_return { input: RuntimeSnapshotDeleteInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl delete_runtime_snapshot_and_return for super::RemoteProcedures { input: RuntimeSnapshotDeleteInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, RuntimeSnapshotProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/drag_puzzle_piece_or_group_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/drag_puzzle_piece_or_group_procedure.rs index 1207f7b5..daad89bd 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/drag_puzzle_piece_or_group_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/drag_puzzle_piece_or_group_procedure.rs @@ -31,10 +31,10 @@ pub trait drag_puzzle_piece_or_group { input: PuzzleRunDragInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl drag_puzzle_piece_or_group for super::RemoteProcedures { input: PuzzleRunDragInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, PuzzleRunProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/ensure_analytics_date_dimension_for_date_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/ensure_analytics_date_dimension_for_date_reducer.rs new file mode 100644 index 00000000..30b9ba35 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/ensure_analytics_date_dimension_for_date_reducer.rs @@ -0,0 +1,73 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +use super::analytics_date_dimension_ensure_input_type::AnalyticsDateDimensionEnsureInput; + +#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] +#[sats(crate = __lib)] +pub(super) struct EnsureAnalyticsDateDimensionForDateArgs { + pub input: AnalyticsDateDimensionEnsureInput, +} + +impl From for super::Reducer { + fn from(args: EnsureAnalyticsDateDimensionForDateArgs) -> Self { + Self::EnsureAnalyticsDateDimensionForDate { input: args.input } + } +} + +impl __sdk::InModule for EnsureAnalyticsDateDimensionForDateArgs { + type Module = super::RemoteModule; +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the reducer `ensure_analytics_date_dimension_for_date`. +/// +/// Implemented for [`super::RemoteReducers`]. +pub trait ensure_analytics_date_dimension_for_date { + /// Request that the remote module invoke the reducer `ensure_analytics_date_dimension_for_date` to run as soon as possible. + /// + /// This method returns immediately, and errors only if we are unable to send the request. + /// The reducer will run asynchronously in the future, + /// and this method provides no way to listen for its completion status. + /// /// Use [`ensure_analytics_date_dimension_for_date:ensure_analytics_date_dimension_for_date_then`] to run a callback after the reducer completes. + fn ensure_analytics_date_dimension_for_date( + &self, + input: AnalyticsDateDimensionEnsureInput, + ) -> __sdk::Result<()> { + self.ensure_analytics_date_dimension_for_date_then(input, |_, _| {}) + } + + /// Request that the remote module invoke the reducer `ensure_analytics_date_dimension_for_date` to run as soon as possible, + /// registering `callback` to run when we are notified that the reducer completed. + /// + /// This method returns immediately, and errors only if we are unable to send the request. + /// The reducer will run asynchronously in the future, + /// and its status can be observed with the `callback`. + fn ensure_analytics_date_dimension_for_date_then( + &self, + input: AnalyticsDateDimensionEnsureInput, + + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, + ) -> __sdk::Result<()>; +} + +impl ensure_analytics_date_dimension_for_date for super::RemoteReducers { + fn ensure_analytics_date_dimension_for_date_then( + &self, + input: AnalyticsDateDimensionEnsureInput, + + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, + ) -> __sdk::Result<()> { + self.imp.invoke_reducer_with_callback( + EnsureAnalyticsDateDimensionForDateArgs { input }, + callback, + ) + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/execute_custom_world_agent_action_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/execute_custom_world_agent_action_procedure.rs index c1008466..e778877c 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/execute_custom_world_agent_action_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/execute_custom_world_agent_action_procedure.rs @@ -31,10 +31,10 @@ pub trait execute_custom_world_agent_action { input: CustomWorldAgentActionExecuteInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl execute_custom_world_agent_action for super::RemoteProcedures { input: CustomWorldAgentActionExecuteInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, CustomWorldAgentActionExecuteResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/export_auth_store_snapshot_from_tables_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/export_auth_store_snapshot_from_tables_procedure.rs index 9e8059fa..9f8842ad 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/export_auth_store_snapshot_from_tables_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/export_auth_store_snapshot_from_tables_procedure.rs @@ -27,10 +27,10 @@ pub trait export_auth_store_snapshot_from_tables { &self, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -39,10 +39,10 @@ impl export_auth_store_snapshot_from_tables for super::RemoteProcedures { &self, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, AuthStoreSnapshotProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/export_database_migration_to_file_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/export_database_migration_to_file_procedure.rs index d850737b..3dfe18f8 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/export_database_migration_to_file_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/export_database_migration_to_file_procedure.rs @@ -31,10 +31,10 @@ pub trait export_database_migration_to_file { input: DatabaseMigrationExportInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl export_database_migration_to_file for super::RemoteProcedures { input: DatabaseMigrationExportInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, DatabaseMigrationProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/fail_ai_task_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/fail_ai_task_and_return_procedure.rs index 3194799b..46090a01 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/fail_ai_task_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/fail_ai_task_and_return_procedure.rs @@ -31,10 +31,10 @@ pub trait fail_ai_task_and_return { input: AiTaskFailureInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl fail_ai_task_and_return for super::RemoteProcedures { input: AiTaskFailureInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, AiTaskProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/finalize_big_fish_agent_message_turn_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/finalize_big_fish_agent_message_turn_procedure.rs index a2dd9fd5..9f5c8e7a 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/finalize_big_fish_agent_message_turn_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/finalize_big_fish_agent_message_turn_procedure.rs @@ -31,10 +31,10 @@ pub trait finalize_big_fish_agent_message_turn { input: BigFishMessageFinalizeInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl finalize_big_fish_agent_message_turn for super::RemoteProcedures { input: BigFishMessageFinalizeInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, BigFishSessionProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/finalize_custom_world_agent_message_turn_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/finalize_custom_world_agent_message_turn_procedure.rs index f670f9b6..fad75a7b 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/finalize_custom_world_agent_message_turn_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/finalize_custom_world_agent_message_turn_procedure.rs @@ -34,10 +34,10 @@ pub trait finalize_custom_world_agent_message_turn { input: CustomWorldAgentMessageFinalizeInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -47,10 +47,10 @@ impl finalize_custom_world_agent_message_turn for super::RemoteProcedures { input: CustomWorldAgentMessageFinalizeInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, CustomWorldAgentOperationProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/finalize_match_3_d_agent_message_turn_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/finalize_match_3_d_agent_message_turn_procedure.rs index ea0ec225..9d51ab95 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/finalize_match_3_d_agent_message_turn_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/finalize_match_3_d_agent_message_turn_procedure.rs @@ -31,10 +31,10 @@ pub trait finalize_match_3_d_agent_message_turn { input: Match3DAgentMessageFinalizeInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl finalize_match_3_d_agent_message_turn for super::RemoteProcedures { input: Match3DAgentMessageFinalizeInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, Match3DAgentSessionProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/finalize_puzzle_agent_message_turn_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/finalize_puzzle_agent_message_turn_procedure.rs index 7f06aafa..0014d394 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/finalize_puzzle_agent_message_turn_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/finalize_puzzle_agent_message_turn_procedure.rs @@ -31,10 +31,10 @@ pub trait finalize_puzzle_agent_message_turn { input: PuzzleAgentMessageFinalizeInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl finalize_puzzle_agent_message_turn for super::RemoteProcedures { input: PuzzleAgentMessageFinalizeInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, PuzzleAgentSessionProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/finish_match_3_d_time_up_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/finish_match_3_d_time_up_procedure.rs index bd849631..0d68dbd9 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/finish_match_3_d_time_up_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/finish_match_3_d_time_up_procedure.rs @@ -31,10 +31,10 @@ pub trait finish_match_3_d_time_up { input: Match3DRunTimeUpInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl finish_match_3_d_time_up for super::RemoteProcedures { input: Match3DRunTimeUpInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, Match3DRunProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/generate_big_fish_asset_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/generate_big_fish_asset_procedure.rs index 144c5d40..1a87c951 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/generate_big_fish_asset_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/generate_big_fish_asset_procedure.rs @@ -31,10 +31,10 @@ pub trait generate_big_fish_asset { input: BigFishAssetGenerateInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl generate_big_fish_asset for super::RemoteProcedures { input: BigFishAssetGenerateInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, BigFishSessionProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/get_auth_store_snapshot_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_auth_store_snapshot_procedure.rs index 61c5f8fd..51b3d201 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_auth_store_snapshot_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_auth_store_snapshot_procedure.rs @@ -27,10 +27,10 @@ pub trait get_auth_store_snapshot { &self, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -39,10 +39,10 @@ impl get_auth_store_snapshot for super::RemoteProcedures { &self, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, AuthStoreSnapshotProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/get_battle_state_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_battle_state_procedure.rs index 0fcc276c..a737fbdf 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_battle_state_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_battle_state_procedure.rs @@ -31,10 +31,10 @@ pub trait get_battle_state { input: BattleStateQueryInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl get_battle_state for super::RemoteProcedures { input: BattleStateQueryInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, BattleStateProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/get_big_fish_run_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_big_fish_run_procedure.rs index 9a601ff2..867a6759 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_big_fish_run_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_big_fish_run_procedure.rs @@ -31,10 +31,10 @@ pub trait get_big_fish_run { input: BigFishRunGetInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl get_big_fish_run for super::RemoteProcedures { input: BigFishRunGetInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, BigFishRunProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/get_big_fish_session_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_big_fish_session_procedure.rs index 7f52f94b..0b0d78f1 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_big_fish_session_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_big_fish_session_procedure.rs @@ -31,10 +31,10 @@ pub trait get_big_fish_session { input: BigFishSessionGetInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl get_big_fish_session for super::RemoteProcedures { input: BigFishSessionGetInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, BigFishSessionProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/get_chapter_progression_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_chapter_progression_procedure.rs index 18f9ae27..eef158dc 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_chapter_progression_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_chapter_progression_procedure.rs @@ -31,10 +31,10 @@ pub trait get_chapter_progression { input: ChapterProgressionGetInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl get_chapter_progression for super::RemoteProcedures { input: ChapterProgressionGetInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, ChapterProgressionProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/get_custom_world_agent_card_detail_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_custom_world_agent_card_detail_procedure.rs index e1034345..11a90329 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_custom_world_agent_card_detail_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_custom_world_agent_card_detail_procedure.rs @@ -31,10 +31,10 @@ pub trait get_custom_world_agent_card_detail { input: CustomWorldAgentCardDetailGetInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl get_custom_world_agent_card_detail for super::RemoteProcedures { input: CustomWorldAgentCardDetailGetInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, CustomWorldDraftCardDetailResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/get_custom_world_agent_operation_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_custom_world_agent_operation_procedure.rs index cce1dbb5..1c4ffd6a 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_custom_world_agent_operation_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_custom_world_agent_operation_procedure.rs @@ -31,10 +31,10 @@ pub trait get_custom_world_agent_operation { input: CustomWorldAgentOperationGetInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl get_custom_world_agent_operation for super::RemoteProcedures { input: CustomWorldAgentOperationGetInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, CustomWorldAgentOperationProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/get_custom_world_agent_session_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_custom_world_agent_session_procedure.rs index f4b678e9..212987e4 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_custom_world_agent_session_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_custom_world_agent_session_procedure.rs @@ -31,10 +31,10 @@ pub trait get_custom_world_agent_session { input: CustomWorldAgentSessionGetInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl get_custom_world_agent_session for super::RemoteProcedures { input: CustomWorldAgentSessionGetInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, CustomWorldAgentSessionProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/get_custom_world_gallery_detail_by_code_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_custom_world_gallery_detail_by_code_procedure.rs index a387cbaf..24768c43 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_custom_world_gallery_detail_by_code_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_custom_world_gallery_detail_by_code_procedure.rs @@ -31,10 +31,10 @@ pub trait get_custom_world_gallery_detail_by_code { input: CustomWorldGalleryDetailByCodeInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl get_custom_world_gallery_detail_by_code for super::RemoteProcedures { input: CustomWorldGalleryDetailByCodeInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, CustomWorldLibraryMutationResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/get_custom_world_gallery_detail_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_custom_world_gallery_detail_procedure.rs index d0e029ff..f5127dcf 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_custom_world_gallery_detail_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_custom_world_gallery_detail_procedure.rs @@ -31,10 +31,10 @@ pub trait get_custom_world_gallery_detail { input: CustomWorldGalleryDetailInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl get_custom_world_gallery_detail for super::RemoteProcedures { input: CustomWorldGalleryDetailInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, CustomWorldLibraryMutationResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/get_custom_world_library_detail_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_custom_world_library_detail_procedure.rs index 82bd1c3c..ab99274a 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_custom_world_library_detail_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_custom_world_library_detail_procedure.rs @@ -31,10 +31,10 @@ pub trait get_custom_world_library_detail { input: CustomWorldLibraryDetailInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl get_custom_world_library_detail for super::RemoteProcedures { input: CustomWorldLibraryDetailInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, CustomWorldLibraryMutationResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/get_match_3_d_agent_session_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_match_3_d_agent_session_procedure.rs index 574012d9..62d093b5 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_match_3_d_agent_session_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_match_3_d_agent_session_procedure.rs @@ -31,10 +31,10 @@ pub trait get_match_3_d_agent_session { input: Match3DAgentSessionGetInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl get_match_3_d_agent_session for super::RemoteProcedures { input: Match3DAgentSessionGetInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, Match3DAgentSessionProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/get_match_3_d_run_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_match_3_d_run_procedure.rs index 0a472230..033e620c 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_match_3_d_run_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_match_3_d_run_procedure.rs @@ -31,10 +31,10 @@ pub trait get_match_3_d_run { input: Match3DRunGetInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl get_match_3_d_run for super::RemoteProcedures { input: Match3DRunGetInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, Match3DRunProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/get_match_3_d_work_detail_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_match_3_d_work_detail_procedure.rs index 0ea9f495..5a74982b 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_match_3_d_work_detail_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_match_3_d_work_detail_procedure.rs @@ -31,10 +31,10 @@ pub trait get_match_3_d_work_detail { input: Match3DWorkGetInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl get_match_3_d_work_detail for super::RemoteProcedures { input: Match3DWorkGetInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, Match3DWorkProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/get_player_progression_or_default_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_player_progression_or_default_procedure.rs index 38a1525a..97c139fb 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_player_progression_or_default_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_player_progression_or_default_procedure.rs @@ -31,10 +31,10 @@ pub trait get_player_progression_or_default { input: PlayerProgressionGetInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl get_player_progression_or_default for super::RemoteProcedures { input: PlayerProgressionGetInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, PlayerProgressionProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/get_profile_dashboard_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_profile_dashboard_procedure.rs index 6c48fafb..38200b75 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_profile_dashboard_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_profile_dashboard_procedure.rs @@ -31,10 +31,10 @@ pub trait get_profile_dashboard { input: RuntimeProfileDashboardGetInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl get_profile_dashboard for super::RemoteProcedures { input: RuntimeProfileDashboardGetInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, RuntimeProfileDashboardProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/get_profile_play_stats_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_profile_play_stats_procedure.rs index 088f4812..2ad47ed2 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_profile_play_stats_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_profile_play_stats_procedure.rs @@ -31,10 +31,10 @@ pub trait get_profile_play_stats { input: RuntimeProfilePlayStatsGetInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl get_profile_play_stats for super::RemoteProcedures { input: RuntimeProfilePlayStatsGetInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, RuntimeProfilePlayStatsProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/get_profile_recharge_center_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_profile_recharge_center_procedure.rs index 3e42f3d5..bf070c9c 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_profile_recharge_center_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_profile_recharge_center_procedure.rs @@ -31,10 +31,10 @@ pub trait get_profile_recharge_center { input: RuntimeProfileRechargeCenterGetInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl get_profile_recharge_center for super::RemoteProcedures { input: RuntimeProfileRechargeCenterGetInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, RuntimeProfileRechargeCenterProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/get_profile_referral_invite_center_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_profile_referral_invite_center_procedure.rs index c7221484..2b3dcdad 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_profile_referral_invite_center_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_profile_referral_invite_center_procedure.rs @@ -31,10 +31,10 @@ pub trait get_profile_referral_invite_center { input: RuntimeReferralInviteCenterGetInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl get_profile_referral_invite_center for super::RemoteProcedures { input: RuntimeReferralInviteCenterGetInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, RuntimeReferralInviteCenterProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/get_profile_task_center_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_profile_task_center_procedure.rs index 0aa83260..105a4f98 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_profile_task_center_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_profile_task_center_procedure.rs @@ -31,10 +31,10 @@ pub trait get_profile_task_center { input: RuntimeProfileTaskCenterGetInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl get_profile_task_center for super::RemoteProcedures { input: RuntimeProfileTaskCenterGetInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, RuntimeProfileTaskCenterProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/get_puzzle_agent_session_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_puzzle_agent_session_procedure.rs index 8aa5a78f..97929382 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_puzzle_agent_session_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_puzzle_agent_session_procedure.rs @@ -31,10 +31,10 @@ pub trait get_puzzle_agent_session { input: PuzzleAgentSessionGetInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl get_puzzle_agent_session for super::RemoteProcedures { input: PuzzleAgentSessionGetInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, PuzzleAgentSessionProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/get_puzzle_gallery_detail_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_puzzle_gallery_detail_procedure.rs index 85b70081..a1471eb3 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_puzzle_gallery_detail_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_puzzle_gallery_detail_procedure.rs @@ -31,10 +31,10 @@ pub trait get_puzzle_gallery_detail { input: PuzzleWorkGetInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl get_puzzle_gallery_detail for super::RemoteProcedures { input: PuzzleWorkGetInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, PuzzleWorkProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/get_puzzle_run_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_puzzle_run_procedure.rs index d09fc285..2db5ab66 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_puzzle_run_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_puzzle_run_procedure.rs @@ -31,10 +31,10 @@ pub trait get_puzzle_run { input: PuzzleRunGetInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl get_puzzle_run for super::RemoteProcedures { input: PuzzleRunGetInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, PuzzleRunProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/get_puzzle_work_detail_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_puzzle_work_detail_procedure.rs index 0d6c4f70..d36c7417 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_puzzle_work_detail_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_puzzle_work_detail_procedure.rs @@ -31,10 +31,10 @@ pub trait get_puzzle_work_detail { input: PuzzleWorkGetInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl get_puzzle_work_detail for super::RemoteProcedures { input: PuzzleWorkGetInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, PuzzleWorkProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/get_runtime_inventory_state_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_runtime_inventory_state_procedure.rs index c8dfefac..abbf4f20 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_runtime_inventory_state_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_runtime_inventory_state_procedure.rs @@ -31,10 +31,10 @@ pub trait get_runtime_inventory_state { input: RuntimeInventoryStateQueryInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl get_runtime_inventory_state for super::RemoteProcedures { input: RuntimeInventoryStateQueryInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, RuntimeInventoryStateProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/get_runtime_setting_or_default_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_runtime_setting_or_default_procedure.rs index 4ca8b03e..261caed1 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_runtime_setting_or_default_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_runtime_setting_or_default_procedure.rs @@ -31,10 +31,10 @@ pub trait get_runtime_setting_or_default { input: RuntimeSettingGetInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl get_runtime_setting_or_default for super::RemoteProcedures { input: RuntimeSettingGetInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, RuntimeSettingProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/get_runtime_snapshot_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_runtime_snapshot_procedure.rs index 7f9feb4f..989fa40e 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_runtime_snapshot_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_runtime_snapshot_procedure.rs @@ -31,10 +31,10 @@ pub trait get_runtime_snapshot { input: RuntimeSnapshotGetInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl get_runtime_snapshot for super::RemoteProcedures { input: RuntimeSnapshotGetInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, RuntimeSnapshotProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/get_story_session_state_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/get_story_session_state_procedure.rs index 44b48ada..7e566dc9 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/get_story_session_state_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/get_story_session_state_procedure.rs @@ -31,10 +31,10 @@ pub trait get_story_session_state { input: StorySessionStateInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl get_story_session_state for super::RemoteProcedures { input: StorySessionStateInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, StorySessionStateProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/grant_new_user_registration_wallet_reward_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/grant_new_user_registration_wallet_reward_procedure.rs index 71e48151..c1d7b6de 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/grant_new_user_registration_wallet_reward_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/grant_new_user_registration_wallet_reward_procedure.rs @@ -31,10 +31,10 @@ pub trait grant_new_user_registration_wallet_reward { input: RuntimeProfileDashboardGetInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl grant_new_user_registration_wallet_reward for super::RemoteProcedures { input: RuntimeProfileDashboardGetInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, RuntimeProfileWalletAdjustmentProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/grant_player_progression_experience_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/grant_player_progression_experience_and_return_procedure.rs index a3f2aa9e..4c67da63 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/grant_player_progression_experience_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/grant_player_progression_experience_and_return_procedure.rs @@ -31,10 +31,10 @@ pub trait grant_player_progression_experience_and_return { input: PlayerProgressionGrantInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl grant_player_progression_experience_and_return for super::RemoteProcedures input: PlayerProgressionGrantInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, PlayerProgressionProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/grant_player_progression_experience_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/grant_player_progression_experience_reducer.rs index bd07115e..83b48cf7 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/grant_player_progression_experience_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/grant_player_progression_experience_reducer.rs @@ -50,11 +50,9 @@ pub trait grant_player_progression_experience { &self, input: PlayerProgressionGrantInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()>; } @@ -63,11 +61,9 @@ impl grant_player_progression_experience for super::RemoteReducers { &self, input: PlayerProgressionGrantInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()> { self.imp .invoke_reducer_with_callback(GrantPlayerProgressionExperienceArgs { input }, callback) diff --git a/server-rs/crates/spacetime-client/src/module_bindings/import_auth_store_snapshot_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/import_auth_store_snapshot_procedure.rs index b4c2dd4f..2821fddc 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/import_auth_store_snapshot_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/import_auth_store_snapshot_procedure.rs @@ -27,10 +27,10 @@ pub trait import_auth_store_snapshot { &self, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -39,10 +39,10 @@ impl import_auth_store_snapshot for super::RemoteProcedures { &self, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, AuthStoreSnapshotImportProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/import_database_migration_from_chunks_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/import_database_migration_from_chunks_procedure.rs index 080dda54..73157480 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/import_database_migration_from_chunks_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/import_database_migration_from_chunks_procedure.rs @@ -31,10 +31,10 @@ pub trait import_database_migration_from_chunks { input: DatabaseMigrationImportChunksInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl import_database_migration_from_chunks for super::RemoteProcedures { input: DatabaseMigrationImportChunksInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, DatabaseMigrationProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/import_database_migration_from_file_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/import_database_migration_from_file_procedure.rs index 2ce4ee2a..7b2322ee 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/import_database_migration_from_file_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/import_database_migration_from_file_procedure.rs @@ -31,10 +31,10 @@ pub trait import_database_migration_from_file { input: DatabaseMigrationImportInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl import_database_migration_from_file for super::RemoteProcedures { input: DatabaseMigrationImportInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, DatabaseMigrationProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/import_database_migration_incremental_from_chunks_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/import_database_migration_incremental_from_chunks_procedure.rs index bbe49357..51ff565c 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/import_database_migration_incremental_from_chunks_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/import_database_migration_incremental_from_chunks_procedure.rs @@ -34,10 +34,10 @@ pub trait import_database_migration_incremental_from_chunks { input: DatabaseMigrationImportChunksInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -47,10 +47,10 @@ impl import_database_migration_incremental_from_chunks for super::RemoteProcedur input: DatabaseMigrationImportChunksInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, DatabaseMigrationProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/import_database_migration_incremental_from_file_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/import_database_migration_incremental_from_file_procedure.rs index f911c87f..2fc31804 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/import_database_migration_incremental_from_file_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/import_database_migration_incremental_from_file_procedure.rs @@ -31,10 +31,10 @@ pub trait import_database_migration_incremental_from_file { input: DatabaseMigrationImportInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl import_database_migration_incremental_from_file for super::RemoteProcedures input: DatabaseMigrationImportInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, DatabaseMigrationProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/inventory_slot_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/inventory_slot_table.rs new file mode 100644 index 00000000..277df68a --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/inventory_slot_table.rs @@ -0,0 +1,163 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::inventory_container_kind_type::InventoryContainerKind; +use super::inventory_equipment_slot_type::InventoryEquipmentSlot; +use super::inventory_item_rarity_type::InventoryItemRarity; +use super::inventory_item_source_kind_type::InventoryItemSourceKind; +use super::inventory_slot_type::InventorySlot; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `inventory_slot`. +/// +/// Obtain a handle from the [`InventorySlotTableAccess::inventory_slot`] method on [`super::RemoteTables`], +/// like `ctx.db.inventory_slot()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.inventory_slot().on_insert(...)`. +pub struct InventorySlotTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `inventory_slot`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait InventorySlotTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`InventorySlotTableHandle`], which mediates access to the table `inventory_slot`. + fn inventory_slot(&self) -> InventorySlotTableHandle<'_>; +} + +impl InventorySlotTableAccess for super::RemoteTables { + fn inventory_slot(&self) -> InventorySlotTableHandle<'_> { + InventorySlotTableHandle { + imp: self.imp.get_table::("inventory_slot"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct InventorySlotInsertCallbackId(__sdk::CallbackId); +pub struct InventorySlotDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for InventorySlotTableHandle<'ctx> { + type Row = InventorySlot; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = InventorySlotInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> InventorySlotInsertCallbackId { + InventorySlotInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: InventorySlotInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = InventorySlotDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> InventorySlotDeleteCallbackId { + InventorySlotDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: InventorySlotDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct InventorySlotUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for InventorySlotTableHandle<'ctx> { + type UpdateCallbackId = InventorySlotUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> InventorySlotUpdateCallbackId { + InventorySlotUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: InventorySlotUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `slot_id` unique index on the table `inventory_slot`, +/// which allows point queries on the field of the same name +/// via the [`InventorySlotSlotIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.inventory_slot().slot_id().find(...)`. +pub struct InventorySlotSlotIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> InventorySlotTableHandle<'ctx> { + /// Get a handle on the `slot_id` unique index on the table `inventory_slot`. + pub fn slot_id(&self) -> InventorySlotSlotIdUnique<'ctx> { + InventorySlotSlotIdUnique { + imp: self.imp.get_unique_constraint::("slot_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> InventorySlotSlotIdUnique<'ctx> { + /// Find the subscribed row whose `slot_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("inventory_slot"); + _table.add_unique_constraint::("slot_id", |row| &row.slot_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `InventorySlot`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait inventory_slotQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `InventorySlot`. + fn inventory_slot(&self) -> __sdk::__query_builder::Table; +} + +impl inventory_slotQueryTableAccess for __sdk::QueryTableAccessor { + fn inventory_slot(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("inventory_slot") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/list_asset_history_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/list_asset_history_and_return_procedure.rs index ea689b10..bcc2a742 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/list_asset_history_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/list_asset_history_and_return_procedure.rs @@ -31,10 +31,10 @@ pub trait list_asset_history_and_return { input: AssetHistoryListInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl list_asset_history_and_return for super::RemoteProcedures { input: AssetHistoryListInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, AssetHistoryListResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/list_big_fish_works_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/list_big_fish_works_procedure.rs index 45ba04af..8e4c21ba 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/list_big_fish_works_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/list_big_fish_works_procedure.rs @@ -31,10 +31,10 @@ pub trait list_big_fish_works { input: BigFishWorksListInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl list_big_fish_works for super::RemoteProcedures { input: BigFishWorksListInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, BigFishWorksProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/list_custom_world_gallery_entries_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/list_custom_world_gallery_entries_procedure.rs index 01f6cb0c..63ee059f 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/list_custom_world_gallery_entries_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/list_custom_world_gallery_entries_procedure.rs @@ -27,10 +27,10 @@ pub trait list_custom_world_gallery_entries { &self, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -39,10 +39,10 @@ impl list_custom_world_gallery_entries for super::RemoteProcedures { &self, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, CustomWorldGalleryListResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/list_custom_world_profiles_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/list_custom_world_profiles_procedure.rs index c42ce2c6..f8834945 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/list_custom_world_profiles_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/list_custom_world_profiles_procedure.rs @@ -31,10 +31,10 @@ pub trait list_custom_world_profiles { input: CustomWorldProfileListInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl list_custom_world_profiles for super::RemoteProcedures { input: CustomWorldProfileListInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, CustomWorldProfileListResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/list_custom_world_works_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/list_custom_world_works_procedure.rs index 77f48ba6..d469f660 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/list_custom_world_works_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/list_custom_world_works_procedure.rs @@ -31,10 +31,10 @@ pub trait list_custom_world_works { input: CustomWorldWorksListInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl list_custom_world_works for super::RemoteProcedures { input: CustomWorldWorksListInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, CustomWorldWorksListResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/list_match_3_d_works_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/list_match_3_d_works_procedure.rs index c593e848..b1477034 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/list_match_3_d_works_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/list_match_3_d_works_procedure.rs @@ -31,10 +31,10 @@ pub trait list_match_3_d_works { input: Match3DWorksListInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl list_match_3_d_works for super::RemoteProcedures { input: Match3DWorksListInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, Match3DWorksProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/list_platform_browse_history_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/list_platform_browse_history_procedure.rs index 00176656..0d368a99 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/list_platform_browse_history_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/list_platform_browse_history_procedure.rs @@ -31,10 +31,10 @@ pub trait list_platform_browse_history { input: RuntimeBrowseHistoryListInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl list_platform_browse_history for super::RemoteProcedures { input: RuntimeBrowseHistoryListInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, RuntimeBrowseHistoryProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/list_profile_save_archives_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/list_profile_save_archives_procedure.rs index 1c7176cf..31c214bb 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/list_profile_save_archives_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/list_profile_save_archives_procedure.rs @@ -31,10 +31,10 @@ pub trait list_profile_save_archives { input: RuntimeProfileSaveArchiveListInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl list_profile_save_archives for super::RemoteProcedures { input: RuntimeProfileSaveArchiveListInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, RuntimeProfileSaveArchiveProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/list_profile_wallet_ledger_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/list_profile_wallet_ledger_procedure.rs index d51f0df2..23496701 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/list_profile_wallet_ledger_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/list_profile_wallet_ledger_procedure.rs @@ -31,10 +31,10 @@ pub trait list_profile_wallet_ledger { input: RuntimeProfileWalletLedgerListInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl list_profile_wallet_ledger for super::RemoteProcedures { input: RuntimeProfileWalletLedgerListInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, RuntimeProfileWalletLedgerProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/list_puzzle_gallery_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/list_puzzle_gallery_procedure.rs index e62fd064..553b8e08 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/list_puzzle_gallery_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/list_puzzle_gallery_procedure.rs @@ -27,10 +27,10 @@ pub trait list_puzzle_gallery { &self, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -39,10 +39,10 @@ impl list_puzzle_gallery for super::RemoteProcedures { &self, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, PuzzleWorksProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/list_puzzle_works_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/list_puzzle_works_procedure.rs index 1da004e9..844d16df 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/list_puzzle_works_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/list_puzzle_works_procedure.rs @@ -31,10 +31,10 @@ pub trait list_puzzle_works { input: PuzzleWorksListInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl list_puzzle_works for super::RemoteProcedures { input: PuzzleWorksListInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, PuzzleWorksProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/match_3_d_agent_message_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/match_3_d_agent_message_table.rs new file mode 100644 index 00000000..d2aacbf3 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/match_3_d_agent_message_table.rs @@ -0,0 +1,162 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::match_3_d_agent_message_row_type::Match3DAgentMessageRow; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `match_3_d_agent_message`. +/// +/// Obtain a handle from the [`Match3DAgentMessageTableAccess::match_3_d_agent_message`] method on [`super::RemoteTables`], +/// like `ctx.db.match_3_d_agent_message()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.match_3_d_agent_message().on_insert(...)`. +pub struct Match3DAgentMessageTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `match_3_d_agent_message`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait Match3DAgentMessageTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`Match3DAgentMessageTableHandle`], which mediates access to the table `match_3_d_agent_message`. + fn match_3_d_agent_message(&self) -> Match3DAgentMessageTableHandle<'_>; +} + +impl Match3DAgentMessageTableAccess for super::RemoteTables { + fn match_3_d_agent_message(&self) -> Match3DAgentMessageTableHandle<'_> { + Match3DAgentMessageTableHandle { + imp: self + .imp + .get_table::("match_3_d_agent_message"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct Match3DAgentMessageInsertCallbackId(__sdk::CallbackId); +pub struct Match3DAgentMessageDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for Match3DAgentMessageTableHandle<'ctx> { + type Row = Match3DAgentMessageRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = Match3DAgentMessageInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> Match3DAgentMessageInsertCallbackId { + Match3DAgentMessageInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: Match3DAgentMessageInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = Match3DAgentMessageDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> Match3DAgentMessageDeleteCallbackId { + Match3DAgentMessageDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: Match3DAgentMessageDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct Match3DAgentMessageUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for Match3DAgentMessageTableHandle<'ctx> { + type UpdateCallbackId = Match3DAgentMessageUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> Match3DAgentMessageUpdateCallbackId { + Match3DAgentMessageUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: Match3DAgentMessageUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `message_id` unique index on the table `match_3_d_agent_message`, +/// which allows point queries on the field of the same name +/// via the [`Match3DAgentMessageMessageIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.match_3_d_agent_message().message_id().find(...)`. +pub struct Match3DAgentMessageMessageIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> Match3DAgentMessageTableHandle<'ctx> { + /// Get a handle on the `message_id` unique index on the table `match_3_d_agent_message`. + pub fn message_id(&self) -> Match3DAgentMessageMessageIdUnique<'ctx> { + Match3DAgentMessageMessageIdUnique { + imp: self.imp.get_unique_constraint::("message_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> Match3DAgentMessageMessageIdUnique<'ctx> { + /// Find the subscribed row whose `message_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = + client_cache.get_or_make_table::("match_3_d_agent_message"); + _table.add_unique_constraint::("message_id", |row| &row.message_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `Match3DAgentMessageRow`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait match_3_d_agent_messageQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `Match3DAgentMessageRow`. + fn match_3_d_agent_message(&self) -> __sdk::__query_builder::Table; +} + +impl match_3_d_agent_messageQueryTableAccess for __sdk::QueryTableAccessor { + fn match_3_d_agent_message(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("match_3_d_agent_message") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/match_3_d_agent_session_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/match_3_d_agent_session_table.rs new file mode 100644 index 00000000..7c792089 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/match_3_d_agent_session_table.rs @@ -0,0 +1,162 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::match_3_d_agent_session_row_type::Match3DAgentSessionRow; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `match_3_d_agent_session`. +/// +/// Obtain a handle from the [`Match3DAgentSessionTableAccess::match_3_d_agent_session`] method on [`super::RemoteTables`], +/// like `ctx.db.match_3_d_agent_session()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.match_3_d_agent_session().on_insert(...)`. +pub struct Match3DAgentSessionTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `match_3_d_agent_session`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait Match3DAgentSessionTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`Match3DAgentSessionTableHandle`], which mediates access to the table `match_3_d_agent_session`. + fn match_3_d_agent_session(&self) -> Match3DAgentSessionTableHandle<'_>; +} + +impl Match3DAgentSessionTableAccess for super::RemoteTables { + fn match_3_d_agent_session(&self) -> Match3DAgentSessionTableHandle<'_> { + Match3DAgentSessionTableHandle { + imp: self + .imp + .get_table::("match_3_d_agent_session"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct Match3DAgentSessionInsertCallbackId(__sdk::CallbackId); +pub struct Match3DAgentSessionDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for Match3DAgentSessionTableHandle<'ctx> { + type Row = Match3DAgentSessionRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = Match3DAgentSessionInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> Match3DAgentSessionInsertCallbackId { + Match3DAgentSessionInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: Match3DAgentSessionInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = Match3DAgentSessionDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> Match3DAgentSessionDeleteCallbackId { + Match3DAgentSessionDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: Match3DAgentSessionDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct Match3DAgentSessionUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for Match3DAgentSessionTableHandle<'ctx> { + type UpdateCallbackId = Match3DAgentSessionUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> Match3DAgentSessionUpdateCallbackId { + Match3DAgentSessionUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: Match3DAgentSessionUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `session_id` unique index on the table `match_3_d_agent_session`, +/// which allows point queries on the field of the same name +/// via the [`Match3DAgentSessionSessionIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.match_3_d_agent_session().session_id().find(...)`. +pub struct Match3DAgentSessionSessionIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> Match3DAgentSessionTableHandle<'ctx> { + /// Get a handle on the `session_id` unique index on the table `match_3_d_agent_session`. + pub fn session_id(&self) -> Match3DAgentSessionSessionIdUnique<'ctx> { + Match3DAgentSessionSessionIdUnique { + imp: self.imp.get_unique_constraint::("session_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> Match3DAgentSessionSessionIdUnique<'ctx> { + /// Find the subscribed row whose `session_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = + client_cache.get_or_make_table::("match_3_d_agent_session"); + _table.add_unique_constraint::("session_id", |row| &row.session_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `Match3DAgentSessionRow`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait match_3_d_agent_sessionQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `Match3DAgentSessionRow`. + fn match_3_d_agent_session(&self) -> __sdk::__query_builder::Table; +} + +impl match_3_d_agent_sessionQueryTableAccess for __sdk::QueryTableAccessor { + fn match_3_d_agent_session(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("match_3_d_agent_session") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/match_3_d_runtime_run_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/match_3_d_runtime_run_table.rs new file mode 100644 index 00000000..b0478067 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/match_3_d_runtime_run_table.rs @@ -0,0 +1,161 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::match_3_d_runtime_run_row_type::Match3DRuntimeRunRow; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `match_3_d_runtime_run`. +/// +/// Obtain a handle from the [`Match3DRuntimeRunTableAccess::match_3_d_runtime_run`] method on [`super::RemoteTables`], +/// like `ctx.db.match_3_d_runtime_run()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.match_3_d_runtime_run().on_insert(...)`. +pub struct Match3DRuntimeRunTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `match_3_d_runtime_run`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait Match3DRuntimeRunTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`Match3DRuntimeRunTableHandle`], which mediates access to the table `match_3_d_runtime_run`. + fn match_3_d_runtime_run(&self) -> Match3DRuntimeRunTableHandle<'_>; +} + +impl Match3DRuntimeRunTableAccess for super::RemoteTables { + fn match_3_d_runtime_run(&self) -> Match3DRuntimeRunTableHandle<'_> { + Match3DRuntimeRunTableHandle { + imp: self + .imp + .get_table::("match_3_d_runtime_run"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct Match3DRuntimeRunInsertCallbackId(__sdk::CallbackId); +pub struct Match3DRuntimeRunDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for Match3DRuntimeRunTableHandle<'ctx> { + type Row = Match3DRuntimeRunRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = Match3DRuntimeRunInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> Match3DRuntimeRunInsertCallbackId { + Match3DRuntimeRunInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: Match3DRuntimeRunInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = Match3DRuntimeRunDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> Match3DRuntimeRunDeleteCallbackId { + Match3DRuntimeRunDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: Match3DRuntimeRunDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct Match3DRuntimeRunUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for Match3DRuntimeRunTableHandle<'ctx> { + type UpdateCallbackId = Match3DRuntimeRunUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> Match3DRuntimeRunUpdateCallbackId { + Match3DRuntimeRunUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: Match3DRuntimeRunUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `run_id` unique index on the table `match_3_d_runtime_run`, +/// which allows point queries on the field of the same name +/// via the [`Match3DRuntimeRunRunIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.match_3_d_runtime_run().run_id().find(...)`. +pub struct Match3DRuntimeRunRunIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> Match3DRuntimeRunTableHandle<'ctx> { + /// Get a handle on the `run_id` unique index on the table `match_3_d_runtime_run`. + pub fn run_id(&self) -> Match3DRuntimeRunRunIdUnique<'ctx> { + Match3DRuntimeRunRunIdUnique { + imp: self.imp.get_unique_constraint::("run_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> Match3DRuntimeRunRunIdUnique<'ctx> { + /// Find the subscribed row whose `run_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("match_3_d_runtime_run"); + _table.add_unique_constraint::("run_id", |row| &row.run_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `Match3DRuntimeRunRow`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait match_3_d_runtime_runQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `Match3DRuntimeRunRow`. + fn match_3_d_runtime_run(&self) -> __sdk::__query_builder::Table; +} + +impl match_3_d_runtime_runQueryTableAccess for __sdk::QueryTableAccessor { + fn match_3_d_runtime_run(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("match_3_d_runtime_run") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/match_3_d_work_profile_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/match_3_d_work_profile_table.rs new file mode 100644 index 00000000..bc4c96b0 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/match_3_d_work_profile_table.rs @@ -0,0 +1,161 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::match_3_d_work_profile_row_type::Match3DWorkProfileRow; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `match_3_d_work_profile`. +/// +/// Obtain a handle from the [`Match3DWorkProfileTableAccess::match_3_d_work_profile`] method on [`super::RemoteTables`], +/// like `ctx.db.match_3_d_work_profile()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.match_3_d_work_profile().on_insert(...)`. +pub struct Match3DWorkProfileTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `match_3_d_work_profile`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait Match3DWorkProfileTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`Match3DWorkProfileTableHandle`], which mediates access to the table `match_3_d_work_profile`. + fn match_3_d_work_profile(&self) -> Match3DWorkProfileTableHandle<'_>; +} + +impl Match3DWorkProfileTableAccess for super::RemoteTables { + fn match_3_d_work_profile(&self) -> Match3DWorkProfileTableHandle<'_> { + Match3DWorkProfileTableHandle { + imp: self + .imp + .get_table::("match_3_d_work_profile"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct Match3DWorkProfileInsertCallbackId(__sdk::CallbackId); +pub struct Match3DWorkProfileDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for Match3DWorkProfileTableHandle<'ctx> { + type Row = Match3DWorkProfileRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = Match3DWorkProfileInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> Match3DWorkProfileInsertCallbackId { + Match3DWorkProfileInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: Match3DWorkProfileInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = Match3DWorkProfileDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> Match3DWorkProfileDeleteCallbackId { + Match3DWorkProfileDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: Match3DWorkProfileDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct Match3DWorkProfileUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for Match3DWorkProfileTableHandle<'ctx> { + type UpdateCallbackId = Match3DWorkProfileUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> Match3DWorkProfileUpdateCallbackId { + Match3DWorkProfileUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: Match3DWorkProfileUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `profile_id` unique index on the table `match_3_d_work_profile`, +/// which allows point queries on the field of the same name +/// via the [`Match3DWorkProfileProfileIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.match_3_d_work_profile().profile_id().find(...)`. +pub struct Match3DWorkProfileProfileIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> Match3DWorkProfileTableHandle<'ctx> { + /// Get a handle on the `profile_id` unique index on the table `match_3_d_work_profile`. + pub fn profile_id(&self) -> Match3DWorkProfileProfileIdUnique<'ctx> { + Match3DWorkProfileProfileIdUnique { + imp: self.imp.get_unique_constraint::("profile_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> Match3DWorkProfileProfileIdUnique<'ctx> { + /// Find the subscribed row whose `profile_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("match_3_d_work_profile"); + _table.add_unique_constraint::("profile_id", |row| &row.profile_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `Match3DWorkProfileRow`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait match_3_d_work_profileQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `Match3DWorkProfileRow`. + fn match_3_d_work_profile(&self) -> __sdk::__query_builder::Table; +} + +impl match_3_d_work_profileQueryTableAccess for __sdk::QueryTableAccessor { + fn match_3_d_work_profile(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("match_3_d_work_profile") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/mod.rs b/server-rs/crates/spacetime-client/src/module_bindings/mod.rs index 11af304a..c7715108 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/mod.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/mod.rs @@ -20,6 +20,7 @@ pub mod advance_puzzle_next_level_procedure; pub mod ai_result_reference_input_type; pub mod ai_result_reference_kind_type; pub mod ai_result_reference_snapshot_type; +pub mod ai_result_reference_table; pub mod ai_result_reference_type; pub mod ai_stage_completion_input_type; pub mod ai_task_cancel_input_type; @@ -37,13 +38,20 @@ pub mod ai_task_stage_kind_type; pub mod ai_task_stage_snapshot_type; pub mod ai_task_stage_start_input_type; pub mod ai_task_stage_status_type; +pub mod ai_task_stage_table; pub mod ai_task_stage_type; pub mod ai_task_start_input_type; pub mod ai_task_status_type; +pub mod ai_task_table; pub mod ai_task_type; pub mod ai_text_chunk_append_input_type; pub mod ai_text_chunk_snapshot_type; +pub mod ai_text_chunk_table; pub mod ai_text_chunk_type; +pub mod analytics_date_dimension_ensure_input_type; +pub mod analytics_date_dimension_seed_input_type; +pub mod analytics_date_dimension_table; +pub mod analytics_date_dimension_type; pub mod append_ai_text_chunk_and_return_procedure; pub mod apply_chapter_progression_ledger_entry_and_return_procedure; pub mod apply_chapter_progression_ledger_entry_reducer; @@ -52,6 +60,7 @@ pub mod apply_quest_signal_reducer; pub mod asset_entity_binding_input_type; pub mod asset_entity_binding_procedure_result_type; pub mod asset_entity_binding_snapshot_type; +pub mod asset_entity_binding_table; pub mod asset_entity_binding_type; pub mod asset_event_kind_type; pub mod asset_event_table; @@ -61,15 +70,18 @@ pub mod asset_history_list_input_type; pub mod asset_history_list_result_type; pub mod asset_object_access_policy_type; pub mod asset_object_procedure_result_type; +pub mod asset_object_table; pub mod asset_object_type; pub mod asset_object_upsert_input_type; pub mod asset_object_upsert_snapshot_type; pub mod attach_ai_result_reference_and_return_procedure; +pub mod auth_identity_table; pub mod auth_identity_type; pub mod auth_store_snapshot_import_procedure_result_type; pub mod auth_store_snapshot_import_record_type; pub mod auth_store_snapshot_procedure_result_type; pub mod auth_store_snapshot_record_type; +pub mod auth_store_snapshot_table; pub mod auth_store_snapshot_type; pub mod auth_store_snapshot_upsert_input_type; pub mod authorize_database_migration_operator_procedure; @@ -78,6 +90,7 @@ pub mod battle_state_input_type; pub mod battle_state_procedure_result_type; pub mod battle_state_query_input_type; pub mod battle_state_snapshot_type; +pub mod battle_state_table; pub mod battle_state_type; pub mod battle_status_type; pub mod begin_story_session_and_return_procedure; @@ -85,6 +98,7 @@ pub mod begin_story_session_reducer; pub mod big_fish_agent_message_kind_type; pub mod big_fish_agent_message_role_type; pub mod big_fish_agent_message_snapshot_type; +pub mod big_fish_agent_message_table; pub mod big_fish_agent_message_type; pub mod big_fish_anchor_item_type; pub mod big_fish_anchor_pack_type; @@ -93,9 +107,11 @@ pub mod big_fish_asset_coverage_type; pub mod big_fish_asset_generate_input_type; pub mod big_fish_asset_kind_type; pub mod big_fish_asset_slot_snapshot_type; +pub mod big_fish_asset_slot_table; pub mod big_fish_asset_slot_type; pub mod big_fish_asset_status_type; pub mod big_fish_background_blueprint_type; +pub mod big_fish_creation_session_table; pub mod big_fish_creation_session_type; pub mod big_fish_creation_stage_type; pub mod big_fish_draft_compile_input_type; @@ -114,6 +130,7 @@ pub mod big_fish_run_procedure_result_type; pub mod big_fish_run_start_input_type; pub mod big_fish_run_status_type; pub mod big_fish_runtime_params_type; +pub mod big_fish_runtime_run_table; pub mod big_fish_runtime_run_type; pub mod big_fish_session_create_input_type; pub mod big_fish_session_get_input_type; @@ -133,6 +150,7 @@ pub mod chapter_progression_input_type; pub mod chapter_progression_ledger_input_type; pub mod chapter_progression_procedure_result_type; pub mod chapter_progression_snapshot_type; +pub mod chapter_progression_table; pub mod chapter_progression_type; pub mod claim_profile_task_reward_and_return_procedure; pub mod claim_puzzle_work_point_incentive_procedure; @@ -167,21 +185,25 @@ pub mod custom_world_agent_card_detail_get_input_type; pub mod custom_world_agent_message_finalize_input_type; pub mod custom_world_agent_message_snapshot_type; pub mod custom_world_agent_message_submit_input_type; +pub mod custom_world_agent_message_table; pub mod custom_world_agent_message_type; pub mod custom_world_agent_operation_get_input_type; pub mod custom_world_agent_operation_procedure_result_type; pub mod custom_world_agent_operation_progress_input_type; pub mod custom_world_agent_operation_snapshot_type; +pub mod custom_world_agent_operation_table; pub mod custom_world_agent_operation_type; pub mod custom_world_agent_session_create_input_type; pub mod custom_world_agent_session_get_input_type; pub mod custom_world_agent_session_procedure_result_type; pub mod custom_world_agent_session_snapshot_type; +pub mod custom_world_agent_session_table; pub mod custom_world_agent_session_type; pub mod custom_world_draft_card_detail_result_type; pub mod custom_world_draft_card_detail_section_snapshot_type; pub mod custom_world_draft_card_detail_snapshot_type; pub mod custom_world_draft_card_snapshot_type; +pub mod custom_world_draft_card_table; pub mod custom_world_draft_card_type; pub mod custom_world_gallery_detail_by_code_input_type; pub mod custom_world_gallery_detail_input_type; @@ -200,6 +222,7 @@ pub mod custom_world_profile_play_record_input_type; pub mod custom_world_profile_publish_input_type; pub mod custom_world_profile_remix_input_type; pub mod custom_world_profile_snapshot_type; +pub mod custom_world_profile_table; pub mod custom_world_profile_type; pub mod custom_world_profile_unpublish_input_type; pub mod custom_world_profile_upsert_input_type; @@ -211,6 +234,7 @@ pub mod custom_world_published_profile_compile_result_type; pub mod custom_world_published_profile_compile_snapshot_type; pub mod custom_world_role_asset_status_type; pub mod custom_world_session_status_type; +pub mod custom_world_session_table; pub mod custom_world_session_type; pub mod custom_world_theme_mode_type; pub mod custom_world_work_summary_snapshot_type; @@ -219,11 +243,13 @@ pub mod custom_world_works_list_result_type; pub mod database_migration_authorize_operator_input_type; pub mod database_migration_export_input_type; pub mod database_migration_import_chunk_input_type; +pub mod database_migration_import_chunk_table; pub mod database_migration_import_chunk_type; pub mod database_migration_import_chunks_clear_input_type; pub mod database_migration_import_chunks_input_type; pub mod database_migration_import_input_type; pub mod database_migration_operator_procedure_result_type; +pub mod database_migration_operator_table; pub mod database_migration_operator_type; pub mod database_migration_procedure_result_type; pub mod database_migration_revoke_operator_input_type; @@ -236,6 +262,7 @@ pub mod delete_match_3_d_work_procedure; pub mod delete_puzzle_work_procedure; pub mod delete_runtime_snapshot_and_return_procedure; pub mod drag_puzzle_piece_or_group_procedure; +pub mod ensure_analytics_date_dimension_for_date_reducer; pub mod equip_inventory_item_input_type; pub mod execute_custom_world_agent_action_procedure; pub mod export_auth_store_snapshot_from_tables_procedure; @@ -292,6 +319,7 @@ pub mod inventory_item_source_kind_type; pub mod inventory_mutation_input_type; pub mod inventory_mutation_type; pub mod inventory_slot_snapshot_type; +pub mod inventory_slot_table; pub mod inventory_slot_type; pub mod list_asset_history_and_return_procedure; pub mod list_big_fish_works_procedure; @@ -307,10 +335,12 @@ pub mod list_puzzle_works_procedure; pub mod match_3_d_agent_message_finalize_input_type; pub mod match_3_d_agent_message_row_type; pub mod match_3_d_agent_message_submit_input_type; +pub mod match_3_d_agent_message_table; pub mod match_3_d_agent_session_create_input_type; pub mod match_3_d_agent_session_get_input_type; pub mod match_3_d_agent_session_procedure_result_type; pub mod match_3_d_agent_session_row_type; +pub mod match_3_d_agent_session_table; pub mod match_3_d_click_item_procedure_result_type; pub mod match_3_d_draft_compile_input_type; pub mod match_3_d_run_click_input_type; @@ -321,10 +351,12 @@ pub mod match_3_d_run_start_input_type; pub mod match_3_d_run_stop_input_type; pub mod match_3_d_run_time_up_input_type; pub mod match_3_d_runtime_run_row_type; +pub mod match_3_d_runtime_run_table; pub mod match_3_d_work_delete_input_type; pub mod match_3_d_work_get_input_type; pub mod match_3_d_work_procedure_result_type; pub mod match_3_d_work_profile_row_type; +pub mod match_3_d_work_profile_table; pub mod match_3_d_work_publish_input_type; pub mod match_3_d_work_update_input_type; pub mod match_3_d_works_list_input_type; @@ -341,6 +373,7 @@ pub mod npc_social_action_kind_type; pub mod npc_stance_profile_type; pub mod npc_state_procedure_result_type; pub mod npc_state_snapshot_type; +pub mod npc_state_table; pub mod npc_state_type; pub mod npc_state_upsert_input_type; pub mod player_progression_get_input_type; @@ -348,21 +381,37 @@ pub mod player_progression_grant_input_type; pub mod player_progression_grant_source_type; pub mod player_progression_procedure_result_type; pub mod player_progression_snapshot_type; +pub mod player_progression_table; pub mod player_progression_type; +pub mod profile_dashboard_state_table; pub mod profile_dashboard_state_type; +pub mod profile_invite_code_table; pub mod profile_invite_code_type; +pub mod profile_membership_table; pub mod profile_membership_type; +pub mod profile_played_world_table; pub mod profile_played_world_type; +pub mod profile_recharge_order_table; pub mod profile_recharge_order_type; +pub mod profile_redeem_code_table; pub mod profile_redeem_code_type; +pub mod profile_redeem_code_usage_table; pub mod profile_redeem_code_usage_type; +pub mod profile_referral_relation_table; pub mod profile_referral_relation_type; +pub mod profile_save_archive_table; pub mod profile_save_archive_type; +pub mod profile_task_config_table; pub mod profile_task_config_type; +pub mod profile_task_progress_table; pub mod profile_task_progress_type; +pub mod profile_task_reward_claim_table; pub mod profile_task_reward_claim_type; +pub mod profile_wallet_ledger_table; pub mod profile_wallet_ledger_type; +pub mod public_work_like_table; pub mod public_work_like_type; +pub mod public_work_play_daily_stat_table; pub mod public_work_play_daily_stat_type; pub mod publish_big_fish_game_procedure; pub mod publish_custom_world_profile_and_return_procedure; @@ -376,10 +425,12 @@ pub mod puzzle_agent_message_kind_type; pub mod puzzle_agent_message_role_type; pub mod puzzle_agent_message_row_type; pub mod puzzle_agent_message_submit_input_type; +pub mod puzzle_agent_message_table; pub mod puzzle_agent_session_create_input_type; pub mod puzzle_agent_session_get_input_type; pub mod puzzle_agent_session_procedure_result_type; pub mod puzzle_agent_session_row_type; +pub mod puzzle_agent_session_table; pub mod puzzle_agent_stage_type; pub mod puzzle_draft_compile_input_type; pub mod puzzle_event_kind_type; @@ -388,6 +439,7 @@ pub mod puzzle_event_type; pub mod puzzle_form_draft_save_input_type; pub mod puzzle_generated_images_save_input_type; pub mod puzzle_leaderboard_entry_row_type; +pub mod puzzle_leaderboard_entry_table; pub mod puzzle_leaderboard_submit_input_type; pub mod puzzle_publication_status_type; pub mod puzzle_publish_input_type; @@ -400,6 +452,7 @@ pub mod puzzle_run_prop_input_type; pub mod puzzle_run_start_input_type; pub mod puzzle_run_swap_input_type; pub mod puzzle_runtime_run_row_type; +pub mod puzzle_runtime_run_table; pub mod puzzle_select_cover_image_input_type; pub mod puzzle_work_delete_input_type; pub mod puzzle_work_get_input_type; @@ -407,6 +460,7 @@ pub mod puzzle_work_like_record_input_type; pub mod puzzle_work_point_incentive_claim_input_type; pub mod puzzle_work_procedure_result_type; pub mod puzzle_work_profile_row_type; +pub mod puzzle_work_profile_table; pub mod puzzle_work_remix_input_type; pub mod puzzle_work_upsert_input_type; pub mod puzzle_works_list_input_type; @@ -415,6 +469,7 @@ pub mod quest_completion_ack_input_type; pub mod quest_hostile_npc_defeated_signal_type; pub mod quest_item_delivered_signal_type; pub mod quest_log_event_kind_type; +pub mod quest_log_table; pub mod quest_log_type; pub mod quest_narrative_binding_snapshot_type; pub mod quest_narrative_origin_type; @@ -425,6 +480,7 @@ pub mod quest_objective_kind_type; pub mod quest_objective_snapshot_type; pub mod quest_progress_signal_type; pub mod quest_record_input_type; +pub mod quest_record_table; pub mod quest_record_type; pub mod quest_reward_equipment_slot_type; pub mod quest_reward_intel_type; @@ -445,6 +501,7 @@ pub mod record_custom_world_profile_play_procedure; pub mod record_puzzle_work_like_procedure; pub mod redeem_profile_referral_invite_code_procedure; pub mod redeem_profile_reward_code_procedure; +pub mod refresh_session_table; pub mod refresh_session_type; pub mod refund_profile_wallet_points_and_return_procedure; pub mod remix_big_fish_work_procedure; @@ -558,17 +615,20 @@ pub mod runtime_referral_redeem_snapshot_type; pub mod runtime_setting_get_input_type; pub mod runtime_setting_procedure_result_type; pub mod runtime_setting_snapshot_type; +pub mod runtime_setting_table; pub mod runtime_setting_type; pub mod runtime_setting_upsert_input_type; pub mod runtime_snapshot_delete_input_type; pub mod runtime_snapshot_get_input_type; pub mod runtime_snapshot_procedure_result_type; pub mod runtime_snapshot_row_type; +pub mod runtime_snapshot_table; pub mod runtime_snapshot_type; pub mod runtime_snapshot_upsert_input_type; pub mod runtime_tracking_scope_kind_type; pub mod save_puzzle_form_draft_procedure; pub mod save_puzzle_generated_images_procedure; +pub mod seed_analytics_date_dimensions_reducer; pub mod select_puzzle_cover_image_procedure; pub mod start_ai_task_reducer; pub mod start_ai_task_stage_reducer; @@ -579,6 +639,7 @@ pub mod stop_match_3_d_run_procedure; pub mod story_continue_input_type; pub mod story_event_kind_type; pub mod story_event_snapshot_type; +pub mod story_event_table; pub mod story_event_type; pub mod story_session_input_type; pub mod story_session_procedure_result_type; @@ -586,6 +647,7 @@ pub mod story_session_snapshot_type; pub mod story_session_state_input_type; pub mod story_session_state_procedure_result_type; pub mod story_session_status_type; +pub mod story_session_table; pub mod story_session_type; pub mod submit_big_fish_input_procedure; pub mod submit_big_fish_message_procedure; @@ -594,11 +656,14 @@ pub mod submit_match_3_d_agent_message_procedure; pub mod submit_puzzle_agent_message_procedure; pub mod submit_puzzle_leaderboard_entry_procedure; pub mod swap_puzzle_pieces_procedure; +pub mod tracking_daily_stat_table; pub mod tracking_daily_stat_type; +pub mod tracking_event_table; pub mod tracking_event_type; pub mod treasure_interaction_action_type; pub mod treasure_record_procedure_result_type; pub mod treasure_record_snapshot_type; +pub mod treasure_record_table; pub mod treasure_record_type; pub mod treasure_resolve_input_type; pub mod turn_in_quest_reducer; @@ -620,7 +685,9 @@ pub mod upsert_platform_browse_history_and_return_procedure; pub mod upsert_runtime_setting_and_return_procedure; pub mod upsert_runtime_snapshot_and_return_procedure; pub mod use_puzzle_runtime_prop_procedure; +pub mod user_account_table; pub mod user_account_type; +pub mod user_browse_history_table; pub mod user_browse_history_type; pub use accept_quest_reducer::accept_quest; @@ -637,6 +704,7 @@ pub use advance_puzzle_next_level_procedure::advance_puzzle_next_level; pub use ai_result_reference_input_type::AiResultReferenceInput; pub use ai_result_reference_kind_type::AiResultReferenceKind; pub use ai_result_reference_snapshot_type::AiResultReferenceSnapshot; +pub use ai_result_reference_table::*; pub use ai_result_reference_type::AiResultReference; pub use ai_stage_completion_input_type::AiStageCompletionInput; pub use ai_task_cancel_input_type::AiTaskCancelInput; @@ -654,13 +722,20 @@ pub use ai_task_stage_kind_type::AiTaskStageKind; pub use ai_task_stage_snapshot_type::AiTaskStageSnapshot; pub use ai_task_stage_start_input_type::AiTaskStageStartInput; pub use ai_task_stage_status_type::AiTaskStageStatus; +pub use ai_task_stage_table::*; pub use ai_task_stage_type::AiTaskStage; pub use ai_task_start_input_type::AiTaskStartInput; pub use ai_task_status_type::AiTaskStatus; +pub use ai_task_table::*; pub use ai_task_type::AiTask; pub use ai_text_chunk_append_input_type::AiTextChunkAppendInput; pub use ai_text_chunk_snapshot_type::AiTextChunkSnapshot; +pub use ai_text_chunk_table::*; pub use ai_text_chunk_type::AiTextChunk; +pub use analytics_date_dimension_ensure_input_type::AnalyticsDateDimensionEnsureInput; +pub use analytics_date_dimension_seed_input_type::AnalyticsDateDimensionSeedInput; +pub use analytics_date_dimension_table::*; +pub use analytics_date_dimension_type::AnalyticsDateDimension; pub use append_ai_text_chunk_and_return_procedure::append_ai_text_chunk_and_return; pub use apply_chapter_progression_ledger_entry_and_return_procedure::apply_chapter_progression_ledger_entry_and_return; pub use apply_chapter_progression_ledger_entry_reducer::apply_chapter_progression_ledger_entry; @@ -669,6 +744,7 @@ pub use apply_quest_signal_reducer::apply_quest_signal; pub use asset_entity_binding_input_type::AssetEntityBindingInput; pub use asset_entity_binding_procedure_result_type::AssetEntityBindingProcedureResult; pub use asset_entity_binding_snapshot_type::AssetEntityBindingSnapshot; +pub use asset_entity_binding_table::*; pub use asset_entity_binding_type::AssetEntityBinding; pub use asset_event_kind_type::AssetEventKind; pub use asset_event_table::*; @@ -678,15 +754,18 @@ pub use asset_history_list_input_type::AssetHistoryListInput; pub use asset_history_list_result_type::AssetHistoryListResult; pub use asset_object_access_policy_type::AssetObjectAccessPolicy; pub use asset_object_procedure_result_type::AssetObjectProcedureResult; +pub use asset_object_table::*; pub use asset_object_type::AssetObject; pub use asset_object_upsert_input_type::AssetObjectUpsertInput; pub use asset_object_upsert_snapshot_type::AssetObjectUpsertSnapshot; pub use attach_ai_result_reference_and_return_procedure::attach_ai_result_reference_and_return; +pub use auth_identity_table::*; pub use auth_identity_type::AuthIdentity; pub use auth_store_snapshot_import_procedure_result_type::AuthStoreSnapshotImportProcedureResult; pub use auth_store_snapshot_import_record_type::AuthStoreSnapshotImportRecord; pub use auth_store_snapshot_procedure_result_type::AuthStoreSnapshotProcedureResult; pub use auth_store_snapshot_record_type::AuthStoreSnapshotRecord; +pub use auth_store_snapshot_table::*; pub use auth_store_snapshot_type::AuthStoreSnapshot; pub use auth_store_snapshot_upsert_input_type::AuthStoreSnapshotUpsertInput; pub use authorize_database_migration_operator_procedure::authorize_database_migration_operator; @@ -695,6 +774,7 @@ pub use battle_state_input_type::BattleStateInput; pub use battle_state_procedure_result_type::BattleStateProcedureResult; pub use battle_state_query_input_type::BattleStateQueryInput; pub use battle_state_snapshot_type::BattleStateSnapshot; +pub use battle_state_table::*; pub use battle_state_type::BattleState; pub use battle_status_type::BattleStatus; pub use begin_story_session_and_return_procedure::begin_story_session_and_return; @@ -702,6 +782,7 @@ pub use begin_story_session_reducer::begin_story_session; pub use big_fish_agent_message_kind_type::BigFishAgentMessageKind; pub use big_fish_agent_message_role_type::BigFishAgentMessageRole; pub use big_fish_agent_message_snapshot_type::BigFishAgentMessageSnapshot; +pub use big_fish_agent_message_table::*; pub use big_fish_agent_message_type::BigFishAgentMessage; pub use big_fish_anchor_item_type::BigFishAnchorItem; pub use big_fish_anchor_pack_type::BigFishAnchorPack; @@ -710,9 +791,11 @@ pub use big_fish_asset_coverage_type::BigFishAssetCoverage; pub use big_fish_asset_generate_input_type::BigFishAssetGenerateInput; pub use big_fish_asset_kind_type::BigFishAssetKind; pub use big_fish_asset_slot_snapshot_type::BigFishAssetSlotSnapshot; +pub use big_fish_asset_slot_table::*; pub use big_fish_asset_slot_type::BigFishAssetSlot; pub use big_fish_asset_status_type::BigFishAssetStatus; pub use big_fish_background_blueprint_type::BigFishBackgroundBlueprint; +pub use big_fish_creation_session_table::*; pub use big_fish_creation_session_type::BigFishCreationSession; pub use big_fish_creation_stage_type::BigFishCreationStage; pub use big_fish_draft_compile_input_type::BigFishDraftCompileInput; @@ -731,6 +814,7 @@ pub use big_fish_run_procedure_result_type::BigFishRunProcedureResult; pub use big_fish_run_start_input_type::BigFishRunStartInput; pub use big_fish_run_status_type::BigFishRunStatus; pub use big_fish_runtime_params_type::BigFishRuntimeParams; +pub use big_fish_runtime_run_table::*; pub use big_fish_runtime_run_type::BigFishRuntimeRun; pub use big_fish_session_create_input_type::BigFishSessionCreateInput; pub use big_fish_session_get_input_type::BigFishSessionGetInput; @@ -750,6 +834,7 @@ pub use chapter_progression_input_type::ChapterProgressionInput; pub use chapter_progression_ledger_input_type::ChapterProgressionLedgerInput; pub use chapter_progression_procedure_result_type::ChapterProgressionProcedureResult; pub use chapter_progression_snapshot_type::ChapterProgressionSnapshot; +pub use chapter_progression_table::*; pub use chapter_progression_type::ChapterProgression; pub use claim_profile_task_reward_and_return_procedure::claim_profile_task_reward_and_return; pub use claim_puzzle_work_point_incentive_procedure::claim_puzzle_work_point_incentive; @@ -784,21 +869,25 @@ pub use custom_world_agent_card_detail_get_input_type::CustomWorldAgentCardDetai pub use custom_world_agent_message_finalize_input_type::CustomWorldAgentMessageFinalizeInput; pub use custom_world_agent_message_snapshot_type::CustomWorldAgentMessageSnapshot; pub use custom_world_agent_message_submit_input_type::CustomWorldAgentMessageSubmitInput; +pub use custom_world_agent_message_table::*; pub use custom_world_agent_message_type::CustomWorldAgentMessage; pub use custom_world_agent_operation_get_input_type::CustomWorldAgentOperationGetInput; pub use custom_world_agent_operation_procedure_result_type::CustomWorldAgentOperationProcedureResult; pub use custom_world_agent_operation_progress_input_type::CustomWorldAgentOperationProgressInput; pub use custom_world_agent_operation_snapshot_type::CustomWorldAgentOperationSnapshot; +pub use custom_world_agent_operation_table::*; pub use custom_world_agent_operation_type::CustomWorldAgentOperation; pub use custom_world_agent_session_create_input_type::CustomWorldAgentSessionCreateInput; pub use custom_world_agent_session_get_input_type::CustomWorldAgentSessionGetInput; pub use custom_world_agent_session_procedure_result_type::CustomWorldAgentSessionProcedureResult; pub use custom_world_agent_session_snapshot_type::CustomWorldAgentSessionSnapshot; +pub use custom_world_agent_session_table::*; pub use custom_world_agent_session_type::CustomWorldAgentSession; pub use custom_world_draft_card_detail_result_type::CustomWorldDraftCardDetailResult; pub use custom_world_draft_card_detail_section_snapshot_type::CustomWorldDraftCardDetailSectionSnapshot; pub use custom_world_draft_card_detail_snapshot_type::CustomWorldDraftCardDetailSnapshot; pub use custom_world_draft_card_snapshot_type::CustomWorldDraftCardSnapshot; +pub use custom_world_draft_card_table::*; pub use custom_world_draft_card_type::CustomWorldDraftCard; pub use custom_world_gallery_detail_by_code_input_type::CustomWorldGalleryDetailByCodeInput; pub use custom_world_gallery_detail_input_type::CustomWorldGalleryDetailInput; @@ -817,6 +906,7 @@ pub use custom_world_profile_play_record_input_type::CustomWorldProfilePlayRecor pub use custom_world_profile_publish_input_type::CustomWorldProfilePublishInput; pub use custom_world_profile_remix_input_type::CustomWorldProfileRemixInput; pub use custom_world_profile_snapshot_type::CustomWorldProfileSnapshot; +pub use custom_world_profile_table::*; pub use custom_world_profile_type::CustomWorldProfile; pub use custom_world_profile_unpublish_input_type::CustomWorldProfileUnpublishInput; pub use custom_world_profile_upsert_input_type::CustomWorldProfileUpsertInput; @@ -828,6 +918,7 @@ pub use custom_world_published_profile_compile_result_type::CustomWorldPublished pub use custom_world_published_profile_compile_snapshot_type::CustomWorldPublishedProfileCompileSnapshot; pub use custom_world_role_asset_status_type::CustomWorldRoleAssetStatus; pub use custom_world_session_status_type::CustomWorldSessionStatus; +pub use custom_world_session_table::*; pub use custom_world_session_type::CustomWorldSession; pub use custom_world_theme_mode_type::CustomWorldThemeMode; pub use custom_world_work_summary_snapshot_type::CustomWorldWorkSummarySnapshot; @@ -836,11 +927,13 @@ pub use custom_world_works_list_result_type::CustomWorldWorksListResult; pub use database_migration_authorize_operator_input_type::DatabaseMigrationAuthorizeOperatorInput; pub use database_migration_export_input_type::DatabaseMigrationExportInput; pub use database_migration_import_chunk_input_type::DatabaseMigrationImportChunkInput; +pub use database_migration_import_chunk_table::*; pub use database_migration_import_chunk_type::DatabaseMigrationImportChunk; pub use database_migration_import_chunks_clear_input_type::DatabaseMigrationImportChunksClearInput; pub use database_migration_import_chunks_input_type::DatabaseMigrationImportChunksInput; pub use database_migration_import_input_type::DatabaseMigrationImportInput; pub use database_migration_operator_procedure_result_type::DatabaseMigrationOperatorProcedureResult; +pub use database_migration_operator_table::*; pub use database_migration_operator_type::DatabaseMigrationOperator; pub use database_migration_procedure_result_type::DatabaseMigrationProcedureResult; pub use database_migration_revoke_operator_input_type::DatabaseMigrationRevokeOperatorInput; @@ -853,6 +946,7 @@ pub use delete_match_3_d_work_procedure::delete_match_3_d_work; pub use delete_puzzle_work_procedure::delete_puzzle_work; pub use delete_runtime_snapshot_and_return_procedure::delete_runtime_snapshot_and_return; pub use drag_puzzle_piece_or_group_procedure::drag_puzzle_piece_or_group; +pub use ensure_analytics_date_dimension_for_date_reducer::ensure_analytics_date_dimension_for_date; pub use equip_inventory_item_input_type::EquipInventoryItemInput; pub use execute_custom_world_agent_action_procedure::execute_custom_world_agent_action; pub use export_auth_store_snapshot_from_tables_procedure::export_auth_store_snapshot_from_tables; @@ -909,6 +1003,7 @@ pub use inventory_item_source_kind_type::InventoryItemSourceKind; pub use inventory_mutation_input_type::InventoryMutationInput; pub use inventory_mutation_type::InventoryMutation; pub use inventory_slot_snapshot_type::InventorySlotSnapshot; +pub use inventory_slot_table::*; pub use inventory_slot_type::InventorySlot; pub use list_asset_history_and_return_procedure::list_asset_history_and_return; pub use list_big_fish_works_procedure::list_big_fish_works; @@ -924,10 +1019,12 @@ pub use list_puzzle_works_procedure::list_puzzle_works; pub use match_3_d_agent_message_finalize_input_type::Match3DAgentMessageFinalizeInput; pub use match_3_d_agent_message_row_type::Match3DAgentMessageRow; pub use match_3_d_agent_message_submit_input_type::Match3DAgentMessageSubmitInput; +pub use match_3_d_agent_message_table::*; pub use match_3_d_agent_session_create_input_type::Match3DAgentSessionCreateInput; pub use match_3_d_agent_session_get_input_type::Match3DAgentSessionGetInput; pub use match_3_d_agent_session_procedure_result_type::Match3DAgentSessionProcedureResult; pub use match_3_d_agent_session_row_type::Match3DAgentSessionRow; +pub use match_3_d_agent_session_table::*; pub use match_3_d_click_item_procedure_result_type::Match3DClickItemProcedureResult; pub use match_3_d_draft_compile_input_type::Match3DDraftCompileInput; pub use match_3_d_run_click_input_type::Match3DRunClickInput; @@ -938,10 +1035,12 @@ pub use match_3_d_run_start_input_type::Match3DRunStartInput; pub use match_3_d_run_stop_input_type::Match3DRunStopInput; pub use match_3_d_run_time_up_input_type::Match3DRunTimeUpInput; pub use match_3_d_runtime_run_row_type::Match3DRuntimeRunRow; +pub use match_3_d_runtime_run_table::*; pub use match_3_d_work_delete_input_type::Match3DWorkDeleteInput; pub use match_3_d_work_get_input_type::Match3DWorkGetInput; pub use match_3_d_work_procedure_result_type::Match3DWorkProcedureResult; pub use match_3_d_work_profile_row_type::Match3DWorkProfileRow; +pub use match_3_d_work_profile_table::*; pub use match_3_d_work_publish_input_type::Match3DWorkPublishInput; pub use match_3_d_work_update_input_type::Match3DWorkUpdateInput; pub use match_3_d_works_list_input_type::Match3DWorksListInput; @@ -958,6 +1057,7 @@ pub use npc_social_action_kind_type::NpcSocialActionKind; pub use npc_stance_profile_type::NpcStanceProfile; pub use npc_state_procedure_result_type::NpcStateProcedureResult; pub use npc_state_snapshot_type::NpcStateSnapshot; +pub use npc_state_table::*; pub use npc_state_type::NpcState; pub use npc_state_upsert_input_type::NpcStateUpsertInput; pub use player_progression_get_input_type::PlayerProgressionGetInput; @@ -965,21 +1065,37 @@ pub use player_progression_grant_input_type::PlayerProgressionGrantInput; pub use player_progression_grant_source_type::PlayerProgressionGrantSource; pub use player_progression_procedure_result_type::PlayerProgressionProcedureResult; pub use player_progression_snapshot_type::PlayerProgressionSnapshot; +pub use player_progression_table::*; pub use player_progression_type::PlayerProgression; +pub use profile_dashboard_state_table::*; pub use profile_dashboard_state_type::ProfileDashboardState; +pub use profile_invite_code_table::*; pub use profile_invite_code_type::ProfileInviteCode; +pub use profile_membership_table::*; pub use profile_membership_type::ProfileMembership; +pub use profile_played_world_table::*; pub use profile_played_world_type::ProfilePlayedWorld; +pub use profile_recharge_order_table::*; pub use profile_recharge_order_type::ProfileRechargeOrder; +pub use profile_redeem_code_table::*; pub use profile_redeem_code_type::ProfileRedeemCode; +pub use profile_redeem_code_usage_table::*; pub use profile_redeem_code_usage_type::ProfileRedeemCodeUsage; +pub use profile_referral_relation_table::*; pub use profile_referral_relation_type::ProfileReferralRelation; +pub use profile_save_archive_table::*; pub use profile_save_archive_type::ProfileSaveArchive; +pub use profile_task_config_table::*; pub use profile_task_config_type::ProfileTaskConfig; +pub use profile_task_progress_table::*; pub use profile_task_progress_type::ProfileTaskProgress; +pub use profile_task_reward_claim_table::*; pub use profile_task_reward_claim_type::ProfileTaskRewardClaim; +pub use profile_wallet_ledger_table::*; pub use profile_wallet_ledger_type::ProfileWalletLedger; +pub use public_work_like_table::*; pub use public_work_like_type::PublicWorkLike; +pub use public_work_play_daily_stat_table::*; pub use public_work_play_daily_stat_type::PublicWorkPlayDailyStat; pub use publish_big_fish_game_procedure::publish_big_fish_game; pub use publish_custom_world_profile_and_return_procedure::publish_custom_world_profile_and_return; @@ -993,10 +1109,12 @@ pub use puzzle_agent_message_kind_type::PuzzleAgentMessageKind; pub use puzzle_agent_message_role_type::PuzzleAgentMessageRole; pub use puzzle_agent_message_row_type::PuzzleAgentMessageRow; pub use puzzle_agent_message_submit_input_type::PuzzleAgentMessageSubmitInput; +pub use puzzle_agent_message_table::*; pub use puzzle_agent_session_create_input_type::PuzzleAgentSessionCreateInput; pub use puzzle_agent_session_get_input_type::PuzzleAgentSessionGetInput; pub use puzzle_agent_session_procedure_result_type::PuzzleAgentSessionProcedureResult; pub use puzzle_agent_session_row_type::PuzzleAgentSessionRow; +pub use puzzle_agent_session_table::*; pub use puzzle_agent_stage_type::PuzzleAgentStage; pub use puzzle_draft_compile_input_type::PuzzleDraftCompileInput; pub use puzzle_event_kind_type::PuzzleEventKind; @@ -1005,6 +1123,7 @@ pub use puzzle_event_type::PuzzleEvent; pub use puzzle_form_draft_save_input_type::PuzzleFormDraftSaveInput; pub use puzzle_generated_images_save_input_type::PuzzleGeneratedImagesSaveInput; pub use puzzle_leaderboard_entry_row_type::PuzzleLeaderboardEntryRow; +pub use puzzle_leaderboard_entry_table::*; pub use puzzle_leaderboard_submit_input_type::PuzzleLeaderboardSubmitInput; pub use puzzle_publication_status_type::PuzzlePublicationStatus; pub use puzzle_publish_input_type::PuzzlePublishInput; @@ -1017,6 +1136,7 @@ pub use puzzle_run_prop_input_type::PuzzleRunPropInput; pub use puzzle_run_start_input_type::PuzzleRunStartInput; pub use puzzle_run_swap_input_type::PuzzleRunSwapInput; pub use puzzle_runtime_run_row_type::PuzzleRuntimeRunRow; +pub use puzzle_runtime_run_table::*; pub use puzzle_select_cover_image_input_type::PuzzleSelectCoverImageInput; pub use puzzle_work_delete_input_type::PuzzleWorkDeleteInput; pub use puzzle_work_get_input_type::PuzzleWorkGetInput; @@ -1024,6 +1144,7 @@ pub use puzzle_work_like_record_input_type::PuzzleWorkLikeRecordInput; pub use puzzle_work_point_incentive_claim_input_type::PuzzleWorkPointIncentiveClaimInput; pub use puzzle_work_procedure_result_type::PuzzleWorkProcedureResult; pub use puzzle_work_profile_row_type::PuzzleWorkProfileRow; +pub use puzzle_work_profile_table::*; pub use puzzle_work_remix_input_type::PuzzleWorkRemixInput; pub use puzzle_work_upsert_input_type::PuzzleWorkUpsertInput; pub use puzzle_works_list_input_type::PuzzleWorksListInput; @@ -1032,6 +1153,7 @@ pub use quest_completion_ack_input_type::QuestCompletionAckInput; pub use quest_hostile_npc_defeated_signal_type::QuestHostileNpcDefeatedSignal; pub use quest_item_delivered_signal_type::QuestItemDeliveredSignal; pub use quest_log_event_kind_type::QuestLogEventKind; +pub use quest_log_table::*; pub use quest_log_type::QuestLog; pub use quest_narrative_binding_snapshot_type::QuestNarrativeBindingSnapshot; pub use quest_narrative_origin_type::QuestNarrativeOrigin; @@ -1042,6 +1164,7 @@ pub use quest_objective_kind_type::QuestObjectiveKind; pub use quest_objective_snapshot_type::QuestObjectiveSnapshot; pub use quest_progress_signal_type::QuestProgressSignal; pub use quest_record_input_type::QuestRecordInput; +pub use quest_record_table::*; pub use quest_record_type::QuestRecord; pub use quest_reward_equipment_slot_type::QuestRewardEquipmentSlot; pub use quest_reward_intel_type::QuestRewardIntel; @@ -1062,6 +1185,7 @@ pub use record_custom_world_profile_play_procedure::record_custom_world_profile_ pub use record_puzzle_work_like_procedure::record_puzzle_work_like; pub use redeem_profile_referral_invite_code_procedure::redeem_profile_referral_invite_code; pub use redeem_profile_reward_code_procedure::redeem_profile_reward_code; +pub use refresh_session_table::*; pub use refresh_session_type::RefreshSession; pub use refund_profile_wallet_points_and_return_procedure::refund_profile_wallet_points_and_return; pub use remix_big_fish_work_procedure::remix_big_fish_work; @@ -1175,17 +1299,20 @@ pub use runtime_referral_redeem_snapshot_type::RuntimeReferralRedeemSnapshot; pub use runtime_setting_get_input_type::RuntimeSettingGetInput; pub use runtime_setting_procedure_result_type::RuntimeSettingProcedureResult; pub use runtime_setting_snapshot_type::RuntimeSettingSnapshot; +pub use runtime_setting_table::*; pub use runtime_setting_type::RuntimeSetting; pub use runtime_setting_upsert_input_type::RuntimeSettingUpsertInput; pub use runtime_snapshot_delete_input_type::RuntimeSnapshotDeleteInput; pub use runtime_snapshot_get_input_type::RuntimeSnapshotGetInput; pub use runtime_snapshot_procedure_result_type::RuntimeSnapshotProcedureResult; pub use runtime_snapshot_row_type::RuntimeSnapshotRow; +pub use runtime_snapshot_table::*; pub use runtime_snapshot_type::RuntimeSnapshot; pub use runtime_snapshot_upsert_input_type::RuntimeSnapshotUpsertInput; pub use runtime_tracking_scope_kind_type::RuntimeTrackingScopeKind; pub use save_puzzle_form_draft_procedure::save_puzzle_form_draft; pub use save_puzzle_generated_images_procedure::save_puzzle_generated_images; +pub use seed_analytics_date_dimensions_reducer::seed_analytics_date_dimensions; pub use select_puzzle_cover_image_procedure::select_puzzle_cover_image; pub use start_ai_task_reducer::start_ai_task; pub use start_ai_task_stage_reducer::start_ai_task_stage; @@ -1196,6 +1323,7 @@ pub use stop_match_3_d_run_procedure::stop_match_3_d_run; pub use story_continue_input_type::StoryContinueInput; pub use story_event_kind_type::StoryEventKind; pub use story_event_snapshot_type::StoryEventSnapshot; +pub use story_event_table::*; pub use story_event_type::StoryEvent; pub use story_session_input_type::StorySessionInput; pub use story_session_procedure_result_type::StorySessionProcedureResult; @@ -1203,6 +1331,7 @@ pub use story_session_snapshot_type::StorySessionSnapshot; pub use story_session_state_input_type::StorySessionStateInput; pub use story_session_state_procedure_result_type::StorySessionStateProcedureResult; pub use story_session_status_type::StorySessionStatus; +pub use story_session_table::*; pub use story_session_type::StorySession; pub use submit_big_fish_input_procedure::submit_big_fish_input; pub use submit_big_fish_message_procedure::submit_big_fish_message; @@ -1211,11 +1340,14 @@ pub use submit_match_3_d_agent_message_procedure::submit_match_3_d_agent_message pub use submit_puzzle_agent_message_procedure::submit_puzzle_agent_message; pub use submit_puzzle_leaderboard_entry_procedure::submit_puzzle_leaderboard_entry; pub use swap_puzzle_pieces_procedure::swap_puzzle_pieces; +pub use tracking_daily_stat_table::*; pub use tracking_daily_stat_type::TrackingDailyStat; +pub use tracking_event_table::*; pub use tracking_event_type::TrackingEvent; pub use treasure_interaction_action_type::TreasureInteractionAction; pub use treasure_record_procedure_result_type::TreasureRecordProcedureResult; pub use treasure_record_snapshot_type::TreasureRecordSnapshot; +pub use treasure_record_table::*; pub use treasure_record_type::TreasureRecord; pub use treasure_resolve_input_type::TreasureResolveInput; pub use turn_in_quest_reducer::turn_in_quest; @@ -1237,7 +1369,9 @@ pub use upsert_platform_browse_history_and_return_procedure::upsert_platform_bro pub use upsert_runtime_setting_and_return_procedure::upsert_runtime_setting_and_return; pub use upsert_runtime_snapshot_and_return_procedure::upsert_runtime_snapshot_and_return; pub use use_puzzle_runtime_prop_procedure::use_puzzle_runtime_prop; +pub use user_account_table::*; pub use user_account_type::UserAccount; +pub use user_browse_history_table::*; pub use user_browse_history_type::UserBrowseHistory; #[derive(Clone, PartialEq, Debug)] @@ -1281,6 +1415,9 @@ pub enum Reducer { CreateBattleState { input: BattleStateInput, }, + EnsureAnalyticsDateDimensionForDate { + input: AnalyticsDateDimensionEnsureInput, + }, GrantPlayerProgressionExperience { input: PlayerProgressionGrantInput, }, @@ -1299,6 +1436,9 @@ pub enum Reducer { ResolveTreasureInteraction { input: TreasureResolveInput, }, + SeedAnalyticsDateDimensions { + input: AnalyticsDateDimensionSeedInput, + }, StartAiTask { input: AiTaskStartInput, }, @@ -1342,6 +1482,9 @@ impl __sdk::Reducer for Reducer { Reducer::ContinueStory { .. } => "continue_story", Reducer::CreateAiTask { .. } => "create_ai_task", Reducer::CreateBattleState { .. } => "create_battle_state", + Reducer::EnsureAnalyticsDateDimensionForDate { .. } => { + "ensure_analytics_date_dimension_for_date" + } Reducer::GrantPlayerProgressionExperience { .. } => { "grant_player_progression_experience" } @@ -1350,6 +1493,7 @@ impl __sdk::Reducer for Reducer { Reducer::ResolveNpcInteraction { .. } => "resolve_npc_interaction", Reducer::ResolveNpcSocialAction { .. } => "resolve_npc_social_action", Reducer::ResolveTreasureInteraction { .. } => "resolve_treasure_interaction", + Reducer::SeedAnalyticsDateDimensions { .. } => "seed_analytics_date_dimensions", Reducer::StartAiTask { .. } => "start_ai_task", Reducer::StartAiTaskStage { .. } => "start_ai_task_stage", Reducer::TurnInQuest { .. } => "turn_in_quest", @@ -1417,6 +1561,11 @@ impl __sdk::Reducer for Reducer { input, } => __sats::bsatn::to_vec(&create_battle_state_reducer::CreateBattleStateArgs { input: input.clone(), +}), + Reducer::EnsureAnalyticsDateDimensionForDate{ + input, +} => __sats::bsatn::to_vec(&ensure_analytics_date_dimension_for_date_reducer::EnsureAnalyticsDateDimensionForDateArgs { + input: input.clone(), }), Reducer::GrantPlayerProgressionExperience{ input, @@ -1447,6 +1596,11 @@ impl __sdk::Reducer for Reducer { input, } => __sats::bsatn::to_vec(&resolve_treasure_interaction_reducer::ResolveTreasureInteractionArgs { input: input.clone(), +}), + Reducer::SeedAnalyticsDateDimensions{ + input, +} => __sats::bsatn::to_vec(&seed_analytics_date_dimensions_reducer::SeedAnalyticsDateDimensionsArgs { + input: input.clone(), }), Reducer::StartAiTask{ input, @@ -1492,11 +1646,73 @@ impl __sdk::Reducer for Reducer { #[allow(non_snake_case)] #[doc(hidden)] pub struct DbUpdate { + ai_result_reference: __sdk::TableUpdate, + ai_task: __sdk::TableUpdate, ai_task_event: __sdk::TableUpdate, + ai_task_stage: __sdk::TableUpdate, + ai_text_chunk: __sdk::TableUpdate, + analytics_date_dimension: __sdk::TableUpdate, + asset_entity_binding: __sdk::TableUpdate, asset_event: __sdk::TableUpdate, + asset_object: __sdk::TableUpdate, + auth_identity: __sdk::TableUpdate, + auth_store_snapshot: __sdk::TableUpdate, + battle_state: __sdk::TableUpdate, + big_fish_agent_message: __sdk::TableUpdate, + big_fish_asset_slot: __sdk::TableUpdate, + big_fish_creation_session: __sdk::TableUpdate, big_fish_event: __sdk::TableUpdate, + big_fish_runtime_run: __sdk::TableUpdate, + chapter_progression: __sdk::TableUpdate, + custom_world_agent_message: __sdk::TableUpdate, + custom_world_agent_operation: __sdk::TableUpdate, + custom_world_agent_session: __sdk::TableUpdate, + custom_world_draft_card: __sdk::TableUpdate, custom_world_gallery_entry: __sdk::TableUpdate, + custom_world_profile: __sdk::TableUpdate, + custom_world_session: __sdk::TableUpdate, + database_migration_import_chunk: __sdk::TableUpdate, + database_migration_operator: __sdk::TableUpdate, + inventory_slot: __sdk::TableUpdate, + match_3_d_agent_message: __sdk::TableUpdate, + match_3_d_agent_session: __sdk::TableUpdate, + match_3_d_runtime_run: __sdk::TableUpdate, + match_3_d_work_profile: __sdk::TableUpdate, + npc_state: __sdk::TableUpdate, + player_progression: __sdk::TableUpdate, + profile_dashboard_state: __sdk::TableUpdate, + profile_invite_code: __sdk::TableUpdate, + profile_membership: __sdk::TableUpdate, + profile_played_world: __sdk::TableUpdate, + profile_recharge_order: __sdk::TableUpdate, + profile_redeem_code: __sdk::TableUpdate, + profile_redeem_code_usage: __sdk::TableUpdate, + profile_referral_relation: __sdk::TableUpdate, + profile_save_archive: __sdk::TableUpdate, + profile_task_config: __sdk::TableUpdate, + profile_task_progress: __sdk::TableUpdate, + profile_task_reward_claim: __sdk::TableUpdate, + profile_wallet_ledger: __sdk::TableUpdate, + public_work_like: __sdk::TableUpdate, + public_work_play_daily_stat: __sdk::TableUpdate, + puzzle_agent_message: __sdk::TableUpdate, + puzzle_agent_session: __sdk::TableUpdate, puzzle_event: __sdk::TableUpdate, + puzzle_leaderboard_entry: __sdk::TableUpdate, + puzzle_runtime_run: __sdk::TableUpdate, + puzzle_work_profile: __sdk::TableUpdate, + quest_log: __sdk::TableUpdate, + quest_record: __sdk::TableUpdate, + refresh_session: __sdk::TableUpdate, + runtime_setting: __sdk::TableUpdate, + runtime_snapshot: __sdk::TableUpdate, + story_event: __sdk::TableUpdate, + story_session: __sdk::TableUpdate, + tracking_daily_stat: __sdk::TableUpdate, + tracking_event: __sdk::TableUpdate, + treasure_record: __sdk::TableUpdate, + user_account: __sdk::TableUpdate, + user_browse_history: __sdk::TableUpdate, } impl TryFrom<__ws::v2::TransactionUpdate> for DbUpdate { @@ -1505,21 +1721,209 @@ impl TryFrom<__ws::v2::TransactionUpdate> for DbUpdate { let mut db_update = DbUpdate::default(); for table_update in __sdk::transaction_update_iter_table_updates(raw) { match &table_update.table_name[..] { + "ai_result_reference" => db_update + .ai_result_reference + .append(ai_result_reference_table::parse_table_update(table_update)?), + "ai_task" => db_update + .ai_task + .append(ai_task_table::parse_table_update(table_update)?), "ai_task_event" => db_update .ai_task_event .append(ai_task_event_table::parse_table_update(table_update)?), + "ai_task_stage" => db_update + .ai_task_stage + .append(ai_task_stage_table::parse_table_update(table_update)?), + "ai_text_chunk" => db_update + .ai_text_chunk + .append(ai_text_chunk_table::parse_table_update(table_update)?), + "analytics_date_dimension" => db_update.analytics_date_dimension.append( + analytics_date_dimension_table::parse_table_update(table_update)?, + ), + "asset_entity_binding" => db_update.asset_entity_binding.append( + asset_entity_binding_table::parse_table_update(table_update)?, + ), "asset_event" => db_update .asset_event .append(asset_event_table::parse_table_update(table_update)?), + "asset_object" => db_update + .asset_object + .append(asset_object_table::parse_table_update(table_update)?), + "auth_identity" => db_update + .auth_identity + .append(auth_identity_table::parse_table_update(table_update)?), + "auth_store_snapshot" => db_update + .auth_store_snapshot + .append(auth_store_snapshot_table::parse_table_update(table_update)?), + "battle_state" => db_update + .battle_state + .append(battle_state_table::parse_table_update(table_update)?), + "big_fish_agent_message" => db_update.big_fish_agent_message.append( + big_fish_agent_message_table::parse_table_update(table_update)?, + ), + "big_fish_asset_slot" => db_update + .big_fish_asset_slot + .append(big_fish_asset_slot_table::parse_table_update(table_update)?), + "big_fish_creation_session" => db_update.big_fish_creation_session.append( + big_fish_creation_session_table::parse_table_update(table_update)?, + ), "big_fish_event" => db_update .big_fish_event .append(big_fish_event_table::parse_table_update(table_update)?), + "big_fish_runtime_run" => db_update.big_fish_runtime_run.append( + big_fish_runtime_run_table::parse_table_update(table_update)?, + ), + "chapter_progression" => db_update + .chapter_progression + .append(chapter_progression_table::parse_table_update(table_update)?), + "custom_world_agent_message" => db_update.custom_world_agent_message.append( + custom_world_agent_message_table::parse_table_update(table_update)?, + ), + "custom_world_agent_operation" => db_update.custom_world_agent_operation.append( + custom_world_agent_operation_table::parse_table_update(table_update)?, + ), + "custom_world_agent_session" => db_update.custom_world_agent_session.append( + custom_world_agent_session_table::parse_table_update(table_update)?, + ), + "custom_world_draft_card" => db_update.custom_world_draft_card.append( + custom_world_draft_card_table::parse_table_update(table_update)?, + ), "custom_world_gallery_entry" => db_update.custom_world_gallery_entry.append( custom_world_gallery_entry_table::parse_table_update(table_update)?, ), + "custom_world_profile" => db_update.custom_world_profile.append( + custom_world_profile_table::parse_table_update(table_update)?, + ), + "custom_world_session" => db_update.custom_world_session.append( + custom_world_session_table::parse_table_update(table_update)?, + ), + "database_migration_import_chunk" => { + db_update.database_migration_import_chunk.append( + database_migration_import_chunk_table::parse_table_update(table_update)?, + ) + } + "database_migration_operator" => db_update.database_migration_operator.append( + database_migration_operator_table::parse_table_update(table_update)?, + ), + "inventory_slot" => db_update + .inventory_slot + .append(inventory_slot_table::parse_table_update(table_update)?), + "match_3_d_agent_message" => db_update.match_3_d_agent_message.append( + match_3_d_agent_message_table::parse_table_update(table_update)?, + ), + "match_3_d_agent_session" => db_update.match_3_d_agent_session.append( + match_3_d_agent_session_table::parse_table_update(table_update)?, + ), + "match_3_d_runtime_run" => db_update.match_3_d_runtime_run.append( + match_3_d_runtime_run_table::parse_table_update(table_update)?, + ), + "match_3_d_work_profile" => db_update.match_3_d_work_profile.append( + match_3_d_work_profile_table::parse_table_update(table_update)?, + ), + "npc_state" => db_update + .npc_state + .append(npc_state_table::parse_table_update(table_update)?), + "player_progression" => db_update + .player_progression + .append(player_progression_table::parse_table_update(table_update)?), + "profile_dashboard_state" => db_update.profile_dashboard_state.append( + profile_dashboard_state_table::parse_table_update(table_update)?, + ), + "profile_invite_code" => db_update + .profile_invite_code + .append(profile_invite_code_table::parse_table_update(table_update)?), + "profile_membership" => db_update + .profile_membership + .append(profile_membership_table::parse_table_update(table_update)?), + "profile_played_world" => db_update.profile_played_world.append( + profile_played_world_table::parse_table_update(table_update)?, + ), + "profile_recharge_order" => db_update.profile_recharge_order.append( + profile_recharge_order_table::parse_table_update(table_update)?, + ), + "profile_redeem_code" => db_update + .profile_redeem_code + .append(profile_redeem_code_table::parse_table_update(table_update)?), + "profile_redeem_code_usage" => db_update.profile_redeem_code_usage.append( + profile_redeem_code_usage_table::parse_table_update(table_update)?, + ), + "profile_referral_relation" => db_update.profile_referral_relation.append( + profile_referral_relation_table::parse_table_update(table_update)?, + ), + "profile_save_archive" => db_update.profile_save_archive.append( + profile_save_archive_table::parse_table_update(table_update)?, + ), + "profile_task_config" => db_update + .profile_task_config + .append(profile_task_config_table::parse_table_update(table_update)?), + "profile_task_progress" => db_update.profile_task_progress.append( + profile_task_progress_table::parse_table_update(table_update)?, + ), + "profile_task_reward_claim" => db_update.profile_task_reward_claim.append( + profile_task_reward_claim_table::parse_table_update(table_update)?, + ), + "profile_wallet_ledger" => db_update.profile_wallet_ledger.append( + profile_wallet_ledger_table::parse_table_update(table_update)?, + ), + "public_work_like" => db_update + .public_work_like + .append(public_work_like_table::parse_table_update(table_update)?), + "public_work_play_daily_stat" => db_update.public_work_play_daily_stat.append( + public_work_play_daily_stat_table::parse_table_update(table_update)?, + ), + "puzzle_agent_message" => db_update.puzzle_agent_message.append( + puzzle_agent_message_table::parse_table_update(table_update)?, + ), + "puzzle_agent_session" => db_update.puzzle_agent_session.append( + puzzle_agent_session_table::parse_table_update(table_update)?, + ), "puzzle_event" => db_update .puzzle_event .append(puzzle_event_table::parse_table_update(table_update)?), + "puzzle_leaderboard_entry" => db_update.puzzle_leaderboard_entry.append( + puzzle_leaderboard_entry_table::parse_table_update(table_update)?, + ), + "puzzle_runtime_run" => db_update + .puzzle_runtime_run + .append(puzzle_runtime_run_table::parse_table_update(table_update)?), + "puzzle_work_profile" => db_update + .puzzle_work_profile + .append(puzzle_work_profile_table::parse_table_update(table_update)?), + "quest_log" => db_update + .quest_log + .append(quest_log_table::parse_table_update(table_update)?), + "quest_record" => db_update + .quest_record + .append(quest_record_table::parse_table_update(table_update)?), + "refresh_session" => db_update + .refresh_session + .append(refresh_session_table::parse_table_update(table_update)?), + "runtime_setting" => db_update + .runtime_setting + .append(runtime_setting_table::parse_table_update(table_update)?), + "runtime_snapshot" => db_update + .runtime_snapshot + .append(runtime_snapshot_table::parse_table_update(table_update)?), + "story_event" => db_update + .story_event + .append(story_event_table::parse_table_update(table_update)?), + "story_session" => db_update + .story_session + .append(story_session_table::parse_table_update(table_update)?), + "tracking_daily_stat" => db_update + .tracking_daily_stat + .append(tracking_daily_stat_table::parse_table_update(table_update)?), + "tracking_event" => db_update + .tracking_event + .append(tracking_event_table::parse_table_update(table_update)?), + "treasure_record" => db_update + .treasure_record + .append(treasure_record_table::parse_table_update(table_update)?), + "user_account" => db_update + .user_account + .append(user_account_table::parse_table_update(table_update)?), + "user_browse_history" => db_update + .user_browse_history + .append(user_browse_history_table::parse_table_update(table_update)?), unknown => { return Err(__sdk::InternalError::unknown_name( @@ -1546,16 +1950,331 @@ impl __sdk::DbUpdate for DbUpdate { ) -> AppliedDiff<'_> { let mut diff = AppliedDiff::default(); + diff.ai_result_reference = cache + .apply_diff_to_table::( + "ai_result_reference", + &self.ai_result_reference, + ) + .with_updates_by_pk(|row| &row.result_reference_row_id); + diff.ai_task = cache + .apply_diff_to_table::("ai_task", &self.ai_task) + .with_updates_by_pk(|row| &row.task_id); diff.ai_task_event = self.ai_task_event.into_event_diff(); + diff.ai_task_stage = cache + .apply_diff_to_table::("ai_task_stage", &self.ai_task_stage) + .with_updates_by_pk(|row| &row.task_stage_id); + diff.ai_text_chunk = cache + .apply_diff_to_table::("ai_text_chunk", &self.ai_text_chunk) + .with_updates_by_pk(|row| &row.text_chunk_row_id); + diff.analytics_date_dimension = cache + .apply_diff_to_table::( + "analytics_date_dimension", + &self.analytics_date_dimension, + ) + .with_updates_by_pk(|row| &row.date_key); + diff.asset_entity_binding = cache + .apply_diff_to_table::( + "asset_entity_binding", + &self.asset_entity_binding, + ) + .with_updates_by_pk(|row| &row.binding_id); diff.asset_event = self.asset_event.into_event_diff(); + diff.asset_object = cache + .apply_diff_to_table::("asset_object", &self.asset_object) + .with_updates_by_pk(|row| &row.asset_object_id); + diff.auth_identity = cache + .apply_diff_to_table::("auth_identity", &self.auth_identity) + .with_updates_by_pk(|row| &row.identity_id); + diff.auth_store_snapshot = cache + .apply_diff_to_table::( + "auth_store_snapshot", + &self.auth_store_snapshot, + ) + .with_updates_by_pk(|row| &row.snapshot_id); + diff.battle_state = cache + .apply_diff_to_table::("battle_state", &self.battle_state) + .with_updates_by_pk(|row| &row.battle_state_id); + diff.big_fish_agent_message = cache + .apply_diff_to_table::( + "big_fish_agent_message", + &self.big_fish_agent_message, + ) + .with_updates_by_pk(|row| &row.message_id); + diff.big_fish_asset_slot = cache + .apply_diff_to_table::( + "big_fish_asset_slot", + &self.big_fish_asset_slot, + ) + .with_updates_by_pk(|row| &row.slot_id); + diff.big_fish_creation_session = cache + .apply_diff_to_table::( + "big_fish_creation_session", + &self.big_fish_creation_session, + ) + .with_updates_by_pk(|row| &row.session_id); diff.big_fish_event = self.big_fish_event.into_event_diff(); + diff.big_fish_runtime_run = cache + .apply_diff_to_table::( + "big_fish_runtime_run", + &self.big_fish_runtime_run, + ) + .with_updates_by_pk(|row| &row.run_id); + diff.chapter_progression = cache + .apply_diff_to_table::( + "chapter_progression", + &self.chapter_progression, + ) + .with_updates_by_pk(|row| &row.chapter_progression_id); + diff.custom_world_agent_message = cache + .apply_diff_to_table::( + "custom_world_agent_message", + &self.custom_world_agent_message, + ) + .with_updates_by_pk(|row| &row.message_id); + diff.custom_world_agent_operation = cache + .apply_diff_to_table::( + "custom_world_agent_operation", + &self.custom_world_agent_operation, + ) + .with_updates_by_pk(|row| &row.operation_id); + diff.custom_world_agent_session = cache + .apply_diff_to_table::( + "custom_world_agent_session", + &self.custom_world_agent_session, + ) + .with_updates_by_pk(|row| &row.session_id); + diff.custom_world_draft_card = cache + .apply_diff_to_table::( + "custom_world_draft_card", + &self.custom_world_draft_card, + ) + .with_updates_by_pk(|row| &row.card_id); diff.custom_world_gallery_entry = cache .apply_diff_to_table::( "custom_world_gallery_entry", &self.custom_world_gallery_entry, ) .with_updates_by_pk(|row| &row.profile_id); + diff.custom_world_profile = cache + .apply_diff_to_table::( + "custom_world_profile", + &self.custom_world_profile, + ) + .with_updates_by_pk(|row| &row.profile_id); + diff.custom_world_session = cache + .apply_diff_to_table::( + "custom_world_session", + &self.custom_world_session, + ) + .with_updates_by_pk(|row| &row.session_id); + diff.database_migration_import_chunk = cache + .apply_diff_to_table::( + "database_migration_import_chunk", + &self.database_migration_import_chunk, + ) + .with_updates_by_pk(|row| &row.chunk_key); + diff.database_migration_operator = cache + .apply_diff_to_table::( + "database_migration_operator", + &self.database_migration_operator, + ) + .with_updates_by_pk(|row| &row.operator_identity); + diff.inventory_slot = cache + .apply_diff_to_table::("inventory_slot", &self.inventory_slot) + .with_updates_by_pk(|row| &row.slot_id); + diff.match_3_d_agent_message = cache + .apply_diff_to_table::( + "match_3_d_agent_message", + &self.match_3_d_agent_message, + ) + .with_updates_by_pk(|row| &row.message_id); + diff.match_3_d_agent_session = cache + .apply_diff_to_table::( + "match_3_d_agent_session", + &self.match_3_d_agent_session, + ) + .with_updates_by_pk(|row| &row.session_id); + diff.match_3_d_runtime_run = cache + .apply_diff_to_table::( + "match_3_d_runtime_run", + &self.match_3_d_runtime_run, + ) + .with_updates_by_pk(|row| &row.run_id); + diff.match_3_d_work_profile = cache + .apply_diff_to_table::( + "match_3_d_work_profile", + &self.match_3_d_work_profile, + ) + .with_updates_by_pk(|row| &row.profile_id); + diff.npc_state = cache + .apply_diff_to_table::("npc_state", &self.npc_state) + .with_updates_by_pk(|row| &row.npc_state_id); + diff.player_progression = cache + .apply_diff_to_table::( + "player_progression", + &self.player_progression, + ) + .with_updates_by_pk(|row| &row.user_id); + diff.profile_dashboard_state = cache + .apply_diff_to_table::( + "profile_dashboard_state", + &self.profile_dashboard_state, + ) + .with_updates_by_pk(|row| &row.user_id); + diff.profile_invite_code = cache + .apply_diff_to_table::( + "profile_invite_code", + &self.profile_invite_code, + ) + .with_updates_by_pk(|row| &row.user_id); + diff.profile_membership = cache + .apply_diff_to_table::( + "profile_membership", + &self.profile_membership, + ) + .with_updates_by_pk(|row| &row.user_id); + diff.profile_played_world = cache + .apply_diff_to_table::( + "profile_played_world", + &self.profile_played_world, + ) + .with_updates_by_pk(|row| &row.played_world_id); + diff.profile_recharge_order = cache + .apply_diff_to_table::( + "profile_recharge_order", + &self.profile_recharge_order, + ) + .with_updates_by_pk(|row| &row.order_id); + diff.profile_redeem_code = cache + .apply_diff_to_table::( + "profile_redeem_code", + &self.profile_redeem_code, + ) + .with_updates_by_pk(|row| &row.code); + diff.profile_redeem_code_usage = cache + .apply_diff_to_table::( + "profile_redeem_code_usage", + &self.profile_redeem_code_usage, + ) + .with_updates_by_pk(|row| &row.usage_id); + diff.profile_referral_relation = cache + .apply_diff_to_table::( + "profile_referral_relation", + &self.profile_referral_relation, + ) + .with_updates_by_pk(|row| &row.invitee_user_id); + diff.profile_save_archive = cache + .apply_diff_to_table::( + "profile_save_archive", + &self.profile_save_archive, + ) + .with_updates_by_pk(|row| &row.archive_id); + diff.profile_task_config = cache + .apply_diff_to_table::( + "profile_task_config", + &self.profile_task_config, + ) + .with_updates_by_pk(|row| &row.task_id); + diff.profile_task_progress = cache + .apply_diff_to_table::( + "profile_task_progress", + &self.profile_task_progress, + ) + .with_updates_by_pk(|row| &row.progress_id); + diff.profile_task_reward_claim = cache + .apply_diff_to_table::( + "profile_task_reward_claim", + &self.profile_task_reward_claim, + ) + .with_updates_by_pk(|row| &row.claim_id); + diff.profile_wallet_ledger = cache + .apply_diff_to_table::( + "profile_wallet_ledger", + &self.profile_wallet_ledger, + ) + .with_updates_by_pk(|row| &row.wallet_ledger_id); + diff.public_work_like = cache + .apply_diff_to_table::("public_work_like", &self.public_work_like) + .with_updates_by_pk(|row| &row.like_id); + diff.public_work_play_daily_stat = cache + .apply_diff_to_table::( + "public_work_play_daily_stat", + &self.public_work_play_daily_stat, + ) + .with_updates_by_pk(|row| &row.stat_id); + diff.puzzle_agent_message = cache + .apply_diff_to_table::( + "puzzle_agent_message", + &self.puzzle_agent_message, + ) + .with_updates_by_pk(|row| &row.message_id); + diff.puzzle_agent_session = cache + .apply_diff_to_table::( + "puzzle_agent_session", + &self.puzzle_agent_session, + ) + .with_updates_by_pk(|row| &row.session_id); diff.puzzle_event = self.puzzle_event.into_event_diff(); + diff.puzzle_leaderboard_entry = cache + .apply_diff_to_table::( + "puzzle_leaderboard_entry", + &self.puzzle_leaderboard_entry, + ) + .with_updates_by_pk(|row| &row.entry_id); + diff.puzzle_runtime_run = cache + .apply_diff_to_table::( + "puzzle_runtime_run", + &self.puzzle_runtime_run, + ) + .with_updates_by_pk(|row| &row.run_id); + diff.puzzle_work_profile = cache + .apply_diff_to_table::( + "puzzle_work_profile", + &self.puzzle_work_profile, + ) + .with_updates_by_pk(|row| &row.profile_id); + diff.quest_log = cache + .apply_diff_to_table::("quest_log", &self.quest_log) + .with_updates_by_pk(|row| &row.log_id); + diff.quest_record = cache + .apply_diff_to_table::("quest_record", &self.quest_record) + .with_updates_by_pk(|row| &row.quest_id); + diff.refresh_session = cache + .apply_diff_to_table::("refresh_session", &self.refresh_session) + .with_updates_by_pk(|row| &row.session_id); + diff.runtime_setting = cache + .apply_diff_to_table::("runtime_setting", &self.runtime_setting) + .with_updates_by_pk(|row| &row.user_id); + diff.runtime_snapshot = cache + .apply_diff_to_table::("runtime_snapshot", &self.runtime_snapshot) + .with_updates_by_pk(|row| &row.user_id); + diff.story_event = cache + .apply_diff_to_table::("story_event", &self.story_event) + .with_updates_by_pk(|row| &row.event_id); + diff.story_session = cache + .apply_diff_to_table::("story_session", &self.story_session) + .with_updates_by_pk(|row| &row.story_session_id); + diff.tracking_daily_stat = cache + .apply_diff_to_table::( + "tracking_daily_stat", + &self.tracking_daily_stat, + ) + .with_updates_by_pk(|row| &row.stat_id); + diff.tracking_event = cache + .apply_diff_to_table::("tracking_event", &self.tracking_event) + .with_updates_by_pk(|row| &row.event_id); + diff.treasure_record = cache + .apply_diff_to_table::("treasure_record", &self.treasure_record) + .with_updates_by_pk(|row| &row.treasure_record_id); + diff.user_account = cache + .apply_diff_to_table::("user_account", &self.user_account) + .with_updates_by_pk(|row| &row.user_id); + diff.user_browse_history = cache + .apply_diff_to_table::( + "user_browse_history", + &self.user_browse_history, + ) + .with_updates_by_pk(|row| &row.browse_history_id); diff } @@ -1563,21 +2282,207 @@ impl __sdk::DbUpdate for DbUpdate { let mut db_update = DbUpdate::default(); for table_rows in raw.tables { match &table_rows.table[..] { + "ai_result_reference" => db_update + .ai_result_reference + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "ai_task" => db_update + .ai_task + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), "ai_task_event" => db_update .ai_task_event .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "ai_task_stage" => db_update + .ai_task_stage + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "ai_text_chunk" => db_update + .ai_text_chunk + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "analytics_date_dimension" => db_update + .analytics_date_dimension + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "asset_entity_binding" => db_update + .asset_entity_binding + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), "asset_event" => db_update .asset_event .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "asset_object" => db_update + .asset_object + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "auth_identity" => db_update + .auth_identity + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "auth_store_snapshot" => db_update + .auth_store_snapshot + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "battle_state" => db_update + .battle_state + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "big_fish_agent_message" => db_update + .big_fish_agent_message + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "big_fish_asset_slot" => db_update + .big_fish_asset_slot + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "big_fish_creation_session" => db_update + .big_fish_creation_session + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), "big_fish_event" => db_update .big_fish_event .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "big_fish_runtime_run" => db_update + .big_fish_runtime_run + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "chapter_progression" => db_update + .chapter_progression + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "custom_world_agent_message" => db_update + .custom_world_agent_message + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "custom_world_agent_operation" => db_update + .custom_world_agent_operation + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "custom_world_agent_session" => db_update + .custom_world_agent_session + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "custom_world_draft_card" => db_update + .custom_world_draft_card + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), "custom_world_gallery_entry" => db_update .custom_world_gallery_entry .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "custom_world_profile" => db_update + .custom_world_profile + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "custom_world_session" => db_update + .custom_world_session + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "database_migration_import_chunk" => db_update + .database_migration_import_chunk + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "database_migration_operator" => db_update + .database_migration_operator + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "inventory_slot" => db_update + .inventory_slot + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "match_3_d_agent_message" => db_update + .match_3_d_agent_message + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "match_3_d_agent_session" => db_update + .match_3_d_agent_session + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "match_3_d_runtime_run" => db_update + .match_3_d_runtime_run + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "match_3_d_work_profile" => db_update + .match_3_d_work_profile + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "npc_state" => db_update + .npc_state + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "player_progression" => db_update + .player_progression + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "profile_dashboard_state" => db_update + .profile_dashboard_state + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "profile_invite_code" => db_update + .profile_invite_code + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "profile_membership" => db_update + .profile_membership + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "profile_played_world" => db_update + .profile_played_world + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "profile_recharge_order" => db_update + .profile_recharge_order + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "profile_redeem_code" => db_update + .profile_redeem_code + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "profile_redeem_code_usage" => db_update + .profile_redeem_code_usage + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "profile_referral_relation" => db_update + .profile_referral_relation + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "profile_save_archive" => db_update + .profile_save_archive + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "profile_task_config" => db_update + .profile_task_config + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "profile_task_progress" => db_update + .profile_task_progress + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "profile_task_reward_claim" => db_update + .profile_task_reward_claim + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "profile_wallet_ledger" => db_update + .profile_wallet_ledger + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "public_work_like" => db_update + .public_work_like + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "public_work_play_daily_stat" => db_update + .public_work_play_daily_stat + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "puzzle_agent_message" => db_update + .puzzle_agent_message + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "puzzle_agent_session" => db_update + .puzzle_agent_session + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), "puzzle_event" => db_update .puzzle_event .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "puzzle_leaderboard_entry" => db_update + .puzzle_leaderboard_entry + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "puzzle_runtime_run" => db_update + .puzzle_runtime_run + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "puzzle_work_profile" => db_update + .puzzle_work_profile + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "quest_log" => db_update + .quest_log + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "quest_record" => db_update + .quest_record + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "refresh_session" => db_update + .refresh_session + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "runtime_setting" => db_update + .runtime_setting + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "runtime_snapshot" => db_update + .runtime_snapshot + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "story_event" => db_update + .story_event + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "story_session" => db_update + .story_session + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "tracking_daily_stat" => db_update + .tracking_daily_stat + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "tracking_event" => db_update + .tracking_event + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "treasure_record" => db_update + .treasure_record + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "user_account" => db_update + .user_account + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), + "user_browse_history" => db_update + .user_browse_history + .append(__sdk::parse_row_list_as_inserts(table_rows.rows)?), unknown => { return Err( __sdk::InternalError::unknown_name("table", unknown, "QueryRows").into(), @@ -1591,21 +2496,207 @@ impl __sdk::DbUpdate for DbUpdate { let mut db_update = DbUpdate::default(); for table_rows in raw.tables { match &table_rows.table[..] { + "ai_result_reference" => db_update + .ai_result_reference + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "ai_task" => db_update + .ai_task + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), "ai_task_event" => db_update .ai_task_event .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "ai_task_stage" => db_update + .ai_task_stage + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "ai_text_chunk" => db_update + .ai_text_chunk + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "analytics_date_dimension" => db_update + .analytics_date_dimension + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "asset_entity_binding" => db_update + .asset_entity_binding + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), "asset_event" => db_update .asset_event .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "asset_object" => db_update + .asset_object + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "auth_identity" => db_update + .auth_identity + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "auth_store_snapshot" => db_update + .auth_store_snapshot + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "battle_state" => db_update + .battle_state + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "big_fish_agent_message" => db_update + .big_fish_agent_message + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "big_fish_asset_slot" => db_update + .big_fish_asset_slot + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "big_fish_creation_session" => db_update + .big_fish_creation_session + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), "big_fish_event" => db_update .big_fish_event .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "big_fish_runtime_run" => db_update + .big_fish_runtime_run + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "chapter_progression" => db_update + .chapter_progression + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "custom_world_agent_message" => db_update + .custom_world_agent_message + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "custom_world_agent_operation" => db_update + .custom_world_agent_operation + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "custom_world_agent_session" => db_update + .custom_world_agent_session + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "custom_world_draft_card" => db_update + .custom_world_draft_card + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), "custom_world_gallery_entry" => db_update .custom_world_gallery_entry .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "custom_world_profile" => db_update + .custom_world_profile + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "custom_world_session" => db_update + .custom_world_session + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "database_migration_import_chunk" => db_update + .database_migration_import_chunk + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "database_migration_operator" => db_update + .database_migration_operator + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "inventory_slot" => db_update + .inventory_slot + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "match_3_d_agent_message" => db_update + .match_3_d_agent_message + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "match_3_d_agent_session" => db_update + .match_3_d_agent_session + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "match_3_d_runtime_run" => db_update + .match_3_d_runtime_run + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "match_3_d_work_profile" => db_update + .match_3_d_work_profile + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "npc_state" => db_update + .npc_state + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "player_progression" => db_update + .player_progression + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "profile_dashboard_state" => db_update + .profile_dashboard_state + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "profile_invite_code" => db_update + .profile_invite_code + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "profile_membership" => db_update + .profile_membership + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "profile_played_world" => db_update + .profile_played_world + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "profile_recharge_order" => db_update + .profile_recharge_order + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "profile_redeem_code" => db_update + .profile_redeem_code + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "profile_redeem_code_usage" => db_update + .profile_redeem_code_usage + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "profile_referral_relation" => db_update + .profile_referral_relation + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "profile_save_archive" => db_update + .profile_save_archive + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "profile_task_config" => db_update + .profile_task_config + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "profile_task_progress" => db_update + .profile_task_progress + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "profile_task_reward_claim" => db_update + .profile_task_reward_claim + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "profile_wallet_ledger" => db_update + .profile_wallet_ledger + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "public_work_like" => db_update + .public_work_like + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "public_work_play_daily_stat" => db_update + .public_work_play_daily_stat + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "puzzle_agent_message" => db_update + .puzzle_agent_message + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "puzzle_agent_session" => db_update + .puzzle_agent_session + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), "puzzle_event" => db_update .puzzle_event .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "puzzle_leaderboard_entry" => db_update + .puzzle_leaderboard_entry + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "puzzle_runtime_run" => db_update + .puzzle_runtime_run + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "puzzle_work_profile" => db_update + .puzzle_work_profile + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "quest_log" => db_update + .quest_log + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "quest_record" => db_update + .quest_record + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "refresh_session" => db_update + .refresh_session + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "runtime_setting" => db_update + .runtime_setting + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "runtime_snapshot" => db_update + .runtime_snapshot + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "story_event" => db_update + .story_event + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "story_session" => db_update + .story_session + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "tracking_daily_stat" => db_update + .tracking_daily_stat + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "tracking_event" => db_update + .tracking_event + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "treasure_record" => db_update + .treasure_record + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "user_account" => db_update + .user_account + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), + "user_browse_history" => db_update + .user_browse_history + .append(__sdk::parse_row_list_as_deletes(table_rows.rows)?), unknown => { return Err( __sdk::InternalError::unknown_name("table", unknown, "QueryRows").into(), @@ -1621,11 +2712,73 @@ impl __sdk::DbUpdate for DbUpdate { #[allow(non_snake_case)] #[doc(hidden)] pub struct AppliedDiff<'r> { + ai_result_reference: __sdk::TableAppliedDiff<'r, AiResultReference>, + ai_task: __sdk::TableAppliedDiff<'r, AiTask>, ai_task_event: __sdk::TableAppliedDiff<'r, AiTaskEvent>, + ai_task_stage: __sdk::TableAppliedDiff<'r, AiTaskStage>, + ai_text_chunk: __sdk::TableAppliedDiff<'r, AiTextChunk>, + analytics_date_dimension: __sdk::TableAppliedDiff<'r, AnalyticsDateDimension>, + asset_entity_binding: __sdk::TableAppliedDiff<'r, AssetEntityBinding>, asset_event: __sdk::TableAppliedDiff<'r, AssetEvent>, + asset_object: __sdk::TableAppliedDiff<'r, AssetObject>, + auth_identity: __sdk::TableAppliedDiff<'r, AuthIdentity>, + auth_store_snapshot: __sdk::TableAppliedDiff<'r, AuthStoreSnapshot>, + battle_state: __sdk::TableAppliedDiff<'r, BattleState>, + big_fish_agent_message: __sdk::TableAppliedDiff<'r, BigFishAgentMessage>, + big_fish_asset_slot: __sdk::TableAppliedDiff<'r, BigFishAssetSlot>, + big_fish_creation_session: __sdk::TableAppliedDiff<'r, BigFishCreationSession>, big_fish_event: __sdk::TableAppliedDiff<'r, BigFishEvent>, + big_fish_runtime_run: __sdk::TableAppliedDiff<'r, BigFishRuntimeRun>, + chapter_progression: __sdk::TableAppliedDiff<'r, ChapterProgression>, + custom_world_agent_message: __sdk::TableAppliedDiff<'r, CustomWorldAgentMessage>, + custom_world_agent_operation: __sdk::TableAppliedDiff<'r, CustomWorldAgentOperation>, + custom_world_agent_session: __sdk::TableAppliedDiff<'r, CustomWorldAgentSession>, + custom_world_draft_card: __sdk::TableAppliedDiff<'r, CustomWorldDraftCard>, custom_world_gallery_entry: __sdk::TableAppliedDiff<'r, CustomWorldGalleryEntry>, + custom_world_profile: __sdk::TableAppliedDiff<'r, CustomWorldProfile>, + custom_world_session: __sdk::TableAppliedDiff<'r, CustomWorldSession>, + database_migration_import_chunk: __sdk::TableAppliedDiff<'r, DatabaseMigrationImportChunk>, + database_migration_operator: __sdk::TableAppliedDiff<'r, DatabaseMigrationOperator>, + inventory_slot: __sdk::TableAppliedDiff<'r, InventorySlot>, + match_3_d_agent_message: __sdk::TableAppliedDiff<'r, Match3DAgentMessageRow>, + match_3_d_agent_session: __sdk::TableAppliedDiff<'r, Match3DAgentSessionRow>, + match_3_d_runtime_run: __sdk::TableAppliedDiff<'r, Match3DRuntimeRunRow>, + match_3_d_work_profile: __sdk::TableAppliedDiff<'r, Match3DWorkProfileRow>, + npc_state: __sdk::TableAppliedDiff<'r, NpcState>, + player_progression: __sdk::TableAppliedDiff<'r, PlayerProgression>, + profile_dashboard_state: __sdk::TableAppliedDiff<'r, ProfileDashboardState>, + profile_invite_code: __sdk::TableAppliedDiff<'r, ProfileInviteCode>, + profile_membership: __sdk::TableAppliedDiff<'r, ProfileMembership>, + profile_played_world: __sdk::TableAppliedDiff<'r, ProfilePlayedWorld>, + profile_recharge_order: __sdk::TableAppliedDiff<'r, ProfileRechargeOrder>, + profile_redeem_code: __sdk::TableAppliedDiff<'r, ProfileRedeemCode>, + profile_redeem_code_usage: __sdk::TableAppliedDiff<'r, ProfileRedeemCodeUsage>, + profile_referral_relation: __sdk::TableAppliedDiff<'r, ProfileReferralRelation>, + profile_save_archive: __sdk::TableAppliedDiff<'r, ProfileSaveArchive>, + profile_task_config: __sdk::TableAppliedDiff<'r, ProfileTaskConfig>, + profile_task_progress: __sdk::TableAppliedDiff<'r, ProfileTaskProgress>, + profile_task_reward_claim: __sdk::TableAppliedDiff<'r, ProfileTaskRewardClaim>, + profile_wallet_ledger: __sdk::TableAppliedDiff<'r, ProfileWalletLedger>, + public_work_like: __sdk::TableAppliedDiff<'r, PublicWorkLike>, + public_work_play_daily_stat: __sdk::TableAppliedDiff<'r, PublicWorkPlayDailyStat>, + puzzle_agent_message: __sdk::TableAppliedDiff<'r, PuzzleAgentMessageRow>, + puzzle_agent_session: __sdk::TableAppliedDiff<'r, PuzzleAgentSessionRow>, puzzle_event: __sdk::TableAppliedDiff<'r, PuzzleEvent>, + puzzle_leaderboard_entry: __sdk::TableAppliedDiff<'r, PuzzleLeaderboardEntryRow>, + puzzle_runtime_run: __sdk::TableAppliedDiff<'r, PuzzleRuntimeRunRow>, + puzzle_work_profile: __sdk::TableAppliedDiff<'r, PuzzleWorkProfileRow>, + quest_log: __sdk::TableAppliedDiff<'r, QuestLog>, + quest_record: __sdk::TableAppliedDiff<'r, QuestRecord>, + refresh_session: __sdk::TableAppliedDiff<'r, RefreshSession>, + runtime_setting: __sdk::TableAppliedDiff<'r, RuntimeSetting>, + runtime_snapshot: __sdk::TableAppliedDiff<'r, RuntimeSnapshotRow>, + story_event: __sdk::TableAppliedDiff<'r, StoryEvent>, + story_session: __sdk::TableAppliedDiff<'r, StorySession>, + tracking_daily_stat: __sdk::TableAppliedDiff<'r, TrackingDailyStat>, + tracking_event: __sdk::TableAppliedDiff<'r, TrackingEvent>, + treasure_record: __sdk::TableAppliedDiff<'r, TreasureRecord>, + user_account: __sdk::TableAppliedDiff<'r, UserAccount>, + user_browse_history: __sdk::TableAppliedDiff<'r, UserBrowseHistory>, __unused: std::marker::PhantomData<&'r ()>, } @@ -1639,27 +2792,321 @@ impl<'r> __sdk::AppliedDiff<'r> for AppliedDiff<'r> { event: &EventContext, callbacks: &mut __sdk::DbCallbacks, ) { + callbacks.invoke_table_row_callbacks::( + "ai_result_reference", + &self.ai_result_reference, + event, + ); + callbacks.invoke_table_row_callbacks::("ai_task", &self.ai_task, event); callbacks.invoke_table_row_callbacks::( "ai_task_event", &self.ai_task_event, event, ); + callbacks.invoke_table_row_callbacks::( + "ai_task_stage", + &self.ai_task_stage, + event, + ); + callbacks.invoke_table_row_callbacks::( + "ai_text_chunk", + &self.ai_text_chunk, + event, + ); + callbacks.invoke_table_row_callbacks::( + "analytics_date_dimension", + &self.analytics_date_dimension, + event, + ); + callbacks.invoke_table_row_callbacks::( + "asset_entity_binding", + &self.asset_entity_binding, + event, + ); callbacks.invoke_table_row_callbacks::("asset_event", &self.asset_event, event); + callbacks.invoke_table_row_callbacks::( + "asset_object", + &self.asset_object, + event, + ); + callbacks.invoke_table_row_callbacks::( + "auth_identity", + &self.auth_identity, + event, + ); + callbacks.invoke_table_row_callbacks::( + "auth_store_snapshot", + &self.auth_store_snapshot, + event, + ); + callbacks.invoke_table_row_callbacks::( + "battle_state", + &self.battle_state, + event, + ); + callbacks.invoke_table_row_callbacks::( + "big_fish_agent_message", + &self.big_fish_agent_message, + event, + ); + callbacks.invoke_table_row_callbacks::( + "big_fish_asset_slot", + &self.big_fish_asset_slot, + event, + ); + callbacks.invoke_table_row_callbacks::( + "big_fish_creation_session", + &self.big_fish_creation_session, + event, + ); callbacks.invoke_table_row_callbacks::( "big_fish_event", &self.big_fish_event, event, ); + callbacks.invoke_table_row_callbacks::( + "big_fish_runtime_run", + &self.big_fish_runtime_run, + event, + ); + callbacks.invoke_table_row_callbacks::( + "chapter_progression", + &self.chapter_progression, + event, + ); + callbacks.invoke_table_row_callbacks::( + "custom_world_agent_message", + &self.custom_world_agent_message, + event, + ); + callbacks.invoke_table_row_callbacks::( + "custom_world_agent_operation", + &self.custom_world_agent_operation, + event, + ); + callbacks.invoke_table_row_callbacks::( + "custom_world_agent_session", + &self.custom_world_agent_session, + event, + ); + callbacks.invoke_table_row_callbacks::( + "custom_world_draft_card", + &self.custom_world_draft_card, + event, + ); callbacks.invoke_table_row_callbacks::( "custom_world_gallery_entry", &self.custom_world_gallery_entry, event, ); + callbacks.invoke_table_row_callbacks::( + "custom_world_profile", + &self.custom_world_profile, + event, + ); + callbacks.invoke_table_row_callbacks::( + "custom_world_session", + &self.custom_world_session, + event, + ); + callbacks.invoke_table_row_callbacks::( + "database_migration_import_chunk", + &self.database_migration_import_chunk, + event, + ); + callbacks.invoke_table_row_callbacks::( + "database_migration_operator", + &self.database_migration_operator, + event, + ); + callbacks.invoke_table_row_callbacks::( + "inventory_slot", + &self.inventory_slot, + event, + ); + callbacks.invoke_table_row_callbacks::( + "match_3_d_agent_message", + &self.match_3_d_agent_message, + event, + ); + callbacks.invoke_table_row_callbacks::( + "match_3_d_agent_session", + &self.match_3_d_agent_session, + event, + ); + callbacks.invoke_table_row_callbacks::( + "match_3_d_runtime_run", + &self.match_3_d_runtime_run, + event, + ); + callbacks.invoke_table_row_callbacks::( + "match_3_d_work_profile", + &self.match_3_d_work_profile, + event, + ); + callbacks.invoke_table_row_callbacks::("npc_state", &self.npc_state, event); + callbacks.invoke_table_row_callbacks::( + "player_progression", + &self.player_progression, + event, + ); + callbacks.invoke_table_row_callbacks::( + "profile_dashboard_state", + &self.profile_dashboard_state, + event, + ); + callbacks.invoke_table_row_callbacks::( + "profile_invite_code", + &self.profile_invite_code, + event, + ); + callbacks.invoke_table_row_callbacks::( + "profile_membership", + &self.profile_membership, + event, + ); + callbacks.invoke_table_row_callbacks::( + "profile_played_world", + &self.profile_played_world, + event, + ); + callbacks.invoke_table_row_callbacks::( + "profile_recharge_order", + &self.profile_recharge_order, + event, + ); + callbacks.invoke_table_row_callbacks::( + "profile_redeem_code", + &self.profile_redeem_code, + event, + ); + callbacks.invoke_table_row_callbacks::( + "profile_redeem_code_usage", + &self.profile_redeem_code_usage, + event, + ); + callbacks.invoke_table_row_callbacks::( + "profile_referral_relation", + &self.profile_referral_relation, + event, + ); + callbacks.invoke_table_row_callbacks::( + "profile_save_archive", + &self.profile_save_archive, + event, + ); + callbacks.invoke_table_row_callbacks::( + "profile_task_config", + &self.profile_task_config, + event, + ); + callbacks.invoke_table_row_callbacks::( + "profile_task_progress", + &self.profile_task_progress, + event, + ); + callbacks.invoke_table_row_callbacks::( + "profile_task_reward_claim", + &self.profile_task_reward_claim, + event, + ); + callbacks.invoke_table_row_callbacks::( + "profile_wallet_ledger", + &self.profile_wallet_ledger, + event, + ); + callbacks.invoke_table_row_callbacks::( + "public_work_like", + &self.public_work_like, + event, + ); + callbacks.invoke_table_row_callbacks::( + "public_work_play_daily_stat", + &self.public_work_play_daily_stat, + event, + ); + callbacks.invoke_table_row_callbacks::( + "puzzle_agent_message", + &self.puzzle_agent_message, + event, + ); + callbacks.invoke_table_row_callbacks::( + "puzzle_agent_session", + &self.puzzle_agent_session, + event, + ); callbacks.invoke_table_row_callbacks::( "puzzle_event", &self.puzzle_event, event, ); + callbacks.invoke_table_row_callbacks::( + "puzzle_leaderboard_entry", + &self.puzzle_leaderboard_entry, + event, + ); + callbacks.invoke_table_row_callbacks::( + "puzzle_runtime_run", + &self.puzzle_runtime_run, + event, + ); + callbacks.invoke_table_row_callbacks::( + "puzzle_work_profile", + &self.puzzle_work_profile, + event, + ); + callbacks.invoke_table_row_callbacks::("quest_log", &self.quest_log, event); + callbacks.invoke_table_row_callbacks::( + "quest_record", + &self.quest_record, + event, + ); + callbacks.invoke_table_row_callbacks::( + "refresh_session", + &self.refresh_session, + event, + ); + callbacks.invoke_table_row_callbacks::( + "runtime_setting", + &self.runtime_setting, + event, + ); + callbacks.invoke_table_row_callbacks::( + "runtime_snapshot", + &self.runtime_snapshot, + event, + ); + callbacks.invoke_table_row_callbacks::("story_event", &self.story_event, event); + callbacks.invoke_table_row_callbacks::( + "story_session", + &self.story_session, + event, + ); + callbacks.invoke_table_row_callbacks::( + "tracking_daily_stat", + &self.tracking_daily_stat, + event, + ); + callbacks.invoke_table_row_callbacks::( + "tracking_event", + &self.tracking_event, + event, + ); + callbacks.invoke_table_row_callbacks::( + "treasure_record", + &self.treasure_record, + event, + ); + callbacks.invoke_table_row_callbacks::( + "user_account", + &self.user_account, + event, + ); + callbacks.invoke_table_row_callbacks::( + "user_browse_history", + &self.user_browse_history, + event, + ); } } @@ -1915,19 +3362,19 @@ impl __sdk::SubscriptionHandle for SubscriptionHandle { /// either a [`DbConnection`] or an [`EventContext`] and operate on either. pub trait RemoteDbContext: __sdk::DbContext< - DbView = RemoteTables, - Reducers = RemoteReducers, - SubscriptionBuilder = __sdk::SubscriptionBuilder, - > + DbView = RemoteTables, + Reducers = RemoteReducers, + SubscriptionBuilder = __sdk::SubscriptionBuilder, +> { } impl< - Ctx: __sdk::DbContext< + Ctx: __sdk::DbContext< DbView = RemoteTables, Reducers = RemoteReducers, SubscriptionBuilder = __sdk::SubscriptionBuilder, >, -> RemoteDbContext for Ctx + > RemoteDbContext for Ctx { } @@ -2320,17 +3767,141 @@ impl __sdk::SpacetimeModule for RemoteModule { type QueryBuilder = __sdk::QueryBuilder; fn register_tables(client_cache: &mut __sdk::ClientCache) { + ai_result_reference_table::register_table(client_cache); + ai_task_table::register_table(client_cache); ai_task_event_table::register_table(client_cache); + ai_task_stage_table::register_table(client_cache); + ai_text_chunk_table::register_table(client_cache); + analytics_date_dimension_table::register_table(client_cache); + asset_entity_binding_table::register_table(client_cache); asset_event_table::register_table(client_cache); + asset_object_table::register_table(client_cache); + auth_identity_table::register_table(client_cache); + auth_store_snapshot_table::register_table(client_cache); + battle_state_table::register_table(client_cache); + big_fish_agent_message_table::register_table(client_cache); + big_fish_asset_slot_table::register_table(client_cache); + big_fish_creation_session_table::register_table(client_cache); big_fish_event_table::register_table(client_cache); + big_fish_runtime_run_table::register_table(client_cache); + chapter_progression_table::register_table(client_cache); + custom_world_agent_message_table::register_table(client_cache); + custom_world_agent_operation_table::register_table(client_cache); + custom_world_agent_session_table::register_table(client_cache); + custom_world_draft_card_table::register_table(client_cache); custom_world_gallery_entry_table::register_table(client_cache); + custom_world_profile_table::register_table(client_cache); + custom_world_session_table::register_table(client_cache); + database_migration_import_chunk_table::register_table(client_cache); + database_migration_operator_table::register_table(client_cache); + inventory_slot_table::register_table(client_cache); + match_3_d_agent_message_table::register_table(client_cache); + match_3_d_agent_session_table::register_table(client_cache); + match_3_d_runtime_run_table::register_table(client_cache); + match_3_d_work_profile_table::register_table(client_cache); + npc_state_table::register_table(client_cache); + player_progression_table::register_table(client_cache); + profile_dashboard_state_table::register_table(client_cache); + profile_invite_code_table::register_table(client_cache); + profile_membership_table::register_table(client_cache); + profile_played_world_table::register_table(client_cache); + profile_recharge_order_table::register_table(client_cache); + profile_redeem_code_table::register_table(client_cache); + profile_redeem_code_usage_table::register_table(client_cache); + profile_referral_relation_table::register_table(client_cache); + profile_save_archive_table::register_table(client_cache); + profile_task_config_table::register_table(client_cache); + profile_task_progress_table::register_table(client_cache); + profile_task_reward_claim_table::register_table(client_cache); + profile_wallet_ledger_table::register_table(client_cache); + public_work_like_table::register_table(client_cache); + public_work_play_daily_stat_table::register_table(client_cache); + puzzle_agent_message_table::register_table(client_cache); + puzzle_agent_session_table::register_table(client_cache); puzzle_event_table::register_table(client_cache); + puzzle_leaderboard_entry_table::register_table(client_cache); + puzzle_runtime_run_table::register_table(client_cache); + puzzle_work_profile_table::register_table(client_cache); + quest_log_table::register_table(client_cache); + quest_record_table::register_table(client_cache); + refresh_session_table::register_table(client_cache); + runtime_setting_table::register_table(client_cache); + runtime_snapshot_table::register_table(client_cache); + story_event_table::register_table(client_cache); + story_session_table::register_table(client_cache); + tracking_daily_stat_table::register_table(client_cache); + tracking_event_table::register_table(client_cache); + treasure_record_table::register_table(client_cache); + user_account_table::register_table(client_cache); + user_browse_history_table::register_table(client_cache); } const ALL_TABLE_NAMES: &'static [&'static str] = &[ + "ai_result_reference", + "ai_task", "ai_task_event", + "ai_task_stage", + "ai_text_chunk", + "analytics_date_dimension", + "asset_entity_binding", "asset_event", + "asset_object", + "auth_identity", + "auth_store_snapshot", + "battle_state", + "big_fish_agent_message", + "big_fish_asset_slot", + "big_fish_creation_session", "big_fish_event", + "big_fish_runtime_run", + "chapter_progression", + "custom_world_agent_message", + "custom_world_agent_operation", + "custom_world_agent_session", + "custom_world_draft_card", "custom_world_gallery_entry", + "custom_world_profile", + "custom_world_session", + "database_migration_import_chunk", + "database_migration_operator", + "inventory_slot", + "match_3_d_agent_message", + "match_3_d_agent_session", + "match_3_d_runtime_run", + "match_3_d_work_profile", + "npc_state", + "player_progression", + "profile_dashboard_state", + "profile_invite_code", + "profile_membership", + "profile_played_world", + "profile_recharge_order", + "profile_redeem_code", + "profile_redeem_code_usage", + "profile_referral_relation", + "profile_save_archive", + "profile_task_config", + "profile_task_progress", + "profile_task_reward_claim", + "profile_wallet_ledger", + "public_work_like", + "public_work_play_daily_stat", + "puzzle_agent_message", + "puzzle_agent_session", "puzzle_event", + "puzzle_leaderboard_entry", + "puzzle_runtime_run", + "puzzle_work_profile", + "quest_log", + "quest_record", + "refresh_session", + "runtime_setting", + "runtime_snapshot", + "story_event", + "story_session", + "tracking_daily_stat", + "tracking_event", + "treasure_record", + "user_account", + "user_browse_history", ]; } diff --git a/server-rs/crates/spacetime-client/src/module_bindings/npc_state_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/npc_state_table.rs new file mode 100644 index 00000000..26e7fcf5 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/npc_state_table.rs @@ -0,0 +1,161 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::npc_relation_state_type::NpcRelationState; +use super::npc_stance_profile_type::NpcStanceProfile; +use super::npc_state_type::NpcState; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `npc_state`. +/// +/// Obtain a handle from the [`NpcStateTableAccess::npc_state`] method on [`super::RemoteTables`], +/// like `ctx.db.npc_state()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.npc_state().on_insert(...)`. +pub struct NpcStateTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `npc_state`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait NpcStateTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`NpcStateTableHandle`], which mediates access to the table `npc_state`. + fn npc_state(&self) -> NpcStateTableHandle<'_>; +} + +impl NpcStateTableAccess for super::RemoteTables { + fn npc_state(&self) -> NpcStateTableHandle<'_> { + NpcStateTableHandle { + imp: self.imp.get_table::("npc_state"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct NpcStateInsertCallbackId(__sdk::CallbackId); +pub struct NpcStateDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for NpcStateTableHandle<'ctx> { + type Row = NpcState; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = NpcStateInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> NpcStateInsertCallbackId { + NpcStateInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: NpcStateInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = NpcStateDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> NpcStateDeleteCallbackId { + NpcStateDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: NpcStateDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct NpcStateUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for NpcStateTableHandle<'ctx> { + type UpdateCallbackId = NpcStateUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> NpcStateUpdateCallbackId { + NpcStateUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: NpcStateUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `npc_state_id` unique index on the table `npc_state`, +/// which allows point queries on the field of the same name +/// via the [`NpcStateNpcStateIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.npc_state().npc_state_id().find(...)`. +pub struct NpcStateNpcStateIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> NpcStateTableHandle<'ctx> { + /// Get a handle on the `npc_state_id` unique index on the table `npc_state`. + pub fn npc_state_id(&self) -> NpcStateNpcStateIdUnique<'ctx> { + NpcStateNpcStateIdUnique { + imp: self.imp.get_unique_constraint::("npc_state_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> NpcStateNpcStateIdUnique<'ctx> { + /// Find the subscribed row whose `npc_state_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("npc_state"); + _table.add_unique_constraint::("npc_state_id", |row| &row.npc_state_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `NpcState`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait npc_stateQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `NpcState`. + fn npc_state(&self) -> __sdk::__query_builder::Table; +} + +impl npc_stateQueryTableAccess for __sdk::QueryTableAccessor { + fn npc_state(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("npc_state") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/player_progression_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/player_progression_table.rs new file mode 100644 index 00000000..66961930 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/player_progression_table.rs @@ -0,0 +1,162 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::player_progression_grant_source_type::PlayerProgressionGrantSource; +use super::player_progression_type::PlayerProgression; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `player_progression`. +/// +/// Obtain a handle from the [`PlayerProgressionTableAccess::player_progression`] method on [`super::RemoteTables`], +/// like `ctx.db.player_progression()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.player_progression().on_insert(...)`. +pub struct PlayerProgressionTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `player_progression`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait PlayerProgressionTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`PlayerProgressionTableHandle`], which mediates access to the table `player_progression`. + fn player_progression(&self) -> PlayerProgressionTableHandle<'_>; +} + +impl PlayerProgressionTableAccess for super::RemoteTables { + fn player_progression(&self) -> PlayerProgressionTableHandle<'_> { + PlayerProgressionTableHandle { + imp: self + .imp + .get_table::("player_progression"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct PlayerProgressionInsertCallbackId(__sdk::CallbackId); +pub struct PlayerProgressionDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for PlayerProgressionTableHandle<'ctx> { + type Row = PlayerProgression; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = PlayerProgressionInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> PlayerProgressionInsertCallbackId { + PlayerProgressionInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: PlayerProgressionInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = PlayerProgressionDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> PlayerProgressionDeleteCallbackId { + PlayerProgressionDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: PlayerProgressionDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct PlayerProgressionUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for PlayerProgressionTableHandle<'ctx> { + type UpdateCallbackId = PlayerProgressionUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> PlayerProgressionUpdateCallbackId { + PlayerProgressionUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: PlayerProgressionUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `user_id` unique index on the table `player_progression`, +/// which allows point queries on the field of the same name +/// via the [`PlayerProgressionUserIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.player_progression().user_id().find(...)`. +pub struct PlayerProgressionUserIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> PlayerProgressionTableHandle<'ctx> { + /// Get a handle on the `user_id` unique index on the table `player_progression`. + pub fn user_id(&self) -> PlayerProgressionUserIdUnique<'ctx> { + PlayerProgressionUserIdUnique { + imp: self.imp.get_unique_constraint::("user_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> PlayerProgressionUserIdUnique<'ctx> { + /// Find the subscribed row whose `user_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("player_progression"); + _table.add_unique_constraint::("user_id", |row| &row.user_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `PlayerProgression`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait player_progressionQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `PlayerProgression`. + fn player_progression(&self) -> __sdk::__query_builder::Table; +} + +impl player_progressionQueryTableAccess for __sdk::QueryTableAccessor { + fn player_progression(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("player_progression") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_dashboard_state_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_dashboard_state_table.rs new file mode 100644 index 00000000..c79f8b0c --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_dashboard_state_table.rs @@ -0,0 +1,161 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::profile_dashboard_state_type::ProfileDashboardState; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `profile_dashboard_state`. +/// +/// Obtain a handle from the [`ProfileDashboardStateTableAccess::profile_dashboard_state`] method on [`super::RemoteTables`], +/// like `ctx.db.profile_dashboard_state()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.profile_dashboard_state().on_insert(...)`. +pub struct ProfileDashboardStateTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `profile_dashboard_state`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait ProfileDashboardStateTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`ProfileDashboardStateTableHandle`], which mediates access to the table `profile_dashboard_state`. + fn profile_dashboard_state(&self) -> ProfileDashboardStateTableHandle<'_>; +} + +impl ProfileDashboardStateTableAccess for super::RemoteTables { + fn profile_dashboard_state(&self) -> ProfileDashboardStateTableHandle<'_> { + ProfileDashboardStateTableHandle { + imp: self + .imp + .get_table::("profile_dashboard_state"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct ProfileDashboardStateInsertCallbackId(__sdk::CallbackId); +pub struct ProfileDashboardStateDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for ProfileDashboardStateTableHandle<'ctx> { + type Row = ProfileDashboardState; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = ProfileDashboardStateInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileDashboardStateInsertCallbackId { + ProfileDashboardStateInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: ProfileDashboardStateInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = ProfileDashboardStateDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileDashboardStateDeleteCallbackId { + ProfileDashboardStateDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: ProfileDashboardStateDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct ProfileDashboardStateUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for ProfileDashboardStateTableHandle<'ctx> { + type UpdateCallbackId = ProfileDashboardStateUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> ProfileDashboardStateUpdateCallbackId { + ProfileDashboardStateUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: ProfileDashboardStateUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `user_id` unique index on the table `profile_dashboard_state`, +/// which allows point queries on the field of the same name +/// via the [`ProfileDashboardStateUserIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.profile_dashboard_state().user_id().find(...)`. +pub struct ProfileDashboardStateUserIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> ProfileDashboardStateTableHandle<'ctx> { + /// Get a handle on the `user_id` unique index on the table `profile_dashboard_state`. + pub fn user_id(&self) -> ProfileDashboardStateUserIdUnique<'ctx> { + ProfileDashboardStateUserIdUnique { + imp: self.imp.get_unique_constraint::("user_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> ProfileDashboardStateUserIdUnique<'ctx> { + /// Find the subscribed row whose `user_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("profile_dashboard_state"); + _table.add_unique_constraint::("user_id", |row| &row.user_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `ProfileDashboardState`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait profile_dashboard_stateQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `ProfileDashboardState`. + fn profile_dashboard_state(&self) -> __sdk::__query_builder::Table; +} + +impl profile_dashboard_stateQueryTableAccess for __sdk::QueryTableAccessor { + fn profile_dashboard_state(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("profile_dashboard_state") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_invite_code_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_invite_code_table.rs new file mode 100644 index 00000000..17c10036 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_invite_code_table.rs @@ -0,0 +1,192 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::profile_invite_code_type::ProfileInviteCode; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `profile_invite_code`. +/// +/// Obtain a handle from the [`ProfileInviteCodeTableAccess::profile_invite_code`] method on [`super::RemoteTables`], +/// like `ctx.db.profile_invite_code()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.profile_invite_code().on_insert(...)`. +pub struct ProfileInviteCodeTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `profile_invite_code`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait ProfileInviteCodeTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`ProfileInviteCodeTableHandle`], which mediates access to the table `profile_invite_code`. + fn profile_invite_code(&self) -> ProfileInviteCodeTableHandle<'_>; +} + +impl ProfileInviteCodeTableAccess for super::RemoteTables { + fn profile_invite_code(&self) -> ProfileInviteCodeTableHandle<'_> { + ProfileInviteCodeTableHandle { + imp: self + .imp + .get_table::("profile_invite_code"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct ProfileInviteCodeInsertCallbackId(__sdk::CallbackId); +pub struct ProfileInviteCodeDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for ProfileInviteCodeTableHandle<'ctx> { + type Row = ProfileInviteCode; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = ProfileInviteCodeInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileInviteCodeInsertCallbackId { + ProfileInviteCodeInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: ProfileInviteCodeInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = ProfileInviteCodeDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileInviteCodeDeleteCallbackId { + ProfileInviteCodeDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: ProfileInviteCodeDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct ProfileInviteCodeUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for ProfileInviteCodeTableHandle<'ctx> { + type UpdateCallbackId = ProfileInviteCodeUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> ProfileInviteCodeUpdateCallbackId { + ProfileInviteCodeUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: ProfileInviteCodeUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `user_id` unique index on the table `profile_invite_code`, +/// which allows point queries on the field of the same name +/// via the [`ProfileInviteCodeUserIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.profile_invite_code().user_id().find(...)`. +pub struct ProfileInviteCodeUserIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> ProfileInviteCodeTableHandle<'ctx> { + /// Get a handle on the `user_id` unique index on the table `profile_invite_code`. + pub fn user_id(&self) -> ProfileInviteCodeUserIdUnique<'ctx> { + ProfileInviteCodeUserIdUnique { + imp: self.imp.get_unique_constraint::("user_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> ProfileInviteCodeUserIdUnique<'ctx> { + /// Find the subscribed row whose `user_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +/// Access to the `invite_code` unique index on the table `profile_invite_code`, +/// which allows point queries on the field of the same name +/// via the [`ProfileInviteCodeInviteCodeUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.profile_invite_code().invite_code().find(...)`. +pub struct ProfileInviteCodeInviteCodeUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> ProfileInviteCodeTableHandle<'ctx> { + /// Get a handle on the `invite_code` unique index on the table `profile_invite_code`. + pub fn invite_code(&self) -> ProfileInviteCodeInviteCodeUnique<'ctx> { + ProfileInviteCodeInviteCodeUnique { + imp: self.imp.get_unique_constraint::("invite_code"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> ProfileInviteCodeInviteCodeUnique<'ctx> { + /// Find the subscribed row whose `invite_code` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("profile_invite_code"); + _table.add_unique_constraint::("user_id", |row| &row.user_id); + _table.add_unique_constraint::("invite_code", |row| &row.invite_code); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `ProfileInviteCode`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait profile_invite_codeQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `ProfileInviteCode`. + fn profile_invite_code(&self) -> __sdk::__query_builder::Table; +} + +impl profile_invite_codeQueryTableAccess for __sdk::QueryTableAccessor { + fn profile_invite_code(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("profile_invite_code") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_membership_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_membership_table.rs new file mode 100644 index 00000000..82d0e749 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_membership_table.rs @@ -0,0 +1,163 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::profile_membership_type::ProfileMembership; +use super::runtime_profile_membership_status_type::RuntimeProfileMembershipStatus; +use super::runtime_profile_membership_tier_type::RuntimeProfileMembershipTier; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `profile_membership`. +/// +/// Obtain a handle from the [`ProfileMembershipTableAccess::profile_membership`] method on [`super::RemoteTables`], +/// like `ctx.db.profile_membership()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.profile_membership().on_insert(...)`. +pub struct ProfileMembershipTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `profile_membership`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait ProfileMembershipTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`ProfileMembershipTableHandle`], which mediates access to the table `profile_membership`. + fn profile_membership(&self) -> ProfileMembershipTableHandle<'_>; +} + +impl ProfileMembershipTableAccess for super::RemoteTables { + fn profile_membership(&self) -> ProfileMembershipTableHandle<'_> { + ProfileMembershipTableHandle { + imp: self + .imp + .get_table::("profile_membership"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct ProfileMembershipInsertCallbackId(__sdk::CallbackId); +pub struct ProfileMembershipDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for ProfileMembershipTableHandle<'ctx> { + type Row = ProfileMembership; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = ProfileMembershipInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileMembershipInsertCallbackId { + ProfileMembershipInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: ProfileMembershipInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = ProfileMembershipDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileMembershipDeleteCallbackId { + ProfileMembershipDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: ProfileMembershipDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct ProfileMembershipUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for ProfileMembershipTableHandle<'ctx> { + type UpdateCallbackId = ProfileMembershipUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> ProfileMembershipUpdateCallbackId { + ProfileMembershipUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: ProfileMembershipUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `user_id` unique index on the table `profile_membership`, +/// which allows point queries on the field of the same name +/// via the [`ProfileMembershipUserIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.profile_membership().user_id().find(...)`. +pub struct ProfileMembershipUserIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> ProfileMembershipTableHandle<'ctx> { + /// Get a handle on the `user_id` unique index on the table `profile_membership`. + pub fn user_id(&self) -> ProfileMembershipUserIdUnique<'ctx> { + ProfileMembershipUserIdUnique { + imp: self.imp.get_unique_constraint::("user_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> ProfileMembershipUserIdUnique<'ctx> { + /// Find the subscribed row whose `user_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("profile_membership"); + _table.add_unique_constraint::("user_id", |row| &row.user_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `ProfileMembership`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait profile_membershipQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `ProfileMembership`. + fn profile_membership(&self) -> __sdk::__query_builder::Table; +} + +impl profile_membershipQueryTableAccess for __sdk::QueryTableAccessor { + fn profile_membership(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("profile_membership") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_played_world_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_played_world_table.rs new file mode 100644 index 00000000..0f147bd5 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_played_world_table.rs @@ -0,0 +1,161 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::profile_played_world_type::ProfilePlayedWorld; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `profile_played_world`. +/// +/// Obtain a handle from the [`ProfilePlayedWorldTableAccess::profile_played_world`] method on [`super::RemoteTables`], +/// like `ctx.db.profile_played_world()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.profile_played_world().on_insert(...)`. +pub struct ProfilePlayedWorldTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `profile_played_world`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait ProfilePlayedWorldTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`ProfilePlayedWorldTableHandle`], which mediates access to the table `profile_played_world`. + fn profile_played_world(&self) -> ProfilePlayedWorldTableHandle<'_>; +} + +impl ProfilePlayedWorldTableAccess for super::RemoteTables { + fn profile_played_world(&self) -> ProfilePlayedWorldTableHandle<'_> { + ProfilePlayedWorldTableHandle { + imp: self + .imp + .get_table::("profile_played_world"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct ProfilePlayedWorldInsertCallbackId(__sdk::CallbackId); +pub struct ProfilePlayedWorldDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for ProfilePlayedWorldTableHandle<'ctx> { + type Row = ProfilePlayedWorld; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = ProfilePlayedWorldInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfilePlayedWorldInsertCallbackId { + ProfilePlayedWorldInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: ProfilePlayedWorldInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = ProfilePlayedWorldDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfilePlayedWorldDeleteCallbackId { + ProfilePlayedWorldDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: ProfilePlayedWorldDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct ProfilePlayedWorldUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for ProfilePlayedWorldTableHandle<'ctx> { + type UpdateCallbackId = ProfilePlayedWorldUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> ProfilePlayedWorldUpdateCallbackId { + ProfilePlayedWorldUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: ProfilePlayedWorldUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `played_world_id` unique index on the table `profile_played_world`, +/// which allows point queries on the field of the same name +/// via the [`ProfilePlayedWorldPlayedWorldIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.profile_played_world().played_world_id().find(...)`. +pub struct ProfilePlayedWorldPlayedWorldIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> ProfilePlayedWorldTableHandle<'ctx> { + /// Get a handle on the `played_world_id` unique index on the table `profile_played_world`. + pub fn played_world_id(&self) -> ProfilePlayedWorldPlayedWorldIdUnique<'ctx> { + ProfilePlayedWorldPlayedWorldIdUnique { + imp: self.imp.get_unique_constraint::("played_world_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> ProfilePlayedWorldPlayedWorldIdUnique<'ctx> { + /// Find the subscribed row whose `played_world_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("profile_played_world"); + _table.add_unique_constraint::("played_world_id", |row| &row.played_world_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `ProfilePlayedWorld`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait profile_played_worldQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `ProfilePlayedWorld`. + fn profile_played_world(&self) -> __sdk::__query_builder::Table; +} + +impl profile_played_worldQueryTableAccess for __sdk::QueryTableAccessor { + fn profile_played_world(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("profile_played_world") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_recharge_order_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_recharge_order_table.rs new file mode 100644 index 00000000..e3909eec --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_recharge_order_table.rs @@ -0,0 +1,163 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::profile_recharge_order_type::ProfileRechargeOrder; +use super::runtime_profile_recharge_order_status_type::RuntimeProfileRechargeOrderStatus; +use super::runtime_profile_recharge_product_kind_type::RuntimeProfileRechargeProductKind; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `profile_recharge_order`. +/// +/// Obtain a handle from the [`ProfileRechargeOrderTableAccess::profile_recharge_order`] method on [`super::RemoteTables`], +/// like `ctx.db.profile_recharge_order()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.profile_recharge_order().on_insert(...)`. +pub struct ProfileRechargeOrderTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `profile_recharge_order`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait ProfileRechargeOrderTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`ProfileRechargeOrderTableHandle`], which mediates access to the table `profile_recharge_order`. + fn profile_recharge_order(&self) -> ProfileRechargeOrderTableHandle<'_>; +} + +impl ProfileRechargeOrderTableAccess for super::RemoteTables { + fn profile_recharge_order(&self) -> ProfileRechargeOrderTableHandle<'_> { + ProfileRechargeOrderTableHandle { + imp: self + .imp + .get_table::("profile_recharge_order"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct ProfileRechargeOrderInsertCallbackId(__sdk::CallbackId); +pub struct ProfileRechargeOrderDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for ProfileRechargeOrderTableHandle<'ctx> { + type Row = ProfileRechargeOrder; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = ProfileRechargeOrderInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileRechargeOrderInsertCallbackId { + ProfileRechargeOrderInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: ProfileRechargeOrderInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = ProfileRechargeOrderDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileRechargeOrderDeleteCallbackId { + ProfileRechargeOrderDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: ProfileRechargeOrderDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct ProfileRechargeOrderUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for ProfileRechargeOrderTableHandle<'ctx> { + type UpdateCallbackId = ProfileRechargeOrderUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> ProfileRechargeOrderUpdateCallbackId { + ProfileRechargeOrderUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: ProfileRechargeOrderUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `order_id` unique index on the table `profile_recharge_order`, +/// which allows point queries on the field of the same name +/// via the [`ProfileRechargeOrderOrderIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.profile_recharge_order().order_id().find(...)`. +pub struct ProfileRechargeOrderOrderIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> ProfileRechargeOrderTableHandle<'ctx> { + /// Get a handle on the `order_id` unique index on the table `profile_recharge_order`. + pub fn order_id(&self) -> ProfileRechargeOrderOrderIdUnique<'ctx> { + ProfileRechargeOrderOrderIdUnique { + imp: self.imp.get_unique_constraint::("order_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> ProfileRechargeOrderOrderIdUnique<'ctx> { + /// Find the subscribed row whose `order_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("profile_recharge_order"); + _table.add_unique_constraint::("order_id", |row| &row.order_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `ProfileRechargeOrder`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait profile_recharge_orderQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `ProfileRechargeOrder`. + fn profile_recharge_order(&self) -> __sdk::__query_builder::Table; +} + +impl profile_recharge_orderQueryTableAccess for __sdk::QueryTableAccessor { + fn profile_recharge_order(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("profile_recharge_order") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_redeem_code_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_redeem_code_table.rs new file mode 100644 index 00000000..2b9ac34f --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_redeem_code_table.rs @@ -0,0 +1,162 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::profile_redeem_code_type::ProfileRedeemCode; +use super::runtime_profile_redeem_code_mode_type::RuntimeProfileRedeemCodeMode; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `profile_redeem_code`. +/// +/// Obtain a handle from the [`ProfileRedeemCodeTableAccess::profile_redeem_code`] method on [`super::RemoteTables`], +/// like `ctx.db.profile_redeem_code()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.profile_redeem_code().on_insert(...)`. +pub struct ProfileRedeemCodeTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `profile_redeem_code`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait ProfileRedeemCodeTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`ProfileRedeemCodeTableHandle`], which mediates access to the table `profile_redeem_code`. + fn profile_redeem_code(&self) -> ProfileRedeemCodeTableHandle<'_>; +} + +impl ProfileRedeemCodeTableAccess for super::RemoteTables { + fn profile_redeem_code(&self) -> ProfileRedeemCodeTableHandle<'_> { + ProfileRedeemCodeTableHandle { + imp: self + .imp + .get_table::("profile_redeem_code"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct ProfileRedeemCodeInsertCallbackId(__sdk::CallbackId); +pub struct ProfileRedeemCodeDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for ProfileRedeemCodeTableHandle<'ctx> { + type Row = ProfileRedeemCode; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = ProfileRedeemCodeInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileRedeemCodeInsertCallbackId { + ProfileRedeemCodeInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: ProfileRedeemCodeInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = ProfileRedeemCodeDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileRedeemCodeDeleteCallbackId { + ProfileRedeemCodeDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: ProfileRedeemCodeDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct ProfileRedeemCodeUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for ProfileRedeemCodeTableHandle<'ctx> { + type UpdateCallbackId = ProfileRedeemCodeUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> ProfileRedeemCodeUpdateCallbackId { + ProfileRedeemCodeUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: ProfileRedeemCodeUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `code` unique index on the table `profile_redeem_code`, +/// which allows point queries on the field of the same name +/// via the [`ProfileRedeemCodeCodeUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.profile_redeem_code().code().find(...)`. +pub struct ProfileRedeemCodeCodeUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> ProfileRedeemCodeTableHandle<'ctx> { + /// Get a handle on the `code` unique index on the table `profile_redeem_code`. + pub fn code(&self) -> ProfileRedeemCodeCodeUnique<'ctx> { + ProfileRedeemCodeCodeUnique { + imp: self.imp.get_unique_constraint::("code"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> ProfileRedeemCodeCodeUnique<'ctx> { + /// Find the subscribed row whose `code` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("profile_redeem_code"); + _table.add_unique_constraint::("code", |row| &row.code); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `ProfileRedeemCode`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait profile_redeem_codeQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `ProfileRedeemCode`. + fn profile_redeem_code(&self) -> __sdk::__query_builder::Table; +} + +impl profile_redeem_codeQueryTableAccess for __sdk::QueryTableAccessor { + fn profile_redeem_code(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("profile_redeem_code") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_redeem_code_usage_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_redeem_code_usage_table.rs new file mode 100644 index 00000000..dc48cdab --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_redeem_code_usage_table.rs @@ -0,0 +1,162 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::profile_redeem_code_usage_type::ProfileRedeemCodeUsage; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `profile_redeem_code_usage`. +/// +/// Obtain a handle from the [`ProfileRedeemCodeUsageTableAccess::profile_redeem_code_usage`] method on [`super::RemoteTables`], +/// like `ctx.db.profile_redeem_code_usage()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.profile_redeem_code_usage().on_insert(...)`. +pub struct ProfileRedeemCodeUsageTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `profile_redeem_code_usage`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait ProfileRedeemCodeUsageTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`ProfileRedeemCodeUsageTableHandle`], which mediates access to the table `profile_redeem_code_usage`. + fn profile_redeem_code_usage(&self) -> ProfileRedeemCodeUsageTableHandle<'_>; +} + +impl ProfileRedeemCodeUsageTableAccess for super::RemoteTables { + fn profile_redeem_code_usage(&self) -> ProfileRedeemCodeUsageTableHandle<'_> { + ProfileRedeemCodeUsageTableHandle { + imp: self + .imp + .get_table::("profile_redeem_code_usage"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct ProfileRedeemCodeUsageInsertCallbackId(__sdk::CallbackId); +pub struct ProfileRedeemCodeUsageDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for ProfileRedeemCodeUsageTableHandle<'ctx> { + type Row = ProfileRedeemCodeUsage; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = ProfileRedeemCodeUsageInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileRedeemCodeUsageInsertCallbackId { + ProfileRedeemCodeUsageInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: ProfileRedeemCodeUsageInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = ProfileRedeemCodeUsageDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileRedeemCodeUsageDeleteCallbackId { + ProfileRedeemCodeUsageDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: ProfileRedeemCodeUsageDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct ProfileRedeemCodeUsageUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for ProfileRedeemCodeUsageTableHandle<'ctx> { + type UpdateCallbackId = ProfileRedeemCodeUsageUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> ProfileRedeemCodeUsageUpdateCallbackId { + ProfileRedeemCodeUsageUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: ProfileRedeemCodeUsageUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `usage_id` unique index on the table `profile_redeem_code_usage`, +/// which allows point queries on the field of the same name +/// via the [`ProfileRedeemCodeUsageUsageIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.profile_redeem_code_usage().usage_id().find(...)`. +pub struct ProfileRedeemCodeUsageUsageIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> ProfileRedeemCodeUsageTableHandle<'ctx> { + /// Get a handle on the `usage_id` unique index on the table `profile_redeem_code_usage`. + pub fn usage_id(&self) -> ProfileRedeemCodeUsageUsageIdUnique<'ctx> { + ProfileRedeemCodeUsageUsageIdUnique { + imp: self.imp.get_unique_constraint::("usage_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> ProfileRedeemCodeUsageUsageIdUnique<'ctx> { + /// Find the subscribed row whose `usage_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = + client_cache.get_or_make_table::("profile_redeem_code_usage"); + _table.add_unique_constraint::("usage_id", |row| &row.usage_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `ProfileRedeemCodeUsage`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait profile_redeem_code_usageQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `ProfileRedeemCodeUsage`. + fn profile_redeem_code_usage(&self) -> __sdk::__query_builder::Table; +} + +impl profile_redeem_code_usageQueryTableAccess for __sdk::QueryTableAccessor { + fn profile_redeem_code_usage(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("profile_redeem_code_usage") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_referral_relation_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_referral_relation_table.rs new file mode 100644 index 00000000..7ab90442 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_referral_relation_table.rs @@ -0,0 +1,162 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::profile_referral_relation_type::ProfileReferralRelation; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `profile_referral_relation`. +/// +/// Obtain a handle from the [`ProfileReferralRelationTableAccess::profile_referral_relation`] method on [`super::RemoteTables`], +/// like `ctx.db.profile_referral_relation()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.profile_referral_relation().on_insert(...)`. +pub struct ProfileReferralRelationTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `profile_referral_relation`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait ProfileReferralRelationTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`ProfileReferralRelationTableHandle`], which mediates access to the table `profile_referral_relation`. + fn profile_referral_relation(&self) -> ProfileReferralRelationTableHandle<'_>; +} + +impl ProfileReferralRelationTableAccess for super::RemoteTables { + fn profile_referral_relation(&self) -> ProfileReferralRelationTableHandle<'_> { + ProfileReferralRelationTableHandle { + imp: self + .imp + .get_table::("profile_referral_relation"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct ProfileReferralRelationInsertCallbackId(__sdk::CallbackId); +pub struct ProfileReferralRelationDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for ProfileReferralRelationTableHandle<'ctx> { + type Row = ProfileReferralRelation; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = ProfileReferralRelationInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileReferralRelationInsertCallbackId { + ProfileReferralRelationInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: ProfileReferralRelationInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = ProfileReferralRelationDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileReferralRelationDeleteCallbackId { + ProfileReferralRelationDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: ProfileReferralRelationDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct ProfileReferralRelationUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for ProfileReferralRelationTableHandle<'ctx> { + type UpdateCallbackId = ProfileReferralRelationUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> ProfileReferralRelationUpdateCallbackId { + ProfileReferralRelationUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: ProfileReferralRelationUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `invitee_user_id` unique index on the table `profile_referral_relation`, +/// which allows point queries on the field of the same name +/// via the [`ProfileReferralRelationInviteeUserIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.profile_referral_relation().invitee_user_id().find(...)`. +pub struct ProfileReferralRelationInviteeUserIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> ProfileReferralRelationTableHandle<'ctx> { + /// Get a handle on the `invitee_user_id` unique index on the table `profile_referral_relation`. + pub fn invitee_user_id(&self) -> ProfileReferralRelationInviteeUserIdUnique<'ctx> { + ProfileReferralRelationInviteeUserIdUnique { + imp: self.imp.get_unique_constraint::("invitee_user_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> ProfileReferralRelationInviteeUserIdUnique<'ctx> { + /// Find the subscribed row whose `invitee_user_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = + client_cache.get_or_make_table::("profile_referral_relation"); + _table.add_unique_constraint::("invitee_user_id", |row| &row.invitee_user_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `ProfileReferralRelation`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait profile_referral_relationQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `ProfileReferralRelation`. + fn profile_referral_relation(&self) -> __sdk::__query_builder::Table; +} + +impl profile_referral_relationQueryTableAccess for __sdk::QueryTableAccessor { + fn profile_referral_relation(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("profile_referral_relation") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_save_archive_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_save_archive_table.rs new file mode 100644 index 00000000..fc9c83e1 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_save_archive_table.rs @@ -0,0 +1,161 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::profile_save_archive_type::ProfileSaveArchive; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `profile_save_archive`. +/// +/// Obtain a handle from the [`ProfileSaveArchiveTableAccess::profile_save_archive`] method on [`super::RemoteTables`], +/// like `ctx.db.profile_save_archive()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.profile_save_archive().on_insert(...)`. +pub struct ProfileSaveArchiveTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `profile_save_archive`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait ProfileSaveArchiveTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`ProfileSaveArchiveTableHandle`], which mediates access to the table `profile_save_archive`. + fn profile_save_archive(&self) -> ProfileSaveArchiveTableHandle<'_>; +} + +impl ProfileSaveArchiveTableAccess for super::RemoteTables { + fn profile_save_archive(&self) -> ProfileSaveArchiveTableHandle<'_> { + ProfileSaveArchiveTableHandle { + imp: self + .imp + .get_table::("profile_save_archive"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct ProfileSaveArchiveInsertCallbackId(__sdk::CallbackId); +pub struct ProfileSaveArchiveDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for ProfileSaveArchiveTableHandle<'ctx> { + type Row = ProfileSaveArchive; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = ProfileSaveArchiveInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileSaveArchiveInsertCallbackId { + ProfileSaveArchiveInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: ProfileSaveArchiveInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = ProfileSaveArchiveDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileSaveArchiveDeleteCallbackId { + ProfileSaveArchiveDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: ProfileSaveArchiveDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct ProfileSaveArchiveUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for ProfileSaveArchiveTableHandle<'ctx> { + type UpdateCallbackId = ProfileSaveArchiveUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> ProfileSaveArchiveUpdateCallbackId { + ProfileSaveArchiveUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: ProfileSaveArchiveUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `archive_id` unique index on the table `profile_save_archive`, +/// which allows point queries on the field of the same name +/// via the [`ProfileSaveArchiveArchiveIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.profile_save_archive().archive_id().find(...)`. +pub struct ProfileSaveArchiveArchiveIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> ProfileSaveArchiveTableHandle<'ctx> { + /// Get a handle on the `archive_id` unique index on the table `profile_save_archive`. + pub fn archive_id(&self) -> ProfileSaveArchiveArchiveIdUnique<'ctx> { + ProfileSaveArchiveArchiveIdUnique { + imp: self.imp.get_unique_constraint::("archive_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> ProfileSaveArchiveArchiveIdUnique<'ctx> { + /// Find the subscribed row whose `archive_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("profile_save_archive"); + _table.add_unique_constraint::("archive_id", |row| &row.archive_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `ProfileSaveArchive`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait profile_save_archiveQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `ProfileSaveArchive`. + fn profile_save_archive(&self) -> __sdk::__query_builder::Table; +} + +impl profile_save_archiveQueryTableAccess for __sdk::QueryTableAccessor { + fn profile_save_archive(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("profile_save_archive") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_task_config_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_task_config_table.rs new file mode 100644 index 00000000..108ccf6c --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_task_config_table.rs @@ -0,0 +1,163 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::profile_task_config_type::ProfileTaskConfig; +use super::runtime_profile_task_cycle_type::RuntimeProfileTaskCycle; +use super::runtime_tracking_scope_kind_type::RuntimeTrackingScopeKind; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `profile_task_config`. +/// +/// Obtain a handle from the [`ProfileTaskConfigTableAccess::profile_task_config`] method on [`super::RemoteTables`], +/// like `ctx.db.profile_task_config()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.profile_task_config().on_insert(...)`. +pub struct ProfileTaskConfigTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `profile_task_config`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait ProfileTaskConfigTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`ProfileTaskConfigTableHandle`], which mediates access to the table `profile_task_config`. + fn profile_task_config(&self) -> ProfileTaskConfigTableHandle<'_>; +} + +impl ProfileTaskConfigTableAccess for super::RemoteTables { + fn profile_task_config(&self) -> ProfileTaskConfigTableHandle<'_> { + ProfileTaskConfigTableHandle { + imp: self + .imp + .get_table::("profile_task_config"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct ProfileTaskConfigInsertCallbackId(__sdk::CallbackId); +pub struct ProfileTaskConfigDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for ProfileTaskConfigTableHandle<'ctx> { + type Row = ProfileTaskConfig; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = ProfileTaskConfigInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileTaskConfigInsertCallbackId { + ProfileTaskConfigInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: ProfileTaskConfigInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = ProfileTaskConfigDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileTaskConfigDeleteCallbackId { + ProfileTaskConfigDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: ProfileTaskConfigDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct ProfileTaskConfigUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for ProfileTaskConfigTableHandle<'ctx> { + type UpdateCallbackId = ProfileTaskConfigUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> ProfileTaskConfigUpdateCallbackId { + ProfileTaskConfigUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: ProfileTaskConfigUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `task_id` unique index on the table `profile_task_config`, +/// which allows point queries on the field of the same name +/// via the [`ProfileTaskConfigTaskIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.profile_task_config().task_id().find(...)`. +pub struct ProfileTaskConfigTaskIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> ProfileTaskConfigTableHandle<'ctx> { + /// Get a handle on the `task_id` unique index on the table `profile_task_config`. + pub fn task_id(&self) -> ProfileTaskConfigTaskIdUnique<'ctx> { + ProfileTaskConfigTaskIdUnique { + imp: self.imp.get_unique_constraint::("task_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> ProfileTaskConfigTaskIdUnique<'ctx> { + /// Find the subscribed row whose `task_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("profile_task_config"); + _table.add_unique_constraint::("task_id", |row| &row.task_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `ProfileTaskConfig`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait profile_task_configQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `ProfileTaskConfig`. + fn profile_task_config(&self) -> __sdk::__query_builder::Table; +} + +impl profile_task_configQueryTableAccess for __sdk::QueryTableAccessor { + fn profile_task_config(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("profile_task_config") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_task_progress_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_task_progress_table.rs new file mode 100644 index 00000000..bdf63b3e --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_task_progress_table.rs @@ -0,0 +1,162 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::profile_task_progress_type::ProfileTaskProgress; +use super::runtime_profile_task_status_type::RuntimeProfileTaskStatus; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `profile_task_progress`. +/// +/// Obtain a handle from the [`ProfileTaskProgressTableAccess::profile_task_progress`] method on [`super::RemoteTables`], +/// like `ctx.db.profile_task_progress()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.profile_task_progress().on_insert(...)`. +pub struct ProfileTaskProgressTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `profile_task_progress`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait ProfileTaskProgressTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`ProfileTaskProgressTableHandle`], which mediates access to the table `profile_task_progress`. + fn profile_task_progress(&self) -> ProfileTaskProgressTableHandle<'_>; +} + +impl ProfileTaskProgressTableAccess for super::RemoteTables { + fn profile_task_progress(&self) -> ProfileTaskProgressTableHandle<'_> { + ProfileTaskProgressTableHandle { + imp: self + .imp + .get_table::("profile_task_progress"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct ProfileTaskProgressInsertCallbackId(__sdk::CallbackId); +pub struct ProfileTaskProgressDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for ProfileTaskProgressTableHandle<'ctx> { + type Row = ProfileTaskProgress; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = ProfileTaskProgressInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileTaskProgressInsertCallbackId { + ProfileTaskProgressInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: ProfileTaskProgressInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = ProfileTaskProgressDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileTaskProgressDeleteCallbackId { + ProfileTaskProgressDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: ProfileTaskProgressDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct ProfileTaskProgressUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for ProfileTaskProgressTableHandle<'ctx> { + type UpdateCallbackId = ProfileTaskProgressUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> ProfileTaskProgressUpdateCallbackId { + ProfileTaskProgressUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: ProfileTaskProgressUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `progress_id` unique index on the table `profile_task_progress`, +/// which allows point queries on the field of the same name +/// via the [`ProfileTaskProgressProgressIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.profile_task_progress().progress_id().find(...)`. +pub struct ProfileTaskProgressProgressIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> ProfileTaskProgressTableHandle<'ctx> { + /// Get a handle on the `progress_id` unique index on the table `profile_task_progress`. + pub fn progress_id(&self) -> ProfileTaskProgressProgressIdUnique<'ctx> { + ProfileTaskProgressProgressIdUnique { + imp: self.imp.get_unique_constraint::("progress_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> ProfileTaskProgressProgressIdUnique<'ctx> { + /// Find the subscribed row whose `progress_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("profile_task_progress"); + _table.add_unique_constraint::("progress_id", |row| &row.progress_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `ProfileTaskProgress`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait profile_task_progressQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `ProfileTaskProgress`. + fn profile_task_progress(&self) -> __sdk::__query_builder::Table; +} + +impl profile_task_progressQueryTableAccess for __sdk::QueryTableAccessor { + fn profile_task_progress(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("profile_task_progress") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_task_reward_claim_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_task_reward_claim_table.rs new file mode 100644 index 00000000..7e67894d --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_task_reward_claim_table.rs @@ -0,0 +1,162 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::profile_task_reward_claim_type::ProfileTaskRewardClaim; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `profile_task_reward_claim`. +/// +/// Obtain a handle from the [`ProfileTaskRewardClaimTableAccess::profile_task_reward_claim`] method on [`super::RemoteTables`], +/// like `ctx.db.profile_task_reward_claim()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.profile_task_reward_claim().on_insert(...)`. +pub struct ProfileTaskRewardClaimTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `profile_task_reward_claim`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait ProfileTaskRewardClaimTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`ProfileTaskRewardClaimTableHandle`], which mediates access to the table `profile_task_reward_claim`. + fn profile_task_reward_claim(&self) -> ProfileTaskRewardClaimTableHandle<'_>; +} + +impl ProfileTaskRewardClaimTableAccess for super::RemoteTables { + fn profile_task_reward_claim(&self) -> ProfileTaskRewardClaimTableHandle<'_> { + ProfileTaskRewardClaimTableHandle { + imp: self + .imp + .get_table::("profile_task_reward_claim"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct ProfileTaskRewardClaimInsertCallbackId(__sdk::CallbackId); +pub struct ProfileTaskRewardClaimDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for ProfileTaskRewardClaimTableHandle<'ctx> { + type Row = ProfileTaskRewardClaim; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = ProfileTaskRewardClaimInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileTaskRewardClaimInsertCallbackId { + ProfileTaskRewardClaimInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: ProfileTaskRewardClaimInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = ProfileTaskRewardClaimDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileTaskRewardClaimDeleteCallbackId { + ProfileTaskRewardClaimDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: ProfileTaskRewardClaimDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct ProfileTaskRewardClaimUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for ProfileTaskRewardClaimTableHandle<'ctx> { + type UpdateCallbackId = ProfileTaskRewardClaimUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> ProfileTaskRewardClaimUpdateCallbackId { + ProfileTaskRewardClaimUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: ProfileTaskRewardClaimUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `claim_id` unique index on the table `profile_task_reward_claim`, +/// which allows point queries on the field of the same name +/// via the [`ProfileTaskRewardClaimClaimIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.profile_task_reward_claim().claim_id().find(...)`. +pub struct ProfileTaskRewardClaimClaimIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> ProfileTaskRewardClaimTableHandle<'ctx> { + /// Get a handle on the `claim_id` unique index on the table `profile_task_reward_claim`. + pub fn claim_id(&self) -> ProfileTaskRewardClaimClaimIdUnique<'ctx> { + ProfileTaskRewardClaimClaimIdUnique { + imp: self.imp.get_unique_constraint::("claim_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> ProfileTaskRewardClaimClaimIdUnique<'ctx> { + /// Find the subscribed row whose `claim_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = + client_cache.get_or_make_table::("profile_task_reward_claim"); + _table.add_unique_constraint::("claim_id", |row| &row.claim_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `ProfileTaskRewardClaim`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait profile_task_reward_claimQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `ProfileTaskRewardClaim`. + fn profile_task_reward_claim(&self) -> __sdk::__query_builder::Table; +} + +impl profile_task_reward_claimQueryTableAccess for __sdk::QueryTableAccessor { + fn profile_task_reward_claim(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("profile_task_reward_claim") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_wallet_ledger_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_wallet_ledger_table.rs new file mode 100644 index 00000000..48705ae9 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_wallet_ledger_table.rs @@ -0,0 +1,162 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::profile_wallet_ledger_type::ProfileWalletLedger; +use super::runtime_profile_wallet_ledger_source_type_type::RuntimeProfileWalletLedgerSourceType; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `profile_wallet_ledger`. +/// +/// Obtain a handle from the [`ProfileWalletLedgerTableAccess::profile_wallet_ledger`] method on [`super::RemoteTables`], +/// like `ctx.db.profile_wallet_ledger()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.profile_wallet_ledger().on_insert(...)`. +pub struct ProfileWalletLedgerTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `profile_wallet_ledger`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait ProfileWalletLedgerTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`ProfileWalletLedgerTableHandle`], which mediates access to the table `profile_wallet_ledger`. + fn profile_wallet_ledger(&self) -> ProfileWalletLedgerTableHandle<'_>; +} + +impl ProfileWalletLedgerTableAccess for super::RemoteTables { + fn profile_wallet_ledger(&self) -> ProfileWalletLedgerTableHandle<'_> { + ProfileWalletLedgerTableHandle { + imp: self + .imp + .get_table::("profile_wallet_ledger"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct ProfileWalletLedgerInsertCallbackId(__sdk::CallbackId); +pub struct ProfileWalletLedgerDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for ProfileWalletLedgerTableHandle<'ctx> { + type Row = ProfileWalletLedger; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = ProfileWalletLedgerInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileWalletLedgerInsertCallbackId { + ProfileWalletLedgerInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: ProfileWalletLedgerInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = ProfileWalletLedgerDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileWalletLedgerDeleteCallbackId { + ProfileWalletLedgerDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: ProfileWalletLedgerDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct ProfileWalletLedgerUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for ProfileWalletLedgerTableHandle<'ctx> { + type UpdateCallbackId = ProfileWalletLedgerUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> ProfileWalletLedgerUpdateCallbackId { + ProfileWalletLedgerUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: ProfileWalletLedgerUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `wallet_ledger_id` unique index on the table `profile_wallet_ledger`, +/// which allows point queries on the field of the same name +/// via the [`ProfileWalletLedgerWalletLedgerIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.profile_wallet_ledger().wallet_ledger_id().find(...)`. +pub struct ProfileWalletLedgerWalletLedgerIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> ProfileWalletLedgerTableHandle<'ctx> { + /// Get a handle on the `wallet_ledger_id` unique index on the table `profile_wallet_ledger`. + pub fn wallet_ledger_id(&self) -> ProfileWalletLedgerWalletLedgerIdUnique<'ctx> { + ProfileWalletLedgerWalletLedgerIdUnique { + imp: self.imp.get_unique_constraint::("wallet_ledger_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> ProfileWalletLedgerWalletLedgerIdUnique<'ctx> { + /// Find the subscribed row whose `wallet_ledger_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("profile_wallet_ledger"); + _table.add_unique_constraint::("wallet_ledger_id", |row| &row.wallet_ledger_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `ProfileWalletLedger`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait profile_wallet_ledgerQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `ProfileWalletLedger`. + fn profile_wallet_ledger(&self) -> __sdk::__query_builder::Table; +} + +impl profile_wallet_ledgerQueryTableAccess for __sdk::QueryTableAccessor { + fn profile_wallet_ledger(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("profile_wallet_ledger") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/public_work_like_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/public_work_like_table.rs new file mode 100644 index 00000000..b25f46d1 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/public_work_like_table.rs @@ -0,0 +1,159 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::public_work_like_type::PublicWorkLike; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `public_work_like`. +/// +/// Obtain a handle from the [`PublicWorkLikeTableAccess::public_work_like`] method on [`super::RemoteTables`], +/// like `ctx.db.public_work_like()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.public_work_like().on_insert(...)`. +pub struct PublicWorkLikeTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `public_work_like`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait PublicWorkLikeTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`PublicWorkLikeTableHandle`], which mediates access to the table `public_work_like`. + fn public_work_like(&self) -> PublicWorkLikeTableHandle<'_>; +} + +impl PublicWorkLikeTableAccess for super::RemoteTables { + fn public_work_like(&self) -> PublicWorkLikeTableHandle<'_> { + PublicWorkLikeTableHandle { + imp: self.imp.get_table::("public_work_like"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct PublicWorkLikeInsertCallbackId(__sdk::CallbackId); +pub struct PublicWorkLikeDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for PublicWorkLikeTableHandle<'ctx> { + type Row = PublicWorkLike; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = PublicWorkLikeInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> PublicWorkLikeInsertCallbackId { + PublicWorkLikeInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: PublicWorkLikeInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = PublicWorkLikeDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> PublicWorkLikeDeleteCallbackId { + PublicWorkLikeDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: PublicWorkLikeDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct PublicWorkLikeUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for PublicWorkLikeTableHandle<'ctx> { + type UpdateCallbackId = PublicWorkLikeUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> PublicWorkLikeUpdateCallbackId { + PublicWorkLikeUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: PublicWorkLikeUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `like_id` unique index on the table `public_work_like`, +/// which allows point queries on the field of the same name +/// via the [`PublicWorkLikeLikeIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.public_work_like().like_id().find(...)`. +pub struct PublicWorkLikeLikeIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> PublicWorkLikeTableHandle<'ctx> { + /// Get a handle on the `like_id` unique index on the table `public_work_like`. + pub fn like_id(&self) -> PublicWorkLikeLikeIdUnique<'ctx> { + PublicWorkLikeLikeIdUnique { + imp: self.imp.get_unique_constraint::("like_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> PublicWorkLikeLikeIdUnique<'ctx> { + /// Find the subscribed row whose `like_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("public_work_like"); + _table.add_unique_constraint::("like_id", |row| &row.like_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `PublicWorkLike`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait public_work_likeQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `PublicWorkLike`. + fn public_work_like(&self) -> __sdk::__query_builder::Table; +} + +impl public_work_likeQueryTableAccess for __sdk::QueryTableAccessor { + fn public_work_like(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("public_work_like") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/public_work_play_daily_stat_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/public_work_play_daily_stat_table.rs new file mode 100644 index 00000000..8c95aaa8 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/public_work_play_daily_stat_table.rs @@ -0,0 +1,165 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::public_work_play_daily_stat_type::PublicWorkPlayDailyStat; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `public_work_play_daily_stat`. +/// +/// Obtain a handle from the [`PublicWorkPlayDailyStatTableAccess::public_work_play_daily_stat`] method on [`super::RemoteTables`], +/// like `ctx.db.public_work_play_daily_stat()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.public_work_play_daily_stat().on_insert(...)`. +pub struct PublicWorkPlayDailyStatTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `public_work_play_daily_stat`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait PublicWorkPlayDailyStatTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`PublicWorkPlayDailyStatTableHandle`], which mediates access to the table `public_work_play_daily_stat`. + fn public_work_play_daily_stat(&self) -> PublicWorkPlayDailyStatTableHandle<'_>; +} + +impl PublicWorkPlayDailyStatTableAccess for super::RemoteTables { + fn public_work_play_daily_stat(&self) -> PublicWorkPlayDailyStatTableHandle<'_> { + PublicWorkPlayDailyStatTableHandle { + imp: self + .imp + .get_table::("public_work_play_daily_stat"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct PublicWorkPlayDailyStatInsertCallbackId(__sdk::CallbackId); +pub struct PublicWorkPlayDailyStatDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for PublicWorkPlayDailyStatTableHandle<'ctx> { + type Row = PublicWorkPlayDailyStat; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = PublicWorkPlayDailyStatInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> PublicWorkPlayDailyStatInsertCallbackId { + PublicWorkPlayDailyStatInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: PublicWorkPlayDailyStatInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = PublicWorkPlayDailyStatDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> PublicWorkPlayDailyStatDeleteCallbackId { + PublicWorkPlayDailyStatDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: PublicWorkPlayDailyStatDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct PublicWorkPlayDailyStatUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for PublicWorkPlayDailyStatTableHandle<'ctx> { + type UpdateCallbackId = PublicWorkPlayDailyStatUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> PublicWorkPlayDailyStatUpdateCallbackId { + PublicWorkPlayDailyStatUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: PublicWorkPlayDailyStatUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `stat_id` unique index on the table `public_work_play_daily_stat`, +/// which allows point queries on the field of the same name +/// via the [`PublicWorkPlayDailyStatStatIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.public_work_play_daily_stat().stat_id().find(...)`. +pub struct PublicWorkPlayDailyStatStatIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> PublicWorkPlayDailyStatTableHandle<'ctx> { + /// Get a handle on the `stat_id` unique index on the table `public_work_play_daily_stat`. + pub fn stat_id(&self) -> PublicWorkPlayDailyStatStatIdUnique<'ctx> { + PublicWorkPlayDailyStatStatIdUnique { + imp: self.imp.get_unique_constraint::("stat_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> PublicWorkPlayDailyStatStatIdUnique<'ctx> { + /// Find the subscribed row whose `stat_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = + client_cache.get_or_make_table::("public_work_play_daily_stat"); + _table.add_unique_constraint::("stat_id", |row| &row.stat_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `PublicWorkPlayDailyStat`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait public_work_play_daily_statQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `PublicWorkPlayDailyStat`. + fn public_work_play_daily_stat(&self) + -> __sdk::__query_builder::Table; +} + +impl public_work_play_daily_statQueryTableAccess for __sdk::QueryTableAccessor { + fn public_work_play_daily_stat( + &self, + ) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("public_work_play_daily_stat") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/publish_big_fish_game_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/publish_big_fish_game_procedure.rs index d4507ad8..e8007288 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/publish_big_fish_game_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/publish_big_fish_game_procedure.rs @@ -31,10 +31,10 @@ pub trait publish_big_fish_game { input: BigFishPublishInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl publish_big_fish_game for super::RemoteProcedures { input: BigFishPublishInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, BigFishSessionProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/publish_custom_world_profile_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/publish_custom_world_profile_and_return_procedure.rs index d5741922..e5434aca 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/publish_custom_world_profile_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/publish_custom_world_profile_and_return_procedure.rs @@ -31,10 +31,10 @@ pub trait publish_custom_world_profile_and_return { input: CustomWorldProfilePublishInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl publish_custom_world_profile_and_return for super::RemoteProcedures { input: CustomWorldProfilePublishInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, CustomWorldLibraryMutationResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/publish_custom_world_profile_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/publish_custom_world_profile_reducer.rs index 2e2f71f6..84e6b339 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/publish_custom_world_profile_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/publish_custom_world_profile_reducer.rs @@ -50,11 +50,9 @@ pub trait publish_custom_world_profile { &self, input: CustomWorldProfilePublishInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()>; } @@ -63,11 +61,9 @@ impl publish_custom_world_profile for super::RemoteReducers { &self, input: CustomWorldProfilePublishInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()> { self.imp .invoke_reducer_with_callback(PublishCustomWorldProfileArgs { input }, callback) diff --git a/server-rs/crates/spacetime-client/src/module_bindings/publish_custom_world_world_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/publish_custom_world_world_procedure.rs index 42c76aad..1eb935a2 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/publish_custom_world_world_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/publish_custom_world_world_procedure.rs @@ -31,10 +31,10 @@ pub trait publish_custom_world_world { input: CustomWorldPublishWorldInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl publish_custom_world_world for super::RemoteProcedures { input: CustomWorldPublishWorldInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, CustomWorldPublishWorldResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/publish_match_3_d_work_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/publish_match_3_d_work_procedure.rs index db0c7efe..65bd160e 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/publish_match_3_d_work_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/publish_match_3_d_work_procedure.rs @@ -31,10 +31,10 @@ pub trait publish_match_3_d_work { input: Match3DWorkPublishInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl publish_match_3_d_work for super::RemoteProcedures { input: Match3DWorkPublishInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, Match3DWorkProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/publish_puzzle_work_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/publish_puzzle_work_procedure.rs index 932b66d6..288b44a5 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/publish_puzzle_work_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/publish_puzzle_work_procedure.rs @@ -31,10 +31,10 @@ pub trait publish_puzzle_work { input: PuzzlePublishInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl publish_puzzle_work for super::RemoteProcedures { input: PuzzlePublishInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, PuzzleWorkProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/put_database_migration_import_chunk_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/put_database_migration_import_chunk_procedure.rs index f3776bfd..597b2511 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/put_database_migration_import_chunk_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/put_database_migration_import_chunk_procedure.rs @@ -31,10 +31,10 @@ pub trait put_database_migration_import_chunk { input: DatabaseMigrationImportChunkInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl put_database_migration_import_chunk for super::RemoteProcedures { input: DatabaseMigrationImportChunkInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, DatabaseMigrationProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_message_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_message_table.rs new file mode 100644 index 00000000..0f54e13b --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_message_table.rs @@ -0,0 +1,163 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::puzzle_agent_message_kind_type::PuzzleAgentMessageKind; +use super::puzzle_agent_message_role_type::PuzzleAgentMessageRole; +use super::puzzle_agent_message_row_type::PuzzleAgentMessageRow; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `puzzle_agent_message`. +/// +/// Obtain a handle from the [`PuzzleAgentMessageTableAccess::puzzle_agent_message`] method on [`super::RemoteTables`], +/// like `ctx.db.puzzle_agent_message()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.puzzle_agent_message().on_insert(...)`. +pub struct PuzzleAgentMessageTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `puzzle_agent_message`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait PuzzleAgentMessageTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`PuzzleAgentMessageTableHandle`], which mediates access to the table `puzzle_agent_message`. + fn puzzle_agent_message(&self) -> PuzzleAgentMessageTableHandle<'_>; +} + +impl PuzzleAgentMessageTableAccess for super::RemoteTables { + fn puzzle_agent_message(&self) -> PuzzleAgentMessageTableHandle<'_> { + PuzzleAgentMessageTableHandle { + imp: self + .imp + .get_table::("puzzle_agent_message"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct PuzzleAgentMessageInsertCallbackId(__sdk::CallbackId); +pub struct PuzzleAgentMessageDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for PuzzleAgentMessageTableHandle<'ctx> { + type Row = PuzzleAgentMessageRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = PuzzleAgentMessageInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> PuzzleAgentMessageInsertCallbackId { + PuzzleAgentMessageInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: PuzzleAgentMessageInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = PuzzleAgentMessageDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> PuzzleAgentMessageDeleteCallbackId { + PuzzleAgentMessageDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: PuzzleAgentMessageDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct PuzzleAgentMessageUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for PuzzleAgentMessageTableHandle<'ctx> { + type UpdateCallbackId = PuzzleAgentMessageUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> PuzzleAgentMessageUpdateCallbackId { + PuzzleAgentMessageUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: PuzzleAgentMessageUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `message_id` unique index on the table `puzzle_agent_message`, +/// which allows point queries on the field of the same name +/// via the [`PuzzleAgentMessageMessageIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.puzzle_agent_message().message_id().find(...)`. +pub struct PuzzleAgentMessageMessageIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> PuzzleAgentMessageTableHandle<'ctx> { + /// Get a handle on the `message_id` unique index on the table `puzzle_agent_message`. + pub fn message_id(&self) -> PuzzleAgentMessageMessageIdUnique<'ctx> { + PuzzleAgentMessageMessageIdUnique { + imp: self.imp.get_unique_constraint::("message_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> PuzzleAgentMessageMessageIdUnique<'ctx> { + /// Find the subscribed row whose `message_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("puzzle_agent_message"); + _table.add_unique_constraint::("message_id", |row| &row.message_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `PuzzleAgentMessageRow`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait puzzle_agent_messageQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `PuzzleAgentMessageRow`. + fn puzzle_agent_message(&self) -> __sdk::__query_builder::Table; +} + +impl puzzle_agent_messageQueryTableAccess for __sdk::QueryTableAccessor { + fn puzzle_agent_message(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("puzzle_agent_message") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_session_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_session_table.rs new file mode 100644 index 00000000..08c05360 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_session_table.rs @@ -0,0 +1,162 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::puzzle_agent_session_row_type::PuzzleAgentSessionRow; +use super::puzzle_agent_stage_type::PuzzleAgentStage; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `puzzle_agent_session`. +/// +/// Obtain a handle from the [`PuzzleAgentSessionTableAccess::puzzle_agent_session`] method on [`super::RemoteTables`], +/// like `ctx.db.puzzle_agent_session()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.puzzle_agent_session().on_insert(...)`. +pub struct PuzzleAgentSessionTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `puzzle_agent_session`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait PuzzleAgentSessionTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`PuzzleAgentSessionTableHandle`], which mediates access to the table `puzzle_agent_session`. + fn puzzle_agent_session(&self) -> PuzzleAgentSessionTableHandle<'_>; +} + +impl PuzzleAgentSessionTableAccess for super::RemoteTables { + fn puzzle_agent_session(&self) -> PuzzleAgentSessionTableHandle<'_> { + PuzzleAgentSessionTableHandle { + imp: self + .imp + .get_table::("puzzle_agent_session"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct PuzzleAgentSessionInsertCallbackId(__sdk::CallbackId); +pub struct PuzzleAgentSessionDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for PuzzleAgentSessionTableHandle<'ctx> { + type Row = PuzzleAgentSessionRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = PuzzleAgentSessionInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> PuzzleAgentSessionInsertCallbackId { + PuzzleAgentSessionInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: PuzzleAgentSessionInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = PuzzleAgentSessionDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> PuzzleAgentSessionDeleteCallbackId { + PuzzleAgentSessionDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: PuzzleAgentSessionDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct PuzzleAgentSessionUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for PuzzleAgentSessionTableHandle<'ctx> { + type UpdateCallbackId = PuzzleAgentSessionUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> PuzzleAgentSessionUpdateCallbackId { + PuzzleAgentSessionUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: PuzzleAgentSessionUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `session_id` unique index on the table `puzzle_agent_session`, +/// which allows point queries on the field of the same name +/// via the [`PuzzleAgentSessionSessionIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.puzzle_agent_session().session_id().find(...)`. +pub struct PuzzleAgentSessionSessionIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> PuzzleAgentSessionTableHandle<'ctx> { + /// Get a handle on the `session_id` unique index on the table `puzzle_agent_session`. + pub fn session_id(&self) -> PuzzleAgentSessionSessionIdUnique<'ctx> { + PuzzleAgentSessionSessionIdUnique { + imp: self.imp.get_unique_constraint::("session_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> PuzzleAgentSessionSessionIdUnique<'ctx> { + /// Find the subscribed row whose `session_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("puzzle_agent_session"); + _table.add_unique_constraint::("session_id", |row| &row.session_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `PuzzleAgentSessionRow`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait puzzle_agent_sessionQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `PuzzleAgentSessionRow`. + fn puzzle_agent_session(&self) -> __sdk::__query_builder::Table; +} + +impl puzzle_agent_sessionQueryTableAccess for __sdk::QueryTableAccessor { + fn puzzle_agent_session(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("puzzle_agent_session") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_leaderboard_entry_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_leaderboard_entry_table.rs new file mode 100644 index 00000000..808035f3 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_leaderboard_entry_table.rs @@ -0,0 +1,162 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::puzzle_leaderboard_entry_row_type::PuzzleLeaderboardEntryRow; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `puzzle_leaderboard_entry`. +/// +/// Obtain a handle from the [`PuzzleLeaderboardEntryTableAccess::puzzle_leaderboard_entry`] method on [`super::RemoteTables`], +/// like `ctx.db.puzzle_leaderboard_entry()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.puzzle_leaderboard_entry().on_insert(...)`. +pub struct PuzzleLeaderboardEntryTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `puzzle_leaderboard_entry`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait PuzzleLeaderboardEntryTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`PuzzleLeaderboardEntryTableHandle`], which mediates access to the table `puzzle_leaderboard_entry`. + fn puzzle_leaderboard_entry(&self) -> PuzzleLeaderboardEntryTableHandle<'_>; +} + +impl PuzzleLeaderboardEntryTableAccess for super::RemoteTables { + fn puzzle_leaderboard_entry(&self) -> PuzzleLeaderboardEntryTableHandle<'_> { + PuzzleLeaderboardEntryTableHandle { + imp: self + .imp + .get_table::("puzzle_leaderboard_entry"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct PuzzleLeaderboardEntryInsertCallbackId(__sdk::CallbackId); +pub struct PuzzleLeaderboardEntryDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for PuzzleLeaderboardEntryTableHandle<'ctx> { + type Row = PuzzleLeaderboardEntryRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = PuzzleLeaderboardEntryInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> PuzzleLeaderboardEntryInsertCallbackId { + PuzzleLeaderboardEntryInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: PuzzleLeaderboardEntryInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = PuzzleLeaderboardEntryDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> PuzzleLeaderboardEntryDeleteCallbackId { + PuzzleLeaderboardEntryDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: PuzzleLeaderboardEntryDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct PuzzleLeaderboardEntryUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for PuzzleLeaderboardEntryTableHandle<'ctx> { + type UpdateCallbackId = PuzzleLeaderboardEntryUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> PuzzleLeaderboardEntryUpdateCallbackId { + PuzzleLeaderboardEntryUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: PuzzleLeaderboardEntryUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `entry_id` unique index on the table `puzzle_leaderboard_entry`, +/// which allows point queries on the field of the same name +/// via the [`PuzzleLeaderboardEntryEntryIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.puzzle_leaderboard_entry().entry_id().find(...)`. +pub struct PuzzleLeaderboardEntryEntryIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> PuzzleLeaderboardEntryTableHandle<'ctx> { + /// Get a handle on the `entry_id` unique index on the table `puzzle_leaderboard_entry`. + pub fn entry_id(&self) -> PuzzleLeaderboardEntryEntryIdUnique<'ctx> { + PuzzleLeaderboardEntryEntryIdUnique { + imp: self.imp.get_unique_constraint::("entry_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> PuzzleLeaderboardEntryEntryIdUnique<'ctx> { + /// Find the subscribed row whose `entry_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = + client_cache.get_or_make_table::("puzzle_leaderboard_entry"); + _table.add_unique_constraint::("entry_id", |row| &row.entry_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `PuzzleLeaderboardEntryRow`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait puzzle_leaderboard_entryQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `PuzzleLeaderboardEntryRow`. + fn puzzle_leaderboard_entry(&self) -> __sdk::__query_builder::Table; +} + +impl puzzle_leaderboard_entryQueryTableAccess for __sdk::QueryTableAccessor { + fn puzzle_leaderboard_entry(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("puzzle_leaderboard_entry") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_runtime_run_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_runtime_run_table.rs new file mode 100644 index 00000000..1cd988cc --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_runtime_run_table.rs @@ -0,0 +1,161 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::puzzle_runtime_run_row_type::PuzzleRuntimeRunRow; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `puzzle_runtime_run`. +/// +/// Obtain a handle from the [`PuzzleRuntimeRunTableAccess::puzzle_runtime_run`] method on [`super::RemoteTables`], +/// like `ctx.db.puzzle_runtime_run()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.puzzle_runtime_run().on_insert(...)`. +pub struct PuzzleRuntimeRunTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `puzzle_runtime_run`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait PuzzleRuntimeRunTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`PuzzleRuntimeRunTableHandle`], which mediates access to the table `puzzle_runtime_run`. + fn puzzle_runtime_run(&self) -> PuzzleRuntimeRunTableHandle<'_>; +} + +impl PuzzleRuntimeRunTableAccess for super::RemoteTables { + fn puzzle_runtime_run(&self) -> PuzzleRuntimeRunTableHandle<'_> { + PuzzleRuntimeRunTableHandle { + imp: self + .imp + .get_table::("puzzle_runtime_run"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct PuzzleRuntimeRunInsertCallbackId(__sdk::CallbackId); +pub struct PuzzleRuntimeRunDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for PuzzleRuntimeRunTableHandle<'ctx> { + type Row = PuzzleRuntimeRunRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = PuzzleRuntimeRunInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> PuzzleRuntimeRunInsertCallbackId { + PuzzleRuntimeRunInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: PuzzleRuntimeRunInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = PuzzleRuntimeRunDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> PuzzleRuntimeRunDeleteCallbackId { + PuzzleRuntimeRunDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: PuzzleRuntimeRunDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct PuzzleRuntimeRunUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for PuzzleRuntimeRunTableHandle<'ctx> { + type UpdateCallbackId = PuzzleRuntimeRunUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> PuzzleRuntimeRunUpdateCallbackId { + PuzzleRuntimeRunUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: PuzzleRuntimeRunUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `run_id` unique index on the table `puzzle_runtime_run`, +/// which allows point queries on the field of the same name +/// via the [`PuzzleRuntimeRunRunIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.puzzle_runtime_run().run_id().find(...)`. +pub struct PuzzleRuntimeRunRunIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> PuzzleRuntimeRunTableHandle<'ctx> { + /// Get a handle on the `run_id` unique index on the table `puzzle_runtime_run`. + pub fn run_id(&self) -> PuzzleRuntimeRunRunIdUnique<'ctx> { + PuzzleRuntimeRunRunIdUnique { + imp: self.imp.get_unique_constraint::("run_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> PuzzleRuntimeRunRunIdUnique<'ctx> { + /// Find the subscribed row whose `run_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("puzzle_runtime_run"); + _table.add_unique_constraint::("run_id", |row| &row.run_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `PuzzleRuntimeRunRow`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait puzzle_runtime_runQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `PuzzleRuntimeRunRow`. + fn puzzle_runtime_run(&self) -> __sdk::__query_builder::Table; +} + +impl puzzle_runtime_runQueryTableAccess for __sdk::QueryTableAccessor { + fn puzzle_runtime_run(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("puzzle_runtime_run") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_work_profile_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_work_profile_table.rs new file mode 100644 index 00000000..673a9841 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_work_profile_table.rs @@ -0,0 +1,162 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::puzzle_publication_status_type::PuzzlePublicationStatus; +use super::puzzle_work_profile_row_type::PuzzleWorkProfileRow; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `puzzle_work_profile`. +/// +/// Obtain a handle from the [`PuzzleWorkProfileTableAccess::puzzle_work_profile`] method on [`super::RemoteTables`], +/// like `ctx.db.puzzle_work_profile()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.puzzle_work_profile().on_insert(...)`. +pub struct PuzzleWorkProfileTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `puzzle_work_profile`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait PuzzleWorkProfileTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`PuzzleWorkProfileTableHandle`], which mediates access to the table `puzzle_work_profile`. + fn puzzle_work_profile(&self) -> PuzzleWorkProfileTableHandle<'_>; +} + +impl PuzzleWorkProfileTableAccess for super::RemoteTables { + fn puzzle_work_profile(&self) -> PuzzleWorkProfileTableHandle<'_> { + PuzzleWorkProfileTableHandle { + imp: self + .imp + .get_table::("puzzle_work_profile"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct PuzzleWorkProfileInsertCallbackId(__sdk::CallbackId); +pub struct PuzzleWorkProfileDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for PuzzleWorkProfileTableHandle<'ctx> { + type Row = PuzzleWorkProfileRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = PuzzleWorkProfileInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> PuzzleWorkProfileInsertCallbackId { + PuzzleWorkProfileInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: PuzzleWorkProfileInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = PuzzleWorkProfileDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> PuzzleWorkProfileDeleteCallbackId { + PuzzleWorkProfileDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: PuzzleWorkProfileDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct PuzzleWorkProfileUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for PuzzleWorkProfileTableHandle<'ctx> { + type UpdateCallbackId = PuzzleWorkProfileUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> PuzzleWorkProfileUpdateCallbackId { + PuzzleWorkProfileUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: PuzzleWorkProfileUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `profile_id` unique index on the table `puzzle_work_profile`, +/// which allows point queries on the field of the same name +/// via the [`PuzzleWorkProfileProfileIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.puzzle_work_profile().profile_id().find(...)`. +pub struct PuzzleWorkProfileProfileIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> PuzzleWorkProfileTableHandle<'ctx> { + /// Get a handle on the `profile_id` unique index on the table `puzzle_work_profile`. + pub fn profile_id(&self) -> PuzzleWorkProfileProfileIdUnique<'ctx> { + PuzzleWorkProfileProfileIdUnique { + imp: self.imp.get_unique_constraint::("profile_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> PuzzleWorkProfileProfileIdUnique<'ctx> { + /// Find the subscribed row whose `profile_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("puzzle_work_profile"); + _table.add_unique_constraint::("profile_id", |row| &row.profile_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `PuzzleWorkProfileRow`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait puzzle_work_profileQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `PuzzleWorkProfileRow`. + fn puzzle_work_profile(&self) -> __sdk::__query_builder::Table; +} + +impl puzzle_work_profileQueryTableAccess for __sdk::QueryTableAccessor { + fn puzzle_work_profile(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("puzzle_work_profile") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/quest_log_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/quest_log_table.rs new file mode 100644 index 00000000..b1ac8c78 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/quest_log_table.rs @@ -0,0 +1,163 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::quest_log_event_kind_type::QuestLogEventKind; +use super::quest_log_type::QuestLog; +use super::quest_progress_signal_type::QuestProgressSignal; +use super::quest_signal_kind_type::QuestSignalKind; +use super::quest_status_type::QuestStatus; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `quest_log`. +/// +/// Obtain a handle from the [`QuestLogTableAccess::quest_log`] method on [`super::RemoteTables`], +/// like `ctx.db.quest_log()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.quest_log().on_insert(...)`. +pub struct QuestLogTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `quest_log`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait QuestLogTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`QuestLogTableHandle`], which mediates access to the table `quest_log`. + fn quest_log(&self) -> QuestLogTableHandle<'_>; +} + +impl QuestLogTableAccess for super::RemoteTables { + fn quest_log(&self) -> QuestLogTableHandle<'_> { + QuestLogTableHandle { + imp: self.imp.get_table::("quest_log"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct QuestLogInsertCallbackId(__sdk::CallbackId); +pub struct QuestLogDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for QuestLogTableHandle<'ctx> { + type Row = QuestLog; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = QuestLogInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> QuestLogInsertCallbackId { + QuestLogInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: QuestLogInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = QuestLogDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> QuestLogDeleteCallbackId { + QuestLogDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: QuestLogDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct QuestLogUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for QuestLogTableHandle<'ctx> { + type UpdateCallbackId = QuestLogUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> QuestLogUpdateCallbackId { + QuestLogUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: QuestLogUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `log_id` unique index on the table `quest_log`, +/// which allows point queries on the field of the same name +/// via the [`QuestLogLogIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.quest_log().log_id().find(...)`. +pub struct QuestLogLogIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> QuestLogTableHandle<'ctx> { + /// Get a handle on the `log_id` unique index on the table `quest_log`. + pub fn log_id(&self) -> QuestLogLogIdUnique<'ctx> { + QuestLogLogIdUnique { + imp: self.imp.get_unique_constraint::("log_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> QuestLogLogIdUnique<'ctx> { + /// Find the subscribed row whose `log_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("quest_log"); + _table.add_unique_constraint::("log_id", |row| &row.log_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `QuestLog`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait quest_logQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `QuestLog`. + fn quest_log(&self) -> __sdk::__query_builder::Table; +} + +impl quest_logQueryTableAccess for __sdk::QueryTableAccessor { + fn quest_log(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("quest_log") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/quest_record_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/quest_record_table.rs new file mode 100644 index 00000000..07e6e918 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/quest_record_table.rs @@ -0,0 +1,164 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::quest_narrative_binding_snapshot_type::QuestNarrativeBindingSnapshot; +use super::quest_objective_snapshot_type::QuestObjectiveSnapshot; +use super::quest_record_type::QuestRecord; +use super::quest_reward_snapshot_type::QuestRewardSnapshot; +use super::quest_status_type::QuestStatus; +use super::quest_step_snapshot_type::QuestStepSnapshot; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `quest_record`. +/// +/// Obtain a handle from the [`QuestRecordTableAccess::quest_record`] method on [`super::RemoteTables`], +/// like `ctx.db.quest_record()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.quest_record().on_insert(...)`. +pub struct QuestRecordTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `quest_record`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait QuestRecordTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`QuestRecordTableHandle`], which mediates access to the table `quest_record`. + fn quest_record(&self) -> QuestRecordTableHandle<'_>; +} + +impl QuestRecordTableAccess for super::RemoteTables { + fn quest_record(&self) -> QuestRecordTableHandle<'_> { + QuestRecordTableHandle { + imp: self.imp.get_table::("quest_record"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct QuestRecordInsertCallbackId(__sdk::CallbackId); +pub struct QuestRecordDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for QuestRecordTableHandle<'ctx> { + type Row = QuestRecord; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = QuestRecordInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> QuestRecordInsertCallbackId { + QuestRecordInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: QuestRecordInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = QuestRecordDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> QuestRecordDeleteCallbackId { + QuestRecordDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: QuestRecordDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct QuestRecordUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for QuestRecordTableHandle<'ctx> { + type UpdateCallbackId = QuestRecordUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> QuestRecordUpdateCallbackId { + QuestRecordUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: QuestRecordUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `quest_id` unique index on the table `quest_record`, +/// which allows point queries on the field of the same name +/// via the [`QuestRecordQuestIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.quest_record().quest_id().find(...)`. +pub struct QuestRecordQuestIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> QuestRecordTableHandle<'ctx> { + /// Get a handle on the `quest_id` unique index on the table `quest_record`. + pub fn quest_id(&self) -> QuestRecordQuestIdUnique<'ctx> { + QuestRecordQuestIdUnique { + imp: self.imp.get_unique_constraint::("quest_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> QuestRecordQuestIdUnique<'ctx> { + /// Find the subscribed row whose `quest_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("quest_record"); + _table.add_unique_constraint::("quest_id", |row| &row.quest_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `QuestRecord`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait quest_recordQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `QuestRecord`. + fn quest_record(&self) -> __sdk::__query_builder::Table; +} + +impl quest_recordQueryTableAccess for __sdk::QueryTableAccessor { + fn quest_record(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("quest_record") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/record_big_fish_like_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/record_big_fish_like_procedure.rs index 536aa47d..0429a9f7 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/record_big_fish_like_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/record_big_fish_like_procedure.rs @@ -31,10 +31,10 @@ pub trait record_big_fish_like { input: BigFishWorkLikeRecordInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl record_big_fish_like for super::RemoteProcedures { input: BigFishWorkLikeRecordInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, BigFishWorksProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/record_big_fish_play_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/record_big_fish_play_procedure.rs index 8cf35b2b..f4cfaa6b 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/record_big_fish_play_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/record_big_fish_play_procedure.rs @@ -31,10 +31,10 @@ pub trait record_big_fish_play { input: BigFishPlayRecordInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl record_big_fish_play for super::RemoteProcedures { input: BigFishPlayRecordInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, BigFishWorksProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/record_custom_world_profile_like_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/record_custom_world_profile_like_procedure.rs index 1cd0aaad..6ac81dd9 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/record_custom_world_profile_like_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/record_custom_world_profile_like_procedure.rs @@ -31,10 +31,10 @@ pub trait record_custom_world_profile_like { input: CustomWorldProfileLikeRecordInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl record_custom_world_profile_like for super::RemoteProcedures { input: CustomWorldProfileLikeRecordInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, CustomWorldLibraryMutationResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/record_custom_world_profile_play_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/record_custom_world_profile_play_procedure.rs index 2534ee30..f803e277 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/record_custom_world_profile_play_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/record_custom_world_profile_play_procedure.rs @@ -31,10 +31,10 @@ pub trait record_custom_world_profile_play { input: CustomWorldProfilePlayRecordInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl record_custom_world_profile_play for super::RemoteProcedures { input: CustomWorldProfilePlayRecordInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, CustomWorldLibraryMutationResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/record_puzzle_work_like_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/record_puzzle_work_like_procedure.rs index fa55cf09..78dce7f8 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/record_puzzle_work_like_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/record_puzzle_work_like_procedure.rs @@ -31,10 +31,10 @@ pub trait record_puzzle_work_like { input: PuzzleWorkLikeRecordInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl record_puzzle_work_like for super::RemoteProcedures { input: PuzzleWorkLikeRecordInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, PuzzleWorkProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/redeem_profile_referral_invite_code_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/redeem_profile_referral_invite_code_procedure.rs index efebd26a..44354acd 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/redeem_profile_referral_invite_code_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/redeem_profile_referral_invite_code_procedure.rs @@ -31,10 +31,10 @@ pub trait redeem_profile_referral_invite_code { input: RuntimeReferralRedeemInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl redeem_profile_referral_invite_code for super::RemoteProcedures { input: RuntimeReferralRedeemInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, RuntimeReferralRedeemProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/redeem_profile_reward_code_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/redeem_profile_reward_code_procedure.rs index 38fc64f5..4d048a49 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/redeem_profile_reward_code_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/redeem_profile_reward_code_procedure.rs @@ -31,10 +31,10 @@ pub trait redeem_profile_reward_code { input: RuntimeProfileRewardCodeRedeemInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl redeem_profile_reward_code for super::RemoteProcedures { input: RuntimeProfileRewardCodeRedeemInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, RuntimeProfileRewardCodeRedeemProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/refresh_session_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/refresh_session_table.rs new file mode 100644 index 00000000..cae67422 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/refresh_session_table.rs @@ -0,0 +1,159 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::refresh_session_type::RefreshSession; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `refresh_session`. +/// +/// Obtain a handle from the [`RefreshSessionTableAccess::refresh_session`] method on [`super::RemoteTables`], +/// like `ctx.db.refresh_session()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.refresh_session().on_insert(...)`. +pub struct RefreshSessionTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `refresh_session`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait RefreshSessionTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`RefreshSessionTableHandle`], which mediates access to the table `refresh_session`. + fn refresh_session(&self) -> RefreshSessionTableHandle<'_>; +} + +impl RefreshSessionTableAccess for super::RemoteTables { + fn refresh_session(&self) -> RefreshSessionTableHandle<'_> { + RefreshSessionTableHandle { + imp: self.imp.get_table::("refresh_session"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct RefreshSessionInsertCallbackId(__sdk::CallbackId); +pub struct RefreshSessionDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for RefreshSessionTableHandle<'ctx> { + type Row = RefreshSession; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = RefreshSessionInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> RefreshSessionInsertCallbackId { + RefreshSessionInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: RefreshSessionInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = RefreshSessionDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> RefreshSessionDeleteCallbackId { + RefreshSessionDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: RefreshSessionDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct RefreshSessionUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for RefreshSessionTableHandle<'ctx> { + type UpdateCallbackId = RefreshSessionUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> RefreshSessionUpdateCallbackId { + RefreshSessionUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: RefreshSessionUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `session_id` unique index on the table `refresh_session`, +/// which allows point queries on the field of the same name +/// via the [`RefreshSessionSessionIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.refresh_session().session_id().find(...)`. +pub struct RefreshSessionSessionIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> RefreshSessionTableHandle<'ctx> { + /// Get a handle on the `session_id` unique index on the table `refresh_session`. + pub fn session_id(&self) -> RefreshSessionSessionIdUnique<'ctx> { + RefreshSessionSessionIdUnique { + imp: self.imp.get_unique_constraint::("session_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> RefreshSessionSessionIdUnique<'ctx> { + /// Find the subscribed row whose `session_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("refresh_session"); + _table.add_unique_constraint::("session_id", |row| &row.session_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `RefreshSession`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait refresh_sessionQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `RefreshSession`. + fn refresh_session(&self) -> __sdk::__query_builder::Table; +} + +impl refresh_sessionQueryTableAccess for __sdk::QueryTableAccessor { + fn refresh_session(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("refresh_session") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/refund_profile_wallet_points_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/refund_profile_wallet_points_and_return_procedure.rs index a4bbd378..fb86172c 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/refund_profile_wallet_points_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/refund_profile_wallet_points_and_return_procedure.rs @@ -31,10 +31,10 @@ pub trait refund_profile_wallet_points_and_return { input: RuntimeProfileWalletAdjustmentInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl refund_profile_wallet_points_and_return for super::RemoteProcedures { input: RuntimeProfileWalletAdjustmentInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, RuntimeProfileWalletAdjustmentProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/remix_big_fish_work_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/remix_big_fish_work_procedure.rs index ff7d1486..7f58adb3 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/remix_big_fish_work_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/remix_big_fish_work_procedure.rs @@ -31,10 +31,10 @@ pub trait remix_big_fish_work { input: BigFishWorkRemixInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl remix_big_fish_work for super::RemoteProcedures { input: BigFishWorkRemixInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, BigFishSessionProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/remix_custom_world_profile_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/remix_custom_world_profile_procedure.rs index 8cd29b12..93f74383 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/remix_custom_world_profile_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/remix_custom_world_profile_procedure.rs @@ -31,10 +31,10 @@ pub trait remix_custom_world_profile { input: CustomWorldProfileRemixInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl remix_custom_world_profile for super::RemoteProcedures { input: CustomWorldProfileRemixInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, CustomWorldLibraryMutationResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/remix_puzzle_work_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/remix_puzzle_work_procedure.rs index d2548069..da91b334 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/remix_puzzle_work_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/remix_puzzle_work_procedure.rs @@ -31,10 +31,10 @@ pub trait remix_puzzle_work { input: PuzzleWorkRemixInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl remix_puzzle_work for super::RemoteProcedures { input: PuzzleWorkRemixInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, PuzzleAgentSessionProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/resolve_combat_action_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/resolve_combat_action_and_return_procedure.rs index 7d6fbfd1..ac8aa07d 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/resolve_combat_action_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/resolve_combat_action_and_return_procedure.rs @@ -31,10 +31,10 @@ pub trait resolve_combat_action_and_return { input: ResolveCombatActionInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl resolve_combat_action_and_return for super::RemoteProcedures { input: ResolveCombatActionInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, ResolveCombatActionProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/resolve_combat_action_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/resolve_combat_action_reducer.rs index 8398db8c..41340e2f 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/resolve_combat_action_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/resolve_combat_action_reducer.rs @@ -47,11 +47,9 @@ pub trait resolve_combat_action { &self, input: ResolveCombatActionInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()>; } @@ -60,11 +58,9 @@ impl resolve_combat_action for super::RemoteReducers { &self, input: ResolveCombatActionInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()> { self.imp .invoke_reducer_with_callback(ResolveCombatActionArgs { input }, callback) diff --git a/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_battle_interaction_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_battle_interaction_and_return_procedure.rs index 268483bf..ff4cca29 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_battle_interaction_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_battle_interaction_and_return_procedure.rs @@ -31,10 +31,10 @@ pub trait resolve_npc_battle_interaction_and_return { input: ResolveNpcBattleInteractionInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl resolve_npc_battle_interaction_and_return for super::RemoteProcedures { input: ResolveNpcBattleInteractionInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, NpcBattleInteractionProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_interaction_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_interaction_and_return_procedure.rs index 4604fc30..aaba3d9c 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_interaction_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_interaction_and_return_procedure.rs @@ -31,10 +31,10 @@ pub trait resolve_npc_interaction_and_return { input: ResolveNpcInteractionInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl resolve_npc_interaction_and_return for super::RemoteProcedures { input: ResolveNpcInteractionInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, NpcInteractionProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_interaction_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_interaction_reducer.rs index 352f5a93..52d213b5 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_interaction_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_interaction_reducer.rs @@ -47,11 +47,9 @@ pub trait resolve_npc_interaction { &self, input: ResolveNpcInteractionInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()>; } @@ -60,11 +58,9 @@ impl resolve_npc_interaction for super::RemoteReducers { &self, input: ResolveNpcInteractionInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()> { self.imp .invoke_reducer_with_callback(ResolveNpcInteractionArgs { input }, callback) diff --git a/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_social_action_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_social_action_and_return_procedure.rs index 65b1690e..c1425649 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_social_action_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_social_action_and_return_procedure.rs @@ -31,10 +31,10 @@ pub trait resolve_npc_social_action_and_return { input: ResolveNpcSocialActionInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl resolve_npc_social_action_and_return for super::RemoteProcedures { input: ResolveNpcSocialActionInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, NpcStateProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_social_action_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_social_action_reducer.rs index 9b326931..28e5ce36 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_social_action_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/resolve_npc_social_action_reducer.rs @@ -47,11 +47,9 @@ pub trait resolve_npc_social_action { &self, input: ResolveNpcSocialActionInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()>; } @@ -60,11 +58,9 @@ impl resolve_npc_social_action for super::RemoteReducers { &self, input: ResolveNpcSocialActionInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()> { self.imp .invoke_reducer_with_callback(ResolveNpcSocialActionArgs { input }, callback) diff --git a/server-rs/crates/spacetime-client/src/module_bindings/resolve_treasure_interaction_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/resolve_treasure_interaction_and_return_procedure.rs index 0b8f6bad..a224c122 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/resolve_treasure_interaction_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/resolve_treasure_interaction_and_return_procedure.rs @@ -31,10 +31,10 @@ pub trait resolve_treasure_interaction_and_return { input: TreasureResolveInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl resolve_treasure_interaction_and_return for super::RemoteProcedures { input: TreasureResolveInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, TreasureRecordProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/resolve_treasure_interaction_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/resolve_treasure_interaction_reducer.rs index 221ac39d..942b377a 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/resolve_treasure_interaction_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/resolve_treasure_interaction_reducer.rs @@ -47,11 +47,9 @@ pub trait resolve_treasure_interaction { &self, input: TreasureResolveInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()>; } @@ -60,11 +58,9 @@ impl resolve_treasure_interaction for super::RemoteReducers { &self, input: TreasureResolveInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()> { self.imp .invoke_reducer_with_callback(ResolveTreasureInteractionArgs { input }, callback) diff --git a/server-rs/crates/spacetime-client/src/module_bindings/restart_match_3_d_run_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/restart_match_3_d_run_procedure.rs index 76c74037..add954d4 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/restart_match_3_d_run_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/restart_match_3_d_run_procedure.rs @@ -31,10 +31,10 @@ pub trait restart_match_3_d_run { input: Match3DRunRestartInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl restart_match_3_d_run for super::RemoteProcedures { input: Match3DRunRestartInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, Match3DRunProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/resume_profile_save_archive_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/resume_profile_save_archive_and_return_procedure.rs index 73e6d668..957c105f 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/resume_profile_save_archive_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/resume_profile_save_archive_and_return_procedure.rs @@ -31,10 +31,10 @@ pub trait resume_profile_save_archive_and_return { input: RuntimeProfileSaveArchiveResumeInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl resume_profile_save_archive_and_return for super::RemoteProcedures { input: RuntimeProfileSaveArchiveResumeInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, RuntimeProfileSaveArchiveProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/revoke_database_migration_operator_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/revoke_database_migration_operator_procedure.rs index fe032926..feb5086e 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/revoke_database_migration_operator_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/revoke_database_migration_operator_procedure.rs @@ -31,10 +31,10 @@ pub trait revoke_database_migration_operator { input: DatabaseMigrationRevokeOperatorInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl revoke_database_migration_operator for super::RemoteProcedures { input: DatabaseMigrationRevokeOperatorInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, DatabaseMigrationOperatorProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_setting_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_setting_table.rs new file mode 100644 index 00000000..dc1ed5bb --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_setting_table.rs @@ -0,0 +1,160 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::runtime_platform_theme_type::RuntimePlatformTheme; +use super::runtime_setting_type::RuntimeSetting; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `runtime_setting`. +/// +/// Obtain a handle from the [`RuntimeSettingTableAccess::runtime_setting`] method on [`super::RemoteTables`], +/// like `ctx.db.runtime_setting()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.runtime_setting().on_insert(...)`. +pub struct RuntimeSettingTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `runtime_setting`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait RuntimeSettingTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`RuntimeSettingTableHandle`], which mediates access to the table `runtime_setting`. + fn runtime_setting(&self) -> RuntimeSettingTableHandle<'_>; +} + +impl RuntimeSettingTableAccess for super::RemoteTables { + fn runtime_setting(&self) -> RuntimeSettingTableHandle<'_> { + RuntimeSettingTableHandle { + imp: self.imp.get_table::("runtime_setting"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct RuntimeSettingInsertCallbackId(__sdk::CallbackId); +pub struct RuntimeSettingDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for RuntimeSettingTableHandle<'ctx> { + type Row = RuntimeSetting; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = RuntimeSettingInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> RuntimeSettingInsertCallbackId { + RuntimeSettingInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: RuntimeSettingInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = RuntimeSettingDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> RuntimeSettingDeleteCallbackId { + RuntimeSettingDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: RuntimeSettingDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct RuntimeSettingUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for RuntimeSettingTableHandle<'ctx> { + type UpdateCallbackId = RuntimeSettingUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> RuntimeSettingUpdateCallbackId { + RuntimeSettingUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: RuntimeSettingUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `user_id` unique index on the table `runtime_setting`, +/// which allows point queries on the field of the same name +/// via the [`RuntimeSettingUserIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.runtime_setting().user_id().find(...)`. +pub struct RuntimeSettingUserIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> RuntimeSettingTableHandle<'ctx> { + /// Get a handle on the `user_id` unique index on the table `runtime_setting`. + pub fn user_id(&self) -> RuntimeSettingUserIdUnique<'ctx> { + RuntimeSettingUserIdUnique { + imp: self.imp.get_unique_constraint::("user_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> RuntimeSettingUserIdUnique<'ctx> { + /// Find the subscribed row whose `user_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("runtime_setting"); + _table.add_unique_constraint::("user_id", |row| &row.user_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `RuntimeSetting`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait runtime_settingQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `RuntimeSetting`. + fn runtime_setting(&self) -> __sdk::__query_builder::Table; +} + +impl runtime_settingQueryTableAccess for __sdk::QueryTableAccessor { + fn runtime_setting(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("runtime_setting") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_snapshot_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_snapshot_table.rs new file mode 100644 index 00000000..9d105016 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_snapshot_table.rs @@ -0,0 +1,159 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::runtime_snapshot_row_type::RuntimeSnapshotRow; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `runtime_snapshot`. +/// +/// Obtain a handle from the [`RuntimeSnapshotTableAccess::runtime_snapshot`] method on [`super::RemoteTables`], +/// like `ctx.db.runtime_snapshot()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.runtime_snapshot().on_insert(...)`. +pub struct RuntimeSnapshotTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `runtime_snapshot`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait RuntimeSnapshotTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`RuntimeSnapshotTableHandle`], which mediates access to the table `runtime_snapshot`. + fn runtime_snapshot(&self) -> RuntimeSnapshotTableHandle<'_>; +} + +impl RuntimeSnapshotTableAccess for super::RemoteTables { + fn runtime_snapshot(&self) -> RuntimeSnapshotTableHandle<'_> { + RuntimeSnapshotTableHandle { + imp: self.imp.get_table::("runtime_snapshot"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct RuntimeSnapshotInsertCallbackId(__sdk::CallbackId); +pub struct RuntimeSnapshotDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for RuntimeSnapshotTableHandle<'ctx> { + type Row = RuntimeSnapshotRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = RuntimeSnapshotInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> RuntimeSnapshotInsertCallbackId { + RuntimeSnapshotInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: RuntimeSnapshotInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = RuntimeSnapshotDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> RuntimeSnapshotDeleteCallbackId { + RuntimeSnapshotDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: RuntimeSnapshotDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct RuntimeSnapshotUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for RuntimeSnapshotTableHandle<'ctx> { + type UpdateCallbackId = RuntimeSnapshotUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> RuntimeSnapshotUpdateCallbackId { + RuntimeSnapshotUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: RuntimeSnapshotUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `user_id` unique index on the table `runtime_snapshot`, +/// which allows point queries on the field of the same name +/// via the [`RuntimeSnapshotUserIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.runtime_snapshot().user_id().find(...)`. +pub struct RuntimeSnapshotUserIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> RuntimeSnapshotTableHandle<'ctx> { + /// Get a handle on the `user_id` unique index on the table `runtime_snapshot`. + pub fn user_id(&self) -> RuntimeSnapshotUserIdUnique<'ctx> { + RuntimeSnapshotUserIdUnique { + imp: self.imp.get_unique_constraint::("user_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> RuntimeSnapshotUserIdUnique<'ctx> { + /// Find the subscribed row whose `user_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("runtime_snapshot"); + _table.add_unique_constraint::("user_id", |row| &row.user_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `RuntimeSnapshotRow`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait runtime_snapshotQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `RuntimeSnapshotRow`. + fn runtime_snapshot(&self) -> __sdk::__query_builder::Table; +} + +impl runtime_snapshotQueryTableAccess for __sdk::QueryTableAccessor { + fn runtime_snapshot(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("runtime_snapshot") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/save_puzzle_form_draft_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/save_puzzle_form_draft_procedure.rs index 13aff9a3..bd13cb5f 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/save_puzzle_form_draft_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/save_puzzle_form_draft_procedure.rs @@ -31,10 +31,10 @@ pub trait save_puzzle_form_draft { input: PuzzleFormDraftSaveInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl save_puzzle_form_draft for super::RemoteProcedures { input: PuzzleFormDraftSaveInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, PuzzleAgentSessionProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/save_puzzle_generated_images_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/save_puzzle_generated_images_procedure.rs index 870d6d51..85d17456 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/save_puzzle_generated_images_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/save_puzzle_generated_images_procedure.rs @@ -31,10 +31,10 @@ pub trait save_puzzle_generated_images { input: PuzzleGeneratedImagesSaveInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl save_puzzle_generated_images for super::RemoteProcedures { input: PuzzleGeneratedImagesSaveInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, PuzzleAgentSessionProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/seed_analytics_date_dimensions_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/seed_analytics_date_dimensions_reducer.rs new file mode 100644 index 00000000..6e2ac3ad --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/seed_analytics_date_dimensions_reducer.rs @@ -0,0 +1,71 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +use super::analytics_date_dimension_seed_input_type::AnalyticsDateDimensionSeedInput; + +#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)] +#[sats(crate = __lib)] +pub(super) struct SeedAnalyticsDateDimensionsArgs { + pub input: AnalyticsDateDimensionSeedInput, +} + +impl From for super::Reducer { + fn from(args: SeedAnalyticsDateDimensionsArgs) -> Self { + Self::SeedAnalyticsDateDimensions { input: args.input } + } +} + +impl __sdk::InModule for SeedAnalyticsDateDimensionsArgs { + type Module = super::RemoteModule; +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the reducer `seed_analytics_date_dimensions`. +/// +/// Implemented for [`super::RemoteReducers`]. +pub trait seed_analytics_date_dimensions { + /// Request that the remote module invoke the reducer `seed_analytics_date_dimensions` to run as soon as possible. + /// + /// This method returns immediately, and errors only if we are unable to send the request. + /// The reducer will run asynchronously in the future, + /// and this method provides no way to listen for its completion status. + /// /// Use [`seed_analytics_date_dimensions:seed_analytics_date_dimensions_then`] to run a callback after the reducer completes. + fn seed_analytics_date_dimensions( + &self, + input: AnalyticsDateDimensionSeedInput, + ) -> __sdk::Result<()> { + self.seed_analytics_date_dimensions_then(input, |_, _| {}) + } + + /// Request that the remote module invoke the reducer `seed_analytics_date_dimensions` to run as soon as possible, + /// registering `callback` to run when we are notified that the reducer completed. + /// + /// This method returns immediately, and errors only if we are unable to send the request. + /// The reducer will run asynchronously in the future, + /// and its status can be observed with the `callback`. + fn seed_analytics_date_dimensions_then( + &self, + input: AnalyticsDateDimensionSeedInput, + + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, + ) -> __sdk::Result<()>; +} + +impl seed_analytics_date_dimensions for super::RemoteReducers { + fn seed_analytics_date_dimensions_then( + &self, + input: AnalyticsDateDimensionSeedInput, + + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, + ) -> __sdk::Result<()> { + self.imp + .invoke_reducer_with_callback(SeedAnalyticsDateDimensionsArgs { input }, callback) + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/select_puzzle_cover_image_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/select_puzzle_cover_image_procedure.rs index fd4dd93c..9dde8aaa 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/select_puzzle_cover_image_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/select_puzzle_cover_image_procedure.rs @@ -31,10 +31,10 @@ pub trait select_puzzle_cover_image { input: PuzzleSelectCoverImageInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl select_puzzle_cover_image for super::RemoteProcedures { input: PuzzleSelectCoverImageInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, PuzzleAgentSessionProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/start_ai_task_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/start_ai_task_reducer.rs index c5cc5256..5809736b 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/start_ai_task_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/start_ai_task_reducer.rs @@ -47,11 +47,9 @@ pub trait start_ai_task { &self, input: AiTaskStartInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()>; } @@ -60,11 +58,9 @@ impl start_ai_task for super::RemoteReducers { &self, input: AiTaskStartInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()> { self.imp .invoke_reducer_with_callback(StartAiTaskArgs { input }, callback) diff --git a/server-rs/crates/spacetime-client/src/module_bindings/start_ai_task_stage_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/start_ai_task_stage_reducer.rs index 24ed5b3f..1d7b7582 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/start_ai_task_stage_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/start_ai_task_stage_reducer.rs @@ -47,11 +47,9 @@ pub trait start_ai_task_stage { &self, input: AiTaskStageStartInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()>; } @@ -60,11 +58,9 @@ impl start_ai_task_stage for super::RemoteReducers { &self, input: AiTaskStageStartInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()> { self.imp .invoke_reducer_with_callback(StartAiTaskStageArgs { input }, callback) diff --git a/server-rs/crates/spacetime-client/src/module_bindings/start_big_fish_run_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/start_big_fish_run_procedure.rs index 6a149f03..7f3713ab 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/start_big_fish_run_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/start_big_fish_run_procedure.rs @@ -31,10 +31,10 @@ pub trait start_big_fish_run { input: BigFishRunStartInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl start_big_fish_run for super::RemoteProcedures { input: BigFishRunStartInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, BigFishRunProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/start_match_3_d_run_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/start_match_3_d_run_procedure.rs index c0a8c8a9..d4126af9 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/start_match_3_d_run_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/start_match_3_d_run_procedure.rs @@ -31,10 +31,10 @@ pub trait start_match_3_d_run { input: Match3DRunStartInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl start_match_3_d_run for super::RemoteProcedures { input: Match3DRunStartInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, Match3DRunProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/start_puzzle_run_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/start_puzzle_run_procedure.rs index c3d6d457..b6baeb83 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/start_puzzle_run_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/start_puzzle_run_procedure.rs @@ -31,10 +31,10 @@ pub trait start_puzzle_run { input: PuzzleRunStartInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl start_puzzle_run for super::RemoteProcedures { input: PuzzleRunStartInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, PuzzleRunProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/stop_match_3_d_run_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/stop_match_3_d_run_procedure.rs index 630e7a98..f87a63d5 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/stop_match_3_d_run_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/stop_match_3_d_run_procedure.rs @@ -31,10 +31,10 @@ pub trait stop_match_3_d_run { input: Match3DRunStopInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl stop_match_3_d_run for super::RemoteProcedures { input: Match3DRunStopInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, Match3DRunProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/story_event_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/story_event_table.rs new file mode 100644 index 00000000..232a554e --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/story_event_table.rs @@ -0,0 +1,160 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::story_event_kind_type::StoryEventKind; +use super::story_event_type::StoryEvent; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `story_event`. +/// +/// Obtain a handle from the [`StoryEventTableAccess::story_event`] method on [`super::RemoteTables`], +/// like `ctx.db.story_event()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.story_event().on_insert(...)`. +pub struct StoryEventTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `story_event`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait StoryEventTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`StoryEventTableHandle`], which mediates access to the table `story_event`. + fn story_event(&self) -> StoryEventTableHandle<'_>; +} + +impl StoryEventTableAccess for super::RemoteTables { + fn story_event(&self) -> StoryEventTableHandle<'_> { + StoryEventTableHandle { + imp: self.imp.get_table::("story_event"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct StoryEventInsertCallbackId(__sdk::CallbackId); +pub struct StoryEventDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for StoryEventTableHandle<'ctx> { + type Row = StoryEvent; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = StoryEventInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> StoryEventInsertCallbackId { + StoryEventInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: StoryEventInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = StoryEventDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> StoryEventDeleteCallbackId { + StoryEventDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: StoryEventDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct StoryEventUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for StoryEventTableHandle<'ctx> { + type UpdateCallbackId = StoryEventUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> StoryEventUpdateCallbackId { + StoryEventUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: StoryEventUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `event_id` unique index on the table `story_event`, +/// which allows point queries on the field of the same name +/// via the [`StoryEventEventIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.story_event().event_id().find(...)`. +pub struct StoryEventEventIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> StoryEventTableHandle<'ctx> { + /// Get a handle on the `event_id` unique index on the table `story_event`. + pub fn event_id(&self) -> StoryEventEventIdUnique<'ctx> { + StoryEventEventIdUnique { + imp: self.imp.get_unique_constraint::("event_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> StoryEventEventIdUnique<'ctx> { + /// Find the subscribed row whose `event_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("story_event"); + _table.add_unique_constraint::("event_id", |row| &row.event_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `StoryEvent`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait story_eventQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `StoryEvent`. + fn story_event(&self) -> __sdk::__query_builder::Table; +} + +impl story_eventQueryTableAccess for __sdk::QueryTableAccessor { + fn story_event(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("story_event") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/story_session_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/story_session_table.rs new file mode 100644 index 00000000..142f7fa1 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/story_session_table.rs @@ -0,0 +1,160 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::story_session_status_type::StorySessionStatus; +use super::story_session_type::StorySession; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `story_session`. +/// +/// Obtain a handle from the [`StorySessionTableAccess::story_session`] method on [`super::RemoteTables`], +/// like `ctx.db.story_session()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.story_session().on_insert(...)`. +pub struct StorySessionTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `story_session`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait StorySessionTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`StorySessionTableHandle`], which mediates access to the table `story_session`. + fn story_session(&self) -> StorySessionTableHandle<'_>; +} + +impl StorySessionTableAccess for super::RemoteTables { + fn story_session(&self) -> StorySessionTableHandle<'_> { + StorySessionTableHandle { + imp: self.imp.get_table::("story_session"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct StorySessionInsertCallbackId(__sdk::CallbackId); +pub struct StorySessionDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for StorySessionTableHandle<'ctx> { + type Row = StorySession; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = StorySessionInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> StorySessionInsertCallbackId { + StorySessionInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: StorySessionInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = StorySessionDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> StorySessionDeleteCallbackId { + StorySessionDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: StorySessionDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct StorySessionUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for StorySessionTableHandle<'ctx> { + type UpdateCallbackId = StorySessionUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> StorySessionUpdateCallbackId { + StorySessionUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: StorySessionUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `story_session_id` unique index on the table `story_session`, +/// which allows point queries on the field of the same name +/// via the [`StorySessionStorySessionIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.story_session().story_session_id().find(...)`. +pub struct StorySessionStorySessionIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> StorySessionTableHandle<'ctx> { + /// Get a handle on the `story_session_id` unique index on the table `story_session`. + pub fn story_session_id(&self) -> StorySessionStorySessionIdUnique<'ctx> { + StorySessionStorySessionIdUnique { + imp: self.imp.get_unique_constraint::("story_session_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> StorySessionStorySessionIdUnique<'ctx> { + /// Find the subscribed row whose `story_session_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("story_session"); + _table.add_unique_constraint::("story_session_id", |row| &row.story_session_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `StorySession`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait story_sessionQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `StorySession`. + fn story_session(&self) -> __sdk::__query_builder::Table; +} + +impl story_sessionQueryTableAccess for __sdk::QueryTableAccessor { + fn story_session(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("story_session") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/submit_big_fish_input_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/submit_big_fish_input_procedure.rs index e5bbe6b0..8ef444c5 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/submit_big_fish_input_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/submit_big_fish_input_procedure.rs @@ -31,10 +31,10 @@ pub trait submit_big_fish_input { input: BigFishInputSubmitInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl submit_big_fish_input for super::RemoteProcedures { input: BigFishInputSubmitInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, BigFishRunProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/submit_big_fish_message_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/submit_big_fish_message_procedure.rs index 307d7755..0dbc0118 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/submit_big_fish_message_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/submit_big_fish_message_procedure.rs @@ -31,10 +31,10 @@ pub trait submit_big_fish_message { input: BigFishMessageSubmitInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl submit_big_fish_message for super::RemoteProcedures { input: BigFishMessageSubmitInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, BigFishSessionProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/submit_custom_world_agent_message_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/submit_custom_world_agent_message_procedure.rs index 5debac19..c5e8def1 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/submit_custom_world_agent_message_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/submit_custom_world_agent_message_procedure.rs @@ -31,10 +31,10 @@ pub trait submit_custom_world_agent_message { input: CustomWorldAgentMessageSubmitInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl submit_custom_world_agent_message for super::RemoteProcedures { input: CustomWorldAgentMessageSubmitInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, CustomWorldAgentOperationProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/submit_match_3_d_agent_message_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/submit_match_3_d_agent_message_procedure.rs index c323ecda..1ceceaf5 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/submit_match_3_d_agent_message_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/submit_match_3_d_agent_message_procedure.rs @@ -31,10 +31,10 @@ pub trait submit_match_3_d_agent_message { input: Match3DAgentMessageSubmitInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl submit_match_3_d_agent_message for super::RemoteProcedures { input: Match3DAgentMessageSubmitInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, Match3DAgentSessionProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/submit_puzzle_agent_message_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/submit_puzzle_agent_message_procedure.rs index 0d9e94e5..b5b2b090 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/submit_puzzle_agent_message_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/submit_puzzle_agent_message_procedure.rs @@ -31,10 +31,10 @@ pub trait submit_puzzle_agent_message { input: PuzzleAgentMessageSubmitInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl submit_puzzle_agent_message for super::RemoteProcedures { input: PuzzleAgentMessageSubmitInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, PuzzleAgentSessionProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/submit_puzzle_leaderboard_entry_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/submit_puzzle_leaderboard_entry_procedure.rs index 9f72a916..7df24564 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/submit_puzzle_leaderboard_entry_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/submit_puzzle_leaderboard_entry_procedure.rs @@ -31,10 +31,10 @@ pub trait submit_puzzle_leaderboard_entry { input: PuzzleLeaderboardSubmitInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl submit_puzzle_leaderboard_entry for super::RemoteProcedures { input: PuzzleLeaderboardSubmitInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, PuzzleRunProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/swap_puzzle_pieces_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/swap_puzzle_pieces_procedure.rs index f5835607..9c6a1337 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/swap_puzzle_pieces_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/swap_puzzle_pieces_procedure.rs @@ -31,10 +31,10 @@ pub trait swap_puzzle_pieces { input: PuzzleRunSwapInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl swap_puzzle_pieces for super::RemoteProcedures { input: PuzzleRunSwapInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, PuzzleRunProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/tracking_daily_stat_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/tracking_daily_stat_table.rs new file mode 100644 index 00000000..b86a1893 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/tracking_daily_stat_table.rs @@ -0,0 +1,162 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::runtime_tracking_scope_kind_type::RuntimeTrackingScopeKind; +use super::tracking_daily_stat_type::TrackingDailyStat; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `tracking_daily_stat`. +/// +/// Obtain a handle from the [`TrackingDailyStatTableAccess::tracking_daily_stat`] method on [`super::RemoteTables`], +/// like `ctx.db.tracking_daily_stat()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.tracking_daily_stat().on_insert(...)`. +pub struct TrackingDailyStatTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `tracking_daily_stat`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait TrackingDailyStatTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`TrackingDailyStatTableHandle`], which mediates access to the table `tracking_daily_stat`. + fn tracking_daily_stat(&self) -> TrackingDailyStatTableHandle<'_>; +} + +impl TrackingDailyStatTableAccess for super::RemoteTables { + fn tracking_daily_stat(&self) -> TrackingDailyStatTableHandle<'_> { + TrackingDailyStatTableHandle { + imp: self + .imp + .get_table::("tracking_daily_stat"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct TrackingDailyStatInsertCallbackId(__sdk::CallbackId); +pub struct TrackingDailyStatDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for TrackingDailyStatTableHandle<'ctx> { + type Row = TrackingDailyStat; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = TrackingDailyStatInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> TrackingDailyStatInsertCallbackId { + TrackingDailyStatInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: TrackingDailyStatInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = TrackingDailyStatDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> TrackingDailyStatDeleteCallbackId { + TrackingDailyStatDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: TrackingDailyStatDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct TrackingDailyStatUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for TrackingDailyStatTableHandle<'ctx> { + type UpdateCallbackId = TrackingDailyStatUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> TrackingDailyStatUpdateCallbackId { + TrackingDailyStatUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: TrackingDailyStatUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `stat_id` unique index on the table `tracking_daily_stat`, +/// which allows point queries on the field of the same name +/// via the [`TrackingDailyStatStatIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.tracking_daily_stat().stat_id().find(...)`. +pub struct TrackingDailyStatStatIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> TrackingDailyStatTableHandle<'ctx> { + /// Get a handle on the `stat_id` unique index on the table `tracking_daily_stat`. + pub fn stat_id(&self) -> TrackingDailyStatStatIdUnique<'ctx> { + TrackingDailyStatStatIdUnique { + imp: self.imp.get_unique_constraint::("stat_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> TrackingDailyStatStatIdUnique<'ctx> { + /// Find the subscribed row whose `stat_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("tracking_daily_stat"); + _table.add_unique_constraint::("stat_id", |row| &row.stat_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `TrackingDailyStat`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait tracking_daily_statQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `TrackingDailyStat`. + fn tracking_daily_stat(&self) -> __sdk::__query_builder::Table; +} + +impl tracking_daily_statQueryTableAccess for __sdk::QueryTableAccessor { + fn tracking_daily_stat(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("tracking_daily_stat") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/tracking_event_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/tracking_event_table.rs new file mode 100644 index 00000000..0a48f1fb --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/tracking_event_table.rs @@ -0,0 +1,160 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::runtime_tracking_scope_kind_type::RuntimeTrackingScopeKind; +use super::tracking_event_type::TrackingEvent; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `tracking_event`. +/// +/// Obtain a handle from the [`TrackingEventTableAccess::tracking_event`] method on [`super::RemoteTables`], +/// like `ctx.db.tracking_event()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.tracking_event().on_insert(...)`. +pub struct TrackingEventTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `tracking_event`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait TrackingEventTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`TrackingEventTableHandle`], which mediates access to the table `tracking_event`. + fn tracking_event(&self) -> TrackingEventTableHandle<'_>; +} + +impl TrackingEventTableAccess for super::RemoteTables { + fn tracking_event(&self) -> TrackingEventTableHandle<'_> { + TrackingEventTableHandle { + imp: self.imp.get_table::("tracking_event"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct TrackingEventInsertCallbackId(__sdk::CallbackId); +pub struct TrackingEventDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for TrackingEventTableHandle<'ctx> { + type Row = TrackingEvent; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = TrackingEventInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> TrackingEventInsertCallbackId { + TrackingEventInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: TrackingEventInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = TrackingEventDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> TrackingEventDeleteCallbackId { + TrackingEventDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: TrackingEventDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct TrackingEventUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for TrackingEventTableHandle<'ctx> { + type UpdateCallbackId = TrackingEventUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> TrackingEventUpdateCallbackId { + TrackingEventUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: TrackingEventUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `event_id` unique index on the table `tracking_event`, +/// which allows point queries on the field of the same name +/// via the [`TrackingEventEventIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.tracking_event().event_id().find(...)`. +pub struct TrackingEventEventIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> TrackingEventTableHandle<'ctx> { + /// Get a handle on the `event_id` unique index on the table `tracking_event`. + pub fn event_id(&self) -> TrackingEventEventIdUnique<'ctx> { + TrackingEventEventIdUnique { + imp: self.imp.get_unique_constraint::("event_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> TrackingEventEventIdUnique<'ctx> { + /// Find the subscribed row whose `event_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("tracking_event"); + _table.add_unique_constraint::("event_id", |row| &row.event_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `TrackingEvent`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait tracking_eventQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `TrackingEvent`. + fn tracking_event(&self) -> __sdk::__query_builder::Table; +} + +impl tracking_eventQueryTableAccess for __sdk::QueryTableAccessor { + fn tracking_event(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("tracking_event") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/treasure_record_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/treasure_record_table.rs new file mode 100644 index 00000000..927e3256 --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/treasure_record_table.rs @@ -0,0 +1,163 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::runtime_item_reward_item_snapshot_type::RuntimeItemRewardItemSnapshot; +use super::treasure_interaction_action_type::TreasureInteractionAction; +use super::treasure_record_type::TreasureRecord; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `treasure_record`. +/// +/// Obtain a handle from the [`TreasureRecordTableAccess::treasure_record`] method on [`super::RemoteTables`], +/// like `ctx.db.treasure_record()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.treasure_record().on_insert(...)`. +pub struct TreasureRecordTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `treasure_record`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait TreasureRecordTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`TreasureRecordTableHandle`], which mediates access to the table `treasure_record`. + fn treasure_record(&self) -> TreasureRecordTableHandle<'_>; +} + +impl TreasureRecordTableAccess for super::RemoteTables { + fn treasure_record(&self) -> TreasureRecordTableHandle<'_> { + TreasureRecordTableHandle { + imp: self.imp.get_table::("treasure_record"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct TreasureRecordInsertCallbackId(__sdk::CallbackId); +pub struct TreasureRecordDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for TreasureRecordTableHandle<'ctx> { + type Row = TreasureRecord; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = TreasureRecordInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> TreasureRecordInsertCallbackId { + TreasureRecordInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: TreasureRecordInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = TreasureRecordDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> TreasureRecordDeleteCallbackId { + TreasureRecordDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: TreasureRecordDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct TreasureRecordUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for TreasureRecordTableHandle<'ctx> { + type UpdateCallbackId = TreasureRecordUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> TreasureRecordUpdateCallbackId { + TreasureRecordUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: TreasureRecordUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `treasure_record_id` unique index on the table `treasure_record`, +/// which allows point queries on the field of the same name +/// via the [`TreasureRecordTreasureRecordIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.treasure_record().treasure_record_id().find(...)`. +pub struct TreasureRecordTreasureRecordIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> TreasureRecordTableHandle<'ctx> { + /// Get a handle on the `treasure_record_id` unique index on the table `treasure_record`. + pub fn treasure_record_id(&self) -> TreasureRecordTreasureRecordIdUnique<'ctx> { + TreasureRecordTreasureRecordIdUnique { + imp: self + .imp + .get_unique_constraint::("treasure_record_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> TreasureRecordTreasureRecordIdUnique<'ctx> { + /// Find the subscribed row whose `treasure_record_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("treasure_record"); + _table.add_unique_constraint::("treasure_record_id", |row| &row.treasure_record_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `TreasureRecord`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait treasure_recordQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `TreasureRecord`. + fn treasure_record(&self) -> __sdk::__query_builder::Table; +} + +impl treasure_recordQueryTableAccess for __sdk::QueryTableAccessor { + fn treasure_record(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("treasure_record") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/turn_in_quest_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/turn_in_quest_reducer.rs index 08727f04..4306a47f 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/turn_in_quest_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/turn_in_quest_reducer.rs @@ -47,11 +47,9 @@ pub trait turn_in_quest { &self, input: QuestTurnInInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()>; } @@ -60,11 +58,9 @@ impl turn_in_quest for super::RemoteReducers { &self, input: QuestTurnInInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()> { self.imp .invoke_reducer_with_callback(TurnInQuestArgs { input }, callback) diff --git a/server-rs/crates/spacetime-client/src/module_bindings/unpublish_custom_world_profile_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/unpublish_custom_world_profile_and_return_procedure.rs index 31acccce..b87880a7 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/unpublish_custom_world_profile_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/unpublish_custom_world_profile_and_return_procedure.rs @@ -31,10 +31,10 @@ pub trait unpublish_custom_world_profile_and_return { input: CustomWorldProfileUnpublishInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl unpublish_custom_world_profile_and_return for super::RemoteProcedures { input: CustomWorldProfileUnpublishInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, CustomWorldLibraryMutationResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/unpublish_custom_world_profile_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/unpublish_custom_world_profile_reducer.rs index 51af927f..05274f62 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/unpublish_custom_world_profile_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/unpublish_custom_world_profile_reducer.rs @@ -50,11 +50,9 @@ pub trait unpublish_custom_world_profile { &self, input: CustomWorldProfileUnpublishInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()>; } @@ -63,11 +61,9 @@ impl unpublish_custom_world_profile for super::RemoteReducers { &self, input: CustomWorldProfileUnpublishInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()> { self.imp .invoke_reducer_with_callback(UnpublishCustomWorldProfileArgs { input }, callback) diff --git a/server-rs/crates/spacetime-client/src/module_bindings/update_match_3_d_work_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/update_match_3_d_work_procedure.rs index cdc42782..ea2ee9b4 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/update_match_3_d_work_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/update_match_3_d_work_procedure.rs @@ -31,10 +31,10 @@ pub trait update_match_3_d_work { input: Match3DWorkUpdateInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl update_match_3_d_work for super::RemoteProcedures { input: Match3DWorkUpdateInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, Match3DWorkProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/update_puzzle_run_pause_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/update_puzzle_run_pause_procedure.rs index 3388380c..1679b5ec 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/update_puzzle_run_pause_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/update_puzzle_run_pause_procedure.rs @@ -31,10 +31,10 @@ pub trait update_puzzle_run_pause { input: PuzzleRunPauseInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl update_puzzle_run_pause for super::RemoteProcedures { input: PuzzleRunPauseInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, PuzzleRunProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/update_puzzle_work_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/update_puzzle_work_procedure.rs index 80571241..6710b4da 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/update_puzzle_work_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/update_puzzle_work_procedure.rs @@ -31,10 +31,10 @@ pub trait update_puzzle_work { input: PuzzleWorkUpsertInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl update_puzzle_work for super::RemoteProcedures { input: PuzzleWorkUpsertInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, PuzzleWorkProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/upsert_auth_store_snapshot_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/upsert_auth_store_snapshot_procedure.rs index 5d4da3cb..31460874 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/upsert_auth_store_snapshot_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/upsert_auth_store_snapshot_procedure.rs @@ -31,10 +31,10 @@ pub trait upsert_auth_store_snapshot { input: AuthStoreSnapshotUpsertInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl upsert_auth_store_snapshot for super::RemoteProcedures { input: AuthStoreSnapshotUpsertInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, AuthStoreSnapshotProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/upsert_chapter_progression_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/upsert_chapter_progression_and_return_procedure.rs index be3ff473..abc39bfe 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/upsert_chapter_progression_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/upsert_chapter_progression_and_return_procedure.rs @@ -31,10 +31,10 @@ pub trait upsert_chapter_progression_and_return { input: ChapterProgressionInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl upsert_chapter_progression_and_return for super::RemoteProcedures { input: ChapterProgressionInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, ChapterProgressionProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/upsert_chapter_progression_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/upsert_chapter_progression_reducer.rs index de37e994..0cb4bb7a 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/upsert_chapter_progression_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/upsert_chapter_progression_reducer.rs @@ -47,11 +47,9 @@ pub trait upsert_chapter_progression { &self, input: ChapterProgressionInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()>; } @@ -60,11 +58,9 @@ impl upsert_chapter_progression for super::RemoteReducers { &self, input: ChapterProgressionInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()> { self.imp .invoke_reducer_with_callback(UpsertChapterProgressionArgs { input }, callback) diff --git a/server-rs/crates/spacetime-client/src/module_bindings/upsert_custom_world_agent_operation_progress_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/upsert_custom_world_agent_operation_progress_procedure.rs index 6d8e39a2..554b95b2 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/upsert_custom_world_agent_operation_progress_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/upsert_custom_world_agent_operation_progress_procedure.rs @@ -34,10 +34,10 @@ pub trait upsert_custom_world_agent_operation_progress { input: CustomWorldAgentOperationProgressInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -47,10 +47,10 @@ impl upsert_custom_world_agent_operation_progress for super::RemoteProcedures { input: CustomWorldAgentOperationProgressInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, CustomWorldAgentOperationProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/upsert_custom_world_profile_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/upsert_custom_world_profile_and_return_procedure.rs index a761ab95..343e1807 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/upsert_custom_world_profile_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/upsert_custom_world_profile_and_return_procedure.rs @@ -31,10 +31,10 @@ pub trait upsert_custom_world_profile_and_return { input: CustomWorldProfileUpsertInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl upsert_custom_world_profile_and_return for super::RemoteProcedures { input: CustomWorldProfileUpsertInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, CustomWorldLibraryMutationResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/upsert_custom_world_profile_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/upsert_custom_world_profile_reducer.rs index 91ca2652..e343b491 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/upsert_custom_world_profile_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/upsert_custom_world_profile_reducer.rs @@ -50,11 +50,9 @@ pub trait upsert_custom_world_profile { &self, input: CustomWorldProfileUpsertInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()>; } @@ -63,11 +61,9 @@ impl upsert_custom_world_profile for super::RemoteReducers { &self, input: CustomWorldProfileUpsertInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()> { self.imp .invoke_reducer_with_callback(UpsertCustomWorldProfileArgs { input }, callback) diff --git a/server-rs/crates/spacetime-client/src/module_bindings/upsert_npc_state_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/upsert_npc_state_and_return_procedure.rs index 91ba0d0e..b7f3a28d 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/upsert_npc_state_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/upsert_npc_state_and_return_procedure.rs @@ -31,10 +31,10 @@ pub trait upsert_npc_state_and_return { input: NpcStateUpsertInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl upsert_npc_state_and_return for super::RemoteProcedures { input: NpcStateUpsertInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, NpcStateProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/upsert_npc_state_reducer.rs b/server-rs/crates/spacetime-client/src/module_bindings/upsert_npc_state_reducer.rs index afbe61f8..f363770d 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/upsert_npc_state_reducer.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/upsert_npc_state_reducer.rs @@ -47,11 +47,9 @@ pub trait upsert_npc_state { &self, input: NpcStateUpsertInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()>; } @@ -60,11 +58,9 @@ impl upsert_npc_state for super::RemoteReducers { &self, input: NpcStateUpsertInput, - callback: impl FnOnce( - &super::ReducerEventContext, - Result, __sdk::InternalError>, - ) + Send - + 'static, + callback: impl FnOnce(&super::ReducerEventContext, Result, __sdk::InternalError>) + + Send + + 'static, ) -> __sdk::Result<()> { self.imp .invoke_reducer_with_callback(UpsertNpcStateArgs { input }, callback) diff --git a/server-rs/crates/spacetime-client/src/module_bindings/upsert_platform_browse_history_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/upsert_platform_browse_history_and_return_procedure.rs index 36e5f464..614a6d05 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/upsert_platform_browse_history_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/upsert_platform_browse_history_and_return_procedure.rs @@ -31,10 +31,10 @@ pub trait upsert_platform_browse_history_and_return { input: RuntimeBrowseHistorySyncInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl upsert_platform_browse_history_and_return for super::RemoteProcedures { input: RuntimeBrowseHistorySyncInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, RuntimeBrowseHistoryProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/upsert_runtime_setting_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/upsert_runtime_setting_and_return_procedure.rs index f8fa0351..119eab70 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/upsert_runtime_setting_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/upsert_runtime_setting_and_return_procedure.rs @@ -31,10 +31,10 @@ pub trait upsert_runtime_setting_and_return { input: RuntimeSettingUpsertInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl upsert_runtime_setting_and_return for super::RemoteProcedures { input: RuntimeSettingUpsertInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, RuntimeSettingProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/upsert_runtime_snapshot_and_return_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/upsert_runtime_snapshot_and_return_procedure.rs index fe0746ba..eceae785 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/upsert_runtime_snapshot_and_return_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/upsert_runtime_snapshot_and_return_procedure.rs @@ -31,10 +31,10 @@ pub trait upsert_runtime_snapshot_and_return { input: RuntimeSnapshotUpsertInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl upsert_runtime_snapshot_and_return for super::RemoteProcedures { input: RuntimeSnapshotUpsertInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, RuntimeSnapshotProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/use_puzzle_runtime_prop_procedure.rs b/server-rs/crates/spacetime-client/src/module_bindings/use_puzzle_runtime_prop_procedure.rs index 1e2dbe13..45bd3a73 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/use_puzzle_runtime_prop_procedure.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/use_puzzle_runtime_prop_procedure.rs @@ -31,10 +31,10 @@ pub trait use_puzzle_runtime_prop { input: PuzzleRunPropInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ); } @@ -44,10 +44,10 @@ impl use_puzzle_runtime_prop for super::RemoteProcedures { input: PuzzleRunPropInput, __callback: impl FnOnce( - &super::ProcedureEventContext, - Result, - ) + Send - + 'static, + &super::ProcedureEventContext, + Result, + ) + Send + + 'static, ) { self.imp .invoke_procedure_with_callback::<_, PuzzleRunProcedureResult>( diff --git a/server-rs/crates/spacetime-client/src/module_bindings/user_account_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/user_account_table.rs new file mode 100644 index 00000000..ac55c40a --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/user_account_table.rs @@ -0,0 +1,159 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::user_account_type::UserAccount; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `user_account`. +/// +/// Obtain a handle from the [`UserAccountTableAccess::user_account`] method on [`super::RemoteTables`], +/// like `ctx.db.user_account()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.user_account().on_insert(...)`. +pub struct UserAccountTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `user_account`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait UserAccountTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`UserAccountTableHandle`], which mediates access to the table `user_account`. + fn user_account(&self) -> UserAccountTableHandle<'_>; +} + +impl UserAccountTableAccess for super::RemoteTables { + fn user_account(&self) -> UserAccountTableHandle<'_> { + UserAccountTableHandle { + imp: self.imp.get_table::("user_account"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct UserAccountInsertCallbackId(__sdk::CallbackId); +pub struct UserAccountDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for UserAccountTableHandle<'ctx> { + type Row = UserAccount; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = UserAccountInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> UserAccountInsertCallbackId { + UserAccountInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: UserAccountInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = UserAccountDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> UserAccountDeleteCallbackId { + UserAccountDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: UserAccountDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct UserAccountUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for UserAccountTableHandle<'ctx> { + type UpdateCallbackId = UserAccountUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> UserAccountUpdateCallbackId { + UserAccountUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: UserAccountUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `user_id` unique index on the table `user_account`, +/// which allows point queries on the field of the same name +/// via the [`UserAccountUserIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.user_account().user_id().find(...)`. +pub struct UserAccountUserIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> UserAccountTableHandle<'ctx> { + /// Get a handle on the `user_id` unique index on the table `user_account`. + pub fn user_id(&self) -> UserAccountUserIdUnique<'ctx> { + UserAccountUserIdUnique { + imp: self.imp.get_unique_constraint::("user_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> UserAccountUserIdUnique<'ctx> { + /// Find the subscribed row whose `user_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("user_account"); + _table.add_unique_constraint::("user_id", |row| &row.user_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `UserAccount`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait user_accountQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `UserAccount`. + fn user_account(&self) -> __sdk::__query_builder::Table; +} + +impl user_accountQueryTableAccess for __sdk::QueryTableAccessor { + fn user_account(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("user_account") + } +} diff --git a/server-rs/crates/spacetime-client/src/module_bindings/user_browse_history_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/user_browse_history_table.rs new file mode 100644 index 00000000..2341921d --- /dev/null +++ b/server-rs/crates/spacetime-client/src/module_bindings/user_browse_history_table.rs @@ -0,0 +1,164 @@ +// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE +// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. + +#![allow(unused, clippy::all)] +use super::runtime_browse_history_theme_mode_type::RuntimeBrowseHistoryThemeMode; +use super::user_browse_history_type::UserBrowseHistory; +use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; + +/// Table handle for the table `user_browse_history`. +/// +/// Obtain a handle from the [`UserBrowseHistoryTableAccess::user_browse_history`] method on [`super::RemoteTables`], +/// like `ctx.db.user_browse_history()`. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.user_browse_history().on_insert(...)`. +pub struct UserBrowseHistoryTableHandle<'ctx> { + imp: __sdk::TableHandle, + ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +#[allow(non_camel_case_types)] +/// Extension trait for access to the table `user_browse_history`. +/// +/// Implemented for [`super::RemoteTables`]. +pub trait UserBrowseHistoryTableAccess { + #[allow(non_snake_case)] + /// Obtain a [`UserBrowseHistoryTableHandle`], which mediates access to the table `user_browse_history`. + fn user_browse_history(&self) -> UserBrowseHistoryTableHandle<'_>; +} + +impl UserBrowseHistoryTableAccess for super::RemoteTables { + fn user_browse_history(&self) -> UserBrowseHistoryTableHandle<'_> { + UserBrowseHistoryTableHandle { + imp: self + .imp + .get_table::("user_browse_history"), + ctx: std::marker::PhantomData, + } + } +} + +pub struct UserBrowseHistoryInsertCallbackId(__sdk::CallbackId); +pub struct UserBrowseHistoryDeleteCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::Table for UserBrowseHistoryTableHandle<'ctx> { + type Row = UserBrowseHistory; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } + + type InsertCallbackId = UserBrowseHistoryInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> UserBrowseHistoryInsertCallbackId { + UserBrowseHistoryInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: UserBrowseHistoryInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } + + type DeleteCallbackId = UserBrowseHistoryDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> UserBrowseHistoryDeleteCallbackId { + UserBrowseHistoryDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: UserBrowseHistoryDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + +pub struct UserBrowseHistoryUpdateCallbackId(__sdk::CallbackId); + +impl<'ctx> __sdk::TableWithPrimaryKey for UserBrowseHistoryTableHandle<'ctx> { + type UpdateCallbackId = UserBrowseHistoryUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> UserBrowseHistoryUpdateCallbackId { + UserBrowseHistoryUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: UserBrowseHistoryUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + +/// Access to the `browse_history_id` unique index on the table `user_browse_history`, +/// which allows point queries on the field of the same name +/// via the [`UserBrowseHistoryBrowseHistoryIdUnique::find`] method. +/// +/// Users are encouraged not to explicitly reference this type, +/// but to directly chain method calls, +/// like `ctx.db.user_browse_history().browse_history_id().find(...)`. +pub struct UserBrowseHistoryBrowseHistoryIdUnique<'ctx> { + imp: __sdk::UniqueConstraintHandle, + phantom: std::marker::PhantomData<&'ctx super::RemoteTables>, +} + +impl<'ctx> UserBrowseHistoryTableHandle<'ctx> { + /// Get a handle on the `browse_history_id` unique index on the table `user_browse_history`. + pub fn browse_history_id(&self) -> UserBrowseHistoryBrowseHistoryIdUnique<'ctx> { + UserBrowseHistoryBrowseHistoryIdUnique { + imp: self + .imp + .get_unique_constraint::("browse_history_id"), + phantom: std::marker::PhantomData, + } + } +} + +impl<'ctx> UserBrowseHistoryBrowseHistoryIdUnique<'ctx> { + /// Find the subscribed row whose `browse_history_id` column value is equal to `col_val`, + /// if such a row is present in the client cache. + pub fn find(&self, col_val: &String) -> Option { + self.imp.find(col_val) + } +} + +#[doc(hidden)] +pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { + let _table = client_cache.get_or_make_table::("user_browse_history"); + _table.add_unique_constraint::("browse_history_id", |row| &row.browse_history_id); +} + +#[doc(hidden)] +pub(super) fn parse_table_update( + raw_updates: __ws::v2::TableUpdate, +) -> __sdk::Result<__sdk::TableUpdate> { + __sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| { + __sdk::InternalError::failed_parse("TableUpdate", "TableUpdate") + .with_cause(e) + .into() + }) +} + +#[allow(non_camel_case_types)] +/// Extension trait for query builder access to the table `UserBrowseHistory`. +/// +/// Implemented for [`__sdk::QueryTableAccessor`]. +pub trait user_browse_historyQueryTableAccess { + #[allow(non_snake_case)] + /// Get a query builder for the table `UserBrowseHistory`. + fn user_browse_history(&self) -> __sdk::__query_builder::Table; +} + +impl user_browse_historyQueryTableAccess for __sdk::QueryTableAccessor { + fn user_browse_history(&self) -> __sdk::__query_builder::Table { + __sdk::__query_builder::Table::new("user_browse_history") + } +} diff --git a/server-rs/crates/spacetime-module/src/runtime/analytics_date_dimension.rs b/server-rs/crates/spacetime-module/src/runtime/analytics_date_dimension.rs new file mode 100644 index 00000000..6048118e --- /dev/null +++ b/server-rs/crates/spacetime-module/src/runtime/analytics_date_dimension.rs @@ -0,0 +1,126 @@ +use crate::*; + +#[derive(Clone, Debug, PartialEq, Eq, SpacetimeType)] +pub struct AnalyticsDateDimensionEnsureInput { + pub date_key: i64, +} + +#[derive(Clone, Debug, PartialEq, Eq, SpacetimeType)] +pub struct AnalyticsDateDimensionSeedInput { + pub start_date: String, + pub end_date: String, +} + +#[spacetimedb::table( + accessor = analytics_date_dimension, + index(accessor = by_analytics_date_dimension_iso_week, btree(columns = [iso_week_key])), + index(accessor = by_analytics_date_dimension_month, btree(columns = [month_key])), + index(accessor = by_analytics_date_dimension_quarter, btree(columns = [quarter_key])), + index(accessor = by_analytics_date_dimension_year, btree(columns = [year_key])) +)] +pub struct AnalyticsDateDimension { + #[primary_key] + pub(crate) date_key: i64, + // 中文注释:北京时间业务日对应的公历日期,格式 YYYY-MM-DD。 + pub(crate) calendar_date: String, + // 中文注释:ISO weekday,周一=1,周日=7,方便统计层不重复计算。 + pub(crate) weekday: u8, + // 中文注释:ISO week 编码为 YYYYWW,跨年周按 ISO 年归属。 + pub(crate) iso_week_key: i32, + pub(crate) week_start_date_key: i64, + pub(crate) week_end_date_key: i64, + pub(crate) month_key: i32, + pub(crate) month_start_date_key: i64, + pub(crate) month_end_date_key: i64, + pub(crate) quarter_key: i32, + pub(crate) quarter_start_date_key: i64, + pub(crate) quarter_end_date_key: i64, + pub(crate) year_key: i32, + pub(crate) year_start_date_key: i64, + pub(crate) year_end_date_key: i64, + pub(crate) created_at: Timestamp, + pub(crate) updated_at: Timestamp, +} + +#[spacetimedb::reducer] +pub fn ensure_analytics_date_dimension_for_date( + ctx: &ReducerContext, + input: AnalyticsDateDimensionEnsureInput, +) -> Result<(), String> { + ensure_analytics_date_dimension_row(ctx, input.date_key)?; + Ok(()) +} + +#[spacetimedb::reducer] +pub fn seed_analytics_date_dimensions( + ctx: &ReducerContext, + input: AnalyticsDateDimensionSeedInput, +) -> Result<(), String> { + let start_date_key = parse_analytics_calendar_date_key(&input.start_date) + .map_err(|error| format!("invalid start_date: {error}"))?; + let end_date_key = parse_analytics_calendar_date_key(&input.end_date) + .map_err(|error| format!("invalid end_date: {error}"))?; + if start_date_key > end_date_key { + return Err("start_date must be <= end_date".to_string()); + } + let seed_days = end_date_key - start_date_key + 1; + if seed_days > ANALYTICS_DATE_DIMENSION_MAX_SEED_DAYS { + return Err(format!( + "date range too large: max {} days", + ANALYTICS_DATE_DIMENSION_MAX_SEED_DAYS + )); + } + + for date_key in start_date_key..=end_date_key { + ensure_analytics_date_dimension_row(ctx, date_key)?; + } + Ok(()) +} + +pub(crate) fn ensure_analytics_date_dimension_row( + ctx: &ReducerContext, + date_key: i64, +) -> Result<(), String> { + validate_analytics_date_dimension_date_key(date_key) + .map_err(|error| format!("invalid date_key: {error}"))?; + if ctx + .db + .analytics_date_dimension() + .date_key() + .find(&date_key) + .is_some() + { + return Ok(()); + } + + let snapshot = build_analytics_date_dimension_from_date_key(date_key); + ctx.db + .analytics_date_dimension() + .insert(build_analytics_date_dimension_row(snapshot, ctx.timestamp)); + Ok(()) +} + +fn build_analytics_date_dimension_row( + snapshot: AnalyticsDateDimensionSnapshot, + now: Timestamp, +) -> AnalyticsDateDimension { + AnalyticsDateDimension { + date_key: snapshot.date_key, + calendar_date: snapshot.calendar_date, + weekday: snapshot.weekday, + iso_week_key: snapshot.iso_week_key, + week_start_date_key: snapshot.week_start_date_key, + week_end_date_key: snapshot.week_end_date_key, + month_key: snapshot.month_key, + month_start_date_key: snapshot.month_start_date_key, + month_end_date_key: snapshot.month_end_date_key, + quarter_key: snapshot.quarter_key, + quarter_start_date_key: snapshot.quarter_start_date_key, + quarter_end_date_key: snapshot.quarter_end_date_key, + year_key: snapshot.year_key, + year_start_date_key: snapshot.year_start_date_key, + year_end_date_key: snapshot.year_end_date_key, + created_at: now, + updated_at: now, + } +}