@reventlessdev/reventless-aws 3.0.0-alpha.167
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1564 -0
- package/README.md +62 -0
- package/__mocks__/emptyModule.js +1 -0
- package/all-licenses.csv +565 -0
- package/docker-compose.dynamodb-local.yml +12 -0
- package/jest.setup.cjs +5 -0
- package/licenses-analysis.ods +0 -0
- package/package.json +73 -0
- package/rescript.json +39 -0
- package/reventless-licenses-analysis.xls +0 -0
- package/scripts/run-integration-tests.sh +43 -0
- package/src/Platform.res +1940 -0
- package/src/Platform.res.mjs +2281 -0
- package/src/Platform_Casts.res +106 -0
- package/src/Platform_Casts.res.mjs +13 -0
- package/src/Platform_Stack.res +153 -0
- package/src/Platform_Stack.res.mjs +121 -0
- package/src/Types.res +39 -0
- package/src/Types.res.mjs +21 -0
- package/src/adapter/AWS.res +96 -0
- package/src/adapter/AWS.res.mjs +186 -0
- package/src/adapter/AWS_Tags.res +16 -0
- package/src/adapter/AWS_Tags.res.mjs +48 -0
- package/src/adapter/Adapter_Helpers.res +19 -0
- package/src/adapter/Adapter_Helpers.res.mjs +37 -0
- package/src/adapter/Api/AppSync_EventsApi.res +172 -0
- package/src/adapter/Api/AppSync_EventsApi.res.mjs +96 -0
- package/src/adapter/Api/AppSync_Resolver_Native.res +93 -0
- package/src/adapter/Api/AppSync_Resolver_Native.res.mjs +67 -0
- package/src/adapter/Api/AppSync_Resolver_Retrying.res +653 -0
- package/src/adapter/Api/AppSync_Resolver_Retrying.res.mjs +462 -0
- package/src/adapter/Api/CommandSubscriptionResolvers_AppSync.res +29 -0
- package/src/adapter/Api/CommandSubscriptionResolvers_AppSync.res.mjs +15 -0
- package/src/adapter/Api/Platform_ComponentDefinitions_Lambda.res +238 -0
- package/src/adapter/Api/Platform_ComponentDefinitions_Lambda.res.mjs +179 -0
- package/src/adapter/Api/Platform_UIFragments_Lambda.res +229 -0
- package/src/adapter/Api/Platform_UIFragments_Lambda.res.mjs +245 -0
- package/src/adapter/Auth/Auth_Cognito.res +209 -0
- package/src/adapter/Auth/Auth_Cognito.res.mjs +135 -0
- package/src/adapter/CommandGenerator/CommandGeneratorResolvers.res +2 -0
- package/src/adapter/CommandGenerator/CommandGeneratorResolvers.res.mjs +12 -0
- package/src/adapter/CommandGenerator/CommandGeneratorResolvers_AppSync.res +251 -0
- package/src/adapter/CommandGenerator/CommandGeneratorResolvers_AppSync.res.mjs +126 -0
- package/src/adapter/CommandGenerator/CommandGeneratorResolvers_AppSync_NoOp.res +20 -0
- package/src/adapter/CommandGenerator/CommandGeneratorResolvers_AppSync_NoOp.res.mjs +23 -0
- package/src/adapter/CommandGenerator/CommandGeneratorResolvers_AppSync_Runtime.res +1 -0
- package/src/adapter/CommandGenerator/CommandGeneratorResolvers_AppSync_Runtime.res.mjs +11 -0
- package/src/adapter/CommandGenerator/InboundTranslationResolvers_AppSync.res +95 -0
- package/src/adapter/CommandGenerator/InboundTranslationResolvers_AppSync.res.mjs +50 -0
- package/src/adapter/CommandTopic/CommandTopicChannel.res +6 -0
- package/src/adapter/CommandTopic/CommandTopicChannel.res.mjs +21 -0
- package/src/adapter/CommandTopic/CommandTopicChannel_Helpers.res +196 -0
- package/src/adapter/CommandTopic/CommandTopicChannel_Helpers.res.mjs +145 -0
- package/src/adapter/CommandTopic/CommandTopicChannel_SQS.res +91 -0
- package/src/adapter/CommandTopic/CommandTopicChannel_SQS.res.mjs +74 -0
- package/src/adapter/CommandTopic/CommandTopicChannel_SQS_Async.res +69 -0
- package/src/adapter/CommandTopic/CommandTopicChannel_SQS_Async.res.mjs +62 -0
- package/src/adapter/CommandTopic/CommandTopicChannel_SQS_FIFO.res +60 -0
- package/src/adapter/CommandTopic/CommandTopicChannel_SQS_FIFO.res.mjs +56 -0
- package/src/adapter/CommandTopic/CommandTopicChannel_SQS_Runtime.res +73 -0
- package/src/adapter/CommandTopic/CommandTopicChannel_SQS_Runtime.res.mjs +65 -0
- package/src/adapter/CommandTopic/CommandTopicChannel_SQS_Sync.res +88 -0
- package/src/adapter/CommandTopic/CommandTopicChannel_SQS_Sync.res.mjs +76 -0
- package/src/adapter/CommandTopic/CommandTopicRemoteChannel.res +1 -0
- package/src/adapter/CommandTopic/CommandTopicRemoteChannel.res.mjs +9 -0
- package/src/adapter/CommandTopic/CommandTopicRemoteChannel_SQS.res +7 -0
- package/src/adapter/CommandTopic/CommandTopicRemoteChannel_SQS.res.mjs +17 -0
- package/src/adapter/Counter/CounterHandler_DynamoDbStream.res +103 -0
- package/src/adapter/Counter/CounterHandler_DynamoDbStream.res.mjs +68 -0
- package/src/adapter/Counter/CounterHandler_DynamoDbStream_Runtime.res +107 -0
- package/src/adapter/Counter/CounterHandler_DynamoDbStream_Runtime.res.mjs +145 -0
- package/src/adapter/DcbEventLog/DcbEventLogStorage.res +1 -0
- package/src/adapter/DcbEventLog/DcbEventLogStorage.res.mjs +9 -0
- package/src/adapter/DcbEventLog/DcbEventLogStorage_DynamoDb.res +84 -0
- package/src/adapter/DcbEventLog/DcbEventLogStorage_DynamoDb.res.mjs +52 -0
- package/src/adapter/DcbEventLog/DcbEventLogStorage_DynamoDb_Runtime.res +1436 -0
- package/src/adapter/DcbEventLog/DcbEventLogStorage_DynamoDb_Runtime.res.mjs +1143 -0
- package/src/adapter/EventCollector/EventCollectorChannel.res +6 -0
- package/src/adapter/EventCollector/EventCollectorChannel.res.mjs +21 -0
- package/src/adapter/EventCollector/EventCollectorChannel_DynamoDbStream.res +63 -0
- package/src/adapter/EventCollector/EventCollectorChannel_DynamoDbStream.res.mjs +56 -0
- package/src/adapter/EventCollector/EventCollectorChannel_DynamoDbStream_Runtime.res +20 -0
- package/src/adapter/EventCollector/EventCollectorChannel_DynamoDbStream_Runtime.res.mjs +32 -0
- package/src/adapter/EventCollector/EventCollectorChannel_Helpers.res +266 -0
- package/src/adapter/EventCollector/EventCollectorChannel_Helpers.res.mjs +166 -0
- package/src/adapter/EventCollector/EventCollectorChannel_SQS.res +81 -0
- package/src/adapter/EventCollector/EventCollectorChannel_SQS.res.mjs +54 -0
- package/src/adapter/EventCollector/EventCollectorChannel_SQS_FIFO.res +59 -0
- package/src/adapter/EventCollector/EventCollectorChannel_SQS_FIFO.res.mjs +45 -0
- package/src/adapter/EventCollector/EventCollectorChannel_SQS_Runtime.res +91 -0
- package/src/adapter/EventCollector/EventCollectorChannel_SQS_Runtime.res.mjs +89 -0
- package/src/adapter/EventLog/EventLogStorage.res +3 -0
- package/src/adapter/EventLog/EventLogStorage.res.mjs +15 -0
- package/src/adapter/EventLog/EventLogStorage_DynamoDb.res +25 -0
- package/src/adapter/EventLog/EventLogStorage_DynamoDb.res.mjs +34 -0
- package/src/adapter/EventLog/EventLogStorage_DynamoDbStream.res +26 -0
- package/src/adapter/EventLog/EventLogStorage_DynamoDbStream.res.mjs +35 -0
- package/src/adapter/EventLog/EventLogStorage_DynamoDb_Runtime.res +121 -0
- package/src/adapter/EventLog/EventLogStorage_DynamoDb_Runtime.res.mjs +137 -0
- package/src/adapter/EventLogSubscription/EventLogSubscription_AppSync.res +265 -0
- package/src/adapter/EventLogSubscription/EventLogSubscription_AppSync.res.mjs +185 -0
- package/src/adapter/EventTopic/EventTopicPublisher.res +6 -0
- package/src/adapter/EventTopic/EventTopicPublisher.res.mjs +21 -0
- package/src/adapter/EventTopic/EventTopicPublisher_DynamoDbStream.res +25 -0
- package/src/adapter/EventTopic/EventTopicPublisher_DynamoDbStream.res.mjs +28 -0
- package/src/adapter/EventTopic/EventTopicPublisher_SNS.res +40 -0
- package/src/adapter/EventTopic/EventTopicPublisher_SNS.res.mjs +39 -0
- package/src/adapter/EventTopic/EventTopicPublisher_SNS_FIFO.res +39 -0
- package/src/adapter/EventTopic/EventTopicPublisher_SNS_FIFO.res.mjs +38 -0
- package/src/adapter/EventTopic/EventTopicPublisher_SNS_Runtime.res +5 -0
- package/src/adapter/EventTopic/EventTopicPublisher_SNS_Runtime.res.mjs +18 -0
- package/src/adapter/Mcp/MCP_Lambda.res +502 -0
- package/src/adapter/Mcp/MCP_Lambda.res.mjs +289 -0
- package/src/adapter/QueryDb/NodeResolver_AppSync.res +71 -0
- package/src/adapter/QueryDb/NodeResolver_AppSync.res.mjs +44 -0
- package/src/adapter/QueryDb/QueryDbResolvers.res +2 -0
- package/src/adapter/QueryDb/QueryDbResolvers.res.mjs +12 -0
- package/src/adapter/QueryDb/QueryDbResolvers_AppSync.res +434 -0
- package/src/adapter/QueryDb/QueryDbResolvers_AppSync.res.mjs +243 -0
- package/src/adapter/QueryDb/QueryDbResolvers_AppSync_NoOp.res +21 -0
- package/src/adapter/QueryDb/QueryDbResolvers_AppSync_NoOp.res.mjs +14 -0
- package/src/adapter/QueryDb/QueryDbResolvers_NoOp.res +21 -0
- package/src/adapter/QueryDb/QueryDbResolvers_NoOp.res.mjs +14 -0
- package/src/adapter/QueryDb/QueryDbStorage.res +5 -0
- package/src/adapter/QueryDb/QueryDbStorage.res.mjs +18 -0
- package/src/adapter/QueryDb/QueryDbStorage_DynamoDb.res +115 -0
- package/src/adapter/QueryDb/QueryDbStorage_DynamoDb.res.mjs +100 -0
- package/src/adapter/QueryDb/QueryDbStorage_DynamoDbStream.res +52 -0
- package/src/adapter/QueryDb/QueryDbStorage_DynamoDbStream.res.mjs +38 -0
- package/src/adapter/QueryDb/QueryDbStorage_DynamoDb_Runtime.res +271 -0
- package/src/adapter/QueryDb/QueryDbStorage_DynamoDb_Runtime.res.mjs +306 -0
- package/src/adapter/QueryDb/QueryInterceptor_Lambda.res +20 -0
- package/src/adapter/QueryDb/QueryInterceptor_Lambda.res.mjs +22 -0
- package/src/adapter/QueryEngine/QueryEngine.res +3 -0
- package/src/adapter/QueryEngine/QueryEngine.res.mjs +12 -0
- package/src/adapter/QueryEngine/QueryEngine_DynamoDb.res +184 -0
- package/src/adapter/QueryEngine/QueryEngine_DynamoDb.res.mjs +221 -0
- package/src/adapter/Runtime/AdminEventCollectorEntryPoint.mjs +879 -0
- package/src/adapter/Runtime/AggregateEntryPoint.mjs +313 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_Micro.res +327 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_Micro.res.mjs +239 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_Micro_Async.res +331 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_Micro_Async.res.mjs +240 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_PerAggregate.res +247 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_PerAggregate.res.mjs +185 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_PerAggregate_Async.res +244 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_PerAggregate_Async.res.mjs +185 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_Single.res +347 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_Single.res.mjs +244 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_Single_Async.res +285 -0
- package/src/adapter/Runtime/AggregateRuntime_Builder_Single_Async.res.mjs +212 -0
- package/src/adapter/Runtime/AutomationSliceEntryPoint.mjs +124 -0
- package/src/adapter/Runtime/AutomationSliceRuntime_Builder_Single.res +187 -0
- package/src/adapter/Runtime/AutomationSliceRuntime_Builder_Single.res.mjs +147 -0
- package/src/adapter/Runtime/CounterEntryPoint.mjs +91 -0
- package/src/adapter/Runtime/DcbCommandTopicEntryPoint.mjs +265 -0
- package/src/adapter/Runtime/EventCollectorRuntime_Builder_PerEventCollector.res +122 -0
- package/src/adapter/Runtime/EventCollectorRuntime_Builder_PerEventCollector.res.mjs +89 -0
- package/src/adapter/Runtime/EventCollectorRuntime_Builder_Single.res +193 -0
- package/src/adapter/Runtime/EventCollectorRuntime_Builder_Single.res.mjs +137 -0
- package/src/adapter/Runtime/EventMapperEntryPoint.mjs +97 -0
- package/src/adapter/Runtime/ExtensionPointEntryPoint.mjs +101 -0
- package/src/adapter/Runtime/ExtensionPointRuntime_Builder_PerExtensionPoint.res +83 -0
- package/src/adapter/Runtime/ExtensionPointRuntime_Builder_PerExtensionPoint.res.mjs +59 -0
- package/src/adapter/Runtime/HandlerFactoryHelpers.mjs +142 -0
- package/src/adapter/Runtime/HeartbeatEntryPoint.mjs +38 -0
- package/src/adapter/Runtime/PluginExtensionPointEntryPoint.mjs +137 -0
- package/src/adapter/Runtime/ReadModelEntryPoint.mjs +143 -0
- package/src/adapter/Runtime/RuntimeEnvironment.res +1 -0
- package/src/adapter/Runtime/RuntimeEnvironment.res.mjs +9 -0
- package/src/adapter/Runtime/RuntimeEnvironment_Lambda.res +254 -0
- package/src/adapter/Runtime/RuntimeEnvironment_Lambda.res.mjs +169 -0
- package/src/adapter/Runtime/SideEffectEntryPoint.mjs +81 -0
- package/src/adapter/Runtime/SideEffectHandlerRuntime_Builder_Single.res +178 -0
- package/src/adapter/Runtime/SideEffectHandlerRuntime_Builder_Single.res.mjs +129 -0
- package/src/adapter/Runtime/StateChangeSliceRuntime_Builder_Single.res +166 -0
- package/src/adapter/Runtime/StateChangeSliceRuntime_Builder_Single.res.mjs +87 -0
- package/src/adapter/Runtime/StateViewSliceEntryPoint.mjs +136 -0
- package/src/adapter/Runtime/StateViewSliceRuntime_Builder_Single.res +344 -0
- package/src/adapter/Runtime/StateViewSliceRuntime_Builder_Single.res.mjs +242 -0
- package/src/adapter/Runtime/TaskBucketEntryPoint.mjs +150 -0
- package/src/adapter/Runtime/TaskRuntime_Builder_PerBucket.res +123 -0
- package/src/adapter/Runtime/TaskRuntime_Builder_PerBucket.res.mjs +74 -0
- package/src/adapter/ScheduledPublisher/ScheduledPublisher.res +2 -0
- package/src/adapter/ScheduledPublisher/ScheduledPublisher.res.mjs +12 -0
- package/src/adapter/ScheduledPublisher/ScheduledPublisher_CloudWatchEvents.res +54 -0
- package/src/adapter/ScheduledPublisher/ScheduledPublisher_CloudWatchEvents.res.mjs +41 -0
- package/src/adapter/ScheduledPublisher/ScheduledPublisher_CloudWatchEvents_Runtime.res +97 -0
- package/src/adapter/ScheduledPublisher/ScheduledPublisher_CloudWatchEvents_Runtime.res.mjs +85 -0
- package/src/adapter/StateTopic/StateTopic_AppSync.res +418 -0
- package/src/adapter/StateTopic/StateTopic_AppSync.res.mjs +295 -0
- package/src/adapter/Task/TaskBucket.res +1 -0
- package/src/adapter/Task/TaskBucket.res.mjs +9 -0
- package/src/adapter/Task/TaskBucket_S3.res +157 -0
- package/src/adapter/Task/TaskBucket_S3.res.mjs +108 -0
- package/src/adapter/Task/TaskBucket_S3_Runtime.res +11 -0
- package/src/adapter/Task/TaskBucket_S3_Runtime.res.mjs +15 -0
- package/src/components/Aggregate_Builder.res +1 -0
- package/src/components/Aggregate_Builder.res.mjs +25 -0
- package/src/components/Aggregate_Builder_Micro.res +63 -0
- package/src/components/Aggregate_Builder_Micro.res.mjs +80 -0
- package/src/components/Aggregate_Builder_NoResolver.res +61 -0
- package/src/components/Aggregate_Builder_NoResolver.res.mjs +80 -0
- package/src/components/Aggregate_Builder_PerAggregate.res +57 -0
- package/src/components/Aggregate_Builder_PerAggregate.res.mjs +80 -0
- package/src/components/Aggregate_Builder_Single.res +59 -0
- package/src/components/Aggregate_Builder_Single.res.mjs +80 -0
- package/src/components/Aggregate_Builder_Single_Async.res +59 -0
- package/src/components/Aggregate_Builder_Single_Async.res.mjs +80 -0
- package/src/components/Api/AppSync_Adapter.res +500 -0
- package/src/components/Api/AppSync_Adapter.res.mjs +396 -0
- package/src/components/AutomationSlice_Builder.res +52 -0
- package/src/components/AutomationSlice_Builder.res.mjs +72 -0
- package/src/components/AutomationSlice_Builder_Bundled.res.mjs +70 -0
- package/src/components/Counter_Builder.res +10 -0
- package/src/components/Counter_Builder.res.mjs +16 -0
- package/src/components/DataCleaner.res +170 -0
- package/src/components/DataCleaner.res.mjs +2 -0
- package/src/components/DcbEventLog_Builder.res +8 -0
- package/src/components/DcbEventLog_Builder.res.mjs +14 -0
- package/src/components/ExtensionPoint_Builder.res +16 -0
- package/src/components/ExtensionPoint_Builder.res.mjs +37 -0
- package/src/components/ForeignReadModel_Builder.res +19 -0
- package/src/components/ForeignReadModel_Builder.res.mjs +48 -0
- package/src/components/InboundTranslationSlice_Builder.res +25 -0
- package/src/components/InboundTranslationSlice_Builder.res.mjs +31 -0
- package/src/components/OutboundTranslationSlice_Builder.res +60 -0
- package/src/components/OutboundTranslationSlice_Builder.res.mjs +76 -0
- package/src/components/OutboundTranslationSlice_Builder_Bundled.res.mjs +75 -0
- package/src/components/Plugin.res +29 -0
- package/src/components/Plugin.res.mjs +63 -0
- package/src/components/ReadModel_Builder.res +1 -0
- package/src/components/ReadModel_Builder.res.mjs +19 -0
- package/src/components/ReadModel_Builder_NoResolver.res +55 -0
- package/src/components/ReadModel_Builder_NoResolver.res.mjs +64 -0
- package/src/components/ReadModel_Builder_NoResolver_Stream.res +60 -0
- package/src/components/ReadModel_Builder_NoResolver_Stream.res.mjs +64 -0
- package/src/components/ReadModel_Builder_PerReadModel.res +53 -0
- package/src/components/ReadModel_Builder_PerReadModel.res.mjs +66 -0
- package/src/components/ReadModel_Builder_Single.res +52 -0
- package/src/components/ReadModel_Builder_Single.res.mjs +66 -0
- package/src/components/ReadModel_Builder_Single_Stream.res +60 -0
- package/src/components/ReadModel_Builder_Single_Stream.res.mjs +66 -0
- package/src/components/Scheduler.res +1 -0
- package/src/components/Scheduler.res.mjs +13 -0
- package/src/components/SideEffectHandler.res +1 -0
- package/src/components/SideEffectHandler.res.mjs +19 -0
- package/src/components/SideEffectHandler_PerSideEffectHandler.res +13 -0
- package/src/components/SideEffectHandler_PerSideEffectHandler.res.mjs +52 -0
- package/src/components/SideEffectHandler_Single.res +54 -0
- package/src/components/SideEffectHandler_Single.res.mjs +60 -0
- package/src/components/StateChangeSlice_Builder.res +17 -0
- package/src/components/StateChangeSlice_Builder.res.mjs +23 -0
- package/src/components/StateViewSlice_Builder.res +46 -0
- package/src/components/StateViewSlice_Builder.res.mjs +68 -0
- package/src/components/StateViewSlice_Builder_Bundled.res.mjs +69 -0
- package/src/components/StateViewSlice_Builder_Stream.res +50 -0
- package/src/components/StateViewSlice_Builder_Stream.res.mjs +68 -0
- package/src/components/Task_Builder.res +1 -0
- package/src/components/Task_Builder.res.mjs +28 -0
- package/src/components/Task_Builder_PerBucket.res +22 -0
- package/src/components/Task_Builder_PerBucket.res.mjs +63 -0
- package/src/components/Vpc.res +214 -0
- package/src/components/Vpc.res.mjs +117 -0
- package/src/components/Vpc.resi +22 -0
- package/src/errors/AppSync_Error.res +36 -0
- package/src/errors/AppSync_Error.res.mjs +38 -0
- package/src/errors/Cognito_Error.res +36 -0
- package/src/errors/Cognito_Error.res.mjs +38 -0
- package/src/errors/DynamoDb_Error.res +75 -0
- package/src/errors/DynamoDb_Error.res.mjs +86 -0
- package/src/errors/Kinesis_Error.res +36 -0
- package/src/errors/Kinesis_Error.res.mjs +38 -0
- package/src/errors/SNS_Error.res +34 -0
- package/src/errors/SNS_Error.res.mjs +38 -0
- package/src/errors/SQS_Error.res +40 -0
- package/src/errors/SQS_Error.res.mjs +41 -0
- package/src/plugin/cloner/ClonerRunner.res +1 -0
- package/src/plugin/cloner/ClonerRunner.res.mjs +9 -0
- package/src/plugin/cloner/ClonerRunner_Fargate.res +362 -0
- package/src/plugin/cloner/ClonerRunner_Fargate.res.mjs +246 -0
- package/src/plugin/cloner/ClonerRunner_Fargate_Runtime.res +42 -0
- package/src/plugin/cloner/ClonerRunner_Fargate_Runtime.res.mjs +45 -0
- package/src/plugin/heartbeat/HeartbeatRunner.res +1 -0
- package/src/plugin/heartbeat/HeartbeatRunner.res.mjs +9 -0
- package/src/plugin/heartbeat/HeartbeatRunner_CloudWatchEvents.res +96 -0
- package/src/plugin/heartbeat/HeartbeatRunner_CloudWatchEvents.res.mjs +69 -0
- package/src/plugin/runtime/PluginExtensionPointRuntime_Builder.res +115 -0
- package/src/plugin/runtime/PluginExtensionPointRuntime_Builder.res.mjs +88 -0
- package/src/plugin/runtime/PluginRuntimeOperations.res +5 -0
- package/src/plugin/runtime/PluginRuntimeOperations.res.mjs +14 -0
- package/src/plugin/runtime/PluginRuntime_Builder.res +769 -0
- package/src/plugin/runtime/PluginRuntime_Builder.res.mjs +464 -0
- package/src/plugin/runtime/Util_PluginMessage_Runtime.res +13 -0
- package/src/plugin/runtime/Util_PluginMessage_Runtime.res.mjs +19 -0
- package/src/plugin/stack/Plugin_ExtensionPoint_Builder.res +28 -0
- package/src/plugin/stack/Plugin_ExtensionPoint_Builder.res.mjs +67 -0
- package/src/plugin/stack/Plugin_Stack.res +439 -0
- package/src/plugin/stack/Plugin_Stack.res.mjs +263 -0
- package/src/util/Util.res +29 -0
- package/src/util/Util.res.mjs +93 -0
- package/src/util/Util_AppSync.res +36 -0
- package/src/util/Util_AppSync.res.mjs +35 -0
- package/src/util/Util_AppSync_Caller.res +213 -0
- package/src/util/Util_AppSync_Caller.res.mjs +170 -0
- package/src/util/Util_Bundle.res +255 -0
- package/src/util/Util_Bundle.res.mjs +179 -0
- package/src/util/Util_Cloudwatch.res +14 -0
- package/src/util/Util_Cloudwatch.res.mjs +19 -0
- package/src/util/Util_CognitoGroupUser.res +39 -0
- package/src/util/Util_CognitoGroupUser.res.mjs +32 -0
- package/src/util/Util_CognitoGroupUser_Runtime.res +65 -0
- package/src/util/Util_CognitoGroupUser_Runtime.res.mjs +50 -0
- package/src/util/Util_Cognito_Runtime.res +52 -0
- package/src/util/Util_Cognito_Runtime.res.mjs +35 -0
- package/src/util/Util_DeadLetterQueue.res +154 -0
- package/src/util/Util_DeadLetterQueue.res.mjs +158 -0
- package/src/util/Util_DynamoDb.res +210 -0
- package/src/util/Util_DynamoDb.res.mjs +218 -0
- package/src/util/Util_DynamoDbStream.res +138 -0
- package/src/util/Util_DynamoDbStream.res.mjs +134 -0
- package/src/util/Util_DynamoDbStream_Runtime.res +94 -0
- package/src/util/Util_DynamoDbStream_Runtime.res.mjs +131 -0
- package/src/util/Util_DynamoDb_Runtime.res +216 -0
- package/src/util/Util_DynamoDb_Runtime.res.mjs +257 -0
- package/src/util/Util_DynamoDb_TableManager.res +23 -0
- package/src/util/Util_DynamoDb_TableManager.res.mjs +35 -0
- package/src/util/Util_DynamoDb_TableManager.resi +3 -0
- package/src/util/Util_Env.res +5 -0
- package/src/util/Util_Env.res.mjs +2 -0
- package/src/util/Util_EventSourceMapping.res +49 -0
- package/src/util/Util_EventSourceMapping.res.mjs +32 -0
- package/src/util/Util_HostUiDomain.res +28 -0
- package/src/util/Util_HostUiDomain.res.mjs +26 -0
- package/src/util/Util_IAM_Role.res +14 -0
- package/src/util/Util_IAM_Role.res.mjs +28 -0
- package/src/util/Util_Kinesis_Runtime.res +20 -0
- package/src/util/Util_Kinesis_Runtime.res.mjs +24 -0
- package/src/util/Util_Lambda.res +39 -0
- package/src/util/Util_Lambda.res.mjs +45 -0
- package/src/util/Util_LocalConfig.res +119 -0
- package/src/util/Util_LocalConfig.res.mjs +112 -0
- package/src/util/Util_ResourceNaming.res +15 -0
- package/src/util/Util_ResourceNaming.res.mjs +26 -0
- package/src/util/Util_S3.res +17 -0
- package/src/util/Util_S3.res.mjs +30 -0
- package/src/util/Util_S3_Runtime.res +11 -0
- package/src/util/Util_S3_Runtime.res.mjs +15 -0
- package/src/util/Util_SNS.res +33 -0
- package/src/util/Util_SNS.res.mjs +50 -0
- package/src/util/Util_SNS_FIFO.res +21 -0
- package/src/util/Util_SNS_FIFO.res.mjs +27 -0
- package/src/util/Util_SNS_Runtime.res +33 -0
- package/src/util/Util_SNS_Runtime.res.mjs +27 -0
- package/src/util/Util_SQS.res +70 -0
- package/src/util/Util_SQS.res.mjs +83 -0
- package/src/util/Util_SQS_FIFO.res +16 -0
- package/src/util/Util_SQS_FIFO.res.mjs +28 -0
- package/src/util/Util_SQS_Runtime.res +169 -0
- package/src/util/Util_SQS_Runtime.res.mjs +150 -0
- package/src/util/Util_SesPolicy_Runtime.res +54 -0
- package/src/util/Util_SesPolicy_Runtime.res.mjs +55 -0
- package/src/util/Util_StaticBundle.res +124 -0
- package/src/util/Util_StaticBundle.res.mjs +132 -0
- package/src/util/Util_Vpc.res +22 -0
- package/src/util/Util_Vpc.res.mjs +27 -0
- package/tests/AppSync_AdapterTest.res +396 -0
- package/tests/AppSync_AdapterTest.res.mjs +326 -0
- package/tests/AppSync_Resolver_RetryingTest.res +59 -0
- package/tests/AppSync_Resolver_RetryingTest.res.mjs +66 -0
- package/tests/Auth_CognitoTest.res +203 -0
- package/tests/Auth_CognitoTest.res.mjs +248 -0
- package/tests/DcbEventLogStorage_DynamoDb_RuntimeTest.res +602 -0
- package/tests/DcbEventLogStorage_DynamoDb_RuntimeTest.res.mjs +742 -0
- package/tests/EventLogStorage_DynamoDb_RuntimeTest.res +57 -0
- package/tests/EventLogStorage_DynamoDb_RuntimeTest.res.mjs +68 -0
- package/tests/MCP_LambdaTest.res +101 -0
- package/tests/MCP_LambdaTest.res.mjs +56 -0
- package/tests/Util_HostUiDomainTest.res +90 -0
- package/tests/Util_HostUiDomainTest.res.mjs +50 -0
- package/tests/Util_SQS_RuntimeTest.res +46 -0
- package/tests/Util_SQS_RuntimeTest.res.mjs +45 -0
- package/tests/Util_StaticBundleTest.res +136 -0
- package/tests/Util_StaticBundleTest.res.mjs +149 -0
- package/tests/integration/DcbCommandTopicEntryPoint_IntegrationTest.res +101 -0
- package/tests/integration/DcbCommandTopicEntryPoint_IntegrationTest.res.mjs +91 -0
- package/tests/integration/DcbEventLogStorage_DynamoDb_IntegrationTest.res +315 -0
- package/tests/integration/DcbEventLogStorage_DynamoDb_IntegrationTest.res.mjs +435 -0
- package/tests/integration/DcbIntegrationHarness.res +102 -0
- package/tests/integration/DcbIntegrationHarness.res.mjs +163 -0
- package/tests/integration/EpTestSlice.res +28 -0
- package/tests/integration/EpTestSlice.res.mjs +43 -0
- package/tests/integration/EpTestSliceBehavior.res +18 -0
- package/tests/integration/EpTestSliceBehavior.res.mjs +35 -0
|
@@ -0,0 +1,462 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Alias$Pulumi from "@reventlessdev/rescript-pulumi-pulumi/src/Alias.res.mjs";
|
|
4
|
+
import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.js";
|
|
5
|
+
import * as Stdlib_JsExn from "@rescript/runtime/lib/es6/Stdlib_JsExn.js";
|
|
6
|
+
import * as Output$Pulumi from "@reventlessdev/rescript-pulumi-pulumi/src/Output.res.mjs";
|
|
7
|
+
import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
8
|
+
import * as Pulumi from "@pulumi/pulumi";
|
|
9
|
+
import * as Primitive_object from "@rescript/runtime/lib/es6/Primitive_object.js";
|
|
10
|
+
import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js";
|
|
11
|
+
import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.js";
|
|
12
|
+
import * as Logger$ReventlessCore from "@reventlessdev/reventless-core/src/util/Logger.res.mjs";
|
|
13
|
+
import * as IndexJs from "@pulumi/pulumi/dynamic/index.js";
|
|
14
|
+
|
|
15
|
+
let log = Logger$ReventlessCore.fromEnv();
|
|
16
|
+
|
|
17
|
+
let appsyncJsRuntime = {
|
|
18
|
+
name: "APPSYNC_JS",
|
|
19
|
+
runtimeVersion: "1.0.0"
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
let newOf1 = ((C, x) => new C(x));
|
|
23
|
+
|
|
24
|
+
let newOf0 = ((C) => new C());
|
|
25
|
+
|
|
26
|
+
let _sdk = {
|
|
27
|
+
contents: undefined
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
let _client = {
|
|
31
|
+
contents: undefined
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
async function getSdk() {
|
|
35
|
+
let m = _sdk.contents;
|
|
36
|
+
if (m !== undefined) {
|
|
37
|
+
return m;
|
|
38
|
+
}
|
|
39
|
+
let m$1 = await import("@aws-sdk/client-appsync");
|
|
40
|
+
_sdk.contents = m$1;
|
|
41
|
+
return m$1;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
async function getClient() {
|
|
45
|
+
let c = _client.contents;
|
|
46
|
+
if (c !== undefined) {
|
|
47
|
+
return Primitive_option.valFromOption(c);
|
|
48
|
+
}
|
|
49
|
+
let sdk = await getSdk();
|
|
50
|
+
let c$1 = newOf0(sdk.AppSyncClient);
|
|
51
|
+
_client.contents = Primitive_option.some(c$1);
|
|
52
|
+
return c$1;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function isFieldNotFoundError(jsErr) {
|
|
56
|
+
let match = jsErr.name;
|
|
57
|
+
let match$1 = Stdlib_JsExn.message(jsErr);
|
|
58
|
+
if ((match == null) || match !== "NotFoundException" || match$1 === undefined) {
|
|
59
|
+
return false;
|
|
60
|
+
} else {
|
|
61
|
+
return match$1.includes("No field named");
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function isAlreadyDeletedError(jsErr) {
|
|
66
|
+
let match = jsErr.name;
|
|
67
|
+
let match$1 = Stdlib_JsExn.message(jsErr);
|
|
68
|
+
if ((match == null) || match !== "NotFoundException" || match$1 === undefined) {
|
|
69
|
+
return false;
|
|
70
|
+
} else if (match$1.includes("API not found") || match$1.includes("No resolver found")) {
|
|
71
|
+
return true;
|
|
72
|
+
} else {
|
|
73
|
+
return match$1.includes("Type not found");
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function isAlreadyExistsError(jsErr) {
|
|
78
|
+
let match = jsErr.name;
|
|
79
|
+
let match$1 = Stdlib_JsExn.message(jsErr);
|
|
80
|
+
if ((match == null) || match !== "BadRequestException" || match$1 === undefined) {
|
|
81
|
+
return false;
|
|
82
|
+
} else {
|
|
83
|
+
return match$1.includes("Only one resolver is allowed");
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function isSchemaAlteringError(jsErr) {
|
|
88
|
+
let match = jsErr.name;
|
|
89
|
+
let match$1 = Stdlib_JsExn.message(jsErr);
|
|
90
|
+
if ((match == null) || match !== "ConcurrentModificationException" || match$1 === undefined) {
|
|
91
|
+
return false;
|
|
92
|
+
} else {
|
|
93
|
+
return match$1.includes("Schema is currently being altered");
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
let jsThrow = (e => { throw e });
|
|
98
|
+
|
|
99
|
+
async function runWithRaceRetry(attemptOpt, maxAttemptsOpt, delayMsOpt, maxDelayMsOpt, makeCall) {
|
|
100
|
+
let attempt = attemptOpt !== undefined ? attemptOpt : 0;
|
|
101
|
+
let maxAttempts = maxAttemptsOpt !== undefined ? maxAttemptsOpt : 8;
|
|
102
|
+
let delayMs = delayMsOpt !== undefined ? delayMsOpt : 2000;
|
|
103
|
+
let maxDelayMs = maxDelayMsOpt !== undefined ? maxDelayMsOpt : 30000;
|
|
104
|
+
try {
|
|
105
|
+
return await makeCall();
|
|
106
|
+
} catch (raw_exn) {
|
|
107
|
+
let exn = Primitive_exceptions.internalToException(raw_exn);
|
|
108
|
+
let jsExn = Stdlib_JsExn.fromException(exn);
|
|
109
|
+
let name = Stdlib_Option.getOr(Stdlib_Option.flatMap(jsExn, prim => Primitive_option.fromNullable(prim.name)), "(no name)");
|
|
110
|
+
let msg = Stdlib_Option.getOr(Stdlib_Option.flatMap(jsExn, Stdlib_JsExn.message), "(no message)");
|
|
111
|
+
let isRetryable = attempt < maxAttempts && Stdlib_Option.mapOr(jsExn, false, e => {
|
|
112
|
+
if (isFieldNotFoundError(e)) {
|
|
113
|
+
return true;
|
|
114
|
+
} else {
|
|
115
|
+
return isSchemaAlteringError(e);
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
if (isRetryable) {
|
|
119
|
+
log.info("AppSync_Resolver_Retrying", undefined, `attempt ` + (attempt + 1 | 0).toString() + `/` + maxAttempts.toString() + ` failed, retrying in ` + delayMs.toString() + `ms: ` + name + `: ` + msg);
|
|
120
|
+
await new Promise((resolve, param) => {
|
|
121
|
+
setTimeout(resolve, delayMs);
|
|
122
|
+
});
|
|
123
|
+
let nextDelay = (delayMs << 1);
|
|
124
|
+
let cappedDelay = nextDelay > maxDelayMs ? maxDelayMs : nextDelay;
|
|
125
|
+
return await runWithRaceRetry(attempt + 1 | 0, maxAttempts, cappedDelay, maxDelayMs, makeCall);
|
|
126
|
+
}
|
|
127
|
+
if (attempt > 0) {
|
|
128
|
+
log.warn("AppSync_Resolver_Retrying", undefined, `giving up after ` + (attempt + 1 | 0).toString() + ` attempts: ` + name + `: ` + msg);
|
|
129
|
+
}
|
|
130
|
+
if (jsExn !== undefined) {
|
|
131
|
+
return jsThrow(Primitive_option.valFromOption(jsExn));
|
|
132
|
+
}
|
|
133
|
+
throw exn;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function buildSdkInput(inputs) {
|
|
138
|
+
let base_apiId = inputs.apiId;
|
|
139
|
+
let base_typeName = inputs.typeName;
|
|
140
|
+
let base_fieldName = inputs.fieldName;
|
|
141
|
+
let base_kind = inputs.kind;
|
|
142
|
+
let base_code = inputs.code;
|
|
143
|
+
let base_runtime = appsyncJsRuntime;
|
|
144
|
+
let base = {
|
|
145
|
+
apiId: base_apiId,
|
|
146
|
+
typeName: base_typeName,
|
|
147
|
+
fieldName: base_fieldName,
|
|
148
|
+
kind: base_kind,
|
|
149
|
+
code: base_code,
|
|
150
|
+
runtime: base_runtime
|
|
151
|
+
};
|
|
152
|
+
let ds = inputs.dataSourceName;
|
|
153
|
+
let withDs;
|
|
154
|
+
if (ds !== undefined) {
|
|
155
|
+
let newrecord = {...base};
|
|
156
|
+
newrecord.dataSourceName = ds;
|
|
157
|
+
withDs = newrecord;
|
|
158
|
+
} else {
|
|
159
|
+
withDs = base;
|
|
160
|
+
}
|
|
161
|
+
let fns = inputs.functions;
|
|
162
|
+
if (fns === undefined) {
|
|
163
|
+
return withDs;
|
|
164
|
+
}
|
|
165
|
+
let newrecord$1 = {...withDs};
|
|
166
|
+
newrecord$1.pipelineConfig = {
|
|
167
|
+
functions: fns
|
|
168
|
+
};
|
|
169
|
+
return newrecord$1;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
function extractArn(resp) {
|
|
173
|
+
return Stdlib_Option.getOr(Stdlib_Option.flatMap(resp.resolver, r => r.resolverArn), "unknown-arn");
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
function makeOuts(resolverArn, inputs) {
|
|
177
|
+
let base_apiId = inputs.apiId;
|
|
178
|
+
let base_typeName = inputs.typeName;
|
|
179
|
+
let base_fieldName = inputs.fieldName;
|
|
180
|
+
let base_kind = inputs.kind;
|
|
181
|
+
let base_code = inputs.code;
|
|
182
|
+
let base = {
|
|
183
|
+
resolverArn: resolverArn,
|
|
184
|
+
apiId: base_apiId,
|
|
185
|
+
typeName: base_typeName,
|
|
186
|
+
fieldName: base_fieldName,
|
|
187
|
+
kind: base_kind,
|
|
188
|
+
code: base_code
|
|
189
|
+
};
|
|
190
|
+
let ds = inputs.dataSourceName;
|
|
191
|
+
let withDs;
|
|
192
|
+
if (ds !== undefined) {
|
|
193
|
+
let newrecord = {...base};
|
|
194
|
+
newrecord.dataSourceName = ds;
|
|
195
|
+
withDs = newrecord;
|
|
196
|
+
} else {
|
|
197
|
+
withDs = base;
|
|
198
|
+
}
|
|
199
|
+
let fns = inputs.functions;
|
|
200
|
+
if (fns === undefined) {
|
|
201
|
+
return withDs;
|
|
202
|
+
}
|
|
203
|
+
let newrecord$1 = {...withDs};
|
|
204
|
+
newrecord$1.functions = fns;
|
|
205
|
+
return newrecord$1;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
async function create(inputs) {
|
|
209
|
+
let sdk = await getSdk();
|
|
210
|
+
let client = await getClient();
|
|
211
|
+
let arn;
|
|
212
|
+
try {
|
|
213
|
+
arn = await runWithRaceRetry(undefined, undefined, undefined, undefined, () => client.send(newOf1(sdk.CreateResolverCommand, buildSdkInput(inputs))).then(extractArn));
|
|
214
|
+
} catch (raw_exn) {
|
|
215
|
+
let exn = Primitive_exceptions.internalToException(raw_exn);
|
|
216
|
+
let handled = Stdlib_Option.mapOr(Stdlib_JsExn.fromException(exn), false, isAlreadyExistsError);
|
|
217
|
+
if (handled) {
|
|
218
|
+
arn = extractArn(await client.send(newOf1(sdk.UpdateResolverCommand, buildSdkInput(inputs))));
|
|
219
|
+
} else {
|
|
220
|
+
let jsExn = Stdlib_JsExn.fromException(exn);
|
|
221
|
+
if (jsExn !== undefined) {
|
|
222
|
+
arn = jsThrow(Primitive_option.valFromOption(jsExn));
|
|
223
|
+
} else {
|
|
224
|
+
throw exn;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
return {
|
|
229
|
+
id: arn,
|
|
230
|
+
outs: makeOuts(arn, inputs)
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
async function update(id, _olds, news) {
|
|
235
|
+
let sdk = await getSdk();
|
|
236
|
+
let client = await getClient();
|
|
237
|
+
let arn;
|
|
238
|
+
try {
|
|
239
|
+
await runWithRaceRetry(undefined, undefined, undefined, undefined, () => client.send(newOf1(sdk.UpdateResolverCommand, buildSdkInput(news))));
|
|
240
|
+
arn = id;
|
|
241
|
+
} catch (raw_exn) {
|
|
242
|
+
let exn = Primitive_exceptions.internalToException(raw_exn);
|
|
243
|
+
let handled = Stdlib_Option.mapOr(Stdlib_JsExn.fromException(exn), false, isAlreadyDeletedError);
|
|
244
|
+
if (handled) {
|
|
245
|
+
arn = await runWithRaceRetry(undefined, undefined, undefined, undefined, () => client.send(newOf1(sdk.CreateResolverCommand, buildSdkInput(news))).then(extractArn));
|
|
246
|
+
} else {
|
|
247
|
+
let jsExn = Stdlib_JsExn.fromException(exn);
|
|
248
|
+
if (jsExn !== undefined) {
|
|
249
|
+
arn = jsThrow(Primitive_option.valFromOption(jsExn));
|
|
250
|
+
} else {
|
|
251
|
+
throw exn;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
return {
|
|
256
|
+
outs: makeOuts(arn, news)
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
function parseArn(arn) {
|
|
261
|
+
let parts = arn.split("/");
|
|
262
|
+
let match = parts[1];
|
|
263
|
+
let match$1 = parts[3];
|
|
264
|
+
let match$2 = parts[5];
|
|
265
|
+
if (match !== undefined && match$1 !== undefined && match$2 !== undefined) {
|
|
266
|
+
return {
|
|
267
|
+
apiId: match,
|
|
268
|
+
typeName: match$1,
|
|
269
|
+
fieldName: match$2
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
async function delete_(id, props) {
|
|
275
|
+
let sdk = await getSdk();
|
|
276
|
+
let client = await getClient();
|
|
277
|
+
let parsed = parseArn(id);
|
|
278
|
+
let deleteInput = parsed !== undefined ? parsed : ({
|
|
279
|
+
apiId: props.apiId,
|
|
280
|
+
typeName: props.typeName,
|
|
281
|
+
fieldName: props.fieldName
|
|
282
|
+
});
|
|
283
|
+
try {
|
|
284
|
+
return await client.send(newOf1(sdk.DeleteResolverCommand, deleteInput));
|
|
285
|
+
} catch (raw_exn) {
|
|
286
|
+
let exn = Primitive_exceptions.internalToException(raw_exn);
|
|
287
|
+
if (Stdlib_Option.mapOr(Stdlib_JsExn.fromException(exn), false, isAlreadyDeletedError)) {
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
throw exn;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
let isDefined = (x => x !== undefined && x !== null);
|
|
295
|
+
|
|
296
|
+
function diff_(_id, olds, news) {
|
|
297
|
+
let replaces = Stdlib_Array.filterMap([
|
|
298
|
+
isDefined(olds.apiId) && olds.apiId !== news.apiId ? "apiId" : undefined,
|
|
299
|
+
isDefined(olds.typeName) && olds.typeName !== news.typeName ? "typeName" : undefined,
|
|
300
|
+
isDefined(olds.fieldName) && olds.fieldName !== news.fieldName ? "fieldName" : undefined,
|
|
301
|
+
isDefined(olds.kind) && olds.kind !== news.kind ? "kind" : undefined
|
|
302
|
+
], x => x);
|
|
303
|
+
let changes = replaces.length !== 0 || olds.code !== news.code || Primitive_object.notequal(olds.dataSourceName, news.dataSourceName) || Primitive_object.notequal(olds.functions, news.functions);
|
|
304
|
+
return {
|
|
305
|
+
changes: changes,
|
|
306
|
+
replaces: replaces,
|
|
307
|
+
deleteBeforeReplace: true
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
async function read_(id, props) {
|
|
312
|
+
let sdk = await getSdk();
|
|
313
|
+
let client = await getClient();
|
|
314
|
+
let parsed = parseArn(id);
|
|
315
|
+
let getInput = parsed !== undefined ? parsed : ({
|
|
316
|
+
apiId: props.apiId,
|
|
317
|
+
typeName: props.typeName,
|
|
318
|
+
fieldName: props.fieldName
|
|
319
|
+
});
|
|
320
|
+
try {
|
|
321
|
+
await client.send(newOf1(sdk.GetResolverCommand, getInput));
|
|
322
|
+
return {
|
|
323
|
+
id: id,
|
|
324
|
+
props: props
|
|
325
|
+
};
|
|
326
|
+
} catch (raw_exn) {
|
|
327
|
+
let exn = Primitive_exceptions.internalToException(raw_exn);
|
|
328
|
+
if (Stdlib_Option.mapOr(Stdlib_JsExn.fromException(exn), false, isAlreadyDeletedError)) {
|
|
329
|
+
log.info("AppSync_Resolver_Retrying", undefined, `resolver ` + getInput.typeName + `.` + getInput.fieldName + ` missing in AppSync; reporting drift`);
|
|
330
|
+
return {};
|
|
331
|
+
}
|
|
332
|
+
let jsExn = Stdlib_JsExn.fromException(exn);
|
|
333
|
+
if (jsExn !== undefined) {
|
|
334
|
+
return jsThrow(Primitive_option.valFromOption(jsExn));
|
|
335
|
+
}
|
|
336
|
+
throw exn;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
let provider = {
|
|
341
|
+
create: create,
|
|
342
|
+
update: update,
|
|
343
|
+
delete: delete_,
|
|
344
|
+
diff: diff_,
|
|
345
|
+
read: read_
|
|
346
|
+
};
|
|
347
|
+
|
|
348
|
+
function makeResolver(name, props, opts) {
|
|
349
|
+
let migrationAlias = Alias$Pulumi.make(name, "aws-native:appsync/resolver:Resolver", undefined);
|
|
350
|
+
let finalOpts;
|
|
351
|
+
if (opts !== undefined) {
|
|
352
|
+
let newrecord = {...opts};
|
|
353
|
+
newrecord.aliases = [migrationAlias];
|
|
354
|
+
finalOpts = newrecord;
|
|
355
|
+
} else {
|
|
356
|
+
finalOpts = {
|
|
357
|
+
aliases: [migrationAlias]
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
return new IndexJs.Resource(provider, name, props, finalOpts);
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
function makeSubscriptionResolverCode(filter) {
|
|
364
|
+
if (filter !== undefined) {
|
|
365
|
+
return `export function request(ctx) {
|
|
366
|
+
extensions.setSubscriptionFilter(` + filter + `);
|
|
367
|
+
return {};
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
export function response(ctx) {
|
|
371
|
+
return ctx.result;
|
|
372
|
+
}`;
|
|
373
|
+
} else {
|
|
374
|
+
return `export function request(ctx) {
|
|
375
|
+
return { payload: null };
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
export function response(ctx) {
|
|
379
|
+
return ctx.result;
|
|
380
|
+
}`;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
function makeSubscriptionResolver(name, api, field, dataSourceName, subscriptionFilter, opts) {
|
|
385
|
+
let baseProps_apiId = Output$Pulumi.flatMap(api, a => a.id);
|
|
386
|
+
let baseProps_code = makeSubscriptionResolverCode(subscriptionFilter);
|
|
387
|
+
let baseProps = {
|
|
388
|
+
apiId: baseProps_apiId,
|
|
389
|
+
typeName: "Subscription",
|
|
390
|
+
fieldName: field,
|
|
391
|
+
kind: "UNIT",
|
|
392
|
+
code: baseProps_code
|
|
393
|
+
};
|
|
394
|
+
let props;
|
|
395
|
+
if (dataSourceName !== undefined) {
|
|
396
|
+
let newrecord = {...baseProps};
|
|
397
|
+
newrecord.dataSourceName = dataSourceName;
|
|
398
|
+
props = newrecord;
|
|
399
|
+
} else {
|
|
400
|
+
props = baseProps;
|
|
401
|
+
}
|
|
402
|
+
return makeResolver(name, props, opts);
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
function makeUnitJsResolver(name, api, dataSourceName, type_, field, code, opts) {
|
|
406
|
+
return makeResolver(name, {
|
|
407
|
+
apiId: Output$Pulumi.flatMap(api, a => a.id),
|
|
408
|
+
typeName: type_,
|
|
409
|
+
fieldName: field,
|
|
410
|
+
dataSourceName: dataSourceName,
|
|
411
|
+
kind: "UNIT",
|
|
412
|
+
code: code
|
|
413
|
+
}, opts);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
function makePipelineJsResolver(name, api, type_, field, code, functions, opts) {
|
|
417
|
+
return makeResolver(name, {
|
|
418
|
+
apiId: Output$Pulumi.flatMap(api, a => a.id),
|
|
419
|
+
typeName: type_,
|
|
420
|
+
fieldName: field,
|
|
421
|
+
kind: "PIPELINE",
|
|
422
|
+
code: code,
|
|
423
|
+
functions: Pulumi.all(functions.map(f => f.functionId))
|
|
424
|
+
}, opts);
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
let Functions;
|
|
428
|
+
|
|
429
|
+
export {
|
|
430
|
+
log,
|
|
431
|
+
appsyncJsRuntime,
|
|
432
|
+
newOf1,
|
|
433
|
+
newOf0,
|
|
434
|
+
_sdk,
|
|
435
|
+
_client,
|
|
436
|
+
getSdk,
|
|
437
|
+
getClient,
|
|
438
|
+
isFieldNotFoundError,
|
|
439
|
+
isAlreadyDeletedError,
|
|
440
|
+
isAlreadyExistsError,
|
|
441
|
+
isSchemaAlteringError,
|
|
442
|
+
jsThrow,
|
|
443
|
+
runWithRaceRetry,
|
|
444
|
+
buildSdkInput,
|
|
445
|
+
extractArn,
|
|
446
|
+
makeOuts,
|
|
447
|
+
create,
|
|
448
|
+
update,
|
|
449
|
+
parseArn,
|
|
450
|
+
delete_,
|
|
451
|
+
isDefined,
|
|
452
|
+
diff_,
|
|
453
|
+
read_,
|
|
454
|
+
provider,
|
|
455
|
+
makeResolver,
|
|
456
|
+
Functions,
|
|
457
|
+
makeSubscriptionResolverCode,
|
|
458
|
+
makeSubscriptionResolver,
|
|
459
|
+
makeUnitJsResolver,
|
|
460
|
+
makePipelineJsResolver,
|
|
461
|
+
}
|
|
462
|
+
/* log Not a pure module */
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// CommandSubscriptionResolvers_AppSync.res
|
|
2
|
+
// Source C: mutation-triggered subscription resolvers.
|
|
3
|
+
//
|
|
4
|
+
// Creates one AppSync Subscription-type resolver per command mutation field.
|
|
5
|
+
// The corresponding SDL field (e.g. `onPlugin_Agg_Cmd`) with its
|
|
6
|
+
// `@aws_subscribe(mutations: ["Plugin_Agg_Cmd"])` directive is emitted by
|
|
7
|
+
// Plugin_SubscriptionSchema (Phase 2). This resolver registers the handler
|
|
8
|
+
// on the Subscription type so AppSync can deliver the mutation return value
|
|
9
|
+
// to all matching subscribers automatically. AWS requires a dataSourceName
|
|
10
|
+
// on every resolver; we reuse the corresponding mutation's data source since
|
|
11
|
+
// UNIT subscription code never executes against it.
|
|
12
|
+
|
|
13
|
+
type api = Types.AppSync.api
|
|
14
|
+
|
|
15
|
+
let make = (
|
|
16
|
+
~api: api,
|
|
17
|
+
~mutationFields: array<string>,
|
|
18
|
+
~dataSourceName: Pulumi.Input.t<string>,
|
|
19
|
+
~opts: Pulumi.CustomResourceOptions.t,
|
|
20
|
+
) =>
|
|
21
|
+
mutationFields->Array.forEach(field => {
|
|
22
|
+
let _ = AppSync_Resolver_Retrying.makeSubscriptionResolver(
|
|
23
|
+
~name="on" ++ field->String.capitalize,
|
|
24
|
+
~api,
|
|
25
|
+
~field="on" ++ field,
|
|
26
|
+
~dataSourceName,
|
|
27
|
+
~opts,
|
|
28
|
+
)
|
|
29
|
+
})
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Stdlib_String from "@rescript/runtime/lib/es6/Stdlib_String.js";
|
|
4
|
+
import * as AppSync_Resolver_Retrying$ReventlessAws from "./AppSync_Resolver_Retrying.res.mjs";
|
|
5
|
+
|
|
6
|
+
function make(api, mutationFields, dataSourceName, opts) {
|
|
7
|
+
mutationFields.forEach(field => {
|
|
8
|
+
AppSync_Resolver_Retrying$ReventlessAws.makeSubscriptionResolver("on" + Stdlib_String.capitalize(field), api, "on" + field, dataSourceName, undefined, opts);
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export {
|
|
13
|
+
make,
|
|
14
|
+
}
|
|
15
|
+
/* AppSync_Resolver_Retrying-ReventlessAws Not a pure module */
|