@cynodia/axiom-compiler 0.8.2-alpha.1 → 0.9.0-alpha.2
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/dist/normalize.js +7 -2
- package/dist/server.js +15 -1
- package/package.json +3 -3
package/dist/normalize.js
CHANGED
|
@@ -160,8 +160,13 @@ export function compileToIR(graph, options = {}) {
|
|
|
160
160
|
case 'integration':
|
|
161
161
|
case 'integration-operation':
|
|
162
162
|
case 'event':
|
|
163
|
-
|
|
164
|
-
|
|
163
|
+
case 'subscription':
|
|
164
|
+
case 'storage':
|
|
165
|
+
// Server-only vocabulary: no client concern ever needs to know an integration, its
|
|
166
|
+
// operations, the events it can raise (spec §80), the live sources it subscribes to
|
|
167
|
+
// or the object stores it reaches. A subscription in particular has no client half
|
|
168
|
+
// at all — the browser maintains no long-lived external source — so it is absent
|
|
169
|
+
// here rather than present and inert (spec 0.9 §62-64).
|
|
165
170
|
delete nodes[node.id];
|
|
166
171
|
break;
|
|
167
172
|
case 'trigger': {
|
package/dist/server.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { actionAuthority, actionGuards, authorityContext, expressionDefsIn, isObservable, maxContract, requiredServerContract, serverIRExpressions, serverStateClosure, stateAuthority, usesIntegrationVocabulary, usesInvocationVocabulary, usesV4Semantics, validateGraph, } from '@cynodia/axiom-core';
|
|
1
|
+
import { actionAuthority, actionGuards, authorityContext, expressionDefsIn, isObservable, maxContract, requiredServerContract, serverIRExpressions, serverStateClosure, stateAuthority, usesExternalIOVocabulary, usesIntegrationVocabulary, usesInvocationVocabulary, usesV4Semantics, validateGraph, } from '@cynodia/axiom-core';
|
|
2
2
|
import { GraphValidationError } from './normalize.js';
|
|
3
3
|
/**
|
|
4
4
|
* Compiles the authoritative half of a graph.
|
|
@@ -28,6 +28,8 @@ export function compileToServerIR(graph, options = {}) {
|
|
|
28
28
|
const integrations = [];
|
|
29
29
|
const integrationOperations = {};
|
|
30
30
|
const events = [];
|
|
31
|
+
const subscriptions = [];
|
|
32
|
+
const storages = [];
|
|
31
33
|
for (const node of nodes) {
|
|
32
34
|
if (node.kind === 'entity') {
|
|
33
35
|
entities.push(node);
|
|
@@ -50,6 +52,15 @@ export function compileToServerIR(graph, options = {}) {
|
|
|
50
52
|
else if (node.kind === 'event') {
|
|
51
53
|
events.push(node);
|
|
52
54
|
}
|
|
55
|
+
else if (node.kind === 'subscription') {
|
|
56
|
+
// Every subscription is authority-side by construction: there is no client half to
|
|
57
|
+
// decide about (spec 0.9 §62-64), and validation has already refused a graph that
|
|
58
|
+
// declares one without an authority to activate it.
|
|
59
|
+
subscriptions.push(node);
|
|
60
|
+
}
|
|
61
|
+
else if (node.kind === 'storage') {
|
|
62
|
+
storages.push(node);
|
|
63
|
+
}
|
|
53
64
|
}
|
|
54
65
|
const states = [];
|
|
55
66
|
const observableStateIds = [];
|
|
@@ -109,6 +120,8 @@ export function compileToServerIR(graph, options = {}) {
|
|
|
109
120
|
...(Object.keys(integrationOperations).length > 0 ? { integrationOperations } : {}),
|
|
110
121
|
...(events.length > 0 ? { events } : {}),
|
|
111
122
|
...(triggers.length > 0 ? { triggers } : {}),
|
|
123
|
+
...(subscriptions.length > 0 ? { subscriptions } : {}),
|
|
124
|
+
...(storages.length > 0 ? { storages } : {}),
|
|
112
125
|
};
|
|
113
126
|
// Only the definitions the authority's own rules reach. A calculation used by the client
|
|
114
127
|
// alone decides nothing here, and the Server IR carries nothing that decides nothing.
|
|
@@ -137,6 +150,7 @@ export function compileToServerIR(graph, options = {}) {
|
|
|
137
150
|
: requiredServerContract(serverIRExpressions(document)),
|
|
138
151
|
usesIntegrationVocabulary(document) ? 'axiom.server.v3' : 'axiom.server.v1',
|
|
139
152
|
usesV4Semantics(document) ? 'axiom.server.v4' : 'axiom.server.v1',
|
|
153
|
+
usesExternalIOVocabulary(document) ? 'axiom.server.v5' : 'axiom.server.v1',
|
|
140
154
|
];
|
|
141
155
|
const contract = contractCandidates.reduce(maxContract);
|
|
142
156
|
return { contract, ...document };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cynodia/axiom-compiler",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0-alpha.2",
|
|
4
4
|
"description": "Normalizes an Axiom application graph and emits a self-contained page.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "AskTech AS",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@cynodia/axiom-core": "0.
|
|
35
|
-
"@cynodia/axiom-runtime": "0.
|
|
34
|
+
"@cynodia/axiom-core": "0.9.0-alpha.2",
|
|
35
|
+
"@cynodia/axiom-runtime": "0.9.0-alpha.2"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"build": "tsc -b tsconfig.json tsconfig.test.json",
|