feat(payment): 新增微信支付宝积分充值与对账

This commit is contained in:
MasterChiefCN
2026-09-02 12:58:10 +08:00
parent b7fd7a1b61
commit 421a19d189
41 changed files with 6401 additions and 136 deletions

View File

@@ -2,8 +2,8 @@ import type { Asset } from "@/stores/use-asset-store";
export const PLUGIN_API_VERSION = "yingce.plugin/v1" as const;
export type PluginContributionKind = "provider" | "workflow" | "canvas-node" | "transform" | "command" | "asset-source" | "usage-observer" | "ai-capability" | "agent" | "import-export";
export type PluginSurface = "node" | "fullscreen" | "hybrid" | "asset-source" | "settings";
export type PluginContributionKind = "provider" | "payment-provider" | "workflow" | "canvas-node" | "transform" | "command" | "asset-source" | "usage-observer" | "ai-capability" | "agent" | "import-export";
export type PluginSurface = "node" | "fullscreen" | "hybrid" | "asset-source" | "settings" | "wallet";
export type ProtocolCapability = "text" | "image" | "video" | "audio";
export type ProtocolScope = "admin.system-channel" | "user.custom-channel" | "canvas" | "creation" | "agent" | string;
export type PluginRuntime = "declarative" | "sandbox" | "worker" | "trusted-backend";
@@ -60,6 +60,13 @@ export type PluginWorkflowContribution = {
parameters: PluginParameter[];
defaults?: Record<string, string | number | boolean>;
};
export type PluginPaymentProviderContribution = {
id: string;
label: string;
icon: string;
checkoutMode: "qr_code" | "redirect";
expiryPolicy: { defaultMinutes: number; minMinutes: number; maxMinutes: number };
};
export type PluginCanvasNodeContribution = {
id: string;
label: string;
@@ -76,6 +83,7 @@ export type PluginTransformContribution = {
};
export type PluginContributions = {
providers?: PluginProviderContribution[];
paymentProviders?: PluginPaymentProviderContribution[];
workflows?: PluginWorkflowContribution[];
canvasNodes?: PluginCanvasNodeContribution[];
transforms?: PluginTransformContribution[];
@@ -97,6 +105,10 @@ export type PluginPermission =
| "ai.text"
| "media.read"
| "usage.read"
| "payment.create"
| "payment.query"
| "payment.close"
| "payment.reconcile"
| "external.open";
export type PluginManifest = {
@@ -124,9 +136,7 @@ export type PluginStorage = {
remove(key: string): Promise<void>;
};
export type PluginTextContentPart =
| { type: "text"; text: string }
| { type: "image_url"; image_url: { url: string } };
export type PluginTextContentPart = { type: "text"; text: string } | { type: "image_url"; image_url: { url: string } };
export type PluginTextMessage = {
role: "system" | "user" | "assistant";
@@ -218,10 +228,7 @@ export type PromptOptimizationResult = {
};
export type PromptOptimizerProvider = {
optimize: (
input: PromptOptimizationInput,
options?: { signal?: AbortSignal; onDelta?: (text: string) => void },
) => Promise<PromptOptimizationResult>;
optimize: (input: PromptOptimizationInput, options?: { signal?: AbortSignal; onDelta?: (text: string) => void }) => Promise<PromptOptimizationResult>;
};
export type AssetSourceQuery = {