@nest-boot/graphql 7.0.0-beta.4 → 7.0.0-beta.5

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.
Files changed (43) hide show
  1. package/dist/graphql-module-options.interface.d.ts +2 -0
  2. package/dist/graphql-module-options.interface.js.map +1 -0
  3. package/dist/graphql.module-definition.d.ts +1 -2
  4. package/dist/graphql.module.js +3 -22
  5. package/dist/graphql.module.js.map +1 -1
  6. package/dist/index.d.ts +0 -6
  7. package/dist/index.js +1 -8
  8. package/dist/index.js.map +1 -1
  9. package/dist/tsconfig.build.tsbuildinfo +1 -1
  10. package/package.json +1 -16
  11. package/dist/complexities/connection.complexity.d.ts +0 -2
  12. package/dist/complexities/connection.complexity.js +0 -9
  13. package/dist/complexities/connection.complexity.js.map +0 -1
  14. package/dist/complexities/index.d.ts +0 -1
  15. package/dist/complexities/index.js +0 -18
  16. package/dist/complexities/index.js.map +0 -1
  17. package/dist/decorators/complexity.decorator.d.ts +0 -5
  18. package/dist/decorators/complexity.decorator.js +0 -8
  19. package/dist/decorators/complexity.decorator.js.map +0 -1
  20. package/dist/decorators/index.d.ts +0 -1
  21. package/dist/decorators/index.js +0 -18
  22. package/dist/decorators/index.js.map +0 -1
  23. package/dist/interfaces/cost-response.interface.d.ts +0 -10
  24. package/dist/interfaces/cost-response.interface.js +0 -3
  25. package/dist/interfaces/cost-response.interface.js.map +0 -1
  26. package/dist/interfaces/edge.interface.d.ts +0 -4
  27. package/dist/interfaces/edge.interface.js +0 -3
  28. package/dist/interfaces/edge.interface.js.map +0 -1
  29. package/dist/interfaces/graphql-module-options.interface.d.ts +0 -21
  30. package/dist/interfaces/graphql-module-options.interface.js.map +0 -1
  31. package/dist/interfaces/index.d.ts +0 -3
  32. package/dist/interfaces/index.js +0 -20
  33. package/dist/interfaces/index.js.map +0 -1
  34. package/dist/plugins/complexity.plugin.d.ts +0 -21
  35. package/dist/plugins/complexity.plugin.js +0 -246
  36. package/dist/plugins/complexity.plugin.js.map +0 -1
  37. package/dist/plugins/index.d.ts +0 -1
  38. package/dist/plugins/index.js +0 -18
  39. package/dist/plugins/index.js.map +0 -1
  40. package/dist/plugins/logging.plugin.d.ts +0 -7
  41. package/dist/plugins/logging.plugin.js +0 -48
  42. package/dist/plugins/logging.plugin.js.map +0 -1
  43. /package/dist/{interfaces/graphql-module-options.interface.js → graphql-module-options.interface.js} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nest-boot/graphql",
3
- "version": "7.0.0-beta.4",
3
+ "version": "7.0.0-beta.5",
4
4
  "description": "",
5
5
  "author": "d4rkcr0w <me@d4rkcr0w.com>",
6
6
  "homepage": "",
@@ -13,13 +13,7 @@
13
13
  "files": [
14
14
  "dist"
15
15
  ],
16
- "dependencies": {
17
- "@apollo/server": "^4.12.2",
18
- "graphql-query-complexity": "^1.1.0",
19
- "lodash": "^4.17.21"
20
- },
21
16
  "devDependencies": {
22
- "@mikro-orm/core": "^6.5.8",
23
17
  "@nest-boot/eslint-config": "^7.0.0-beta.1",
24
18
  "@nest-boot/eslint-plugin": "^7.0.0-beta.1",
25
19
  "@nestjs/apollo": "^13.1.0",
@@ -29,13 +23,10 @@
29
23
  "@nestjs/testing": "^11.1.6",
30
24
  "@types/express": "^5.0.3",
31
25
  "@types/jest": "^29.5.14",
32
- "@types/lodash": "^4.17.20",
33
26
  "@types/node": "^22.18.6",
34
- "dataloader": "^2.2.3",
35
27
  "eslint": "^9.36.0",
36
28
  "express": "^5.1.0",
37
29
  "graphql": "^16.11.0",
38
- "ioredis": "^5.8.0",
39
30
  "jest": "^29.7.0",
40
31
  "reflect-metadata": "^0.2.2",
41
32
  "rxjs": "^7.8.2",
@@ -43,19 +34,13 @@
43
34
  "typescript": "^5.9.2",
44
35
  "@nest-boot/tsconfig": "7.0.0-beta.0"
45
36
  },
