このドキュメントは Channel App SDK と一緒に管理されています。最新 package とドキュメント全体の順序は、まず SDK README を確認してください。この Document の基準となる原文は GitHub 原文です。
Function は Channel または他の app が app server に送る typed RPC です。Request の method が
Function の完全な name で、params が input です。App 固有 Function は orders.get のような
standalone name で登録し、標準 Extension Function は Extension name と relative name を組み合わせます。
受信 call は次の JSON-RPC-like envelope を使用します。
method: discovery が公開する正確な完全 Function nameparams: schema で検証する untrusted inputcontext: surface に応じた caller、Channel、language、auth、config datasystemVersion: 必要な場合に Extension contract version を選択
Public JSON field は TypeScript と Go の両方で camelCase を使用します。Raw body の
x-signature 検証に成功した後だけ context を信頼してください。
成功時は result、想定可能な失敗時は structured error を返します。
主な code は unprocessable input 1、bad request 2、not found 3、unauthorized 4、method
not found -32601、internal error -32603 です。Programmatic handling 用の type は安定させ、
error に credential や customer data を入れないでください。完全な envelope は
共通 protocolを基準にします。
Developer portal には Function root を登録し、AppStore は system version 付き route を呼び出します。
SDK が routing、dispatch、schema validation、error envelope、
extension.core.function.getFunctions discovery を処理します。Raw JSON-RPC router や manual
discovery response を別に作らないでください。TypeScript は SignatureGuard と rawBody: true、
Go は server.WithSignature で正確な request bytes を検証します。
Decorator API と Zod schema を使用します。
@Extension({ name: "command" }) がある provider の @Func("metadata.getCommands") は
extension.command.metadata.getCommands になります。Standalone Function のために fake
Extension を作らないでください。Discovery されるよう、decorated class を NestJS module の
providers に追加します。
Go は builder と generic handler を使用します。
appsdk.Register と appsdk.MustRegister は Go struct から schema を作り、input が
Validate() error を実装する場合は自動で呼び出します。明示的な contract には
appsdk.InputSchema、appsdk.OutputSchema、proto helper を使用します。
Native Function は逆方向で、app が Channel operation を要求します。TokenManager から app token
または channel token を取得し、typed proxy/client を優先してください。固定された document の
一覧ではなく、現在の TypeScript NativeFunctionTypeMap と Go native.Client export が基準です。
他の app または自分の登録済み Function を AppStore 経由で呼ぶ場合は SDK の app-function client を使用します。
有効な access token は business authorization の代わりではありません。Target app、install 済み Channel、caller、requested resource の関係を handler で再確認してください。正確な API は TypeScript Native Function referenceと Go Native Function referenceを確認します。
SDK schema と Function name を提供する標準 Extension helper を優先します。Go builder package
には extension/config、extension/oauth、extension/calendar、extension/command、
extension/widget、extension/customtab、extension/hook、extension/polling、
extension/store、extension/messaging、extension/alftask、extension/wms などがあります。
SDK helper がない standalone Function だけを generic registration に分離してください。
次に Command ガイド、WAM ガイド、 Extension 完全ガイド、本番運用準備ガイドを確認してください。