新增图片画布编辑器
新增 /editor 图片画布入口与 Lovart 风格画布交互 新增图片画布工程和资源持久化的 SpacetimeDB 表、绑定与 api-server BFF 接入图片生成和修改的 VectorEngine gpt-image-2 后端通道 完善素材库文件夹、重命名、上传删除、图层和元数据交互 补充图片画布技术方案、领域词、执行跟踪和浏览器 smoke 截图
This commit is contained in:
122
server-rs/crates/spacetime-client/src/editor_project.rs
Normal file
122
server-rs/crates/spacetime-client/src/editor_project.rs
Normal file
@@ -0,0 +1,122 @@
|
||||
use super::*;
|
||||
|
||||
impl SpacetimeClient {
|
||||
pub async fn create_editor_project(
|
||||
&self,
|
||||
input: EditorProjectCreateRecordInput,
|
||||
) -> Result<EditorProjectRecord, SpacetimeClientError> {
|
||||
let procedure_input = input.into();
|
||||
|
||||
self.call_after_connect(
|
||||
"create_editor_project_and_return",
|
||||
move |connection, sender| {
|
||||
connection
|
||||
.procedures()
|
||||
.create_editor_project_and_return_then(procedure_input, move |_, result| {
|
||||
let mapped = result
|
||||
.map_err(SpacetimeClientError::from_sdk_error)
|
||||
.and_then(map_editor_project_required_procedure_result);
|
||||
send_once(&sender, mapped);
|
||||
});
|
||||
},
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn get_recent_editor_project(
|
||||
&self,
|
||||
owner_user_id: String,
|
||||
) -> Result<Option<EditorProjectRecord>, SpacetimeClientError> {
|
||||
let procedure_input = EditorProjectGetRecentInput { owner_user_id };
|
||||
|
||||
self.call_after_connect(
|
||||
"get_recent_editor_project_and_return",
|
||||
move |connection, sender| {
|
||||
connection
|
||||
.procedures()
|
||||
.get_recent_editor_project_and_return_then(
|
||||
procedure_input,
|
||||
move |_, result| {
|
||||
let mapped = result
|
||||
.map_err(SpacetimeClientError::from_sdk_error)
|
||||
.and_then(map_editor_project_optional_procedure_result);
|
||||
send_once(&sender, mapped);
|
||||
},
|
||||
);
|
||||
},
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn get_editor_project(
|
||||
&self,
|
||||
input: EditorProjectGetRecordInput,
|
||||
) -> Result<EditorProjectRecord, SpacetimeClientError> {
|
||||
let procedure_input = input.into();
|
||||
|
||||
self.call_after_connect(
|
||||
"get_editor_project_and_return",
|
||||
move |connection, sender| {
|
||||
connection
|
||||
.procedures()
|
||||
.get_editor_project_and_return_then(procedure_input, move |_, result| {
|
||||
let mapped = result
|
||||
.map_err(SpacetimeClientError::from_sdk_error)
|
||||
.and_then(map_editor_project_required_procedure_result);
|
||||
send_once(&sender, mapped);
|
||||
});
|
||||
},
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn save_editor_project_layout(
|
||||
&self,
|
||||
input: EditorProjectLayoutSaveRecordInput,
|
||||
) -> Result<EditorProjectRecord, SpacetimeClientError> {
|
||||
let procedure_input = input.into();
|
||||
|
||||
self.call_after_connect(
|
||||
"save_editor_project_layout_and_return",
|
||||
move |connection, sender| {
|
||||
connection
|
||||
.procedures()
|
||||
.save_editor_project_layout_and_return_then(
|
||||
procedure_input,
|
||||
move |_, result| {
|
||||
let mapped = result
|
||||
.map_err(SpacetimeClientError::from_sdk_error)
|
||||
.and_then(map_editor_project_required_procedure_result);
|
||||
send_once(&sender, mapped);
|
||||
},
|
||||
);
|
||||
},
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn create_editor_project_resource(
|
||||
&self,
|
||||
input: EditorProjectResourceCreateRecordInput,
|
||||
) -> Result<EditorProjectResourceRecord, SpacetimeClientError> {
|
||||
let procedure_input = input.into();
|
||||
|
||||
self.call_after_connect(
|
||||
"create_editor_project_resource_and_return",
|
||||
move |connection, sender| {
|
||||
connection
|
||||
.procedures()
|
||||
.create_editor_project_resource_and_return_then(
|
||||
procedure_input,
|
||||
move |_, result| {
|
||||
let mapped = result
|
||||
.map_err(SpacetimeClientError::from_sdk_error)
|
||||
.and_then(map_editor_project_resource_procedure_result);
|
||||
send_once(&sender, mapped);
|
||||
},
|
||||
);
|
||||
},
|
||||
)
|
||||
.await
|
||||
}
|
||||
}
|
||||
@@ -30,8 +30,11 @@ pub use mapper::{
|
||||
CustomWorldPublishGateRecord, CustomWorldPublishWorldRecord,
|
||||
CustomWorldPublishWorldRecordInput, CustomWorldPublishedProfileCompileRecord,
|
||||
CustomWorldResultPreviewBlockerRecord, CustomWorldSupportedActionRecord,
|
||||
CustomWorldWorkSummaryRecord, JumpHopActionRequest, JumpHopActionResponse, JumpHopActionType,
|
||||
JumpHopCharacterAsset, JumpHopDifficulty, JumpHopDraftResponse, JumpHopGalleryCardResponse,
|
||||
CustomWorldWorkSummaryRecord, EditorCanvasViewportRecord, EditorProjectCreateRecordInput,
|
||||
EditorProjectGetRecordInput, EditorProjectLayoutSaveRecordInput, EditorProjectRecord,
|
||||
EditorProjectResourceCreateRecordInput, EditorProjectResourceRecord, JumpHopActionRequest,
|
||||
JumpHopActionResponse, JumpHopActionType, JumpHopCharacterAsset, JumpHopDifficulty,
|
||||
JumpHopDraftResponse, JumpHopGalleryCardResponse,
|
||||
JumpHopGalleryDetailResponse, JumpHopGalleryResponse, JumpHopGenerationStatus,
|
||||
JumpHopJumpRequest, JumpHopJumpResponse, JumpHopJumpResult, JumpHopLastJump, JumpHopPath,
|
||||
JumpHopPlatform, JumpHopRestartRunRequest, JumpHopRunResponse, JumpHopRunStatus,
|
||||
@@ -112,6 +115,7 @@ pub use bark_battle::{
|
||||
pub mod big_fish;
|
||||
pub mod combat;
|
||||
pub mod custom_world;
|
||||
pub mod editor_project;
|
||||
pub mod inventory;
|
||||
pub mod jump_hop;
|
||||
pub mod match3d;
|
||||
|
||||
@@ -8,6 +8,7 @@ mod big_fish;
|
||||
mod combat;
|
||||
mod common;
|
||||
mod custom_world;
|
||||
mod editor_project;
|
||||
mod inventory;
|
||||
mod jump_hop;
|
||||
mod match3d;
|
||||
@@ -39,6 +40,11 @@ pub use self::combat::{
|
||||
BarkBattleDraftConfigRecord, BarkBattleRunRecord, BarkBattleRuntimeConfigRecord,
|
||||
ResolveCombatActionRecord,
|
||||
};
|
||||
pub use self::editor_project::{
|
||||
EditorCanvasViewportRecord, EditorProjectCreateRecordInput, EditorProjectGetRecordInput,
|
||||
EditorProjectLayoutSaveRecordInput, EditorProjectRecord,
|
||||
EditorProjectResourceCreateRecordInput, EditorProjectResourceRecord,
|
||||
};
|
||||
pub use self::common::{
|
||||
BigFishAgentMessageRecord, BigFishAnchorItemRecord, BigFishAnchorPackRecord,
|
||||
BigFishBackgroundBlueprintRecord, BigFishDraftCompileRecordInput,
|
||||
@@ -178,6 +184,10 @@ pub(crate) use self::custom_world::{
|
||||
parse_rpg_agent_operation_status_record, parse_rpg_agent_operation_type_record,
|
||||
parse_rpg_agent_stage_record,
|
||||
};
|
||||
pub(crate) use self::editor_project::{
|
||||
map_editor_project_optional_procedure_result, map_editor_project_required_procedure_result,
|
||||
map_editor_project_resource_procedure_result,
|
||||
};
|
||||
pub(crate) use self::inventory::{
|
||||
map_runtime_inventory_state_procedure_result, map_runtime_item_reward_item_snapshot,
|
||||
map_runtime_item_reward_item_snapshot_back,
|
||||
|
||||
226
server-rs/crates/spacetime-client/src/mapper/editor_project.rs
Normal file
226
server-rs/crates/spacetime-client/src/mapper/editor_project.rs
Normal file
@@ -0,0 +1,226 @@
|
||||
use super::*;
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)]
|
||||
pub struct EditorCanvasViewportRecord {
|
||||
pub x: f64,
|
||||
pub y: f64,
|
||||
pub scale: f64,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, serde::Serialize, serde::Deserialize)]
|
||||
pub struct EditorProjectRecord {
|
||||
pub project_id: String,
|
||||
pub owner_user_id: String,
|
||||
pub title: String,
|
||||
pub viewport: EditorCanvasViewportRecord,
|
||||
pub layers: serde_json::Value,
|
||||
pub resources: Vec<EditorProjectResourceRecord>,
|
||||
pub created_at: String,
|
||||
pub updated_at: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
|
||||
pub struct EditorProjectResourceRecord {
|
||||
pub resource_id: String,
|
||||
pub project_id: String,
|
||||
pub asset_object_id: Option<String>,
|
||||
pub image_src: String,
|
||||
pub object_key: Option<String>,
|
||||
pub width: u32,
|
||||
pub height: u32,
|
||||
pub source_type: String,
|
||||
pub prompt: Option<String>,
|
||||
pub actual_prompt: Option<String>,
|
||||
pub model: Option<String>,
|
||||
pub provider: Option<String>,
|
||||
pub task_id: Option<String>,
|
||||
pub source_resource_id: Option<String>,
|
||||
pub created_at: String,
|
||||
pub updated_at: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub struct EditorProjectCreateRecordInput {
|
||||
pub project_id: String,
|
||||
pub owner_user_id: String,
|
||||
pub title: String,
|
||||
pub now_micros: i64,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub struct EditorProjectGetRecordInput {
|
||||
pub project_id: String,
|
||||
pub owner_user_id: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub struct EditorProjectLayoutSaveRecordInput {
|
||||
pub project_id: String,
|
||||
pub owner_user_id: String,
|
||||
pub viewport: EditorCanvasViewportRecord,
|
||||
pub layers_json: String,
|
||||
pub updated_at_micros: i64,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub struct EditorProjectResourceCreateRecordInput {
|
||||
pub resource_id: String,
|
||||
pub project_id: String,
|
||||
pub owner_user_id: String,
|
||||
pub asset_object_id: Option<String>,
|
||||
pub image_src: String,
|
||||
pub object_key: Option<String>,
|
||||
pub width: u32,
|
||||
pub height: u32,
|
||||
pub source_type: String,
|
||||
pub prompt: Option<String>,
|
||||
pub actual_prompt: Option<String>,
|
||||
pub model: Option<String>,
|
||||
pub provider: Option<String>,
|
||||
pub task_id: Option<String>,
|
||||
pub source_resource_id: Option<String>,
|
||||
pub updated_at_micros: i64,
|
||||
}
|
||||
|
||||
impl From<EditorProjectCreateRecordInput> for crate::module_bindings::EditorProjectCreateInput {
|
||||
fn from(input: EditorProjectCreateRecordInput) -> Self {
|
||||
Self {
|
||||
project_id: input.project_id,
|
||||
owner_user_id: input.owner_user_id,
|
||||
title: input.title,
|
||||
now_micros: input.now_micros,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<EditorProjectGetRecordInput> for crate::module_bindings::EditorProjectGetInput {
|
||||
fn from(input: EditorProjectGetRecordInput) -> Self {
|
||||
Self {
|
||||
project_id: input.project_id,
|
||||
owner_user_id: input.owner_user_id,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<EditorProjectLayoutSaveRecordInput>
|
||||
for crate::module_bindings::EditorProjectLayoutSaveInput
|
||||
{
|
||||
fn from(input: EditorProjectLayoutSaveRecordInput) -> Self {
|
||||
Self {
|
||||
project_id: input.project_id,
|
||||
owner_user_id: input.owner_user_id,
|
||||
viewport: crate::module_bindings::EditorProjectViewportSnapshot {
|
||||
x: input.viewport.x,
|
||||
y: input.viewport.y,
|
||||
scale: input.viewport.scale,
|
||||
},
|
||||
layers_json: input.layers_json,
|
||||
updated_at_micros: input.updated_at_micros,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<EditorProjectResourceCreateRecordInput>
|
||||
for crate::module_bindings::EditorProjectResourceCreateInput
|
||||
{
|
||||
fn from(input: EditorProjectResourceCreateRecordInput) -> Self {
|
||||
Self {
|
||||
resource_id: input.resource_id,
|
||||
project_id: input.project_id,
|
||||
owner_user_id: input.owner_user_id,
|
||||
asset_object_id: input.asset_object_id,
|
||||
image_src: input.image_src,
|
||||
object_key: input.object_key,
|
||||
width: input.width,
|
||||
height: input.height,
|
||||
source_type: input.source_type,
|
||||
prompt: input.prompt,
|
||||
actual_prompt: input.actual_prompt,
|
||||
model: input.model,
|
||||
provider: input.provider,
|
||||
task_id: input.task_id,
|
||||
source_resource_id: input.source_resource_id,
|
||||
updated_at_micros: input.updated_at_micros,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn map_editor_project_optional_procedure_result(
|
||||
result: EditorProjectProcedureResult,
|
||||
) -> Result<Option<EditorProjectRecord>, SpacetimeClientError> {
|
||||
if !result.ok {
|
||||
return Err(SpacetimeClientError::procedure_failed(result.error_message));
|
||||
}
|
||||
|
||||
result.project.map(map_editor_project_snapshot).transpose()
|
||||
}
|
||||
|
||||
pub(crate) fn map_editor_project_required_procedure_result(
|
||||
result: EditorProjectProcedureResult,
|
||||
) -> Result<EditorProjectRecord, SpacetimeClientError> {
|
||||
map_editor_project_optional_procedure_result(result)?
|
||||
.ok_or_else(|| SpacetimeClientError::missing_snapshot("图片画布工程快照"))
|
||||
}
|
||||
|
||||
pub(crate) fn map_editor_project_resource_procedure_result(
|
||||
result: EditorProjectResourceProcedureResult,
|
||||
) -> Result<EditorProjectResourceRecord, SpacetimeClientError> {
|
||||
if !result.ok {
|
||||
return Err(SpacetimeClientError::procedure_failed(result.error_message));
|
||||
}
|
||||
|
||||
result
|
||||
.resource
|
||||
.map(map_editor_project_resource_snapshot)
|
||||
.ok_or_else(|| SpacetimeClientError::missing_snapshot("图片画布资源快照"))
|
||||
}
|
||||
|
||||
fn map_editor_project_snapshot(
|
||||
snapshot: EditorProjectSnapshot,
|
||||
) -> Result<EditorProjectRecord, SpacetimeClientError> {
|
||||
let layers = serde_json::from_str(&snapshot.layers_json).map_err(|error| {
|
||||
SpacetimeClientError::validation_failed(format!("图片画布图层布局 JSON 无法解析:{error}"))
|
||||
})?;
|
||||
|
||||
Ok(EditorProjectRecord {
|
||||
project_id: snapshot.project_id,
|
||||
owner_user_id: snapshot.owner_user_id,
|
||||
title: snapshot.title,
|
||||
viewport: EditorCanvasViewportRecord {
|
||||
x: snapshot.viewport.x,
|
||||
y: snapshot.viewport.y,
|
||||
scale: snapshot.viewport.scale,
|
||||
},
|
||||
layers,
|
||||
resources: snapshot
|
||||
.resources
|
||||
.into_iter()
|
||||
.map(map_editor_project_resource_snapshot)
|
||||
.collect(),
|
||||
created_at: format_timestamp_micros(snapshot.created_at_micros),
|
||||
updated_at: format_timestamp_micros(snapshot.updated_at_micros),
|
||||
})
|
||||
}
|
||||
|
||||
fn map_editor_project_resource_snapshot(
|
||||
snapshot: EditorProjectResourceSnapshot,
|
||||
) -> EditorProjectResourceRecord {
|
||||
EditorProjectResourceRecord {
|
||||
resource_id: snapshot.resource_id,
|
||||
project_id: snapshot.project_id,
|
||||
asset_object_id: snapshot.asset_object_id,
|
||||
image_src: snapshot.image_src,
|
||||
object_key: snapshot.object_key,
|
||||
width: snapshot.width,
|
||||
height: snapshot.height,
|
||||
source_type: snapshot.source_type,
|
||||
prompt: snapshot.prompt,
|
||||
actual_prompt: snapshot.actual_prompt,
|
||||
model: snapshot.model,
|
||||
provider: snapshot.provider,
|
||||
task_id: snapshot.task_id,
|
||||
source_resource_id: snapshot.source_resource_id,
|
||||
created_at: format_timestamp_micros(snapshot.created_at_micros),
|
||||
updated_at: format_timestamp_micros(snapshot.updated_at_micros),
|
||||
}
|
||||
}
|
||||
@@ -234,6 +234,8 @@ pub mod create_battle_state_and_return_procedure;
|
||||
pub mod create_battle_state_reducer;
|
||||
pub mod create_big_fish_session_procedure;
|
||||
pub mod create_custom_world_agent_session_procedure;
|
||||
pub mod create_editor_project_and_return_procedure;
|
||||
pub mod create_editor_project_resource_and_return_procedure;
|
||||
pub mod create_jump_hop_agent_session_procedure;
|
||||
pub mod create_match_3_d_agent_session_procedure;
|
||||
pub mod create_profile_recharge_order_and_return_procedure;
|
||||
@@ -343,6 +345,20 @@ pub mod delete_visual_novel_work_procedure;
|
||||
pub mod delete_wooden_fish_work_procedure;
|
||||
pub mod drag_puzzle_piece_or_group_procedure;
|
||||
pub mod drop_square_hole_shape_procedure;
|
||||
pub mod editor_project_create_input_type;
|
||||
pub mod editor_project_get_input_type;
|
||||
pub mod editor_project_get_recent_input_type;
|
||||
pub mod editor_project_layout_save_input_type;
|
||||
pub mod editor_project_procedure_result_type;
|
||||
pub mod editor_project_resource_create_input_type;
|
||||
pub mod editor_project_resource_procedure_result_type;
|
||||
pub mod editor_project_resource_snapshot_type;
|
||||
pub mod editor_project_resource_table;
|
||||
pub mod editor_project_resource_type;
|
||||
pub mod editor_project_snapshot_type;
|
||||
pub mod editor_project_table;
|
||||
pub mod editor_project_type;
|
||||
pub mod editor_project_viewport_snapshot_type;
|
||||
pub mod ensure_analytics_date_dimension_for_date_reducer;
|
||||
pub mod equip_inventory_item_input_type;
|
||||
pub mod execute_custom_world_agent_action_procedure;
|
||||
@@ -373,6 +389,7 @@ pub mod get_custom_world_agent_session_procedure;
|
||||
pub mod get_custom_world_gallery_detail_by_code_procedure;
|
||||
pub mod get_custom_world_gallery_detail_procedure;
|
||||
pub mod get_custom_world_library_detail_procedure;
|
||||
pub mod get_editor_project_and_return_procedure;
|
||||
pub mod get_jump_hop_agent_session_procedure;
|
||||
pub mod get_jump_hop_leaderboard_procedure;
|
||||
pub mod get_jump_hop_run_procedure;
|
||||
@@ -394,6 +411,7 @@ pub mod get_puzzle_clear_work_profile_procedure;
|
||||
pub mod get_puzzle_gallery_detail_procedure;
|
||||
pub mod get_puzzle_run_procedure;
|
||||
pub mod get_puzzle_work_detail_procedure;
|
||||
pub mod get_recent_editor_project_and_return_procedure;
|
||||
pub mod get_runtime_inventory_state_procedure;
|
||||
pub mod get_runtime_setting_or_default_procedure;
|
||||
pub mod get_runtime_snapshot_procedure;
|
||||
@@ -913,6 +931,7 @@ pub mod runtime_tracking_event_batch_procedure_result_type;
|
||||
pub mod runtime_tracking_event_input_type;
|
||||
pub mod runtime_tracking_event_procedure_result_type;
|
||||
pub mod runtime_tracking_scope_kind_type;
|
||||
pub mod save_editor_project_layout_and_return_procedure;
|
||||
pub mod save_puzzle_form_draft_procedure;
|
||||
pub mod save_puzzle_generated_images_procedure;
|
||||
pub mod save_puzzle_ui_background_procedure;
|
||||
@@ -1349,6 +1368,8 @@ pub use create_battle_state_and_return_procedure::create_battle_state_and_return
|
||||
pub use create_battle_state_reducer::create_battle_state;
|
||||
pub use create_big_fish_session_procedure::create_big_fish_session;
|
||||
pub use create_custom_world_agent_session_procedure::create_custom_world_agent_session;
|
||||
pub use create_editor_project_and_return_procedure::create_editor_project_and_return;
|
||||
pub use create_editor_project_resource_and_return_procedure::create_editor_project_resource_and_return;
|
||||
pub use create_jump_hop_agent_session_procedure::create_jump_hop_agent_session;
|
||||
pub use create_match_3_d_agent_session_procedure::create_match_3_d_agent_session;
|
||||
pub use create_profile_recharge_order_and_return_procedure::create_profile_recharge_order_and_return;
|
||||
@@ -1458,6 +1479,20 @@ pub use delete_visual_novel_work_procedure::delete_visual_novel_work;
|
||||
pub use delete_wooden_fish_work_procedure::delete_wooden_fish_work;
|
||||
pub use drag_puzzle_piece_or_group_procedure::drag_puzzle_piece_or_group;
|
||||
pub use drop_square_hole_shape_procedure::drop_square_hole_shape;
|
||||
pub use editor_project_create_input_type::EditorProjectCreateInput;
|
||||
pub use editor_project_get_input_type::EditorProjectGetInput;
|
||||
pub use editor_project_get_recent_input_type::EditorProjectGetRecentInput;
|
||||
pub use editor_project_layout_save_input_type::EditorProjectLayoutSaveInput;
|
||||
pub use editor_project_procedure_result_type::EditorProjectProcedureResult;
|
||||
pub use editor_project_resource_create_input_type::EditorProjectResourceCreateInput;
|
||||
pub use editor_project_resource_procedure_result_type::EditorProjectResourceProcedureResult;
|
||||
pub use editor_project_resource_snapshot_type::EditorProjectResourceSnapshot;
|
||||
pub use editor_project_resource_table::*;
|
||||
pub use editor_project_resource_type::EditorProjectResource;
|
||||
pub use editor_project_snapshot_type::EditorProjectSnapshot;
|
||||
pub use editor_project_table::*;
|
||||
pub use editor_project_type::EditorProject;
|
||||
pub use editor_project_viewport_snapshot_type::EditorProjectViewportSnapshot;
|
||||
pub use ensure_analytics_date_dimension_for_date_reducer::ensure_analytics_date_dimension_for_date;
|
||||
pub use equip_inventory_item_input_type::EquipInventoryItemInput;
|
||||
pub use execute_custom_world_agent_action_procedure::execute_custom_world_agent_action;
|
||||
@@ -1488,6 +1523,7 @@ pub use get_custom_world_agent_session_procedure::get_custom_world_agent_session
|
||||
pub use get_custom_world_gallery_detail_by_code_procedure::get_custom_world_gallery_detail_by_code;
|
||||
pub use get_custom_world_gallery_detail_procedure::get_custom_world_gallery_detail;
|
||||
pub use get_custom_world_library_detail_procedure::get_custom_world_library_detail;
|
||||
pub use get_editor_project_and_return_procedure::get_editor_project_and_return;
|
||||
pub use get_jump_hop_agent_session_procedure::get_jump_hop_agent_session;
|
||||
pub use get_jump_hop_leaderboard_procedure::get_jump_hop_leaderboard;
|
||||
pub use get_jump_hop_run_procedure::get_jump_hop_run;
|
||||
@@ -1509,6 +1545,7 @@ pub use get_puzzle_clear_work_profile_procedure::get_puzzle_clear_work_profile;
|
||||
pub use get_puzzle_gallery_detail_procedure::get_puzzle_gallery_detail;
|
||||
pub use get_puzzle_run_procedure::get_puzzle_run;
|
||||
pub use get_puzzle_work_detail_procedure::get_puzzle_work_detail;
|
||||
pub use get_recent_editor_project_and_return_procedure::get_recent_editor_project_and_return;
|
||||
pub use get_runtime_inventory_state_procedure::get_runtime_inventory_state;
|
||||
pub use get_runtime_setting_or_default_procedure::get_runtime_setting_or_default;
|
||||
pub use get_runtime_snapshot_procedure::get_runtime_snapshot;
|
||||
@@ -2028,6 +2065,7 @@ pub use runtime_tracking_event_batch_procedure_result_type::RuntimeTrackingEvent
|
||||
pub use runtime_tracking_event_input_type::RuntimeTrackingEventInput;
|
||||
pub use runtime_tracking_event_procedure_result_type::RuntimeTrackingEventProcedureResult;
|
||||
pub use runtime_tracking_scope_kind_type::RuntimeTrackingScopeKind;
|
||||
pub use save_editor_project_layout_and_return_procedure::save_editor_project_layout_and_return;
|
||||
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;
|
||||
@@ -2547,6 +2585,8 @@ pub struct DbUpdate {
|
||||
custom_world_session: __sdk::TableUpdate<CustomWorldSession>,
|
||||
database_migration_import_chunk: __sdk::TableUpdate<DatabaseMigrationImportChunk>,
|
||||
database_migration_operator: __sdk::TableUpdate<DatabaseMigrationOperator>,
|
||||
editor_project: __sdk::TableUpdate<EditorProject>,
|
||||
editor_project_resource: __sdk::TableUpdate<EditorProjectResource>,
|
||||
inventory_slot: __sdk::TableUpdate<InventorySlot>,
|
||||
jump_hop_agent_session: __sdk::TableUpdate<JumpHopAgentSessionRow>,
|
||||
jump_hop_event: __sdk::TableUpdate<JumpHopEventRow>,
|
||||
@@ -2759,6 +2799,12 @@ impl TryFrom<__ws::v2::TransactionUpdate> for DbUpdate {
|
||||
"database_migration_operator" => db_update.database_migration_operator.append(
|
||||
database_migration_operator_table::parse_table_update(table_update)?,
|
||||
),
|
||||
"editor_project" => db_update
|
||||
.editor_project
|
||||
.append(editor_project_table::parse_table_update(table_update)?),
|
||||
"editor_project_resource" => db_update.editor_project_resource.append(
|
||||
editor_project_resource_table::parse_table_update(table_update)?,
|
||||
),
|
||||
"inventory_slot" => db_update
|
||||
.inventory_slot
|
||||
.append(inventory_slot_table::parse_table_update(table_update)?),
|
||||
@@ -3219,6 +3265,15 @@ impl __sdk::DbUpdate for DbUpdate {
|
||||
&self.database_migration_operator,
|
||||
)
|
||||
.with_updates_by_pk(|row| &row.operator_identity);
|
||||
diff.editor_project = cache
|
||||
.apply_diff_to_table::<EditorProject>("editor_project", &self.editor_project)
|
||||
.with_updates_by_pk(|row| &row.project_id);
|
||||
diff.editor_project_resource = cache
|
||||
.apply_diff_to_table::<EditorProjectResource>(
|
||||
"editor_project_resource",
|
||||
&self.editor_project_resource,
|
||||
)
|
||||
.with_updates_by_pk(|row| &row.resource_id);
|
||||
diff.inventory_slot = cache
|
||||
.apply_diff_to_table::<InventorySlot>("inventory_slot", &self.inventory_slot)
|
||||
.with_updates_by_pk(|row| &row.slot_id);
|
||||
@@ -3746,6 +3801,12 @@ impl __sdk::DbUpdate for DbUpdate {
|
||||
"database_migration_operator" => db_update
|
||||
.database_migration_operator
|
||||
.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"editor_project" => db_update
|
||||
.editor_project
|
||||
.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"editor_project_resource" => db_update
|
||||
.editor_project_resource
|
||||
.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"inventory_slot" => db_update
|
||||
.inventory_slot
|
||||
.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
@@ -4113,6 +4174,12 @@ impl __sdk::DbUpdate for DbUpdate {
|
||||
"database_migration_operator" => db_update
|
||||
.database_migration_operator
|
||||
.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"editor_project" => db_update
|
||||
.editor_project
|
||||
.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"editor_project_resource" => db_update
|
||||
.editor_project_resource
|
||||
.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"inventory_slot" => db_update
|
||||
.inventory_slot
|
||||
.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
@@ -4406,6 +4473,8 @@ pub struct AppliedDiff<'r> {
|
||||
custom_world_session: __sdk::TableAppliedDiff<'r, CustomWorldSession>,
|
||||
database_migration_import_chunk: __sdk::TableAppliedDiff<'r, DatabaseMigrationImportChunk>,
|
||||
database_migration_operator: __sdk::TableAppliedDiff<'r, DatabaseMigrationOperator>,
|
||||
editor_project: __sdk::TableAppliedDiff<'r, EditorProject>,
|
||||
editor_project_resource: __sdk::TableAppliedDiff<'r, EditorProjectResource>,
|
||||
inventory_slot: __sdk::TableAppliedDiff<'r, InventorySlot>,
|
||||
jump_hop_agent_session: __sdk::TableAppliedDiff<'r, JumpHopAgentSessionRow>,
|
||||
jump_hop_event: __sdk::TableAppliedDiff<'r, JumpHopEventRow>,
|
||||
@@ -4686,6 +4755,16 @@ impl<'r> __sdk::AppliedDiff<'r> for AppliedDiff<'r> {
|
||||
&self.database_migration_operator,
|
||||
event,
|
||||
);
|
||||
callbacks.invoke_table_row_callbacks::<EditorProject>(
|
||||
"editor_project",
|
||||
&self.editor_project,
|
||||
event,
|
||||
);
|
||||
callbacks.invoke_table_row_callbacks::<EditorProjectResource>(
|
||||
"editor_project_resource",
|
||||
&self.editor_project_resource,
|
||||
event,
|
||||
);
|
||||
callbacks.invoke_table_row_callbacks::<InventorySlot>(
|
||||
"inventory_slot",
|
||||
&self.inventory_slot,
|
||||
@@ -5768,6 +5847,8 @@ impl __sdk::SpacetimeModule for RemoteModule {
|
||||
custom_world_session_table::register_table(client_cache);
|
||||
database_migration_import_chunk_table::register_table(client_cache);
|
||||
database_migration_operator_table::register_table(client_cache);
|
||||
editor_project_table::register_table(client_cache);
|
||||
editor_project_resource_table::register_table(client_cache);
|
||||
inventory_slot_table::register_table(client_cache);
|
||||
jump_hop_agent_session_table::register_table(client_cache);
|
||||
jump_hop_event_table::register_table(client_cache);
|
||||
@@ -5888,6 +5969,8 @@ impl __sdk::SpacetimeModule for RemoteModule {
|
||||
"custom_world_session",
|
||||
"database_migration_import_chunk",
|
||||
"database_migration_operator",
|
||||
"editor_project",
|
||||
"editor_project_resource",
|
||||
"inventory_slot",
|
||||
"jump_hop_agent_session",
|
||||
"jump_hop_event",
|
||||
|
||||
@@ -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::editor_project_create_input_type::EditorProjectCreateInput;
|
||||
use super::editor_project_procedure_result_type::EditorProjectProcedureResult;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
struct CreateEditorProjectAndReturnArgs {
|
||||
pub input: EditorProjectCreateInput,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for CreateEditorProjectAndReturnArgs {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the procedure `create_editor_project_and_return`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteProcedures`].
|
||||
pub trait create_editor_project_and_return {
|
||||
fn create_editor_project_and_return(&self, input: EditorProjectCreateInput) {
|
||||
self.create_editor_project_and_return_then(input, |_, _| {});
|
||||
}
|
||||
|
||||
fn create_editor_project_and_return_then(
|
||||
&self,
|
||||
input: EditorProjectCreateInput,
|
||||
|
||||
__callback: impl FnOnce(
|
||||
&super::ProcedureEventContext,
|
||||
Result<EditorProjectProcedureResult, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
);
|
||||
}
|
||||
|
||||
impl create_editor_project_and_return for super::RemoteProcedures {
|
||||
fn create_editor_project_and_return_then(
|
||||
&self,
|
||||
input: EditorProjectCreateInput,
|
||||
|
||||
__callback: impl FnOnce(
|
||||
&super::ProcedureEventContext,
|
||||
Result<EditorProjectProcedureResult, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
) {
|
||||
self.imp
|
||||
.invoke_procedure_with_callback::<_, EditorProjectProcedureResult>(
|
||||
"create_editor_project_and_return",
|
||||
CreateEditorProjectAndReturnArgs { input },
|
||||
__callback,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -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::editor_project_resource_create_input_type::EditorProjectResourceCreateInput;
|
||||
use super::editor_project_resource_procedure_result_type::EditorProjectResourceProcedureResult;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
struct CreateEditorProjectResourceAndReturnArgs {
|
||||
pub input: EditorProjectResourceCreateInput,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for CreateEditorProjectResourceAndReturnArgs {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the procedure `create_editor_project_resource_and_return`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteProcedures`].
|
||||
pub trait create_editor_project_resource_and_return {
|
||||
fn create_editor_project_resource_and_return(&self, input: EditorProjectResourceCreateInput) {
|
||||
self.create_editor_project_resource_and_return_then(input, |_, _| {});
|
||||
}
|
||||
|
||||
fn create_editor_project_resource_and_return_then(
|
||||
&self,
|
||||
input: EditorProjectResourceCreateInput,
|
||||
|
||||
__callback: impl FnOnce(
|
||||
&super::ProcedureEventContext,
|
||||
Result<EditorProjectResourceProcedureResult, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
);
|
||||
}
|
||||
|
||||
impl create_editor_project_resource_and_return for super::RemoteProcedures {
|
||||
fn create_editor_project_resource_and_return_then(
|
||||
&self,
|
||||
input: EditorProjectResourceCreateInput,
|
||||
|
||||
__callback: impl FnOnce(
|
||||
&super::ProcedureEventContext,
|
||||
Result<EditorProjectResourceProcedureResult, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
) {
|
||||
self.imp
|
||||
.invoke_procedure_with_callback::<_, EditorProjectResourceProcedureResult>(
|
||||
"create_editor_project_resource_and_return",
|
||||
CreateEditorProjectResourceAndReturnArgs { input },
|
||||
__callback,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -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)]
|
||||
pub struct EditorProjectCreateInput {
|
||||
pub project_id: String,
|
||||
pub owner_user_id: String,
|
||||
pub title: String,
|
||||
pub now_micros: i64,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for EditorProjectCreateInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
@@ -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 EditorProjectGetInput {
|
||||
pub project_id: String,
|
||||
pub owner_user_id: String,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for EditorProjectGetInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct EditorProjectGetRecentInput {
|
||||
pub owner_user_id: String,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for EditorProjectGetRecentInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
@@ -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};
|
||||
|
||||
use super::editor_project_viewport_snapshot_type::EditorProjectViewportSnapshot;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct EditorProjectLayoutSaveInput {
|
||||
pub project_id: String,
|
||||
pub owner_user_id: String,
|
||||
pub viewport: EditorProjectViewportSnapshot,
|
||||
pub layers_json: String,
|
||||
pub updated_at_micros: i64,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for EditorProjectLayoutSaveInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
@@ -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::editor_project_snapshot_type::EditorProjectSnapshot;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct EditorProjectProcedureResult {
|
||||
pub ok: bool,
|
||||
pub project: Option<EditorProjectSnapshot>,
|
||||
pub error_message: Option<String>,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for EditorProjectProcedureResult {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
// 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 EditorProjectResourceCreateInput {
|
||||
pub resource_id: String,
|
||||
pub project_id: String,
|
||||
pub owner_user_id: String,
|
||||
pub asset_object_id: Option<String>,
|
||||
pub image_src: String,
|
||||
pub object_key: Option<String>,
|
||||
pub width: u32,
|
||||
pub height: u32,
|
||||
pub source_type: String,
|
||||
pub prompt: Option<String>,
|
||||
pub actual_prompt: Option<String>,
|
||||
pub model: Option<String>,
|
||||
pub provider: Option<String>,
|
||||
pub task_id: Option<String>,
|
||||
pub source_resource_id: Option<String>,
|
||||
pub updated_at_micros: i64,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for EditorProjectResourceCreateInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
@@ -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::editor_project_resource_snapshot_type::EditorProjectResourceSnapshot;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct EditorProjectResourceProcedureResult {
|
||||
pub ok: bool,
|
||||
pub resource: Option<EditorProjectResourceSnapshot>,
|
||||
pub error_message: Option<String>,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for EditorProjectResourceProcedureResult {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
// 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 EditorProjectResourceSnapshot {
|
||||
pub resource_id: String,
|
||||
pub project_id: String,
|
||||
pub asset_object_id: Option<String>,
|
||||
pub image_src: String,
|
||||
pub object_key: Option<String>,
|
||||
pub width: u32,
|
||||
pub height: u32,
|
||||
pub source_type: String,
|
||||
pub prompt: Option<String>,
|
||||
pub actual_prompt: Option<String>,
|
||||
pub model: Option<String>,
|
||||
pub provider: Option<String>,
|
||||
pub task_id: Option<String>,
|
||||
pub source_resource_id: Option<String>,
|
||||
pub created_at_micros: i64,
|
||||
pub updated_at_micros: i64,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for EditorProjectResourceSnapshot {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
@@ -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::editor_project_resource_type::EditorProjectResource;
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
/// Table handle for the table `editor_project_resource`.
|
||||
///
|
||||
/// Obtain a handle from the [`EditorProjectResourceTableAccess::editor_project_resource`] method on [`super::RemoteTables`],
|
||||
/// like `ctx.db.editor_project_resource()`.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.editor_project_resource().on_insert(...)`.
|
||||
pub struct EditorProjectResourceTableHandle<'ctx> {
|
||||
imp: __sdk::TableHandle<EditorProjectResource>,
|
||||
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the table `editor_project_resource`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteTables`].
|
||||
pub trait EditorProjectResourceTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Obtain a [`EditorProjectResourceTableHandle`], which mediates access to the table `editor_project_resource`.
|
||||
fn editor_project_resource(&self) -> EditorProjectResourceTableHandle<'_>;
|
||||
}
|
||||
|
||||
impl EditorProjectResourceTableAccess for super::RemoteTables {
|
||||
fn editor_project_resource(&self) -> EditorProjectResourceTableHandle<'_> {
|
||||
EditorProjectResourceTableHandle {
|
||||
imp: self
|
||||
.imp
|
||||
.get_table::<EditorProjectResource>("editor_project_resource"),
|
||||
ctx: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct EditorProjectResourceInsertCallbackId(__sdk::CallbackId);
|
||||
pub struct EditorProjectResourceDeleteCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::Table for EditorProjectResourceTableHandle<'ctx> {
|
||||
type Row = EditorProjectResource;
|
||||
type EventContext = super::EventContext;
|
||||
|
||||
fn count(&self) -> u64 {
|
||||
self.imp.count()
|
||||
}
|
||||
fn iter(&self) -> impl Iterator<Item = EditorProjectResource> + '_ {
|
||||
self.imp.iter()
|
||||
}
|
||||
|
||||
type InsertCallbackId = EditorProjectResourceInsertCallbackId;
|
||||
|
||||
fn on_insert(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> EditorProjectResourceInsertCallbackId {
|
||||
EditorProjectResourceInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_insert(&self, callback: EditorProjectResourceInsertCallbackId) {
|
||||
self.imp.remove_on_insert(callback.0)
|
||||
}
|
||||
|
||||
type DeleteCallbackId = EditorProjectResourceDeleteCallbackId;
|
||||
|
||||
fn on_delete(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> EditorProjectResourceDeleteCallbackId {
|
||||
EditorProjectResourceDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_delete(&self, callback: EditorProjectResourceDeleteCallbackId) {
|
||||
self.imp.remove_on_delete(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct EditorProjectResourceUpdateCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::TableWithPrimaryKey for EditorProjectResourceTableHandle<'ctx> {
|
||||
type UpdateCallbackId = EditorProjectResourceUpdateCallbackId;
|
||||
|
||||
fn on_update(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||
) -> EditorProjectResourceUpdateCallbackId {
|
||||
EditorProjectResourceUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_update(&self, callback: EditorProjectResourceUpdateCallbackId) {
|
||||
self.imp.remove_on_update(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
/// Access to the `resource_id` unique index on the table `editor_project_resource`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`EditorProjectResourceResourceIdUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.editor_project_resource().resource_id().find(...)`.
|
||||
pub struct EditorProjectResourceResourceIdUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<EditorProjectResource, String>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
impl<'ctx> EditorProjectResourceTableHandle<'ctx> {
|
||||
/// Get a handle on the `resource_id` unique index on the table `editor_project_resource`.
|
||||
pub fn resource_id(&self) -> EditorProjectResourceResourceIdUnique<'ctx> {
|
||||
EditorProjectResourceResourceIdUnique {
|
||||
imp: self.imp.get_unique_constraint::<String>("resource_id"),
|
||||
phantom: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> EditorProjectResourceResourceIdUnique<'ctx> {
|
||||
/// Find the subscribed row whose `resource_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<EditorProjectResource> {
|
||||
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::<EditorProjectResource>("editor_project_resource");
|
||||
_table.add_unique_constraint::<String>("resource_id", |row| &row.resource_id);
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub(super) fn parse_table_update(
|
||||
raw_updates: __ws::v2::TableUpdate,
|
||||
) -> __sdk::Result<__sdk::TableUpdate<EditorProjectResource>> {
|
||||
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||
__sdk::InternalError::failed_parse("TableUpdate<EditorProjectResource>", "TableUpdate")
|
||||
.with_cause(e)
|
||||
.into()
|
||||
})
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `EditorProjectResource`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait editor_project_resourceQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `EditorProjectResource`.
|
||||
fn editor_project_resource(&self) -> __sdk::__query_builder::Table<EditorProjectResource>;
|
||||
}
|
||||
|
||||
impl editor_project_resourceQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn editor_project_resource(&self) -> __sdk::__query_builder::Table<EditorProjectResource> {
|
||||
__sdk::__query_builder::Table::new("editor_project_resource")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
// 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 EditorProjectResource {
|
||||
pub resource_id: String,
|
||||
pub project_id: String,
|
||||
pub owner_user_id: String,
|
||||
pub asset_object_id: Option<String>,
|
||||
pub image_src: String,
|
||||
pub object_key: Option<String>,
|
||||
pub width: u32,
|
||||
pub height: u32,
|
||||
pub source_type: String,
|
||||
pub prompt: Option<String>,
|
||||
pub actual_prompt: Option<String>,
|
||||
pub model: Option<String>,
|
||||
pub provider: Option<String>,
|
||||
pub task_id: Option<String>,
|
||||
pub source_resource_id: Option<String>,
|
||||
pub created_at: __sdk::Timestamp,
|
||||
pub updated_at: __sdk::Timestamp,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for EditorProjectResource {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
/// Column accessor struct for the table `EditorProjectResource`.
|
||||
///
|
||||
/// Provides typed access to columns for query building.
|
||||
pub struct EditorProjectResourceCols {
|
||||
pub resource_id: __sdk::__query_builder::Col<EditorProjectResource, String>,
|
||||
pub project_id: __sdk::__query_builder::Col<EditorProjectResource, String>,
|
||||
pub owner_user_id: __sdk::__query_builder::Col<EditorProjectResource, String>,
|
||||
pub asset_object_id: __sdk::__query_builder::Col<EditorProjectResource, Option<String>>,
|
||||
pub image_src: __sdk::__query_builder::Col<EditorProjectResource, String>,
|
||||
pub object_key: __sdk::__query_builder::Col<EditorProjectResource, Option<String>>,
|
||||
pub width: __sdk::__query_builder::Col<EditorProjectResource, u32>,
|
||||
pub height: __sdk::__query_builder::Col<EditorProjectResource, u32>,
|
||||
pub source_type: __sdk::__query_builder::Col<EditorProjectResource, String>,
|
||||
pub prompt: __sdk::__query_builder::Col<EditorProjectResource, Option<String>>,
|
||||
pub actual_prompt: __sdk::__query_builder::Col<EditorProjectResource, Option<String>>,
|
||||
pub model: __sdk::__query_builder::Col<EditorProjectResource, Option<String>>,
|
||||
pub provider: __sdk::__query_builder::Col<EditorProjectResource, Option<String>>,
|
||||
pub task_id: __sdk::__query_builder::Col<EditorProjectResource, Option<String>>,
|
||||
pub source_resource_id: __sdk::__query_builder::Col<EditorProjectResource, Option<String>>,
|
||||
pub created_at: __sdk::__query_builder::Col<EditorProjectResource, __sdk::Timestamp>,
|
||||
pub updated_at: __sdk::__query_builder::Col<EditorProjectResource, __sdk::Timestamp>,
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::HasCols for EditorProjectResource {
|
||||
type Cols = EditorProjectResourceCols;
|
||||
fn cols(table_name: &'static str) -> Self::Cols {
|
||||
EditorProjectResourceCols {
|
||||
resource_id: __sdk::__query_builder::Col::new(table_name, "resource_id"),
|
||||
project_id: __sdk::__query_builder::Col::new(table_name, "project_id"),
|
||||
owner_user_id: __sdk::__query_builder::Col::new(table_name, "owner_user_id"),
|
||||
asset_object_id: __sdk::__query_builder::Col::new(table_name, "asset_object_id"),
|
||||
image_src: __sdk::__query_builder::Col::new(table_name, "image_src"),
|
||||
object_key: __sdk::__query_builder::Col::new(table_name, "object_key"),
|
||||
width: __sdk::__query_builder::Col::new(table_name, "width"),
|
||||
height: __sdk::__query_builder::Col::new(table_name, "height"),
|
||||
source_type: __sdk::__query_builder::Col::new(table_name, "source_type"),
|
||||
prompt: __sdk::__query_builder::Col::new(table_name, "prompt"),
|
||||
actual_prompt: __sdk::__query_builder::Col::new(table_name, "actual_prompt"),
|
||||
model: __sdk::__query_builder::Col::new(table_name, "model"),
|
||||
provider: __sdk::__query_builder::Col::new(table_name, "provider"),
|
||||
task_id: __sdk::__query_builder::Col::new(table_name, "task_id"),
|
||||
source_resource_id: __sdk::__query_builder::Col::new(table_name, "source_resource_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 `EditorProjectResource`.
|
||||
///
|
||||
/// Provides typed access to indexed columns for query building.
|
||||
pub struct EditorProjectResourceIxCols {
|
||||
pub owner_user_id: __sdk::__query_builder::IxCol<EditorProjectResource, String>,
|
||||
pub project_id: __sdk::__query_builder::IxCol<EditorProjectResource, String>,
|
||||
pub resource_id: __sdk::__query_builder::IxCol<EditorProjectResource, String>,
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::HasIxCols for EditorProjectResource {
|
||||
type IxCols = EditorProjectResourceIxCols;
|
||||
fn ix_cols(table_name: &'static str) -> Self::IxCols {
|
||||
EditorProjectResourceIxCols {
|
||||
owner_user_id: __sdk::__query_builder::IxCol::new(table_name, "owner_user_id"),
|
||||
project_id: __sdk::__query_builder::IxCol::new(table_name, "project_id"),
|
||||
resource_id: __sdk::__query_builder::IxCol::new(table_name, "resource_id"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::CanBeLookupTable for EditorProjectResource {}
|
||||
@@ -0,0 +1,25 @@
|
||||
// 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::editor_project_resource_snapshot_type::EditorProjectResourceSnapshot;
|
||||
use super::editor_project_viewport_snapshot_type::EditorProjectViewportSnapshot;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct EditorProjectSnapshot {
|
||||
pub project_id: String,
|
||||
pub owner_user_id: String,
|
||||
pub title: String,
|
||||
pub viewport: EditorProjectViewportSnapshot,
|
||||
pub layers_json: String,
|
||||
pub resources: Vec<EditorProjectResourceSnapshot>,
|
||||
pub created_at_micros: i64,
|
||||
pub updated_at_micros: i64,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for EditorProjectSnapshot {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use super::editor_project_type::EditorProject;
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
/// Table handle for the table `editor_project`.
|
||||
///
|
||||
/// Obtain a handle from the [`EditorProjectTableAccess::editor_project`] method on [`super::RemoteTables`],
|
||||
/// like `ctx.db.editor_project()`.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.editor_project().on_insert(...)`.
|
||||
pub struct EditorProjectTableHandle<'ctx> {
|
||||
imp: __sdk::TableHandle<EditorProject>,
|
||||
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the table `editor_project`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteTables`].
|
||||
pub trait EditorProjectTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Obtain a [`EditorProjectTableHandle`], which mediates access to the table `editor_project`.
|
||||
fn editor_project(&self) -> EditorProjectTableHandle<'_>;
|
||||
}
|
||||
|
||||
impl EditorProjectTableAccess for super::RemoteTables {
|
||||
fn editor_project(&self) -> EditorProjectTableHandle<'_> {
|
||||
EditorProjectTableHandle {
|
||||
imp: self.imp.get_table::<EditorProject>("editor_project"),
|
||||
ctx: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct EditorProjectInsertCallbackId(__sdk::CallbackId);
|
||||
pub struct EditorProjectDeleteCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::Table for EditorProjectTableHandle<'ctx> {
|
||||
type Row = EditorProject;
|
||||
type EventContext = super::EventContext;
|
||||
|
||||
fn count(&self) -> u64 {
|
||||
self.imp.count()
|
||||
}
|
||||
fn iter(&self) -> impl Iterator<Item = EditorProject> + '_ {
|
||||
self.imp.iter()
|
||||
}
|
||||
|
||||
type InsertCallbackId = EditorProjectInsertCallbackId;
|
||||
|
||||
fn on_insert(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> EditorProjectInsertCallbackId {
|
||||
EditorProjectInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_insert(&self, callback: EditorProjectInsertCallbackId) {
|
||||
self.imp.remove_on_insert(callback.0)
|
||||
}
|
||||
|
||||
type DeleteCallbackId = EditorProjectDeleteCallbackId;
|
||||
|
||||
fn on_delete(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> EditorProjectDeleteCallbackId {
|
||||
EditorProjectDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_delete(&self, callback: EditorProjectDeleteCallbackId) {
|
||||
self.imp.remove_on_delete(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct EditorProjectUpdateCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::TableWithPrimaryKey for EditorProjectTableHandle<'ctx> {
|
||||
type UpdateCallbackId = EditorProjectUpdateCallbackId;
|
||||
|
||||
fn on_update(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||
) -> EditorProjectUpdateCallbackId {
|
||||
EditorProjectUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_update(&self, callback: EditorProjectUpdateCallbackId) {
|
||||
self.imp.remove_on_update(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
/// Access to the `project_id` unique index on the table `editor_project`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`EditorProjectProjectIdUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.editor_project().project_id().find(...)`.
|
||||
pub struct EditorProjectProjectIdUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<EditorProject, String>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
impl<'ctx> EditorProjectTableHandle<'ctx> {
|
||||
/// Get a handle on the `project_id` unique index on the table `editor_project`.
|
||||
pub fn project_id(&self) -> EditorProjectProjectIdUnique<'ctx> {
|
||||
EditorProjectProjectIdUnique {
|
||||
imp: self.imp.get_unique_constraint::<String>("project_id"),
|
||||
phantom: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> EditorProjectProjectIdUnique<'ctx> {
|
||||
/// Find the subscribed row whose `project_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<EditorProject> {
|
||||
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::<EditorProject>("editor_project");
|
||||
_table.add_unique_constraint::<String>("project_id", |row| &row.project_id);
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub(super) fn parse_table_update(
|
||||
raw_updates: __ws::v2::TableUpdate,
|
||||
) -> __sdk::Result<__sdk::TableUpdate<EditorProject>> {
|
||||
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||
__sdk::InternalError::failed_parse("TableUpdate<EditorProject>", "TableUpdate")
|
||||
.with_cause(e)
|
||||
.into()
|
||||
})
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `EditorProject`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait editor_projectQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `EditorProject`.
|
||||
fn editor_project(&self) -> __sdk::__query_builder::Table<EditorProject>;
|
||||
}
|
||||
|
||||
impl editor_projectQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn editor_project(&self) -> __sdk::__query_builder::Table<EditorProject> {
|
||||
__sdk::__query_builder::Table::new("editor_project")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
// 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 EditorProject {
|
||||
pub project_id: String,
|
||||
pub owner_user_id: String,
|
||||
pub title: String,
|
||||
pub viewport_x: f64,
|
||||
pub viewport_y: f64,
|
||||
pub viewport_scale: f64,
|
||||
pub layers_json: String,
|
||||
pub created_at: __sdk::Timestamp,
|
||||
pub updated_at: __sdk::Timestamp,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for EditorProject {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
/// Column accessor struct for the table `EditorProject`.
|
||||
///
|
||||
/// Provides typed access to columns for query building.
|
||||
pub struct EditorProjectCols {
|
||||
pub project_id: __sdk::__query_builder::Col<EditorProject, String>,
|
||||
pub owner_user_id: __sdk::__query_builder::Col<EditorProject, String>,
|
||||
pub title: __sdk::__query_builder::Col<EditorProject, String>,
|
||||
pub viewport_x: __sdk::__query_builder::Col<EditorProject, f64>,
|
||||
pub viewport_y: __sdk::__query_builder::Col<EditorProject, f64>,
|
||||
pub viewport_scale: __sdk::__query_builder::Col<EditorProject, f64>,
|
||||
pub layers_json: __sdk::__query_builder::Col<EditorProject, String>,
|
||||
pub created_at: __sdk::__query_builder::Col<EditorProject, __sdk::Timestamp>,
|
||||
pub updated_at: __sdk::__query_builder::Col<EditorProject, __sdk::Timestamp>,
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::HasCols for EditorProject {
|
||||
type Cols = EditorProjectCols;
|
||||
fn cols(table_name: &'static str) -> Self::Cols {
|
||||
EditorProjectCols {
|
||||
project_id: __sdk::__query_builder::Col::new(table_name, "project_id"),
|
||||
owner_user_id: __sdk::__query_builder::Col::new(table_name, "owner_user_id"),
|
||||
title: __sdk::__query_builder::Col::new(table_name, "title"),
|
||||
viewport_x: __sdk::__query_builder::Col::new(table_name, "viewport_x"),
|
||||
viewport_y: __sdk::__query_builder::Col::new(table_name, "viewport_y"),
|
||||
viewport_scale: __sdk::__query_builder::Col::new(table_name, "viewport_scale"),
|
||||
layers_json: __sdk::__query_builder::Col::new(table_name, "layers_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 `EditorProject`.
|
||||
///
|
||||
/// Provides typed access to indexed columns for query building.
|
||||
pub struct EditorProjectIxCols {
|
||||
pub owner_user_id: __sdk::__query_builder::IxCol<EditorProject, String>,
|
||||
pub project_id: __sdk::__query_builder::IxCol<EditorProject, String>,
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::HasIxCols for EditorProject {
|
||||
type IxCols = EditorProjectIxCols;
|
||||
fn ix_cols(table_name: &'static str) -> Self::IxCols {
|
||||
EditorProjectIxCols {
|
||||
owner_user_id: __sdk::__query_builder::IxCol::new(table_name, "owner_user_id"),
|
||||
project_id: __sdk::__query_builder::IxCol::new(table_name, "project_id"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::CanBeLookupTable for EditorProject {}
|
||||
@@ -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 EditorProjectViewportSnapshot {
|
||||
pub x: f64,
|
||||
pub y: f64,
|
||||
pub scale: f64,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for EditorProjectViewportSnapshot {
|
||||
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::editor_project_get_input_type::EditorProjectGetInput;
|
||||
use super::editor_project_procedure_result_type::EditorProjectProcedureResult;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
struct GetEditorProjectAndReturnArgs {
|
||||
pub input: EditorProjectGetInput,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for GetEditorProjectAndReturnArgs {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the procedure `get_editor_project_and_return`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteProcedures`].
|
||||
pub trait get_editor_project_and_return {
|
||||
fn get_editor_project_and_return(&self, input: EditorProjectGetInput) {
|
||||
self.get_editor_project_and_return_then(input, |_, _| {});
|
||||
}
|
||||
|
||||
fn get_editor_project_and_return_then(
|
||||
&self,
|
||||
input: EditorProjectGetInput,
|
||||
|
||||
__callback: impl FnOnce(
|
||||
&super::ProcedureEventContext,
|
||||
Result<EditorProjectProcedureResult, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
);
|
||||
}
|
||||
|
||||
impl get_editor_project_and_return for super::RemoteProcedures {
|
||||
fn get_editor_project_and_return_then(
|
||||
&self,
|
||||
input: EditorProjectGetInput,
|
||||
|
||||
__callback: impl FnOnce(
|
||||
&super::ProcedureEventContext,
|
||||
Result<EditorProjectProcedureResult, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
) {
|
||||
self.imp
|
||||
.invoke_procedure_with_callback::<_, EditorProjectProcedureResult>(
|
||||
"get_editor_project_and_return",
|
||||
GetEditorProjectAndReturnArgs { input },
|
||||
__callback,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -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::editor_project_get_recent_input_type::EditorProjectGetRecentInput;
|
||||
use super::editor_project_procedure_result_type::EditorProjectProcedureResult;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
struct GetRecentEditorProjectAndReturnArgs {
|
||||
pub input: EditorProjectGetRecentInput,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for GetRecentEditorProjectAndReturnArgs {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the procedure `get_recent_editor_project_and_return`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteProcedures`].
|
||||
pub trait get_recent_editor_project_and_return {
|
||||
fn get_recent_editor_project_and_return(&self, input: EditorProjectGetRecentInput) {
|
||||
self.get_recent_editor_project_and_return_then(input, |_, _| {});
|
||||
}
|
||||
|
||||
fn get_recent_editor_project_and_return_then(
|
||||
&self,
|
||||
input: EditorProjectGetRecentInput,
|
||||
|
||||
__callback: impl FnOnce(
|
||||
&super::ProcedureEventContext,
|
||||
Result<EditorProjectProcedureResult, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
);
|
||||
}
|
||||
|
||||
impl get_recent_editor_project_and_return for super::RemoteProcedures {
|
||||
fn get_recent_editor_project_and_return_then(
|
||||
&self,
|
||||
input: EditorProjectGetRecentInput,
|
||||
|
||||
__callback: impl FnOnce(
|
||||
&super::ProcedureEventContext,
|
||||
Result<EditorProjectProcedureResult, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
) {
|
||||
self.imp
|
||||
.invoke_procedure_with_callback::<_, EditorProjectProcedureResult>(
|
||||
"get_recent_editor_project_and_return",
|
||||
GetRecentEditorProjectAndReturnArgs { input },
|
||||
__callback,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -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::editor_project_layout_save_input_type::EditorProjectLayoutSaveInput;
|
||||
use super::editor_project_procedure_result_type::EditorProjectProcedureResult;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
struct SaveEditorProjectLayoutAndReturnArgs {
|
||||
pub input: EditorProjectLayoutSaveInput,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for SaveEditorProjectLayoutAndReturnArgs {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the procedure `save_editor_project_layout_and_return`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteProcedures`].
|
||||
pub trait save_editor_project_layout_and_return {
|
||||
fn save_editor_project_layout_and_return(&self, input: EditorProjectLayoutSaveInput) {
|
||||
self.save_editor_project_layout_and_return_then(input, |_, _| {});
|
||||
}
|
||||
|
||||
fn save_editor_project_layout_and_return_then(
|
||||
&self,
|
||||
input: EditorProjectLayoutSaveInput,
|
||||
|
||||
__callback: impl FnOnce(
|
||||
&super::ProcedureEventContext,
|
||||
Result<EditorProjectProcedureResult, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
);
|
||||
}
|
||||
|
||||
impl save_editor_project_layout_and_return for super::RemoteProcedures {
|
||||
fn save_editor_project_layout_and_return_then(
|
||||
&self,
|
||||
input: EditorProjectLayoutSaveInput,
|
||||
|
||||
__callback: impl FnOnce(
|
||||
&super::ProcedureEventContext,
|
||||
Result<EditorProjectProcedureResult, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
) {
|
||||
self.imp
|
||||
.invoke_procedure_with_callback::<_, EditorProjectProcedureResult>(
|
||||
"save_editor_project_layout_and_return",
|
||||
SaveEditorProjectLayoutAndReturnArgs { input },
|
||||
__callback,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user