@shaclmate/compiler 4.0.98 → 4.0.100
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/generators/ts/AbstractBuiltinType.d.ts +23 -0
- package/dist/generators/ts/AbstractBuiltinType.js +18 -0
- package/dist/generators/ts/AbstractCollectionType.d.ts +2 -1
- package/dist/generators/ts/AbstractCollectionType.js +10 -5
- package/dist/generators/ts/AbstractCompoundType.d.ts +11 -8
- package/dist/generators/ts/AbstractCompoundType.js +5 -2
- package/dist/generators/ts/AbstractContainerType.d.ts +11 -11
- package/dist/generators/ts/AbstractContainerType.js +21 -15
- package/dist/generators/ts/AbstractDateType.d.ts +7 -6
- package/dist/generators/ts/AbstractDateType.js +16 -6
- package/dist/generators/ts/AbstractDiscriminatedUnionType.d.ts +2 -3
- package/dist/generators/ts/AbstractDiscriminatedUnionType.js +25 -7
- package/dist/generators/ts/AbstractIntersectionType.d.ts +2 -2
- package/dist/generators/ts/AbstractIntersectionType.js +19 -8
- package/dist/generators/ts/AbstractLazyType.d.ts +23 -23
- package/dist/generators/ts/AbstractLazyType.js +21 -19
- package/dist/generators/ts/AbstractNumericType.d.ts +4 -3
- package/dist/generators/ts/AbstractNumericType.js +12 -7
- package/dist/generators/ts/AbstractPrimitiveType.d.ts +2 -2
- package/dist/generators/ts/AbstractPrimitiveType.js +4 -4
- package/dist/generators/ts/AbstractTermType.d.ts +17 -16
- package/dist/generators/ts/AbstractTermType.js +21 -11
- package/dist/generators/ts/AbstractType.d.ts +6 -15
- package/dist/generators/ts/AbstractType.js +14 -33
- package/dist/generators/ts/AbstractTypedLiteralType.d.ts +2 -1
- package/dist/generators/ts/AbstractTypedLiteralType.js +20 -2
- package/dist/generators/ts/{AbstractStructuredType.d.ts → AbstractUserDefinedType.d.ts} +6 -6
- package/dist/generators/ts/{AbstractStructuredType.js → AbstractUserDefinedType.js} +38 -26
- package/dist/generators/ts/BigDecimalType.d.ts +12 -11
- package/dist/generators/ts/BigDecimalType.js +28 -11
- package/dist/generators/ts/BigIntType.js +6 -6
- package/dist/generators/ts/BlankNodeType.d.ts +11 -10
- package/dist/generators/ts/BlankNodeType.js +27 -10
- package/dist/generators/ts/BooleanType.d.ts +6 -5
- package/dist/generators/ts/BooleanType.js +18 -8
- package/dist/generators/ts/{ReferenceCallable.d.ts → BuiltinCallable.d.ts} +3 -3
- package/dist/generators/ts/{ReferenceCallable.js → BuiltinCallable.js} +3 -3
- package/dist/generators/ts/Callable.d.ts +2 -2
- package/dist/generators/ts/DateTimeType.d.ts +6 -6
- package/dist/generators/ts/DateTimeType.js +6 -6
- package/dist/generators/ts/DateType.d.ts +6 -6
- package/dist/generators/ts/DateType.js +6 -6
- package/dist/generators/ts/DefaultValueType.d.ts +2 -2
- package/dist/generators/ts/DefaultValueType.js +18 -8
- package/dist/generators/ts/FloatType.js +4 -4
- package/dist/generators/ts/IdentifierType.d.ts +11 -10
- package/dist/generators/ts/IdentifierType.js +27 -10
- package/dist/generators/ts/IntType.js +4 -4
- package/dist/generators/ts/IriType.d.ts +5 -5
- package/dist/generators/ts/IriType.js +27 -22
- package/dist/generators/ts/LangStringType.d.ts +10 -10
- package/dist/generators/ts/LangStringType.js +21 -13
- package/dist/generators/ts/ListType.js +7 -7
- package/dist/generators/ts/LiteralType.d.ts +10 -10
- package/dist/generators/ts/LiteralType.js +21 -13
- package/dist/generators/ts/ObjectType.d.ts +13 -15
- package/dist/generators/ts/ObjectType.js +32 -9
- package/dist/generators/ts/OptionType.d.ts +2 -1
- package/dist/generators/ts/OptionType.js +16 -11
- package/dist/generators/ts/SchemaObject.d.ts +98 -0
- package/dist/generators/ts/SchemaObject.js +143 -0
- package/dist/generators/ts/SetType.d.ts +2 -1
- package/dist/generators/ts/SetType.js +22 -10
- package/dist/generators/ts/Snippets.d.ts +1 -0
- package/dist/generators/ts/Snippets.js +7 -0
- package/dist/generators/ts/StringType.d.ts +6 -6
- package/dist/generators/ts/StringType.js +20 -17
- package/dist/generators/ts/TermType.d.ts +7 -7
- package/dist/generators/ts/TermType.js +18 -13
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_fromJsonObjectFunction.js +1 -1
- package/dist/generators/ts/_AbstractType/AbstractType_JsonType.d.ts +39 -16
- package/dist/generators/ts/_AbstractType/AbstractType_JsonType.js +49 -33
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_focusSparqlWherePatternsFunction.js +1 -1
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_fromRdfResourceValuesFunction.js +1 -1
- package/dist/generators/ts/_ObjectType/ObjectType_AbstractProperty.d.ts +4 -7
- package/dist/generators/ts/_ObjectType/ObjectType_AbstractProperty.js +1 -3
- package/dist/generators/ts/_ObjectType/ObjectType_DiscriminantProperty.d.ts +0 -1
- package/dist/generators/ts/_ObjectType/ObjectType_DiscriminantProperty.js +0 -1
- package/dist/generators/ts/_ObjectType/ObjectType_IdentifierProperty.d.ts +3 -2
- package/dist/generators/ts/_ObjectType/ObjectType_IdentifierProperty.js +30 -10
- package/dist/generators/ts/_ObjectType/ObjectType_RdfTypeProperty.d.ts +3 -2
- package/dist/generators/ts/_ObjectType/ObjectType_RdfTypeProperty.js +26 -10
- package/dist/generators/ts/_ObjectType/ObjectType_ShaclProperty.d.ts +3 -2
- package/dist/generators/ts/_ObjectType/ObjectType_ShaclProperty.js +46 -22
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunction.js +1 -1
- package/dist/generators/ts/_ObjectType/ObjectType_jsonObjectType.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_jsonObjectType.js +26 -0
- package/dist/generators/ts/_snippets/snippets_LazySchema.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_LazySchema.js +7 -0
- package/package.json +14 -12
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_schemaTypeExpression.d.ts +0 -5
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_schemaTypeExpression.js +0 -11
- package/dist/generators/ts/_ObjectType/ObjectType_schemaExpression.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_schemaExpression.js +0 -15
- package/dist/generators/ts/_ObjectType/ObjectType_schemaTypeExpression.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_schemaTypeExpression.js +0 -15
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { AbstractType } from "./AbstractType.js";
|
|
2
|
+
import type { SchemaObject } from "./SchemaObject.js";
|
|
3
|
+
/**
|
|
4
|
+
* Abstract base class for built-in types (container types, term types, et al.) -- anything that is not user-defined.
|
|
5
|
+
*/
|
|
6
|
+
export declare abstract class AbstractBuiltinType extends AbstractType {
|
|
7
|
+
get schema(): SchemaObject<SchemaObject.AbstractType | SchemaObject.BuiltinType>;
|
|
8
|
+
}
|
|
9
|
+
export declare namespace AbstractBuiltinType {
|
|
10
|
+
type ConversionFunction = AbstractType.ConversionFunction;
|
|
11
|
+
namespace ConversionFunction {
|
|
12
|
+
const SourceType: typeof import("./_AbstractType/AbstractType_ConversionFunction.js").AbstractType_ConversionFunction.SourceType;
|
|
13
|
+
type SourceType = AbstractType.ConversionFunction.SourceType;
|
|
14
|
+
}
|
|
15
|
+
type DiscriminatedType = AbstractType.DiscriminatedType;
|
|
16
|
+
const GraphqlType: typeof import("./_AbstractType/AbstractType_GraphqlType.js").AbstractType_GraphqlType;
|
|
17
|
+
type GraphqlType = AbstractType.GraphqlType;
|
|
18
|
+
type JsType = AbstractType.JsType;
|
|
19
|
+
const JsType: typeof import("./_AbstractType/AbstractType_JsType.js").AbstractType_JsType;
|
|
20
|
+
type JsonType = AbstractType.JsonType;
|
|
21
|
+
type JsonTypeFactory = AbstractType.JsonTypeFactory;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=AbstractBuiltinType.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AbstractType } from "./AbstractType.js";
|
|
2
|
+
/**
|
|
3
|
+
* Abstract base class for built-in types (container types, term types, et al.) -- anything that is not user-defined.
|
|
4
|
+
*/
|
|
5
|
+
export class AbstractBuiltinType extends AbstractType {
|
|
6
|
+
get schema() {
|
|
7
|
+
return super.schema;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
(function (AbstractBuiltinType) {
|
|
11
|
+
let ConversionFunction;
|
|
12
|
+
(function (ConversionFunction) {
|
|
13
|
+
ConversionFunction.SourceType = AbstractType.ConversionFunction.SourceType;
|
|
14
|
+
})(ConversionFunction = AbstractBuiltinType.ConversionFunction || (AbstractBuiltinType.ConversionFunction = {}));
|
|
15
|
+
AbstractBuiltinType.GraphqlType = AbstractType.GraphqlType;
|
|
16
|
+
AbstractBuiltinType.JsType = AbstractType.JsType;
|
|
17
|
+
})(AbstractBuiltinType || (AbstractBuiltinType = {}));
|
|
18
|
+
//# sourceMappingURL=AbstractBuiltinType.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Maybe } from "purify-ts";
|
|
2
2
|
import { AbstractContainerType } from "./AbstractContainerType.js";
|
|
3
3
|
import type { Callable } from "./Callable.js";
|
|
4
|
+
import { SchemaObject } from "./SchemaObject.js";
|
|
4
5
|
import { type Code } from "./ts-poet-wrapper.js";
|
|
5
6
|
/**
|
|
6
7
|
* Abstract base class for ListType and SetType.
|
|
@@ -15,9 +16,9 @@ export declare abstract class AbstractCollectionType<ItemTypeT extends AbstractC
|
|
|
15
16
|
get filterFunction(): Callable;
|
|
16
17
|
get filterType(): Code;
|
|
17
18
|
get graphqlType(): AbstractContainerType.GraphqlType;
|
|
19
|
+
get schema(): SchemaObject<SchemaObject.BuiltinType>;
|
|
18
20
|
get hashFunction(): Callable;
|
|
19
21
|
get mutable(): boolean;
|
|
20
|
-
get schemaType(): Code;
|
|
21
22
|
get validationFunction(): Maybe<Callable>;
|
|
22
23
|
protected get inlineExpression(): Code;
|
|
23
24
|
graphqlResolveExpression({ variables, }: Parameters<AbstractContainerType<ItemTypeT>["graphqlResolveExpression"]>[0]): Code;
|
|
@@ -8,6 +8,7 @@ import { Maybe } from "purify-ts";
|
|
|
8
8
|
import { Memoize } from "typescript-memoize";
|
|
9
9
|
import { AbstractContainerType } from "./AbstractContainerType.js";
|
|
10
10
|
import { InlineCallable } from "./InlineCallable.js";
|
|
11
|
+
import { SchemaObject } from "./SchemaObject.js";
|
|
11
12
|
import { code } from "./ts-poet-wrapper.js";
|
|
12
13
|
/**
|
|
13
14
|
* Abstract base class for ListType and SetType.
|
|
@@ -33,15 +34,19 @@ export class AbstractCollectionType extends AbstractContainerType {
|
|
|
33
34
|
get graphqlType() {
|
|
34
35
|
return new AbstractContainerType.GraphqlType(code `new ${this.reusables.imports.GraphQLList}(${this.itemType.graphqlType.expression})`, this.reusables);
|
|
35
36
|
}
|
|
37
|
+
get schema() {
|
|
38
|
+
return new SchemaObject({
|
|
39
|
+
properties: super.schema.properties,
|
|
40
|
+
type: new SchemaObject.BuiltinType(code `${this.reusables.snippets.CollectionSchema}<${this.itemType.schema.type.expression}>`),
|
|
41
|
+
variable: super.schema.variable,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
36
44
|
get hashFunction() {
|
|
37
45
|
return new InlineCallable(code `${this.reusables.snippets.hashArray}(${this.itemType.hashFunction.annotatedUsage})`);
|
|
38
46
|
}
|
|
39
47
|
get mutable() {
|
|
40
48
|
return this._mutable || this.itemType.mutable;
|
|
41
49
|
}
|
|
42
|
-
get schemaType() {
|
|
43
|
-
return code `${this.reusables.snippets.CollectionSchema}<${this.itemType.schemaType}>`;
|
|
44
|
-
}
|
|
45
50
|
get validationFunction() {
|
|
46
51
|
return Maybe.of(new InlineCallable(code `${this._mutable ? this.reusables.snippets.validateMutableArray : this.reusables.snippets.validateArray}(${this.itemType.validationFunction
|
|
47
52
|
.map((_) => _.unannotatedUsage)
|
|
@@ -71,10 +76,10 @@ __decorate([
|
|
|
71
76
|
], AbstractCollectionType.prototype, "graphqlType", null);
|
|
72
77
|
__decorate([
|
|
73
78
|
Memoize()
|
|
74
|
-
], AbstractCollectionType.prototype, "
|
|
79
|
+
], AbstractCollectionType.prototype, "schema", null);
|
|
75
80
|
__decorate([
|
|
76
81
|
Memoize()
|
|
77
|
-
], AbstractCollectionType.prototype, "
|
|
82
|
+
], AbstractCollectionType.prototype, "hashFunction", null);
|
|
78
83
|
__decorate([
|
|
79
84
|
Memoize()
|
|
80
85
|
], AbstractCollectionType.prototype, "validationFunction", null);
|
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AbstractUserDefinedType } from "./AbstractUserDefinedType.js";
|
|
2
2
|
import type { Type } from "./Type.js";
|
|
3
|
+
/**
|
|
4
|
+
* A compound of types, such as an intersection or union.
|
|
5
|
+
*/
|
|
3
6
|
export declare abstract class AbstractCompoundType<MemberT extends {
|
|
4
7
|
type: MemberTypeT;
|
|
5
|
-
}, MemberTypeT extends Type> extends
|
|
8
|
+
}, MemberTypeT extends Type> extends AbstractUserDefinedType {
|
|
6
9
|
abstract readonly members: readonly MemberT[];
|
|
7
10
|
get mutable(): boolean;
|
|
8
11
|
get referencesNamedType(): boolean;
|
|
9
|
-
get toRdfResourceValueTypes():
|
|
12
|
+
get toRdfResourceValueTypes(): AbstractUserDefinedType["toRdfResourceValueTypes"];
|
|
10
13
|
}
|
|
11
14
|
export declare namespace AbstractCompoundType {
|
|
12
|
-
type ConversionFunction =
|
|
13
|
-
type DiscriminatedType =
|
|
14
|
-
type GraphqlType =
|
|
15
|
-
type JsonType =
|
|
16
|
-
type JsType =
|
|
15
|
+
type ConversionFunction = AbstractUserDefinedType.ConversionFunction;
|
|
16
|
+
type DiscriminatedType = AbstractUserDefinedType.DiscriminatedType;
|
|
17
|
+
type GraphqlType = AbstractUserDefinedType.GraphqlType;
|
|
18
|
+
type JsonType = AbstractUserDefinedType.JsonType;
|
|
19
|
+
type JsType = AbstractUserDefinedType.JsType;
|
|
17
20
|
}
|
|
18
21
|
//# sourceMappingURL=AbstractCompoundType.d.ts.map
|
|
@@ -5,8 +5,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
import { Memoize } from "typescript-memoize";
|
|
8
|
-
import {
|
|
9
|
-
|
|
8
|
+
import { AbstractUserDefinedType } from "./AbstractUserDefinedType.js";
|
|
9
|
+
/**
|
|
10
|
+
* A compound of types, such as an intersection or union.
|
|
11
|
+
*/
|
|
12
|
+
export class AbstractCompoundType extends AbstractUserDefinedType {
|
|
10
13
|
get mutable() {
|
|
11
14
|
return this.members.some((member) => member.type.mutable);
|
|
12
15
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Maybe } from "purify-ts";
|
|
2
|
-
import {
|
|
2
|
+
import { AbstractBuiltinType } from "./AbstractBuiltinType.js";
|
|
3
3
|
import type { BigDecimalType } from "./BigDecimalType.js";
|
|
4
4
|
import type { BigIntType } from "./BigIntType.js";
|
|
5
5
|
import type { BlankNodeType } from "./BlankNodeType.js";
|
|
@@ -18,15 +18,15 @@ import type { LiteralType } from "./LiteralType.js";
|
|
|
18
18
|
import type { ObjectDiscriminatedUnionType } from "./ObjectDiscriminatedUnionType.js";
|
|
19
19
|
import type { ObjectIntersectionType } from "./ObjectIntersectionType.js";
|
|
20
20
|
import type { ObjectType } from "./ObjectType.js";
|
|
21
|
+
import { SchemaObject } from "./SchemaObject.js";
|
|
21
22
|
import type { StringType } from "./StringType.js";
|
|
22
23
|
import type { TermType } from "./TermType.js";
|
|
23
24
|
import type { Type } from "./Type.js";
|
|
24
|
-
import { type Code } from "./ts-poet-wrapper.js";
|
|
25
25
|
/**
|
|
26
26
|
* Abstract base class for types that contain other types e.g., ListType, OptionType, SetType.
|
|
27
27
|
*/
|
|
28
|
-
export declare abstract class AbstractContainerType<ItemTypeT extends AbstractContainerType.ItemType> extends
|
|
29
|
-
readonly discriminatedType: Maybe<
|
|
28
|
+
export declare abstract class AbstractContainerType<ItemTypeT extends AbstractContainerType.ItemType> extends AbstractBuiltinType {
|
|
29
|
+
readonly discriminatedType: Maybe<AbstractBuiltinType.DiscriminatedType>;
|
|
30
30
|
abstract readonly kind: "DefaultValue" | "List" | "Option" | "Set";
|
|
31
31
|
/**
|
|
32
32
|
* Container item type.
|
|
@@ -36,20 +36,20 @@ export declare abstract class AbstractContainerType<ItemTypeT extends AbstractCo
|
|
|
36
36
|
itemType: ItemTypeT;
|
|
37
37
|
constructor({ itemType, ...superParameters }: {
|
|
38
38
|
itemType: ItemTypeT;
|
|
39
|
-
} & ConstructorParameters<typeof
|
|
39
|
+
} & ConstructorParameters<typeof AbstractBuiltinType>[0]);
|
|
40
40
|
get recursive(): boolean;
|
|
41
41
|
get referencesNamedType(): boolean;
|
|
42
|
-
|
|
42
|
+
get schema(): SchemaObject<SchemaObject.AbstractType | SchemaObject.BuiltinType>;
|
|
43
|
+
protected get itemConversionFunctionDefault(): AbstractBuiltinType.ConversionFunction;
|
|
43
44
|
protected get itemValidationFunctionDefault(): Callable;
|
|
44
|
-
protected get schemaInitializers(): readonly Code[];
|
|
45
45
|
}
|
|
46
46
|
export declare namespace AbstractContainerType {
|
|
47
|
-
type ConversionFunction =
|
|
48
|
-
type DiscriminatedType =
|
|
47
|
+
type ConversionFunction = AbstractBuiltinType.ConversionFunction;
|
|
48
|
+
type DiscriminatedType = AbstractBuiltinType.DiscriminatedType;
|
|
49
49
|
const GraphqlType: typeof import("./_AbstractType/AbstractType_GraphqlType.js").AbstractType_GraphqlType;
|
|
50
|
-
type GraphqlType =
|
|
50
|
+
type GraphqlType = AbstractBuiltinType.GraphqlType;
|
|
51
51
|
type ItemType = BigDecimalType | BigIntType | BlankNodeType | BooleanType | DateTimeType | DateType | DiscriminatedUnionType | FloatType | IdentifierType | IntType | IriType | LangStringType | ListType<ListType.ItemType> | LiteralType | ObjectDiscriminatedUnionType | ObjectIntersectionType | ObjectType | StringType | TermType;
|
|
52
52
|
function isItemType(type: Type): type is ItemType;
|
|
53
|
-
type JsonType =
|
|
53
|
+
type JsonType = AbstractBuiltinType.JsonType;
|
|
54
54
|
}
|
|
55
55
|
//# sourceMappingURL=AbstractContainerType.d.ts.map
|
|
@@ -6,13 +6,14 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { Maybe } from "purify-ts";
|
|
8
8
|
import { Memoize } from "typescript-memoize";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { AbstractBuiltinType } from "./AbstractBuiltinType.js";
|
|
10
|
+
import { BuiltinCallable } from "./BuiltinCallable.js";
|
|
11
|
+
import { SchemaObject } from "./SchemaObject.js";
|
|
11
12
|
import { code } from "./ts-poet-wrapper.js";
|
|
12
13
|
/**
|
|
13
14
|
* Abstract base class for types that contain other types e.g., ListType, OptionType, SetType.
|
|
14
15
|
*/
|
|
15
|
-
export class AbstractContainerType extends
|
|
16
|
+
export class AbstractContainerType extends AbstractBuiltinType {
|
|
16
17
|
discriminatedType = Maybe.empty();
|
|
17
18
|
/**
|
|
18
19
|
* Container item type.
|
|
@@ -30,6 +31,18 @@ export class AbstractContainerType extends AbstractType {
|
|
|
30
31
|
get referencesNamedType() {
|
|
31
32
|
return this.name.isJust() || this.itemType.referencesNamedType;
|
|
32
33
|
}
|
|
34
|
+
get schema() {
|
|
35
|
+
return new SchemaObject({
|
|
36
|
+
properties: {
|
|
37
|
+
...super.schema.properties,
|
|
38
|
+
itemType: this.recursive || this.referencesNamedType
|
|
39
|
+
? code `get itemType() { return ${this.itemType.schema.expression}; }`
|
|
40
|
+
: code `itemType: ${this.itemType.schema.expression}`,
|
|
41
|
+
},
|
|
42
|
+
type: new SchemaObject.AbstractType("AbstractContainerType"),
|
|
43
|
+
variable: super.schema.variable,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
33
46
|
get itemConversionFunctionDefault() {
|
|
34
47
|
return {
|
|
35
48
|
code: code `${this.reusables.snippets.identityConversionFunction}`,
|
|
@@ -42,19 +55,12 @@ export class AbstractContainerType extends AbstractType {
|
|
|
42
55
|
};
|
|
43
56
|
}
|
|
44
57
|
get itemValidationFunctionDefault() {
|
|
45
|
-
return new
|
|
46
|
-
}
|
|
47
|
-
get schemaInitializers() {
|
|
48
|
-
const initializers = super.schemaInitializers.concat();
|
|
49
|
-
if (this.recursive || this.referencesNamedType) {
|
|
50
|
-
initializers.push(code `get itemType() { return ${this.itemType.schema}; }`);
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
initializers.push(code `itemType: ${this.itemType.schema}`);
|
|
54
|
-
}
|
|
55
|
-
return initializers;
|
|
58
|
+
return new BuiltinCallable(this.reusables.snippets.identityValidationFunction);
|
|
56
59
|
}
|
|
57
60
|
}
|
|
61
|
+
__decorate([
|
|
62
|
+
Memoize()
|
|
63
|
+
], AbstractContainerType.prototype, "schema", null);
|
|
58
64
|
__decorate([
|
|
59
65
|
Memoize()
|
|
60
66
|
], AbstractContainerType.prototype, "itemConversionFunctionDefault", null);
|
|
@@ -62,7 +68,7 @@ __decorate([
|
|
|
62
68
|
Memoize()
|
|
63
69
|
], AbstractContainerType.prototype, "itemValidationFunctionDefault", null);
|
|
64
70
|
(function (AbstractContainerType) {
|
|
65
|
-
AbstractContainerType.GraphqlType =
|
|
71
|
+
AbstractContainerType.GraphqlType = AbstractBuiltinType.GraphqlType;
|
|
66
72
|
function isItemType(type) {
|
|
67
73
|
switch (type.kind) {
|
|
68
74
|
case "BigDecimal":
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Maybe } from "purify-ts";
|
|
2
2
|
import { AbstractTypedLiteralType } from "./AbstractTypedLiteralType.js";
|
|
3
|
-
import {
|
|
3
|
+
import { BuiltinCallable } from "./BuiltinCallable.js";
|
|
4
|
+
import { SchemaObject } from "./SchemaObject.js";
|
|
4
5
|
import { type Code } from "./ts-poet-wrapper.js";
|
|
5
6
|
export declare abstract class AbstractDateType extends AbstractTypedLiteralType<Date> {
|
|
6
7
|
protected readonly inlineExpression: Code;
|
|
@@ -9,17 +10,17 @@ export declare abstract class AbstractDateType extends AbstractTypedLiteralType<
|
|
|
9
10
|
* Date has no conversion function to avoid source type overlap with other types (e.g., string).
|
|
10
11
|
*/
|
|
11
12
|
readonly conversionFunction: Maybe<AbstractTypedLiteralType.ConversionFunction>;
|
|
12
|
-
readonly equalsFunction:
|
|
13
|
-
readonly filterFunction:
|
|
13
|
+
readonly equalsFunction: BuiltinCallable;
|
|
14
|
+
readonly filterFunction: BuiltinCallable;
|
|
14
15
|
readonly filterType: Code;
|
|
15
|
-
readonly fromJsonValueFunction:
|
|
16
|
+
readonly fromJsonValueFunction: BuiltinCallable;
|
|
16
17
|
readonly jsTypes: readonly [{
|
|
17
18
|
readonly instanceof: "Date";
|
|
18
19
|
readonly typeof: "object";
|
|
19
20
|
}];
|
|
20
|
-
readonly
|
|
21
|
-
readonly valueSparqlWherePatternsFunction: ReferenceCallable;
|
|
21
|
+
readonly valueSparqlWherePatternsFunction: BuiltinCallable;
|
|
22
22
|
get jsonValueType(): AbstractTypedLiteralType.JsonType;
|
|
23
|
+
get schema(): SchemaObject<SchemaObject.BuiltinType>;
|
|
23
24
|
toLoggableExpression({ variables, }: Parameters<AbstractTypedLiteralType<Date>["toLoggableExpression"]>[0]): Code;
|
|
24
25
|
toRdfResourceValuesExpression({ variables, }: Parameters<AbstractTypedLiteralType<Date>["toRdfResourceValuesExpression"]>[0]): Code;
|
|
25
26
|
}
|
|
@@ -7,7 +7,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { Maybe } from "purify-ts";
|
|
8
8
|
import { Memoize } from "typescript-memoize";
|
|
9
9
|
import { AbstractTypedLiteralType } from "./AbstractTypedLiteralType.js";
|
|
10
|
-
import {
|
|
10
|
+
import { BuiltinCallable } from "./BuiltinCallable.js";
|
|
11
|
+
import { SchemaObject } from "./SchemaObject.js";
|
|
11
12
|
import { code } from "./ts-poet-wrapper.js";
|
|
12
13
|
export class AbstractDateType extends AbstractTypedLiteralType {
|
|
13
14
|
inlineExpression = code `Date`;
|
|
@@ -15,23 +16,29 @@ export class AbstractDateType extends AbstractTypedLiteralType {
|
|
|
15
16
|
* Date has no conversion function to avoid source type overlap with other types (e.g., string).
|
|
16
17
|
*/
|
|
17
18
|
conversionFunction = Maybe.empty();
|
|
18
|
-
equalsFunction = new
|
|
19
|
-
filterFunction = new
|
|
19
|
+
equalsFunction = new BuiltinCallable(this.reusables.snippets.dateEquals);
|
|
20
|
+
filterFunction = new BuiltinCallable(this.reusables.snippets.filterDate);
|
|
20
21
|
filterType = code `${this.reusables.snippets.DateFilter}`;
|
|
21
|
-
fromJsonValueFunction = new
|
|
22
|
+
fromJsonValueFunction = new BuiltinCallable(this.reusables.snippets.dateFromJsonString);
|
|
22
23
|
jsTypes = [
|
|
23
24
|
{
|
|
24
25
|
instanceof: "Date",
|
|
25
26
|
typeof: "object",
|
|
26
27
|
},
|
|
27
28
|
];
|
|
28
|
-
|
|
29
|
-
valueSparqlWherePatternsFunction = new ReferenceCallable(this.reusables.snippets.dateSparqlWherePatterns);
|
|
29
|
+
valueSparqlWherePatternsFunction = new BuiltinCallable(this.reusables.snippets.dateSparqlWherePatterns);
|
|
30
30
|
get jsonValueType() {
|
|
31
31
|
return this.jsonTypeFactory.createJsonStringType({
|
|
32
32
|
format: this.jsonStringFormat,
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
|
+
get schema() {
|
|
36
|
+
return new SchemaObject({
|
|
37
|
+
properties: super.schema.properties,
|
|
38
|
+
type: new SchemaObject.BuiltinType(this.reusables.snippets.DateSchema),
|
|
39
|
+
variable: super.schema.variable,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
35
42
|
toLoggableExpression({ variables, }) {
|
|
36
43
|
return code `${variables.value}.toISOString()`;
|
|
37
44
|
}
|
|
@@ -42,4 +49,7 @@ export class AbstractDateType extends AbstractTypedLiteralType {
|
|
|
42
49
|
__decorate([
|
|
43
50
|
Memoize()
|
|
44
51
|
], AbstractDateType.prototype, "jsonValueType", null);
|
|
52
|
+
__decorate([
|
|
53
|
+
Memoize()
|
|
54
|
+
], AbstractDateType.prototype, "schema", null);
|
|
45
55
|
//# sourceMappingURL=AbstractDateType.js.map
|
|
@@ -6,7 +6,6 @@ import { AbstractDiscriminatedUnionType_filterTypeExpression } from "./_Abstract
|
|
|
6
6
|
import { AbstractDiscriminatedUnionType_fromJsonObjectFunctionExpression } from "./_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_fromJsonObjectFunction.js";
|
|
7
7
|
import { AbstractDiscriminatedUnionType_fromRdfResourceValuesFunctionExpression } from "./_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_fromRdfResourceValuesFunction.js";
|
|
8
8
|
import { AbstractDiscriminatedUnionType_hashFunctionExpression } from "./_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_hashFunction.js";
|
|
9
|
-
import { AbstractDiscriminatedUnionType_schemaTypeExpression } from "./_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_schemaTypeExpression.js";
|
|
10
9
|
import { AbstractDiscriminatedUnionType_toJsonObjectFunctionExpression } from "./_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_toJsonObjectFunction.js";
|
|
11
10
|
import { AbstractDiscriminatedUnionType_toLoggableFunctionExpression } from "./_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_toLoggableFunction.js";
|
|
12
11
|
import { AbstractDiscriminatedUnionType_toRdfResourceValuesFunctionExpression } from "./_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_toRdfResourceValuesFunction.js";
|
|
@@ -15,6 +14,7 @@ import { AbstractDiscriminatedUnionType_valueSparqlConstructTriplesFunctionExpre
|
|
|
15
14
|
import { AbstractDiscriminatedUnionType_valueSparqlWherePatternsFunctionExpression } from "./_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_valueSparqlWherePatternsFunction.js";
|
|
16
15
|
import { AbstractCompoundType } from "./AbstractCompoundType.js";
|
|
17
16
|
import type { ObjectType } from "./ObjectType.js";
|
|
17
|
+
import { SchemaObject } from "./SchemaObject.js";
|
|
18
18
|
import type { Type } from "./Type.js";
|
|
19
19
|
import { type Code } from "./ts-poet-wrapper.js";
|
|
20
20
|
export declare abstract class AbstractDiscriminatedUnionType<MemberTypeT extends Type> extends AbstractCompoundType<AbstractDiscriminatedUnionType.Member<MemberTypeT>, MemberTypeT> {
|
|
@@ -25,7 +25,6 @@ export declare abstract class AbstractDiscriminatedUnionType<MemberTypeT extends
|
|
|
25
25
|
protected fromJsonObjectFunctionExpression: typeof AbstractDiscriminatedUnionType_fromJsonObjectFunctionExpression;
|
|
26
26
|
protected fromRdfResourceValuesFunctionExpression: typeof AbstractDiscriminatedUnionType_fromRdfResourceValuesFunctionExpression;
|
|
27
27
|
protected hashFunctionExpression: typeof AbstractDiscriminatedUnionType_hashFunctionExpression;
|
|
28
|
-
protected schemaTypeExpression: typeof AbstractDiscriminatedUnionType_schemaTypeExpression;
|
|
29
28
|
protected toJsonObjectFunctionExpression: typeof AbstractDiscriminatedUnionType_toJsonObjectFunctionExpression;
|
|
30
29
|
protected toLoggableFunctionExpression: typeof AbstractDiscriminatedUnionType_toLoggableFunctionExpression;
|
|
31
30
|
protected toRdfResourceValuesFunctionExpression: typeof AbstractDiscriminatedUnionType_toRdfResourceValuesFunctionExpression;
|
|
@@ -53,7 +52,7 @@ export declare abstract class AbstractDiscriminatedUnionType<MemberTypeT extends
|
|
|
53
52
|
get jsTypes(): AbstractCompoundType<AbstractDiscriminatedUnionType.Member<MemberTypeT>, MemberTypeT>["jsTypes"];
|
|
54
53
|
get members(): readonly AbstractDiscriminatedUnionType.Member<MemberTypeT>[];
|
|
55
54
|
protected get inlineExpression(): Code;
|
|
56
|
-
|
|
55
|
+
get schema(): SchemaObject<SchemaObject.UserDefinedType>;
|
|
57
56
|
private get conversionFunctionExpression();
|
|
58
57
|
protected staticModuleDeclarations(name: string): Record<string, Code>;
|
|
59
58
|
private readonly lazyMembers;
|
|
@@ -16,7 +16,6 @@ import { AbstractDiscriminatedUnionType_fromRdfResourceValuesFunctionExpression
|
|
|
16
16
|
import { AbstractDiscriminatedUnionType_hashFunctionExpression } from "./_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_hashFunction.js";
|
|
17
17
|
import { AbstractDiscriminatedUnionType_inferDiscriminant } from "./_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_inferDiscriminant.js";
|
|
18
18
|
import { AbstractDiscriminatedUnionType_inlineExpression } from "./_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_inlineExpression.js";
|
|
19
|
-
import { AbstractDiscriminatedUnionType_schemaTypeExpression } from "./_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_schemaTypeExpression.js";
|
|
20
19
|
import { AbstractDiscriminatedUnionType_toJsonObjectFunctionExpression } from "./_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_toJsonObjectFunction.js";
|
|
21
20
|
import { AbstractDiscriminatedUnionType_toLoggableFunctionExpression } from "./_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_toLoggableFunction.js";
|
|
22
21
|
import { AbstractDiscriminatedUnionType_toRdfResourceValuesFunctionExpression } from "./_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_toRdfResourceValuesFunction.js";
|
|
@@ -24,6 +23,7 @@ import { AbstractDiscriminatedUnionType_toStringFunctionExpression } from "./_Ab
|
|
|
24
23
|
import { AbstractDiscriminatedUnionType_valueSparqlConstructTriplesFunctionExpression } from "./_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_valueSparqlConstructTriplesFunction.js";
|
|
25
24
|
import { AbstractDiscriminatedUnionType_valueSparqlWherePatternsFunctionExpression } from "./_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_valueSparqlWherePatternsFunction.js";
|
|
26
25
|
import { AbstractCompoundType } from "./AbstractCompoundType.js";
|
|
26
|
+
import { SchemaObject } from "./SchemaObject.js";
|
|
27
27
|
import { code, joinCode, literalOf } from "./ts-poet-wrapper.js";
|
|
28
28
|
export class AbstractDiscriminatedUnionType extends AbstractCompoundType {
|
|
29
29
|
discriminant;
|
|
@@ -33,7 +33,6 @@ export class AbstractDiscriminatedUnionType extends AbstractCompoundType {
|
|
|
33
33
|
fromJsonObjectFunctionExpression = AbstractDiscriminatedUnionType_fromJsonObjectFunctionExpression;
|
|
34
34
|
fromRdfResourceValuesFunctionExpression = AbstractDiscriminatedUnionType_fromRdfResourceValuesFunctionExpression;
|
|
35
35
|
hashFunctionExpression = AbstractDiscriminatedUnionType_hashFunctionExpression;
|
|
36
|
-
schemaTypeExpression = AbstractDiscriminatedUnionType_schemaTypeExpression;
|
|
37
36
|
toJsonObjectFunctionExpression = AbstractDiscriminatedUnionType_toJsonObjectFunctionExpression;
|
|
38
37
|
toLoggableFunctionExpression = AbstractDiscriminatedUnionType_toLoggableFunctionExpression;
|
|
39
38
|
toRdfResourceValuesFunctionExpression = AbstractDiscriminatedUnionType_toRdfResourceValuesFunctionExpression;
|
|
@@ -224,11 +223,27 @@ export class AbstractDiscriminatedUnionType extends AbstractCompoundType {
|
|
|
224
223
|
get inlineExpression() {
|
|
225
224
|
return AbstractDiscriminatedUnionType_inlineExpression.call(this);
|
|
226
225
|
}
|
|
227
|
-
get
|
|
228
|
-
return
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
226
|
+
get schema() {
|
|
227
|
+
return new SchemaObject({
|
|
228
|
+
properties: {
|
|
229
|
+
...super.schema.properties,
|
|
230
|
+
members: code `members: { ${joinCode(this.members.map(({ discriminantValues, type, primaryDiscriminantValue }) => code `${literalOf(primaryDiscriminantValue)}: ${{
|
|
231
|
+
discriminantValues: discriminantValues,
|
|
232
|
+
type: type.schema.expression,
|
|
233
|
+
}}`), { on: "," })} }`,
|
|
234
|
+
},
|
|
235
|
+
type: new SchemaObject.UserDefinedType({
|
|
236
|
+
members: {
|
|
237
|
+
...super.schema.type.members,
|
|
238
|
+
members: code `members: { ${joinCode(this.members.map(({ type, primaryDiscriminantValue }) => code `readonly ${literalOf(primaryDiscriminantValue)}: ${{
|
|
239
|
+
discriminantValues: code `readonly (number | string)[]`,
|
|
240
|
+
type: type.schema.type.expression,
|
|
241
|
+
}}`), { on: ";" })} }`,
|
|
242
|
+
},
|
|
243
|
+
name: super.schema.type.name,
|
|
244
|
+
}),
|
|
245
|
+
variable: super.schema.variable,
|
|
246
|
+
});
|
|
232
247
|
}
|
|
233
248
|
get conversionFunctionExpression() {
|
|
234
249
|
return AbstractDiscriminatedUnionType_conversionFunctionExpression.call(this);
|
|
@@ -266,6 +281,9 @@ __decorate([
|
|
|
266
281
|
__decorate([
|
|
267
282
|
Memoize()
|
|
268
283
|
], AbstractDiscriminatedUnionType.prototype, "inlineExpression", null);
|
|
284
|
+
__decorate([
|
|
285
|
+
Memoize()
|
|
286
|
+
], AbstractDiscriminatedUnionType.prototype, "schema", null);
|
|
269
287
|
__decorate([
|
|
270
288
|
Memoize()
|
|
271
289
|
], AbstractDiscriminatedUnionType.prototype, "conversionFunctionExpression", null);
|
|
@@ -8,6 +8,7 @@ import { AbstractIntersectionType_valueSparqlConstructTriplesFunctionExpression
|
|
|
8
8
|
import { AbstractIntersectionType_valueSparqlWherePatternsFunctionExpression } from "./_AbstractIntersectionType/AbstractIntersectionType_valueSparqlWherePatternsFunction.js";
|
|
9
9
|
import { AbstractCompoundType } from "./AbstractCompoundType.js";
|
|
10
10
|
import type { ObjectType } from "./ObjectType.js";
|
|
11
|
+
import { SchemaObject } from "./SchemaObject.js";
|
|
11
12
|
import type { Type } from "./Type.js";
|
|
12
13
|
import { type Code } from "./ts-poet-wrapper.js";
|
|
13
14
|
export declare abstract class AbstractIntersectionType<MemberTypeT extends Type> extends AbstractCompoundType<AbstractIntersectionType.Member<MemberTypeT>, MemberTypeT> {
|
|
@@ -34,9 +35,8 @@ export declare abstract class AbstractIntersectionType<MemberTypeT extends Type>
|
|
|
34
35
|
get graphqlType(): AbstractCompoundType.GraphqlType;
|
|
35
36
|
get jsTypes(): AbstractCompoundType<AbstractIntersectionType.Member<MemberTypeT>, MemberTypeT>["jsTypes"];
|
|
36
37
|
protected get inlineExpression(): Code;
|
|
37
|
-
|
|
38
|
+
get schema(): SchemaObject<SchemaObject.UserDefinedType>;
|
|
38
39
|
protected filterTypeExpression(): Code;
|
|
39
|
-
protected schemaTypeExpression(): Code;
|
|
40
40
|
}
|
|
41
41
|
export declare namespace AbstractIntersectionType {
|
|
42
42
|
type DiscriminatedType = AbstractCompoundType.DiscriminatedType;
|
|
@@ -15,6 +15,7 @@ import { AbstractIntersectionType_toStringFunctionExpression } from "./_Abstract
|
|
|
15
15
|
import { AbstractIntersectionType_valueSparqlConstructTriplesFunctionExpression } from "./_AbstractIntersectionType/AbstractIntersectionType_valueSparqlConstructTriplesFunction.js";
|
|
16
16
|
import { AbstractIntersectionType_valueSparqlWherePatternsFunctionExpression } from "./_AbstractIntersectionType/AbstractIntersectionType_valueSparqlWherePatternsFunction.js";
|
|
17
17
|
import { AbstractCompoundType } from "./AbstractCompoundType.js";
|
|
18
|
+
import { SchemaObject } from "./SchemaObject.js";
|
|
18
19
|
import { code, joinCode } from "./ts-poet-wrapper.js";
|
|
19
20
|
export class AbstractIntersectionType extends AbstractCompoundType {
|
|
20
21
|
equalsFunctionExpression = AbstractIntersectionType_equalsFunctionExpression;
|
|
@@ -55,18 +56,25 @@ export class AbstractIntersectionType extends AbstractCompoundType {
|
|
|
55
56
|
get inlineExpression() {
|
|
56
57
|
return joinCode(this.members.map((member) => member.type.expression), { on: " & " });
|
|
57
58
|
}
|
|
58
|
-
get
|
|
59
|
-
return
|
|
59
|
+
get schema() {
|
|
60
|
+
return new SchemaObject({
|
|
61
|
+
properties: {
|
|
62
|
+
...super.schema.properties,
|
|
63
|
+
members: code `members: [${joinCode(this.members.map(({ type }) => type.schema.expression), { on: "," })}] as const`,
|
|
64
|
+
},
|
|
65
|
+
type: new SchemaObject.UserDefinedType({
|
|
66
|
+
members: {
|
|
67
|
+
...super.schema.type.members,
|
|
68
|
+
members: code `members: [${joinCode(this.members.map(({ type }) => type.schema.type.expression), { on: ", " })}]`,
|
|
69
|
+
},
|
|
70
|
+
name: super.schema.type.name,
|
|
71
|
+
}),
|
|
72
|
+
variable: super.schema.variable,
|
|
73
|
+
});
|
|
60
74
|
}
|
|
61
75
|
filterTypeExpression() {
|
|
62
76
|
return joinCode(this.members.map(({ type }) => type.filterType), { on: " & " });
|
|
63
77
|
}
|
|
64
|
-
schemaTypeExpression() {
|
|
65
|
-
return code `${{
|
|
66
|
-
kind: this.kind,
|
|
67
|
-
members: code `[${joinCode(this.members.map(({ type }) => type.schemaType), { on: ", " })}]`,
|
|
68
|
-
}}`;
|
|
69
|
-
}
|
|
70
78
|
}
|
|
71
79
|
__decorate([
|
|
72
80
|
Memoize()
|
|
@@ -77,4 +85,7 @@ __decorate([
|
|
|
77
85
|
__decorate([
|
|
78
86
|
Memoize()
|
|
79
87
|
], AbstractIntersectionType.prototype, "inlineExpression", null);
|
|
88
|
+
__decorate([
|
|
89
|
+
Memoize()
|
|
90
|
+
], AbstractIntersectionType.prototype, "schema", null);
|
|
80
91
|
//# sourceMappingURL=AbstractIntersectionType.js.map
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AbstractBuiltinType } from "./AbstractBuiltinType.js";
|
|
2
2
|
import type { Callable } from "./Callable.js";
|
|
3
3
|
import type { ObjectDiscriminatedUnionType } from "./ObjectDiscriminatedUnionType.js";
|
|
4
4
|
import type { ObjectType } from "./ObjectType.js";
|
|
5
5
|
import type { OptionType } from "./OptionType.js";
|
|
6
|
+
import { SchemaObject } from "./SchemaObject.js";
|
|
6
7
|
import type { SetType } from "./SetType.js";
|
|
7
8
|
import { type Code } from "./ts-poet-wrapper.js";
|
|
8
|
-
export declare abstract class AbstractLazyType<PartialTypeT extends AbstractLazyType.PartialTypeConstraint, ResolveTypeT extends AbstractLazyType.ResolveTypeConstraint> extends
|
|
9
|
+
export declare abstract class AbstractLazyType<PartialTypeT extends AbstractLazyType.PartialTypeConstraint, ResolveTypeT extends AbstractLazyType.ResolveTypeConstraint> extends AbstractBuiltinType {
|
|
9
10
|
protected abstract readonly partialItemType: AbstractLazyType.ItemTypeConstraint;
|
|
10
11
|
protected abstract readonly resolveItemType: AbstractLazyType.ItemTypeConstraint;
|
|
11
12
|
protected abstract readonly runtimeClass: {
|
|
@@ -13,40 +14,39 @@ export declare abstract class AbstractLazyType<PartialTypeT extends AbstractLazy
|
|
|
13
14
|
readonly partialPropertyName: string;
|
|
14
15
|
readonly rawName: Code;
|
|
15
16
|
};
|
|
16
|
-
readonly discriminatedType:
|
|
17
|
+
readonly discriminatedType: AbstractBuiltinType["discriminatedType"];
|
|
17
18
|
abstract readonly kind: "Lazy" | "LazyOption" | "LazySet";
|
|
18
19
|
readonly mutable = false;
|
|
19
20
|
readonly partialType: PartialTypeT;
|
|
20
21
|
readonly resolveType: ResolveTypeT;
|
|
21
|
-
readonly validationFunction:
|
|
22
|
+
readonly validationFunction: AbstractBuiltinType["validationFunction"];
|
|
22
23
|
constructor({ partialType, resolveType, ...superParameters }: {
|
|
23
24
|
partialType: PartialTypeT;
|
|
24
25
|
resolveType: ResolveTypeT;
|
|
25
|
-
} & ConstructorParameters<typeof
|
|
26
|
+
} & ConstructorParameters<typeof AbstractBuiltinType>[0]);
|
|
26
27
|
get equalsFunction(): Callable;
|
|
27
28
|
get filterFunction(): Callable;
|
|
28
29
|
get filterType(): Code;
|
|
29
|
-
get fromJsonObjectFunction():
|
|
30
|
-
get fromJsonValueFunction():
|
|
30
|
+
get fromJsonObjectFunction(): AbstractBuiltinType["fromJsonObjectFunction"];
|
|
31
|
+
get fromJsonValueFunction(): AbstractBuiltinType["fromJsonValueFunction"];
|
|
31
32
|
get fromRdfResourceValuesFunction(): Callable;
|
|
32
|
-
get graphqlType():
|
|
33
|
+
get graphqlType(): AbstractBuiltinType.GraphqlType;
|
|
33
34
|
get hashFunction(): Callable;
|
|
34
35
|
get inlineExpression(): Code;
|
|
35
|
-
get jsTypes(): readonly
|
|
36
|
-
get jsonObjectType():
|
|
37
|
-
get jsonValueType():
|
|
36
|
+
get jsTypes(): readonly AbstractBuiltinType.JsType[];
|
|
37
|
+
get jsonObjectType(): AbstractBuiltinType["jsonObjectType"];
|
|
38
|
+
get jsonValueType(): AbstractBuiltinType["jsonValueType"];
|
|
38
39
|
get recursive(): boolean;
|
|
39
40
|
get referencesNamedType(): boolean;
|
|
40
|
-
get
|
|
41
|
-
get
|
|
42
|
-
get
|
|
43
|
-
get toRdfResourceValueTypes(): AbstractType["toRdfResourceValueTypes"];
|
|
41
|
+
get toJsonObjectFunction(): AbstractBuiltinType["toJsonObjectFunction"];
|
|
42
|
+
get toJsonValueFunction(): AbstractBuiltinType["toJsonValueFunction"];
|
|
43
|
+
get toRdfResourceValueTypes(): AbstractBuiltinType["toRdfResourceValueTypes"];
|
|
44
44
|
get valueSparqlConstructTriplesFunction(): Callable;
|
|
45
45
|
get valueSparqlWherePatternsFunction(): Callable;
|
|
46
|
-
|
|
47
|
-
toLoggableExpression({ variables, }: Parameters<
|
|
48
|
-
toRdfResourceValuesExpression({ variables, }: Parameters<
|
|
49
|
-
toStringExpression({ variables, }: Parameters<
|
|
46
|
+
get schema(): SchemaObject<SchemaObject.AbstractType | SchemaObject.BuiltinType>;
|
|
47
|
+
toLoggableExpression({ variables, }: Parameters<AbstractBuiltinType["toLoggableExpression"]>[0]): Code;
|
|
48
|
+
toRdfResourceValuesExpression({ variables, }: Parameters<AbstractBuiltinType["toRdfResourceValuesExpression"]>[0]): Code;
|
|
49
|
+
toStringExpression({ variables, }: Parameters<AbstractBuiltinType["toStringExpression"]>[0]): Code;
|
|
50
50
|
protected abstract objectSetResolveExpression(parameters: {
|
|
51
51
|
variables: {
|
|
52
52
|
objectSet: Code;
|
|
@@ -75,10 +75,10 @@ export declare namespace AbstractLazyType {
|
|
|
75
75
|
type ItemTypeConstraint = ObjectType | ObjectDiscriminatedUnionType;
|
|
76
76
|
type PartialTypeConstraint = ItemTypeConstraint | OptionType<ItemTypeConstraint> | SetType<ItemTypeConstraint>;
|
|
77
77
|
type ResolveTypeConstraint = PartialTypeConstraint;
|
|
78
|
-
type ConversionFunction =
|
|
79
|
-
type DiscriminatedType =
|
|
78
|
+
type ConversionFunction = AbstractBuiltinType.ConversionFunction;
|
|
79
|
+
type DiscriminatedType = AbstractBuiltinType.DiscriminatedType;
|
|
80
80
|
const GraphqlType: typeof import("./_AbstractType/AbstractType_GraphqlType.js").AbstractType_GraphqlType;
|
|
81
|
-
type GraphqlType =
|
|
82
|
-
type JsonType =
|
|
81
|
+
type GraphqlType = AbstractBuiltinType.GraphqlType;
|
|
82
|
+
type JsonType = AbstractBuiltinType.JsonType;
|
|
83
83
|
}
|
|
84
84
|
//# sourceMappingURL=AbstractLazyType.d.ts.map
|