1
This commit is contained in:
@@ -50,8 +50,9 @@ pub use mapper::{
|
||||
PuzzleResultPreviewRecord, PuzzleRunDragRecordInput, PuzzleRunNextLevelRecordInput,
|
||||
PuzzleRunPauseRecordInput, PuzzleRunPropRecordInput, PuzzleRunRecord,
|
||||
PuzzleRunStartRecordInput, PuzzleRunSwapRecordInput, PuzzleRuntimeLevelRecord,
|
||||
PuzzleSelectCoverImageRecordInput, PuzzleWorkLikeReportRecordInput,
|
||||
PuzzleWorkPointIncentiveClaimRecordInput, PuzzleWorkProfileRecord, PuzzleWorkRemixRecordInput,
|
||||
PuzzleSelectCoverImageRecordInput, PuzzleUiBackgroundSaveRecordInput,
|
||||
PuzzleWorkLikeReportRecordInput, PuzzleWorkPointIncentiveClaimRecordInput,
|
||||
PuzzleWorkProfileRecord, PuzzleWorkRemixRecordInput,
|
||||
PuzzleWorkUpsertRecordInput, ResolveCombatActionRecord, ResolveNpcBattleInteractionInput,
|
||||
SquareHoleAgentMessageFinalizeRecordInput, SquareHoleAgentMessageRecord,
|
||||
SquareHoleAgentMessageSubmitRecordInput, SquareHoleAgentSessionCreateRecordInput,
|
||||
|
||||
@@ -2917,6 +2917,9 @@ pub(crate) fn map_puzzle_draft_level(snapshot: DomainPuzzleDraftLevel) -> Puzzle
|
||||
level_name: snapshot.level_name,
|
||||
picture_description: snapshot.picture_description,
|
||||
picture_reference: snapshot.picture_reference,
|
||||
ui_background_prompt: snapshot.ui_background_prompt,
|
||||
ui_background_image_src: snapshot.ui_background_image_src,
|
||||
ui_background_image_object_key: snapshot.ui_background_image_object_key,
|
||||
background_music: snapshot.background_music.map(map_puzzle_audio_asset),
|
||||
candidates: snapshot
|
||||
.candidates
|
||||
@@ -3022,6 +3025,7 @@ fn map_match3d_creator_config(
|
||||
asset_style_id: snapshot.asset_style_id,
|
||||
asset_style_label: snapshot.asset_style_label,
|
||||
asset_style_prompt: snapshot.asset_style_prompt,
|
||||
generate_click_sound: snapshot.generate_click_sound,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3799,6 +3803,8 @@ pub(crate) fn map_puzzle_runtime_level_snapshot(
|
||||
author_display_name: snapshot.author_display_name,
|
||||
theme_tags: snapshot.theme_tags,
|
||||
cover_image_src: snapshot.cover_image_src,
|
||||
ui_background_image_src: snapshot.ui_background_image_src,
|
||||
background_music: snapshot.background_music.map(map_puzzle_audio_asset),
|
||||
board: map_puzzle_board_snapshot(snapshot.board),
|
||||
status: snapshot.status.as_str().to_string(),
|
||||
started_at_ms,
|
||||
@@ -5888,6 +5894,18 @@ pub struct PuzzleGeneratedImagesSaveRecordInput {
|
||||
pub saved_at_micros: i64,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub struct PuzzleUiBackgroundSaveRecordInput {
|
||||
pub session_id: String,
|
||||
pub owner_user_id: String,
|
||||
pub level_id: Option<String>,
|
||||
pub levels_json: Option<String>,
|
||||
pub prompt: String,
|
||||
pub image_src: String,
|
||||
pub image_object_key: Option<String>,
|
||||
pub saved_at_micros: i64,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub struct PuzzleSelectCoverImageRecordInput {
|
||||
pub session_id: String,
|
||||
@@ -6110,6 +6128,7 @@ pub struct Match3DRunStartRecordInput {
|
||||
pub owner_user_id: String,
|
||||
pub profile_id: String,
|
||||
pub started_at_ms: i64,
|
||||
pub item_type_count_override: u32,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
@@ -6168,6 +6187,7 @@ pub struct Match3DCreatorConfigRecord {
|
||||
pub asset_style_id: Option<String>,
|
||||
pub asset_style_label: Option<String>,
|
||||
pub asset_style_prompt: Option<String>,
|
||||
pub generate_click_sound: bool,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
@@ -6301,6 +6321,8 @@ struct Match3DCreatorConfigJsonRecord {
|
||||
asset_style_label: Option<String>,
|
||||
#[serde(default)]
|
||||
asset_style_prompt: Option<String>,
|
||||
#[serde(default)]
|
||||
generate_click_sound: bool,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, serde::Deserialize)]
|
||||
@@ -7285,6 +7307,9 @@ pub struct PuzzleDraftLevelRecord {
|
||||
pub level_name: String,
|
||||
pub picture_description: String,
|
||||
pub picture_reference: Option<String>,
|
||||
pub ui_background_prompt: Option<String>,
|
||||
pub ui_background_image_src: Option<String>,
|
||||
pub ui_background_image_object_key: Option<String>,
|
||||
pub background_music: Option<PuzzleAudioAssetRecord>,
|
||||
pub candidates: Vec<PuzzleGeneratedImageCandidateRecord>,
|
||||
pub selected_candidate_id: Option<String>,
|
||||
@@ -7459,6 +7484,8 @@ pub struct PuzzleRuntimeLevelRecord {
|
||||
pub author_display_name: String,
|
||||
pub theme_tags: Vec<String>,
|
||||
pub cover_image_src: Option<String>,
|
||||
pub ui_background_image_src: Option<String>,
|
||||
pub background_music: Option<PuzzleAudioAssetRecord>,
|
||||
pub board: PuzzleBoardRecord,
|
||||
pub status: String,
|
||||
pub started_at_ms: u64,
|
||||
|
||||
@@ -296,6 +296,7 @@ impl SpacetimeClient {
|
||||
owner_user_id: input.owner_user_id,
|
||||
profile_id: input.profile_id,
|
||||
started_at_ms: input.started_at_ms,
|
||||
item_type_count_override: input.item_type_count_override,
|
||||
};
|
||||
|
||||
self.call_after_connect(move |connection, sender| {
|
||||
|
||||
@@ -11,6 +11,7 @@ pub struct Match3DRunStartInput {
|
||||
pub owner_user_id: String,
|
||||
pub profile_id: String,
|
||||
pub started_at_ms: i64,
|
||||
pub item_type_count_override: u32,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for Match3DRunStartInput {
|
||||
|
||||
@@ -493,6 +493,7 @@ pub mod puzzle_run_swap_input_type;
|
||||
pub mod puzzle_runtime_run_row_type;
|
||||
pub mod puzzle_runtime_run_table;
|
||||
pub mod puzzle_select_cover_image_input_type;
|
||||
pub mod puzzle_ui_background_save_input_type;
|
||||
pub mod puzzle_work_delete_input_type;
|
||||
pub mod puzzle_work_get_input_type;
|
||||
pub mod puzzle_work_like_record_input_type;
|
||||
@@ -679,6 +680,7 @@ pub mod runtime_tracking_event_procedure_result_type;
|
||||
pub mod runtime_tracking_scope_kind_type;
|
||||
pub mod save_puzzle_form_draft_procedure;
|
||||
pub mod save_puzzle_generated_images_procedure;
|
||||
pub mod save_puzzle_ui_background_procedure;
|
||||
pub mod seed_analytics_date_dimensions_reducer;
|
||||
pub mod select_puzzle_cover_image_procedure;
|
||||
pub mod square_hole_agent_message_finalize_input_type;
|
||||
@@ -1301,6 +1303,7 @@ pub use puzzle_run_swap_input_type::PuzzleRunSwapInput;
|
||||
pub use puzzle_runtime_run_row_type::PuzzleRuntimeRunRow;
|
||||
pub use puzzle_runtime_run_table::*;
|
||||
pub use puzzle_select_cover_image_input_type::PuzzleSelectCoverImageInput;
|
||||
pub use puzzle_ui_background_save_input_type::PuzzleUiBackgroundSaveInput;
|
||||
pub use puzzle_work_delete_input_type::PuzzleWorkDeleteInput;
|
||||
pub use puzzle_work_get_input_type::PuzzleWorkGetInput;
|
||||
pub use puzzle_work_like_record_input_type::PuzzleWorkLikeRecordInput;
|
||||
@@ -1487,6 +1490,7 @@ pub use runtime_tracking_event_procedure_result_type::RuntimeTrackingEventProced
|
||||
pub use runtime_tracking_scope_kind_type::RuntimeTrackingScopeKind;
|
||||
pub use save_puzzle_form_draft_procedure::save_puzzle_form_draft;
|
||||
pub use save_puzzle_generated_images_procedure::save_puzzle_generated_images;
|
||||
pub use save_puzzle_ui_background_procedure::save_puzzle_ui_background;
|
||||
pub use seed_analytics_date_dimensions_reducer::seed_analytics_date_dimensions;
|
||||
pub use select_puzzle_cover_image_procedure::select_puzzle_cover_image;
|
||||
pub use square_hole_agent_message_finalize_input_type::SquareHoleAgentMessageFinalizeInput;
|
||||
|
||||
@@ -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 PuzzleUiBackgroundSaveInput {
|
||||
pub session_id: String,
|
||||
pub owner_user_id: String,
|
||||
pub level_id: Option<String>,
|
||||
pub levels_json: Option<String>,
|
||||
pub prompt: String,
|
||||
pub image_src: String,
|
||||
pub image_object_key: Option<String>,
|
||||
pub saved_at_micros: i64,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for PuzzleUiBackgroundSaveInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
@@ -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::puzzle_agent_session_procedure_result_type::PuzzleAgentSessionProcedureResult;
|
||||
use super::puzzle_ui_background_save_input_type::PuzzleUiBackgroundSaveInput;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
struct SavePuzzleUiBackgroundArgs {
|
||||
pub input: PuzzleUiBackgroundSaveInput,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for SavePuzzleUiBackgroundArgs {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the procedure `save_puzzle_ui_background`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteProcedures`].
|
||||
pub trait save_puzzle_ui_background {
|
||||
fn save_puzzle_ui_background(&self, input: PuzzleUiBackgroundSaveInput) {
|
||||
self.save_puzzle_ui_background_then(input, |_, _| {});
|
||||
}
|
||||
|
||||
fn save_puzzle_ui_background_then(
|
||||
&self,
|
||||
input: PuzzleUiBackgroundSaveInput,
|
||||
|
||||
__callback: impl FnOnce(
|
||||
&super::ProcedureEventContext,
|
||||
Result<PuzzleAgentSessionProcedureResult, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
);
|
||||
}
|
||||
|
||||
impl save_puzzle_ui_background for super::RemoteProcedures {
|
||||
fn save_puzzle_ui_background_then(
|
||||
&self,
|
||||
input: PuzzleUiBackgroundSaveInput,
|
||||
|
||||
__callback: impl FnOnce(
|
||||
&super::ProcedureEventContext,
|
||||
Result<PuzzleAgentSessionProcedureResult, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
) {
|
||||
self.imp
|
||||
.invoke_procedure_with_callback::<_, PuzzleAgentSessionProcedureResult>(
|
||||
"save_puzzle_ui_background",
|
||||
SavePuzzleUiBackgroundArgs { input },
|
||||
__callback,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ use crate::module_bindings::claim_puzzle_work_point_incentive_procedure::claim_p
|
||||
use crate::module_bindings::delete_puzzle_work_procedure::delete_puzzle_work;
|
||||
use crate::module_bindings::record_puzzle_work_like_procedure::record_puzzle_work_like;
|
||||
use crate::module_bindings::remix_puzzle_work_procedure::remix_puzzle_work;
|
||||
use crate::module_bindings::save_puzzle_ui_background_procedure::save_puzzle_ui_background;
|
||||
|
||||
impl SpacetimeClient {
|
||||
pub async fn create_puzzle_agent_session(
|
||||
@@ -190,6 +191,35 @@ impl SpacetimeClient {
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn save_puzzle_ui_background(
|
||||
&self,
|
||||
input: PuzzleUiBackgroundSaveRecordInput,
|
||||
) -> Result<PuzzleAgentSessionRecord, SpacetimeClientError> {
|
||||
let procedure_input = PuzzleUiBackgroundSaveInput {
|
||||
session_id: input.session_id,
|
||||
owner_user_id: input.owner_user_id,
|
||||
level_id: input.level_id,
|
||||
levels_json: input.levels_json,
|
||||
prompt: input.prompt,
|
||||
image_src: input.image_src,
|
||||
image_object_key: input.image_object_key,
|
||||
saved_at_micros: input.saved_at_micros,
|
||||
};
|
||||
|
||||
self.call_after_connect(move |connection, sender| {
|
||||
connection.procedures().save_puzzle_ui_background_then(
|
||||
procedure_input,
|
||||
move |_, result| {
|
||||
let mapped = result
|
||||
.map_err(SpacetimeClientError::from_sdk_error)
|
||||
.and_then(map_puzzle_agent_session_procedure_result);
|
||||
send_once(&sender, mapped);
|
||||
},
|
||||
);
|
||||
})
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn select_puzzle_cover_image(
|
||||
&self,
|
||||
input: PuzzleSelectCoverImageRecordInput,
|
||||
|
||||
Reference in New Issue
Block a user