This commit is contained in:
449
src/types/api/audit.ts
Normal file
449
src/types/api/audit.ts
Normal file
@@ -0,0 +1,449 @@
|
||||
import type { PaginationParams } from './common'
|
||||
|
||||
export type AuditActorKind =
|
||||
| 'account'
|
||||
| 'personal_customer'
|
||||
| 'openapi'
|
||||
| 'system_task'
|
||||
| 'scheduled_job'
|
||||
| 'external_system'
|
||||
export type AuditResult = 'success' | 'failed' | 'denied' | 'partial' | 'unknown'
|
||||
export type AuditRiskLevel = 'low' | 'normal' | 'high' | 'critical'
|
||||
export type AuditCategory =
|
||||
| 'configuration'
|
||||
| 'reliability'
|
||||
| 'asset'
|
||||
| 'security'
|
||||
| 'identity'
|
||||
| 'business'
|
||||
export type AuditSource =
|
||||
| 'admin_api'
|
||||
| 'personal_api'
|
||||
| 'openapi'
|
||||
| 'worker'
|
||||
| 'scheduler'
|
||||
| 'callback'
|
||||
export type AuditScopeType = 'platform' | 'shop' | 'personal_customer'
|
||||
export type IntegrationProvider =
|
||||
| 'ctcc'
|
||||
| 'cmcc'
|
||||
| 'cucc'
|
||||
| 'wechat_pay'
|
||||
| 'alipay'
|
||||
| 'fuiou'
|
||||
| 'wecom'
|
||||
| 'gateway'
|
||||
export type IntegrationDirection = 'inbound' | 'outbound'
|
||||
export type IntegrationResult =
|
||||
| 'pending'
|
||||
| 'success'
|
||||
| 'failed'
|
||||
| 'unknown'
|
||||
| 'not_found'
|
||||
| 'invalid_payload'
|
||||
| 'conflict'
|
||||
| 'ignored'
|
||||
| 'merged'
|
||||
| 'rate_limited'
|
||||
| 'completed'
|
||||
| 'cancelled'
|
||||
export type IntegrationResultCategory =
|
||||
| 'processing'
|
||||
| 'succeeded'
|
||||
| 'indeterminate'
|
||||
| 'failed'
|
||||
| 'not_sent'
|
||||
export type AuditSubjectResourceType =
|
||||
| 'iot_card'
|
||||
| 'device'
|
||||
| 'asset_allocation_record'
|
||||
| 'exchange_order'
|
||||
| 'shop'
|
||||
| 'enterprise'
|
||||
|
||||
export interface AuditRetentionInfo {
|
||||
online_from: string
|
||||
archived_before: string
|
||||
timezone: string
|
||||
}
|
||||
export interface AuditActorRef {
|
||||
kind: AuditActorKind
|
||||
id: string
|
||||
}
|
||||
export interface AuditInvestigationResourceRef {
|
||||
resource_type: string
|
||||
resource_id?: string | null
|
||||
resource_key?: string | null
|
||||
display_name?: string | null
|
||||
}
|
||||
export interface AuditInvestigationRefs {
|
||||
event_id?: string | null
|
||||
actor_ref?: AuditActorRef | null
|
||||
resource_refs?: AuditInvestigationResourceRef[]
|
||||
request_id?: string | null
|
||||
correlation_id?: string | null
|
||||
integration_refs?: Array<{ integration_id: string }>
|
||||
}
|
||||
export interface AuditResourceView extends AuditInvestigationResourceRef {
|
||||
relation: 'primary' | 'affected' | 'reference'
|
||||
role: string
|
||||
display_name: string
|
||||
subject_summary?: string | null
|
||||
subject_visibility?: 'internal_only' | 'subject_result' | 'subject_detail'
|
||||
identity_snapshot?: Record<string, unknown> | null
|
||||
before_data?: Record<string, unknown> | null
|
||||
after_data?: Record<string, unknown> | null
|
||||
subject_data?: Record<string, unknown> | null
|
||||
sort_order?: number | null
|
||||
created_at?: string | null
|
||||
}
|
||||
export interface AuditEventView {
|
||||
event_id: string
|
||||
parent_event_id?: string | null
|
||||
action_code: string
|
||||
action_name: string
|
||||
category: AuditCategory
|
||||
summary: string
|
||||
result: AuditResult
|
||||
risk_level: AuditRiskLevel
|
||||
source: AuditSource
|
||||
actor_kind: AuditActorKind
|
||||
actor_id: string
|
||||
actor_name: string
|
||||
actor_shop_id?: number | null
|
||||
actor_shop_name?: string | null
|
||||
actor_enterprise_id?: number | null
|
||||
actor_enterprise_name?: string | null
|
||||
scope_type: AuditScopeType
|
||||
scope_id?: string | null
|
||||
scope_name?: string | null
|
||||
request_id?: string | null
|
||||
correlation_id?: string | null
|
||||
request_method?: string | null
|
||||
request_path?: string | null
|
||||
ip_address?: string | null
|
||||
user_agent?: string | null
|
||||
success_count?: number | null
|
||||
fail_count?: number | null
|
||||
batch_total?: number | null
|
||||
error_code?: string | null
|
||||
error_summary?: string | null
|
||||
content_hash?: string | null
|
||||
occurred_at: string
|
||||
created_at: string
|
||||
resources: AuditResourceView[]
|
||||
investigation_refs?: AuditInvestigationRefs | null
|
||||
metadata?: Record<string, unknown> | null
|
||||
}
|
||||
export interface AuditEventDetail extends AuditEventView {
|
||||
retention: AuditRetentionInfo
|
||||
}
|
||||
export interface AuditPage<T> {
|
||||
items: T[]
|
||||
page: number
|
||||
page_size: number
|
||||
total: number
|
||||
retention: AuditRetentionInfo
|
||||
}
|
||||
export type AuditEventPage = AuditPage<AuditEventView>
|
||||
export interface AuditEventQuery extends PaginationParams {
|
||||
created_from?: string
|
||||
created_to?: string
|
||||
action?: string
|
||||
category?: AuditCategory
|
||||
actor_kind?: AuditActorKind
|
||||
actor_id?: string
|
||||
source?: AuditSource
|
||||
result?: AuditResult
|
||||
risk?: AuditRiskLevel
|
||||
scope_type?: AuditScopeType
|
||||
scope_id?: string
|
||||
resource_type?: string
|
||||
resource_id?: string
|
||||
resource_key?: string
|
||||
request_id?: string
|
||||
correlation_id?: string
|
||||
}
|
||||
export interface AuditActorEventQuery extends PaginationParams {
|
||||
action?: string
|
||||
result?: AuditResult
|
||||
risk?: AuditRiskLevel
|
||||
resource_type?: string
|
||||
resource_id?: string
|
||||
created_from?: string
|
||||
created_to?: string
|
||||
}
|
||||
export interface AuditResourceTimelineQuery extends PaginationParams {
|
||||
created_from?: string
|
||||
created_to?: string
|
||||
action?: string
|
||||
result?: AuditResult
|
||||
}
|
||||
export type AuditSearchResourceType = 'iot_card' | 'device' | 'shop' | 'order' | 'refund'
|
||||
export interface AuditResourceSearchQuery extends PaginationParams {
|
||||
resource_type: AuditSearchResourceType
|
||||
keyword: string
|
||||
}
|
||||
export interface AuditResourceCandidate extends AuditInvestigationResourceRef {
|
||||
resource_type: AuditSearchResourceType
|
||||
display_name: string
|
||||
historical: boolean
|
||||
identity_snapshot?: Record<string, unknown> | null
|
||||
}
|
||||
export type AuditResourceSearchPage = AuditPage<AuditResourceCandidate>
|
||||
|
||||
export interface AuditLinkTimelineNode {
|
||||
node_id: string
|
||||
record_source: 'audit_event' | 'integration_log' | 'outbox_event'
|
||||
code: string
|
||||
title: string
|
||||
summary: string
|
||||
result: string
|
||||
result_name: string
|
||||
occurred_at: string
|
||||
request_id?: string | null
|
||||
correlation_id?: string | null
|
||||
parent_event_id?: string | null
|
||||
reference_only?: boolean
|
||||
resources?: AuditInvestigationResourceRef[]
|
||||
investigation_refs?: AuditInvestigationRefs | null
|
||||
fidelity?: Record<string, boolean | null> | null
|
||||
}
|
||||
export interface AuditLinkTimeline {
|
||||
request_id?: string | null
|
||||
correlation_id?: string | null
|
||||
access_log_lookup_request_id?: string | null
|
||||
nodes: AuditLinkTimelineNode[]
|
||||
retention: AuditRetentionInfo
|
||||
}
|
||||
|
||||
export interface AuditFinanceQuery extends PaginationParams {
|
||||
shop_id?: number
|
||||
wallet_id?: number
|
||||
order_id?: number
|
||||
order_no?: string
|
||||
payment_id?: number
|
||||
payment_no?: string
|
||||
refund_id?: number
|
||||
refund_no?: string
|
||||
recharge_id?: number
|
||||
recharge_no?: string
|
||||
approval_instance_id?: number
|
||||
third_party_trade_no?: string
|
||||
actor_kind?: AuditActorKind
|
||||
actor_id?: string
|
||||
correlation_id?: string
|
||||
created_from?: string
|
||||
created_to?: string
|
||||
}
|
||||
export interface AuditFinanceTimelineNode {
|
||||
node_id: string
|
||||
record_source: string
|
||||
code: string
|
||||
title: string
|
||||
result: string
|
||||
result_name: string
|
||||
occurred_at: string
|
||||
shop_id?: number | null
|
||||
amount?: number | null
|
||||
balance_before?: number | null
|
||||
balance_after?: number | null
|
||||
currency?: string | null
|
||||
wallet?: { resource_type: 'agent_wallet' | 'asset_wallet'; wallet_id: number } | null
|
||||
amount_authority?: {
|
||||
authoritative: boolean
|
||||
table?: string
|
||||
field?: string
|
||||
conflict_rule?: string
|
||||
} | null
|
||||
facts?: Record<string, unknown> | null
|
||||
investigation_refs?: AuditInvestigationRefs | null
|
||||
}
|
||||
export type AuditFinanceTimelinePage = AuditPage<AuditFinanceTimelineNode>
|
||||
|
||||
export interface AuditRiskQuery {
|
||||
created_from?: string
|
||||
created_to?: string
|
||||
risk?: AuditRiskLevel
|
||||
result?: AuditResult
|
||||
action?: string
|
||||
source?: AuditSource
|
||||
}
|
||||
export interface AuditRiskEventQuery extends AuditRiskQuery, PaginationParams {}
|
||||
export interface AuditNamedCount {
|
||||
code: string
|
||||
name: string
|
||||
count: number
|
||||
}
|
||||
export interface AuditRiskOverview {
|
||||
total: number
|
||||
bucket: 'hour' | 'day'
|
||||
risks: AuditNamedCount[]
|
||||
results: AuditNamedCount[]
|
||||
actions: AuditNamedCount[]
|
||||
sources: AuditNamedCount[]
|
||||
signals: AuditNamedCount[]
|
||||
trend: Array<Record<string, string | number>>
|
||||
retention: AuditRetentionInfo
|
||||
}
|
||||
export type AuditRiskEventPage = AuditPage<AuditEventView>
|
||||
|
||||
export interface IntegrationQuery extends PaginationParams {
|
||||
created_from?: string
|
||||
created_to?: string
|
||||
integration_id?: string
|
||||
provider?: IntegrationProvider
|
||||
direction?: IntegrationDirection
|
||||
operation?: string
|
||||
result?: IntegrationResult
|
||||
result_category?: IntegrationResultCategory
|
||||
external_id?: string
|
||||
resource_type?: string
|
||||
resource_id?: string
|
||||
resource_key?: string
|
||||
trigger_source?: string
|
||||
trigger_scene?: string
|
||||
trigger_series?: string
|
||||
state_changed?: boolean
|
||||
http_status?: number
|
||||
provider_code?: string
|
||||
request_id?: string
|
||||
correlation_id?: string
|
||||
}
|
||||
export interface IntegrationResourceView {
|
||||
type?: string | null
|
||||
id?: string | null
|
||||
key?: string | null
|
||||
}
|
||||
export interface IntegrationIdentityView {
|
||||
integration_id: string
|
||||
provider: IntegrationProvider
|
||||
provider_name: string
|
||||
direction: IntegrationDirection
|
||||
direction_name: string
|
||||
operation: string
|
||||
operation_name: string
|
||||
external_id?: string | null
|
||||
}
|
||||
export interface IntegrationResultView {
|
||||
category: IntegrationResultCategory
|
||||
code: IntegrationResult
|
||||
name: string
|
||||
duration_ms: number
|
||||
http_status?: number | null
|
||||
provider_code?: string | null
|
||||
provider_message?: string | null
|
||||
recovery_strategy?: string | null
|
||||
state_changed: boolean
|
||||
}
|
||||
export interface IntegrationLinkageView {
|
||||
audit_event_id?: number | null
|
||||
request_id?: string | null
|
||||
correlation_id?: string | null
|
||||
}
|
||||
export interface IntegrationTriggerView {
|
||||
attempt: number
|
||||
scene?: string | null
|
||||
series?: string | null
|
||||
source?: string | null
|
||||
}
|
||||
export interface IntegrationTimestampView {
|
||||
created_at: string
|
||||
scheduled_at?: string | null
|
||||
started_at?: string | null
|
||||
updated_at: string
|
||||
}
|
||||
export interface IntegrationContentView {
|
||||
content_hash: string
|
||||
metadata?: Record<string, unknown> | null
|
||||
request_summary?: Record<string, unknown> | null
|
||||
response_summary?: Record<string, unknown> | null
|
||||
}
|
||||
export interface IntegrationFidelityView {
|
||||
attempt_sequence_reliable: boolean
|
||||
correlation_available: boolean
|
||||
provider_message_fidelity: string
|
||||
resource_id_available: boolean
|
||||
trigger_series_available: boolean
|
||||
}
|
||||
export interface IntegrationAttemptView {
|
||||
attempt: number
|
||||
created_at: string
|
||||
duration_ms: number
|
||||
integration_id: string
|
||||
operation: string
|
||||
operation_name: string
|
||||
result: IntegrationResult
|
||||
result_category: IntegrationResultCategory
|
||||
result_name: string
|
||||
sent: boolean
|
||||
state_changed: boolean
|
||||
}
|
||||
export interface IntegrationListItem {
|
||||
integration_id: string
|
||||
provider: IntegrationProvider
|
||||
provider_name: string
|
||||
direction: IntegrationDirection
|
||||
direction_name: string
|
||||
operation: string
|
||||
operation_name: string
|
||||
result: IntegrationResult
|
||||
result_name: string
|
||||
result_category: IntegrationResultCategory
|
||||
state_changed: boolean
|
||||
duration_ms?: number | null
|
||||
request_id?: string | null
|
||||
correlation_id?: string | null
|
||||
created_at: string
|
||||
resource?: IntegrationResourceView | null
|
||||
}
|
||||
export type IntegrationListPage = AuditPage<IntegrationListItem>
|
||||
export interface IntegrationOverview {
|
||||
total: number
|
||||
anomaly_count: number
|
||||
stale_pending_count: number
|
||||
state_changed_count: number
|
||||
unknown_count: number
|
||||
average_duration_ms: number
|
||||
p95_duration_ms: number
|
||||
providers: AuditNamedCount[]
|
||||
directions: AuditNamedCount[]
|
||||
results: Array<AuditNamedCount & { category: IntegrationResultCategory }>
|
||||
trend: Array<Record<string, string | number>>
|
||||
retention: AuditRetentionInfo
|
||||
}
|
||||
export interface IntegrationDetailResponse {
|
||||
identity: IntegrationIdentityView
|
||||
result: IntegrationResultView
|
||||
resource?: IntegrationResourceView | null
|
||||
linkage: IntegrationLinkageView
|
||||
trigger: IntegrationTriggerView
|
||||
timestamps: IntegrationTimestampView
|
||||
content: IntegrationContentView
|
||||
fidelity: IntegrationFidelityView
|
||||
attempts: IntegrationAttemptView[]
|
||||
retention: AuditRetentionInfo
|
||||
}
|
||||
|
||||
export interface AuditSubjectActivityQuery extends PaginationParams {
|
||||
created_from?: string
|
||||
created_to?: string
|
||||
}
|
||||
export interface AuditSubjectResourceSummary {
|
||||
resource_type?: string
|
||||
identifier?: string
|
||||
display_name?: string
|
||||
[key: string]: unknown
|
||||
}
|
||||
export interface AuditSubjectActivity {
|
||||
action_code: string
|
||||
action_name: string
|
||||
occurred_at: string
|
||||
result: AuditResult
|
||||
subject_summary: string
|
||||
subject_data?: Record<string, unknown> | null
|
||||
related_resources?: AuditSubjectResourceSummary[]
|
||||
}
|
||||
export interface AuditSubjectActivityPage extends AuditPage<AuditSubjectActivity> {
|
||||
resource: AuditSubjectResourceSummary
|
||||
}
|
||||
@@ -126,5 +126,8 @@ export * from './bulkPurchase'
|
||||
// 站内通知相关
|
||||
export * from './notification'
|
||||
|
||||
// 审计链路与调查中心
|
||||
export * from './audit'
|
||||
|
||||
// 企业微信审批配置相关
|
||||
export * from './wecom'
|
||||
|
||||
6
src/types/components.d.ts
vendored
6
src/types/components.d.ts
vendored
@@ -68,6 +68,12 @@ declare module 'vue' {
|
||||
ArtWangEditor: typeof import('./../components/core/forms/ArtWangEditor.vue')['default']
|
||||
ArtWatermark: typeof import('./../components/core/others/ArtWatermark.vue')['default']
|
||||
ArtWorkTab: typeof import('./../components/core/layouts/art-work-tab/index.vue')['default']
|
||||
AuditDistributionChart: typeof import('./../components/business/audit/AuditDistributionChart.vue')['default']
|
||||
AuditEventTable: typeof import('./../components/business/audit/AuditEventTable.vue')['default']
|
||||
AuditInvestigationDrawer: typeof import('./../components/business/audit/AuditInvestigationDrawer.vue')['default']
|
||||
AuditInvestigationHost: typeof import('./../components/business/audit/AuditInvestigationHost.vue')['default']
|
||||
AuditInvestigationLinks: typeof import('./../components/business/audit/AuditInvestigationLinks.vue')['default']
|
||||
AuditResourceSearchDialog: typeof import('./../components/business/audit/AuditResourceSearchDialog.vue')['default']
|
||||
BasicSettings: typeof import('./../components/core/layouts/art-settings-panel/widget/BasicSettings.vue')['default']
|
||||
BatchOperationDialog: typeof import('./../components/business/BatchOperationDialog.vue')['default']
|
||||
BatchRealnamePolicyDialog: typeof import('./../components/business/BatchRealnamePolicyDialog.vue')['default']
|
||||
|
||||
@@ -34,6 +34,8 @@ export interface RouteMeta extends Record<string | number | symbol, unknown> {
|
||||
isFirstLevel?: boolean
|
||||
/** 角色权限 */
|
||||
roles?: string[]
|
||||
/** 页面访问权限,满足任意一个即可 */
|
||||
permissions?: string[]
|
||||
/** 导出任务固定场景 */
|
||||
exportTaskScene?: ExportTaskScene
|
||||
/** 是否固定标签页 */
|
||||
|
||||
Reference in New Issue
Block a user