Extend square-hole creation flow with visual asset timeout guard

This commit is contained in:
kdletters
2026-05-05 15:27:09 +08:00
parent 2252afb080
commit 60b667a9d1
30 changed files with 2838 additions and 215 deletions

View File

@@ -38,6 +38,26 @@ pub struct ExecuteSquareHoleActionRequest {
pub cover_image_src: Option<String>,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct SquareHoleShapeOptionResponse {
pub option_id: String,
pub shape_kind: String,
pub label: String,
pub image_prompt: String,
#[serde(default)]
pub image_src: Option<String>,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct SquareHoleHoleOptionResponse {
pub hole_id: String,
pub hole_kind: String,
pub label: String,
pub bonus: bool,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct SquareHoleAnchorItemResponse {
@@ -63,6 +83,16 @@ pub struct SquareHoleCreatorConfigResponse {
pub twist_rule: String,
pub shape_count: u32,
pub difficulty: u32,
#[serde(default)]
pub shape_options: Vec<SquareHoleShapeOptionResponse>,
#[serde(default)]
pub hole_options: Vec<SquareHoleHoleOptionResponse>,
#[serde(default)]
pub background_prompt: String,
#[serde(default)]
pub cover_image_src: Option<String>,
#[serde(default)]
pub background_image_src: Option<String>,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
@@ -74,6 +104,16 @@ pub struct SquareHoleResultDraftResponse {
pub twist_rule: String,
pub summary: String,
pub tags: Vec<String>,
#[serde(default)]
pub cover_image_src: Option<String>,
#[serde(default)]
pub background_prompt: String,
#[serde(default)]
pub background_image_src: Option<String>,
#[serde(default)]
pub shape_options: Vec<SquareHoleShapeOptionResponse>,
#[serde(default)]
pub hole_options: Vec<SquareHoleHoleOptionResponse>,
pub shape_count: u32,
pub difficulty: u32,
pub publish_ready: bool,

View File

@@ -30,6 +30,8 @@ pub struct SquareHoleShapeSnapshotResponse {
pub shape_kind: String,
pub label: String,
pub color: String,
#[serde(default)]
pub image_src: Option<String>,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
@@ -40,6 +42,7 @@ pub struct SquareHoleHoleSnapshotResponse {
pub label: String,
pub x: f32,
pub y: f32,
pub bonus: bool,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
@@ -69,6 +72,8 @@ pub struct SquareHoleRunSnapshotResponse {
pub score: u32,
pub rule_label: String,
#[serde(default)]
pub background_image_src: Option<String>,
#[serde(default)]
pub current_shape: Option<SquareHoleShapeSnapshotResponse>,
pub holes: Vec<SquareHoleHoleSnapshotResponse>,
#[serde(default)]

View File

@@ -1,5 +1,25 @@
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct SquareHoleShapeOptionResponse {
pub option_id: String,
pub shape_kind: String,
pub label: String,
pub image_prompt: String,
#[serde(default)]
pub image_src: Option<String>,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct SquareHoleHoleOptionResponse {
pub hole_id: String,
pub hole_kind: String,
pub label: String,
pub bonus: bool,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct PutSquareHoleWorkRequest {
@@ -11,6 +31,14 @@ pub struct PutSquareHoleWorkRequest {
pub tags: Vec<String>,
#[serde(default)]
pub cover_image_src: Option<String>,
#[serde(default)]
pub background_prompt: Option<String>,
#[serde(default)]
pub background_image_src: Option<String>,
#[serde(default)]
pub shape_options: Option<Vec<SquareHoleShapeOptionResponse>>,
#[serde(default)]
pub hole_options: Option<Vec<SquareHoleHoleOptionResponse>>,
pub shape_count: u32,
pub difficulty: u32,
}
@@ -30,6 +58,14 @@ pub struct SquareHoleWorkSummaryResponse {
pub tags: Vec<String>,
#[serde(default)]
pub cover_image_src: Option<String>,
#[serde(default)]
pub background_prompt: String,
#[serde(default)]
pub background_image_src: Option<String>,
#[serde(default)]
pub shape_options: Vec<SquareHoleShapeOptionResponse>,
#[serde(default)]
pub hole_options: Vec<SquareHoleHoleOptionResponse>,
pub shape_count: u32,
pub difficulty: u32,
pub publication_status: String,