46
- "optionalDependencies": {
47
- "@nest-boot/logger": "^7.0.0-beta.2"
48
- },
49
37
  "peerDependencies": {
50
- "@mikro-orm/core": "^6.0.0",
51
38
  "@nestjs/apollo": "^12.0.0",
52
39
  "@nestjs/common": "^11.0.0",
53
40
  "@nestjs/core": "^11.0.0",
54
41
  "@nestjs/graphql": "^13.0.0",
55
- "dataloader": "^2.0.0",
56
42
  "express": "^5.0.0",
57
43
  "graphql": "^16.0.0",
58
- "ioredis": "^5.3.2",
59
44
  "reflect-metadata": "^0.2.2",
60
45
  "rxjs": "^7.0.0"
61
46
  },
@@ -1,2 +0,0 @@
1
- import { type Complexity } from "@nestjs/graphql";
2
- export declare const connectionComplexity: Complexity;
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.connectionComplexity = void 0;
4
- const connectionComplexity = (options) => {
5
- return (Number(options.args.first ?? options.args.last ?? 1) *
6
- options.childComplexity);
7
- };
8
- exports.connectionComplexity = connectionComplexity;
9
- //# sourceMappingURL=connection.complexity.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"connection.complexity.js","sourceRoot":"","sources":["../../src/complexities/connection.complexity.ts"],"names":[],"mappings":";;;AAEO,MAAM,oBAAoB,GAAe,CAC9C,OAAgC,EAChC,EAAE;IACF,OAAO,CACL,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC;QACpD,OAAO,CAAC,eAAe,CACxB,CAAC;AACJ,CAAC,CAAC;AAPW,QAAA,oBAAoB,wBAO/B"}
@@ -1 +0,0 @@
1
- export * from "./connection.complexity";
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./connection.complexity"), exports);
18
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/complexities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC"}
@@ -1,5 +0,0 @@
1
- export interface ComplexityOptions {
2
- value?: number;
3
- multipliers?: string[];
4
- }
5
- export declare function Complexity(options: ComplexityOptions): MethodDecorator & PropertyDecorator & ClassDecorator;
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Complexity = Complexity;
4
- const graphql_1 = require("@nestjs/graphql");
5
- function Complexity(options) {
6
- return (0, graphql_1.Directive)(`@complexity(value: ${String(options.value ?? 1)}, multipliers: ${JSON.stringify(options.multipliers ?? [])})`);
7
- }
8
- //# sourceMappingURL=complexity.decorator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"complexity.decorator.js","sourceRoot":"","sources":["../../src/decorators/complexity.decorator.ts"],"names":[],"mappings":";;AAOA,gCAQC;AAfD,6CAA4C;AAO5C,SAAgB,UAAU,CACxB,OAA0B;IAE1B,OAAO,IAAA,mBAAS,EACd,sBAAsB,MAAM,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC,CAAC,kBAAkB,IAAI,CAAC,SAAS,CAC9E,OAAO,CAAC,WAAW,IAAI,EAAE,CAC1B,GAAG,CACL,CAAC;AACJ,CAAC"}
@@ -1 +0,0 @@
1
- export * from "./complexity.decorator";
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./complexity.decorator"), exports);
18
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/decorators/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC"}
@@ -1,10 +0,0 @@
1
- export interface CostThrottleStatus {
2
- maximumAvailable: number;
3
- currentlyAvailable: number;
4
- restoreRate: number;
5
- }
6
- export interface CostResponse {
7
- requestedQueryCost: number;
8
- actualQueryCost: number;
9
- throttleStatus?: CostThrottleStatus;
10
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=cost-response.interface.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cost-response.interface.js","sourceRoot":"","sources":["../../src/interfaces/cost-response.interface.ts"],"names":[],"mappings":""}
@@ -1,4 +0,0 @@
1
- export interface EdgeInterface<T> {
2
- node: T;
3
- cursor: string;
4
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=edge.interface.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"edge.interface.js","sourceRoot":"","sources":["../../src/interfaces/edge.interface.ts"],"names":[],"mappings":""}
@@ -1,21 +0,0 @@
1
- import { BaseContext, GraphQLRequestContext } from "@apollo/server";
2
- import { type ApolloDriverConfig } from "@nestjs/apollo";
3
- import { type GraphQLWsSubscriptionsConfig } from "@nestjs/graphql";
4
- import { RedisOptions } from "ioredis";
5
- export interface GraphQLModuleComplexityRateLimitOptions {
6
- connection?: RedisOptions;
7
- keyPrefix?: string;
8
- restoreRate?: number;
9
- maximumAvailable?: number;
10
- getId?: (args: GraphQLRequestContext<BaseContext>) => string;
11
- }
12
- export interface GraphQLModuleComplexityOptions {
13
- maxComplexity?: number;
14
- defaultComplexity?: number;
15
- rateLimit?: GraphQLModuleComplexityRateLimitOptions;
16
- }
17
- export interface GraphQLModuleOptions extends Omit<ApolloDriverConfig, "playground" | "subscriptions"> {
18
- playground?: boolean;
19
- subscriptions?: GraphQLWsSubscriptionsConfig;
20
- complexity?: GraphQLModuleComplexityOptions;
21
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"graphql-module-options.interface.js","sourceRoot":"","sources":["../../src/interfaces/graphql-module-options.interface.ts"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- export * from "./cost-response.interface";
2
- export * from "./edge.interface";
3
- export * from "./graphql-module-options.interface";
@@ -1,20 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./cost-response.interface"), exports);
18
- __exportStar(require("./edge.interface"), exports);
19
- __exportStar(require("./graphql-module-options.interface"), exports);
20
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAA0C;AAC1C,mDAAiC;AACjC,qEAAmD"}
@@ -1,21 +0,0 @@
1
- import { type ApolloServerPlugin, type BaseContext, GraphQLRequestContext, type GraphQLRequestListener } from "@apollo/server";
2
- import { OnApplicationShutdown } from "@nestjs/common";
3
- import { GraphQLSchemaHost } from "@nestjs/graphql";
4
- import { GraphQLModuleOptions } from "../interfaces";
5
- export declare class ComplexityPlugin implements ApolloServerPlugin, OnApplicationShutdown {
6
- private readonly options;
7
- private readonly gqlSchemaHost;
8
- private readonly complexityEstimators;
9
- private readonly maxComplexity;
10
- private readonly defaultComplexity;
11
- private readonly rateLimitRedis?;
12
- private readonly rateLimitKeyPrefix;
13
- private readonly rateLimitRestoreRate;
14
- private readonly rateLimitMaximumAvailable;
15
- private readonly rateLimitGetId;
16
- constructor(options: GraphQLModuleOptions, gqlSchemaHost: GraphQLSchemaHost);
17
- addPoint(args: GraphQLRequestContext<BaseContext>, point: number): Promise<[boolean, number]>;
18
- subPoint(args: GraphQLRequestContext<BaseContext>, point: number): Promise<[boolean, number]>;
19
- requestDidStart(): Promise<GraphQLRequestListener<BaseContext>>;
20
- onApplicationShutdown(): Promise<void>;
21
- }
@@ -1,246 +0,0 @@
1
- "use strict";
2
- /* eslint-disable @typescript-eslint/require-await */
3
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
4
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
5
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
6
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
7
- return c > 3 && r && Object.defineProperty(target, key, r), r;
8
- };
9
- var __metadata = (this && this.__metadata) || function (k, v) {
10
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
11
- };
12
- var __param = (this && this.__param) || function (paramIndex, decorator) {
13
- return function (target, key) { decorator(target, key, paramIndex); }
14
- };
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.ComplexityPlugin = void 0;
17
- const apollo_1 = require("@nestjs/apollo");
18
- const common_1 = require("@nestjs/common");
19
- const graphql_1 = require("@nestjs/graphql");
20
- const graphql_2 = require("graphql");
21
- const graphql_query_complexity_1 = require("graphql-query-complexity");
22
- const ioredis_1 = require("ioredis");
23
- const graphql_module_definition_1 = require("../graphql.module-definition");
24
- // https://shopify.engineering/rate-limiting-graphql-apis-calculating-query-complexity
25
- function shopifyEstimator(args, type) {
26
- type = type ?? args.field.type;
27
- if (type instanceof graphql_2.GraphQLNonNull || type instanceof graphql_2.GraphQLList) {
28
- return shopifyEstimator(args, type.ofType);
29
- }
30
- // GraphQL 的 Connection 表示的是一对多的关系,Connection 的消耗是两点加上要返回的对象数量。
31
- if (type instanceof graphql_2.GraphQLObjectType && type.name.endsWith("Connection")) {
32
- return 2 + args.childComplexity * (args.args.first ?? args.args.last ?? 0);
33
- }
34
- // Object 是查询的基本单位,一般代码一个单次的 server 端操作,可以是一次数据库查询,也可以一次内部服务的访问。
35
- // Interface 和 Union 和 Object 类似,只不过是能返回不同类型的 object,所以算一点。
36
- if (type instanceof graphql_2.GraphQLObjectType ||
37
- type instanceof graphql_2.GraphQLInterfaceType ||
38
- type instanceof graphql_2.GraphQLUnionType) {
39
- return 1 + args.childComplexity;
40
- }
41
- // Scalar 和 Enum 是 Object 本身的一部分,在 Object 里我们已经算过消耗了。
42
- // Scalar 和 Enum 其实就是 Object 上的某个字段,一个 Object 上多返回几个字段消耗是比较少的。
43
- if (type instanceof graphql_2.GraphQLScalarType || type instanceof graphql_2.GraphQLEnumType) {
44
- return 0;
45
- }
46
- }
47
- const REDIS_GRAPHQL_COMPLEXITY_RATE_LIMIT_COMMAND_NAME = "GRAPHQL_COMPLEXITY.RATE_LIMIT";
48
- let ComplexityPlugin = class ComplexityPlugin {
49
- constructor(options, gqlSchemaHost) {
50
- this.options = options;
51
- this.gqlSchemaHost = gqlSchemaHost;
52
- this.complexityEstimators = [];
53
- this.maxComplexity = 1000;
54
- this.defaultComplexity = 0;
55
- this.rateLimitKeyPrefix = "graphql-complexity:rate-limit";
56
- this.rateLimitRestoreRate = 50;
57
- this.rateLimitMaximumAvailable = 1000;
58
- this.rateLimitGetId = (args) => {
59
- const req = args.contextValue.req;
60
- return req.ips.length ? req.ips[0] : req.ip;
61
- };
62
- if (typeof options.complexity !== "undefined") {
63
- this.maxComplexity =
64
- options.complexity.maxComplexity ?? this.maxComplexity;
65
- this.defaultComplexity =
66
- options.complexity.defaultComplexity ?? this.defaultComplexity;
67
- if (typeof options.complexity.rateLimit !== "undefined") {
68
- this.rateLimitRedis =
69
- typeof options.complexity.rateLimit.connection !== "undefined"
70
- ? new ioredis_1.Redis(options.complexity.rateLimit.connection)
71
- : new ioredis_1.Redis();
72
- this.rateLimitKeyPrefix =
73
- options.complexity.rateLimit.keyPrefix ?? this.rateLimitKeyPrefix;
74
- this.rateLimitRestoreRate =
75
- options.complexity.rateLimit.restoreRate ?? this.rateLimitRestoreRate;
76
- this.rateLimitMaximumAvailable =
77
- options.complexity.rateLimit.maximumAvailable ??
78
- this.rateLimitMaximumAvailable;
79
- this.rateLimitGetId =
80
- options.complexity.rateLimit.getId ?? this.rateLimitGetId;
81
- }
82
- }
83
- if (typeof this.rateLimitRedis !== "undefined") {
84
- this.rateLimitRedis.defineCommand(REDIS_GRAPHQL_COMPLEXITY_RATE_LIMIT_COMMAND_NAME, {
85
- numberOfKeys: 5,
86
- lua: /* lua */ `
87
- -- 获取当前时间戳
88
- local currentTimestamp = redis.call("TIME")[1]
89
-
90
- -- 获取参数
91
- local bucketKeyPrefix = KEYS[1]
92
- local maximumAvailable = tonumber(KEYS[2])
93
- local restoreRate = tonumber(KEYS[3])
94
- local id = KEYS[4]
95
- local complexity = tonumber(KEYS[5])
96
-
97
- -- 定义存储桶的键
98
- local bucketKey = bucketKeyPrefix .. ":" .. id
99
-
100
- local keyExpireSeconds = math.ceil(maximumAvailable / restoreRate)
101
-
102
- -- 获取存储桶中当前的令牌数量,如果不存在,则设置为最大可用令牌数
103
- local currentlyAvailable = redis.call("HGET", bucketKey, "currentlyAvailable")
104
- if not currentlyAvailable then
105
- currentlyAvailable = maximumAvailable
106
- end
107
-
108
- -- 如果存储桶为空,设置上次更新时间戳为当前时间戳
109
- local updatedTimestamp = redis.call("HGET", bucketKey, "updatedTimestamp")
110
- if not updatedTimestamp then
111
- updatedTimestamp = currentTimestamp
112
- end
113
-
114
- -- 更新上次更新的时间戳
115
- redis.call("HSET", bucketKey, "updatedTimestamp", currentTimestamp)
116
-
117
- -- 更新存储桶的过期时间
118
- redis.call("EXPIRE", bucketKey, keyExpireSeconds)
119
-
120
- -- 计算自上次更新以来要恢复的令牌数量,并恢复存储桶中的令牌数量
121
- local intervalSeconds = currentTimestamp - updatedTimestamp;
122
- if intervalSeconds > 0 then
123
- currentlyAvailable = math.min((restoreRate * intervalSeconds) + currentlyAvailable, maximumAvailable);
124
- redis.call("HSET", bucketKey, "currentlyAvailable", currentlyAvailable)
125
- end
126
-
127
- -- 检查是否有足够的令牌供扣减,如果有,则扣减并返回剩余令牌数
128
- local newCurrentlyAvailable = currentlyAvailable - complexity
129
- if newCurrentlyAvailable >= 0 then
130
- currentlyAvailable = newCurrentlyAvailable
131
- redis.call("HSET", bucketKey, "currentlyAvailable", currentlyAvailable)
132
- return { false, currentlyAvailable };
133
- end
134
-
135
- return { true, currentlyAvailable }
136
- `,
137
- });
138
- }
139
- this.complexityEstimators = [
140
- (0, graphql_query_complexity_1.directiveEstimator)(),
141
- (0, graphql_query_complexity_1.fieldExtensionsEstimator)(),
142
- shopifyEstimator,
143
- (0, graphql_query_complexity_1.simpleEstimator)({ defaultComplexity: this.defaultComplexity }),
144
- ];
145
- }
146
- async addPoint(args, point) {
147
- if (typeof this.rateLimitRedis === "undefined") {
148
- throw new Error("Redis is not defined");
149
- }
150
- return (await this.rateLimitRedis[REDIS_GRAPHQL_COMPLEXITY_RATE_LIMIT_COMMAND_NAME](this.rateLimitKeyPrefix, this.rateLimitMaximumAvailable, this.rateLimitRestoreRate, this.rateLimitGetId(args), -point));
151
- }
152
- async subPoint(args, point) {
153
- if (typeof this.rateLimitRedis === "undefined") {
154
- throw new Error("Redis is not defined");
155
- }
156
- return (await this.rateLimitRedis[REDIS_GRAPHQL_COMPLEXITY_RATE_LIMIT_COMMAND_NAME](this.rateLimitKeyPrefix, this.rateLimitMaximumAvailable, this.rateLimitRestoreRate, this.rateLimitGetId(args), point));
157
- }
158
- async requestDidStart() {
159
- const { schema } = this.gqlSchemaHost;
160
- const cost = {
161
- requestedQueryCost: 0,
162
- actualQueryCost: 0,
163
- };
164
- return {
165
- didResolveOperation: async (args) => {
166
- const { request, document } = args;
167
- cost.requestedQueryCost = (0, graphql_query_complexity_1.getComplexity)({
168
- schema,
169
- operationName: request.operationName,
170
- query: document,
171
- variables: request.variables,
172
- estimators: this.complexityEstimators,
173
- });
174
- if (cost.requestedQueryCost >= this.maxComplexity) {
175
- throw new common_1.HttpException(`Query is too complex: ${String(cost.requestedQueryCost)}. Maximum allowed complexity: ${String(this.maxComplexity)}`, 429);
176
- }
177
- if (typeof this.rateLimitRedis !== "undefined") {
178
- const [blocked, currentlyAvailable] = await this.subPoint(args, cost.requestedQueryCost);
179
- cost.throttleStatus = {
180
- maximumAvailable: this.rateLimitMaximumAvailable,
181
- currentlyAvailable,
182
- restoreRate: this.rateLimitRestoreRate,
183
- };
184
- if (blocked) {
185
- throw new common_1.HttpException(`Too Many Requests`, 429);
186
- }
187
- }
188
- },
189
- executionDidStart: async () => {
190
- return {
191
- willResolveField: ({ info }) => {
192
- const parentTypeFields = info.parentType.getFields();
193
- const field = parentTypeFields[info.fieldName];
194
- const estimatorArgs = {
195
- childComplexity: 0,
196
- args: {},
197
- field,
198
- node: info.fieldNodes[0],
199
- type: info.parentType,
200
- };
201
- return (error) => {
202
- if (error === null) {
203
- // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
204
- let fieldCost;
205
- for (const complexityEstimator of this.complexityEstimators) {
206
- fieldCost = complexityEstimator(estimatorArgs);
207
- if (typeof fieldCost === "number" && !isNaN(fieldCost)) {
208
- cost.actualQueryCost += fieldCost;
209
- break;
210
- }
211
- }
212
- }
213
- };
214
- },
215
- };
216
- },
217
- willSendResponse: async (request) => {
218
- if (request.response.body.kind === "single" &&
219
- "data" in request.response.body.singleResult) {
220
- if (typeof this.rateLimitRedis !== "undefined") {
221
- const [, currentlyAvailable] = await this.addPoint(request, cost.requestedQueryCost - cost.actualQueryCost);
222
- cost.throttleStatus = {
223
- maximumAvailable: this.rateLimitMaximumAvailable,
224
- currentlyAvailable,
225
- restoreRate: this.rateLimitRestoreRate,
226
- };
227
- }
228
- request.response.body.singleResult.extensions = {
229
- ...request.response.body.singleResult.extensions,
230
- cost,
231
- };
232
- }
233
- },
234
- };
235
- }
236
- async onApplicationShutdown() {
237
- await this.rateLimitRedis?.quit();
238
- }
239
- };
240
- exports.ComplexityPlugin = ComplexityPlugin;
241
- exports.ComplexityPlugin = ComplexityPlugin = __decorate([
242
- (0, apollo_1.Plugin)(),
243
- __param(0, (0, common_1.Inject)(graphql_module_definition_1.MODULE_OPTIONS_TOKEN)),
244
- __metadata("design:paramtypes", [Object, graphql_1.GraphQLSchemaHost])
245
- ], ComplexityPlugin);
246
- //# sourceMappingURL=complexity.plugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"complexity.plugin.js","sourceRoot":"","sources":["../../src/plugins/complexity.plugin.ts"],"names":[],"mappings":";AAAA,qDAAqD;;;;;;;;;;;;;;;AAQrD,2CAAwC;AACxC,2CAA8E;AAC9E,6CAA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MAAM,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,EAC5C,CAAC;oBACD,IAAI,OAAO,IAAI,CAAC,cAAc,KAAK,WAAW,EAAE,CAAC;wBAC/C,MAAM,CAAC,EAAE,kBAAkB,CAAC,GAAG,MAAM,IAAI,CAAC,QAAQ,CAChD,OAAO,EACP,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,eAAe,CAC/C,CAAC;wBAEF,IAAI,CAAC,cAAc,GAAG;4BACpB,gBAAgB,EAAE,IAAI,CAAC,yBAAyB;4BAChD,kBAAkB;4BAClB,WAAW,EAAE,IAAI,CAAC,oBAAoB;yBACvC,CAAC;oBACJ,CAAC;oBAED,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,GAAG;wBAC9C,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU;wBAChD,IAAI;qBACL,CAAC;gBACJ,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,qBAAqB;QACzB,MAAM,IAAI,CAAC,cAAc,EAAE,IAAI,EAAE,CAAC;IACpC,CAAC;CACF,CAAA;AArQY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,eAAM,GAAE;IAsBJ,WAAA,IAAA,eAAM,EAAC,gDAAoB,CAAC,CAAA;6CAEG,2BAAiB;GAvBxC,gBAAgB,CAqQ5B"}
@@ -1 +0,0 @@
1
- export * from "./complexity.plugin";
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./complexity.plugin"), exports);
18
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC"}
@@ -1,7 +0,0 @@
1
- import { type ApolloServerPlugin, type BaseContext, type GraphQLRequestListener } from "@apollo/server";
2
- import { Logger } from "@nest-boot/logger";
3
- export declare class LoggingPlugin implements ApolloServerPlugin {
4
- private readonly logger?;
5
- constructor(logger?: Logger | undefined);
6
- requestDidStart(): Promise<GraphQLRequestListener<BaseContext>>;
7
- }
@@ -1,48 +0,0 @@
1
- "use strict";
2
- /* eslint-disable @typescript-eslint/require-await */
3
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
4
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
5
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
6
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
7
- return c > 3 && r && Object.defineProperty(target, key, r), r;
8
- };
9
- var __metadata = (this && this.__metadata) || function (k, v) {
10
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
11
- };
12
- var __param = (this && this.__param) || function (paramIndex, decorator) {
13
- return function (target, key) { decorator(target, key, paramIndex); }
14
- };
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.LoggingPlugin = void 0;
17
- const logger_1 = require("@nest-boot/logger");
18
- const apollo_1 = require("@nestjs/apollo");
19
- const common_1 = require("@nestjs/common");
20
- let LoggingPlugin = class LoggingPlugin {
21
- constructor(logger) {
22
- this.logger = logger;
23
- }
24
- async requestDidStart() {
25
- const logger = this.logger;
26
- if (typeof logger !== "undefined") {
27
- return {
28
- didResolveOperation: async (ctx) => {
29
- logger.assign({
30
- operation: {
31
- id: ctx.queryHash,
32
- name: ctx.operationName,
33
- type: ctx.operation?.operation,
34
- },
35
- });
36
- },
37
- };
38
- }
39
- return {};
40
- }
41
- };
42
- exports.LoggingPlugin = LoggingPlugin;
43
- exports.LoggingPlugin = LoggingPlugin = __decorate([
44
- (0, apollo_1.Plugin)(),
45
- __param(0, (0, common_1.Optional)()),
46
- __metadata("design:paramtypes", [logger_1.Logger])
47
- ], LoggingPlugin);
48
- //# sourceMappingURL=logging.plugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logging.plugin.js","sourceRoot":"","sources":["../../src/plugins/logging.plugin.ts"],"names":[],"mappings":";AAAA,qDAAqD;;;;;;;;;;;;;;;AAOrD,8CAA2C;AAC3C,2CAAwC;AACxC,2CAA0C;AAGnC,IAAM,aAAa,GAAnB,MAAM,aAAa;IACxB,YAEmB,MAAe;QAAf,WAAM,GAAN,MAAM,CAAS;IAC/B,CAAC;IAEJ,KAAK,CAAC,eAAe;QACnB,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAE3B,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;YAClC,OAAO;gBACL,mBAAmB,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE;oBACjC,MAAM,CAAC,MAAM,CAAC;wBACZ,SAAS,EAAE;4BACT,EAAE,EAAE,GAAG,CAAC,SAAS;4BACjB,IAAI,EAAE,GAAG,CAAC,aAAa;4BACvB,IAAI,EAAE,GAAG,CAAC,SAAS,EAAE,SAAS;yBAC/B;qBACF,CAAC,CAAC;gBACL,CAAC;aACF,CAAC;QACJ,CAAC;QAED,OAAO,EAAE,CAAC;IACZ,CAAC;CACF,CAAA;AAzBY,sCAAa;wBAAb,aAAa;IADzB,IAAA,eAAM,GAAE;IAGJ,WAAA,IAAA,iBAAQ,GAAE,CAAA;qCACe,eAAM;GAHvB,aAAa,CAyBzB"}