Class StandaloneMatrixSDK

StandaloneMatrixSDK is a connection to a Matrix Instance. It offers services to interact with the Instance. A primary purpose beyond authenticating on the server is to provide access to Project objects through openProject() or openCurrentProjectFromSession().

Implements

Constructors

Properties

ItemConfig: ItemConfiguration
baseRestUrl: string
config: Configuration
debug: boolean = false
fetchWrapper: IsomorphicFetchWrapper
instance: DefaultApi
json: IJSONTools
labelManager: ILabelManager
logger: ILoggerTools
matrixBaseUrl: string
projectMap: Map<string, Project>
simpleItemTools: ISimpleItemTools

Methods

  • Parameters

    • fromId: string
    • toId: string

    Returns Promise<string>

  • Parameters

    • project: string
    • category: string
    • itemJson: IItemPut
    • actions: string
    • parentId: string

    Returns Promise<string>

  • Parameters

    • project: string
    • itemId: string
    • force: boolean

    Returns Promise<string>

  • Parameters

    • project: string
    • term: string
    • Optional filter: string
    • Optional ignoreFilters: boolean
    • Optional fieldList: string
    • Optional crossProject: string
    • Optional labels: boolean
    • Optional down: boolean
    • Optional up: boolean
    • Optional treeOrder: boolean

    Returns Promise<ISearchResult[]>

  • Parameters

    • project: string
    • itemJson: IItemPut
    • auditAction: string
    • Optional currentVersion: number

    Returns Promise<IItemGet>

  • Parameters

    • fromProject: string
    • fromItem: string
    • toProject: string
    • toFolder: string
    • copyLabels: boolean

    Returns Promise<CopyItemAck>

  • Creates a folder

    Parameters

    • parent: string

      where to store the folder

    • title: string

      name of the folder

    • Optional data: ISetField[]

      array with fieldNames and values

    Returns Promise<string>

    Promise to the item id of folder

    Throws

    error in case of input error (bad fields, etc)

  • create a new item in the database

    Use: createItem( "F-REQ-1", "my item", [{fieldName:"description",value:"x"}], ["labelx"], downlinks:["SPEC-1"], uplinks:[] )

    Parameters

    • folder: string

      where to store the item

    • title: string

      name of the item

    • Optional data: ISetField[]

      array with fieldNames and values

    • Optional labels: []

      list of labels to set

    • Optional downlinks: []

      list of downlinks to create

    • Optional uplinks: []

      list of uplinks to create

    Returns Promise<string>

    the created item id

  • Parameters

    • project: string
    • folder: string
    • item: IItemPut

    Returns Promise<string>

  • Parameters

    • project: string
    • users: string[]
    • type: TodoTypes
    • text: string
    • itemId: string
    • fieldId: number
    • atDate: Date

    Returns Promise<string>

  • Parameters

    • fromId: string
    • toId: string

    Returns Promise<string>

  • Parameters

    • fromId: string

    Returns Promise<string[]>

  • Parameters

    • itemId: string
    • Optional force: boolean

    Returns Promise<string>

  • Parameters

    • fromId: string

    Returns Promise<string[]>

  • Actually download a job file

    Parameters

    • project: string
    • jobId: number
    • fileno: number
    • Optional mode: string
    • Optional format: string
    • Optional disposition: string
    • Optional options: unknown

    Returns Promise<ArrayBuffer>

    An ArrayBuffer

  • Parameters

    • itemId: string

    Returns Promise<string[]>

  • gets the value of a field of an item from the database

    Use: await getField( "REQ-1", "description")

    Parameters

    • itemId: string

      the id of the item like "REQ-1" or a specific version like "REQ-1-v1"

    • fieldName: string

      name of the field

    Returns Promise<unknown>

    Promise to the value of the field

    Throws

    Error in case of invalid item or field

  • get a folder from the database, filling in it's children.

    Parameters

    • folderId: string

      the id of the folder like "F--"

    Returns Promise<ITitleAndId[]>

    Promise to ITitleAndId array

    Throws

    error if folderId is invalid

  • get an item from the database as json object.

    Use: await api.getItem("F-DOC-1")

    Parameters

    • itemId: string

      the id of the item like "REQ-1" or a specific version like "REQ-1-v1"

    Returns Promise<IItem>

    Promise to json object with all fields, links and labels

    Throws

    error in case the itemId is bad.

  • Parameters

    • category: string
    • title: string

    Returns Promise<string>

  • Parameters

    • category: string

    Returns Promise<string[]>

  • Get the TODOs for a project.

    Parameters

    • project: string

      project name

    • Optional itemRef: string

      if specified, returns all todos linked to an item, regardless of user

    • Optional includeDone: boolean

      if true, includes done todos

    • Optional includeAllUsers: boolean

      if true, includes all todos for all users.

    • Optional includeFuture: boolean

      false by default. If true, includes future todos.

    Returns Promise<GetTodosAck>

    Information on the todos.

  • Parameters

    • itemId: string

    Returns Promise<string[]>

  • Move items to a particular folder.

    Parameters

    • project: string

      a valid project on the instance

    • folderId: string

      a valid folder id within the project

    • itemIds: string[]

      an array of itemIds

    Returns Promise<string>

    the string "Ok" on success

  • The session object contains a string that represents the "current project." This convenience method calls openProject() with that string.

    Returns Promise<Project>

    A valid Project object, or null if the session has no project.

  • Retrieve or create a Project object for the given project name. The method is asynchronous because it may require a trip to the server to retrieve project configuration.

    Parameters

    • project: string

      a valid string.

    Returns Promise<Project>

    A valid Project object, or null if the project name is undefined.

  • Put a server setting (also called a customer setting).

    Parameters

    • key: string

      the key to save the setting under

    • value: string

      the value of the setting

    Returns Promise<string>

  • Parameters

    • Optional adminUI: number
    • Optional output: string
    • Optional options: unknown

    Returns Promise<ListProjectAndSettings>

  • Run a hook in a project

    Parameters

    • project: string
    • itemId: string
    • hookName: string
    • body: string

    Returns Promise<string>

  • search items

    Parameters

    • term: string

      search expression, e.g. mrql:category=REQ

    • Optional includeFields: boolean

      true to include fields

    • Optional includeLinks: boolean

      true to include links

    • Optional includeLabels: boolean

      true to include labels

    • Optional filter: string

    Returns Promise<ISearchResult[]>

    search results

  • Execute a search in the given project, returning matching item ids.

    Parameters

    • project: string
    • term: string

    Returns Promise<string[]>

    an array of item ids.

  • set a field of an item in the database

    Use: await api.setField("PROC-83", "plain english", "x");

    Parameters

    • itemId: string

      itemId the id of the item like "REQ-1"

    • fieldName: string

      name of the field

    • value: string

      value of the field

    Returns Promise<IItemGet>

    Promise to the updated item

    Throws

    Error in case of invalid itemId or fieldName

  • sets multiple fields in the database

    Use: await api.setFields("PROC-83", [{fieldName:"plain english",value:"x"}] )

    Parameters

    • itemId: string

      itemId itemId the id of the item like "REQ-1"

    • data: ISetField[]

      array of fieldName and value tupels

    Returns Promise<IItemGet>

    the updated item

    Throws

    Error in case of invalid id or fields

Generated using TypeDoc