Cleanup, rewrite workflow functions

This commit is contained in:
Denis Arh
2021-03-18 07:12:08 +01:00
parent 679fba69cc
commit 85c5ac4943
22 changed files with 215 additions and 171 deletions
@@ -44,7 +44,7 @@ type (
}
)
// Exec function Executes script in Corredor Automation server
// Exec function Corredor automation script executor
//
// expects implementation of exec function:
// func (h corredorHandler) exec(ctx context.Context, args *corredorExecArgs) (results *corredorExecResults, err error) {
@@ -56,7 +56,8 @@ func (h corredorHandler) Exec() *atypes.Function {
Kind: "function",
Labels: map[string]string(nil),
Meta: &atypes.FunctionMeta{
Short: "Executes script in Corredor Automation server",
Short: "Corredor automation script executor",
Description: "Executes script in Corredor Automation server",
},
Parameters: []*atypes.Param{
+2 -1
View File
@@ -4,7 +4,8 @@ functions:
exec:
kind: function
meta:
short: Executes script in Corredor Automation server
short: Corredor automation script executor
description: Executes script in Corredor Automation server
params:
script: { types: [ { wf: String } ], required: true }
args: { types: [ { wf: Any } ] }
+27 -18
View File
@@ -103,7 +103,7 @@ func (a emailSendArgs) GetPlain() (bool, string, io.Reader) {
return a.hasPlain, a.plainString, a.plainStream
}
// Send function Sends email message with basic parameters
// Send function Email
//
// expects implementation of send function:
// func (h emailHandler) send(ctx context.Context, args *emailSendArgs) (err error) {
@@ -115,7 +115,8 @@ func (h emailHandler) Send() *atypes.Function {
Kind: "function",
Labels: map[string]string(nil),
Meta: &atypes.FunctionMeta{
Short: "Sends email message with basic parameters",
Short: "Email",
Description: "Sends email directly",
},
Parameters: []*atypes.Param{
@@ -329,7 +330,7 @@ func (a emailMessageArgs) GetPlain() (bool, string, io.Reader) {
return a.hasPlain, a.plainString, a.plainStream
}
// Message function Constructs new email message
// Message function Email builder
//
// expects implementation of message function:
// func (h emailHandler) message(ctx context.Context, args *emailMessageArgs) (results *emailMessageResults, err error) {
@@ -341,7 +342,8 @@ func (h emailHandler) Message() *atypes.Function {
Kind: "function",
Labels: map[string]string(nil),
Meta: &atypes.FunctionMeta{
Short: "Constructs new email message",
Short: "Email builder",
Description: "Constructs new email message from basic parameters without sending it",
},
Parameters: []*atypes.Param{
@@ -523,7 +525,7 @@ type (
}
)
// SendMessage function Sends email message
// SendMessage function Email sender
//
// expects implementation of sendMessage function:
// func (h emailHandler) sendMessage(ctx context.Context, args *emailSendMessageArgs) (err error) {
@@ -535,7 +537,8 @@ func (h emailHandler) SendMessage() *atypes.Function {
Kind: "function",
Labels: map[string]string(nil),
Meta: &atypes.FunctionMeta{
Short: "Sends email message",
Short: "Email sender",
Description: "Sends email message",
},
Parameters: []*atypes.Param{
@@ -574,7 +577,7 @@ type (
}
)
// SetSubject function Sets message subject
// SetSubject function Email subject
//
// expects implementation of setSubject function:
// func (h emailHandler) setSubject(ctx context.Context, args *emailSetSubjectArgs) (err error) {
@@ -586,7 +589,8 @@ func (h emailHandler) SetSubject() *atypes.Function {
Kind: "function",
Labels: map[string]string(nil),
Meta: &atypes.FunctionMeta{
Short: "Sets message subject",
Short: "Email subject",
Description: "Sets subject on the email message",
},
Parameters: []*atypes.Param{
@@ -633,7 +637,7 @@ type (
}
)
// SetHeaders function Sets message headers (overrides any existing headers, subject, recipients)
// SetHeaders function Email headers
//
// expects implementation of setHeaders function:
// func (h emailHandler) setHeaders(ctx context.Context, args *emailSetHeadersArgs) (err error) {
@@ -645,7 +649,8 @@ func (h emailHandler) SetHeaders() *atypes.Function {
Kind: "function",
Labels: map[string]string(nil),
Meta: &atypes.FunctionMeta{
Short: "Sets message headers (overrides any existing headers, subject, recipients)",
Short: "Email headers",
Description: "Sets message headers (overrides any existing headers, subject, recipients)",
},
Parameters: []*atypes.Param{
@@ -695,7 +700,7 @@ type (
}
)
// SetHeader function Appends value or removes specific header,
// SetHeader function Email header
//
// expects implementation of setHeader function:
// func (h emailHandler) setHeader(ctx context.Context, args *emailSetHeaderArgs) (err error) {
@@ -707,7 +712,8 @@ func (h emailHandler) SetHeader() *atypes.Function {
Kind: "function",
Labels: map[string]string(nil),
Meta: &atypes.FunctionMeta{
Short: "Appends value or removes specific header,",
Short: "Email header",
Description: "Sets or removes specific header without changing the rest",
},
Parameters: []*atypes.Param{
@@ -769,7 +775,7 @@ type (
}
)
// SetAddress function Adds new recipient, sender or reply-to address
// SetAddress function Email address
//
// expects implementation of setAddress function:
// func (h emailHandler) setAddress(ctx context.Context, args *emailSetAddressArgs) (err error) {
@@ -781,7 +787,8 @@ func (h emailHandler) SetAddress() *atypes.Function {
Kind: "function",
Labels: map[string]string(nil),
Meta: &atypes.FunctionMeta{
Short: "Adds new recipient, sender or reply-to address",
Short: "Email address",
Description: "Adds new recipient, sender or reply-to address",
},
Parameters: []*atypes.Param{
@@ -854,7 +861,7 @@ func (a emailAttachArgs) GetContent() (bool, io.Reader, string) {
return a.hasContent, a.contentStream, a.contentString
}
// Attach function Attach content to an email message
// Attach function Email attachment
//
// expects implementation of attach function:
// func (h emailHandler) attach(ctx context.Context, args *emailAttachArgs) (err error) {
@@ -866,7 +873,8 @@ func (h emailHandler) Attach() *atypes.Function {
Kind: "function",
Labels: map[string]string(nil),
Meta: &atypes.FunctionMeta{
Short: "Attach content to an email message",
Short: "Email attachment",
Description: "Attach content to an email message",
},
Parameters: []*atypes.Param{
@@ -935,7 +943,7 @@ type (
}
)
// Embed function Embed file to an email message
// Embed function Email embedded attachment
//
// expects implementation of embed function:
// func (h emailHandler) embed(ctx context.Context, args *emailEmbedArgs) (err error) {
@@ -947,7 +955,8 @@ func (h emailHandler) Embed() *atypes.Function {
Kind: "function",
Labels: map[string]string(nil),
Meta: &atypes.FunctionMeta{
Short: "Embed file to an email message",
Short: "Email embedded attachment",
Description: "Embed file (image) to an email message",
},
Parameters: []*atypes.Param{
+18 -9
View File
@@ -67,27 +67,31 @@ functions:
send:
kind: function
meta:
short: Sends email message with basic parameters
short: Email
description: Sends email directly
params: *messageParams
message:
kind: function
meta:
short: Constructs new email message
short: Email builder
description: Constructs new email message from basic parameters without sending it
params: *messageParams
results: *messageResults
sendMessage:
kind: function
meta:
short: Sends email message
short: Email sender
description: Sends email message
params:
message: *messageParam
setSubject:
kind: function
meta:
short: Sets message subject
short: Email subject
description: Sets subject on the email message
params:
message: *messageParam
subject:
@@ -100,7 +104,8 @@ functions:
setHeaders:
kind: function
meta:
short: Sets message headers (overrides any existing headers, subject, recipients)
short: Email headers
description: Sets message headers (overrides any existing headers, subject, recipients)
params:
message: *messageParam
headers:
@@ -113,7 +118,8 @@ functions:
setHeader:
kind: function
meta:
short: Appends value or removes specific header,
short: Email header
description: Sets or removes specific header without changing the rest
params:
message: *messageParam
name:
@@ -127,7 +133,8 @@ functions:
setAddress:
kind: function
meta:
short: Adds new recipient, sender or reply-to address
short: Email address
description: Adds new recipient, sender or reply-to address
params:
message: *messageParam
type:
@@ -145,7 +152,8 @@ functions:
attach:
kind: function
meta:
short: Attach content to an email message
short: Email attachment
description: Attach content to an email message
params:
message: *messageParam
content:
@@ -159,7 +167,8 @@ functions:
embed:
kind: function
meta:
short: Embed file to an email message
short: Email embedded attachment
description: Embed file (image) to an email message
params:
message: *messageParam
content:
@@ -90,7 +90,7 @@ func (a httpRequestSendArgs) GetBody() (bool, string, io.Reader, interface{}) {
return a.hasBody, a.bodyString, a.bodyStream, a.bodyRaw
}
// Send function Sends HTTP request
// Send function HTTP request
//
// expects implementation of send function:
// func (h httpRequestHandler) send(ctx context.Context, args *httpRequestSendArgs) (results *httpRequestSendResults, err error) {
@@ -102,7 +102,8 @@ func (h httpRequestHandler) Send() *atypes.Function {
Kind: "function",
Labels: map[string]string{"http request": "step,workflow"},
Meta: &atypes.FunctionMeta{
Short: "Sends HTTP request",
Short: "HTTP request",
Description: "Sends HTTP requests",
},
Parameters: []*atypes.Param{
@@ -71,7 +71,8 @@ results:
functions:
send:
meta:
short: Sends HTTP request
short: HTTP request
description: Sends HTTP requests
labels:
"http request": "step,workflow"
params:
+8 -8
View File
@@ -43,7 +43,7 @@ type (
}
)
// Debug function Writes debug log message
// Debug function Log debug message
//
// expects implementation of debug function:
// func (h logHandler) debug(ctx context.Context, args *logDebugArgs) (err error) {
@@ -55,7 +55,7 @@ func (h logHandler) Debug() *atypes.Function {
Kind: "function",
Labels: map[string]string{"debug": "step", "logger": "step,workflow"},
Meta: &atypes.FunctionMeta{
Short: "Writes debug log message",
Short: "Log debug message",
},
Parameters: []*atypes.Param{
@@ -96,7 +96,7 @@ type (
}
)
// Info function Writes info log message
// Info function Log info message
//
// expects implementation of info function:
// func (h logHandler) info(ctx context.Context, args *logInfoArgs) (err error) {
@@ -108,7 +108,7 @@ func (h logHandler) Info() *atypes.Function {
Kind: "function",
Labels: map[string]string{"debug": "step", "logger": "step,workflow"},
Meta: &atypes.FunctionMeta{
Short: "Writes info log message",
Short: "Log info message",
},
Parameters: []*atypes.Param{
@@ -149,7 +149,7 @@ type (
}
)
// Warn function Writes warn log message
// Warn function Log warning message
//
// expects implementation of warn function:
// func (h logHandler) warn(ctx context.Context, args *logWarnArgs) (err error) {
@@ -161,7 +161,7 @@ func (h logHandler) Warn() *atypes.Function {
Kind: "function",
Labels: map[string]string{"debug": "step", "logger": "step,workflow"},
Meta: &atypes.FunctionMeta{
Short: "Writes warn log message",
Short: "Log warning message",
},
Parameters: []*atypes.Param{
@@ -202,7 +202,7 @@ type (
}
)
// Error function Writes error log message
// Error function Log error message
//
// expects implementation of error function:
// func (h logHandler) error(ctx context.Context, args *logErrorArgs) (err error) {
@@ -214,7 +214,7 @@ func (h logHandler) Error() *atypes.Function {
Kind: "function",
Labels: map[string]string{"debug": "step", "logger": "step,workflow"},
Meta: &atypes.FunctionMeta{
Short: "Writes error log message",
Short: "Log error message",
},
Parameters: []*atypes.Param{
+4 -4
View File
@@ -14,7 +14,7 @@ labels: &labels
functions:
debug:
meta:
short: Writes debug log message
short: Log debug message
labels: *labels
params:
message: *message
@@ -22,7 +22,7 @@ functions:
info:
meta:
short: Writes info log message
short: Log info message
labels: *labels
params:
message: *message
@@ -30,7 +30,7 @@ functions:
warn:
meta:
short: Writes warn log message
short: Log warning message
labels: *labels
params:
message: *message
@@ -38,7 +38,7 @@ functions:
error:
meta:
short: Writes error log message
short: Log error message
labels: *labels
params:
message: *message
+9 -6
View File
@@ -126,7 +126,7 @@ type (
}
)
// Do function Iterates while condition is true
// Do function Condition
//
// expects implementation of do function:
// func (h loopHandler) do(ctx context.Context, args *loopDoArgs) (err error) {
@@ -138,7 +138,8 @@ func (h loopHandler) Do() *atypes.Function {
Kind: "iterator",
Labels: map[string]string(nil),
Meta: &atypes.FunctionMeta{
Short: "Iterates while condition is true",
Short: "Condition",
Description: "Iterates while condition is true",
},
Parameters: []*atypes.Param{
@@ -179,7 +180,7 @@ type (
}
)
// Each function Iterates over set of items
// Each function Items
//
// expects implementation of each function:
// func (h loopHandler) each(ctx context.Context, args *loopEachArgs) (results *loopEachResults, err error) {
@@ -191,7 +192,8 @@ func (h loopHandler) Each() *atypes.Function {
Kind: "iterator",
Labels: map[string]string(nil),
Meta: &atypes.FunctionMeta{
Short: "Iterates over set of items",
Short: "Items",
Description: "Iterates over set of items",
},
Parameters: []*atypes.Param{
@@ -236,7 +238,7 @@ type (
}
)
// Lines function Iterates over lines from stream
// Lines function Stream lines
//
// expects implementation of lines function:
// func (h loopHandler) lines(ctx context.Context, args *loopLinesArgs) (results *loopLinesResults, err error) {
@@ -248,7 +250,8 @@ func (h loopHandler) Lines() *atypes.Function {
Kind: "iterator",
Labels: map[string]string(nil),
Meta: &atypes.FunctionMeta{
Short: "Iterates over lines from stream",
Short: "Stream lines",
Description: "Iterates over lines from stream",
},
Parameters: []*atypes.Param{
+6 -3
View File
@@ -23,7 +23,8 @@ functions:
do:
kind: iterator
meta:
short: Iterates while condition is true
short: Condition
description: Iterates while condition is true
params:
while:
required: true
@@ -35,7 +36,8 @@ functions:
each:
kind: iterator
meta:
short: Iterates over set of items
short: Items
description: Iterates over set of items
params:
items:
required: true
@@ -49,7 +51,8 @@ functions:
lines:
kind: iterator
meta:
short: Iterates over lines from stream
short: Stream lines
description: Iterates over lines from stream
params:
stream:
required: true
+3 -2
View File
@@ -59,7 +59,7 @@ func (a modulesLookupArgs) GetNamespace() (bool, uint64, string, *types.Namespac
return a.hasNamespace, a.namespaceID, a.namespaceHandle, a.namespaceRes
}
// Lookup function Lookup for compose Lookup by ID
// Lookup function Compose module lookup
//
// expects implementation of lookup function:
// func (h modulesHandler) lookup(ctx context.Context, args *modulesLookupArgs) (results *modulesLookupResults, err error) {
@@ -71,7 +71,8 @@ func (h modulesHandler) Lookup() *atypes.Function {
Kind: "function",
Labels: map[string]string{"compose": "step,workflow", "lookup": "step", "module": "step,workflow"},
Meta: &atypes.FunctionMeta{
Short: "Lookup for compose Lookup by ID",
Short: "Compose module lookup",
Description: "Find specific module by ID or handle",
},
Parameters: []*atypes.Param{
+2 -1
View File
@@ -24,7 +24,8 @@ params:
functions:
lookup:
meta:
short: Lookup for compose Lookup by ID
short: Compose module lookup
description: Find specific module by ID or handle
params:
module: *moduleLookup
namespace: *namespaceLookup
+3 -2
View File
@@ -49,7 +49,7 @@ func (a namespacesLookupArgs) GetNamespace() (bool, uint64, string, *types.Names
return a.hasNamespace, a.namespaceID, a.namespaceHandle, a.namespaceRes
}
// Lookup function Lookup for compose namespace by ID
// Lookup function Compose namespace lookup
//
// expects implementation of lookup function:
// func (h namespacesHandler) lookup(ctx context.Context, args *namespacesLookupArgs) (results *namespacesLookupResults, err error) {
@@ -61,7 +61,8 @@ func (h namespacesHandler) Lookup() *atypes.Function {
Kind: "function",
Labels: map[string]string{"compose": "step,workflow", "lookup": "step", "namespace": "step,workflow"},
Meta: &atypes.FunctionMeta{
Short: "Lookup for compose namespace by ID",
Short: "Compose namespace lookup",
Description: "Find specific namespace by ID or handle",
},
Parameters: []*atypes.Param{
+2 -1
View File
@@ -17,7 +17,8 @@ params:
functions:
lookup:
meta:
short: Lookup for compose namespace by ID
short: Compose namespace lookup
description: Find specific namespace by ID or handle
labels:
lookup: "step"
namespace: "step,workflow"
+25 -22
View File
@@ -78,7 +78,7 @@ func (a recordsLookupArgs) GetRecord() (bool, uint64, *types.Record) {
return a.hasRecord, a.recordID, a.recordRes
}
// Lookup function Lookup for compose record by ID
// Lookup function Compose record lookup
//
// expects implementation of lookup function:
// func (h recordsHandler) lookup(ctx context.Context, args *recordsLookupArgs) (results *recordsLookupResults, err error) {
@@ -90,7 +90,8 @@ func (h recordsHandler) Lookup() *atypes.Function {
Kind: "function",
Labels: map[string]string{"compose": "step,workflow", "record": "step,workflow"},
Meta: &atypes.FunctionMeta{
Short: "Lookup for compose record by ID",
Short: "Compose record lookup",
Description: "Find specific record by ID",
},
Parameters: []*atypes.Param{
@@ -249,7 +250,7 @@ func (a recordsSearchArgs) GetNamespace() (bool, uint64, string, *types.Namespac
return a.hasNamespace, a.namespaceID, a.namespaceHandle, a.namespaceRes
}
// Search function Searches for records and returns them
// Search function Compose records search
//
// expects implementation of search function:
// func (h recordsHandler) search(ctx context.Context, args *recordsSearchArgs) (results *recordsSearchResults, err error) {
@@ -261,7 +262,7 @@ func (h recordsHandler) Search() *atypes.Function {
Kind: "function",
Labels: map[string]string{"compose": "step,workflow", "record": "step,workflow"},
Meta: &atypes.FunctionMeta{
Short: "Searches for records and returns them",
Short: "Compose records search",
},
Parameters: []*atypes.Param{
@@ -466,7 +467,7 @@ func (a recordsFirstArgs) GetNamespace() (bool, uint64, string, *types.Namespace
return a.hasNamespace, a.namespaceID, a.namespaceHandle, a.namespaceRes
}
// First function Returns the first created record
// First function Compose record lookup (first created)
//
// expects implementation of first function:
// func (h recordsHandler) first(ctx context.Context, args *recordsFirstArgs) (results *recordsFirstResults, err error) {
@@ -478,7 +479,7 @@ func (h recordsHandler) First() *atypes.Function {
Kind: "function",
Labels: map[string]string{"compose": "step,workflow", "record": "step,workflow"},
Meta: &atypes.FunctionMeta{
Short: "Returns the first created record",
Short: "Compose record lookup (first created)",
},
Parameters: []*atypes.Param{
@@ -595,7 +596,7 @@ func (a recordsLastArgs) GetNamespace() (bool, uint64, string, *types.Namespace)
return a.hasNamespace, a.namespaceID, a.namespaceHandle, a.namespaceRes
}
// Last function Returns the last created record
// Last function Compose record lookup (last created)
//
// expects implementation of last function:
// func (h recordsHandler) last(ctx context.Context, args *recordsLastArgs) (results *recordsLastResults, err error) {
@@ -607,7 +608,7 @@ func (h recordsHandler) Last() *atypes.Function {
Kind: "function",
Labels: map[string]string{"compose": "step,workflow", "record": "step,workflow"},
Meta: &atypes.FunctionMeta{
Short: "Returns the last created record",
Short: "Compose record lookup (last created)",
},
Parameters: []*atypes.Param{
@@ -750,7 +751,7 @@ func (a recordsEachArgs) GetNamespace() (bool, uint64, string, *types.Namespace)
return a.hasNamespace, a.namespaceID, a.namespaceHandle, a.namespaceRes
}
// Each function Searches for records and iterates over results
// Each function Compose records
//
// expects implementation of each function:
// func (h recordsHandler) each(ctx context.Context, args *recordsEachArgs) (results *recordsEachResults, err error) {
@@ -762,7 +763,7 @@ func (h recordsHandler) Each() *atypes.Function {
Kind: "iterator",
Labels: map[string]string{"compose": "step,workflow", "record": "step,workflow"},
Meta: &atypes.FunctionMeta{
Short: "Searches for records and iterates over results",
Short: "Compose records",
},
Parameters: []*atypes.Param{
@@ -917,7 +918,7 @@ func (a recordsNewArgs) GetNamespace() (bool, uint64, string, *types.Namespace)
return a.hasNamespace, a.namespaceID, a.namespaceHandle, a.namespaceRes
}
// New function Make a new record
// New function Compose record maker
//
// expects implementation of new function:
// func (h recordsHandler) new(ctx context.Context, args *recordsNewArgs) (results *recordsNewResults, err error) {
@@ -929,7 +930,8 @@ func (h recordsHandler) New() *atypes.Function {
Kind: "function",
Labels: map[string]string{"compose": "step,workflow", "record": "step,workflow"},
Meta: &atypes.FunctionMeta{
Short: "Make a new record",
Short: "Compose record maker",
Description: "Creates new compose record instance without saving it",
},
Parameters: []*atypes.Param{
@@ -1029,7 +1031,7 @@ type (
}
)
// Validate function Validate record
// Validate function Compose record validator
//
// expects implementation of validate function:
// func (h recordsHandler) validate(ctx context.Context, args *recordsValidateArgs) (results *recordsValidateResults, err error) {
@@ -1041,7 +1043,7 @@ func (h recordsHandler) Validate() *atypes.Function {
Kind: "function",
Labels: map[string]string{"compose": "step,workflow", "record": "step,workflow"},
Meta: &atypes.FunctionMeta{
Short: "Validate record",
Short: "Compose record validator",
},
Parameters: []*atypes.Param{
@@ -1109,7 +1111,7 @@ type (
}
)
// Create function Creates and stores a new record
// Create function Compose record create
//
// expects implementation of create function:
// func (h recordsHandler) create(ctx context.Context, args *recordsCreateArgs) (results *recordsCreateResults, err error) {
@@ -1121,7 +1123,7 @@ func (h recordsHandler) Create() *atypes.Function {
Kind: "function",
Labels: map[string]string{"compose": "step,workflow", "create": "step", "record": "step,workflow"},
Meta: &atypes.FunctionMeta{
Short: "Creates and stores a new record",
Short: "Compose record create",
},
Parameters: []*atypes.Param{
@@ -1186,7 +1188,7 @@ type (
}
)
// Update function Updates an existing record
// Update function Compose record update
//
// expects implementation of update function:
// func (h recordsHandler) update(ctx context.Context, args *recordsUpdateArgs) (results *recordsUpdateResults, err error) {
@@ -1198,7 +1200,7 @@ func (h recordsHandler) Update() *atypes.Function {
Kind: "function",
Labels: map[string]string{"compose": "step,workflow", "record": "step,workflow", "update": "step"},
Meta: &atypes.FunctionMeta{
Short: "Updates an existing record",
Short: "Compose record update",
},
Parameters: []*atypes.Param{
@@ -1265,7 +1267,7 @@ func (a recordsDeleteArgs) GetRecord() (bool, uint64, *types.Record) {
return a.hasRecord, a.recordID, a.recordRes
}
// Delete function Soft deletes compose record by ID
// Delete function Compose record delete
//
// expects implementation of delete function:
// func (h recordsHandler) delete(ctx context.Context, args *recordsDeleteArgs) (err error) {
@@ -1277,7 +1279,7 @@ func (h recordsHandler) Delete() *atypes.Function {
Kind: "function",
Labels: map[string]string{"compose": "step,workflow", "delete": "step", "record": "step,workflow"},
Meta: &atypes.FunctionMeta{
Short: "Soft deletes compose record by ID",
Short: "Compose record delete",
},
Parameters: []*atypes.Param{
@@ -1351,7 +1353,7 @@ func (a recordsReportArgs) GetNamespace() (bool, uint64, string, *types.Namespac
return a.hasNamespace, a.namespaceID, a.namespaceHandle, a.namespaceRes
}
// Report function Searches for records and returns them
// Report function Report
//
// expects implementation of report function:
// func (h recordsHandler) report(ctx context.Context, args *recordsReportArgs) (results *recordsReportResults, err error) {
@@ -1363,7 +1365,8 @@ func (h recordsHandler) Report() *atypes.Function {
Kind: "function",
Labels: map[string]string{"compose": "step,workflow", "record": "step,workflow"},
Meta: &atypes.FunctionMeta{
Short: "Searches for records and returns them",
Short: "Report",
Description: "Compose records report",
},
Parameters: []*atypes.Param{
+14 -11
View File
@@ -96,7 +96,8 @@ labels: &labels
functions:
lookup:
meta:
short: Lookup for compose record by ID
short: Compose record lookup
description: Find specific record by ID
labels:
<<: *labels
params:
@@ -108,7 +109,7 @@ functions:
search:
meta:
short: Searches for records and returns them
short: Compose records search
labels:
<<: *labels
params: *filterParams
@@ -121,7 +122,7 @@ functions:
first:
meta:
short: Returns the first created record
short: Compose record lookup (first created)
labels:
<<: *labels
params: *edgeParams
@@ -130,7 +131,7 @@ functions:
last:
meta:
short: Returns the last created record
short: Compose record lookup (last created)
labels:
<<: *labels
params: *edgeParams
@@ -140,7 +141,7 @@ functions:
each:
kind: iterator
meta:
short: Searches for records and iterates over results
short: Compose records
labels:
<<: *labels
params: *filterParams
@@ -151,7 +152,8 @@ functions:
new:
meta:
short: Make a new record
short: Compose record maker
description: Creates new compose record instance without saving it
labels:
<<: *labels
params:
@@ -162,7 +164,7 @@ functions:
validate:
meta:
short: Validate record
short: Compose record validator
labels:
<<: *labels
params:
@@ -175,7 +177,7 @@ functions:
create:
meta:
short: Creates and stores a new record
short: Compose record create
labels:
<<: *labels
create: "step"
@@ -188,7 +190,7 @@ functions:
update:
meta:
short: Updates an existing record
short: Compose record update
labels:
<<: *labels
update: "step"
@@ -201,7 +203,7 @@ functions:
delete:
meta:
short: Soft deletes compose record by ID
short: Compose record delete
labels:
<<: *labels
delete: "step"
@@ -218,7 +220,8 @@ functions:
report:
meta:
short: Searches for records and returns them
short: Report
description: Compose records report
labels:
<<: *labels
params:
+19 -18
View File
@@ -57,7 +57,7 @@ func (a rolesLookupArgs) GetLookup() (bool, uint64, string, *types.Role) {
return a.hasLookup, a.lookupID, a.lookupHandle, a.lookupRes
}
// Lookup function Looks-up for role by ID
// Lookup function Role lookup
//
// expects implementation of lookup function:
// func (h rolesHandler) lookup(ctx context.Context, args *rolesLookupArgs) (results *rolesLookupResults, err error) {
@@ -69,7 +69,8 @@ func (h rolesHandler) Lookup() *atypes.Function {
Kind: "function",
Labels: map[string]string{"users": "step,workflow"},
Meta: &atypes.FunctionMeta{
Short: "Looks-up for role by ID",
Short: "Role lookup",
Description: "Find specific role by ID or handle",
},
Parameters: []*atypes.Param{
@@ -182,7 +183,7 @@ type (
}
)
// Search function Searches for roles and returns them
// Search function Roles search
//
// expects implementation of search function:
// func (h rolesHandler) search(ctx context.Context, args *rolesSearchArgs) (results *rolesSearchResults, err error) {
@@ -194,7 +195,7 @@ func (h rolesHandler) Search() *atypes.Function {
Kind: "function",
Labels: map[string]string{"users": "step,workflow"},
Meta: &atypes.FunctionMeta{
Short: "Searches for roles and returns them",
Short: "Roles search",
},
Parameters: []*atypes.Param{
@@ -392,7 +393,7 @@ type (
}
)
// Each function Searches for roles and iterates over results
// Each function Roles
//
// expects implementation of each function:
// func (h rolesHandler) each(ctx context.Context, args *rolesEachArgs) (results *rolesEachResults, err error) {
@@ -404,7 +405,7 @@ func (h rolesHandler) Each() *atypes.Function {
Kind: "iterator",
Labels: map[string]string(nil),
Meta: &atypes.FunctionMeta{
Short: "Searches for roles and iterates over results",
Short: "Roles",
},
Parameters: []*atypes.Param{
@@ -509,7 +510,7 @@ type (
}
)
// Create function Creates new role
// Create function Role creator
//
// expects implementation of create function:
// func (h rolesHandler) create(ctx context.Context, args *rolesCreateArgs) (results *rolesCreateResults, err error) {
@@ -521,7 +522,7 @@ func (h rolesHandler) Create() *atypes.Function {
Kind: "function",
Labels: map[string]string{"create": "step", "users": "step,workflow"},
Meta: &atypes.FunctionMeta{
Short: "Creates new role",
Short: "Role creator",
},
Parameters: []*atypes.Param{
@@ -586,7 +587,7 @@ type (
}
)
// Update function Updates exiting role
// Update function Role update
//
// expects implementation of update function:
// func (h rolesHandler) update(ctx context.Context, args *rolesUpdateArgs) (results *rolesUpdateResults, err error) {
@@ -598,7 +599,7 @@ func (h rolesHandler) Update() *atypes.Function {
Kind: "function",
Labels: map[string]string{"update": "step", "users": "step,workflow"},
Meta: &atypes.FunctionMeta{
Short: "Updates exiting role",
Short: "Role update",
},
Parameters: []*atypes.Param{
@@ -666,7 +667,7 @@ func (a rolesDeleteArgs) GetLookup() (bool, uint64, string, *types.Role) {
return a.hasLookup, a.lookupID, a.lookupHandle, a.lookupRes
}
// Delete function Deletes the role
// Delete function Role delete
//
// expects implementation of delete function:
// func (h rolesHandler) delete(ctx context.Context, args *rolesDeleteArgs) (err error) {
@@ -678,7 +679,7 @@ func (h rolesHandler) Delete() *atypes.Function {
Kind: "function",
Labels: map[string]string{"delete": "step", "users": "step,workflow"},
Meta: &atypes.FunctionMeta{
Short: "Deletes the role",
Short: "Role delete",
},
Parameters: []*atypes.Param{
@@ -731,7 +732,7 @@ func (a rolesRecoverArgs) GetLookup() (bool, uint64, string, *types.Role) {
return a.hasLookup, a.lookupID, a.lookupHandle, a.lookupRes
}
// Recover function Recovers deleted role
// Recover function Role recover
//
// expects implementation of recover function:
// func (h rolesHandler) recover(ctx context.Context, args *rolesRecoverArgs) (err error) {
@@ -743,7 +744,7 @@ func (h rolesHandler) Recover() *atypes.Function {
Kind: "function",
Labels: map[string]string{"recover": "step", "users": "step,workflow"},
Meta: &atypes.FunctionMeta{
Short: "Recovers deleted role",
Short: "Role recover",
},
Parameters: []*atypes.Param{
@@ -796,7 +797,7 @@ func (a rolesArchiveArgs) GetLookup() (bool, uint64, string, *types.Role) {
return a.hasLookup, a.lookupID, a.lookupHandle, a.lookupRes
}
// Archive function Archives the role
// Archive function Role archive
//
// expects implementation of archive function:
// func (h rolesHandler) archive(ctx context.Context, args *rolesArchiveArgs) (err error) {
@@ -808,7 +809,7 @@ func (h rolesHandler) Archive() *atypes.Function {
Kind: "function",
Labels: map[string]string{"archive": "step", "users": "step,workflow"},
Meta: &atypes.FunctionMeta{
Short: "Archives the role",
Short: "Role archive",
},
Parameters: []*atypes.Param{
@@ -861,7 +862,7 @@ func (a rolesUnarchiveArgs) GetLookup() (bool, uint64, string, *types.Role) {
return a.hasLookup, a.lookupID, a.lookupHandle, a.lookupRes
}
// Unarchive function Unarchives the role
// Unarchive function Role unarchive
//
// expects implementation of unarchive function:
// func (h rolesHandler) unarchive(ctx context.Context, args *rolesUnarchiveArgs) (err error) {
@@ -873,7 +874,7 @@ func (h rolesHandler) Unarchive() *atypes.Function {
Kind: "function",
Labels: map[string]string{"unarchive": "step", "users": "step,workflow"},
Meta: &atypes.FunctionMeta{
Short: "Unarchives the role",
Short: "Role unarchive",
},
Parameters: []*atypes.Param{
+10 -9
View File
@@ -67,7 +67,8 @@ labels: &labels
functions:
lookup:
meta:
short: Looks-up for role by ID
short: Role lookup
description: Find specific role by ID or handle
labels:
<<: *labels
params:
@@ -77,7 +78,7 @@ functions:
search:
meta:
short: Searches for roles and returns them
short: Roles search
labels:
<<: *labels
params: *filterParams
@@ -91,7 +92,7 @@ functions:
each:
kind: iterator
meta:
short: Searches for roles and iterates over results
short: Roles
params: *filterParams
results:
role: *rvRole
@@ -99,7 +100,7 @@ functions:
create:
meta:
short: Creates new role
short: Role creator
labels:
<<: *labels
create: "step"
@@ -112,7 +113,7 @@ functions:
update:
meta:
short: Updates exiting role
short: Role update
labels:
<<: *labels
update: "step"
@@ -125,7 +126,7 @@ functions:
delete:
meta:
short: Deletes the role
short: Role delete
labels:
<<: *labels
delete: "step"
@@ -134,7 +135,7 @@ functions:
recover:
meta:
short: Recovers deleted role
short: Role recover
labels:
<<: *labels
recover: "step"
@@ -143,7 +144,7 @@ functions:
archive:
meta:
short: Archives the role
short: Role archive
labels:
<<: *labels
archive: "step"
@@ -152,7 +153,7 @@ functions:
unarchive:
meta:
short: Unarchives the role
short: Role unarchive
labels:
<<: *labels
unarchive: "step"
+17 -16
View File
@@ -56,7 +56,7 @@ func (a templatesLookupArgs) GetLookup() (bool, uint64, string, *types.Template)
return a.hasLookup, a.lookupID, a.lookupHandle, a.lookupRes
}
// Lookup function Looks-up for template by ID
// Lookup function Template lookup
//
// expects implementation of lookup function:
// func (h templatesHandler) lookup(ctx context.Context, args *templatesLookupArgs) (results *templatesLookupResults, err error) {
@@ -68,7 +68,8 @@ func (h templatesHandler) Lookup() *atypes.Function {
Kind: "function",
Labels: map[string]string{"templates": "step,workflow"},
Meta: &atypes.FunctionMeta{
Short: "Looks-up for template by ID",
Short: "Template lookup",
Description: "Find specific template by ID or handle",
},
Parameters: []*atypes.Param{
@@ -175,7 +176,7 @@ type (
}
)
// Search function Searches for templates and returns them
// Search function Templates search
//
// expects implementation of search function:
// func (h templatesHandler) search(ctx context.Context, args *templatesSearchArgs) (results *templatesSearchResults, err error) {
@@ -187,7 +188,7 @@ func (h templatesHandler) Search() *atypes.Function {
Kind: "function",
Labels: map[string]string{"templates": "step,workflow"},
Meta: &atypes.FunctionMeta{
Short: "Searches for templates and returns them",
Short: "Templates search",
},
Parameters: []*atypes.Param{
@@ -369,7 +370,7 @@ type (
}
)
// Each function Searches for templates and iterates over results
// Each function Tempates
//
// expects implementation of each function:
// func (h templatesHandler) each(ctx context.Context, args *templatesEachArgs) (results *templatesEachResults, err error) {
@@ -381,7 +382,7 @@ func (h templatesHandler) Each() *atypes.Function {
Kind: "iterator",
Labels: map[string]string{"templates": "step,workflow"},
Meta: &atypes.FunctionMeta{
Short: "Searches for templates and iterates over results",
Short: "Tempates",
},
Parameters: []*atypes.Param{
@@ -476,7 +477,7 @@ type (
}
)
// Create function Creates new template
// Create function Template create
//
// expects implementation of create function:
// func (h templatesHandler) create(ctx context.Context, args *templatesCreateArgs) (results *templatesCreateResults, err error) {
@@ -488,7 +489,7 @@ func (h templatesHandler) Create() *atypes.Function {
Kind: "function",
Labels: map[string]string{"templates": "step,workflow"},
Meta: &atypes.FunctionMeta{
Short: "Creates new template",
Short: "Template create",
},
Parameters: []*atypes.Param{
@@ -553,7 +554,7 @@ type (
}
)
// Update function Updates exiting template
// Update function Template update
//
// expects implementation of update function:
// func (h templatesHandler) update(ctx context.Context, args *templatesUpdateArgs) (results *templatesUpdateResults, err error) {
@@ -565,7 +566,7 @@ func (h templatesHandler) Update() *atypes.Function {
Kind: "function",
Labels: map[string]string{"templates": "step,workflow"},
Meta: &atypes.FunctionMeta{
Short: "Updates exiting template",
Short: "Template update",
},
Parameters: []*atypes.Param{
@@ -633,7 +634,7 @@ func (a templatesDeleteArgs) GetLookup() (bool, uint64, string, *types.Template)
return a.hasLookup, a.lookupID, a.lookupHandle, a.lookupRes
}
// Delete function Deletes template
// Delete function Template delete
//
// expects implementation of delete function:
// func (h templatesHandler) delete(ctx context.Context, args *templatesDeleteArgs) (err error) {
@@ -645,7 +646,7 @@ func (h templatesHandler) Delete() *atypes.Function {
Kind: "function",
Labels: map[string]string{"delete": "step", "templates": "step,workflow"},
Meta: &atypes.FunctionMeta{
Short: "Deletes template",
Short: "Template delete",
},
Parameters: []*atypes.Param{
@@ -698,7 +699,7 @@ func (a templatesRecoverArgs) GetLookup() (bool, uint64, string, *types.Template
return a.hasLookup, a.lookupID, a.lookupHandle, a.lookupRes
}
// Recover function Recovers deleted template
// Recover function Template recover
//
// expects implementation of recover function:
// func (h templatesHandler) recover(ctx context.Context, args *templatesRecoverArgs) (err error) {
@@ -710,7 +711,7 @@ func (h templatesHandler) Recover() *atypes.Function {
Kind: "function",
Labels: map[string]string{"recover": "step", "templates": "step,workflow"},
Meta: &atypes.FunctionMeta{
Short: "Recovers deleted template",
Short: "Template recover",
},
Parameters: []*atypes.Param{
@@ -779,7 +780,7 @@ func (a templatesRenderArgs) GetLookup() (bool, uint64, string, *types.Template)
return a.hasLookup, a.lookupID, a.lookupHandle, a.lookupRes
}
// Render function Renders a document from template
// Render function Render template
//
// expects implementation of render function:
// func (h templatesHandler) render(ctx context.Context, args *templatesRenderArgs) (results *templatesRenderResults, err error) {
@@ -791,7 +792,7 @@ func (h templatesHandler) Render() *atypes.Function {
Kind: "function",
Labels: map[string]string{"render": "step", "templates": "step,workflow"},
Meta: &atypes.FunctionMeta{
Short: "Renders a document from template",
Short: "Render template",
},
Parameters: []*atypes.Param{
+9 -8
View File
@@ -63,7 +63,8 @@ labels: &labels
functions:
lookup:
meta:
short: Looks-up for template by ID
short: Template lookup
description: Find specific template by ID or handle
params:
lookup: *lookup
labels:
@@ -73,7 +74,7 @@ functions:
search:
meta:
short: Searches for templates and returns them
short: Templates search
params: *filterParams
labels:
<<: *labels
@@ -87,7 +88,7 @@ functions:
each:
kind: iterator
meta:
short: Searches for templates and iterates over results
short: Tempates
params: *filterParams
labels:
<<: *labels
@@ -97,7 +98,7 @@ functions:
create:
meta:
short: Creates new template
short: Template create
labels:
<<: *labels
params:
@@ -109,7 +110,7 @@ functions:
update:
meta:
short: Updates exiting template
short: Template update
labels:
<<: *labels
params:
@@ -124,13 +125,13 @@ functions:
<<: *labels
delete: "step"
meta:
short: Deletes template
short: Template delete
params:
lookup: *lookup
recover:
meta:
short: Recovers deleted template
short: Template recover
labels:
<<: *labels
recover: "step"
@@ -139,7 +140,7 @@ functions:
render:
meta:
short: Renders a document from template
short: Render template
labels:
<<: *labels
render: "step"
+19 -18
View File
@@ -58,7 +58,7 @@ func (a usersLookupArgs) GetLookup() (bool, uint64, string, string, *types.User)
return a.hasLookup, a.lookupID, a.lookupHandle, a.lookupEmail, a.lookupRes
}
// Lookup function Looks-up for user by ID
// Lookup function User lookup
//
// expects implementation of lookup function:
// func (h usersHandler) lookup(ctx context.Context, args *usersLookupArgs) (results *usersLookupResults, err error) {
@@ -70,7 +70,8 @@ func (h usersHandler) Lookup() *atypes.Function {
Kind: "function",
Labels: map[string]string{"users": "step,workflow"},
Meta: &atypes.FunctionMeta{
Short: "Looks-up for user by ID",
Short: "User lookup",
Description: "Find specific user by ID, handle or string",
},
Parameters: []*atypes.Param{
@@ -182,7 +183,7 @@ type (
}
)
// Search function Searches for users and returns them
// Search function User search
//
// expects implementation of search function:
// func (h usersHandler) search(ctx context.Context, args *usersSearchArgs) (results *usersSearchResults, err error) {
@@ -194,7 +195,7 @@ func (h usersHandler) Search() *atypes.Function {
Kind: "function",
Labels: map[string]string{"users": "step,workflow"},
Meta: &atypes.FunctionMeta{
Short: "Searches for users and returns them",
Short: "User search",
},
Parameters: []*atypes.Param{
@@ -384,7 +385,7 @@ type (
}
)
// Each function Searches for users and iterates over results
// Each function Users
//
// expects implementation of each function:
// func (h usersHandler) each(ctx context.Context, args *usersEachArgs) (results *usersEachResults, err error) {
@@ -396,7 +397,7 @@ func (h usersHandler) Each() *atypes.Function {
Kind: "iterator",
Labels: map[string]string{"users": "step,workflow"},
Meta: &atypes.FunctionMeta{
Short: "Searches for users and iterates over results",
Short: "Users",
},
Parameters: []*atypes.Param{
@@ -496,7 +497,7 @@ type (
}
)
// Create function Creates new user
// Create function User create
//
// expects implementation of create function:
// func (h usersHandler) create(ctx context.Context, args *usersCreateArgs) (results *usersCreateResults, err error) {
@@ -508,7 +509,7 @@ func (h usersHandler) Create() *atypes.Function {
Kind: "function",
Labels: map[string]string{"users": "step,workflow"},
Meta: &atypes.FunctionMeta{
Short: "Creates new user",
Short: "User create",
},
Parameters: []*atypes.Param{
@@ -573,7 +574,7 @@ type (
}
)
// Update function Updates exiting user
// Update function User update
//
// expects implementation of update function:
// func (h usersHandler) update(ctx context.Context, args *usersUpdateArgs) (results *usersUpdateResults, err error) {
@@ -585,7 +586,7 @@ func (h usersHandler) Update() *atypes.Function {
Kind: "function",
Labels: map[string]string{"users": "step,workflow"},
Meta: &atypes.FunctionMeta{
Short: "Updates exiting user",
Short: "User update",
},
Parameters: []*atypes.Param{
@@ -654,7 +655,7 @@ func (a usersDeleteArgs) GetLookup() (bool, uint64, string, string, *types.User)
return a.hasLookup, a.lookupID, a.lookupHandle, a.lookupEmail, a.lookupRes
}
// Delete function Deletes user
// Delete function User delete
//
// expects implementation of delete function:
// func (h usersHandler) delete(ctx context.Context, args *usersDeleteArgs) (err error) {
@@ -666,7 +667,7 @@ func (h usersHandler) Delete() *atypes.Function {
Kind: "function",
Labels: map[string]string{"delete": "step", "users": "step,workflow"},
Meta: &atypes.FunctionMeta{
Short: "Deletes user",
Short: "User delete",
},
Parameters: []*atypes.Param{
@@ -722,7 +723,7 @@ func (a usersRecoverArgs) GetLookup() (bool, uint64, string, string, *types.User
return a.hasLookup, a.lookupID, a.lookupHandle, a.lookupEmail, a.lookupRes
}
// Recover function Recovers deleted user
// Recover function User recover
//
// expects implementation of recover function:
// func (h usersHandler) recover(ctx context.Context, args *usersRecoverArgs) (err error) {
@@ -734,7 +735,7 @@ func (h usersHandler) Recover() *atypes.Function {
Kind: "function",
Labels: map[string]string{"recover": "step", "users": "step,workflow"},
Meta: &atypes.FunctionMeta{
Short: "Recovers deleted user",
Short: "User recover",
},
Parameters: []*atypes.Param{
@@ -790,7 +791,7 @@ func (a usersSuspendArgs) GetLookup() (bool, uint64, string, string, *types.User
return a.hasLookup, a.lookupID, a.lookupHandle, a.lookupEmail, a.lookupRes
}
// Suspend function Suspends user
// Suspend function User suspend
//
// expects implementation of suspend function:
// func (h usersHandler) suspend(ctx context.Context, args *usersSuspendArgs) (err error) {
@@ -802,7 +803,7 @@ func (h usersHandler) Suspend() *atypes.Function {
Kind: "function",
Labels: map[string]string{"suspend": "step", "users": "step,workflow"},
Meta: &atypes.FunctionMeta{
Short: "Suspends user",
Short: "User suspend",
},
Parameters: []*atypes.Param{
@@ -858,7 +859,7 @@ func (a usersUnsuspendArgs) GetLookup() (bool, uint64, string, string, *types.Us
return a.hasLookup, a.lookupID, a.lookupHandle, a.lookupEmail, a.lookupRes
}
// Unsuspend function Unsuspends user
// Unsuspend function User unsuspend
//
// expects implementation of unsuspend function:
// func (h usersHandler) unsuspend(ctx context.Context, args *usersUnsuspendArgs) (err error) {
@@ -870,7 +871,7 @@ func (h usersHandler) Unsuspend() *atypes.Function {
Kind: "function",
Labels: map[string]string{"unsuspend": "step", "users": "step,workflow"},
Meta: &atypes.FunctionMeta{
Short: "Unsuspends user",
Short: "User unsuspend",
},
Parameters: []*atypes.Param{
+10 -9
View File
@@ -64,7 +64,8 @@ labels: &labels
functions:
lookup:
meta:
short: Looks-up for user by ID
short: User lookup
description: Find specific user by ID, handle or string
params:
lookup: *lookup
labels:
@@ -74,7 +75,7 @@ functions:
search:
meta:
short: Searches for users and returns them
short: User search
params: *filterParams
labels:
<<: *labels
@@ -88,7 +89,7 @@ functions:
each:
kind: iterator
meta:
short: Searches for users and iterates over results
short: Users
params: *filterParams
labels:
<<: *labels
@@ -98,7 +99,7 @@ functions:
create:
meta:
short: Creates new user
short: User create
labels:
<<: *labels
params:
@@ -110,7 +111,7 @@ functions:
update:
meta:
short: Updates exiting user
short: User update
labels:
<<: *labels
params:
@@ -125,7 +126,7 @@ functions:
<<: *labels
delete: "step"
meta:
short: Deletes user
short: User delete
params:
lookup: *lookup
@@ -134,7 +135,7 @@ functions:
<<: *labels
recover: "step"
meta:
short: Recovers deleted user
short: User recover
params:
lookup: *lookup
@@ -143,7 +144,7 @@ functions:
<<: *labels
suspend: "step"
meta:
short: Suspends user
short: User suspend
params:
lookup: *lookup
@@ -152,6 +153,6 @@ functions:
<<: *labels
unsuspend: "step"
meta:
short: Unsuspends user
short: User unsuspend
params:
lookup: *lookup