@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
|
@@ -11,7 +11,7 @@ const variables = {
|
|
|
11
11
|
focusIdentifier: code `parameters.focusIdentifier`,
|
|
12
12
|
variablePrefix: code `parameters.variablePrefix`,
|
|
13
13
|
};
|
|
14
|
-
export function
|
|
14
|
+
export function NamedObjectType_focusSparqlWherePatternsFunctionDeclaration() {
|
|
15
15
|
if (!this.features.has("sparql")) {
|
|
16
16
|
return Maybe.empty();
|
|
17
17
|
}
|
|
@@ -21,7 +21,7 @@ export function ObjectType_sparqlWherePatternsFunctionDeclaration() {
|
|
|
21
21
|
const statements = [];
|
|
22
22
|
for (const parentObjectType of this.parentObjectTypes) {
|
|
23
23
|
statements.push(code `\
|
|
24
|
-
patterns = patterns.concat(${parentObjectType.staticModuleName}.${syntheticNamePrefix}
|
|
24
|
+
patterns = patterns.concat(${parentObjectType.staticModuleName}.${syntheticNamePrefix}focusSparqlWherePatterns(${{ filter: variables.filter, focusIdentifier: variables.focusIdentifier, ignoreRdfType: true, preferredLanguages: variables.preferredLanguages, variablePrefix: variables.variablePrefix }}));`);
|
|
25
25
|
patternsVariableDeclarationKeyword = "let";
|
|
26
26
|
}
|
|
27
27
|
if (this.fromRdfType.isJust()) {
|
|
@@ -93,7 +93,7 @@ if (!parameters?.ignoreRdfType) {
|
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
95
|
return Maybe.of(code `\
|
|
96
|
-
export
|
|
96
|
+
export const ${syntheticNamePrefix}focusSparqlWherePatterns: ${snippets.FocusSparqlWherePatternsFunction}<${this.filterType}> = (${statements.length === 0 ? "_" : ""}parameters) => {
|
|
97
97
|
${statements.length > 0
|
|
98
98
|
? joinCode([
|
|
99
99
|
code `${patternsVariableDeclarationKeyword} patterns: ${snippets.SparqlPattern}[] = [];`,
|
|
@@ -101,6 +101,6 @@ ${statements.length > 0
|
|
|
101
101
|
code `return patterns;`,
|
|
102
102
|
])
|
|
103
103
|
: "return [];"}
|
|
104
|
-
}
|
|
104
|
+
};`);
|
|
105
105
|
}
|
|
106
|
-
//# sourceMappingURL=
|
|
106
|
+
//# sourceMappingURL=NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Maybe } from "purify-ts";
|
|
2
|
+
import type { NamedObjectType } from "../NamedObjectType.js";
|
|
3
|
+
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
+
export declare function NamedObjectType_fromJsonFunctionDeclaration(this: NamedObjectType): Maybe<Code>;
|
|
5
|
+
//# sourceMappingURL=NamedObjectType_fromJsonFunctionDeclaration.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Maybe } from "purify-ts";
|
|
2
|
+
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
3
|
+
import { code } from "../ts-poet-wrapper.js";
|
|
4
|
+
export function NamedObjectType_fromJsonFunctionDeclaration() {
|
|
5
|
+
if (!this.features.has("json")) {
|
|
6
|
+
return Maybe.empty();
|
|
7
|
+
}
|
|
8
|
+
if (this.abstract) {
|
|
9
|
+
return Maybe.empty();
|
|
10
|
+
}
|
|
11
|
+
let returnExpression = code `${syntheticNamePrefix}propertiesFromJson(json)`;
|
|
12
|
+
if (this.declarationType === "class") {
|
|
13
|
+
returnExpression = code `new ${this.name}(${returnExpression})`;
|
|
14
|
+
}
|
|
15
|
+
return Maybe.of(code `\
|
|
16
|
+
export function ${syntheticNamePrefix}fromJson(json: ${this.jsonType().name}): ${this.name} {
|
|
17
|
+
return ${returnExpression};
|
|
18
|
+
}`);
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=NamedObjectType_fromJsonFunctionDeclaration.js.map
|
package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceFunctionDeclaration.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Maybe } from "purify-ts";
|
|
2
|
+
import type { NamedObjectType } from "../NamedObjectType.js";
|
|
3
|
+
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
+
export declare function NamedObjectType_fromRdfResourceFunctionDeclaration(this: NamedObjectType): Maybe<Code>;
|
|
5
|
+
//# sourceMappingURL=NamedObjectType_fromRdfResourceFunctionDeclaration.d.ts.map
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { Maybe } from "purify-ts";
|
|
2
|
-
import { imports } from "../imports.js";
|
|
3
2
|
import { snippets } from "../snippets.js";
|
|
4
3
|
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
5
4
|
import { code, joinCode } from "../ts-poet-wrapper.js";
|
|
6
|
-
export function
|
|
5
|
+
export function NamedObjectType_fromRdfResourceFunctionDeclaration() {
|
|
7
6
|
if (!this.features.has("rdf")) {
|
|
8
7
|
return Maybe.empty();
|
|
9
8
|
}
|
|
@@ -11,17 +10,17 @@ export function ObjectType_fromRdfFunctionDeclaration() {
|
|
|
11
10
|
return Maybe.empty();
|
|
12
11
|
}
|
|
13
12
|
const statements = [
|
|
14
|
-
code `let { context, ignoreRdfType = false, objectSet, preferredLanguages } = (options ?? {});`,
|
|
13
|
+
code `let { context, graph, ignoreRdfType = false, objectSet, preferredLanguages } = (options ?? {});`,
|
|
15
14
|
code `if (!objectSet) { objectSet = new ${syntheticNamePrefix}RdfjsDatasetObjectSet(resource.dataset); }`,
|
|
16
15
|
];
|
|
17
|
-
let propertiesFromRdfExpression = code `${this.staticModuleName}.${syntheticNamePrefix}
|
|
16
|
+
let propertiesFromRdfExpression = code `${this.staticModuleName}.${syntheticNamePrefix}propertiesFromRdfResource(resource, { context, graph, ignoreRdfType, objectSet, preferredLanguages })`;
|
|
18
17
|
if (this.declarationType === "class") {
|
|
19
18
|
propertiesFromRdfExpression = code `${propertiesFromRdfExpression}.map(properties => new ${this.name}(properties))`;
|
|
20
19
|
}
|
|
21
20
|
statements.push(code `return ${propertiesFromRdfExpression};`);
|
|
22
21
|
return Maybe.of(code `\
|
|
23
|
-
export
|
|
22
|
+
export const ${syntheticNamePrefix}fromRdfResource: ${snippets.FromRdfResourceFunction}<${this.name}> = (resource, options) => {
|
|
24
23
|
${joinCode(statements)}
|
|
25
|
-
}
|
|
24
|
+
};`);
|
|
26
25
|
}
|
|
27
|
-
//# sourceMappingURL=
|
|
26
|
+
//# sourceMappingURL=NamedObjectType_fromRdfResourceFunctionDeclaration.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Maybe } from "purify-ts";
|
|
2
|
+
import type { NamedObjectType } from "../NamedObjectType.js";
|
|
3
|
+
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
+
export declare function NamedObjectType_fromRdfResourceValuesFunctionDeclaration(this: NamedObjectType): Maybe<Code>;
|
|
5
|
+
//# sourceMappingURL=NamedObjectType_fromRdfResourceValuesFunctionDeclaration.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Maybe } from "purify-ts";
|
|
2
|
+
import { snippets } from "../snippets.js";
|
|
3
|
+
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
4
|
+
import { code } from "../ts-poet-wrapper.js";
|
|
5
|
+
export function NamedObjectType_fromRdfResourceValuesFunctionDeclaration() {
|
|
6
|
+
if (!this.features.has("rdf")) {
|
|
7
|
+
return Maybe.empty();
|
|
8
|
+
}
|
|
9
|
+
if (this.abstract) {
|
|
10
|
+
return Maybe.empty();
|
|
11
|
+
}
|
|
12
|
+
return Maybe.of(code `\
|
|
13
|
+
export const ${syntheticNamePrefix}fromRdfResourceValues: ${snippets.FromRdfResourceValuesFunction}<${this.name}> = (values, options) =>
|
|
14
|
+
values.chain(
|
|
15
|
+
values => values.chainMap(
|
|
16
|
+
value => value.toResource().chain(resource => ${this.staticModuleName}.${syntheticNamePrefix}fromRdfResource(resource, options))
|
|
17
|
+
)
|
|
18
|
+
);`);
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=NamedObjectType_fromRdfResourceValuesFunctionDeclaration.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Maybe } from "purify-ts";
|
|
2
|
+
import type { NamedObjectType } from "../NamedObjectType.js";
|
|
3
|
+
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
+
export declare function NamedObjectType_fromRdfTypeVariableStatement(this: NamedObjectType): Maybe<Code>;
|
|
5
|
+
//# sourceMappingURL=NamedObjectType_fromRdfTypeVariableStatement.d.ts.map
|
|
@@ -3,11 +3,11 @@ import { imports } from "../imports.js";
|
|
|
3
3
|
import { rdfjsTermExpression } from "../rdfjsTermExpression.js";
|
|
4
4
|
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
5
5
|
import { code } from "../ts-poet-wrapper.js";
|
|
6
|
-
export function
|
|
6
|
+
export function NamedObjectType_fromRdfTypeVariableStatement() {
|
|
7
7
|
if (!this.features.has("rdf")) {
|
|
8
8
|
return Maybe.empty();
|
|
9
9
|
}
|
|
10
10
|
return this.fromRdfType.map((fromRdfType) => code `\
|
|
11
11
|
export const ${syntheticNamePrefix}fromRdfType: ${imports.NamedNode}<string> = ${rdfjsTermExpression(fromRdfType)};`);
|
|
12
12
|
}
|
|
13
|
-
//# sourceMappingURL=
|
|
13
|
+
//# sourceMappingURL=NamedObjectType_fromRdfTypeVariableStatement.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Maybe } from "purify-ts";
|
|
2
|
+
import type { NamedObjectType } from "../NamedObjectType.js";
|
|
3
|
+
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
+
export declare function NamedObjectType_graphqlTypeVariableStatement(this: NamedObjectType): Maybe<Code>;
|
|
5
|
+
//# sourceMappingURL=NamedObjectType_graphqlTypeVariableStatement.d.ts.map
|
|
@@ -2,7 +2,7 @@ import { Maybe } from "purify-ts";
|
|
|
2
2
|
import { imports } from "../imports.js";
|
|
3
3
|
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
4
4
|
import { code } from "../ts-poet-wrapper.js";
|
|
5
|
-
export function
|
|
5
|
+
export function NamedObjectType_graphqlTypeVariableStatement() {
|
|
6
6
|
if (!this.features.has("graphql")) {
|
|
7
7
|
return Maybe.empty();
|
|
8
8
|
}
|
|
@@ -32,4 +32,4 @@ export const ${syntheticNamePrefix}GraphQL = new ${imports.GraphQLObjectType}<${
|
|
|
32
32
|
name: this.name,
|
|
33
33
|
}});`);
|
|
34
34
|
}
|
|
35
|
-
//# sourceMappingURL=
|
|
35
|
+
//# sourceMappingURL=NamedObjectType_graphqlTypeVariableStatement.js.map
|
package/dist/generators/ts/_NamedObjectType/NamedObjectType_hashFunctionOrMethodDeclarations.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { NamedObjectType } from "../NamedObjectType.js";
|
|
2
|
+
import { type Code } from "../ts-poet-wrapper.js";
|
|
3
|
+
export declare function NamedObjectType_hashFunctionOrMethodDeclarations(this: NamedObjectType): readonly Code[];
|
|
4
|
+
//# sourceMappingURL=NamedObjectType_hashFunctionOrMethodDeclarations.d.ts.map
|
|
@@ -2,7 +2,7 @@ import { snippets } from "../snippets.js";
|
|
|
2
2
|
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
3
3
|
import { code, joinCode } from "../ts-poet-wrapper.js";
|
|
4
4
|
const hasherVariable = code `_hasher`;
|
|
5
|
-
export function
|
|
5
|
+
export function NamedObjectType_hashFunctionOrMethodDeclarations() {
|
|
6
6
|
if (!this.features.has("hash")) {
|
|
7
7
|
return [];
|
|
8
8
|
}
|
|
@@ -70,4 +70,4 @@ ${hashShaclPropertiesPreamble}${syntheticNamePrefix}hashShaclProperties<HasherT
|
|
|
70
70
|
}`,
|
|
71
71
|
];
|
|
72
72
|
}
|
|
73
|
-
//# sourceMappingURL=
|
|
73
|
+
//# sourceMappingURL=NamedObjectType_hashFunctionOrMethodDeclarations.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { NamedObjectType } from "../NamedObjectType.js";
|
|
2
|
+
import { type Code } from "../ts-poet-wrapper.js";
|
|
3
|
+
export declare function NamedObjectType_interfaceDeclaration(this: NamedObjectType): Code;
|
|
4
|
+
//# sourceMappingURL=NamedObjectType_interfaceDeclaration.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { code, joinCode } from "../ts-poet-wrapper.js";
|
|
2
2
|
import { tsComment } from "../tsComment.js";
|
|
3
|
-
export function
|
|
3
|
+
export function NamedObjectType_interfaceDeclaration() {
|
|
4
4
|
return code `\
|
|
5
5
|
${this.comment
|
|
6
6
|
.alt(this.label)
|
|
@@ -13,4 +13,4 @@ ${this.comment
|
|
|
13
13
|
${joinCode(this.properties.flatMap((property) => property.declaration.toList()))}
|
|
14
14
|
}`;
|
|
15
15
|
}
|
|
16
|
-
//# sourceMappingURL=
|
|
16
|
+
//# sourceMappingURL=NamedObjectType_interfaceDeclaration.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { NamedObjectType } from "../NamedObjectType.js";
|
|
2
|
+
import { type Code } from "../ts-poet-wrapper.js";
|
|
3
|
+
export declare function NamedObjectType_isTypeFunctionDeclaration(this: NamedObjectType): Code;
|
|
4
|
+
//# sourceMappingURL=NamedObjectType_isTypeFunctionDeclaration.d.ts.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
2
2
|
import { code } from "../ts-poet-wrapper.js";
|
|
3
|
-
export function
|
|
3
|
+
export function NamedObjectType_isTypeFunctionDeclaration() {
|
|
4
4
|
return code `\
|
|
5
5
|
export function is${this.name}(object: ${syntheticNamePrefix}Object): object is ${this.name} {
|
|
6
6
|
switch (object.${this._discriminantProperty.name}) {
|
|
7
|
-
${this._discriminantProperty.descendantValues
|
|
8
|
-
.concat(this._discriminantProperty.ownValues)
|
|
7
|
+
${this._discriminantProperty.type.descendantValues
|
|
8
|
+
.concat(this._discriminantProperty.type.ownValues)
|
|
9
9
|
.map((value) => `case "${value}":`)
|
|
10
10
|
.join("\n")} return true; default: return false;
|
|
11
11
|
}
|
|
12
12
|
}`;
|
|
13
13
|
}
|
|
14
|
-
//# sourceMappingURL=
|
|
14
|
+
//# sourceMappingURL=NamedObjectType_isTypeFunctionDeclaration.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Maybe } from "purify-ts";
|
|
2
|
+
import type { NamedObjectType } from "../NamedObjectType.js";
|
|
3
|
+
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
+
export declare function NamedObjectType_jsonParseFunctionDeclaration(this: NamedObjectType): Maybe<Code>;
|
|
5
|
+
//# sourceMappingURL=NamedObjectType_jsonParseFunctionDeclaration.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
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 NamedObjectType_jsonParseFunctionDeclaration() {
|
|
6
|
+
if (!this.features.has("json")) {
|
|
7
|
+
return Maybe.empty();
|
|
8
|
+
}
|
|
9
|
+
if (this.abstract) {
|
|
10
|
+
return Maybe.empty();
|
|
11
|
+
}
|
|
12
|
+
return Maybe.of(code `\
|
|
13
|
+
export function parse(json: unknown): ${imports.Either}<Error, ${syntheticNamePrefix}Json> {
|
|
14
|
+
const jsonSafeParseResult = schema().safeParse(json);
|
|
15
|
+
if (!jsonSafeParseResult.success) { return ${imports.Left}(jsonSafeParseResult.error); }
|
|
16
|
+
return ${imports.Right}(jsonSafeParseResult.data);
|
|
17
|
+
}`);
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=NamedObjectType_jsonParseFunctionDeclaration.js.map
|
package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonSchemaFunctionDeclaration.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Maybe } from "purify-ts";
|
|
2
|
+
import type { NamedObjectType } from "../NamedObjectType.js";
|
|
3
|
+
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
+
export declare function NamedObjectType_jsonSchemaFunctionDeclaration(this: NamedObjectType): Maybe<Code>;
|
|
5
|
+
//# sourceMappingURL=NamedObjectType_jsonSchemaFunctionDeclaration.d.ts.map
|
|
@@ -2,21 +2,21 @@ import { Maybe } from "purify-ts";
|
|
|
2
2
|
import { imports } from "../imports.js";
|
|
3
3
|
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
4
4
|
import { code, joinCode } from "../ts-poet-wrapper.js";
|
|
5
|
-
export function
|
|
5
|
+
export function NamedObjectType_jsonSchemaFunctionDeclaration() {
|
|
6
6
|
if (!this.features.has("json")) {
|
|
7
7
|
return Maybe.empty();
|
|
8
8
|
}
|
|
9
9
|
const mergeZodObjectSchemas = [];
|
|
10
10
|
for (const parentObjectType of this.parentObjectTypes) {
|
|
11
|
-
mergeZodObjectSchemas.push(parentObjectType.
|
|
11
|
+
mergeZodObjectSchemas.push(parentObjectType.jsonSchema({ context: "type" }));
|
|
12
12
|
}
|
|
13
13
|
if (this.properties.length > 0) {
|
|
14
14
|
mergeZodObjectSchemas.push(code `${imports.z}.object({ ${joinCode(this.properties
|
|
15
|
-
.flatMap((property) => property.
|
|
15
|
+
.flatMap((property) => property.jsonZchema.toList())
|
|
16
16
|
.map(({ key, schema }) => code `"${key}": ${schema}`), { on: "," })} })`);
|
|
17
17
|
}
|
|
18
18
|
return Maybe.of(code `\
|
|
19
|
-
export function
|
|
19
|
+
export function schema() {
|
|
20
20
|
return ${mergeZodObjectSchemas.length > 0
|
|
21
21
|
? mergeZodObjectSchemas.reduce((merged, zodObjectSchema) => {
|
|
22
22
|
if (merged === null) {
|
|
@@ -27,4 +27,4 @@ export function ${syntheticNamePrefix}jsonZodSchema() {
|
|
|
27
27
|
: `${imports.z}.object()`} satisfies ${imports.z}.ZodType<${syntheticNamePrefix}Json>;
|
|
28
28
|
}`);
|
|
29
29
|
}
|
|
30
|
-
//# sourceMappingURL=
|
|
30
|
+
//# sourceMappingURL=NamedObjectType_jsonSchemaFunctionDeclaration.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Maybe } from "purify-ts";
|
|
2
|
+
import type { NamedObjectType } from "../NamedObjectType.js";
|
|
3
|
+
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
+
export declare function NamedObjectType_jsonTypeAliasDeclaration(this: NamedObjectType): Maybe<Code>;
|
|
5
|
+
//# sourceMappingURL=NamedObjectType_jsonTypeAliasDeclaration.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Maybe } from "purify-ts";
|
|
2
2
|
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
3
3
|
import { code, joinCode } from "../ts-poet-wrapper.js";
|
|
4
|
-
export function
|
|
4
|
+
export function NamedObjectType_jsonTypeAliasDeclaration() {
|
|
5
5
|
if (!this.features.has("json")) {
|
|
6
6
|
return Maybe.empty();
|
|
7
7
|
}
|
|
@@ -14,4 +14,4 @@ export function ObjectType_jsonTypeAliasDeclaration() {
|
|
|
14
14
|
}
|
|
15
15
|
return Maybe.of(code `export type ${syntheticNamePrefix}Json = ${members.length > 0 ? joinCode(members, { on: " & " }) : "object"};`);
|
|
16
16
|
}
|
|
17
|
-
//# sourceMappingURL=
|
|
17
|
+
//# sourceMappingURL=NamedObjectType_jsonTypeAliasDeclaration.js.map
|
package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonUiSchemaFunctionDeclaration.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Maybe } from "purify-ts";
|
|
2
|
+
import type { NamedObjectType } from "../NamedObjectType.js";
|
|
3
|
+
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
+
export declare function NamedObjectType_jsonUiSchemaFunctionDeclaration(this: NamedObjectType): Maybe<Code>;
|
|
5
|
+
//# sourceMappingURL=NamedObjectType_jsonUiSchemaFunctionDeclaration.d.ts.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { Maybe } from "purify-ts";
|
|
2
2
|
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
3
3
|
import { code, joinCode } from "../ts-poet-wrapper.js";
|
|
4
|
-
export function
|
|
4
|
+
export function NamedObjectType_jsonUiSchemaFunctionDeclaration() {
|
|
5
5
|
if (!this.features.has("json")) {
|
|
6
6
|
return Maybe.empty();
|
|
7
7
|
}
|
|
8
8
|
const variables = { scopePrefix: code `scopePrefix` };
|
|
9
9
|
const elements = this.parentObjectTypes
|
|
10
|
-
.map((parentObjectType) => code `${parentObjectType.staticModuleName}.${syntheticNamePrefix}
|
|
10
|
+
.map((parentObjectType) => code `${parentObjectType.staticModuleName}.${syntheticNamePrefix}Json.uiSchema({ scopePrefix })`)
|
|
11
11
|
.concat(this.ownProperties.flatMap((property) => property.jsonUiSchemaElement({ variables }).toList()));
|
|
12
12
|
return Maybe.of(code `\
|
|
13
|
-
export function
|
|
13
|
+
export function uiSchema(parameters?: { scopePrefix?: string }): any {
|
|
14
14
|
const scopePrefix = parameters?.scopePrefix ?? "#";
|
|
15
15
|
return { "elements": [ ${joinCode(elements, { on: "," })} ], label: "${this.label.orDefault(this.name)}", type: "Group" };
|
|
16
16
|
}`);
|
|
17
17
|
}
|
|
18
|
-
//# sourceMappingURL=
|
|
18
|
+
//# sourceMappingURL=NamedObjectType_jsonUiSchemaFunctionDeclaration.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function NamedObjectType_objectSetMethodNames(this: {
|
|
2
|
+
readonly name: string;
|
|
3
|
+
}): {
|
|
4
|
+
object: string;
|
|
5
|
+
objectCount: string;
|
|
6
|
+
objectIdentifiers: string;
|
|
7
|
+
objects: string;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=NamedObjectType_objectSetMethodNames.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { camelCase, trainCase } from "change-case";
|
|
2
2
|
import plur from "plur";
|
|
3
|
-
export function
|
|
3
|
+
export function NamedObjectType_objectSetMethodNames() {
|
|
4
4
|
const prefixSingular = camelCase(this.name);
|
|
5
5
|
const thisNameParts = trainCase(this.name).split("-");
|
|
6
6
|
let prefixPlural = camelCase(`${thisNameParts.slice(0, thisNameParts.length - 1).join("")}${plur(thisNameParts[thisNameParts.length - 1])}`);
|
|
@@ -15,4 +15,4 @@ export function ObjectType_objectSetMethodNames() {
|
|
|
15
15
|
objects: prefixPlural,
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
//# sourceMappingURL=
|
|
18
|
+
//# sourceMappingURL=NamedObjectType_objectSetMethodNames.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Maybe } from "purify-ts";
|
|
2
|
+
import type { NamedObjectType } from "../NamedObjectType.js";
|
|
3
|
+
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
+
export declare function NamedObjectType_propertiesFromJsonFunctionDeclaration(this: NamedObjectType): Maybe<Code>;
|
|
5
|
+
//# sourceMappingURL=NamedObjectType_propertiesFromJsonFunctionDeclaration.d.ts.map
|
package/dist/generators/ts/_NamedObjectType/NamedObjectType_propertiesFromJsonFunctionDeclaration.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Maybe } from "purify-ts";
|
|
2
|
+
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
3
|
+
import { code, joinCode } from "../ts-poet-wrapper.js";
|
|
4
|
+
const variables = {
|
|
5
|
+
jsonObject: code `${syntheticNamePrefix}json`,
|
|
6
|
+
};
|
|
7
|
+
export function NamedObjectType_propertiesFromJsonFunctionDeclaration() {
|
|
8
|
+
if (!this.features.has("json")) {
|
|
9
|
+
return Maybe.empty();
|
|
10
|
+
}
|
|
11
|
+
const initializers = [];
|
|
12
|
+
const statements = [];
|
|
13
|
+
const propertyReturnTypeSignatures = [];
|
|
14
|
+
const returnType = [];
|
|
15
|
+
this.parentObjectTypes.forEach((parentObjectType) => {
|
|
16
|
+
initializers.push(code `...${parentObjectType.staticModuleName}.${syntheticNamePrefix}propertiesFromJson(${variables.jsonObject})`);
|
|
17
|
+
returnType.push(code `ReturnType<typeof ${parentObjectType.staticModuleName}.${syntheticNamePrefix}propertiesFromJson>`);
|
|
18
|
+
});
|
|
19
|
+
for (const property of this.properties) {
|
|
20
|
+
const propertyFromJsonStatements = property.fromJsonStatements({
|
|
21
|
+
variables,
|
|
22
|
+
});
|
|
23
|
+
if (propertyFromJsonStatements.length > 0) {
|
|
24
|
+
propertyReturnTypeSignatures.push(code `${property.name}: ${property.type.name};`);
|
|
25
|
+
initializers.push(code `${property.name}`);
|
|
26
|
+
statements.push(...propertyFromJsonStatements);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
statements.push(code `return { ${joinCode(initializers, { on: ", " })} };`);
|
|
30
|
+
if (propertyReturnTypeSignatures.length > 0) {
|
|
31
|
+
returnType.splice(0, 0, code `{ ${joinCode(propertyReturnTypeSignatures, { on: " " })} }`);
|
|
32
|
+
}
|
|
33
|
+
return Maybe.of(code `\
|
|
34
|
+
export function ${syntheticNamePrefix}propertiesFromJson(${variables.jsonObject}: ${this.jsonType().name}): ${joinCode(returnType, { on: " & " })} {
|
|
35
|
+
${joinCode(statements)}
|
|
36
|
+
}`);
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=NamedObjectType_propertiesFromJsonFunctionDeclaration.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Maybe } from "purify-ts";
|
|
2
|
+
import type { NamedObjectType } from "../NamedObjectType.js";
|
|
3
|
+
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
+
export declare function NamedObjectType_propertiesFromRdfResourceFunctionDeclaration(this: NamedObjectType): Maybe<Code>;
|
|
5
|
+
//# sourceMappingURL=NamedObjectType_propertiesFromRdfResourceFunctionDeclaration.d.ts.map
|
|
@@ -5,7 +5,16 @@ import { rdfjsTermExpression } from "../rdfjsTermExpression.js";
|
|
|
5
5
|
import { snippets } from "../snippets.js";
|
|
6
6
|
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
7
7
|
import { code, joinCode } from "../ts-poet-wrapper.js";
|
|
8
|
-
|
|
8
|
+
const optionsVariable = `_${syntheticNamePrefix}options`;
|
|
9
|
+
const variables = {
|
|
10
|
+
context: code `${optionsVariable}.context`,
|
|
11
|
+
graph: code `${optionsVariable}.graph`,
|
|
12
|
+
ignoreRdfType: code `${optionsVariable}.ignoreRdfType`,
|
|
13
|
+
objectSet: code `${optionsVariable}.objectSet`,
|
|
14
|
+
preferredLanguages: code `${optionsVariable}.preferredLanguages`,
|
|
15
|
+
resource: code `${syntheticNamePrefix}resource`,
|
|
16
|
+
};
|
|
17
|
+
export function NamedObjectType_propertiesFromRdfResourceFunctionDeclaration() {
|
|
9
18
|
if (!this.features.has("rdf")) {
|
|
10
19
|
return Maybe.empty();
|
|
11
20
|
}
|
|
@@ -13,21 +22,13 @@ export function ObjectType_propertiesFromRdfFunctionDeclaration() {
|
|
|
13
22
|
const initializers = [];
|
|
14
23
|
const propertySignatures = [];
|
|
15
24
|
const returnType = [];
|
|
16
|
-
const variables = {
|
|
17
|
-
context: code `${syntheticNamePrefix}parameters.context`,
|
|
18
|
-
graph: code `${syntheticNamePrefix}parameters.graph`,
|
|
19
|
-
ignoreRdfType: code `${syntheticNamePrefix}parameters.ignoreRdfType`,
|
|
20
|
-
objectSet: code `${syntheticNamePrefix}parameters.objectSet`,
|
|
21
|
-
preferredLanguages: code `${syntheticNamePrefix}parameters.preferredLanguages`,
|
|
22
|
-
resource: code `${syntheticNamePrefix}parameters.resource`,
|
|
23
|
-
};
|
|
24
25
|
this.parentObjectTypes.forEach((parentObjectType, parentObjectTypeI) => {
|
|
25
26
|
chains.push({
|
|
26
|
-
expression: code `${parentObjectType.staticModuleName}.${syntheticNamePrefix}
|
|
27
|
+
expression: code `${parentObjectType.staticModuleName}.${syntheticNamePrefix}propertiesFromRdfResource(${variables.resource}, { ...${optionsVariable}, ignoreRdfType: true })`,
|
|
27
28
|
variable: `${syntheticNamePrefix}super${parentObjectTypeI}`,
|
|
28
29
|
});
|
|
29
30
|
initializers.push(code `...${syntheticNamePrefix}super${parentObjectTypeI}`);
|
|
30
|
-
returnType.push(code `${snippets.UnwrapR}<ReturnType<typeof ${parentObjectType.staticModuleName}.${syntheticNamePrefix}
|
|
31
|
+
returnType.push(code `${snippets.UnwrapR}<ReturnType<typeof ${parentObjectType.staticModuleName}.${syntheticNamePrefix}propertiesFromRdfResource>>`);
|
|
31
32
|
});
|
|
32
33
|
this.fromRdfType.ifJust((fromRdfType) => {
|
|
33
34
|
const fromRdfTypeVariable = this.fromRdfTypeVariable.unsafeCoerce();
|
|
@@ -67,7 +68,7 @@ export function ObjectType_propertiesFromRdfFunctionDeclaration() {
|
|
|
67
68
|
};
|
|
68
69
|
for (const property of this.properties) {
|
|
69
70
|
property
|
|
70
|
-
.
|
|
71
|
+
.fromRdfResourceValuesExpression({
|
|
71
72
|
variables: propertyFromRdfVariables,
|
|
72
73
|
})
|
|
73
74
|
.ifJust((propertyFromRdfExpression) => {
|
|
@@ -93,8 +94,8 @@ export function ObjectType_propertiesFromRdfFunctionDeclaration() {
|
|
|
93
94
|
returnType.splice(0, 0, code `{ ${joinCode(propertySignatures, { on: " " })} }`);
|
|
94
95
|
}
|
|
95
96
|
return Maybe.of(code `\
|
|
96
|
-
export
|
|
97
|
+
export const ${syntheticNamePrefix}propertiesFromRdfResource: ${snippets.PropertiesFromRdfResourceFunction}<${joinCode(returnType, { on: " & " })}> = (${syntheticNamePrefix}resource, ${optionsVariable}) => {
|
|
97
98
|
${joinCode(statements)}
|
|
98
|
-
}
|
|
99
|
+
};`);
|
|
99
100
|
}
|
|
100
|
-
//# sourceMappingURL=
|
|
101
|
+
//# sourceMappingURL=NamedObjectType_propertiesFromRdfResourceFunctionDeclaration.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { NamedObjectType } from "../NamedObjectType.js";
|
|
2
|
+
import { type Code } from "../ts-poet-wrapper.js";
|
|
3
|
+
export declare function NamedObjectType_schemaVariableStatement(this: NamedObjectType): Code;
|
|
4
|
+
//# sourceMappingURL=NamedObjectType_schemaVariableStatement.d.ts.map
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
2
2
|
import { code, joinCode } from "../ts-poet-wrapper.js";
|
|
3
|
-
export function
|
|
3
|
+
export function NamedObjectType_schemaVariableStatement() {
|
|
4
4
|
return code `\
|
|
5
5
|
export const ${syntheticNamePrefix}schema = { properties: { ${joinCode(this.parentObjectTypes
|
|
6
6
|
.map((parentObjectType) => code `...${parentObjectType.staticModuleName}.${syntheticNamePrefix}schema.properties`)
|
|
7
|
-
.concat(this.ownProperties.map((property) => code `${property.name}: ${property.schema}`)), { on: ", " })} } } as const
|
|
8
|
-
`;
|
|
7
|
+
.concat(this.ownProperties.map((property) => code `${property.name}: ${property.schema}`)), { on: ", " })} } } as const;`;
|
|
9
8
|
}
|
|
10
|
-
//# sourceMappingURL=
|
|
9
|
+
//# sourceMappingURL=NamedObjectType_schemaVariableStatement.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Maybe } from "purify-ts";
|
|
2
2
|
import type { TsFeature } from "../../../enums/TsFeature.js";
|
|
3
3
|
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
-
export declare function
|
|
4
|
+
export declare function NamedObjectType_sparqlConstructQueryFunctionDeclaration(this: {
|
|
5
5
|
readonly features: ReadonlySet<TsFeature>;
|
|
6
6
|
readonly filterType: Code;
|
|
7
7
|
readonly name: string;
|
|
8
8
|
readonly staticModuleName: string;
|
|
9
9
|
}): Maybe<Code>;
|
|
10
|
-
//# sourceMappingURL=
|
|
10
|
+
//# sourceMappingURL=NamedObjectType_sparqlConstructQueryFunctionDeclaration.d.ts.map
|
|
@@ -4,7 +4,7 @@ import { imports } from "../imports.js";
|
|
|
4
4
|
import { snippets } from "../snippets.js";
|
|
5
5
|
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
6
6
|
import { code } from "../ts-poet-wrapper.js";
|
|
7
|
-
export function
|
|
7
|
+
export function NamedObjectType_sparqlConstructQueryFunctionDeclaration() {
|
|
8
8
|
if (!this.features.has("sparql")) {
|
|
9
9
|
return Maybe.empty();
|
|
10
10
|
}
|
|
@@ -17,7 +17,7 @@ export function ${syntheticNamePrefix}sparqlConstructQuery({ filter, ignoreRdfTy
|
|
|
17
17
|
prefixes: prefixes ?? {},
|
|
18
18
|
queryType: "CONSTRUCT",
|
|
19
19
|
template: (queryParameters.template ?? []).concat(
|
|
20
|
-
${this.staticModuleName}.${syntheticNamePrefix}
|
|
20
|
+
${this.staticModuleName}.${syntheticNamePrefix}focusSparqlConstructTriples({
|
|
21
21
|
filter,
|
|
22
22
|
focusIdentifier: subject,
|
|
23
23
|
ignoreRdfType: !!ignoreRdfType,
|
|
@@ -27,7 +27,7 @@ export function ${syntheticNamePrefix}sparqlConstructQuery({ filter, ignoreRdfTy
|
|
|
27
27
|
type: "query",
|
|
28
28
|
where: (queryParameters.where ?? []).concat(
|
|
29
29
|
${snippets.normalizeSparqlWherePatterns}(
|
|
30
|
-
${this.staticModuleName}.${syntheticNamePrefix}
|
|
30
|
+
${this.staticModuleName}.${syntheticNamePrefix}focusSparqlWherePatterns({
|
|
31
31
|
filter,
|
|
32
32
|
focusIdentifier: subject,
|
|
33
33
|
ignoreRdfType: !!ignoreRdfType,
|
|
@@ -39,4 +39,4 @@ export function ${syntheticNamePrefix}sparqlConstructQuery({ filter, ignoreRdfTy
|
|
|
39
39
|
};
|
|
40
40
|
}`);
|
|
41
41
|
}
|
|
42
|
-
//# sourceMappingURL=
|
|
42
|
+
//# sourceMappingURL=NamedObjectType_sparqlConstructQueryFunctionDeclaration.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Maybe } from "purify-ts";
|
|
2
2
|
import type { TsFeature } from "../../../enums/TsFeature.js";
|
|
3
3
|
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
-
export declare function
|
|
4
|
+
export declare function NamedObjectType_sparqlConstructQueryStringFunctionDeclaration(this: {
|
|
5
5
|
readonly features: ReadonlySet<TsFeature>;
|
|
6
6
|
readonly filterType: Code;
|
|
7
7
|
readonly staticModuleName: string;
|
|
8
8
|
}): Maybe<Code>;
|
|
9
|
-
//# sourceMappingURL=
|
|
9
|
+
//# sourceMappingURL=NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts.map
|
|
@@ -2,7 +2,7 @@ import { Maybe } from "purify-ts";
|
|
|
2
2
|
import { imports } from "../imports.js";
|
|
3
3
|
import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
|
|
4
4
|
import { code } from "../ts-poet-wrapper.js";
|
|
5
|
-
export function
|
|
5
|
+
export function NamedObjectType_sparqlConstructQueryStringFunctionDeclaration() {
|
|
6
6
|
if (!this.features.has("sparql")) {
|
|
7
7
|
return Maybe.empty();
|
|
8
8
|
}
|
|
@@ -11,4 +11,4 @@ export function ${syntheticNamePrefix}sparqlConstructQueryString(parameters: Par
|
|
|
11
11
|
return new ${imports.sparqljs}.Generator(parameters).stringify(${this.staticModuleName}.${syntheticNamePrefix}sparqlConstructQuery(parameters));
|
|
12
12
|
}`);
|
|
13
13
|
}
|
|
14
|
-
//# sourceMappingURL=
|
|
14
|
+
//# sourceMappingURL=NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.js.map
|
package/dist/generators/ts/_NamedObjectType/NamedObjectType_toJsonFunctionOrMethodDeclaration.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Maybe } from "purify-ts";
|
|
2
|
+
import type { NamedObjectType } from "../NamedObjectType.js";
|
|
3
|
+
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
+
export declare function NamedObjectType_toJsonFunctionOrMethodDeclaration(this: NamedObjectType): Maybe<Code>;
|
|
5
|
+
//# sourceMappingURL=NamedObjectType_toJsonFunctionOrMethodDeclaration.d.ts.map
|