UNPKG

@kaaiot/services

Version:

Type definitions for KaaIoT platform REST API service communication

25 lines (24 loc) 1.81 kB
import { FetchResponse, ServiceRequester } from "../service-requester"; import { Asset, AssetRelation, AssetRelationPayload, AssetType, CreateAssetTypePayload, GetAssetsParams, GetAssetsPayload, ListItemsResponse, RelationEntityType } from "./types"; export declare class AssetsClient { private http; constructor(urlPrefix: string, serviceRequester?: ServiceRequester); getAssetTypes(params?: { size: number; page: number; }, signal?: AbortSignal): Promise<FetchResponse<ListItemsResponse<AssetType[]>>>; getAssets(params: GetAssetsParams, data?: GetAssetsPayload, signal?: AbortSignal): Promise<FetchResponse<ListItemsResponse<Asset[]>>>; getAssetType(id: string): Promise<FetchResponse<AssetType>>; createAssetType(payload: CreateAssetTypePayload): Promise<FetchResponse<void>>; updateAssetType(assetTypeId: string, payload: CreateAssetTypePayload): Promise<FetchResponse<void>>; deleteAssetType(id: string): Promise<FetchResponse<void>>; createAsset(assetTypeId: string, payload: string): Promise<FetchResponse<void>>; updateAsset(assetTypeId: string, assetId: string, payload: string): Promise<FetchResponse<void>>; getAsset(assetId: string): Promise<FetchResponse<Asset>>; deleteAsset(assetId: string): Promise<FetchResponse<void>>; getChildRelationships(entityId: string, entityType?: RelationEntityType, signal?: AbortSignal): Promise<AssetRelation[]>; getAssetRelations(entityId: string, entityType?: RelationEntityType): Promise<AssetRelation[]>; getParentRelationships(entityId: string, entityType?: RelationEntityType, signal?: AbortSignal): Promise<AssetRelation[]>; linkAsset(payload: AssetRelationPayload): Promise<FetchResponse<void>>; unlinkAsset(payload: AssetRelationPayload): Promise<FetchResponse<void>>; }