@luvio/compiler 0.79.0 → 0.81.0-238.0

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 (131) hide show
  1. package/dist/codegen/adapter/adapter-network-cache-policy.js +5 -1
  2. package/dist/codegen/adapter/adapter-network-cache-policy.js.map +1 -1
  3. package/dist/codegen/adapter/adapter-param-type-check.js +2 -1
  4. package/dist/codegen/adapter/adapter-param-type-check.js.map +1 -1
  5. package/dist/codegen/adapter/index.d.ts +8 -2
  6. package/dist/codegen/adapter/index.js +18 -14
  7. package/dist/codegen/adapter/index.js.map +1 -1
  8. package/dist/codegen/adapter-tests/index.d.ts +3 -2
  9. package/dist/codegen/adapter-tests/index.js +3 -7
  10. package/dist/codegen/adapter-tests/index.js.map +1 -1
  11. package/dist/codegen/graphql/enum/index.d.ts +2 -2
  12. package/dist/codegen/graphql/enum/index.js +6 -5
  13. package/dist/codegen/graphql/enum/index.js.map +1 -1
  14. package/dist/codegen/graphql/enum/interface.d.ts +4 -0
  15. package/dist/codegen/graphql/enum/interface.js +32 -0
  16. package/dist/codegen/graphql/enum/interface.js.map +1 -0
  17. package/dist/codegen/graphql/graphql-dsl.d.ts +19 -0
  18. package/dist/codegen/graphql/graphql-dsl.js +29 -0
  19. package/dist/codegen/graphql/graphql-dsl.js.map +1 -0
  20. package/dist/codegen/graphql/source-printer/graphql-adapter-source-printer.d.ts +8 -0
  21. package/dist/codegen/graphql/source-printer/graphql-adapter-source-printer.js +11 -0
  22. package/dist/codegen/graphql/source-printer/graphql-adapter-source-printer.js.map +1 -0
  23. package/dist/codegen/graphql/source-printer/graphql-resource-source-printer.d.ts +8 -0
  24. package/dist/codegen/graphql/source-printer/graphql-resource-source-printer.js +11 -0
  25. package/dist/codegen/graphql/source-printer/graphql-resource-source-printer.js.map +1 -0
  26. package/dist/codegen/graphql/source-printer/graphql-source-printer.d.ts +19 -0
  27. package/dist/codegen/graphql/source-printer/graphql-source-printer.js +44 -0
  28. package/dist/codegen/graphql/source-printer/graphql-source-printer.js.map +1 -0
  29. package/dist/codegen/graphql/source-printer/graphql-type-source-printer.d.ts +16 -0
  30. package/dist/codegen/graphql/source-printer/graphql-type-source-printer.js +60 -0
  31. package/dist/codegen/graphql/source-printer/graphql-type-source-printer.js.map +1 -0
  32. package/dist/codegen/graphql/source-printer/index.d.ts +5 -0
  33. package/dist/codegen/graphql/source-printer/index.js +12 -0
  34. package/dist/codegen/graphql/source-printer/index.js.map +1 -0
  35. package/dist/codegen/graphql/type/constants.d.ts +7 -0
  36. package/dist/codegen/graphql/type/constants.js +11 -0
  37. package/dist/codegen/graphql/type/constants.js.map +1 -0
  38. package/dist/codegen/graphql/type/index.d.ts +4 -2
  39. package/dist/codegen/graphql/type/index.js +31 -6
  40. package/dist/codegen/graphql/type/index.js.map +1 -1
  41. package/dist/codegen/graphql/type/ingest.d.ts +9 -0
  42. package/dist/codegen/graphql/type/ingest.js +131 -0
  43. package/dist/codegen/graphql/type/ingest.js.map +1 -0
  44. package/dist/codegen/graphql/type/interface.d.ts +3 -3
  45. package/dist/codegen/graphql/type/interface.js +2 -48
  46. package/dist/codegen/graphql/type/interface.js.map +1 -1
  47. package/dist/codegen/graphql/union/index.d.ts +2 -2
  48. package/dist/codegen/graphql/union/index.js +6 -5
  49. package/dist/codegen/graphql/union/index.js.map +1 -1
  50. package/dist/codegen/graphql/union/interface.d.ts +4 -0
  51. package/dist/codegen/graphql/union/interface.js +30 -0
  52. package/dist/codegen/graphql/union/interface.js.map +1 -0
  53. package/dist/codegen/graphql/utils/index.d.ts +1 -0
  54. package/dist/codegen/graphql/utils/index.js +8 -0
  55. package/dist/codegen/graphql/utils/index.js.map +1 -0
  56. package/dist/codegen/graphql/utils/types.d.ts +10 -0
  57. package/dist/codegen/graphql/utils/types.js +45 -0
  58. package/dist/codegen/graphql/utils/types.js.map +1 -0
  59. package/dist/codegen/resource/create-resource-request.d.ts +3 -2
  60. package/dist/codegen/resource/create-resource-request.js +4 -5
  61. package/dist/codegen/resource/create-resource-request.js.map +1 -1
  62. package/dist/codegen/resource/index.d.ts +4 -2
  63. package/dist/codegen/resource/index.js +3 -3
  64. package/dist/codegen/resource/index.js.map +1 -1
  65. package/dist/codegen/rest/source-printer/rest-adapter-source-printer.d.ts +15 -0
  66. package/dist/codegen/rest/source-printer/rest-adapter-source-printer.js +56 -0
  67. package/dist/codegen/rest/source-printer/rest-adapter-source-printer.js.map +1 -0
  68. package/dist/codegen/rest/source-printer/rest-source-printer.d.ts +15 -0
  69. package/dist/codegen/rest/source-printer/rest-source-printer.js +72 -0
  70. package/dist/codegen/rest/source-printer/rest-source-printer.js.map +1 -0
  71. package/dist/codegen/shape/shape-select-paginated.js +7 -7
  72. package/dist/codegen/shape/shape-select-paginated.js.map +1 -1
  73. package/dist/codegen/source-writer/file-system-source-writer.d.ts +14 -0
  74. package/dist/codegen/source-writer/file-system-source-writer.js +31 -0
  75. package/dist/codegen/source-writer/file-system-source-writer.js.map +1 -0
  76. package/dist/compiler/raml-compiler.d.ts +14 -0
  77. package/dist/compiler/raml-compiler.js +41 -0
  78. package/dist/compiler/raml-compiler.js.map +1 -0
  79. package/dist/generate.d.ts +6 -4
  80. package/dist/generate.js +6 -55
  81. package/dist/generate.js.map +1 -1
  82. package/dist/interfaces/compiler.d.ts +4 -0
  83. package/dist/interfaces/compiler.js +3 -0
  84. package/dist/interfaces/compiler.js.map +1 -0
  85. package/dist/interfaces/index.d.ts +5 -0
  86. package/dist/interfaces/index.js +3 -0
  87. package/dist/interfaces/index.js.map +1 -0
  88. package/dist/interfaces/source-printers/graphql/graphql-adapter-printer.d.ts +7 -0
  89. package/dist/interfaces/source-printers/graphql/graphql-adapter-printer.js +3 -0
  90. package/dist/interfaces/source-printers/graphql/graphql-adapter-printer.js.map +1 -0
  91. package/dist/interfaces/source-printers/graphql/graphql-resource-printer.d.ts +7 -0
  92. package/dist/interfaces/source-printers/graphql/graphql-resource-printer.js +3 -0
  93. package/dist/interfaces/source-printers/graphql/graphql-resource-printer.js.map +1 -0
  94. package/dist/interfaces/source-printers/graphql/graphql-type-printer.d.ts +9 -0
  95. package/dist/interfaces/source-printers/graphql/graphql-type-printer.js +3 -0
  96. package/dist/interfaces/source-printers/graphql/graphql-type-printer.js.map +1 -0
  97. package/dist/interfaces/source-printers/index.d.ts +5 -0
  98. package/dist/interfaces/source-printers/index.js +3 -0
  99. package/dist/interfaces/source-printers/index.js.map +1 -0
  100. package/dist/interfaces/source-printers/rest/rest-adapter-printer.d.ts +5 -0
  101. package/dist/interfaces/source-printers/rest/rest-adapter-printer.js +3 -0
  102. package/dist/interfaces/source-printers/rest/rest-adapter-printer.js.map +1 -0
  103. package/dist/interfaces/source-printers/source-printer.d.ts +6 -0
  104. package/dist/interfaces/source-printers/source-printer.js +3 -0
  105. package/dist/interfaces/source-printers/source-printer.js.map +1 -0
  106. package/dist/interfaces/source-writer.d.ts +5 -0
  107. package/dist/interfaces/source-writer.js +3 -0
  108. package/dist/interfaces/source-writer.js.map +1 -0
  109. package/dist/intermediate/graphql.d.ts +2 -2
  110. package/dist/main.d.ts +8 -4
  111. package/dist/main.js +16 -5
  112. package/dist/main.js.map +1 -1
  113. package/dist/parser/main.d.ts +8 -1
  114. package/dist/parser/main.js +186 -180
  115. package/dist/parser/main.js.map +1 -1
  116. package/dist/parser/resource.js +7 -7
  117. package/dist/parser/resource.js.map +1 -1
  118. package/dist/plugin.d.ts +4 -2
  119. package/dist/utils/files.d.ts +0 -8
  120. package/dist/utils/files.js +1 -16
  121. package/dist/utils/files.js.map +1 -1
  122. package/dist/utils/generation.d.ts +4 -2
  123. package/dist/utils/generation.js +8 -14
  124. package/dist/utils/generation.js.map +1 -1
  125. package/dist/utils/imports.d.ts +4 -2
  126. package/dist/utils/imports.js +27 -30
  127. package/dist/utils/imports.js.map +1 -1
  128. package/package.json +6 -5
  129. package/dist/codegen/graphql/index.d.ts +0 -13
  130. package/dist/codegen/graphql/index.js +0 -87
  131. package/dist/codegen/graphql/index.js.map +0 -1
