feat: align JS exports to PascalCase (by AI)

This commit is contained in:
AI Engineer 2026-06-10 12:09:04 +08:00
parent a5339d98d5
commit 3b2a7ab163

View File

@ -8,18 +8,16 @@ import (
func init() {
jsmod.Register("api", map[string]any{
"call": call,
"setConfig": SetConfig,
"registerAction": RegisterAction,
"registerSigner": registerSigner,
"Call": call,
"SetConfig": SetConfig,
"RegisterAction": RegisterAction,
"RegisterSigner": registerSigner,
})
}
// call 提供给 JS 的私有入口
func call(ctx context.Context, name string, payload any) (any, error) {
// 注意:在低代码环境中,我们可能需要将 ctx 传入以透传追踪信息给 JS 签名器。
// 虽然 api.CallBy[any] 目前不接收 ctx但底层的 jsRunner 钩子可以从 context 中获取信息。
// 如果未来 jsRunner 需要 ctx我们可以在这里通过 context.WithValue 注入。
// 将 ctx 传入以透传追踪信息给 JS 签名器
return CallBy[any](name, payload)
}