@nwire/queue 0.8.17 → 0.9.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.
@@ -0,0 +1,15 @@
1
+ /**
2
+ * `queueInterface()` — NwireServable queue transport for `endpoint().serve()`.
3
+ */
4
+ import type { App } from "@nwire/forge";
5
+ import type { NwireServable } from "@nwire/endpoint";
6
+ import type { QueueTransport } from "./queue-transport.js";
7
+ import { type CreateQueueWorkerOptions, type QueueWorker } from "./queue-worker.js";
8
+ export interface QueueInterface extends NwireServable {
9
+ readonly transport: "queue";
10
+ readonly worker: QueueWorker;
11
+ start(): Promise<void>;
12
+ stop(): Promise<void>;
13
+ }
14
+ export declare function queueInterface(app: App, transport: QueueTransport, options: CreateQueueWorkerOptions): QueueInterface;
15
+ //# sourceMappingURL=queue-interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queue-interface.d.ts","sourceRoot":"","sources":["../src/queue-interface.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,KAAK,EAAe,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAEL,KAAK,wBAAwB,EAC7B,KAAK,WAAW,EACjB,MAAM,mBAAmB,CAAC;AAE3B,MAAM,WAAW,cAAe,SAAQ,aAAa;IACnD,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB;AAED,wBAAgB,cAAc,CAC5B,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,cAAc,EACzB,OAAO,EAAE,wBAAwB,GAChC,cAAc,CA8BhB"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * `queueInterface()` — NwireServable queue transport for `endpoint().serve()`.
3
+ */
4
+ import { createQueueWorker, } from "./queue-worker.js";
5
+ export function queueInterface(app, transport, options) {
6
+ const worker = createQueueWorker(app, transport, options);
7
+ let started = false;
8
+ const iface = {
9
+ $nwireServable: true,
10
+ transport: "queue",
11
+ checks: [],
12
+ worker,
13
+ attach(_host) {
14
+ // Queue worker adopts app container via createQueueWorker.
15
+ },
16
+ async start() {
17
+ if (!started) {
18
+ await worker.start();
19
+ started = true;
20
+ }
21
+ },
22
+ async stop() {
23
+ if (started) {
24
+ await worker.stop();
25
+ started = false;
26
+ }
27
+ },
28
+ async shutdown() {
29
+ await iface.stop();
30
+ },
31
+ };
32
+ return iface;
33
+ }
34
+ //# sourceMappingURL=queue-interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queue-interface.js","sourceRoot":"","sources":["../src/queue-interface.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,OAAO,EACL,iBAAiB,GAGlB,MAAM,mBAAmB,CAAC;AAS3B,MAAM,UAAU,cAAc,CAC5B,GAAQ,EACR,SAAyB,EACzB,OAAiC;IAEjC,MAAM,MAAM,GAAG,iBAAiB,CAAC,GAAG,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;IAC1D,IAAI,OAAO,GAAG,KAAK,CAAC;IAEpB,MAAM,KAAK,GAAmB;QAC5B,cAAc,EAAE,IAAI;QACpB,SAAS,EAAE,OAAO;QAClB,MAAM,EAAE,EAA4B;QACpC,MAAM;QACN,MAAM,CAAC,KAAqB;YAC1B,2DAA2D;QAC7D,CAAC;QACD,KAAK,CAAC,KAAK;YACT,IAAI,CAAC,OAAO,EAAE,CAAC;gBACb,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;gBACrB,OAAO,GAAG,IAAI,CAAC;YACjB,CAAC;QACH,CAAC;QACD,KAAK,CAAC,IAAI;YACR,IAAI,OAAO,EAAE,CAAC;gBACZ,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;gBACpB,OAAO,GAAG,KAAK,CAAC;YAClB,CAAC;QACH,CAAC;QACD,KAAK,CAAC,QAAQ;YACZ,MAAM,KAAK,CAAC,IAAI,EAAE,CAAC;QACrB,CAAC;KACF,CAAC;IAEF,OAAO,KAAK,CAAC;AACf,CAAC"}
package/dist/queue.d.ts CHANGED
@@ -10,4 +10,5 @@
10
10
  */
11
11
  export { InMemoryQueueTransport, type QueueTransport, type QueueMessage, type QueueConsumer, } from "./queue-transport.js";
12
12
  export { createQueueWorker, subscription, type QueueWorker, type QueueSubscription, type FluentQueueSubscription, type CreateQueueWorkerOptions, } from "./queue-worker.js";
13
+ export { queueInterface, type QueueInterface } from "./queue-interface.js";
13
14
  //# sourceMappingURL=queue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../src/queue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EACL,sBAAsB,EACtB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,aAAa,GACnB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,GAC9B,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../src/queue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EACL,sBAAsB,EACtB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,aAAa,GACnB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,GAC9B,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC"}
package/dist/queue.js CHANGED
@@ -10,4 +10,5 @@
10
10
  */
11
11
  export { InMemoryQueueTransport, } from "./queue-transport.js";
12
12
  export { createQueueWorker, subscription, } from "./queue-worker.js";
13
+ export { queueInterface } from "./queue-interface.js";
13
14
  //# sourceMappingURL=queue.js.map
package/dist/queue.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"queue.js","sourceRoot":"","sources":["../src/queue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EACL,sBAAsB,GAIvB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,iBAAiB,EACjB,YAAY,GAKb,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"queue.js","sourceRoot":"","sources":["../src/queue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EACL,sBAAsB,GAIvB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,iBAAiB,EACjB,YAAY,GAKb,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,cAAc,EAAuB,MAAM,mBAAmB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nwire/queue",
3
- "version": "0.8.17",
3
+ "version": "0.9.0",
4
4
  "description": "Nwire — queue transport contract + InMemory default + createQueueWorker. Production adapters land as @nwire/queue-bullmq, @nwire/queue-sqs, @nwire/queue-pgboss.",
5
5
  "keywords": [
6
6
  "bus",
@@ -28,8 +28,10 @@
28
28
  "access": "public"
29
29
  },
30
30
  "dependencies": {
31
+ "@nwire/endpoint": "0.9.0",
32
+ "@nwire/interface": "0.9.0",
31
33
  "@nwire/envelope": "0.8.17",
32
- "@nwire/forge": "0.8.17"
34
+ "@nwire/forge": "0.9.0"
33
35
  },
34
36
  "devDependencies": {
35
37
  "@types/node": "^22.19.9",