@lark-apaas/nestjs-capability 0.1.4-beta.0 → 0.1.4-beta.10
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 +9 -1
- package/dist/index.cjs +476 -147
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +99 -5
- package/dist/index.d.ts +99 -5
- package/dist/index.js +453 -125
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -101,6 +101,7 @@ const result = await this.capabilityService
|
|
|
101
101
|
userId: 'custom-user-id',
|
|
102
102
|
tenantId: 'custom-tenant-id',
|
|
103
103
|
appId: 'custom-app-id',
|
|
104
|
+
isSystemAccount: false,
|
|
104
105
|
},
|
|
105
106
|
});
|
|
106
107
|
|
|
@@ -419,17 +420,24 @@ interface PluginInstance {
|
|
|
419
420
|
|
|
420
421
|
```typescript
|
|
421
422
|
interface PluginActionContext {
|
|
423
|
+
pluginKey: string; // 插件标识(如 @official/ai-chat)
|
|
422
424
|
logger: Logger; // 日志记录器
|
|
423
|
-
|
|
425
|
+
platformHttpClient: PlatformHttpClient; // HTTP 客户端(自动携带 x-plugin-key header)
|
|
424
426
|
userContext: {
|
|
425
427
|
userId: string; // 用户 ID
|
|
426
428
|
tenantId: string; // 租户 ID
|
|
427
429
|
appId: string; // 应用 ID
|
|
430
|
+
isSystemAccount: boolean; // 是否为系统账号
|
|
428
431
|
};
|
|
429
432
|
isDebug: boolean; // 是否为调试模式
|
|
430
433
|
}
|
|
431
434
|
```
|
|
432
435
|
|
|
436
|
+
**pluginKey 说明:**
|
|
437
|
+
- 每次插件调用都会传入当前插件的标识
|
|
438
|
+
- 插件的 HttpClient 会自动在请求头中携带 `x-plugin-key` header
|
|
439
|
+
- 用于计费追踪、日志关联等场景
|
|
440
|
+
|
|
433
441
|
**isDebug 说明:**
|
|
434
442
|
- `DebugController` 调用时 `isDebug = true`
|
|
435
443
|
- `WebhookController` 或其他调用时 `isDebug = false`
|