1
This commit is contained in:
@@ -11,6 +11,7 @@ reqwest = { version = "0.12", default-features = false, features = ["json", "rus
|
||||
module-ai = { path = "../module-ai" }
|
||||
module-assets = { path = "../module-assets" }
|
||||
module-auth = { path = "../module-auth" }
|
||||
module-big-fish = { path = "../module-big-fish" }
|
||||
module-combat = { path = "../module-combat" }
|
||||
module-custom-world = { path = "../module-custom-world" }
|
||||
module-inventory = { path = "../module-inventory" }
|
||||
|
||||
@@ -24,6 +24,11 @@ use crate::{
|
||||
},
|
||||
auth_me::auth_me,
|
||||
auth_sessions::auth_sessions,
|
||||
big_fish::{
|
||||
create_big_fish_session, execute_big_fish_action, get_big_fish_run, get_big_fish_session,
|
||||
start_big_fish_run, stream_big_fish_message, submit_big_fish_input,
|
||||
submit_big_fish_message,
|
||||
},
|
||||
custom_world::{
|
||||
create_custom_world_agent_session, execute_custom_world_agent_action,
|
||||
get_custom_world_agent_card_detail,
|
||||
@@ -48,6 +53,13 @@ use crate::{
|
||||
logout_all::logout_all,
|
||||
password_entry::password_entry,
|
||||
phone_auth::{phone_login, send_phone_code},
|
||||
puzzle::{
|
||||
advance_puzzle_next_level, create_puzzle_agent_session, drag_puzzle_piece_or_group,
|
||||
execute_puzzle_agent_action, get_puzzle_agent_session, get_puzzle_gallery_detail,
|
||||
get_puzzle_run, get_puzzle_work_detail, get_puzzle_works, list_puzzle_gallery,
|
||||
put_puzzle_work, start_puzzle_run, stream_puzzle_agent_message,
|
||||
submit_puzzle_agent_message, swap_puzzle_pieces,
|
||||
},
|
||||
refresh_session::refresh_session,
|
||||
request_context::{attach_request_context, resolve_request_id},
|
||||
response_headers::propagate_request_id_header,
|
||||
@@ -348,6 +360,153 @@ pub fn build_router(state: AppState) -> Router {
|
||||
require_bearer_auth,
|
||||
)),
|
||||
)
|
||||
.route(
|
||||
"/api/runtime/big-fish/agent/sessions",
|
||||
post(create_big_fish_session).route_layer(middleware::from_fn_with_state(
|
||||
state.clone(),
|
||||
require_bearer_auth,
|
||||
)),
|
||||
)
|
||||
.route(
|
||||
"/api/runtime/big-fish/agent/sessions/{session_id}",
|
||||
get(get_big_fish_session).route_layer(middleware::from_fn_with_state(
|
||||
state.clone(),
|
||||
require_bearer_auth,
|
||||
)),
|
||||
)
|
||||
.route(
|
||||
"/api/runtime/big-fish/agent/sessions/{session_id}/messages",
|
||||
post(submit_big_fish_message).route_layer(middleware::from_fn_with_state(
|
||||
state.clone(),
|
||||
require_bearer_auth,
|
||||
)),
|
||||
)
|
||||
.route(
|
||||
"/api/runtime/big-fish/agent/sessions/{session_id}/messages/stream",
|
||||
post(stream_big_fish_message).route_layer(middleware::from_fn_with_state(
|
||||
state.clone(),
|
||||
require_bearer_auth,
|
||||
)),
|
||||
)
|
||||
.route(
|
||||
"/api/runtime/big-fish/agent/sessions/{session_id}/actions",
|
||||
post(execute_big_fish_action).route_layer(middleware::from_fn_with_state(
|
||||
state.clone(),
|
||||
require_bearer_auth,
|
||||
)),
|
||||
)
|
||||
.route(
|
||||
"/api/runtime/big-fish/sessions/{session_id}/runs",
|
||||
post(start_big_fish_run).route_layer(middleware::from_fn_with_state(
|
||||
state.clone(),
|
||||
require_bearer_auth,
|
||||
)),
|
||||
)
|
||||
.route(
|
||||
"/api/runtime/big-fish/runs/{run_id}",
|
||||
get(get_big_fish_run).route_layer(middleware::from_fn_with_state(
|
||||
state.clone(),
|
||||
require_bearer_auth,
|
||||
)),
|
||||
)
|
||||
.route(
|
||||
"/api/runtime/big-fish/runs/{run_id}/input",
|
||||
post(submit_big_fish_input).route_layer(middleware::from_fn_with_state(
|
||||
state.clone(),
|
||||
require_bearer_auth,
|
||||
)),
|
||||
)
|
||||
.route(
|
||||
"/api/runtime/puzzle/agent/sessions",
|
||||
post(create_puzzle_agent_session).route_layer(middleware::from_fn_with_state(
|
||||
state.clone(),
|
||||
require_bearer_auth,
|
||||
)),
|
||||
)
|
||||
.route(
|
||||
"/api/runtime/puzzle/agent/sessions/{session_id}",
|
||||
get(get_puzzle_agent_session).route_layer(middleware::from_fn_with_state(
|
||||
state.clone(),
|
||||
require_bearer_auth,
|
||||
)),
|
||||
)
|
||||
.route(
|
||||
"/api/runtime/puzzle/agent/sessions/{session_id}/messages",
|
||||
post(submit_puzzle_agent_message).route_layer(middleware::from_fn_with_state(
|
||||
state.clone(),
|
||||
require_bearer_auth,
|
||||
)),
|
||||
)
|
||||
.route(
|
||||
"/api/runtime/puzzle/agent/sessions/{session_id}/messages/stream",
|
||||
post(stream_puzzle_agent_message).route_layer(middleware::from_fn_with_state(
|
||||
state.clone(),
|
||||
require_bearer_auth,
|
||||
)),
|
||||
)
|
||||
.route(
|
||||
"/api/runtime/puzzle/agent/sessions/{session_id}/actions",
|
||||
post(execute_puzzle_agent_action).route_layer(middleware::from_fn_with_state(
|
||||
state.clone(),
|
||||
require_bearer_auth,
|
||||
)),
|
||||
)
|
||||
.route(
|
||||
"/api/runtime/puzzle/works",
|
||||
get(get_puzzle_works).route_layer(middleware::from_fn_with_state(
|
||||
state.clone(),
|
||||
require_bearer_auth,
|
||||
)),
|
||||
)
|
||||
.route(
|
||||
"/api/runtime/puzzle/works/{profile_id}",
|
||||
get(get_puzzle_work_detail)
|
||||
.put(put_puzzle_work)
|
||||
.route_layer(middleware::from_fn_with_state(
|
||||
state.clone(),
|
||||
require_bearer_auth,
|
||||
)),
|
||||
)
|
||||
.route("/api/runtime/puzzle/gallery", get(list_puzzle_gallery))
|
||||
.route(
|
||||
"/api/runtime/puzzle/gallery/{profile_id}",
|
||||
get(get_puzzle_gallery_detail),
|
||||
)
|
||||
.route(
|
||||
"/api/runtime/puzzle/runs",
|
||||
post(start_puzzle_run).route_layer(middleware::from_fn_with_state(
|
||||
state.clone(),
|
||||
require_bearer_auth,
|
||||
)),
|
||||
)
|
||||
.route(
|
||||
"/api/runtime/puzzle/runs/{run_id}",
|
||||
get(get_puzzle_run).route_layer(middleware::from_fn_with_state(
|
||||
state.clone(),
|
||||
require_bearer_auth,
|
||||
)),
|
||||
)
|
||||
.route(
|
||||
"/api/runtime/puzzle/runs/{run_id}/swap",
|
||||
post(swap_puzzle_pieces).route_layer(middleware::from_fn_with_state(
|
||||
state.clone(),
|
||||
require_bearer_auth,
|
||||
)),
|
||||
)
|
||||
.route(
|
||||
"/api/runtime/puzzle/runs/{run_id}/drag",
|
||||
post(drag_puzzle_piece_or_group).route_layer(middleware::from_fn_with_state(
|
||||
state.clone(),
|
||||
require_bearer_auth,
|
||||
)),
|
||||
)
|
||||
.route(
|
||||
"/api/runtime/puzzle/runs/{run_id}/next-level",
|
||||
post(advance_puzzle_next_level).route_layer(middleware::from_fn_with_state(
|
||||
state.clone(),
|
||||
require_bearer_auth,
|
||||
)),
|
||||
)
|
||||
.route(
|
||||
"/api/custom-world/entity",
|
||||
post(generate_custom_world_entity).route_layer(middleware::from_fn_with_state(
|
||||
|
||||
@@ -8,8 +8,12 @@ use axum::{
|
||||
middleware::Next,
|
||||
response::Response,
|
||||
};
|
||||
use platform_auth::{AccessTokenClaims, read_refresh_session_token, verify_access_token};
|
||||
use platform_auth::{
|
||||
AccessTokenClaims, AuthProvider, BindingStatus, read_refresh_session_token,
|
||||
verify_access_token,
|
||||
};
|
||||
use serde_json::{Value, json};
|
||||
use time::OffsetDateTime;
|
||||
use tracing::warn;
|
||||
|
||||
use crate::{
|
||||
@@ -17,6 +21,9 @@ use crate::{
|
||||
state::AppState,
|
||||
};
|
||||
|
||||
const INTERNAL_AUTH_USER_ID_HEADER: &str = "x-genarrative-authenticated-user-id";
|
||||
const INTERNAL_API_SECRET_HEADER: &str = "x-genarrative-internal-api-secret";
|
||||
|
||||
// 统一把已校验的 claims 写入 request extensions,避免后续 handler 再次重复解析 Bearer token。
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct AuthenticatedAccessToken {
|
||||
@@ -53,6 +60,15 @@ pub async fn require_bearer_auth(
|
||||
mut request: Request,
|
||||
next: Next,
|
||||
) -> Result<Response, AppError> {
|
||||
if request.uri().path().starts_with("/api/runtime/big-fish/")
|
||||
&& let Some(claims) = try_build_internal_forwarded_claims(&state, request.headers())
|
||||
{
|
||||
request
|
||||
.extensions_mut()
|
||||
.insert(AuthenticatedAccessToken::new(claims));
|
||||
return Ok(next.run(request).await);
|
||||
}
|
||||
|
||||
let bearer_token = extract_bearer_token(request.headers())?;
|
||||
let request_id = request
|
||||
.extensions()
|
||||
@@ -172,13 +188,60 @@ fn extract_bearer_token(headers: &HeaderMap) -> Result<String, AppError> {
|
||||
Ok(token.to_string())
|
||||
}
|
||||
|
||||
fn try_build_internal_forwarded_claims(
|
||||
state: &AppState,
|
||||
headers: &HeaderMap,
|
||||
) -> Option<AccessTokenClaims> {
|
||||
let expected_secret = state.config.internal_api_secret.as_ref()?.trim();
|
||||
if expected_secret.is_empty() {
|
||||
return None;
|
||||
}
|
||||
|
||||
let provided_secret = headers
|
||||
.get(INTERNAL_API_SECRET_HEADER)
|
||||
.and_then(|value| value.to_str().ok())
|
||||
.map(str::trim)
|
||||
.filter(|value| !value.is_empty())?;
|
||||
if provided_secret != expected_secret {
|
||||
return None;
|
||||
}
|
||||
|
||||
let user_id = headers
|
||||
.get(INTERNAL_AUTH_USER_ID_HEADER)
|
||||
.and_then(|value| value.to_str().ok())
|
||||
.map(str::trim)
|
||||
.filter(|value| !value.is_empty())?
|
||||
.to_string();
|
||||
|
||||
// 这里的 claims 只服务于经 Node 已鉴权后的本地内部转发链路,避免在开发态复制整套账号仓储。
|
||||
AccessTokenClaims::from_input(
|
||||
platform_auth::AccessTokenClaimsInput {
|
||||
user_id: user_id.clone(),
|
||||
session_id: format!("internal-forwarded-{user_id}"),
|
||||
provider: AuthProvider::Password,
|
||||
roles: vec!["user".to_string()],
|
||||
token_version: 0,
|
||||
phone_verified: false,
|
||||
binding_status: BindingStatus::Active,
|
||||
display_name: None,
|
||||
},
|
||||
state.auth_jwt_config(),
|
||||
OffsetDateTime::now_utc(),
|
||||
)
|
||||
.ok()
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::{RefreshSessionToken, extract_bearer_token};
|
||||
use super::{
|
||||
INTERNAL_API_SECRET_HEADER, INTERNAL_AUTH_USER_ID_HEADER, RefreshSessionToken,
|
||||
extract_bearer_token, try_build_internal_forwarded_claims,
|
||||
};
|
||||
use axum::{
|
||||
http::{HeaderMap, HeaderValue, StatusCode, header::AUTHORIZATION},
|
||||
response::IntoResponse,
|
||||
};
|
||||
use crate::{config::AppConfig, state::AppState};
|
||||
|
||||
#[test]
|
||||
fn extract_bearer_token_accepts_standard_header() {
|
||||
@@ -209,4 +272,26 @@ mod tests {
|
||||
|
||||
assert_eq!(token.token(), "refresh-token-01");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn internal_forwarded_claims_require_matching_secret() {
|
||||
let mut config = AppConfig::default();
|
||||
config.internal_api_secret = Some("bridge-secret".to_string());
|
||||
let state = AppState::new(config).expect("state should build");
|
||||
let mut headers = HeaderMap::new();
|
||||
headers.insert(
|
||||
INTERNAL_AUTH_USER_ID_HEADER,
|
||||
HeaderValue::from_static("user_forwarded_01"),
|
||||
);
|
||||
headers.insert(
|
||||
INTERNAL_API_SECRET_HEADER,
|
||||
HeaderValue::from_static("bridge-secret"),
|
||||
);
|
||||
|
||||
let claims =
|
||||
try_build_internal_forwarded_claims(&state, &headers).expect("claims should resolve");
|
||||
|
||||
assert_eq!(claims.user_id(), "user_forwarded_01");
|
||||
assert_eq!(claims.token_version(), 0);
|
||||
}
|
||||
}
|
||||
|
||||
653
server-rs/crates/api-server/src/big_fish.rs
Normal file
653
server-rs/crates/api-server/src/big_fish.rs
Normal file
@@ -0,0 +1,653 @@
|
||||
use axum::{
|
||||
Json,
|
||||
extract::{Extension, Path, State, rejection::JsonRejection},
|
||||
http::{HeaderName, StatusCode, header},
|
||||
response::{IntoResponse, Response},
|
||||
};
|
||||
use serde_json::{Value, json};
|
||||
use shared_contracts::big_fish::{
|
||||
BigFishActionResponse, BigFishAgentMessageResponse, BigFishAnchorItemResponse,
|
||||
BigFishAnchorPackResponse, BigFishAssetCoverageResponse, BigFishAssetSlotResponse,
|
||||
BigFishBackgroundBlueprintResponse, BigFishGameDraftResponse, BigFishLevelBlueprintResponse,
|
||||
BigFishRuntimeEntityResponse, BigFishRuntimeParamsResponse, BigFishRuntimeSnapshotResponse,
|
||||
BigFishRunResponse, BigFishSessionResponse, BigFishSessionSnapshotResponse,
|
||||
BigFishVector2Response, CreateBigFishSessionRequest, ExecuteBigFishActionRequest,
|
||||
SendBigFishMessageRequest, SubmitBigFishInputRequest,
|
||||
};
|
||||
use shared_kernel::build_prefixed_uuid_id;
|
||||
use spacetime_client::{
|
||||
BigFishAgentMessageRecord, BigFishAnchorItemRecord, BigFishAnchorPackRecord,
|
||||
BigFishAssetCoverageRecord, BigFishAssetGenerateRecordInput, BigFishAssetSlotRecord,
|
||||
BigFishBackgroundBlueprintRecord, BigFishGameDraftRecord, BigFishLevelBlueprintRecord,
|
||||
BigFishMessageSubmitRecordInput, BigFishRunInputSubmitRecordInput, BigFishRunStartRecordInput,
|
||||
BigFishRuntimeEntityRecord, BigFishRuntimeParamsRecord, BigFishRuntimeRecord,
|
||||
BigFishSessionCreateRecordInput, BigFishSessionRecord, BigFishVector2Record,
|
||||
SpacetimeClientError,
|
||||
};
|
||||
|
||||
use crate::{
|
||||
api_response::json_success_body, auth::AuthenticatedAccessToken, http_error::AppError,
|
||||
request_context::RequestContext, state::AppState,
|
||||
};
|
||||
|
||||
pub async fn create_big_fish_session(
|
||||
State(state): State<AppState>,
|
||||
Extension(request_context): Extension<RequestContext>,
|
||||
Extension(authenticated): Extension<AuthenticatedAccessToken>,
|
||||
payload: Result<Json<CreateBigFishSessionRequest>, JsonRejection>,
|
||||
) -> Result<Json<Value>, Response> {
|
||||
let Json(payload) = payload.map_err(|error| {
|
||||
big_fish_error_response(
|
||||
&request_context,
|
||||
AppError::from_status(StatusCode::BAD_REQUEST).with_details(json!({
|
||||
"provider": "big-fish",
|
||||
"message": error.body_text(),
|
||||
})),
|
||||
)
|
||||
})?;
|
||||
|
||||
let seed_text = payload.seed_text.unwrap_or_default().trim().to_string();
|
||||
let session = state
|
||||
.spacetime_client()
|
||||
.create_big_fish_session(BigFishSessionCreateRecordInput {
|
||||
session_id: build_prefixed_uuid_id("big-fish-session-"),
|
||||
owner_user_id: authenticated.claims().user_id().to_string(),
|
||||
seed_text: seed_text.clone(),
|
||||
welcome_message_id: build_prefixed_uuid_id("big-fish-message-"),
|
||||
welcome_message_text: build_big_fish_welcome_text(&seed_text),
|
||||
created_at_micros: current_utc_micros(),
|
||||
})
|
||||
.await
|
||||
.map_err(|error| big_fish_error_response(&request_context, map_big_fish_client_error(error)))?;
|
||||
|
||||
Ok(json_success_body(
|
||||
Some(&request_context),
|
||||
BigFishSessionResponse {
|
||||
session: map_big_fish_session_response(session),
|
||||
},
|
||||
))
|
||||
}
|
||||
|
||||
pub async fn get_big_fish_session(
|
||||
State(state): State<AppState>,
|
||||
Path(session_id): Path<String>,
|
||||
Extension(request_context): Extension<RequestContext>,
|
||||
Extension(authenticated): Extension<AuthenticatedAccessToken>,
|
||||
) -> Result<Json<Value>, Response> {
|
||||
ensure_non_empty(&request_context, &session_id, "sessionId")?;
|
||||
|
||||
let session = state
|
||||
.spacetime_client()
|
||||
.get_big_fish_session(session_id, authenticated.claims().user_id().to_string())
|
||||
.await
|
||||
.map_err(|error| big_fish_error_response(&request_context, map_big_fish_client_error(error)))?;
|
||||
|
||||
Ok(json_success_body(
|
||||
Some(&request_context),
|
||||
BigFishSessionResponse {
|
||||
session: map_big_fish_session_response(session),
|
||||
},
|
||||
))
|
||||
}
|
||||
|
||||
pub async fn submit_big_fish_message(
|
||||
State(state): State<AppState>,
|
||||
Path(session_id): Path<String>,
|
||||
Extension(request_context): Extension<RequestContext>,
|
||||
Extension(authenticated): Extension<AuthenticatedAccessToken>,
|
||||
payload: Result<Json<SendBigFishMessageRequest>, JsonRejection>,
|
||||
) -> Result<Json<Value>, Response> {
|
||||
let Json(payload) = payload.map_err(|error| {
|
||||
big_fish_error_response(
|
||||
&request_context,
|
||||
AppError::from_status(StatusCode::BAD_REQUEST).with_details(json!({
|
||||
"provider": "big-fish",
|
||||
"message": error.body_text(),
|
||||
})),
|
||||
)
|
||||
})?;
|
||||
ensure_non_empty(&request_context, &session_id, "sessionId")?;
|
||||
|
||||
let client_message_id = payload.client_message_id.trim().to_string();
|
||||
let message_text = payload.text.trim().to_string();
|
||||
if client_message_id.is_empty() || message_text.is_empty() {
|
||||
return Err(big_fish_bad_request(
|
||||
&request_context,
|
||||
"clientMessageId and text are required",
|
||||
));
|
||||
}
|
||||
|
||||
let session = state
|
||||
.spacetime_client()
|
||||
.submit_big_fish_message(BigFishMessageSubmitRecordInput {
|
||||
session_id,
|
||||
owner_user_id: authenticated.claims().user_id().to_string(),
|
||||
user_message_id: client_message_id,
|
||||
user_message_text: message_text,
|
||||
assistant_message_id: build_prefixed_uuid_id("big-fish-message-"),
|
||||
submitted_at_micros: current_utc_micros(),
|
||||
})
|
||||
.await
|
||||
.map_err(|error| big_fish_error_response(&request_context, map_big_fish_client_error(error)))?;
|
||||
|
||||
Ok(json_success_body(
|
||||
Some(&request_context),
|
||||
BigFishSessionResponse {
|
||||
session: map_big_fish_session_response(session),
|
||||
},
|
||||
))
|
||||
}
|
||||
|
||||
pub async fn stream_big_fish_message(
|
||||
State(state): State<AppState>,
|
||||
Path(session_id): Path<String>,
|
||||
Extension(request_context): Extension<RequestContext>,
|
||||
Extension(authenticated): Extension<AuthenticatedAccessToken>,
|
||||
payload: Result<Json<SendBigFishMessageRequest>, JsonRejection>,
|
||||
) -> Result<Response, Response> {
|
||||
let Json(payload) = payload.map_err(|error| {
|
||||
big_fish_error_response(
|
||||
&request_context,
|
||||
AppError::from_status(StatusCode::BAD_REQUEST).with_details(json!({
|
||||
"provider": "big-fish",
|
||||
"message": error.body_text(),
|
||||
})),
|
||||
)
|
||||
})?;
|
||||
ensure_non_empty(&request_context, &session_id, "sessionId")?;
|
||||
|
||||
let owner_user_id = authenticated.claims().user_id().to_string();
|
||||
let session = state
|
||||
.spacetime_client()
|
||||
.submit_big_fish_message(BigFishMessageSubmitRecordInput {
|
||||
session_id,
|
||||
owner_user_id,
|
||||
user_message_id: payload.client_message_id.trim().to_string(),
|
||||
user_message_text: payload.text.trim().to_string(),
|
||||
assistant_message_id: build_prefixed_uuid_id("big-fish-message-"),
|
||||
submitted_at_micros: current_utc_micros(),
|
||||
})
|
||||
.await
|
||||
.map_err(|error| big_fish_error_response(&request_context, map_big_fish_client_error(error)))?;
|
||||
|
||||
let session_response = map_big_fish_session_response(session);
|
||||
let reply_text = session_response
|
||||
.last_assistant_reply
|
||||
.clone()
|
||||
.unwrap_or_else(|| "锚点已更新。".to_string());
|
||||
let mut sse_body = String::new();
|
||||
append_sse_event(&request_context, &mut sse_body, "reply_delta", &json!({ "text": reply_text }))?;
|
||||
append_sse_event(&request_context, &mut sse_body, "session", &json!({ "session": session_response }))?;
|
||||
append_sse_event(&request_context, &mut sse_body, "done", &json!({ "ok": true }))?;
|
||||
Ok(build_event_stream_response(sse_body))
|
||||
}
|
||||
|
||||
pub async fn execute_big_fish_action(
|
||||
State(state): State<AppState>,
|
||||
Path(session_id): Path<String>,
|
||||
Extension(request_context): Extension<RequestContext>,
|
||||
Extension(authenticated): Extension<AuthenticatedAccessToken>,
|
||||
payload: Result<Json<ExecuteBigFishActionRequest>, JsonRejection>,
|
||||
) -> Result<Json<Value>, Response> {
|
||||
let Json(payload) = payload.map_err(|error| {
|
||||
big_fish_error_response(
|
||||
&request_context,
|
||||
AppError::from_status(StatusCode::BAD_REQUEST).with_details(json!({
|
||||
"provider": "big-fish",
|
||||
"message": error.body_text(),
|
||||
})),
|
||||
)
|
||||
})?;
|
||||
ensure_non_empty(&request_context, &session_id, "sessionId")?;
|
||||
|
||||
let owner_user_id = authenticated.claims().user_id().to_string();
|
||||
let now = current_utc_micros();
|
||||
let session = match payload.action.trim() {
|
||||
"big_fish_compile_draft" => {
|
||||
state
|
||||
.spacetime_client()
|
||||
.compile_big_fish_draft(session_id, owner_user_id, now)
|
||||
.await
|
||||
}
|
||||
"big_fish_generate_level_main_image" => {
|
||||
state
|
||||
.spacetime_client()
|
||||
.generate_big_fish_asset(BigFishAssetGenerateRecordInput {
|
||||
session_id,
|
||||
owner_user_id,
|
||||
asset_kind: "level_main_image".to_string(),
|
||||
level: payload.level,
|
||||
motion_key: None,
|
||||
generated_at_micros: now,
|
||||
})
|
||||
.await
|
||||
}
|
||||
"big_fish_generate_level_motion" => {
|
||||
state
|
||||
.spacetime_client()
|
||||
.generate_big_fish_asset(BigFishAssetGenerateRecordInput {
|
||||
session_id,
|
||||
owner_user_id,
|
||||
asset_kind: "level_motion".to_string(),
|
||||
level: payload.level,
|
||||
motion_key: payload.motion_key,
|
||||
generated_at_micros: now,
|
||||
})
|
||||
.await
|
||||
}
|
||||
"big_fish_generate_stage_background" => {
|
||||
state
|
||||
.spacetime_client()
|
||||
.generate_big_fish_asset(BigFishAssetGenerateRecordInput {
|
||||
session_id,
|
||||
owner_user_id,
|
||||
asset_kind: "stage_background".to_string(),
|
||||
level: None,
|
||||
motion_key: None,
|
||||
generated_at_micros: now,
|
||||
})
|
||||
.await
|
||||
}
|
||||
"big_fish_publish_game" => {
|
||||
state
|
||||
.spacetime_client()
|
||||
.publish_big_fish_game(session_id, owner_user_id, now)
|
||||
.await
|
||||
}
|
||||
other => {
|
||||
return Err(big_fish_bad_request(
|
||||
&request_context,
|
||||
format!("action `{other}` is not supported").as_str(),
|
||||
));
|
||||
}
|
||||
}
|
||||
.map_err(|error| big_fish_error_response(&request_context, map_big_fish_client_error(error)))?;
|
||||
|
||||
Ok(json_success_body(
|
||||
Some(&request_context),
|
||||
BigFishActionResponse {
|
||||
session: map_big_fish_session_response(session),
|
||||
},
|
||||
))
|
||||
}
|
||||
|
||||
pub async fn start_big_fish_run(
|
||||
State(state): State<AppState>,
|
||||
Path(session_id): Path<String>,
|
||||
Extension(request_context): Extension<RequestContext>,
|
||||
Extension(authenticated): Extension<AuthenticatedAccessToken>,
|
||||
) -> Result<Json<Value>, Response> {
|
||||
ensure_non_empty(&request_context, &session_id, "sessionId")?;
|
||||
|
||||
let run = state
|
||||
.spacetime_client()
|
||||
.start_big_fish_run(BigFishRunStartRecordInput {
|
||||
run_id: build_prefixed_uuid_id("big-fish-run-"),
|
||||
session_id,
|
||||
owner_user_id: authenticated.claims().user_id().to_string(),
|
||||
started_at_micros: current_utc_micros(),
|
||||
})
|
||||
.await
|
||||
.map_err(|error| big_fish_error_response(&request_context, map_big_fish_client_error(error)))?;
|
||||
|
||||
Ok(json_success_body(
|
||||
Some(&request_context),
|
||||
BigFishRunResponse {
|
||||
run: map_big_fish_runtime_response(run),
|
||||
},
|
||||
))
|
||||
}
|
||||
|
||||
pub async fn get_big_fish_run(
|
||||
State(state): State<AppState>,
|
||||
Path(run_id): Path<String>,
|
||||
Extension(request_context): Extension<RequestContext>,
|
||||
Extension(authenticated): Extension<AuthenticatedAccessToken>,
|
||||
) -> Result<Json<Value>, Response> {
|
||||
ensure_non_empty(&request_context, &run_id, "runId")?;
|
||||
|
||||
let run = state
|
||||
.spacetime_client()
|
||||
.get_big_fish_run(run_id, authenticated.claims().user_id().to_string())
|
||||
.await
|
||||
.map_err(|error| big_fish_error_response(&request_context, map_big_fish_client_error(error)))?;
|
||||
|
||||
Ok(json_success_body(
|
||||
Some(&request_context),
|
||||
BigFishRunResponse {
|
||||
run: map_big_fish_runtime_response(run),
|
||||
},
|
||||
))
|
||||
}
|
||||
|
||||
pub async fn submit_big_fish_input(
|
||||
State(state): State<AppState>,
|
||||
Path(run_id): Path<String>,
|
||||
Extension(request_context): Extension<RequestContext>,
|
||||
Extension(authenticated): Extension<AuthenticatedAccessToken>,
|
||||
payload: Result<Json<SubmitBigFishInputRequest>, JsonRejection>,
|
||||
) -> Result<Json<Value>, Response> {
|
||||
let Json(payload) = payload.map_err(|error| {
|
||||
big_fish_error_response(
|
||||
&request_context,
|
||||
AppError::from_status(StatusCode::BAD_REQUEST).with_details(json!({
|
||||
"provider": "big-fish",
|
||||
"message": error.body_text(),
|
||||
})),
|
||||
)
|
||||
})?;
|
||||
ensure_non_empty(&request_context, &run_id, "runId")?;
|
||||
|
||||
let run = state
|
||||
.spacetime_client()
|
||||
.submit_big_fish_input(BigFishRunInputSubmitRecordInput {
|
||||
run_id,
|
||||
owner_user_id: authenticated.claims().user_id().to_string(),
|
||||
input_x: payload.x,
|
||||
input_y: payload.y,
|
||||
submitted_at_micros: current_utc_micros(),
|
||||
})
|
||||
.await
|
||||
.map_err(|error| big_fish_error_response(&request_context, map_big_fish_client_error(error)))?;
|
||||
|
||||
Ok(json_success_body(
|
||||
Some(&request_context),
|
||||
BigFishRunResponse {
|
||||
run: map_big_fish_runtime_response(run),
|
||||
},
|
||||
))
|
||||
}
|
||||
|
||||
fn map_big_fish_session_response(session: BigFishSessionRecord) -> BigFishSessionSnapshotResponse {
|
||||
BigFishSessionSnapshotResponse {
|
||||
session_id: session.session_id,
|
||||
current_turn: session.current_turn,
|
||||
progress_percent: session.progress_percent,
|
||||
stage: session.stage,
|
||||
anchor_pack: map_big_fish_anchor_pack_response(session.anchor_pack),
|
||||
draft: session.draft.map(map_big_fish_draft_response),
|
||||
asset_slots: session
|
||||
.asset_slots
|
||||
.into_iter()
|
||||
.map(map_big_fish_asset_slot_response)
|
||||
.collect(),
|
||||
asset_coverage: map_big_fish_asset_coverage_response(session.asset_coverage),
|
||||
messages: session
|
||||
.messages
|
||||
.into_iter()
|
||||
.map(map_big_fish_agent_message_response)
|
||||
.collect(),
|
||||
last_assistant_reply: session.last_assistant_reply,
|
||||
publish_ready: session.publish_ready,
|
||||
updated_at: session.updated_at,
|
||||
}
|
||||
}
|
||||
|
||||
fn map_big_fish_anchor_pack_response(anchor_pack: BigFishAnchorPackRecord) -> BigFishAnchorPackResponse {
|
||||
BigFishAnchorPackResponse {
|
||||
gameplay_promise: map_big_fish_anchor_item_response(anchor_pack.gameplay_promise),
|
||||
ecology_visual_theme: map_big_fish_anchor_item_response(anchor_pack.ecology_visual_theme),
|
||||
growth_ladder: map_big_fish_anchor_item_response(anchor_pack.growth_ladder),
|
||||
risk_tempo: map_big_fish_anchor_item_response(anchor_pack.risk_tempo),
|
||||
}
|
||||
}
|
||||
|
||||
fn map_big_fish_anchor_item_response(anchor: BigFishAnchorItemRecord) -> BigFishAnchorItemResponse {
|
||||
BigFishAnchorItemResponse {
|
||||
key: anchor.key,
|
||||
label: anchor.label,
|
||||
value: anchor.value,
|
||||
status: anchor.status,
|
||||
}
|
||||
}
|
||||
|
||||
fn map_big_fish_draft_response(draft: BigFishGameDraftRecord) -> BigFishGameDraftResponse {
|
||||
BigFishGameDraftResponse {
|
||||
title: draft.title,
|
||||
subtitle: draft.subtitle,
|
||||
core_fun: draft.core_fun,
|
||||
ecology_theme: draft.ecology_theme,
|
||||
levels: draft
|
||||
.levels
|
||||
.into_iter()
|
||||
.map(map_big_fish_level_response)
|
||||
.collect(),
|
||||
background: map_big_fish_background_response(draft.background),
|
||||
runtime_params: map_big_fish_runtime_params_response(draft.runtime_params),
|
||||
}
|
||||
}
|
||||
|
||||
fn map_big_fish_level_response(level: BigFishLevelBlueprintRecord) -> BigFishLevelBlueprintResponse {
|
||||
BigFishLevelBlueprintResponse {
|
||||
level: level.level,
|
||||
name: level.name,
|
||||
one_line_fantasy: level.one_line_fantasy,
|
||||
silhouette_direction: level.silhouette_direction,
|
||||
size_ratio: level.size_ratio,
|
||||
visual_prompt_seed: level.visual_prompt_seed,
|
||||
motion_prompt_seed: level.motion_prompt_seed,
|
||||
merge_source_level: level.merge_source_level,
|
||||
prey_window: level.prey_window,
|
||||
threat_window: level.threat_window,
|
||||
is_final_level: level.is_final_level,
|
||||
}
|
||||
}
|
||||
|
||||
fn map_big_fish_background_response(
|
||||
background: BigFishBackgroundBlueprintRecord,
|
||||
) -> BigFishBackgroundBlueprintResponse {
|
||||
BigFishBackgroundBlueprintResponse {
|
||||
theme: background.theme,
|
||||
color_mood: background.color_mood,
|
||||
foreground_hints: background.foreground_hints,
|
||||
midground_composition: background.midground_composition,
|
||||
background_depth: background.background_depth,
|
||||
safe_play_area_hint: background.safe_play_area_hint,
|
||||
spawn_edge_hint: background.spawn_edge_hint,
|
||||
background_prompt_seed: background.background_prompt_seed,
|
||||
}
|
||||
}
|
||||
|
||||
fn map_big_fish_runtime_params_response(
|
||||
params: BigFishRuntimeParamsRecord,
|
||||
) -> BigFishRuntimeParamsResponse {
|
||||
BigFishRuntimeParamsResponse {
|
||||
level_count: params.level_count,
|
||||
merge_count_per_upgrade: params.merge_count_per_upgrade,
|
||||
spawn_target_count: params.spawn_target_count,
|
||||
leader_move_speed: params.leader_move_speed,
|
||||
follower_catch_up_speed: params.follower_catch_up_speed,
|
||||
offscreen_cull_seconds: params.offscreen_cull_seconds,
|
||||
prey_spawn_delta_levels: params.prey_spawn_delta_levels,
|
||||
threat_spawn_delta_levels: params.threat_spawn_delta_levels,
|
||||
win_level: params.win_level,
|
||||
}
|
||||
}
|
||||
|
||||
fn map_big_fish_asset_slot_response(slot: BigFishAssetSlotRecord) -> BigFishAssetSlotResponse {
|
||||
BigFishAssetSlotResponse {
|
||||
slot_id: slot.slot_id,
|
||||
asset_kind: slot.asset_kind,
|
||||
level: slot.level,
|
||||
motion_key: slot.motion_key,
|
||||
status: slot.status,
|
||||
asset_url: slot.asset_url,
|
||||
prompt_snapshot: slot.prompt_snapshot,
|
||||
updated_at: slot.updated_at,
|
||||
}
|
||||
}
|
||||
|
||||
fn map_big_fish_asset_coverage_response(
|
||||
coverage: BigFishAssetCoverageRecord,
|
||||
) -> BigFishAssetCoverageResponse {
|
||||
BigFishAssetCoverageResponse {
|
||||
level_main_image_ready_count: coverage.level_main_image_ready_count,
|
||||
level_motion_ready_count: coverage.level_motion_ready_count,
|
||||
background_ready: coverage.background_ready,
|
||||
required_level_count: coverage.required_level_count,
|
||||
publish_ready: coverage.publish_ready,
|
||||
blockers: coverage.blockers,
|
||||
}
|
||||
}
|
||||
|
||||
fn map_big_fish_agent_message_response(
|
||||
message: BigFishAgentMessageRecord,
|
||||
) -> BigFishAgentMessageResponse {
|
||||
BigFishAgentMessageResponse {
|
||||
id: message.message_id,
|
||||
role: message.role,
|
||||
kind: message.kind,
|
||||
text: message.text,
|
||||
created_at: message.created_at,
|
||||
}
|
||||
}
|
||||
|
||||
fn map_big_fish_runtime_response(run: BigFishRuntimeRecord) -> BigFishRuntimeSnapshotResponse {
|
||||
BigFishRuntimeSnapshotResponse {
|
||||
run_id: run.run_id,
|
||||
session_id: run.session_id,
|
||||
status: run.status,
|
||||
tick: run.tick,
|
||||
player_level: run.player_level,
|
||||
win_level: run.win_level,
|
||||
leader_entity_id: run.leader_entity_id,
|
||||
owned_entities: run
|
||||
.owned_entities
|
||||
.into_iter()
|
||||
.map(map_big_fish_entity_response)
|
||||
.collect(),
|
||||
wild_entities: run
|
||||
.wild_entities
|
||||
.into_iter()
|
||||
.map(map_big_fish_entity_response)
|
||||
.collect(),
|
||||
camera_center: map_big_fish_vector_response(run.camera_center),
|
||||
last_input: map_big_fish_vector_response(run.last_input),
|
||||
event_log: run.event_log,
|
||||
updated_at: run.updated_at,
|
||||
}
|
||||
}
|
||||
|
||||
fn map_big_fish_entity_response(entity: BigFishRuntimeEntityRecord) -> BigFishRuntimeEntityResponse {
|
||||
BigFishRuntimeEntityResponse {
|
||||
entity_id: entity.entity_id,
|
||||
level: entity.level,
|
||||
position: map_big_fish_vector_response(entity.position),
|
||||
radius: entity.radius,
|
||||
offscreen_seconds: entity.offscreen_seconds,
|
||||
}
|
||||
}
|
||||
|
||||
fn map_big_fish_vector_response(vector: BigFishVector2Record) -> BigFishVector2Response {
|
||||
BigFishVector2Response {
|
||||
x: vector.x,
|
||||
y: vector.y,
|
||||
}
|
||||
}
|
||||
|
||||
fn build_big_fish_welcome_text(seed_text: &str) -> String {
|
||||
if seed_text.trim().is_empty() {
|
||||
return "我会先帮你确定大鱼吃小鱼的核心锚点。可以从主题生态、成长阶梯或风险节奏开始。".to_string();
|
||||
}
|
||||
"我已经收到你的玩法起点,会先把它整理成锚点并准备结果页草稿。".to_string()
|
||||
}
|
||||
|
||||
fn ensure_non_empty(
|
||||
request_context: &RequestContext,
|
||||
value: &str,
|
||||
field_name: &str,
|
||||
) -> Result<(), Response> {
|
||||
if value.trim().is_empty() {
|
||||
return Err(big_fish_bad_request(
|
||||
request_context,
|
||||
format!("{field_name} is required").as_str(),
|
||||
));
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn big_fish_bad_request(request_context: &RequestContext, message: &str) -> Response {
|
||||
big_fish_error_response(
|
||||
request_context,
|
||||
AppError::from_status(StatusCode::BAD_REQUEST).with_details(json!({
|
||||
"provider": "big-fish",
|
||||
"message": message,
|
||||
})),
|
||||
)
|
||||
}
|
||||
|
||||
fn append_sse_event(
|
||||
request_context: &RequestContext,
|
||||
body: &mut String,
|
||||
event: &str,
|
||||
payload: &Value,
|
||||
) -> Result<(), Response> {
|
||||
let payload_text = serde_json::to_string(payload).map_err(|error| {
|
||||
big_fish_error_response(
|
||||
request_context,
|
||||
AppError::from_status(StatusCode::INTERNAL_SERVER_ERROR).with_details(json!({
|
||||
"provider": "big-fish",
|
||||
"message": format!("SSE payload 序列化失败:{error}"),
|
||||
})),
|
||||
)
|
||||
})?;
|
||||
body.push_str("event: ");
|
||||
body.push_str(event);
|
||||
body.push('\n');
|
||||
body.push_str("data: ");
|
||||
body.push_str(&payload_text);
|
||||
body.push_str("\n\n");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn build_event_stream_response(body: String) -> Response {
|
||||
(
|
||||
[
|
||||
(header::CONTENT_TYPE, "text/event-stream; charset=utf-8"),
|
||||
(header::CACHE_CONTROL, "no-cache"),
|
||||
(HeaderName::from_static("x-accel-buffering"), "no"),
|
||||
],
|
||||
body,
|
||||
)
|
||||
.into_response()
|
||||
}
|
||||
|
||||
fn map_big_fish_client_error(error: SpacetimeClientError) -> AppError {
|
||||
let status = match &error {
|
||||
SpacetimeClientError::Procedure(message)
|
||||
if message.contains("big_fish_creation_session 不存在")
|
||||
|| message.contains("big_fish_runtime_run 不存在") =>
|
||||
{
|
||||
StatusCode::NOT_FOUND
|
||||
}
|
||||
SpacetimeClientError::Procedure(message)
|
||||
if message.contains("不能为空")
|
||||
|| message.contains("尚未编译")
|
||||
|| message.contains("不允许")
|
||||
|| message.contains("非法")
|
||||
|| message.contains("缺少") =>
|
||||
{
|
||||
StatusCode::BAD_REQUEST
|
||||
}
|
||||
SpacetimeClientError::Runtime(_) => StatusCode::BAD_REQUEST,
|
||||
_ => StatusCode::BAD_GATEWAY,
|
||||
};
|
||||
|
||||
AppError::from_status(status).with_details(json!({
|
||||
"provider": "spacetimedb",
|
||||
"message": error.to_string(),
|
||||
}))
|
||||
}
|
||||
|
||||
fn big_fish_error_response(request_context: &RequestContext, error: AppError) -> Response {
|
||||
error.into_response_with_context(Some(request_context))
|
||||
}
|
||||
|
||||
fn current_utc_micros() -> i64 {
|
||||
use std::time::{SystemTime, UNIX_EPOCH};
|
||||
|
||||
let duration = SystemTime::now()
|
||||
.duration_since(UNIX_EPOCH)
|
||||
.expect("system clock should be after unix epoch");
|
||||
i64::try_from(duration.as_micros()).expect("current unix micros should fit in i64")
|
||||
}
|
||||
@@ -6,6 +6,7 @@ use platform_llm::{
|
||||
};
|
||||
|
||||
const DEFAULT_LLM_MODEL: &str = "doubao-1-5-pro-32k-character-250715";
|
||||
const DEFAULT_INTERNAL_API_SECRET: &str = "genarrative-dev-internal-bridge";
|
||||
|
||||
// 集中管理 api-server 的启动配置,避免入口层直接散落环境变量解析逻辑。
|
||||
#[derive(Clone, Debug)]
|
||||
@@ -13,6 +14,7 @@ pub struct AppConfig {
|
||||
pub bind_host: String,
|
||||
pub bind_port: u16,
|
||||
pub log_filter: String,
|
||||
pub internal_api_secret: Option<String>,
|
||||
pub jwt_issuer: String,
|
||||
pub jwt_secret: String,
|
||||
pub jwt_access_token_ttl_seconds: u64,
|
||||
@@ -62,6 +64,7 @@ impl Default for AppConfig {
|
||||
bind_host: "127.0.0.1".to_string(),
|
||||
bind_port: 3000,
|
||||
log_filter: "info,tower_http=info".to_string(),
|
||||
internal_api_secret: Some(DEFAULT_INTERNAL_API_SECRET.to_string()),
|
||||
jwt_issuer: "https://auth.genarrative.local".to_string(),
|
||||
jwt_secret: "genarrative-dev-secret".to_string(),
|
||||
jwt_access_token_ttl_seconds: 2 * 60 * 60,
|
||||
@@ -130,6 +133,9 @@ impl AppConfig {
|
||||
config.log_filter = log_filter;
|
||||
}
|
||||
|
||||
config.internal_api_secret =
|
||||
read_first_non_empty_env(&["GENARRATIVE_INTERNAL_API_SECRET"]);
|
||||
|
||||
if let Some(jwt_issuer) =
|
||||
read_first_non_empty_env(&["GENARRATIVE_JWT_ISSUER", "JWT_ISSUER"])
|
||||
{
|
||||
|
||||
@@ -6,6 +6,7 @@ mod auth;
|
||||
mod auth_me;
|
||||
mod auth_session;
|
||||
mod auth_sessions;
|
||||
mod big_fish;
|
||||
mod config;
|
||||
mod custom_world;
|
||||
mod custom_world_ai;
|
||||
@@ -18,6 +19,7 @@ mod logout;
|
||||
mod logout_all;
|
||||
mod password_entry;
|
||||
mod phone_auth;
|
||||
mod puzzle;
|
||||
mod refresh_session;
|
||||
mod request_context;
|
||||
mod response_headers;
|
||||
|
||||
1394
server-rs/crates/api-server/src/puzzle.rs
Normal file
1394
server-rs/crates/api-server/src/puzzle.rs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
use axum::{
|
||||
Json,
|
||||
extract::{Extension, State},
|
||||
extract::{Extension, Path, State, rejection::JsonRejection},
|
||||
http::StatusCode,
|
||||
response::Response,
|
||||
};
|
||||
@@ -54,6 +54,91 @@ pub async fn resolve_runtime_story_state(
|
||||
))
|
||||
}
|
||||
|
||||
pub async fn get_runtime_story_state(
|
||||
State(_state): State<AppState>,
|
||||
Path(session_id): Path<String>,
|
||||
Extension(request_context): Extension<RequestContext>,
|
||||
Extension(_authenticated): Extension<AuthenticatedAccessToken>,
|
||||
) -> Result<Json<Value>, Response> {
|
||||
let session_id = normalize_required_string(session_id.as_str()).ok_or_else(|| {
|
||||
runtime_story_error_response(
|
||||
&request_context,
|
||||
AppError::from_status(StatusCode::BAD_REQUEST).with_details(json!({
|
||||
"provider": "runtime-story",
|
||||
"field": "sessionId",
|
||||
"message": "sessionId 不能为空",
|
||||
})),
|
||||
)
|
||||
})?;
|
||||
|
||||
Ok(json_success_body(
|
||||
Some(&request_context),
|
||||
build_runtime_story_state_response(&session_id, None, build_runtime_story_empty_snapshot(&session_id)),
|
||||
))
|
||||
}
|
||||
|
||||
pub async fn resolve_runtime_story_action(
|
||||
State(_state): State<AppState>,
|
||||
Extension(request_context): Extension<RequestContext>,
|
||||
Extension(_authenticated): Extension<AuthenticatedAccessToken>,
|
||||
payload: Result<Json<Value>, JsonRejection>,
|
||||
) -> Result<Json<Value>, Response> {
|
||||
let payload = optional_runtime_story_payload(payload)?;
|
||||
let session_id = read_payload_session_id(&payload).ok_or_else(|| {
|
||||
runtime_story_error_response(
|
||||
&request_context,
|
||||
AppError::from_status(StatusCode::BAD_REQUEST).with_details(json!({
|
||||
"provider": "runtime-story",
|
||||
"field": "sessionId",
|
||||
"message": "sessionId 不能为空",
|
||||
})),
|
||||
)
|
||||
})?;
|
||||
let client_version = read_u32_field(&payload, "clientVersion");
|
||||
let snapshot = read_payload_snapshot(&payload)
|
||||
.unwrap_or_else(|| build_runtime_story_empty_snapshot(&session_id));
|
||||
let mut response = build_runtime_story_state_response(&session_id, client_version, snapshot);
|
||||
response.presentation.action_text = read_runtime_story_action_text(&payload).unwrap_or_default();
|
||||
|
||||
Ok(json_success_body(Some(&request_context), response))
|
||||
}
|
||||
|
||||
pub async fn generate_runtime_story_initial(
|
||||
State(_state): State<AppState>,
|
||||
Extension(request_context): Extension<RequestContext>,
|
||||
Extension(_authenticated): Extension<AuthenticatedAccessToken>,
|
||||
payload: Result<Json<Value>, JsonRejection>,
|
||||
) -> Result<Json<Value>, Response> {
|
||||
let payload = optional_runtime_story_payload(payload)?;
|
||||
let session_id = read_payload_session_id(&payload).unwrap_or_else(|| "runtime-main".to_string());
|
||||
let client_version = read_u32_field(&payload, "clientVersion");
|
||||
let snapshot = read_payload_snapshot(&payload)
|
||||
.unwrap_or_else(|| build_runtime_story_empty_snapshot(&session_id));
|
||||
|
||||
Ok(json_success_body(
|
||||
Some(&request_context),
|
||||
build_runtime_story_state_response(&session_id, client_version, snapshot),
|
||||
))
|
||||
}
|
||||
|
||||
pub async fn generate_runtime_story_continue(
|
||||
State(_state): State<AppState>,
|
||||
Extension(request_context): Extension<RequestContext>,
|
||||
Extension(_authenticated): Extension<AuthenticatedAccessToken>,
|
||||
payload: Result<Json<Value>, JsonRejection>,
|
||||
) -> Result<Json<Value>, Response> {
|
||||
let payload = optional_runtime_story_payload(payload)?;
|
||||
let session_id = read_payload_session_id(&payload).unwrap_or_else(|| "runtime-main".to_string());
|
||||
let client_version = read_u32_field(&payload, "clientVersion");
|
||||
let snapshot = read_payload_snapshot(&payload)
|
||||
.unwrap_or_else(|| build_runtime_story_empty_snapshot(&session_id));
|
||||
|
||||
Ok(json_success_body(
|
||||
Some(&request_context),
|
||||
build_runtime_story_state_response(&session_id, client_version, snapshot),
|
||||
))
|
||||
}
|
||||
|
||||
fn build_runtime_story_state_response(
|
||||
requested_session_id: &str,
|
||||
client_version: Option<u32>,
|
||||
@@ -107,6 +192,61 @@ fn build_runtime_story_state_response(
|
||||
}
|
||||
}
|
||||
|
||||
fn optional_runtime_story_payload(
|
||||
payload: Result<Json<Value>, JsonRejection>,
|
||||
) -> Result<Value, Response> {
|
||||
match payload {
|
||||
Ok(Json(value)) => Ok(value),
|
||||
Err(error) if error.status() == StatusCode::UNSUPPORTED_MEDIA_TYPE => Ok(json!({})),
|
||||
Err(error) if error.status() == StatusCode::BAD_REQUEST => Ok(json!({})),
|
||||
Err(error) => Err(AppError::from_status(StatusCode::BAD_REQUEST)
|
||||
.with_details(json!({
|
||||
"provider": "runtime-story",
|
||||
"message": error.body_text(),
|
||||
}))
|
||||
.into_response_with_context(None)),
|
||||
}
|
||||
}
|
||||
|
||||
fn read_payload_session_id(payload: &Value) -> Option<String> {
|
||||
read_required_string_field(payload, "sessionId")
|
||||
.or_else(|| read_field(payload, "action").and_then(|action| read_required_string_field(action, "sessionId")))
|
||||
.or_else(|| read_field(payload, "snapshot").and_then(|snapshot| {
|
||||
read_object_field(snapshot, "gameState").and_then(read_runtime_session_id)
|
||||
}))
|
||||
}
|
||||
|
||||
fn read_payload_snapshot(payload: &Value) -> Option<RuntimeStorySnapshotPayload> {
|
||||
let snapshot = read_field(payload, "snapshot")?.clone();
|
||||
serde_json::from_value(snapshot).ok()
|
||||
}
|
||||
|
||||
fn read_runtime_story_action_text(payload: &Value) -> Option<String> {
|
||||
let action = read_field(payload, "action")?;
|
||||
read_optional_string_field(action, "functionId")
|
||||
.or_else(|| read_optional_string_field(action, "type"))
|
||||
}
|
||||
|
||||
fn build_runtime_story_empty_snapshot(session_id: &str) -> RuntimeStorySnapshotPayload {
|
||||
RuntimeStorySnapshotPayload {
|
||||
saved_at: time::OffsetDateTime::now_utc()
|
||||
.format(&time::format_description::well_known::Rfc3339)
|
||||
.unwrap_or_else(|_| "1970-01-01T00:00:00Z".to_string()),
|
||||
bottom_tab: "adventure".to_string(),
|
||||
game_state: json!({
|
||||
"runtimeSessionId": session_id,
|
||||
"runtimeActionVersion": 0,
|
||||
"playerHp": 1,
|
||||
"playerMaxHp": 1,
|
||||
"playerMana": 0,
|
||||
"playerMaxMana": 1,
|
||||
"inBattle": false,
|
||||
"npcInteractionActive": false
|
||||
}),
|
||||
current_story: None,
|
||||
}
|
||||
}
|
||||
|
||||
fn build_runtime_story_companions(game_state: &Value) -> Vec<RuntimeStoryCompanionViewModel> {
|
||||
read_array_field(game_state, "companions")
|
||||
.into_iter()
|
||||
|
||||
15
server-rs/crates/module-big-fish/Cargo.toml
Normal file
15
server-rs/crates/module-big-fish/Cargo.toml
Normal file
@@ -0,0 +1,15 @@
|
||||
[package]
|
||||
name = "module-big-fish"
|
||||
edition.workspace = true
|
||||
version.workspace = true
|
||||
license.workspace = true
|
||||
|
||||
[features]
|
||||
default = []
|
||||
spacetime-types = ["dep:spacetimedb"]
|
||||
|
||||
[dependencies]
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
shared-kernel = { path = "../shared-kernel" }
|
||||
spacetimedb = { workspace = true, optional = true }
|
||||
1385
server-rs/crates/module-big-fish/src/lib.rs
Normal file
1385
server-rs/crates/module-big-fish/src/lib.rs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -153,6 +153,7 @@ pub enum CustomWorldFieldError {
|
||||
MissingMessageText,
|
||||
MissingOperationId,
|
||||
MissingPhaseLabel,
|
||||
MissingAction,
|
||||
InvalidProgressPercent,
|
||||
MissingCardId,
|
||||
MissingCardTitle,
|
||||
@@ -290,6 +291,7 @@ pub struct CustomWorldAgentSessionSnapshot {
|
||||
pub lock_state_json: Option<String>,
|
||||
pub draft_profile_json: Option<String>,
|
||||
pub last_assistant_reply: Option<String>,
|
||||
pub publish_gate_json: Option<String>,
|
||||
pub result_preview_json: Option<String>,
|
||||
pub pending_clarifications_json: String,
|
||||
pub quality_findings_json: String,
|
||||
@@ -297,6 +299,7 @@ pub struct CustomWorldAgentSessionSnapshot {
|
||||
pub recommended_replies_json: String,
|
||||
pub asset_coverage_json: String,
|
||||
pub checkpoints_json: String,
|
||||
pub supported_actions_json: String,
|
||||
pub messages: Vec<CustomWorldAgentMessageSnapshot>,
|
||||
pub draft_cards: Vec<CustomWorldDraftCardSnapshot>,
|
||||
pub operations: Vec<CustomWorldAgentOperationSnapshot>,
|
||||
@@ -425,6 +428,126 @@ pub struct CustomWorldAgentOperationProcedureResult {
|
||||
pub error_message: Option<String>,
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct CustomWorldWorksListInput {
|
||||
pub owner_user_id: String,
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct CustomWorldPublishBlockerSnapshot {
|
||||
pub blocker_id: String,
|
||||
pub code: String,
|
||||
pub message: String,
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct CustomWorldPublishGateSnapshot {
|
||||
pub profile_id: String,
|
||||
pub blockers: Vec<CustomWorldPublishBlockerSnapshot>,
|
||||
pub blocker_count: u32,
|
||||
pub publish_ready: bool,
|
||||
pub can_enter_world: bool,
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct CustomWorldWorkSummarySnapshot {
|
||||
pub work_id: String,
|
||||
pub source_type: String,
|
||||
pub status: String,
|
||||
pub title: String,
|
||||
pub subtitle: String,
|
||||
pub summary: String,
|
||||
pub cover_image_src: Option<String>,
|
||||
pub cover_render_mode: Option<String>,
|
||||
pub cover_character_image_srcs_json: String,
|
||||
pub updated_at_micros: i64,
|
||||
pub published_at_micros: Option<i64>,
|
||||
pub stage: Option<RpgAgentStage>,
|
||||
pub stage_label: Option<String>,
|
||||
pub playable_npc_count: u32,
|
||||
pub landmark_count: u32,
|
||||
pub role_visual_ready_count: Option<u32>,
|
||||
pub role_animation_ready_count: Option<u32>,
|
||||
pub role_asset_summary_label: Option<String>,
|
||||
pub session_id: Option<String>,
|
||||
pub profile_id: Option<String>,
|
||||
pub can_resume: bool,
|
||||
pub can_enter_world: bool,
|
||||
pub blocker_count: u32,
|
||||
pub publish_ready: bool,
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct CustomWorldWorksListResult {
|
||||
pub ok: bool,
|
||||
pub items: Vec<CustomWorldWorkSummarySnapshot>,
|
||||
pub error_message: Option<String>,
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct CustomWorldAgentCardDetailGetInput {
|
||||
pub session_id: String,
|
||||
pub owner_user_id: String,
|
||||
pub card_id: String,
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct CustomWorldDraftCardDetailSectionSnapshot {
|
||||
pub section_id: String,
|
||||
pub label: String,
|
||||
pub value: String,
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct CustomWorldDraftCardDetailSnapshot {
|
||||
pub card_id: String,
|
||||
pub kind: RpgAgentDraftCardKind,
|
||||
pub title: String,
|
||||
pub sections: Vec<CustomWorldDraftCardDetailSectionSnapshot>,
|
||||
pub linked_ids_json: String,
|
||||
pub locked: bool,
|
||||
pub editable: bool,
|
||||
pub editable_section_ids_json: String,
|
||||
pub warning_messages_json: String,
|
||||
pub asset_status: Option<CustomWorldRoleAssetStatus>,
|
||||
pub asset_status_label: Option<String>,
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct CustomWorldDraftCardDetailResult {
|
||||
pub ok: bool,
|
||||
pub card: Option<CustomWorldDraftCardDetailSnapshot>,
|
||||
pub error_message: Option<String>,
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct CustomWorldAgentActionExecuteInput {
|
||||
pub session_id: String,
|
||||
pub owner_user_id: String,
|
||||
pub operation_id: String,
|
||||
pub action: String,
|
||||
pub payload_json: Option<String>,
|
||||
pub submitted_at_micros: i64,
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct CustomWorldAgentActionExecuteResult {
|
||||
pub ok: bool,
|
||||
pub operation: Option<CustomWorldAgentOperationSnapshot>,
|
||||
pub error_message: Option<String>,
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct CustomWorldPublishedProfileCompileInput {
|
||||
@@ -941,6 +1064,52 @@ pub fn validate_custom_world_agent_operation_get_input(
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn validate_custom_world_works_list_input(
|
||||
input: &CustomWorldWorksListInput,
|
||||
) -> Result<(), CustomWorldFieldError> {
|
||||
if input.owner_user_id.trim().is_empty() {
|
||||
return Err(CustomWorldFieldError::MissingOwnerUserId);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn validate_custom_world_agent_card_detail_get_input(
|
||||
input: &CustomWorldAgentCardDetailGetInput,
|
||||
) -> Result<(), CustomWorldFieldError> {
|
||||
if input.session_id.trim().is_empty() {
|
||||
return Err(CustomWorldFieldError::MissingSessionId);
|
||||
}
|
||||
if input.owner_user_id.trim().is_empty() {
|
||||
return Err(CustomWorldFieldError::MissingOwnerUserId);
|
||||
}
|
||||
if input.card_id.trim().is_empty() {
|
||||
return Err(CustomWorldFieldError::MissingCardId);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn validate_custom_world_agent_action_execute_input(
|
||||
input: &CustomWorldAgentActionExecuteInput,
|
||||
) -> Result<(), CustomWorldFieldError> {
|
||||
validate_custom_world_agent_operation_get_input(&CustomWorldAgentOperationGetInput {
|
||||
session_id: input.session_id.clone(),
|
||||
owner_user_id: input.owner_user_id.clone(),
|
||||
operation_id: input.operation_id.clone(),
|
||||
})?;
|
||||
if input.action.trim().is_empty() {
|
||||
return Err(CustomWorldFieldError::MissingAction);
|
||||
}
|
||||
if let Some(payload_json) = input.payload_json.as_deref() {
|
||||
if !payload_json.trim().is_empty() {
|
||||
ensure_json_object(payload_json)?;
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn validate_custom_world_agent_message_fields(
|
||||
message_id: &str,
|
||||
session_id: &str,
|
||||
@@ -1321,6 +1490,7 @@ impl fmt::Display for CustomWorldFieldError {
|
||||
Self::MissingPhaseLabel => {
|
||||
f.write_str("custom_world_agent_operation.phase_label 不能为空")
|
||||
}
|
||||
Self::MissingAction => f.write_str("custom_world_agent_action.action 不能为空"),
|
||||
Self::InvalidProgressPercent => f.write_str("progress 必须位于 0~100"),
|
||||
Self::MissingCardId => f.write_str("custom_world_draft_card.card_id 不能为空"),
|
||||
Self::MissingCardTitle => f.write_str("custom_world_draft_card.title 不能为空"),
|
||||
|
||||
15
server-rs/crates/module-puzzle/Cargo.toml
Normal file
15
server-rs/crates/module-puzzle/Cargo.toml
Normal file
@@ -0,0 +1,15 @@
|
||||
[package]
|
||||
name = "module-puzzle"
|
||||
edition.workspace = true
|
||||
version.workspace = true
|
||||
license.workspace = true
|
||||
|
||||
[features]
|
||||
default = []
|
||||
spacetime-types = ["dep:spacetimedb"]
|
||||
|
||||
[dependencies]
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
shared-kernel = { path = "../shared-kernel" }
|
||||
spacetimedb = { workspace = true, optional = true }
|
||||
1538
server-rs/crates/module-puzzle/src/lib.rs
Normal file
1538
server-rs/crates/module-puzzle/src/lib.rs
Normal file
File diff suppressed because it is too large
Load Diff
238
server-rs/crates/shared-contracts/src/big_fish.rs
Normal file
238
server-rs/crates/shared-contracts/src/big_fish.rs
Normal file
@@ -0,0 +1,238 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct CreateBigFishSessionRequest {
|
||||
#[serde(default)]
|
||||
pub seed_text: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct SendBigFishMessageRequest {
|
||||
pub client_message_id: String,
|
||||
pub text: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ExecuteBigFishActionRequest {
|
||||
pub action: String,
|
||||
#[serde(default)]
|
||||
pub level: Option<u32>,
|
||||
#[serde(default)]
|
||||
pub motion_key: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct SubmitBigFishInputRequest {
|
||||
pub x: f32,
|
||||
pub y: f32,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct BigFishAnchorItemResponse {
|
||||
pub key: String,
|
||||
pub label: String,
|
||||
pub value: String,
|
||||
pub status: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct BigFishAnchorPackResponse {
|
||||
pub gameplay_promise: BigFishAnchorItemResponse,
|
||||
pub ecology_visual_theme: BigFishAnchorItemResponse,
|
||||
pub growth_ladder: BigFishAnchorItemResponse,
|
||||
pub risk_tempo: BigFishAnchorItemResponse,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct BigFishLevelBlueprintResponse {
|
||||
pub level: u32,
|
||||
pub name: String,
|
||||
pub one_line_fantasy: String,
|
||||
pub silhouette_direction: String,
|
||||
pub size_ratio: f32,
|
||||
pub visual_prompt_seed: String,
|
||||
pub motion_prompt_seed: String,
|
||||
pub merge_source_level: Option<u32>,
|
||||
pub prey_window: Vec<u32>,
|
||||
pub threat_window: Vec<u32>,
|
||||
pub is_final_level: bool,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct BigFishBackgroundBlueprintResponse {
|
||||
pub theme: String,
|
||||
pub color_mood: String,
|
||||
pub foreground_hints: String,
|
||||
pub midground_composition: String,
|
||||
pub background_depth: String,
|
||||
pub safe_play_area_hint: String,
|
||||
pub spawn_edge_hint: String,
|
||||
pub background_prompt_seed: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct BigFishRuntimeParamsResponse {
|
||||
pub level_count: u32,
|
||||
pub merge_count_per_upgrade: u32,
|
||||
pub spawn_target_count: u32,
|
||||
pub leader_move_speed: f32,
|
||||
pub follower_catch_up_speed: f32,
|
||||
pub offscreen_cull_seconds: f32,
|
||||
pub prey_spawn_delta_levels: Vec<u32>,
|
||||
pub threat_spawn_delta_levels: Vec<u32>,
|
||||
pub win_level: u32,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct BigFishGameDraftResponse {
|
||||
pub title: String,
|
||||
pub subtitle: String,
|
||||
pub core_fun: String,
|
||||
pub ecology_theme: String,
|
||||
pub levels: Vec<BigFishLevelBlueprintResponse>,
|
||||
pub background: BigFishBackgroundBlueprintResponse,
|
||||
pub runtime_params: BigFishRuntimeParamsResponse,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct BigFishAgentMessageResponse {
|
||||
pub id: String,
|
||||
pub role: String,
|
||||
pub kind: String,
|
||||
pub text: String,
|
||||
pub created_at: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct BigFishAssetSlotResponse {
|
||||
pub slot_id: String,
|
||||
pub asset_kind: String,
|
||||
pub level: Option<u32>,
|
||||
pub motion_key: Option<String>,
|
||||
pub status: String,
|
||||
pub asset_url: Option<String>,
|
||||
pub prompt_snapshot: String,
|
||||
pub updated_at: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct BigFishAssetCoverageResponse {
|
||||
pub level_main_image_ready_count: u32,
|
||||
pub level_motion_ready_count: u32,
|
||||
pub background_ready: bool,
|
||||
pub required_level_count: u32,
|
||||
pub publish_ready: bool,
|
||||
pub blockers: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct BigFishSessionSnapshotResponse {
|
||||
pub session_id: String,
|
||||
pub current_turn: u32,
|
||||
pub progress_percent: u32,
|
||||
pub stage: String,
|
||||
pub anchor_pack: BigFishAnchorPackResponse,
|
||||
pub draft: Option<BigFishGameDraftResponse>,
|
||||
pub asset_slots: Vec<BigFishAssetSlotResponse>,
|
||||
pub asset_coverage: BigFishAssetCoverageResponse,
|
||||
pub messages: Vec<BigFishAgentMessageResponse>,
|
||||
pub last_assistant_reply: Option<String>,
|
||||
pub publish_ready: bool,
|
||||
pub updated_at: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct BigFishSessionResponse {
|
||||
pub session: BigFishSessionSnapshotResponse,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct BigFishActionResponse {
|
||||
pub session: BigFishSessionSnapshotResponse,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct BigFishVector2Response {
|
||||
pub x: f32,
|
||||
pub y: f32,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct BigFishRuntimeEntityResponse {
|
||||
pub entity_id: String,
|
||||
pub level: u32,
|
||||
pub position: BigFishVector2Response,
|
||||
pub radius: f32,
|
||||
pub offscreen_seconds: f32,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct BigFishRuntimeSnapshotResponse {
|
||||
pub run_id: String,
|
||||
pub session_id: String,
|
||||
pub status: String,
|
||||
pub tick: u64,
|
||||
pub player_level: u32,
|
||||
pub win_level: u32,
|
||||
pub leader_entity_id: Option<String>,
|
||||
pub owned_entities: Vec<BigFishRuntimeEntityResponse>,
|
||||
pub wild_entities: Vec<BigFishRuntimeEntityResponse>,
|
||||
pub camera_center: BigFishVector2Response,
|
||||
pub last_input: BigFishVector2Response,
|
||||
pub event_log: Vec<String>,
|
||||
pub updated_at: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct BigFishRunResponse {
|
||||
pub run: BigFishRuntimeSnapshotResponse,
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use serde_json::json;
|
||||
|
||||
#[test]
|
||||
fn big_fish_session_request_uses_camel_case() {
|
||||
let payload = serde_json::to_value(CreateBigFishSessionRequest {
|
||||
seed_text: Some("深海机械鱼".to_string()),
|
||||
})
|
||||
.expect("payload should serialize");
|
||||
|
||||
assert_eq!(payload, json!({ "seedText": "深海机械鱼" }));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn big_fish_action_request_uses_camel_case() {
|
||||
let payload = serde_json::to_value(ExecuteBigFishActionRequest {
|
||||
action: "big_fish_generate_level_motion".to_string(),
|
||||
level: Some(3),
|
||||
motion_key: Some("move_swim".to_string()),
|
||||
})
|
||||
.expect("payload should serialize");
|
||||
|
||||
assert_eq!(payload["motionKey"], json!("move_swim"));
|
||||
assert_eq!(payload["level"], json!(3));
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,12 @@ pub mod ai;
|
||||
pub mod api;
|
||||
pub mod assets;
|
||||
pub mod auth;
|
||||
pub mod big_fish;
|
||||
pub mod llm;
|
||||
pub mod puzzle_agent;
|
||||
pub mod puzzle_gallery;
|
||||
pub mod puzzle_runtime;
|
||||
pub mod puzzle_works;
|
||||
pub mod runtime;
|
||||
pub mod runtime_story;
|
||||
pub mod story;
|
||||
|
||||
188
server-rs/crates/shared-contracts/src/puzzle_agent.rs
Normal file
188
server-rs/crates/shared-contracts/src/puzzle_agent.rs
Normal file
@@ -0,0 +1,188 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct CreatePuzzleAgentSessionRequest {
|
||||
#[serde(default)]
|
||||
pub seed_text: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct SendPuzzleAgentMessageRequest {
|
||||
pub client_message_id: String,
|
||||
pub text: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ExecutePuzzleAgentActionRequest {
|
||||
pub action: String,
|
||||
#[serde(default)]
|
||||
pub prompt_text: Option<String>,
|
||||
#[serde(default)]
|
||||
pub candidate_count: Option<u32>,
|
||||
#[serde(default)]
|
||||
pub candidate_id: Option<String>,
|
||||
#[serde(default)]
|
||||
pub level_name: Option<String>,
|
||||
#[serde(default)]
|
||||
pub summary: Option<String>,
|
||||
#[serde(default)]
|
||||
pub theme_tags: Option<Vec<String>>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct PuzzleAnchorItemResponse {
|
||||
pub key: String,
|
||||
pub label: String,
|
||||
pub value: String,
|
||||
pub status: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct PuzzleAnchorPackResponse {
|
||||
pub theme_promise: PuzzleAnchorItemResponse,
|
||||
pub visual_subject: PuzzleAnchorItemResponse,
|
||||
pub visual_mood: PuzzleAnchorItemResponse,
|
||||
pub composition_hooks: PuzzleAnchorItemResponse,
|
||||
pub tags_and_forbidden: PuzzleAnchorItemResponse,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct PuzzleGeneratedImageCandidateResponse {
|
||||
pub candidate_id: String,
|
||||
pub image_src: String,
|
||||
pub asset_id: String,
|
||||
pub prompt: String,
|
||||
#[serde(default)]
|
||||
pub actual_prompt: Option<String>,
|
||||
pub source_type: String,
|
||||
pub selected: bool,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct PuzzleCreatorIntentResponse {
|
||||
pub source_mode: String,
|
||||
pub raw_messages_summary: String,
|
||||
pub theme_promise: String,
|
||||
pub visual_subject: String,
|
||||
pub visual_mood: Vec<String>,
|
||||
pub composition_hooks: Vec<String>,
|
||||
pub theme_tags: Vec<String>,
|
||||
pub forbidden_directives: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct PuzzleResultDraftResponse {
|
||||
pub level_name: String,
|
||||
pub summary: String,
|
||||
pub theme_tags: Vec<String>,
|
||||
pub forbidden_directives: Vec<String>,
|
||||
#[serde(default)]
|
||||
pub creator_intent: Option<PuzzleCreatorIntentResponse>,
|
||||
pub anchor_pack: PuzzleAnchorPackResponse,
|
||||
pub candidates: Vec<PuzzleGeneratedImageCandidateResponse>,
|
||||
#[serde(default)]
|
||||
pub selected_candidate_id: Option<String>,
|
||||
#[serde(default)]
|
||||
pub cover_image_src: Option<String>,
|
||||
#[serde(default)]
|
||||
pub cover_asset_id: Option<String>,
|
||||
pub generation_status: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct PuzzleAgentMessageResponse {
|
||||
pub id: String,
|
||||
pub role: String,
|
||||
pub kind: String,
|
||||
pub text: String,
|
||||
pub created_at: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct PuzzleAgentSuggestedActionResponse {
|
||||
pub id: String,
|
||||
pub action_type: String,
|
||||
pub label: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct PuzzleResultPreviewBlockerResponse {
|
||||
pub id: String,
|
||||
pub code: String,
|
||||
pub message: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct PuzzleResultPreviewFindingResponse {
|
||||
pub id: String,
|
||||
pub severity: String,
|
||||
pub code: String,
|
||||
pub message: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct PuzzleResultPreviewEnvelopeResponse {
|
||||
pub draft: PuzzleResultDraftResponse,
|
||||
pub blockers: Vec<PuzzleResultPreviewBlockerResponse>,
|
||||
pub quality_findings: Vec<PuzzleResultPreviewFindingResponse>,
|
||||
pub publish_ready: bool,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct PuzzleAgentSessionSnapshotResponse {
|
||||
pub session_id: String,
|
||||
pub current_turn: u32,
|
||||
pub progress_percent: u32,
|
||||
pub stage: String,
|
||||
pub anchor_pack: PuzzleAnchorPackResponse,
|
||||
#[serde(default)]
|
||||
pub draft: Option<PuzzleResultDraftResponse>,
|
||||
pub messages: Vec<PuzzleAgentMessageResponse>,
|
||||
#[serde(default)]
|
||||
pub last_assistant_reply: Option<String>,
|
||||
#[serde(default)]
|
||||
pub published_profile_id: Option<String>,
|
||||
pub suggested_actions: Vec<PuzzleAgentSuggestedActionResponse>,
|
||||
#[serde(default)]
|
||||
pub result_preview: Option<PuzzleResultPreviewEnvelopeResponse>,
|
||||
pub updated_at: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct PuzzleAgentSessionResponse {
|
||||
pub session: PuzzleAgentSessionSnapshotResponse,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct PuzzleAgentOperationResponse {
|
||||
pub operation_id: String,
|
||||
pub operation_type: String,
|
||||
pub status: String,
|
||||
pub phase_label: String,
|
||||
pub phase_detail: String,
|
||||
pub progress: u32,
|
||||
#[serde(default)]
|
||||
pub error: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct PuzzleAgentActionResponse {
|
||||
pub operation: PuzzleAgentOperationResponse,
|
||||
}
|
||||
15
server-rs/crates/shared-contracts/src/puzzle_gallery.rs
Normal file
15
server-rs/crates/shared-contracts/src/puzzle_gallery.rs
Normal file
@@ -0,0 +1,15 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::puzzle_works::PuzzleWorkSummaryResponse;
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct PuzzleGalleryResponse {
|
||||
pub items: Vec<PuzzleWorkSummaryResponse>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct PuzzleGalleryDetailResponse {
|
||||
pub item: PuzzleWorkSummaryResponse,
|
||||
}
|
||||
99
server-rs/crates/shared-contracts/src/puzzle_runtime.rs
Normal file
99
server-rs/crates/shared-contracts/src/puzzle_runtime.rs
Normal file
@@ -0,0 +1,99 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct StartPuzzleRunRequest {
|
||||
pub profile_id: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct SwapPuzzlePiecesRequest {
|
||||
pub first_piece_id: String,
|
||||
pub second_piece_id: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct DragPuzzlePieceRequest {
|
||||
pub piece_id: String,
|
||||
pub target_row: u32,
|
||||
pub target_col: u32,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct PuzzleCellPositionResponse {
|
||||
pub row: u32,
|
||||
pub col: u32,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct PuzzlePieceStateResponse {
|
||||
pub piece_id: String,
|
||||
pub correct_row: u32,
|
||||
pub correct_col: u32,
|
||||
pub current_row: u32,
|
||||
pub current_col: u32,
|
||||
#[serde(default)]
|
||||
pub merged_group_id: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct PuzzleMergedGroupStateResponse {
|
||||
pub group_id: String,
|
||||
pub piece_ids: Vec<String>,
|
||||
pub occupied_cells: Vec<PuzzleCellPositionResponse>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct PuzzleBoardSnapshotResponse {
|
||||
pub rows: u32,
|
||||
pub cols: u32,
|
||||
pub pieces: Vec<PuzzlePieceStateResponse>,
|
||||
pub merged_groups: Vec<PuzzleMergedGroupStateResponse>,
|
||||
#[serde(default)]
|
||||
pub selected_piece_id: Option<String>,
|
||||
pub all_tiles_resolved: bool,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct PuzzleRuntimeLevelSnapshotResponse {
|
||||
pub run_id: String,
|
||||
pub level_index: u32,
|
||||
pub grid_size: u32,
|
||||
pub profile_id: String,
|
||||
pub level_name: String,
|
||||
pub author_display_name: String,
|
||||
pub theme_tags: Vec<String>,
|
||||
#[serde(default)]
|
||||
pub cover_image_src: Option<String>,
|
||||
pub board: PuzzleBoardSnapshotResponse,
|
||||
pub status: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct PuzzleRunSnapshotResponse {
|
||||
pub run_id: String,
|
||||
pub entry_profile_id: String,
|
||||
pub cleared_level_count: u32,
|
||||
pub current_level_index: u32,
|
||||
pub current_grid_size: u32,
|
||||
pub played_profile_ids: Vec<String>,
|
||||
pub previous_level_tags: Vec<String>,
|
||||
#[serde(default)]
|
||||
pub current_level: Option<PuzzleRuntimeLevelSnapshotResponse>,
|
||||
#[serde(default)]
|
||||
pub recommended_next_profile_id: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct PuzzleRunResponse {
|
||||
pub run: PuzzleRunSnapshotResponse,
|
||||
}
|
||||
65
server-rs/crates/shared-contracts/src/puzzle_works.rs
Normal file
65
server-rs/crates/shared-contracts/src/puzzle_works.rs
Normal file
@@ -0,0 +1,65 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::puzzle_agent::PuzzleAnchorPackResponse;
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct PutPuzzleWorkRequest {
|
||||
pub level_name: String,
|
||||
pub summary: String,
|
||||
pub theme_tags: Vec<String>,
|
||||
#[serde(default)]
|
||||
pub cover_image_src: Option<String>,
|
||||
#[serde(default)]
|
||||
pub cover_asset_id: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct PuzzleWorkSummaryResponse {
|
||||
pub work_id: String,
|
||||
pub profile_id: String,
|
||||
pub owner_user_id: String,
|
||||
#[serde(default)]
|
||||
pub source_session_id: Option<String>,
|
||||
pub author_display_name: String,
|
||||
pub level_name: String,
|
||||
pub summary: String,
|
||||
pub theme_tags: Vec<String>,
|
||||
#[serde(default)]
|
||||
pub cover_image_src: Option<String>,
|
||||
#[serde(default)]
|
||||
pub cover_asset_id: Option<String>,
|
||||
pub publication_status: String,
|
||||
pub updated_at: String,
|
||||
#[serde(default)]
|
||||
pub published_at: Option<String>,
|
||||
pub play_count: u32,
|
||||
pub publish_ready: bool,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct PuzzleWorkProfileResponse {
|
||||
#[serde(flatten)]
|
||||
pub summary: PuzzleWorkSummaryResponse,
|
||||
pub anchor_pack: PuzzleAnchorPackResponse,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct PuzzleWorksResponse {
|
||||
pub items: Vec<PuzzleWorkSummaryResponse>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct PuzzleWorkDetailResponse {
|
||||
pub item: PuzzleWorkProfileResponse,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct PuzzleWorkMutationResponse {
|
||||
pub item: PuzzleWorkProfileResponse,
|
||||
}
|
||||
@@ -6,11 +6,13 @@ license.workspace = true
|
||||
|
||||
[dependencies]
|
||||
module-ai = { path = "../module-ai" }
|
||||
module-big-fish = { path = "../module-big-fish" }
|
||||
module-custom-world = { path = "../module-custom-world" }
|
||||
module-assets = { path = "../module-assets" }
|
||||
module-combat = { path = "../module-combat" }
|
||||
module-inventory = { path = "../module-inventory" }
|
||||
module-npc = { path = "../module-npc" }
|
||||
module-puzzle = { path = "../module-puzzle" }
|
||||
module-runtime = { path = "../module-runtime" }
|
||||
module-runtime-item = { path = "../module-runtime-item" }
|
||||
module-story = { path = "../module-story" }
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,58 @@
|
||||
// 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_run_next_level_input_type::PuzzleRunNextLevelInput;
|
||||
use super::puzzle_run_procedure_result_type::PuzzleRunProcedureResult;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
struct AdvancePuzzleNextLevelArgs {
|
||||
pub input: PuzzleRunNextLevelInput,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for AdvancePuzzleNextLevelArgs {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the procedure `advance_puzzle_next_level`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteProcedures`].
|
||||
pub trait advance_puzzle_next_level {
|
||||
fn advance_puzzle_next_level(&self, input: PuzzleRunNextLevelInput,
|
||||
) {
|
||||
self.advance_puzzle_next_level_then(input, |_, _| {});
|
||||
}
|
||||
|
||||
fn advance_puzzle_next_level_then(
|
||||
&self,
|
||||
input: PuzzleRunNextLevelInput,
|
||||
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<PuzzleRunProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||
);
|
||||
}
|
||||
|
||||
impl advance_puzzle_next_level for super::RemoteProcedures {
|
||||
fn advance_puzzle_next_level_then(
|
||||
&self,
|
||||
input: PuzzleRunNextLevelInput,
|
||||
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<PuzzleRunProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||
) {
|
||||
self.imp.invoke_procedure_with_callback::<_, PuzzleRunProcedureResult>(
|
||||
"advance_puzzle_next_level",
|
||||
AdvancePuzzleNextLevelArgs { input, },
|
||||
__callback,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)]
|
||||
#[derive(Copy, Eq, Hash)]
|
||||
pub enum BigFishAgentMessageKind {
|
||||
Chat,
|
||||
|
||||
Summary,
|
||||
|
||||
ActionResult,
|
||||
|
||||
Warning,
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishAgentMessageKind {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -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)]
|
||||
#[derive(Copy, Eq, Hash)]
|
||||
pub enum BigFishAgentMessageRole {
|
||||
User,
|
||||
|
||||
Assistant,
|
||||
|
||||
System,
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishAgentMessageRole {
|
||||
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,
|
||||
};
|
||||
|
||||
use super::big_fish_agent_message_role_type::BigFishAgentMessageRole;
|
||||
use super::big_fish_agent_message_kind_type::BigFishAgentMessageKind;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct BigFishAgentMessageSnapshot {
|
||||
pub message_id: String,
|
||||
pub session_id: String,
|
||||
pub role: BigFishAgentMessageRole,
|
||||
pub kind: BigFishAgentMessageKind,
|
||||
pub text: String,
|
||||
pub created_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishAgentMessageSnapshot {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -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 spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
use super::big_fish_agent_message_type::BigFishAgentMessage;
|
||||
use super::big_fish_agent_message_role_type::BigFishAgentMessageRole;
|
||||
use super::big_fish_agent_message_kind_type::BigFishAgentMessageKind;
|
||||
|
||||
/// Table handle for the table `big_fish_agent_message`.
|
||||
///
|
||||
/// Obtain a handle from the [`BigFishAgentMessageTableAccess::big_fish_agent_message`] method on [`super::RemoteTables`],
|
||||
/// like `ctx.db.big_fish_agent_message()`.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.big_fish_agent_message().on_insert(...)`.
|
||||
pub struct BigFishAgentMessageTableHandle<'ctx> {
|
||||
imp: __sdk::TableHandle<BigFishAgentMessage>,
|
||||
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the table `big_fish_agent_message`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteTables`].
|
||||
pub trait BigFishAgentMessageTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Obtain a [`BigFishAgentMessageTableHandle`], which mediates access to the table `big_fish_agent_message`.
|
||||
fn big_fish_agent_message(&self) -> BigFishAgentMessageTableHandle<'_>;
|
||||
}
|
||||
|
||||
impl BigFishAgentMessageTableAccess for super::RemoteTables {
|
||||
fn big_fish_agent_message(&self) -> BigFishAgentMessageTableHandle<'_> {
|
||||
BigFishAgentMessageTableHandle {
|
||||
imp: self.imp.get_table::<BigFishAgentMessage>("big_fish_agent_message"),
|
||||
ctx: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct BigFishAgentMessageInsertCallbackId(__sdk::CallbackId);
|
||||
pub struct BigFishAgentMessageDeleteCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::Table for BigFishAgentMessageTableHandle<'ctx> {
|
||||
type Row = BigFishAgentMessage;
|
||||
type EventContext = super::EventContext;
|
||||
|
||||
fn count(&self) -> u64 { self.imp.count() }
|
||||
fn iter(&self) -> impl Iterator<Item = BigFishAgentMessage> + '_ { self.imp.iter() }
|
||||
|
||||
type InsertCallbackId = BigFishAgentMessageInsertCallbackId;
|
||||
|
||||
fn on_insert(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> BigFishAgentMessageInsertCallbackId {
|
||||
BigFishAgentMessageInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_insert(&self, callback: BigFishAgentMessageInsertCallbackId) {
|
||||
self.imp.remove_on_insert(callback.0)
|
||||
}
|
||||
|
||||
type DeleteCallbackId = BigFishAgentMessageDeleteCallbackId;
|
||||
|
||||
fn on_delete(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> BigFishAgentMessageDeleteCallbackId {
|
||||
BigFishAgentMessageDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_delete(&self, callback: BigFishAgentMessageDeleteCallbackId) {
|
||||
self.imp.remove_on_delete(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct BigFishAgentMessageUpdateCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::TableWithPrimaryKey for BigFishAgentMessageTableHandle<'ctx> {
|
||||
type UpdateCallbackId = BigFishAgentMessageUpdateCallbackId;
|
||||
|
||||
fn on_update(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||
) -> BigFishAgentMessageUpdateCallbackId {
|
||||
BigFishAgentMessageUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_update(&self, callback: BigFishAgentMessageUpdateCallbackId) {
|
||||
self.imp.remove_on_update(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
/// Access to the `message_id` unique index on the table `big_fish_agent_message`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`BigFishAgentMessageMessageIdUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.big_fish_agent_message().message_id().find(...)`.
|
||||
pub struct BigFishAgentMessageMessageIdUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<BigFishAgentMessage, String>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
impl<'ctx> BigFishAgentMessageTableHandle<'ctx> {
|
||||
/// Get a handle on the `message_id` unique index on the table `big_fish_agent_message`.
|
||||
pub fn message_id(&self) -> BigFishAgentMessageMessageIdUnique<'ctx> {
|
||||
BigFishAgentMessageMessageIdUnique {
|
||||
imp: self.imp.get_unique_constraint::<String>("message_id"),
|
||||
phantom: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> BigFishAgentMessageMessageIdUnique<'ctx> {
|
||||
/// Find the subscribed row whose `message_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<BigFishAgentMessage> {
|
||||
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::<BigFishAgentMessage>("big_fish_agent_message");
|
||||
_table.add_unique_constraint::<String>("message_id", |row| &row.message_id);
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub(super) fn parse_table_update(
|
||||
raw_updates: __ws::v2::TableUpdate,
|
||||
) -> __sdk::Result<__sdk::TableUpdate<BigFishAgentMessage>> {
|
||||
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||
__sdk::InternalError::failed_parse(
|
||||
"TableUpdate<BigFishAgentMessage>",
|
||||
"TableUpdate",
|
||||
).with_cause(e).into()
|
||||
})
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `BigFishAgentMessage`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait big_fish_agent_messageQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `BigFishAgentMessage`.
|
||||
fn big_fish_agent_message(&self) -> __sdk::__query_builder::Table<BigFishAgentMessage>;
|
||||
}
|
||||
|
||||
impl big_fish_agent_messageQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn big_fish_agent_message(&self) -> __sdk::__query_builder::Table<BigFishAgentMessage> {
|
||||
__sdk::__query_builder::Table::new("big_fish_agent_message")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
// 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::big_fish_agent_message_role_type::BigFishAgentMessageRole;
|
||||
use super::big_fish_agent_message_kind_type::BigFishAgentMessageKind;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct BigFishAgentMessage {
|
||||
pub message_id: String,
|
||||
pub session_id: String,
|
||||
pub role: BigFishAgentMessageRole,
|
||||
pub kind: BigFishAgentMessageKind,
|
||||
pub text: String,
|
||||
pub created_at: __sdk::Timestamp,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishAgentMessage {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
/// Column accessor struct for the table `BigFishAgentMessage`.
|
||||
///
|
||||
/// Provides typed access to columns for query building.
|
||||
pub struct BigFishAgentMessageCols {
|
||||
pub message_id: __sdk::__query_builder::Col<BigFishAgentMessage, String>,
|
||||
pub session_id: __sdk::__query_builder::Col<BigFishAgentMessage, String>,
|
||||
pub role: __sdk::__query_builder::Col<BigFishAgentMessage, BigFishAgentMessageRole>,
|
||||
pub kind: __sdk::__query_builder::Col<BigFishAgentMessage, BigFishAgentMessageKind>,
|
||||
pub text: __sdk::__query_builder::Col<BigFishAgentMessage, String>,
|
||||
pub created_at: __sdk::__query_builder::Col<BigFishAgentMessage, __sdk::Timestamp>,
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::HasCols for BigFishAgentMessage {
|
||||
type Cols = BigFishAgentMessageCols;
|
||||
fn cols(table_name: &'static str) -> Self::Cols {
|
||||
BigFishAgentMessageCols {
|
||||
message_id: __sdk::__query_builder::Col::new(table_name, "message_id"),
|
||||
session_id: __sdk::__query_builder::Col::new(table_name, "session_id"),
|
||||
role: __sdk::__query_builder::Col::new(table_name, "role"),
|
||||
kind: __sdk::__query_builder::Col::new(table_name, "kind"),
|
||||
text: __sdk::__query_builder::Col::new(table_name, "text"),
|
||||
created_at: __sdk::__query_builder::Col::new(table_name, "created_at"),
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Indexed column accessor struct for the table `BigFishAgentMessage`.
|
||||
///
|
||||
/// Provides typed access to indexed columns for query building.
|
||||
pub struct BigFishAgentMessageIxCols {
|
||||
pub message_id: __sdk::__query_builder::IxCol<BigFishAgentMessage, String>,
|
||||
pub session_id: __sdk::__query_builder::IxCol<BigFishAgentMessage, String>,
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::HasIxCols for BigFishAgentMessage {
|
||||
type IxCols = BigFishAgentMessageIxCols;
|
||||
fn ix_cols(table_name: &'static str) -> Self::IxCols {
|
||||
BigFishAgentMessageIxCols {
|
||||
message_id: __sdk::__query_builder::IxCol::new(table_name, "message_id"),
|
||||
session_id: __sdk::__query_builder::IxCol::new(table_name, "session_id"),
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::CanBeLookupTable for BigFishAgentMessage {}
|
||||
|
||||
@@ -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::big_fish_anchor_status_type::BigFishAnchorStatus;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct BigFishAnchorItem {
|
||||
pub key: String,
|
||||
pub label: String,
|
||||
pub value: String,
|
||||
pub status: BigFishAnchorStatus,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishAnchorItem {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -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::big_fish_anchor_item_type::BigFishAnchorItem;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct BigFishAnchorPack {
|
||||
pub gameplay_promise: BigFishAnchorItem,
|
||||
pub ecology_visual_theme: BigFishAnchorItem,
|
||||
pub growth_ladder: BigFishAnchorItem,
|
||||
pub risk_tempo: BigFishAnchorItem,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishAnchorPack {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -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)]
|
||||
#[derive(Copy, Eq, Hash)]
|
||||
pub enum BigFishAnchorStatus {
|
||||
Confirmed,
|
||||
|
||||
Inferred,
|
||||
|
||||
Missing,
|
||||
|
||||
Locked,
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishAnchorStatus {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
// 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 BigFishAssetCoverage {
|
||||
pub level_main_image_ready_count: u32,
|
||||
pub level_motion_ready_count: u32,
|
||||
pub background_ready: bool,
|
||||
pub required_level_count: u32,
|
||||
pub publish_ready: bool,
|
||||
pub blockers: Vec::<String>,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishAssetCoverage {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
use super::big_fish_asset_kind_type::BigFishAssetKind;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct BigFishAssetGenerateInput {
|
||||
pub session_id: String,
|
||||
pub owner_user_id: String,
|
||||
pub asset_kind: BigFishAssetKind,
|
||||
pub level: Option::<u32>,
|
||||
pub motion_key: Option::<String>,
|
||||
pub generated_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishAssetGenerateInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -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)]
|
||||
#[derive(Copy, Eq, Hash)]
|
||||
pub enum BigFishAssetKind {
|
||||
LevelMainImage,
|
||||
|
||||
LevelMotion,
|
||||
|
||||
StageBackground,
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishAssetKind {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
// 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::big_fish_asset_kind_type::BigFishAssetKind;
|
||||
use super::big_fish_asset_status_type::BigFishAssetStatus;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct BigFishAssetSlotSnapshot {
|
||||
pub slot_id: String,
|
||||
pub session_id: String,
|
||||
pub asset_kind: BigFishAssetKind,
|
||||
pub level: Option::<u32>,
|
||||
pub motion_key: Option::<String>,
|
||||
pub status: BigFishAssetStatus,
|
||||
pub asset_url: Option::<String>,
|
||||
pub prompt_snapshot: String,
|
||||
pub updated_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishAssetSlotSnapshot {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -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 spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
use super::big_fish_asset_slot_type::BigFishAssetSlot;
|
||||
use super::big_fish_asset_kind_type::BigFishAssetKind;
|
||||
use super::big_fish_asset_status_type::BigFishAssetStatus;
|
||||
|
||||
/// Table handle for the table `big_fish_asset_slot`.
|
||||
///
|
||||
/// Obtain a handle from the [`BigFishAssetSlotTableAccess::big_fish_asset_slot`] method on [`super::RemoteTables`],
|
||||
/// like `ctx.db.big_fish_asset_slot()`.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.big_fish_asset_slot().on_insert(...)`.
|
||||
pub struct BigFishAssetSlotTableHandle<'ctx> {
|
||||
imp: __sdk::TableHandle<BigFishAssetSlot>,
|
||||
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the table `big_fish_asset_slot`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteTables`].
|
||||
pub trait BigFishAssetSlotTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Obtain a [`BigFishAssetSlotTableHandle`], which mediates access to the table `big_fish_asset_slot`.
|
||||
fn big_fish_asset_slot(&self) -> BigFishAssetSlotTableHandle<'_>;
|
||||
}
|
||||
|
||||
impl BigFishAssetSlotTableAccess for super::RemoteTables {
|
||||
fn big_fish_asset_slot(&self) -> BigFishAssetSlotTableHandle<'_> {
|
||||
BigFishAssetSlotTableHandle {
|
||||
imp: self.imp.get_table::<BigFishAssetSlot>("big_fish_asset_slot"),
|
||||
ctx: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct BigFishAssetSlotInsertCallbackId(__sdk::CallbackId);
|
||||
pub struct BigFishAssetSlotDeleteCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::Table for BigFishAssetSlotTableHandle<'ctx> {
|
||||
type Row = BigFishAssetSlot;
|
||||
type EventContext = super::EventContext;
|
||||
|
||||
fn count(&self) -> u64 { self.imp.count() }
|
||||
fn iter(&self) -> impl Iterator<Item = BigFishAssetSlot> + '_ { self.imp.iter() }
|
||||
|
||||
type InsertCallbackId = BigFishAssetSlotInsertCallbackId;
|
||||
|
||||
fn on_insert(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> BigFishAssetSlotInsertCallbackId {
|
||||
BigFishAssetSlotInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_insert(&self, callback: BigFishAssetSlotInsertCallbackId) {
|
||||
self.imp.remove_on_insert(callback.0)
|
||||
}
|
||||
|
||||
type DeleteCallbackId = BigFishAssetSlotDeleteCallbackId;
|
||||
|
||||
fn on_delete(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> BigFishAssetSlotDeleteCallbackId {
|
||||
BigFishAssetSlotDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_delete(&self, callback: BigFishAssetSlotDeleteCallbackId) {
|
||||
self.imp.remove_on_delete(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct BigFishAssetSlotUpdateCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::TableWithPrimaryKey for BigFishAssetSlotTableHandle<'ctx> {
|
||||
type UpdateCallbackId = BigFishAssetSlotUpdateCallbackId;
|
||||
|
||||
fn on_update(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||
) -> BigFishAssetSlotUpdateCallbackId {
|
||||
BigFishAssetSlotUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_update(&self, callback: BigFishAssetSlotUpdateCallbackId) {
|
||||
self.imp.remove_on_update(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
/// Access to the `slot_id` unique index on the table `big_fish_asset_slot`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`BigFishAssetSlotSlotIdUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.big_fish_asset_slot().slot_id().find(...)`.
|
||||
pub struct BigFishAssetSlotSlotIdUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<BigFishAssetSlot, String>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
impl<'ctx> BigFishAssetSlotTableHandle<'ctx> {
|
||||
/// Get a handle on the `slot_id` unique index on the table `big_fish_asset_slot`.
|
||||
pub fn slot_id(&self) -> BigFishAssetSlotSlotIdUnique<'ctx> {
|
||||
BigFishAssetSlotSlotIdUnique {
|
||||
imp: self.imp.get_unique_constraint::<String>("slot_id"),
|
||||
phantom: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> BigFishAssetSlotSlotIdUnique<'ctx> {
|
||||
/// Find the subscribed row whose `slot_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<BigFishAssetSlot> {
|
||||
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::<BigFishAssetSlot>("big_fish_asset_slot");
|
||||
_table.add_unique_constraint::<String>("slot_id", |row| &row.slot_id);
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub(super) fn parse_table_update(
|
||||
raw_updates: __ws::v2::TableUpdate,
|
||||
) -> __sdk::Result<__sdk::TableUpdate<BigFishAssetSlot>> {
|
||||
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||
__sdk::InternalError::failed_parse(
|
||||
"TableUpdate<BigFishAssetSlot>",
|
||||
"TableUpdate",
|
||||
).with_cause(e).into()
|
||||
})
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `BigFishAssetSlot`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait big_fish_asset_slotQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `BigFishAssetSlot`.
|
||||
fn big_fish_asset_slot(&self) -> __sdk::__query_builder::Table<BigFishAssetSlot>;
|
||||
}
|
||||
|
||||
impl big_fish_asset_slotQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn big_fish_asset_slot(&self) -> __sdk::__query_builder::Table<BigFishAssetSlot> {
|
||||
__sdk::__query_builder::Table::new("big_fish_asset_slot")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
// 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::big_fish_asset_kind_type::BigFishAssetKind;
|
||||
use super::big_fish_asset_status_type::BigFishAssetStatus;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct BigFishAssetSlot {
|
||||
pub slot_id: String,
|
||||
pub session_id: String,
|
||||
pub asset_kind: BigFishAssetKind,
|
||||
pub level: Option::<u32>,
|
||||
pub motion_key: Option::<String>,
|
||||
pub status: BigFishAssetStatus,
|
||||
pub asset_url: Option::<String>,
|
||||
pub prompt_snapshot: String,
|
||||
pub updated_at: __sdk::Timestamp,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishAssetSlot {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
/// Column accessor struct for the table `BigFishAssetSlot`.
|
||||
///
|
||||
/// Provides typed access to columns for query building.
|
||||
pub struct BigFishAssetSlotCols {
|
||||
pub slot_id: __sdk::__query_builder::Col<BigFishAssetSlot, String>,
|
||||
pub session_id: __sdk::__query_builder::Col<BigFishAssetSlot, String>,
|
||||
pub asset_kind: __sdk::__query_builder::Col<BigFishAssetSlot, BigFishAssetKind>,
|
||||
pub level: __sdk::__query_builder::Col<BigFishAssetSlot, Option::<u32>>,
|
||||
pub motion_key: __sdk::__query_builder::Col<BigFishAssetSlot, Option::<String>>,
|
||||
pub status: __sdk::__query_builder::Col<BigFishAssetSlot, BigFishAssetStatus>,
|
||||
pub asset_url: __sdk::__query_builder::Col<BigFishAssetSlot, Option::<String>>,
|
||||
pub prompt_snapshot: __sdk::__query_builder::Col<BigFishAssetSlot, String>,
|
||||
pub updated_at: __sdk::__query_builder::Col<BigFishAssetSlot, __sdk::Timestamp>,
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::HasCols for BigFishAssetSlot {
|
||||
type Cols = BigFishAssetSlotCols;
|
||||
fn cols(table_name: &'static str) -> Self::Cols {
|
||||
BigFishAssetSlotCols {
|
||||
slot_id: __sdk::__query_builder::Col::new(table_name, "slot_id"),
|
||||
session_id: __sdk::__query_builder::Col::new(table_name, "session_id"),
|
||||
asset_kind: __sdk::__query_builder::Col::new(table_name, "asset_kind"),
|
||||
level: __sdk::__query_builder::Col::new(table_name, "level"),
|
||||
motion_key: __sdk::__query_builder::Col::new(table_name, "motion_key"),
|
||||
status: __sdk::__query_builder::Col::new(table_name, "status"),
|
||||
asset_url: __sdk::__query_builder::Col::new(table_name, "asset_url"),
|
||||
prompt_snapshot: __sdk::__query_builder::Col::new(table_name, "prompt_snapshot"),
|
||||
updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"),
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Indexed column accessor struct for the table `BigFishAssetSlot`.
|
||||
///
|
||||
/// Provides typed access to indexed columns for query building.
|
||||
pub struct BigFishAssetSlotIxCols {
|
||||
pub session_id: __sdk::__query_builder::IxCol<BigFishAssetSlot, String>,
|
||||
pub slot_id: __sdk::__query_builder::IxCol<BigFishAssetSlot, String>,
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::HasIxCols for BigFishAssetSlot {
|
||||
type IxCols = BigFishAssetSlotIxCols;
|
||||
fn ix_cols(table_name: &'static str) -> Self::IxCols {
|
||||
BigFishAssetSlotIxCols {
|
||||
session_id: __sdk::__query_builder::IxCol::new(table_name, "session_id"),
|
||||
slot_id: __sdk::__query_builder::IxCol::new(table_name, "slot_id"),
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::CanBeLookupTable for BigFishAssetSlot {}
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
#[derive(Copy, Eq, Hash)]
|
||||
pub enum BigFishAssetStatus {
|
||||
Missing,
|
||||
|
||||
Ready,
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishAssetStatus {
|
||||
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 BigFishBackgroundBlueprint {
|
||||
pub theme: String,
|
||||
pub color_mood: String,
|
||||
pub foreground_hints: String,
|
||||
pub midground_composition: String,
|
||||
pub background_depth: String,
|
||||
pub safe_play_area_hint: String,
|
||||
pub spawn_edge_hint: String,
|
||||
pub background_prompt_seed: String,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishBackgroundBlueprint {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,164 @@
|
||||
// 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::big_fish_creation_session_type::BigFishCreationSession;
|
||||
use super::big_fish_creation_stage_type::BigFishCreationStage;
|
||||
|
||||
/// Table handle for the table `big_fish_creation_session`.
|
||||
///
|
||||
/// Obtain a handle from the [`BigFishCreationSessionTableAccess::big_fish_creation_session`] method on [`super::RemoteTables`],
|
||||
/// like `ctx.db.big_fish_creation_session()`.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.big_fish_creation_session().on_insert(...)`.
|
||||
pub struct BigFishCreationSessionTableHandle<'ctx> {
|
||||
imp: __sdk::TableHandle<BigFishCreationSession>,
|
||||
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the table `big_fish_creation_session`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteTables`].
|
||||
pub trait BigFishCreationSessionTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Obtain a [`BigFishCreationSessionTableHandle`], which mediates access to the table `big_fish_creation_session`.
|
||||
fn big_fish_creation_session(&self) -> BigFishCreationSessionTableHandle<'_>;
|
||||
}
|
||||
|
||||
impl BigFishCreationSessionTableAccess for super::RemoteTables {
|
||||
fn big_fish_creation_session(&self) -> BigFishCreationSessionTableHandle<'_> {
|
||||
BigFishCreationSessionTableHandle {
|
||||
imp: self.imp.get_table::<BigFishCreationSession>("big_fish_creation_session"),
|
||||
ctx: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct BigFishCreationSessionInsertCallbackId(__sdk::CallbackId);
|
||||
pub struct BigFishCreationSessionDeleteCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::Table for BigFishCreationSessionTableHandle<'ctx> {
|
||||
type Row = BigFishCreationSession;
|
||||
type EventContext = super::EventContext;
|
||||
|
||||
fn count(&self) -> u64 { self.imp.count() }
|
||||
fn iter(&self) -> impl Iterator<Item = BigFishCreationSession> + '_ { self.imp.iter() }
|
||||
|
||||
type InsertCallbackId = BigFishCreationSessionInsertCallbackId;
|
||||
|
||||
fn on_insert(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> BigFishCreationSessionInsertCallbackId {
|
||||
BigFishCreationSessionInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_insert(&self, callback: BigFishCreationSessionInsertCallbackId) {
|
||||
self.imp.remove_on_insert(callback.0)
|
||||
}
|
||||
|
||||
type DeleteCallbackId = BigFishCreationSessionDeleteCallbackId;
|
||||
|
||||
fn on_delete(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> BigFishCreationSessionDeleteCallbackId {
|
||||
BigFishCreationSessionDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_delete(&self, callback: BigFishCreationSessionDeleteCallbackId) {
|
||||
self.imp.remove_on_delete(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct BigFishCreationSessionUpdateCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::TableWithPrimaryKey for BigFishCreationSessionTableHandle<'ctx> {
|
||||
type UpdateCallbackId = BigFishCreationSessionUpdateCallbackId;
|
||||
|
||||
fn on_update(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||
) -> BigFishCreationSessionUpdateCallbackId {
|
||||
BigFishCreationSessionUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_update(&self, callback: BigFishCreationSessionUpdateCallbackId) {
|
||||
self.imp.remove_on_update(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
/// Access to the `session_id` unique index on the table `big_fish_creation_session`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`BigFishCreationSessionSessionIdUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.big_fish_creation_session().session_id().find(...)`.
|
||||
pub struct BigFishCreationSessionSessionIdUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<BigFishCreationSession, String>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
impl<'ctx> BigFishCreationSessionTableHandle<'ctx> {
|
||||
/// Get a handle on the `session_id` unique index on the table `big_fish_creation_session`.
|
||||
pub fn session_id(&self) -> BigFishCreationSessionSessionIdUnique<'ctx> {
|
||||
BigFishCreationSessionSessionIdUnique {
|
||||
imp: self.imp.get_unique_constraint::<String>("session_id"),
|
||||
phantom: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> BigFishCreationSessionSessionIdUnique<'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<BigFishCreationSession> {
|
||||
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::<BigFishCreationSession>("big_fish_creation_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<BigFishCreationSession>> {
|
||||
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||
__sdk::InternalError::failed_parse(
|
||||
"TableUpdate<BigFishCreationSession>",
|
||||
"TableUpdate",
|
||||
).with_cause(e).into()
|
||||
})
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `BigFishCreationSession`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait big_fish_creation_sessionQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `BigFishCreationSession`.
|
||||
fn big_fish_creation_session(&self) -> __sdk::__query_builder::Table<BigFishCreationSession>;
|
||||
}
|
||||
|
||||
impl big_fish_creation_sessionQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn big_fish_creation_session(&self) -> __sdk::__query_builder::Table<BigFishCreationSession> {
|
||||
__sdk::__query_builder::Table::new("big_fish_creation_session")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
// 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::big_fish_creation_stage_type::BigFishCreationStage;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct BigFishCreationSession {
|
||||
pub session_id: String,
|
||||
pub owner_user_id: String,
|
||||
pub seed_text: String,
|
||||
pub current_turn: u32,
|
||||
pub progress_percent: u32,
|
||||
pub stage: BigFishCreationStage,
|
||||
pub anchor_pack_json: String,
|
||||
pub draft_json: Option::<String>,
|
||||
pub asset_coverage_json: String,
|
||||
pub last_assistant_reply: Option::<String>,
|
||||
pub publish_ready: bool,
|
||||
pub created_at: __sdk::Timestamp,
|
||||
pub updated_at: __sdk::Timestamp,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishCreationSession {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
/// Column accessor struct for the table `BigFishCreationSession`.
|
||||
///
|
||||
/// Provides typed access to columns for query building.
|
||||
pub struct BigFishCreationSessionCols {
|
||||
pub session_id: __sdk::__query_builder::Col<BigFishCreationSession, String>,
|
||||
pub owner_user_id: __sdk::__query_builder::Col<BigFishCreationSession, String>,
|
||||
pub seed_text: __sdk::__query_builder::Col<BigFishCreationSession, String>,
|
||||
pub current_turn: __sdk::__query_builder::Col<BigFishCreationSession, u32>,
|
||||
pub progress_percent: __sdk::__query_builder::Col<BigFishCreationSession, u32>,
|
||||
pub stage: __sdk::__query_builder::Col<BigFishCreationSession, BigFishCreationStage>,
|
||||
pub anchor_pack_json: __sdk::__query_builder::Col<BigFishCreationSession, String>,
|
||||
pub draft_json: __sdk::__query_builder::Col<BigFishCreationSession, Option::<String>>,
|
||||
pub asset_coverage_json: __sdk::__query_builder::Col<BigFishCreationSession, String>,
|
||||
pub last_assistant_reply: __sdk::__query_builder::Col<BigFishCreationSession, Option::<String>>,
|
||||
pub publish_ready: __sdk::__query_builder::Col<BigFishCreationSession, bool>,
|
||||
pub created_at: __sdk::__query_builder::Col<BigFishCreationSession, __sdk::Timestamp>,
|
||||
pub updated_at: __sdk::__query_builder::Col<BigFishCreationSession, __sdk::Timestamp>,
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::HasCols for BigFishCreationSession {
|
||||
type Cols = BigFishCreationSessionCols;
|
||||
fn cols(table_name: &'static str) -> Self::Cols {
|
||||
BigFishCreationSessionCols {
|
||||
session_id: __sdk::__query_builder::Col::new(table_name, "session_id"),
|
||||
owner_user_id: __sdk::__query_builder::Col::new(table_name, "owner_user_id"),
|
||||
seed_text: __sdk::__query_builder::Col::new(table_name, "seed_text"),
|
||||
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"),
|
||||
anchor_pack_json: __sdk::__query_builder::Col::new(table_name, "anchor_pack_json"),
|
||||
draft_json: __sdk::__query_builder::Col::new(table_name, "draft_json"),
|
||||
asset_coverage_json: __sdk::__query_builder::Col::new(table_name, "asset_coverage_json"),
|
||||
last_assistant_reply: __sdk::__query_builder::Col::new(table_name, "last_assistant_reply"),
|
||||
publish_ready: __sdk::__query_builder::Col::new(table_name, "publish_ready"),
|
||||
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 `BigFishCreationSession`.
|
||||
///
|
||||
/// Provides typed access to indexed columns for query building.
|
||||
pub struct BigFishCreationSessionIxCols {
|
||||
pub owner_user_id: __sdk::__query_builder::IxCol<BigFishCreationSession, String>,
|
||||
pub session_id: __sdk::__query_builder::IxCol<BigFishCreationSession, String>,
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::HasIxCols for BigFishCreationSession {
|
||||
type IxCols = BigFishCreationSessionIxCols;
|
||||
fn ix_cols(table_name: &'static str) -> Self::IxCols {
|
||||
BigFishCreationSessionIxCols {
|
||||
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 BigFishCreationSession {}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
// 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 BigFishCreationStage {
|
||||
CollectingAnchors,
|
||||
|
||||
DraftReady,
|
||||
|
||||
AssetRefining,
|
||||
|
||||
ReadyToPublish,
|
||||
|
||||
Published,
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishCreationStage {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct BigFishDraftCompileInput {
|
||||
pub session_id: String,
|
||||
pub owner_user_id: String,
|
||||
pub compiled_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishDraftCompileInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -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::big_fish_level_blueprint_type::BigFishLevelBlueprint;
|
||||
use super::big_fish_background_blueprint_type::BigFishBackgroundBlueprint;
|
||||
use super::big_fish_runtime_params_type::BigFishRuntimeParams;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct BigFishGameDraft {
|
||||
pub title: String,
|
||||
pub subtitle: String,
|
||||
pub core_fun: String,
|
||||
pub ecology_theme: String,
|
||||
pub levels: Vec::<BigFishLevelBlueprint>,
|
||||
pub background: BigFishBackgroundBlueprint,
|
||||
pub runtime_params: BigFishRuntimeParams,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishGameDraft {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
// 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 BigFishLevelBlueprint {
|
||||
pub level: u32,
|
||||
pub name: String,
|
||||
pub one_line_fantasy: String,
|
||||
pub silhouette_direction: String,
|
||||
pub size_ratio: f32,
|
||||
pub visual_prompt_seed: String,
|
||||
pub motion_prompt_seed: String,
|
||||
pub merge_source_level: Option::<u32>,
|
||||
pub prey_window: Vec::<u32>,
|
||||
pub threat_window: Vec::<u32>,
|
||||
pub is_final_level: bool,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishLevelBlueprint {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
// 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 BigFishMessageSubmitInput {
|
||||
pub session_id: String,
|
||||
pub owner_user_id: String,
|
||||
pub user_message_id: String,
|
||||
pub user_message_text: String,
|
||||
pub assistant_message_id: String,
|
||||
pub submitted_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishMessageSubmitInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct BigFishPublishInput {
|
||||
pub session_id: String,
|
||||
pub owner_user_id: String,
|
||||
pub published_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishPublishInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
// 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 BigFishRunGetInput {
|
||||
pub run_id: String,
|
||||
pub owner_user_id: String,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishRunGetInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct BigFishRunInputSubmitInput {
|
||||
pub run_id: String,
|
||||
pub owner_user_id: String,
|
||||
pub input_x: f32,
|
||||
pub input_y: f32,
|
||||
pub submitted_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishRunInputSubmitInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -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::big_fish_runtime_snapshot_type::BigFishRuntimeSnapshot;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct BigFishRunProcedureResult {
|
||||
pub ok: bool,
|
||||
pub run: Option::<BigFishRuntimeSnapshot>,
|
||||
pub error_message: Option::<String>,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishRunProcedureResult {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct BigFishRunStartInput {
|
||||
pub run_id: String,
|
||||
pub session_id: String,
|
||||
pub owner_user_id: String,
|
||||
pub started_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishRunStartInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -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)]
|
||||
#[derive(Copy, Eq, Hash)]
|
||||
pub enum BigFishRunStatus {
|
||||
Running,
|
||||
|
||||
Won,
|
||||
|
||||
Failed,
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishRunStatus {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
// 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::big_fish_vector_2_type::BigFishVector2;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct BigFishRuntimeEntity {
|
||||
pub entity_id: String,
|
||||
pub level: u32,
|
||||
pub position: BigFishVector2,
|
||||
pub radius: f32,
|
||||
pub offscreen_seconds: f32,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishRuntimeEntity {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -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 BigFishRuntimeParams {
|
||||
pub level_count: u32,
|
||||
pub merge_count_per_upgrade: u32,
|
||||
pub spawn_target_count: u32,
|
||||
pub leader_move_speed: f32,
|
||||
pub follower_catch_up_speed: f32,
|
||||
pub offscreen_cull_seconds: f32,
|
||||
pub prey_spawn_delta_levels: Vec::<u32>,
|
||||
pub threat_spawn_delta_levels: Vec::<u32>,
|
||||
pub win_level: u32,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishRuntimeParams {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,164 @@
|
||||
// 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::big_fish_runtime_run_type::BigFishRuntimeRun;
|
||||
use super::big_fish_run_status_type::BigFishRunStatus;
|
||||
|
||||
/// Table handle for the table `big_fish_runtime_run`.
|
||||
///
|
||||
/// Obtain a handle from the [`BigFishRuntimeRunTableAccess::big_fish_runtime_run`] method on [`super::RemoteTables`],
|
||||
/// like `ctx.db.big_fish_runtime_run()`.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.big_fish_runtime_run().on_insert(...)`.
|
||||
pub struct BigFishRuntimeRunTableHandle<'ctx> {
|
||||
imp: __sdk::TableHandle<BigFishRuntimeRun>,
|
||||
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the table `big_fish_runtime_run`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteTables`].
|
||||
pub trait BigFishRuntimeRunTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Obtain a [`BigFishRuntimeRunTableHandle`], which mediates access to the table `big_fish_runtime_run`.
|
||||
fn big_fish_runtime_run(&self) -> BigFishRuntimeRunTableHandle<'_>;
|
||||
}
|
||||
|
||||
impl BigFishRuntimeRunTableAccess for super::RemoteTables {
|
||||
fn big_fish_runtime_run(&self) -> BigFishRuntimeRunTableHandle<'_> {
|
||||
BigFishRuntimeRunTableHandle {
|
||||
imp: self.imp.get_table::<BigFishRuntimeRun>("big_fish_runtime_run"),
|
||||
ctx: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct BigFishRuntimeRunInsertCallbackId(__sdk::CallbackId);
|
||||
pub struct BigFishRuntimeRunDeleteCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::Table for BigFishRuntimeRunTableHandle<'ctx> {
|
||||
type Row = BigFishRuntimeRun;
|
||||
type EventContext = super::EventContext;
|
||||
|
||||
fn count(&self) -> u64 { self.imp.count() }
|
||||
fn iter(&self) -> impl Iterator<Item = BigFishRuntimeRun> + '_ { self.imp.iter() }
|
||||
|
||||
type InsertCallbackId = BigFishRuntimeRunInsertCallbackId;
|
||||
|
||||
fn on_insert(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> BigFishRuntimeRunInsertCallbackId {
|
||||
BigFishRuntimeRunInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_insert(&self, callback: BigFishRuntimeRunInsertCallbackId) {
|
||||
self.imp.remove_on_insert(callback.0)
|
||||
}
|
||||
|
||||
type DeleteCallbackId = BigFishRuntimeRunDeleteCallbackId;
|
||||
|
||||
fn on_delete(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> BigFishRuntimeRunDeleteCallbackId {
|
||||
BigFishRuntimeRunDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_delete(&self, callback: BigFishRuntimeRunDeleteCallbackId) {
|
||||
self.imp.remove_on_delete(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct BigFishRuntimeRunUpdateCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::TableWithPrimaryKey for BigFishRuntimeRunTableHandle<'ctx> {
|
||||
type UpdateCallbackId = BigFishRuntimeRunUpdateCallbackId;
|
||||
|
||||
fn on_update(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||
) -> BigFishRuntimeRunUpdateCallbackId {
|
||||
BigFishRuntimeRunUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_update(&self, callback: BigFishRuntimeRunUpdateCallbackId) {
|
||||
self.imp.remove_on_update(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
/// Access to the `run_id` unique index on the table `big_fish_runtime_run`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`BigFishRuntimeRunRunIdUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.big_fish_runtime_run().run_id().find(...)`.
|
||||
pub struct BigFishRuntimeRunRunIdUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<BigFishRuntimeRun, String>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
impl<'ctx> BigFishRuntimeRunTableHandle<'ctx> {
|
||||
/// Get a handle on the `run_id` unique index on the table `big_fish_runtime_run`.
|
||||
pub fn run_id(&self) -> BigFishRuntimeRunRunIdUnique<'ctx> {
|
||||
BigFishRuntimeRunRunIdUnique {
|
||||
imp: self.imp.get_unique_constraint::<String>("run_id"),
|
||||
phantom: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> BigFishRuntimeRunRunIdUnique<'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<BigFishRuntimeRun> {
|
||||
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::<BigFishRuntimeRun>("big_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<BigFishRuntimeRun>> {
|
||||
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||
__sdk::InternalError::failed_parse(
|
||||
"TableUpdate<BigFishRuntimeRun>",
|
||||
"TableUpdate",
|
||||
).with_cause(e).into()
|
||||
})
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `BigFishRuntimeRun`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait big_fish_runtime_runQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `BigFishRuntimeRun`.
|
||||
fn big_fish_runtime_run(&self) -> __sdk::__query_builder::Table<BigFishRuntimeRun>;
|
||||
}
|
||||
|
||||
impl big_fish_runtime_runQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn big_fish_runtime_run(&self) -> __sdk::__query_builder::Table<BigFishRuntimeRun> {
|
||||
__sdk::__query_builder::Table::new("big_fish_runtime_run")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
// 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::big_fish_run_status_type::BigFishRunStatus;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct BigFishRuntimeRun {
|
||||
pub run_id: String,
|
||||
pub session_id: String,
|
||||
pub owner_user_id: String,
|
||||
pub status: BigFishRunStatus,
|
||||
pub snapshot_json: String,
|
||||
pub last_input_x: f32,
|
||||
pub last_input_y: f32,
|
||||
pub tick: u64,
|
||||
pub created_at: __sdk::Timestamp,
|
||||
pub updated_at: __sdk::Timestamp,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishRuntimeRun {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
/// Column accessor struct for the table `BigFishRuntimeRun`.
|
||||
///
|
||||
/// Provides typed access to columns for query building.
|
||||
pub struct BigFishRuntimeRunCols {
|
||||
pub run_id: __sdk::__query_builder::Col<BigFishRuntimeRun, String>,
|
||||
pub session_id: __sdk::__query_builder::Col<BigFishRuntimeRun, String>,
|
||||
pub owner_user_id: __sdk::__query_builder::Col<BigFishRuntimeRun, String>,
|
||||
pub status: __sdk::__query_builder::Col<BigFishRuntimeRun, BigFishRunStatus>,
|
||||
pub snapshot_json: __sdk::__query_builder::Col<BigFishRuntimeRun, String>,
|
||||
pub last_input_x: __sdk::__query_builder::Col<BigFishRuntimeRun, f32>,
|
||||
pub last_input_y: __sdk::__query_builder::Col<BigFishRuntimeRun, f32>,
|
||||
pub tick: __sdk::__query_builder::Col<BigFishRuntimeRun, u64>,
|
||||
pub created_at: __sdk::__query_builder::Col<BigFishRuntimeRun, __sdk::Timestamp>,
|
||||
pub updated_at: __sdk::__query_builder::Col<BigFishRuntimeRun, __sdk::Timestamp>,
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::HasCols for BigFishRuntimeRun {
|
||||
type Cols = BigFishRuntimeRunCols;
|
||||
fn cols(table_name: &'static str) -> Self::Cols {
|
||||
BigFishRuntimeRunCols {
|
||||
run_id: __sdk::__query_builder::Col::new(table_name, "run_id"),
|
||||
session_id: __sdk::__query_builder::Col::new(table_name, "session_id"),
|
||||
owner_user_id: __sdk::__query_builder::Col::new(table_name, "owner_user_id"),
|
||||
status: __sdk::__query_builder::Col::new(table_name, "status"),
|
||||
snapshot_json: __sdk::__query_builder::Col::new(table_name, "snapshot_json"),
|
||||
last_input_x: __sdk::__query_builder::Col::new(table_name, "last_input_x"),
|
||||
last_input_y: __sdk::__query_builder::Col::new(table_name, "last_input_y"),
|
||||
tick: __sdk::__query_builder::Col::new(table_name, "tick"),
|
||||
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 `BigFishRuntimeRun`.
|
||||
///
|
||||
/// Provides typed access to indexed columns for query building.
|
||||
pub struct BigFishRuntimeRunIxCols {
|
||||
pub owner_user_id: __sdk::__query_builder::IxCol<BigFishRuntimeRun, String>,
|
||||
pub run_id: __sdk::__query_builder::IxCol<BigFishRuntimeRun, String>,
|
||||
pub session_id: __sdk::__query_builder::IxCol<BigFishRuntimeRun, String>,
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::HasIxCols for BigFishRuntimeRun {
|
||||
type IxCols = BigFishRuntimeRunIxCols;
|
||||
fn ix_cols(table_name: &'static str) -> Self::IxCols {
|
||||
BigFishRuntimeRunIxCols {
|
||||
owner_user_id: __sdk::__query_builder::IxCol::new(table_name, "owner_user_id"),
|
||||
run_id: __sdk::__query_builder::IxCol::new(table_name, "run_id"),
|
||||
session_id: __sdk::__query_builder::IxCol::new(table_name, "session_id"),
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::CanBeLookupTable for BigFishRuntimeRun {}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
// 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::big_fish_run_status_type::BigFishRunStatus;
|
||||
use super::big_fish_runtime_entity_type::BigFishRuntimeEntity;
|
||||
use super::big_fish_vector_2_type::BigFishVector2;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct BigFishRuntimeSnapshot {
|
||||
pub run_id: String,
|
||||
pub session_id: String,
|
||||
pub status: BigFishRunStatus,
|
||||
pub tick: u64,
|
||||
pub player_level: u32,
|
||||
pub win_level: u32,
|
||||
pub leader_entity_id: Option::<String>,
|
||||
pub owned_entities: Vec::<BigFishRuntimeEntity>,
|
||||
pub wild_entities: Vec::<BigFishRuntimeEntity>,
|
||||
pub camera_center: BigFishVector2,
|
||||
pub last_input: BigFishVector2,
|
||||
pub event_log: Vec::<String>,
|
||||
pub updated_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishRuntimeSnapshot {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
// 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 BigFishSessionCreateInput {
|
||||
pub session_id: String,
|
||||
pub owner_user_id: String,
|
||||
pub seed_text: String,
|
||||
pub welcome_message_id: String,
|
||||
pub welcome_message_text: String,
|
||||
pub created_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishSessionCreateInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
// 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 BigFishSessionGetInput {
|
||||
pub session_id: String,
|
||||
pub owner_user_id: String,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishSessionGetInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -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::big_fish_session_snapshot_type::BigFishSessionSnapshot;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct BigFishSessionProcedureResult {
|
||||
pub ok: bool,
|
||||
pub session: Option::<BigFishSessionSnapshot>,
|
||||
pub error_message: Option::<String>,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishSessionProcedureResult {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
// 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::big_fish_creation_stage_type::BigFishCreationStage;
|
||||
use super::big_fish_anchor_pack_type::BigFishAnchorPack;
|
||||
use super::big_fish_game_draft_type::BigFishGameDraft;
|
||||
use super::big_fish_asset_slot_snapshot_type::BigFishAssetSlotSnapshot;
|
||||
use super::big_fish_asset_coverage_type::BigFishAssetCoverage;
|
||||
use super::big_fish_agent_message_snapshot_type::BigFishAgentMessageSnapshot;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct BigFishSessionSnapshot {
|
||||
pub session_id: String,
|
||||
pub owner_user_id: String,
|
||||
pub seed_text: String,
|
||||
pub current_turn: u32,
|
||||
pub progress_percent: u32,
|
||||
pub stage: BigFishCreationStage,
|
||||
pub anchor_pack: BigFishAnchorPack,
|
||||
pub draft: Option::<BigFishGameDraft>,
|
||||
pub asset_slots: Vec::<BigFishAssetSlotSnapshot>,
|
||||
pub asset_coverage: BigFishAssetCoverage,
|
||||
pub messages: Vec::<BigFishAgentMessageSnapshot>,
|
||||
pub last_assistant_reply: Option::<String>,
|
||||
pub publish_ready: bool,
|
||||
pub created_at_micros: i64,
|
||||
pub updated_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishSessionSnapshot {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
// 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 BigFishVector2 {
|
||||
pub x: f32,
|
||||
pub y: f32,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for BigFishVector2 {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
// 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::big_fish_draft_compile_input_type::BigFishDraftCompileInput;
|
||||
use super::big_fish_session_procedure_result_type::BigFishSessionProcedureResult;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
struct CompileBigFishDraftArgs {
|
||||
pub input: BigFishDraftCompileInput,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for CompileBigFishDraftArgs {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the procedure `compile_big_fish_draft`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteProcedures`].
|
||||
pub trait compile_big_fish_draft {
|
||||
fn compile_big_fish_draft(&self, input: BigFishDraftCompileInput,
|
||||
) {
|
||||
self.compile_big_fish_draft_then(input, |_, _| {});
|
||||
}
|
||||
|
||||
fn compile_big_fish_draft_then(
|
||||
&self,
|
||||
input: BigFishDraftCompileInput,
|
||||
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<BigFishSessionProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||
);
|
||||
}
|
||||
|
||||
impl compile_big_fish_draft for super::RemoteProcedures {
|
||||
fn compile_big_fish_draft_then(
|
||||
&self,
|
||||
input: BigFishDraftCompileInput,
|
||||
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<BigFishSessionProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||
) {
|
||||
self.imp.invoke_procedure_with_callback::<_, BigFishSessionProcedureResult>(
|
||||
"compile_big_fish_draft",
|
||||
CompileBigFishDraftArgs { input, },
|
||||
__callback,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
// 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_draft_compile_input_type::PuzzleDraftCompileInput;
|
||||
use super::puzzle_agent_session_procedure_result_type::PuzzleAgentSessionProcedureResult;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
struct CompilePuzzleAgentDraftArgs {
|
||||
pub input: PuzzleDraftCompileInput,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for CompilePuzzleAgentDraftArgs {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the procedure `compile_puzzle_agent_draft`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteProcedures`].
|
||||
pub trait compile_puzzle_agent_draft {
|
||||
fn compile_puzzle_agent_draft(&self, input: PuzzleDraftCompileInput,
|
||||
) {
|
||||
self.compile_puzzle_agent_draft_then(input, |_, _| {});
|
||||
}
|
||||
|
||||
fn compile_puzzle_agent_draft_then(
|
||||
&self,
|
||||
input: PuzzleDraftCompileInput,
|
||||
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<PuzzleAgentSessionProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||
);
|
||||
}
|
||||
|
||||
impl compile_puzzle_agent_draft for super::RemoteProcedures {
|
||||
fn compile_puzzle_agent_draft_then(
|
||||
&self,
|
||||
input: PuzzleDraftCompileInput,
|
||||
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<PuzzleAgentSessionProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||
) {
|
||||
self.imp.invoke_procedure_with_callback::<_, PuzzleAgentSessionProcedureResult>(
|
||||
"compile_puzzle_agent_draft",
|
||||
CompilePuzzleAgentDraftArgs { input, },
|
||||
__callback,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
// 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::big_fish_session_procedure_result_type::BigFishSessionProcedureResult;
|
||||
use super::big_fish_session_create_input_type::BigFishSessionCreateInput;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
struct CreateBigFishSessionArgs {
|
||||
pub input: BigFishSessionCreateInput,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for CreateBigFishSessionArgs {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the procedure `create_big_fish_session`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteProcedures`].
|
||||
pub trait create_big_fish_session {
|
||||
fn create_big_fish_session(&self, input: BigFishSessionCreateInput,
|
||||
) {
|
||||
self.create_big_fish_session_then(input, |_, _| {});
|
||||
}
|
||||
|
||||
fn create_big_fish_session_then(
|
||||
&self,
|
||||
input: BigFishSessionCreateInput,
|
||||
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<BigFishSessionProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||
);
|
||||
}
|
||||
|
||||
impl create_big_fish_session for super::RemoteProcedures {
|
||||
fn create_big_fish_session_then(
|
||||
&self,
|
||||
input: BigFishSessionCreateInput,
|
||||
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<BigFishSessionProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||
) {
|
||||
self.imp.invoke_procedure_with_callback::<_, BigFishSessionProcedureResult>(
|
||||
"create_big_fish_session",
|
||||
CreateBigFishSessionArgs { input, },
|
||||
__callback,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
// 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_agent_session_create_input_type::PuzzleAgentSessionCreateInput;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
struct CreatePuzzleAgentSessionArgs {
|
||||
pub input: PuzzleAgentSessionCreateInput,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for CreatePuzzleAgentSessionArgs {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the procedure `create_puzzle_agent_session`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteProcedures`].
|
||||
pub trait create_puzzle_agent_session {
|
||||
fn create_puzzle_agent_session(&self, input: PuzzleAgentSessionCreateInput,
|
||||
) {
|
||||
self.create_puzzle_agent_session_then(input, |_, _| {});
|
||||
}
|
||||
|
||||
fn create_puzzle_agent_session_then(
|
||||
&self,
|
||||
input: PuzzleAgentSessionCreateInput,
|
||||
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<PuzzleAgentSessionProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||
);
|
||||
}
|
||||
|
||||
impl create_puzzle_agent_session for super::RemoteProcedures {
|
||||
fn create_puzzle_agent_session_then(
|
||||
&self,
|
||||
input: PuzzleAgentSessionCreateInput,
|
||||
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<PuzzleAgentSessionProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||
) {
|
||||
self.imp.invoke_procedure_with_callback::<_, PuzzleAgentSessionProcedureResult>(
|
||||
"create_puzzle_agent_session",
|
||||
CreatePuzzleAgentSessionArgs { input, },
|
||||
__callback,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
// 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_run_procedure_result_type::PuzzleRunProcedureResult;
|
||||
use super::puzzle_run_drag_input_type::PuzzleRunDragInput;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
struct DragPuzzlePieceOrGroupArgs {
|
||||
pub input: PuzzleRunDragInput,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for DragPuzzlePieceOrGroupArgs {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the procedure `drag_puzzle_piece_or_group`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteProcedures`].
|
||||
pub trait drag_puzzle_piece_or_group {
|
||||
fn drag_puzzle_piece_or_group(&self, input: PuzzleRunDragInput,
|
||||
) {
|
||||
self.drag_puzzle_piece_or_group_then(input, |_, _| {});
|
||||
}
|
||||
|
||||
fn drag_puzzle_piece_or_group_then(
|
||||
&self,
|
||||
input: PuzzleRunDragInput,
|
||||
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<PuzzleRunProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||
);
|
||||
}
|
||||
|
||||
impl drag_puzzle_piece_or_group for super::RemoteProcedures {
|
||||
fn drag_puzzle_piece_or_group_then(
|
||||
&self,
|
||||
input: PuzzleRunDragInput,
|
||||
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<PuzzleRunProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||
) {
|
||||
self.imp.invoke_procedure_with_callback::<_, PuzzleRunProcedureResult>(
|
||||
"drag_puzzle_piece_or_group",
|
||||
DragPuzzlePieceOrGroupArgs { input, },
|
||||
__callback,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
// 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::big_fish_session_procedure_result_type::BigFishSessionProcedureResult;
|
||||
use super::big_fish_asset_generate_input_type::BigFishAssetGenerateInput;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
struct GenerateBigFishAssetArgs {
|
||||
pub input: BigFishAssetGenerateInput,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for GenerateBigFishAssetArgs {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the procedure `generate_big_fish_asset`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteProcedures`].
|
||||
pub trait generate_big_fish_asset {
|
||||
fn generate_big_fish_asset(&self, input: BigFishAssetGenerateInput,
|
||||
) {
|
||||
self.generate_big_fish_asset_then(input, |_, _| {});
|
||||
}
|
||||
|
||||
fn generate_big_fish_asset_then(
|
||||
&self,
|
||||
input: BigFishAssetGenerateInput,
|
||||
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<BigFishSessionProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||
);
|
||||
}
|
||||
|
||||
impl generate_big_fish_asset for super::RemoteProcedures {
|
||||
fn generate_big_fish_asset_then(
|
||||
&self,
|
||||
input: BigFishAssetGenerateInput,
|
||||
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<BigFishSessionProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||
) {
|
||||
self.imp.invoke_procedure_with_callback::<_, BigFishSessionProcedureResult>(
|
||||
"generate_big_fish_asset",
|
||||
GenerateBigFishAssetArgs { input, },
|
||||
__callback,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
// 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::big_fish_run_get_input_type::BigFishRunGetInput;
|
||||
use super::big_fish_run_procedure_result_type::BigFishRunProcedureResult;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
struct GetBigFishRunArgs {
|
||||
pub input: BigFishRunGetInput,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for GetBigFishRunArgs {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the procedure `get_big_fish_run`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteProcedures`].
|
||||
pub trait get_big_fish_run {
|
||||
fn get_big_fish_run(&self, input: BigFishRunGetInput,
|
||||
) {
|
||||
self.get_big_fish_run_then(input, |_, _| {});
|
||||
}
|
||||
|
||||
fn get_big_fish_run_then(
|
||||
&self,
|
||||
input: BigFishRunGetInput,
|
||||
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<BigFishRunProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||
);
|
||||
}
|
||||
|
||||
impl get_big_fish_run for super::RemoteProcedures {
|
||||
fn get_big_fish_run_then(
|
||||
&self,
|
||||
input: BigFishRunGetInput,
|
||||
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<BigFishRunProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||
) {
|
||||
self.imp.invoke_procedure_with_callback::<_, BigFishRunProcedureResult>(
|
||||
"get_big_fish_run",
|
||||
GetBigFishRunArgs { input, },
|
||||
__callback,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
// 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::big_fish_session_procedure_result_type::BigFishSessionProcedureResult;
|
||||
use super::big_fish_session_get_input_type::BigFishSessionGetInput;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
struct GetBigFishSessionArgs {
|
||||
pub input: BigFishSessionGetInput,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for GetBigFishSessionArgs {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the procedure `get_big_fish_session`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteProcedures`].
|
||||
pub trait get_big_fish_session {
|
||||
fn get_big_fish_session(&self, input: BigFishSessionGetInput,
|
||||
) {
|
||||
self.get_big_fish_session_then(input, |_, _| {});
|
||||
}
|
||||
|
||||
fn get_big_fish_session_then(
|
||||
&self,
|
||||
input: BigFishSessionGetInput,
|
||||
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<BigFishSessionProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||
);
|
||||
}
|
||||
|
||||
impl get_big_fish_session for super::RemoteProcedures {
|
||||
fn get_big_fish_session_then(
|
||||
&self,
|
||||
input: BigFishSessionGetInput,
|
||||
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<BigFishSessionProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||
) {
|
||||
self.imp.invoke_procedure_with_callback::<_, BigFishSessionProcedureResult>(
|
||||
"get_big_fish_session",
|
||||
GetBigFishSessionArgs { input, },
|
||||
__callback,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
// 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_agent_session_get_input_type::PuzzleAgentSessionGetInput;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
struct GetPuzzleAgentSessionArgs {
|
||||
pub input: PuzzleAgentSessionGetInput,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for GetPuzzleAgentSessionArgs {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the procedure `get_puzzle_agent_session`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteProcedures`].
|
||||
pub trait get_puzzle_agent_session {
|
||||
fn get_puzzle_agent_session(&self, input: PuzzleAgentSessionGetInput,
|
||||
) {
|
||||
self.get_puzzle_agent_session_then(input, |_, _| {});
|
||||
}
|
||||
|
||||
fn get_puzzle_agent_session_then(
|
||||
&self,
|
||||
input: PuzzleAgentSessionGetInput,
|
||||
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<PuzzleAgentSessionProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||
);
|
||||
}
|
||||
|
||||
impl get_puzzle_agent_session for super::RemoteProcedures {
|
||||
fn get_puzzle_agent_session_then(
|
||||
&self,
|
||||
input: PuzzleAgentSessionGetInput,
|
||||
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<PuzzleAgentSessionProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||
) {
|
||||
self.imp.invoke_procedure_with_callback::<_, PuzzleAgentSessionProcedureResult>(
|
||||
"get_puzzle_agent_session",
|
||||
GetPuzzleAgentSessionArgs { input, },
|
||||
__callback,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
// 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_work_get_input_type::PuzzleWorkGetInput;
|
||||
use super::puzzle_work_procedure_result_type::PuzzleWorkProcedureResult;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
struct GetPuzzleGalleryDetailArgs {
|
||||
pub input: PuzzleWorkGetInput,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for GetPuzzleGalleryDetailArgs {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the procedure `get_puzzle_gallery_detail`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteProcedures`].
|
||||
pub trait get_puzzle_gallery_detail {
|
||||
fn get_puzzle_gallery_detail(&self, input: PuzzleWorkGetInput,
|
||||
) {
|
||||
self.get_puzzle_gallery_detail_then(input, |_, _| {});
|
||||
}
|
||||
|
||||
fn get_puzzle_gallery_detail_then(
|
||||
&self,
|
||||
input: PuzzleWorkGetInput,
|
||||
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<PuzzleWorkProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||
);
|
||||
}
|
||||
|
||||
impl get_puzzle_gallery_detail for super::RemoteProcedures {
|
||||
fn get_puzzle_gallery_detail_then(
|
||||
&self,
|
||||
input: PuzzleWorkGetInput,
|
||||
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<PuzzleWorkProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||
) {
|
||||
self.imp.invoke_procedure_with_callback::<_, PuzzleWorkProcedureResult>(
|
||||
"get_puzzle_gallery_detail",
|
||||
GetPuzzleGalleryDetailArgs { input, },
|
||||
__callback,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
// 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_run_procedure_result_type::PuzzleRunProcedureResult;
|
||||
use super::puzzle_run_get_input_type::PuzzleRunGetInput;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
struct GetPuzzleRunArgs {
|
||||
pub input: PuzzleRunGetInput,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for GetPuzzleRunArgs {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the procedure `get_puzzle_run`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteProcedures`].
|
||||
pub trait get_puzzle_run {
|
||||
fn get_puzzle_run(&self, input: PuzzleRunGetInput,
|
||||
) {
|
||||
self.get_puzzle_run_then(input, |_, _| {});
|
||||
}
|
||||
|
||||
fn get_puzzle_run_then(
|
||||
&self,
|
||||
input: PuzzleRunGetInput,
|
||||
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<PuzzleRunProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||
);
|
||||
}
|
||||
|
||||
impl get_puzzle_run for super::RemoteProcedures {
|
||||
fn get_puzzle_run_then(
|
||||
&self,
|
||||
input: PuzzleRunGetInput,
|
||||
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<PuzzleRunProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||
) {
|
||||
self.imp.invoke_procedure_with_callback::<_, PuzzleRunProcedureResult>(
|
||||
"get_puzzle_run",
|
||||
GetPuzzleRunArgs { input, },
|
||||
__callback,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
// 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_work_get_input_type::PuzzleWorkGetInput;
|
||||
use super::puzzle_work_procedure_result_type::PuzzleWorkProcedureResult;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
struct GetPuzzleWorkDetailArgs {
|
||||
pub input: PuzzleWorkGetInput,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for GetPuzzleWorkDetailArgs {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the procedure `get_puzzle_work_detail`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteProcedures`].
|
||||
pub trait get_puzzle_work_detail {
|
||||
fn get_puzzle_work_detail(&self, input: PuzzleWorkGetInput,
|
||||
) {
|
||||
self.get_puzzle_work_detail_then(input, |_, _| {});
|
||||
}
|
||||
|
||||
fn get_puzzle_work_detail_then(
|
||||
&self,
|
||||
input: PuzzleWorkGetInput,
|
||||
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<PuzzleWorkProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||
);
|
||||
}
|
||||
|
||||
impl get_puzzle_work_detail for super::RemoteProcedures {
|
||||
fn get_puzzle_work_detail_then(
|
||||
&self,
|
||||
input: PuzzleWorkGetInput,
|
||||
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<PuzzleWorkProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||
) {
|
||||
self.imp.invoke_procedure_with_callback::<_, PuzzleWorkProcedureResult>(
|
||||
"get_puzzle_work_detail",
|
||||
GetPuzzleWorkDetailArgs { input, },
|
||||
__callback,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
// 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_works_procedure_result_type::PuzzleWorksProcedureResult;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
struct ListPuzzleGalleryArgs {
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for ListPuzzleGalleryArgs {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the procedure `list_puzzle_gallery`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteProcedures`].
|
||||
pub trait list_puzzle_gallery {
|
||||
fn list_puzzle_gallery(&self, ) {
|
||||
self.list_puzzle_gallery_then( |_, _| {});
|
||||
}
|
||||
|
||||
fn list_puzzle_gallery_then(
|
||||
&self,
|
||||
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<PuzzleWorksProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||
);
|
||||
}
|
||||
|
||||
impl list_puzzle_gallery for super::RemoteProcedures {
|
||||
fn list_puzzle_gallery_then(
|
||||
&self,
|
||||
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<PuzzleWorksProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||
) {
|
||||
self.imp.invoke_procedure_with_callback::<_, PuzzleWorksProcedureResult>(
|
||||
"list_puzzle_gallery",
|
||||
ListPuzzleGalleryArgs { },
|
||||
__callback,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
// 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_works_procedure_result_type::PuzzleWorksProcedureResult;
|
||||
use super::puzzle_works_list_input_type::PuzzleWorksListInput;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
struct ListPuzzleWorksArgs {
|
||||
pub input: PuzzleWorksListInput,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for ListPuzzleWorksArgs {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the procedure `list_puzzle_works`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteProcedures`].
|
||||
pub trait list_puzzle_works {
|
||||
fn list_puzzle_works(&self, input: PuzzleWorksListInput,
|
||||
) {
|
||||
self.list_puzzle_works_then(input, |_, _| {});
|
||||
}
|
||||
|
||||
fn list_puzzle_works_then(
|
||||
&self,
|
||||
input: PuzzleWorksListInput,
|
||||
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<PuzzleWorksProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||
);
|
||||
}
|
||||
|
||||
impl list_puzzle_works for super::RemoteProcedures {
|
||||
fn list_puzzle_works_then(
|
||||
&self,
|
||||
input: PuzzleWorksListInput,
|
||||
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<PuzzleWorksProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||
) {
|
||||
self.imp.invoke_procedure_with_callback::<_, PuzzleWorksProcedureResult>(
|
||||
"list_puzzle_works",
|
||||
ListPuzzleWorksArgs { input, },
|
||||
__callback,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,6 +51,41 @@ pub mod battle_state_procedure_result_type;
|
||||
pub mod battle_state_query_input_type;
|
||||
pub mod battle_state_snapshot_type;
|
||||
pub mod battle_status_type;
|
||||
pub mod big_fish_agent_message_type;
|
||||
pub mod big_fish_agent_message_kind_type;
|
||||
pub mod big_fish_agent_message_role_type;
|
||||
pub mod big_fish_agent_message_snapshot_type;
|
||||
pub mod big_fish_anchor_item_type;
|
||||
pub mod big_fish_anchor_pack_type;
|
||||
pub mod big_fish_anchor_status_type;
|
||||
pub mod big_fish_asset_coverage_type;
|
||||
pub mod big_fish_asset_generate_input_type;
|
||||
pub mod big_fish_asset_kind_type;
|
||||
pub mod big_fish_asset_slot_type;
|
||||
pub mod big_fish_asset_slot_snapshot_type;
|
||||
pub mod big_fish_asset_status_type;
|
||||
pub mod big_fish_background_blueprint_type;
|
||||
pub mod big_fish_creation_session_type;
|
||||
pub mod big_fish_creation_stage_type;
|
||||
pub mod big_fish_draft_compile_input_type;
|
||||
pub mod big_fish_game_draft_type;
|
||||
pub mod big_fish_level_blueprint_type;
|
||||
pub mod big_fish_message_submit_input_type;
|
||||
pub mod big_fish_publish_input_type;
|
||||
pub mod big_fish_run_get_input_type;
|
||||
pub mod big_fish_run_input_submit_input_type;
|
||||
pub mod big_fish_run_procedure_result_type;
|
||||
pub mod big_fish_run_start_input_type;
|
||||
pub mod big_fish_run_status_type;
|
||||
pub mod big_fish_runtime_entity_type;
|
||||
pub mod big_fish_runtime_params_type;
|
||||
pub mod big_fish_runtime_run_type;
|
||||
pub mod big_fish_runtime_snapshot_type;
|
||||
pub mod big_fish_session_create_input_type;
|
||||
pub mod big_fish_session_get_input_type;
|
||||
pub mod big_fish_session_procedure_result_type;
|
||||
pub mod big_fish_session_snapshot_type;
|
||||
pub mod big_fish_vector_2_type;
|
||||
pub mod chapter_pace_band_type;
|
||||
pub mod chapter_progression_type;
|
||||
pub mod chapter_progression_get_input_type;
|
||||
@@ -142,6 +177,33 @@ pub mod profile_dashboard_state_type;
|
||||
pub mod profile_played_world_type;
|
||||
pub mod profile_save_archive_type;
|
||||
pub mod profile_wallet_ledger_type;
|
||||
pub mod puzzle_agent_message_kind_type;
|
||||
pub mod puzzle_agent_message_role_type;
|
||||
pub mod puzzle_agent_message_row_type;
|
||||
pub mod puzzle_agent_message_submit_input_type;
|
||||
pub mod puzzle_agent_session_create_input_type;
|
||||
pub mod puzzle_agent_session_get_input_type;
|
||||
pub mod puzzle_agent_session_procedure_result_type;
|
||||
pub mod puzzle_agent_session_row_type;
|
||||
pub mod puzzle_agent_stage_type;
|
||||
pub mod puzzle_draft_compile_input_type;
|
||||
pub mod puzzle_generated_images_save_input_type;
|
||||
pub mod puzzle_publication_status_type;
|
||||
pub mod puzzle_publish_input_type;
|
||||
pub mod puzzle_run_drag_input_type;
|
||||
pub mod puzzle_run_get_input_type;
|
||||
pub mod puzzle_run_next_level_input_type;
|
||||
pub mod puzzle_run_procedure_result_type;
|
||||
pub mod puzzle_run_start_input_type;
|
||||
pub mod puzzle_run_swap_input_type;
|
||||
pub mod puzzle_runtime_run_row_type;
|
||||
pub mod puzzle_select_cover_image_input_type;
|
||||
pub mod puzzle_work_get_input_type;
|
||||
pub mod puzzle_work_procedure_result_type;
|
||||
pub mod puzzle_work_profile_row_type;
|
||||
pub mod puzzle_work_upsert_input_type;
|
||||
pub mod puzzle_works_list_input_type;
|
||||
pub mod puzzle_works_procedure_result_type;
|
||||
pub mod quest_completion_ack_input_type;
|
||||
pub mod quest_hostile_npc_defeated_signal_type;
|
||||
pub mod quest_item_delivered_signal_type;
|
||||
@@ -271,6 +333,10 @@ pub mod ai_text_chunk_table;
|
||||
pub mod asset_entity_binding_table;
|
||||
pub mod asset_object_table;
|
||||
pub mod battle_state_table;
|
||||
pub mod big_fish_agent_message_table;
|
||||
pub mod big_fish_asset_slot_table;
|
||||
pub mod big_fish_creation_session_table;
|
||||
pub mod big_fish_runtime_run_table;
|
||||
pub mod chapter_progression_table;
|
||||
pub mod custom_world_agent_message_table;
|
||||
pub mod custom_world_agent_operation_table;
|
||||
@@ -286,6 +352,10 @@ pub mod profile_dashboard_state_table;
|
||||
pub mod profile_played_world_table;
|
||||
pub mod profile_save_archive_table;
|
||||
pub mod profile_wallet_ledger_table;
|
||||
pub mod puzzle_agent_message_table;
|
||||
pub mod puzzle_agent_session_table;
|
||||
pub mod puzzle_runtime_run_table;
|
||||
pub mod puzzle_work_profile_table;
|
||||
pub mod quest_log_table;
|
||||
pub mod quest_record_table;
|
||||
pub mod runtime_setting_table;
|
||||
@@ -294,6 +364,7 @@ pub mod story_event_table;
|
||||
pub mod story_session_table;
|
||||
pub mod treasure_record_table;
|
||||
pub mod user_browse_history_table;
|
||||
pub mod advance_puzzle_next_level_procedure;
|
||||
pub mod append_ai_text_chunk_and_return_procedure;
|
||||
pub mod apply_chapter_progression_ledger_entry_and_return_procedure;
|
||||
pub mod attach_ai_result_reference_and_return_procedure;
|
||||
@@ -301,18 +372,26 @@ pub mod begin_story_session_and_return_procedure;
|
||||
pub mod bind_asset_object_to_entity_and_return_procedure;
|
||||
pub mod cancel_ai_task_and_return_procedure;
|
||||
pub mod clear_platform_browse_history_and_return_procedure;
|
||||
pub mod compile_big_fish_draft_procedure;
|
||||
pub mod compile_custom_world_published_profile_procedure;
|
||||
pub mod compile_puzzle_agent_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;
|
||||
pub mod continue_story_and_return_procedure;
|
||||
pub mod create_ai_task_and_return_procedure;
|
||||
pub mod create_battle_state_and_return_procedure;
|
||||
pub mod create_big_fish_session_procedure;
|
||||
pub mod create_custom_world_agent_session_procedure;
|
||||
pub mod create_puzzle_agent_session_procedure;
|
||||
pub mod delete_runtime_snapshot_and_return_procedure;
|
||||
pub mod drag_puzzle_piece_or_group_procedure;
|
||||
pub mod execute_custom_world_agent_action_procedure;
|
||||
pub mod fail_ai_task_and_return_procedure;
|
||||
pub mod generate_big_fish_asset_procedure;
|
||||
pub mod get_battle_state_procedure;
|
||||
pub mod get_big_fish_run_procedure;
|
||||
pub mod get_big_fish_session_procedure;
|
||||
pub mod get_chapter_progression_procedure;
|
||||
pub mod get_custom_world_agent_card_detail_procedure;
|
||||
pub mod get_custom_world_agent_operation_procedure;
|
||||
@@ -322,6 +401,10 @@ pub mod get_custom_world_library_detail_procedure;
|
||||
pub mod get_player_progression_or_default_procedure;
|
||||
pub mod get_profile_dashboard_procedure;
|
||||
pub mod get_profile_play_stats_procedure;
|
||||
pub mod get_puzzle_agent_session_procedure;
|
||||
pub mod get_puzzle_gallery_detail_procedure;
|
||||
pub mod get_puzzle_run_procedure;
|
||||
pub mod get_puzzle_work_detail_procedure;
|
||||
pub mod get_runtime_inventory_state_procedure;
|
||||
pub mod get_runtime_setting_or_default_procedure;
|
||||
pub mod get_runtime_snapshot_procedure;
|
||||
@@ -333,16 +416,29 @@ pub mod list_custom_world_works_procedure;
|
||||
pub mod list_platform_browse_history_procedure;
|
||||
pub mod list_profile_save_archives_procedure;
|
||||
pub mod list_profile_wallet_ledger_procedure;
|
||||
pub mod list_puzzle_gallery_procedure;
|
||||
pub mod list_puzzle_works_procedure;
|
||||
pub mod publish_big_fish_game_procedure;
|
||||
pub mod publish_custom_world_profile_and_return_procedure;
|
||||
pub mod publish_custom_world_world_procedure;
|
||||
pub mod publish_puzzle_work_procedure;
|
||||
pub mod resolve_combat_action_and_return_procedure;
|
||||
pub mod resolve_npc_battle_interaction_and_return_procedure;
|
||||
pub mod resolve_npc_interaction_and_return_procedure;
|
||||
pub mod resolve_npc_social_action_and_return_procedure;
|
||||
pub mod resolve_treasure_interaction_and_return_procedure;
|
||||
pub mod resume_profile_save_archive_and_return_procedure;
|
||||
pub mod save_puzzle_generated_images_procedure;
|
||||
pub mod select_puzzle_cover_image_procedure;
|
||||
pub mod start_big_fish_run_procedure;
|
||||
pub mod start_puzzle_run_procedure;
|
||||
pub mod submit_big_fish_input_procedure;
|
||||
pub mod submit_big_fish_message_procedure;
|
||||
pub mod submit_custom_world_agent_message_procedure;
|
||||
pub mod submit_puzzle_agent_message_procedure;
|
||||
pub mod swap_puzzle_pieces_procedure;
|
||||
pub mod unpublish_custom_world_profile_and_return_procedure;
|
||||
pub mod update_puzzle_work_procedure;
|
||||
pub mod upsert_chapter_progression_and_return_procedure;
|
||||
pub mod upsert_custom_world_profile_and_return_procedure;
|
||||
pub mod upsert_npc_state_and_return_procedure;
|
||||
@@ -390,6 +486,41 @@ pub use battle_state_procedure_result_type::BattleStateProcedureResult;
|
||||
pub use battle_state_query_input_type::BattleStateQueryInput;
|
||||
pub use battle_state_snapshot_type::BattleStateSnapshot;
|
||||
pub use battle_status_type::BattleStatus;
|
||||
pub use big_fish_agent_message_type::BigFishAgentMessage;
|
||||
pub use big_fish_agent_message_kind_type::BigFishAgentMessageKind;
|
||||
pub use big_fish_agent_message_role_type::BigFishAgentMessageRole;
|
||||
pub use big_fish_agent_message_snapshot_type::BigFishAgentMessageSnapshot;
|
||||
pub use big_fish_anchor_item_type::BigFishAnchorItem;
|
||||
pub use big_fish_anchor_pack_type::BigFishAnchorPack;
|
||||
pub use big_fish_anchor_status_type::BigFishAnchorStatus;
|
||||
pub use big_fish_asset_coverage_type::BigFishAssetCoverage;
|
||||
pub use big_fish_asset_generate_input_type::BigFishAssetGenerateInput;
|
||||
pub use big_fish_asset_kind_type::BigFishAssetKind;
|
||||
pub use big_fish_asset_slot_type::BigFishAssetSlot;
|
||||
pub use big_fish_asset_slot_snapshot_type::BigFishAssetSlotSnapshot;
|
||||
pub use big_fish_asset_status_type::BigFishAssetStatus;
|
||||
pub use big_fish_background_blueprint_type::BigFishBackgroundBlueprint;
|
||||
pub use big_fish_creation_session_type::BigFishCreationSession;
|
||||
pub use big_fish_creation_stage_type::BigFishCreationStage;
|
||||
pub use big_fish_draft_compile_input_type::BigFishDraftCompileInput;
|
||||
pub use big_fish_game_draft_type::BigFishGameDraft;
|
||||
pub use big_fish_level_blueprint_type::BigFishLevelBlueprint;
|
||||
pub use big_fish_message_submit_input_type::BigFishMessageSubmitInput;
|
||||
pub use big_fish_publish_input_type::BigFishPublishInput;
|
||||
pub use big_fish_run_get_input_type::BigFishRunGetInput;
|
||||
pub use big_fish_run_input_submit_input_type::BigFishRunInputSubmitInput;
|
||||
pub use big_fish_run_procedure_result_type::BigFishRunProcedureResult;
|
||||
pub use big_fish_run_start_input_type::BigFishRunStartInput;
|
||||
pub use big_fish_run_status_type::BigFishRunStatus;
|
||||
pub use big_fish_runtime_entity_type::BigFishRuntimeEntity;
|
||||
pub use big_fish_runtime_params_type::BigFishRuntimeParams;
|
||||
pub use big_fish_runtime_run_type::BigFishRuntimeRun;
|
||||
pub use big_fish_runtime_snapshot_type::BigFishRuntimeSnapshot;
|
||||
pub use big_fish_session_create_input_type::BigFishSessionCreateInput;
|
||||
pub use big_fish_session_get_input_type::BigFishSessionGetInput;
|
||||
pub use big_fish_session_procedure_result_type::BigFishSessionProcedureResult;
|
||||
pub use big_fish_session_snapshot_type::BigFishSessionSnapshot;
|
||||
pub use big_fish_vector_2_type::BigFishVector2;
|
||||
pub use chapter_pace_band_type::ChapterPaceBand;
|
||||
pub use chapter_progression_type::ChapterProgression;
|
||||
pub use chapter_progression_get_input_type::ChapterProgressionGetInput;
|
||||
@@ -481,6 +612,33 @@ pub use profile_dashboard_state_type::ProfileDashboardState;
|
||||
pub use profile_played_world_type::ProfilePlayedWorld;
|
||||
pub use profile_save_archive_type::ProfileSaveArchive;
|
||||
pub use profile_wallet_ledger_type::ProfileWalletLedger;
|
||||
pub use puzzle_agent_message_kind_type::PuzzleAgentMessageKind;
|
||||
pub use puzzle_agent_message_role_type::PuzzleAgentMessageRole;
|
||||
pub use puzzle_agent_message_row_type::PuzzleAgentMessageRow;
|
||||
pub use puzzle_agent_message_submit_input_type::PuzzleAgentMessageSubmitInput;
|
||||
pub use puzzle_agent_session_create_input_type::PuzzleAgentSessionCreateInput;
|
||||
pub use puzzle_agent_session_get_input_type::PuzzleAgentSessionGetInput;
|
||||
pub use puzzle_agent_session_procedure_result_type::PuzzleAgentSessionProcedureResult;
|
||||
pub use puzzle_agent_session_row_type::PuzzleAgentSessionRow;
|
||||
pub use puzzle_agent_stage_type::PuzzleAgentStage;
|
||||
pub use puzzle_draft_compile_input_type::PuzzleDraftCompileInput;
|
||||
pub use puzzle_generated_images_save_input_type::PuzzleGeneratedImagesSaveInput;
|
||||
pub use puzzle_publication_status_type::PuzzlePublicationStatus;
|
||||
pub use puzzle_publish_input_type::PuzzlePublishInput;
|
||||
pub use puzzle_run_drag_input_type::PuzzleRunDragInput;
|
||||
pub use puzzle_run_get_input_type::PuzzleRunGetInput;
|
||||
pub use puzzle_run_next_level_input_type::PuzzleRunNextLevelInput;
|
||||
pub use puzzle_run_procedure_result_type::PuzzleRunProcedureResult;
|
||||
pub use puzzle_run_start_input_type::PuzzleRunStartInput;
|
||||
pub use puzzle_run_swap_input_type::PuzzleRunSwapInput;
|
||||
pub use puzzle_runtime_run_row_type::PuzzleRuntimeRunRow;
|
||||
pub use puzzle_select_cover_image_input_type::PuzzleSelectCoverImageInput;
|
||||
pub use puzzle_work_get_input_type::PuzzleWorkGetInput;
|
||||
pub use puzzle_work_procedure_result_type::PuzzleWorkProcedureResult;
|
||||
pub use puzzle_work_profile_row_type::PuzzleWorkProfileRow;
|
||||
pub use puzzle_work_upsert_input_type::PuzzleWorkUpsertInput;
|
||||
pub use puzzle_works_list_input_type::PuzzleWorksListInput;
|
||||
pub use puzzle_works_procedure_result_type::PuzzleWorksProcedureResult;
|
||||
pub use quest_completion_ack_input_type::QuestCompletionAckInput;
|
||||
pub use quest_hostile_npc_defeated_signal_type::QuestHostileNpcDefeatedSignal;
|
||||
pub use quest_item_delivered_signal_type::QuestItemDeliveredSignal;
|
||||
@@ -586,6 +744,10 @@ pub use ai_text_chunk_table::*;
|
||||
pub use asset_entity_binding_table::*;
|
||||
pub use asset_object_table::*;
|
||||
pub use battle_state_table::*;
|
||||
pub use big_fish_agent_message_table::*;
|
||||
pub use big_fish_asset_slot_table::*;
|
||||
pub use big_fish_creation_session_table::*;
|
||||
pub use big_fish_runtime_run_table::*;
|
||||
pub use chapter_progression_table::*;
|
||||
pub use custom_world_agent_message_table::*;
|
||||
pub use custom_world_agent_operation_table::*;
|
||||
@@ -601,6 +763,10 @@ pub use profile_dashboard_state_table::*;
|
||||
pub use profile_played_world_table::*;
|
||||
pub use profile_save_archive_table::*;
|
||||
pub use profile_wallet_ledger_table::*;
|
||||
pub use puzzle_agent_message_table::*;
|
||||
pub use puzzle_agent_session_table::*;
|
||||
pub use puzzle_runtime_run_table::*;
|
||||
pub use puzzle_work_profile_table::*;
|
||||
pub use quest_log_table::*;
|
||||
pub use quest_record_table::*;
|
||||
pub use runtime_setting_table::*;
|
||||
@@ -633,6 +799,7 @@ pub use unpublish_custom_world_profile_reducer::unpublish_custom_world_profile;
|
||||
pub use upsert_chapter_progression_reducer::upsert_chapter_progression;
|
||||
pub use upsert_custom_world_profile_reducer::upsert_custom_world_profile;
|
||||
pub use upsert_npc_state_reducer::upsert_npc_state;
|
||||
pub use advance_puzzle_next_level_procedure::advance_puzzle_next_level;
|
||||
pub use append_ai_text_chunk_and_return_procedure::append_ai_text_chunk_and_return;
|
||||
pub use apply_chapter_progression_ledger_entry_and_return_procedure::apply_chapter_progression_ledger_entry_and_return;
|
||||
pub use attach_ai_result_reference_and_return_procedure::attach_ai_result_reference_and_return;
|
||||
@@ -640,18 +807,26 @@ pub use begin_story_session_and_return_procedure::begin_story_session_and_return
|
||||
pub use bind_asset_object_to_entity_and_return_procedure::bind_asset_object_to_entity_and_return;
|
||||
pub use cancel_ai_task_and_return_procedure::cancel_ai_task_and_return;
|
||||
pub use clear_platform_browse_history_and_return_procedure::clear_platform_browse_history_and_return;
|
||||
pub use compile_big_fish_draft_procedure::compile_big_fish_draft;
|
||||
pub use compile_custom_world_published_profile_procedure::compile_custom_world_published_profile;
|
||||
pub use compile_puzzle_agent_draft_procedure::compile_puzzle_agent_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;
|
||||
pub use continue_story_and_return_procedure::continue_story_and_return;
|
||||
pub use create_ai_task_and_return_procedure::create_ai_task_and_return;
|
||||
pub use create_battle_state_and_return_procedure::create_battle_state_and_return;
|
||||
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_puzzle_agent_session_procedure::create_puzzle_agent_session;
|
||||
pub use delete_runtime_snapshot_and_return_procedure::delete_runtime_snapshot_and_return;
|
||||
pub use drag_puzzle_piece_or_group_procedure::drag_puzzle_piece_or_group;
|
||||
pub use execute_custom_world_agent_action_procedure::execute_custom_world_agent_action;
|
||||
pub use fail_ai_task_and_return_procedure::fail_ai_task_and_return;
|
||||
pub use generate_big_fish_asset_procedure::generate_big_fish_asset;
|
||||
pub use get_battle_state_procedure::get_battle_state;
|
||||
pub use get_big_fish_run_procedure::get_big_fish_run;
|
||||
pub use get_big_fish_session_procedure::get_big_fish_session;
|
||||
pub use get_chapter_progression_procedure::get_chapter_progression;
|
||||
pub use get_custom_world_agent_card_detail_procedure::get_custom_world_agent_card_detail;
|
||||
pub use get_custom_world_agent_operation_procedure::get_custom_world_agent_operation;
|
||||
@@ -661,6 +836,10 @@ pub use get_custom_world_library_detail_procedure::get_custom_world_library_deta
|
||||
pub use get_player_progression_or_default_procedure::get_player_progression_or_default;
|
||||
pub use get_profile_dashboard_procedure::get_profile_dashboard;
|
||||
pub use get_profile_play_stats_procedure::get_profile_play_stats;
|
||||
pub use get_puzzle_agent_session_procedure::get_puzzle_agent_session;
|
||||
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_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;
|
||||
@@ -672,16 +851,29 @@ pub use list_custom_world_works_procedure::list_custom_world_works;
|
||||
pub use list_platform_browse_history_procedure::list_platform_browse_history;
|
||||
pub use list_profile_save_archives_procedure::list_profile_save_archives;
|
||||
pub use list_profile_wallet_ledger_procedure::list_profile_wallet_ledger;
|
||||
pub use list_puzzle_gallery_procedure::list_puzzle_gallery;
|
||||
pub use list_puzzle_works_procedure::list_puzzle_works;
|
||||
pub use publish_big_fish_game_procedure::publish_big_fish_game;
|
||||
pub use publish_custom_world_profile_and_return_procedure::publish_custom_world_profile_and_return;
|
||||
pub use publish_custom_world_world_procedure::publish_custom_world_world;
|
||||
pub use publish_puzzle_work_procedure::publish_puzzle_work;
|
||||
pub use resolve_combat_action_and_return_procedure::resolve_combat_action_and_return;
|
||||
pub use resolve_npc_battle_interaction_and_return_procedure::resolve_npc_battle_interaction_and_return;
|
||||
pub use resolve_npc_interaction_and_return_procedure::resolve_npc_interaction_and_return;
|
||||
pub use resolve_npc_social_action_and_return_procedure::resolve_npc_social_action_and_return;
|
||||
pub use resolve_treasure_interaction_and_return_procedure::resolve_treasure_interaction_and_return;
|
||||
pub use resume_profile_save_archive_and_return_procedure::resume_profile_save_archive_and_return;
|
||||
pub use save_puzzle_generated_images_procedure::save_puzzle_generated_images;
|
||||
pub use select_puzzle_cover_image_procedure::select_puzzle_cover_image;
|
||||
pub use start_big_fish_run_procedure::start_big_fish_run;
|
||||
pub use start_puzzle_run_procedure::start_puzzle_run;
|
||||
pub use submit_big_fish_input_procedure::submit_big_fish_input;
|
||||
pub use submit_big_fish_message_procedure::submit_big_fish_message;
|
||||
pub use submit_custom_world_agent_message_procedure::submit_custom_world_agent_message;
|
||||
pub use submit_puzzle_agent_message_procedure::submit_puzzle_agent_message;
|
||||
pub use swap_puzzle_pieces_procedure::swap_puzzle_pieces;
|
||||
pub use unpublish_custom_world_profile_and_return_procedure::unpublish_custom_world_profile_and_return;
|
||||
pub use update_puzzle_work_procedure::update_puzzle_work;
|
||||
pub use upsert_chapter_progression_and_return_procedure::upsert_chapter_progression_and_return;
|
||||
pub use upsert_custom_world_profile_and_return_procedure::upsert_custom_world_profile_and_return;
|
||||
pub use upsert_npc_state_and_return_procedure::upsert_npc_state_and_return;
|
||||
@@ -945,6 +1137,10 @@ pub struct DbUpdate {
|
||||
asset_entity_binding: __sdk::TableUpdate<AssetEntityBinding>,
|
||||
asset_object: __sdk::TableUpdate<AssetObject>,
|
||||
battle_state: __sdk::TableUpdate<BattleState>,
|
||||
big_fish_agent_message: __sdk::TableUpdate<BigFishAgentMessage>,
|
||||
big_fish_asset_slot: __sdk::TableUpdate<BigFishAssetSlot>,
|
||||
big_fish_creation_session: __sdk::TableUpdate<BigFishCreationSession>,
|
||||
big_fish_runtime_run: __sdk::TableUpdate<BigFishRuntimeRun>,
|
||||
chapter_progression: __sdk::TableUpdate<ChapterProgression>,
|
||||
custom_world_agent_message: __sdk::TableUpdate<CustomWorldAgentMessage>,
|
||||
custom_world_agent_operation: __sdk::TableUpdate<CustomWorldAgentOperation>,
|
||||
@@ -960,6 +1156,10 @@ pub struct DbUpdate {
|
||||
profile_played_world: __sdk::TableUpdate<ProfilePlayedWorld>,
|
||||
profile_save_archive: __sdk::TableUpdate<ProfileSaveArchive>,
|
||||
profile_wallet_ledger: __sdk::TableUpdate<ProfileWalletLedger>,
|
||||
puzzle_agent_message: __sdk::TableUpdate<PuzzleAgentMessageRow>,
|
||||
puzzle_agent_session: __sdk::TableUpdate<PuzzleAgentSessionRow>,
|
||||
puzzle_runtime_run: __sdk::TableUpdate<PuzzleRuntimeRunRow>,
|
||||
puzzle_work_profile: __sdk::TableUpdate<PuzzleWorkProfileRow>,
|
||||
quest_log: __sdk::TableUpdate<QuestLog>,
|
||||
quest_record: __sdk::TableUpdate<QuestRecord>,
|
||||
runtime_setting: __sdk::TableUpdate<RuntimeSetting>,
|
||||
@@ -985,6 +1185,10 @@ impl TryFrom<__ws::v2::TransactionUpdate> for DbUpdate {
|
||||
"asset_entity_binding" => db_update.asset_entity_binding.append(asset_entity_binding_table::parse_table_update(table_update)?),
|
||||
"asset_object" => db_update.asset_object.append(asset_object_table::parse_table_update(table_update)?),
|
||||
"battle_state" => db_update.battle_state.append(battle_state_table::parse_table_update(table_update)?),
|
||||
"big_fish_agent_message" => db_update.big_fish_agent_message.append(big_fish_agent_message_table::parse_table_update(table_update)?),
|
||||
"big_fish_asset_slot" => db_update.big_fish_asset_slot.append(big_fish_asset_slot_table::parse_table_update(table_update)?),
|
||||
"big_fish_creation_session" => db_update.big_fish_creation_session.append(big_fish_creation_session_table::parse_table_update(table_update)?),
|
||||
"big_fish_runtime_run" => db_update.big_fish_runtime_run.append(big_fish_runtime_run_table::parse_table_update(table_update)?),
|
||||
"chapter_progression" => db_update.chapter_progression.append(chapter_progression_table::parse_table_update(table_update)?),
|
||||
"custom_world_agent_message" => db_update.custom_world_agent_message.append(custom_world_agent_message_table::parse_table_update(table_update)?),
|
||||
"custom_world_agent_operation" => db_update.custom_world_agent_operation.append(custom_world_agent_operation_table::parse_table_update(table_update)?),
|
||||
@@ -1000,6 +1204,10 @@ impl TryFrom<__ws::v2::TransactionUpdate> for DbUpdate {
|
||||
"profile_played_world" => db_update.profile_played_world.append(profile_played_world_table::parse_table_update(table_update)?),
|
||||
"profile_save_archive" => db_update.profile_save_archive.append(profile_save_archive_table::parse_table_update(table_update)?),
|
||||
"profile_wallet_ledger" => db_update.profile_wallet_ledger.append(profile_wallet_ledger_table::parse_table_update(table_update)?),
|
||||
"puzzle_agent_message" => db_update.puzzle_agent_message.append(puzzle_agent_message_table::parse_table_update(table_update)?),
|
||||
"puzzle_agent_session" => db_update.puzzle_agent_session.append(puzzle_agent_session_table::parse_table_update(table_update)?),
|
||||
"puzzle_runtime_run" => db_update.puzzle_runtime_run.append(puzzle_runtime_run_table::parse_table_update(table_update)?),
|
||||
"puzzle_work_profile" => db_update.puzzle_work_profile.append(puzzle_work_profile_table::parse_table_update(table_update)?),
|
||||
"quest_log" => db_update.quest_log.append(quest_log_table::parse_table_update(table_update)?),
|
||||
"quest_record" => db_update.quest_record.append(quest_record_table::parse_table_update(table_update)?),
|
||||
"runtime_setting" => db_update.runtime_setting.append(runtime_setting_table::parse_table_update(table_update)?),
|
||||
@@ -1037,6 +1245,10 @@ impl __sdk::DbUpdate for DbUpdate {
|
||||
diff.asset_entity_binding = cache.apply_diff_to_table::<AssetEntityBinding>("asset_entity_binding", &self.asset_entity_binding).with_updates_by_pk(|row| &row.binding_id);
|
||||
diff.asset_object = cache.apply_diff_to_table::<AssetObject>("asset_object", &self.asset_object).with_updates_by_pk(|row| &row.asset_object_id);
|
||||
diff.battle_state = cache.apply_diff_to_table::<BattleState>("battle_state", &self.battle_state).with_updates_by_pk(|row| &row.battle_state_id);
|
||||
diff.big_fish_agent_message = cache.apply_diff_to_table::<BigFishAgentMessage>("big_fish_agent_message", &self.big_fish_agent_message).with_updates_by_pk(|row| &row.message_id);
|
||||
diff.big_fish_asset_slot = cache.apply_diff_to_table::<BigFishAssetSlot>("big_fish_asset_slot", &self.big_fish_asset_slot).with_updates_by_pk(|row| &row.slot_id);
|
||||
diff.big_fish_creation_session = cache.apply_diff_to_table::<BigFishCreationSession>("big_fish_creation_session", &self.big_fish_creation_session).with_updates_by_pk(|row| &row.session_id);
|
||||
diff.big_fish_runtime_run = cache.apply_diff_to_table::<BigFishRuntimeRun>("big_fish_runtime_run", &self.big_fish_runtime_run).with_updates_by_pk(|row| &row.run_id);
|
||||
diff.chapter_progression = cache.apply_diff_to_table::<ChapterProgression>("chapter_progression", &self.chapter_progression).with_updates_by_pk(|row| &row.chapter_progression_id);
|
||||
diff.custom_world_agent_message = cache.apply_diff_to_table::<CustomWorldAgentMessage>("custom_world_agent_message", &self.custom_world_agent_message).with_updates_by_pk(|row| &row.message_id);
|
||||
diff.custom_world_agent_operation = cache.apply_diff_to_table::<CustomWorldAgentOperation>("custom_world_agent_operation", &self.custom_world_agent_operation).with_updates_by_pk(|row| &row.operation_id);
|
||||
@@ -1052,6 +1264,10 @@ impl __sdk::DbUpdate for DbUpdate {
|
||||
diff.profile_played_world = cache.apply_diff_to_table::<ProfilePlayedWorld>("profile_played_world", &self.profile_played_world).with_updates_by_pk(|row| &row.played_world_id);
|
||||
diff.profile_save_archive = cache.apply_diff_to_table::<ProfileSaveArchive>("profile_save_archive", &self.profile_save_archive).with_updates_by_pk(|row| &row.archive_id);
|
||||
diff.profile_wallet_ledger = cache.apply_diff_to_table::<ProfileWalletLedger>("profile_wallet_ledger", &self.profile_wallet_ledger).with_updates_by_pk(|row| &row.wallet_ledger_id);
|
||||
diff.puzzle_agent_message = cache.apply_diff_to_table::<PuzzleAgentMessageRow>("puzzle_agent_message", &self.puzzle_agent_message).with_updates_by_pk(|row| &row.message_id);
|
||||
diff.puzzle_agent_session = cache.apply_diff_to_table::<PuzzleAgentSessionRow>("puzzle_agent_session", &self.puzzle_agent_session).with_updates_by_pk(|row| &row.session_id);
|
||||
diff.puzzle_runtime_run = cache.apply_diff_to_table::<PuzzleRuntimeRunRow>("puzzle_runtime_run", &self.puzzle_runtime_run).with_updates_by_pk(|row| &row.run_id);
|
||||
diff.puzzle_work_profile = cache.apply_diff_to_table::<PuzzleWorkProfileRow>("puzzle_work_profile", &self.puzzle_work_profile).with_updates_by_pk(|row| &row.profile_id);
|
||||
diff.quest_log = cache.apply_diff_to_table::<QuestLog>("quest_log", &self.quest_log).with_updates_by_pk(|row| &row.log_id);
|
||||
diff.quest_record = cache.apply_diff_to_table::<QuestRecord>("quest_record", &self.quest_record).with_updates_by_pk(|row| &row.quest_id);
|
||||
diff.runtime_setting = cache.apply_diff_to_table::<RuntimeSetting>("runtime_setting", &self.runtime_setting).with_updates_by_pk(|row| &row.user_id);
|
||||
@@ -1074,6 +1290,10 @@ for table_rows in raw.tables {
|
||||
"asset_entity_binding" => db_update.asset_entity_binding.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"asset_object" => db_update.asset_object.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"battle_state" => db_update.battle_state.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"big_fish_agent_message" => db_update.big_fish_agent_message.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"big_fish_asset_slot" => db_update.big_fish_asset_slot.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"big_fish_creation_session" => db_update.big_fish_creation_session.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"big_fish_runtime_run" => db_update.big_fish_runtime_run.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"chapter_progression" => db_update.chapter_progression.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"custom_world_agent_message" => db_update.custom_world_agent_message.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"custom_world_agent_operation" => db_update.custom_world_agent_operation.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
@@ -1089,6 +1309,10 @@ for table_rows in raw.tables {
|
||||
"profile_played_world" => db_update.profile_played_world.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"profile_save_archive" => db_update.profile_save_archive.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"profile_wallet_ledger" => db_update.profile_wallet_ledger.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"puzzle_agent_message" => db_update.puzzle_agent_message.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"puzzle_agent_session" => db_update.puzzle_agent_session.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"puzzle_runtime_run" => db_update.puzzle_runtime_run.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"puzzle_work_profile" => db_update.puzzle_work_profile.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"quest_log" => db_update.quest_log.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"quest_record" => db_update.quest_record.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"runtime_setting" => db_update.runtime_setting.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
@@ -1111,6 +1335,10 @@ for table_rows in raw.tables {
|
||||
"asset_entity_binding" => db_update.asset_entity_binding.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"asset_object" => db_update.asset_object.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"battle_state" => db_update.battle_state.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"big_fish_agent_message" => db_update.big_fish_agent_message.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"big_fish_asset_slot" => db_update.big_fish_asset_slot.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"big_fish_creation_session" => db_update.big_fish_creation_session.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"big_fish_runtime_run" => db_update.big_fish_runtime_run.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"chapter_progression" => db_update.chapter_progression.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"custom_world_agent_message" => db_update.custom_world_agent_message.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"custom_world_agent_operation" => db_update.custom_world_agent_operation.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
@@ -1126,6 +1354,10 @@ for table_rows in raw.tables {
|
||||
"profile_played_world" => db_update.profile_played_world.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"profile_save_archive" => db_update.profile_save_archive.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"profile_wallet_ledger" => db_update.profile_wallet_ledger.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"puzzle_agent_message" => db_update.puzzle_agent_message.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"puzzle_agent_session" => db_update.puzzle_agent_session.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"puzzle_runtime_run" => db_update.puzzle_runtime_run.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"puzzle_work_profile" => db_update.puzzle_work_profile.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"quest_log" => db_update.quest_log.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"quest_record" => db_update.quest_record.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"runtime_setting" => db_update.runtime_setting.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
@@ -1150,6 +1382,10 @@ pub struct AppliedDiff<'r> {
|
||||
asset_entity_binding: __sdk::TableAppliedDiff<'r, AssetEntityBinding>,
|
||||
asset_object: __sdk::TableAppliedDiff<'r, AssetObject>,
|
||||
battle_state: __sdk::TableAppliedDiff<'r, BattleState>,
|
||||
big_fish_agent_message: __sdk::TableAppliedDiff<'r, BigFishAgentMessage>,
|
||||
big_fish_asset_slot: __sdk::TableAppliedDiff<'r, BigFishAssetSlot>,
|
||||
big_fish_creation_session: __sdk::TableAppliedDiff<'r, BigFishCreationSession>,
|
||||
big_fish_runtime_run: __sdk::TableAppliedDiff<'r, BigFishRuntimeRun>,
|
||||
chapter_progression: __sdk::TableAppliedDiff<'r, ChapterProgression>,
|
||||
custom_world_agent_message: __sdk::TableAppliedDiff<'r, CustomWorldAgentMessage>,
|
||||
custom_world_agent_operation: __sdk::TableAppliedDiff<'r, CustomWorldAgentOperation>,
|
||||
@@ -1165,6 +1401,10 @@ pub struct AppliedDiff<'r> {
|
||||
profile_played_world: __sdk::TableAppliedDiff<'r, ProfilePlayedWorld>,
|
||||
profile_save_archive: __sdk::TableAppliedDiff<'r, ProfileSaveArchive>,
|
||||
profile_wallet_ledger: __sdk::TableAppliedDiff<'r, ProfileWalletLedger>,
|
||||
puzzle_agent_message: __sdk::TableAppliedDiff<'r, PuzzleAgentMessageRow>,
|
||||
puzzle_agent_session: __sdk::TableAppliedDiff<'r, PuzzleAgentSessionRow>,
|
||||
puzzle_runtime_run: __sdk::TableAppliedDiff<'r, PuzzleRuntimeRunRow>,
|
||||
puzzle_work_profile: __sdk::TableAppliedDiff<'r, PuzzleWorkProfileRow>,
|
||||
quest_log: __sdk::TableAppliedDiff<'r, QuestLog>,
|
||||
quest_record: __sdk::TableAppliedDiff<'r, QuestRecord>,
|
||||
runtime_setting: __sdk::TableAppliedDiff<'r, RuntimeSetting>,
|
||||
@@ -1190,6 +1430,10 @@ impl<'r> __sdk::AppliedDiff<'r> for AppliedDiff<'r> {
|
||||
callbacks.invoke_table_row_callbacks::<AssetEntityBinding>("asset_entity_binding", &self.asset_entity_binding, event);
|
||||
callbacks.invoke_table_row_callbacks::<AssetObject>("asset_object", &self.asset_object, event);
|
||||
callbacks.invoke_table_row_callbacks::<BattleState>("battle_state", &self.battle_state, event);
|
||||
callbacks.invoke_table_row_callbacks::<BigFishAgentMessage>("big_fish_agent_message", &self.big_fish_agent_message, event);
|
||||
callbacks.invoke_table_row_callbacks::<BigFishAssetSlot>("big_fish_asset_slot", &self.big_fish_asset_slot, event);
|
||||
callbacks.invoke_table_row_callbacks::<BigFishCreationSession>("big_fish_creation_session", &self.big_fish_creation_session, event);
|
||||
callbacks.invoke_table_row_callbacks::<BigFishRuntimeRun>("big_fish_runtime_run", &self.big_fish_runtime_run, event);
|
||||
callbacks.invoke_table_row_callbacks::<ChapterProgression>("chapter_progression", &self.chapter_progression, event);
|
||||
callbacks.invoke_table_row_callbacks::<CustomWorldAgentMessage>("custom_world_agent_message", &self.custom_world_agent_message, event);
|
||||
callbacks.invoke_table_row_callbacks::<CustomWorldAgentOperation>("custom_world_agent_operation", &self.custom_world_agent_operation, event);
|
||||
@@ -1205,6 +1449,10 @@ impl<'r> __sdk::AppliedDiff<'r> for AppliedDiff<'r> {
|
||||
callbacks.invoke_table_row_callbacks::<ProfilePlayedWorld>("profile_played_world", &self.profile_played_world, event);
|
||||
callbacks.invoke_table_row_callbacks::<ProfileSaveArchive>("profile_save_archive", &self.profile_save_archive, event);
|
||||
callbacks.invoke_table_row_callbacks::<ProfileWalletLedger>("profile_wallet_ledger", &self.profile_wallet_ledger, event);
|
||||
callbacks.invoke_table_row_callbacks::<PuzzleAgentMessageRow>("puzzle_agent_message", &self.puzzle_agent_message, event);
|
||||
callbacks.invoke_table_row_callbacks::<PuzzleAgentSessionRow>("puzzle_agent_session", &self.puzzle_agent_session, event);
|
||||
callbacks.invoke_table_row_callbacks::<PuzzleRuntimeRunRow>("puzzle_runtime_run", &self.puzzle_runtime_run, event);
|
||||
callbacks.invoke_table_row_callbacks::<PuzzleWorkProfileRow>("puzzle_work_profile", &self.puzzle_work_profile, event);
|
||||
callbacks.invoke_table_row_callbacks::<QuestLog>("quest_log", &self.quest_log, event);
|
||||
callbacks.invoke_table_row_callbacks::<QuestRecord>("quest_record", &self.quest_record, event);
|
||||
callbacks.invoke_table_row_callbacks::<RuntimeSetting>("runtime_setting", &self.runtime_setting, event);
|
||||
@@ -1871,6 +2119,10 @@ fn register_tables(client_cache: &mut __sdk::ClientCache<Self>) {
|
||||
asset_entity_binding_table::register_table(client_cache);
|
||||
asset_object_table::register_table(client_cache);
|
||||
battle_state_table::register_table(client_cache);
|
||||
big_fish_agent_message_table::register_table(client_cache);
|
||||
big_fish_asset_slot_table::register_table(client_cache);
|
||||
big_fish_creation_session_table::register_table(client_cache);
|
||||
big_fish_runtime_run_table::register_table(client_cache);
|
||||
chapter_progression_table::register_table(client_cache);
|
||||
custom_world_agent_message_table::register_table(client_cache);
|
||||
custom_world_agent_operation_table::register_table(client_cache);
|
||||
@@ -1886,6 +2138,10 @@ fn register_tables(client_cache: &mut __sdk::ClientCache<Self>) {
|
||||
profile_played_world_table::register_table(client_cache);
|
||||
profile_save_archive_table::register_table(client_cache);
|
||||
profile_wallet_ledger_table::register_table(client_cache);
|
||||
puzzle_agent_message_table::register_table(client_cache);
|
||||
puzzle_agent_session_table::register_table(client_cache);
|
||||
puzzle_runtime_run_table::register_table(client_cache);
|
||||
puzzle_work_profile_table::register_table(client_cache);
|
||||
quest_log_table::register_table(client_cache);
|
||||
quest_record_table::register_table(client_cache);
|
||||
runtime_setting_table::register_table(client_cache);
|
||||
@@ -1903,6 +2159,10 @@ const ALL_TABLE_NAMES: &'static [&'static str] = &[
|
||||
"asset_entity_binding",
|
||||
"asset_object",
|
||||
"battle_state",
|
||||
"big_fish_agent_message",
|
||||
"big_fish_asset_slot",
|
||||
"big_fish_creation_session",
|
||||
"big_fish_runtime_run",
|
||||
"chapter_progression",
|
||||
"custom_world_agent_message",
|
||||
"custom_world_agent_operation",
|
||||
@@ -1918,6 +2178,10 @@ const ALL_TABLE_NAMES: &'static [&'static str] = &[
|
||||
"profile_played_world",
|
||||
"profile_save_archive",
|
||||
"profile_wallet_ledger",
|
||||
"puzzle_agent_message",
|
||||
"puzzle_agent_session",
|
||||
"puzzle_runtime_run",
|
||||
"puzzle_work_profile",
|
||||
"quest_log",
|
||||
"quest_record",
|
||||
"runtime_setting",
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
// 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::big_fish_session_procedure_result_type::BigFishSessionProcedureResult;
|
||||
use super::big_fish_publish_input_type::BigFishPublishInput;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
struct PublishBigFishGameArgs {
|
||||
pub input: BigFishPublishInput,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for PublishBigFishGameArgs {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the procedure `publish_big_fish_game`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteProcedures`].
|
||||
pub trait publish_big_fish_game {
|
||||
fn publish_big_fish_game(&self, input: BigFishPublishInput,
|
||||
) {
|
||||
self.publish_big_fish_game_then(input, |_, _| {});
|
||||
}
|
||||
|
||||
fn publish_big_fish_game_then(
|
||||
&self,
|
||||
input: BigFishPublishInput,
|
||||
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<BigFishSessionProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||
);
|
||||
}
|
||||
|
||||
impl publish_big_fish_game for super::RemoteProcedures {
|
||||
fn publish_big_fish_game_then(
|
||||
&self,
|
||||
input: BigFishPublishInput,
|
||||
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<BigFishSessionProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||
) {
|
||||
self.imp.invoke_procedure_with_callback::<_, BigFishSessionProcedureResult>(
|
||||
"publish_big_fish_game",
|
||||
PublishBigFishGameArgs { input, },
|
||||
__callback,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
// 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_work_procedure_result_type::PuzzleWorkProcedureResult;
|
||||
use super::puzzle_publish_input_type::PuzzlePublishInput;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
struct PublishPuzzleWorkArgs {
|
||||
pub input: PuzzlePublishInput,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for PublishPuzzleWorkArgs {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the procedure `publish_puzzle_work`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteProcedures`].
|
||||
pub trait publish_puzzle_work {
|
||||
fn publish_puzzle_work(&self, input: PuzzlePublishInput,
|
||||
) {
|
||||
self.publish_puzzle_work_then(input, |_, _| {});
|
||||
}
|
||||
|
||||
fn publish_puzzle_work_then(
|
||||
&self,
|
||||
input: PuzzlePublishInput,
|
||||
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<PuzzleWorkProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||
);
|
||||
}
|
||||
|
||||
impl publish_puzzle_work for super::RemoteProcedures {
|
||||
fn publish_puzzle_work_then(
|
||||
&self,
|
||||
input: PuzzlePublishInput,
|
||||
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<PuzzleWorkProcedureResult, __sdk::InternalError>) + Send + 'static,
|
||||
) {
|
||||
self.imp.invoke_procedure_with_callback::<_, PuzzleWorkProcedureResult>(
|
||||
"publish_puzzle_work",
|
||||
PublishPuzzleWorkArgs { input, },
|
||||
__callback,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)]
|
||||
#[derive(Copy, Eq, Hash)]
|
||||
pub enum PuzzleAgentMessageKind {
|
||||
Chat,
|
||||
|
||||
Summary,
|
||||
|
||||
ActionResult,
|
||||
|
||||
Warning,
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
impl __sdk::InModule for PuzzleAgentMessageKind {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -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)]
|
||||
#[derive(Copy, Eq, Hash)]
|
||||
pub enum PuzzleAgentMessageRole {
|
||||
User,
|
||||
|
||||
Assistant,
|
||||
|
||||
System,
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
impl __sdk::InModule for PuzzleAgentMessageRole {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
// 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_message_role_type::PuzzleAgentMessageRole;
|
||||
use super::puzzle_agent_message_kind_type::PuzzleAgentMessageKind;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct PuzzleAgentMessageRow {
|
||||
pub message_id: String,
|
||||
pub session_id: String,
|
||||
pub role: PuzzleAgentMessageRole,
|
||||
pub kind: PuzzleAgentMessageKind,
|
||||
pub text: String,
|
||||
pub created_at: __sdk::Timestamp,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for PuzzleAgentMessageRow {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
/// Column accessor struct for the table `PuzzleAgentMessageRow`.
|
||||
///
|
||||
/// Provides typed access to columns for query building.
|
||||
pub struct PuzzleAgentMessageRowCols {
|
||||
pub message_id: __sdk::__query_builder::Col<PuzzleAgentMessageRow, String>,
|
||||
pub session_id: __sdk::__query_builder::Col<PuzzleAgentMessageRow, String>,
|
||||
pub role: __sdk::__query_builder::Col<PuzzleAgentMessageRow, PuzzleAgentMessageRole>,
|
||||
pub kind: __sdk::__query_builder::Col<PuzzleAgentMessageRow, PuzzleAgentMessageKind>,
|
||||
pub text: __sdk::__query_builder::Col<PuzzleAgentMessageRow, String>,
|
||||
pub created_at: __sdk::__query_builder::Col<PuzzleAgentMessageRow, __sdk::Timestamp>,
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::HasCols for PuzzleAgentMessageRow {
|
||||
type Cols = PuzzleAgentMessageRowCols;
|
||||
fn cols(table_name: &'static str) -> Self::Cols {
|
||||
PuzzleAgentMessageRowCols {
|
||||
message_id: __sdk::__query_builder::Col::new(table_name, "message_id"),
|
||||
session_id: __sdk::__query_builder::Col::new(table_name, "session_id"),
|
||||
role: __sdk::__query_builder::Col::new(table_name, "role"),
|
||||
kind: __sdk::__query_builder::Col::new(table_name, "kind"),
|
||||
text: __sdk::__query_builder::Col::new(table_name, "text"),
|
||||
created_at: __sdk::__query_builder::Col::new(table_name, "created_at"),
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Indexed column accessor struct for the table `PuzzleAgentMessageRow`.
|
||||
///
|
||||
/// Provides typed access to indexed columns for query building.
|
||||
pub struct PuzzleAgentMessageRowIxCols {
|
||||
pub message_id: __sdk::__query_builder::IxCol<PuzzleAgentMessageRow, String>,
|
||||
pub session_id: __sdk::__query_builder::IxCol<PuzzleAgentMessageRow, String>,
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::HasIxCols for PuzzleAgentMessageRow {
|
||||
type IxCols = PuzzleAgentMessageRowIxCols;
|
||||
fn ix_cols(table_name: &'static str) -> Self::IxCols {
|
||||
PuzzleAgentMessageRowIxCols {
|
||||
message_id: __sdk::__query_builder::IxCol::new(table_name, "message_id"),
|
||||
session_id: __sdk::__query_builder::IxCol::new(table_name, "session_id"),
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::CanBeLookupTable for PuzzleAgentMessageRow {}
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct PuzzleAgentMessageSubmitInput {
|
||||
pub session_id: String,
|
||||
pub owner_user_id: String,
|
||||
pub user_message_id: String,
|
||||
pub user_message_text: String,
|
||||
pub submitted_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for PuzzleAgentMessageSubmitInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -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 spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
use super::puzzle_agent_message_row_type::PuzzleAgentMessageRow;
|
||||
use super::puzzle_agent_message_role_type::PuzzleAgentMessageRole;
|
||||
use super::puzzle_agent_message_kind_type::PuzzleAgentMessageKind;
|
||||
|
||||
/// Table handle for the table `puzzle_agent_message`.
|
||||
///
|
||||
/// Obtain a handle from the [`PuzzleAgentMessageTableAccess::puzzle_agent_message`] method on [`super::RemoteTables`],
|
||||
/// like `ctx.db.puzzle_agent_message()`.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.puzzle_agent_message().on_insert(...)`.
|
||||
pub struct PuzzleAgentMessageTableHandle<'ctx> {
|
||||
imp: __sdk::TableHandle<PuzzleAgentMessageRow>,
|
||||
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the table `puzzle_agent_message`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteTables`].
|
||||
pub trait PuzzleAgentMessageTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Obtain a [`PuzzleAgentMessageTableHandle`], which mediates access to the table `puzzle_agent_message`.
|
||||
fn puzzle_agent_message(&self) -> PuzzleAgentMessageTableHandle<'_>;
|
||||
}
|
||||
|
||||
impl PuzzleAgentMessageTableAccess for super::RemoteTables {
|
||||
fn puzzle_agent_message(&self) -> PuzzleAgentMessageTableHandle<'_> {
|
||||
PuzzleAgentMessageTableHandle {
|
||||
imp: self.imp.get_table::<PuzzleAgentMessageRow>("puzzle_agent_message"),
|
||||
ctx: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct PuzzleAgentMessageInsertCallbackId(__sdk::CallbackId);
|
||||
pub struct PuzzleAgentMessageDeleteCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::Table for PuzzleAgentMessageTableHandle<'ctx> {
|
||||
type Row = PuzzleAgentMessageRow;
|
||||
type EventContext = super::EventContext;
|
||||
|
||||
fn count(&self) -> u64 { self.imp.count() }
|
||||
fn iter(&self) -> impl Iterator<Item = PuzzleAgentMessageRow> + '_ { self.imp.iter() }
|
||||
|
||||
type InsertCallbackId = PuzzleAgentMessageInsertCallbackId;
|
||||
|
||||
fn on_insert(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> PuzzleAgentMessageInsertCallbackId {
|
||||
PuzzleAgentMessageInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_insert(&self, callback: PuzzleAgentMessageInsertCallbackId) {
|
||||
self.imp.remove_on_insert(callback.0)
|
||||
}
|
||||
|
||||
type DeleteCallbackId = PuzzleAgentMessageDeleteCallbackId;
|
||||
|
||||
fn on_delete(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> PuzzleAgentMessageDeleteCallbackId {
|
||||
PuzzleAgentMessageDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_delete(&self, callback: PuzzleAgentMessageDeleteCallbackId) {
|
||||
self.imp.remove_on_delete(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct PuzzleAgentMessageUpdateCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::TableWithPrimaryKey for PuzzleAgentMessageTableHandle<'ctx> {
|
||||
type UpdateCallbackId = PuzzleAgentMessageUpdateCallbackId;
|
||||
|
||||
fn on_update(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||
) -> PuzzleAgentMessageUpdateCallbackId {
|
||||
PuzzleAgentMessageUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_update(&self, callback: PuzzleAgentMessageUpdateCallbackId) {
|
||||
self.imp.remove_on_update(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
/// Access to the `message_id` unique index on the table `puzzle_agent_message`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`PuzzleAgentMessageMessageIdUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.puzzle_agent_message().message_id().find(...)`.
|
||||
pub struct PuzzleAgentMessageMessageIdUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<PuzzleAgentMessageRow, String>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
impl<'ctx> PuzzleAgentMessageTableHandle<'ctx> {
|
||||
/// Get a handle on the `message_id` unique index on the table `puzzle_agent_message`.
|
||||
pub fn message_id(&self) -> PuzzleAgentMessageMessageIdUnique<'ctx> {
|
||||
PuzzleAgentMessageMessageIdUnique {
|
||||
imp: self.imp.get_unique_constraint::<String>("message_id"),
|
||||
phantom: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> PuzzleAgentMessageMessageIdUnique<'ctx> {
|
||||
/// Find the subscribed row whose `message_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<PuzzleAgentMessageRow> {
|
||||
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::<PuzzleAgentMessageRow>("puzzle_agent_message");
|
||||
_table.add_unique_constraint::<String>("message_id", |row| &row.message_id);
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub(super) fn parse_table_update(
|
||||
raw_updates: __ws::v2::TableUpdate,
|
||||
) -> __sdk::Result<__sdk::TableUpdate<PuzzleAgentMessageRow>> {
|
||||
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||
__sdk::InternalError::failed_parse(
|
||||
"TableUpdate<PuzzleAgentMessageRow>",
|
||||
"TableUpdate",
|
||||
).with_cause(e).into()
|
||||
})
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `PuzzleAgentMessageRow`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait puzzle_agent_messageQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `PuzzleAgentMessageRow`.
|
||||
fn puzzle_agent_message(&self) -> __sdk::__query_builder::Table<PuzzleAgentMessageRow>;
|
||||
}
|
||||
|
||||
impl puzzle_agent_messageQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn puzzle_agent_message(&self) -> __sdk::__query_builder::Table<PuzzleAgentMessageRow> {
|
||||
__sdk::__query_builder::Table::new("puzzle_agent_message")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
// 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 PuzzleAgentSessionCreateInput {
|
||||
pub session_id: String,
|
||||
pub owner_user_id: String,
|
||||
pub seed_text: String,
|
||||
pub welcome_message_id: String,
|
||||
pub welcome_message_text: String,
|
||||
pub created_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for PuzzleAgentSessionCreateInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
// 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 PuzzleAgentSessionGetInput {
|
||||
pub session_id: String,
|
||||
pub owner_user_id: String,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for PuzzleAgentSessionGetInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct PuzzleAgentSessionProcedureResult {
|
||||
pub ok: bool,
|
||||
pub session_json: Option::<String>,
|
||||
pub error_message: Option::<String>,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for PuzzleAgentSessionProcedureResult {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
// 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_stage_type::PuzzleAgentStage;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct PuzzleAgentSessionRow {
|
||||
pub session_id: String,
|
||||
pub owner_user_id: String,
|
||||
pub seed_text: String,
|
||||
pub current_turn: u32,
|
||||
pub progress_percent: u32,
|
||||
pub stage: PuzzleAgentStage,
|
||||
pub anchor_pack_json: String,
|
||||
pub draft_json: Option::<String>,
|
||||
pub last_assistant_reply: Option::<String>,
|
||||
pub published_profile_id: Option::<String>,
|
||||
pub created_at: __sdk::Timestamp,
|
||||
pub updated_at: __sdk::Timestamp,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for PuzzleAgentSessionRow {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
/// Column accessor struct for the table `PuzzleAgentSessionRow`.
|
||||
///
|
||||
/// Provides typed access to columns for query building.
|
||||
pub struct PuzzleAgentSessionRowCols {
|
||||
pub session_id: __sdk::__query_builder::Col<PuzzleAgentSessionRow, String>,
|
||||
pub owner_user_id: __sdk::__query_builder::Col<PuzzleAgentSessionRow, String>,
|
||||
pub seed_text: __sdk::__query_builder::Col<PuzzleAgentSessionRow, String>,
|
||||
pub current_turn: __sdk::__query_builder::Col<PuzzleAgentSessionRow, u32>,
|
||||
pub progress_percent: __sdk::__query_builder::Col<PuzzleAgentSessionRow, u32>,
|
||||
pub stage: __sdk::__query_builder::Col<PuzzleAgentSessionRow, PuzzleAgentStage>,
|
||||
pub anchor_pack_json: __sdk::__query_builder::Col<PuzzleAgentSessionRow, String>,
|
||||
pub draft_json: __sdk::__query_builder::Col<PuzzleAgentSessionRow, Option::<String>>,
|
||||
pub last_assistant_reply: __sdk::__query_builder::Col<PuzzleAgentSessionRow, Option::<String>>,
|
||||
pub published_profile_id: __sdk::__query_builder::Col<PuzzleAgentSessionRow, Option::<String>>,
|
||||
pub created_at: __sdk::__query_builder::Col<PuzzleAgentSessionRow, __sdk::Timestamp>,
|
||||
pub updated_at: __sdk::__query_builder::Col<PuzzleAgentSessionRow, __sdk::Timestamp>,
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::HasCols for PuzzleAgentSessionRow {
|
||||
type Cols = PuzzleAgentSessionRowCols;
|
||||
fn cols(table_name: &'static str) -> Self::Cols {
|
||||
PuzzleAgentSessionRowCols {
|
||||
session_id: __sdk::__query_builder::Col::new(table_name, "session_id"),
|
||||
owner_user_id: __sdk::__query_builder::Col::new(table_name, "owner_user_id"),
|
||||
seed_text: __sdk::__query_builder::Col::new(table_name, "seed_text"),
|
||||
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"),
|
||||
anchor_pack_json: __sdk::__query_builder::Col::new(table_name, "anchor_pack_json"),
|
||||
draft_json: __sdk::__query_builder::Col::new(table_name, "draft_json"),
|
||||
last_assistant_reply: __sdk::__query_builder::Col::new(table_name, "last_assistant_reply"),
|
||||
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 `PuzzleAgentSessionRow`.
|
||||
///
|
||||
/// Provides typed access to indexed columns for query building.
|
||||
pub struct PuzzleAgentSessionRowIxCols {
|
||||
pub owner_user_id: __sdk::__query_builder::IxCol<PuzzleAgentSessionRow, String>,
|
||||
pub session_id: __sdk::__query_builder::IxCol<PuzzleAgentSessionRow, String>,
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::HasIxCols for PuzzleAgentSessionRow {
|
||||
type IxCols = PuzzleAgentSessionRowIxCols;
|
||||
fn ix_cols(table_name: &'static str) -> Self::IxCols {
|
||||
PuzzleAgentSessionRowIxCols {
|
||||
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 PuzzleAgentSessionRow {}
|
||||
|
||||
@@ -0,0 +1,164 @@
|
||||
// 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_row_type::PuzzleAgentSessionRow;
|
||||
use super::puzzle_agent_stage_type::PuzzleAgentStage;
|
||||
|
||||
/// Table handle for the table `puzzle_agent_session`.
|
||||
///
|
||||
/// Obtain a handle from the [`PuzzleAgentSessionTableAccess::puzzle_agent_session`] method on [`super::RemoteTables`],
|
||||
/// like `ctx.db.puzzle_agent_session()`.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.puzzle_agent_session().on_insert(...)`.
|
||||
pub struct PuzzleAgentSessionTableHandle<'ctx> {
|
||||
imp: __sdk::TableHandle<PuzzleAgentSessionRow>,
|
||||
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the table `puzzle_agent_session`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteTables`].
|
||||
pub trait PuzzleAgentSessionTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Obtain a [`PuzzleAgentSessionTableHandle`], which mediates access to the table `puzzle_agent_session`.
|
||||
fn puzzle_agent_session(&self) -> PuzzleAgentSessionTableHandle<'_>;
|
||||
}
|
||||
|
||||
impl PuzzleAgentSessionTableAccess for super::RemoteTables {
|
||||
fn puzzle_agent_session(&self) -> PuzzleAgentSessionTableHandle<'_> {
|
||||
PuzzleAgentSessionTableHandle {
|
||||
imp: self.imp.get_table::<PuzzleAgentSessionRow>("puzzle_agent_session"),
|
||||
ctx: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct PuzzleAgentSessionInsertCallbackId(__sdk::CallbackId);
|
||||
pub struct PuzzleAgentSessionDeleteCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::Table for PuzzleAgentSessionTableHandle<'ctx> {
|
||||
type Row = PuzzleAgentSessionRow;
|
||||
type EventContext = super::EventContext;
|
||||
|
||||
fn count(&self) -> u64 { self.imp.count() }
|
||||
fn iter(&self) -> impl Iterator<Item = PuzzleAgentSessionRow> + '_ { self.imp.iter() }
|
||||
|
||||
type InsertCallbackId = PuzzleAgentSessionInsertCallbackId;
|
||||
|
||||
fn on_insert(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> PuzzleAgentSessionInsertCallbackId {
|
||||
PuzzleAgentSessionInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_insert(&self, callback: PuzzleAgentSessionInsertCallbackId) {
|
||||
self.imp.remove_on_insert(callback.0)
|
||||
}
|
||||
|
||||
type DeleteCallbackId = PuzzleAgentSessionDeleteCallbackId;
|
||||
|
||||
fn on_delete(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> PuzzleAgentSessionDeleteCallbackId {
|
||||
PuzzleAgentSessionDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_delete(&self, callback: PuzzleAgentSessionDeleteCallbackId) {
|
||||
self.imp.remove_on_delete(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct PuzzleAgentSessionUpdateCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::TableWithPrimaryKey for PuzzleAgentSessionTableHandle<'ctx> {
|
||||
type UpdateCallbackId = PuzzleAgentSessionUpdateCallbackId;
|
||||
|
||||
fn on_update(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||
) -> PuzzleAgentSessionUpdateCallbackId {
|
||||
PuzzleAgentSessionUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_update(&self, callback: PuzzleAgentSessionUpdateCallbackId) {
|
||||
self.imp.remove_on_update(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
/// Access to the `session_id` unique index on the table `puzzle_agent_session`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`PuzzleAgentSessionSessionIdUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.puzzle_agent_session().session_id().find(...)`.
|
||||
pub struct PuzzleAgentSessionSessionIdUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<PuzzleAgentSessionRow, String>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
impl<'ctx> PuzzleAgentSessionTableHandle<'ctx> {
|
||||
/// Get a handle on the `session_id` unique index on the table `puzzle_agent_session`.
|
||||
pub fn session_id(&self) -> PuzzleAgentSessionSessionIdUnique<'ctx> {
|
||||
PuzzleAgentSessionSessionIdUnique {
|
||||
imp: self.imp.get_unique_constraint::<String>("session_id"),
|
||||
phantom: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> PuzzleAgentSessionSessionIdUnique<'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<PuzzleAgentSessionRow> {
|
||||
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::<PuzzleAgentSessionRow>("puzzle_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<PuzzleAgentSessionRow>> {
|
||||
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||
__sdk::InternalError::failed_parse(
|
||||
"TableUpdate<PuzzleAgentSessionRow>",
|
||||
"TableUpdate",
|
||||
).with_cause(e).into()
|
||||
})
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `PuzzleAgentSessionRow`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait puzzle_agent_sessionQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `PuzzleAgentSessionRow`.
|
||||
fn puzzle_agent_session(&self) -> __sdk::__query_builder::Table<PuzzleAgentSessionRow>;
|
||||
}
|
||||
|
||||
impl puzzle_agent_sessionQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn puzzle_agent_session(&self) -> __sdk::__query_builder::Table<PuzzleAgentSessionRow> {
|
||||
__sdk::__query_builder::Table::new("puzzle_agent_session")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
// 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 PuzzleAgentStage {
|
||||
CollectingAnchors,
|
||||
|
||||
DraftReady,
|
||||
|
||||
ImageRefining,
|
||||
|
||||
ReadyToPublish,
|
||||
|
||||
Published,
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
impl __sdk::InModule for PuzzleAgentStage {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct PuzzleDraftCompileInput {
|
||||
pub session_id: String,
|
||||
pub owner_user_id: String,
|
||||
pub compiled_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for PuzzleDraftCompileInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct PuzzleGeneratedImagesSaveInput {
|
||||
pub session_id: String,
|
||||
pub owner_user_id: String,
|
||||
pub candidates_json: String,
|
||||
pub saved_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for PuzzleGeneratedImagesSaveInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
#[derive(Copy, Eq, Hash)]
|
||||
pub enum PuzzlePublicationStatus {
|
||||
Draft,
|
||||
|
||||
Published,
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
impl __sdk::InModule for PuzzlePublicationStatus {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -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 PuzzlePublishInput {
|
||||
pub session_id: String,
|
||||
pub owner_user_id: String,
|
||||
pub work_id: String,
|
||||
pub profile_id: String,
|
||||
pub author_display_name: String,
|
||||
pub level_name: Option::<String>,
|
||||
pub summary: Option::<String>,
|
||||
pub theme_tags: Option::<Vec::<String>>,
|
||||
pub published_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for PuzzlePublishInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
// 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 PuzzleRunDragInput {
|
||||
pub run_id: String,
|
||||
pub owner_user_id: String,
|
||||
pub piece_id: String,
|
||||
pub target_row: u32,
|
||||
pub target_col: u32,
|
||||
pub dragged_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for PuzzleRunDragInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
// 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 PuzzleRunGetInput {
|
||||
pub run_id: String,
|
||||
pub owner_user_id: String,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for PuzzleRunGetInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct PuzzleRunNextLevelInput {
|
||||
pub run_id: String,
|
||||
pub owner_user_id: String,
|
||||
pub advanced_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for PuzzleRunNextLevelInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct PuzzleRunProcedureResult {
|
||||
pub ok: bool,
|
||||
pub run_json: Option::<String>,
|
||||
pub error_message: Option::<String>,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for PuzzleRunProcedureResult {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct PuzzleRunStartInput {
|
||||
pub run_id: String,
|
||||
pub owner_user_id: String,
|
||||
pub profile_id: String,
|
||||
pub started_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for PuzzleRunStartInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct PuzzleRunSwapInput {
|
||||
pub run_id: String,
|
||||
pub owner_user_id: String,
|
||||
pub first_piece_id: String,
|
||||
pub second_piece_id: String,
|
||||
pub swapped_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for PuzzleRunSwapInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
// 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 PuzzleRuntimeRunRow {
|
||||
pub run_id: String,
|
||||
pub owner_user_id: String,
|
||||
pub entry_profile_id: String,
|
||||
pub current_profile_id: String,
|
||||
pub cleared_level_count: u32,
|
||||
pub current_level_index: u32,
|
||||
pub current_grid_size: u32,
|
||||
pub played_profile_ids_json: String,
|
||||
pub previous_level_tags_json: String,
|
||||
pub snapshot_json: String,
|
||||
pub created_at: __sdk::Timestamp,
|
||||
pub updated_at: __sdk::Timestamp,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for PuzzleRuntimeRunRow {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
|
||||
/// Column accessor struct for the table `PuzzleRuntimeRunRow`.
|
||||
///
|
||||
/// Provides typed access to columns for query building.
|
||||
pub struct PuzzleRuntimeRunRowCols {
|
||||
pub run_id: __sdk::__query_builder::Col<PuzzleRuntimeRunRow, String>,
|
||||
pub owner_user_id: __sdk::__query_builder::Col<PuzzleRuntimeRunRow, String>,
|
||||
pub entry_profile_id: __sdk::__query_builder::Col<PuzzleRuntimeRunRow, String>,
|
||||
pub current_profile_id: __sdk::__query_builder::Col<PuzzleRuntimeRunRow, String>,
|
||||
pub cleared_level_count: __sdk::__query_builder::Col<PuzzleRuntimeRunRow, u32>,
|
||||
pub current_level_index: __sdk::__query_builder::Col<PuzzleRuntimeRunRow, u32>,
|
||||
pub current_grid_size: __sdk::__query_builder::Col<PuzzleRuntimeRunRow, u32>,
|
||||
pub played_profile_ids_json: __sdk::__query_builder::Col<PuzzleRuntimeRunRow, String>,
|
||||
pub previous_level_tags_json: __sdk::__query_builder::Col<PuzzleRuntimeRunRow, String>,
|
||||
pub snapshot_json: __sdk::__query_builder::Col<PuzzleRuntimeRunRow, String>,
|
||||
pub created_at: __sdk::__query_builder::Col<PuzzleRuntimeRunRow, __sdk::Timestamp>,
|
||||
pub updated_at: __sdk::__query_builder::Col<PuzzleRuntimeRunRow, __sdk::Timestamp>,
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::HasCols for PuzzleRuntimeRunRow {
|
||||
type Cols = PuzzleRuntimeRunRowCols;
|
||||
fn cols(table_name: &'static str) -> Self::Cols {
|
||||
PuzzleRuntimeRunRowCols {
|
||||
run_id: __sdk::__query_builder::Col::new(table_name, "run_id"),
|
||||
owner_user_id: __sdk::__query_builder::Col::new(table_name, "owner_user_id"),
|
||||
entry_profile_id: __sdk::__query_builder::Col::new(table_name, "entry_profile_id"),
|
||||
current_profile_id: __sdk::__query_builder::Col::new(table_name, "current_profile_id"),
|
||||
cleared_level_count: __sdk::__query_builder::Col::new(table_name, "cleared_level_count"),
|
||||
current_level_index: __sdk::__query_builder::Col::new(table_name, "current_level_index"),
|
||||
current_grid_size: __sdk::__query_builder::Col::new(table_name, "current_grid_size"),
|
||||
played_profile_ids_json: __sdk::__query_builder::Col::new(table_name, "played_profile_ids_json"),
|
||||
previous_level_tags_json: __sdk::__query_builder::Col::new(table_name, "previous_level_tags_json"),
|
||||
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 `PuzzleRuntimeRunRow`.
|
||||
///
|
||||
/// Provides typed access to indexed columns for query building.
|
||||
pub struct PuzzleRuntimeRunRowIxCols {
|
||||
pub owner_user_id: __sdk::__query_builder::IxCol<PuzzleRuntimeRunRow, String>,
|
||||
pub run_id: __sdk::__query_builder::IxCol<PuzzleRuntimeRunRow, String>,
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::HasIxCols for PuzzleRuntimeRunRow {
|
||||
type IxCols = PuzzleRuntimeRunRowIxCols;
|
||||
fn ix_cols(table_name: &'static str) -> Self::IxCols {
|
||||
PuzzleRuntimeRunRowIxCols {
|
||||
owner_user_id: __sdk::__query_builder::IxCol::new(table_name, "owner_user_id"),
|
||||
run_id: __sdk::__query_builder::IxCol::new(table_name, "run_id"),
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::CanBeLookupTable for PuzzleRuntimeRunRow {}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user