@reventlessdev/reventless-local 3.0.0-alpha.226 → 3.0.0-alpha.228
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 +23 -0
- package/package.json +14 -14
- package/src/LocalPlatformRegistry.res +2 -2
- package/src/LocalPlatformRegistry.res.mjs +14 -13
- package/src/Platform.res +14 -15
- package/src/Platform.res.mjs +20 -21
- package/src/adapter/Auth/LocalAuth.res +3 -3
- package/src/adapter/Auth/LocalAuth.res.mjs +3 -2
- package/src/adapter/Auth/UserStore.res +1 -1
- package/src/adapter/Auth/UserStore.res.mjs +7 -6
- package/src/adapter/CommandGenerator/CommandGeneratorResolvers_GraphQL.res +1 -1
- package/src/adapter/CommandGenerator/CommandGeneratorResolvers_GraphQL.res.mjs +1 -1
- package/src/adapter/CommandTopic/LocalCommandTopicRemoteChannel.res +1 -1
- package/src/adapter/CommandTopic/LocalCommandTopicRemoteChannel.res.mjs +3 -3
- package/src/adapter/DcbEventLog/DcbEventLogStorage_Sqlite.res +2 -2
- package/src/adapter/DcbEventLog/DcbEventLogStorage_Sqlite.res.mjs +4 -4
- package/src/adapter/DomainGraphQL_Server.res +2 -2
- package/src/adapter/DomainGraphQL_Server.res.mjs +3 -3
- package/src/adapter/DomainMCP_Server.res +1 -1
- package/src/adapter/MCP_ServerInstance.res +1 -1
- package/src/adapter/QueryDb/QueryDbResolvers_GraphQL.res +223 -22
- package/src/adapter/QueryDb/QueryDbResolvers_GraphQL.res.mjs +176 -18
- package/tests/BakedManifestFilesTest.res +0 -1
- package/tests/PluginEventDecodeTest.res +3 -3
- package/tests/PluginEventDecodeTest.res.mjs +4 -4
- package/tests/ShellConfigTest.res +0 -1
- package/tests/UiHintsTest.res +33 -6
- package/tests/UiHintsTest.res.mjs +15 -2
- package/tests/adapter/CommandAuthorizationTest.res.mjs +7 -7
- package/tests/adapter/GraphQL_SchemaInspectorTest.res +9 -7
- package/tests/adapter/GraphQL_SchemaInspectorTest.res.mjs +64 -64
- package/tests/adapter/LocalAuthHttpTest.res +1 -1
- package/tests/adapter/LocalAuthHttpTest.res.mjs +2 -2
- package/tests/adapter/QueryDbListResolverTest.res +82 -2
- package/tests/adapter/QueryDbListResolverTest.res.mjs +111 -16
- package/tests/components/aggregate/AggregateFixtures.res.mjs +6 -6
- package/tests/components/automationslice/AutomationSliceFixtures.res +4 -4
- package/tests/components/automationslice/AutomationSliceFixtures.res.mjs +20 -19
- package/tests/components/automationslice/AutomationSliceSelfDeadlockFixtures.res +2 -2
- package/tests/components/automationslice/AutomationSliceSelfDeadlockFixtures.res.mjs +23 -22
- package/tests/components/automationslice/MixedSourceAutomationSliceFixtures.res +4 -4
- package/tests/components/automationslice/MixedSourceAutomationSliceFixtures.res.mjs +21 -20
- package/tests/components/commandgenerator/CommandGeneratorFixtures.res +0 -1
- package/tests/components/commandgenerator/CommandGeneratorFixtures.res.mjs +6 -8
- package/tests/components/commandgenerator/CommandGeneratorTest.res +1 -1
- package/tests/components/commandgenerator/CommandGeneratorTest.res.mjs +2 -2
- package/tests/components/commandtopic/CommandTopicFixtures.res.mjs +9 -9
- package/tests/components/commandtopic/CommandTopicStreamFixtures.res.mjs +9 -9
- package/tests/components/dcb/DcbCrossPartitionFixtures.res +3 -3
- package/tests/components/dcb/DcbCrossPartitionFixtures.res.mjs +22 -21
- package/tests/components/dcb/DcbEventLogAppendStreamTest.res +1 -1
- package/tests/components/dcb/DcbEventLogAppendStreamTest.res.mjs +2 -2
- package/tests/components/dcb/DcbFixtures.res +2 -2
- package/tests/components/dcb/DcbFixtures.res.mjs +12 -11
- package/tests/components/eventlog/EventLogFixtures.res.mjs +6 -6
- package/tests/components/eventlog/EventLogProvisioningSeamTest.res.mjs +3 -3
- package/tests/components/eventtopic/EventTopicFixtures.res.mjs +6 -6
- package/tests/components/eventtopic/EventTopicStreamFixtures.res.mjs +6 -6
- package/tests/components/extensionpoint/ExtensionPointFixtures.res +0 -1
- package/tests/components/extensionpoint/ExtensionPointFixtures.res.mjs +11 -13
- package/tests/components/extensionpoint/ExtensionPointTest.res +3 -3
- package/tests/components/extensionpoint/ExtensionPointTest.res.mjs +4 -4
- package/tests/components/inboundtranslationslice/InboundTranslationSliceCallbackTest.res.mjs +10 -10
- package/tests/components/inboundtranslationslice/InboundTranslationSliceFixtures.res.mjs +9 -9
- package/tests/components/outboundtranslationslice/OutboundTranslationSliceFixtures.res.mjs +23 -21
- package/tests/components/outboundtranslationslice/OutboundTranslationSlicePlatformFixtures.res +2 -2
- package/tests/components/outboundtranslationslice/OutboundTranslationSlicePlatformFixtures.res.mjs +17 -14
- package/tests/components/querydb/QueryDbFixtures.res.mjs +4 -4
- package/tests/components/querydb/QueryDbSubIdFixtures.res.mjs +6 -6
- package/tests/components/readmodel/DcbReadModelE2EFixtures.res +3 -3
- package/tests/components/readmodel/DcbReadModelE2EFixtures.res.mjs +17 -16
- package/tests/components/readmodel/DcbReadModelTypoFailFastTest.res.mjs +7 -7
- package/tests/components/readmodel/MixedSourceReadModelFixtures.res +5 -5
- package/tests/components/readmodel/MixedSourceReadModelFixtures.res.mjs +20 -19
- package/tests/components/readmodel/ReadModelFixtures.res +3 -3
- package/tests/components/readmodel/ReadModelFixtures.res.mjs +9 -8
- package/tests/components/sideeffecthandler/SideEffectHandlerFixtures.res +2 -3
- package/tests/components/sideeffecthandler/SideEffectHandlerFixtures.res.mjs +7 -8
- package/tests/components/stateviewslice/StateViewSliceFixtures.res +2 -2
- package/tests/components/stateviewslice/StateViewSliceFixtures.res.mjs +22 -21
- package/tests/components/stateviewslice/StateViewSliceSubIdFixtures.res +2 -2
- package/tests/components/stateviewslice/StateViewSliceSubIdFixtures.res.mjs +27 -26
- package/tests/components/task/TaskFixtures.res +0 -1
- package/tests/components/task/TaskFixtures.res.mjs +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,29 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# 3.0.0-alpha.228 (2026-08-18)
|
|
7
|
+
|
|
8
|
+
* feat(sury)!: migrate to sury 11.0.0-rc.1 ([2cf8969](https://github.com/ReventlessDev/reventless-core/commit/2cf8969a222ce1b775563668a4126cb20611966c))
|
|
9
|
+
|
|
10
|
+
### BREAKING CHANGES
|
|
11
|
+
|
|
12
|
+
* sury is a direct dependency of the published packages and
|
|
13
|
+
its schema and serialization surface changed; consumers must migrate to
|
|
14
|
+
sury 11.
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
# 3.0.0-alpha.227 (2026-08-18)
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* **api:** declare the reference door in the SDL every backend is built from ([5c1857e](https://github.com/ReventlessDev/reventless-core/commit/5c1857ea90ff40305a1c44a9e57043528e6a93aa))
|
|
23
|
+
* **api:** make the by-index door answer, and let an elevated caller widen it ([0fe0c6f](https://github.com/ReventlessDev/reventless-core/commit/0fe0c6f8dec6228ecaba39577e28d780b4f79c83))
|
|
24
|
+
### Features
|
|
25
|
+
|
|
26
|
+
* **core:** let a reference name a retired row, and let an elevated caller open one ([9e2623a](https://github.com/ReventlessDev/reventless-core/commit/9e2623a4b22487561607fcc0ca19d51726069ee4))
|
|
27
|
+
|
|
28
|
+
|
|
6
29
|
# 3.0.0-alpha.226 (2026-08-16)
|
|
7
30
|
|
|
8
31
|
**Note:** Version bump only for package @reventlessdev/reventless-local
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reventlessdev/reventless-local",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.228",
|
|
4
4
|
"description": "Local platform for Reventless (in-memory or SQLite backend, for development and testing without AWS)",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"bin": {
|
|
@@ -32,26 +32,26 @@
|
|
|
32
32
|
"graphql": "^16.13.2",
|
|
33
33
|
"graphql-ws": "^5.16.0",
|
|
34
34
|
"graphql-yoga": "^5.21.0",
|
|
35
|
-
"sury": "11.0.0-
|
|
35
|
+
"sury": "11.0.0-rc.1",
|
|
36
36
|
"ws": "^8.18.0",
|
|
37
|
-
"@reventlessdev/rescript-effect": "0.1.0-alpha.32",
|
|
38
|
-
"@reventlessdev/rescript-jest": "1.0.0-alpha.10",
|
|
39
37
|
"@reventlessdev/rescript-graphql-yoga": "1.0.0-alpha.27",
|
|
40
38
|
"@reventlessdev/rescript-mcp-sdk": "1.0.0-alpha.21",
|
|
41
|
-
"@reventlessdev/rescript-
|
|
39
|
+
"@reventlessdev/rescript-jest": "1.0.0-alpha.10",
|
|
42
40
|
"@reventlessdev/rescript-pulumi-pulumi": "2.3.0-alpha.19",
|
|
43
|
-
"@reventlessdev/
|
|
44
|
-
"@reventlessdev/reventless-
|
|
45
|
-
"@reventlessdev/reventless-
|
|
46
|
-
"@reventlessdev/
|
|
47
|
-
"@reventlessdev/reventless-
|
|
48
|
-
"@reventlessdev/reventless-
|
|
49
|
-
"@reventlessdev/reventless-
|
|
41
|
+
"@reventlessdev/rescript-node": "2.0.0-alpha.8",
|
|
42
|
+
"@reventlessdev/reventless-core": "3.0.0-alpha.240",
|
|
43
|
+
"@reventlessdev/reventless-graphql-server": "1.0.0-alpha.88",
|
|
44
|
+
"@reventlessdev/rescript-effect": "0.1.0-alpha.32",
|
|
45
|
+
"@reventlessdev/reventless-infra": "3.0.0-alpha.146",
|
|
46
|
+
"@reventlessdev/reventless-gwt": "1.0.0-alpha.187",
|
|
47
|
+
"@reventlessdev/reventless-seed": "1.0.0-alpha.16",
|
|
48
|
+
"@reventlessdev/reventless-postgres": "3.0.0-alpha.104",
|
|
49
|
+
"@reventlessdev/reventless-spec": "3.0.0-alpha.118"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"rescript": "12.3.0",
|
|
53
|
-
"sury-ppx": "11.0.0-
|
|
54
|
-
"@reventlessdev/reventless-ppx": "1.0.0-alpha.
|
|
53
|
+
"sury-ppx": "11.0.0-rc.1",
|
|
54
|
+
"@reventlessdev/reventless-ppx": "1.0.0-alpha.71"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
57
|
"rescript": "12.3.0"
|
|
@@ -99,7 +99,7 @@ let alive = (pid: int): bool =>
|
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
let readEntry = (path: string): option<entry> =>
|
|
102
|
-
try Some(path->NodeFs.readFileSync->JSON.parseOrThrow->
|
|
102
|
+
try Some(path->NodeFs.readFileSync->JSON.parseOrThrow->Reventless.Util_Sury.fromJson(entrySchema)) catch {
|
|
103
103
|
| _ => None
|
|
104
104
|
}
|
|
105
105
|
|
|
@@ -157,7 +157,7 @@ let write = (
|
|
|
157
157
|
NodeFs.mkdirSync(runningDir(~cwd, ()), {recursive: true})
|
|
158
158
|
NodeFs.writeFileSync(
|
|
159
159
|
path,
|
|
160
|
-
entry->
|
|
160
|
+
entry->Reventless.Util_Sury.toJson(entrySchema)->JSON.stringify(~space=2),
|
|
161
161
|
)
|
|
162
162
|
} catch {
|
|
163
163
|
// A platform that cannot announce itself must still serve. The tools fall back
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as
|
|
3
|
+
import * as Sury from "sury";
|
|
4
4
|
import * as Nodefs from "node:fs";
|
|
5
5
|
import * as Nodepath from "node:path";
|
|
6
6
|
import * as Stdlib_JSON from "@rescript/runtime/lib/es6/Stdlib_JSON.js";
|
|
7
7
|
import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.js";
|
|
8
8
|
import * as Primitive_int from "@rescript/runtime/lib/es6/Primitive_int.js";
|
|
9
9
|
import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
10
|
+
import * as Util_Sury$Reventless from "@reventlessdev/reventless-spec/src/util/Util_Sury.res.mjs";
|
|
10
11
|
|
|
11
|
-
let storeSchema =
|
|
12
|
-
kind: s.m(
|
|
13
|
-
path: s.m(
|
|
12
|
+
let storeSchema = Sury.$schema(s => ({
|
|
13
|
+
kind: s.m(Sury.string),
|
|
14
|
+
path: s.m(Sury.$option(Sury.string))
|
|
14
15
|
}));
|
|
15
16
|
|
|
16
|
-
let entrySchema =
|
|
17
|
-
app: s.m(
|
|
18
|
-
port: s.m(
|
|
19
|
-
pid: s.m(
|
|
20
|
-
endpoint: s.m(
|
|
21
|
-
loginEndpoint: s.m(
|
|
17
|
+
let entrySchema = Sury.$schema(s => ({
|
|
18
|
+
app: s.m(Sury.string),
|
|
19
|
+
port: s.m(Sury.int),
|
|
20
|
+
pid: s.m(Sury.int),
|
|
21
|
+
endpoint: s.m(Sury.string),
|
|
22
|
+
loginEndpoint: s.m(Sury.string),
|
|
22
23
|
store: s.m(storeSchema),
|
|
23
|
-
startedAt: s.m(
|
|
24
|
+
startedAt: s.m(Sury.string)
|
|
24
25
|
}));
|
|
25
26
|
|
|
26
27
|
function runningDir(cwdOpt, param) {
|
|
@@ -69,7 +70,7 @@ function alive(pid) {
|
|
|
69
70
|
|
|
70
71
|
function readEntry(path) {
|
|
71
72
|
try {
|
|
72
|
-
return
|
|
73
|
+
return Util_Sury$Reventless.fromJson(JSON.parse(Nodefs.readFileSync(path, "utf8")), entrySchema);
|
|
73
74
|
} catch (exn) {
|
|
74
75
|
return;
|
|
75
76
|
}
|
|
@@ -126,7 +127,7 @@ function write(port, endpoint, loginEndpoint, store, pidOpt, cwdOpt) {
|
|
|
126
127
|
Nodefs.mkdirSync(runningDir(cwd, undefined), {
|
|
127
128
|
recursive: true
|
|
128
129
|
});
|
|
129
|
-
Nodefs.writeFileSync(path, JSON.stringify(
|
|
130
|
+
Nodefs.writeFileSync(path, JSON.stringify(Util_Sury$Reventless.toJson(entry, entrySchema), undefined, 2), "utf8");
|
|
130
131
|
} catch (exn) {
|
|
131
132
|
|
|
132
133
|
}
|
package/src/Platform.res
CHANGED
|
@@ -39,7 +39,7 @@ let decodePluginEventEnvelope = (eventJson: JSON.t): option<ReventlessCore.Plugi
|
|
|
39
39
|
switch eventJson
|
|
40
40
|
->JSON.Decode.object
|
|
41
41
|
->Option.flatMap(d => d->Dict.get("event"))
|
|
42
|
-
->Option.map(payload => payload->
|
|
42
|
+
->Option.map(payload => payload->Reventless.Util_Sury.fromJson(ReventlessCore.PluginSpec.eventSchema)) {
|
|
43
43
|
| result => result
|
|
44
44
|
| exception _ => None
|
|
45
45
|
}
|
|
@@ -55,7 +55,7 @@ let decodeUiFragmentRegistryEventEnvelope = (
|
|
|
55
55
|
->JSON.Decode.object
|
|
56
56
|
->Option.flatMap(d => d->Dict.get("event"))
|
|
57
57
|
->Option.map(payload =>
|
|
58
|
-
payload->
|
|
58
|
+
payload->Reventless.Util_Sury.fromJson(ReventlessCore.UiFragmentRegistry.eventSchema)
|
|
59
59
|
) {
|
|
60
60
|
| result => result
|
|
61
61
|
| exception _ => None
|
|
@@ -968,7 +968,7 @@ module MakeWithConfig = (
|
|
|
968
968
|
let cmdJson: Reventless.Message.commandJson = {
|
|
969
969
|
id: pluginName,
|
|
970
970
|
meta: ReventlessCore.Message.generateMeta(~service=ReventlessCore.PluginSpec.name),
|
|
971
|
-
commandJson: command->
|
|
971
|
+
commandJson: command->Reventless.Util_Sury.toJson(ReventlessCore.PluginSpec.commandSchema),
|
|
972
972
|
}
|
|
973
973
|
Bus.dispatchCommand(pluginCmdTopicKey, ReventlessCore.CommandTopic.encodeCommandJson(cmdJson))
|
|
974
974
|
}
|
|
@@ -997,7 +997,7 @@ module MakeWithConfig = (
|
|
|
997
997
|
let cmdJson: Reventless.Message.commandJson = {
|
|
998
998
|
id: pluginName,
|
|
999
999
|
meta: ReventlessCore.Message.generateMeta(~service=ReventlessCore.UiFragmentRegistry.name),
|
|
1000
|
-
commandJson: command->
|
|
1000
|
+
commandJson: command->Reventless.Util_Sury.toJson(
|
|
1001
1001
|
ReventlessCore.UiFragmentRegistry.commandSchema,
|
|
1002
1002
|
),
|
|
1003
1003
|
}
|
|
@@ -1057,7 +1057,7 @@ module MakeWithConfig = (
|
|
|
1057
1057
|
),
|
|
1058
1058
|
)
|
|
1059
1059
|
let manifestJson = (m: Reventless.Plugin.uiFragmentManifest) =>
|
|
1060
|
-
m->
|
|
1060
|
+
m->Reventless.Util_Sury.toJson(Reventless.Plugin.uiFragmentManifestSchema)
|
|
1061
1061
|
Bus.subscribeToEvents(pluginEventTopicKey, async (_service, _meta, eventJson) => {
|
|
1062
1062
|
switch decodePluginEventEnvelope(eventJson) {
|
|
1063
1063
|
| Some(VersionConnected(def))
|
|
@@ -1428,11 +1428,10 @@ module MakeWithConfig = (
|
|
|
1428
1428
|
switch entry.indexQueries {
|
|
1429
1429
|
| Some(indexes) =>
|
|
1430
1430
|
indexes->Array.forEach((ic: Reventless.ReadModel.indexConfig) => {
|
|
1431
|
-
let
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
let fieldName = entry.singleFieldName ++ "By" ++ stripped->String.capitalize
|
|
1431
|
+
let fieldName = ReventlessCore.GraphQL_FragmentGenerator.indexQueryFieldName(
|
|
1432
|
+
~singleFieldName=entry.singleFieldName,
|
|
1433
|
+
~index=ic.index,
|
|
1434
|
+
)
|
|
1436
1435
|
queryResolvers->Dict.set(fieldName, async (_root, _args, _ctx): JSON.t =>
|
|
1437
1436
|
connectionResponse([])
|
|
1438
1437
|
)
|
|
@@ -1724,7 +1723,7 @@ module MakeWithConfig = (
|
|
|
1724
1723
|
switch Bus.getQueryDbScan(pluginQueryDbName) {
|
|
1725
1724
|
| Some(scanAll) =>
|
|
1726
1725
|
scanAll()->Array.forEach(json =>
|
|
1727
|
-
switch json->
|
|
1726
|
+
switch json->Reventless.Util_Sury.fromJson(ReventlessCore.PluginsReadModelSpec.stateSchema) {
|
|
1728
1727
|
| state => statusByName->Dict.set(state.name, state.status)
|
|
1729
1728
|
| exception _ => ()
|
|
1730
1729
|
}
|
|
@@ -1806,7 +1805,7 @@ module MakeWithConfig = (
|
|
|
1806
1805
|
switch Bus.getQueryDbScan(pluginQueryDbName) {
|
|
1807
1806
|
| Some(scanAll) =>
|
|
1808
1807
|
scanAll()->Array.forEach(json =>
|
|
1809
|
-
switch json->
|
|
1808
|
+
switch json->Reventless.Util_Sury.fromJson(ReventlessCore.PluginsReadModelSpec.stateSchema) {
|
|
1810
1809
|
| state =>
|
|
1811
1810
|
let id = state.name ++ "@" ++ state.version
|
|
1812
1811
|
dict->Dict.set(id, state.status)
|
|
@@ -1887,7 +1886,7 @@ module MakeWithConfig = (
|
|
|
1887
1886
|
// mixed store never surfaces duplicates (mirrors Platform_UIFragments_Lambda.res).
|
|
1888
1887
|
let latestByName = Dict.make()
|
|
1889
1888
|
items->Array.forEach(item =>
|
|
1890
|
-
switch item->S.parseOrThrow(ReventlessCore.UiFragments.stateSchema) {
|
|
1889
|
+
switch item->S.parseOrThrow(~to=ReventlessCore.UiFragments.stateSchema) {
|
|
1891
1890
|
| state =>
|
|
1892
1891
|
let name = ReventlessCore.Plugin.name(state.pluginId)
|
|
1893
1892
|
let version = ReventlessCore.Plugin.version(state.pluginId)
|
|
@@ -1933,7 +1932,7 @@ module MakeWithConfig = (
|
|
|
1933
1932
|
switch Bus.getQueryDbScan(pluginQueryDbName) {
|
|
1934
1933
|
| Some(scanAll) =>
|
|
1935
1934
|
scanAll()->Array.findMap(json =>
|
|
1936
|
-
switch json->
|
|
1935
|
+
switch json->Reventless.Util_Sury.fromJson(ReventlessCore.PluginsReadModelSpec.stateSchema) {
|
|
1937
1936
|
| state if state.name == pluginName => Some(state.version)
|
|
1938
1937
|
| _ => None
|
|
1939
1938
|
| exception _ => None
|
|
@@ -2386,7 +2385,7 @@ module MakeWithConfig = (
|
|
|
2386
2385
|
}
|
|
2387
2386
|
items
|
|
2388
2387
|
->Array.filterMap(item =>
|
|
2389
|
-
switch item->S.parseOrThrow(ReventlessCore.UiFragments.stateSchema) {
|
|
2388
|
+
switch item->S.parseOrThrow(~to=ReventlessCore.UiFragments.stateSchema) {
|
|
2390
2389
|
| state =>
|
|
2391
2390
|
Some(ReventlessCore.Platform_UIFragmentsApi.encodeUIFragmentEntry(state))
|
|
2392
2391
|
| exception _ => None
|
package/src/Platform.res.mjs
CHANGED
|
@@ -9,11 +9,11 @@ import * as Stdlib_JSON from "@rescript/runtime/lib/es6/Stdlib_JSON.js";
|
|
|
9
9
|
import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.js";
|
|
10
10
|
import * as Id$Reventless from "@reventlessdev/reventless-spec/src/types/Id.res.mjs";
|
|
11
11
|
import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
12
|
-
import * as Stdlib_String from "@rescript/runtime/lib/es6/Stdlib_String.js";
|
|
13
12
|
import * as Effect from "effect/Effect";
|
|
14
13
|
import * as Pulumi from "@pulumi/pulumi";
|
|
15
14
|
import * as Stdlib_Promise from "@rescript/runtime/lib/es6/Stdlib_Promise.js";
|
|
16
15
|
import * as Plugin$Reventless from "@reventlessdev/reventless-spec/src/components/Plugin.res.mjs";
|
|
16
|
+
import * as Util_Sury$Reventless from "@reventlessdev/reventless-spec/src/util/Util_Sury.res.mjs";
|
|
17
17
|
import * as Logger$ReventlessCore from "@reventlessdev/reventless-core/src/util/Logger.res.mjs";
|
|
18
18
|
import * as Plugin$ReventlessCore from "@reventlessdev/reventless-core/src/plugin/component/Plugin.res.mjs";
|
|
19
19
|
import * as Message$ReventlessCore from "@reventlessdev/reventless-core/src/Message.res.mjs";
|
|
@@ -81,6 +81,7 @@ import * as LocalDcbEventLogStorage$ReventlessLocal from "./adapter/DcbEventLog/
|
|
|
81
81
|
import * as LocalRuntimeEnvironment$ReventlessLocal from "./adapter/Runtime/LocalRuntimeEnvironment.res.mjs";
|
|
82
82
|
import * as LocalScheduledPublisher$ReventlessLocal from "./adapter/Scheduler/LocalScheduledPublisher.res.mjs";
|
|
83
83
|
import * as Platform_Admin_Structure$ReventlessCore from "@reventlessdev/reventless-core/src/admin/Platform_Admin_Structure.res.mjs";
|
|
84
|
+
import * as GraphQL_FragmentGenerator$ReventlessCore from "@reventlessdev/reventless-core/src/components/Api/GraphQL_FragmentGenerator.res.mjs";
|
|
84
85
|
import * as LocalCommandTopicChannel$ReventlessLocal from "./adapter/CommandTopic/LocalCommandTopicChannel.res.mjs";
|
|
85
86
|
import * as LocalEventTopicPublisher$ReventlessLocal from "./adapter/EventTopic/LocalEventTopicPublisher.res.mjs";
|
|
86
87
|
import * as StateChangeSlice_Builder$ReventlessLocal from "./components/StateChangeSlice_Builder.res.mjs";
|
|
@@ -115,7 +116,7 @@ let platformMCPRef = {
|
|
|
115
116
|
|
|
116
117
|
function decodePluginEventEnvelope(eventJson) {
|
|
117
118
|
try {
|
|
118
|
-
return Stdlib_Option.map(Stdlib_Option.flatMap(Stdlib_JSON.Decode.object(eventJson), d => d["event"]), payload =>
|
|
119
|
+
return Stdlib_Option.map(Stdlib_Option.flatMap(Stdlib_JSON.Decode.object(eventJson), d => d["event"]), payload => Util_Sury$Reventless.fromJson(payload, PluginSpec$ReventlessCore.eventSchema));
|
|
119
120
|
} catch (exn) {
|
|
120
121
|
return;
|
|
121
122
|
}
|
|
@@ -123,7 +124,7 @@ function decodePluginEventEnvelope(eventJson) {
|
|
|
123
124
|
|
|
124
125
|
function decodeUiFragmentRegistryEventEnvelope(eventJson) {
|
|
125
126
|
try {
|
|
126
|
-
return Stdlib_Option.map(Stdlib_Option.flatMap(Stdlib_JSON.Decode.object(eventJson), d => d["event"]), payload =>
|
|
127
|
+
return Stdlib_Option.map(Stdlib_Option.flatMap(Stdlib_JSON.Decode.object(eventJson), d => d["event"]), payload => Util_Sury$Reventless.fromJson(payload, UiFragmentRegistry$ReventlessCore.eventSchema));
|
|
127
128
|
} catch (exn) {
|
|
128
129
|
return;
|
|
129
130
|
}
|
|
@@ -882,7 +883,7 @@ function MakeWithConfig(Config) {
|
|
|
882
883
|
let pluginEventTopicKey = PluginSpec$ReventlessCore.name + "AggrEventTopic";
|
|
883
884
|
let dispatchPluginCommand = (pluginName, command) => {
|
|
884
885
|
let cmdJson_meta = Message$ReventlessCore.generateMeta(PluginSpec$ReventlessCore.name, undefined, undefined, undefined, undefined, undefined, undefined, undefined);
|
|
885
|
-
let cmdJson_commandJson =
|
|
886
|
+
let cmdJson_commandJson = Util_Sury$Reventless.toJson(command, PluginSpec$ReventlessCore.commandSchema);
|
|
886
887
|
let cmdJson = {
|
|
887
888
|
id: pluginName,
|
|
888
889
|
meta: cmdJson_meta,
|
|
@@ -893,7 +894,7 @@ function MakeWithConfig(Config) {
|
|
|
893
894
|
let adminDcbCmdTopicKey = ComponentType$ReventlessCore.name(Platform_Admin_Structure$ReventlessCore.pluginId + "Dcb", "CommandTopic");
|
|
894
895
|
let dispatchUiFragmentCommand = (pluginName, command) => {
|
|
895
896
|
let cmdJson_meta = Message$ReventlessCore.generateMeta(UiFragmentRegistry$ReventlessCore.name, undefined, undefined, undefined, undefined, undefined, undefined, undefined);
|
|
896
|
-
let cmdJson_commandJson =
|
|
897
|
+
let cmdJson_commandJson = Util_Sury$Reventless.toJson(command, UiFragmentRegistry$ReventlessCore.commandSchema);
|
|
897
898
|
let cmdJson = {
|
|
898
899
|
id: pluginName,
|
|
899
900
|
meta: cmdJson_meta,
|
|
@@ -967,9 +968,9 @@ function MakeWithConfig(Config) {
|
|
|
967
968
|
}
|
|
968
969
|
switch (match.TAG) {
|
|
969
970
|
case "UiFragmentRegistered" :
|
|
970
|
-
return publishUIFragment(match.pluginId, "Registered",
|
|
971
|
+
return publishUIFragment(match.pluginId, "Registered", Util_Sury$Reventless.toJson(match.manifest, Plugin$Reventless.uiFragmentManifestSchema));
|
|
971
972
|
case "UiFragmentUpdated" :
|
|
972
|
-
return publishUIFragment(match.pluginId, "Updated",
|
|
973
|
+
return publishUIFragment(match.pluginId, "Updated", Util_Sury$Reventless.toJson(match.newManifest, Plugin$Reventless.uiFragmentManifestSchema));
|
|
973
974
|
case "UiFragmentDeregistered" :
|
|
974
975
|
return publishUIFragment(match.pluginId, "Deregistered", null);
|
|
975
976
|
}
|
|
@@ -1206,8 +1207,7 @@ function MakeWithConfig(Config) {
|
|
|
1206
1207
|
let indexes = entry.indexQueries;
|
|
1207
1208
|
if (indexes !== undefined) {
|
|
1208
1209
|
indexes.forEach(ic => {
|
|
1209
|
-
let
|
|
1210
|
-
let fieldName = entry.singleFieldName + "By" + Stdlib_String.capitalize(stripped);
|
|
1210
|
+
let fieldName = GraphQL_FragmentGenerator$ReventlessCore.indexQueryFieldName(entry.singleFieldName, ic.index);
|
|
1211
1211
|
queryResolvers[fieldName] = async (_root, _args, _ctx) => connectionResponse([]);
|
|
1212
1212
|
});
|
|
1213
1213
|
return;
|
|
@@ -1336,7 +1336,7 @@ function MakeWithConfig(Config) {
|
|
|
1336
1336
|
scanAll().forEach(json => {
|
|
1337
1337
|
let state;
|
|
1338
1338
|
try {
|
|
1339
|
-
state =
|
|
1339
|
+
state = Util_Sury$Reventless.fromJson(json, PluginsReadModelSpec$ReventlessCore.stateSchema);
|
|
1340
1340
|
} catch (exn) {
|
|
1341
1341
|
return;
|
|
1342
1342
|
}
|
|
@@ -1398,7 +1398,7 @@ function MakeWithConfig(Config) {
|
|
|
1398
1398
|
scanAll().forEach(json => {
|
|
1399
1399
|
let state;
|
|
1400
1400
|
try {
|
|
1401
|
-
state =
|
|
1401
|
+
state = Util_Sury$Reventless.fromJson(json, PluginsReadModelSpec$ReventlessCore.stateSchema);
|
|
1402
1402
|
} catch (exn) {
|
|
1403
1403
|
return;
|
|
1404
1404
|
}
|
|
@@ -1475,7 +1475,7 @@ function MakeWithConfig(Config) {
|
|
|
1475
1475
|
return Stdlib_Array.findMap(scanAll(), json => {
|
|
1476
1476
|
let state;
|
|
1477
1477
|
try {
|
|
1478
|
-
state =
|
|
1478
|
+
state = Util_Sury$Reventless.fromJson(json, PluginsReadModelSpec$ReventlessCore.stateSchema);
|
|
1479
1479
|
} catch (exn) {
|
|
1480
1480
|
return;
|
|
1481
1481
|
}
|
|
@@ -2613,7 +2613,7 @@ function Make($star) {
|
|
|
2613
2613
|
let pluginEventTopicKey = PluginSpec$ReventlessCore.name + "AggrEventTopic";
|
|
2614
2614
|
let dispatchPluginCommand = (pluginName, command) => {
|
|
2615
2615
|
let cmdJson_meta = Message$ReventlessCore.generateMeta(PluginSpec$ReventlessCore.name, undefined, undefined, undefined, undefined, undefined, undefined, undefined);
|
|
2616
|
-
let cmdJson_commandJson =
|
|
2616
|
+
let cmdJson_commandJson = Util_Sury$Reventless.toJson(command, PluginSpec$ReventlessCore.commandSchema);
|
|
2617
2617
|
let cmdJson = {
|
|
2618
2618
|
id: pluginName,
|
|
2619
2619
|
meta: cmdJson_meta,
|
|
@@ -2624,7 +2624,7 @@ function Make($star) {
|
|
|
2624
2624
|
let adminDcbCmdTopicKey = ComponentType$ReventlessCore.name(Platform_Admin_Structure$ReventlessCore.pluginId + "Dcb", "CommandTopic");
|
|
2625
2625
|
let dispatchUiFragmentCommand = (pluginName, command) => {
|
|
2626
2626
|
let cmdJson_meta = Message$ReventlessCore.generateMeta(UiFragmentRegistry$ReventlessCore.name, undefined, undefined, undefined, undefined, undefined, undefined, undefined);
|
|
2627
|
-
let cmdJson_commandJson =
|
|
2627
|
+
let cmdJson_commandJson = Util_Sury$Reventless.toJson(command, UiFragmentRegistry$ReventlessCore.commandSchema);
|
|
2628
2628
|
let cmdJson = {
|
|
2629
2629
|
id: pluginName,
|
|
2630
2630
|
meta: cmdJson_meta,
|
|
@@ -2698,9 +2698,9 @@ function Make($star) {
|
|
|
2698
2698
|
}
|
|
2699
2699
|
switch (match.TAG) {
|
|
2700
2700
|
case "UiFragmentRegistered" :
|
|
2701
|
-
return publishUIFragment(match.pluginId, "Registered",
|
|
2701
|
+
return publishUIFragment(match.pluginId, "Registered", Util_Sury$Reventless.toJson(match.manifest, Plugin$Reventless.uiFragmentManifestSchema));
|
|
2702
2702
|
case "UiFragmentUpdated" :
|
|
2703
|
-
return publishUIFragment(match.pluginId, "Updated",
|
|
2703
|
+
return publishUIFragment(match.pluginId, "Updated", Util_Sury$Reventless.toJson(match.newManifest, Plugin$Reventless.uiFragmentManifestSchema));
|
|
2704
2704
|
case "UiFragmentDeregistered" :
|
|
2705
2705
|
return publishUIFragment(match.pluginId, "Deregistered", null);
|
|
2706
2706
|
}
|
|
@@ -2933,8 +2933,7 @@ function Make($star) {
|
|
|
2933
2933
|
let indexes = entry.indexQueries;
|
|
2934
2934
|
if (indexes !== undefined) {
|
|
2935
2935
|
indexes.forEach(ic => {
|
|
2936
|
-
let
|
|
2937
|
-
let fieldName = entry.singleFieldName + "By" + Stdlib_String.capitalize(stripped);
|
|
2936
|
+
let fieldName = GraphQL_FragmentGenerator$ReventlessCore.indexQueryFieldName(entry.singleFieldName, ic.index);
|
|
2938
2937
|
queryResolvers[fieldName] = async (_root, _args, _ctx) => connectionResponse([]);
|
|
2939
2938
|
});
|
|
2940
2939
|
return;
|
|
@@ -3062,7 +3061,7 @@ function Make($star) {
|
|
|
3062
3061
|
scanAll().forEach(json => {
|
|
3063
3062
|
let state;
|
|
3064
3063
|
try {
|
|
3065
|
-
state =
|
|
3064
|
+
state = Util_Sury$Reventless.fromJson(json, PluginsReadModelSpec$ReventlessCore.stateSchema);
|
|
3066
3065
|
} catch (exn) {
|
|
3067
3066
|
return;
|
|
3068
3067
|
}
|
|
@@ -3124,7 +3123,7 @@ function Make($star) {
|
|
|
3124
3123
|
scanAll().forEach(json => {
|
|
3125
3124
|
let state;
|
|
3126
3125
|
try {
|
|
3127
|
-
state =
|
|
3126
|
+
state = Util_Sury$Reventless.fromJson(json, PluginsReadModelSpec$ReventlessCore.stateSchema);
|
|
3128
3127
|
} catch (exn) {
|
|
3129
3128
|
return;
|
|
3130
3129
|
}
|
|
@@ -3201,7 +3200,7 @@ function Make($star) {
|
|
|
3201
3200
|
return Stdlib_Array.findMap(scanAll(), json => {
|
|
3202
3201
|
let state;
|
|
3203
3202
|
try {
|
|
3204
|
-
state =
|
|
3203
|
+
state = Util_Sury$Reventless.fromJson(json, PluginsReadModelSpec$ReventlessCore.stateSchema);
|
|
3205
3204
|
} catch (exn) {
|
|
3206
3205
|
return;
|
|
3207
3206
|
}
|
|
@@ -253,7 +253,7 @@ module Login = {
|
|
|
253
253
|
} {
|
|
254
254
|
| Error(_) as e => e
|
|
255
255
|
| Ok(minted) =>
|
|
256
|
-
let json = minted->
|
|
256
|
+
let json = minted->Reventless.Util_Sury.toJson(Identity.schema)->JSON.stringify
|
|
257
257
|
let payload = _b64urlEncode(json)
|
|
258
258
|
let sig = _sign(payload)
|
|
259
259
|
Ok(`${payload}.${sig}`)
|
|
@@ -293,7 +293,7 @@ module Login = {
|
|
|
293
293
|
| (Some(payload), Some(sig)) if _sign(payload) === sig =>
|
|
294
294
|
_b64urlDecode(payload)->Option.flatMap(json =>
|
|
295
295
|
try {
|
|
296
|
-
Some(json->JSON.parseOrThrow->S.parseOrThrow(Identity.schema))
|
|
296
|
+
Some(json->JSON.parseOrThrow->S.parseOrThrow(~to=Identity.schema))
|
|
297
297
|
} catch {
|
|
298
298
|
| _ => None
|
|
299
299
|
}
|
|
@@ -334,7 +334,7 @@ module Login = {
|
|
|
334
334
|
} {
|
|
335
335
|
| Error(_) as e => e
|
|
336
336
|
| Ok(minted) =>
|
|
337
|
-
let json = minted->
|
|
337
|
+
let json = minted->Reventless.Util_Sury.toJson(Identity.schema)->JSON.stringify
|
|
338
338
|
let payload = _b64urlEncode(json)
|
|
339
339
|
Ok(`${payload}.${_sign(payload)}`)
|
|
340
340
|
}
|
|
@@ -7,6 +7,7 @@ import * as Nodecrypto from "node:crypto";
|
|
|
7
7
|
import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
8
8
|
import * as Pulumi from "@pulumi/pulumi";
|
|
9
9
|
import * as Identity$Reventless from "@reventlessdev/reventless-spec/src/types/Identity.res.mjs";
|
|
10
|
+
import * as Util_Sury$Reventless from "@reventlessdev/reventless-spec/src/util/Util_Sury.res.mjs";
|
|
10
11
|
import * as Auth_ActiveRole$ReventlessCore from "@reventlessdev/reventless-core/src/adapter/Auth/Auth_ActiveRole.res.mjs";
|
|
11
12
|
|
|
12
13
|
let defaultUser_groups = ["User"];
|
|
@@ -209,7 +210,7 @@ async function issue(username, password, activeRole) {
|
|
|
209
210
|
if (e.TAG !== "Ok") {
|
|
210
211
|
return e;
|
|
211
212
|
}
|
|
212
|
-
let json = JSON.stringify(
|
|
213
|
+
let json = JSON.stringify(Util_Sury$Reventless.toJson(e._0, Identity$Reventless.schema));
|
|
213
214
|
let payload = _b64urlEncode(json);
|
|
214
215
|
let sig = _sign(payload);
|
|
215
216
|
return {
|
|
@@ -269,7 +270,7 @@ function reissue(token, activeRole) {
|
|
|
269
270
|
if (e.TAG !== "Ok") {
|
|
270
271
|
return e;
|
|
271
272
|
}
|
|
272
|
-
let json = JSON.stringify(
|
|
273
|
+
let json = JSON.stringify(Util_Sury$Reventless.toJson(e._0, Identity$Reventless.schema));
|
|
273
274
|
let payload = _b64urlEncode(json);
|
|
274
275
|
return {
|
|
275
276
|
TAG: "Ok",
|
|
@@ -33,7 +33,7 @@ let _entriesSchema = S.array(entrySchema)
|
|
|
33
33
|
let parseString = (yamlText: string): result<array<entry>, string> =>
|
|
34
34
|
try {
|
|
35
35
|
let json = _yamlParse(yamlText)->Obj.magic
|
|
36
|
-
Ok(S.parseOrThrow(json, _entriesSchema))
|
|
36
|
+
Ok(S.parseOrThrow(json, ~to=_entriesSchema))
|
|
37
37
|
} catch {
|
|
38
38
|
| JsExn(err) => Error(JsExn.message(err)->Option.getOr("YAML parse error"))
|
|
39
39
|
| _ => Error("YAML parse error")
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
3
|
import * as S from "sury/src/S.res.mjs";
|
|
4
|
+
import * as Sury from "sury";
|
|
4
5
|
import * as Yaml from "yaml";
|
|
5
6
|
import * as Nodefs from "node:fs";
|
|
6
7
|
import * as Nodepath from "node:path";
|
|
@@ -10,14 +11,14 @@ import * as Stdlib_Result from "@rescript/runtime/lib/es6/Stdlib_Result.js";
|
|
|
10
11
|
import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.js";
|
|
11
12
|
import * as LocalAuth$ReventlessLocal from "./LocalAuth.res.mjs";
|
|
12
13
|
|
|
13
|
-
let entrySchema =
|
|
14
|
-
username: s.m(
|
|
15
|
-
password: s.m(
|
|
16
|
-
groups: s.m(
|
|
17
|
-
userId: s.m(
|
|
14
|
+
let entrySchema = Sury.$schema(s => ({
|
|
15
|
+
username: s.m(Sury.string),
|
|
16
|
+
password: s.m(Sury.string),
|
|
17
|
+
groups: s.m(Sury.array(Sury.string)),
|
|
18
|
+
userId: s.m(Sury.$option(Sury.string))
|
|
18
19
|
}));
|
|
19
20
|
|
|
20
|
-
let _entriesSchema =
|
|
21
|
+
let _entriesSchema = Sury.array(entrySchema);
|
|
21
22
|
|
|
22
23
|
function parseString(yamlText) {
|
|
23
24
|
try {
|
|
@@ -125,7 +125,7 @@ let extractCommandName = (fieldName: string) => {
|
|
|
125
125
|
|
|
126
126
|
let extractVariantSchema = (commandSchema: S.t<unknown>, ~index=0) =>
|
|
127
127
|
switch commandSchema {
|
|
128
|
-
|
|
|
128
|
+
| AnyOf({anyOf}) => anyOf->Array.get(index)->Option.getOr(commandSchema)
|
|
129
129
|
| _ => commandSchema
|
|
130
130
|
}
|
|
131
131
|
|
|
@@ -120,7 +120,7 @@ function extractCommandName(fieldName) {
|
|
|
120
120
|
|
|
121
121
|
function extractVariantSchema(commandSchema, indexOpt) {
|
|
122
122
|
let index = indexOpt !== undefined ? indexOpt : 0;
|
|
123
|
-
if (commandSchema.type === "
|
|
123
|
+
if (commandSchema.type === "anyOf") {
|
|
124
124
|
return Stdlib_Option.getOr(commandSchema.anyOf[index], commandSchema);
|
|
125
125
|
} else {
|
|
126
126
|
return commandSchema;
|
|
@@ -14,7 +14,7 @@ module Make = (Bus: LocalBus.T) => {
|
|
|
14
14
|
("id", JSON.Encode.string(cmdJson.id)),
|
|
15
15
|
(
|
|
16
16
|
"meta",
|
|
17
|
-
cmdJson.meta->
|
|
17
|
+
cmdJson.meta->Reventless.Util_Sury.toJson(Reventless.Message.metaSchema),
|
|
18
18
|
),
|
|
19
19
|
("command", cmdJson.commandJson),
|
|
20
20
|
]),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as S from "sury/src/S.res.mjs";
|
|
4
3
|
import * as Message$Reventless from "@reventlessdev/reventless-spec/src/types/Message.res.mjs";
|
|
4
|
+
import * as Util_Sury$Reventless from "@reventlessdev/reventless-spec/src/util/Util_Sury.res.mjs";
|
|
5
5
|
|
|
6
6
|
function Make(Bus) {
|
|
7
7
|
let make = resources => ({
|
|
@@ -15,7 +15,7 @@ function Make(Bus) {
|
|
|
15
15
|
],
|
|
16
16
|
[
|
|
17
17
|
"meta",
|
|
18
|
-
|
|
18
|
+
Util_Sury$Reventless.toJson(cmdJson.meta, Message$Reventless.metaSchema)
|
|
19
19
|
],
|
|
20
20
|
[
|
|
21
21
|
"command",
|
|
@@ -35,4 +35,4 @@ function Make(Bus) {
|
|
|
35
35
|
export {
|
|
36
36
|
Make,
|
|
37
37
|
}
|
|
38
|
-
/*
|
|
38
|
+
/* Message-Reventless Not a pure module */
|
|
@@ -275,7 +275,7 @@ let makeStorage = (
|
|
|
275
275
|
let meta = switch row->Dict.get("meta") {
|
|
276
276
|
| Some(JSON.String(s)) =>
|
|
277
277
|
switch JSON.parseOrThrow(s) {
|
|
278
|
-
| metaJson => metaJson->
|
|
278
|
+
| metaJson => metaJson->Reventless.Util_Sury.fromJson(Reventless.Message.metaSchema)
|
|
279
279
|
| exception _ => JsError.throwWithMessage("invalid meta JSON in dcb_event row")
|
|
280
280
|
}
|
|
281
281
|
| _ => JsError.throwWithMessage("missing meta column in dcb_event row")
|
|
@@ -345,7 +345,7 @@ let makeStorage = (
|
|
|
345
345
|
newEvents->Array.forEach(event => {
|
|
346
346
|
mutable_ := mutable_.contents + 1
|
|
347
347
|
let pos = mutable_.contents
|
|
348
|
-
let metaJson = event.meta->
|
|
348
|
+
let metaJson = event.meta->Reventless.Util_Sury.toJson(Reventless.Message.metaSchema)
|
|
349
349
|
let recordedAt = ReventlessCore.Message.nowAsISOString()
|
|
350
350
|
insertEventStmt->SqliteDriver.run([
|
|
351
351
|
JSON.Encode.string(name),
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as S from "sury/src/S.res.mjs";
|
|
4
3
|
import * as Stdlib_Int from "@rescript/runtime/lib/es6/Stdlib_Int.js";
|
|
5
4
|
import * as Stdlib_JsExn from "@rescript/runtime/lib/es6/Stdlib_JsExn.js";
|
|
6
5
|
import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
@@ -11,6 +10,7 @@ import * as Stdlib_JsError from "@rescript/runtime/lib/es6/Stdlib_JsError.js";
|
|
|
11
10
|
import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js";
|
|
12
11
|
import * as Message$Reventless from "@reventlessdev/reventless-spec/src/types/Message.res.mjs";
|
|
13
12
|
import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.js";
|
|
13
|
+
import * as Util_Sury$Reventless from "@reventlessdev/reventless-spec/src/util/Util_Sury.res.mjs";
|
|
14
14
|
import * as Message$ReventlessCore from "@reventlessdev/reventless-core/src/Message.res.mjs";
|
|
15
15
|
import * as SqliteDriver$ReventlessLocal from "../SqliteDriver.res.mjs";
|
|
16
16
|
import * as ProjectionPending$ReventlessLocal from "../ProjectionPending.res.mjs";
|
|
@@ -219,7 +219,7 @@ function makeStorage(db, name, param, param$1, param$2) {
|
|
|
219
219
|
meta = Stdlib_JsError.throwWithMessage("invalid meta JSON in dcb_event row");
|
|
220
220
|
}
|
|
221
221
|
if (exit === 1) {
|
|
222
|
-
meta =
|
|
222
|
+
meta = Util_Sury$Reventless.fromJson(metaJson, Message$Reventless.metaSchema);
|
|
223
223
|
}
|
|
224
224
|
} else {
|
|
225
225
|
meta = Stdlib_JsError.throwWithMessage("missing meta column in dcb_event row");
|
|
@@ -284,7 +284,7 @@ function makeStorage(db, name, param, param$1, param$2) {
|
|
|
284
284
|
newEvents.forEach(event => {
|
|
285
285
|
mutable_.contents = mutable_.contents + 1 | 0;
|
|
286
286
|
let pos = mutable_.contents;
|
|
287
|
-
let metaJson =
|
|
287
|
+
let metaJson = Util_Sury$Reventless.toJson(event.meta, Message$Reventless.metaSchema);
|
|
288
288
|
let recordedAt = Message$ReventlessCore.nowAsISOString();
|
|
289
289
|
SqliteDriver$ReventlessLocal.run(insertEventStmt, [
|
|
290
290
|
name,
|
|
@@ -382,4 +382,4 @@ export {
|
|
|
382
382
|
buildQuerySql,
|
|
383
383
|
makeStorage,
|
|
384
384
|
}
|
|
385
|
-
/*
|
|
385
|
+
/* Stdlib_JsExn Not a pure module */
|