ts-cache-mongoose 1.6.0 → 1.6.2
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/README.md +17 -17
- package/dist/cjs/types/extend/aggregate.d.ts +1 -0
- package/dist/cjs/types/extend/aggregate.d.ts.map +1 -1
- package/dist/cjs/types/extend/query.d.ts +1 -0
- package/dist/cjs/types/extend/query.d.ts.map +1 -1
- package/dist/cjs/types/plugin.d.ts +1 -0
- package/dist/cjs/types/plugin.d.ts.map +1 -1
- package/dist/esm/types/extend/aggregate.d.ts +1 -0
- package/dist/esm/types/extend/aggregate.d.ts.map +1 -1
- package/dist/esm/types/extend/query.d.ts +1 -0
- package/dist/esm/types/extend/query.d.ts.map +1 -1
- package/dist/esm/types/plugin.d.ts +1 -0
- package/dist/esm/types/plugin.d.ts.map +1 -1
- package/package.json +13 -12
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@ Caching queries is a good way to improve performance of your application
|
|
|
26
26
|
```json
|
|
27
27
|
{
|
|
28
28
|
"node": "18.x || 20.x || 22.x",
|
|
29
|
-
"mongoose": "6.6.x || 7.x || 8.x",
|
|
29
|
+
"mongoose": ">=6.6.x || 7.x || 8.x",
|
|
30
30
|
}
|
|
31
31
|
```
|
|
32
32
|
|
|
@@ -53,24 +53,24 @@ pnpm add ts-cache-mongoose
|
|
|
53
53
|
bun add ts-cache-mongoose
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
-
- This plugin requires mongoose
|
|
56
|
+
- This plugin requires mongoose `>=6.6.x || 7.x || 8.x` to be installed as a peer dependency
|
|
57
57
|
|
|
58
58
|
```bash
|
|
59
|
-
# For mongoose 6
|
|
60
|
-
npm install mongoose@6
|
|
61
|
-
yarn add mongoose@6
|
|
62
|
-
pnpm add mongoose@6
|
|
63
|
-
bun add mongoose@6
|
|
64
|
-
# For mongoose 7
|
|
65
|
-
npm install mongoose@7
|
|
66
|
-
yarn add mongoose@7
|
|
67
|
-
pnpm add mongoose@7
|
|
68
|
-
bun add mongoose@7
|
|
69
|
-
# For mongoose 8
|
|
70
|
-
npm install mongoose@8
|
|
71
|
-
yarn add mongoose@8
|
|
72
|
-
pnpm add mongoose@8
|
|
73
|
-
bun add mongoose@8
|
|
59
|
+
# For latest mongoose 6
|
|
60
|
+
npm install mongoose@6
|
|
61
|
+
yarn add mongoose@6
|
|
62
|
+
pnpm add mongoose@6
|
|
63
|
+
bun add mongoose@6
|
|
64
|
+
# For latest mongoose 7
|
|
65
|
+
npm install mongoose@7
|
|
66
|
+
yarn add mongoose@7
|
|
67
|
+
pnpm add mongoose@7
|
|
68
|
+
bun add mongoose@7
|
|
69
|
+
# For latest mongoose 8
|
|
70
|
+
npm install mongoose@8
|
|
71
|
+
yarn add mongoose@8
|
|
72
|
+
pnpm add mongoose@8
|
|
73
|
+
bun add mongoose@8
|
|
74
74
|
```
|
|
75
75
|
|
|
76
76
|
## Example
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
/// <reference types="mongoose/types/validation" />
|
|
24
24
|
/// <reference types="mongoose/types/virtuals" />
|
|
25
25
|
/// <reference types="mongoose/types/inferschematype" />
|
|
26
|
+
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
26
27
|
import type { Mongoose } from 'mongoose';
|
|
27
28
|
import type Cache from '../cache/Cache';
|
|
28
29
|
export default function extendQuery(mongoose: Mongoose, cache: Cache): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggregate.d.ts","sourceRoot":"","sources":["../../../../src/extend/aggregate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"aggregate.d.ts","sourceRoot":"","sources":["../../../../src/extend/aggregate.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAA;AAEvC,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI,CAiD1E"}
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
/// <reference types="mongoose/types/validation" />
|
|
24
24
|
/// <reference types="mongoose/types/virtuals" />
|
|
25
25
|
/// <reference types="mongoose/types/inferschematype" />
|
|
26
|
+
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
26
27
|
import type { Mongoose } from 'mongoose';
|
|
27
28
|
import type Cache from '../cache/Cache';
|
|
28
29
|
export default function extendQuery(mongoose: Mongoose, cache: Cache): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../../src/extend/query.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../../src/extend/query.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAA;AAEvC,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI,CAgF1E"}
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
/// <reference types="mongoose/types/validation" />
|
|
23
23
|
/// <reference types="mongoose/types/virtuals" />
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
+
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
25
26
|
import type { Mongoose } from 'mongoose';
|
|
26
27
|
import type ICacheOptions from './interfaces/ICacheOptions';
|
|
27
28
|
declare module 'mongoose' {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/plugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/plugin.ts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I,EAAE,MAAM,GAAG,IAAI,CAAA;QACnB,WAAW,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC,UAAU,CAAC,KAAK,MAAM,GAAG,IAAI,CAAA;KAC5D;CACF;AAED,cAAM,aAAa;;IAEjB,OAAO,CAAC,KAAK,CAAQ;IAErB,OAAO;WAIO,IAAI,CAAC,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,aAAa,GAAG,aAAa;IAcrE,KAAK,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQxC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAGpC;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
/// <reference types="mongoose/types/validation" />
|
|
24
24
|
/// <reference types="mongoose/types/virtuals" />
|
|
25
25
|
/// <reference types="mongoose/types/inferschematype" />
|
|
26
|
+
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
26
27
|
import type { Mongoose } from 'mongoose';
|
|
27
28
|
import type Cache from '../cache/Cache';
|
|
28
29
|
export default function extendQuery(mongoose: Mongoose, cache: Cache): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggregate.d.ts","sourceRoot":"","sources":["../../../../src/extend/aggregate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"aggregate.d.ts","sourceRoot":"","sources":["../../../../src/extend/aggregate.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAA;AAEvC,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI,CAiD1E"}
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
/// <reference types="mongoose/types/validation" />
|
|
24
24
|
/// <reference types="mongoose/types/virtuals" />
|
|
25
25
|
/// <reference types="mongoose/types/inferschematype" />
|
|
26
|
+
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
26
27
|
import type { Mongoose } from 'mongoose';
|
|
27
28
|
import type Cache from '../cache/Cache';
|
|
28
29
|
export default function extendQuery(mongoose: Mongoose, cache: Cache): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../../src/extend/query.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../../src/extend/query.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAA;AAEvC,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI,CAgF1E"}
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
/// <reference types="mongoose/types/validation" />
|
|
23
23
|
/// <reference types="mongoose/types/virtuals" />
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
+
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
25
26
|
import type { Mongoose } from 'mongoose';
|
|
26
27
|
import type ICacheOptions from './interfaces/ICacheOptions';
|
|
27
28
|
declare module 'mongoose' {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/plugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/plugin.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,KAAK,aAAa,MAAM,4BAA4B,CAAA;AAE3D,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;IAEjB,OAAO,CAAC,KAAK,CAAQ;IAErB,OAAO;WAIO,IAAI,CAAC,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,aAAa,GAAG,aAAa;IAcrE,KAAK,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQxC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAGpC;AAED,eAAe,aAAa,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ts-cache-mongoose",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.2",
|
|
4
4
|
"description": "Cache plugin for mongoose Queries and Aggregate (in-memory, redis)",
|
|
5
5
|
"author": "Alex Eagle",
|
|
6
6
|
"license": "MIT",
|
|
@@ -78,35 +78,36 @@
|
|
|
78
78
|
"dependencies": {
|
|
79
79
|
"ioredis": "5.4.1",
|
|
80
80
|
"ms": "2.1.3",
|
|
81
|
-
"semver": "7.6.
|
|
81
|
+
"semver": "7.6.2",
|
|
82
82
|
"sort-keys": "4.2.0"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
|
-
"@shelf/jest-mongodb": "4.3.
|
|
86
|
-
"@stylistic/eslint-plugin": "2.
|
|
85
|
+
"@shelf/jest-mongodb": "4.3.2",
|
|
86
|
+
"@stylistic/eslint-plugin": "2.2.0",
|
|
87
87
|
"@swc/cli": "0.3.12",
|
|
88
|
-
"@swc/core": "1.
|
|
88
|
+
"@swc/core": "1.6.0",
|
|
89
89
|
"@swc/helpers": "0.5.11",
|
|
90
90
|
"@swc/jest": "0.2.36",
|
|
91
91
|
"@swc/register": "0.1.10",
|
|
92
92
|
"@types/jest": "29.5.12",
|
|
93
93
|
"@types/ms": "0.7.34",
|
|
94
94
|
"@types/node": "20",
|
|
95
|
-
"@
|
|
96
|
-
"@typescript-eslint/
|
|
95
|
+
"@types/semver": "7.5.8",
|
|
96
|
+
"@typescript-eslint/eslint-plugin": "7.13.0",
|
|
97
|
+
"@typescript-eslint/parser": "7.13.0",
|
|
98
|
+
"bson": "^6.5.0",
|
|
97
99
|
"eslint": "8.57.0",
|
|
98
|
-
"eslint-plugin-jest": "28.
|
|
100
|
+
"eslint-plugin-jest": "28.6.0",
|
|
99
101
|
"eslint-plugin-jest-formatting": "3.1.0",
|
|
100
102
|
"eslint-plugin-sonarjs": "0.25.1",
|
|
101
103
|
"jest": "29.7.0",
|
|
102
104
|
"merge": "2.1.1",
|
|
103
|
-
"mongoose": "8.
|
|
104
|
-
"bson": "^6.5.0",
|
|
105
|
+
"mongoose": "8.4.1",
|
|
105
106
|
"open-cli": "8.0.0",
|
|
106
107
|
"typescript": "5.4.5"
|
|
107
108
|
},
|
|
108
109
|
"peerDependencies": {
|
|
109
|
-
"
|
|
110
|
-
"
|
|
110
|
+
"bson": ">=4.7.2 < 7",
|
|
111
|
+
"mongoose": ">=6.6.0 < 9"
|
|
111
112
|
}
|
|
112
113
|
}
|