@shaclmate/compiler 4.0.19 → 4.0.21

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.
Files changed (105) hide show
  1. package/dist/Compiler.d.ts +4 -1
  2. package/dist/Compiler.js +4 -1
  3. package/dist/ShapesGraphToAstTransformer.d.ts +4 -1
  4. package/dist/ShapesGraphToAstTransformer.js +9 -6
  5. package/dist/_ShapesGraphToAstTransformer/transformPropertyShapeToAstObjectTypeProperty.js +1 -1
  6. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.js +1 -1
  7. package/dist/ast/AbstractCollectionType.d.ts +1 -1
  8. package/dist/ast/AbstractContainerType.d.ts +1 -1
  9. package/dist/ast/AbstractLazyObjectType.d.ts +19 -79
  10. package/dist/ast/AbstractTermType.d.ts +3 -33
  11. package/dist/ast/AbstractTermType.js +2 -3
  12. package/dist/ast/AbstractType.d.ts +1 -1
  13. package/dist/ast/AbstractType.js +1 -2
  14. package/dist/ast/BlankNodeType.d.ts +1 -1
  15. package/dist/ast/DefaultValueType.d.ts +2 -17
  16. package/dist/ast/DefaultValueType.js +1 -2
  17. package/dist/ast/IdentifierType.d.ts +1 -1
  18. package/dist/ast/LiteralType.d.ts +8 -98
  19. package/dist/ast/LiteralType.js +5 -7
  20. package/dist/ast/ObjectCompoundType.js +1 -2
  21. package/dist/ast/ObjectType.d.ts +9 -39
  22. package/dist/ast/ObjectType.js +9 -13
  23. package/dist/ast/SetType.d.ts +1 -1
  24. package/dist/ast/UnionType.d.ts +1 -1
  25. package/dist/generators/transformAstToLabeledPropertyGraph.js +3 -4
  26. package/dist/generators/ts/AbstractContainerType.d.ts +1 -0
  27. package/dist/generators/ts/AbstractContainerType.js +3 -0
  28. package/dist/generators/ts/AbstractDateType.js +1 -1
  29. package/dist/generators/ts/AbstractIdentifierType.d.ts +2 -2
  30. package/dist/generators/ts/AbstractIdentifierType.js +2 -5
  31. package/dist/generators/ts/AbstractLazyObjectType.d.ts +2 -1
  32. package/dist/generators/ts/AbstractLazyObjectType.js +6 -3
  33. package/dist/generators/ts/AbstractNamedUnionType.js +2 -2
  34. package/dist/generators/ts/AbstractNumericType.js +1 -1
  35. package/dist/generators/ts/AbstractTermType.d.ts +1 -0
  36. package/dist/generators/ts/AbstractTermType.js +8 -2
  37. package/dist/generators/ts/AbstractType.d.ts +21 -14
  38. package/dist/generators/ts/AbstractType.js +3 -1
  39. package/dist/generators/ts/AbstractUnionType.d.ts +5 -4
  40. package/dist/generators/ts/AbstractUnionType.js +83 -59
  41. package/dist/generators/ts/BlankNodeType.d.ts +2 -2
  42. package/dist/generators/ts/BlankNodeType.js +1 -1
  43. package/dist/generators/ts/BooleanType.js +1 -1
  44. package/dist/generators/ts/DefaultValueType.js +1 -1
  45. package/dist/generators/ts/IdentifierType.d.ts +2 -2
  46. package/dist/generators/ts/IdentifierType.js +1 -1
  47. package/dist/generators/ts/IriType.d.ts +1 -1
  48. package/dist/generators/ts/IriType.js +8 -13
  49. package/dist/generators/ts/LazyObjectOptionType.d.ts +1 -0
  50. package/dist/generators/ts/LazyObjectOptionType.js +1 -1
  51. package/dist/generators/ts/LazyObjectType.js +1 -1
  52. package/dist/generators/ts/ListType.js +5 -5
  53. package/dist/generators/ts/NamedObjectType.d.ts +1 -0
  54. package/dist/generators/ts/NamedObjectType.js +7 -0
  55. package/dist/generators/ts/NamedObjectUnionType.js +4 -1
  56. package/dist/generators/ts/SetType.js +1 -1
  57. package/dist/generators/ts/StringType.js +1 -1
  58. package/dist/generators/ts/TermType.js +3 -1
  59. package/dist/generators/ts/TsGenerator.d.ts +5 -0
  60. package/dist/generators/ts/TsGenerator.js +7 -1
  61. package/dist/generators/ts/TypeFactory.d.ts +5 -0
  62. package/dist/generators/ts/TypeFactory.js +35 -5
  63. package/dist/generators/ts/ZodGenerator.d.ts +4 -0
  64. package/dist/generators/ts/ZodGenerator.js +4 -1
  65. package/dist/generators/ts/_NamedObjectType/AbstractProperty.d.ts +4 -1
  66. package/dist/generators/ts/_NamedObjectType/AbstractProperty.js +3 -1
  67. package/dist/generators/ts/_NamedObjectType/IdentifierProperty.js +6 -5
  68. package/dist/generators/ts/_NamedObjectType/NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.js +2 -2
  69. package/dist/generators/ts/_NamedObjectType/NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.js +2 -2
  70. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfTypeVariableStatement.js +1 -1
  71. package/dist/generators/ts/_NamedObjectType/NamedObjectType_propertiesFromRdfResourceFunctionDeclaration.js +2 -2
  72. package/dist/generators/ts/_NamedObjectType/NamedObjectType_toRdfResourceFunctionOrMethodDeclaration.js +1 -1
  73. package/dist/generators/ts/_NamedObjectType/ShaclProperty.d.ts +1 -0
  74. package/dist/generators/ts/_NamedObjectType/ShaclProperty.js +16 -16
  75. package/dist/generators/ts/_NamedObjectType/identifierTypeDeclarations.js +6 -2
  76. package/dist/generators/ts/_snippets/parseIri.d.ts +2 -0
  77. package/dist/generators/ts/_snippets/parseIri.js +12 -0
  78. package/dist/generators/ts/_snippets/snippets_ToRdfResourceValuesFunction.js +4 -3
  79. package/dist/generators/ts/_snippets/snippets_listSparqlWherePatterns.js +7 -5
  80. package/dist/generators/ts/_snippets/snippets_parseBlankNode.d.ts +2 -0
  81. package/dist/generators/ts/_snippets/snippets_parseBlankNode.js +12 -0
  82. package/dist/generators/ts/_snippets/snippets_parseIdentifier.d.ts +2 -0
  83. package/dist/generators/ts/_snippets/snippets_parseIdentifier.js +6 -0
  84. package/dist/generators/ts/graphqlSchemaVariableStatement.js +3 -3
  85. package/dist/generators/ts/imports.d.ts +2 -0
  86. package/dist/generators/ts/imports.js +3 -1
  87. package/dist/generators/ts/rdfjsTermExpression.d.ts +4 -1
  88. package/dist/generators/ts/rdfjsTermExpression.js +2 -3
  89. package/dist/generators/ts/snippets.d.ts +3 -2
  90. package/dist/generators/ts/snippets.js +6 -4
  91. package/dist/generators/ts/synthesizeUberObjectUnionType.d.ts +2 -0
  92. package/dist/generators/ts/synthesizeUberObjectUnionType.js +4 -0
  93. package/dist/input/ShapesGraph.d.ts +4 -1
  94. package/dist/input/ShapesGraph.js +3 -2
  95. package/dist/input/generated.d.ts +323 -323
  96. package/dist/input/generated.js +19 -20
  97. package/package.json +6 -7
  98. package/dist/ast/termToJson.d.ts +0 -18
  99. package/dist/ast/termToJson.js +0 -18
  100. package/dist/generators/ts/_snippets/snippets_blankNodeFromString.d.ts +0 -2
  101. package/dist/generators/ts/_snippets/snippets_blankNodeFromString.js +0 -11
  102. package/dist/generators/ts/_snippets/snippets_identifierFromString.d.ts +0 -2
  103. package/dist/generators/ts/_snippets/snippets_identifierFromString.js +0 -8
  104. package/dist/logger.d.ts +0 -2
  105. package/dist/logger.js +0 -8
