@entifix/redis 0.5.0 → 0.6.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.
|
@@ -12,8 +12,7 @@ export declare const REDIS_PROBE_NAME = "redis";
|
|
|
12
12
|
*
|
|
13
13
|
* `stores` names the Stores this connection backs, by their register name in
|
|
14
14
|
* `tools/slices/` — `['session']`, `['saga-coordination']`. See
|
|
15
|
-
* {@link MongoHealthProbeLayer} for why the composition root supplies it
|
|
16
|
-
* (ADR 0031).
|
|
15
|
+
* {@link MongoHealthProbeLayer} for why the composition root supplies it.
|
|
17
16
|
*/
|
|
18
17
|
export declare const RedisHealthProbeLayer: (stores: readonly string[]) => Layer.Layer<never, never, RedisTag | HealthRegistryTag>;
|
|
19
18
|
//# sourceMappingURL=redis-health-probe.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redis-health-probe.d.ts","sourceRoot":"","sources":["../../src/redis-connection/redis-health-probe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAU,KAAK,EAAE,MAAM,QAAQ,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,4EAA4E;AAC5E,eAAO,MAAM,gBAAgB,UAAU,CAAC;AAExC
|
|
1
|
+
{"version":3,"file":"redis-health-probe.d.ts","sourceRoot":"","sources":["../../src/redis-connection/redis-health-probe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAU,KAAK,EAAE,MAAM,QAAQ,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,4EAA4E;AAC5E,eAAO,MAAM,gBAAgB,UAAU,CAAC;AAExC;;;;;;;;;;GAUG;AACH,eAAO,MAAM,qBAAqB,GAChC,QAAQ,SAAS,MAAM,EAAE,KACxB,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,GAAG,iBAAiB,CAgBtD,CAAC"}
|
|
@@ -11,8 +11,7 @@ import { RedisTag } from './redis-connection.js';
|
|
|
11
11
|
*
|
|
12
12
|
* `stores` names the Stores this connection backs, by their register name in
|
|
13
13
|
* `tools/slices/` — `['session']`, `['saga-coordination']`. See
|
|
14
|
-
* {@link MongoHealthProbeLayer} for why the composition root supplies it
|
|
15
|
-
* (ADR 0031).
|
|
14
|
+
* {@link MongoHealthProbeLayer} for why the composition root supplies it.
|
|
16
15
|
*/ export const RedisHealthProbeLayer = (stores)=>Layer.effectDiscard(Effect.gen(function*() {
|
|
17
16
|
const redis = yield* RedisTag;
|
|
18
17
|
const registry = yield* HealthRegistryTag;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/redis-connection/redis-health-probe.ts"],"sourcesContent":["import { HealthRegistryTag } from '@entifix/business';\nimport { Effect, Layer } from 'effect';\n\nimport { RedisTag } from './redis-connection.js';\n\n/** Probe name reported by `/api/health/ready` when Redis is unreachable. */\nexport const REDIS_PROBE_NAME = 'redis';\n\n/**\n * Registers a readiness probe for the Redis connection: `PING`.\n *\n * Sessions live here, so a service that cannot reach Redis can still answer\n * liveness (its process is fine) while readiness reports the truth — which is\n * exactly the split Kubernetes acts on: drain traffic, do not restart.\n *\n * `stores` names the Stores this connection backs, by their register name in\n * `tools/slices/` — `['session']`, `['saga-coordination']`. See\n * {@link MongoHealthProbeLayer} for why the composition root supplies it
|
|
1
|
+
{"version":3,"sources":["../../src/redis-connection/redis-health-probe.ts"],"sourcesContent":["import { HealthRegistryTag } from '@entifix/business';\nimport { Effect, Layer } from 'effect';\n\nimport { RedisTag } from './redis-connection.js';\n\n/** Probe name reported by `/api/health/ready` when Redis is unreachable. */\nexport const REDIS_PROBE_NAME = 'redis';\n\n/**\n * Registers a readiness probe for the Redis connection: `PING`.\n *\n * Sessions live here, so a service that cannot reach Redis can still answer\n * liveness (its process is fine) while readiness reports the truth — which is\n * exactly the split Kubernetes acts on: drain traffic, do not restart.\n *\n * `stores` names the Stores this connection backs, by their register name in\n * `tools/slices/` — `['session']`, `['saga-coordination']`. See\n * {@link MongoHealthProbeLayer} for why the composition root supplies it.\n */\nexport const RedisHealthProbeLayer = (\n stores: readonly string[],\n): Layer.Layer<never, never, RedisTag | HealthRegistryTag> =>\n Layer.effectDiscard(\n Effect.gen(function* () {\n const redis = yield* RedisTag;\n const registry = yield* HealthRegistryTag;\n\n yield* registry.register({\n name: REDIS_PROBE_NAME,\n kind: 'datastore',\n targets: stores,\n check: Effect.tryPromise(() => redis.ping()).pipe(\n Effect.map(reply => reply === 'PONG'),\n Effect.catch(() => Effect.succeed(false)),\n ),\n });\n }),\n );\n"],"names":["HealthRegistryTag","Effect","Layer","RedisTag","REDIS_PROBE_NAME","RedisHealthProbeLayer","stores","effectDiscard","gen","redis","registry","register","name","kind","targets","check","tryPromise","ping","pipe","map","reply","catch","succeed"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,oBAAoB;AACtD,SAASC,MAAM,EAAEC,KAAK,QAAQ,SAAS;AAEvC,SAASC,QAAQ,QAAQ,wBAAwB;AAEjD,0EAA0E,GAC1E,OAAO,MAAMC,mBAAmB,QAAQ;AAExC;;;;;;;;;;CAUC,GACD,OAAO,MAAMC,wBAAwB,CACnCC,SAEAJ,MAAMK,aAAa,CACjBN,OAAOO,GAAG,CAAC;QACT,MAAMC,QAAQ,OAAON;QACrB,MAAMO,WAAW,OAAOV;QAExB,OAAOU,SAASC,QAAQ,CAAC;YACvBC,MAAMR;YACNS,MAAM;YACNC,SAASR;YACTS,OAAOd,OAAOe,UAAU,CAAC,IAAMP,MAAMQ,IAAI,IAAIC,IAAI,CAC/CjB,OAAOkB,GAAG,CAACC,CAAAA,QAASA,UAAU,SAC9BnB,OAAOoB,KAAK,CAAC,IAAMpB,OAAOqB,OAAO,CAAC;QAEtC;IACF,IACA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@entifix/redis",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Redis adapters for sessions and one-time tokens, and optionally the lock and sequence services @entifix/transactions needs.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -57,17 +57,17 @@
|
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@swc/helpers": "0.5.23",
|
|
59
59
|
"ioredis": "6.0.0",
|
|
60
|
-
"@entifix/business": "0.
|
|
61
|
-
"@entifix/core": "0.
|
|
60
|
+
"@entifix/business": "0.6.0",
|
|
61
|
+
"@entifix/core": "0.6.0"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"effect": "4.0.5",
|
|
65
|
-
"@entifix/testing-unit": "0.
|
|
66
|
-
"@entifix/transactions": "0.
|
|
65
|
+
"@entifix/testing-unit": "0.6.0",
|
|
66
|
+
"@entifix/transactions": "0.6.0"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
69
|
"effect": "^4.0.5",
|
|
70
|
-
"@entifix/transactions": "0.
|
|
70
|
+
"@entifix/transactions": "0.6.0"
|
|
71
71
|
},
|
|
72
72
|
"peerDependenciesMeta": {
|
|
73
73
|
"@entifix/transactions": {
|