@aws-amplify/graphql-api-construct 1.3.0 → 1.4.0-nov-14-cut.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (537) hide show
  1. package/.jsii +1425 -248
  2. package/API.md +118 -1
  3. package/CHANGELOG.md +17 -0
  4. package/README.md +1055 -116
  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 +11 -0
  8. package/lib/amplify-graphql-api.js +76 -6
  9. package/lib/amplify-graphql-definition.d.ts +32 -4
  10. package/lib/amplify-graphql-definition.js +71 -7
  11. package/lib/index.d.ts +2 -1
  12. package/lib/index.js +5 -2
  13. package/lib/internal/construct-exports.js +8 -1
  14. package/lib/internal/data-source-config.d.ts +11 -0
  15. package/lib/internal/data-source-config.js +49 -0
  16. package/lib/internal/default-parameters.js +2 -1
  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 +37 -0
  21. package/lib/sql-model-datasource-strategy.d.ts +25 -0
  22. package/lib/sql-model-datasource-strategy.js +57 -0
  23. package/lib/types.d.ts +167 -7
  24. package/lib/types.js +1 -1
  25. package/node_modules/@aws-amplify/backend-output-schemas/lib/auth/index.js +7 -9
  26. package/node_modules/@aws-amplify/backend-output-schemas/lib/auth/v1.js +15 -18
  27. package/node_modules/@aws-amplify/backend-output-schemas/lib/graphql/index.js +10 -16
  28. package/node_modules/@aws-amplify/backend-output-schemas/lib/graphql/v1.js +22 -20
  29. package/node_modules/@aws-amplify/backend-output-schemas/lib/index.d.ts +12 -1
  30. package/node_modules/@aws-amplify/backend-output-schemas/lib/index.js +37 -63
  31. package/node_modules/@aws-amplify/backend-output-schemas/lib/platform/index.js +16 -14
  32. package/node_modules/@aws-amplify/backend-output-schemas/lib/platform/stack_metadata_schemas.js +7 -11
  33. package/node_modules/@aws-amplify/backend-output-schemas/lib/stack/index.d.ts +5 -0
  34. package/node_modules/@aws-amplify/backend-output-schemas/lib/stack/index.js +7 -9
  35. package/node_modules/@aws-amplify/backend-output-schemas/lib/stack/v1.d.ts +5 -0
  36. package/node_modules/@aws-amplify/backend-output-schemas/lib/stack/v1.js +9 -11
  37. package/node_modules/@aws-amplify/backend-output-schemas/lib/storage/index.js +7 -9
  38. package/node_modules/@aws-amplify/backend-output-schemas/lib/storage/v1.js +9 -12
  39. package/node_modules/@aws-amplify/backend-output-schemas/package.json +4 -23
  40. package/node_modules/@aws-amplify/backend-output-storage/lib/index.d.ts +1 -0
  41. package/node_modules/@aws-amplify/backend-output-storage/lib/index.js +17 -14
  42. package/node_modules/@aws-amplify/backend-output-storage/lib/stack_metadata_output_storage_strategy.js +28 -32
  43. package/node_modules/@aws-amplify/backend-output-storage/lib/store_attribution_metadata.d.ts +50 -0
  44. package/node_modules/@aws-amplify/backend-output-storage/lib/store_attribution_metadata.js +104 -0
  45. package/node_modules/@aws-amplify/backend-output-storage/node_modules/@aws-amplify/platform-core/lib/backend_deployment_type.d.ts +5 -0
  46. package/node_modules/@aws-amplify/backend-output-storage/node_modules/@aws-amplify/platform-core/lib/backend_deployment_type.js +9 -0
  47. package/node_modules/@aws-amplify/backend-output-storage/node_modules/@aws-amplify/platform-core/lib/cdk_context_key.d.ts +9 -0
  48. package/node_modules/@aws-amplify/backend-output-storage/node_modules/@aws-amplify/platform-core/lib/cdk_context_key.js +13 -0
  49. package/node_modules/@aws-amplify/backend-output-storage/node_modules/@aws-amplify/platform-core/lib/index.d.ts +4 -0
  50. package/node_modules/@aws-amplify/backend-output-storage/node_modules/@aws-amplify/platform-core/lib/index.js +22 -0
  51. package/node_modules/@aws-amplify/backend-output-storage/node_modules/@aws-amplify/platform-core/lib/unique_backend_identifier.d.ts +53 -0
  52. package/node_modules/@aws-amplify/backend-output-storage/node_modules/@aws-amplify/platform-core/lib/unique_backend_identifier.js +74 -0
  53. package/node_modules/@aws-amplify/backend-output-storage/node_modules/@aws-amplify/platform-core/package.json +23 -0
  54. package/node_modules/@aws-amplify/backend-output-storage/package.json +6 -4
  55. package/node_modules/@aws-amplify/graphql-auth-transformer/API.md +5 -1
  56. package/node_modules/@aws-amplify/graphql-auth-transformer/CHANGELOG.md +16 -0
  57. package/node_modules/@aws-amplify/graphql-auth-transformer/LICENSE +201 -0
  58. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/graphql-auth-transformer.d.ts +3 -1
  59. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/graphql-auth-transformer.d.ts.map +1 -1
  60. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/graphql-auth-transformer.js +64 -50
  61. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/graphql-auth-transformer.js.map +1 -1
  62. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/index.d.ts.map +1 -1
  63. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/index.js +3 -0
  64. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/index.js.map +1 -1
  65. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/schema.d.ts.map +1 -1
  66. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/schema.js.map +1 -1
  67. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/validations.d.ts +3 -2
  68. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/validations.d.ts.map +1 -1
  69. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/validations.js +4 -1
  70. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/utils/validations.js.map +1 -1
  71. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/ddb-vtl-generator.d.ts +20 -0
  72. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/ddb-vtl-generator.d.ts.map +1 -0
  73. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/ddb-vtl-generator.js +24 -0
  74. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/ddb-vtl-generator.js.map +1 -0
  75. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{resolvers → vtl-generator/ddb/resolvers}/field.d.ts +1 -1
  76. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/field.d.ts.map +1 -0
  77. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{resolvers → vtl-generator/ddb/resolvers}/field.js +1 -1
  78. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/field.js.map +1 -0
  79. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{resolvers → vtl-generator/ddb/resolvers}/helpers.d.ts +1 -1
  80. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/helpers.d.ts.map +1 -0
  81. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{resolvers → vtl-generator/ddb/resolvers}/helpers.js +1 -1
  82. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/helpers.js.map +1 -0
  83. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/index.d.ts.map +1 -0
  84. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/index.js.map +1 -0
  85. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{resolvers → vtl-generator/ddb/resolvers}/mutation.create.d.ts +1 -1
  86. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/mutation.create.d.ts.map +1 -0
  87. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{resolvers → vtl-generator/ddb/resolvers}/mutation.create.js +1 -1
  88. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/mutation.create.js.map +1 -0
  89. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{resolvers → vtl-generator/ddb/resolvers}/mutation.delete.d.ts +1 -1
  90. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/mutation.delete.d.ts.map +1 -0
  91. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{resolvers → vtl-generator/ddb/resolvers}/mutation.delete.js +1 -1
  92. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/mutation.delete.js.map +1 -0
  93. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{resolvers → vtl-generator/ddb/resolvers}/mutation.update.d.ts +1 -1
  94. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/mutation.update.d.ts.map +1 -0
  95. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{resolvers → vtl-generator/ddb/resolvers}/mutation.update.js +1 -1
  96. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/mutation.update.js.map +1 -0
  97. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/query.d.ts +6 -0
  98. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/query.d.ts.map +1 -0
  99. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{resolvers → vtl-generator/ddb/resolvers}/query.js +28 -3
  100. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/query.js.map +1 -0
  101. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{resolvers → vtl-generator/ddb/resolvers}/search.d.ts +1 -1
  102. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/search.d.ts.map +1 -0
  103. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{resolvers → vtl-generator/ddb/resolvers}/search.js +1 -1
  104. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/search.js.map +1 -0
  105. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/subscriptions.d.ts +3 -0
  106. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/subscriptions.d.ts.map +1 -0
  107. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{resolvers → vtl-generator/ddb/resolvers}/subscriptions.js +1 -1
  108. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/ddb/resolvers/subscriptions.js.map +1 -0
  109. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/rds-vtl-generator.d.ts +20 -0
  110. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/rds-vtl-generator.d.ts.map +1 -0
  111. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/rds-vtl-generator.js +24 -0
  112. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/rds-vtl-generator.js.map +1 -0
  113. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/common.d.ts +13 -0
  114. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/common.d.ts.map +1 -0
  115. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/common.js +157 -0
  116. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/common.js.map +1 -0
  117. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/index.d.ts +5 -0
  118. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/index.d.ts.map +1 -0
  119. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/index.js +21 -0
  120. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/index.js.map +1 -0
  121. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/mutation.d.ts +8 -0
  122. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/mutation.d.ts.map +1 -0
  123. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/mutation.js +56 -0
  124. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/mutation.js.map +1 -0
  125. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/query.d.ts +8 -0
  126. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/query.d.ts.map +1 -0
  127. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/query.js +41 -0
  128. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/query.js.map +1 -0
  129. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{resolvers/subscriptions.d.ts → vtl-generator/rds/resolvers/subscription.d.ts} +2 -2
  130. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/subscription.d.ts.map +1 -0
  131. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/subscription.js +18 -0
  132. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/rds/resolvers/subscription.js.map +1 -0
  133. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/vtl-generator.d.ts +19 -0
  134. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/vtl-generator.d.ts.map +1 -0
  135. package/node_modules/@aws-amplify/{graphql-transformer-core/lib/config/project-config.js → graphql-auth-transformer/lib/vtl-generator/vtl-generator.js} +1 -1
  136. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/vtl-generator/vtl-generator.js.map +1 -0
  137. package/node_modules/@aws-amplify/graphql-auth-transformer/package.json +11 -10
  138. package/node_modules/@aws-amplify/graphql-default-value-transformer/CHANGELOG.md +6 -0
  139. package/node_modules/@aws-amplify/graphql-default-value-transformer/LICENSE +201 -0
  140. package/node_modules/@aws-amplify/graphql-default-value-transformer/lib/graphql-default-value-transformer.d.ts.map +1 -1
  141. package/node_modules/@aws-amplify/graphql-default-value-transformer/lib/graphql-default-value-transformer.js +13 -1
  142. package/node_modules/@aws-amplify/graphql-default-value-transformer/lib/graphql-default-value-transformer.js.map +1 -1
  143. package/node_modules/@aws-amplify/graphql-default-value-transformer/package.json +8 -7
  144. package/node_modules/@aws-amplify/graphql-function-transformer/CHANGELOG.md +4 -0
  145. package/node_modules/@aws-amplify/graphql-function-transformer/LICENSE +201 -0
  146. package/node_modules/@aws-amplify/graphql-function-transformer/package.json +7 -6
  147. package/node_modules/@aws-amplify/graphql-http-transformer/CHANGELOG.md +4 -0
  148. package/node_modules/@aws-amplify/graphql-http-transformer/LICENSE +201 -0
  149. package/node_modules/@aws-amplify/graphql-http-transformer/package.json +7 -6
  150. package/node_modules/@aws-amplify/graphql-index-transformer/API.md +4 -1
  151. package/node_modules/@aws-amplify/graphql-index-transformer/CHANGELOG.md +9 -0
  152. package/node_modules/@aws-amplify/graphql-index-transformer/LICENSE +201 -0
  153. package/node_modules/@aws-amplify/graphql-index-transformer/lib/graphql-index-transformer.js +4 -0
  154. package/node_modules/@aws-amplify/graphql-index-transformer/lib/graphql-index-transformer.js.map +1 -1
  155. package/node_modules/@aws-amplify/graphql-index-transformer/lib/graphql-primary-key-transformer.d.ts +1 -1
  156. package/node_modules/@aws-amplify/graphql-index-transformer/lib/graphql-primary-key-transformer.d.ts.map +1 -1
  157. package/node_modules/@aws-amplify/graphql-index-transformer/lib/graphql-primary-key-transformer.js +7 -7
  158. package/node_modules/@aws-amplify/graphql-index-transformer/lib/graphql-primary-key-transformer.js.map +1 -1
  159. package/node_modules/@aws-amplify/graphql-index-transformer/lib/index.d.ts +1 -1
  160. package/node_modules/@aws-amplify/graphql-index-transformer/lib/index.d.ts.map +1 -1
  161. package/node_modules/@aws-amplify/graphql-index-transformer/lib/index.js +2 -1
  162. package/node_modules/@aws-amplify/graphql-index-transformer/lib/index.js.map +1 -1
  163. package/node_modules/@aws-amplify/graphql-index-transformer/lib/resolvers/generators/rds-vtl-generator.d.ts.map +1 -1
  164. package/node_modules/@aws-amplify/graphql-index-transformer/lib/resolvers/generators/rds-vtl-generator.js +4 -1
  165. package/node_modules/@aws-amplify/graphql-index-transformer/lib/resolvers/generators/rds-vtl-generator.js.map +1 -1
  166. package/node_modules/@aws-amplify/graphql-index-transformer/lib/resolvers/resolvers.d.ts +19 -18
  167. package/node_modules/@aws-amplify/graphql-index-transformer/lib/resolvers/resolvers.d.ts.map +1 -1
  168. package/node_modules/@aws-amplify/graphql-index-transformer/lib/resolvers/resolvers.js +161 -120
  169. package/node_modules/@aws-amplify/graphql-index-transformer/lib/resolvers/resolvers.js.map +1 -1
  170. package/node_modules/@aws-amplify/graphql-index-transformer/package.json +8 -7
  171. package/node_modules/@aws-amplify/graphql-maps-to-transformer/API.md +15 -0
  172. package/node_modules/@aws-amplify/graphql-maps-to-transformer/CHANGELOG.md +12 -0
  173. package/node_modules/@aws-amplify/graphql-maps-to-transformer/LICENSE +201 -0
  174. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/assets/mapping-lambda.zip +0 -0
  175. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/field-mapping-resolvers.d.ts +1 -0
  176. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/field-mapping-resolvers.d.ts.map +1 -1
  177. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/field-mapping-resolvers.js +13 -1
  178. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/field-mapping-resolvers.js.map +1 -1
  179. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-maps-to-transformer.d.ts +2 -1
  180. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-maps-to-transformer.d.ts.map +1 -1
  181. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-maps-to-transformer.js +16 -33
  182. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-maps-to-transformer.js.map +1 -1
  183. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-name-mapping.d.ts +10 -0
  184. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-name-mapping.d.ts.map +1 -0
  185. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-name-mapping.js +102 -0
  186. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-name-mapping.js.map +1 -0
  187. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-refers-to-transformer.d.ts +13 -0
  188. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-refers-to-transformer.d.ts.map +1 -0
  189. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-refers-to-transformer.js +81 -0
  190. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/graphql-refers-to-transformer.js.map +1 -0
  191. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/index.d.ts +1 -0
  192. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/index.d.ts.map +1 -1
  193. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/index.js +3 -1
  194. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/index.js.map +1 -1
  195. package/node_modules/@aws-amplify/graphql-maps-to-transformer/package.json +13 -12
  196. package/node_modules/@aws-amplify/graphql-model-transformer/API.md +15 -15
  197. package/node_modules/@aws-amplify/graphql-model-transformer/CHANGELOG.md +21 -0
  198. package/node_modules/@aws-amplify/graphql-model-transformer/LICENSE +201 -0
  199. package/node_modules/@aws-amplify/graphql-model-transformer/lib/graphql-model-transformer.d.ts +2 -1
  200. package/node_modules/@aws-amplify/graphql-model-transformer/lib/graphql-model-transformer.d.ts.map +1 -1
  201. package/node_modules/@aws-amplify/graphql-model-transformer/lib/graphql-model-transformer.js +72 -52
  202. package/node_modules/@aws-amplify/graphql-model-transformer/lib/graphql-model-transformer.js.map +1 -1
  203. package/node_modules/@aws-amplify/graphql-model-transformer/lib/graphql-types/mutation.d.ts.map +1 -1
  204. package/node_modules/@aws-amplify/graphql-model-transformer/lib/graphql-types/mutation.js +9 -2
  205. package/node_modules/@aws-amplify/graphql-model-transformer/lib/graphql-types/mutation.js.map +1 -1
  206. package/node_modules/@aws-amplify/graphql-model-transformer/lib/rds-lambda.zip +0 -0
  207. package/node_modules/@aws-amplify/graphql-model-transformer/lib/rds-notification-lambda.zip +0 -0
  208. package/node_modules/@aws-amplify/graphql-model-transformer/lib/rds-patching-lambda.zip +0 -0
  209. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/generators/dynamodb-vtl-generator.d.ts +6 -5
  210. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/generators/dynamodb-vtl-generator.d.ts.map +1 -1
  211. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/generators/dynamodb-vtl-generator.js +5 -5
  212. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/generators/dynamodb-vtl-generator.js.map +1 -1
  213. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/generators/rds-vtl-generator.d.ts +6 -5
  214. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/generators/rds-vtl-generator.d.ts.map +1 -1
  215. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/generators/rds-vtl-generator.js +11 -11
  216. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/generators/rds-vtl-generator.js.map +1 -1
  217. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/generators/vtl-generator.d.ts +6 -5
  218. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/generators/vtl-generator.d.ts.map +1 -1
  219. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/mutation.d.ts +4 -3
  220. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/mutation.d.ts.map +1 -1
  221. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/mutation.js +74 -55
  222. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/mutation.js.map +1 -1
  223. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/query.d.ts +2 -1
  224. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/query.d.ts.map +1 -1
  225. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/query.js +8 -2
  226. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/query.js.map +1 -1
  227. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/resolver.d.ts +11 -4
  228. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/resolver.d.ts.map +1 -1
  229. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/resolver.js +141 -45
  230. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/rds/resolver.js.map +1 -1
  231. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamo-model-resource-generator.d.ts +13 -0
  232. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamo-model-resource-generator.d.ts.map +1 -0
  233. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamo-model-resource-generator.js +171 -0
  234. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamo-model-resource-generator.js.map +1 -0
  235. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamodb-table-construct/index.d.ts +41 -0
  236. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamodb-table-construct/index.d.ts.map +1 -0
  237. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamodb-table-construct/index.js +243 -0
  238. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamodb-table-construct/index.js.map +1 -0
  239. 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
  240. 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
  241. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/amplify-table-manager-handler.js +686 -0
  242. 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
  243. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/dynamo-model-resource-generator.d.ts +5 -2
  244. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/dynamo-model-resource-generator.d.ts.map +1 -1
  245. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/dynamo-model-resource-generator.js +47 -60
  246. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/dynamo-model-resource-generator.js.map +1 -1
  247. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/model-resource-generator.js +5 -5
  248. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/model-resource-generator.js.map +1 -1
  249. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/rds-model-resource-generator.d.ts +1 -0
  250. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/rds-model-resource-generator.d.ts.map +1 -1
  251. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/rds-model-resource-generator.js +29 -2
  252. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/rds-model-resource-generator.js.map +1 -1
  253. package/node_modules/@aws-amplify/graphql-model-transformer/package.json +12 -9
  254. package/node_modules/@aws-amplify/graphql-predictions-transformer/CHANGELOG.md +4 -0
  255. package/node_modules/@aws-amplify/graphql-predictions-transformer/LICENSE +201 -0
  256. package/node_modules/@aws-amplify/graphql-predictions-transformer/lib/predictionsLambdaFunction.zip +0 -0
  257. package/node_modules/@aws-amplify/graphql-predictions-transformer/package.json +7 -6
  258. package/node_modules/@aws-amplify/graphql-relational-transformer/CHANGELOG.md +10 -0
  259. package/node_modules/@aws-amplify/graphql-relational-transformer/LICENSE +201 -0
  260. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-belongs-to-transformer.d.ts.map +1 -1
  261. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-belongs-to-transformer.js +41 -9
  262. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-belongs-to-transformer.js.map +1 -1
  263. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-has-many-transformer.d.ts.map +1 -1
  264. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-has-many-transformer.js +35 -8
  265. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-has-many-transformer.js.map +1 -1
  266. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-has-one-transformer.d.ts.map +1 -1
  267. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-has-one-transformer.js +30 -8
  268. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-has-one-transformer.js.map +1 -1
  269. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-many-to-many-transformer.d.ts.map +1 -1
  270. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-many-to-many-transformer.js +3 -2
  271. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-many-to-many-transformer.js.map +1 -1
  272. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/ddb-generator.d.ts +13 -0
  273. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/ddb-generator.d.ts.map +1 -0
  274. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/ddb-generator.js +171 -0
  275. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/ddb-generator.js.map +1 -0
  276. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/generator-factory.d.ts +4 -0
  277. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/generator-factory.d.ts.map +1 -0
  278. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/generator-factory.js +18 -0
  279. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/generator-factory.js.map +1 -0
  280. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/generator.d.ts +8 -0
  281. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/generator.d.ts.map +1 -0
  282. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/generator.js +7 -0
  283. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/generator.js.map +1 -0
  284. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/rds-generator.d.ts +14 -0
  285. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/rds-generator.d.ts.map +1 -0
  286. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/rds-generator.js +115 -0
  287. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolver/rds-generator.js.map +1 -0
  288. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolvers.d.ts +5 -5
  289. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolvers.d.ts.map +1 -1
  290. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolvers.js +26 -179
  291. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolvers.js.map +1 -1
  292. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/schema.d.ts.map +1 -1
  293. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/schema.js +14 -8
  294. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/schema.js.map +1 -1
  295. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/types.d.ts +4 -0
  296. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/types.d.ts.map +1 -1
  297. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/utils.d.ts +5 -0
  298. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/utils.d.ts.map +1 -1
  299. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/utils.js +85 -1
  300. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/utils.js.map +1 -1
  301. package/node_modules/@aws-amplify/graphql-relational-transformer/package.json +10 -9
  302. package/node_modules/@aws-amplify/graphql-searchable-transformer/CHANGELOG.md +6 -0
  303. package/node_modules/@aws-amplify/graphql-searchable-transformer/LICENSE +201 -0
  304. package/node_modules/@aws-amplify/graphql-searchable-transformer/lib/graphql-searchable-transformer.d.ts.map +1 -1
  305. package/node_modules/@aws-amplify/graphql-searchable-transformer/lib/graphql-searchable-transformer.js +3 -0
  306. package/node_modules/@aws-amplify/graphql-searchable-transformer/lib/graphql-searchable-transformer.js.map +1 -1
  307. package/node_modules/@aws-amplify/graphql-searchable-transformer/lib/streaming-lambda.zip +0 -0
  308. package/node_modules/@aws-amplify/graphql-searchable-transformer/package.json +8 -7
  309. package/node_modules/@aws-amplify/graphql-sql-transformer/API.md +26 -0
  310. package/node_modules/@aws-amplify/graphql-sql-transformer/CHANGELOG.md +10 -0
  311. package/node_modules/@aws-amplify/graphql-sql-transformer/LICENSE +201 -0
  312. package/node_modules/@aws-amplify/graphql-sql-transformer/README.md +13 -0
  313. package/node_modules/@aws-amplify/graphql-sql-transformer/lib/graphql-sql-transformer.d.ts +12 -0
  314. package/node_modules/@aws-amplify/graphql-sql-transformer/lib/graphql-sql-transformer.d.ts.map +1 -0
  315. package/node_modules/@aws-amplify/graphql-sql-transformer/lib/graphql-sql-transformer.js +132 -0
  316. package/node_modules/@aws-amplify/graphql-sql-transformer/lib/graphql-sql-transformer.js.map +1 -0
  317. package/node_modules/@aws-amplify/graphql-sql-transformer/lib/index.d.ts +2 -0
  318. package/node_modules/@aws-amplify/graphql-sql-transformer/lib/index.d.ts.map +1 -0
  319. package/node_modules/@aws-amplify/graphql-sql-transformer/lib/index.js +6 -0
  320. package/node_modules/@aws-amplify/graphql-sql-transformer/lib/index.js.map +1 -0
  321. package/node_modules/@aws-amplify/graphql-sql-transformer/package.json +71 -0
  322. package/node_modules/@aws-amplify/graphql-transformer/API.md +6 -2
  323. package/node_modules/@aws-amplify/graphql-transformer/CHANGELOG.md +15 -0
  324. package/node_modules/@aws-amplify/graphql-transformer/LICENSE +201 -0
  325. package/node_modules/@aws-amplify/graphql-transformer/lib/graphql-transformer.d.ts +6 -3
  326. package/node_modules/@aws-amplify/graphql-transformer/lib/graphql-transformer.d.ts.map +1 -1
  327. package/node_modules/@aws-amplify/graphql-transformer/lib/graphql-transformer.js +7 -2
  328. package/node_modules/@aws-amplify/graphql-transformer/lib/graphql-transformer.js.map +1 -1
  329. package/node_modules/@aws-amplify/graphql-transformer/package.json +16 -14
  330. package/node_modules/@aws-amplify/graphql-transformer/src/graphql-transformer.ts +15 -10
  331. package/node_modules/@aws-amplify/graphql-transformer-core/API.md +41 -15
  332. package/node_modules/@aws-amplify/graphql-transformer-core/CHANGELOG.md +19 -0
  333. package/node_modules/@aws-amplify/graphql-transformer-core/LICENSE +201 -0
  334. package/node_modules/@aws-amplify/graphql-transformer-core/lib/config/index.d.ts +0 -1
  335. package/node_modules/@aws-amplify/graphql-transformer-core/lib/config/index.d.ts.map +1 -1
  336. package/node_modules/@aws-amplify/graphql-transformer-core/lib/config/index.js.map +1 -1
  337. package/node_modules/@aws-amplify/graphql-transformer-core/lib/index.d.ts +4 -4
  338. package/node_modules/@aws-amplify/graphql-transformer-core/lib/index.d.ts.map +1 -1
  339. package/node_modules/@aws-amplify/graphql-transformer-core/lib/index.js +11 -1
  340. package/node_modules/@aws-amplify/graphql-transformer-core/lib/index.js.map +1 -1
  341. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transform-host.d.ts.map +1 -1
  342. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transform-host.js +2 -1
  343. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transform-host.js.map +1 -1
  344. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/index.d.ts +1 -0
  345. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/index.d.ts.map +1 -1
  346. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/index.js +3 -1
  347. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/index.js.map +1 -1
  348. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/sync-utils.d.ts.map +1 -1
  349. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/sync-utils.js.map +1 -1
  350. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/transform.d.ts +4 -3
  351. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/transform.d.ts.map +1 -1
  352. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/transform.js +3 -3
  353. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/transform.js.map +1 -1
  354. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/types.d.ts +3 -3
  355. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/types.d.ts.map +1 -1
  356. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/utils.d.ts +2 -1
  357. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/utils.d.ts.map +1 -1
  358. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/utils.js +12 -1
  359. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/utils.js.map +1 -1
  360. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/datasource.d.ts +4 -5
  361. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/datasource.d.ts.map +1 -1
  362. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/datasource.js.map +1 -1
  363. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/index.d.ts +6 -5
  364. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/index.d.ts.map +1 -1
  365. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/index.js +3 -1
  366. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/index.js.map +1 -1
  367. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/transform-parameters.d.ts.map +1 -1
  368. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/transform-parameters.js +1 -0
  369. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/transform-parameters.js.map +1 -1
  370. package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/import-appsync-api-types.d.ts +5 -4
  371. package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/import-appsync-api-types.d.ts.map +1 -1
  372. package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/import-appsync-api-types.js +3 -2
  373. package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/import-appsync-api-types.js.map +1 -1
  374. package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/index.d.ts +1 -1
  375. package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/index.d.ts.map +1 -1
  376. package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/index.js +2 -1
  377. package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/index.js.map +1 -1
  378. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/api-category.d.ts +2 -0
  379. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/api-category.d.ts.map +1 -0
  380. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/api-category.js +5 -0
  381. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/api-category.js.map +1 -0
  382. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/index.d.ts +4 -2
  383. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/index.d.ts.map +1 -1
  384. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/index.js +16 -3
  385. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/index.js.map +1 -1
  386. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/model-util.d.ts +3 -0
  387. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/model-util.d.ts.map +1 -0
  388. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/model-util.js +19 -0
  389. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/model-util.js.map +1 -0
  390. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/provision-strategy-utils.d.ts +3 -0
  391. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/provision-strategy-utils.d.ts.map +1 -0
  392. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/provision-strategy-utils.js +15 -0
  393. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/provision-strategy-utils.js.map +1 -0
  394. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/rds-util.d.ts +12 -0
  395. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/rds-util.d.ts.map +1 -0
  396. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/rds-util.js +82 -0
  397. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/rds-util.js.map +1 -0
  398. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/schema-utils.d.ts +3 -2
  399. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/schema-utils.d.ts.map +1 -1
  400. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/schema-utils.js +7 -1
  401. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/schema-utils.js.map +1 -1
  402. package/node_modules/@aws-amplify/graphql-transformer-core/lib/wrappers/object-definition-wrapper.d.ts +1 -1
  403. package/node_modules/@aws-amplify/graphql-transformer-core/lib/wrappers/object-definition-wrapper.d.ts.map +1 -1
  404. package/node_modules/@aws-amplify/graphql-transformer-core/package.json +5 -4
  405. package/node_modules/@aws-amplify/graphql-transformer-interfaces/API.md +69 -15
  406. package/node_modules/@aws-amplify/graphql-transformer-interfaces/CHANGELOG.md +11 -0
  407. package/node_modules/@aws-amplify/graphql-transformer-interfaces/LICENSE +201 -0
  408. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/graphql-api-provider.d.ts +15 -8
  409. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/graphql-api-provider.d.ts.map +1 -1
  410. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/graphql-api-provider.js.map +1 -1
  411. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/index.d.ts +1 -1
  412. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/index.d.ts.map +1 -1
  413. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/index.js.map +1 -1
  414. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/index.d.ts +1 -1
  415. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/index.d.ts.map +1 -1
  416. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/index.js +3 -1
  417. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/index.js.map +1 -1
  418. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/transform-parameters.d.ts +1 -0
  419. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/transform-parameters.d.ts.map +1 -1
  420. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/transformer-context-provider.d.ts +5 -3
  421. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/transformer-context-provider.d.ts.map +1 -1
  422. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/transformer-datasource-provider.d.ts +15 -5
  423. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/transformer-datasource-provider.d.ts.map +1 -1
  424. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/transformer-datasource-provider.js +10 -1
  425. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/transformer-datasource-provider.js.map +1 -1
  426. package/node_modules/@aws-amplify/graphql-transformer-interfaces/package.json +3 -2
  427. package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/graphql-api-provider.ts +38 -11
  428. package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/index.ts +3 -0
  429. package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/transformer-context/index.ts +6 -0
  430. package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/transformer-context/transform-parameters.ts +1 -0
  431. package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/transformer-context/transformer-context-provider.ts +11 -3
  432. package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/transformer-context/transformer-datasource-provider.ts +41 -5
  433. package/node_modules/@aws-amplify/graphql-transformer-interfaces/tsconfig.tsbuildinfo +1 -1
  434. package/node_modules/@aws-amplify/platform-core/lib/backend_deployment_type.d.ts +5 -0
  435. package/node_modules/@aws-amplify/platform-core/lib/backend_deployment_type.js +9 -0
  436. package/node_modules/@aws-amplify/platform-core/lib/cdk_context_key.d.ts +9 -0
  437. package/node_modules/@aws-amplify/platform-core/lib/cdk_context_key.js +13 -0
  438. package/node_modules/@aws-amplify/platform-core/lib/index.d.ts +4 -0
  439. package/node_modules/@aws-amplify/platform-core/lib/index.js +22 -0
  440. package/node_modules/@aws-amplify/platform-core/lib/unique_backend_identifier.d.ts +53 -0
  441. package/node_modules/@aws-amplify/platform-core/lib/unique_backend_identifier.js +74 -0
  442. package/node_modules/@aws-amplify/platform-core/package.json +24 -0
  443. package/node_modules/@aws-amplify/plugin-types/lib/amplify_function.d.ts +4 -0
  444. package/node_modules/@aws-amplify/plugin-types/lib/amplify_function.js +3 -0
  445. package/node_modules/@aws-amplify/plugin-types/lib/amplify_output_writer.d.ts +9 -0
  446. package/node_modules/@aws-amplify/plugin-types/lib/amplify_output_writer.js +3 -0
  447. package/node_modules/@aws-amplify/plugin-types/lib/auth_resources.d.ts +42 -0
  448. package/node_modules/@aws-amplify/plugin-types/lib/auth_resources.js +3 -0
  449. package/node_modules/@aws-amplify/plugin-types/lib/backend_output.d.ts +6 -0
  450. package/node_modules/@aws-amplify/plugin-types/lib/backend_output.js +3 -0
  451. package/node_modules/@aws-amplify/plugin-types/lib/backend_secret_resolver.d.ts +13 -0
  452. package/node_modules/@aws-amplify/plugin-types/lib/backend_secret_resolver.js +3 -0
  453. package/node_modules/@aws-amplify/plugin-types/lib/backend_stack_creator.d.ts +8 -0
  454. package/node_modules/@aws-amplify/plugin-types/lib/backend_stack_creator.js +3 -0
  455. package/node_modules/@aws-amplify/plugin-types/lib/backend_stack_resolver.d.ts +7 -0
  456. package/node_modules/@aws-amplify/plugin-types/lib/backend_stack_resolver.js +3 -0
  457. package/node_modules/@aws-amplify/plugin-types/lib/construct_container.d.ts +26 -0
  458. package/node_modules/@aws-amplify/plugin-types/lib/construct_container.js +3 -0
  459. package/node_modules/@aws-amplify/plugin-types/lib/construct_factory.d.ts +21 -0
  460. package/node_modules/@aws-amplify/plugin-types/lib/construct_factory.js +3 -0
  461. package/node_modules/@aws-amplify/plugin-types/lib/function_resources.d.ts +5 -0
  462. package/node_modules/@aws-amplify/plugin-types/lib/function_resources.js +3 -0
  463. package/node_modules/@aws-amplify/plugin-types/lib/import_path_verifier.d.ts +14 -0
  464. package/node_modules/@aws-amplify/plugin-types/lib/import_path_verifier.js +3 -0
  465. package/node_modules/@aws-amplify/plugin-types/lib/index.d.ts +16 -0
  466. package/node_modules/@aws-amplify/plugin-types/lib/index.js +32 -0
  467. package/node_modules/@aws-amplify/plugin-types/lib/output_retrieval_strategy.d.ts +11 -0
  468. package/node_modules/@aws-amplify/plugin-types/lib/output_retrieval_strategy.js +3 -0
  469. package/node_modules/@aws-amplify/plugin-types/lib/output_storage_strategy.d.ts +8 -0
  470. package/node_modules/@aws-amplify/plugin-types/lib/output_storage_strategy.js +3 -0
  471. package/node_modules/@aws-amplify/plugin-types/lib/resource_provider.d.ts +7 -0
  472. package/node_modules/@aws-amplify/plugin-types/lib/resource_provider.js +3 -0
  473. package/node_modules/@aws-amplify/plugin-types/lib/unique_backend_identifier.d.ts +25 -0
  474. package/node_modules/@aws-amplify/plugin-types/lib/unique_backend_identifier.js +3 -0
  475. package/node_modules/@aws-amplify/plugin-types/package.json +20 -0
  476. package/node_modules/graphql-transformer-common/API.md +25 -0
  477. package/node_modules/graphql-transformer-common/CHANGELOG.md +13 -0
  478. package/node_modules/graphql-transformer-common/LICENSE +201 -0
  479. package/node_modules/graphql-transformer-common/lib/ResourceConstants.d.ts +4 -0
  480. package/node_modules/graphql-transformer-common/lib/ResourceConstants.d.ts.map +1 -1
  481. package/node_modules/graphql-transformer-common/lib/ResourceConstants.js +4 -0
  482. package/node_modules/graphql-transformer-common/lib/ResourceConstants.js.map +1 -1
  483. package/node_modules/graphql-transformer-common/lib/definition.d.ts +9 -2
  484. package/node_modules/graphql-transformer-common/lib/definition.d.ts.map +1 -1
  485. package/node_modules/graphql-transformer-common/lib/definition.js +52 -1
  486. package/node_modules/graphql-transformer-common/lib/definition.js.map +1 -1
  487. package/node_modules/graphql-transformer-common/lib/util.d.ts.map +1 -1
  488. package/node_modules/graphql-transformer-common/lib/util.js +3 -1
  489. package/node_modules/graphql-transformer-common/lib/util.js.map +1 -1
  490. package/node_modules/graphql-transformer-common/package.json +6 -5
  491. package/package.json +39 -37
  492. package/src/amplify-dynamodb-table-wrapper.ts +177 -0
  493. package/src/amplify-graphql-api.ts +91 -7
  494. package/src/amplify-graphql-definition.ts +78 -5
  495. package/src/index.ts +22 -0
  496. package/src/internal/construct-exports.ts +7 -0
  497. package/src/internal/data-source-config.ts +57 -0
  498. package/src/internal/default-parameters.ts +1 -0
  499. package/src/internal/index.ts +1 -1
  500. package/src/internal/model-type-name.ts +39 -0
  501. package/src/sql-model-datasource-strategy.ts +62 -0
  502. package/src/types.ts +199 -7
  503. package/babel.config.js +0 -13
  504. package/lib/internal/amplify-metadata.d.ts +0 -6
  505. package/lib/internal/amplify-metadata.js +0 -58
  506. package/node_modules/@aws-amplify/backend-output-schemas/lib/index.internal.d.ts +0 -3
  507. package/node_modules/@aws-amplify/backend-output-schemas/lib/index.internal.js +0 -27
  508. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/field.d.ts.map +0 -1
  509. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/field.js.map +0 -1
  510. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/helpers.d.ts.map +0 -1
  511. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/helpers.js.map +0 -1
  512. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/index.d.ts.map +0 -1
  513. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/index.js.map +0 -1
  514. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/mutation.create.d.ts.map +0 -1
  515. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/mutation.create.js.map +0 -1
  516. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/mutation.delete.d.ts.map +0 -1
  517. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/mutation.delete.js.map +0 -1
  518. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/mutation.update.d.ts.map +0 -1
  519. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/mutation.update.js.map +0 -1
  520. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/query.d.ts +0 -6
  521. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/query.d.ts.map +0 -1
  522. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/query.js.map +0 -1
  523. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/search.d.ts.map +0 -1
  524. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/search.js.map +0 -1
  525. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/subscriptions.d.ts.map +0 -1
  526. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/resolvers/subscriptions.js.map +0 -1
  527. package/node_modules/@aws-amplify/graphql-transformer-core/lib/config/project-config.d.ts +0 -6
  528. package/node_modules/@aws-amplify/graphql-transformer-core/lib/config/project-config.d.ts.map +0 -1
  529. package/node_modules/@aws-amplify/graphql-transformer-core/lib/config/project-config.js.map +0 -1
  530. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/rds-secret-utils.d.ts +0 -2
  531. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/rds-secret-utils.d.ts.map +0 -1
  532. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/rds-secret-utils.js +0 -25
  533. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/rds-secret-utils.js.map +0 -1
  534. package/remove-module-type-from-package-json.ts +0 -19
  535. package/src/internal/amplify-metadata.ts +0 -58
  536. /package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{resolvers → vtl-generator/ddb/resolvers}/index.d.ts +0 -0
  537. /package/node_modules/@aws-amplify/graphql-auth-transformer/lib/{resolvers → vtl-generator/ddb/resolvers}/index.js +0 -0
