@envelop/response-cache-redis 0.5.0-alpha-e9434aa.0 → 0.5.0-alpha-05dbec7.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/esm/index.js +1 -17
- package/esm/redis-cache.js +5 -11
- package/package.json +2 -2
package/esm/index.js
CHANGED
|
@@ -1,17 +1 @@
|
|
|
1
|
-
|
|
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("./redis-cache.js"), exports);
|
|
1
|
+
export * from './redis-cache.js';
|
package/esm/redis-cache.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.defaultBuildRedisOperationResultCacheKey = exports.defaultBuildRedisEntityId = exports.createRedisCache = void 0;
|
|
4
|
-
const createRedisCache = (params) => {
|
|
1
|
+
export const createRedisCache = (params) => {
|
|
5
2
|
var _a, _b;
|
|
6
3
|
const store = params.redis;
|
|
7
|
-
const buildRedisEntityId = (_a = params === null || params === void 0 ? void 0 : params.buildRedisEntityId) !== null && _a !== void 0 ? _a :
|
|
8
|
-
const buildRedisOperationResultCacheKey = (_b = params === null || params === void 0 ? void 0 : params.buildRedisOperationResultCacheKey) !== null && _b !== void 0 ? _b :
|
|
4
|
+
const buildRedisEntityId = (_a = params === null || params === void 0 ? void 0 : params.buildRedisEntityId) !== null && _a !== void 0 ? _a : defaultBuildRedisEntityId;
|
|
5
|
+
const buildRedisOperationResultCacheKey = (_b = params === null || params === void 0 ? void 0 : params.buildRedisOperationResultCacheKey) !== null && _b !== void 0 ? _b : defaultBuildRedisOperationResultCacheKey;
|
|
9
6
|
async function buildEntityInvalidationsKeys(entity) {
|
|
10
7
|
const keysToInvalidate = [entity];
|
|
11
8
|
// find the responseIds for the entity
|
|
@@ -75,8 +72,5 @@ const createRedisCache = (params) => {
|
|
|
75
72
|
},
|
|
76
73
|
};
|
|
77
74
|
};
|
|
78
|
-
|
|
79
|
-
const
|
|
80
|
-
exports.defaultBuildRedisEntityId = defaultBuildRedisEntityId;
|
|
81
|
-
const defaultBuildRedisOperationResultCacheKey = responseId => `operations:${responseId}`;
|
|
82
|
-
exports.defaultBuildRedisOperationResultCacheKey = defaultBuildRedisOperationResultCacheKey;
|
|
75
|
+
export const defaultBuildRedisEntityId = (typename, id) => `${typename}:${id}`;
|
|
76
|
+
export const defaultBuildRedisOperationResultCacheKey = responseId => `operations:${responseId}`;
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@envelop/response-cache-redis",
|
|
3
|
-
"version": "0.5.0-alpha-
|
|
3
|
+
"version": "0.5.0-alpha-05dbec7.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"peerDependencies": {},
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@envelop/response-cache": "2.4.0-alpha-
|
|
7
|
+
"@envelop/response-cache": "2.4.0-alpha-05dbec7.0",
|
|
8
8
|
"ioredis": "^4.27.9"
|
|
9
9
|
},
|
|
10
10
|
"repository": {
|