Fixed latest/oldest record fetch automation function
This commit is contained in:
parent
2873e0123e
commit
7b29b80163
82
server/compose/automation/records_handler.gen.go
generated
82
server/compose/automation/records_handler.gen.go
generated
@ -10,6 +10,7 @@ package automation
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
atypes "github.com/cortezaproject/corteza/server/automation/types"
|
||||
"github.com/cortezaproject/corteza/server/compose/types"
|
||||
"github.com/cortezaproject/corteza/server/pkg/expr"
|
||||
@ -81,9 +82,10 @@ func (a recordsLookupArgs) GetRecord() (bool, uint64, *types.Record) {
|
||||
// Lookup function Compose record lookup
|
||||
//
|
||||
// expects implementation of lookup function:
|
||||
// func (h recordsHandler) lookup(ctx context.Context, args *recordsLookupArgs) (results *recordsLookupResults, err error) {
|
||||
// return
|
||||
// }
|
||||
//
|
||||
// func (h recordsHandler) lookup(ctx context.Context, args *recordsLookupArgs) (results *recordsLookupResults, err error) {
|
||||
// return
|
||||
// }
|
||||
func (h recordsHandler) Lookup() *atypes.Function {
|
||||
return &atypes.Function{
|
||||
Ref: "composeRecordsLookup",
|
||||
@ -255,9 +257,10 @@ func (a recordsSearchArgs) GetNamespace() (bool, uint64, string, *types.Namespac
|
||||
// Search function Compose records search
|
||||
//
|
||||
// expects implementation of search function:
|
||||
// func (h recordsHandler) search(ctx context.Context, args *recordsSearchArgs) (results *recordsSearchResults, err error) {
|
||||
// return
|
||||
// }
|
||||
//
|
||||
// func (h recordsHandler) search(ctx context.Context, args *recordsSearchArgs) (results *recordsSearchResults, err error) {
|
||||
// return
|
||||
// }
|
||||
func (h recordsHandler) Search() *atypes.Function {
|
||||
return &atypes.Function{
|
||||
Ref: "composeRecordsSearch",
|
||||
@ -508,16 +511,17 @@ func (a recordsFirstArgs) GetNamespace() (bool, uint64, string, *types.Namespace
|
||||
// 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) {
|
||||
// return
|
||||
// }
|
||||
//
|
||||
// func (h recordsHandler) first(ctx context.Context, args *recordsFirstArgs) (results *recordsFirstResults, err error) {
|
||||
// return
|
||||
// }
|
||||
func (h recordsHandler) First() *atypes.Function {
|
||||
return &atypes.Function{
|
||||
Ref: "composeRecordsFirst",
|
||||
Kind: "function",
|
||||
Labels: map[string]string{"compose": "step,workflow", "record": "step,workflow"},
|
||||
Meta: &atypes.FunctionMeta{
|
||||
Short: "Compose record lookup (first created)",
|
||||
Short: "Compose record lookup (oldest)",
|
||||
},
|
||||
|
||||
Parameters: []*atypes.Param{
|
||||
@ -637,16 +641,17 @@ func (a recordsLastArgs) GetNamespace() (bool, uint64, string, *types.Namespace)
|
||||
// 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) {
|
||||
// return
|
||||
// }
|
||||
//
|
||||
// func (h recordsHandler) last(ctx context.Context, args *recordsLastArgs) (results *recordsLastResults, err error) {
|
||||
// return
|
||||
// }
|
||||
func (h recordsHandler) Last() *atypes.Function {
|
||||
return &atypes.Function{
|
||||
Ref: "composeRecordsLast",
|
||||
Kind: "function",
|
||||
Labels: map[string]string{"compose": "step,workflow", "record": "step,workflow"},
|
||||
Meta: &atypes.FunctionMeta{
|
||||
Short: "Compose record lookup (last created)",
|
||||
Short: "Compose record lookup (newest)",
|
||||
},
|
||||
|
||||
Parameters: []*atypes.Param{
|
||||
@ -792,9 +797,10 @@ func (a recordsEachArgs) GetNamespace() (bool, uint64, string, *types.Namespace)
|
||||
// Each function Compose records
|
||||
//
|
||||
// expects implementation of each function:
|
||||
// func (h recordsHandler) each(ctx context.Context, args *recordsEachArgs) (results *recordsEachResults, err error) {
|
||||
// return
|
||||
// }
|
||||
//
|
||||
// func (h recordsHandler) each(ctx context.Context, args *recordsEachArgs) (results *recordsEachResults, err error) {
|
||||
// return
|
||||
// }
|
||||
func (h recordsHandler) Each() *atypes.Function {
|
||||
return &atypes.Function{
|
||||
Ref: "composeRecordsEach",
|
||||
@ -959,9 +965,10 @@ func (a recordsNewArgs) GetNamespace() (bool, uint64, string, *types.Namespace)
|
||||
// New function Compose record maker
|
||||
//
|
||||
// expects implementation of new function:
|
||||
// func (h recordsHandler) new(ctx context.Context, args *recordsNewArgs) (results *recordsNewResults, err error) {
|
||||
// return
|
||||
// }
|
||||
//
|
||||
// func (h recordsHandler) new(ctx context.Context, args *recordsNewArgs) (results *recordsNewResults, err error) {
|
||||
// return
|
||||
// }
|
||||
func (h recordsHandler) New() *atypes.Function {
|
||||
return &atypes.Function{
|
||||
Ref: "composeRecordsNew",
|
||||
@ -1072,9 +1079,10 @@ type (
|
||||
// Validate function Compose record validator
|
||||
//
|
||||
// expects implementation of validate function:
|
||||
// func (h recordsHandler) validate(ctx context.Context, args *recordsValidateArgs) (results *recordsValidateResults, err error) {
|
||||
// return
|
||||
// }
|
||||
//
|
||||
// func (h recordsHandler) validate(ctx context.Context, args *recordsValidateArgs) (results *recordsValidateResults, err error) {
|
||||
// return
|
||||
// }
|
||||
func (h recordsHandler) Validate() *atypes.Function {
|
||||
return &atypes.Function{
|
||||
Ref: "composeRecordsValidate",
|
||||
@ -1152,9 +1160,10 @@ type (
|
||||
// Create function Compose record create
|
||||
//
|
||||
// expects implementation of create function:
|
||||
// func (h recordsHandler) create(ctx context.Context, args *recordsCreateArgs) (results *recordsCreateResults, err error) {
|
||||
// return
|
||||
// }
|
||||
//
|
||||
// func (h recordsHandler) create(ctx context.Context, args *recordsCreateArgs) (results *recordsCreateResults, err error) {
|
||||
// return
|
||||
// }
|
||||
func (h recordsHandler) Create() *atypes.Function {
|
||||
return &atypes.Function{
|
||||
Ref: "composeRecordsCreate",
|
||||
@ -1229,9 +1238,10 @@ type (
|
||||
// Update function Compose record update
|
||||
//
|
||||
// expects implementation of update function:
|
||||
// func (h recordsHandler) update(ctx context.Context, args *recordsUpdateArgs) (results *recordsUpdateResults, err error) {
|
||||
// return
|
||||
// }
|
||||
//
|
||||
// func (h recordsHandler) update(ctx context.Context, args *recordsUpdateArgs) (results *recordsUpdateResults, err error) {
|
||||
// return
|
||||
// }
|
||||
func (h recordsHandler) Update() *atypes.Function {
|
||||
return &atypes.Function{
|
||||
Ref: "composeRecordsUpdate",
|
||||
@ -1328,9 +1338,10 @@ func (a recordsDeleteArgs) GetRecord() (bool, uint64, *types.Record) {
|
||||
// Delete function Compose record delete
|
||||
//
|
||||
// expects implementation of delete function:
|
||||
// func (h recordsHandler) delete(ctx context.Context, args *recordsDeleteArgs) (err error) {
|
||||
// return
|
||||
// }
|
||||
//
|
||||
// func (h recordsHandler) delete(ctx context.Context, args *recordsDeleteArgs) (err error) {
|
||||
// return
|
||||
// }
|
||||
func (h recordsHandler) Delete() *atypes.Function {
|
||||
return &atypes.Function{
|
||||
Ref: "composeRecordsDelete",
|
||||
@ -1454,9 +1465,10 @@ func (a recordsReportArgs) GetNamespace() (bool, uint64, string, *types.Namespac
|
||||
// Report function Report
|
||||
//
|
||||
// expects implementation of report function:
|
||||
// func (h recordsHandler) report(ctx context.Context, args *recordsReportArgs) (results *recordsReportResults, err error) {
|
||||
// return
|
||||
// }
|
||||
//
|
||||
// func (h recordsHandler) report(ctx context.Context, args *recordsReportArgs) (results *recordsReportResults, err error) {
|
||||
// return
|
||||
// }
|
||||
func (h recordsHandler) Report() *atypes.Function {
|
||||
return &atypes.Function{
|
||||
Ref: "composeRecordsReport",
|
||||
|
||||
@ -358,9 +358,9 @@ func (h recordsHandler) fetchEdge(ctx context.Context, args interface{}, first b
|
||||
f := types.RecordFilter{}
|
||||
|
||||
if first {
|
||||
f.Sort.Set("createdAt DESC")
|
||||
} else {
|
||||
f.Sort.Set("createdAt ASC")
|
||||
} else {
|
||||
f.Sort.Set("createdAt DESC")
|
||||
}
|
||||
|
||||
f.Limit = 1
|
||||
|
||||
@ -127,7 +127,7 @@ functions:
|
||||
|
||||
first:
|
||||
meta:
|
||||
short: Compose record lookup (first created)
|
||||
short: Compose record lookup (oldest)
|
||||
labels:
|
||||
<<: *labels
|
||||
params: *edgeParams
|
||||
@ -136,7 +136,7 @@ functions:
|
||||
|
||||
last:
|
||||
meta:
|
||||
short: Compose record lookup (last created)
|
||||
short: Compose record lookup (newest)
|
||||
labels:
|
||||
<<: *labels
|
||||
params: *edgeParams
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user