@@ -0,0 +1,686 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toCreateTableInput = exports.extractTableInputFromEvent = exports.getPointInTimeRecoveryUpdate = exports.getTtlUpdate = exports.getDeletionProtectionUpdate = exports.getSseUpdate = exports.getStreamUpdate = exports.getNextGSIUpdate = exports.isComplete = exports.onEvent = void 0;
4
+ const client_dynamodb_1 = require("@aws-sdk/client-dynamodb");
5
+ const ddbClient = new client_dynamodb_1.DynamoDB();
6
+ const finished = {
7
+ IsComplete: true,
8
+ };
9
+ const notFinished = {
10
+ IsComplete: false,
11
+ };
12
+ const log = (msg, ...other) => {
13
+ console.log(msg, other.map((o) => (typeof o === 'object' ? JSON.stringify(o, undefined, 2) : o)));
14
+ };
15
+ const onEvent = async (event) => {
16
+ var _a;
17
+ console.log({ ...event, ResponseURL: '[redacted]' });
18
+ const tableDef = (0, exports.extractTableInputFromEvent)(event);
19
+ console.log('Input table state: ', tableDef);
20
+ let result;
21
+ switch (event.RequestType) {
22
+ case 'Create':
23
+ console.log('Initiating CREATE event');
24
+ const createTableInput = (0, exports.toCreateTableInput)(tableDef);
25
+ console.log('Create Table Params: ', createTableInput);
26
+ const response = await createNewTable(createTableInput);
27
+ result = {
28
+ PhysicalResourceId: response.tableName,
29
+ Data: {
30
+ TableArn: response.tableArn,
31
+ TableStreamArn: response.streamArn,
32
+ TableName: response.tableName,
33
+ },
34
+ };
35
+ console.log('Returning result: ', result);
36
+ return result;
37
+ case 'Update':
38
+ if (!event.PhysicalResourceId) {
39
+ throw new Error(`Could not find the physical ID for the updated resource`);
40
+ }
41
+ console.log('Fetching current table state');
42
+ const describeTableResult = await ddbClient.describeTable({ TableName: event.PhysicalResourceId });
43
+ if (!describeTableResult.Table) {
44
+ throw new Error(`Could not find ${event.PhysicalResourceId} to update`);
45
+ }
46
+ log('Current table state: ', describeTableResult);
47
+ if (isKeySchemaModified(describeTableResult.Table.KeySchema, tableDef.keySchema)) {
48
+ console.log('Update requires replacement');
49
+ if (tableDef.allowDestructiveGraphqlSchemaUpdates) {
50
+ if (describeTableResult.Table.DeletionProtectionEnabled === true) {
51
+ throw new Error('Table cannot be replaced when the deletion protection is enabled.');
52
+ }
53
+ console.log('Deleting the old table');
54
+ await ddbClient.deleteTable({ TableName: event.PhysicalResourceId });
55
+ await retry(async () => await doesTableExist(event.PhysicalResourceId), (res) => res === false);
56
+ console.log(`Table '${event.PhysicalResourceId}' does not exist. Deletion is finished.`);
57
+ const createTableInput = (0, exports.toCreateTableInput)(tableDef);
58
+ const response = await createNewTable(createTableInput);
59
+ result = {
60
+ PhysicalResourceId: response.tableName,
61
+ Data: {
62
+ TableArn: response.tableArn,
63
+ TableStreamArn: response.streamArn,
64
+ TableName: response.tableName,
65
+ IsTableReplaced: true,
66
+ },
67
+ };
68
+ log('Returning result', result);
69
+ return result;
70
+ }
71
+ else {
72
+ throw new Error("Editing key schema of table requires replacement which will cause ALL EXISITING DATA TO BE LOST. If this is intended, set the 'allowDestructiveGraphqlSchemaUpdates' to true and deploy again.");
73
+ }
74
+ }
75
+ const describePointInTimeRecoveryResult = await ddbClient.describeContinuousBackups({ TableName: event.PhysicalResourceId });
76
+ console.log('Current point in time recovery: ', describePointInTimeRecoveryResult);
77
+ const pointInTimeUpdate = (0, exports.getPointInTimeRecoveryUpdate)(describePointInTimeRecoveryResult.ContinuousBackupsDescription, tableDef);
78
+ if (pointInTimeUpdate) {
79
+ log('Computed point in time recovery update', pointInTimeUpdate);
80
+ await ddbClient.updateContinuousBackups(pointInTimeUpdate);
81
+ await retry(async () => await isTableReady(event.PhysicalResourceId), (res) => res === true);
82
+ console.log(`Table '${event.PhysicalResourceId}' is ready after the update of PointInTimeRecovery.`);
83
+ }
84
+ const deletionProtectionUpdate = (0, exports.getDeletionProtectionUpdate)(describeTableResult.Table, tableDef);
85
+ if (deletionProtectionUpdate) {
86
+ log('Computed deletion protection update', deletionProtectionUpdate);
87
+ await ddbClient.updateTable(deletionProtectionUpdate);
88
+ await retry(async () => await isTableReady(event.PhysicalResourceId), (res) => res === true);
89
+ console.log(`Table '${event.PhysicalResourceId}' is ready after the update of deletion protection.`);
90
+ }
91
+ const sseUpdate = (0, exports.getSseUpdate)(describeTableResult.Table, tableDef);
92
+ if (sseUpdate) {
93
+ log('Computed server side encryption update', sseUpdate);
94
+ await ddbClient.updateTable(sseUpdate);
95
+ await retry(async () => await isTableReady(event.PhysicalResourceId), (res) => res === true);
96
+ console.log(`Table '${event.PhysicalResourceId}' is ready after the update of sever side encryption.`);
97
+ }
98
+ const streamUpdate = await (0, exports.getStreamUpdate)(describeTableResult.Table, tableDef);
99
+ if (streamUpdate) {
100
+ log('Computed stream specification update', streamUpdate);
101
+ await ddbClient.updateTable(streamUpdate);
102
+ await retry(async () => await isTableReady(event.PhysicalResourceId), (res) => res === true);
103
+ console.log(`Table '${event.PhysicalResourceId}' is ready after the update of stream specificaion.`);
104
+ }
105
+ const describeTimeToLiveResult = await ddbClient.describeTimeToLive({ TableName: event.PhysicalResourceId });
106
+ console.log('Current TTL: ', describeTimeToLiveResult);
107
+ const ttlUpdate = (0, exports.getTtlUpdate)(describeTimeToLiveResult.TimeToLiveDescription, tableDef);
108
+ if (ttlUpdate) {
109
+ log('Computed time to live update', ttlUpdate);
110
+ console.log('Initiating TTL update');
111
+ await ddbClient.updateTimeToLive(ttlUpdate);
112
+ result = {
113
+ PhysicalResourceId: event.PhysicalResourceId,
114
+ Data: {
115
+ TableArn: describeTableResult.Table.TableArn,
116
+ TableStreamArn: describeTableResult.Table.LatestStreamArn,
117
+ TableName: describeTableResult.Table.TableName,
118
+ },
119
+ };
120
+ return result;
121
+ }
122
+ const nextGsiUpdate = (0, exports.getNextGSIUpdate)(describeTableResult.Table, tableDef);
123
+ if (nextGsiUpdate) {
124
+ log('Computed next update', nextGsiUpdate);
125
+ console.log('Initiating table GSI update');
126
+ await ddbClient.updateTable(nextGsiUpdate);
127
+ }
128
+ result = {
129
+ PhysicalResourceId: event.PhysicalResourceId,
130
+ Data: {
131
+ TableArn: describeTableResult.Table.TableArn,
132
+ TableStreamArn: describeTableResult.Table.LatestStreamArn,
133
+ TableName: describeTableResult.Table.TableName,
134
+ },
135
+ };
136
+ return result;
137
+ case 'Delete':
138
+ if (!event.PhysicalResourceId) {
139
+ throw new Error(`Could not find the physical ID for the resource`);
140
+ }
141
+ result = {
142
+ PhysicalResourceId: event.PhysicalResourceId,
143
+ };
144
+ try {
145
+ console.log('Fetching current table state');
146
+ const describeTableResultBeforeDeletion = await ddbClient.describeTable({ TableName: event.PhysicalResourceId });
147
+ if ((_a = describeTableResultBeforeDeletion.Table) === null || _a === void 0 ? void 0 : _a.DeletionProtectionEnabled) {
148
+ return result;
149
+ }
150
+ console.log('Initiating table deletion');
151
+ await ddbClient.deleteTable({ TableName: event.PhysicalResourceId });
152
+ return result;
153
+ }
154
+ catch (err) {
155
+ if (err instanceof client_dynamodb_1.ResourceNotFoundException) {
156
+ console.log('Table to be deleted is not found. Deletion complete.');
157
+ return result;
158
+ }
159
+ throw err;
160
+ }
161
+ default:
162
+ throw new Error(`Event type ${event.RequestType} is not supported`);
163
+ }
164
+ };
165
+ exports.onEvent = onEvent;
166
+ const isComplete = async (event) => {
167
+ var _a, _b, _c;
168
+ log('got event', { ...event, ResponseURL: '[redacted]' });
169
+ if (event.RequestType === 'Delete') {
170
+ console.log('Delete is finished');
171
+ return finished;
172
+ }
173
+ if (!event.PhysicalResourceId) {
174
+ throw new Error('PhysicalResourceId not set in call to isComplete');
175
+ }
176
+ console.log('Fetching current table state');
177
+ const describeTableResult = await retry(async () => await ddbClient.describeTable({ TableName: event.PhysicalResourceId }), (result) => !!(result === null || result === void 0 ? void 0 : result.Table));
178
+ if (((_a = describeTableResult.Table) === null || _a === void 0 ? void 0 : _a.TableStatus) !== 'ACTIVE') {
179
+ console.log('Table not active yet');
180
+ return notFinished;
181
+ }
182
+ if ((_b = describeTableResult.Table.GlobalSecondaryIndexes) === null || _b === void 0 ? void 0 : _b.some((gsi) => gsi.IndexStatus !== 'ACTIVE' || gsi.Backfilling)) {
183
+ console.log('Some GSI is not active yet');
184
+ return notFinished;
185
+ }
186
+ const endState = (0, exports.extractTableInputFromEvent)(event);
187
+ if (event.RequestType === 'Create' || ((_c = event.Data) === null || _c === void 0 ? void 0 : _c.IsTableReplaced) === true) {
188
+ const describePointInTimeRecoveryResult = await ddbClient.describeContinuousBackups({ TableName: event.PhysicalResourceId });
189
+ const pointInTimeUpdate = (0, exports.getPointInTimeRecoveryUpdate)(describePointInTimeRecoveryResult.ContinuousBackupsDescription, endState);
190
+ if (pointInTimeUpdate) {
191
+ console.log('Updating table with point in time recovery enabled');
192
+ await ddbClient.updateContinuousBackups(pointInTimeUpdate);
193
+ return notFinished;
194
+ }
195
+ const describeTimeToLiveResult = await ddbClient.describeTimeToLive({ TableName: event.PhysicalResourceId });
196
+ const ttlUpdate = (0, exports.getTtlUpdate)(describeTimeToLiveResult.TimeToLiveDescription, endState);
197
+ if (ttlUpdate) {
198
+ console.log('Updating table with TTL enabled');
199
+ await ddbClient.updateTimeToLive(ttlUpdate);
200
+ return notFinished;
201
+ }
202
+ console.log('Create is finished');
203
+ return finished;
204
+ }
205
+ const nextUpdate = (0, exports.getNextGSIUpdate)(describeTableResult.Table, endState);
206
+ log('Computed next update', nextUpdate);
207
+ if (!nextUpdate) {
208
+ console.log('No additional updates needed. Update finished');
209
+ return finished;
210
+ }
211
+ console.log('Initiating table update');
212
+ await ddbClient.updateTable(nextUpdate);
213
+ return notFinished;
214
+ };
215
+ exports.isComplete = isComplete;
216
+ const getNextGSIUpdate = (currentState, endState) => {
217
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
218
+ const endStateGSIs = endState.globalSecondaryIndexes || [];
219
+ const endStateGSINames = endStateGSIs.map((gsi) => gsi.indexName);
220
+ const currentStateGSIs = currentState.GlobalSecondaryIndexes || [];
221
+ const currentStateGSINames = currentStateGSIs.map((gsi) => gsi.IndexName);
222
+ const isTableBillingModeModified = (((_a = currentState.BillingModeSummary) === null || _a === void 0 ? void 0 : _a.BillingMode) !== undefined && ((_b = currentState.BillingModeSummary) === null || _b === void 0 ? void 0 : _b.BillingMode) !== endState.billingMode) ||
223
+ (((_c = currentState.BillingModeSummary) === null || _c === void 0 ? void 0 : _c.BillingMode) == undefined && endState.billingMode === 'PAY_PER_REQUEST');
224
+ const isTableProvisionThroughputModified = (((_d = endState.provisionedThroughput) === null || _d === void 0 ? void 0 : _d.readCapacityUnits) !== undefined &&
225
+ ((_e = currentState.ProvisionedThroughput) === null || _e === void 0 ? void 0 : _e.ReadCapacityUnits) !== ((_f = endState.provisionedThroughput) === null || _f === void 0 ? void 0 : _f.readCapacityUnits)) ||
226
+ (((_g = endState.provisionedThroughput) === null || _g === void 0 ? void 0 : _g.writeCapacityUnits) !== undefined &&
227
+ ((_h = currentState.ProvisionedThroughput) === null || _h === void 0 ? void 0 : _h.WriteCapacityUnits) !== ((_j = endState.provisionedThroughput) === null || _j === void 0 ? void 0 : _j.writeCapacityUnits));
228
+ if (isTableBillingModeModified || isTableProvisionThroughputModified) {
229
+ let updateInput = {
230
+ TableName: currentState.TableName,
231
+ BillingMode: isTableBillingModeModified ? endState.billingMode : undefined,
232
+ ProvisionedThroughput: isTableProvisionThroughputModified && endState.billingMode === 'PROVISIONED'
233
+ ? {
234
+ ReadCapacityUnits: (_k = endState.provisionedThroughput) === null || _k === void 0 ? void 0 : _k.readCapacityUnits,
235
+ WriteCapacityUnits: (_l = endState.provisionedThroughput) === null || _l === void 0 ? void 0 : _l.writeCapacityUnits,
236
+ }
237
+ : undefined,
238
+ };
239
+ if (isTableBillingModeModified && endState.billingMode === 'PROVISIONED') {
240
+ const indexToBeUpdated = currentStateGSIs.map((gsiToUpdate) => {
241
+ var _a, _b;
242
+ return {
243
+ Update: {
244
+ IndexName: gsiToUpdate.IndexName,
245
+ ProvisionedThroughput: {
246
+ ReadCapacityUnits: (_a = endState.provisionedThroughput) === null || _a === void 0 ? void 0 : _a.readCapacityUnits,
247
+ WriteCapacityUnits: (_b = endState.provisionedThroughput) === null || _b === void 0 ? void 0 : _b.writeCapacityUnits,
248
+ },
249
+ },
250
+ };
251
+ });
252
+ updateInput = {
253
+ ...updateInput,
254
+ GlobalSecondaryIndexUpdates: indexToBeUpdated.length > 0 ? indexToBeUpdated : undefined,
255
+ };
256
+ }
257
+ return parsePropertiesToDynamoDBInput(updateInput);
258
+ }
259
+ const gsiRequiresReplacementPredicate = (currentGSI) => {
260
+ if (!endStateGSINames.includes(currentGSI.IndexName))
261
+ return true;
262
+ const respectiveEndStateGSI = endStateGSIs.find((endStateGSI) => endStateGSI.indexName === currentGSI.IndexName);
263
+ if (isProjectionModified(currentGSI.Projection, respectiveEndStateGSI.projection))
264
+ return true;
265
+ if (isKeySchemaModified(currentGSI.KeySchema, respectiveEndStateGSI.keySchema))
266
+ return true;
267
+ return false;
268
+ };
269
+ const gsiToRemove = currentStateGSIs.find(gsiRequiresReplacementPredicate);
270
+ if (gsiToRemove) {
271
+ return {
272
+ TableName: currentState.TableName,
273
+ GlobalSecondaryIndexUpdates: [
274
+ {
275
+ Delete: {
276
+ IndexName: gsiToRemove.IndexName,
277
+ },
278
+ },
279
+ ],
280
+ };
281
+ }
282
+ const gsiRequiresCreationPredicate = (endStateGSI) => !currentStateGSINames.includes(endStateGSI.indexName);
283
+ const gsiToAdd = endStateGSIs.find(gsiRequiresCreationPredicate);
284
+ if (gsiToAdd) {
285
+ let gsiProvisionThroughput = gsiToAdd.provisionedThroughput;
286
+ if (endState.billingMode === 'PROVISIONED' && gsiToAdd.provisionedThroughput === undefined) {
287
+ gsiProvisionThroughput = {
288
+ readCapacityUnits: (_m = endState.provisionedThroughput) === null || _m === void 0 ? void 0 : _m.readCapacityUnits,
289
+ writeCapacityUnits: (_o = endState.provisionedThroughput) === null || _o === void 0 ? void 0 : _o.writeCapacityUnits,
290
+ };
291
+ }
292
+ const attributeNamesToInclude = gsiToAdd.keySchema.map((schema) => schema.attributeName);
293
+ const gsiToAddAction = {
294
+ IndexName: gsiToAdd.indexName,
295
+ KeySchema: gsiToAdd.keySchema,
296
+ Projection: gsiToAdd.projection,
297
+ ProvisionedThroughput: gsiProvisionThroughput,
298
+ };
299
+ return {
300
+ TableName: currentState.TableName,
301
+ AttributeDefinitions: (_p = endState.attributeDefinitions) === null || _p === void 0 ? void 0 : _p.filter((def) => attributeNamesToInclude.includes(def.attributeName)).map((def) => usePascalCaseForObjectKeys(def)),
302
+ GlobalSecondaryIndexUpdates: [
303
+ {
304
+ Create: parsePropertiesToDynamoDBInput(gsiToAddAction),
305
+ },
306
+ ],
307
+ };
308
+ }
309
+ const gsiRequiresUpdatePredicate = (endStateGSI) => {
310
+ var _a, _b, _c, _d;
311
+ if (endState.provisionedThroughput &&
312
+ endState.provisionedThroughput.readCapacityUnits &&
313
+ endState.provisionedThroughput.writeCapacityUnits &&
314
+ currentStateGSINames.includes(endStateGSI.indexName)) {
315
+ const currentStateGSI = currentStateGSIs.find((gsi) => gsi.IndexName === endStateGSI.indexName);
316
+ if (currentStateGSI) {
317
+ if (((_a = currentStateGSI.ProvisionedThroughput) === null || _a === void 0 ? void 0 : _a.ReadCapacityUnits) !== ((_b = endStateGSI.provisionedThroughput) === null || _b === void 0 ? void 0 : _b.readCapacityUnits) ||
318
+ ((_c = currentStateGSI.ProvisionedThroughput) === null || _c === void 0 ? void 0 : _c.WriteCapacityUnits) !== ((_d = endStateGSI.provisionedThroughput) === null || _d === void 0 ? void 0 : _d.writeCapacityUnits)) {
319
+ return true;
320
+ }
321
+ }
322
+ }
323
+ return false;
324
+ };
325
+ const gsiToUpdate = endStateGSIs.find(gsiRequiresUpdatePredicate);
326
+ if (gsiToUpdate) {
327
+ return {
328
+ TableName: currentState.TableName,
329
+ GlobalSecondaryIndexUpdates: [
330
+ {
331
+ Update: {
332
+ IndexName: gsiToUpdate.indexName,
333
+ ProvisionedThroughput: {
334
+ ReadCapacityUnits: (_q = gsiToUpdate.provisionedThroughput) === null || _q === void 0 ? void 0 : _q.readCapacityUnits,
335
+ WriteCapacityUnits: (_r = gsiToUpdate.provisionedThroughput) === null || _r === void 0 ? void 0 : _r.writeCapacityUnits,
336
+ },
337
+ },
338
+ },
339
+ ],
340
+ };
341
+ }
342
+ return undefined;
343
+ };
344
+ exports.getNextGSIUpdate = getNextGSIUpdate;
345
+ const getStreamUpdate = async (currentState, endState) => {
346
+ var _a, _b, _c, _d, _e, _f;
347
+ let streamUpdate;
348
+ if (((_a = endState.streamSpecification) === null || _a === void 0 ? void 0 : _a.streamViewType) !== undefined &&
349
+ (currentState.StreamSpecification === undefined || currentState.StreamSpecification.StreamEnabled === false)) {
350
+ streamUpdate = { StreamEnabled: true, StreamViewType: endState.streamSpecification.streamViewType };
351
+ }
352
+ else if (((_b = endState.streamSpecification) === null || _b === void 0 ? void 0 : _b.streamViewType) === undefined && ((_c = currentState.StreamSpecification) === null || _c === void 0 ? void 0 : _c.StreamEnabled) === true) {
353
+ streamUpdate = { StreamEnabled: false };
354
+ }
355
+ else if (((_d = currentState.StreamSpecification) === null || _d === void 0 ? void 0 : _d.StreamEnabled) === true &&
356
+ ((_e = endState.streamSpecification) === null || _e === void 0 ? void 0 : _e.streamViewType) !== undefined &&
357
+ currentState.StreamSpecification.StreamViewType !== ((_f = endState.streamSpecification) === null || _f === void 0 ? void 0 : _f.streamViewType)) {
358
+ console.log('Detect stream view type is changed. Disabling stream before the type change.');
359
+ await ddbClient.updateTable({
360
+ TableName: currentState.TableName,
361
+ StreamSpecification: { StreamEnabled: false },
362
+ });
363
+ await retry(async () => await isTableReady(currentState.TableName), (res) => res === true);
364
+ streamUpdate = { StreamEnabled: true, StreamViewType: endState.streamSpecification.streamViewType };
365
+ }
366
+ if (streamUpdate) {
367
+ return {
368
+ TableName: currentState.TableName,
369
+ StreamSpecification: streamUpdate,
370
+ };
371
+ }
372
+ return undefined;
373
+ };
374
+ exports.getStreamUpdate = getStreamUpdate;
375
+ const getSseUpdate = (currentState, endState) => {
376
+ var _a, _b, _c;
377
+ let sseUpdate;
378
+ if (currentState.SSEDescription) {
379
+ if (!((_a = endState.sseSpecification) === null || _a === void 0 ? void 0 : _a.sseEnabled)) {
380
+ sseUpdate = {
381
+ Enabled: false,
382
+ };
383
+ }
384
+ else if (((_b = endState.sseSpecification) === null || _b === void 0 ? void 0 : _b.sseEnabled) === true &&
385
+ endState.sseSpecification.sseType !== undefined &&
386
+ endState.sseSpecification.sseType !== currentState.SSEDescription.SSEType) {
387
+ sseUpdate = {
388
+ Enabled: true,
389
+ SSEType: endState.sseSpecification.sseType,
390
+ KMSMasterKeyId: endState.sseSpecification.kmsMasterKeyId,
391
+ };
392
+ }
393
+ }
394
+ else {
395
+ if ((_c = endState.sseSpecification) === null || _c === void 0 ? void 0 : _c.sseEnabled) {
396
+ sseUpdate = {
397
+ Enabled: true,
398
+ SSEType: endState.sseSpecification.sseType,
399
+ KMSMasterKeyId: endState.sseSpecification.kmsMasterKeyId,
400
+ };
401
+ }
402
+ }
403
+ if (sseUpdate) {
404
+ return parsePropertiesToDynamoDBInput({
405
+ TableName: currentState.TableName,
406
+ SSESpecification: sseUpdate,
407
+ });
408
+ }
409
+ return undefined;
410
+ };
411
+ exports.getSseUpdate = getSseUpdate;
412
+ const getDeletionProtectionUpdate = (currentState, endState) => {
413
+ if (endState.deletionProtectionEnabled !== undefined && currentState.DeletionProtectionEnabled !== endState.deletionProtectionEnabled) {
414
+ return {
415
+ TableName: currentState.TableName,
416
+ DeletionProtectionEnabled: endState.deletionProtectionEnabled,
417
+ };
418
+ }
419
+ else if (endState.deletionProtectionEnabled === undefined && currentState.DeletionProtectionEnabled === true) {
420
+ return {
421
+ TableName: currentState.TableName,
422
+ DeletionProtectionEnabled: false,
423
+ };
424
+ }
425
+ return undefined;
426
+ };
427
+ exports.getDeletionProtectionUpdate = getDeletionProtectionUpdate;
428
+ const getTtlUpdate = (currentTTL, endState) => {
429
+ const endTTL = endState.timeToLiveSpecification;
430
+ if (currentTTL && currentTTL.TimeToLiveStatus) {
431
+ if (currentTTL.TimeToLiveStatus === 'ENABLED' && currentTTL.AttributeName) {
432
+ if (!endTTL || !endTTL.enabled) {
433
+ return {
434
+ TableName: endState.tableName,
435
+ TimeToLiveSpecification: {
436
+ Enabled: false,
437
+ AttributeName: currentTTL.AttributeName,
438
+ },
439
+ };
440
+ }
441
+ else if (currentTTL.AttributeName !== endTTL.attributeName) {
442
+ return {
443
+ TableName: endState.tableName,
444
+ TimeToLiveSpecification: {
445
+ Enabled: true,
446
+ AttributeName: endTTL.attributeName,
447
+ },
448
+ };
449
+ }
450
+ }
451
+ else if (currentTTL.TimeToLiveStatus === 'DISABLED' && endTTL && endTTL.enabled) {
452
+ return {
453
+ TableName: endState.tableName,
454
+ TimeToLiveSpecification: {
455
+ Enabled: true,
456
+ AttributeName: endTTL.attributeName,
457
+ },
458
+ };
459
+ }
460
+ }
461
+ return undefined;
462
+ };
463
+ exports.getTtlUpdate = getTtlUpdate;
464
+ const getPointInTimeRecoveryUpdate = (currentPointInTime, endState) => {
465
+ var _a, _b;
466
+ if (!currentPointInTime) {
467
+ return undefined;
468
+ }
469
+ const currentStatus = (_a = currentPointInTime.PointInTimeRecoveryDescription) === null || _a === void 0 ? void 0 : _a.PointInTimeRecoveryStatus;
470
+ const endStatus = (_b = endState.pointInTimeRecoverySpecification) === null || _b === void 0 ? void 0 : _b.pointInTimeRecoveryEnabled;
471
+ if (endStatus === undefined || endStatus === false) {
472
+ if (currentStatus === 'ENABLED') {
473
+ return {
474
+ TableName: endState.tableName,
475
+ PointInTimeRecoverySpecification: {
476
+ PointInTimeRecoveryEnabled: false,
477
+ },
478
+ };
479
+ }
480
+ }
481
+ else {
482
+ if (currentStatus === 'DISABLED') {
483
+ return {
484
+ TableName: endState.tableName,
485
+ PointInTimeRecoverySpecification: {
486
+ PointInTimeRecoveryEnabled: true,
487
+ },
488
+ };
489
+ }
490
+ }
491
+ return undefined;
492
+ };
493
+ exports.getPointInTimeRecoveryUpdate = getPointInTimeRecoveryUpdate;
494
+ const extractTableInputFromEvent = (event) => {
495
+ const resourceProperties = { ...event.ResourceProperties };
496
+ delete resourceProperties.ServiceToken;
497
+ const tableDef = convertStringToBooleanOrNumber(resourceProperties);
498
+ return tableDef;
499
+ };
500
+ exports.extractTableInputFromEvent = extractTableInputFromEvent;
501
+ const parsePropertiesToDynamoDBInput = (obj) => {
502
+ return usePascalCaseForObjectKeys(removeUndefinedAttributes(obj));
503
+ };
504
+ const usePascalCaseForObjectKeys = (obj) => {
505
+ const result = {};
506
+ for (const key in obj) {
507
+ if (obj.hasOwnProperty(key) && key !== '') {
508
+ const capitalizedKey = key.charAt(0).toUpperCase() + key.slice(1);
509
+ const value = obj[key];
510
+ if (Array.isArray(value)) {
511
+ result[capitalizedKey] = value.map((v) => usePascalCaseForObjectKeys(v));
512
+ }
513
+ else if (typeof value === 'object' && value !== null) {
514
+ result[capitalizedKey] = usePascalCaseForObjectKeys(value);
515
+ }
516
+ else {
517
+ result[capitalizedKey] = value;
518
+ }
519
+ }
520
+ }
521
+ return result;
522
+ };
523
+ const convertStringToBooleanOrNumber = (obj) => {
524
+ const fieldsToBeConvertedToBoolean = [
525
+ 'deletionProtectionEnabled',
526
+ 'enabled',
527
+ 'sseEnabled',
528
+ 'pointInTimeRecoveryEnabled',
529
+ 'allowDestructiveGraphqlSchemaUpdates',
530
+ ];
531
+ const fieldsToBeConvertedToNumber = ['readCapacityUnits', 'writeCapacityUnits'];
532
+ for (const key in obj) {
533
+ if (Array.isArray(obj[key])) {
534
+ obj[key] = obj[key].map((o) => convertStringToBooleanOrNumber(o));
535
+ }
536
+ else if (typeof obj[key] === 'object') {
537
+ obj[key] = convertStringToBooleanOrNumber(obj[key]);
538
+ }
539
+ else if (typeof obj[key] === 'string') {
540
+ if ((obj[key] === 'true' || obj[key] === 'false') && fieldsToBeConvertedToBoolean.includes(key)) {
541
+ obj[key] = obj[key] === 'true';
542
+ }
543
+ else if (!isNaN(Number(obj[key])) && fieldsToBeConvertedToNumber.includes(key)) {
544
+ obj[key] = Number(obj[key]);
545
+ }
546
+ }
547
+ }
548
+ return obj;
549
+ };
550
+ const removeUndefinedAttributes = (obj) => {
551
+ for (const key in obj) {
552
+ if (Array.isArray(obj[key])) {
553
+ obj[key].map((o) => removeUndefinedAttributes(o));
554
+ }
555
+ else if (typeof obj[key] === 'object') {
556
+ removeUndefinedAttributes(obj[key]);
557
+ }
558
+ else if (obj[key] === undefined) {
559
+ delete obj[key];
560
+ }
561
+ }
562
+ return obj;
563
+ };
564
+ const toCreateTableInput = (props) => {
565
+ const createTableInput = {
566
+ TableName: props.tableName,
567
+ AttributeDefinitions: props.attributeDefinitions,
568
+ KeySchema: props.keySchema,
569
+ GlobalSecondaryIndexes: props.globalSecondaryIndexes,
570
+ BillingMode: props.billingMode,
571
+ StreamSpecification: props.streamSpecification
572
+ ? {
573
+ StreamEnabled: true,
574
+ StreamViewType: props.streamSpecification.streamViewType,
575
+ }
576
+ : undefined,
577
+ ProvisionedThroughput: props.provisionedThroughput,
578
+ SSESpecification: props.sseSpecification ? { Enabled: props.sseSpecification.sseEnabled } : undefined,
579
+ DeletionProtectionEnabled: props.deletionProtectionEnabled,
580
+ };
581
+ return parsePropertiesToDynamoDBInput(createTableInput);
582
+ };
583
+ exports.toCreateTableInput = toCreateTableInput;
584
+ const createNewTable = async (input) => {
585
+ var _a;
586
+ const tableName = input.TableName;
587
+ const createTableInput = input;
588
+ const result = await ddbClient.createTable(createTableInput);
589
+ return { tableName: tableName, tableArn: result.TableDescription.TableArn, streamArn: (_a = result.TableDescription) === null || _a === void 0 ? void 0 : _a.LatestStreamArn };
590
+ };
591
+ const doesTableExist = async (tableName) => {
592
+ try {
593
+ await ddbClient.describeTable({ TableName: tableName });
594
+ return true;
595
+ }
596
+ catch (error) {
597
+ if (error instanceof client_dynamodb_1.ResourceNotFoundException) {
598
+ return false;
599
+ }
600
+ throw error;
601
+ }
602
+ };
603
+ const isTableReady = async (tableName) => {
604
+ var _a, _b;
605
+ const result = await ddbClient.describeTable({ TableName: tableName });
606
+ if (((_a = result.Table) === null || _a === void 0 ? void 0 : _a.TableStatus) !== 'ACTIVE') {
607
+ console.log('Table not active yet');
608
+ return false;
609
+ }
610
+ if ((_b = result.Table.GlobalSecondaryIndexes) === null || _b === void 0 ? void 0 : _b.some((gsi) => gsi.IndexStatus !== 'ACTIVE' || gsi.Backfilling)) {
611
+ console.log('Some GSI is not active yet');
612
+ return false;
613
+ }
614
+ return true;
615
+ };
616
+ const isProjectionModified = (currentProjection, endProjection) => {
617
+ if (currentProjection.ProjectionType !== endProjection.projectionType)
618
+ return true;
619
+ if (currentProjection.ProjectionType === 'ALL')
620
+ return false;
621
+ const currentNonKeyAttributes = currentProjection.NonKeyAttributes || [];
622
+ const endNonKeyAttributes = endProjection.nonKeyAttributes || [];
623
+ if (currentNonKeyAttributes.length !== endNonKeyAttributes.length)
624
+ return true;
625
+ if (currentNonKeyAttributes.some((currentNonKeyAttribute) => !endNonKeyAttributes.includes(currentNonKeyAttribute)))
626
+ return true;
627
+ return false;
628
+ };
629
+ const isKeySchemaModified = (currentSchema, endSchema) => {
630
+ const currentHashKey = currentSchema.find((schema) => schema.KeyType === 'HASH');
631
+ const endHashKey = endSchema.find((schema) => schema.keyType === 'HASH');
632
+ if ((currentHashKey === null || currentHashKey === void 0 ? void 0 : currentHashKey.AttributeName) !== (endHashKey === null || endHashKey === void 0 ? void 0 : endHashKey.attributeName))
633
+ return true;
634
+ const currentSortKey = currentSchema.find((schema) => schema.KeyType === 'RANGE');
635
+ const endSortKey = endSchema.find((schema) => schema.keyType === 'RANGE');
636
+ if (currentSortKey === undefined && endSortKey === undefined)
637
+ return false;
638
+ if ((currentSortKey === undefined && endSortKey !== undefined) || (currentSortKey !== undefined && endSortKey === undefined))
639
+ return true;
640
+ if ((currentSortKey === null || currentSortKey === void 0 ? void 0 : currentSortKey.AttributeName) !== (endSortKey === null || endSortKey === void 0 ? void 0 : endSortKey.attributeName))
641
+ return true;
642
+ return false;
643
+ };
644
+ const defaultSettings = {
645
+ times: Infinity,
646
+ delayMS: 1000 * 15,
647
+ timeoutMS: 1000 * 60 * 14,
648
+ stopOnError: false,
649
+ };
650
+ const retry = async (func, successPredicate, settings, failurePredicate) => {
651
+ const { times, delayMS, timeoutMS, stopOnError } = {
652
+ ...defaultSettings,
653
+ ...settings,
654
+ };
655
+ let count = 0;
656
+ let result;
657
+ let terminate = false;
658
+ const startTime = Date.now();
659
+ do {
660
+ try {
661
+ result = await func();
662
+ if (successPredicate(result)) {
663
+ return result;
664
+ }
665
+ if (typeof failurePredicate === 'function' && failurePredicate(result)) {
666
+ throw new Error('Retry-able function execution result matched failure predicate. Stopping retries.');
667
+ }
668
+ console.warn(`Retry-able function execution did not match success predicate. Result was [${JSON.stringify(result)}]. Retrying...`);
669
+ }
670
+ catch (err) {
671
+ console.warn(`Retry-able function execution failed with [${err.message || err}]`);
672
+ if (stopOnError) {
673
+ console.log('Stopping retries on error.');
674
+ }
675
+ else {
676
+ console.log('Retrying...');
677
+ }
678
+ terminate = stopOnError;
679
+ }
680
+ count++;
681
+ await sleep(delayMS);
682
+ } while (!terminate && count <= times && Date.now() - startTime < timeoutMS);
683
+ throw new Error('Retry-able function did not match predicate within the given retry constraints');
684
+ };
685
+ const sleep = async (milliseconds) => new Promise((resolve) => setTimeout(resolve, milliseconds));
686
+ //# sourceMappingURL=amplify-table-manager-handler.js.map