Merge remote-tracking branch 'origin/master' into feat/project-name
This commit is contained in:
Generated
+1
@@ -240,6 +240,7 @@ dependencies = [
|
||||
"platform-oss",
|
||||
"platform-speech",
|
||||
"platform-wechat",
|
||||
"regex",
|
||||
"reqwest",
|
||||
"ring",
|
||||
"rmcp",
|
||||
|
||||
@@ -16,6 +16,7 @@ hex = { workspace = true }
|
||||
image = { workspace = true, features = ["jpeg", "png", "webp"] }
|
||||
http-body-util = { workspace = true }
|
||||
reqwest = { workspace = true, features = ["json", "multipart", "rustls-tls"] }
|
||||
regex = { workspace = true }
|
||||
rmcp = { workspace = true, features = ["server", "transport-streamable-http-server"] }
|
||||
webp = { workspace = true }
|
||||
module-ai = { workspace = true }
|
||||
|
||||
@@ -1792,6 +1792,8 @@ fn admin_permission_requirement(_method: &Method, path: &str) -> AdminPermission
|
||||
"/admin/api/debug/http" => AnyTab(&["debug"]),
|
||||
"/admin/api/tracking/events" => AnyTab(&["tracking"]),
|
||||
"/admin/api/tracking/event-keys" => AnyTab(&["tracking", "tasks"]),
|
||||
"/admin/api/error-reports" => AnyTab(&["error-reports"]),
|
||||
path if path.starts_with("/admin/api/error-reports/") => AnyTab(&["error-reports"]),
|
||||
"/admin/api/feature-gates" => AnyTab(&["gray-release"]),
|
||||
"/admin/api/editor-generation-pricing" => AnyTab(&["editor-generation-pricing"]),
|
||||
"/admin/api/editor-assets" => AnyTab(&["editor-assets"]),
|
||||
@@ -6131,6 +6133,7 @@ mod tests {
|
||||
("tables", Method::GET, "/admin/api/database/tables"),
|
||||
("debug", Method::POST, "/admin/api/debug/http"),
|
||||
("tracking", Method::GET, "/admin/api/tracking/events"),
|
||||
("error-reports", Method::GET, "/admin/api/error-reports"),
|
||||
("gray-release", Method::GET, "/admin/api/feature-gates"),
|
||||
("redeem", Method::GET, "/admin/api/profile/redeem-codes"),
|
||||
("invite", Method::GET, "/admin/api/profile/invite-codes"),
|
||||
|
||||
@@ -46,6 +46,7 @@ pub fn build_router(state: AppState) -> Router {
|
||||
.merge(modules::platform::router(state.clone()))
|
||||
.merge(modules::external_generation::router(state.clone()))
|
||||
.merge(modules::platform_support::router(state.clone()))
|
||||
.merge(crate::error_reports::router(state.clone()))
|
||||
.route(
|
||||
"/api/profile/recharge/wechat/notify",
|
||||
post(handle_wechat_pay_notify),
|
||||
|
||||
@@ -105,7 +105,10 @@ pub(crate) async fn create_direct_upload_ticket_for_owner(
|
||||
"supported": platform_oss::LEGACY_PUBLIC_PREFIXES,
|
||||
}))
|
||||
})?;
|
||||
if matches!(legacy_prefix, LegacyAssetPrefix::EditorAgent) {
|
||||
if matches!(
|
||||
legacy_prefix,
|
||||
LegacyAssetPrefix::EditorAgent | LegacyAssetPrefix::AgcErrorReports
|
||||
) {
|
||||
return Err(
|
||||
AppError::from_status(StatusCode::BAD_REQUEST).with_details(json!({
|
||||
"field": "legacyPrefix",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -32,6 +32,7 @@ mod editor_screen_background_decision;
|
||||
mod editor_screen_background_filter;
|
||||
mod editor_sound_effect_prompt_assist;
|
||||
mod error_middleware;
|
||||
mod error_reports;
|
||||
mod external_api_audit;
|
||||
mod external_api_auth;
|
||||
mod external_api_keys;
|
||||
@@ -565,6 +566,7 @@ fn spawn_common_app_state_background_workers(state: &AppState) {
|
||||
|
||||
fn spawn_http_app_state_background_workers(state: &AppState, process_role: ProcessRole) {
|
||||
spawn_common_app_state_background_workers(state);
|
||||
crate::error_reports::spawn_cleanup_worker(state.clone());
|
||||
if should_start_profile_recharge_expiration_listener(process_role) {
|
||||
spawn_profile_recharge_expiration_listener(state.clone());
|
||||
spawn_profile_recharge_refund_reconciliation_worker(state.clone());
|
||||
|
||||
@@ -52,6 +52,7 @@ pub enum OssObjectAccess {
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
pub enum LegacyAssetPrefix {
|
||||
EditorAgent,
|
||||
AgcErrorReports,
|
||||
CharacterDrafts,
|
||||
Characters,
|
||||
Animations,
|
||||
@@ -103,6 +104,15 @@ pub struct OssSignedGetObjectUrlRequest {
|
||||
pub struct OssHeadObjectRequest {
|
||||
pub object_key: String,
|
||||
}
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub struct OssGetObjectRequest {
|
||||
pub object_key: String,
|
||||
pub max_bytes: usize,
|
||||
}
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub struct OssDeleteObjectRequest {
|
||||
pub object_key: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub struct OssPutObjectRequest {
|
||||
@@ -218,6 +228,8 @@ pub struct OssClient {
|
||||
pub enum OssRequestOperation {
|
||||
Put,
|
||||
Head,
|
||||
Get,
|
||||
Delete,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
@@ -291,6 +303,7 @@ impl LegacyAssetPrefix {
|
||||
|
||||
match normalized {
|
||||
"editor-agent" => Some(Self::EditorAgent),
|
||||
"agc" => Some(Self::AgcErrorReports),
|
||||
"generated-character-drafts" => Some(Self::CharacterDrafts),
|
||||
"generated-characters" => Some(Self::Characters),
|
||||
"generated-animations" => Some(Self::Animations),
|
||||
@@ -312,6 +325,7 @@ impl LegacyAssetPrefix {
|
||||
pub fn as_str(&self) -> &'static str {
|
||||
match self {
|
||||
Self::EditorAgent => "editor-agent",
|
||||
Self::AgcErrorReports => "agc",
|
||||
Self::CharacterDrafts => "generated-character-drafts",
|
||||
Self::Characters => "generated-characters",
|
||||
Self::Animations => "generated-animations",
|
||||
@@ -336,7 +350,11 @@ impl LegacyAssetPrefix {
|
||||
pub fn from_object_key(raw: &str) -> Option<Self> {
|
||||
let normalized = raw.trim().trim_start_matches('/').trim();
|
||||
let prefix = normalized.split('/').next()?;
|
||||
Self::parse(prefix)
|
||||
match Self::parse(prefix) {
|
||||
// agc/error-reports is a server-only write prefix, never a caller-supplied object key.
|
||||
Some(Self::AgcErrorReports) => None,
|
||||
other => other,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -841,6 +859,80 @@ impl OssClient {
|
||||
result
|
||||
}
|
||||
|
||||
pub async fn get_object(
|
||||
&self,
|
||||
client: &reqwest::Client,
|
||||
request: OssGetObjectRequest,
|
||||
) -> Result<Vec<u8>, OssError> {
|
||||
let key = normalize_internal_object_key(&request.object_key)?;
|
||||
let target = build_object_url(&self.config.bucket, &self.config.endpoint, &key)
|
||||
.map_err(|e| request_error(OssRequestOperation::Get, &e.to_string()))?;
|
||||
let mut response = send_signed_request(
|
||||
client,
|
||||
&self.config,
|
||||
Method::GET,
|
||||
Some(&key),
|
||||
target,
|
||||
OssRequestOperation::Get,
|
||||
)
|
||||
.await?;
|
||||
if response.status() == reqwest::StatusCode::NOT_FOUND {
|
||||
return Err(OssError::ObjectNotFound(format!("OSS 对象不存在:{key}")));
|
||||
}
|
||||
if !response.status().is_success() {
|
||||
return Err(request_status_error(
|
||||
OssRequestOperation::Get,
|
||||
response.status().as_u16(),
|
||||
format!("OSS GET Object 失败,状态码:{}", response.status()),
|
||||
));
|
||||
}
|
||||
if response
|
||||
.content_length()
|
||||
.is_some_and(|length| length > request.max_bytes as u64)
|
||||
{
|
||||
return Err(OssError::InvalidRequest("OSS 对象超过读取上限".to_string()));
|
||||
}
|
||||
let mut bytes = Vec::new();
|
||||
while let Some(chunk) = response
|
||||
.chunk()
|
||||
.await
|
||||
.map_err(|e| request_error_from_reqwest(OssRequestOperation::Get, e))?
|
||||
{
|
||||
if bytes.len().saturating_add(chunk.len()) > request.max_bytes {
|
||||
return Err(OssError::InvalidRequest("OSS 对象超过读取上限".to_string()));
|
||||
}
|
||||
bytes.extend_from_slice(&chunk);
|
||||
}
|
||||
Ok(bytes)
|
||||
}
|
||||
|
||||
pub async fn delete_object(
|
||||
&self,
|
||||
client: &reqwest::Client,
|
||||
request: OssDeleteObjectRequest,
|
||||
) -> Result<(), OssError> {
|
||||
let key = normalize_internal_object_key(&request.object_key)?;
|
||||
let target = build_object_url(&self.config.bucket, &self.config.endpoint, &key)
|
||||
.map_err(|e| request_error(OssRequestOperation::Delete, &e.to_string()))?;
|
||||
let response = send_signed_request(
|
||||
client,
|
||||
&self.config,
|
||||
Method::DELETE,
|
||||
Some(&key),
|
||||
target,
|
||||
OssRequestOperation::Delete,
|
||||
)
|
||||
.await?;
|
||||
if response.status() == reqwest::StatusCode::NOT_FOUND || response.status().is_success() {
|
||||
return Ok(());
|
||||
}
|
||||
Err(request_status_error(
|
||||
OssRequestOperation::Delete,
|
||||
response.status().as_u16(),
|
||||
format!("OSS DELETE Object 失败,状态码:{}", response.status()),
|
||||
))
|
||||
}
|
||||
|
||||
// AI 生成资源默认由服务端上传 OSS,Web 端只拿签名读地址,不直接持有写权限。
|
||||
pub async fn put_object(
|
||||
&self,
|
||||
@@ -1648,7 +1740,7 @@ fn normalize_object_key(raw: &str) -> Result<String, OssError> {
|
||||
match LegacyAssetPrefix::from_object_key(&normalized) {
|
||||
Some(LegacyAssetPrefix::EditorAgent) | None => {
|
||||
return Err(OssError::InvalidRequest(
|
||||
"objectKey 必须落在受支持的 generated-* 前缀下".to_string(),
|
||||
"objectKey 必须落在受支持的 OSS 前缀下".to_string(),
|
||||
));
|
||||
}
|
||||
Some(_) => {}
|
||||
@@ -1686,6 +1778,18 @@ fn normalize_editor_agent_messages_object_key(raw: &str) -> Result<String, OssEr
|
||||
Ok(normalized)
|
||||
}
|
||||
|
||||
fn normalize_internal_object_key(raw: &str) -> Result<String, OssError> {
|
||||
let normalized = raw.trim().trim_start_matches('/').trim().to_string();
|
||||
validate_object_key_segments(&normalized)?;
|
||||
if normalized.starts_with("agc/error-reports/v1/") {
|
||||
Ok(normalized)
|
||||
} else {
|
||||
Err(OssError::InvalidRequest(
|
||||
"objectKey 不属于内部对象前缀".to_string(),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
fn validate_object_key_segments(normalized: &str) -> Result<(), OssError> {
|
||||
let segments = normalized.split('/').collect::<Vec<_>>();
|
||||
if segments.len() < 2 {
|
||||
@@ -3072,7 +3176,7 @@ mod tests {
|
||||
|
||||
assert_eq!(
|
||||
error,
|
||||
OssError::InvalidRequest("objectKey 必须落在受支持的 generated-* 前缀下".to_string())
|
||||
OssError::InvalidRequest("objectKey 必须落在受支持的 OSS 前缀下".to_string())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ use crate::creation_entry_config::{
|
||||
};
|
||||
|
||||
/// 后台 member 可被授予的一级 Tab 权限;账号管理仅 owner 可见,不进入该集合。
|
||||
pub const ADMIN_TAB_PERMISSIONS: [&str; 15] = [
|
||||
pub const ADMIN_TAB_PERMISSIONS: [&str; 16] = [
|
||||
"dashboard",
|
||||
"overview",
|
||||
"tables",
|
||||
@@ -26,6 +26,7 @@ pub const ADMIN_TAB_PERMISSIONS: [&str; 15] = [
|
||||
"editor-generation-pricing",
|
||||
"editor-showcase",
|
||||
"editor-assets",
|
||||
"error-reports",
|
||||
];
|
||||
|
||||
/// 不随一级 Tab 自动授予的后台高风险操作权限。
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Event {
|
||||
pub event_id: String,
|
||||
pub fingerprint: String,
|
||||
pub source: String,
|
||||
pub message: String,
|
||||
pub stack: Option<String>,
|
||||
pub occurred_at: String,
|
||||
pub count: u32,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ErrorReportLogInput {
|
||||
pub name: String,
|
||||
pub content: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct CreateErrorReportBatchRequest {
|
||||
pub schema_version: u32,
|
||||
pub submission_id: String,
|
||||
pub events: Vec<Event>,
|
||||
pub user_description: Option<String>,
|
||||
pub logs: Vec<ErrorReportLogInput>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct CreateErrorReportBatchResponse {
|
||||
pub batch_id: String,
|
||||
pub submission_id: String,
|
||||
pub status: String,
|
||||
pub accepted_event_ids: Vec<String>,
|
||||
pub created_at: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct AdminErrorReportListQuery {
|
||||
pub status: Option<String>,
|
||||
pub fingerprint: Option<String>,
|
||||
pub source: Option<String>,
|
||||
pub limit: Option<u32>,
|
||||
pub offset: Option<u32>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct AdminErrorReportEntry {
|
||||
pub batch_id: String,
|
||||
pub event_count: u32,
|
||||
pub log_count: u32,
|
||||
pub fingerprint: Option<String>,
|
||||
pub source: Option<String>,
|
||||
pub status: String,
|
||||
pub user_id: String,
|
||||
pub created_at: String,
|
||||
pub updated_at: String,
|
||||
pub user_description: Option<String>,
|
||||
pub attachment_size_bytes: u64,
|
||||
pub submission_id: Option<String>,
|
||||
pub oss_object_key: Option<String>,
|
||||
pub archive_sha256: Option<String>,
|
||||
pub upload_status: Option<String>,
|
||||
pub review_status: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct AdminErrorReportListResponse {
|
||||
pub reports: Vec<AdminErrorReportEntry>,
|
||||
pub total: u64,
|
||||
pub offset: u32,
|
||||
pub limit: u32,
|
||||
pub has_more: bool,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct AdminUpdateErrorReportRequest {
|
||||
pub status: String,
|
||||
pub note: Option<String>,
|
||||
}
|
||||
@@ -19,6 +19,7 @@ pub mod creation_entry_config;
|
||||
pub mod creative_agent;
|
||||
pub mod editor_agent;
|
||||
pub mod editor_generation;
|
||||
pub mod error_reports;
|
||||
pub use editor_generation::{
|
||||
EDITOR_GENERATION_ASSET_BINDING_ID_PREFIX, EDITOR_GENERATION_ASSET_ID_PREFIX,
|
||||
EDITOR_GENERATION_ASSET_OBJECT_ID_PREFIX, EDITOR_GENERATION_RESOURCE_ID_PREFIX,
|
||||
|
||||
@@ -15,6 +15,8 @@ pub mod assets;
|
||||
pub mod auth;
|
||||
pub mod editor_agent;
|
||||
pub mod editor_project;
|
||||
#[path = "active/error_reports.rs"]
|
||||
mod error_reports;
|
||||
pub mod external_api_key;
|
||||
#[path = "active/external_generation.rs"]
|
||||
pub mod external_generation;
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
use super::*;
|
||||
|
||||
impl SpacetimeClient {
|
||||
pub async fn create_error_report(
|
||||
&self,
|
||||
input: ErrorReportCreateRecordInput,
|
||||
) -> Result<ErrorReportRecord, SpacetimeClientError> {
|
||||
let input = input.into();
|
||||
self.call_after_connect("create_error_report_and_return", move |c, s| {
|
||||
c.procedures()
|
||||
.create_error_report_and_return_then(input, move |_, r| {
|
||||
send_once(
|
||||
&s,
|
||||
r.map_err(SpacetimeClientError::from_sdk_error)
|
||||
.and_then(map_error_report_result),
|
||||
)
|
||||
})
|
||||
})
|
||||
.await
|
||||
}
|
||||
pub async fn get_error_report(
|
||||
&self,
|
||||
batch_id: String,
|
||||
) -> Result<ErrorReportRecord, SpacetimeClientError> {
|
||||
let input = ErrorReportGetInput { batch_id };
|
||||
self.call_after_connect("get_error_report_and_return", move |c, s| {
|
||||
c.procedures()
|
||||
.get_error_report_and_return_then(input, move |_, r| {
|
||||
send_once(
|
||||
&s,
|
||||
r.map_err(SpacetimeClientError::from_sdk_error)
|
||||
.and_then(map_error_report_result),
|
||||
)
|
||||
})
|
||||
})
|
||||
.await
|
||||
}
|
||||
pub async fn list_error_reports(
|
||||
&self,
|
||||
input: ErrorReportListRecordInput,
|
||||
) -> Result<(Vec<ErrorReportRecord>, u64), SpacetimeClientError> {
|
||||
let input = input.into();
|
||||
self.call_after_connect("list_error_reports_and_return", move |c, s| {
|
||||
c.procedures()
|
||||
.list_error_reports_and_return_then(input, move |_, r| {
|
||||
send_once(
|
||||
&s,
|
||||
r.map_err(SpacetimeClientError::from_sdk_error)
|
||||
.and_then(map_error_report_list_result),
|
||||
)
|
||||
})
|
||||
})
|
||||
.await
|
||||
}
|
||||
pub async fn update_error_report(
|
||||
&self,
|
||||
input: ErrorReportUpdateRecordInput,
|
||||
) -> Result<ErrorReportRecord, SpacetimeClientError> {
|
||||
let input = input.into();
|
||||
self.call_after_connect("update_error_report_and_return", move |c, s| {
|
||||
c.procedures()
|
||||
.update_error_report_and_return_then(input, move |_, r| {
|
||||
send_once(
|
||||
&s,
|
||||
r.map_err(SpacetimeClientError::from_sdk_error)
|
||||
.and_then(map_error_report_result),
|
||||
)
|
||||
})
|
||||
})
|
||||
.await
|
||||
}
|
||||
pub async fn delete_error_report(
|
||||
&self,
|
||||
batch_id: String,
|
||||
) -> Result<ErrorReportRecord, SpacetimeClientError> {
|
||||
let input = ErrorReportDeleteInput { batch_id };
|
||||
self.call_after_connect("delete_error_report_and_return", move |c, s| {
|
||||
c.procedures()
|
||||
.delete_error_report_and_return_then(input, move |_, r| {
|
||||
send_once(
|
||||
&s,
|
||||
r.map_err(SpacetimeClientError::from_sdk_error)
|
||||
.and_then(map_error_report_result),
|
||||
)
|
||||
})
|
||||
})
|
||||
.await
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,8 @@ mod auth;
|
||||
mod editor_agent;
|
||||
#[path = "mapper/editor_project.rs"]
|
||||
mod editor_project;
|
||||
#[path = "mapper/error_reports.rs"]
|
||||
mod error_reports;
|
||||
#[path = "mapper/external_api_key.rs"]
|
||||
mod external_api_key;
|
||||
#[path = "mapper/external_generation.rs"]
|
||||
@@ -67,6 +69,10 @@ pub use self::editor_project::{
|
||||
EditorShowcaseAssetViewerRecord, EditorShowcaseCampaignConfigGetRecordInput,
|
||||
EditorShowcaseCampaignConfigRecord, EditorShowcaseCampaignConfigUpsertRecordInput,
|
||||
};
|
||||
pub use self::error_reports::{
|
||||
ErrorReportCreateRecordInput, ErrorReportListRecordInput, ErrorReportRecord,
|
||||
ErrorReportUpdateRecordInput,
|
||||
};
|
||||
pub use self::external_api_key::{
|
||||
ExternalApiKeyAuthenticateRecordInput, ExternalApiKeyCreateRecordInput, ExternalApiKeyRecord,
|
||||
ExternalApiKeyRevokeRecordInput,
|
||||
@@ -118,6 +124,7 @@ pub(crate) use self::editor_project::{
|
||||
map_editor_showcase_campaign_config_procedure_result,
|
||||
map_optional_editor_asset_procedure_result,
|
||||
};
|
||||
pub(crate) use self::error_reports::{map_error_report_list_result, map_error_report_result};
|
||||
pub(crate) use self::external_api_key::{
|
||||
map_external_api_key_list_procedure_result, map_external_api_key_single_procedure_result,
|
||||
};
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
use super::*;
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub struct ErrorReportRecord {
|
||||
pub batch_id: String,
|
||||
pub user_id: String,
|
||||
pub submission_id: String,
|
||||
pub idempotency_key: String,
|
||||
pub object_key: String,
|
||||
pub archive_sha256: String,
|
||||
pub archive_size_bytes: u64,
|
||||
pub event_count: u32,
|
||||
pub log_count: u32,
|
||||
pub first_fingerprint: Option<String>,
|
||||
pub first_source: Option<String>,
|
||||
pub review_status: String,
|
||||
pub admin_note: Option<String>,
|
||||
pub created_at: String,
|
||||
pub updated_at: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub struct ErrorReportCreateRecordInput {
|
||||
pub batch_id: String,
|
||||
pub submission_id: String,
|
||||
pub idempotency_key: String,
|
||||
pub user_id: String,
|
||||
pub object_key: String,
|
||||
pub archive_sha256: String,
|
||||
pub archive_size_bytes: u64,
|
||||
pub event_count: u32,
|
||||
pub log_count: u32,
|
||||
pub first_fingerprint: Option<String>,
|
||||
pub first_source: Option<String>,
|
||||
}
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub struct ErrorReportListRecordInput {
|
||||
pub status: Option<String>,
|
||||
pub fingerprint: Option<String>,
|
||||
pub source: Option<String>,
|
||||
pub limit: u32,
|
||||
pub offset: u32,
|
||||
}
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub struct ErrorReportUpdateRecordInput {
|
||||
pub batch_id: String,
|
||||
pub status: String,
|
||||
pub note: Option<String>,
|
||||
}
|
||||
|
||||
fn map(s: ErrorReportSnapshot) -> ErrorReportRecord {
|
||||
ErrorReportRecord {
|
||||
batch_id: s.batch_id,
|
||||
user_id: s.user_id,
|
||||
submission_id: s.submission_id,
|
||||
idempotency_key: s.idempotency_key,
|
||||
object_key: s.object_key,
|
||||
archive_sha256: s.archive_sha_256,
|
||||
archive_size_bytes: s.archive_size_bytes,
|
||||
event_count: s.event_count,
|
||||
log_count: s.log_count,
|
||||
first_fingerprint: s.first_fingerprint,
|
||||
first_source: s.first_source,
|
||||
review_status: s.review_status,
|
||||
admin_note: s.admin_note,
|
||||
created_at: format_timestamp_micros(s.created_at_micros),
|
||||
updated_at: format_timestamp_micros(s.updated_at_micros),
|
||||
}
|
||||
}
|
||||
pub(crate) fn map_error_report_result(
|
||||
r: ErrorReportProcedureResult,
|
||||
) -> Result<ErrorReportRecord, SpacetimeClientError> {
|
||||
if !r.ok {
|
||||
return Err(SpacetimeClientError::procedure_failed(r.error_message));
|
||||
}
|
||||
r.report
|
||||
.map(map)
|
||||
.ok_or_else(|| SpacetimeClientError::missing_snapshot("错误报告快照"))
|
||||
}
|
||||
pub(crate) fn map_error_report_list_result(
|
||||
r: ErrorReportProcedureResult,
|
||||
) -> Result<(Vec<ErrorReportRecord>, u64), SpacetimeClientError> {
|
||||
if !r.ok {
|
||||
return Err(SpacetimeClientError::procedure_failed(r.error_message));
|
||||
}
|
||||
Ok((r.reports.into_iter().map(map).collect(), r.total))
|
||||
}
|
||||
impl From<ErrorReportCreateRecordInput> for ErrorReportCreateInput {
|
||||
fn from(i: ErrorReportCreateRecordInput) -> Self {
|
||||
Self {
|
||||
batch_id: i.batch_id,
|
||||
submission_id: i.submission_id,
|
||||
idempotency_key: i.idempotency_key,
|
||||
user_id: i.user_id,
|
||||
object_key: i.object_key,
|
||||
archive_sha_256: i.archive_sha256,
|
||||
archive_size_bytes: i.archive_size_bytes,
|
||||
event_count: i.event_count,
|
||||
log_count: i.log_count,
|
||||
first_fingerprint: i.first_fingerprint,
|
||||
first_source: i.first_source,
|
||||
}
|
||||
}
|
||||
}
|
||||
impl From<ErrorReportListRecordInput> for ErrorReportListInput {
|
||||
fn from(i: ErrorReportListRecordInput) -> Self {
|
||||
Self {
|
||||
status: i.status,
|
||||
fingerprint: i.fingerprint,
|
||||
source: i.source,
|
||||
limit: i.limit,
|
||||
offset: i.offset,
|
||||
}
|
||||
}
|
||||
}
|
||||
impl From<ErrorReportUpdateRecordInput> for ErrorReportUpdateInput {
|
||||
fn from(i: ErrorReportUpdateRecordInput) -> Self {
|
||||
Self {
|
||||
batch_id: i.batch_id,
|
||||
status: i.status,
|
||||
note: i.note,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -197,6 +197,7 @@ pub mod create_editor_asset_and_return_procedure;
|
||||
pub mod create_editor_asset_folder_and_return_procedure;
|
||||
pub mod create_editor_project_and_return_procedure;
|
||||
pub mod create_editor_project_resource_and_return_procedure;
|
||||
pub mod create_error_report_and_return_procedure;
|
||||
pub mod create_external_api_key_and_return_procedure;
|
||||
pub mod create_profile_recharge_order_and_return_procedure;
|
||||
pub mod creation_entry_config_table;
|
||||
@@ -241,6 +242,7 @@ pub mod delete_editor_agent_conversation_and_return_procedure;
|
||||
pub mod delete_editor_asset_and_return_procedure;
|
||||
pub mod delete_editor_asset_folder_and_return_procedure;
|
||||
pub mod delete_editor_project_and_return_procedure;
|
||||
pub mod delete_error_report_and_return_procedure;
|
||||
pub mod editor_agent_conversation_create_input_type;
|
||||
pub mod editor_agent_conversation_delete_input_type;
|
||||
pub mod editor_agent_conversation_get_input_type;
|
||||
@@ -385,6 +387,15 @@ pub mod editor_spritesheet_slice_persisted_item_type;
|
||||
pub mod enqueue_external_generation_job_and_return_procedure;
|
||||
pub mod enqueue_profile_wallet_refund_outbox_and_return_procedure;
|
||||
pub mod ensure_analytics_date_dimension_for_date_reducer;
|
||||
pub mod error_report_create_input_type;
|
||||
pub mod error_report_delete_input_type;
|
||||
pub mod error_report_get_input_type;
|
||||
pub mod error_report_list_input_type;
|
||||
pub mod error_report_procedure_result_type;
|
||||
pub mod error_report_snapshot_type;
|
||||
pub mod error_report_table;
|
||||
pub mod error_report_type;
|
||||
pub mod error_report_update_input_type;
|
||||
pub mod expire_profile_recharge_order_timer_reducer;
|
||||
pub mod export_auth_store_projection_from_tables_procedure;
|
||||
pub mod export_database_migration_to_file_procedure;
|
||||
@@ -446,6 +457,7 @@ pub mod get_editor_asset_library_and_return_procedure;
|
||||
pub mod get_editor_generation_pricing_config_and_return_procedure;
|
||||
pub mod get_editor_project_and_return_procedure;
|
||||
pub mod get_editor_showcase_campaign_config_and_return_procedure;
|
||||
pub mod get_error_report_and_return_procedure;
|
||||
pub mod get_external_generation_job_and_return_procedure;
|
||||
pub mod get_external_generation_job_result_and_return_procedure;
|
||||
pub mod get_external_generation_job_summary_and_return_procedure;
|
||||
@@ -486,6 +498,7 @@ pub mod list_admin_accounts_and_return_procedure;
|
||||
pub mod list_asset_history_and_return_procedure;
|
||||
pub mod list_editor_agent_conversations_and_return_procedure;
|
||||
pub mod list_editor_projects_and_return_procedure;
|
||||
pub mod list_error_reports_and_return_procedure;
|
||||
pub mod list_external_api_keys_and_return_procedure;
|
||||
pub mod list_external_generation_job_summaries_and_return_procedure;
|
||||
pub mod list_external_generation_jobs_and_return_procedure;
|
||||
@@ -849,6 +862,7 @@ pub mod update_editor_asset_and_return_procedure;
|
||||
pub mod update_editor_asset_folder_and_return_procedure;
|
||||
pub mod update_editor_project_resource_showcase_and_return_procedure;
|
||||
pub mod update_editor_showcase_asset_display_and_return_procedure;
|
||||
pub mod update_error_report_and_return_procedure;
|
||||
pub mod update_external_generation_job_phase_and_return_procedure;
|
||||
pub mod upsert_editor_generation_pricing_config_and_return_procedure;
|
||||
pub mod upsert_editor_showcase_campaign_config_and_return_procedure;
|
||||
@@ -1071,6 +1085,7 @@ pub use create_editor_asset_and_return_procedure::create_editor_asset_and_return
|
||||
pub use create_editor_asset_folder_and_return_procedure::create_editor_asset_folder_and_return;
|
||||
pub use create_editor_project_and_return_procedure::create_editor_project_and_return;
|
||||
pub use create_editor_project_resource_and_return_procedure::create_editor_project_resource_and_return;
|
||||
pub use create_error_report_and_return_procedure::create_error_report_and_return;
|
||||
pub use create_external_api_key_and_return_procedure::create_external_api_key_and_return;
|
||||
pub use create_profile_recharge_order_and_return_procedure::create_profile_recharge_order_and_return;
|
||||
pub use creation_entry_config_table::*;
|
||||
@@ -1115,6 +1130,7 @@ pub use delete_editor_agent_conversation_and_return_procedure::delete_editor_age
|
||||
pub use delete_editor_asset_and_return_procedure::delete_editor_asset_and_return;
|
||||
pub use delete_editor_asset_folder_and_return_procedure::delete_editor_asset_folder_and_return;
|
||||
pub use delete_editor_project_and_return_procedure::delete_editor_project_and_return;
|
||||
pub use delete_error_report_and_return_procedure::delete_error_report_and_return;
|
||||
pub use editor_agent_conversation_create_input_type::EditorAgentConversationCreateInput;
|
||||
pub use editor_agent_conversation_delete_input_type::EditorAgentConversationDeleteInput;
|
||||
pub use editor_agent_conversation_get_input_type::EditorAgentConversationGetInput;
|
||||
@@ -1259,6 +1275,15 @@ pub use editor_spritesheet_slice_persisted_item_type::EditorSpritesheetSlicePers
|
||||
pub use enqueue_external_generation_job_and_return_procedure::enqueue_external_generation_job_and_return;
|
||||
pub use enqueue_profile_wallet_refund_outbox_and_return_procedure::enqueue_profile_wallet_refund_outbox_and_return;
|
||||
pub use ensure_analytics_date_dimension_for_date_reducer::ensure_analytics_date_dimension_for_date;
|
||||
pub use error_report_create_input_type::ErrorReportCreateInput;
|
||||
pub use error_report_delete_input_type::ErrorReportDeleteInput;
|
||||
pub use error_report_get_input_type::ErrorReportGetInput;
|
||||
pub use error_report_list_input_type::ErrorReportListInput;
|
||||
pub use error_report_procedure_result_type::ErrorReportProcedureResult;
|
||||
pub use error_report_snapshot_type::ErrorReportSnapshot;
|
||||
pub use error_report_table::*;
|
||||
pub use error_report_type::ErrorReport;
|
||||
pub use error_report_update_input_type::ErrorReportUpdateInput;
|
||||
pub use expire_profile_recharge_order_timer_reducer::expire_profile_recharge_order_timer;
|
||||
pub use export_auth_store_projection_from_tables_procedure::export_auth_store_projection_from_tables;
|
||||
pub use export_database_migration_to_file_procedure::export_database_migration_to_file;
|
||||
@@ -1320,6 +1345,7 @@ pub use get_editor_asset_library_and_return_procedure::get_editor_asset_library_
|
||||
pub use get_editor_generation_pricing_config_and_return_procedure::get_editor_generation_pricing_config_and_return;
|
||||
pub use get_editor_project_and_return_procedure::get_editor_project_and_return;
|
||||
pub use get_editor_showcase_campaign_config_and_return_procedure::get_editor_showcase_campaign_config_and_return;
|
||||
pub use get_error_report_and_return_procedure::get_error_report_and_return;
|
||||
pub use get_external_generation_job_and_return_procedure::get_external_generation_job_and_return;
|
||||
pub use get_external_generation_job_result_and_return_procedure::get_external_generation_job_result_and_return;
|
||||
pub use get_external_generation_job_summary_and_return_procedure::get_external_generation_job_summary_and_return;
|
||||
@@ -1360,6 +1386,7 @@ pub use list_admin_accounts_and_return_procedure::list_admin_accounts_and_return
|
||||
pub use list_asset_history_and_return_procedure::list_asset_history_and_return;
|
||||
pub use list_editor_agent_conversations_and_return_procedure::list_editor_agent_conversations_and_return;
|
||||
pub use list_editor_projects_and_return_procedure::list_editor_projects_and_return;
|
||||
pub use list_error_reports_and_return_procedure::list_error_reports_and_return;
|
||||
pub use list_external_api_keys_and_return_procedure::list_external_api_keys_and_return;
|
||||
pub use list_external_generation_job_summaries_and_return_procedure::list_external_generation_job_summaries_and_return;
|
||||
pub use list_external_generation_jobs_and_return_procedure::list_external_generation_jobs_and_return;
|
||||
@@ -1723,6 +1750,7 @@ pub use update_editor_asset_and_return_procedure::update_editor_asset_and_return
|
||||
pub use update_editor_asset_folder_and_return_procedure::update_editor_asset_folder_and_return;
|
||||
pub use update_editor_project_resource_showcase_and_return_procedure::update_editor_project_resource_showcase_and_return;
|
||||
pub use update_editor_showcase_asset_display_and_return_procedure::update_editor_showcase_asset_display_and_return;
|
||||
pub use update_error_report_and_return_procedure::update_error_report_and_return;
|
||||
pub use update_external_generation_job_phase_and_return_procedure::update_external_generation_job_phase_and_return;
|
||||
pub use upsert_editor_generation_pricing_config_and_return_procedure::upsert_editor_generation_pricing_config_and_return;
|
||||
pub use upsert_editor_showcase_campaign_config_and_return_procedure::upsert_editor_showcase_campaign_config_and_return;
|
||||
@@ -1919,6 +1947,7 @@ pub struct DbUpdate {
|
||||
editor_showcase_asset: __sdk::TableUpdate<EditorShowcaseAsset>,
|
||||
editor_showcase_asset_like: __sdk::TableUpdate<EditorShowcaseAssetLike>,
|
||||
editor_showcase_campaign_config: __sdk::TableUpdate<EditorShowcaseCampaignConfig>,
|
||||
error_report: __sdk::TableUpdate<ErrorReport>,
|
||||
external_api_key: __sdk::TableUpdate<ExternalApiKey>,
|
||||
external_generation_job: __sdk::TableUpdate<ExternalGenerationJob>,
|
||||
external_generation_job_event: __sdk::TableUpdate<ExternalGenerationJobEvent>,
|
||||
@@ -2211,6 +2240,9 @@ impl TryFrom<__ws::v2::TransactionUpdate> for DbUpdate {
|
||||
editor_showcase_campaign_config_table::parse_table_update(table_update)?,
|
||||
)
|
||||
}
|
||||
"error_report" => db_update
|
||||
.error_report
|
||||
.append(error_report_table::parse_table_update(table_update)?),
|
||||
"external_api_key" => db_update
|
||||
.external_api_key
|
||||
.append(external_api_key_table::parse_table_update(table_update)?),
|
||||
@@ -2812,6 +2844,9 @@ impl __sdk::DbUpdate for DbUpdate {
|
||||
&self.editor_showcase_campaign_config,
|
||||
)
|
||||
.with_updates_by_pk(|row| &row.config_id);
|
||||
diff.error_report = cache
|
||||
.apply_diff_to_table::<ErrorReport>("error_report", &self.error_report)
|
||||
.with_updates_by_pk(|row| &row.batch_id);
|
||||
diff.external_api_key = cache
|
||||
.apply_diff_to_table::<ExternalApiKey>("external_api_key", &self.external_api_key)
|
||||
.with_updates_by_pk(|row| &row.key_id);
|
||||
@@ -3433,6 +3468,9 @@ impl __sdk::DbUpdate for DbUpdate {
|
||||
"editor_showcase_campaign_config" => db_update
|
||||
.editor_showcase_campaign_config
|
||||
.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"error_report" => db_update
|
||||
.error_report
|
||||
.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"external_api_key" => db_update
|
||||
.external_api_key
|
||||
.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
@@ -3866,6 +3904,9 @@ impl __sdk::DbUpdate for DbUpdate {
|
||||
"editor_showcase_campaign_config" => db_update
|
||||
.editor_showcase_campaign_config
|
||||
.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"error_report" => db_update
|
||||
.error_report
|
||||
.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"external_api_key" => db_update
|
||||
.external_api_key
|
||||
.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
@@ -4193,6 +4234,7 @@ pub struct AppliedDiff<'r> {
|
||||
editor_showcase_asset: __sdk::TableAppliedDiff<'r, EditorShowcaseAsset>,
|
||||
editor_showcase_asset_like: __sdk::TableAppliedDiff<'r, EditorShowcaseAssetLike>,
|
||||
editor_showcase_campaign_config: __sdk::TableAppliedDiff<'r, EditorShowcaseCampaignConfig>,
|
||||
error_report: __sdk::TableAppliedDiff<'r, ErrorReport>,
|
||||
external_api_key: __sdk::TableAppliedDiff<'r, ExternalApiKey>,
|
||||
external_generation_job: __sdk::TableAppliedDiff<'r, ExternalGenerationJob>,
|
||||
external_generation_job_event: __sdk::TableAppliedDiff<'r, ExternalGenerationJobEvent>,
|
||||
@@ -4568,6 +4610,11 @@ impl<'r> __sdk::AppliedDiff<'r> for AppliedDiff<'r> {
|
||||
&self.editor_showcase_campaign_config,
|
||||
event,
|
||||
);
|
||||
callbacks.invoke_table_row_callbacks::<ErrorReport>(
|
||||
"error_report",
|
||||
&self.error_report,
|
||||
event,
|
||||
);
|
||||
callbacks.invoke_table_row_callbacks::<ExternalApiKey>(
|
||||
"external_api_key",
|
||||
&self.external_api_key,
|
||||
@@ -5231,19 +5278,19 @@ impl __sdk::SubscriptionHandle for SubscriptionHandle {
|
||||
/// either a [`DbConnection`] or an [`EventContext`] and operate on either.
|
||||
pub trait RemoteDbContext:
|
||||
__sdk::DbContext<
|
||||
DbView = RemoteTables,
|
||||
Reducers = RemoteReducers,
|
||||
SubscriptionBuilder = __sdk::SubscriptionBuilder<RemoteModule>,
|
||||
>
|
||||
DbView = RemoteTables,
|
||||
Reducers = RemoteReducers,
|
||||
SubscriptionBuilder = __sdk::SubscriptionBuilder<RemoteModule>,
|
||||
>
|
||||
{
|
||||
}
|
||||
impl<
|
||||
Ctx: __sdk::DbContext<
|
||||
Ctx: __sdk::DbContext<
|
||||
DbView = RemoteTables,
|
||||
Reducers = RemoteReducers,
|
||||
SubscriptionBuilder = __sdk::SubscriptionBuilder<RemoteModule>,
|
||||
>,
|
||||
> RemoteDbContext for Ctx
|
||||
> RemoteDbContext for Ctx
|
||||
{
|
||||
}
|
||||
|
||||
@@ -5692,6 +5739,7 @@ impl __sdk::SpacetimeModule for RemoteModule {
|
||||
editor_showcase_asset_table::register_table(client_cache);
|
||||
editor_showcase_asset_like_table::register_table(client_cache);
|
||||
editor_showcase_campaign_config_table::register_table(client_cache);
|
||||
error_report_table::register_table(client_cache);
|
||||
external_api_key_table::register_table(client_cache);
|
||||
external_generation_job_table::register_table(client_cache);
|
||||
external_generation_job_event_table::register_table(client_cache);
|
||||
@@ -5834,6 +5882,7 @@ impl __sdk::SpacetimeModule for RemoteModule {
|
||||
"editor_showcase_asset",
|
||||
"editor_showcase_asset_like",
|
||||
"editor_showcase_campaign_config",
|
||||
"error_report",
|
||||
"external_api_key",
|
||||
"external_generation_job",
|
||||
"external_generation_job_event",
|
||||
|
||||
+59
@@ -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::error_report_create_input_type::ErrorReportCreateInput;
|
||||
use super::error_report_procedure_result_type::ErrorReportProcedureResult;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
struct CreateErrorReportAndReturnArgs {
|
||||
pub input: ErrorReportCreateInput,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for CreateErrorReportAndReturnArgs {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the procedure `create_error_report_and_return`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteProcedures`].
|
||||
pub trait create_error_report_and_return {
|
||||
fn create_error_report_and_return(&self, input: ErrorReportCreateInput) {
|
||||
self.create_error_report_and_return_then(input, |_, _| {});
|
||||
}
|
||||
|
||||
fn create_error_report_and_return_then(
|
||||
&self,
|
||||
input: ErrorReportCreateInput,
|
||||
|
||||
__callback: impl FnOnce(
|
||||
&super::ProcedureEventContext,
|
||||
Result<ErrorReportProcedureResult, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
);
|
||||
}
|
||||
|
||||
impl create_error_report_and_return for super::RemoteProcedures {
|
||||
fn create_error_report_and_return_then(
|
||||
&self,
|
||||
input: ErrorReportCreateInput,
|
||||
|
||||
__callback: impl FnOnce(
|
||||
&super::ProcedureEventContext,
|
||||
Result<ErrorReportProcedureResult, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
) {
|
||||
self.imp
|
||||
.invoke_procedure_with_callback::<_, ErrorReportProcedureResult>(
|
||||
"create_error_report_and_return",
|
||||
CreateErrorReportAndReturnArgs { input },
|
||||
__callback,
|
||||
);
|
||||
}
|
||||
}
|
||||
+59
@@ -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::error_report_delete_input_type::ErrorReportDeleteInput;
|
||||
use super::error_report_procedure_result_type::ErrorReportProcedureResult;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
struct DeleteErrorReportAndReturnArgs {
|
||||
pub input: ErrorReportDeleteInput,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for DeleteErrorReportAndReturnArgs {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the procedure `delete_error_report_and_return`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteProcedures`].
|
||||
pub trait delete_error_report_and_return {
|
||||
fn delete_error_report_and_return(&self, input: ErrorReportDeleteInput) {
|
||||
self.delete_error_report_and_return_then(input, |_, _| {});
|
||||
}
|
||||
|
||||
fn delete_error_report_and_return_then(
|
||||
&self,
|
||||
input: ErrorReportDeleteInput,
|
||||
|
||||
__callback: impl FnOnce(
|
||||
&super::ProcedureEventContext,
|
||||
Result<ErrorReportProcedureResult, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
);
|
||||
}
|
||||
|
||||
impl delete_error_report_and_return for super::RemoteProcedures {
|
||||
fn delete_error_report_and_return_then(
|
||||
&self,
|
||||
input: ErrorReportDeleteInput,
|
||||
|
||||
__callback: impl FnOnce(
|
||||
&super::ProcedureEventContext,
|
||||
Result<ErrorReportProcedureResult, __sdk::InternalError>,
|
||||
) + Send
|
||||
+ 'static,
|
||||
) {
|
||||
self.imp
|
||||
.invoke_procedure_with_callback::<_, ErrorReportProcedureResult>(
|
||||
"delete_error_report_and_return",
|
||||
DeleteErrorReportAndReturnArgs { input },
|
||||
__callback,
|
||||
);
|
||||
}
|
||||
}
|
||||
+25
@@ -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 ErrorReportCreateInput {
|
||||
pub batch_id: String,
|
||||
pub submission_id: String,
|
||||
pub idempotency_key: String,
|
||||
pub user_id: String,
|
||||
pub object_key: String,
|
||||
pub archive_sha_256: String,
|
||||
pub archive_size_bytes: u64,
|
||||
pub event_count: u32,
|
||||
pub log_count: u32,
|
||||
pub first_fingerprint: Option<String>,
|
||||
pub first_source: Option<String>,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for ErrorReportCreateInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct ErrorReportDeleteInput {
|
||||
pub batch_id: String,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for ErrorReportDeleteInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct ErrorReportGetInput {
|
||||
pub batch_id: String,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for ErrorReportGetInput {
|
||||
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};
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct ErrorReportListInput {
|
||||
pub status: Option<String>,
|
||||
pub fingerprint: Option<String>,
|
||||
pub source: Option<String>,
|
||||
pub limit: u32,
|
||||
pub offset: u32,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for ErrorReportListInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
+21
@@ -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::error_report_snapshot_type::ErrorReportSnapshot;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct ErrorReportProcedureResult {
|
||||
pub ok: bool,
|
||||
pub report: Option<ErrorReportSnapshot>,
|
||||
pub reports: Vec<ErrorReportSnapshot>,
|
||||
pub total: u64,
|
||||
pub error_message: Option<String>,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for ErrorReportProcedureResult {
|
||||
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)]
|
||||
pub struct ErrorReportSnapshot {
|
||||
pub batch_id: String,
|
||||
pub user_id: String,
|
||||
pub submission_id: String,
|
||||
pub idempotency_key: String,
|
||||
pub object_key: String,
|
||||
pub archive_sha_256: String,
|
||||
pub archive_size_bytes: u64,
|
||||
pub event_count: u32,
|
||||
pub log_count: u32,
|
||||
pub first_fingerprint: Option<String>,
|
||||
pub first_source: Option<String>,
|
||||
pub review_status: String,
|
||||
pub admin_note: Option<String>,
|
||||
pub created_at_micros: i64,
|
||||
pub updated_at_micros: i64,
|
||||
}
|
||||
|
||||
impl __sdk::InModule for ErrorReportSnapshot {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
@@ -0,0 +1,259 @@
|
||||
// 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::error_report_type::ErrorReport;
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
/// Table handle for the table `error_report`.
|
||||
///
|
||||
/// Obtain a handle from the [`ErrorReportTableAccess::error_report`] method on [`super::RemoteTables`],
|
||||
/// like `ctx.db.error_report()`.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.error_report().on_insert(...)`.
|
||||
pub struct ErrorReportTableHandle<'ctx> {
|
||||
imp: __sdk::TableHandle<ErrorReport>,
|
||||
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
/// Lifetime-aware accessor marker for the table `error_report`.
|
||||
pub struct ErrorReportTableAccessor;
|
||||
|
||||
impl __sdk::TableAccessor<super::RemoteTables> for ErrorReportTableAccessor {
|
||||
type Row = ErrorReport;
|
||||
type Handle<'db> = ErrorReportTableHandle<'db>;
|
||||
|
||||
fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> {
|
||||
db.error_report()
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the table `error_report`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteTables`].
|
||||
pub trait ErrorReportTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Obtain a [`ErrorReportTableHandle`], which mediates access to the table `error_report`.
|
||||
fn error_report(&self) -> ErrorReportTableHandle<'_>;
|
||||
}
|
||||
|
||||
impl ErrorReportTableAccess for super::RemoteTables {
|
||||
fn error_report(&self) -> ErrorReportTableHandle<'_> {
|
||||
ErrorReportTableHandle {
|
||||
imp: self.imp.get_table::<ErrorReport>("error_report"),
|
||||
ctx: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct ErrorReportInsertCallbackId(__sdk::CallbackId);
|
||||
pub struct ErrorReportDeleteCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::TableLike for ErrorReportTableHandle<'ctx> {
|
||||
type Row = ErrorReport;
|
||||
type EventContext = super::EventContext;
|
||||
|
||||
fn count(&self) -> u64 {
|
||||
self.imp.count()
|
||||
}
|
||||
fn iter(&self) -> impl Iterator<Item = ErrorReport> + '_ {
|
||||
self.imp.iter()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> __sdk::Table for ErrorReportTableHandle<'ctx> {
|
||||
type Row = ErrorReport;
|
||||
type EventContext = super::EventContext;
|
||||
|
||||
fn count(&self) -> u64 {
|
||||
self.imp.count()
|
||||
}
|
||||
fn iter(&self) -> impl Iterator<Item = ErrorReport> + '_ {
|
||||
self.imp.iter()
|
||||
}
|
||||
|
||||
type InsertCallbackId = ErrorReportInsertCallbackId;
|
||||
|
||||
fn on_insert(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> ErrorReportInsertCallbackId {
|
||||
ErrorReportInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_insert(&self, callback: ErrorReportInsertCallbackId) {
|
||||
self.imp.remove_on_insert(callback.0)
|
||||
}
|
||||
|
||||
type DeleteCallbackId = ErrorReportDeleteCallbackId;
|
||||
|
||||
fn on_delete(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> ErrorReportDeleteCallbackId {
|
||||
ErrorReportDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_delete(&self, callback: ErrorReportDeleteCallbackId) {
|
||||
self.imp.remove_on_delete(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> __sdk::WithInsert for ErrorReportTableHandle<'ctx> {
|
||||
type InsertCallbackId = ErrorReportInsertCallbackId;
|
||||
|
||||
fn on_insert(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> ErrorReportInsertCallbackId {
|
||||
ErrorReportInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_insert(&self, callback: ErrorReportInsertCallbackId) {
|
||||
self.imp.remove_on_insert(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> __sdk::WithDelete for ErrorReportTableHandle<'ctx> {
|
||||
type DeleteCallbackId = ErrorReportDeleteCallbackId;
|
||||
|
||||
fn on_delete(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> ErrorReportDeleteCallbackId {
|
||||
ErrorReportDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_delete(&self, callback: ErrorReportDeleteCallbackId) {
|
||||
self.imp.remove_on_delete(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct ErrorReportUpdateCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::TableWithPrimaryKey for ErrorReportTableHandle<'ctx> {
|
||||
type UpdateCallbackId = ErrorReportUpdateCallbackId;
|
||||
|
||||
fn on_update(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||
) -> ErrorReportUpdateCallbackId {
|
||||
ErrorReportUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_update(&self, callback: ErrorReportUpdateCallbackId) {
|
||||
self.imp.remove_on_update(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> __sdk::WithUpdate for ErrorReportTableHandle<'ctx> {
|
||||
type UpdateCallbackId = ErrorReportUpdateCallbackId;
|
||||
|
||||
fn on_update(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||
) -> ErrorReportUpdateCallbackId {
|
||||
ErrorReportUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_update(&self, callback: ErrorReportUpdateCallbackId) {
|
||||
self.imp.remove_on_update(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
/// Access to the `batch_id` unique index on the table `error_report`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`ErrorReportBatchIdUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.error_report().batch_id().find(...)`.
|
||||
pub struct ErrorReportBatchIdUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<ErrorReport, String>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
impl<'ctx> ErrorReportTableHandle<'ctx> {
|
||||
/// Get a handle on the `batch_id` unique index on the table `error_report`.
|
||||
pub fn batch_id(&self) -> ErrorReportBatchIdUnique<'ctx> {
|
||||
ErrorReportBatchIdUnique {
|
||||
imp: self.imp.get_unique_constraint::<String>("batch_id"),
|
||||
phantom: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> ErrorReportBatchIdUnique<'ctx> {
|
||||
/// Find the subscribed row whose `batch_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<ErrorReport> {
|
||||
self.imp.find(col_val)
|
||||
}
|
||||
}
|
||||
|
||||
/// Access to the `idempotency_key` unique index on the table `error_report`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`ErrorReportIdempotencyKeyUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.error_report().idempotency_key().find(...)`.
|
||||
pub struct ErrorReportIdempotencyKeyUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<ErrorReport, String>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
impl<'ctx> ErrorReportTableHandle<'ctx> {
|
||||
/// Get a handle on the `idempotency_key` unique index on the table `error_report`.
|
||||
pub fn idempotency_key(&self) -> ErrorReportIdempotencyKeyUnique<'ctx> {
|
||||
ErrorReportIdempotencyKeyUnique {
|
||||
imp: self.imp.get_unique_constraint::<String>("idempotency_key"),
|
||||
phantom: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> ErrorReportIdempotencyKeyUnique<'ctx> {
|
||||
/// Find the subscribed row whose `idempotency_key` 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<ErrorReport> {
|
||||
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::<ErrorReport>("error_report");
|
||||
_table.add_unique_constraint::<String>("batch_id", |row| &row.batch_id);
|
||||
_table.add_unique_constraint::<String>("idempotency_key", |row| &row.idempotency_key);
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub(super) fn parse_table_update(
|
||||
raw_updates: __ws::v2::TableUpdate,
|
||||
) -> __sdk::Result<__sdk::TableUpdate<ErrorReport>> {
|
||||
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||
__sdk::InternalError::failed_parse("TableUpdate<ErrorReport>", "TableUpdate")
|
||||
.with_cause(e)
|
||||
.into()
|
||||
})
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `ErrorReport`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait error_reportQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `ErrorReport`.
|
||||
fn error_report(&self) -> __sdk::__query_builder::Table<ErrorReport>;
|
||||
}
|
||||
|
||||
impl error_reportQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn error_report(&self) -> __sdk::__query_builder::Table<ErrorReport> {
|
||||
__sdk::__query_builder::Table::new("error_report")
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user