UNPKG

corellium-typescript

Version:
1 lines 818 B
"use strict";exports.createCustomNetworkEndpoints=r=>({list:async()=>{const o=await r.GET("/v1/network/connections");if(o.error)throw new Error(o.error.error);return o.data},create:async o=>{const e=await r.POST("/v1/network/connections",{body:o});if(e.error)throw new Error(e.error.error);return e.data},update:async(o,e)=>{const t=await r.PATCH("/v1/network/connections/{id}",{params:{path:{customNetworkId:o}},body:{name:e.name,provider:"openvpn",config:{config:e.config}}});if(t.error)throw new Error(t.error.error);return t.data},delete:async o=>{const e=await r.DELETE("/v1/network/connections/{id}",{params:{path:{id:o}}});if(e.error)throw new Error(e.error.error);return e.data},providers:{list:async()=>{const o=await r.GET("/v1/network/providers");if(o.error)throw new Error(o.error.error);return o.data}}});