Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ClavizClient

Hierarchy

  • ClavizClient

Index

Constructors

Methods

  • deleteFacts(factIds: string[]): Promise<void>
  • Removes facts by IDs.

    Parameters

    • factIds: string[]

      array of fact IDs.

    Returns Promise<void>

  • destroyFunctionInstance(functionId: string): Promise<void>
  • Stops function (if it is processing) and deletes it.

    Parameters

    • functionId: string

    Returns Promise<void>

  • executeFunction<T>(functionId: string, parameters: any, signal?: AbortSignal, engineName?: string): Promise<T>
  • Executes a cancellable Claviz Function in separate thread.

    Type parameters

    • T

    Parameters

    • functionId: string

      Function ID.

    • parameters: any

      Object representing function parameters.

    • Optional signal: AbortSignal

      A signal object that can be used to cancel the execution.

    • Optional engineName: string

      Name of the engine to use for function execution.

    Returns Promise<T>

    A promise that resolves to the result of the function.

  • getBranches(): Promise<Branch[]>
  • Returns all branches in the system.

    Returns Promise<Branch[]>

  • getCollectionEntities(branchId?: null): Promise<CollectionEntity[]>
  • Returns all collection entities.

    Parameters

    • branchId: null = null

      The branch ID to get collections from.

    Returns Promise<CollectionEntity[]>

  • getComponentEntities(): Promise<ComponentEntity[]>
  • Returns all component entities.

    Returns Promise<ComponentEntity[]>

  • Returns info about the current user.

    Returns Promise<UserInfo>

  • getCurrentUserBranch(): Promise<Branch>
  • Returns current user branch.

    Returns Promise<Branch>

  • getFactData<T>(factId: string): Promise<FactData<T>>
  • Returns data about the fact.

    Type parameters

    • T

    Parameters

    • factId: string

    Returns Promise<FactData<T>>

  • getFactHistory<T>(factId: string, pageIndex?: number, pageSize?: number): Promise<FactHistory<T>>
  • Returns fact history.

    Type parameters

    • T

    Parameters

    • factId: string
    • pageIndex: number = 0
    • pageSize: number = 10

    Returns Promise<FactHistory<T>>

  • getFunctionInstanceStatus(functionInstanceId: string): Promise<FunctionInstance>
  • Returns started function info by instance id.

    Parameters

    • functionInstanceId: string

    Returns Promise<FunctionInstance>

  • getStartedFunctionInstances(): Promise<FunctionInstance[]>
  • Returns info about all started function instances.

    Returns Promise<FunctionInstance[]>

  • getUserGroupList(): Promise<UserGroup[]>
  • Returns list of all user groups in system.

    Returns Promise<UserGroup[]>

  • Returns list of all users in system.

    Returns Promise<UserInfo[]>

  • importFacts<T>(collectionId: string, facts: T[]): Promise<void>
  • Imports facts in batch.

    Type parameters

    • T

    Parameters

    • collectionId: string
    • facts: T[]

    Returns Promise<void>

  • migrateFacts(options: MigrateFacts): Promise<any>
  • Migrates facts from one branch to another.

    Parameters

    • options: MigrateFacts

      The options for migration.

    Returns Promise<any>

  • query<T>(expression: string, userAgnostic?: boolean): Promise<T[]>
  • Executes provided expression for collection.

    Type parameters

    • T

    Parameters

    • expression: string

      The expression to execute.

    • userAgnostic: boolean = false

      If true, the expression will be executed as if it was run by the admin.

    Returns Promise<T[]>

  • saveFact<T>(factId: string, collectionId: string, fields: T): Promise<SavedFact<T>>
  • Saves/updates a fact.

    Type parameters

    • T

    Parameters

    • factId: string
    • collectionId: string
    • fields: T

    Returns Promise<SavedFact<T>>

  • startBackgroundFunction(functionId: string): Promise<void>
  • Starts background function.

    Parameters

    • functionId: string

    Returns Promise<void>

  • stopBackgroundFunction(functionId: string): Promise<void>
  • Stops background function.

    Parameters

    • functionId: string

    Returns Promise<void>

  • validateFact<T>(collectionId: string, facts: FactValidationRequest<T>[], signal?: AbortSignal): Promise<FactValidationResult<T>>
  • Type parameters

    • T

    Parameters

    • collectionId: string
    • facts: FactValidationRequest<T>[]
    • Optional signal: AbortSignal

    Returns Promise<FactValidationResult<T>>

Generated using TypeDoc