@aws-amplify/graphql-api-construct 1.14.0-gen2-migration-0930.0 → 1.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (275) hide show
  1. package/.jsii +171 -172
  2. package/API.md +3 -11
  3. package/CHANGELOG.md +11 -5
  4. package/lib/amplify-dynamodb-table-wrapper.js +1 -1
  5. package/lib/amplify-graphql-api.d.ts +5 -0
  6. package/lib/amplify-graphql-api.js +3 -2
  7. package/lib/amplify-graphql-definition.js +1 -1
  8. package/lib/internal/authorization-modes.js +3 -3
  9. package/lib/model-datasource-strategy-types.d.ts +1 -19
  10. package/lib/model-datasource-strategy-types.js +1 -1
  11. package/lib/sql-model-datasource-strategy.js +1 -1
  12. package/lib/types.d.ts +1 -1
  13. package/lib/types.js +1 -1
  14. package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/bedrock_converse_adapter.d.ts +3 -1
  15. package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/bedrock_converse_adapter.js +8 -5
  16. package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/conversation_message_history_retriever.d.ts +44 -0
  17. package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/conversation_message_history_retriever.js +173 -0
  18. package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/conversation_turn_response_sender.d.ts +10 -3
  19. package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/conversation_turn_response_sender.js +10 -23
  20. package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/event-tools-provider/graphql_tool.d.ts +5 -5
  21. package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/event-tools-provider/graphql_tool.js +9 -24
  22. package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/graphql_request_executor.d.ts +21 -0
  23. package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/graphql_request_executor.js +45 -0
  24. package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/types.d.ts +11 -1
  25. package/node_modules/@aws-amplify/ai-constructs/lib/conversation/runtime/types.js +1 -1
  26. package/node_modules/@aws-amplify/ai-constructs/package.json +1 -1
  27. package/node_modules/@aws-amplify/graphql-auth-transformer/API.md +2 -0
  28. package/node_modules/@aws-amplify/graphql-auth-transformer/CHANGELOG.md +7 -1
  29. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/graphql-auth-transformer.d.ts +1 -0
  30. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/graphql-auth-transformer.d.ts.map +1 -1
  31. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/graphql-auth-transformer.js +37 -15
  32. package/node_modules/@aws-amplify/graphql-auth-transformer/lib/graphql-auth-transformer.js.map +1 -1
  33. package/node_modules/@aws-amplify/graphql-auth-transformer/package.json +15 -15
  34. package/node_modules/@aws-amplify/graphql-conversation-transformer/API.md +2 -1
  35. package/node_modules/@aws-amplify/graphql-conversation-transformer/CHANGELOG.md +12 -1
  36. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/graphql-types/message-model.js +2 -2
  37. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/graphql-types/message-model.js.map +1 -1
  38. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/grapqhl-conversation-transformer.d.ts +2 -1
  39. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/grapqhl-conversation-transformer.d.ts.map +1 -1
  40. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/grapqhl-conversation-transformer.js +2 -2
  41. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/grapqhl-conversation-transformer.js.map +1 -1
  42. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-messages-subscription-resolver-fn.template.js +43 -0
  43. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-messages-subscription-resolver.d.ts +3 -2
  44. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-messages-subscription-resolver.d.ts.map +1 -1
  45. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-messages-subscription-resolver.js +9 -55
  46. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-messages-subscription-resolver.js.map +1 -1
  47. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-mutation-resolver-fn.template.js +41 -0
  48. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-mutation-resolver.d.ts +3 -2
  49. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-mutation-resolver.d.ts.map +1 -1
  50. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-mutation-resolver.js +18 -70
  51. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/assistant-mutation-resolver.js.map +1 -1
  52. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/auth-resolver-fn.template.js +38 -0
  53. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/auth-resolver.d.ts +3 -2
  54. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/auth-resolver.d.ts.map +1 -1
  55. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/auth-resolver.js +9 -50
  56. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/auth-resolver.js.map +1 -1
  57. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/init-resolver-fn.template.js +16 -0
  58. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/init-resolver.d.ts +2 -2
  59. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/init-resolver.d.ts.map +1 -1
  60. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/init-resolver.js +15 -27
  61. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/init-resolver.js.map +1 -1
  62. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/invoke-lambda-resolver-fn.template.js +66 -0
  63. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/invoke-lambda-resolver.d.ts +2 -3
  64. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/invoke-lambda-resolver.d.ts.map +1 -1
  65. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/invoke-lambda-resolver.js +49 -76
  66. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/invoke-lambda-resolver.js.map +1 -1
  67. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/list-messages-init-resolver-fn.template.js +8 -0
  68. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/list-messages-init-resolver.d.ts +4 -0
  69. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/list-messages-init-resolver.d.ts.map +1 -0
  70. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/list-messages-init-resolver.js +16 -0
  71. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/list-messages-init-resolver.js.map +1 -0
  72. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/verify-session-owner-resolver-fn.template.js +31 -0
  73. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/verify-session-owner-resolver.d.ts +4 -2
  74. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/verify-session-owner-resolver.d.ts.map +1 -1
  75. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/verify-session-owner-resolver.js +27 -43
  76. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/verify-session-owner-resolver.js.map +1 -1
  77. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/write-message-to-table-resolver-fn.template.js +24 -0
  78. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/write-message-to-table-resolver.d.ts +3 -2
  79. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/write-message-to-table-resolver.d.ts.map +1 -1
  80. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/write-message-to-table-resolver.js +18 -38
  81. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/write-message-to-table-resolver.js.map +1 -1
  82. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/transformer-steps/conversation-resolver-generator.d.ts +4 -1
  83. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/transformer-steps/conversation-resolver-generator.d.ts.map +1 -1
  84. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/transformer-steps/conversation-resolver-generator.js +59 -38
  85. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/transformer-steps/conversation-resolver-generator.js.map +1 -1
  86. package/node_modules/@aws-amplify/graphql-conversation-transformer/package.json +16 -14
  87. package/node_modules/@aws-amplify/graphql-default-value-transformer/CHANGELOG.md +7 -1
  88. package/node_modules/@aws-amplify/graphql-default-value-transformer/lib/graphql-default-value-transformer.d.ts.map +1 -1
  89. package/node_modules/@aws-amplify/graphql-default-value-transformer/lib/graphql-default-value-transformer.js +20 -8
  90. package/node_modules/@aws-amplify/graphql-default-value-transformer/lib/graphql-default-value-transformer.js.map +1 -1
  91. package/node_modules/@aws-amplify/graphql-default-value-transformer/package.json +11 -10
  92. package/node_modules/@aws-amplify/graphql-directives/CHANGELOG.md +2 -2
  93. package/node_modules/@aws-amplify/graphql-directives/lib/directives/belongs-to.d.ts.map +1 -1
  94. package/node_modules/@aws-amplify/graphql-directives/lib/directives/belongs-to.js +1 -1
  95. package/node_modules/@aws-amplify/graphql-directives/lib/directives/belongs-to.js.map +1 -1
  96. package/node_modules/@aws-amplify/graphql-directives/lib/directives/default.js +1 -1
  97. package/node_modules/@aws-amplify/graphql-directives/package.json +2 -2
  98. package/node_modules/@aws-amplify/graphql-function-transformer/CHANGELOG.md +5 -1
  99. package/node_modules/@aws-amplify/graphql-function-transformer/lib/graphql-function-transformer.js +2 -2
  100. package/node_modules/@aws-amplify/graphql-function-transformer/lib/graphql-function-transformer.js.map +1 -1
  101. package/node_modules/@aws-amplify/graphql-function-transformer/package.json +9 -9
  102. package/node_modules/@aws-amplify/graphql-generation-transformer/CHANGELOG.md +8 -1
  103. package/node_modules/@aws-amplify/graphql-generation-transformer/lib/grapqhl-generation-transformer.d.ts.map +1 -1
  104. package/node_modules/@aws-amplify/graphql-generation-transformer/lib/grapqhl-generation-transformer.js +1 -1
  105. package/node_modules/@aws-amplify/graphql-generation-transformer/lib/grapqhl-generation-transformer.js.map +1 -1
  106. package/node_modules/@aws-amplify/graphql-generation-transformer/lib/resolvers/invoke-bedrock-resolver-fn.template.js +60 -0
  107. package/node_modules/@aws-amplify/graphql-generation-transformer/lib/resolvers/invoke-bedrock.d.ts +1 -4
  108. package/node_modules/@aws-amplify/graphql-generation-transformer/lib/resolvers/invoke-bedrock.d.ts.map +1 -1
  109. package/node_modules/@aws-amplify/graphql-generation-transformer/lib/resolvers/invoke-bedrock.js +37 -60
  110. package/node_modules/@aws-amplify/graphql-generation-transformer/lib/resolvers/invoke-bedrock.js.map +1 -1
  111. package/node_modules/@aws-amplify/graphql-generation-transformer/lib/utils/tools.d.ts.map +1 -1
  112. package/node_modules/@aws-amplify/graphql-generation-transformer/lib/utils/tools.js +2 -1
  113. package/node_modules/@aws-amplify/graphql-generation-transformer/lib/utils/tools.js.map +1 -1
  114. package/node_modules/@aws-amplify/graphql-generation-transformer/package.json +11 -10
  115. package/node_modules/@aws-amplify/graphql-http-transformer/CHANGELOG.md +5 -1
  116. package/node_modules/@aws-amplify/graphql-http-transformer/lib/graphql-http-transformer.js +2 -2
  117. package/node_modules/@aws-amplify/graphql-http-transformer/lib/graphql-http-transformer.js.map +1 -1
  118. package/node_modules/@aws-amplify/graphql-http-transformer/package.json +9 -9
  119. package/node_modules/@aws-amplify/graphql-index-transformer/CHANGELOG.md +5 -1
  120. package/node_modules/@aws-amplify/graphql-index-transformer/lib/resolvers/resolvers.js +2 -2
  121. package/node_modules/@aws-amplify/graphql-index-transformer/lib/resolvers/resolvers.js.map +1 -1
  122. package/node_modules/@aws-amplify/graphql-index-transformer/package.json +10 -10
  123. package/node_modules/@aws-amplify/graphql-maps-to-transformer/CHANGELOG.md +5 -1
  124. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/assets/mapping-lambda.zip +0 -0
  125. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/field-mapping-resolvers.js +4 -4
  126. package/node_modules/@aws-amplify/graphql-maps-to-transformer/lib/field-mapping-resolvers.js.map +1 -1
  127. package/node_modules/@aws-amplify/graphql-maps-to-transformer/package.json +13 -13
  128. package/node_modules/@aws-amplify/graphql-model-transformer/CHANGELOG.md +4 -13
  129. package/node_modules/@aws-amplify/graphql-model-transformer/lib/graphql-model-transformer.d.ts.map +1 -1
  130. package/node_modules/@aws-amplify/graphql-model-transformer/lib/graphql-model-transformer.js +2 -7
  131. package/node_modules/@aws-amplify/graphql-model-transformer/lib/graphql-model-transformer.js.map +1 -1
  132. package/node_modules/@aws-amplify/graphql-model-transformer/lib/rds-lambda.zip +0 -0
  133. package/node_modules/@aws-amplify/graphql-model-transformer/lib/rds-notification-lambda.zip +0 -0
  134. package/node_modules/@aws-amplify/graphql-model-transformer/lib/rds-patching-lambda.zip +0 -0
  135. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/dynamodb/query.js +1 -1
  136. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resolvers/dynamodb/query.js.map +1 -1
  137. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamo-model-resource-generator.d.ts.map +1 -1
  138. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamo-model-resource-generator.js +3 -12
  139. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamo-model-resource-generator.js.map +1 -1
  140. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamodb-table-construct/index.d.ts +0 -2
  141. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamodb-table-construct/index.d.ts.map +1 -1
  142. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamodb-table-construct/index.js +2 -4
  143. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-dynamodb-table-construct/index.js.map +1 -1
  144. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/amplify-table-manager-handler.d.ts +0 -3
  145. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/amplify-table-manager-handler.d.ts.map +1 -1
  146. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/amplify-table-manager-handler.js +1 -141
  147. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/amplify-table-manager-handler.js.map +1 -1
  148. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/model-resource-generator.js +5 -5
  149. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/model-resource-generator.js.map +1 -1
  150. package/node_modules/@aws-amplify/graphql-model-transformer/package.json +11 -14
  151. package/node_modules/@aws-amplify/graphql-predictions-transformer/CHANGELOG.md +5 -1
  152. package/node_modules/@aws-amplify/graphql-predictions-transformer/lib/graphql-predictions-transformer.js +2 -2
  153. package/node_modules/@aws-amplify/graphql-predictions-transformer/lib/graphql-predictions-transformer.js.map +1 -1
  154. package/node_modules/@aws-amplify/graphql-predictions-transformer/lib/predictionsLambdaFunction.zip +0 -0
  155. package/node_modules/@aws-amplify/graphql-predictions-transformer/package.json +9 -9
  156. package/node_modules/@aws-amplify/graphql-relational-transformer/CHANGELOG.md +5 -3
  157. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-belongs-to-transformer.js +0 -3
  158. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/graphql-belongs-to-transformer.js.map +1 -1
  159. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/has-many/has-many-directive-ddb-references-transformer.d.ts.map +1 -1
  160. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/has-many/has-many-directive-ddb-references-transformer.js +1 -7
  161. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/has-many/has-many-directive-ddb-references-transformer.js.map +1 -1
  162. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/has-one/has-one-directive-ddb-references-transformer.d.ts.map +1 -1
  163. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/has-one/has-one-directive-ddb-references-transformer.js +1 -7
  164. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/has-one/has-one-directive-ddb-references-transformer.js.map +1 -1
  165. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolvers.js +1 -1
  166. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/resolvers.js.map +1 -1
  167. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/types.d.ts +0 -1
  168. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/types.d.ts.map +1 -1
  169. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/utils.d.ts +0 -1
  170. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/utils.d.ts.map +1 -1
  171. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/utils.js +1 -9
  172. package/node_modules/@aws-amplify/graphql-relational-transformer/lib/utils.js.map +1 -1
  173. package/node_modules/@aws-amplify/graphql-relational-transformer/package.json +11 -11
  174. package/node_modules/@aws-amplify/graphql-searchable-transformer/CHANGELOG.md +5 -1
  175. package/node_modules/@aws-amplify/graphql-searchable-transformer/lib/graphql-searchable-transformer.js +1 -1
  176. package/node_modules/@aws-amplify/graphql-searchable-transformer/lib/graphql-searchable-transformer.js.map +1 -1
  177. package/node_modules/@aws-amplify/graphql-searchable-transformer/lib/streaming-lambda.zip +0 -0
  178. package/node_modules/@aws-amplify/graphql-searchable-transformer/package.json +10 -10
  179. package/node_modules/@aws-amplify/graphql-sql-transformer/CHANGELOG.md +5 -1
  180. package/node_modules/@aws-amplify/graphql-sql-transformer/lib/graphql-sql-transformer.js +1 -1
  181. package/node_modules/@aws-amplify/graphql-sql-transformer/lib/graphql-sql-transformer.js.map +1 -1
  182. package/node_modules/@aws-amplify/graphql-sql-transformer/package.json +10 -10
  183. package/node_modules/@aws-amplify/graphql-transformer/CHANGELOG.md +5 -5
  184. package/node_modules/@aws-amplify/graphql-transformer/lib/graphql-transformer.js +1 -1
  185. package/node_modules/@aws-amplify/graphql-transformer/lib/graphql-transformer.js.map +1 -1
  186. package/node_modules/@aws-amplify/graphql-transformer/package.json +19 -19
  187. package/node_modules/@aws-amplify/graphql-transformer/src/graphql-transformer.ts +1 -1
  188. package/node_modules/@aws-amplify/graphql-transformer-core/API.md +36 -16
  189. package/node_modules/@aws-amplify/graphql-transformer-core/CHANGELOG.md +8 -5
  190. package/node_modules/@aws-amplify/graphql-transformer-core/lib/appsync-function.d.ts +2 -3
  191. package/node_modules/@aws-amplify/graphql-transformer-core/lib/appsync-function.d.ts.map +1 -1
  192. package/node_modules/@aws-amplify/graphql-transformer-core/lib/appsync-function.js.map +1 -1
  193. package/node_modules/@aws-amplify/graphql-transformer-core/lib/cdk-compat/template-asset.d.ts +10 -0
  194. package/node_modules/@aws-amplify/graphql-transformer-core/lib/cdk-compat/template-asset.d.ts.map +1 -1
  195. package/node_modules/@aws-amplify/graphql-transformer-core/lib/cdk-compat/template-asset.js +26 -1
  196. package/node_modules/@aws-amplify/graphql-transformer-core/lib/cdk-compat/template-asset.js.map +1 -1
  197. package/node_modules/@aws-amplify/graphql-transformer-core/lib/index.d.ts +2 -2
  198. package/node_modules/@aws-amplify/graphql-transformer-core/lib/index.d.ts.map +1 -1
  199. package/node_modules/@aws-amplify/graphql-transformer-core/lib/index.js +6 -3
  200. package/node_modules/@aws-amplify/graphql-transformer-core/lib/index.js.map +1 -1
  201. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transform-host.d.ts +9 -3
  202. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transform-host.d.ts.map +1 -1
  203. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transform-host.js +43 -10
  204. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transform-host.js.map +1 -1
  205. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/transform.d.ts.map +1 -1
  206. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/transform.js +1 -1
  207. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformation/transform.js.map +1 -1
  208. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/resolver.d.ts +12 -10
  209. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/resolver.d.ts.map +1 -1
  210. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/resolver.js +107 -38
  211. package/node_modules/@aws-amplify/graphql-transformer-core/lib/transformer-context/resolver.js.map +1 -1
  212. package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/function-runtime-types.d.ts +4 -0
  213. package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/function-runtime-types.d.ts.map +1 -0
  214. package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/function-runtime-types.js +6 -0
  215. package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/function-runtime-types.js.map +1 -0
  216. package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/index.d.ts +1 -0
  217. package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/index.d.ts.map +1 -1
  218. package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/index.js +4 -1
  219. package/node_modules/@aws-amplify/graphql-transformer-core/lib/types/index.js.map +1 -1
  220. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/function-runtime.d.ts +4 -3
  221. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/function-runtime.d.ts.map +1 -1
  222. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/function-runtime.js +19 -9
  223. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/function-runtime.js.map +1 -1
  224. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/graphql-utils.d.ts +9 -9
  225. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/graphql-utils.d.ts.map +1 -1
  226. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/graphql-utils.js.map +1 -1
  227. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/model-datasource-strategy-utils.d.ts +3 -2
  228. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/model-datasource-strategy-utils.d.ts.map +1 -1
  229. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/model-datasource-strategy-utils.js +13 -9
  230. package/node_modules/@aws-amplify/graphql-transformer-core/lib/utils/model-datasource-strategy-utils.js.map +1 -1
  231. package/node_modules/@aws-amplify/graphql-transformer-core/package.json +7 -7
  232. package/node_modules/@aws-amplify/graphql-transformer-interfaces/API.md +28 -14
  233. package/node_modules/@aws-amplify/graphql-transformer-interfaces/CHANGELOG.md +4 -7
  234. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/model-datasource/types.d.ts +1 -6
  235. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/model-datasource/types.d.ts.map +1 -1
  236. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/model-datasource/types.js.map +1 -1
  237. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transform-host-provider.d.ts +8 -3
  238. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transform-host-provider.d.ts.map +1 -1
  239. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/index.d.ts +1 -1
  240. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/index.d.ts.map +1 -1
  241. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/index.js.map +1 -1
  242. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/transformer-resolver-provider.d.ts +10 -1
  243. package/node_modules/@aws-amplify/graphql-transformer-interfaces/lib/transformer-context/transformer-resolver-provider.d.ts.map +1 -1
  244. package/node_modules/@aws-amplify/graphql-transformer-interfaces/package.json +3 -3
  245. package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/model-datasource/types.ts +0 -10
  246. package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/transform-host-provider.ts +38 -3
  247. package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/transformer-context/index.ts +7 -1
  248. package/node_modules/@aws-amplify/graphql-transformer-interfaces/src/transformer-context/transformer-resolver-provider.ts +6 -1
  249. package/node_modules/@aws-amplify/graphql-transformer-interfaces/tsconfig.tsbuildinfo +1 -1
  250. package/node_modules/graphql-mapping-template/CHANGELOG.md +0 -4
  251. package/node_modules/graphql-mapping-template/package.json +2 -3
  252. package/node_modules/graphql-transformer-common/CHANGELOG.md +0 -10
  253. package/node_modules/graphql-transformer-common/package.json +3 -4
  254. package/package.json +25 -25
  255. package/src/amplify-graphql-api.ts +6 -0
  256. package/src/internal/authorization-modes.ts +2 -2
  257. package/src/model-datasource-strategy-types.ts +0 -21
  258. package/src/types.ts +1 -1
  259. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/js-resolver-function-provider.d.ts +0 -6
  260. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/js-resolver-function-provider.d.ts.map +0 -1
  261. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/js-resolver-function-provider.js +0 -3
  262. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/js-resolver-function-provider.js.map +0 -1
  263. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/message-history-resolver.d.ts +0 -3
  264. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/message-history-resolver.d.ts.map +0 -1
  265. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/message-history-resolver.js +0 -59
  266. package/node_modules/@aws-amplify/graphql-conversation-transformer/lib/resolvers/message-history-resolver.js.map +0 -1
  267. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/node_modules/.package-lock.json +0 -13
  268. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/node_modules/lodash.isequal/LICENSE +0 -47
  269. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/node_modules/lodash.isequal/README.md +0 -18
  270. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/node_modules/lodash.isequal/index.js +0 -1848
  271. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/node_modules/lodash.isequal/package.json +0 -16
  272. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/package-lock.json +0 -21
  273. package/node_modules/@aws-amplify/graphql-model-transformer/lib/resources/amplify-dynamodb-table/amplify-table-manager-lambda/package.json +0 -11
  274. package/node_modules/graphql-mapping-template/LICENSE +0 -201
  275. package/node_modules/graphql-transformer-common/LICENSE +0 -201
