You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@aws-lambda-powertools/batch

Package Overview
Dependencies
Maintainers
3
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-lambda-powertools/batch - npm Package Compare versions

Comparing version

to
2.24.0

20

./lib/cjs/index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SqsFifoPartialProcessorAsync = exports.SqsFifoPartialProcessor = exports.processPartialResponse = exports.processPartialResponseSync = exports.BatchProcessor = exports.BatchProcessorSync = exports.BasePartialBatchProcessor = exports.UnexpectedBatchTypeError = exports.SqsFifoMessageGroupShortCircuitError = exports.SqsFifoShortCircuitError = exports.FullBatchFailureError = exports.BatchProcessingError = exports.EventType = void 0;
exports.SqsFifoPartialProcessorAsync = exports.SqsFifoPartialProcessor = exports.processPartialResponseSync = exports.processPartialResponse = exports.UnexpectedBatchTypeError = exports.SqsFifoShortCircuitError = exports.SqsFifoMessageGroupShortCircuitError = exports.FullBatchFailureError = exports.BatchProcessingError = exports.EventType = exports.BatchProcessorSync = exports.BatchProcessor = exports.BasePartialBatchProcessor = void 0;
var BasePartialBatchProcessor_js_1 = require("./BasePartialBatchProcessor.js");
Object.defineProperty(exports, "BasePartialBatchProcessor", { enumerable: true, get: function () { return BasePartialBatchProcessor_js_1.BasePartialBatchProcessor; } });
var BatchProcessor_js_1 = require("./BatchProcessor.js");
Object.defineProperty(exports, "BatchProcessor", { enumerable: true, get: function () { return BatchProcessor_js_1.BatchProcessor; } });
var BatchProcessorSync_js_1 = require("./BatchProcessorSync.js");
Object.defineProperty(exports, "BatchProcessorSync", { enumerable: true, get: function () { return BatchProcessorSync_js_1.BatchProcessorSync; } });
var constants_js_1 = require("./constants.js");

@@ -9,15 +15,9 @@ Object.defineProperty(exports, "EventType", { enumerable: true, get: function () { return constants_js_1.EventType; } });

Object.defineProperty(exports, "FullBatchFailureError", { enumerable: true, get: function () { return errors_js_1.FullBatchFailureError; } });
Object.defineProperty(exports, "SqsFifoMessageGroupShortCircuitError", { enumerable: true, get: function () { return errors_js_1.SqsFifoMessageGroupShortCircuitError; } });
Object.defineProperty(exports, "SqsFifoShortCircuitError", { enumerable: true, get: function () { return errors_js_1.SqsFifoShortCircuitError; } });
Object.defineProperty(exports, "SqsFifoMessageGroupShortCircuitError", { enumerable: true, get: function () { return errors_js_1.SqsFifoMessageGroupShortCircuitError; } });
Object.defineProperty(exports, "UnexpectedBatchTypeError", { enumerable: true, get: function () { return errors_js_1.UnexpectedBatchTypeError; } });
var BasePartialBatchProcessor_js_1 = require("./BasePartialBatchProcessor.js");
Object.defineProperty(exports, "BasePartialBatchProcessor", { enumerable: true, get: function () { return BasePartialBatchProcessor_js_1.BasePartialBatchProcessor; } });
var BatchProcessorSync_js_1 = require("./BatchProcessorSync.js");
Object.defineProperty(exports, "BatchProcessorSync", { enumerable: true, get: function () { return BatchProcessorSync_js_1.BatchProcessorSync; } });
var BatchProcessor_js_1 = require("./BatchProcessor.js");
Object.defineProperty(exports, "BatchProcessor", { enumerable: true, get: function () { return BatchProcessor_js_1.BatchProcessor; } });
var processPartialResponse_js_1 = require("./processPartialResponse.js");
Object.defineProperty(exports, "processPartialResponse", { enumerable: true, get: function () { return processPartialResponse_js_1.processPartialResponse; } });
var processPartialResponseSync_js_1 = require("./processPartialResponseSync.js");
Object.defineProperty(exports, "processPartialResponseSync", { enumerable: true, get: function () { return processPartialResponseSync_js_1.processPartialResponseSync; } });
var processPartialResponse_js_1 = require("./processPartialResponse.js");
Object.defineProperty(exports, "processPartialResponse", { enumerable: true, get: function () { return processPartialResponse_js_1.processPartialResponse; } });
var SqsFifoPartialProcessor_js_1 = require("./SqsFifoPartialProcessor.js");

