Skip to content

Commit

Permalink
chore(signature-v4-multi-region): cleanups and docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
siddsriv committed Jul 11, 2024
1 parent c4f2e54 commit a908d87
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
1 change: 0 additions & 1 deletion packages/signature-v4-multi-region/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"@aws-sdk/types": "*",
"@smithy/protocol-http": "^4.0.3",
"@smithy/signature-v4": "^3.1.2",
"@smithy/signature-v4a": "*",
"@smithy/types": "^3.3.0",
"tslib": "^2.6.2"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export class SignatureV4MultiRegion implements RequestPresigner, RequestSigner {
} else {
throw new Error(
"Neither CRT nor JS SigV4a implementation is available. " +
"Please load either @aws-sdk/signature-v4-crt or @smithy/signature-v4a."
"Please load either @aws-sdk/signature-v4-crt or @smithy/signature-v4a."
);
}
}
Expand Down
11 changes: 11 additions & 0 deletions packages/signature-v4-multi-region/src/signature-v4a-container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ import type { HttpRequest, RequestPresigner, RequestSigner, RequestSigningArgume
* @public
*/
export type OptionalSigV4aSigner = {
/**
* This constructor is not typed so as not to require a type import
* from the signature-v4a package.
*
* The true type is SignatureV4a from @smithy/signature-v4a.
*/
new (options: any): RequestPresigner &
RequestSigner & {
signWithCredentials(
Expand All @@ -17,6 +23,11 @@ export type OptionalSigV4aSigner = {

/**
* @public
*
* \@smithy/signature-v4a will install the constructor in this
* container if it is installed.
*
* This avoids a runtime-require being interpreted statically by bundlers.
*/
export const signatureV4aContainer: {
SignatureV4a: null | OptionalSigV4aSigner;
Expand Down

0 comments on commit a908d87

Please sign in to comment.