Update spacetime-client bindings and frontend
Large update across server and web clients: regenerated/added many spacetime-client module bindings and input types (including new delete/work_delete input types and numerous procedure/reducer files), updates to server-rs API modules (bark_battle, jump_hop, wooden_fish, auth, module-runtime and shared contracts), and fixes in module-runtime behavior and domain logic. Frontend changes include new/updated components and tests (creative audio helpers, bark-battle/jump-hop/wooden-fish clients and views, unified generation pages, RPG entry views, and runtime shells), plus CSS and service updates. Documentation and operational notes updated (.hermes pitfalls and multiple PRD/docs) to cover daily-task refresh, banner asset fallback, recommend-key bug, and other platform behaviors. Tests and verification steps added/updated alongside these changes.
This commit is contained in:
@@ -202,6 +202,25 @@ pub fn list_wooden_fish_works(
|
||||
}
|
||||
}
|
||||
|
||||
#[spacetimedb::procedure]
|
||||
pub fn delete_wooden_fish_work(
|
||||
ctx: &mut ProcedureContext,
|
||||
input: WoodenFishWorkDeleteInput,
|
||||
) -> WoodenFishWorksProcedureResult {
|
||||
match ctx.try_with_tx(|tx| delete_wooden_fish_work_tx(tx, input.clone())) {
|
||||
Ok(items) => WoodenFishWorksProcedureResult {
|
||||
ok: true,
|
||||
items,
|
||||
error_message: None,
|
||||
},
|
||||
Err(message) => WoodenFishWorksProcedureResult {
|
||||
ok: false,
|
||||
items: Vec::new(),
|
||||
error_message: Some(message),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
#[spacetimedb::procedure]
|
||||
pub fn start_wooden_fish_run(
|
||||
ctx: &mut ProcedureContext,
|
||||
@@ -598,6 +617,62 @@ fn list_wooden_fish_works_tx(
|
||||
.collect()
|
||||
}
|
||||
|
||||
fn delete_wooden_fish_work_tx(
|
||||
ctx: &ReducerContext,
|
||||
input: WoodenFishWorkDeleteInput,
|
||||
) -> Result<Vec<WoodenFishWorkSnapshot>, String> {
|
||||
let work = find_owned_work(ctx, &input.profile_id, &input.owner_user_id)?;
|
||||
ctx.db
|
||||
.wooden_fish_work_profile()
|
||||
.profile_id()
|
||||
.delete(&work.profile_id);
|
||||
if !work.source_session_id.trim().is_empty() {
|
||||
if let Some(session) = ctx
|
||||
.db
|
||||
.wooden_fish_agent_session()
|
||||
.session_id()
|
||||
.find(&work.source_session_id)
|
||||
.filter(|session| session.owner_user_id == input.owner_user_id)
|
||||
{
|
||||
ctx.db
|
||||
.wooden_fish_agent_session()
|
||||
.session_id()
|
||||
.delete(&session.session_id);
|
||||
}
|
||||
}
|
||||
for run in ctx
|
||||
.db
|
||||
.wooden_fish_runtime_run()
|
||||
.by_wooden_fish_run_profile_id()
|
||||
.filter(input.profile_id.as_str())
|
||||
.collect::<Vec<_>>()
|
||||
{
|
||||
ctx.db
|
||||
.wooden_fish_runtime_run()
|
||||
.run_id()
|
||||
.delete(&run.run_id);
|
||||
}
|
||||
for event in ctx
|
||||
.db
|
||||
.wooden_fish_event()
|
||||
.by_wooden_fish_event_profile_id()
|
||||
.filter(input.profile_id.as_str())
|
||||
.collect::<Vec<_>>()
|
||||
{
|
||||
ctx.db
|
||||
.wooden_fish_event()
|
||||
.event_id()
|
||||
.delete(&event.event_id);
|
||||
}
|
||||
list_wooden_fish_works_tx(
|
||||
ctx,
|
||||
WoodenFishWorksListInput {
|
||||
owner_user_id: input.owner_user_id,
|
||||
published_only: false,
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
fn start_wooden_fish_run_tx(
|
||||
ctx: &ReducerContext,
|
||||
input: WoodenFishRunStartInput,
|
||||
@@ -1363,6 +1438,17 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn wooden_fish_delete_input_carries_owner_and_profile() {
|
||||
let input = WoodenFishWorkDeleteInput {
|
||||
profile_id: "wooden-fish-profile-1".to_string(),
|
||||
owner_user_id: "user-1".to_string(),
|
||||
};
|
||||
|
||||
assert_eq!(input.profile_id, "wooden-fish-profile-1");
|
||||
assert_eq!(input.owner_user_id, "user-1");
|
||||
}
|
||||
|
||||
fn published_ready_work_without_back_button() -> WoodenFishWorkProfileRow {
|
||||
let now = Timestamp::from_micros_since_unix_epoch(1_770_000_000_000_000);
|
||||
WoodenFishWorkProfileRow {
|
||||
|
||||
Reference in New Issue
Block a user