Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgraded to AWS SDK v3. #45

Merged
merged 1 commit into from
Aug 10, 2021
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
1 change: 1 addition & 0 deletions subscribers/javascript/all-entitled-datasets/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
engine-strict=true
2 changes: 1 addition & 1 deletion subscribers/javascript/all-entitled-datasets/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# All Entitled Data Sets (JavaScript)

This sample retrieves a list of all subscriber's entitled data sets, in JavaScript.
This sample retrieves a list of all subscriber's entitled data sets, in JavaScript, using AWS SDK v3.

To run the sample, set `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, and optionally `AWS_SESSION_TOKEN`.

Expand Down
10 changes: 5 additions & 5 deletions subscribers/javascript/all-entitled-datasets/index.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import { DataExchange, Credentials } from 'aws-sdk';
import { DataExchange, DataSetEntry } from '@aws-sdk/client-dataexchange'

const dataexchange = new DataExchange({
region: process.env.AWS_REGION || 'us-east-1',
credentials: new Credentials({
credentials: {
accessKeyId: process.env.AWS_ACCESS_KEY_ID,
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
sessionToken: process.env.AWS_SESSION_TOKEN
})
}
});

void async function () {
const entitledDataSets = await dataexchange.listDataSets({ Origin: 'ENTITLED' }).promise();
const entitledDataSets = await dataexchange.listDataSets({ Origin: 'ENTITLED' });

entitledDataSets.DataSets.forEach((dataSet: DataExchange.DataSetEntry) => {
entitledDataSets.DataSets.forEach((dataSet: DataSetEntry) => {
console.log(`${dataSet.OriginDetails.ProductId}/${dataSet.Id}: ${dataSet.Name}\n ${dataSet.Description}`);
});
}();
Loading