Skip to content

lib-storage Upload constructor params type incorrect #7311

@kuhe

Description

@kuhe

Checkboxes for prior research

Describe the bug

The type annotation for the Upload constructor input is incorrect, and is not only the input type of PutObject.

It is actually composite of the PutObject, CreateMultipartUpload, UploadPart, and CompleteMultipartUpload inputs, since the params are passed into all of these operations when the Upload class executes them on behalf of the caller.

Regression Issue

  • Select this option if this issue appears to be a regression.

SDK version number

@aws-sdk/package-name@version, ...

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

n/a

Reproduction Steps

--

Observed Behavior

--

Expected Behavior

--

Possible Solution

Update the type declaration to be an intersection of all the types.

Perhaps this:

params: PutObjectCommandInput & Partial<CreateMultipartUploadCommandInput & UploadPartCommandInput & CompleteMultipartUploadCommandInput>

Additional Information/Context

Noticed while responding to internal ticket V1879798411.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.needs-triageThis issue or PR still needs to be triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions