@aws-amplify/graphql-api-construct 1.7.1-gen2-release.0 → 1.8.0-sql-gen2.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 (281) hide show
  1. package/.jsii +256 -331
  2. package/API.md +9 -17
  3. package/CHANGELOG.md +4 -2
  4. package/lib/amplify-dynamodb-table-wrapper.js +1 -1
  5. package/lib/amplify-graphql-api.js +2 -3
  6. package/lib/amplify-graphql-definition.js +1 -1
  7. package/lib/index.d.ts +1 -1
  8. package/lib/index.js +1 -1
  9. package/lib/internal/authorization-modes.d.ts +1 -12
  10. package/lib/internal/authorization-modes.js +7 -47
  11. package/lib/internal/codegen-assets.js +1 -10
  12. package/lib/internal/data-source-config.js +3 -2
  13. package/lib/model-datasource-strategy-types.d.ts +9 -1
  14. package/lib/model-datasource-strategy-types.js +1 -1
  15. package/lib/sql-model-datasource-strategy.d.ts +7 -1
  16. package/lib/sql-model-datasource-strategy.js +15 -4
  17. package/lib/types.d.ts +5 -51
  18. package/lib/types.js +1 -1
  19. package/node_modules/@aws-amplify/graphql-auth-transformer/API.md +1 -3
  20. package/node_modules/@aws-amplify/graphql-auth-transformer/CHANGELOG.md +1 -1
  21. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/graphql-auth-transformer.d.ts.map +1 -1
  22. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/graphql-auth-transformer.js +19 -30
  23. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/graphql-auth-transformer.js.map +1 -1
  24. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/constants.d.ts.map +1 -1
  25. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/constants.js +0 -1
  26. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/constants.js.map +1 -1
  27. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/definitions.d.ts +1 -2
  28. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/definitions.d.ts.map +1 -1
  29. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/definitions.js.map +1 -1
  30. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/index.d.ts +1 -2
  31. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/index.d.ts.map +1 -1
  32. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/index.js +11 -22
  33. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/index.js.map +1 -1
  34. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/validations.d.ts.map +1 -1
  35. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/validations.js +4 -11
  36. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/validations.js.map +1 -1
  37. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/warnings.d.ts +0 -1
  38. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/warnings.d.ts.map +1 -1
  39. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/warnings.js +1 -10
  40. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/warnings.js.map +1 -1
  41. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/ddb-vtl-generator.d.ts +1 -1
  42. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/ddb-vtl-generator.d.ts.map +1 -1
  43. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/ddb-vtl-generator.js +1 -1
  44. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/ddb-vtl-generator.js.map +1 -1
  45. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/field.d.ts +1 -1
  46. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/field.d.ts.map +1 -1
  47. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/field.js +10 -20
  48. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/field.js.map +1 -1
  49. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/helpers.d.ts +2 -9
  50. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/helpers.d.ts.map +1 -1
  51. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/helpers.js +9 -16
  52. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/helpers.js.map +1 -1
  53. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/index.d.ts +1 -1
  54. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/index.d.ts.map +1 -1
  55. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/index.js +2 -2
  56. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/index.js.map +1 -1
  57. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/mutation.create.d.ts.map +1 -1
  58. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/mutation.create.js +4 -5
  59. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/mutation.create.js.map +1 -1
  60. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/mutation.delete.d.ts.map +1 -1
  61. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/mutation.delete.js +4 -5
  62. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/mutation.delete.js.map +1 -1
  63. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/mutation.update.d.ts.map +1 -1
  64. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/mutation.update.js +4 -5
  65. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/mutation.update.js.map +1 -1
  66. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/query.d.ts.map +1 -1
  67. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/query.js +4 -15
  68. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/query.js.map +1 -1
  69. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/search.d.ts.map +1 -1
  70. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/search.js +4 -5
  71. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/search.js.map +1 -1
  72. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/subscriptions.d.ts.map +1 -1
  73. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/subscriptions.js +2 -8
  74. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/subscriptions.js.map +1 -1
  75. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/rds-vtl-generator.d.ts +1 -1
  76. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/rds-vtl-generator.d.ts.map +1 -1
  77. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/rds-vtl-generator.js +2 -2
  78. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/rds-vtl-generator.js.map +1 -1
  79. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/common.d.ts +2 -3
  80. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/common.d.ts.map +1 -1
  81. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/common.js +16 -27
  82. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/common.js.map +1 -1
  83. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/mutation.d.ts.map +1 -1
  84. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/mutation.js +5 -5
  85. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/mutation.js.map +1 -1
  86. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/query.js +3 -3
  87. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/query.js.map +1 -1
  88. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/subscription.js +1 -1
  89. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/subscription.js.map +1 -1
  90. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/vtl-generator.d.ts +1 -1
  91. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/vtl-generator.d.ts.map +1 -1
  92. package/node_modules/@aws-amplify/graphql-auth-transformer/package.json +13 -13
  93. package/node_modules/@aws-amplify/graphql-default-value-transformer/CHANGELOG.md +1 -1
  94. package/node_modules/@aws-amplify/graphql-default-value-transformer/package.json +8 -8
  95. package/node_modules/@aws-amplify/graphql-directives/CHANGELOG.md +0 -6
  96. package/node_modules/@aws-amplify/graphql-directives/lib/directives/auth.d.ts.map +1 -1
  97. package/node_modules/@aws-amplify/graphql-directives/lib/directives/auth.js +0 -1
  98. package/node_modules/@aws-amplify/graphql-directives/lib/directives/auth.js.map +1 -1
  99. package/node_modules/@aws-amplify/graphql-directives/package.json +2 -3
  100. package/node_modules/@aws-amplify/graphql-function-transformer/CHANGELOG.md +1 -1
  101. package/node_modules/@aws-amplify/graphql-function-transformer/package.json +7 -7
  102. package/node_modules/@aws-amplify/graphql-http-transformer/CHANGELOG.md +1 -1
  103. package/node_modules/@aws-amplify/graphql-http-transformer/package.json +7 -7
  104. package/node_modules/@aws-amplify/graphql-index-transformer/CHANGELOG.md +1 -1
  105. package/node_modules/@aws-amplify/graphql-index-transformer/lib/resolvers/resolvers.d.ts +1 -1
  106. package/node_modules/@aws-amplify/graphql-index-transformer/lib/resolvers/resolvers.d.ts.map +1 -1
  107. package/node_modules/@aws-amplify/graphql-index-transformer/lib/resolvers/resolvers.js +10 -19
  108. package/node_modules/@aws-amplify/graphql-index-transformer/lib/resolvers/resolvers.js.map +1 -1
  109. package/node_modules/@aws-amplify/graphql-index-transformer/lib/schema.d.ts.map +1 -1
  110. package/node_modules/@aws-amplify/graphql-index-transformer/lib/schema.js +2 -13
  111. package/node_modules/@aws-amplify/graphql-index-transformer/lib/schema.js.map +1 -1
  112. package/node_modules/@aws-amplify/graphql-index-transformer/package.json +8 -8
  113. package/node_modules/@aws-amplify/graphql-maps-to-transformer/CHANGELOG.md +1 -1
  114. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/assets/mapping-lambda.zip +0 -0
  115. package/node_modules/@aws-amplify/graphql-maps-to-transformer/package.json +11 -11
  116. package/node_modules/@aws-amplify/graphql-model-transformer/API.md +3 -3
  117. package/node_modules/@aws-amplify/graphql-model-transformer/CHANGELOG.md +8 -2
  118. package/node_modules/@aws-amplify/graphql-model-transformer/lib/definitions.d.ts +0 -1
  119. package/node_modules/@aws-amplify/graphql-model-transformer/lib/definitions.d.ts.map +1 -1
  120. package/node_modules/@aws-amplify/graphql-model-transformer/lib/definitions.js +1 -2
  121. package/node_modules/@aws-amplify/graphql-model-transformer/lib/definitions.js.map +1 -1
  122. package/node_modules/@aws-amplify/graphql-model-transformer/lib/graphql-model-transformer.d.ts.map +1 -1
  123. package/node_modules/@aws-amplify/graphql-model-transformer/lib/graphql-model-transformer.js +16 -29
  124. package/node_modules/@aws-amplify/graphql-model-transformer/lib/graphql-model-transformer.js.map +1 -1
  125. package/node_modules/@aws-amplify/graphql-model-transformer/lib/graphql-types/common.d.ts +1 -1
  126. package/node_modules/@aws-amplify/graphql-model-transformer/lib/graphql-types/common.d.ts.map +1 -1
  127. package/node_modules/@aws-amplify/graphql-model-transformer/lib/graphql-types/common.js +7 -11
  128. package/node_modules/@aws-amplify/graphql-model-transformer/lib/graphql-types/common.js.map +1 -1
  129. package/node_modules/@aws-amplify/graphql-model-transformer/lib/rds-lambda.zip +0 -0
  130. package/node_modules/@aws-amplify/graphql-model-transformer/lib/rds-notification-lambda.zip +0 -0
  131. package/node_modules/@aws-amplify/graphql-model-transformer/lib/rds-patching-lambda.zip +0 -0
  132. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/common.d.ts +1 -1
  133. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/common.d.ts.map +1 -1
  134. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/common.js +9 -18
  135. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/common.js.map +1 -1
  136. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/resolver.d.ts.map +1 -1
  137. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/resolver.js +7 -0
  138. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/resolver.js.map +1 -1
  139. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/model-resource-generator.d.ts.map +1 -1
  140. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/model-resource-generator.js +3 -3
  141. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/model-resource-generator.js.map +1 -1
  142. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/rds-model-resource-generator.d.ts.map +1 -1
  143. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/rds-model-resource-generator.js +5 -0
  144. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/rds-model-resource-generator.js.map +1 -1
  145. package/node_modules/@aws-amplify/graphql-model-transformer/package.json +7 -7
  146. package/node_modules/@aws-amplify/graphql-predictions-transformer/CHANGELOG.md +1 -1
  147. package/node_modules/@aws-amplify/graphql-predictions-transformer/lib/predictionsLambdaFunction.zip +0 -0
  148. package/node_modules/@aws-amplify/graphql-predictions-transformer/package.json +7 -7
  149. package/node_modules/@aws-amplify/graphql-relational-transformer/CHANGELOG.md +2 -4
  150. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/belongs-to/belongs-to-directive-ddb-fields-transformer.d.ts +4 -3
  151. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/belongs-to/belongs-to-directive-ddb-fields-transformer.d.ts.map +1 -1
  152. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/belongs-to/belongs-to-directive-ddb-fields-transformer.js +4 -7
  153. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/belongs-to/belongs-to-directive-ddb-fields-transformer.js.map +1 -1
  154. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/belongs-to/belongs-to-directive-sql-transformer.d.ts +5 -4
  155. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/belongs-to/belongs-to-directive-sql-transformer.d.ts.map +1 -1
  156. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/belongs-to/belongs-to-directive-sql-transformer.js +5 -8
  157. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/belongs-to/belongs-to-directive-sql-transformer.js.map +1 -1
  158. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/belongs-to/belongs-to-directive-transformer-factory.d.ts +1 -1
  159. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/belongs-to/belongs-to-directive-transformer-factory.d.ts.map +1 -1
  160. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/belongs-to/belongs-to-directive-transformer-factory.js +3 -18
  161. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/belongs-to/belongs-to-directive-transformer-factory.js.map +1 -1
  162. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-belongs-to-transformer.js +6 -5
  163. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-belongs-to-transformer.js.map +1 -1
  164. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-has-many-transformer.d.ts.map +1 -1
  165. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-has-many-transformer.js +7 -4
  166. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-has-many-transformer.js.map +1 -1
  167. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-has-one-transformer.js +6 -5
  168. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-has-one-transformer.js.map +1 -1
  169. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-many-to-many-transformer.js.map +1 -1
  170. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/has-many/has-many-directive-ddb-fields-transformer.d.ts +3 -2
  171. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/has-many/has-many-directive-ddb-fields-transformer.d.ts.map +1 -1
  172. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/has-many/has-many-directive-ddb-fields-transformer.js +2 -6
  173. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/has-many/has-many-directive-ddb-fields-transformer.js.map +1 -1
  174. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/has-many/has-many-directive-sql-transformer.d.ts +5 -4
  175. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/has-many/has-many-directive-sql-transformer.d.ts.map +1 -1
  176. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/has-many/has-many-directive-sql-transformer.js +4 -7
  177. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/has-many/has-many-directive-sql-transformer.js.map +1 -1
  178. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/has-many/has-many-directive-transformer-factory.d.ts +1 -1
  179. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/has-many/has-many-directive-transformer-factory.d.ts.map +1 -1
  180. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/has-many/has-many-directive-transformer-factory.js +3 -18
  181. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/has-many/has-many-directive-transformer-factory.js.map +1 -1
  182. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/has-one/has-one-directive-ddb-fields-transformer.d.ts +4 -3
  183. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/has-one/has-one-directive-ddb-fields-transformer.d.ts.map +1 -1
  184. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/has-one/has-one-directive-ddb-fields-transformer.js +4 -7
  185. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/has-one/has-one-directive-ddb-fields-transformer.js.map +1 -1
  186. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/has-one/has-one-directive-sql-transformer.d.ts +5 -4
  187. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/has-one/has-one-directive-sql-transformer.d.ts.map +1 -1
  188. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/has-one/has-one-directive-sql-transformer.js +4 -7
  189. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/has-one/has-one-directive-sql-transformer.js.map +1 -1
  190. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/has-one/has-one-directive-transformer-factory.d.ts +1 -1
  191. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/has-one/has-one-directive-transformer-factory.d.ts.map +1 -1
  192. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/has-one/has-one-directive-transformer-factory.js +3 -18
  193. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/has-one/has-one-directive-transformer-factory.js.map +1 -1
  194. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/ddb-generator.d.ts +2 -3
  195. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/ddb-generator.d.ts.map +1 -1
  196. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/ddb-generator.js +3 -6
  197. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/ddb-generator.js.map +1 -1
  198. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/generator.d.ts +2 -2
  199. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/generator.d.ts.map +1 -1
  200. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/generator.js.map +1 -1
  201. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolvers.d.ts +1 -2
  202. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolvers.d.ts.map +1 -1
  203. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolvers.js +17 -72
  204. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolvers.js.map +1 -1
  205. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/schema.d.ts +1 -1
  206. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/schema.d.ts.map +1 -1
  207. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/schema.js.map +1 -1
  208. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/types.d.ts +0 -5
  209. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/types.d.ts.map +1 -1
  210. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/utils.d.ts +1 -2
  211. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/utils.d.ts.map +1 -1
  212. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/utils.js +1 -7
  213. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/utils.js.map +1 -1
  214. package/node_modules/@aws-amplify/graphql-relational-transformer/package.json +9 -9
  215. package/node_modules/@aws-amplify/graphql-searchable-transformer/CHANGELOG.md +1 -1
  216. package/node_modules/@aws-amplify/graphql-searchable-transformer/lib/generate-resolver-vtl.d.ts +1 -1
  217. package/node_modules/@aws-amplify/graphql-searchable-transformer/lib/generate-resolver-vtl.d.ts.map +1 -1
  218. package/node_modules/@aws-amplify/graphql-searchable-transformer/lib/generate-resolver-vtl.js +9 -20
  219. package/node_modules/@aws-amplify/graphql-searchable-transformer/lib/generate-resolver-vtl.js.map +1 -1
  220. package/node_modules/@aws-amplify/graphql-searchable-transformer/lib/graphql-searchable-transformer.d.ts.map +1 -1
  221. package/node_modules/@aws-amplify/graphql-searchable-transformer/lib/graphql-searchable-transformer.js +3 -14
  222. package/node_modules/@aws-amplify/graphql-searchable-transformer/lib/graphql-searchable-transformer.js.map +1 -1
  223. package/node_modules/@aws-amplify/graphql-searchable-transformer/lib/streaming-lambda.zip +0 -0
  224. package/node_modules/@aws-amplify/graphql-searchable-transformer/package.json +8 -8
  225. package/node_modules/@aws-amplify/graphql-sql-transformer/CHANGELOG.md +1 -1
  226. package/node_modules/@aws-amplify/graphql-sql-transformer/lib/graphql-sql-transformer.d.ts.map +1 -1
  227. package/node_modules/@aws-amplify/graphql-sql-transformer/lib/graphql-sql-transformer.js +8 -17
  228. package/node_modules/@aws-amplify/graphql-sql-transformer/lib/graphql-sql-transformer.js.map +1 -1
  229. package/node_modules/@aws-amplify/graphql-sql-transformer/package.json +8 -8
  230. package/node_modules/@aws-amplify/graphql-transformer/CHANGELOG.md +1 -1
  231. package/node_modules/@aws-amplify/graphql-transformer/package.json +15 -15
  232. package/node_modules/@aws-amplify/graphql-transformer-core/CHANGELOG.md +1 -1
  233. package/node_modules/@aws-amplify/graphql-transformer-core/package.json +5 -5
  234. package/node_modules/@aws-amplify/graphql-transformer-interfaces/API.md +11 -3
  235. package/node_modules/@aws-amplify/graphql-transformer-interfaces/CHANGELOG.md +4 -2
  236. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/model-datasource/types.d.ts +5 -1
  237. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/model-datasource/types.d.ts.map +1 -1
  238. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/model-datasource/types.js +5 -1
  239. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/model-datasource/types.js.map +1 -1
  240. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/synth-parameters.d.ts +0 -1
  241. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/synth-parameters.d.ts.map +1 -1
  242. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/transformer-context-provider.d.ts +1 -1
  243. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/transformer-context-provider.d.ts.map +1 -1
  244. package/node_modules/@aws-amplify/graphql-transformer-interfaces/package.json +2 -2
  245. package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/model-datasource/types.ts +20 -1
  246. package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/transformer-context/synth-parameters.ts +0 -1
  247. package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/transformer-context/transformer-context-provider.ts +0 -1
  248. package/node_modules/@aws-amplify/graphql-transformer-interfaces/tsconfig.tsbuildinfo +1 -1
  249. package/node_modules/graphql-transformer-common/CHANGELOG.md +0 -4
  250. package/node_modules/graphql-transformer-common/package.json +2 -3
  251. package/package.json +19 -19
  252. package/src/amplify-graphql-api.ts +0 -2
  253. package/src/index.ts +0 -1
  254. package/src/internal/authorization-modes.ts +8 -57
  255. package/src/internal/codegen-assets.ts +2 -11
  256. package/src/internal/data-source-config.ts +5 -1
  257. package/src/model-datasource-strategy-types.ts +11 -1
  258. package/src/sql-model-datasource-strategy.ts +15 -1
  259. package/src/types.ts +5 -56
  260. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/common.d.ts +0 -4
  261. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/common.d.ts.map +0 -1
  262. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/common.js +0 -12
  263. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/common.js.map +0 -1
  264. package/node_modules/@aws-amplify/graphql-directives/LICENSE +0 -201
  265. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/belongs-to/belongs-to-directive-ddb-references-transformer.d.ts +0 -11
  266. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/belongs-to/belongs-to-directive-ddb-references-transformer.d.ts.map +0 -1
  267. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/belongs-to/belongs-to-directive-ddb-references-transformer.js +0 -36
  268. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/belongs-to/belongs-to-directive-ddb-references-transformer.js.map +0 -1
  269. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/has-many/has-many-directive-ddb-references-transformer.d.ts +0 -11
  270. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/has-many/has-many-directive-ddb-references-transformer.d.ts.map +0 -1
  271. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/has-many/has-many-directive-ddb-references-transformer.js +0 -37
  272. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/has-many/has-many-directive-ddb-references-transformer.js.map +0 -1
  273. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/has-one/has-one-directive-ddb-references-transformer.d.ts +0 -11
  274. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/has-one/has-one-directive-ddb-references-transformer.d.ts.map +0 -1
  275. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/has-one/has-one-directive-ddb-references-transformer.js +0 -37
  276. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/has-one/has-one-directive-ddb-references-transformer.js.map +0 -1
  277. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/ddb-references-generator.d.ts +0 -9
  278. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/ddb-references-generator.d.ts.map +0 -1
  279. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/ddb-references-generator.js +0 -172
  280. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/ddb-references-generator.js.map +0 -1
  281. package/node_modules/graphql-transformer-common/LICENSE +0 -201
@@ -3,10 +3,6 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- ## [4.29.1-gen2-release.0](https://github.com/aws-amplify/amplify-category-api/compare/graphql-transformer-common@4.29.0...graphql-transformer-common@4.29.1-gen2-release.0) (2024-03-29)
7
-
8
- **Note:** Version bump only for package graphql-transformer-common
9
-
10
6
  # [4.29.0](https://github.com/aws-amplify/amplify-category-api/compare/graphql-transformer-common@4.28.1...graphql-transformer-common@4.29.0) (2024-03-28)
11
7
 
12
8
  ### Features
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphql-transformer-common",
3
- "version": "4.29.1-gen2-release.0",
3
+ "version": "4.29.0",
4
4
  "description": "Common code and constants for AppSync Transformers",
5
5
  "repository": {
6
6
  "type": "git",
@@ -65,6 +65,5 @@
65
65
  "coveragePathIgnorePatterns": [
66
66
  "/__tests__/"
67
67
  ]
68
- },
69
- "gitHead": "a550843921e81b923214a9038b0725ac5e6b2b67"
68
+ }
70
69
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/graphql-api-construct",
3
- "version": "1.7.1-gen2-release.0",
3
+ "version": "1.8.0-sql-gen2.0",
4
4
  "description": "AppSync GraphQL Api Construct using Amplify GraphQL Transformer.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -76,21 +76,21 @@
76
76
  "dependencies": {
77
77
  "@aws-amplify/backend-output-schemas": "^0.4.0",
78
78
  "@aws-amplify/backend-output-storage": "^0.2.2",
79
- "@aws-amplify/graphql-auth-transformer": "3.4.3-gen2-release.0",
80
- "@aws-amplify/graphql-default-value-transformer": "2.3.3-gen2-release.0",
81
- "@aws-amplify/graphql-directives": "1.1.0-gen2-release.0",
82
- "@aws-amplify/graphql-function-transformer": "2.1.20-gen2-release.0",
83
- "@aws-amplify/graphql-http-transformer": "2.1.20-gen2-release.0",
84
- "@aws-amplify/graphql-index-transformer": "2.3.9-gen2-release.0",
85
- "@aws-amplify/graphql-maps-to-transformer": "3.4.10-gen2-release.0",
86
- "@aws-amplify/graphql-model-transformer": "2.7.1-gen2-release.0",
87
- "@aws-amplify/graphql-predictions-transformer": "2.1.20-gen2-release.0",
88
- "@aws-amplify/graphql-relational-transformer": "2.5.0-gen2-release.0",
89
- "@aws-amplify/graphql-searchable-transformer": "2.6.3-gen2-release.0",
90
- "@aws-amplify/graphql-sql-transformer": "0.2.9-gen2-release.0",
91
- "@aws-amplify/graphql-transformer": "1.4.1-gen2-release.0",
92
- "@aws-amplify/graphql-transformer-core": "2.5.2-gen2-release.0",
93
- "@aws-amplify/graphql-transformer-interfaces": "3.5.1-gen2-release.0",
79
+ "@aws-amplify/graphql-auth-transformer": "3.4.3-sql-gen2.0",
80
+ "@aws-amplify/graphql-default-value-transformer": "2.3.3-sql-gen2.0",
81
+ "@aws-amplify/graphql-directives": "1.0.1",
82
+ "@aws-amplify/graphql-function-transformer": "2.1.20-sql-gen2.0",
83
+ "@aws-amplify/graphql-http-transformer": "2.1.20-sql-gen2.0",
84
+ "@aws-amplify/graphql-index-transformer": "2.3.9-sql-gen2.0",
85
+ "@aws-amplify/graphql-maps-to-transformer": "3.4.10-sql-gen2.0",
86
+ "@aws-amplify/graphql-model-transformer": "2.8.0-sql-gen2.0",
87
+ "@aws-amplify/graphql-predictions-transformer": "2.1.20-sql-gen2.0",
88
+ "@aws-amplify/graphql-relational-transformer": "2.4.3-sql-gen2.0",
89
+ "@aws-amplify/graphql-searchable-transformer": "2.6.3-sql-gen2.0",
90
+ "@aws-amplify/graphql-sql-transformer": "0.2.9-sql-gen2.0",
91
+ "@aws-amplify/graphql-transformer": "1.4.1-sql-gen2.0",
92
+ "@aws-amplify/graphql-transformer-core": "2.5.2-sql-gen2.0",
93
+ "@aws-amplify/graphql-transformer-interfaces": "3.6.0-sql-gen2.0",
94
94
  "@aws-amplify/platform-core": "^0.2.0",
95
95
  "@aws-amplify/plugin-types": "^0.4.1",
96
96
  "charenc": "^0.0.2",
@@ -99,7 +99,7 @@
99
99
  "graceful-fs": "^4.2.11",
100
100
  "graphql": "^15.5.0",
101
101
  "graphql-mapping-template": "4.20.15",
102
- "graphql-transformer-common": "4.29.1-gen2-release.0",
102
+ "graphql-transformer-common": "4.29.0",
103
103
  "hjson": "^3.2.2",
104
104
  "immer": "^9.0.12",
105
105
  "is-buffer": "^2.0.5",
@@ -114,7 +114,7 @@
114
114
  "zod": "^3.22.3"
115
115
  },
