aws-lambda-stream
Advanced tools
Comparing version
@@ -7,3 +7,3 @@ "use strict"; | ||
}); | ||
exports.toDynamodbRecords = exports.outTtlExpiredEvents = exports.outReplicas = exports.outGlobalTableExtraModify = exports.fromDynamodb = exports.UNKNOWN_DYNAMODB_EVENT_TYPE = void 0; | ||
exports.toDynamodbRecords = exports.outTtlExpiredEvents = exports.outReplicas = exports.outGlobalTableExtraModify = exports.fromDynamodb = exports.ddbApproximateCreationTimestamp = exports.UNKNOWN_DYNAMODB_EVENT_TYPE = void 0; | ||
var _highland = _interopRequireDefault(require("highland")); | ||
@@ -47,3 +47,3 @@ var _utilDynamodb = require("@aws-sdk/util-dynamodb"); | ||
partitionKey: record.dynamodb.Keys[pkFn].S, | ||
timestamp: record.dynamodb.ApproximateCreationDateTime * 1000, | ||
timestamp: deriveTimestamp(record), | ||
tags: { | ||
@@ -96,2 +96,4 @@ region: record.awsRegion | ||
}; | ||
const deriveTimestamp = record => parseInt(record.dynamodb.NewImage?.timestamp?.N, 10) || ddbApproximateCreationTimestamp(record); | ||
const ddbApproximateCreationTimestamp = record => record.dynamodb.ApproximateCreationDateTime * 1000; | ||
@@ -116,3 +118,3 @@ //-------------------------------------------- | ||
// - ${opt:region} | ||
exports.ddbApproximateCreationTimestamp = ddbApproximateCreationTimestamp; | ||
const outReplicas = ignoreReplicas => record => { | ||
@@ -119,0 +121,0 @@ if (!ignoreReplicas) return true; |
{ | ||
"name": "aws-lambda-stream", | ||
"version": "1.0.34", | ||
"version": "1.1.0", | ||
"description": "Create stream processors with AWS Lambda functions.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
249188
0.13%6037
0.05%