@shaclmate/compiler 4.0.33 → 4.0.35
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/Compiler.d.ts +0 -3
- package/dist/Compiler.js +0 -2
- package/dist/ShapesGraphToAstTransformer.d.ts +1 -4
- package/dist/ShapesGraphToAstTransformer.js +1 -5
- package/dist/_ShapesGraphToAstTransformer/transformPropertyShapeToAstObjectTypeProperty.js +1 -3
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstCompoundType.js +4 -7
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.js +0 -1
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstObjectType.js +1 -3
- package/dist/ast/AbstractCompoundType.d.ts +6 -4
- package/dist/ast/AbstractCompoundType.js +4 -37
- package/dist/ast/ObjectType.d.ts +1 -7
- package/dist/ast/ObjectType.js +1 -6
- package/dist/generators/ts/AbstractCollectionType.d.ts +9 -8
- package/dist/generators/ts/AbstractCollectionType.js +38 -120
- package/dist/generators/ts/AbstractContainerType.d.ts +3 -1
- package/dist/generators/ts/AbstractContainerType.js +20 -0
- package/dist/generators/ts/AbstractDateType.d.ts +5 -10
- package/dist/generators/ts/AbstractDateType.js +5 -32
- package/dist/generators/ts/AbstractIdentifierType.d.ts +4 -1
- package/dist/generators/ts/AbstractIdentifierType.js +0 -17
- package/dist/generators/ts/AbstractLazyObjectType.d.ts +9 -5
- package/dist/generators/ts/AbstractLazyObjectType.js +22 -21
- package/dist/generators/ts/AbstractLiteralType.d.ts +12 -4
- package/dist/generators/ts/AbstractLiteralType.js +3 -3
- package/dist/generators/ts/AbstractNamedUnionType.d.ts +2 -5
- package/dist/generators/ts/AbstractNamedUnionType.js +27 -58
- package/dist/generators/ts/AbstractNumericType.d.ts +3 -9
- package/dist/generators/ts/AbstractNumericType.js +6 -13
- package/dist/generators/ts/AbstractPrimitiveType.d.ts +9 -4
- package/dist/generators/ts/AbstractPrimitiveType.js +11 -18
- package/dist/generators/ts/AbstractTermType.d.ts +10 -5
- package/dist/generators/ts/AbstractTermType.js +14 -53
- package/dist/generators/ts/AbstractType.d.ts +39 -24
- package/dist/generators/ts/AbstractType.js +4 -2
- package/dist/generators/ts/AbstractUnionType.d.ts +3 -2
- package/dist/generators/ts/AbstractUnionType.js +29 -39
- package/dist/generators/ts/AnonymousUnionType.d.ts +1 -1
- package/dist/generators/ts/AnonymousUnionType.js +3 -3
- package/dist/generators/ts/BigDecimalType.d.ts +7 -4
- package/dist/generators/ts/BigDecimalType.js +11 -45
- package/dist/generators/ts/BigIntType.d.ts +3 -4
- package/dist/generators/ts/BigIntType.js +6 -17
- package/dist/generators/ts/BlankNodeType.d.ts +8 -7
- package/dist/generators/ts/BlankNodeType.js +18 -5
- package/dist/generators/ts/BooleanType.d.ts +6 -9
- package/dist/generators/ts/BooleanType.js +9 -16
- package/dist/generators/ts/DateTimeType.d.ts +4 -1
- package/dist/generators/ts/DateTimeType.js +6 -13
- package/dist/generators/ts/DateType.d.ts +4 -1
- package/dist/generators/ts/DateType.js +7 -14
- package/dist/generators/ts/DefaultValueType.d.ts +6 -6
- package/dist/generators/ts/DefaultValueType.js +30 -63
- package/dist/generators/ts/FloatType.d.ts +3 -3
- package/dist/generators/ts/FloatType.js +5 -5
- package/dist/generators/ts/IdentifierType.d.ts +7 -6
- package/dist/generators/ts/IdentifierType.js +26 -5
- package/dist/generators/ts/IntType.d.ts +3 -3
- package/dist/generators/ts/IntType.js +5 -5
- package/dist/generators/ts/IriType.d.ts +9 -12
- package/dist/generators/ts/IriType.js +43 -32
- package/dist/generators/ts/LazyObjectOptionType.d.ts +2 -1
- package/dist/generators/ts/LazyObjectOptionType.js +23 -44
- package/dist/generators/ts/LazyObjectSetType.d.ts +2 -1
- package/dist/generators/ts/LazyObjectSetType.js +19 -29
- package/dist/generators/ts/LazyObjectType.d.ts +2 -1
- package/dist/generators/ts/LazyObjectType.js +18 -26
- package/dist/generators/ts/LiteralType.d.ts +6 -3
- package/dist/generators/ts/LiteralType.js +27 -13
- package/dist/generators/ts/NamedObjectType.d.ts +7 -9
- package/dist/generators/ts/NamedObjectType.js +24 -32
- package/dist/generators/ts/NamedObjectUnionType.d.ts +3 -1
- package/dist/generators/ts/NamedObjectUnionType.js +21 -14
- package/dist/generators/ts/OptionType.d.ts +6 -5
- package/dist/generators/ts/OptionType.js +31 -51
- package/dist/generators/ts/Reusables.d.ts +3 -1
- package/dist/generators/ts/Reusables.js +2 -1
- package/dist/generators/ts/SetType.d.ts +0 -1
- package/dist/generators/ts/SetType.js +4 -22
- package/dist/generators/ts/SnippetFactory.d.ts +2 -0
- package/dist/generators/ts/Snippets.d.ts +36 -8
- package/dist/generators/ts/Snippets.js +207 -30
- package/dist/generators/ts/StringType.d.ts +6 -10
- package/dist/generators/ts/StringType.js +8 -21
- package/dist/generators/ts/TermType.d.ts +2 -4
- package/dist/generators/ts/TermType.js +6 -10
- package/dist/generators/ts/TsGenerator.d.ts +14 -1
- package/dist/generators/ts/TsGenerator.js +41 -12
- package/dist/generators/ts/TypeFactory.d.ts +8 -4
- package/dist/generators/ts/TypeFactory.js +73 -49
- package/dist/generators/ts/ZodGenerator.js +6 -3
- package/dist/generators/ts/_NamedObjectType/AbstractProperty.d.ts +27 -20
- package/dist/generators/ts/_NamedObjectType/AbstractProperty.js +4 -2
- package/dist/generators/ts/_NamedObjectType/DiscriminantProperty.d.ts +7 -7
- package/dist/generators/ts/_NamedObjectType/DiscriminantProperty.js +9 -9
- package/dist/generators/ts/_NamedObjectType/IdentifierProperty.d.ts +6 -6
- package/dist/generators/ts/_NamedObjectType/IdentifierProperty.js +36 -39
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_createFunctionDeclaration.js +34 -31
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_equalsFunctionDeclaration.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromJsonFunctionDeclaration.js +31 -19
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceFunctionDeclaration.js +30 -36
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceValuesFunctionDeclaration.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfTypeVariableStatement.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_graphqlTypeVariableStatement.js +2 -3
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_hashFunctionDeclarations.js +6 -8
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_isTypeFunctionDeclaration.js +1 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonParseFunctionDeclaration.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonSchemaFunctionDeclaration.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonTypeAliasDeclaration.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonUiSchemaFunctionDeclaration.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_objectSetMethodNames.d.ts +2 -0
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_objectSetMethodNames.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_sparqlConstructQueryFunctionDeclaration.d.ts +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_sparqlConstructQueryFunctionDeclaration.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_toJsonFunctionDeclaration.js +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_toRdfResourceFunctionDeclaration.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_toStringFunctionDeclarations.js +14 -18
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_valueSparqlWherePatternsFunctionDeclaration.js +1 -1
- package/dist/generators/ts/_NamedObjectType/ShaclProperty.d.ts +7 -7
- package/dist/generators/ts/_NamedObjectType/ShaclProperty.js +41 -29
- package/dist/generators/ts/_snippets/snippets_ConversionFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_ConversionFunction.js +4 -0
- package/dist/generators/ts/_snippets/snippets_DefaultValueSchema.js +3 -3
- package/dist/generators/ts/_snippets/snippets_HashFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_HashFunction.js +4 -0
- package/dist/generators/ts/_snippets/snippets_PropertyPath.js +34 -24
- package/dist/generators/ts/_snippets/snippets_ValidationFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_ValidationFunction.js +4 -0
- package/dist/generators/ts/_snippets/snippets_convertToArray.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToArray.js +8 -0
- package/dist/generators/ts/_snippets/snippets_convertToBlankNode.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToBlankNode.js +11 -0
- package/dist/generators/ts/_snippets/snippets_convertToBlankNodeIdentifierProperty.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToBlankNodeIdentifierProperty.js +17 -0
- package/dist/generators/ts/_snippets/snippets_convertToIdentifier.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToIdentifier.js +13 -0
- package/dist/generators/ts/_snippets/snippets_convertToIdentifierProperty.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToIdentifierProperty.js +21 -0
- package/dist/generators/ts/_snippets/snippets_convertToIri.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToIri.js +11 -0
- package/dist/generators/ts/_snippets/snippets_convertToIriIdentifierProperty.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToIriIdentifierProperty.js +17 -0
- package/dist/generators/ts/_snippets/snippets_convertToLazyObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToLazyObject.js +15 -0
- package/dist/generators/ts/_snippets/snippets_convertToLazyObjectOption.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToLazyObjectOption.js +31 -0
- package/dist/generators/ts/_snippets/snippets_convertToLazyObjectSet.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToLazyObjectSet.js +25 -0
- package/dist/generators/ts/_snippets/snippets_convertToLiteral.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToLiteral.js +13 -0
- package/dist/generators/ts/_snippets/snippets_convertToMaybe.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToMaybe.js +19 -0
- package/dist/generators/ts/_snippets/snippets_convertWithDefaultValue.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertWithDefaultValue.js +11 -0
- package/dist/generators/ts/_snippets/snippets_defaultValueSparqlWherePatterns.js +1 -1
- package/dist/generators/ts/_snippets/snippets_hashArray.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_hashArray.js +11 -0
- package/dist/generators/ts/_snippets/snippets_hashBigDecimal.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_hashBigDecimal.js +7 -0
- package/dist/generators/ts/_snippets/snippets_hashBoolean.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_hashBoolean.js +7 -0
- package/dist/generators/ts/_snippets/snippets_hashDate.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_hashDate.js +7 -0
- package/dist/generators/ts/_snippets/snippets_hashDateTime.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_hashDateTime.js +7 -0
- package/dist/generators/ts/_snippets/snippets_hashMaybe.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_hashMaybe.js +11 -0
- package/dist/generators/ts/_snippets/snippets_hashNumeric.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_hashNumeric.js +7 -0
- package/dist/generators/ts/_snippets/snippets_hashString.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_hashString.js +7 -0
- package/dist/generators/ts/_snippets/snippets_hashTerm.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_hashTerm.js +12 -0
- package/dist/generators/ts/_snippets/snippets_identityConversionFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_identityConversionFunction.js +6 -0
- package/dist/generators/ts/_snippets/snippets_identityValidationFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_identityValidationFunction.js +6 -0
- package/dist/generators/ts/_snippets/snippets_toIsoDateString.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_toIsoDateString.js +6 -0
- package/dist/generators/ts/_snippets/snippets_validateArray.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_validateArray.js +13 -0
- package/dist/generators/ts/_snippets/snippets_validateMaybe.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_validateMaybe.js +7 -0
- package/dist/generators/ts/graphqlSchemaVariableStatement.d.ts +1 -1
- package/dist/generators/ts/graphqlSchemaVariableStatement.js +7 -4
- package/dist/generators/ts/objectSetDeclarations.js +4 -34
- package/dist/generators/ts/objectSetInterfaceDeclaration.js +1 -1
- package/dist/generators/ts/objectSetMethodSignatures.js +2 -2
- package/dist/generators/ts/rdfjsDatasetObjectSetClassDeclaration.js +2 -2
- package/dist/generators/ts/sparqlObjectSetClassDeclaration.js +2 -2
- package/dist/input/ShapesGraph.d.ts +5 -8
- package/dist/input/ShapesGraph.js +5 -6
- package/dist/input/generated.d.ts +175 -230
- package/dist/input/generated.js +226 -1748
- package/package.json +2 -2
- package/dist/_ShapesGraphToAstTransformer/nodeShapeTsFeatures.d.ts +0 -6
- package/dist/_ShapesGraphToAstTransformer/nodeShapeTsFeatures.js +0 -67
- package/dist/generators/ts/_snippets/snippets_isReadonlyBigIntArray.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_isReadonlyBigIntArray.js +0 -6
- package/dist/generators/ts/_snippets/snippets_isReadonlyBooleanArray.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_isReadonlyBooleanArray.js +0 -6
- package/dist/generators/ts/_snippets/snippets_isReadonlyNumberArray.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_isReadonlyNumberArray.js +0 -6
- package/dist/generators/ts/_snippets/snippets_isReadonlyObjectArray.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_isReadonlyObjectArray.js +0 -6
- package/dist/generators/ts/_snippets/snippets_isReadonlyStringArray.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_isReadonlyStringArray.js +0 -6
- package/dist/generators/ts/syntheticNamePrefix.d.ts +0 -2
- package/dist/generators/ts/syntheticNamePrefix.js +0 -2
|
@@ -11,13 +11,13 @@ export declare class AnonymousUnionType extends AbstractUnionType<Type> {
|
|
|
11
11
|
get filterFunction(): Code;
|
|
12
12
|
get filterType(): Code;
|
|
13
13
|
get graphqlType(): AbstractType.GraphqlType;
|
|
14
|
+
get hashFunction(): Code;
|
|
14
15
|
get name(): Code;
|
|
15
16
|
get valueSparqlConstructTriplesFunction(): Code;
|
|
16
17
|
get valueSparqlWherePatternsFunction(): Code;
|
|
17
18
|
fromJsonExpression({ variables, }: Parameters<AbstractType["fromJsonExpression"]>[0]): Code;
|
|
18
19
|
fromRdfResourceValuesExpression({ variables, }: Parameters<AbstractType["fromRdfResourceValuesExpression"]>[0]): Code;
|
|
19
20
|
graphqlResolveExpression(_parameters: Parameters<AbstractType["graphqlResolveExpression"]>[0]): Code;
|
|
20
|
-
hashStatements(parameters: Parameters<AbstractType["hashStatements"]>[0]): readonly Code[];
|
|
21
21
|
jsonSchema(_parameters: Parameters<AbstractType["jsonSchema"]>[0]): Code;
|
|
22
22
|
jsonType(): AbstractType.JsonType;
|
|
23
23
|
toJsonExpression({ variables, }: Parameters<AbstractType["toJsonExpression"]>[0]): Code;
|
|
@@ -17,6 +17,9 @@ export class AnonymousUnionType extends AbstractUnionType {
|
|
|
17
17
|
get graphqlType() {
|
|
18
18
|
throw new Error("GraphQL doesn't support scalar unions");
|
|
19
19
|
}
|
|
20
|
+
get hashFunction() {
|
|
21
|
+
return this.inlineHashFunction;
|
|
22
|
+
}
|
|
20
23
|
get name() {
|
|
21
24
|
return this.inlineName;
|
|
22
25
|
}
|
|
@@ -36,9 +39,6 @@ export class AnonymousUnionType extends AbstractUnionType {
|
|
|
36
39
|
graphqlResolveExpression(_parameters) {
|
|
37
40
|
throw new Error("not implemented");
|
|
38
41
|
}
|
|
39
|
-
hashStatements(parameters) {
|
|
40
|
-
return this.inlineHashStatements(parameters);
|
|
41
|
-
}
|
|
42
42
|
jsonSchema(_parameters) {
|
|
43
43
|
return this.inlineJsonSchema;
|
|
44
44
|
}
|
|
@@ -1,21 +1,24 @@
|
|
|
1
|
+
import type { Literal } from "@rdfjs/types";
|
|
2
|
+
import { Maybe } from "purify-ts";
|
|
1
3
|
import { AbstractLiteralType } from "./AbstractLiteralType.js";
|
|
2
4
|
import { type Code } from "./ts-poet-wrapper.js";
|
|
3
5
|
export declare class BigDecimalType extends AbstractLiteralType {
|
|
6
|
+
readonly name: Code;
|
|
7
|
+
readonly conversionFunction: Maybe<AbstractLiteralType.ConversionFunction>;
|
|
4
8
|
readonly filterFunction: Code;
|
|
5
9
|
readonly filterType: Code;
|
|
10
|
+
readonly hashFunction: Code;
|
|
6
11
|
readonly kind = "BigDecimalType";
|
|
7
|
-
readonly name: Code;
|
|
8
12
|
readonly schemaType: Code;
|
|
9
13
|
readonly valueSparqlWherePatternsFunction: Code;
|
|
10
|
-
get conversions(): readonly AbstractLiteralType.Conversion[];
|
|
11
14
|
get graphqlType(): import("./AbstractType.js").AbstractType.GraphqlType;
|
|
12
15
|
fromJsonExpression({ variables, }: Parameters<AbstractLiteralType["fromJsonExpression"]>[0]): Code;
|
|
13
16
|
graphqlResolveExpression({ variables, }: Parameters<AbstractLiteralType["graphqlResolveExpression"]>[0]): Code;
|
|
14
|
-
hashStatements({ variables, }: Parameters<AbstractLiteralType["hashStatements"]>[0]): readonly Code[];
|
|
15
17
|
jsonSchema(): Code;
|
|
16
18
|
jsonType(): AbstractLiteralType.JsonType;
|
|
19
|
+
literalExpression(literal: Literal): Code;
|
|
17
20
|
toJsonExpression({ variables, }: Parameters<AbstractLiteralType["toJsonExpression"]>[0]): Code;
|
|
18
21
|
toRdfResourceValuesExpression({ variables, }: Parameters<AbstractLiteralType["toRdfResourceValuesExpression"]>[0]): Code;
|
|
19
|
-
protected
|
|
22
|
+
protected fromRdfResourceValuesExpressionChain({ variables, }: Parameters<AbstractLiteralType["fromRdfResourceValuesExpressionChain"]>[0]): ReturnType<AbstractLiteralType["fromRdfResourceValuesExpressionChain"]>;
|
|
20
23
|
}
|
|
21
24
|
//# sourceMappingURL=BigDecimalType.d.ts.map
|
|
@@ -4,84 +4,50 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
+
import { Maybe } from "purify-ts";
|
|
7
8
|
import { Memoize } from "typescript-memoize";
|
|
8
9
|
import { AbstractLiteralType } from "./AbstractLiteralType.js";
|
|
9
|
-
import { code } from "./ts-poet-wrapper.js";
|
|
10
|
+
import { code, literalOf } from "./ts-poet-wrapper.js";
|
|
10
11
|
export class BigDecimalType extends AbstractLiteralType {
|
|
12
|
+
name = code `${this.reusables.imports.BigDecimal}`;
|
|
13
|
+
conversionFunction = Maybe.empty();
|
|
11
14
|
filterFunction = code `${this.reusables.snippets.filterBigDecimal}`;
|
|
12
15
|
filterType = code `${this.reusables.snippets.NumericFilter}<${this.reusables.imports.BigDecimal}>`;
|
|
16
|
+
hashFunction = code `${this.reusables.snippets.hashBigDecimal}`;
|
|
13
17
|
kind = "BigDecimalType";
|
|
14
|
-
name = code `${this.reusables.imports.BigDecimal}`;
|
|
15
18
|
schemaType = code `${this.reusables.snippets.NumericSchema}<${this.reusables.imports.BigDecimal}>`;
|
|
16
19
|
valueSparqlWherePatternsFunction = code `${this.reusables.snippets.bigDecimalSparqlWherePatterns}`;
|
|
17
|
-
get conversions() {
|
|
18
|
-
return [
|
|
19
|
-
// {
|
|
20
|
-
// conversionExpression: (value) =>
|
|
21
|
-
// code`new ${this.reusables.imports.BigDecimal}(${value}.toString())`,
|
|
22
|
-
// sourceTypeCheckExpression: (value) =>
|
|
23
|
-
// code`typeof ${value} === "bigint"`,
|
|
24
|
-
// sourceTypeName: code`bigint`,
|
|
25
|
-
// sourceTypeof: "bigint",
|
|
26
|
-
// },
|
|
27
|
-
{
|
|
28
|
-
conversionExpression: (value) => value,
|
|
29
|
-
sourceTypeCheckExpression: (value) => code `typeof ${value} === "object"`,
|
|
30
|
-
sourceTypeName: code `${this.reusables.imports.BigDecimal}`,
|
|
31
|
-
sourceTypeof: "object",
|
|
32
|
-
},
|
|
33
|
-
// {
|
|
34
|
-
// conversionExpression: (value) =>
|
|
35
|
-
// code`new ${this.reusables.imports.BigDecimal}(${value})`,
|
|
36
|
-
// sourceTypeCheckExpression: (value) =>
|
|
37
|
-
// code`typeof ${value} === "number"`,
|
|
38
|
-
// sourceTypeName: code`number`,
|
|
39
|
-
// sourceTypeof: "number",
|
|
40
|
-
// },
|
|
41
|
-
// {
|
|
42
|
-
// conversionExpression: (value) =>
|
|
43
|
-
// code`new ${this.reusables.imports.BigDecimal}(${value})`,
|
|
44
|
-
// sourceTypeCheckExpression: (value) =>
|
|
45
|
-
// code`typeof ${value} === "string"`,
|
|
46
|
-
// sourceTypeName: code`string`,
|
|
47
|
-
// sourceTypeof: "string",
|
|
48
|
-
// },
|
|
49
|
-
];
|
|
50
|
-
}
|
|
51
20
|
get graphqlType() {
|
|
52
21
|
return new AbstractLiteralType.GraphqlType(code `${this.reusables.imports.GraphQLString}`, this.reusables);
|
|
53
22
|
}
|
|
54
23
|
fromJsonExpression({ variables, }) {
|
|
55
|
-
return code
|
|
24
|
+
return code `${this.reusables.imports.Either}.encase<Error, ${this.name}>(() => new ${this.name}(${variables.value}))`;
|
|
56
25
|
}
|
|
57
26
|
graphqlResolveExpression({ variables, }) {
|
|
58
27
|
return code `${variables.value}.toFixed()`;
|
|
59
28
|
}
|
|
60
|
-
hashStatements({ variables, }) {
|
|
61
|
-
return [code `${variables.hasher}.update(${variables.value}.toFixed());`];
|
|
62
|
-
}
|
|
63
29
|
jsonSchema() {
|
|
64
30
|
return code `${this.reusables.imports.z}.string()`;
|
|
65
31
|
}
|
|
66
32
|
jsonType() {
|
|
67
33
|
return new AbstractLiteralType.JsonType("string");
|
|
68
34
|
}
|
|
35
|
+
literalExpression(literal) {
|
|
36
|
+
return code `new ${this.reusables.imports.BigDecimal}(${literalOf(literal.value)})`;
|
|
37
|
+
}
|
|
69
38
|
toJsonExpression({ variables, }) {
|
|
70
39
|
return code `${variables.value}.toFixed()`;
|
|
71
40
|
}
|
|
72
41
|
toRdfResourceValuesExpression({ variables, }) {
|
|
73
42
|
return code `[${this.reusables.snippets.bigDecimalLiteral}(${variables.value})]`;
|
|
74
43
|
}
|
|
75
|
-
|
|
44
|
+
fromRdfResourceValuesExpressionChain({ variables, }) {
|
|
76
45
|
return {
|
|
77
|
-
...super.
|
|
46
|
+
...super.fromRdfResourceValuesExpressionChain({ variables }),
|
|
78
47
|
valueTo: code `chain(values => values.chainMap(value => value.toLiteral().chain(${this.reusables.snippets.decodeBigDecimalLiteral})))`,
|
|
79
48
|
};
|
|
80
49
|
}
|
|
81
50
|
}
|
|
82
|
-
__decorate([
|
|
83
|
-
Memoize()
|
|
84
|
-
], BigDecimalType.prototype, "conversions", null);
|
|
85
51
|
__decorate([
|
|
86
52
|
Memoize()
|
|
87
53
|
], BigDecimalType.prototype, "graphqlType", null);
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Literal } from "@rdfjs/types";
|
|
2
2
|
import { AbstractNumericType } from "./AbstractNumericType.js";
|
|
3
3
|
import { type Code } from "./ts-poet-wrapper.js";
|
|
4
4
|
export declare class BigIntType extends AbstractNumericType<bigint> {
|
|
5
5
|
readonly kind = "BigIntType";
|
|
6
|
-
readonly typeofs:
|
|
6
|
+
readonly typeofs: "bigint"[];
|
|
7
7
|
get graphqlType(): import("./AbstractType.js").AbstractType.GraphqlType;
|
|
8
|
-
get conversions(): readonly AbstractNumericType.Conversion[];
|
|
9
8
|
fromJsonExpression({ variables, }: Parameters<AbstractNumericType<bigint>["fromJsonExpression"]>[0]): Code;
|
|
10
9
|
jsonSchema(_parameters: Parameters<AbstractNumericType<bigint>["jsonSchema"]>[0]): Code;
|
|
11
10
|
jsonType(): AbstractNumericType.JsonType;
|
|
11
|
+
literalExpression(literal: bigint | Literal): Code;
|
|
12
12
|
toJsonExpression({ variables, }: Parameters<AbstractNumericType<bigint>["toJsonExpression"]>[0]): Code;
|
|
13
13
|
protected fromRdfResourceValueExpression({ variables, }: Parameters<AbstractNumericType<bigint>["fromRdfResourceValueExpression"]>[0]): Code;
|
|
14
|
-
protected literalOf(value: bigint): string;
|
|
15
14
|
}
|
|
16
15
|
//# sourceMappingURL=BigIntType.d.ts.map
|
|
@@ -4,33 +4,22 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import {
|
|
7
|
+
import { LiteralDecoder } from "@rdfx/literal";
|
|
8
8
|
import { Memoize } from "typescript-memoize";
|
|
9
9
|
import { AbstractNumericType } from "./AbstractNumericType.js";
|
|
10
10
|
import { code, joinCode, literalOf } from "./ts-poet-wrapper.js";
|
|
11
11
|
export class BigIntType extends AbstractNumericType {
|
|
12
12
|
kind = "BigIntType";
|
|
13
|
-
typeofs =
|
|
13
|
+
typeofs = ["bigint"];
|
|
14
14
|
get graphqlType() {
|
|
15
15
|
return new AbstractNumericType.GraphqlType(code `${this.reusables.imports.GraphQLBigInt}`, this.reusables);
|
|
16
16
|
}
|
|
17
|
-
get conversions() {
|
|
18
|
-
if (this.in_.length > 0) {
|
|
19
|
-
return super.conversions;
|
|
20
|
-
}
|
|
21
|
-
return super.conversions.concat({
|
|
22
|
-
conversionExpression: (value) => code `BigInt(${value})`,
|
|
23
|
-
sourceTypeCheckExpression: (value) => code `typeof ${value} === "number"`,
|
|
24
|
-
sourceTypeName: "number",
|
|
25
|
-
sourceTypeof: "number",
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
17
|
fromJsonExpression({ variables, }) {
|
|
29
18
|
let expression = code `BigInt(${variables.value})`;
|
|
30
19
|
if (this.primitiveIn.length > 0) {
|
|
31
20
|
expression = code `${expression} as ${this.name}`;
|
|
32
21
|
}
|
|
33
|
-
return expression
|
|
22
|
+
return code `${this.reusables.imports.Either}.encase<Error, ${this.name}>(() => ${expression})`;
|
|
34
23
|
}
|
|
35
24
|
jsonSchema(_parameters) {
|
|
36
25
|
switch (this.primitiveIn.length) {
|
|
@@ -45,15 +34,15 @@ export class BigIntType extends AbstractNumericType {
|
|
|
45
34
|
jsonType() {
|
|
46
35
|
return new AbstractNumericType.JsonType(code `string`);
|
|
47
36
|
}
|
|
37
|
+
literalExpression(literal) {
|
|
38
|
+
return code `${typeof literal === "bigint" ? literal : LiteralDecoder.decodeBigIntLiteral(literal).unsafeCoerce()}n`;
|
|
39
|
+
}
|
|
48
40
|
toJsonExpression({ variables, }) {
|
|
49
41
|
return code `${variables.value}.toString()`;
|
|
50
42
|
}
|
|
51
43
|
fromRdfResourceValueExpression({ variables, }) {
|
|
52
44
|
return code `${variables.value}.toBigInt(${this.primitiveIn.length > 0 ? `[${this.primitiveIn.map((_) => `${_}n`).join(", ")}] as const` : ""})`;
|
|
53
45
|
}
|
|
54
|
-
literalOf(value) {
|
|
55
|
-
return `${value.toString()}n`;
|
|
56
|
-
}
|
|
57
46
|
}
|
|
58
47
|
__decorate([
|
|
59
48
|
Memoize()
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { BlankNode
|
|
1
|
+
import type { BlankNode } from "@rdfjs/types";
|
|
2
|
+
import { Maybe } from "purify-ts";
|
|
2
3
|
import { AbstractIdentifierType } from "./AbstractIdentifierType.js";
|
|
3
|
-
import { AbstractTermType } from "./AbstractTermType.js";
|
|
4
4
|
import { type Code } from "./ts-poet-wrapper.js";
|
|
5
5
|
export declare class BlankNodeType extends AbstractIdentifierType<BlankNode> {
|
|
6
|
+
readonly conversionFunction: Maybe<AbstractIdentifierType.ConversionFunction>;
|
|
6
7
|
readonly filterFunction: Code;
|
|
7
8
|
readonly filterType: Code;
|
|
8
9
|
readonly parseFunction: Code;
|
|
@@ -12,11 +13,11 @@ export declare class BlankNodeType extends AbstractIdentifierType<BlankNode> {
|
|
|
12
13
|
readonly schemaType: Code;
|
|
13
14
|
readonly valueSparqlWherePatternsFunction: Code;
|
|
14
15
|
constructor(superParameters: Omit<ConstructorParameters<typeof AbstractIdentifierType<BlankNode>>[0], "hasValues" | "in_">);
|
|
15
|
-
fromJsonExpression({ variables, }: Parameters<
|
|
16
|
-
jsonType(parameters?: Parameters<
|
|
17
|
-
jsonSchema({ includeDiscriminantProperty, }: Parameters<
|
|
18
|
-
toJsonExpression({ includeDiscriminantProperty, variables, }: Parameters<
|
|
19
|
-
protected
|
|
16
|
+
fromJsonExpression({ variables, }: Parameters<AbstractIdentifierType<BlankNode>["fromJsonExpression"]>[0]): Code;
|
|
17
|
+
jsonType(parameters?: Parameters<AbstractIdentifierType<BlankNode>["jsonType"]>[0]): AbstractIdentifierType.JsonType;
|
|
18
|
+
jsonSchema({ includeDiscriminantProperty, }: Parameters<AbstractIdentifierType<BlankNode>["jsonSchema"]>[0]): Code;
|
|
19
|
+
toJsonExpression({ includeDiscriminantProperty, variables, }: Parameters<AbstractIdentifierType<BlankNode>["toJsonExpression"]>[0]): Code;
|
|
20
|
+
protected fromRdfResourceValuesExpressionChain({ variables, }: Parameters<AbstractIdentifierType<BlankNode>["fromRdfResourceValuesExpressionChain"]>[0]): {
|
|
20
21
|
valueTo: Code;
|
|
21
22
|
hasValues?: Code;
|
|
22
23
|
languageIn?: Code;
|
|
@@ -4,11 +4,24 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
+
import { Maybe } from "purify-ts";
|
|
7
8
|
import { Memoize } from "typescript-memoize";
|
|
8
9
|
import { AbstractIdentifierType } from "./AbstractIdentifierType.js";
|
|
9
|
-
import { AbstractTermType } from "./AbstractTermType.js";
|
|
10
10
|
import { code } from "./ts-poet-wrapper.js";
|
|
11
11
|
export class BlankNodeType extends AbstractIdentifierType {
|
|
12
|
+
conversionFunction = Maybe.of({
|
|
13
|
+
code: code `${this.reusables.snippets.convertToBlankNode}`,
|
|
14
|
+
sourceTypes: [
|
|
15
|
+
{
|
|
16
|
+
name: code `${this.reusables.imports.BlankNode}`,
|
|
17
|
+
typeof: "object",
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: "undefined",
|
|
21
|
+
typeof: "undefined",
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
});
|
|
12
25
|
filterFunction = code `${this.reusables.snippets.filterBlankNode}`;
|
|
13
26
|
filterType = code `${this.reusables.snippets.BlankNodeFilter}`;
|
|
14
27
|
parseFunction = code `${this.reusables.snippets.parseBlankNode};`;
|
|
@@ -25,13 +38,13 @@ export class BlankNodeType extends AbstractIdentifierType {
|
|
|
25
38
|
});
|
|
26
39
|
}
|
|
27
40
|
fromJsonExpression({ variables, }) {
|
|
28
|
-
return code `${this.reusables.imports.dataFactory}.blankNode(${variables.value}["@id"].substring(2))`;
|
|
41
|
+
return code `${this.reusables.imports.Either}.of<Error, ${this.name}>(${this.reusables.imports.dataFactory}.blankNode(${variables.value}["@id"].substring(2)))`;
|
|
29
42
|
}
|
|
30
43
|
jsonType(parameters) {
|
|
31
44
|
const discriminantProperty = parameters?.includeDiscriminantProperty
|
|
32
45
|
? `, readonly termType: "BlankNode"`
|
|
33
46
|
: "";
|
|
34
|
-
return new
|
|
47
|
+
return new AbstractIdentifierType.JsonType(code `{ readonly "@id": string${discriminantProperty} }`);
|
|
35
48
|
}
|
|
36
49
|
jsonSchema({ includeDiscriminantProperty, }) {
|
|
37
50
|
const discriminantProperty = includeDiscriminantProperty
|
|
@@ -45,9 +58,9 @@ export class BlankNodeType extends AbstractIdentifierType {
|
|
|
45
58
|
: "";
|
|
46
59
|
return code `{ "@id": \`_:\${${variables.value}.value}\`${discriminantProperty} }`;
|
|
47
60
|
}
|
|
48
|
-
|
|
61
|
+
fromRdfResourceValuesExpressionChain({ variables, }) {
|
|
49
62
|
return {
|
|
50
|
-
...super.
|
|
63
|
+
...super.fromRdfResourceValuesExpressionChain({ variables }),
|
|
51
64
|
valueTo: code `chain(values => values.chainMap(value => value.toBlankNode()))`,
|
|
52
65
|
};
|
|
53
66
|
}
|
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Literal } from "@rdfjs/types";
|
|
2
2
|
import { AbstractPrimitiveType } from "./AbstractPrimitiveType.js";
|
|
3
3
|
import { type Code } from "./ts-poet-wrapper.js";
|
|
4
4
|
export declare class BooleanType extends AbstractPrimitiveType<boolean> {
|
|
5
5
|
readonly filterFunction: Code;
|
|
6
6
|
readonly filterType: Code;
|
|
7
|
+
readonly graphqlType: import("./AbstractType.js").AbstractType.GraphqlType;
|
|
8
|
+
readonly hashFunction: Code;
|
|
7
9
|
readonly kind = "BooleanType";
|
|
8
10
|
readonly schemaType: Code;
|
|
11
|
+
readonly typeofs: "boolean"[];
|
|
9
12
|
readonly valueSparqlWherePatternsFunction: Code;
|
|
10
|
-
readonly typeofs: NonEmptyList<"boolean">;
|
|
11
|
-
get graphqlType(): import("./AbstractType.js").AbstractType.GraphqlType;
|
|
12
13
|
get name(): string;
|
|
13
|
-
protected get schemaObject(): {
|
|
14
|
-
in: boolean[] | undefined;
|
|
15
|
-
languageIn: import("ts-poet/build/Node.js").Node[] | undefined;
|
|
16
|
-
kind: Code;
|
|
17
|
-
};
|
|
18
14
|
jsonSchema(_parameters: Parameters<AbstractPrimitiveType<number>["jsonSchema"]>[0]): Code;
|
|
15
|
+
literalExpression(literal: boolean | Literal): Code;
|
|
19
16
|
toRdfResourceValuesExpression({ variables, }: Parameters<AbstractPrimitiveType<boolean>["toRdfResourceValuesExpression"]>[0]): Code;
|
|
20
|
-
protected
|
|
17
|
+
protected fromRdfResourceValuesExpressionChain({ variables, }: Parameters<AbstractPrimitiveType<boolean>["fromRdfResourceValuesExpressionChain"]>[0]): ReturnType<AbstractPrimitiveType<boolean>["fromRdfResourceValuesExpressionChain"]>;
|
|
21
18
|
}
|
|
22
19
|
//# sourceMappingURL=BooleanType.d.ts.map
|
|
@@ -4,53 +4,46 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import {
|
|
7
|
+
import { LiteralDecoder } from "@rdfx/literal";
|
|
8
8
|
import { Memoize } from "typescript-memoize";
|
|
9
9
|
import { AbstractPrimitiveType } from "./AbstractPrimitiveType.js";
|
|
10
10
|
import { code } from "./ts-poet-wrapper.js";
|
|
11
11
|
export class BooleanType extends AbstractPrimitiveType {
|
|
12
12
|
filterFunction = code `${this.reusables.snippets.filterBoolean}`;
|
|
13
13
|
filterType = code `${this.reusables.snippets.BooleanFilter}`;
|
|
14
|
+
graphqlType = new AbstractPrimitiveType.GraphqlType(code `${this.reusables.imports.GraphQLBoolean}`, this.reusables);
|
|
15
|
+
hashFunction = code `${this.reusables.snippets.hashBoolean}`;
|
|
14
16
|
kind = "BooleanType";
|
|
15
17
|
schemaType = code `${this.reusables.snippets.BooleanSchema}`;
|
|
18
|
+
typeofs = ["boolean"];
|
|
16
19
|
valueSparqlWherePatternsFunction = code `${this.reusables.snippets.booleanSparqlWherePatterns}`;
|
|
17
|
-
typeofs = NonEmptyList(["boolean"]);
|
|
18
|
-
get graphqlType() {
|
|
19
|
-
return new AbstractPrimitiveType.GraphqlType(code `${this.reusables.imports.GraphQLBoolean}`, this.reusables);
|
|
20
|
-
}
|
|
21
20
|
get name() {
|
|
22
21
|
if (this.primitiveIn.length > 0) {
|
|
23
22
|
return `${this.primitiveIn.map((value) => value.toString()).join(" | ")}`;
|
|
24
23
|
}
|
|
25
24
|
return `boolean`;
|
|
26
25
|
}
|
|
27
|
-
get schemaObject() {
|
|
28
|
-
return {
|
|
29
|
-
...super.schemaObject,
|
|
30
|
-
in: this.primitiveIn.length > 0 ? this.primitiveIn.concat() : undefined,
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
26
|
jsonSchema(_parameters) {
|
|
34
27
|
if (this.primitiveIn.length === 1) {
|
|
35
28
|
return code `${this.reusables.imports.z}.literal(${this.primitiveIn[0]})`;
|
|
36
29
|
}
|
|
37
30
|
return code `${this.reusables.imports.z}.boolean()`;
|
|
38
31
|
}
|
|
32
|
+
literalExpression(literal) {
|
|
33
|
+
return code `${typeof literal === "boolean" ? literal : LiteralDecoder.decodeBooleanLiteral(literal).unsafeCoerce()}`;
|
|
34
|
+
}
|
|
39
35
|
toRdfResourceValuesExpression({ variables, }) {
|
|
40
36
|
return code `[${this.reusables.snippets.literalFactory}.boolean(${variables.value}, ${this.rdfjsTermExpression(this.datatype)})]`;
|
|
41
37
|
}
|
|
42
|
-
|
|
38
|
+
fromRdfResourceValuesExpressionChain({ variables, }) {
|
|
43
39
|
return {
|
|
44
|
-
...super.
|
|
40
|
+
...super.fromRdfResourceValuesExpressionChain({ variables }),
|
|
45
41
|
languageIn: undefined,
|
|
46
42
|
preferredLanguages: undefined,
|
|
47
43
|
valueTo: code `chain(values => values.chainMap(value => value.toBoolean(${this.primitiveIn.length === 1 ? `[${this.primitiveIn[0]}] as const` : ""})))`,
|
|
48
44
|
};
|
|
49
45
|
}
|
|
50
46
|
}
|
|
51
|
-
__decorate([
|
|
52
|
-
Memoize()
|
|
53
|
-
], BooleanType.prototype, "graphqlType", null);
|
|
54
47
|
__decorate([
|
|
55
48
|
Memoize()
|
|
56
49
|
], BooleanType.prototype, "name", null);
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import type { Literal } from "@rdfjs/types";
|
|
1
2
|
import { AbstractDateType } from "./AbstractDateType.js";
|
|
2
3
|
import { type Code } from "./ts-poet-wrapper.js";
|
|
3
4
|
export declare class DateTimeType extends AbstractDateType {
|
|
5
|
+
readonly graphqlType: import("./AbstractType.js").AbstractType.GraphqlType;
|
|
6
|
+
readonly hashFunction: Code;
|
|
4
7
|
readonly kind = "DateTimeType";
|
|
5
|
-
get graphqlType(): import("./AbstractType.js").AbstractType.GraphqlType;
|
|
6
8
|
jsonSchema(_parameters: Parameters<AbstractDateType["jsonSchema"]>[0]): Code;
|
|
9
|
+
literalExpression(literal: Date | Literal): Code;
|
|
7
10
|
toJsonExpression({ variables, }: Parameters<AbstractDateType["toJsonExpression"]>[0]): Code;
|
|
8
11
|
protected fromRdfResourceValueExpression({ variables, }: Parameters<AbstractDateType["fromRdfResourceValueExpression"]>[0]): Code;
|
|
9
12
|
}
|
|
@@ -1,20 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import { Memoize } from "typescript-memoize";
|
|
1
|
+
import { LiteralDecoder } from "@rdfx/literal";
|
|
8
2
|
import { AbstractDateType } from "./AbstractDateType.js";
|
|
9
3
|
import { code } from "./ts-poet-wrapper.js";
|
|
10
4
|
export class DateTimeType extends AbstractDateType {
|
|
5
|
+
graphqlType = new DateTimeType.GraphqlType(code `${this.reusables.imports.GraphQLDateTime}`, this.reusables);
|
|
6
|
+
hashFunction = code `${this.reusables.snippets.hashDateTime}`;
|
|
11
7
|
kind = "DateTimeType";
|
|
12
|
-
get graphqlType() {
|
|
13
|
-
return new DateTimeType.GraphqlType(code `${this.reusables.imports.GraphQLDateTime}`, this.reusables);
|
|
14
|
-
}
|
|
15
8
|
jsonSchema(_parameters) {
|
|
16
9
|
return code `${this.reusables.imports.z}.iso.datetime()`;
|
|
17
10
|
}
|
|
11
|
+
literalExpression(literal) {
|
|
12
|
+
return code `new Date("${(literal instanceof Date ? literal : LiteralDecoder.decodeDateTimeLiteral(literal).unsafeCoerce()).toISOString()}")`;
|
|
13
|
+
}
|
|
18
14
|
toJsonExpression({ variables, }) {
|
|
19
15
|
return code `${variables.value}.toISOString()`;
|
|
20
16
|
}
|
|
@@ -22,7 +18,4 @@ export class DateTimeType extends AbstractDateType {
|
|
|
22
18
|
return code `${variables.value}.toDateTime(${this.primitiveIn.length > 0 ? `[${this.primitiveIn.map((_) => `new Date(${_.getTime()})`).join(", ")}]` : ""})`;
|
|
23
19
|
}
|
|
24
20
|
}
|
|
25
|
-
__decorate([
|
|
26
|
-
Memoize()
|
|
27
|
-
], DateTimeType.prototype, "graphqlType", null);
|
|
28
21
|
//# sourceMappingURL=DateTimeType.js.map
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import type { Literal } from "@rdfjs/types";
|
|
1
2
|
import { AbstractDateType } from "./AbstractDateType.js";
|
|
2
3
|
import { DateTimeType } from "./DateTimeType.js";
|
|
3
4
|
import { type Code } from "./ts-poet-wrapper.js";
|
|
4
5
|
export declare class DateType extends AbstractDateType {
|
|
6
|
+
readonly graphqlType: import("./AbstractType.js").AbstractType.GraphqlType;
|
|
7
|
+
readonly hashFunction: Code;
|
|
5
8
|
readonly kind = "DateType";
|
|
6
|
-
get graphqlType(): import("./AbstractType.js").AbstractType.GraphqlType;
|
|
7
9
|
jsonSchema(_parameters: Parameters<DateTimeType["jsonSchema"]>[0]): Code;
|
|
10
|
+
literalExpression(literal: Date | Literal): Code;
|
|
8
11
|
toJsonExpression({ variables, }: Parameters<AbstractDateType["toJsonExpression"]>[0]): Code;
|
|
9
12
|
protected fromRdfResourceValueExpression({ variables, }: Parameters<AbstractDateType["fromRdfResourceValueExpression"]>[0]): Code;
|
|
10
13
|
}
|
|
@@ -1,29 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import { Memoize } from "typescript-memoize";
|
|
1
|
+
import { LiteralDecoder } from "@rdfx/literal";
|
|
8
2
|
import { AbstractDateType } from "./AbstractDateType.js";
|
|
9
3
|
import { DateTimeType } from "./DateTimeType.js";
|
|
10
4
|
import { code } from "./ts-poet-wrapper.js";
|
|
11
5
|
export class DateType extends AbstractDateType {
|
|
6
|
+
graphqlType = new DateTimeType.GraphqlType(code `${this.reusables.imports.GraphQLDate}`, this.reusables);
|
|
7
|
+
hashFunction = code `${this.reusables.snippets.hashDate}`;
|
|
12
8
|
kind = "DateType";
|
|
13
|
-
get graphqlType() {
|
|
14
|
-
return new DateTimeType.GraphqlType(code `${this.reusables.imports.GraphQLDate}`, this.reusables);
|
|
15
|
-
}
|
|
16
9
|
jsonSchema(_parameters) {
|
|
17
10
|
return code `${this.reusables.imports.z}.iso.date()`;
|
|
18
11
|
}
|
|
12
|
+
literalExpression(literal) {
|
|
13
|
+
return code `new Date("${(literal instanceof Date ? literal : LiteralDecoder.decodeDateLiteral(literal).unsafeCoerce()).toISOString()}")`;
|
|
14
|
+
}
|
|
19
15
|
toJsonExpression({ variables, }) {
|
|
20
|
-
return code `${variables.value}
|
|
16
|
+
return code `${this.reusables.snippets.toIsoDateString}(${variables.value})`;
|
|
21
17
|
}
|
|
22
18
|
fromRdfResourceValueExpression({ variables, }) {
|
|
23
19
|
return code `${variables.value}.toDate(${this.primitiveIn.length > 0 ? `[${this.primitiveIn.map((_) => `new Date(${_.getTime()})`).join(", ")}]` : ""})`;
|
|
24
20
|
}
|
|
25
21
|
}
|
|
26
|
-
__decorate([
|
|
27
|
-
Memoize()
|
|
28
|
-
], DateType.prototype, "graphqlType", null);
|
|
29
22
|
//# sourceMappingURL=DateType.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Literal, NamedNode } from "@rdfjs/types";
|
|
2
|
-
import { Maybe
|
|
2
|
+
import { Maybe } from "purify-ts";
|
|
3
3
|
import { AbstractContainerType } from "./AbstractContainerType.js";
|
|
4
4
|
import type { AbstractType } from "./AbstractType.js";
|
|
5
5
|
import type { BlankNodeType } from "./BlankNodeType.js";
|
|
@@ -10,15 +10,17 @@ export declare class DefaultValueType<ItemTypeT extends DefaultValueType.ItemTyp
|
|
|
10
10
|
readonly discriminantProperty: Maybe<AbstractType.DiscriminantProperty>;
|
|
11
11
|
readonly graphqlArgs: AbstractType["graphqlArgs"];
|
|
12
12
|
readonly kind = "DefaultValueType";
|
|
13
|
-
readonly typeofs:
|
|
13
|
+
readonly typeofs: "object"[];
|
|
14
|
+
readonly validationFunction: Maybe<Code>;
|
|
14
15
|
constructor({ defaultValue, ...superParameters }: {
|
|
15
16
|
defaultValue: Literal | NamedNode;
|
|
16
17
|
} & ConstructorParameters<typeof AbstractContainerType<ItemTypeT>>[0]);
|
|
17
|
-
get
|
|
18
|
+
get conversionFunction(): Maybe<AbstractContainerType.ConversionFunction>;
|
|
18
19
|
get equalsFunction(): Code;
|
|
19
20
|
get filterFunction(): Code;
|
|
20
21
|
get filterType(): Code;
|
|
21
22
|
get graphqlType(): AbstractContainerType.GraphqlType;
|
|
23
|
+
get hashFunction(): Code;
|
|
22
24
|
get mutable(): boolean;
|
|
23
25
|
get name(): Code | string;
|
|
24
26
|
get schemaType(): Code;
|
|
@@ -29,12 +31,10 @@ export declare class DefaultValueType<ItemTypeT extends DefaultValueType.ItemTyp
|
|
|
29
31
|
item: Code;
|
|
30
32
|
kind: Code;
|
|
31
33
|
};
|
|
32
|
-
private get
|
|
33
|
-
private get defaultValueTermExpression();
|
|
34
|
+
private get defaultValueExpression();
|
|
34
35
|
fromJsonExpression(parameters: Parameters<AbstractType["fromJsonExpression"]>[0]): Code;
|
|
35
36
|
fromRdfResourceValuesExpression({ variables, }: Parameters<AbstractContainerType<ItemTypeT>["fromRdfResourceValuesExpression"]>[0]): Code;
|
|
36
37
|
graphqlResolveExpression(parameters: Parameters<AbstractContainerType<ItemTypeT>["graphqlResolveExpression"]>[0]): Code;
|
|
37
|
-
hashStatements(parameters: Parameters<AbstractContainerType<ItemTypeT>["hashStatements"]>[0]): readonly Code[];
|
|
38
38
|
jsonSchema(parameters: Parameters<AbstractContainerType<ItemTypeT>["jsonSchema"]>[0]): Code;
|
|
39
39
|
jsonType(parameters?: Parameters<AbstractContainerType<ItemTypeT>["jsonType"]>[0]): AbstractType.JsonType;
|
|
40
40
|
jsonUiSchemaElement(parameters: Parameters<AbstractContainerType<ItemTypeT>["jsonUiSchemaElement"]>[0]): Maybe<Code>;
|