@aws-amplify/graphql-api-construct 1.3.0-rds-5.0 → 1.4.0-construct-publish-test.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 (520) hide show
  1. package/.jsii +774 -465
  2. package/API.md +67 -28
  3. package/CHANGELOG.md +19 -3
  4. package/README.md +1039 -401
  5. package/lib/amplify-dynamodb-table-wrapper.d.ts +128 -0
  6. package/lib/amplify-dynamodb-table-wrapper.js +102 -0
  7. package/lib/amplify-graphql-api.d.ts +4 -6
  8. package/lib/amplify-graphql-api.js +12 -61
  9. package/lib/amplify-graphql-definition.d.ts +19 -13
  10. package/lib/amplify-graphql-definition.js +58 -21
  11. package/lib/index.d.ts +2 -1
  12. package/lib/index.js +5 -2
  13. package/lib/internal/authorization-modes.js +20 -2
  14. package/lib/internal/construct-exports.js +8 -1
  15. package/lib/internal/data-source-config.d.ts +7 -0
  16. package/lib/internal/data-source-config.js +37 -0
  17. package/lib/internal/index.d.ts +1 -1
  18. package/lib/internal/index.js +2 -2
  19. package/lib/internal/model-type-name.d.ts +8 -0
  20. package/lib/internal/model-type-name.js +27 -0
  21. package/lib/types.d.ts +52 -102
  22. package/lib/types.js +1 -1
  23. package/node_modules/@aws-amplify/backend-output-schemas/lib/auth/index.js +8 -9
  24. package/node_modules/@aws-amplify/backend-output-schemas/lib/auth/v1.js +16 -18
  25. package/node_modules/@aws-amplify/backend-output-schemas/lib/graphql/index.js +11 -16
  26. package/node_modules/@aws-amplify/backend-output-schemas/lib/graphql/v1.js +23 -19
  27. package/node_modules/@aws-amplify/backend-output-schemas/lib/index.d.ts +12 -1
  28. package/node_modules/@aws-amplify/backend-output-schemas/lib/index.js +38 -60
  29. package/node_modules/@aws-amplify/backend-output-schemas/lib/platform/index.js +16 -14
  30. package/node_modules/@aws-amplify/backend-output-schemas/lib/platform/stack_metadata_schemas.js +7 -9
  31. package/node_modules/@aws-amplify/backend-output-schemas/lib/stack/index.d.ts +5 -0
  32. package/node_modules/@aws-amplify/backend-output-schemas/lib/stack/index.js +8 -9
  33. package/node_modules/@aws-amplify/backend-output-schemas/lib/stack/v1.d.ts +5 -0
  34. package/node_modules/@aws-amplify/backend-output-schemas/lib/stack/v1.js +10 -11
  35. package/node_modules/@aws-amplify/backend-output-schemas/lib/storage/index.js +8 -9
  36. package/node_modules/@aws-amplify/backend-output-schemas/lib/storage/v1.js +10 -12
  37. package/node_modules/@aws-amplify/backend-output-schemas/package.json +4 -23
  38. package/node_modules/@aws-amplify/backend-output-storage/lib/index.d.ts +1 -0
  39. package/node_modules/@aws-amplify/backend-output-storage/lib/index.js +17 -14
  40. package/node_modules/@aws-amplify/backend-output-storage/lib/stack_metadata_output_storage_strategy.js +28 -32
  41. package/node_modules/@aws-amplify/backend-output-storage/lib/store_attribution_metadata.d.ts +50 -0
  42. package/node_modules/@aws-amplify/backend-output-storage/lib/store_attribution_metadata.js +104 -0
  43. package/node_modules/@aws-amplify/backend-output-storage/node_modules/@aws-amplify/platform-core/lib/backend_deployment_type.d.ts +5 -0
  44. package/node_modules/@aws-amplify/backend-output-storage/node_modules/@aws-amplify/platform-core/lib/backend_deployment_type.js +9 -0
  45. package/node_modules/@aws-amplify/backend-output-storage/node_modules/@aws-amplify/platform-core/lib/cdk_context_key.d.ts +9 -0
  46. package/node_modules/@aws-amplify/backend-output-storage/node_modules/@aws-amplify/platform-core/lib/cdk_context_key.js +13 -0
  47. package/node_modules/@aws-amplify/backend-output-storage/node_modules/@aws-amplify/platform-core/lib/index.d.ts +4 -0
  48. package/node_modules/@aws-amplify/backend-output-storage/node_modules/@aws-amplify/platform-core/lib/index.js +22 -0
  49. package/node_modules/@aws-amplify/backend-output-storage/node_modules/@aws-amplify/platform-core/lib/unique_backend_identifier.d.ts +53 -0
  50. package/node_modules/@aws-amplify/backend-output-storage/node_modules/@aws-amplify/platform-core/lib/unique_backend_identifier.js +74 -0
  51. package/node_modules/@aws-amplify/backend-output-storage/node_modules/@aws-amplify/platform-core/package.json +23 -0
  52. package/node_modules/@aws-amplify/backend-output-storage/package.json +6 -4
  53. package/node_modules/@aws-amplify/graphql-auth-transformer/API.md +1 -5
  54. package/node_modules/@aws-amplify/graphql-auth-transformer/CHANGELOG.md +4 -12
  55. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/graphql-auth-transformer.d.ts +1 -3
  56. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/graphql-auth-transformer.d.ts.map +1 -1
  57. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/graphql-auth-transformer.js +50 -64
  58. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/graphql-auth-transformer.js.map +1 -1
  59. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{vtl-generator/ddb/resolvers → resolvers}/field.d.ts +1 -1
  60. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/field.d.ts.map +1 -0
  61. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{vtl-generator/ddb/resolvers → resolvers}/field.js +1 -1
  62. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/field.js.map +1 -0
  63. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{vtl-generator/ddb/resolvers → resolvers}/helpers.d.ts +1 -1
  64. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/helpers.d.ts.map +1 -0
  65. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{vtl-generator/ddb/resolvers → resolvers}/helpers.js +1 -1
  66. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/helpers.js.map +1 -0
  67. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/index.d.ts.map +1 -0
  68. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/index.js.map +1 -0
  69. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{vtl-generator/ddb/resolvers → resolvers}/mutation.create.d.ts +1 -1
  70. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/mutation.create.d.ts.map +1 -0
  71. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{vtl-generator/ddb/resolvers → resolvers}/mutation.create.js +1 -1
  72. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/mutation.create.js.map +1 -0
  73. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{vtl-generator/ddb/resolvers → resolvers}/mutation.delete.d.ts +1 -1
  74. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/mutation.delete.d.ts.map +1 -0
  75. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{vtl-generator/ddb/resolvers → resolvers}/mutation.delete.js +1 -1
  76. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/mutation.delete.js.map +1 -0
  77. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{vtl-generator/ddb/resolvers → resolvers}/mutation.update.d.ts +1 -1
  78. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/mutation.update.d.ts.map +1 -0
  79. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{vtl-generator/ddb/resolvers → resolvers}/mutation.update.js +1 -1
  80. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/mutation.update.js.map +1 -0
  81. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/query.d.ts +6 -0
  82. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/query.d.ts.map +1 -0
  83. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{vtl-generator/ddb/resolvers → resolvers}/query.js +3 -28
  84. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/query.js.map +1 -0
  85. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{vtl-generator/ddb/resolvers → resolvers}/search.d.ts +1 -1
  86. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/search.d.ts.map +1 -0
  87. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{vtl-generator/ddb/resolvers → resolvers}/search.js +1 -1
  88. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/search.js.map +1 -0
  89. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{vtl-generator/rds/resolvers/subscription.d.ts → resolvers/subscriptions.d.ts} +2 -2
  90. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/subscriptions.d.ts.map +1 -0
  91. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{vtl-generator/ddb/resolvers → resolvers}/subscriptions.js +1 -1
  92. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/subscriptions.js.map +1 -0
  93. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/index.d.ts.map +1 -1
  94. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/index.js +0 -3
  95. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/index.js.map +1 -1
  96. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/schema.d.ts.map +1 -1
  97. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/schema.js.map +1 -1
  98. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/validations.d.ts +2 -3
  99. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/validations.d.ts.map +1 -1
  100. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/validations.js +1 -4
  101. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/validations.js.map +1 -1
  102. package/node_modules/@aws-amplify/graphql-auth-transformer/package.json +11 -11
  103. package/node_modules/@aws-amplify/graphql-default-value-transformer/CHANGELOG.md +5 -3
  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 +1 -13
  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 +8 -8
  108. package/node_modules/@aws-amplify/graphql-function-transformer/CHANGELOG.md +5 -1
  109. package/node_modules/@aws-amplify/graphql-function-transformer/package.json +7 -7
  110. package/node_modules/@aws-amplify/graphql-http-transformer/CHANGELOG.md +5 -1
  111. package/node_modules/@aws-amplify/graphql-http-transformer/package.json +7 -7
  112. package/node_modules/@aws-amplify/graphql-index-transformer/API.md +3 -0
  113. package/node_modules/@aws-amplify/graphql-index-transformer/CHANGELOG.md +6 -4
  114. package/node_modules/@aws-amplify/graphql-index-transformer/lib/graphql-index-transformer.js +4 -0
  115. package/node_modules/@aws-amplify/graphql-index-transformer/lib/graphql-index-transformer.js.map +1 -1
  116. package/node_modules/@aws-amplify/graphql-index-transformer/lib/graphql-primary-key-transformer.d.ts.map +1 -1
  117. package/node_modules/@aws-amplify/graphql-index-transformer/lib/graphql-primary-key-transformer.js +2 -2
  118. package/node_modules/@aws-amplify/graphql-index-transformer/lib/graphql-primary-key-transformer.js.map +1 -1
  119. package/node_modules/@aws-amplify/graphql-index-transformer/lib/index.d.ts +1 -1
  120. package/node_modules/@aws-amplify/graphql-index-transformer/lib/index.d.ts.map +1 -1
  121. package/node_modules/@aws-amplify/graphql-index-transformer/lib/index.js +2 -1
  122. package/node_modules/@aws-amplify/graphql-index-transformer/lib/index.js.map +1 -1
  123. package/node_modules/@aws-amplify/graphql-index-transformer/lib/resolvers/generators/rds-vtl-generator.d.ts.map +1 -1
  124. package/node_modules/@aws-amplify/graphql-index-transformer/lib/resolvers/generators/rds-vtl-generator.js +1 -4
  125. package/node_modules/@aws-amplify/graphql-index-transformer/lib/resolvers/generators/rds-vtl-generator.js.map +1 -1
  126. package/node_modules/@aws-amplify/graphql-index-transformer/lib/resolvers/resolvers.d.ts +5 -6
  127. package/node_modules/@aws-amplify/graphql-index-transformer/lib/resolvers/resolvers.d.ts.map +1 -1
  128. package/node_modules/@aws-amplify/graphql-index-transformer/lib/resolvers/resolvers.js +43 -26
  129. package/node_modules/@aws-amplify/graphql-index-transformer/lib/resolvers/resolvers.js.map +1 -1
  130. package/node_modules/@aws-amplify/graphql-index-transformer/package.json +8 -8
  131. package/node_modules/@aws-amplify/graphql-maps-to-transformer/API.md +0 -15
  132. package/node_modules/@aws-amplify/graphql-maps-to-transformer/CHANGELOG.md +4 -8
  133. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/assets/mapping-lambda.zip +0 -0
  134. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/field-mapping-resolvers.d.ts +0 -1
  135. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/field-mapping-resolvers.d.ts.map +1 -1
  136. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/field-mapping-resolvers.js +1 -13
  137. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/field-mapping-resolvers.js.map +1 -1
  138. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-maps-to-transformer.d.ts +1 -2
  139. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-maps-to-transformer.d.ts.map +1 -1
  140. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-maps-to-transformer.js +33 -16
  141. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-maps-to-transformer.js.map +1 -1
  142. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/index.d.ts +0 -1
  143. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/index.d.ts.map +1 -1
  144. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/index.js +1 -3
  145. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/index.js.map +1 -1
  146. package/node_modules/@aws-amplify/graphql-maps-to-transformer/package.json +13 -13
  147. package/node_modules/@aws-amplify/graphql-model-transformer/API.md +15 -15
  148. package/node_modules/@aws-amplify/graphql-model-transformer/CHANGELOG.md +5 -13
  149. package/node_modules/@aws-amplify/graphql-model-transformer/lib/graphql-model-transformer.d.ts +2 -1
  150. package/node_modules/@aws-amplify/graphql-model-transformer/lib/graphql-model-transformer.d.ts.map +1 -1
  151. package/node_modules/@aws-amplify/graphql-model-transformer/lib/graphql-model-transformer.js +58 -66
  152. package/node_modules/@aws-amplify/graphql-model-transformer/lib/graphql-model-transformer.js.map +1 -1
  153. package/node_modules/@aws-amplify/graphql-model-transformer/lib/graphql-types/mutation.d.ts.map +1 -1
  154. package/node_modules/@aws-amplify/graphql-model-transformer/lib/graphql-types/mutation.js +2 -9
  155. package/node_modules/@aws-amplify/graphql-model-transformer/lib/graphql-types/mutation.js.map +1 -1
  156. package/node_modules/@aws-amplify/graphql-model-transformer/lib/rds-lambda.zip +0 -0
  157. package/node_modules/@aws-amplify/graphql-model-transformer/lib/rds-notification-lambda.zip +0 -0
  158. package/node_modules/@aws-amplify/graphql-model-transformer/lib/rds-patching-lambda.zip +0 -0
  159. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/generators/dynamodb-vtl-generator.d.ts +5 -6
  160. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/generators/dynamodb-vtl-generator.d.ts.map +1 -1
  161. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/generators/dynamodb-vtl-generator.js +5 -5
  162. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/generators/dynamodb-vtl-generator.js.map +1 -1
  163. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/generators/rds-vtl-generator.d.ts +5 -6
  164. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/generators/rds-vtl-generator.d.ts.map +1 -1
  165. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/generators/rds-vtl-generator.js +11 -11
  166. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/generators/rds-vtl-generator.js.map +1 -1
  167. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/generators/vtl-generator.d.ts +5 -6
  168. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/generators/vtl-generator.d.ts.map +1 -1
  169. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/mutation.d.ts +3 -4
  170. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/mutation.d.ts.map +1 -1
  171. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/mutation.js +55 -74
  172. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/mutation.js.map +1 -1
  173. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/query.d.ts +1 -2
  174. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/query.d.ts.map +1 -1
  175. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/query.js +2 -8
  176. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/query.js.map +1 -1
  177. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/resolver.d.ts +3 -10
  178. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/resolver.d.ts.map +1 -1
  179. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/resolver.js +42 -127
  180. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/resolver.js.map +1 -1
  181. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamo-model-resource-generator.d.ts +15 -0
  182. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamo-model-resource-generator.d.ts.map +1 -0
  183. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamo-model-resource-generator.js +169 -0
  184. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamo-model-resource-generator.js.map +1 -0
  185. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamodb-table-construct/index.d.ts +40 -0
  186. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamodb-table-construct/index.d.ts.map +1 -0
  187. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamodb-table-construct/index.js +242 -0
  188. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamodb-table-construct/index.js.map +1 -0
  189. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/amplify-table-manager-handler.d.ts +12 -0
  190. 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 -0
  191. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/amplify-table-manager-handler.js +663 -0
  192. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/amplify-table-manager-handler.js.map +1 -0
  193. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/dynamo-model-resource-generator.d.ts +5 -2
  194. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/dynamo-model-resource-generator.d.ts.map +1 -1
  195. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/dynamo-model-resource-generator.js +47 -60
  196. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/dynamo-model-resource-generator.js.map +1 -1
  197. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/model-resource-generator.js +5 -5
  198. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/model-resource-generator.js.map +1 -1
  199. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/rds-model-resource-generator.d.ts +0 -1
  200. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/rds-model-resource-generator.d.ts.map +1 -1
  201. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/rds-model-resource-generator.js +1 -28
  202. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/rds-model-resource-generator.js.map +1 -1
  203. package/node_modules/@aws-amplify/graphql-model-transformer/package.json +11 -9
  204. package/node_modules/@aws-amplify/graphql-predictions-transformer/CHANGELOG.md +5 -1
  205. package/node_modules/@aws-amplify/graphql-predictions-transformer/lib/predictionsLambdaFunction.zip +0 -0
  206. package/node_modules/@aws-amplify/graphql-predictions-transformer/package.json +7 -7
  207. package/node_modules/@aws-amplify/graphql-relational-transformer/CHANGELOG.md +6 -5
  208. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-belongs-to-transformer.d.ts.map +1 -1
  209. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-belongs-to-transformer.js +9 -41
  210. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-belongs-to-transformer.js.map +1 -1
  211. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-has-many-transformer.d.ts.map +1 -1
  212. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-has-many-transformer.js +8 -35
  213. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-has-many-transformer.js.map +1 -1
  214. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-has-one-transformer.d.ts.map +1 -1
  215. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-has-one-transformer.js +8 -30
  216. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-has-one-transformer.js.map +1 -1
  217. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-many-to-many-transformer.d.ts.map +1 -1
  218. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-many-to-many-transformer.js +2 -3
  219. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-many-to-many-transformer.js.map +1 -1
  220. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolvers.d.ts +4 -4
  221. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolvers.d.ts.map +1 -1
  222. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolvers.js +164 -24
  223. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolvers.js.map +1 -1
  224. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/schema.d.ts.map +1 -1
  225. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/schema.js +8 -14
  226. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/schema.js.map +1 -1
  227. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/types.d.ts +0 -4
  228. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/types.d.ts.map +1 -1
  229. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/utils.d.ts +0 -5
  230. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/utils.d.ts.map +1 -1
  231. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/utils.js +1 -85
  232. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/utils.js.map +1 -1
  233. package/node_modules/@aws-amplify/graphql-relational-transformer/package.json +10 -10
  234. package/node_modules/@aws-amplify/graphql-searchable-transformer/CHANGELOG.md +5 -3
  235. package/node_modules/@aws-amplify/graphql-searchable-transformer/lib/graphql-searchable-transformer.d.ts.map +1 -1
  236. package/node_modules/@aws-amplify/graphql-searchable-transformer/lib/graphql-searchable-transformer.js +0 -3
  237. package/node_modules/@aws-amplify/graphql-searchable-transformer/lib/graphql-searchable-transformer.js.map +1 -1
  238. package/node_modules/@aws-amplify/graphql-searchable-transformer/lib/streaming-lambda.zip +0 -0
  239. package/node_modules/@aws-amplify/graphql-searchable-transformer/package.json +8 -8
  240. package/node_modules/@aws-amplify/graphql-transformer/API.md +2 -3
  241. package/node_modules/@aws-amplify/graphql-transformer/CHANGELOG.md +5 -8
  242. package/node_modules/@aws-amplify/graphql-transformer/lib/graphql-transformer.d.ts +3 -4
  243. package/node_modules/@aws-amplify/graphql-transformer/lib/graphql-transformer.d.ts.map +1 -1
  244. package/node_modules/@aws-amplify/graphql-transformer/lib/graphql-transformer.js +1 -5
  245. package/node_modules/@aws-amplify/graphql-transformer/lib/graphql-transformer.js.map +1 -1
  246. package/node_modules/@aws-amplify/graphql-transformer/package.json +14 -15
  247. package/node_modules/@aws-amplify/graphql-transformer/src/graphql-transformer.ts +5 -15
  248. package/node_modules/@aws-amplify/graphql-transformer-core/API.md +7 -39
  249. package/node_modules/@aws-amplify/graphql-transformer-core/CHANGELOG.md +7 -12
  250. package/node_modules/@aws-amplify/graphql-transformer-core/lib/config/index.d.ts +0 -1
  251. package/node_modules/@aws-amplify/graphql-transformer-core/lib/config/index.d.ts.map +1 -1
  252. package/node_modules/@aws-amplify/graphql-transformer-core/lib/config/index.js.map +1 -1
  253. package/node_modules/@aws-amplify/graphql-transformer-core/lib/graphql-api.js +2 -1
  254. package/node_modules/@aws-amplify/graphql-transformer-core/lib/graphql-api.js.map +1 -1
  255. package/node_modules/@aws-amplify/graphql-transformer-core/lib/index.d.ts +4 -4
  256. package/node_modules/@aws-amplify/graphql-transformer-core/lib/index.d.ts.map +1 -1
  257. package/node_modules/@aws-amplify/graphql-transformer-core/lib/index.js +3 -10
  258. package/node_modules/@aws-amplify/graphql-transformer-core/lib/index.js.map +1 -1
  259. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transform-host.d.ts.map +1 -1
  260. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transform-host.js +1 -2
  261. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transform-host.js.map +1 -1
  262. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/index.d.ts +1 -0
  263. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/index.d.ts.map +1 -1
  264. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/index.js +3 -1
  265. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/index.js.map +1 -1
  266. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/transform.d.ts +3 -2
  267. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/transform.d.ts.map +1 -1
  268. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/transform.js +3 -2
  269. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/transform.js.map +1 -1
  270. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/types.d.ts +2 -4
  271. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/types.d.ts.map +1 -1
  272. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/utils.d.ts +2 -1
  273. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/utils.d.ts.map +1 -1
  274. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/utils.js +12 -1
  275. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/utils.js.map +1 -1
  276. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/index.d.ts +4 -6
  277. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/index.d.ts.map +1 -1
  278. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/index.js +1 -2
  279. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/index.js.map +1 -1
  280. package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/import-appsync-api-types.d.ts +1 -4
  281. package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/import-appsync-api-types.d.ts.map +1 -1
  282. package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/import-appsync-api-types.js +2 -3
  283. package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/import-appsync-api-types.js.map +1 -1
  284. package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/index.d.ts +1 -1
  285. package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/index.d.ts.map +1 -1
  286. package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/index.js +1 -2
  287. package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/index.js.map +1 -1
  288. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/authType.d.ts.map +1 -1
  289. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/authType.js +1 -0
  290. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/authType.js.map +1 -1
  291. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/index.d.ts +3 -3
  292. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/index.d.ts.map +1 -1
  293. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/index.js +5 -14
  294. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/index.js.map +1 -1
  295. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/provision-strategy-utils.d.ts +3 -0
  296. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/provision-strategy-utils.d.ts.map +1 -0
  297. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/provision-strategy-utils.js +15 -0
  298. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/provision-strategy-utils.js.map +1 -0
  299. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/rds-secret-utils.d.ts +2 -0
  300. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/rds-secret-utils.d.ts.map +1 -0
  301. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/rds-secret-utils.js +25 -0
  302. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/rds-secret-utils.js.map +1 -0
  303. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/schema-utils.d.ts +1 -3
  304. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/schema-utils.d.ts.map +1 -1
  305. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/schema-utils.js +1 -7
  306. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/schema-utils.js.map +1 -1
  307. package/node_modules/@aws-amplify/graphql-transformer-core/lib/wrappers/object-definition-wrapper.d.ts +1 -1
  308. package/node_modules/@aws-amplify/graphql-transformer-core/lib/wrappers/object-definition-wrapper.d.ts.map +1 -1
  309. package/node_modules/@aws-amplify/graphql-transformer-core/package.json +4 -4
  310. package/node_modules/@aws-amplify/graphql-transformer-interfaces/API.md +17 -12
  311. package/node_modules/@aws-amplify/graphql-transformer-interfaces/CHANGELOG.md +8 -5
  312. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/graphql-api-provider.d.ts +2 -5
  313. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/graphql-api-provider.d.ts.map +1 -1
  314. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/graphql-api-provider.js.map +1 -1
  315. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/index.d.ts +1 -1
  316. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/index.d.ts.map +1 -1
  317. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/index.js.map +1 -1
  318. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/index.d.ts +1 -1
  319. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/index.d.ts.map +1 -1
  320. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/index.js +2 -1
  321. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/index.js.map +1 -1
  322. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/transformer-context-provider.d.ts +2 -3
  323. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/transformer-context-provider.d.ts.map +1 -1
  324. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/transformer-datasource-provider.d.ts +8 -2
  325. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/transformer-datasource-provider.d.ts.map +1 -1
  326. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/transformer-datasource-provider.js +6 -1
  327. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/transformer-datasource-provider.js.map +1 -1
  328. package/node_modules/@aws-amplify/graphql-transformer-interfaces/package.json +2 -2
  329. package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/graphql-api-provider.ts +16 -17
  330. package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/index.ts +0 -1
  331. package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/transformer-context/index.ts +3 -1
  332. package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/transformer-context/transformer-context-provider.ts +2 -3
  333. package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/transformer-context/transformer-datasource-provider.ts +18 -10
  334. package/node_modules/@aws-amplify/graphql-transformer-interfaces/tsconfig.tsbuildinfo +1 -1
  335. package/node_modules/@aws-amplify/platform-core/lib/backend_deployment_type.d.ts +5 -0
  336. package/node_modules/@aws-amplify/platform-core/lib/backend_deployment_type.js +9 -0
  337. package/node_modules/@aws-amplify/platform-core/lib/cdk_context_key.d.ts +9 -0
  338. package/node_modules/@aws-amplify/platform-core/lib/cdk_context_key.js +13 -0
  339. package/node_modules/@aws-amplify/platform-core/lib/index.d.ts +4 -0
  340. package/node_modules/@aws-amplify/platform-core/lib/index.js +22 -0
  341. package/node_modules/@aws-amplify/platform-core/lib/unique_backend_identifier.d.ts +53 -0
  342. package/node_modules/@aws-amplify/platform-core/lib/unique_backend_identifier.js +74 -0
  343. package/node_modules/@aws-amplify/platform-core/package.json +24 -0
  344. package/node_modules/@aws-amplify/plugin-types/lib/amplify_function.d.ts +4 -0
  345. package/node_modules/@aws-amplify/plugin-types/lib/amplify_function.js +3 -0
  346. package/node_modules/@aws-amplify/plugin-types/lib/amplify_output_writer.d.ts +9 -0
  347. package/node_modules/@aws-amplify/plugin-types/lib/amplify_output_writer.js +3 -0
  348. package/node_modules/@aws-amplify/plugin-types/lib/auth_resources.d.ts +42 -0
  349. package/node_modules/@aws-amplify/plugin-types/lib/auth_resources.js +3 -0
  350. package/node_modules/@aws-amplify/plugin-types/lib/backend_output.d.ts +6 -0
  351. package/node_modules/@aws-amplify/plugin-types/lib/backend_output.js +3 -0
  352. package/node_modules/@aws-amplify/plugin-types/lib/backend_secret_resolver.d.ts +13 -0
  353. package/node_modules/@aws-amplify/plugin-types/lib/backend_secret_resolver.js +3 -0
  354. package/node_modules/@aws-amplify/plugin-types/lib/backend_stack_creator.d.ts +8 -0
  355. package/node_modules/@aws-amplify/plugin-types/lib/backend_stack_creator.js +3 -0
  356. package/node_modules/@aws-amplify/plugin-types/lib/backend_stack_resolver.d.ts +7 -0
  357. package/node_modules/@aws-amplify/plugin-types/lib/backend_stack_resolver.js +3 -0
  358. package/node_modules/@aws-amplify/plugin-types/lib/construct_container.d.ts +26 -0
  359. package/node_modules/@aws-amplify/plugin-types/lib/construct_container.js +3 -0
  360. package/node_modules/@aws-amplify/plugin-types/lib/construct_factory.d.ts +21 -0
  361. package/node_modules/@aws-amplify/plugin-types/lib/construct_factory.js +3 -0
  362. package/node_modules/@aws-amplify/plugin-types/lib/function_resources.d.ts +5 -0
  363. package/node_modules/@aws-amplify/plugin-types/lib/function_resources.js +3 -0
  364. package/node_modules/@aws-amplify/plugin-types/lib/import_path_verifier.d.ts +14 -0
  365. package/node_modules/@aws-amplify/plugin-types/lib/import_path_verifier.js +3 -0
  366. package/node_modules/@aws-amplify/plugin-types/lib/index.d.ts +16 -0
  367. package/node_modules/@aws-amplify/plugin-types/lib/index.js +32 -0
  368. package/node_modules/@aws-amplify/plugin-types/lib/output_retrieval_strategy.d.ts +11 -0
  369. package/node_modules/@aws-amplify/plugin-types/lib/output_retrieval_strategy.js +3 -0
  370. package/node_modules/@aws-amplify/plugin-types/lib/output_storage_strategy.d.ts +8 -0
  371. package/node_modules/@aws-amplify/plugin-types/lib/output_storage_strategy.js +3 -0
  372. package/node_modules/@aws-amplify/plugin-types/lib/resource_provider.d.ts +7 -0
  373. package/node_modules/@aws-amplify/plugin-types/lib/resource_provider.js +3 -0
  374. package/node_modules/@aws-amplify/plugin-types/lib/unique_backend_identifier.d.ts +25 -0
  375. package/node_modules/@aws-amplify/plugin-types/lib/unique_backend_identifier.js +3 -0
  376. package/node_modules/@aws-amplify/plugin-types/package.json +20 -0
  377. package/node_modules/graphql-mapping-template/CHANGELOG.md +0 -4
  378. package/node_modules/graphql-mapping-template/package.json +2 -3
  379. package/node_modules/graphql-transformer-common/API.md +3 -21
  380. package/node_modules/graphql-transformer-common/CHANGELOG.md +2 -7
  381. package/node_modules/graphql-transformer-common/lib/ResourceConstants.d.ts +3 -0
  382. package/node_modules/graphql-transformer-common/lib/ResourceConstants.d.ts.map +1 -1
  383. package/node_modules/graphql-transformer-common/lib/ResourceConstants.js +3 -0
  384. package/node_modules/graphql-transformer-common/lib/ResourceConstants.js.map +1 -1
  385. package/node_modules/graphql-transformer-common/lib/definition.d.ts +2 -9
  386. package/node_modules/graphql-transformer-common/lib/definition.d.ts.map +1 -1
  387. package/node_modules/graphql-transformer-common/lib/definition.js +1 -52
  388. package/node_modules/graphql-transformer-common/lib/definition.js.map +1 -1
  389. package/node_modules/graphql-transformer-common/lib/util.d.ts.map +1 -1
  390. package/node_modules/graphql-transformer-common/lib/util.js +1 -3
  391. package/node_modules/graphql-transformer-common/lib/util.js.map +1 -1
  392. package/node_modules/graphql-transformer-common/package.json +6 -6
  393. package/package.json +25 -27
  394. package/src/amplify-dynamodb-table-wrapper.ts +177 -0
  395. package/src/amplify-graphql-api.ts +14 -76
  396. package/src/amplify-graphql-definition.ts +60 -20
  397. package/src/index.ts +13 -6
  398. package/src/internal/authorization-modes.ts +22 -1
  399. package/src/internal/construct-exports.ts +7 -0
  400. package/src/internal/data-source-config.ts +39 -0
  401. package/src/internal/index.ts +1 -1
  402. package/src/internal/model-type-name.ts +30 -0
  403. package/src/types.ts +59 -118
  404. package/babel.config.js +0 -13
  405. package/lib/internal/amplify-metadata.d.ts +0 -6
  406. package/lib/internal/amplify-metadata.js +0 -58
  407. package/lib/sql-model-datasource-binding.d.ts +0 -20
  408. package/lib/sql-model-datasource-binding.js +0 -42
  409. package/node_modules/@aws-amplify/backend-output-schemas/lib/index.internal.d.ts +0 -3
  410. package/node_modules/@aws-amplify/backend-output-schemas/lib/index.internal.js +0 -27
  411. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/ddb-vtl-generator.d.ts +0 -20
  412. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/ddb-vtl-generator.d.ts.map +0 -1
  413. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/ddb-vtl-generator.js +0 -24
  414. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/ddb-vtl-generator.js.map +0 -1
  415. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/field.d.ts.map +0 -1
  416. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/field.js.map +0 -1
  417. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/helpers.d.ts.map +0 -1
  418. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/helpers.js.map +0 -1
  419. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/index.d.ts.map +0 -1
  420. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/index.js.map +0 -1
  421. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/mutation.create.d.ts.map +0 -1
  422. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/mutation.create.js.map +0 -1
  423. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/mutation.delete.d.ts.map +0 -1
  424. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/mutation.delete.js.map +0 -1
  425. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/mutation.update.d.ts.map +0 -1
  426. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/mutation.update.js.map +0 -1
  427. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/query.d.ts +0 -6
  428. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/query.d.ts.map +0 -1
  429. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/query.js.map +0 -1
  430. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/search.d.ts.map +0 -1
  431. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/search.js.map +0 -1
  432. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/subscriptions.d.ts +0 -3
  433. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/subscriptions.d.ts.map +0 -1
  434. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/subscriptions.js.map +0 -1
  435. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/rds-vtl-generator.d.ts +0 -20
  436. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/rds-vtl-generator.d.ts.map +0 -1
  437. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/rds-vtl-generator.js +0 -24
  438. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/rds-vtl-generator.js.map +0 -1
  439. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/common.d.ts +0 -13
  440. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/common.d.ts.map +0 -1
  441. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/common.js +0 -157
  442. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/common.js.map +0 -1
  443. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/index.d.ts +0 -5
  444. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/index.d.ts.map +0 -1
  445. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/index.js +0 -21
  446. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/index.js.map +0 -1
  447. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/mutation.d.ts +0 -8
  448. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/mutation.d.ts.map +0 -1
  449. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/mutation.js +0 -56
  450. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/mutation.js.map +0 -1
  451. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/query.d.ts +0 -8
  452. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/query.d.ts.map +0 -1
  453. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/query.js +0 -41
  454. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/query.js.map +0 -1
  455. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/subscription.d.ts.map +0 -1
  456. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/subscription.js +0 -18
  457. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/subscription.js.map +0 -1
  458. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/vtl-generator.d.ts +0 -19
  459. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/vtl-generator.d.ts.map +0 -1
  460. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/vtl-generator.js +0 -3
  461. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/vtl-generator.js.map +0 -1
  462. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-name-mapping.d.ts +0 -10
  463. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-name-mapping.d.ts.map +0 -1
  464. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-name-mapping.js +0 -102
  465. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-name-mapping.js.map +0 -1
  466. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-refers-to-transformer.d.ts +0 -13
  467. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-refers-to-transformer.d.ts.map +0 -1
  468. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-refers-to-transformer.js +0 -81
  469. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-refers-to-transformer.js.map +0 -1
  470. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/ddb-generator.d.ts +0 -13
  471. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/ddb-generator.d.ts.map +0 -1
  472. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/ddb-generator.js +0 -171
  473. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/ddb-generator.js.map +0 -1
  474. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/generator-factory.d.ts +0 -4
  475. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/generator-factory.d.ts.map +0 -1
  476. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/generator-factory.js +0 -18
  477. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/generator-factory.js.map +0 -1
  478. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/generator.d.ts +0 -8
  479. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/generator.d.ts.map +0 -1
  480. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/generator.js +0 -7
  481. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/generator.js.map +0 -1
  482. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/rds-generator.d.ts +0 -14
  483. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/rds-generator.d.ts.map +0 -1
  484. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/rds-generator.js +0 -115
  485. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/rds-generator.js.map +0 -1
  486. package/node_modules/@aws-amplify/graphql-sql-transformer/API.md +0 -26
  487. package/node_modules/@aws-amplify/graphql-sql-transformer/CHANGELOG.md +0 -10
  488. package/node_modules/@aws-amplify/graphql-sql-transformer/LICENSE +0 -201
  489. package/node_modules/@aws-amplify/graphql-sql-transformer/README.md +0 -13
  490. package/node_modules/@aws-amplify/graphql-sql-transformer/lib/graphql-sql-transformer.d.ts +0 -12
  491. package/node_modules/@aws-amplify/graphql-sql-transformer/lib/graphql-sql-transformer.d.ts.map +0 -1
  492. package/node_modules/@aws-amplify/graphql-sql-transformer/lib/graphql-sql-transformer.js +0 -132
  493. package/node_modules/@aws-amplify/graphql-sql-transformer/lib/graphql-sql-transformer.js.map +0 -1
  494. package/node_modules/@aws-amplify/graphql-sql-transformer/lib/index.d.ts +0 -2
  495. package/node_modules/@aws-amplify/graphql-sql-transformer/lib/index.d.ts.map +0 -1
  496. package/node_modules/@aws-amplify/graphql-sql-transformer/lib/index.js +0 -6
  497. package/node_modules/@aws-amplify/graphql-sql-transformer/lib/index.js.map +0 -1
  498. package/node_modules/@aws-amplify/graphql-sql-transformer/package.json +0 -71
  499. package/node_modules/@aws-amplify/graphql-transformer-core/lib/config/project-config.d.ts +0 -6
  500. package/node_modules/@aws-amplify/graphql-transformer-core/lib/config/project-config.d.ts.map +0 -1
  501. package/node_modules/@aws-amplify/graphql-transformer-core/lib/config/project-config.js +0 -3
  502. package/node_modules/@aws-amplify/graphql-transformer-core/lib/config/project-config.js.map +0 -1
  503. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/api-category.d.ts +0 -2
  504. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/api-category.d.ts.map +0 -1
  505. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/api-category.js +0 -5
  506. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/api-category.js.map +0 -1
  507. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/model-util.d.ts +0 -3
  508. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/model-util.d.ts.map +0 -1
  509. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/model-util.js +0 -19
  510. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/model-util.js.map +0 -1
  511. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/rds-util.d.ts +0 -14
  512. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/rds-util.d.ts.map +0 -1
  513. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/rds-util.js +0 -82
  514. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/rds-util.js.map +0 -1
  515. package/node_modules/graphql-mapping-template/LICENSE +0 -201
  516. package/remove-module-type-from-package-json.ts +0 -19
  517. package/src/internal/amplify-metadata.ts +0 -58
  518. package/src/sql-model-datasource-binding.ts +0 -45
  519. /package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{vtl-generator/ddb/resolvers → resolvers}/index.d.ts +0 -0
  520. /package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{vtl-generator/ddb/resolvers → resolvers}/index.js +0 -0
