@reventlessdev/reventless-local 3.0.0-alpha.249 → 3.0.0-alpha.251
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 +30 -0
- package/package.json +13 -13
- package/src/BakedManifest.res +5 -6
- package/src/EmitCapabilities.res +3 -1
- package/src/LocalPlatformRegistry.res +3 -1
- package/src/LocalPlatformStart.res +7 -6
- package/src/LocalSeedTarget.res +3 -1
- package/src/Platform.res +291 -215
- package/src/ShellConfig.res +10 -17
- package/src/UiHints.res +8 -14
- package/src/UiSlots.res +10 -17
- package/src/adapter/Api/LocalEvents_Server.res +5 -3
- package/src/adapter/Api/LocalGraphQL_Adapter.res +4 -4
- package/src/adapter/Auth/LocalAuth.res +12 -16
- package/src/adapter/Auth/LocalAuth.res.mjs +2 -1
- package/src/adapter/Auth/UserStore.res +13 -40
- package/src/adapter/Auth/UserStore.res.mjs +11 -67
- package/src/adapter/Backend.res +1 -2
- package/src/adapter/CommandGenerator/CommandGeneratorResolvers_GraphQL.res +42 -26
- package/src/adapter/CommandGenerator/InboundTranslationResolvers_GraphQL.res +13 -3
- package/src/adapter/CommandTopic/LocalCommandTopicChannel.res +15 -17
- package/src/adapter/CommandTopic/LocalCommandTopicRemoteChannel.res +18 -22
- package/src/adapter/Counter/LocalCounterHandler.res +1 -1
- package/src/adapter/DcbEventLog/DcbEventLogStorage_InMemory.res +33 -22
- package/src/adapter/DcbEventLog/DcbEventLogStorage_Sqlite.res +57 -57
- package/src/adapter/DomainGraphQL_Server.res +35 -34
- package/src/adapter/DomainMCP_Server.res +45 -41
- package/src/adapter/EventCollector/LocalEventCollectorChannel.res +47 -36
- package/src/adapter/EventHistory/EventHistoryResolvers_GraphQL.res +15 -12
- package/src/adapter/EventLog/EventLogStorage_InMemory.res +9 -4
- package/src/adapter/EventLog/EventLogStorage_Sqlite.res +36 -24
- package/src/adapter/EventTopic/LocalEventTopicPublisher.res +9 -3
- package/src/adapter/Heartbeat/LocalHeartbeatRunner.res +9 -14
- package/src/adapter/LocalBus.res +12 -12
- package/src/adapter/LocalCapabilities.res +6 -0
- package/src/adapter/LocalCapabilities.res.mjs +5 -2
- package/src/adapter/LocalGeocodeResolvers.res +1 -4
- package/src/adapter/LocalSideEffectHandler.res +1 -1
- package/src/adapter/LocalStateChangeDescriptor.res +2 -1
- package/src/adapter/MCP_ServerInstance.res +51 -39
- package/src/adapter/ObjectStore/LocalObjectStore.res +5 -2
- package/src/adapter/ObjectStore/ObjectStoreStorage_FileSystem.res +1 -2
- package/src/adapter/PlatformGraphQL_Server.res +10 -6
- package/src/adapter/PlatformGraphQL_Server.res.mjs +2 -1
- package/src/adapter/ProjectionCheckpoint.res +8 -1
- package/src/adapter/ProjectionPending.res +1 -3
- package/src/adapter/QueryDb/LocalQueryDbStorage.res +2 -1
- package/src/adapter/QueryDb/QueryDbResolvers_GraphQL.res +367 -269
- package/src/adapter/QueryDb/QueryDbStorage_InMemory.res +5 -3
- package/src/adapter/QueryDb/QueryDbStorage_Sqlite.res +63 -40
- package/src/adapter/QueryDb/SortKey_Filter.res +14 -6
- package/src/adapter/Runtime/LocalAggregateRuntime_Builder.res +12 -10
- package/src/adapter/Runtime/LocalEventCollectorRuntime_Builder.res +8 -2
- package/src/adapter/Runtime/LocalPluginRuntime_Builder.res +1 -4
- package/src/adapter/Scheduler/LocalScheduledPublisher.res +12 -12
- package/src/adapter/SqliteDriver.res +16 -4
- package/src/adapter/Task/TaskBucket_Sqlite.res +5 -6
- package/src/components/Aggregate_Builder.res +6 -1
- package/src/components/Counter_Builder.res +1 -5
- package/src/components/DcbEventLog_Builder.res +5 -3
- package/src/components/ExtensionPoint_Builder.res +13 -15
- package/src/components/InboundTranslationSlice_Builder.res +3 -2
- package/src/components/OutboundTranslationSlice_Builder.res +3 -2
- package/src/components/ReadModel_Builder.res +18 -20
- package/src/components/StateViewSlice_Builder.res +3 -2
- package/src/components/Task_Builder.res +12 -13
- package/src/reset/LocalSeedReset.res +2 -5
- package/src/test/Mocks/MockDcbEventLogStorage.res +5 -1
- package/src/test/Mocks/MockEventLogStorage.res +8 -3
- package/src/test/Mocks/MockQueryDbStorage.res +3 -2
- package/src/test/TestRunner.res +1 -1
- package/tests/BakedManifestFilesTest.res +7 -10
- package/tests/LocalEventTapTest.res +26 -21
- package/tests/LocalPlatformStartTest.res +33 -28
- package/tests/PluginEventDecodeTest.res +3 -3
- package/tests/ShellConfigTest.res +30 -21
- package/tests/SplitApiFixtures.res +34 -10
- package/tests/SplitApiTest.res +92 -62
- package/tests/adapter/BackendParityTest.res +180 -130
- package/tests/adapter/CollectNEventsTest.res +6 -4
- package/tests/adapter/CommandAuthorizationTest.res +47 -41
- package/tests/adapter/CommandTopicChannelTest.res +163 -139
- package/tests/adapter/CounterHandlerTest.res +95 -77
- package/tests/adapter/DcbEventLogStorageSqliteTest.res +171 -168
- package/tests/adapter/DcbEventLogStorageTest.res +264 -207
- package/tests/adapter/DomainGraphQL_ServerTest.res +53 -43
- package/tests/adapter/EventCollectorChannelTest.res +153 -124
- package/tests/adapter/EventHistoryResolverTest.res +46 -18
- package/tests/adapter/EventLogSnapshotParityTest.res +57 -45
- package/tests/adapter/EventLogStorageSqliteTest.res +9 -10
- package/tests/adapter/EventTapTest.res +37 -20
- package/tests/adapter/EventTopicPublisherTest.res +74 -50
- package/tests/adapter/GraphQLSubscriptionBridgeTest.res +4 -3
- package/tests/adapter/GraphQL_SchemaInspectorTest.res +666 -568
- package/tests/adapter/GraphQL_SubscriptionResolversTest.res +105 -96
- package/tests/adapter/HeartbeatRunnerTest.res +99 -81
- package/tests/adapter/InboundTranslationMutationTest.res +4 -1
- package/tests/adapter/LocalAuthHttpTest.res +79 -85
- package/tests/adapter/LocalAuthLoginTest.res +42 -50
- package/tests/adapter/LocalAuthTest.res +8 -16
- package/tests/adapter/LocalAuthUserStoreTest.res +2 -7
- package/tests/adapter/LocalBusBoundedTest.res +187 -117
- package/tests/adapter/LocalBusPubSubTest.res +118 -76
- package/tests/adapter/LocalDispatchContextTest.res +1 -2
- package/tests/adapter/LocalEvents_ServerTest.res +242 -187
- package/tests/adapter/PgProjectionCatchupTest.res +44 -10
- package/tests/adapter/ProjectionCheckpointTest.res +261 -206
- package/tests/adapter/QueryDbGsiTtlTest.res +123 -83
- package/tests/adapter/QueryDbListPushdownParityTest.res +107 -67
- package/tests/adapter/QueryDbListResolverTest.res +225 -208
- package/tests/adapter/QueryDbResolvedFieldsTest.res +17 -14
- package/tests/adapter/QueryDbStorageSqliteTest.res +33 -49
- package/tests/adapter/QueryDbStorageTest.res +163 -117
- package/tests/adapter/QueryDbUnionRoundTripTest.res +8 -10
- package/tests/adapter/QueryEngineTest.res +179 -126
- package/tests/adapter/ScheduledPublisherTest.res +171 -135
- package/tests/adapter/ServedBucketHttpTest.res +65 -59
- package/tests/adapter/SortKey_FilterTest.res +19 -3
- package/tests/adapter/SqliteDriverTest.res +13 -10
- package/tests/adapter/TaskBucketTest.res +94 -80
- package/tests/components/aggregate/AggregateTest.res +31 -18
- package/tests/components/automationslice/AutomationSliceCallbackTest.res +259 -222
- package/tests/components/automationslice/AutomationSliceFixtures.res +4 -2
- package/tests/components/automationslice/AutomationSliceSelfDeadlockFixtures.res +38 -38
- package/tests/components/automationslice/MixedSourceAutomationSliceFixtures.res +12 -14
- package/tests/components/automationslice/MixedSourceAutomationSliceTest.res +8 -32
- package/tests/components/commandgenerator/CommandGeneratorFixtures.res +7 -5
- package/tests/components/commandgenerator/CommandGeneratorTest.res +40 -31
- package/tests/components/commandtopic/CommandTopicFixtures.res +3 -4
- package/tests/components/commandtopic/CommandTopicStreamFixtures.res +7 -5
- package/tests/components/commandtopic/CommandTopicTest.res +24 -15
- package/tests/components/counter/CounterFixtures.res +6 -8
- package/tests/components/dcb/DcbCrossPartitionFixtures.res +8 -2
- package/tests/components/dcb/DcbCrossPartitionReadTest.res +20 -13
- package/tests/components/dcb/DcbEventLogAppendStreamTest.res +12 -8
- package/tests/components/dcb/DcbEventLogStreamTest.res +88 -61
- package/tests/components/dcb/DcbFixtures.res +4 -1
- package/tests/components/dcb/DcbTest.res +9 -6
- package/tests/components/eventcollector/EventCollectorFixtures.res +0 -1
- package/tests/components/eventcollector/EventCollectorTest.res +6 -3
- package/tests/components/eventlog/EventLogAppendStreamTest.res +88 -68
- package/tests/components/eventlog/EventLogConflictTest.res +8 -4
- package/tests/components/eventlog/EventLogFixtures.res +3 -3
- package/tests/components/eventlog/EventLogProvisioningSeamTest.res +26 -13
- package/tests/components/eventlog/EventLogStreamTest.res +119 -56
- package/tests/components/eventlog/EventLogTest.res +20 -4
- package/tests/components/eventtopic/EventTopicFixtures.res +3 -3
- package/tests/components/eventtopic/EventTopicStreamFixtures.res +1 -2
- package/tests/components/eventtopic/EventTopicStreamTest.res +7 -1
- package/tests/components/extensionpoint/ExtensionPointFixtures.res +14 -9
- package/tests/components/extensionpoint/ExtensionPointTest.res +3 -2
- package/tests/components/heartbeat/HeartbeatFixtures.res +5 -6
- package/tests/components/heartbeat/HeartbeatTest.res +56 -47
- package/tests/components/inboundtranslationslice/InboundTranslationSliceCallbackTest.res +271 -249
- package/tests/components/inboundtranslationslice/InboundTranslationSliceFixtures.res +3 -2
- package/tests/components/outboundtranslationslice/OutboundTranslationSliceCallbackTest.res +361 -276
- package/tests/components/outboundtranslationslice/OutboundTranslationSliceFixtures.res +8 -10
- package/tests/components/outboundtranslationslice/OutboundTranslationSlicePlatformFixtures.res +37 -43
- package/tests/components/querydb/QueryDbFixtures.res +1 -5
- package/tests/components/querydb/QueryDbTest.res +2 -4
- package/tests/components/readmodel/DcbReadModelE2EFixtures.res +15 -18
- package/tests/components/readmodel/MixedSourceReadModelFixtures.res +5 -7
- package/tests/components/readmodel/ReadModelFixtures.res +8 -8
- package/tests/components/scheduler/SchedulerTest.res +76 -58
- package/tests/components/sideeffecthandler/SideEffectHandlerFixtures.res +4 -4
- package/tests/components/stateviewslice/StateViewSliceDisplayNameFixtures.res +5 -7
- package/tests/components/stateviewslice/StateViewSliceFixtures.res +8 -6
- package/tests/components/stateviewslice/StateViewSliceSubIdFixtures.res +17 -11
- package/tests/components/stateviewslice/StateViewSliceSubIdTest.res +12 -2
- package/tests/components/task/TaskFixtures.res +5 -5
- package/tests/components/task/TaskTest.res +95 -80
- package/tests/plugin/PluginsProjection_GWT.res +3 -1
- package/tests/plugin/UiFragments_GWT.res +6 -1
- package/tests/reset/LocalSeedResetTest.res +1 -0
|
@@ -11,91 +11,106 @@ describe("Task_Builder.Make:", () => {
|
|
|
11
11
|
let _ = beforeEach(() => resetCaptures())
|
|
12
12
|
|
|
13
13
|
describe("make — no buckets:", () => {
|
|
14
|
-
testPromise(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
14
|
+
testPromise(
|
|
15
|
+
"creates component with correct output name",
|
|
16
|
+
async () => {
|
|
17
|
+
let task = NoBucketsMaker.make(
|
|
18
|
+
~queryBucketName=mockQueryBucketName,
|
|
19
|
+
~scheduler=mockScheduler,
|
|
20
|
+
~schedulerRoleUrn=Pulumi.Output.make(""),
|
|
21
|
+
~publishToAggregates=mockPublishToAggregates,
|
|
22
|
+
~queryEngine=mockQueryEngine,
|
|
23
|
+
~resourceNaming=mockResourceNaming,
|
|
24
|
+
~allAggregates=Dict.make(),
|
|
25
|
+
~opts=None,
|
|
26
|
+
)
|
|
27
|
+
let outputs = NoBucketsMaker.outputs(task)
|
|
28
|
+
expect(outputs.name)->toBe("NoBucketsTask")
|
|
29
|
+
},
|
|
30
|
+
)
|
|
28
31
|
|
|
29
|
-
testPromise(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
32
|
+
testPromise(
|
|
33
|
+
"task with no buckets has no bucketNames in outputs",
|
|
34
|
+
async () => {
|
|
35
|
+
let task = NoBucketsMaker.make(
|
|
36
|
+
~queryBucketName=mockQueryBucketName,
|
|
37
|
+
~scheduler=mockScheduler,
|
|
38
|
+
~schedulerRoleUrn=Pulumi.Output.make(""),
|
|
39
|
+
~publishToAggregates=mockPublishToAggregates,
|
|
40
|
+
~queryEngine=mockQueryEngine,
|
|
41
|
+
~resourceNaming=mockResourceNaming,
|
|
42
|
+
~allAggregates=Dict.make(),
|
|
43
|
+
~opts=None,
|
|
44
|
+
)
|
|
45
|
+
let outputs = NoBucketsMaker.outputs(task)
|
|
46
|
+
// bucketNames is absent when spec returns no buckets
|
|
47
|
+
expect(outputs.bucketNames->Option.isSome)->toBe(false)
|
|
48
|
+
},
|
|
49
|
+
)
|
|
44
50
|
})
|
|
45
51
|
|
|
46
52
|
describe("make — one named bucket with callback:", () => {
|
|
47
|
-
testPromise(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
53
|
+
testPromise(
|
|
54
|
+
"creates component with correct output name",
|
|
55
|
+
async () => {
|
|
56
|
+
let task = OneBucketMaker.make(
|
|
57
|
+
~queryBucketName=mockQueryBucketName,
|
|
58
|
+
~scheduler=mockScheduler,
|
|
59
|
+
~schedulerRoleUrn=Pulumi.Output.make(""),
|
|
60
|
+
~publishToAggregates=mockPublishToAggregates,
|
|
61
|
+
~queryEngine=mockQueryEngine,
|
|
62
|
+
~resourceNaming=mockResourceNaming,
|
|
63
|
+
~allAggregates=Dict.make(),
|
|
64
|
+
~opts=None,
|
|
65
|
+
)
|
|
66
|
+
let outputs = OneBucketMaker.outputs(task)
|
|
67
|
+
expect(outputs.name)->toBe("OneBucketTask")
|
|
68
|
+
},
|
|
69
|
+
)
|
|
61
70
|
|
|
62
|
-
testPromise(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
71
|
+
testPromise(
|
|
72
|
+
"bucketNames dict contains the named bucket key",
|
|
73
|
+
async () => {
|
|
74
|
+
let task = OneBucketMaker.make(
|
|
75
|
+
~queryBucketName=mockQueryBucketName,
|
|
76
|
+
~scheduler=mockScheduler,
|
|
77
|
+
~schedulerRoleUrn=Pulumi.Output.make(""),
|
|
78
|
+
~publishToAggregates=mockPublishToAggregates,
|
|
79
|
+
~queryEngine=mockQueryEngine,
|
|
80
|
+
~resourceNaming=mockResourceNaming,
|
|
81
|
+
~allAggregates=Dict.make(),
|
|
82
|
+
~opts=None,
|
|
83
|
+
)
|
|
84
|
+
let outputs = OneBucketMaker.outputs(task)
|
|
85
|
+
let bucketNames = outputs.bucketNames->Option.getUnsafe
|
|
86
|
+
expect(bucketNames->Dict.keysToArray)->toEqual(["Reports"])
|
|
87
|
+
},
|
|
88
|
+
)
|
|
77
89
|
|
|
78
|
-
testPromise(
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
90
|
+
testPromise(
|
|
91
|
+
"bucket id resolves to the bucket name (in-memory dummy resource)",
|
|
92
|
+
async () => {
|
|
93
|
+
let task = OneBucketMaker.make(
|
|
94
|
+
~queryBucketName=mockQueryBucketName,
|
|
95
|
+
~scheduler=mockScheduler,
|
|
96
|
+
~schedulerRoleUrn=Pulumi.Output.make(""),
|
|
97
|
+
~publishToAggregates=mockPublishToAggregates,
|
|
98
|
+
~queryEngine=mockQueryEngine,
|
|
99
|
+
~resourceNaming=mockResourceNaming,
|
|
100
|
+
~allAggregates=Dict.make(),
|
|
101
|
+
~opts=None,
|
|
102
|
+
)
|
|
103
|
+
let outputs = OneBucketMaker.outputs(task)
|
|
104
|
+
let bucketNames = outputs.bucketNames->Option.getUnsafe
|
|
105
|
+
let idOutput = bucketNames->Dict.get("Reports")->Option.getUnsafe
|
|
106
|
+
let id = await idOutput->TestRunner.resolve
|
|
107
|
+
// In-memory bucket id = the bucket's resource name, which is kebab-cased
|
|
108
|
+
// and plugin-qualified because S3 lowercases a bucket name and a PascalCase
|
|
109
|
+
// one collapses into a run-on. No plugin segment here: the task is built
|
|
110
|
+
// outside any plugin, so there is no ambient plugin to qualify with.
|
|
111
|
+
// The runtime lookup key is a separate string and stays "Reports".
|
|
112
|
+
expect(id)->toBe("one-bucket-task-reports")
|
|
113
|
+
},
|
|
114
|
+
)
|
|
100
115
|
})
|
|
101
116
|
})
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
open ReventlessCore
|
|
2
2
|
open PluginSpec
|
|
3
3
|
open Plugin_Fixtures
|
|
4
|
-
module PluginsProjectionTest = ReventlessGwt.MultiSourceProjection_GWT.Make(
|
|
4
|
+
module PluginsProjectionTest = ReventlessGwt.MultiSourceProjection_GWT.Make(
|
|
5
|
+
PluginsProjection.PluginMapping,
|
|
6
|
+
)
|
|
5
7
|
open PluginsProjectionTest
|
|
6
8
|
|
|
7
9
|
// Current view (one row per plugin name). The displayed row tracks the current
|
|
@@ -33,7 +33,12 @@ describe("UiFragments StateViewSlice projection", () => {
|
|
|
33
33
|
test("UiFragmentUpdated updates manifest fields + updatedAt, keeps registeredAt", () =>
|
|
34
34
|
givenEvents([UiFragmentRegistered({pluginId: "p1", manifest: uiManifest, at: "t0"})])
|
|
35
35
|
->whenEvent(
|
|
36
|
-
UiFragmentUpdated({
|
|
36
|
+
UiFragmentUpdated({
|
|
37
|
+
pluginId: "p1",
|
|
38
|
+
previousManifest: uiManifest,
|
|
39
|
+
newManifest: manifest2,
|
|
40
|
+
at: "t1",
|
|
41
|
+
}),
|
|
37
42
|
)
|
|
38
43
|
->thenStateWithId(
|
|
39
44
|
"p1",
|
|
@@ -60,6 +60,7 @@ let makeStore = (): (SqliteDriver.t, string) => {
|
|
|
60
60
|
db->SqliteDriver.exec(
|
|
61
61
|
`CREATE TABLE ${t} (partition_key TEXT NOT NULL, sub_key TEXT NOT NULL DEFAULT '', item TEXT NOT NULL, expires_at INTEGER, PRIMARY KEY (partition_key, sub_key))`,
|
|
62
62
|
)
|
|
63
|
+
|
|
63
64
|
// qdb_Plugins gets the two registry rows below and nothing else, so its count
|
|
64
65
|
// stays the number of connected plugins.
|
|
65
66
|
if t != "qdb_Plugins" {
|