File tree Expand file tree Collapse file tree 6 files changed +56
-7
lines changed
core/src/submodules/httpAuthSchemes/aws_sdk
polly-request-presigner/src Expand file tree Collapse file tree 6 files changed +56
-7
lines changed Original file line number Diff line number Diff line change 11import { setCredentialFeature } from "@aws-sdk/core/client" ;
2- import { AttributedAwsCredentialIdentity } from "@aws-sdk/types" ;
2+ import type { AttributedAwsCredentialIdentity , MergeFunctions } from "@aws-sdk/types" ;
33import {
44 doesIdentityRequireRefresh ,
55 isIdentityExpired ,
@@ -81,9 +81,8 @@ export interface AwsSdkSigV4AuthResolvedConfig {
8181 /**
8282 * Resolved value for input config {@link AwsSdkSigV4AuthInputConfig.credentials}
8383 * This provider MAY memoize the loaded credentials for certain period.
84- * See {@link MemoizedProvider} for more information.
8584 */
86- credentials : AwsCredentialIdentityProvider ;
85+ credentials : MergeFunctions < AwsCredentialIdentityProvider , MemoizedProvider < AwsCredentialIdentity > > ;
8786 /**
8887 * Resolved value for input config {@link AwsSdkSigV4AuthInputConfig.signer}
8988 */
Original file line number Diff line number Diff line change 9898 },
9999 "exports" : {
100100 "./sso-oidc" : {
101+ "types" : " ./dist-types/submodules/sso-oidc/index.d.ts" ,
101102 "module" : " ./dist-es/submodules/sso-oidc/index.js" ,
102103 "node" : " ./dist-cjs/submodules/sso-oidc/index.js" ,
103104 "import" : " ./dist-es/submodules/sso-oidc/index.js" ,
104- "require" : " ./dist-cjs/submodules/sso-oidc/index.js" ,
105- "types" : " ./dist-types/submodules/sso-oidc/index.d.ts"
105+ "require" : " ./dist-cjs/submodules/sso-oidc/index.js"
106106 },
107107 "./sts" : {
108+ "types" : " ./dist-types/submodules/sts/index.d.ts" ,
108109 "module" : " ./dist-es/submodules/sts/index.js" ,
109110 "node" : " ./dist-cjs/submodules/sts/index.js" ,
110111 "import" : " ./dist-es/submodules/sts/index.js" ,
111- "require" : " ./dist-cjs/submodules/sts/index.js" ,
112- "types" : " ./dist-types/submodules/sts/index.d.ts"
112+ "require" : " ./dist-cjs/submodules/sts/index.js"
113113 }
114114 }
115115}
Original file line number Diff line number Diff line change 11import { PollyClient , SynthesizeSpeechCommand } from "@aws-sdk/client-polly" ;
2+ import type { AwsCredentialIdentity , Provider } from "@aws-sdk/types" ;
23import { formatUrl } from "@aws-sdk/util-format-url" ;
34import { HttpRequest } from "@smithy/protocol-http" ;
45import { SignatureV4 } from "@smithy/signature-v4" ;
@@ -8,10 +9,13 @@ export const getSignedUrl = async (
89 command : SynthesizeSpeechCommand ,
910 options : any = { }
1011) : Promise < string > => {
12+ const { credentials } = client . config ;
13+
1114 const signer = new SignatureV4 ( {
1215 service : options . service || "polly" ,
1316 uriEscapePath : options . uriEscapePath || false ,
1417 ...client . config ,
18+ credentials : credentials as Provider < AwsCredentialIdentity > ,
1519 } ) ;
1620
1721 const presignInterceptMiddleware = ( next : any , context : any ) => async ( args : any ) => {
Original file line number Diff line number Diff line change 1+ import { Exact } from "@smithy/types" ;
2+
3+ import type { MergeFunctions } from "./function" ;
4+
5+ {
6+ const function1 = ( { a } : { a : boolean } ) => ( { a : a } ) ;
7+ const function2 = ( { b } : { b : boolean } ) => ( { b : b } ) ;
8+
9+ const function3 : MergeFunctions < typeof function1 , typeof function2 > = null as any ;
10+
11+ // it should merge the first arg and return value objects of function1 and function2
12+ // into function3.
13+
14+ type assert0 = Exact < typeof function3 , ( { a, b } ?: { a : boolean ; b : boolean } ) => { a : boolean ; b : boolean } > ;
15+ const assert0 : assert0 = true as const ;
16+ }
17+
18+ {
19+ const function1 = ( { a } : { a : boolean } ) => Promise . resolve ( { a : a } ) ;
20+ const function2 = ( { b } : { b : boolean } ) => Promise . resolve ( { b : b } ) ;
21+
22+ const function3 : MergeFunctions < typeof function1 , typeof function2 > = null as any ;
23+
24+ // it should merge the first arg and return value objects of function1 and function2
25+ // into function3 while ignoring the async Promise wrapper.
26+
27+ type assert1 = Exact <
28+ typeof function3 ,
29+ ( { a, b } ?: { a : boolean ; b : boolean } ) => Promise < { a : boolean ; b : boolean } >
30+ > ;
31+ const assert1 : assert1 = true as const ;
32+ }
Original file line number Diff line number Diff line change 1+ /**
2+ * Resolves a function that accepts both the object argument fields of F1 and F2.
3+ * The function returns an intersection of what F1 and F2 return.
4+ *
5+ * @public
6+ */
7+ export type MergeFunctions < F1 , F2 > = F1 extends ( arg : infer A1 ) => infer R1
8+ ? F2 extends ( arg : infer A2 ) => infer R2
9+ ? R1 extends Promise < unknown >
10+ ? ( arg ?: A1 & A2 ) => Promise < Awaited < R1 > & Awaited < R2 > >
11+ : ( arg ?: A1 & A2 ) => R1 & R2
12+ : never
13+ : never ;
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ export * from "./endpoint";
1313export * from "./eventStream" ;
1414export * from "./extensions" ;
1515export * from "./feature-ids" ;
16+ export * from "./function" ;
1617export * from "./http" ;
1718export * from "./identity" ;
1819export * from "./logger" ;
You can’t perform that action at this time.
0 commit comments