@ez4/local-queue 0.40.0 → 0.42.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/dist/main.cjs CHANGED
@@ -15,9 +15,9 @@ ervices"),B=s(async(e,t,r)=>{let{reference:o,schema:n}=e;return b(o,n,t).sendMes
15
15
  JSON.parse(r.body.toString()))},"handleQueueForward");var v=require("@ez4/local-common"),z=require("@ez4/queue/utils"),j=require("@ez4/project/library"),
16
16
  I=require("@ez4/utils");var u=require("@ez4/local-common"),S=require("@ez4/queue/utils"),w=require("@ez4/utils"),
17
17
  q=require("@ez4/common");var C=s(async(e,t,r,o,n)=>{let{services:a}=e,i=await r.makeClients(a),m=(0,w.getRandomUUID)();
18
- q.Runtime.setScope({isLocal:!0,traceId:m});let c=await(0,u.createModule)({listener:o.
19
- listener,handler:o.handler,version:t.version,variables:{...t.variables,...e.variables,
20
- ...o.variables}}),l,g={requestId:(0,w.getRandomUUID)(),traceId:m},N=s((d,$)=>(0,S.resolveValidation)(
18
+ q.Runtime.setScope({traceId:m});let c=await(0,u.createModule)({listener:o.listener,
19
+ handler:o.handler,version:t.version,variables:{...t.variables,...e.variables,...o.
20
+ variables}}),l,g={requestId:(0,w.getRandomUUID)(),traceId:m},N=s((d,$)=>(0,S.resolveValidation)(
21
21
  d,i,$.type),"onCustomValidation");try{await(0,u.onBegin)(c,i,g),l={...g,message:await(0,S.getJsonMessage)(
22
22
  n,e.schema,N)},await(0,u.onReady)(c,i,l),await c.handler(l,i),await(0,u.onDone)(
23
23
  c,i,l)}catch(d){throw await(0,u.onError)(c,i,l??g,d),d}finally{await(0,u.onEnd)(
package/dist/main.mjs CHANGED
@@ -15,12 +15,11 @@ MalformedMessageError as U}from"@ez4/queue/utils";import{getServiceName as D}fro
15
15
  import{getRandomInteger as B}from"@ez4/utils";import{createModule as z,onBegin as j,onReady as I,onDone as T,onError as L,onEnd as A}from"@ez4/local-common";
16
16
  import{getJsonMessage as N,resolveValidation as $}from"@ez4/queue/utils";import{
17
17
  getRandomUUID as f}from"@ez4/utils";import{Runtime as H}from"@ez4/common";var S=o(async(e,t,r,n,i)=>{let{services:a}=e,s=await r.makeClients(a),m=f();H.setScope(
18
- {isLocal:!0,traceId:m});let u=await z({listener:n.listener,handler:n.handler,version:t.
19
- version,variables:{...t.variables,...e.variables,...n.variables}}),c,p={requestId:f(),
20
- traceId:m},w=o((l,O)=>$(l,s,O.type),"onCustomValidation");try{await j(u,s,p),c={
21
- ...p,message:await N(i,e.schema,w)},await I(u,s,c),await u.handler(c,s),await T(
22
- u,s,c)}catch(l){throw await L(u,s,c??p,l),l}finally{await A(u,s,p)}},"processLam\
23
- bdaMessage");import{getJsonMessage as P}from"@ez4/queue/utils";import{Logger as J}from"@ez4/logger";var v=o((e,t,r)=>new class{async sendMessage(n,i){J.debug(`\u2709\uFE0F Sending message t\
18
+ {traceId:m});let u=await z({listener:n.listener,handler:n.handler,version:t.version,
19
+ variables:{...t.variables,...e.variables,...n.variables}}),c,p={requestId:f(),traceId:m},
20
+ w=o((l,O)=>$(l,s,O.type),"onCustomValidation");try{await j(u,s,p),c={...p,message:await N(
21
+ i,e.schema,w)},await I(u,s,c),await u.handler(c,s),await T(u,s,c)}catch(l){throw await L(
22
+ u,s,c??p,l),l}finally{await A(u,s,p)}},"processLambdaMessage");import{getJsonMessage as P}from"@ez4/queue/utils";import{Logger as J}from"@ez4/logger";var v=o((e,t,r)=>new class{async sendMessage(n,i){J.debug(`\u2709\uFE0F Sending message t\
24
23
  o queue [${e}]`);let a=await P(n,t),s=i?.delay??r.delay;setTimeout(()=>r.handler(
25
24
  a),s*1e3)}receiveMessage(){throw new Error("Receive message isn't supported yet.")}},
26
25
  "createLocalClient");var h=o((e,t,r)=>{let{name:n,schema:i}=e,a={...t,delay:e.delay??0,handler:o(s=>b(
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ez4/local-queue",
3
3
  "description": "EZ4: Local queue emulator",
4
- "version": "0.40.0",
4
+ "version": "0.42.0",
5
5
  "author": "Silas B.",
6
6
  "license": "MIT",
7
7
  "type": "module",
@@ -43,12 +43,12 @@
43
43
  "live:publish": "npm run build && npm publish --access public"
44
44
  },
45
45
  "dependencies": {
46
- "@ez4/common": "^0.40.0",
47
- "@ez4/logger": "^0.40.0",
48
- "@ez4/local-common": "^0.40.0",
49
- "@ez4/project": "^0.40.0",
50
- "@ez4/queue": "^0.40.0",
51
- "@ez4/utils": "^0.40.0",
52
- "@ez4/validator": "^0.40.0"
46
+ "@ez4/common": "^0.42.0",
47
+ "@ez4/logger": "^0.42.0",
48
+ "@ez4/local-common": "^0.42.0",
49
+ "@ez4/project": "^0.42.0",
50
+ "@ez4/queue": "^0.42.0",
51
+ "@ez4/utils": "^0.42.0",
52
+ "@ez4/validator": "^0.42.0"
53
53
  }
54
54
  }