@@ -16,7 +16,7 @@ function graphqlQueryObjectType({ namedObjectTypes, namedObjectUnionTypes, }) {
16
16
  resolve: code `\
17
17
  async (_source, args: { identifier: string }, { objectSet }): Promise<${namedObjectType.name}> =>
18
18
  (await ${imports.EitherAsync}<Error, ${namedObjectType.name}>(async ({ liftEither }) =>
19
- liftEither(await objectSet.${namedObjectType.objectSetMethodNames.object}(await liftEither(${namedObjectType.identifierTypeAlias}.fromString(args.identifier))))
19
+ liftEither(await objectSet.${namedObjectType.objectSetMethodNames.object}(await liftEither(${namedObjectType.identifierTypeAlias}.parse(args.identifier))))
20
20
  )).unsafeCoerce()`,
21
21
  type: namedObjectType.graphqlType.name,
22
22
  };
@@ -31,7 +31,7 @@ async (_source, args: { identifier: string }, { objectSet }): Promise<${namedObj
31
31
  },
32
32
  resolve: code `\
33
33
  async (_source, args: { limit: number | null; offset: number | null; }, { objectSet }): Promise<readonly string[]> =>
34
- (await objectSet.${namedObjectType.objectSetMethodNames.objectIdentifiers}({ limit: args.limit !== null ? args.limit : undefined, offset: args.offset !== null ? args.offset : undefined })).unsafeCoerce().map(${namedObjectType.identifierTypeAlias}.toString)`,
34
+ (await objectSet.${namedObjectType.objectSetMethodNames.objectIdentifiers}({ limit: args.limit !== null ? args.limit : undefined, offset: args.offset !== null ? args.offset : undefined })).unsafeCoerce().map(${namedObjectType.identifierTypeAlias}.stringify)`,
35
35
  type: code `new ${imports.GraphQLNonNull}(new ${imports.GraphQLList}(${imports.GraphQLString}))`,
36
36
  };
37
37
  fields[namedObjectType.objectSetMethodNames.objects] = {
@@ -53,7 +53,7 @@ async (_source, args: { identifiers: readonly string[] | null; limit: number | n
53
53
  if (args.identifiers) {
54
54
  const identifiers: ${namedObjectType.identifierTypeAlias}[] = [];
55
55
  for (const identifierArg of args.identifiers) {
56
- identifiers.push(await liftEither(${namedObjectType.identifierTypeAlias}.fromString(identifierArg)));
56
+ identifiers.push(await liftEither(${namedObjectType.identifierTypeAlias}.parse(identifierArg)));
57
57
  }
58
58
  filter = { ${syntheticNamePrefix}identifier: { in: identifiers } };
59
59
  }
@@ -25,6 +25,8 @@ export declare const imports: {
25
25
  readonly Maybe: import("ts-poet/build/Import.js").Import;
26
26
  readonly NamedNode: import("ts-poet/build/Import.js").Import;
27
27
  readonly NonEmptyList: import("ts-poet/build/Import.js").Import;
28
+ readonly NTriplesIdentifier: import("ts-poet/build/Import.js").Import;
29
+ readonly NTriplesTerm: import("ts-poet/build/Import.js").Import;
28
30
  readonly Quad: import("ts-poet/build/Import.js").Import;
29
31
  readonly Quad_Graph: import("ts-poet/build/Import.js").Import;
30
32
  readonly RdfjsResourcePropertyPath: import("ts-poet/build/Import.js").Import;
@@ -2,7 +2,7 @@ import { imp } from "./ts-poet-wrapper.js";
2
2
  export const imports = {
3
3
  BigDecimal: imp("Decimal:BigDecimal@decimal.js"),
4
4
  BlankNode: imp("BlankNode@@rdfjs/types"),
5
- dataFactory: imp("dataFactory=@rdfjs/data-model"),
5
+ dataFactory: imp("dataFactory=@rdfx/data-factory"),
6
6
  DatasetCore: imp("DatasetCore@@rdfjs/types"),
7
7
  datasetFactory: imp("datasetFactory=@rdfjs/dataset"),
8
8
  Either: imp("Either@purify-ts"),
@@ -26,6 +26,8 @@ export const imports = {
26
26
  Maybe: imp("Maybe@purify-ts"),
27
27
  NamedNode: imp("NamedNode@@rdfjs/types"),
28
28
  NonEmptyList: imp("NonEmptyList@purify-ts"),
29
+ NTriplesIdentifier: imp("NTriplesIdentifier@@rdfx/string"),
30
+ NTriplesTerm: imp("NTriplesTerm@@rdfx/string"),
29
31
  Quad: imp("Quad@@rdfjs/types"),
30
32
  Quad_Graph: imp("Quad_Graph@@rdfjs/types"),
31
33
  RdfjsResourcePropertyPath: imp("PropertyPath:RdfjsResourcePropertyPath@@rdfx/resource"),
@@ -1,4 +1,7 @@
1
1
  import type { BlankNode, Literal, NamedNode, Variable } from "@rdfjs/types";
2
+ import type { Logger } from "ts-log";
2
3
  import { type Code } from "./ts-poet-wrapper.js";
3
- export declare function rdfjsTermExpression(rdfjsTerm: Omit<BlankNode, "equals"> | Omit<Literal, "equals"> | Omit<NamedNode, "equals"> | Omit<Variable, "equals">): Code;
4
+ export declare function rdfjsTermExpression(rdfjsTerm: Omit<BlankNode, "equals"> | Omit<Literal, "equals"> | Omit<NamedNode, "equals"> | Omit<Variable, "equals">, { logger }: {
5
+ logger: Logger;
6
+ }): Code;
4
7
  //# sourceMappingURL=rdfjsTermExpression.d.ts.map
@@ -1,9 +1,8 @@
1
1
  import { rdf, rdfs, xsd } from "@tpluscode/rdf-ns-builders";
2
- import { logger } from "../../logger.js";
3
2
  import { snippets_RdfVocabularies } from "./_snippets/snippets_RdfVocabularies.js";
4
3
  import { imports } from "./imports.js";
5
4
  import { code, literalOf } from "./ts-poet-wrapper.js";
6
- export function rdfjsTermExpression(rdfjsTerm) {
5
+ export function rdfjsTermExpression(rdfjsTerm, { logger }) {
7
6
  switch (rdfjsTerm.termType) {
8
7
  case "BlankNode":
9
8
  return code `${imports.dataFactory}.blankNode(${literalOf(rdfjsTerm.value)})`;
@@ -14,7 +13,7 @@ export function rdfjsTermExpression(rdfjsTerm) {
14
13
  }
15
14
  return code `${imports.dataFactory}.literal(${literalOf(rdfjsTerm.value)}, ${literalOf(rdfjsTerm.language)})`;
16
15
  }
17
- return code `${imports.dataFactory}.literal(${literalOf(rdfjsTerm.value)}, ${rdfjsTermExpression(rdfjsTerm.datatype)})`;
16
+ return code `${imports.dataFactory}.literal(${literalOf(rdfjsTerm.value)}, ${rdfjsTermExpression(rdfjsTerm.datatype, { logger })})`;
18
17
  case "NamedNode": {
19
18
  if (rdfjsTerm.value.startsWith(rdf[""].value)) {
20
19
  const unqualifiedName = rdfjsTerm.value.substring(rdf[""].value.length);
@@ -5,7 +5,6 @@ export declare const snippets: {
5
5
  bigDecimalSparqlWherePatterns: import("ts-poet/build/ConditionalOutput.js").ConditionalOutput;
6
6
  BlankNodeFilter: import("ts-poet/build/ConditionalOutput.js").ConditionalOutput;
7
7
  BlankNodeSchema: import("ts-poet/build/ConditionalOutput.js").ConditionalOutput;
8
- blankNodeFromString: import("ts-poet/build/ConditionalOutput.js").ConditionalOutput;
9
8
  blankNodeSparqlWherePatterns: import("ts-poet/build/ConditionalOutput.js").ConditionalOutput;
10
9
  booleanEquals: import("ts-poet/build/ConditionalOutput.js").ConditionalOutput;
11
10
  BooleanFilter: import("ts-poet/build/ConditionalOutput.js").ConditionalOutput;
@@ -42,7 +41,6 @@ export declare const snippets: {
42
41
  FromRdfResourceValuesFunction: import("ts-poet/build/ConditionalOutput.js").ConditionalOutput;
43
42
  Hasher: import("ts-poet/build/ConditionalOutput.js").ConditionalOutput;
44
43
  IdentifierFilter: import("ts-poet/build/ConditionalOutput.js").ConditionalOutput;
45
- identifierFromString: import("ts-poet/build/ConditionalOutput.js").ConditionalOutput;
46
44
  IdentifierSchema: import("ts-poet/build/ConditionalOutput.js").ConditionalOutput;
47
45
  IdentifierSet: import("ts-poet/build/ConditionalOutput.js").ConditionalOutput;
48
46
  identifierSparqlWherePatterns: import("ts-poet/build/ConditionalOutput.js").ConditionalOutput;
@@ -74,6 +72,9 @@ export declare const snippets: {
74
72
  NumericFilter: import("ts-poet/build/ConditionalOutput.js").ConditionalOutput;
75
73
  NumericSchema: import("ts-poet/build/ConditionalOutput.js").ConditionalOutput;
76
74
  numericSparqlWherePatterns: import("ts-poet/build/ConditionalOutput.js").ConditionalOutput;
75
+ parseBlankNode: import("ts-poet/build/ConditionalOutput.js").ConditionalOutput;
76
+ parseIdentifier: import("ts-poet/build/ConditionalOutput.js").ConditionalOutput;
77
+ parseIri: import("ts-poet/build/ConditionalOutput.js").ConditionalOutput;
77
78
  PropertiesFromRdfResourceFunction: import("ts-poet/build/ConditionalOutput.js").ConditionalOutput;
78
79
  PropertyPath: import("ts-poet/build/ConditionalOutput.js").ConditionalOutput;
79
80
  RdfVocabularies: import("ts-poet/build/ConditionalOutput.js").ConditionalOutput;
@@ -1,3 +1,4 @@
1
+ import { snippets_parseIri } from "./_snippets/parseIri.js";
1
2
  import { snippets_arrayEquals } from "./_snippets/snippets_arrayEquals.js";
2
3
  import { snippets_arrayIntersection } from "./_snippets/snippets_arrayIntersection.js";
3
4
  import { snippets_BlankNodeFilter } from "./_snippets/snippets_BlankNodeFilter.js";
@@ -6,7 +7,6 @@ import { snippets_BooleanFilter } from "./_snippets/snippets_BooleanFilter.js";
6
7
  import { snippets_BooleanSchema } from "./_snippets/snippets_BooleanSchema.js";
7
8
  import { snippets_bigDecimalLiteral } from "./_snippets/snippets_bigDecimalLiteral.js";
8
9
  import { snippets_bigDecimalSparqlWherePatterns } from "./_snippets/snippets_bigDecimalSparqlWherePatterns.js";
9
- import { snippets_blankNodeFromString } from "./_snippets/snippets_blankNodeFromString.js";
10
10
  import { snippets_blankNodeSparqlWherePatterns } from "./_snippets/snippets_blankNodeSparqlWherePatterns.js";
11
11
  import { snippets_booleanEquals } from "./_snippets/snippets_booleanEquals.js";
12
12
  import { snippets_booleanSparqlWherePatterns } from "./_snippets/snippets_booleanSparqlWherePatterns.js";
@@ -45,7 +45,6 @@ import { snippets_IdentifierSchema } from "./_snippets/snippets_IdentifierSchema
45
45
  import { snippets_IdentifierSet } from "./_snippets/snippets_IdentifierSet.js";
46
46
  import { snippets_IriFilter } from "./_snippets/snippets_IriFilter.js";
47
47
  import { snippets_IriSchema } from "./_snippets/snippets_IriSchema.js";
48
- import { snippets_identifierFromString } from "./_snippets/snippets_identifierFromString.js";
49
48
  import { snippets_identifierSparqlWherePatterns } from "./_snippets/snippets_identifierSparqlWherePatterns.js";
50
49
  import { snippets_iriSparqlWherePatterns } from "./_snippets/snippets_iriSparqlWherePatterns.js";
51
50
  import { snippets_isReadonlyBigIntArray } from "./_snippets/snippets_isReadonlyBigIntArray.js";
@@ -75,6 +74,8 @@ import { snippets_normalizeSparqlWherePatterns } from "./_snippets/snippets_norm
75
74
  import { snippets_numericSparqlWherePatterns } from "./_snippets/snippets_numericSparqlWherePatterns.js";
76
75
  import { snippets_PropertiesFromRdfResourceFunction } from "./_snippets/snippets_PropertiesFromRdfResourceFunction.js";
77
76
  import { snippets_PropertyPath } from "./_snippets/snippets_PropertyPath.js";
77
+ import { snippets_parseBlankNode } from "./_snippets/snippets_parseBlankNode.js";
78
+ import { snippets_parseIdentifier } from "./_snippets/snippets_parseIdentifier.js";
78
79
  import { snippets_RdfVocabularies } from "./_snippets/snippets_RdfVocabularies.js";
79
80
  import { snippets_ShaclPropertySchema } from "./_snippets/snippets_ShaclPropertySchema.js";
80
81
  import { snippets_SparqlFilterPattern } from "./_snippets/snippets_SparqlFilterPattern.js";
@@ -110,7 +111,6 @@ export const snippets = {
110
111
  bigDecimalSparqlWherePatterns: snippets_bigDecimalSparqlWherePatterns,
111
112
  BlankNodeFilter: snippets_BlankNodeFilter,
112
113
  BlankNodeSchema: snippets_BlankNodeSchema,
113
- blankNodeFromString: snippets_blankNodeFromString,
114
114
  blankNodeSparqlWherePatterns: snippets_blankNodeSparqlWherePatterns,
115
115
  booleanEquals: snippets_booleanEquals,
116
116
  BooleanFilter: snippets_BooleanFilter,
@@ -147,7 +147,6 @@ export const snippets = {
147
147
  FromRdfResourceValuesFunction: snippets_FromRdfResourceValuesFunction,
148
148
  Hasher: snippets_Hasher,
149
149
  IdentifierFilter: snippets_IdentifierFilter,
150
- identifierFromString: snippets_identifierFromString,
151
150
  IdentifierSchema: snippets_IdentifierSchema,
152
151
  IdentifierSet: snippets_IdentifierSet,
153
152
  identifierSparqlWherePatterns: snippets_identifierSparqlWherePatterns,
@@ -179,6 +178,9 @@ export const snippets = {
179
178
  NumericFilter: snippets_NumericFilter,
180
179
  NumericSchema: snippets_NumericSchema,
181
180
  numericSparqlWherePatterns: snippets_numericSparqlWherePatterns,
181
+ parseBlankNode: snippets_parseBlankNode,
182
+ parseIdentifier: snippets_parseIdentifier,
183
+ parseIri: snippets_parseIri,
182
184
  PropertiesFromRdfResourceFunction: snippets_PropertiesFromRdfResourceFunction,
183
185
  PropertyPath: snippets_PropertyPath,
184
186
  RdfVocabularies: snippets_RdfVocabularies,
@@ -1,9 +1,11 @@
1
+ import type { Logger } from "ts-log";
1
2
  import type { NamedObjectType } from "./NamedObjectType.js";
2
3
  import { NamedObjectUnionType } from "./NamedObjectUnionType.js";
3
4
  /**
4
5
  * Synthesize the $Object union.
5
6
  */
6
7
  export declare function synthesizeUberObjectUnionType(parameters: {
8
+ logger: Logger;
7
9
  namedObjectTypes: readonly NamedObjectType[];
8
10
  }): NamedObjectUnionType;
9
11
  //# sourceMappingURL=synthesizeUberObjectUnionType.d.ts.map
@@ -22,6 +22,7 @@ export function synthesizeUberObjectUnionType(parameters) {
22
22
  identifierType = new IdentifierType({
23
23
  comment: Maybe.empty(),
24
24
  label: Maybe.empty(),
25
+ logger: parameters.logger,
25
26
  });
26
27
  }
27
28
  else {
@@ -30,6 +31,7 @@ export function synthesizeUberObjectUnionType(parameters) {
30
31
  identifierType = new BlankNodeType({
31
32
  comment: Maybe.empty(),
32
33
  label: Maybe.empty(),
34
+ logger: parameters.logger,
33
35
  });
34
36
  break;
35
37
  case "IRI":
@@ -38,6 +40,7 @@ export function synthesizeUberObjectUnionType(parameters) {
38
40
  hasValues: [],
39
41
  in_: [],
40
42
  label: Maybe.empty(),
43
+ logger: parameters.logger,
41
44
  });
42
45
  break;
43
46
  }
@@ -53,6 +56,7 @@ export function synthesizeUberObjectUnionType(parameters) {
53
56
  }, new Set()),
54
57
  identifierType,
55
58
  label: Maybe.empty(),
59
+ logger: parameters.logger,
56
60
  members: namedObjectTypes.map((namedObjectType) => ({
57
61
  discriminantValue: Maybe.empty(),
58
62
  type: namedObjectType,
@@ -1,5 +1,6 @@
1
1
  import { AbstractShapesGraph } from "@shaclmate/shacl-ast";
2
2
  import type { Either } from "purify-ts";
3
+ import type { Logger } from "ts-log";
3
4
  import type { Ast } from "../ast/Ast.js";
4
5
  import type { TsFeature } from "../enums/TsFeature.js";
5
6
  import type { Generator } from "../generators/Generator.js";
@@ -16,13 +17,15 @@ export declare class ShapesGraph extends AbstractShapesGraph<generated.NodeShape
16
17
  */
17
18
  compile(parameters: {
18
19
  generator: Generator;
20
+ logger: Logger;
19
21
  tsFeaturesDefault?: ReadonlySet<TsFeature>;
20
22
  }): Either<Error, string>;
21
23
  static builder(): ShapesGraph.Builder;
22
24
  /**
23
25
  * Transform the shapes graph to an AST.
24
26
  */
25
- toAst(options?: {
27
+ toAst({ logger, tsFeaturesDefault, }: {
28
+ logger: Logger;
26
29
  tsFeaturesDefault?: ReadonlySet<TsFeature>;
27
30
  }): Either<Error, Ast>;
28
31
  }
@@ -22,10 +22,11 @@ export class ShapesGraph extends AbstractShapesGraph {
22
22
  /**
23
23
  * Transform the shapes graph to an AST.
24
24
  */
25
- toAst(options) {
25
+ toAst({ logger, tsFeaturesDefault, }) {
26
26
  return new ShapesGraphToAstTransformer({
27
- ...options,
27
+ logger,
28
28
  shapesGraph: this,
29
+ tsFeaturesDefault,
29
30
  }).transform();
30
31
  }
31
32
  }