@motiadev/adapter-redis-streams 0.17.6-beta.188-784886 → 0.17.7-beta.188
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redis-stream-adapter-manager.d.mts","names":[],"sources":["../src/redis-stream-adapter-manager.ts"],"sourcesContent":[],"mappings":";;;;;cASa,yBAAA,YAAqC;;EAArC,QAAA,SAAA;EAMkB,QAAA,gBAAA;EAAkB,QAAA,MAAA;EAA8B,WAAA,CAAA,eAAA,EAAhD,eAAgD,GAA9B,kBAA8B,EAAA,OAAA,CAAA,EAAA,yBAAA;
|
|
1
|
+
{"version":3,"file":"redis-stream-adapter-manager.d.mts","names":[],"sources":["../src/redis-stream-adapter-manager.ts"],"sourcesContent":[],"mappings":";;;;;cASa,yBAAA,YAAqC;;EAArC,QAAA,SAAA;EAMkB,QAAA,gBAAA;EAAkB,QAAA,MAAA;EAA8B,WAAA,CAAA,eAAA,EAAhD,eAAgD,GAA9B,kBAA8B,EAAA,OAAA,CAAA,EAAA,yBAAA;EAqDtB,QAAA,OAAA;EAAd,YAAA,CAAA,KAAA,CAAA,CAAA,UAAA,EAAA,MAAA,CAAA,EAAA,aAAA,CAAc,KAAd,CAAA;EAI5B,SAAA,CAAA,CAAA,EAAA,eAAA;EAIK,QAAA,CAAA,CAAA,EAAA,OAAA,CAAA,IAAA,CAAA"}
|
|
@@ -28,7 +28,7 @@ var RedisStreamAdapterManager = class {
|
|
|
28
28
|
this.isExternalClient = false;
|
|
29
29
|
this.client = createClient(config);
|
|
30
30
|
this.client.on("error", (err) => {
|
|
31
|
-
console.error("[Redis Stream Manager] Client error:", err);
|
|
31
|
+
if (this.connected) console.error("[Redis Stream Manager] Client error:", err?.message);
|
|
32
32
|
});
|
|
33
33
|
this.client.on("connect", () => {
|
|
34
34
|
this.connected = true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redis-stream-adapter-manager.mjs","names":["config: RedisClientOptions"],"sources":["../src/redis-stream-adapter-manager.ts"],"sourcesContent":["import type { StreamAdapter, StreamAdapterManager } from '@motiadev/core'\nimport { createClient, type RedisClientOptions, type RedisClientType } from 'redis'\nimport { RedisStreamAdapter } from './redis-stream-adapter'\nimport type { RedisStreamAdapterConfig, RedisStreamAdapterOptions } from './types'\n\nfunction isRedisClient(input: RedisClientType | RedisClientOptions): input is RedisClientType {\n return typeof input === 'object' && 'isOpen' in input && 'connect' in input\n}\n\nexport class RedisStreamAdapterManager implements StreamAdapterManager {\n private client: RedisClientType\n private connected = false\n private isExternalClient: boolean\n private config: RedisStreamAdapterConfig\n\n constructor(redisConnection: RedisClientType | RedisClientOptions, options?: RedisStreamAdapterOptions) {\n this.config = {\n keyPrefix: options?.keyPrefix || 'motia:stream:',\n socketKeepAlive: options?.socketKeepAlive ?? true,\n }\n\n if (isRedisClient(redisConnection)) {\n this.client = redisConnection\n this.isExternalClient = true\n this.connected = this.client.isOpen\n } else {\n const config: RedisClientOptions = {\n ...redisConnection,\n socket: {\n ...(redisConnection.socket || {}),\n keepAlive: this.config.socketKeepAlive,\n noDelay: true,\n },\n } as RedisClientOptions\n this.isExternalClient = false\n\n this.client = createClient(config) as RedisClientType\n\n this.client.on('error', (err) => {\n console.error('[Redis Stream Manager] Client error:', err)\n })\n\n this.client.on('connect', () => {\n this.connected = true\n })\n\n this.client.on('disconnect', () => {\n console.warn('[Redis Stream Manager] Disconnected')\n this.connected = false\n })\n\n this.connect()\n }\n }\n\n private async connect(): Promise<void> {\n if (!this.connected && !this.isExternalClient) {\n try {\n await this.client.connect()\n } catch (error) {\n console.error('[Redis Stream Manager] Failed to connect:', error)\n throw error\n }\n }\n }\n\n createStream<TData>(streamName: string): StreamAdapter<TData> {\n return new RedisStreamAdapter<TData>(streamName, this.config, this.client)\n }\n\n getClient(): RedisClientType {\n return this.client\n }\n\n async shutdown(): Promise<void> {\n if (!this.isExternalClient && this.client.isOpen) {\n await this.client.quit()\n }\n }\n}\n"],"mappings":";;;;AAKA,SAAS,cAAc,OAAuE;AAC5F,QAAO,OAAO,UAAU,YAAY,YAAY,SAAS,aAAa;;AAGxE,IAAa,4BAAb,MAAuE;CAMrE,YAAY,iBAAuD,SAAqC;mBAJpF;AAKlB,OAAK,SAAS;GACZ,WAAW,SAAS,aAAa;GACjC,iBAAiB,SAAS,mBAAmB;GAC9C;AAED,MAAI,cAAc,gBAAgB,EAAE;AAClC,QAAK,SAAS;AACd,QAAK,mBAAmB;AACxB,QAAK,YAAY,KAAK,OAAO;SACxB;GACL,MAAMA,SAA6B;IACjC,GAAG;IACH,QAAQ;KACN,GAAI,gBAAgB,UAAU,EAAE;KAChC,WAAW,KAAK,OAAO;KACvB,SAAS;KACV;IACF;AACD,QAAK,mBAAmB;AAExB,QAAK,SAAS,aAAa,OAAO;AAElC,QAAK,OAAO,GAAG,UAAU,QAAQ;AAC/B,
|
|
1
|
+
{"version":3,"file":"redis-stream-adapter-manager.mjs","names":["config: RedisClientOptions"],"sources":["../src/redis-stream-adapter-manager.ts"],"sourcesContent":["import type { StreamAdapter, StreamAdapterManager } from '@motiadev/core'\nimport { createClient, type RedisClientOptions, type RedisClientType } from 'redis'\nimport { RedisStreamAdapter } from './redis-stream-adapter'\nimport type { RedisStreamAdapterConfig, RedisStreamAdapterOptions } from './types'\n\nfunction isRedisClient(input: RedisClientType | RedisClientOptions): input is RedisClientType {\n return typeof input === 'object' && 'isOpen' in input && 'connect' in input\n}\n\nexport class RedisStreamAdapterManager implements StreamAdapterManager {\n private client: RedisClientType\n private connected = false\n private isExternalClient: boolean\n private config: RedisStreamAdapterConfig\n\n constructor(redisConnection: RedisClientType | RedisClientOptions, options?: RedisStreamAdapterOptions) {\n this.config = {\n keyPrefix: options?.keyPrefix || 'motia:stream:',\n socketKeepAlive: options?.socketKeepAlive ?? true,\n }\n\n if (isRedisClient(redisConnection)) {\n this.client = redisConnection\n this.isExternalClient = true\n this.connected = this.client.isOpen\n } else {\n const config: RedisClientOptions = {\n ...redisConnection,\n socket: {\n ...(redisConnection.socket || {}),\n keepAlive: this.config.socketKeepAlive,\n noDelay: true,\n },\n } as RedisClientOptions\n this.isExternalClient = false\n\n this.client = createClient(config) as RedisClientType\n\n this.client.on('error', (err) => {\n if (this.connected) {\n console.error('[Redis Stream Manager] Client error:', err?.message)\n }\n })\n\n this.client.on('connect', () => {\n this.connected = true\n })\n\n this.client.on('disconnect', () => {\n console.warn('[Redis Stream Manager] Disconnected')\n this.connected = false\n })\n\n this.connect()\n }\n }\n\n private async connect(): Promise<void> {\n if (!this.connected && !this.isExternalClient) {\n try {\n await this.client.connect()\n } catch (error) {\n console.error('[Redis Stream Manager] Failed to connect:', error)\n throw error\n }\n }\n }\n\n createStream<TData>(streamName: string): StreamAdapter<TData> {\n return new RedisStreamAdapter<TData>(streamName, this.config, this.client)\n }\n\n getClient(): RedisClientType {\n return this.client\n }\n\n async shutdown(): Promise<void> {\n if (!this.isExternalClient && this.client.isOpen) {\n await this.client.quit()\n }\n }\n}\n"],"mappings":";;;;AAKA,SAAS,cAAc,OAAuE;AAC5F,QAAO,OAAO,UAAU,YAAY,YAAY,SAAS,aAAa;;AAGxE,IAAa,4BAAb,MAAuE;CAMrE,YAAY,iBAAuD,SAAqC;mBAJpF;AAKlB,OAAK,SAAS;GACZ,WAAW,SAAS,aAAa;GACjC,iBAAiB,SAAS,mBAAmB;GAC9C;AAED,MAAI,cAAc,gBAAgB,EAAE;AAClC,QAAK,SAAS;AACd,QAAK,mBAAmB;AACxB,QAAK,YAAY,KAAK,OAAO;SACxB;GACL,MAAMA,SAA6B;IACjC,GAAG;IACH,QAAQ;KACN,GAAI,gBAAgB,UAAU,EAAE;KAChC,WAAW,KAAK,OAAO;KACvB,SAAS;KACV;IACF;AACD,QAAK,mBAAmB;AAExB,QAAK,SAAS,aAAa,OAAO;AAElC,QAAK,OAAO,GAAG,UAAU,QAAQ;AAC/B,QAAI,KAAK,UACP,SAAQ,MAAM,wCAAwC,KAAK,QAAQ;KAErE;AAEF,QAAK,OAAO,GAAG,iBAAiB;AAC9B,SAAK,YAAY;KACjB;AAEF,QAAK,OAAO,GAAG,oBAAoB;AACjC,YAAQ,KAAK,sCAAsC;AACnD,SAAK,YAAY;KACjB;AAEF,QAAK,SAAS;;;CAIlB,MAAc,UAAyB;AACrC,MAAI,CAAC,KAAK,aAAa,CAAC,KAAK,iBAC3B,KAAI;AACF,SAAM,KAAK,OAAO,SAAS;WACpB,OAAO;AACd,WAAQ,MAAM,6CAA6C,MAAM;AACjE,SAAM;;;CAKZ,aAAoB,YAA0C;AAC5D,SAAO,IAAI,mBAA0B,YAAY,KAAK,QAAQ,KAAK,OAAO;;CAG5E,YAA6B;AAC3B,SAAO,KAAK;;CAGd,MAAM,WAA0B;AAC9B,MAAI,CAAC,KAAK,oBAAoB,KAAK,OAAO,OACxC,OAAM,KAAK,OAAO,MAAM"}
|
package/package.json
CHANGED
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
"main": "dist/index.mjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
7
7
|
"types": "dist/index.d.mts",
|
|
8
|
-
"version": "0.17.
|
|
8
|
+
"version": "0.17.7-beta.188",
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"redis": "^5.9.0",
|
|
11
|
-
"@motiadev/core": "0.17.
|
|
11
|
+
"@motiadev/core": "0.17.7-beta.188"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
14
|
"@types/node": "^22.10.2",
|