@@ -0,0 +1,41 @@
1
+ import { util } from '@aws-appsync/utils';
2
+ import * as ddb from '@aws-appsync/utils/dynamodb';
3
+
4
+ /**
5
+ * Sends a request to the attached data source
6
+ * @param {import('@aws-appsync/utils').Context} ctx the context
7
+ * @returns {*} the request
8
+ */
9
+ export function request(ctx) {
10
+ const { conversationId, content, associatedUserMessageId } = ctx.args.input;
11
+ const { owner } = ctx.args;
12
+ const defaultValues = ctx.stash.defaultValues ?? {};
13
+ const id = defaultValues.id;
14
+
15
+ const message = {
16
+ __typename: '[[CONVERSATION_MESSAGE_TYPE_NAME]]',
17
+ id,
18
+ role: 'assistant',
19
+ content,
20
+ conversationId,
21
+ associatedUserMessageId,
22
+ owner,
23
+ ...defaultValues,
24
+ };
25
+
26
+ return ddb.put({ key: { id }, item: message });
27
+ }
28
+
29
+ /**
30
+ * Returns the resolver result
31
+ * @param {import('@aws-appsync/utils').Context} ctx the context
32
+ * @returns {*} the result
33
+ */
34
+ export function response(ctx) {
35
+ // Update with response logic
36
+ if (ctx.error) {
37
+ util.error(ctx.error.message, ctx.error.type);
38
+ }
39
+
40
+ return ctx.result;
41
+ }
@@ -1,3 +1,4 @@
1
- import { JSResolverFunctionProvider } from './js-resolver-function-provider';
2
- export declare const assistantMutationResolver: () => JSResolverFunctionProvider;
1
+ import { MappingTemplateProvider } from '@aws-amplify/graphql-transformer-interfaces';
2
+ import { ConversationDirectiveConfiguration } from '../grapqhl-conversation-transformer';
3
+ export declare const assistantMutationResolver: (config: ConversationDirectiveConfiguration) => MappingTemplateProvider;
3
4
  //# sourceMappingURL=assistant-mutation-resolver.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"assistant-mutation-resolver.d.ts","sourceRoot":"","sources":["../../src/resolvers/assistant-mutation-resolver.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAS7E,eAAO,MAAM,yBAAyB,QAAO,0BAI5C,CAAC"}