@@ -0,0 +1,177 @@
1
+ import { CfnResource } from 'aws-cdk-lib';
2
+ import { BillingMode, StreamViewType } from 'aws-cdk-lib/aws-dynamodb';
3
+
4
+ const AMPLIFY_DYNAMODB_TABLE_RESOURCE_TYPE = 'Custom::AmplifyDynamoDBTable';
5
+
6
+ /**
7
+ * Shape for TTL config.
8
+ */
9
+ export interface TimeToLiveSpecification {
10
+ /**
11
+ * Boolean determining if the ttl is enabled or not.
12
+ */
13
+ readonly enabled: boolean;
14
+
15
+ /**
16
+ * Attribute name to apply to the ttl spec.
17
+ */
18
+ readonly attributeName?: string;
19
+ }
20
+
21
+ /**
22
+ * Wrapper for provisioned throughput config in DDB.
23
+ */
24
+ export interface ProvisionedThroughput {
25
+ /**
26
+ * The read capacity units on the table or index.
27
+ */
28
+ readonly readCapacityUnits: number;
29
+
30
+ /**
31
+ * The write capacity units on the table or index.
32
+ */
33
+ readonly writeCapacityUnits: number;
34
+ }
35
+
36
+ /**
37
+ * Server Side Encryption Type Values
38
+ * - `KMS` - Server-side encryption that uses AWS KMS. The key is stored in your account and is managed by KMS (AWS KMS charges apply).
39
+ */
40
+ export enum SSEType {
41
+ KMS = 'KMS',
42
+ }
43
+
44
+ /**
45
+ * Represents the settings used to enable server-side encryption.
46
+ */
47
+ export interface SSESpecification {
48
+ /**
49
+ * Indicates whether server-side encryption is done using an AWS managed key or an AWS owned key.
50
+ * If enabled (true), server-side encryption type is set to `KMS` and an AWS managed key is used ( AWS KMS charges apply).
51
+ * If disabled (false) or not specified, server-side encryption is set to AWS owned key.
52
+ */
53
+ readonly sseEnabled: boolean;
54
+
55
+ /**
56
+ * The AWS KMS key that should be used for the AWS KMS encryption.
57
+ * To specify a key, use its key ID, Amazon Resource Name (ARN), alias name, or alias ARN. Note that you should only provide
58
+ * this parameter if the key is different from the default DynamoDB key `alias/aws/dynamodb` .
59
+ */
60
+ readonly kmsMasterKeyId?: string;
61
+
62
+ /**
63
+ * Server-side encryption type. The only supported value is:
64
+ * `KMS` Server-side encryption that uses AWS Key Management Service.
65
+ * The key is stored in your account and is managed by AWS KMS ( AWS KMS charges apply).
66
+ */
67
+ readonly sseType?: SSEType;
68
+ }
69
+
70
+ /**
71
+ * Represents the DynamoDB Streams configuration for a table in DynamoDB.
72
+ */
73
+ export interface StreamSpecification {
74
+ /**
75
+ * When an item in the table is modified, `StreamViewType` determines what information is written to the stream for this table.
76
+ * Valid values for `StreamViewType` are:
77
+ * - `KEYS_ONLY` - Only the key attributes of the modified item are written to the stream.
78
+ * - `NEW_IMAGE` - The entire item, as it appears after it was modified, is written to the stream.
79
+ * - `OLD_IMAGE` - The entire item, as it appeared before it was modified, is written to the stream.
80
+ * - `NEW_AND_OLD_IMAGES` - Both the new and the old item images of the item are written to the stream.
81
+ */
82
+ readonly streamViewType: StreamViewType;
83
+ }
84
+
85
+ /**
86
+ * Wrapper class around Custom::AmplifyDynamoDBTable custom resource, to simplify
87
+ * the override experience a bit. This is NOT a construct, just an easier way to access
88
+ * the generated construct.
89
+ * This is a wrapper intended to mimic the `aws_cdk_lib.aws_dynamodb.Table` functionality more-or-less.
90
+ * Notable differences is the addition of TKTK properties, to account for the fact that they're constructor props
91
+ * in the CDK construct, as well as the removal of all from*, grant*, and metric* methods implemented by Table.
92
+ */
93
+ export class AmplifyDynamoDbTableWrapper {
94
+ /**
95
+ * Return true and perform type narrowing if a given input appears to be capable of
96
+ * @param x the object to check.
97
+ * @returns whether or not the resource is an underlying amplify dynamodb table resource.
98
+ */
99
+ static isAmplifyDynamoDbTableResource(x: any): x is CfnResource {
100
+ return x instanceof CfnResource && x.cfnResourceType === AMPLIFY_DYNAMODB_TABLE_RESOURCE_TYPE;
101
+ }
102
+
103
+ /**
104
+ * Create the wrapper given an underlying CfnResource that is an instance of Custom::AmplifyDynamoDBTable.
105
+ * @param resource the Cfn resource.
106
+ */
107
+ constructor(private readonly resource: CfnResource) {
108
+ if (resource.cfnResourceType !== AMPLIFY_DYNAMODB_TABLE_RESOURCE_TYPE) {
109
+ throw new Error(`Only CfnResource with type ${AMPLIFY_DYNAMODB_TABLE_RESOURCE_TYPE} can be used in AmplifyDynamoDbTable`);
110
+ }
111
+ }
112
+
113
+ /**
114
+ * Specify how you are charged for read and write throughput and how you manage capacity.
115
+ */
116
+ set billingMode(billingMode: BillingMode) {
117
+ this.resource.addPropertyOverride('billingMode', billingMode);
118
+ }
119
+
120
+ /**
121
+ * The name of TTL attribute.
122
+ */
123
+ set timeToLiveAttribute(timeToLiveSpecification: TimeToLiveSpecification) {
124
+ this.resource.addPropertyOverride('timeToLiveSpecification', timeToLiveSpecification);
125
+ }
126
+
127
+ /**
128
+ * Whether point-in-time recovery is enabled.
129
+ */
130
+ set pointInTimeRecoveryEnabled(pointInTimeRecoveryEnabled: boolean) {
131
+ this.resource.addPropertyOverride('pointInTimeRecoverySpecification', { pointInTimeRecoveryEnabled });
132
+ }
133
+
134
+ /**
135
+ * Update the provisioned throughput for the base table.
136
+ */
137
+ set provisionedThroughput(provisionedThroughput: ProvisionedThroughput) {
138
+ this.resource.addPropertyOverride('provisionedThroughput', provisionedThroughput);
139
+ }
140
+
141
+ /**
142
+ * Set the provisionedThroughtput for a specified GSI by name.
143
+ * @param indexName the index to specify a provisionedThroughput config for
144
+ * @param provisionedThroughput the config to set
145
+ */
146
+ setGlobalSecondaryIndexProvisionedThroughput(indexName: string, provisionedThroughput: ProvisionedThroughput): void {
147
+ const gsis: Array<[string, { indexName: string }]> = Object.entries(
148
+ (this.resource as any).rawOverrides?.Properties?.globalSecondaryIndexes ?? {},
149
+ );
150
+ const foundGsis = gsis.filter(([_, gsiConfig]) => indexName === gsiConfig.indexName).map(([gsiIndex]) => gsiIndex);
151
+ if (foundGsis.length !== 1) {
152
+ throw new Error(`Index with name ${indexName} not found in table definition`);
153
+ }
154
+ this.resource.addPropertyOverride(`globalSecondaryIndexes.${foundGsis[0]}.provisionedThroughput`, provisionedThroughput);
155
+ }
156
+
157
+ /**
158
+ * Set the ddb stream specification on the table.
159
+ */
160
+ set streamSpecification(streamSpecification: StreamSpecification) {
161
+ this.resource.addPropertyOverride('streamSpecification', streamSpecification);
162
+ }
163
+
164
+ /**
165
+ * Set the ddb server-side encryption specification on the table.
166
+ */
167
+ set sseSpecification(sseSpecification: SSESpecification) {
168
+ this.resource.addPropertyOverride('sseSpecification', sseSpecification);
169
+ }
170
+
171
+ /**
172
+ * Set table deletion protection.
173
+ */
174
+ set deletionProtectionEnabled(deletionProtectionEnabled: boolean) {
175
+ this.resource.addPropertyOverride('deletionProtectionEnabled', deletionProtectionEnabled);
176
+ }
177
+ }
@@ -1,9 +1,10 @@
1
+ import * as path from 'path';
1
2
  import { Construct } from 'constructs';
