"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.fakeStreamQueueCreator = exports.fakeStreamConfigCreator = exports.fakeKinesisClientCreator = exports.fakeKinesisConfigCreator = exports.numRecords = void 0;

var _kinesis = _interopRequireDefault(require("aws-sdk/clients/kinesis"));

var _StreamQueue = _interopRequireDefault(require("../StreamQueue"));

var numRecords = function numRecords(stream) {
  return 1;
};

exports.numRecords = numRecords;

var fakeKinesisConfigCreator = function fakeKinesisConfigCreator() {
  var config = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null;
  return {
    client: fakeKinesisClientCreator(),
    streamConfigs: [fakeStreamConfigCreator()]
  };
};

exports.fakeKinesisConfigCreator = fakeKinesisConfigCreator;

var fakeKinesisClientCreator = function fakeKinesisClientCreator() {
  var config = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null;
  var kinesisConfig = config || {
    apiVersion: '2013-12-02',
    region: 'us-west-2',
    endpoint: 'kinesis.docker'
  };
  return new _kinesis.default(kinesisConfig);
};

exports.fakeKinesisClientCreator = fakeKinesisClientCreator;

var fakeStreamConfigCreator = function fakeStreamConfigCreator() {
  var config = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
  return {
    eventTypes: {
      EVENT: function EVENT() {}
    },
    maxPageSize: 5,
    // max number events sent at once
    sendRecordsTimeout: 1000,
    // in milliseconds
    stream: 'KinesisResponsesStreamName',
    whiny: true
  };
};

exports.fakeStreamConfigCreator = fakeStreamConfigCreator;

var fakeStreamQueueCreator = function fakeStreamQueueCreator() {
  var kinesis = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : fakeKinesisClientCreator();
  var config = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : fakeStreamConfigCreator();
  return new _StreamQueue.default({
    config: config,
    kinesis: kinesis
  });
};

exports.fakeStreamQueueCreator = fakeStreamQueueCreator;