(
uuid: string,
action: OrderAction,
domainName?: string,
opts?: { revokeReason?: RevokeReason },
)
| 102 | * - 其他仅返回操作结果 |
| 103 | */ |
| 104 | export async function operateOrder( |
| 105 | uuid: string, |
| 106 | action: OrderAction, |
| 107 | domainName?: string, |
| 108 | opts?: { revokeReason?: RevokeReason }, |
| 109 | ): Promise<string> { |
| 110 | const params: Record<string, any> = { id: uuid, op: action }; |
| 111 | if (domainName) params.cd = domainName; |
| 112 | if (action === 'ca_del' && opts?.revokeReason !== undefined) { |
| 113 | params.reason = opts.revokeReason; |
| 114 | } |
| 115 | const data = await apiGet<ApiResp>('/order/', params); |
| 116 | if (data.flags !== 0) throw new Error(data.texts || '操作失败'); |
| 117 | return (data.order as string) || ''; |
| 118 | } |
no outgoing calls
no test coverage detected