@sirutils/driver-redis
Advanced tools
Comparing version 0.1.6 to 0.1.7
// @bun | ||
import{tagBuilder as p}from"@sirutils/core";var m=p("@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 n={name:"@sirutils/driver-redis",version:"0.1.6",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 P,createPlugin as S}from"@sirutils/core";import{Evt as h}from"@sirutils/safe-toolbox";import{Redis as A}from"ioredis";import{extractEnvs as T}from"@sirutils/core";var l=T((t)=>({console:t.CONSOLE||"normal"})),u=86400;import{createLogger as R}from"@sirutils/core";var g=R(o.logger,l.console==="silent"?-999:999);import{ProjectError as f,Result as b,createActions as a,unwrap as d}from"@sirutils/core";import{proxy as E,safeJsonParse as y,safeJsonStringify as v}from"@sirutils/safe-toolbox";var c=a((t)=>{return{get:async(...s)=>{let r=t.api.$client.pipeline();for(let i of s)r=r.get(i);const e=await r.exec();if(!e||e.some((i)=>i[0]!==null))return f.create(o.invalidResponse,"some keys are does return invalid result").throw();return e.map((i)=>i[1])},getJson:async(...s)=>{let r=t.api.$client.pipeline();for(let i of s)r=r.get(i);const e=await r.exec();if(!e)return f.create(o.invalidResponse,"some keys are does return invalid result").throw();return d(b.combine(e.map((i)=>i?y(i[1]):i)))},set:async(...s)=>{let r=t.api.$client.pipeline();for(let[e,i]of s)r=r.set(e,i,"EX",t.options.ttl);return await r.exec(),!0},setJson:async(...s)=>{let r=t.api.$client.pipeline();for(let[e,i]of s)r=r.set(e,d(v(i)),"EX",t.options.ttl);return await r.exec(),!0},setWithoutTtl:async(...s)=>{let r=t.api.$client.pipeline();for(let[e,i]of s)r=r.set(e,i);return await r.exec(),!0},setJsonWithoutTtl:async(...s)=>{let r=t.api.$client.pipeline();for(let[e,i]of s)r=r.set(e,d(v(i)));return await r.exec(),!0},del:async(...s)=>{let r=t.api.$client.pipeline();for(let e of s)r=r.del(e);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 Q=S({name:n.name,version:n.version},(t)=>{const s=h.create(),r=new A(t.options.client);return r.on("error",(e)=>{const i=P.create(o.redisGlobal,e.message).appendData(e);g.error(i.stringify()),s.post(i)}),r.on("connect",()=>{g.info("connected to redis")}),{$events:s,$client:r}},o.plugin,{ttl:u}).register(c).lock();export*from"ioredis";export{o as driverRedisTags,Q as createRedisDriver}; | ||
import{tagBuilder as p}from"@sirutils/core";var m=p("@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 n={name:"@sirutils/driver-redis",version:"0.1.7",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 P,createPlugin as S}from"@sirutils/core";import{Evt as h}from"@sirutils/safe-toolbox";import{Redis as A}from"ioredis";import{extractEnvs as T}from"@sirutils/core";var l=T((t)=>({console:t.CONSOLE||"normal"})),u=86400;import{createLogger as R}from"@sirutils/core";var g=R(o.logger,l.console==="silent"?-999:999);import{ProjectError as f,Result as b,createActions as a,unwrap as d}from"@sirutils/core";import{proxy as E,safeJsonParse as y,safeJsonStringify as v}from"@sirutils/safe-toolbox";var c=a((t)=>{return{get:async(...s)=>{let r=t.api.$client.pipeline();for(let i of s)r=r.get(i);const e=await r.exec();if(!e||e.some((i)=>i[0]!==null))return f.create(o.invalidResponse,"some keys are does return invalid result").throw();return e.map((i)=>i[1])},getJson:async(...s)=>{let r=t.api.$client.pipeline();for(let i of s)r=r.get(i);const e=await r.exec();if(!e)return f.create(o.invalidResponse,"some keys are does return invalid result").throw();return d(b.combine(e.map((i)=>i?y(i[1]):i)))},set:async(...s)=>{let r=t.api.$client.pipeline();for(let[e,i]of s)r=r.set(e,i,"EX",t.options.ttl);return await r.exec(),!0},setJson:async(...s)=>{let r=t.api.$client.pipeline();for(let[e,i]of s)r=r.set(e,d(v(i)),"EX",t.options.ttl);return await r.exec(),!0},setWithoutTtl:async(...s)=>{let r=t.api.$client.pipeline();for(let[e,i]of s)r=r.set(e,i);return await r.exec(),!0},setJsonWithoutTtl:async(...s)=>{let r=t.api.$client.pipeline();for(let[e,i]of s)r=r.set(e,d(v(i)));return await r.exec(),!0},del:async(...s)=>{let r=t.api.$client.pipeline();for(let e of s)r=r.del(e);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 Q=S({name:n.name,version:n.version},(t)=>{const s=h.create(),r=new A(t.options.client);return r.on("error",(e)=>{const i=P.create(o.redisGlobal,e.message).appendData(e);g.error(i.stringify()),s.post(i)}),r.on("connect",()=>{g.info("connected to redis")}),{$events:s,$client:r}},o.plugin,{ttl:u}).register(c).lock();export*from"ioredis";export{o as driverRedisTags,Q as createRedisDriver}; | ||
//# debugId=22B81859495800DC64756E2164756E21 | ||
//# debugId=88F1D91E4B67E6A864756E2164756E21 |
// @bun | ||
import{tagBuilder as D}from"@sirutils/core";var d=D("@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 v={name:"@sirutils/driver-redis",version:"0.1.6",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 O,createPlugin as S}from"@sirutils/core";import{Evt as y}from"@sirutils/safe-toolbox";import{Redis as A}from"ioredis";import{extractEnvs as b}from"@sirutils/core";var g=b((m)=>({console:m.CONSOLE||"normal"})),l=86400;import{createLogger as h}from"@sirutils/core";var t=h(e.logger,g.console==="silent"?-999:999);import{ProjectError as T,Result as L,createActions as R,unwrap as f}from"@sirutils/core";import{proxy as p,safeJsonParse as B,safeJsonStringify as c}from"@sirutils/safe-toolbox";var u=R((m)=>{return{get:async(...i)=>{let r=m.api.$client.pipeline();for(let o of i)r=r.get(o);const s=await r.exec();if(!s||s.some((o)=>o[0]!==null))return T.create(e.invalidResponse,"some keys are does return invalid result").throw();return s.map((o)=>o[1])},getJson:async(...i)=>{let r=m.api.$client.pipeline();for(let o of i)r=r.get(o);const s=await r.exec();if(!s)return T.create(e.invalidResponse,"some keys are does return invalid result").throw();return f(L.combine(s.map((o)=>o?B(o[1]):o)))},set:async(...i)=>{let r=m.api.$client.pipeline();for(let[s,o]of i)r=r.set(s,o,"EX",m.options.ttl);return await r.exec(),!0},setJson:async(...i)=>{let r=m.api.$client.pipeline();for(let[s,o]of i)r=r.set(s,f(c(o)),"EX",m.options.ttl);return await r.exec(),!0},setWithoutTtl:async(...i)=>{let r=m.api.$client.pipeline();for(let[s,o]of i)r=r.set(s,o);return await r.exec(),!0},setJsonWithoutTtl:async(...i)=>{let r=m.api.$client.pipeline();for(let[s,o]of i)r=r.set(s,f(c(o)));return await r.exec(),!0},del:async(...i)=>{let r=m.api.$client.pipeline();for(let s of i)r=r.del(s);return await r.exec(),!0},scan:(i,r)=>{return p(m.api.$client.scanStream({type:"string",match:i,...r?{count:r}:{}}),e.scan)}}},e.driver);var Y=S({name:v.name,version:v.version},(m)=>{const i=y.create(),r=new A(m.options.client);return r.on("error",(s)=>{const o=O.create(e.redisGlobal,s.message).appendData(s);t.error(o.stringify()),i.post(o)}),r.on("connect",()=>{t.info("connected to redis")}),{$events:i,$client:r}},e.plugin,{ttl:l}).register(u).lock();export{Y as createRedisDriver}; | ||
import{tagBuilder as D}from"@sirutils/core";var d=D("@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 v={name:"@sirutils/driver-redis",version:"0.1.7",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 O,createPlugin as S}from"@sirutils/core";import{Evt as y}from"@sirutils/safe-toolbox";import{Redis as A}from"ioredis";import{extractEnvs as b}from"@sirutils/core";var g=b((m)=>({console:m.CONSOLE||"normal"})),l=86400;import{createLogger as h}from"@sirutils/core";var t=h(e.logger,g.console==="silent"?-999:999);import{ProjectError as T,Result as L,createActions as R,unwrap as f}from"@sirutils/core";import{proxy as p,safeJsonParse as B,safeJsonStringify as c}from"@sirutils/safe-toolbox";var u=R((m)=>{return{get:async(...i)=>{let r=m.api.$client.pipeline();for(let o of i)r=r.get(o);const s=await r.exec();if(!s||s.some((o)=>o[0]!==null))return T.create(e.invalidResponse,"some keys are does return invalid result").throw();return s.map((o)=>o[1])},getJson:async(...i)=>{let r=m.api.$client.pipeline();for(let o of i)r=r.get(o);const s=await r.exec();if(!s)return T.create(e.invalidResponse,"some keys are does return invalid result").throw();return f(L.combine(s.map((o)=>o?B(o[1]):o)))},set:async(...i)=>{let r=m.api.$client.pipeline();for(let[s,o]of i)r=r.set(s,o,"EX",m.options.ttl);return await r.exec(),!0},setJson:async(...i)=>{let r=m.api.$client.pipeline();for(let[s,o]of i)r=r.set(s,f(c(o)),"EX",m.options.ttl);return await r.exec(),!0},setWithoutTtl:async(...i)=>{let r=m.api.$client.pipeline();for(let[s,o]of i)r=r.set(s,o);return await r.exec(),!0},setJsonWithoutTtl:async(...i)=>{let r=m.api.$client.pipeline();for(let[s,o]of i)r=r.set(s,f(c(o)));return await r.exec(),!0},del:async(...i)=>{let r=m.api.$client.pipeline();for(let s of i)r=r.del(s);return await r.exec(),!0},scan:(i,r)=>{return p(m.api.$client.scanStream({type:"string",match:i,...r?{count:r}:{}}),e.scan)}}},e.driver);var Y=S({name:v.name,version:v.version},(m)=>{const i=y.create(),r=new A(m.options.client);return r.on("error",(s)=>{const o=O.create(e.redisGlobal,s.message).appendData(s);t.error(o.stringify()),i.post(o)}),r.on("connect",()=>{t.info("connected to redis")}),{$events:i,$client:r}},e.plugin,{ttl:l}).register(u).lock();export{Y as createRedisDriver}; | ||
//# debugId=193FE03082020B7964756E2164756E21 | ||
//# debugId=2DD28BD4EDA4CABD64756E2164756E21 |
{ | ||
"name": "@sirutils/driver-redis", | ||
"version": "0.1.6", | ||
"version": "0.1.7", | ||
"type": "module", | ||
@@ -21,9 +21,9 @@ "files": [ | ||
"devDependencies": { | ||
"@sirutils/builder": "0.1.6" | ||
"@sirutils/builder": "0.1.7" | ||
}, | ||
"dependencies": { | ||
"ioredis": "^5.4.1", | ||
"@sirutils/core": "0.1.6", | ||
"@sirutils/safe-toolbox": "0.1.6" | ||
"@sirutils/safe-toolbox": "0.1.7", | ||
"@sirutils/core": "0.1.7" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
+ Added@sirutils/core@0.1.7(transitive)
+ Added@sirutils/safe-toolbox@0.1.7(transitive)
- Removed@sirutils/core@0.1.6(transitive)
- Removed@sirutils/safe-toolbox@0.1.6(transitive)
Updated@sirutils/core@0.1.7
Updated@sirutils/safe-toolbox@0.1.7