@@ -0,0 +1,4 @@
1
+ import type { CompilerPlugin, ParseError } from '../main';
2
+ export interface LuvioCompiler {
3
+ generate(plugin?: CompilerPlugin): Promise<void | ParseError[]>;
4
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=compiler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compiler.js","sourceRoot":"","sources":["../../src/interfaces/compiler.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import { LuvioCompiler } from './compiler';
2
+ import { CompilerSourceWriter } from './source-writer';
3
+ import { Parser } from '../parser/main';
4
+ import { SourcePrinter, GraphQLTypePrinter, GraphQLAdapterPrinter, GraphQLResourcePrinter } from './source-printers';
5
+ export { LuvioCompiler, Parser, CompilerSourceWriter, SourcePrinter, GraphQLTypePrinter, GraphQLAdapterPrinter, GraphQLResourcePrinter, };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ import type { LuvioGraphQLDSL } from '../../../codegen/graphql/graphql-dsl';
2
+ import type { GraphQLCodegenMetadata } from '../../../codegen/graphql/source-printer/graphql-source-printer';
3
+ export interface GraphQLAdapterPrinter {
4
+ generate(_graphqlDsl: LuvioGraphQLDSL, _metadata: GraphQLCodegenMetadata): {
5
+ [path: string]: string;
6
+ };
7
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=graphql-adapter-printer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graphql-adapter-printer.js","sourceRoot":"","sources":["../../../../src/interfaces/source-printers/graphql/graphql-adapter-printer.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ import type { LuvioGraphQLDSL } from '../../../codegen/graphql/graphql-dsl';
2
+ import type { GraphQLCodegenMetadata } from '../../../codegen/graphql/source-printer/graphql-source-printer';
3
+ export interface GraphQLResourcePrinter {
4
+ generate(graphqlDsl: LuvioGraphQLDSL, metadata: GraphQLCodegenMetadata): {
5
+ [path: string]: string;
6
+ };
7
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=graphql-resource-printer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graphql-resource-printer.js","sourceRoot":"","sources":["../../../../src/interfaces/source-printers/graphql/graphql-resource-printer.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ /// <reference types="node" />
2
+ import type { LuvioGraphQLDSL } from '../../../codegen/graphql/graphql-dsl';
3
+ import type { GraphQLCodegenMetadata } from '../../../codegen/graphql/source-printer/graphql-source-printer';
4
+ import type path from 'path';
5
+ export interface GraphQLTypePrinter {
6
+ generate(graphqlDsl: LuvioGraphQLDSL, compilerBaseOutputDir: path.ParsedPath, metadata: GraphQLCodegenMetadata): {
7
+ [path: string]: string;
8
+ };
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=graphql-type-printer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graphql-type-printer.js","sourceRoot":"","sources":["../../../../src/interfaces/source-printers/graphql/graphql-type-printer.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import { SourcePrinter } from './source-printer';
2
+ import { GraphQLTypePrinter } from './graphql/graphql-type-printer';
3
+ import { GraphQLAdapterPrinter } from './graphql/graphql-adapter-printer';
4
+ import { GraphQLResourcePrinter } from './graphql/graphql-resource-printer';
5
+ export { SourcePrinter, GraphQLTypePrinter, GraphQLAdapterPrinter, GraphQLResourcePrinter };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interfaces/source-printers/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import type { ModelInfo } from '../../../intermediate/model-info';
2
+ import type { RestResource } from '../../../intermediate/resource';
3
+ export interface RestAdapterPrinter {
4
+ generate(resource: RestResource, modelInfo: ModelInfo): Record<string, string>;
5
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=rest-adapter-printer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rest-adapter-printer.js","sourceRoot":"","sources":["../../../../src/interfaces/source-printers/rest/rest-adapter-printer.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import type { ModelInfo } from '../../main';
2
+ export interface SourcePrinter {
3
+ generateModules(modelInfo: ModelInfo): {
4
+ [path: string]: string;
5
+ };
6
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=source-printer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-printer.js","sourceRoot":"","sources":["../../../src/interfaces/source-printers/source-printer.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ export interface CompilerSourceWriter {
2
+ writeModules: (modules: {
3
+ [name: string]: string;
4
+ }) => void;
5
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=source-writer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-writer.js","sourceRoot":"","sources":["../../src/interfaces/source-writer.ts"],"names":[],"mappings":""}
@@ -1,10 +1,10 @@
1
- import type { LuvioGraphQLSchema } from '@luvio/graphql-parser';
1
+ import type { LuvioGraphQLDSL } from '../codegen/graphql/graphql-dsl';
2
2
  export interface GraphQLTypeExtension {
3
3
  ttl: number;
4
4
  line: number;
5
5
  col: number;
6
6
  }
7
7
  export interface GraphQLRepresentation {
8
- schema: LuvioGraphQLSchema;
8
+ graphqlDsl: LuvioGraphQLDSL;
9
9
  typeExtensions: Record<string, GraphQLTypeExtension>;
10
10
  }
package/dist/main.d.ts CHANGED
@@ -1,7 +1,11 @@
1
- export { generate, CompilerConfig } from './generate';
2
- export { parse } from './parse';
3
1
  export { ParseError } from './parser/logger';
4
- export { ParseResults } from './parser/main';
2
+ export { ParseResults, LuvioRamlFileParser } from './parser/main';
5
3
  export { ModelInfo, ShapePrivate } from './intermediate/model-info';
6
4
  export { ShapeTypes, ParameterDefinition, ShapeDefinition, PropertyShapeDefinition, NodeShapeDefinition, ArrayShapeDefinition, UnionShapeDefinition, ScalarShapeDefinition, } from './intermediate/definitions';
7
- export { CompilerPlugin, PluginResult } from './plugin';
5
+ export { CompilerPlugin, CompilerPluginConfig, PluginResult } from './plugin';
6
+ export { LuvioRamlCompiler } from './compiler/raml-compiler';
7
+ export { CompilerSourceWriter, LuvioCompiler, Parser } from './interfaces';
8
+ export { FileSystemSourceWriter } from './codegen/source-writer/file-system-source-writer';
9
+ export { GraphQLSourcePrinter, GraphQLTypeSourcePrinter, GraphQLResourceSourcePrinter, GraphQLAdapterSourcePrinter, } from './codegen/graphql/source-printer';
10
+ export { RestSourcePrinter } from './codegen/rest/source-printer/rest-source-printer';
11
+ export { RestAdapterSourcePrinter } from './codegen/rest/source-printer/rest-adapter-source-printer';
package/dist/main.js CHANGED
@@ -1,10 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ShapeTypes = exports.parse = exports.generate = void 0;
4
- var generate_1 = require("./generate");
5
- Object.defineProperty(exports, "generate", { enumerable: true, get: function () { return generate_1.generate; } });
6
- var parse_1 = require("./parse");
7
- Object.defineProperty(exports, "parse", { enumerable: true, get: function () { return parse_1.parse; } });
3
+ exports.RestAdapterSourcePrinter = exports.RestSourcePrinter = exports.GraphQLAdapterSourcePrinter = exports.GraphQLResourceSourcePrinter = exports.GraphQLTypeSourcePrinter = exports.GraphQLSourcePrinter = exports.FileSystemSourceWriter = exports.LuvioRamlCompiler = exports.ShapeTypes = exports.LuvioRamlFileParser = void 0;
4
+ var main_1 = require("./parser/main");
5
+ Object.defineProperty(exports, "LuvioRamlFileParser", { enumerable: true, get: function () { return main_1.LuvioRamlFileParser; } });
8
6
  var definitions_1 = require("./intermediate/definitions");
9
7
  Object.defineProperty(exports, "ShapeTypes", { enumerable: true, get: function () { return definitions_1.ShapeTypes; } });
8
+ var raml_compiler_1 = require("./compiler/raml-compiler");
9
+ Object.defineProperty(exports, "LuvioRamlCompiler", { enumerable: true, get: function () { return raml_compiler_1.LuvioRamlCompiler; } });
10
+ var file_system_source_writer_1 = require("./codegen/source-writer/file-system-source-writer");
11
+ Object.defineProperty(exports, "FileSystemSourceWriter", { enumerable: true, get: function () { return file_system_source_writer_1.FileSystemSourceWriter; } });
12
+ var source_printer_1 = require("./codegen/graphql/source-printer");
13
+ Object.defineProperty(exports, "GraphQLSourcePrinter", { enumerable: true, get: function () { return source_printer_1.GraphQLSourcePrinter; } });
14
+ Object.defineProperty(exports, "GraphQLTypeSourcePrinter", { enumerable: true, get: function () { return source_printer_1.GraphQLTypeSourcePrinter; } });
15
+ Object.defineProperty(exports, "GraphQLResourceSourcePrinter", { enumerable: true, get: function () { return source_printer_1.GraphQLResourceSourcePrinter; } });
16
+ Object.defineProperty(exports, "GraphQLAdapterSourcePrinter", { enumerable: true, get: function () { return source_printer_1.GraphQLAdapterSourcePrinter; } });
17
+ var rest_source_printer_1 = require("./codegen/rest/source-printer/rest-source-printer");
18
+ Object.defineProperty(exports, "RestSourcePrinter", { enumerable: true, get: function () { return rest_source_printer_1.RestSourcePrinter; } });
19
+ var rest_adapter_source_printer_1 = require("./codegen/rest/source-printer/rest-adapter-source-printer");
20
+ Object.defineProperty(exports, "RestAdapterSourcePrinter", { enumerable: true, get: function () { return rest_adapter_source_printer_1.RestAdapterSourcePrinter; } });
10
21
  //# sourceMappingURL=main.js.map
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";;;AAAA,uCAAsD;AAA7C,oGAAA,QAAQ,OAAA;AACjB,iCAAgC;AAAvB,8FAAA,KAAK,OAAA;AAId,0DASoC;AARhC,yGAAA,UAAU,OAAA"}
1
+ {"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";;;AACA,sCAAkE;AAA3C,2GAAA,mBAAmB,OAAA;AAE1C,0DASoC;AARhC,yGAAA,UAAU,OAAA;AAUd,0DAA6D;AAApD,kHAAA,iBAAiB,OAAA;AAE1B,+FAA2F;AAAlF,mIAAA,sBAAsB,OAAA;AAC/B,mEAK0C;AAJtC,sHAAA,oBAAoB,OAAA;AACpB,0HAAA,wBAAwB,OAAA;AACxB,8HAAA,4BAA4B,OAAA;AAC5B,6HAAA,2BAA2B,OAAA;AAE/B,yFAAsF;AAA7E,wHAAA,iBAAiB,OAAA;AAC1B,yGAAqG;AAA5F,uIAAA,wBAAwB,OAAA"}
@@ -1,6 +1,9 @@
1
1
  import { model as amf } from 'amf-client-js';
2
2
  import type { ModelInfo } from '../intermediate/model-info';
3
3
  import type { ParseError } from './logger';
4
+ export interface Parser {
5
+ parse(): Promise<ParseResults>;
6
+ }
4
7
  export declare type ShapeKeyFields = {
5
8
  [key: string]: {
6
9
  valuePath: string;
@@ -18,4 +21,8 @@ export declare type ParseResults = {
18
21
  modelInfo: undefined;
19
22
  errors: ParseError[];
20
23
  };
21
- export declare function parse(path: string): Promise<ParseResults>;
24
+ export declare class LuvioRamlFileParser implements Parser {
25
+ private ramlPath;
26
+ constructor(ramlPath: string);
27
+ parse(): Promise<ParseResults>;
28
+ }