@dudousxd/nestjs-durable-transport-sqs 0.1.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,2 @@
1
+ export * from './sqs-transport';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./sqs-transport"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC"}
@@ -0,0 +1,93 @@
1
+ import { SQSClient, type SQSClientConfig } from '@aws-sdk/client-sqs';
2
+ import { type Heartbeat, type RemoteTask, type StepHandler, type StepResult, type Transport } from '@dudousxd/nestjs-durable-core';
3
+ /** Resolve a group's tasks queue URL. Sync or async; resolved once and cached. */
4
+ export type QueueUrlResolver = (group: string) => string | Promise<string>;
5
+ export interface SqsTransportOptions {
6
+ /**
7
+ * Reuse an existing SQS client (recommended — share the app's). When omitted, one is built
8
+ * from `clientConfig` and destroyed on `close()`.
9
+ */
10
+ client?: SQSClient;
11
+ /** Used only when `client` is omitted — e.g. `{ region, endpoint, credentials }` for ElasticMQ. */
12
+ clientConfig?: SQSClientConfig;
13
+ /** The worker group this instance serves. Required to register `handle()` consumers. */
14
+ group?: string;
15
+ /**
16
+ * Map a group → an **existing** tasks queue URL. This is the seam for reusing queues you already
17
+ * have (e.g. `extraction`, `ingestion`) instead of letting the transport mint its own. When
18
+ * omitted, the transport resolves `${prefix}-tasks-${group}` by name (and creates it if
19
+ * `autoCreate`). Return value is awaited and cached.
20
+ */
21
+ taskQueueUrl?: QueueUrlResolver;
22
+ /**
23
+ * The results queue URL (worker → engine). A literal URL or a resolver. When omitted, the
24
+ * transport resolves `${prefix}-results` by name (and creates it if `autoCreate`).
25
+ */
26
+ resultsQueueUrl?: string | (() => string | Promise<string>);
27
+ /** Prefix for the fallback `${prefix}-tasks-*` / `${prefix}-results` names. Default `durable`. */
28
+ prefix?: string;
29
+ /**
30
+ * Create the fallback-named queues on first use if they don't exist (handy for ElasticMQ / dev).
31
+ * Ignored for queues you supply via `taskQueueUrl` / `resultsQueueUrl` — those must already exist.
32
+ */
33
+ autoCreate?: boolean;
34
+ /**
35
+ * When set, durable messages carry this SQS message attribute and pollers **skip** messages
36
+ * that lack it (releasing them for a co-resident legacy consumer). Enables sharing one physical
37
+ * queue with a non-durable consumer — but only if that consumer likewise ignores tagged messages.
38
+ * Leave unset for the clean case: a queue dedicated to durable traffic.
39
+ */
40
+ marker?: string;
41
+ /** SQS receive long-poll seconds (0–20). Default 20. */
42
+ waitTimeSeconds?: number;
43
+ /** Visibility timeout for an in-flight task, in seconds. Must exceed the step's runtime. Default 60. */
44
+ visibilityTimeoutSec?: number;
45
+ }
46
+ /**
47
+ * An SQS-backed `Transport` — dispatch remote steps over Amazon SQS (or ElasticMQ). Unlike the
48
+ * BullMQ transport, it does **not** mint its own queue names: pass `taskQueueUrl` / `resultsQueueUrl`
49
+ * to ride the queues you already operate. The wire payload is the documented `RemoteTask` /
50
+ * `StepResult` JSON, so non-Node workers on the same queues interoperate.
51
+ *
52
+ * Run one instance engine-side (calls `onResult`, dispatches tasks) and one per worker process
53
+ * (calls `handle()` for its group). SQS is at-least-once: a task whose process crashes before the
54
+ * result is sent reappears after the visibility timeout (durable retry); a duplicate `StepResult`
55
+ * is harmless because the engine resolves a step's `pending` exactly once by `stepId`.
56
+ */
57
+ export declare class SqsTransport implements Transport {
58
+ private readonly client;
59
+ private readonly ownsClient;
60
+ private readonly group?;
61
+ private readonly prefix;
62
+ private readonly autoCreate;
63
+ private readonly marker?;
64
+ private readonly waitTimeSeconds;
65
+ private readonly visibilityTimeoutSec;
66
+ private readonly taskQueueUrlResolver?;
67
+ private readonly resultsQueueUrlOption?;
68
+ private readonly handlers;
69
+ private readonly urlCache;
70
+ private running;
71
+ private readonly abort;
72
+ private taskLoop?;
73
+ private resultLoop?;
74
+ constructor(options: SqsTransportOptions);
75
+ private resolveByName;
76
+ private tasksUrl;
77
+ private resultsUrl;
78
+ dispatch(task: RemoteTask): Promise<void>;
79
+ /** Register a step handler (worker side). Starts the group's task consumer on first call. */
80
+ handle(name: string, fn: StepHandler): void;
81
+ onResult(handler: (result: StepResult) => Promise<void>): void;
82
+ onHeartbeat(_handler: (beat: Heartbeat) => Promise<void>): void;
83
+ private pollTasks;
84
+ private pollResults;
85
+ /** One long-poll receive. Swallows the abort thrown on `close()`; logs and backs off otherwise. */
86
+ private receive;
87
+ private shouldSkip;
88
+ private del;
89
+ private release;
90
+ /** Stop the pollers and (if we created it) destroy the SQS client so the process can exit. */
91
+ close(): Promise<void>;
92
+ }
93
+ //# sourceMappingURL=sqs-transport.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sqs-transport.d.ts","sourceRoot":"","sources":["../src/sqs-transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,SAAS,EACT,KAAK,eAAe,EACrB,MAAM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AAS;IACzC,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAS;IAC9C,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAC,CAAmB;IACzD,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAA4C;IAEnF,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkC;IAC3D,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA6B;IACtD,OAAO,CAAC,OAAO,CAAQ;IACvB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAyB;IAC/C,OAAO,CAAC,QAAQ,CAAC,CAAgB;IACjC,OAAO,CAAC,UAAU,CAAC,CAAgB;gBAEvB,OAAO,EAAE,mBAAmB;YAe1B,aAAa;YAmBb,QAAQ;YAKR,UAAU;IASlB,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAe/C,6FAA6F;IAC7F,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,WAAW,GAAG,IAAI;IAM3C,QAAQ,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAI9D,WAAW,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;YAMjD,SAAS;YA0BT,WAAW;IAezB,mGAAmG;YACrF,OAAO;IAqBrB,OAAO,CAAC,UAAU;YAIJ,GAAG;YAKH,OAAO;IAOrB,8FAA8F;IACxF,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAM7B"}
@@ -0,0 +1,191 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SqsTransport = void 0;
4
+ const client_sqs_1 = require("@aws-sdk/client-sqs");
5
+ const nestjs_durable_core_1 = require("@dudousxd/nestjs-durable-core");
6
+ /**
7
+ * An SQS-backed `Transport` — dispatch remote steps over Amazon SQS (or ElasticMQ). Unlike the
8
+ * BullMQ transport, it does **not** mint its own queue names: pass `taskQueueUrl` / `resultsQueueUrl`
9
+ * to ride the queues you already operate. The wire payload is the documented `RemoteTask` /
10
+ * `StepResult` JSON, so non-Node workers on the same queues interoperate.
11
+ *
12
+ * Run one instance engine-side (calls `onResult`, dispatches tasks) and one per worker process
13
+ * (calls `handle()` for its group). SQS is at-least-once: a task whose process crashes before the
14
+ * result is sent reappears after the visibility timeout (durable retry); a duplicate `StepResult`
15
+ * is harmless because the engine resolves a step's `pending` exactly once by `stepId`.
16
+ */
17
+ class SqsTransport {
18
+ client;
19
+ ownsClient;
20
+ group;
21
+ prefix;
22
+ autoCreate;
23
+ marker;
24
+ waitTimeSeconds;
25
+ visibilityTimeoutSec;
26
+ taskQueueUrlResolver;
27
+ resultsQueueUrlOption;
28
+ handlers = new Map();
29
+ urlCache = new Map();
30
+ running = true;
31
+ abort = new AbortController();
32
+ taskLoop;
33
+ resultLoop;
34
+ constructor(options) {
35
+ this.client = options.client ?? new client_sqs_1.SQSClient(options.clientConfig ?? {});
36
+ this.ownsClient = !options.client;
37
+ this.group = options.group;
38
+ this.prefix = options.prefix ?? 'durable';
39
+ this.autoCreate = options.autoCreate ?? false;
40
+ this.marker = options.marker;
41
+ this.waitTimeSeconds = options.waitTimeSeconds ?? 20;
42
+ this.visibilityTimeoutSec = options.visibilityTimeoutSec ?? 60;
43
+ this.taskQueueUrlResolver = options.taskQueueUrl;
44
+ this.resultsQueueUrlOption = options.resultsQueueUrl;
45
+ }
46
+ // ── queue resolution ───────────────────────────────────────────────────────────────────────
47
+ async resolveByName(name) {
48
+ const cached = this.urlCache.get(name);
49
+ if (cached)
50
+ return cached;
51
+ let url;
52
+ try {
53
+ const out = await this.client.send(new client_sqs_1.GetQueueUrlCommand({ QueueName: name }));
54
+ url = out.QueueUrl;
55
+ }
56
+ catch (err) {
57
+ if (this.autoCreate) {
58
+ const created = await this.client.send(new client_sqs_1.CreateQueueCommand({ QueueName: name }));
59
+ url = created.QueueUrl;
60
+ }
61
+ else {
62
+ throw err;
63
+ }
64
+ }
65
+ this.urlCache.set(name, url);
66
+ return url;
67
+ }
68
+ async tasksUrl(group) {
69
+ if (this.taskQueueUrlResolver)
70
+ return this.taskQueueUrlResolver(group);
71
+ return this.resolveByName(`${this.prefix}-tasks-${group}`);
72
+ }
73
+ async resultsUrl() {
74
+ const opt = this.resultsQueueUrlOption;
75
+ if (typeof opt === 'string')
76
+ return opt;
77
+ if (typeof opt === 'function')
78
+ return opt();
79
+ return this.resolveByName(`${this.prefix}-results`);
80
+ }
81
+ // ── engine → worker ────────────────────────────────────────────────────────────────────────
82
+ async dispatch(task) {
83
+ const QueueUrl = await this.tasksUrl(task.group);
84
+ await this.client.send(new client_sqs_1.SendMessageCommand({
85
+ QueueUrl,
86
+ MessageBody: JSON.stringify(task),
87
+ MessageAttributes: this.marker
88
+ ? { [this.marker]: { DataType: 'String', StringValue: '1' } }
89
+ : undefined,
90
+ }));
91
+ }
92
+ // ── worker → engine ────────────────────────────────────────────────────────────────────────
93
+ /** Register a step handler (worker side). Starts the group's task consumer on first call. */
94
+ handle(name, fn) {
95
+ if (!this.group)
96
+ throw new Error('SqsTransport needs a `group` to register handlers');
97
+ this.handlers.set(name, fn);
98
+ if (!this.taskLoop)
99
+ this.taskLoop = this.pollTasks(this.group);
100
+ }
101
+ onResult(handler) {
102
+ if (!this.resultLoop)
103
+ this.resultLoop = this.pollResults(handler);
104
+ }
105
+ onHeartbeat(_handler) {
106
+ // Not modelled over SQS; the queue's visibility-timeout redelivery is the liveness mechanism.
107
+ }
108
+ // ── polling loops ──────────────────────────────────────────────────────────────────────────
109
+ async pollTasks(group) {
110
+ const QueueUrl = await this.tasksUrl(group);
111
+ while (this.running) {
112
+ const messages = await this.receive(QueueUrl, this.visibilityTimeoutSec);
113
+ for (const msg of messages) {
114
+ if (this.shouldSkip(msg)) {
115
+ // Not ours (shared queue): release immediately so the legacy consumer can take it.
116
+ await this.release(QueueUrl, msg.ReceiptHandle);
117
+ continue;
118
+ }
119
+ const task = JSON.parse(msg.Body ?? '{}');
120
+ const result = await (0, nestjs_durable_core_1.runStepHandler)(task, this.handlers.get(task.name));
121
+ await this.client.send(new client_sqs_1.SendMessageCommand({
122
+ QueueUrl: await this.resultsUrl(),
123
+ MessageBody: JSON.stringify(result),
124
+ MessageAttributes: this.marker
125
+ ? { [this.marker]: { DataType: 'String', StringValue: '1' } }
126
+ : undefined,
127
+ }));
128
+ await this.del(QueueUrl, msg.ReceiptHandle);
129
+ }
130
+ }
131
+ }
132
+ async pollResults(handler) {
133
+ const QueueUrl = await this.resultsUrl();
134
+ while (this.running) {
135
+ const messages = await this.receive(QueueUrl, 30);
136
+ for (const msg of messages) {
137
+ if (this.shouldSkip(msg)) {
138
+ await this.release(QueueUrl, msg.ReceiptHandle);
139
+ continue;
140
+ }
141
+ await handler(JSON.parse(msg.Body ?? '{}'));
142
+ await this.del(QueueUrl, msg.ReceiptHandle);
143
+ }
144
+ }
145
+ }
146
+ /** One long-poll receive. Swallows the abort thrown on `close()`; logs and backs off otherwise. */
147
+ async receive(QueueUrl, visibility) {
148
+ try {
149
+ const out = await this.client.send(new client_sqs_1.ReceiveMessageCommand({
150
+ QueueUrl,
151
+ MaxNumberOfMessages: 10,
152
+ WaitTimeSeconds: this.waitTimeSeconds,
153
+ VisibilityTimeout: visibility,
154
+ MessageAttributeNames: this.marker ? ['All'] : undefined,
155
+ }), { abortSignal: this.abort.signal });
156
+ return out.Messages ?? [];
157
+ }
158
+ catch (err) {
159
+ if (!this.running)
160
+ return [];
161
+ console.error('[SqsTransport] receive failed', err);
162
+ await new Promise((r) => setTimeout(r, 1000));
163
+ return [];
164
+ }
165
+ }
166
+ shouldSkip(msg) {
167
+ return !!this.marker && !msg.MessageAttributes?.[this.marker];
168
+ }
169
+ async del(QueueUrl, ReceiptHandle) {
170
+ if (!ReceiptHandle)
171
+ return;
172
+ await this.client.send(new client_sqs_1.DeleteMessageCommand({ QueueUrl, ReceiptHandle }));
173
+ }
174
+ async release(QueueUrl, ReceiptHandle) {
175
+ if (!ReceiptHandle)
176
+ return;
177
+ await this.client
178
+ .send(new client_sqs_1.ChangeMessageVisibilityCommand({ QueueUrl, ReceiptHandle, VisibilityTimeout: 0 }))
179
+ .catch(() => { });
180
+ }
181
+ /** Stop the pollers and (if we created it) destroy the SQS client so the process can exit. */
182
+ async close() {
183
+ this.running = false;
184
+ this.abort.abort();
185
+ await Promise.allSettled([this.taskLoop, this.resultLoop]);
186
+ if (this.ownsClient)
187
+ this.client.destroy();
188
+ }
189
+ }
190
+ exports.SqsTransport = SqsTransport;
191
+ //# sourceMappingURL=sqs-transport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sqs-transport.js","sourceRoot":"","sources":["../src/sqs-transport.ts"],"names":[],"mappings":";;;AAAA,oDAS6B;AAC7B,uEAOuC;AAoDvC;;;;;;;;;;GAUG;AACH,MAAa,YAAY;IACN,MAAM,CAAY;IAClB,UAAU,CAAU;IACpB,KAAK,CAAU;IACf,MAAM,CAAS;IACf,UAAU,CAAU;IACpB,MAAM,CAAU;IAChB,eAAe,CAAS;IACxB,oBAAoB,CAAS;IAC7B,oBAAoB,CAAoB;IACxC,qBAAqB,CAA6C;IAElE,QAAQ,GAAG,IAAI,GAAG,EAAuB,CAAC;IAC1C,QAAQ,GAAG,IAAI,GAAG,EAAkB,CAAC;IAC9C,OAAO,GAAG,IAAI,CAAC;IACN,KAAK,GAAG,IAAI,eAAe,EAAE,CAAC;IACvC,QAAQ,CAAiB;IACzB,UAAU,CAAiB;IAEnC,YAAY,OAA4B;QACtC,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,IAAI,sBAAS,CAAC,OAAO,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC;QAC1E,IAAI,CAAC,UAAU,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC;QAClC,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC3B,IAAI,CAAC,M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CAAC,CAAC;aAC3F,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IACrB,CAAC;IAED,8FAA8F;IAC9F,KAAK,CAAC,KAAK;QACT,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACrB,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QACnB,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;QAC3D,IAAI,IAAI,CAAC,UAAU;YAAE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;IAC7C,CAAC;CACF;AAzLD,oCAyLC"}
package/package.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "@dudousxd/nestjs-durable-transport-sqs",
3
+ "version": "0.1.0",
4
+ "description": "Amazon SQS Transport for nestjs-durable — dispatch remote steps over existing SQS queues (ElasticMQ-compatible)",
5
+ "license": "MIT",
6
+ "author": "Davide Carvalho",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/DavideCarvalho/nestjs-durable.git",
10
+ "directory": "packages/transport-sqs"
11
+ },
12
+ "type": "commonjs",
13
+ "main": "dist/index.js",
14
+ "types": "dist/index.d.ts",
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "peerDependencies": {
19
+ "@aws-sdk/client-sqs": "^3.0.0",
20
+ "@dudousxd/nestjs-durable-core": ">=0.1.0 <1.0.0"
21
+ },
22
+ "devDependencies": {
23
+ "@aws-sdk/client-sqs": "3.1034.0",
24
+ "typescript": "5.9.3",
25
+ "zod": "3.25.76",
26
+ "@dudousxd/nestjs-durable-core": "^0.1.0"
27
+ },
28
+ "scripts": {
29
+ "build": "tsc -p tsconfig.json",
30
+ "typecheck": "tsc -p tsconfig.json --noEmit"
31
+ }
32
+ }