Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/aws/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/aws",
"version": "0.7.5",
"version": "0.7.6",
"description": "Pipedream Aws Components",
"main": "aws.app.mjs",
"keywords": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
name: "New DynamoDB Stream Event",
description: "Emit new event when a DynamoDB stream receives new events. [See the docs here](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_GetRecords.html)",
type: "source",
version: "0.0.2",
version: "0.0.3",
dedupe: "unique",
props: {
...common.props,
Expand Down Expand Up @@ -36,6 +36,12 @@ export default {
},
hooks: {
async deploy() {
await this._getNewShardIterator();
},
},
methods: {
...common.methods,
async _getNewShardIterator() {
const { StreamDescription: streamDescription } = await this.listShards({
StreamArn: this.stream,
});
Expand All @@ -46,10 +52,8 @@ export default {
ShardIteratorType: "LATEST",
});
this._setShardIterator(shardIterator);
return shardIterator;
},
},
methods: {
...common.methods,
_getShardIterator() {
return this.db.get("shardIterator");
},
Expand All @@ -71,7 +75,7 @@ export default {
throw new Error("Stream is no longer enabled.");
}

const shardIterator = this._getShardIterator();
const shardIterator = this._getShardIterator() ?? (await this._getNewShardIterator());

const {
Records: records, NextShardIterator: nextShardIterator,
Expand All @@ -84,6 +88,8 @@ export default {
this.$emit(record, meta);
}

this._setShardIterator(nextShardIterator);
if (nextShardIterator) {
this._setShardIterator(nextShardIterator);
}
},
};
2 changes: 2 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading