@gabroberge/nestjs-dataloader 2.0.0 → 3.0.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/CHANGELOG.md +6 -0
- package/dist/index.js +9 -18
- package/dist/index.mjs +6 -15
- package/package.json +25 -21
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @gabroberge/nestjs-dataloader
|
|
2
2
|
|
|
3
|
+
## 3.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 41e83ac: Raise peer dependencies to **NestJS 11** (`@nestjs/common`, `@nestjs/core`), **`@nestjs/graphql` 13**, and patch bumps for `dataloader` and `rxjs`. Applications still on NestJS 10 or `@nestjs/graphql` 12 must upgrade before installing this release.
|
|
8
|
+
|
|
3
9
|
## 2.0.0
|
|
4
10
|
|
|
5
11
|
### Major Changes
|
package/dist/index.js
CHANGED
|
@@ -18,10 +18,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
20
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
-
var __publicField = (obj, key, value) =>
|
|
22
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
23
|
-
return value;
|
|
24
|
-
};
|
|
21
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
25
22
|
var __async = (__this, __arguments, generator) => {
|
|
26
23
|
return new Promise((resolve, reject) => {
|
|
27
24
|
var fulfilled = (value) => {
|
|
@@ -44,13 +41,13 @@ var __async = (__this, __arguments, generator) => {
|
|
|
44
41
|
};
|
|
45
42
|
|
|
46
43
|
// src/index.ts
|
|
47
|
-
var
|
|
48
|
-
__export(
|
|
44
|
+
var index_exports = {};
|
|
45
|
+
__export(index_exports, {
|
|
49
46
|
Loader: () => Loader,
|
|
50
47
|
NestDataLoader: () => NestDataLoader,
|
|
51
48
|
NestDataLoaderInterceptor: () => NestDataLoaderInterceptor
|
|
52
49
|
});
|
|
53
|
-
module.exports = __toCommonJS(
|
|
50
|
+
module.exports = __toCommonJS(index_exports);
|
|
54
51
|
|
|
55
52
|
// src/loader.decorator.ts
|
|
56
53
|
var import_common2 = require("@nestjs/common");
|
|
@@ -66,18 +63,13 @@ var import_core = require("@nestjs/core");
|
|
|
66
63
|
var import_graphql = require("@nestjs/graphql");
|
|
67
64
|
function _ts_decorate(decorators, target, key, desc) {
|
|
68
65
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
69
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
70
|
-
|
|
71
|
-
else
|
|
72
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
73
|
-
if (d = decorators[i])
|
|
74
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
66
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
67
|
+
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;
|
|
75
68
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
76
69
|
}
|
|
77
70
|
__name(_ts_decorate, "_ts_decorate");
|
|
78
71
|
function _ts_metadata(k, v) {
|
|
79
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
80
|
-
return Reflect.metadata(k, v);
|
|
72
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
81
73
|
}
|
|
82
74
|
__name(_ts_metadata, "_ts_metadata");
|
|
83
75
|
var _NestDataLoaderInterceptor = class _NestDataLoaderInterceptor {
|
|
@@ -121,12 +113,11 @@ NestDataLoaderInterceptor = _ts_decorate([
|
|
|
121
113
|
], NestDataLoaderInterceptor);
|
|
122
114
|
|
|
123
115
|
// src/loader.decorator.ts
|
|
124
|
-
var Loader = (0, import_common2.createParamDecorator)((data, context) => __async(
|
|
116
|
+
var Loader = (0, import_common2.createParamDecorator)((data, context) => __async(null, null, function* () {
|
|
125
117
|
const gqlExecutionContext = import_graphql2.GqlExecutionContext.create(context);
|
|
126
118
|
const injectionContext = gqlExecutionContext.getContext();
|
|
127
119
|
const loaderContext = injectionContext[NEST_LOADER_CONTEXT_KEY];
|
|
128
|
-
if (loaderContext !== void 0)
|
|
129
|
-
return loaderContext.getLoader(data);
|
|
120
|
+
if (loaderContext !== void 0) return loaderContext.getLoader(data);
|
|
130
121
|
throw new import_common2.InternalServerErrorException(`You should provide interceptor ${NestDataLoaderInterceptor.name} globally with ${import_core2.APP_INTERCEPTOR}`);
|
|
131
122
|
}));
|
|
132
123
|
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
4
|
-
var __publicField = (obj, key, value) =>
|
|
5
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
6
|
-
return value;
|
|
7
|
-
};
|
|
4
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
8
5
|
var __async = (__this, __arguments, generator) => {
|
|
9
6
|
return new Promise((resolve, reject) => {
|
|
10
7
|
var fulfilled = (value) => {
|
|
@@ -40,18 +37,13 @@ import { ContextIdFactory, ModuleRef } from "@nestjs/core";
|
|
|
40
37
|
import { GqlExecutionContext } from "@nestjs/graphql";
|
|
41
38
|
function _ts_decorate(decorators, target, key, desc) {
|
|
42
39
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
43
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
44
|
-
|
|
45
|
-
else
|
|
46
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
|
47
|
-
if (d = decorators[i])
|
|
48
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
40
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
41
|
+
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;
|
|
49
42
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
50
43
|
}
|
|
51
44
|
__name(_ts_decorate, "_ts_decorate");
|
|
52
45
|
function _ts_metadata(k, v) {
|
|
53
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
54
|
-
return Reflect.metadata(k, v);
|
|
46
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
55
47
|
}
|
|
56
48
|
__name(_ts_metadata, "_ts_metadata");
|
|
57
49
|
var _NestDataLoaderInterceptor = class _NestDataLoaderInterceptor {
|
|
@@ -95,12 +87,11 @@ NestDataLoaderInterceptor = _ts_decorate([
|
|
|
95
87
|
], NestDataLoaderInterceptor);
|
|
96
88
|
|
|
97
89
|
// src/loader.decorator.ts
|
|
98
|
-
var Loader = createParamDecorator((data, context) => __async(
|
|
90
|
+
var Loader = createParamDecorator((data, context) => __async(null, null, function* () {
|
|
99
91
|
const gqlExecutionContext = GqlExecutionContext2.create(context);
|
|
100
92
|
const injectionContext = gqlExecutionContext.getContext();
|
|
101
93
|
const loaderContext = injectionContext[NEST_LOADER_CONTEXT_KEY];
|
|
102
|
-
if (loaderContext !== void 0)
|
|
103
|
-
return loaderContext.getLoader(data);
|
|
94
|
+
if (loaderContext !== void 0) return loaderContext.getLoader(data);
|
|
104
95
|
throw new InternalServerErrorException(`You should provide interceptor ${NestDataLoaderInterceptor.name} globally with ${APP_INTERCEPTOR}`);
|
|
105
96
|
}));
|
|
106
97
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gabroberge/nestjs-dataloader",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "A NestJS decorator for dataloader",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -25,33 +25,37 @@
|
|
|
25
25
|
},
|
|
26
26
|
"homepage": "https://github.com/gabroberge/nestjs-dataloader#readme",
|
|
27
27
|
"bugs": "https://github.com/gabroberge/nestjs-dataloader/issues",
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": ">=20.12.0"
|
|
30
|
+
},
|
|
28
31
|
"peerDependencies": {
|
|
29
|
-
"@nestjs/common": "^
|
|
30
|
-
"@nestjs/core": "^
|
|
31
|
-
"@nestjs/graphql": "^
|
|
32
|
-
"dataloader": "^2.2.
|
|
33
|
-
"rxjs": "^7.8.
|
|
32
|
+
"@nestjs/common": "^11.1.19",
|
|
33
|
+
"@nestjs/core": "^11.1.19",
|
|
34
|
+
"@nestjs/graphql": "^13.4.0",
|
|
35
|
+
"dataloader": "^2.2.3",
|
|
36
|
+
"rxjs": "^7.8.2"
|
|
34
37
|
},
|
|
35
38
|
"devDependencies": {
|
|
36
|
-
"@changesets/cli": "^2.
|
|
37
|
-
"@nestjs/common": "^
|
|
38
|
-
"@nestjs/core": "^
|
|
39
|
-
"@nestjs/graphql": "^
|
|
40
|
-
"@nestjs/testing": "^
|
|
41
|
-
"@types/node": "^
|
|
42
|
-
"dataloader": "^2.2.
|
|
43
|
-
"husky": "^
|
|
44
|
-
"prettier": "^3.
|
|
45
|
-
"rxjs": "^7.8.
|
|
46
|
-
"tsup": "^8.
|
|
47
|
-
"typescript": "^
|
|
48
|
-
"unplugin-swc": "^1.
|
|
49
|
-
"
|
|
39
|
+
"@changesets/cli": "^2.31.0",
|
|
40
|
+
"@nestjs/common": "^11.1.19",
|
|
41
|
+
"@nestjs/core": "^11.1.19",
|
|
42
|
+
"@nestjs/graphql": "^13.4.0",
|
|
43
|
+
"@nestjs/testing": "^11.1.19",
|
|
44
|
+
"@types/node": "^25.7.0",
|
|
45
|
+
"dataloader": "^2.2.3",
|
|
46
|
+
"husky": "^9.1.7",
|
|
47
|
+
"prettier": "^3.8.3",
|
|
48
|
+
"rxjs": "^7.8.2",
|
|
49
|
+
"tsup": "^8.5.1",
|
|
50
|
+
"typescript": "^6.0.3",
|
|
51
|
+
"unplugin-swc": "^1.5.9",
|
|
52
|
+
"vite": "^8.0.12",
|
|
53
|
+
"vitest": "^4.1.6"
|
|
50
54
|
},
|
|
51
55
|
"scripts": {
|
|
52
56
|
"dev": "vitest",
|
|
53
57
|
"test": "vitest run",
|
|
54
|
-
"build": "tsup
|
|
58
|
+
"build": "tsup",
|
|
55
59
|
"format": "prettier --write \"src/**/*.ts\" \"tests/**/*.spec.ts\"",
|
|
56
60
|
"lint": "tsc",
|
|
57
61
|
"ci": "pnpm lint && pnpm test && pnpm build",
|