functionbuilder
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Nathan Coad
2023-02-10 17:21:49 +11:00
parent 1f1e172f2e
commit c2bc2c7e4a
4 changed files with 17 additions and 24 deletions

View File

@@ -24,9 +24,6 @@ type PostParamsBody struct {
// File to create before running commands.
Files []apps.DirektivFile `json:"files"`
// json input to convert to spreadsheet
InData interface{} `json:"in-data,omitempty"`
// Name of the json input file to utilise
Infile string `json:"infile,omitempty"`

View File

@@ -80,10 +80,6 @@ func init() {
"$ref": "#/definitions/direktivFile"
}
},
"in-data": {
"description": "json input to convert to spreadsheet",
"type": "object"
},
"infile": {
"description": "Name of the json input file to utilise",
"type": "string"
@@ -156,11 +152,11 @@ func init() {
"x-direktiv-examples": [
{
"content": "- id: export-xlsx\n type: action\n action:\n function: export-xlsx\n input: \n files:\n - name: input.json\n data: |\n jq(.input) \n worksheet-name: \"TestSpreadsheet\"\n out-filename: example.xlsx",
"title": "Rely on Direktiv to create input file"
"title": "Basic"
},
{
"content": "- id: export-xlsx\n type: action\n action:\n function: export-xlsx\n input: \n worksheet-name: \"TestSpreadsheet\"\n out-filename: example.xlsx\n in-data: jq(.array | tostring) ",
"title": "Use function to create input file"
"content": "- id: export-xlsx\n type: action\n action:\n function: export-xlsx\n input: \n files:\n - name: input.json\n data: |\n jq(.array | {input: . } | tostring ) \n worksheet-name: \"TestSpreadsheet\"\n out-filename: example.xlsx ",
"title": "Use jq to add a parent key 'input' containing array of objects"
}
],
"x-direktiv-function": "functions:\n- id: export-xlsx\n image: registry.coadcorp.com/export-xlsx:1.0\n type: knative-workflow",
@@ -319,11 +315,11 @@ func init() {
"x-direktiv-examples": [
{
"content": "- id: export-xlsx\n type: action\n action:\n function: export-xlsx\n input: \n files:\n - name: input.json\n data: |\n jq(.input) \n worksheet-name: \"TestSpreadsheet\"\n out-filename: example.xlsx",
"title": "Rely on Direktiv to create input file"
"title": "Basic"
},
{
"content": "- id: export-xlsx\n type: action\n action:\n function: export-xlsx\n input: \n worksheet-name: \"TestSpreadsheet\"\n out-filename: example.xlsx\n in-data: jq(.array | tostring) ",
"title": "Use function to create input file"
"content": "- id: export-xlsx\n type: action\n action:\n function: export-xlsx\n input: \n files:\n - name: input.json\n data: |\n jq(.array | {input: . } | tostring ) \n worksheet-name: \"TestSpreadsheet\"\n out-filename: example.xlsx ",
"title": "Use jq to add a parent key 'input' containing array of objects"
}
],
"x-direktiv-function": "functions:\n- id: export-xlsx\n image: registry.coadcorp.com/export-xlsx:1.0\n type: knative-workflow",
@@ -404,10 +400,6 @@ func init() {
"$ref": "#/definitions/direktivFile"
}
},
"in-data": {
"description": "json input to convert to spreadsheet",
"type": "object"
},
"infile": {
"description": "Name of the json input file to utilise",
"type": "string"