@reventlessdev/reventless-local 3.0.0-alpha.227 → 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 +12 -0
- package/package.json +13 -13
- package/src/LocalPlatformRegistry.res +2 -2
- package/src/LocalPlatformRegistry.res.mjs +14 -13
- package/src/Platform.res +10 -10
- package/src/Platform.res.mjs +17 -16
- 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/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/adapter/CommandAuthorizationTest.res.mjs +7 -7
- package/tests/adapter/GraphQL_SchemaInspectorTest.res.mjs +59 -59
- package/tests/adapter/LocalAuthHttpTest.res +1 -1
- package/tests/adapter/LocalAuthHttpTest.res.mjs +2 -2
- package/tests/adapter/QueryDbListResolverTest.res.mjs +5 -5
- 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,18 @@
|
|
|
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
|
+
|
|
6
18
|
# 3.0.0-alpha.227 (2026-08-18)
|
|
7
19
|
|
|
8
20
|
### Bug Fixes
|
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
37
|
"@reventlessdev/rescript-graphql-yoga": "1.0.0-alpha.27",
|
|
39
|
-
"@reventlessdev/rescript-jest": "1.0.0-alpha.10",
|
|
40
38
|
"@reventlessdev/rescript-mcp-sdk": "1.0.0-alpha.21",
|
|
41
|
-
"@reventlessdev/rescript-
|
|
42
|
-
"@reventlessdev/reventless-core": "3.0.0-alpha.239",
|
|
39
|
+
"@reventlessdev/rescript-jest": "1.0.0-alpha.10",
|
|
43
40
|
"@reventlessdev/rescript-pulumi-pulumi": "2.3.0-alpha.19",
|
|
44
|
-
"@reventlessdev/
|
|
45
|
-
"@reventlessdev/reventless-
|
|
46
|
-
"@reventlessdev/reventless-
|
|
47
|
-
"@reventlessdev/
|
|
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",
|
|
48
47
|
"@reventlessdev/reventless-seed": "1.0.0-alpha.16",
|
|
49
|
-
"@reventlessdev/reventless-
|
|
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))
|
|
@@ -1723,7 +1723,7 @@ module MakeWithConfig = (
|
|
|
1723
1723
|
switch Bus.getQueryDbScan(pluginQueryDbName) {
|
|
1724
1724
|
| Some(scanAll) =>
|
|
1725
1725
|
scanAll()->Array.forEach(json =>
|
|
1726
|
-
switch json->
|
|
1726
|
+
switch json->Reventless.Util_Sury.fromJson(ReventlessCore.PluginsReadModelSpec.stateSchema) {
|
|
1727
1727
|
| state => statusByName->Dict.set(state.name, state.status)
|
|
1728
1728
|
| exception _ => ()
|
|
1729
1729
|
}
|
|
@@ -1805,7 +1805,7 @@ module MakeWithConfig = (
|
|
|
1805
1805
|
switch Bus.getQueryDbScan(pluginQueryDbName) {
|
|
1806
1806
|
| Some(scanAll) =>
|
|
1807
1807
|
scanAll()->Array.forEach(json =>
|
|
1808
|
-
switch json->
|
|
1808
|
+
switch json->Reventless.Util_Sury.fromJson(ReventlessCore.PluginsReadModelSpec.stateSchema) {
|
|
1809
1809
|
| state =>
|
|
1810
1810
|
let id = state.name ++ "@" ++ state.version
|
|
1811
1811
|
dict->Dict.set(id, state.status)
|
|
@@ -1886,7 +1886,7 @@ module MakeWithConfig = (
|
|
|
1886
1886
|
// mixed store never surfaces duplicates (mirrors Platform_UIFragments_Lambda.res).
|
|
1887
1887
|
let latestByName = Dict.make()
|
|
1888
1888
|
items->Array.forEach(item =>
|
|
1889
|
-
switch item->S.parseOrThrow(ReventlessCore.UiFragments.stateSchema) {
|
|
1889
|
+
switch item->S.parseOrThrow(~to=ReventlessCore.UiFragments.stateSchema) {
|
|
1890
1890
|
| state =>
|
|
1891
1891
|
let name = ReventlessCore.Plugin.name(state.pluginId)
|
|
1892
1892
|
let version = ReventlessCore.Plugin.version(state.pluginId)
|
|
@@ -1932,7 +1932,7 @@ module MakeWithConfig = (
|
|
|
1932
1932
|
switch Bus.getQueryDbScan(pluginQueryDbName) {
|
|
1933
1933
|
| Some(scanAll) =>
|
|
1934
1934
|
scanAll()->Array.findMap(json =>
|
|
1935
|
-
switch json->
|
|
1935
|
+
switch json->Reventless.Util_Sury.fromJson(ReventlessCore.PluginsReadModelSpec.stateSchema) {
|
|
1936
1936
|
| state if state.name == pluginName => Some(state.version)
|
|
1937
1937
|
| _ => None
|
|
1938
1938
|
| exception _ => None
|
|
@@ -2385,7 +2385,7 @@ module MakeWithConfig = (
|
|
|
2385
2385
|
}
|
|
2386
2386
|
items
|
|
2387
2387
|
->Array.filterMap(item =>
|
|
2388
|
-
switch item->S.parseOrThrow(ReventlessCore.UiFragments.stateSchema) {
|
|
2388
|
+
switch item->S.parseOrThrow(~to=ReventlessCore.UiFragments.stateSchema) {
|
|
2389
2389
|
| state =>
|
|
2390
2390
|
Some(ReventlessCore.Platform_UIFragmentsApi.encodeUIFragmentEntry(state))
|
|
2391
2391
|
| exception _ => None
|
package/src/Platform.res.mjs
CHANGED
|
@@ -13,6 +13,7 @@ import * as Effect from "effect/Effect";
|
|
|
13
13
|
import * as Pulumi from "@pulumi/pulumi";
|
|
14
14
|
import * as Stdlib_Promise from "@rescript/runtime/lib/es6/Stdlib_Promise.js";
|
|
15
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";
|
|
16
17
|
import * as Logger$ReventlessCore from "@reventlessdev/reventless-core/src/util/Logger.res.mjs";
|
|
17
18
|
import * as Plugin$ReventlessCore from "@reventlessdev/reventless-core/src/plugin/component/Plugin.res.mjs";
|
|
18
19
|
import * as Message$ReventlessCore from "@reventlessdev/reventless-core/src/Message.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
|
}
|
|
@@ -1335,7 +1336,7 @@ function MakeWithConfig(Config) {
|
|
|
1335
1336
|
scanAll().forEach(json => {
|
|
1336
1337
|
let state;
|
|
1337
1338
|
try {
|
|
1338
|
-
state =
|
|
1339
|
+
state = Util_Sury$Reventless.fromJson(json, PluginsReadModelSpec$ReventlessCore.stateSchema);
|
|
1339
1340
|
} catch (exn) {
|
|
1340
1341
|
return;
|
|
1341
1342
|
}
|
|
@@ -1397,7 +1398,7 @@ function MakeWithConfig(Config) {
|
|
|
1397
1398
|
scanAll().forEach(json => {
|
|
1398
1399
|
let state;
|
|
1399
1400
|
try {
|
|
1400
|
-
state =
|
|
1401
|
+
state = Util_Sury$Reventless.fromJson(json, PluginsReadModelSpec$ReventlessCore.stateSchema);
|
|
1401
1402
|
} catch (exn) {
|
|
1402
1403
|
return;
|
|
1403
1404
|
}
|
|
@@ -1474,7 +1475,7 @@ function MakeWithConfig(Config) {
|
|
|
1474
1475
|
return Stdlib_Array.findMap(scanAll(), json => {
|
|
1475
1476
|
let state;
|
|
1476
1477
|
try {
|
|
1477
|
-
state =
|
|
1478
|
+
state = Util_Sury$Reventless.fromJson(json, PluginsReadModelSpec$ReventlessCore.stateSchema);
|
|
1478
1479
|
} catch (exn) {
|
|
1479
1480
|
return;
|
|
1480
1481
|
}
|
|
@@ -2612,7 +2613,7 @@ function Make($star) {
|
|
|
2612
2613
|
let pluginEventTopicKey = PluginSpec$ReventlessCore.name + "AggrEventTopic";
|
|
2613
2614
|
let dispatchPluginCommand = (pluginName, command) => {
|
|
2614
2615
|
let cmdJson_meta = Message$ReventlessCore.generateMeta(PluginSpec$ReventlessCore.name, undefined, undefined, undefined, undefined, undefined, undefined, undefined);
|
|
2615
|
-
let cmdJson_commandJson =
|
|
2616
|
+
let cmdJson_commandJson = Util_Sury$Reventless.toJson(command, PluginSpec$ReventlessCore.commandSchema);
|
|
2616
2617
|
let cmdJson = {
|
|
2617
2618
|
id: pluginName,
|
|
2618
2619
|
meta: cmdJson_meta,
|
|
@@ -2623,7 +2624,7 @@ function Make($star) {
|
|
|
2623
2624
|
let adminDcbCmdTopicKey = ComponentType$ReventlessCore.name(Platform_Admin_Structure$ReventlessCore.pluginId + "Dcb", "CommandTopic");
|
|
2624
2625
|
let dispatchUiFragmentCommand = (pluginName, command) => {
|
|
2625
2626
|
let cmdJson_meta = Message$ReventlessCore.generateMeta(UiFragmentRegistry$ReventlessCore.name, undefined, undefined, undefined, undefined, undefined, undefined, undefined);
|
|
2626
|
-
let cmdJson_commandJson =
|
|
2627
|
+
let cmdJson_commandJson = Util_Sury$Reventless.toJson(command, UiFragmentRegistry$ReventlessCore.commandSchema);
|
|
2627
2628
|
let cmdJson = {
|
|
2628
2629
|
id: pluginName,
|
|
2629
2630
|
meta: cmdJson_meta,
|
|
@@ -2697,9 +2698,9 @@ function Make($star) {
|
|
|
2697
2698
|
}
|
|
2698
2699
|
switch (match.TAG) {
|
|
2699
2700
|
case "UiFragmentRegistered" :
|
|
2700
|
-
return publishUIFragment(match.pluginId, "Registered",
|
|
2701
|
+
return publishUIFragment(match.pluginId, "Registered", Util_Sury$Reventless.toJson(match.manifest, Plugin$Reventless.uiFragmentManifestSchema));
|
|
2701
2702
|
case "UiFragmentUpdated" :
|
|
2702
|
-
return publishUIFragment(match.pluginId, "Updated",
|
|
2703
|
+
return publishUIFragment(match.pluginId, "Updated", Util_Sury$Reventless.toJson(match.newManifest, Plugin$Reventless.uiFragmentManifestSchema));
|
|
2703
2704
|
case "UiFragmentDeregistered" :
|
|
2704
2705
|
return publishUIFragment(match.pluginId, "Deregistered", null);
|
|
2705
2706
|
}
|
|
@@ -3060,7 +3061,7 @@ function Make($star) {
|
|
|
3060
3061
|
scanAll().forEach(json => {
|
|
3061
3062
|
let state;
|
|
3062
3063
|
try {
|
|
3063
|
-
state =
|
|
3064
|
+
state = Util_Sury$Reventless.fromJson(json, PluginsReadModelSpec$ReventlessCore.stateSchema);
|
|
3064
3065
|
} catch (exn) {
|
|
3065
3066
|
return;
|
|
3066
3067
|
}
|
|
@@ -3122,7 +3123,7 @@ function Make($star) {
|
|
|
3122
3123
|
scanAll().forEach(json => {
|
|
3123
3124
|
let state;
|
|
3124
3125
|
try {
|
|
3125
|
-
state =
|
|
3126
|
+
state = Util_Sury$Reventless.fromJson(json, PluginsReadModelSpec$ReventlessCore.stateSchema);
|
|
3126
3127
|
} catch (exn) {
|
|
3127
3128
|
return;
|
|
3128
3129
|
}
|
|
@@ -3199,7 +3200,7 @@ function Make($star) {
|
|
|
3199
3200
|
return Stdlib_Array.findMap(scanAll(), json => {
|
|
3200
3201
|
let state;
|
|
3201
3202
|
try {
|
|
3202
|
-
state =
|
|
3203
|
+
state = Util_Sury$Reventless.fromJson(json, PluginsReadModelSpec$ReventlessCore.stateSchema);
|
|
3203
3204
|
} catch (exn) {
|
|
3204
3205
|
return;
|
|
3205
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 */
|
|
@@ -110,7 +110,7 @@ let handleLogin = (req: nodeRequest, res: nodeResponse): unit =>
|
|
|
110
110
|
| None => Reventless.Identity.anonymous
|
|
111
111
|
}
|
|
112
112
|
let identityJson =
|
|
113
|
-
identity->
|
|
113
|
+
identity->Reventless.Util_Sury.toJson(Reventless.Identity.schema)
|
|
114
114
|
_writeJson(
|
|
115
115
|
res,
|
|
116
116
|
~status=200,
|
|
@@ -171,7 +171,7 @@ let handleSwitchRole = (req: nodeRequest, res: nodeResponse): unit =>
|
|
|
171
171
|
("token", JSON.Encode.string(newToken)),
|
|
172
172
|
(
|
|
173
173
|
"identity",
|
|
174
|
-
identity->
|
|
174
|
+
identity->Reventless.Util_Sury.toJson(Reventless.Identity.schema),
|
|
175
175
|
),
|
|
176
176
|
]),
|
|
177
177
|
),
|
|
@@ -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 Http from "http";
|
|
5
4
|
import * as Graphql from "graphql";
|
|
6
5
|
import * as GraphqlYoga from "@reventlessdev/rescript-graphql-yoga/src/GraphqlYoga.res.mjs";
|
|
@@ -14,6 +13,7 @@ import * as Stdlib_JsError from "@rescript/runtime/lib/es6/Stdlib_JsError.js";
|
|
|
14
13
|
import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js";
|
|
15
14
|
import * as Identity$Reventless from "@reventlessdev/reventless-spec/src/types/Identity.res.mjs";
|
|
16
15
|
import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.js";
|
|
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 Api_Ids$ReventlessCore from "@reventlessdev/reventless-core/src/components/Api/Api_Ids.res.mjs";
|
|
19
19
|
import * as LocalAuth$ReventlessLocal from "./Auth/LocalAuth.res.mjs";
|
|
@@ -75,7 +75,7 @@ function handleLogin(req, res) {
|
|
|
75
75
|
if (result.TAG === "Ok") {
|
|
76
76
|
let i = LocalAuth$ReventlessLocal.Login.mintedIdentity(username, activeRole);
|
|
77
77
|
let identity = i !== undefined ? i : Identity$Reventless.anonymous;
|
|
78
|
-
let identityJson =
|
|
78
|
+
let identityJson = Util_Sury$Reventless.toJson(identity, Identity$Reventless.schema);
|
|
79
79
|
_writeJson(res, 200, Object.fromEntries([
|
|
80
80
|
[
|
|
81
81
|
"token",
|
|
@@ -130,7 +130,7 @@ function handleSwitchRole(req, res) {
|
|
|
130
130
|
],
|
|
131
131
|
[
|
|
132
132
|
"identity",
|
|
133
|
-
|
|
133
|
+
Util_Sury$Reventless.toJson(identity, Identity$Reventless.schema)
|
|
134
134
|
]
|
|
135
135
|
]));
|
|
136
136
|
});
|
|
@@ -143,7 +143,7 @@ let extractIdentity = (req: McpSdk.incomingMessage): Reventless.Identity.t => {
|
|
|
143
143
|
| Some(json) =>
|
|
144
144
|
json
|
|
145
145
|
->JSON.parseOrThrow
|
|
146
|
-
->S.parseOrThrow(Reventless.Identity.schema)
|
|
146
|
+
->S.parseOrThrow(~to=Reventless.Identity.schema)
|
|
147
147
|
| None => Reventless.Identity.anonymous
|
|
148
148
|
}
|
|
149
149
|
} catch {
|
|
@@ -157,7 +157,7 @@ let make = (~label: string="MCP"): t => {
|
|
|
157
157
|
| Some(json) =>
|
|
158
158
|
json
|
|
159
159
|
->JSON.parseOrThrow
|
|
160
|
-
->S.parseOrThrow(Reventless.Identity.schema)
|
|
160
|
+
->S.parseOrThrow(~to=Reventless.Identity.schema)
|
|
161
161
|
| None => Reventless.Identity.anonymous
|
|
162
162
|
}
|
|
163
163
|
} catch {
|