lonnymq 0.0.30 → 1.0.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Tim Lonsdale
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # LonnyMQ
2
2
 
3
- A high-performance, multi-tenant PostgreSQL message queue implementation for Node.js/TypeScript. Docs can be found [here](https://tlonny.github.io/lonnymq)
3
+ A high-performance, multi-tenant PostgreSQL message queue implementation for Node.js/TypeScript.
4
4
 
5
5
  ## Features
6
6
 
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- var{defineProperty:T,getOwnPropertyNames:H,getOwnPropertyDescriptor:w}=Object,k=Object.prototype.hasOwnProperty;var I=new WeakMap,P=(e)=>{var t=I.get(e),a;if(t)return t;if(t=T({},"__esModule",{value:!0}),e&&typeof e==="object"||typeof e==="function")H(e).map((E)=>!k.call(t,E)&&T(t,E,{get:()=>e[E],enumerable:!(a=w(e,E))||a.enumerable}));return I.set(e,t),t};var Q=(e,t)=>{for(var a in t)T(e,a,{get:t[a],enumerable:!0,configurable:!0,set:(E)=>t[a]=()=>E})};var re={};Q(re,{Queue:()=>D,MessageHeartbeatCommand:()=>m,MessageDequeueCommand:()=>o,MessageDeleteCommand:()=>i,MessageDeferCommand:()=>d,MessageCreateCommand:()=>l,ChannelPolicySetCommand:()=>u,ChannelPolicyClearCommand:()=>c});module.exports=P(re);var r=(e)=>({nodeType:"VALUE",value:e}),s=(e)=>({nodeType:"REF",value:e}),z=(e)=>({nodeType:"RAW",value:e}),V=(e)=>{return`'${e.replace(/'/g,"''")}'`},W=(e)=>{if(e===null)return"NULL";else if(typeof e==="string")return V(e);else if(typeof e==="number")return e.toString();else if(typeof e==="boolean")return e?"TRUE":"FALSE";else if(e instanceof Date)return`'${e.toISOString()}'`;else if(typeof e==="bigint")return e.toString();else throw new Error(`Unsupported value type: ${typeof e}`)},Y=(e)=>{return`"${e.replace(/"/g,'""')}"`},X=(e)=>{if(e.nodeType==="VALUE")return W(e.value);else if(e.nodeType==="REF")return Y(e.value);else if(e.nodeType==="RAW")return e.value;else throw new Error("Unsupported SQL node type")};var n=(e,...t)=>{let a=[];for(let E=0;E<e.length;E+=1)if(a.push(e[E]),E<t.length)a.push(X(t[E]));return z(a.join(""))};class c{schema;channelId;createdAt;constructor(e){this.schema=e.schema,this.channelId=e.channelId,this.createdAt=new Date}async execute(e){await e.query(n`
1
+ var{defineProperty:T,getOwnPropertyNames:H,getOwnPropertyDescriptor:w}=Object,k=Object.prototype.hasOwnProperty;var I=new WeakMap,P=(e)=>{var t=I.get(e),a;if(t)return t;if(t=T({},"__esModule",{value:!0}),e&&typeof e==="object"||typeof e==="function")H(e).map((E)=>!k.call(t,E)&&T(t,E,{get:()=>e[E],enumerable:!(a=w(e,E))||a.enumerable}));return I.set(e,t),t};var Q=(e,t)=>{for(var a in t)T(e,a,{get:t[a],enumerable:!0,configurable:!0,set:(E)=>t[a]=()=>E})};var re={};Q(re,{Queue:()=>D,MessageHeartbeatCommand:()=>m,MessageDequeueCommand:()=>o,MessageDeleteCommand:()=>i,MessageDeferCommand:()=>d,MessageCreateCommand:()=>l,ChannelPolicySetCommand:()=>u,ChannelPolicyClearCommand:()=>c});module.exports=P(re);var r=(e)=>({nodeType:"VALUE",value:e}),s=(e)=>({nodeType:"REF",value:e}),z=(e)=>({nodeType:"RAW",value:e}),V=(e)=>{return`'${e.replace(/'/g,"''")}'`},W=(e)=>{if(e===null)return"NULL";else if(typeof e==="string")return V(e);else if(typeof e==="number")return e.toString();else if(typeof e==="boolean")return e?"TRUE":"FALSE";else if(e instanceof Date)return`'${e.toISOString()}'`;else if(typeof e==="bigint")return e.toString();else throw Error(`Unsupported value type: ${typeof e}`)},Y=(e)=>{return`"${e.replace(/"/g,'""')}"`},X=(e)=>{if(e.nodeType==="VALUE")return W(e.value);else if(e.nodeType==="REF")return Y(e.value);else if(e.nodeType==="RAW")return e.value;else throw Error("Unsupported SQL node type")};var n=(e,...t)=>{let a=[];for(let E=0;E<e.length;E+=1)if(a.push(e[E]),E<t.length)a.push(X(t[E]));return z(a.join(""))};class c{schema;channelId;createdAt;constructor(e){this.schema=e.schema,this.channelId=e.channelId,this.createdAt=new Date}async execute(e){await e.query(n`
2
2
  SELECT 1 FROM ${s(this.schema)}."channel_policy_clear"(
3
3
  $1
4
4
  )
@@ -18,32 +18,32 @@ var{defineProperty:T,getOwnPropertyNames:H,getOwnPropertyDescriptor:w}=Object,k=
18
18
  $2,
19
19
  $3::BIGINT
20
20
  )
21
- `.value,[this.channelId,this.content,this.dequeueAt]).then((a)=>a.rows[0]);if(t.result_code===0)return{resultType:"MESSAGE_CREATED",id:BigInt(t.metadata.id),channelSize:t.metadata.channel_size};else if(t.result_code===1)return{resultType:"MESSAGE_DROPPED"};else throw new Error("Unexpected result code")}}class o{schema;lockMs;constructor(e){this.schema=e.schema,this.lockMs=e.lockMs}async execute(e){let t=await e.query(n`
21
+ `.value,[this.channelId,this.content,this.dequeueAt]).then((a)=>a.rows[0]);if(t.result_code===0)return{resultType:"MESSAGE_CREATED",id:BigInt(t.metadata.id),channelSize:t.metadata.channel_size};else if(t.result_code===1)return{resultType:"MESSAGE_DROPPED"};else throw Error("Unexpected result code")}}class o{schema;lockMs;constructor(e){this.schema=e.schema,this.lockMs=e.lockMs}async execute(e){let t=await e.query(n`
22
22
  SELECT
23
23
  result_code,
24
24
  metadata,
25
25
  content,
26
26
  state
27
27
  FROM ${s(this.schema)}."message_dequeue"($1::BIGINT)
28
- `.value,[this.lockMs]).then((a)=>a.rows[0]);if(t.result_code===0)return{resultType:"MESSAGE_NOT_AVAILABLE"};else if(t.result_code===1)return{resultType:"MESSAGE_DEQUEUED",id:BigInt(t.metadata.id),channelId:t.metadata.channel_id,isUnlocked:t.metadata.is_unlocked,content:t.content,state:t.state,numAttempts:t.metadata.num_attempts};else throw new Error("Unexpected dequeue result")}}class i{schema;id;numAttempts;constructor(e){this.schema=e.schema,this.id=e.id,this.numAttempts=e.numAttempts}async execute(e){let t=await e.query(n`
28
+ `.value,[this.lockMs]).then((a)=>a.rows[0]);if(t.result_code===0)return{resultType:"MESSAGE_NOT_AVAILABLE"};else if(t.result_code===1)return{resultType:"MESSAGE_DEQUEUED",id:BigInt(t.metadata.id),channelId:t.metadata.channel_id,isUnlocked:t.metadata.is_unlocked,content:t.content,state:t.state,numAttempts:t.metadata.num_attempts};else throw Error("Unexpected dequeue result")}}class i{schema;id;numAttempts;constructor(e){this.schema=e.schema,this.id=e.id,this.numAttempts=e.numAttempts}async execute(e){let t=await e.query(n`
29
29
  SELECT * FROM ${s(this.schema)}."message_delete"(
30
30
  $1::BIGINT,
31
31
  $2::BIGINT
32
32
  )
33
- `.value,[this.id.toString(),this.numAttempts]).then((a)=>a.rows[0]);if(t.result_code===0)return{resultType:"MESSAGE_NOT_FOUND"};else if(t.result_code===1)return{resultType:"STATE_INVALID"};else if(t.result_code===2)return{resultType:"MESSAGE_DELETED"};else throw new Error("Unexpected result")}}class d{schema;id;numAttempts;state;dequeueAt;constructor(e){this.schema=e.schema,this.numAttempts=e.numAttempts,this.id=e.id,this.state=e.state,this.dequeueAt=e.dequeueAt}async execute(e){let t=await e.query(n`
33
+ `.value,[this.id.toString(),this.numAttempts]).then((a)=>a.rows[0]);if(t.result_code===0)return{resultType:"MESSAGE_NOT_FOUND"};else if(t.result_code===1)return{resultType:"STATE_INVALID"};else if(t.result_code===2)return{resultType:"MESSAGE_DELETED"};else throw Error("Unexpected result")}}class d{schema;id;numAttempts;state;dequeueAt;constructor(e){this.schema=e.schema,this.numAttempts=e.numAttempts,this.id=e.id,this.state=e.state,this.dequeueAt=e.dequeueAt}async execute(e){let t=await e.query(n`
34
34
  SELECT * FROM ${s(this.schema)}."message_defer"(
35
35
  $1::BIGINT,
36
36
  $2::BIGINT,
37
37
  $3::BIGINT,
38
38
  $4
39
39
  )
40
- `.value,[this.id.toString(),this.numAttempts,this.dequeueAt,this.state]).then((a)=>a.rows[0]);if(t.result_code===0)return{resultType:"MESSAGE_NOT_FOUND"};else if(t.result_code===1)return{resultType:"STATE_INVALID"};else if(t.result_code===2)return{resultType:"MESSAGE_DEFERRED"};else throw new Error("Unexpected result")}}class m{schema;id;numAttempts;lockMs;constructor(e){this.schema=e.schema,this.numAttempts=e.numAttempts,this.id=e.id,this.lockMs=e.lockMs}async execute(e){let t=await e.query(n`
40
+ `.value,[this.id.toString(),this.numAttempts,this.dequeueAt,this.state]).then((a)=>a.rows[0]);if(t.result_code===0)return{resultType:"MESSAGE_NOT_FOUND"};else if(t.result_code===1)return{resultType:"STATE_INVALID"};else if(t.result_code===2)return{resultType:"MESSAGE_DEFERRED"};else throw Error("Unexpected result")}}class m{schema;id;numAttempts;lockMs;constructor(e){this.schema=e.schema,this.numAttempts=e.numAttempts,this.id=e.id,this.lockMs=e.lockMs}async execute(e){let t=await e.query(n`
41
41
  SELECT * FROM ${s(this.schema)}."message_heartbeat"(
42
42
  $1::BIGINT,
43
43
  $2::BIGINT,
44
44
  $3::BIGINT
45
45
  )
46
- `.value,[this.id.toString(),this.numAttempts,this.lockMs]).then((a)=>a.rows[0]);if(t.result_code===0)return{resultType:"MESSAGE_NOT_FOUND"};else if(t.result_code===1)return{resultType:"MESSAGE_STATE_INVALID"};else if(t.result_code===2)return{resultType:"MESSAGE_HEARTBEATED"};else throw new Error("Unexpected result")}}var y=(e)=>{let t=e.split(`
46
+ `.value,[this.id.toString(),this.numAttempts,this.lockMs]).then((a)=>a.rows[0]);if(t.result_code===0)return{resultType:"MESSAGE_NOT_FOUND"};else if(t.result_code===1)return{resultType:"MESSAGE_STATE_INVALID"};else if(t.result_code===2)return{resultType:"MESSAGE_HEARTBEATED"};else throw Error("Unexpected result")}}var y=(e)=>{let t=e.split(`
47
47
  `),a=Number.MAX_SAFE_INTEGER;for(let E of t){if(E.trim().length===0)continue;let B=E.search(/\S/);a=Math.min(a,B)}return t.map((E)=>E.slice(a)).join(`
48
48
  `).trim()};var h=require("path"),__filename="/home/runner/work/lonnymq/lonnymq/src/core/path.ts",te=h.dirname(h.dirname(__filename)),se=new RegExp(`^${te}/`),_=(e)=>{return e.replace(se,"")};var __filename="/home/runner/work/lonnymq/lonnymq/src/install/table-channel-policy.ts",v={name:_(__filename),sql:(e)=>{return[n`
49
49
  CREATE TABLE ${s(e.schema)}."channel_policy" (
@@ -651,7 +651,7 @@ var{defineProperty:T,getOwnPropertyNames:H,getOwnPropertyDescriptor:w}=Object,k=
651
651
  RETURN;
652
652
  END;
653
653
  $$ LANGUAGE plpgsql;
654
- `]}};var F=(e)=>{let t=JSON.parse(e);if(t.type===0)return{eventType:"MESSAGE_CREATED",id:t.id,dequeueAt:Number(t.dequeue_at)};else if(t.type===1)return{eventType:"MESSAGE_DELETED",id:t.id};else if(t.type===2)return{eventType:"MESSAGE_DEFERRED",id:t.id,dequeueAt:Number(t.dequeue_at)};else throw new Error("Unknown event type")};var __filename="/home/runner/work/lonnymq/lonnymq/src/install/function-epoch.ts",b={name:_(__filename),sql:(e)=>{return[n`
654
+ `]}};var F=(e)=>{let t=JSON.parse(e);if(t.type===0)return{eventType:"MESSAGE_CREATED",id:t.id,dequeueAt:Number(t.dequeue_at)};else if(t.type===1)return{eventType:"MESSAGE_DELETED",id:t.id};else if(t.type===2)return{eventType:"MESSAGE_DEFERRED",id:t.id,dequeueAt:Number(t.dequeue_at)};else throw Error("Unknown event type")};var __filename="/home/runner/work/lonnymq/lonnymq/src/install/function-epoch.ts",b={name:_(__filename),sql:(e)=>{return[n`
655
655
  CREATE FUNCTION ${s(e.schema)}."epoch" ()
656
656
  RETURNS BIGINT AS $$
657
657
  DECLARE
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- var E=(e)=>({nodeType:"VALUE",value:e}),s=(e)=>({nodeType:"REF",value:e}),F=(e)=>({nodeType:"RAW",value:e}),b=(e)=>{return`'${e.replace(/'/g,"''")}'`},B=(e)=>{if(e===null)return"NULL";else if(typeof e==="string")return b(e);else if(typeof e==="number")return e.toString();else if(typeof e==="boolean")return e?"TRUE":"FALSE";else if(e instanceof Date)return`'${e.toISOString()}'`;else if(typeof e==="bigint")return e.toString();else throw new Error(`Unsupported value type: ${typeof e}`)},H=(e)=>{return`"${e.replace(/"/g,'""')}"`},w=(e)=>{if(e.nodeType==="VALUE")return B(e.value);else if(e.nodeType==="REF")return H(e.value);else if(e.nodeType==="RAW")return e.value;else throw new Error("Unsupported SQL node type")};var n=(e,...t)=>{let a=[];for(let r=0;r<e.length;r+=1)if(a.push(e[r]),r<t.length)a.push(w(t[r]));return F(a.join(""))};class c{schema;channelId;createdAt;constructor(e){this.schema=e.schema,this.channelId=e.channelId,this.createdAt=new Date}async execute(e){await e.query(n`
1
+ var E=(e)=>({nodeType:"VALUE",value:e}),s=(e)=>({nodeType:"REF",value:e}),F=(e)=>({nodeType:"RAW",value:e}),b=(e)=>{return`'${e.replace(/'/g,"''")}'`},B=(e)=>{if(e===null)return"NULL";else if(typeof e==="string")return b(e);else if(typeof e==="number")return e.toString();else if(typeof e==="boolean")return e?"TRUE":"FALSE";else if(e instanceof Date)return`'${e.toISOString()}'`;else if(typeof e==="bigint")return e.toString();else throw Error(`Unsupported value type: ${typeof e}`)},H=(e)=>{return`"${e.replace(/"/g,'""')}"`},w=(e)=>{if(e.nodeType==="VALUE")return B(e.value);else if(e.nodeType==="REF")return H(e.value);else if(e.nodeType==="RAW")return e.value;else throw Error("Unsupported SQL node type")};var n=(e,...t)=>{let a=[];for(let r=0;r<e.length;r+=1)if(a.push(e[r]),r<t.length)a.push(w(t[r]));return F(a.join(""))};class c{schema;channelId;createdAt;constructor(e){this.schema=e.schema,this.channelId=e.channelId,this.createdAt=new Date}async execute(e){await e.query(n`
2
2
  SELECT 1 FROM ${s(this.schema)}."channel_policy_clear"(
3
3
  $1
4
4
  )
@@ -18,32 +18,32 @@ var E=(e)=>({nodeType:"VALUE",value:e}),s=(e)=>({nodeType:"REF",value:e}),F=(e)=
18
18
  $2,
19
19
  $3::BIGINT
20
20
  )
21
- `.value,[this.channelId,this.content,this.dequeueAt]).then((a)=>a.rows[0]);if(t.result_code===0)return{resultType:"MESSAGE_CREATED",id:BigInt(t.metadata.id),channelSize:t.metadata.channel_size};else if(t.result_code===1)return{resultType:"MESSAGE_DROPPED"};else throw new Error("Unexpected result code")}}class o{schema;lockMs;constructor(e){this.schema=e.schema,this.lockMs=e.lockMs}async execute(e){let t=await e.query(n`
21
+ `.value,[this.channelId,this.content,this.dequeueAt]).then((a)=>a.rows[0]);if(t.result_code===0)return{resultType:"MESSAGE_CREATED",id:BigInt(t.metadata.id),channelSize:t.metadata.channel_size};else if(t.result_code===1)return{resultType:"MESSAGE_DROPPED"};else throw Error("Unexpected result code")}}class o{schema;lockMs;constructor(e){this.schema=e.schema,this.lockMs=e.lockMs}async execute(e){let t=await e.query(n`
22
22
  SELECT
23
23
  result_code,
24
24
  metadata,
25
25
  content,
26
26
  state
27
27
  FROM ${s(this.schema)}."message_dequeue"($1::BIGINT)
28
- `.value,[this.lockMs]).then((a)=>a.rows[0]);if(t.result_code===0)return{resultType:"MESSAGE_NOT_AVAILABLE"};else if(t.result_code===1)return{resultType:"MESSAGE_DEQUEUED",id:BigInt(t.metadata.id),channelId:t.metadata.channel_id,isUnlocked:t.metadata.is_unlocked,content:t.content,state:t.state,numAttempts:t.metadata.num_attempts};else throw new Error("Unexpected dequeue result")}}class i{schema;id;numAttempts;constructor(e){this.schema=e.schema,this.id=e.id,this.numAttempts=e.numAttempts}async execute(e){let t=await e.query(n`
28
+ `.value,[this.lockMs]).then((a)=>a.rows[0]);if(t.result_code===0)return{resultType:"MESSAGE_NOT_AVAILABLE"};else if(t.result_code===1)return{resultType:"MESSAGE_DEQUEUED",id:BigInt(t.metadata.id),channelId:t.metadata.channel_id,isUnlocked:t.metadata.is_unlocked,content:t.content,state:t.state,numAttempts:t.metadata.num_attempts};else throw Error("Unexpected dequeue result")}}class i{schema;id;numAttempts;constructor(e){this.schema=e.schema,this.id=e.id,this.numAttempts=e.numAttempts}async execute(e){let t=await e.query(n`
29
29
  SELECT * FROM ${s(this.schema)}."message_delete"(
30
30
  $1::BIGINT,
31
31
  $2::BIGINT
32
32
  )
33
- `.value,[this.id.toString(),this.numAttempts]).then((a)=>a.rows[0]);if(t.result_code===0)return{resultType:"MESSAGE_NOT_FOUND"};else if(t.result_code===1)return{resultType:"STATE_INVALID"};else if(t.result_code===2)return{resultType:"MESSAGE_DELETED"};else throw new Error("Unexpected result")}}class d{schema;id;numAttempts;state;dequeueAt;constructor(e){this.schema=e.schema,this.numAttempts=e.numAttempts,this.id=e.id,this.state=e.state,this.dequeueAt=e.dequeueAt}async execute(e){let t=await e.query(n`
33
+ `.value,[this.id.toString(),this.numAttempts]).then((a)=>a.rows[0]);if(t.result_code===0)return{resultType:"MESSAGE_NOT_FOUND"};else if(t.result_code===1)return{resultType:"STATE_INVALID"};else if(t.result_code===2)return{resultType:"MESSAGE_DELETED"};else throw Error("Unexpected result")}}class d{schema;id;numAttempts;state;dequeueAt;constructor(e){this.schema=e.schema,this.numAttempts=e.numAttempts,this.id=e.id,this.state=e.state,this.dequeueAt=e.dequeueAt}async execute(e){let t=await e.query(n`
34
34
  SELECT * FROM ${s(this.schema)}."message_defer"(
35
35
  $1::BIGINT,
36
36
  $2::BIGINT,
37
37
  $3::BIGINT,
38
38
  $4
39
39
  )
40
- `.value,[this.id.toString(),this.numAttempts,this.dequeueAt,this.state]).then((a)=>a.rows[0]);if(t.result_code===0)return{resultType:"MESSAGE_NOT_FOUND"};else if(t.result_code===1)return{resultType:"STATE_INVALID"};else if(t.result_code===2)return{resultType:"MESSAGE_DEFERRED"};else throw new Error("Unexpected result")}}class m{schema;id;numAttempts;lockMs;constructor(e){this.schema=e.schema,this.numAttempts=e.numAttempts,this.id=e.id,this.lockMs=e.lockMs}async execute(e){let t=await e.query(n`
40
+ `.value,[this.id.toString(),this.numAttempts,this.dequeueAt,this.state]).then((a)=>a.rows[0]);if(t.result_code===0)return{resultType:"MESSAGE_NOT_FOUND"};else if(t.result_code===1)return{resultType:"STATE_INVALID"};else if(t.result_code===2)return{resultType:"MESSAGE_DEFERRED"};else throw Error("Unexpected result")}}class m{schema;id;numAttempts;lockMs;constructor(e){this.schema=e.schema,this.numAttempts=e.numAttempts,this.id=e.id,this.lockMs=e.lockMs}async execute(e){let t=await e.query(n`
41
41
  SELECT * FROM ${s(this.schema)}."message_heartbeat"(
42
42
  $1::BIGINT,
43
43
  $2::BIGINT,
44
44
  $3::BIGINT
45
45
  )
46
- `.value,[this.id.toString(),this.numAttempts,this.lockMs]).then((a)=>a.rows[0]);if(t.result_code===0)return{resultType:"MESSAGE_NOT_FOUND"};else if(t.result_code===1)return{resultType:"MESSAGE_STATE_INVALID"};else if(t.result_code===2)return{resultType:"MESSAGE_HEARTBEATED"};else throw new Error("Unexpected result")}}var p=(e)=>{let t=e.split(`
46
+ `.value,[this.id.toString(),this.numAttempts,this.lockMs]).then((a)=>a.rows[0]);if(t.result_code===0)return{resultType:"MESSAGE_NOT_FOUND"};else if(t.result_code===1)return{resultType:"MESSAGE_STATE_INVALID"};else if(t.result_code===2)return{resultType:"MESSAGE_HEARTBEATED"};else throw Error("Unexpected result")}}var p=(e)=>{let t=e.split(`
47
47
  `),a=Number.MAX_SAFE_INTEGER;for(let r of t){if(r.trim().length===0)continue;let $=r.search(/\S/);a=Math.min(a,$)}return t.map((r)=>r.slice(a)).join(`
48
48
  `).trim()};import{dirname as g}from"path";var __filename="/home/runner/work/lonnymq/lonnymq/src/core/path.ts",W=g(g(__filename)),Y=new RegExp(`^${W}/`),_=(e)=>{return e.replace(Y,"")};var __filename="/home/runner/work/lonnymq/lonnymq/src/install/table-channel-policy.ts",D={name:_(__filename),sql:(e)=>{return[n`
49
49
  CREATE TABLE ${s(e.schema)}."channel_policy" (
@@ -651,7 +651,7 @@ var E=(e)=>({nodeType:"VALUE",value:e}),s=(e)=>({nodeType:"REF",value:e}),F=(e)=
651
651
  RETURN;
652
652
  END;
653
653
  $$ LANGUAGE plpgsql;
654
- `]}};var G=(e)=>{let t=JSON.parse(e);if(t.type===0)return{eventType:"MESSAGE_CREATED",id:t.id,dequeueAt:Number(t.dequeue_at)};else if(t.type===1)return{eventType:"MESSAGE_DELETED",id:t.id};else if(t.type===2)return{eventType:"MESSAGE_DEFERRED",id:t.id,dequeueAt:Number(t.dequeue_at)};else throw new Error("Unknown event type")};var __filename="/home/runner/work/lonnymq/lonnymq/src/install/function-epoch.ts",q={name:_(__filename),sql:(e)=>{return[n`
654
+ `]}};var G=(e)=>{let t=JSON.parse(e);if(t.type===0)return{eventType:"MESSAGE_CREATED",id:t.id,dequeueAt:Number(t.dequeue_at)};else if(t.type===1)return{eventType:"MESSAGE_DELETED",id:t.id};else if(t.type===2)return{eventType:"MESSAGE_DEFERRED",id:t.id,dequeueAt:Number(t.dequeue_at)};else throw Error("Unknown event type")};var __filename="/home/runner/work/lonnymq/lonnymq/src/install/function-epoch.ts",q={name:_(__filename),sql:(e)=>{return[n`
655
655
  CREATE FUNCTION ${s(e.schema)}."epoch" ()
656
656
  RETURNS BIGINT AS $$
657
657
  DECLARE
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lonnymq",
3
- "version": "0.0.30",
3
+ "version": "1.0.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -9,6 +9,9 @@
9
9
  "require": "./dist/index.cjs"
10
10
  }
11
11
  },
12
+ "repository": {
13
+ "url": "https://github.com/tlonny/lonnymq"
14
+ },
12
15
  "files": ["dist"],
13
16
  "devDependencies": {
14
17
  "@stylistic/eslint-plugin-ts": "4.2.0",
@@ -18,8 +21,7 @@
18
21
  "@typescript-eslint/parser": "8.26.1",
19
22
  "bun-plugin-dts": "^0.3.0",
20
23
  "eslint": "9.22.0",
21
- "pg": "^8.16.3",
22
- "typedoc": "^0.28.13"
24
+ "pg": "^8.16.3"
23
25
  },
24
26
  "peerDependencies": {
25
27
  "typescript": "^5.0.0"