From 5e59bbab2c062d712e0cab5909a381536d14bd81 Mon Sep 17 00:00:00 2001 From: Denis Arh Date: Wed, 9 Feb 2022 15:55:50 +0100 Subject: [PATCH] Added meta/visual for http-request function --- .../automation/http_request_handler.gen.go | 16 ++++++++++--- .../automation/http_request_handler.yaml | 23 +++++++++++++++++++ 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/automation/automation/http_request_handler.gen.go b/automation/automation/http_request_handler.gen.go index 938e9ef57..0a0635a49 100644 --- a/automation/automation/http_request_handler.gen.go +++ b/automation/automation/http_request_handler.gen.go @@ -10,13 +10,14 @@ package automation import ( "context" - atypes "github.com/cortezaproject/corteza-server/automation/types" - "github.com/cortezaproject/corteza-server/pkg/expr" - "github.com/cortezaproject/corteza-server/pkg/wfexec" "io" "net/http" "net/url" "time" + + atypes "github.com/cortezaproject/corteza-server/automation/types" + "github.com/cortezaproject/corteza-server/pkg/expr" + "github.com/cortezaproject/corteza-server/pkg/wfexec" ) var _ wfexec.ExecResponse @@ -110,10 +111,16 @@ func (h httpRequestHandler) Send() *atypes.Function { { Name: "url", Types: []string{"String"}, Required: true, + Meta: &atypes.ParamMeta{ + Visual: map[string]interface{}{"input": map[string]interface{}{"type": "url"}}, + }, }, { Name: "method", Types: []string{"String"}, Required: true, + Meta: &atypes.ParamMeta{ + Visual: map[string]interface{}{"input": map[string]interface{}{"properties": map[string]interface{}{"options": []interface{}{map[string]interface{}{"text": "GET", "value": "GET"}, map[string]interface{}{"text": "HEAD", "value": "HEAD"}, map[string]interface{}{"text": "POST", "value": "POST"}, map[string]interface{}{"text": "PUT", "value": "PUT"}, map[string]interface{}{"text": "PATCH", "value": "PATCH"}, map[string]interface{}{"text": "DELETE", "value": "DELETE"}, map[string]interface{}{"text": "CONNECT", "value": "CONNECT"}, map[string]interface{}{"text": "OPTIONS", "value": "OPTIONS"}, map[string]interface{}{"text": "TRACE", "value": "TRACE"}}}, "type": "select"}}, + }, }, { Name: "params", @@ -122,6 +129,9 @@ func (h httpRequestHandler) Send() *atypes.Function { { Name: "headers", Types: []string{"KVV"}, + Meta: &atypes.ParamMeta{ + Visual: map[string]interface{}{"input": map[string]interface{}{"type": "http-headers"}}, + }, }, { Name: "headerAuthBearer", diff --git a/automation/automation/http_request_handler.yaml b/automation/automation/http_request_handler.yaml index af6acba15..229264c56 100644 --- a/automation/automation/http_request_handler.yaml +++ b/automation/automation/http_request_handler.yaml @@ -11,19 +11,42 @@ params: required: true types: - { wf: String } + meta: { visual: { input: { type: url } } } + method: &method required: true types: - { wf: String } + meta: + visual: + input: + type: select + properties: + options: + - { value: "GET", text: "GET" } + - { value: "HEAD", text: "HEAD" } + - { value: "POST", text: "POST" } + - { value: "PUT", text: "PUT" } + - { value: "PATCH", text: "PATCH" } + - { value: "DELETE", text: "DELETE" } + - { value: "CONNECT", text: "CONNECT" } + - { value: "OPTIONS", text: "OPTIONS" } + - { value: "TRACE", text: "TRACE" } + params: ¶ms types: - { wf: KVV, go: 'url.Values' } + headers: &headers types: - { wf: KVV, go: 'http.Header' } + meta: { visual: { input: { type: http-headers } } } + + headerAuthBearer: &headerAuthBearer types: - { wf: String } + headerAuthUsername: &headerAuthUsername types: - { wf: String }