How to use the @clevercloud/client/cjs/api/log.js.getOldLogs function in @clevercloud/client

To help you get started, we’ve selected a few @clevercloud/client examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github CleverCloud / clever-tools / src / models / log.js View on Github external
function getOldLogs (appId, beforeDate, afterDate, filter, deployment_id) {

  const limit = (beforeDate == null && afterDate == null) ? 300 : null;
  const before = (beforeDate != null) ? beforeDate.toISOString() : null;
  const after = (afterDate != null) ? afterDate.toISOString() : null;

  const logsProm = fetchOldLogs({ appId, limit, before, after, filter, deployment_id }).then(sendToApi);

  return Bacon.fromPromise(logsProm)
    .flatMapLatest((logs) => Bacon.fromArray(logs.reverse()));
};