@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,2281 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as S from "sury/src/S.res.mjs";
|
|
4
|
+
import * as Aws from "@pulumi/aws";
|
|
5
|
+
import * as Stdlib_Dict from "@rescript/runtime/lib/es6/Stdlib_Dict.js";
|
|
6
|
+
import * as Stdlib_JSON from "@rescript/runtime/lib/es6/Stdlib_JSON.js";
|
|
7
|
+
import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.js";
|
|
8
|
+
import * as Stdlib_Float from "@rescript/runtime/lib/es6/Stdlib_Float.js";
|
|
9
|
+
import * as Stdlib_JsExn from "@rescript/runtime/lib/es6/Stdlib_JsExn.js";
|
|
10
|
+
import * as Id$Reventless from "@reventlessdev/reventless-spec/src/types/Id.res.mjs";
|
|
11
|
+
import * as Output$Pulumi from "@reventlessdev/rescript-pulumi-pulumi/src/Output.res.mjs";
|
|
12
|
+
import * as Pulumi$Pulumi from "@reventlessdev/rescript-pulumi-pulumi/src/Pulumi.res.mjs";
|
|
13
|
+
import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
14
|
+
import * as Pulumi from "@pulumi/pulumi";
|
|
15
|
+
import * as Stdlib_Promise from "@rescript/runtime/lib/es6/Stdlib_Promise.js";
|
|
16
|
+
import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js";
|
|
17
|
+
import * as Plugin$ReventlessAws from "./components/Plugin.res.mjs";
|
|
18
|
+
import * as LibDynamodb from "@aws-sdk/lib-dynamodb";
|
|
19
|
+
import * as Logger$ReventlessCore from "@reventlessdev/reventless-core/src/util/Logger.res.mjs";
|
|
20
|
+
import * as Message$ReventlessCore from "@reventlessdev/reventless-core/src/Message.res.mjs";
|
|
21
|
+
import * as AdminApi$ReventlessCore from "@reventlessdev/reventless-core/src/admin/AdminApi.res.mjs";
|
|
22
|
+
import * as Scheduler$ReventlessAws from "./components/Scheduler.res.mjs";
|
|
23
|
+
import * as Aggregate$ReventlessCore from "@reventlessdev/reventless-core/src/components/Aggregate/Aggregate.res.mjs";
|
|
24
|
+
import * as Component$ReventlessCore from "@reventlessdev/reventless-core/src/components/Component.res.mjs";
|
|
25
|
+
import * as ReadModel$ReventlessCore from "@reventlessdev/reventless-core/src/components/ReadModel/ReadModel.res.mjs";
|
|
26
|
+
import * as PluginSpec$ReventlessCore from "@reventlessdev/reventless-core/src/plugin/lifecycle/PluginSpec.res.mjs";
|
|
27
|
+
import * as Api_Builder$ReventlessCore from "@reventlessdev/reventless-core/src/components/Api/Api_Builder.res.mjs";
|
|
28
|
+
import * as Plugin_Stack$ReventlessAws from "./plugin/stack/Plugin_Stack.res.mjs";
|
|
29
|
+
import * as Util_Pulumi$ReventlessCore from "@reventlessdev/reventless-core/src/util/Util_Pulumi.res.mjs";
|
|
30
|
+
import * as Util_DynamoDb$ReventlessAws from "./util/Util_DynamoDb.res.mjs";
|
|
31
|
+
import * as Platform_Casts$ReventlessAws from "./Platform_Casts.res.mjs";
|
|
32
|
+
import * as Platform_Stack$ReventlessAws from "./Platform_Stack.res.mjs";
|
|
33
|
+
import * as AppSync_Adapter$ReventlessAws from "./components/Api/AppSync_Adapter.res.mjs";
|
|
34
|
+
import * as Counter_Builder$ReventlessAws from "./components/Counter_Builder.res.mjs";
|
|
35
|
+
import * as Platform_Admin$ReventlessCore from "@reventlessdev/reventless-core/src/admin/Platform_Admin.res.mjs";
|
|
36
|
+
import * as PluginBehavior$ReventlessCore from "@reventlessdev/reventless-core/src/plugin/lifecycle/PluginBehavior.res.mjs";
|
|
37
|
+
import * as Plugin_Helpers$ReventlessCore from "@reventlessdev/reventless-core/src/plugin/component/Plugin_Helpers.res.mjs";
|
|
38
|
+
import * as DynamoDb_DocumentClient$AwsSdk from "@reventlessdev/rescript-aws-sdk/src/DynamoDb_DocumentClient.res.mjs";
|
|
39
|
+
import * as Util_LocalConfig$ReventlessAws from "./util/Util_LocalConfig.res.mjs";
|
|
40
|
+
import * as IndexJs from "@pulumi/pulumi/runtime/index.js";
|
|
41
|
+
import * as AppSync_EventsApi$ReventlessAws from "./adapter/Api/AppSync_EventsApi.res.mjs";
|
|
42
|
+
import * as GraphQL_Stitcher$ReventlessCore from "@reventlessdev/reventless-core/src/components/Api/GraphQL_Stitcher.res.mjs";
|
|
43
|
+
import * as NoEventMappings$ReventlessInfra from "@reventlessdev/reventless-infra/src/types/NoEventMappings.res.mjs";
|
|
44
|
+
import * as Util_HostUiDomain$ReventlessAws from "./util/Util_HostUiDomain.res.mjs";
|
|
45
|
+
import * as ExtensionMapping$ReventlessInfra from "@reventlessdev/reventless-infra/src/types/ExtensionMapping.res.mjs";
|
|
46
|
+
import * as PluginsProjection$ReventlessCore from "@reventlessdev/reventless-core/src/plugin/lifecycle/PluginsProjection.res.mjs";
|
|
47
|
+
import * as StateTopic_AppSync$ReventlessAws from "./adapter/StateTopic/StateTopic_AppSync.res.mjs";
|
|
48
|
+
import * as Util_ResourceNaming$ReventlessAws from "./util/Util_ResourceNaming.res.mjs";
|
|
49
|
+
import * as ClonerRunner_Fargate$ReventlessAws from "./plugin/cloner/ClonerRunner_Fargate.res.mjs";
|
|
50
|
+
import * as QueryEngine_DynamoDb$ReventlessAws from "./adapter/QueryEngine/QueryEngine_DynamoDb.res.mjs";
|
|
51
|
+
import * as PluginRuntime_Builder$ReventlessAws from "./plugin/runtime/PluginRuntime_Builder.res.mjs";
|
|
52
|
+
import * as PluginsReadModelSpec$ReventlessCore from "@reventlessdev/reventless-core/src/plugin/lifecycle/PluginsReadModelSpec.res.mjs";
|
|
53
|
+
import * as ExtensionPoint_Builder$ReventlessAws from "./components/ExtensionPoint_Builder.res.mjs";
|
|
54
|
+
import * as StateViewSlice_Builder$ReventlessAws from "./components/StateViewSlice_Builder.res.mjs";
|
|
55
|
+
import * as Task_Builder_PerBucket$ReventlessAws from "./components/Task_Builder_PerBucket.res.mjs";
|
|
56
|
+
import * as AutomationSlice_Builder$ReventlessAws from "./components/AutomationSlice_Builder.res.mjs";
|
|
57
|
+
import * as EventTopicPublisher_SNS$ReventlessAws from "./adapter/EventTopic/EventTopicPublisher_SNS.res.mjs";
|
|
58
|
+
import * as ExtensionPointMapping$ReventlessInfra from "@reventlessdev/reventless-infra/src/types/ExtensionPointMapping.res.mjs";
|
|
59
|
+
import * as Aggregate_Builder_Single$ReventlessAws from "./components/Aggregate_Builder_Single.res.mjs";
|
|
60
|
+
import * as ReadModel_Builder_Single$ReventlessAws from "./components/ReadModel_Builder_Single.res.mjs";
|
|
61
|
+
import * as StateChangeSlice_Builder$ReventlessAws from "./components/StateChangeSlice_Builder.res.mjs";
|
|
62
|
+
import * as EventCollectorChannel_SQS$ReventlessAws from "./adapter/EventCollector/EventCollectorChannel_SQS.res.mjs";
|
|
63
|
+
import * as RuntimeEnvironment_Lambda$ReventlessAws from "./adapter/Runtime/RuntimeEnvironment_Lambda.res.mjs";
|
|
64
|
+
import * as PluginExtensionPointSpec$ReventlessInfra from "@reventlessdev/reventless-infra/src/types/PluginExtensionPointSpec.res.mjs";
|
|
65
|
+
import * as DcbEventLogStorage_DynamoDb$ReventlessAws from "./adapter/DcbEventLog/DcbEventLogStorage_DynamoDb.res.mjs";
|
|
66
|
+
import * as Platform_UIFragments_Lambda$ReventlessAws from "./adapter/Api/Platform_UIFragments_Lambda.res.mjs";
|
|
67
|
+
import * as CommandTopicChannel_SQS_Sync$ReventlessAws from "./adapter/CommandTopic/CommandTopicChannel_SQS_Sync.res.mjs";
|
|
68
|
+
import * as EventLogSubscription_AppSync$ReventlessAws from "./adapter/EventLogSubscription/EventLogSubscription_AppSync.res.mjs";
|
|
69
|
+
import * as CommandTopicChannel_SQS_Async$ReventlessAws from "./adapter/CommandTopic/CommandTopicChannel_SQS_Async.res.mjs";
|
|
70
|
+
import * as Plugin_ExtensionPoint_Builder$ReventlessAws from "./plugin/stack/Plugin_ExtensionPoint_Builder.res.mjs";
|
|
71
|
+
import * as QueryDbStorage_DynamoDbStream$ReventlessAws from "./adapter/QueryDb/QueryDbStorage_DynamoDbStream.res.mjs";
|
|
72
|
+
import * as StateViewSlice_Builder_Stream$ReventlessAws from "./components/StateViewSlice_Builder_Stream.res.mjs";
|
|
73
|
+
import * as UIFragmentRegistryProjection$ReventlessCore from "@reventlessdev/reventless-core/src/admin/UIFragmentRegistryProjection.res.mjs";
|
|
74
|
+
import * as Aggregate_Builder_Single_Async$ReventlessAws from "./components/Aggregate_Builder_Single_Async.res.mjs";
|
|
75
|
+
import * as AggregateRuntime_Builder_Single$ReventlessAws from "./adapter/Runtime/AggregateRuntime_Builder_Single.res.mjs";
|
|
76
|
+
import * as CommandTopicChannel_SQS_Runtime$ReventlessAws from "./adapter/CommandTopic/CommandTopicChannel_SQS_Runtime.res.mjs";
|
|
77
|
+
import * as InboundTranslationSlice_Builder$ReventlessAws from "./components/InboundTranslationSlice_Builder.res.mjs";
|
|
78
|
+
import * as ReadModel_Builder_Single_Stream$ReventlessAws from "./components/ReadModel_Builder_Single_Stream.res.mjs";
|
|
79
|
+
import * as OutboundTranslationSlice_Builder$ReventlessAws from "./components/OutboundTranslationSlice_Builder.res.mjs";
|
|
80
|
+
import * as UIFragmentRegistryReadModelSpec$ReventlessCore from "@reventlessdev/reventless-core/src/admin/UIFragmentRegistryReadModelSpec.res.mjs";
|
|
81
|
+
import * as CommandGeneratorResolvers_AppSync$ReventlessAws from "./adapter/CommandGenerator/CommandGeneratorResolvers_AppSync.res.mjs";
|
|
82
|
+
import * as EventTopicPublisher_DynamoDbStream$ReventlessAws from "./adapter/EventTopic/EventTopicPublisher_DynamoDbStream.res.mjs";
|
|
83
|
+
import * as InboundTranslationResolvers_AppSync$ReventlessAws from "./adapter/CommandGenerator/InboundTranslationResolvers_AppSync.res.mjs";
|
|
84
|
+
import * as PluginExtensionPointRuntime_Builder$ReventlessAws from "./plugin/runtime/PluginExtensionPointRuntime_Builder.res.mjs";
|
|
85
|
+
import * as ReadModel_Builder_NoResolver_Stream$ReventlessAws from "./components/ReadModel_Builder_NoResolver_Stream.res.mjs";
|
|
86
|
+
import * as Platform_ComponentDefinitions_Lambda$ReventlessAws from "./adapter/Api/Platform_ComponentDefinitions_Lambda.res.mjs";
|
|
87
|
+
import * as StateViewSliceRuntime_Builder_Single$ReventlessAws from "./adapter/Runtime/StateViewSliceRuntime_Builder_Single.res.mjs";
|
|
88
|
+
import * as AggregateRuntime_Builder_Single_Async$ReventlessAws from "./adapter/Runtime/AggregateRuntime_Builder_Single_Async.res.mjs";
|
|
89
|
+
import * as AutomationSliceRuntime_Builder_Single$ReventlessAws from "./adapter/Runtime/AutomationSliceRuntime_Builder_Single.res.mjs";
|
|
90
|
+
|
|
91
|
+
let log = Logger$ReventlessCore.fromEnv();
|
|
92
|
+
|
|
93
|
+
let n = Stdlib_Option.flatMap(process.env["DEPLOY_SCHEMA_SHRINK_THRESHOLD"], Stdlib_Float.fromString);
|
|
94
|
+
|
|
95
|
+
let deploySchemaShrinkThreshold = n !== undefined ? (
|
|
96
|
+
n > 0 && n < 1 ? n : 0.5
|
|
97
|
+
) : 0.5;
|
|
98
|
+
|
|
99
|
+
let apiConfigRef = {
|
|
100
|
+
contents: undefined
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
function getApiConfig() {
|
|
104
|
+
return Stdlib_Option.getOrThrow(apiConfigRef.contents, "Platform.getApiConfig() called before MakeWithConfig");
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
let splitApiOutputsRef = {
|
|
108
|
+
contents: undefined
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
function getSplitApiOutputs() {
|
|
112
|
+
return splitApiOutputsRef.contents;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function MakeWithConfig(Config) {
|
|
116
|
+
Stdlib_Option.forEach(Config.commandHandlerConfig.aggregates, param => {
|
|
117
|
+
Stdlib_Option.forEach(param.sync, AggregateRuntime_Builder_Single$ReventlessAws.setConfig);
|
|
118
|
+
Stdlib_Option.forEach(param.async, AggregateRuntime_Builder_Single_Async$ReventlessAws.setConfig);
|
|
119
|
+
});
|
|
120
|
+
Stdlib_Option.forEach(Config.commandHandlerConfig.stateChanges, param => PluginRuntime_Builder$ReventlessAws.setStateChangesConfig(param.sync, param.async, undefined));
|
|
121
|
+
let currentDeployTarget = {
|
|
122
|
+
contents: "Domain"
|
|
123
|
+
};
|
|
124
|
+
let platformStackRef = Stdlib_Option.map(new Pulumi.Config("platform").get("stack"), stack => new Pulumi.StackReference(stack));
|
|
125
|
+
let makePhantomApi = (apiId, apiEndpoint) => ({
|
|
126
|
+
id: Pulumi.output(apiId),
|
|
127
|
+
arn: Pulumi.output(""),
|
|
128
|
+
name: Pulumi.output(""),
|
|
129
|
+
uris: Pulumi.output({
|
|
130
|
+
GRAPHQL: apiEndpoint,
|
|
131
|
+
REALTIME: ""
|
|
132
|
+
})
|
|
133
|
+
});
|
|
134
|
+
let makePhantomRole = apiRoleArn => {
|
|
135
|
+
let roleName = Stdlib_Option.getOr(apiRoleArn.split("/").at(-1), apiRoleArn);
|
|
136
|
+
return {
|
|
137
|
+
arn: Pulumi.output(apiRoleArn),
|
|
138
|
+
name: Pulumi.output(roleName),
|
|
139
|
+
id: Pulumi.output(roleName)
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
let match;
|
|
143
|
+
if (platformStackRef !== undefined) {
|
|
144
|
+
let stackRef = Primitive_option.valFromOption(platformStackRef);
|
|
145
|
+
let defaultOutput = stackRef.getOutput("default");
|
|
146
|
+
let domainApiIdOutput = stackRef.getOutput("domainApiId");
|
|
147
|
+
let domainApiEndpointOutput = stackRef.getOutput("domainApiEndpoint");
|
|
148
|
+
let domainApiRoleArnOutput = stackRef.getOutput("domainApiRoleArn");
|
|
149
|
+
let phantomApi = Pulumi.all([
|
|
150
|
+
domainApiIdOutput,
|
|
151
|
+
domainApiEndpointOutput,
|
|
152
|
+
defaultOutput
|
|
153
|
+
]).apply(param => {
|
|
154
|
+
let $$default = param[2];
|
|
155
|
+
let directEndpoint = param[1];
|
|
156
|
+
let directId = param[0];
|
|
157
|
+
let apiId = directId !== undefined ? directId : Stdlib_Option.getOrThrow(Stdlib_Option.flatMap(Stdlib_Option.flatMap(Stdlib_Option.flatMap($$default, d => Stdlib_JSON.Decode.object(d)), d => d["domainApiId"]), v => Stdlib_JSON.Decode.string(v)), undefined);
|
|
158
|
+
let apiEndpoint = directEndpoint !== undefined ? directEndpoint : Stdlib_Option.getOrThrow(Stdlib_Option.flatMap(Stdlib_Option.flatMap(Stdlib_Option.flatMap($$default, d => Stdlib_JSON.Decode.object(d)), d => d["domainApiEndpoint"]), v => Stdlib_JSON.Decode.string(v)), "Platform stack does not export 'domainApiEndpoint' — redeploy the platform stack first");
|
|
159
|
+
return makePhantomApi(apiId, apiEndpoint);
|
|
160
|
+
});
|
|
161
|
+
let phantomRole = Pulumi.all([
|
|
162
|
+
domainApiRoleArnOutput,
|
|
163
|
+
defaultOutput
|
|
164
|
+
]).apply(param => {
|
|
165
|
+
let direct = param[0];
|
|
166
|
+
return makePhantomRole(direct !== undefined ? direct : Stdlib_Option.getOrThrow(Stdlib_Option.flatMap(Stdlib_Option.flatMap(Stdlib_Option.flatMap(param[1], d => Stdlib_JSON.Decode.object(d)), d => d["domainApiRoleArn"]), v => Stdlib_JSON.Decode.string(v)), undefined));
|
|
167
|
+
});
|
|
168
|
+
let platformApiIdOutput = stackRef.getOutput("platformApiId");
|
|
169
|
+
let platformApiEndpointOutput = stackRef.getOutput("platformApiEndpoint");
|
|
170
|
+
let platformApiRoleArnOutput = stackRef.getOutput("platformApiRoleArn");
|
|
171
|
+
let phantomPlatformApi = Pulumi.all([
|
|
172
|
+
platformApiIdOutput,
|
|
173
|
+
platformApiEndpointOutput,
|
|
174
|
+
defaultOutput
|
|
175
|
+
]).apply(param => {
|
|
176
|
+
let $$default = param[2];
|
|
177
|
+
let getFromDefault = key => Stdlib_Option.flatMap(Stdlib_Option.flatMap(Stdlib_Option.flatMap($$default, d => Stdlib_JSON.Decode.object(d)), d => d[key]), v => Stdlib_JSON.Decode.string(v));
|
|
178
|
+
let platformApiId = Stdlib_Option.getOrThrow(Stdlib_Option.orElse(param[0], getFromDefault("platformApiId")), undefined);
|
|
179
|
+
let platformApiEndpoint = Stdlib_Option.getOrThrow(Stdlib_Option.orElse(param[1], getFromDefault("platformApiEndpoint")), undefined);
|
|
180
|
+
return makePhantomApi(platformApiId, platformApiEndpoint);
|
|
181
|
+
});
|
|
182
|
+
let phantomPlatformRole = Pulumi.all([
|
|
183
|
+
platformApiRoleArnOutput,
|
|
184
|
+
defaultOutput
|
|
185
|
+
]).apply(param => {
|
|
186
|
+
let $$default = param[1];
|
|
187
|
+
let getFromDefault = key => Stdlib_Option.flatMap(Stdlib_Option.flatMap(Stdlib_Option.flatMap($$default, d => Stdlib_JSON.Decode.object(d)), d => d[key]), v => Stdlib_JSON.Decode.string(v));
|
|
188
|
+
return makePhantomRole(Stdlib_Option.getOrThrow(Stdlib_Option.orElse(param[0], getFromDefault("platformApiRoleArn")), undefined));
|
|
189
|
+
});
|
|
190
|
+
match = [
|
|
191
|
+
phantomApi,
|
|
192
|
+
phantomRole,
|
|
193
|
+
phantomPlatformApi,
|
|
194
|
+
phantomPlatformRole
|
|
195
|
+
];
|
|
196
|
+
} else {
|
|
197
|
+
let match$1 = AppSync_Adapter$ReventlessAws.makeApiResource("DomainApi", {});
|
|
198
|
+
let role = match$1[1];
|
|
199
|
+
let api = match$1[0];
|
|
200
|
+
match = [
|
|
201
|
+
api,
|
|
202
|
+
role,
|
|
203
|
+
api,
|
|
204
|
+
role
|
|
205
|
+
];
|
|
206
|
+
}
|
|
207
|
+
let domainApiRole = match[1];
|
|
208
|
+
let domainApi = match[0];
|
|
209
|
+
apiConfigRef.contents = {
|
|
210
|
+
domainApi: domainApi,
|
|
211
|
+
domainApiRole: domainApiRole,
|
|
212
|
+
platformApi: match[2],
|
|
213
|
+
platformApiRole: match[3]
|
|
214
|
+
};
|
|
215
|
+
let domainEventsApiOpt;
|
|
216
|
+
if (platformStackRef !== undefined) {
|
|
217
|
+
let stackRef$1 = Primitive_option.valFromOption(platformStackRef);
|
|
218
|
+
let eventsApiArnOutput = stackRef$1.getOutput("eventsApiArn");
|
|
219
|
+
let eventsApiDnsOutput = stackRef$1.getOutput("eventsApiDns");
|
|
220
|
+
let defaultEventsOutput = stackRef$1.getOutput("default");
|
|
221
|
+
let getFromDefault = ($$default, key) => Stdlib_Option.flatMap(Stdlib_Option.flatMap(Stdlib_Option.flatMap($$default, d => Stdlib_JSON.Decode.object(d)), d => d[key]), v => Stdlib_JSON.Decode.string(v));
|
|
222
|
+
let apiArn = Pulumi.all([
|
|
223
|
+
eventsApiArnOutput,
|
|
224
|
+
defaultEventsOutput
|
|
225
|
+
]).apply(param => Stdlib_Option.orElse(param[0], getFromDefault(param[1], "eventsApiArn")));
|
|
226
|
+
let dns = Pulumi.all([
|
|
227
|
+
eventsApiDnsOutput,
|
|
228
|
+
defaultEventsOutput
|
|
229
|
+
]).apply(param => Stdlib_Option.orElse(param[0], getFromDefault(param[1], "eventsApiDns")));
|
|
230
|
+
let api_apiId = Pulumi.output("");
|
|
231
|
+
let api_apiArn = apiArn.apply(v => Stdlib_Option.getOr(v, ""));
|
|
232
|
+
let api_dns = dns.apply(dnsHttp => ({
|
|
233
|
+
http: dnsHttp
|
|
234
|
+
}));
|
|
235
|
+
let api_name = Pulumi.output("");
|
|
236
|
+
let api$1 = {
|
|
237
|
+
apiId: api_apiId,
|
|
238
|
+
apiArn: api_apiArn,
|
|
239
|
+
dns: api_dns,
|
|
240
|
+
name: api_name
|
|
241
|
+
};
|
|
242
|
+
domainEventsApiOpt = {
|
|
243
|
+
name: "DomainEventsApi",
|
|
244
|
+
api: api$1,
|
|
245
|
+
defaultNamespace: undefined
|
|
246
|
+
};
|
|
247
|
+
} else {
|
|
248
|
+
let cognitoPool = Platform_Stack$ReventlessAws.resolveCognitoUserPool();
|
|
249
|
+
let awsRegion = Stdlib_Option.getOr(new Pulumi.Config("aws").get("region"), "unknown");
|
|
250
|
+
domainEventsApiOpt = AppSync_EventsApi$ReventlessAws.make("DomainEventsApi", cognitoPool.poolId, awsRegion, {});
|
|
251
|
+
}
|
|
252
|
+
let resolveTargetApi = () => {
|
|
253
|
+
let match = currentDeployTarget.contents;
|
|
254
|
+
if (match === "Domain") {
|
|
255
|
+
return domainApi;
|
|
256
|
+
}
|
|
257
|
+
let match$1 = apiConfigRef.contents;
|
|
258
|
+
if (match$1 !== undefined) {
|
|
259
|
+
return match$1.platformApi;
|
|
260
|
+
} else {
|
|
261
|
+
return domainApi;
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
let resolveTargetApiRole = () => {
|
|
265
|
+
let match = currentDeployTarget.contents;
|
|
266
|
+
if (match === "Domain") {
|
|
267
|
+
return domainApiRole;
|
|
268
|
+
}
|
|
269
|
+
let match$1 = apiConfigRef.contents;
|
|
270
|
+
if (match$1 !== undefined) {
|
|
271
|
+
return match$1.platformApiRole;
|
|
272
|
+
} else {
|
|
273
|
+
return domainApiRole;
|
|
274
|
+
}
|
|
275
|
+
};
|
|
276
|
+
let ApiConfig = {
|
|
277
|
+
api: resolveTargetApi,
|
|
278
|
+
apiRole: resolveTargetApiRole
|
|
279
|
+
};
|
|
280
|
+
let Make = Spec => (Behavior => (EventMappings => Aggregate_Builder_Single$ReventlessAws.Make(Spec)(Behavior)(EventMappings)));
|
|
281
|
+
let MakeAsync = Spec => (Behavior => (EventMappings => Aggregate_Builder_Single_Async$ReventlessAws.Make(Spec)(Behavior)(EventMappings)));
|
|
282
|
+
let Aggregate = {
|
|
283
|
+
Make: Make,
|
|
284
|
+
MakeAsync: MakeAsync
|
|
285
|
+
};
|
|
286
|
+
let Make$1 = Spec => (Mappings => ReadModel_Builder_Single$ReventlessAws.Make(Spec)(Mappings));
|
|
287
|
+
let ReadModel = {
|
|
288
|
+
Make: Make$1
|
|
289
|
+
};
|
|
290
|
+
let Make$2 = Spec => (Mappings => ReadModel_Builder_Single_Stream$ReventlessAws.Make(Spec)(Mappings));
|
|
291
|
+
let ReadModelStream = {
|
|
292
|
+
Make: Make$2
|
|
293
|
+
};
|
|
294
|
+
let Make$3 = Mapping => {
|
|
295
|
+
let CompiledMapping = ExtensionPointMapping$ReventlessInfra.Make(Mapping);
|
|
296
|
+
let name = Mapping.Delegate.name;
|
|
297
|
+
let mappings = [CompiledMapping];
|
|
298
|
+
return ExtensionPoint_Builder$ReventlessAws.Make(Mapping.ExtensionPoint)({
|
|
299
|
+
name: name,
|
|
300
|
+
moduleUrl: Mapping.moduleUrl,
|
|
301
|
+
mappings: mappings
|
|
302
|
+
});
|
|
303
|
+
};
|
|
304
|
+
let Make2 = Mapping1 => (Mapping2 => {
|
|
305
|
+
let CM1 = ExtensionPointMapping$ReventlessInfra.Make(Mapping1);
|
|
306
|
+
let CM2 = ExtensionPointMapping$ReventlessInfra.Make(Mapping2);
|
|
307
|
+
let name = Mapping1.Delegate.name + "+" + Mapping2.Delegate.name;
|
|
308
|
+
let mappings = [
|
|
309
|
+
CM1,
|
|
310
|
+
CM2
|
|
311
|
+
];
|
|
312
|
+
return ExtensionPoint_Builder$ReventlessAws.Make(Mapping1.ExtensionPoint)({
|
|
313
|
+
name: name,
|
|
314
|
+
moduleUrl: Mapping1.moduleUrl,
|
|
315
|
+
mappings: mappings
|
|
316
|
+
});
|
|
317
|
+
});
|
|
318
|
+
let Make3 = Mapping1 => (Mapping2 => (Mapping3 => {
|
|
319
|
+
let CM1 = ExtensionPointMapping$ReventlessInfra.Make(Mapping1);
|
|
320
|
+
let CM2 = ExtensionPointMapping$ReventlessInfra.Make(Mapping2);
|
|
321
|
+
let CM3 = ExtensionPointMapping$ReventlessInfra.Make(Mapping3);
|
|
322
|
+
let name = Mapping1.Delegate.name + "+" + Mapping2.Delegate.name + "+" + Mapping3.Delegate.name;
|
|
323
|
+
let mappings = [
|
|
324
|
+
CM1,
|
|
325
|
+
CM2,
|
|
326
|
+
CM3
|
|
327
|
+
];
|
|
328
|
+
return ExtensionPoint_Builder$ReventlessAws.Make(Mapping1.ExtensionPoint)({
|
|
329
|
+
name: name,
|
|
330
|
+
moduleUrl: Mapping1.moduleUrl,
|
|
331
|
+
mappings: mappings
|
|
332
|
+
});
|
|
333
|
+
}));
|
|
334
|
+
let MakeMulti = Spec => (Mappings => ExtensionPoint_Builder$ReventlessAws.Make(Spec)(Mappings));
|
|
335
|
+
let ExtensionPoint = {
|
|
336
|
+
Make: Make$3,
|
|
337
|
+
Make2: Make2,
|
|
338
|
+
Make3: Make3,
|
|
339
|
+
MakeMulti: MakeMulti
|
|
340
|
+
};
|
|
341
|
+
let Make$4 = Mapping => {
|
|
342
|
+
let CompiledMapping = ExtensionMapping$ReventlessInfra.Make(Mapping);
|
|
343
|
+
let name = Mapping.Delegate.name;
|
|
344
|
+
let mappings = [CompiledMapping];
|
|
345
|
+
return {
|
|
346
|
+
Spec: Mapping.ExtensionPoint,
|
|
347
|
+
name: name,
|
|
348
|
+
moduleUrl: Mapping.moduleUrl,
|
|
349
|
+
delegateModuleUrl: Mapping.delegateModuleUrl,
|
|
350
|
+
mappings: mappings
|
|
351
|
+
};
|
|
352
|
+
};
|
|
353
|
+
let Extension = {
|
|
354
|
+
Make: Make$4
|
|
355
|
+
};
|
|
356
|
+
let Make$5 = Task_Builder_PerBucket$ReventlessAws.Make;
|
|
357
|
+
let Task = {
|
|
358
|
+
Make: Make$5
|
|
359
|
+
};
|
|
360
|
+
let Counter = Counter_Builder$ReventlessAws.Make(ApiConfig);
|
|
361
|
+
let Make$6 = Spec => (Behavior => StateChangeSlice_Builder$ReventlessAws.Make(Spec)(Behavior));
|
|
362
|
+
let MakeAsync$1 = Spec => (Behavior => {
|
|
363
|
+
let include = StateChangeSlice_Builder$ReventlessAws.Make(Spec)(Behavior);
|
|
364
|
+
return {
|
|
365
|
+
Spec: include.Spec,
|
|
366
|
+
Behavior: include.Behavior,
|
|
367
|
+
isAsync: true,
|
|
368
|
+
make: include.make
|
|
369
|
+
};
|
|
370
|
+
});
|
|
371
|
+
let StateChangeSlice = {
|
|
372
|
+
Make: Make$6,
|
|
373
|
+
MakeAsync: MakeAsync$1
|
|
374
|
+
};
|
|
375
|
+
let include = StateViewSlice_Builder$ReventlessAws.Make(ApiConfig);
|
|
376
|
+
let include$1 = StateViewSlice_Builder_Stream$ReventlessAws.Make(ApiConfig);
|
|
377
|
+
let include$2 = AutomationSlice_Builder$ReventlessAws.Make(ApiConfig);
|
|
378
|
+
let include$3 = OutboundTranslationSlice_Builder$ReventlessAws.Make(ApiConfig);
|
|
379
|
+
let InboundTranslationSlice = InboundTranslationSlice_Builder$ReventlessAws.Make(ApiConfig);
|
|
380
|
+
let emptyBaseFragment = GraphQL_Stitcher$ReventlessCore.encode({
|
|
381
|
+
types: [],
|
|
382
|
+
mutations: [],
|
|
383
|
+
queries: [],
|
|
384
|
+
subscriptions: []
|
|
385
|
+
});
|
|
386
|
+
let Make$7 = FragmentConfig => {
|
|
387
|
+
let Builder = Api_Builder$ReventlessCore.Make({
|
|
388
|
+
makeApiResource: AppSync_Adapter$ReventlessAws.makeApiResource,
|
|
389
|
+
generateFragment: AppSync_Adapter$ReventlessAws.generateFragment,
|
|
390
|
+
updateSchema: AppSync_Adapter$ReventlessAws.updateSchema
|
|
391
|
+
});
|
|
392
|
+
let effectiveBaseFragment = Config.splitApi ? emptyBaseFragment : FragmentConfig.baseFragment;
|
|
393
|
+
let make = (name, opts) => Builder.make(name, effectiveBaseFragment, opts);
|
|
394
|
+
return {
|
|
395
|
+
make: make
|
|
396
|
+
};
|
|
397
|
+
};
|
|
398
|
+
let Api = {
|
|
399
|
+
Make: Make$7
|
|
400
|
+
};
|
|
401
|
+
let deploySchemaHashPrefix = "deploy-schema-hash:";
|
|
402
|
+
let readSchemaHash = async (tableName, apiId) => {
|
|
403
|
+
let key = Object.fromEntries([[
|
|
404
|
+
"id",
|
|
405
|
+
deploySchemaHashPrefix + apiId
|
|
406
|
+
]]);
|
|
407
|
+
try {
|
|
408
|
+
let result = await DynamoDb_DocumentClient$AwsSdk.GetCommand.send(new LibDynamodb.GetCommand({
|
|
409
|
+
TableName: tableName,
|
|
410
|
+
Key: key
|
|
411
|
+
}));
|
|
412
|
+
return Stdlib_Option.flatMap(Stdlib_Option.flatMap(Stdlib_Option.flatMap(result.Item, item => Stdlib_JSON.Decode.object(item)), d => d["hash"]), v => Stdlib_JSON.Decode.string(v));
|
|
413
|
+
} catch (exn) {
|
|
414
|
+
return;
|
|
415
|
+
}
|
|
416
|
+
};
|
|
417
|
+
let writeSchemaHash = async (tableName, apiId, hash) => {
|
|
418
|
+
let item = Object.fromEntries([
|
|
419
|
+
[
|
|
420
|
+
"id",
|
|
421
|
+
deploySchemaHashPrefix + apiId
|
|
422
|
+
],
|
|
423
|
+
[
|
|
424
|
+
"hash",
|
|
425
|
+
hash
|
|
426
|
+
]
|
|
427
|
+
]);
|
|
428
|
+
await DynamoDb_DocumentClient$AwsSdk.PutCommand.send(new LibDynamodb.PutCommand({
|
|
429
|
+
Item: item,
|
|
430
|
+
TableName: tableName
|
|
431
|
+
}));
|
|
432
|
+
};
|
|
433
|
+
let hooksApiRef = {
|
|
434
|
+
contents: undefined
|
|
435
|
+
};
|
|
436
|
+
let hooksApiRoleRef = {
|
|
437
|
+
contents: undefined
|
|
438
|
+
};
|
|
439
|
+
let resolveHookedApi = () => {
|
|
440
|
+
let match = hooksApiRef.contents;
|
|
441
|
+
if (match !== undefined) {
|
|
442
|
+
return match.val;
|
|
443
|
+
} else {
|
|
444
|
+
return resolveTargetApi();
|
|
445
|
+
}
|
|
446
|
+
};
|
|
447
|
+
let hooks_subscriptionInfraHook = Stdlib_Option.map(domainEventsApiOpt, eventsApi => (params => {
|
|
448
|
+
let allEventTopics = params.allEventTopics;
|
|
449
|
+
let allQueryDbs = params.allQueryDbs;
|
|
450
|
+
let customOpts = Util_Pulumi$ReventlessCore.ComponentResourceOptions.toCustomResourceOptions(params.opts);
|
|
451
|
+
Stdlib_Dict.forEachWithKey(allQueryDbs, (_queryDbOutputs, readModelName) => {
|
|
452
|
+
if (!QueryDbStorage_DynamoDbStream$ReventlessAws.streamRegistry.has(readModelName)) {
|
|
453
|
+
return;
|
|
454
|
+
}
|
|
455
|
+
let topicName = Stdlib_Option.getOr(Stdlib_Option.map(Plugin_Helpers$ReventlessCore.queryFieldNamesRegistry[readModelName], qn => qn.listFieldName), readModelName);
|
|
456
|
+
StateTopic_AppSync$ReventlessAws.make(readModelName, topicName, allQueryDbs, eventsApi, customOpts);
|
|
457
|
+
});
|
|
458
|
+
params.eventLogEntries.forEach(entry => {
|
|
459
|
+
let isSns = EventTopicPublisher_SNS$ReventlessAws.snsRegistry.has(entry.displayName) || EventTopicPublisher_SNS$ReventlessAws.snsRegistry.has(entry.busKey);
|
|
460
|
+
let eventTopicOutputs = isSns ? Stdlib_Option.orElse(allEventTopics[entry.displayName], allEventTopics[entry.busKey]) : undefined;
|
|
461
|
+
Stdlib_Option.forEach(eventTopicOutputs, outputs => EventLogSubscription_AppSync$ReventlessAws.make(entry.displayName, entry.displayName, outputs, eventsApi, customOpts));
|
|
462
|
+
});
|
|
463
|
+
StateTopic_AppSync$ReventlessAws.finish(eventsApi, {});
|
|
464
|
+
}));
|
|
465
|
+
let hooks_preResolversSchemaHook = (name, version, pluginFragment) => {
|
|
466
|
+
log.info("preResolversSchemaHook", undefined, `Pushing schema for plugin ` + name + `@` + version + ` to AppSync`);
|
|
467
|
+
let capturedDeployTarget = currentDeployTarget.contents;
|
|
468
|
+
let match;
|
|
469
|
+
if (capturedDeployTarget === "Domain") {
|
|
470
|
+
match = [
|
|
471
|
+
"deploy-schema:",
|
|
472
|
+
domainApi
|
|
473
|
+
];
|
|
474
|
+
} else {
|
|
475
|
+
let match$1 = apiConfigRef.contents;
|
|
476
|
+
let api = match$1 !== undefined ? match$1.platformApi : domainApi;
|
|
477
|
+
match = [
|
|
478
|
+
"deploy-schema-platform:",
|
|
479
|
+
api
|
|
480
|
+
];
|
|
481
|
+
}
|
|
482
|
+
let targetApi = match[1];
|
|
483
|
+
let schemaPrefix = match[0];
|
|
484
|
+
let readStackRefString = (stackRef, key) => {
|
|
485
|
+
let direct = stackRef.getOutput(key);
|
|
486
|
+
let defaultOutput = stackRef.getOutput("default");
|
|
487
|
+
return Pulumi.all([
|
|
488
|
+
direct,
|
|
489
|
+
defaultOutput
|
|
490
|
+
]).apply(param => {
|
|
491
|
+
let name = Stdlib_Option.flatMap(param[0], v => Stdlib_JSON.Decode.string(v));
|
|
492
|
+
if (name !== undefined) {
|
|
493
|
+
return name;
|
|
494
|
+
} else {
|
|
495
|
+
return Stdlib_Option.flatMap(Stdlib_Option.flatMap(Stdlib_Option.flatMap(param[1], d => Stdlib_JSON.Decode.object(d)), d => d[key]), v => Stdlib_JSON.Decode.string(v));
|
|
496
|
+
}
|
|
497
|
+
});
|
|
498
|
+
};
|
|
499
|
+
let schemaPersistenceTableNameOutput;
|
|
500
|
+
if (platformStackRef !== undefined) {
|
|
501
|
+
let stackRef = Primitive_option.valFromOption(platformStackRef);
|
|
502
|
+
schemaPersistenceTableNameOutput = Pulumi.all([
|
|
503
|
+
readStackRefString(stackRef, "pluginSchemaPersistenceTableName"),
|
|
504
|
+
readStackRefString(stackRef, "pluginRmTableName")
|
|
505
|
+
]).apply(param => {
|
|
506
|
+
let dedicated = param[0];
|
|
507
|
+
if (dedicated !== undefined) {
|
|
508
|
+
return dedicated;
|
|
509
|
+
} else {
|
|
510
|
+
return param[1];
|
|
511
|
+
}
|
|
512
|
+
});
|
|
513
|
+
} else {
|
|
514
|
+
schemaPersistenceTableNameOutput = Pulumi.output(undefined);
|
|
515
|
+
}
|
|
516
|
+
return Output$Pulumi.flatMap(schemaPersistenceTableNameOutput, tableNameOpt => {
|
|
517
|
+
let writeAndScanFragments = () => {
|
|
518
|
+
if (tableNameOpt !== undefined) {
|
|
519
|
+
let deployItem = Object.fromEntries([
|
|
520
|
+
[
|
|
521
|
+
"id",
|
|
522
|
+
schemaPrefix + name
|
|
523
|
+
],
|
|
524
|
+
[
|
|
525
|
+
"fragment",
|
|
526
|
+
pluginFragment.encoded
|
|
527
|
+
]
|
|
528
|
+
]);
|
|
529
|
+
log.info("preResolversSchemaHook", undefined, `Writing deploy-schema entry for ` + name + ` to ` + tableNameOpt);
|
|
530
|
+
let scanAllDeploySchemaItems = async () => {
|
|
531
|
+
let allItems = [];
|
|
532
|
+
let startKey;
|
|
533
|
+
let more = true;
|
|
534
|
+
while (more) {
|
|
535
|
+
let result = await DynamoDb_DocumentClient$AwsSdk.ScanCommand.send(new LibDynamodb.ScanCommand({
|
|
536
|
+
TableName: tableNameOpt,
|
|
537
|
+
ExclusiveStartKey: startKey,
|
|
538
|
+
ExpressionAttributeNames: Object.fromEntries([[
|
|
539
|
+
"#id",
|
|
540
|
+
"id"
|
|
541
|
+
]]),
|
|
542
|
+
ExpressionAttributeValues: Object.fromEntries([[
|
|
543
|
+
":prefix",
|
|
544
|
+
schemaPrefix
|
|
545
|
+
]]),
|
|
546
|
+
FilterExpression: "begins_with(#id, :prefix)"
|
|
547
|
+
}));
|
|
548
|
+
Stdlib_Option.getOr(result.Items, []).forEach(item => {
|
|
549
|
+
allItems.push(item);
|
|
550
|
+
});
|
|
551
|
+
let k = result.LastEvaluatedKey;
|
|
552
|
+
if (k !== undefined) {
|
|
553
|
+
startKey = k;
|
|
554
|
+
} else {
|
|
555
|
+
more = false;
|
|
556
|
+
}
|
|
557
|
+
};
|
|
558
|
+
return allItems;
|
|
559
|
+
};
|
|
560
|
+
return Stdlib_Promise.$$catch(DynamoDb_DocumentClient$AwsSdk.PutCommand.send(new LibDynamodb.PutCommand({
|
|
561
|
+
Item: deployItem,
|
|
562
|
+
TableName: tableNameOpt
|
|
563
|
+
})).then(param => {
|
|
564
|
+
log.info("preResolversSchemaHook", undefined, `Scanning ` + tableNameOpt + ` for deploy-schema entries`);
|
|
565
|
+
return scanAllDeploySchemaItems();
|
|
566
|
+
}).then(items => {
|
|
567
|
+
let fragments = Stdlib_Array.filterMap(items, item => {
|
|
568
|
+
try {
|
|
569
|
+
let obj = JSON.parse(JSON.stringify(item));
|
|
570
|
+
let fragmentJson = Stdlib_Option.flatMap(Stdlib_JSON.Decode.object(obj), d => d["fragment"]);
|
|
571
|
+
if (fragmentJson === undefined) {
|
|
572
|
+
return;
|
|
573
|
+
}
|
|
574
|
+
let encoded = Stdlib_JSON.Decode.string(fragmentJson);
|
|
575
|
+
if (encoded !== undefined) {
|
|
576
|
+
return {
|
|
577
|
+
encoded: encoded,
|
|
578
|
+
protocol: "graphql"
|
|
579
|
+
};
|
|
580
|
+
} else {
|
|
581
|
+
return;
|
|
582
|
+
}
|
|
583
|
+
} catch (exn) {
|
|
584
|
+
return;
|
|
585
|
+
}
|
|
586
|
+
});
|
|
587
|
+
log.info("preResolversSchemaHook", undefined, `Found ` + fragments.length.toString() + ` deploy-schema entries`);
|
|
588
|
+
return Promise.resolve(fragments);
|
|
589
|
+
}), err => {
|
|
590
|
+
let msg = Stdlib_Option.getOr(Stdlib_Option.flatMap(Stdlib_JsExn.fromException(err), Stdlib_JsExn.message), "unknown");
|
|
591
|
+
log.info("preResolversSchemaHook", undefined, `DynamoDB write/scan failed (` + msg + `) — using current plugin only`);
|
|
592
|
+
return Promise.resolve([pluginFragment]);
|
|
593
|
+
});
|
|
594
|
+
}
|
|
595
|
+
log.info("preResolversSchemaHook", undefined, "No pluginSchemaPersistenceTableName / pluginRmTableName — skipping fragment persistence");
|
|
596
|
+
return Promise.resolve([pluginFragment]);
|
|
597
|
+
};
|
|
598
|
+
return Output$Pulumi.flatMap(targetApi, api => Output$Pulumi.flatMap(api.id, apiId => {
|
|
599
|
+
let runSchemaPush = () => writeAndScanFragments().then(async allPluginFragments => {
|
|
600
|
+
let baseFragment;
|
|
601
|
+
baseFragment = capturedDeployTarget === "Domain" && Config.splitApi ? emptyBaseFragment : AppSync_Adapter$ReventlessAws.injectAwsAuthAll(AdminApi$ReventlessCore.baseFragment(Config.cloner), "Admin");
|
|
602
|
+
let sdl = GraphQL_Stitcher$ReventlessCore.stitch(baseFragment, allPluginFragments);
|
|
603
|
+
let currentHash = AppSync_Adapter$ReventlessAws.sha256Hex(sdl);
|
|
604
|
+
let storedHash = tableNameOpt !== undefined ? await readSchemaHash(tableNameOpt, apiId) : undefined;
|
|
605
|
+
let client = AppSync_Adapter$ReventlessAws.getClient();
|
|
606
|
+
let liveSdl = await AppSync_Adapter$ReventlessAws.getIntrospectionSdl(client, apiId);
|
|
607
|
+
let countRoots = s => (GraphQL_Stitcher$ReventlessCore.countRootTypeFields(s, "Mutation") + GraphQL_Stitcher$ReventlessCore.countRootTypeFields(s, "Query") | 0) + GraphQL_Stitcher$ReventlessCore.countRootTypeFields(s, "Subscription") | 0;
|
|
608
|
+
let skipPush;
|
|
609
|
+
if (storedHash !== undefined && storedHash === currentHash) {
|
|
610
|
+
let expected = countRoots(sdl);
|
|
611
|
+
let live = countRoots(liveSdl);
|
|
612
|
+
if (liveSdl === "") {
|
|
613
|
+
log.info("preResolversSchemaHook", undefined, `hash matches but live schema could not be introspected — forcing repair push (check appsync:GetIntrospectionSchema permission)`);
|
|
614
|
+
skipPush = false;
|
|
615
|
+
} else if (live < expected) {
|
|
616
|
+
log.info("preResolversSchemaHook", undefined, `hash matches but live schema drifted (` + live.toString() + ` root field(s) live vs ` + expected.toString() + ` expected) — forcing repair push`);
|
|
617
|
+
skipPush = false;
|
|
618
|
+
} else {
|
|
619
|
+
log.info("preResolversSchemaHook", undefined, `SDL unchanged (hash ` + currentHash.slice(0, 12) + `…) and live schema intact (` + live.toString() + ` root fields); skipping push`);
|
|
620
|
+
skipPush = true;
|
|
621
|
+
}
|
|
622
|
+
} else {
|
|
623
|
+
skipPush = false;
|
|
624
|
+
}
|
|
625
|
+
if (!skipPush) {
|
|
626
|
+
if (GraphQL_Stitcher$ReventlessCore.isCatastrophicSchemaShrink(liveSdl, sdl, deploySchemaShrinkThreshold)) {
|
|
627
|
+
return log.error("preResolversSchemaHook", undefined, `ABORTED schema push for ` + apiId + `: stitched SDL (` + countRoots(sdl).toString() + ` root field(s)) would catastrophically shrink the live schema (` + countRoots(liveSdl).toString() + ` root field(s), threshold ` + deploySchemaShrinkThreshold.toString() + `) — refusing to clobber resolvers (likely a stale concurrent-deploy scan)`);
|
|
628
|
+
} else {
|
|
629
|
+
log.info("preResolversSchemaHook", undefined, `Pushing schema to API ` + apiId + ` (` + allPluginFragments.length.toString() + ` plugin fragments, new hash: ` + currentHash.slice(0, 12) + `…)`);
|
|
630
|
+
await AppSync_Adapter$ReventlessAws.startSchemaCreationRetrying(client, {
|
|
631
|
+
apiId: apiId,
|
|
632
|
+
definition: sdl
|
|
633
|
+
});
|
|
634
|
+
log.info("preResolversSchemaHook", undefined, "startSchemaCreation called, waiting for ACTIVE");
|
|
635
|
+
await AppSync_Adapter$ReventlessAws.waitForSchemaActive(client, apiId, undefined, undefined);
|
|
636
|
+
log.info("preResolversSchemaHook", undefined, "Schema is ACTIVE");
|
|
637
|
+
if (tableNameOpt !== undefined) {
|
|
638
|
+
return await writeSchemaHash(tableNameOpt, apiId, currentHash);
|
|
639
|
+
} else {
|
|
640
|
+
return;
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
});
|
|
645
|
+
if (tableNameOpt !== undefined) {
|
|
646
|
+
return AppSync_Adapter$ReventlessAws.withSchemaPushLock(tableNameOpt, apiId, undefined, undefined, runSchemaPush);
|
|
647
|
+
} else {
|
|
648
|
+
return runSchemaPush();
|
|
649
|
+
}
|
|
650
|
+
}));
|
|
651
|
+
});
|
|
652
|
+
};
|
|
653
|
+
let hooks_preAdminResolversSchemaHook = adminBarrier => {
|
|
654
|
+
let match = splitApiOutputsRef.contents;
|
|
655
|
+
let targetApi = match !== undefined ? match.platformApi : domainApi;
|
|
656
|
+
let adminBaseFragment = AppSync_Adapter$ReventlessAws.injectAwsAuthAll(AdminApi$ReventlessCore.baseFragment(Config.cloner), "Admin");
|
|
657
|
+
let sdl = GraphQL_Stitcher$ReventlessCore.stitch(adminBaseFragment, []);
|
|
658
|
+
return Output$Pulumi.flatMap(Pulumi.all([
|
|
659
|
+
targetApi,
|
|
660
|
+
adminBarrier
|
|
661
|
+
]), param => Output$Pulumi.flatMap(param[0].id, apiId => {
|
|
662
|
+
log.info("preAdminResolversSchemaHook", undefined, `Pushing admin schema to ` + apiId);
|
|
663
|
+
let client = AppSync_Adapter$ReventlessAws.getClient();
|
|
664
|
+
return AppSync_Adapter$ReventlessAws.startSchemaCreationRetrying(client, {
|
|
665
|
+
apiId: apiId,
|
|
666
|
+
definition: sdl
|
|
667
|
+
}).then(async () => {
|
|
668
|
+
log.info("preAdminResolversSchemaHook", undefined, "startSchemaCreation called, waiting for ACTIVE");
|
|
669
|
+
await AppSync_Adapter$ReventlessAws.waitForSchemaActive(client, apiId, undefined, undefined);
|
|
670
|
+
return log.info("preAdminResolversSchemaHook", undefined, "schema is ACTIVE");
|
|
671
|
+
});
|
|
672
|
+
}));
|
|
673
|
+
};
|
|
674
|
+
let hooks_inboundAppSyncResolverHook = param => InboundTranslationResolvers_AppSync$ReventlessAws.make(resolveHookedApi(), param.runtime, param.fieldNames, param.opts);
|
|
675
|
+
let hooks_dcbAppSyncResolverHook = param => CommandGeneratorResolvers_AppSync$ReventlessAws.makeDcb(resolveHookedApi(), param.runtime, param.fieldNames, param.tags, param.opts);
|
|
676
|
+
let hooks_onDcbEventLogCreated = dcbEventLogUnknown => {
|
|
677
|
+
let outputs = Component$ReventlessCore.outputs(dcbEventLogUnknown);
|
|
678
|
+
let tableResource = outputs.resources[0];
|
|
679
|
+
PluginRuntime_Builder$ReventlessAws.registerDcbTableName(tableResource.name);
|
|
680
|
+
};
|
|
681
|
+
let hooks_onDcbCommandTopicCreated = dcbCommandTopicUnknown => {
|
|
682
|
+
let channel = dcbCommandTopicUnknown.channel;
|
|
683
|
+
let channelParts = channel.parts;
|
|
684
|
+
AutomationSliceRuntime_Builder_Single$ReventlessAws.setDcbQueueUrl(channelParts.queue.id);
|
|
685
|
+
};
|
|
686
|
+
let hooks_onDcbSlicesCreated = dcbEventLogUnknown => {
|
|
687
|
+
StateViewSliceRuntime_Builder_Single$ReventlessAws.finishWithDcbEventLog(dcbEventLogUnknown);
|
|
688
|
+
AutomationSliceRuntime_Builder_Single$ReventlessAws.finish();
|
|
689
|
+
};
|
|
690
|
+
let hooks_onHeartbeatEpChannelAvailable = (remoteChannelUnknown, pluginId) => {
|
|
691
|
+
let resource = remoteChannelUnknown.resources[0];
|
|
692
|
+
if (resource !== undefined) {
|
|
693
|
+
return PluginRuntime_Builder$ReventlessAws.registerHeartbeatConfig(pluginId, undefined, Pulumi.output(resource.id), undefined);
|
|
694
|
+
} else {
|
|
695
|
+
return log.warn("Platform", undefined, "heartbeat EP channel has no resources");
|
|
696
|
+
}
|
|
697
|
+
};
|
|
698
|
+
let hooks_adminExtensionPoints = {
|
|
699
|
+
contents: Pulumi.output({})
|
|
700
|
+
};
|
|
701
|
+
let hooks_scheduler = {
|
|
702
|
+
contents: undefined
|
|
703
|
+
};
|
|
704
|
+
let hooks_schedulerRoleUrn = {
|
|
705
|
+
contents: Pulumi.output("")
|
|
706
|
+
};
|
|
707
|
+
let hooks_deployTarget = {
|
|
708
|
+
contents: "Domain"
|
|
709
|
+
};
|
|
710
|
+
let hooks = {
|
|
711
|
+
subscriptionInfraHook: hooks_subscriptionInfraHook,
|
|
712
|
+
preResolversSchemaHook: hooks_preResolversSchemaHook,
|
|
713
|
+
preAdminResolversSchemaHook: hooks_preAdminResolversSchemaHook,
|
|
714
|
+
inboundAppSyncResolverHook: hooks_inboundAppSyncResolverHook,
|
|
715
|
+
dcbAppSyncResolverHook: hooks_dcbAppSyncResolverHook,
|
|
716
|
+
onDcbEventLogCreated: hooks_onDcbEventLogCreated,
|
|
717
|
+
onDcbCommandTopicCreated: hooks_onDcbCommandTopicCreated,
|
|
718
|
+
onDcbSlicesCreated: hooks_onDcbSlicesCreated,
|
|
719
|
+
onHeartbeatEpChannelAvailable: hooks_onHeartbeatEpChannelAvailable,
|
|
720
|
+
adminExtensionPoints: hooks_adminExtensionPoints,
|
|
721
|
+
scheduler: hooks_scheduler,
|
|
722
|
+
schedulerRoleUrn: hooks_schedulerRoleUrn,
|
|
723
|
+
api: hooksApiRef,
|
|
724
|
+
apiRole: hooksApiRoleRef,
|
|
725
|
+
deployTarget: hooks_deployTarget
|
|
726
|
+
};
|
|
727
|
+
let PluginBuilderImpl = Plugin$ReventlessAws.Make({
|
|
728
|
+
hooks: hooks
|
|
729
|
+
});
|
|
730
|
+
let Plugin = PluginBuilderImpl;
|
|
731
|
+
let Admin = Platform_Admin$ReventlessCore.Make({
|
|
732
|
+
make: RuntimeEnvironment_Lambda$ReventlessAws.make,
|
|
733
|
+
groupBySource: RuntimeEnvironment_Lambda$ReventlessAws.groupBySource,
|
|
734
|
+
extractCorrelationId: RuntimeEnvironment_Lambda$ReventlessAws.extractCorrelationId,
|
|
735
|
+
asEventHandler: prim => prim,
|
|
736
|
+
asEffectHandler: prim => prim
|
|
737
|
+
})({
|
|
738
|
+
make: EventCollectorChannel_SQS$ReventlessAws.make,
|
|
739
|
+
connect: EventCollectorChannel_SQS$ReventlessAws.connect
|
|
740
|
+
})({
|
|
741
|
+
make: QueryEngine_DynamoDb$ReventlessAws.make
|
|
742
|
+
})(ClonerRunner_Fargate$ReventlessAws)(PluginRuntime_Builder$ReventlessAws.Make({
|
|
743
|
+
make: EventCollectorChannel_SQS$ReventlessAws.make,
|
|
744
|
+
connect: EventCollectorChannel_SQS$ReventlessAws.connect
|
|
745
|
+
}))(DcbEventLogStorage_DynamoDb$ReventlessAws)(EventTopicPublisher_DynamoDbStream$ReventlessAws)({
|
|
746
|
+
make: CommandTopicChannel_SQS_Sync$ReventlessAws.make
|
|
747
|
+
})({
|
|
748
|
+
make: CommandTopicChannel_SQS_Async$ReventlessAws.make
|
|
749
|
+
})({
|
|
750
|
+
silent: false,
|
|
751
|
+
splitApi: Config.splitApi,
|
|
752
|
+
cloner: Config.cloner,
|
|
753
|
+
hooks: hooks
|
|
754
|
+
});
|
|
755
|
+
let PluginAggregate = Aggregate_Builder_Single$ReventlessAws.Make({
|
|
756
|
+
Id: Id$Reventless.$$String,
|
|
757
|
+
name: PluginSpec$ReventlessCore.name,
|
|
758
|
+
eventSchema: PluginSpec$ReventlessCore.eventSchema,
|
|
759
|
+
errorSchema: PluginSpec$ReventlessCore.errorSchema,
|
|
760
|
+
commandSchema: PluginSpec$ReventlessCore.commandSchema,
|
|
761
|
+
moduleUrl: PluginSpec$ReventlessCore.moduleUrl,
|
|
762
|
+
commandAuthorization: PluginSpec$ReventlessCore.commandAuthorization
|
|
763
|
+
})({
|
|
764
|
+
initialState: PluginBehavior$ReventlessCore.initialState,
|
|
765
|
+
evolve: PluginBehavior$ReventlessCore.evolve,
|
|
766
|
+
decide: PluginBehavior$ReventlessCore.decide,
|
|
767
|
+
moduleUrl: PluginBehavior$ReventlessCore.moduleUrl
|
|
768
|
+
})(NoEventMappings$ReventlessInfra.Make({
|
|
769
|
+
name: PluginSpec$ReventlessCore.name,
|
|
770
|
+
Id: Id$Reventless.$$String,
|
|
771
|
+
commandSchema: PluginSpec$ReventlessCore.commandSchema
|
|
772
|
+
}));
|
|
773
|
+
let PluginReadModelMappings = {
|
|
774
|
+
moduleUrl: PluginsProjection$ReventlessCore.moduleUrl,
|
|
775
|
+
mappings: PluginsProjection$ReventlessCore.mappings
|
|
776
|
+
};
|
|
777
|
+
let PluginReadModel = ReadModel_Builder_Single_Stream$ReventlessAws.Make({
|
|
778
|
+
Id: Id$Reventless.$$String,
|
|
779
|
+
name: PluginsReadModelSpec$ReventlessCore.name,
|
|
780
|
+
moduleUrl: PluginsReadModelSpec$ReventlessCore.moduleUrl,
|
|
781
|
+
stateSchema: PluginsReadModelSpec$ReventlessCore.stateSchema,
|
|
782
|
+
config: PluginsReadModelSpec$ReventlessCore.config,
|
|
783
|
+
subIdConfig: undefined,
|
|
784
|
+
authorization: PluginsReadModelSpec$ReventlessCore.authorization,
|
|
785
|
+
visibility: PluginsReadModelSpec$ReventlessCore.visibility
|
|
786
|
+
})(PluginReadModelMappings);
|
|
787
|
+
let UIFragmentRegistryReadModelMappings = {
|
|
788
|
+
moduleUrl: UIFragmentRegistryProjection$ReventlessCore.moduleUrl,
|
|
789
|
+
mappings: UIFragmentRegistryProjection$ReventlessCore.mappings
|
|
790
|
+
};
|
|
791
|
+
let UIFragmentRegistryReadModel = ReadModel_Builder_NoResolver_Stream$ReventlessAws.Make({
|
|
792
|
+
Id: Id$Reventless.$$String,
|
|
793
|
+
name: UIFragmentRegistryReadModelSpec$ReventlessCore.name,
|
|
794
|
+
moduleUrl: UIFragmentRegistryReadModelSpec$ReventlessCore.moduleUrl,
|
|
795
|
+
stateSchema: UIFragmentRegistryReadModelSpec$ReventlessCore.stateSchema,
|
|
796
|
+
config: UIFragmentRegistryReadModelSpec$ReventlessCore.config,
|
|
797
|
+
subIdConfig: undefined,
|
|
798
|
+
authorization: UIFragmentRegistryReadModelSpec$ReventlessCore.authorization,
|
|
799
|
+
visibility: UIFragmentRegistryReadModelSpec$ReventlessCore.visibility
|
|
800
|
+
})(UIFragmentRegistryReadModelMappings);
|
|
801
|
+
let makeScheduler = () => {
|
|
802
|
+
let component = Scheduler$ReventlessAws.make(undefined);
|
|
803
|
+
let outputs = Component$ReventlessCore.outputs(component);
|
|
804
|
+
hooks_schedulerRoleUrn.contents = outputs.resource.urn;
|
|
805
|
+
return Component$ReventlessCore.operations(component);
|
|
806
|
+
};
|
|
807
|
+
let makePlatform = (version, plugins) => {
|
|
808
|
+
log.info("Platform", undefined, `v` + version);
|
|
809
|
+
let scheduler = makeScheduler();
|
|
810
|
+
hooks_scheduler.contents = scheduler;
|
|
811
|
+
hooksApiRef.contents = Platform_Casts$ReventlessAws.wrapHookedValue(domainApi);
|
|
812
|
+
hooksApiRoleRef.contents = Platform_Casts$ReventlessAws.wrapHookedValue(domainApiRole);
|
|
813
|
+
let match = Config.splitApi ? AppSync_Adapter$ReventlessAws.makeApiResource("PlatformApi", {}) : [
|
|
814
|
+
domainApi,
|
|
815
|
+
domainApiRole
|
|
816
|
+
];
|
|
817
|
+
let platformApiRole = match[1];
|
|
818
|
+
let platformApi = match[0];
|
|
819
|
+
if (Config.splitApi) {
|
|
820
|
+
splitApiOutputsRef.contents = {
|
|
821
|
+
platformApi: platformApi,
|
|
822
|
+
platformApiRole: platformApiRole
|
|
823
|
+
};
|
|
824
|
+
let c = apiConfigRef.contents;
|
|
825
|
+
if (c !== undefined) {
|
|
826
|
+
apiConfigRef.contents = {
|
|
827
|
+
domainApi: c.domainApi,
|
|
828
|
+
domainApiRole: c.domainApiRole,
|
|
829
|
+
platformApi: platformApi,
|
|
830
|
+
platformApiRole: platformApiRole
|
|
831
|
+
};
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
let admin = Admin.construct(version, [], [PluginAggregate], [
|
|
835
|
+
PluginReadModel,
|
|
836
|
+
UIFragmentRegistryReadModel
|
|
837
|
+
], scheduler, Util_ResourceNaming$ReventlessAws.operations, platformApi, platformApiRole, [], [], [], [], []);
|
|
838
|
+
let pluginRm = admin.readModelsOutputs["Plugins"];
|
|
839
|
+
if (pluginRm !== undefined) {
|
|
840
|
+
let r = pluginRm.queryDb.resources[0];
|
|
841
|
+
if (r !== undefined) {
|
|
842
|
+
Platform_ComponentDefinitions_Lambda$ReventlessAws.make(platformApi, r.name, {});
|
|
843
|
+
AggregateRuntime_Builder_Single$ReventlessAws.setPluginReadModelTable(r.name);
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
let rm = admin.readModelsOutputs["UIFragmentRegistry"];
|
|
847
|
+
if (rm !== undefined) {
|
|
848
|
+
let r$1 = rm.queryDb.resources[0];
|
|
849
|
+
if (r$1 !== undefined) {
|
|
850
|
+
Platform_UIFragments_Lambda$ReventlessAws.make(platformApi, r$1.name, {});
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
let pluginComponents = plugins.map(plugin => plugin.make());
|
|
854
|
+
let pluginComponent = pluginComponents[0];
|
|
855
|
+
if (pluginComponent !== undefined) {
|
|
856
|
+
Plugin_Helpers$ReventlessCore.exportPluginOutputs(Component$ReventlessCore.outputs(Primitive_option.valFromOption(pluginComponent)));
|
|
857
|
+
}
|
|
858
|
+
if (Config.splitApi) {
|
|
859
|
+
Pulumi$Pulumi.$$export("platformApiId", Output$Pulumi.flatMap(platformApi, api => api.id));
|
|
860
|
+
Pulumi$Pulumi.$$export("platformApiEndpoint", Output$Pulumi.flatMap(platformApi, api => api.uris.apply(uris => uris.GRAPHQL)));
|
|
861
|
+
Pulumi$Pulumi.$$export("platformApiRoleArn", Output$Pulumi.flatMap(platformApiRole, role => role.arn));
|
|
862
|
+
} else {
|
|
863
|
+
Pulumi$Pulumi.$$export("platformApiId", Output$Pulumi.flatMap(domainApi, api => api.id));
|
|
864
|
+
Pulumi$Pulumi.$$export("platformApiEndpoint", Output$Pulumi.flatMap(domainApi, api => api.uris.apply(uris => uris.GRAPHQL)));
|
|
865
|
+
Pulumi$Pulumi.$$export("platformApiRoleArn", Output$Pulumi.flatMap(domainApiRole, role => role.arn));
|
|
866
|
+
}
|
|
867
|
+
Pulumi$Pulumi.$$export("domainApiId", Output$Pulumi.flatMap(domainApi, api => api.id));
|
|
868
|
+
Pulumi$Pulumi.$$export("domainApiEndpoint", Output$Pulumi.flatMap(domainApi, api => api.uris.apply(uris => uris.GRAPHQL)));
|
|
869
|
+
Pulumi$Pulumi.$$export("domainApiRoleArn", Output$Pulumi.flatMap(domainApiRole, role => role.arn));
|
|
870
|
+
};
|
|
871
|
+
let deployPlatform = (version, hostUiBundle) => {
|
|
872
|
+
log.info("Platform:deployPlatform", undefined, `v` + version);
|
|
873
|
+
let scheduler = makeScheduler();
|
|
874
|
+
hooks_scheduler.contents = scheduler;
|
|
875
|
+
hooksApiRef.contents = Platform_Casts$ReventlessAws.wrapHookedValue(domainApi);
|
|
876
|
+
hooksApiRoleRef.contents = Platform_Casts$ReventlessAws.wrapHookedValue(domainApiRole);
|
|
877
|
+
let match = Config.splitApi ? AppSync_Adapter$ReventlessAws.makeApiResource("PlatformApi", {}) : [
|
|
878
|
+
domainApi,
|
|
879
|
+
domainApiRole
|
|
880
|
+
];
|
|
881
|
+
let platformApiRole = match[1];
|
|
882
|
+
let platformApi = match[0];
|
|
883
|
+
if (Config.splitApi) {
|
|
884
|
+
splitApiOutputsRef.contents = {
|
|
885
|
+
platformApi: platformApi,
|
|
886
|
+
platformApiRole: platformApiRole
|
|
887
|
+
};
|
|
888
|
+
let c = apiConfigRef.contents;
|
|
889
|
+
if (c !== undefined) {
|
|
890
|
+
apiConfigRef.contents = {
|
|
891
|
+
domainApi: c.domainApi,
|
|
892
|
+
domainApiRole: c.domainApiRole,
|
|
893
|
+
platformApi: platformApi,
|
|
894
|
+
platformApiRole: platformApiRole
|
|
895
|
+
};
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
let domainApiId = Output$Pulumi.flatMap(domainApi, api => api.id);
|
|
899
|
+
let updateApiSchema = async queryEngine => {
|
|
900
|
+
let apiId = domainApiId.get();
|
|
901
|
+
let plugins = await queryEngine.scan("Plugins", [[
|
|
902
|
+
"status",
|
|
903
|
+
"Contains",
|
|
904
|
+
{
|
|
905
|
+
TAG: "String",
|
|
906
|
+
_0: "Connected"
|
|
907
|
+
}
|
|
908
|
+
]], 1000);
|
|
909
|
+
let fragments = Stdlib_Array.filterMap(plugins, json => {
|
|
910
|
+
try {
|
|
911
|
+
let state = S.parseOrThrow(json, PluginsReadModelSpec$ReventlessCore.stateSchema);
|
|
912
|
+
let match = state.apiTarget;
|
|
913
|
+
if (match === "Platform") {
|
|
914
|
+
return;
|
|
915
|
+
} else {
|
|
916
|
+
return state.apiSchemaFragment;
|
|
917
|
+
}
|
|
918
|
+
} catch (exn) {
|
|
919
|
+
return;
|
|
920
|
+
}
|
|
921
|
+
});
|
|
922
|
+
let baseFragment = Config.splitApi ? emptyBaseFragment : AppSync_Adapter$ReventlessAws.injectAwsAuthAll(AdminApi$ReventlessCore.baseFragment(Config.cloner), "Admin");
|
|
923
|
+
let sdl = GraphQL_Stitcher$ReventlessCore.stitch(baseFragment, fragments);
|
|
924
|
+
return await AppSync_Adapter$ReventlessAws.startSchemaCreationRetrying(AppSync_Adapter$ReventlessAws.getClient(), {
|
|
925
|
+
apiId: apiId,
|
|
926
|
+
definition: sdl
|
|
927
|
+
});
|
|
928
|
+
};
|
|
929
|
+
let PluginExtensionPoint = Plugin_ExtensionPoint_Builder$ReventlessAws.MakeWithConfig({
|
|
930
|
+
updateApiSchema: updateApiSchema,
|
|
931
|
+
manageSubscriptions: undefined
|
|
932
|
+
});
|
|
933
|
+
let admin = Admin.construct(version, [PluginExtensionPoint], [PluginAggregate], [
|
|
934
|
+
PluginReadModel,
|
|
935
|
+
UIFragmentRegistryReadModel
|
|
936
|
+
], scheduler, Util_ResourceNaming$ReventlessAws.operations, platformApi, platformApiRole, [], [], [], [], []);
|
|
937
|
+
let pluginRm = admin.readModelsOutputs["Plugins"];
|
|
938
|
+
let pluginReadModelTableName;
|
|
939
|
+
if (pluginRm !== undefined) {
|
|
940
|
+
let r = pluginRm.queryDb.resources[0];
|
|
941
|
+
pluginReadModelTableName = r !== undefined ? r.name : undefined;
|
|
942
|
+
} else {
|
|
943
|
+
pluginReadModelTableName = undefined;
|
|
944
|
+
}
|
|
945
|
+
let pluginSchemaPersistenceTable = Util_DynamoDb$ReventlessAws.makeTable([{
|
|
946
|
+
name: "id",
|
|
947
|
+
type: "S"
|
|
948
|
+
}], undefined, undefined, undefined, undefined, {}, "PluginSchemaPersistence");
|
|
949
|
+
PluginExtensionPointRuntime_Builder$ReventlessAws.registerPluginExtensionPoint(pluginReadModelTableName, hooks_schedulerRoleUrn.contents, undefined);
|
|
950
|
+
let pluginEpEventTopicArn = Output$Pulumi.flatMap(admin.extensionPointsOutputs, eps => {
|
|
951
|
+
let ep = eps.find(ep => ep.name === PluginExtensionPointSpec$ReventlessInfra.name);
|
|
952
|
+
if (ep !== undefined) {
|
|
953
|
+
return Output$Pulumi.flatMap(ep.eventTopic, et => {
|
|
954
|
+
let r = et.resources[0];
|
|
955
|
+
if (r !== undefined) {
|
|
956
|
+
return r.urn;
|
|
957
|
+
} else {
|
|
958
|
+
return Pulumi.output("NOT_AVAILABLE");
|
|
959
|
+
}
|
|
960
|
+
});
|
|
961
|
+
} else {
|
|
962
|
+
return Pulumi.output("NOT_AVAILABLE");
|
|
963
|
+
}
|
|
964
|
+
});
|
|
965
|
+
PluginRuntime_Builder$ReventlessAws.registerConfig(pluginEpEventTopicArn, pluginReadModelTableName, pluginSchemaPersistenceTable.name, hooks_schedulerRoleUrn.contents, undefined, undefined, domainApiId, Config.cloner, undefined);
|
|
966
|
+
if (pluginReadModelTableName !== undefined) {
|
|
967
|
+
AggregateRuntime_Builder_Single$ReventlessAws.setPluginReadModelTable(pluginReadModelTableName);
|
|
968
|
+
Platform_ComponentDefinitions_Lambda$ReventlessAws.make(platformApi, pluginReadModelTableName, {});
|
|
969
|
+
}
|
|
970
|
+
let rm = admin.readModelsOutputs["UIFragmentRegistry"];
|
|
971
|
+
if (rm !== undefined) {
|
|
972
|
+
let r$1 = rm.queryDb.resources[0];
|
|
973
|
+
if (r$1 !== undefined) {
|
|
974
|
+
Platform_UIFragments_Lambda$ReventlessAws.make(platformApi, r$1.name, {});
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
if (Config.splitApi) {
|
|
978
|
+
Pulumi$Pulumi.$$export("platformApiId", Output$Pulumi.flatMap(platformApi, api => api.id));
|
|
979
|
+
Pulumi$Pulumi.$$export("platformApiEndpoint", Output$Pulumi.flatMap(platformApi, api => api.uris.apply(uris => uris.GRAPHQL)));
|
|
980
|
+
Pulumi$Pulumi.$$export("platformApiRoleArn", Output$Pulumi.flatMap(platformApiRole, role => role.arn));
|
|
981
|
+
} else {
|
|
982
|
+
Pulumi$Pulumi.$$export("platformApiId", Output$Pulumi.flatMap(domainApi, api => api.id));
|
|
983
|
+
Pulumi$Pulumi.$$export("platformApiEndpoint", Output$Pulumi.flatMap(domainApi, api => api.uris.apply(uris => uris.GRAPHQL)));
|
|
984
|
+
Pulumi$Pulumi.$$export("platformApiRoleArn", Output$Pulumi.flatMap(domainApiRole, role => role.arn));
|
|
985
|
+
}
|
|
986
|
+
Pulumi$Pulumi.$$export("domainApiId", Output$Pulumi.flatMap(domainApi, api => api.id));
|
|
987
|
+
Pulumi$Pulumi.$$export("domainApiEndpoint", Output$Pulumi.flatMap(domainApi, api => api.uris.apply(uris => uris.GRAPHQL)));
|
|
988
|
+
Pulumi$Pulumi.$$export("domainApiRoleArn", Output$Pulumi.flatMap(domainApiRole, role => role.arn));
|
|
989
|
+
if (domainEventsApiOpt !== undefined) {
|
|
990
|
+
Pulumi$Pulumi.$$export("eventsApiArn", domainEventsApiOpt.api.apiArn);
|
|
991
|
+
Pulumi$Pulumi.$$export("eventsApiDns", domainEventsApiOpt.api.dns.apply(dns => Stdlib_Option.getOr(dns.http, "")));
|
|
992
|
+
}
|
|
993
|
+
if (pluginReadModelTableName !== undefined) {
|
|
994
|
+
Pulumi$Pulumi.$$export("pluginRmTableName", pluginReadModelTableName);
|
|
995
|
+
}
|
|
996
|
+
Pulumi$Pulumi.$$export("pluginSchemaPersistenceTableName", pluginSchemaPersistenceTable.name);
|
|
997
|
+
Plugin_Helpers$ReventlessCore.exportPlatformOutputs(admin.extensionPointsOutputs, admin.aggregatesOutputs, admin.readModelsOutputs, admin.dcbEventLogOutputs, admin.stateChangeSlicesOutputs, admin.stateViewSlicesOutputs, admin.automationSlicesOutputs, admin.outboundTranslationSlicesOutputs, admin.inboundTranslationSlicesOutputs);
|
|
998
|
+
let resolvedDomainApiEndpoint = Output$Pulumi.flatMap(domainApi, api => api.uris.apply(uris => uris.GRAPHQL));
|
|
999
|
+
let resolvedDomainApiRoleArn = Output$Pulumi.flatMap(domainApiRole, role => role.arn);
|
|
1000
|
+
let resolvedPlatformApiEndpoint = Output$Pulumi.flatMap(platformApi, api => api.uris.apply(uris => uris.GRAPHQL));
|
|
1001
|
+
let resolvedPlatformApiRoleArn = Output$Pulumi.flatMap(platformApiRole, role => role.arn);
|
|
1002
|
+
let adminResourcesOutput = Pulumi.all(Object.values(admin.aggregatesOutputs).map(agg => Aggregate$ReventlessCore.toResolvedOutputs(agg).apply(r => [
|
|
1003
|
+
r.eventLog.resources,
|
|
1004
|
+
r.eventLog.eventTopic.resources,
|
|
1005
|
+
r.commandTopic.resources,
|
|
1006
|
+
r.commandGenerator.resources
|
|
1007
|
+
].flat())).concat(Object.values(admin.readModelsOutputs).map(rm => ReadModel$ReventlessCore.toResolvedOutputs(rm).apply(r => r.queryDb.resources)))).apply(arrays => arrays.flat());
|
|
1008
|
+
Pulumi.all([
|
|
1009
|
+
resolvedDomainApiEndpoint,
|
|
1010
|
+
resolvedDomainApiRoleArn,
|
|
1011
|
+
resolvedPlatformApiEndpoint,
|
|
1012
|
+
resolvedPlatformApiRoleArn,
|
|
1013
|
+
adminResourcesOutput
|
|
1014
|
+
]).apply(param => {
|
|
1015
|
+
let region = Stdlib_Option.getOr(new Pulumi.Config("aws").get("region"), "unknown");
|
|
1016
|
+
Plugin_Helpers$ReventlessCore.firePlatformDeployedHook({
|
|
1017
|
+
name: Pulumi.getProject(),
|
|
1018
|
+
environment: Pulumi.getStack(),
|
|
1019
|
+
region: region,
|
|
1020
|
+
domainApiEndpoint: param[0],
|
|
1021
|
+
domainApiRoleArn: param[1],
|
|
1022
|
+
platformApiEndpoint: param[2],
|
|
1023
|
+
platformApiRoleArn: param[3],
|
|
1024
|
+
adminResources: param[4]
|
|
1025
|
+
});
|
|
1026
|
+
});
|
|
1027
|
+
if (hostUiBundle !== undefined) {
|
|
1028
|
+
let match$1 = Util_LocalConfig$ReventlessAws.get("hostUiBaseDomain");
|
|
1029
|
+
let match$2 = Util_LocalConfig$ReventlessAws.get("hostUiHostedZoneId");
|
|
1030
|
+
let customDomain;
|
|
1031
|
+
if (match$1 !== undefined && match$2 !== undefined) {
|
|
1032
|
+
let stack = Pulumi.getStack();
|
|
1033
|
+
let baseName = Stdlib_Option.getOr(Util_LocalConfig$ReventlessAws.get("hostUiBaseName"), Pulumi.getProject());
|
|
1034
|
+
let prodStacks = Stdlib_Option.getOr(Stdlib_Option.map(Util_LocalConfig$ReventlessAws.get("hostUiProdStacks"), Util_HostUiDomain$ReventlessAws.parseProdStacks), Util_HostUiDomain$ReventlessAws.defaultProdStacks);
|
|
1035
|
+
let fqdn = Util_HostUiDomain$ReventlessAws.deriveFqdn(baseName, stack, match$1, prodStacks);
|
|
1036
|
+
customDomain = {
|
|
1037
|
+
fqdn: fqdn,
|
|
1038
|
+
hostedZoneId: match$2
|
|
1039
|
+
};
|
|
1040
|
+
} else {
|
|
1041
|
+
customDomain = undefined;
|
|
1042
|
+
}
|
|
1043
|
+
let match$3 = Plugin_Stack$ReventlessAws.makeUiBundleDistribution("host-ui", hostUiBundle.bundleVersion, hostUiBundle.assetsDir, true, undefined, true, ["config.json"], customDomain);
|
|
1044
|
+
let regionStr = Stdlib_Option.getOr(new Pulumi.Config("aws").get("region"), "unknown");
|
|
1045
|
+
let cognitoPool = Platform_Stack$ReventlessAws.resolveCognitoUserPool();
|
|
1046
|
+
let domainEventsEndpointOutput = domainEventsApiOpt !== undefined ? AppSync_EventsApi$ReventlessAws.httpEndpoint(domainEventsApiOpt).apply(ep => ep + "/event") : Pulumi.output(undefined);
|
|
1047
|
+
let configJsonContent = Pulumi.all([
|
|
1048
|
+
Pulumi.all([
|
|
1049
|
+
resolvedDomainApiEndpoint,
|
|
1050
|
+
resolvedPlatformApiEndpoint,
|
|
1051
|
+
cognitoPool.poolId,
|
|
1052
|
+
cognitoPool.clientId
|
|
1053
|
+
]),
|
|
1054
|
+
domainEventsEndpointOutput
|
|
1055
|
+
]).apply(param => {
|
|
1056
|
+
let eventsEpOpt = param[1];
|
|
1057
|
+
let match = param[0];
|
|
1058
|
+
let fields = [
|
|
1059
|
+
[
|
|
1060
|
+
"apiEndpoint",
|
|
1061
|
+
match[0]
|
|
1062
|
+
],
|
|
1063
|
+
[
|
|
1064
|
+
"platformApiEndpoint",
|
|
1065
|
+
match[1]
|
|
1066
|
+
],
|
|
1067
|
+
[
|
|
1068
|
+
"region",
|
|
1069
|
+
regionStr
|
|
1070
|
+
],
|
|
1071
|
+
[
|
|
1072
|
+
"authMode",
|
|
1073
|
+
"cognito"
|
|
1074
|
+
],
|
|
1075
|
+
[
|
|
1076
|
+
"cognitoUserPoolId",
|
|
1077
|
+
match[2]
|
|
1078
|
+
],
|
|
1079
|
+
[
|
|
1080
|
+
"cognitoClientId",
|
|
1081
|
+
match[3]
|
|
1082
|
+
],
|
|
1083
|
+
[
|
|
1084
|
+
"liveUpdates",
|
|
1085
|
+
true
|
|
1086
|
+
]
|
|
1087
|
+
];
|
|
1088
|
+
let withEvents = eventsEpOpt !== undefined ? fields.concat([
|
|
1089
|
+
[
|
|
1090
|
+
"domainApiEventsEndpoint",
|
|
1091
|
+
eventsEpOpt
|
|
1092
|
+
],
|
|
1093
|
+
[
|
|
1094
|
+
"platformApiEventsEndpoint",
|
|
1095
|
+
eventsEpOpt
|
|
1096
|
+
]
|
|
1097
|
+
]) : fields;
|
|
1098
|
+
return JSON.stringify(Object.fromEntries(withEvents));
|
|
1099
|
+
});
|
|
1100
|
+
new (Aws.s3.BucketObject)("host-ui-config-json", {
|
|
1101
|
+
bucket: match$3.bucketName,
|
|
1102
|
+
key: "config.json",
|
|
1103
|
+
content: configJsonContent,
|
|
1104
|
+
contentType: "application/json"
|
|
1105
|
+
});
|
|
1106
|
+
Pulumi$Pulumi.$$export("hostShellUrl", match$3.distributionUrl);
|
|
1107
|
+
}
|
|
1108
|
+
return Pulumi$Pulumi.getOutputs();
|
|
1109
|
+
};
|
|
1110
|
+
let startServers = () => {};
|
|
1111
|
+
let deployPlugin = (plugin, apiTargetOpt) => {
|
|
1112
|
+
let apiTarget = apiTargetOpt !== undefined ? apiTargetOpt : "Domain";
|
|
1113
|
+
let tmp;
|
|
1114
|
+
tmp = apiTarget === "Domain" ? "Domain" : "Platform";
|
|
1115
|
+
log.info("Platform:deployPlugin", undefined, `target=` + tmp);
|
|
1116
|
+
currentDeployTarget.contents = apiTarget;
|
|
1117
|
+
let tmp$1;
|
|
1118
|
+
tmp$1 = apiTarget === "Domain" ? "Domain" : "Platform";
|
|
1119
|
+
hooks_deployTarget.contents = tmp$1;
|
|
1120
|
+
let scheduler = makeScheduler();
|
|
1121
|
+
hooks_scheduler.contents = scheduler;
|
|
1122
|
+
let targetApi = resolveTargetApi();
|
|
1123
|
+
let targetApiRole = resolveTargetApiRole();
|
|
1124
|
+
hooksApiRef.contents = Platform_Casts$ReventlessAws.wrapHookedValue(targetApi);
|
|
1125
|
+
hooksApiRoleRef.contents = Platform_Casts$ReventlessAws.wrapHookedValue(targetApiRole);
|
|
1126
|
+
let pluginComponent = plugin.make();
|
|
1127
|
+
currentDeployTarget.contents = "Domain";
|
|
1128
|
+
Pulumi$Pulumi.$$export("_interopMeta", Plugin_Helpers$ReventlessCore.getInteropMeta());
|
|
1129
|
+
let pluginOutputs = Component$ReventlessCore.outputs(pluginComponent);
|
|
1130
|
+
Plugin_Helpers$ReventlessCore.exportPluginOutputs(pluginOutputs);
|
|
1131
|
+
let hbConfig = PluginRuntime_Builder$ReventlessAws.heartbeatConfigRef.contents;
|
|
1132
|
+
let match = IndexJs.isDryRun();
|
|
1133
|
+
let match$1 = hbConfig.epQueueUrl;
|
|
1134
|
+
if (match) {
|
|
1135
|
+
|
|
1136
|
+
} else if (match$1 !== undefined) {
|
|
1137
|
+
match$1.apply(async url => {
|
|
1138
|
+
let queue = {
|
|
1139
|
+
id: url,
|
|
1140
|
+
name: "",
|
|
1141
|
+
arn: ""
|
|
1142
|
+
};
|
|
1143
|
+
let publishHeartbeat = CommandTopicChannel_SQS_Runtime$ReventlessAws.publishJsons(queue, "SQS_FIFO");
|
|
1144
|
+
let message_id = hbConfig.pluginId;
|
|
1145
|
+
let message_meta = Message$ReventlessCore.generateMeta(PluginExtensionPointSpec$ReventlessInfra.name, undefined, "DeployHeartbeat", undefined, undefined, undefined, undefined, undefined);
|
|
1146
|
+
let message_commandJson = S.reverseConvertToJsonOrThrow({
|
|
1147
|
+
TAG: "Heartbeat",
|
|
1148
|
+
_0: hbConfig.heartbeatTimeout
|
|
1149
|
+
}, PluginExtensionPointSpec$ReventlessInfra.commandSchema);
|
|
1150
|
+
let message = {
|
|
1151
|
+
id: message_id,
|
|
1152
|
+
meta: message_meta,
|
|
1153
|
+
commandJson: message_commandJson
|
|
1154
|
+
};
|
|
1155
|
+
try {
|
|
1156
|
+
return await publishHeartbeat([message]);
|
|
1157
|
+
} catch (exn) {
|
|
1158
|
+
return log.warn("Platform:deployPlugin", undefined, `synthetic heartbeat failed for ` + hbConfig.pluginId + ` (handover falls back to the next natural heartbeat)`);
|
|
1159
|
+
}
|
|
1160
|
+
});
|
|
1161
|
+
} else {
|
|
1162
|
+
log.warn("Platform:deployPlugin", undefined, "synthetic heartbeat skipped: no EP queue URL in heartbeat config");
|
|
1163
|
+
}
|
|
1164
|
+
return Pulumi$Pulumi.getOutputs();
|
|
1165
|
+
};
|
|
1166
|
+
return {
|
|
1167
|
+
api: domainApi,
|
|
1168
|
+
apiRole: domainApiRole,
|
|
1169
|
+
Aggregate: Aggregate,
|
|
1170
|
+
ReadModel: ReadModel,
|
|
1171
|
+
ReadModelStream: ReadModelStream,
|
|
1172
|
+
ExtensionPoint: ExtensionPoint,
|
|
1173
|
+
Extension: Extension,
|
|
1174
|
+
Task: Task,
|
|
1175
|
+
Counter: Counter,
|
|
1176
|
+
StateChangeSlice: StateChangeSlice,
|
|
1177
|
+
StateViewSlice: {
|
|
1178
|
+
Make: include.Make
|
|
1179
|
+
},
|
|
1180
|
+
StateViewSliceStream: {
|
|
1181
|
+
Make: include$1.Make
|
|
1182
|
+
},
|
|
1183
|
+
AutomationSlice: {
|
|
1184
|
+
Make: include$2.Make
|
|
1185
|
+
},
|
|
1186
|
+
OutboundTranslationSlice: {
|
|
1187
|
+
Make: include$3.Make
|
|
1188
|
+
},
|
|
1189
|
+
InboundTranslationSlice: {
|
|
1190
|
+
Make: InboundTranslationSlice.Make
|
|
1191
|
+
},
|
|
1192
|
+
Api: Api,
|
|
1193
|
+
mcpSupported: false,
|
|
1194
|
+
Plugin: Plugin,
|
|
1195
|
+
makePlatform: makePlatform,
|
|
1196
|
+
deployPlatform: deployPlatform,
|
|
1197
|
+
deployPlugin: deployPlugin,
|
|
1198
|
+
startServers: startServers
|
|
1199
|
+
};
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
function Make($star) {
|
|
1203
|
+
let commandHandlerConfig = {};
|
|
1204
|
+
Stdlib_Option.forEach(commandHandlerConfig.aggregates, param => {
|
|
1205
|
+
Stdlib_Option.forEach(param.sync, AggregateRuntime_Builder_Single$ReventlessAws.setConfig);
|
|
1206
|
+
Stdlib_Option.forEach(param.async, AggregateRuntime_Builder_Single_Async$ReventlessAws.setConfig);
|
|
1207
|
+
});
|
|
1208
|
+
Stdlib_Option.forEach(commandHandlerConfig.stateChanges, param => PluginRuntime_Builder$ReventlessAws.setStateChangesConfig(param.sync, param.async, undefined));
|
|
1209
|
+
let currentDeployTarget = {
|
|
1210
|
+
contents: "Domain"
|
|
1211
|
+
};
|
|
1212
|
+
let platformStackRef = Stdlib_Option.map(new Pulumi.Config("platform").get("stack"), stack => new Pulumi.StackReference(stack));
|
|
1213
|
+
let makePhantomApi = (apiId, apiEndpoint) => ({
|
|
1214
|
+
id: Pulumi.output(apiId),
|
|
1215
|
+
arn: Pulumi.output(""),
|
|
1216
|
+
name: Pulumi.output(""),
|
|
1217
|
+
uris: Pulumi.output({
|
|
1218
|
+
GRAPHQL: apiEndpoint,
|
|
1219
|
+
REALTIME: ""
|
|
1220
|
+
})
|
|
1221
|
+
});
|
|
1222
|
+
let makePhantomRole = apiRoleArn => {
|
|
1223
|
+
let roleName = Stdlib_Option.getOr(apiRoleArn.split("/").at(-1), apiRoleArn);
|
|
1224
|
+
return {
|
|
1225
|
+
arn: Pulumi.output(apiRoleArn),
|
|
1226
|
+
name: Pulumi.output(roleName),
|
|
1227
|
+
id: Pulumi.output(roleName)
|
|
1228
|
+
};
|
|
1229
|
+
};
|
|
1230
|
+
let match;
|
|
1231
|
+
if (platformStackRef !== undefined) {
|
|
1232
|
+
let stackRef = Primitive_option.valFromOption(platformStackRef);
|
|
1233
|
+
let defaultOutput = stackRef.getOutput("default");
|
|
1234
|
+
let domainApiIdOutput = stackRef.getOutput("domainApiId");
|
|
1235
|
+
let domainApiEndpointOutput = stackRef.getOutput("domainApiEndpoint");
|
|
1236
|
+
let domainApiRoleArnOutput = stackRef.getOutput("domainApiRoleArn");
|
|
1237
|
+
let phantomApi = Pulumi.all([
|
|
1238
|
+
domainApiIdOutput,
|
|
1239
|
+
domainApiEndpointOutput,
|
|
1240
|
+
defaultOutput
|
|
1241
|
+
]).apply(param => {
|
|
1242
|
+
let $$default = param[2];
|
|
1243
|
+
let directEndpoint = param[1];
|
|
1244
|
+
let directId = param[0];
|
|
1245
|
+
let apiId = directId !== undefined ? directId : Stdlib_Option.getOrThrow(Stdlib_Option.flatMap(Stdlib_Option.flatMap(Stdlib_Option.flatMap($$default, d => Stdlib_JSON.Decode.object(d)), d => d["domainApiId"]), v => Stdlib_JSON.Decode.string(v)), undefined);
|
|
1246
|
+
let apiEndpoint = directEndpoint !== undefined ? directEndpoint : Stdlib_Option.getOrThrow(Stdlib_Option.flatMap(Stdlib_Option.flatMap(Stdlib_Option.flatMap($$default, d => Stdlib_JSON.Decode.object(d)), d => d["domainApiEndpoint"]), v => Stdlib_JSON.Decode.string(v)), "Platform stack does not export 'domainApiEndpoint' — redeploy the platform stack first");
|
|
1247
|
+
return makePhantomApi(apiId, apiEndpoint);
|
|
1248
|
+
});
|
|
1249
|
+
let phantomRole = Pulumi.all([
|
|
1250
|
+
domainApiRoleArnOutput,
|
|
1251
|
+
defaultOutput
|
|
1252
|
+
]).apply(param => {
|
|
1253
|
+
let direct = param[0];
|
|
1254
|
+
return makePhantomRole(direct !== undefined ? direct : Stdlib_Option.getOrThrow(Stdlib_Option.flatMap(Stdlib_Option.flatMap(Stdlib_Option.flatMap(param[1], d => Stdlib_JSON.Decode.object(d)), d => d["domainApiRoleArn"]), v => Stdlib_JSON.Decode.string(v)), undefined));
|
|
1255
|
+
});
|
|
1256
|
+
let platformApiIdOutput = stackRef.getOutput("platformApiId");
|
|
1257
|
+
let platformApiEndpointOutput = stackRef.getOutput("platformApiEndpoint");
|
|
1258
|
+
let platformApiRoleArnOutput = stackRef.getOutput("platformApiRoleArn");
|
|
1259
|
+
let phantomPlatformApi = Pulumi.all([
|
|
1260
|
+
platformApiIdOutput,
|
|
1261
|
+
platformApiEndpointOutput,
|
|
1262
|
+
defaultOutput
|
|
1263
|
+
]).apply(param => {
|
|
1264
|
+
let $$default = param[2];
|
|
1265
|
+
let getFromDefault = key => Stdlib_Option.flatMap(Stdlib_Option.flatMap(Stdlib_Option.flatMap($$default, d => Stdlib_JSON.Decode.object(d)), d => d[key]), v => Stdlib_JSON.Decode.string(v));
|
|
1266
|
+
let platformApiId = Stdlib_Option.getOrThrow(Stdlib_Option.orElse(param[0], getFromDefault("platformApiId")), undefined);
|
|
1267
|
+
let platformApiEndpoint = Stdlib_Option.getOrThrow(Stdlib_Option.orElse(param[1], getFromDefault("platformApiEndpoint")), undefined);
|
|
1268
|
+
return makePhantomApi(platformApiId, platformApiEndpoint);
|
|
1269
|
+
});
|
|
1270
|
+
let phantomPlatformRole = Pulumi.all([
|
|
1271
|
+
platformApiRoleArnOutput,
|
|
1272
|
+
defaultOutput
|
|
1273
|
+
]).apply(param => {
|
|
1274
|
+
let $$default = param[1];
|
|
1275
|
+
let getFromDefault = key => Stdlib_Option.flatMap(Stdlib_Option.flatMap(Stdlib_Option.flatMap($$default, d => Stdlib_JSON.Decode.object(d)), d => d[key]), v => Stdlib_JSON.Decode.string(v));
|
|
1276
|
+
return makePhantomRole(Stdlib_Option.getOrThrow(Stdlib_Option.orElse(param[0], getFromDefault("platformApiRoleArn")), undefined));
|
|
1277
|
+
});
|
|
1278
|
+
match = [
|
|
1279
|
+
phantomApi,
|
|
1280
|
+
phantomRole,
|
|
1281
|
+
phantomPlatformApi,
|
|
1282
|
+
phantomPlatformRole
|
|
1283
|
+
];
|
|
1284
|
+
} else {
|
|
1285
|
+
let match$1 = AppSync_Adapter$ReventlessAws.makeApiResource("DomainApi", {});
|
|
1286
|
+
let role = match$1[1];
|
|
1287
|
+
let api = match$1[0];
|
|
1288
|
+
match = [
|
|
1289
|
+
api,
|
|
1290
|
+
role,
|
|
1291
|
+
api,
|
|
1292
|
+
role
|
|
1293
|
+
];
|
|
1294
|
+
}
|
|
1295
|
+
let domainApiRole = match[1];
|
|
1296
|
+
let domainApi = match[0];
|
|
1297
|
+
apiConfigRef.contents = {
|
|
1298
|
+
domainApi: domainApi,
|
|
1299
|
+
domainApiRole: domainApiRole,
|
|
1300
|
+
platformApi: match[2],
|
|
1301
|
+
platformApiRole: match[3]
|
|
1302
|
+
};
|
|
1303
|
+
let domainEventsApiOpt;
|
|
1304
|
+
if (platformStackRef !== undefined) {
|
|
1305
|
+
let stackRef$1 = Primitive_option.valFromOption(platformStackRef);
|
|
1306
|
+
let eventsApiArnOutput = stackRef$1.getOutput("eventsApiArn");
|
|
1307
|
+
let eventsApiDnsOutput = stackRef$1.getOutput("eventsApiDns");
|
|
1308
|
+
let defaultEventsOutput = stackRef$1.getOutput("default");
|
|
1309
|
+
let getFromDefault = ($$default, key) => Stdlib_Option.flatMap(Stdlib_Option.flatMap(Stdlib_Option.flatMap($$default, d => Stdlib_JSON.Decode.object(d)), d => d[key]), v => Stdlib_JSON.Decode.string(v));
|
|
1310
|
+
let apiArn = Pulumi.all([
|
|
1311
|
+
eventsApiArnOutput,
|
|
1312
|
+
defaultEventsOutput
|
|
1313
|
+
]).apply(param => Stdlib_Option.orElse(param[0], getFromDefault(param[1], "eventsApiArn")));
|
|
1314
|
+
let dns = Pulumi.all([
|
|
1315
|
+
eventsApiDnsOutput,
|
|
1316
|
+
defaultEventsOutput
|
|
1317
|
+
]).apply(param => Stdlib_Option.orElse(param[0], getFromDefault(param[1], "eventsApiDns")));
|
|
1318
|
+
let api_apiId = Pulumi.output("");
|
|
1319
|
+
let api_apiArn = apiArn.apply(v => Stdlib_Option.getOr(v, ""));
|
|
1320
|
+
let api_dns = dns.apply(dnsHttp => ({
|
|
1321
|
+
http: dnsHttp
|
|
1322
|
+
}));
|
|
1323
|
+
let api_name = Pulumi.output("");
|
|
1324
|
+
let api$1 = {
|
|
1325
|
+
apiId: api_apiId,
|
|
1326
|
+
apiArn: api_apiArn,
|
|
1327
|
+
dns: api_dns,
|
|
1328
|
+
name: api_name
|
|
1329
|
+
};
|
|
1330
|
+
domainEventsApiOpt = {
|
|
1331
|
+
name: "DomainEventsApi",
|
|
1332
|
+
api: api$1,
|
|
1333
|
+
defaultNamespace: undefined
|
|
1334
|
+
};
|
|
1335
|
+
} else {
|
|
1336
|
+
let cognitoPool = Platform_Stack$ReventlessAws.resolveCognitoUserPool();
|
|
1337
|
+
let awsRegion = Stdlib_Option.getOr(new Pulumi.Config("aws").get("region"), "unknown");
|
|
1338
|
+
domainEventsApiOpt = AppSync_EventsApi$ReventlessAws.make("DomainEventsApi", cognitoPool.poolId, awsRegion, {});
|
|
1339
|
+
}
|
|
1340
|
+
let resolveTargetApi = () => {
|
|
1341
|
+
let match = currentDeployTarget.contents;
|
|
1342
|
+
if (match === "Domain") {
|
|
1343
|
+
return domainApi;
|
|
1344
|
+
}
|
|
1345
|
+
let match$1 = apiConfigRef.contents;
|
|
1346
|
+
if (match$1 !== undefined) {
|
|
1347
|
+
return match$1.platformApi;
|
|
1348
|
+
} else {
|
|
1349
|
+
return domainApi;
|
|
1350
|
+
}
|
|
1351
|
+
};
|
|
1352
|
+
let resolveTargetApiRole = () => {
|
|
1353
|
+
let match = currentDeployTarget.contents;
|
|
1354
|
+
if (match === "Domain") {
|
|
1355
|
+
return domainApiRole;
|
|
1356
|
+
}
|
|
1357
|
+
let match$1 = apiConfigRef.contents;
|
|
1358
|
+
if (match$1 !== undefined) {
|
|
1359
|
+
return match$1.platformApiRole;
|
|
1360
|
+
} else {
|
|
1361
|
+
return domainApiRole;
|
|
1362
|
+
}
|
|
1363
|
+
};
|
|
1364
|
+
let ApiConfig = {
|
|
1365
|
+
api: resolveTargetApi,
|
|
1366
|
+
apiRole: resolveTargetApiRole
|
|
1367
|
+
};
|
|
1368
|
+
let Make$1 = Spec => (Behavior => (EventMappings => Aggregate_Builder_Single$ReventlessAws.Make(Spec)(Behavior)(EventMappings)));
|
|
1369
|
+
let MakeAsync = Spec => (Behavior => (EventMappings => Aggregate_Builder_Single_Async$ReventlessAws.Make(Spec)(Behavior)(EventMappings)));
|
|
1370
|
+
let Aggregate = {
|
|
1371
|
+
Make: Make$1,
|
|
1372
|
+
MakeAsync: MakeAsync
|
|
1373
|
+
};
|
|
1374
|
+
let Make$2 = Spec => (Mappings => ReadModel_Builder_Single$ReventlessAws.Make(Spec)(Mappings));
|
|
1375
|
+
let ReadModel = {
|
|
1376
|
+
Make: Make$2
|
|
1377
|
+
};
|
|
1378
|
+
let Make$3 = Spec => (Mappings => ReadModel_Builder_Single_Stream$ReventlessAws.Make(Spec)(Mappings));
|
|
1379
|
+
let ReadModelStream = {
|
|
1380
|
+
Make: Make$3
|
|
1381
|
+
};
|
|
1382
|
+
let Make$4 = Mapping => {
|
|
1383
|
+
let CompiledMapping = ExtensionPointMapping$ReventlessInfra.Make(Mapping);
|
|
1384
|
+
let name = Mapping.Delegate.name;
|
|
1385
|
+
let mappings = [CompiledMapping];
|
|
1386
|
+
return ExtensionPoint_Builder$ReventlessAws.Make(Mapping.ExtensionPoint)({
|
|
1387
|
+
name: name,
|
|
1388
|
+
moduleUrl: Mapping.moduleUrl,
|
|
1389
|
+
mappings: mappings
|
|
1390
|
+
});
|
|
1391
|
+
};
|
|
1392
|
+
let Make2 = Mapping1 => (Mapping2 => {
|
|
1393
|
+
let CM1 = ExtensionPointMapping$ReventlessInfra.Make(Mapping1);
|
|
1394
|
+
let CM2 = ExtensionPointMapping$ReventlessInfra.Make(Mapping2);
|
|
1395
|
+
let name = Mapping1.Delegate.name + "+" + Mapping2.Delegate.name;
|
|
1396
|
+
let mappings = [
|
|
1397
|
+
CM1,
|
|
1398
|
+
CM2
|
|
1399
|
+
];
|
|
1400
|
+
return ExtensionPoint_Builder$ReventlessAws.Make(Mapping1.ExtensionPoint)({
|
|
1401
|
+
name: name,
|
|
1402
|
+
moduleUrl: Mapping1.moduleUrl,
|
|
1403
|
+
mappings: mappings
|
|
1404
|
+
});
|
|
1405
|
+
});
|
|
1406
|
+
let Make3 = Mapping1 => (Mapping2 => (Mapping3 => {
|
|
1407
|
+
let CM1 = ExtensionPointMapping$ReventlessInfra.Make(Mapping1);
|
|
1408
|
+
let CM2 = ExtensionPointMapping$ReventlessInfra.Make(Mapping2);
|
|
1409
|
+
let CM3 = ExtensionPointMapping$ReventlessInfra.Make(Mapping3);
|
|
1410
|
+
let name = Mapping1.Delegate.name + "+" + Mapping2.Delegate.name + "+" + Mapping3.Delegate.name;
|
|
1411
|
+
let mappings = [
|
|
1412
|
+
CM1,
|
|
1413
|
+
CM2,
|
|
1414
|
+
CM3
|
|
1415
|
+
];
|
|
1416
|
+
return ExtensionPoint_Builder$ReventlessAws.Make(Mapping1.ExtensionPoint)({
|
|
1417
|
+
name: name,
|
|
1418
|
+
moduleUrl: Mapping1.moduleUrl,
|
|
1419
|
+
mappings: mappings
|
|
1420
|
+
});
|
|
1421
|
+
}));
|
|
1422
|
+
let MakeMulti = Spec => (Mappings => ExtensionPoint_Builder$ReventlessAws.Make(Spec)(Mappings));
|
|
1423
|
+
let ExtensionPoint = {
|
|
1424
|
+
Make: Make$4,
|
|
1425
|
+
Make2: Make2,
|
|
1426
|
+
Make3: Make3,
|
|
1427
|
+
MakeMulti: MakeMulti
|
|
1428
|
+
};
|
|
1429
|
+
let Make$5 = Mapping => {
|
|
1430
|
+
let CompiledMapping = ExtensionMapping$ReventlessInfra.Make(Mapping);
|
|
1431
|
+
let name = Mapping.Delegate.name;
|
|
1432
|
+
let mappings = [CompiledMapping];
|
|
1433
|
+
return {
|
|
1434
|
+
Spec: Mapping.ExtensionPoint,
|
|
1435
|
+
name: name,
|
|
1436
|
+
moduleUrl: Mapping.moduleUrl,
|
|
1437
|
+
delegateModuleUrl: Mapping.delegateModuleUrl,
|
|
1438
|
+
mappings: mappings
|
|
1439
|
+
};
|
|
1440
|
+
};
|
|
1441
|
+
let Extension = {
|
|
1442
|
+
Make: Make$5
|
|
1443
|
+
};
|
|
1444
|
+
let Make$6 = Task_Builder_PerBucket$ReventlessAws.Make;
|
|
1445
|
+
let Task = {
|
|
1446
|
+
Make: Make$6
|
|
1447
|
+
};
|
|
1448
|
+
let Counter = Counter_Builder$ReventlessAws.Make(ApiConfig);
|
|
1449
|
+
let Make$7 = Spec => (Behavior => StateChangeSlice_Builder$ReventlessAws.Make(Spec)(Behavior));
|
|
1450
|
+
let MakeAsync$1 = Spec => (Behavior => {
|
|
1451
|
+
let include = StateChangeSlice_Builder$ReventlessAws.Make(Spec)(Behavior);
|
|
1452
|
+
return {
|
|
1453
|
+
Spec: include.Spec,
|
|
1454
|
+
Behavior: include.Behavior,
|
|
1455
|
+
isAsync: true,
|
|
1456
|
+
make: include.make
|
|
1457
|
+
};
|
|
1458
|
+
});
|
|
1459
|
+
let StateChangeSlice = {
|
|
1460
|
+
Make: Make$7,
|
|
1461
|
+
MakeAsync: MakeAsync$1
|
|
1462
|
+
};
|
|
1463
|
+
let include = StateViewSlice_Builder$ReventlessAws.Make(ApiConfig);
|
|
1464
|
+
let include$1 = StateViewSlice_Builder_Stream$ReventlessAws.Make(ApiConfig);
|
|
1465
|
+
let include$2 = AutomationSlice_Builder$ReventlessAws.Make(ApiConfig);
|
|
1466
|
+
let include$3 = OutboundTranslationSlice_Builder$ReventlessAws.Make(ApiConfig);
|
|
1467
|
+
let InboundTranslationSlice = InboundTranslationSlice_Builder$ReventlessAws.Make(ApiConfig);
|
|
1468
|
+
let emptyBaseFragment = GraphQL_Stitcher$ReventlessCore.encode({
|
|
1469
|
+
types: [],
|
|
1470
|
+
mutations: [],
|
|
1471
|
+
queries: [],
|
|
1472
|
+
subscriptions: []
|
|
1473
|
+
});
|
|
1474
|
+
let Make$8 = FragmentConfig => {
|
|
1475
|
+
let Builder = Api_Builder$ReventlessCore.Make({
|
|
1476
|
+
makeApiResource: AppSync_Adapter$ReventlessAws.makeApiResource,
|
|
1477
|
+
generateFragment: AppSync_Adapter$ReventlessAws.generateFragment,
|
|
1478
|
+
updateSchema: AppSync_Adapter$ReventlessAws.updateSchema
|
|
1479
|
+
});
|
|
1480
|
+
let make = (name, opts) => Builder.make(name, emptyBaseFragment, opts);
|
|
1481
|
+
return {
|
|
1482
|
+
make: make
|
|
1483
|
+
};
|
|
1484
|
+
};
|
|
1485
|
+
let Api = {
|
|
1486
|
+
Make: Make$8
|
|
1487
|
+
};
|
|
1488
|
+
let deploySchemaHashPrefix = "deploy-schema-hash:";
|
|
1489
|
+
let readSchemaHash = async (tableName, apiId) => {
|
|
1490
|
+
let key = Object.fromEntries([[
|
|
1491
|
+
"id",
|
|
1492
|
+
deploySchemaHashPrefix + apiId
|
|
1493
|
+
]]);
|
|
1494
|
+
try {
|
|
1495
|
+
let result = await DynamoDb_DocumentClient$AwsSdk.GetCommand.send(new LibDynamodb.GetCommand({
|
|
1496
|
+
TableName: tableName,
|
|
1497
|
+
Key: key
|
|
1498
|
+
}));
|
|
1499
|
+
return Stdlib_Option.flatMap(Stdlib_Option.flatMap(Stdlib_Option.flatMap(result.Item, item => Stdlib_JSON.Decode.object(item)), d => d["hash"]), v => Stdlib_JSON.Decode.string(v));
|
|
1500
|
+
} catch (exn) {
|
|
1501
|
+
return;
|
|
1502
|
+
}
|
|
1503
|
+
};
|
|
1504
|
+
let writeSchemaHash = async (tableName, apiId, hash) => {
|
|
1505
|
+
let item = Object.fromEntries([
|
|
1506
|
+
[
|
|
1507
|
+
"id",
|
|
1508
|
+
deploySchemaHashPrefix + apiId
|
|
1509
|
+
],
|
|
1510
|
+
[
|
|
1511
|
+
"hash",
|
|
1512
|
+
hash
|
|
1513
|
+
]
|
|
1514
|
+
]);
|
|
1515
|
+
await DynamoDb_DocumentClient$AwsSdk.PutCommand.send(new LibDynamodb.PutCommand({
|
|
1516
|
+
Item: item,
|
|
1517
|
+
TableName: tableName
|
|
1518
|
+
}));
|
|
1519
|
+
};
|
|
1520
|
+
let hooksApiRef = {
|
|
1521
|
+
contents: undefined
|
|
1522
|
+
};
|
|
1523
|
+
let hooksApiRoleRef = {
|
|
1524
|
+
contents: undefined
|
|
1525
|
+
};
|
|
1526
|
+
let resolveHookedApi = () => {
|
|
1527
|
+
let match = hooksApiRef.contents;
|
|
1528
|
+
if (match !== undefined) {
|
|
1529
|
+
return match.val;
|
|
1530
|
+
} else {
|
|
1531
|
+
return resolveTargetApi();
|
|
1532
|
+
}
|
|
1533
|
+
};
|
|
1534
|
+
let hooks_subscriptionInfraHook = Stdlib_Option.map(domainEventsApiOpt, eventsApi => (params => {
|
|
1535
|
+
let allEventTopics = params.allEventTopics;
|
|
1536
|
+
let allQueryDbs = params.allQueryDbs;
|
|
1537
|
+
let customOpts = Util_Pulumi$ReventlessCore.ComponentResourceOptions.toCustomResourceOptions(params.opts);
|
|
1538
|
+
Stdlib_Dict.forEachWithKey(allQueryDbs, (_queryDbOutputs, readModelName) => {
|
|
1539
|
+
if (!QueryDbStorage_DynamoDbStream$ReventlessAws.streamRegistry.has(readModelName)) {
|
|
1540
|
+
return;
|
|
1541
|
+
}
|
|
1542
|
+
let topicName = Stdlib_Option.getOr(Stdlib_Option.map(Plugin_Helpers$ReventlessCore.queryFieldNamesRegistry[readModelName], qn => qn.listFieldName), readModelName);
|
|
1543
|
+
StateTopic_AppSync$ReventlessAws.make(readModelName, topicName, allQueryDbs, eventsApi, customOpts);
|
|
1544
|
+
});
|
|
1545
|
+
params.eventLogEntries.forEach(entry => {
|
|
1546
|
+
let isSns = EventTopicPublisher_SNS$ReventlessAws.snsRegistry.has(entry.displayName) || EventTopicPublisher_SNS$ReventlessAws.snsRegistry.has(entry.busKey);
|
|
1547
|
+
let eventTopicOutputs = isSns ? Stdlib_Option.orElse(allEventTopics[entry.displayName], allEventTopics[entry.busKey]) : undefined;
|
|
1548
|
+
Stdlib_Option.forEach(eventTopicOutputs, outputs => EventLogSubscription_AppSync$ReventlessAws.make(entry.displayName, entry.displayName, outputs, eventsApi, customOpts));
|
|
1549
|
+
});
|
|
1550
|
+
StateTopic_AppSync$ReventlessAws.finish(eventsApi, {});
|
|
1551
|
+
}));
|
|
1552
|
+
let hooks_preResolversSchemaHook = (name, version, pluginFragment) => {
|
|
1553
|
+
log.info("preResolversSchemaHook", undefined, `Pushing schema for plugin ` + name + `@` + version + ` to AppSync`);
|
|
1554
|
+
let capturedDeployTarget = currentDeployTarget.contents;
|
|
1555
|
+
let match;
|
|
1556
|
+
if (capturedDeployTarget === "Domain") {
|
|
1557
|
+
match = [
|
|
1558
|
+
"deploy-schema:",
|
|
1559
|
+
domainApi
|
|
1560
|
+
];
|
|
1561
|
+
} else {
|
|
1562
|
+
let match$1 = apiConfigRef.contents;
|
|
1563
|
+
let api = match$1 !== undefined ? match$1.platformApi : domainApi;
|
|
1564
|
+
match = [
|
|
1565
|
+
"deploy-schema-platform:",
|
|
1566
|
+
api
|
|
1567
|
+
];
|
|
1568
|
+
}
|
|
1569
|
+
let targetApi = match[1];
|
|
1570
|
+
let schemaPrefix = match[0];
|
|
1571
|
+
let readStackRefString = (stackRef, key) => {
|
|
1572
|
+
let direct = stackRef.getOutput(key);
|
|
1573
|
+
let defaultOutput = stackRef.getOutput("default");
|
|
1574
|
+
return Pulumi.all([
|
|
1575
|
+
direct,
|
|
1576
|
+
defaultOutput
|
|
1577
|
+
]).apply(param => {
|
|
1578
|
+
let name = Stdlib_Option.flatMap(param[0], v => Stdlib_JSON.Decode.string(v));
|
|
1579
|
+
if (name !== undefined) {
|
|
1580
|
+
return name;
|
|
1581
|
+
} else {
|
|
1582
|
+
return Stdlib_Option.flatMap(Stdlib_Option.flatMap(Stdlib_Option.flatMap(param[1], d => Stdlib_JSON.Decode.object(d)), d => d[key]), v => Stdlib_JSON.Decode.string(v));
|
|
1583
|
+
}
|
|
1584
|
+
});
|
|
1585
|
+
};
|
|
1586
|
+
let schemaPersistenceTableNameOutput;
|
|
1587
|
+
if (platformStackRef !== undefined) {
|
|
1588
|
+
let stackRef = Primitive_option.valFromOption(platformStackRef);
|
|
1589
|
+
schemaPersistenceTableNameOutput = Pulumi.all([
|
|
1590
|
+
readStackRefString(stackRef, "pluginSchemaPersistenceTableName"),
|
|
1591
|
+
readStackRefString(stackRef, "pluginRmTableName")
|
|
1592
|
+
]).apply(param => {
|
|
1593
|
+
let dedicated = param[0];
|
|
1594
|
+
if (dedicated !== undefined) {
|
|
1595
|
+
return dedicated;
|
|
1596
|
+
} else {
|
|
1597
|
+
return param[1];
|
|
1598
|
+
}
|
|
1599
|
+
});
|
|
1600
|
+
} else {
|
|
1601
|
+
schemaPersistenceTableNameOutput = Pulumi.output(undefined);
|
|
1602
|
+
}
|
|
1603
|
+
return Output$Pulumi.flatMap(schemaPersistenceTableNameOutput, tableNameOpt => {
|
|
1604
|
+
let writeAndScanFragments = () => {
|
|
1605
|
+
if (tableNameOpt !== undefined) {
|
|
1606
|
+
let deployItem = Object.fromEntries([
|
|
1607
|
+
[
|
|
1608
|
+
"id",
|
|
1609
|
+
schemaPrefix + name
|
|
1610
|
+
],
|
|
1611
|
+
[
|
|
1612
|
+
"fragment",
|
|
1613
|
+
pluginFragment.encoded
|
|
1614
|
+
]
|
|
1615
|
+
]);
|
|
1616
|
+
log.info("preResolversSchemaHook", undefined, `Writing deploy-schema entry for ` + name + ` to ` + tableNameOpt);
|
|
1617
|
+
let scanAllDeploySchemaItems = async () => {
|
|
1618
|
+
let allItems = [];
|
|
1619
|
+
let startKey;
|
|
1620
|
+
let more = true;
|
|
1621
|
+
while (more) {
|
|
1622
|
+
let result = await DynamoDb_DocumentClient$AwsSdk.ScanCommand.send(new LibDynamodb.ScanCommand({
|
|
1623
|
+
TableName: tableNameOpt,
|
|
1624
|
+
ExclusiveStartKey: startKey,
|
|
1625
|
+
ExpressionAttributeNames: Object.fromEntries([[
|
|
1626
|
+
"#id",
|
|
1627
|
+
"id"
|
|
1628
|
+
]]),
|
|
1629
|
+
ExpressionAttributeValues: Object.fromEntries([[
|
|
1630
|
+
":prefix",
|
|
1631
|
+
schemaPrefix
|
|
1632
|
+
]]),
|
|
1633
|
+
FilterExpression: "begins_with(#id, :prefix)"
|
|
1634
|
+
}));
|
|
1635
|
+
Stdlib_Option.getOr(result.Items, []).forEach(item => {
|
|
1636
|
+
allItems.push(item);
|
|
1637
|
+
});
|
|
1638
|
+
let k = result.LastEvaluatedKey;
|
|
1639
|
+
if (k !== undefined) {
|
|
1640
|
+
startKey = k;
|
|
1641
|
+
} else {
|
|
1642
|
+
more = false;
|
|
1643
|
+
}
|
|
1644
|
+
};
|
|
1645
|
+
return allItems;
|
|
1646
|
+
};
|
|
1647
|
+
return Stdlib_Promise.$$catch(DynamoDb_DocumentClient$AwsSdk.PutCommand.send(new LibDynamodb.PutCommand({
|
|
1648
|
+
Item: deployItem,
|
|
1649
|
+
TableName: tableNameOpt
|
|
1650
|
+
})).then(param => {
|
|
1651
|
+
log.info("preResolversSchemaHook", undefined, `Scanning ` + tableNameOpt + ` for deploy-schema entries`);
|
|
1652
|
+
return scanAllDeploySchemaItems();
|
|
1653
|
+
}).then(items => {
|
|
1654
|
+
let fragments = Stdlib_Array.filterMap(items, item => {
|
|
1655
|
+
try {
|
|
1656
|
+
let obj = JSON.parse(JSON.stringify(item));
|
|
1657
|
+
let fragmentJson = Stdlib_Option.flatMap(Stdlib_JSON.Decode.object(obj), d => d["fragment"]);
|
|
1658
|
+
if (fragmentJson === undefined) {
|
|
1659
|
+
return;
|
|
1660
|
+
}
|
|
1661
|
+
let encoded = Stdlib_JSON.Decode.string(fragmentJson);
|
|
1662
|
+
if (encoded !== undefined) {
|
|
1663
|
+
return {
|
|
1664
|
+
encoded: encoded,
|
|
1665
|
+
protocol: "graphql"
|
|
1666
|
+
};
|
|
1667
|
+
} else {
|
|
1668
|
+
return;
|
|
1669
|
+
}
|
|
1670
|
+
} catch (exn) {
|
|
1671
|
+
return;
|
|
1672
|
+
}
|
|
1673
|
+
});
|
|
1674
|
+
log.info("preResolversSchemaHook", undefined, `Found ` + fragments.length.toString() + ` deploy-schema entries`);
|
|
1675
|
+
return Promise.resolve(fragments);
|
|
1676
|
+
}), err => {
|
|
1677
|
+
let msg = Stdlib_Option.getOr(Stdlib_Option.flatMap(Stdlib_JsExn.fromException(err), Stdlib_JsExn.message), "unknown");
|
|
1678
|
+
log.info("preResolversSchemaHook", undefined, `DynamoDB write/scan failed (` + msg + `) — using current plugin only`);
|
|
1679
|
+
return Promise.resolve([pluginFragment]);
|
|
1680
|
+
});
|
|
1681
|
+
}
|
|
1682
|
+
log.info("preResolversSchemaHook", undefined, "No pluginSchemaPersistenceTableName / pluginRmTableName — skipping fragment persistence");
|
|
1683
|
+
return Promise.resolve([pluginFragment]);
|
|
1684
|
+
};
|
|
1685
|
+
return Output$Pulumi.flatMap(targetApi, api => Output$Pulumi.flatMap(api.id, apiId => {
|
|
1686
|
+
let runSchemaPush = () => writeAndScanFragments().then(async allPluginFragments => {
|
|
1687
|
+
let baseFragment;
|
|
1688
|
+
baseFragment = capturedDeployTarget === "Domain" ? emptyBaseFragment : AppSync_Adapter$ReventlessAws.injectAwsAuthAll(AdminApi$ReventlessCore.baseFragment(false), "Admin");
|
|
1689
|
+
let sdl = GraphQL_Stitcher$ReventlessCore.stitch(baseFragment, allPluginFragments);
|
|
1690
|
+
let currentHash = AppSync_Adapter$ReventlessAws.sha256Hex(sdl);
|
|
1691
|
+
let storedHash = tableNameOpt !== undefined ? await readSchemaHash(tableNameOpt, apiId) : undefined;
|
|
1692
|
+
let client = AppSync_Adapter$ReventlessAws.getClient();
|
|
1693
|
+
let liveSdl = await AppSync_Adapter$ReventlessAws.getIntrospectionSdl(client, apiId);
|
|
1694
|
+
let countRoots = s => (GraphQL_Stitcher$ReventlessCore.countRootTypeFields(s, "Mutation") + GraphQL_Stitcher$ReventlessCore.countRootTypeFields(s, "Query") | 0) + GraphQL_Stitcher$ReventlessCore.countRootTypeFields(s, "Subscription") | 0;
|
|
1695
|
+
let skipPush;
|
|
1696
|
+
if (storedHash !== undefined && storedHash === currentHash) {
|
|
1697
|
+
let expected = countRoots(sdl);
|
|
1698
|
+
let live = countRoots(liveSdl);
|
|
1699
|
+
if (liveSdl === "") {
|
|
1700
|
+
log.info("preResolversSchemaHook", undefined, `hash matches but live schema could not be introspected — forcing repair push (check appsync:GetIntrospectionSchema permission)`);
|
|
1701
|
+
skipPush = false;
|
|
1702
|
+
} else if (live < expected) {
|
|
1703
|
+
log.info("preResolversSchemaHook", undefined, `hash matches but live schema drifted (` + live.toString() + ` root field(s) live vs ` + expected.toString() + ` expected) — forcing repair push`);
|
|
1704
|
+
skipPush = false;
|
|
1705
|
+
} else {
|
|
1706
|
+
log.info("preResolversSchemaHook", undefined, `SDL unchanged (hash ` + currentHash.slice(0, 12) + `…) and live schema intact (` + live.toString() + ` root fields); skipping push`);
|
|
1707
|
+
skipPush = true;
|
|
1708
|
+
}
|
|
1709
|
+
} else {
|
|
1710
|
+
skipPush = false;
|
|
1711
|
+
}
|
|
1712
|
+
if (!skipPush) {
|
|
1713
|
+
if (GraphQL_Stitcher$ReventlessCore.isCatastrophicSchemaShrink(liveSdl, sdl, deploySchemaShrinkThreshold)) {
|
|
1714
|
+
return log.error("preResolversSchemaHook", undefined, `ABORTED schema push for ` + apiId + `: stitched SDL (` + countRoots(sdl).toString() + ` root field(s)) would catastrophically shrink the live schema (` + countRoots(liveSdl).toString() + ` root field(s), threshold ` + deploySchemaShrinkThreshold.toString() + `) — refusing to clobber resolvers (likely a stale concurrent-deploy scan)`);
|
|
1715
|
+
} else {
|
|
1716
|
+
log.info("preResolversSchemaHook", undefined, `Pushing schema to API ` + apiId + ` (` + allPluginFragments.length.toString() + ` plugin fragments, new hash: ` + currentHash.slice(0, 12) + `…)`);
|
|
1717
|
+
await AppSync_Adapter$ReventlessAws.startSchemaCreationRetrying(client, {
|
|
1718
|
+
apiId: apiId,
|
|
1719
|
+
definition: sdl
|
|
1720
|
+
});
|
|
1721
|
+
log.info("preResolversSchemaHook", undefined, "startSchemaCreation called, waiting for ACTIVE");
|
|
1722
|
+
await AppSync_Adapter$ReventlessAws.waitForSchemaActive(client, apiId, undefined, undefined);
|
|
1723
|
+
log.info("preResolversSchemaHook", undefined, "Schema is ACTIVE");
|
|
1724
|
+
if (tableNameOpt !== undefined) {
|
|
1725
|
+
return await writeSchemaHash(tableNameOpt, apiId, currentHash);
|
|
1726
|
+
} else {
|
|
1727
|
+
return;
|
|
1728
|
+
}
|
|
1729
|
+
}
|
|
1730
|
+
}
|
|
1731
|
+
});
|
|
1732
|
+
if (tableNameOpt !== undefined) {
|
|
1733
|
+
return AppSync_Adapter$ReventlessAws.withSchemaPushLock(tableNameOpt, apiId, undefined, undefined, runSchemaPush);
|
|
1734
|
+
} else {
|
|
1735
|
+
return runSchemaPush();
|
|
1736
|
+
}
|
|
1737
|
+
}));
|
|
1738
|
+
});
|
|
1739
|
+
};
|
|
1740
|
+
let hooks_preAdminResolversSchemaHook = adminBarrier => {
|
|
1741
|
+
let match = splitApiOutputsRef.contents;
|
|
1742
|
+
let targetApi = match !== undefined ? match.platformApi : domainApi;
|
|
1743
|
+
let adminBaseFragment = AppSync_Adapter$ReventlessAws.injectAwsAuthAll(AdminApi$ReventlessCore.baseFragment(false), "Admin");
|
|
1744
|
+
let sdl = GraphQL_Stitcher$ReventlessCore.stitch(adminBaseFragment, []);
|
|
1745
|
+
return Output$Pulumi.flatMap(Pulumi.all([
|
|
1746
|
+
targetApi,
|
|
1747
|
+
adminBarrier
|
|
1748
|
+
]), param => Output$Pulumi.flatMap(param[0].id, apiId => {
|
|
1749
|
+
log.info("preAdminResolversSchemaHook", undefined, `Pushing admin schema to ` + apiId);
|
|
1750
|
+
let client = AppSync_Adapter$ReventlessAws.getClient();
|
|
1751
|
+
return AppSync_Adapter$ReventlessAws.startSchemaCreationRetrying(client, {
|
|
1752
|
+
apiId: apiId,
|
|
1753
|
+
definition: sdl
|
|
1754
|
+
}).then(async () => {
|
|
1755
|
+
log.info("preAdminResolversSchemaHook", undefined, "startSchemaCreation called, waiting for ACTIVE");
|
|
1756
|
+
await AppSync_Adapter$ReventlessAws.waitForSchemaActive(client, apiId, undefined, undefined);
|
|
1757
|
+
return log.info("preAdminResolversSchemaHook", undefined, "schema is ACTIVE");
|
|
1758
|
+
});
|
|
1759
|
+
}));
|
|
1760
|
+
};
|
|
1761
|
+
let hooks_inboundAppSyncResolverHook = param => InboundTranslationResolvers_AppSync$ReventlessAws.make(resolveHookedApi(), param.runtime, param.fieldNames, param.opts);
|
|
1762
|
+
let hooks_dcbAppSyncResolverHook = param => CommandGeneratorResolvers_AppSync$ReventlessAws.makeDcb(resolveHookedApi(), param.runtime, param.fieldNames, param.tags, param.opts);
|
|
1763
|
+
let hooks_onDcbEventLogCreated = dcbEventLogUnknown => {
|
|
1764
|
+
let outputs = Component$ReventlessCore.outputs(dcbEventLogUnknown);
|
|
1765
|
+
let tableResource = outputs.resources[0];
|
|
1766
|
+
PluginRuntime_Builder$ReventlessAws.registerDcbTableName(tableResource.name);
|
|
1767
|
+
};
|
|
1768
|
+
let hooks_onDcbCommandTopicCreated = dcbCommandTopicUnknown => {
|
|
1769
|
+
let channel = dcbCommandTopicUnknown.channel;
|
|
1770
|
+
let channelParts = channel.parts;
|
|
1771
|
+
AutomationSliceRuntime_Builder_Single$ReventlessAws.setDcbQueueUrl(channelParts.queue.id);
|
|
1772
|
+
};
|
|
1773
|
+
let hooks_onDcbSlicesCreated = dcbEventLogUnknown => {
|
|
1774
|
+
StateViewSliceRuntime_Builder_Single$ReventlessAws.finishWithDcbEventLog(dcbEventLogUnknown);
|
|
1775
|
+
AutomationSliceRuntime_Builder_Single$ReventlessAws.finish();
|
|
1776
|
+
};
|
|
1777
|
+
let hooks_onHeartbeatEpChannelAvailable = (remoteChannelUnknown, pluginId) => {
|
|
1778
|
+
let resource = remoteChannelUnknown.resources[0];
|
|
1779
|
+
if (resource !== undefined) {
|
|
1780
|
+
return PluginRuntime_Builder$ReventlessAws.registerHeartbeatConfig(pluginId, undefined, Pulumi.output(resource.id), undefined);
|
|
1781
|
+
} else {
|
|
1782
|
+
return log.warn("Platform", undefined, "heartbeat EP channel has no resources");
|
|
1783
|
+
}
|
|
1784
|
+
};
|
|
1785
|
+
let hooks_adminExtensionPoints = {
|
|
1786
|
+
contents: Pulumi.output({})
|
|
1787
|
+
};
|
|
1788
|
+
let hooks_scheduler = {
|
|
1789
|
+
contents: undefined
|
|
1790
|
+
};
|
|
1791
|
+
let hooks_schedulerRoleUrn = {
|
|
1792
|
+
contents: Pulumi.output("")
|
|
1793
|
+
};
|
|
1794
|
+
let hooks_deployTarget = {
|
|
1795
|
+
contents: "Domain"
|
|
1796
|
+
};
|
|
1797
|
+
let hooks = {
|
|
1798
|
+
subscriptionInfraHook: hooks_subscriptionInfraHook,
|
|
1799
|
+
preResolversSchemaHook: hooks_preResolversSchemaHook,
|
|
1800
|
+
preAdminResolversSchemaHook: hooks_preAdminResolversSchemaHook,
|
|
1801
|
+
inboundAppSyncResolverHook: hooks_inboundAppSyncResolverHook,
|
|
1802
|
+
dcbAppSyncResolverHook: hooks_dcbAppSyncResolverHook,
|
|
1803
|
+
onDcbEventLogCreated: hooks_onDcbEventLogCreated,
|
|
1804
|
+
onDcbCommandTopicCreated: hooks_onDcbCommandTopicCreated,
|
|
1805
|
+
onDcbSlicesCreated: hooks_onDcbSlicesCreated,
|
|
1806
|
+
onHeartbeatEpChannelAvailable: hooks_onHeartbeatEpChannelAvailable,
|
|
1807
|
+
adminExtensionPoints: hooks_adminExtensionPoints,
|
|
1808
|
+
scheduler: hooks_scheduler,
|
|
1809
|
+
schedulerRoleUrn: hooks_schedulerRoleUrn,
|
|
1810
|
+
api: hooksApiRef,
|
|
1811
|
+
apiRole: hooksApiRoleRef,
|
|
1812
|
+
deployTarget: hooks_deployTarget
|
|
1813
|
+
};
|
|
1814
|
+
let PluginBuilderImpl = Plugin$ReventlessAws.Make({
|
|
1815
|
+
hooks: hooks
|
|
1816
|
+
});
|
|
1817
|
+
let Plugin = PluginBuilderImpl;
|
|
1818
|
+
let Admin = Platform_Admin$ReventlessCore.Make({
|
|
1819
|
+
make: RuntimeEnvironment_Lambda$ReventlessAws.make,
|
|
1820
|
+
groupBySource: RuntimeEnvironment_Lambda$ReventlessAws.groupBySource,
|
|
1821
|
+
extractCorrelationId: RuntimeEnvironment_Lambda$ReventlessAws.extractCorrelationId,
|
|
1822
|
+
asEventHandler: prim => prim,
|
|
1823
|
+
asEffectHandler: prim => prim
|
|
1824
|
+
})({
|
|
1825
|
+
make: EventCollectorChannel_SQS$ReventlessAws.make,
|
|
1826
|
+
connect: EventCollectorChannel_SQS$ReventlessAws.connect
|
|
1827
|
+
})({
|
|
1828
|
+
make: QueryEngine_DynamoDb$ReventlessAws.make
|
|
1829
|
+
})(ClonerRunner_Fargate$ReventlessAws)(PluginRuntime_Builder$ReventlessAws.Make({
|
|
1830
|
+
make: EventCollectorChannel_SQS$ReventlessAws.make,
|
|
1831
|
+
connect: EventCollectorChannel_SQS$ReventlessAws.connect
|
|
1832
|
+
}))(DcbEventLogStorage_DynamoDb$ReventlessAws)(EventTopicPublisher_DynamoDbStream$ReventlessAws)({
|
|
1833
|
+
make: CommandTopicChannel_SQS_Sync$ReventlessAws.make
|
|
1834
|
+
})({
|
|
1835
|
+
make: CommandTopicChannel_SQS_Async$ReventlessAws.make
|
|
1836
|
+
})({
|
|
1837
|
+
silent: false,
|
|
1838
|
+
splitApi: true,
|
|
1839
|
+
cloner: false,
|
|
1840
|
+
hooks: hooks
|
|
1841
|
+
});
|
|
1842
|
+
let PluginAggregate = Aggregate_Builder_Single$ReventlessAws.Make({
|
|
1843
|
+
Id: Id$Reventless.$$String,
|
|
1844
|
+
name: PluginSpec$ReventlessCore.name,
|
|
1845
|
+
eventSchema: PluginSpec$ReventlessCore.eventSchema,
|
|
1846
|
+
errorSchema: PluginSpec$ReventlessCore.errorSchema,
|
|
1847
|
+
commandSchema: PluginSpec$ReventlessCore.commandSchema,
|
|
1848
|
+
moduleUrl: PluginSpec$ReventlessCore.moduleUrl,
|
|
1849
|
+
commandAuthorization: PluginSpec$ReventlessCore.commandAuthorization
|
|
1850
|
+
})({
|
|
1851
|
+
initialState: PluginBehavior$ReventlessCore.initialState,
|
|
1852
|
+
evolve: PluginBehavior$ReventlessCore.evolve,
|
|
1853
|
+
decide: PluginBehavior$ReventlessCore.decide,
|
|
1854
|
+
moduleUrl: PluginBehavior$ReventlessCore.moduleUrl
|
|
1855
|
+
})(NoEventMappings$ReventlessInfra.Make({
|
|
1856
|
+
name: PluginSpec$ReventlessCore.name,
|
|
1857
|
+
Id: Id$Reventless.$$String,
|
|
1858
|
+
commandSchema: PluginSpec$ReventlessCore.commandSchema
|
|
1859
|
+
}));
|
|
1860
|
+
let PluginReadModelMappings = {
|
|
1861
|
+
moduleUrl: PluginsProjection$ReventlessCore.moduleUrl,
|
|
1862
|
+
mappings: PluginsProjection$ReventlessCore.mappings
|
|
1863
|
+
};
|
|
1864
|
+
let PluginReadModel = ReadModel_Builder_Single_Stream$ReventlessAws.Make({
|
|
1865
|
+
Id: Id$Reventless.$$String,
|
|
1866
|
+
name: PluginsReadModelSpec$ReventlessCore.name,
|
|
1867
|
+
moduleUrl: PluginsReadModelSpec$ReventlessCore.moduleUrl,
|
|
1868
|
+
stateSchema: PluginsReadModelSpec$ReventlessCore.stateSchema,
|
|
1869
|
+
config: PluginsReadModelSpec$ReventlessCore.config,
|
|
1870
|
+
subIdConfig: undefined,
|
|
1871
|
+
authorization: PluginsReadModelSpec$ReventlessCore.authorization,
|
|
1872
|
+
visibility: PluginsReadModelSpec$ReventlessCore.visibility
|
|
1873
|
+
})(PluginReadModelMappings);
|
|
1874
|
+
let UIFragmentRegistryReadModelMappings = {
|
|
1875
|
+
moduleUrl: UIFragmentRegistryProjection$ReventlessCore.moduleUrl,
|
|
1876
|
+
mappings: UIFragmentRegistryProjection$ReventlessCore.mappings
|
|
1877
|
+
};
|
|
1878
|
+
let UIFragmentRegistryReadModel = ReadModel_Builder_NoResolver_Stream$ReventlessAws.Make({
|
|
1879
|
+
Id: Id$Reventless.$$String,
|
|
1880
|
+
name: UIFragmentRegistryReadModelSpec$ReventlessCore.name,
|
|
1881
|
+
moduleUrl: UIFragmentRegistryReadModelSpec$ReventlessCore.moduleUrl,
|
|
1882
|
+
stateSchema: UIFragmentRegistryReadModelSpec$ReventlessCore.stateSchema,
|
|
1883
|
+
config: UIFragmentRegistryReadModelSpec$ReventlessCore.config,
|
|
1884
|
+
subIdConfig: undefined,
|
|
1885
|
+
authorization: UIFragmentRegistryReadModelSpec$ReventlessCore.authorization,
|
|
1886
|
+
visibility: UIFragmentRegistryReadModelSpec$ReventlessCore.visibility
|
|
1887
|
+
})(UIFragmentRegistryReadModelMappings);
|
|
1888
|
+
let makeScheduler = () => {
|
|
1889
|
+
let component = Scheduler$ReventlessAws.make(undefined);
|
|
1890
|
+
let outputs = Component$ReventlessCore.outputs(component);
|
|
1891
|
+
hooks_schedulerRoleUrn.contents = outputs.resource.urn;
|
|
1892
|
+
return Component$ReventlessCore.operations(component);
|
|
1893
|
+
};
|
|
1894
|
+
let makePlatform = (version, plugins) => {
|
|
1895
|
+
log.info("Platform", undefined, `v` + version);
|
|
1896
|
+
let scheduler = makeScheduler();
|
|
1897
|
+
hooks_scheduler.contents = scheduler;
|
|
1898
|
+
hooksApiRef.contents = Platform_Casts$ReventlessAws.wrapHookedValue(domainApi);
|
|
1899
|
+
hooksApiRoleRef.contents = Platform_Casts$ReventlessAws.wrapHookedValue(domainApiRole);
|
|
1900
|
+
let match = AppSync_Adapter$ReventlessAws.makeApiResource("PlatformApi", {});
|
|
1901
|
+
let platformApiRole = match[1];
|
|
1902
|
+
let platformApi = match[0];
|
|
1903
|
+
splitApiOutputsRef.contents = {
|
|
1904
|
+
platformApi: platformApi,
|
|
1905
|
+
platformApiRole: platformApiRole
|
|
1906
|
+
};
|
|
1907
|
+
let c = apiConfigRef.contents;
|
|
1908
|
+
if (c !== undefined) {
|
|
1909
|
+
apiConfigRef.contents = {
|
|
1910
|
+
domainApi: c.domainApi,
|
|
1911
|
+
domainApiRole: c.domainApiRole,
|
|
1912
|
+
platformApi: platformApi,
|
|
1913
|
+
platformApiRole: platformApiRole
|
|
1914
|
+
};
|
|
1915
|
+
}
|
|
1916
|
+
let admin = Admin.construct(version, [], [PluginAggregate], [
|
|
1917
|
+
PluginReadModel,
|
|
1918
|
+
UIFragmentRegistryReadModel
|
|
1919
|
+
], scheduler, Util_ResourceNaming$ReventlessAws.operations, platformApi, platformApiRole, [], [], [], [], []);
|
|
1920
|
+
let pluginRm = admin.readModelsOutputs["Plugins"];
|
|
1921
|
+
if (pluginRm !== undefined) {
|
|
1922
|
+
let r = pluginRm.queryDb.resources[0];
|
|
1923
|
+
if (r !== undefined) {
|
|
1924
|
+
Platform_ComponentDefinitions_Lambda$ReventlessAws.make(platformApi, r.name, {});
|
|
1925
|
+
AggregateRuntime_Builder_Single$ReventlessAws.setPluginReadModelTable(r.name);
|
|
1926
|
+
}
|
|
1927
|
+
}
|
|
1928
|
+
let rm = admin.readModelsOutputs["UIFragmentRegistry"];
|
|
1929
|
+
if (rm !== undefined) {
|
|
1930
|
+
let r$1 = rm.queryDb.resources[0];
|
|
1931
|
+
if (r$1 !== undefined) {
|
|
1932
|
+
Platform_UIFragments_Lambda$ReventlessAws.make(platformApi, r$1.name, {});
|
|
1933
|
+
}
|
|
1934
|
+
}
|
|
1935
|
+
let pluginComponents = plugins.map(plugin => plugin.make());
|
|
1936
|
+
let pluginComponent = pluginComponents[0];
|
|
1937
|
+
if (pluginComponent !== undefined) {
|
|
1938
|
+
Plugin_Helpers$ReventlessCore.exportPluginOutputs(Component$ReventlessCore.outputs(Primitive_option.valFromOption(pluginComponent)));
|
|
1939
|
+
}
|
|
1940
|
+
Pulumi$Pulumi.$$export("platformApiId", Output$Pulumi.flatMap(platformApi, api => api.id));
|
|
1941
|
+
Pulumi$Pulumi.$$export("platformApiEndpoint", Output$Pulumi.flatMap(platformApi, api => api.uris.apply(uris => uris.GRAPHQL)));
|
|
1942
|
+
Pulumi$Pulumi.$$export("platformApiRoleArn", Output$Pulumi.flatMap(platformApiRole, role => role.arn));
|
|
1943
|
+
Pulumi$Pulumi.$$export("domainApiId", Output$Pulumi.flatMap(domainApi, api => api.id));
|
|
1944
|
+
Pulumi$Pulumi.$$export("domainApiEndpoint", Output$Pulumi.flatMap(domainApi, api => api.uris.apply(uris => uris.GRAPHQL)));
|
|
1945
|
+
Pulumi$Pulumi.$$export("domainApiRoleArn", Output$Pulumi.flatMap(domainApiRole, role => role.arn));
|
|
1946
|
+
};
|
|
1947
|
+
let deployPlatform = (version, hostUiBundle) => {
|
|
1948
|
+
log.info("Platform:deployPlatform", undefined, `v` + version);
|
|
1949
|
+
let scheduler = makeScheduler();
|
|
1950
|
+
hooks_scheduler.contents = scheduler;
|
|
1951
|
+
hooksApiRef.contents = Platform_Casts$ReventlessAws.wrapHookedValue(domainApi);
|
|
1952
|
+
hooksApiRoleRef.contents = Platform_Casts$ReventlessAws.wrapHookedValue(domainApiRole);
|
|
1953
|
+
let match = AppSync_Adapter$ReventlessAws.makeApiResource("PlatformApi", {});
|
|
1954
|
+
let platformApiRole = match[1];
|
|
1955
|
+
let platformApi = match[0];
|
|
1956
|
+
splitApiOutputsRef.contents = {
|
|
1957
|
+
platformApi: platformApi,
|
|
1958
|
+
platformApiRole: platformApiRole
|
|
1959
|
+
};
|
|
1960
|
+
let c = apiConfigRef.contents;
|
|
1961
|
+
if (c !== undefined) {
|
|
1962
|
+
apiConfigRef.contents = {
|
|
1963
|
+
domainApi: c.domainApi,
|
|
1964
|
+
domainApiRole: c.domainApiRole,
|
|
1965
|
+
platformApi: platformApi,
|
|
1966
|
+
platformApiRole: platformApiRole
|
|
1967
|
+
};
|
|
1968
|
+
}
|
|
1969
|
+
let domainApiId = Output$Pulumi.flatMap(domainApi, api => api.id);
|
|
1970
|
+
let updateApiSchema = async queryEngine => {
|
|
1971
|
+
let apiId = domainApiId.get();
|
|
1972
|
+
let plugins = await queryEngine.scan("Plugins", [[
|
|
1973
|
+
"status",
|
|
1974
|
+
"Contains",
|
|
1975
|
+
{
|
|
1976
|
+
TAG: "String",
|
|
1977
|
+
_0: "Connected"
|
|
1978
|
+
}
|
|
1979
|
+
]], 1000);
|
|
1980
|
+
let fragments = Stdlib_Array.filterMap(plugins, json => {
|
|
1981
|
+
try {
|
|
1982
|
+
let state = S.parseOrThrow(json, PluginsReadModelSpec$ReventlessCore.stateSchema);
|
|
1983
|
+
let match = state.apiTarget;
|
|
1984
|
+
if (match === "Platform") {
|
|
1985
|
+
return;
|
|
1986
|
+
} else {
|
|
1987
|
+
return state.apiSchemaFragment;
|
|
1988
|
+
}
|
|
1989
|
+
} catch (exn) {
|
|
1990
|
+
return;
|
|
1991
|
+
}
|
|
1992
|
+
});
|
|
1993
|
+
let sdl = GraphQL_Stitcher$ReventlessCore.stitch(emptyBaseFragment, fragments);
|
|
1994
|
+
return await AppSync_Adapter$ReventlessAws.startSchemaCreationRetrying(AppSync_Adapter$ReventlessAws.getClient(), {
|
|
1995
|
+
apiId: apiId,
|
|
1996
|
+
definition: sdl
|
|
1997
|
+
});
|
|
1998
|
+
};
|
|
1999
|
+
let PluginExtensionPoint = Plugin_ExtensionPoint_Builder$ReventlessAws.MakeWithConfig({
|
|
2000
|
+
updateApiSchema: updateApiSchema,
|
|
2001
|
+
manageSubscriptions: undefined
|
|
2002
|
+
});
|
|
2003
|
+
let admin = Admin.construct(version, [PluginExtensionPoint], [PluginAggregate], [
|
|
2004
|
+
PluginReadModel,
|
|
2005
|
+
UIFragmentRegistryReadModel
|
|
2006
|
+
], scheduler, Util_ResourceNaming$ReventlessAws.operations, platformApi, platformApiRole, [], [], [], [], []);
|
|
2007
|
+
let pluginRm = admin.readModelsOutputs["Plugins"];
|
|
2008
|
+
let pluginReadModelTableName;
|
|
2009
|
+
if (pluginRm !== undefined) {
|
|
2010
|
+
let r = pluginRm.queryDb.resources[0];
|
|
2011
|
+
pluginReadModelTableName = r !== undefined ? r.name : undefined;
|
|
2012
|
+
} else {
|
|
2013
|
+
pluginReadModelTableName = undefined;
|
|
2014
|
+
}
|
|
2015
|
+
let pluginSchemaPersistenceTable = Util_DynamoDb$ReventlessAws.makeTable([{
|
|
2016
|
+
name: "id",
|
|
2017
|
+
type: "S"
|
|
2018
|
+
}], undefined, undefined, undefined, undefined, {}, "PluginSchemaPersistence");
|
|
2019
|
+
PluginExtensionPointRuntime_Builder$ReventlessAws.registerPluginExtensionPoint(pluginReadModelTableName, hooks_schedulerRoleUrn.contents, undefined);
|
|
2020
|
+
let pluginEpEventTopicArn = Output$Pulumi.flatMap(admin.extensionPointsOutputs, eps => {
|
|
2021
|
+
let ep = eps.find(ep => ep.name === PluginExtensionPointSpec$ReventlessInfra.name);
|
|
2022
|
+
if (ep !== undefined) {
|
|
2023
|
+
return Output$Pulumi.flatMap(ep.eventTopic, et => {
|
|
2024
|
+
let r = et.resources[0];
|
|
2025
|
+
if (r !== undefined) {
|
|
2026
|
+
return r.urn;
|
|
2027
|
+
} else {
|
|
2028
|
+
return Pulumi.output("NOT_AVAILABLE");
|
|
2029
|
+
}
|
|
2030
|
+
});
|
|
2031
|
+
} else {
|
|
2032
|
+
return Pulumi.output("NOT_AVAILABLE");
|
|
2033
|
+
}
|
|
2034
|
+
});
|
|
2035
|
+
PluginRuntime_Builder$ReventlessAws.registerConfig(pluginEpEventTopicArn, pluginReadModelTableName, pluginSchemaPersistenceTable.name, hooks_schedulerRoleUrn.contents, undefined, undefined, domainApiId, false, undefined);
|
|
2036
|
+
if (pluginReadModelTableName !== undefined) {
|
|
2037
|
+
AggregateRuntime_Builder_Single$ReventlessAws.setPluginReadModelTable(pluginReadModelTableName);
|
|
2038
|
+
Platform_ComponentDefinitions_Lambda$ReventlessAws.make(platformApi, pluginReadModelTableName, {});
|
|
2039
|
+
}
|
|
2040
|
+
let rm = admin.readModelsOutputs["UIFragmentRegistry"];
|
|
2041
|
+
if (rm !== undefined) {
|
|
2042
|
+
let r$1 = rm.queryDb.resources[0];
|
|
2043
|
+
if (r$1 !== undefined) {
|
|
2044
|
+
Platform_UIFragments_Lambda$ReventlessAws.make(platformApi, r$1.name, {});
|
|
2045
|
+
}
|
|
2046
|
+
}
|
|
2047
|
+
Pulumi$Pulumi.$$export("platformApiId", Output$Pulumi.flatMap(platformApi, api => api.id));
|
|
2048
|
+
Pulumi$Pulumi.$$export("platformApiEndpoint", Output$Pulumi.flatMap(platformApi, api => api.uris.apply(uris => uris.GRAPHQL)));
|
|
2049
|
+
Pulumi$Pulumi.$$export("platformApiRoleArn", Output$Pulumi.flatMap(platformApiRole, role => role.arn));
|
|
2050
|
+
Pulumi$Pulumi.$$export("domainApiId", Output$Pulumi.flatMap(domainApi, api => api.id));
|
|
2051
|
+
Pulumi$Pulumi.$$export("domainApiEndpoint", Output$Pulumi.flatMap(domainApi, api => api.uris.apply(uris => uris.GRAPHQL)));
|
|
2052
|
+
Pulumi$Pulumi.$$export("domainApiRoleArn", Output$Pulumi.flatMap(domainApiRole, role => role.arn));
|
|
2053
|
+
if (domainEventsApiOpt !== undefined) {
|
|
2054
|
+
Pulumi$Pulumi.$$export("eventsApiArn", domainEventsApiOpt.api.apiArn);
|
|
2055
|
+
Pulumi$Pulumi.$$export("eventsApiDns", domainEventsApiOpt.api.dns.apply(dns => Stdlib_Option.getOr(dns.http, "")));
|
|
2056
|
+
}
|
|
2057
|
+
if (pluginReadModelTableName !== undefined) {
|
|
2058
|
+
Pulumi$Pulumi.$$export("pluginRmTableName", pluginReadModelTableName);
|
|
2059
|
+
}
|
|
2060
|
+
Pulumi$Pulumi.$$export("pluginSchemaPersistenceTableName", pluginSchemaPersistenceTable.name);
|
|
2061
|
+
Plugin_Helpers$ReventlessCore.exportPlatformOutputs(admin.extensionPointsOutputs, admin.aggregatesOutputs, admin.readModelsOutputs, admin.dcbEventLogOutputs, admin.stateChangeSlicesOutputs, admin.stateViewSlicesOutputs, admin.automationSlicesOutputs, admin.outboundTranslationSlicesOutputs, admin.inboundTranslationSlicesOutputs);
|
|
2062
|
+
let resolvedDomainApiEndpoint = Output$Pulumi.flatMap(domainApi, api => api.uris.apply(uris => uris.GRAPHQL));
|
|
2063
|
+
let resolvedDomainApiRoleArn = Output$Pulumi.flatMap(domainApiRole, role => role.arn);
|
|
2064
|
+
let resolvedPlatformApiEndpoint = Output$Pulumi.flatMap(platformApi, api => api.uris.apply(uris => uris.GRAPHQL));
|
|
2065
|
+
let resolvedPlatformApiRoleArn = Output$Pulumi.flatMap(platformApiRole, role => role.arn);
|
|
2066
|
+
let adminResourcesOutput = Pulumi.all(Object.values(admin.aggregatesOutputs).map(agg => Aggregate$ReventlessCore.toResolvedOutputs(agg).apply(r => [
|
|
2067
|
+
r.eventLog.resources,
|
|
2068
|
+
r.eventLog.eventTopic.resources,
|
|
2069
|
+
r.commandTopic.resources,
|
|
2070
|
+
r.commandGenerator.resources
|
|
2071
|
+
].flat())).concat(Object.values(admin.readModelsOutputs).map(rm => ReadModel$ReventlessCore.toResolvedOutputs(rm).apply(r => r.queryDb.resources)))).apply(arrays => arrays.flat());
|
|
2072
|
+
Pulumi.all([
|
|
2073
|
+
resolvedDomainApiEndpoint,
|
|
2074
|
+
resolvedDomainApiRoleArn,
|
|
2075
|
+
resolvedPlatformApiEndpoint,
|
|
2076
|
+
resolvedPlatformApiRoleArn,
|
|
2077
|
+
adminResourcesOutput
|
|
2078
|
+
]).apply(param => {
|
|
2079
|
+
let region = Stdlib_Option.getOr(new Pulumi.Config("aws").get("region"), "unknown");
|
|
2080
|
+
Plugin_Helpers$ReventlessCore.firePlatformDeployedHook({
|
|
2081
|
+
name: Pulumi.getProject(),
|
|
2082
|
+
environment: Pulumi.getStack(),
|
|
2083
|
+
region: region,
|
|
2084
|
+
domainApiEndpoint: param[0],
|
|
2085
|
+
domainApiRoleArn: param[1],
|
|
2086
|
+
platformApiEndpoint: param[2],
|
|
2087
|
+
platformApiRoleArn: param[3],
|
|
2088
|
+
adminResources: param[4]
|
|
2089
|
+
});
|
|
2090
|
+
});
|
|
2091
|
+
if (hostUiBundle !== undefined) {
|
|
2092
|
+
let match$1 = Util_LocalConfig$ReventlessAws.get("hostUiBaseDomain");
|
|
2093
|
+
let match$2 = Util_LocalConfig$ReventlessAws.get("hostUiHostedZoneId");
|
|
2094
|
+
let customDomain;
|
|
2095
|
+
if (match$1 !== undefined && match$2 !== undefined) {
|
|
2096
|
+
let stack = Pulumi.getStack();
|
|
2097
|
+
let baseName = Stdlib_Option.getOr(Util_LocalConfig$ReventlessAws.get("hostUiBaseName"), Pulumi.getProject());
|
|
2098
|
+
let prodStacks = Stdlib_Option.getOr(Stdlib_Option.map(Util_LocalConfig$ReventlessAws.get("hostUiProdStacks"), Util_HostUiDomain$ReventlessAws.parseProdStacks), Util_HostUiDomain$ReventlessAws.defaultProdStacks);
|
|
2099
|
+
let fqdn = Util_HostUiDomain$ReventlessAws.deriveFqdn(baseName, stack, match$1, prodStacks);
|
|
2100
|
+
customDomain = {
|
|
2101
|
+
fqdn: fqdn,
|
|
2102
|
+
hostedZoneId: match$2
|
|
2103
|
+
};
|
|
2104
|
+
} else {
|
|
2105
|
+
customDomain = undefined;
|
|
2106
|
+
}
|
|
2107
|
+
let match$3 = Plugin_Stack$ReventlessAws.makeUiBundleDistribution("host-ui", hostUiBundle.bundleVersion, hostUiBundle.assetsDir, true, undefined, true, ["config.json"], customDomain);
|
|
2108
|
+
let regionStr = Stdlib_Option.getOr(new Pulumi.Config("aws").get("region"), "unknown");
|
|
2109
|
+
let cognitoPool = Platform_Stack$ReventlessAws.resolveCognitoUserPool();
|
|
2110
|
+
let domainEventsEndpointOutput = domainEventsApiOpt !== undefined ? AppSync_EventsApi$ReventlessAws.httpEndpoint(domainEventsApiOpt).apply(ep => ep + "/event") : Pulumi.output(undefined);
|
|
2111
|
+
let configJsonContent = Pulumi.all([
|
|
2112
|
+
Pulumi.all([
|
|
2113
|
+
resolvedDomainApiEndpoint,
|
|
2114
|
+
resolvedPlatformApiEndpoint,
|
|
2115
|
+
cognitoPool.poolId,
|
|
2116
|
+
cognitoPool.clientId
|
|
2117
|
+
]),
|
|
2118
|
+
domainEventsEndpointOutput
|
|
2119
|
+
]).apply(param => {
|
|
2120
|
+
let eventsEpOpt = param[1];
|
|
2121
|
+
let match = param[0];
|
|
2122
|
+
let fields = [
|
|
2123
|
+
[
|
|
2124
|
+
"apiEndpoint",
|
|
2125
|
+
match[0]
|
|
2126
|
+
],
|
|
2127
|
+
[
|
|
2128
|
+
"platformApiEndpoint",
|
|
2129
|
+
match[1]
|
|
2130
|
+
],
|
|
2131
|
+
[
|
|
2132
|
+
"region",
|
|
2133
|
+
regionStr
|
|
2134
|
+
],
|
|
2135
|
+
[
|
|
2136
|
+
"authMode",
|
|
2137
|
+
"cognito"
|
|
2138
|
+
],
|
|
2139
|
+
[
|
|
2140
|
+
"cognitoUserPoolId",
|
|
2141
|
+
match[2]
|
|
2142
|
+
],
|
|
2143
|
+
[
|
|
2144
|
+
"cognitoClientId",
|
|
2145
|
+
match[3]
|
|
2146
|
+
],
|
|
2147
|
+
[
|
|
2148
|
+
"liveUpdates",
|
|
2149
|
+
true
|
|
2150
|
+
]
|
|
2151
|
+
];
|
|
2152
|
+
let withEvents = eventsEpOpt !== undefined ? fields.concat([
|
|
2153
|
+
[
|
|
2154
|
+
"domainApiEventsEndpoint",
|
|
2155
|
+
eventsEpOpt
|
|
2156
|
+
],
|
|
2157
|
+
[
|
|
2158
|
+
"platformApiEventsEndpoint",
|
|
2159
|
+
eventsEpOpt
|
|
2160
|
+
]
|
|
2161
|
+
]) : fields;
|
|
2162
|
+
return JSON.stringify(Object.fromEntries(withEvents));
|
|
2163
|
+
});
|
|
2164
|
+
new (Aws.s3.BucketObject)("host-ui-config-json", {
|
|
2165
|
+
bucket: match$3.bucketName,
|
|
2166
|
+
key: "config.json",
|
|
2167
|
+
content: configJsonContent,
|
|
2168
|
+
contentType: "application/json"
|
|
2169
|
+
});
|
|
2170
|
+
Pulumi$Pulumi.$$export("hostShellUrl", match$3.distributionUrl);
|
|
2171
|
+
}
|
|
2172
|
+
return Pulumi$Pulumi.getOutputs();
|
|
2173
|
+
};
|
|
2174
|
+
let startServers = () => {};
|
|
2175
|
+
let deployPlugin = (plugin, apiTargetOpt) => {
|
|
2176
|
+
let apiTarget = apiTargetOpt !== undefined ? apiTargetOpt : "Domain";
|
|
2177
|
+
let tmp;
|
|
2178
|
+
tmp = apiTarget === "Domain" ? "Domain" : "Platform";
|
|
2179
|
+
log.info("Platform:deployPlugin", undefined, `target=` + tmp);
|
|
2180
|
+
currentDeployTarget.contents = apiTarget;
|
|
2181
|
+
let tmp$1;
|
|
2182
|
+
tmp$1 = apiTarget === "Domain" ? "Domain" : "Platform";
|
|
2183
|
+
hooks_deployTarget.contents = tmp$1;
|
|
2184
|
+
let scheduler = makeScheduler();
|
|
2185
|
+
hooks_scheduler.contents = scheduler;
|
|
2186
|
+
let targetApi = resolveTargetApi();
|
|
2187
|
+
let targetApiRole = resolveTargetApiRole();
|
|
2188
|
+
hooksApiRef.contents = Platform_Casts$ReventlessAws.wrapHookedValue(targetApi);
|
|
2189
|
+
hooksApiRoleRef.contents = Platform_Casts$ReventlessAws.wrapHookedValue(targetApiRole);
|
|
2190
|
+
let pluginComponent = plugin.make();
|
|
2191
|
+
currentDeployTarget.contents = "Domain";
|
|
2192
|
+
Pulumi$Pulumi.$$export("_interopMeta", Plugin_Helpers$ReventlessCore.getInteropMeta());
|
|
2193
|
+
let pluginOutputs = Component$ReventlessCore.outputs(pluginComponent);
|
|
2194
|
+
Plugin_Helpers$ReventlessCore.exportPluginOutputs(pluginOutputs);
|
|
2195
|
+
let hbConfig = PluginRuntime_Builder$ReventlessAws.heartbeatConfigRef.contents;
|
|
2196
|
+
let match = IndexJs.isDryRun();
|
|
2197
|
+
let match$1 = hbConfig.epQueueUrl;
|
|
2198
|
+
if (match) {
|
|
2199
|
+
|
|
2200
|
+
} else if (match$1 !== undefined) {
|
|
2201
|
+
match$1.apply(async url => {
|
|
2202
|
+
let queue = {
|
|
2203
|
+
id: url,
|
|
2204
|
+
name: "",
|
|
2205
|
+
arn: ""
|
|
2206
|
+
};
|
|
2207
|
+
let publishHeartbeat = CommandTopicChannel_SQS_Runtime$ReventlessAws.publishJsons(queue, "SQS_FIFO");
|
|
2208
|
+
let message_id = hbConfig.pluginId;
|
|
2209
|
+
let message_meta = Message$ReventlessCore.generateMeta(PluginExtensionPointSpec$ReventlessInfra.name, undefined, "DeployHeartbeat", undefined, undefined, undefined, undefined, undefined);
|
|
2210
|
+
let message_commandJson = S.reverseConvertToJsonOrThrow({
|
|
2211
|
+
TAG: "Heartbeat",
|
|
2212
|
+
_0: hbConfig.heartbeatTimeout
|
|
2213
|
+
}, PluginExtensionPointSpec$ReventlessInfra.commandSchema);
|
|
2214
|
+
let message = {
|
|
2215
|
+
id: message_id,
|
|
2216
|
+
meta: message_meta,
|
|
2217
|
+
commandJson: message_commandJson
|
|
2218
|
+
};
|
|
2219
|
+
try {
|
|
2220
|
+
return await publishHeartbeat([message]);
|
|
2221
|
+
} catch (exn) {
|
|
2222
|
+
return log.warn("Platform:deployPlugin", undefined, `synthetic heartbeat failed for ` + hbConfig.pluginId + ` (handover falls back to the next natural heartbeat)`);
|
|
2223
|
+
}
|
|
2224
|
+
});
|
|
2225
|
+
} else {
|
|
2226
|
+
log.warn("Platform:deployPlugin", undefined, "synthetic heartbeat skipped: no EP queue URL in heartbeat config");
|
|
2227
|
+
}
|
|
2228
|
+
return Pulumi$Pulumi.getOutputs();
|
|
2229
|
+
};
|
|
2230
|
+
let StateViewSlice = {
|
|
2231
|
+
Make: include.Make
|
|
2232
|
+
};
|
|
2233
|
+
let StateViewSliceStream = {
|
|
2234
|
+
Make: include$1.Make
|
|
2235
|
+
};
|
|
2236
|
+
let AutomationSlice = {
|
|
2237
|
+
Make: include$2.Make
|
|
2238
|
+
};
|
|
2239
|
+
let OutboundTranslationSlice = {
|
|
2240
|
+
Make: include$3.Make
|
|
2241
|
+
};
|
|
2242
|
+
let InboundTranslationSlice$1 = {
|
|
2243
|
+
Make: InboundTranslationSlice.Make
|
|
2244
|
+
};
|
|
2245
|
+
return {
|
|
2246
|
+
api: domainApi,
|
|
2247
|
+
apiRole: domainApiRole,
|
|
2248
|
+
Aggregate: Aggregate,
|
|
2249
|
+
ReadModel: ReadModel,
|
|
2250
|
+
ReadModelStream: ReadModelStream,
|
|
2251
|
+
ExtensionPoint: ExtensionPoint,
|
|
2252
|
+
Extension: Extension,
|
|
2253
|
+
Task: Task,
|
|
2254
|
+
Counter: Counter,
|
|
2255
|
+
StateChangeSlice: StateChangeSlice,
|
|
2256
|
+
StateViewSlice: StateViewSlice,
|
|
2257
|
+
StateViewSliceStream: StateViewSliceStream,
|
|
2258
|
+
AutomationSlice: AutomationSlice,
|
|
2259
|
+
OutboundTranslationSlice: OutboundTranslationSlice,
|
|
2260
|
+
InboundTranslationSlice: InboundTranslationSlice$1,
|
|
2261
|
+
Api: Api,
|
|
2262
|
+
mcpSupported: false,
|
|
2263
|
+
Plugin: Plugin,
|
|
2264
|
+
makePlatform: makePlatform,
|
|
2265
|
+
deployPlatform: deployPlatform,
|
|
2266
|
+
deployPlugin: deployPlugin,
|
|
2267
|
+
startServers: startServers
|
|
2268
|
+
};
|
|
2269
|
+
}
|
|
2270
|
+
|
|
2271
|
+
export {
|
|
2272
|
+
log,
|
|
2273
|
+
deploySchemaShrinkThreshold,
|
|
2274
|
+
apiConfigRef,
|
|
2275
|
+
getApiConfig,
|
|
2276
|
+
splitApiOutputsRef,
|
|
2277
|
+
getSplitApiOutputs,
|
|
2278
|
+
MakeWithConfig,
|
|
2279
|
+
Make,
|
|
2280
|
+
}
|
|
2281
|
+
/* log Not a pure module */
|