@snowtop/ent 0.1.0-alpha13 → 0.1.0-alpha131
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/action/action.d.ts +33 -29
- package/action/action.js +22 -7
- package/action/executor.d.ts +3 -3
- package/action/executor.js +8 -3
- package/action/experimental_action.d.ts +32 -22
- package/action/experimental_action.js +35 -9
- package/action/index.d.ts +2 -0
- package/action/index.js +7 -1
- package/action/orchestrator.d.ts +32 -15
- package/action/orchestrator.js +249 -53
- package/action/privacy.d.ts +2 -2
- package/action/relative_value.d.ts +47 -0
- package/action/relative_value.js +125 -0
- package/action/transaction.d.ts +10 -0
- package/action/transaction.js +23 -0
- package/auth/auth.d.ts +1 -1
- package/core/base.d.ts +61 -37
- package/core/base.js +7 -1
- package/core/clause.d.ts +85 -40
- package/core/clause.js +375 -64
- package/core/config.d.ts +12 -1
- package/core/config.js +7 -1
- package/core/const.d.ts +3 -0
- package/core/const.js +6 -0
- package/core/context.d.ts +6 -4
- package/core/context.js +20 -2
- package/core/convert.d.ts +1 -1
- package/core/date.js +1 -5
- package/core/db.d.ts +11 -8
- package/core/db.js +20 -8
- package/core/ent.d.ts +86 -30
- package/core/ent.js +626 -197
- package/core/global_schema.d.ts +7 -0
- package/core/global_schema.js +51 -0
- package/core/loaders/assoc_count_loader.d.ts +3 -2
- package/core/loaders/assoc_count_loader.js +10 -2
- package/core/loaders/assoc_edge_loader.d.ts +2 -2
- package/core/loaders/assoc_edge_loader.js +8 -11
- package/core/loaders/index.d.ts +1 -1
- package/core/loaders/index.js +1 -3
- package/core/loaders/index_loader.d.ts +3 -3
- package/core/loaders/loader.d.ts +2 -2
- package/core/loaders/loader.js +5 -5
- package/core/loaders/object_loader.d.ts +32 -11
- package/core/loaders/object_loader.js +225 -78
- package/core/loaders/query_loader.d.ts +7 -13
- package/core/loaders/query_loader.js +52 -11
- package/core/loaders/raw_count_loader.d.ts +2 -2
- package/core/loaders/raw_count_loader.js +5 -1
- package/core/logger.d.ts +1 -1
- package/core/logger.js +1 -0
- package/core/privacy.d.ts +25 -24
- package/core/privacy.js +21 -25
- package/core/query/assoc_query.d.ts +7 -6
- package/core/query/assoc_query.js +9 -1
- package/core/query/custom_clause_query.d.ts +27 -0
- package/core/query/custom_clause_query.js +84 -0
- package/core/query/custom_query.d.ts +20 -5
- package/core/query/custom_query.js +87 -12
- package/core/query/index.d.ts +1 -0
- package/core/query/index.js +3 -1
- package/core/query/query.d.ts +8 -4
- package/core/query/query.js +101 -53
- package/core/query/shared_assoc_test.d.ts +2 -1
- package/core/query/shared_assoc_test.js +35 -45
- package/core/query/shared_test.d.ts +8 -1
- package/core/query/shared_test.js +470 -236
- package/core/viewer.d.ts +3 -3
- package/core/viewer.js +1 -1
- package/graphql/graphql.d.ts +51 -19
- package/graphql/graphql.js +160 -136
- package/graphql/graphql_field_helpers.d.ts +7 -1
- package/graphql/graphql_field_helpers.js +21 -1
- package/graphql/index.d.ts +2 -2
- package/graphql/index.js +3 -5
- package/graphql/query/connection_type.d.ts +9 -9
- package/graphql/query/edge_connection.d.ts +9 -9
- package/graphql/query/page_info.d.ts +1 -1
- package/graphql/query/shared_assoc_test.js +1 -1
- package/graphql/query/shared_edge_connection.js +1 -19
- package/graphql/scalars/orderby_direction.d.ts +2 -0
- package/graphql/scalars/orderby_direction.js +15 -0
- package/imports/dataz/example1/_auth.js +128 -47
- package/imports/dataz/example1/_viewer.js +87 -39
- package/imports/index.d.ts +6 -1
- package/imports/index.js +19 -4
- package/index.d.ts +13 -5
- package/index.js +21 -7
- package/package.json +17 -17
- package/parse_schema/parse.d.ts +31 -9
- package/parse_schema/parse.js +155 -13
- package/schema/base_schema.d.ts +7 -3
- package/schema/base_schema.js +10 -0
- package/schema/field.d.ts +78 -21
- package/schema/field.js +231 -71
- package/schema/index.d.ts +2 -2
- package/schema/index.js +5 -1
- package/schema/json_field.d.ts +16 -4
- package/schema/json_field.js +32 -2
- package/schema/schema.d.ts +89 -19
- package/schema/schema.js +11 -13
- package/schema/struct_field.d.ts +15 -3
- package/schema/struct_field.js +117 -22
- package/schema/union_field.d.ts +1 -1
- package/scripts/custom_compiler.js +10 -6
- package/scripts/custom_graphql.js +128 -31
- package/scripts/migrate_v0.1.js +36 -0
- package/scripts/move_types.js +120 -0
- package/scripts/read_schema.js +20 -5
- package/testutils/action/complex_schemas.d.ts +69 -0
- package/testutils/action/complex_schemas.js +398 -0
- package/testutils/builder.d.ts +41 -47
- package/testutils/builder.js +76 -49
- package/testutils/db/fixture.d.ts +10 -0
- package/testutils/db/fixture.js +26 -0
- package/testutils/db/{test_db.d.ts → temp_db.d.ts} +24 -8
- package/testutils/db/{test_db.js → temp_db.js} +182 -45
- package/testutils/db/value.d.ts +7 -0
- package/testutils/db/value.js +251 -0
- package/testutils/db_mock.d.ts +16 -4
- package/testutils/db_mock.js +52 -7
- package/testutils/db_time_zone.d.ts +4 -0
- package/testutils/db_time_zone.js +41 -0
- package/testutils/ent-graphql-tests/index.d.ts +7 -1
- package/testutils/ent-graphql-tests/index.js +52 -23
- package/testutils/fake_comms.js +1 -1
- package/testutils/fake_data/const.d.ts +2 -1
- package/testutils/fake_data/const.js +3 -0
- package/testutils/fake_data/fake_contact.d.ts +7 -3
- package/testutils/fake_data/fake_contact.js +13 -7
- package/testutils/fake_data/fake_event.d.ts +4 -1
- package/testutils/fake_data/fake_event.js +7 -6
- package/testutils/fake_data/fake_tag.d.ts +36 -0
- package/testutils/fake_data/fake_tag.js +89 -0
- package/testutils/fake_data/fake_user.d.ts +8 -5
- package/testutils/fake_data/fake_user.js +16 -15
- package/testutils/fake_data/index.js +5 -1
- package/testutils/fake_data/internal.d.ts +2 -0
- package/testutils/fake_data/internal.js +7 -1
- package/testutils/fake_data/tag_query.d.ts +13 -0
- package/testutils/fake_data/tag_query.js +43 -0
- package/testutils/fake_data/test_helpers.d.ts +11 -4
- package/testutils/fake_data/test_helpers.js +28 -12
- package/testutils/fake_data/user_query.d.ts +13 -6
- package/testutils/fake_data/user_query.js +54 -22
- package/testutils/fake_log.d.ts +3 -3
- package/testutils/fake_log.js +1 -1
- package/testutils/parse_sql.d.ts +6 -0
- package/testutils/parse_sql.js +16 -2
- package/testutils/test_edge_global_schema.d.ts +15 -0
- package/testutils/test_edge_global_schema.js +62 -0
- package/testutils/write.d.ts +2 -2
- package/testutils/write.js +33 -7
- package/tsc/ast.d.ts +25 -2
- package/tsc/ast.js +141 -17
- package/tsc/compilerOptions.js +5 -1
- package/tsc/move_generated.d.ts +1 -0
- package/tsc/move_generated.js +164 -0
- package/tsc/transform.d.ts +22 -0
- package/tsc/transform.js +181 -0
- package/tsc/transform_action.d.ts +22 -0
- package/tsc/transform_action.js +183 -0
- package/tsc/transform_ent.d.ts +17 -0
- package/tsc/transform_ent.js +60 -0
- package/tsc/transform_schema.d.ts +27 -0
- package/{scripts → tsc}/transform_schema.js +146 -117
- package/graphql/enums.d.ts +0 -3
- package/graphql/enums.js +0 -25
- package/scripts/move_generated.js +0 -142
- package/scripts/transform_code.js +0 -113
- package/scripts/transform_schema.d.ts +0 -1
- /package/scripts/{move_generated.d.ts → migrate_v0.1.d.ts} +0 -0
- /package/scripts/{transform_code.d.ts → move_types.d.ts} +0 -0
|
@@ -8,12 +8,16 @@ export declare function validateNoCustomFields(): void;
|
|
|
8
8
|
export declare function validateCustomArgs(expected: CustomObject[]): void;
|
|
9
9
|
export declare function validateCustomInputObjects(expected: CustomObject[]): void;
|
|
10
10
|
export declare function validateCustomObjects(expected: CustomObject[]): void;
|
|
11
|
+
export declare function validateCustomInterfaces(expected: CustomObject[]): void;
|
|
12
|
+
export declare function validateCustomUnions(expected: CustomObject[]): void;
|
|
11
13
|
export declare function validateNoCustomArgs(): void;
|
|
12
14
|
export declare function validateNoCustomQueries(): void;
|
|
13
15
|
export declare function validateNoCustomMutations(): void;
|
|
14
16
|
export declare function validateNoCustomInputObjects(): void;
|
|
15
17
|
export declare function validateNoCustomObjects(): void;
|
|
16
18
|
export declare function validateNoCustomTypes(): void;
|
|
19
|
+
export declare function validateNoCustomInterfaces(): void;
|
|
20
|
+
export declare function validateNoCustomUnions(): void;
|
|
17
21
|
export declare enum CustomObjectTypes {
|
|
18
22
|
Field = 1,
|
|
19
23
|
Arg = 2,
|
|
@@ -21,7 +25,9 @@ export declare enum CustomObjectTypes {
|
|
|
21
25
|
InputObject = 8,
|
|
22
26
|
Query = 16,
|
|
23
27
|
Mutation = 32,
|
|
24
|
-
CustomTypes = 64
|
|
28
|
+
CustomTypes = 64,
|
|
29
|
+
Interface = 128,
|
|
30
|
+
Union = 256
|
|
25
31
|
}
|
|
26
32
|
export declare function validateNoCustom(...exceptions: number[]): void;
|
|
27
33
|
export declare function validateCustomTypes(expected: CustomType[]): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateCustomTypes = exports.validateNoCustom = exports.CustomObjectTypes = exports.validateNoCustomTypes = exports.validateNoCustomObjects = exports.validateNoCustomInputObjects = exports.validateNoCustomMutations = exports.validateNoCustomQueries = exports.validateNoCustomArgs = exports.validateCustomObjects = exports.validateCustomInputObjects = exports.validateCustomArgs = exports.validateNoCustomFields = exports.validateFields = exports.validateCustomQueries = exports.validateCustomMutations = exports.validateCustomFields = exports.validateOneCustomField = void 0;
|
|
3
|
+
exports.validateCustomTypes = exports.validateNoCustom = exports.CustomObjectTypes = exports.validateNoCustomUnions = exports.validateNoCustomInterfaces = exports.validateNoCustomTypes = exports.validateNoCustomObjects = exports.validateNoCustomInputObjects = exports.validateNoCustomMutations = exports.validateNoCustomQueries = exports.validateNoCustomArgs = exports.validateCustomUnions = exports.validateCustomInterfaces = exports.validateCustomObjects = exports.validateCustomInputObjects = exports.validateCustomArgs = exports.validateNoCustomFields = exports.validateFields = exports.validateCustomQueries = exports.validateCustomMutations = exports.validateCustomFields = exports.validateOneCustomField = void 0;
|
|
4
4
|
const graphql_1 = require("./graphql");
|
|
5
5
|
function validateOneCustomField(expected) {
|
|
6
6
|
let customFields = graphql_1.GQLCapture.getCustomFields();
|
|
@@ -101,6 +101,14 @@ function validateCustomObjects(expected) {
|
|
|
101
101
|
validateCustom(expected, graphql_1.GQLCapture.getCustomObjects());
|
|
102
102
|
}
|
|
103
103
|
exports.validateCustomObjects = validateCustomObjects;
|
|
104
|
+
function validateCustomInterfaces(expected) {
|
|
105
|
+
validateCustom(expected, graphql_1.GQLCapture.getCustomInterfaces());
|
|
106
|
+
}
|
|
107
|
+
exports.validateCustomInterfaces = validateCustomInterfaces;
|
|
108
|
+
function validateCustomUnions(expected) {
|
|
109
|
+
validateCustom(expected, graphql_1.GQLCapture.getCustomUnions());
|
|
110
|
+
}
|
|
111
|
+
exports.validateCustomUnions = validateCustomUnions;
|
|
104
112
|
function validateNoCustomArgs() {
|
|
105
113
|
expect(graphql_1.GQLCapture.getCustomArgs().size).toBe(0);
|
|
106
114
|
}
|
|
@@ -125,6 +133,14 @@ function validateNoCustomTypes() {
|
|
|
125
133
|
expect(graphql_1.GQLCapture.getCustomTypes().size).toBe(0);
|
|
126
134
|
}
|
|
127
135
|
exports.validateNoCustomTypes = validateNoCustomTypes;
|
|
136
|
+
function validateNoCustomInterfaces() {
|
|
137
|
+
expect(graphql_1.GQLCapture.getCustomInterfaces().size).toBe(0);
|
|
138
|
+
}
|
|
139
|
+
exports.validateNoCustomInterfaces = validateNoCustomInterfaces;
|
|
140
|
+
function validateNoCustomUnions() {
|
|
141
|
+
expect(graphql_1.GQLCapture.getCustomUnions().size).toBe(0);
|
|
142
|
+
}
|
|
143
|
+
exports.validateNoCustomUnions = validateNoCustomUnions;
|
|
128
144
|
var CustomObjectTypes;
|
|
129
145
|
(function (CustomObjectTypes) {
|
|
130
146
|
CustomObjectTypes[CustomObjectTypes["Field"] = 1] = "Field";
|
|
@@ -134,6 +150,8 @@ var CustomObjectTypes;
|
|
|
134
150
|
CustomObjectTypes[CustomObjectTypes["Query"] = 16] = "Query";
|
|
135
151
|
CustomObjectTypes[CustomObjectTypes["Mutation"] = 32] = "Mutation";
|
|
136
152
|
CustomObjectTypes[CustomObjectTypes["CustomTypes"] = 64] = "CustomTypes";
|
|
153
|
+
CustomObjectTypes[CustomObjectTypes["Interface"] = 128] = "Interface";
|
|
154
|
+
CustomObjectTypes[CustomObjectTypes["Union"] = 256] = "Union";
|
|
137
155
|
})(CustomObjectTypes = exports.CustomObjectTypes || (exports.CustomObjectTypes = {}));
|
|
138
156
|
// TODO what's a good name for this instead
|
|
139
157
|
function validateNoCustom(...exceptions) {
|
|
@@ -151,6 +169,8 @@ function validateNoCustom(...exceptions) {
|
|
|
151
169
|
validate(CustomObjectTypes.Mutation, validateNoCustomMutations);
|
|
152
170
|
validate(CustomObjectTypes.InputObject, validateNoCustomInputObjects);
|
|
153
171
|
validate(CustomObjectTypes.CustomTypes, validateNoCustomTypes);
|
|
172
|
+
validate(CustomObjectTypes.Interface, validateNoCustomInterfaces);
|
|
173
|
+
validate(CustomObjectTypes.Union, validateNoCustomUnions);
|
|
154
174
|
}
|
|
155
175
|
exports.validateNoCustom = validateNoCustom;
|
|
156
176
|
function validateCustomTypes(expected) {
|
package/graphql/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export { gqlFieldOptions, gqlObjectOptions, gqlField,
|
|
1
|
+
export { gqlFieldOptions, gqlObjectOptions, gqlField, gqlArgType, gqlInputObjectType, gqlObjectType, gqlQuery, gqlMutation, gqlContextType, gqlConnection, GraphQLConnection, GQLCapture, gqlFileUpload, CustomType, } from "./graphql";
|
|
2
2
|
export { GraphQLTime } from "./scalars/time";
|
|
3
|
+
export { GraphQLOrderByDirection } from "./scalars/orderby_direction";
|
|
3
4
|
export { GraphQLPageInfo } from "./query/page_info";
|
|
4
5
|
export { GraphQLEdge, GraphQLEdgeConnection } from "./query/edge_connection";
|
|
5
6
|
export { GraphQLEdgeType, GraphQLConnectionType, } from "./query/connection_type";
|
|
@@ -7,5 +8,4 @@ export { GraphQLNodeInterface } from "./builtins/node";
|
|
|
7
8
|
export { GraphQLConnectionInterface } from "./builtins/connection";
|
|
8
9
|
export { GraphQLEdgeInterface } from "./builtins/edge";
|
|
9
10
|
export { NodeResolver, EntNodeResolver, registerResolver, clearResolvers, resolveID, nodeIDEncoder, mustDecodeIDFromGQLID, mustDecodeNullableIDFromGQLID, encodeGQLID, } from "./node_resolver";
|
|
10
|
-
export { convertFromGQLEnum, convertToGQLEnum } from "./enums";
|
|
11
11
|
export { transformUnionTypes } from "./mutations/union";
|
package/graphql/index.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.transformUnionTypes = exports.
|
|
3
|
+
exports.transformUnionTypes = exports.encodeGQLID = exports.mustDecodeNullableIDFromGQLID = exports.mustDecodeIDFromGQLID = exports.nodeIDEncoder = exports.resolveID = exports.clearResolvers = exports.registerResolver = exports.EntNodeResolver = exports.GraphQLEdgeInterface = exports.GraphQLConnectionInterface = exports.GraphQLNodeInterface = exports.GraphQLConnectionType = exports.GraphQLEdgeType = exports.GraphQLEdgeConnection = exports.GraphQLPageInfo = exports.GraphQLOrderByDirection = exports.GraphQLTime = exports.gqlFileUpload = exports.GQLCapture = exports.gqlConnection = exports.gqlContextType = exports.gqlMutation = exports.gqlQuery = exports.gqlObjectType = exports.gqlInputObjectType = exports.gqlArgType = exports.gqlField = void 0;
|
|
4
4
|
var graphql_1 = require("./graphql");
|
|
5
5
|
Object.defineProperty(exports, "gqlField", { enumerable: true, get: function () { return graphql_1.gqlField; } });
|
|
6
|
-
Object.defineProperty(exports, "gqlArg", { enumerable: true, get: function () { return graphql_1.gqlArg; } });
|
|
7
6
|
Object.defineProperty(exports, "gqlArgType", { enumerable: true, get: function () { return graphql_1.gqlArgType; } });
|
|
8
7
|
Object.defineProperty(exports, "gqlInputObjectType", { enumerable: true, get: function () { return graphql_1.gqlInputObjectType; } });
|
|
9
8
|
Object.defineProperty(exports, "gqlObjectType", { enumerable: true, get: function () { return graphql_1.gqlObjectType; } });
|
|
@@ -15,6 +14,8 @@ Object.defineProperty(exports, "GQLCapture", { enumerable: true, get: function (
|
|
|
15
14
|
Object.defineProperty(exports, "gqlFileUpload", { enumerable: true, get: function () { return graphql_1.gqlFileUpload; } });
|
|
16
15
|
var time_1 = require("./scalars/time");
|
|
17
16
|
Object.defineProperty(exports, "GraphQLTime", { enumerable: true, get: function () { return time_1.GraphQLTime; } });
|
|
17
|
+
var orderby_direction_1 = require("./scalars/orderby_direction");
|
|
18
|
+
Object.defineProperty(exports, "GraphQLOrderByDirection", { enumerable: true, get: function () { return orderby_direction_1.GraphQLOrderByDirection; } });
|
|
18
19
|
var page_info_1 = require("./query/page_info");
|
|
19
20
|
Object.defineProperty(exports, "GraphQLPageInfo", { enumerable: true, get: function () { return page_info_1.GraphQLPageInfo; } });
|
|
20
21
|
var edge_connection_1 = require("./query/edge_connection");
|
|
@@ -37,8 +38,5 @@ Object.defineProperty(exports, "nodeIDEncoder", { enumerable: true, get: functio
|
|
|
37
38
|
Object.defineProperty(exports, "mustDecodeIDFromGQLID", { enumerable: true, get: function () { return node_resolver_1.mustDecodeIDFromGQLID; } });
|
|
38
39
|
Object.defineProperty(exports, "mustDecodeNullableIDFromGQLID", { enumerable: true, get: function () { return node_resolver_1.mustDecodeNullableIDFromGQLID; } });
|
|
39
40
|
Object.defineProperty(exports, "encodeGQLID", { enumerable: true, get: function () { return node_resolver_1.encodeGQLID; } });
|
|
40
|
-
var enums_1 = require("./enums");
|
|
41
|
-
Object.defineProperty(exports, "convertFromGQLEnum", { enumerable: true, get: function () { return enums_1.convertFromGQLEnum; } });
|
|
42
|
-
Object.defineProperty(exports, "convertToGQLEnum", { enumerable: true, get: function () { return enums_1.convertToGQLEnum; } });
|
|
43
41
|
var union_1 = require("./mutations/union");
|
|
44
42
|
Object.defineProperty(exports, "transformUnionTypes", { enumerable: true, get: function () { return union_1.transformUnionTypes; } });
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { GraphQLFieldConfigMap, GraphQLObjectType, GraphQLInterfaceType } from "graphql";
|
|
2
2
|
import { RequestContext } from "../../core/context";
|
|
3
3
|
import { GraphQLEdge } from "./edge_connection";
|
|
4
|
-
import { Data } from "../../core/base";
|
|
5
|
-
|
|
6
|
-
export declare class GraphQLEdgeType<TNode extends nodeType, TEdge extends Data> extends GraphQLObjectType {
|
|
7
|
-
constructor(name: string, nodeType: TNode, optionalFields?: () => GraphQLFieldConfigMap<GraphQLEdge<TEdge>, RequestContext
|
|
4
|
+
import { Data, Viewer } from "../../core/base";
|
|
5
|
+
type nodeType = GraphQLObjectType | GraphQLInterfaceType;
|
|
6
|
+
export declare class GraphQLEdgeType<TNode extends nodeType, TEdge extends Data, TViewer extends Viewer> extends GraphQLObjectType {
|
|
7
|
+
constructor(name: string, nodeType: TNode, optionalFields?: () => GraphQLFieldConfigMap<GraphQLEdge<TEdge>, RequestContext<TViewer>>);
|
|
8
8
|
}
|
|
9
|
-
interface connectionOptions<T extends Data> {
|
|
10
|
-
fields?(): GraphQLFieldConfigMap<GraphQLEdge<T>, RequestContext
|
|
9
|
+
interface connectionOptions<T extends Data, TViewer extends Viewer> {
|
|
10
|
+
fields?(): GraphQLFieldConfigMap<GraphQLEdge<T>, RequestContext<TViewer>>;
|
|
11
11
|
}
|
|
12
|
-
export declare class GraphQLConnectionType<TNode extends nodeType, TEdge extends Data> extends GraphQLObjectType {
|
|
13
|
-
edgeType: GraphQLEdgeType<TNode, TEdge>;
|
|
14
|
-
constructor(name: string, nodeType: TNode, options?: connectionOptions<TEdge>);
|
|
12
|
+
export declare class GraphQLConnectionType<TNode extends nodeType, TEdge extends Data, TViewer extends Viewer> extends GraphQLObjectType {
|
|
13
|
+
edgeType: GraphQLEdgeType<TNode, TEdge, TViewer>;
|
|
14
|
+
constructor(name: string, nodeType: TNode, options?: connectionOptions<TEdge, TViewer>);
|
|
15
15
|
}
|
|
16
16
|
export {};
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import { EdgeQuery, PaginationInfo } from "../../core/query/query";
|
|
2
|
-
import { Data, Ent, Viewer } from "../../core/base";
|
|
2
|
+
import { Data, Ent, ID, Viewer } from "../../core/base";
|
|
3
3
|
export interface GraphQLEdge<T extends Data> {
|
|
4
4
|
edge: T;
|
|
5
5
|
node: Ent;
|
|
6
6
|
cursor: string;
|
|
7
7
|
}
|
|
8
|
-
interface edgeQueryCtr<T extends Ent, TEdge extends Data> {
|
|
9
|
-
(v:
|
|
8
|
+
interface edgeQueryCtr<T extends Ent, TEdge extends Data, TViewer extends Viewer> {
|
|
9
|
+
(v: TViewer, src: T): EdgeQuery<T, Ent, TEdge>;
|
|
10
10
|
}
|
|
11
|
-
interface edgeQueryCtr2<T extends Ent, TEdge extends Data> {
|
|
12
|
-
(v:
|
|
11
|
+
interface edgeQueryCtr2<T extends Ent, TEdge extends Data, TViewer extends Viewer> {
|
|
12
|
+
(v: TViewer): EdgeQuery<T, Ent, TEdge>;
|
|
13
13
|
}
|
|
14
|
-
export declare class GraphQLEdgeConnection<TSource extends Ent, TEdge extends Data> {
|
|
14
|
+
export declare class GraphQLEdgeConnection<TSource extends Ent, TEdge extends Data, TViewer extends Viewer = Viewer> {
|
|
15
15
|
query: EdgeQuery<TSource, Ent, TEdge>;
|
|
16
16
|
private results;
|
|
17
17
|
private viewer;
|
|
18
18
|
private source?;
|
|
19
19
|
private args?;
|
|
20
|
-
constructor(viewer:
|
|
21
|
-
constructor(viewer:
|
|
20
|
+
constructor(viewer: TViewer, source: TSource, getQuery: edgeQueryCtr<TSource, TEdge, TViewer>, args?: Data);
|
|
21
|
+
constructor(viewer: TViewer, getQuery: edgeQueryCtr2<TSource, TEdge, TViewer>, args?: Data);
|
|
22
22
|
first(limit: number, cursor?: string): void;
|
|
23
23
|
last(limit: number, cursor?: string): void;
|
|
24
24
|
modifyQuery(fn: (query: EdgeQuery<TSource, Ent, TEdge>) => EdgeQuery<TSource, Ent, TEdge>): void;
|
|
25
25
|
queryTotalCount(): Promise<number>;
|
|
26
26
|
queryEdges(): Promise<GraphQLEdge<TEdge>[]>;
|
|
27
|
-
queryNodes(): Promise<Ent[]>;
|
|
27
|
+
queryNodes(): Promise<Ent<Viewer<Ent<any> | null, ID | null>>[]>;
|
|
28
28
|
private defaultPageInfo;
|
|
29
29
|
queryPageInfo(): Promise<PaginationInfo>;
|
|
30
30
|
private queryData;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { GraphQLObjectType } from "graphql";
|
|
2
2
|
import { RequestContext } from "../../core/context";
|
|
3
3
|
import { PaginationInfo } from "../../core/query/query";
|
|
4
|
-
export declare const GraphQLPageInfo: GraphQLObjectType<PaginationInfo, RequestContext
|
|
4
|
+
export declare const GraphQLPageInfo: GraphQLObjectType<PaginationInfo, RequestContext<import("../..").Viewer<import("../..").Ent<any> | null, import("../..").ID | null>>>;
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.commonTests = void 0;
|
|
4
|
-
const pg_1 = require("pg");
|
|
5
4
|
const viewer_1 = require("../../core/viewer");
|
|
6
5
|
const ent_1 = require("../../core/ent");
|
|
7
|
-
const db_mock_1 = require("../../testutils/db_mock");
|
|
8
6
|
const edge_connection_1 = require("./edge_connection");
|
|
9
7
|
const test_helpers_1 = require("../../testutils/fake_data/test_helpers");
|
|
10
|
-
jest.mock("pg");
|
|
11
|
-
db_mock_1.QueryRecorder.mockPool(pg_1.Pool);
|
|
12
8
|
class TestConnection {
|
|
13
9
|
constructor(getQuery, ents, filter) {
|
|
14
10
|
this.getQuery = getQuery;
|
|
@@ -48,23 +44,9 @@ class TestConnection {
|
|
|
48
44
|
}
|
|
49
45
|
const commonTests = (opts) => {
|
|
50
46
|
function getCursorFrom(contacts, idx) {
|
|
51
|
-
// we depend on the fact that the same time is used for the edge and created_at
|
|
52
|
-
// based on getContactBuilder
|
|
53
|
-
// so regardless of if we're doing assoc or custom queries, we can get the time
|
|
54
|
-
// from the created_at field
|
|
55
47
|
return (0, ent_1.getCursor)({
|
|
56
48
|
row: contacts[idx],
|
|
57
|
-
col: "
|
|
58
|
-
conv: (t) => {
|
|
59
|
-
//sqlite
|
|
60
|
-
if (typeof t === "string") {
|
|
61
|
-
return Date.parse(t);
|
|
62
|
-
}
|
|
63
|
-
return t.getTime();
|
|
64
|
-
},
|
|
65
|
-
// we want the right column to be encoded in the cursor as opposed e.g. time for
|
|
66
|
-
// assoc queries, created_at for index/custom queries
|
|
67
|
-
cursorKey: opts.sortCol,
|
|
49
|
+
col: "id",
|
|
68
50
|
});
|
|
69
51
|
}
|
|
70
52
|
describe("no filters", () => {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GraphQLOrderByDirection = void 0;
|
|
4
|
+
const graphql_1 = require("graphql");
|
|
5
|
+
exports.GraphQLOrderByDirection = new graphql_1.GraphQLEnumType({
|
|
6
|
+
name: "OrderByDirection",
|
|
7
|
+
values: {
|
|
8
|
+
ASC: {
|
|
9
|
+
value: "asc",
|
|
10
|
+
},
|
|
11
|
+
DESC: {
|
|
12
|
+
value: "desc",
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
});
|
|
@@ -1,54 +1,135 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
3
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
4
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
5
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
6
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
7
|
+
var _, done = false;
|
|
8
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
9
|
+
var context = {};
|
|
10
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
11
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
12
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
13
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
14
|
+
if (kind === "accessor") {
|
|
15
|
+
if (result === void 0) continue;
|
|
16
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
17
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
18
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
19
|
+
if (_ = accept(result.init)) initializers.push(_);
|
|
20
|
+
}
|
|
21
|
+
else if (_ = accept(result)) {
|
|
22
|
+
if (kind === "field") initializers.push(_);
|
|
23
|
+
else descriptor[key] = _;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
27
|
+
done = true;
|
|
7
28
|
};
|
|
8
|
-
var
|
|
9
|
-
|
|
29
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
30
|
+
var useValue = arguments.length > 2;
|
|
31
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
32
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
33
|
+
}
|
|
34
|
+
return useValue ? value : void 0;
|
|
10
35
|
};
|
|
11
|
-
var
|
|
12
|
-
|
|
36
|
+
var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
|
|
37
|
+
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
|
38
|
+
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
13
39
|
};
|
|
14
40
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
41
|
const graphql_1 = require("../../../graphql/graphql");
|
|
16
42
|
const graphql_2 = require("graphql");
|
|
17
|
-
let UserAuthInput =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
UserAuthInput =
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
]
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
43
|
+
let UserAuthInput = (() => {
|
|
44
|
+
let _classDecorators = [(0, graphql_1.gqlInputObjectType)()];
|
|
45
|
+
let _classDescriptor;
|
|
46
|
+
let _classExtraInitializers = [];
|
|
47
|
+
let _classThis;
|
|
48
|
+
let _instanceExtraInitializers = [];
|
|
49
|
+
let _emailAddress_decorators;
|
|
50
|
+
let _emailAddress_initializers = [];
|
|
51
|
+
let _password_decorators;
|
|
52
|
+
let _password_initializers = [];
|
|
53
|
+
var UserAuthInput = _classThis = class {
|
|
54
|
+
constructor() {
|
|
55
|
+
this.emailAddress = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _emailAddress_initializers, void 0));
|
|
56
|
+
this.password = __runInitializers(this, _password_initializers, void 0);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
__setFunctionName(_classThis, "UserAuthInput");
|
|
60
|
+
(() => {
|
|
61
|
+
_emailAddress_decorators = [(0, graphql_1.gqlField)({
|
|
62
|
+
nodeName: "UserAuthInput",
|
|
63
|
+
type: graphql_2.GraphQLString,
|
|
64
|
+
})];
|
|
65
|
+
_password_decorators = [(0, graphql_1.gqlField)({
|
|
66
|
+
nodeName: "UserAuthInput",
|
|
67
|
+
type: graphql_2.GraphQLString,
|
|
68
|
+
})];
|
|
69
|
+
__esDecorate(null, null, _emailAddress_decorators, { kind: "field", name: "emailAddress", static: false, private: false, access: { has: obj => "emailAddress" in obj, get: obj => obj.emailAddress, set: (obj, value) => { obj.emailAddress = value; } } }, _emailAddress_initializers, _instanceExtraInitializers);
|
|
70
|
+
__esDecorate(null, null, _password_decorators, { kind: "field", name: "password", static: false, private: false, access: { has: obj => "password" in obj, get: obj => obj.password, set: (obj, value) => { obj.password = value; } } }, _password_initializers, _instanceExtraInitializers);
|
|
71
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name }, null, _classExtraInitializers);
|
|
72
|
+
UserAuthInput = _classThis = _classDescriptor.value;
|
|
73
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
74
|
+
})();
|
|
75
|
+
return UserAuthInput = _classThis;
|
|
76
|
+
})();
|
|
77
|
+
let UserAuthResponse = (() => {
|
|
78
|
+
let _classDecorators_1 = [(0, graphql_1.gqlObjectType)()];
|
|
79
|
+
let _classDescriptor_1;
|
|
80
|
+
let _classExtraInitializers_1 = [];
|
|
81
|
+
let _classThis_1;
|
|
82
|
+
let _instanceExtraInitializers_1 = [];
|
|
83
|
+
let _token_decorators;
|
|
84
|
+
let _token_initializers = [];
|
|
85
|
+
let _viewerID_decorators;
|
|
86
|
+
let _viewerID_initializers = [];
|
|
87
|
+
var UserAuthResponse = _classThis_1 = class {
|
|
88
|
+
constructor() {
|
|
89
|
+
this.token = (__runInitializers(this, _instanceExtraInitializers_1), __runInitializers(this, _token_initializers, void 0));
|
|
90
|
+
this.viewerID = __runInitializers(this, _viewerID_initializers, void 0);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
__setFunctionName(_classThis_1, "UserAuthResponse");
|
|
94
|
+
(() => {
|
|
95
|
+
_token_decorators = [(0, graphql_1.gqlField)({
|
|
96
|
+
nodeName: "UserAuthResponse",
|
|
97
|
+
type: graphql_2.GraphQLString,
|
|
98
|
+
})];
|
|
99
|
+
_viewerID_decorators = [(0, graphql_1.gqlField)({ nodeName: "UserAuthResponses", type: graphql_2.GraphQLID })];
|
|
100
|
+
__esDecorate(null, null, _token_decorators, { kind: "field", name: "token", static: false, private: false, access: { has: obj => "token" in obj, get: obj => obj.token, set: (obj, value) => { obj.token = value; } } }, _token_initializers, _instanceExtraInitializers_1);
|
|
101
|
+
__esDecorate(null, null, _viewerID_decorators, { kind: "field", name: "viewerID", static: false, private: false, access: { has: obj => "viewerID" in obj, get: obj => obj.viewerID, set: (obj, value) => { obj.viewerID = value; } } }, _viewerID_initializers, _instanceExtraInitializers_1);
|
|
102
|
+
__esDecorate(null, _classDescriptor_1 = { value: _classThis_1 }, _classDecorators_1, { kind: "class", name: _classThis_1.name }, null, _classExtraInitializers_1);
|
|
103
|
+
UserAuthResponse = _classThis_1 = _classDescriptor_1.value;
|
|
104
|
+
__runInitializers(_classThis_1, _classExtraInitializers_1);
|
|
105
|
+
})();
|
|
106
|
+
return UserAuthResponse = _classThis_1;
|
|
107
|
+
})();
|
|
108
|
+
let AuthResolver = (() => {
|
|
109
|
+
var _a;
|
|
110
|
+
let _instanceExtraInitializers_2 = [];
|
|
111
|
+
let _userAuth_decorators;
|
|
112
|
+
return _a = class AuthResolver {
|
|
113
|
+
async userAuth(input) {
|
|
114
|
+
throw new Error("not implemented");
|
|
115
|
+
}
|
|
116
|
+
constructor() {
|
|
117
|
+
__runInitializers(this, _instanceExtraInitializers_2);
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
(() => {
|
|
121
|
+
_userAuth_decorators = [(0, graphql_1.gqlMutation)({
|
|
122
|
+
nodeName: "AuthResolver",
|
|
123
|
+
name: "userAuth",
|
|
124
|
+
type: UserAuthResponse,
|
|
125
|
+
args: [
|
|
126
|
+
{
|
|
127
|
+
name: "input",
|
|
128
|
+
type: UserAuthInput,
|
|
129
|
+
},
|
|
130
|
+
],
|
|
131
|
+
})];
|
|
132
|
+
__esDecorate(_a, null, _userAuth_decorators, { kind: "method", name: "userAuth", static: false, private: false, access: { has: obj => "userAuth" in obj, get: obj => obj.userAuth } }, null, _instanceExtraInitializers_2);
|
|
133
|
+
})(),
|
|
134
|
+
_a;
|
|
135
|
+
})();
|
|
@@ -1,46 +1,94 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
3
|
+
var useValue = arguments.length > 2;
|
|
4
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
5
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
6
|
+
}
|
|
7
|
+
return useValue ? value : void 0;
|
|
7
8
|
};
|
|
8
|
-
var
|
|
9
|
-
if (
|
|
9
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
10
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
11
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
12
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
13
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
14
|
+
var _, done = false;
|
|
15
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
16
|
+
var context = {};
|
|
17
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
18
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
19
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
20
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
21
|
+
if (kind === "accessor") {
|
|
22
|
+
if (result === void 0) continue;
|
|
23
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
24
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
25
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
26
|
+
if (_ = accept(result.init)) initializers.push(_);
|
|
27
|
+
}
|
|
28
|
+
else if (_ = accept(result)) {
|
|
29
|
+
if (kind === "field") initializers.push(_);
|
|
30
|
+
else descriptor[key] = _;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
34
|
+
done = true;
|
|
10
35
|
};
|
|
11
|
-
var
|
|
12
|
-
|
|
36
|
+
var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
|
|
37
|
+
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
|
38
|
+
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
13
39
|
};
|
|
14
40
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
41
|
const graphql_1 = require("../../../graphql/graphql");
|
|
16
42
|
const graphql_2 = require("graphql");
|
|
17
|
-
let ViewerType =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
exports.default =
|
|
43
|
+
let ViewerType = (() => {
|
|
44
|
+
let _classDecorators = [(0, graphql_1.gqlObjectType)({ name: "Viewer" })];
|
|
45
|
+
let _classDescriptor;
|
|
46
|
+
let _classExtraInitializers = [];
|
|
47
|
+
let _classThis;
|
|
48
|
+
let _instanceExtraInitializers = [];
|
|
49
|
+
let _get_viewerID_decorators;
|
|
50
|
+
var ViewerType = _classThis = class {
|
|
51
|
+
constructor(viewer) {
|
|
52
|
+
this.viewer = (__runInitializers(this, _instanceExtraInitializers), viewer);
|
|
53
|
+
}
|
|
54
|
+
get viewerID() {
|
|
55
|
+
return this.viewer.viewerID;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
__setFunctionName(_classThis, "ViewerType");
|
|
59
|
+
(() => {
|
|
60
|
+
_get_viewerID_decorators = [(0, graphql_1.gqlField)({
|
|
61
|
+
nodeName: "ViewerType",
|
|
62
|
+
type: graphql_2.GraphQLID,
|
|
63
|
+
nullable: true,
|
|
64
|
+
})];
|
|
65
|
+
__esDecorate(_classThis, null, _get_viewerID_decorators, { kind: "getter", name: "viewerID", static: false, private: false, access: { has: obj => "viewerID" in obj, get: obj => obj.viewerID } }, null, _instanceExtraInitializers);
|
|
66
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name }, null, _classExtraInitializers);
|
|
67
|
+
ViewerType = _classThis = _classDescriptor.value;
|
|
68
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
69
|
+
})();
|
|
70
|
+
return ViewerType = _classThis;
|
|
71
|
+
})();
|
|
72
|
+
exports.default = (() => {
|
|
73
|
+
var _a;
|
|
74
|
+
let _instanceExtraInitializers_1 = [];
|
|
75
|
+
let _viewer_decorators;
|
|
76
|
+
return _a = class ViewerResolver {
|
|
77
|
+
viewer(context) {
|
|
78
|
+
return new ViewerType(context.getViewer());
|
|
79
|
+
}
|
|
80
|
+
constructor() {
|
|
81
|
+
__runInitializers(this, _instanceExtraInitializers_1);
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
(() => {
|
|
85
|
+
_viewer_decorators = [(0, graphql_1.gqlQuery)({
|
|
86
|
+
nodeName: "ViewerResolver",
|
|
87
|
+
name: "viewer",
|
|
88
|
+
type: ViewerType,
|
|
89
|
+
args: [(0, graphql_1.gqlContextType)()],
|
|
90
|
+
})];
|
|
91
|
+
__esDecorate(_a, null, _viewer_decorators, { kind: "method", name: "viewer", static: false, private: false, access: { has: obj => "viewer" in obj, get: obj => obj.viewer } }, null, _instanceExtraInitializers_1);
|
|
92
|
+
})(),
|
|
93
|
+
_a;
|
|
94
|
+
})();
|
package/imports/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export interface Options {
|
|
2
2
|
filter?: (file: string, index: number, array: string[]) => boolean;
|
|
3
|
+
justCurrentDir?: boolean;
|
|
3
4
|
ignore?: string | Readonly<string[]> | undefined;
|
|
4
5
|
}
|
|
5
6
|
export interface PathResult {
|
|
@@ -10,7 +11,11 @@ interface classResult {
|
|
|
10
11
|
class: classInfo;
|
|
11
12
|
file: file;
|
|
12
13
|
}
|
|
13
|
-
|
|
14
|
+
interface ParseInput {
|
|
15
|
+
root: string;
|
|
16
|
+
opts?: Options;
|
|
17
|
+
}
|
|
18
|
+
export declare function parseCustomImports(filePath: string, inputs: ParseInput[]): PathResult;
|
|
14
19
|
export interface importInfo {
|
|
15
20
|
name: string;
|
|
16
21
|
importPath: string;
|