From d2aaa393ca5554abd4b5a6a88d81d63552a518ac Mon Sep 17 00:00:00 2001 From: Cedric Date: Mon, 10 Feb 2025 12:23:26 +0000 Subject: [PATCH] Move StepDependency to Inputs (#1026) --- .../readcontract/action_builders_generated.go | 3 ++- .../readcontract/readcontract_action-schema.json | 12 ++++++------ .../readcontract/readcontract_action_generated.go | 6 +++--- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/pkg/capabilities/actions/readcontract/action_builders_generated.go b/pkg/capabilities/actions/readcontract/action_builders_generated.go index 31582fe96..65b4b587a 100644 --- a/pkg/capabilities/actions/readcontract/action_builders_generated.go +++ b/pkg/capabilities/actions/readcontract/action_builders_generated.go @@ -17,7 +17,6 @@ func (cfg Config) New(w *sdk.WorkflowSpecFactory, id string, ref string, input A "ContractName": cfg.ContractName, "ContractReaderConfig": cfg.ContractReaderConfig, "ReadIdentifier": cfg.ReadIdentifier, - "StepDependency": cfg.StepDependency, }, CapabilityType: capabilities.CapabilityTypeAction, } @@ -79,6 +78,7 @@ func (c *simpleOutput) private() {} type ActionInput struct { ConfidenceLevel sdk.CapDefinition[string] Params sdk.CapDefinition[InputParams] + StepDependency sdk.CapDefinition[any] } func (input ActionInput) ToSteps() sdk.StepInputs { @@ -86,6 +86,7 @@ func (input ActionInput) ToSteps() sdk.StepInputs { Mapping: map[string]any{ "ConfidenceLevel": input.ConfidenceLevel.Ref(), "Params": input.Params.Ref(), + "StepDependency": input.StepDependency.Ref(), }, } } diff --git a/pkg/capabilities/actions/readcontract/readcontract_action-schema.json b/pkg/capabilities/actions/readcontract/readcontract_action-schema.json index 0411d3d57..472f16757 100644 --- a/pkg/capabilities/actions/readcontract/readcontract_action-schema.json +++ b/pkg/capabilities/actions/readcontract/readcontract_action-schema.json @@ -16,11 +16,7 @@ }, "ContractName": { "type": "string" - }, - "StepDependency": { - "type": "string", - "description": "an optional step reference that is a non-data dependency for the current step" - } + } }, "required": ["ContractReaderConfig", "ReadIdentifier", "ContractAddress", "ContractName"] }, @@ -33,7 +29,11 @@ "Params": { "type": "object", "additionalProperties": true - } + }, + "StepDependency": { + "type": ["object", "string", "boolean", "null", "array"], + "description": "an optional step reference that is a non-data dependency for the current step" + } }, "required": ["ConfidenceLevel", "Params"] }, diff --git a/pkg/capabilities/actions/readcontract/readcontract_action_generated.go b/pkg/capabilities/actions/readcontract/readcontract_action_generated.go index 3eea28d04..789534ed5 100644 --- a/pkg/capabilities/actions/readcontract/readcontract_action_generated.go +++ b/pkg/capabilities/actions/readcontract/readcontract_action_generated.go @@ -31,9 +31,6 @@ type Config struct { // ReadIdentifier corresponds to the JSON schema field "ReadIdentifier". ReadIdentifier string `json:"ReadIdentifier" yaml:"ReadIdentifier" mapstructure:"ReadIdentifier"` - - // an optional step reference that is a non-data dependency for the current step - StepDependency *string `json:"StepDependency,omitempty" yaml:"StepDependency,omitempty" mapstructure:"StepDependency,omitempty"` } // UnmarshalJSON implements json.Unmarshaler. @@ -69,6 +66,9 @@ type Input struct { // Params corresponds to the JSON schema field "Params". Params InputParams `json:"Params" yaml:"Params" mapstructure:"Params"` + + // an optional step reference that is a non-data dependency for the current step + StepDependency interface{} `json:"StepDependency,omitempty" yaml:"StepDependency,omitempty" mapstructure:"StepDependency,omitempty"` } type InputParams map[string]interface{}