import { getDefaultClient } from '../../factory' import type { DatasetRow, GetOrganizationTreeReqVO, GetOrganizationTreeRespVO, GetOrganizationUsersReqVO, GetOrganizationUsersRespVO, GetUploadTokenReqVO, GetUploadTokenRespVO, IngressRespVO, IngressSetOptionsTabberReqVO, IngressSetOptionsTabberRespVO, MobileUploadReqVO, MobileUploadRespVO, MobileUploadCheckReqVO, MobileUploadCheckRespVO, UploadPreviewReqVO, UploadPreviewRespVO, EntityValidateUniqReqVO, EntityValidateUniqRespVO, EntityQueryRelationReqVO, EntityQueryRelationRespVO, EntityQueryLinkToValuesReqVO, AppDetailRespVO, } from '../../types' // @endpoint GET /apps/:id // @controller UserAction.AppDetail export async function getAppDetail( id: string | number ): Promise { return getDefaultClient().get(`/apps/${id}`) } // @endpoint GET /dataset/:id/:node_id // @controller UserAction.GetDataset export async function getDataset( id: string | number, nodeId: string | number ): Promise { return getDefaultClient().get(`/dataset/${id}/${nodeId}`) } // @endpoint POST /organization/departments/tree // @controller UserAction.GetOrganizationTree export async function getOrganizationTree( data: GetOrganizationTreeReqVO ): Promise { return getDefaultClient().post('/organization/departments/tree', data) } // @endpoint POST /organization/users // @controller UserAction.GetOrganizationUsers export async function getOrganizationUsers( data: GetOrganizationUsersReqVO ): Promise { return getDefaultClient().post('/organization/users', data) } // @endpoint POST /upload/token // @controller UserAction.GetUploadToken export async function getUploadToken( data: GetUploadTokenReqVO ): Promise { return getDefaultClient().post('/upload/token', data) } // @endpoint GET /ingress/:app_id/:ingress_id // @controller UserAction.Ingress export async function getIngress( appId: string, ingressId: string ): Promise { return getDefaultClient().get(`/ingress/${appId}/${ingressId}`) } // @endpoint PUT /ingress/:app_id/:ingress_id/options-tabber // @controller UserAction.IngressSetOptionsTabber export async function setIngressOptionsTabber( appId: string, ingressId: string, data: IngressSetOptionsTabberReqVO ): Promise { return getDefaultClient().put(`/ingress/${appId}/${ingressId}/options-tabber`, data) } // @endpoint POST /upload/mobile-upload // @controller UserAction.MobileUpload export async function mobileUpload( data: MobileUploadReqVO ): Promise { return getDefaultClient().post('/upload/mobile-upload', data) } // @endpoint POST /upload/mobile-upload/check // @controller UserAction.MobileUploadCheck export async function checkMobileUpload( data: MobileUploadCheckReqVO ): Promise { return getDefaultClient().post('/upload/mobile-upload/check', data) } // @endpoint POST /upload/preview // @controller UserAction.UploadPreview export async function uploadPreview( data: UploadPreviewReqVO ): Promise { return getDefaultClient().post('/upload/preview', data) } // @endpoint POST /entity/:app_id/:entity_id/validate-uniq // @controller UserAction.EntityValidateUniq export async function validateEntityUnique( appId: string, entityId: string, data: EntityValidateUniqReqVO ): Promise { return getDefaultClient().post(`/entity/${appId}/${entityId}/validate-uniq`, data) } // @endpoint POST /entity/:app_id/:entity_id/query-rel // @controller UserAction.EntityQueryRelation export async function queryEntityRelation( appId: string, entityId: string, data: EntityQueryRelationReqVO ): Promise { return getDefaultClient().post(`/entity/${appId}/${entityId}/query-rel`, data) } // @endpoint POST /entity/:app_id/:entity_id/query-linkto-pick // @controller UserAction.EntityQueryLinkToPick export async function queryLinktoPickOptions( appId: string, entityId: string, data: EntityQueryRelationReqVO ): Promise { return getDefaultClient().post(`/entity/${appId}/${entityId}/query-linkto-pick`, data) } // @endpoint POST /entity/:app_id/:entity_id/query-linkto-values // @controller UserAction.EntityQueryLinkToValues export async function queryLinktoValues( appId: string, entityId: string, data: EntityQueryLinkToValuesReqVO ): Promise { return getDefaultClient().post(`/entity/${appId}/${entityId}/query-linkto-values`, data) } // @endpoint POST /entity/:app_id/:entity_id/query-subform-rel // @controller UserAction.EntityQuerySubformRelation export async function getSubformRelationData( appId: string, entityId: string, options: any ): Promise { return getDefaultClient().post(`/entity/${appId}/${entityId}/query-subform-rel`, options) }