@shaclmate/compiler 4.0.8 → 4.0.9
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 +1 -4
- package/dist/Compiler.js +1 -5
- package/dist/ShapesGraphToAstTransformer.d.ts +2 -11
- package/dist/ShapesGraphToAstTransformer.js +25 -27
- package/dist/_ShapesGraphToAstTransformer/defaultNodeShapeNodeKinds.d.ts +3 -0
- package/dist/_ShapesGraphToAstTransformer/defaultNodeShapeNodeKinds.js +5 -0
- package/dist/_ShapesGraphToAstTransformer/shapeAstTypeName.d.ts +4 -0
- package/dist/_ShapesGraphToAstTransformer/shapeAstTypeName.js +27 -0
- package/dist/_ShapesGraphToAstTransformer/transformPropertyShapeToAstObjectTypeProperty.js +74 -19
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstCompoundType.d.ts +1 -1
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstCompoundType.js +45 -91
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.d.ts +11 -0
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.js +146 -0
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstObjectType.d.ts +7 -0
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstObjectType.js +182 -0
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstTermType.js +9 -7
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstType.d.ts +3 -5
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstType.js +33 -10
- package/dist/ast/AbstractCompoundType.d.ts +26 -8
- package/dist/ast/AbstractCompoundType.js +84 -16
- package/dist/ast/AbstractContainerType.d.ts +2 -4
- package/dist/ast/AbstractContainerType.js +3 -4
- package/dist/ast/AbstractLazyObjectType.d.ts +1 -0
- package/dist/ast/AbstractLazyObjectType.js +3 -0
- package/dist/ast/AbstractTermType.d.ts +1 -0
- package/dist/ast/AbstractTermType.js +1 -0
- package/dist/ast/AbstractType.d.ts +16 -1
- package/dist/ast/AbstractType.js +11 -1
- package/dist/ast/Ast.d.ts +4 -4
- package/dist/ast/BlankNodeType.d.ts +1 -1
- package/dist/ast/DefaultValueType.d.ts +1 -2
- package/dist/ast/DefaultValueType.js +2 -0
- package/dist/ast/IdentifierType.d.ts +1 -1
- package/dist/ast/IntersectionType.d.ts +7 -2
- package/dist/ast/IntersectionType.js +8 -0
- package/dist/ast/ListType.d.ts +2 -9
- package/dist/ast/ListType.js +1 -9
- package/dist/ast/LiteralType.d.ts +1 -0
- package/dist/ast/LiteralType.js +26 -0
- package/dist/ast/ObjectCompoundType.d.ts +12 -0
- package/dist/ast/ObjectCompoundType.js +88 -0
- package/dist/ast/ObjectIntersectionType.d.ts +3 -7
- package/dist/ast/ObjectIntersectionType.js +1 -7
- package/dist/ast/ObjectType.d.ts +14 -31
- package/dist/ast/ObjectType.js +41 -73
- package/dist/ast/ObjectUnionType.d.ts +3 -7
- package/dist/ast/ObjectUnionType.js +1 -7
- package/dist/ast/OptionType.d.ts +1 -2
- package/dist/ast/OptionType.js +2 -0
- package/dist/ast/SetType.d.ts +1 -2
- package/dist/ast/SetType.js +2 -0
- package/dist/ast/Type.d.ts +1 -4
- package/dist/ast/Type.js +0 -6
- package/dist/ast/UnionType.d.ts +11 -6
- package/dist/ast/UnionType.js +6 -4
- package/dist/ast/index.d.ts +1 -2
- package/dist/ast/index.js +1 -2
- package/dist/generators/json/AstJsonGenerator.js +16 -14
- package/dist/generators/ts/AbstractCollectionType.js +8 -10
- package/dist/generators/ts/AbstractContainerType.d.ts +8 -3
- package/dist/generators/ts/AbstractContainerType.js +9 -2
- package/dist/generators/ts/AbstractDateType.d.ts +2 -2
- package/dist/generators/ts/AbstractDateType.js +2 -2
- package/dist/generators/ts/AbstractIdentifierType.d.ts +1 -1
- package/dist/generators/ts/AbstractIdentifierType.js +1 -1
- package/dist/generators/ts/AbstractLazyObjectType.d.ts +11 -8
- package/dist/generators/ts/AbstractLazyObjectType.js +19 -14
- package/dist/generators/ts/AbstractNamedUnionType.d.ts +33 -0
- package/dist/generators/ts/AbstractNamedUnionType.js +193 -0
- package/dist/generators/ts/AbstractNumericType.d.ts +2 -2
- package/dist/generators/ts/AbstractNumericType.js +3 -3
- package/dist/generators/ts/AbstractTermType.d.ts +7 -4
- package/dist/generators/ts/AbstractTermType.js +7 -4
- package/dist/generators/ts/AbstractType.d.ts +29 -14
- package/dist/generators/ts/AbstractUnionType.d.ts +80 -0
- package/dist/generators/ts/AbstractUnionType.js +514 -0
- package/dist/generators/ts/AnonymousUnionType.d.ts +26 -0
- package/dist/generators/ts/AnonymousUnionType.js +56 -0
- package/dist/generators/ts/BigDecimalType.d.ts +3 -3
- package/dist/generators/ts/BigDecimalType.js +3 -3
- package/dist/generators/ts/BlankNodeType.d.ts +1 -1
- package/dist/generators/ts/BlankNodeType.js +1 -1
- package/dist/generators/ts/BooleanType.d.ts +2 -2
- package/dist/generators/ts/BooleanType.js +2 -2
- package/dist/generators/ts/DefaultValueType.d.ts +4 -4
- package/dist/generators/ts/DefaultValueType.js +14 -13
- package/dist/generators/ts/IdentifierType.d.ts +1 -1
- package/dist/generators/ts/IdentifierType.js +1 -1
- package/dist/generators/ts/IriType.d.ts +1 -1
- package/dist/generators/ts/IriType.js +1 -1
- package/dist/generators/ts/LazyObjectOptionType.d.ts +1 -1
- package/dist/generators/ts/LazyObjectOptionType.js +9 -9
- package/dist/generators/ts/LazyObjectSetType.d.ts +1 -1
- package/dist/generators/ts/LazyObjectSetType.js +7 -7
- package/dist/generators/ts/LazyObjectType.d.ts +1 -1
- package/dist/generators/ts/LazyObjectType.js +7 -8
- package/dist/generators/ts/ListType.d.ts +8 -7
- package/dist/generators/ts/ListType.js +14 -13
- package/dist/generators/ts/LiteralType.d.ts +1 -1
- package/dist/generators/ts/LiteralType.js +2 -2
- package/dist/generators/ts/NamedObjectUnionType.d.ts +35 -0
- package/dist/generators/ts/NamedObjectUnionType.js +221 -0
- package/dist/generators/ts/NamedUnionType.d.ts +11 -0
- package/dist/generators/ts/NamedUnionType.js +13 -0
- package/dist/generators/ts/ObjectType.d.ts +34 -25
- package/dist/generators/ts/ObjectType.js +62 -52
- package/dist/generators/ts/OptionType.d.ts +4 -4
- package/dist/generators/ts/OptionType.js +10 -10
- package/dist/generators/ts/SetType.d.ts +4 -4
- package/dist/generators/ts/SetType.js +13 -11
- package/dist/generators/ts/StringType.d.ts +2 -2
- package/dist/generators/ts/StringType.js +2 -2
- package/dist/generators/ts/TermType.d.ts +1 -1
- package/dist/generators/ts/TermType.js +2 -2
- package/dist/generators/ts/TsGenerator.js +23 -15
- package/dist/generators/ts/Type.d.ts +4 -3
- package/dist/generators/ts/TypeFactory.d.ts +7 -5
- package/dist/generators/ts/TypeFactory.js +117 -90
- package/dist/generators/ts/ZodGenerator.js +6 -6
- package/dist/generators/ts/_ObjectType/AbstractProperty.d.ts +3 -3
- package/dist/generators/ts/_ObjectType/{TypeDiscriminantProperty.d.ts → DiscriminantProperty.d.ts} +14 -14
- package/dist/generators/ts/_ObjectType/{TypeDiscriminantProperty.js → DiscriminantProperty.js} +10 -10
- package/dist/generators/ts/_ObjectType/IdentifierPrefixProperty.d.ts +2 -2
- package/dist/generators/ts/_ObjectType/IdentifierPrefixProperty.js +2 -2
- package/dist/generators/ts/_ObjectType/IdentifierProperty.d.ts +2 -2
- package/dist/generators/ts/_ObjectType/IdentifierProperty.js +7 -4
- package/dist/generators/ts/_ObjectType/ObjectType_classDeclaration.js +8 -8
- package/dist/generators/ts/_ObjectType/ObjectType_focusSparqlConstructTriplesFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_sparqlConstructTriplesFunctionDeclaration.js → ObjectType_focusSparqlConstructTriplesFunctionDeclaration.js} +6 -5
- package/dist/generators/ts/_ObjectType/ObjectType_focusSparqlWherePatternsFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_sparqlWherePatternsFunctionDeclarations.js → ObjectType_focusSparqlWherePatternsFunctionDeclaration.js} +5 -5
- package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclaration.js +20 -0
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_fromRdfFunctionDeclaration.js → ObjectType_fromRdfResourceFunctionDeclaration.js} +6 -7
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.js +20 -0
- package/dist/generators/ts/_ObjectType/ObjectType_isTypeFunctionDeclaration.js +2 -2
- package/dist/generators/ts/_ObjectType/ObjectType_parseJsonFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_parseJsonFunctionDeclaration.js +19 -0
- package/dist/generators/ts/_ObjectType/ObjectType_propertiesFromJsonFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_propertiesFromJsonFunctionDeclaration.js +38 -0
- package/dist/generators/ts/_ObjectType/ObjectType_propertiesFromRdfResourceFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_propertiesFromRdfFunctionDeclaration.js → ObjectType_propertiesFromRdfResourceFunctionDeclaration.js} +16 -15
- package/dist/generators/ts/_ObjectType/ObjectType_schemaVariableStatement.js +1 -2
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.js +2 -2
- package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceFunctionOrMethodDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_toRdfFunctionOrMethodDeclaration.js → ObjectType_toRdfResourceFunctionOrMethodDeclaration.js} +10 -8
- package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlConstructTriplesFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlConstructTriplesFunctionDeclaration.js +13 -0
- package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlWherePatternsFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlWherePatternsFunctionDeclaration.js +15 -0
- package/dist/generators/ts/_ObjectType/Property.d.ts +2 -2
- package/dist/generators/ts/_ObjectType/ShaclProperty.d.ts +2 -2
- package/dist/generators/ts/_ObjectType/ShaclProperty.js +6 -6
- package/dist/generators/ts/_snippets/snippets_FocusSparqlConstructTriplesFunction.d.ts +2 -0
- package/dist/generators/ts/_snippets/snippets_FocusSparqlConstructTriplesFunction.js +12 -0
- package/dist/generators/ts/_snippets/snippets_FocusSparqlWherePatternsFunction.d.ts +2 -0
- package/dist/generators/ts/_snippets/snippets_FocusSparqlWherePatternsFunction.js +14 -0
- package/dist/generators/ts/_snippets/snippets_FromRdfResourceFunction.d.ts +2 -0
- package/dist/generators/ts/_snippets/snippets_FromRdfResourceFunction.js +15 -0
- package/dist/generators/ts/_snippets/snippets_FromRdfResourceValuesFunction.d.ts +2 -0
- package/dist/generators/ts/_snippets/snippets_FromRdfResourceValuesFunction.js +17 -0
- package/dist/generators/ts/_snippets/snippets_PropertiesFromRdfResourceFunction.d.ts +2 -0
- package/dist/generators/ts/_snippets/snippets_PropertiesFromRdfResourceFunction.js +15 -0
- package/dist/generators/ts/_snippets/snippets_PropertyPath.d.ts +5 -0
- package/dist/generators/ts/_snippets/snippets_PropertyPath.js +35 -0
- package/dist/generators/ts/_snippets/snippets_ShaclPropertySchema.js +2 -2
- package/dist/generators/ts/_snippets/snippets_ToRdfResourceFunction.d.ts +2 -0
- package/dist/generators/ts/_snippets/snippets_ToRdfResourceFunction.js +7 -0
- package/dist/generators/ts/_snippets/snippets_ToRdfResourceValuesFunction.d.ts +2 -0
- package/dist/generators/ts/_snippets/snippets_ToRdfResourceValuesFunction.js +16 -0
- package/dist/generators/ts/_snippets/snippets_ValueSparqlConstructTriplesFunction.d.ts +2 -0
- package/dist/generators/ts/_snippets/snippets_ValueSparqlConstructTriplesFunction.js +13 -0
- package/dist/generators/ts/_snippets/snippets_ValueSparqlWherePatternsFunction.d.ts +2 -0
- package/dist/generators/ts/_snippets/snippets_ValueSparqlWherePatternsFunction.js +16 -0
- package/dist/generators/ts/_snippets/snippets_bigDecimalSparqlWherePatterns.js +2 -2
- package/dist/generators/ts/_snippets/snippets_blankNodeSparqlWherePatterns.js +2 -2
- package/dist/generators/ts/_snippets/snippets_booleanEquals.js +1 -1
- package/dist/generators/ts/_snippets/snippets_booleanSparqlWherePatterns.js +2 -2
- package/dist/generators/ts/_snippets/snippets_dateSparqlWherePatterns.js +2 -2
- package/dist/generators/ts/_snippets/snippets_defaultValueSparqlWherePatterns.js +2 -2
- package/dist/generators/ts/_snippets/snippets_fromRdfLanguageIn.js +1 -1
- package/dist/generators/ts/_snippets/snippets_identifierSparqlWherePatterns.js +2 -2
- package/dist/generators/ts/_snippets/snippets_iriSparqlWherePatterns.js +2 -2
- package/dist/generators/ts/_snippets/snippets_listSparqlConstructTriples.js +2 -2
- package/dist/generators/ts/_snippets/snippets_listSparqlWherePatterns.js +2 -2
- package/dist/generators/ts/_snippets/snippets_literalSparqlWherePatterns.js +2 -2
- package/dist/generators/ts/_snippets/snippets_maybeSparqlConstructTriples.js +2 -2
- package/dist/generators/ts/_snippets/snippets_maybeSparqlWherePatterns.js +2 -2
- package/dist/generators/ts/_snippets/snippets_numericSparqlWherePatterns.js +2 -3
- package/dist/generators/ts/_snippets/snippets_setSparqlConstructTriples.js +2 -2
- package/dist/generators/ts/_snippets/snippets_setSparqlWherePatterns.js +2 -2
- package/dist/generators/ts/_snippets/snippets_shaclPropertySparqlConstructTriples.js +4 -3
- package/dist/generators/ts/_snippets/snippets_shaclPropertySparqlWherePatterns.js +4 -3
- package/dist/generators/ts/_snippets/snippets_sparqlPropertyPath.js +3 -2
- package/dist/generators/ts/_snippets/snippets_stringSparqlWherePatterns.js +2 -2
- package/dist/generators/ts/_snippets/snippets_termSparqlWherePatterns.js +2 -2
- package/dist/generators/ts/graphqlSchemaVariableStatement.d.ts +2 -2
- package/dist/generators/ts/graphqlSchemaVariableStatement.js +4 -4
- package/dist/generators/ts/imports.d.ts +1 -1
- package/dist/generators/ts/imports.js +1 -1
- package/dist/generators/ts/objectSetDeclarations.d.ts +3 -3
- package/dist/generators/ts/objectSetDeclarations.js +15 -15
- package/dist/generators/ts/objectSetInterfaceDeclaration.d.ts +3 -3
- package/dist/generators/ts/objectSetInterfaceDeclaration.js +2 -2
- package/dist/generators/ts/rdfjsDatasetObjectSetClassDeclaration.d.ts +3 -3
- package/dist/generators/ts/rdfjsDatasetObjectSetClassDeclaration.js +16 -17
- package/dist/generators/ts/snippets.d.ts +10 -6
- package/dist/generators/ts/snippets.js +20 -12
- package/dist/generators/ts/sparqlObjectSetClassDeclaration.d.ts +3 -3
- package/dist/generators/ts/sparqlObjectSetClassDeclaration.js +7 -8
- package/dist/generators/ts/synthesizeUberObjectUnionType.d.ts +2 -2
- package/dist/generators/ts/synthesizeUberObjectUnionType.js +9 -4
- package/dist/input/NodeShape.d.ts +0 -1
- package/dist/input/NodeShape.js +0 -3
- package/dist/input/ShapesGraph.d.ts +3 -2
- package/dist/input/ShapesGraph.js +12 -7
- package/dist/input/generated.d.ts +1899 -88
- package/dist/input/generated.js +676 -564
- package/package.json +3 -5
- package/dist/_ShapesGraphToAstTransformer/CurieFactory.d.ts +0 -16
- package/dist/_ShapesGraphToAstTransformer/CurieFactory.js +0 -45
- package/dist/_ShapesGraphToAstTransformer/NodeShapeAstType.d.ts +0 -3
- package/dist/_ShapesGraphToAstTransformer/NodeShapeAstType.js +0 -2
- package/dist/_ShapesGraphToAstTransformer/index.d.ts +0 -6
- package/dist/_ShapesGraphToAstTransformer/index.js +0 -6
- package/dist/_ShapesGraphToAstTransformer/shapeIdentifier.d.ts +0 -5
- package/dist/_ShapesGraphToAstTransformer/shapeIdentifier.js +0 -9
- package/dist/_ShapesGraphToAstTransformer/transformNodeShapeToAstType.d.ts +0 -11
- package/dist/_ShapesGraphToAstTransformer/transformNodeShapeToAstType.js +0 -338
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstAbstractTypeProperties.d.ts +0 -12
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstAbstractTypeProperties.js +0 -31
- package/dist/ast/AbstractObjectCompoundType.d.ts +0 -45
- package/dist/ast/AbstractObjectCompoundType.js +0 -180
- package/dist/ast/Curie.d.ts +0 -21
- package/dist/ast/Curie.js +0 -29
- package/dist/ast/PlaceholderType.d.ts +0 -15
- package/dist/ast/PlaceholderType.js +0 -19
- package/dist/generators/codeName.d.ts +0 -6
- package/dist/generators/codeName.js +0 -66
- package/dist/generators/ts/AbstractDeclaredType.d.ts +0 -23
- package/dist/generators/ts/AbstractDeclaredType.js +0 -17
- package/dist/generators/ts/ObjectUnionType.d.ts +0 -65
- package/dist/generators/ts/ObjectUnionType.js +0 -257
- package/dist/generators/ts/UnionType.d.ts +0 -40
- package/dist/generators/ts/UnionType.js +0 -527
- package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclarations.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclarations.js +0 -66
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_propertiesFromRdfFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructTriplesFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlWherePatternsFunctionDeclarations.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_toRdfFunctionOrMethodDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectUnionType/MemberType.d.ts +0 -34
- package/dist/generators/ts/_ObjectUnionType/MemberType.js +0 -105
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_equalsFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_equalsFunctionDeclaration.js +0 -29
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_filterFunctionDeclaration.d.ts +0 -4
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_filterFunctionDeclaration.js +0 -19
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_filterTypeDeclaration.d.ts +0 -4
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_filterTypeDeclaration.js +0 -10
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_fromJsonFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_fromJsonFunctionDeclaration.js +0 -19
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_fromRdfFunctionDeclarations.d.ts +0 -5
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_fromRdfFunctionDeclarations.js +0 -20
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_graphqlTypeVariableStatement.d.ts +0 -5
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_graphqlTypeVariableStatement.js +0 -18
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_hashFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_hashFunctionDeclaration.js +0 -28
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_identifierTypeDeclarations.d.ts +0 -4
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_identifierTypeDeclarations.js +0 -9
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_isTypeFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_isTypeFunctionDeclaration.js +0 -13
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_jsonTypeAliasDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_jsonTypeAliasDeclaration.js +0 -10
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_jsonZodSchemaFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_jsonZodSchemaFunctionDeclaration.js +0 -14
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_schemaVariableStatement.d.ts +0 -4
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_schemaVariableStatement.js +0 -37
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_sparqlConstructTriplesFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_sparqlConstructTriplesFunctionDeclaration.js +0 -15
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_sparqlWherePatternsFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_sparqlWherePatternsFunctionDeclaration.js +0 -35
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_toJsonFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_toJsonFunctionDeclaration.js +0 -26
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_toRdfFunctionDeclarations.d.ts +0 -5
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_toRdfFunctionDeclarations.js +0 -43
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_typeAliasDeclaration.d.ts +0 -4
- package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_typeAliasDeclaration.js +0 -10
- package/dist/generators/ts/_snippets/snippets_FromRdfOptions.d.ts +0 -2
- package/dist/generators/ts/_snippets/snippets_FromRdfOptions.js +0 -5
- package/dist/generators/ts/_snippets/snippets_PropertiesFromRdfParameters.d.ts +0 -2
- package/dist/generators/ts/_snippets/snippets_PropertiesFromRdfParameters.js +0 -5
- package/dist/generators/ts/_snippets/snippets_SparqlConstructTriplesFunction.d.ts +0 -2
- package/dist/generators/ts/_snippets/snippets_SparqlConstructTriplesFunction.js +0 -6
- package/dist/generators/ts/_snippets/snippets_SparqlConstructTriplesFunctionParameters.d.ts +0 -2
- package/dist/generators/ts/_snippets/snippets_SparqlConstructTriplesFunctionParameters.js +0 -12
- package/dist/generators/ts/_snippets/snippets_SparqlWherePatternsFunction.d.ts +0 -2
- package/dist/generators/ts/_snippets/snippets_SparqlWherePatternsFunction.js +0 -6
- package/dist/generators/ts/_snippets/snippets_SparqlWherePatternsFunctionParameters.d.ts +0 -2
- package/dist/generators/ts/_snippets/snippets_SparqlWherePatternsFunctionParameters.js +0 -15
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
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 { pascalCase } from "change-case";
|
|
8
|
+
import { Maybe } from "purify-ts";
|
|
9
|
+
import { PropertyPath } from "rdfjs-resource";
|
|
10
|
+
import { Memoize } from "typescript-memoize";
|
|
11
|
+
import { ObjectType_objectSetMethodNames } from "./_ObjectType/ObjectType_objectSetMethodNames.js";
|
|
12
|
+
import { ObjectType_sparqlConstructQueryFunctionDeclaration } from "./_ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.js";
|
|
13
|
+
import { ObjectType_sparqlConstructQueryStringFunctionDeclaration } from "./_ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.js";
|
|
14
|
+
import { AbstractNamedUnionType } from "./AbstractNamedUnionType.js";
|
|
15
|
+
import { AbstractType } from "./AbstractType.js";
|
|
16
|
+
import { imports } from "./imports.js";
|
|
17
|
+
import { snippets } from "./snippets.js";
|
|
18
|
+
import { syntheticNamePrefix } from "./syntheticNamePrefix.js";
|
|
19
|
+
import { code, joinCode, literalOf } from "./ts-poet-wrapper.js";
|
|
20
|
+
function singleEntryRecord(key, value) {
|
|
21
|
+
const record = {};
|
|
22
|
+
record[key] = value;
|
|
23
|
+
return record;
|
|
24
|
+
}
|
|
25
|
+
export class NamedObjectUnionType extends AbstractNamedUnionType {
|
|
26
|
+
#identifierType;
|
|
27
|
+
graphqlArgs = Maybe.empty();
|
|
28
|
+
kind = "NamedObjectUnionType";
|
|
29
|
+
constructor({ identifierType, ...superParameters }) {
|
|
30
|
+
super({ ...superParameters, identifierType: Maybe.of(identifierType) });
|
|
31
|
+
this.#identifierType = identifierType;
|
|
32
|
+
}
|
|
33
|
+
get graphqlType() {
|
|
34
|
+
return new AbstractType.GraphqlType(code `${this._name}.${syntheticNamePrefix}GraphQL`);
|
|
35
|
+
}
|
|
36
|
+
get identifierTypeAlias() {
|
|
37
|
+
return code `${this.staticModuleName}.${syntheticNamePrefix}Identifier`;
|
|
38
|
+
}
|
|
39
|
+
get objectSetMethodNames() {
|
|
40
|
+
return ObjectType_objectSetMethodNames.call(this);
|
|
41
|
+
}
|
|
42
|
+
get schema() {
|
|
43
|
+
return code `${this.staticModuleName}.${syntheticNamePrefix}schema`;
|
|
44
|
+
}
|
|
45
|
+
get schemaType() {
|
|
46
|
+
return code `typeof ${this.schema}`;
|
|
47
|
+
}
|
|
48
|
+
get staticModuleDeclarations() {
|
|
49
|
+
return {
|
|
50
|
+
...super.staticModuleDeclarations,
|
|
51
|
+
...this.identifierTypeDeclarations,
|
|
52
|
+
...this.focusSparqlConstructTriplesFunctionDeclaration,
|
|
53
|
+
...this.focusSparqlWherePatternsFunctionDeclaration,
|
|
54
|
+
...this.fromRdfResourceFunctionDeclaration,
|
|
55
|
+
...this.graphqlTypeVariableStatement,
|
|
56
|
+
...this.isTypeFunctionDeclaration,
|
|
57
|
+
...this.schemaVariableStatement,
|
|
58
|
+
...ObjectType_sparqlConstructQueryFunctionDeclaration.call(this)
|
|
59
|
+
.map((code_) => singleEntryRecord(`${syntheticNamePrefix}sparqlConstructQuery`, code_))
|
|
60
|
+
.orDefault({}),
|
|
61
|
+
...ObjectType_sparqlConstructQueryStringFunctionDeclaration.call(this)
|
|
62
|
+
.map((code_) => singleEntryRecord(`${syntheticNamePrefix}sparqlConstructQueryString`, code_))
|
|
63
|
+
.orDefault({}),
|
|
64
|
+
...this.toRdfResourceFunctionDeclaration,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
get focusSparqlConstructTriplesFunctionDeclaration() {
|
|
68
|
+
if (!this.features.has("sparql")) {
|
|
69
|
+
return {};
|
|
70
|
+
}
|
|
71
|
+
return singleEntryRecord(`${syntheticNamePrefix}focusSparqlConstructTriples`, code `\
|
|
72
|
+
export function ${syntheticNamePrefix}focusSparqlConstructTriples({ filter, focusIdentifier, variablePrefix }: { filter: ${this.filterType} | undefined; focusIdentifier: ${imports.NamedNode} | ${imports.Variable}; ignoreRdfType: boolean; variablePrefix: string }): readonly ${imports.sparqljs}.Triple[] {
|
|
73
|
+
return [${joinCode(this.concreteMembers.map((member) => code `...${member.type.staticModuleName}.${syntheticNamePrefix}focusSparqlConstructTriples({ filter: filter?.on?.${member.type.name}, focusIdentifier, ignoreRdfType: false, variablePrefix: \`\${variablePrefix}${pascalCase(member.type.name)}\` }).concat()`), { on: ", " })}];
|
|
74
|
+
}`);
|
|
75
|
+
}
|
|
76
|
+
get focusSparqlWherePatternsFunctionDeclaration() {
|
|
77
|
+
if (!this.features.has("sparql")) {
|
|
78
|
+
return {};
|
|
79
|
+
}
|
|
80
|
+
return singleEntryRecord(`${syntheticNamePrefix}focusSparqlWherePatterns`, code `\
|
|
81
|
+
export function ${syntheticNamePrefix}focusSparqlWherePatterns({ filter, focusIdentifier, preferredLanguages, variablePrefix }: { filter: ${this.filterType} | undefined; focusIdentifier: ${imports.NamedNode} | ${imports.Variable}; ignoreRdfType: boolean; preferredLanguages: readonly string[] | undefined; variablePrefix: string }): readonly ${snippets.SparqlPattern}[] {
|
|
82
|
+
${joinCode([
|
|
83
|
+
code `let patterns: ${snippets.SparqlPattern}[] = [];`,
|
|
84
|
+
code `\
|
|
85
|
+
if (focusIdentifier.termType === "Variable") {
|
|
86
|
+
patterns = patterns.concat(${this.#identifierType.valueSparqlWherePatternsFunction}({
|
|
87
|
+
filter: filter?.${syntheticNamePrefix}identifier,
|
|
88
|
+
ignoreRdfType: false,
|
|
89
|
+
preferredLanguages,
|
|
90
|
+
propertyPatterns: [],
|
|
91
|
+
schema: ${this.#identifierType.schema},
|
|
92
|
+
valueVariable: focusIdentifier,
|
|
93
|
+
variablePrefix,
|
|
94
|
+
}));
|
|
95
|
+
}`,
|
|
96
|
+
code `patterns.push({ patterns: [${joinCode(this.concreteMembers.map((member) => code `${{
|
|
97
|
+
patterns: code `${member.type.staticModuleName}.${syntheticNamePrefix}focusSparqlWherePatterns({ filter: filter?.on?.${member.type.name}, focusIdentifier, ignoreRdfType: false, preferredLanguages, variablePrefix: \`\${variablePrefix}${pascalCase(member.type.name)}\` }).concat()`,
|
|
98
|
+
type: literalOf("group"),
|
|
99
|
+
}}`), { on: ", " })}], type: "union" });`,
|
|
100
|
+
code `return patterns;`,
|
|
101
|
+
])}
|
|
102
|
+
}`);
|
|
103
|
+
}
|
|
104
|
+
get fromRdfResourceFunctionDeclaration() {
|
|
105
|
+
if (!this.features.has("rdf")) {
|
|
106
|
+
return {};
|
|
107
|
+
}
|
|
108
|
+
return singleEntryRecord(`${syntheticNamePrefix}fromRdfResource`, code `\
|
|
109
|
+
export const ${syntheticNamePrefix}fromRdfResource: ${snippets.FromRdfResourceFunction}<${this.name}> = (resource, options) =>
|
|
110
|
+
${this.concreteMembers.reduce((expression, member) => {
|
|
111
|
+
const memberTypeExpression = code `(${member.type.staticModuleName}.${syntheticNamePrefix}fromRdfResource(resource, { ...options, ignoreRdfType: false }) as ${imports.Either}<Error, ${this.name}>)`;
|
|
112
|
+
return expression !== null
|
|
113
|
+
? code `${expression}.altLazy(() => ${memberTypeExpression})`
|
|
114
|
+
: memberTypeExpression;
|
|
115
|
+
}, null)};`);
|
|
116
|
+
}
|
|
117
|
+
get graphqlTypeVariableStatement() {
|
|
118
|
+
if (!this.features.has("graphql")) {
|
|
119
|
+
return {};
|
|
120
|
+
}
|
|
121
|
+
return singleEntryRecord(`${syntheticNamePrefix}GraphQL`, code `\
|
|
122
|
+
export const ${syntheticNamePrefix}GraphQL = new ${imports.GraphQLUnionType}(${{
|
|
123
|
+
description: this.comment.map(JSON.stringify).extract(),
|
|
124
|
+
name: this.name,
|
|
125
|
+
resolveType: code `(value: ${this.name}) => value.${syntheticNamePrefix}type`,
|
|
126
|
+
types: code `[${joinCode(this.concreteMembers.map((member) => member.type.graphqlType.nullableName), { on: ", " })}]`,
|
|
127
|
+
}});`);
|
|
128
|
+
}
|
|
129
|
+
get identifierTypeDeclarations() {
|
|
130
|
+
return singleEntryRecord(`${syntheticNamePrefix}Identifier`, code `\
|
|
131
|
+
export type ${syntheticNamePrefix}Identifier = ${this.#identifierType.name};
|
|
132
|
+
export namespace ${syntheticNamePrefix}Identifier { ${joinCode([this.#identifierType.fromStringFunction, this.#identifierType.toStringFunction])} }`);
|
|
133
|
+
}
|
|
134
|
+
get isTypeFunctionDeclaration() {
|
|
135
|
+
if (this._name === `${syntheticNamePrefix}Object`) {
|
|
136
|
+
return {};
|
|
137
|
+
}
|
|
138
|
+
return singleEntryRecord(`is${this._name}`, code `\
|
|
139
|
+
export function is${this._name}(object: ${syntheticNamePrefix}Object): object is ${this.name} {
|
|
140
|
+
return ${joinCode(this.concreteMembers.map((member) => code `${member.type.staticModuleName}.is${member.type.name}(object)`), { on: " || " })};
|
|
141
|
+
}`);
|
|
142
|
+
}
|
|
143
|
+
get schemaVariableStatement() {
|
|
144
|
+
const commonPropertiesByName = {};
|
|
145
|
+
this.concreteMembers.forEach((member, memberI) => {
|
|
146
|
+
for (const memberTypeProperty of member.type.ownProperties.concat(member.type.ancestorObjectTypes.flatMap((ancestorObjectType) => ancestorObjectType.ownProperties))) {
|
|
147
|
+
if (memberTypeProperty.kind !== "ShaclProperty") {
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
150
|
+
let commonProperty = commonPropertiesByName[memberTypeProperty.name];
|
|
151
|
+
if (commonProperty) {
|
|
152
|
+
if (PropertyPath.equals(commonProperty.property.path, memberTypeProperty.path)) {
|
|
153
|
+
commonProperty.memberTypesWithProperty[memberI] = true;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
commonPropertiesByName[memberTypeProperty.name] = commonProperty = {
|
|
158
|
+
memberTypesWithProperty: new Array(this.concreteMembers.length).fill(false),
|
|
159
|
+
property: memberTypeProperty,
|
|
160
|
+
};
|
|
161
|
+
commonProperty.memberTypesWithProperty[memberI] = true;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
const propertiesObject = [];
|
|
166
|
+
for (const name of Object.keys(commonPropertiesByName).toSorted()) {
|
|
167
|
+
const { memberTypesWithProperty, property } = commonPropertiesByName[name];
|
|
168
|
+
if (!memberTypesWithProperty.every((value) => value)) {
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
171
|
+
propertiesObject.push(code `${property.name}: ${property.schema}`);
|
|
172
|
+
}
|
|
173
|
+
return singleEntryRecord(`${syntheticNamePrefix}schema`, code `\
|
|
174
|
+
export const ${syntheticNamePrefix}schema =
|
|
175
|
+
${{
|
|
176
|
+
...super.schemaObject,
|
|
177
|
+
properties: code `{ ${joinCode(propertiesObject, { on: ", " })} }`,
|
|
178
|
+
}} as const;`);
|
|
179
|
+
}
|
|
180
|
+
get toRdfResourceFunctionDeclaration() {
|
|
181
|
+
if (!this.features.has("rdf")) {
|
|
182
|
+
return {};
|
|
183
|
+
}
|
|
184
|
+
return singleEntryRecord(``, code `\
|
|
185
|
+
export const ${syntheticNamePrefix}toRdfResource: ${snippets.ToRdfResourceFunction}<${this.name}> = (value, options) => {
|
|
186
|
+
${joinCode(this.concreteMembers
|
|
187
|
+
.map((member) => {
|
|
188
|
+
let returnExpression;
|
|
189
|
+
switch (member.type.declarationType) {
|
|
190
|
+
case "class":
|
|
191
|
+
returnExpression = code `value.${syntheticNamePrefix}toRdfResource(options)`;
|
|
192
|
+
break;
|
|
193
|
+
case "interface":
|
|
194
|
+
returnExpression = code `${member.type.staticModuleName}.${syntheticNamePrefix}toRdfResource(value, options)`;
|
|
195
|
+
break;
|
|
196
|
+
}
|
|
197
|
+
return code `if (${member.type.staticModuleName}.is${member.type.name}(value)) { return ${returnExpression}; }`;
|
|
198
|
+
})
|
|
199
|
+
.concat(code `throw new Error("unrecognized type");`))}
|
|
200
|
+
};`);
|
|
201
|
+
}
|
|
202
|
+
graphqlResolveExpression({ variables, }) {
|
|
203
|
+
return variables.value;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
__decorate([
|
|
207
|
+
Memoize()
|
|
208
|
+
], NamedObjectUnionType.prototype, "graphqlType", null);
|
|
209
|
+
__decorate([
|
|
210
|
+
Memoize()
|
|
211
|
+
], NamedObjectUnionType.prototype, "identifierTypeAlias", null);
|
|
212
|
+
__decorate([
|
|
213
|
+
Memoize()
|
|
214
|
+
], NamedObjectUnionType.prototype, "objectSetMethodNames", null);
|
|
215
|
+
__decorate([
|
|
216
|
+
Memoize()
|
|
217
|
+
], NamedObjectUnionType.prototype, "schema", null);
|
|
218
|
+
__decorate([
|
|
219
|
+
Memoize()
|
|
220
|
+
], NamedObjectUnionType.prototype, "schemaType", null);
|
|
221
|
+
//# sourceMappingURL=NamedObjectUnionType.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AbstractNamedUnionType } from "./AbstractNamedUnionType.js";
|
|
2
|
+
import type { AbstractType } from "./AbstractType.js";
|
|
3
|
+
import type { Type } from "./Type.js";
|
|
4
|
+
import type { Code } from "./ts-poet-wrapper.js";
|
|
5
|
+
export declare class NamedUnionType extends AbstractNamedUnionType<Type> {
|
|
6
|
+
readonly graphqlArgs: AbstractType["graphqlArgs"];
|
|
7
|
+
readonly kind = "NamedUnionType";
|
|
8
|
+
graphqlResolveExpression(): Code;
|
|
9
|
+
get graphqlType(): AbstractType.GraphqlType;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=NamedUnionType.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Maybe } from "purify-ts";
|
|
2
|
+
import { AbstractNamedUnionType } from "./AbstractNamedUnionType.js";
|
|
3
|
+
export class NamedUnionType extends AbstractNamedUnionType {
|
|
4
|
+
graphqlArgs = Maybe.empty();
|
|
5
|
+
kind = "NamedUnionType";
|
|
6
|
+
graphqlResolveExpression() {
|
|
7
|
+
throw new Error("GraphQL doesn't support scalar unions");
|
|
8
|
+
}
|
|
9
|
+
get graphqlType() {
|
|
10
|
+
throw new Error("GraphQL doesn't support scalar unions");
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=NamedUnionType.js.map
|
|
@@ -1,65 +1,71 @@
|
|
|
1
1
|
import type { NamedNode } from "@rdfjs/types";
|
|
2
2
|
import { Maybe, NonEmptyList } from "purify-ts";
|
|
3
|
-
import type {
|
|
3
|
+
import type { TsFeature } from "../../enums/TsFeature.js";
|
|
4
4
|
import type { TsObjectDeclarationType } from "../../enums/TsObjectDeclarationType.js";
|
|
5
|
+
import { DiscriminantProperty as _DiscriminantProperty } from "./_ObjectType/DiscriminantProperty.js";
|
|
5
6
|
import { IdentifierPrefixProperty as _IdentifierPrefixProperty } from "./_ObjectType/IdentifierPrefixProperty.js";
|
|
6
7
|
import { IdentifierProperty as _IdentifierProperty } from "./_ObjectType/IdentifierProperty.js";
|
|
7
8
|
import type { Property as _Property } from "./_ObjectType/Property.js";
|
|
8
9
|
import { ShaclProperty as _ShaclProperty } from "./_ObjectType/ShaclProperty.js";
|
|
9
|
-
import {
|
|
10
|
-
import { AbstractDeclaredType } from "./AbstractDeclaredType.js";
|
|
10
|
+
import { AbstractType } from "./AbstractType.js";
|
|
11
11
|
import type { BlankNodeType } from "./BlankNodeType.js";
|
|
12
12
|
import type { IdentifierType } from "./IdentifierType.js";
|
|
13
13
|
import type { IriType } from "./IriType.js";
|
|
14
14
|
import type { Type } from "./Type.js";
|
|
15
15
|
import { type Code } from "./ts-poet-wrapper.js";
|
|
16
|
-
export declare class ObjectType extends
|
|
16
|
+
export declare class ObjectType extends AbstractType {
|
|
17
17
|
private readonly imports;
|
|
18
18
|
protected readonly toRdfTypes: readonly NamedNode[];
|
|
19
19
|
readonly abstract: boolean;
|
|
20
20
|
readonly declarationType: TsObjectDeclarationType;
|
|
21
21
|
readonly extern: boolean;
|
|
22
|
+
readonly features: ReadonlySet<TsFeature>;
|
|
22
23
|
readonly fromRdfType: Maybe<NamedNode>;
|
|
23
|
-
readonly graphqlArgs:
|
|
24
|
+
readonly graphqlArgs: AbstractType["graphqlArgs"];
|
|
24
25
|
readonly identifierType: BlankNodeType | IdentifierType | IriType;
|
|
25
26
|
readonly kind = "ObjectType";
|
|
27
|
+
readonly name: string;
|
|
28
|
+
readonly recursive: boolean;
|
|
26
29
|
readonly staticModuleName: string;
|
|
27
30
|
readonly synthetic: boolean;
|
|
28
31
|
readonly typeofs: NonEmptyList<"object">;
|
|
29
|
-
constructor({ abstract, declarationType, extern, fromRdfType, identifierType, imports, lazyAncestorObjectTypes, lazyChildObjectTypes, lazyDescendantObjectTypes, lazyParentObjectTypes, lazyProperties, staticModuleName, synthetic, toRdfTypes, ...superParameters }: {
|
|
32
|
+
constructor({ abstract, declarationType, extern, features, fromRdfType, identifierType, imports, lazyAncestorObjectTypes, lazyChildObjectTypes, lazyDescendantObjectTypes, lazyDiscriminantProperty, lazyIdentifierProperty, lazyParentObjectTypes, lazyProperties, name, recursive, staticModuleName, synthetic, toRdfTypes, ...superParameters }: {
|
|
30
33
|
abstract: boolean;
|
|
31
34
|
comment: Maybe<string>;
|
|
32
35
|
declarationType: TsObjectDeclarationType;
|
|
33
36
|
extern: boolean;
|
|
37
|
+
features: ReadonlySet<TsFeature>;
|
|
34
38
|
fromRdfType: Maybe<NamedNode>;
|
|
35
|
-
identifierMintingStrategy: Maybe<IdentifierMintingStrategy>;
|
|
36
39
|
identifierType: BlankNodeType | IdentifierType | IriType;
|
|
37
40
|
imports: readonly string[];
|
|
38
41
|
label: Maybe<string>;
|
|
39
42
|
lazyAncestorObjectTypes: () => readonly ObjectType[];
|
|
40
43
|
lazyChildObjectTypes: () => readonly ObjectType[];
|
|
44
|
+
lazyDiscriminantProperty: (objectType: ObjectType) => ObjectType.DiscriminantProperty;
|
|
45
|
+
lazyIdentifierProperty: (objectType: ObjectType) => ObjectType.IdentifierProperty;
|
|
41
46
|
lazyDescendantObjectTypes: () => readonly ObjectType[];
|
|
42
47
|
lazyParentObjectTypes: () => readonly ObjectType[];
|
|
43
48
|
lazyProperties: (objectType: ObjectType) => readonly ObjectType.Property[];
|
|
49
|
+
name: string;
|
|
50
|
+
recursive: boolean;
|
|
44
51
|
staticModuleName: string;
|
|
45
52
|
synthetic: boolean;
|
|
46
53
|
toRdfTypes: readonly NamedNode[];
|
|
47
|
-
} & ConstructorParameters<typeof
|
|
48
|
-
get _discriminantProperty(): AbstractDeclaredType.DiscriminantProperty;
|
|
54
|
+
} & ConstructorParameters<typeof AbstractType>[0]);
|
|
49
55
|
get ancestorObjectTypes(): readonly ObjectType[];
|
|
50
56
|
get childObjectTypes(): readonly ObjectType[];
|
|
51
|
-
get conversions(): readonly
|
|
52
|
-
get declaration(): Code
|
|
57
|
+
get conversions(): readonly AbstractType.Conversion[];
|
|
58
|
+
get declaration(): Maybe<Code>;
|
|
53
59
|
get descendantFromRdfTypeVariables(): readonly Code[];
|
|
54
60
|
get descendantFromRdfTypes(): readonly NamedNode[];
|
|
55
61
|
get descendantObjectTypes(): readonly ObjectType[];
|
|
56
|
-
get discriminantProperty(): Maybe<
|
|
62
|
+
get discriminantProperty(): Maybe<AbstractType.DiscriminantProperty>;
|
|
57
63
|
get discriminantValue(): string;
|
|
58
64
|
get equalsFunction(): Code;
|
|
59
65
|
get filterFunction(): Code;
|
|
60
66
|
get filterType(): Code;
|
|
61
67
|
get fromRdfTypeVariable(): Maybe<Code>;
|
|
62
|
-
get graphqlType():
|
|
68
|
+
get graphqlType(): AbstractType.GraphqlType;
|
|
63
69
|
get identifierProperty(): ObjectType.IdentifierProperty;
|
|
64
70
|
get identifierTypeAlias(): Code;
|
|
65
71
|
get mutable(): boolean;
|
|
@@ -70,30 +76,33 @@ export declare class ObjectType extends AbstractDeclaredType {
|
|
|
70
76
|
get properties(): readonly ObjectType.Property[];
|
|
71
77
|
get schema(): Code;
|
|
72
78
|
get schemaType(): Code;
|
|
73
|
-
get
|
|
74
|
-
get
|
|
79
|
+
get valueSparqlConstructTriplesFunction(): Code;
|
|
80
|
+
get valueSparqlWherePatternsFunction(): Code;
|
|
75
81
|
get toRdfjsResourceType(): Code;
|
|
82
|
+
get _discriminantProperty(): ObjectType.DiscriminantProperty;
|
|
76
83
|
protected get thisVariable(): Code;
|
|
77
|
-
fromJsonExpression({ variables, }: Parameters<
|
|
78
|
-
|
|
84
|
+
fromJsonExpression({ variables, }: Parameters<AbstractType["fromJsonExpression"]>[0]): Code;
|
|
85
|
+
fromRdfResourceValuesExpression({ variables, }: Parameters<AbstractType["fromRdfResourceValuesExpression"]>[0]): Code;
|
|
79
86
|
graphqlResolveExpression({ variables, }: {
|
|
80
87
|
variables: {
|
|
81
88
|
value: Code;
|
|
82
89
|
};
|
|
83
90
|
}): Code;
|
|
84
|
-
hashStatements({ variables, }: Parameters<
|
|
85
|
-
jsonType():
|
|
86
|
-
jsonUiSchemaElement({ variables, }: Parameters<
|
|
87
|
-
jsonZodSchema({ context, }: Parameters<
|
|
91
|
+
hashStatements({ variables, }: Parameters<AbstractType["hashStatements"]>[0]): readonly Code[];
|
|
92
|
+
jsonType(): AbstractType.JsonType;
|
|
93
|
+
jsonUiSchemaElement({ variables, }: Parameters<AbstractType["jsonUiSchemaElement"]>[0]): Maybe<Code>;
|
|
94
|
+
jsonZodSchema({ context, }: Parameters<AbstractType["jsonZodSchema"]>[0]): Code;
|
|
88
95
|
newExpression({ parameters }: {
|
|
89
96
|
parameters: Code;
|
|
90
97
|
}): Code;
|
|
91
|
-
toJsonExpression({ variables, }: Parameters<
|
|
92
|
-
|
|
98
|
+
toJsonExpression({ variables, }: Parameters<AbstractType["toJsonExpression"]>[0]): Code;
|
|
99
|
+
toRdfResourceValuesExpression({ variables, }: Parameters<AbstractType["toRdfResourceValuesExpression"]>[0]): Code;
|
|
93
100
|
protected ensureAtMostOneSuperObjectType(): void;
|
|
94
101
|
private readonly lazyAncestorObjectTypes;
|
|
95
102
|
private readonly lazyChildObjectTypes;
|
|
96
103
|
private readonly lazyDescendantObjectTypes;
|
|
104
|
+
private readonly lazyDiscriminantProperty;
|
|
105
|
+
private readonly lazyIdentifierProperty;
|
|
97
106
|
private readonly lazyParentObjectTypes;
|
|
98
107
|
private readonly lazyProperties;
|
|
99
108
|
}
|
|
@@ -111,7 +120,7 @@ export declare namespace ObjectType {
|
|
|
111
120
|
type Property = _Property;
|
|
112
121
|
const ShaclProperty: typeof _ShaclProperty;
|
|
113
122
|
type ShaclProperty<TypeT extends Type> = _ShaclProperty<TypeT>;
|
|
114
|
-
const
|
|
115
|
-
type
|
|
123
|
+
const DiscriminantProperty: typeof _DiscriminantProperty;
|
|
124
|
+
type DiscriminantProperty = _DiscriminantProperty;
|
|
116
125
|
}
|
|
117
126
|
//# sourceMappingURL=ObjectType.d.ts.map
|