redis-kv-store 4.0.2 → 5.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 +4 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/package.json +22 -22
- package/src/index.ts +10 -7
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type
|
|
3
|
-
import type
|
|
1
|
+
import { type LogService } from 'common-services';
|
|
2
|
+
import { type KVStoreService } from 'memory-kv-store';
|
|
3
|
+
import { type RedisService } from 'simple-redis-service';
|
|
4
4
|
export type RedisKVService<T> = KVStoreService<T>;
|
|
5
5
|
export type RedisKVDependencies = {
|
|
6
6
|
redis: RedisService;
|
|
7
|
-
log
|
|
7
|
+
log?: LogService;
|
|
8
8
|
};
|
|
9
9
|
declare const _default: import("knifecycle").ServiceInitializer<RedisKVDependencies, KVStoreService<unknown>>;
|
|
10
10
|
export default _default;
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { autoService, name } from 'knifecycle';
|
|
2
|
-
|
|
1
|
+
import { autoService, name, location } from 'knifecycle';
|
|
2
|
+
import { noop } from 'common-services';
|
|
3
|
+
export default location(name('redisKV', autoService(initRedisKV)), import.meta.url);
|
|
3
4
|
/**
|
|
4
5
|
* Instantiate the Redis Key/Value service
|
|
5
6
|
* @name initRedisKV
|
|
@@ -31,7 +32,7 @@ export default name('redisKV', autoService(initRedisKV));
|
|
|
31
32
|
*
|
|
32
33
|
* const value = await redisKV.get('my_key');
|
|
33
34
|
*/
|
|
34
|
-
async function initRedisKV({ redis, log, }) {
|
|
35
|
+
async function initRedisKV({ redis, log = noop, }) {
|
|
35
36
|
log('warning', `🏧 - Redis KV Store Service initialized!`);
|
|
36
37
|
const redisKV = {
|
|
37
38
|
get: async (key) => {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,EAAE,IAAI,EAAmB,MAAM,iBAAiB,CAAC;AAexD,eAAe,QAAQ,CACrB,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC,EACzC,MAAM,CAAC,IAAI,CAAC,GAAG,CAChB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,KAAK,UAAU,WAAW,CAAI,EAC5B,KAAK,EACL,GAAG,GAAG,IAAI,GACU;IACpB,GAAG,CAAC,SAAS,EAAE,0CAA0C,CAAC,CAAC;IAE3D,MAAM,OAAO,GAAG;QACd,GAAG,EAAE,KAAK,EAAE,GAAW,EAA0B,EAAE;YACjD,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACpC,OAAO,eAAe,CAAI,MAAM,CAAC,CAAC;QACpC,CAAC;QACD,GAAG,EAAE,KAAK,EACR,GAAW,EACX,KAAoB,EACpB,GAAY,EACG,EAAE;YACjB,IAAI,OAAO,GAAG,KAAK,WAAW,EAAE,CAAC;gBAC/B,MAAM,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,iBAAiB,CAAI,KAAK,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;YAC/D,CAAC;iBAAM,CAAC;gBACN,MAAM,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,iBAAiB,CAAI,KAAK,CAAC,CAAC,CAAC;YACpD,CAAC;QACH,CAAC;QACD,MAAM,E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@@
|
|
|
24
24
|
]
|
|
25
25
|
},
|
|
26
26
|
"name": "redis-kv-store",
|
|
27
|
-
"version": "
|
|
27
|
+
"version": "5.0.0",
|
|
28
28
|
"description": "A simple Redis based key/value store.",
|
|
29
29
|
"main": "dist/index.js",
|
|
30
30
|
"types": "dist/index.d.ts",
|
|
@@ -68,33 +68,33 @@
|
|
|
68
68
|
},
|
|
69
69
|
"homepage": "https://github.com/nfroidure/redis-kv-store#readme",
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"common-services": "^
|
|
72
|
-
"knifecycle": "
|
|
73
|
-
"memory-kv-store": "^
|
|
74
|
-
"simple-redis-service": "^
|
|
71
|
+
"common-services": "^17.0.0",
|
|
72
|
+
"knifecycle": "18.0.0",
|
|
73
|
+
"memory-kv-store": "^9.0.0",
|
|
74
|
+
"simple-redis-service": "^5.0.0"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
|
-
"@eslint/js": "^9.
|
|
78
|
-
"@swc/cli": "^0.
|
|
79
|
-
"@swc/core": "^1.
|
|
80
|
-
"@swc/helpers": "^0.5.
|
|
81
|
-
"@swc/jest": "^0.2.
|
|
82
|
-
"commitizen": "^4.3.
|
|
77
|
+
"@eslint/js": "^9.16.0",
|
|
78
|
+
"@swc/cli": "^0.5.2",
|
|
79
|
+
"@swc/core": "^1.10.0",
|
|
80
|
+
"@swc/helpers": "^0.5.15",
|
|
81
|
+
"@swc/jest": "^0.2.37",
|
|
82
|
+
"commitizen": "^4.3.1",
|
|
83
83
|
"conventional-changelog-cli": "^5.0.0",
|
|
84
84
|
"cz-conventional-changelog": "^3.3.0",
|
|
85
|
-
"eslint": "^9.
|
|
85
|
+
"eslint": "^9.16.0",
|
|
86
86
|
"eslint-config-prettier": "^9.1.0",
|
|
87
|
-
"eslint-plugin-jest": "^28.
|
|
88
|
-
"eslint-plugin-prettier": "^5.1
|
|
87
|
+
"eslint-plugin-jest": "^28.9.0",
|
|
88
|
+
"eslint-plugin-prettier": "^5.2.1",
|
|
89
89
|
"jest": "^29.7.0",
|
|
90
|
-
"jsarch": "^6.
|
|
91
|
-
"jsdoc-to-markdown": "^
|
|
92
|
-
"metapak": "^6.0.
|
|
93
|
-
"metapak-nfroidure": "
|
|
94
|
-
"prettier": "^3.
|
|
90
|
+
"jsarch": "^6.1.2",
|
|
91
|
+
"jsdoc-to-markdown": "^9.1.1",
|
|
92
|
+
"metapak": "^6.0.2",
|
|
93
|
+
"metapak-nfroidure": "19.0.1",
|
|
94
|
+
"prettier": "^3.4.2",
|
|
95
95
|
"rimraf": "^6.0.1",
|
|
96
|
-
"typescript": "^5.
|
|
97
|
-
"typescript-eslint": "^
|
|
96
|
+
"typescript": "^5.7.2",
|
|
97
|
+
"typescript-eslint": "^8.17.0"
|
|
98
98
|
},
|
|
99
99
|
"engines": {
|
|
100
100
|
"node": ">=20.11.1"
|
|
@@ -173,6 +173,6 @@
|
|
|
173
173
|
}
|
|
174
174
|
},
|
|
175
175
|
"overrides": {
|
|
176
|
-
"eslint": "^9.
|
|
176
|
+
"eslint": "^9.16.0"
|
|
177
177
|
}
|
|
178
178
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { autoService, name } from 'knifecycle';
|
|
2
|
-
import type
|
|
3
|
-
import type
|
|
4
|
-
import type
|
|
1
|
+
import { autoService, name, location } from 'knifecycle';
|
|
2
|
+
import { noop, type LogService } from 'common-services';
|
|
3
|
+
import { type KVStoreService } from 'memory-kv-store';
|
|
4
|
+
import { type RedisService } from 'simple-redis-service';
|
|
5
5
|
|
|
6
6
|
/* Architecture Note #1: Redis Key/Value Service
|
|
7
7
|
|
|
@@ -11,10 +11,13 @@ A `redis` based key/value service.
|
|
|
11
11
|
export type RedisKVService<T> = KVStoreService<T>;
|
|
12
12
|
export type RedisKVDependencies = {
|
|
13
13
|
redis: RedisService;
|
|
14
|
-
log
|
|
14
|
+
log?: LogService;
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
export default
|
|
17
|
+
export default location(
|
|
18
|
+
name('redisKV', autoService(initRedisKV)),
|
|
19
|
+
import.meta.url,
|
|
20
|
+
);
|
|
18
21
|
|
|
19
22
|
/**
|
|
20
23
|
* Instantiate the Redis Key/Value service
|
|
@@ -49,7 +52,7 @@ export default name('redisKV', autoService(initRedisKV));
|
|
|
49
52
|
*/
|
|
50
53
|
async function initRedisKV<T>({
|
|
51
54
|
redis,
|
|
52
|
-
log,
|
|
55
|
+
log = noop,
|
|
53
56
|
}: RedisKVDependencies): Promise<KVStoreService<T>> {
|
|
54
57
|
log('warning', `🏧 - Redis KV Store Service initialized!`);
|
|
55
58
|
|