@aws-amplify/graphql-api-construct 1.4.0-construct-publish-test.0 → 1.4.0-nov-14-cut-1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (408) hide show
  1. package/.jsii +677 -192
  2. package/API.md +53 -13
  3. package/CHANGELOG.md +9 -1
  4. package/README.md +414 -88
  5. package/lib/amplify-dynamodb-table-wrapper.js +1 -1
  6. package/lib/amplify-graphql-api.d.ts +7 -0
  7. package/lib/amplify-graphql-api.js +69 -6
  8. package/lib/amplify-graphql-definition.d.ts +21 -10
  9. package/lib/amplify-graphql-definition.js +33 -21
  10. package/lib/index.d.ts +1 -1
  11. package/lib/index.js +1 -1
  12. package/lib/internal/data-source-config.d.ts +6 -2
  13. package/lib/internal/data-source-config.js +19 -7
  14. package/lib/internal/default-parameters.js +3 -1
  15. package/lib/internal/model-type-name.d.ts +2 -2
  16. package/lib/internal/model-type-name.js +25 -15
  17. package/lib/sql-model-datasource-strategy.d.ts +25 -0
  18. package/lib/sql-model-datasource-strategy.js +57 -0
  19. package/lib/types.d.ts +176 -40
  20. package/lib/types.js +1 -1
  21. package/node_modules/@aws-amplify/graphql-auth-transformer/API.md +5 -1
  22. package/node_modules/@aws-amplify/graphql-auth-transformer/CHANGELOG.md +15 -2
  23. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/graphql-auth-transformer.d.ts +3 -1
  24. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/graphql-auth-transformer.d.ts.map +1 -1
  25. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/graphql-auth-transformer.js +64 -50
  26. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/graphql-auth-transformer.js.map +1 -1
  27. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/index.d.ts.map +1 -1
  28. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/index.js +3 -0
  29. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/index.js.map +1 -1
  30. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/schema.d.ts.map +1 -1
  31. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/schema.js.map +1 -1
  32. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/validations.d.ts +3 -2
  33. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/validations.d.ts.map +1 -1
  34. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/validations.js +4 -1
  35. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/validations.js.map +1 -1
  36. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/ddb-vtl-generator.d.ts +20 -0
  37. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/ddb-vtl-generator.d.ts.map +1 -0
  38. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/ddb-vtl-generator.js +24 -0
  39. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/ddb-vtl-generator.js.map +1 -0
  40. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{resolvers → vtl-generator/ddb/resolvers}/field.d.ts +1 -1
  41. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/field.d.ts.map +1 -0
  42. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{resolvers → vtl-generator/ddb/resolvers}/field.js +1 -1
  43. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/field.js.map +1 -0
  44. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{resolvers → vtl-generator/ddb/resolvers}/helpers.d.ts +1 -1
  45. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/helpers.d.ts.map +1 -0
  46. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{resolvers → vtl-generator/ddb/resolvers}/helpers.js +1 -1
  47. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/helpers.js.map +1 -0
  48. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/index.d.ts.map +1 -0
  49. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/index.js.map +1 -0
  50. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{resolvers → vtl-generator/ddb/resolvers}/mutation.create.d.ts +1 -1
  51. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/mutation.create.d.ts.map +1 -0
  52. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{resolvers → vtl-generator/ddb/resolvers}/mutation.create.js +1 -1
  53. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/mutation.create.js.map +1 -0
  54. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{resolvers → vtl-generator/ddb/resolvers}/mutation.delete.d.ts +1 -1
  55. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/mutation.delete.d.ts.map +1 -0
  56. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{resolvers → vtl-generator/ddb/resolvers}/mutation.delete.js +1 -1
  57. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/mutation.delete.js.map +1 -0
  58. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{resolvers → vtl-generator/ddb/resolvers}/mutation.update.d.ts +1 -1
  59. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/mutation.update.d.ts.map +1 -0
  60. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{resolvers → vtl-generator/ddb/resolvers}/mutation.update.js +1 -1
  61. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/mutation.update.js.map +1 -0
  62. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/query.d.ts +6 -0
  63. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/query.d.ts.map +1 -0
  64. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{resolvers → vtl-generator/ddb/resolvers}/query.js +28 -3
  65. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/query.js.map +1 -0
  66. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{resolvers → vtl-generator/ddb/resolvers}/search.d.ts +1 -1
  67. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/search.d.ts.map +1 -0
  68. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{resolvers → vtl-generator/ddb/resolvers}/search.js +1 -1
  69. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/search.js.map +1 -0
  70. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/subscriptions.d.ts +3 -0
  71. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/subscriptions.d.ts.map +1 -0
  72. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{resolvers → vtl-generator/ddb/resolvers}/subscriptions.js +1 -1
  73. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/subscriptions.js.map +1 -0
  74. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/rds-vtl-generator.d.ts +20 -0
  75. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/rds-vtl-generator.d.ts.map +1 -0
  76. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/rds-vtl-generator.js +24 -0
  77. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/rds-vtl-generator.js.map +1 -0
  78. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/common.d.ts +13 -0
  79. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/common.d.ts.map +1 -0
  80. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/common.js +157 -0
  81. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/common.js.map +1 -0
  82. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/index.d.ts +5 -0
  83. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/index.d.ts.map +1 -0
  84. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/index.js +21 -0
  85. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/index.js.map +1 -0
  86. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/mutation.d.ts +8 -0
  87. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/mutation.d.ts.map +1 -0
  88. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/mutation.js +56 -0
  89. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/mutation.js.map +1 -0
  90. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/query.d.ts +8 -0
  91. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/query.d.ts.map +1 -0
  92. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/query.js +41 -0
  93. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/query.js.map +1 -0
  94. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{resolvers/subscriptions.d.ts → vtl-generator/rds/resolvers/subscription.d.ts} +2 -2
  95. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/subscription.d.ts.map +1 -0
  96. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/subscription.js +18 -0
  97. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/subscription.js.map +1 -0
  98. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/vtl-generator.d.ts +19 -0
  99. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/vtl-generator.d.ts.map +1 -0
  100. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/vtl-generator.js +3 -0
  101. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/vtl-generator.js.map +1 -0
  102. package/node_modules/@aws-amplify/graphql-auth-transformer/package.json +10 -10
  103. package/node_modules/@aws-amplify/graphql-default-value-transformer/CHANGELOG.md +5 -2
  104. package/node_modules/@aws-amplify/graphql-default-value-transformer/lib/graphql-default-value-transformer.d.ts.map +1 -1
  105. package/node_modules/@aws-amplify/graphql-default-value-transformer/lib/graphql-default-value-transformer.js +13 -1
  106. package/node_modules/@aws-amplify/graphql-default-value-transformer/lib/graphql-default-value-transformer.js.map +1 -1
  107. package/node_modules/@aws-amplify/graphql-default-value-transformer/package.json +7 -7
  108. package/node_modules/@aws-amplify/graphql-function-transformer/CHANGELOG.md +1 -1
  109. package/node_modules/@aws-amplify/graphql-function-transformer/package.json +6 -6
  110. package/node_modules/@aws-amplify/graphql-http-transformer/CHANGELOG.md +1 -1
  111. package/node_modules/@aws-amplify/graphql-http-transformer/package.json +6 -6
  112. package/node_modules/@aws-amplify/graphql-index-transformer/API.md +2 -2
  113. package/node_modules/@aws-amplify/graphql-index-transformer/CHANGELOG.md +8 -1
  114. package/node_modules/@aws-amplify/graphql-index-transformer/lib/graphql-primary-key-transformer.d.ts +1 -1
  115. package/node_modules/@aws-amplify/graphql-index-transformer/lib/graphql-primary-key-transformer.d.ts.map +1 -1
  116. package/node_modules/@aws-amplify/graphql-index-transformer/lib/graphql-primary-key-transformer.js +7 -7
  117. package/node_modules/@aws-amplify/graphql-index-transformer/lib/graphql-primary-key-transformer.js.map +1 -1
  118. package/node_modules/@aws-amplify/graphql-index-transformer/lib/resolvers/generators/rds-vtl-generator.d.ts.map +1 -1
  119. package/node_modules/@aws-amplify/graphql-index-transformer/lib/resolvers/generators/rds-vtl-generator.js +4 -1
  120. package/node_modules/@aws-amplify/graphql-index-transformer/lib/resolvers/generators/rds-vtl-generator.js.map +1 -1
  121. package/node_modules/@aws-amplify/graphql-index-transformer/lib/resolvers/resolvers.d.ts +17 -16
  122. package/node_modules/@aws-amplify/graphql-index-transformer/lib/resolvers/resolvers.d.ts.map +1 -1
  123. package/node_modules/@aws-amplify/graphql-index-transformer/lib/resolvers/resolvers.js +134 -119
  124. package/node_modules/@aws-amplify/graphql-index-transformer/lib/resolvers/resolvers.js.map +1 -1
  125. package/node_modules/@aws-amplify/graphql-index-transformer/package.json +7 -7
  126. package/node_modules/@aws-amplify/graphql-maps-to-transformer/API.md +15 -0
  127. package/node_modules/@aws-amplify/graphql-maps-to-transformer/CHANGELOG.md +10 -2
  128. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/assets/mapping-lambda.zip +0 -0
  129. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/field-mapping-resolvers.d.ts +1 -0
  130. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/field-mapping-resolvers.d.ts.map +1 -1
  131. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/field-mapping-resolvers.js +13 -1
  132. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/field-mapping-resolvers.js.map +1 -1
  133. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-maps-to-transformer.d.ts +2 -1
  134. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-maps-to-transformer.d.ts.map +1 -1
  135. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-maps-to-transformer.js +16 -33
  136. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-maps-to-transformer.js.map +1 -1
  137. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-name-mapping.d.ts +10 -0
  138. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-name-mapping.d.ts.map +1 -0
  139. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-name-mapping.js +102 -0
  140. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-name-mapping.js.map +1 -0
  141. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-refers-to-transformer.d.ts +13 -0
  142. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-refers-to-transformer.d.ts.map +1 -0
  143. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-refers-to-transformer.js +81 -0
  144. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-refers-to-transformer.js.map +1 -0
  145. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/index.d.ts +1 -0
  146. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/index.d.ts.map +1 -1
  147. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/index.js +3 -1
  148. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/index.js.map +1 -1
  149. package/node_modules/@aws-amplify/graphql-maps-to-transformer/package.json +12 -12
  150. package/node_modules/@aws-amplify/graphql-model-transformer/API.md +15 -15
  151. package/node_modules/@aws-amplify/graphql-model-transformer/CHANGELOG.md +18 -1
  152. package/node_modules/@aws-amplify/graphql-model-transformer/lib/graphql-model-transformer.d.ts.map +1 -1
  153. package/node_modules/@aws-amplify/graphql-model-transformer/lib/graphql-model-transformer.js +28 -13
  154. package/node_modules/@aws-amplify/graphql-model-transformer/lib/graphql-model-transformer.js.map +1 -1
  155. package/node_modules/@aws-amplify/graphql-model-transformer/lib/graphql-types/mutation.d.ts.map +1 -1
  156. package/node_modules/@aws-amplify/graphql-model-transformer/lib/graphql-types/mutation.js +9 -2
  157. package/node_modules/@aws-amplify/graphql-model-transformer/lib/graphql-types/mutation.js.map +1 -1
  158. package/node_modules/@aws-amplify/graphql-model-transformer/lib/rds-lambda.zip +0 -0
  159. package/node_modules/@aws-amplify/graphql-model-transformer/lib/rds-notification-lambda.zip +0 -0
  160. package/node_modules/@aws-amplify/graphql-model-transformer/lib/rds-patching-lambda.zip +0 -0
  161. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/generators/dynamodb-vtl-generator.d.ts +6 -5
  162. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/generators/dynamodb-vtl-generator.d.ts.map +1 -1
  163. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/generators/dynamodb-vtl-generator.js +5 -5
  164. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/generators/dynamodb-vtl-generator.js.map +1 -1
  165. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/generators/rds-vtl-generator.d.ts +6 -5
  166. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/generators/rds-vtl-generator.d.ts.map +1 -1
  167. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/generators/rds-vtl-generator.js +11 -11
  168. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/generators/rds-vtl-generator.js.map +1 -1
  169. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/generators/vtl-generator.d.ts +6 -5
  170. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/generators/vtl-generator.d.ts.map +1 -1
  171. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/mutation.d.ts +4 -3
  172. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/mutation.d.ts.map +1 -1
  173. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/mutation.js +74 -55
  174. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/mutation.js.map +1 -1
  175. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/query.d.ts +2 -1
  176. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/query.d.ts.map +1 -1
  177. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/query.js +8 -2
  178. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/query.js.map +1 -1
  179. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/resolver.d.ts +11 -4
  180. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/resolver.d.ts.map +1 -1
  181. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/resolver.js +153 -58
  182. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/resolver.js.map +1 -1
  183. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamo-model-resource-generator.d.ts +0 -2
  184. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamo-model-resource-generator.d.ts.map +1 -1
  185. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamo-model-resource-generator.js +8 -5
  186. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamo-model-resource-generator.js.map +1 -1
  187. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamodb-table-construct/index.d.ts +2 -0
  188. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamodb-table-construct/index.d.ts.map +1 -1
  189. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamodb-table-construct/index.js +3 -1
  190. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamodb-table-construct/index.js.map +1 -1
  191. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/amplify-table-manager-handler.d.ts +1 -1
  192. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/amplify-table-manager-handler.d.ts.map +1 -1
  193. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/amplify-table-manager-handler.js +79 -39
  194. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/amplify-table-manager-handler.js.map +1 -1
  195. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/model-resource-generator.js +5 -5
  196. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/model-resource-generator.js.map +1 -1
  197. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/rds-model-resource-generator.d.ts +2 -1
  198. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/rds-model-resource-generator.d.ts.map +1 -1
  199. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/rds-model-resource-generator.js +43 -16
  200. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/rds-model-resource-generator.js.map +1 -1
  201. package/node_modules/@aws-amplify/graphql-model-transformer/package.json +9 -9
  202. package/node_modules/@aws-amplify/graphql-predictions-transformer/CHANGELOG.md +1 -1
  203. package/node_modules/@aws-amplify/graphql-predictions-transformer/lib/predictionsLambdaFunction.zip +0 -0
  204. package/node_modules/@aws-amplify/graphql-predictions-transformer/package.json +6 -6
  205. package/node_modules/@aws-amplify/graphql-relational-transformer/CHANGELOG.md +9 -1
  206. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-belongs-to-transformer.d.ts.map +1 -1
  207. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-belongs-to-transformer.js +41 -9
  208. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-belongs-to-transformer.js.map +1 -1
  209. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-has-many-transformer.d.ts.map +1 -1
  210. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-has-many-transformer.js +35 -8
  211. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-has-many-transformer.js.map +1 -1
  212. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-has-one-transformer.d.ts.map +1 -1
  213. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-has-one-transformer.js +30 -8
  214. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-has-one-transformer.js.map +1 -1
  215. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-many-to-many-transformer.d.ts.map +1 -1
  216. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-many-to-many-transformer.js +3 -2
  217. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-many-to-many-transformer.js.map +1 -1
  218. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/ddb-generator.d.ts +13 -0
  219. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/ddb-generator.d.ts.map +1 -0
  220. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/ddb-generator.js +171 -0
  221. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/ddb-generator.js.map +1 -0
  222. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/generator-factory.d.ts +4 -0
  223. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/generator-factory.d.ts.map +1 -0
  224. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/generator-factory.js +18 -0
  225. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/generator-factory.js.map +1 -0
  226. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/generator.d.ts +8 -0
  227. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/generator.d.ts.map +1 -0
  228. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/generator.js +7 -0
  229. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/generator.js.map +1 -0
  230. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/rds-generator.d.ts +14 -0
  231. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/rds-generator.d.ts.map +1 -0
  232. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/rds-generator.js +115 -0
  233. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/rds-generator.js.map +1 -0
  234. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolvers.d.ts +5 -5
  235. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolvers.d.ts.map +1 -1
  236. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolvers.js +23 -169
  237. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolvers.js.map +1 -1
  238. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/schema.d.ts.map +1 -1
  239. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/schema.js +14 -8
  240. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/schema.js.map +1 -1
  241. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/types.d.ts +4 -0
  242. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/types.d.ts.map +1 -1
  243. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/utils.d.ts +5 -0
  244. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/utils.d.ts.map +1 -1
  245. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/utils.js +85 -1
  246. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/utils.js.map +1 -1
  247. package/node_modules/@aws-amplify/graphql-relational-transformer/package.json +9 -9
  248. package/node_modules/@aws-amplify/graphql-searchable-transformer/CHANGELOG.md +4 -2
  249. package/node_modules/@aws-amplify/graphql-searchable-transformer/lib/graphql-searchable-transformer.d.ts.map +1 -1
  250. package/node_modules/@aws-amplify/graphql-searchable-transformer/lib/graphql-searchable-transformer.js +3 -0
  251. package/node_modules/@aws-amplify/graphql-searchable-transformer/lib/graphql-searchable-transformer.js.map +1 -1
  252. package/node_modules/@aws-amplify/graphql-searchable-transformer/lib/streaming-lambda.zip +0 -0
  253. package/node_modules/@aws-amplify/graphql-searchable-transformer/package.json +7 -7
  254. package/node_modules/@aws-amplify/graphql-sql-transformer/API.md +26 -0
  255. package/node_modules/@aws-amplify/graphql-sql-transformer/CHANGELOG.md +14 -0
  256. package/node_modules/@aws-amplify/graphql-sql-transformer/LICENSE +201 -0
  257. package/node_modules/@aws-amplify/graphql-sql-transformer/README.md +13 -0
  258. package/node_modules/@aws-amplify/graphql-sql-transformer/lib/graphql-sql-transformer.d.ts +12 -0
  259. package/node_modules/@aws-amplify/graphql-sql-transformer/lib/graphql-sql-transformer.d.ts.map +1 -0
  260. package/node_modules/@aws-amplify/graphql-sql-transformer/lib/graphql-sql-transformer.js +132 -0
  261. package/node_modules/@aws-amplify/graphql-sql-transformer/lib/graphql-sql-transformer.js.map +1 -0
  262. package/node_modules/@aws-amplify/graphql-sql-transformer/lib/index.d.ts +2 -0
  263. package/node_modules/@aws-amplify/graphql-sql-transformer/lib/index.d.ts.map +1 -0
  264. package/node_modules/@aws-amplify/graphql-sql-transformer/lib/index.js +6 -0
  265. package/node_modules/@aws-amplify/graphql-sql-transformer/lib/index.js.map +1 -0
  266. package/node_modules/@aws-amplify/graphql-sql-transformer/package.json +71 -0
  267. package/node_modules/@aws-amplify/graphql-transformer/API.md +4 -0
  268. package/node_modules/@aws-amplify/graphql-transformer/CHANGELOG.md +11 -1
  269. package/node_modules/@aws-amplify/graphql-transformer/lib/graphql-transformer.d.ts +4 -1
  270. package/node_modules/@aws-amplify/graphql-transformer/lib/graphql-transformer.d.ts.map +1 -1
  271. package/node_modules/@aws-amplify/graphql-transformer/lib/graphql-transformer.js +7 -2
  272. package/node_modules/@aws-amplify/graphql-transformer/lib/graphql-transformer.js.map +1 -1
  273. package/node_modules/@aws-amplify/graphql-transformer/package.json +15 -14
  274. package/node_modules/@aws-amplify/graphql-transformer/src/graphql-transformer.ts +12 -2
  275. package/node_modules/@aws-amplify/graphql-transformer-core/API.md +33 -5
  276. package/node_modules/@aws-amplify/graphql-transformer-core/CHANGELOG.md +16 -1
  277. package/node_modules/@aws-amplify/graphql-transformer-core/lib/index.d.ts +2 -2
  278. package/node_modules/@aws-amplify/graphql-transformer-core/lib/index.d.ts.map +1 -1
  279. package/node_modules/@aws-amplify/graphql-transformer-core/lib/index.js +10 -2
  280. package/node_modules/@aws-amplify/graphql-transformer-core/lib/index.js.map +1 -1
  281. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transform-host.d.ts.map +1 -1
  282. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transform-host.js +2 -1
  283. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transform-host.js.map +1 -1
  284. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/sync-utils.d.ts.map +1 -1
  285. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/sync-utils.js.map +1 -1
  286. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/transform.d.ts +4 -3
  287. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/transform.d.ts.map +1 -1
  288. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/transform.js +3 -3
  289. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/transform.js.map +1 -1
  290. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/types.d.ts +1 -0
  291. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/types.d.ts.map +1 -1
  292. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/datasource.d.ts +4 -5
  293. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/datasource.d.ts.map +1 -1
  294. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/datasource.js.map +1 -1
  295. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/index.d.ts +5 -3
  296. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/index.d.ts.map +1 -1
  297. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/index.js +3 -1
  298. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/index.js.map +1 -1
  299. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/transform-parameters.d.ts.map +1 -1
  300. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/transform-parameters.js +2 -0
  301. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/transform-parameters.js.map +1 -1
  302. package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/import-appsync-api-types.d.ts +6 -5
  303. package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/import-appsync-api-types.d.ts.map +1 -1
  304. package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/import-appsync-api-types.js +4 -3
  305. package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/import-appsync-api-types.js.map +1 -1
  306. package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/index.d.ts +1 -1
  307. package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/index.d.ts.map +1 -1
  308. package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/index.js +3 -2
  309. package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/index.js.map +1 -1
  310. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/api-category.d.ts +2 -0
  311. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/api-category.d.ts.map +1 -0
  312. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/api-category.js +5 -0
  313. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/api-category.js.map +1 -0
  314. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/index.d.ts +3 -2
  315. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/index.d.ts.map +1 -1
  316. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/index.js +14 -3
  317. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/index.js.map +1 -1
  318. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/model-util.d.ts +3 -0
  319. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/model-util.d.ts.map +1 -0
  320. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/model-util.js +19 -0
  321. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/model-util.js.map +1 -0
  322. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/rds-util.d.ts +12 -0
  323. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/rds-util.d.ts.map +1 -0
  324. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/rds-util.js +82 -0
  325. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/rds-util.js.map +1 -0
  326. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/schema-utils.d.ts +3 -2
  327. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/schema-utils.d.ts.map +1 -1
  328. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/schema-utils.js +7 -1
  329. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/schema-utils.js.map +1 -1
  330. package/node_modules/@aws-amplify/graphql-transformer-core/lib/wrappers/object-definition-wrapper.d.ts +1 -1
  331. package/node_modules/@aws-amplify/graphql-transformer-core/lib/wrappers/object-definition-wrapper.d.ts.map +1 -1
  332. package/node_modules/@aws-amplify/graphql-transformer-core/package.json +4 -4
  333. package/node_modules/@aws-amplify/graphql-transformer-interfaces/API.md +47 -14
  334. package/node_modules/@aws-amplify/graphql-transformer-interfaces/CHANGELOG.md +7 -1
  335. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/graphql-api-provider.d.ts +15 -8
  336. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/graphql-api-provider.d.ts.map +1 -1
  337. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/graphql-api-provider.js.map +1 -1
  338. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/index.d.ts +1 -1
  339. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/index.d.ts.map +1 -1
  340. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/index.js.map +1 -1
  341. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/index.d.ts +1 -1
  342. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/index.d.ts.map +1 -1
  343. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/index.js +2 -1
  344. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/index.js.map +1 -1
  345. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/transform-parameters.d.ts +2 -0
  346. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/transform-parameters.d.ts.map +1 -1
  347. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/transformer-context-provider.d.ts +3 -1
  348. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/transformer-context-provider.d.ts.map +1 -1
  349. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/transformer-datasource-provider.d.ts +9 -5
  350. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/transformer-datasource-provider.d.ts.map +1 -1
  351. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/transformer-datasource-provider.js +5 -1
  352. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/transformer-datasource-provider.js.map +1 -1
  353. package/node_modules/@aws-amplify/graphql-transformer-interfaces/package.json +2 -2
  354. package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/graphql-api-provider.ts +38 -11
  355. package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/index.ts +3 -0
  356. package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/transformer-context/index.ts +2 -0
  357. package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/transformer-context/transform-parameters.ts +2 -0
  358. package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/transformer-context/transformer-context-provider.ts +9 -1
  359. package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/transformer-context/transformer-datasource-provider.ts +28 -7
  360. package/node_modules/@aws-amplify/graphql-transformer-interfaces/tsconfig.tsbuildinfo +1 -1
  361. package/node_modules/graphql-transformer-common/API.md +33 -9
  362. package/node_modules/graphql-transformer-common/CHANGELOG.md +9 -1
  363. package/node_modules/graphql-transformer-common/lib/ResourceConstants.d.ts +12 -9
  364. package/node_modules/graphql-transformer-common/lib/ResourceConstants.d.ts.map +1 -1
  365. package/node_modules/graphql-transformer-common/lib/ResourceConstants.js +12 -9
  366. package/node_modules/graphql-transformer-common/lib/ResourceConstants.js.map +1 -1
  367. package/node_modules/graphql-transformer-common/lib/definition.d.ts +9 -2
  368. package/node_modules/graphql-transformer-common/lib/definition.d.ts.map +1 -1
  369. package/node_modules/graphql-transformer-common/lib/definition.js +52 -1
  370. package/node_modules/graphql-transformer-common/lib/definition.js.map +1 -1
  371. package/node_modules/graphql-transformer-common/lib/util.d.ts.map +1 -1
  372. package/node_modules/graphql-transformer-common/lib/util.js +3 -1
  373. package/node_modules/graphql-transformer-common/lib/util.js.map +1 -1
  374. package/node_modules/graphql-transformer-common/package.json +5 -5
  375. package/package.json +31 -29
  376. package/src/amplify-graphql-api.ts +82 -5
  377. package/src/amplify-graphql-definition.ts +34 -21
  378. package/src/index.ts +14 -5
  379. package/src/internal/data-source-config.ts +27 -9
  380. package/src/internal/default-parameters.ts +2 -0
  381. package/src/internal/model-type-name.ts +28 -19
  382. package/src/sql-model-datasource-strategy.ts +62 -0
  383. package/src/types.ts +208 -45
  384. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/field.d.ts.map +0 -1
  385. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/field.js.map +0 -1
  386. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/helpers.d.ts.map +0 -1
  387. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/helpers.js.map +0 -1
  388. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/index.d.ts.map +0 -1
  389. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/index.js.map +0 -1
  390. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/mutation.create.d.ts.map +0 -1
  391. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/mutation.create.js.map +0 -1
  392. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/mutation.delete.d.ts.map +0 -1
  393. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/mutation.delete.js.map +0 -1
  394. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/mutation.update.d.ts.map +0 -1
  395. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/mutation.update.js.map +0 -1
  396. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/query.d.ts +0 -6
  397. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/query.d.ts.map +0 -1
  398. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/query.js.map +0 -1
  399. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/search.d.ts.map +0 -1
  400. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/search.js.map +0 -1
  401. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/subscriptions.d.ts.map +0 -1
  402. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/subscriptions.js.map +0 -1
  403. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/rds-secret-utils.d.ts +0 -2
  404. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/rds-secret-utils.d.ts.map +0 -1
  405. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/rds-secret-utils.js +0 -25
  406. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/rds-secret-utils.js.map +0 -1
  407. /package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{resolvers → vtl-generator/ddb/resolvers}/index.d.ts +0 -0
  408. /package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{resolvers → vtl-generator/ddb/resolvers}/index.js +0 -0