116
116
  "devDependencies": {
117
- "@aws-amplify/graphql-transformer-test-utils": "0.4.8-gen2-release.0",
117
+ "@aws-amplify/graphql-transformer-test-utils": "0.4.8-sql-gen2.0",
118
118
  "@types/fs-extra": "^8.0.1",
119
119
  "@types/node": "^12.12.6",
120
120
  "aws-cdk-lib": "2.80.0",
@@ -179,5 +179,5 @@
179
179
  "/__tests__/"
180
180
  ]
181
181
  },
182
- "gitHead": "a550843921e81b923214a9038b0725ac5e6b2b67"
182
+ "gitHead": "b28d05f89e8a528dbf1f03836044594b40566b3d"
183
183
  }
@@ -48,7 +48,6 @@ import {
48
48
  getGeneratedFunctionSlots,
49
49
  CodegenAssets,
50
50
  getAdditionalAuthenticationTypes,
51
- validateAuthorizationModes,
52
51
  } from './internal';
53
52
  import { getStackForScope, walkAndProcessNodes } from './internal/construct-tree';
54
53
  import { getDataSourceStrategiesProvider } from './internal/data-source-config';
@@ -170,7 +169,6 @@ export class AmplifyGraphqlApi extends Construct {
170
169
  dataSources,
171
170
  });
