Skip to content

Commit

Permalink
fix(lib-dynamodb): e2e scenarios WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
kuhe committed Oct 5, 2023
1 parent 7e23cfa commit 8fb23b2
Show file tree
Hide file tree
Showing 8 changed files with 272 additions and 47 deletions.
290 changes: 257 additions & 33 deletions lib/lib-dynamodb/src/test/lib-dynamodb.e2e.spec.ts

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions lib/lib-storage/example-code/file-upload.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { S3 } from "@aws-sdk/client-s3";
import { Upload } from "@aws-sdk/lib-storage";
import * as fs from "fs";

import { Upload } from "@aws-sdk/lib-storage";
import { S3 } from "@aws-sdk/client-s3";
import { configuration } from "./config";

const fileStream = fs.createReadStream(__dirname + "/big.file");
Expand Down
7 changes: 3 additions & 4 deletions lib/lib-storage/example-code/upload-abort.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { S3Client } from "@aws-sdk/client-s3";
import { Upload } from "@aws-sdk/lib-storage";
import { Readable } from "stream";

import { configuration } from "./config";
import { Readable } from "stream";

const Bucket = configuration.Bucket;
const region = "us-west-2";
Expand All @@ -24,7 +23,7 @@ const uploadIndeterminateLengthStreamNode = async () => {
const streamOfUnknownlength = Readable.from(generateContents());

const Key = configuration.Key;
const upload = new Upload({
let upload = new Upload({
client: new S3Client({ region }),
params: {
Key,
Expand All @@ -39,7 +38,7 @@ const uploadIndeterminateLengthStreamNode = async () => {

setTimeout(() => {
console.log(" Aborting ....");
const res = upload.abort();
let res = upload.abort();
}, 10 * 1000);

const uploadResult = await upload.done();
Expand Down
3 changes: 1 addition & 2 deletions lib/lib-storage/example-code/upload-string.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { S3 } from "@aws-sdk/client-s3";
import { Upload } from "@aws-sdk/lib-storage";

import { S3 } from "@aws-sdk/client-s3";
import { configuration } from "./config";

const Bucket = configuration.Bucket;
Expand Down
5 changes: 3 additions & 2 deletions lib/lib-storage/example-code/upload-unknown-length-browser.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { fromCognitoIdentityPool } from "@aws-sdk/credential-provider-cognito-identity";
import { CognitoIdentityClient } from "@aws-sdk/client-cognito-identity";

import { S3Client } from "@aws-sdk/client-s3";
import { fromCognitoIdentityPool } from "@aws-sdk/credential-provider-cognito-identity";
import { Upload } from "@aws-sdk/lib-storage";

import { configuration } from "./config";
Expand Down Expand Up @@ -36,7 +37,7 @@ const uploadIndeterminateLengthStreamBrowser = async () => {

const Key = configuration.Key;

const upload = new Upload({
let upload = new Upload({
client,
params: {
Key,
Expand Down
4 changes: 2 additions & 2 deletions lib/lib-storage/example-code/upload-unknown-length.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { S3Client } from "@aws-sdk/client-s3";
import { Upload } from "@aws-sdk/lib-storage";
import { Readable } from "stream";

import { Readable } from "stream";
import { configuration } from "./config";

const Bucket = configuration.Bucket;
Expand All @@ -23,7 +23,7 @@ const fakeStreamOfUnknownlength = Readable.from(generateContents());

const uploadIndeterminateLengthStreamNode = async () => {
const Key = configuration.Key;
const upload = new Upload({
let upload = new Upload({
client: new S3Client({ region }),
params: {
Key,
Expand Down
3 changes: 3 additions & 0 deletions packages/util-dynamodb/src/marshall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ export interface marshallOptions {
/**
* Whether to convert the top level container
* if it is a map or list.
*
* Default is true when using the DynamoDBDocumentClient,
* but false if directly using the marshall function (backwards compatibility).
*/
convertTopLevelContainer?: boolean;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/util-dynamodb/src/unmarshall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface unmarshallOptions {
* When true, skip wrapping the data in `{ M: data }` before converting.
*
* Default is true when using the DynamoDBDocumentClient,
* but false if only using the unmarshall function.
* but false if directly using the unmarshall function (backwards compatibility)..
*/
convertWithoutMapWrapper?: boolean;
}
Expand Down

0 comments on commit 8fb23b2

Please sign in to comment.