Merge remote-tracking branch 'origin/codex/wooden-fish-template'

This commit is contained in:
kdletters
2026-05-22 08:09:58 +08:00
617 changed files with 31612 additions and 237 deletions

View File

@@ -60,6 +60,7 @@ pub fn build_router(state: AppState) -> Router {
.merge(modules::match3d::router(state.clone()))
.merge(modules::square_hole::router(state.clone()))
.merge(modules::jump_hop::router(state.clone()))
.merge(modules::wooden_fish::router(state.clone()))
.merge(modules::puzzle::router(state.clone()))
.merge(visual_novel_router(state.clone()))
.route(

View File

@@ -8,8 +8,8 @@ use axum::{
};
use serde_json::{Value, json};
#[cfg(test)]
use module_runtime::build_creation_entry_config_response;
use shared_contracts::creation_entry_config::CreationEntryConfigResponse;
use crate::{
api_response::json_success_body, http_error::AppError, request_context::RequestContext,
@@ -84,6 +84,12 @@ pub fn resolve_creation_entry_route_id(path: &str) -> Option<&'static str> {
if normalized.starts_with("/api/creation/bark-battle") {
return Some("bark-battle");
}
if normalized.starts_with("/api/runtime/wooden-fish") {
return Some("wooden-fish");
}
if normalized.starts_with("/api/creation/wooden-fish") {
return Some("wooden-fish");
}
if normalized.starts_with("/api/runtime/square-hole") {
return Some("square-hole");
}
@@ -123,9 +129,8 @@ fn creation_entry_error_response(request_context: &RequestContext, error: AppErr
error.into_response_with_context(Some(request_context))
}
#[cfg(test)]
pub(crate) fn test_creation_entry_config_response()
-> shared_contracts::creation_entry_config::CreationEntryConfigResponse {
/// 中文注释:本地 debug 兜底也来自后端领域默认种子,避免前端恢复硬编码入口配置。
pub(crate) fn default_creation_entry_config_response() -> CreationEntryConfigResponse {
build_creation_entry_config_response(module_runtime::CreationEntryConfigSnapshot {
config_id: module_runtime::CREATION_ENTRY_CONFIG_GLOBAL_ID.to_string(),
start_card: module_runtime::CreationEntryStartCardSnapshot {
@@ -143,6 +148,11 @@ pub(crate) fn test_creation_entry_config_response()
})
}
#[cfg(test)]
pub(crate) fn test_creation_entry_config_response() -> CreationEntryConfigResponse {
default_creation_entry_config_response()
}
#[cfg(test)]
mod tests {
use super::*;
@@ -197,6 +207,14 @@ mod tests {
resolve_creation_entry_route_id("/api/creation/bark-battle/drafts"),
Some("bark-battle"),
);
assert_eq!(
resolve_creation_entry_route_id("/api/runtime/wooden-fish/runs/run-1"),
Some("wooden-fish"),
);
assert_eq!(
resolve_creation_entry_route_id("/api/creation/wooden-fish/sessions"),
Some("wooden-fish"),
);
assert_eq!(
resolve_creation_entry_route_id("/api/creation/edutainment/baby-object-match/assets"),
Some("baby-object-match"),
@@ -217,10 +235,10 @@ mod tests {
.find(|item| item.id == "bark-battle")
.expect("test creation entry config should include bark-battle");
assert_eq!(bark_battle.title, "汪汪声浪");
assert_eq!(bark_battle.title, "\u{6c6a}\u{6c6a}\u{58f0}\u{6d6a}");
assert!(bark_battle.visible);
assert!(bark_battle.open);
assert_eq!(bark_battle.badge, "可创建");
assert_eq!(bark_battle.badge, "\u{53ef}\u{521b}\u{5efa}");
assert_eq!(
bark_battle.image_src,
"/creation-type-references/bark-battle.webp"
@@ -228,7 +246,7 @@ mod tests {
}
#[test]
fn test_creation_entry_config_response_keeps_baby_object_match_coming_soon() {
fn test_creation_entry_config_response_keeps_baby_object_match_visible() {
let config = test_creation_entry_config_response();
let baby_object_match = config
.creation_types
@@ -236,10 +254,10 @@ mod tests {
.find(|item| item.id == "baby-object-match")
.expect("test creation entry config should include baby-object-match");
assert_eq!(baby_object_match.title, "宝贝识物");
assert_eq!(baby_object_match.title, "\u{5b9d}\u{8d1d}\u{8bc6}\u{7269}");
assert!(baby_object_match.visible);
assert!(!baby_object_match.open);
assert_eq!(baby_object_match.badge, "敬请期待");
assert!(baby_object_match.open);
assert_eq!(baby_object_match.badge, "\u{53ef}\u{521b}\u{5efa}");
assert_eq!(baby_object_match.sort_order, 90);
}
}

View File

@@ -90,6 +90,7 @@ mod volcengine_speech;
mod wechat_auth;
mod wechat_pay;
mod wechat_provider;
mod wooden_fish;
mod work_author;
mod work_play_tracking;

View File

@@ -1539,111 +1539,11 @@ pub(super) fn slice_match3d_material_sheet(
image: &DownloadedOpenAiImage,
item_names: &[String],
) -> Result<Vec<Vec<Match3DSlicedItemImage>>, AppError> {
// 中文注释:素材图提示词固定要求 5*5 均匀排布;切图也固定按 5 行 5 列定位格子。
// 每个格子内再基于前景像素二次校准,避免固定内缩裁断物品边缘。
let source = image::load_from_memory(image.bytes.as_slice()).map_err(|error| {
AppError::from_status(StatusCode::BAD_GATEWAY).with_details(json!({
"provider": "match3d-assets",
"message": format!("抓大鹅素材图解码失败:{error}"),
}))
})?;
// 中文注释:素材图按绿幕背景生成;先把整张 sheet 的绿幕转成 alpha再进入格子裁切。
let source = apply_match3d_material_green_screen_alpha(source);
let (width, height) = source.dimensions();
let row_count = MATCH3D_MATERIAL_GRID_SIZE;
let cell_width = width / MATCH3D_MATERIAL_GRID_SIZE;
let cell_height = height / row_count;
if cell_width == 0 || cell_height == 0 {
return Err(
AppError::from_status(StatusCode::BAD_GATEWAY).with_details(json!({
"provider": "match3d-assets",
"message": "抓大鹅素材图尺寸过小,无法切割",
})),
);
}
let mut slices = Vec::with_capacity(item_names.len());
for item_index in 0..item_names.len().min(MATCH3D_MATERIAL_ITEM_BATCH_SIZE) {
let row = item_index as u32;
let mut views = Vec::with_capacity(MATCH3D_ITEM_VIEW_COUNT);
for view_index in 0..MATCH3D_ITEM_VIEW_COUNT {
let col = view_index as u32;
let (crop_x, crop_y, crop_width, crop_height) =
resolve_match3d_material_cell_crop(&source, row_count, row, col);
let cropped = source.crop_imm(crop_x, crop_y, crop_width, crop_height);
let cleaned = crop_match3d_material_view_edge_matte(cropped);
let mut cursor = std::io::Cursor::new(Vec::new());
cleaned
.write_to(&mut cursor, ImageFormat::Png)
.map_err(|error| {
AppError::from_status(StatusCode::BAD_GATEWAY).with_details(json!({
"provider": "match3d-assets",
"message": format!("抓大鹅素材图切割失败:{error}"),
}))
})?;
views.push(Match3DSlicedItemImage {
bytes: cursor.into_inner(),
});
}
slices.push(views);
}
Ok(slices)
}
fn resolve_match3d_material_cell_crop(
source: &image::DynamicImage,
row_count: u32,
row: u32,
col: u32,
) -> (u32, u32, u32, u32) {
let (image_width, image_height) = source.dimensions();
let cell = resolve_match3d_material_cell_bounds(image_width, image_height, row_count, row, col);
let Some(foreground) = detect_match3d_material_foreground_bounds(source, cell) else {
return cell.to_crop_tuple();
};
let cell_width = cell.width();
let cell_height = cell.height();
let pad_x = (cell_width / 16).clamp(4, 16);
let pad_y = (cell_height / 16).clamp(4, 16);
let crop = Match3DMaterialCellBounds {
x0: foreground.x0.saturating_sub(pad_x).max(cell.x0),
y0: foreground.y0.saturating_sub(pad_y).max(cell.y0),
x1: foreground.x1.saturating_add(pad_x).min(cell.x1),
y1: foreground.y1.saturating_add(pad_y).min(cell.y1),
};
crop.to_crop_tuple()
}
pub(super) fn crop_match3d_material_view_edge_matte(
image: image::DynamicImage,
) -> image::DynamicImage {
let mut image = image.to_rgba8();
let (width, height) = image.dimensions();
remove_match3d_material_view_edge_matte(image.as_mut(), width as usize, height as usize);
let bounds = detect_match3d_material_visible_bounds(&image).unwrap_or_else(|| {
Match3DMaterialCellBounds {
x0: 0,
y0: 0,
x1: width,
y1: height,
}
});
if bounds.x0 == 0 && bounds.y0 == 0 && bounds.x1 == width && bounds.y1 == height {
return image::DynamicImage::ImageRgba8(image);
}
image::DynamicImage::ImageRgba8(
image::imageops::crop_imm(
&image,
bounds.x0,
bounds.y0,
bounds.width(),
bounds.height(),
)
.to_image(),
slice_generated_asset_sheet_two_items_per_row(
image,
item_names,
MATCH3D_MATERIAL_GRID_SIZE as usize,
MATCH3D_ITEM_VIEW_COUNT,
)
.map(|rows| {
rows.into_iter()

View File

@@ -716,6 +716,40 @@ pub(super) fn load_match3d_container_reference_image() -> Result<OpenAiReference
})
}
pub(super) fn build_match3d_level_scene_generation_prompt(config: &Match3DConfigJson) -> String {
let theme = config.theme_text.trim();
let theme = if theme.is_empty() {
MATCH3D_DEFAULT_THEME
} else {
theme
};
let style_clause = resolve_match3d_asset_style_prompt(config)
.map(|style| format!("\n整体美术风格要求:{style}"))
.unwrap_or_default();
format!(
concat!(
"生成抓大鹅游戏关卡画面要求画面中所有元素精致且风格高度一致画面中所有UI细节饱满精致、完成度高、顶级游戏品质\n\n",
"抓大鹅主题描述:\n",
"{theme}{style_clause}\n\n",
"画面元素:\n",
"返回按钮位于顶部左上角顶部中间显示关卡标题“第1关 重庆火锅”和倒计时时间,右上角显示设置按钮\n",
"画面中间是一个和主题匹配的容器,宽度与画面宽度同宽,紧贴画面横向边缘\n",
"底部还有三个道具按钮分别为“移出”、“凑齐”、“打乱”"
),
theme = theme,
style_clause = style_clause,
)
}
pub(super) fn build_match3d_ui_spritesheet_prompt() -> String {
"提取画面中的UI元素将返回按钮、设置按钮、方格素材不含边框仅保留一个、移出按钮、凑齐按钮、打乱按钮的顺序从上到下从左到右整理成纯绿色绿幕背景spritesheet。背景必须是统一纯绿色绿幕高饱和亮绿色接近 #00FF00背景平整无纹理、无渐变、无阴影、无场景内容后端会在生图后将绿幕扣成透明并把透明背景 PNG 存到 OSS。UI 素材自身不得使用接近 #00FF00 的高饱和纯绿;绿色题材只能使用深绿、橄榄绿、金绿或蓝绿,并用清晰描边与绿幕区分。".to_string()
}
pub(super) fn build_match3d_background_from_scene_prompt() -> String {
"移除画面中的所有UI组件和容器中的内含物完整保留容器和背景补全被UI覆盖的背景内容".to_string()
}
pub(super) fn build_match3d_background_generation_prompt(
config: &Match3DConfigJson,
prompt: &str,

View File

@@ -14,3 +14,4 @@ pub mod profile;
pub mod puzzle;
pub mod square_hole;
pub mod story;
pub mod wooden_fish;

View File

@@ -0,0 +1,80 @@
use axum::{
Router, middleware,
routing::{get, post},
};
use crate::{
auth::require_bearer_auth,
state::AppState,
wooden_fish::{
checkpoint_wooden_fish_run, create_wooden_fish_session, execute_wooden_fish_action,
finish_wooden_fish_run, get_wooden_fish_gallery_detail, get_wooden_fish_runtime_work,
get_wooden_fish_session, list_wooden_fish_gallery, publish_wooden_fish_work,
start_wooden_fish_run,
},
};
pub fn router(state: AppState) -> Router<AppState> {
Router::new()
.route(
"/api/creation/wooden-fish/sessions",
post(create_wooden_fish_session).route_layer(middleware::from_fn_with_state(
state.clone(),
require_bearer_auth,
)),
)
.route(
"/api/creation/wooden-fish/sessions/{session_id}",
get(get_wooden_fish_session).route_layer(middleware::from_fn_with_state(
state.clone(),
require_bearer_auth,
)),
)
.route(
"/api/creation/wooden-fish/sessions/{session_id}/actions",
post(execute_wooden_fish_action).route_layer(middleware::from_fn_with_state(
state.clone(),
require_bearer_auth,
)),
)
.route(
"/api/creation/wooden-fish/works/{profile_id}/publish",
post(publish_wooden_fish_work).route_layer(middleware::from_fn_with_state(
state.clone(),
require_bearer_auth,
)),
)
.route(
"/api/runtime/wooden-fish/works/{profile_id}",
get(get_wooden_fish_runtime_work),
)
.route(
"/api/runtime/wooden-fish/runs",
post(start_wooden_fish_run).route_layer(middleware::from_fn_with_state(
state.clone(),
require_bearer_auth,
)),
)
.route(
"/api/runtime/wooden-fish/runs/{run_id}/checkpoint",
post(checkpoint_wooden_fish_run).route_layer(middleware::from_fn_with_state(
state.clone(),
require_bearer_auth,
)),
)
.route(
"/api/runtime/wooden-fish/runs/{run_id}/finish",
post(finish_wooden_fish_run).route_layer(middleware::from_fn_with_state(
state.clone(),
require_bearer_auth,
)),
)
.route(
"/api/runtime/wooden-fish/gallery",
get(list_wooden_fish_gallery),
)
.route(
"/api/runtime/wooden-fish/gallery/{public_work_code}",
get(get_wooden_fish_gallery_detail),
)
}

View File

@@ -423,13 +423,14 @@ pub(crate) async fn create_openai_image_edit_with_references(
return Err(
AppError::from_status(StatusCode::BAD_REQUEST).with_details(json!({
"provider": VECTOR_ENGINE_PROVIDER,
"message": format!("{failure_context}:图片编辑需要至少一张参考图。"),
"message": format!("{failure_context}缺少参考图,图片编辑需要至少一张参考图。"),
})),
);
}
let request_url = vector_engine_images_edit_url(settings);
let normalized_size = normalize_image_size(size);
let mut form = reqwest::multipart::Form::new()
.text("model", GPT_IMAGE_2_MODEL.to_string())
.text(
@@ -1277,6 +1278,33 @@ mod tests {
);
}
#[tokio::test]
async fn vector_engine_multi_reference_edit_rejects_empty_references() {
let settings = OpenAiImageSettings {
base_url: "https://vector.example".to_string(),
api_key: "test-key".to_string(),
request_timeout_ms: 1_000_000,
external_api_audit_state: None,
};
let http_client = reqwest::Client::new();
let result = create_openai_image_edit_with_references(
&http_client,
&settings,
"提示词",
None,
"1:1",
1,
&[],
"测试图片编辑失败",
)
.await;
let error = result.expect_err("empty references should be rejected locally");
assert_eq!(error.status_code(), StatusCode::BAD_REQUEST);
assert!(error.body_text().contains("缺少参考图"));
}
#[test]
fn reference_data_url_resolves_to_edit_image_part() {
let source = format!(

View File

@@ -463,6 +463,14 @@ impl AppState {
self.cache_test_creation_entry_config(config.clone());
Ok(config)
}
#[cfg(debug_assertions)]
Err(error) if is_missing_creation_entry_config_procedure(&error) => {
warn!(
error = %error,
"本地 SpacetimeDB 缺少创作入口配置 procedure使用后端默认入口配置兜底"
);
Ok(crate::creation_entry_config::default_creation_entry_config_response())
}
#[cfg(test)]
Err(_) => Ok(self.read_test_creation_entry_config()),
#[cfg(not(test))]
@@ -1327,12 +1335,35 @@ fn build_admin_runtime(
}))
}
#[cfg(debug_assertions)]
fn is_missing_creation_entry_config_procedure(error: &SpacetimeClientError) -> bool {
match error {
SpacetimeClientError::Procedure(message) => message.contains("No such procedure"),
_ => false,
}
}
#[cfg(test)]
mod tests {
use module_ai::{AiTaskKind, generate_ai_task_id};
use super::*;
#[test]
fn detects_missing_creation_entry_config_procedure_for_debug_fallback() {
assert!(is_missing_creation_entry_config_procedure(
&SpacetimeClientError::Procedure(
"No such procedure: get_creation_entry_config".to_string(),
),
));
assert!(is_missing_creation_entry_config_procedure(
&SpacetimeClientError::Procedure("No such procedure".to_string()),
));
assert!(!is_missing_creation_entry_config_procedure(
&SpacetimeClientError::Timeout,
));
}
#[test]
fn app_state_exposes_usable_ai_task_service() {
let state = AppState::new(AppConfig::default()).expect("state should build");

View File

@@ -233,13 +233,15 @@ pub async fn create_visual_novel_sound_effect_task(
}
pub async fn create_sound_effect_task(
State(_state): State<AppState>,
State(state): State<AppState>,
axum::extract::Extension(request_context): axum::extract::Extension<RequestContext>,
payload: Result<Json<creation_audio::CreateSoundEffectRequest>, JsonRejection>,
) -> Result<Json<Value>, Response> {
let _ = parse_json_payload(&request_context, payload)?;
Err(creation_audio_generation_disabled_error()
.into_response_with_context(Some(&request_context)))
let Json(payload) = parse_json_payload(&request_context, payload)?;
create_sound_effect_task_response(&state, payload.prompt, payload.duration, payload.seed)
.await
.map(|task| json_success_body(Some(&request_context), task))
.map_err(|error| error.into_response_with_context(Some(&request_context)))
}
pub(crate) async fn generate_sound_effect_asset_for_creation(
@@ -518,15 +520,25 @@ pub async fn publish_background_music_asset(
}
pub async fn publish_sound_effect_asset(
State(_state): State<AppState>,
Path(_task_id): Path<String>,
State(state): State<AppState>,
Path(task_id): Path<String>,
axum::extract::Extension(request_context): axum::extract::Extension<RequestContext>,
axum::extract::Extension(_authenticated): axum::extract::Extension<AuthenticatedAccessToken>,
axum::extract::Extension(authenticated): axum::extract::Extension<AuthenticatedAccessToken>,
payload: Result<Json<creation_audio::PublishGeneratedAudioAssetRequest>, JsonRejection>,
) -> Result<Json<Value>, Response> {
let payload = parse_json_payload(&request_context, payload)?.0;
Err(creation_audio_generation_disabled_error_for_target(payload)
.into_response_with_context(Some(&request_context)))
let target = build_creation_audio_target(payload, AudioAssetSlot::SoundEffect)
.map_err(|error| error.into_response_with_context(Some(&request_context)))?;
publish_generated_audio_asset(
&state,
authenticated.claims().user_id(),
task_id,
AudioAssetSlot::SoundEffect,
target,
)
.await
.map(|payload| json_success_body(Some(&request_context), payload))
.map_err(|error| error.into_response_with_context(Some(&request_context)))
}
async fn publish_generated_audio_asset(
@@ -860,10 +872,36 @@ fn build_visual_novel_audio_target(
})
}
fn build_creation_audio_target(
payload: creation_audio::PublishGeneratedAudioAssetRequest,
slot: AudioAssetSlot,
) -> Result<AudioAssetBindingTarget, AppError> {
if matches!(slot, AudioAssetSlot::SoundEffect)
&& payload.entity_kind.trim() == "wooden_fish_work"
&& payload.slot.trim() == "hit_sound"
&& payload.asset_kind.trim() == "wooden_fish_hit_sound"
&& payload.storage_prefix
== Some(creation_audio::CreationAudioStoragePrefix::WoodenFishAssets)
{
let entity_id = normalize_limited_text(&payload.entity_id, "entityId", 160)?;
return Ok(AudioAssetBindingTarget {
storage_scope: payload.entity_kind.trim().to_string(),
entity_kind: payload.entity_kind.trim().to_string(),
entity_id,
slot: payload.slot.trim().to_string(),
asset_kind: payload.asset_kind.trim().to_string(),
profile_id: normalize_optional_text(payload.profile_id.as_deref()),
storage_prefix: LegacyAssetPrefix::WoodenFishAssets,
});
}
Err(creation_audio_generation_disabled_error_for_target(payload))
}
fn creation_audio_generation_disabled_error() -> AppError {
AppError::from_status(StatusCode::GONE).with_details(json!({
"provider": VECTOR_ENGINE_PROVIDER,
"message": "拼图与抓大鹅音频生成入口已临时关闭",
"message": "当前创作音频目标未开放",
}))
}
@@ -872,8 +910,9 @@ fn creation_audio_generation_disabled_error_for_target(
) -> AppError {
creation_audio_generation_disabled_error().with_details(json!({
"provider": VECTOR_ENGINE_PROVIDER,
"message": "拼图与抓大鹅音频生成入口已临时关闭",
"message": "当前创作音频目标未开放",
"entityKind": payload.entity_kind.trim(),
"slot": payload.slot.trim(),
}))
}
@@ -1434,7 +1473,7 @@ mod tests {
}
#[test]
fn disabled_creation_audio_targets_return_gone() {
fn disabled_creation_audio_targets_return_gone_except_wooden_fish_sound_effects() {
let payload = creation_audio::PublishGeneratedAudioAssetRequest {
entity_kind: "puzzle_work".to_string(),
entity_id: "puzzle-profile-1".to_string(),
@@ -1467,6 +1506,22 @@ mod tests {
};
let error = creation_audio_generation_disabled_error_for_target(payload);
assert_eq!(error.status_code(), StatusCode::GONE);
let payload = creation_audio::PublishGeneratedAudioAssetRequest {
entity_kind: "wooden_fish_work".to_string(),
entity_id: "wooden-fish-profile-1".to_string(),
slot: "hit_sound".to_string(),
asset_kind: "wooden_fish_hit_sound".to_string(),
profile_id: Some("wooden-fish-profile-1".to_string()),
storage_prefix: Some(creation_audio::CreationAudioStoragePrefix::WoodenFishAssets),
};
let target = build_creation_audio_target(payload, AudioAssetSlot::SoundEffect)
.expect("wooden fish hit sound target should be enabled");
assert_eq!(target.entity_kind, "wooden_fish_work");
assert_eq!(target.slot, "hit_sound");
assert_eq!(target.storage_prefix, LegacyAssetPrefix::WoodenFishAssets);
assert_eq!(target.storage_scope, "wooden_fish_work");
}
#[test]

File diff suppressed because it is too large Load Diff

View File

@@ -105,6 +105,17 @@ pub fn default_creation_entry_type_snapshots(
45,
updated_at_micros,
),
build_default_creation_entry_type_snapshot(
"wooden-fish",
"敲木鱼",
"点击祈福轻玩法",
"可创建",
"/wooden-fish/default-hit-object.png",
true,
true,
47,
updated_at_micros,
),
build_default_creation_entry_type_snapshot(
"square-hole",
"方洞",
@@ -164,10 +175,10 @@ pub fn default_creation_entry_type_snapshots(
"baby-object-match",
"宝贝识物",
"亲子识物分类",
"敬请期待",
"可创建",
"/child-motion-demo/picture-book-grass-stage.png",
true,
false,
true,
90,
updated_at_micros,
),

View File

@@ -227,8 +227,8 @@ mod tests {
assert_eq!(baby_object_match.title, "宝贝识物");
assert_eq!(baby_object_match.subtitle, "亲子识物分类");
assert!(baby_object_match.visible);
assert!(!baby_object_match.open);
assert_eq!(baby_object_match.badge, "敬请期待");
assert!(baby_object_match.open);
assert_eq!(baby_object_match.badge, "可创建");
assert_eq!(baby_object_match.sort_order, 90);
assert_eq!(
baby_object_match.image_src,
@@ -272,6 +272,25 @@ mod tests {
);
}
#[test]
fn default_creation_entry_types_include_wooden_fish() {
let configs = default_creation_entry_type_snapshots(1);
let wooden_fish = configs
.iter()
.find(|item| item.id == "wooden-fish")
.expect("wooden-fish creation entry should be seeded");
assert_eq!(wooden_fish.title, "敲木鱼");
assert!(wooden_fish.visible);
assert!(wooden_fish.open);
assert_eq!(wooden_fish.badge, "可创建");
assert_eq!(wooden_fish.sort_order, 47);
assert_eq!(
wooden_fish.image_src,
"/wooden-fish/default-hit-object.png"
);
}
#[test]
fn normalized_clamps_music_volume_into_valid_range() {
let low = RuntimeSettings::normalized(-1.0, RuntimePlatformTheme::Light);

View File

@@ -0,0 +1,13 @@
[package]
name = "module-wooden-fish"
edition.workspace = true
version.workspace = true
license.workspace = true
[features]
default = []
spacetime-types = ["dep:spacetimedb"]
[dependencies]
serde = { workspace = true }
spacetimedb = { workspace = true, optional = true }

View File

@@ -0,0 +1,4 @@
pub use crate::domain::{
apply_run_checkpoint, default_floating_words, finish_run, normalize_floating_words,
normalize_word_counters,
};

View File

@@ -0,0 +1,8 @@
pub fn normalize_wooden_fish_prompt(value: &str, fallback: &str) -> String {
let value = value.trim();
if value.is_empty() {
fallback.to_string()
} else {
value.to_string()
}
}

View File

@@ -0,0 +1,281 @@
use serde::{Deserialize, Serialize};
#[cfg(feature = "spacetime-types")]
use spacetimedb::SpacetimeType;
pub const WOODEN_FISH_SESSION_ID_PREFIX: &str = "wooden-fish-session-";
pub const WOODEN_FISH_PROFILE_ID_PREFIX: &str = "wooden-fish-profile-";
pub const WOODEN_FISH_WORK_ID_PREFIX: &str = "wooden-fish-work-";
pub const WOODEN_FISH_RUN_ID_PREFIX: &str = "wooden-fish-run-";
pub const DEFAULT_FLOATING_WORDS: [&str; 8] = [
"幸运", "健康", "财富", "姻缘", "幸福", "事业", "成功", "功德",
];
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub enum WoodenFishRunStatus {
Playing,
Finished,
}
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct WoodenFishWordCounter {
pub text: String,
pub count: u32,
}
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct WoodenFishRunSnapshot {
pub run_id: String,
pub profile_id: String,
pub owner_user_id: String,
pub status: WoodenFishRunStatus,
pub total_tap_count: u32,
pub word_counters: Vec<WoodenFishWordCounter>,
pub started_at_ms: u64,
pub updated_at_ms: u64,
pub finished_at_ms: Option<u64>,
}
pub fn default_floating_words() -> Vec<String> {
DEFAULT_FLOATING_WORDS
.iter()
.map(|value| (*value).to_string())
.collect()
}
pub fn normalize_floating_words(words: &[String]) -> Vec<String> {
let mut normalized: Vec<String> = Vec::new();
for word in words {
let value = normalize_floating_word(word);
if !value.is_empty() && !normalized.iter().any(|item| item == &value) {
normalized.push(value);
}
if normalized.len() == 8 {
break;
}
}
if normalized.is_empty() {
default_floating_words()
} else {
normalized
}
}
fn normalize_floating_word(word: &str) -> String {
word.trim()
.trim_end_matches(|ch: char| ch == '1' || ch.is_whitespace())
.trim_end_matches(['+', ''])
.trim()
.to_string()
}
pub fn apply_run_checkpoint(
current: &WoodenFishRunSnapshot,
total_tap_count: u32,
word_counters: Vec<WoodenFishWordCounter>,
updated_at_ms: u64,
) -> WoodenFishRunSnapshot {
WoodenFishRunSnapshot {
total_tap_count,
word_counters: normalize_word_counters(word_counters),
updated_at_ms,
..current.clone()
}
}
pub fn finish_run(
current: &WoodenFishRunSnapshot,
total_tap_count: u32,
word_counters: Vec<WoodenFishWordCounter>,
finished_at_ms: u64,
) -> WoodenFishRunSnapshot {
WoodenFishRunSnapshot {
status: WoodenFishRunStatus::Finished,
total_tap_count,
word_counters: normalize_word_counters(word_counters),
updated_at_ms: finished_at_ms,
finished_at_ms: Some(finished_at_ms),
..current.clone()
}
}
pub fn normalize_word_counters(counters: Vec<WoodenFishWordCounter>) -> Vec<WoodenFishWordCounter> {
let mut normalized: Vec<WoodenFishWordCounter> = Vec::new();
for counter in counters {
let text = normalize_floating_word(&counter.text);
if text.is_empty() || counter.count == 0 {
continue;
}
if let Some(existing) = normalized.iter_mut().find(|item| item.text == text) {
existing.count = existing.count.saturating_add(counter.count);
} else {
normalized.push(WoodenFishWordCounter {
text,
count: counter.count,
});
}
if normalized.len() == 8 {
break;
}
}
normalized
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn floating_words_default_to_eight_blessing_entries() {
assert_eq!(
default_floating_words(),
vec![
"幸运".to_string(),
"健康".to_string(),
"财富".to_string(),
"姻缘".to_string(),
"幸福".to_string(),
"事业".to_string(),
"成功".to_string(),
"功德".to_string(),
]
);
}
#[test]
fn floating_words_are_trimmed_deduped_and_capped_at_eight() {
let words = vec![
" 幸运+1 ".to_string(),
"幸运".to_string(),
"健康".to_string(),
"财富".to_string(),
"姻缘".to_string(),
"幸福".to_string(),
"事业".to_string(),
"成功".to_string(),
"功德".to_string(),
"快乐".to_string(),
];
assert_eq!(normalize_floating_words(&words).len(), 8);
assert_eq!(normalize_floating_words(&words)[0], "幸运");
assert_eq!(normalize_floating_words(&words)[7], "功德");
}
#[test]
fn checkpoint_replaces_single_run_counter_snapshot() {
let current = WoodenFishRunSnapshot {
run_id: "wooden-fish-run-1".to_string(),
profile_id: "wooden-fish-profile-1".to_string(),
owner_user_id: "user-1".to_string(),
status: WoodenFishRunStatus::Playing,
total_tap_count: 0,
word_counters: Vec::new(),
started_at_ms: 100,
updated_at_ms: 100,
finished_at_ms: None,
};
let next = apply_run_checkpoint(
&current,
2,
vec![WoodenFishWordCounter {
text: "功德".to_string(),
count: 2,
}],
160,
);
assert_eq!(next.total_tap_count, 2);
assert_eq!(next.word_counters[0].text, "功德");
assert_eq!(next.updated_at_ms, 160);
assert_eq!(next.started_at_ms, 100);
}
#[test]
fn word_counters_are_trimmed_deduped_and_capped_at_eight() {
let counters = vec![
WoodenFishWordCounter {
text: " 幸运+1 ".to_string(),
count: 1,
},
WoodenFishWordCounter {
text: "幸运+1".to_string(),
count: 2,
},
WoodenFishWordCounter {
text: "健康+1".to_string(),
count: 1,
},
WoodenFishWordCounter {
text: "财富+1".to_string(),
count: 1,
},
WoodenFishWordCounter {
text: "姻缘+1".to_string(),
count: 1,
},
WoodenFishWordCounter {
text: "幸福+1".to_string(),
count: 1,
},
WoodenFishWordCounter {
text: "事业+1".to_string(),
count: 1,
},
WoodenFishWordCounter {
text: "成功+1".to_string(),
count: 1,
},
WoodenFishWordCounter {
text: "功德+1".to_string(),
count: 1,
},
WoodenFishWordCounter {
text: "快乐+1".to_string(),
count: 1,
},
];
let normalized = normalize_word_counters(counters);
assert_eq!(normalized.len(), 8);
assert_eq!(normalized[0].text, "幸运");
assert_eq!(normalized[0].count, 3);
assert_eq!(normalized[7].text, "功德");
}
#[test]
fn finish_run_sets_status_and_finished_timestamp() {
let current = WoodenFishRunSnapshot {
run_id: "wooden-fish-run-1".to_string(),
profile_id: "wooden-fish-profile-1".to_string(),
owner_user_id: "user-1".to_string(),
status: WoodenFishRunStatus::Playing,
total_tap_count: 3,
word_counters: Vec::new(),
started_at_ms: 100,
updated_at_ms: 130,
finished_at_ms: None,
};
let next = finish_run(
&current,
4,
vec![WoodenFishWordCounter {
text: "健康".to_string(),
count: 4,
}],
220,
);
assert_eq!(next.status, WoodenFishRunStatus::Finished);
assert_eq!(next.total_tap_count, 4);
assert_eq!(next.updated_at_ms, 220);
assert_eq!(next.finished_at_ms, Some(220));
assert_eq!(next.word_counters[0].text, "健康");
}
}

View File

@@ -0,0 +1,23 @@
use std::fmt::{self, Display};
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum WoodenFishError {
MissingRunId,
MissingProfileId,
MissingOwnerUserId,
RunNotPlaying,
}
impl Display for WoodenFishError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let message = match self {
Self::MissingRunId => "缺少 runId",
Self::MissingProfileId => "缺少 profileId",
Self::MissingOwnerUserId => "owner_user_id 缺失",
Self::RunNotPlaying => "当前运行态不是 playing",
};
write!(f, "{message}")
}
}
impl std::error::Error for WoodenFishError {}

View File

@@ -0,0 +1,25 @@
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum WoodenFishDomainEvent {
DraftCompiled {
profile_id: String,
owner_user_id: String,
occurred_at_micros: i64,
},
WorkPublished {
profile_id: String,
owner_user_id: String,
occurred_at_micros: i64,
},
RunCheckpointed {
run_id: String,
owner_user_id: String,
total_tap_count: u32,
occurred_at_micros: i64,
},
RunFinished {
run_id: String,
owner_user_id: String,
total_tap_count: u32,
occurred_at_micros: i64,
},
}

View File

@@ -0,0 +1,11 @@
mod application;
mod commands;
mod domain;
mod errors;
mod events;
pub use application::*;
pub use commands::*;
pub use domain::*;
pub use errors::*;
pub use events::*;

View File

@@ -20,12 +20,13 @@ const OSS_V4_REQUEST: &str = "aliyun_v4_request";
const OSS_V4_SERVICE: &str = "oss";
const OSS_UNSIGNED_PAYLOAD: &str = "UNSIGNED-PAYLOAD";
pub const LEGACY_PUBLIC_PREFIXES: [&str; 11] = [
pub const LEGACY_PUBLIC_PREFIXES: [&str; 12] = [
"generated-character-drafts",
"generated-characters",
"generated-animations",
"generated-big-fish-assets",
"generated-square-hole-assets",
"generated-wooden-fish-assets",
"generated-match3d-assets",
"generated-puzzle-assets",
"generated-custom-world-scenes",
@@ -48,6 +49,7 @@ pub enum LegacyAssetPrefix {
Animations,
BigFishAssets,
SquareHoleAssets,
WoodenFishAssets,
Match3DAssets,
PuzzleAssets,
CustomWorldScenes,
@@ -236,6 +238,7 @@ impl LegacyAssetPrefix {
"generated-animations" => Some(Self::Animations),
"generated-big-fish-assets" => Some(Self::BigFishAssets),
"generated-square-hole-assets" => Some(Self::SquareHoleAssets),
"generated-wooden-fish-assets" => Some(Self::WoodenFishAssets),
"generated-match3d-assets" => Some(Self::Match3DAssets),
"generated-puzzle-assets" => Some(Self::PuzzleAssets),
"generated-custom-world-scenes" => Some(Self::CustomWorldScenes),
@@ -253,6 +256,7 @@ impl LegacyAssetPrefix {
Self::Animations => "generated-animations",
Self::BigFishAssets => "generated-big-fish-assets",
Self::SquareHoleAssets => "generated-square-hole-assets",
Self::WoodenFishAssets => "generated-wooden-fish-assets",
Self::Match3DAssets => "generated-match3d-assets",
Self::PuzzleAssets => "generated-puzzle-assets",
Self::CustomWorldScenes => "generated-custom-world-scenes",
@@ -1317,9 +1321,14 @@ mod tests {
LegacyAssetPrefix::parse("/generated-match3d-assets/*"),
Some(LegacyAssetPrefix::Match3DAssets)
);
assert_eq!(
LegacyAssetPrefix::parse("/generated-wooden-fish-assets/*"),
Some(LegacyAssetPrefix::WoodenFishAssets)
);
assert!(LEGACY_PUBLIC_PREFIXES.contains(&"generated-puzzle-assets"));
assert!(LEGACY_PUBLIC_PREFIXES.contains(&"generated-match3d-assets"));
assert!(LEGACY_PUBLIC_PREFIXES.contains(&"generated-bark-battle-assets"));
assert!(LEGACY_PUBLIC_PREFIXES.contains(&"generated-wooden-fish-assets"));
assert_eq!(LegacyAssetPrefix::parse("unknown"), None);
}
@@ -1559,6 +1568,12 @@ mod tests {
),
Some(LegacyAssetPrefix::CustomWorldScenes)
);
assert_eq!(
LegacyAssetPrefix::from_object_key(
"generated-wooden-fish-assets/session/profile/hit_object/asset/image.png"
),
Some(LegacyAssetPrefix::WoodenFishAssets)
);
assert_eq!(
LegacyAssetPrefix::from_object_key("workflow-cache/demo.json"),
None

View File

@@ -61,6 +61,7 @@ pub enum CreationAudioStoragePrefix {
PuzzleAssets,
#[serde(rename = "match3d_assets")]
Match3DAssets,
WoodenFishAssets,
CustomWorldScenes,
}
@@ -125,4 +126,20 @@ mod tests {
assert_eq!(payload["taskId"], json!("task-1"));
assert_eq!(payload["audioSrc"], json!("/generated-puzzle-assets/a.mp3"));
}
#[test]
fn creation_audio_contracts_support_wooden_fish_storage_prefix() {
let request = PublishGeneratedAudioAssetRequest {
entity_kind: "wooden_fish_work".to_string(),
entity_id: "wooden-fish-profile-1".to_string(),
slot: "hit_sound".to_string(),
asset_kind: "wooden_fish_hit_sound".to_string(),
profile_id: Some("wooden-fish-profile-1".to_string()),
storage_prefix: Some(CreationAudioStoragePrefix::WoodenFishAssets),
};
let payload = serde_json::to_value(request).expect("request should serialize");
assert_eq!(payload["storagePrefix"], json!("wooden_fish_assets"));
}
}

View File

@@ -29,3 +29,4 @@ pub mod square_hole_runtime;
pub mod square_hole_works;
pub mod story;
pub mod visual_novel;
pub mod wooden_fish;

View File

@@ -0,0 +1,507 @@
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "kebab-case")]
pub enum WoodenFishGenerationStatus {
Draft,
Generating,
Ready,
Failed,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "kebab-case")]
pub enum WoodenFishActionType {
CompileDraft,
RegenerateHitObject,
GenerateHitSound,
ReplaceHitSound,
UpdateWorkMeta,
UpdateFloatingWords,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "kebab-case")]
pub enum WoodenFishRunStatus {
Playing,
Finished,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct WoodenFishImageAsset {
pub asset_id: String,
pub image_src: String,
pub image_object_key: String,
pub asset_object_id: String,
pub generation_provider: String,
pub prompt: String,
pub width: u32,
pub height: u32,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct WoodenFishAudioAsset {
pub asset_id: String,
pub audio_src: String,
pub audio_object_key: String,
pub asset_object_id: String,
pub source: String,
#[serde(default)]
pub prompt: Option<String>,
#[serde(default)]
pub duration_ms: Option<u32>,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct WoodenFishWorkspaceCreateRequest {
pub template_id: String,
pub work_title: String,
pub work_description: String,
pub theme_tags: Vec<String>,
pub hit_object_prompt: String,
#[serde(default)]
pub hit_object_reference_image_src: Option<String>,
#[serde(default)]
pub hit_sound_prompt: Option<String>,
#[serde(default)]
pub hit_sound_asset: Option<WoodenFishAudioAsset>,
pub floating_words: Vec<String>,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct WoodenFishActionRequest {
pub action_type: WoodenFishActionType,
#[serde(default, skip_deserializing)]
pub profile_id: Option<String>,
#[serde(default)]
pub work_title: Option<String>,
#[serde(default)]
pub work_description: Option<String>,
#[serde(default)]
pub theme_tags: Option<Vec<String>>,
#[serde(default)]
pub hit_object_prompt: Option<String>,
#[serde(default)]
pub hit_object_reference_image_src: Option<String>,
#[serde(default, skip_deserializing)]
pub hit_object_asset: Option<WoodenFishImageAsset>,
#[serde(default)]
#[serde(skip_deserializing)]
pub background_asset: Option<WoodenFishImageAsset>,
#[serde(default)]
pub hit_sound_prompt: Option<String>,
#[serde(default)]
pub hit_sound_asset: Option<WoodenFishAudioAsset>,
#[serde(default)]
pub floating_words: Option<Vec<String>>,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct WoodenFishWordCounter {
pub text: String,
pub count: u32,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct WoodenFishDraftResponse {
pub template_id: String,
pub template_name: String,
#[serde(default)]
pub profile_id: Option<String>,
pub work_title: String,
pub work_description: String,
pub theme_tags: Vec<String>,
pub hit_object_prompt: String,
#[serde(default)]
pub hit_object_reference_image_src: Option<String>,
#[serde(default)]
pub hit_sound_prompt: Option<String>,
pub floating_words: Vec<String>,
#[serde(default)]
pub hit_object_asset: Option<WoodenFishImageAsset>,
#[serde(default)]
pub background_asset: Option<WoodenFishImageAsset>,
#[serde(default)]
pub hit_sound_asset: Option<WoodenFishAudioAsset>,
#[serde(default)]
pub cover_image_src: Option<String>,
pub generation_status: WoodenFishGenerationStatus,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct WoodenFishSessionSnapshotResponse {
pub session_id: String,
pub owner_user_id: String,
pub status: WoodenFishGenerationStatus,
#[serde(default)]
pub draft: Option<WoodenFishDraftResponse>,
pub created_at: String,
pub updated_at: String,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct WoodenFishSessionResponse {
pub session: WoodenFishSessionSnapshotResponse,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct WoodenFishActionResponse {
pub action_type: WoodenFishActionType,
pub session: WoodenFishSessionSnapshotResponse,
#[serde(default)]
pub work: Option<WoodenFishWorkProfileResponse>,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct WoodenFishWorkSummaryResponse {
pub runtime_kind: String,
pub work_id: String,
pub profile_id: String,
pub owner_user_id: String,
#[serde(default)]
pub source_session_id: Option<String>,
pub work_title: String,
pub work_description: String,
pub theme_tags: Vec<String>,
#[serde(default)]
pub cover_image_src: Option<String>,
pub publication_status: String,
pub play_count: u32,
pub updated_at: String,
#[serde(default)]
pub published_at: Option<String>,
pub publish_ready: bool,
pub generation_status: WoodenFishGenerationStatus,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct WoodenFishWorkProfileResponse {
pub summary: WoodenFishWorkSummaryResponse,
pub draft: WoodenFishDraftResponse,
pub hit_object_asset: WoodenFishImageAsset,
#[serde(default)]
pub background_asset: Option<WoodenFishImageAsset>,
pub hit_sound_asset: WoodenFishAudioAsset,
pub floating_words: Vec<String>,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct WoodenFishWorkDetailResponse {
pub item: WoodenFishWorkProfileResponse,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct WoodenFishWorkMutationResponse {
pub item: WoodenFishWorkProfileResponse,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct WoodenFishGalleryCardResponse {
pub public_work_code: String,
pub work_id: String,
pub profile_id: String,
pub owner_user_id: String,
pub author_display_name: String,
pub work_title: String,
pub work_description: String,
#[serde(default)]
pub cover_image_src: Option<String>,
pub theme_tags: Vec<String>,
pub publication_status: String,
pub play_count: u32,
pub updated_at: String,
#[serde(default)]
pub published_at: Option<String>,
pub generation_status: WoodenFishGenerationStatus,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct WoodenFishGalleryResponse {
pub items: Vec<WoodenFishGalleryCardResponse>,
pub has_more: bool,
#[serde(default)]
pub next_cursor: Option<String>,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct WoodenFishGalleryDetailResponse {
pub item: WoodenFishWorkProfileResponse,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct WoodenFishRuntimeRunSnapshotResponse {
pub run_id: String,
pub profile_id: String,
pub owner_user_id: String,
pub status: WoodenFishRunStatus,
pub total_tap_count: u32,
pub word_counters: Vec<WoodenFishWordCounter>,
pub started_at_ms: u64,
pub updated_at_ms: u64,
#[serde(default)]
pub finished_at_ms: Option<u64>,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct WoodenFishRunResponse {
pub run: WoodenFishRuntimeRunSnapshotResponse,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct WoodenFishStartRunRequest {
pub profile_id: String,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct WoodenFishCheckpointRunRequest {
pub total_tap_count: u32,
pub word_counters: Vec<WoodenFishWordCounter>,
pub client_event_id: String,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct WoodenFishFinishRunRequest {
pub total_tap_count: u32,
pub word_counters: Vec<WoodenFishWordCounter>,
pub client_event_id: String,
}
#[cfg(test)]
mod tests {
use super::*;
use serde_json::json;
#[test]
fn wooden_fish_workspace_request_uses_camel_case_and_default_words() {
let payload = serde_json::to_value(WoodenFishWorkspaceCreateRequest {
template_id: "wooden-fish".to_string(),
work_title: "今日敲木鱼".to_string(),
work_description: "轻松敲击".to_string(),
theme_tags: vec!["休闲".to_string()],
hit_object_prompt: "卡通木鱼".to_string(),
hit_object_reference_image_src: None,
hit_sound_prompt: Some("清脆木鱼声".to_string()),
hit_sound_asset: None,
floating_words: vec![
"幸运".to_string(),
"健康".to_string(),
"财富".to_string(),
"姻缘".to_string(),
"幸福".to_string(),
"事业".to_string(),
"成功".to_string(),
"功德".to_string(),
],
})
.expect("payload should serialize");
assert_eq!(payload["templateId"], json!("wooden-fish"));
assert_eq!(payload["hitObjectPrompt"], json!("卡通木鱼"));
assert_eq!(payload["hitSoundPrompt"], json!("清脆木鱼声"));
assert_eq!(payload["floatingWords"][7], json!("功德"));
}
#[test]
fn wooden_fish_runtime_snapshot_counts_words_inside_one_run() {
let payload = serde_json::to_value(WoodenFishRuntimeRunSnapshotResponse {
run_id: "wooden-fish-run-1".to_string(),
profile_id: "wooden-fish-profile-1".to_string(),
owner_user_id: "user-1".to_string(),
status: WoodenFishRunStatus::Playing,
total_tap_count: 3,
word_counters: vec![
WoodenFishWordCounter {
text: "幸运".to_string(),
count: 2,
},
WoodenFishWordCounter {
text: "功德".to_string(),
count: 1,
},
],
started_at_ms: 100,
updated_at_ms: 130,
finished_at_ms: None,
})
.expect("payload should serialize");
assert_eq!(payload["status"], json!("playing"));
assert_eq!(payload["totalTapCount"], json!(3));
assert_eq!(payload["wordCounters"][0]["text"], json!("幸运"));
}
#[test]
fn wooden_fish_action_request_serializes_audio_and_image_fields() {
let payload = serde_json::to_value(WoodenFishActionRequest {
action_type: WoodenFishActionType::ReplaceHitSound,
profile_id: Some("wooden-fish-profile-1".to_string()),
work_title: None,
work_description: None,
theme_tags: None,
hit_object_prompt: Some("卡通铜钹".to_string()),
hit_object_reference_image_src: Some("/uploads/reference.png".to_string()),
hit_object_asset: Some(WoodenFishImageAsset {
asset_id: "image-1".to_string(),
image_src: "/generated-wooden-fish-assets/profile/hit-object/image.png".to_string(),
image_object_key: "generated-wooden-fish-assets/profile/hit-object/image.png"
.to_string(),
asset_object_id: "image-object-1".to_string(),
generation_provider: "image2".to_string(),
prompt: "卡通铜钹".to_string(),
width: 1024,
height: 1024,
}),
background_asset: Some(WoodenFishImageAsset {
asset_id: "background-1".to_string(),
image_src: "/generated-wooden-fish-assets/profile/background/image.png"
.to_string(),
image_object_key: "generated-wooden-fish-assets/profile/background/image.png"
.to_string(),
asset_object_id: "background-object-1".to_string(),
generation_provider: "image2".to_string(),
prompt: "赛博莲花背景".to_string(),
width: 1024,
height: 1536,
}),
hit_sound_prompt: Some("短促木鱼声".to_string()),
hit_sound_asset: Some(WoodenFishAudioAsset {
asset_id: "sound-1".to_string(),
audio_src: "/generated/wooden-fish.mp3".to_string(),
audio_object_key: "generated/wooden-fish.mp3".to_string(),
asset_object_id: "asset-object-1".to_string(),
source: "upload".to_string(),
prompt: None,
duration_ms: Some(800),
}),
floating_words: Some(vec!["功德".to_string()]),
})
.expect("payload should serialize");
assert_eq!(payload["actionType"], json!("replace-hit-sound"));
assert_eq!(payload["profileId"], json!("wooden-fish-profile-1"));
assert_eq!(payload["hitObjectPrompt"], json!("卡通铜钹"));
assert_eq!(
payload["hitObjectAsset"]["imageObjectKey"],
json!("generated-wooden-fish-assets/profile/hit-object/image.png")
);
assert_eq!(payload["backgroundAsset"]["height"], json!(1536));
assert_eq!(payload["hitSoundAsset"]["source"], json!("upload"));
assert_eq!(payload["hitSoundAsset"]["durationMs"], json!(800));
}
#[test]
fn wooden_fish_action_request_ignores_client_hit_object_asset() {
let payload = serde_json::from_value::<WoodenFishActionRequest>(json!({
"actionType": "compile-draft",
"hitObjectPrompt": "卡通铜钹",
"hitObjectAsset": {
"assetId": "client-image",
"imageSrc": "/generated-wooden-fish-assets/client/image.png",
"imageObjectKey": "generated-wooden-fish-assets/client/image.png",
"assetObjectId": "client-asset-object",
"generationProvider": "client",
"prompt": "跳过生成",
"width": 1024,
"height": 1024
}
}))
.expect("payload should deserialize");
assert_eq!(payload.action_type, WoodenFishActionType::CompileDraft);
assert_eq!(payload.hit_object_prompt.as_deref(), Some("卡通铜钹"));
assert_eq!(payload.hit_object_asset, None);
}
#[test]
fn wooden_fish_work_profile_keeps_summary_and_runtime_assets() {
let image = WoodenFishImageAsset {
asset_id: "image-1".to_string(),
image_src: "/generated/wooden-fish.png".to_string(),
image_object_key: "generated/wooden-fish.png".to_string(),
asset_object_id: "image-object-1".to_string(),
generation_provider: "image2".to_string(),
prompt: "卡通木鱼".to_string(),
width: 1024,
height: 1024,
};
let audio = WoodenFishAudioAsset {
asset_id: "sound-1".to_string(),
audio_src: "/generated/wooden-fish.mp3".to_string(),
audio_object_key: "generated/wooden-fish.mp3".to_string(),
asset_object_id: "sound-object-1".to_string(),
source: "generated".to_string(),
prompt: Some("清脆木鱼".to_string()),
duration_ms: Some(600),
};
let profile = WoodenFishWorkProfileResponse {
summary: WoodenFishWorkSummaryResponse {
runtime_kind: "wooden-fish".to_string(),
work_id: "wooden-fish-profile-1".to_string(),
profile_id: "wooden-fish-profile-1".to_string(),
owner_user_id: "user-1".to_string(),
source_session_id: Some("wooden-fish-session-1".to_string()),
work_title: "敲木鱼".to_string(),
work_description: String::new(),
theme_tags: vec!["休闲".to_string()],
cover_image_src: Some(image.image_src.clone()),
publication_status: "draft".to_string(),
play_count: 0,
updated_at: "2026-05-20T00:00:00Z".to_string(),
published_at: None,
publish_ready: true,
generation_status: WoodenFishGenerationStatus::Ready,
},
draft: WoodenFishDraftResponse {
template_id: "wooden-fish".to_string(),
template_name: "敲木鱼".to_string(),
profile_id: Some("wooden-fish-profile-1".to_string()),
work_title: "敲木鱼".to_string(),
work_description: String::new(),
theme_tags: vec!["休闲".to_string()],
hit_object_prompt: "卡通木鱼".to_string(),
hit_object_reference_image_src: None,
hit_sound_prompt: Some("清脆木鱼".to_string()),
floating_words: vec!["功德".to_string()],
hit_object_asset: Some(image.clone()),
background_asset: None,
hit_sound_asset: Some(audio.clone()),
cover_image_src: Some(image.image_src.clone()),
generation_status: WoodenFishGenerationStatus::Ready,
},
hit_object_asset: image,
background_asset: None,
hit_sound_asset: audio,
floating_words: vec!["功德".to_string()],
};
let payload = serde_json::to_value(profile).expect("profile should serialize");
assert_eq!(payload["summary"]["runtimeKind"], json!("wooden-fish"));
assert_eq!(
payload["hitObjectAsset"]["generationProvider"],
json!("image2")
);
assert_eq!(payload["hitSoundAsset"]["source"], json!("generated"));
}
}

View File

@@ -12,6 +12,7 @@ module-combat = { workspace = true }
module-custom-world = { workspace = true }
module-inventory = { workspace = true }
module-jump-hop = { workspace = true }
module-wooden-fish = { workspace = true }
module-match3d = { workspace = true }
module-npc = { workspace = true }
module-puzzle = { workspace = true }

View File

@@ -79,7 +79,15 @@ pub use mapper::{
VisualNovelHistoryEntryRecordInput, VisualNovelRunRecord, VisualNovelRunSnapshotRecordInput,
VisualNovelRunStartRecordInput, VisualNovelRuntimeEventRecord,
VisualNovelRuntimeEventRecordInput, VisualNovelWorkCompileRecordInput,
VisualNovelWorkProfileRecord, VisualNovelWorkUpdateRecordInput,
VisualNovelWorkProfileRecord, VisualNovelWorkUpdateRecordInput, WoodenFishActionRequest,
WoodenFishActionResponse, WoodenFishActionType, WoodenFishAudioAsset,
WoodenFishCheckpointRunRequest, WoodenFishDraftResponse, WoodenFishFinishRunRequest,
WoodenFishGalleryCardResponse, WoodenFishGalleryDetailResponse, WoodenFishGalleryResponse,
WoodenFishGenerationStatus, WoodenFishImageAsset, WoodenFishRunResponse, WoodenFishRunStatus,
WoodenFishRuntimeRunSnapshotResponse, WoodenFishSessionResponse,
WoodenFishSessionSnapshotResponse, WoodenFishStartRunRequest, WoodenFishWordCounter,
WoodenFishWorkDetailResponse, WoodenFishWorkMutationResponse, WoodenFishWorkProfileResponse,
WoodenFishWorkSummaryResponse, WoodenFishWorkspaceCreateRequest,
};
pub mod ai;
@@ -104,6 +112,7 @@ pub mod square_hole;
pub mod story;
pub mod story_runtime;
pub mod visual_novel;
pub mod wooden_fish;
use std::{
collections::HashMap,
@@ -563,6 +572,7 @@ impl SpacetimeClient {
"SELECT * FROM bark_battle_gallery_view",
"SELECT * FROM puzzle_gallery_card_view",
"SELECT * FROM jump_hop_gallery_card_view",
"SELECT * FROM wooden_fish_gallery_card_view",
"SELECT * FROM custom_world_gallery_entry",
"SELECT * FROM match_3_d_gallery_view",
"SELECT * FROM square_hole_gallery_view",
@@ -578,6 +588,7 @@ impl SpacetimeClient {
for query in [
"SELECT * FROM public_work_play_daily_stat WHERE source_type = 'puzzle'",
"SELECT * FROM public_work_play_daily_stat WHERE source_type = 'jump-hop'",
"SELECT * FROM public_work_play_daily_stat WHERE source_type = 'wooden-fish'",
"SELECT * FROM public_work_play_daily_stat WHERE source_type = 'custom-world'",
"SELECT * FROM public_work_play_daily_stat WHERE source_type = 'match3d'",
"SELECT * FROM public_work_play_daily_stat WHERE source_type = 'square-hole'",

View File

@@ -18,6 +18,7 @@ mod runtime_profile;
mod square_hole;
mod story;
mod visual_novel;
mod wooden_fish;
pub use self::ai::{
AiResultReferenceRecord, AiTaskMutationRecord, AiTaskRecord, AiTaskStageRecord,
@@ -118,6 +119,16 @@ pub use self::runtime_profile::{
SquareHoleDropConfirmationRecord, SquareHoleDropFeedbackRecord, SquareHoleRunRecord,
};
pub use self::story::{VisualNovelRuntimeEventRecord, VisualNovelRuntimeEventRecordInput};
pub use self::wooden_fish::{
WoodenFishActionRequest, WoodenFishActionResponse, WoodenFishActionType, WoodenFishAudioAsset,
WoodenFishCheckpointRunRequest, WoodenFishDraftResponse, WoodenFishFinishRunRequest,
WoodenFishGalleryCardResponse, WoodenFishGalleryDetailResponse, WoodenFishGalleryResponse,
WoodenFishGenerationStatus, WoodenFishImageAsset, WoodenFishRunResponse, WoodenFishRunStatus,
WoodenFishRuntimeRunSnapshotResponse, WoodenFishSessionResponse,
WoodenFishSessionSnapshotResponse, WoodenFishStartRunRequest, WoodenFishWordCounter,
WoodenFishWorkDetailResponse, WoodenFishWorkMutationResponse, WoodenFishWorkProfileResponse,
WoodenFishWorkSummaryResponse, WoodenFishWorkspaceCreateRequest,
};
pub(crate) use self::ai::map_ai_task_procedure_result;
pub(crate) use self::assets::{
@@ -223,3 +234,8 @@ pub(crate) use self::visual_novel::{
map_visual_novel_runtime_event_procedure_result, map_visual_novel_work_procedure_result,
map_visual_novel_works_procedure_result,
};
pub(crate) use self::wooden_fish::{
map_wooden_fish_agent_session_procedure_result, map_wooden_fish_gallery_card_view_row,
map_wooden_fish_run_procedure_result, map_wooden_fish_work_procedure_result,
map_wooden_fish_works_procedure_result,
};

View File

@@ -0,0 +1,240 @@
use super::*;
pub use shared_contracts::wooden_fish::{
WoodenFishActionRequest, WoodenFishActionResponse, WoodenFishActionType, WoodenFishAudioAsset,
WoodenFishCheckpointRunRequest, WoodenFishDraftResponse, WoodenFishFinishRunRequest,
WoodenFishGalleryCardResponse, WoodenFishGalleryDetailResponse, WoodenFishGalleryResponse,
WoodenFishGenerationStatus, WoodenFishImageAsset, WoodenFishRunResponse, WoodenFishRunStatus,
WoodenFishRuntimeRunSnapshotResponse, WoodenFishSessionResponse,
WoodenFishSessionSnapshotResponse, WoodenFishStartRunRequest, WoodenFishWordCounter,
WoodenFishWorkDetailResponse, WoodenFishWorkMutationResponse, WoodenFishWorkProfileResponse,
WoodenFishWorkSummaryResponse, WoodenFishWorkspaceCreateRequest,
};
pub(crate) fn map_wooden_fish_agent_session_procedure_result(
result: WoodenFishAgentSessionProcedureResult,
) -> Result<WoodenFishSessionSnapshotResponse, SpacetimeClientError> {
if !result.ok {
return Err(SpacetimeClientError::procedure_failed(result.error_message));
}
let session = result
.session
.ok_or_else(|| SpacetimeClientError::missing_snapshot("wooden fish agent session 快照"))?;
Ok(map_wooden_fish_session_snapshot(session))
}
pub(crate) fn map_wooden_fish_work_procedure_result(
result: WoodenFishWorkProcedureResult,
) -> Result<WoodenFishWorkProfileResponse, SpacetimeClientError> {
if !result.ok {
return Err(SpacetimeClientError::procedure_failed(result.error_message));
}
let work = result
.work
.ok_or_else(|| SpacetimeClientError::missing_snapshot("wooden fish work 快照"))?;
map_wooden_fish_work_snapshot(work)
}
pub(crate) fn map_wooden_fish_works_procedure_result(
result: WoodenFishWorksProcedureResult,
) -> Result<Vec<WoodenFishWorkProfileResponse>, SpacetimeClientError> {
if !result.ok {
return Err(SpacetimeClientError::procedure_failed(result.error_message));
}
result
.items
.into_iter()
.map(map_wooden_fish_work_snapshot)
.collect()
}
pub(crate) fn map_wooden_fish_run_procedure_result(
result: WoodenFishRunProcedureResult,
) -> Result<WoodenFishRuntimeRunSnapshotResponse, SpacetimeClientError> {
if !result.ok {
return Err(SpacetimeClientError::procedure_failed(result.error_message));
}
let run = result
.run
.ok_or_else(|| SpacetimeClientError::missing_snapshot("wooden fish run 快照"))?;
Ok(map_wooden_fish_run_snapshot(run))
}
pub(crate) fn map_wooden_fish_gallery_card_view_row(
row: WoodenFishGalleryCardViewRow,
) -> WoodenFishGalleryCardResponse {
WoodenFishGalleryCardResponse {
public_work_code: row.public_work_code,
work_id: row.work_id,
profile_id: row.profile_id,
owner_user_id: row.owner_user_id,
author_display_name: row.author_display_name,
work_title: row.work_title,
work_description: row.work_description,
cover_image_src: empty_string_to_none(row.cover_image_src),
theme_tags: row.theme_tags,
publication_status: normalize_publication_status(&row.publication_status).to_string(),
play_count: row.play_count,
updated_at: format_timestamp_micros(row.updated_at_micros),
published_at: row.published_at_micros.map(format_timestamp_micros),
generation_status: parse_generation_status(&row.generation_status),
}
}
fn map_wooden_fish_session_snapshot(
snapshot: WoodenFishAgentSessionSnapshot,
) -> WoodenFishSessionSnapshotResponse {
WoodenFishSessionSnapshotResponse {
session_id: snapshot.session_id,
owner_user_id: snapshot.owner_user_id,
status: snapshot
.draft
.as_ref()
.map(|draft| parse_generation_status(&draft.generation_status))
.unwrap_or(WoodenFishGenerationStatus::Draft),
draft: snapshot.draft.map(map_wooden_fish_draft_snapshot),
created_at: format_timestamp_micros(snapshot.created_at_micros),
updated_at: format_timestamp_micros(snapshot.updated_at_micros),
}
}
fn map_wooden_fish_work_snapshot(
snapshot: WoodenFishWorkSnapshot,
) -> Result<WoodenFishWorkProfileResponse, SpacetimeClientError> {
let draft = WoodenFishDraftResponse {
template_id: "wooden-fish".to_string(),
template_name: "敲木鱼".to_string(),
profile_id: Some(snapshot.profile_id.clone()),
work_title: snapshot.work_title.clone(),
work_description: snapshot.work_description.clone(),
theme_tags: snapshot.theme_tags.clone(),
hit_object_prompt: snapshot.hit_object_prompt.clone(),
hit_object_reference_image_src: snapshot.hit_object_reference_image_src.clone(),
hit_sound_prompt: snapshot.hit_sound_prompt.clone(),
floating_words: snapshot.floating_words.clone(),
hit_object_asset: snapshot.hit_object_asset.clone().map(map_image_asset),
background_asset: snapshot.background_asset.clone().map(map_image_asset),
hit_sound_asset: snapshot.hit_sound_asset.clone().map(map_audio_asset),
cover_image_src: empty_string_to_none(snapshot.cover_image_src.clone()),
generation_status: parse_generation_status(&snapshot.generation_status),
};
let hit_object_asset = draft
.hit_object_asset
.clone()
.ok_or_else(|| SpacetimeClientError::missing_snapshot("wooden fish hit object asset"))?;
let hit_sound_asset = draft
.hit_sound_asset
.clone()
.ok_or_else(|| SpacetimeClientError::missing_snapshot("wooden fish hit sound asset"))?;
Ok(WoodenFishWorkProfileResponse {
summary: WoodenFishWorkSummaryResponse {
runtime_kind: "wooden-fish".to_string(),
work_id: snapshot.work_id,
profile_id: snapshot.profile_id,
owner_user_id: snapshot.owner_user_id,
source_session_id: empty_string_to_none(snapshot.source_session_id),
work_title: snapshot.work_title,
work_description: snapshot.work_description,
theme_tags: snapshot.theme_tags,
cover_image_src: empty_string_to_none(snapshot.cover_image_src),
publication_status: normalize_publication_status(&snapshot.publication_status)
.to_string(),
play_count: snapshot.play_count,
updated_at: format_timestamp_micros(snapshot.updated_at_micros),
published_at: snapshot.published_at_micros.map(format_timestamp_micros),
publish_ready: snapshot.publish_ready,
generation_status: parse_generation_status(&snapshot.generation_status),
},
draft,
hit_object_asset,
background_asset: snapshot.background_asset.map(map_image_asset),
hit_sound_asset,
floating_words: snapshot.floating_words,
})
}
fn map_wooden_fish_draft_snapshot(snapshot: WoodenFishDraftSnapshot) -> WoodenFishDraftResponse {
WoodenFishDraftResponse {
template_id: snapshot.template_id,
template_name: snapshot.template_name,
profile_id: snapshot.profile_id,
work_title: snapshot.work_title,
work_description: snapshot.work_description,
theme_tags: snapshot.theme_tags,
hit_object_prompt: snapshot.hit_object_prompt,
hit_object_reference_image_src: snapshot.hit_object_reference_image_src,
hit_sound_prompt: snapshot.hit_sound_prompt,
floating_words: snapshot.floating_words,
hit_object_asset: snapshot.hit_object_asset.map(map_image_asset),
background_asset: snapshot.background_asset.map(map_image_asset),
hit_sound_asset: snapshot.hit_sound_asset.map(map_audio_asset),
cover_image_src: snapshot.cover_image_src,
generation_status: parse_generation_status(&snapshot.generation_status),
}
}
fn map_image_asset(snapshot: WoodenFishImageAssetSnapshot) -> WoodenFishImageAsset {
WoodenFishImageAsset {
asset_id: snapshot.asset_id,
image_src: snapshot.image_src,
image_object_key: snapshot.image_object_key,
asset_object_id: snapshot.asset_object_id,
generation_provider: snapshot.generation_provider,
prompt: snapshot.prompt,
width: snapshot.width,
height: snapshot.height,
}
}
fn map_audio_asset(snapshot: WoodenFishAudioAssetSnapshot) -> WoodenFishAudioAsset {
WoodenFishAudioAsset {
asset_id: snapshot.asset_id,
audio_src: snapshot.audio_src,
audio_object_key: snapshot.audio_object_key,
asset_object_id: snapshot.asset_object_id,
source: snapshot.source,
prompt: snapshot.prompt,
duration_ms: snapshot.duration_ms,
}
}
fn map_wooden_fish_run_snapshot(
snapshot: crate::module_bindings::WoodenFishRunSnapshot,
) -> WoodenFishRuntimeRunSnapshotResponse {
WoodenFishRuntimeRunSnapshotResponse {
run_id: snapshot.run_id,
profile_id: snapshot.profile_id,
owner_user_id: snapshot.owner_user_id,
status: match snapshot.status {
crate::module_bindings::WoodenFishRunStatus::Playing => WoodenFishRunStatus::Playing,
crate::module_bindings::WoodenFishRunStatus::Finished => WoodenFishRunStatus::Finished,
},
total_tap_count: snapshot.total_tap_count,
word_counters: snapshot
.word_counters
.into_iter()
.map(|counter| WoodenFishWordCounter {
text: counter.text,
count: counter.count,
})
.collect(),
started_at_ms: snapshot.started_at_ms,
updated_at_ms: snapshot.updated_at_ms,
finished_at_ms: snapshot.finished_at_ms,
}
}
fn parse_generation_status(value: &str) -> WoodenFishGenerationStatus {
match value {
"generating" => WoodenFishGenerationStatus::Generating,
"ready" => WoodenFishGenerationStatus::Ready,
"failed" => WoodenFishGenerationStatus::Failed,
_ => WoodenFishGenerationStatus::Draft,
}
}
fn normalize_publication_status(value: &str) -> &str {
match value {
"Published" | "published" => "published",
_ => "draft",
}
}

View File

@@ -193,6 +193,7 @@ 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 checkpoint_wooden_fish_run_procedure;
pub mod claim_profile_task_reward_and_return_procedure;
pub mod claim_puzzle_work_point_incentive_procedure;
pub mod clear_database_migration_import_chunks_procedure;
@@ -206,6 +207,7 @@ pub mod compile_match_3_d_draft_procedure;
pub mod compile_puzzle_agent_draft_procedure;
pub mod compile_square_hole_draft_procedure;
pub mod compile_visual_novel_work_profile_procedure;
pub mod compile_wooden_fish_draft_procedure;
pub mod complete_ai_stage_and_return_procedure;
pub mod complete_ai_task_and_return_procedure;
pub mod confirm_asset_object_and_return_procedure;
@@ -227,6 +229,7 @@ pub mod create_profile_recharge_order_and_return_procedure;
pub mod create_puzzle_agent_session_procedure;
pub mod create_square_hole_agent_session_procedure;
pub mod create_visual_novel_agent_session_procedure;
pub mod create_wooden_fish_agent_session_procedure;
pub mod creation_entry_config_procedure_result_type;
pub mod creation_entry_config_snapshot_type;
pub mod creation_entry_config_table;
@@ -338,6 +341,7 @@ pub mod finalize_visual_novel_agent_message_turn_procedure;
pub mod finish_bark_battle_run_procedure;
pub mod finish_match_3_d_time_up_procedure;
pub mod finish_square_hole_time_up_procedure;
pub mod finish_wooden_fish_run_procedure;
pub mod generate_big_fish_asset_procedure;
pub mod get_auth_store_snapshot_procedure;
pub mod get_bark_battle_run_procedure;
@@ -380,6 +384,9 @@ pub mod get_story_session_state_procedure;
pub mod get_visual_novel_agent_session_procedure;
pub mod get_visual_novel_run_procedure;
pub mod get_visual_novel_work_detail_procedure;
pub mod get_wooden_fish_agent_session_procedure;
pub mod get_wooden_fish_run_procedure;
pub mod get_wooden_fish_work_profile_procedure;
pub mod grant_inventory_item_input_type;
pub mod grant_new_user_registration_wallet_reward_procedure;
pub mod grant_player_progression_experience_and_return_procedure;
@@ -458,6 +465,7 @@ pub mod list_puzzle_works_procedure;
pub mod list_square_hole_works_procedure;
pub mod list_visual_novel_runtime_history_procedure;
pub mod list_visual_novel_works_procedure;
pub mod list_wooden_fish_works_procedure;
pub mod mark_profile_recharge_order_paid_and_return_procedure;
pub mod match_3_d_agent_message_finalize_input_type;
pub mod match_3_d_agent_message_row_type;
@@ -564,6 +572,7 @@ pub mod publish_match_3_d_work_procedure;
pub mod publish_puzzle_work_procedure;
pub mod publish_square_hole_work_procedure;
pub mod publish_visual_novel_work_procedure;
pub mod publish_wooden_fish_work_procedure;
pub mod put_database_migration_import_chunk_procedure;
pub mod puzzle_agent_message_finalize_input_type;
pub mod puzzle_agent_message_kind_type;
@@ -878,6 +887,7 @@ pub mod start_match_3_d_run_procedure;
pub mod start_puzzle_run_procedure;
pub mod start_square_hole_run_procedure;
pub mod start_visual_novel_run_procedure;
pub mod start_wooden_fish_run_procedure;
pub mod stop_match_3_d_run_procedure;
pub mod stop_square_hole_run_procedure;
pub mod story_continue_input_type;
@@ -924,6 +934,7 @@ pub mod update_puzzle_run_pause_procedure;
pub mod update_puzzle_work_procedure;
pub mod update_square_hole_work_procedure;
pub mod update_visual_novel_work_procedure;
pub mod update_wooden_fish_work_procedure;
pub mod upsert_auth_store_snapshot_procedure;
pub mod upsert_chapter_progression_and_return_procedure;
pub mod upsert_chapter_progression_reducer;
@@ -986,6 +997,42 @@ pub mod visual_novel_work_snapshot_type;
pub mod visual_novel_work_update_input_type;
pub mod visual_novel_works_list_input_type;
pub mod visual_novel_works_procedure_result_type;
pub mod wooden_fish_agent_session_create_input_type;
pub mod wooden_fish_agent_session_get_input_type;
pub mod wooden_fish_agent_session_procedure_result_type;
pub mod wooden_fish_agent_session_row_type;
pub mod wooden_fish_agent_session_snapshot_type;
pub mod wooden_fish_agent_session_table;
pub mod wooden_fish_audio_asset_snapshot_type;
pub mod wooden_fish_creator_config_snapshot_type;
pub mod wooden_fish_draft_compile_input_type;
pub mod wooden_fish_draft_snapshot_type;
pub mod wooden_fish_event_row_type;
pub mod wooden_fish_event_table;
pub mod wooden_fish_gallery_card_view_row_type;
pub mod wooden_fish_gallery_card_view_table;
pub mod wooden_fish_gallery_view_row_type;
pub mod wooden_fish_gallery_view_table;
pub mod wooden_fish_image_asset_snapshot_type;
pub mod wooden_fish_run_checkpoint_input_type;
pub mod wooden_fish_run_finish_input_type;
pub mod wooden_fish_run_get_input_type;
pub mod wooden_fish_run_procedure_result_type;
pub mod wooden_fish_run_snapshot_type;
pub mod wooden_fish_run_start_input_type;
pub mod wooden_fish_run_status_type;
pub mod wooden_fish_runtime_run_row_type;
pub mod wooden_fish_runtime_run_table;
pub mod wooden_fish_word_counter_type;
pub mod wooden_fish_work_get_input_type;
pub mod wooden_fish_work_procedure_result_type;
pub mod wooden_fish_work_profile_row_type;
pub mod wooden_fish_work_profile_table;
pub mod wooden_fish_work_publish_input_type;
pub mod wooden_fish_work_snapshot_type;
pub mod wooden_fish_work_update_input_type;
pub mod wooden_fish_works_list_input_type;
pub mod wooden_fish_works_procedure_result_type;
pub use accept_quest_reducer::accept_quest;
pub use acknowledge_quest_completion_reducer::acknowledge_quest_completion;
@@ -1174,6 +1221,7 @@ pub use chapter_progression_procedure_result_type::ChapterProgressionProcedureRe
pub use chapter_progression_snapshot_type::ChapterProgressionSnapshot;
pub use chapter_progression_table::*;
pub use chapter_progression_type::ChapterProgression;
pub use checkpoint_wooden_fish_run_procedure::checkpoint_wooden_fish_run;
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;
pub use clear_database_migration_import_chunks_procedure::clear_database_migration_import_chunks;
@@ -1187,6 +1235,7 @@ pub use compile_match_3_d_draft_procedure::compile_match_3_d_draft;
pub use compile_puzzle_agent_draft_procedure::compile_puzzle_agent_draft;
pub use compile_square_hole_draft_procedure::compile_square_hole_draft;
pub use compile_visual_novel_work_profile_procedure::compile_visual_novel_work_profile;
pub use compile_wooden_fish_draft_procedure::compile_wooden_fish_draft;
pub use complete_ai_stage_and_return_procedure::complete_ai_stage_and_return;
pub use complete_ai_task_and_return_procedure::complete_ai_task_and_return;
pub use confirm_asset_object_and_return_procedure::confirm_asset_object_and_return;
@@ -1208,6 +1257,7 @@ pub use create_profile_recharge_order_and_return_procedure::create_profile_recha
pub use create_puzzle_agent_session_procedure::create_puzzle_agent_session;
pub use create_square_hole_agent_session_procedure::create_square_hole_agent_session;
pub use create_visual_novel_agent_session_procedure::create_visual_novel_agent_session;
pub use create_wooden_fish_agent_session_procedure::create_wooden_fish_agent_session;
pub use creation_entry_config_procedure_result_type::CreationEntryConfigProcedureResult;
pub use creation_entry_config_snapshot_type::CreationEntryConfigSnapshot;
pub use creation_entry_config_table::*;
@@ -1319,6 +1369,7 @@ pub use finalize_visual_novel_agent_message_turn_procedure::finalize_visual_nove
pub use finish_bark_battle_run_procedure::finish_bark_battle_run;
pub use finish_match_3_d_time_up_procedure::finish_match_3_d_time_up;
pub use finish_square_hole_time_up_procedure::finish_square_hole_time_up;
pub use finish_wooden_fish_run_procedure::finish_wooden_fish_run;
pub use generate_big_fish_asset_procedure::generate_big_fish_asset;
pub use get_auth_store_snapshot_procedure::get_auth_store_snapshot;
pub use get_bark_battle_run_procedure::get_bark_battle_run;
@@ -1361,6 +1412,9 @@ pub use get_story_session_state_procedure::get_story_session_state;
pub use get_visual_novel_agent_session_procedure::get_visual_novel_agent_session;
pub use get_visual_novel_run_procedure::get_visual_novel_run;
pub use get_visual_novel_work_detail_procedure::get_visual_novel_work_detail;
pub use get_wooden_fish_agent_session_procedure::get_wooden_fish_agent_session;
pub use get_wooden_fish_run_procedure::get_wooden_fish_run;
pub use get_wooden_fish_work_profile_procedure::get_wooden_fish_work_profile;
pub use grant_inventory_item_input_type::GrantInventoryItemInput;
pub use grant_new_user_registration_wallet_reward_procedure::grant_new_user_registration_wallet_reward;
pub use grant_player_progression_experience_and_return_procedure::grant_player_progression_experience_and_return;
@@ -1439,6 +1493,7 @@ pub use list_puzzle_works_procedure::list_puzzle_works;
pub use list_square_hole_works_procedure::list_square_hole_works;
pub use list_visual_novel_runtime_history_procedure::list_visual_novel_runtime_history;
pub use list_visual_novel_works_procedure::list_visual_novel_works;
pub use list_wooden_fish_works_procedure::list_wooden_fish_works;
pub use mark_profile_recharge_order_paid_and_return_procedure::mark_profile_recharge_order_paid_and_return;
pub use match_3_d_agent_message_finalize_input_type::Match3DAgentMessageFinalizeInput;
pub use match_3_d_agent_message_row_type::Match3DAgentMessageRow;
@@ -1545,6 +1600,7 @@ pub use publish_match_3_d_work_procedure::publish_match_3_d_work;
pub use publish_puzzle_work_procedure::publish_puzzle_work;
pub use publish_square_hole_work_procedure::publish_square_hole_work;
pub use publish_visual_novel_work_procedure::publish_visual_novel_work;
pub use publish_wooden_fish_work_procedure::publish_wooden_fish_work;
pub use put_database_migration_import_chunk_procedure::put_database_migration_import_chunk;
pub use puzzle_agent_message_finalize_input_type::PuzzleAgentMessageFinalizeInput;
pub use puzzle_agent_message_kind_type::PuzzleAgentMessageKind;
@@ -1859,6 +1915,7 @@ pub use start_match_3_d_run_procedure::start_match_3_d_run;
pub use start_puzzle_run_procedure::start_puzzle_run;
pub use start_square_hole_run_procedure::start_square_hole_run;
pub use start_visual_novel_run_procedure::start_visual_novel_run;
pub use start_wooden_fish_run_procedure::start_wooden_fish_run;
pub use stop_match_3_d_run_procedure::stop_match_3_d_run;
pub use stop_square_hole_run_procedure::stop_square_hole_run;
pub use story_continue_input_type::StoryContinueInput;
@@ -1905,6 +1962,7 @@ pub use update_puzzle_run_pause_procedure::update_puzzle_run_pause;
pub use update_puzzle_work_procedure::update_puzzle_work;
pub use update_square_hole_work_procedure::update_square_hole_work;
pub use update_visual_novel_work_procedure::update_visual_novel_work;
pub use update_wooden_fish_work_procedure::update_wooden_fish_work;
pub use upsert_auth_store_snapshot_procedure::upsert_auth_store_snapshot;
pub use upsert_chapter_progression_and_return_procedure::upsert_chapter_progression_and_return;
pub use upsert_chapter_progression_reducer::upsert_chapter_progression;
@@ -1967,6 +2025,42 @@ pub use visual_novel_work_snapshot_type::VisualNovelWorkSnapshot;
pub use visual_novel_work_update_input_type::VisualNovelWorkUpdateInput;
pub use visual_novel_works_list_input_type::VisualNovelWorksListInput;
pub use visual_novel_works_procedure_result_type::VisualNovelWorksProcedureResult;
pub use wooden_fish_agent_session_create_input_type::WoodenFishAgentSessionCreateInput;
pub use wooden_fish_agent_session_get_input_type::WoodenFishAgentSessionGetInput;
pub use wooden_fish_agent_session_procedure_result_type::WoodenFishAgentSessionProcedureResult;
pub use wooden_fish_agent_session_row_type::WoodenFishAgentSessionRow;
pub use wooden_fish_agent_session_snapshot_type::WoodenFishAgentSessionSnapshot;
pub use wooden_fish_agent_session_table::*;
pub use wooden_fish_audio_asset_snapshot_type::WoodenFishAudioAssetSnapshot;
pub use wooden_fish_creator_config_snapshot_type::WoodenFishCreatorConfigSnapshot;
pub use wooden_fish_draft_compile_input_type::WoodenFishDraftCompileInput;
pub use wooden_fish_draft_snapshot_type::WoodenFishDraftSnapshot;
pub use wooden_fish_event_row_type::WoodenFishEventRow;
pub use wooden_fish_event_table::*;
pub use wooden_fish_gallery_card_view_row_type::WoodenFishGalleryCardViewRow;
pub use wooden_fish_gallery_card_view_table::*;
pub use wooden_fish_gallery_view_row_type::WoodenFishGalleryViewRow;
pub use wooden_fish_gallery_view_table::*;
pub use wooden_fish_image_asset_snapshot_type::WoodenFishImageAssetSnapshot;
pub use wooden_fish_run_checkpoint_input_type::WoodenFishRunCheckpointInput;
pub use wooden_fish_run_finish_input_type::WoodenFishRunFinishInput;
pub use wooden_fish_run_get_input_type::WoodenFishRunGetInput;
pub use wooden_fish_run_procedure_result_type::WoodenFishRunProcedureResult;
pub use wooden_fish_run_snapshot_type::WoodenFishRunSnapshot;
pub use wooden_fish_run_start_input_type::WoodenFishRunStartInput;
pub use wooden_fish_run_status_type::WoodenFishRunStatus;
pub use wooden_fish_runtime_run_row_type::WoodenFishRuntimeRunRow;
pub use wooden_fish_runtime_run_table::*;
pub use wooden_fish_word_counter_type::WoodenFishWordCounter;
pub use wooden_fish_work_get_input_type::WoodenFishWorkGetInput;
pub use wooden_fish_work_procedure_result_type::WoodenFishWorkProcedureResult;
pub use wooden_fish_work_profile_row_type::WoodenFishWorkProfileRow;
pub use wooden_fish_work_profile_table::*;
pub use wooden_fish_work_publish_input_type::WoodenFishWorkPublishInput;
pub use wooden_fish_work_snapshot_type::WoodenFishWorkSnapshot;
pub use wooden_fish_work_update_input_type::WoodenFishWorkUpdateInput;
pub use wooden_fish_works_list_input_type::WoodenFishWorksListInput;
pub use wooden_fish_works_procedure_result_type::WoodenFishWorksProcedureResult;
#[derive(Clone, PartialEq, Debug)]
@@ -2342,6 +2436,12 @@ pub struct DbUpdate {
visual_novel_runtime_history_entry: __sdk::TableUpdate<VisualNovelRuntimeHistoryEntryRow>,
visual_novel_runtime_run: __sdk::TableUpdate<VisualNovelRuntimeRunRow>,
visual_novel_work_profile: __sdk::TableUpdate<VisualNovelWorkProfileRow>,
wooden_fish_agent_session: __sdk::TableUpdate<WoodenFishAgentSessionRow>,
wooden_fish_event: __sdk::TableUpdate<WoodenFishEventRow>,
wooden_fish_gallery_card_view: __sdk::TableUpdate<WoodenFishGalleryCardViewRow>,
wooden_fish_gallery_view: __sdk::TableUpdate<WoodenFishGalleryViewRow>,
wooden_fish_runtime_run: __sdk::TableUpdate<WoodenFishRuntimeRunRow>,
wooden_fish_work_profile: __sdk::TableUpdate<WoodenFishWorkProfileRow>,
}
impl TryFrom<__ws::v2::TransactionUpdate> for DbUpdate {
@@ -2668,6 +2768,24 @@ impl TryFrom<__ws::v2::TransactionUpdate> for DbUpdate {
"visual_novel_work_profile" => db_update.visual_novel_work_profile.append(
visual_novel_work_profile_table::parse_table_update(table_update)?,
),
"wooden_fish_agent_session" => db_update.wooden_fish_agent_session.append(
wooden_fish_agent_session_table::parse_table_update(table_update)?,
),
"wooden_fish_event" => db_update
.wooden_fish_event
.append(wooden_fish_event_table::parse_table_update(table_update)?),
"wooden_fish_gallery_card_view" => db_update.wooden_fish_gallery_card_view.append(
wooden_fish_gallery_card_view_table::parse_table_update(table_update)?,
),
"wooden_fish_gallery_view" => db_update.wooden_fish_gallery_view.append(
wooden_fish_gallery_view_table::parse_table_update(table_update)?,
),
"wooden_fish_runtime_run" => db_update.wooden_fish_runtime_run.append(
wooden_fish_runtime_run_table::parse_table_update(table_update)?,
),
"wooden_fish_work_profile" => db_update.wooden_fish_work_profile.append(
wooden_fish_work_profile_table::parse_table_update(table_update)?,
),
unknown => {
return Err(__sdk::InternalError::unknown_name(
@@ -3171,6 +3289,27 @@ impl __sdk::DbUpdate for DbUpdate {
"bark_battle_gallery_view",
&self.bark_battle_gallery_view,
);
diff.wooden_fish_agent_session = cache
.apply_diff_to_table::<WoodenFishAgentSessionRow>(
"wooden_fish_agent_session",
&self.wooden_fish_agent_session,
)
.with_updates_by_pk(|row| &row.session_id);
diff.wooden_fish_event = cache
.apply_diff_to_table::<WoodenFishEventRow>("wooden_fish_event", &self.wooden_fish_event)
.with_updates_by_pk(|row| &row.event_id);
diff.wooden_fish_runtime_run = cache
.apply_diff_to_table::<WoodenFishRuntimeRunRow>(
"wooden_fish_runtime_run",
&self.wooden_fish_runtime_run,
)
.with_updates_by_pk(|row| &row.run_id);
diff.wooden_fish_work_profile = cache
.apply_diff_to_table::<WoodenFishWorkProfileRow>(
"wooden_fish_work_profile",
&self.wooden_fish_work_profile,
)
.with_updates_by_pk(|row| &row.profile_id);
diff.big_fish_gallery_view = cache.apply_diff_to_table::<BigFishWorkSummarySnapshot>(
"big_fish_gallery_view",
&self.big_fish_gallery_view,
@@ -3203,6 +3342,15 @@ impl __sdk::DbUpdate for DbUpdate {
"visual_novel_gallery_view",
&self.visual_novel_gallery_view,
);
diff.wooden_fish_gallery_card_view = cache
.apply_diff_to_table::<WoodenFishGalleryCardViewRow>(
"wooden_fish_gallery_card_view",
&self.wooden_fish_gallery_card_view,
);
diff.wooden_fish_gallery_view = cache.apply_diff_to_table::<WoodenFishGalleryViewRow>(
"wooden_fish_gallery_view",
&self.wooden_fish_gallery_view,
);
diff
}
@@ -3516,6 +3664,24 @@ impl __sdk::DbUpdate for DbUpdate {
"visual_novel_work_profile" => db_update
.visual_novel_work_profile
.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
"wooden_fish_agent_session" => db_update
.wooden_fish_agent_session
.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
"wooden_fish_event" => db_update
.wooden_fish_event
.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
"wooden_fish_gallery_card_view" => db_update
.wooden_fish_gallery_card_view
.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
"wooden_fish_gallery_view" => db_update
.wooden_fish_gallery_view
.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
"wooden_fish_runtime_run" => db_update
.wooden_fish_runtime_run
.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
"wooden_fish_work_profile" => db_update
.wooden_fish_work_profile
.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
unknown => {
return Err(
__sdk::InternalError::unknown_name("table", unknown, "QueryRows").into(),
@@ -3835,6 +4001,24 @@ impl __sdk::DbUpdate for DbUpdate {
"visual_novel_work_profile" => db_update
.visual_novel_work_profile
.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
"wooden_fish_agent_session" => db_update
.wooden_fish_agent_session
.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
"wooden_fish_event" => db_update
.wooden_fish_event
.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
"wooden_fish_gallery_card_view" => db_update
.wooden_fish_gallery_card_view
.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
"wooden_fish_gallery_view" => db_update
.wooden_fish_gallery_view
.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
"wooden_fish_runtime_run" => db_update
.wooden_fish_runtime_run
.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
"wooden_fish_work_profile" => db_update
.wooden_fish_work_profile
.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
unknown => {
return Err(
__sdk::InternalError::unknown_name("table", unknown, "QueryRows").into(),
@@ -3955,6 +4139,12 @@ pub struct AppliedDiff<'r> {
__sdk::TableAppliedDiff<'r, VisualNovelRuntimeHistoryEntryRow>,
visual_novel_runtime_run: __sdk::TableAppliedDiff<'r, VisualNovelRuntimeRunRow>,
visual_novel_work_profile: __sdk::TableAppliedDiff<'r, VisualNovelWorkProfileRow>,
wooden_fish_agent_session: __sdk::TableAppliedDiff<'r, WoodenFishAgentSessionRow>,
wooden_fish_event: __sdk::TableAppliedDiff<'r, WoodenFishEventRow>,
wooden_fish_gallery_card_view: __sdk::TableAppliedDiff<'r, WoodenFishGalleryCardViewRow>,
wooden_fish_gallery_view: __sdk::TableAppliedDiff<'r, WoodenFishGalleryViewRow>,
wooden_fish_runtime_run: __sdk::TableAppliedDiff<'r, WoodenFishRuntimeRunRow>,
wooden_fish_work_profile: __sdk::TableAppliedDiff<'r, WoodenFishWorkProfileRow>,
__unused: std::marker::PhantomData<&'r ()>,
}
@@ -4458,6 +4648,36 @@ impl<'r> __sdk::AppliedDiff<'r> for AppliedDiff<'r> {
&self.visual_novel_work_profile,
event,
);
callbacks.invoke_table_row_callbacks::<WoodenFishAgentSessionRow>(
"wooden_fish_agent_session",
&self.wooden_fish_agent_session,
event,
);
callbacks.invoke_table_row_callbacks::<WoodenFishEventRow>(
"wooden_fish_event",
&self.wooden_fish_event,
event,
);
callbacks.invoke_table_row_callbacks::<WoodenFishGalleryCardViewRow>(
"wooden_fish_gallery_card_view",
&self.wooden_fish_gallery_card_view,
event,
);
callbacks.invoke_table_row_callbacks::<WoodenFishGalleryViewRow>(
"wooden_fish_gallery_view",
&self.wooden_fish_gallery_view,
event,
);
callbacks.invoke_table_row_callbacks::<WoodenFishRuntimeRunRow>(
"wooden_fish_runtime_run",
&self.wooden_fish_runtime_run,
event,
);
callbacks.invoke_table_row_callbacks::<WoodenFishWorkProfileRow>(
"wooden_fish_work_profile",
&self.wooden_fish_work_profile,
event,
);
}
}
@@ -5220,6 +5440,12 @@ impl __sdk::SpacetimeModule for RemoteModule {
visual_novel_runtime_history_entry_table::register_table(client_cache);
visual_novel_runtime_run_table::register_table(client_cache);
visual_novel_work_profile_table::register_table(client_cache);
wooden_fish_agent_session_table::register_table(client_cache);
wooden_fish_event_table::register_table(client_cache);
wooden_fish_gallery_card_view_table::register_table(client_cache);
wooden_fish_gallery_view_table::register_table(client_cache);
wooden_fish_runtime_run_table::register_table(client_cache);
wooden_fish_work_profile_table::register_table(client_cache);
}
const ALL_TABLE_NAMES: &'static [&'static str] = &[
"ai_result_reference",
@@ -5324,5 +5550,11 @@ impl __sdk::SpacetimeModule for RemoteModule {
"visual_novel_runtime_history_entry",
"visual_novel_runtime_run",
"visual_novel_work_profile",
"wooden_fish_agent_session",
"wooden_fish_event",
"wooden_fish_gallery_card_view",
"wooden_fish_gallery_view",
"wooden_fish_runtime_run",
"wooden_fish_work_profile",
];
}

View File

@@ -0,0 +1,59 @@
// 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::wooden_fish_run_checkpoint_input_type::WoodenFishRunCheckpointInput;
use super::wooden_fish_run_procedure_result_type::WoodenFishRunProcedureResult;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
struct CheckpointWoodenFishRunArgs {
pub input: WoodenFishRunCheckpointInput,
}
impl __sdk::InModule for CheckpointWoodenFishRunArgs {
type Module = super::RemoteModule;
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the procedure `checkpoint_wooden_fish_run`.
///
/// Implemented for [`super::RemoteProcedures`].
pub trait checkpoint_wooden_fish_run {
fn checkpoint_wooden_fish_run(&self, input: WoodenFishRunCheckpointInput) {
self.checkpoint_wooden_fish_run_then(input, |_, _| {});
}
fn checkpoint_wooden_fish_run_then(
&self,
input: WoodenFishRunCheckpointInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<WoodenFishRunProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
impl checkpoint_wooden_fish_run for super::RemoteProcedures {
fn checkpoint_wooden_fish_run_then(
&self,
input: WoodenFishRunCheckpointInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<WoodenFishRunProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, WoodenFishRunProcedureResult>(
"checkpoint_wooden_fish_run",
CheckpointWoodenFishRunArgs { input },
__callback,
);
}
}

View File

@@ -0,0 +1,59 @@
// 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::wooden_fish_agent_session_procedure_result_type::WoodenFishAgentSessionProcedureResult;
use super::wooden_fish_draft_compile_input_type::WoodenFishDraftCompileInput;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
struct CompileWoodenFishDraftArgs {
pub input: WoodenFishDraftCompileInput,
}
impl __sdk::InModule for CompileWoodenFishDraftArgs {
type Module = super::RemoteModule;
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the procedure `compile_wooden_fish_draft`.
///
/// Implemented for [`super::RemoteProcedures`].
pub trait compile_wooden_fish_draft {
fn compile_wooden_fish_draft(&self, input: WoodenFishDraftCompileInput) {
self.compile_wooden_fish_draft_then(input, |_, _| {});
}
fn compile_wooden_fish_draft_then(
&self,
input: WoodenFishDraftCompileInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<WoodenFishAgentSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
impl compile_wooden_fish_draft for super::RemoteProcedures {
fn compile_wooden_fish_draft_then(
&self,
input: WoodenFishDraftCompileInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<WoodenFishAgentSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, WoodenFishAgentSessionProcedureResult>(
"compile_wooden_fish_draft",
CompileWoodenFishDraftArgs { input },
__callback,
);
}
}

View File

@@ -0,0 +1,59 @@
// 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::wooden_fish_agent_session_create_input_type::WoodenFishAgentSessionCreateInput;
use super::wooden_fish_agent_session_procedure_result_type::WoodenFishAgentSessionProcedureResult;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
struct CreateWoodenFishAgentSessionArgs {
pub input: WoodenFishAgentSessionCreateInput,
}
impl __sdk::InModule for CreateWoodenFishAgentSessionArgs {
type Module = super::RemoteModule;
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the procedure `create_wooden_fish_agent_session`.
///
/// Implemented for [`super::RemoteProcedures`].
pub trait create_wooden_fish_agent_session {
fn create_wooden_fish_agent_session(&self, input: WoodenFishAgentSessionCreateInput) {
self.create_wooden_fish_agent_session_then(input, |_, _| {});
}
fn create_wooden_fish_agent_session_then(
&self,
input: WoodenFishAgentSessionCreateInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<WoodenFishAgentSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
impl create_wooden_fish_agent_session for super::RemoteProcedures {
fn create_wooden_fish_agent_session_then(
&self,
input: WoodenFishAgentSessionCreateInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<WoodenFishAgentSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, WoodenFishAgentSessionProcedureResult>(
"create_wooden_fish_agent_session",
CreateWoodenFishAgentSessionArgs { input },
__callback,
);
}
}

View File

@@ -0,0 +1,59 @@
// 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::wooden_fish_run_finish_input_type::WoodenFishRunFinishInput;
use super::wooden_fish_run_procedure_result_type::WoodenFishRunProcedureResult;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
struct FinishWoodenFishRunArgs {
pub input: WoodenFishRunFinishInput,
}
impl __sdk::InModule for FinishWoodenFishRunArgs {
type Module = super::RemoteModule;
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the procedure `finish_wooden_fish_run`.
///
/// Implemented for [`super::RemoteProcedures`].
pub trait finish_wooden_fish_run {
fn finish_wooden_fish_run(&self, input: WoodenFishRunFinishInput) {
self.finish_wooden_fish_run_then(input, |_, _| {});
}
fn finish_wooden_fish_run_then(
&self,
input: WoodenFishRunFinishInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<WoodenFishRunProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
impl finish_wooden_fish_run for super::RemoteProcedures {
fn finish_wooden_fish_run_then(
&self,
input: WoodenFishRunFinishInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<WoodenFishRunProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, WoodenFishRunProcedureResult>(
"finish_wooden_fish_run",
FinishWoodenFishRunArgs { input },
__callback,
);
}
}

View File

@@ -0,0 +1,59 @@
// 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::wooden_fish_agent_session_get_input_type::WoodenFishAgentSessionGetInput;
use super::wooden_fish_agent_session_procedure_result_type::WoodenFishAgentSessionProcedureResult;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
struct GetWoodenFishAgentSessionArgs {
pub input: WoodenFishAgentSessionGetInput,
}
impl __sdk::InModule for GetWoodenFishAgentSessionArgs {
type Module = super::RemoteModule;
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the procedure `get_wooden_fish_agent_session`.
///
/// Implemented for [`super::RemoteProcedures`].
pub trait get_wooden_fish_agent_session {
fn get_wooden_fish_agent_session(&self, input: WoodenFishAgentSessionGetInput) {
self.get_wooden_fish_agent_session_then(input, |_, _| {});
}
fn get_wooden_fish_agent_session_then(
&self,
input: WoodenFishAgentSessionGetInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<WoodenFishAgentSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
impl get_wooden_fish_agent_session for super::RemoteProcedures {
fn get_wooden_fish_agent_session_then(
&self,
input: WoodenFishAgentSessionGetInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<WoodenFishAgentSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, WoodenFishAgentSessionProcedureResult>(
"get_wooden_fish_agent_session",
GetWoodenFishAgentSessionArgs { input },
__callback,
);
}
}

View File

@@ -0,0 +1,59 @@
// 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::wooden_fish_run_get_input_type::WoodenFishRunGetInput;
use super::wooden_fish_run_procedure_result_type::WoodenFishRunProcedureResult;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
struct GetWoodenFishRunArgs {
pub input: WoodenFishRunGetInput,
}
impl __sdk::InModule for GetWoodenFishRunArgs {
type Module = super::RemoteModule;
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the procedure `get_wooden_fish_run`.
///
/// Implemented for [`super::RemoteProcedures`].
pub trait get_wooden_fish_run {
fn get_wooden_fish_run(&self, input: WoodenFishRunGetInput) {
self.get_wooden_fish_run_then(input, |_, _| {});
}
fn get_wooden_fish_run_then(
&self,
input: WoodenFishRunGetInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<WoodenFishRunProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
impl get_wooden_fish_run for super::RemoteProcedures {
fn get_wooden_fish_run_then(
&self,
input: WoodenFishRunGetInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<WoodenFishRunProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, WoodenFishRunProcedureResult>(
"get_wooden_fish_run",
GetWoodenFishRunArgs { input },
__callback,
);
}
}

View File

@@ -0,0 +1,59 @@
// 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::wooden_fish_work_get_input_type::WoodenFishWorkGetInput;
use super::wooden_fish_work_procedure_result_type::WoodenFishWorkProcedureResult;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
struct GetWoodenFishWorkProfileArgs {
pub input: WoodenFishWorkGetInput,
}
impl __sdk::InModule for GetWoodenFishWorkProfileArgs {
type Module = super::RemoteModule;
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the procedure `get_wooden_fish_work_profile`.
///
/// Implemented for [`super::RemoteProcedures`].
pub trait get_wooden_fish_work_profile {
fn get_wooden_fish_work_profile(&self, input: WoodenFishWorkGetInput) {
self.get_wooden_fish_work_profile_then(input, |_, _| {});
}
fn get_wooden_fish_work_profile_then(
&self,
input: WoodenFishWorkGetInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<WoodenFishWorkProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
impl get_wooden_fish_work_profile for super::RemoteProcedures {
fn get_wooden_fish_work_profile_then(
&self,
input: WoodenFishWorkGetInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<WoodenFishWorkProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, WoodenFishWorkProcedureResult>(
"get_wooden_fish_work_profile",
GetWoodenFishWorkProfileArgs { input },
__callback,
);
}
}

View File

@@ -0,0 +1,59 @@
// 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::wooden_fish_works_list_input_type::WoodenFishWorksListInput;
use super::wooden_fish_works_procedure_result_type::WoodenFishWorksProcedureResult;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
struct ListWoodenFishWorksArgs {
pub input: WoodenFishWorksListInput,
}
impl __sdk::InModule for ListWoodenFishWorksArgs {
type Module = super::RemoteModule;
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the procedure `list_wooden_fish_works`.
///
/// Implemented for [`super::RemoteProcedures`].
pub trait list_wooden_fish_works {
fn list_wooden_fish_works(&self, input: WoodenFishWorksListInput) {
self.list_wooden_fish_works_then(input, |_, _| {});
}
fn list_wooden_fish_works_then(
&self,
input: WoodenFishWorksListInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<WoodenFishWorksProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
impl list_wooden_fish_works for super::RemoteProcedures {
fn list_wooden_fish_works_then(
&self,
input: WoodenFishWorksListInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<WoodenFishWorksProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, WoodenFishWorksProcedureResult>(
"list_wooden_fish_works",
ListWoodenFishWorksArgs { input },
__callback,
);
}
}

View File

@@ -0,0 +1,59 @@
// 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::wooden_fish_work_procedure_result_type::WoodenFishWorkProcedureResult;
use super::wooden_fish_work_publish_input_type::WoodenFishWorkPublishInput;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
struct PublishWoodenFishWorkArgs {
pub input: WoodenFishWorkPublishInput,
}
impl __sdk::InModule for PublishWoodenFishWorkArgs {
type Module = super::RemoteModule;
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the procedure `publish_wooden_fish_work`.
///
/// Implemented for [`super::RemoteProcedures`].
pub trait publish_wooden_fish_work {
fn publish_wooden_fish_work(&self, input: WoodenFishWorkPublishInput) {
self.publish_wooden_fish_work_then(input, |_, _| {});
}
fn publish_wooden_fish_work_then(
&self,
input: WoodenFishWorkPublishInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<WoodenFishWorkProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
impl publish_wooden_fish_work for super::RemoteProcedures {
fn publish_wooden_fish_work_then(
&self,
input: WoodenFishWorkPublishInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<WoodenFishWorkProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, WoodenFishWorkProcedureResult>(
"publish_wooden_fish_work",
PublishWoodenFishWorkArgs { input },
__callback,
);
}
}

View File

@@ -0,0 +1,59 @@
// 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::wooden_fish_run_procedure_result_type::WoodenFishRunProcedureResult;
use super::wooden_fish_run_start_input_type::WoodenFishRunStartInput;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
struct StartWoodenFishRunArgs {
pub input: WoodenFishRunStartInput,
}
impl __sdk::InModule for StartWoodenFishRunArgs {
type Module = super::RemoteModule;
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the procedure `start_wooden_fish_run`.
///
/// Implemented for [`super::RemoteProcedures`].
pub trait start_wooden_fish_run {
fn start_wooden_fish_run(&self, input: WoodenFishRunStartInput) {
self.start_wooden_fish_run_then(input, |_, _| {});
}
fn start_wooden_fish_run_then(
&self,
input: WoodenFishRunStartInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<WoodenFishRunProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
impl start_wooden_fish_run for super::RemoteProcedures {
fn start_wooden_fish_run_then(
&self,
input: WoodenFishRunStartInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<WoodenFishRunProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, WoodenFishRunProcedureResult>(
"start_wooden_fish_run",
StartWoodenFishRunArgs { input },
__callback,
);
}
}

View File

@@ -0,0 +1,59 @@
// 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::wooden_fish_work_procedure_result_type::WoodenFishWorkProcedureResult;
use super::wooden_fish_work_update_input_type::WoodenFishWorkUpdateInput;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
struct UpdateWoodenFishWorkArgs {
pub input: WoodenFishWorkUpdateInput,
}
impl __sdk::InModule for UpdateWoodenFishWorkArgs {
type Module = super::RemoteModule;
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the procedure `update_wooden_fish_work`.
///
/// Implemented for [`super::RemoteProcedures`].
pub trait update_wooden_fish_work {
fn update_wooden_fish_work(&self, input: WoodenFishWorkUpdateInput) {
self.update_wooden_fish_work_then(input, |_, _| {});
}
fn update_wooden_fish_work_then(
&self,
input: WoodenFishWorkUpdateInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<WoodenFishWorkProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
impl update_wooden_fish_work for super::RemoteProcedures {
fn update_wooden_fish_work_then(
&self,
input: WoodenFishWorkUpdateInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<WoodenFishWorkProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, WoodenFishWorkProcedureResult>(
"update_wooden_fish_work",
UpdateWoodenFishWorkArgs { input },
__callback,
);
}
}

View File

@@ -0,0 +1,22 @@
// 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 WoodenFishAgentSessionCreateInput {
pub session_id: String,
pub owner_user_id: String,
pub work_title: String,
pub work_description: String,
pub theme_tags_json: Option<String>,
pub config_json: Option<String>,
pub draft_json: Option<String>,
pub created_at_micros: i64,
}
impl __sdk::InModule for WoodenFishAgentSessionCreateInput {
type Module = super::RemoteModule;
}

View File

@@ -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 WoodenFishAgentSessionGetInput {
pub session_id: String,
pub owner_user_id: String,
}
impl __sdk::InModule for WoodenFishAgentSessionGetInput {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,19 @@
// 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::wooden_fish_agent_session_snapshot_type::WoodenFishAgentSessionSnapshot;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct WoodenFishAgentSessionProcedureResult {
pub ok: bool,
pub session: Option<WoodenFishAgentSessionSnapshot>,
pub error_message: Option<String>,
}
impl __sdk::InModule for WoodenFishAgentSessionProcedureResult {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,81 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct WoodenFishAgentSessionRow {
pub session_id: String,
pub owner_user_id: String,
pub current_turn: u32,
pub progress_percent: u32,
pub stage: String,
pub config_json: String,
pub draft_json: String,
pub published_profile_id: String,
pub created_at: __sdk::Timestamp,
pub updated_at: __sdk::Timestamp,
}
impl __sdk::InModule for WoodenFishAgentSessionRow {
type Module = super::RemoteModule;
}
/// Column accessor struct for the table `WoodenFishAgentSessionRow`.
///
/// Provides typed access to columns for query building.
pub struct WoodenFishAgentSessionRowCols {
pub session_id: __sdk::__query_builder::Col<WoodenFishAgentSessionRow, String>,
pub owner_user_id: __sdk::__query_builder::Col<WoodenFishAgentSessionRow, String>,
pub current_turn: __sdk::__query_builder::Col<WoodenFishAgentSessionRow, u32>,
pub progress_percent: __sdk::__query_builder::Col<WoodenFishAgentSessionRow, u32>,
pub stage: __sdk::__query_builder::Col<WoodenFishAgentSessionRow, String>,
pub config_json: __sdk::__query_builder::Col<WoodenFishAgentSessionRow, String>,
pub draft_json: __sdk::__query_builder::Col<WoodenFishAgentSessionRow, String>,
pub published_profile_id: __sdk::__query_builder::Col<WoodenFishAgentSessionRow, String>,
pub created_at: __sdk::__query_builder::Col<WoodenFishAgentSessionRow, __sdk::Timestamp>,
pub updated_at: __sdk::__query_builder::Col<WoodenFishAgentSessionRow, __sdk::Timestamp>,
}
impl __sdk::__query_builder::HasCols for WoodenFishAgentSessionRow {
type Cols = WoodenFishAgentSessionRowCols;
fn cols(table_name: &'static str) -> Self::Cols {
WoodenFishAgentSessionRowCols {
session_id: __sdk::__query_builder::Col::new(table_name, "session_id"),
owner_user_id: __sdk::__query_builder::Col::new(table_name, "owner_user_id"),
current_turn: __sdk::__query_builder::Col::new(table_name, "current_turn"),
progress_percent: __sdk::__query_builder::Col::new(table_name, "progress_percent"),
stage: __sdk::__query_builder::Col::new(table_name, "stage"),
config_json: __sdk::__query_builder::Col::new(table_name, "config_json"),
draft_json: __sdk::__query_builder::Col::new(table_name, "draft_json"),
published_profile_id: __sdk::__query_builder::Col::new(
table_name,
"published_profile_id",
),
created_at: __sdk::__query_builder::Col::new(table_name, "created_at"),
updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"),
}
}
}
/// Indexed column accessor struct for the table `WoodenFishAgentSessionRow`.
///
/// Provides typed access to indexed columns for query building.
pub struct WoodenFishAgentSessionRowIxCols {
pub owner_user_id: __sdk::__query_builder::IxCol<WoodenFishAgentSessionRow, String>,
pub session_id: __sdk::__query_builder::IxCol<WoodenFishAgentSessionRow, String>,
}
impl __sdk::__query_builder::HasIxCols for WoodenFishAgentSessionRow {
type IxCols = WoodenFishAgentSessionRowIxCols;
fn ix_cols(table_name: &'static str) -> Self::IxCols {
WoodenFishAgentSessionRowIxCols {
owner_user_id: __sdk::__query_builder::IxCol::new(table_name, "owner_user_id"),
session_id: __sdk::__query_builder::IxCol::new(table_name, "session_id"),
}
}
}
impl __sdk::__query_builder::CanBeLookupTable for WoodenFishAgentSessionRow {}

View File

@@ -0,0 +1,27 @@
// 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::wooden_fish_creator_config_snapshot_type::WoodenFishCreatorConfigSnapshot;
use super::wooden_fish_draft_snapshot_type::WoodenFishDraftSnapshot;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct WoodenFishAgentSessionSnapshot {
pub session_id: String,
pub owner_user_id: String,
pub current_turn: u32,
pub progress_percent: u32,
pub stage: String,
pub config: WoodenFishCreatorConfigSnapshot,
pub draft: Option<WoodenFishDraftSnapshot>,
pub published_profile_id: Option<String>,
pub created_at_micros: i64,
pub updated_at_micros: i64,
}
impl __sdk::InModule for WoodenFishAgentSessionSnapshot {
type Module = super::RemoteModule;
}

View File

@@ -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::wooden_fish_agent_session_row_type::WoodenFishAgentSessionRow;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `wooden_fish_agent_session`.
///
/// Obtain a handle from the [`WoodenFishAgentSessionTableAccess::wooden_fish_agent_session`] method on [`super::RemoteTables`],
/// like `ctx.db.wooden_fish_agent_session()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.wooden_fish_agent_session().on_insert(...)`.
pub struct WoodenFishAgentSessionTableHandle<'ctx> {
imp: __sdk::TableHandle<WoodenFishAgentSessionRow>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `wooden_fish_agent_session`.
///
/// Implemented for [`super::RemoteTables`].
pub trait WoodenFishAgentSessionTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`WoodenFishAgentSessionTableHandle`], which mediates access to the table `wooden_fish_agent_session`.
fn wooden_fish_agent_session(&self) -> WoodenFishAgentSessionTableHandle<'_>;
}
impl WoodenFishAgentSessionTableAccess for super::RemoteTables {
fn wooden_fish_agent_session(&self) -> WoodenFishAgentSessionTableHandle<'_> {
WoodenFishAgentSessionTableHandle {
imp: self
.imp
.get_table::<WoodenFishAgentSessionRow>("wooden_fish_agent_session"),
ctx: std::marker::PhantomData,
}
}
}
pub struct WoodenFishAgentSessionInsertCallbackId(__sdk::CallbackId);
pub struct WoodenFishAgentSessionDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for WoodenFishAgentSessionTableHandle<'ctx> {
type Row = WoodenFishAgentSessionRow;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = WoodenFishAgentSessionRow> + '_ {
self.imp.iter()
}
type InsertCallbackId = WoodenFishAgentSessionInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> WoodenFishAgentSessionInsertCallbackId {
WoodenFishAgentSessionInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: WoodenFishAgentSessionInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = WoodenFishAgentSessionDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> WoodenFishAgentSessionDeleteCallbackId {
WoodenFishAgentSessionDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: WoodenFishAgentSessionDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct WoodenFishAgentSessionUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for WoodenFishAgentSessionTableHandle<'ctx> {
type UpdateCallbackId = WoodenFishAgentSessionUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> WoodenFishAgentSessionUpdateCallbackId {
WoodenFishAgentSessionUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: WoodenFishAgentSessionUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `session_id` unique index on the table `wooden_fish_agent_session`,
/// which allows point queries on the field of the same name
/// via the [`WoodenFishAgentSessionSessionIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.wooden_fish_agent_session().session_id().find(...)`.
pub struct WoodenFishAgentSessionSessionIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<WoodenFishAgentSessionRow, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> WoodenFishAgentSessionTableHandle<'ctx> {
/// Get a handle on the `session_id` unique index on the table `wooden_fish_agent_session`.
pub fn session_id(&self) -> WoodenFishAgentSessionSessionIdUnique<'ctx> {
WoodenFishAgentSessionSessionIdUnique {
imp: self.imp.get_unique_constraint::<String>("session_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> WoodenFishAgentSessionSessionIdUnique<'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<WoodenFishAgentSessionRow> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table =
client_cache.get_or_make_table::<WoodenFishAgentSessionRow>("wooden_fish_agent_session");
_table.add_unique_constraint::<String>("session_id", |row| &row.session_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<WoodenFishAgentSessionRow>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<WoodenFishAgentSessionRow>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `WoodenFishAgentSessionRow`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait wooden_fish_agent_sessionQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `WoodenFishAgentSessionRow`.
fn wooden_fish_agent_session(&self)
-> __sdk::__query_builder::Table<WoodenFishAgentSessionRow>;
}
impl wooden_fish_agent_sessionQueryTableAccess for __sdk::QueryTableAccessor {
fn wooden_fish_agent_session(
&self,
) -> __sdk::__query_builder::Table<WoodenFishAgentSessionRow> {
__sdk::__query_builder::Table::new("wooden_fish_agent_session")
}
}

View File

@@ -0,0 +1,21 @@
// 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 WoodenFishAudioAssetSnapshot {
pub asset_id: String,
pub audio_src: String,
pub audio_object_key: String,
pub asset_object_id: String,
pub source: String,
pub prompt: Option<String>,
pub duration_ms: Option<u32>,
}
impl __sdk::InModule for WoodenFishAudioAssetSnapshot {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,21 @@
// 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 WoodenFishCreatorConfigSnapshot {
pub work_title: String,
pub work_description: String,
pub theme_tags: Vec<String>,
pub hit_object_prompt: String,
pub hit_object_reference_image_src: Option<String>,
pub hit_sound_prompt: Option<String>,
pub floating_words: Vec<String>,
}
impl __sdk::InModule for WoodenFishCreatorConfigSnapshot {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,31 @@
// 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 WoodenFishDraftCompileInput {
pub session_id: String,
pub owner_user_id: String,
pub profile_id: String,
pub author_display_name: String,
pub work_title: String,
pub work_description: String,
pub theme_tags_json: Option<String>,
pub hit_object_prompt: String,
pub hit_object_reference_image_src: Option<String>,
pub hit_sound_prompt: Option<String>,
pub hit_object_asset_json: Option<String>,
pub background_asset_json: Option<String>,
pub hit_sound_asset_json: Option<String>,
pub floating_words_json: Option<String>,
pub cover_image_src: Option<String>,
pub generation_status: Option<String>,
pub compiled_at_micros: i64,
}
impl __sdk::InModule for WoodenFishDraftCompileInput {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,32 @@
// 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::wooden_fish_audio_asset_snapshot_type::WoodenFishAudioAssetSnapshot;
use super::wooden_fish_image_asset_snapshot_type::WoodenFishImageAssetSnapshot;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct WoodenFishDraftSnapshot {
pub template_id: String,
pub template_name: String,
pub profile_id: Option<String>,
pub work_title: String,
pub work_description: String,
pub theme_tags: Vec<String>,
pub hit_object_prompt: String,
pub hit_object_reference_image_src: Option<String>,
pub hit_sound_prompt: Option<String>,
pub floating_words: Vec<String>,
pub hit_object_asset: Option<WoodenFishImageAssetSnapshot>,
pub background_asset: Option<WoodenFishImageAssetSnapshot>,
pub hit_sound_asset: Option<WoodenFishAudioAssetSnapshot>,
pub cover_image_src: Option<String>,
pub generation_status: String,
}
impl __sdk::InModule for WoodenFishDraftSnapshot {
type Module = super::RemoteModule;
}

View File

@@ -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};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct WoodenFishEventRow {
pub event_id: String,
pub owner_user_id: String,
pub profile_id: String,
pub run_id: String,
pub event_type: String,
pub result: String,
pub occurred_at: __sdk::Timestamp,
}
impl __sdk::InModule for WoodenFishEventRow {
type Module = super::RemoteModule;
}
/// Column accessor struct for the table `WoodenFishEventRow`.
///
/// Provides typed access to columns for query building.
pub struct WoodenFishEventRowCols {
pub event_id: __sdk::__query_builder::Col<WoodenFishEventRow, String>,
pub owner_user_id: __sdk::__query_builder::Col<WoodenFishEventRow, String>,
pub profile_id: __sdk::__query_builder::Col<WoodenFishEventRow, String>,
pub run_id: __sdk::__query_builder::Col<WoodenFishEventRow, String>,
pub event_type: __sdk::__query_builder::Col<WoodenFishEventRow, String>,
pub result: __sdk::__query_builder::Col<WoodenFishEventRow, String>,
pub occurred_at: __sdk::__query_builder::Col<WoodenFishEventRow, __sdk::Timestamp>,
}
impl __sdk::__query_builder::HasCols for WoodenFishEventRow {
type Cols = WoodenFishEventRowCols;
fn cols(table_name: &'static str) -> Self::Cols {
WoodenFishEventRowCols {
event_id: __sdk::__query_builder::Col::new(table_name, "event_id"),
owner_user_id: __sdk::__query_builder::Col::new(table_name, "owner_user_id"),
profile_id: __sdk::__query_builder::Col::new(table_name, "profile_id"),
run_id: __sdk::__query_builder::Col::new(table_name, "run_id"),
event_type: __sdk::__query_builder::Col::new(table_name, "event_type"),
result: __sdk::__query_builder::Col::new(table_name, "result"),
occurred_at: __sdk::__query_builder::Col::new(table_name, "occurred_at"),
}
}
}
/// Indexed column accessor struct for the table `WoodenFishEventRow`.
///
/// Provides typed access to indexed columns for query building.
pub struct WoodenFishEventRowIxCols {
pub event_id: __sdk::__query_builder::IxCol<WoodenFishEventRow, String>,
pub profile_id: __sdk::__query_builder::IxCol<WoodenFishEventRow, String>,
pub run_id: __sdk::__query_builder::IxCol<WoodenFishEventRow, String>,
}
impl __sdk::__query_builder::HasIxCols for WoodenFishEventRow {
type IxCols = WoodenFishEventRowIxCols;
fn ix_cols(table_name: &'static str) -> Self::IxCols {
WoodenFishEventRowIxCols {
event_id: __sdk::__query_builder::IxCol::new(table_name, "event_id"),
profile_id: __sdk::__query_builder::IxCol::new(table_name, "profile_id"),
run_id: __sdk::__query_builder::IxCol::new(table_name, "run_id"),
}
}
}
impl __sdk::__query_builder::CanBeLookupTable for WoodenFishEventRow {}

View File

@@ -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::wooden_fish_event_row_type::WoodenFishEventRow;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `wooden_fish_event`.
///
/// Obtain a handle from the [`WoodenFishEventTableAccess::wooden_fish_event`] method on [`super::RemoteTables`],
/// like `ctx.db.wooden_fish_event()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.wooden_fish_event().on_insert(...)`.
pub struct WoodenFishEventTableHandle<'ctx> {
imp: __sdk::TableHandle<WoodenFishEventRow>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `wooden_fish_event`.
///
/// Implemented for [`super::RemoteTables`].
pub trait WoodenFishEventTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`WoodenFishEventTableHandle`], which mediates access to the table `wooden_fish_event`.
fn wooden_fish_event(&self) -> WoodenFishEventTableHandle<'_>;
}
impl WoodenFishEventTableAccess for super::RemoteTables {
fn wooden_fish_event(&self) -> WoodenFishEventTableHandle<'_> {
WoodenFishEventTableHandle {
imp: self
.imp
.get_table::<WoodenFishEventRow>("wooden_fish_event"),
ctx: std::marker::PhantomData,
}
}
}
pub struct WoodenFishEventInsertCallbackId(__sdk::CallbackId);
pub struct WoodenFishEventDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for WoodenFishEventTableHandle<'ctx> {
type Row = WoodenFishEventRow;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = WoodenFishEventRow> + '_ {
self.imp.iter()
}
type InsertCallbackId = WoodenFishEventInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> WoodenFishEventInsertCallbackId {
WoodenFishEventInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: WoodenFishEventInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = WoodenFishEventDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> WoodenFishEventDeleteCallbackId {
WoodenFishEventDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: WoodenFishEventDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct WoodenFishEventUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for WoodenFishEventTableHandle<'ctx> {
type UpdateCallbackId = WoodenFishEventUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> WoodenFishEventUpdateCallbackId {
WoodenFishEventUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: WoodenFishEventUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `event_id` unique index on the table `wooden_fish_event`,
/// which allows point queries on the field of the same name
/// via the [`WoodenFishEventEventIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.wooden_fish_event().event_id().find(...)`.
pub struct WoodenFishEventEventIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<WoodenFishEventRow, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> WoodenFishEventTableHandle<'ctx> {
/// Get a handle on the `event_id` unique index on the table `wooden_fish_event`.
pub fn event_id(&self) -> WoodenFishEventEventIdUnique<'ctx> {
WoodenFishEventEventIdUnique {
imp: self.imp.get_unique_constraint::<String>("event_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> WoodenFishEventEventIdUnique<'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<WoodenFishEventRow> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<WoodenFishEventRow>("wooden_fish_event");
_table.add_unique_constraint::<String>("event_id", |row| &row.event_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<WoodenFishEventRow>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<WoodenFishEventRow>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `WoodenFishEventRow`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait wooden_fish_eventQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `WoodenFishEventRow`.
fn wooden_fish_event(&self) -> __sdk::__query_builder::Table<WoodenFishEventRow>;
}
impl wooden_fish_eventQueryTableAccess for __sdk::QueryTableAccessor {
fn wooden_fish_event(&self) -> __sdk::__query_builder::Table<WoodenFishEventRow> {
__sdk::__query_builder::Table::new("wooden_fish_event")
}
}

View File

@@ -0,0 +1,76 @@
// 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 WoodenFishGalleryCardViewRow {
pub public_work_code: String,
pub work_id: String,
pub profile_id: String,
pub owner_user_id: String,
pub author_display_name: String,
pub work_title: String,
pub work_description: String,
pub cover_image_src: String,
pub theme_tags: Vec<String>,
pub publication_status: String,
pub play_count: u32,
pub updated_at_micros: i64,
pub published_at_micros: Option<i64>,
pub generation_status: String,
}
impl __sdk::InModule for WoodenFishGalleryCardViewRow {
type Module = super::RemoteModule;
}
/// Column accessor struct for the table `WoodenFishGalleryCardViewRow`.
///
/// Provides typed access to columns for query building.
pub struct WoodenFishGalleryCardViewRowCols {
pub public_work_code: __sdk::__query_builder::Col<WoodenFishGalleryCardViewRow, String>,
pub work_id: __sdk::__query_builder::Col<WoodenFishGalleryCardViewRow, String>,
pub profile_id: __sdk::__query_builder::Col<WoodenFishGalleryCardViewRow, String>,
pub owner_user_id: __sdk::__query_builder::Col<WoodenFishGalleryCardViewRow, String>,
pub author_display_name: __sdk::__query_builder::Col<WoodenFishGalleryCardViewRow, String>,
pub work_title: __sdk::__query_builder::Col<WoodenFishGalleryCardViewRow, String>,
pub work_description: __sdk::__query_builder::Col<WoodenFishGalleryCardViewRow, String>,
pub cover_image_src: __sdk::__query_builder::Col<WoodenFishGalleryCardViewRow, String>,
pub theme_tags: __sdk::__query_builder::Col<WoodenFishGalleryCardViewRow, Vec<String>>,
pub publication_status: __sdk::__query_builder::Col<WoodenFishGalleryCardViewRow, String>,
pub play_count: __sdk::__query_builder::Col<WoodenFishGalleryCardViewRow, u32>,
pub updated_at_micros: __sdk::__query_builder::Col<WoodenFishGalleryCardViewRow, i64>,
pub published_at_micros: __sdk::__query_builder::Col<WoodenFishGalleryCardViewRow, Option<i64>>,
pub generation_status: __sdk::__query_builder::Col<WoodenFishGalleryCardViewRow, String>,
}
impl __sdk::__query_builder::HasCols for WoodenFishGalleryCardViewRow {
type Cols = WoodenFishGalleryCardViewRowCols;
fn cols(table_name: &'static str) -> Self::Cols {
WoodenFishGalleryCardViewRowCols {
public_work_code: __sdk::__query_builder::Col::new(table_name, "public_work_code"),
work_id: __sdk::__query_builder::Col::new(table_name, "work_id"),
profile_id: __sdk::__query_builder::Col::new(table_name, "profile_id"),
owner_user_id: __sdk::__query_builder::Col::new(table_name, "owner_user_id"),
author_display_name: __sdk::__query_builder::Col::new(
table_name,
"author_display_name",
),
work_title: __sdk::__query_builder::Col::new(table_name, "work_title"),
work_description: __sdk::__query_builder::Col::new(table_name, "work_description"),
cover_image_src: __sdk::__query_builder::Col::new(table_name, "cover_image_src"),
theme_tags: __sdk::__query_builder::Col::new(table_name, "theme_tags"),
publication_status: __sdk::__query_builder::Col::new(table_name, "publication_status"),
play_count: __sdk::__query_builder::Col::new(table_name, "play_count"),
updated_at_micros: __sdk::__query_builder::Col::new(table_name, "updated_at_micros"),
published_at_micros: __sdk::__query_builder::Col::new(
table_name,
"published_at_micros",
),
generation_status: __sdk::__query_builder::Col::new(table_name, "generation_status"),
}
}
}

View File

@@ -0,0 +1,121 @@
// 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::wooden_fish_gallery_card_view_row_type::WoodenFishGalleryCardViewRow;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `wooden_fish_gallery_card_view`.
///
/// Obtain a handle from the [`WoodenFishGalleryCardViewTableAccess::wooden_fish_gallery_card_view`] method on [`super::RemoteTables`],
/// like `ctx.db.wooden_fish_gallery_card_view()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.wooden_fish_gallery_card_view().on_insert(...)`.
pub struct WoodenFishGalleryCardViewTableHandle<'ctx> {
imp: __sdk::TableHandle<WoodenFishGalleryCardViewRow>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `wooden_fish_gallery_card_view`.
///
/// Implemented for [`super::RemoteTables`].
pub trait WoodenFishGalleryCardViewTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`WoodenFishGalleryCardViewTableHandle`], which mediates access to the table `wooden_fish_gallery_card_view`.
fn wooden_fish_gallery_card_view(&self) -> WoodenFishGalleryCardViewTableHandle<'_>;
}
impl WoodenFishGalleryCardViewTableAccess for super::RemoteTables {
fn wooden_fish_gallery_card_view(&self) -> WoodenFishGalleryCardViewTableHandle<'_> {
WoodenFishGalleryCardViewTableHandle {
imp: self
.imp
.get_table::<WoodenFishGalleryCardViewRow>("wooden_fish_gallery_card_view"),
ctx: std::marker::PhantomData,
}
}
}
pub struct WoodenFishGalleryCardViewInsertCallbackId(__sdk::CallbackId);
pub struct WoodenFishGalleryCardViewDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for WoodenFishGalleryCardViewTableHandle<'ctx> {
type Row = WoodenFishGalleryCardViewRow;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = WoodenFishGalleryCardViewRow> + '_ {
self.imp.iter()
}
type InsertCallbackId = WoodenFishGalleryCardViewInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> WoodenFishGalleryCardViewInsertCallbackId {
WoodenFishGalleryCardViewInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: WoodenFishGalleryCardViewInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = WoodenFishGalleryCardViewDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> WoodenFishGalleryCardViewDeleteCallbackId {
WoodenFishGalleryCardViewDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: WoodenFishGalleryCardViewDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache
.get_or_make_table::<WoodenFishGalleryCardViewRow>("wooden_fish_gallery_card_view");
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<WoodenFishGalleryCardViewRow>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse(
"TableUpdate<WoodenFishGalleryCardViewRow>",
"TableUpdate",
)
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `WoodenFishGalleryCardViewRow`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait wooden_fish_gallery_card_viewQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `WoodenFishGalleryCardViewRow`.
fn wooden_fish_gallery_card_view(
&self,
) -> __sdk::__query_builder::Table<WoodenFishGalleryCardViewRow>;
}
impl wooden_fish_gallery_card_viewQueryTableAccess for __sdk::QueryTableAccessor {
fn wooden_fish_gallery_card_view(
&self,
) -> __sdk::__query_builder::Table<WoodenFishGalleryCardViewRow> {
__sdk::__query_builder::Table::new("wooden_fish_gallery_card_view")
}
}

View File

@@ -0,0 +1,113 @@
// 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::wooden_fish_audio_asset_snapshot_type::WoodenFishAudioAssetSnapshot;
use super::wooden_fish_image_asset_snapshot_type::WoodenFishImageAssetSnapshot;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct WoodenFishGalleryViewRow {
pub public_work_code: String,
pub work_id: String,
pub profile_id: String,
pub owner_user_id: String,
pub source_session_id: String,
pub author_display_name: String,
pub work_title: String,
pub work_description: String,
pub theme_tags: Vec<String>,
pub hit_object_prompt: String,
pub hit_object_reference_image_src: Option<String>,
pub hit_sound_prompt: Option<String>,
pub hit_object_asset: Option<WoodenFishImageAssetSnapshot>,
pub background_asset: Option<WoodenFishImageAssetSnapshot>,
pub hit_sound_asset: Option<WoodenFishAudioAssetSnapshot>,
pub floating_words: Vec<String>,
pub cover_image_src: String,
pub publication_status: String,
pub publish_ready: bool,
pub play_count: u32,
pub generation_status: String,
pub updated_at_micros: i64,
pub published_at_micros: Option<i64>,
}
impl __sdk::InModule for WoodenFishGalleryViewRow {
type Module = super::RemoteModule;
}
/// Column accessor struct for the table `WoodenFishGalleryViewRow`.
///
/// Provides typed access to columns for query building.
pub struct WoodenFishGalleryViewRowCols {
pub public_work_code: __sdk::__query_builder::Col<WoodenFishGalleryViewRow, String>,
pub work_id: __sdk::__query_builder::Col<WoodenFishGalleryViewRow, String>,
pub profile_id: __sdk::__query_builder::Col<WoodenFishGalleryViewRow, String>,
pub owner_user_id: __sdk::__query_builder::Col<WoodenFishGalleryViewRow, String>,
pub source_session_id: __sdk::__query_builder::Col<WoodenFishGalleryViewRow, String>,
pub author_display_name: __sdk::__query_builder::Col<WoodenFishGalleryViewRow, String>,
pub work_title: __sdk::__query_builder::Col<WoodenFishGalleryViewRow, String>,
pub work_description: __sdk::__query_builder::Col<WoodenFishGalleryViewRow, String>,
pub theme_tags: __sdk::__query_builder::Col<WoodenFishGalleryViewRow, Vec<String>>,
pub hit_object_prompt: __sdk::__query_builder::Col<WoodenFishGalleryViewRow, String>,
pub hit_object_reference_image_src:
__sdk::__query_builder::Col<WoodenFishGalleryViewRow, Option<String>>,
pub hit_sound_prompt: __sdk::__query_builder::Col<WoodenFishGalleryViewRow, Option<String>>,
pub hit_object_asset:
__sdk::__query_builder::Col<WoodenFishGalleryViewRow, Option<WoodenFishImageAssetSnapshot>>,
pub background_asset:
__sdk::__query_builder::Col<WoodenFishGalleryViewRow, Option<WoodenFishImageAssetSnapshot>>,
pub hit_sound_asset:
__sdk::__query_builder::Col<WoodenFishGalleryViewRow, Option<WoodenFishAudioAssetSnapshot>>,
pub floating_words: __sdk::__query_builder::Col<WoodenFishGalleryViewRow, Vec<String>>,
pub cover_image_src: __sdk::__query_builder::Col<WoodenFishGalleryViewRow, String>,
pub publication_status: __sdk::__query_builder::Col<WoodenFishGalleryViewRow, String>,
pub publish_ready: __sdk::__query_builder::Col<WoodenFishGalleryViewRow, bool>,
pub play_count: __sdk::__query_builder::Col<WoodenFishGalleryViewRow, u32>,
pub generation_status: __sdk::__query_builder::Col<WoodenFishGalleryViewRow, String>,
pub updated_at_micros: __sdk::__query_builder::Col<WoodenFishGalleryViewRow, i64>,
pub published_at_micros: __sdk::__query_builder::Col<WoodenFishGalleryViewRow, Option<i64>>,
}
impl __sdk::__query_builder::HasCols for WoodenFishGalleryViewRow {
type Cols = WoodenFishGalleryViewRowCols;
fn cols(table_name: &'static str) -> Self::Cols {
WoodenFishGalleryViewRowCols {
public_work_code: __sdk::__query_builder::Col::new(table_name, "public_work_code"),
work_id: __sdk::__query_builder::Col::new(table_name, "work_id"),
profile_id: __sdk::__query_builder::Col::new(table_name, "profile_id"),
owner_user_id: __sdk::__query_builder::Col::new(table_name, "owner_user_id"),
source_session_id: __sdk::__query_builder::Col::new(table_name, "source_session_id"),
author_display_name: __sdk::__query_builder::Col::new(
table_name,
"author_display_name",
),
work_title: __sdk::__query_builder::Col::new(table_name, "work_title"),
work_description: __sdk::__query_builder::Col::new(table_name, "work_description"),
theme_tags: __sdk::__query_builder::Col::new(table_name, "theme_tags"),
hit_object_prompt: __sdk::__query_builder::Col::new(table_name, "hit_object_prompt"),
hit_object_reference_image_src: __sdk::__query_builder::Col::new(
table_name,
"hit_object_reference_image_src",
),
hit_sound_prompt: __sdk::__query_builder::Col::new(table_name, "hit_sound_prompt"),
hit_object_asset: __sdk::__query_builder::Col::new(table_name, "hit_object_asset"),
background_asset: __sdk::__query_builder::Col::new(table_name, "background_asset"),
hit_sound_asset: __sdk::__query_builder::Col::new(table_name, "hit_sound_asset"),
floating_words: __sdk::__query_builder::Col::new(table_name, "floating_words"),
cover_image_src: __sdk::__query_builder::Col::new(table_name, "cover_image_src"),
publication_status: __sdk::__query_builder::Col::new(table_name, "publication_status"),
publish_ready: __sdk::__query_builder::Col::new(table_name, "publish_ready"),
play_count: __sdk::__query_builder::Col::new(table_name, "play_count"),
generation_status: __sdk::__query_builder::Col::new(table_name, "generation_status"),
updated_at_micros: __sdk::__query_builder::Col::new(table_name, "updated_at_micros"),
published_at_micros: __sdk::__query_builder::Col::new(
table_name,
"published_at_micros",
),
}
}
}

View File

@@ -0,0 +1,116 @@
// 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::wooden_fish_audio_asset_snapshot_type::WoodenFishAudioAssetSnapshot;
use super::wooden_fish_gallery_view_row_type::WoodenFishGalleryViewRow;
use super::wooden_fish_image_asset_snapshot_type::WoodenFishImageAssetSnapshot;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `wooden_fish_gallery_view`.
///
/// Obtain a handle from the [`WoodenFishGalleryViewTableAccess::wooden_fish_gallery_view`] method on [`super::RemoteTables`],
/// like `ctx.db.wooden_fish_gallery_view()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.wooden_fish_gallery_view().on_insert(...)`.
pub struct WoodenFishGalleryViewTableHandle<'ctx> {
imp: __sdk::TableHandle<WoodenFishGalleryViewRow>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `wooden_fish_gallery_view`.
///
/// Implemented for [`super::RemoteTables`].
pub trait WoodenFishGalleryViewTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`WoodenFishGalleryViewTableHandle`], which mediates access to the table `wooden_fish_gallery_view`.
fn wooden_fish_gallery_view(&self) -> WoodenFishGalleryViewTableHandle<'_>;
}
impl WoodenFishGalleryViewTableAccess for super::RemoteTables {
fn wooden_fish_gallery_view(&self) -> WoodenFishGalleryViewTableHandle<'_> {
WoodenFishGalleryViewTableHandle {
imp: self
.imp
.get_table::<WoodenFishGalleryViewRow>("wooden_fish_gallery_view"),
ctx: std::marker::PhantomData,
}
}
}
pub struct WoodenFishGalleryViewInsertCallbackId(__sdk::CallbackId);
pub struct WoodenFishGalleryViewDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for WoodenFishGalleryViewTableHandle<'ctx> {
type Row = WoodenFishGalleryViewRow;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = WoodenFishGalleryViewRow> + '_ {
self.imp.iter()
}
type InsertCallbackId = WoodenFishGalleryViewInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> WoodenFishGalleryViewInsertCallbackId {
WoodenFishGalleryViewInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: WoodenFishGalleryViewInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = WoodenFishGalleryViewDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> WoodenFishGalleryViewDeleteCallbackId {
WoodenFishGalleryViewDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: WoodenFishGalleryViewDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table =
client_cache.get_or_make_table::<WoodenFishGalleryViewRow>("wooden_fish_gallery_view");
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<WoodenFishGalleryViewRow>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<WoodenFishGalleryViewRow>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `WoodenFishGalleryViewRow`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait wooden_fish_gallery_viewQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `WoodenFishGalleryViewRow`.
fn wooden_fish_gallery_view(&self) -> __sdk::__query_builder::Table<WoodenFishGalleryViewRow>;
}
impl wooden_fish_gallery_viewQueryTableAccess for __sdk::QueryTableAccessor {
fn wooden_fish_gallery_view(&self) -> __sdk::__query_builder::Table<WoodenFishGalleryViewRow> {
__sdk::__query_builder::Table::new("wooden_fish_gallery_view")
}
}

View File

@@ -0,0 +1,22 @@
// 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 WoodenFishImageAssetSnapshot {
pub asset_id: String,
pub image_src: String,
pub image_object_key: String,
pub asset_object_id: String,
pub generation_provider: String,
pub prompt: String,
pub width: u32,
pub height: u32,
}
impl __sdk::InModule for WoodenFishImageAssetSnapshot {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,20 @@
// 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 WoodenFishRunCheckpointInput {
pub run_id: String,
pub owner_user_id: String,
pub total_tap_count: u32,
pub word_counters_json: String,
pub client_event_id: String,
pub checkpoint_at_ms: i64,
}
impl __sdk::InModule for WoodenFishRunCheckpointInput {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,20 @@
// 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 WoodenFishRunFinishInput {
pub run_id: String,
pub owner_user_id: String,
pub total_tap_count: u32,
pub word_counters_json: String,
pub client_event_id: String,
pub finished_at_ms: i64,
}
impl __sdk::InModule for WoodenFishRunFinishInput {
type Module = super::RemoteModule;
}

View File

@@ -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 WoodenFishRunGetInput {
pub run_id: String,
pub owner_user_id: String,
}
impl __sdk::InModule for WoodenFishRunGetInput {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,19 @@
// 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::wooden_fish_run_snapshot_type::WoodenFishRunSnapshot;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct WoodenFishRunProcedureResult {
pub ok: bool,
pub run: Option<WoodenFishRunSnapshot>,
pub error_message: Option<String>,
}
impl __sdk::InModule for WoodenFishRunProcedureResult {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,26 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
use super::wooden_fish_run_status_type::WoodenFishRunStatus;
use super::wooden_fish_word_counter_type::WoodenFishWordCounter;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct WoodenFishRunSnapshot {
pub run_id: String,
pub profile_id: String,
pub owner_user_id: String,
pub status: WoodenFishRunStatus,
pub total_tap_count: u32,
pub word_counters: Vec<WoodenFishWordCounter>,
pub started_at_ms: u64,
pub updated_at_ms: u64,
pub finished_at_ms: Option<u64>,
}
impl __sdk::InModule for WoodenFishRunSnapshot {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,19 @@
// 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 WoodenFishRunStartInput {
pub run_id: String,
pub owner_user_id: String,
pub profile_id: String,
pub client_event_id: String,
pub started_at_ms: i64,
}
impl __sdk::InModule for WoodenFishRunStartInput {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,18 @@
// 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)]
#[derive(Copy, Eq, Hash)]
pub enum WoodenFishRunStatus {
Playing,
Finished,
}
impl __sdk::InModule for WoodenFishRunStatus {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,86 @@
// 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 WoodenFishRuntimeRunRow {
pub run_id: String,
pub owner_user_id: String,
pub profile_id: String,
pub status: String,
pub total_tap_count: u32,
pub word_counters_json: String,
pub started_at_ms: i64,
pub updated_at_ms: i64,
pub finished_at_ms: i64,
pub snapshot_json: String,
pub created_at: __sdk::Timestamp,
pub updated_at: __sdk::Timestamp,
}
impl __sdk::InModule for WoodenFishRuntimeRunRow {
type Module = super::RemoteModule;
}
/// Column accessor struct for the table `WoodenFishRuntimeRunRow`.
///
/// Provides typed access to columns for query building.
pub struct WoodenFishRuntimeRunRowCols {
pub run_id: __sdk::__query_builder::Col<WoodenFishRuntimeRunRow, String>,
pub owner_user_id: __sdk::__query_builder::Col<WoodenFishRuntimeRunRow, String>,
pub profile_id: __sdk::__query_builder::Col<WoodenFishRuntimeRunRow, String>,
pub status: __sdk::__query_builder::Col<WoodenFishRuntimeRunRow, String>,
pub total_tap_count: __sdk::__query_builder::Col<WoodenFishRuntimeRunRow, u32>,
pub word_counters_json: __sdk::__query_builder::Col<WoodenFishRuntimeRunRow, String>,
pub started_at_ms: __sdk::__query_builder::Col<WoodenFishRuntimeRunRow, i64>,
pub updated_at_ms: __sdk::__query_builder::Col<WoodenFishRuntimeRunRow, i64>,
pub finished_at_ms: __sdk::__query_builder::Col<WoodenFishRuntimeRunRow, i64>,
pub snapshot_json: __sdk::__query_builder::Col<WoodenFishRuntimeRunRow, String>,
pub created_at: __sdk::__query_builder::Col<WoodenFishRuntimeRunRow, __sdk::Timestamp>,
pub updated_at: __sdk::__query_builder::Col<WoodenFishRuntimeRunRow, __sdk::Timestamp>,
}
impl __sdk::__query_builder::HasCols for WoodenFishRuntimeRunRow {
type Cols = WoodenFishRuntimeRunRowCols;
fn cols(table_name: &'static str) -> Self::Cols {
WoodenFishRuntimeRunRowCols {
run_id: __sdk::__query_builder::Col::new(table_name, "run_id"),
owner_user_id: __sdk::__query_builder::Col::new(table_name, "owner_user_id"),
profile_id: __sdk::__query_builder::Col::new(table_name, "profile_id"),
status: __sdk::__query_builder::Col::new(table_name, "status"),
total_tap_count: __sdk::__query_builder::Col::new(table_name, "total_tap_count"),
word_counters_json: __sdk::__query_builder::Col::new(table_name, "word_counters_json"),
started_at_ms: __sdk::__query_builder::Col::new(table_name, "started_at_ms"),
updated_at_ms: __sdk::__query_builder::Col::new(table_name, "updated_at_ms"),
finished_at_ms: __sdk::__query_builder::Col::new(table_name, "finished_at_ms"),
snapshot_json: __sdk::__query_builder::Col::new(table_name, "snapshot_json"),
created_at: __sdk::__query_builder::Col::new(table_name, "created_at"),
updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"),
}
}
}
/// Indexed column accessor struct for the table `WoodenFishRuntimeRunRow`.
///
/// Provides typed access to indexed columns for query building.
pub struct WoodenFishRuntimeRunRowIxCols {
pub owner_user_id: __sdk::__query_builder::IxCol<WoodenFishRuntimeRunRow, String>,
pub profile_id: __sdk::__query_builder::IxCol<WoodenFishRuntimeRunRow, String>,
pub run_id: __sdk::__query_builder::IxCol<WoodenFishRuntimeRunRow, String>,
}
impl __sdk::__query_builder::HasIxCols for WoodenFishRuntimeRunRow {
type IxCols = WoodenFishRuntimeRunRowIxCols;
fn ix_cols(table_name: &'static str) -> Self::IxCols {
WoodenFishRuntimeRunRowIxCols {
owner_user_id: __sdk::__query_builder::IxCol::new(table_name, "owner_user_id"),
profile_id: __sdk::__query_builder::IxCol::new(table_name, "profile_id"),
run_id: __sdk::__query_builder::IxCol::new(table_name, "run_id"),
}
}
}
impl __sdk::__query_builder::CanBeLookupTable for WoodenFishRuntimeRunRow {}

View File

@@ -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::wooden_fish_runtime_run_row_type::WoodenFishRuntimeRunRow;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `wooden_fish_runtime_run`.
///
/// Obtain a handle from the [`WoodenFishRuntimeRunTableAccess::wooden_fish_runtime_run`] method on [`super::RemoteTables`],
/// like `ctx.db.wooden_fish_runtime_run()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.wooden_fish_runtime_run().on_insert(...)`.
pub struct WoodenFishRuntimeRunTableHandle<'ctx> {
imp: __sdk::TableHandle<WoodenFishRuntimeRunRow>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `wooden_fish_runtime_run`.
///
/// Implemented for [`super::RemoteTables`].
pub trait WoodenFishRuntimeRunTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`WoodenFishRuntimeRunTableHandle`], which mediates access to the table `wooden_fish_runtime_run`.
fn wooden_fish_runtime_run(&self) -> WoodenFishRuntimeRunTableHandle<'_>;
}
impl WoodenFishRuntimeRunTableAccess for super::RemoteTables {
fn wooden_fish_runtime_run(&self) -> WoodenFishRuntimeRunTableHandle<'_> {
WoodenFishRuntimeRunTableHandle {
imp: self
.imp
.get_table::<WoodenFishRuntimeRunRow>("wooden_fish_runtime_run"),
ctx: std::marker::PhantomData,
}
}
}
pub struct WoodenFishRuntimeRunInsertCallbackId(__sdk::CallbackId);
pub struct WoodenFishRuntimeRunDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for WoodenFishRuntimeRunTableHandle<'ctx> {
type Row = WoodenFishRuntimeRunRow;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = WoodenFishRuntimeRunRow> + '_ {
self.imp.iter()
}
type InsertCallbackId = WoodenFishRuntimeRunInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> WoodenFishRuntimeRunInsertCallbackId {
WoodenFishRuntimeRunInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: WoodenFishRuntimeRunInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = WoodenFishRuntimeRunDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> WoodenFishRuntimeRunDeleteCallbackId {
WoodenFishRuntimeRunDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: WoodenFishRuntimeRunDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct WoodenFishRuntimeRunUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for WoodenFishRuntimeRunTableHandle<'ctx> {
type UpdateCallbackId = WoodenFishRuntimeRunUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> WoodenFishRuntimeRunUpdateCallbackId {
WoodenFishRuntimeRunUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: WoodenFishRuntimeRunUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `run_id` unique index on the table `wooden_fish_runtime_run`,
/// which allows point queries on the field of the same name
/// via the [`WoodenFishRuntimeRunRunIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.wooden_fish_runtime_run().run_id().find(...)`.
pub struct WoodenFishRuntimeRunRunIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<WoodenFishRuntimeRunRow, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> WoodenFishRuntimeRunTableHandle<'ctx> {
/// Get a handle on the `run_id` unique index on the table `wooden_fish_runtime_run`.
pub fn run_id(&self) -> WoodenFishRuntimeRunRunIdUnique<'ctx> {
WoodenFishRuntimeRunRunIdUnique {
imp: self.imp.get_unique_constraint::<String>("run_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> WoodenFishRuntimeRunRunIdUnique<'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<WoodenFishRuntimeRunRow> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table =
client_cache.get_or_make_table::<WoodenFishRuntimeRunRow>("wooden_fish_runtime_run");
_table.add_unique_constraint::<String>("run_id", |row| &row.run_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<WoodenFishRuntimeRunRow>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<WoodenFishRuntimeRunRow>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `WoodenFishRuntimeRunRow`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait wooden_fish_runtime_runQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `WoodenFishRuntimeRunRow`.
fn wooden_fish_runtime_run(&self) -> __sdk::__query_builder::Table<WoodenFishRuntimeRunRow>;
}
impl wooden_fish_runtime_runQueryTableAccess for __sdk::QueryTableAccessor {
fn wooden_fish_runtime_run(&self) -> __sdk::__query_builder::Table<WoodenFishRuntimeRunRow> {
__sdk::__query_builder::Table::new("wooden_fish_runtime_run")
}
}

View File

@@ -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 WoodenFishWordCounter {
pub text: String,
pub count: u32,
}
impl __sdk::InModule for WoodenFishWordCounter {
type Module = super::RemoteModule;
}

View File

@@ -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 WoodenFishWorkGetInput {
pub profile_id: String,
pub owner_user_id: String,
}
impl __sdk::InModule for WoodenFishWorkGetInput {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,19 @@
// 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::wooden_fish_work_snapshot_type::WoodenFishWorkSnapshot;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct WoodenFishWorkProcedureResult {
pub ok: bool,
pub work: Option<WoodenFishWorkSnapshot>,
pub error_message: Option<String>,
}
impl __sdk::InModule for WoodenFishWorkProcedureResult {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,137 @@
// 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 WoodenFishWorkProfileRow {
pub profile_id: String,
pub work_id: String,
pub owner_user_id: String,
pub source_session_id: String,
pub author_display_name: String,
pub work_title: String,
pub work_description: String,
pub theme_tags_json: String,
pub hit_object_prompt: String,
pub hit_object_reference_image_src: String,
pub hit_sound_prompt: String,
pub hit_object_asset_json: String,
pub hit_sound_asset_json: String,
pub floating_words_json: String,
pub cover_image_src: String,
pub generation_status: String,
pub publication_status: String,
pub play_count: u32,
pub updated_at: __sdk::Timestamp,
pub published_at: Option<__sdk::Timestamp>,
pub background_asset_json: Option<String>,
}
impl __sdk::InModule for WoodenFishWorkProfileRow {
type Module = super::RemoteModule;
}
/// Column accessor struct for the table `WoodenFishWorkProfileRow`.
///
/// Provides typed access to columns for query building.
pub struct WoodenFishWorkProfileRowCols {
pub profile_id: __sdk::__query_builder::Col<WoodenFishWorkProfileRow, String>,
pub work_id: __sdk::__query_builder::Col<WoodenFishWorkProfileRow, String>,
pub owner_user_id: __sdk::__query_builder::Col<WoodenFishWorkProfileRow, String>,
pub source_session_id: __sdk::__query_builder::Col<WoodenFishWorkProfileRow, String>,
pub author_display_name: __sdk::__query_builder::Col<WoodenFishWorkProfileRow, String>,
pub work_title: __sdk::__query_builder::Col<WoodenFishWorkProfileRow, String>,
pub work_description: __sdk::__query_builder::Col<WoodenFishWorkProfileRow, String>,
pub theme_tags_json: __sdk::__query_builder::Col<WoodenFishWorkProfileRow, String>,
pub hit_object_prompt: __sdk::__query_builder::Col<WoodenFishWorkProfileRow, String>,
pub hit_object_reference_image_src:
__sdk::__query_builder::Col<WoodenFishWorkProfileRow, String>,
pub hit_sound_prompt: __sdk::__query_builder::Col<WoodenFishWorkProfileRow, String>,
pub hit_object_asset_json: __sdk::__query_builder::Col<WoodenFishWorkProfileRow, String>,
pub hit_sound_asset_json: __sdk::__query_builder::Col<WoodenFishWorkProfileRow, String>,
pub floating_words_json: __sdk::__query_builder::Col<WoodenFishWorkProfileRow, String>,
pub cover_image_src: __sdk::__query_builder::Col<WoodenFishWorkProfileRow, String>,
pub generation_status: __sdk::__query_builder::Col<WoodenFishWorkProfileRow, String>,
pub publication_status: __sdk::__query_builder::Col<WoodenFishWorkProfileRow, String>,
pub play_count: __sdk::__query_builder::Col<WoodenFishWorkProfileRow, u32>,
pub updated_at: __sdk::__query_builder::Col<WoodenFishWorkProfileRow, __sdk::Timestamp>,
pub published_at:
__sdk::__query_builder::Col<WoodenFishWorkProfileRow, Option<__sdk::Timestamp>>,
pub background_asset_json:
__sdk::__query_builder::Col<WoodenFishWorkProfileRow, Option<String>>,
}
impl __sdk::__query_builder::HasCols for WoodenFishWorkProfileRow {
type Cols = WoodenFishWorkProfileRowCols;
fn cols(table_name: &'static str) -> Self::Cols {
WoodenFishWorkProfileRowCols {
profile_id: __sdk::__query_builder::Col::new(table_name, "profile_id"),
work_id: __sdk::__query_builder::Col::new(table_name, "work_id"),
owner_user_id: __sdk::__query_builder::Col::new(table_name, "owner_user_id"),
source_session_id: __sdk::__query_builder::Col::new(table_name, "source_session_id"),
author_display_name: __sdk::__query_builder::Col::new(
table_name,
"author_display_name",
),
work_title: __sdk::__query_builder::Col::new(table_name, "work_title"),
work_description: __sdk::__query_builder::Col::new(table_name, "work_description"),
theme_tags_json: __sdk::__query_builder::Col::new(table_name, "theme_tags_json"),
hit_object_prompt: __sdk::__query_builder::Col::new(table_name, "hit_object_prompt"),
hit_object_reference_image_src: __sdk::__query_builder::Col::new(
table_name,
"hit_object_reference_image_src",
),
hit_sound_prompt: __sdk::__query_builder::Col::new(table_name, "hit_sound_prompt"),
hit_object_asset_json: __sdk::__query_builder::Col::new(
table_name,
"hit_object_asset_json",
),
hit_sound_asset_json: __sdk::__query_builder::Col::new(
table_name,
"hit_sound_asset_json",
),
floating_words_json: __sdk::__query_builder::Col::new(
table_name,
"floating_words_json",
),
cover_image_src: __sdk::__query_builder::Col::new(table_name, "cover_image_src"),
generation_status: __sdk::__query_builder::Col::new(table_name, "generation_status"),
publication_status: __sdk::__query_builder::Col::new(table_name, "publication_status"),
play_count: __sdk::__query_builder::Col::new(table_name, "play_count"),
updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"),
published_at: __sdk::__query_builder::Col::new(table_name, "published_at"),
background_asset_json: __sdk::__query_builder::Col::new(
table_name,
"background_asset_json",
),
}
}
}
/// Indexed column accessor struct for the table `WoodenFishWorkProfileRow`.
///
/// Provides typed access to indexed columns for query building.
pub struct WoodenFishWorkProfileRowIxCols {
pub owner_user_id: __sdk::__query_builder::IxCol<WoodenFishWorkProfileRow, String>,
pub profile_id: __sdk::__query_builder::IxCol<WoodenFishWorkProfileRow, String>,
pub publication_status: __sdk::__query_builder::IxCol<WoodenFishWorkProfileRow, String>,
}
impl __sdk::__query_builder::HasIxCols for WoodenFishWorkProfileRow {
type IxCols = WoodenFishWorkProfileRowIxCols;
fn ix_cols(table_name: &'static str) -> Self::IxCols {
WoodenFishWorkProfileRowIxCols {
owner_user_id: __sdk::__query_builder::IxCol::new(table_name, "owner_user_id"),
profile_id: __sdk::__query_builder::IxCol::new(table_name, "profile_id"),
publication_status: __sdk::__query_builder::IxCol::new(
table_name,
"publication_status",
),
}
}
}
impl __sdk::__query_builder::CanBeLookupTable for WoodenFishWorkProfileRow {}

View File

@@ -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::wooden_fish_work_profile_row_type::WoodenFishWorkProfileRow;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `wooden_fish_work_profile`.
///
/// Obtain a handle from the [`WoodenFishWorkProfileTableAccess::wooden_fish_work_profile`] method on [`super::RemoteTables`],
/// like `ctx.db.wooden_fish_work_profile()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.wooden_fish_work_profile().on_insert(...)`.
pub struct WoodenFishWorkProfileTableHandle<'ctx> {
imp: __sdk::TableHandle<WoodenFishWorkProfileRow>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `wooden_fish_work_profile`.
///
/// Implemented for [`super::RemoteTables`].
pub trait WoodenFishWorkProfileTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`WoodenFishWorkProfileTableHandle`], which mediates access to the table `wooden_fish_work_profile`.
fn wooden_fish_work_profile(&self) -> WoodenFishWorkProfileTableHandle<'_>;
}
impl WoodenFishWorkProfileTableAccess for super::RemoteTables {
fn wooden_fish_work_profile(&self) -> WoodenFishWorkProfileTableHandle<'_> {
WoodenFishWorkProfileTableHandle {
imp: self
.imp
.get_table::<WoodenFishWorkProfileRow>("wooden_fish_work_profile"),
ctx: std::marker::PhantomData,
}
}
}
pub struct WoodenFishWorkProfileInsertCallbackId(__sdk::CallbackId);
pub struct WoodenFishWorkProfileDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for WoodenFishWorkProfileTableHandle<'ctx> {
type Row = WoodenFishWorkProfileRow;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = WoodenFishWorkProfileRow> + '_ {
self.imp.iter()
}
type InsertCallbackId = WoodenFishWorkProfileInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> WoodenFishWorkProfileInsertCallbackId {
WoodenFishWorkProfileInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: WoodenFishWorkProfileInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = WoodenFishWorkProfileDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> WoodenFishWorkProfileDeleteCallbackId {
WoodenFishWorkProfileDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: WoodenFishWorkProfileDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct WoodenFishWorkProfileUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for WoodenFishWorkProfileTableHandle<'ctx> {
type UpdateCallbackId = WoodenFishWorkProfileUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> WoodenFishWorkProfileUpdateCallbackId {
WoodenFishWorkProfileUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: WoodenFishWorkProfileUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `profile_id` unique index on the table `wooden_fish_work_profile`,
/// which allows point queries on the field of the same name
/// via the [`WoodenFishWorkProfileProfileIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.wooden_fish_work_profile().profile_id().find(...)`.
pub struct WoodenFishWorkProfileProfileIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<WoodenFishWorkProfileRow, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> WoodenFishWorkProfileTableHandle<'ctx> {
/// Get a handle on the `profile_id` unique index on the table `wooden_fish_work_profile`.
pub fn profile_id(&self) -> WoodenFishWorkProfileProfileIdUnique<'ctx> {
WoodenFishWorkProfileProfileIdUnique {
imp: self.imp.get_unique_constraint::<String>("profile_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> WoodenFishWorkProfileProfileIdUnique<'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<WoodenFishWorkProfileRow> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table =
client_cache.get_or_make_table::<WoodenFishWorkProfileRow>("wooden_fish_work_profile");
_table.add_unique_constraint::<String>("profile_id", |row| &row.profile_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<WoodenFishWorkProfileRow>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<WoodenFishWorkProfileRow>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `WoodenFishWorkProfileRow`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait wooden_fish_work_profileQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `WoodenFishWorkProfileRow`.
fn wooden_fish_work_profile(&self) -> __sdk::__query_builder::Table<WoodenFishWorkProfileRow>;
}
impl wooden_fish_work_profileQueryTableAccess for __sdk::QueryTableAccessor {
fn wooden_fish_work_profile(&self) -> __sdk::__query_builder::Table<WoodenFishWorkProfileRow> {
__sdk::__query_builder::Table::new("wooden_fish_work_profile")
}
}

View File

@@ -0,0 +1,17 @@
// 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 WoodenFishWorkPublishInput {
pub profile_id: String,
pub owner_user_id: String,
pub published_at_micros: i64,
}
impl __sdk::InModule for WoodenFishWorkPublishInput {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,39 @@
// 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::wooden_fish_audio_asset_snapshot_type::WoodenFishAudioAssetSnapshot;
use super::wooden_fish_image_asset_snapshot_type::WoodenFishImageAssetSnapshot;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct WoodenFishWorkSnapshot {
pub work_id: String,
pub profile_id: String,
pub owner_user_id: String,
pub source_session_id: String,
pub author_display_name: String,
pub work_title: String,
pub work_description: String,
pub theme_tags: Vec<String>,
pub hit_object_prompt: String,
pub hit_object_reference_image_src: Option<String>,
pub hit_sound_prompt: Option<String>,
pub hit_object_asset: Option<WoodenFishImageAssetSnapshot>,
pub background_asset: Option<WoodenFishImageAssetSnapshot>,
pub hit_sound_asset: Option<WoodenFishAudioAssetSnapshot>,
pub floating_words: Vec<String>,
pub cover_image_src: String,
pub publication_status: String,
pub publish_ready: bool,
pub play_count: u32,
pub generation_status: String,
pub updated_at_micros: i64,
pub published_at_micros: Option<i64>,
}
impl __sdk::InModule for WoodenFishWorkSnapshot {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,29 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct WoodenFishWorkUpdateInput {
pub profile_id: String,
pub owner_user_id: String,
pub work_title: String,
pub work_description: String,
pub theme_tags_json: String,
pub hit_object_prompt: Option<String>,
pub hit_object_reference_image_src: Option<String>,
pub hit_sound_prompt: Option<String>,
pub hit_object_asset_json: Option<String>,
pub background_asset_json: Option<String>,
pub hit_sound_asset_json: Option<String>,
pub floating_words_json: Option<String>,
pub cover_image_src: Option<String>,
pub generation_status: Option<String>,
pub updated_at_micros: i64,
}
impl __sdk::InModule for WoodenFishWorkUpdateInput {
type Module = super::RemoteModule;
}

View File

@@ -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 WoodenFishWorksListInput {
pub owner_user_id: String,
pub published_only: bool,
}
impl __sdk::InModule for WoodenFishWorksListInput {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,19 @@
// 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::wooden_fish_work_snapshot_type::WoodenFishWorkSnapshot;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct WoodenFishWorksProcedureResult {
pub ok: bool,
pub items: Vec<WoodenFishWorkSnapshot>,
pub error_message: Option<String>,
}
impl __sdk::InModule for WoodenFishWorksProcedureResult {
type Module = super::RemoteModule;
}

File diff suppressed because it is too large Load Diff

View File

@@ -19,6 +19,7 @@ module-combat = { workspace = true, features = ["spacetime-types"] }
module-inventory = { workspace = true, features = ["spacetime-types"] }
module-custom-world = { workspace = true, features = ["spacetime-types"] }
module-jump-hop = { workspace = true, features = ["spacetime-types"] }
module-wooden-fish = { workspace = true, features = ["spacetime-types"] }
module-match3d = { workspace = true }
module-npc = { workspace = true, features = ["spacetime-types"] }
module-puzzle = { workspace = true, features = ["spacetime-types"] }

View File

@@ -1,4 +1,4 @@
// 中文注释SpacetimeDB 绑定生成依赖根模块继续公开 re-export 各领域类型;
// 中文注释SpacetimeDB 绑定生成依赖根模块继续公开 re-export 各领域类型;
// 少数领域 helper 同名只影响 value namespace 导出,不影响 table / reducer 类型。
#![allow(ambiguous_glob_reexports)]
@@ -15,6 +15,7 @@ pub use module_quest::*;
pub use module_runtime::*;
pub use module_runtime_item::*;
pub use module_story::*;
pub use module_wooden_fish::*;
pub(crate) use serde_json::{Map as JsonMap, Value as JsonValue, json};
pub(crate) use shared_kernel::format_timestamp_micros;
@@ -37,6 +38,7 @@ mod puzzle;
mod runtime;
mod square_hole;
mod visual_novel;
mod wooden_fish;
pub use ai::*;
pub use asset_metadata::*;
@@ -53,3 +55,4 @@ pub use migration::*;
pub use runtime::*;
pub use square_hole::*;
pub use visual_novel::*;
pub use wooden_fish::*;

View File

@@ -26,6 +26,9 @@ use crate::square_hole::tables::{
square_hole_agent_message, square_hole_agent_session, square_hole_runtime_run,
square_hole_work_profile,
};
use crate::wooden_fish::tables::{
wooden_fish_agent_session, wooden_fish_event, wooden_fish_runtime_run, wooden_fish_work_profile,
};
use crate::{
visual_novel_agent_message, visual_novel_agent_session, visual_novel_runtime_event,
visual_novel_runtime_history_entry, visual_novel_runtime_run, visual_novel_work_profile,
@@ -241,6 +244,10 @@ macro_rules! migration_tables {
jump_hop_work_profile,
jump_hop_runtime_run,
jump_hop_event,
wooden_fish_agent_session,
wooden_fish_work_profile,
wooden_fish_runtime_run,
wooden_fish_event,
square_hole_agent_session,
square_hole_agent_message,
square_hole_work_profile,
@@ -1258,6 +1265,14 @@ fn normalize_migration_row(table_name: &str, value: &serde_json::Value) -> serde
.or_insert(serde_json::Value::Null);
}
}
if table_name == "wooden_fish_work_profile" {
if let Some(object) = next_value.as_object_mut() {
// 中文注释:敲木鱼背景环境图晚于首版作品表加入,旧迁移包按未生成背景兼容。
object
.entry("background_asset_json".to_string())
.or_insert(serde_json::Value::Null);
}
}
next_value
}

View File

@@ -182,17 +182,8 @@ fn seed_creation_entry_config_if_missing(ctx: &ReducerContext) {
migrate_rpg_entry_from_old_hidden_default(ctx, now);
migrate_visual_novel_entry_from_old_visible_default(ctx, now);
migrate_bark_battle_entry_to_open_default(ctx, now);
migrate_coming_soon_entry_from_old_open_default(
ctx,
now,
ComingSoonEntryDefault {
id: "baby-object-match",
title: "宝贝识物",
subtitle: "亲子识物分类",
image_src: "/child-motion-demo/picture-book-grass-stage.png",
sort_order: 90,
},
);
migrate_baby_object_match_entry_from_old_coming_soon_default(ctx, now);
migrate_wooden_fish_entry_from_old_puzzle_image_default(ctx, now);
}
fn migrate_rpg_entry_from_old_hidden_default(ctx: &ReducerContext, now: Timestamp) {
@@ -284,33 +275,24 @@ fn migrate_visual_novel_entry_from_old_visible_default(ctx: &ReducerContext, now
});
}
struct ComingSoonEntryDefault {
id: &'static str,
title: &'static str,
subtitle: &'static str,
image_src: &'static str,
sort_order: i32,
}
fn migrate_coming_soon_entry_from_old_open_default(
fn migrate_baby_object_match_entry_from_old_coming_soon_default(
ctx: &ReducerContext,
now: Timestamp,
target: ComingSoonEntryDefault,
) {
let id = target.id.to_string();
let id = "baby-object-match".to_string();
let Some(row) = ctx.db.creation_entry_type_config().id().find(&id) else {
return;
};
// 中文注释:只把旧默认开放种子纠偏为敬请期待,不覆盖后台手动维护过的入口配置
let still_old_open_default = row.title == target.title
&& row.subtitle == target.subtitle
&& row.badge == "可创建"
&& row.image_src == target.image_src
// 中文注释:宝贝识物已接入完整创作发布链路,只纠偏历史默认敬请期待种子
let still_old_coming_soon_default = row.title == "宝贝识物"
&& row.subtitle == "亲子识物分类"
&& row.badge == "敬请期待"
&& row.image_src == "/child-motion-demo/picture-book-grass-stage.png"
&& row.visible
&& row.open
&& row.sort_order == target.sort_order;
if !still_old_open_default {
&& !row.open
&& row.sort_order == 90;
if !still_old_coming_soon_default {
return;
}
@@ -318,8 +300,36 @@ fn migrate_coming_soon_entry_from_old_open_default(
.creation_entry_type_config()
.id()
.update(CreationEntryTypeConfig {
badge: "敬请期待".to_string(),
open: false,
badge: "可创建".to_string(),
open: true,
updated_at: now,
..row
});
}
fn migrate_wooden_fish_entry_from_old_puzzle_image_default(ctx: &ReducerContext, now: Timestamp) {
let id = "wooden-fish".to_string();
let Some(row) = ctx.db.creation_entry_type_config().id().find(&id) else {
return;
};
// 中文注释:只替换敲木鱼旧默认入口图,不覆盖后台手动设置过的其它展示信息。
let still_old_puzzle_image_default = row.title == "敲木鱼"
&& row.subtitle == "点击祈福轻玩法"
&& row.badge == "可创建"
&& row.image_src == "/creation-type-references/puzzle.webp"
&& row.visible
&& row.open
&& row.sort_order == 47;
if !still_old_puzzle_image_default {
return;
}
ctx.db
.creation_entry_type_config()
.id()
.update(CreationEntryTypeConfig {
image_src: "/wooden-fish/default-hit-object.png".to_string(),
updated_at: now,
..row
});

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,87 @@
use crate::*;
#[spacetimedb::table(
accessor = wooden_fish_agent_session,
index(accessor = by_wooden_fish_agent_session_owner_user_id, btree(columns = [owner_user_id]))
)]
pub struct WoodenFishAgentSessionRow {
#[primary_key]
pub(crate) session_id: String,
pub(crate) owner_user_id: String,
pub(crate) current_turn: u32,
pub(crate) progress_percent: u32,
pub(crate) stage: String,
pub(crate) config_json: String,
pub(crate) draft_json: String,
pub(crate) published_profile_id: String,
pub(crate) created_at: Timestamp,
pub(crate) updated_at: Timestamp,
}
#[spacetimedb::table(
accessor = wooden_fish_work_profile,
index(accessor = by_wooden_fish_work_owner_user_id, btree(columns = [owner_user_id])),
index(accessor = by_wooden_fish_work_publication_status, btree(columns = [publication_status]))
)]
pub struct WoodenFishWorkProfileRow {
#[primary_key]
pub(crate) profile_id: String,
pub(crate) work_id: String,
pub(crate) owner_user_id: String,
pub(crate) source_session_id: String,
pub(crate) author_display_name: String,
pub(crate) work_title: String,
pub(crate) work_description: String,
pub(crate) theme_tags_json: String,
pub(crate) hit_object_prompt: String,
pub(crate) hit_object_reference_image_src: String,
pub(crate) hit_sound_prompt: String,
pub(crate) hit_object_asset_json: String,
pub(crate) hit_sound_asset_json: String,
pub(crate) floating_words_json: String,
pub(crate) cover_image_src: String,
pub(crate) generation_status: String,
pub(crate) publication_status: String,
pub(crate) play_count: u32,
pub(crate) updated_at: Timestamp,
pub(crate) published_at: Option<Timestamp>,
#[default(None::<String>)]
pub(crate) background_asset_json: Option<String>,
}
#[spacetimedb::table(
accessor = wooden_fish_runtime_run,
index(accessor = by_wooden_fish_run_owner_user_id, btree(columns = [owner_user_id])),
index(accessor = by_wooden_fish_run_profile_id, btree(columns = [profile_id]))
)]
pub struct WoodenFishRuntimeRunRow {
#[primary_key]
pub(crate) run_id: String,
pub(crate) owner_user_id: String,
pub(crate) profile_id: String,
pub(crate) status: String,
pub(crate) total_tap_count: u32,
pub(crate) word_counters_json: String,
pub(crate) started_at_ms: i64,
pub(crate) updated_at_ms: i64,
pub(crate) finished_at_ms: i64,
pub(crate) snapshot_json: String,
pub(crate) created_at: Timestamp,
pub(crate) updated_at: Timestamp,
}
#[spacetimedb::table(
accessor = wooden_fish_event,
index(accessor = by_wooden_fish_event_profile_id, btree(columns = [profile_id])),
index(accessor = by_wooden_fish_event_run_id, btree(columns = [run_id]))
)]
pub struct WoodenFishEventRow {
#[primary_key]
pub(crate) event_id: String,
pub(crate) owner_user_id: String,
pub(crate) profile_id: String,
pub(crate) run_id: String,
pub(crate) event_type: String,
pub(crate) result: String,
pub(crate) occurred_at: Timestamp,
}

View File

@@ -0,0 +1,258 @@
use crate::*;
use serde::{Deserialize, Serialize};
pub const WOODEN_FISH_TEMPLATE_ID: &str = "wooden-fish";
pub const WOODEN_FISH_TEMPLATE_NAME: &str = "敲木鱼";
pub const WOODEN_FISH_STAGE_COLLECTING: &str = "Collecting";
pub const WOODEN_FISH_STAGE_DRAFT_COMPILED: &str = "DraftCompiled";
pub const WOODEN_FISH_STAGE_PUBLISHED: &str = "Published";
pub const WOODEN_FISH_PUBLICATION_DRAFT: &str = "Draft";
pub const WOODEN_FISH_PUBLICATION_PUBLISHED: &str = "Published";
pub const WOODEN_FISH_GENERATION_DRAFT: &str = "draft";
pub const WOODEN_FISH_GENERATION_READY: &str = "ready";
pub const WOODEN_FISH_EVENT_RUN_STARTED: &str = "run-started";
pub const WOODEN_FISH_EVENT_RUN_CHECKPOINT: &str = "checkpoint";
pub const WOODEN_FISH_EVENT_RUN_FINISHED: &str = "finish";
#[derive(Clone, Debug, PartialEq, Eq, SpacetimeType)]
pub struct WoodenFishAgentSessionCreateInput {
pub session_id: String,
pub owner_user_id: String,
pub work_title: String,
pub work_description: String,
pub theme_tags_json: Option<String>,
pub config_json: Option<String>,
pub draft_json: Option<String>,
pub created_at_micros: i64,
}
#[derive(Clone, Debug, PartialEq, Eq, SpacetimeType)]
pub struct WoodenFishAgentSessionGetInput {
pub session_id: String,
pub owner_user_id: String,
}
#[derive(Clone, Debug, PartialEq, Eq, SpacetimeType)]
pub struct WoodenFishDraftCompileInput {
pub session_id: String,
pub owner_user_id: String,
pub profile_id: String,
pub author_display_name: String,
pub work_title: String,
pub work_description: String,
pub theme_tags_json: Option<String>,
pub hit_object_prompt: String,
pub hit_object_reference_image_src: Option<String>,
pub hit_sound_prompt: Option<String>,
pub hit_object_asset_json: Option<String>,
pub background_asset_json: Option<String>,
pub hit_sound_asset_json: Option<String>,
pub floating_words_json: Option<String>,
pub cover_image_src: Option<String>,
pub generation_status: Option<String>,
pub compiled_at_micros: i64,
}
#[derive(Clone, Debug, PartialEq, Eq, SpacetimeType)]
pub struct WoodenFishWorkUpdateInput {
pub profile_id: String,
pub owner_user_id: String,
pub work_title: String,
pub work_description: String,
pub theme_tags_json: String,
pub hit_object_prompt: Option<String>,
pub hit_object_reference_image_src: Option<String>,
pub hit_sound_prompt: Option<String>,
pub hit_object_asset_json: Option<String>,
pub background_asset_json: Option<String>,
pub hit_sound_asset_json: Option<String>,
pub floating_words_json: Option<String>,
pub cover_image_src: Option<String>,
pub generation_status: Option<String>,
pub updated_at_micros: i64,
}
#[derive(Clone, Debug, PartialEq, Eq, SpacetimeType)]
pub struct WoodenFishWorkPublishInput {
pub profile_id: String,
pub owner_user_id: String,
pub published_at_micros: i64,
}
#[derive(Clone, Debug, PartialEq, Eq, SpacetimeType)]
pub struct WoodenFishWorksListInput {
pub owner_user_id: String,
pub published_only: bool,
}
#[derive(Clone, Debug, PartialEq, Eq, SpacetimeType)]
pub struct WoodenFishWorkGetInput {
pub profile_id: String,
pub owner_user_id: String,
}
#[derive(Clone, Debug, PartialEq, Eq, SpacetimeType)]
pub struct WoodenFishRunStartInput {
pub run_id: String,
pub owner_user_id: String,
pub profile_id: String,
pub client_event_id: String,
pub started_at_ms: i64,
}
#[derive(Clone, Debug, PartialEq, Eq, SpacetimeType)]
pub struct WoodenFishRunGetInput {
pub run_id: String,
pub owner_user_id: String,
}
#[derive(Clone, Debug, PartialEq, Eq, SpacetimeType)]
pub struct WoodenFishRunCheckpointInput {
pub run_id: String,
pub owner_user_id: String,
pub total_tap_count: u32,
pub word_counters_json: String,
pub client_event_id: String,
pub checkpoint_at_ms: i64,
}
#[derive(Clone, Debug, PartialEq, Eq, SpacetimeType)]
pub struct WoodenFishRunFinishInput {
pub run_id: String,
pub owner_user_id: String,
pub total_tap_count: u32,
pub word_counters_json: String,
pub client_event_id: String,
pub finished_at_ms: i64,
}
#[derive(Clone, Debug, PartialEq, SpacetimeType)]
pub struct WoodenFishAgentSessionProcedureResult {
pub ok: bool,
pub session: Option<WoodenFishAgentSessionSnapshot>,
pub error_message: Option<String>,
}
#[derive(Clone, Debug, PartialEq, SpacetimeType)]
pub struct WoodenFishWorkProcedureResult {
pub ok: bool,
pub work: Option<WoodenFishWorkSnapshot>,
pub error_message: Option<String>,
}
#[derive(Clone, Debug, PartialEq, SpacetimeType)]
pub struct WoodenFishWorksProcedureResult {
pub ok: bool,
pub items: Vec<WoodenFishWorkSnapshot>,
pub error_message: Option<String>,
}
#[derive(Clone, Debug, PartialEq, SpacetimeType)]
pub struct WoodenFishRunProcedureResult {
pub ok: bool,
pub run: Option<module_wooden_fish::WoodenFishRunSnapshot>,
pub error_message: Option<String>,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, SpacetimeType)]
#[serde(rename_all = "camelCase")]
pub struct WoodenFishCreatorConfigSnapshot {
pub work_title: String,
pub work_description: String,
pub theme_tags: Vec<String>,
pub hit_object_prompt: String,
#[serde(default)]
pub hit_object_reference_image_src: Option<String>,
#[serde(default)]
pub hit_sound_prompt: Option<String>,
pub floating_words: Vec<String>,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, SpacetimeType)]
#[serde(rename_all = "camelCase")]
pub struct WoodenFishImageAssetSnapshot {
pub asset_id: String,
pub image_src: String,
pub image_object_key: String,
pub asset_object_id: String,
pub generation_provider: String,
pub prompt: String,
pub width: u32,
pub height: u32,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, SpacetimeType)]
#[serde(rename_all = "camelCase")]
pub struct WoodenFishAudioAssetSnapshot {
pub asset_id: String,
pub audio_src: String,
pub audio_object_key: String,
pub asset_object_id: String,
pub source: String,
#[serde(default)]
pub prompt: Option<String>,
#[serde(default)]
pub duration_ms: Option<u32>,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, SpacetimeType)]
#[serde(rename_all = "camelCase")]
pub struct WoodenFishDraftSnapshot {
pub template_id: String,
pub template_name: String,
pub profile_id: Option<String>,
pub work_title: String,
pub work_description: String,
pub theme_tags: Vec<String>,
pub hit_object_prompt: String,
pub hit_object_reference_image_src: Option<String>,
pub hit_sound_prompt: Option<String>,
pub floating_words: Vec<String>,
pub hit_object_asset: Option<WoodenFishImageAssetSnapshot>,
pub background_asset: Option<WoodenFishImageAssetSnapshot>,
pub hit_sound_asset: Option<WoodenFishAudioAssetSnapshot>,
pub cover_image_src: Option<String>,
pub generation_status: String,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, SpacetimeType)]
#[serde(rename_all = "camelCase")]
pub struct WoodenFishAgentSessionSnapshot {
pub session_id: String,
pub owner_user_id: String,
pub current_turn: u32,
pub progress_percent: u32,
pub stage: String,
pub config: WoodenFishCreatorConfigSnapshot,
pub draft: Option<WoodenFishDraftSnapshot>,
pub published_profile_id: Option<String>,
pub created_at_micros: i64,
pub updated_at_micros: i64,
}
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, SpacetimeType)]
#[serde(rename_all = "camelCase")]
pub struct WoodenFishWorkSnapshot {
pub work_id: String,
pub profile_id: String,
pub owner_user_id: String,
pub source_session_id: String,
pub author_display_name: String,
pub work_title: String,
pub work_description: String,
pub theme_tags: Vec<String>,
pub hit_object_prompt: String,
pub hit_object_reference_image_src: Option<String>,
pub hit_sound_prompt: Option<String>,
pub hit_object_asset: Option<WoodenFishImageAssetSnapshot>,
pub background_asset: Option<WoodenFishImageAssetSnapshot>,
pub hit_sound_asset: Option<WoodenFishAudioAssetSnapshot>,
pub floating_words: Vec<String>,
pub cover_image_src: String,
pub publication_status: String,
pub publish_ready: bool,
pub play_count: u32,
pub generation_status: String,
pub updated_at_micros: i64,
pub published_at_micros: Option<i64>,
}