@kiwano/core 2.0.2 → 2.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/dist/Builder.js +2 -2
- package/dist/argument.js +2 -2
- package/dist/entity/createInputObjectType.js +2 -2
- package/dist/entity/entitySchema.js +2 -2
- package/dist/entity/updateInputObjectType.js +2 -2
- package/dist/enumType.js +19 -9
- package/dist/enumValue.js +2 -2
- package/dist/field.js +19 -9
- package/dist/inputField.js +2 -2
- package/dist/inputObjectType.js +19 -9
- package/dist/naming/compact.js +2 -2
- package/dist/naming/descriptive.js +2 -2
- package/dist/naming/util.js +3 -3
- package/dist/objectType.js +19 -9
- package/dist/plugin/acl/acl.js +2 -2
- package/dist/plugin/acl/middleware.js +4 -4
- package/dist/plugin/filter/equals.d.ts +3 -0
- package/dist/plugin/filter/equals.js +9 -4
- package/dist/plugin/filter/search.js +2 -2
- package/dist/plugin/pagination/connection.js +19 -9
- package/dist/plugin/pagination/firstAfter.js +2 -2
- package/dist/plugin/pagination/items.js +19 -9
- package/dist/plugin/pagination/offsetLimit.js +2 -2
- package/dist/plugin/pagination/relay.js +2 -2
- package/dist/plugin/pagination/simple.js +2 -2
- package/dist/plugin/sort/sort.js +2 -2
- package/dist/schema.js +2 -2
- package/dist/unionType.js +2 -2
- package/dist/util.js +11 -11
- package/package.json +1 -1
package/dist/Builder.js
CHANGED
|
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.FinalizeContext = exports.BuildContext = exports.BuilderError = void 0;
|
|
7
|
+
exports.resolveName = resolveName;
|
|
7
8
|
const lodash_1 = require("lodash");
|
|
8
9
|
const graphql_1 = require("graphql");
|
|
9
10
|
const FrameworkError_1 = __importDefault(require("./error/FrameworkError"));
|
|
@@ -110,4 +111,3 @@ exports.FinalizeContext = FinalizeContext;
|
|
|
110
111
|
function resolveName(name) {
|
|
111
112
|
return (0, lodash_1.isFunction)(name) ? name() : name;
|
|
112
113
|
}
|
|
113
|
-
exports.resolveName = resolveName;
|
package/dist/argument.js
CHANGED
|
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.ArgumentBuilder = void 0;
|
|
7
|
+
exports.argument = argument;
|
|
7
8
|
const lodash_1 = require("lodash");
|
|
8
9
|
const graphql_1 = require("graphql");
|
|
9
10
|
const Builder_1 = __importDefault(require("./Builder"));
|
|
@@ -96,5 +97,4 @@ exports.ArgumentBuilder = ArgumentBuilder;
|
|
|
96
97
|
function argument(name, type) {
|
|
97
98
|
return new ArgumentBuilder(name, type);
|
|
98
99
|
}
|
|
99
|
-
exports.argument = argument;
|
|
100
100
|
exports.default = argument;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.CreateInputObjectTypeBuilder = void 0;
|
|
4
|
+
exports.createInputObjectType = createInputObjectType;
|
|
4
5
|
const inputObjectType_1 = require("../inputObjectType");
|
|
5
6
|
const objectType_1 = require("../objectType");
|
|
6
7
|
const inputField_1 = require("../inputField");
|
|
@@ -51,5 +52,4 @@ exports.CreateInputObjectTypeBuilder = CreateInputObjectTypeBuilder;
|
|
|
51
52
|
function createInputObjectType(name, entityType) {
|
|
52
53
|
return new CreateInputObjectTypeBuilder(name, entityType);
|
|
53
54
|
}
|
|
54
|
-
exports.createInputObjectType = createInputObjectType;
|
|
55
55
|
exports.default = createInputObjectType;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.EntitySchemaBuilder = exports.AbstractEntitySchemaBuilder = exports.AbstractEntitySchemaBuilderBase = exports.entityFieldTypeExtensionName = exports.EntityFieldType = void 0;
|
|
4
|
+
exports.entitySchema = entitySchema;
|
|
4
5
|
const objectType_1 = require("../objectType");
|
|
5
6
|
const field_1 = require("../field");
|
|
6
7
|
const naming_1 = require("../naming");
|
|
@@ -208,5 +209,4 @@ EntitySchemaBuilder.defaultNamingStrategy = (0, naming_1.compactNamingStrategy)(
|
|
|
208
209
|
function entitySchema(name) {
|
|
209
210
|
return new EntitySchemaBuilder(name);
|
|
210
211
|
}
|
|
211
|
-
exports.entitySchema = entitySchema;
|
|
212
212
|
exports.default = entitySchema;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.UpdateInputObjectTypeBuilder = void 0;
|
|
4
|
+
exports.updateInputObjectType = updateInputObjectType;
|
|
4
5
|
const inputObjectType_1 = require("../inputObjectType");
|
|
5
6
|
const objectType_1 = require("../objectType");
|
|
6
7
|
const inputField_1 = require("../inputField");
|
|
@@ -51,5 +52,4 @@ exports.UpdateInputObjectTypeBuilder = UpdateInputObjectTypeBuilder;
|
|
|
51
52
|
function updateInputObjectType(name, entityType) {
|
|
52
53
|
return new UpdateInputObjectTypeBuilder(name, entityType);
|
|
53
54
|
}
|
|
54
|
-
exports.updateInputObjectType = updateInputObjectType;
|
|
55
55
|
exports.default = updateInputObjectType;
|
package/dist/enumType.js
CHANGED
|
@@ -15,15 +15,26 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.
|
|
36
|
+
exports.EnumTypeBuilder = void 0;
|
|
37
|
+
exports.enumType = enumType;
|
|
27
38
|
const lodash_1 = require("lodash");
|
|
28
39
|
const definition_1 = require("graphql/type/definition");
|
|
29
40
|
const Builder_1 = __importStar(require("./Builder"));
|
|
@@ -112,5 +123,4 @@ exports.EnumTypeBuilder = EnumTypeBuilder;
|
|
|
112
123
|
function enumType(name, valuesObject = null) {
|
|
113
124
|
return new EnumTypeBuilder(name, valuesObject);
|
|
114
125
|
}
|
|
115
|
-
exports.enumType = enumType;
|
|
116
126
|
exports.default = enumType;
|
package/dist/enumValue.js
CHANGED
|
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.EnumValueBuilder = void 0;
|
|
7
|
+
exports.enumValue = enumValue;
|
|
7
8
|
const lodash_1 = require("lodash");
|
|
8
9
|
const Builder_1 = __importDefault(require("./Builder"));
|
|
9
10
|
class EnumValueBuilder extends Builder_1.default {
|
|
@@ -56,5 +57,4 @@ exports.EnumValueBuilder = EnumValueBuilder;
|
|
|
56
57
|
function enumValue(name, value = null) {
|
|
57
58
|
return new EnumValueBuilder(name, value);
|
|
58
59
|
}
|
|
59
|
-
exports.enumValue = enumValue;
|
|
60
60
|
exports.default = enumValue;
|
package/dist/field.js
CHANGED
|
@@ -15,15 +15,26 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.
|
|
36
|
+
exports.FieldBuilder = void 0;
|
|
37
|
+
exports.field = field;
|
|
27
38
|
const lodash_1 = require("lodash");
|
|
28
39
|
const graphql_1 = require("graphql");
|
|
29
40
|
const argument_1 = require("./argument");
|
|
@@ -173,5 +184,4 @@ exports.FieldBuilder = FieldBuilder;
|
|
|
173
184
|
function field(name, type = null) {
|
|
174
185
|
return new FieldBuilder(name, type);
|
|
175
186
|
}
|
|
176
|
-
exports.field = field;
|
|
177
187
|
exports.default = field;
|
package/dist/inputField.js
CHANGED
|
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.InputFieldBuilder = void 0;
|
|
7
|
+
exports.inputField = inputField;
|
|
7
8
|
const lodash_1 = require("lodash");
|
|
8
9
|
const graphql_1 = require("graphql");
|
|
9
10
|
const Builder_1 = __importDefault(require("./Builder"));
|
|
@@ -96,5 +97,4 @@ exports.InputFieldBuilder = InputFieldBuilder;
|
|
|
96
97
|
function inputField(name, type) {
|
|
97
98
|
return new InputFieldBuilder(name, type);
|
|
98
99
|
}
|
|
99
|
-
exports.inputField = inputField;
|
|
100
100
|
exports.default = inputField;
|
package/dist/inputObjectType.js
CHANGED
|
@@ -15,15 +15,26 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.
|
|
36
|
+
exports.InputObjectTypeBuilder = void 0;
|
|
37
|
+
exports.inputObjectType = inputObjectType;
|
|
27
38
|
const lodash_1 = require("lodash");
|
|
28
39
|
const graphql_1 = require("graphql");
|
|
29
40
|
const inputField_1 = require("./inputField");
|
|
@@ -105,5 +116,4 @@ exports.InputObjectTypeBuilder = InputObjectTypeBuilder;
|
|
|
105
116
|
function inputObjectType(name) {
|
|
106
117
|
return new InputObjectTypeBuilder(name);
|
|
107
118
|
}
|
|
108
|
-
exports.inputObjectType = inputObjectType;
|
|
109
119
|
exports.default = inputObjectType;
|
package/dist/naming/compact.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.CompactNamingStrategy = void 0;
|
|
4
|
+
exports.compactNamingStrategy = compactNamingStrategy;
|
|
4
5
|
const util_1 = require("./util");
|
|
5
6
|
class CompactNamingStrategy {
|
|
6
7
|
entityObject(schemaName) {
|
|
@@ -50,5 +51,4 @@ exports.CompactNamingStrategy = CompactNamingStrategy;
|
|
|
50
51
|
function compactNamingStrategy() {
|
|
51
52
|
return new CompactNamingStrategy();
|
|
52
53
|
}
|
|
53
|
-
exports.compactNamingStrategy = compactNamingStrategy;
|
|
54
54
|
exports.default = compactNamingStrategy;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.DescriptiveNamingStrategy = void 0;
|
|
4
|
+
exports.descriptiveNamingStrategy = descriptiveNamingStrategy;
|
|
4
5
|
const util_1 = require("./util");
|
|
5
6
|
class DescriptiveNamingStrategy {
|
|
6
7
|
entityObject(schemaName) {
|
|
@@ -50,5 +51,4 @@ exports.DescriptiveNamingStrategy = DescriptiveNamingStrategy;
|
|
|
50
51
|
function descriptiveNamingStrategy() {
|
|
51
52
|
return new DescriptiveNamingStrategy();
|
|
52
53
|
}
|
|
53
|
-
exports.descriptiveNamingStrategy = descriptiveNamingStrategy;
|
|
54
54
|
exports.default = descriptiveNamingStrategy;
|
package/dist/naming/util.js
CHANGED
|
@@ -3,7 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.pluralize =
|
|
6
|
+
exports.pluralize = void 0;
|
|
7
|
+
exports.ucFirst = ucFirst;
|
|
8
|
+
exports.lcFirst = lcFirst;
|
|
7
9
|
const pluralize_1 = __importDefault(require("pluralize"));
|
|
8
10
|
exports.pluralize = pluralize_1.default;
|
|
9
11
|
function ucFirst(input) {
|
|
@@ -12,11 +14,9 @@ function ucFirst(input) {
|
|
|
12
14
|
}
|
|
13
15
|
return input.charAt(0).toUpperCase() + input.slice(1);
|
|
14
16
|
}
|
|
15
|
-
exports.ucFirst = ucFirst;
|
|
16
17
|
function lcFirst(input) {
|
|
17
18
|
if (input === null || input.length === 0) {
|
|
18
19
|
return null;
|
|
19
20
|
}
|
|
20
21
|
return input.charAt(0).toLowerCase() + input.slice(1);
|
|
21
22
|
}
|
|
22
|
-
exports.lcFirst = lcFirst;
|
package/dist/objectType.js
CHANGED
|
@@ -15,15 +15,26 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.
|
|
36
|
+
exports.ObjectTypeBuilder = void 0;
|
|
37
|
+
exports.objectType = objectType;
|
|
27
38
|
const lodash_1 = require("lodash");
|
|
28
39
|
const graphql_1 = require("graphql");
|
|
29
40
|
const field_1 = require("./field");
|
|
@@ -126,5 +137,4 @@ exports.ObjectTypeBuilder = ObjectTypeBuilder;
|
|
|
126
137
|
function objectType(name) {
|
|
127
138
|
return new ObjectTypeBuilder(name);
|
|
128
139
|
}
|
|
129
|
-
exports.objectType = objectType;
|
|
130
140
|
exports.default = objectType;
|
package/dist/plugin/acl/acl.js
CHANGED
|
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.AclPlugin = exports.defaultAclOptions = exports.AclAction = void 0;
|
|
7
|
+
exports.aclPlugin = aclPlugin;
|
|
7
8
|
const lodash_1 = require("lodash");
|
|
8
9
|
const middleware_1 = require("./middleware");
|
|
9
10
|
const FrameworkError_1 = __importDefault(require("../../error/FrameworkError"));
|
|
@@ -201,5 +202,4 @@ exports.AclPlugin = AclPlugin;
|
|
|
201
202
|
function aclPlugin(options) {
|
|
202
203
|
return new AclPlugin(options);
|
|
203
204
|
}
|
|
204
|
-
exports.aclPlugin = aclPlugin;
|
|
205
205
|
exports.default = aclPlugin;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.defaultAclMiddlewareOptions = void 0;
|
|
4
|
+
exports.expressAclMiddleware = expressAclMiddleware;
|
|
5
|
+
exports.graphQLAclMiddleware = graphQLAclMiddleware;
|
|
6
|
+
exports.getPathResource = getPathResource;
|
|
4
7
|
const lodash_1 = require("lodash");
|
|
5
8
|
const resolver_1 = require("../../error/resolver");
|
|
6
9
|
exports.defaultAclMiddlewareOptions = {
|
|
@@ -23,7 +26,6 @@ function expressAclMiddleware(acl, config = null, options = null) {
|
|
|
23
26
|
next();
|
|
24
27
|
};
|
|
25
28
|
}
|
|
26
|
-
exports.expressAclMiddleware = expressAclMiddleware;
|
|
27
29
|
function graphQLAclMiddleware(acl, schemaName, options = null) {
|
|
28
30
|
const fullOptions = getOptions(options);
|
|
29
31
|
return (resolve, root, args, context, info) => {
|
|
@@ -38,11 +40,9 @@ function graphQLAclMiddleware(acl, schemaName, options = null) {
|
|
|
38
40
|
return resolve(root, args, context, info);
|
|
39
41
|
};
|
|
40
42
|
}
|
|
41
|
-
exports.graphQLAclMiddleware = graphQLAclMiddleware;
|
|
42
43
|
function getPathResource(path) {
|
|
43
44
|
return [path.typename, path.key].join('.');
|
|
44
45
|
}
|
|
45
|
-
exports.getPathResource = getPathResource;
|
|
46
46
|
function getOptions(options) {
|
|
47
47
|
return (0, lodash_1.defaults)({}, options || {}, exports.defaultAclMiddlewareOptions);
|
|
48
48
|
}
|
|
@@ -6,6 +6,7 @@ import { Plugin } from "../common";
|
|
|
6
6
|
import { BuildContext } from "../../Builder";
|
|
7
7
|
export interface EqualsFilterPluginOptions {
|
|
8
8
|
multi?: boolean;
|
|
9
|
+
manual?: boolean;
|
|
9
10
|
fields?: EqualsFilterPluginFieldConfig[];
|
|
10
11
|
exclude?: string[];
|
|
11
12
|
include?: string[];
|
|
@@ -22,6 +23,8 @@ export declare class EqualsFilterPlugin implements Plugin {
|
|
|
22
23
|
constructor(options?: EqualsFilterPluginOptions);
|
|
23
24
|
multi(): this;
|
|
24
25
|
multi(multi: boolean): this;
|
|
26
|
+
manual(): this;
|
|
27
|
+
manual(manual: boolean): this;
|
|
25
28
|
field(name: string, type: InputFieldType): this;
|
|
26
29
|
exclude(...fieldNames: string[]): this;
|
|
27
30
|
include(...fieldNames: string[]): this;
|
|
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.EqualsFilterPlugin = exports.defaultEqualsFilterPluginOptions = void 0;
|
|
7
|
+
exports.equalsFilterPlugin = equalsFilterPlugin;
|
|
7
8
|
const lodash_1 = require("lodash");
|
|
8
9
|
const inputObjectType_1 = __importDefault(require("../../inputObjectType"));
|
|
9
10
|
const objectType_1 = require("../../objectType");
|
|
@@ -11,6 +12,7 @@ const util_1 = require("../../util");
|
|
|
11
12
|
const PluginError_1 = __importDefault(require("../PluginError"));
|
|
12
13
|
exports.defaultEqualsFilterPluginOptions = {
|
|
13
14
|
multi: false,
|
|
15
|
+
manual: false,
|
|
14
16
|
argumentName: 'filter',
|
|
15
17
|
inputName: typeName => `${typeName}EqualsFilter`,
|
|
16
18
|
};
|
|
@@ -25,6 +27,10 @@ class EqualsFilterPlugin {
|
|
|
25
27
|
this._options.multi = multi;
|
|
26
28
|
return this;
|
|
27
29
|
}
|
|
30
|
+
manual(manual = true) {
|
|
31
|
+
this._options.manual = manual;
|
|
32
|
+
return this;
|
|
33
|
+
}
|
|
28
34
|
field(name, type) {
|
|
29
35
|
if (!this._options.fields) {
|
|
30
36
|
this._options.fields = [];
|
|
@@ -55,7 +61,7 @@ class EqualsFilterPlugin {
|
|
|
55
61
|
const typeName = info.type.toString();
|
|
56
62
|
const inputTypeName = this._options.inputName(typeName);
|
|
57
63
|
let targetObjectType;
|
|
58
|
-
if (!this._options.
|
|
64
|
+
if (!this._options.manual) {
|
|
59
65
|
targetObjectType = context.rootSchema.findType(typeName, true);
|
|
60
66
|
if (!targetObjectType) {
|
|
61
67
|
throw new PluginError_1.default(`Filter target object ${typeName} not found`);
|
|
@@ -88,7 +94,7 @@ class EqualsFilterPlugin {
|
|
|
88
94
|
});
|
|
89
95
|
}
|
|
90
96
|
}
|
|
91
|
-
|
|
97
|
+
if (this._options.fields) {
|
|
92
98
|
this._options.fields.forEach(field => fields.add(field));
|
|
93
99
|
}
|
|
94
100
|
const extraFields = this._getExtraFieldConfigs(context, name, targetObjectType);
|
|
@@ -115,5 +121,4 @@ exports.EqualsFilterPlugin = EqualsFilterPlugin;
|
|
|
115
121
|
function equalsFilterPlugin(options) {
|
|
116
122
|
return new EqualsFilterPlugin(options);
|
|
117
123
|
}
|
|
118
|
-
exports.equalsFilterPlugin = equalsFilterPlugin;
|
|
119
124
|
exports.default = equalsFilterPlugin;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.SearchFilterPlugin = exports.defaultSearchFilterPluginOptions = void 0;
|
|
4
|
+
exports.searchFilterPlugin = searchFilterPlugin;
|
|
4
5
|
const lodash_1 = require("lodash");
|
|
5
6
|
exports.defaultSearchFilterPluginOptions = {
|
|
6
7
|
argumentName: 'search'
|
|
@@ -20,5 +21,4 @@ exports.SearchFilterPlugin = SearchFilterPlugin;
|
|
|
20
21
|
function searchFilterPlugin() {
|
|
21
22
|
return new SearchFilterPlugin();
|
|
22
23
|
}
|
|
23
|
-
exports.searchFilterPlugin = searchFilterPlugin;
|
|
24
24
|
exports.default = searchFilterPlugin;
|
|
@@ -15,18 +15,29 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
|
28
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.
|
|
39
|
+
exports.ConnectionPaginationPlugin = void 0;
|
|
40
|
+
exports.connectionPaginationPlugin = connectionPaginationPlugin;
|
|
30
41
|
const objectType_1 = __importStar(require("../../objectType"));
|
|
31
42
|
const PluginError_1 = __importDefault(require("../PluginError"));
|
|
32
43
|
const PageInfoObjectTypeName = "PageInfo";
|
|
@@ -101,5 +112,4 @@ exports.ConnectionPaginationPlugin = ConnectionPaginationPlugin;
|
|
|
101
112
|
function connectionPaginationPlugin() {
|
|
102
113
|
return new ConnectionPaginationPlugin();
|
|
103
114
|
}
|
|
104
|
-
exports.connectionPaginationPlugin = connectionPaginationPlugin;
|
|
105
115
|
exports.default = connectionPaginationPlugin;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.FirstAfterPaginationPlugin = void 0;
|
|
4
|
+
exports.firstAfterPaginationPlugin = firstAfterPaginationPlugin;
|
|
4
5
|
class FirstAfterPaginationPlugin {
|
|
5
6
|
beforeBuildField(builder, context, info) {
|
|
6
7
|
if (!info.list) {
|
|
@@ -15,5 +16,4 @@ exports.FirstAfterPaginationPlugin = FirstAfterPaginationPlugin;
|
|
|
15
16
|
function firstAfterPaginationPlugin() {
|
|
16
17
|
return new FirstAfterPaginationPlugin();
|
|
17
18
|
}
|
|
18
|
-
exports.firstAfterPaginationPlugin = firstAfterPaginationPlugin;
|
|
19
19
|
exports.default = firstAfterPaginationPlugin;
|
|
@@ -15,18 +15,29 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
|
28
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.
|
|
39
|
+
exports.ItemsPaginationPlugin = void 0;
|
|
40
|
+
exports.itemsPaginationPlugin = itemsPaginationPlugin;
|
|
30
41
|
const objectType_1 = __importStar(require("../../objectType"));
|
|
31
42
|
const PluginError_1 = __importDefault(require("../PluginError"));
|
|
32
43
|
class ItemsPaginationPlugin {
|
|
@@ -64,5 +75,4 @@ exports.ItemsPaginationPlugin = ItemsPaginationPlugin;
|
|
|
64
75
|
function itemsPaginationPlugin() {
|
|
65
76
|
return new ItemsPaginationPlugin();
|
|
66
77
|
}
|
|
67
|
-
exports.itemsPaginationPlugin = itemsPaginationPlugin;
|
|
68
78
|
exports.default = itemsPaginationPlugin;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.OffsetLimitPaginationPlugin = void 0;
|
|
4
|
+
exports.offsetLimitPaginationPlugin = offsetLimitPaginationPlugin;
|
|
4
5
|
class OffsetLimitPaginationPlugin {
|
|
5
6
|
beforeBuildField(builder, context, info) {
|
|
6
7
|
if (!info.list) {
|
|
@@ -15,5 +16,4 @@ exports.OffsetLimitPaginationPlugin = OffsetLimitPaginationPlugin;
|
|
|
15
16
|
function offsetLimitPaginationPlugin() {
|
|
16
17
|
return new OffsetLimitPaginationPlugin();
|
|
17
18
|
}
|
|
18
|
-
exports.offsetLimitPaginationPlugin = offsetLimitPaginationPlugin;
|
|
19
19
|
exports.default = offsetLimitPaginationPlugin;
|
|
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.RelayPaginationPlugin = void 0;
|
|
7
|
+
exports.relayPaginationPlugin = relayPaginationPlugin;
|
|
7
8
|
const MultiPlugin_1 = __importDefault(require("../MultiPlugin"));
|
|
8
9
|
const connection_1 = require("./connection");
|
|
9
10
|
const firstAfter_1 = require("./firstAfter");
|
|
@@ -22,5 +23,4 @@ exports.RelayPaginationPlugin = RelayPaginationPlugin;
|
|
|
22
23
|
function relayPaginationPlugin() {
|
|
23
24
|
return new RelayPaginationPlugin();
|
|
24
25
|
}
|
|
25
|
-
exports.relayPaginationPlugin = relayPaginationPlugin;
|
|
26
26
|
exports.default = relayPaginationPlugin;
|
|
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.SimplePaginationPlugin = void 0;
|
|
7
|
+
exports.simplePaginationPlugin = simplePaginationPlugin;
|
|
7
8
|
const MultiPlugin_1 = __importDefault(require("../MultiPlugin"));
|
|
8
9
|
const offsetLimit_1 = require("./offsetLimit");
|
|
9
10
|
const items_1 = require("./items");
|
|
@@ -16,5 +17,4 @@ exports.SimplePaginationPlugin = SimplePaginationPlugin;
|
|
|
16
17
|
function simplePaginationPlugin() {
|
|
17
18
|
return new SimplePaginationPlugin();
|
|
18
19
|
}
|
|
19
|
-
exports.simplePaginationPlugin = simplePaginationPlugin;
|
|
20
20
|
exports.default = simplePaginationPlugin;
|
package/dist/plugin/sort/sort.js
CHANGED
|
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.SortPlugin = exports.defaultSortPluginOptions = exports.SortDirection = void 0;
|
|
7
|
+
exports.sortPlugin = sortPlugin;
|
|
7
8
|
const lodash_1 = require("lodash");
|
|
8
9
|
const inputObjectType_1 = __importDefault(require("../../inputObjectType"));
|
|
9
10
|
const enumType_1 = __importDefault(require("../../enumType"));
|
|
@@ -147,5 +148,4 @@ exports.SortPlugin = SortPlugin;
|
|
|
147
148
|
function sortPlugin(options) {
|
|
148
149
|
return new SortPlugin(options);
|
|
149
150
|
}
|
|
150
|
-
exports.sortPlugin = sortPlugin;
|
|
151
151
|
exports.default = sortPlugin;
|
package/dist/schema.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.SchemaBuilder = exports.AbstractSchemaBuilder = void 0;
|
|
4
|
+
exports.schema = schema;
|
|
4
5
|
const lodash_1 = require("lodash");
|
|
5
6
|
const schema_1 = require("@graphql-tools/schema");
|
|
6
7
|
const graphql_middleware_1 = require("graphql-middleware");
|
|
@@ -376,5 +377,4 @@ exports.SchemaBuilder = SchemaBuilder;
|
|
|
376
377
|
function schema(name = null) {
|
|
377
378
|
return new SchemaBuilder(name);
|
|
378
379
|
}
|
|
379
|
-
exports.schema = schema;
|
|
380
380
|
exports.default = schema;
|
package/dist/unionType.js
CHANGED
|
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.UnionTypeBuilder = void 0;
|
|
7
|
+
exports.unionType = unionType;
|
|
7
8
|
const definition_1 = require("graphql/type/definition");
|
|
8
9
|
const lodash_1 = require("lodash");
|
|
9
10
|
const Builder_1 = __importDefault(require("./Builder"));
|
|
@@ -71,5 +72,4 @@ exports.UnionTypeBuilder = UnionTypeBuilder;
|
|
|
71
72
|
function unionType(name, types = null) {
|
|
72
73
|
return new UnionTypeBuilder(name, types);
|
|
73
74
|
}
|
|
74
|
-
exports.unionType = unionType;
|
|
75
75
|
exports.default = unionType;
|
package/dist/util.js
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.defaultScalarNames = void 0;
|
|
4
|
+
exports.resolveAutoBuilderArgs = resolveAutoBuilderArgs;
|
|
5
|
+
exports.resolveBuilderArgs = resolveBuilderArgs;
|
|
6
|
+
exports.resolveBuilder = resolveBuilder;
|
|
7
|
+
exports.resolveType = resolveType;
|
|
8
|
+
exports.isTypeInput = isTypeInput;
|
|
9
|
+
exports.isTypeScalar = isTypeScalar;
|
|
10
|
+
exports.isFieldId = isFieldId;
|
|
11
|
+
exports.ensureInstantiated = ensureInstantiated;
|
|
12
|
+
exports.getAclExtension = getAclExtension;
|
|
13
|
+
exports.camelize = camelize;
|
|
4
14
|
const lodash_1 = require("lodash");
|
|
5
15
|
const graphql_1 = require("graphql");
|
|
6
16
|
const definition_1 = require("graphql/type/definition");
|
|
@@ -26,7 +36,6 @@ function resolveAutoBuilderArgs(builderOrConfiguratorOrName, configuratorArg, bu
|
|
|
26
36
|
builder, name, configurator
|
|
27
37
|
};
|
|
28
38
|
}
|
|
29
|
-
exports.resolveAutoBuilderArgs = resolveAutoBuilderArgs;
|
|
30
39
|
function resolveBuilderArgs(builderOrName, configuratorArg, builderType) {
|
|
31
40
|
let builder = null;
|
|
32
41
|
let name = null;
|
|
@@ -43,7 +52,6 @@ function resolveBuilderArgs(builderOrName, configuratorArg, builderType) {
|
|
|
43
52
|
builder, name, configurator
|
|
44
53
|
};
|
|
45
54
|
}
|
|
46
|
-
exports.resolveBuilderArgs = resolveBuilderArgs;
|
|
47
55
|
function resolveBuilder(args, defaultBuilderGenerator) {
|
|
48
56
|
let resolvedBuilder = args.builder;
|
|
49
57
|
if (!resolvedBuilder) {
|
|
@@ -54,7 +62,6 @@ function resolveBuilder(args, defaultBuilderGenerator) {
|
|
|
54
62
|
}
|
|
55
63
|
return resolvedBuilder;
|
|
56
64
|
}
|
|
57
|
-
exports.resolveBuilder = resolveBuilder;
|
|
58
65
|
const nonNullTypePattern = /(.+)!$/;
|
|
59
66
|
const nonNullListTypePattern = /\[(.+)!]/;
|
|
60
67
|
const listTypePattern = /\[(.+)]/;
|
|
@@ -69,7 +76,6 @@ function resolveType(type) {
|
|
|
69
76
|
const baseMatches = baseTypePattern.exec(type);
|
|
70
77
|
return { nonNull, list, nonNullList, type: baseMatches[1] };
|
|
71
78
|
}
|
|
72
|
-
exports.resolveType = resolveType;
|
|
73
79
|
function isTypeInput(type, schema) {
|
|
74
80
|
if ((0, lodash_1.isString)(type)) {
|
|
75
81
|
const typeName = type;
|
|
@@ -88,7 +94,6 @@ function isTypeInput(type, schema) {
|
|
|
88
94
|
}
|
|
89
95
|
return false;
|
|
90
96
|
}
|
|
91
|
-
exports.isTypeInput = isTypeInput;
|
|
92
97
|
function isTypeScalar(type, schema) {
|
|
93
98
|
if ((0, lodash_1.isString)(type)) {
|
|
94
99
|
const typeName = type;
|
|
@@ -107,11 +112,9 @@ function isTypeScalar(type, schema) {
|
|
|
107
112
|
}
|
|
108
113
|
return false;
|
|
109
114
|
}
|
|
110
|
-
exports.isTypeScalar = isTypeScalar;
|
|
111
115
|
function isFieldId(info) {
|
|
112
116
|
return info.type === 'ID' && info.name === 'id';
|
|
113
117
|
}
|
|
114
|
-
exports.isFieldId = isFieldId;
|
|
115
118
|
function ensureInstantiated(input, ...args) {
|
|
116
119
|
if ((0, lodash_1.isFunction)(input)) {
|
|
117
120
|
try {
|
|
@@ -124,14 +127,12 @@ function ensureInstantiated(input, ...args) {
|
|
|
124
127
|
}
|
|
125
128
|
return input;
|
|
126
129
|
}
|
|
127
|
-
exports.ensureInstantiated = ensureInstantiated;
|
|
128
130
|
function getAclExtension(allowed, denied) {
|
|
129
131
|
return {
|
|
130
132
|
allowedRoles: Array.from(allowed).join(','),
|
|
131
133
|
deniedRoles: Array.from(denied).join(','),
|
|
132
134
|
};
|
|
133
135
|
}
|
|
134
|
-
exports.getAclExtension = getAclExtension;
|
|
135
136
|
function camelize(text) {
|
|
136
137
|
return text.replace(/^([A-Z])|[\s-_]+(\w)/g, function (match, p1, p2) {
|
|
137
138
|
if (p2)
|
|
@@ -139,4 +140,3 @@ function camelize(text) {
|
|
|
139
140
|
return p1.toLowerCase();
|
|
140
141
|
});
|
|
141
142
|
}
|
|
142
|
-
exports.camelize = camelize;
|