@envelop/response-cache-redis 1.0.0-alpha-6a4e0e2.0 → 1.0.0-alpha-e8a9318.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/cjs/index.js +4 -0
- package/cjs/package.json +1 -0
- package/{index.js → cjs/redis-cache.js} +7 -9
- package/esm/index.js +1 -0
- package/{index.mjs → esm/redis-cache.js} +3 -5
- package/package.json +33 -11
- package/typings/index.d.ts +1 -0
- package/{redis-cache.d.ts → typings/redis-cache.d.ts} +0 -0
- package/index.d.ts +0 -1
package/cjs/index.js
ADDED
package/cjs/package.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"commonjs"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defaultBuildRedisOperationResultCacheKey = exports.defaultBuildRedisEntityId = exports.createRedisCache = void 0;
|
|
5
4
|
const createRedisCache = (params) => {
|
|
6
5
|
var _a, _b;
|
|
7
6
|
const store = params.redis;
|
|
8
|
-
const buildRedisEntityId = (_a = params === null || params === void 0 ? void 0 : params.buildRedisEntityId) !== null && _a !== void 0 ? _a : defaultBuildRedisEntityId;
|
|
9
|
-
const buildRedisOperationResultCacheKey = (_b = params === null || params === void 0 ? void 0 : params.buildRedisOperationResultCacheKey) !== null && _b !== void 0 ? _b : defaultBuildRedisOperationResultCacheKey;
|
|
7
|
+
const buildRedisEntityId = (_a = params === null || params === void 0 ? void 0 : params.buildRedisEntityId) !== null && _a !== void 0 ? _a : exports.defaultBuildRedisEntityId;
|
|
8
|
+
const buildRedisOperationResultCacheKey = (_b = params === null || params === void 0 ? void 0 : params.buildRedisOperationResultCacheKey) !== null && _b !== void 0 ? _b : exports.defaultBuildRedisOperationResultCacheKey;
|
|
10
9
|
async function buildEntityInvalidationsKeys(entity) {
|
|
11
10
|
const keysToInvalidate = [entity];
|
|
12
11
|
// find the responseIds for the entity
|
|
@@ -76,9 +75,8 @@ const createRedisCache = (params) => {
|
|
|
76
75
|
},
|
|
77
76
|
};
|
|
78
77
|
};
|
|
79
|
-
const defaultBuildRedisEntityId = (typename, id) => `${typename}:${id}`;
|
|
80
|
-
const defaultBuildRedisOperationResultCacheKey = responseId => `operations:${responseId}`;
|
|
81
|
-
|
|
82
78
|
exports.createRedisCache = createRedisCache;
|
|
79
|
+
const defaultBuildRedisEntityId = (typename, id) => `${typename}:${id}`;
|
|
83
80
|
exports.defaultBuildRedisEntityId = defaultBuildRedisEntityId;
|
|
81
|
+
const defaultBuildRedisOperationResultCacheKey = responseId => `operations:${responseId}`;
|
|
84
82
|
exports.defaultBuildRedisOperationResultCacheKey = defaultBuildRedisOperationResultCacheKey;
|
package/esm/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './redis-cache.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const createRedisCache = (params) => {
|
|
1
|
+
export const createRedisCache = (params) => {
|
|
2
2
|
var _a, _b;
|
|
3
3
|
const store = params.redis;
|
|
4
4
|
const buildRedisEntityId = (_a = params === null || params === void 0 ? void 0 : params.buildRedisEntityId) !== null && _a !== void 0 ? _a : defaultBuildRedisEntityId;
|
|
@@ -72,7 +72,5 @@ const createRedisCache = (params) => {
|
|
|
72
72
|
},
|
|
73
73
|
};
|
|
74
74
|
};
|
|
75
|
-
const defaultBuildRedisEntityId = (typename, id) => `${typename}:${id}`;
|
|
76
|
-
const defaultBuildRedisOperationResultCacheKey = responseId => `operations:${responseId}`;
|
|
77
|
-
|
|
78
|
-
export { createRedisCache, defaultBuildRedisEntityId, defaultBuildRedisOperationResultCacheKey };
|
|
75
|
+
export const defaultBuildRedisEntityId = (typename, id) => `${typename}:${id}`;
|
|
76
|
+
export const defaultBuildRedisOperationResultCacheKey = responseId => `operations:${responseId}`;
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@envelop/response-cache-redis",
|
|
3
|
-
"version": "1.0.0-alpha-
|
|
3
|
+
"version": "1.0.0-alpha-e8a9318.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
+
"peerDependencies": {},
|
|
5
6
|
"dependencies": {
|
|
6
|
-
"@envelop/response-cache": "3.0.0-alpha-
|
|
7
|
+
"@envelop/response-cache": "3.0.0-alpha-e8a9318.0",
|
|
7
8
|
"ioredis": "^4.27.9"
|
|
8
9
|
},
|
|
9
10
|
"repository": {
|
|
@@ -13,21 +14,42 @@
|
|
|
13
14
|
},
|
|
14
15
|
"author": "David Thyresson <dthyresson@gmail.com>",
|
|
15
16
|
"license": "MIT",
|
|
16
|
-
"main": "index.js",
|
|
17
|
-
"module": "index.
|
|
18
|
-
"typings": "index.d.ts",
|
|
17
|
+
"main": "cjs/index.js",
|
|
18
|
+
"module": "esm/index.js",
|
|
19
|
+
"typings": "typings/index.d.ts",
|
|
19
20
|
"typescript": {
|
|
20
|
-
"definition": "index.d.ts"
|
|
21
|
+
"definition": "typings/index.d.ts"
|
|
21
22
|
},
|
|
23
|
+
"type": "module",
|
|
22
24
|
"exports": {
|
|
23
25
|
".": {
|
|
24
|
-
"require":
|
|
25
|
-
|
|
26
|
+
"require": {
|
|
27
|
+
"types": "./typings/index.d.ts",
|
|
28
|
+
"default": "./cjs/index.js"
|
|
29
|
+
},
|
|
30
|
+
"import": {
|
|
31
|
+
"types": "./typings/index.d.ts",
|
|
32
|
+
"default": "./esm/index.js"
|
|
33
|
+
},
|
|
34
|
+
"default": {
|
|
35
|
+
"types": "./typings/index.d.ts",
|
|
36
|
+
"default": "./esm/index.js"
|
|
37
|
+
}
|
|
26
38
|
},
|
|
27
39
|
"./*": {
|
|
28
|
-
"require":
|
|
29
|
-
|
|
40
|
+
"require": {
|
|
41
|
+
"types": "./typings/*.d.ts",
|
|
42
|
+
"default": "./cjs/*.js"
|
|
43
|
+
},
|
|
44
|
+
"import": {
|
|
45
|
+
"types": "./typings/*.d.ts",
|
|
46
|
+
"default": "./esm/*.js"
|
|
47
|
+
},
|
|
48
|
+
"default": {
|
|
49
|
+
"types": "./typings/*.d.ts",
|
|
50
|
+
"default": "./esm/*.js"
|
|
51
|
+
}
|
|
30
52
|
},
|
|
31
53
|
"./package.json": "./package.json"
|
|
32
54
|
}
|
|
33
|
-
}
|
|
55
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './redis-cache.js';
|
|
File without changes
|
package/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './redis-cache';
|