@@ -9,8 +9,23 @@ import { ConstructFactory } from '@aws-amplify/plugin-types';
99import { FunctionResources } from ' @aws-amplify/plugin-types' ;
1010import { ResourceAccessAcceptorFactory } from ' @aws-amplify/plugin-types' ;
1111import { ResourceProvider } from ' @aws-amplify/plugin-types' ;
12+ import { S3Client } from ' @aws-sdk/client-s3' ;
1213import { StackProvider } from ' @aws-amplify/plugin-types' ;
1314
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+
1429// @public (undocumented)
1530export type AddEnvironmentFactory = {
1631 addEnvironment: (key : string , value : string | BackendSecret ) => void ;
@@ -19,6 +34,32 @@ export type AddEnvironmentFactory = {
1934// @public (undocumented)
2035export type CronSchedule = ` ${string } ${string } ${string } ${string } ${string } ` | ` ${string } ${string } ${string } ${string } ${string } ${string } ` ;
2136
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+
2263// @public
2364export const defineFunction: (props ? : FunctionProps ) => ConstructFactory <ResourceProvider <FunctionResources > & ResourceAccessAcceptorFactory & AddEnvironmentFactory & StackProvider >;
2465
@@ -43,9 +84,45 @@ export type FunctionProps = {
4384// @public (undocumented)
4485export type FunctionSchedule = TimeInterval | CronSchedule ;
4586
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+
46111// @public (undocumented)
47112export type NodeVersion = 16 | 18 | 20 ;
48113
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+
49126// @public (undocumented)
50127export type TimeInterval = ` every ${number }m ` | ` every ${number }h ` | ` every day ` | ` every week ` | ` every month ` | ` every year ` ;
51128
0 commit comments