@aws-amplify/graphql-api-construct 1.4.2 → 1.5.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.
Files changed (251) hide show
  1. package/.jsii +367 -278
  2. package/API.md +14 -3
  3. package/CHANGELOG.md +18 -0
  4. package/README.md +210 -20
  5. package/lib/amplify-dynamodb-table-wrapper.js +1 -1
  6. package/lib/amplify-graphql-api.d.ts +0 -7
  7. package/lib/amplify-graphql-api.js +18 -65
  8. package/lib/amplify-graphql-definition.d.ts +4 -15
  9. package/lib/amplify-graphql-definition.js +33 -30
  10. package/lib/index.d.ts +2 -1
  11. package/lib/index.js +16 -1
  12. package/lib/internal/data-source-config.d.ts +22 -9
  13. package/lib/internal/data-source-config.js +150 -39
  14. package/lib/internal/model-type-name.d.ts +3 -3
  15. package/lib/internal/model-type-name.js +7 -7
  16. package/lib/model-datasource-strategy-types.d.ts +122 -0
  17. package/lib/model-datasource-strategy-types.js +10 -0
  18. package/lib/sql-model-datasource-strategy.d.ts +1 -1
  19. package/lib/sql-model-datasource-strategy.js +4 -4
  20. package/lib/types.d.ts +12 -119
  21. package/lib/types.js +1 -1
  22. package/node_modules/@aws-amplify/graphql-auth-transformer/CHANGELOG.md +10 -0
  23. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/graphql-auth-transformer.d.ts.map +1 -1
  24. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/graphql-auth-transformer.js +6 -10
  25. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/graphql-auth-transformer.js.map +1 -1
  26. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/validations.js +1 -1
  27. package/node_modules/@aws-amplify/graphql-auth-transformer/package.json +16 -12
  28. package/node_modules/@aws-amplify/graphql-default-value-transformer/CHANGELOG.md +10 -0
  29. package/node_modules/@aws-amplify/graphql-default-value-transformer/lib/graphql-default-value-transformer.d.ts.map +1 -1
  30. package/node_modules/@aws-amplify/graphql-default-value-transformer/lib/graphql-default-value-transformer.js +2 -7
  31. package/node_modules/@aws-amplify/graphql-default-value-transformer/lib/graphql-default-value-transformer.js.map +1 -1
  32. package/node_modules/@aws-amplify/graphql-default-value-transformer/package.json +13 -9
  33. package/node_modules/@aws-amplify/graphql-function-transformer/CHANGELOG.md +10 -0
  34. package/node_modules/@aws-amplify/graphql-function-transformer/lib/graphql-function-transformer.d.ts.map +1 -1
  35. package/node_modules/@aws-amplify/graphql-function-transformer/lib/graphql-function-transformer.js +7 -0
  36. package/node_modules/@aws-amplify/graphql-function-transformer/lib/graphql-function-transformer.js.map +1 -1
  37. package/node_modules/@aws-amplify/graphql-function-transformer/package.json +11 -7
  38. package/node_modules/@aws-amplify/graphql-http-transformer/CHANGELOG.md +8 -0
  39. package/node_modules/@aws-amplify/graphql-http-transformer/package.json +11 -7
  40. package/node_modules/@aws-amplify/graphql-index-transformer/CHANGELOG.md +10 -0
  41. package/node_modules/@aws-amplify/graphql-index-transformer/lib/graphql-primary-key-transformer.d.ts.map +1 -1
  42. package/node_modules/@aws-amplify/graphql-index-transformer/lib/graphql-primary-key-transformer.js +4 -4
  43. package/node_modules/@aws-amplify/graphql-index-transformer/lib/graphql-primary-key-transformer.js.map +1 -1
  44. package/node_modules/@aws-amplify/graphql-index-transformer/lib/resolvers/resolvers.d.ts +3 -5
  45. package/node_modules/@aws-amplify/graphql-index-transformer/lib/resolvers/resolvers.d.ts.map +1 -1
  46. package/node_modules/@aws-amplify/graphql-index-transformer/lib/resolvers/resolvers.js +12 -34
  47. package/node_modules/@aws-amplify/graphql-index-transformer/lib/resolvers/resolvers.js.map +1 -1
  48. package/node_modules/@aws-amplify/graphql-index-transformer/package.json +13 -9
  49. package/node_modules/@aws-amplify/graphql-maps-to-transformer/CHANGELOG.md +10 -0
  50. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/assets/mapping-lambda.zip +0 -0
  51. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-maps-to-transformer.d.ts.map +1 -1
  52. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-maps-to-transformer.js +3 -4
  53. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-maps-to-transformer.js.map +1 -1
  54. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-refers-to-transformer.d.ts.map +1 -1
  55. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-refers-to-transformer.js +3 -3
  56. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-refers-to-transformer.js.map +1 -1
  57. package/node_modules/@aws-amplify/graphql-maps-to-transformer/package.json +16 -12
  58. package/node_modules/@aws-amplify/graphql-model-transformer/API.md +16 -0
  59. package/node_modules/@aws-amplify/graphql-model-transformer/CHANGELOG.md +13 -0
  60. package/node_modules/@aws-amplify/graphql-model-transformer/lib/graphql-model-transformer.d.ts +1 -3
  61. package/node_modules/@aws-amplify/graphql-model-transformer/lib/graphql-model-transformer.d.ts.map +1 -1
  62. package/node_modules/@aws-amplify/graphql-model-transformer/lib/graphql-model-transformer.js +61 -68
  63. package/node_modules/@aws-amplify/graphql-model-transformer/lib/graphql-model-transformer.js.map +1 -1
  64. package/node_modules/@aws-amplify/graphql-model-transformer/lib/index.d.ts +1 -0
  65. package/node_modules/@aws-amplify/graphql-model-transformer/lib/index.d.ts.map +1 -1
  66. package/node_modules/@aws-amplify/graphql-model-transformer/lib/index.js +3 -1
  67. package/node_modules/@aws-amplify/graphql-model-transformer/lib/index.js.map +1 -1
  68. package/node_modules/@aws-amplify/graphql-model-transformer/lib/rds-lambda.zip +0 -0
  69. package/node_modules/@aws-amplify/graphql-model-transformer/lib/rds-notification-lambda.zip +0 -0
  70. package/node_modules/@aws-amplify/graphql-model-transformer/lib/rds-patching-lambda.zip +0 -0
  71. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/resolver.d.ts +8 -8
  72. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/resolver.d.ts.map +1 -1
  73. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/resolver.js +32 -36
  74. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/resolver.js.map +1 -1
  75. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/rds-model-resource-generator.d.ts +3 -2
  76. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/rds-model-resource-generator.d.ts.map +1 -1
  77. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/rds-model-resource-generator.js +70 -34
  78. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/rds-model-resource-generator.js.map +1 -1
  79. package/node_modules/@aws-amplify/graphql-model-transformer/package.json +15 -10
  80. package/node_modules/@aws-amplify/graphql-predictions-transformer/CHANGELOG.md +8 -0
  81. package/node_modules/@aws-amplify/graphql-predictions-transformer/lib/predictionsLambdaFunction.zip +0 -0
  82. package/node_modules/@aws-amplify/graphql-predictions-transformer/package.json +11 -7
  83. package/node_modules/@aws-amplify/graphql-relational-transformer/API.md +2 -2
  84. package/node_modules/@aws-amplify/graphql-relational-transformer/CHANGELOG.md +12 -0
  85. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-belongs-to-transformer.d.ts.map +1 -1
  86. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-belongs-to-transformer.js +14 -7
  87. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-belongs-to-transformer.js.map +1 -1
  88. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-has-many-transformer.d.ts.map +1 -1
  89. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-has-many-transformer.js +6 -6
  90. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-has-many-transformer.js.map +1 -1
  91. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-has-one-transformer.js +6 -6
  92. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-has-one-transformer.js.map +1 -1
  93. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-many-to-many-transformer.d.ts.map +1 -1
  94. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-many-to-many-transformer.js +8 -1
  95. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-many-to-many-transformer.js.map +1 -1
  96. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/ddb-generator.d.ts.map +1 -1
  97. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/ddb-generator.js +5 -3
  98. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/ddb-generator.js.map +1 -1
  99. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/generator-factory.d.ts +2 -2
  100. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/generator-factory.d.ts.map +1 -1
  101. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/generator-factory.js.map +1 -1
  102. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/rds-generator.d.ts.map +1 -1
  103. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/rds-generator.js +18 -6
  104. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/rds-generator.js.map +1 -1
  105. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/utils.d.ts +18 -18
  106. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/utils.d.ts.map +1 -1
  107. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/utils.js +54 -54
  108. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/utils.js.map +1 -1
  109. package/node_modules/@aws-amplify/graphql-relational-transformer/package.json +14 -10
  110. package/node_modules/@aws-amplify/graphql-searchable-transformer/CHANGELOG.md +10 -0
  111. package/node_modules/@aws-amplify/graphql-searchable-transformer/lib/graphql-searchable-transformer.js +1 -1
  112. package/node_modules/@aws-amplify/graphql-searchable-transformer/lib/streaming-lambda.zip +0 -0
  113. package/node_modules/@aws-amplify/graphql-searchable-transformer/package.json +12 -8
  114. package/node_modules/@aws-amplify/graphql-sql-transformer/CHANGELOG.md +12 -0
  115. package/node_modules/@aws-amplify/graphql-sql-transformer/lib/graphql-sql-transformer.d.ts.map +1 -1
  116. package/node_modules/@aws-amplify/graphql-sql-transformer/lib/graphql-sql-transformer.js +32 -12
  117. package/node_modules/@aws-amplify/graphql-sql-transformer/lib/graphql-sql-transformer.js.map +1 -1
  118. package/node_modules/@aws-amplify/graphql-sql-transformer/package.json +12 -8
  119. package/node_modules/@aws-amplify/graphql-transformer/API.md +4 -16
  120. package/node_modules/@aws-amplify/graphql-transformer/CHANGELOG.md +10 -0
  121. package/node_modules/@aws-amplify/graphql-transformer/lib/graphql-transformer.d.ts +4 -13
  122. package/node_modules/@aws-amplify/graphql-transformer/lib/graphql-transformer.d.ts.map +1 -1
  123. package/node_modules/@aws-amplify/graphql-transformer/lib/graphql-transformer.js +8 -14
  124. package/node_modules/@aws-amplify/graphql-transformer/lib/graphql-transformer.js.map +1 -1
  125. package/node_modules/@aws-amplify/graphql-transformer/package.json +20 -16
  126. package/node_modules/@aws-amplify/graphql-transformer/src/graphql-transformer.ts +30 -54
  127. package/node_modules/@aws-amplify/graphql-transformer-core/API.md +128 -31
  128. package/node_modules/@aws-amplify/graphql-transformer-core/CHANGELOG.md +13 -0
  129. package/node_modules/@aws-amplify/graphql-transformer-core/lib/index.d.ts +3 -3
  130. package/node_modules/@aws-amplify/graphql-transformer-core/lib/index.d.ts.map +1 -1
  131. package/node_modules/@aws-amplify/graphql-transformer-core/lib/index.js +34 -16
  132. package/node_modules/@aws-amplify/graphql-transformer-core/lib/index.js.map +1 -1
  133. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/index.d.ts +1 -1
  134. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/index.d.ts.map +1 -1
  135. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/index.js +4 -2
  136. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/index.js.map +1 -1
  137. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/transform.d.ts +6 -12
  138. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/transform.d.ts.map +1 -1
  139. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/transform.js +16 -5
  140. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/transform.js.map +1 -1
  141. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/types.d.ts +0 -8
  142. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/types.d.ts.map +1 -1
  143. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/utils.d.ts +12 -10
  144. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/utils.d.ts.map +1 -1
  145. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/utils.js +94 -39
  146. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/utils.js.map +1 -1
  147. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/index.d.ts +18 -12
  148. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/index.d.ts.map +1 -1
  149. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/index.js +13 -15
  150. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/index.js.map +1 -1
  151. package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/import-appsync-api-types.d.ts +1 -4
  152. package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/import-appsync-api-types.d.ts.map +1 -1
  153. package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/import-appsync-api-types.js +1 -4
  154. package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/import-appsync-api-types.js.map +1 -1
  155. package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/index.d.ts +2 -1
  156. package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/index.d.ts.map +1 -1
  157. package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/index.js +16 -4
  158. package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/index.js.map +1 -1
  159. package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/model-datasource-strategies.d.ts +7 -0
  160. package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/model-datasource-strategies.d.ts.map +1 -0
  161. package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/model-datasource-strategies.js +15 -0
  162. package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/model-datasource-strategies.js.map +1 -0
  163. package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/types.d.ts.map +1 -1
  164. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/graphql-utils.d.ts +28 -0
  165. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/graphql-utils.d.ts.map +1 -0
  166. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/graphql-utils.js +39 -0
  167. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/graphql-utils.js.map +1 -0
  168. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/index.d.ts +5 -4
  169. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/index.d.ts.map +1 -1
  170. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/index.js +21 -12
  171. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/index.js.map +1 -1
  172. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/model-datasource-strategy-utils.d.ts +14 -0
  173. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/model-datasource-strategy-utils.d.ts.map +1 -0
  174. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/model-datasource-strategy-utils.js +96 -0
  175. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/model-datasource-strategy-utils.js.map +1 -0
  176. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/rds-util.d.ts +0 -10
  177. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/rds-util.d.ts.map +1 -1
  178. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/rds-util.js +1 -58
  179. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/rds-util.js.map +1 -1
  180. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/resource-name.d.ts +22 -0
  181. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/resource-name.d.ts.map +1 -1
  182. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/resource-name.js +28 -1
  183. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/resource-name.js.map +1 -1
  184. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/schema-utils.d.ts +2 -2
  185. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/schema-utils.d.ts.map +1 -1
  186. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/schema-utils.js +7 -6
  187. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/schema-utils.js.map +1 -1
  188. package/node_modules/@aws-amplify/graphql-transformer-core/package.json +9 -5
  189. package/node_modules/@aws-amplify/graphql-transformer-interfaces/API.md +88 -40
  190. package/node_modules/@aws-amplify/graphql-transformer-interfaces/CHANGELOG.md +10 -0
  191. package/node_modules/@aws-amplify/graphql-transformer-interfaces/LICENSE +201 -0
  192. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/graphql-api-provider.d.ts +0 -17
  193. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/graphql-api-provider.d.ts.map +1 -1
  194. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/graphql-api-provider.js.map +1 -1
  195. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/index.d.ts +2 -1
  196. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/index.d.ts.map +1 -1
  197. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/index.js +1 -0
  198. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/index.js.map +1 -1
  199. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/model-datasource/index.d.ts +2 -0
  200. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/model-datasource/index.d.ts.map +1 -0
  201. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/model-datasource/index.js +18 -0
  202. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/model-datasource/index.js.map +1 -0
  203. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/model-datasource/types.d.ts +59 -0
  204. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/model-datasource/types.d.ts.map +1 -0
  205. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/model-datasource/types.js +3 -0
  206. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/model-datasource/types.js.map +1 -0
  207. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transform-host-provider.d.ts +2 -1
  208. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transform-host-provider.d.ts.map +1 -1
  209. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/index.d.ts +2 -2
  210. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/index.d.ts.map +1 -1
  211. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/index.js +1 -3
  212. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/index.js.map +1 -1
  213. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/transformer-context-provider.d.ts +12 -17
  214. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/transformer-context-provider.d.ts.map +1 -1
  215. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/transformer-datasource-provider.d.ts +0 -15
  216. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/transformer-datasource-provider.d.ts.map +1 -1
  217. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/transformer-datasource-provider.js +1 -10
  218. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/transformer-datasource-provider.js.map +1 -1
  219. package/node_modules/@aws-amplify/graphql-transformer-interfaces/package.json +8 -3
  220. package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/graphql-api-provider.ts +1 -41
  221. package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/index.ts +1 -4
  222. package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/model-datasource/index.ts +1 -0
  223. package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/model-datasource/types.ts +195 -0
  224. package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/transform-host-provider.ts +1 -1
  225. package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/transformer-context/index.ts +4 -9
  226. package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/transformer-context/transformer-context-provider.ts +15 -23
  227. package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/transformer-context/transformer-datasource-provider.ts +0 -43
  228. package/node_modules/@aws-amplify/graphql-transformer-interfaces/tsconfig.tsbuildinfo +1 -1
  229. package/node_modules/graphql-mapping-template/CHANGELOG.md +4 -0
  230. package/node_modules/graphql-mapping-template/LICENSE +201 -0
  231. package/node_modules/graphql-mapping-template/package.json +8 -3
  232. package/node_modules/graphql-transformer-common/API.md +0 -15
  233. package/node_modules/graphql-transformer-common/CHANGELOG.md +6 -0
  234. package/node_modules/graphql-transformer-common/lib/ResourceConstants.d.ts +0 -15
  235. package/node_modules/graphql-transformer-common/lib/ResourceConstants.d.ts.map +1 -1
  236. package/node_modules/graphql-transformer-common/lib/ResourceConstants.js +0 -15
  237. package/node_modules/graphql-transformer-common/lib/ResourceConstants.js.map +1 -1
  238. package/node_modules/graphql-transformer-common/package.json +7 -3
  239. package/package.json +24 -19
  240. package/src/amplify-graphql-api.ts +19 -76
  241. package/src/amplify-graphql-definition.ts +47 -30
  242. package/src/index.ts +2 -10
  243. package/src/internal/data-source-config.ts +195 -47
  244. package/src/internal/model-type-name.ts +5 -4
  245. package/src/model-datasource-strategy-types.ts +157 -0
  246. package/src/sql-model-datasource-strategy.ts +3 -3
  247. package/src/types.ts +13 -144
  248. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/provision-strategy-utils.d.ts +0 -3
  249. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/provision-strategy-utils.d.ts.map +0 -1
  250. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/provision-strategy-utils.js +0 -15
  251. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/provision-strategy-utils.js.map +0 -1
