@sirutils/driver-redis
Advanced tools
Comparing version 0.2.1 to 0.2.2
// @bun | ||
import{tagBuilder as D}from"@sirutils/core";var m=D("@sirutils/driver-redis"),o={logger:m("logger"),plugin:m("plugin"),driver:m("driver"),redisGlobal:m("redis-global"),scan:m("driver#scan"),invalidResponse:m("invalid-response")};var d={name:"@sirutils/driver-redis",version:"0.2.1",type:"module",files:["dist"],exports:{".":{default:"./dist/index.js",types:"./dist/index.d.ts"}},author:"giveerr (https://github.com/giveerr)",homepage:"https://sirutils.com/",repository:{type:"git",url:"https://github.com/sirius-tedarik/sirutils.git"},devDependencies:{"@sirutils/builder":"workspace:*"},dependencies:{"@sirutils/core":"workspace:*","@sirutils/safe-toolbox":"workspace:*",ioredis:"^5.4.1"}};import{ProjectError as h,createPlugin as A}from"@sirutils/core";import{Evt as O}from"@sirutils/safe-toolbox";import{Redis as B}from"ioredis";import{extractEnvs as R}from"@sirutils/core";var u=R((t)=>({console:t.CONSOLE||"normal"})),f=86400;import{createLogger as b}from"@sirutils/core";var g=b(o.logger,u.console==="silent"?-999:999);import{ProjectError as v,Result as a,createActions as y,ok as P,unwrap as l}from"@sirutils/core";import{proxy as E,safeEjsonParse as S,safeEjsonStringify as c}from"@sirutils/safe-toolbox";var p=y((t)=>{return{get:async(...s)=>{let r=t.api.$client.pipeline();for(let e of s)r=r.get(e);const i=await r.exec();if(!i||i.some((e)=>e[0]!==null))return v.create(o.invalidResponse,"some keys are does return invalid result").throw();return i.map((e)=>e[1])},getJson:async(...s)=>{let r=t.api.$client.pipeline();for(let e of s)r=r.get(e);const i=await r.exec();if(!i)return v.create(o.invalidResponse,"some keys are does return invalid result").throw();return l(a.combine(i.map(([e,n])=>n?S(n):P(n))))},set:async(...s)=>{let r=t.api.$client.pipeline();for(let[i,e]of s)r=r.set(i,e,"EX",t.options.ttl);return await r.exec(),!0},setJson:async(...s)=>{let r=t.api.$client.pipeline();for(let[i,e]of s)r=r.set(i,l(c(e)),"EX",t.options.ttl);return await r.exec(),!0},setWithoutTtl:async(...s)=>{let r=t.api.$client.pipeline();for(let[i,e]of s)r=r.set(i,e);return await r.exec(),!0},setJsonWithoutTtl:async(...s)=>{let r=t.api.$client.pipeline();for(let[i,e]of s)r=r.set(i,l(c(e)));return await r.exec(),!0},del:async(...s)=>{let r=t.api.$client.pipeline();for(let i of s)r=r.del(i);return await r.exec(),!0},scan:(s,r)=>{return E(t.api.$client.scanStream({type:"string",match:s,...r?{count:r}:{}}),o.scan)}}},o.driver);var j=A({name:d.name,version:d.version},(t)=>{const s=O.create(),r=new B(t.options.client);return r.on("error",(i)=>{const e=h.create(o.redisGlobal,i.message).appendData(i);g.error(e.stringify()),s.post(e)}),r.on("connect",()=>{g.info("connected to redis")}),{$events:s,$client:r}},o.plugin,{ttl:f}).register(p).lock();export*from"ioredis";export{o as driverRedisTags,j as createRedisDriver}; | ||
import{tagBuilder as D}from"@sirutils/core";var m=D("@sirutils/driver-redis"),o={logger:m("logger"),plugin:m("plugin"),driver:m("driver"),redisGlobal:m("redis-global"),scan:m("driver#scan"),invalidResponse:m("invalid-response")};var d={name:"@sirutils/driver-redis",version:"0.2.2",type:"module",files:["dist"],exports:{".":{default:"./dist/index.js",types:"./dist/index.d.ts"}},author:"giveerr (https://github.com/giveerr)",homepage:"https://sirutils.com/",repository:{type:"git",url:"https://github.com/sirius-tedarik/sirutils.git"},devDependencies:{"@sirutils/builder":"workspace:*"},dependencies:{"@sirutils/core":"workspace:*","@sirutils/safe-toolbox":"workspace:*",ioredis:"^5.4.1"}};import{ProjectError as h,createPlugin as A}from"@sirutils/core";import{Evt as O}from"@sirutils/safe-toolbox";import{Redis as B}from"ioredis";import{extractEnvs as R}from"@sirutils/core";var u=R((t)=>({console:t.CONSOLE||"normal"})),f=86400;import{createLogger as b}from"@sirutils/core";var g=b(o.logger,u.console==="silent"?-999:999);import{ProjectError as v,Result as a,createActions as y,ok as P,unwrap as l}from"@sirutils/core";import{proxy as E,safeEjsonParse as S,safeEjsonStringify as c}from"@sirutils/safe-toolbox";var p=y((t)=>{return{get:async(...s)=>{let r=t.api.$client.pipeline();for(let e of s)r=r.get(e);const i=await r.exec();if(!i||i.some((e)=>e[0]!==null))return v.create(o.invalidResponse,"some keys are does return invalid result").throw();return i.map((e)=>e[1])},getJson:async(...s)=>{let r=t.api.$client.pipeline();for(let e of s)r=r.get(e);const i=await r.exec();if(!i)return v.create(o.invalidResponse,"some keys are does return invalid result").throw();return l(a.combine(i.map(([e,n])=>n?S(n):P(n))))},set:async(...s)=>{let r=t.api.$client.pipeline();for(let[i,e]of s)r=r.set(i,e,"EX",t.options.ttl);return await r.exec(),!0},setJson:async(...s)=>{let r=t.api.$client.pipeline();for(let[i,e]of s)r=r.set(i,l(c(e)),"EX",t.options.ttl);return await r.exec(),!0},setWithoutTtl:async(...s)=>{let r=t.api.$client.pipeline();for(let[i,e]of s)r=r.set(i,e);return await r.exec(),!0},setJsonWithoutTtl:async(...s)=>{let r=t.api.$client.pipeline();for(let[i,e]of s)r=r.set(i,l(c(e)));return await r.exec(),!0},del:async(...s)=>{let r=t.api.$client.pipeline();for(let i of s)r=r.del(i);return await r.exec(),!0},scan:(s,r)=>{return E(t.api.$client.scanStream({type:"string",match:s,...r?{count:r}:{}}),o.scan)}}},o.driver);var j=A({name:d.name,version:d.version},(t)=>{const s=O.create(),r=new B(t.options.client);return r.on("error",(i)=>{const e=h.create(o.redisGlobal,i.message).appendData(i);g.error(e.stringify()),s.post(e)}),r.on("connect",()=>{g.info("connected to redis")}),{$events:s,$client:r}},o.plugin,{ttl:f}).register(p).lock();export*from"ioredis";export{o as driverRedisTags,j as createRedisDriver}; | ||
//# debugId=E4E15446A930BB4E64756E2164756E21 | ||
//# debugId=68AF99D56374E7F964756E2164756E21 |
// @bun | ||
import{tagBuilder as b}from"@sirutils/core";var d=b("@sirutils/driver-redis"),e={logger:d("logger"),plugin:d("plugin"),driver:d("driver"),redisGlobal:d("redis-global"),scan:d("driver#scan"),invalidResponse:d("invalid-response")};var t={name:"@sirutils/driver-redis",version:"0.2.1",type:"module",files:["dist"],exports:{".":{default:"./dist/index.js",types:"./dist/index.d.ts"}},author:"giveerr (https://github.com/giveerr)",homepage:"https://sirutils.com/",repository:{type:"git",url:"https://github.com/sirius-tedarik/sirutils.git"},devDependencies:{"@sirutils/builder":"workspace:*"},dependencies:{"@sirutils/core":"workspace:*","@sirutils/safe-toolbox":"workspace:*",ioredis:"^5.4.1"}};import{ProjectError as y,createPlugin as A}from"@sirutils/core";import{Evt as F}from"@sirutils/safe-toolbox";import{Redis as G}from"ioredis";import{extractEnvs as L}from"@sirutils/core";var l=L((m)=>({console:m.CONSOLE||"normal"})),T=86400;import{createLogger as E}from"@sirutils/core";var f=E(e.logger,l.console==="silent"?-999:999);import{ProjectError as c,Result as R,createActions as p,ok as B,unwrap as g}from"@sirutils/core";import{proxy as O,safeEjsonParse as S,safeEjsonStringify as u}from"@sirutils/safe-toolbox";var D=p((m)=>{return{get:async(...i)=>{let r=m.api.$client.pipeline();for(let s of i)r=r.get(s);const o=await r.exec();if(!o||o.some((s)=>s[0]!==null))return c.create(e.invalidResponse,"some keys are does return invalid result").throw();return o.map((s)=>s[1])},getJson:async(...i)=>{let r=m.api.$client.pipeline();for(let s of i)r=r.get(s);const o=await r.exec();if(!o)return c.create(e.invalidResponse,"some keys are does return invalid result").throw();return g(R.combine(o.map(([s,v])=>v?S(v):B(v))))},set:async(...i)=>{let r=m.api.$client.pipeline();for(let[o,s]of i)r=r.set(o,s,"EX",m.options.ttl);return await r.exec(),!0},setJson:async(...i)=>{let r=m.api.$client.pipeline();for(let[o,s]of i)r=r.set(o,g(u(s)),"EX",m.options.ttl);return await r.exec(),!0},setWithoutTtl:async(...i)=>{let r=m.api.$client.pipeline();for(let[o,s]of i)r=r.set(o,s);return await r.exec(),!0},setJsonWithoutTtl:async(...i)=>{let r=m.api.$client.pipeline();for(let[o,s]of i)r=r.set(o,g(u(s)));return await r.exec(),!0},del:async(...i)=>{let r=m.api.$client.pipeline();for(let o of i)r=r.del(o);return await r.exec(),!0},scan:(i,r)=>{return O(m.api.$client.scanStream({type:"string",match:i,...r?{count:r}:{}}),e.scan)}}},e.driver);var j=A({name:t.name,version:t.version},(m)=>{const i=F.create(),r=new G(m.options.client);return r.on("error",(o)=>{const s=y.create(e.redisGlobal,o.message).appendData(o);f.error(s.stringify()),i.post(s)}),r.on("connect",()=>{f.info("connected to redis")}),{$events:i,$client:r}},e.plugin,{ttl:T}).register(D).lock();export{j as createRedisDriver}; | ||
import{tagBuilder as b}from"@sirutils/core";var d=b("@sirutils/driver-redis"),e={logger:d("logger"),plugin:d("plugin"),driver:d("driver"),redisGlobal:d("redis-global"),scan:d("driver#scan"),invalidResponse:d("invalid-response")};var t={name:"@sirutils/driver-redis",version:"0.2.2",type:"module",files:["dist"],exports:{".":{default:"./dist/index.js",types:"./dist/index.d.ts"}},author:"giveerr (https://github.com/giveerr)",homepage:"https://sirutils.com/",repository:{type:"git",url:"https://github.com/sirius-tedarik/sirutils.git"},devDependencies:{"@sirutils/builder":"workspace:*"},dependencies:{"@sirutils/core":"workspace:*","@sirutils/safe-toolbox":"workspace:*",ioredis:"^5.4.1"}};import{ProjectError as y,createPlugin as A}from"@sirutils/core";import{Evt as F}from"@sirutils/safe-toolbox";import{Redis as G}from"ioredis";import{extractEnvs as L}from"@sirutils/core";var l=L((m)=>({console:m.CONSOLE||"normal"})),T=86400;import{createLogger as E}from"@sirutils/core";var f=E(e.logger,l.console==="silent"?-999:999);import{ProjectError as c,Result as R,createActions as p,ok as B,unwrap as g}from"@sirutils/core";import{proxy as O,safeEjsonParse as S,safeEjsonStringify as u}from"@sirutils/safe-toolbox";var D=p((m)=>{return{get:async(...i)=>{let r=m.api.$client.pipeline();for(let s of i)r=r.get(s);const o=await r.exec();if(!o||o.some((s)=>s[0]!==null))return c.create(e.invalidResponse,"some keys are does return invalid result").throw();return o.map((s)=>s[1])},getJson:async(...i)=>{let r=m.api.$client.pipeline();for(let s of i)r=r.get(s);const o=await r.exec();if(!o)return c.create(e.invalidResponse,"some keys are does return invalid result").throw();return g(R.combine(o.map(([s,v])=>v?S(v):B(v))))},set:async(...i)=>{let r=m.api.$client.pipeline();for(let[o,s]of i)r=r.set(o,s,"EX",m.options.ttl);return await r.exec(),!0},setJson:async(...i)=>{let r=m.api.$client.pipeline();for(let[o,s]of i)r=r.set(o,g(u(s)),"EX",m.options.ttl);return await r.exec(),!0},setWithoutTtl:async(...i)=>{let r=m.api.$client.pipeline();for(let[o,s]of i)r=r.set(o,s);return await r.exec(),!0},setJsonWithoutTtl:async(...i)=>{let r=m.api.$client.pipeline();for(let[o,s]of i)r=r.set(o,g(u(s)));return await r.exec(),!0},del:async(...i)=>{let r=m.api.$client.pipeline();for(let o of i)r=r.del(o);return await r.exec(),!0},scan:(i,r)=>{return O(m.api.$client.scanStream({type:"string",match:i,...r?{count:r}:{}}),e.scan)}}},e.driver);var j=A({name:t.name,version:t.version},(m)=>{const i=F.create(),r=new G(m.options.client);return r.on("error",(o)=>{const s=y.create(e.redisGlobal,o.message).appendData(o);f.error(s.stringify()),i.post(s)}),r.on("connect",()=>{f.info("connected to redis")}),{$events:i,$client:r}},e.plugin,{ttl:T}).register(D).lock();export{j as createRedisDriver}; | ||
//# debugId=9B631DF339EB677D64756E2164756E21 | ||
//# debugId=68F8DC010AFF80C764756E2164756E21 |
{ | ||
"name": "@sirutils/driver-redis", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"type": "module", | ||
@@ -21,9 +21,9 @@ "files": [ | ||
"devDependencies": { | ||
"@sirutils/builder": "0.2.1" | ||
"@sirutils/builder": "0.2.2" | ||
}, | ||
"dependencies": { | ||
"ioredis": "^5.4.1", | ||
"@sirutils/core": "0.2.1", | ||
"@sirutils/safe-toolbox": "0.2.1" | ||
"@sirutils/core": "0.2.2", | ||
"@sirutils/safe-toolbox": "0.2.2" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
+ Added@sirutils/core@0.2.2(transitive)
+ Added@sirutils/safe-toolbox@0.2.2(transitive)
- Removed@sirutils/core@0.2.1(transitive)
- Removed@sirutils/safe-toolbox@0.2.1(transitive)
Updated@sirutils/core@0.2.2
Updated@sirutils/safe-toolbox@0.2.2