為內部 API 建立自訂 Prismatic 連接器
何時使用: 當您有內部 API 需要讓 Prismatic 流程呼叫時。
步驟
-
建立連接器鷹架Use prismatic-skills. Scaffold a connector for our Orders API — base URL, bearer auth, actions for list, get, create.✓ 已複製→ 包含 TS 入口點、清單檔及測試檔的連接器目錄
-
實作動作Fill in the listOrders action with pagination and error handling.✓ 已複製→ 含型別與 Prismatic 輸入/輸出慣例的 TS 實作
-
本機測試Run the test harness with a mock response.✓ 已複製→ prism tests 輸出;全部通過
結果: 一個可部署的連接器,讓流程能夠使用其中的動作。
注意事項
- 缺少輸入驗證 — Prismatic 在平台邊界進行驗證;仍建議使用 Zod 或類似工具確保執行期安全
搭配使用: filesystem