@shaclmate/compiler 4.0.8 → 4.0.10
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 +5 -5
- 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 +17 -15
- package/dist/generators/ts/AbstractCollectionType.d.ts +1 -1
- package/dist/generators/ts/AbstractCollectionType.js +10 -12
- package/dist/generators/ts/AbstractContainerType.d.ts +9 -4
- package/dist/generators/ts/AbstractContainerType.js +10 -3
- 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 +13 -10
- package/dist/generators/ts/AbstractLazyObjectType.js +21 -16
- package/dist/generators/ts/AbstractNamedUnionType.d.ts +33 -0
- package/dist/generators/ts/AbstractNamedUnionType.js +195 -0
- package/dist/generators/ts/AbstractNumericType.d.ts +3 -3
- package/dist/generators/ts/AbstractNumericType.js +4 -4
- package/dist/generators/ts/AbstractTermType.d.ts +7 -4
- package/dist/generators/ts/AbstractTermType.js +7 -4
- package/dist/generators/ts/AbstractType.d.ts +34 -19
- 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 +4 -4
- package/dist/generators/ts/BigDecimalType.js +5 -5
- package/dist/generators/ts/BigIntType.d.ts +1 -1
- package/dist/generators/ts/BigIntType.js +1 -1
- package/dist/generators/ts/BlankNodeType.d.ts +2 -2
- package/dist/generators/ts/BlankNodeType.js +2 -2
- package/dist/generators/ts/BooleanType.d.ts +3 -3
- package/dist/generators/ts/BooleanType.js +3 -3
- package/dist/generators/ts/DateTimeType.d.ts +1 -1
- package/dist/generators/ts/DateTimeType.js +1 -1
- package/dist/generators/ts/DateType.d.ts +1 -1
- package/dist/generators/ts/DateType.js +1 -1
- package/dist/generators/ts/DefaultValueType.d.ts +5 -5
- package/dist/generators/ts/DefaultValueType.js +17 -16
- package/dist/generators/ts/IdentifierType.d.ts +2 -2
- package/dist/generators/ts/IdentifierType.js +2 -2
- package/dist/generators/ts/IriType.d.ts +2 -2
- package/dist/generators/ts/IriType.js +2 -2
- package/dist/generators/ts/LazyObjectOptionType.d.ts +1 -1
- package/dist/generators/ts/LazyObjectOptionType.js +10 -10
- package/dist/generators/ts/LazyObjectSetType.d.ts +1 -1
- package/dist/generators/ts/LazyObjectSetType.js +8 -8
- package/dist/generators/ts/LazyObjectType.d.ts +1 -1
- package/dist/generators/ts/LazyObjectType.js +9 -10
- package/dist/generators/ts/ListType.d.ts +9 -8
- package/dist/generators/ts/ListType.js +15 -14
- package/dist/generators/ts/LiteralType.d.ts +2 -2
- package/dist/generators/ts/LiteralType.js +3 -3
- package/dist/generators/ts/NamedObjectType.d.ts +126 -0
- package/dist/generators/ts/NamedObjectType.js +420 -0
- package/dist/generators/ts/NamedObjectUnionType.d.ts +35 -0
- package/dist/generators/ts/NamedObjectUnionType.js +217 -0
- package/dist/generators/ts/NamedUnionType.d.ts +11 -0
- package/dist/generators/ts/NamedUnionType.js +13 -0
- package/dist/generators/ts/OptionType.d.ts +5 -5
- package/dist/generators/ts/OptionType.js +12 -12
- package/dist/generators/ts/SetType.d.ts +4 -4
- package/dist/generators/ts/SetType.js +13 -11
- package/dist/generators/ts/StringType.d.ts +3 -3
- package/dist/generators/ts/StringType.js +3 -3
- package/dist/generators/ts/TermType.d.ts +2 -2
- package/dist/generators/ts/TermType.js +3 -3
- package/dist/generators/ts/TsGenerator.js +28 -20
- package/dist/generators/ts/Type.d.ts +5 -4
- package/dist/generators/ts/TypeFactory.d.ts +9 -7
- package/dist/generators/ts/TypeFactory.js +139 -112
- package/dist/generators/ts/ZodGenerator.js +18 -16
- package/dist/generators/ts/{_ObjectType → _NamedObjectType}/AbstractProperty.d.ts +9 -9
- package/dist/generators/ts/{_ObjectType → _NamedObjectType}/AbstractProperty.js +3 -3
- package/dist/generators/ts/{_ObjectType/TypeDiscriminantProperty.d.ts → _NamedObjectType/DiscriminantProperty.d.ts} +14 -14
- package/dist/generators/ts/{_ObjectType/TypeDiscriminantProperty.js → _NamedObjectType/DiscriminantProperty.js} +22 -20
- package/dist/generators/ts/{_ObjectType → _NamedObjectType}/IdentifierPrefixProperty.d.ts +3 -3
- package/dist/generators/ts/{_ObjectType → _NamedObjectType}/IdentifierPrefixProperty.js +6 -6
- package/dist/generators/ts/{_ObjectType → _NamedObjectType}/IdentifierProperty.d.ts +3 -3
- package/dist/generators/ts/{_ObjectType → _NamedObjectType}/IdentifierProperty.js +31 -28
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_classDeclaration.d.ts +4 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_classDeclaration.js → _NamedObjectType/NamedObjectType_classDeclaration.js} +15 -15
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_createFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_createFunctionDeclaration.js → _NamedObjectType/NamedObjectType_createFunctionDeclaration.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_equalsFunctionOrMethodDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_equalsFunctionOrMethodDeclaration.js → _NamedObjectType/NamedObjectType_equalsFunctionOrMethodDeclaration.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_filterFunctionDeclaration.d.ts +4 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_filterFunctionDeclaration.js → _NamedObjectType/NamedObjectType_filterFunctionDeclaration.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_filterTypeDeclaration.d.ts +4 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_filterTypeDeclaration.js → _NamedObjectType/NamedObjectType_filterTypeDeclaration.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_sparqlConstructTriplesFunctionDeclaration.js → _NamedObjectType/NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.js} +6 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_sparqlWherePatternsFunctionDeclarations.js → _NamedObjectType/NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.js} +5 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromJsonFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromJsonFunctionDeclaration.js +20 -0
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_fromRdfFunctionDeclaration.js → _NamedObjectType/NamedObjectType_fromRdfResourceFunctionDeclaration.js} +6 -7
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceValuesFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceValuesFunctionDeclaration.js +20 -0
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfTypeVariableStatement.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_fromRdfTypeVariableStatement.js → _NamedObjectType/NamedObjectType_fromRdfTypeVariableStatement.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_graphqlTypeVariableStatement.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_graphqlTypeVariableStatement.js → _NamedObjectType/NamedObjectType_graphqlTypeVariableStatement.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_hashFunctionOrMethodDeclarations.d.ts +4 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_hashFunctionOrMethodDeclarations.js → _NamedObjectType/NamedObjectType_hashFunctionOrMethodDeclarations.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_interfaceDeclaration.d.ts +4 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_interfaceDeclaration.js → _NamedObjectType/NamedObjectType_interfaceDeclaration.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_isTypeFunctionDeclaration.d.ts +4 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_isTypeFunctionDeclaration.js → _NamedObjectType/NamedObjectType_isTypeFunctionDeclaration.js} +4 -4
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonParseFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonParseFunctionDeclaration.js +19 -0
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonSchemaFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_jsonZodSchemaFunctionDeclaration.js → _NamedObjectType/NamedObjectType_jsonSchemaFunctionDeclaration.js} +5 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonTypeAliasDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_jsonTypeAliasDeclaration.js → _NamedObjectType/NamedObjectType_jsonTypeAliasDeclaration.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonUiSchemaFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.js → _NamedObjectType/NamedObjectType_jsonUiSchemaFunctionDeclaration.js} +4 -4
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_objectSetMethodNames.d.ts +9 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_objectSetMethodNames.js → _NamedObjectType/NamedObjectType_objectSetMethodNames.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_propertiesFromJsonFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_propertiesFromJsonFunctionDeclaration.js +38 -0
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_propertiesFromRdfResourceFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_propertiesFromRdfFunctionDeclaration.js → _NamedObjectType/NamedObjectType_propertiesFromRdfResourceFunctionDeclaration.js} +16 -15
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_schemaVariableStatement.d.ts +4 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_schemaVariableStatement.js → _NamedObjectType/NamedObjectType_schemaVariableStatement.js} +3 -4
- package/dist/generators/ts/{_ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.d.ts → _NamedObjectType/NamedObjectType_sparqlConstructQueryFunctionDeclaration.d.ts} +2 -2
- package/dist/generators/ts/{_ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.js → _NamedObjectType/NamedObjectType_sparqlConstructQueryFunctionDeclaration.js} +4 -4
- package/dist/generators/ts/{_ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts → _NamedObjectType/NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts} +2 -2
- package/dist/generators/ts/{_ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.js → _NamedObjectType/NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_toJsonFunctionOrMethodDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_toJsonFunctionOrMethodDeclaration.js → _NamedObjectType/NamedObjectType_toJsonFunctionOrMethodDeclaration.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_toRdfResourceFunctionOrMethodDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_toRdfFunctionOrMethodDeclaration.js → _NamedObjectType/NamedObjectType_toRdfResourceFunctionOrMethodDeclaration.js} +10 -8
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration.js +13 -0
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_valueSparqlWherePatternsFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_valueSparqlWherePatternsFunctionDeclaration.js +15 -0
- package/dist/generators/ts/{_ObjectType → _NamedObjectType}/Property.d.ts +2 -2
- package/dist/generators/ts/{_ObjectType → _NamedObjectType}/ShaclProperty.d.ts +3 -3
- package/dist/generators/ts/{_ObjectType → _NamedObjectType}/ShaclProperty.js +14 -14
- package/dist/generators/ts/_NamedObjectType/identifierTypeDeclarations.d.ts +4 -0
- 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 +4 -4
- package/dist/generators/ts/graphqlSchemaVariableStatement.js +25 -25
- package/dist/generators/ts/imports.d.ts +1 -1
- package/dist/generators/ts/imports.js +1 -1
- package/dist/generators/ts/objectSetDeclarations.d.ts +5 -5
- package/dist/generators/ts/objectSetDeclarations.js +34 -31
- package/dist/generators/ts/objectSetInterfaceDeclaration.d.ts +5 -5
- package/dist/generators/ts/objectSetInterfaceDeclaration.js +6 -4
- package/dist/generators/ts/objectSetMethodSignatures.d.ts +4 -4
- package/dist/generators/ts/objectSetMethodSignatures.js +9 -9
- package/dist/generators/ts/rdfjsDatasetObjectSetClassDeclaration.d.ts +5 -5
- package/dist/generators/ts/rdfjsDatasetObjectSetClassDeclaration.js +54 -53
- package/dist/generators/ts/singleEntryRecord.d.ts +2 -0
- package/dist/generators/ts/singleEntryRecord.js +6 -0
- package/dist/generators/ts/snippets.d.ts +10 -6
- package/dist/generators/ts/snippets.js +20 -12
- package/dist/generators/ts/sparqlObjectSetClassDeclaration.d.ts +5 -5
- package/dist/generators/ts/sparqlObjectSetClassDeclaration.js +19 -20
- package/dist/generators/ts/synthesizeUberObjectUnionType.d.ts +4 -4
- package/dist/generators/ts/synthesizeUberObjectUnionType.js +14 -9
- package/dist/generators/ts/unsupportedObjectSetMethodDeclarations.d.ts +5 -5
- package/dist/generators/ts/unsupportedObjectSetMethodDeclarations.js +2 -2
- 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 +5 -7
- 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/ObjectType.d.ts +0 -117
- package/dist/generators/ts/ObjectType.js +0 -402
- 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_classDeclaration.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_createFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_equalsFunctionOrMethodDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionDeclaration.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_filterTypeDeclaration.d.ts +0 -4
- 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_fromRdfTypeVariableStatement.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_graphqlTypeVariableStatement.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionOrMethodDeclarations.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_interfaceDeclaration.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_isTypeFunctionDeclaration.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaFunctionDeclaration.js +0 -14
- package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeAliasDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_jsonZodSchemaFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_objectSetMethodNames.d.ts +0 -9
- package/dist/generators/ts/_ObjectType/ObjectType_propertiesFromRdfFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_schemaVariableStatement.d.ts +0 -4
- 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_toJsonFunctionOrMethodDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_toRdfFunctionOrMethodDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/identifierTypeDeclarations.d.ts +0 -4
- 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
- /package/dist/generators/ts/{_ObjectType → _NamedObjectType}/Property.js +0 -0
- /package/dist/generators/ts/{_ObjectType → _NamedObjectType}/identifierTypeDeclarations.js +0 -0
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Maybe } from "purify-ts";
|
|
2
|
-
import type { ObjectType } from "../ObjectType.js";
|
|
3
|
-
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
-
export declare function ObjectType_jsonSchemaFunctionDeclaration(this: ObjectType): Maybe<Code>;
|
|
5
|
-
//# sourceMappingURL=ObjectType_jsonSchemaFunctionDeclaration.d.ts.map
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Maybe } from "purify-ts";
|
|
2
|
-
import { imports } from "../imports.js";
|
|
3
|
-
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
4
|
-
import { code } from "../ts-poet-wrapper.js";
|
|
5
|
-
export function ObjectType_jsonSchemaFunctionDeclaration() {
|
|
6
|
-
if (!this.features.has("json")) {
|
|
7
|
-
return Maybe.empty();
|
|
8
|
-
}
|
|
9
|
-
return Maybe.of(code `\
|
|
10
|
-
export function ${syntheticNamePrefix}jsonSchema() {
|
|
11
|
-
return ${imports.z}.toJSONSchema(${syntheticNamePrefix}jsonZodSchema());
|
|
12
|
-
}`);
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=ObjectType_jsonSchemaFunctionDeclaration.js.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Maybe } from "purify-ts";
|
|
2
|
-
import type { ObjectType } from "../ObjectType.js";
|
|
3
|
-
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
-
export declare function ObjectType_jsonTypeAliasDeclaration(this: ObjectType): Maybe<Code>;
|
|
5
|
-
//# sourceMappingURL=ObjectType_jsonTypeAliasDeclaration.d.ts.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Maybe } from "purify-ts";
|
|
2
|
-
import type { ObjectType } from "../ObjectType.js";
|
|
3
|
-
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
-
export declare function ObjectType_jsonUiSchemaFunctionDeclaration(this: ObjectType): Maybe<Code>;
|
|
5
|
-
//# sourceMappingURL=ObjectType_jsonUiSchemaFunctionDeclaration.d.ts.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Maybe } from "purify-ts";
|
|
2
|
-
import type { ObjectType } from "../ObjectType.js";
|
|
3
|
-
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
-
export declare function ObjectType_jsonZodSchemaFunctionDeclaration(this: ObjectType): Maybe<Code>;
|
|
5
|
-
//# sourceMappingURL=ObjectType_jsonZodSchemaFunctionDeclaration.d.ts.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Maybe } from "purify-ts";
|
|
2
|
-
import type { ObjectType } from "../ObjectType.js";
|
|
3
|
-
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
-
export declare function ObjectType_propertiesFromRdfFunctionDeclaration(this: ObjectType): Maybe<Code>;
|
|
5
|
-
//# sourceMappingURL=ObjectType_propertiesFromRdfFunctionDeclaration.d.ts.map
|
package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructTriplesFunctionDeclaration.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Maybe } from "purify-ts";
|
|
2
|
-
import type { ObjectType } from "../ObjectType.js";
|
|
3
|
-
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
-
export declare function ObjectType_sparqlConstructTriplesFunctionDeclaration(this: ObjectType): Maybe<Code>;
|
|
5
|
-
//# sourceMappingURL=ObjectType_sparqlConstructTriplesFunctionDeclaration.d.ts.map
|
package/dist/generators/ts/_ObjectType/ObjectType_sparqlWherePatternsFunctionDeclarations.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Maybe } from "purify-ts";
|
|
2
|
-
import type { ObjectType } from "../ObjectType.js";
|
|
3
|
-
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
-
export declare function ObjectType_sparqlWherePatternsFunctionDeclaration(this: ObjectType): Maybe<Code>;
|
|
5
|
-
//# sourceMappingURL=ObjectType_sparqlWherePatternsFunctionDeclarations.d.ts.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Maybe } from "purify-ts";
|
|
2
|
-
import type { ObjectType } from "../ObjectType.js";
|
|
3
|
-
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
-
export declare function ObjectType_toJsonFunctionOrMethodDeclaration(this: ObjectType): Maybe<Code>;
|
|
5
|
-
//# sourceMappingURL=ObjectType_toJsonFunctionOrMethodDeclaration.d.ts.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Maybe } from "purify-ts";
|
|
2
|
-
import type { ObjectType } from "../ObjectType.js";
|
|
3
|
-
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
-
export declare function ObjectType_toRdfFunctionOrMethodDeclaration(this: ObjectType): Maybe<Code>;
|
|
5
|
-
//# sourceMappingURL=ObjectType_toRdfFunctionOrMethodDeclaration.d.ts.map
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { AbstractDeclaredType } from "../AbstractDeclaredType.js";
|
|
2
|
-
import type { ObjectType } from "../ObjectType.js";
|
|
3
|
-
export declare class MemberType {
|
|
4
|
-
private readonly delegate;
|
|
5
|
-
private readonly universe;
|
|
6
|
-
constructor({ delegate, universe, }: {
|
|
7
|
-
delegate: ObjectType;
|
|
8
|
-
universe: readonly ObjectType[];
|
|
9
|
-
});
|
|
10
|
-
get _discriminantProperty(): import("../AbstractType.js").AbstractType.DiscriminantProperty;
|
|
11
|
-
get abstract(): boolean;
|
|
12
|
-
get ancestorObjectTypes(): readonly ObjectType[];
|
|
13
|
-
get declarationType(): import("../../../enums/TsObjectDeclarationType.js").TsObjectDeclarationType;
|
|
14
|
-
get descendantFromRdfTypeVariables(): readonly import("ts-poet").Code[];
|
|
15
|
-
get discriminantPropertyValues(): readonly string[];
|
|
16
|
-
get features(): ReadonlySet<"create" | "equals" | "graphql" | "hash" | "json" | "rdf" | "sparql">;
|
|
17
|
-
get filterFunction(): import("ts-poet").Code;
|
|
18
|
-
get filterType(): import("ts-poet").Code;
|
|
19
|
-
get fromRdfType(): import("purify-ts").Maybe<import("@rdfjs/types").NamedNode<string>>;
|
|
20
|
-
get fromRdfTypeVariable(): import("purify-ts").Maybe<import("ts-poet").Code>;
|
|
21
|
-
get graphqlType(): import("../AbstractType.js").AbstractType.GraphqlType;
|
|
22
|
-
get identifierTypeAlias(): import("ts-poet").Code;
|
|
23
|
-
get mutable(): boolean;
|
|
24
|
-
get name(): string;
|
|
25
|
-
get ownProperties(): readonly import("../_ObjectType/Property.js").Property[];
|
|
26
|
-
get properties(): readonly import("../_ObjectType/Property.js").Property[];
|
|
27
|
-
get staticModuleName(): string;
|
|
28
|
-
get toRdfjsResourceType(): import("ts-poet").Code;
|
|
29
|
-
jsonType(): import("../AbstractType.js").AbstractType.JsonType;
|
|
30
|
-
jsonZodSchema(parameters: Parameters<AbstractDeclaredType["jsonZodSchema"]>[0]): import("ts-poet").Code;
|
|
31
|
-
newExpression(parameters: Parameters<ObjectType["newExpression"]>[0]): import("ts-poet").Code;
|
|
32
|
-
toObjectType(): ObjectType;
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=MemberType.d.ts.map
|
|
@@ -1,105 +0,0 @@
|
|
|
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 { Memoize } from "typescript-memoize";
|
|
8
|
-
export class MemberType {
|
|
9
|
-
delegate;
|
|
10
|
-
universe;
|
|
11
|
-
constructor({ delegate, universe, }) {
|
|
12
|
-
this.delegate = delegate;
|
|
13
|
-
this.universe = universe;
|
|
14
|
-
}
|
|
15
|
-
get _discriminantProperty() {
|
|
16
|
-
return this.delegate._discriminantProperty;
|
|
17
|
-
}
|
|
18
|
-
get abstract() {
|
|
19
|
-
return this.delegate.abstract;
|
|
20
|
-
}
|
|
21
|
-
get ancestorObjectTypes() {
|
|
22
|
-
return this.delegate.ancestorObjectTypes;
|
|
23
|
-
}
|
|
24
|
-
get declarationType() {
|
|
25
|
-
return this.delegate.declarationType;
|
|
26
|
-
}
|
|
27
|
-
get descendantFromRdfTypeVariables() {
|
|
28
|
-
return this.delegate.descendantFromRdfTypeVariables;
|
|
29
|
-
}
|
|
30
|
-
get discriminantPropertyValues() {
|
|
31
|
-
// A member type's combined discriminant property values are its "own" values plus any descendant values that are
|
|
32
|
-
// not the "own" values of some other member type.
|
|
33
|
-
// So if you have type A, type B, and B inherits A, then
|
|
34
|
-
// A has
|
|
35
|
-
// own discriminant property values: ["A"]
|
|
36
|
-
// descendant discriminant property values: ["B"]
|
|
37
|
-
// and B has
|
|
38
|
-
// own discriminant property values: ["B"]
|
|
39
|
-
// descendant discriminant property values ["B"]
|
|
40
|
-
// In this case A shouldn't have "B" as a combined discriminant property value since it's "claimed" by B.
|
|
41
|
-
const memberOwnDiscriminantPropertyValues = new Set();
|
|
42
|
-
for (const memberType of this.universe) {
|
|
43
|
-
for (const ownDiscriminantPropertyValue of memberType.discriminantProperty.unsafeCoerce()
|
|
44
|
-
.ownValues) {
|
|
45
|
-
memberOwnDiscriminantPropertyValues.add(ownDiscriminantPropertyValue);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
return this.delegate._discriminantProperty.ownValues.concat(this.delegate._discriminantProperty.descendantValues.filter((value) => !memberOwnDiscriminantPropertyValues.has(value)));
|
|
49
|
-
}
|
|
50
|
-
get features() {
|
|
51
|
-
return this.delegate.features;
|
|
52
|
-
}
|
|
53
|
-
get filterFunction() {
|
|
54
|
-
return this.delegate.filterFunction;
|
|
55
|
-
}
|
|
56
|
-
get filterType() {
|
|
57
|
-
return this.delegate.filterType;
|
|
58
|
-
}
|
|
59
|
-
get fromRdfType() {
|
|
60
|
-
return this.delegate.fromRdfType;
|
|
61
|
-
}
|
|
62
|
-
get fromRdfTypeVariable() {
|
|
63
|
-
return this.delegate.fromRdfTypeVariable;
|
|
64
|
-
}
|
|
65
|
-
get graphqlType() {
|
|
66
|
-
return this.delegate.graphqlType;
|
|
67
|
-
}
|
|
68
|
-
get identifierTypeAlias() {
|
|
69
|
-
return this.delegate.identifierTypeAlias;
|
|
70
|
-
}
|
|
71
|
-
get mutable() {
|
|
72
|
-
return this.delegate.mutable;
|
|
73
|
-
}
|
|
74
|
-
get name() {
|
|
75
|
-
return this.delegate.name;
|
|
76
|
-
}
|
|
77
|
-
get ownProperties() {
|
|
78
|
-
return this.delegate.ownProperties;
|
|
79
|
-
}
|
|
80
|
-
get properties() {
|
|
81
|
-
return this.delegate.properties;
|
|
82
|
-
}
|
|
83
|
-
get staticModuleName() {
|
|
84
|
-
return this.delegate.staticModuleName;
|
|
85
|
-
}
|
|
86
|
-
get toRdfjsResourceType() {
|
|
87
|
-
return this.delegate.toRdfjsResourceType;
|
|
88
|
-
}
|
|
89
|
-
jsonType() {
|
|
90
|
-
return this.delegate.jsonType();
|
|
91
|
-
}
|
|
92
|
-
jsonZodSchema(parameters) {
|
|
93
|
-
return this.delegate.jsonZodSchema(parameters);
|
|
94
|
-
}
|
|
95
|
-
newExpression(parameters) {
|
|
96
|
-
return this.delegate.newExpression(parameters);
|
|
97
|
-
}
|
|
98
|
-
toObjectType() {
|
|
99
|
-
return this.delegate;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
__decorate([
|
|
103
|
-
Memoize()
|
|
104
|
-
], MemberType.prototype, "discriminantPropertyValues", null);
|
|
105
|
-
//# sourceMappingURL=MemberType.js.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Maybe } from "purify-ts";
|
|
2
|
-
import type { ObjectUnionType } from "../ObjectUnionType.js";
|
|
3
|
-
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
-
export declare function ObjectUnionType_equalsFunctionDeclaration(this: ObjectUnionType): Maybe<Code>;
|
|
5
|
-
//# sourceMappingURL=ObjectUnionType_equalsFunctionDeclaration.d.ts.map
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { Maybe } from "purify-ts";
|
|
2
|
-
import { snippets } from "../snippets.js";
|
|
3
|
-
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
4
|
-
import { code, joinCode } from "../ts-poet-wrapper.js";
|
|
5
|
-
export function ObjectUnionType_equalsFunctionDeclaration() {
|
|
6
|
-
if (!this.features.has("equals")) {
|
|
7
|
-
return Maybe.empty();
|
|
8
|
-
}
|
|
9
|
-
return Maybe.of(code `\
|
|
10
|
-
export function ${syntheticNamePrefix}equals(left: ${this.name}, right: ${this.name}): ${snippets.EqualsResult} {
|
|
11
|
-
return ${syntheticNamePrefix}strictEquals(left.${syntheticNamePrefix}type, right.${syntheticNamePrefix}type).chain(() => {
|
|
12
|
-
${joinCode(this.concreteMemberTypes
|
|
13
|
-
.map((memberType) => {
|
|
14
|
-
let returnExpression;
|
|
15
|
-
switch (memberType.declarationType) {
|
|
16
|
-
case "class":
|
|
17
|
-
returnExpression = code `left.${syntheticNamePrefix}equals(right as unknown as ${memberType.name})`;
|
|
18
|
-
break;
|
|
19
|
-
case "interface":
|
|
20
|
-
returnExpression = code `${memberType.staticModuleName}.${syntheticNamePrefix}equals(left, right as unknown as ${memberType.name})`;
|
|
21
|
-
break;
|
|
22
|
-
}
|
|
23
|
-
return code `if (${memberType.staticModuleName}.is${memberType.name}(left)) { return ${returnExpression}; }`;
|
|
24
|
-
})
|
|
25
|
-
.concat(code `return ${snippets.EqualsResult}.Equal;`))}
|
|
26
|
-
});
|
|
27
|
-
}`);
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=ObjectUnionType_equalsFunctionDeclaration.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { ObjectUnionType } from "../ObjectUnionType.js";
|
|
2
|
-
import { type Code } from "../ts-poet-wrapper.js";
|
|
3
|
-
export declare function ObjectUnionType_filterFunctionDeclaration(this: ObjectUnionType): Code;
|
|
4
|
-
//# sourceMappingURL=ObjectUnionType_filterFunctionDeclaration.d.ts.map
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
2
|
-
import { code, joinCode } from "../ts-poet-wrapper.js";
|
|
3
|
-
export function ObjectUnionType_filterFunctionDeclaration() {
|
|
4
|
-
return code `\
|
|
5
|
-
export function ${syntheticNamePrefix}filter(filter: ${this.filterType}, value: ${this.name}): boolean {
|
|
6
|
-
${joinCode([
|
|
7
|
-
code `\
|
|
8
|
-
if (filter.${syntheticNamePrefix}identifier !== undefined && !${this.identifierType.filterFunction}(filter.${syntheticNamePrefix}identifier, value.${syntheticNamePrefix}identifier)) {
|
|
9
|
-
return false;
|
|
10
|
-
}`,
|
|
11
|
-
...this.memberTypes.map((memberType) => code `\
|
|
12
|
-
if (${memberType.staticModuleName}.is${memberType.name}(value) && filter.on?.${memberType.name} && !${memberType.filterFunction}(filter.on.${memberType.name}, value as ${memberType.name})) {
|
|
13
|
-
return false;
|
|
14
|
-
}`),
|
|
15
|
-
code `return true;`,
|
|
16
|
-
])}
|
|
17
|
-
}`;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=ObjectUnionType_filterFunctionDeclaration.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { ObjectUnionType } from "../ObjectUnionType.js";
|
|
2
|
-
import { type Code } from "../ts-poet-wrapper.js";
|
|
3
|
-
export declare function ObjectUnionType_filterTypeDeclaration(this: ObjectUnionType): Code;
|
|
4
|
-
//# sourceMappingURL=ObjectUnionType_filterTypeDeclaration.d.ts.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
2
|
-
import { code, joinCode } from "../ts-poet-wrapper.js";
|
|
3
|
-
export function ObjectUnionType_filterTypeDeclaration() {
|
|
4
|
-
return code `\
|
|
5
|
-
export interface ${syntheticNamePrefix}Filter {
|
|
6
|
-
readonly ${syntheticNamePrefix}identifier?: ${this.identifierType.filterType};
|
|
7
|
-
readonly on?: { ${joinCode(this.memberTypes.map((memberType) => code `readonly ${memberType.name}?: Omit<${memberType.filterType}, "${syntheticNamePrefix}identifier">;`))} }
|
|
8
|
-
}`;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=ObjectUnionType_filterTypeDeclaration.js.map
|
package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_fromJsonFunctionDeclaration.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Maybe } from "purify-ts";
|
|
2
|
-
import { type Code } from "ts-poet";
|
|
3
|
-
import type { ObjectUnionType } from "../ObjectUnionType.js";
|
|
4
|
-
export declare function ObjectUnionType_fromJsonFunctionDeclaration(this: ObjectUnionType): Maybe<Code>;
|
|
5
|
-
//# sourceMappingURL=ObjectUnionType_fromJsonFunctionDeclaration.d.ts.map
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Maybe } from "purify-ts";
|
|
2
|
-
import { code } from "ts-poet";
|
|
3
|
-
import { imports } from "../imports.js";
|
|
4
|
-
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
5
|
-
export function ObjectUnionType_fromJsonFunctionDeclaration() {
|
|
6
|
-
if (!this.features.has("json")) {
|
|
7
|
-
return Maybe.empty();
|
|
8
|
-
}
|
|
9
|
-
return Maybe.of(code `\
|
|
10
|
-
export function ${syntheticNamePrefix}fromJson(json: unknown): ${imports.Either}<${imports.z}.ZodError, ${this.name}> {
|
|
11
|
-
return ${this.concreteMemberTypes.reduce((expression, memberType) => {
|
|
12
|
-
const memberTypeExpression = code `(${memberType.staticModuleName}.${syntheticNamePrefix}fromJson(json) as ${imports.Either}<${imports.z}.ZodError, ${this.name}>)`;
|
|
13
|
-
return expression !== null
|
|
14
|
-
? code `${expression}.altLazy(() => ${memberTypeExpression})`
|
|
15
|
-
: memberTypeExpression;
|
|
16
|
-
}, null)};
|
|
17
|
-
}`);
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=ObjectUnionType_fromJsonFunctionDeclaration.js.map
|
package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_fromRdfFunctionDeclarations.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Maybe } from "purify-ts";
|
|
2
|
-
import type { ObjectUnionType } from "../ObjectUnionType.js";
|
|
3
|
-
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
-
export declare function ObjectUnionType_fromRdfFunctionDeclaration(this: ObjectUnionType): Maybe<Code>;
|
|
5
|
-
//# sourceMappingURL=ObjectUnionType_fromRdfFunctionDeclarations.d.ts.map
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Maybe } from "purify-ts";
|
|
2
|
-
import { imports } from "../imports.js";
|
|
3
|
-
import { snippets } from "../snippets.js";
|
|
4
|
-
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
5
|
-
import { code } from "../ts-poet-wrapper.js";
|
|
6
|
-
export function ObjectUnionType_fromRdfFunctionDeclaration() {
|
|
7
|
-
if (!this.features.has("rdf")) {
|
|
8
|
-
return Maybe.empty();
|
|
9
|
-
}
|
|
10
|
-
return Maybe.of(code `\
|
|
11
|
-
export function ${syntheticNamePrefix}fromRdf(resource: ${imports.Resource}, options?: ${snippets.FromRdfOptions}): ${imports.Either}<Error, ${this.name}> {
|
|
12
|
-
return ${this.concreteMemberTypes.reduce((expression, memberType) => {
|
|
13
|
-
const memberTypeExpression = code `(${memberType.staticModuleName}.${syntheticNamePrefix}fromRdf(resource, { ...options, ignoreRdfType: false }) as ${imports.Either}<Error, ${this.name}>)`;
|
|
14
|
-
return expression !== null
|
|
15
|
-
? code `${expression}.altLazy(() => ${memberTypeExpression})`
|
|
16
|
-
: memberTypeExpression;
|
|
17
|
-
}, null)};
|
|
18
|
-
}`);
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=ObjectUnionType_fromRdfFunctionDeclarations.js.map
|
package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_graphqlTypeVariableStatement.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Maybe } from "purify-ts";
|
|
2
|
-
import type { ObjectUnionType } from "../ObjectUnionType.js";
|
|
3
|
-
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
-
export declare function ObjectUnionType_graphqlTypeVariableStatement(this: ObjectUnionType): Maybe<Code>;
|
|
5
|
-
//# sourceMappingURL=ObjectUnionType_graphqlTypeVariableStatement.d.ts.map
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Maybe } from "purify-ts";
|
|
2
|
-
import { imports } from "../imports.js";
|
|
3
|
-
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
4
|
-
import { code, joinCode } from "../ts-poet-wrapper.js";
|
|
5
|
-
export function ObjectUnionType_graphqlTypeVariableStatement() {
|
|
6
|
-
if (!this.features.has("graphql")) {
|
|
7
|
-
return Maybe.empty();
|
|
8
|
-
}
|
|
9
|
-
return Maybe.of(code `\
|
|
10
|
-
export const ${syntheticNamePrefix}GraphQL = new ${imports.GraphQLUnionType}(${{
|
|
11
|
-
description: this.comment.map(JSON.stringify).extract(),
|
|
12
|
-
name: this.name,
|
|
13
|
-
resolveType: code `(value: ${this.name}) => value.${syntheticNamePrefix}type`,
|
|
14
|
-
types: code `[${joinCode(this.concreteMemberTypes.map((memberType) => memberType.graphqlType.nullableName), { on: ", " })}]`,
|
|
15
|
-
}});
|
|
16
|
-
`);
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=ObjectUnionType_graphqlTypeVariableStatement.js.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Maybe } from "purify-ts";
|
|
2
|
-
import type { ObjectUnionType } from "../ObjectUnionType.js";
|
|
3
|
-
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
-
export declare function ObjectUnionType_hashFunctionDeclaration(this: ObjectUnionType): Maybe<Code>;
|
|
5
|
-
//# sourceMappingURL=ObjectUnionType_hashFunctionDeclaration.d.ts.map
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Maybe } from "purify-ts";
|
|
2
|
-
import { snippets } from "../snippets.js";
|
|
3
|
-
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
4
|
-
import { code, joinCode } from "../ts-poet-wrapper.js";
|
|
5
|
-
const hasherVariable = code `_hasher`;
|
|
6
|
-
export function ObjectUnionType_hashFunctionDeclaration() {
|
|
7
|
-
if (!this.features.has("hash")) {
|
|
8
|
-
return Maybe.empty();
|
|
9
|
-
}
|
|
10
|
-
return Maybe.of(code `\
|
|
11
|
-
export function ${syntheticNamePrefix}hash<HasherT extends ${snippets.Hasher}>(${this.thisVariable}: ${this.name}, ${hasherVariable}: HasherT): HasherT {
|
|
12
|
-
${joinCode(this.concreteMemberTypes
|
|
13
|
-
.map((memberType) => {
|
|
14
|
-
let returnExpression;
|
|
15
|
-
switch (memberType.declarationType) {
|
|
16
|
-
case "class":
|
|
17
|
-
returnExpression = code `${this.thisVariable}.${syntheticNamePrefix}hash(${hasherVariable})`;
|
|
18
|
-
break;
|
|
19
|
-
case "interface":
|
|
20
|
-
returnExpression = code `${memberType.staticModuleName}.${syntheticNamePrefix}hash(${this.thisVariable}, ${hasherVariable})`;
|
|
21
|
-
break;
|
|
22
|
-
}
|
|
23
|
-
return code `if (${memberType.staticModuleName}.is${memberType.name}(${this.thisVariable})) { return ${returnExpression}; }`;
|
|
24
|
-
})
|
|
25
|
-
.concat(code `throw new Error("unrecognized type");`))}
|
|
26
|
-
}`);
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=ObjectUnionType_hashFunctionDeclaration.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { ObjectUnionType } from "../ObjectUnionType.js";
|
|
2
|
-
import { type Code } from "../ts-poet-wrapper.js";
|
|
3
|
-
export declare function ObjectUnionType_identifierTypeDeclarations(this: ObjectUnionType): readonly Code[];
|
|
4
|
-
//# sourceMappingURL=ObjectUnionType_identifierTypeDeclarations.d.ts.map
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
2
|
-
import { code, joinCode } from "../ts-poet-wrapper.js";
|
|
3
|
-
export function ObjectUnionType_identifierTypeDeclarations() {
|
|
4
|
-
return [
|
|
5
|
-
code `export type ${syntheticNamePrefix}Identifier = ${this.identifierType.name};`,
|
|
6
|
-
code `export namespace ${syntheticNamePrefix}Identifier { ${joinCode([this.identifierType.fromStringFunction, this.identifierType.toStringFunction])} }`,
|
|
7
|
-
];
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=ObjectUnionType_identifierTypeDeclarations.js.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Maybe } from "purify-ts";
|
|
2
|
-
import type { ObjectUnionType } from "../ObjectUnionType.js";
|
|
3
|
-
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
-
export declare function ObjectUnionType_isTypeFunctionDeclaration(this: ObjectUnionType): Maybe<Code>;
|
|
5
|
-
//# sourceMappingURL=ObjectUnionType_isTypeFunctionDeclaration.d.ts.map
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Maybe } from "purify-ts";
|
|
2
|
-
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
3
|
-
import { code, joinCode } from "../ts-poet-wrapper.js";
|
|
4
|
-
export function ObjectUnionType_isTypeFunctionDeclaration() {
|
|
5
|
-
if (this.name === `${syntheticNamePrefix}Object`) {
|
|
6
|
-
return Maybe.empty();
|
|
7
|
-
}
|
|
8
|
-
return Maybe.of(code `\
|
|
9
|
-
export function is${this.name}(object: ${syntheticNamePrefix}Object): object is ${this.name} {
|
|
10
|
-
return ${joinCode(this.memberTypes.map((memberType) => code `${memberType.staticModuleName}.is${memberType.name}(object)`), { on: " || " })};
|
|
11
|
-
}`);
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=ObjectUnionType_isTypeFunctionDeclaration.js.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Maybe } from "purify-ts";
|
|
2
|
-
import type { ObjectUnionType } from "../ObjectUnionType.js";
|
|
3
|
-
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
-
export declare function ObjectUnionType_jsonTypeAliasDeclaration(this: ObjectUnionType): Maybe<Code>;
|
|
5
|
-
//# sourceMappingURL=ObjectUnionType_jsonTypeAliasDeclaration.d.ts.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Maybe } from "purify-ts";
|
|
2
|
-
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
3
|
-
import { code, joinCode } from "../ts-poet-wrapper.js";
|
|
4
|
-
export function ObjectUnionType_jsonTypeAliasDeclaration() {
|
|
5
|
-
if (!this.features.has("json")) {
|
|
6
|
-
return Maybe.empty();
|
|
7
|
-
}
|
|
8
|
-
return Maybe.of(code `export type ${syntheticNamePrefix}Json = ${joinCode(this.concreteMemberTypes.map((memberType) => code `${memberType.jsonType().name}`), { on: " | " })};`);
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=ObjectUnionType_jsonTypeAliasDeclaration.js.map
|
package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_jsonZodSchemaFunctionDeclaration.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Maybe } from "purify-ts";
|
|
2
|
-
import { type Code } from "ts-poet";
|
|
3
|
-
import type { ObjectUnionType } from "../ObjectUnionType.js";
|
|
4
|
-
export declare function ObjectUnionType_jsonZodSchemaFunctionDeclaration(this: ObjectUnionType): Maybe<Code>;
|
|
5
|
-
//# sourceMappingURL=ObjectUnionType_jsonZodSchemaFunctionDeclaration.d.ts.map
|
package/dist/generators/ts/_ObjectUnionType/ObjectUnionType_jsonZodSchemaFunctionDeclaration.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Maybe } from "purify-ts";
|
|
2
|
-
import { code, joinCode } from "ts-poet";
|
|
3
|
-
import { imports } from "../imports.js";
|
|
4
|
-
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
5
|
-
export function ObjectUnionType_jsonZodSchemaFunctionDeclaration() {
|
|
6
|
-
if (!this.features.has("json")) {
|
|
7
|
-
return Maybe.empty();
|
|
8
|
-
}
|
|
9
|
-
return Maybe.of(code `\
|
|
10
|
-
export function ${syntheticNamePrefix}jsonZodSchema() {
|
|
11
|
-
return ${imports.z}.discriminatedUnion("${this._discriminantProperty.name}", [${joinCode(this.concreteMemberTypes.map((memberType) => memberType.jsonZodSchema({ context: "type" })), { on: ", " })}]);
|
|
12
|
-
}`);
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=ObjectUnionType_jsonZodSchemaFunctionDeclaration.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { ObjectUnionType } from "../ObjectUnionType.js";
|
|
2
|
-
import { type Code } from "../ts-poet-wrapper.js";
|
|
3
|
-
export declare function ObjectUnionType_schemaVariableStatement(this: ObjectUnionType): Code;
|
|
4
|
-
//# sourceMappingURL=ObjectUnionType_schemaVariableStatement.d.ts.map
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { PropertyPath } from "rdfjs-resource";
|
|
2
|
-
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
3
|
-
import { code, joinCode } from "../ts-poet-wrapper.js";
|
|
4
|
-
export function ObjectUnionType_schemaVariableStatement() {
|
|
5
|
-
const commonPropertiesByName = {};
|
|
6
|
-
this.memberTypes.forEach((memberType, memberTypeI) => {
|
|
7
|
-
for (const memberTypeProperty of memberType.ownProperties.concat(memberType.ancestorObjectTypes.flatMap((ancestorObjectType) => ancestorObjectType.ownProperties))) {
|
|
8
|
-
if (memberTypeProperty.kind !== "ShaclProperty") {
|
|
9
|
-
continue;
|
|
10
|
-
}
|
|
11
|
-
let commonProperty = commonPropertiesByName[memberTypeProperty.name];
|
|
12
|
-
if (commonProperty) {
|
|
13
|
-
if (PropertyPath.equals(commonProperty.property.path, memberTypeProperty.path)) {
|
|
14
|
-
commonProperty.memberTypesWithProperty[memberTypeI] = true;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
else {
|
|
18
|
-
commonPropertiesByName[memberTypeProperty.name] = commonProperty = {
|
|
19
|
-
memberTypesWithProperty: new Array(this.memberTypes.length).fill(false),
|
|
20
|
-
property: memberTypeProperty,
|
|
21
|
-
};
|
|
22
|
-
commonProperty.memberTypesWithProperty[memberTypeI] = true;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
const propertiesObject = [];
|
|
27
|
-
for (const name of Object.keys(commonPropertiesByName).toSorted()) {
|
|
28
|
-
const { memberTypesWithProperty, property } = commonPropertiesByName[name];
|
|
29
|
-
if (!memberTypesWithProperty.every((value) => value)) {
|
|
30
|
-
continue;
|
|
31
|
-
}
|
|
32
|
-
propertiesObject.push(code `${property.name}: ${property.schema}`);
|
|
33
|
-
}
|
|
34
|
-
return code `\
|
|
35
|
-
export const ${syntheticNamePrefix}schema = { properties: { ${joinCode(propertiesObject, { on: ", " })} } } as const;`;
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=ObjectUnionType_schemaVariableStatement.js.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Maybe } from "purify-ts";
|
|
2
|
-
import type { ObjectUnionType } from "../ObjectUnionType.js";
|
|
3
|
-
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
-
export declare function ObjectUnionType_sparqlConstructTriplesFunctionDeclaration(this: ObjectUnionType): Maybe<Code>;
|
|
5
|
-
//# sourceMappingURL=ObjectUnionType_sparqlConstructTriplesFunctionDeclaration.d.ts.map
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { pascalCase } from "change-case";
|
|
2
|
-
import { Maybe } from "purify-ts";
|
|
3
|
-
import { imports } from "../imports.js";
|
|
4
|
-
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
5
|
-
import { code, joinCode } from "../ts-poet-wrapper.js";
|
|
6
|
-
export function ObjectUnionType_sparqlConstructTriplesFunctionDeclaration() {
|
|
7
|
-
if (!this.features.has("sparql")) {
|
|
8
|
-
return Maybe.empty();
|
|
9
|
-
}
|
|
10
|
-
return Maybe.of(code `\
|
|
11
|
-
export function ${syntheticNamePrefix}sparqlConstructTriples({ filter, focusIdentifier, variablePrefix }: { filter: ${this.filterType} | undefined; focusIdentifier: ${imports.NamedNode} | ${imports.Variable}; ignoreRdfType: boolean; variablePrefix: string }): readonly ${imports.sparqljs}.Triple[] {
|
|
12
|
-
return [${joinCode(this.concreteMemberTypes.map((memberType) => code `...${memberType.staticModuleName}.${syntheticNamePrefix}sparqlConstructTriples({ filter: filter?.on?.${memberType.name}, focusIdentifier, ignoreRdfType: false, variablePrefix: \`\${variablePrefix}${pascalCase(memberType.name)}\` }).concat()`), { on: ", " })}];
|
|
13
|
-
}`);
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=ObjectUnionType_sparqlConstructTriplesFunctionDeclaration.js.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Maybe } from "purify-ts";
|
|
2
|
-
import type { ObjectUnionType } from "../ObjectUnionType.js";
|
|
3
|
-
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
-
export declare function ObjectUnionType_sparqlWherePatternsFunctionDeclaration(this: ObjectUnionType): Maybe<Code>;
|
|
5
|
-
//# sourceMappingURL=ObjectUnionType_sparqlWherePatternsFunctionDeclaration.d.ts.map
|