@@ -9,8 +9,23 @@ import { ConstructFactory } from '@aws-amplify/plugin-types';
9
9
import { FunctionResources } from ' @aws-amplify/plugin-types' ;
10
10
import { ResourceAccessAcceptorFactory } from ' @aws-amplify/plugin-types' ;
11
11
import { ResourceProvider } from ' @aws-amplify/plugin-types' ;
12
+ import { S3Client } from ' @aws-sdk/client-s3' ;
12
13
import { StackProvider } from ' @aws-amplify/plugin-types' ;
13
14
15
+ declare namespace __export__runtime {
16
+ export {
17
+ getAmplifyDataClientConfig ,
18
+ DataClientConfig ,
19
+ DataClientEnv ,
20
+ DataClientError ,
21
+ DataClientReturn ,
22
+ InvalidConfig ,
23
+ LibraryOptions ,
24
+ ResourceConfig
25
+ }
26
+ }
27
+ export { __export__runtime }
28
+
14
29
// @public (undocumented)
15
30
export type AddEnvironmentFactory = {
16
31
addEnvironment: (key : string , value : string | BackendSecret ) => void ;
@@ -19,6 +34,32 @@ export type AddEnvironmentFactory = {
19
34
// @public (undocumented)
20
35
export type CronSchedule = ` ${string } ${string } ${string } ${string } ${string } ` | ` ${string } ${string } ${string } ${string } ${string } ${string } ` ;
21
36
37
+ // @public (undocumented)
38
+ type DataClientConfig = {
39
+ resourceConfig: ResourceConfig ;
40
+ libraryOptions: LibraryOptions ;
41
+ };
42
+
43
+ // @public (undocumented)
44
+ type DataClientEnv = {
45
+ AMPLIFY_DATA_GRAPHQL_ENDPOINT: string ;
46
+ AMPLIFY_DATA_MODEL_INTROSPECTION_SCHEMA_BUCKET_NAME: string ;
47
+ AMPLIFY_DATA_MODEL_INTROSPECTION_SCHEMA_KEY: string ;
48
+ AWS_ACCESS_KEY_ID: string ;
49
+ AWS_SECRET_ACCESS_KEY: string ;
50
+ AWS_SESSION_TOKEN: string ;
51
+ AWS_REGION: string ;
52
+ };
53
+
54
+ // @public (undocumented)
55
+ type DataClientError = {
56
+ resourceConfig: InvalidConfig ;
57
+ libraryOptions: InvalidConfig ;
58
+ };
59
+
60
+ // @public (undocumented)
61
+ type DataClientReturn <T > = T extends DataClientEnv ? DataClientConfig : DataClientError ;
62
+
22
63
// @public
23
64
export const defineFunction: (props ? : FunctionProps ) => ConstructFactory <ResourceProvider <FunctionResources > & ResourceAccessAcceptorFactory & AddEnvironmentFactory & StackProvider >;
24
65
@@ -43,9 +84,45 @@ export type FunctionProps = {
43
84
// @public (undocumented)
44
85
export type FunctionSchedule = TimeInterval | CronSchedule ;
45
86
87
+ // @public
88
+ const getAmplifyDataClientConfig: <T >(env : T , s3Client ? : S3Client ) => Promise <DataClientReturn <T >>;
89
+
90
+ // @public (undocumented)
91
+ type InvalidConfig = unknown & {
92
+ invalidType: ' This function needs to be granted `authorization((allow) => [allow.resource(fcn)])` on the data schema.' ;
93
+ };
94
+
95
+ // @public (undocumented)
96
+ type LibraryOptions = {
97
+ Auth: {
98
+ credentialsProvider: {
99
+ getCredentialsAndIdentityId: () => Promise <{
100
+ credentials: {
101
+ accessKeyId: string ;
102
+ secretAccessKey: string ;
103
+ sessionToken: string ;
104
+ };
105
+ }>;
106
+ clearCredentialsAndIdentityId: () => void ;
107
+ };
108
+ };
109
+ };
110
+
46
111
// @public (undocumented)
47
112
export type NodeVersion = 16 | 18 | 20 ;
48
113
114
+ // @public (undocumented)
115
+ type ResourceConfig = {
116
+ API: {
117
+ GraphQL: {
118
+ endpoint: string ;
119
+ region: string ;
120
+ defaultAuthMode: string ;
121
+ modelIntrospection: any ;
122
+ };
123
+ };
124
+ };
125
+
49
126
// @public (undocumented)
50
127
export type TimeInterval = ` every ${number }m ` | ` every ${number }h ` | ` every day ` | ` every week ` | ` every month ` | ` every year ` ;
51
128
0 commit comments