@graphitation/supermassive 1.0.0 → 1.1.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/.eslintcache +1 -0
- package/CHANGELOG.md +10 -2
- package/lib/bin/supermassive.d.ts.map +1 -1
- package/lib/bin/supermassive.js +48 -4
- package/lib/bin/supermassive.mjs +48 -4
- package/lib/codegen/context/expect.d.ts +1 -0
- package/lib/codegen/context/expect.d.ts.map +1 -0
- package/lib/codegen/context/expect.js +0 -0
- package/lib/codegen/context/expect.mjs +0 -0
- package/lib/codegen/context/import.d.ts +5 -0
- package/lib/codegen/context/import.d.ts.map +1 -0
- package/lib/codegen/context/import.js +55 -0
- package/lib/codegen/context/import.mjs +37 -0
- package/lib/codegen/context/index.d.ts +51 -0
- package/lib/codegen/context/index.d.ts.map +1 -0
- package/lib/codegen/context/index.js +234 -0
- package/lib/codegen/context/index.mjs +223 -0
- package/lib/codegen/context/model.d.ts +5 -0
- package/lib/codegen/context/model.d.ts.map +1 -0
- package/lib/codegen/context/model.js +53 -0
- package/lib/codegen/context/model.mjs +37 -0
- package/lib/codegen/context/utilities.d.ts +2 -0
- package/lib/codegen/context/utilities.d.ts.map +1 -0
- package/lib/codegen/context/utilities.js +26 -0
- package/lib/codegen/context/utilities.mjs +8 -0
- package/lib/codegen/index.d.ts +7 -0
- package/lib/codegen/index.d.ts.map +1 -0
- package/lib/codegen/index.js +41 -0
- package/lib/codegen/index.mjs +23 -0
- package/lib/codegen/models.d.ts +5 -0
- package/lib/codegen/models.d.ts.map +1 -0
- package/lib/codegen/models.js +157 -0
- package/lib/codegen/models.mjs +141 -0
- package/lib/codegen/resolvers.d.ts +5 -0
- package/lib/codegen/resolvers.d.ts.map +1 -0
- package/lib/codegen/resolvers.js +146 -0
- package/lib/codegen/resolvers.mjs +133 -0
- package/lib/codegen/typedVisitor.d.ts +57 -0
- package/lib/codegen/typedVisitor.d.ts.map +1 -0
- package/lib/codegen/typedVisitor.js +26 -0
- package/lib/codegen/typedVisitor.mjs +8 -0
- package/lib/codegen/types.d.ts +18 -0
- package/lib/codegen/types.d.ts.map +1 -0
- package/lib/codegen/types.js +15 -0
- package/lib/codegen/types.mjs +0 -0
- package/lib/codegen/utilities.d.ts +39 -0
- package/lib/codegen/utilities.d.ts.map +1 -0
- package/lib/codegen/utilities.js +166 -0
- package/lib/codegen/utilities.mjs +148 -0
- package/lib/{extractImplicitTypesToTypescript.d.ts → extractors/extractImplicitTypesToTypescript.d.ts} +0 -0
- package/lib/extractors/extractImplicitTypesToTypescript.d.ts.map +1 -0
- package/lib/{extractImplicitTypesToTypescript.js → extractors/extractImplicitTypesToTypescript.js} +0 -0
- package/lib/{extractImplicitTypesToTypescript.mjs → extractors/extractImplicitTypesToTypescript.mjs} +1 -1
- package/lib/extractors/index.d.ts +1 -1
- package/lib/extractors/index.d.ts.map +1 -1
- package/lib/extractors/index.js +1 -1
- package/lib/extractors/index.mjs +1 -1
- package/lib/index.d.ts +3 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -0
- package/lib/index.mjs +2 -0
- package/lib/utilities/blankGraphQLTag.d.ts +2 -0
- package/lib/utilities/blankGraphQLTag.d.ts.map +1 -0
- package/lib/utilities/blankGraphQLTag.js +25 -0
- package/lib/utilities/blankGraphQLTag.mjs +7 -0
- package/package.json +1 -1
- package/lib/extractImplicitTypesToTypescript.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typedVisitor.d.ts","sourceRoot":"","sources":["../../src/codegen/typedVisitor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAA2B,MAAM,SAAS,CAAC;AAE3D;;;;;GAKG;AAEH,oBAAY,gBAAgB,CAAC,CAAC,IAAI;KAC/B,KAAK,IAAI,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,IAAI;CACrD,CAAC;AAEF,oBAAY,eAAe,CAAC,CAAC,IAAI;KAC9B,KAAK,IAAI,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE;SACnC,CAAC,IAAI,MAAM,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,GAAG,IAAI;KACpC;CACF,CAAC;AAEF,MAAM,CAAC,OAAO,MAAM,UAAU,CAC5B,CAAC,EACD,EAAE,SAAS,gBAAgB,CAAC,CAAC,CAAC,EAC9B,GAAG,SAAS,eAAe,CAAC,CAAC,CAAC,IAC5B;IACF,QAAQ,EAAE,KAAK,IAAI,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE;QAC7C,QAAQ,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;QACnC,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;KAC5E;CACF,CAAC;AAEF,OAAO,MAAM,YAAY,CACvB,YAAY,SAAS,OAAO,EAC5B,OAAO,EACP,WAAW,IACT;AACF,uCAAuC;AACvC,IAAI,EAAE;KACH,CAAC,IAAI,MAAM,YAAY,GAAG,YAAY,CACrC,YAAY,CAAC,CAAC,CAAC,EACf,WAAW,SAAS,SAAS,GACzB,SAAS,GACT,CAAC,SAAS,MAAM,WAAW,GAC3B,WAAW,CAAC,CAAC,CAAC,SAAS,SAAS,GAC9B,SAAS,GACT,WAAW,CAAC,CAAC,CAAC,GAChB,SAAS,CACd;CACF;AACD,mEAAmE;AACnE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;AAChC,qEAAqE;AACrE,MAAM,EAAE,OAAO,GAAG,aAAa,CAAC,OAAO,CAAC,GAAG,SAAS;AACpD,2DAA2D;AAC3D,IAAI,EAAE,aAAa,CAAC,MAAM,GAAG,MAAM,CAAC;AACpC;;;;GAIG;AACH,SAAS,EAAE,aAAa,CAAC,OAAO,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC,KACvD,OAAO,CAAC;AACb,OAAO,MAAM,YAAY,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,SAAS,GACjD,CAAC,GACD,CAAC,SAAS,IAAI,GAAG,SAAS,GAC1B,CAAC,GACD,CAAC,SAAS,aAAa,CAAC,GAAG,CAAC,GAC5B,aAAa,CAAC,CAAC,CAAC,GAChB,CAAC,CAAC;AACN,MAAM,CAAC,OAAO,MAAM,UAAU,CAAC,YAAY,SAAS,OAAO,IAAI;AAC7D,uCAAuC;AACvC,IAAI,EAAE,YAAY;AAClB,mEAAmE;AACnE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;AAChC,qEAAqE;AACrE,MAAM,EAAE,OAAO,GAAG,aAAa,CAAC,OAAO,CAAC,GAAG,SAAS;AACpD,2DAA2D;AAC3D,IAAI,EAAE,aAAa,CAAC,MAAM,GAAG,MAAM,CAAC;AACpC;;;;GAIG;AACH,SAAS,EAAE,aAAa,CAAC,OAAO,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC,KACvD,GAAG,CAAC;AAET,wBAAgB,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE,GAAG,EAC9B,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,UAAU,CAAC,CAAC,EAAE,EAAE,EAAE,GAAG,CAAC,GAC9B,CAAC,CAEH"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var typedVisitor_exports = {};
|
|
19
|
+
__export(typedVisitor_exports, {
|
|
20
|
+
visit: () => visit
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(typedVisitor_exports);
|
|
23
|
+
var import_graphql = require("graphql");
|
|
24
|
+
function visit(root, visitor) {
|
|
25
|
+
return (0, import_graphql.visit)(root, visitor);
|
|
26
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DirectiveNode } from "graphql";
|
|
2
|
+
export declare type DefinitionImport = {
|
|
3
|
+
from: string;
|
|
4
|
+
defs: {
|
|
5
|
+
typeName: string;
|
|
6
|
+
}[];
|
|
7
|
+
importName: string;
|
|
8
|
+
directive: DirectiveNode;
|
|
9
|
+
};
|
|
10
|
+
export declare type DefinitionModel = {
|
|
11
|
+
typeName: string;
|
|
12
|
+
modelName: string;
|
|
13
|
+
tsType: string;
|
|
14
|
+
from: string | null;
|
|
15
|
+
importName: string | null;
|
|
16
|
+
directive: DirectiveNode;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/codegen/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAGxC,oBAAY,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,aAAa,CAAC;CAC1B,CAAC;AAEF,oBAAY,eAAe,GAAG;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,aAAa,CAAC;CAC1B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
var types_exports = {};
|
|
15
|
+
module.exports = __toCommonJS(types_exports);
|
|
File without changes
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
import { ASTNode } from "graphql";
|
|
3
|
+
export declare function createNullableType(node: ts.TypeNode): ts.UnionTypeNode;
|
|
4
|
+
export declare function createNonNullableType(node: ts.TypeNode): ts.TypeNode;
|
|
5
|
+
export declare function addModelSuffix(typeName: string): string;
|
|
6
|
+
export declare function isDirectAncestorInput(ancestors: readonly (ASTNode | readonly ASTNode[])[]): boolean;
|
|
7
|
+
export declare function createVariableNameFromImport(path: string): string;
|
|
8
|
+
export declare type CamelCaseOptions = {
|
|
9
|
+
/**
|
|
10
|
+
Uppercase the first character: `foo-bar` → `FooBar`.
|
|
11
|
+
@default false
|
|
12
|
+
*/
|
|
13
|
+
readonly pascalCase?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
Preserve consecutive uppercase characters: `foo-BAR` → `FooBAR`.
|
|
16
|
+
@default false
|
|
17
|
+
*/
|
|
18
|
+
readonly preserveConsecutiveUppercase?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
The locale parameter indicates the locale to be used to convert to upper/lower case according to any locale-specific case mappings. If multiple locales are given in an array, the best available locale is used.
|
|
21
|
+
Setting `locale: false` ignores the platform locale and uses the [Unicode Default Case Conversion](https://unicode-org.github.io/icu/userguide/transforms/casemappings.html#simple-single-character-case-mapping) algorithm.
|
|
22
|
+
Default: The host environment’s current locale.
|
|
23
|
+
@example
|
|
24
|
+
```
|
|
25
|
+
import camelCase from 'camelcase';
|
|
26
|
+
camelCase('lorem-ipsum', {locale: 'en-US'});
|
|
27
|
+
//=> 'loremIpsum'
|
|
28
|
+
camelCase('lorem-ipsum', {locale: 'tr-TR'});
|
|
29
|
+
//=> 'loremİpsum'
|
|
30
|
+
camelCase('lorem-ipsum', {locale: ['en-US', 'en-GB']});
|
|
31
|
+
//=> 'loremIpsum'
|
|
32
|
+
camelCase('lorem-ipsum', {locale: ['tr', 'TR', 'tr-TR']});
|
|
33
|
+
//=> 'loremİpsum'
|
|
34
|
+
```
|
|
35
|
+
*/
|
|
36
|
+
readonly locale?: false | string | readonly string[];
|
|
37
|
+
};
|
|
38
|
+
export declare function camelCase(input: string | readonly string[], options: CamelCaseOptions): string;
|
|
39
|
+
//# sourceMappingURL=utilities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utilities.d.ts","sourceRoot":"","sources":["../../src/codegen/utilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,OAAO,EAAQ,MAAM,SAAS,CAAC;AAIxC,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,GAAG,EAAE,CAAC,aAAa,CAKtE;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,GAAG,EAAE,CAAC,QAAQ,CAMpE;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,UAM9C;AAED,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,SAAS,CAAC,OAAO,GAAG,SAAS,OAAO,EAAE,CAAC,EAAE,GACnD,OAAO,CAeT;AAED,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAYjE;AA6FD,oBAAY,gBAAgB,GAAG;IAC7B;;;QAGC;IACD,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAE9B;;;QAGC;IACD,QAAQ,CAAC,4BAA4B,CAAC,EAAE,OAAO,CAAC;IAEhD;;;;;;;;;;;;;;;;QAgBC;IACD,QAAQ,CAAC,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC;CACtD,CAAC;AAEF,wBAAgB,SAAS,CACvB,KAAK,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,EACjC,OAAO,EAAE,gBAAgB,UA8D1B"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
+
var __spreadValues = (a, b) => {
|
|
11
|
+
for (var prop in b || (b = {}))
|
|
12
|
+
if (__hasOwnProp.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
if (__getOwnPropSymbols)
|
|
15
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
+
if (__propIsEnum.call(b, prop))
|
|
17
|
+
__defNormalProp(a, prop, b[prop]);
|
|
18
|
+
}
|
|
19
|
+
return a;
|
|
20
|
+
};
|
|
21
|
+
var __export = (target, all) => {
|
|
22
|
+
for (var name in all)
|
|
23
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
24
|
+
};
|
|
25
|
+
var __copyProps = (to, from, except, desc) => {
|
|
26
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
27
|
+
for (let key of __getOwnPropNames(from))
|
|
28
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
29
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
30
|
+
}
|
|
31
|
+
return to;
|
|
32
|
+
};
|
|
33
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
|
|
34
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
35
|
+
var utilities_exports = {};
|
|
36
|
+
__export(utilities_exports, {
|
|
37
|
+
addModelSuffix: () => addModelSuffix,
|
|
38
|
+
camelCase: () => camelCase,
|
|
39
|
+
createNonNullableType: () => createNonNullableType,
|
|
40
|
+
createNullableType: () => createNullableType,
|
|
41
|
+
createVariableNameFromImport: () => createVariableNameFromImport,
|
|
42
|
+
isDirectAncestorInput: () => isDirectAncestorInput
|
|
43
|
+
});
|
|
44
|
+
module.exports = __toCommonJS(utilities_exports);
|
|
45
|
+
var import_typescript = __toESM(require("typescript"));
|
|
46
|
+
var import_graphql = require("graphql");
|
|
47
|
+
const MODEL_SUFFIX = "Model";
|
|
48
|
+
function createNullableType(node) {
|
|
49
|
+
return import_typescript.factory.createUnionTypeNode([
|
|
50
|
+
node,
|
|
51
|
+
import_typescript.factory.createLiteralTypeNode(import_typescript.factory.createNull())
|
|
52
|
+
]);
|
|
53
|
+
}
|
|
54
|
+
function createNonNullableType(node) {
|
|
55
|
+
if (import_typescript.default.isUnionTypeNode(node)) {
|
|
56
|
+
return node.types[0];
|
|
57
|
+
} else {
|
|
58
|
+
throw new Error(`Can't make type non nullable: ${node}.`);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function addModelSuffix(typeName) {
|
|
62
|
+
if (typeName.endsWith(MODEL_SUFFIX)) {
|
|
63
|
+
return typeName;
|
|
64
|
+
}
|
|
65
|
+
return `${typeName}${MODEL_SUFFIX}`;
|
|
66
|
+
}
|
|
67
|
+
function isDirectAncestorInput(ancestors) {
|
|
68
|
+
const directAncestors = ancestors[ancestors.length - 1];
|
|
69
|
+
if (Array.isArray(directAncestors)) {
|
|
70
|
+
return directAncestors.some((directAncestor) => {
|
|
71
|
+
return "kind" in directAncestor && directAncestor.kind === import_graphql.Kind.INPUT_VALUE_DEFINITION;
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
return "kind" in directAncestors && directAncestors.kind === import_graphql.Kind.INPUT_VALUE_DEFINITION;
|
|
75
|
+
}
|
|
76
|
+
function createVariableNameFromImport(path) {
|
|
77
|
+
return camelCase(path.replace(/\.\.\//g, "up-").replace(/@/g, "NS-").replace(/\.\//g, "cwd-").replace(/\//g, "-"), {
|
|
78
|
+
pascalCase: true,
|
|
79
|
+
preserveConsecutiveUppercase: true
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
const UPPERCASE = /[\p{Lu}]/u;
|
|
83
|
+
const LOWERCASE = /[\p{Ll}]/u;
|
|
84
|
+
const LEADING_CAPITAL = /^[\p{Lu}](?![\p{Lu}])/gu;
|
|
85
|
+
const IDENTIFIER = /([\p{Alpha}\p{N}_]|$)/u;
|
|
86
|
+
const SEPARATORS = /[_.\- ]+/;
|
|
87
|
+
const LEADING_SEPARATORS = new RegExp("^" + SEPARATORS.source);
|
|
88
|
+
const SEPARATORS_AND_IDENTIFIER = new RegExp(SEPARATORS.source + IDENTIFIER.source, "gu");
|
|
89
|
+
const NUMBERS_AND_IDENTIFIER = new RegExp("\\d+" + IDENTIFIER.source, "gu");
|
|
90
|
+
const preserveCamelCase = (string, toLowerCase, toUpperCase) => {
|
|
91
|
+
let isLastCharLower = false;
|
|
92
|
+
let isLastCharUpper = false;
|
|
93
|
+
let isLastLastCharUpper = false;
|
|
94
|
+
for (let index = 0; index < string.length; index++) {
|
|
95
|
+
const character = string[index];
|
|
96
|
+
if (isLastCharLower && UPPERCASE.test(character)) {
|
|
97
|
+
string = string.slice(0, index) + "-" + string.slice(index);
|
|
98
|
+
isLastCharLower = false;
|
|
99
|
+
isLastLastCharUpper = isLastCharUpper;
|
|
100
|
+
isLastCharUpper = true;
|
|
101
|
+
index++;
|
|
102
|
+
} else if (isLastCharUpper && isLastLastCharUpper && LOWERCASE.test(character)) {
|
|
103
|
+
string = string.slice(0, index - 1) + "-" + string.slice(index - 1);
|
|
104
|
+
isLastLastCharUpper = isLastCharUpper;
|
|
105
|
+
isLastCharUpper = false;
|
|
106
|
+
isLastCharLower = true;
|
|
107
|
+
} else {
|
|
108
|
+
isLastCharLower = toLowerCase(character) === character && toUpperCase(character) !== character;
|
|
109
|
+
isLastLastCharUpper = isLastCharUpper;
|
|
110
|
+
isLastCharUpper = toUpperCase(character) === character && toLowerCase(character) !== character;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return string;
|
|
114
|
+
};
|
|
115
|
+
const preserveConsecutiveUppercase = (input, toLowerCase) => {
|
|
116
|
+
LEADING_CAPITAL.lastIndex = 0;
|
|
117
|
+
return input.replace(LEADING_CAPITAL, (m1) => toLowerCase(m1));
|
|
118
|
+
};
|
|
119
|
+
const postProcess = (input, toUpperCase) => {
|
|
120
|
+
SEPARATORS_AND_IDENTIFIER.lastIndex = 0;
|
|
121
|
+
NUMBERS_AND_IDENTIFIER.lastIndex = 0;
|
|
122
|
+
return input.replace(SEPARATORS_AND_IDENTIFIER, (_, identifier) => toUpperCase(identifier)).replace(NUMBERS_AND_IDENTIFIER, (m) => toUpperCase(m));
|
|
123
|
+
};
|
|
124
|
+
function camelCase(input, options) {
|
|
125
|
+
if (!(typeof input === "string" || Array.isArray(input))) {
|
|
126
|
+
throw new TypeError("Expected the input to be `string | string[]`");
|
|
127
|
+
}
|
|
128
|
+
options = __spreadValues({
|
|
129
|
+
pascalCase: false,
|
|
130
|
+
preserveConsecutiveUppercase: false
|
|
131
|
+
}, options);
|
|
132
|
+
if (Array.isArray(input)) {
|
|
133
|
+
input = input.map((x) => x.trim()).filter((x) => x.length).join("-");
|
|
134
|
+
} else {
|
|
135
|
+
input = input.trim();
|
|
136
|
+
}
|
|
137
|
+
if (input.length === 0) {
|
|
138
|
+
return "";
|
|
139
|
+
}
|
|
140
|
+
let locale = options.locale;
|
|
141
|
+
let toLowerCase;
|
|
142
|
+
let toUpperCase;
|
|
143
|
+
if (locale === false) {
|
|
144
|
+
toLowerCase = (s) => s.toLowerCase();
|
|
145
|
+
toUpperCase = (s) => s.toUpperCase();
|
|
146
|
+
} else {
|
|
147
|
+
toLowerCase = (s) => s.toLocaleLowerCase(locale);
|
|
148
|
+
toUpperCase = (s) => s.toLocaleUpperCase(locale);
|
|
149
|
+
}
|
|
150
|
+
if (input.length === 1) {
|
|
151
|
+
if (SEPARATORS.test(input)) {
|
|
152
|
+
return "";
|
|
153
|
+
}
|
|
154
|
+
return options.pascalCase ? toUpperCase(input) : toLowerCase(input);
|
|
155
|
+
}
|
|
156
|
+
const hasUpperCase = input !== toLowerCase(input);
|
|
157
|
+
if (hasUpperCase) {
|
|
158
|
+
input = preserveCamelCase(input, toLowerCase, toUpperCase);
|
|
159
|
+
}
|
|
160
|
+
input = input.replace(LEADING_SEPARATORS, "");
|
|
161
|
+
input = options.preserveConsecutiveUppercase ? preserveConsecutiveUppercase(input, toLowerCase) : toLowerCase(input);
|
|
162
|
+
if (options.pascalCase) {
|
|
163
|
+
input = toUpperCase(input.charAt(0)) + input.slice(1);
|
|
164
|
+
}
|
|
165
|
+
return postProcess(input, toUpperCase);
|
|
166
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
// src/codegen/utilities.ts
|
|
19
|
+
import ts, { factory } from "typescript";
|
|
20
|
+
import { Kind } from "graphql";
|
|
21
|
+
var MODEL_SUFFIX = "Model";
|
|
22
|
+
function createNullableType(node) {
|
|
23
|
+
return factory.createUnionTypeNode([
|
|
24
|
+
node,
|
|
25
|
+
factory.createLiteralTypeNode(factory.createNull())
|
|
26
|
+
]);
|
|
27
|
+
}
|
|
28
|
+
function createNonNullableType(node) {
|
|
29
|
+
if (ts.isUnionTypeNode(node)) {
|
|
30
|
+
return node.types[0];
|
|
31
|
+
} else {
|
|
32
|
+
throw new Error(`Can't make type non nullable: ${node}.`);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function addModelSuffix(typeName) {
|
|
36
|
+
if (typeName.endsWith(MODEL_SUFFIX)) {
|
|
37
|
+
return typeName;
|
|
38
|
+
}
|
|
39
|
+
return `${typeName}${MODEL_SUFFIX}`;
|
|
40
|
+
}
|
|
41
|
+
function isDirectAncestorInput(ancestors) {
|
|
42
|
+
const directAncestors = ancestors[ancestors.length - 1];
|
|
43
|
+
if (Array.isArray(directAncestors)) {
|
|
44
|
+
return directAncestors.some((directAncestor) => {
|
|
45
|
+
return "kind" in directAncestor && directAncestor.kind === Kind.INPUT_VALUE_DEFINITION;
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
return "kind" in directAncestors && directAncestors.kind === Kind.INPUT_VALUE_DEFINITION;
|
|
49
|
+
}
|
|
50
|
+
function createVariableNameFromImport(path) {
|
|
51
|
+
return camelCase(path.replace(/\.\.\//g, "up-").replace(/@/g, "NS-").replace(/\.\//g, "cwd-").replace(/\//g, "-"), {
|
|
52
|
+
pascalCase: true,
|
|
53
|
+
preserveConsecutiveUppercase: true
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
var UPPERCASE = /[\p{Lu}]/u;
|
|
57
|
+
var LOWERCASE = /[\p{Ll}]/u;
|
|
58
|
+
var LEADING_CAPITAL = /^[\p{Lu}](?![\p{Lu}])/gu;
|
|
59
|
+
var IDENTIFIER = /([\p{Alpha}\p{N}_]|$)/u;
|
|
60
|
+
var SEPARATORS = /[_.\- ]+/;
|
|
61
|
+
var LEADING_SEPARATORS = new RegExp("^" + SEPARATORS.source);
|
|
62
|
+
var SEPARATORS_AND_IDENTIFIER = new RegExp(SEPARATORS.source + IDENTIFIER.source, "gu");
|
|
63
|
+
var NUMBERS_AND_IDENTIFIER = new RegExp("\\d+" + IDENTIFIER.source, "gu");
|
|
64
|
+
var preserveCamelCase = (string, toLowerCase, toUpperCase) => {
|
|
65
|
+
let isLastCharLower = false;
|
|
66
|
+
let isLastCharUpper = false;
|
|
67
|
+
let isLastLastCharUpper = false;
|
|
68
|
+
for (let index = 0; index < string.length; index++) {
|
|
69
|
+
const character = string[index];
|
|
70
|
+
if (isLastCharLower && UPPERCASE.test(character)) {
|
|
71
|
+
string = string.slice(0, index) + "-" + string.slice(index);
|
|
72
|
+
isLastCharLower = false;
|
|
73
|
+
isLastLastCharUpper = isLastCharUpper;
|
|
74
|
+
isLastCharUpper = true;
|
|
75
|
+
index++;
|
|
76
|
+
} else if (isLastCharUpper && isLastLastCharUpper && LOWERCASE.test(character)) {
|
|
77
|
+
string = string.slice(0, index - 1) + "-" + string.slice(index - 1);
|
|
78
|
+
isLastLastCharUpper = isLastCharUpper;
|
|
79
|
+
isLastCharUpper = false;
|
|
80
|
+
isLastCharLower = true;
|
|
81
|
+
} else {
|
|
82
|
+
isLastCharLower = toLowerCase(character) === character && toUpperCase(character) !== character;
|
|
83
|
+
isLastLastCharUpper = isLastCharUpper;
|
|
84
|
+
isLastCharUpper = toUpperCase(character) === character && toLowerCase(character) !== character;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return string;
|
|
88
|
+
};
|
|
89
|
+
var preserveConsecutiveUppercase = (input, toLowerCase) => {
|
|
90
|
+
LEADING_CAPITAL.lastIndex = 0;
|
|
91
|
+
return input.replace(LEADING_CAPITAL, (m1) => toLowerCase(m1));
|
|
92
|
+
};
|
|
93
|
+
var postProcess = (input, toUpperCase) => {
|
|
94
|
+
SEPARATORS_AND_IDENTIFIER.lastIndex = 0;
|
|
95
|
+
NUMBERS_AND_IDENTIFIER.lastIndex = 0;
|
|
96
|
+
return input.replace(SEPARATORS_AND_IDENTIFIER, (_, identifier) => toUpperCase(identifier)).replace(NUMBERS_AND_IDENTIFIER, (m) => toUpperCase(m));
|
|
97
|
+
};
|
|
98
|
+
function camelCase(input, options) {
|
|
99
|
+
if (!(typeof input === "string" || Array.isArray(input))) {
|
|
100
|
+
throw new TypeError("Expected the input to be `string | string[]`");
|
|
101
|
+
}
|
|
102
|
+
options = __spreadValues({
|
|
103
|
+
pascalCase: false,
|
|
104
|
+
preserveConsecutiveUppercase: false
|
|
105
|
+
}, options);
|
|
106
|
+
if (Array.isArray(input)) {
|
|
107
|
+
input = input.map((x) => x.trim()).filter((x) => x.length).join("-");
|
|
108
|
+
} else {
|
|
109
|
+
input = input.trim();
|
|
110
|
+
}
|
|
111
|
+
if (input.length === 0) {
|
|
112
|
+
return "";
|
|
113
|
+
}
|
|
114
|
+
let locale = options.locale;
|
|
115
|
+
let toLowerCase;
|
|
116
|
+
let toUpperCase;
|
|
117
|
+
if (locale === false) {
|
|
118
|
+
toLowerCase = (s) => s.toLowerCase();
|
|
119
|
+
toUpperCase = (s) => s.toUpperCase();
|
|
120
|
+
} else {
|
|
121
|
+
toLowerCase = (s) => s.toLocaleLowerCase(locale);
|
|
122
|
+
toUpperCase = (s) => s.toLocaleUpperCase(locale);
|
|
123
|
+
}
|
|
124
|
+
if (input.length === 1) {
|
|
125
|
+
if (SEPARATORS.test(input)) {
|
|
126
|
+
return "";
|
|
127
|
+
}
|
|
128
|
+
return options.pascalCase ? toUpperCase(input) : toLowerCase(input);
|
|
129
|
+
}
|
|
130
|
+
const hasUpperCase = input !== toLowerCase(input);
|
|
131
|
+
if (hasUpperCase) {
|
|
132
|
+
input = preserveCamelCase(input, toLowerCase, toUpperCase);
|
|
133
|
+
}
|
|
134
|
+
input = input.replace(LEADING_SEPARATORS, "");
|
|
135
|
+
input = options.preserveConsecutiveUppercase ? preserveConsecutiveUppercase(input, toLowerCase) : toLowerCase(input);
|
|
136
|
+
if (options.pascalCase) {
|
|
137
|
+
input = toUpperCase(input.charAt(0)) + input.slice(1);
|
|
138
|
+
}
|
|
139
|
+
return postProcess(input, toUpperCase);
|
|
140
|
+
}
|
|
141
|
+
export {
|
|
142
|
+
addModelSuffix,
|
|
143
|
+
camelCase,
|
|
144
|
+
createNonNullableType,
|
|
145
|
+
createNullableType,
|
|
146
|
+
createVariableNameFromImport,
|
|
147
|
+
isDirectAncestorInput
|
|
148
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extractImplicitTypesToTypescript.d.ts","sourceRoot":"","sources":["../../src/extractors/extractImplicitTypesToTypescript.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,MAAM,YAAY,CAAC;AACzC,OAAO,EACL,YAAY,EAab,MAAM,SAAS,CAAC;AAmBjB,wBAAgB,gCAAgC,CAC9C,QAAQ,EAAE,YAAY,GACrB,EAAE,CAAC,UAAU,CA8Jf"}
|
package/lib/{extractImplicitTypesToTypescript.js → extractors/extractImplicitTypesToTypescript.js}
RENAMED
|
File without changes
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { extractImplicitTypesToTypescript } from "
|
|
1
|
+
export { extractImplicitTypesToTypescript } from "./extractImplicitTypesToTypescript";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/extractors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/extractors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC"}
|
package/lib/extractors/index.js
CHANGED
|
@@ -20,4 +20,4 @@ __export(extractors_exports, {
|
|
|
20
20
|
extractImplicitTypesToTypescript: () => import_extractImplicitTypesToTypescript.extractImplicitTypesToTypescript
|
|
21
21
|
});
|
|
22
22
|
module.exports = __toCommonJS(extractors_exports);
|
|
23
|
-
var import_extractImplicitTypesToTypescript = require("
|
|
23
|
+
var import_extractImplicitTypesToTypescript = require("./extractImplicitTypesToTypescript");
|
package/lib/extractors/index.mjs
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -2,10 +2,12 @@ export { executeWithoutSchema } from "./executeWithoutSchema";
|
|
|
2
2
|
export { executeWithSchema } from "./executeWithSchema";
|
|
3
3
|
export { subscribeWithSchema } from "./subscribeWithSchema";
|
|
4
4
|
export { subscribeWithoutSchema } from "./subscribeWithoutSchema";
|
|
5
|
-
export type { ObjectTypeResolver, InterfaceTypeResolver, UnionTypeResolver, ScalarTypeResolver, EnumTypeResolver, InputObjectTypeResolver, FunctionFieldResolver, Resolvers, } from "./types";
|
|
5
|
+
export type { ObjectTypeResolver, InterfaceTypeResolver, UnionTypeResolver, ScalarTypeResolver, EnumTypeResolver, InputObjectTypeResolver, FunctionFieldResolver, Resolvers, ResolveInfo, } from "./types";
|
|
6
6
|
export { addTypesToRequestDocument } from "./ast/addTypesToRequestDocument";
|
|
7
7
|
export { extractImplicitTypes } from "./extractImplicitTypesRuntime";
|
|
8
8
|
export { specifiedScalars } from "./values";
|
|
9
9
|
export { annotateDocumentGraphQLTransform } from "./transforms/annotateDocumentGraphQLTransform";
|
|
10
|
+
export type { PromiseOrValue } from "./jsutils/PromiseOrValue";
|
|
11
|
+
export { generateTS } from "./codegen";
|
|
10
12
|
export type { NameNode, DocumentNode, OperationDefinitionNode, VariableDefinitionNode, VariableNode, SelectionSetNode, FieldNode, ArgumentNode, FragmentSpreadNode, InlineFragmentNode, FragmentDefinitionNode, IntValueNode, FloatValueNode, StringValueNode, BooleanValueNode, NullValueNode, EnumValueNode, ListValueNode, ObjectValueNode, ObjectFieldNode, DirectiveNode, NamedTypeNode, ListTypeNode, NonNullTypeNode, SchemaDefinitionNode, OperationTypeDefinitionNode, ScalarTypeDefinitionNode, ObjectTypeDefinitionNode, FieldDefinitionNode, InputValueDefinitionNode, InterfaceTypeDefinitionNode, UnionTypeDefinitionNode, EnumTypeDefinitionNode, EnumValueDefinitionNode, InputObjectTypeDefinitionNode, DirectiveDefinitionNode, SchemaExtensionNode, ScalarTypeExtensionNode, ObjectTypeExtensionNode, InterfaceTypeExtensionNode, UnionTypeExtensionNode, EnumTypeExtensionNode, InputObjectTypeExtensionNode, } from "./ast/TypedAST";
|
|
11
13
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,YAAY,EACV,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,uBAAuB,EACvB,qBAAqB,EACrB,SAAS,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,YAAY,EACV,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,uBAAuB,EACvB,qBAAqB,EACrB,SAAS,EACT,WAAW,GACZ,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAE5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAErE,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,OAAO,EAAE,gCAAgC,EAAE,MAAM,+CAA+C,CAAC;AAEjG,YAAY,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE/D,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,YAAY,EACV,QAAQ,EACR,YAAY,EACZ,uBAAuB,EACvB,sBAAsB,EACtB,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,YAAY,EACZ,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,aAAa,EACb,eAAe,EACf,eAAe,EACf,aAAa,EACb,aAAa,EACb,YAAY,EACZ,eAAe,EACf,oBAAoB,EACpB,2BAA2B,EAC3B,wBAAwB,EACxB,wBAAwB,EACxB,mBAAmB,EACnB,wBAAwB,EACxB,2BAA2B,EAC3B,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACvB,6BAA6B,EAC7B,uBAAuB,EACvB,mBAAmB,EACnB,uBAAuB,EACvB,uBAAuB,EACvB,0BAA0B,EAC1B,sBAAsB,EACtB,qBAAqB,EACrB,4BAA4B,GAC7B,MAAM,gBAAgB,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -22,6 +22,7 @@ __export(src_exports, {
|
|
|
22
22
|
executeWithSchema: () => import_executeWithSchema.executeWithSchema,
|
|
23
23
|
executeWithoutSchema: () => import_executeWithoutSchema.executeWithoutSchema,
|
|
24
24
|
extractImplicitTypes: () => import_extractImplicitTypesRuntime.extractImplicitTypes,
|
|
25
|
+
generateTS: () => import_codegen.generateTS,
|
|
25
26
|
specifiedScalars: () => import_values.specifiedScalars,
|
|
26
27
|
subscribeWithSchema: () => import_subscribeWithSchema.subscribeWithSchema,
|
|
27
28
|
subscribeWithoutSchema: () => import_subscribeWithoutSchema.subscribeWithoutSchema
|
|
@@ -35,3 +36,4 @@ var import_addTypesToRequestDocument = require("./ast/addTypesToRequestDocument"
|
|
|
35
36
|
var import_extractImplicitTypesRuntime = require("./extractImplicitTypesRuntime");
|
|
36
37
|
var import_values = require("./values");
|
|
37
38
|
var import_annotateDocumentGraphQLTransform = require("./transforms/annotateDocumentGraphQLTransform");
|
|
39
|
+
var import_codegen = require("./codegen");
|
package/lib/index.mjs
CHANGED
|
@@ -7,12 +7,14 @@ import { addTypesToRequestDocument } from "./ast/addTypesToRequestDocument.mjs";
|
|
|
7
7
|
import { extractImplicitTypes } from "./extractImplicitTypesRuntime.mjs";
|
|
8
8
|
import { specifiedScalars } from "./values.mjs";
|
|
9
9
|
import { annotateDocumentGraphQLTransform } from "./transforms/annotateDocumentGraphQLTransform.mjs";
|
|
10
|
+
import { generateTS } from "./codegen.mjs";
|
|
10
11
|
export {
|
|
11
12
|
addTypesToRequestDocument,
|
|
12
13
|
annotateDocumentGraphQLTransform,
|
|
13
14
|
executeWithSchema,
|
|
14
15
|
executeWithoutSchema,
|
|
15
16
|
extractImplicitTypes,
|
|
17
|
+
generateTS,
|
|
16
18
|
specifiedScalars,
|
|
17
19
|
subscribeWithSchema,
|
|
18
20
|
subscribeWithoutSchema
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blankGraphQLTag.d.ts","sourceRoot":"","sources":["../../src/utilities/blankGraphQLTag.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,OAAO,EAAE,oBAAoB,GAAG,MAAM,CAE7E"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var blankGraphQLTag_exports = {};
|
|
19
|
+
__export(blankGraphQLTag_exports, {
|
|
20
|
+
default: () => blankGraphQLTag
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(blankGraphQLTag_exports);
|
|
23
|
+
function blankGraphQLTag(strings) {
|
|
24
|
+
return strings[0];
|
|
25
|
+
}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"extractImplicitTypesToTypescript.d.ts","sourceRoot":"","sources":["../src/extractImplicitTypesToTypescript.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,MAAM,YAAY,CAAC;AACzC,OAAO,EACL,YAAY,EAab,MAAM,SAAS,CAAC;AAmBjB,wBAAgB,gCAAgC,CAC9C,QAAQ,EAAE,YAAY,GACrB,EAAE,CAAC,UAAU,CA8Jf"}
|