2
- import { ExecuteTransformConfig, executeTransform } from '@aws-amplify/graphql-transformer';
3
+ import { executeTransform } from '@aws-amplify/graphql-transformer';
3
4
  import { NestedStack, Stack } from 'aws-cdk-lib';
4
5
  import { Asset } from 'aws-cdk-lib/aws-s3-assets';
5
6
  import { AssetProps } from '@aws-amplify/graphql-transformer-interfaces';
6
- import { StackMetadataBackendOutputStorageStrategy } from '@aws-amplify/backend-output-storage';
7
+ import { AttributionMetadataStorage, StackMetadataBackendOutputStorageStrategy } from '@aws-amplify/backend-output-storage';
7
8
  import { graphqlOutputKey } from '@aws-amplify/backend-output-schemas';
8
9
  import type { GraphqlOutput, AwsAppsyncAuthenticationType } from '@aws-amplify/backend-output-schemas';
9
10
  import {
@@ -28,7 +29,6 @@ import { IEventBus } from 'aws-cdk-lib/aws-events';
28
29
  import { IFunction } from 'aws-cdk-lib/aws-lambda';
29
30
  import { IServerlessCluster } from 'aws-cdk-lib/aws-rds';
30
31
  import { ISecret } from 'aws-cdk-lib/aws-secretsmanager';
31
- import { MYSQL_DB_TYPE, POSTGRES_DB_TYPE, RDSConnectionSecrets, constructDataSourceMap } from '@aws-amplify/graphql-transformer-core';
32
32
  import { parseUserDefinedSlots, validateFunctionSlots, separateSlots } from './internal/user-defined-slots';
33
33
  import type {
34
34
  AmplifyGraphqlApiResources,
@@ -37,7 +37,6 @@ import type {
37
37
  IBackendOutputStorageStrategy,
38
38
  AddFunctionProps,
39
39
  ConflictResolution,
40
- SqlModelDataSourceBinding,
41
40
  } from './types';
42
41
  import {
43
42
  convertAuthorizationModesToTransformerAuthConfig,
@@ -47,10 +46,9 @@ import {
47
46
  getGeneratedResources,
48
47
  getGeneratedFunctionSlots,
49
48
  CodegenAssets,
50
- addAmplifyMetadataToStackDescription,
51
49
  getAdditionalAuthenticationTypes,
52
50
  } from './internal';
53
- import { isSqlModelDataSourceBinding } from './sql-model-datasource-binding';
51
+ import { parseDataSourceConfig } from './internal/data-source-config';
54
52
  import { getStackForScope, walkAndProcessNodes } from './internal/construct-tree';
55
53
 
56
54
  /**
@@ -125,6 +123,11 @@ export class AmplifyGraphqlApi extends Construct {
125
123
  */
126
124
  private readonly conflictResolution: ConflictResolution | undefined;
127
125
 
126
+ /**
127
+ * Be very careful editing this value. This is the string that is used to identify graphql stacks in BI metrics
128
+ */
129
+ private readonly stackType = 'api-AppSync';
130
+
128
131
  /**
129
132
  * New AmplifyGraphqlApi construct, this will create an appsync api with authorization, a schema, and all necessary resolvers, functions,
130
133
  * and datasources.
@@ -149,7 +152,8 @@ export class AmplifyGraphqlApi extends Construct {
149
152
  functionNameMap,
150
153
  outputStorageStrategy,
151
154
  } = props;
152
- addAmplifyMetadataToStackDescription(scope);
155
+
156
+ new AttributionMetadataStorage().storeAttributionMetadata(Stack.of(scope), this.stackType, path.join(__dirname, '..', 'package.json'));
153
157
 
154
158
  const { authConfig, authSynthParameters } = convertAuthorizationModesToTransformerAuthConfig(authorizationModes);
155
159
 
@@ -166,7 +170,7 @@ export class AmplifyGraphqlApi extends Construct {
166
170
 
167
171
  const assetManager = new AssetManager();
168
172
 
169
- let executeTransformConfig: ExecuteTransformConfig = {
173
+ executeTransform({
170
174
  scope: this,
171
175
  nestedStackProvider: {
172
176
  provide: (nestedStackScope: Construct, name: string) => new NestedStack(nestedStackScope, name),
@@ -194,13 +198,8 @@ export class AmplifyGraphqlApi extends Construct {
194
198
  ...defaultTranslationBehavior,
195
199
  ...(translationBehavior ?? {}),
196
200
  },
197
- };
198
-
199
- if (isSqlModelDataSourceBinding(definition.modelDataSourceBinding)) {
200
- executeTransformConfig = this.extendTransformConfig(executeTransformConfig, definition.modelDataSourceBinding);
201
- }
202
-
203
- executeTransform(executeTransformConfig);
201
+ ...parseDataSourceConfig(definition.dataSourceDefinition),
202
+ });
204
203
 
205
204
  this.codegenAssets = new CodegenAssets(this, 'AmplifyCodegenAssets', { modelSchema: definition.schema });
206
205
 
@@ -215,67 +214,6 @@ export class AmplifyGraphqlApi extends Construct {
215
214
  this.apiKey = this.resources.cfnResources.cfnApiKey?.attrApiKey;
216
215
  }
217
216
 
218
- /**
219
- * Extends executeTransformConfig with fields for provisioning a SQL Lambda
220
- * @param executeTransformConfig the executeTransformConfig to extend
221
- * @param modelDataSourceBinding the modelDataSourceBinding containing the values to add to the transform config
222
- */
223
- private extendTransformConfig(
224
- executeTransformConfig: ExecuteTransformConfig,
225
- modelDataSourceBinding: SqlModelDataSourceBinding,
226
- ): ExecuteTransformConfig {
227
- const extendedConfig = { ...executeTransformConfig };
228
- if (modelDataSourceBinding.customSqlStatements) {
229
- extendedConfig.customQueries = new Map(Object.entries(modelDataSourceBinding.customSqlStatements));
230
- }
231
-
232
- const dbSecrets: Map<string, RDSConnectionSecrets> = new Map();
233
- let dbSecretDbTypeKey: string;
234
- switch (modelDataSourceBinding.bindingType) {
235
- case MYSQL_DB_TYPE:
236
- dbSecretDbTypeKey = MYSQL_DB_TYPE;
237
- break;
238
- case POSTGRES_DB_TYPE:
239
- dbSecretDbTypeKey = POSTGRES_DB_TYPE;
240
- break;
241
- default:
242
- throw new Error(`Unsupported binding type ${modelDataSourceBinding.bindingType}`);
243
- }
244
- dbSecrets.set(dbSecretDbTypeKey, {
245
- username: modelDataSourceBinding.dbConnectionConfig.usernameSsmPath,
246
- password: modelDataSourceBinding.dbConnectionConfig.passwordSsmPath,
247
- host: modelDataSourceBinding.dbConnectionConfig.hostnameSsmPath,
248
- // 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
249
- // a string containing the SSM path.
250
- port: modelDataSourceBinding.dbConnectionConfig.portSsmPath as any,
251
- database: modelDataSourceBinding.dbConnectionConfig.databaseNameSsmPath,
252
- });
253
- extendedConfig.datasourceSecretParameterLocations = dbSecrets;
254
-
255
- const subnetAvailabilityZoneConfig = modelDataSourceBinding.vpcConfiguration.subnetAvailabilityZones.map(
256
- (saz): { SubnetId: string; AvailabilityZone: string } => ({
257
- SubnetId: saz.subnetId,
258
- AvailabilityZone: saz.availabilityZone,
259
- }),
260
- );
261
-
262
- if (!extendedConfig.modelToDatasourceMap || extendedConfig.modelToDatasourceMap.size === 0) {
263
- const defaultDatasourceType = {
264
- dbType: modelDataSourceBinding.bindingType,
265
- provisionDB: false,
266
- };
267
- extendedConfig.modelToDatasourceMap = constructDataSourceMap(extendedConfig.schema, defaultDatasourceType);
268
- }
269
-
270
- extendedConfig.sqlLambdaVpcConfig = {
271
- vpcId: modelDataSourceBinding.vpcConfiguration.vpcId,
272
- securityGroupIds: modelDataSourceBinding.vpcConfiguration.securityGroupIds,
273
- subnetAvailabilityZoneConfig,
274
- };
275
-
276
- return extendedConfig;
277
- }
278
-
279
217
  /**
280
218
  * Stores graphql api output to be used for client config generation
281
219
  * @param outputStorageStrategy Strategy to store construct outputs. If no strategy is provided a default strategy will be used.
@@ -1,52 +1,92 @@
1
1
  import * as os from 'os';
2
2
  import { SchemaFile } from 'aws-cdk-lib/aws-appsync';
3
- import { ModelDataSourceBinding, IAmplifyGraphqlDefinition } from './types';
3
+ import { IAmplifyGraphqlDefinition, ModelDataSourceDefinition } from './types';
4
+ import { constructDataSourceDefinitionMap } from './internal';
4
5
 
5
- const DEFAULT_DATA_SOURCE_BINDING: ModelDataSourceBinding = {
6
- bindingType: 'DynamoDB',
6
+ export const DEFAULT_MODEL_DATA_SOURCE_DEFINITION: ModelDataSourceDefinition = {
7
+ name: 'DefaultDynamoDB',
8
+ strategy: {
9
+ dbType: 'DYNAMODB',
10
+ provisionStrategy: 'DEFAULT',
11
+ },
7
12
  };
8
-
9
13
  /**
10
14
  * Class exposing utilities to produce IAmplifyGraphqlDefinition objects given various inputs.
11
15
  */
12
16
  export class AmplifyGraphqlDefinition {
13
17
  /**
14
- * Produce a schema definition from a string input.
18
+ * Produce a schema definition from a string input
15
19
  * @param schema the graphql input as a string
16
- * @param modelDataSourceBinding the ModelDataSourceBinding to use for the schema. This parameter is @experimental
17
- * @returns a fully formed amplify graphql definition, whose models will be resolved by the data source specifed in the
18
- * modelDataSourceBinding
20
+ * @param modelDataSourceDefinition the provision definition for `@model` datasource. The DynamoDB from CloudFormation will be used by default.
21
+ * @experimental modelDataSourceDefinition
22
+ * @returns a fully formed amplify graphql definition
19
23
  */
20
24
  static fromString(
21
25
  schema: string,
22
- modelDataSourceBinding: ModelDataSourceBinding = DEFAULT_DATA_SOURCE_BINDING,
26
+ modelDataSourceDefinition: ModelDataSourceDefinition = DEFAULT_MODEL_DATA_SOURCE_DEFINITION,
23
27
  ): IAmplifyGraphqlDefinition {
24
28
  return {
25
29
  schema,
26
30
  functionSlots: [],
27
- modelDataSourceBinding,
31
+ dataSourceDefinition: constructDataSourceDefinitionMap(schema, modelDataSourceDefinition),
28
32
  };
29
33
  }
30
34
 
31
35
  /**
32
- * Convert one or more appsync SchemaFile objects into an Amplify Graphql Schema, binding them to a DynamoDB data source.
36
+ * Convert one or more appsync SchemaFile objects into an Amplify Graphql Schema
33
37
  * @param filePaths one or more paths to the graphql files to process
34
- * @returns a fully formed amplify graphql definition, whose models will be resolved by DynamoDB tables created during deployment.
38
+ * @returns a fully formed amplify graphql definition
35
39
  */
36
40
  static fromFiles(...filePaths: string[]): IAmplifyGraphqlDefinition {
37
- return AmplifyGraphqlDefinition.fromFilesAndBinding(filePaths, DEFAULT_DATA_SOURCE_BINDING);
41
+ if (!Array.isArray(filePaths)) {
42
+ filePaths = [filePaths];
43
+ }
44
+ const schema = filePaths.map((filePath) => new SchemaFile({ filePath }).definition).join(os.EOL);
45
+ return {
46
+ schema,
47
+ functionSlots: [],
48
+ dataSourceDefinition: constructDataSourceDefinitionMap(schema, DEFAULT_MODEL_DATA_SOURCE_DEFINITION),
49
+ };
38
50
  }
39
51
 
40
52
  /**
41
- * Convert one or more appsync SchemaFile objects into an Amplify Graphql Schema, binding them with the specified ModelDataSourceBinding.
42
- * @param filePaths one or more paths to the graphql files to process
43
- * @param modelDataSourceBinding the ModelDataSourceBinding to use for the schema.
44
- * @returns a fully formed amplify graphql definition, whose models will be resolved by the data source specifed in the
45
- * modelDataSourceBinding
53
+ * Convert one or more appsync SchemaFile objects into an Amplify Graphql Schema
46
54
  * @experimental
55
+ * @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.
57
+ * @returns a fully formed amplify graphql definition
47
58
  */
48
- static fromFilesAndBinding(filePaths: string[], modelDataSourceBinding: ModelDataSourceBinding): IAmplifyGraphqlDefinition {
59
+ static fromFilesAndDefinition(
60
+ filePaths: string | string[],
61
+ modelDataSourceDefinition: ModelDataSourceDefinition = DEFAULT_MODEL_DATA_SOURCE_DEFINITION,
62
+ ): IAmplifyGraphqlDefinition {
63
+ if (!Array.isArray(filePaths)) {
64
+ filePaths = [filePaths];
65
+ }
49
66
  const schema = filePaths.map((filePath) => new SchemaFile({ filePath }).definition).join(os.EOL);
50
- return AmplifyGraphqlDefinition.fromString(schema, modelDataSourceBinding);
67
+ return {
68
+ schema,
69
+ functionSlots: [],
70
+ dataSourceDefinition: constructDataSourceDefinitionMap(schema, modelDataSourceDefinition),
71
+ };
72
+ }
73
+
74
+ /**
75
+ * Combines multiple IAmplifyGraphqlDefinitions into a single definition.
76
+ * @experimental
77
+ * @param definitions the definitions to combine
78
+ */
79
+ static combine(definitions: IAmplifyGraphqlDefinition[]): IAmplifyGraphqlDefinition {
80
+ if (definitions.length === 0) {
81
+ throw new Error('The definitions of amplify GraphQL cannot be empty.');
82
+ }
83
+ if (definitions.length === 1) {
84
+ return definitions[0];
85
+ }
86
+ return {
87
+ schema: definitions.map((def) => def.schema).join(os.EOL),
88
+ functionSlots: [],
89
+ dataSourceDefinition: definitions.reduce((acc, cur) => ({ ...acc, ...cur.dataSourceDefinition }), {}),
90
+ };
51
91
  }
52
92
  }
package/src/index.ts CHANGED
@@ -27,12 +27,19 @@ export type {
27
27
  IBackendOutputStorageStrategy,
28
28
  IBackendOutputEntry,
29
29
  AddFunctionProps,
30
- ModelDataSourceBinding,
31
- DynamoModelDataSourceBinding,
32
- SqlModelDataSourceBinding,
33
- SqlModelDataSourceBindingVpcConfig,
34
- SubnetAvailabilityZone,
35
- SqlModelDataSourceBindingDbConnectionConfig,
30
+ ModelDataSourceDefinition,
31
+ ModelDataSourceDefinitionStrategy,
32
+ DefaultDynamoDbModelDataSourceDefinitionStrategy,
33
+ AmplifyDynamoDbModelDataSourceDefinitionStrategy,
34
+ ModelDataSourceDefinitionDbType,
36
35
  } from './types';
37
36
  export { AmplifyGraphqlApi } from './amplify-graphql-api';
38
37
  export { AmplifyGraphqlDefinition } from './amplify-graphql-definition';
38
+ export {
39
+ AmplifyDynamoDbTableWrapper,
40
+ TimeToLiveSpecification,
41
+ ProvisionedThroughput,
42
+ SSESpecification,
43
+ SSEType,
44
+ StreamSpecification,
45
+ } from './amplify-dynamodb-table-wrapper';
@@ -1,6 +1,7 @@
1
1
  import { AppSyncAuthConfiguration, AppSyncAuthConfigurationEntry, SynthParameters } from '@aws-amplify/graphql-transformer-interfaces';
2
2
  import { CfnGraphQLApi } from 'aws-cdk-lib/aws-appsync';
3
3
  import { isArray } from 'lodash';
4
+ import { IRole, ServicePrincipal } from 'aws-cdk-lib/aws-iam';
4
5
  import {
5
6
  AuthorizationModes,
6
7
  ApiKeyAuthorizationConfig,
@@ -56,6 +57,7 @@ const convertAuthModeToAuthProvider = (authMode: AuthorizationConfigMode): AppSy
56
57
  return {
57
58
  authenticationType,
58
59
  lambdaAuthorizerConfig: {
60
+ lambdaArn: authMode.function.functionArn,
59
61
  lambdaFunction: authMode.function.functionName,
60
62
  ttlSeconds: authMode.ttl.toSeconds(),
61
63
  },
@@ -89,6 +91,12 @@ const convertAuthConfigToAppSyncAuth = (authModes: AuthorizationModes): AppSyncA
89
91
  throw new Error('A defaultAuthorizationMode is required if multiple authorization modes are configured.');
90
92
  }
91
93
 
94
+ // Enable appsync to invoke a provided lambda authorizer function
95
+ authModes.lambdaConfig?.function.addPermission('appsync-auth-invoke', {
96
+ principal: new ServicePrincipal('appsync.amazonaws.com'),
97
+ action: 'lambda:InvokeFunction',
98
+ });
99
+
92
100
  // In the case of a single mode, defaultAuthorizationMode is not required, just use the provided value.
93
101
  if (authProviders.length === 1) {
94
102
  return {
@@ -149,13 +157,26 @@ export const convertAuthorizationModesToTransformerAuthConfig = (authModes: Auth
149
157
  authSynthParameters: getSynthParameters(authModes),
150
158
  });
151
159
 
160
+ /**
161
+ * Merge iamConfig allowListedRoles with deprecated adminRoles property, converting to strings.
162
+ * @param authModes the auth modes provided to the construct.
163
+ * @returns the list of admin roles as strings to pass into the transformer
164
+ */
165
+ const getAllowListedRoles = (authModes: AuthorizationModes): string[] =>
166
+ [...(authModes?.iamConfig?.allowListedRoles ?? []), ...(authModes.adminRoles ?? [])].map((roleOrRoleName: IRole | string) => {
167
+ if (typeof roleOrRoleName === 'string' || roleOrRoleName instanceof String) {
168
+ return roleOrRoleName as string;
169
+ }
170
+ return roleOrRoleName.roleName;
171
+ });
172
+
152
173
  /**
153
174
  * Transform the authorization config into the transformer synth parameters pertaining to auth.
154
175
  * @param authModes the auth modes provided to the construct.
155
176
  * @returns a record of params to be consumed by the transformer.
156
177
  */
157
178
  const getSynthParameters = (authModes: AuthorizationModes): AuthSynthParameters => ({
158
- adminRoles: authModes.adminRoles?.map((role) => role.roleName) ?? [],
179
+ adminRoles: getAllowListedRoles(authModes),
159
180
  identityPoolId: authModes.iamConfig?.identityPoolId,
160
181
  ...(authModes.userPoolConfig ? { userPoolId: authModes.userPoolConfig.userPool.userPoolId } : {}),
161
182
  ...(authModes?.iamConfig
@@ -14,6 +14,7 @@ import { CfnResource, NestedStack } from 'aws-cdk-lib';
14
14
  import { getResourceName } from '@aws-amplify/graphql-transformer-core';
15
15
  import { CfnFunction, Function as LambdaFunction } from 'aws-cdk-lib/aws-lambda';
16
16
  import { AmplifyGraphqlApiResources, FunctionSlot } from '../types';
17
+ import { AmplifyDynamoDbTableWrapper } from '../amplify-dynamodb-table-wrapper';
17
18
  import { walkAndProcessNodes } from './construct-tree';
18
19
 
19
20
  /**
@@ -34,6 +35,7 @@ export const getGeneratedResources = (scope: Construct): AmplifyGraphqlApiResour
34
35
  const cfnDataSources: Record<string, CfnDataSource> = {};
35
36
  const tables: Record<string, Table> = {};
36
37
  const cfnTables: Record<string, CfnTable> = {};
38
+ const amplifyDynamoDbTables: Record<string, AmplifyDynamoDbTableWrapper> = {};
37
39
  const roles: Record<string, Role> = {};
38
40
  const cfnRoles: Record<string, CfnRole> = {};
39
41
  const functions: Record<string, LambdaFunction> = {};
@@ -78,6 +80,10 @@ export const getGeneratedResources = (scope: Construct): AmplifyGraphqlApiResour
78
80
  cfnTables[resourceName] = currentScope;
79
81
  return;
80
82
  }
83
+ if (AmplifyDynamoDbTableWrapper.isAmplifyDynamoDbTableResource(currentScope)) {
84
+ amplifyDynamoDbTables[resourceName] = new AmplifyDynamoDbTableWrapper(currentScope);
85
+ return;
86
+ }
81
87
  if (currentScope instanceof Role) {
82
88
  roles[resourceName] = currentScope;
83
89
  return;
@@ -117,6 +123,7 @@ export const getGeneratedResources = (scope: Construct): AmplifyGraphqlApiResour
117
123
  return {
118
124
  graphqlApi: GraphqlApi.fromGraphqlApiAttributes(scope, 'L2GraphqlApi', { graphqlApiId: cfnGraphqlApi.attrApiId }),
119
125
  tables,
126
+ amplifyDynamoDbTables,
120
127
  roles,
121
128
  functions,
122
129
  nestedStacks,
@@ -0,0 +1,39 @@
1
+ import { ModelDataSourceDefinition } from '../types';
2
+ import { DataSourceType, DynamoDBProvisionStrategy } from '@aws-amplify/graphql-transformer-interfaces';
3
+
4
+ type DataSourceConfig = {
5
+ modelToDatasourceMap: Map<string, DataSourceType>;
6
+ };
7
+ const convertToDataSourceType = (modelDataSourceDefinition: ModelDataSourceDefinition): DataSourceType => {
8
+ const { strategy } = modelDataSourceDefinition;
9
+ if (strategy.dbType === 'DYNAMODB') {
10
+ switch (strategy.provisionStrategy) {
11
+ case 'DEFAULT':
12
+ return {
13
+ dbType: 'DDB',
14
+ provisionDB: true,
15
+ provisionStrategy: DynamoDBProvisionStrategy.DEFAULT,
16
+ };
17
+ case 'AMPLIFY_TABLE':
18
+ return {
19
+ dbType: 'DDB',
20
+ provisionDB: true,
21
+ provisionStrategy: DynamoDBProvisionStrategy.AMPLIFY_TABLE,
22
+ };
23
+ default:
24
+ throw new Error(`Encountered unexpected provision strategy: ${(strategy as any).provisionStrategy}`);
25
+ }
26
+ }
27
+ throw new Error(`Encountered unexpected database type ${strategy.dbType}`);
28
+ };
29
+
30
+ export const parseDataSourceConfig = (dataSourceDefinitionMap: Record<string, ModelDataSourceDefinition>): DataSourceConfig => {
31
+ const modelToDatasourceMap = new Map<string, DataSourceType>();
32
+ for (const [key, value] of Object.entries(dataSourceDefinitionMap)) {
33
+ const dataSourceType = convertToDataSourceType(value);
34
+ modelToDatasourceMap.set(key, dataSourceType);
35
+ }
36
+ return {
37
+ modelToDatasourceMap,
38
+ };
39
+ };
@@ -4,4 +4,4 @@ export * from './default-parameters';
4
4
  export * from './conflict-resolution';
5
5
  export * from './asset-manager';
6
6
  export * from './codegen-assets';
7
- export * from './amplify-metadata';
7
+ export * from './model-type-name';
@@ -0,0 +1,30 @@
1
+ import { Kind, ObjectTypeDefinitionNode, parse } from 'graphql';
2
+ import { ModelDataSourceDefinition } from '../types';
3
+
4
+ const MODEL_DIRECTIVE_NAME = 'model';
5
+ /**
6
+ * Get the type names with model directives in the GraphQL schema in SDL
7
+ * @param schema graphql schema in SDL
8
+ * @returns type names which model diretives are attached
9
+ */
10
+ 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);
19
+ }
20
+
21
+ export function constructDataSourceDefinitionMap(
22
+ 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
+ }