@cynodia/axiom-server 0.16.0-alpha.1 → 0.16.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/README.md +6 -4
- package/dist/deps.d.ts +1 -1
- package/dist/deps.js +1 -1
- package/dist/provider-record-runtime.js +16 -7
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -65,9 +65,9 @@ route, controller, handler or SQL statement is written by an application author.
|
|
|
65
65
|
The Server IR contract is versioned. **`axiom.server.v1` is frozen** — its bytes and
|
|
66
66
|
semantics never change — but it is **not the current contract**: a document declares the
|
|
67
67
|
oldest contract that can carry its vocabulary, computed from the document. The current
|
|
68
|
-
contract is **`axiom.server.
|
|
69
|
-
and shipped for compatibility. This package ships what an implementation in another
|
|
70
|
-
needs to conform:
|
|
68
|
+
contract is **`axiom.server.v9`** (0.15 authorization-policy vocabulary); `v1`–`v8` are
|
|
69
|
+
frozen and shipped for compatibility. This package ships what an implementation in another
|
|
70
|
+
language needs to conform:
|
|
71
71
|
|
|
72
72
|
```
|
|
73
73
|
@cynodia/axiom-server/conformance the base fixture manifest
|
|
@@ -80,7 +80,9 @@ needs to conform:
|
|
|
80
80
|
@cynodia/axiom-server/schema/server-ir.v4.schema.json v4 (+ invocation source, structured effect outcome)
|
|
81
81
|
@cynodia/axiom-server/schema/server-ir.v5.schema.json v5 (+ subscriptions, storage, blob operations)
|
|
82
82
|
@cynodia/axiom-server/schema/server-ir.v6.schema.json v6 (+ queries, relationships, read policies)
|
|
83
|
-
@cynodia/axiom-server/schema/server-ir.v7.schema.json v7 (+ migrations, schema version + fingerprint)
|
|
83
|
+
@cynodia/axiom-server/schema/server-ir.v7.schema.json v7 (+ migrations, schema version + fingerprint)
|
|
84
|
+
@cynodia/axiom-server/schema/server-ir.v8.schema.json v8 (+ durable workflows)
|
|
85
|
+
@cynodia/axiom-server/schema/server-ir.v9.schema.json v9 (+ authorization policies) — current
|
|
84
86
|
@cynodia/axiom-server/schema/protocol.v1.schema.json JSON Schema for the protocol
|
|
85
87
|
```
|
|
86
88
|
|
package/dist/deps.d.ts
CHANGED
|
@@ -8,6 +8,6 @@
|
|
|
8
8
|
export type { ActionDef, AnyNode, ApplicationIR, Authority, AuthorityCompatibilityKey, CompatibilityComparison, ConstraintDef, EntityDef, EventDef, Expression, FieldDef, FieldId, IntegrationDef, IntegrationOperationDef, LiteralValue, MigrationDef, MigrationOperation, MigrationOperationKind, NodeId, Operation, SchemaChangeClass, SchemaDiff, SchemaDiffEntry, SchemaProjection, QueryAggregate, QueryAggregateFunction, QueryDef, LiveCapability, LiveChange, LiveQueryDelta, MaterializedResult, QueryDependencySet, CommitChangeset, QueryNullsOrder, QueryPagination, QueryParameter, QueryProjection, QueryRelationshipUse, QuerySortDirection, QuerySortKey, ReadPolicyDef, RelationshipDef, RelationshipCardinality, ServerIR, StateDef, StorageDef, SubscriptionDef, SubscriptionBackpressurePolicy, SubscriptionLifecycleState, TransitionConstraintDef, TriggerDef, TriggerSpec, TypeRef, WorkflowDef, WorkflowStep, WorkflowActionStep, WorkflowWaitEventStep, WorkflowRetryPolicy, WorkflowInput, WorkflowBinding, WorkflowDuration, WorkflowStructuralProblem, } from '@cynodia/axiom-core';
|
|
9
9
|
export type { ActionOutcome, ActionResult, EffectIntentRecord, RuntimeDiagnostic, RuntimeDiagnosticCode, } from '@cynodia/axiom-runtime';
|
|
10
10
|
export { PRINCIPAL, RUNTIME_DIAGNOSTIC_CODES, SERVER_IR_CONTRACT } from './runtime-deps.js';
|
|
11
|
-
export { MIGRATION_OLD_SCOPE, MIGRATION_OPERATION_KINDS, diffSchema, canonicalJSON, walkExpression, applyDelta, commitAffectsQuery, diffResults, queryDependencies, queryLiveCapability, queryStateReferences, rowKey, LIVE_QUERY_NONDETERMINISTIC_BUILTINS, fingerprintProjection, migrationCoversDiff, migrationExpressions, migrationOperationEntityId, migrationOperationExpressions, migrationOperationFieldIds, migrationOperationReadFieldIds, migrationPath, schemaFingerprint, schemaProjection, semanticFingerprint, semanticProjection, authorityCompatibilityKey, compatibilityKeyString, compareAuthorityCompatibility, EXECUTABLE_KINDS, SEMANTIC_FINGERPRINT_VERSION, sortMigrations, WORKFLOW_EVENT_SCOPE, WORKFLOW_PRINCIPAL_SCOPE, WORKFLOW_STEP_TYPES, workflowStepById, workflowStepSuccessors, workflowStepExpressions, workflowActionIds, workflowEventIds, workflowReachableSteps, workflowHasCycle, workflowExpressions, isWorkflowStep, workflowStructuralProblems, canonicalWorkflowForFingerprint, usesAuthorizationVocabulary, usesLegacyActionAuthorization, } from '@cynodia/axiom-core';
|
|
11
|
+
export { MIGRATION_OLD_SCOPE, MIGRATION_OPERATION_KINDS, actionOperations, operationChildren, diffSchema, canonicalJSON, walkExpression, applyDelta, commitAffectsQuery, diffResults, queryDependencies, queryLiveCapability, queryStateReferences, rowKey, LIVE_QUERY_NONDETERMINISTIC_BUILTINS, fingerprintProjection, migrationCoversDiff, migrationExpressions, migrationOperationEntityId, migrationOperationExpressions, migrationOperationFieldIds, migrationOperationReadFieldIds, migrationPath, schemaFingerprint, schemaProjection, semanticFingerprint, semanticProjection, authorityCompatibilityKey, compatibilityKeyString, compareAuthorityCompatibility, EXECUTABLE_KINDS, SEMANTIC_FINGERPRINT_VERSION, sortMigrations, WORKFLOW_EVENT_SCOPE, WORKFLOW_PRINCIPAL_SCOPE, WORKFLOW_STEP_TYPES, workflowStepById, workflowStepSuccessors, workflowStepExpressions, workflowActionIds, workflowEventIds, workflowReachableSteps, workflowHasCycle, workflowExpressions, isWorkflowStep, workflowStructuralProblems, canonicalWorkflowForFingerprint, usesAuthorizationVocabulary, usesLegacyActionAuthorization, } from '@cynodia/axiom-core';
|
|
12
12
|
export { BLOB_CHECKSUM_FIELD, BLOB_FILENAME_FIELD, BLOB_KEY_FIELD, BLOB_MEDIA_TYPE_FIELD, BLOB_SIZE_FIELD, DEFAULT_QUERY_MAX_PAGE_SIZE, DEFAULT_QUERY_PAGE_SIZE, DEFAULT_RELATIONSHIP_PAGE_SIZE, queryDefaultPageSize, queryExpressions, queryIsAggregate, queryIsGrouped, queryMaxPageSize, queryPaginationStrategy, queryRowEntityId, relationshipIsToOne, relationshipTargetEntityId, sortKeyDirection, sortKeyNulls, subscriptionAutoStart, subscriptionBackpressure, subscriptionDeduplicationWindow, subscriptionFailurePolicy, subscriptionIsRequired, subscriptionMaxAttempts, subscriptionQueueLimit, subscriptionReconnectPolicy, subscriptionSourceName, } from '@cynodia/axiom-core';
|
|
13
13
|
//# sourceMappingURL=deps.d.ts.map
|
package/dist/deps.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { PRINCIPAL, RUNTIME_DIAGNOSTIC_CODES, SERVER_IR_CONTRACT } from './runtime-deps.js';
|
|
2
|
-
export { MIGRATION_OLD_SCOPE, MIGRATION_OPERATION_KINDS, diffSchema, canonicalJSON, walkExpression, applyDelta, commitAffectsQuery, diffResults, queryDependencies, queryLiveCapability, queryStateReferences, rowKey, LIVE_QUERY_NONDETERMINISTIC_BUILTINS, fingerprintProjection, migrationCoversDiff, migrationExpressions, migrationOperationEntityId, migrationOperationExpressions, migrationOperationFieldIds, migrationOperationReadFieldIds, migrationPath, schemaFingerprint, schemaProjection, semanticFingerprint, semanticProjection, authorityCompatibilityKey, compatibilityKeyString, compareAuthorityCompatibility, EXECUTABLE_KINDS, SEMANTIC_FINGERPRINT_VERSION, sortMigrations, WORKFLOW_EVENT_SCOPE, WORKFLOW_PRINCIPAL_SCOPE, WORKFLOW_STEP_TYPES, workflowStepById, workflowStepSuccessors, workflowStepExpressions, workflowActionIds, workflowEventIds, workflowReachableSteps, workflowHasCycle, workflowExpressions, isWorkflowStep, workflowStructuralProblems, canonicalWorkflowForFingerprint, usesAuthorizationVocabulary, usesLegacyActionAuthorization, } from '@cynodia/axiom-core';
|
|
2
|
+
export { MIGRATION_OLD_SCOPE, MIGRATION_OPERATION_KINDS, actionOperations, operationChildren, diffSchema, canonicalJSON, walkExpression, applyDelta, commitAffectsQuery, diffResults, queryDependencies, queryLiveCapability, queryStateReferences, rowKey, LIVE_QUERY_NONDETERMINISTIC_BUILTINS, fingerprintProjection, migrationCoversDiff, migrationExpressions, migrationOperationEntityId, migrationOperationExpressions, migrationOperationFieldIds, migrationOperationReadFieldIds, migrationPath, schemaFingerprint, schemaProjection, semanticFingerprint, semanticProjection, authorityCompatibilityKey, compatibilityKeyString, compareAuthorityCompatibility, EXECUTABLE_KINDS, SEMANTIC_FINGERPRINT_VERSION, sortMigrations, WORKFLOW_EVENT_SCOPE, WORKFLOW_PRINCIPAL_SCOPE, WORKFLOW_STEP_TYPES, workflowStepById, workflowStepSuccessors, workflowStepExpressions, workflowActionIds, workflowEventIds, workflowReachableSteps, workflowHasCycle, workflowExpressions, isWorkflowStep, workflowStructuralProblems, canonicalWorkflowForFingerprint, usesAuthorizationVocabulary, usesLegacyActionAuthorization, } from '@cynodia/axiom-core';
|
|
3
3
|
export { BLOB_CHECKSUM_FIELD, BLOB_FILENAME_FIELD, BLOB_KEY_FIELD, BLOB_MEDIA_TYPE_FIELD, BLOB_SIZE_FIELD, DEFAULT_QUERY_MAX_PAGE_SIZE, DEFAULT_QUERY_PAGE_SIZE, DEFAULT_RELATIONSHIP_PAGE_SIZE, queryDefaultPageSize, queryExpressions, queryIsAggregate, queryIsGrouped, queryMaxPageSize, queryPaginationStrategy, queryRowEntityId, relationshipIsToOne, relationshipTargetEntityId, sortKeyDirection, sortKeyNulls, subscriptionAutoStart, subscriptionBackpressure, subscriptionDeduplicationWindow, subscriptionFailurePolicy, subscriptionIsRequired, subscriptionMaxAttempts, subscriptionQueueLimit, subscriptionReconnectPolicy, subscriptionSourceName, } from '@cynodia/axiom-core';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PRINCIPAL } from './deps.js';
|
|
1
|
+
import { PRINCIPAL, actionOperations, operationChildren } from './deps.js';
|
|
2
2
|
import { evaluateQueryExpression } from './query-eval.js';
|
|
3
3
|
/**
|
|
4
4
|
* Executing an action that mutates a **provider-backed record** (spec 0.10 §37-44) without
|
|
@@ -29,14 +29,17 @@ export function providerEntitiesWritten(action) {
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
else if (operation.kind === 'for-each') {
|
|
32
|
-
walk(operation
|
|
32
|
+
walk(operationChildren(operation));
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
|
-
walk(action
|
|
36
|
+
walk(actionOperations(action));
|
|
37
37
|
return [...found];
|
|
38
38
|
}
|
|
39
39
|
function providerRootEntity(location) {
|
|
40
|
+
if (!location || typeof location !== 'object') {
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
40
43
|
const node = location;
|
|
41
44
|
if (node.kind === 'provider-record') {
|
|
42
45
|
return node.sourceEntityId;
|
|
@@ -55,7 +58,7 @@ function providerRootEntity(location) {
|
|
|
55
58
|
* expression. Everything else — guards, `for-each`, other operations — is untouched.
|
|
56
59
|
*/
|
|
57
60
|
export function rewriteForStaging(action) {
|
|
58
|
-
return { ...action, operations: (action
|
|
61
|
+
return { ...action, operations: actionOperations(action).map(rewriteOperation) };
|
|
59
62
|
}
|
|
60
63
|
function rewriteOperation(operation) {
|
|
61
64
|
if (operation.kind === 'set') {
|
|
@@ -68,11 +71,14 @@ function rewriteOperation(operation) {
|
|
|
68
71
|
return { ...operation, target: rewriteLocation(operation.target) };
|
|
69
72
|
}
|
|
70
73
|
if (operation.kind === 'for-each') {
|
|
71
|
-
return { ...operation, operations: operation.
|
|
74
|
+
return { ...operation, operations: operationChildren(operation).map(rewriteOperation) };
|
|
72
75
|
}
|
|
73
76
|
return operation;
|
|
74
77
|
}
|
|
75
78
|
function rewriteLocation(location) {
|
|
79
|
+
if (!location || typeof location !== 'object') {
|
|
80
|
+
return location;
|
|
81
|
+
}
|
|
76
82
|
const node = location;
|
|
77
83
|
if (node.kind === 'provider-record') {
|
|
78
84
|
return {
|
|
@@ -101,7 +107,7 @@ export function identityValuesToLoad(action, args, principal) {
|
|
|
101
107
|
for (const operation of operations) {
|
|
102
108
|
if (operation.kind !== 'set' && operation.kind !== 'insert' && operation.kind !== 'remove') {
|
|
103
109
|
if (operation.kind === 'for-each') {
|
|
104
|
-
walk(operation
|
|
110
|
+
walk(operationChildren(operation));
|
|
105
111
|
}
|
|
106
112
|
continue;
|
|
107
113
|
}
|
|
@@ -117,10 +123,13 @@ export function identityValuesToLoad(action, args, principal) {
|
|
|
117
123
|
byEntity.set(record.sourceEntityId, existing);
|
|
118
124
|
}
|
|
119
125
|
};
|
|
120
|
-
walk(action
|
|
126
|
+
walk(actionOperations(action));
|
|
121
127
|
return byEntity;
|
|
122
128
|
}
|
|
123
129
|
function firstProviderRecord(location) {
|
|
130
|
+
if (!location || typeof location !== 'object') {
|
|
131
|
+
return undefined;
|
|
132
|
+
}
|
|
124
133
|
const node = location;
|
|
125
134
|
if (node.kind === 'provider-record') {
|
|
126
135
|
return node;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cynodia/axiom-server",
|
|
3
|
-
"version": "0.16.0-alpha.
|
|
3
|
+
"version": "0.16.0-alpha.2",
|
|
4
4
|
"description": "Authoritative server runtime that executes an Axiom Server IR.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "AskTech AS",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"./schema/*": "./schema/*"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@cynodia/axiom-core": "0.16.0-alpha.
|
|
41
|
-
"@cynodia/axiom-runtime": "0.16.0-alpha.
|
|
40
|
+
"@cynodia/axiom-core": "0.16.0-alpha.2",
|
|
41
|
+
"@cynodia/axiom-runtime": "0.16.0-alpha.2"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"build": "tsc -b tsconfig.json tsconfig.test.json",
|