@reventlessdev/reventless-core 3.0.0-alpha.337 → 3.0.0-alpha.339
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 +16 -0
- package/package.json +7 -7
- package/src/ComponentType.res +38 -62
- package/src/ComponentType.res.mjs +34 -115
- package/src/ResourceAttribution.res +7 -33
- package/src/ResourceAttribution.res.mjs +2 -51
- package/src/ViewChange.res.mjs +2 -2
- package/src/admin/Platform_ComponentDefinitionsApi.res +10 -11
- package/src/admin/Platform_ComponentDefinitionsApi.res.mjs +9 -8
- package/src/admin/Platform_PluginStructuresApi.res +1 -1
- package/src/admin/Platform_SelfRegistration.res.mjs +3 -3
- package/src/components/QueryDb/QueryDb.res.mjs +1 -1
- package/src/plugin/component/Plugin_Builder.res +1 -1
- package/src/plugin/component/Plugin_Builder.res.mjs +2 -2
- package/src/plugin/component/Plugin_BuiltHook.res +7 -2
- package/src/plugin/component/Plugin_Structure.res +8 -14
- package/src/plugin/component/Plugin_Structure.res.mjs +9 -18
- package/src/plugin/component/SchemaWalker.res +4 -4
- package/src/plugin/component/SchemaWalker.res.mjs +4 -4
- package/src/plugin/connect/PluginExtensionPoint_Builder.res +4 -1
- package/src/plugin/connect/PluginExtensionPoint_Plugin.res +7 -3
- package/src/plugin/connect/PluginExtensionPoint_Plugin.res.mjs +2 -2
- package/src/util/EffectLogger.res.mjs +8 -8
- package/src/util/Logger.res +21 -7
- package/src/util/Logger.res.mjs +44 -30
- package/tests/ClosedSetWordsTest.res +105 -0
- package/tests/ClosedSetWordsTest.res.mjs +145 -0
- package/tests/ResourceAttributionTest.res.mjs +4 -7
- package/tests/admin/AdminApiSchemaDriftTest.res +1 -1
- package/tests/admin/Platform_BakedManifestTest.res +1 -1
- package/tests/admin/Platform_ComponentDefinitionsApiTest.res +1 -1
- package/tests/admin/Platform_PluginStructuresApiTest.res +3 -3
- package/tests/admin/Platform_SelfRegistrationTest.res +2 -2
- package/tests/commandgenerator/OwnerStampingTest.res.mjs +1 -1
- package/tests/logger/LogFormatTest.res.mjs +2 -2
- package/tests/logger/LoggerLazyTest.res.mjs +2 -2
- package/tests/logger/LoggerSinkTest.res.mjs +26 -26
- package/tests/plugin/ManifestVisibilityTest.res +4 -2
- package/tests/plugin/ManifestVisibilityTest.res.mjs +5 -1
- package/tests/plugin/SchemaWalkerTest.res +3 -3
- package/tests/plugin/SchemaWalkerTest.res.mjs +3 -3
- package/tests/projection/ViewChangeTest.res.mjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
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.339 (2026-11-15)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @reventlessdev/reventless-core
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# 3.0.0-alpha.338 (2026-11-12)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @reventlessdev/reventless-core
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
# 3.0.0-alpha.337 (2026-11-11)
|
|
7
23
|
|
|
8
24
|
### Features
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reventlessdev/reventless-core",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.339",
|
|
4
4
|
"description": "Core package for Reventless framework",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"jest": {
|
|
@@ -28,22 +28,22 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"sury": "11.1.0",
|
|
30
30
|
"uuid": "^13.0.0",
|
|
31
|
-
"@reventlessdev/rescript-jest": "1.0.0-alpha.13",
|
|
32
|
-
"@reventlessdev/rescript-node": "2.0.0-alpha.26",
|
|
33
31
|
"@reventlessdev/rescript-effect": "1.0.0-alpha.3",
|
|
34
32
|
"@reventlessdev/rescript-fast-csv": "2.0.0-alpha.26",
|
|
35
33
|
"@reventlessdev/rescript-hash-object": "1.2.0-alpha.15",
|
|
34
|
+
"@reventlessdev/rescript-jest": "1.0.0-alpha.13",
|
|
35
|
+
"@reventlessdev/rescript-node": "2.0.0-alpha.26",
|
|
36
36
|
"@reventlessdev/rescript-pulumi-pulumi": "3.0.0-alpha.0",
|
|
37
|
-
"@reventlessdev/rescript-ssh2": "2.0.0-alpha.27",
|
|
38
37
|
"@reventlessdev/rescript-uuid": "2.0.0-alpha.1",
|
|
38
|
+
"@reventlessdev/reventless-infra": "3.0.0-alpha.232",
|
|
39
|
+
"@reventlessdev/rescript-ssh2": "2.0.0-alpha.27",
|
|
39
40
|
"@reventlessdev/reventless-interop": "3.0.0-alpha.43",
|
|
40
|
-
"@reventlessdev/reventless-spec": "3.0.0-alpha.
|
|
41
|
-
"@reventlessdev/reventless-infra": "3.0.0-alpha.230"
|
|
41
|
+
"@reventlessdev/reventless-spec": "3.0.0-alpha.201"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"rescript": "12.3.1",
|
|
45
45
|
"sury-ppx": "11.1.0",
|
|
46
|
-
"@reventlessdev/reventless-ppx": "1.0.0-alpha.
|
|
46
|
+
"@reventlessdev/reventless-ppx": "1.0.0-alpha.113"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"rescript": "^12.3.1"
|
package/src/ComponentType.res
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// A component's kind. Its text is the case's own name, but for `QueryDb`, deployed as
|
|
2
|
+
// `QueryDB`: a component's Pulumi type token, the `reventless:kind` tag and a
|
|
3
|
+
// runtime's `runtimeKind` carry it, so a word here is stored by every deployment.
|
|
1
4
|
type t =
|
|
2
5
|
| Aggregate
|
|
3
6
|
| Counter
|
|
@@ -11,7 +14,7 @@ type t =
|
|
|
11
14
|
| EventTopic
|
|
12
15
|
| ExtensionPoint
|
|
13
16
|
| Extension
|
|
14
|
-
| QueryDb
|
|
17
|
+
| @as("QueryDB") QueryDb
|
|
15
18
|
| ReadModel
|
|
16
19
|
| Scheduler
|
|
17
20
|
| Service
|
|
@@ -27,69 +30,42 @@ type t =
|
|
|
27
30
|
| OutboundTranslationSlice
|
|
28
31
|
| InboundTranslationSlice
|
|
29
32
|
|
|
30
|
-
let
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
33
|
+
let all = [
|
|
34
|
+
Aggregate,
|
|
35
|
+
Counter,
|
|
36
|
+
Plugin,
|
|
37
|
+
Platform,
|
|
38
|
+
CommandGenerator,
|
|
39
|
+
CommandTopic,
|
|
40
|
+
EventCollector,
|
|
41
|
+
EventLog,
|
|
42
|
+
EventMapper,
|
|
43
|
+
EventTopic,
|
|
44
|
+
ExtensionPoint,
|
|
45
|
+
Extension,
|
|
46
|
+
QueryDb,
|
|
47
|
+
ReadModel,
|
|
48
|
+
Scheduler,
|
|
49
|
+
Service,
|
|
50
|
+
SideEffectHandler,
|
|
51
|
+
Task,
|
|
52
|
+
Vpc,
|
|
53
|
+
Heartbeat,
|
|
54
|
+
Cloner,
|
|
55
|
+
DcbEventLog,
|
|
56
|
+
StateChangeSlice,
|
|
57
|
+
StateViewSlice,
|
|
58
|
+
AutomationSlice,
|
|
59
|
+
OutboundTranslationSlice,
|
|
60
|
+
InboundTranslationSlice,
|
|
61
|
+
]
|
|
60
62
|
|
|
61
|
-
let
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
| "Counter" => Counter->Some
|
|
65
|
-
| "Plugin" => Plugin->Some
|
|
66
|
-
| "Platform" => Platform->Some
|
|
67
|
-
| "CommandGenerator" => CommandGenerator->Some
|
|
68
|
-
| "CommandTopic" => CommandTopic->Some
|
|
69
|
-
| "EventCollector" => EventCollector->Some
|
|
70
|
-
| "EventLog" => EventLog->Some
|
|
71
|
-
| "EventMapper" => EventMapper->Some
|
|
72
|
-
| "EventTopic" => EventTopic->Some
|
|
73
|
-
| "ExtensionPoint" => ExtensionPoint->Some
|
|
74
|
-
| "Extension" => Extension->Some
|
|
75
|
-
| "QueryDB" => QueryDb->Some
|
|
76
|
-
| "ReadModel" => ReadModel->Some
|
|
77
|
-
| "Scheduler" => Scheduler->Some
|
|
78
|
-
| "Service" => Service->Some
|
|
79
|
-
| "SideEffectHandler" => SideEffectHandler->Some
|
|
80
|
-
| "Task" => Task->Some
|
|
81
|
-
| "Vpc" => Vpc->Some
|
|
82
|
-
| "Heartbeat" => Heartbeat->Some
|
|
83
|
-
| "Cloner" => Cloner->Some
|
|
84
|
-
| "DcbEventLog" => DcbEventLog->Some
|
|
85
|
-
| "StateChangeSlice" => StateChangeSlice->Some
|
|
86
|
-
| "StateViewSlice" => StateViewSlice->Some
|
|
87
|
-
| "AutomationSlice" => AutomationSlice->Some
|
|
88
|
-
| "OutboundTranslationSlice" => OutboundTranslationSlice->Some
|
|
89
|
-
| "InboundTranslationSlice" => InboundTranslationSlice->Some
|
|
90
|
-
| _ => None
|
|
91
|
-
}
|
|
63
|
+
let toString = (componentType: t): string => (componentType :> string)
|
|
64
|
+
|
|
65
|
+
let ofString = (str: string): option<t> => all->Array.find(t => toString(t) == str)
|
|
92
66
|
|
|
67
|
+
// The short name a component's resources are named with. A second spelling on
|
|
68
|
+
// purpose: it is part of every physical resource name already deployed.
|
|
93
69
|
let toName = componentType =>
|
|
94
70
|
switch componentType {
|
|
95
71
|
| Aggregate => "Aggr"
|
|
@@ -2,124 +2,42 @@
|
|
|
2
2
|
|
|
3
3
|
import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
4
4
|
|
|
5
|
+
let all = [
|
|
6
|
+
"Aggregate",
|
|
7
|
+
"Counter",
|
|
8
|
+
"Plugin",
|
|
9
|
+
"Platform",
|
|
10
|
+
"CommandGenerator",
|
|
11
|
+
"CommandTopic",
|
|
12
|
+
"EventCollector",
|
|
13
|
+
"EventLog",
|
|
14
|
+
"EventMapper",
|
|
15
|
+
"EventTopic",
|
|
16
|
+
"ExtensionPoint",
|
|
17
|
+
"Extension",
|
|
18
|
+
"QueryDB",
|
|
19
|
+
"ReadModel",
|
|
20
|
+
"Scheduler",
|
|
21
|
+
"Service",
|
|
22
|
+
"SideEffectHandler",
|
|
23
|
+
"Task",
|
|
24
|
+
"Vpc",
|
|
25
|
+
"Heartbeat",
|
|
26
|
+
"Cloner",
|
|
27
|
+
"DcbEventLog",
|
|
28
|
+
"StateChangeSlice",
|
|
29
|
+
"StateViewSlice",
|
|
30
|
+
"AutomationSlice",
|
|
31
|
+
"OutboundTranslationSlice",
|
|
32
|
+
"InboundTranslationSlice"
|
|
33
|
+
];
|
|
34
|
+
|
|
5
35
|
function toString(componentType) {
|
|
6
|
-
|
|
7
|
-
case "Aggregate" :
|
|
8
|
-
return "Aggregate";
|
|
9
|
-
case "Counter" :
|
|
10
|
-
return "Counter";
|
|
11
|
-
case "Plugin" :
|
|
12
|
-
return "Plugin";
|
|
13
|
-
case "Platform" :
|
|
14
|
-
return "Platform";
|
|
15
|
-
case "CommandGenerator" :
|
|
16
|
-
return "CommandGenerator";
|
|
17
|
-
case "CommandTopic" :
|
|
18
|
-
return "CommandTopic";
|
|
19
|
-
case "EventCollector" :
|
|
20
|
-
return "EventCollector";
|
|
21
|
-
case "EventLog" :
|
|
22
|
-
return "EventLog";
|
|
23
|
-
case "EventMapper" :
|
|
24
|
-
return "EventMapper";
|
|
25
|
-
case "EventTopic" :
|
|
26
|
-
return "EventTopic";
|
|
27
|
-
case "ExtensionPoint" :
|
|
28
|
-
return "ExtensionPoint";
|
|
29
|
-
case "Extension" :
|
|
30
|
-
return "Extension";
|
|
31
|
-
case "QueryDb" :
|
|
32
|
-
return "QueryDB";
|
|
33
|
-
case "ReadModel" :
|
|
34
|
-
return "ReadModel";
|
|
35
|
-
case "Scheduler" :
|
|
36
|
-
return "Scheduler";
|
|
37
|
-
case "Service" :
|
|
38
|
-
return "Service";
|
|
39
|
-
case "SideEffectHandler" :
|
|
40
|
-
return "SideEffectHandler";
|
|
41
|
-
case "Task" :
|
|
42
|
-
return "Task";
|
|
43
|
-
case "Vpc" :
|
|
44
|
-
return "Vpc";
|
|
45
|
-
case "Heartbeat" :
|
|
46
|
-
return "Heartbeat";
|
|
47
|
-
case "Cloner" :
|
|
48
|
-
return "Cloner";
|
|
49
|
-
case "DcbEventLog" :
|
|
50
|
-
return "DcbEventLog";
|
|
51
|
-
case "StateChangeSlice" :
|
|
52
|
-
return "StateChangeSlice";
|
|
53
|
-
case "StateViewSlice" :
|
|
54
|
-
return "StateViewSlice";
|
|
55
|
-
case "AutomationSlice" :
|
|
56
|
-
return "AutomationSlice";
|
|
57
|
-
case "OutboundTranslationSlice" :
|
|
58
|
-
return "OutboundTranslationSlice";
|
|
59
|
-
case "InboundTranslationSlice" :
|
|
60
|
-
return "InboundTranslationSlice";
|
|
61
|
-
}
|
|
36
|
+
return componentType;
|
|
62
37
|
}
|
|
63
38
|
|
|
64
39
|
function ofString(str) {
|
|
65
|
-
|
|
66
|
-
case "Aggregate" :
|
|
67
|
-
return "Aggregate";
|
|
68
|
-
case "AutomationSlice" :
|
|
69
|
-
return "AutomationSlice";
|
|
70
|
-
case "Cloner" :
|
|
71
|
-
return "Cloner";
|
|
72
|
-
case "CommandGenerator" :
|
|
73
|
-
return "CommandGenerator";
|
|
74
|
-
case "CommandTopic" :
|
|
75
|
-
return "CommandTopic";
|
|
76
|
-
case "Counter" :
|
|
77
|
-
return "Counter";
|
|
78
|
-
case "DcbEventLog" :
|
|
79
|
-
return "DcbEventLog";
|
|
80
|
-
case "EventCollector" :
|
|
81
|
-
return "EventCollector";
|
|
82
|
-
case "EventLog" :
|
|
83
|
-
return "EventLog";
|
|
84
|
-
case "EventMapper" :
|
|
85
|
-
return "EventMapper";
|
|
86
|
-
case "EventTopic" :
|
|
87
|
-
return "EventTopic";
|
|
88
|
-
case "Extension" :
|
|
89
|
-
return "Extension";
|
|
90
|
-
case "ExtensionPoint" :
|
|
91
|
-
return "ExtensionPoint";
|
|
92
|
-
case "Heartbeat" :
|
|
93
|
-
return "Heartbeat";
|
|
94
|
-
case "InboundTranslationSlice" :
|
|
95
|
-
return "InboundTranslationSlice";
|
|
96
|
-
case "OutboundTranslationSlice" :
|
|
97
|
-
return "OutboundTranslationSlice";
|
|
98
|
-
case "Platform" :
|
|
99
|
-
return "Platform";
|
|
100
|
-
case "Plugin" :
|
|
101
|
-
return "Plugin";
|
|
102
|
-
case "QueryDB" :
|
|
103
|
-
return "QueryDb";
|
|
104
|
-
case "ReadModel" :
|
|
105
|
-
return "ReadModel";
|
|
106
|
-
case "Scheduler" :
|
|
107
|
-
return "Scheduler";
|
|
108
|
-
case "Service" :
|
|
109
|
-
return "Service";
|
|
110
|
-
case "SideEffectHandler" :
|
|
111
|
-
return "SideEffectHandler";
|
|
112
|
-
case "StateChangeSlice" :
|
|
113
|
-
return "StateChangeSlice";
|
|
114
|
-
case "StateViewSlice" :
|
|
115
|
-
return "StateViewSlice";
|
|
116
|
-
case "Task" :
|
|
117
|
-
return "Task";
|
|
118
|
-
case "Vpc" :
|
|
119
|
-
return "Vpc";
|
|
120
|
-
default:
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
40
|
+
return all.find(t => t === str);
|
|
123
41
|
}
|
|
124
42
|
|
|
125
43
|
function toName(componentType) {
|
|
@@ -148,7 +66,7 @@ function toName(componentType) {
|
|
|
148
66
|
return "ExtPoint";
|
|
149
67
|
case "Extension" :
|
|
150
68
|
return "Extension";
|
|
151
|
-
case "
|
|
69
|
+
case "QueryDB" :
|
|
152
70
|
return "QueryDb";
|
|
153
71
|
case "ReadModel" :
|
|
154
72
|
return "ReadModel";
|
|
@@ -190,6 +108,7 @@ function nameOpt(name, t) {
|
|
|
190
108
|
}
|
|
191
109
|
|
|
192
110
|
export {
|
|
111
|
+
all,
|
|
193
112
|
toString,
|
|
194
113
|
ofString,
|
|
195
114
|
toName,
|
|
@@ -25,18 +25,13 @@ neither derives from the other.
|
|
|
25
25
|
module Scope = {
|
|
26
26
|
type t =
|
|
27
27
|
/** owned by one model component */
|
|
28
|
-
| Component
|
|
28
|
+
| @as("component") Component
|
|
29
29
|
/** shared substrate within a plugin (DcbEventLog, plugin DLQ, …) */
|
|
30
|
-
| Plugin
|
|
30
|
+
| @as("plugin") Plugin
|
|
31
31
|
/** shared substrate across the platform (API, auth, hosting, …) */
|
|
32
|
-
| Platform
|
|
33
|
-
|
|
34
|
-
let toString = scope =>
|
|
35
|
-
switch scope {
|
|
36
|
-
| Component => "component"
|
|
37
|
-
| Plugin => "plugin"
|
|
38
|
-
| Platform => "platform"
|
|
39
|
-
}
|
|
32
|
+
| @as("platform") Platform
|
|
33
|
+
|
|
34
|
+
let toString = (scope: t): string => (scope :> string)
|
|
40
35
|
}
|
|
41
36
|
|
|
42
37
|
/**
|
|
@@ -44,6 +39,7 @@ The deployment role a resource plays. `Other(string)` is the escape hatch
|
|
|
44
39
|
for support roles and future ones (same pattern as `Monitoring.unitKind`).
|
|
45
40
|
*/
|
|
46
41
|
module Role = {
|
|
42
|
+
@unboxed
|
|
47
43
|
type t =
|
|
48
44
|
| CommandTopic
|
|
49
45
|
| EventTopic
|
|
@@ -77,29 +73,7 @@ module Role = {
|
|
|
77
73
|
| DataTransfer
|
|
78
74
|
| Other(string)
|
|
79
75
|
|
|
80
|
-
let toString = role =>
|
|
81
|
-
switch role {
|
|
82
|
-
| CommandTopic => "CommandTopic"
|
|
83
|
-
| EventTopic => "EventTopic"
|
|
84
|
-
| StateTopic => "StateTopic"
|
|
85
|
-
| EventLog => "EventLog"
|
|
86
|
-
| DcbEventLog => "DcbEventLog"
|
|
87
|
-
| EventLogSubscription => "EventLogSubscription"
|
|
88
|
-
| EventCollector => "EventCollector"
|
|
89
|
-
| QueryDb => "QueryDb"
|
|
90
|
-
| Runtime => "Runtime"
|
|
91
|
-
| DeadLetter => "DeadLetter"
|
|
92
|
-
| Scheduler => "Scheduler"
|
|
93
|
-
| Logs => "Logs"
|
|
94
|
-
| Identity => "Identity"
|
|
95
|
-
| Api => "Api"
|
|
96
|
-
| Auth => "Auth"
|
|
97
|
-
| Hosting => "Hosting"
|
|
98
|
-
| Network => "Network"
|
|
99
|
-
| EventSourceMapping => "EventSourceMapping"
|
|
100
|
-
| DataTransfer => "DataTransfer"
|
|
101
|
-
| Other(name) => name
|
|
102
|
-
}
|
|
76
|
+
let toString = (role: t): string => (role :> string)
|
|
103
77
|
}
|
|
104
78
|
|
|
105
79
|
/**
|
|
@@ -2,14 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
function toString(scope) {
|
|
5
|
-
|
|
6
|
-
case "Component" :
|
|
7
|
-
return "component";
|
|
8
|
-
case "Plugin" :
|
|
9
|
-
return "plugin";
|
|
10
|
-
case "Platform" :
|
|
11
|
-
return "platform";
|
|
12
|
-
}
|
|
5
|
+
return scope;
|
|
13
6
|
}
|
|
14
7
|
|
|
15
8
|
let Scope = {
|
|
@@ -17,49 +10,7 @@ let Scope = {
|
|
|
17
10
|
};
|
|
18
11
|
|
|
19
12
|
function toString$1(role) {
|
|
20
|
-
|
|
21
|
-
return role._0;
|
|
22
|
-
}
|
|
23
|
-
switch (role) {
|
|
24
|
-
case "CommandTopic" :
|
|
25
|
-
return "CommandTopic";
|
|
26
|
-
case "EventTopic" :
|
|
27
|
-
return "EventTopic";
|
|
28
|
-
case "StateTopic" :
|
|
29
|
-
return "StateTopic";
|
|
30
|
-
case "EventLog" :
|
|
31
|
-
return "EventLog";
|
|
32
|
-
case "DcbEventLog" :
|
|
33
|
-
return "DcbEventLog";
|
|
34
|
-
case "EventLogSubscription" :
|
|
35
|
-
return "EventLogSubscription";
|
|
36
|
-
case "EventCollector" :
|
|
37
|
-
return "EventCollector";
|
|
38
|
-
case "QueryDb" :
|
|
39
|
-
return "QueryDb";
|
|
40
|
-
case "Runtime" :
|
|
41
|
-
return "Runtime";
|
|
42
|
-
case "DeadLetter" :
|
|
43
|
-
return "DeadLetter";
|
|
44
|
-
case "Scheduler" :
|
|
45
|
-
return "Scheduler";
|
|
46
|
-
case "Logs" :
|
|
47
|
-
return "Logs";
|
|
48
|
-
case "Identity" :
|
|
49
|
-
return "Identity";
|
|
50
|
-
case "Api" :
|
|
51
|
-
return "Api";
|
|
52
|
-
case "Auth" :
|
|
53
|
-
return "Auth";
|
|
54
|
-
case "Hosting" :
|
|
55
|
-
return "Hosting";
|
|
56
|
-
case "Network" :
|
|
57
|
-
return "Network";
|
|
58
|
-
case "EventSourceMapping" :
|
|
59
|
-
return "EventSourceMapping";
|
|
60
|
-
case "DataTransfer" :
|
|
61
|
-
return "DataTransfer";
|
|
62
|
-
}
|
|
13
|
+
return role;
|
|
63
14
|
}
|
|
64
15
|
|
|
65
16
|
let Role = {
|
package/src/ViewChange.res.mjs
CHANGED
|
@@ -122,7 +122,7 @@ function summaryFields(c) {
|
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
function logLine(comp, c) {
|
|
125
|
-
Logger$ReventlessCore.emit("
|
|
125
|
+
Logger$ReventlessCore.emit("INFO", comp, undefined, Object.fromEntries(summaryFields(c)), Stdlib_Option.mapOr(c.correlationId, {}, id => Object.fromEntries([[
|
|
126
126
|
"correlationId",
|
|
127
127
|
id
|
|
128
128
|
]])), "view changed");
|
|
@@ -130,7 +130,7 @@ function logLine(comp, c) {
|
|
|
130
130
|
|
|
131
131
|
function reporter(comp, view, stateToJson) {
|
|
132
132
|
return change => {
|
|
133
|
-
let logs = Logger$ReventlessCore.shouldLog("
|
|
133
|
+
let logs = Logger$ReventlessCore.shouldLog("INFO", undefined, comp, undefined);
|
|
134
134
|
let listening = Primitive_object.notequal(listeners.contents, []);
|
|
135
135
|
if (!(logs || listening)) {
|
|
136
136
|
return;
|
|
@@ -64,15 +64,7 @@ let encodeCommandDef = (c: commandDef): JSON.t =>
|
|
|
64
64
|
Dict.fromArray([
|
|
65
65
|
("name", JSON.Encode.string(c.name)),
|
|
66
66
|
("schema", JSON.Encode.string(c.schema)),
|
|
67
|
-
(
|
|
68
|
-
"level",
|
|
69
|
-
JSON.Encode.string(
|
|
70
|
-
switch c.level {
|
|
71
|
-
| Collection => "Collection"
|
|
72
|
-
| Instance => "Instance"
|
|
73
|
-
},
|
|
74
|
-
),
|
|
75
|
-
),
|
|
67
|
+
("level", JSON.Encode.string((c.level :> string))),
|
|
76
68
|
("aggregateIdField", c.aggregateIdField->Option.mapOr(JSON.Encode.null, JSON.Encode.string)),
|
|
77
69
|
("mutationField", JSON.Encode.string(c.mutationField)),
|
|
78
70
|
("references", c.references->Array.map(encodeFieldReference)->JSON.Encode.array),
|
|
@@ -100,7 +92,11 @@ let encodeCommandDef = (c: commandDef): JSON.t =>
|
|
|
100
92
|
// (below) answers the second. Neither is a security boundary — an Internal view
|
|
101
93
|
// keeps its resolver and stays queryable, so naming it here publishes a fact the
|
|
102
94
|
// caller is already entitled to.
|
|
103
|
-
let isPublicReadSide = (q: readSideDef): bool =>
|
|
95
|
+
let isPublicReadSide = (q: readSideDef): bool =>
|
|
96
|
+
switch q.visibility {
|
|
97
|
+
| Some(Internal) => false
|
|
98
|
+
| _ => true
|
|
99
|
+
}
|
|
104
100
|
|
|
105
101
|
let encodeReadSideDef = (r: readSideDef): JSON.t =>
|
|
106
102
|
Dict.fromArray([
|
|
@@ -117,7 +113,10 @@ let encodeReadSideDef = (r: readSideDef): JSON.t =>
|
|
|
117
113
|
// unfiltered structure needs to know WHICH components are Internal, and a
|
|
118
114
|
// consumer of the filtered query reads null here because nothing Internal
|
|
119
115
|
// survives the filter anyway.
|
|
120
|
-
(
|
|
116
|
+
(
|
|
117
|
+
"visibility",
|
|
118
|
+
r.visibility->Option.mapOr(JSON.Encode.null, v => JSON.Encode.string((v :> string))),
|
|
119
|
+
),
|
|
121
120
|
("chapter", r.chapter->Option.mapOr(JSON.Encode.null, JSON.Encode.string)),
|
|
122
121
|
("singleQueryField", r.singleQueryField->Option.mapOr(JSON.Encode.null, JSON.Encode.string)),
|
|
123
122
|
("plural", r.plural->Option.mapOr(JSON.Encode.null, JSON.Encode.string)),
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
3
|
import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
4
|
-
import * as Primitive_object from "@rescript/runtime/lib/es6/Primitive_object.js";
|
|
5
4
|
import * as Plugin$ReventlessCore from "../plugin/component/Plugin.res.mjs";
|
|
6
5
|
|
|
7
6
|
let sdlTypes = [
|
|
@@ -42,9 +41,6 @@ function encodeFieldReference(r) {
|
|
|
42
41
|
}
|
|
43
42
|
|
|
44
43
|
function encodeCommandDef(c) {
|
|
45
|
-
let match = c.level;
|
|
46
|
-
let tmp;
|
|
47
|
-
tmp = match === "Collection" ? "Collection" : "Instance";
|
|
48
44
|
return Object.fromEntries([
|
|
49
45
|
[
|
|
50
46
|
"name",
|
|
@@ -56,7 +52,7 @@ function encodeCommandDef(c) {
|
|
|
56
52
|
],
|
|
57
53
|
[
|
|
58
54
|
"level",
|
|
59
|
-
|
|
55
|
+
c.level
|
|
60
56
|
],
|
|
61
57
|
[
|
|
62
58
|
"aggregateIdField",
|
|
@@ -98,7 +94,12 @@ function encodeCommandDef(c) {
|
|
|
98
94
|
}
|
|
99
95
|
|
|
100
96
|
function isPublicReadSide(q) {
|
|
101
|
-
|
|
97
|
+
let match = q.visibility;
|
|
98
|
+
if (match !== undefined && (match === "Public" || match === "Internal")) {
|
|
99
|
+
return match === "Public";
|
|
100
|
+
} else {
|
|
101
|
+
return true;
|
|
102
|
+
}
|
|
102
103
|
}
|
|
103
104
|
|
|
104
105
|
function encodeReadSideDef(r) {
|
|
@@ -141,7 +142,7 @@ function encodeReadSideDef(r) {
|
|
|
141
142
|
],
|
|
142
143
|
[
|
|
143
144
|
"visibility",
|
|
144
|
-
Stdlib_Option.mapOr(r.visibility, null,
|
|
145
|
+
Stdlib_Option.mapOr(r.visibility, null, v => v)
|
|
145
146
|
],
|
|
146
147
|
[
|
|
147
148
|
"chapter",
|
|
@@ -415,7 +416,7 @@ function encodePluginStructureEntry(pluginId, derived, def) {
|
|
|
415
416
|
],
|
|
416
417
|
[
|
|
417
418
|
"internalQueryables",
|
|
418
|
-
def.readModels.concat(def.stateViewSlices).filter(q => !
|
|
419
|
+
def.readModels.concat(def.stateViewSlices).filter(q => !isPublicReadSide(q)).map(encodeReadSideDef)
|
|
419
420
|
],
|
|
420
421
|
[
|
|
421
422
|
"stateChangeSlices",
|
|
@@ -74,7 +74,7 @@ let encodeTraitDeclaration = (d: traitDeclaration): JSON.t =>
|
|
|
74
74
|
let encodeAdmissionDef = (d: Reventless.Admission.def): JSON.t =>
|
|
75
75
|
Dict.fromArray([
|
|
76
76
|
("role", JSON.Encode.string(d.role)),
|
|
77
|
-
("strategy", JSON.Encode.string(d.strategy)),
|
|
77
|
+
("strategy", JSON.Encode.string((d.strategy :> string))),
|
|
78
78
|
(
|
|
79
79
|
"invitedBy",
|
|
80
80
|
d.invitedBy->Option.mapOr(JSON.Encode.null, Platform_ComponentDefinitionsApi.encodeStrings),
|
|
@@ -23,7 +23,7 @@ function doorField(structures, part) {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
function openRolesField(structures) {
|
|
26
|
-
return Stdlib_Option.map(marked(structures, "
|
|
26
|
+
return Stdlib_Option.map(marked(structures, "openRoles"), param => {
|
|
27
27
|
let d = param[1];
|
|
28
28
|
let plugin = param[0];
|
|
29
29
|
return Stdlib_Option.mapOr(Stdlib_Option.flatMap(Stdlib_Array.findMap(structures, param => {
|
|
@@ -50,8 +50,8 @@ function selfServiceGroups(structures) {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
function fromStructures(structures) {
|
|
53
|
-
let match = doorField(structures, "
|
|
54
|
-
let match$1 = doorField(structures, "
|
|
53
|
+
let match = doorField(structures, "start");
|
|
54
|
+
let match$1 = doorField(structures, "complete");
|
|
55
55
|
if (match !== undefined && match$1 !== undefined) {
|
|
56
56
|
return {
|
|
57
57
|
start: match,
|
|
@@ -1063,7 +1063,7 @@ module Make = (
|
|
|
1063
1063
|
// docs/plans/done/component-visibility-annotations.md
|
|
1064
1064
|
let isVisibleReadSide = (q: Reventless.Plugin.readSideDef) =>
|
|
1065
1065
|
switch q.visibility {
|
|
1066
|
-
| Some(
|
|
1066
|
+
| Some(Internal) => false
|
|
1067
1067
|
| _ => true
|
|
1068
1068
|
}
|
|
1069
1069
|
let visibleReadModels = pluginStructure.readModels->Array.filter(isVisibleReadSide)
|
|
@@ -49,8 +49,8 @@ function Make(Spec) {
|
|
|
49
49
|
let aggregatePositions = aggregatePositionsOpt !== undefined ? aggregatePositionsOpt : [];
|
|
50
50
|
let isVisibleReadSide = q => {
|
|
51
51
|
let match = q.visibility;
|
|
52
|
-
if (match !== undefined) {
|
|
53
|
-
return match
|
|
52
|
+
if (match !== undefined && (match === "Public" || match === "Internal")) {
|
|
53
|
+
return match === "Public";
|
|
54
54
|
} else {
|
|
55
55
|
return true;
|
|
56
56
|
}
|
|
@@ -51,11 +51,16 @@ type constructorSchema = {
|
|
|
51
51
|
fields: array<fieldSchema>,
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
+
/** What shape a named type has; a published schema carries the case's name. */
|
|
55
|
+
type schemaKind =
|
|
56
|
+
| RecordSchema
|
|
57
|
+
| VariantSchema
|
|
58
|
+
| UnknownSchema
|
|
59
|
+
|
|
54
60
|
/** Schema for one named type (a command, event, or state type). */
|
|
55
61
|
type typeSchema = {
|
|
56
62
|
typeName: string,
|
|
57
|
-
|
|
58
|
-
kind: string,
|
|
63
|
+
kind: schemaKind,
|
|
59
64
|
fields: array<fieldSchema>,
|
|
60
65
|
constructors?: array<constructorSchema>,
|
|
61
66
|
/** SHA256 of sorted "name:typeDescription:isRequired" tuples — stable shape fingerprint. */
|