172
171
 
173
- validateAuthorizationModes(authorizationModes);
174
172
  const { authConfig, authSynthParameters } = convertAuthorizationModesToTransformerAuthConfig(authorizationModes);
175
173
 
176
174
  validateFunctionSlots(functionSlots ?? []);
package/src/index.ts CHANGED
@@ -4,7 +4,6 @@
4
4
  */
5
5
  export type {
6
6
  IAMAuthorizationConfig,
7
- IdentityPoolAuthorizationConfig,
8
7
  UserPoolAuthorizationConfig,
9
8
  OIDCAuthorizationConfig,
10
9
  ApiKeyAuthorizationConfig,
@@ -5,61 +5,19 @@ import { IRole, ServicePrincipal } from 'aws-cdk-lib/aws-iam';
5
5
  import {
6
6
  AuthorizationModes,
7
7
  ApiKeyAuthorizationConfig,
8
+ IAMAuthorizationConfig,
8
9
  LambdaAuthorizationConfig,
9
10
  OIDCAuthorizationConfig,
10
11
  UserPoolAuthorizationConfig,
11
12
  } from '../types';
12
13
 
13
14
  type AuthorizationConfigMode =
14
- | { type: 'AWS_IAM' }
15
+ | (IAMAuthorizationConfig & { type: 'AWS_IAM' })
15
16
  | (UserPoolAuthorizationConfig & { type: 'AMAZON_COGNITO_USER_POOLS' })
16
17
  | (OIDCAuthorizationConfig & { type: 'OPENID_CONNECT' })
17
18
  | (ApiKeyAuthorizationConfig & { type: 'API_KEY' })
18
19
  | (LambdaAuthorizationConfig & { type: 'AWS_LAMBDA' });
19
20
 
20
- /**
21
- * Validates authorization modes.
22
- *
23
- * Rules:
24
- * 1. Validates that deprecated settings ('iamConfig.authenticatedUserRole', 'iamConfig.unauthenticatedUserRole',
25
- * 'iamConfig.identityPoolId', 'iamConfig.allowListedRoles' and 'adminRoles') are mutually exclusive with new settings that
26
- * replaced them ('iamConfig.enableIamAuthorizationMode' and any of 'authorizationModes.identityPoolConfig')
27
- * 2. If deprecated identity pool settings are used ('iamConfig.authenticatedUserRole', 'iamConfig.unauthenticatedUserRole',
28
- * and 'iamConfig.identityPoolId') validate that all are provided.
29
- */
30
- export const validateAuthorizationModes = (authorizationModes: AuthorizationModes): void => {
31
- const hasAnyDeprecatedIdentityPoolSetting =
32
- authorizationModes.iamConfig?.authenticatedUserRole ||
33
- authorizationModes.iamConfig?.unauthenticatedUserRole ||
34
- authorizationModes.iamConfig?.identityPoolId;
35
- const hasAllDeprecatedIdentityPoolSettings =
36
- authorizationModes.iamConfig?.authenticatedUserRole &&
37
- authorizationModes.iamConfig?.unauthenticatedUserRole &&
38
- authorizationModes.iamConfig?.identityPoolId;
39
- const hasDeprecatedIamSettings =
40
- authorizationModes.iamConfig?.authenticatedUserRole ||
41
- authorizationModes.iamConfig?.unauthenticatedUserRole ||
42
- authorizationModes.iamConfig?.identityPoolId ||
43
- authorizationModes.iamConfig?.allowListedRoles ||
44
- authorizationModes.adminRoles;
45
- const hasUnDeprecatedIamSettings =
46
- typeof authorizationModes.iamConfig?.enableIamAuthorizationMode !== 'undefined' || authorizationModes.identityPoolConfig;
47
-
48
- if (hasDeprecatedIamSettings && hasUnDeprecatedIamSettings) {
49
- throw new Error(
50
- 'Invalid authorization modes configuration provided. ' +
51
- "Deprecated IAM configuration cannot be used with identity pool configuration or when 'enableIamAuthorizationMode' is specified.",
52
- );
53
- }
54
-
55
- if (hasAnyDeprecatedIdentityPoolSetting && !hasAllDeprecatedIdentityPoolSettings) {
56
- throw new Error(
57
- "'authorizationModes.iamConfig.authenticatedUserRole', 'authorizationModes.iamConfig.unauthenticatedUserRole' and" +
58
- " 'authorizationModes.iamConfig.identityPoolId' must be provided.",
59
- );
60
- }
61
- };
62
-
63
21
  /**
64
22
  * Converts a single auth mode config into the amplify-internal representation.
65
23
  * @param authMode the auth mode to convert into the Appsync CDK representation.
@@ -121,7 +79,7 @@ const convertAuthConfigToAppSyncAuth = (authModes: AuthorizationModes): AppSyncA
121
79
  authModes.lambdaConfig ? { type: 'AWS_LAMBDA', ...authModes.lambdaConfig } : null,
122
80
  authModes.oidcConfig ? { type: 'OPENID_CONNECT', ...authModes.oidcConfig } : null,
123
81
  authModes.userPoolConfig ? { type: 'AMAZON_COGNITO_USER_POOLS', ...authModes.userPoolConfig } : null,
124
- authModes.iamConfig || authModes.identityPoolConfig ? { type: 'AWS_IAM' } : null,
82
+ authModes.iamConfig ? { type: 'AWS_IAM', ...authModes.iamConfig } : null,
125
83
  ].filter((mode) => mode) as AuthorizationConfigMode[];
126
84
  const authProviders = authConfig.map(convertAuthModeToAuthProvider);
127
85
 
@@ -158,7 +116,7 @@ const convertAuthConfigToAppSyncAuth = (authModes: AuthorizationModes): AppSyncA
158
116
 
159
117
  type AuthSynthParameters = Pick<
160
118
  SynthParameters,
161
- 'userPoolId' | 'authenticatedUserRoleName' | 'unauthenticatedUserRoleName' | 'identityPoolId' | 'adminRoles' | 'enableIamAccess'
119
+ 'userPoolId' | 'authenticatedUserRoleName' | 'unauthenticatedUserRoleName' | 'identityPoolId' | 'adminRoles'
162
120
  >;
163
121
 
164
122
  interface AuthConfig {
@@ -219,19 +177,12 @@ const getAllowListedRoles = (authModes: AuthorizationModes): string[] =>
219
177
  */
220
178
  const getSynthParameters = (authModes: AuthorizationModes): AuthSynthParameters => ({
221
179
  adminRoles: getAllowListedRoles(authModes),
222
- identityPoolId: authModes.identityPoolConfig?.identityPoolId ?? authModes.iamConfig?.identityPoolId,
223
- enableIamAccess: authModes.iamConfig?.enableIamAuthorizationMode,
180
+ identityPoolId: authModes.iamConfig?.identityPoolId,
224
181
  ...(authModes.userPoolConfig ? { userPoolId: authModes.userPoolConfig.userPool.userPoolId } : {}),
225
- ...(authModes?.identityPoolConfig
226
- ? {
227
- authenticatedUserRoleName: authModes.identityPoolConfig.authenticatedUserRole.roleName,
228
- unauthenticatedUserRoleName: authModes.identityPoolConfig.unauthenticatedUserRole.roleName,
229
- }
230
- : {}),
231
- ...(authModes?.iamConfig && authModes?.iamConfig.authenticatedUserRole && authModes?.iamConfig.unauthenticatedUserRole
182
+ ...(authModes?.iamConfig
232
183
  ? {
233
- authenticatedUserRoleName: authModes.iamConfig.authenticatedUserRole?.roleName,
234
- unauthenticatedUserRoleName: authModes.iamConfig.unauthenticatedUserRole?.roleName,
184
+ authenticatedUserRoleName: authModes.iamConfig.authenticatedUserRole.roleName,
185
+ unauthenticatedUserRoleName: authModes.iamConfig.unauthenticatedUserRole.roleName,
235
186
  }
236
187
  : {}),
237
188
  });
@@ -1,5 +1,5 @@
1
- import { RemovalPolicy, Fn } from 'aws-cdk-lib';
2
- import { Bucket, HttpMethods, IBucket } from 'aws-cdk-lib/aws-s3';
1
+ import { RemovalPolicy } from 'aws-cdk-lib';
2
+ import { Bucket, IBucket } from 'aws-cdk-lib/aws-s3';
3
3
  import { BucketDeployment, Source } from 'aws-cdk-lib/aws-s3-deployment';
4
4
  import { Construct } from 'constructs';
5
5
 
@@ -8,7 +8,6 @@ export type CodegenAssetsProps = {
8
8
  };
9
9
 
10
10
  const MODEL_SCHEMA_KEY = 'model-schema.graphql';
11
- const CONSOLE_SERVICE_ENDPOINT = Fn.join('', ['https://', Fn.ref('AWS::Region'), '.console.aws.amazon.com/amplify']);
12
11
 
13
12
  /**
14
13
  * Construct an S3 URI string for a given bucket and key.
@@ -31,14 +30,6 @@ export class CodegenAssets extends Construct {
31
30
  const bucket = new Bucket(this, `${id}Bucket`, {
32
31
  removalPolicy: RemovalPolicy.DESTROY,
33
32
  autoDeleteObjects: true,
34
- // Enabling CORS to allow console to access the codegen assets.
35
- cors: [
36
- {
37
- allowedMethods: [HttpMethods.GET, HttpMethods.HEAD],
38
- allowedHeaders: ['*'],
39
- allowedOrigins: [CONSOLE_SERVICE_ENDPOINT],
40
- },
41
- ],
42
33
  });
43
34
 
44
35
  const deployment = new BucketDeployment(this, `${id}Deployment`, {
@@ -10,6 +10,7 @@ import {
10
10
  DataSourceStrategiesProvider,
11
11
  isSqlModelDataSourceSsmDbConnectionConfig,
12
12
  isSqlModelDataSourceSecretsManagerDbConnectionConfig,
13
+ isSqlModelDataSourceSsmDbConnectionStringConfig,
13
14
  } from '@aws-amplify/graphql-transformer-interfaces';
14
15
  import { Token, Arn, ArnFormat } from 'aws-cdk-lib';
15
16
  import {
@@ -195,7 +196,10 @@ export const validateDataSourceStrategy = (strategy: ConstructModelDataSourceStr
195
196
  }
196
197
 
197
198
  const dbConnectionConfig = strategy.dbConnectionConfig;
198
- if (isSqlModelDataSourceSsmDbConnectionConfig(dbConnectionConfig)) {
199
+ if (
200
+ isSqlModelDataSourceSsmDbConnectionConfig(dbConnectionConfig) ||
201
+ isSqlModelDataSourceSsmDbConnectionStringConfig(dbConnectionConfig)
202
+ ) {
199
203
  const invalidSSMPaths = Object.values(dbConnectionConfig).filter((value) => typeof value === 'string' && !isValidSSMPath(value));
200
204
  if (invalidSSMPaths.length > 0) {
201
205
  throw new Error(
@@ -123,7 +123,17 @@ export interface SubnetAvailabilityZone {
123
123
  */
124
124
  export type SqlModelDataSourceDbConnectionConfig =
125
125
  | SqlModelDataSourceSecretsManagerDbConnectionConfig
126
- | SqlModelDataSourceSsmDbConnectionConfig;
126
+ | SqlModelDataSourceSsmDbConnectionConfig
127
+ | SqlModelDataSourceSsmDbConnectionStringConfig;
128
+
129
+ /**
130
+ * The configuration option to use a Secure Systems Manager parameter to store the connection string to the database.
131
+ * @experimental
132
+ */
133
+ export interface SqlModelDataSourceSsmDbConnectionStringConfig {
134
+ /** The SSM Path to the secure connection string used for connecting to the database. **/
135
+ readonly connectionUriSsmPath: string;
136
+ }
127
137
 
128
138
  /**
129
139
  * The credentials stored in Secrets Manager that the lambda data source will use to connect to the database.
@@ -6,6 +6,7 @@ import {
6
6
  SqlModelDataSourceDbConnectionConfig,
7
7
  SqlModelDataSourceSsmDbConnectionConfig,
8
8
  SqlModelDataSourceSecretsManagerDbConnectionConfig,
9
+ SqlModelDataSourceSsmDbConnectionStringConfig,
9
10
  } from './model-datasource-strategy-types';
10
11
 
11
12
  /**
@@ -29,7 +30,11 @@ export const isSQLLambdaModelDataSourceStrategy = (obj: any): obj is SQLLambdaMo
29
30
  * @returns true if the object is shaped like a SqlModelDataSourceDbConnectionConfig
30
31
  */
31
32
  export const isSqlModelDataSourceDbConnectionConfig = (obj: any): obj is SqlModelDataSourceDbConnectionConfig => {
32
- return isSqlModelDataSourceSsmDbConnectionConfig(obj) || isSqlModelDataSourceSecretsManagerDbConnectionConfig(obj);
33
+ return (
34
+ isSqlModelDataSourceSsmDbConnectionConfig(obj) ||
35
+ isSqlModelDataSourceSecretsManagerDbConnectionConfig(obj) ||
36
+ isSqlModelDataSourceSsmDbConnectionStringConfig(obj)
37
+ );
33
38
  };
34
39
 
35
40
  /**
@@ -65,6 +70,15 @@ export const isSqlModelDataSourceSecretsManagerDbConnectionConfig = (
65
70
  );
66
71
  };
67
72
 
73
+ /**
74
+ * Type predicate that returns true if the object is a SqlModelDataSourceSsmDbConnectionStringConfig.
75
+ * @param obj the object to inspect
76
+ * @returns true if the object is shaped like a SqlModelDataSourceSsmDbConnectionStringConfig
77
+ */
78
+ export const isSqlModelDataSourceSsmDbConnectionStringConfig = (obj: any): obj is SqlModelDataSourceSsmDbConnectionStringConfig => {
79
+ return (typeof obj === 'object' || typeof obj === 'function') && typeof obj.connectionUriSsmPath === 'string';
80
+ };
81
+
68
82
  /**
69
83
  * Class exposing utilities to produce SQLLambdaModelDataSourceStrategy objects given various inputs.
70
84
  */
package/src/types.ts CHANGED
@@ -28,68 +28,25 @@ export interface IAMAuthorizationConfig {
28
28
  /**
29
29
  * ID for the Cognito Identity Pool vending auth and unauth roles.
30
30
  * Format: `<region>:<id string>`
31
- *
32
- * @deprecated Use 'IdentityPoolAuthorizationConfig.identityPoolId' instead.
33
- * See https://docs.amplify.aws/cli/react/tools/cli/migration/iam-auth-updates-for-cdk-construct for details.
34
31
  */
35
- readonly identityPoolId?: string;
32
+ readonly identityPoolId: string;
36
33
 
37
34
  /**
38
35
  * Authenticated user role, applies to { provider: iam, allow: private } access.
39
- *
40
- * @deprecated Use 'IdentityPoolAuthorizationConfig.authenticatedUserRole' instead.
41
- * See https://docs.amplify.aws/cli/react/tools/cli/migration/iam-auth-updates-for-cdk-construct for details.
42
36
  */
43
- readonly authenticatedUserRole?: IRole;
37
+ readonly authenticatedUserRole: IRole;
44
38
 
45
39
  /**
46
40
  * Unauthenticated user role, applies to { provider: iam, allow: public } access.
47
- *
48
- * @deprecated Use 'IdentityPoolAuthorizationConfig.unauthenticatedUserRole' instead.
49
- * See https://docs.amplify.aws/cli/react/tools/cli/migration/iam-auth-updates-for-cdk-construct for details.
50
41
  */
51
- readonly unauthenticatedUserRole?: IRole;
42
+ readonly unauthenticatedUserRole: IRole;
52
43
 
53
44
  /**
54
45
  * A list of IAM roles which will be granted full read/write access to the generated model if IAM auth is enabled.
55
46
  * If an IRole is provided, the role `name` will be used for matching.
56
47
  * If a string is provided, the raw value will be used for matching.
57
- *
58
- * @deprecated Use 'enableIamAuthorizationMode' and IAM Policy to control access for IAM principals.
59
- * See https://docs.amplify.aws/cli/react/tools/cli/migration/iam-auth-updates-for-cdk-construct for details.
60
48
  */
61
49
  readonly allowListedRoles?: (IRole | string)[];
62
-
63
- /**
64
- * Enables access for IAM principals. If enabled @auth directive rules are not applied.
65
- * Instead, access should be defined by IAM Policy, see https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsappsync.html.
66
- *
67
- * Does not apply to authenticated and unauthenticated IAM Roles attached to Cognito Identity Pool.
68
- * Use IdentityPoolAuthorizationConfig to configure their access.
69
- */
70
- readonly enableIamAuthorizationMode?: boolean;
71
- }
72
-
73
- /**
74
- * Configuration for Cognito Identity Pool Authorization on the Graphql Api.
75
- * @struct - required since this interface begins with an 'I'
76
- */
77
- export interface IdentityPoolAuthorizationConfig {
78
- /**
79
- * ID for the Cognito Identity Pool vending auth and unauth roles.
80
- * Format: `<region>:<id string>`
81
- */
82
- readonly identityPoolId: string;
83
-
84
- /**
85
- * Authenticated user role, applies to { provider: iam, allow: private } access.
86
- */
87
- readonly authenticatedUserRole: IRole;
88
-
89
- /**
90
- * Unauthenticated user role, applies to { provider: iam, allow: public } access.
91
- */
92
- readonly unauthenticatedUserRole: IRole;
93
50
  }
94
51
 
95
52
  /**
@@ -177,18 +134,10 @@ export interface AuthorizationModes {
177
134
  readonly defaultAuthorizationMode?: 'AWS_IAM' | 'AMAZON_COGNITO_USER_POOLS' | 'OPENID_CONNECT' | 'API_KEY' | 'AWS_LAMBDA';
178
135
 
179
136
  /**
180
- * IAM Auth config, required to allow IAM-based access to this API.
181
- * This applies to any IAM principal except Amazon Cognito identity pool's authenticated and unauthenticated roles.
182
- * This behavior was has recently been improved.
183
- * See https://docs.amplify.aws/cli/react/tools/cli/migration/iam-auth-updates-for-cdk-construct for details.
184
- */
185
- readonly iamConfig?: IAMAuthorizationConfig;
186
-
187
- /**
188
- * Cognito Identity Pool config, required if an 'identityPool' auth provider is specified in the Api.
137
+ * IAM Auth config, required if an 'iam' auth provider is specified in the Api.
189
138
  * Applies to 'public' and 'private' auth strategies.
190
139
  */
191
- readonly identityPoolConfig?: IdentityPoolAuthorizationConfig;
140
+ readonly iamConfig?: IAMAuthorizationConfig;
192
141
 
193
142
  /**
194
143
  * Cognito UserPool config, required if a 'userPools' auth provider is specified in the Api.
@@ -1,4 +0,0 @@
1
- import { Expression } from 'graphql-mapping-template';
2
- export declare const setHasAuthExpression: Expression;
3
- export declare const isNonCognitoIAMPrincipal: import("graphql-mapping-template").AndNode;
4
- //# sourceMappingURL=common.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/vtl-generator/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,UAAU,EAA8B,MAAM,0BAA0B,CAAC;AAIrG,eAAO,MAAM,oBAAoB,EAAE,UAA+E,CAAC;AAGnH,eAAO,MAAM,wBAAwB,4CAInC,CAAC"}
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isNonCognitoIAMPrincipal = exports.setHasAuthExpression = void 0;
4
- const graphql_mapping_template_1 = require("graphql-mapping-template");
5
- const utils_1 = require("../utils");
6
- exports.setHasAuthExpression = (0, graphql_mapping_template_1.qref)((0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('ctx.stash.put'), (0, graphql_mapping_template_1.str)('hasAuth'), (0, graphql_mapping_template_1.bool)(true)));
7
- exports.isNonCognitoIAMPrincipal = (0, graphql_mapping_template_1.and)([
8
- (0, graphql_mapping_template_1.equals)((0, graphql_mapping_template_1.ref)('util.authType()'), (0, graphql_mapping_template_1.str)(utils_1.IAM_AUTH_TYPE)),
9
- (0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('util.isNull'), (0, graphql_mapping_template_1.ref)('ctx.identity.cognitoIdentityPoolId')),
10
- (0, graphql_mapping_template_1.methodCall)((0, graphql_mapping_template_1.ref)('util.isNull'), (0, graphql_mapping_template_1.ref)('ctx.identity.cognitoIdentityId')),
11
- ]);
12
- //# sourceMappingURL=common.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/vtl-generator/common.ts"],"names":[],"mappings":";;;AAAA,uEAAqG;AACrG,oCAAyC;AAG5B,QAAA,oBAAoB,GAAe,IAAA,+BAAI,EAAC,IAAA,qCAAU,EAAC,IAAA,8BAAG,EAAC,eAAe,CAAC,EAAE,IAAA,8BAAG,EAAC,SAAS,CAAC,EAAE,IAAA,+BAAI,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAGtG,QAAA,wBAAwB,GAAG,IAAA,8BAAG,EAAC;IAC1C,IAAA,iCAAM,EAAC,IAAA,8BAAG,EAAC,iBAAiB,CAAC,EAAE,IAAA,8BAAG,EAAC,qBAAa,CAAC,CAAC;IAClD,IAAA,qCAAU,EAAC,IAAA,8BAAG,EAAC,aAAa,CAAC,EAAE,IAAA,8BAAG,EAAC,oCAAoC,CAAC,CAAC;IACzE,IAAA,qCAAU,EAAC,IAAA,8BAAG,EAAC,aAAa,CAAC,EAAE,IAAA,8BAAG,EAAC,gCAAgC,CAAC,CAAC;CACtE,CAAC,CAAC"}