@@ -0,0 +1,59 @@
1
+ export type ModelDataSourceStrategy = DefaultDynamoDbModelDataSourceStrategy | AmplifyDynamoDbModelDataSourceStrategy | SQLLambdaModelDataSourceStrategy;
2
+ export interface ModelDataSourceStrategyBase {
3
+ dbType: ModelDataSourceStrategyDbType;
4
+ }
5
+ export type ModelDataSourceStrategyDbType = 'DYNAMODB' | ModelDataSourceStrategySqlDbType;
6
+ export type ModelDataSourceStrategySqlDbType = 'MYSQL' | 'POSTGRES';
7
+ export interface DefaultDynamoDbModelDataSourceStrategy extends ModelDataSourceStrategyBase {
8
+ readonly dbType: 'DYNAMODB';
9
+ readonly provisionStrategy: 'DEFAULT';
10
+ }
11
+ export interface AmplifyDynamoDbModelDataSourceStrategy extends ModelDataSourceStrategyBase {
12
+ readonly dbType: 'DYNAMODB';
13
+ readonly provisionStrategy: 'AMPLIFY_TABLE';
14
+ }
15
+ export interface SQLLambdaModelDataSourceStrategy extends ModelDataSourceStrategyBase {
16
+ readonly name: string;
17
+ readonly dbType: ModelDataSourceStrategySqlDbType;
18
+ readonly dbConnectionConfig: SqlModelDataSourceDbConnectionConfig;
19
+ readonly vpcConfiguration?: VpcConfig;
20
+ readonly sqlLambdaProvisionedConcurrencyConfig?: ProvisionedConcurrencyConfig;
21
+ }
22
+ export interface VpcConfig {
23
+ readonly vpcId: string;
24
+ readonly securityGroupIds: string[];
25
+ readonly subnetAvailabilityZoneConfig: SubnetAvailabilityZone[];
26
+ }
27
+ export interface ProvisionedConcurrencyConfig {
28
+ readonly provisionedConcurrentExecutions: number;
29
+ }
30
+ export interface SubnetAvailabilityZone {
31
+ readonly subnetId: string;
32
+ readonly availabilityZone: string;
33
+ }
34
+ export interface SqlModelDataSourceDbConnectionConfig {
35
+ readonly hostnameSsmPath: string;
36
+ readonly portSsmPath: string;
37
+ readonly usernameSsmPath: string;
38
+ readonly passwordSsmPath: string;
39
+ readonly databaseNameSsmPath: string;
40
+ }
41
+ export interface SqlDirectiveDataSourceStrategy {
42
+ readonly typeName: 'Query' | 'Mutation';
43
+ readonly fieldName: string;
44
+ readonly strategy: SQLLambdaModelDataSourceStrategy;
45
+ readonly customSqlStatements?: Record<string, string>;
46
+ }
47
+ export interface DataSourceStrategiesProvider {
48
+ dataSourceStrategies: Record<string, ModelDataSourceStrategy>;
49
+ sqlDirectiveDataSourceStrategies?: SqlDirectiveDataSourceStrategy[];
50
+ }
51
+ export interface RDSLayerMapping {
52
+ readonly [key: string]: {
53
+ layerRegion: string;
54
+ };
55
+ }
56
+ export interface RDSLayerMappingProvider {
57
+ rdsLayerMapping?: RDSLayerMapping;
58
+ }
59
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/model-datasource/types.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,uBAAuB,GAC/B,sCAAsC,GACtC,sCAAsC,GACtC,gCAAgC,CAAC;AAErC,MAAM,WAAW,2BAA2B;IAC1C,MAAM,EAAE,6BAA6B,CAAC;CACvC;AAKD,MAAM,MAAM,6BAA6B,GAAG,UAAU,GAAG,gCAAgC,CAAC;AAK1F,MAAM,MAAM,gCAAgC,GAAG,OAAO,GAAG,UAAU,CAAC;AAKpE,MAAM,WAAW,sCAAuC,SAAQ,2BAA2B;IACzF,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,QAAQ,CAAC,iBAAiB,EAAE,SAAS,CAAC;CACvC;AAKD,MAAM,WAAW,sCAAuC,SAAQ,2BAA2B;IACzF,QAAQ,CAAC,MAA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AM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACvD;AAKD,MAAM,WAAW,4BAA4B;IAE3C,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAC;IAG9D,gCAAgC,CAAC,EAAE,8BAA8B,EAAE,CAAC;CACrE;AAOD,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG;QACtB,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;CACH;AAMD,MAAM,WAAW,uBAAuB;IACtC,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/model-datasource/types.ts"],"names":[],"mappings":""}
@@ -4,7 +4,8 @@ import { ITable } from 'aws-cdk-lib/aws-dynamodb';
4
4
  import { IFunction, ILayerVersion, Runtime } from 'aws-cdk-lib/aws-lambda';
