@reventlessdev/reventless-spec 3.0.0-alpha.169 → 3.0.0-alpha.171
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 +32 -0
- package/README.md +17 -3
- package/package.json +5 -4
- package/run-rename-to-decision.mjs +3 -0
- package/src/AnsiStyle.res +3 -3
- package/src/CliArgs.res +1 -1
- package/src/LogPrefix.res +1 -1
- package/src/codemod/RenameToDecision.res +207 -0
- package/src/codemod/RenameToDecision.res.mjs +334 -0
- package/src/components/Aggregate.res +1 -1
- package/src/components/CapabilityManifest.res +1 -1
- package/src/components/ComponentKind.res +2 -2
- package/src/components/ComponentKind.res.mjs +1 -1
- package/src/components/DcbScopeInference.res +2 -2
- package/src/components/DcbTag.res +5 -5
- package/src/components/OutboundTranslationSlice.res +2 -2
- package/src/components/Plugin.res +14 -14
- package/src/components/Plugin.res.mjs +8 -8
- package/src/components/Sensitive.res +1 -1
- package/src/components/Snapshot.res +5 -5
- package/src/components/StateAnnotations.res +1 -1
- package/src/components/StateChangeSlice.res +6 -5
- package/src/components/StateViewSlice.res +3 -3
- package/src/components/TaggedUnion.res +1 -1
- package/src/generator/Codegen.res +5 -5
- package/src/generator/Codegen.res.mjs +1 -1
- package/src/generator/Discovery.res +3 -3
- package/src/generator/Pairing.res +47 -18
- package/src/generator/Pairing.res.mjs +41 -10
- package/src/lifecycle/CheckLifecycleModel.res +8 -7
- package/src/lifecycle/CheckLifecycleModel.res.mjs +2 -2
- package/src/semantic/Capabilities.res +2 -2
- package/src/semantic/CapabilityNeed.res +3 -3
- package/src/semantic/Color.res +8 -8
- package/src/semantic/IdentityProvider.res +1 -1
- package/src/semantic/Messaging.res +2 -2
- package/src/types/{Behavior.res → Decision.res} +10 -6
- package/src/types/Message.res +1 -1
- package/src/types/OwnerScope.res +5 -5
- package/src/types/RoleCoverage.res +6 -6
- package/src/types/RoleCoverage.res.mjs +6 -6
- package/src/types/Trait.res +1 -1
- /package/src/types/{Behavior.res.mjs → Decision.res.mjs} +0 -0
package/src/types/OwnerScope.res
CHANGED
|
@@ -21,8 +21,8 @@ absent. Every read here goes through a nullable cast for that reason; deleting
|
|
|
21
21
|
one restores a silent failure rather than a type error.
|
|
22
22
|
*/
|
|
23
23
|
/** Whether a JS value is a primitive string — `Cognito` and `InMemory` compile to
|
|
24
|
-
bare strings while `Custom(_)` compiles to an object, so this is how a
|
|
25
|
-
provider is told from an
|
|
24
|
+
bare strings while `Custom(_)` compiles to an object, so this is how a modeled
|
|
25
|
+
provider is told from an unmodeled one that arrived as raw JSON. */
|
|
26
26
|
let isJsString: 'a => bool = %raw(`v => typeof v === "string"`)
|
|
27
27
|
|
|
28
28
|
external asNullableString: string => Nullable.t<string> = "%identity"
|
|
@@ -213,8 +213,8 @@ let classify = (identity: Identity.t, ~elevated: array<string>): t => {
|
|
|
213
213
|
|
|
214
214
|
switch providerName {
|
|
215
215
|
| Some(name) if systemProviders->Array.includes(name) => System
|
|
216
|
-
// A
|
|
217
|
-
// None) — either way a caller claiming to be a person.
|
|
216
|
+
// A modeled string provider, or `Custom(_)` (an object, so `providerName` is
|
|
217
|
+
// None) — either way a caller claiming to be a person. Unmodeled strings fall
|
|
218
218
|
// through to the refusal below.
|
|
219
219
|
| Some("Cognito") | Some("InMemory") | None =>
|
|
220
220
|
switch identity.userId->asNullableString->Nullable.toOption {
|
|
@@ -415,7 +415,7 @@ type retiredDecision =
|
|
|
415
415
|
/**
|
|
416
416
|
Combine a view's declared retirement flag with the caller behind the request.
|
|
417
417
|
|
|
418
|
-
`~asked` is the caller's `includeRetired` request,
|
|
418
|
+
`~asked` is the caller's `includeRetired` request, honored only where the
|
|
419
419
|
caller was going to see those rows anyway. Reading it before classifying would
|
|
420
420
|
make the argument the decision rather than a request.
|
|
421
421
|
|
|
@@ -21,18 +21,18 @@ let needsOf = (structure: Plugin.pluginStructure, ~plugin: string): array<need>
|
|
|
21
21
|
let need = (item, role) => {plugin, item, role, group: Role.groupOf(role)}
|
|
22
22
|
let rolesOf = (item, roles: option<array<string>>) =>
|
|
23
23
|
roles->Option.getOr([])->Array.map(role => need(item, Role.make(role)))
|
|
24
|
-
let
|
|
24
|
+
let writeSide = (defs: array<Plugin.writeSideDef>) =>
|
|
25
25
|
defs->Array.flatMap(w =>
|
|
26
26
|
w.commands->Array.flatMap(c => rolesOf(`${w.name}.${c.name}`, c.requiredRoles))
|
|
27
27
|
)
|
|
28
|
-
let
|
|
28
|
+
let readSide = (defs: array<Plugin.readSideDef>) =>
|
|
29
29
|
defs->Array.flatMap(q => rolesOf(q.name, q.requiredRoles))
|
|
30
30
|
Array.flat([
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
writeSide(structure.aggregates),
|
|
32
|
+
writeSide(structure.stateChangeSlices),
|
|
33
33
|
structure.inboundTranslationSlices->Array.flatMap(s => rolesOf(s.name, s.requiredRoles)),
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
readSide(structure.readModels),
|
|
35
|
+
readSide(structure.stateViewSlices),
|
|
36
36
|
])
|
|
37
37
|
}
|
|
38
38
|
|
|
@@ -13,14 +13,14 @@ function needsOf(structure, plugin) {
|
|
|
13
13
|
role: role,
|
|
14
14
|
group: Role$Reventless.groupOf(role)
|
|
15
15
|
}));
|
|
16
|
-
let
|
|
17
|
-
let
|
|
16
|
+
let writeSide = defs => defs.flatMap(w => w.commands.flatMap(c => rolesOf(w.name + `.` + c.name, c.requiredRoles)));
|
|
17
|
+
let readSide = defs => defs.flatMap(q => rolesOf(q.name, q.requiredRoles));
|
|
18
18
|
return [
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
writeSide(structure.aggregates),
|
|
20
|
+
writeSide(structure.stateChangeSlices),
|
|
21
21
|
structure.inboundTranslationSlices.flatMap(s => rolesOf(s.name, s.requiredRoles)),
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
readSide(structure.readModels),
|
|
23
|
+
readSide(structure.stateViewSlices)
|
|
24
24
|
].flat();
|
|
25
25
|
}
|
|
26
26
|
|
package/src/types/Trait.res
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
// annotation — an attribute's fields would all be strings the compiler never
|
|
20
20
|
// checks, which is the failure this program exists to remove.
|
|
21
21
|
//
|
|
22
|
-
// **A declaration is a claim about origin, never about
|
|
22
|
+
// **A declaration is a claim about origin, never about behavior.** After a graft
|
|
23
23
|
// the developer owns the files and may edit them freely. So this says "grafted
|
|
24
24
|
// from trait X", and it does NOT say "still behaves like trait X" — the thing that
|
|
25
25
|
// answers the second question is the trait's conformance suite, which runs in the
|
|
File without changes
|