docs: function processStreamEvent(event, processOneTaskDefsOrNone, processAllTaskDefsOrNone, context) {
    // Precondition - NB: Ensure that your stream consumer is fully configured before calling this function!
    // Check if the Lambda as configured will be unusable or useless, and if so, trigger a replay of all the records until it can be fixed
    try {
      validateTaskDefinitions(processOneTaskDefsOrNone, processAllTaskDefsOrNone, context);
    }
    catch (err) {
      return ignoreUnhandledRejection(Promise.reject(err));
    }
  
    if (context.traceEnabled) logStreamEvent(event, "Processing stream event", LogLevel.TRACE, context);
  
    // Clean up any undefined or null task definition lists
    const processOneTaskDefs = processOneTaskDefsOrNone ? processOneTaskDefsOrNone : [];
    processOneTaskDefs.forEach(td => td.setDescribeItem(messageSettings.describeItem, false));
  
    const processAllTaskDefs = processAllTaskDefsOrNone ? processAllTaskDefsOrNone : [];
    processAllTaskDefs.forEach(td => td.setDescribeItem(batchAndIncompleteMessagesSettings.describeItem, false));
  
    const records = event.Records;
  
    if (!records || !Array.isArray(records) || records.length <= 0) {
      logStreamEvent(event, "Missing Records on stream event", LogLevel.ERROR, context);
      // Consume this useless event rather than throwing an error that will potentially replay it
      return Promise.resolve(new Batch([], processOneTaskDefs, processAllTaskDefs, context));
    }
  
    try {
      // Create a batch to track all of the records & messages
      const batch = new Batch(records, processOneTaskDefs, processAllTaskDefs, context);
  
      // Initiate the batch ... and then process the batch ... and then finalise the batch
      return ignoreUnhandledRejection(executeInitiateBatchTask(batch, {}, context)
        .then(() => executeProcessBatchTask(batch, {}, context))
        .then(processOutcomes => executeFinaliseBatchTask(batch, processOutcomes, {}, context))
        .catch(err => {
          context.error(`Stream consumer failed`, err);
          Object.defineProperty(err, 'batch', {value: batch, enumerable: false});// i.e. err.batch = batch;
  
          if (isInstanceOf(err, FatalError)) {
            return streamProcessing.handleFatalError(err, batch, context);
          }
          throw err;
        }));
  
    } catch (err) {
      context.error(`Stream consumer failed (in try-catch)`, err);
      return ignoreUnhandledRejection(Promise.reject(err));
    }
  }