Merge remote-tracking branch 'origin/master' into hermes/hermes-1e775b03
# Conflicts: # server-rs/crates/api-server/src/app.rs # server-rs/crates/api-server/src/creation_entry_config.rs # server-rs/crates/api-server/src/puzzle.rs # server-rs/crates/spacetime-client/src/lib.rs # src/components/platform-entry/PlatformEntryFlowShellImpl.tsx
This commit is contained in:
@@ -57,6 +57,29 @@ impl SpacetimeClient {
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn import_auth_store_snapshot_json(
|
||||
&self,
|
||||
snapshot_json: String,
|
||||
updated_at_micros: i64,
|
||||
) -> Result<AuthStoreSnapshotImportRecord, SpacetimeClientError> {
|
||||
let procedure_input = AuthStoreSnapshotUpsertInput {
|
||||
snapshot_json,
|
||||
updated_at_micros,
|
||||
};
|
||||
|
||||
self.call_after_connect(move |connection, sender| {
|
||||
connection
|
||||
.procedures()
|
||||
.import_auth_store_snapshot_json_then(procedure_input, move |_, result| {
|
||||
let mapped = result
|
||||
.map_err(SpacetimeClientError::from_sdk_error)
|
||||
.and_then(map_auth_store_snapshot_import_procedure_result);
|
||||
send_once(&sender, mapped);
|
||||
});
|
||||
})
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn import_auth_store_snapshot(
|
||||
&self,
|
||||
) -> Result<AuthStoreSnapshotImportRecord, SpacetimeClientError> {
|
||||
|
||||
@@ -50,9 +50,10 @@ pub use mapper::{
|
||||
PuzzleResultPreviewBlockerRecord, PuzzleResultPreviewFindingRecord, PuzzleResultPreviewRecord,
|
||||
PuzzleRunDragRecordInput, PuzzleRunNextLevelRecordInput, PuzzleRunPauseRecordInput,
|
||||
PuzzleRunPropRecordInput, PuzzleRunRecord, PuzzleRunStartRecordInput, PuzzleRunSwapRecordInput,
|
||||
PuzzleRuntimeLevelRecord, PuzzleSelectCoverImageRecordInput, PuzzleWorkLikeReportRecordInput,
|
||||
PuzzleWorkPointIncentiveClaimRecordInput, PuzzleWorkProfileRecord, PuzzleWorkRemixRecordInput,
|
||||
PuzzleWorkUpsertRecordInput, ResolveCombatActionRecord, ResolveNpcBattleInteractionInput,
|
||||
PuzzleRuntimeLevelRecord, PuzzleSelectCoverImageRecordInput, PuzzleUiBackgroundSaveRecordInput,
|
||||
PuzzleWorkLikeReportRecordInput, PuzzleWorkPointIncentiveClaimRecordInput,
|
||||
PuzzleWorkProfileRecord, PuzzleWorkRemixRecordInput, PuzzleWorkUpsertRecordInput,
|
||||
ResolveCombatActionRecord, ResolveNpcBattleInteractionInput,
|
||||
SquareHoleAgentMessageFinalizeRecordInput, SquareHoleAgentMessageRecord,
|
||||
SquareHoleAgentMessageSubmitRecordInput, SquareHoleAgentSessionCreateRecordInput,
|
||||
SquareHoleAgentSessionRecord, SquareHoleAnchorItemRecord, SquareHoleAnchorPackRecord,
|
||||
@@ -426,28 +427,32 @@ impl SpacetimeClient {
|
||||
let connect_sender = Arc::new(Mutex::new(Some(sender)));
|
||||
let broken_flag = broken.clone();
|
||||
let disconnect_sender = connect_sender.clone();
|
||||
let connection = tokio::task::spawn_blocking(move || {
|
||||
DbConnection::builder()
|
||||
.with_uri(config.server_url)
|
||||
.with_database_name(config.database)
|
||||
.with_token(config.token)
|
||||
.on_connect(move |_, _, _| {
|
||||
send_connect_once(&connect_sender, Ok(()));
|
||||
})
|
||||
.on_disconnect(move |_, error| {
|
||||
broken_flag.store(true, Ordering::SeqCst);
|
||||
let message = error
|
||||
.map(|error| error.to_string())
|
||||
.unwrap_or_else(|| "SpacetimeDB 连接已断开".to_string());
|
||||
send_connect_once(
|
||||
&disconnect_sender,
|
||||
Err(SpacetimeClientError::Procedure(message)),
|
||||
);
|
||||
})
|
||||
.build()
|
||||
.map_err(|error| SpacetimeClientError::Build(error.to_string()))
|
||||
})
|
||||
let connection = timeout(
|
||||
self.config.procedure_timeout,
|
||||
tokio::task::spawn_blocking(move || {
|
||||
DbConnection::builder()
|
||||
.with_uri(config.server_url)
|
||||
.with_database_name(config.database)
|
||||
.with_token(config.token)
|
||||
.on_connect(move |_, _, _| {
|
||||
send_connect_once(&connect_sender, Ok(()));
|
||||
})
|
||||
.on_disconnect(move |_, error| {
|
||||
broken_flag.store(true, Ordering::SeqCst);
|
||||
let message = error
|
||||
.map(|error| error.to_string())
|
||||
.unwrap_or_else(|| "SpacetimeDB 连接已断开".to_string());
|
||||
send_connect_once(
|
||||
&disconnect_sender,
|
||||
Err(SpacetimeClientError::Procedure(message)),
|
||||
);
|
||||
})
|
||||
.build()
|
||||
.map_err(|error| SpacetimeClientError::Build(error.to_string()))
|
||||
}),
|
||||
)
|
||||
.await
|
||||
.map_err(|_| SpacetimeClientError::Timeout)?
|
||||
.map_err(|error| SpacetimeClientError::Runtime(error.to_string()))??;
|
||||
|
||||
let runner = connection.run_threaded();
|
||||
|
||||
@@ -176,6 +176,18 @@ impl From<module_runtime::RuntimeProfileRechargeOrderCreateInput>
|
||||
}
|
||||
}
|
||||
|
||||
impl From<module_runtime::RuntimeProfileRechargeOrderPaidInput>
|
||||
for RuntimeProfileRechargeOrderPaidInput
|
||||
{
|
||||
fn from(input: module_runtime::RuntimeProfileRechargeOrderPaidInput) -> Self {
|
||||
Self {
|
||||
order_id: input.order_id,
|
||||
paid_at_micros: input.paid_at_micros,
|
||||
provider_transaction_id: input.provider_transaction_id,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<module_runtime::RuntimeProfileFeedbackSubmissionInput>
|
||||
for RuntimeProfileFeedbackSubmissionInput
|
||||
{
|
||||
@@ -2253,6 +2265,7 @@ pub(crate) fn map_runtime_profile_recharge_order_snapshot(
|
||||
status: map_runtime_profile_recharge_order_status_back(snapshot.status),
|
||||
payment_channel: snapshot.payment_channel,
|
||||
paid_at_micros: snapshot.paid_at_micros,
|
||||
provider_transaction_id: snapshot.provider_transaction_id,
|
||||
created_at_micros: snapshot.created_at_micros,
|
||||
points_delta: snapshot.points_delta,
|
||||
membership_expires_at_micros: snapshot.membership_expires_at_micros,
|
||||
@@ -2953,6 +2966,9 @@ pub(crate) fn map_puzzle_draft_level(snapshot: DomainPuzzleDraftLevel) -> Puzzle
|
||||
level_name: snapshot.level_name,
|
||||
picture_description: snapshot.picture_description,
|
||||
picture_reference: snapshot.picture_reference,
|
||||
ui_background_prompt: snapshot.ui_background_prompt,
|
||||
ui_background_image_src: snapshot.ui_background_image_src,
|
||||
ui_background_image_object_key: snapshot.ui_background_image_object_key,
|
||||
background_music: snapshot.background_music.map(map_puzzle_audio_asset),
|
||||
candidates: snapshot
|
||||
.candidates
|
||||
@@ -3058,6 +3074,7 @@ fn map_match3d_creator_config(
|
||||
asset_style_id: snapshot.asset_style_id,
|
||||
asset_style_label: snapshot.asset_style_label,
|
||||
asset_style_prompt: snapshot.asset_style_prompt,
|
||||
generate_click_sound: snapshot.generate_click_sound,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3835,6 +3852,8 @@ pub(crate) fn map_puzzle_runtime_level_snapshot(
|
||||
author_display_name: snapshot.author_display_name,
|
||||
theme_tags: snapshot.theme_tags,
|
||||
cover_image_src: snapshot.cover_image_src,
|
||||
ui_background_image_src: snapshot.ui_background_image_src,
|
||||
background_music: snapshot.background_music.map(map_puzzle_audio_asset),
|
||||
board: map_puzzle_board_snapshot(snapshot.board),
|
||||
status: snapshot.status.as_str().to_string(),
|
||||
started_at_ms,
|
||||
@@ -5056,9 +5075,21 @@ pub(crate) fn map_runtime_profile_recharge_order_status_back(
|
||||
value: crate::module_bindings::RuntimeProfileRechargeOrderStatus,
|
||||
) -> module_runtime::RuntimeProfileRechargeOrderStatus {
|
||||
match value {
|
||||
crate::module_bindings::RuntimeProfileRechargeOrderStatus::Pending => {
|
||||
module_runtime::RuntimeProfileRechargeOrderStatus::Pending
|
||||
}
|
||||
crate::module_bindings::RuntimeProfileRechargeOrderStatus::Paid => {
|
||||
module_runtime::RuntimeProfileRechargeOrderStatus::Paid
|
||||
}
|
||||
crate::module_bindings::RuntimeProfileRechargeOrderStatus::Failed => {
|
||||
module_runtime::RuntimeProfileRechargeOrderStatus::Failed
|
||||
}
|
||||
crate::module_bindings::RuntimeProfileRechargeOrderStatus::Closed => {
|
||||
module_runtime::RuntimeProfileRechargeOrderStatus::Closed
|
||||
}
|
||||
crate::module_bindings::RuntimeProfileRechargeOrderStatus::Refunded => {
|
||||
module_runtime::RuntimeProfileRechargeOrderStatus::Refunded
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5924,6 +5955,18 @@ pub struct PuzzleGeneratedImagesSaveRecordInput {
|
||||
pub saved_at_micros: i64,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub struct PuzzleUiBackgroundSaveRecordInput {
|
||||
pub session_id: String,
|
||||
pub owner_user_id: String,
|
||||
pub level_id: Option<String>,
|
||||
pub levels_json: Option<String>,
|
||||
pub prompt: String,
|
||||
pub image_src: String,
|
||||
pub image_object_key: Option<String>,
|
||||
pub saved_at_micros: i64,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub struct PuzzleSelectCoverImageRecordInput {
|
||||
pub session_id: String,
|
||||
@@ -6146,6 +6189,7 @@ pub struct Match3DRunStartRecordInput {
|
||||
pub owner_user_id: String,
|
||||
pub profile_id: String,
|
||||
pub started_at_ms: i64,
|
||||
pub item_type_count_override: u32,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
@@ -6204,6 +6248,7 @@ pub struct Match3DCreatorConfigRecord {
|
||||
pub asset_style_id: Option<String>,
|
||||
pub asset_style_label: Option<String>,
|
||||
pub asset_style_prompt: Option<String>,
|
||||
pub generate_click_sound: bool,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
@@ -6337,6 +6382,8 @@ struct Match3DCreatorConfigJsonRecord {
|
||||
asset_style_label: Option<String>,
|
||||
#[serde(default)]
|
||||
asset_style_prompt: Option<String>,
|
||||
#[serde(default)]
|
||||
generate_click_sound: bool,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, serde::Deserialize)]
|
||||
@@ -7321,6 +7368,9 @@ pub struct PuzzleDraftLevelRecord {
|
||||
pub level_name: String,
|
||||
pub picture_description: String,
|
||||
pub picture_reference: Option<String>,
|
||||
pub ui_background_prompt: Option<String>,
|
||||
pub ui_background_image_src: Option<String>,
|
||||
pub ui_background_image_object_key: Option<String>,
|
||||
pub background_music: Option<PuzzleAudioAssetRecord>,
|
||||
pub candidates: Vec<PuzzleGeneratedImageCandidateRecord>,
|
||||
pub selected_candidate_id: Option<String>,
|
||||
@@ -7495,6 +7545,8 @@ pub struct PuzzleRuntimeLevelRecord {
|
||||
pub author_display_name: String,
|
||||
pub theme_tags: Vec<String>,
|
||||
pub cover_image_src: Option<String>,
|
||||
pub ui_background_image_src: Option<String>,
|
||||
pub background_music: Option<PuzzleAudioAssetRecord>,
|
||||
pub board: PuzzleBoardRecord,
|
||||
pub status: String,
|
||||
pub started_at_ms: u64,
|
||||
|
||||
@@ -296,6 +296,7 @@ impl SpacetimeClient {
|
||||
owner_user_id: input.owner_user_id,
|
||||
profile_id: input.profile_id,
|
||||
started_at_ms: input.started_at_ms,
|
||||
item_type_count_override: input.item_type_count_override,
|
||||
};
|
||||
|
||||
self.call_after_connect(move |connection, sender| {
|
||||
|
||||
@@ -0,0 +1,162 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use super::auth_store_projection_meta_type::AuthStoreProjectionMeta;
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
/// Table handle for the table `auth_store_projection_meta`.
|
||||
///
|
||||
/// Obtain a handle from the [`AuthStoreProjectionMetaTableAccess::auth_store_projection_meta`] method on [`super::RemoteTables`],
|
||||
/// like `ctx.db.auth_store_projection_meta()`.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.auth_store_projection_meta().on_insert(...)`.
|
||||
pub struct AuthStoreProjectionMetaTableHandle<'ctx> {
|
||||
imp: __sdk::TableHandle<AuthStoreProjectionMeta>,
|
||||
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the table `auth_store_projection_meta`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteTables`].
|
||||
pub trait AuthStoreProjectionMetaTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Obtain a [`AuthStoreProjectionMetaTableHandle`], which mediates access to the table `auth_store_projection_meta`.
|
||||
fn auth_store_projection_meta(&self) -> AuthStoreProjectionMetaTableHandle<'_>;
|
||||
}
|
||||
|
||||
impl AuthStoreProjectionMetaTableAccess for super::RemoteTables {
|
||||
fn auth_store_projection_meta(&self) -> AuthStoreProjectionMetaTableHandle<'_> {
|
||||
AuthStoreProjectionMetaTableHandle {
|
||||
imp: self
|
||||
.imp
|
||||
.get_table::<AuthStoreProjectionMeta>("auth_store_projection_meta"),
|
||||
ctx: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct AuthStoreProjectionMetaInsertCallbackId(__sdk::CallbackId);
|
||||
pub struct AuthStoreProjectionMetaDeleteCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::Table for AuthStoreProjectionMetaTableHandle<'ctx> {
|
||||
type Row = AuthStoreProjectionMeta;
|
||||
type EventContext = super::EventContext;
|
||||
|
||||
fn count(&self) -> u64 {
|
||||
self.imp.count()
|
||||
}
|
||||
fn iter(&self) -> impl Iterator<Item = AuthStoreProjectionMeta> + '_ {
|
||||
self.imp.iter()
|
||||
}
|
||||
|
||||
type InsertCallbackId = AuthStoreProjectionMetaInsertCallbackId;
|
||||
|
||||
fn on_insert(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> AuthStoreProjectionMetaInsertCallbackId {
|
||||
AuthStoreProjectionMetaInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_insert(&self, callback: AuthStoreProjectionMetaInsertCallbackId) {
|
||||
self.imp.remove_on_insert(callback.0)
|
||||
}
|
||||
|
||||
type DeleteCallbackId = AuthStoreProjectionMetaDeleteCallbackId;
|
||||
|
||||
fn on_delete(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> AuthStoreProjectionMetaDeleteCallbackId {
|
||||
AuthStoreProjectionMetaDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_delete(&self, callback: AuthStoreProjectionMetaDeleteCallbackId) {
|
||||
self.imp.remove_on_delete(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct AuthStoreProjectionMetaUpdateCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::TableWithPrimaryKey for AuthStoreProjectionMetaTableHandle<'ctx> {
|
||||
type UpdateCallbackId = AuthStoreProjectionMetaUpdateCallbackId;
|
||||
|
||||
fn on_update(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||
) -> AuthStoreProjectionMetaUpdateCallbackId {
|
||||
AuthStoreProjectionMetaUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_update(&self, callback: AuthStoreProjectionMetaUpdateCallbackId) {
|
||||
self.imp.remove_on_update(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
/// Access to the `meta_id` unique index on the table `auth_store_projection_meta`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`AuthStoreProjectionMetaMetaIdUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.auth_store_projection_meta().meta_id().find(...)`.
|
||||
pub struct AuthStoreProjectionMetaMetaIdUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<AuthStoreProjectionMeta, String>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
impl<'ctx> AuthStoreProjectionMetaTableHandle<'ctx> {
|
||||
/// Get a handle on the `meta_id` unique index on the table `auth_store_projection_meta`.
|
||||
pub fn meta_id(&self) -> AuthStoreProjectionMetaMetaIdUnique<'ctx> {
|
||||
AuthStoreProjectionMetaMetaIdUnique {
|
||||
imp: self.imp.get_unique_constraint::<String>("meta_id"),
|
||||
phantom: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> AuthStoreProjectionMetaMetaIdUnique<'ctx> {
|
||||
/// Find the subscribed row whose `meta_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<AuthStoreProjectionMeta> {
|
||||
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::<AuthStoreProjectionMeta>("auth_store_projection_meta");
|
||||
_table.add_unique_constraint::<String>("meta_id", |row| &row.meta_id);
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub(super) fn parse_table_update(
|
||||
raw_updates: __ws::v2::TableUpdate,
|
||||
) -> __sdk::Result<__sdk::TableUpdate<AuthStoreProjectionMeta>> {
|
||||
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||
__sdk::InternalError::failed_parse("TableUpdate<AuthStoreProjectionMeta>", "TableUpdate")
|
||||
.with_cause(e)
|
||||
.into()
|
||||
})
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `AuthStoreProjectionMeta`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait auth_store_projection_metaQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `AuthStoreProjectionMeta`.
|
||||
fn auth_store_projection_meta(&self) -> __sdk::__query_builder::Table<AuthStoreProjectionMeta>;
|
||||
}
|
||||
|
||||
impl auth_store_projection_metaQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn auth_store_projection_meta(&self) -> __sdk::__query_builder::Table<AuthStoreProjectionMeta> {
|
||||
__sdk::__query_builder::Table::new("auth_store_projection_meta")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
// 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 AuthStoreProjectionMeta {
|
||||
pub meta_id: String,
|
||||
pub updated_at: __sdk::Timestamp,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for AuthStoreProjectionMeta {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
/// Column accessor struct for the table `AuthStoreProjectionMeta`.
|
||||
///
|
||||
/// Provides typed access to columns for query building.
|
||||
pub struct AuthStoreProjectionMetaCols {
|
||||
pub meta_id: __sdk::__query_builder::Col<AuthStoreProjectionMeta, String>,
|
||||
pub updated_at: __sdk::__query_builder::Col<AuthStoreProjectionMeta, __sdk::Timestamp>,
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::HasCols for AuthStoreProjectionMeta {
|
||||
type Cols = AuthStoreProjectionMetaCols;
|
||||
fn cols(table_name: &'static str) -> Self::Cols {
|
||||
AuthStoreProjectionMetaCols {
|
||||
meta_id: __sdk::__query_builder::Col::new(table_name, "meta_id"),
|
||||
updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Indexed column accessor struct for the table `AuthStoreProjectionMeta`.
|
||||
///
|
||||
/// Provides typed access to indexed columns for query building.
|
||||
pub struct AuthStoreProjectionMetaIxCols {
|
||||
pub meta_id: __sdk::__query_builder::IxCol<AuthStoreProjectionMeta, String>,
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::HasIxCols for AuthStoreProjectionMeta {
|
||||
type IxCols = AuthStoreProjectionMetaIxCols;
|
||||
fn ix_cols(table_name: &'static str) -> Self::IxCols {
|
||||
AuthStoreProjectionMetaIxCols {
|
||||
meta_id: __sdk::__query_builder::IxCol::new(table_name, "meta_id"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::CanBeLookupTable for AuthStoreProjectionMeta {}
|
||||
@@ -0,0 +1,59 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
use super::auth_store_snapshot_import_procedure_result_type::AuthStoreSnapshotImportProcedureResult;
|
||||
use super::auth_store_snapshot_upsert_input_type::AuthStoreSnapshotUpsertInput;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
struct ImportAuthStoreSnapshotJsonArgs {
|
||||
pub input: AuthStoreSnapshotUpsertInput,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for ImportAuthStoreSnapshotJsonArgs {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the procedure `import_auth_store_snapshot_json`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteProcedures`].
|
||||
pub trait import_auth_store_snapshot_json {
|
||||
fn import_auth_store_snapshot_json(&self, input: AuthStoreSnapshotUpsertInput) {
|
||||
self.import_auth_store_snapshot_json_then(input, |_, _| {});
|
||||
}
|
||||
|
||||
fn import_auth_store_snapshot_json_then(
|
||||
&self,
|
||||
input: AuthStoreSnapshotUpsertInput,
|
||||
|
||||
__callback: impl FnOnce(
|
||||
&super::ProcedureEventContext,
|
||||
Result<AuthStoreSnapshotImportProcedureResult, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
);
|
||||
}
|
||||
|
||||
impl import_auth_store_snapshot_json for super::RemoteProcedures {
|
||||
fn import_auth_store_snapshot_json_then(
|
||||
&self,
|
||||
input: AuthStoreSnapshotUpsertInput,
|
||||
|
||||
__callback: impl FnOnce(
|
||||
&super::ProcedureEventContext,
|
||||
Result<AuthStoreSnapshotImportProcedureResult, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
) {
|
||||
self.imp
|
||||
.invoke_procedure_with_callback::<_, AuthStoreSnapshotImportProcedureResult>(
|
||||
"import_auth_store_snapshot_json",
|
||||
ImportAuthStoreSnapshotJsonArgs { input },
|
||||
__callback,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
// 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::runtime_profile_recharge_center_procedure_result_type::RuntimeProfileRechargeCenterProcedureResult;
|
||||
use super::runtime_profile_recharge_order_paid_input_type::RuntimeProfileRechargeOrderPaidInput;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
struct MarkProfileRechargeOrderPaidAndReturnArgs {
|
||||
pub input: RuntimeProfileRechargeOrderPaidInput,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for MarkProfileRechargeOrderPaidAndReturnArgs {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the procedure `mark_profile_recharge_order_paid_and_return`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteProcedures`].
|
||||
pub trait mark_profile_recharge_order_paid_and_return {
|
||||
fn mark_profile_recharge_order_paid_and_return(
|
||||
&self,
|
||||
input: RuntimeProfileRechargeOrderPaidInput,
|
||||
) {
|
||||
self.mark_profile_recharge_order_paid_and_return_then(input, |_, _| {});
|
||||
}
|
||||
|
||||
fn mark_profile_recharge_order_paid_and_return_then(
|
||||
&self,
|
||||
input: RuntimeProfileRechargeOrderPaidInput,
|
||||
|
||||
__callback: impl FnOnce(
|
||||
&super::ProcedureEventContext,
|
||||
Result<RuntimeProfileRechargeCenterProcedureResult, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
);
|
||||
}
|
||||
|
||||
impl mark_profile_recharge_order_paid_and_return for super::RemoteProcedures {
|
||||
fn mark_profile_recharge_order_paid_and_return_then(
|
||||
&self,
|
||||
input: RuntimeProfileRechargeOrderPaidInput,
|
||||
|
||||
__callback: impl FnOnce(
|
||||
&super::ProcedureEventContext,
|
||||
Result<RuntimeProfileRechargeCenterProcedureResult, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
) {
|
||||
self.imp
|
||||
.invoke_procedure_with_callback::<_, RuntimeProfileRechargeCenterProcedureResult>(
|
||||
"mark_profile_recharge_order_paid_and_return",
|
||||
MarkProfileRechargeOrderPaidAndReturnArgs { input },
|
||||
__callback,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@ pub struct Match3DRunStartInput {
|
||||
pub owner_user_id: String,
|
||||
pub profile_id: String,
|
||||
pub started_at_ms: i64,
|
||||
pub item_type_count_override: u32,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for Match3DRunStartInput {
|
||||
|
||||
@@ -82,6 +82,8 @@ pub mod asset_object_upsert_snapshot_type;
|
||||
pub mod attach_ai_result_reference_and_return_procedure;
|
||||
pub mod auth_identity_table;
|
||||
pub mod auth_identity_type;
|
||||
pub mod auth_store_projection_meta_table;
|
||||
pub mod auth_store_projection_meta_type;
|
||||
pub mod auth_store_snapshot_import_procedure_result_type;
|
||||
pub mod auth_store_snapshot_import_record_type;
|
||||
pub mod auth_store_snapshot_procedure_result_type;
|
||||
@@ -364,6 +366,7 @@ pub mod grant_inventory_item_input_type;
|
||||
pub mod grant_new_user_registration_wallet_reward_procedure;
|
||||
pub mod grant_player_progression_experience_and_return_procedure;
|
||||
pub mod grant_player_progression_experience_reducer;
|
||||
pub mod import_auth_store_snapshot_json_procedure;
|
||||
pub mod import_auth_store_snapshot_procedure;
|
||||
pub mod import_database_migration_from_chunks_procedure;
|
||||
pub mod import_database_migration_from_file_procedure;
|
||||
@@ -393,6 +396,7 @@ pub mod list_puzzle_works_procedure;
|
||||
pub mod list_square_hole_works_procedure;
|
||||
pub mod list_visual_novel_runtime_history_procedure;
|
||||
pub mod list_visual_novel_works_procedure;
|
||||
pub mod mark_profile_recharge_order_paid_and_return_procedure;
|
||||
pub mod match_3_d_agent_message_finalize_input_type;
|
||||
pub mod match_3_d_agent_message_row_type;
|
||||
pub mod match_3_d_agent_message_submit_input_type;
|
||||
@@ -520,6 +524,7 @@ pub mod puzzle_run_swap_input_type;
|
||||
pub mod puzzle_runtime_run_row_type;
|
||||
pub mod puzzle_runtime_run_table;
|
||||
pub mod puzzle_select_cover_image_input_type;
|
||||
pub mod puzzle_ui_background_save_input_type;
|
||||
pub mod puzzle_work_delete_input_type;
|
||||
pub mod puzzle_work_get_input_type;
|
||||
pub mod puzzle_work_like_record_input_type;
|
||||
@@ -642,6 +647,7 @@ pub mod runtime_profile_recharge_center_get_input_type;
|
||||
pub mod runtime_profile_recharge_center_procedure_result_type;
|
||||
pub mod runtime_profile_recharge_center_snapshot_type;
|
||||
pub mod runtime_profile_recharge_order_create_input_type;
|
||||
pub mod runtime_profile_recharge_order_paid_input_type;
|
||||
pub mod runtime_profile_recharge_order_snapshot_type;
|
||||
pub mod runtime_profile_recharge_order_status_type;
|
||||
pub mod runtime_profile_recharge_product_kind_type;
|
||||
@@ -706,6 +712,7 @@ pub mod runtime_tracking_event_procedure_result_type;
|
||||
pub mod runtime_tracking_scope_kind_type;
|
||||
pub mod save_puzzle_form_draft_procedure;
|
||||
pub mod save_puzzle_generated_images_procedure;
|
||||
pub mod save_puzzle_ui_background_procedure;
|
||||
pub mod seed_analytics_date_dimensions_reducer;
|
||||
pub mod select_puzzle_cover_image_procedure;
|
||||
pub mod square_hole_agent_message_finalize_input_type;
|
||||
@@ -919,6 +926,8 @@ pub use asset_object_upsert_snapshot_type::AssetObjectUpsertSnapshot;
|
||||
pub use attach_ai_result_reference_and_return_procedure::attach_ai_result_reference_and_return;
|
||||
pub use auth_identity_table::*;
|
||||
pub use auth_identity_type::AuthIdentity;
|
||||
pub use auth_store_projection_meta_table::*;
|
||||
pub use auth_store_projection_meta_type::AuthStoreProjectionMeta;
|
||||
pub use auth_store_snapshot_import_procedure_result_type::AuthStoreSnapshotImportProcedureResult;
|
||||
pub use auth_store_snapshot_import_record_type::AuthStoreSnapshotImportRecord;
|
||||
pub use auth_store_snapshot_procedure_result_type::AuthStoreSnapshotProcedureResult;
|
||||
@@ -1201,6 +1210,7 @@ pub use grant_inventory_item_input_type::GrantInventoryItemInput;
|
||||
pub use grant_new_user_registration_wallet_reward_procedure::grant_new_user_registration_wallet_reward;
|
||||
pub use grant_player_progression_experience_and_return_procedure::grant_player_progression_experience_and_return;
|
||||
pub use grant_player_progression_experience_reducer::grant_player_progression_experience;
|
||||
pub use import_auth_store_snapshot_json_procedure::import_auth_store_snapshot_json;
|
||||
pub use import_auth_store_snapshot_procedure::import_auth_store_snapshot;
|
||||
pub use import_database_migration_from_chunks_procedure::import_database_migration_from_chunks;
|
||||
pub use import_database_migration_from_file_procedure::import_database_migration_from_file;
|
||||
@@ -1230,6 +1240,7 @@ pub use list_puzzle_works_procedure::list_puzzle_works;
|
||||
pub use list_square_hole_works_procedure::list_square_hole_works;
|
||||
pub use list_visual_novel_runtime_history_procedure::list_visual_novel_runtime_history;
|
||||
pub use list_visual_novel_works_procedure::list_visual_novel_works;
|
||||
pub use mark_profile_recharge_order_paid_and_return_procedure::mark_profile_recharge_order_paid_and_return;
|
||||
pub use match_3_d_agent_message_finalize_input_type::Match3DAgentMessageFinalizeInput;
|
||||
pub use match_3_d_agent_message_row_type::Match3DAgentMessageRow;
|
||||
pub use match_3_d_agent_message_submit_input_type::Match3DAgentMessageSubmitInput;
|
||||
@@ -1357,6 +1368,7 @@ pub use puzzle_run_swap_input_type::PuzzleRunSwapInput;
|
||||
pub use puzzle_runtime_run_row_type::PuzzleRuntimeRunRow;
|
||||
pub use puzzle_runtime_run_table::*;
|
||||
pub use puzzle_select_cover_image_input_type::PuzzleSelectCoverImageInput;
|
||||
pub use puzzle_ui_background_save_input_type::PuzzleUiBackgroundSaveInput;
|
||||
pub use puzzle_work_delete_input_type::PuzzleWorkDeleteInput;
|
||||
pub use puzzle_work_get_input_type::PuzzleWorkGetInput;
|
||||
pub use puzzle_work_like_record_input_type::PuzzleWorkLikeRecordInput;
|
||||
@@ -1479,6 +1491,7 @@ pub use runtime_profile_recharge_center_get_input_type::RuntimeProfileRechargeCe
|
||||
pub use runtime_profile_recharge_center_procedure_result_type::RuntimeProfileRechargeCenterProcedureResult;
|
||||
pub use runtime_profile_recharge_center_snapshot_type::RuntimeProfileRechargeCenterSnapshot;
|
||||
pub use runtime_profile_recharge_order_create_input_type::RuntimeProfileRechargeOrderCreateInput;
|
||||
pub use runtime_profile_recharge_order_paid_input_type::RuntimeProfileRechargeOrderPaidInput;
|
||||
pub use runtime_profile_recharge_order_snapshot_type::RuntimeProfileRechargeOrderSnapshot;
|
||||
pub use runtime_profile_recharge_order_status_type::RuntimeProfileRechargeOrderStatus;
|
||||
pub use runtime_profile_recharge_product_kind_type::RuntimeProfileRechargeProductKind;
|
||||
@@ -1543,6 +1556,7 @@ pub use runtime_tracking_event_procedure_result_type::RuntimeTrackingEventProced
|
||||
pub use runtime_tracking_scope_kind_type::RuntimeTrackingScopeKind;
|
||||
pub use save_puzzle_form_draft_procedure::save_puzzle_form_draft;
|
||||
pub use save_puzzle_generated_images_procedure::save_puzzle_generated_images;
|
||||
pub use save_puzzle_ui_background_procedure::save_puzzle_ui_background;
|
||||
pub use seed_analytics_date_dimensions_reducer::seed_analytics_date_dimensions;
|
||||
pub use select_puzzle_cover_image_procedure::select_puzzle_cover_image;
|
||||
pub use square_hole_agent_message_finalize_input_type::SquareHoleAgentMessageFinalizeInput;
|
||||
@@ -1962,6 +1976,7 @@ pub struct DbUpdate {
|
||||
asset_event: __sdk::TableUpdate<AssetEvent>,
|
||||
asset_object: __sdk::TableUpdate<AssetObject>,
|
||||
auth_identity: __sdk::TableUpdate<AuthIdentity>,
|
||||
auth_store_projection_meta: __sdk::TableUpdate<AuthStoreProjectionMeta>,
|
||||
auth_store_snapshot: __sdk::TableUpdate<AuthStoreSnapshot>,
|
||||
bark_battle_draft_config: __sdk::TableUpdate<BarkBattleDraftConfigRow>,
|
||||
bark_battle_leaderboard_entry: __sdk::TableUpdate<BarkBattleLeaderboardEntryRow>,
|
||||
@@ -2077,6 +2092,9 @@ impl TryFrom<__ws::v2::TransactionUpdate> for DbUpdate {
|
||||
"auth_identity" => db_update
|
||||
.auth_identity
|
||||
.append(auth_identity_table::parse_table_update(table_update)?),
|
||||
"auth_store_projection_meta" => db_update.auth_store_projection_meta.append(
|
||||
auth_store_projection_meta_table::parse_table_update(table_update)?,
|
||||
),
|
||||
"auth_store_snapshot" => db_update
|
||||
.auth_store_snapshot
|
||||
.append(auth_store_snapshot_table::parse_table_update(table_update)?),
|
||||
@@ -2379,6 +2397,12 @@ impl __sdk::DbUpdate for DbUpdate {
|
||||
diff.auth_identity = cache
|
||||
.apply_diff_to_table::<AuthIdentity>("auth_identity", &self.auth_identity)
|
||||
.with_updates_by_pk(|row| &row.identity_id);
|
||||
diff.auth_store_projection_meta = cache
|
||||
.apply_diff_to_table::<AuthStoreProjectionMeta>(
|
||||
"auth_store_projection_meta",
|
||||
&self.auth_store_projection_meta,
|
||||
)
|
||||
.with_updates_by_pk(|row| &row.meta_id);
|
||||
diff.auth_store_snapshot = cache
|
||||
.apply_diff_to_table::<AuthStoreSnapshot>(
|
||||
"auth_store_snapshot",
|
||||
@@ -2821,6 +2845,9 @@ impl __sdk::DbUpdate for DbUpdate {
|
||||
"auth_identity" => db_update
|
||||
.auth_identity
|
||||
.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"auth_store_projection_meta" => db_update
|
||||
.auth_store_projection_meta
|
||||
.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"auth_store_snapshot" => db_update
|
||||
.auth_store_snapshot
|
||||
.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
@@ -3095,6 +3122,9 @@ impl __sdk::DbUpdate for DbUpdate {
|
||||
"auth_identity" => db_update
|
||||
.auth_identity
|
||||
.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"auth_store_projection_meta" => db_update
|
||||
.auth_store_projection_meta
|
||||
.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"auth_store_snapshot" => db_update
|
||||
.auth_store_snapshot
|
||||
.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
@@ -3351,6 +3381,7 @@ pub struct AppliedDiff<'r> {
|
||||
asset_event: __sdk::TableAppliedDiff<'r, AssetEvent>,
|
||||
asset_object: __sdk::TableAppliedDiff<'r, AssetObject>,
|
||||
auth_identity: __sdk::TableAppliedDiff<'r, AuthIdentity>,
|
||||
auth_store_projection_meta: __sdk::TableAppliedDiff<'r, AuthStoreProjectionMeta>,
|
||||
auth_store_snapshot: __sdk::TableAppliedDiff<'r, AuthStoreSnapshot>,
|
||||
bark_battle_draft_config: __sdk::TableAppliedDiff<'r, BarkBattleDraftConfigRow>,
|
||||
bark_battle_leaderboard_entry: __sdk::TableAppliedDiff<'r, BarkBattleLeaderboardEntryRow>,
|
||||
@@ -3486,6 +3517,11 @@ impl<'r> __sdk::AppliedDiff<'r> for AppliedDiff<'r> {
|
||||
&self.auth_identity,
|
||||
event,
|
||||
);
|
||||
callbacks.invoke_table_row_callbacks::<AuthStoreProjectionMeta>(
|
||||
"auth_store_projection_meta",
|
||||
&self.auth_store_projection_meta,
|
||||
event,
|
||||
);
|
||||
callbacks.invoke_table_row_callbacks::<AuthStoreSnapshot>(
|
||||
"auth_store_snapshot",
|
||||
&self.auth_store_snapshot,
|
||||
@@ -4529,6 +4565,7 @@ impl __sdk::SpacetimeModule for RemoteModule {
|
||||
asset_event_table::register_table(client_cache);
|
||||
asset_object_table::register_table(client_cache);
|
||||
auth_identity_table::register_table(client_cache);
|
||||
auth_store_projection_meta_table::register_table(client_cache);
|
||||
auth_store_snapshot_table::register_table(client_cache);
|
||||
bark_battle_draft_config_table::register_table(client_cache);
|
||||
bark_battle_leaderboard_entry_table::register_table(client_cache);
|
||||
@@ -4618,6 +4655,7 @@ impl __sdk::SpacetimeModule for RemoteModule {
|
||||
"asset_event",
|
||||
"asset_object",
|
||||
"auth_identity",
|
||||
"auth_store_projection_meta",
|
||||
"auth_store_snapshot",
|
||||
"bark_battle_draft_config",
|
||||
"bark_battle_leaderboard_entry",
|
||||
|
||||
@@ -18,7 +18,8 @@ pub struct ProfileRechargeOrder {
|
||||
pub amount_cents: u64,
|
||||
pub status: RuntimeProfileRechargeOrderStatus,
|
||||
pub payment_channel: String,
|
||||
pub paid_at: __sdk::Timestamp,
|
||||
pub paid_at: Option<__sdk::Timestamp>,
|
||||
pub provider_transaction_id: Option<String>,
|
||||
pub created_at: __sdk::Timestamp,
|
||||
pub points_delta: i64,
|
||||
pub membership_expires_at: Option<__sdk::Timestamp>,
|
||||
@@ -41,7 +42,8 @@ pub struct ProfileRechargeOrderCols {
|
||||
pub status:
|
||||
__sdk::__query_builder::Col<ProfileRechargeOrder, RuntimeProfileRechargeOrderStatus>,
|
||||
pub payment_channel: __sdk::__query_builder::Col<ProfileRechargeOrder, String>,
|
||||
pub paid_at: __sdk::__query_builder::Col<ProfileRechargeOrder, __sdk::Timestamp>,
|
||||
pub paid_at: __sdk::__query_builder::Col<ProfileRechargeOrder, Option<__sdk::Timestamp>>,
|
||||
pub provider_transaction_id: __sdk::__query_builder::Col<ProfileRechargeOrder, Option<String>>,
|
||||
pub created_at: __sdk::__query_builder::Col<ProfileRechargeOrder, __sdk::Timestamp>,
|
||||
pub points_delta: __sdk::__query_builder::Col<ProfileRechargeOrder, i64>,
|
||||
pub membership_expires_at:
|
||||
@@ -61,6 +63,10 @@ impl __sdk::__query_builder::HasCols for ProfileRechargeOrder {
|
||||
status: __sdk::__query_builder::Col::new(table_name, "status"),
|
||||
payment_channel: __sdk::__query_builder::Col::new(table_name, "payment_channel"),
|
||||
paid_at: __sdk::__query_builder::Col::new(table_name, "paid_at"),
|
||||
provider_transaction_id: __sdk::__query_builder::Col::new(
|
||||
table_name,
|
||||
"provider_transaction_id",
|
||||
),
|
||||
created_at: __sdk::__query_builder::Col::new(table_name, "created_at"),
|
||||
points_delta: __sdk::__query_builder::Col::new(table_name, "points_delta"),
|
||||
membership_expires_at: __sdk::__query_builder::Col::new(
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct PuzzleUiBackgroundSaveInput {
|
||||
pub session_id: String,
|
||||
pub owner_user_id: String,
|
||||
pub level_id: Option<String>,
|
||||
pub levels_json: Option<String>,
|
||||
pub prompt: String,
|
||||
pub image_src: String,
|
||||
pub image_object_key: Option<String>,
|
||||
pub saved_at_micros: i64,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for PuzzleUiBackgroundSaveInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct RuntimeProfileRechargeOrderPaidInput {
|
||||
pub order_id: String,
|
||||
pub paid_at_micros: i64,
|
||||
pub provider_transaction_id: Option<String>,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for RuntimeProfileRechargeOrderPaidInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
@@ -18,7 +18,8 @@ pub struct RuntimeProfileRechargeOrderSnapshot {
|
||||
pub amount_cents: u64,
|
||||
pub status: RuntimeProfileRechargeOrderStatus,
|
||||
pub payment_channel: String,
|
||||
pub paid_at_micros: i64,
|
||||
pub paid_at_micros: Option<i64>,
|
||||
pub provider_transaction_id: Option<String>,
|
||||
pub created_at_micros: i64,
|
||||
pub points_delta: i64,
|
||||
pub membership_expires_at_micros: Option<i64>,
|
||||
|
||||
@@ -8,7 +8,15 @@ use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
#[sats(crate = __lib)]
|
||||
#[derive(Copy, Eq, Hash)]
|
||||
pub enum RuntimeProfileRechargeOrderStatus {
|
||||
Pending,
|
||||
|
||||
Paid,
|
||||
|
||||
Failed,
|
||||
|
||||
Closed,
|
||||
|
||||
Refunded,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for RuntimeProfileRechargeOrderStatus {
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
use super::puzzle_agent_session_procedure_result_type::PuzzleAgentSessionProcedureResult;
|
||||
use super::puzzle_ui_background_save_input_type::PuzzleUiBackgroundSaveInput;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
struct SavePuzzleUiBackgroundArgs {
|
||||
pub input: PuzzleUiBackgroundSaveInput,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for SavePuzzleUiBackgroundArgs {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the procedure `save_puzzle_ui_background`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteProcedures`].
|
||||
pub trait save_puzzle_ui_background {
|
||||
fn save_puzzle_ui_background(&self, input: PuzzleUiBackgroundSaveInput) {
|
||||
self.save_puzzle_ui_background_then(input, |_, _| {});
|
||||
}
|
||||
|
||||
fn save_puzzle_ui_background_then(
|
||||
&self,
|
||||
input: PuzzleUiBackgroundSaveInput,
|
||||
|
||||
__callback: impl FnOnce(
|
||||
&super::ProcedureEventContext,
|
||||
Result<PuzzleAgentSessionProcedureResult, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
);
|
||||
}
|
||||
|
||||
impl save_puzzle_ui_background for super::RemoteProcedures {
|
||||
fn save_puzzle_ui_background_then(
|
||||
&self,
|
||||
input: PuzzleUiBackgroundSaveInput,
|
||||
|
||||
__callback: impl FnOnce(
|
||||
&super::ProcedureEventContext,
|
||||
Result<PuzzleAgentSessionProcedureResult, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
) {
|
||||
self.imp
|
||||
.invoke_procedure_with_callback::<_, PuzzleAgentSessionProcedureResult>(
|
||||
"save_puzzle_ui_background",
|
||||
SavePuzzleUiBackgroundArgs { input },
|
||||
__callback,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ use crate::module_bindings::claim_puzzle_work_point_incentive_procedure::claim_p
|
||||
use crate::module_bindings::delete_puzzle_work_procedure::delete_puzzle_work;
|
||||
use crate::module_bindings::record_puzzle_work_like_procedure::record_puzzle_work_like;
|
||||
use crate::module_bindings::remix_puzzle_work_procedure::remix_puzzle_work;
|
||||
use crate::module_bindings::save_puzzle_ui_background_procedure::save_puzzle_ui_background;
|
||||
|
||||
impl SpacetimeClient {
|
||||
pub async fn create_puzzle_agent_session(
|
||||
@@ -190,6 +191,35 @@ impl SpacetimeClient {
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn save_puzzle_ui_background(
|
||||
&self,
|
||||
input: PuzzleUiBackgroundSaveRecordInput,
|
||||
) -> Result<PuzzleAgentSessionRecord, SpacetimeClientError> {
|
||||
let procedure_input = PuzzleUiBackgroundSaveInput {
|
||||
session_id: input.session_id,
|
||||
owner_user_id: input.owner_user_id,
|
||||
level_id: input.level_id,
|
||||
levels_json: input.levels_json,
|
||||
prompt: input.prompt,
|
||||
image_src: input.image_src,
|
||||
image_object_key: input.image_object_key,
|
||||
saved_at_micros: input.saved_at_micros,
|
||||
};
|
||||
|
||||
self.call_after_connect(move |connection, sender| {
|
||||
connection.procedures().save_puzzle_ui_background_then(
|
||||
procedure_input,
|
||||
move |_, result| {
|
||||
let mapped = result
|
||||
.map_err(SpacetimeClientError::from_sdk_error)
|
||||
.and_then(map_puzzle_agent_session_procedure_result);
|
||||
send_once(&sender, mapped);
|
||||
},
|
||||
);
|
||||
})
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn select_puzzle_cover_image(
|
||||
&self,
|
||||
input: PuzzleSelectCoverImageRecordInput,
|
||||
|
||||
@@ -268,6 +268,42 @@ impl SpacetimeClient {
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn mark_profile_recharge_order_paid(
|
||||
&self,
|
||||
order_id: String,
|
||||
paid_at_micros: i64,
|
||||
provider_transaction_id: Option<String>,
|
||||
) -> Result<
|
||||
(
|
||||
RuntimeProfileRechargeCenterRecord,
|
||||
RuntimeProfileRechargeOrderRecord,
|
||||
),
|
||||
SpacetimeClientError,
|
||||
> {
|
||||
let procedure_input = module_runtime::build_runtime_profile_recharge_order_paid_input(
|
||||
order_id,
|
||||
paid_at_micros,
|
||||
provider_transaction_id,
|
||||
)
|
||||
.map_err(SpacetimeClientError::validation_failed)?
|
||||
.into();
|
||||
|
||||
self.call_after_connect(move |connection, sender| {
|
||||
connection
|
||||
.procedures()
|
||||
.mark_profile_recharge_order_paid_and_return_then(
|
||||
procedure_input,
|
||||
move |_, result| {
|
||||
let mapped = result
|
||||
.map_err(SpacetimeClientError::from_sdk_error)
|
||||
.and_then(map_runtime_profile_recharge_order_procedure_result);
|
||||
send_once(&sender, mapped);
|
||||
},
|
||||
);
|
||||
})
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn submit_profile_feedback(
|
||||
&self,
|
||||
user_id: String,
|
||||
|
||||
Reference in New Issue
Block a user