Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@datastream/aws

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@datastream/aws - npm Package Compare versions

Comparing version
0.4.0
to
0.5.0
+18
dynamodb-streams.d.ts
// Copyright 2026 will Farrell, and datastream contributors.
// SPDX-License-Identifier: MIT
import type { DatastreamReadable, StreamOptions } from "@datastream/core";
export function awsDynamoDBStreamsSetClient(
dynamoDBStreamsClient: unknown,
): void;
export function awsDynamoDBStreamsGetRecordsStream(
options: {
client?: unknown;
ShardIterator?: string;
pollingActive?: boolean;
pollingDelay?: number;
[key: string]: unknown;
},
streamOptions?: StreamOptions,
): Promise<DatastreamReadable>;
import {
DynamoDBStreamsClient,
GetRecordsCommand
} from "@aws-sdk/client-dynamodb-streams";
import { awsClientDefaults } from "./client.js";
let client = new DynamoDBStreamsClient(awsClientDefaults);
const awsDynamoDBStreamsSetClient = (dynamoDBStreamsClient) => {
client = dynamoDBStreamsClient;
};
const awsDynamoDBStreamsGetRecordsStream = async (options, streamOptions = {}) => {
const { pollingActive, pollingDelay = 1e3, ...streamsOptions } = options;
async function* command(opts) {
let expectMore = true;
while (expectMore) {
const response = await client.send(new GetRecordsCommand(opts), {
abortSignal: streamOptions.signal
});
const records = response.Records ?? [];
for (const item of records) {
yield item;
}
opts.ShardIterator = response.NextShardIterator;
expectMore = opts.ShardIterator !== null && (pollingActive || records.length > 0);
if (pollingActive && records.length === 0 && pollingDelay > 0) {
await new Promise((resolve) => setTimeout(resolve, pollingDelay));
}
}
}
return command({ ...streamsOptions });
};
var dynamodb_streams_default = {
setClient: awsDynamoDBStreamsSetClient,
getRecordsStream: awsDynamoDBStreamsGetRecordsStream
};
export {
awsDynamoDBStreamsGetRecordsStream,
awsDynamoDBStreamsSetClient,
dynamodb_streams_default as default
};
{
"version": 3,
"sources": ["dynamodb-streams.js"],
"sourcesContent": ["// Copyright 2026 will Farrell, and datastream contributors.\n// SPDX-License-Identifier: MIT\nimport {\n\tDynamoDBStreamsClient,\n\tGetRecordsCommand,\n} from \"@aws-sdk/client-dynamodb-streams\";\nimport { awsClientDefaults } from \"./client.js\";\n\nlet client = new DynamoDBStreamsClient(awsClientDefaults);\nexport const awsDynamoDBStreamsSetClient = (dynamoDBStreamsClient) => {\n\tclient = dynamoDBStreamsClient;\n};\n\nexport const awsDynamoDBStreamsGetRecordsStream = async (\n\toptions,\n\tstreamOptions = {},\n) => {\n\tconst { pollingActive, pollingDelay = 1000, ...streamsOptions } = options;\n\tasync function* command(opts) {\n\t\tlet expectMore = true;\n\t\twhile (expectMore) {\n\t\t\tconst response = await client.send(new GetRecordsCommand(opts), {\n\t\t\t\tabortSignal: streamOptions.signal,\n\t\t\t});\n\t\t\tconst records = response.Records ?? [];\n\t\t\tfor (const item of records) {\n\t\t\t\tyield item;\n\t\t\t}\n\t\t\topts.ShardIterator = response.NextShardIterator;\n\t\t\texpectMore =\n\t\t\t\topts.ShardIterator !== null && (pollingActive || records.length > 0);\n\t\t\tif (pollingActive && records.length === 0 && pollingDelay > 0) {\n\t\t\t\tawait new Promise((resolve) => setTimeout(resolve, pollingDelay));\n\t\t\t}\n\t\t}\n\t}\n\treturn command({ ...streamsOptions });\n};\n\nexport default {\n\tsetClient: awsDynamoDBStreamsSetClient,\n\tgetRecordsStream: awsDynamoDBStreamsGetRecordsStream,\n};\n"],
"mappings": "AAEA;AAAA,EACC;AAAA,EACA;AAAA,OACM;AACP,SAAS,yBAAyB;AAElC,IAAI,SAAS,IAAI,sBAAsB,iBAAiB;AACjD,MAAM,8BAA8B,CAAC,0BAA0B;AACrE,WAAS;AACV;AAEO,MAAM,qCAAqC,OACjD,SACA,gBAAgB,CAAC,MACb;AACJ,QAAM,EAAE,eAAe,eAAe,KAAM,GAAG,eAAe,IAAI;AAClE,kBAAgB,QAAQ,MAAM;AAC7B,QAAI,aAAa;AACjB,WAAO,YAAY;AAClB,YAAM,WAAW,MAAM,OAAO,KAAK,IAAI,kBAAkB,IAAI,GAAG;AAAA,QAC/D,aAAa,cAAc;AAAA,MAC5B,CAAC;AACD,YAAM,UAAU,SAAS,WAAW,CAAC;AACrC,iBAAW,QAAQ,SAAS;AAC3B,cAAM;AAAA,MACP;AACA,WAAK,gBAAgB,SAAS;AAC9B,mBACC,KAAK,kBAAkB,SAAS,iBAAiB,QAAQ,SAAS;AACnE,UAAI,iBAAiB,QAAQ,WAAW,KAAK,eAAe,GAAG;AAC9D,cAAM,IAAI,QAAQ,CAAC,YAAY,WAAW,SAAS,YAAY,CAAC;AAAA,MACjE;AAAA,IACD;AAAA,EACD;AACA,SAAO,QAAQ,EAAE,GAAG,eAAe,CAAC;AACrC;AAEA,IAAO,2BAAQ;AAAA,EACd,WAAW;AAAA,EACX,kBAAkB;AACnB;",
"names": []
}
import {
DynamoDBStreamsClient,
GetRecordsCommand
} from "@aws-sdk/client-dynamodb-streams";
import { awsClientDefaults } from "./client.js";
let client = new DynamoDBStreamsClient(awsClientDefaults);
const awsDynamoDBStreamsSetClient = (dynamoDBStreamsClient) => {
client = dynamoDBStreamsClient;
};
const awsDynamoDBStreamsGetRecordsStream = async (options, streamOptions = {}) => {
const { pollingActive, pollingDelay = 1e3, ...streamsOptions } = options;
async function* command(opts) {
let expectMore = true;
while (expectMore) {
const response = await client.send(new GetRecordsCommand(opts), {
abortSignal: streamOptions.signal
});
const records = response.Records ?? [];
for (const item of records) {
yield item;
}
opts.ShardIterator = response.NextShardIterator;
expectMore = opts.ShardIterator !== null && (pollingActive || records.length > 0);
if (pollingActive && records.length === 0 && pollingDelay > 0) {
await new Promise((resolve) => setTimeout(resolve, pollingDelay));
}
}
}
return command({ ...streamsOptions });
};
var dynamodb_streams_default = {
setClient: awsDynamoDBStreamsSetClient,
getRecordsStream: awsDynamoDBStreamsGetRecordsStream
};
export {
awsDynamoDBStreamsGetRecordsStream,
awsDynamoDBStreamsSetClient,
dynamodb_streams_default as default
};
{
"version": 3,
"sources": ["dynamodb-streams.js"],
"sourcesContent": ["// Copyright 2026 will Farrell, and datastream contributors.\n// SPDX-License-Identifier: MIT\nimport {\n\tDynamoDBStreamsClient,\n\tGetRecordsCommand,\n} from \"@aws-sdk/client-dynamodb-streams\";\nimport { awsClientDefaults } from \"./client.js\";\n\nlet client = new DynamoDBStreamsClient(awsClientDefaults);\nexport const awsDynamoDBStreamsSetClient = (dynamoDBStreamsClient) => {\n\tclient = dynamoDBStreamsClient;\n};\n\nexport const awsDynamoDBStreamsGetRecordsStream = async (\n\toptions,\n\tstreamOptions = {},\n) => {\n\tconst { pollingActive, pollingDelay = 1000, ...streamsOptions } = options;\n\tasync function* command(opts) {\n\t\tlet expectMore = true;\n\t\twhile (expectMore) {\n\t\t\tconst response = await client.send(new GetRecordsCommand(opts), {\n\t\t\t\tabortSignal: streamOptions.signal,\n\t\t\t});\n\t\t\tconst records = response.Records ?? [];\n\t\t\tfor (const item of records) {\n\t\t\t\tyield item;\n\t\t\t}\n\t\t\topts.ShardIterator = response.NextShardIterator;\n\t\t\texpectMore =\n\t\t\t\topts.ShardIterator !== null && (pollingActive || records.length > 0);\n\t\t\tif (pollingActive && records.length === 0 && pollingDelay > 0) {\n\t\t\t\tawait new Promise((resolve) => setTimeout(resolve, pollingDelay));\n\t\t\t}\n\t\t}\n\t}\n\treturn command({ ...streamsOptions });\n};\n\nexport default {\n\tsetClient: awsDynamoDBStreamsSetClient,\n\tgetRecordsStream: awsDynamoDBStreamsGetRecordsStream,\n};\n"],
"mappings": "AAEA;AAAA,EACC;AAAA,EACA;AAAA,OACM;AACP,SAAS,yBAAyB;AAElC,IAAI,SAAS,IAAI,sBAAsB,iBAAiB;AACjD,MAAM,8BAA8B,CAAC,0BAA0B;AACrE,WAAS;AACV;AAEO,MAAM,qCAAqC,OACjD,SACA,gBAAgB,CAAC,MACb;AACJ,QAAM,EAAE,eAAe,eAAe,KAAM,GAAG,eAAe,IAAI;AAClE,kBAAgB,QAAQ,MAAM;AAC7B,QAAI,aAAa;AACjB,WAAO,YAAY;AAClB,YAAM,WAAW,MAAM,OAAO,KAAK,IAAI,kBAAkB,IAAI,GAAG;AAAA,QAC/D,aAAa,cAAc;AAAA,MAC5B,CAAC;AACD,YAAM,UAAU,SAAS,WAAW,CAAC;AACrC,iBAAW,QAAQ,SAAS;AAC3B,cAAM;AAAA,MACP;AACA,WAAK,gBAAgB,SAAS;AAC9B,mBACC,KAAK,kBAAkB,SAAS,iBAAiB,QAAQ,SAAS;AACnE,UAAI,iBAAiB,QAAQ,WAAW,KAAK,eAAe,GAAG;AAC9D,cAAM,IAAI,QAAQ,CAAC,YAAY,WAAW,SAAS,YAAY,CAAC;AAAA,MACjE;AAAA,IACD;AAAA,EACD;AACA,SAAO,QAAQ,EAAE,GAAG,eAAe,CAAC;AACrC;AAEA,IAAO,2BAAQ;AAAA,EACd,WAAW;AAAA,EACX,kBAAkB;AACnB;",
"names": []
}
+16
-16
// Copyright 2026 will Farrell, and datastream contributors.
// SPDX-License-Identifier: MIT
export {
awsCloudWatchLogsFilterLogEventsStream,
awsCloudWatchLogsGetLogEventsStream,
awsCloudWatchLogsFilterLogEventsStream,
awsCloudWatchLogsSetClient,
} from "@datastream/aws/cloudwatch-logs";
export {
awsKinesisGetRecordsStream,
awsKinesisPutRecordsStream,
awsKinesisSetClient,
} from "@datastream/aws/kinesis";
export {
awsS3GetObjectStream,
awsS3PutObjectStream,
awsS3ChecksumStream,
awsS3SetClient,
} from "@datastream/aws/s3";
export {
awsDynamoDBQueryStream,
awsDynamoDBScanStream,
awsDynamoDBDeleteItemStream,
awsDynamoDBExecuteStatementStream,
awsDynamoDBGetItemStream,
awsDynamoDBPutItemStream,
awsDynamoDBDeleteItemStream,
awsDynamoDBQueryStream,
awsDynamoDBScanStream,
awsDynamoDBSetClient,
} from "@datastream/aws/dynamodb";
export {
awsKinesisGetRecordsStream,
awsKinesisPutRecordsStream,
awsKinesisSetClient,
} from "@datastream/aws/kinesis";
export {
awsLambdaReadableStream,

@@ -34,2 +28,8 @@ awsLambdaResponseStream,

export {
awsS3ChecksumStream,
awsS3GetObjectStream,
awsS3PutObjectStream,
awsS3SetClient,
} from "@datastream/aws/s3";
export {
awsSNSPublishMessageStream,

@@ -39,6 +39,6 @@ awsSNSSetClient,

export {
awsSQSDeleteMessageStream,
awsSQSReceiveMessageStream,
awsSQSSendMessageStream,
awsSQSDeleteMessageStream,
awsSQSSetClient,
} from "@datastream/aws/sqs";
export * from "@datastream/aws/cloudwatch-logs";
export * from "@datastream/aws/dynamodb";
export * from "@datastream/aws/dynamodb-streams";
export * from "@datastream/aws/kinesis";

@@ -4,0 +5,0 @@ export * from "@datastream/aws/lambda";

{
"version": 3,
"sources": ["index.js"],
"sourcesContent": ["// Copyright 2026 will Farrell, and datastream contributors.\n// SPDX-License-Identifier: MIT\nexport * from \"@datastream/aws/cloudwatch-logs\";\nexport * from \"@datastream/aws/dynamodb\";\nexport * from \"@datastream/aws/kinesis\";\nexport * from \"@datastream/aws/lambda\";\nexport * from \"@datastream/aws/s3\";\nexport * from \"@datastream/aws/sns\";\nexport * from \"@datastream/aws/sqs\";\n"],
"mappings": "AAEA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
"sourcesContent": ["// Copyright 2026 will Farrell, and datastream contributors.\n// SPDX-License-Identifier: MIT\nexport * from \"@datastream/aws/cloudwatch-logs\";\nexport * from \"@datastream/aws/dynamodb\";\nexport * from \"@datastream/aws/dynamodb-streams\";\nexport * from \"@datastream/aws/kinesis\";\nexport * from \"@datastream/aws/lambda\";\nexport * from \"@datastream/aws/s3\";\nexport * from \"@datastream/aws/sns\";\nexport * from \"@datastream/aws/sqs\";\n"],
"mappings": "AAEA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
"names": []
}
export * from "@datastream/aws/cloudwatch-logs";
export * from "@datastream/aws/dynamodb";
export * from "@datastream/aws/dynamodb-streams";
export * from "@datastream/aws/kinesis";

@@ -4,0 +5,0 @@ export * from "@datastream/aws/lambda";

{
"version": 3,
"sources": ["index.js"],
"sourcesContent": ["// Copyright 2026 will Farrell, and datastream contributors.\n// SPDX-License-Identifier: MIT\nexport * from \"@datastream/aws/cloudwatch-logs\";\nexport * from \"@datastream/aws/dynamodb\";\nexport * from \"@datastream/aws/kinesis\";\nexport * from \"@datastream/aws/lambda\";\nexport * from \"@datastream/aws/s3\";\nexport * from \"@datastream/aws/sns\";\nexport * from \"@datastream/aws/sqs\";\n"],
"mappings": "AAEA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
"sourcesContent": ["// Copyright 2026 will Farrell, and datastream contributors.\n// SPDX-License-Identifier: MIT\nexport * from \"@datastream/aws/cloudwatch-logs\";\nexport * from \"@datastream/aws/dynamodb\";\nexport * from \"@datastream/aws/dynamodb-streams\";\nexport * from \"@datastream/aws/kinesis\";\nexport * from \"@datastream/aws/lambda\";\nexport * from \"@datastream/aws/s3\";\nexport * from \"@datastream/aws/sns\";\nexport * from \"@datastream/aws/sqs\";\n"],
"mappings": "AAEA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
"names": []
}
{
"name": "@datastream/aws",
"version": "0.4.0",
"description": "AWS service streaming integrations for CloudWatch Logs, DynamoDB, Kinesis, Lambda, S3, SNS, and SQS",
"version": "0.5.0",
"description": "AWS service streaming integrations for CloudWatch Logs, DynamoDB, DynamoDB Streams, Kinesis, Lambda, S3, SNS, and SQS",
"type": "module",

@@ -40,2 +40,14 @@ "engines": {

},
"./dynamodb-streams": {
"node": {
"import": {
"types": "./dynamodb-streams.d.ts",
"default": "./dynamodb-streams.node.mjs"
}
},
"import": {
"types": "./dynamodb-streams.d.ts",
"default": "./dynamodb-streams.web.mjs"
}
},
"./lambda": {

@@ -130,2 +142,3 @@ "node": {

"DynamoDB",
"DynamoDB Streams",
"Kinesis",

@@ -153,3 +166,3 @@ "Lambda",

"dependencies": {
"@datastream/core": "0.4.0"
"@datastream/core": "0.5.0"
},

@@ -159,2 +172,3 @@ "peerDependencies": {

"@aws-sdk/client-dynamodb": "^3.0.0",
"@aws-sdk/client-dynamodb-streams": "^3.0.0",
"@aws-sdk/client-kinesis": "^3.0.0",

@@ -175,2 +189,5 @@ "@aws-sdk/client-lambda": "^3.0.0",

},
"@aws-sdk/client-dynamodb-streams": {
"optional": true
},
"@aws-sdk/client-kinesis": {

@@ -201,2 +218,3 @@ "optional": true

"@aws-sdk/client-dynamodb": "^3.0.0",
"@aws-sdk/client-dynamodb-streams": "^3.0.0",
"@aws-sdk/client-kinesis": "^3.0.0",

@@ -203,0 +221,0 @@ "@aws-sdk/client-lambda": "^3.0.0",

<div align="center">
<h1>&lt;datastream&gt; `aws`</h1>
<img alt="datastream logo" src="https://raw.githubusercontent.com/willfarrell/datastream/main/docs/img/datastream-logo.svg"/>
<p><strong>AWS service streams for CloudWatch Logs, DynamoDB, Kinesis, Lambda, S3, SNS, and SQS.</strong></p>
<p><strong>AWS service streams for CloudWatch Logs, DynamoDB, DynamoDB Streams, Kinesis, Lambda, S3, SNS, and SQS.</strong></p>
<p>

@@ -6,0 +6,0 @@ <a href="https://github.com/willfarrell/datastream/actions/workflows/test-unit.yml"><img src="https://github.com/willfarrell/datastream/actions/workflows/test-unit.yml/badge.svg" alt="GitHub Actions unit test status"></a>