5
5
  import { IRole } from 'aws-cdk-lib/aws-iam';
6
6
  import { Construct } from 'constructs';
7
- import { AppSyncFunctionConfigurationProvider, DataSourceOptions, SearchableDataSourceOptions, MappingTemplateProvider, VpcConfig } from './graphql-api-provider';
7
+ import { AppSyncFunctionConfigurationProvider, DataSourceOptions, SearchableDataSourceOptions, MappingTemplateProvider } from './graphql-api-provider';
8
+ import { VpcConfig } from './model-datasource';
8
9
  export interface DynamoDbDataSourceOptions extends DataSourceOptions {
9
10
  readonly serviceRole: IRole;
10
11
  }
@@ -1 +1 @@
1
- {"version":3,"file":"transform-host-provider.d.ts","sourceRoot":"","sources":["../src/transform-host-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,W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AO,CAAC;IAEzC,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,WAAW,GAAG,IAAI,CAAC;IACzE,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;CAC/D"}
@@ -1,9 +1,9 @@
1
- export { DataSourceProvider, TransformerDataSourceManagerProvider, AppSyncDataSourceType, DataSourceInstance, DataSourceType, DBType, DataSourceProvisionStrategy, DynamoDBProvisionStrategy, SQLLambdaModelProvisionStrategy, SQLDBType, } from './transformer-datasource-provider';
1
+ export { DataSourceProvider, TransformerDataSourceManagerProvider, AppSyncDataSourceType, DataSourceInstance, } from './transformer-datasource-provider';
2
2
  export { TransformerContextOutputProvider } from './transformer-context-output-provider';
3
3
  export { TransformerProviderRegistry } from './transformer-provider-registry';
4
4
  export { TransformerResolverProvider, TransformerResolversManagerProvider } from './transformer-resolver-provider';
5
5
  export * from './resource-resource-provider';
6
- export { TransformerContextProvider, TransformerTransformSchemaStepContextProvider, TransformerBeforeStepContextProvider, TransformerPrepareStepContextProvider, TransformerSchemaVisitStepContextProvider, TransformerValidationStepContextProvider, TransformerSecrets, } from './transformer-context-provider';
6
+ export { TransformerBeforeStepContextProvider, TransformerContextMetadataProvider, TransformerContextProvider, TransformerPrepareStepContextProvider, TransformerSchemaVisitStepContextProvider, TransformerSecrets, TransformerTransformSchemaStepContextProvider, TransformerValidationStepContextProvider, } from './transformer-context-provider';
7
7
  export { TransformerSchemaHelperProvider } from './schema-helper-provider';
8
8
  export { TransformerPreProcessContextProvider } from './transformer-preprocess-context-provider';
9
9
  export { StackManagerProvider } from './stack-manager-provider';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/transformer-context/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,oCAAoC,EACpC,qBAAqB,EACrB,kBAAkB,EAClB,cAAc,EACd,MAAM,EAC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E,+BAA+B,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAE,oCAAoC,EAAE,MAAM,2CAA2C,CAAC;AACjG,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC"}
@@ -14,10 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.SQLLambdaModelProvisionStrategy = exports.DynamoDBProvisionStrategy = exports.AppSyncDataSourceType = void 0;
17
+ exports.AppSyncDataSourceType = void 0;
18
18
  var transformer_datasource_provider_1 = require("./transformer-datasource-provider");
19
19
  Object.defineProperty(exports, "AppSyncDataSourceType", { enumerable: true, get: function () { return transformer_datasource_provider_1.AppSyncDataSourceType; } });
20
- Object.defineProperty(exports, "DynamoDBProvisionStrategy", { enumerable: true, get: function () { return transformer_datasource_provider_1.DynamoDBProvisionStrategy; } });
21
- Object.defineProperty(exports, "SQLLambdaModelProvisionStrategy", { enumerable: true, get: function () { return transformer_datasource_provider_1.SQLLambdaModelProvisionStrategy; } });
22
20
  __exportStar(require("./resource-resource-provider"), exports);
23
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/transformer-context/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qFAW2C;AARzC,wIAAA,qBAAqB,OAAA;AAKrB,4IAAA,yBAAyB,OAAA;AACzB,kJAAA,+BAA+B,OAAA;AAMjC,+DAA6C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/transformer-context/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qFAK2C;AAFzC,wIAAA,qBAAqB,OAAA;AAMvB,+DAA6C"}
@@ -1,6 +1,7 @@
1
1
  import { DocumentNode } from 'graphql';
2
- import { AppSyncAuthConfiguration, GraphQLAPIProvider, RDSLayerMapping, VpcConfig, ProvisionedConcurrencyConfig } from '../graphql-api-provider';
3
- import { TransformerDataSourceManagerProvider, DataSourceType } from './transformer-datasource-provider';
2
+ import { AppSyncAuthConfiguration, GraphQLAPIProvider } from '../graphql-api-provider';
3
+ import { DataSourceStrategiesProvider, RDSLayerMappingProvider } from '../model-datasource';
4
+ import { TransformerDataSourceManagerProvider } from './transformer-datasource-provider';
4
5
  import { TransformerProviderRegistry } from './transformer-provider-registry';
5
6
  import { TransformerContextOutputProvider } from './transformer-context-output-provider';
6
7
  import { StackManagerProvider } from './stack-manager-provider';
@@ -9,21 +10,19 @@ import { TransformParameters } from './transform-parameters';
9
10
  import { TransformerResolversManagerProvider } from './transformer-resolver-provider';
10
11
  import { SynthParameters } from './synth-parameters';
11
12
  export interface TransformerContextMetadataProvider {
12
- set<T>(key: string, value: T): void;
13
- get<T>(key: string): T | undefined;
14
- has(key: string): boolean;
13
+ set: <T>(key: string, value: T) => void;
14
+ get: <T>(key: string) => T | undefined;
15
+ has: (key: string) => boolean;
15
16
  }
16
17
  export type TransformerSecrets = {
17
18
  [key: string]: any;
18
19
  };
19
- export interface TransformerContextProvider {
20
+ export interface TransformerContextProvider extends DataSourceStrategiesProvider, RDSLayerMappingProvider {
20
21
  metadata: TransformerContextMetadataProvider;
21
22
  resolvers: TransformerResolversManagerProvider;
22
23
  dataSources: TransformerDataSourceManagerProvider;
23
24
  providerRegistry: TransformerProviderRegistry;
24
25
  inputDocument: DocumentNode;
25
- modelToDatasourceMap: Map<string, DataSourceType>;
26
- datasourceSecretParameterLocations: Map<string, TransformerSecrets>;
27
26
  output: TransformerContextOutputProvider;
28
27
  stackManager: StackManagerProvider;
29
28
  api: GraphQLAPIProvider;
@@ -31,16 +30,12 @@ export interface TransformerContextProvider {
31
30
  authConfig: AppSyncAuthConfiguration;
32
31
  transformParameters: TransformParameters;
33
32
  synthParameters: SynthParameters;
34
- customQueries: Map<string, string>;
35
- isProjectUsingDataStore(): boolean;
36
- getResolverConfig<ResolverConfig>(): ResolverConfig | undefined;
37
- readonly sqlLambdaVpcConfig?: VpcConfig;
38
- readonly rdsLayerMapping?: RDSLayerMapping;
39
- readonly sqlLambdaProvisionedConcurrencyConfig?: ProvisionedConcurrencyConfig;
33
+ isProjectUsingDataStore: () => boolean;
34
+ getResolverConfig: <ResolverConfig>() => ResolverConfig | undefined;
40
35
  }
41
- export type TransformerBeforeStepContextProvider = Pick<TransformerContextProvider, 'inputDocument' | 'modelToDatasourceMap' | 'transformParameters' | 'isProjectUsingDataStore' | 'getResolverConfig' | 'authConfig' | 'stackManager' | 'synthParameters'>;
42
- export type TransformerSchemaVisitStepContextProvider = Pick<TransformerContextProvider, 'inputDocument' | 'modelToDatasourceMap' | 'output' | 'providerRegistry' | 'transformParameters' | 'isProjectUsingDataStore' | 'getResolverConfig' | 'metadata' | 'authConfig' | 'resourceHelper'>;
43
- export type TransformerValidationStepContextProvider = Pick<TransformerContextProvider, 'inputDocument' | 'modelToDatasourceMap' | 'output' | 'providerRegistry' | 'dataSources' | 'transformParameters' | 'isProjectUsingDataStore' | 'getResolverConfig' | 'metadata' | 'authConfig' | 'resourceHelper' | 'resolvers' | 'stackManager' | 'synthParameters'>;
36
+ export type TransformerBeforeStepContextProvider = Pick<TransformerContextProvider, 'inputDocument' | 'dataSourceStrategies' | 'sqlDirectiveDataSourceStrategies' | 'transformParameters' | 'isProjectUsingDataStore' | 'getResolverConfig' | 'authConfig' | 'stackManager' | 'synthParameters'>;
37
+ export type TransformerSchemaVisitStepContextProvider = Pick<TransformerContextProvider, 'inputDocument' | 'dataSourceStrategies' | 'sqlDirectiveDataSourceStrategies' | 'output' | 'providerRegistry' | 'transformParameters' | 'isProjectUsingDataStore' | 'getResolverConfig' | 'metadata' | 'authConfig' | 'resourceHelper'>;
38
+ export type TransformerValidationStepContextProvider = Pick<TransformerContextProvider, 'inputDocument' | 'dataSourceStrategies' | 'sqlDirectiveDataSourceStrategies' | 'output' | 'providerRegistry' | 'dataSources' | 'transformParameters' | 'isProjectUsingDataStore' | 'getResolverConfig' | 'metadata' | 'authConfig' | 'resourceHelper' | 'resolvers' | 'stackManager' | 'synthParameters'>;
44
39
  export type TransformerPrepareStepContextProvider = TransformerValidationStepContextProvider;
45
40
  export type TransformerTransformSchemaStepContextProvider = TransformerValidationStepContextProvider;
46
41
  //# sourceMappingURL=transformer-context-provider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"transformer-context-provider.d.ts","sourceRoot":"","sources":["../../src/transformer-context/transformer-context-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EACL,wBAAwB,EACxB,kBAAkB,EAClB,eAAe,EACf,SAAS,EACT,4BAA4B,EAC7B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,oCAAoC,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACzG,OAAO,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,EAAE,gCAAgC,EAAE,MAAM,uCAAuC,CAAC;AACzF,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,iCAAiC,EAAE,MAAM,8BAA8B,CAAC;AACjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,mCAAmC,EAAE,MAAM,iCAAiC,CAAC;AACtF,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,WAAW,kCAAkC;IACjD,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;IACpC,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,GAA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,IAAI,CAC1D,0BAA0B,EACxB,eAAe,GACf,sBAAsB,GACtB,QAAQ,GACR,kBAAkB,GAClB,qBAAqB,GACrB,yBAAyB,GACzB,mBAAmB,GACnB,UAAU,GACV,YAAY,GACZ,gBAAgB,CACnB,CAAC;AAEF,MAAM,MAAM,wCAAwC,GAAG,IAAI,CACzD,0BAA0B,EACxB,eAAe,GACf,sBAAsB,GACtB,QAAQ,GACR,kBAAkB,GAClB,aAAa,GACb,qBAAqB,GACrB,yBAAyB,GACzB,mBAAmB,GACnB,UAAU,GACV,YAAY,GACZ,gBAAgB,GAChB,WAAW,GACX,cAAc,GACd,iBAAiB,CACpB,CAAC;AAEF,MAAM,MAAM,qCAAqC,GAAG,wCAAwC,CAAC;AAE7F,MAAM,MAAM,6CAA6C,GAAG,wCAAwC,CAAC"}
1
+ {"version":3,"file":"transformer-context-provider.d.ts","sourceRoot":"","sources":["../../src/transformer-context/transformer-context-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AACvF,OAAO,EAAE,4BAA4B,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC5F,OAAO,EAAE,oCAAoC,EAAE,MAAM,mCAAmC,CAAC;AACzF,OAAO,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,EAAE,gCAAgC,EAAE,MAAM,uCAAuC,CAAC;AACzF,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,iCAAiC,EAAE,MAAM,8BAA8B,CAAC;AACjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,mCAAmC,EAAE,MAAM,iCAAiC,CAAC;AACtF,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,WAAW,kCAAkC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B,GACzB,mBAAmB,GACnB,UAAU,GACV,YAAY,GACZ,gBAAgB,CACnB,CAAC;AAEF,MAAM,MAAM,wCAAwC,GAAG,IAAI,CACzD,0BAA0B,EACxB,eAAe,GACf,sBAAsB,GACtB,kCAAkC,GAClC,QAAQ,GACR,kBAAkB,GAClB,aAAa,GACb,qBAAqB,GACrB,yBAAyB,GACzB,mBAAmB,GACnB,UAAU,GACV,YAAY,GACZ,gBAAgB,GAChB,WAAW,GACX,cAAc,GACd,iBAAiB,CACpB,CAAC;AAEF,MAAM,MAAM,qCAAqC,GAAG,wCAAwC,CAAC;AAE7F,MAAM,MAAM,6CAA6C,GAAG,wCAAwC,CAAC"}
@@ -22,19 +22,4 @@ export interface TransformerDataSourceManagerProvider {
22
22
  }
23
23
  export interface DataSourceProvider extends BackedDataSource {
24
24
  }
25
- export type DBType = 'DDB' | SQLDBType;
26
- export type SQLDBType = 'MySQL' | 'Postgres';
27
- export type DataSourceProvisionStrategy = DynamoDBProvisionStrategy | SQLLambdaModelProvisionStrategy;
28
- export declare const enum DynamoDBProvisionStrategy {
29
- DEFAULT = "DEFAULT",
30
- AMPLIFY_TABLE = "AMPLIFY_TABLE"
31
- }
32
- export declare const enum SQLLambdaModelProvisionStrategy {
33
- DEFAULT = "DEFAULT"
34
- }
35
- export interface DataSourceType {
36
- dbType: DBType;
37
- provisionDB: boolean;
38
- provisionStrategy: DataSourceProvisionStrategy;
39
- }
40
25
  //# sourceMappingURL=transformer-datasource-provider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"transformer-datasource-provider.d.ts","sourceRoot":"","sources":["../../src/transformer-context/transformer-datasource-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,2BAA2B,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAEhF,oBAAY,qBAAqB;IAC/B,eAAe,oBAAoB;IACnC,oBAAoB,yBAAyB;IAC7C,UAAU,eAAe;IACzB,mBAAmB,wBAAwB;IAC3C,IAAI,SAAS;IACb,IAAI,SAAS;CACd;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,SAAS,GAAG,cAAc,GAAG,SAAS,GAAG,sBAAsB,CAAC;AAE1G,MAAM,WAAW,oCAAoC;IACnD,GAAG,EAAE,CAAC,IAAI,EAAE,wBAAwB,GAAG,2BAA2B,EAAE,kBAAkB,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACpH,GAAG,EAAE,CAAC,IAAI,EAAE,wBAAwB,GAAG,2BAA2B,KAAK,kBAAkB,CAAC;IAC1F,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;CAChC;AAED,MAAM,WAAW,kBAAmB,SAAQ,gBAAgB;CAAG;AAK/D,MAAM,MAAM,MAAM,GAAG,KAAK,GAAG,SAAS,CAAC;AAKvC,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,UAAU,CAAC;AAG7C,MAAM,MAAM,2BAA2B,GAAG,yBAAyB,GAAG,+BAA+B,CAAC;AAMtG,0BAAkB,yBAAyB;IAIzC,OAAO,YAAY;IAInB,aAAa,kBAAkB;CAChC;AAGD,0BAAkB,+BAA+B;IAI/C,OAAO,YAAY;CACpB;AAGD,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,OAAO,CAAC;IACrB,iBAAiB,EAAE,2BAA2B,CAAC;CAChD"}
1
+ {"version":3,"file":"transformer-datasource-provider.d.ts","sourceRoot":"","sources":["../../src/transformer-context/transformer-datasource-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,2BAA2B,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAEhF,oBAAY,qBAAqB;IAC/B,eAAe,oBAAoB;IACnC,oBAAoB,yBAAyB;IAC7C,UAAU,eAAe;IACzB,mBAAmB,wBAAwB;IAC3C,IAAI,SAAS;IACb,IAAI,SAAS;CACd;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,SAAS,GAAG,cAAc,GAAG,SAAS,GAAG,sBAAsB,CAAC;AAE1G,MAAM,WAAW,oCAAoC;IACnD,GAAG,EAAE,CAAC,IAAI,EAAE,wBAAwB,GAAG,2BAA2B,EAAE,kBAAkB,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACpH,GAAG,EAAE,CAAC,IAAI,EAAE,wBAAwB,GAAG,2BAA2B,KAAK,kBAAkB,CAAC;IAC1F,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;CAChC;AAED,MAAM,WAAW,kBAAmB,SAAQ,gBAAgB;CAAG"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SQLLambdaModelProvisionStrategy = exports.DynamoDBProvisionStrategy = exports.AppSyncDataSourceType = void 0;
3
+ exports.AppSyncDataSourceType = void 0;
4
4
  var AppSyncDataSourceType;
5
5
  (function (AppSyncDataSourceType) {
6
6
  AppSyncDataSourceType["AMAZON_DYNAMODB"] = "AMAZON_DYNAMODB";
@@ -10,13 +10,4 @@ var AppSyncDataSourceType;
10
10
  AppSyncDataSourceType["HTTP"] = "HTTP";
11
11
  AppSyncDataSourceType["NONE"] = "NONE";
12
12
  })(AppSyncDataSourceType = exports.AppSyncDataSourceType || (exports.AppSyncDataSourceType = {}));
13
- var DynamoDBProvisionStrategy;
14
- (function (DynamoDBProvisionStrategy) {
15
- DynamoDBProvisionStrategy["DEFAULT"] = "DEFAULT";
16
- DynamoDBProvisionStrategy["AMPLIFY_TABLE"] = "AMPLIFY_TABLE";
17
- })(DynamoDBProvisionStrategy = exports.DynamoDBProvisionStrategy || (exports.DynamoDBProvisionStrategy = {}));
18
- var SQLLambdaModelProvisionStrategy;
19
- (function (SQLLambdaModelProvisionStrategy) {
20
- SQLLambdaModelProvisionStrategy["DEFAULT"] = "DEFAULT";
21
- })(SQLLambdaModelProvisionStrategy = exports.SQLLambdaModelProvisionStrategy || (exports.SQLLambdaModelProvisionStrategy = {}));
22
13
  //# sourceMappingURL=transformer-datasource-provider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"transformer-datasource-provider.js","sourceRoot":"","sources":["../../src/transformer-context/transformer-datasource-provider.ts"],"names":[],"mappings":";;;AAMA,IAAY,qBAOX;AAPD,WAAY,qBAAqB;IAC/B,4DAAmC,CAAA;IACnC,sEAA6C,CAAA;IAC7C,kDAAyB,CAAA;IACzB,oEAA2C,CAAA;IAC3C,sCAAa,CAAA;IACb,sCAAa,CAAA;AACf,CAAC,EAPW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAOhC;AAiCD,IAAkB,yBASjB;AATD,WAAkB,yBAAyB;IAIzC,gDAAmB,CAAA;IAInB,4DAA+B,CAAA;AACjC,CAAC,EATiB,yBAAyB,GAAzB,iCAAyB,KAAzB,iCAAyB,QAS1C;AAGD,IAAkB,+BAKjB;AALD,WAAkB,+BAA+B;IAI/C,sDAAmB,CAAA;AACrB,CAAC,EALiB,+BAA+B,GAA/B,uCAA+B,KAA/B,uCAA+B,QAKhD"}
1
+ {"version":3,"file":"transformer-datasource-provider.js","sourceRoot":"","sources":["../../src/transformer-context/transformer-datasource-provider.ts"],"names":[],"mappings":";;;AAMA,IAAY,qBAOX;AAPD,WAAY,qBAAqB;IAC/B,4DAAmC,CAAA;IACnC,sEAA6C,CAAA;IAC7C,kDAAyB,CAAA;IACzB,oEAA2C,CAAA;IAC3C,sCAAa,CAAA;IACb,sCAAa,CAAA;AACf,CAAC,EAPW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAOhC"}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/graphql-transformer-interfaces",
3
- "version": "3.3.0",
3
+ "version": "3.3.2",
4
4
  "description": "Amplify GraphQL transformer interface definitions",
5
5
  "repository": {
6
6
  "type": "git",
@@ -47,6 +47,11 @@
47
47
  "json",
48
48
  "node"
49
49
  ],
50
- "collectCoverage": true
51
- }
50
+ "collectCoverage": true,
51
+ "coverageReporters": [
52
+ "clover",
53
+ "text"
54
+ ]
55
+ },
56
+ "gitHead": "6e450d037cf84098b51ce787a99d6023cbc0e39d"
52
57
  }
@@ -74,51 +74,11 @@ export interface LambdaConfig {
74
74
  ttlSeconds?: number;
75
75
  }
76
76
 
77
- /**
78
- * Configuration of the VPC in which to install a Lambda to resolve queries against a SQL-based data source. The SQL Lambda will be deployed
79
- * into the specified VPC, subnets, and security groups. The specified subnets and security groups must be in the same VPC. The VPC must
80
- * have at least one subnet. The construct will also create VPC service endpoints in the specified subnets, as well as inbound security
81
- * rules, to allow traffic on port 443 within each security group. This allows the Lambda to read database connection information from
82
- * Secure Systems Manager.
83
- * @experimental
84
- */
85
- export interface VpcConfig {
86
- /** The VPC to install the Lambda data source in. */
87
- readonly vpcId: string;
88
-
89
- /** The security groups to install the Lambda data source in. */
90
- readonly securityGroupIds: string[];
91
-
92
- /** The subnets to install the Lambda data source in, one per availability zone. */
93
- readonly subnetAvailabilityZoneConfig: SubnetAvailabilityZone[];
94
- }
95
-
96
- export interface ProvisionedConcurrencyConfig {
97
- readonly provisionedConcurrentExecutions: number;
98
- }
99
-
100
- /**
101
- * Although it is possible to create multiple subnets in a single availability zone, VPC Endpoints may only be deployed to a single subnet
102
- * in a given availability zone. We use this structure to ensure that the Lambda function and VPC endpoints are mutually consistent.
103
- */
104
- export interface SubnetAvailabilityZone {
105
- readonly subnetId: string;
106
- readonly availabilityZone: string;
107
- }
108
-
109
- /**
110
- * Maps a given AWS region to the SQL Lambda layer version ARN for that region. TODO: Rename to SQLLambdaLayerMapping
111
- */
112
- export interface RDSLayerMapping {
113
- readonly [key: string]: {
114
- layerRegion: string;
115
- };
116
- }
117
-
118
77
  export interface AppSyncFunctionConfigurationProvider extends IConstruct {
119
78
  readonly arn: string;
120
79
  readonly functionId: string;
121
80
  }
81
+
122
82
  export interface DataSourceOptions {
123
83
  /**
124
84
  * The name of the data source, overrides the id given by cdk
@@ -28,14 +28,11 @@ export {
28
28
  AppSyncAuthConfigurationUserPoolEntry,
29
29
  AppSyncAuthMode,
30
30
  UserPoolConfig,
31
- VpcConfig,
32
- SubnetAvailabilityZone,
33
31
  SearchableDataSourceOptions,
34
- RDSLayerMapping,
35
- ProvisionedConcurrencyConfig,
36
32
  } from './graphql-api-provider';
37
33
  export { TransformHostProvider, DynamoDbDataSourceOptions } from './transform-host-provider';
38
34
  export { TransformerLog, TransformerLogLevel } from './transformer-log';
39
35
  export type { TransformParameters } from './transformer-context/transform-parameters';
40
36
  export type { NestedStackProvider } from './nested-stack-provider';
41
37
  export type { AssetProps, AssetProvider, S3Asset } from './asset-provider';
38
+ export * from './model-datasource';
@@ -0,0 +1,195 @@
1
+ // #########################################################################################################################################
2
+ // If you change types in this file (the internal implementation), be sure to make corresponding necessary changes to
3
+ // amplify-graphql-api-construct/src/model-datasource-strategy.ts (the customer-facing interface) and the adapter functions in this file.
4
+ // #########################################################################################################################################
5
+
6
+ /**
7
+ * All known ModelDataSourceStrategies. Concrete strategies vary widely in their requirements and implementations.
8
+ */
9
+ export type ModelDataSourceStrategy =
10
+ | DefaultDynamoDbModelDataSourceStrategy
11
+ | AmplifyDynamoDbModelDataSourceStrategy
12
+ | SQLLambdaModelDataSourceStrategy;
13
+
14
+ export interface ModelDataSourceStrategyBase {
15
+ dbType: ModelDataSourceStrategyDbType;
16
+ }
17
+
18
+ /**
19
+ * All supported database types that can be used to resolve models.
20
+ */
21
+ export type ModelDataSourceStrategyDbType = 'DYNAMODB' | ModelDataSourceStrategySqlDbType;
22
+
23
+ /**
24
+ * All supported SQL database types that can be used to resolve models.
25
+ */
26
+ export type ModelDataSourceStrategySqlDbType = 'MYSQL' | 'POSTGRES';
27
+
28
+ /**
29
+ * Use default CloudFormation type 'AWS::DynamoDB::Table' to provision table.
30
+ */
31
+ export interface DefaultDynamoDbModelDataSourceStrategy extends ModelDataSourceStrategyBase {
32
+ readonly dbType: 'DYNAMODB';
33
+ readonly provisionStrategy: 'DEFAULT';
34
+ }
35
+
36
+ /**
37
+ * Use custom resource type 'Custom::AmplifyDynamoDBTable' to provision table.
38
+ */
39
+ export interface AmplifyDynamoDbModelDataSourceStrategy extends ModelDataSourceStrategyBase {
40
+ readonly dbType: 'DYNAMODB';
41
+ readonly provisionStrategy: 'AMPLIFY_TABLE';
42
+ }
43
+
44
+ /**
45
+ * A strategy that creates a Lambda to connect to a pre-existing SQL table to resolve model data.
46
+ *
47
+ * Note: The implementation type is different from the interface type: the interface type contains the custom SQL statements that are
48
+ * reference by the `@sql` `reference` attribute, while the implementation moves those into the SqlDirectiveDataSourceStrategy type.
49
+ */
50
+ export interface SQLLambdaModelDataSourceStrategy extends ModelDataSourceStrategyBase {
51
+ /**
52
+ * The name of the strategy. This will be used to name the AppSync DataSource itself, plus any associated resources like resolver Lambdas.
53
+ * This name must be unique across all schema definitions in a GraphQL API.
54
+ */
55
+ readonly name: string;
56
+
57
+ /**
58
+ * The type of the SQL database used to process model operations for this definition.
59
+ */
60
+ readonly dbType: ModelDataSourceStrategySqlDbType;
61
+
62
+ /**
63
+ * The parameters the Lambda data source will use to connect to the database.
64
+ */
65
+ readonly dbConnectionConfig: SqlModelDataSourceDbConnectionConfig;
66
+
67
+ /**
68
+ * The configuration of the VPC into which to install the Lambda.
69
+ */
70
+ readonly vpcConfiguration?: VpcConfig;
71
+
72
+ /**
73
+ * The configuration for the provisioned concurrency of the Lambda.
74
+ */
75
+ readonly sqlLambdaProvisionedConcurrencyConfig?: ProvisionedConcurrencyConfig;
76
+ }
77
+
78
+ /**
79
+ * Configuration of the VPC in which to install a Lambda to resolve queries against a SQL-based data source. The SQL Lambda will be deployed
80
+ * into the specified VPC, subnets, and security groups. The specified subnets and security groups must be in the same VPC. The VPC must
81
+ * have at least one subnet. The construct will also create VPC service endpoints in the specified subnets, as well as inbound security
82
+ * rules, to allow traffic on port 443 within each security group. This allows the Lambda to read database connection information from
83
+ * Secure Systems Manager.
84
+ */
85
+ export interface VpcConfig {
86
+ /** The VPC to install the Lambda data source in. */
87
+ readonly vpcId: string;
88
+
89
+ /** The security groups to install the Lambda data source in. */
90
+ readonly securityGroupIds: string[];
91
+
92
+ /** The subnets to install the Lambda data source in, one per availability zone. */
93
+ readonly subnetAvailabilityZoneConfig: SubnetAvailabilityZone[];
94
+ }
95
+
96
+ /**
97
+ * The configuration for the provisioned concurrency of the Lambda.
98
+ */
99
+ export interface ProvisionedConcurrencyConfig {
100
+ /** The amount of provisioned concurrency to allocate. **/
101
+ readonly provisionedConcurrentExecutions: number;
102
+ }
103
+
104
+ /**
105
+ * Subnet configuration for VPC endpoints used by a Lambda resolver for a SQL-based data source. Although it is possible to create multiple
106
+ * subnets in a single availability zone, VPC service endpoints may only be deployed to a single subnet in a given availability zone. This
107
+ * structure ensures that the Lambda function and VPC service endpoints are mutually consistent.
108
+ */
109
+ export interface SubnetAvailabilityZone {
110
+ /** The subnet ID to install the Lambda data source in. */
111
+ readonly subnetId: string;
112
+
113
+ /** The availability zone of the subnet. */
114
+ readonly availabilityZone: string;
115
+ }
116
+
117
+ /**
118
+ * The Secure Systems Manager parameter paths the Lambda data source will use to connect to the database.
119
+ *
120
+ * These parameters are retrieved from Secure Systems Manager in the same region as the Lambda.
121
+ */
122
+ export interface SqlModelDataSourceDbConnectionConfig {
123
+ /** The Secure Systems Manager parameter containing the hostname of the database. For RDS-based SQL data sources, this can be the hostname
124
+ * of a database proxy, cluster, or instance.
125
+ */
126
+ readonly hostnameSsmPath: string;
127
+
128
+ /** The Secure Systems Manager parameter containing the port number of the database proxy, cluster, or instance. */
129
+ readonly portSsmPath: string;
130
+
131
+ /** The Secure Systems Manager parameter containing the username to use when connecting to the database. */
132
+ readonly usernameSsmPath: string;
133
+
134
+ /** The Secure Systems Manager parameter containing the password to use when connecting to the database. */
135
+ readonly passwordSsmPath: string;
136
+
137
+ /** The Secure Systems Manager parameter containing the database name. */
138
+ readonly databaseNameSsmPath: string;
139
+ }
140
+
141
+ /**
142
+ * The internal implementation type for defining a ModelDataSourceStrategy used to resolve a field annotated with a `@sql` directive.
143
+ *
144
+ * Note: The implementation type is different from the interface type: it directly contains the SQL statement to be executed rather than
145
+ * passing a map.
146
+ */
147
+ export interface SqlDirectiveDataSourceStrategy {
148
+ /** The built-in type (either "Query" or "Mutation") with which the custom SQL is associated */
149
+ readonly typeName: 'Query' | 'Mutation';
150
+
151
+ /** The field name with which the custom SQL is associated */
152
+ readonly fieldName: string;
153
+
154
+ /** The strategy used to create the datasource that will resolve the custom SQL statement. */
155
+ readonly strategy: SQLLambdaModelDataSourceStrategy;
156
+
157
+ /**
158
+ * Custom SQL statements to be executed to resolve this field.
159
+ *
160
+ * Note: It's overkill to make this a map: a SqlDirectiveDataSourceStrategy will only ever use at most one statement (and maybe not even
161
+ * that if the directive uses inline statements). However, to avoid having to parse the directive configuration in multiple places, we'll
162
+ * pass the entire map as specified in the CDK construct definition, and let the directive transformer use it to look up references.
163
+ */
164
+ readonly customSqlStatements?: Record<string, string>;
165
+ }
166
+
167
+ /**
168
+ * Defines types that vend a dataSourceStrategies and optional customSqlDataSourceStrategies field. Primarily used for transformer context.
169
+ */
170
+ export interface DataSourceStrategiesProvider {
171
+ /** Maps GraphQL model names to the ModelDataSourceStrategy used to resolve it. The key of the record is the GraphQL type name. */
172
+ dataSourceStrategies: Record<string, ModelDataSourceStrategy>;
173
+
174
+ /** Maps custom Query and Mutation fields to the ModelDataSourceStrategy used to resolve them. */
175
+ sqlDirectiveDataSourceStrategies?: SqlDirectiveDataSourceStrategy[];
176
+ }
177
+
178
+ /**
179
+ * Maps a given AWS region to the SQL Lambda layer version ARN for that region. TODO: Once we remove SQL imports from Gen1 CLI, remove this
180
+ * from the transformer interfaces package in favor of the model generator, which is the only place that needs it now that we always resolve
181
+ * the layer mapping at deploy time.
182
+ */
183
+ export interface RDSLayerMapping {
184
+ readonly [key: string]: {
185
+ layerRegion: string;
186
+ };
187
+ }
188
+
189
+ /**
190
+ * Defines types that vend an rdsLayerMapping field. This is used solely for the Gen1 CLI import API flow, since wiring the custom resource
191
+ * provider used by the CDK isn't worth the cost. TODO: Remove this once we remove SQL imports from Gen1 CLI.
192
+ */
193
+ export interface RDSLayerMappingProvider {
194
+ rdsLayerMapping?: RDSLayerMapping;
195
+ }
@@ -17,8 +17,8 @@ import {
17
17
  DataSourceOptions,
18
18
  SearchableDataSourceOptions,
19
19
  MappingTemplateProvider,
20
- VpcConfig,
21
20
  } from './graphql-api-provider';
21
+ import { VpcConfig } from './model-datasource';
22
22
 
23
23
  export interface DynamoDbDataSourceOptions extends DataSourceOptions {
24
24
  /**
@@ -3,25 +3,20 @@ export {
3
3
  TransformerDataSourceManagerProvider,
4
4
  AppSyncDataSourceType,
5
5
  DataSourceInstance,
6
- DataSourceType,
7
- DBType,
8
- DataSourceProvisionStrategy,
9
- DynamoDBProvisionStrategy,
10
- SQLLambdaModelProvisionStrategy,
11
- SQLDBType,
12
6
  } from './transformer-datasource-provider';
13
7
  export { TransformerContextOutputProvider } from './transformer-context-output-provider';
14
8
  export { TransformerProviderRegistry } from './transformer-provider-registry';
15
9
  export { TransformerResolverProvider, TransformerResolversManagerProvider } from './transformer-resolver-provider';
16
10
  export * from './resource-resource-provider';
17
11
  export {
18
- TransformerContextProvider,
19
- TransformerTransformSchemaStepContextProvider,
20
12
  TransformerBeforeStepContextProvider,
13
+ TransformerContextMetadataProvider,
14
+ TransformerContextProvider,
21
15
  TransformerPrepareStepContextProvider,
22
16
  TransformerSchemaVisitStepContextProvider,
23
- TransformerValidationStepContextProvider,
24
17
  TransformerSecrets,
18
+ TransformerTransformSchemaStepContextProvider,
19
+ TransformerValidationStepContextProvider,
25
20
  } from './transformer-context-provider';
26
21
  export { TransformerSchemaHelperProvider } from './schema-helper-provider';
27
22
  export { TransformerPreProcessContextProvider } from './transformer-preprocess-context-provider';