@@ -1,6 +1,6 @@
1
1
  import * as path from 'path';
2
2
  import { Construct } from 'constructs';
3
- import { executeTransform } from '@aws-amplify/graphql-transformer';
3
+ import { ExecuteTransformConfig, executeTransform } from '@aws-amplify/graphql-transformer';
4
4
  import { NestedStack, Stack } from 'aws-cdk-lib';
5
5
  import { Asset } from 'aws-cdk-lib/aws-s3-assets';
6
6
  import { AssetProps } from '@aws-amplify/graphql-transformer-interfaces';
@@ -29,6 +29,7 @@ import { IEventBus } from 'aws-cdk-lib/aws-events';
29
29
  import { IFunction } from 'aws-cdk-lib/aws-lambda';
30
30
  import { IServerlessCluster } from 'aws-cdk-lib/aws-rds';
31
31
  import { ISecret } from 'aws-cdk-lib/aws-secretsmanager';
32
+ import { MYSQL_DB_TYPE, POSTGRES_DB_TYPE, RDSConnectionSecrets } from '@aws-amplify/graphql-transformer-core';
32
33
  import { parseUserDefinedSlots, validateFunctionSlots, separateSlots } from './internal/user-defined-slots';
33
34
  import type {
34
35
  AmplifyGraphqlApiResources,
@@ -37,6 +38,7 @@ import type {
37
38
  IBackendOutputStorageStrategy,
38
39
  AddFunctionProps,
39
40
  ConflictResolution,
41
+ SQLLambdaModelDataSourceStrategy,
40
42
  } from './types';
41
43
  import {
42
44
  convertAuthorizationModesToTransformerAuthConfig,
@@ -48,6 +50,7 @@ import {
48
50
  CodegenAssets,
49
51
  getAdditionalAuthenticationTypes,
50
52
  } from './internal';
53
+ import { isSQLLambdaModelDataSourceStrategy } from './sql-model-datasource-strategy';
51
54
  import { parseDataSourceConfig } from './internal/data-source-config';
52
55
  import { getStackForScope, walkAndProcessNodes } from './internal/construct-tree';
53
56
 
@@ -170,7 +173,7 @@ export class AmplifyGraphqlApi extends Construct {
170
173
 
171
174
  const assetManager = new AssetManager();
172
175
 
173
- executeTransform({
176
+ let executeTransformConfig: ExecuteTransformConfig = {
174
177
  scope: this,
175
178
  nestedStackProvider: {
176
179
  provide: (nestedStackScope: Construct, name: string) => new NestedStack(nestedStackScope, name),
@@ -189,7 +192,10 @@ export class AmplifyGraphqlApi extends Construct {
189
192
  transformersFactoryArgs: {
190
193
  customTransformers: transformerPlugins ?? [],
191
194
  ...(predictionsBucket ? { storageConfig: { bucketName: predictionsBucket.bucketName } } : {}),
192
- functionNameMap,
195
+ functionNameMap: {
196
+ ...definition.referencedLambdaFunctions,
197
+ ...functionNameMap,
198
+ },
193
199
  },
194
200
  authConfig,
195
201
  stackMapping: stackMappings ?? {},
@@ -198,8 +204,20 @@ export class AmplifyGraphqlApi extends Construct {
198
204
  ...defaultTranslationBehavior,
199
205
  ...(translationBehavior ?? {}),
200
206
  },
201
- ...parseDataSourceConfig(definition.dataSourceDefinition),
202
- });
207
+
208
+ // Adds a modelToDataSourceMap field/value
209
+ ...parseDataSourceConfig(definition.dataSourceStrategies),
210
+ };
211
+
212
+ // TODO: Update this to support multiple definitions; right now we assume only one SQL data source type
213
+ for (const strategy of Object.values(definition.dataSourceStrategies)) {
214
+ if (isSQLLambdaModelDataSourceStrategy(strategy)) {
215
+ executeTransformConfig = this.extendTransformConfig(executeTransformConfig, strategy);
216
+ break;
217
+ }
218
+ }
219
+
220
+ executeTransform(executeTransformConfig);
203
221
 
204
222
  this.codegenAssets = new CodegenAssets(this, 'AmplifyCodegenAssets', { modelSchema: definition.schema });
205
223
 
@@ -214,6 +232,65 @@ export class AmplifyGraphqlApi extends Construct {
214
232
  this.apiKey = this.resources.cfnResources.cfnApiKey?.attrApiKey;
215
233
  }
216
234
 
235
+ /**
236
+ * Extends executeTransformConfig with fields for provisioning a SQL Lambda
237
+ * @param executeTransformConfig the executeTransformConfig to extend
238
+ * @param dataSourceDefinition the SQLLambdaModelDataSourceStrategy containing the SQL connection values to add to the transform config
239
+ * @returns the extended configuration that includes SQL DB connection information
240
+ */
241
+ private extendTransformConfig(
242
+ executeTransformConfig: ExecuteTransformConfig,
243
+ strategy: SQLLambdaModelDataSourceStrategy,
244
+ ): ExecuteTransformConfig {
245
+ const extendedConfig = { ...executeTransformConfig };
246
+ if (strategy.customSqlStatements) {
247
+ extendedConfig.customQueries = new Map(Object.entries(strategy.customSqlStatements));
248
+ }
249
+
250
+ const dbSecrets: Map<string, RDSConnectionSecrets> = new Map();
251
+ let dbSecretDbTypeKey: string;
252
+ switch (strategy.dbType) {
253
+ case 'MYSQL':
254
+ dbSecretDbTypeKey = MYSQL_DB_TYPE;
255
+ break;
256
+ case 'POSTGRES':
257
+ dbSecretDbTypeKey = POSTGRES_DB_TYPE;
258
+ break;
259
+ default:
260
+ throw new Error(`Unsupported binding type ${strategy.dbType}`);
261
+ }
262
+ dbSecrets.set(dbSecretDbTypeKey, {
263
+ username: strategy.dbConnectionConfig.usernameSsmPath,
264
+ password: strategy.dbConnectionConfig.passwordSsmPath,
265
+ host: strategy.dbConnectionConfig.hostnameSsmPath,
266
+ // Cast through `any` to allow the SSM Path string to be used on a type expecting a number. This flow expects the incoming value to be
267
+ // a string containing the SSM path.
268
+ port: strategy.dbConnectionConfig.portSsmPath as any,
269
+ database: strategy.dbConnectionConfig.databaseNameSsmPath,
270
+ });
271
+ extendedConfig.datasourceSecretParameterLocations = dbSecrets;
272
+
273
+ if (strategy.vpcConfiguration) {
274
+ const subnetAvailabilityZoneConfig = strategy.vpcConfiguration.subnetAvailabilityZoneConfig.map(
275
+ (saz): { subnetId: string; availabilityZone: string } => ({
276
+ subnetId: saz.subnetId,
277
+ availabilityZone: saz.availabilityZone,
278
+ }),
279
+ );
280
+ extendedConfig.sqlLambdaVpcConfig = {
281
+ vpcId: strategy.vpcConfiguration.vpcId,
282
+ securityGroupIds: strategy.vpcConfiguration.securityGroupIds,
283
+ subnetAvailabilityZoneConfig,
284
+ };
285
+ }
286
+
287
+ if (strategy.sqlLambdaProvisionedConcurrencyConfig) {
288
+ extendedConfig.sqlLambdaProvisionedConcurrencyConfig = strategy.sqlLambdaProvisionedConcurrencyConfig;
289
+ }
290
+
291
+ return extendedConfig;
292
+ }
293
+
217
294
  /**
218
295
  * Stores graphql api output to be used for client config generation
219
296
  * @param outputStorageStrategy Strategy to store construct outputs. If no strategy is provided a default strategy will be used.
@@ -1,41 +1,44 @@
1
1
  import * as os from 'os';
2
2
  import { SchemaFile } from 'aws-cdk-lib/aws-appsync';
3
- import { IAmplifyGraphqlDefinition, ModelDataSourceDefinition } from './types';
4
- import { constructDataSourceDefinitionMap } from './internal';
3
+ import { IAmplifyGraphqlDefinition, ModelDataSourceStrategy } from './types';
4
+ import { constructDataSourceStrategyMap } from './internal';
5
5
 
6
- export const DEFAULT_MODEL_DATA_SOURCE_DEFINITION: ModelDataSourceDefinition = {
7
- name: 'DefaultDynamoDB',
8
- strategy: {
9
- dbType: 'DYNAMODB',
10
- provisionStrategy: 'DEFAULT',
11
- },
6
+ export const DEFAULT_MODEL_DATA_SOURCE_STRATEGY: ModelDataSourceStrategy = {
7
+ dbType: 'DYNAMODB',
8
+ provisionStrategy: 'DEFAULT',
12
9
  };
10
+
13
11
  /**
14
12
  * Class exposing utilities to produce IAmplifyGraphqlDefinition objects given various inputs.
15
13
  */
16
14
  export class AmplifyGraphqlDefinition {
17
15
  /**
18
- * Produce a schema definition from a string input
16
+ * Produce a schema definition from a string input.
17
+ *
18
+ * **NOTE** The 'dataSourceStrategy' configuration option is in preview and is not recommended to use with production systems.
19
+ *
19
20
  * @param schema the graphql input as a string
20
- * @param modelDataSourceDefinition the provision definition for `@model` datasource. The DynamoDB from CloudFormation will be used by default.
21
- * @experimental modelDataSourceDefinition
21
+ * @param dataSourceStrategy the provisioning definition for datasources that resolve `@model`s in this schema. The DynamoDB from
22
+ * CloudFormation will be used by default.
23
+ * @experimental dataSourceStrategy
22
24
  * @returns a fully formed amplify graphql definition
23
25
  */
24
26
  static fromString(
25
27
  schema: string,
26
- modelDataSourceDefinition: ModelDataSourceDefinition = DEFAULT_MODEL_DATA_SOURCE_DEFINITION,
28
+ dataSourceStrategy: ModelDataSourceStrategy = DEFAULT_MODEL_DATA_SOURCE_STRATEGY,
27
29
  ): IAmplifyGraphqlDefinition {
28
30
  return {
29
31
  schema,
30
32
  functionSlots: [],
31
- dataSourceDefinition: constructDataSourceDefinitionMap(schema, modelDataSourceDefinition),
33
+ referencedLambdaFunctions: {},
34
+ dataSourceStrategies: constructDataSourceStrategyMap(schema, dataSourceStrategy),
32
35
  };
33
36
  }
34
37
 
35
38
  /**
36
- * Convert one or more appsync SchemaFile objects into an Amplify Graphql Schema
39
+ * Convert one or more appsync SchemaFile objects into an Amplify Graphql Schema, binding them to a DynamoDB data source.
37
40
  * @param filePaths one or more paths to the graphql files to process
38
- * @returns a fully formed amplify graphql definition
41
+ * @returns a fully formed amplify graphql definition, whose models will be resolved by DynamoDB tables created during deployment.
39
42
  */
40
43
  static fromFiles(...filePaths: string[]): IAmplifyGraphqlDefinition {
41
44
  if (!Array.isArray(filePaths)) {
@@ -45,20 +48,25 @@ export class AmplifyGraphqlDefinition {
45
48
  return {
46
49
  schema,
47
50
  functionSlots: [],
48
- dataSourceDefinition: constructDataSourceDefinitionMap(schema, DEFAULT_MODEL_DATA_SOURCE_DEFINITION),
51
+ referencedLambdaFunctions: {},
52
+ dataSourceStrategies: constructDataSourceStrategyMap(schema, DEFAULT_MODEL_DATA_SOURCE_STRATEGY),
49
53
  };
50
54
  }
51
55
 
52
56
  /**
53
57
  * Convert one or more appsync SchemaFile objects into an Amplify Graphql Schema
58
+ *
59
+ * **NOTE** This API is in preview and is not recommended to use with production systems.
60
+ *
54
61
  * @experimental
55
62
  * @param filePaths one or more paths to the graphql files to process
56
- * @param modelDataSourceDefinition the provision definition for `@model` datasource. The DynamoDB from CloudFormation will be used by default.
63
+ * @param dataSourceStrategy the provisioning definition for datasources that resolve `@model`s in this schema. The DynamoDB from
64
+ * CloudFormation will be used by default.
57
65
  * @returns a fully formed amplify graphql definition
58
66
  */
59
- static fromFilesAndDefinition(
67
+ static fromFilesAndStrategy(
60
68
  filePaths: string | string[],
61
- modelDataSourceDefinition: ModelDataSourceDefinition = DEFAULT_MODEL_DATA_SOURCE_DEFINITION,
69
+ dataSourceStrategy: ModelDataSourceStrategy = DEFAULT_MODEL_DATA_SOURCE_STRATEGY,
62
70
  ): IAmplifyGraphqlDefinition {
63
71
  if (!Array.isArray(filePaths)) {
64
72
  filePaths = [filePaths];
@@ -67,12 +75,16 @@ export class AmplifyGraphqlDefinition {
67
75
  return {
68
76
  schema,
69
77
  functionSlots: [],
70
- dataSourceDefinition: constructDataSourceDefinitionMap(schema, modelDataSourceDefinition),
78
+ referencedLambdaFunctions: {},
79
+ dataSourceStrategies: constructDataSourceStrategyMap(schema, dataSourceStrategy),
71
80
  };
72
81
  }
73
82
 
74
83
  /**
75
84
  * Combines multiple IAmplifyGraphqlDefinitions into a single definition.
85
+ *
86
+ * **NOTE** This API is in preview and is not recommended to use with production systems.
87
+ *
76
88
  * @experimental
77
89
  * @param definitions the definitions to combine
78
90
  */
@@ -86,7 +98,8 @@ export class AmplifyGraphqlDefinition {
86
98
  return {
87
99
  schema: definitions.map((def) => def.schema).join(os.EOL),
88
100
  functionSlots: [],
89
- dataSourceDefinition: definitions.reduce((acc, cur) => ({ ...acc, ...cur.dataSourceDefinition }), {}),
101
+ referencedLambdaFunctions: definitions.reduce((acc, cur) => ({ ...acc, ...cur.referencedLambdaFunctions }), {}),
102
+ dataSourceStrategies: definitions.reduce((acc, cur) => ({ ...acc, ...cur.dataSourceStrategies }), {}),
90
103
  };
91
104
  }
92
105
  }
package/src/index.ts CHANGED
@@ -1,3 +1,7 @@
1
+ /* ATTENTION
2
+ *
3
+ * If you modify this file your must also modify packages/amplify-data-construct/src/index.ts to have the same exports
4
+ */
1
5
  export type {
2
6
  IAMAuthorizationConfig,
3
7
  UserPoolAuthorizationConfig,
@@ -27,11 +31,16 @@ export type {
27
31
  IBackendOutputStorageStrategy,
28
32
  IBackendOutputEntry,
29
33
  AddFunctionProps,
30
- ModelDataSourceDefinition,
31
- ModelDataSourceDefinitionStrategy,
32
- DefaultDynamoDbModelDataSourceDefinitionStrategy,
33
- AmplifyDynamoDbModelDataSourceDefinitionStrategy,
34
- ModelDataSourceDefinitionDbType,
34
+ ModelDataSourceStrategy,
35
+ DefaultDynamoDbModelDataSourceStrategy,
36
+ AmplifyDynamoDbModelDataSourceStrategy,
37
+ SQLLambdaModelDataSourceStrategy,
38
+ ModelDataSourceStrategyDbType,
39
+ VpcConfig,
40
+ SubnetAvailabilityZone,
41
+ SQLLambdaLayerMapping,
42
+ SqlModelDataSourceDbConnectionConfig,
43
+ ProvisionedConcurrencyConfig,
35
44
  } from './types';
36
45
  export { AmplifyGraphqlApi } from './amplify-graphql-api';
37
46
  export { AmplifyGraphqlDefinition } from './amplify-graphql-definition';
@@ -1,13 +1,21 @@
1
- import { ModelDataSourceDefinition } from '../types';
2
- import { DataSourceType, DynamoDBProvisionStrategy } from '@aws-amplify/graphql-transformer-interfaces';
1
+ import {
2
+ DataSourceType,
3
+ DynamoDBProvisionStrategy,
4
+ SQLDBType,
5
+ SQLLambdaModelProvisionStrategy,
6
+ } from '@aws-amplify/graphql-transformer-interfaces';
7
+ import { ModelDataSourceStrategy } from '../types';
3
8
 
4
9
  type DataSourceConfig = {
5
10
  modelToDatasourceMap: Map<string, DataSourceType>;
6
11
  };
7
- const convertToDataSourceType = (modelDataSourceDefinition: ModelDataSourceDefinition): DataSourceType => {
8
- const { strategy } = modelDataSourceDefinition;
9
- if (strategy.dbType === 'DYNAMODB') {
10
- switch (strategy.provisionStrategy) {
12
+
13
+ // TODO: Do away with this after we normalize database types throughout the internals
14
+ const convertSQLDBType = (definitionDBType: 'MYSQL' | 'POSTGRES'): SQLDBType => (definitionDBType === 'MYSQL' ? 'MySQL' : 'Postgres');
15
+
16
+ const convertToDataSourceType = (dataSourceStrategy: ModelDataSourceStrategy): DataSourceType => {
17
+ if (dataSourceStrategy.dbType === 'DYNAMODB') {
18
+ switch (dataSourceStrategy.provisionStrategy) {
11
19
  case 'DEFAULT':
12
20
  return {
13
21
  dbType: 'DDB',
@@ -21,13 +29,23 @@ const convertToDataSourceType = (modelDataSourceDefinition: ModelDataSourceDefin
21
29
  provisionStrategy: DynamoDBProvisionStrategy.AMPLIFY_TABLE,
22
30
  };
23
31
  default:
24
- throw new Error(`Encountered unexpected provision strategy: ${(strategy as any).provisionStrategy}`);
32
+ throw new Error(`Encountered unexpected provision strategy: ${(dataSourceStrategy as any).provisionStrategy}`);
25
33
  }
34
+ } else if (dataSourceStrategy.dbType === 'MYSQL' || dataSourceStrategy.dbType === 'POSTGRES') {
35
+ return {
36
+ dbType: convertSQLDBType(dataSourceStrategy.dbType),
37
+ provisionDB: false,
38
+ provisionStrategy: SQLLambdaModelProvisionStrategy.DEFAULT,
39
+ };
26
40
  }
27
- throw new Error(`Encountered unexpected database type ${strategy.dbType}`);
41
+ throw new Error(`Encountered unexpected database type ${dataSourceStrategy.dbType}`);
28
42
  };
29
43
 
30
- export const parseDataSourceConfig = (dataSourceDefinitionMap: Record<string, ModelDataSourceDefinition>): DataSourceConfig => {
44
+ /**
45
+ * An internal helper to convert from a map of model-to-ModelDataSourceStrategies to the map of model-to-DataSourceTypes that internal
46
+ * transform processing requires. TODO: We can remove this once we refactor the internals to use ModelDataSourceStrategies natively.
47
+ */
48
+ export const parseDataSourceConfig = (dataSourceDefinitionMap: Record<string, ModelDataSourceStrategy>): DataSourceConfig => {
31
49
  const modelToDatasourceMap = new Map<string, DataSourceType>();
32
50
  for (const [key, value] of Object.entries(dataSourceDefinitionMap)) {
33
51
  const dataSourceType = convertToDataSourceType(value);
@@ -17,4 +17,6 @@ export const defaultTranslationBehavior: TranslationBehavior = {
17
17
  respectPrimaryKeyAttributesOnConnectionField: true,
18
18
  enableSearchNodeToNodeEncryption: false,
19
19
  enableTransformerCfnOutputs: false,
20
+ allowDestructiveGraphqlSchemaUpdates: false,
21
+ replaceTableUponGsiUpdate: false,
20
22
  };
@@ -1,30 +1,39 @@
1
- import { Kind, ObjectTypeDefinitionNode, parse } from 'graphql';
2
- import { ModelDataSourceDefinition } from '../types';
1
+ import { ModelDataSourceStrategy } from '../types';
2
+ import { Kind, ObjectTypeDefinitionNode, StringValueNode, parse } from 'graphql';
3
3
 
4
4
  const MODEL_DIRECTIVE_NAME = 'model';
5
+ const MANY_TO_MANY_DIRECTIVE_NAME = 'manyToMany';
5
6
  /**
6
7
  * Get the type names with model directives in the GraphQL schema in SDL
7
8
  * @param schema graphql schema in SDL
8
9
  * @returns type names which model diretives are attached
9
10
  */
10
11
  export function getModelTypeNames(schema: string): string[] {
11
- const parsedDocument = parse(schema);
12
- const nodesWithModelDirective = parsedDocument.definitions.filter(
13
- (def) =>
14
- def.kind === Kind.OBJECT_TYPE_DEFINITION &&
15
- def.directives &&
16
- def.directives.find((dir) => dir.name.value === MODEL_DIRECTIVE_NAME) != undefined,
17
- ) as ObjectTypeDefinitionNode[];
18
- return nodesWithModelDirective.map((node) => node.name.value);
12
+ const parsedSchema = parse(schema);
13
+ const nodesWithModelDirective = parsedSchema.definitions.filter(
14
+ (obj) => obj.kind === Kind.OBJECT_TYPE_DEFINITION && obj.directives?.some((dir) => dir.name.value === MODEL_DIRECTIVE_NAME),
15
+ );
16
+ const modelKeys = nodesWithModelDirective.map((type) => (type as ObjectTypeDefinitionNode).name.value);
17
+ nodesWithModelDirective.forEach((obj) => {
18
+ const { fields } = obj as ObjectTypeDefinitionNode;
19
+ fields?.forEach((field) => {
20
+ field.directives?.forEach((dir) => {
21
+ if (dir.name.value === MANY_TO_MANY_DIRECTIVE_NAME) {
22
+ const relationArg = dir.arguments?.find((arg) => arg.name.value === 'relationName');
23
+ if (relationArg) {
24
+ modelKeys.push((relationArg.value as StringValueNode).value);
25
+ }
26
+ }
27
+ });
28
+ });
29
+ });
30
+ return modelKeys.filter((key, idx) => modelKeys.indexOf(key) === idx);
19
31
  }
20
32
 
21
- export function constructDataSourceDefinitionMap(
33
+ export const constructDataSourceStrategyMap = (
22
34
  schema: string,
23
- dataSourceDefinition: ModelDataSourceDefinition,
24
- ): Record<string, ModelDataSourceDefinition> {
25
- const parsedSchema = parse(schema);
26
- return parsedSchema.definitions
27
- .filter((obj) => obj.kind === Kind.OBJECT_TYPE_DEFINITION && obj.directives?.some((dir) => dir.name.value === MODEL_DIRECTIVE_NAME))
28
- .map((type) => (type as ObjectTypeDefinitionNode).name.value)
29
- .reduce((acc, cur) => ({ ...acc, [cur]: dataSourceDefinition }), {});
30
- }
35
+ dataSourceStrategy: ModelDataSourceStrategy,
36
+ ): Record<string, ModelDataSourceStrategy> => {
37
+ const modelKeys = getModelTypeNames(schema);
38
+ return modelKeys.reduce((acc, cur) => ({ ...acc, [cur]: dataSourceStrategy }), {});
39
+ };
@@ -0,0 +1,62 @@
1
+ import * as fs from 'fs';
2
+ import * as path from 'path';
3
+ import { SQLLambdaModelDataSourceStrategy, SqlModelDataSourceDbConnectionConfig } from './types';
4
+
5
+ /**
6
+ * Type predicate that returns true if the object is a SQLLambdaModelDataSourceStrategy.
7
+ * @param obj the object to inspect
8
+ * @returns true if the object is shaped like a SQLLambdaModelDataSourceStrategy
9
+ */
10
+ export const isSQLLambdaModelDataSourceStrategy = (obj: any): obj is SQLLambdaModelDataSourceStrategy => {
11
+ return (
12
+ (typeof obj === 'object' || typeof obj === 'function') &&
13
+ typeof obj.name === 'string' &&
14
+ typeof obj.dbType === 'string' &&
15
+ // TODO: Use canonical SQL DB type strings
16
+ ['MYSQL', 'POSTGRES'].includes(obj.dbType) &&
17
+ isSqlModelDataSourceDbConnectionConfig(obj.dbConnectionConfig)
18
+ );
19
+ };
20
+
21
+ /**
22
+ * Type predicate that returns true if the object is a SqlModelDataSourceDbConnectionConfig.
23
+ * @param obj the object to inspect
24
+ * @returns true if the object is shaped like a SqlModelDataSourceDbConnectionConfig
25
+ */
26
+ export const isSqlModelDataSourceDbConnectionConfig = (obj: any): obj is SqlModelDataSourceDbConnectionConfig => {
27
+ return (
28
+ (typeof obj === 'object' || typeof obj === 'function') &&
29
+ typeof obj.hostnameSsmPath === 'string' &&
30
+ typeof obj.portSsmPath === 'string' &&
31
+ typeof obj.usernameSsmPath === 'string' &&
32
+ typeof obj.passwordSsmPath === 'string' &&
33
+ typeof obj.databaseNameSsmPath === 'string'
34
+ );
35
+ };
36
+
37
+ /**
38
+ * Class exposing utilities to produce SQLLambdaModelDataSourceStrategy objects given various inputs.
39
+ */
40
+ export class SQLLambdaModelDataSourceStrategyFactory {
41
+ /**
42
+ * Creates a SQLLambdaModelDataSourceStrategy where the binding's `customSqlStatements` are populated from `sqlFiles`. The key
43
+ * of the `customSqlStatements` record is the file's base name (that is, the name of the file minus the directory and extension).
44
+ * @param sqlFiles the list of files to load SQL statements from.
45
+ * @param options the remaining SQLLambdaModelDataSourceStrategy options.
46
+ */
47
+ static fromCustomSqlFiles(
48
+ sqlFiles: string[],
49
+ options: Exclude<SQLLambdaModelDataSourceStrategy, 'customSqlStatements'>,
50
+ ): SQLLambdaModelDataSourceStrategy {
51
+ const customSqlStatements = sqlFiles.reduce((acc, filePath): Record<string, string> => {
52
+ const basename = path.parse(filePath).name;
53
+ acc[basename] = fs.readFileSync(filePath, 'utf8');
54
+ return acc;
55
+ }, {} as Record<string, string>);
56
+
57
+ return {
58
+ customSqlStatements,
59
+ ...options,
60
+ };
61
+ }
62
+ }