iii-node-sdk
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseNode.js SDK
Node.js SDK
The TypeScript/JavaScript SDK for connecting workers to the iii engine.
用于将worker连接到iii引擎的TypeScript/JavaScript SDK。
Documentation
文档
Full API reference: https://iii.dev/docs/api-reference/sdk-node
Install
安装
npm install iii-sdknpm install iii-sdkKey APIs
核心API
| API | Purpose |
|---|---|
| Connect to the engine and return the |
| Register a local async function handler |
| Register an HTTP-invoked external function |
| Bind a trigger to a function (with optional metadata) |
| Invoke a function |
| Fire-and-forget invocation mode |
| Durable async invocation mode |
| Structured logging |
| OpenTelemetry instrumentation |
| Binary streaming between workers |
| Custom stream implementation |
| Custom trigger type registration |
| API | 用途 |
|---|---|
| 连接到引擎并返回 |
| 注册本地异步函数处理程序 |
| 注册通过HTTP调用的外部函数 |
| 将触发器绑定到函数(可附带元数据) |
| 调用函数 |
| 即发即弃调用模式 |
| 持久化异步调用模式 |
| 结构化日志 |
| OpenTelemetry 埋点工具 |
| Worker之间的二进制流通信 |
| 自定义流实现 |
| 自定义触发器类型注册 |
RBAC Auth Result Fields
RBAC 认证结果字段
When implementing an auth function for RBAC workers, the supports:
AuthResult| Field | Purpose |
|---|---|
| Additional function IDs to allow |
| Function IDs to deny (overrides expose_functions) |
| Trigger types the worker may register |
| Whether the worker can register new trigger types |
| Prefix applied to functions registered by worker |
| Arbitrary context forwarded to middleware/handlers |
为RBAC worker实现认证函数时,支持以下字段:
AuthResult| 字段 | 用途 |
|---|---|
| 允许调用的额外函数ID列表 |
| 禁止调用的函数ID列表(优先级高于expose_functions) |
| worker可注册的触发器类型列表 |
| worker是否可以注册新的触发器类型 |
| 应用于worker注册函数的前缀 |
| 转发给中间件/处理程序的任意上下文数据 |
Browser SDK
浏览器SDK
For browser environments, use (same API, adapted for browser WebSocket constraints). See skill for details.
iii-browser-sdkiii-browser-sdk对于浏览器环境,请使用(API相同,适配浏览器WebSocket限制)。详情请查看技能。
iii-browser-sdkiii-browser-sdkPattern Boundaries
模式边界
- For usage patterns and working examples, see
iii-functions-and-triggers - For HTTP endpoint patterns, see
iii-http-endpoints - For HTTP middleware patterns, see
iii-http-middleware - For browser-side usage, see
iii-browser-sdk - For Python SDK, see
iii-python-sdk - For Rust SDK, see
iii-rust-sdk
- 如需使用模式和工作示例,请查看
iii-functions-and-triggers - 如需HTTP端点模式,请查看
iii-http-endpoints - 如需HTTP中间件模式,请查看
iii-http-middleware - 如需浏览器端使用方法,请查看
iii-browser-sdk - 如需Python SDK,请查看
iii-python-sdk - 如需Rust SDK,请查看
iii-rust-sdk
When to Use
使用场景
- Use this skill when the task is primarily about in the iii engine.
iii-node-sdk - Triggers when the request directly asks for this pattern or an equivalent implementation.
- 当任务主要涉及iii引擎中的时,使用本技能。
iii-node-sdk - 当请求直接询问此模式或等效实现时触发。
Boundaries
边界限制
- Never use this skill as a generic fallback for unrelated tasks.
- You must not apply this skill when a more specific iii skill is a better fit.
- Always verify environment and safety constraints before applying examples from this skill.
- 切勿将本技能作为无关任务的通用回退方案。
- 当有更特定的iii技能更合适时,不得使用本技能。
- 在应用本技能中的示例前,务必验证环境和安全约束。