@astrale-os/kernel-dsl 0.2.0-beta.47 → 0.2.0-beta.48
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/addressing/patterns.d.ts +0 -5
- package/dist/v1/addressing/patterns.js +5 -5
- package/dist/v1/builder/callable/authoring.d.ts +1 -1
- package/dist/v1/builder/class/authoring.d.ts +0 -12
- package/dist/v1/builder/class/property.d.ts +1 -1
- package/dist/v1/builder/index.d.ts +1 -1
- package/dist/v1/builder/lowering/callable.d.ts +2 -1
- package/dist/v1/builder/lowering/core.d.ts +3 -2
- package/dist/v1/builder/lowering/schema/compile.js +14 -1
- package/dist/v1/builder/lowering/value/zod.d.ts +3 -2
- package/dist/v1/builder/lowering/view.d.ts +2 -1
- package/dist/v1/builder/schema/define.d.ts +4 -2
- package/dist/v1/builder/schema/handle.d.ts +2 -1
- package/dist/v1/builder/schema/input.d.ts +8 -0
- package/dist/v1/builder/schema/projection/callable.d.ts +51 -0
- package/dist/v1/builder/schema/projection/callable.js +1 -0
- package/dist/v1/builder/schema/projection/class.d.ts +89 -0
- package/dist/v1/builder/schema/projection/class.js +1 -0
- package/dist/v1/builder/schema/projection/core-input.d.ts +32 -0
- package/dist/v1/builder/schema/projection/core-input.js +1 -0
- package/dist/v1/builder/schema/projection/domain.d.ts +59 -0
- package/dist/v1/builder/schema/projection/domain.js +1 -0
- package/dist/v1/builder/schema/projection/identity.d.ts +39 -0
- package/dist/v1/builder/schema/projection/identity.js +1 -0
- package/dist/v1/builder/schema/projection/model.d.ts +59 -0
- package/dist/v1/builder/schema/projection/model.js +1 -0
- package/dist/v1/builder/schema/projection/property.d.ts +32 -0
- package/dist/v1/builder/schema/projection/property.js +1 -0
- package/dist/v1/builder/schema/projection/resolved-class.d.ts +76 -0
- package/dist/v1/builder/schema/projection/resolved-class.js +1 -0
- package/dist/v1/builder/schema/projection.d.ts +4 -375
- package/dist/v1/bundle/structure.d.ts +2 -1
- package/dist/v1/compiled/admission/accept.d.ts +1 -1
- package/dist/v1/compiled/admission/accept.js +7 -1005
- package/dist/v1/compiled/admission/closure.d.ts +3 -0
- package/dist/v1/compiled/admission/closure.js +173 -0
- package/dist/v1/compiled/admission/diagnostic.d.ts +7 -0
- package/dist/v1/compiled/admission/diagnostic.js +13 -0
- package/dist/v1/compiled/admission/revision.js +2 -0
- package/dist/v1/compiled/admission/semantics/cardinality.d.ts +5 -0
- package/dist/v1/compiled/admission/semantics/cardinality.js +113 -0
- package/dist/v1/compiled/admission/semantics/class.d.ts +5 -0
- package/dist/v1/compiled/admission/semantics/class.js +125 -0
- package/dist/v1/compiled/admission/semantics/context.d.ts +60 -0
- package/dist/v1/compiled/admission/semantics/context.js +81 -0
- package/dist/v1/compiled/admission/semantics/core.d.ts +35 -0
- package/dist/v1/compiled/admission/semantics/core.js +123 -0
- package/dist/v1/compiled/admission/semantics/edge.d.ts +8 -0
- package/dist/v1/compiled/admission/semantics/edge.js +89 -0
- package/dist/v1/compiled/admission/semantics/policy/admit.d.ts +4 -0
- package/dist/v1/compiled/admission/semantics/policy/admit.js +57 -0
- package/dist/v1/compiled/admission/semantics/policy/callable.d.ts +5 -0
- package/dist/v1/compiled/admission/semantics/policy/callable.js +72 -0
- package/dist/v1/compiled/admission/semantics/policy/contracts.d.ts +24 -0
- package/dist/v1/compiled/admission/semantics/policy/contracts.js +45 -0
- package/dist/v1/compiled/admission/semantics/policy/equality.d.ts +8 -0
- package/dist/v1/compiled/admission/semantics/policy/equality.js +27 -0
- package/dist/v1/compiled/admission/semantics/policy/measure.d.ts +9 -0
- package/dist/v1/compiled/admission/semantics/policy/measure.js +81 -0
- package/dist/v1/compiled/admission/semantics/policy/parity.d.ts +4 -0
- package/dist/v1/compiled/admission/semantics/policy/parity.js +126 -0
- package/dist/v1/compiled/admission/semantics/policy/pattern.d.ts +8 -0
- package/dist/v1/compiled/admission/semantics/policy/pattern.js +78 -0
- package/dist/v1/compiled/admission/semantics/policy/typing.d.ts +28 -0
- package/dist/v1/compiled/admission/semantics/policy/typing.js +206 -0
- package/dist/v1/compiled/admission/semantics/policy/variants.d.ts +10 -0
- package/dist/v1/compiled/admission/semantics/policy/variants.js +65 -0
- package/dist/v1/compiled/admission/semantics.d.ts +1 -1
- package/dist/v1/compiled/admission/semantics.js +8 -1222
- package/dist/v1/compiled/admission/wire/callable.d.ts +6 -0
- package/dist/v1/compiled/admission/wire/callable.js +90 -0
- package/dist/v1/compiled/admission/wire/class.d.ts +4 -0
- package/dist/v1/compiled/admission/wire/class.js +117 -0
- package/dist/v1/compiled/admission/wire/core.d.ts +5 -0
- package/dist/v1/compiled/admission/wire/core.js +32 -0
- package/dist/v1/compiled/admission/wire/dependency.d.ts +14 -0
- package/dist/v1/compiled/admission/wire/dependency.js +43 -0
- package/dist/v1/compiled/admission/wire/entry.d.ts +5 -0
- package/dist/v1/compiled/admission/wire/entry.js +100 -0
- package/dist/v1/compiled/admission/wire/pattern.d.ts +12 -0
- package/dist/v1/compiled/admission/wire/pattern.js +111 -0
- package/dist/v1/compiled/admission/wire/policy.d.ts +5 -0
- package/dist/v1/compiled/admission/wire/policy.js +168 -0
- package/dist/v1/compiled/admission/wire/program.d.ts +4 -0
- package/dist/v1/compiled/admission/wire/program.js +52 -0
- package/dist/v1/compiled/admission/wire/property.d.ts +4 -0
- package/dist/v1/compiled/admission/wire/property.js +74 -0
- package/dist/v1/compiled/admission/wire/reference.d.ts +8 -0
- package/dist/v1/compiled/admission/wire/reference.js +33 -0
- package/dist/v1/compiled/admission/wire/value.d.ts +29 -0
- package/dist/v1/compiled/admission/wire/value.js +98 -0
- package/dist/v1/compiled/admission/wire/view.d.ts +3 -0
- package/dist/v1/compiled/admission/wire/view.js +17 -0
- package/dist/v1/compiled/compiler/compile.js +2 -0
- package/dist/v1/compiled/model/schema.d.ts +5 -1
- package/dist/v1/domain/projection/classes.js +2 -9
- package/dist/v1/index.d.ts +1 -1
- package/dist/v1/language/class/inheritance.d.ts +12 -0
- package/dist/v1/language/class/inheritance.js +25 -0
- package/dist/v1/language/class/resolved.d.ts +5 -1
- package/dist/v1/language/definition/metadata.d.ts +8 -0
- package/dist/v1/language/definition/metadata.js +12 -0
- package/dist/v1/language/value/model/blob.d.ts +0 -2
- package/dist/v1/language/value/model/blob.js +2 -2
- package/dist/v1/language/value/model/instant.d.ts +0 -2
- package/dist/v1/language/value/model/instant.js +1 -1
- package/dist/v1/language/value/model/schema.d.ts +2 -1
- package/dist/v1/language/value/model/schema.js +1 -5
- package/dist/v1/language/value/reference/registry.d.ts +2 -1
- package/dist/v1/language/value/regexp/syntax.d.ts +2 -1
- package/dist/v1/language/view/model/view.d.ts +2 -10
- package/dist/v1/schema/analysis/class.d.ts +2 -1
- package/dist/v1/schema/canonical/revision.d.ts +2 -1
- package/dist/v1/schema/compatibility/comparators/classes.d.ts +2 -1
- package/dist/v1/schema/compatibility/coordinate.d.ts +2 -1
- package/dist/v1/schema/compatibility/references.js +1 -10
- package/dist/v1/schema/compatibility/report.d.ts +2 -1
- package/dist/v1/schema/compatibility/scope.d.ts +0 -4
- package/dist/v1/schema/compatibility/scope.js +1 -1
- package/dist/v1/schema/diagnostic.d.ts +1 -1
- package/dist/v1/schema/model/schema.d.ts +5 -1
- package/dist/v1/schema/normalization/domain.js +11 -6
- package/dist/v1/schema/resolution/definition.index.d.ts +1 -2
- package/dist/v1/schema/resolution/definition.index.js +0 -3
- package/dist/v1/schema/resolution/origins.d.ts +1 -1
- package/dist/v1/schema/resolution/origins.js +0 -5
- package/dist/v1/schema/validation/class.js +10 -50
- package/dist/v1/schema/validation/core.js +1 -27
- package/dist/v1/schema/validation/domain.d.ts +2 -1
- package/dist/v1/schema/validation/domain.structure.d.ts +0 -2
- package/dist/v1/schema/validation/domain.structure.js +8 -8
- package/dist/v1/schema/validation/policy/context.js +5 -16
- package/dist/v1/schema/validation/view.js +14 -9
- package/dist/value/accept.d.ts +1 -1
- package/dist/value/accept.js +32 -6
- package/dist/value/canonical.js +10 -2
- package/dist/value/immutable.optimization.d.ts +4 -1
- package/dist/value/immutable.optimization.js +8 -2
- package/dist/value/limits.d.ts +1 -1
- package/dist/value/unicode.d.ts +3 -0
- package/dist/value/unicode.js +27 -0
- package/package.json +1 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type * as language from '../../../language/index.js';
|
|
2
|
+
import type { AuthoredPropertyProjection } from '../../class/authoring.js';
|
|
3
|
+
import type { DomainSchemaInput } from '../input.js';
|
|
4
|
+
import type { RecordField, ClassInputOf, OwnerNameOf } from './identity.js';
|
|
5
|
+
import type { PropertyProjection } from './model.js';
|
|
6
|
+
type PropertyFieldsOf<Value> = RecordField<ClassInputOf<Value>, 'properties'>;
|
|
7
|
+
interface AuthoredPropertyEntry<Owner, Name extends string, Field> {
|
|
8
|
+
readonly owner: Owner;
|
|
9
|
+
readonly name: Name;
|
|
10
|
+
readonly field: Field;
|
|
11
|
+
}
|
|
12
|
+
type OwnPropertyEntries<Value> = {
|
|
13
|
+
[Name in keyof PropertyFieldsOf<Value>]: AuthoredPropertyEntry<Value, Extract<Name, string>, PropertyFieldsOf<Value>[Name]>;
|
|
14
|
+
}[keyof PropertyFieldsOf<Value>];
|
|
15
|
+
type PropertyProjectionOfResolved<Value> = Value extends language.ResolvedProperty<infer PropertyValue, infer Required, infer State, infer Input> & {
|
|
16
|
+
readonly name: infer Name extends string;
|
|
17
|
+
readonly key: infer Key extends language.PropertyKey;
|
|
18
|
+
} ? PropertyProjection<PropertyValue, Required, Name, Key, State, Input> : never;
|
|
19
|
+
/** Capture every Property by its unambiguous qualified key. */
|
|
20
|
+
export type PropertiesOfCollection<Value> = Value extends {
|
|
21
|
+
readonly byKey: infer ByKey extends Readonly<Record<language.PropertyKey, language.ResolvedProperty<unknown, boolean>>>;
|
|
22
|
+
} ? PropertyProjectionOfResolved<ByKey[keyof ByKey]> : never;
|
|
23
|
+
/** Project Properties declared directly by one Class. */
|
|
24
|
+
export type OwnPropertyProjectionsOf<Origin extends string, Name extends string, Value> = OwnPropertyEntries<Value> extends infer Entry ? Entry extends AuthoredPropertyEntry<unknown, infer PropertyName, infer Field> ? Field extends AuthoredPropertyProjection<infer Input, infer Output, infer Required, string, unknown, infer State> ? PropertyProjection<Output, Required, PropertyName, language.PropertyKey<Origin, Name, PropertyName>, State, Input> : never : never : never;
|
|
25
|
+
/** Select the flat effective Property witnesses of a Class handle. */
|
|
26
|
+
export type EffectivePropertyEntriesOfClass<Value> = ClassInputOf<Value> extends {
|
|
27
|
+
readonly effectiveProperties: infer Properties;
|
|
28
|
+
} ? Properties : never;
|
|
29
|
+
type EffectivePropertyProjectionOfEntry<Origin extends string, CurrentName extends string, Root extends DomainSchemaInput, Entry> = Entry extends language.ResolvedProperty ? PropertyProjectionOfResolved<Entry> : Entry extends AuthoredPropertyProjection<infer Input, infer Output, infer Required, infer PropertyName, infer Owner, infer State> ? OwnerNameOf<Root, CurrentName, Owner> extends infer OwnerName extends string ? PropertyProjection<Output, Required, PropertyName, language.PropertyKey<Origin, OwnerName, PropertyName>, State, Input> : never : never;
|
|
30
|
+
/** Bind effective Property witnesses to their declaring Class coordinates. */
|
|
31
|
+
export type EffectivePropertyProjectionsOf<Origin extends string, Name extends string, Value, Root extends DomainSchemaInput> = EffectivePropertyEntriesOfClass<Value> extends infer Entry ? Entry extends unknown ? EffectivePropertyProjectionOfEntry<Origin, Name, Root, Entry> : never : never;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type * as language from '../../../language/index.js';
|
|
2
|
+
import type { MethodsOfCollection } from './callable.js';
|
|
3
|
+
import type { IsMultiple } from './identity.js';
|
|
4
|
+
import type { ClassProjection, PropertyProjection, MethodProjection } from './model.js';
|
|
5
|
+
import type { PropertiesOfCollection } from './property.js';
|
|
6
|
+
type EmptyMethodCollection = language.ResolvedMethodCollection<Record<never, never>>;
|
|
7
|
+
/** Retain exact dependency Class contracts with one shallow parent layer. */
|
|
8
|
+
export type ClassProjectionOfResolved<Value> = Value extends language.AnyResolvedClass ? ResolvedClassProjection<Value, ShallowClassProjectionTupleOfResolved<Value['extends']>> : never;
|
|
9
|
+
type ShallowClassProjectionOfResolved<Value> = ResolvedClassProjection<Value, readonly language.AnyResolvedClass[]>;
|
|
10
|
+
type ResolvedClassProjection<Value, Parents extends readonly unknown[]> = Value extends language.AnyResolvedClass & {
|
|
11
|
+
readonly ref: infer Ref extends language.ClassRef;
|
|
12
|
+
readonly key: infer Key extends language.DefinitionKey<string, 'class'>;
|
|
13
|
+
} ? ClassProjection<Value['kind'], Extract<Value['definition'], Extract<language.ClassDefinition, {
|
|
14
|
+
readonly kind: Value['kind'];
|
|
15
|
+
}>>, Ref, Key, Parents, PropertiesOfCollection<Value['properties']>, MethodsOfCollection<Value['methods']>, MethodsOfCollection<Value['static']['methods']>, PropertiesOfCollection<Value['self']['properties']>, MethodsOfCollection<Value['self']['methods']>, MethodsOfCollection<Value['self']['static']['methods']>> : never;
|
|
16
|
+
type ShallowClassProjectionTupleOfResolved<Parents extends readonly unknown[]> = Parents extends readonly [] ? readonly [] : Parents extends readonly [infer Parent, ...infer Rest] ? readonly [
|
|
17
|
+
ShallowClassProjectionOfResolved<ExactClass<Parent>>,
|
|
18
|
+
...ShallowClassProjectionTupleOfResolved<Rest>
|
|
19
|
+
] : readonly ShallowClassProjectionOfResolved<ExactClass<Parents[number]>>[];
|
|
20
|
+
/** Keep only Classes whose origin and declaration name remain literal. */
|
|
21
|
+
export type ExactClass<Value> = Value extends {
|
|
22
|
+
readonly key: infer Key extends language.DefinitionKey<string, 'class'>;
|
|
23
|
+
} ? Key extends `${infer Origin}:class.${infer Name}` ? string extends Origin ? never : string extends Name ? never : Value : never : never;
|
|
24
|
+
type ResolvedParentTupleOfProjection<Parents extends readonly unknown[]> = Parents extends readonly [] ? readonly [] : Parents extends readonly [infer Parent, ...infer Rest] ? readonly [
|
|
25
|
+
Parent extends ClassProjection ? ResolvedClassOfProjection<Parent> : Extract<Parent, language.AnyResolvedClass>,
|
|
26
|
+
...ResolvedParentTupleOfProjection<Rest>
|
|
27
|
+
] : readonly (Parents[number] extends ClassProjection ? ResolvedClassOfProjection<Parents[number]> : Extract<Parents[number], language.AnyResolvedClass>)[];
|
|
28
|
+
/** Restore the resolved Class surface from its compact witness. */
|
|
29
|
+
export type ResolvedClassOfProjection<Value extends ClassProjection> = Value extends ClassProjection<infer Kind, infer Definition, infer Ref, infer Key, infer Parents, infer Properties, infer InstanceMethods, infer StaticMethods, infer SelfProperties, infer SelfInstanceMethods, infer SelfStaticMethods> ? Key extends `${infer Origin}:class.${infer Name}` ? string extends Origin ? language.AnyResolvedClass : string extends Name ? language.AnyResolvedClass : ResolvedClassWithKind<Kind, Definition, Ref, Key, Parents, SelfProperties, SelfInstanceMethods, SelfStaticMethods, Properties, InstanceMethods, StaticMethods> : language.AnyResolvedClass : language.AnyResolvedClass;
|
|
30
|
+
type ResolvedClassWithKind<Kind extends language.ClassKind, Definition extends Extract<language.ClassDefinition, {
|
|
31
|
+
readonly kind: Kind;
|
|
32
|
+
}>, Ref extends language.ClassRef, Key extends language.DefinitionKey<string, 'class'>, Parents extends readonly unknown[], SelfProperties extends PropertyProjection, SelfInstanceMethods extends MethodProjection, SelfStaticMethods extends MethodProjection, Properties extends PropertyProjection, InstanceMethods extends MethodProjection, StaticMethods extends MethodProjection> = Kind extends 'node' ? language.ResolvedClass<'node', PropertyCollectionOfProjection<Properties>, MethodCollectionOfProjection<InstanceMethods>, MethodCollectionOfProjection<StaticMethods>, PropertyCollectionOfProjection<SelfProperties>, MethodCollectionOfProjection<SelfInstanceMethods>, MethodCollectionOfProjection<SelfStaticMethods>, Extract<Definition, language.NodeClassDefinition>, ResolvedParentTupleOfProjection<Parents>> & {
|
|
33
|
+
readonly ref: Ref;
|
|
34
|
+
readonly key: Key;
|
|
35
|
+
} : Kind extends 'edge' ? language.ResolvedClass<'edge', PropertyCollectionOfProjection<Properties>, EmptyMethodCollection, EmptyMethodCollection, PropertyCollectionOfProjection<SelfProperties>, EmptyMethodCollection, EmptyMethodCollection, Extract<Definition, language.EdgeClassDefinition>, ResolvedParentTupleOfProjection<Parents>> & {
|
|
36
|
+
readonly ref: Ref;
|
|
37
|
+
readonly key: Key;
|
|
38
|
+
} : never;
|
|
39
|
+
type PropertyCollectionOperation = 'byKey' | 'get' | 'from';
|
|
40
|
+
type ResolvedPropertyOfProjection<Value> = Value extends PropertyProjection<infer PropertyValue, infer Required, infer Name, infer Key, infer State, infer Input> ? language.ResolvedProperty<PropertyValue, Required, State, Input> & {
|
|
41
|
+
readonly name: Name;
|
|
42
|
+
readonly key: Key;
|
|
43
|
+
} : never;
|
|
44
|
+
type ProjectionPropertyByKey<Entries extends PropertyProjection> = Readonly<{
|
|
45
|
+
[Key in Entries['key']]: ResolvedPropertyOfProjection<Extract<Entries, {
|
|
46
|
+
readonly key: Key;
|
|
47
|
+
}>>;
|
|
48
|
+
}>;
|
|
49
|
+
type ProjectionPropertyByName<Entries extends PropertyProjection> = Readonly<{
|
|
50
|
+
[Name in Entries['name'] as IsMultiple<Extract<Entries, {
|
|
51
|
+
readonly name: Name;
|
|
52
|
+
}>> extends true ? never : Name extends PropertyCollectionOperation ? never : Name]: ResolvedPropertyOfProjection<Extract<Entries, {
|
|
53
|
+
readonly name: Name;
|
|
54
|
+
}>>;
|
|
55
|
+
}>;
|
|
56
|
+
/** Restore qualified lookup and unambiguous named Property access. */
|
|
57
|
+
type PropertyCollectionOfProjection<Entries extends PropertyProjection> = language.ResolvedPropertyCollection<ProjectionPropertyByKey<Entries>, ProjectionPropertyByName<Entries>>;
|
|
58
|
+
type MethodCollectionOperation = 'byKey' | 'get';
|
|
59
|
+
type ResolvedMethodOfProjection<Value> = Value extends MethodProjection<infer Input, infer Output, infer Static, infer Abstract, infer Auth, infer Name, infer Key, infer Executable, infer Execution> ? language.ResolvedMethod<Input, Output, Static, Abstract, Auth, language.PolicyCheckExpression, Key> & {
|
|
60
|
+
readonly name: Name;
|
|
61
|
+
readonly executable: Executable;
|
|
62
|
+
readonly execution: Execution;
|
|
63
|
+
} : never;
|
|
64
|
+
type ProjectionMethodByKey<Entries extends MethodProjection> = Readonly<{
|
|
65
|
+
[Key in Entries['key']]: ResolvedMethodOfProjection<Extract<Entries, {
|
|
66
|
+
readonly key: Key;
|
|
67
|
+
}>>;
|
|
68
|
+
}>;
|
|
69
|
+
type ProjectionMethodByName<Entries extends MethodProjection> = Readonly<{
|
|
70
|
+
[Name in Entries['name'] as Name extends MethodCollectionOperation ? never : Name]: ResolvedMethodOfProjection<Extract<Entries, {
|
|
71
|
+
readonly name: Name;
|
|
72
|
+
}>>;
|
|
73
|
+
}>;
|
|
74
|
+
/** Restore qualified Method lookup and permitted named shortcuts. */
|
|
75
|
+
type MethodCollectionOfProjection<Entries extends MethodProjection> = language.ResolvedMethodCollection<ProjectionMethodByKey<Entries>, ProjectionMethodByName<Entries>>;
|
|
76
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,375 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import type { BlobReceipt } from '../../language/value/model/blob.js';
|
|
6
|
-
import type { DomainOfSchema, DomainSchema } from '../../schema/model/schema.js';
|
|
7
|
-
import type { CallableProjection, Function, Method } from '../callable/authoring.js';
|
|
8
|
-
import type { AuthoredPropertyProjection, Class, ClassIdentityProjection, ClassIdentityProjectionOf, ClassOwnerProjection, ClassOwnerProjectionOf, ClassReferenceProjection, ClassReferenceProjectionOf, DirectedEdgeClass, NodeClass, ProjectionOfClass, UndirectedEdgeClass } from '../class/authoring.js';
|
|
9
|
-
import type { DomainSchemaInput } from './input.js';
|
|
10
|
-
export interface PropertyProjection<Value = unknown, Required extends boolean = boolean, Name extends string = string, Key extends language.PropertyKey = language.PropertyKey, State extends StateTopology | undefined = StateTopology | undefined, Input = Value> {
|
|
11
|
-
readonly value: Value;
|
|
12
|
-
readonly required: Required;
|
|
13
|
-
readonly name: Name;
|
|
14
|
-
readonly key: Key;
|
|
15
|
-
readonly state?: State;
|
|
16
|
-
readonly input: Input;
|
|
17
|
-
}
|
|
18
|
-
type MethodExecutableOf<OwnerAbstract extends boolean, MethodAbstract extends boolean> = MethodAbstract extends false ? true : OwnerAbstract extends false ? true : false;
|
|
19
|
-
export interface MethodProjection<Input = unknown, Output = unknown, Static extends boolean = boolean, Abstract extends boolean = boolean, Auth extends language.FunctionAuth = language.FunctionAuth, Name extends string = string, Key extends language.MethodKey = language.MethodKey, Executable extends boolean = boolean, Execution extends language.CallableExecution | undefined = language.CallableExecution | undefined> {
|
|
20
|
-
readonly input: Input;
|
|
21
|
-
readonly output: Output;
|
|
22
|
-
readonly static: Static;
|
|
23
|
-
readonly abstract: Abstract;
|
|
24
|
-
readonly executable: Executable;
|
|
25
|
-
readonly auth: Auth;
|
|
26
|
-
readonly name: Name;
|
|
27
|
-
readonly key: Key;
|
|
28
|
-
readonly execution: Execution;
|
|
29
|
-
}
|
|
30
|
-
export interface FunctionProjection<Input = unknown, Output = unknown, Auth extends language.FunctionAuth = language.FunctionAuth, Ref extends language.FunctionRef = language.FunctionRef, Key extends language.DefinitionKey<string, 'function'> = language.DefinitionKey<string, 'function'>, Execution extends language.CallableExecution | undefined = language.CallableExecution | undefined> {
|
|
31
|
-
readonly input: Input;
|
|
32
|
-
readonly output: Output;
|
|
33
|
-
readonly auth: Auth;
|
|
34
|
-
readonly ref: Ref;
|
|
35
|
-
readonly key: Key;
|
|
36
|
-
readonly execution: Execution;
|
|
37
|
-
}
|
|
38
|
-
export interface ClassProjection<Kind extends language.ClassKind = language.ClassKind, Definition extends Extract<language.ClassDefinition, {
|
|
39
|
-
readonly kind: Kind;
|
|
40
|
-
}> = Extract<language.ClassDefinition, {
|
|
41
|
-
readonly kind: Kind;
|
|
42
|
-
}>, Ref extends language.ClassRef = language.ClassRef, Key extends language.DefinitionKey<string, 'class'> = language.DefinitionKey<string, 'class'>, Parents extends readonly unknown[] = readonly unknown[], Properties extends PropertyProjection = PropertyProjection, InstanceMethods extends MethodProjection = MethodProjection, StaticMethods extends MethodProjection = MethodProjection, SelfProperties extends PropertyProjection = PropertyProjection, SelfInstanceMethods extends MethodProjection = MethodProjection, SelfStaticMethods extends MethodProjection = MethodProjection> {
|
|
43
|
-
readonly kind: Kind;
|
|
44
|
-
readonly definition: Definition;
|
|
45
|
-
readonly ref: Ref;
|
|
46
|
-
readonly key: Key;
|
|
47
|
-
readonly parents: Parents;
|
|
48
|
-
readonly properties: Properties;
|
|
49
|
-
readonly methods: InstanceMethods;
|
|
50
|
-
readonly staticMethods: StaticMethods;
|
|
51
|
-
readonly selfProperties: SelfProperties;
|
|
52
|
-
readonly selfMethods: SelfInstanceMethods;
|
|
53
|
-
readonly selfStaticMethods: SelfStaticMethods;
|
|
54
|
-
}
|
|
55
|
-
export interface DomainProjection<Classes extends Readonly<Record<string, unknown>> = Readonly<Record<string, unknown>>, Functions extends Readonly<Record<string, unknown>> = Readonly<Record<string, unknown>>, Policies extends Readonly<Record<string, unknown>> = Readonly<Record<string, unknown>>, Views extends Readonly<Record<string, unknown>> = Readonly<Record<string, unknown>>, CoreNodes extends Readonly<Record<string, unknown>> = Readonly<Record<string, unknown>>, Dependencies extends Readonly<Record<string, unknown>> = Readonly<Record<string, unknown>>> {
|
|
56
|
-
readonly classes: Classes;
|
|
57
|
-
readonly functions: Functions;
|
|
58
|
-
readonly policies: Policies;
|
|
59
|
-
readonly views: Views;
|
|
60
|
-
readonly core: CoreNodes;
|
|
61
|
-
readonly dependencies: Dependencies;
|
|
62
|
-
}
|
|
63
|
-
export type ProjectionOfInput<Origin extends string, Input extends DomainSchemaInput> = DomainProjection<{
|
|
64
|
-
readonly [Name in keyof ClassesInputOf<Input>]: ClassProjectionOfAuthoring<Origin, Extract<Name, string>, ClassesInputOf<Input>[Name], Input>;
|
|
65
|
-
}, {
|
|
66
|
-
readonly [Name in keyof FunctionsInputOf<Input>]: FunctionProjectionOfAuthoring<Origin, Extract<Name, string>, FunctionsInputOf<Input>[Name]>;
|
|
67
|
-
}, {
|
|
68
|
-
readonly [Name in keyof PoliciesInputOf<Input>]: language.ResolvedPolicy & {
|
|
69
|
-
readonly ref: language.PolicyRef<Extract<Name, string>> & {
|
|
70
|
-
readonly origin: Origin;
|
|
71
|
-
};
|
|
72
|
-
readonly key: language.DefinitionKey<Origin, 'policy', Extract<Name, string>>;
|
|
73
|
-
};
|
|
74
|
-
}, {
|
|
75
|
-
readonly [Name in keyof ViewsInputOf<Input>]: language.ResolvedView & {
|
|
76
|
-
readonly ref: language.ViewRef<Extract<Name, string>> & {
|
|
77
|
-
readonly origin: Origin;
|
|
78
|
-
};
|
|
79
|
-
readonly key: language.DefinitionKey<Origin, 'view', Extract<Name, string>>;
|
|
80
|
-
};
|
|
81
|
-
}, {
|
|
82
|
-
readonly [Name in keyof CoreNodesInputOf<Input>]: language.ResolvedCoreDefinition & {
|
|
83
|
-
readonly ref: language.CoreRef<Extract<Name, string>> & {
|
|
84
|
-
readonly origin: Origin;
|
|
85
|
-
};
|
|
86
|
-
readonly key: language.DefinitionKey<Origin, 'core', Extract<Name, string>>;
|
|
87
|
-
};
|
|
88
|
-
}, DependencySchemasOf<Input>>;
|
|
89
|
-
export interface DomainOfProjection<Projection extends DomainProjection> extends domain.Domain<{
|
|
90
|
-
readonly [Name in keyof Projection['classes']]: ResolvedClassOfProjection<Extract<Projection['classes'][Name], ClassProjection>>;
|
|
91
|
-
}, {
|
|
92
|
-
readonly [Name in keyof Projection['functions']]: ResolvedFunctionOfProjection<Extract<Projection['functions'][Name], FunctionProjection>>;
|
|
93
|
-
}, Extract<Projection['policies'], Readonly<Record<string, language.ResolvedPolicy>>>, Extract<Projection['views'], Readonly<Record<string, language.ResolvedView>>>, Extract<Projection['core'], Readonly<Record<string, language.ResolvedCoreDefinition>>>, Revision> {
|
|
94
|
-
readonly dependencies: domain.DependencyDomainNamespace<{
|
|
95
|
-
readonly [Alias in keyof Projection['dependencies']]: Projection['dependencies'][Alias] extends infer Dependency extends DomainSchema ? DomainOfSchema<Dependency> : never;
|
|
96
|
-
}>;
|
|
97
|
-
}
|
|
98
|
-
export type ResolvedDomainOfInput<Origin extends string, Input extends DomainSchemaInput> = DomainOfProjection<ProjectionOfInput<Origin, Input>>;
|
|
99
|
-
type DependenciesInputOf<Input extends DomainSchemaInput> = RecordField<Input, 'dependencies'>;
|
|
100
|
-
type DependencySchemasOf<Input extends DomainSchemaInput> = {
|
|
101
|
-
readonly [Alias in keyof DependenciesInputOf<Input>]: DependenciesInputOf<Input>[Alias];
|
|
102
|
-
};
|
|
103
|
-
type EmptyMethodCollection = language.ResolvedMethodCollection<Record<never, never>>;
|
|
104
|
-
type AbstractOf<Config> = Config extends {
|
|
105
|
-
readonly abstract: infer Abstract extends boolean;
|
|
106
|
-
} ? Abstract : false;
|
|
107
|
-
type ConstraintsOf<Options> = Options extends {
|
|
108
|
-
readonly constraints?: infer Constraints;
|
|
109
|
-
} ? NonNullable<Constraints> : Record<never, never>;
|
|
110
|
-
type ProjectedClassDefinition<Origin extends string, Name extends string, Value> = Value extends NodeClass<infer Config> ? language.NodeClassDefinition & {
|
|
111
|
-
readonly ref: language.ClassRef<Name> & {
|
|
112
|
-
readonly origin: Origin;
|
|
113
|
-
};
|
|
114
|
-
readonly kind: 'node';
|
|
115
|
-
readonly abstract: AbstractOf<Config>;
|
|
116
|
-
} : Value extends DirectedEdgeClass<infer Input> ? Input extends {
|
|
117
|
-
readonly source: infer Source extends {
|
|
118
|
-
readonly as: string;
|
|
119
|
-
readonly outgoing: language.EdgeCount;
|
|
120
|
-
};
|
|
121
|
-
readonly target: infer Target extends {
|
|
122
|
-
readonly as: string;
|
|
123
|
-
readonly incoming: language.EdgeCount;
|
|
124
|
-
};
|
|
125
|
-
} ? language.EdgeClassDefinition & {
|
|
126
|
-
readonly ref: language.ClassRef<Name> & {
|
|
127
|
-
readonly origin: Origin;
|
|
128
|
-
};
|
|
129
|
-
readonly kind: 'edge';
|
|
130
|
-
readonly abstract: AbstractOf<Input>;
|
|
131
|
-
readonly orientation: 'directed';
|
|
132
|
-
readonly endpoints: {
|
|
133
|
-
readonly source: language.DirectedSourceEndpoint & {
|
|
134
|
-
readonly role: Source['as'];
|
|
135
|
-
readonly outgoing: Source['outgoing'];
|
|
136
|
-
};
|
|
137
|
-
readonly target: language.DirectedTargetEndpoint & {
|
|
138
|
-
readonly role: Target['as'];
|
|
139
|
-
readonly incoming: Target['incoming'];
|
|
140
|
-
};
|
|
141
|
-
};
|
|
142
|
-
readonly constraints: language.DirectedEdgeConstraints & ConstraintsOf<Input>;
|
|
143
|
-
} : never : Value extends UndirectedEdgeClass<infer Input> ? Input extends {
|
|
144
|
-
readonly endpoints: readonly [
|
|
145
|
-
infer First extends {
|
|
146
|
-
readonly as: string;
|
|
147
|
-
readonly incident: language.EdgeCount;
|
|
148
|
-
},
|
|
149
|
-
infer Second extends {
|
|
150
|
-
readonly as: string;
|
|
151
|
-
readonly incident: language.EdgeCount;
|
|
152
|
-
}
|
|
153
|
-
];
|
|
154
|
-
} ? language.EdgeClassDefinition & {
|
|
155
|
-
readonly ref: language.ClassRef<Name> & {
|
|
156
|
-
readonly origin: Origin;
|
|
157
|
-
};
|
|
158
|
-
readonly kind: 'edge';
|
|
159
|
-
readonly abstract: AbstractOf<Input>;
|
|
160
|
-
readonly orientation: 'undirected';
|
|
161
|
-
readonly endpoints: readonly [
|
|
162
|
-
language.IncidentEndpoint & {
|
|
163
|
-
readonly role: First['as'];
|
|
164
|
-
readonly incident: First['incident'];
|
|
165
|
-
},
|
|
166
|
-
language.IncidentEndpoint & {
|
|
167
|
-
readonly role: Second['as'];
|
|
168
|
-
readonly incident: Second['incident'];
|
|
169
|
-
}
|
|
170
|
-
];
|
|
171
|
-
readonly constraints: language.UndirectedEdgeConstraints & ConstraintsOf<Input>;
|
|
172
|
-
} : never : never;
|
|
173
|
-
type RecordField<Value, Key extends PropertyKey> = Key extends keyof Value ? NonNullable<Value[Key]> extends Readonly<Record<string, unknown>> ? NonNullable<Value[Key]> : Record<never, never> : Record<never, never>;
|
|
174
|
-
type ClassesInputOf<Input extends DomainSchemaInput> = RecordField<Input, 'classes'>;
|
|
175
|
-
type FunctionsInputOf<Input extends DomainSchemaInput> = RecordField<Input, 'functions'>;
|
|
176
|
-
type PoliciesInputOf<Input extends DomainSchemaInput> = RecordField<Input, 'policies'>;
|
|
177
|
-
type ViewsInputOf<Input extends DomainSchemaInput> = RecordField<Input, 'views'>;
|
|
178
|
-
type CoreInputOf<Input extends DomainSchemaInput> = Input extends {
|
|
179
|
-
readonly core?: infer CoreValue;
|
|
180
|
-
} ? NonNullable<CoreValue> : Record<never, never>;
|
|
181
|
-
type CoreNodesInputOf<Input extends DomainSchemaInput> = RecordField<CoreInputOf<Input>, 'nodes'>;
|
|
182
|
-
type ResolveLazy<Value, Depth extends readonly unknown[] = []> = Depth['length'] extends 32 ? Value : Value extends () => infer Resolved ? ResolveLazy<Resolved, readonly [...Depth, unknown]> : Value;
|
|
183
|
-
type ClassInputOf<Value> = Value extends NodeClass<infer Input> ? Input : Value extends DirectedEdgeClass<infer Input> ? Input : Value extends UndirectedEdgeClass<infer Input> ? Input : never;
|
|
184
|
-
type ParentInputsOfConfig<Config> = Config extends {
|
|
185
|
-
readonly extends?: infer Parents extends readonly unknown[];
|
|
186
|
-
} ? Parents : readonly [];
|
|
187
|
-
type ParentClassProjectionOf<Origin extends string, Parent, Root extends DomainSchemaInput, Seen> = ResolveLazy<Parent> extends infer Resolved ? Resolved extends ClassReferenceProjection<infer _Kind, infer _Identity, infer _Properties, infer _InstanceMethods, infer _StaticMethods> ? LocalNameOfReference<Root, Resolved> extends infer Name extends string ? Name extends keyof ClassesInputOf<Root> ? ShallowClassProjectionOfAuthoring<Origin, Name, Extract<ClassesInputOf<Root>[Name], Class>, Root> : never : never : Resolved extends ClassProjection ? Resolved : Resolved extends language.AnyResolvedClass ? ClassProjectionOfResolved<ExactClass<Resolved>> : LocalNameOf<Root, Resolved> extends infer Name extends string ? Resolved extends Seen ? never : ClassProjectionOfAuthoring<Origin, Name, Resolved, Root, Seen | Resolved> : never : never;
|
|
188
|
-
type ParentClassProjectionTuple<Origin extends string, Parents extends readonly unknown[], Root extends DomainSchemaInput, Seen> = Parents extends readonly [] ? readonly [] : Parents extends readonly [infer Parent, ...infer Rest] ? readonly [
|
|
189
|
-
ParentClassProjectionOf<Origin, Parent, Root, Seen>,
|
|
190
|
-
...ParentClassProjectionTuple<Origin, Rest, Root, Seen>
|
|
191
|
-
] : readonly ParentClassProjectionOf<Origin, Parents[number], Root, Seen>[];
|
|
192
|
-
type Same<Left, Right> = [Left] extends [Right] ? ([Right] extends [Left] ? true : false) : false;
|
|
193
|
-
type LocalNameOf<Root extends DomainSchemaInput, Value> = {
|
|
194
|
-
[Name in keyof ClassesInputOf<Root>]: Same<ClassesInputOf<Root>[Name], Value> extends true ? Name : never;
|
|
195
|
-
}[keyof ClassesInputOf<Root>];
|
|
196
|
-
type LocalNameOfReference<Root extends DomainSchemaInput, Value> = {
|
|
197
|
-
[Name in keyof ClassesInputOf<Root>]: Value extends ClassReferenceProjection<'node' | 'edge', unknown, unknown, unknown, unknown> ? Same<ClassReferenceProjectionOf<Extract<ClassesInputOf<Root>[Name], Class>>, Value> extends true ? Name : never : never;
|
|
198
|
-
}[keyof ClassesInputOf<Root>];
|
|
199
|
-
type LocalNameOfIdentity<Root extends DomainSchemaInput, Value> = {
|
|
200
|
-
[Name in keyof ClassesInputOf<Root>]: Same<ClassIdentityProjectionOf<Extract<ClassesInputOf<Root>[Name], Class>>, Value> extends true ? Name : never;
|
|
201
|
-
}[keyof ClassesInputOf<Root>];
|
|
202
|
-
type LocalNameOfOwner<Root extends DomainSchemaInput, Value> = {
|
|
203
|
-
[Name in keyof ClassesInputOf<Root>]: Same<ClassOwnerProjectionOf<Extract<ClassesInputOf<Root>[Name], Class>>, Value> extends true ? Name : never;
|
|
204
|
-
}[keyof ClassesInputOf<Root>];
|
|
205
|
-
type PropertyFieldsOf<Value> = RecordField<ClassInputOf<Value>, 'properties'>;
|
|
206
|
-
interface AuthoredPropertyEntry<Owner, Name extends string, Field> {
|
|
207
|
-
readonly owner: Owner;
|
|
208
|
-
readonly name: Name;
|
|
209
|
-
readonly field: Field;
|
|
210
|
-
}
|
|
211
|
-
type OwnPropertyEntries<Value> = {
|
|
212
|
-
[Name in keyof PropertyFieldsOf<Value>]: AuthoredPropertyEntry<Value, Extract<Name, string>, PropertyFieldsOf<Value>[Name]>;
|
|
213
|
-
}[keyof PropertyFieldsOf<Value>];
|
|
214
|
-
export type CoreNamedPropertyInput<ClassValue> = ResolveLazy<ClassValue> extends infer Resolved ? Resolved extends Class ? CorePropertyInputFromAuthoredProjections<EffectivePropertyProjectionsOfClass<Resolved>> : Resolved extends language.ResolvedClass ? language.PropertyInputOf<Resolved> : never : never;
|
|
215
|
-
export type CorePropertyInput<ClassValue> = CoreNamedPropertyInput<ClassValue> | Readonly<Record<language.PropertyKey, language.PropertyValue>>;
|
|
216
|
-
type EffectivePropertyProjectionsOfClass<Value extends Class> = ClassInputOf<Value> extends {
|
|
217
|
-
readonly effectiveProperties: infer Properties;
|
|
218
|
-
} ? Properties : never;
|
|
219
|
-
type AuthoredProjectionName<Entry> = Entry extends AuthoredPropertyProjection<unknown, unknown, boolean, infer Name> ? Name : never;
|
|
220
|
-
type AuthoredProjectionInput<Entry> = Entry extends AuthoredPropertyProjection<infer Input, unknown, boolean, string> ? Input : never;
|
|
221
|
-
type CoreProjectionInput<Entry> = Entry extends AuthoredPropertyProjection<infer Input, infer Output, boolean, string> ? Input extends BlobReceipt ? Output : Input : never;
|
|
222
|
-
type AuthoredProjectionRequired<Entry> = Entry extends AuthoredPropertyProjection<unknown, unknown, infer Required, string> ? Required : false;
|
|
223
|
-
type UniqueAuthoredProjections<Entries> = Entries extends unknown ? IsMultiple<Extract<Entries, {
|
|
224
|
-
readonly name: AuthoredProjectionName<Entries>;
|
|
225
|
-
}>> extends true ? never : Entries : never;
|
|
226
|
-
type CoreAuthoredProjections<Entries> = UniqueAuthoredProjections<Entries> extends infer Entry ? Entry extends unknown ? [AuthoredProjectionInput<Entry>] extends [never] ? never : Entry : never : never;
|
|
227
|
-
type RequiredAuthoredPropertyNames<Entries> = CoreAuthoredProjections<Entries> extends infer Entry ? Entry extends unknown ? AuthoredProjectionRequired<Entry> extends true ? AuthoredProjectionName<Entry> : never : never : never;
|
|
228
|
-
type OptionalAuthoredPropertyNames<Entries> = Exclude<AuthoredProjectionName<CoreAuthoredProjections<Entries>>, RequiredAuthoredPropertyNames<Entries>>;
|
|
229
|
-
type AutomaticAuthoredPropertyNames<Entries> = UniqueAuthoredProjections<Entries> extends infer Entry ? Entry extends unknown ? [AuthoredProjectionInput<Entry>] extends [never] ? AuthoredProjectionName<Entry> : never : never : never;
|
|
230
|
-
type CorePropertyInputFromAuthoredProjections<Entries> = Readonly<{
|
|
231
|
-
[Name in RequiredAuthoredPropertyNames<Entries>]: CoreProjectionInput<Extract<CoreAuthoredProjections<Entries>, {
|
|
232
|
-
readonly name: Name;
|
|
233
|
-
}>>;
|
|
234
|
-
} & {
|
|
235
|
-
[Name in OptionalAuthoredPropertyNames<Entries>]?: CoreProjectionInput<Extract<CoreAuthoredProjections<Entries>, {
|
|
236
|
-
readonly name: Name;
|
|
237
|
-
}>>;
|
|
238
|
-
} & {
|
|
239
|
-
[Name in AutomaticAuthoredPropertyNames<Entries>]?: never;
|
|
240
|
-
}>;
|
|
241
|
-
type UnionIsMultiple<Value, Whole = Value> = Value extends unknown ? [Whole] extends [Value] ? false : true : never;
|
|
242
|
-
type IsMultiple<Value> = true extends UnionIsMultiple<Value> ? true : false;
|
|
243
|
-
type PropertyCollectionOperation = 'byKey' | 'get' | 'from';
|
|
244
|
-
type MethodFieldsOf<Value> = RecordField<ClassInputOf<Value>, 'methods'>;
|
|
245
|
-
interface AuthoredMethodEntry<Owner, Name extends string, Value extends Method> {
|
|
246
|
-
readonly owner: Owner;
|
|
247
|
-
readonly name: Name;
|
|
248
|
-
readonly value: Value;
|
|
249
|
-
}
|
|
250
|
-
type OwnMethodEntries<Value, Static extends boolean> = {
|
|
251
|
-
[Name in keyof MethodFieldsOf<Value>]: MethodFieldsOf<Value>[Name] extends infer MethodValue extends Method ? CallableConfig<MethodValue> extends {
|
|
252
|
-
readonly static: true;
|
|
253
|
-
} ? Static extends true ? AuthoredMethodEntry<Value, Extract<Name, string>, MethodValue> : never : Static extends false ? AuthoredMethodEntry<Value, Extract<Name, string>, MethodValue> : never : never;
|
|
254
|
-
}[keyof MethodFieldsOf<Value>];
|
|
255
|
-
type CallableConfig<Value> = Value extends Method<infer Config> ? Config extends CallableProjection ? Config : never : Value extends Function<infer Config> ? Config extends CallableProjection ? Config : never : never;
|
|
256
|
-
type CallableInputValue<Value extends Method | Function> = CallableConfig<Value>['input'];
|
|
257
|
-
type CallableOutputValue<Value extends Method | Function> = CallableConfig<Value>['output'];
|
|
258
|
-
type CallableExecutionOf<Value extends Method | Function> = CallableConfig<Value>['execution'];
|
|
259
|
-
type CallableStaticOf<Value extends Method> = CallableConfig<Value> extends {
|
|
260
|
-
readonly static: true;
|
|
261
|
-
} ? true : false;
|
|
262
|
-
type CallableAbstractOf<Value extends Method> = CallableConfig<Value> extends {
|
|
263
|
-
readonly abstract: infer Abstract extends boolean;
|
|
264
|
-
} ? Abstract : false;
|
|
265
|
-
type CallableAuthOf<Value extends Method | Function> = CallableConfig<Value>['auth'];
|
|
266
|
-
type MethodProjectionOfEntry<Origin extends string, OwnerName extends string, Entry> = Entry extends language.ResolvedMethod ? MethodProjectionOfResolved<Entry> : Entry extends AuthoredMethodEntry<infer Owner, infer Name, infer Value> ? MethodProjection<CallableInputValue<Value>, CallableOutputValue<Value>, CallableStaticOf<Value>, CallableAbstractOf<Value>, CallableAuthOf<Value>, Name, language.MethodKey<Origin, OwnerName, Name>, MethodExecutableOf<AbstractOf<ClassInputOf<Owner>>, CallableAbstractOf<Value>>, CallableExecutionOf<Value>> : never;
|
|
267
|
-
type MethodProjectionOfEntries<Origin extends string, OwnerName extends string, Entries> = Entries extends unknown ? MethodProjectionOfEntry<Origin, OwnerName, Entries> : never;
|
|
268
|
-
type MethodCollectionOperation = 'byKey' | 'get';
|
|
269
|
-
type PropertyProjectionOfResolved<Value> = Value extends language.ResolvedProperty<infer PropertyValue, infer Required, infer State, infer Input> & {
|
|
270
|
-
readonly name: infer Name extends string;
|
|
271
|
-
readonly key: infer Key extends language.PropertyKey;
|
|
272
|
-
} ? PropertyProjection<PropertyValue, Required, Name, Key, State, Input> : never;
|
|
273
|
-
type MethodProjectionOfResolved<Value> = Value extends language.ResolvedMethod<infer Input, infer Output, infer Static, infer Abstract, infer Auth, infer _Policy, infer Key> & {
|
|
274
|
-
readonly name: infer Name extends string;
|
|
275
|
-
} ? MethodProjection<Input, Output, Static, Abstract, Auth, Name, Key, Value['executable'], Value['execution']> : never;
|
|
276
|
-
type PropertiesOfCollection<Value> = Value extends {
|
|
277
|
-
readonly byKey: infer ByKey extends Readonly<Record<language.PropertyKey, language.ResolvedProperty<unknown, boolean>>>;
|
|
278
|
-
} ? PropertyProjectionOfResolved<ByKey[keyof ByKey]> : never;
|
|
279
|
-
type MethodsOfCollection<Value> = Value extends {
|
|
280
|
-
readonly byKey: infer ByKey extends Readonly<Record<language.MethodKey, language.ResolvedMethod>>;
|
|
281
|
-
} ? MethodProjectionOfResolved<ByKey[keyof ByKey]> : never;
|
|
282
|
-
export type ClassProjectionOfResolved<Value> = Value extends language.AnyResolvedClass & {
|
|
283
|
-
readonly ref: infer Ref extends language.ClassRef;
|
|
284
|
-
readonly key: infer Key extends language.DefinitionKey<string, 'class'>;
|
|
285
|
-
} ? ClassProjection<Value['kind'], Extract<Value['definition'], Extract<language.ClassDefinition, {
|
|
286
|
-
readonly kind: Value['kind'];
|
|
287
|
-
}>>, Ref, Key, ShallowClassProjectionTupleOfResolved<Value['extends']>, PropertiesOfCollection<Value['properties']>, MethodsOfCollection<Value['methods']>, MethodsOfCollection<Value['static']['methods']>, PropertiesOfCollection<Value['self']['properties']>, MethodsOfCollection<Value['self']['methods']>, MethodsOfCollection<Value['self']['static']['methods']>> : never;
|
|
288
|
-
type ShallowClassProjectionOfResolved<Value> = Value extends language.AnyResolvedClass & {
|
|
289
|
-
readonly ref: infer Ref extends language.ClassRef;
|
|
290
|
-
readonly key: infer Key extends language.DefinitionKey<string, 'class'>;
|
|
291
|
-
} ? ClassProjection<Value['kind'], Extract<Value['definition'], Extract<language.ClassDefinition, {
|
|
292
|
-
readonly kind: Value['kind'];
|
|
293
|
-
}>>, Ref, Key, readonly language.AnyResolvedClass[], PropertiesOfCollection<Value['properties']>, MethodsOfCollection<Value['methods']>, MethodsOfCollection<Value['static']['methods']>, PropertiesOfCollection<Value['self']['properties']>, MethodsOfCollection<Value['self']['methods']>, MethodsOfCollection<Value['self']['static']['methods']>> : never;
|
|
294
|
-
type ShallowClassProjectionTupleOfResolved<Parents extends readonly unknown[]> = Parents extends readonly [] ? readonly [] : Parents extends readonly [infer Parent, ...infer Rest] ? readonly [
|
|
295
|
-
ShallowClassProjectionOfResolved<ExactClass<Parent>>,
|
|
296
|
-
...ShallowClassProjectionTupleOfResolved<Rest>
|
|
297
|
-
] : readonly ShallowClassProjectionOfResolved<ExactClass<Parents[number]>>[];
|
|
298
|
-
type ExactClass<Value> = Value extends {
|
|
299
|
-
readonly key: infer Key extends language.DefinitionKey<string, 'class'>;
|
|
300
|
-
} ? Key extends `${infer Origin}:class.${infer Name}` ? string extends Origin ? never : string extends Name ? never : Value : never : never;
|
|
301
|
-
type OwnPropertyProjectionsOf<Origin extends string, Name extends string, Value> = OwnPropertyEntries<Value> extends infer Entry ? Entry extends AuthoredPropertyEntry<unknown, infer PropertyName, infer Field> ? Field extends AuthoredPropertyProjection<infer Input, infer Output, infer Required, string, unknown, infer State> ? PropertyProjection<Output, Required, PropertyName, language.PropertyKey<Origin, Name, PropertyName>, State, Input> : never : never : never;
|
|
302
|
-
type EffectivePropertyEntriesOfClass<Value> = ClassInputOf<Value> extends {
|
|
303
|
-
readonly effectiveProperties: infer Properties;
|
|
304
|
-
} ? Properties : never;
|
|
305
|
-
type OwnerNameOf<Root extends DomainSchemaInput, CurrentName extends string, Owner> = Owner extends 'self' ? CurrentName : Owner extends ClassOwnerProjection ? Extract<LocalNameOfOwner<Root, Owner>, string> : Owner extends ClassIdentityProjection ? Extract<LocalNameOfIdentity<Root, Owner>, string> : never;
|
|
306
|
-
type EffectivePropertyProjectionOfEntry<Origin extends string, CurrentName extends string, Root extends DomainSchemaInput, Entry> = Entry extends language.ResolvedProperty ? PropertyProjectionOfResolved<Entry> : Entry extends AuthoredPropertyProjection<infer Input, infer Output, infer Required, infer PropertyName, infer Owner, infer State> ? OwnerNameOf<Root, CurrentName, Owner> extends infer OwnerName extends string ? PropertyProjection<Output, Required, PropertyName, language.PropertyKey<Origin, OwnerName, PropertyName>, State, Input> : never : never;
|
|
307
|
-
type EffectivePropertyProjectionsOf<Origin extends string, Name extends string, Value, Root extends DomainSchemaInput> = EffectivePropertyEntriesOfClass<Value> extends infer Entry ? Entry extends unknown ? EffectivePropertyProjectionOfEntry<Origin, Name, Root, Entry> : never : never;
|
|
308
|
-
type OwnInstanceMethodProjectionsOf<Origin extends string, Name extends string, Value> = MethodProjectionOfEntries<Origin, Name, OwnMethodEntries<Value, false>>;
|
|
309
|
-
type OwnStaticMethodProjectionsOf<Origin extends string, Name extends string, Value> = MethodProjectionOfEntries<Origin, Name, OwnMethodEntries<Value, true>>;
|
|
310
|
-
type ShallowClassProjectionOfAuthoring<Origin extends string, Name extends string, Value, Root extends DomainSchemaInput> = Value extends NodeClass<infer _Config> ? ClassProjection<'node', Extract<ProjectedClassDefinition<Origin, Name, Value>, language.NodeClassDefinition>, language.ClassRef<Name> & {
|
|
311
|
-
readonly origin: Origin;
|
|
312
|
-
}, language.DefinitionKey<Origin, 'class', Name>, readonly language.AnyResolvedClass[], EffectivePropertyProjectionsOf<Origin, Name, Value, Root>, OwnInstanceMethodProjectionsOf<Origin, Name, Value>, OwnStaticMethodProjectionsOf<Origin, Name, Value>, OwnPropertyProjectionsOf<Origin, Name, Value>, OwnInstanceMethodProjectionsOf<Origin, Name, Value>, OwnStaticMethodProjectionsOf<Origin, Name, Value>> : Value extends DirectedEdgeClass | UndirectedEdgeClass ? ClassProjection<'edge', Extract<ProjectedClassDefinition<Origin, Name, Value>, language.EdgeClassDefinition>, language.ClassRef<Name> & {
|
|
313
|
-
readonly origin: Origin;
|
|
314
|
-
}, language.DefinitionKey<Origin, 'class', Name>, readonly language.AnyResolvedClass[], EffectivePropertyProjectionsOf<Origin, Name, Value, Root>, never, never, OwnPropertyProjectionsOf<Origin, Name, Value>, never, never> : never;
|
|
315
|
-
type ClassProjectionOfAuthoring<Origin extends string, Name extends string, Value, Root extends DomainSchemaInput, Seen = Value> = Value extends NodeClass ? ClassProjection<'node', Extract<ProjectedClassDefinition<Origin, Name, Value>, language.NodeClassDefinition>, language.ClassRef<Name> & {
|
|
316
|
-
readonly origin: Origin;
|
|
317
|
-
}, language.DefinitionKey<Origin, 'class', Name>, ParentClassProjectionTuple<Origin, ParentInputsOfConfig<ProjectionOfClass<Extract<Value, Class>>>, Root, Seen>, EffectivePropertyProjectionsOf<Origin, Name, Value, Root>, OwnInstanceMethodProjectionsOf<Origin, Name, Value>, OwnStaticMethodProjectionsOf<Origin, Name, Value>, OwnPropertyProjectionsOf<Origin, Name, Value>, OwnInstanceMethodProjectionsOf<Origin, Name, Value>, OwnStaticMethodProjectionsOf<Origin, Name, Value>> : Value extends DirectedEdgeClass | UndirectedEdgeClass ? ClassProjection<'edge', Extract<ProjectedClassDefinition<Origin, Name, Value>, language.EdgeClassDefinition>, language.ClassRef<Name> & {
|
|
318
|
-
readonly origin: Origin;
|
|
319
|
-
}, language.DefinitionKey<Origin, 'class', Name>, ParentClassProjectionTuple<Origin, ParentInputsOfConfig<ProjectionOfClass<Extract<Value, Class>>>, Root, Seen>, EffectivePropertyProjectionsOf<Origin, Name, Value, Root>, never, never, OwnPropertyProjectionsOf<Origin, Name, Value>, never, never> : never;
|
|
320
|
-
type FunctionProjectionOfAuthoring<Origin extends string, Name extends string, Value> = Value extends Function ? FunctionProjection<CallableInputValue<Value>, CallableOutputValue<Value>, CallableAuthOf<Value>, language.FunctionRef<Name> & {
|
|
321
|
-
readonly origin: Origin;
|
|
322
|
-
}, language.DefinitionKey<Origin, 'function', Name>, CallableExecutionOf<Value>> : never;
|
|
323
|
-
type ResolvedPropertyOfProjection<Value> = Value extends PropertyProjection<infer PropertyValue, infer Required, infer Name, infer Key, infer State, infer Input> ? language.ResolvedProperty<PropertyValue, Required, State, Input> & {
|
|
324
|
-
readonly name: Name;
|
|
325
|
-
readonly key: Key;
|
|
326
|
-
} : never;
|
|
327
|
-
type ProjectionPropertyByKey<Entries extends PropertyProjection> = Readonly<{
|
|
328
|
-
[Key in Entries['key']]: ResolvedPropertyOfProjection<Extract<Entries, {
|
|
329
|
-
readonly key: Key;
|
|
330
|
-
}>>;
|
|
331
|
-
}>;
|
|
332
|
-
type ProjectionPropertyByName<Entries extends PropertyProjection> = Readonly<{
|
|
333
|
-
[Name in Entries['name'] as IsMultiple<Extract<Entries, {
|
|
334
|
-
readonly name: Name;
|
|
335
|
-
}>> extends true ? never : Name extends PropertyCollectionOperation ? never : Name]: ResolvedPropertyOfProjection<Extract<Entries, {
|
|
336
|
-
readonly name: Name;
|
|
337
|
-
}>>;
|
|
338
|
-
}>;
|
|
339
|
-
type PropertyCollectionOfProjection<Entries extends PropertyProjection> = language.ResolvedPropertyCollection<ProjectionPropertyByKey<Entries>, ProjectionPropertyByName<Entries>>;
|
|
340
|
-
type ResolvedMethodOfProjection<Value> = Value extends MethodProjection<infer Input, infer Output, infer Static, infer Abstract, infer Auth, infer Name, infer Key, infer Executable, infer Execution> ? language.ResolvedMethod<Input, Output, Static, Abstract, Auth, language.PolicyCheckExpression, Key> & {
|
|
341
|
-
readonly name: Name;
|
|
342
|
-
readonly executable: Executable;
|
|
343
|
-
readonly execution: Execution;
|
|
344
|
-
} : never;
|
|
345
|
-
type ProjectionMethodByKey<Entries extends MethodProjection> = Readonly<{
|
|
346
|
-
[Key in Entries['key']]: ResolvedMethodOfProjection<Extract<Entries, {
|
|
347
|
-
readonly key: Key;
|
|
348
|
-
}>>;
|
|
349
|
-
}>;
|
|
350
|
-
type ProjectionMethodByName<Entries extends MethodProjection> = Readonly<{
|
|
351
|
-
[Name in Entries['name'] as Name extends MethodCollectionOperation ? never : Name]: ResolvedMethodOfProjection<Extract<Entries, {
|
|
352
|
-
readonly name: Name;
|
|
353
|
-
}>>;
|
|
354
|
-
}>;
|
|
355
|
-
type MethodCollectionOfProjection<Entries extends MethodProjection> = language.ResolvedMethodCollection<ProjectionMethodByKey<Entries>, ProjectionMethodByName<Entries>>;
|
|
356
|
-
type ResolvedParentTupleOfProjection<Parents extends readonly unknown[]> = Parents extends readonly [] ? readonly [] : Parents extends readonly [infer Parent, ...infer Rest] ? readonly [
|
|
357
|
-
Parent extends ClassProjection ? ResolvedClassOfProjection<Parent> : Extract<Parent, language.AnyResolvedClass>,
|
|
358
|
-
...ResolvedParentTupleOfProjection<Rest>
|
|
359
|
-
] : readonly (Parents[number] extends ClassProjection ? ResolvedClassOfProjection<Parents[number]> : Extract<Parents[number], language.AnyResolvedClass>)[];
|
|
360
|
-
export type ResolvedClassOfProjection<Value extends ClassProjection> = Value extends ClassProjection<infer Kind, infer Definition, infer Ref, infer Key, infer Parents, infer Properties, infer InstanceMethods, infer StaticMethods, infer SelfProperties, infer SelfInstanceMethods, infer SelfStaticMethods> ? Key extends `${infer Origin}:class.${infer Name}` ? string extends Origin ? language.AnyResolvedClass : string extends Name ? language.AnyResolvedClass : ResolvedClassWithKind<Kind, Definition, Ref, Key, Parents, SelfProperties, SelfInstanceMethods, SelfStaticMethods, Properties, InstanceMethods, StaticMethods> : language.AnyResolvedClass : language.AnyResolvedClass;
|
|
361
|
-
type ResolvedClassWithKind<Kind extends language.ClassKind, Definition extends Extract<language.ClassDefinition, {
|
|
362
|
-
readonly kind: Kind;
|
|
363
|
-
}>, Ref extends language.ClassRef, Key extends language.DefinitionKey<string, 'class'>, Parents extends readonly unknown[], SelfProperties extends PropertyProjection, SelfInstanceMethods extends MethodProjection, SelfStaticMethods extends MethodProjection, Properties extends PropertyProjection, InstanceMethods extends MethodProjection, StaticMethods extends MethodProjection> = Kind extends 'node' ? language.ResolvedClass<'node', PropertyCollectionOfProjection<Properties>, MethodCollectionOfProjection<InstanceMethods>, MethodCollectionOfProjection<StaticMethods>, PropertyCollectionOfProjection<SelfProperties>, MethodCollectionOfProjection<SelfInstanceMethods>, MethodCollectionOfProjection<SelfStaticMethods>, Extract<Definition, language.NodeClassDefinition>, ResolvedParentTupleOfProjection<Parents>> & {
|
|
364
|
-
readonly ref: Ref;
|
|
365
|
-
readonly key: Key;
|
|
366
|
-
} : Kind extends 'edge' ? language.ResolvedClass<'edge', PropertyCollectionOfProjection<Properties>, EmptyMethodCollection, EmptyMethodCollection, PropertyCollectionOfProjection<SelfProperties>, EmptyMethodCollection, EmptyMethodCollection, Extract<Definition, language.EdgeClassDefinition>, ResolvedParentTupleOfProjection<Parents>> & {
|
|
367
|
-
readonly ref: Ref;
|
|
368
|
-
readonly key: Key;
|
|
369
|
-
} : never;
|
|
370
|
-
type ResolvedFunctionOfProjection<Value extends FunctionProjection> = Value extends FunctionProjection<infer Input, infer Output, infer Auth, infer Ref, infer Key, infer Execution> ? language.ResolvedFunction<Input, Output, Auth, language.PolicyCheckExpression> & {
|
|
371
|
-
readonly ref: Ref;
|
|
372
|
-
readonly key: Key;
|
|
373
|
-
readonly execution: Execution;
|
|
374
|
-
} : never;
|
|
375
|
-
export {};
|
|
1
|
+
export type { PropertyProjection, MethodProjection, FunctionProjection, ClassProjection, DomainProjection, } from './projection/model.js';
|
|
2
|
+
export type { ResolvedDomainOfInput } from './projection/domain.js';
|
|
3
|
+
export type { CoreNamedPropertyInput, CorePropertyInput } from './projection/core-input.js';
|
|
4
|
+
export type { ClassProjectionOfResolved } from './projection/resolved-class.js';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { Value as JsonValue } from '@astrale-os/kernel-dsl/value';
|
|
2
2
|
import type { DomainSchemaIR } from '../schema/model/schema.js';
|
|
3
|
-
|
|
3
|
+
interface DomainSchemaBundleStructure {
|
|
4
4
|
readonly root: DomainSchemaIR;
|
|
5
5
|
readonly closure: readonly DomainSchemaIR[];
|
|
6
6
|
}
|
|
7
7
|
export declare function parseDomainSchemaBundleStructure(input: JsonValue): DomainSchemaBundleStructure;
|
|
8
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type CompiledSchema } from '../model/schema.js';
|
|
2
2
|
/** Admit one detached compiled closure before indices and declarations become executable. */
|
|
3
3
|
export declare function acceptCompiledSchema(input: unknown): CompiledSchema;
|