UNPKG

@allthings/sdk

Version:
47 lines (46 loc) 1.89 kB
import { EntityResultList, EnumResource, IAllthingsRestClient } from '../types'; export interface IUserRelation { readonly id: string; readonly readOnly: boolean; readonly responsibilities: readonly { readonly groups: readonly string[]; readonly id: string; readonly properties: readonly string[]; readonly role?: string; }[]; readonly type: string; readonly user: string; } export type UserRelationResult = Promise<IUserRelation>; export type UserRelationResultList = EntityResultList<IUserRelation>; export declare enum EnumUserRelationType { isResponsible = "is-responsible" } export type MethodUserRelationCreate = (userId: string, data: { readonly ids: readonly string[]; readonly level: EnumResource; readonly readOnly?: boolean; readonly role?: string; readonly type: EnumUserRelationType; }) => UserRelationResult; export type MethodUserRelationDelete = (userId: string, data: { readonly ids: readonly string[]; readonly level: EnumResource; readonly role?: string; readonly type: EnumUserRelationType; }) => UserRelationResult; export type MethodUserRelationsGetByUser = (userId: string) => UserRelationResultList; export declare function userRelationCreate(client: IAllthingsRestClient, userId: string, data: { readonly ids: readonly string[]; readonly level: EnumResource; readonly readOnly: boolean; readonly role?: string; readonly type: EnumUserRelationType; }): UserRelationResult; export declare function userRelationDelete(client: IAllthingsRestClient, userId: string, data: { readonly ids: readonly string[]; readonly level: EnumResource; readonly role?: string; readonly type: EnumUserRelationType; }): UserRelationResult; export declare function userRelationsGetByUser(client: IAllthingsRestClient, userId: string): UserRelationResultList;