stream-processing.js
function configureStreamProcessingWithSettings(context, settings, standardSettings, standardOptions, event, awsContext,
  forceConfiguration, validateConfiguration) {

  // Configure all of the stream processing dependencies if not configured by configuring the given context as a
  // standard context with stage handling, logging, custom settings, an optional Kinesis instance and an optional
  // DynamoDB.DocumentClient instance using the given standard settings and standard options and ALSO optionally with
  // the current region, resolved stage and AWS context, if BOTH the optional given event and optional given AWS context
  // are defined
  contexts.configureStandardContext(context, standardSettings, standardOptions, event, awsContext, forceConfiguration);

  // If forceConfiguration is false check if the given context already has stream processing configured on it
  // and, if so, do nothing more and simply return the context as is (to prevent overriding an earlier configuration)
  if (!forceConfiguration && isStreamProcessingConfigured(context)) {
    // Configure the consumer id if possible
    configureConsumerId(context, awsContext);

    // Configure an AWS.Lambda instance for disabling of the Lambda's event source mapping if necessary
    lambdaCache.configureLambda(context);

    // Validate the stream processing configuration
    if (typeof validateConfiguration === 'function')
      validateConfiguration(context);
    else
      validateStreamProcessingConfiguration(context);

    return context;
  }

  // Configure stream processing with the given settings
  context.streamProcessing = settings;

  // Configure the consumer id if possible
  configureConsumerId(context, awsContext);

  // Configure an AWS.Lambda instance for disabling of the Lambda's event source mapping if necessary
  lambdaCache.configureLambda(context);

  // Validate the stream processing configuration
  if (typeof validateConfiguration === 'function')
    validateConfiguration(context);
  else
    validateStreamProcessingConfiguration(context);

  return context;
}
function configureStreamProcessingWithSettings(context, settings, standardSettings, standardOptions, event, awsContext,
  forceConfiguration, validateConfiguration) {

  // Configure all of the stream processing dependencies if not configured by configuring the given context as a
  // standard context with stage handling, logging, custom settings, an optional Kinesis instance and an optional
  // DynamoDB.DocumentClient instance using the given standard settings and standard options and ALSO optionally with
  // the current region, resolved stage and AWS context, if BOTH the optional given event and optional given AWS context
  // are defined
  contexts.configureStandardContext(context, standardSettings, standardOptions, event, awsContext, forceConfiguration);

  // If forceConfiguration is false check if the given context already has stream processing configured on it
  // and, if so, do nothing more and simply return the context as is (to prevent overriding an earlier configuration)
  if (!forceConfiguration && isStreamProcessingConfigured(context)) {
    // Configure the consumer id if possible
    configureConsumerId(context, awsContext);

    // Configure an AWS.Lambda instance for disabling of the Lambda's event source mapping if necessary
    lambdaCache.configureLambda(context);

    // Validate the stream processing configuration
    if (typeof validateConfiguration === 'function')
      validateConfiguration(context);
    else
      validateStreamProcessingConfiguration(context);

    return context;
  }

  // Configure stream processing with the given settings
  context.streamProcessing = settings;

  // Configure the consumer id if possible
  configureConsumerId(context, awsContext);

  // Configure an AWS.Lambda instance for disabling of the Lambda's event source mapping if necessary
  lambdaCache.configureLambda(context);

  // Validate the stream processing configuration
  if (typeof validateConfiguration === 'function')
    validateConfiguration(context);
  else
    validateStreamProcessingConfiguration(context);

  return context;
}
function configureStreamProcessingWithSettings ( context , settings , standardSettings , standardOptions , event , awsContext , forceConfiguration , validateConfiguration ) { // Configure all of the stream processing dependencies if not configured by configuring the given context as a // standard context with stage handling, logging, custom settings, an optional Kinesis instance and an optional // DynamoDB.DocumentClient instance using the given standard settings and standard options and ALSO optionally with // the current region, resolved stage and AWS context, if BOTH the optional given event and optional given AWS context // are defined contexts . configureStandardContext ( context , standardSettings , standardOptions , event , awsContext , forceConfiguration ) ; // If forceConfiguration is false check if the given context already has stream processing configured on it // and, if so, do nothing more and simply return the context as is (to prevent overriding an earlier configuration) if ( ! forceConfiguration && isStreamProcessingConfigured ( context ) ) { // Configure the consumer id if possible configureConsumerId ( context , awsContext ) ; // Configure an AWS.Lambda instance for disabling of the Lambda's event source mapping if necessary lambdaCache . configureLambda ( context ) ; // Validate the stream processing configuration if ( typeof validateConfiguration === 'function' ) validateConfiguration ( context ) ; else validateStreamProcessingConfiguration ( context ) ; return context ; } // Configure stream processing with the given settings context . streamProcessing = settings ; // Configure the consumer id if possible configureConsumerId ( context , awsContext ) ; // Configure an AWS.Lambda instance for disabling of the Lambda's event source mapping if necessary lambdaCache . configureLambda ( context ) ; // Validate the stream processing configuration if ( typeof validateConfiguration === 'function' ) validateConfiguration ( context ) ; else validateStreamProcessingConfiguration ( context ) ; return context ; }
Configures the given context with the given stream processing settings, but only if stream processing is not already
configured on the given context OR if forceConfiguration is true, and with the given standard settings and options.

Note that if either the given event or AWS context are undefined, then everything other than the event, AWS context &
stage will be configured. This missing configuration can be configured at a later point in your code by invoking
{@linkcode module:aws-stream-consumer-core/stream-processing#configureEventAwsContextAndStage}. This separation of configuration is
primarily useful for unit testing.

@param {Object|StreamProcessing|StandardContext} context - the context onto which to configure the given stream processing settings and standard settings
@param {StreamProcessingSettings} settings - the stream processing settings to use
@param {StandardSettings|undefined} [standardSettings] - optional standard settings to use to configure dependencies
@param {StandardOptions|undefined} [standardOptions] - optional standard options to use to configure dependencies
@param {AWSEvent|undefined} [event] - the AWS event, which was passed to your lambda
@param {AWSContext|undefined} [awsContext] - the AWS context, which was passed to your lambda
@param {boolean|undefined} [forceConfiguration] - whether or not to force configuration of the given settings and
options, which will override any previously configured stream processing and stage handling settings on the given context
@param {function(context: StreamConsumerContext)|undefined} [validateConfiguration] - an optional function to use to further validate the configuration on the given context
@return {StreamProcessing} the context object configured with stream processing (either existing or new) and standard settings
Configures the given context with the given stream processing settings but only if stream processing is not already configured on the given context OR if forceConfiguration is true and with the given standard settings and options .