Module: ActionsApi

API for interacting with actions.

More info: https://dashboard.seq.com/docs/filters

Methods


<inner> list(params)

Get actions matching the specified query.

Parameters:
Name Type Default Description
params Object {}

Filter information.

Properties
Name Type Description
filter String

Filter string, see https://dashboard.seq.com/docs/filters.

filterParams Array.<(String|Number)>

Parameter values for filter string (if needed).

Returns:

A promise of results.

Type
Promise.<Page.<Action>>
Examples

List all actions for a source account

async () => {
  await ledger.actions
    .list({
      filter: 'sourceAccountId = $1',
      filterParams: [account.id]
    })
    .all(action => {
      console.log(action)
    })
}

Paginate actions

async () => {
  const page1 = await ledger.actions
    .list({})
    .page({ size: 1 })
  const action = page1.items[0];
  console.log(action)
  const page2 = await ledger.actions
    .list({})
    .page({ cursor: page.cursor })
}

<inner> sum(params)

Get sums of actions matching the specified query.

Parameters:
Name Type Default Description
params Object {}

Filter and pagination information.

Properties
Name Type Description
filter String

Filter string, see https://dashboard.seq.com/docs/filters.

filterParams Array.<(String|Number)>

Parameter values for filter string (if needed).

groupBy Array.<String>

Action object fields to group by.

Returns:

A promise of results.

Type
Promise.<Page.<ActionSum>>
Examples

Sum actions for an account grouped by type

async () => {
  await ledger.actions
    .sum({
      filter: 'destinationAccountId = $2',
      filterParams: [account.id],
      groupBy: ['type']
    })
    .all(sum => {
      console.log(sum)
    })
}

Paginate sums of actions grouped by type

async () => {
  const page1 = await ledger.actions
    .sum({
      groupBy: ['type']
    })
    .page({ size: 1 })
  const sum = page1.items[0];
  console.log(sum)
  const page2 = await ledger.actions
    .sum({})
    .page({ cursor: page.cursor })
}

<inner> updateTags(params)

Update action tags.

Parameters:
Name Type Description
params module:ActionsApi~updateTagsRequest

Parameters for updating action tags.

Returns:

Success message.

Type
Promise.<Object>