@stepflowjs/trigger-nats 0.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/dist/index.d.ts +79 -0
- package/dist/index.js +165 -0
- package/dist/index.js.map +1 -0
- package/package.json +58 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { Trigger, TriggerHandler } from '@stepflowjs/core';
|
|
2
|
+
|
|
3
|
+
interface NatsTriggerConfig {
|
|
4
|
+
/** NATS server URLs */
|
|
5
|
+
servers: string[];
|
|
6
|
+
/** Subject to subscribe to */
|
|
7
|
+
subject: string;
|
|
8
|
+
/** Queue group name for load balancing (optional) */
|
|
9
|
+
queue?: string;
|
|
10
|
+
/** Durable consumer name (optional) */
|
|
11
|
+
durableName?: string;
|
|
12
|
+
/** Message delivery policy (optional) */
|
|
13
|
+
deliverPolicy?: "all" | "last" | "new";
|
|
14
|
+
/** Authentication credentials (optional) */
|
|
15
|
+
credentials?: {
|
|
16
|
+
user?: string;
|
|
17
|
+
pass?: string;
|
|
18
|
+
token?: string;
|
|
19
|
+
nkey?: string;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
interface NatsTriggerResponse {
|
|
23
|
+
success: boolean;
|
|
24
|
+
error?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* NATS trigger for Stepflow workflows
|
|
28
|
+
*
|
|
29
|
+
* Allows workflows to be triggered via NATS messages with support for queue groups,
|
|
30
|
+
* durable consumers, and various delivery policies.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```typescript
|
|
34
|
+
* const trigger = new NatsTrigger({
|
|
35
|
+
* servers: ['nats://localhost:4222'],
|
|
36
|
+
* subject: 'orders.created',
|
|
37
|
+
* queue: 'order-processors',
|
|
38
|
+
* deliverPolicy: 'new',
|
|
39
|
+
* });
|
|
40
|
+
*
|
|
41
|
+
* await trigger.start(async (event) => {
|
|
42
|
+
* await stepflow.trigger('process-order', event.data);
|
|
43
|
+
* });
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
declare class NatsTrigger implements Trigger<NatsTriggerConfig> {
|
|
47
|
+
readonly config: NatsTriggerConfig;
|
|
48
|
+
readonly type = "nats";
|
|
49
|
+
private connection?;
|
|
50
|
+
private subscription?;
|
|
51
|
+
private handler?;
|
|
52
|
+
private processingLoop?;
|
|
53
|
+
constructor(config: NatsTriggerConfig);
|
|
54
|
+
/**
|
|
55
|
+
* Start the trigger with a handler function
|
|
56
|
+
* @param handler Function to call when NATS messages are received
|
|
57
|
+
*/
|
|
58
|
+
start(handler: TriggerHandler): Promise<void>;
|
|
59
|
+
/**
|
|
60
|
+
* Stop the trigger
|
|
61
|
+
*/
|
|
62
|
+
stop(): Promise<void>;
|
|
63
|
+
/**
|
|
64
|
+
* Health check - returns true if connected to NATS
|
|
65
|
+
*/
|
|
66
|
+
healthCheck(): Promise<boolean>;
|
|
67
|
+
/**
|
|
68
|
+
* Process incoming NATS messages
|
|
69
|
+
* @private
|
|
70
|
+
*/
|
|
71
|
+
private processMessages;
|
|
72
|
+
/**
|
|
73
|
+
* Handle a single NATS message
|
|
74
|
+
* @private
|
|
75
|
+
*/
|
|
76
|
+
private handleMessage;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export { NatsTrigger, type NatsTriggerConfig, type NatsTriggerResponse };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import {
|
|
3
|
+
connect
|
|
4
|
+
} from "nats";
|
|
5
|
+
var NatsTrigger = class {
|
|
6
|
+
constructor(config) {
|
|
7
|
+
this.config = config;
|
|
8
|
+
}
|
|
9
|
+
type = "nats";
|
|
10
|
+
connection;
|
|
11
|
+
subscription;
|
|
12
|
+
handler;
|
|
13
|
+
processingLoop;
|
|
14
|
+
/**
|
|
15
|
+
* Start the trigger with a handler function
|
|
16
|
+
* @param handler Function to call when NATS messages are received
|
|
17
|
+
*/
|
|
18
|
+
async start(handler) {
|
|
19
|
+
this.handler = handler;
|
|
20
|
+
const connectionOptions = {
|
|
21
|
+
servers: this.config.servers
|
|
22
|
+
};
|
|
23
|
+
if (this.config.credentials) {
|
|
24
|
+
if (this.config.credentials.user && this.config.credentials.pass) {
|
|
25
|
+
connectionOptions.user = this.config.credentials.user;
|
|
26
|
+
connectionOptions.pass = this.config.credentials.pass;
|
|
27
|
+
} else if (this.config.credentials.token) {
|
|
28
|
+
connectionOptions.token = this.config.credentials.token;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
try {
|
|
32
|
+
this.connection = await connect(connectionOptions);
|
|
33
|
+
} catch (error) {
|
|
34
|
+
throw new Error(`Failed to connect to NATS: ${error.message}`);
|
|
35
|
+
}
|
|
36
|
+
try {
|
|
37
|
+
this.subscription = this.connection.subscribe(this.config.subject, {
|
|
38
|
+
queue: this.config.queue
|
|
39
|
+
});
|
|
40
|
+
} catch (error) {
|
|
41
|
+
await this.connection.close();
|
|
42
|
+
throw new Error(
|
|
43
|
+
`Failed to subscribe to subject "${this.config.subject}": ${error.message}`
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
this.processingLoop = this.processMessages();
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Stop the trigger
|
|
50
|
+
*/
|
|
51
|
+
async stop() {
|
|
52
|
+
this.handler = void 0;
|
|
53
|
+
if (this.subscription) {
|
|
54
|
+
try {
|
|
55
|
+
this.subscription.unsubscribe();
|
|
56
|
+
} catch (error) {
|
|
57
|
+
console.error("Error unsubscribing:", error);
|
|
58
|
+
}
|
|
59
|
+
this.subscription = void 0;
|
|
60
|
+
}
|
|
61
|
+
if (this.processingLoop) {
|
|
62
|
+
try {
|
|
63
|
+
await this.processingLoop;
|
|
64
|
+
} catch (error) {
|
|
65
|
+
}
|
|
66
|
+
this.processingLoop = void 0;
|
|
67
|
+
}
|
|
68
|
+
if (this.connection) {
|
|
69
|
+
try {
|
|
70
|
+
await this.connection.close();
|
|
71
|
+
} catch (error) {
|
|
72
|
+
console.error("Error closing NATS connection:", error);
|
|
73
|
+
}
|
|
74
|
+
this.connection = void 0;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Health check - returns true if connected to NATS
|
|
79
|
+
*/
|
|
80
|
+
async healthCheck() {
|
|
81
|
+
return this.connection?.isClosed() === false;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Process incoming NATS messages
|
|
85
|
+
* @private
|
|
86
|
+
*/
|
|
87
|
+
async processMessages() {
|
|
88
|
+
if (!this.subscription || !this.handler) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
try {
|
|
92
|
+
for await (const msg of this.subscription) {
|
|
93
|
+
if (!this.handler) {
|
|
94
|
+
break;
|
|
95
|
+
}
|
|
96
|
+
await this.handleMessage(msg);
|
|
97
|
+
}
|
|
98
|
+
} catch (error) {
|
|
99
|
+
if (this.handler !== void 0) {
|
|
100
|
+
console.error("Error processing NATS messages:", error);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Handle a single NATS message
|
|
106
|
+
* @private
|
|
107
|
+
*/
|
|
108
|
+
async handleMessage(msg) {
|
|
109
|
+
if (!this.handler) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
try {
|
|
113
|
+
let data;
|
|
114
|
+
try {
|
|
115
|
+
const text = new TextDecoder().decode(msg.data);
|
|
116
|
+
data = JSON.parse(text);
|
|
117
|
+
} catch (error) {
|
|
118
|
+
data = new TextDecoder().decode(msg.data);
|
|
119
|
+
}
|
|
120
|
+
const headers = {};
|
|
121
|
+
if (msg.headers) {
|
|
122
|
+
for (const [key, values] of msg.headers) {
|
|
123
|
+
headers[key] = values.join(", ");
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
const event = {
|
|
127
|
+
id: crypto.randomUUID(),
|
|
128
|
+
type: this.type,
|
|
129
|
+
source: msg.subject,
|
|
130
|
+
data,
|
|
131
|
+
metadata: {
|
|
132
|
+
subject: msg.subject,
|
|
133
|
+
reply: msg.reply,
|
|
134
|
+
headers,
|
|
135
|
+
sid: msg.sid
|
|
136
|
+
},
|
|
137
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
138
|
+
};
|
|
139
|
+
await this.handler(event);
|
|
140
|
+
if (msg.reply) {
|
|
141
|
+
const response = {
|
|
142
|
+
success: true
|
|
143
|
+
};
|
|
144
|
+
msg.respond(new TextEncoder().encode(JSON.stringify(response)));
|
|
145
|
+
}
|
|
146
|
+
} catch (error) {
|
|
147
|
+
if (msg.reply) {
|
|
148
|
+
const response = {
|
|
149
|
+
success: false,
|
|
150
|
+
error: error.message
|
|
151
|
+
};
|
|
152
|
+
try {
|
|
153
|
+
msg.respond(new TextEncoder().encode(JSON.stringify(response)));
|
|
154
|
+
} catch (respondError) {
|
|
155
|
+
console.error("Error sending NATS response:", respondError);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
throw error;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
export {
|
|
163
|
+
NatsTrigger
|
|
164
|
+
};
|
|
165
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { Trigger, TriggerHandler, TriggerEvent } from \"@stepflowjs/core\";\nimport {\n connect,\n type NatsConnection,\n type Subscription,\n type Msg,\n type ConnectionOptions,\n} from \"nats\";\n\n// ============================================================================\n// Types\n// ============================================================================\n\nexport interface NatsTriggerConfig {\n /** NATS server URLs */\n servers: string[];\n /** Subject to subscribe to */\n subject: string;\n /** Queue group name for load balancing (optional) */\n queue?: string;\n /** Durable consumer name (optional) */\n durableName?: string;\n /** Message delivery policy (optional) */\n deliverPolicy?: \"all\" | \"last\" | \"new\";\n /** Authentication credentials (optional) */\n credentials?: {\n user?: string;\n pass?: string;\n token?: string;\n nkey?: string;\n };\n}\n\nexport interface NatsTriggerResponse {\n success: boolean;\n error?: string;\n}\n\n// ============================================================================\n// NatsTrigger Implementation\n// ============================================================================\n\n/**\n * NATS trigger for Stepflow workflows\n *\n * Allows workflows to be triggered via NATS messages with support for queue groups,\n * durable consumers, and various delivery policies.\n *\n * @example\n * ```typescript\n * const trigger = new NatsTrigger({\n * servers: ['nats://localhost:4222'],\n * subject: 'orders.created',\n * queue: 'order-processors',\n * deliverPolicy: 'new',\n * });\n *\n * await trigger.start(async (event) => {\n * await stepflow.trigger('process-order', event.data);\n * });\n * ```\n */\nexport class NatsTrigger implements Trigger<NatsTriggerConfig> {\n readonly type = \"nats\";\n private connection?: NatsConnection;\n private subscription?: Subscription;\n private handler?: TriggerHandler;\n private processingLoop?: Promise<void>;\n\n constructor(readonly config: NatsTriggerConfig) {}\n\n /**\n * Start the trigger with a handler function\n * @param handler Function to call when NATS messages are received\n */\n async start(handler: TriggerHandler): Promise<void> {\n this.handler = handler;\n\n // Build connection options\n const connectionOptions: ConnectionOptions = {\n servers: this.config.servers,\n };\n\n // Add credentials if provided\n if (this.config.credentials) {\n if (this.config.credentials.user && this.config.credentials.pass) {\n connectionOptions.user = this.config.credentials.user;\n connectionOptions.pass = this.config.credentials.pass;\n } else if (this.config.credentials.token) {\n connectionOptions.token = this.config.credentials.token;\n }\n // Note: nkey authentication would require additional setup\n }\n\n // Connect to NATS\n try {\n this.connection = await connect(connectionOptions);\n } catch (error) {\n throw new Error(`Failed to connect to NATS: ${(error as Error).message}`);\n }\n\n // Subscribe to subject\n try {\n this.subscription = this.connection.subscribe(this.config.subject, {\n queue: this.config.queue,\n });\n } catch (error) {\n await this.connection.close();\n throw new Error(\n `Failed to subscribe to subject \"${this.config.subject}\": ${(error as Error).message}`,\n );\n }\n\n // Start processing messages\n this.processingLoop = this.processMessages();\n }\n\n /**\n * Stop the trigger\n */\n async stop(): Promise<void> {\n this.handler = undefined;\n\n // Unsubscribe\n if (this.subscription) {\n try {\n this.subscription.unsubscribe();\n } catch (error) {\n console.error(\"Error unsubscribing:\", error);\n }\n this.subscription = undefined;\n }\n\n // Wait for processing loop to finish\n if (this.processingLoop) {\n try {\n await this.processingLoop;\n } catch (error) {\n // Ignore errors during shutdown\n }\n this.processingLoop = undefined;\n }\n\n // Close connection\n if (this.connection) {\n try {\n await this.connection.close();\n } catch (error) {\n console.error(\"Error closing NATS connection:\", error);\n }\n this.connection = undefined;\n }\n }\n\n /**\n * Health check - returns true if connected to NATS\n */\n async healthCheck(): Promise<boolean> {\n return this.connection?.isClosed() === false;\n }\n\n /**\n * Process incoming NATS messages\n * @private\n */\n private async processMessages(): Promise<void> {\n if (!this.subscription || !this.handler) {\n return;\n }\n\n try {\n for await (const msg of this.subscription) {\n // Skip if handler was removed (during shutdown)\n if (!this.handler) {\n break;\n }\n\n await this.handleMessage(msg);\n }\n } catch (error) {\n // Only log if not during shutdown\n if (this.handler !== undefined) {\n console.error(\"Error processing NATS messages:\", error);\n }\n }\n }\n\n /**\n * Handle a single NATS message\n * @private\n */\n private async handleMessage(msg: Msg): Promise<void> {\n if (!this.handler) {\n return;\n }\n\n try {\n // Parse message data\n let data: unknown;\n try {\n const text = new TextDecoder().decode(msg.data);\n data = JSON.parse(text);\n } catch (error) {\n // If JSON parsing fails, use raw text\n data = new TextDecoder().decode(msg.data);\n }\n\n // Extract headers if present\n const headers: Record<string, string> = {};\n if (msg.headers) {\n for (const [key, values] of msg.headers) {\n headers[key] = values.join(\", \");\n }\n }\n\n // Create trigger event\n const event: TriggerEvent = {\n id: crypto.randomUUID(),\n type: this.type,\n source: msg.subject,\n data,\n metadata: {\n subject: msg.subject,\n reply: msg.reply,\n headers,\n sid: msg.sid,\n },\n timestamp: new Date(),\n };\n\n // Invoke handler\n await this.handler(event);\n\n // Send success response if reply subject is set\n if (msg.reply) {\n const response: NatsTriggerResponse = {\n success: true,\n };\n msg.respond(new TextEncoder().encode(JSON.stringify(response)));\n }\n } catch (error) {\n // Send error response if reply subject is set\n if (msg.reply) {\n const response: NatsTriggerResponse = {\n success: false,\n error: (error as Error).message,\n };\n try {\n msg.respond(new TextEncoder().encode(JSON.stringify(response)));\n } catch (respondError) {\n console.error(\"Error sending NATS response:\", respondError);\n }\n }\n\n // Re-throw to allow error handling upstream\n throw error;\n }\n }\n}\n"],"mappings":"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","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@stepflowjs/trigger-nats",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "NATS trigger for Stepflow with queue groups and JetStream support",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"nats": "^2.29.0",
|
|
20
|
+
"@stepflowjs/core": "0.0.1"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"tsup": "^8.5.1",
|
|
24
|
+
"vitest": "^4.0.17"
|
|
25
|
+
},
|
|
26
|
+
"peerDependencies": {
|
|
27
|
+
"typescript": "^5.0.0"
|
|
28
|
+
},
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"author": "Stepflow Contributors",
|
|
31
|
+
"repository": {
|
|
32
|
+
"type": "git",
|
|
33
|
+
"url": "https://stepflow-production.up.railway.app",
|
|
34
|
+
"directory": "packages/triggers/nats"
|
|
35
|
+
},
|
|
36
|
+
"homepage": "https://stepflow-production.up.railway.app",
|
|
37
|
+
"bugs": {
|
|
38
|
+
"url": "https://stepflow-production.up.railway.app"
|
|
39
|
+
},
|
|
40
|
+
"keywords": [
|
|
41
|
+
"stepflow",
|
|
42
|
+
"trigger",
|
|
43
|
+
"nats",
|
|
44
|
+
"jetstream",
|
|
45
|
+
"workflow",
|
|
46
|
+
"orchestration"
|
|
47
|
+
],
|
|
48
|
+
"publishConfig": {
|
|
49
|
+
"access": "public"
|
|
50
|
+
},
|
|
51
|
+
"scripts": {
|
|
52
|
+
"build": "tsup",
|
|
53
|
+
"dev": "tsup --watch",
|
|
54
|
+
"typecheck": "tsc --noEmit",
|
|
55
|
+
"test": "vitest",
|
|
56
|
+
"clean": "rm -rf dist"
|
|
57
|
+
}
|
|
58
|
+
}
|