@aws-amplify/graphql-transformer-interfaces 3.3.0-rds-5.0 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,23 +20,52 @@ export interface NoneDataSourceProvider {
20
20
  export type DataSourceInstance = ITable | CfnDomain | HttpDataSource | IFunction | NoneDataSourceProvider;
21
21
 
22
22
  export interface TransformerDataSourceManagerProvider {
23
- add(type: ObjectTypeDefinitionNode | InterfaceTypeDefinitionNode, dataSourceInstance: DataSourceInstance): void;
24
- get(type: ObjectTypeDefinitionNode | InterfaceTypeDefinitionNode): DataSourceInstance;
25
- has(name: string): boolean;
23
+ add: (type: ObjectTypeDefinitionNode | InterfaceTypeDefinitionNode, dataSourceInstance: DataSourceInstance) => void;
24
+ get: (type: ObjectTypeDefinitionNode | InterfaceTypeDefinitionNode) => DataSourceInstance;
25
+ has: (name: string) => boolean;
26
26
  }
27
27
 
28
28
  export interface DataSourceProvider extends BackedDataSource {}
29
29
 
30
30
  /**
31
- * Supported transformable database types.
31
+ * Supported transformable database types. TODO: Move this to amplify-graphql-api-construct
32
32
  */
33
- export type DBType = 'DDB' | 'MySQL' | 'Postgres';
33
+ export type DBType = 'DDB' | SQLDBType;
34
34
 
35
35
  /**
36
- * Configuration for a datasource. Defines the underlying database engine, and instructs the tranformer whether to provision the database
37
- * storage or whether it already exists.
36
+ * Supported transformable SQL database types. TODO: Move this to amplify-graphql-api-construct
38
37
  */
39
- export interface DatasourceType {
38
+ export type SQLDBType = 'MySQL' | 'Postgres';
39
+
40
+ // TODO: add strategy for the RDS. TODO: Move this to amplify-graphql-api-construct
41
+ export type DataSourceProvisionStrategy = DynamoDBProvisionStrategy | SQLLambdaModelProvisionStrategy;
42
+
43
+ /**
44
+ * Provisioning configuration for a DynamoDB datasource. TODO: Remove this type in favor of strategy definitions in
45
+ * amplify-graphql-api-construct
46
+ */
47
+ export const enum DynamoDBProvisionStrategy {
48
+ /**
49
+ * Use default CloudFormation resource of `AWS::DynamoDB::Table`
50
+ */
51
+ DEFAULT = 'DEFAULT',
52
+ /**
53
+ * Use custom resource type `Custom::AmplifyDynamoDBTable`
54
+ */
55
+ AMPLIFY_TABLE = 'AMPLIFY_TABLE',
56
+ }
57
+
58
+ // TODO: Remove this type in favor of fully-specified SQLLambdaModelDataSourceStrategy from amplify-graphql-api-construct
59
+ export const enum SQLLambdaModelProvisionStrategy {
60
+ /**
61
+ * A strategy that creates a Lambda to connect to a pre-existing SQL table to resolve model data.
62
+ */
63
+ DEFAULT = 'DEFAULT',
64
+ }
65
+
66
+ // TODO: Replace usages of this type with ModelDataSourceStrategy
67
+ export interface DataSourceType {
40
68
  dbType: DBType;
41
69
  provisionDB: boolean;
70
+ provisionStrategy: DataSourceProvisionStrategy;
42
71
  }