@luvio/compiler 0.78.0 → 0.82.1
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/codegen/adapter/adapter-network-cache-policy.js +5 -1
- package/dist/codegen/adapter/adapter-network-cache-policy.js.map +1 -1
- package/dist/codegen/adapter/adapter-param-type-check.js +2 -1
- package/dist/codegen/adapter/adapter-param-type-check.js.map +1 -1
- package/dist/codegen/adapter/index.d.ts +4 -0
- package/dist/codegen/adapter/index.js +5 -1
- package/dist/codegen/adapter/index.js.map +1 -1
- package/dist/codegen/adapter-tests/index.js +1 -1
- package/dist/codegen/adapter-tests/index.js.map +1 -1
- package/dist/codegen/graphql/enum/index.d.ts +2 -2
- package/dist/codegen/graphql/enum/index.js +6 -5
- package/dist/codegen/graphql/enum/index.js.map +1 -1
- package/dist/codegen/graphql/enum/interface.d.ts +4 -0
- package/dist/codegen/graphql/enum/interface.js +32 -0
- package/dist/codegen/graphql/enum/interface.js.map +1 -0
- package/dist/codegen/graphql/source-printer/graphql-adapter-source-printer.d.ts +7 -0
- package/dist/codegen/graphql/source-printer/graphql-adapter-source-printer.js +11 -0
- package/dist/codegen/graphql/source-printer/graphql-adapter-source-printer.js.map +1 -0
- package/dist/codegen/graphql/source-printer/graphql-resource-source-printer.d.ts +7 -0
- package/dist/codegen/graphql/source-printer/graphql-resource-source-printer.js +11 -0
- package/dist/codegen/graphql/source-printer/graphql-resource-source-printer.js.map +1 -0
- package/dist/codegen/graphql/source-printer/graphql-source-printer.d.ts +27 -0
- package/dist/codegen/graphql/source-printer/graphql-source-printer.js +50 -0
- package/dist/codegen/graphql/source-printer/graphql-source-printer.js.map +1 -0
- package/dist/codegen/graphql/source-printer/graphql-type-source-printer.d.ts +13 -0
- package/dist/codegen/graphql/source-printer/graphql-type-source-printer.js +65 -0
- package/dist/codegen/graphql/source-printer/graphql-type-source-printer.js.map +1 -0
- package/dist/codegen/graphql/source-printer/index.d.ts +5 -0
- package/dist/codegen/graphql/source-printer/index.js +12 -0
- package/dist/codegen/graphql/source-printer/index.js.map +1 -0
- package/dist/codegen/graphql/type/constants.d.ts +7 -0
- package/dist/codegen/graphql/type/constants.js +11 -0
- package/dist/codegen/graphql/type/constants.js.map +1 -0
- package/dist/codegen/graphql/type/index.d.ts +3 -2
- package/dist/codegen/graphql/type/index.js +30 -5
- package/dist/codegen/graphql/type/index.js.map +1 -1
- package/dist/codegen/graphql/type/ingest.d.ts +9 -0
- package/dist/codegen/graphql/type/ingest.js +131 -0
- package/dist/codegen/graphql/type/ingest.js.map +1 -0
- package/dist/codegen/graphql/type/interface.d.ts +3 -3
- package/dist/codegen/graphql/type/interface.js +2 -48
- package/dist/codegen/graphql/type/interface.js.map +1 -1
- package/dist/codegen/graphql/union/index.d.ts +2 -2
- package/dist/codegen/graphql/union/index.js +6 -5
- package/dist/codegen/graphql/union/index.js.map +1 -1
- package/dist/codegen/graphql/union/interface.d.ts +4 -0
- package/dist/codegen/graphql/union/interface.js +30 -0
- package/dist/codegen/graphql/union/interface.js.map +1 -0
- package/dist/codegen/graphql/utils/index.d.ts +1 -0
- package/dist/codegen/graphql/utils/index.js +8 -0
- package/dist/codegen/graphql/utils/index.js.map +1 -0
- package/dist/codegen/graphql/utils/types.d.ts +10 -0
- package/dist/codegen/graphql/utils/types.js +45 -0
- package/dist/codegen/graphql/utils/types.js.map +1 -0
- package/dist/codegen/resource/create-resource-request.js +2 -2
- package/dist/codegen/resource/create-resource-request.js.map +1 -1
- package/dist/codegen/rest/source-printer/rest-adapter-source-printer.d.ts +12 -0
- package/dist/codegen/rest/source-printer/rest-adapter-source-printer.js +60 -0
- package/dist/codegen/rest/source-printer/rest-adapter-source-printer.js.map +1 -0
- package/dist/codegen/rest/source-printer/rest-source-printer.d.ts +12 -0
- package/dist/codegen/rest/source-printer/rest-source-printer.js +78 -0
- package/dist/codegen/rest/source-printer/rest-source-printer.js.map +1 -0
- package/dist/codegen/source-writer/file-system-source-writer.d.ts +14 -0
- package/dist/codegen/source-writer/file-system-source-writer.js +31 -0
- package/dist/codegen/source-writer/file-system-source-writer.js.map +1 -0
- package/dist/compiler/raml-compiler.d.ts +15 -0
- package/dist/compiler/raml-compiler.js +34 -0
- package/dist/compiler/raml-compiler.js.map +1 -0
- package/dist/generate.d.ts +3 -5
- package/dist/generate.js +0 -134
- package/dist/generate.js.map +1 -1
- package/dist/interfaces/compiler.d.ts +4 -0
- package/dist/interfaces/compiler.js +3 -0
- package/dist/interfaces/compiler.js.map +1 -0
- package/dist/interfaces/index.d.ts +5 -0
- package/dist/interfaces/index.js +3 -0
- package/dist/interfaces/index.js.map +1 -0
- package/dist/interfaces/source-printers/graphql/graphql-adapter-printer.d.ts +6 -0
- package/dist/interfaces/source-printers/graphql/graphql-adapter-printer.js +3 -0
- package/dist/interfaces/source-printers/graphql/graphql-adapter-printer.js.map +1 -0
- package/dist/interfaces/source-printers/graphql/graphql-resource-printer.d.ts +6 -0
- package/dist/interfaces/source-printers/graphql/graphql-resource-printer.js +3 -0
- package/dist/interfaces/source-printers/graphql/graphql-resource-printer.js.map +1 -0
- package/dist/interfaces/source-printers/graphql/graphql-type-printer.d.ts +6 -0
- package/dist/interfaces/source-printers/graphql/graphql-type-printer.js +3 -0
- package/dist/interfaces/source-printers/graphql/graphql-type-printer.js.map +1 -0
- package/dist/interfaces/source-printers/index.d.ts +5 -0
- package/dist/interfaces/source-printers/index.js +3 -0
- package/dist/interfaces/source-printers/index.js.map +1 -0
- package/dist/interfaces/source-printers/rest/rest-adapter-printer.d.ts +5 -0
- package/dist/interfaces/source-printers/rest/rest-adapter-printer.js +3 -0
- package/dist/interfaces/source-printers/rest/rest-adapter-printer.js.map +1 -0
- package/dist/interfaces/source-printers/source-printer.d.ts +6 -0
- package/dist/interfaces/source-printers/source-printer.js +3 -0
- package/dist/interfaces/source-printers/source-printer.js.map +1 -0
- package/dist/interfaces/source-writer.d.ts +6 -0
- package/dist/interfaces/source-writer.js +3 -0
- package/dist/interfaces/source-writer.js.map +1 -0
- package/dist/main.d.ts +8 -3
- package/dist/main.js +16 -5
- package/dist/main.js.map +1 -1
- package/dist/parser/main.d.ts +8 -1
- package/dist/parser/main.js +186 -180
- package/dist/parser/main.js.map +1 -1
- package/dist/utils/files.d.ts +0 -8
- package/dist/utils/files.js +1 -16
- package/dist/utils/files.js.map +1 -1
- package/dist/utils/generation.js +5 -5
- package/dist/utils/generation.js.map +1 -1
- package/dist/utils/imports.js +4 -3
- package/dist/utils/imports.js.map +1 -1
- package/package.json +4 -4
- package/dist/codegen/graphql/index.d.ts +0 -13
- package/dist/codegen/graphql/index.js +0 -87
- package/dist/codegen/graphql/index.js.map +0 -1
- package/dist/parse.d.ts +0 -2
- package/dist/parse.js +0 -14
- package/dist/parse.js.map +0 -1
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { LuvioGraphQLSchema } from '@luvio/graphql-parser';
|
|
2
|
-
import type { AdapterAnnotation } from '../../intermediate/adapter-annotation';
|
|
3
|
-
import type { CompilerEnvironment } from '../../generate';
|
|
4
|
-
declare type GraphQLGenerationResult = Record<string, string>;
|
|
5
|
-
export interface GraphQLGenerateState {
|
|
6
|
-
schema: LuvioGraphQLSchema;
|
|
7
|
-
adapter?: AdapterAnnotation;
|
|
8
|
-
outDirName: string;
|
|
9
|
-
env: CompilerEnvironment;
|
|
10
|
-
scalarToPrimitiveMap: Record<string, string>;
|
|
11
|
-
}
|
|
12
|
-
export declare function generate(state: GraphQLGenerateState): GraphQLGenerationResult;
|
|
13
|
-
export {};
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.generate = void 0;
|
|
7
|
-
const graphql_parser_1 = require("@luvio/graphql-parser");
|
|
8
|
-
const imports_1 = require("../../utils/imports");
|
|
9
|
-
const path_1 = __importDefault(require("path"));
|
|
10
|
-
const type_1 = require("./type");
|
|
11
|
-
const enum_1 = require("./enum");
|
|
12
|
-
const union_1 = require("./union");
|
|
13
|
-
function createImportContext(state, defName) {
|
|
14
|
-
const { env, outDirName } = state;
|
|
15
|
-
const { config: compilerConfig } = env;
|
|
16
|
-
const graphqlRelPath = `${outDirName}/types/${defName}.ts`;
|
|
17
|
-
const shapeAbsPath = path_1.default.resolve(compilerConfig.outputDir, graphqlRelPath);
|
|
18
|
-
return {
|
|
19
|
-
relPath: graphqlRelPath,
|
|
20
|
-
importContext: (0, imports_1.createImportContext)({
|
|
21
|
-
compiler: env,
|
|
22
|
-
output: path_1.default.parse(shapeAbsPath),
|
|
23
|
-
}),
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
function generateUnion(defName, def, state) {
|
|
27
|
-
const { relPath, importContext } = createImportContext(state, defName);
|
|
28
|
-
return {
|
|
29
|
-
[relPath]: (0, union_1.generate)(state, defName, def, importContext),
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
function generateEnum(defName, def, state) {
|
|
33
|
-
const { relPath, importContext } = createImportContext(state, defName);
|
|
34
|
-
return {
|
|
35
|
-
[relPath]: (0, enum_1.generate)(state, defName, def, importContext),
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
function generateType(defName, def, state) {
|
|
39
|
-
const { relPath, importContext } = createImportContext(state, defName);
|
|
40
|
-
return {
|
|
41
|
-
[relPath]: (0, type_1.generateType)(state, defName, def, importContext),
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
function generate(state) {
|
|
45
|
-
const { schema } = state;
|
|
46
|
-
const results = {};
|
|
47
|
-
const schemaTypes = Object.values(schema.schema.getTypeMap());
|
|
48
|
-
// make a pass over the schema to identify any custom scalar types
|
|
49
|
-
schemaTypes
|
|
50
|
-
.filter((def) => {
|
|
51
|
-
return (0, graphql_parser_1.isScalarType)(def) && def.astNode !== undefined;
|
|
52
|
-
})
|
|
53
|
-
.forEach((def) => {
|
|
54
|
-
state.scalarToPrimitiveMap[def.name] = 'any';
|
|
55
|
-
});
|
|
56
|
-
schemaTypes.forEach((def) => {
|
|
57
|
-
var _a;
|
|
58
|
-
if (!('name' in def)) {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
if (def.name === undefined) {
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
let childResult = {};
|
|
65
|
-
const kind = (_a = def.astNode) === null || _a === void 0 ? void 0 : _a.kind;
|
|
66
|
-
switch (kind) {
|
|
67
|
-
case graphql_parser_1.Kind.OBJECT_TYPE_DEFINITION:
|
|
68
|
-
case graphql_parser_1.Kind.INTERFACE_TYPE_DEFINITION:
|
|
69
|
-
childResult = generateType(def.name, def.astNode, state);
|
|
70
|
-
break;
|
|
71
|
-
case graphql_parser_1.Kind.UNION_TYPE_DEFINITION:
|
|
72
|
-
childResult = generateUnion(def.name, def.astNode, state);
|
|
73
|
-
break;
|
|
74
|
-
case graphql_parser_1.Kind.ENUM_TYPE_DEFINITION:
|
|
75
|
-
childResult = generateEnum(def.name, def.astNode, state);
|
|
76
|
-
break;
|
|
77
|
-
default:
|
|
78
|
-
break;
|
|
79
|
-
}
|
|
80
|
-
Object.keys(childResult).forEach((key) => {
|
|
81
|
-
results[key] = (0, imports_1.resolveImports)(childResult[key]);
|
|
82
|
-
});
|
|
83
|
-
});
|
|
84
|
-
return results;
|
|
85
|
-
}
|
|
86
|
-
exports.generate = generate;
|
|
87
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/codegen/graphql/index.ts"],"names":[],"mappings":";;;;;;AAOA,0DAA2D;AAG3D,iDAG6B;AAC7B,gDAAwB;AACxB,iCAA6D;AAC7D,iCAAsD;AACtD,mCAAwD;AAaxD,SAAS,mBAAmB,CACxB,KAA2B,EAC3B,OAAe;IAEf,MAAM,EAAE,G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AAM;YAEV,KAAK,qBAAI,CAAC,oBAAoB;gBAC1B,WAAW,GAAG,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,OAAQ,EAAE,KAAK,CAAC,CAAC;gBAC1D,MAAM;YAEV;gBACI,MAAM;SACb;QAED,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YACrC,OAAO,CAAC,GAAG,CAAC,GAAG,IAAA,wBAAc,EAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;QACpD,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC;AACnB,CAAC;AAnDD,4BAmDC"}
|
package/dist/parse.d.ts
DELETED
package/dist/parse.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.parse = void 0;
|
|
7
|
-
const path_1 = __importDefault(require("path"));
|
|
8
|
-
const main_1 = require("./parser/main");
|
|
9
|
-
function parse(inputFile) {
|
|
10
|
-
const input = path_1.default.resolve(inputFile);
|
|
11
|
-
return (0, main_1.parse)(input);
|
|
12
|
-
}
|
|
13
|
-
exports.parse = parse;
|
|
14
|
-
//# sourceMappingURL=parse.js.map
|
package/dist/parse.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parse.js","sourceRoot":"","sources":["../src/parse.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,wCAAyD;AAEzD,SAAgB,KAAK,CAAC,SAAiB;IACnC,MAAM,KAAK,GAAG,cAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACtC,OAAO,IAAA,YAAe,EAAC,KAAK,CAAC,CAAC;AAClC,CAAC;AAHD,sBAGC"}
|