import { getDefaultClient } from '../../factory' import type { AppIngressCreateReqVO, AppIngressCreateRespVO, AppIngressDeleteRespVO, AppIngressGetRespVO, AppIngressGetBlocksRespVO, AppIngressGetByHashIDRespVO, AppIngressListRespVO, AppIngressUpdateReqVO, AppIngressUpdateRespVO, AppIngressUpdateBlocksReqVO, AppIngressUpdateBlocksRespVO } from '../../types/ingress' // @endpoint POST /apps/:app_id/entity/:entity_id/ingress // @controller App.IngressCreate export async function createEntityIngress( appId: string, entityId: string, data: AppIngressCreateReqVO ): Promise { return getDefaultClient().post(`/apps/${appId}/entity/${entityId}/ingress`, data) } // @endpoint POST /apps/:app_id/entity/:entity_id/ingress?from_ingress_id=:id // @controller App.IngressCreate (clone from existing ingress) export async function createEntityIngressFrom( appId: string, entityId: string, fromIngressId: string, data: AppIngressCreateReqVO ): Promise { return getDefaultClient().post(`/apps/${appId}/entity/${entityId}/ingress?from_ingress_id=${fromIngressId}`, data) } // @endpoint DELETE /apps/:app_id/entity/:entity_id/ingress/:id // @controller App.IngressDelete export async function deleteEntityIngress( appId: string, entityId: string, id: string ): Promise { return getDefaultClient().delete(`/apps/${appId}/entity/${entityId}/ingress/${id}`) } // @endpoint GET /apps/:app_id/entity/:entity_id/ingress/:id // @controller App.IngressGet export async function getEntityIngress( appId: string, entityId: string, id: string ): Promise { return getDefaultClient().get(`/apps/${appId}/entity/${entityId}/ingress/${id}`) } // @endpoint GET /apps/:app_id/entity/:entity_id/ingress-blocks/:id // @controller App.IngressGetBlocks export async function getEntityIngressBlocks( appId: string, entityId: string, id: string ): Promise { return getDefaultClient().get(`/apps/${appId}/entity/${entityId}/ingress-blocks/${id}`) } // @endpoint GET /apps/:app_id/entity/:entity_id/ingress-h/:id // @controller App.IngressGetByHashID export async function getEntityIngressByHashID( appId: string, entityId: string, id: string ): Promise { return getDefaultClient().get(`/apps/${appId}/entity/${entityId}/ingress-h/${id}`) } // @endpoint GET /apps/:app_id/entity/:entity_id/ingress // @controller App.IngressList export async function getEntityIngressList( appId: string, entityId: string ): Promise { return getDefaultClient().get(`/apps/${appId}/entity/${entityId}/ingress`) } // @endpoint PUT /apps/:app_id/entity/:entity_id/ingress/:id // @controller App.IngressUpdate export async function updateEntityIngress( appId: string, entityId: string, id: string, data: AppIngressUpdateReqVO ): Promise { return getDefaultClient().put(`/apps/${appId}/entity/${entityId}/ingress/${id}`, data) } // @endpoint PUT /apps/:app_id/entity/:entity_id/ingress-blocks/:id // @controller App.IngressUpdateBlocks export async function updateEntityIngressBlocks( appId: string, entityId: string, id: string, data: AppIngressUpdateBlocksReqVO ): Promise { return getDefaultClient().put(`/apps/${appId}/entity/${entityId}/ingress-blocks/${id}`, data) } // @endpoint PUT /apps/:app_id/entity/:entity_id/ingress-h/:id // @controller App.IngressUpdateByHashID export async function updateEntityIngressByHashID( appId: string, entityId: string, id: string, data: AppIngressUpdateReqVO ): Promise { return getDefaultClient().put(`/apps/${appId}/entity/${entityId}/ingress-h/${id}`, data) }