大卫在这里,来自 Zapier 平台团队。好问题!
根据文档,这有点不清楚 -StoreClient
仅在 Code 应用程序(又名Code by Zapier
)中可用。如果您正在使用zapier-platform-core
,则您正在创建一个 cli 应用程序,它是一个 vanilla node.js 环境。如果您想从 cli 应用程序中进行交互Storage by Zapier
,您可以使用网站上的文档:https ://store.zapier.com 。即:
{
"how does it work?": {
"always provide either `?secret=12345` or `X-Secret: 12345`": "",
"GET /api/secret": [
"will return a random secret for you to use if you need one."
],
"GET /api/records": [
"will return a full object of all values stored by default.",
"you can also specify only the keys you want via the",
"querystring like`?key=color&key=age`."
],
"POST /api/records": [
"provide a body with a json object with keys/values you want",
"to store like `{\"color\": \"blue\", \"age\": 29}`."
],
"DELETE /api/records": ["completely clear all the records in this account"],
"PATCH /api/records": [
"A data with a particular schema needs to be received.",
"The schema specifies which action to do and with what parameters.",
"For example {\"action\": \"increment_by\", \"data\": {\"key\": \"<key_name>\", \"amount\": 1}} to increment the value specified by \"key\"."
]
}
}
可以使用标准向这些端点发出请求,该标准z.request
在此处有详细记录:https ://github.com/zapier/zapier-platform/tree/master/packages/cli#making-http-requests