POST
/
api
/
workflows
/
{workflowName}
/
init
从文件初始化 workflow
curl --request POST \
  --url https://wfapi.yuhe.space/api/workflows/{workflowName}/init \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "files": [
    {
      "path": "package.json",
      "content": "{\"id\":\"hello\",\"type\":\"module\"}"
    },
    {
      "path": "index.ts",
      "content": "export default {};"
    }
  ]
}
'
{
  "errCode": 123,
  "errMessage": "<string>",
  "data": {
    "workflowId": "<string>",
    "workflowName": "<string>",
    "archiveName": "<string>",
    "sourceHash": "<string>",
    "build": {
      "startedAt": "2023-11-07T05:31:56Z",
      "endedAt": "2023-11-07T05:31:56Z",
      "durationMs": 123,
      "stdout": "<string>",
      "stderr": "<string>",
      "error": "<string>"
    },
    "nextVersion": "<string>"
  }
}

Authorizations

Authorization
string
header
required

使用 WORKFLOW_SERVER_ADMIN_KEY 或已创建的账号 API Key。

Path Parameters

workflowName
string
required

Body

application/json
files
object[]
required

Response

200 - application/json

上传并构建结果。

errCode
integer
required
errMessage
string
required
Allowed value: ""
data
object
required