4
4
5
5
``` ts
6
6
7
+ import { BackendSecret } from ' @aws-amplify/plugin-types' ;
8
+ import { ConstructFactory } from ' @aws-amplify/plugin-types' ;
9
+ import { FunctionResources } from ' @aws-amplify/plugin-types' ;
10
+ import { ResourceAccessAcceptorFactory } from ' @aws-amplify/plugin-types' ;
11
+ import { ResourceProvider } from ' @aws-amplify/plugin-types' ;
7
12
import { S3Client } from ' @aws-sdk/client-s3' ;
13
+ import { StackProvider } from ' @aws-amplify/plugin-types' ;
8
14
9
- declare namespace __export__get_amplify_clients_configuration {
15
+ declare namespace __export__runtime {
10
16
export {
17
+ getAmplifyDataClientConfig ,
18
+ DataClientConfig ,
11
19
DataClientEnv ,
12
- getResourceConfig ,
13
- getLibraryOptions ,
14
- InvalidConfig ,
15
20
DataClientError ,
16
- DataClientConfig ,
17
21
DataClientReturn ,
18
- getAmplifyDataClientConfig
19
- }
20
- }
21
- export { __export__get_amplify_clients_configuration }
22
-
23
- declare namespace __export__runtime {
24
- export {
25
- getAmplifyDataClientConfig
22
+ InvalidConfig ,
23
+ LibraryOptions ,
24
+ ResourceConfig
26
25
}
27
26
}
28
27
export { __export__runtime }
29
28
29
+ // @public (undocumented)
30
+ export type AddEnvironmentFactory = {
31
+ addEnvironment: (key : string , value : string | BackendSecret ) => void ;
32
+ };
33
+
34
+ // @public (undocumented)
35
+ export type CronSchedule = ` ${string } ${string } ${string } ${string } ${string } ` | ` ${string } ${string } ${string } ${string } ${string } ${string } ` ;
36
+
30
37
// @public (undocumented)
31
38
type DataClientConfig = {
32
- resourceConfig: ReturnType < typeof getResourceConfig > ;
33
- libraryOptions: ReturnType < typeof getLibraryOptions > ;
39
+ resourceConfig: ResourceConfig ;
40
+ libraryOptions: LibraryOptions ;
34
41
};
35
42
36
43
// @public (undocumented)
@@ -54,10 +61,39 @@ type DataClientError = {
54
61
type DataClientReturn <T > = T extends DataClientEnv ? DataClientConfig : DataClientError ;
55
62
56
63
// @public
57
- const getAmplifyDataClientConfig: <T >(env : T , s3Client ? : S3Client ) => Promise <DataClientReturn <T >>;
64
+ export const defineFunction: (props ? : FunctionProps ) => ConstructFactory <ResourceProvider <FunctionResources > & ResourceAccessAcceptorFactory & AddEnvironmentFactory & StackProvider >;
65
+
66
+ // @public (undocumented)
67
+ export type FunctionBundlingOptions = {
68
+ minify? : boolean ;
69
+ };
70
+
71
+ // @public (undocumented)
72
+ export type FunctionProps = {
73
+ name? : string ;
74
+ entry? : string ;
75
+ timeoutSeconds? : number ;
76
+ memoryMB? : number ;
77
+ environment? : Record <string , string | BackendSecret >;
78
+ runtime? : NodeVersion ;
79
+ schedule? : FunctionSchedule | FunctionSchedule [];
80
+ layers? : Record <string , string >;
81
+ bundling? : FunctionBundlingOptions ;
82
+ };
83
+
84
+ // @public (undocumented)
85
+ export type FunctionSchedule = TimeInterval | CronSchedule ;
58
86
59
87
// @public
60
- const getLibraryOptions: (env : DataClientEnv ) => {
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 = {
61
97
Auth: {
62
98
credentialsProvider: {
63
99
getCredentialsAndIdentityId: () => Promise <{
@@ -72,22 +108,23 @@ const getLibraryOptions: (env: DataClientEnv) => {
72
108
};
73
109
};
74
110
75
- // @public
76
- const getResourceConfig: (env : DataClientEnv , modelIntrospectionSchema : object ) => {
111
+ // @public (undocumented)
112
+ export type NodeVersion = 16 | 18 | 20 ;
113
+
114
+ // @public (undocumented)
115
+ type ResourceConfig = {
77
116
API: {
78
117
GraphQL: {
79
118
endpoint: string ;
80
119
region: string ;
81
- defaultAuthMode: " iam " ;
120
+ defaultAuthMode: string ;
82
121
modelIntrospection: any ;
83
122
};
84
123
};
85
124
};
86
125
87
126
// @public (undocumented)
88
- type InvalidConfig = unknown & {
89
- invalidType: ' This function needs to be granted `authorization((allow) => [allow.resource(fcn)])` on the data schema.' ;
90
- };
127
+ export type TimeInterval = ` every ${number }m ` | ` every ${number }h ` | ` every day ` | ` every week ` | ` every month ` | ` every year ` ;
91
128
92
129
// (No @packageDocumentation comment for this package)
93
130
0 commit comments