( panelId: string, registerCode: string, productId: string | number, daemonId: string, code: string, isDelete?: boolean )
| 83 | ); |
| 84 | |
| 85 | export async function requestUseRedeem( |
| 86 | panelId: string, |
| 87 | registerCode: string, |
| 88 | productId: string | number, |
| 89 | daemonId: string, |
| 90 | code: string, |
| 91 | isDelete?: boolean |
| 92 | ) { |
| 93 | const { data: responseData } = await axios.post<IRedeemResponseProtocol<IBusinessProductInfo>>( |
| 94 | `${REDEEM_PLATFORM_ADDR}/api/iframe_instances/use_redeem`, |
| 95 | { |
| 96 | panelId, |
| 97 | registerCode, |
| 98 | productId, |
| 99 | daemonId, |
| 100 | code, |
| 101 | isDelete |
| 102 | }, |
| 103 | { |
| 104 | headers: { |
| 105 | "X-Panel-Id": panelId, |
| 106 | "X-Register-Code": registerCode |
| 107 | } |
| 108 | } |
| 109 | ); |
| 110 | if (responseData.code !== 200) { |
| 111 | throw new Error(responseData.message); |
| 112 | } |
| 113 | return responseData.data; |
| 114 | } |
| 115 | |
| 116 | function formatInstanceData(instance: IAdvancedInstanceInfo): IInstanceInfoProtocol { |
| 117 | let ports: string[] = instance.docker?.ports ?? []; |
no outgoing calls
no test coverage detected