service-bridge 1.8.3-dev.41 → 1.8.3-dev.42
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/README.md +5 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -203,8 +203,8 @@ await notifications.serve({ host: "localhost" });
|
|
|
203
203
|
// --- Orchestrate as a workflow ---
|
|
204
204
|
|
|
205
205
|
await orders.workflow("order.fulfillment", [
|
|
206
|
-
{ id: "reserve", type: "rpc", ref: "inventory
|
|
207
|
-
{ id: "charge", type: "rpc", ref: "
|
|
206
|
+
{ id: "reserve", type: "rpc", ref: "inventory.reserve" },
|
|
207
|
+
{ id: "charge", type: "rpc", ref: "payment.charge", deps: ["reserve"] },
|
|
208
208
|
{ id: "wait_dlv", type: "event_wait", ref: "shipping.delivered", deps: ["charge"] },
|
|
209
209
|
{ id: "notify", type: "event", ref: "orders.fulfilled", deps: ["wait_dlv"] },
|
|
210
210
|
]);
|
|
@@ -432,7 +432,7 @@ Registers (or updates) a workflow definition as a DAG of typed steps. Returns th
|
|
|
432
432
|
|---|---|---|
|
|
433
433
|
| `id` | `string` | Unique step identifier in the DAG. |
|
|
434
434
|
| `type` | `"rpc" \| "event" \| "event_wait" \| "sleep" \| "workflow"` | Step execution type. |
|
|
435
|
-
| `ref` | `string` | Required for `rpc`, `event`, `event_wait`, `workflow`. |
|
|
435
|
+
| `ref` | `string` | Required for `rpc`, `event`, `event_wait`, `workflow`. For `rpc` — function name in dot notation (e.g. `"payment.charge"`); the runtime resolves the target service from its registry. For `event`/`event_wait` — topic or pattern. For `workflow` — workflow name. Always use dots, never slashes. |
|
|
436
436
|
| `deps` | `string[]` | Dependencies. Empty/omitted means root step. |
|
|
437
437
|
| `if` | `string` | Optional filter expression (step is skipped if false). |
|
|
438
438
|
| `timeoutMs` | `number` | Optional timeout for `rpc` and `event_wait` steps. |
|
|
@@ -454,8 +454,8 @@ interface WorkflowOpts {
|
|
|
454
454
|
|
|
455
455
|
```ts
|
|
456
456
|
await sb.workflow("order.fulfillment", [
|
|
457
|
-
{ id: "reserve", type: "rpc", ref: "inventory
|
|
458
|
-
{ id: "charge", type: "rpc", ref: "
|
|
457
|
+
{ id: "reserve", type: "rpc", ref: "inventory.reserve" },
|
|
458
|
+
{ id: "charge", type: "rpc", ref: "payment.charge", deps: ["reserve"] },
|
|
459
459
|
{ id: "wait_5m", type: "sleep", durationMs: 300_000, deps: ["charge"] },
|
|
460
460
|
{ id: "notify", type: "event", ref: "orders.fulfilled", deps: ["wait_5m"] },
|
|
461
461
|
]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "service-bridge",
|
|
3
|
-
"version": "1.8.3-dev.
|
|
3
|
+
"version": "1.8.3-dev.42",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "ServiceBridge SDK for Node.js — one self-hosted runtime for RPC, events, workflows, and jobs without a service mesh or sidecars. Direct gRPC between workers; durable events, jobs, tracing, auto mTLS. One Go runtime + PostgreSQL.",
|
|
6
6
|
"keywords": [
|