@astrale-os/kernel-dsl 1.0.0-beta.11 → 1.0.0-beta.12
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/v1/builder/callable/authoring.d.ts +1 -1
- package/dist/v1/builder/class/authoring.d.ts +6 -256
- package/dist/v1/builder/class/handle.d.ts +27 -0
- package/dist/v1/builder/class/handle.js +1 -0
- package/dist/v1/builder/class/input.d.ts +129 -0
- package/dist/v1/builder/class/input.js +1 -0
- package/dist/v1/builder/class/projection.d.ts +129 -0
- package/dist/v1/builder/class/projection.js +1 -0
- package/dist/v1/builder/core/authoring.d.ts +1 -1
- package/dist/v1/builder/index.d.ts +3 -1
- package/dist/v1/builder/lowering/class.d.ts +1 -1
- package/dist/v1/builder/lowering/schema/context.d.ts +2 -1
- package/dist/v1/builder/lowering/value/path.d.ts +1 -1
- package/dist/v1/builder/policy/authoring.d.ts +1 -1
- package/dist/v1/builder/schema/input.d.ts +1 -1
- package/dist/v1/builder/schema/projection/class.d.ts +2 -1
- package/dist/v1/builder/schema/projection/core-input.d.ts +2 -1
- package/dist/v1/builder/schema/projection/identity.d.ts +2 -1
- package/dist/v1/builder/schema/projection/property.d.ts +1 -1
- package/dist/v1/builder/value/path-metadata.d.ts +1 -1
- package/dist/v1/builder/value/path.d.ts +1 -1
- package/dist/v1/language/index.d.ts +1 -0
- package/dist/v1/language/index.js +1 -0
- package/dist/v1/language/validation/diagnostic.d.ts +1 -1
- package/dist/v1/language/value/inclusion/arrays.d.ts +3 -0
- package/dist/v1/language/value/inclusion/arrays.js +85 -0
- package/dist/v1/language/value/inclusion/assertions.d.ts +18 -0
- package/dist/v1/language/value/inclusion/assertions.js +29 -0
- package/dist/v1/language/value/inclusion/combinators.d.ts +3 -0
- package/dist/v1/language/value/inclusion/combinators.js +67 -0
- package/dist/v1/language/value/inclusion/equivalence.d.ts +4 -0
- package/dist/v1/language/value/inclusion/equivalence.js +74 -0
- package/dist/v1/language/value/inclusion/evidence.d.ts +34 -0
- package/dist/v1/language/value/inclusion/evidence.js +138 -0
- package/dist/v1/language/value/inclusion/includes.d.ts +17 -0
- package/dist/v1/language/value/inclusion/includes.js +25 -719
- package/dist/v1/language/value/inclusion/keywords.d.ts +5 -0
- package/dist/v1/language/value/inclusion/keywords.js +31 -0
- package/dist/v1/language/value/inclusion/kinds.d.ts +17 -0
- package/dist/v1/language/value/inclusion/kinds.js +57 -0
- package/dist/v1/language/value/inclusion/location.d.ts +24 -0
- package/dist/v1/language/value/inclusion/location.js +63 -0
- package/dist/v1/language/value/inclusion/numbers.d.ts +3 -0
- package/dist/v1/language/value/inclusion/numbers.js +41 -0
- package/dist/v1/language/value/inclusion/objects.d.ts +3 -0
- package/dist/v1/language/value/inclusion/objects.js +190 -0
- package/dist/v1/language/value/inclusion/strings.d.ts +3 -0
- package/dist/v1/language/value/inclusion/strings.js +29 -0
- package/dist/v1/language/value/inclusion/types.d.ts +3 -0
- package/dist/v1/language/value/inclusion/types.js +11 -0
- package/dist/v1/language/value/index.d.ts +1 -1
- package/dist/v1/language/value/index.js +1 -1
- package/dist/v1/language/value/ordering.d.ts +9 -0
- package/dist/v1/language/value/ordering.js +72 -9
- package/dist/v1/schema/validation/value-api.d.ts +9 -0
- package/dist/v1/schema/validation/value-api.js +23 -1
- package/dist/value/canonical.d.ts +3 -2
- package/dist/value/canonical.js +30 -6
- package/dist/value/decode.d.ts +7 -0
- package/dist/value/decode.js +159 -9
- package/dist/value/index.d.ts +1 -1
- package/dist/value/json.d.ts +1 -1
- package/dist/value/json.js +1 -1
- package/dist/value/types.d.ts +6 -0
- package/dist/value/unicode.d.ts +2 -1
- package/dist/value/unicode.js +2 -0
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import type { z } from 'zod';
|
|
|
3
3
|
import type { PolicyRef } from '../../addressing/index.js';
|
|
4
4
|
import type { BinaryInputProjection, CallableAdmission, CallableExecution, FunctionAuth } from '../../language/callable/model/callable.js';
|
|
5
5
|
import type { PolicyCheckExpression, PolicyCheckObject, PolicyObjectRef } from '../../language/policy/model/policy.js';
|
|
6
|
-
import type { Class } from '../class/
|
|
6
|
+
import type { Class } from '../class/handle.js';
|
|
7
7
|
import type { ValueSchemaInput } from '../class/property.js';
|
|
8
8
|
import type { CoreNode } from '../core/authoring.js';
|
|
9
9
|
import type { Policy, PolicyInput } from '../policy/authoring.js';
|
|
@@ -1,147 +1,16 @@
|
|
|
1
1
|
import type { Value as PortableValue } from '@astrale-os/kernel-dsl/value';
|
|
2
2
|
import type { z } from 'zod';
|
|
3
|
-
import type { ClassRef } from '../../addressing/index.js';
|
|
4
|
-
import type { MethodRecord } from '../../language/callable/model/callable.js';
|
|
5
|
-
import type { ResolvedMethod } from '../../language/callable/resolved.js';
|
|
6
|
-
import type { Inheritance } from '../../language/class/model/class.js';
|
|
7
|
-
import type { MediaType } from '../../language/class/model/data.js';
|
|
8
|
-
import type { EdgeCount, EdgeLifetime } from '../../language/class/model/edge.js';
|
|
9
3
|
import type { ResolvedClass, ResolvedProperty } from '../../language/class/resolved.js';
|
|
10
|
-
import type {
|
|
11
|
-
import type { StateTopology, StateTopologyOf } from '../../language/state/topology.js';
|
|
4
|
+
import type { StateTopologyOf } from '../../language/state/topology.js';
|
|
12
5
|
import type { BlobReceipt, BlobRef, BlobSchema } from '../../language/value/model/blob.js';
|
|
13
|
-
import type { Method,
|
|
14
|
-
import type { Policy } from '../policy/authoring.js';
|
|
15
|
-
import type { Lazy } from '../schema/lazy.js';
|
|
6
|
+
import type { Method, ProjectionOfCallable } from '../callable/authoring.js';
|
|
16
7
|
import type { ClassProjectionOfResolved } from '../schema/projection.js';
|
|
17
8
|
import type { TypedValueSchema } from '../value/schema.js';
|
|
9
|
+
import type { Class, DirectedEdgeClass, EdgeClass, NodeClass, UndirectedEdgeClass } from './handle.js';
|
|
10
|
+
import type { DirectedEdgeInput, DirectedSourceInput, DirectedTargetInput, IncidentEndpointInput, NodeClassInput, UndirectedEdgeInput } from './input.js';
|
|
11
|
+
import type { AuthoredMethodProjection, AuthoredPropertyProjection, BindMethodOwners, BindPropertyOwners, ClassOwnerProjectionOf, ClassReferenceProjectionOf } from './projection.js';
|
|
18
12
|
import type { AutoProperty, Property, PropertyOptions, PropertyStateMachineOf, ValueSchemaInput } from './property.js';
|
|
19
|
-
import type { PropertyRecordInput } from './property.js';
|
|
20
|
-
import { type AUTHORING } from '../schema/handle.js';
|
|
21
|
-
declare const CLASS_TYPE: unique symbol;
|
|
22
|
-
export type ClassReferenceInput = Lazy<Class | ClassRef | ResolvedClass<'node'> | ResolvedClass<'edge'>>;
|
|
23
|
-
export type NodeClassReferenceInput = Lazy<NodeClass | ClassRef | ResolvedClass<'node'>>;
|
|
24
|
-
export type EdgeClassReferenceInput = Lazy<EdgeClass | ClassRef | ResolvedClass<'edge'>>;
|
|
25
|
-
export interface DirectedSourceInput {
|
|
26
|
-
readonly as: string;
|
|
27
|
-
readonly accepts: readonly NodeClassReferenceInput[];
|
|
28
|
-
readonly outgoing: EdgeCount;
|
|
29
|
-
/** What deleting a Node at this endpoint does to the Edge; derived when omitted. */
|
|
30
|
-
readonly onDelete?: EdgeLifetime;
|
|
31
|
-
}
|
|
32
|
-
export interface DirectedTargetInput {
|
|
33
|
-
readonly as: string;
|
|
34
|
-
readonly accepts: readonly NodeClassReferenceInput[];
|
|
35
|
-
readonly incoming: EdgeCount;
|
|
36
|
-
/** What deleting a Node at this endpoint does to the Edge; derived when omitted. */
|
|
37
|
-
readonly onDelete?: EdgeLifetime;
|
|
38
|
-
}
|
|
39
|
-
export interface IncidentEndpointInput {
|
|
40
|
-
readonly as: string;
|
|
41
|
-
readonly accepts: readonly NodeClassReferenceInput[];
|
|
42
|
-
readonly incident: EdgeCount;
|
|
43
|
-
/** What deleting a Node at this endpoint does to the Edge; derived when omitted. */
|
|
44
|
-
readonly onDelete?: EdgeLifetime;
|
|
45
|
-
}
|
|
46
13
|
type ExactEndpointInput<Input, Shape> = Input & Record<Exclude<keyof Input, keyof Shape>, never>;
|
|
47
|
-
/** One observation slot: a local Policy, or its constant value. Absent means `true`. */
|
|
48
|
-
export type ClassPolicyInput = Lazy<Policy> | boolean;
|
|
49
|
-
export interface ClassPoliciesInput {
|
|
50
|
-
readonly read?: ClassPolicyInput;
|
|
51
|
-
readonly traverse?: ClassPolicyInput;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Policy checks deciding one Node Class observation. `self` is the observed Node; `ref` names one
|
|
55
|
-
* exact member, the same Node for every observed candidate.
|
|
56
|
-
*/
|
|
57
|
-
export interface ClassRuleContext extends PolicyCheckContext<ClassRuleObject> {
|
|
58
|
-
}
|
|
59
|
-
export type ClassRuleBuilder = (context: ClassRuleContext) => ClassRuleChecks;
|
|
60
|
-
/** One Node Class observation slot: a local Policy, a constant value, or Policy checks. */
|
|
61
|
-
export type NodeClassPolicyInput = ClassPolicyInput | ClassRuleBuilder;
|
|
62
|
-
export interface NodeClassPoliciesInput {
|
|
63
|
-
readonly read?: NodeClassPolicyInput;
|
|
64
|
-
readonly traverse?: NodeClassPolicyInput;
|
|
65
|
-
}
|
|
66
|
-
export interface NodeClassInput {
|
|
67
|
-
readonly abstract?: boolean;
|
|
68
|
-
/** Which Classes may extend this one; omitted, those of its own Domain only (`'internal'`). */
|
|
69
|
-
readonly inheritance?: Inheritance;
|
|
70
|
-
readonly description?: string;
|
|
71
|
-
readonly extends?: readonly NodeClassReferenceInput[];
|
|
72
|
-
readonly properties?: PropertyRecordInput;
|
|
73
|
-
readonly data?: MediaType;
|
|
74
|
-
readonly methods?: Readonly<Record<string, Method>>;
|
|
75
|
-
readonly icon?: string;
|
|
76
|
-
/** Local observation Policies; inherited by no descendant and forbidden on abstract Classes. */
|
|
77
|
-
readonly policies?: NodeClassPoliciesInput;
|
|
78
|
-
/**
|
|
79
|
-
* The tuples no two Nodes of this Class and of its active concrete descendants share while every
|
|
80
|
-
* Property is present; omitted, none. A descendant is covered without declaring them again.
|
|
81
|
-
*/
|
|
82
|
-
readonly unique?: readonly NodeUniqueTupleInput[];
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* The distinct Properties of one Node key, in any order, each a Property of the Class, own or
|
|
86
|
-
* inherited, by its name or, when names collide, by its full key.
|
|
87
|
-
*/
|
|
88
|
-
export type NodeUniqueTupleInput = readonly [string, ...string[]];
|
|
89
|
-
export interface EdgeClassOptions {
|
|
90
|
-
readonly abstract?: boolean;
|
|
91
|
-
/** Which Classes may extend this one; omitted, those of its own Domain only (`'internal'`). */
|
|
92
|
-
readonly inheritance?: Inheritance;
|
|
93
|
-
readonly description?: string;
|
|
94
|
-
readonly extends?: readonly EdgeClassReferenceInput[];
|
|
95
|
-
readonly properties?: PropertyRecordInput;
|
|
96
|
-
/** Local observation Policies; inherited by no descendant and forbidden on abstract Classes. */
|
|
97
|
-
readonly policies?: ClassPoliciesInput;
|
|
98
|
-
readonly constraints?: {
|
|
99
|
-
readonly noSelf?: true;
|
|
100
|
-
readonly acyclic?: true;
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* A key field as authored: an endpoint, the slug, or a Property of the Class, own or inherited, by
|
|
105
|
-
* its name or, when names collide, by its full key.
|
|
106
|
-
*/
|
|
107
|
-
export type EdgeUniqueFieldInput = 'source' | 'target' | 'slug' | {
|
|
108
|
-
readonly property: string;
|
|
109
|
-
};
|
|
110
|
-
/** The distinct fields of one key, in any order. */
|
|
111
|
-
export type EdgeUniqueTupleInput = readonly [EdgeUniqueFieldInput, ...EdgeUniqueFieldInput[]];
|
|
112
|
-
export interface DirectedEdgeInput extends EdgeClassOptions {
|
|
113
|
-
readonly orientation: 'directed';
|
|
114
|
-
readonly source: DirectedSourceInput;
|
|
115
|
-
readonly target: DirectedTargetInput;
|
|
116
|
-
/**
|
|
117
|
-
* The tuples no two Edges of this Class and of its active concrete descendants share while every
|
|
118
|
-
* field is present; omitted, none. A descendant is covered without declaring them again.
|
|
119
|
-
*/
|
|
120
|
-
readonly unique?: readonly EdgeUniqueTupleInput[];
|
|
121
|
-
}
|
|
122
|
-
export interface UndirectedEdgeInput extends Omit<EdgeClassOptions, 'constraints'> {
|
|
123
|
-
readonly orientation: 'undirected';
|
|
124
|
-
readonly endpoints: readonly [IncidentEndpointInput, IncidentEndpointInput];
|
|
125
|
-
readonly constraints?: {
|
|
126
|
-
readonly noSelf?: true;
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
export type EdgeClassCommon = EdgeClassOptions;
|
|
130
|
-
export type EdgeClassInput = DirectedEdgeInput | UndirectedEdgeInput;
|
|
131
|
-
export type Class = NodeClass | EdgeClass;
|
|
132
|
-
export interface AuthoredPropertyProjection<out Input = unknown, out Output = unknown, out Required extends boolean = boolean, out Name extends string = string, out Owner = 'self', out State extends StateTopology | undefined = StateTopology | undefined> {
|
|
133
|
-
readonly input: Input;
|
|
134
|
-
readonly output: Output;
|
|
135
|
-
readonly required: Required;
|
|
136
|
-
readonly name: Name;
|
|
137
|
-
readonly owner: Owner;
|
|
138
|
-
readonly state?: State;
|
|
139
|
-
}
|
|
140
|
-
export interface AuthoredMethodProjection<out Value extends Method = Method, out Name extends string = string, out Owner = 'self'> {
|
|
141
|
-
readonly value: Value;
|
|
142
|
-
readonly name: Name;
|
|
143
|
-
readonly owner: Owner;
|
|
144
|
-
}
|
|
145
14
|
type PropertySchemaOf<Field> = Field extends AutoProperty<infer Value> ? PropertySchemaOf<Value> : Field extends Property<infer Schema, PropertyOptions, unknown> ? Schema : Field;
|
|
146
15
|
type PropertyOptionsOf<Field> = Field extends AutoProperty<infer Value> ? PropertyOptionsOf<Value> : Field extends Property<ValueSchemaInput, infer Options, unknown> ? Options : Record<never, never>;
|
|
147
16
|
type ValueInputOf<Schema> = Schema extends BlobSchema ? BlobReceipt : Schema extends TypedValueSchema<infer Value> ? Value : Schema extends z.ZodType ? z.input<Schema> : PortableValue;
|
|
@@ -166,7 +35,6 @@ type ParentPropertyProjectionsOf<Input> = Input extends {
|
|
|
166
35
|
type EffectivePropertyProjectionsOf<Input> = PropertyProjectionEntriesOf<'properties' extends keyof Input ? Input extends {
|
|
167
36
|
readonly properties?: infer Value;
|
|
168
37
|
} ? NonNullable<Value> : never : never> | ParentPropertyProjectionsOf<Input>;
|
|
169
|
-
type BindPropertyOwners<Entries, Owner> = Entries extends AuthoredPropertyProjection<infer Input, infer Output, infer Required, infer Name, infer ExistingOwner, infer State> ? AuthoredPropertyProjection<Input, Output, Required, Name, ExistingOwner extends 'self' ? Owner : ExistingOwner, State> : Entries;
|
|
170
38
|
type MethodFieldsOf<Input> = 'methods' extends keyof Input ? Input extends {
|
|
171
39
|
readonly methods?: infer Methods extends Readonly<Record<string, Method>>;
|
|
172
40
|
} ? NonNullable<Methods> : Readonly<Record<never, never>> : Readonly<Record<never, never>>;
|
|
@@ -176,7 +44,6 @@ type MethodIsStatic<Value extends Method> = ProjectionOfCallable<Value> extends
|
|
|
176
44
|
type OwnMethodProjectionsOf<Input, Static extends boolean> = {
|
|
177
45
|
[Name in keyof MethodFieldsOf<Input>]: MethodFieldsOf<Input>[Name] extends infer Value extends Method ? MethodIsStatic<Value> extends Static ? AuthoredMethodProjection<Value, Extract<Name, string>> : never : never;
|
|
178
46
|
}[keyof MethodFieldsOf<Input>];
|
|
179
|
-
type BindMethodOwners<Entries, Owner> = Entries extends AuthoredMethodProjection<infer Value, infer Name, infer ExistingOwner> ? AuthoredMethodProjection<Value, Name, ExistingOwner extends 'self' ? Owner : ExistingOwner> : Entries;
|
|
180
47
|
type AbstractMethodEntries<Entry> = Entry extends AuthoredMethodProjection<infer Value> ? ProjectionOfCallable<Value> extends {
|
|
181
48
|
readonly abstract: true;
|
|
182
49
|
} ? Entry : never : Entry extends {
|
|
@@ -213,104 +80,6 @@ type Increment<Depth extends number> = number extends Depth ? number : [...Tuple
|
|
|
213
80
|
type ClassDepthOfInput<Input> = Input extends {
|
|
214
81
|
readonly extends?: infer Parents extends readonly unknown[];
|
|
215
82
|
} ? Parents extends readonly [] ? 0 : Increment<ClassDepthOf<Parents[number]>> : 0;
|
|
216
|
-
export interface ClassIdentityProjection<out Kind extends 'node' | 'edge' = 'node' | 'edge', out Identity = unknown> {
|
|
217
|
-
readonly kind: Kind;
|
|
218
|
-
readonly identity: Identity;
|
|
219
|
-
}
|
|
220
|
-
export interface ClassOwnerProjection<out Kind extends 'node' | 'edge' = 'node' | 'edge', out Identity = unknown, out Properties = unknown, out InstanceMethods = unknown, out StaticMethods = unknown> extends ClassIdentityProjection<Kind, Identity> {
|
|
221
|
-
readonly properties: Properties;
|
|
222
|
-
readonly instanceMethods: InstanceMethods;
|
|
223
|
-
readonly staticMethods: StaticMethods;
|
|
224
|
-
}
|
|
225
|
-
export interface ClassReferenceProjection<out Kind extends 'node' | 'edge' = 'node' | 'edge', out Identity = unknown, out EffectiveProperties = AuthoredPropertyProjection, out EffectiveInstanceMethods = unknown, out EffectiveStaticMethods = unknown> extends ClassIdentityProjection<Kind, Identity> {
|
|
226
|
-
readonly effectiveProperties: EffectiveProperties;
|
|
227
|
-
readonly effectiveInstanceMethods: EffectiveInstanceMethods;
|
|
228
|
-
readonly effectiveStaticMethods: EffectiveStaticMethods;
|
|
229
|
-
}
|
|
230
|
-
type NodeClassIdentity<Config> = Config extends {
|
|
231
|
-
readonly abstract: infer Abstract;
|
|
232
|
-
readonly depth: infer Depth;
|
|
233
|
-
readonly properties: infer Properties;
|
|
234
|
-
readonly methods: infer Methods;
|
|
235
|
-
} ? {
|
|
236
|
-
readonly abstract: Abstract;
|
|
237
|
-
readonly depth: Depth;
|
|
238
|
-
readonly properties: Properties;
|
|
239
|
-
readonly methods: Methods;
|
|
240
|
-
} : never;
|
|
241
|
-
type DirectedEdgeClassIdentity<Config> = Config extends {
|
|
242
|
-
readonly abstract: infer Abstract;
|
|
243
|
-
readonly depth: infer Depth;
|
|
244
|
-
readonly properties: infer Properties;
|
|
245
|
-
readonly source: infer Source;
|
|
246
|
-
readonly target: infer Target;
|
|
247
|
-
readonly constraints: infer Constraints;
|
|
248
|
-
} ? {
|
|
249
|
-
readonly abstract: Abstract;
|
|
250
|
-
readonly depth: Depth;
|
|
251
|
-
readonly properties: Properties;
|
|
252
|
-
readonly source: Source;
|
|
253
|
-
readonly target: Target;
|
|
254
|
-
readonly constraints: Constraints;
|
|
255
|
-
} : never;
|
|
256
|
-
type UndirectedEdgeClassIdentity<Config> = Config extends {
|
|
257
|
-
readonly abstract: infer Abstract;
|
|
258
|
-
readonly depth: infer Depth;
|
|
259
|
-
readonly properties: infer Properties;
|
|
260
|
-
readonly endpoints: infer Endpoints;
|
|
261
|
-
readonly constraints: infer Constraints;
|
|
262
|
-
} ? {
|
|
263
|
-
readonly abstract: Abstract;
|
|
264
|
-
readonly depth: Depth;
|
|
265
|
-
readonly properties: Properties;
|
|
266
|
-
readonly endpoints: Endpoints;
|
|
267
|
-
readonly constraints: Constraints;
|
|
268
|
-
} : never;
|
|
269
|
-
type OwnerErasedPropertyProjection<Entry> = Entry extends AuthoredPropertyProjection<infer Input, infer Output, infer Required, infer Name, unknown, infer State> ? AuthoredPropertyProjection<Input, Output, Required, Name, unknown, State> : Entry extends ResolvedProperty<infer Value, infer Required, infer State, infer Input> & {
|
|
270
|
-
readonly name: infer Name;
|
|
271
|
-
readonly key: infer Key;
|
|
272
|
-
} ? {
|
|
273
|
-
readonly value: Value;
|
|
274
|
-
readonly input: Input;
|
|
275
|
-
readonly required: Required;
|
|
276
|
-
readonly name: Name;
|
|
277
|
-
readonly key: Key;
|
|
278
|
-
readonly state?: State;
|
|
279
|
-
} : never;
|
|
280
|
-
type OwnerErasedMethodProjection<Entry> = Entry extends AuthoredMethodProjection<infer Value, infer Name, unknown> ? AuthoredMethodProjection<Value, Name, unknown> : Entry extends ResolvedMethod<infer Input, infer Output, infer Static, infer Abstract, infer Auth, infer _Policy, infer Key> & {
|
|
281
|
-
readonly name: infer Name;
|
|
282
|
-
} ? {
|
|
283
|
-
readonly input: Input;
|
|
284
|
-
readonly output: Output;
|
|
285
|
-
readonly static: Static;
|
|
286
|
-
readonly abstract: Abstract;
|
|
287
|
-
readonly auth: Auth;
|
|
288
|
-
readonly name: Name;
|
|
289
|
-
readonly key: Key;
|
|
290
|
-
} : never;
|
|
291
|
-
export type ClassIdentityProjectionOf<Value> = Value extends NodeClass<infer Config> ? ClassIdentityProjection<'node', NodeClassIdentity<Config>> : Value extends DirectedEdgeClass<infer Config> ? ClassIdentityProjection<'edge', DirectedEdgeClassIdentity<Config>> : Value extends UndirectedEdgeClass<infer Config> ? ClassIdentityProjection<'edge', UndirectedEdgeClassIdentity<Config>> : never;
|
|
292
|
-
export type ClassOwnerProjectionOf<Value> = Value extends NodeClass<infer Config> ? ClassOwnerProjection<'node', NodeClassIdentity<Config>, Config extends {
|
|
293
|
-
readonly effectiveProperties: infer Properties;
|
|
294
|
-
} ? OwnerErasedPropertyProjection<Properties> : never, Config extends {
|
|
295
|
-
readonly effectiveInstanceMethods: infer Methods;
|
|
296
|
-
} ? OwnerErasedMethodProjection<Methods> : never, Config extends {
|
|
297
|
-
readonly effectiveStaticMethods: infer Methods;
|
|
298
|
-
} ? OwnerErasedMethodProjection<Methods> : never> : Value extends DirectedEdgeClass<infer Config> ? ClassOwnerProjection<'edge', DirectedEdgeClassIdentity<Config>, Config extends {
|
|
299
|
-
readonly effectiveProperties: infer Properties;
|
|
300
|
-
} ? OwnerErasedPropertyProjection<Properties> : never, never, never> : Value extends UndirectedEdgeClass<infer Config> ? ClassOwnerProjection<'edge', UndirectedEdgeClassIdentity<Config>, Config extends {
|
|
301
|
-
readonly effectiveProperties: infer Properties;
|
|
302
|
-
} ? OwnerErasedPropertyProjection<Properties> : never, never, never> : never;
|
|
303
|
-
export type ClassReferenceProjectionOf<Value> = Value extends NodeClass<infer Config> ? ClassReferenceProjection<'node', NodeClassIdentity<Config>, Config extends {
|
|
304
|
-
readonly effectiveProperties: infer Properties;
|
|
305
|
-
} ? BindPropertyOwners<Properties, ClassOwnerProjectionOf<NodeClass<Config>>> : never, Config extends {
|
|
306
|
-
readonly effectiveInstanceMethods: infer Methods;
|
|
307
|
-
} ? BindMethodOwners<Methods, ClassOwnerProjectionOf<NodeClass<Config>>> : never, Config extends {
|
|
308
|
-
readonly effectiveStaticMethods: infer Methods;
|
|
309
|
-
} ? BindMethodOwners<Methods, ClassOwnerProjectionOf<NodeClass<Config>>> : never> : Value extends DirectedEdgeClass<infer Config> ? ClassReferenceProjection<'edge', DirectedEdgeClassIdentity<Config>, Config extends {
|
|
310
|
-
readonly effectiveProperties: infer Properties;
|
|
311
|
-
} ? BindPropertyOwners<Properties, ClassOwnerProjectionOf<DirectedEdgeClass<Config>>> : never, never, never> : Value extends UndirectedEdgeClass<infer Config> ? ClassReferenceProjection<'edge', UndirectedEdgeClassIdentity<Config>, Config extends {
|
|
312
|
-
readonly effectiveProperties: infer Properties;
|
|
313
|
-
} ? BindPropertyOwners<Properties, ClassOwnerProjectionOf<UndirectedEdgeClass<Config>>> : never, never, never> : never;
|
|
314
83
|
type CompactReference<Value> = Value extends () => infer Resolved ? () => CompactReference<Resolved> : Value extends ResolvedClass ? ClassProjectionOfResolved<Value> : Value extends Class ? ClassReferenceProjectionOf<Value> : Value;
|
|
315
84
|
type CompactReferences<Values extends readonly unknown[]> = Values extends readonly [] ? readonly [] : Values extends readonly [infer Value, ...infer Rest] ? readonly [CompactReference<Value>, ...CompactReferences<Rest>] : readonly CompactReference<Values[number]>[];
|
|
316
85
|
type CompactParentsOf<Input> = Input extends {
|
|
@@ -380,24 +149,6 @@ type CompactUndirectedInput<Input extends Omit<UndirectedEdgeInput, 'orientation
|
|
|
380
149
|
} ? NonNullable<Value> : Record<never, never>;
|
|
381
150
|
readonly effectiveProperties: EffectivePropertyProjectionsOf<Input>;
|
|
382
151
|
};
|
|
383
|
-
export interface NodeClass<out Config = unknown> {
|
|
384
|
-
readonly [AUTHORING]: 'definition';
|
|
385
|
-
readonly kind: 'node';
|
|
386
|
-
readonly [CLASS_TYPE]: () => Config;
|
|
387
|
-
}
|
|
388
|
-
export interface DirectedEdgeClass<out Input = unknown> {
|
|
389
|
-
readonly [AUTHORING]: 'definition';
|
|
390
|
-
readonly kind: 'edge';
|
|
391
|
-
readonly orientation: 'directed';
|
|
392
|
-
readonly [CLASS_TYPE]: () => Input;
|
|
393
|
-
}
|
|
394
|
-
export interface UndirectedEdgeClass<out Input = unknown> {
|
|
395
|
-
readonly [AUTHORING]: 'definition';
|
|
396
|
-
readonly kind: 'edge';
|
|
397
|
-
readonly orientation: 'undirected';
|
|
398
|
-
readonly [CLASS_TYPE]: () => Input;
|
|
399
|
-
}
|
|
400
|
-
export type EdgeClass = DirectedEdgeClass | UndirectedEdgeClass;
|
|
401
152
|
export declare function defineClass(config: {
|
|
402
153
|
readonly kind: 'node';
|
|
403
154
|
readonly abstract: boolean;
|
|
@@ -430,9 +181,8 @@ type WithoutStateProperties<Input> = Input extends {
|
|
|
430
181
|
readonly [Name in keyof Properties]: Properties[Name] extends Property ? [PropertyStateMachineOf<Properties[Name]>] extends [never] ? Properties[Name] : never : Properties[Name];
|
|
431
182
|
};
|
|
432
183
|
} : unknown;
|
|
433
|
-
export type ProjectionOfClass<Value extends Class> = Value extends NodeClass<infer Config> ? Config : Value extends DirectedEdgeClass<infer Input> ? Input : Value extends UndirectedEdgeClass<infer Input> ? Input : never;
|
|
434
184
|
export declare function classConfiguration(value: NodeClass): NodeClassInput;
|
|
435
185
|
export declare function classConfiguration(value: DirectedEdgeClass): Omit<DirectedEdgeInput, 'orientation'>;
|
|
436
186
|
export declare function classConfiguration(value: UndirectedEdgeClass): Omit<UndirectedEdgeInput, 'orientation'>;
|
|
437
187
|
export declare function classConfiguration(value: EdgeClass): Omit<DirectedEdgeInput, 'orientation'> | Omit<UndirectedEdgeInput, 'orientation'>;
|
|
438
|
-
export
|
|
188
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type AUTHORING } from '../schema/handle.js';
|
|
2
|
+
declare const CLASS_TYPE: unique symbol;
|
|
3
|
+
/** Authored Node Class handle; its type carries the compact projection of its input. */
|
|
4
|
+
export interface NodeClass<out Config = unknown> {
|
|
5
|
+
readonly [AUTHORING]: 'definition';
|
|
6
|
+
readonly kind: 'node';
|
|
7
|
+
readonly [CLASS_TYPE]: () => Config;
|
|
8
|
+
}
|
|
9
|
+
/** Authored directed Edge Class handle; its type carries the compact projection of its input. */
|
|
10
|
+
export interface DirectedEdgeClass<out Input = unknown> {
|
|
11
|
+
readonly [AUTHORING]: 'definition';
|
|
12
|
+
readonly kind: 'edge';
|
|
13
|
+
readonly orientation: 'directed';
|
|
14
|
+
readonly [CLASS_TYPE]: () => Input;
|
|
15
|
+
}
|
|
16
|
+
/** Authored undirected Edge Class handle; its type carries the compact projection of its input. */
|
|
17
|
+
export interface UndirectedEdgeClass<out Input = unknown> {
|
|
18
|
+
readonly [AUTHORING]: 'definition';
|
|
19
|
+
readonly kind: 'edge';
|
|
20
|
+
readonly orientation: 'undirected';
|
|
21
|
+
readonly [CLASS_TYPE]: () => Input;
|
|
22
|
+
}
|
|
23
|
+
export type EdgeClass = DirectedEdgeClass | UndirectedEdgeClass;
|
|
24
|
+
export type Class = NodeClass | EdgeClass;
|
|
25
|
+
/** The compact projection a Class handle carries. */
|
|
26
|
+
export type ProjectionOfClass<Value extends Class> = Value extends NodeClass<infer Config> ? Config : Value extends DirectedEdgeClass<infer Input> ? Input : Value extends UndirectedEdgeClass<infer Input> ? Input : never;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {} from '../schema/handle.js';
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import type { ClassRef } from '../../addressing/index.js';
|
|
2
|
+
import type { Inheritance } from '../../language/class/model/class.js';
|
|
3
|
+
import type { MediaType } from '../../language/class/model/data.js';
|
|
4
|
+
import type { EdgeCount, EdgeLifetime } from '../../language/class/model/edge.js';
|
|
5
|
+
import type { ResolvedClass } from '../../language/class/resolved.js';
|
|
6
|
+
import type { ClassRuleChecks, ClassRuleObject } from '../../language/policy/model/policy.js';
|
|
7
|
+
import type { Method, PolicyCheckContext } from '../callable/authoring.js';
|
|
8
|
+
import type { Policy } from '../policy/authoring.js';
|
|
9
|
+
import type { Lazy } from '../schema/lazy.js';
|
|
10
|
+
import type { Class, EdgeClass, NodeClass } from './handle.js';
|
|
11
|
+
import type { PropertyRecordInput } from './property.js';
|
|
12
|
+
/** Reference to a Class: an authored handle, a ClassRef or a resolved Class, possibly lazy. */
|
|
13
|
+
export type ClassReferenceInput = Lazy<Class | ClassRef | ResolvedClass<'node'> | ResolvedClass<'edge'>>;
|
|
14
|
+
export type NodeClassReferenceInput = Lazy<NodeClass | ClassRef | ResolvedClass<'node'>>;
|
|
15
|
+
export type EdgeClassReferenceInput = Lazy<EdgeClass | ClassRef | ResolvedClass<'edge'>>;
|
|
16
|
+
/** Source side of a directed Edge Class. */
|
|
17
|
+
export interface DirectedSourceInput {
|
|
18
|
+
readonly as: string;
|
|
19
|
+
readonly accepts: readonly NodeClassReferenceInput[];
|
|
20
|
+
readonly outgoing: EdgeCount;
|
|
21
|
+
/** What deleting a Node at this endpoint does to the Edge; derived when omitted. */
|
|
22
|
+
readonly onDelete?: EdgeLifetime;
|
|
23
|
+
}
|
|
24
|
+
/** Target side of a directed Edge Class. */
|
|
25
|
+
export interface DirectedTargetInput {
|
|
26
|
+
readonly as: string;
|
|
27
|
+
readonly accepts: readonly NodeClassReferenceInput[];
|
|
28
|
+
readonly incoming: EdgeCount;
|
|
29
|
+
/** What deleting a Node at this endpoint does to the Edge; derived when omitted. */
|
|
30
|
+
readonly onDelete?: EdgeLifetime;
|
|
31
|
+
}
|
|
32
|
+
/** One endpoint of an undirected Edge Class. */
|
|
33
|
+
export interface IncidentEndpointInput {
|
|
34
|
+
readonly as: string;
|
|
35
|
+
readonly accepts: readonly NodeClassReferenceInput[];
|
|
36
|
+
readonly incident: EdgeCount;
|
|
37
|
+
/** What deleting a Node at this endpoint does to the Edge; derived when omitted. */
|
|
38
|
+
readonly onDelete?: EdgeLifetime;
|
|
39
|
+
}
|
|
40
|
+
/** One observation slot: a local Policy, or its constant value. Absent means `true`. */
|
|
41
|
+
export type ClassPolicyInput = Lazy<Policy> | boolean;
|
|
42
|
+
/** Local observation Policies of a Class. */
|
|
43
|
+
export interface ClassPoliciesInput {
|
|
44
|
+
readonly read?: ClassPolicyInput;
|
|
45
|
+
readonly traverse?: ClassPolicyInput;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Policy checks deciding one Node Class observation. `self` is the observed Node; `ref` names one
|
|
49
|
+
* exact member, the same Node for every observed candidate.
|
|
50
|
+
*/
|
|
51
|
+
export interface ClassRuleContext extends PolicyCheckContext<ClassRuleObject> {
|
|
52
|
+
}
|
|
53
|
+
export type ClassRuleBuilder = (context: ClassRuleContext) => ClassRuleChecks;
|
|
54
|
+
/** One Node Class observation slot: a local Policy, a constant value, or Policy checks. */
|
|
55
|
+
export type NodeClassPolicyInput = ClassPolicyInput | ClassRuleBuilder;
|
|
56
|
+
/** Local observation Policies of a Node Class. */
|
|
57
|
+
export interface NodeClassPoliciesInput {
|
|
58
|
+
readonly read?: NodeClassPolicyInput;
|
|
59
|
+
readonly traverse?: NodeClassPolicyInput;
|
|
60
|
+
}
|
|
61
|
+
/** Authored Node Class. */
|
|
62
|
+
export interface NodeClassInput {
|
|
63
|
+
readonly abstract?: boolean;
|
|
64
|
+
/** Which Classes may extend this one; omitted, those of its own Domain only (`'internal'`). */
|
|
65
|
+
readonly inheritance?: Inheritance;
|
|
66
|
+
readonly description?: string;
|
|
67
|
+
readonly extends?: readonly NodeClassReferenceInput[];
|
|
68
|
+
readonly properties?: PropertyRecordInput;
|
|
69
|
+
readonly data?: MediaType;
|
|
70
|
+
readonly methods?: Readonly<Record<string, Method>>;
|
|
71
|
+
readonly icon?: string;
|
|
72
|
+
/** Local observation Policies; inherited by no descendant and forbidden on abstract Classes. */
|
|
73
|
+
readonly policies?: NodeClassPoliciesInput;
|
|
74
|
+
/**
|
|
75
|
+
* The tuples no two Nodes of this Class and of its active concrete descendants share while every
|
|
76
|
+
* Property is present; omitted, none. A descendant is covered without declaring them again.
|
|
77
|
+
*/
|
|
78
|
+
readonly unique?: readonly NodeUniqueTupleInput[];
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* The distinct Properties of one Node key, in any order, each a Property of the Class, own or
|
|
82
|
+
* inherited, by its name or, when names collide, by its full key.
|
|
83
|
+
*/
|
|
84
|
+
export type NodeUniqueTupleInput = readonly [string, ...string[]];
|
|
85
|
+
/** Members every authored Edge Class shares. */
|
|
86
|
+
export interface EdgeClassOptions {
|
|
87
|
+
readonly abstract?: boolean;
|
|
88
|
+
/** Which Classes may extend this one; omitted, those of its own Domain only (`'internal'`). */
|
|
89
|
+
readonly inheritance?: Inheritance;
|
|
90
|
+
readonly description?: string;
|
|
91
|
+
readonly extends?: readonly EdgeClassReferenceInput[];
|
|
92
|
+
readonly properties?: PropertyRecordInput;
|
|
93
|
+
/** Local observation Policies; inherited by no descendant and forbidden on abstract Classes. */
|
|
94
|
+
readonly policies?: ClassPoliciesInput;
|
|
95
|
+
readonly constraints?: {
|
|
96
|
+
readonly noSelf?: true;
|
|
97
|
+
readonly acyclic?: true;
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* A key field as authored: an endpoint, the slug, or a Property of the Class, own or inherited, by
|
|
102
|
+
* its name or, when names collide, by its full key.
|
|
103
|
+
*/
|
|
104
|
+
export type EdgeUniqueFieldInput = 'source' | 'target' | 'slug' | {
|
|
105
|
+
readonly property: string;
|
|
106
|
+
};
|
|
107
|
+
/** The distinct fields of one key, in any order. */
|
|
108
|
+
export type EdgeUniqueTupleInput = readonly [EdgeUniqueFieldInput, ...EdgeUniqueFieldInput[]];
|
|
109
|
+
/** Authored directed Edge Class. */
|
|
110
|
+
export interface DirectedEdgeInput extends EdgeClassOptions {
|
|
111
|
+
readonly orientation: 'directed';
|
|
112
|
+
readonly source: DirectedSourceInput;
|
|
113
|
+
readonly target: DirectedTargetInput;
|
|
114
|
+
/**
|
|
115
|
+
* The tuples no two Edges of this Class and of its active concrete descendants share while every
|
|
116
|
+
* field is present; omitted, none. A descendant is covered without declaring them again.
|
|
117
|
+
*/
|
|
118
|
+
readonly unique?: readonly EdgeUniqueTupleInput[];
|
|
119
|
+
}
|
|
120
|
+
/** Authored undirected Edge Class. */
|
|
121
|
+
export interface UndirectedEdgeInput extends Omit<EdgeClassOptions, 'constraints'> {
|
|
122
|
+
readonly orientation: 'undirected';
|
|
123
|
+
readonly endpoints: readonly [IncidentEndpointInput, IncidentEndpointInput];
|
|
124
|
+
readonly constraints?: {
|
|
125
|
+
readonly noSelf?: true;
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
export type EdgeClassCommon = EdgeClassOptions;
|
|
129
|
+
export type EdgeClassInput = DirectedEdgeInput | UndirectedEdgeInput;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import type { ResolvedMethod } from '../../language/callable/resolved.js';
|
|
2
|
+
import type { ResolvedProperty } from '../../language/class/resolved.js';
|
|
3
|
+
import type { StateTopology } from '../../language/state/topology.js';
|
|
4
|
+
import type { Method } from '../callable/authoring.js';
|
|
5
|
+
import type { DirectedEdgeClass, NodeClass, UndirectedEdgeClass } from './handle.js';
|
|
6
|
+
/** Compact type of one authored Property: values, requiredness, name, owner and state. */
|
|
7
|
+
export interface AuthoredPropertyProjection<out Input = unknown, out Output = unknown, out Required extends boolean = boolean, out Name extends string = string, out Owner = 'self', out State extends StateTopology | undefined = StateTopology | undefined> {
|
|
8
|
+
readonly input: Input;
|
|
9
|
+
readonly output: Output;
|
|
10
|
+
readonly required: Required;
|
|
11
|
+
readonly name: Name;
|
|
12
|
+
readonly owner: Owner;
|
|
13
|
+
readonly state?: State;
|
|
14
|
+
}
|
|
15
|
+
/** Compact type of one authored Method with its name and owner. */
|
|
16
|
+
export interface AuthoredMethodProjection<out Value extends Method = Method, out Name extends string = string, out Owner = 'self'> {
|
|
17
|
+
readonly value: Value;
|
|
18
|
+
readonly name: Name;
|
|
19
|
+
readonly owner: Owner;
|
|
20
|
+
}
|
|
21
|
+
/** Give `Owner` to every Property projection still owned by `self`. */
|
|
22
|
+
export type BindPropertyOwners<Entries, Owner> = Entries extends AuthoredPropertyProjection<infer Input, infer Output, infer Required, infer Name, infer ExistingOwner, infer State> ? AuthoredPropertyProjection<Input, Output, Required, Name, ExistingOwner extends 'self' ? Owner : ExistingOwner, State> : Entries;
|
|
23
|
+
/** Give `Owner` to every Method projection still owned by `self`. */
|
|
24
|
+
export type BindMethodOwners<Entries, Owner> = Entries extends AuthoredMethodProjection<infer Value, infer Name, infer ExistingOwner> ? AuthoredMethodProjection<Value, Name, ExistingOwner extends 'self' ? Owner : ExistingOwner> : Entries;
|
|
25
|
+
/** Kind and structural identity of an authored Class. */
|
|
26
|
+
export interface ClassIdentityProjection<out Kind extends 'node' | 'edge' = 'node' | 'edge', out Identity = unknown> {
|
|
27
|
+
readonly kind: Kind;
|
|
28
|
+
readonly identity: Identity;
|
|
29
|
+
}
|
|
30
|
+
/** An authored Class as the owner its Properties and Methods name. */
|
|
31
|
+
export interface ClassOwnerProjection<out Kind extends 'node' | 'edge' = 'node' | 'edge', out Identity = unknown, out Properties = unknown, out InstanceMethods = unknown, out StaticMethods = unknown> extends ClassIdentityProjection<Kind, Identity> {
|
|
32
|
+
readonly properties: Properties;
|
|
33
|
+
readonly instanceMethods: InstanceMethods;
|
|
34
|
+
readonly staticMethods: StaticMethods;
|
|
35
|
+
}
|
|
36
|
+
/** An authored Class as a reference, with its effective Properties and Methods. */
|
|
37
|
+
export interface ClassReferenceProjection<out Kind extends 'node' | 'edge' = 'node' | 'edge', out Identity = unknown, out EffectiveProperties = AuthoredPropertyProjection, out EffectiveInstanceMethods = unknown, out EffectiveStaticMethods = unknown> extends ClassIdentityProjection<Kind, Identity> {
|
|
38
|
+
readonly effectiveProperties: EffectiveProperties;
|
|
39
|
+
readonly effectiveInstanceMethods: EffectiveInstanceMethods;
|
|
40
|
+
readonly effectiveStaticMethods: EffectiveStaticMethods;
|
|
41
|
+
}
|
|
42
|
+
type NodeClassIdentity<Config> = Config extends {
|
|
43
|
+
readonly abstract: infer Abstract;
|
|
44
|
+
readonly depth: infer Depth;
|
|
45
|
+
readonly properties: infer Properties;
|
|
46
|
+
readonly methods: infer Methods;
|
|
47
|
+
} ? {
|
|
48
|
+
readonly abstract: Abstract;
|
|
49
|
+
readonly depth: Depth;
|
|
50
|
+
readonly properties: Properties;
|
|
51
|
+
readonly methods: Methods;
|
|
52
|
+
} : never;
|
|
53
|
+
type DirectedEdgeClassIdentity<Config> = Config extends {
|
|
54
|
+
readonly abstract: infer Abstract;
|
|
55
|
+
readonly depth: infer Depth;
|
|
56
|
+
readonly properties: infer Properties;
|
|
57
|
+
readonly source: infer Source;
|
|
58
|
+
readonly target: infer Target;
|
|
59
|
+
readonly constraints: infer Constraints;
|
|
60
|
+
} ? {
|
|
61
|
+
readonly abstract: Abstract;
|
|
62
|
+
readonly depth: Depth;
|
|
63
|
+
readonly properties: Properties;
|
|
64
|
+
readonly source: Source;
|
|
65
|
+
readonly target: Target;
|
|
66
|
+
readonly constraints: Constraints;
|
|
67
|
+
} : never;
|
|
68
|
+
type UndirectedEdgeClassIdentity<Config> = Config extends {
|
|
69
|
+
readonly abstract: infer Abstract;
|
|
70
|
+
readonly depth: infer Depth;
|
|
71
|
+
readonly properties: infer Properties;
|
|
72
|
+
readonly endpoints: infer Endpoints;
|
|
73
|
+
readonly constraints: infer Constraints;
|
|
74
|
+
} ? {
|
|
75
|
+
readonly abstract: Abstract;
|
|
76
|
+
readonly depth: Depth;
|
|
77
|
+
readonly properties: Properties;
|
|
78
|
+
readonly endpoints: Endpoints;
|
|
79
|
+
readonly constraints: Constraints;
|
|
80
|
+
} : never;
|
|
81
|
+
type OwnerErasedPropertyProjection<Entry> = Entry extends AuthoredPropertyProjection<infer Input, infer Output, infer Required, infer Name, unknown, infer State> ? AuthoredPropertyProjection<Input, Output, Required, Name, unknown, State> : Entry extends ResolvedProperty<infer Value, infer Required, infer State, infer Input> & {
|
|
82
|
+
readonly name: infer Name;
|
|
83
|
+
readonly key: infer Key;
|
|
84
|
+
} ? {
|
|
85
|
+
readonly value: Value;
|
|
86
|
+
readonly input: Input;
|
|
87
|
+
readonly required: Required;
|
|
88
|
+
readonly name: Name;
|
|
89
|
+
readonly key: Key;
|
|
90
|
+
readonly state?: State;
|
|
91
|
+
} : never;
|
|
92
|
+
type OwnerErasedMethodProjection<Entry> = Entry extends AuthoredMethodProjection<infer Value, infer Name, unknown> ? AuthoredMethodProjection<Value, Name, unknown> : Entry extends ResolvedMethod<infer Input, infer Output, infer Static, infer Abstract, infer Auth, infer _Policy, infer Key> & {
|
|
93
|
+
readonly name: infer Name;
|
|
94
|
+
} ? {
|
|
95
|
+
readonly input: Input;
|
|
96
|
+
readonly output: Output;
|
|
97
|
+
readonly static: Static;
|
|
98
|
+
readonly abstract: Abstract;
|
|
99
|
+
readonly auth: Auth;
|
|
100
|
+
readonly name: Name;
|
|
101
|
+
readonly key: Key;
|
|
102
|
+
} : never;
|
|
103
|
+
/** Identity projection of a Class handle. */
|
|
104
|
+
export type ClassIdentityProjectionOf<Value> = Value extends NodeClass<infer Config> ? ClassIdentityProjection<'node', NodeClassIdentity<Config>> : Value extends DirectedEdgeClass<infer Config> ? ClassIdentityProjection<'edge', DirectedEdgeClassIdentity<Config>> : Value extends UndirectedEdgeClass<infer Config> ? ClassIdentityProjection<'edge', UndirectedEdgeClassIdentity<Config>> : never;
|
|
105
|
+
/** Owner projection of a Class handle. */
|
|
106
|
+
export type ClassOwnerProjectionOf<Value> = Value extends NodeClass<infer Config> ? ClassOwnerProjection<'node', NodeClassIdentity<Config>, Config extends {
|
|
107
|
+
readonly effectiveProperties: infer Properties;
|
|
108
|
+
} ? OwnerErasedPropertyProjection<Properties> : never, Config extends {
|
|
109
|
+
readonly effectiveInstanceMethods: infer Methods;
|
|
110
|
+
} ? OwnerErasedMethodProjection<Methods> : never, Config extends {
|
|
111
|
+
readonly effectiveStaticMethods: infer Methods;
|
|
112
|
+
} ? OwnerErasedMethodProjection<Methods> : never> : Value extends DirectedEdgeClass<infer Config> ? ClassOwnerProjection<'edge', DirectedEdgeClassIdentity<Config>, Config extends {
|
|
113
|
+
readonly effectiveProperties: infer Properties;
|
|
114
|
+
} ? OwnerErasedPropertyProjection<Properties> : never, never, never> : Value extends UndirectedEdgeClass<infer Config> ? ClassOwnerProjection<'edge', UndirectedEdgeClassIdentity<Config>, Config extends {
|
|
115
|
+
readonly effectiveProperties: infer Properties;
|
|
116
|
+
} ? OwnerErasedPropertyProjection<Properties> : never, never, never> : never;
|
|
117
|
+
/** Reference projection of a Class handle. */
|
|
118
|
+
export type ClassReferenceProjectionOf<Value> = Value extends NodeClass<infer Config> ? ClassReferenceProjection<'node', NodeClassIdentity<Config>, Config extends {
|
|
119
|
+
readonly effectiveProperties: infer Properties;
|
|
120
|
+
} ? BindPropertyOwners<Properties, ClassOwnerProjectionOf<NodeClass<Config>>> : never, Config extends {
|
|
121
|
+
readonly effectiveInstanceMethods: infer Methods;
|
|
122
|
+
} ? BindMethodOwners<Methods, ClassOwnerProjectionOf<NodeClass<Config>>> : never, Config extends {
|
|
123
|
+
readonly effectiveStaticMethods: infer Methods;
|
|
124
|
+
} ? BindMethodOwners<Methods, ClassOwnerProjectionOf<NodeClass<Config>>> : never> : Value extends DirectedEdgeClass<infer Config> ? ClassReferenceProjection<'edge', DirectedEdgeClassIdentity<Config>, Config extends {
|
|
125
|
+
readonly effectiveProperties: infer Properties;
|
|
126
|
+
} ? BindPropertyOwners<Properties, ClassOwnerProjectionOf<DirectedEdgeClass<Config>>> : never, never, never> : Value extends UndirectedEdgeClass<infer Config> ? ClassReferenceProjection<'edge', UndirectedEdgeClassIdentity<Config>, Config extends {
|
|
127
|
+
readonly effectiveProperties: infer Properties;
|
|
128
|
+
} ? BindPropertyOwners<Properties, ClassOwnerProjectionOf<UndirectedEdgeClass<Config>>> : never, never, never> : never;
|
|
129
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Object as JsonObject } from '@astrale-os/kernel-dsl/value';
|
|
2
2
|
import type { DomainEndpointRef } from '../../language/core/model/core.js';
|
|
3
3
|
import type { PolicyObjectInput } from '../callable/authoring.js';
|
|
4
|
-
import type { EdgeClass, NodeClass } from '../class/
|
|
4
|
+
import type { EdgeClass, NodeClass } from '../class/handle.js';
|
|
5
5
|
import type { AUTHORING } from '../schema/handle.js';
|
|
6
6
|
import type { Lazy } from '../schema/lazy.js';
|
|
7
7
|
import type { CoreNamedPropertyInput } from '../schema/projection.js';
|
|
@@ -14,7 +14,9 @@ export { BuilderError as Error } from './schema/diagnostic.js';
|
|
|
14
14
|
export type { BuilderDiagnostic as Diagnostic, BuilderDiagnosticCode as DiagnosticCode, } from './schema/diagnostic.js';
|
|
15
15
|
export type { CallableInputBase, CallableInput, BinaryInputAuthoring, CallableOutputInput, CallableProjection, CallablePolicyBuilder, CallablePolicyContext, PolicyCheckContext, BinaryOutput, Function, FunctionInput, Method, MethodInput, PolicyObjectInput, StreamOutput, } from './callable/authoring.js';
|
|
16
16
|
export type { CoreEdge, CoreEndpoint, CoreInput, CoreNode } from './core/authoring.js';
|
|
17
|
-
export type {
|
|
17
|
+
export type { Class, DirectedEdgeClass, EdgeClass, NodeClass, UndirectedEdgeClass, } from './class/handle.js';
|
|
18
|
+
export type { ClassReferenceInput as ClassReference, ClassRuleBuilder, ClassRuleContext, DirectedEdgeInput, DirectedSourceInput, DirectedTargetInput, EdgeClassCommon, EdgeClassInput, EdgeClassReferenceInput as EdgeClassReference, EdgeUniqueFieldInput, EdgeUniqueTupleInput, IncidentEndpointInput, NodeClassInput, NodeClassPoliciesInput, NodeClassPolicyInput, NodeClassReferenceInput as NodeClassReference, NodeUniqueTupleInput, UndirectedEdgeInput, } from './class/input.js';
|
|
19
|
+
export type { AuthoredPropertyProjection, AuthoredMethodProjection, ClassIdentityProjection, ClassOwnerProjection, ClassReferenceProjection, } from './class/projection.js';
|
|
18
20
|
export type { PathAuthoring } from './value/path.js';
|
|
19
21
|
export type { Lazy } from './schema/lazy.js';
|
|
20
22
|
export type { MatchPolicyInput, Policy, PolicyBuilder as PolicyFactory, PolicyEdgeInput, PolicyExistsContext, PolicyInput, PolicyNodeBinder, PolicyPatternContext, } from './policy/authoring.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ClassDefinition } from '../../language/class/model/class.js';
|
|
2
|
-
import type { Class } from '../class/
|
|
2
|
+
import type { Class } from '../class/handle.js';
|
|
3
3
|
import type { CallableCompiler } from './callable.js';
|
|
4
4
|
import type { PolicyCompiler } from './policy.js';
|
|
5
5
|
import type { BuilderContext } from './schema/context.js';
|