Constructors
constructor
- new Elements(api: Api): Elements
Properties
api
Methods
archive
- archive(type: string, hash: string): Promise<void>
Returns Promise<void>
archiveFile
- archiveFile(
type: string,
hash: string,
organization: string,
attribute: string,
fileHash: string,
method?: "delete" | "post",
): Promise<void> Parameters
- type: string
- hash: string
- organization: string
- attribute: string
- fileHash: string
Optional
method: "delete" | "post"
Returns Promise<void>
cloneElementTree
- cloneElementTree(
root: string,
organization: string,
newParent?: string,
cloneConfig?: CloneConfig,
maxDepth?: number,
): Promise<ApiResponse<void, void>> Parameters
- root: string
- organization: string
Optional
newParent: stringOptional
cloneConfig: CloneConfigOptional
maxDepth: number
Returns Promise<ApiResponse<void, void>>
copyElement
- copyElement(
newParentType: string,
newParentHash: string,
copiedHash: string,
): Promise<
ApiResponse<
{ element: { hash: string }; links: RestApiLink[] },
{ element: { hash: string }; links: RestApiLink[] },
>,
> Parameters
- newParentType: string
- newParentHash: string
- copiedHash: string
Returns Promise<
ApiResponse<
{ element: { hash: string }; links: RestApiLink[] },
{ element: { hash: string }; links: RestApiLink[] },
>,
>
create
- create(
type: string,
operations: Operation[],
organization: string,
parent?: string,
queryParams?: Record<string, unknown>,
): Promise<
ApiResponse<
{ element: { hash: string } },
{ element: { hash: string } },
>,
> Parameters
- type: string
- operations: Operation[]
- organization: string
Optional
parent: stringOptional
queryParams: Record<string, unknown>
Returns Promise<
ApiResponse<
{ element: { hash: string } },
{ element: { hash: string } },
>,
>
getElementHashFromQR
- getElementHashFromQR(url: string): Promise<undefined | null | string>
Returns Promise<undefined | null | string>
getElementTypeList
- getElementTypeList(
organization: string,
right?: string,
page?: number,
): Promise<undefined | ElementTypePrivilegesList> Parameters
- organization: string
- right: string = 'read'
- page: number = 1
getElementTypes
- getElementTypes(organizationId: string, page?: number): Promise<ElementType[]>
Parameters
- organizationId: string
- page: number = 1
getPrivileges
- getPrivileges(
organization: string,
type: string,
): Promise<
ApiResponse<ElementPrivilegesResponse, ElementPrivilegesResponse>,
> Parameters
- organization: string
- type: string
Returns Promise<ApiResponse<ElementPrivilegesResponse, ElementPrivilegesResponse>>
getRaw
- getRaw(
hash: string,
type?: string,
useCache?: boolean,
params?: Record<string, unknown>,
): Promise<undefined | { element: ElementData }> Parameters
- hash: string
- type: string = '_TYPE_PLACEHOLDER'
Optional
useCache: booleanOptional
params: Record<string, unknown>
Returns Promise<undefined | { element: ElementData }>
pairQr
- pairQr(
elementHash: string,
organizationId: string,
url?: string,
): Promise<ApiResponse<void>> Parameters
- elementHash: string
- organizationId: string
Optional
url: string
Returns Promise<ApiResponse<void>>
patch
- patch(
type: string,
hash: string,
operations: Operation[],
organization: string,
queryParams?: Record<string, unknown>,
): Promise<ApiResponse<void>> Parameters
- type: string
- hash: string
- operations: Operation[]
- organization: string
Optional
queryParams: Record<string, unknown>
Returns Promise<ApiResponse<void>>
setParent
- setParent(
type: string,
hash: string,
parentHash: string,
): Promise<ApiResponse<void>> Parameters
- type: string
- hash: string
- parentHash: string
Returns Promise<ApiResponse<void>>
unarchive
- unarchive(type: string, hash: string): Promise<void>
Returns Promise<void>