1
+ {"version":3,"file":"assistant-mutation-resolver.d.ts","sourceRoot":"","sources":["../../src/resolvers/assistant-mutation-resolver.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AAGtF,OAAO,EAAE,kCAAkC,EAAE,MAAM,qCAAqC,CAAC;AASzF,eAAO,MAAM,yBAAyB,WAAY,kCAAkC,KAAG,uBAYtF,CAAC"}
@@ -1,77 +1,25 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.assistantMutationResolver = void 0;
4
7
  const graphql_transformer_core_1 = require("@aws-amplify/graphql-transformer-core");
5
- const ts_dedent_1 = require("ts-dedent");
6
- const assistantMutationResolver = () => {
7
- const req = createAssistantMutationRequestFunction();
8
- const res = createAssistantMutationResponseFunction();
9
- return { req, res };
8
+ const fs_1 = __importDefault(require("fs"));
9
+ const path_1 = __importDefault(require("path"));
10
+ const graphql_transformer_common_1 = require("graphql-transformer-common");
11
+ const assistantMutationResolver = (config) => {
12
+ let resolver = fs_1.default.readFileSync(path_1.default.join(__dirname, 'assistant-mutation-resolver-fn.template.js'), 'utf8');
13
+ const fieldName = (0, graphql_transformer_common_1.toUpper)(config.field.name.value);
14
+ const substitutions = {
15
+ CONVERSATION_MESSAGE_TYPE_NAME: `ConversationMessage${fieldName}`,
16
+ };
17
+ Object.entries(substitutions).forEach(([key, value]) => {
18
+ const replaced = resolver.replace(new RegExp(`\\[\\[${key}\\]\\]`, 'g'), value);
19
+ resolver = replaced;
20
+ });
21
+ const templateName = `Mutation.${config.field.name.value}.assistant-response.js`;
22
+ return graphql_transformer_core_1.MappingTemplate.s3MappingFunctionCodeFromString(resolver, templateName);
10
23
  };
11
24
  exports.assistantMutationResolver = assistantMutationResolver;
12
- const createAssistantMutationRequestFunction = () => {
13
- const requestFunctionString = `
14
- import { util } from '@aws-appsync/utils';
15
-
16
- /**
17
- * Sends a request to the attached data source
18
- * @param {import('@aws-appsync/utils').Context} ctx the context
19
- * @returns {*} the request
20
- */
21
- export function request(ctx) {
22
- const owner = ctx.identity['claims']['sub'];
23
- ctx.stash.owner = owner;
24
- const { conversationId, content, associatedUserMessageId } = ctx.args.input;
25
- const updatedAt = util.time.nowISO8601();
26
-
27
- const expression = 'SET #assistantContent = :assistantContent, #updatedAt = :updatedAt';
28
- const expressionNames = { '#assistantContent': 'assistantContent', '#updatedAt': 'updatedAt' };
29
- const expressionValues = { ':assistantContent': content, ':updatedAt': updatedAt };
30
- const condition = JSON.parse(
31
- util.transform.toDynamoDBConditionExpression({
32
- owner: { eq: owner },
33
- conversationId: { eq: conversationId }
34
- })
35
- );
36
- return {
37
- operation: 'UpdateItem',
38
- key: util.dynamodb.toMapValues({ id: associatedUserMessageId }),
39
- condition,
40
- update: {
41
- expression,
42
- expressionNames,
43
- expressionValues: util.dynamodb.toMapValues(expressionValues),
44
- }
45
- };
46
- }`;
47
- return graphql_transformer_core_1.MappingTemplate.inlineTemplateFromString((0, ts_dedent_1.dedent)(requestFunctionString));
48
- };
49
- const createAssistantMutationResponseFunction = () => {
50
- const responseFunctionString = `
51
- /**
52
- * Returns the resolver result
53
- * @param {import('@aws-appsync/utils').Context} ctx the context
54
- * @returns {*} the result
55
- */
56
- export function response(ctx) {
57
- // Update with response logic
58
- if (ctx.error) {
59
- util.error(ctx.error.message, ctx.error.type);
60
- }
61
-
62
- const { conversationId, content, associatedUserMessageId } = ctx.args.input;
63
- const { createdAt, updatedAt } = ctx.result;
64
-
65
- return {
66
- id: associatedUserMessageId,
67
- content,
68
- conversationId,
69
- role: 'assistant',
70
- owner: ctx.stash.owner,
71
- createdAt,
72
- updatedAt,
73
- };
74
- }`;
75
- return graphql_transformer_core_1.MappingTemplate.inlineTemplateFromString((0, ts_dedent_1.dedent)(responseFunctionString));
76
- };
77
25
  //# sourceMappingURL=assistant-mutation-resolver.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"assistant-mutation-resolver.js","sourceRoot":"","sources":["../../src/resolvers/assistant-mutation-resolver.ts"],"names":[],"mappings":";;;AAAA,oFAAwE;AAExE,yCAAmC;AAU5B,MAAM,yBAAyB,GAAG,GAA+B,EAAE;IACxE,MAAM,GAAG,GAAG,sCAAsC,EAAE,CAAC;IACrD,MAAM,GAAG,GAAG,uCAAuC,EAAE,CAAC;IACtD,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AACtB,CAAC,CAAC;AAJW,QAAA,yBAAyB,6BAIpC;AAQF,MAAM,sCAAsC,GAAG,GAA4B,EAAE;IAC3E,MAAM,qBAAqB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAi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,0CAAe,CAAC,+BAA+B,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;AACjF,CAAC,CAAC;AAZW,QAAA,yBAAyB,6BAYpC"}
@@ -0,0 +1,38 @@
1
+ export function request(ctx) {
2
+ ctx.stash.hasAuth = true;
3
+ const isAuthorized = false;
4
+
5
+ if (util.authType() === 'User Pool Authorization') {
6
+ if (!isAuthorized) {
7
+ const authFilter = [];
8
+ let ownerClaim0 = ctx.identity['claims']['sub'];
9
+ ctx.args.owner = ownerClaim0;
10
+ const currentClaim1 = ctx.identity['claims']['username'] ?? ctx.identity['claims']['cognito:username'];
11
+ if (ownerClaim0 && currentClaim1) {
12
+ ownerClaim0 = ownerClaim0 + '::' + currentClaim1;
13
+ authFilter.push({ owner: { eq: ownerClaim0 } });
14
+ }
15
+ const role0_0 = ctx.identity['claims']['sub'];
16
+ if (role0_0) {
17
+ authFilter.push({ owner: { eq: role0_0 } });
18
+ }
19
+ // we can just reuse currentClaim1 here, but doing this (for now) to mirror the existing
20
+ // vtl auth resolver.
21
+ const role0_1 = ctx.identity['claims']['username'] ?? ctx.identity['claims']['cognito:username'];
22
+ if (role0_1) {
23
+ authFilter.push({ owner: { eq: role0_1 } });
24
+ }
25
+ if (authFilter.length !== 0) {
26
+ ctx.stash.authFilter = { or: authFilter };
27
+ }
28
+ }
29
+ }
30
+ if (!isAuthorized && ctx.stash.authFilter.length === 0) {
31
+ util.unauthorized();
32
+ }
33
+ return { version: '2018-05-29', payload: {} };
34
+ }
35
+
36
+ export function response(ctx) {
37
+ return {};
38
+ }
@@ -1,3 +1,4 @@
1
- import { JSResolverFunctionProvider } from './js-resolver-function-provider';
2
- export declare const authMappingTemplate: () => JSResolverFunctionProvider;
1
+ import { MappingTemplateProvider } from '@aws-amplify/graphql-transformer-interfaces';
2
+ import { ConversationDirectiveConfiguration } from '../grapqhl-conversation-transformer';
3
+ export declare const authMappingTemplate: (config: ConversationDirectiveConfiguration) => MappingTemplateProvider;
3
4
  //# sourceMappingURL=auth-resolver.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth-resolver.d.ts","sourceRoot":"","sources":["../../src/resolvers/auth-resolver.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAQ7E,eAAO,MAAM,mBAAmB,QAAO,0BAItC,CAAC"}
1
+ {"version":3,"file":"auth-resolver.d.ts","sourceRoot":"","sources":["../../src/resolvers/auth-resolver.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AAGtF,OAAO,EAAE,kCAAkC,EAAE,MAAM,qCAAqC,CAAC;AAQzF,eAAO,MAAM,mBAAmB,WAAY,kCAAkC,KAAG,uBAIhF,CAAC"}
@@ -1,57 +1,16 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.authMappingTemplate = void 0;
4
7
  const graphql_transformer_core_1 = require("@aws-amplify/graphql-transformer-core");
5
- const ts_dedent_1 = require("ts-dedent");
6
- const authMappingTemplate = () => {
7
- const req = createAuthRequestFunction();
8
- const res = createAuthResponseFunction();
9
- return { req, res };
8
+ const fs_1 = __importDefault(require("fs"));
9
+ const path_1 = __importDefault(require("path"));
10
+ const authMappingTemplate = (config) => {
11
+ const resolver = fs_1.default.readFileSync(path_1.default.join(__dirname, 'auth-resolver-fn.template.js'), 'utf8');
12
+ const templateName = `Mutation.${config.field.name.value}.auth.js`;
13
+ return graphql_transformer_core_1.MappingTemplate.s3MappingFunctionCodeFromString(resolver, templateName);
10
14
  };
11
15
  exports.authMappingTemplate = authMappingTemplate;
12
- const createAuthRequestFunction = () => {
13
- const requestFunctionString = `
14
- export function request(ctx) {
15
- ctx.stash.hasAuth = true;
16
- const isAuthorized = false;
17
-
18
- if (util.authType() === 'User Pool Authorization') {
19
- if (!isAuthorized) {
20
- const authFilter = [];
21
- let ownerClaim0 = ctx.identity['claims']['sub'];
22
- ctx.args.owner = ownerClaim0;
23
- const currentClaim1 = ctx.identity['claims']['username'] ?? ctx.identity['claims']['cognito:username'];
24
- if (ownerClaim0 && currentClaim1) {
25
- ownerClaim0 = ownerClaim0 + '::' + currentClaim1;
26
- authFilter.push({ owner: { eq: ownerClaim0 } })
27
- }
28
- const role0_0 = ctx.identity['claims']['sub'];
29
- if (role0_0) {
30
- authFilter.push({ owner: { eq: role0_0 } });
31
- }
32
- // we can just reuse currentClaim1 here, but doing this (for now) to mirror the existing
33
- // vtl auth resolver.
34
- const role0_1 = ctx.identity['claims']['username'] ?? ctx.identity['claims']['cognito:username'];
35
- if (role0_1) {
36
- authFilter.push({ owner: { eq: role0_1 }});
37
- }
38
- if (authFilter.length !== 0) {
39
- ctx.stash.authFilter = { or: authFilter };
40
- }
41
- }
42
- }
43
- if (!isAuthorized && ctx.stash.authFilter.length === 0) {
44
- util.unauthorized();
45
- }
46
- return { version: '2018-05-29', payload: {} };
47
- }`;
48
- return graphql_transformer_core_1.MappingTemplate.inlineTemplateFromString((0, ts_dedent_1.dedent)(requestFunctionString));
49
- };
50
- const createAuthResponseFunction = () => {
51
- const responseFunctionString = `
52
- export function response(ctx) {
53
- return {};
54
- }`;
55
- return graphql_transformer_core_1.MappingTemplate.inlineTemplateFromString((0, ts_dedent_1.dedent)(responseFunctionString));
56
- };
57
16
  //# sourceMappingURL=auth-resolver.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth-resolver.js","sourceRoot":"","sources":["../../src/resolvers/auth-resolver.ts"],"names":[],"mappings":";;;AAAA,oFAAwE;AAExE,yCAAmC;AAS5B,MAAM,mBAAmB,GAAG,GAA+B,EAAE;IAClE,MAAM,GAAG,GAAG,yBAAyB,EAAE,CAAC;IACxC,MAAM,GAAG,GAAG,0BAA0B,EAAE,CAAC;IACzC,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AACtB,CAAC,CAAC;AAJW,QAAA,mBAAmB,uBAI9B;AAQF,MAAM,yBAAyB,GAAG,GAA4B,EAAE;IAC9D,MAAM,qBAAqB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAkCxB,CAAC;IAEP,OAAO,0CAAe,CAAC,wBAAwB,CAAC,IAAA,kBAAM,EAAC,qBAAqB,CAAC,CAAC,CAAC;AACjF,CAAC,CAAC;AASF,MAAM,0BAA0B,GAAG,GAA4B,EAAE;IAC/D,MAAM,sBAAsB,GAAG;;;QAGzB,CAAC;IAEP,OAAO,0CAAe,CAAC,wBAAwB,CAAC,IAAA,kBAAM,EAAC,sBAAsB,CAAC,CAAC,CAAC;AAClF,CAAC,CAAC"}
1
+ {"version":3,"file":"auth-resolver.js","sourceRoot":"","sources":["../../src/resolvers/auth-resolver.ts"],"names":[],"mappings":";;;;;;AAAA,oFAAwE;AAExE,4CAAoB;AACpB,gDAAwB;AASjB,MAAM,mBAAmB,GAAG,CAAC,MAA0C,EAA2B,EAAE;IACzG,MAAM,QAAQ,GAAG,YAAE,CAAC,YAAY,CAAC,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,8BAA8B,CAAC,EAAE,MAAM,CAAC,CAAC;IAC/F,MAAM,YAAY,GAAG,YAAY,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,UAAU,CAAC;IACnE,OAAO,0CAAe,CAAC,+BAA+B,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;AACjF,CAAC,CAAC;AAJW,QAAA,mBAAmB,uBAI9B"}
@@ -0,0 +1,16 @@
1
+ export function request(ctx) {
2
+ ctx.stash.graphqlApiEndpoint = '[[GRAPHQL_API_ENDPOINT]]';
3
+ ctx.stash.defaultValues = ctx.stash.defaultValues ?? {};
4
+ ctx.stash.defaultValues.id = util.autoId();
5
+ const createdAt = util.time.nowISO8601();
6
+ ctx.stash.defaultValues.createdAt = createdAt;
7
+ ctx.stash.defaultValues.updatedAt = createdAt;
8
+ return {
9
+ version: '2018-05-09',
10
+ payload: {},
11
+ };
12
+ }
13
+
14
+ export function response(ctx) {
15
+ return {};
16
+ }
@@ -1,3 +1,3 @@
1
- import { JSResolverFunctionProvider } from './js-resolver-function-provider';
2
- export declare const initMappingTemplate: () => JSResolverFunctionProvider;
1
+ import { MappingTemplateProvider, TransformerContextProvider } from '@aws-amplify/graphql-transformer-interfaces';
2
+ export declare const initMappingTemplate: (ctx: TransformerContextProvider) => MappingTemplateProvider;
3
3
  //# sourceMappingURL=init-resolver.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"init-resolver.d.ts","sourceRoot":"","sources":["../../src/resolvers/init-resolver.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAQ7E,eAAO,MAAM,mBAAmB,QAAO,0BAItC,CAAC"}
1
+ {"version":3,"file":"init-resolver.d.ts","sourceRoot":"","sources":["../../src/resolvers/init-resolver.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,MAAM,6CAA6C,CAAC;AAUlH,eAAO,MAAM,mBAAmB,QAAS,0BAA0B,KAAG,uBAYrE,CAAC"}
@@ -1,34 +1,22 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.initMappingTemplate = void 0;
4
7
  const graphql_transformer_core_1 = require("@aws-amplify/graphql-transformer-core");
5
- const ts_dedent_1 = require("ts-dedent");
6
- const initMappingTemplate = () => {
7
- const req = createInitRequestFunction();
8
- const res = createInitResponseFunction();
9
- return { req, res };
8
+ const fs_1 = __importDefault(require("fs"));
9
+ const path_1 = __importDefault(require("path"));
10
+ const initMappingTemplate = (ctx) => {
11
+ const substitutions = {
12
+ GRAPHQL_API_ENDPOINT: ctx.api.graphqlUrl,
13
+ };
14
+ let resolver = fs_1.default.readFileSync(path_1.default.join(__dirname, 'init-resolver-fn.template.js'), 'utf8');
15
+ Object.entries(substitutions).forEach(([key, value]) => {
16
+ const replaced = resolver.replace(new RegExp(`\\[\\[${key}\\]\\]`, 'g'), value);
17
+ resolver = replaced;
18
+ });
19
+ return graphql_transformer_core_1.MappingTemplate.inlineTemplateFromString(resolver);
10
20
  };
11
21
  exports.initMappingTemplate = initMappingTemplate;
12
- const createInitRequestFunction = () => {
13
- const requestFunctionString = `
14
- export function request(ctx) {
15
- ctx.stash.defaultValues = ctx.stash.defaultValues ?? {};
16
- ctx.stash.defaultValues.id = util.autoId();
17
- const createdAt = util.time.nowISO8601();
18
- ctx.stash.defaultValues.createdAt = createdAt;
19
- ctx.stash.defaultValues.updatedAt = createdAt;
20
- return {
21
- version: '2018-05-09',
22
- payload: {}
23
- };
24
- }`;
25
- return graphql_transformer_core_1.MappingTemplate.inlineTemplateFromString((0, ts_dedent_1.dedent)(requestFunctionString));
26
- };
27
- const createInitResponseFunction = () => {
28
- const responseFunctionString = `
29
- export function response(ctx) {
30
- return {};
31
- }`;
32
- return graphql_transformer_core_1.MappingTemplate.inlineTemplateFromString((0, ts_dedent_1.dedent)(responseFunctionString));
33
- };
34
22
  //# sourceMappingURL=init-resolver.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"init-resolver.js","sourceRoot":"","sources":["../../src/resolvers/init-resolver.ts"],"names":[],"mappings":";;;AAAA,oFAAwE;AAExE,yCAAmC;AAS5B,MAAM,mBAAmB,GAAG,GAA+B,EAAE;IAClE,MAAM,GAAG,GAAG,yBAAyB,EAAE,CAAC;IACxC,MAAM,GAAG,GAAG,0BAA0B,EAAE,CAAC;IACzC,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AACtB,CAAC,CAAC;AAJW,QAAA,mBAAmB,uBAI9B;AASF,MAAM,yBAAyB,GAAG,GAA4B,EAAE;IAC9D,MAAM,qBAAqB,GAAG;;;;;;;;;;;QAWxB,CAAC;IAEP,OAAO,0CAAe,CAAC,wBAAwB,CAAC,IAAA,kBAAM,EAAC,qBAAqB,CAAC,CAAC,CAAC;AACjF,CAAC,CAAC;AAQF,MAAM,0BAA0B,GAAG,GAA4B,EAAE;IAC/D,MAAM,sBAAsB,GAAG;;;QAGzB,CAAC;IAEP,OAAO,0CAAe,CAAC,wBAAwB,CAAC,IAAA,kBAAM,EAAC,sBAAsB,CAAC,CAAC,CAAC;AAClF,CAAC,CAAC"}
1
+ {"version":3,"file":"init-resolver.js","sourceRoot":"","sources":["../../src/resolvers/init-resolver.ts"],"names":[],"mappings":";;;;;;AAAA,oFAAwE;AAExE,4CAAoB;AACpB,gDAAwB;AAQjB,MAAM,mBAAmB,GAAG,CAAC,GAA+B,EAA2B,EAAE;IAC9F,MAAM,aAAa,GAAG;QACpB,oBAAoB,EAAE,GAAG,CAAC,GAAG,CAAC,UAAU;KACzC,CAAC;IAEF,IAAI,QAAQ,GAAG,YAAE,CAAC,YAAY,CAAC,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,8BAA8B,CAAC,EAAE,MAAM,CAAC,CAAC;IAC7F,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QACrD,MAAM,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,SAAS,GAAG,QAAQ,EAAE,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC;QAChF,QAAQ,GAAG,QAAQ,CAAC;IACtB,CAAC,CAAC,CAAC;IAEH,OAAO,0CAAe,CAAC,wBAAwB,CAAC,QAAQ,CAAC,CAAC;AAC5D,CAAC,CAAC;AAZW,QAAA,mBAAmB,uBAY9B"}
@@ -0,0 +1,66 @@
1
+ import { util } from '@aws-appsync/utils';
2
+
3
+ export function request(ctx) {
4
+ const { args, request } = ctx;
5
+ const { graphqlApiEndpoint } = ctx.stash;
6
+
7
+ [[TOOL_DEFINITIONS_LINE]]
8
+ const selectionSet = '[[SELECTION_SET]]';
9
+
10
+ const responseMutation = {
11
+ name: '[[RESPONSE_MUTATION_NAME]]',
12
+ inputTypeName: '[[RESPONSE_MUTATION_INPUT_TYPE_NAME]]',
13
+ selectionSet,
14
+ };
15
+ const currentMessageId = ctx.stash.defaultValues.id;
16
+ [[MODEL_CONFIGURATION_LINE]]
17
+
18
+ const clientTools = args.toolConfiguration?.tools?.map((tool) => {
19
+ return { ...tool.toolSpec };
20
+ });
21
+ [[TOOLS_CONFIGURATION_LINE]]
22
+
23
+ const messageHistoryQuery = {
24
+ getQueryName: '[[GET_QUERY_NAME]]',
25
+ getQueryInputTypeName: '[[GET_QUERY_INPUT_TYPE_NAME]]',
26
+ listQueryName: '[[LIST_QUERY_NAME]]',
27
+ listQueryInputTypeName: '[[LIST_QUERY_INPUT_TYPE_NAME]]',
28
+ listQueryLimit: [[LIST_QUERY_LIMIT]],
29
+ };
30
+
31
+ const authHeader = request.headers['authorization'];
32
+ const payload = {
33
+ conversationId: args.conversationId,
34
+ currentMessageId,
35
+ responseMutation,
36
+ graphqlApiEndpoint,
37
+ modelConfiguration,
38
+ request: { headers: { authorization: authHeader } },
39
+ messageHistoryQuery,
40
+ toolsConfiguration,
41
+ };
42
+
43
+ return {
44
+ operation: 'Invoke',
45
+ payload,
46
+ invocationType: 'Event',
47
+ };
48
+ }
49
+
50
+ export function response(ctx) {
51
+ if (ctx.error) {
52
+ util.appendError(ctx.error.message, ctx.error.type);
53
+ }
54
+ const response = {
55
+ __typename: '[[MESSAGE_MODEL_NAME]]',
56
+ id: ctx.stash.defaultValues.id,
57
+ conversationId: ctx.args.conversationId,
58
+ role: 'user',
59
+ content: ctx.args.content,
60
+ aiContext: ctx.args.aiContext,
61
+ toolConfiguration: ctx.args.toolConfiguration,
62
+ createdAt: ctx.stash.defaultValues.createdAt,
63
+ updatedAt: ctx.stash.defaultValues.updatedAt,
64
+ };
65
+ return response;
66
+ }
@@ -1,5 +1,4 @@
1
- import { TransformerContextProvider } from '@aws-amplify/graphql-transformer-interfaces';
1
+ import { MappingTemplateProvider } from '@aws-amplify/graphql-transformer-interfaces';
2
2
  import { ConversationDirectiveConfiguration } from '../grapqhl-conversation-transformer';
3
- import { JSResolverFunctionProvider } from './js-resolver-function-provider';
4
- export declare const invokeLambdaMappingTemplate: (config: ConversationDirectiveConfiguration, ctx: TransformerContextProvider) => JSResolverFunctionProvider;
3
+ export declare const invokeLambdaMappingTemplate: (config: ConversationDirectiveConfiguration) => MappingTemplateProvider;
5
4
  //# sourceMappingURL=invoke-lambda-resolver.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"invoke-lambda-resolver.d.ts","sourceRoot":"","sources":["../../src/resolvers/invoke-lambda-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAA2B,MAAM,6CAA6C,CAAC;AAElH,OAAO,EAAE,kCAAkC,EAAE,MAAM,qCAAqC,CAAC;AAEzF,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAS7E,eAAO,MAAM,2BAA2B,WAC9B,kCAAkC,OACrC,0BAA0B,KAC9B,0BAIF,CAAC"}
1
+ {"version":3,"file":"invoke-lambda-resolver.d.ts","sourceRoot":"","sources":["../../src/resolvers/invoke-lambda-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AAElH,OAAO,EAAE,kCAAkC,EAAE,MAAM,qCAAqC,CAAC;AAczF,eAAO,MAAM,2BAA2B,WAAY,kCAAkC,KAAG,uBAuCxF,CAAC"}
@@ -1,94 +1,67 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.invokeLambdaMappingTemplate = void 0;
4
7
  const graphql_transformer_core_1 = require("@aws-amplify/graphql-transformer-core");
5
- const ts_dedent_1 = require("ts-dedent");
6
- const invokeLambdaMappingTemplate = (config, ctx) => {
7
- const req = createInvokeLambdaRequestFunction(config, ctx);
8
- const res = createInvokeLambdaResponseFunction(config);
9
- return { req, res };
8
+ const fs_1 = __importDefault(require("fs"));
9
+ const path_1 = __importDefault(require("path"));
10
+ const ts_dedent_1 = __importDefault(require("ts-dedent"));
11
+ const graphql_transformer_common_1 = require("graphql-transformer-common");
12
+ const pluralize_1 = __importDefault(require("pluralize"));
13
+ const invokeLambdaMappingTemplate = (config) => {
14
+ const { TOOL_DEFINITIONS_LINE, TOOLS_CONFIGURATION_LINE } = generateToolLines(config);
15
+ const SELECTION_SET = selectionSet;
16
+ const MODEL_CONFIGURATION_LINE = generateModelConfigurationLine(config);
17
+ const RESPONSE_MUTATION_NAME = config.responseMutationName;
18
+ const RESPONSE_MUTATION_INPUT_TYPE_NAME = config.responseMutationInputTypeName;
19
+ const MESSAGE_MODEL_NAME = config.messageModel.messageModel.name.value;
20
+ const GET_QUERY_NAME = `getConversationMessage${(0, graphql_transformer_common_1.toUpper)(config.field.name.value)}`;
21
+ const GET_QUERY_INPUT_TYPE_NAME = 'ID';
22
+ const LIST_QUERY_NAME = `listConversationMessage${(0, graphql_transformer_common_1.toUpper)((0, pluralize_1.default)(config.field.name.value))}`;
23
+ const LIST_QUERY_INPUT_TYPE_NAME = `ModelConversationMessage${(0, graphql_transformer_common_1.toUpper)(config.field.name.value)}FilterInput`;
24
+ const LIST_QUERY_LIMIT = 'undefined';
25
+ const substitutions = {
26
+ TOOL_DEFINITIONS_LINE,
27
+ TOOLS_CONFIGURATION_LINE,
28
+ SELECTION_SET,
29
+ MODEL_CONFIGURATION_LINE,
30
+ RESPONSE_MUTATION_NAME,
31
+ RESPONSE_MUTATION_INPUT_TYPE_NAME,
32
+ MESSAGE_MODEL_NAME,
33
+ GET_QUERY_NAME,
34
+ GET_QUERY_INPUT_TYPE_NAME,
35
+ LIST_QUERY_NAME,
36
+ LIST_QUERY_INPUT_TYPE_NAME,
37
+ LIST_QUERY_LIMIT,
38
+ };
39
+ let resolver = fs_1.default.readFileSync(path_1.default.join(__dirname, 'invoke-lambda-resolver-fn.template.js'), 'utf8');
40
+ Object.entries(substitutions).forEach(([key, value]) => {
41
+ const replaced = resolver.replace(new RegExp(`\\[\\[${key}\\]\\]`, 'g'), value);
42
+ resolver = replaced;
43
+ });
44
+ const templateName = `Mutation.${config.field.name.value}.invoke-lambda.js`;
45
+ return graphql_transformer_core_1.MappingTemplate.s3MappingFunctionCodeFromString(resolver, templateName);
10
46
  };
11
47
  exports.invokeLambdaMappingTemplate = invokeLambdaMappingTemplate;
12
- const createInvokeLambdaRequestFunction = (config, ctx) => {
13
- const { responseMutationInputTypeName, responseMutationName } = config;
48
+ const generateToolLines = (config) => {
14
49
  const toolDefinitions = JSON.stringify(config.toolSpec);
15
- const toolDefinitionsLine = toolDefinitions ? `const toolDefinitions = ${toolDefinitions};` : '';
16
- const modelConfigurationLine = generateModelConfigurationLine(config);
17
- const graphqlEndpoint = ctx.api.graphqlUrl;
18
- const toolsConfigurationLine = toolDefinitions
19
- ? (0, ts_dedent_1.dedent) `const dataTools = toolDefinitions.tools;
50
+ const TOOL_DEFINITIONS_LINE = toolDefinitions ? `const toolDefinitions = ${toolDefinitions};` : '';
51
+ const TOOLS_CONFIGURATION_LINE = toolDefinitions
52
+ ? (0, ts_dedent_1.default) `const dataTools = toolDefinitions.tools;
20
53
  const toolsConfiguration = {
21
54
  dataTools,
22
55
  clientTools,
23
56
  };`
24
- : (0, ts_dedent_1.dedent) `const toolsConfiguration = {
57
+ : (0, ts_dedent_1.default) `const toolsConfiguration = {
25
58
  clientTools
26
59
  };`;
27
- const requestFunctionString = `
28
- import { util } from '@aws-appsync/utils';
29
-
30
- export function request(ctx) {
31
- const { args, identity, request, prev } = ctx;
32
- ${toolDefinitionsLine}
33
- const selectionSet = '${selectionSet}';
34
- const graphqlApiEndpoint = '${graphqlEndpoint}';
35
-
36
- const messages = prev.result.items;
37
- const responseMutation = {
38
- name: '${responseMutationName}',
39
- inputTypeName: '${responseMutationInputTypeName}',
40
- selectionSet,
41
- };
42
- const currentMessageId = ctx.stash.defaultValues.id;
43
- ${modelConfigurationLine}
44
-
45
- const clientTools = args.toolConfiguration?.tools?.map((tool) => { return { ...tool.toolSpec }});
46
- ${toolsConfigurationLine}
47
-
48
- const authHeader = request.headers['authorization'];
49
- const payload = {
50
- conversationId: args.conversationId,
51
- currentMessageId,
52
- responseMutation,
53
- graphqlApiEndpoint,
54
- modelConfiguration,
55
- request: { headers: { authorization: authHeader }},
56
- messages,
57
- toolsConfiguration,
58
- };
59
-
60
- return {
61
- operation: 'Invoke',
62
- payload,
63
- invocationType: 'Event'
64
- };
65
- }`;
66
- return graphql_transformer_core_1.MappingTemplate.inlineTemplateFromString((0, ts_dedent_1.dedent)(requestFunctionString));
67
- };
68
- const createInvokeLambdaResponseFunction = (config) => {
69
- const responseFunctionString = `
70
- export function response(ctx) {
71
- let success = true;
72
- if (ctx.error) {
73
- util.appendError(ctx.error.message, ctx.error.type);
74
- success = false;
75
- }
76
- const response = {
77
- __typename: '${config.messageModel.messageModel.name.value}',
78
- id: ctx.stash.defaultValues.id,
79
- conversationId: ctx.args.conversationId,
80
- role: 'user',
81
- content: ctx.args.content,
82
- createdAt: ctx.stash.defaultValues.createdAt,
83
- updatedAt: ctx.stash.defaultValues.updatedAt,
84
- };
85
- return response;
86
- }`;
87
- return graphql_transformer_core_1.MappingTemplate.inlineTemplateFromString((0, ts_dedent_1.dedent)(responseFunctionString));
60
+ return { TOOL_DEFINITIONS_LINE, TOOLS_CONFIGURATION_LINE };
88
61
  };
89
62
  const generateModelConfigurationLine = (config) => {
90
63
  const { aiModel, systemPrompt } = config;
91
- return (0, ts_dedent_1.dedent) `const modelConfiguration = {
64
+ return (0, ts_dedent_1.default) `const modelConfiguration = {
92
65
  modelId: '${aiModel}',
93
66
  systemPrompt: ${JSON.stringify(systemPrompt)},
94
67
  ${generateModelInferenceConfigurationLine(config)}
@@ -97,7 +70,7 @@ const generateModelConfigurationLine = (config) => {
97
70
  const generateModelInferenceConfigurationLine = (config) => {
98
71
  const { inferenceConfiguration } = config;
99
72
  return inferenceConfiguration && Object.keys(inferenceConfiguration).length > 0
100
- ? (0, ts_dedent_1.dedent) `inferenceConfiguration: ${JSON.stringify(config.inferenceConfiguration)},`
73
+ ? (0, ts_dedent_1.default) `inferenceConfiguration: ${JSON.stringify(config.inferenceConfiguration)},`
101
74
  : '';
102
75
  };
103
76
  const selectionSet = `id conversationId content { image { format source { bytes }} text toolUse { toolUseId name input } toolResult { status toolUseId content { json text image { format source { bytes }} document { format name source { bytes }} }}} role owner createdAt updatedAt`;
@@ -1 +1 @@
1
- {"version":3,"file":"invoke-lambda-resolver.js","sourceRoot":"","sources":["../../src/resolvers/invoke-lambda-resolver.ts"],"names":[],"mappings":";;;AACA,oFAAwE;AAExE,yCAAmC;AAU5B,MAAM,2BAA2B,GAAG,CACzC,MAA0C,EAC1C,GAA+B,EACH,EAAE;IAC9B,MAAM,GAAG,GAAG,iCAAiC,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3D,MAAM,GAAG,GAAG,kCAAkC,CAAC,MAAM,CAAC,CAAC;IACvD,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AACtB,CAAC,CAAC;AAPW,QAAA,2BAA2B,+BAOtC;AAUF,MAAM,iCAAiC,GAAG,CACxC,MAA0C,EAC1C,GAA+B,EACN,EAAE;IAC3B,MAAM,EAAE,6BAA6B,EAAE,oBAAoB,EAAE,GAAG,MAAM,CAAC;IACvE,MAAM,eAAe,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IACxD,MAAM,mBAAmB,GAAG,eAAe,CAAC,CAAC,CAAC,2BAA2B,eAAe,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IACjG,MAAM,sBAAsB,GAAG,8BAA8B,CAAC,MAAM,CAAC,CAAC;IACtE,MAAM,eAAe,GAAG,GA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AM,8BAA8B,GAAG,CAAC,MAA0C,EAAE,EAAE;IACpF,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,MAAM,CAAC;IAEzC,OAAO,IAAA,mBAAM,EAAA;gBACC,OAAO;oBACH,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC;MAC1C,uCAAuC,CAAC,MAAM,CAAC;KAChD,CAAC;AACN,CAAC,CAAC;AAQF,MAAM,uCAAuC,GAAG,CAAC,MAA0C,EAAE,EAAE;IAC7F,MAAM,EAAE,sBAAsB,EAAE,GAAG,MAAM,CAAC;IAC1C,OAAO,sBAAsB,IAAI,MAAM,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,MAAM,GAAG,CAAC;QAC7E,CAAC,CAAC,IAAA,mBAAM,EAAA,2BAA2B,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,sBAAsB,CAAC,GAAG;QACnF,CAAC,CAAC,EAAE,CAAC;AACT,CAAC,CAAC;AAKF,MAAM,YAAY,GAAG,mQAAmQ,CAAC"}
@@ -0,0 +1,8 @@
1
+ export function request(ctx) {
2
+ ctx.stash.metadata.index = 'gsi-ConversationMessage.conversationId.createdAt';
3
+ return {};
4
+ }
5
+
6
+ export function response(ctx) {
7
+ return {};
8
+ }