@@ -24,0 +24,0 @@ Object.defineProperty(exports, "SqsFifoPartialProcessor", { enumerable: true, get: function () { return SqsFifoPartialProcessor_js_1.SqsFifoPartialProcessor; } });

@@ -74,13 +74,2 @@ "use strict";

async process() {
/**
* If this is a sync processor, user should have called processSync instead,
* so we call the method early to throw the error early thus failing fast.
*
* The type casting is necessary to ensure that we have test coverage for the
* block of code that throws the error, without having to change the return type
* of the method. This is because this call will always throw an error.
*/
if (this.constructor.name === 'BatchProcessorSync') {
return (await this.processRecord(this.records[0]));
}
this.prepare();

@@ -87,0 +76,0 @@ // Default to `true` if `processInParallel` is not specified.

@@ -86,3 +86,3 @@ "use strict";

*/
class BatchProcessorSync extends BasePartialBatchProcessor_js_1.BasePartialBatchProcessor {
/* v8 ignore start */ class BatchProcessorSync extends BasePartialBatchProcessor_js_1.BasePartialBatchProcessor {
/**

@@ -120,3 +120,3 @@ * @throws {BatchProcessingError} This method is not implemented for asynchronous processing.

}
}
} /* v8 ignore stop */
exports.BatchProcessorSync = BatchProcessorSync;

@@ -1,10 +0,10 @@

export { EventType } from './constants.js';
export { BatchProcessingError, FullBatchFailureError, SqsFifoShortCircuitError, SqsFifoMessageGroupShortCircuitError, UnexpectedBatchTypeError, } from './errors.js';
export { BasePartialBatchProcessor } from './BasePartialBatchProcessor.js';
export { BatchProcessor } from './BatchProcessor.js';
export { BatchProcessorSync } from './BatchProcessorSync.js';
export { BatchProcessor } from './BatchProcessor.js';
export { EventType } from './constants.js';
export { BatchProcessingError, FullBatchFailureError, SqsFifoMessageGroupShortCircuitError, SqsFifoShortCircuitError, UnexpectedBatchTypeError, } from './errors.js';
export { processPartialResponse } from './processPartialResponse.js';
export { processPartialResponseSync } from './processPartialResponseSync.js';
export { processPartialResponse } from './processPartialResponse.js';
export { SqsFifoPartialProcessor } from './SqsFifoPartialProcessor.js';
export { SqsFifoPartialProcessorAsync } from './SqsFifoPartialProcessorAsync.js';
//# sourceMappingURL=index.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SqsFifoPartialProcessorAsync = exports.SqsFifoPartialProcessor = exports.processPartialResponse = exports.processPartialResponseSync = exports.BatchProcessor = exports.BatchProcessorSync = exports.BasePartialBatchProcessor = exports.UnexpectedBatchTypeError = exports.SqsFifoMessageGroupShortCircuitError = exports.SqsFifoShortCircuitError = exports.FullBatchFailureError = exports.BatchProcessingError = exports.EventType = void 0;
exports.SqsFifoPartialProcessorAsync = exports.SqsFifoPartialProcessor = exports.processPartialResponseSync = exports.processPartialResponse = exports.UnexpectedBatchTypeError = exports.SqsFifoShortCircuitError = exports.SqsFifoMessageGroupShortCircuitError = exports.FullBatchFailureError = exports.BatchProcessingError = exports.EventType = exports.BatchProcessorSync = exports.BatchProcessor = exports.BasePartialBatchProcessor = void 0;
var BasePartialBatchProcessor_js_1 = require("./BasePartialBatchProcessor.js");
Object.defineProperty(exports, "BasePartialBatchProcessor", { enumerable: true, get: function () { return BasePartialBatchProcessor_js_1.BasePartialBatchProcessor; } });
var BatchProcessor_js_1 = require("./BatchProcessor.js");
Object.defineProperty(exports, "BatchProcessor", { enumerable: true, get: function () { return BatchProcessor_js_1.BatchProcessor; } });
var BatchProcessorSync_js_1 = require("./BatchProcessorSync.js");
Object.defineProperty(exports, "BatchProcessorSync", { enumerable: true, get: function () { return BatchProcessorSync_js_1.BatchProcessorSync; } });
var constants_js_1 = require("./constants.js");

@@ -9,15 +15,9 @@ Object.defineProperty(exports, "EventType", { enumerable: true, get: function () { return constants_js_1.EventType; } });

Object.defineProperty(exports, "FullBatchFailureError", { enumerable: true, get: function () { return errors_js_1.FullBatchFailureError; } });
Object.defineProperty(exports, "SqsFifoMessageGroupShortCircuitError", { enumerable: true, get: function () { return errors_js_1.SqsFifoMessageGroupShortCircuitError; } });
Object.defineProperty(exports, "SqsFifoShortCircuitError", { enumerable: true, get: function () { return errors_js_1.SqsFifoShortCircuitError; } });
Object.defineProperty(exports, "SqsFifoMessageGroupShortCircuitError", { enumerable: true, get: function () { return errors_js_1.SqsFifoMessageGroupShortCircuitError; } });
Object.defineProperty(exports, "UnexpectedBatchTypeError", { enumerable: true, get: function () { return errors_js_1.UnexpectedBatchTypeError; } });
var BasePartialBatchProcessor_js_1 = require("./BasePartialBatchProcessor.js");
Object.defineProperty(exports, "BasePartialBatchProcessor", { enumerable: true, get: function () { return BasePartialBatchProcessor_js_1.BasePartialBatchProcessor; } });
var BatchProcessorSync_js_1 = require("./BatchProcessorSync.js");
Object.defineProperty(exports, "BatchProcessorSync", { enumerable: true, get: function () { return BatchProcessorSync_js_1.BatchProcessorSync; } });
var BatchProcessor_js_1 = require("./BatchProcessor.js");
Object.defineProperty(exports, "BatchProcessor", { enumerable: true, get: function () { return BatchProcessor_js_1.BatchProcessor; } });
var processPartialResponse_js_1 = require("./processPartialResponse.js");
Object.defineProperty(exports, "processPartialResponse", { enumerable: true, get: function () { return processPartialResponse_js_1.processPartialResponse; } });
var processPartialResponseSync_js_1 = require("./processPartialResponseSync.js");
Object.defineProperty(exports, "processPartialResponseSync", { enumerable: true, get: function () { return processPartialResponseSync_js_1.processPartialResponseSync; } });
var processPartialResponse_js_1 = require("./processPartialResponse.js");
Object.defineProperty(exports, "processPartialResponse", { enumerable: true, get: function () { return processPartialResponse_js_1.processPartialResponse; } });
var SqsFifoPartialProcessor_js_1 = require("./SqsFifoPartialProcessor.js");

@@ -24,0 +24,0 @@ Object.defineProperty(exports, "SqsFifoPartialProcessor", { enumerable: true, get: function () { return SqsFifoPartialProcessor_js_1.SqsFifoPartialProcessor; } });

@@ -98,3 +98,3 @@ "use strict";

*/
const processPartialResponseSync = (event, recordHandler, processor, options) => {
/* v8 ignore start */ const processPartialResponseSync = (event, recordHandler, processor, options) => {
if (!event.Records || !Array.isArray(event.Records)) {

@@ -106,3 +106,3 @@ throw new errors_js_1.UnexpectedBatchTypeError();

return processor.response();
};
}; /* v8 ignore stop */
exports.processPartialResponseSync = processPartialResponseSync;

@@ -5,5 +5,5 @@ "use strict";

const BatchProcessorSync_js_1 = require("./BatchProcessorSync.js");
const SqsFifoProcessor_js_1 = require("./SqsFifoProcessor.js");
const constants_js_1 = require("./constants.js");
const errors_js_1 = require("./errors.js");
const SqsFifoProcessor_js_1 = require("./SqsFifoProcessor.js");
/**

@@ -10,0 +10,0 @@ * Batch processor for SQS FIFO queues

@@ -5,5 +5,5 @@ "use strict";

const BatchProcessor_js_1 = require("./BatchProcessor.js");
const SqsFifoProcessor_js_1 = require("./SqsFifoProcessor.js");
const constants_js_1 = require("./constants.js");
const errors_js_1 = require("./errors.js");
const SqsFifoProcessor_js_1 = require("./SqsFifoProcessor.js");
/**

@@ -10,0 +10,0 @@ * Batch processor for SQS FIFO queues

@@ -71,13 +71,2 @@ /**

async process() {
/**
* If this is a sync processor, user should have called processSync instead,
* so we call the method early to throw the error early thus failing fast.
*
* The type casting is necessary to ensure that we have test coverage for the
* block of code that throws the error, without having to change the return type
* of the method. This is because this call will always throw an error.
*/
if (this.constructor.name === 'BatchProcessorSync') {
return (await this.processRecord(this.records[0]));
}
this.prepare();

@@ -84,0 +73,0 @@ // Default to `true` if `processInParallel` is not specified.

@@ -83,3 +83,3 @@ import { BasePartialBatchProcessor } from './BasePartialBatchProcessor.js';

*/
class BatchProcessorSync extends BasePartialBatchProcessor {
/* v8 ignore start */ class BatchProcessorSync extends BasePartialBatchProcessor {
/**

@@ -117,3 +117,3 @@ * @throws {BatchProcessingError} This method is not implemented for asynchronous processing.

}
}
} /* v8 ignore stop */
export { BatchProcessorSync };

@@ -1,10 +0,10 @@

export { EventType } from './constants.js';
export { BatchProcessingError, FullBatchFailureError, SqsFifoShortCircuitError, SqsFifoMessageGroupShortCircuitError, UnexpectedBatchTypeError, } from './errors.js';
export { BasePartialBatchProcessor } from './BasePartialBatchProcessor.js';
export { BatchProcessor } from './BatchProcessor.js';
export { BatchProcessorSync } from './BatchProcessorSync.js';
export { BatchProcessor } from './BatchProcessor.js';
export { EventType } from './constants.js';
export { BatchProcessingError, FullBatchFailureError, SqsFifoMessageGroupShortCircuitError, SqsFifoShortCircuitError, UnexpectedBatchTypeError, } from './errors.js';
export { processPartialResponse } from './processPartialResponse.js';
export { processPartialResponseSync } from './processPartialResponseSync.js';
export { processPartialResponse } from './processPartialResponse.js';
export { SqsFifoPartialProcessor } from './SqsFifoPartialProcessor.js';
export { SqsFifoPartialProcessorAsync } from './SqsFifoPartialProcessorAsync.js';
//# sourceMappingURL=index.d.ts.map

@@ -1,9 +0,9 @@

export { EventType } from './constants.js';
export { BatchProcessingError, FullBatchFailureError, SqsFifoShortCircuitError, SqsFifoMessageGroupShortCircuitError, UnexpectedBatchTypeError, } from './errors.js';
export { BasePartialBatchProcessor } from './BasePartialBatchProcessor.js';
export { BatchProcessor } from './BatchProcessor.js';
export { BatchProcessorSync } from './BatchProcessorSync.js';
export { BatchProcessor } from './BatchProcessor.js';
export { EventType } from './constants.js';
export { BatchProcessingError, FullBatchFailureError, SqsFifoMessageGroupShortCircuitError, SqsFifoShortCircuitError, UnexpectedBatchTypeError, } from './errors.js';
export { processPartialResponse } from './processPartialResponse.js';
export { processPartialResponseSync } from './processPartialResponseSync.js';
export { processPartialResponse } from './processPartialResponse.js';
export { SqsFifoPartialProcessor } from './SqsFifoPartialProcessor.js';
export { SqsFifoPartialProcessorAsync } from './SqsFifoPartialProcessorAsync.js';

@@ -95,3 +95,3 @@ import { UnexpectedBatchTypeError } from './errors.js';

*/
const processPartialResponseSync = (event, recordHandler, processor, options) => {
/* v8 ignore start */ const processPartialResponseSync = (event, recordHandler, processor, options) => {
if (!event.Records || !Array.isArray(event.Records)) {

@@ -103,3 +103,3 @@ throw new UnexpectedBatchTypeError();

return processor.response();
};
}; /* v8 ignore stop */
export { processPartialResponseSync };
import { BatchProcessorSync } from './BatchProcessorSync.js';
import { SqsFifoProcessor } from './SqsFifoProcessor.js';
import { EventType } from './constants.js';
import { SqsFifoMessageGroupShortCircuitError, SqsFifoShortCircuitError, } from './errors.js';
import { SqsFifoProcessor } from './SqsFifoProcessor.js';
/**

@@ -6,0 +6,0 @@ * Batch processor for SQS FIFO queues

import { BatchProcessor } from './BatchProcessor.js';
import { SqsFifoProcessor } from './SqsFifoProcessor.js';
import { EventType } from './constants.js';
import { SqsFifoMessageGroupShortCircuitError, SqsFifoShortCircuitError, } from './errors.js';
import { SqsFifoProcessor } from './SqsFifoProcessor.js';
/**

@@ -6,0 +6,0 @@ * Batch processor for SQS FIFO queues

{
"name": "@aws-lambda-powertools/batch",
"version": "2.23.0",
"version": "2.24.0",
"description": "The batch processing package for the Powertools for AWS Lambda (TypeScript) library.",

@@ -5,0 +5,0 @@ "author": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet