Merge branch 'master' of http://82.157.175.59:3000/GenarrativeAI/Genarrative
Some checks failed
CI / verify (push) Has been cancelled
Some checks failed
CI / verify (push) Has been cancelled
This commit is contained in:
@@ -154,8 +154,9 @@ use module_puzzle::{
|
||||
use module_runtime::{
|
||||
AnalyticsMetricQueryResponse as DomainAnalyticsMetricQueryResponse, RuntimeBrowseHistoryRecord,
|
||||
RuntimePlatformTheme as DomainRuntimePlatformTheme, RuntimeProfileDashboardRecord,
|
||||
RuntimeProfileInviteCodeRecord, RuntimeProfilePlayStatsRecord,
|
||||
RuntimeProfileRechargeCenterRecord, RuntimeProfileRechargeOrderRecord,
|
||||
RuntimeProfileFeedbackSubmissionRecord, RuntimeProfileInviteCodeRecord,
|
||||
RuntimeProfilePlayStatsRecord, RuntimeProfileRechargeCenterRecord,
|
||||
RuntimeProfileRechargeOrderRecord,
|
||||
RuntimeProfileRedeemCodeMode as DomainRuntimeProfileRedeemCodeMode,
|
||||
RuntimeProfileRedeemCodeRecord, RuntimeProfileRewardCodeRedeemRecord,
|
||||
RuntimeProfileSaveArchiveRecord, RuntimeProfileTaskCenterRecord, RuntimeProfileTaskClaimRecord,
|
||||
@@ -167,6 +168,8 @@ use module_runtime::{
|
||||
build_runtime_browse_history_clear_input, build_runtime_browse_history_list_input,
|
||||
build_runtime_browse_history_record, build_runtime_browse_history_sync_input,
|
||||
build_runtime_profile_dashboard_get_input, build_runtime_profile_dashboard_record,
|
||||
build_runtime_profile_feedback_submission_input,
|
||||
build_runtime_profile_feedback_submission_record,
|
||||
build_runtime_profile_invite_code_admin_list_input,
|
||||
build_runtime_profile_invite_code_admin_upsert_input, build_runtime_profile_invite_code_record,
|
||||
build_runtime_profile_play_stats_get_input, build_runtime_profile_play_stats_record,
|
||||
|
||||
@@ -161,6 +161,34 @@ impl From<module_runtime::RuntimeProfileRechargeOrderCreateInput>
|
||||
}
|
||||
}
|
||||
|
||||
impl From<module_runtime::RuntimeProfileFeedbackSubmissionInput>
|
||||
for RuntimeProfileFeedbackSubmissionInput
|
||||
{
|
||||
fn from(input: module_runtime::RuntimeProfileFeedbackSubmissionInput) -> Self {
|
||||
Self {
|
||||
user_id: input.user_id,
|
||||
description: input.description,
|
||||
contact_phone: input.contact_phone,
|
||||
evidence_items: input.evidence_items.into_iter().map(Into::into).collect(),
|
||||
created_at_micros: input.created_at_micros,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<module_runtime::RuntimeProfileFeedbackEvidenceSnapshot>
|
||||
for RuntimeProfileFeedbackEvidenceSnapshot
|
||||
{
|
||||
fn from(input: module_runtime::RuntimeProfileFeedbackEvidenceSnapshot) -> Self {
|
||||
Self {
|
||||
evidence_id: input.evidence_id,
|
||||
file_name: input.file_name,
|
||||
content_type: input.content_type,
|
||||
size_bytes: input.size_bytes,
|
||||
data_url: input.data_url,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<module_runtime::RuntimeProfileRewardCodeRedeemInput>
|
||||
for RuntimeProfileRewardCodeRedeemInput
|
||||
{
|
||||
@@ -846,6 +874,23 @@ pub(crate) fn map_runtime_profile_recharge_order_procedure_result(
|
||||
))
|
||||
}
|
||||
|
||||
pub(crate) fn map_runtime_profile_feedback_submission_procedure_result(
|
||||
result: RuntimeProfileFeedbackSubmissionProcedureResult,
|
||||
) -> Result<RuntimeProfileFeedbackSubmissionRecord, SpacetimeClientError> {
|
||||
if !result.ok {
|
||||
return Err(SpacetimeClientError::procedure_failed(result.error_message));
|
||||
}
|
||||
|
||||
let snapshot = result
|
||||
.record
|
||||
.ok_or_else(|| SpacetimeClientError::missing_snapshot("profile feedback 快照"))?;
|
||||
|
||||
build_runtime_profile_feedback_submission_record(
|
||||
map_runtime_profile_feedback_submission_snapshot(snapshot),
|
||||
)
|
||||
.map_err(SpacetimeClientError::validation_failed)
|
||||
}
|
||||
|
||||
pub(crate) fn map_runtime_referral_invite_center_procedure_result(
|
||||
result: RuntimeReferralInviteCenterProcedureResult,
|
||||
) -> Result<RuntimeReferralInviteCenterRecord, SpacetimeClientError> {
|
||||
@@ -2110,6 +2155,21 @@ pub(crate) fn map_runtime_profile_recharge_order_snapshot(
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn map_runtime_profile_feedback_submission_snapshot(
|
||||
snapshot: RuntimeProfileFeedbackSubmissionSnapshot,
|
||||
) -> module_runtime::RuntimeProfileFeedbackSubmissionSnapshot {
|
||||
module_runtime::RuntimeProfileFeedbackSubmissionSnapshot {
|
||||
feedback_id: snapshot.feedback_id,
|
||||
user_id: snapshot.user_id,
|
||||
description: snapshot.description,
|
||||
contact_phone: snapshot.contact_phone,
|
||||
evidence_json: snapshot.evidence_json,
|
||||
status: map_runtime_profile_feedback_status_back(snapshot.status),
|
||||
created_at_micros: snapshot.created_at_micros,
|
||||
updated_at_micros: snapshot.updated_at_micros,
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn map_runtime_referral_invite_center_snapshot(
|
||||
snapshot: RuntimeReferralInviteCenterSnapshot,
|
||||
) -> module_runtime::RuntimeReferralInviteCenterSnapshot {
|
||||
@@ -4877,6 +4937,16 @@ pub(crate) fn map_runtime_profile_recharge_order_status_back(
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn map_runtime_profile_feedback_status_back(
|
||||
value: crate::module_bindings::RuntimeProfileFeedbackStatus,
|
||||
) -> module_runtime::RuntimeProfileFeedbackStatus {
|
||||
match value {
|
||||
crate::module_bindings::RuntimeProfileFeedbackStatus::Open => {
|
||||
module_runtime::RuntimeProfileFeedbackStatus::Open
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn map_story_session_status(value: StorySessionStatus) -> DomainStorySessionStatus {
|
||||
match value {
|
||||
StorySessionStatus::Active => DomainStorySessionStatus::Active,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
// This was generated using spacetimedb cli version 2.1.0 (commit 6981f48b4bc1a71c8dd9bdfe5a2c343f6370243d).
|
||||
// This was generated using spacetimedb cli version 2.2.0 (commit eb11e2f5c41dce6979715ad407996270d61329f6).
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
@@ -409,6 +409,8 @@ pub mod player_progression_table;
|
||||
pub mod player_progression_type;
|
||||
pub mod profile_dashboard_state_table;
|
||||
pub mod profile_dashboard_state_type;
|
||||
pub mod profile_feedback_submission_table;
|
||||
pub mod profile_feedback_submission_type;
|
||||
pub mod profile_invite_code_table;
|
||||
pub mod profile_invite_code_type;
|
||||
pub mod profile_membership_table;
|
||||
@@ -579,6 +581,11 @@ pub mod runtime_platform_theme_type;
|
||||
pub mod runtime_profile_dashboard_get_input_type;
|
||||
pub mod runtime_profile_dashboard_procedure_result_type;
|
||||
pub mod runtime_profile_dashboard_snapshot_type;
|
||||
pub mod runtime_profile_feedback_evidence_snapshot_type;
|
||||
pub mod runtime_profile_feedback_status_type;
|
||||
pub mod runtime_profile_feedback_submission_input_type;
|
||||
pub mod runtime_profile_feedback_submission_procedure_result_type;
|
||||
pub mod runtime_profile_feedback_submission_snapshot_type;
|
||||
pub mod runtime_profile_invite_code_admin_list_input_type;
|
||||
pub mod runtime_profile_invite_code_admin_list_procedure_result_type;
|
||||
pub mod runtime_profile_invite_code_admin_procedure_result_type;
|
||||
@@ -655,8 +662,8 @@ pub mod runtime_snapshot_row_type;
|
||||
pub mod runtime_snapshot_table;
|
||||
pub mod runtime_snapshot_type;
|
||||
pub mod runtime_snapshot_upsert_input_type;
|
||||
pub mod runtime_tracking_scope_kind_type;
|
||||
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 seed_analytics_date_dimensions_reducer;
|
||||
@@ -716,6 +723,7 @@ 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_match_3_d_agent_message_procedure;
|
||||
pub mod submit_profile_feedback_and_return_procedure;
|
||||
pub mod submit_puzzle_agent_message_procedure;
|
||||
pub mod submit_puzzle_leaderboard_entry_procedure;
|
||||
pub mod submit_square_hole_agent_message_procedure;
|
||||
@@ -1195,6 +1203,8 @@ pub use player_progression_table::*;
|
||||
pub use player_progression_type::PlayerProgression;
|
||||
pub use profile_dashboard_state_table::*;
|
||||
pub use profile_dashboard_state_type::ProfileDashboardState;
|
||||
pub use profile_feedback_submission_table::*;
|
||||
pub use profile_feedback_submission_type::ProfileFeedbackSubmission;
|
||||
pub use profile_invite_code_table::*;
|
||||
pub use profile_invite_code_type::ProfileInviteCode;
|
||||
pub use profile_membership_table::*;
|
||||
@@ -1365,6 +1375,11 @@ pub use runtime_platform_theme_type::RuntimePlatformTheme;
|
||||
pub use runtime_profile_dashboard_get_input_type::RuntimeProfileDashboardGetInput;
|
||||
pub use runtime_profile_dashboard_procedure_result_type::RuntimeProfileDashboardProcedureResult;
|
||||
pub use runtime_profile_dashboard_snapshot_type::RuntimeProfileDashboardSnapshot;
|
||||
pub use runtime_profile_feedback_evidence_snapshot_type::RuntimeProfileFeedbackEvidenceSnapshot;
|
||||
pub use runtime_profile_feedback_status_type::RuntimeProfileFeedbackStatus;
|
||||
pub use runtime_profile_feedback_submission_input_type::RuntimeProfileFeedbackSubmissionInput;
|
||||
pub use runtime_profile_feedback_submission_procedure_result_type::RuntimeProfileFeedbackSubmissionProcedureResult;
|
||||
pub use runtime_profile_feedback_submission_snapshot_type::RuntimeProfileFeedbackSubmissionSnapshot;
|
||||
pub use runtime_profile_invite_code_admin_list_input_type::RuntimeProfileInviteCodeAdminListInput;
|
||||
pub use runtime_profile_invite_code_admin_list_procedure_result_type::RuntimeProfileInviteCodeAdminListProcedureResult;
|
||||
pub use runtime_profile_invite_code_admin_procedure_result_type::RuntimeProfileInviteCodeAdminProcedureResult;
|
||||
@@ -1441,8 +1456,8 @@ pub use runtime_snapshot_row_type::RuntimeSnapshotRow;
|
||||
pub use runtime_snapshot_table::*;
|
||||
pub use runtime_snapshot_type::RuntimeSnapshot;
|
||||
pub use runtime_snapshot_upsert_input_type::RuntimeSnapshotUpsertInput;
|
||||
pub use runtime_tracking_scope_kind_type::RuntimeTrackingScopeKind;
|
||||
pub use runtime_tracking_event_procedure_result_type::RuntimeTrackingEventProcedureResult;
|
||||
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 seed_analytics_date_dimensions_reducer::seed_analytics_date_dimensions;
|
||||
@@ -1502,6 +1517,7 @@ 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_match_3_d_agent_message_procedure::submit_match_3_d_agent_message;
|
||||
pub use submit_profile_feedback_and_return_procedure::submit_profile_feedback_and_return;
|
||||
pub use submit_puzzle_agent_message_procedure::submit_puzzle_agent_message;
|
||||
pub use submit_puzzle_leaderboard_entry_procedure::submit_puzzle_leaderboard_entry;
|
||||
pub use submit_square_hole_agent_message_procedure::submit_square_hole_agent_message;
|
||||
@@ -1885,6 +1901,7 @@ pub struct DbUpdate {
|
||||
npc_state: __sdk::TableUpdate<NpcState>,
|
||||
player_progression: __sdk::TableUpdate<PlayerProgression>,
|
||||
profile_dashboard_state: __sdk::TableUpdate<ProfileDashboardState>,
|
||||
profile_feedback_submission: __sdk::TableUpdate<ProfileFeedbackSubmission>,
|
||||
profile_invite_code: __sdk::TableUpdate<ProfileInviteCode>,
|
||||
profile_membership: __sdk::TableUpdate<ProfileMembership>,
|
||||
profile_played_world: __sdk::TableUpdate<ProfilePlayedWorld>,
|
||||
@@ -2042,6 +2059,9 @@ impl TryFrom<__ws::v2::TransactionUpdate> for DbUpdate {
|
||||
"profile_dashboard_state" => db_update.profile_dashboard_state.append(
|
||||
profile_dashboard_state_table::parse_table_update(table_update)?,
|
||||
),
|
||||
"profile_feedback_submission" => db_update.profile_feedback_submission.append(
|
||||
profile_feedback_submission_table::parse_table_update(table_update)?,
|
||||
),
|
||||
"profile_invite_code" => db_update
|
||||
.profile_invite_code
|
||||
.append(profile_invite_code_table::parse_table_update(table_update)?),
|
||||
@@ -2367,6 +2387,12 @@ impl __sdk::DbUpdate for DbUpdate {
|
||||
&self.profile_dashboard_state,
|
||||
)
|
||||
.with_updates_by_pk(|row| &row.user_id);
|
||||
diff.profile_feedback_submission = cache
|
||||
.apply_diff_to_table::<ProfileFeedbackSubmission>(
|
||||
"profile_feedback_submission",
|
||||
&self.profile_feedback_submission,
|
||||
)
|
||||
.with_updates_by_pk(|row| &row.feedback_id);
|
||||
diff.profile_invite_code = cache
|
||||
.apply_diff_to_table::<ProfileInviteCode>(
|
||||
"profile_invite_code",
|
||||
@@ -2688,6 +2714,9 @@ impl __sdk::DbUpdate for DbUpdate {
|
||||
"profile_dashboard_state" => db_update
|
||||
.profile_dashboard_state
|
||||
.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"profile_feedback_submission" => db_update
|
||||
.profile_feedback_submission
|
||||
.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"profile_invite_code" => db_update
|
||||
.profile_invite_code
|
||||
.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
@@ -2932,6 +2961,9 @@ impl __sdk::DbUpdate for DbUpdate {
|
||||
"profile_dashboard_state" => db_update
|
||||
.profile_dashboard_state
|
||||
.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"profile_feedback_submission" => db_update
|
||||
.profile_feedback_submission
|
||||
.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"profile_invite_code" => db_update
|
||||
.profile_invite_code
|
||||
.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
@@ -3108,6 +3140,7 @@ pub struct AppliedDiff<'r> {
|
||||
npc_state: __sdk::TableAppliedDiff<'r, NpcState>,
|
||||
player_progression: __sdk::TableAppliedDiff<'r, PlayerProgression>,
|
||||
profile_dashboard_state: __sdk::TableAppliedDiff<'r, ProfileDashboardState>,
|
||||
profile_feedback_submission: __sdk::TableAppliedDiff<'r, ProfileFeedbackSubmission>,
|
||||
profile_invite_code: __sdk::TableAppliedDiff<'r, ProfileInviteCode>,
|
||||
profile_membership: __sdk::TableAppliedDiff<'r, ProfileMembership>,
|
||||
profile_played_world: __sdk::TableAppliedDiff<'r, ProfilePlayedWorld>,
|
||||
@@ -3327,6 +3360,11 @@ impl<'r> __sdk::AppliedDiff<'r> for AppliedDiff<'r> {
|
||||
&self.profile_dashboard_state,
|
||||
event,
|
||||
);
|
||||
callbacks.invoke_table_row_callbacks::<ProfileFeedbackSubmission>(
|
||||
"profile_feedback_submission",
|
||||
&self.profile_feedback_submission,
|
||||
event,
|
||||
);
|
||||
callbacks.invoke_table_row_callbacks::<ProfileInviteCode>(
|
||||
"profile_invite_code",
|
||||
&self.profile_invite_code,
|
||||
@@ -4224,6 +4262,7 @@ impl __sdk::SpacetimeModule for RemoteModule {
|
||||
npc_state_table::register_table(client_cache);
|
||||
player_progression_table::register_table(client_cache);
|
||||
profile_dashboard_state_table::register_table(client_cache);
|
||||
profile_feedback_submission_table::register_table(client_cache);
|
||||
profile_invite_code_table::register_table(client_cache);
|
||||
profile_membership_table::register_table(client_cache);
|
||||
profile_played_world_table::register_table(client_cache);
|
||||
@@ -4303,6 +4342,7 @@ impl __sdk::SpacetimeModule for RemoteModule {
|
||||
"npc_state",
|
||||
"player_progression",
|
||||
"profile_dashboard_state",
|
||||
"profile_feedback_submission",
|
||||
"profile_invite_code",
|
||||
"profile_membership",
|
||||
"profile_played_world",
|
||||
|
||||
@@ -0,0 +1,167 @@
|
||||
// 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::profile_feedback_submission_type::ProfileFeedbackSubmission;
|
||||
use super::runtime_profile_feedback_status_type::RuntimeProfileFeedbackStatus;
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
/// Table handle for the table `profile_feedback_submission`.
|
||||
///
|
||||
/// Obtain a handle from the [`ProfileFeedbackSubmissionTableAccess::profile_feedback_submission`] method on [`super::RemoteTables`],
|
||||
/// like `ctx.db.profile_feedback_submission()`.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.profile_feedback_submission().on_insert(...)`.
|
||||
pub struct ProfileFeedbackSubmissionTableHandle<'ctx> {
|
||||
imp: __sdk::TableHandle<ProfileFeedbackSubmission>,
|
||||
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the table `profile_feedback_submission`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteTables`].
|
||||
pub trait ProfileFeedbackSubmissionTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Obtain a [`ProfileFeedbackSubmissionTableHandle`], which mediates access to the table `profile_feedback_submission`.
|
||||
fn profile_feedback_submission(&self) -> ProfileFeedbackSubmissionTableHandle<'_>;
|
||||
}
|
||||
|
||||
impl ProfileFeedbackSubmissionTableAccess for super::RemoteTables {
|
||||
fn profile_feedback_submission(&self) -> ProfileFeedbackSubmissionTableHandle<'_> {
|
||||
ProfileFeedbackSubmissionTableHandle {
|
||||
imp: self
|
||||
.imp
|
||||
.get_table::<ProfileFeedbackSubmission>("profile_feedback_submission"),
|
||||
ctx: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct ProfileFeedbackSubmissionInsertCallbackId(__sdk::CallbackId);
|
||||
pub struct ProfileFeedbackSubmissionDeleteCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::Table for ProfileFeedbackSubmissionTableHandle<'ctx> {
|
||||
type Row = ProfileFeedbackSubmission;
|
||||
type EventContext = super::EventContext;
|
||||
|
||||
fn count(&self) -> u64 {
|
||||
self.imp.count()
|
||||
}
|
||||
fn iter(&self) -> impl Iterator<Item = ProfileFeedbackSubmission> + '_ {
|
||||
self.imp.iter()
|
||||
}
|
||||
|
||||
type InsertCallbackId = ProfileFeedbackSubmissionInsertCallbackId;
|
||||
|
||||
fn on_insert(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> ProfileFeedbackSubmissionInsertCallbackId {
|
||||
ProfileFeedbackSubmissionInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_insert(&self, callback: ProfileFeedbackSubmissionInsertCallbackId) {
|
||||
self.imp.remove_on_insert(callback.0)
|
||||
}
|
||||
|
||||
type DeleteCallbackId = ProfileFeedbackSubmissionDeleteCallbackId;
|
||||
|
||||
fn on_delete(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> ProfileFeedbackSubmissionDeleteCallbackId {
|
||||
ProfileFeedbackSubmissionDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_delete(&self, callback: ProfileFeedbackSubmissionDeleteCallbackId) {
|
||||
self.imp.remove_on_delete(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct ProfileFeedbackSubmissionUpdateCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::TableWithPrimaryKey for ProfileFeedbackSubmissionTableHandle<'ctx> {
|
||||
type UpdateCallbackId = ProfileFeedbackSubmissionUpdateCallbackId;
|
||||
|
||||
fn on_update(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||
) -> ProfileFeedbackSubmissionUpdateCallbackId {
|
||||
ProfileFeedbackSubmissionUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_update(&self, callback: ProfileFeedbackSubmissionUpdateCallbackId) {
|
||||
self.imp.remove_on_update(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
/// Access to the `feedback_id` unique index on the table `profile_feedback_submission`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`ProfileFeedbackSubmissionFeedbackIdUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.profile_feedback_submission().feedback_id().find(...)`.
|
||||
pub struct ProfileFeedbackSubmissionFeedbackIdUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<ProfileFeedbackSubmission, String>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
impl<'ctx> ProfileFeedbackSubmissionTableHandle<'ctx> {
|
||||
/// Get a handle on the `feedback_id` unique index on the table `profile_feedback_submission`.
|
||||
pub fn feedback_id(&self) -> ProfileFeedbackSubmissionFeedbackIdUnique<'ctx> {
|
||||
ProfileFeedbackSubmissionFeedbackIdUnique {
|
||||
imp: self.imp.get_unique_constraint::<String>("feedback_id"),
|
||||
phantom: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> ProfileFeedbackSubmissionFeedbackIdUnique<'ctx> {
|
||||
/// Find the subscribed row whose `feedback_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<ProfileFeedbackSubmission> {
|
||||
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::<ProfileFeedbackSubmission>("profile_feedback_submission");
|
||||
_table.add_unique_constraint::<String>("feedback_id", |row| &row.feedback_id);
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub(super) fn parse_table_update(
|
||||
raw_updates: __ws::v2::TableUpdate,
|
||||
) -> __sdk::Result<__sdk::TableUpdate<ProfileFeedbackSubmission>> {
|
||||
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||
__sdk::InternalError::failed_parse("TableUpdate<ProfileFeedbackSubmission>", "TableUpdate")
|
||||
.with_cause(e)
|
||||
.into()
|
||||
})
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `ProfileFeedbackSubmission`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait profile_feedback_submissionQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `ProfileFeedbackSubmission`.
|
||||
fn profile_feedback_submission(
|
||||
&self,
|
||||
) -> __sdk::__query_builder::Table<ProfileFeedbackSubmission>;
|
||||
}
|
||||
|
||||
impl profile_feedback_submissionQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn profile_feedback_submission(
|
||||
&self,
|
||||
) -> __sdk::__query_builder::Table<ProfileFeedbackSubmission> {
|
||||
__sdk::__query_builder::Table::new("profile_feedback_submission")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
use super::runtime_profile_feedback_status_type::RuntimeProfileFeedbackStatus;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct ProfileFeedbackSubmission {
|
||||
pub feedback_id: String,
|
||||
pub user_id: String,
|
||||
pub description: String,
|
||||
pub contact_phone: Option<String>,
|
||||
pub evidence_json: String,
|
||||
pub status: RuntimeProfileFeedbackStatus,
|
||||
pub created_at: __sdk::Timestamp,
|
||||
pub updated_at: __sdk::Timestamp,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for ProfileFeedbackSubmission {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
/// Column accessor struct for the table `ProfileFeedbackSubmission`.
|
||||
///
|
||||
/// Provides typed access to columns for query building.
|
||||
pub struct ProfileFeedbackSubmissionCols {
|
||||
pub feedback_id: __sdk::__query_builder::Col<ProfileFeedbackSubmission, String>,
|
||||
pub user_id: __sdk::__query_builder::Col<ProfileFeedbackSubmission, String>,
|
||||
pub description: __sdk::__query_builder::Col<ProfileFeedbackSubmission, String>,
|
||||
pub contact_phone: __sdk::__query_builder::Col<ProfileFeedbackSubmission, Option<String>>,
|
||||
pub evidence_json: __sdk::__query_builder::Col<ProfileFeedbackSubmission, String>,
|
||||
pub status:
|
||||
__sdk::__query_builder::Col<ProfileFeedbackSubmission, RuntimeProfileFeedbackStatus>,
|
||||
pub created_at: __sdk::__query_builder::Col<ProfileFeedbackSubmission, __sdk::Timestamp>,
|
||||
pub updated_at: __sdk::__query_builder::Col<ProfileFeedbackSubmission, __sdk::Timestamp>,
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::HasCols for ProfileFeedbackSubmission {
|
||||
type Cols = ProfileFeedbackSubmissionCols;
|
||||
fn cols(table_name: &'static str) -> Self::Cols {
|
||||
ProfileFeedbackSubmissionCols {
|
||||
feedback_id: __sdk::__query_builder::Col::new(table_name, "feedback_id"),
|
||||
user_id: __sdk::__query_builder::Col::new(table_name, "user_id"),
|
||||
description: __sdk::__query_builder::Col::new(table_name, "description"),
|
||||
contact_phone: __sdk::__query_builder::Col::new(table_name, "contact_phone"),
|
||||
evidence_json: __sdk::__query_builder::Col::new(table_name, "evidence_json"),
|
||||
status: __sdk::__query_builder::Col::new(table_name, "status"),
|
||||
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 `ProfileFeedbackSubmission`.
|
||||
///
|
||||
/// Provides typed access to indexed columns for query building.
|
||||
pub struct ProfileFeedbackSubmissionIxCols {
|
||||
pub feedback_id: __sdk::__query_builder::IxCol<ProfileFeedbackSubmission, String>,
|
||||
pub user_id: __sdk::__query_builder::IxCol<ProfileFeedbackSubmission, String>,
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::HasIxCols for ProfileFeedbackSubmission {
|
||||
type IxCols = ProfileFeedbackSubmissionIxCols;
|
||||
fn ix_cols(table_name: &'static str) -> Self::IxCols {
|
||||
ProfileFeedbackSubmissionIxCols {
|
||||
feedback_id: __sdk::__query_builder::IxCol::new(table_name, "feedback_id"),
|
||||
user_id: __sdk::__query_builder::IxCol::new(table_name, "user_id"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl __sdk::__query_builder::CanBeLookupTable for ProfileFeedbackSubmission {}
|
||||
@@ -34,10 +34,10 @@ pub trait record_daily_login_tracking_event_and_return {
|
||||
input: RuntimeProfileTaskCenterGetInput,
|
||||
|
||||
__callback: impl FnOnce(
|
||||
&super::ProcedureEventContext,
|
||||
Result<RuntimeTrackingEventProcedureResult, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
&super::ProcedureEventContext,
|
||||
Result<RuntimeTrackingEventProcedureResult, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -47,10 +47,10 @@ impl record_daily_login_tracking_event_and_return for super::RemoteProcedures {
|
||||
input: RuntimeProfileTaskCenterGetInput,
|
||||
|
||||
__callback: impl FnOnce(
|
||||
&super::ProcedureEventContext,
|
||||
Result<RuntimeTrackingEventProcedureResult, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
&super::ProcedureEventContext,
|
||||
Result<RuntimeTrackingEventProcedureResult, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
) {
|
||||
self.imp
|
||||
.invoke_procedure_with_callback::<_, RuntimeTrackingEventProcedureResult>(
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct RuntimeProfileFeedbackEvidenceSnapshot {
|
||||
pub evidence_id: String,
|
||||
pub file_name: String,
|
||||
pub content_type: String,
|
||||
pub size_bytes: u64,
|
||||
pub data_url: String,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for RuntimeProfileFeedbackEvidenceSnapshot {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
#[derive(Copy, Eq, Hash)]
|
||||
pub enum RuntimeProfileFeedbackStatus {
|
||||
Open,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for RuntimeProfileFeedbackStatus {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
use super::runtime_profile_feedback_evidence_snapshot_type::RuntimeProfileFeedbackEvidenceSnapshot;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct RuntimeProfileFeedbackSubmissionInput {
|
||||
pub user_id: String,
|
||||
pub description: String,
|
||||
pub contact_phone: Option<String>,
|
||||
pub evidence_items: Vec<RuntimeProfileFeedbackEvidenceSnapshot>,
|
||||
pub created_at_micros: i64,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for RuntimeProfileFeedbackSubmissionInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
use super::runtime_profile_feedback_submission_snapshot_type::RuntimeProfileFeedbackSubmissionSnapshot;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct RuntimeProfileFeedbackSubmissionProcedureResult {
|
||||
pub ok: bool,
|
||||
pub record: Option<RuntimeProfileFeedbackSubmissionSnapshot>,
|
||||
pub error_message: Option<String>,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for RuntimeProfileFeedbackSubmissionProcedureResult {
|
||||
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};
|
||||
|
||||
use super::runtime_profile_feedback_status_type::RuntimeProfileFeedbackStatus;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct RuntimeProfileFeedbackSubmissionSnapshot {
|
||||
pub feedback_id: String,
|
||||
pub user_id: String,
|
||||
pub description: String,
|
||||
pub contact_phone: Option<String>,
|
||||
pub evidence_json: String,
|
||||
pub status: RuntimeProfileFeedbackStatus,
|
||||
pub created_at_micros: i64,
|
||||
pub updated_at_micros: i64,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for RuntimeProfileFeedbackSubmissionSnapshot {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
use super::runtime_profile_feedback_submission_input_type::RuntimeProfileFeedbackSubmissionInput;
|
||||
use super::runtime_profile_feedback_submission_procedure_result_type::RuntimeProfileFeedbackSubmissionProcedureResult;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
struct SubmitProfileFeedbackAndReturnArgs {
|
||||
pub input: RuntimeProfileFeedbackSubmissionInput,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for SubmitProfileFeedbackAndReturnArgs {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the procedure `submit_profile_feedback_and_return`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteProcedures`].
|
||||
pub trait submit_profile_feedback_and_return {
|
||||
fn submit_profile_feedback_and_return(&self, input: RuntimeProfileFeedbackSubmissionInput) {
|
||||
self.submit_profile_feedback_and_return_then(input, |_, _| {});
|
||||
}
|
||||
|
||||
fn submit_profile_feedback_and_return_then(
|
||||
&self,
|
||||
input: RuntimeProfileFeedbackSubmissionInput,
|
||||
|
||||
__callback: impl FnOnce(
|
||||
&super::ProcedureEventContext,
|
||||
Result<RuntimeProfileFeedbackSubmissionProcedureResult, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
);
|
||||
}
|
||||
|
||||
impl submit_profile_feedback_and_return for super::RemoteProcedures {
|
||||
fn submit_profile_feedback_and_return_then(
|
||||
&self,
|
||||
input: RuntimeProfileFeedbackSubmissionInput,
|
||||
|
||||
__callback: impl FnOnce(
|
||||
&super::ProcedureEventContext,
|
||||
Result<RuntimeProfileFeedbackSubmissionProcedureResult, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
) {
|
||||
self.imp
|
||||
.invoke_procedure_with_callback::<_, RuntimeProfileFeedbackSubmissionProcedureResult>(
|
||||
"submit_profile_feedback_and_return",
|
||||
SubmitProfileFeedbackAndReturnArgs { input },
|
||||
__callback,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -234,6 +234,37 @@ impl SpacetimeClient {
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn submit_profile_feedback(
|
||||
&self,
|
||||
user_id: String,
|
||||
description: String,
|
||||
contact_phone: Option<String>,
|
||||
evidence_items: Vec<module_runtime::RuntimeProfileFeedbackEvidenceSnapshot>,
|
||||
created_at_micros: i64,
|
||||
) -> Result<RuntimeProfileFeedbackSubmissionRecord, SpacetimeClientError> {
|
||||
let procedure_input = build_runtime_profile_feedback_submission_input(
|
||||
user_id,
|
||||
description,
|
||||
contact_phone,
|
||||
evidence_items,
|
||||
created_at_micros,
|
||||
)
|
||||
.map_err(SpacetimeClientError::validation_failed)?
|
||||
.into();
|
||||
|
||||
self.call_after_connect(move |connection, sender| {
|
||||
connection
|
||||
.procedures()
|
||||
.submit_profile_feedback_and_return_then(procedure_input, move |_, result| {
|
||||
let mapped = result
|
||||
.map_err(SpacetimeClientError::from_sdk_error)
|
||||
.and_then(map_runtime_profile_feedback_submission_procedure_result);
|
||||
send_once(&sender, mapped);
|
||||
});
|
||||
})
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn get_profile_referral_invite_center(
|
||||
&self,
|
||||
user_id: String,
|
||||
|
||||
Reference in New Issue
Block a user