lib/actions/expire.js
async function expire ({ payload, meta = {} }, { dispatch }) {
  const { service } = payload
  const { ident } = meta

  if (!service) {
    return createError(`Can't delete expired without a specified service`)
  }
  if (!payload.endpoint) {
    return createError(`Can't delete expired from service '${service}' without an endpoint`)
  }
  if (!payload.type) {
    return createError(`Can't delete expired from service '${service}' without one or more specified types`)
  }

  const response = await getExpired(payload, ident, dispatch)

  return deleteExpired(response, service, ident, dispatch)
}
async function expire ({ payload, meta = {} }, { dispatch }) {
  const { service } = payload
  const { ident } = meta

  if (!service) {
    return createError(`Can't delete expired without a specified service`)
  }
  if (!payload.endpoint) {
    return createError(`Can't delete expired from service '${service}' without an endpoint`)
  }
  if (!payload.type) {
    return createError(`Can't delete expired from service '${service}' without one or more specified types`)
  }

  const response = await getExpired(payload, ident, dispatch)

  return deleteExpired(response, service, ident, dispatch)
}
Action to delete expired items.

The given `endpoint` is used to retrieve expired items from the `service`, and
may use the paramters `timestamp` or `isodate`, which represents the current
time plus the microseconds in `msFromNow`, the former as microseconds since
January 1, 1970, the latter as an ISO formatted date and time string.

The items are mapped and typed, so the `type` param should be set to one
or more types expected from the `endpoint`, and may be a string or an array
of strings.
@param {Object} payload - Action payload (service, type, endpoint, and msFromNow)
@param {Object} resources - Dispatch and queue functions
@returns {Object} Response object