iii-sdk 0.11.5 → 0.11.6-next.2
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 +8 -20
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -34,13 +34,14 @@ const result = await iii.trigger({ function_id: 'hello::greet', payload: { name:
|
|
|
34
34
|
|
|
35
35
|
## API
|
|
36
36
|
|
|
37
|
-
| Operation | Signature
|
|
38
|
-
| ------------------------ |
|
|
39
|
-
| Initialize | `registerWorker(url, options?)`
|
|
40
|
-
| Register function | `iii.registerFunction(id, handler, options?)`
|
|
41
|
-
| Register trigger | `iii.registerTrigger({ type, function_id, config })`
|
|
42
|
-
| Invoke (await) | `await iii.trigger({ function_id, payload })`
|
|
43
|
-
| Invoke (fire-and-forget) | `iii.trigger({ function_id, payload, action: TriggerAction.Void() })`
|
|
37
|
+
| Operation | Signature | Description |
|
|
38
|
+
| ------------------------ | --------------------------------------------------------------------------------- | ------------------------------------------------------------ |
|
|
39
|
+
| Initialize | `registerWorker(url, options?)` | Create and connect to the engine. Returns an `ISdk` instance |
|
|
40
|
+
| Register function | `iii.registerFunction(id, handler, options?)` | Register a function that can be invoked by name |
|
|
41
|
+
| Register trigger | `iii.registerTrigger({ type, function_id, config })` | Bind a trigger (HTTP, cron, queue, etc.) to a function |
|
|
42
|
+
| Invoke (await) | `await iii.trigger({ function_id, payload })` | Invoke a function and wait for the result |
|
|
43
|
+
| Invoke (fire-and-forget) | `iii.trigger({ function_id, payload, action: TriggerAction.Void() })` | Invoke without waiting |
|
|
44
|
+
| Invoke (enqueue) | `iii.trigger({ function_id, payload, action: TriggerAction.Enqueue({ queue }) })` | Route invocation through a named queue |
|
|
44
45
|
|
|
45
46
|
### Registering Functions
|
|
46
47
|
|
|
@@ -72,19 +73,6 @@ const result = await iii.trigger({ function_id: 'orders::create', payload: { ite
|
|
|
72
73
|
iii.trigger({ function_id: 'analytics::track', payload: { event: 'page_view' }, action: TriggerAction.Void() })
|
|
73
74
|
```
|
|
74
75
|
|
|
75
|
-
## Node Modules
|
|
76
|
-
|
|
77
|
-
| Import | What it provides |
|
|
78
|
-
| ------------------- | ------------------------------------- |
|
|
79
|
-
| `iii-sdk` | Core SDK (`registerWorker`, types) |
|
|
80
|
-
| `iii-sdk/stream` | Stream client for real-time state |
|
|
81
|
-
| `iii-sdk/state` | State client for key-value operations |
|
|
82
|
-
| `iii-sdk/telemetry` | OpenTelemetry integration |
|
|
83
|
-
|
|
84
|
-
## Removed methods
|
|
85
|
-
|
|
86
|
-
`call`, `callVoid`, and `triggerVoid` have been removed. Use `trigger()` for all invocations. For fire-and-forget, use `trigger({ function_id, payload, action: TriggerAction.Void() })`.
|
|
87
|
-
|
|
88
76
|
## Resources
|
|
89
77
|
|
|
90
78
|
- [Documentation](https://iii.dev/docs)
|