@luvio/compiler 0.81.1-238.1 → 0.83.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.
- package/dist/codegen/adapter/index.d.ts +8 -2
- package/dist/codegen/adapter/index.js +18 -14
- package/dist/codegen/adapter/index.js.map +1 -1
- package/dist/codegen/adapter-tests/index.d.ts +3 -2
- package/dist/codegen/adapter-tests/index.js +3 -7
- 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/graphql-dsl.d.ts +4 -10
- package/dist/codegen/graphql/graphql-dsl.js +5 -8
- package/dist/codegen/graphql/graphql-dsl.js.map +1 -1
- package/dist/codegen/graphql/source-printer/graphql-adapter-source-printer.d.ts +7 -5
- package/dist/codegen/graphql/source-printer/graphql-adapter-source-printer.js +31 -3
- package/dist/codegen/graphql/source-printer/graphql-adapter-source-printer.js.map +1 -1
- package/dist/codegen/graphql/source-printer/graphql-resource-source-printer.d.ts +6 -3
- package/dist/codegen/graphql/source-printer/graphql-resource-source-printer.js +15 -3
- package/dist/codegen/graphql/source-printer/graphql-resource-source-printer.js.map +1 -1
- package/dist/codegen/graphql/source-printer/graphql-source-printer.d.ts +5 -2
- package/dist/codegen/graphql/source-printer/graphql-source-printer.js +9 -6
- package/dist/codegen/graphql/source-printer/graphql-source-printer.js.map +1 -1
- package/dist/codegen/graphql/source-printer/graphql-type-source-printer.d.ts +2 -2
- package/dist/codegen/graphql/source-printer/graphql-type-source-printer.js +6 -5
- package/dist/codegen/graphql/source-printer/graphql-type-source-printer.js.map +1 -1
- package/dist/codegen/graphql/source-printer/index.d.ts +2 -2
- package/dist/codegen/graphql/source-printer/index.js.map +1 -1
- package/dist/codegen/graphql/type/index.d.ts +5 -2
- package/dist/codegen/graphql/type/index.js +39 -6
- package/dist/codegen/graphql/type/index.js.map +1 -1
- package/dist/codegen/graphql/type/ingest.d.ts +3 -2
- package/dist/codegen/graphql/type/ingest.js +22 -8
- package/dist/codegen/graphql/type/ingest.js.map +1 -1
- 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/type/ttl.d.ts +4 -0
- package/dist/codegen/graphql/type/ttl.js +18 -0
- package/dist/codegen/graphql/type/ttl.js.map +1 -0
- 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/utils/index.d.ts +1 -1
- package/dist/codegen/graphql/utils/index.js +2 -1
- package/dist/codegen/graphql/utils/index.js.map +1 -1
- package/dist/codegen/graphql/utils/types.d.ts +6 -0
- package/dist/codegen/graphql/utils/types.js +13 -1
- package/dist/codegen/graphql/utils/types.js.map +1 -1
- package/dist/codegen/package-renderer/index.d.ts +2 -0
- package/dist/codegen/package-renderer/index.js +6 -0
- package/dist/codegen/package-renderer/index.js.map +1 -0
- package/dist/codegen/package-renderer/package-renderer.d.ts +16 -0
- package/dist/codegen/package-renderer/package-renderer.js +72 -0
- package/dist/codegen/package-renderer/package-renderer.js.map +1 -0
- package/dist/codegen/package-renderer/text-file.d.ts +6 -0
- package/dist/codegen/package-renderer/text-file.js +3 -0
- package/dist/codegen/package-renderer/text-file.js.map +1 -0
- package/dist/codegen/resource/create-resource-request.d.ts +3 -2
- package/dist/codegen/resource/create-resource-request.js +4 -5
- package/dist/codegen/resource/create-resource-request.js.map +1 -1
- package/dist/codegen/resource/index.d.ts +4 -2
- package/dist/codegen/resource/index.js +3 -3
- package/dist/codegen/resource/index.js.map +1 -1
- package/dist/codegen/shape/shape-select-paginated.js +1 -8
- package/dist/codegen/shape/shape-select-paginated.js.map +1 -1
- package/dist/codegen/typescript/index.d.ts +3 -0
- package/dist/codegen/typescript/index.js +15 -0
- package/dist/codegen/typescript/index.js.map +1 -0
- package/dist/codegen/typescript/typescript-import.d.ts +93 -0
- package/dist/codegen/typescript/typescript-import.js +110 -0
- package/dist/codegen/typescript/typescript-import.js.map +1 -0
- package/dist/codegen/typescript/typescript-package.d.ts +13 -0
- package/dist/codegen/typescript/typescript-package.js +85 -0
- package/dist/codegen/typescript/typescript-package.js.map +1 -0
- package/dist/codegen/typescript/typescript-source-file-id.d.ts +13 -0
- package/dist/codegen/typescript/typescript-source-file-id.js +21 -0
- package/dist/codegen/typescript/typescript-source-file-id.js.map +1 -0
- package/dist/codegen/typescript/typescript-source-file.d.ts +10 -0
- package/dist/codegen/typescript/typescript-source-file.js +19 -0
- package/dist/codegen/typescript/typescript-source-file.js.map +1 -0
- package/dist/interfaces/source-printers/graphql/graphql-adapter-printer.d.ts +5 -3
- package/dist/interfaces/source-printers/graphql/graphql-resource-printer.d.ts +5 -3
- package/dist/interfaces/source-printers/graphql/graphql-type-printer.d.ts +2 -2
- package/dist/intermediate/graphql-annotation.d.ts +1 -1
- package/dist/intermediate/graphql.d.ts +10 -3
- package/dist/intermediate/resource.d.ts +2 -2
- package/dist/main.d.ts +8 -4
- package/dist/main.js +16 -5
- package/dist/main.js.map +1 -1
- package/dist/parser/annotation-graphql.d.ts +2 -2
- 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/parser/resource.js +13 -11
- package/dist/parser/resource.js.map +1 -1
- package/dist/plugin.d.ts +4 -2
- 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.d.ts +4 -2
- package/dist/utils/generation.js +8 -14
- package/dist/utils/generation.js.map +1 -1
- package/dist/utils/imports.d.ts +4 -2
- package/dist/utils/imports.js +27 -30
- package/dist/utils/imports.js.map +1 -1
- package/package.json +5 -6
- 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/generate.d.ts +0 -17
- package/dist/generate.js +0 -137
- package/dist/generate.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,8 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="node" />
|
|
2
2
|
import type { AdapterAnnotation } from '../../intermediate/adapter-annotation';
|
|
3
3
|
import type { NodeShapeDefinition, ShapeDefinition } from '../../intermediate/definitions';
|
|
4
4
|
import type { ModelInfo } from '../../intermediate/model-info';
|
|
5
5
|
import type { Resource } from '../../intermediate/resource';
|
|
6
|
+
import type path from 'path';
|
|
7
|
+
import type { CompilerPlugin } from '../../plugin';
|
|
6
8
|
export interface ConfigShape {
|
|
7
9
|
name: string;
|
|
8
10
|
shape: NodeShapeDefinition;
|
|
@@ -19,4 +21,8 @@ export interface ResourceParamInfo {
|
|
|
19
21
|
shape: ShapeDefinition;
|
|
20
22
|
resourceParamType: ResourceParamType;
|
|
21
23
|
}
|
|
22
|
-
export declare function
|
|
24
|
+
export declare function generateGetAdapter(typescriptFilePath: path.ParsedPath, compilerBaseOutputDir: path.ParsedPath, adapterAnnotation: AdapterAnnotation, resource: Resource, modelInfo: ModelInfo, plugin?: CompilerPlugin): string;
|
|
25
|
+
export declare function generatePatchAdapter(typescriptFilePath: path.ParsedPath, compilerBaseOutputDir: path.ParsedPath, adapterAnnotation: AdapterAnnotation, resource: Resource, modelInfo: ModelInfo, plugin?: CompilerPlugin): string;
|
|
26
|
+
export declare function generateDeleteAdapter(typescriptFilePath: path.ParsedPath, compilerBaseOutputDir: path.ParsedPath, adapterAnnotation: AdapterAnnotation, resource: Resource, modelInfo: ModelInfo, plugin?: CompilerPlugin): string;
|
|
27
|
+
export declare function generatePostAdapter(typescriptFilePath: path.ParsedPath, compilerBaseOutputDir: path.ParsedPath, adapterAnnotation: AdapterAnnotation, resource: Resource, modelInfo: ModelInfo, plugin?: CompilerPlugin): string;
|
|
28
|
+
export declare function generateAdapter(typescriptFilePath: path.ParsedPath, compilerBaseOutputDir: path.ParsedPath, adapterAnnotation: AdapterAnnotation, resource: Resource, modelInfo: ModelInfo, plugin?: CompilerPlugin): string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.generateAdapter = exports.ResourceParamType = void 0;
|
|
3
|
+
exports.generateAdapter = exports.generatePostAdapter = exports.generateDeleteAdapter = exports.generatePatchAdapter = exports.generateGetAdapter = exports.ResourceParamType = void 0;
|
|
4
4
|
const format_1 = require("../../utils/format");
|
|
5
5
|
const imports_1 = require("../../utils/imports");
|
|
6
6
|
const adapter_browser_factory_1 = require("./adapter-browser-factory");
|
|
@@ -68,13 +68,13 @@ function buildConfigParamInfos(resource) {
|
|
|
68
68
|
}
|
|
69
69
|
return paramInfos;
|
|
70
70
|
}
|
|
71
|
-
function generateGetAdapter(
|
|
71
|
+
function generateGetAdapter(typescriptFilePath, compilerBaseOutputDir, adapterAnnotation, resource, modelInfo, plugin) {
|
|
72
72
|
const configShape = {
|
|
73
73
|
name: resource.name,
|
|
74
74
|
shape: resource.flattenResourceParamDefinition,
|
|
75
75
|
};
|
|
76
76
|
const configParamInfos = buildConfigParamInfos(resource);
|
|
77
|
-
const importContext = (0, imports_1.createImportContext)(
|
|
77
|
+
const importContext = (0, imports_1.createImportContext)(typescriptFilePath, compilerBaseOutputDir, plugin);
|
|
78
78
|
return [
|
|
79
79
|
(0, adapter_name_1.generateAdapterNameExport)(adapterAnnotation.name),
|
|
80
80
|
(0, adapter_one_of_params_1.generateAdapterOneOfParams)(adapterAnnotation),
|
|
@@ -101,13 +101,14 @@ function generateGetAdapter(env, adapterAnnotation, resource, modelInfo) {
|
|
|
101
101
|
.filter(Boolean)
|
|
102
102
|
.join('\n\n');
|
|
103
103
|
}
|
|
104
|
-
|
|
104
|
+
exports.generateGetAdapter = generateGetAdapter;
|
|
105
|
+
function generatePatchAdapter(typescriptFilePath, compilerBaseOutputDir, adapterAnnotation, resource, modelInfo, plugin) {
|
|
105
106
|
const configShape = {
|
|
106
107
|
name: resource.name,
|
|
107
108
|
shape: resource.flattenResourceParamDefinition,
|
|
108
109
|
};
|
|
109
110
|
const configParamInfos = buildConfigParamInfos(resource);
|
|
110
|
-
const importContext = (0, imports_1.createImportContext)(
|
|
111
|
+
const importContext = (0, imports_1.createImportContext)(typescriptFilePath, compilerBaseOutputDir, plugin);
|
|
111
112
|
return [
|
|
112
113
|
(0, adapter_name_1.generateAdapterNameExport)(adapterAnnotation.name),
|
|
113
114
|
(0, adapter_one_of_params_1.generateAdapterOneOfParams)(adapterAnnotation),
|
|
@@ -123,13 +124,14 @@ function generatePatchAdapter(env, adapterAnnotation, resource, modelInfo) {
|
|
|
123
124
|
.filter(Boolean)
|
|
124
125
|
.join('\n\n');
|
|
125
126
|
}
|
|
126
|
-
|
|
127
|
+
exports.generatePatchAdapter = generatePatchAdapter;
|
|
128
|
+
function generateDeleteAdapter(typescriptFilePath, compilerBaseOutputDir, adapterAnnotation, resource, modelInfo, plugin) {
|
|
127
129
|
const configShape = {
|
|
128
130
|
name: resource.name,
|
|
129
131
|
shape: resource.flattenResourceParamDefinition,
|
|
130
132
|
};
|
|
131
133
|
const configParamInfos = buildConfigParamInfos(resource);
|
|
132
|
-
const importContext = (0, imports_1.createImportContext)(
|
|
134
|
+
const importContext = (0, imports_1.createImportContext)(typescriptFilePath, compilerBaseOutputDir, plugin);
|
|
133
135
|
return [
|
|
134
136
|
(0, adapter_name_1.generateAdapterNameExport)(adapterAnnotation.name),
|
|
135
137
|
(0, adapter_one_of_params_1.generateAdapterOneOfParams)(adapterAnnotation),
|
|
@@ -145,12 +147,13 @@ function generateDeleteAdapter(env, adapterAnnotation, resource, modelInfo) {
|
|
|
145
147
|
.filter(Boolean)
|
|
146
148
|
.join('\n\n');
|
|
147
149
|
}
|
|
148
|
-
|
|
150
|
+
exports.generateDeleteAdapter = generateDeleteAdapter;
|
|
151
|
+
function generatePostAdapter(typescriptFilePath, compilerBaseOutputDir, adapterAnnotation, resource, modelInfo, plugin) {
|
|
149
152
|
const configShape = {
|
|
150
153
|
name: resource.name,
|
|
151
154
|
shape: resource.flattenResourceParamDefinition,
|
|
152
155
|
};
|
|
153
|
-
const importContext = (0, imports_1.createImportContext)(
|
|
156
|
+
const importContext = (0, imports_1.createImportContext)(typescriptFilePath, compilerBaseOutputDir, plugin);
|
|
154
157
|
const configParamInfos = buildConfigParamInfos(resource);
|
|
155
158
|
return [
|
|
156
159
|
(0, adapter_name_1.generateAdapterNameExport)(adapterAnnotation.name),
|
|
@@ -167,23 +170,24 @@ function generatePostAdapter(env, adapterAnnotation, resource, modelInfo) {
|
|
|
167
170
|
.filter(Boolean)
|
|
168
171
|
.join('\n\n');
|
|
169
172
|
}
|
|
170
|
-
|
|
173
|
+
exports.generatePostAdapter = generatePostAdapter;
|
|
174
|
+
function generateAdapter(typescriptFilePath, compilerBaseOutputDir, adapterAnnotation, resource, modelInfo, plugin) {
|
|
171
175
|
const { method: resourceMethod, alternativeMethod } = resource;
|
|
172
176
|
const method = alternativeMethod || resourceMethod;
|
|
173
177
|
let code;
|
|
174
178
|
switch (method) {
|
|
175
179
|
case 'patch':
|
|
176
180
|
case 'put':
|
|
177
|
-
code = generatePatchAdapter(
|
|
181
|
+
code = generatePatchAdapter(typescriptFilePath, compilerBaseOutputDir, adapterAnnotation, resource, modelInfo, plugin);
|
|
178
182
|
break;
|
|
179
183
|
case 'delete':
|
|
180
|
-
code = generateDeleteAdapter(
|
|
184
|
+
code = generateDeleteAdapter(typescriptFilePath, compilerBaseOutputDir, adapterAnnotation, resource, modelInfo, plugin);
|
|
181
185
|
break;
|
|
182
186
|
case 'post':
|
|
183
|
-
code = generatePostAdapter(
|
|
187
|
+
code = generatePostAdapter(typescriptFilePath, compilerBaseOutputDir, adapterAnnotation, resource, modelInfo, plugin);
|
|
184
188
|
break;
|
|
185
189
|
default:
|
|
186
|
-
code = generateGetAdapter(
|
|
190
|
+
code = generateGetAdapter(typescriptFilePath, compilerBaseOutputDir, adapterAnnotation, resource, modelInfo, plugin);
|
|
187
191
|
}
|
|
188
192
|
return (0, imports_1.resolveImports)(code);
|
|
189
193
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/codegen/adapter/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/codegen/adapter/index.ts"],"names":[],"mappings":";;;AASA,+CAAsD;AACtD,iDAA0E;AAC1E,uEAAmE;AACnE,qFAAgF;AAChF,mDAAwD;AACxD,uEAA2E;AAC3E,yEAA4E;AAC5E,2EAAuE;AACvE,yDAAqE;AACrE,+DAA2D;AAC3D,+EAA0F;AAC1F,iDAA2D;AAC3D,uDAA4D;AAC5D,iFAA4F;AAC5F,mEAA+D;AAC/D,mEAAqE;AACrE,qEAAiE;AACjE,yEAAqE;AACrE,yFAAsF;AACtF,6DAAiE;AACjE,yFAA2F;AAC3F,qEAAwE;AACxE,8EAAgF;AAChF,8DAAyE;AACzE,kFAAuF;AACvF,kEAAgF;AAChF,uEAAmE;AASnE,IAAY,iBAKX;AALD,WAAY,iBAAiB;IACzB,yEAAY,CAAA;IACZ,6EAAc,CAAA;IACd,yDAAI,CAAA;IACJ,6DAAM,CAAA;AACV,CAAC,EALW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAK5B;AASD,SAAS,4BAA4B,CACjC,SAA8B,EAC9B,iBAAoC;IAEpC,OAAO;QACH,IAAI,EAAE,IAAA,yBAAgB,EAAC,SAAS,CAAC,IAAI,CAAC;QACtC,UAAU,EAAE,SAAS,CAAC,QAAQ;QAC9B,KAAK,EAAE,SAAS,CAAC,MAAM;QACvB,iBAAiB;KACpB,CAAC;AACN,CAAC;AAED,SAAS,gCAAgC,CACrC,QAAiC,E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YACI,IAAI,GAAG,kBAAkB,CACrB,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EACjB,QAAQ,EACR,SAAS,EACT,MAAM,CACT,CAAC;KACT;IAED,OAAO,IAAA,wBAAc,EAAC,IAAI,CAAC,CAAC;AAChC,CAAC;AAxDD,0CAwDC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import path from 'path';
|
|
1
3
|
import type { AdapterAnnotation } from '../../intermediate/adapter-annotation';
|
|
2
4
|
import type { Resource } from '../../intermediate/resource';
|
|
3
|
-
import type { CompilerConfig } from '../../generate';
|
|
4
5
|
import type { CompilerPlugin } from '../../plugin';
|
|
5
|
-
export declare function generateAdapterTestModules(
|
|
6
|
+
export declare function generateAdapterTestModules(compilerBaseOutputDir: path.ParsedPath, adapter: AdapterAnnotation, resource: Resource, adaptersDirectoryName: string, plugin?: CompilerPlugin): import("../../intermediate/utils").StringMap;
|
|
@@ -27,7 +27,7 @@ function getExpectedMockPayloads(resource, expectedResponses) {
|
|
|
27
27
|
}
|
|
28
28
|
return Object.values(mockPayloadsMap);
|
|
29
29
|
}
|
|
30
|
-
function generateAdapterTestModules(
|
|
30
|
+
function generateAdapterTestModules(compilerBaseOutputDir, adapter, resource, adaptersDirectoryName,
|
|
31
31
|
//plugin is needed to get overridden adapter imports from `resolveRamlArtifact`
|
|
32
32
|
plugin) {
|
|
33
33
|
if (adapter.tests === undefined) {
|
|
@@ -41,12 +41,8 @@ plugin) {
|
|
|
41
41
|
const mockPayloads = getExpectedMockPayloads(resource, expectedResponses);
|
|
42
42
|
// create JSON files for mock data and add to modules list
|
|
43
43
|
const modules = (0, mock_payloads_1.generateMockPayloadModules)(mockPayloads, `${adaptersDirectoryName}/${TESTS_DIRECTORY_NAME}/${MOCK_DATA_DIRECTORY_NAME}/${returnShapeName}`);
|
|
44
|
-
const relPath =
|
|
45
|
-
const
|
|
46
|
-
const importContext = (0, imports_1.createImportContext)({
|
|
47
|
-
compiler: { config: compilerConfig, plugin },
|
|
48
|
-
output: path_1.default.parse(absPath),
|
|
49
|
-
});
|
|
44
|
+
const relPath = path_1.default.join(adaptersDirectoryName, TESTS_DIRECTORY_NAME, `${adapter.name}.spec.ts`);
|
|
45
|
+
const importContext = (0, imports_1.createImportContext)(path_1.default.parse(path_1.default.resolve(path_1.default.join(path_1.default.format(compilerBaseOutputDir), relPath))), compilerBaseOutputDir, plugin);
|
|
50
46
|
// generate unresolved adapter test code
|
|
51
47
|
const code = (0, deindent_1.default) `
|
|
52
48
|
${(0, mock_payloads_1.generateMockPayloadsArrayCode)(mockPayloads, `${MOCK_DATA_DIRECTORY_NAME}/${returnShapeName}`)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/codegen/adapter-tests/index.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,6DAA6E;AAI7E,mDAA4F;AAC5F,iDAA0E;AAC1E,oEAA4C;AAC5C,mDAA2D;AAC3D,uDAA+D;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/codegen/adapter-tests/index.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,6DAA6E;AAI7E,mDAA4F;AAC5F,iDAA0E;AAC1E,oEAA4C;AAC5C,mDAA2D;AAC3D,uDAA+D;AAG/D,MAAM,oBAAoB,GAAG,WAAW,CAAC;AACzC,MAAM,wBAAwB,GAAG,UAAU,CAAC;AAE5C,SAAS,uBAAuB,CAAC,QAAkB,EAAE,iBAAqC;IACtF,MAAM,eAAe,GAAiC,EAAE,CAAC;IACzD,KAAK,MAAM,gBAAgB,IAAI,iBAAiB,EAAE;QAC9C,MAAM,EAAE,aAAa,EAAE,GAAG,gBAAgB,CAAC;QAC3C,MAAM,WAAW,GAAG,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,aAA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MAAM,IAAI,GAAG,IAAA,kBAAQ,EAAA;UACf,IAAA,6CAA6B,EAC3B,YAAY,EACZ,GAAG,wBAAwB,IAAI,eAAe,EAAE,CACnD;;UAEC;QACE,IAAA,0DAAqC,EACjC,aAAa,EACb,OAAO,EACP,iBAAiB,IAAI,MAAM,CAC9B;QACD,IAAA,wCAAwB,EAAC,aAAa,EAAE,OAAO,CAAC;QAChD,IAAA,4CAA0B,EAAC,aAAa,EAAE,OAAO,CAAC;KACrD;SACI,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,MAAM,CAAC;KACpB,CAAC;IAEF,4CAA4C;IAC5C,OAAO,CAAC,OAAO,CAAC,GAAG,IAAA,wBAAc,EAAC,IAAI,CAAC,CAAC;IAExC,OAAO,OAAO,CAAC;AACnB,CAAC;AA9DD,gEA8DC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GraphQLGenerateState } from '..';
|
|
2
1
|
import type { EnumTypeDefinitionNode } from '@luvio/graphql-parser';
|
|
3
2
|
import type { ImportContext } from '../../../utils/imports';
|
|
4
|
-
|
|
3
|
+
import type { GraphQLCodegenMetadata } from '../source-printer/graphql-source-printer';
|
|
4
|
+
export declare function generate(typeName: string, def: EnumTypeDefinitionNode, importContext: ImportContext, metadata: GraphQLCodegenMetadata): string;
|
|
@@ -5,12 +5,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.generate = void 0;
|
|
7
7
|
const deindent_1 = __importDefault(require("../../../utils/deindent"));
|
|
8
|
-
const interface_1 = require("
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
const interface_1 = require("./interface");
|
|
9
|
+
const imports_1 = require("../../../utils/imports");
|
|
10
|
+
function generate(typeName, def, importContext, metadata) {
|
|
11
|
+
return (0, imports_1.resolveImports)((0, deindent_1.default) `
|
|
11
12
|
export const name = '${typeName}';
|
|
12
|
-
${(0, interface_1.generateInterface)(
|
|
13
|
-
|
|
13
|
+
${(0, interface_1.generateInterface)(typeName, def, importContext, metadata)}
|
|
14
|
+
`);
|
|
14
15
|
}
|
|
15
16
|
exports.generate = generate;
|
|
16
17
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/codegen/graphql/enum/index.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/codegen/graphql/enum/index.ts"],"names":[],"mappings":";;;;;;AACA,uEAA+C;AAC/C,2CAAgD;AAEhD,oDAAwD;AAGxD,SAAgB,QAAQ,CACpB,QAAgB,EAChB,GAA2B,EAC3B,aAA4B,EAC5B,QAAgC;IAEhC,OAAO,IAAA,wBAAc,EAAC,IAAA,kBAAQ,EAAA;+BACH,QAAQ;UAC7B,IAAA,6BAAiB,EAAC,QAAQ,EAAE,GAAG,EAAE,aAAa,EAAE,QAAQ,CAAC;KAC9D,CAAC,CAAC;AACP,CAAC;AAVD,4BAUC"}
|
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
import type { GraphQLSchema, GraphQLScalarType } from '@luvio/graphql-parser';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
schemaName: string;
|
|
5
|
-
}
|
|
6
|
-
export interface LuvioGraphQLDSL {
|
|
7
|
-
schema: Readonly<GraphQLSchema>;
|
|
8
|
-
schemaName: Readonly<string>;
|
|
9
|
-
customScalars: GraphQLScalarType[];
|
|
10
|
-
}
|
|
2
|
+
import type { GraphQLTypeExtension, LuvioGraphQLDSL, LuvioGraphQLDSLParams } from '../../intermediate/graphql';
|
|
3
|
+
declare type GraphQLTypeExtensions = Record<string, GraphQLTypeExtension>;
|
|
11
4
|
export declare class GraphQLDSL implements LuvioGraphQLDSL {
|
|
12
5
|
schema: Readonly<GraphQLSchema>;
|
|
13
6
|
schemaName: Readonly<string>;
|
|
14
7
|
customScalars: GraphQLScalarType[];
|
|
8
|
+
typeExtensions: GraphQLTypeExtensions;
|
|
15
9
|
constructor(luvioSchemaParams: Readonly<LuvioGraphQLDSLParams>);
|
|
16
10
|
private extractCustomScalars;
|
|
17
11
|
}
|
|
18
|
-
export declare function
|
|
12
|
+
export declare function interpretGraphQLSchema(schemaString: string): Readonly<GraphQLSchema>;
|
|
19
13
|
export {};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.interpretGraphQLSchema = exports.GraphQLDSL = void 0;
|
|
4
4
|
const graphql_parser_1 = require("@luvio/graphql-parser");
|
|
5
5
|
class GraphQLDSL {
|
|
6
6
|
constructor(luvioSchemaParams) {
|
|
7
7
|
this.customScalars = [];
|
|
8
8
|
this.schemaName = luvioSchemaParams.schemaName;
|
|
9
9
|
this.schema = luvioSchemaParams.schema;
|
|
10
|
+
this.typeExtensions = luvioSchemaParams.typeExtensions;
|
|
10
11
|
this.extractCustomScalars();
|
|
11
12
|
}
|
|
12
13
|
extractCustomScalars() {
|
|
@@ -18,12 +19,8 @@ class GraphQLDSL {
|
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
21
|
exports.GraphQLDSL = GraphQLDSL;
|
|
21
|
-
function
|
|
22
|
-
|
|
23
|
-
return new GraphQLDSL({
|
|
24
|
-
schema,
|
|
25
|
-
schemaName,
|
|
26
|
-
});
|
|
22
|
+
function interpretGraphQLSchema(schemaString) {
|
|
23
|
+
return (0, graphql_parser_1.buildASTSchema)((0, graphql_parser_1.parse)(schemaString));
|
|
27
24
|
}
|
|
28
|
-
exports.
|
|
25
|
+
exports.interpretGraphQLSchema = interpretGraphQLSchema;
|
|
29
26
|
//# sourceMappingURL=graphql-dsl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql-dsl.js","sourceRoot":"","sources":["../../../src/codegen/graphql/graphql-dsl.ts"],"names":[],"mappings":";;;AAAA,0DAA4E;
|
|
1
|
+
{"version":3,"file":"graphql-dsl.js","sourceRoot":"","sources":["../../../src/codegen/graphql/graphql-dsl.ts"],"names":[],"mappings":";;;AAAA,0DAA4E;AAU5E,MAAa,UAAU;IAQnB,YAAY,iBAAkD;QAH9D,kBAAa,GAAwB,EAAE,CAAC;QAIpC,IAAI,CAAC,UAAU,GAAG,iBAAiB,CAAC,UAAU,CAAC;QAC/C,IAAI,CAAC,MAAM,GAAG,iBAAiB,CAAC,MAAM,CAAC;QACvC,IAAI,CAAC,cAAc,GAAG,iBAAiB,CAAC,cAAc,CAAC;QAEvD,IAAI,CAAC,oBAAoB,EAAE,CAAC;IAChC,CAAC;IAEO,oBAAoB;QACxB,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YACpD,IAAI,IAAA,6BAAY,EAAC,GAAG,CAAC,IAAI,GAAG,CAAC,OAAO,KAAK,SAAS,EAAE;gBAChD,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;aAChC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AAvBD,gCAuBC;AAED,SAAgB,sBAAsB,CAAC,YAAoB;IACvD,OAAO,IAAA,+BAAc,EAAC,IAAA,sBAAK,EAAC,YAAY,CAAC,CAAC,CAAC;AAC/C,CAAC;AAFD,wDAEC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="node" />
|
|
2
2
|
import type { GraphQLAdapterPrinter } from '../../../interfaces';
|
|
3
|
-
import
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import type { GraphQLResource } from '../../../intermediate/resource';
|
|
5
|
+
import type { ModelInfo } from '../../../main';
|
|
4
6
|
export declare class GraphQLAdapterSourcePrinter implements GraphQLAdapterPrinter {
|
|
5
|
-
generate(
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
generate(modelInfo: ModelInfo, resource: GraphQLResource, compilerBaseOutputDir: path.ParsedPath): Record<string, string>;
|
|
8
|
+
private generatePostAdapter;
|
|
9
|
+
private generateRelativeOutputPath;
|
|
8
10
|
}
|
|
@@ -1,10 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.GraphQLAdapterSourcePrinter = void 0;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const adapter_1 = require("../../adapter");
|
|
9
|
+
const adapter_tests_1 = require("../../adapter-tests");
|
|
10
|
+
const ADAPTERS_DIRECTORY_NAME = 'adapters';
|
|
4
11
|
class GraphQLAdapterSourcePrinter {
|
|
5
|
-
generate(
|
|
6
|
-
|
|
7
|
-
|
|
12
|
+
generate(modelInfo, resource, compilerBaseOutputDir) {
|
|
13
|
+
const { method } = resource;
|
|
14
|
+
switch (method) {
|
|
15
|
+
case 'post':
|
|
16
|
+
return this.generatePostAdapter(modelInfo, resource, compilerBaseOutputDir);
|
|
17
|
+
default:
|
|
18
|
+
throw new Error('Only POST is supported for GraphQL adapters');
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
generatePostAdapter(modelInfo, resource, compilerBaseOutputDir) {
|
|
22
|
+
const modules = {};
|
|
23
|
+
const adapter = resource.adapter;
|
|
24
|
+
const relativeOutputPath = this.generateRelativeOutputPath(adapter.name);
|
|
25
|
+
const absoluteOutputPath = path_1.default.parse(path_1.default.join(path_1.default.format(compilerBaseOutputDir), relativeOutputPath));
|
|
26
|
+
modules[relativeOutputPath] = (0, adapter_1.generateAdapter)(absoluteOutputPath, compilerBaseOutputDir, adapter, resource, modelInfo);
|
|
27
|
+
// generate adapter tests as well
|
|
28
|
+
const testModules = (0, adapter_tests_1.generateAdapterTestModules)(compilerBaseOutputDir, adapter, resource, ADAPTERS_DIRECTORY_NAME);
|
|
29
|
+
for (const key of Object.keys(testModules)) {
|
|
30
|
+
modules[key] = testModules[key];
|
|
31
|
+
}
|
|
32
|
+
return modules;
|
|
33
|
+
}
|
|
34
|
+
generateRelativeOutputPath(defName) {
|
|
35
|
+
return path_1.default.join(ADAPTERS_DIRECTORY_NAME, `${defName}.ts`);
|
|
8
36
|
}
|
|
9
37
|
}
|
|
10
38
|
exports.GraphQLAdapterSourcePrinter = GraphQLAdapterSourcePrinter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql-adapter-source-printer.js","sourceRoot":"","sources":["../../../../src/codegen/graphql/source-printer/graphql-adapter-source-printer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"graphql-adapter-source-printer.js","sourceRoot":"","sources":["../../../../src/codegen/graphql/source-printer/graphql-adapter-source-printer.ts"],"names":[],"mappings":";;;;;;AACA,gDAAwB;AAExB,2CAAgD;AAChD,uDAAiE;AAIjE,MAAM,uBAAuB,GAAG,UAAU,CAAC;AAC3C,MAAa,2BAA2B;IACpC,QAAQ,CACJ,SAAoB,EACpB,QAAyB,EACzB,qBAAsC;QAEtC,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,CAAC;QAE5B,QAAQ,MAAM,EAAE;YACZ,KAAK,MAAM;gBACP,OAAO,IAAI,CAAC,mBAAmB,CAAC,SAAS,EAAE,QAAQ,EAAE,qBAAqB,CAAC,CAAC;YAChF;gBACI,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;SACtE;IACL,CAAC;IAEO,mBAAmB,CACvB,SAAoB,EACpB,QAAyB,EACzB,qBAAsC;QAEtC,MAAM,OAAO,GAA2B,EAAE,CAAC;QAC3C,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAQ,CAAC;QAElC,MAAM,kBAAkB,GAAG,IAAI,CAAC,0BAA0B,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACzE,MAAM,kBAAkB,GAAG,cAAI,CAAC,KAAK,CACjC,cAAI,CAAC,IAAI,CAAC,cAAI,CAAC,MAAM,CAAC,qBAAqB,CAAC,EAAE,kBAAkB,CAAC,CACpE,CAAC;QACF,OAAO,CAAC,kBAAkB,CAAC,GAAG,IAAA,yBAAe,EACzC,kBAAkB,EAClB,qBAAqB,EACrB,OAAO,EACP,QAAQ,EACR,SAAS,CACZ,CAAC;QAEF,iCAAiC;QACjC,MAAM,WAAW,GAAG,IAAA,0CAA0B,EAC1C,qBAAqB,EACrB,OAAO,EACP,QAAQ,EACR,uBAAuB,CAC1B,CAAC;QACF,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE;YACxC,OAAO,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;SACnC;QAED,OAAO,OAAO,CAAC;IACnB,CAAC;IAEO,0BAA0B,CAAC,OAAe;QAC9C,OAAO,cAAI,CAAC,IAAI,CAAC,uBAAuB,EAAE,GAAG,OAAO,KAAK,CAAC,CAAC;IAC/D,CAAC;CACJ;AArDD,kEAqDC"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="node" />
|
|
2
2
|
import type { GraphQLResourcePrinter } from '../../../interfaces';
|
|
3
|
-
import type {
|
|
3
|
+
import type { ModelInfo } from '../../../main';
|
|
4
|
+
import type { GraphQLResource } from '../../../intermediate/resource';
|
|
5
|
+
import path from 'path';
|
|
4
6
|
export declare class GraphQLResourceSourcePrinter implements GraphQLResourcePrinter {
|
|
5
|
-
generate(
|
|
7
|
+
generate(modelInfo: ModelInfo, resource: GraphQLResource, compilerBaseOutputDir: path.ParsedPath): {
|
|
6
8
|
[path: string]: string;
|
|
7
9
|
};
|
|
10
|
+
private generateRelativeOutputPath;
|
|
8
11
|
}
|
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.GraphQLResourceSourcePrinter = void 0;
|
|
7
|
+
const resource_1 = require("../../resource");
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const RESOURCES_DIRECTORY_NAME = 'resources';
|
|
4
10
|
class GraphQLResourceSourcePrinter {
|
|
5
|
-
generate(
|
|
6
|
-
|
|
7
|
-
|
|
11
|
+
generate(modelInfo, resource, compilerBaseOutputDir) {
|
|
12
|
+
const modules = {};
|
|
13
|
+
const relativeOutputPath = this.generateRelativeOutputPath(resource.name);
|
|
14
|
+
const absoluteOutputPath = path_1.default.parse(path_1.default.join(path_1.default.format(compilerBaseOutputDir), relativeOutputPath));
|
|
15
|
+
modules[relativeOutputPath] = (0, resource_1.generateResource)(absoluteOutputPath, compilerBaseOutputDir, resource, modelInfo, relativeOutputPath);
|
|
16
|
+
return modules;
|
|
17
|
+
}
|
|
18
|
+
generateRelativeOutputPath(defName) {
|
|
19
|
+
return path_1.default.join(RESOURCES_DIRECTORY_NAME, `${defName}.ts`);
|
|
8
20
|
}
|
|
9
21
|
}
|
|
10
22
|
exports.GraphQLResourceSourcePrinter = GraphQLResourceSourcePrinter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql-resource-source-printer.js","sourceRoot":"","sources":["../../../../src/codegen/graphql/source-printer/graphql-resource-source-printer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"graphql-resource-source-printer.js","sourceRoot":"","sources":["../../../../src/codegen/graphql/source-printer/graphql-resource-source-printer.ts"],"names":[],"mappings":";;;;;;AACA,6CAAkD;AAGlD,gDAAwB;AAExB,MAAM,wBAAwB,GAAG,WAAW,CAAC;AAC7C,MAAa,4BAA4B;IACrC,QAAQ,CACJ,SAAoB,EACpB,QAAyB,EACzB,qBAAsC;QAEtC,MAAM,OAAO,GAA2B,EAAE,CAAC;QAE3C,MAAM,kBAAkB,GAAG,IAAI,CAAC,0BAA0B,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC1E,MAAM,kBAAkB,GAAG,cAAI,CAAC,KAAK,CACjC,cAAI,CAAC,IAAI,CAAC,cAAI,CAAC,MAAM,CAAC,qBAAqB,CAAC,EAAE,kBAAkB,CAAC,CACpE,CAAC;QACF,OAAO,CAAC,kBAAkB,CAAC,GAAG,IAAA,2BAAgB,EAC1C,kBAAkB,EAClB,qBAAqB,EACrB,QAAQ,EACR,SAAS,EACT,kBAAkB,CACrB,CAAC;QAEF,OAAO,OAAO,CAAC;IACnB,CAAC;IAEO,0BAA0B,CAAC,OAAe;QAC9C,OAAO,cAAI,CAAC,IAAI,CAAC,wBAAwB,EAAE,GAAG,OAAO,KAAK,CAAC,CAAC;IAChE,CAAC;CACJ;AA1BD,oEA0BC"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import type { SourcePrinter, GraphQLTypePrinter, GraphQLResourcePrinter, GraphQLAdapterPrinter } from '../../../interfaces';
|
|
3
3
|
import type { ModelInfo } from '../../../main';
|
|
4
|
-
import type { LuvioGraphQLDSL } from '
|
|
4
|
+
import type { LuvioGraphQLDSL } from '../../../intermediate/graphql';
|
|
5
5
|
import type path from 'path';
|
|
6
|
+
import type { ShapeTtls } from '../../../intermediate/model-info';
|
|
6
7
|
export interface GraphQLCodegenMetadata {
|
|
7
8
|
scalarToPrimitiveMap: Record<string, string>;
|
|
9
|
+
shapeTtls?: ShapeTtls;
|
|
10
|
+
rootTtl?: number;
|
|
8
11
|
}
|
|
9
12
|
export declare class GraphQLSourcePrinter implements SourcePrinter {
|
|
10
13
|
private typePrinter;
|
|
@@ -15,5 +18,5 @@ export declare class GraphQLSourcePrinter implements SourcePrinter {
|
|
|
15
18
|
generateModules(modelInfo: ModelInfo): {
|
|
16
19
|
[path: string]: string;
|
|
17
20
|
};
|
|
18
|
-
calculateMetadata(graphqlDsl: LuvioGraphQLDSL): GraphQLCodegenMetadata;
|
|
21
|
+
calculateMetadata(modelInfo: ModelInfo, graphqlDsl: LuvioGraphQLDSL): GraphQLCodegenMetadata;
|
|
19
22
|
}
|
|
@@ -20,23 +20,26 @@ class GraphQLSourcePrinter {
|
|
|
20
20
|
let modules = {};
|
|
21
21
|
for (const resource of resources) {
|
|
22
22
|
if (resource.resourceType === 'GraphQL') {
|
|
23
|
-
const {
|
|
24
|
-
const metadata = this.calculateMetadata(
|
|
23
|
+
const { graphqlDSL } = resource;
|
|
24
|
+
const metadata = this.calculateMetadata(modelInfo, graphqlDSL);
|
|
25
25
|
modules = {
|
|
26
|
-
...this.typePrinter.generate(
|
|
27
|
-
...this.resourcePrinter.generate(
|
|
28
|
-
...this.adapterPrinter.generate(
|
|
26
|
+
...this.typePrinter.generate(resource, this.compilerBaseOutputDir, metadata),
|
|
27
|
+
...this.resourcePrinter.generate(modelInfo, resource, this.compilerBaseOutputDir),
|
|
28
|
+
...this.adapterPrinter.generate(modelInfo, resource, this.compilerBaseOutputDir),
|
|
29
29
|
...modules,
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
return modules;
|
|
34
34
|
}
|
|
35
|
-
calculateMetadata(graphqlDsl) {
|
|
35
|
+
calculateMetadata(modelInfo, graphqlDsl) {
|
|
36
|
+
const { shapeTtls, rootTtl } = modelInfo;
|
|
36
37
|
const scalarToPrimitiveMap = DEFAULT_GRAPHQL_SCALAR_TO_PRIMITIVE_MAP;
|
|
37
38
|
graphqlDsl.customScalars.forEach((custom) => (scalarToPrimitiveMap[custom.name] = 'unknown'));
|
|
38
39
|
return {
|
|
39
40
|
scalarToPrimitiveMap,
|
|
41
|
+
shapeTtls,
|
|
42
|
+
rootTtl,
|
|
40
43
|
};
|
|
41
44
|
}
|
|
42
45
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql-source-printer.js","sourceRoot":"","sources":["../../../../src/codegen/graphql/source-printer/graphql-source-printer.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"graphql-source-printer.js","sourceRoot":"","sources":["../../../../src/codegen/graphql/source-printer/graphql-source-printer.ts"],"names":[],"mappings":";;;AAWA,MAAM,uCAAuC,GAA2B;IACpE,MAAM,EAAE,QAAQ;IAChB,EAAE,EAAE,QAAQ;IACZ,OAAO,EAAE,SAAS;IAClB,GAAG,EAAE,QAAQ;IACb,KAAK,EAAE,QAAQ;CAClB,CAAC;AASF,MAAa,oBAAoB;IAC7B,YACY,WAA+B,EAC/B,eAAuC,EACvC,cAAqC,EACrC,qBAAsC;QAHtC,gBAAW,GAAX,WAAW,CAAoB;QAC/B,oBAAe,GAAf,eAAe,CAAwB;QACvC,mBAAc,GAAd,cAAc,CAAuB;QACrC,0BAAqB,GAArB,qBAAqB,CAAiB;IAC/C,CAAC;IAEJ,eAAe,CAAC,SAAoB;QAChC,MAAM,EAAE,SAAS,EAAE,GAAG,SAAS,CAAC;QAChC,IAAI,OAAO,GAA2B,EAAE,CAAC;QAEzC,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE;YAC9B,IAAI,QAAQ,CAAC,YAAY,KAAK,SAAS,EAAE;gBACrC,MAAM,EAAE,UAAU,EAAE,GAAG,QAAQ,CAAC;gBAChC,MAAM,QAAQ,GAAG,IAAI,CAAC,iBAAiB,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;gBAC/D,OAAO,GAAG;oBACN,GAAG,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,qBAAqB,EAAE,QAAQ,CAAC;oBAC5E,GAAG,IAAI,CAAC,eAAe,CAAC,QAAQ,CAC5B,SAAS,EACT,QAAQ,EACR,IAAI,CAAC,qBAAqB,CAC7B;oBACD,GAAG,IAAI,CAAC,cAAc,CAAC,QAAQ,CAC3B,SAAS,EACT,QAAQ,EACR,IAAI,CAAC,qBAAqB,CAC7B;oBACD,GAAG,OAAO;iBACb,CAAC;aACL;SACJ;QACD,OAAO,OAAO,CAAC;IACnB,CAAC;IAED,iBAAiB,CAAC,SAAoB,EAAE,UAA2B;QAC/D,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,SAAS,CAAC;QACzC,MAAM,oBAAoB,GAAG,uCAAuC,CAAC;QAErE,UAAU,CAAC,aAAa,CAAC,OAAO,CAC5B,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,oBAAoB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,CAC9D,CAAC;QAEF,OAAO;YACH,oBAAoB;YACpB,SAAS;YACT,OAAO;SACV,CAAC;IACN,CAAC;CACJ;AAjDD,oDAiDC"}
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import type { GraphQLTypePrinter } from '../../../interfaces';
|
|
3
3
|
import type { ImportContext } from '../../../utils/imports';
|
|
4
4
|
import path from 'path';
|
|
5
|
-
import type { LuvioGraphQLDSL } from '../graphql-dsl';
|
|
6
5
|
import type { GraphQLCodegenMetadata } from './graphql-source-printer';
|
|
6
|
+
import type { GraphQLResource } from '../../../intermediate/resource';
|
|
7
7
|
export declare const GRAPHQL_OUTPUT_DIRECTORY = "graphql";
|
|
8
8
|
export declare const GRAPHQL_OBJECT_TYPENAME = "typeName";
|
|
9
9
|
export declare type GraphQLTypeGenerationResult = Record<string, string>;
|
|
10
10
|
export declare class GraphQLTypeSourcePrinter implements GraphQLTypePrinter {
|
|
11
|
-
generate(
|
|
11
|
+
generate(graphQLResource: GraphQLResource, compilerBaseOutputDir: path.ParsedPath, metadata: GraphQLCodegenMetadata): GraphQLTypeGenerationResult;
|
|
12
12
|
createGraphQLTypeImportContext(compilerBaseOutputDir: path.ParsedPath, defName: string): {
|
|
13
13
|
relPath: string;
|
|
14
14
|
importContext: ImportContext;
|
|
@@ -14,14 +14,15 @@ exports.GRAPHQL_OUTPUT_DIRECTORY = 'graphql';
|
|
|
14
14
|
exports.GRAPHQL_OBJECT_TYPENAME = 'typeName';
|
|
15
15
|
const GRAPHQL_TYPES_DIRECTORY = 'types';
|
|
16
16
|
class GraphQLTypeSourcePrinter {
|
|
17
|
-
generate(
|
|
18
|
-
const
|
|
17
|
+
generate(graphQLResource, compilerBaseOutputDir, metadata) {
|
|
18
|
+
const { graphqlDSL } = graphQLResource;
|
|
19
|
+
const typeKeys = Object.keys(graphqlDSL.schema.getTypeMap());
|
|
19
20
|
const modules = {};
|
|
20
21
|
const { relPath } = this.createGraphQLTypeImportContext(compilerBaseOutputDir, 'type-util');
|
|
21
|
-
const typeUtil = (0, type_1.generateTypeUtil)();
|
|
22
|
+
const typeUtil = (0, type_1.generateTypeUtil)(graphQLResource, metadata);
|
|
22
23
|
modules[relPath] = typeUtil;
|
|
23
24
|
typeKeys.forEach((typeKey) => {
|
|
24
|
-
const typeDefinition =
|
|
25
|
+
const typeDefinition = graphqlDSL.schema.getType(typeKey);
|
|
25
26
|
if (typeDefinition !== undefined &&
|
|
26
27
|
typeDefinition !== null &&
|
|
27
28
|
typeDefinition.astNode !== undefined &&
|
|
@@ -31,7 +32,7 @@ class GraphQLTypeSourcePrinter {
|
|
|
31
32
|
switch (kind) {
|
|
32
33
|
case graphql_parser_1.Kind.OBJECT_TYPE_DEFINITION:
|
|
33
34
|
case graphql_parser_1.Kind.INTERFACE_TYPE_DEFINITION:
|
|
34
|
-
modules[relPath] = (0, type_1.generateType)(
|
|
35
|
+
modules[relPath] = (0, type_1.generateType)(graphqlDSL, typeDefinition.name, typeDefinition.astNode, importContext, metadata);
|
|
35
36
|
break;
|
|
36
37
|
case graphql_parser_1.Kind.UNION_TYPE_DEFINITION:
|
|
37
38
|
modules[relPath] = (0, union_1.generate)(typeDefinition.name, typeDefinition.astNode, importContext, metadata);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql-type-source-printer.js","sourceRoot":"","sources":["../../../../src/codegen/graphql/source-printer/graphql-type-source-printer.ts"],"names":[],"mappings":";;;;;;AAEA,oDAA6D;AAC7D,gDAAwB;AACxB,0DAA6C;
|
|
1
|
+
{"version":3,"file":"graphql-type-source-printer.js","sourceRoot":"","sources":["../../../../src/codegen/graphql/source-printer/graphql-type-source-printer.ts"],"names":[],"mappings":";;;;;;AAEA,oDAA6D;AAC7D,gDAAwB;AACxB,0DAA6C;AAC7C,kCAAyD;AACzD,oCAAyD;AACzD,kCAAuD;AAI1C,QAAA,wBAAwB,GAAG,SAAS,CAAC;AACrC,QAAA,uBAAuB,GAAG,UAAU,CAAC;AAClD,MAAM,uBAAuB,GAAG,OAAO,CAAC;AAIxC,MAAa,wBAAwB;IACjC,QAAQ,CACJ,eAAgC,EAChC,qBAAsC,EACtC,QAAgC;QAEhC,MAAM,EAAE,UAAU,EAAE,GAAG,eAAe,CAAC;QACvC,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;QAC7D,MAAM,OAAO,GAAgC,EAAE,CAAC;QAEhD,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,8BAA8B,CAAC,qBAAqB,EAAE,WAAW,CAAC,CAAC;QAC5F,MAAM,QAAQ,GAAW,IAAA,uBAAgB,EAAC,eAAe,EAAE,QAAQ,CAAC,CAAC;QACrE,OAAO,CAAC,OAAO,CAAC,GAAG,QAAQ,CAAC;QAE5B,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YACzB,MAAM,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YAC1D,IACI,cAAc,KAAK,SAAS;gBAC5B,cAAc,KAAK,IAAI;gBACvB,cAAc,CAAC,OAAO,KAAK,SAAS;gBACpC,cAAc,CAAC,OAAO,KAAK,IAAI,EACjC;gBACE,MAAM,IAAI,GAAG,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC;gBACzC,MAAM,EAAE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C;IACN,CAAC;CACJ;AApFD,4DAoFC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GraphQLAdapterSourcePrinter } from './graphql-adapter-source-printer';
|
|
2
2
|
import { GraphQLResourceSourcePrinter } from './graphql-resource-source-printer';
|
|
3
|
-
import { GraphQLSourcePrinter } from './graphql-source-printer';
|
|
3
|
+
import { GraphQLSourcePrinter, GraphQLCodegenMetadata } from './graphql-source-printer';
|
|
4
4
|
import { GraphQLTypeSourcePrinter } from './graphql-type-source-printer';
|
|
5
|
-
export { GraphQLSourcePrinter, GraphQLTypeSourcePrinter, GraphQLResourceSourcePrinter, GraphQLAdapterSourcePrinter, };
|
|
5
|
+
export { GraphQLSourcePrinter, GraphQLTypeSourcePrinter, GraphQLResourceSourcePrinter, GraphQLAdapterSourcePrinter, GraphQLCodegenMetadata, };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/codegen/graphql/source-printer/index.ts"],"names":[],"mappings":";;;AAAA,qFAA+E;AAQ3E,4GARK,4DAA2B,OAQL;AAP/B,uFAAiF;AAM7E,6GANK,8DAA4B,OAML;AALhC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/codegen/graphql/source-printer/index.ts"],"names":[],"mappings":";;;AAAA,qFAA+E;AAQ3E,4GARK,4DAA2B,OAQL;AAP/B,uFAAiF;AAM7E,6GANK,8DAA4B,OAML;AALhC,qEAAwF;AAGpF,qGAHK,6CAAoB,OAGL;AAFxB,+EAAyE;AAGrE,yGAHK,sDAAwB,OAGL"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import type { ImportContext } from '../../../utils/imports';
|
|
2
2
|
import type { InterfaceTypeDefinitionNode, ObjectTypeDefinitionNode } from '@luvio/graphql-parser';
|
|
3
|
-
import type {
|
|
4
|
-
|
|
3
|
+
import type { LuvioGraphQLDSL } from '../../../intermediate/graphql';
|
|
4
|
+
import type { GraphQLCodegenMetadata } from '../source-printer';
|
|
5
|
+
import type { GraphQLResource } from '../../../intermediate/resource';
|
|
6
|
+
export declare function generateTypeUtil(graphqlResource: GraphQLResource, metadata: GraphQLCodegenMetadata): string;
|
|
7
|
+
export declare function generateType(graphqlDsl: LuvioGraphQLDSL, typeName: string, def: ObjectTypeDefinitionNode | InterfaceTypeDefinitionNode, importContext: ImportContext, metadata: GraphQLCodegenMetadata): string;
|