From 06ed2976024b31678464ab518a1263eee08421ca Mon Sep 17 00:00:00 2001 From: Colt McNealy Date: Mon, 25 Nov 2024 21:46:44 -0800 Subject: [PATCH 1/3] refactor(server): standardize on variableassignment for mutations (#1164) - Deprecates the literal_value and node_output options of VariableMutation.rhs_value - Updates sdk-java to only use the VariableAssignment field - Renames VariableMutation.source_variable to VariableMutation.rhs_assignment Co-authored-by: Hazim Arafa --- .../(diagram)/components/Modals/Edge.tsx | 10 +- docs/docs/08-api.md | 6 +- docs/static/img/protobuf-docs.html | 4 +- schemas/littlehorse/common_wfspec.proto | 16 +- sdk-go/lhproto/common_wfspec.pb.go | 299 +++++++++--------- sdk-go/littlehorse/wf_lib_internal.go | 8 +- .../sdk/common/proto/CommonWfspec.java | 98 +++--- .../sdk/common/proto/VariableMutation.java | 228 ++++++------- .../proto/VariableMutationOrBuilder.java | 43 +-- .../sdk/wfsdk/internal/BuilderUtil.java | 4 + .../wfsdk/internal/WorkflowThreadImpl.java | 48 +-- .../sdk/wfsdk/internal/ConditionalTest.java | 1 + .../internal/WorkflowThreadImplTest.java | 103 ++++++ sdk-js/src/proto/common_wfspec.ts | 29 +- sdk-python/littlehorse/model/__init__.py | 2 +- .../littlehorse/model/common_wfspec_pb2.py | 48 +-- .../littlehorse/model/common_wfspec_pb2.pyi | 8 +- sdk-python/littlehorse/workflow.py | 6 +- .../getable/core/wfrun/ThreadRunModel.java | 2 +- .../variable/VariableMutationModel.java | 18 +- server/src/test/java/e2e/BasicTest.java | 4 +- 21 files changed, 537 insertions(+), 448 deletions(-) diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/Modals/Edge.tsx b/dashboard/src/app/(authenticated)/(diagram)/components/Modals/Edge.tsx index ff672f238..c087098ca 100644 --- a/dashboard/src/app/(authenticated)/(diagram)/components/Modals/Edge.tsx +++ b/dashboard/src/app/(authenticated)/(diagram)/components/Modals/Edge.tsx @@ -21,7 +21,7 @@ export const Edge: FC = ({ data }) => { {mutation.operation} - + ))} @@ -41,12 +41,12 @@ const NodeOutput: FC> = ({ nodeOutput }) => ) } -const SourceVariable: FC> = ({ sourceVariable }) => { - if (!sourceVariable) return <> +const RhsAssignment: FC> = ({ rhsAssignment }) => { + if (!rhsAssignment) return <> return ( <> - Source Variable - {getVariable(sourceVariable)} + RHS Assignment + {getVariable(rhsAssignment)} ) } diff --git a/docs/docs/08-api.md b/docs/docs/08-api.md index fc79749fa..8170029e3 100644 --- a/docs/docs/08-api.md +++ b/docs/docs/08-api.md @@ -858,9 +858,9 @@ they are writing their own WfSpec SDK. | `lhs_name` | | string | The name of the variable to mutate | | `lhs_json_path` | optional| string | For JSON_ARR and JSON_OBJ variables, this allows you to optionally mutate a specific sub-field of the variable. | | `operation` | | [VariableMutationType](#variablemutationtype) | Defines the operation that we are executing. | -| `source_variable` | oneof `rhs_value`| [VariableAssignment](#variableassignment) | Set the source_variable as the RHS to use another variable from the workflow to as the RHS/ | -| `literal_value` | oneof `rhs_value`| [VariableValue](#variablevalue) | Use a literal value as the RHS. | -| `node_output` | oneof `rhs_value`| [VariableMutation.NodeOutputSource](#variablemutationnodeoutputsource) | Use the output of the current node as the RHS. | +| `rhs_assignment` | oneof `rhs_value`| [VariableAssignment](#variableassignment) | Assigns the value to be used as the RHS of the mutation. | +| `literal_value` | oneof `rhs_value`| [VariableValue](#variablevalue) | Use a literal value as the RHS. DEPRECATED: use rhs_assignment.literal_value instead. | +| `node_output` | oneof `rhs_value`| [VariableMutation.NodeOutputSource](#variablemutationnodeoutputsource) | Use the output of the current node as the RHS. DEPRECATED: use rhs_assignment.node_output instead. | diff --git a/docs/static/img/protobuf-docs.html b/docs/static/img/protobuf-docs.html index c95aeee38..cf0d601c2 100644 --- a/docs/static/img/protobuf-docs.html +++ b/docs/static/img/protobuf-docs.html @@ -2307,10 +2307,10 @@

VariableMutation

- source_variable + rhs_assignment VariableAssignment -

Set the source_variable as the RHS to use another variable from the workflow to +

Set the rhs_assignment as the RHS to use another variable from the workflow to as the RHS/

diff --git a/schemas/littlehorse/common_wfspec.proto b/schemas/littlehorse/common_wfspec.proto index 4128e0618..153ff1f77 100644 --- a/schemas/littlehorse/common_wfspec.proto +++ b/schemas/littlehorse/common_wfspec.proto @@ -114,16 +114,20 @@ message VariableMutation { // Defines the operation that we are executing. VariableMutationType operation = 3; - // The RHS of the mutation; i.e. what is operated _with_. + // The RHS of the mutation; i.e. what is operated _with_. Note the values other + // than `rhs_assignment` are deprecated and will be removed in 2.0. + // + // As of 0.12.0, the SDK's only use rhs_assignment. oneof rhs_value { - // Set the source_variable as the RHS to use another variable from the workflow to - // as the RHS/ - VariableAssignment source_variable = 4; + // Assigns the value to be used as the RHS of the mutation. + VariableAssignment rhs_assignment = 4; - // Use a literal value as the RHS. + // Use a literal value as the RHS. DEPRECATED: use rhs_assignment.literal_value + // instead. VariableValue literal_value = 5; - // Use the output of the current node as the RHS. + // Use the output of the current node as the RHS. DEPRECATED: use + // rhs_assignment.node_output instead. NodeOutputSource node_output = 6; } } diff --git a/sdk-go/lhproto/common_wfspec.pb.go b/sdk-go/lhproto/common_wfspec.pb.go index d21722fb4..511cab212 100644 --- a/sdk-go/lhproto/common_wfspec.pb.go +++ b/sdk-go/lhproto/common_wfspec.pb.go @@ -397,10 +397,13 @@ type VariableMutation struct { LhsJsonPath *string `protobuf:"bytes,2,opt,name=lhs_json_path,json=lhsJsonPath,proto3,oneof" json:"lhs_json_path,omitempty"` // Defines the operation that we are executing. Operation VariableMutationType `protobuf:"varint,3,opt,name=operation,proto3,enum=littlehorse.VariableMutationType" json:"operation,omitempty"` - // The RHS of the mutation; i.e. what is operated _with_. + // The RHS of the mutation; i.e. what is operated _with_. Note the values other + // than `rhs_assignment` are deprecated and will be removed in 2.0. + // + // As of 0.12.0, the SDK's only use rhs_assignment. // // Types that are assignable to RhsValue: - // *VariableMutation_SourceVariable + // *VariableMutation_RhsAssignment // *VariableMutation_LiteralValue // *VariableMutation_NodeOutput RhsValue isVariableMutation_RhsValue `protobuf_oneof:"rhs_value"` @@ -466,9 +469,9 @@ func (m *VariableMutation) GetRhsValue() isVariableMutation_RhsValue { return nil } -func (x *VariableMutation) GetSourceVariable() *VariableAssignment { - if x, ok := x.GetRhsValue().(*VariableMutation_SourceVariable); ok { - return x.SourceVariable +func (x *VariableMutation) GetRhsAssignment() *VariableAssignment { + if x, ok := x.GetRhsValue().(*VariableMutation_RhsAssignment); ok { + return x.RhsAssignment } return nil } @@ -491,23 +494,24 @@ type isVariableMutation_RhsValue interface { isVariableMutation_RhsValue() } -type VariableMutation_SourceVariable struct { - // Set the source_variable as the RHS to use another variable from the workflow to - // as the RHS/ - SourceVariable *VariableAssignment `protobuf:"bytes,4,opt,name=source_variable,json=sourceVariable,proto3,oneof"` +type VariableMutation_RhsAssignment struct { + // Assigns the value to be used as the RHS of the mutation. + RhsAssignment *VariableAssignment `protobuf:"bytes,4,opt,name=rhs_assignment,json=rhsAssignment,proto3,oneof"` } type VariableMutation_LiteralValue struct { - // Use a literal value as the RHS. + // Use a literal value as the RHS. DEPRECATED: use rhs_assignment.literal_value + // instead. LiteralValue *VariableValue `protobuf:"bytes,5,opt,name=literal_value,json=literalValue,proto3,oneof"` } type VariableMutation_NodeOutput struct { - // Use the output of the current node as the RHS. + // Use the output of the current node as the RHS. DEPRECATED: use + // rhs_assignment.node_output instead. NodeOutput *VariableMutation_NodeOutputSource `protobuf:"bytes,6,opt,name=node_output,json=nodeOutput,proto3,oneof"` } -func (*VariableMutation_SourceVariable) isVariableMutation_RhsValue() {} +func (*VariableMutation_RhsAssignment) isVariableMutation_RhsValue() {} func (*VariableMutation_LiteralValue) isVariableMutation_RhsValue() {} @@ -1362,7 +1366,7 @@ var file_common_wfspec_proto_rawDesc = []byte{ 0x68, 0x6f, 0x72, 0x73, 0x65, 0x2e, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x03, 0x72, 0x68, 0x73, 0x42, 0x08, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, - 0x5f, 0x70, 0x61, 0x74, 0x68, 0x22, 0xda, 0x03, 0x0a, 0x10, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, + 0x5f, 0x70, 0x61, 0x74, 0x68, 0x22, 0xd8, 0x03, 0x0a, 0x10, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x68, 0x73, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6c, 0x68, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x27, 0x0a, 0x0d, 0x6c, 0x68, 0x73, 0x5f, 0x6a, 0x73, 0x6f, @@ -1372,142 +1376,141 @@ var file_common_wfspec_proto_rawDesc = []byte{ 0x0e, 0x32, 0x21, 0x2e, 0x6c, 0x69, 0x74, 0x74, 0x6c, 0x65, 0x68, 0x6f, 0x72, 0x73, 0x65, 0x2e, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x4a, 0x0a, 0x0f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x76, 0x61, 0x72, 0x69, 0x61, 0x62, - 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6c, 0x69, 0x74, 0x74, 0x6c, - 0x65, 0x68, 0x6f, 0x72, 0x73, 0x65, 0x2e, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x41, - 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x0e, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x41, 0x0a, 0x0d, 0x6c, - 0x69, 0x74, 0x65, 0x72, 0x61, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6c, 0x69, 0x74, 0x74, 0x6c, 0x65, 0x68, 0x6f, 0x72, 0x73, 0x65, - 0x2e, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, - 0x52, 0x0c, 0x6c, 0x69, 0x74, 0x65, 0x72, 0x61, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x51, - 0x0a, 0x0b, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x6c, 0x69, 0x74, 0x74, 0x6c, 0x65, 0x68, 0x6f, 0x72, 0x73, - 0x65, 0x2e, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x53, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x48, 0x00, 0x52, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x4f, 0x75, 0x74, 0x70, 0x75, - 0x74, 0x1a, 0x40, 0x0a, 0x10, 0x4e, 0x6f, 0x64, 0x65, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x53, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x08, 0x6a, 0x73, 0x6f, 0x6e, 0x70, 0x61, 0x74, - 0x68, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x6a, 0x73, 0x6f, 0x6e, 0x70, - 0x61, 0x74, 0x68, 0x88, 0x01, 0x01, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x70, - 0x61, 0x74, 0x68, 0x42, 0x0b, 0x0a, 0x09, 0x72, 0x68, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x6c, 0x68, 0x73, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x70, 0x61, - 0x74, 0x68, 0x22, 0xcb, 0x01, 0x0a, 0x0b, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x44, - 0x65, 0x66, 0x12, 0x2d, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x19, 0x2e, 0x6c, 0x69, 0x74, 0x74, 0x6c, 0x65, 0x68, 0x6f, 0x72, 0x73, 0x65, 0x2e, 0x56, - 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x44, 0x0a, 0x0d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, - 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6c, - 0x69, 0x74, 0x74, 0x6c, 0x65, 0x68, 0x6f, 0x72, 0x73, 0x65, 0x2e, 0x56, 0x61, 0x72, 0x69, 0x61, - 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0c, 0x64, 0x65, 0x66, 0x61, - 0x75, 0x6c, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x88, 0x01, 0x01, 0x12, 0x21, 0x0a, 0x0c, 0x6d, - 0x61, 0x73, 0x6b, 0x65, 0x64, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x0b, 0x6d, 0x61, 0x73, 0x6b, 0x65, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x10, - 0x0a, 0x0e, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x22, 0xbf, 0x05, 0x0a, 0x0f, 0x55, 0x54, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x72, 0x69, - 0x67, 0x67, 0x65, 0x72, 0x12, 0x3a, 0x0a, 0x04, 0x74, 0x61, 0x73, 0x6b, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x6c, 0x69, 0x74, 0x74, 0x6c, 0x65, 0x68, 0x6f, 0x72, 0x73, 0x65, - 0x2e, 0x55, 0x54, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, - 0x2e, 0x55, 0x54, 0x41, 0x54, 0x61, 0x73, 0x6b, 0x48, 0x00, 0x52, 0x04, 0x74, 0x61, 0x73, 0x6b, - 0x12, 0x40, 0x0a, 0x06, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x26, 0x2e, 0x6c, 0x69, 0x74, 0x74, 0x6c, 0x65, 0x68, 0x6f, 0x72, 0x73, 0x65, 0x2e, 0x55, + 0x48, 0x0a, 0x0e, 0x72, 0x68, 0x73, 0x5f, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, + 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6c, 0x69, 0x74, 0x74, 0x6c, 0x65, + 0x68, 0x6f, 0x72, 0x73, 0x65, 0x2e, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x73, + 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x0d, 0x72, 0x68, 0x73, 0x41, + 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x41, 0x0a, 0x0d, 0x6c, 0x69, 0x74, + 0x65, 0x72, 0x61, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x6c, 0x69, 0x74, 0x74, 0x6c, 0x65, 0x68, 0x6f, 0x72, 0x73, 0x65, 0x2e, 0x56, + 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0c, + 0x6c, 0x69, 0x74, 0x65, 0x72, 0x61, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x51, 0x0a, 0x0b, + 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x2e, 0x2e, 0x6c, 0x69, 0x74, 0x74, 0x6c, 0x65, 0x68, 0x6f, 0x72, 0x73, 0x65, 0x2e, + 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x53, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x48, 0x00, 0x52, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x1a, + 0x40, 0x0a, 0x10, 0x4e, 0x6f, 0x64, 0x65, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x53, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x08, 0x6a, 0x73, 0x6f, 0x6e, 0x70, 0x61, 0x74, 0x68, 0x18, + 0x0a, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x6a, 0x73, 0x6f, 0x6e, 0x70, 0x61, 0x74, + 0x68, 0x88, 0x01, 0x01, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x70, 0x61, 0x74, + 0x68, 0x42, 0x0b, 0x0a, 0x09, 0x72, 0x68, 0x73, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x10, + 0x0a, 0x0e, 0x5f, 0x6c, 0x68, 0x73, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x74, 0x68, + 0x22, 0xcb, 0x01, 0x0a, 0x0b, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x65, 0x66, + 0x12, 0x2d, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, + 0x2e, 0x6c, 0x69, 0x74, 0x74, 0x6c, 0x65, 0x68, 0x6f, 0x72, 0x73, 0x65, 0x2e, 0x56, 0x61, 0x72, + 0x69, 0x61, 0x62, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x44, 0x0a, 0x0d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6c, 0x69, 0x74, + 0x74, 0x6c, 0x65, 0x68, 0x6f, 0x72, 0x73, 0x65, 0x2e, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, + 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0c, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, + 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x88, 0x01, 0x01, 0x12, 0x21, 0x0a, 0x0c, 0x6d, 0x61, 0x73, + 0x6b, 0x65, 0x64, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x0b, 0x6d, 0x61, 0x73, 0x6b, 0x65, 0x64, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x10, 0x0a, 0x0e, + 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xbf, + 0x05, 0x0a, 0x0f, 0x55, 0x54, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x72, 0x69, 0x67, 0x67, + 0x65, 0x72, 0x12, 0x3a, 0x0a, 0x04, 0x74, 0x61, 0x73, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x24, 0x2e, 0x6c, 0x69, 0x74, 0x74, 0x6c, 0x65, 0x68, 0x6f, 0x72, 0x73, 0x65, 0x2e, 0x55, 0x54, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x2e, 0x55, - 0x54, 0x41, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x48, 0x00, 0x52, 0x06, 0x63, 0x61, 0x6e, 0x63, - 0x65, 0x6c, 0x12, 0x46, 0x0a, 0x08, 0x72, 0x65, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6c, 0x69, 0x74, 0x74, 0x6c, 0x65, 0x68, 0x6f, 0x72, - 0x73, 0x65, 0x2e, 0x55, 0x54, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x72, 0x69, 0x67, 0x67, - 0x65, 0x72, 0x2e, 0x55, 0x54, 0x41, 0x52, 0x65, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x48, 0x00, - 0x52, 0x08, 0x72, 0x65, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x12, 0x44, 0x0a, 0x0d, 0x64, 0x65, - 0x6c, 0x61, 0x79, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1f, 0x2e, 0x6c, 0x69, 0x74, 0x74, 0x6c, 0x65, 0x68, 0x6f, 0x72, 0x73, 0x65, 0x2e, - 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, - 0x6e, 0x74, 0x52, 0x0c, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, - 0x12, 0x37, 0x0a, 0x04, 0x68, 0x6f, 0x6f, 0x6b, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, + 0x54, 0x41, 0x54, 0x61, 0x73, 0x6b, 0x48, 0x00, 0x52, 0x04, 0x74, 0x61, 0x73, 0x6b, 0x12, 0x40, + 0x0a, 0x06, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x6c, 0x69, 0x74, 0x74, 0x6c, 0x65, 0x68, 0x6f, 0x72, 0x73, 0x65, 0x2e, 0x55, 0x54, 0x41, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x2e, 0x55, 0x54, 0x48, - 0x6f, 0x6f, 0x6b, 0x52, 0x04, 0x68, 0x6f, 0x6f, 0x6b, 0x1a, 0x0b, 0x0a, 0x09, 0x55, 0x54, 0x41, - 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x1a, 0x71, 0x0a, 0x07, 0x55, 0x54, 0x41, 0x54, 0x61, 0x73, - 0x6b, 0x12, 0x29, 0x0a, 0x04, 0x74, 0x61, 0x73, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x15, 0x2e, 0x6c, 0x69, 0x74, 0x74, 0x6c, 0x65, 0x68, 0x6f, 0x72, 0x73, 0x65, 0x2e, 0x54, 0x61, - 0x73, 0x6b, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x74, 0x61, 0x73, 0x6b, 0x12, 0x3b, 0x0a, 0x09, - 0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x1d, 0x2e, 0x6c, 0x69, 0x74, 0x74, 0x6c, 0x65, 0x68, 0x6f, 0x72, 0x73, 0x65, 0x2e, 0x56, 0x61, - 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, - 0x6d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0xac, 0x01, 0x0a, 0x0b, 0x55, 0x54, - 0x41, 0x52, 0x65, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x12, 0x3d, 0x0a, 0x07, 0x75, 0x73, 0x65, - 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6c, 0x69, 0x74, - 0x74, 0x6c, 0x65, 0x68, 0x6f, 0x72, 0x73, 0x65, 0x2e, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, - 0x65, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x06, 0x75, - 0x73, 0x65, 0x72, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x43, 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, - 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6c, - 0x69, 0x74, 0x74, 0x6c, 0x65, 0x68, 0x6f, 0x72, 0x73, 0x65, 0x2e, 0x56, 0x61, 0x72, 0x69, 0x61, - 0x62, 0x6c, 0x65, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x48, 0x01, 0x52, - 0x09, 0x75, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x88, 0x01, 0x01, 0x42, 0x0a, 0x0a, - 0x08, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x75, 0x73, - 0x65, 0x72, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x22, 0x2e, 0x0a, 0x06, 0x55, 0x54, 0x48, 0x6f, - 0x6f, 0x6b, 0x12, 0x0e, 0x0a, 0x0a, 0x4f, 0x4e, 0x5f, 0x41, 0x52, 0x52, 0x49, 0x56, 0x41, 0x4c, - 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x4f, 0x4e, 0x5f, 0x54, 0x41, 0x53, 0x4b, 0x5f, 0x41, 0x53, - 0x53, 0x49, 0x47, 0x4e, 0x45, 0x44, 0x10, 0x01, 0x42, 0x08, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x22, 0x8b, 0x01, 0x0a, 0x1d, 0x45, 0x78, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x69, - 0x61, 0x6c, 0x42, 0x61, 0x63, 0x6b, 0x6f, 0x66, 0x66, 0x52, 0x65, 0x74, 0x72, 0x79, 0x50, 0x6f, - 0x6c, 0x69, 0x63, 0x79, 0x12, 0x28, 0x0a, 0x10, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x76, 0x61, 0x6c, 0x5f, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, - 0x62, 0x61, 0x73, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x4d, 0x73, 0x12, 0x20, - 0x0a, 0x0c, 0x6d, 0x61, 0x78, 0x5f, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x5f, 0x6d, 0x73, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x6d, 0x61, 0x78, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x4d, 0x73, - 0x12, 0x1e, 0x0a, 0x0a, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x02, 0x52, 0x0a, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x69, 0x65, 0x72, - 0x22, 0x99, 0x03, 0x0a, 0x08, 0x54, 0x61, 0x73, 0x6b, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x38, 0x0a, - 0x0b, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x64, 0x65, 0x66, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6c, 0x69, 0x74, 0x74, 0x6c, 0x65, 0x68, 0x6f, 0x72, 0x73, 0x65, - 0x2e, 0x54, 0x61, 0x73, 0x6b, 0x44, 0x65, 0x66, 0x49, 0x64, 0x48, 0x00, 0x52, 0x09, 0x74, 0x61, - 0x73, 0x6b, 0x44, 0x65, 0x66, 0x49, 0x64, 0x12, 0x44, 0x0a, 0x0c, 0x64, 0x79, 0x6e, 0x61, 0x6d, - 0x69, 0x63, 0x5f, 0x74, 0x61, 0x73, 0x6b, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x2e, 0x55, 0x54, 0x41, + 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x48, 0x00, 0x52, 0x06, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, + 0x12, 0x46, 0x0a, 0x08, 0x72, 0x65, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6c, 0x69, 0x74, 0x74, 0x6c, 0x65, 0x68, 0x6f, 0x72, 0x73, 0x65, + 0x2e, 0x55, 0x54, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, + 0x2e, 0x55, 0x54, 0x41, 0x52, 0x65, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x48, 0x00, 0x52, 0x08, + 0x72, 0x65, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x12, 0x44, 0x0a, 0x0d, 0x64, 0x65, 0x6c, 0x61, + 0x79, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1f, 0x2e, 0x6c, 0x69, 0x74, 0x74, 0x6c, 0x65, 0x68, 0x6f, 0x72, 0x73, 0x65, 0x2e, 0x56, 0x61, + 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, + 0x52, 0x0c, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x37, + 0x0a, 0x04, 0x68, 0x6f, 0x6f, 0x6b, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x6c, + 0x69, 0x74, 0x74, 0x6c, 0x65, 0x68, 0x6f, 0x72, 0x73, 0x65, 0x2e, 0x55, 0x54, 0x41, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x2e, 0x55, 0x54, 0x48, 0x6f, 0x6f, + 0x6b, 0x52, 0x04, 0x68, 0x6f, 0x6f, 0x6b, 0x1a, 0x0b, 0x0a, 0x09, 0x55, 0x54, 0x41, 0x43, 0x61, + 0x6e, 0x63, 0x65, 0x6c, 0x1a, 0x71, 0x0a, 0x07, 0x55, 0x54, 0x41, 0x54, 0x61, 0x73, 0x6b, 0x12, + 0x29, 0x0a, 0x04, 0x74, 0x61, 0x73, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, + 0x6c, 0x69, 0x74, 0x74, 0x6c, 0x65, 0x68, 0x6f, 0x72, 0x73, 0x65, 0x2e, 0x54, 0x61, 0x73, 0x6b, + 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x74, 0x61, 0x73, 0x6b, 0x12, 0x3b, 0x0a, 0x09, 0x6d, 0x75, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6c, 0x69, 0x74, 0x74, 0x6c, 0x65, 0x68, 0x6f, 0x72, 0x73, 0x65, 0x2e, 0x56, 0x61, 0x72, 0x69, - 0x61, 0x62, 0x6c, 0x65, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x48, 0x00, - 0x52, 0x0b, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x27, 0x0a, - 0x0f, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x53, - 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x74, 0x72, 0x69, 0x65, - 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x65, 0x74, 0x72, 0x69, 0x65, 0x73, - 0x12, 0x60, 0x0a, 0x13, 0x65, 0x78, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x5f, - 0x62, 0x61, 0x63, 0x6b, 0x6f, 0x66, 0x66, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, - 0x6c, 0x69, 0x74, 0x74, 0x6c, 0x65, 0x68, 0x6f, 0x72, 0x73, 0x65, 0x2e, 0x45, 0x78, 0x70, 0x6f, - 0x6e, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x42, 0x61, 0x63, 0x6b, 0x6f, 0x66, 0x66, 0x52, 0x65, - 0x74, 0x72, 0x79, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x48, 0x01, 0x52, 0x12, 0x65, 0x78, 0x70, - 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x42, 0x61, 0x63, 0x6b, 0x6f, 0x66, 0x66, 0x88, - 0x01, 0x01, 0x12, 0x3d, 0x0a, 0x09, 0x76, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x18, - 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6c, 0x69, 0x74, 0x74, 0x6c, 0x65, 0x68, 0x6f, - 0x72, 0x73, 0x65, 0x2e, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x73, 0x73, 0x69, - 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x09, 0x76, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, - 0x73, 0x42, 0x11, 0x0a, 0x0f, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x74, 0x6f, 0x5f, 0x65, 0x78, 0x65, - 0x63, 0x75, 0x74, 0x65, 0x42, 0x16, 0x0a, 0x14, 0x5f, 0x65, 0x78, 0x70, 0x6f, 0x6e, 0x65, 0x6e, - 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x6f, 0x66, 0x66, 0x2a, 0x98, 0x01, 0x0a, - 0x14, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x53, 0x53, 0x49, 0x47, 0x4e, 0x10, - 0x00, 0x12, 0x07, 0x0a, 0x03, 0x41, 0x44, 0x44, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x45, 0x58, - 0x54, 0x45, 0x4e, 0x44, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x55, 0x42, 0x54, 0x52, 0x41, - 0x43, 0x54, 0x10, 0x03, 0x12, 0x0c, 0x0a, 0x08, 0x4d, 0x55, 0x4c, 0x54, 0x49, 0x50, 0x4c, 0x59, - 0x10, 0x04, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x49, 0x56, 0x49, 0x44, 0x45, 0x10, 0x05, 0x12, 0x15, - 0x0a, 0x11, 0x52, 0x45, 0x4d, 0x4f, 0x56, 0x45, 0x5f, 0x49, 0x46, 0x5f, 0x50, 0x52, 0x45, 0x53, - 0x45, 0x4e, 0x54, 0x10, 0x06, 0x12, 0x10, 0x0a, 0x0c, 0x52, 0x45, 0x4d, 0x4f, 0x56, 0x45, 0x5f, - 0x49, 0x4e, 0x44, 0x45, 0x58, 0x10, 0x07, 0x12, 0x0e, 0x0a, 0x0a, 0x52, 0x45, 0x4d, 0x4f, 0x56, - 0x45, 0x5f, 0x4b, 0x45, 0x59, 0x10, 0x08, 0x2a, 0x84, 0x01, 0x0a, 0x0a, 0x43, 0x6f, 0x6d, 0x70, - 0x61, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x0d, 0x0a, 0x09, 0x4c, 0x45, 0x53, 0x53, 0x5f, 0x54, - 0x48, 0x41, 0x4e, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x47, 0x52, 0x45, 0x41, 0x54, 0x45, 0x52, - 0x5f, 0x54, 0x48, 0x41, 0x4e, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x4c, 0x45, 0x53, 0x53, 0x5f, - 0x54, 0x48, 0x41, 0x4e, 0x5f, 0x45, 0x51, 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x47, 0x52, 0x45, - 0x41, 0x54, 0x45, 0x52, 0x5f, 0x54, 0x48, 0x41, 0x4e, 0x5f, 0x45, 0x51, 0x10, 0x03, 0x12, 0x0a, - 0x0a, 0x06, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x53, 0x10, 0x04, 0x12, 0x0e, 0x0a, 0x0a, 0x4e, 0x4f, - 0x54, 0x5f, 0x45, 0x51, 0x55, 0x41, 0x4c, 0x53, 0x10, 0x05, 0x12, 0x06, 0x0a, 0x02, 0x49, 0x4e, - 0x10, 0x06, 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x4f, 0x54, 0x5f, 0x49, 0x4e, 0x10, 0x07, 0x42, 0x49, - 0x0a, 0x1f, 0x69, 0x6f, 0x2e, 0x6c, 0x69, 0x74, 0x74, 0x6c, 0x65, 0x68, 0x6f, 0x72, 0x73, 0x65, - 0x2e, 0x73, 0x64, 0x6b, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x09, 0x2e, 0x3b, 0x6c, 0x68, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0xaa, 0x02, - 0x18, 0x4c, 0x69, 0x74, 0x74, 0x6c, 0x65, 0x48, 0x6f, 0x72, 0x73, 0x65, 0x2e, 0x43, 0x6f, 0x6d, - 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x61, 0x62, 0x6c, 0x65, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x6d, 0x75, + 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0xac, 0x01, 0x0a, 0x0b, 0x55, 0x54, 0x41, 0x52, + 0x65, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x12, 0x3d, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6c, 0x69, 0x74, 0x74, 0x6c, + 0x65, 0x68, 0x6f, 0x72, 0x73, 0x65, 0x2e, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x41, + 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x06, 0x75, 0x73, 0x65, + 0x72, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x43, 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x67, + 0x72, 0x6f, 0x75, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6c, 0x69, 0x74, + 0x74, 0x6c, 0x65, 0x68, 0x6f, 0x72, 0x73, 0x65, 0x2e, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, + 0x65, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x48, 0x01, 0x52, 0x09, 0x75, + 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x88, 0x01, 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, + 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x75, 0x73, 0x65, 0x72, + 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x22, 0x2e, 0x0a, 0x06, 0x55, 0x54, 0x48, 0x6f, 0x6f, 0x6b, + 0x12, 0x0e, 0x0a, 0x0a, 0x4f, 0x4e, 0x5f, 0x41, 0x52, 0x52, 0x49, 0x56, 0x41, 0x4c, 0x10, 0x00, + 0x12, 0x14, 0x0a, 0x10, 0x4f, 0x4e, 0x5f, 0x54, 0x41, 0x53, 0x4b, 0x5f, 0x41, 0x53, 0x53, 0x49, + 0x47, 0x4e, 0x45, 0x44, 0x10, 0x01, 0x42, 0x08, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x22, 0x8b, 0x01, 0x0a, 0x1d, 0x45, 0x78, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, + 0x42, 0x61, 0x63, 0x6b, 0x6f, 0x66, 0x66, 0x52, 0x65, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x6c, 0x69, + 0x63, 0x79, 0x12, 0x28, 0x0a, 0x10, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x69, 0x6e, 0x74, 0x65, 0x72, + 0x76, 0x61, 0x6c, 0x5f, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x62, 0x61, + 0x73, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x4d, 0x73, 0x12, 0x20, 0x0a, 0x0c, + 0x6d, 0x61, 0x78, 0x5f, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x5f, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x0a, 0x6d, 0x61, 0x78, 0x44, 0x65, 0x6c, 0x61, 0x79, 0x4d, 0x73, 0x12, 0x1e, + 0x0a, 0x0a, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x02, 0x52, 0x0a, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x69, 0x65, 0x72, 0x22, 0x99, + 0x03, 0x0a, 0x08, 0x54, 0x61, 0x73, 0x6b, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x38, 0x0a, 0x0b, 0x74, + 0x61, 0x73, 0x6b, 0x5f, 0x64, 0x65, 0x66, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x16, 0x2e, 0x6c, 0x69, 0x74, 0x74, 0x6c, 0x65, 0x68, 0x6f, 0x72, 0x73, 0x65, 0x2e, 0x54, + 0x61, 0x73, 0x6b, 0x44, 0x65, 0x66, 0x49, 0x64, 0x48, 0x00, 0x52, 0x09, 0x74, 0x61, 0x73, 0x6b, + 0x44, 0x65, 0x66, 0x49, 0x64, 0x12, 0x44, 0x0a, 0x0c, 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, + 0x5f, 0x74, 0x61, 0x73, 0x6b, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6c, 0x69, + 0x74, 0x74, 0x6c, 0x65, 0x68, 0x6f, 0x72, 0x73, 0x65, 0x2e, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, + 0x6c, 0x65, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x0b, + 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x27, 0x0a, 0x0f, 0x74, + 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x53, 0x65, 0x63, + 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x72, 0x65, 0x74, 0x72, 0x69, 0x65, 0x73, 0x12, 0x60, + 0x0a, 0x13, 0x65, 0x78, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x62, 0x61, + 0x63, 0x6b, 0x6f, 0x66, 0x66, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x6c, 0x69, + 0x74, 0x74, 0x6c, 0x65, 0x68, 0x6f, 0x72, 0x73, 0x65, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x6e, 0x65, + 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x42, 0x61, 0x63, 0x6b, 0x6f, 0x66, 0x66, 0x52, 0x65, 0x74, 0x72, + 0x79, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x48, 0x01, 0x52, 0x12, 0x65, 0x78, 0x70, 0x6f, 0x6e, + 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x42, 0x61, 0x63, 0x6b, 0x6f, 0x66, 0x66, 0x88, 0x01, 0x01, + 0x12, 0x3d, 0x0a, 0x09, 0x76, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x18, 0x04, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6c, 0x69, 0x74, 0x74, 0x6c, 0x65, 0x68, 0x6f, 0x72, 0x73, + 0x65, 0x2e, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, + 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x09, 0x76, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x42, + 0x11, 0x0a, 0x0f, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x74, 0x6f, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, + 0x74, 0x65, 0x42, 0x16, 0x0a, 0x14, 0x5f, 0x65, 0x78, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x69, + 0x61, 0x6c, 0x5f, 0x62, 0x61, 0x63, 0x6b, 0x6f, 0x66, 0x66, 0x2a, 0x98, 0x01, 0x0a, 0x14, 0x56, + 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x4d, 0x75, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x53, 0x53, 0x49, 0x47, 0x4e, 0x10, 0x00, 0x12, + 0x07, 0x0a, 0x03, 0x41, 0x44, 0x44, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x45, 0x58, 0x54, 0x45, + 0x4e, 0x44, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x55, 0x42, 0x54, 0x52, 0x41, 0x43, 0x54, + 0x10, 0x03, 0x12, 0x0c, 0x0a, 0x08, 0x4d, 0x55, 0x4c, 0x54, 0x49, 0x50, 0x4c, 0x59, 0x10, 0x04, + 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x49, 0x56, 0x49, 0x44, 0x45, 0x10, 0x05, 0x12, 0x15, 0x0a, 0x11, + 0x52, 0x45, 0x4d, 0x4f, 0x56, 0x45, 0x5f, 0x49, 0x46, 0x5f, 0x50, 0x52, 0x45, 0x53, 0x45, 0x4e, + 0x54, 0x10, 0x06, 0x12, 0x10, 0x0a, 0x0c, 0x52, 0x45, 0x4d, 0x4f, 0x56, 0x45, 0x5f, 0x49, 0x4e, + 0x44, 0x45, 0x58, 0x10, 0x07, 0x12, 0x0e, 0x0a, 0x0a, 0x52, 0x45, 0x4d, 0x4f, 0x56, 0x45, 0x5f, + 0x4b, 0x45, 0x59, 0x10, 0x08, 0x2a, 0x84, 0x01, 0x0a, 0x0a, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, + 0x61, 0x74, 0x6f, 0x72, 0x12, 0x0d, 0x0a, 0x09, 0x4c, 0x45, 0x53, 0x53, 0x5f, 0x54, 0x48, 0x41, + 0x4e, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x47, 0x52, 0x45, 0x41, 0x54, 0x45, 0x52, 0x5f, 0x54, + 0x48, 0x41, 0x4e, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x4c, 0x45, 0x53, 0x53, 0x5f, 0x54, 0x48, + 0x41, 0x4e, 0x5f, 0x45, 0x51, 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x47, 0x52, 0x45, 0x41, 0x54, + 0x45, 0x52, 0x5f, 0x54, 0x48, 0x41, 0x4e, 0x5f, 0x45, 0x51, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, + 0x45, 0x51, 0x55, 0x41, 0x4c, 0x53, 0x10, 0x04, 0x12, 0x0e, 0x0a, 0x0a, 0x4e, 0x4f, 0x54, 0x5f, + 0x45, 0x51, 0x55, 0x41, 0x4c, 0x53, 0x10, 0x05, 0x12, 0x06, 0x0a, 0x02, 0x49, 0x4e, 0x10, 0x06, + 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x4f, 0x54, 0x5f, 0x49, 0x4e, 0x10, 0x07, 0x42, 0x49, 0x0a, 0x1f, + 0x69, 0x6f, 0x2e, 0x6c, 0x69, 0x74, 0x74, 0x6c, 0x65, 0x68, 0x6f, 0x72, 0x73, 0x65, 0x2e, 0x73, + 0x64, 0x6b, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x09, 0x2e, 0x3b, 0x6c, 0x68, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0xaa, 0x02, 0x18, 0x4c, + 0x69, 0x74, 0x74, 0x6c, 0x65, 0x48, 0x6f, 0x72, 0x73, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1551,7 +1554,7 @@ var file_common_wfspec_proto_depIdxs = []int32{ 10, // 2: littlehorse.VariableAssignment.node_output:type_name -> littlehorse.VariableAssignment.NodeOutputReference 11, // 3: littlehorse.VariableAssignment.expression:type_name -> littlehorse.VariableAssignment.Expression 0, // 4: littlehorse.VariableMutation.operation:type_name -> littlehorse.VariableMutationType - 3, // 5: littlehorse.VariableMutation.source_variable:type_name -> littlehorse.VariableAssignment + 3, // 5: littlehorse.VariableMutation.rhs_assignment:type_name -> littlehorse.VariableAssignment 16, // 6: littlehorse.VariableMutation.literal_value:type_name -> littlehorse.VariableValue 12, // 7: littlehorse.VariableMutation.node_output:type_name -> littlehorse.VariableMutation.NodeOutputSource 17, // 8: littlehorse.VariableDef.type:type_name -> littlehorse.VariableType @@ -1755,7 +1758,7 @@ func file_common_wfspec_proto_init() { (*VariableAssignment_Expression_)(nil), } file_common_wfspec_proto_msgTypes[1].OneofWrappers = []interface{}{ - (*VariableMutation_SourceVariable)(nil), + (*VariableMutation_RhsAssignment)(nil), (*VariableMutation_LiteralValue)(nil), (*VariableMutation_NodeOutput)(nil), } diff --git a/sdk-go/littlehorse/wf_lib_internal.go b/sdk-go/littlehorse/wf_lib_internal.go index a0a648619..2e50d8c1b 100644 --- a/sdk-go/littlehorse/wf_lib_internal.go +++ b/sdk-go/littlehorse/wf_lib_internal.go @@ -709,8 +709,8 @@ func (t *WorkflowThread) mutate( }, } case WfRunVariable: - mutation.RhsValue = &lhproto.VariableMutation_SourceVariable{ - SourceVariable: &lhproto.VariableAssignment{ + mutation.RhsValue = &lhproto.VariableMutation_RhsAssignment{ + RhsAssignment: &lhproto.VariableAssignment{ JsonPath: r.jsonPath, Source: &lhproto.VariableAssignment_VariableName{ VariableName: r.Name, @@ -718,8 +718,8 @@ func (t *WorkflowThread) mutate( }, } case *WfRunVariable: - mutation.RhsValue = &lhproto.VariableMutation_SourceVariable{ - SourceVariable: &lhproto.VariableAssignment{ + mutation.RhsValue = &lhproto.VariableMutation_RhsAssignment{ + RhsAssignment: &lhproto.VariableAssignment{ JsonPath: r.jsonPath, Source: &lhproto.VariableAssignment_VariableName{ VariableName: r.Name, diff --git a/sdk-java/src/main/java/io/littlehorse/sdk/common/proto/CommonWfspec.java b/sdk-java/src/main/java/io/littlehorse/sdk/common/proto/CommonWfspec.java index 0406587c2..6e90f7ce1 100644 --- a/sdk-java/src/main/java/io/littlehorse/sdk/common/proto/CommonWfspec.java +++ b/sdk-java/src/main/java/io/littlehorse/sdk/common/proto/CommonWfspec.java @@ -107,56 +107,56 @@ public static void registerAllExtensions( "\0224\n\toperation\030\002 \001(\0162!.littlehorse.Variab" + "leMutationType\022,\n\003rhs\030\003 \001(\0132\037.littlehors" + "e.VariableAssignmentB\010\n\006sourceB\014\n\n_json_" + - "path\"\205\003\n\020VariableMutation\022\020\n\010lhs_name\030\001 " + + "path\"\204\003\n\020VariableMutation\022\020\n\010lhs_name\030\001 " + "\001(\t\022\032\n\rlhs_json_path\030\002 \001(\tH\001\210\001\001\0224\n\topera" + "tion\030\003 \001(\0162!.littlehorse.VariableMutatio" + - "nType\022:\n\017source_variable\030\004 \001(\0132\037.littleh" + - "orse.VariableAssignmentH\000\0223\n\rliteral_val" + - "ue\030\005 \001(\0132\032.littlehorse.VariableValueH\000\022E" + - "\n\013node_output\030\006 \001(\0132..littlehorse.Variab" + - "leMutation.NodeOutputSourceH\000\0326\n\020NodeOut" + - "putSource\022\025\n\010jsonpath\030\n \001(\tH\000\210\001\001B\013\n\t_jso" + - "npathB\013\n\trhs_valueB\020\n\016_lhs_json_path\"\244\001\n" + - "\013VariableDef\022\'\n\004type\030\001 \001(\0162\031.littlehorse" + - ".VariableType\022\014\n\004name\030\002 \001(\t\0226\n\rdefault_v" + - "alue\030\003 \001(\0132\032.littlehorse.VariableValueH\000" + - "\210\001\001\022\024\n\014masked_value\030\004 \001(\010B\020\n\016_default_va" + - "lue\"\357\004\n\017UTActionTrigger\0224\n\004task\030\001 \001(\0132$." + - "littlehorse.UTActionTrigger.UTATaskH\000\0228\n" + - "\006cancel\030\002 \001(\0132&.littlehorse.UTActionTrig" + - "ger.UTACancelH\000\022<\n\010reassign\030\003 \001(\0132(.litt" + - "lehorse.UTActionTrigger.UTAReassignH\000\0226\n" + - "\rdelay_seconds\030\005 \001(\0132\037.littlehorse.Varia" + - "bleAssignment\0221\n\004hook\030\006 \001(\0162#.littlehors" + - "e.UTActionTrigger.UTHook\032\013\n\tUTACancel\032`\n" + - "\007UTATask\022#\n\004task\030\001 \001(\0132\025.littlehorse.Tas" + - "kNode\0220\n\tmutations\030\002 \003(\0132\035.littlehorse.V" + - "ariableMutation\032\231\001\n\013UTAReassign\0225\n\007user_" + - "id\030\001 \001(\0132\037.littlehorse.VariableAssignmen" + - "tH\000\210\001\001\0228\n\nuser_group\030\002 \001(\0132\037.littlehorse" + - ".VariableAssignmentH\001\210\001\001B\n\n\010_user_idB\r\n\013" + - "_user_group\".\n\006UTHook\022\016\n\nON_ARRIVAL\020\000\022\024\n" + - "\020ON_TASK_ASSIGNED\020\001B\010\n\006action\"c\n\035Exponen" + - "tialBackoffRetryPolicy\022\030\n\020base_interval_" + - "ms\030\001 \001(\005\022\024\n\014max_delay_ms\030\002 \001(\003\022\022\n\nmultip" + - "lier\030\003 \001(\002\"\311\002\n\010TaskNode\022-\n\013task_def_id\030\001" + - " \001(\0132\026.littlehorse.TaskDefIdH\000\0227\n\014dynami" + - "c_task\030\006 \001(\0132\037.littlehorse.VariableAssig" + - "nmentH\000\022\027\n\017timeout_seconds\030\002 \001(\005\022\017\n\007retr" + - "ies\030\003 \001(\005\022L\n\023exponential_backoff\030\005 \001(\0132*" + - ".littlehorse.ExponentialBackoffRetryPoli" + - "cyH\001\210\001\001\0222\n\tvariables\030\004 \003(\0132\037.littlehorse" + - ".VariableAssignmentB\021\n\017task_to_executeB\026" + - "\n\024_exponential_backoff*\230\001\n\024VariableMutat" + - "ionType\022\n\n\006ASSIGN\020\000\022\007\n\003ADD\020\001\022\n\n\006EXTEND\020\002" + - "\022\014\n\010SUBTRACT\020\003\022\014\n\010MULTIPLY\020\004\022\n\n\006DIVIDE\020\005" + - "\022\025\n\021REMOVE_IF_PRESENT\020\006\022\020\n\014REMOVE_INDEX\020" + - "\007\022\016\n\nREMOVE_KEY\020\010*\204\001\n\nComparator\022\r\n\tLESS" + - "_THAN\020\000\022\020\n\014GREATER_THAN\020\001\022\020\n\014LESS_THAN_E" + - "Q\020\002\022\023\n\017GREATER_THAN_EQ\020\003\022\n\n\006EQUALS\020\004\022\016\n\n" + - "NOT_EQUALS\020\005\022\006\n\002IN\020\006\022\n\n\006NOT_IN\020\007BI\n\037io.l" + - "ittlehorse.sdk.common.protoP\001Z\t.;lhproto" + - "\252\002\030LittleHorse.Common.Protob\006proto3" + "nType\0229\n\016rhs_assignment\030\004 \001(\0132\037.littleho" + + "rse.VariableAssignmentH\000\0223\n\rliteral_valu" + + "e\030\005 \001(\0132\032.littlehorse.VariableValueH\000\022E\n" + + "\013node_output\030\006 \001(\0132..littlehorse.Variabl" + + "eMutation.NodeOutputSourceH\000\0326\n\020NodeOutp" + + "utSource\022\025\n\010jsonpath\030\n \001(\tH\000\210\001\001B\013\n\t_json" + + "pathB\013\n\trhs_valueB\020\n\016_lhs_json_path\"\244\001\n\013" + + "VariableDef\022\'\n\004type\030\001 \001(\0162\031.littlehorse." + + "VariableType\022\014\n\004name\030\002 \001(\t\0226\n\rdefault_va" + + "lue\030\003 \001(\0132\032.littlehorse.VariableValueH\000\210" + + "\001\001\022\024\n\014masked_value\030\004 \001(\010B\020\n\016_default_val" + + "ue\"\357\004\n\017UTActionTrigger\0224\n\004task\030\001 \001(\0132$.l" + + "ittlehorse.UTActionTrigger.UTATaskH\000\0228\n\006" + + "cancel\030\002 \001(\0132&.littlehorse.UTActionTrigg" + + "er.UTACancelH\000\022<\n\010reassign\030\003 \001(\0132(.littl" + + "ehorse.UTActionTrigger.UTAReassignH\000\0226\n\r" + + "delay_seconds\030\005 \001(\0132\037.littlehorse.Variab" + + "leAssignment\0221\n\004hook\030\006 \001(\0162#.littlehorse" + + ".UTActionTrigger.UTHook\032\013\n\tUTACancel\032`\n\007" + + "UTATask\022#\n\004task\030\001 \001(\0132\025.littlehorse.Task" + + "Node\0220\n\tmutations\030\002 \003(\0132\035.littlehorse.Va" + + "riableMutation\032\231\001\n\013UTAReassign\0225\n\007user_i" + + "d\030\001 \001(\0132\037.littlehorse.VariableAssignment" + + "H\000\210\001\001\0228\n\nuser_group\030\002 \001(\0132\037.littlehorse." + + "VariableAssignmentH\001\210\001\001B\n\n\010_user_idB\r\n\013_" + + "user_group\".\n\006UTHook\022\016\n\nON_ARRIVAL\020\000\022\024\n\020" + + "ON_TASK_ASSIGNED\020\001B\010\n\006action\"c\n\035Exponent" + + "ialBackoffRetryPolicy\022\030\n\020base_interval_m" + + "s\030\001 \001(\005\022\024\n\014max_delay_ms\030\002 \001(\003\022\022\n\nmultipl" + + "ier\030\003 \001(\002\"\311\002\n\010TaskNode\022-\n\013task_def_id\030\001 " + + "\001(\0132\026.littlehorse.TaskDefIdH\000\0227\n\014dynamic" + + "_task\030\006 \001(\0132\037.littlehorse.VariableAssign" + + "mentH\000\022\027\n\017timeout_seconds\030\002 \001(\005\022\017\n\007retri" + + "es\030\003 \001(\005\022L\n\023exponential_backoff\030\005 \001(\0132*." + + "littlehorse.ExponentialBackoffRetryPolic" + + "yH\001\210\001\001\0222\n\tvariables\030\004 \003(\0132\037.littlehorse." + + "VariableAssignmentB\021\n\017task_to_executeB\026\n" + + "\024_exponential_backoff*\230\001\n\024VariableMutati" + + "onType\022\n\n\006ASSIGN\020\000\022\007\n\003ADD\020\001\022\n\n\006EXTEND\020\002\022" + + "\014\n\010SUBTRACT\020\003\022\014\n\010MULTIPLY\020\004\022\n\n\006DIVIDE\020\005\022" + + "\025\n\021REMOVE_IF_PRESENT\020\006\022\020\n\014REMOVE_INDEX\020\007" + + "\022\016\n\nREMOVE_KEY\020\010*\204\001\n\nComparator\022\r\n\tLESS_" + + "THAN\020\000\022\020\n\014GREATER_THAN\020\001\022\020\n\014LESS_THAN_EQ" + + "\020\002\022\023\n\017GREATER_THAN_EQ\020\003\022\n\n\006EQUALS\020\004\022\016\n\nN" + + "OT_EQUALS\020\005\022\006\n\002IN\020\006\022\n\n\006NOT_IN\020\007BI\n\037io.li" + + "ttlehorse.sdk.common.protoP\001Z\t.;lhproto\252" + + "\002\030LittleHorse.Common.Protob\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -194,7 +194,7 @@ public static void registerAllExtensions( internal_static_littlehorse_VariableMutation_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_littlehorse_VariableMutation_descriptor, - new java.lang.String[] { "LhsName", "LhsJsonPath", "Operation", "SourceVariable", "LiteralValue", "NodeOutput", "RhsValue", "LhsJsonPath", }); + new java.lang.String[] { "LhsName", "LhsJsonPath", "Operation", "RhsAssignment", "LiteralValue", "NodeOutput", "RhsValue", "LhsJsonPath", }); internal_static_littlehorse_VariableMutation_NodeOutputSource_descriptor = internal_static_littlehorse_VariableMutation_descriptor.getNestedTypes().get(0); internal_static_littlehorse_VariableMutation_NodeOutputSource_fieldAccessorTable = new diff --git a/sdk-java/src/main/java/io/littlehorse/sdk/common/proto/VariableMutation.java b/sdk-java/src/main/java/io/littlehorse/sdk/common/proto/VariableMutation.java index ace98259d..c3e4317d4 100644 --- a/sdk-java/src/main/java/io/littlehorse/sdk/common/proto/VariableMutation.java +++ b/sdk-java/src/main/java/io/littlehorse/sdk/common/proto/VariableMutation.java @@ -694,7 +694,7 @@ public io.littlehorse.sdk.common.proto.VariableMutation.NodeOutputSource getDefa public enum RhsValueCase implements com.google.protobuf.Internal.EnumLite, com.google.protobuf.AbstractMessage.InternalOneOfEnum { - SOURCE_VARIABLE(4), + RHS_ASSIGNMENT(4), LITERAL_VALUE(5), NODE_OUTPUT(6), RHSVALUE_NOT_SET(0); @@ -714,7 +714,7 @@ public static RhsValueCase valueOf(int value) { public static RhsValueCase forNumber(int value) { switch (value) { - case 4: return SOURCE_VARIABLE; + case 4: return RHS_ASSIGNMENT; case 5: return LITERAL_VALUE; case 6: return NODE_OUTPUT; case 0: return RHSVALUE_NOT_SET; @@ -867,31 +867,29 @@ public java.lang.String getLhsJsonPath() { return result == null ? io.littlehorse.sdk.common.proto.VariableMutationType.UNRECOGNIZED : result; } - public static final int SOURCE_VARIABLE_FIELD_NUMBER = 4; + public static final int RHS_ASSIGNMENT_FIELD_NUMBER = 4; /** *
-   * Set the source_variable as the RHS to use another variable from the workflow to
-   * as the RHS/
+   * Assigns the value to be used as the RHS of the mutation.
    * 
* - * .littlehorse.VariableAssignment source_variable = 4; - * @return Whether the sourceVariable field is set. + * .littlehorse.VariableAssignment rhs_assignment = 4; + * @return Whether the rhsAssignment field is set. */ @java.lang.Override - public boolean hasSourceVariable() { + public boolean hasRhsAssignment() { return rhsValueCase_ == 4; } /** *
-   * Set the source_variable as the RHS to use another variable from the workflow to
-   * as the RHS/
+   * Assigns the value to be used as the RHS of the mutation.
    * 
* - * .littlehorse.VariableAssignment source_variable = 4; - * @return The sourceVariable. + * .littlehorse.VariableAssignment rhs_assignment = 4; + * @return The rhsAssignment. */ @java.lang.Override - public io.littlehorse.sdk.common.proto.VariableAssignment getSourceVariable() { + public io.littlehorse.sdk.common.proto.VariableAssignment getRhsAssignment() { if (rhsValueCase_ == 4) { return (io.littlehorse.sdk.common.proto.VariableAssignment) rhsValue_; } @@ -899,14 +897,13 @@ public io.littlehorse.sdk.common.proto.VariableAssignment getSourceVariable() { } /** *
-   * Set the source_variable as the RHS to use another variable from the workflow to
-   * as the RHS/
+   * Assigns the value to be used as the RHS of the mutation.
    * 
* - * .littlehorse.VariableAssignment source_variable = 4; + * .littlehorse.VariableAssignment rhs_assignment = 4; */ @java.lang.Override - public io.littlehorse.sdk.common.proto.VariableAssignmentOrBuilder getSourceVariableOrBuilder() { + public io.littlehorse.sdk.common.proto.VariableAssignmentOrBuilder getRhsAssignmentOrBuilder() { if (rhsValueCase_ == 4) { return (io.littlehorse.sdk.common.proto.VariableAssignment) rhsValue_; } @@ -916,7 +913,8 @@ public io.littlehorse.sdk.common.proto.VariableAssignmentOrBuilder getSourceVari public static final int LITERAL_VALUE_FIELD_NUMBER = 5; /** *
-   * Use a literal value as the RHS.
+   * Use a literal value as the RHS. DEPRECATED: use rhs_assignment.literal_value
+   * instead.
    * 
* * .littlehorse.VariableValue literal_value = 5; @@ -928,7 +926,8 @@ public boolean hasLiteralValue() { } /** *
-   * Use a literal value as the RHS.
+   * Use a literal value as the RHS. DEPRECATED: use rhs_assignment.literal_value
+   * instead.
    * 
* * .littlehorse.VariableValue literal_value = 5; @@ -943,7 +942,8 @@ public io.littlehorse.sdk.common.proto.VariableValue getLiteralValue() { } /** *
-   * Use a literal value as the RHS.
+   * Use a literal value as the RHS. DEPRECATED: use rhs_assignment.literal_value
+   * instead.
    * 
* * .littlehorse.VariableValue literal_value = 5; @@ -959,7 +959,8 @@ public io.littlehorse.sdk.common.proto.VariableValueOrBuilder getLiteralValueOrB public static final int NODE_OUTPUT_FIELD_NUMBER = 6; /** *
-   * Use the output of the current node as the RHS.
+   * Use the output of the current node as the RHS. DEPRECATED: use
+   * rhs_assignment.node_output instead.
    * 
* * .littlehorse.VariableMutation.NodeOutputSource node_output = 6; @@ -971,7 +972,8 @@ public boolean hasNodeOutput() { } /** *
-   * Use the output of the current node as the RHS.
+   * Use the output of the current node as the RHS. DEPRECATED: use
+   * rhs_assignment.node_output instead.
    * 
* * .littlehorse.VariableMutation.NodeOutputSource node_output = 6; @@ -986,7 +988,8 @@ public io.littlehorse.sdk.common.proto.VariableMutation.NodeOutputSource getNode } /** *
-   * Use the output of the current node as the RHS.
+   * Use the output of the current node as the RHS. DEPRECATED: use
+   * rhs_assignment.node_output instead.
    * 
* * .littlehorse.VariableMutation.NodeOutputSource node_output = 6; @@ -1088,8 +1091,8 @@ public boolean equals(final java.lang.Object obj) { if (!getRhsValueCase().equals(other.getRhsValueCase())) return false; switch (rhsValueCase_) { case 4: - if (!getSourceVariable() - .equals(other.getSourceVariable())) return false; + if (!getRhsAssignment() + .equals(other.getRhsAssignment())) return false; break; case 5: if (!getLiteralValue() @@ -1123,8 +1126,8 @@ public int hashCode() { hash = (53 * hash) + operation_; switch (rhsValueCase_) { case 4: - hash = (37 * hash) + SOURCE_VARIABLE_FIELD_NUMBER; - hash = (53 * hash) + getSourceVariable().hashCode(); + hash = (37 * hash) + RHS_ASSIGNMENT_FIELD_NUMBER; + hash = (53 * hash) + getRhsAssignment().hashCode(); break; case 5: hash = (37 * hash) + LITERAL_VALUE_FIELD_NUMBER; @@ -1280,8 +1283,8 @@ public Builder clear() { lhsName_ = ""; lhsJsonPath_ = ""; operation_ = 0; - if (sourceVariableBuilder_ != null) { - sourceVariableBuilder_.clear(); + if (rhsAssignmentBuilder_ != null) { + rhsAssignmentBuilder_.clear(); } if (literalValueBuilder_ != null) { literalValueBuilder_.clear(); @@ -1343,8 +1346,8 @@ private void buildPartialOneofs(io.littlehorse.sdk.common.proto.VariableMutation result.rhsValueCase_ = rhsValueCase_; result.rhsValue_ = this.rhsValue_; if (rhsValueCase_ == 4 && - sourceVariableBuilder_ != null) { - result.rhsValue_ = sourceVariableBuilder_.build(); + rhsAssignmentBuilder_ != null) { + result.rhsValue_ = rhsAssignmentBuilder_.build(); } if (rhsValueCase_ == 5 && literalValueBuilder_ != null) { @@ -1414,8 +1417,8 @@ public Builder mergeFrom(io.littlehorse.sdk.common.proto.VariableMutation other) setOperationValue(other.getOperationValue()); } switch (other.getRhsValueCase()) { - case SOURCE_VARIABLE: { - mergeSourceVariable(other.getSourceVariable()); + case RHS_ASSIGNMENT: { + mergeRhsAssignment(other.getRhsAssignment()); break; } case LITERAL_VALUE: { @@ -1473,7 +1476,7 @@ public Builder mergeFrom( } // case 24 case 34: { input.readMessage( - getSourceVariableFieldBuilder().getBuilder(), + getRhsAssignmentFieldBuilder().getBuilder(), extensionRegistry); rhsValueCase_ = 4; break; @@ -1799,93 +1802,88 @@ public Builder clearOperation() { } private com.google.protobuf.SingleFieldBuilderV3< - io.littlehorse.sdk.common.proto.VariableAssignment, io.littlehorse.sdk.common.proto.VariableAssignment.Builder, io.littlehorse.sdk.common.proto.VariableAssignmentOrBuilder> sourceVariableBuilder_; + io.littlehorse.sdk.common.proto.VariableAssignment, io.littlehorse.sdk.common.proto.VariableAssignment.Builder, io.littlehorse.sdk.common.proto.VariableAssignmentOrBuilder> rhsAssignmentBuilder_; /** *
-     * Set the source_variable as the RHS to use another variable from the workflow to
-     * as the RHS/
+     * Assigns the value to be used as the RHS of the mutation.
      * 
* - * .littlehorse.VariableAssignment source_variable = 4; - * @return Whether the sourceVariable field is set. + * .littlehorse.VariableAssignment rhs_assignment = 4; + * @return Whether the rhsAssignment field is set. */ @java.lang.Override - public boolean hasSourceVariable() { + public boolean hasRhsAssignment() { return rhsValueCase_ == 4; } /** *
-     * Set the source_variable as the RHS to use another variable from the workflow to
-     * as the RHS/
+     * Assigns the value to be used as the RHS of the mutation.
      * 
* - * .littlehorse.VariableAssignment source_variable = 4; - * @return The sourceVariable. + * .littlehorse.VariableAssignment rhs_assignment = 4; + * @return The rhsAssignment. */ @java.lang.Override - public io.littlehorse.sdk.common.proto.VariableAssignment getSourceVariable() { - if (sourceVariableBuilder_ == null) { + public io.littlehorse.sdk.common.proto.VariableAssignment getRhsAssignment() { + if (rhsAssignmentBuilder_ == null) { if (rhsValueCase_ == 4) { return (io.littlehorse.sdk.common.proto.VariableAssignment) rhsValue_; } return io.littlehorse.sdk.common.proto.VariableAssignment.getDefaultInstance(); } else { if (rhsValueCase_ == 4) { - return sourceVariableBuilder_.getMessage(); + return rhsAssignmentBuilder_.getMessage(); } return io.littlehorse.sdk.common.proto.VariableAssignment.getDefaultInstance(); } } /** *
-     * Set the source_variable as the RHS to use another variable from the workflow to
-     * as the RHS/
+     * Assigns the value to be used as the RHS of the mutation.
      * 
* - * .littlehorse.VariableAssignment source_variable = 4; + * .littlehorse.VariableAssignment rhs_assignment = 4; */ - public Builder setSourceVariable(io.littlehorse.sdk.common.proto.VariableAssignment value) { - if (sourceVariableBuilder_ == null) { + public Builder setRhsAssignment(io.littlehorse.sdk.common.proto.VariableAssignment value) { + if (rhsAssignmentBuilder_ == null) { if (value == null) { throw new NullPointerException(); } rhsValue_ = value; onChanged(); } else { - sourceVariableBuilder_.setMessage(value); + rhsAssignmentBuilder_.setMessage(value); } rhsValueCase_ = 4; return this; } /** *
-     * Set the source_variable as the RHS to use another variable from the workflow to
-     * as the RHS/
+     * Assigns the value to be used as the RHS of the mutation.
      * 
* - * .littlehorse.VariableAssignment source_variable = 4; + * .littlehorse.VariableAssignment rhs_assignment = 4; */ - public Builder setSourceVariable( + public Builder setRhsAssignment( io.littlehorse.sdk.common.proto.VariableAssignment.Builder builderForValue) { - if (sourceVariableBuilder_ == null) { + if (rhsAssignmentBuilder_ == null) { rhsValue_ = builderForValue.build(); onChanged(); } else { - sourceVariableBuilder_.setMessage(builderForValue.build()); + rhsAssignmentBuilder_.setMessage(builderForValue.build()); } rhsValueCase_ = 4; return this; } /** *
-     * Set the source_variable as the RHS to use another variable from the workflow to
-     * as the RHS/
+     * Assigns the value to be used as the RHS of the mutation.
      * 
* - * .littlehorse.VariableAssignment source_variable = 4; + * .littlehorse.VariableAssignment rhs_assignment = 4; */ - public Builder mergeSourceVariable(io.littlehorse.sdk.common.proto.VariableAssignment value) { - if (sourceVariableBuilder_ == null) { + public Builder mergeRhsAssignment(io.littlehorse.sdk.common.proto.VariableAssignment value) { + if (rhsAssignmentBuilder_ == null) { if (rhsValueCase_ == 4 && rhsValue_ != io.littlehorse.sdk.common.proto.VariableAssignment.getDefaultInstance()) { rhsValue_ = io.littlehorse.sdk.common.proto.VariableAssignment.newBuilder((io.littlehorse.sdk.common.proto.VariableAssignment) rhsValue_) @@ -1896,9 +1894,9 @@ public Builder mergeSourceVariable(io.littlehorse.sdk.common.proto.VariableAssig onChanged(); } else { if (rhsValueCase_ == 4) { - sourceVariableBuilder_.mergeFrom(value); + rhsAssignmentBuilder_.mergeFrom(value); } else { - sourceVariableBuilder_.setMessage(value); + rhsAssignmentBuilder_.setMessage(value); } } rhsValueCase_ = 4; @@ -1906,14 +1904,13 @@ public Builder mergeSourceVariable(io.littlehorse.sdk.common.proto.VariableAssig } /** *
-     * Set the source_variable as the RHS to use another variable from the workflow to
-     * as the RHS/
+     * Assigns the value to be used as the RHS of the mutation.
      * 
* - * .littlehorse.VariableAssignment source_variable = 4; + * .littlehorse.VariableAssignment rhs_assignment = 4; */ - public Builder clearSourceVariable() { - if (sourceVariableBuilder_ == null) { + public Builder clearRhsAssignment() { + if (rhsAssignmentBuilder_ == null) { if (rhsValueCase_ == 4) { rhsValueCase_ = 0; rhsValue_ = null; @@ -1924,33 +1921,31 @@ public Builder clearSourceVariable() { rhsValueCase_ = 0; rhsValue_ = null; } - sourceVariableBuilder_.clear(); + rhsAssignmentBuilder_.clear(); } return this; } /** *
-     * Set the source_variable as the RHS to use another variable from the workflow to
-     * as the RHS/
+     * Assigns the value to be used as the RHS of the mutation.
      * 
* - * .littlehorse.VariableAssignment source_variable = 4; + * .littlehorse.VariableAssignment rhs_assignment = 4; */ - public io.littlehorse.sdk.common.proto.VariableAssignment.Builder getSourceVariableBuilder() { - return getSourceVariableFieldBuilder().getBuilder(); + public io.littlehorse.sdk.common.proto.VariableAssignment.Builder getRhsAssignmentBuilder() { + return getRhsAssignmentFieldBuilder().getBuilder(); } /** *
-     * Set the source_variable as the RHS to use another variable from the workflow to
-     * as the RHS/
+     * Assigns the value to be used as the RHS of the mutation.
      * 
* - * .littlehorse.VariableAssignment source_variable = 4; + * .littlehorse.VariableAssignment rhs_assignment = 4; */ @java.lang.Override - public io.littlehorse.sdk.common.proto.VariableAssignmentOrBuilder getSourceVariableOrBuilder() { - if ((rhsValueCase_ == 4) && (sourceVariableBuilder_ != null)) { - return sourceVariableBuilder_.getMessageOrBuilder(); + public io.littlehorse.sdk.common.proto.VariableAssignmentOrBuilder getRhsAssignmentOrBuilder() { + if ((rhsValueCase_ == 4) && (rhsAssignmentBuilder_ != null)) { + return rhsAssignmentBuilder_.getMessageOrBuilder(); } else { if (rhsValueCase_ == 4) { return (io.littlehorse.sdk.common.proto.VariableAssignment) rhsValue_; @@ -1960,20 +1955,19 @@ public io.littlehorse.sdk.common.proto.VariableAssignmentOrBuilder getSourceVari } /** *
-     * Set the source_variable as the RHS to use another variable from the workflow to
-     * as the RHS/
+     * Assigns the value to be used as the RHS of the mutation.
      * 
* - * .littlehorse.VariableAssignment source_variable = 4; + * .littlehorse.VariableAssignment rhs_assignment = 4; */ private com.google.protobuf.SingleFieldBuilderV3< io.littlehorse.sdk.common.proto.VariableAssignment, io.littlehorse.sdk.common.proto.VariableAssignment.Builder, io.littlehorse.sdk.common.proto.VariableAssignmentOrBuilder> - getSourceVariableFieldBuilder() { - if (sourceVariableBuilder_ == null) { + getRhsAssignmentFieldBuilder() { + if (rhsAssignmentBuilder_ == null) { if (!(rhsValueCase_ == 4)) { rhsValue_ = io.littlehorse.sdk.common.proto.VariableAssignment.getDefaultInstance(); } - sourceVariableBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + rhsAssignmentBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< io.littlehorse.sdk.common.proto.VariableAssignment, io.littlehorse.sdk.common.proto.VariableAssignment.Builder, io.littlehorse.sdk.common.proto.VariableAssignmentOrBuilder>( (io.littlehorse.sdk.common.proto.VariableAssignment) rhsValue_, getParentForChildren(), @@ -1982,14 +1976,15 @@ public io.littlehorse.sdk.common.proto.VariableAssignmentOrBuilder getSourceVari } rhsValueCase_ = 4; onChanged(); - return sourceVariableBuilder_; + return rhsAssignmentBuilder_; } private com.google.protobuf.SingleFieldBuilderV3< io.littlehorse.sdk.common.proto.VariableValue, io.littlehorse.sdk.common.proto.VariableValue.Builder, io.littlehorse.sdk.common.proto.VariableValueOrBuilder> literalValueBuilder_; /** *
-     * Use a literal value as the RHS.
+     * Use a literal value as the RHS. DEPRECATED: use rhs_assignment.literal_value
+     * instead.
      * 
* * .littlehorse.VariableValue literal_value = 5; @@ -2001,7 +1996,8 @@ public boolean hasLiteralValue() { } /** *
-     * Use a literal value as the RHS.
+     * Use a literal value as the RHS. DEPRECATED: use rhs_assignment.literal_value
+     * instead.
      * 
* * .littlehorse.VariableValue literal_value = 5; @@ -2023,7 +2019,8 @@ public io.littlehorse.sdk.common.proto.VariableValue getLiteralValue() { } /** *
-     * Use a literal value as the RHS.
+     * Use a literal value as the RHS. DEPRECATED: use rhs_assignment.literal_value
+     * instead.
      * 
* * .littlehorse.VariableValue literal_value = 5; @@ -2043,7 +2040,8 @@ public Builder setLiteralValue(io.littlehorse.sdk.common.proto.VariableValue val } /** *
-     * Use a literal value as the RHS.
+     * Use a literal value as the RHS. DEPRECATED: use rhs_assignment.literal_value
+     * instead.
      * 
* * .littlehorse.VariableValue literal_value = 5; @@ -2061,7 +2059,8 @@ public Builder setLiteralValue( } /** *
-     * Use a literal value as the RHS.
+     * Use a literal value as the RHS. DEPRECATED: use rhs_assignment.literal_value
+     * instead.
      * 
* * .littlehorse.VariableValue literal_value = 5; @@ -2088,7 +2087,8 @@ public Builder mergeLiteralValue(io.littlehorse.sdk.common.proto.VariableValue v } /** *
-     * Use a literal value as the RHS.
+     * Use a literal value as the RHS. DEPRECATED: use rhs_assignment.literal_value
+     * instead.
      * 
* * .littlehorse.VariableValue literal_value = 5; @@ -2111,7 +2111,8 @@ public Builder clearLiteralValue() { } /** *
-     * Use a literal value as the RHS.
+     * Use a literal value as the RHS. DEPRECATED: use rhs_assignment.literal_value
+     * instead.
      * 
* * .littlehorse.VariableValue literal_value = 5; @@ -2121,7 +2122,8 @@ public io.littlehorse.sdk.common.proto.VariableValue.Builder getLiteralValueBuil } /** *
-     * Use a literal value as the RHS.
+     * Use a literal value as the RHS. DEPRECATED: use rhs_assignment.literal_value
+     * instead.
      * 
* * .littlehorse.VariableValue literal_value = 5; @@ -2139,7 +2141,8 @@ public io.littlehorse.sdk.common.proto.VariableValueOrBuilder getLiteralValueOrB } /** *
-     * Use a literal value as the RHS.
+     * Use a literal value as the RHS. DEPRECATED: use rhs_assignment.literal_value
+     * instead.
      * 
* * .littlehorse.VariableValue literal_value = 5; @@ -2167,7 +2170,8 @@ public io.littlehorse.sdk.common.proto.VariableValueOrBuilder getLiteralValueOrB io.littlehorse.sdk.common.proto.VariableMutation.NodeOutputSource, io.littlehorse.sdk.common.proto.VariableMutation.NodeOutputSource.Builder, io.littlehorse.sdk.common.proto.VariableMutation.NodeOutputSourceOrBuilder> nodeOutputBuilder_; /** *
-     * Use the output of the current node as the RHS.
+     * Use the output of the current node as the RHS. DEPRECATED: use
+     * rhs_assignment.node_output instead.
      * 
* * .littlehorse.VariableMutation.NodeOutputSource node_output = 6; @@ -2179,7 +2183,8 @@ public boolean hasNodeOutput() { } /** *
-     * Use the output of the current node as the RHS.
+     * Use the output of the current node as the RHS. DEPRECATED: use
+     * rhs_assignment.node_output instead.
      * 
* * .littlehorse.VariableMutation.NodeOutputSource node_output = 6; @@ -2201,7 +2206,8 @@ public io.littlehorse.sdk.common.proto.VariableMutation.NodeOutputSource getNode } /** *
-     * Use the output of the current node as the RHS.
+     * Use the output of the current node as the RHS. DEPRECATED: use
+     * rhs_assignment.node_output instead.
      * 
* * .littlehorse.VariableMutation.NodeOutputSource node_output = 6; @@ -2221,7 +2227,8 @@ public Builder setNodeOutput(io.littlehorse.sdk.common.proto.VariableMutation.No } /** *
-     * Use the output of the current node as the RHS.
+     * Use the output of the current node as the RHS. DEPRECATED: use
+     * rhs_assignment.node_output instead.
      * 
* * .littlehorse.VariableMutation.NodeOutputSource node_output = 6; @@ -2239,7 +2246,8 @@ public Builder setNodeOutput( } /** *
-     * Use the output of the current node as the RHS.
+     * Use the output of the current node as the RHS. DEPRECATED: use
+     * rhs_assignment.node_output instead.
      * 
* * .littlehorse.VariableMutation.NodeOutputSource node_output = 6; @@ -2266,7 +2274,8 @@ public Builder mergeNodeOutput(io.littlehorse.sdk.common.proto.VariableMutation. } /** *
-     * Use the output of the current node as the RHS.
+     * Use the output of the current node as the RHS. DEPRECATED: use
+     * rhs_assignment.node_output instead.
      * 
* * .littlehorse.VariableMutation.NodeOutputSource node_output = 6; @@ -2289,7 +2298,8 @@ public Builder clearNodeOutput() { } /** *
-     * Use the output of the current node as the RHS.
+     * Use the output of the current node as the RHS. DEPRECATED: use
+     * rhs_assignment.node_output instead.
      * 
* * .littlehorse.VariableMutation.NodeOutputSource node_output = 6; @@ -2299,7 +2309,8 @@ public io.littlehorse.sdk.common.proto.VariableMutation.NodeOutputSource.Builder } /** *
-     * Use the output of the current node as the RHS.
+     * Use the output of the current node as the RHS. DEPRECATED: use
+     * rhs_assignment.node_output instead.
      * 
* * .littlehorse.VariableMutation.NodeOutputSource node_output = 6; @@ -2317,7 +2328,8 @@ public io.littlehorse.sdk.common.proto.VariableMutation.NodeOutputSourceOrBuilde } /** *
-     * Use the output of the current node as the RHS.
+     * Use the output of the current node as the RHS. DEPRECATED: use
+     * rhs_assignment.node_output instead.
      * 
* * .littlehorse.VariableMutation.NodeOutputSource node_output = 6; diff --git a/sdk-java/src/main/java/io/littlehorse/sdk/common/proto/VariableMutationOrBuilder.java b/sdk-java/src/main/java/io/littlehorse/sdk/common/proto/VariableMutationOrBuilder.java index 0a2b90cbb..4956d7196 100644 --- a/sdk-java/src/main/java/io/littlehorse/sdk/common/proto/VariableMutationOrBuilder.java +++ b/sdk-java/src/main/java/io/littlehorse/sdk/common/proto/VariableMutationOrBuilder.java @@ -80,37 +80,35 @@ public interface VariableMutationOrBuilder extends /** *
-   * Set the source_variable as the RHS to use another variable from the workflow to
-   * as the RHS/
+   * Assigns the value to be used as the RHS of the mutation.
    * 
* - * .littlehorse.VariableAssignment source_variable = 4; - * @return Whether the sourceVariable field is set. + * .littlehorse.VariableAssignment rhs_assignment = 4; + * @return Whether the rhsAssignment field is set. */ - boolean hasSourceVariable(); + boolean hasRhsAssignment(); /** *
-   * Set the source_variable as the RHS to use another variable from the workflow to
-   * as the RHS/
+   * Assigns the value to be used as the RHS of the mutation.
    * 
* - * .littlehorse.VariableAssignment source_variable = 4; - * @return The sourceVariable. + * .littlehorse.VariableAssignment rhs_assignment = 4; + * @return The rhsAssignment. */ - io.littlehorse.sdk.common.proto.VariableAssignment getSourceVariable(); + io.littlehorse.sdk.common.proto.VariableAssignment getRhsAssignment(); /** *
-   * Set the source_variable as the RHS to use another variable from the workflow to
-   * as the RHS/
+   * Assigns the value to be used as the RHS of the mutation.
    * 
* - * .littlehorse.VariableAssignment source_variable = 4; + * .littlehorse.VariableAssignment rhs_assignment = 4; */ - io.littlehorse.sdk.common.proto.VariableAssignmentOrBuilder getSourceVariableOrBuilder(); + io.littlehorse.sdk.common.proto.VariableAssignmentOrBuilder getRhsAssignmentOrBuilder(); /** *
-   * Use a literal value as the RHS.
+   * Use a literal value as the RHS. DEPRECATED: use rhs_assignment.literal_value
+   * instead.
    * 
* * .littlehorse.VariableValue literal_value = 5; @@ -119,7 +117,8 @@ public interface VariableMutationOrBuilder extends boolean hasLiteralValue(); /** *
-   * Use a literal value as the RHS.
+   * Use a literal value as the RHS. DEPRECATED: use rhs_assignment.literal_value
+   * instead.
    * 
* * .littlehorse.VariableValue literal_value = 5; @@ -128,7 +127,8 @@ public interface VariableMutationOrBuilder extends io.littlehorse.sdk.common.proto.VariableValue getLiteralValue(); /** *
-   * Use a literal value as the RHS.
+   * Use a literal value as the RHS. DEPRECATED: use rhs_assignment.literal_value
+   * instead.
    * 
* * .littlehorse.VariableValue literal_value = 5; @@ -137,7 +137,8 @@ public interface VariableMutationOrBuilder extends /** *
-   * Use the output of the current node as the RHS.
+   * Use the output of the current node as the RHS. DEPRECATED: use
+   * rhs_assignment.node_output instead.
    * 
* * .littlehorse.VariableMutation.NodeOutputSource node_output = 6; @@ -146,7 +147,8 @@ public interface VariableMutationOrBuilder extends boolean hasNodeOutput(); /** *
-   * Use the output of the current node as the RHS.
+   * Use the output of the current node as the RHS. DEPRECATED: use
+   * rhs_assignment.node_output instead.
    * 
* * .littlehorse.VariableMutation.NodeOutputSource node_output = 6; @@ -155,7 +157,8 @@ public interface VariableMutationOrBuilder extends io.littlehorse.sdk.common.proto.VariableMutation.NodeOutputSource getNodeOutput(); /** *
-   * Use the output of the current node as the RHS.
+   * Use the output of the current node as the RHS. DEPRECATED: use
+   * rhs_assignment.node_output instead.
    * 
* * .littlehorse.VariableMutation.NodeOutputSource node_output = 6; diff --git a/sdk-java/src/main/java/io/littlehorse/sdk/wfsdk/internal/BuilderUtil.java b/sdk-java/src/main/java/io/littlehorse/sdk/wfsdk/internal/BuilderUtil.java index 32c67e72a..6e6f8dbae 100644 --- a/sdk-java/src/main/java/io/littlehorse/sdk/wfsdk/internal/BuilderUtil.java +++ b/sdk-java/src/main/java/io/littlehorse/sdk/wfsdk/internal/BuilderUtil.java @@ -27,6 +27,10 @@ static VariableAssignment assignVariable(Object variable) { builder.setNodeOutput(NodeOutputReference.newBuilder() .setNodeName(nodeReference.nodeName) .build()); + + if (nodeReference.jsonPath != null) { + builder.setJsonPath(nodeReference.jsonPath); + } } else if (variable.getClass().equals(LHFormatStringImpl.class)) { LHFormatStringImpl format = (LHFormatStringImpl) variable; builder.setFormatString(VariableAssignment.FormatString.newBuilder() diff --git a/sdk-java/src/main/java/io/littlehorse/sdk/wfsdk/internal/WorkflowThreadImpl.java b/sdk-java/src/main/java/io/littlehorse/sdk/wfsdk/internal/WorkflowThreadImpl.java index 93a9f65de..9db7e0385 100644 --- a/sdk-java/src/main/java/io/littlehorse/sdk/wfsdk/internal/WorkflowThreadImpl.java +++ b/sdk-java/src/main/java/io/littlehorse/sdk/wfsdk/internal/WorkflowThreadImpl.java @@ -2,7 +2,6 @@ import com.google.protobuf.Message; import io.littlehorse.sdk.common.LHLibUtil; -import io.littlehorse.sdk.common.exception.LHSerdeError; import io.littlehorse.sdk.common.exception.TaskSchemaMismatchError; import io.littlehorse.sdk.common.proto.Comparator; import io.littlehorse.sdk.common.proto.Edge; @@ -33,7 +32,6 @@ import io.littlehorse.sdk.common.proto.VariableAssignment; import io.littlehorse.sdk.common.proto.VariableDef; import io.littlehorse.sdk.common.proto.VariableMutation; -import io.littlehorse.sdk.common.proto.VariableMutation.NodeOutputSource; import io.littlehorse.sdk.common.proto.VariableMutationType; import io.littlehorse.sdk.common.proto.VariableType; import io.littlehorse.sdk.common.proto.VariableValue; @@ -718,51 +716,7 @@ public void mutate(WfRunVariable lhsVar, VariableMutationType type, Object rhs) mutation.setLhsJsonPath(lhs.jsonPath); } - mutation.setSourceVariable(assignVariable(rhs)); - - if (NodeOutputImpl.class.isAssignableFrom(rhs.getClass())) { - NodeOutputImpl no = (NodeOutputImpl) rhs; - if (!no.nodeName.equals(this.lastNodeName)) { - log.debug("Mutating {} {} {}", no.nodeName, this.lastNodeName, name); - - throw new RuntimeException("Cannot use an old NodeOutput from node " + no.nodeName); - } - - NodeOutputSource.Builder nodeOutputSource = NodeOutputSource.newBuilder(); - if (no.jsonPath != null) { - nodeOutputSource.setJsonpath(no.jsonPath); - } - - mutation.setNodeOutput(nodeOutputSource); - } else if (WfRunVariableImpl.class.isAssignableFrom(rhs.getClass())) { - WfRunVariableImpl var = (WfRunVariableImpl) rhs; - VariableAssignment.Builder varBuilder = VariableAssignment.newBuilder(); - - if (var.jsonPath != null) { - varBuilder.setJsonPath(var.jsonPath); - } - varBuilder.setVariableName(var.name); - - mutation.setSourceVariable(varBuilder); - } else if (LHExpression.class.isAssignableFrom(rhs.getClass())) { - // TODO: Long term, we should deprecate all forms of mutation other than - // just using the `VariableAssignemnt source_variable` field. - // - // That would mean we just use `assignVariable()` for all cases. - mutation.setSourceVariable(assignVariable(rhs)); - } else { - // At this point, we're going to treat it as a regular POJO, which means - // likely a json obj. - - VariableValue rhsVal; - try { - rhsVal = LHLibUtil.objToVarVal(rhs); - } catch (LHSerdeError exn) { - throw new RuntimeException(exn); - } - - mutation.setLiteralValue(rhsVal); - } + mutation.setRhsAssignment(assignVariable(rhs)); this.variableMutations.add(mutation.build()); } diff --git a/sdk-java/src/test/java/io/littlehorse/sdk/wfsdk/internal/ConditionalTest.java b/sdk-java/src/test/java/io/littlehorse/sdk/wfsdk/internal/ConditionalTest.java index 745711225..4512b4666 100644 --- a/sdk-java/src/test/java/io/littlehorse/sdk/wfsdk/internal/ConditionalTest.java +++ b/sdk-java/src/test/java/io/littlehorse/sdk/wfsdk/internal/ConditionalTest.java @@ -39,6 +39,7 @@ public void shouldCreateIfElseConditionWithoutNodes() { .getLiteralValue() .getInt(), (edge) -> edge.getVariableMutations(0) + .getRhsAssignment() .getLiteralValue() .getStr()) .containsExactlyInAnyOrder( diff --git a/sdk-java/src/test/java/io/littlehorse/sdk/wfsdk/internal/WorkflowThreadImplTest.java b/sdk-java/src/test/java/io/littlehorse/sdk/wfsdk/internal/WorkflowThreadImplTest.java index bd59c2a58..681c6a666 100644 --- a/sdk-java/src/test/java/io/littlehorse/sdk/wfsdk/internal/WorkflowThreadImplTest.java +++ b/sdk-java/src/test/java/io/littlehorse/sdk/wfsdk/internal/WorkflowThreadImplTest.java @@ -4,6 +4,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import io.littlehorse.sdk.common.proto.Comparator; +import io.littlehorse.sdk.common.proto.Edge; import io.littlehorse.sdk.common.proto.ExponentialBackoffRetryPolicy; import io.littlehorse.sdk.common.proto.FailureHandlerDef; import io.littlehorse.sdk.common.proto.FailureHandlerDef.FailureToCatchCase; @@ -543,4 +544,106 @@ void testPassingNodeOutput() { assertThat(taskNode.getVariables(0).getNodeOutput().getNodeName()).isEqualTo("1-some-other-task-TASK"); } + + @Test + void mutationsShouldUseVariableAssignment() { + // Deprecated the literal_value and node_output approach + Workflow workflow = new WorkflowImpl("obiwan", wf -> { + WfRunVariable myVar = wf.addVariable("my-var", VariableType.STR); + myVar.assignTo("some-value"); + }); + + PutWfSpecRequest wfSpec = workflow.compileWorkflow(); + ThreadSpec entrypoint = wfSpec.getThreadSpecsOrThrow(wfSpec.getEntrypointThreadName()); + Node node = entrypoint.getNodesOrThrow("0-entrypoint-ENTRYPOINT"); + + Edge edge = node.getOutgoingEdges(0); + assertThat(edge.getVariableMutations(0) + .getRhsAssignment() + .getLiteralValue() + .getStr()) + .isEqualTo("some-value"); + } + + @Test + void nodeOutputMutationsShouldAlsoUseVariableAssignments() { + // Deprecated the literal_value and node_output approach + Workflow workflow = new WorkflowImpl("obiwan", wf -> { + WfRunVariable myVar = wf.addVariable("my-var", VariableType.STR); + myVar.assignTo(wf.execute("use-the-force")); + }); + + PutWfSpecRequest wfSpec = workflow.compileWorkflow(); + ThreadSpec entrypoint = wfSpec.getThreadSpecsOrThrow(wfSpec.getEntrypointThreadName()); + Node node = entrypoint.getNodesOrThrow("1-use-the-force-TASK"); + + Edge edge = node.getOutgoingEdges(0); + assertThat(edge.getVariableMutations(0) + .getRhsAssignment() + .getNodeOutput() + .getNodeName()) + .isEqualTo("1-use-the-force-TASK"); + } + + @Test + void nodeOutputMutationsShouldCarryJsonPath() { + // Deprecated the literal_value and node_output approach + Workflow workflow = new WorkflowImpl("obiwan", wf -> { + WfRunVariable myVar = wf.addVariable("my-var", VariableType.STR); + myVar.assignTo(wf.execute("use-the-force").jsonPath("$.hello.there")); + }); + + PutWfSpecRequest wfSpec = workflow.compileWorkflow(); + ThreadSpec entrypoint = wfSpec.getThreadSpecsOrThrow(wfSpec.getEntrypointThreadName()); + Node node = entrypoint.getNodesOrThrow("1-use-the-force-TASK"); + + Edge edge = node.getOutgoingEdges(0); + assertThat(edge.getVariableMutations(0) + .getRhsAssignment() + .getNodeOutput() + .getNodeName()) + .isEqualTo("1-use-the-force-TASK"); + + assertThat(edge.getVariableMutations(0).getRhsAssignment().getJsonPath()) + .isEqualTo("$.hello.there"); + } + + @Test + void assigningVariablesToOtherVariablesShouldUseVariableAssignment() { + // Deprecated the literal_value and node_output approach + Workflow workflow = new WorkflowImpl("obiwan", wf -> { + WfRunVariable myVar = wf.addVariable("my-var", VariableType.STR); + WfRunVariable otherVar = wf.addVariable("other-var", VariableType.STR); + myVar.assignTo(otherVar); + }); + + PutWfSpecRequest wfSpec = workflow.compileWorkflow(); + ThreadSpec entrypoint = wfSpec.getThreadSpecsOrThrow(wfSpec.getEntrypointThreadName()); + Node node = entrypoint.getNodesOrThrow("0-entrypoint-ENTRYPOINT"); + + Edge edge = node.getOutgoingEdges(0); + assertThat(edge.getVariableMutations(0).getRhsAssignment().getVariableName()) + .isEqualTo("other-var"); + } + + @Test + void assigningVariablesToOtherVariablesShouldCarryJsonPath() { + // Deprecated the literal_value and node_output approach + Workflow workflow = new WorkflowImpl("obiwan", wf -> { + WfRunVariable myVar = wf.addVariable("my-var", VariableType.STR); + WfRunVariable otherVar = wf.addVariable("other-var", VariableType.JSON_OBJ); + myVar.assignTo(otherVar.jsonPath("$.hello.there")); + }); + + PutWfSpecRequest wfSpec = workflow.compileWorkflow(); + ThreadSpec entrypoint = wfSpec.getThreadSpecsOrThrow(wfSpec.getEntrypointThreadName()); + Node node = entrypoint.getNodesOrThrow("0-entrypoint-ENTRYPOINT"); + + Edge edge = node.getOutgoingEdges(0); + assertThat(edge.getVariableMutations(0).getRhsAssignment().getVariableName()) + .isEqualTo("other-var"); + + assertThat(edge.getVariableMutations(0).getRhsAssignment().getJsonPath()) + .isEqualTo("$.hello.there"); + } } diff --git a/sdk-js/src/proto/common_wfspec.ts b/sdk-js/src/proto/common_wfspec.ts index 85696dc53..5f890e2a0 100644 --- a/sdk-js/src/proto/common_wfspec.ts +++ b/sdk-js/src/proto/common_wfspec.ts @@ -280,18 +280,21 @@ export interface VariableMutation { | undefined; /** Defines the operation that we are executing. */ operation: VariableMutationType; - /** - * Set the source_variable as the RHS to use another variable from the workflow to - * as the RHS/ - */ - sourceVariable?: + /** Assigns the value to be used as the RHS of the mutation. */ + rhsAssignment?: | VariableAssignment | undefined; - /** Use a literal value as the RHS. */ + /** + * Use a literal value as the RHS. DEPRECATED: use rhs_assignment.literal_value + * instead. + */ literalValue?: | VariableValue | undefined; - /** Use the output of the current node as the RHS. */ + /** + * Use the output of the current node as the RHS. DEPRECATED: use + * rhs_assignment.node_output instead. + */ nodeOutput?: VariableMutation_NodeOutputSource | undefined; } @@ -776,7 +779,7 @@ function createBaseVariableMutation(): VariableMutation { lhsName: "", lhsJsonPath: undefined, operation: VariableMutationType.ASSIGN, - sourceVariable: undefined, + rhsAssignment: undefined, literalValue: undefined, nodeOutput: undefined, }; @@ -793,8 +796,8 @@ export const VariableMutation = { if (message.operation !== VariableMutationType.ASSIGN) { writer.uint32(24).int32(variableMutationTypeToNumber(message.operation)); } - if (message.sourceVariable !== undefined) { - VariableAssignment.encode(message.sourceVariable, writer.uint32(34).fork()).ldelim(); + if (message.rhsAssignment !== undefined) { + VariableAssignment.encode(message.rhsAssignment, writer.uint32(34).fork()).ldelim(); } if (message.literalValue !== undefined) { VariableValue.encode(message.literalValue, writer.uint32(42).fork()).ldelim(); @@ -838,7 +841,7 @@ export const VariableMutation = { break; } - message.sourceVariable = VariableAssignment.decode(reader, reader.uint32()); + message.rhsAssignment = VariableAssignment.decode(reader, reader.uint32()); continue; case 5: if (tag !== 42) { @@ -871,8 +874,8 @@ export const VariableMutation = { message.lhsName = object.lhsName ?? ""; message.lhsJsonPath = object.lhsJsonPath ?? undefined; message.operation = object.operation ?? VariableMutationType.ASSIGN; - message.sourceVariable = (object.sourceVariable !== undefined && object.sourceVariable !== null) - ? VariableAssignment.fromPartial(object.sourceVariable) + message.rhsAssignment = (object.rhsAssignment !== undefined && object.rhsAssignment !== null) + ? VariableAssignment.fromPartial(object.rhsAssignment) : undefined; message.literalValue = (object.literalValue !== undefined && object.literalValue !== null) ? VariableValue.fromPartial(object.literalValue) diff --git a/sdk-python/littlehorse/model/__init__.py b/sdk-python/littlehorse/model/__init__.py index 85f573b7e..c956189c7 100644 --- a/sdk-python/littlehorse/model/__init__.py +++ b/sdk-python/littlehorse/model/__init__.py @@ -5,8 +5,8 @@ from .node_run_pb2 import * from .object_id_pb2 import * from .scheduled_wf_run_pb2 import * -from .service_pb2 import * from .service_pb2_grpc import * +from .service_pb2 import * from .task_def_pb2 import * from .task_run_pb2 import * from .user_tasks_pb2 import * diff --git a/sdk-python/littlehorse/model/common_wfspec_pb2.py b/sdk-python/littlehorse/model/common_wfspec_pb2.py index e209ba371..35fdfd883 100644 --- a/sdk-python/littlehorse/model/common_wfspec_pb2.py +++ b/sdk-python/littlehorse/model/common_wfspec_pb2.py @@ -16,7 +16,7 @@ import littlehorse.model.object_id_pb2 as object__id__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x13\x63ommon_wfspec.proto\x12\x0blittlehorse\x1a\x12\x63ommon_enums.proto\x1a\x0evariable.proto\x1a\x0fobject_id.proto\"\xa2\x05\n\x12VariableAssignment\x12\x16\n\tjson_path\x18\x01 \x01(\tH\x01\x88\x01\x01\x12\x17\n\rvariable_name\x18\x02 \x01(\tH\x00\x12\x33\n\rliteral_value\x18\x03 \x01(\x0b\x32\x1a.littlehorse.VariableValueH\x00\x12\x45\n\rformat_string\x18\x04 \x01(\x0b\x32,.littlehorse.VariableAssignment.FormatStringH\x00\x12J\n\x0bnode_output\x18\x05 \x01(\x0b\x32\x33.littlehorse.VariableAssignment.NodeOutputReferenceH\x00\x12@\n\nexpression\x18\x06 \x01(\x0b\x32*.littlehorse.VariableAssignment.ExpressionH\x00\x1an\n\x0c\x46ormatString\x12/\n\x06\x66ormat\x18\x01 \x01(\x0b\x32\x1f.littlehorse.VariableAssignment\x12-\n\x04\x61rgs\x18\x02 \x03(\x0b\x32\x1f.littlehorse.VariableAssignment\x1a(\n\x13NodeOutputReference\x12\x11\n\tnode_name\x18\x01 \x01(\t\x1a\x9e\x01\n\nExpression\x12,\n\x03lhs\x18\x01 \x01(\x0b\x32\x1f.littlehorse.VariableAssignment\x12\x34\n\toperation\x18\x02 \x01(\x0e\x32!.littlehorse.VariableMutationType\x12,\n\x03rhs\x18\x03 \x01(\x0b\x32\x1f.littlehorse.VariableAssignmentB\x08\n\x06sourceB\x0c\n\n_json_path\"\x85\x03\n\x10VariableMutation\x12\x10\n\x08lhs_name\x18\x01 \x01(\t\x12\x1a\n\rlhs_json_path\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x34\n\toperation\x18\x03 \x01(\x0e\x32!.littlehorse.VariableMutationType\x12:\n\x0fsource_variable\x18\x04 \x01(\x0b\x32\x1f.littlehorse.VariableAssignmentH\x00\x12\x33\n\rliteral_value\x18\x05 \x01(\x0b\x32\x1a.littlehorse.VariableValueH\x00\x12\x45\n\x0bnode_output\x18\x06 \x01(\x0b\x32..littlehorse.VariableMutation.NodeOutputSourceH\x00\x1a\x36\n\x10NodeOutputSource\x12\x15\n\x08jsonpath\x18\n \x01(\tH\x00\x88\x01\x01\x42\x0b\n\t_jsonpathB\x0b\n\trhs_valueB\x10\n\x0e_lhs_json_path\"\xa4\x01\n\x0bVariableDef\x12\'\n\x04type\x18\x01 \x01(\x0e\x32\x19.littlehorse.VariableType\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x36\n\rdefault_value\x18\x03 \x01(\x0b\x32\x1a.littlehorse.VariableValueH\x00\x88\x01\x01\x12\x14\n\x0cmasked_value\x18\x04 \x01(\x08\x42\x10\n\x0e_default_value\"\xef\x04\n\x0fUTActionTrigger\x12\x34\n\x04task\x18\x01 \x01(\x0b\x32$.littlehorse.UTActionTrigger.UTATaskH\x00\x12\x38\n\x06\x63\x61ncel\x18\x02 \x01(\x0b\x32&.littlehorse.UTActionTrigger.UTACancelH\x00\x12<\n\x08reassign\x18\x03 \x01(\x0b\x32(.littlehorse.UTActionTrigger.UTAReassignH\x00\x12\x36\n\rdelay_seconds\x18\x05 \x01(\x0b\x32\x1f.littlehorse.VariableAssignment\x12\x31\n\x04hook\x18\x06 \x01(\x0e\x32#.littlehorse.UTActionTrigger.UTHook\x1a\x0b\n\tUTACancel\x1a`\n\x07UTATask\x12#\n\x04task\x18\x01 \x01(\x0b\x32\x15.littlehorse.TaskNode\x12\x30\n\tmutations\x18\x02 \x03(\x0b\x32\x1d.littlehorse.VariableMutation\x1a\x99\x01\n\x0bUTAReassign\x12\x35\n\x07user_id\x18\x01 \x01(\x0b\x32\x1f.littlehorse.VariableAssignmentH\x00\x88\x01\x01\x12\x38\n\nuser_group\x18\x02 \x01(\x0b\x32\x1f.littlehorse.VariableAssignmentH\x01\x88\x01\x01\x42\n\n\x08_user_idB\r\n\x0b_user_group\".\n\x06UTHook\x12\x0e\n\nON_ARRIVAL\x10\x00\x12\x14\n\x10ON_TASK_ASSIGNED\x10\x01\x42\x08\n\x06\x61\x63tion\"c\n\x1d\x45xponentialBackoffRetryPolicy\x12\x18\n\x10\x62\x61se_interval_ms\x18\x01 \x01(\x05\x12\x14\n\x0cmax_delay_ms\x18\x02 \x01(\x03\x12\x12\n\nmultiplier\x18\x03 \x01(\x02\"\xc9\x02\n\x08TaskNode\x12-\n\x0btask_def_id\x18\x01 \x01(\x0b\x32\x16.littlehorse.TaskDefIdH\x00\x12\x37\n\x0c\x64ynamic_task\x18\x06 \x01(\x0b\x32\x1f.littlehorse.VariableAssignmentH\x00\x12\x17\n\x0ftimeout_seconds\x18\x02 \x01(\x05\x12\x0f\n\x07retries\x18\x03 \x01(\x05\x12L\n\x13\x65xponential_backoff\x18\x05 \x01(\x0b\x32*.littlehorse.ExponentialBackoffRetryPolicyH\x01\x88\x01\x01\x12\x32\n\tvariables\x18\x04 \x03(\x0b\x32\x1f.littlehorse.VariableAssignmentB\x11\n\x0ftask_to_executeB\x16\n\x14_exponential_backoff*\x98\x01\n\x14VariableMutationType\x12\n\n\x06\x41SSIGN\x10\x00\x12\x07\n\x03\x41\x44\x44\x10\x01\x12\n\n\x06\x45XTEND\x10\x02\x12\x0c\n\x08SUBTRACT\x10\x03\x12\x0c\n\x08MULTIPLY\x10\x04\x12\n\n\x06\x44IVIDE\x10\x05\x12\x15\n\x11REMOVE_IF_PRESENT\x10\x06\x12\x10\n\x0cREMOVE_INDEX\x10\x07\x12\x0e\n\nREMOVE_KEY\x10\x08*\x84\x01\n\nComparator\x12\r\n\tLESS_THAN\x10\x00\x12\x10\n\x0cGREATER_THAN\x10\x01\x12\x10\n\x0cLESS_THAN_EQ\x10\x02\x12\x13\n\x0fGREATER_THAN_EQ\x10\x03\x12\n\n\x06\x45QUALS\x10\x04\x12\x0e\n\nNOT_EQUALS\x10\x05\x12\x06\n\x02IN\x10\x06\x12\n\n\x06NOT_IN\x10\x07\x42I\n\x1fio.littlehorse.sdk.common.protoP\x01Z\t.;lhproto\xaa\x02\x18LittleHorse.Common.Protob\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x13\x63ommon_wfspec.proto\x12\x0blittlehorse\x1a\x12\x63ommon_enums.proto\x1a\x0evariable.proto\x1a\x0fobject_id.proto\"\xa2\x05\n\x12VariableAssignment\x12\x16\n\tjson_path\x18\x01 \x01(\tH\x01\x88\x01\x01\x12\x17\n\rvariable_name\x18\x02 \x01(\tH\x00\x12\x33\n\rliteral_value\x18\x03 \x01(\x0b\x32\x1a.littlehorse.VariableValueH\x00\x12\x45\n\rformat_string\x18\x04 \x01(\x0b\x32,.littlehorse.VariableAssignment.FormatStringH\x00\x12J\n\x0bnode_output\x18\x05 \x01(\x0b\x32\x33.littlehorse.VariableAssignment.NodeOutputReferenceH\x00\x12@\n\nexpression\x18\x06 \x01(\x0b\x32*.littlehorse.VariableAssignment.ExpressionH\x00\x1an\n\x0c\x46ormatString\x12/\n\x06\x66ormat\x18\x01 \x01(\x0b\x32\x1f.littlehorse.VariableAssignment\x12-\n\x04\x61rgs\x18\x02 \x03(\x0b\x32\x1f.littlehorse.VariableAssignment\x1a(\n\x13NodeOutputReference\x12\x11\n\tnode_name\x18\x01 \x01(\t\x1a\x9e\x01\n\nExpression\x12,\n\x03lhs\x18\x01 \x01(\x0b\x32\x1f.littlehorse.VariableAssignment\x12\x34\n\toperation\x18\x02 \x01(\x0e\x32!.littlehorse.VariableMutationType\x12,\n\x03rhs\x18\x03 \x01(\x0b\x32\x1f.littlehorse.VariableAssignmentB\x08\n\x06sourceB\x0c\n\n_json_path\"\x84\x03\n\x10VariableMutation\x12\x10\n\x08lhs_name\x18\x01 \x01(\t\x12\x1a\n\rlhs_json_path\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x34\n\toperation\x18\x03 \x01(\x0e\x32!.littlehorse.VariableMutationType\x12\x39\n\x0erhs_assignment\x18\x04 \x01(\x0b\x32\x1f.littlehorse.VariableAssignmentH\x00\x12\x33\n\rliteral_value\x18\x05 \x01(\x0b\x32\x1a.littlehorse.VariableValueH\x00\x12\x45\n\x0bnode_output\x18\x06 \x01(\x0b\x32..littlehorse.VariableMutation.NodeOutputSourceH\x00\x1a\x36\n\x10NodeOutputSource\x12\x15\n\x08jsonpath\x18\n \x01(\tH\x00\x88\x01\x01\x42\x0b\n\t_jsonpathB\x0b\n\trhs_valueB\x10\n\x0e_lhs_json_path\"\xa4\x01\n\x0bVariableDef\x12\'\n\x04type\x18\x01 \x01(\x0e\x32\x19.littlehorse.VariableType\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x36\n\rdefault_value\x18\x03 \x01(\x0b\x32\x1a.littlehorse.VariableValueH\x00\x88\x01\x01\x12\x14\n\x0cmasked_value\x18\x04 \x01(\x08\x42\x10\n\x0e_default_value\"\xef\x04\n\x0fUTActionTrigger\x12\x34\n\x04task\x18\x01 \x01(\x0b\x32$.littlehorse.UTActionTrigger.UTATaskH\x00\x12\x38\n\x06\x63\x61ncel\x18\x02 \x01(\x0b\x32&.littlehorse.UTActionTrigger.UTACancelH\x00\x12<\n\x08reassign\x18\x03 \x01(\x0b\x32(.littlehorse.UTActionTrigger.UTAReassignH\x00\x12\x36\n\rdelay_seconds\x18\x05 \x01(\x0b\x32\x1f.littlehorse.VariableAssignment\x12\x31\n\x04hook\x18\x06 \x01(\x0e\x32#.littlehorse.UTActionTrigger.UTHook\x1a\x0b\n\tUTACancel\x1a`\n\x07UTATask\x12#\n\x04task\x18\x01 \x01(\x0b\x32\x15.littlehorse.TaskNode\x12\x30\n\tmutations\x18\x02 \x03(\x0b\x32\x1d.littlehorse.VariableMutation\x1a\x99\x01\n\x0bUTAReassign\x12\x35\n\x07user_id\x18\x01 \x01(\x0b\x32\x1f.littlehorse.VariableAssignmentH\x00\x88\x01\x01\x12\x38\n\nuser_group\x18\x02 \x01(\x0b\x32\x1f.littlehorse.VariableAssignmentH\x01\x88\x01\x01\x42\n\n\x08_user_idB\r\n\x0b_user_group\".\n\x06UTHook\x12\x0e\n\nON_ARRIVAL\x10\x00\x12\x14\n\x10ON_TASK_ASSIGNED\x10\x01\x42\x08\n\x06\x61\x63tion\"c\n\x1d\x45xponentialBackoffRetryPolicy\x12\x18\n\x10\x62\x61se_interval_ms\x18\x01 \x01(\x05\x12\x14\n\x0cmax_delay_ms\x18\x02 \x01(\x03\x12\x12\n\nmultiplier\x18\x03 \x01(\x02\"\xc9\x02\n\x08TaskNode\x12-\n\x0btask_def_id\x18\x01 \x01(\x0b\x32\x16.littlehorse.TaskDefIdH\x00\x12\x37\n\x0c\x64ynamic_task\x18\x06 \x01(\x0b\x32\x1f.littlehorse.VariableAssignmentH\x00\x12\x17\n\x0ftimeout_seconds\x18\x02 \x01(\x05\x12\x0f\n\x07retries\x18\x03 \x01(\x05\x12L\n\x13\x65xponential_backoff\x18\x05 \x01(\x0b\x32*.littlehorse.ExponentialBackoffRetryPolicyH\x01\x88\x01\x01\x12\x32\n\tvariables\x18\x04 \x03(\x0b\x32\x1f.littlehorse.VariableAssignmentB\x11\n\x0ftask_to_executeB\x16\n\x14_exponential_backoff*\x98\x01\n\x14VariableMutationType\x12\n\n\x06\x41SSIGN\x10\x00\x12\x07\n\x03\x41\x44\x44\x10\x01\x12\n\n\x06\x45XTEND\x10\x02\x12\x0c\n\x08SUBTRACT\x10\x03\x12\x0c\n\x08MULTIPLY\x10\x04\x12\n\n\x06\x44IVIDE\x10\x05\x12\x15\n\x11REMOVE_IF_PRESENT\x10\x06\x12\x10\n\x0cREMOVE_INDEX\x10\x07\x12\x0e\n\nREMOVE_KEY\x10\x08*\x84\x01\n\nComparator\x12\r\n\tLESS_THAN\x10\x00\x12\x10\n\x0cGREATER_THAN\x10\x01\x12\x10\n\x0cLESS_THAN_EQ\x10\x02\x12\x13\n\x0fGREATER_THAN_EQ\x10\x03\x12\n\n\x06\x45QUALS\x10\x04\x12\x0e\n\nNOT_EQUALS\x10\x05\x12\x06\n\x02IN\x10\x06\x12\n\n\x06NOT_IN\x10\x07\x42I\n\x1fio.littlehorse.sdk.common.protoP\x01Z\t.;lhproto\xaa\x02\x18LittleHorse.Common.Protob\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -25,10 +25,10 @@ DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'\n\037io.littlehorse.sdk.common.protoP\001Z\t.;lhproto\252\002\030LittleHorse.Common.Proto' - _globals['_VARIABLEMUTATIONTYPE']._serialized_start=2385 - _globals['_VARIABLEMUTATIONTYPE']._serialized_end=2537 - _globals['_COMPARATOR']._serialized_start=2540 - _globals['_COMPARATOR']._serialized_end=2672 + _globals['_VARIABLEMUTATIONTYPE']._serialized_start=2384 + _globals['_VARIABLEMUTATIONTYPE']._serialized_end=2536 + _globals['_COMPARATOR']._serialized_start=2539 + _globals['_COMPARATOR']._serialized_end=2671 _globals['_VARIABLEASSIGNMENT']._serialized_start=90 _globals['_VARIABLEASSIGNMENT']._serialized_end=764 _globals['_VARIABLEASSIGNMENT_FORMATSTRING']._serialized_start=427 @@ -38,23 +38,23 @@ _globals['_VARIABLEASSIGNMENT_EXPRESSION']._serialized_start=582 _globals['_VARIABLEASSIGNMENT_EXPRESSION']._serialized_end=740 _globals['_VARIABLEMUTATION']._serialized_start=767 - _globals['_VARIABLEMUTATION']._serialized_end=1156 - _globals['_VARIABLEMUTATION_NODEOUTPUTSOURCE']._serialized_start=1071 - _globals['_VARIABLEMUTATION_NODEOUTPUTSOURCE']._serialized_end=1125 - _globals['_VARIABLEDEF']._serialized_start=1159 - _globals['_VARIABLEDEF']._serialized_end=1323 - _globals['_UTACTIONTRIGGER']._serialized_start=1326 - _globals['_UTACTIONTRIGGER']._serialized_end=1949 - _globals['_UTACTIONTRIGGER_UTACANCEL']._serialized_start=1626 - _globals['_UTACTIONTRIGGER_UTACANCEL']._serialized_end=1637 - _globals['_UTACTIONTRIGGER_UTATASK']._serialized_start=1639 - _globals['_UTACTIONTRIGGER_UTATASK']._serialized_end=1735 - _globals['_UTACTIONTRIGGER_UTAREASSIGN']._serialized_start=1738 - _globals['_UTACTIONTRIGGER_UTAREASSIGN']._serialized_end=1891 - _globals['_UTACTIONTRIGGER_UTHOOK']._serialized_start=1893 - _globals['_UTACTIONTRIGGER_UTHOOK']._serialized_end=1939 - _globals['_EXPONENTIALBACKOFFRETRYPOLICY']._serialized_start=1951 - _globals['_EXPONENTIALBACKOFFRETRYPOLICY']._serialized_end=2050 - _globals['_TASKNODE']._serialized_start=2053 - _globals['_TASKNODE']._serialized_end=2382 + _globals['_VARIABLEMUTATION']._serialized_end=1155 + _globals['_VARIABLEMUTATION_NODEOUTPUTSOURCE']._serialized_start=1070 + _globals['_VARIABLEMUTATION_NODEOUTPUTSOURCE']._serialized_end=1124 + _globals['_VARIABLEDEF']._serialized_start=1158 + _globals['_VARIABLEDEF']._serialized_end=1322 + _globals['_UTACTIONTRIGGER']._serialized_start=1325 + _globals['_UTACTIONTRIGGER']._serialized_end=1948 + _globals['_UTACTIONTRIGGER_UTACANCEL']._serialized_start=1625 + _globals['_UTACTIONTRIGGER_UTACANCEL']._serialized_end=1636 + _globals['_UTACTIONTRIGGER_UTATASK']._serialized_start=1638 + _globals['_UTACTIONTRIGGER_UTATASK']._serialized_end=1734 + _globals['_UTACTIONTRIGGER_UTAREASSIGN']._serialized_start=1737 + _globals['_UTACTIONTRIGGER_UTAREASSIGN']._serialized_end=1890 + _globals['_UTACTIONTRIGGER_UTHOOK']._serialized_start=1892 + _globals['_UTACTIONTRIGGER_UTHOOK']._serialized_end=1938 + _globals['_EXPONENTIALBACKOFFRETRYPOLICY']._serialized_start=1950 + _globals['_EXPONENTIALBACKOFFRETRYPOLICY']._serialized_end=2049 + _globals['_TASKNODE']._serialized_start=2052 + _globals['_TASKNODE']._serialized_end=2381 # @@protoc_insertion_point(module_scope) diff --git a/sdk-python/littlehorse/model/common_wfspec_pb2.pyi b/sdk-python/littlehorse/model/common_wfspec_pb2.pyi index 1e3ebffa6..6462238a7 100644 --- a/sdk-python/littlehorse/model/common_wfspec_pb2.pyi +++ b/sdk-python/littlehorse/model/common_wfspec_pb2.pyi @@ -87,7 +87,7 @@ class VariableAssignment(_message.Message): def __init__(self, json_path: _Optional[str] = ..., variable_name: _Optional[str] = ..., literal_value: _Optional[_Union[_variable_pb2.VariableValue, _Mapping]] = ..., format_string: _Optional[_Union[VariableAssignment.FormatString, _Mapping]] = ..., node_output: _Optional[_Union[VariableAssignment.NodeOutputReference, _Mapping]] = ..., expression: _Optional[_Union[VariableAssignment.Expression, _Mapping]] = ...) -> None: ... class VariableMutation(_message.Message): - __slots__ = ["lhs_name", "lhs_json_path", "operation", "source_variable", "literal_value", "node_output"] + __slots__ = ["lhs_name", "lhs_json_path", "operation", "rhs_assignment", "literal_value", "node_output"] class NodeOutputSource(_message.Message): __slots__ = ["jsonpath"] JSONPATH_FIELD_NUMBER: _ClassVar[int] @@ -96,16 +96,16 @@ class VariableMutation(_message.Message): LHS_NAME_FIELD_NUMBER: _ClassVar[int] LHS_JSON_PATH_FIELD_NUMBER: _ClassVar[int] OPERATION_FIELD_NUMBER: _ClassVar[int] - SOURCE_VARIABLE_FIELD_NUMBER: _ClassVar[int] + RHS_ASSIGNMENT_FIELD_NUMBER: _ClassVar[int] LITERAL_VALUE_FIELD_NUMBER: _ClassVar[int] NODE_OUTPUT_FIELD_NUMBER: _ClassVar[int] lhs_name: str lhs_json_path: str operation: VariableMutationType - source_variable: VariableAssignment + rhs_assignment: VariableAssignment literal_value: _variable_pb2.VariableValue node_output: VariableMutation.NodeOutputSource - def __init__(self, lhs_name: _Optional[str] = ..., lhs_json_path: _Optional[str] = ..., operation: _Optional[_Union[VariableMutationType, str]] = ..., source_variable: _Optional[_Union[VariableAssignment, _Mapping]] = ..., literal_value: _Optional[_Union[_variable_pb2.VariableValue, _Mapping]] = ..., node_output: _Optional[_Union[VariableMutation.NodeOutputSource, _Mapping]] = ...) -> None: ... + def __init__(self, lhs_name: _Optional[str] = ..., lhs_json_path: _Optional[str] = ..., operation: _Optional[_Union[VariableMutationType, str]] = ..., rhs_assignment: _Optional[_Union[VariableAssignment, _Mapping]] = ..., literal_value: _Optional[_Union[_variable_pb2.VariableValue, _Mapping]] = ..., node_output: _Optional[_Union[VariableMutation.NodeOutputSource, _Mapping]] = ...) -> None: ... class VariableDef(_message.Message): __slots__ = ["type", "name", "default_value", "masked_value"] diff --git a/sdk-python/littlehorse/workflow.py b/sdk-python/littlehorse/workflow.py index 6d61db990..13b54058a 100644 --- a/sdk-python/littlehorse/workflow.py +++ b/sdk-python/littlehorse/workflow.py @@ -1461,7 +1461,7 @@ def mutate( last_node = self._last_node() node_output: Optional[VariableMutation.NodeOutputSource] = None - source_variable: Optional[VariableAssignment] = None + rhs_assignment: Optional[VariableAssignment] = None literal_value: Optional[VariableValue] = None if isinstance(right_hand, NodeOutput): @@ -1471,7 +1471,7 @@ def mutate( jsonpath=right_hand.json_path ) elif isinstance(right_hand, WfRunVariable): - source_variable = to_variable_assignment(right_hand) + rhs_assignment = to_variable_assignment(right_hand) else: literal_value = to_variable_value(right_hand) @@ -1480,7 +1480,7 @@ def mutate( lhs_json_path=left_hand.json_path, operation=operation, node_output=node_output, - source_variable=source_variable, + rhs_assignment=rhs_assignment, literal_value=literal_value, ) diff --git a/server/src/main/java/io/littlehorse/common/model/getable/core/wfrun/ThreadRunModel.java b/server/src/main/java/io/littlehorse/common/model/getable/core/wfrun/ThreadRunModel.java index 1ca43cd8c..ef2637e66 100644 --- a/server/src/main/java/io/littlehorse/common/model/getable/core/wfrun/ThreadRunModel.java +++ b/server/src/main/java/io/littlehorse/common/model/getable/core/wfrun/ThreadRunModel.java @@ -857,7 +857,7 @@ public NodeRunModel getMostRecentNodeRun(String nodeName) throws LHVarSubError { // TODO: We can find a way to optimize this. Range scans are expensive, and also // doing it in this way means that the NodeRun's will be re-put into the GetableManager's // buffer, which could get _very_ expensive. - for (int backwardPosition = currentNodePosition - 1; backwardPosition > 0; backwardPosition--) { + for (int backwardPosition = currentNodePosition; backwardPosition > 0; backwardPosition--) { NodeRunModel nodeRun = this.getNodeRun(backwardPosition); if (nodeRun.getNodeName().equals(nodeName)) { return nodeRun; diff --git a/server/src/main/java/io/littlehorse/common/model/getable/global/wfspec/variable/VariableMutationModel.java b/server/src/main/java/io/littlehorse/common/model/getable/global/wfspec/variable/VariableMutationModel.java index 264cbd0f9..dc17ff822 100644 --- a/server/src/main/java/io/littlehorse/common/model/getable/global/wfspec/variable/VariableMutationModel.java +++ b/server/src/main/java/io/littlehorse/common/model/getable/global/wfspec/variable/VariableMutationModel.java @@ -26,7 +26,7 @@ public class VariableMutationModel extends LHSerializable { private VariableMutationType operation; private RhsValueCase rhsValueType; - private VariableAssignmentModel rhsSourceVariable; + private VariableAssignmentModel rhsRhsAssignment; private VariableValueModel rhsLiteralValue; private NodeOutputSourceModel nodeOutputSource; @@ -46,8 +46,8 @@ public VariableMutation.Builder toProto() { case LITERAL_VALUE: out.setLiteralValue(rhsLiteralValue.toProto()); break; - case SOURCE_VARIABLE: - out.setSourceVariable(rhsSourceVariable.toProto()); + case RHS_ASSIGNMENT: + out.setRhsAssignment(rhsRhsAssignment.toProto()); break; case NODE_OUTPUT: out.setNodeOutput(nodeOutputSource.toProto()); // just set the flag @@ -71,8 +71,8 @@ public void initFrom(Message proto, ExecutionContext context) { case LITERAL_VALUE: rhsLiteralValue = VariableValueModel.fromProto(p.getLiteralValue(), context); break; - case SOURCE_VARIABLE: - rhsSourceVariable = VariableAssignmentModel.fromProto(p.getSourceVariable(), context); + case RHS_ASSIGNMENT: + rhsRhsAssignment = VariableAssignmentModel.fromProto(p.getRhsAssignment(), context); break; case NODE_OUTPUT: nodeOutputSource = NodeOutputSourceModel.fromProto(p.getNodeOutput(), context); @@ -117,8 +117,8 @@ public VariableValueModel getRhsValue( if (rhsValueType == RhsValueCase.LITERAL_VALUE) { out = rhsLiteralValue; - } else if (rhsValueType == RhsValueCase.SOURCE_VARIABLE) { - out = thread.assignVariable(rhsSourceVariable, txnCache); + } else if (rhsValueType == RhsValueCase.RHS_ASSIGNMENT) { + out = thread.assignVariable(rhsRhsAssignment, txnCache); } else if (rhsValueType == RhsValueCase.NODE_OUTPUT) { out = nodeOutput; if (nodeOutputSource.jsonPath != null) { @@ -168,8 +168,8 @@ public void execute(ThreadRunModel thread, Map txnCa public Set getRequiredVariableNames() { Set out = new HashSet<>(); out.add(lhsName); - if (rhsValueType == RhsValueCase.SOURCE_VARIABLE) { - out.addAll(rhsSourceVariable.getRequiredWfRunVarNames()); + if (rhsValueType == RhsValueCase.RHS_ASSIGNMENT) { + out.addAll(rhsRhsAssignment.getRequiredWfRunVarNames()); } return out; } diff --git a/server/src/test/java/e2e/BasicTest.java b/server/src/test/java/e2e/BasicTest.java index 70960efac..094d1ab96 100644 --- a/server/src/test/java/e2e/BasicTest.java +++ b/server/src/test/java/e2e/BasicTest.java @@ -1,6 +1,7 @@ package e2e; import io.littlehorse.sdk.common.proto.LHStatus; +import io.littlehorse.sdk.wfsdk.WfRunVariable; import io.littlehorse.sdk.wfsdk.Workflow; import io.littlehorse.sdk.wfsdk.internal.WorkflowImpl; import io.littlehorse.sdk.worker.LHTaskMethod; @@ -25,7 +26,8 @@ public void shouldDoBasic() { @LHWorkflow("test-basic") public Workflow getBasic() { return new WorkflowImpl("test-basic", thread -> { - thread.execute("ag-one"); + WfRunVariable asdf = thread.declareBool("asdf"); + asdf.assignTo(thread.execute("ag-one")); }); } From 3e67fa76855ad58b70fb4d1a6b16744c42ef8a8a Mon Sep 17 00:00:00 2001 From: "Bryson G." <114206517+bryson-g@users.noreply.github.com> Date: Tue, 26 Nov 2024 20:06:33 -0800 Subject: [PATCH 2/3] refactor(dashboard): tenant cookie -> dynamic route slug (#1139) - Added `[tenantId]` dynamic route - Moved file directories - Updated broken imports - New `LinkWithTenant` component to prepend `tenantId` to the passed `href` prop. - Ensuring every `redirect` & `router.push` is accounted for with the new route to maintain functionality - Removed use of cookie for holding tenant info --------- Co-authored-by: Hazim Arafa --- dashboard/src/app/(authenticated)/layout.tsx | 28 ------------------- .../(diagram)/components/Diagram.tsx | 2 +- .../components/EdgeTypes/Default.tsx | 0 .../components/EdgeTypes/EdgeDetails.tsx | 0 .../components/EdgeTypes/extractEdges.ts | 0 .../components/EdgeTypes/extractEdges.tsx | 0 .../(diagram)/components/EdgeTypes/index.ts | 0 .../(diagram)/components/Forms/WfRunForm.tsx | 0 .../Forms/components/BaseFormField.tsx | 0 .../Forms/components/FormFields.tsx | 0 .../components/Forms/components/FormInput.tsx | 0 .../Forms/components/FormSelect.tsx | 0 .../Forms/components/FormTextarea.tsx | 0 .../components/Forms/components/formType.ts | 0 .../components/Forms/components/index.tsx | 0 .../components/Forms/components/validation.ts | 0 .../(diagram)/components/Layouter.tsx | 2 +- .../(diagram)/components/Modals/Edge.tsx | 0 .../components/Modals/ExecuteWorkflowRun.tsx | 9 +++--- .../(diagram)/components/Modals/Modals.tsx | 0 .../Modals/NodeRun/AccordionContent.ts | 2 +- .../Modals/NodeRun/AccordionItem.tsx | 6 ++-- .../Modals/NodeRun/ExternalEventDefDetail.tsx | 0 .../components/Modals/NodeRun/NodeRun.tsx | 0 .../Modals/NodeRun/SleepDefDetail.tsx | 0 .../Modals/NodeRun/StartThreadDefDetail.tsx | 0 .../Modals/NodeRun/TaskDefDetail.tsx | 0 .../Modals/NodeRun/UserTaskDefDetail.tsx | 10 +++---- .../Modals/NodeRun/WaitForThreadDefDetail.tsx | 0 .../Modals/NodeRun/WorkflowEventDefDetail.tsx | 19 ++++++------- .../components/Modals/NodeRun/index.ts | 0 .../(diagram)/components/Modals/index.ts | 0 .../(diagram)/components/NodeRunsList.tsx | 6 ++-- .../components/NodeTypes/Entrypoint.tsx | 0 .../(diagram)/components/NodeTypes/Exit.tsx | 0 .../NodeTypes/ExternalEvent/ExternalEvent.tsx | 6 ++-- .../ExternalEvent/getExternalEvent.ts | 0 .../(diagram)/components/NodeTypes/Fade.tsx | 0 .../components/NodeTypes/NodeDetails.tsx | 0 .../components/NodeTypes/Nop/Nop.tsx | 0 .../components/NodeTypes/Nop/index.tsx | 0 .../components/NodeTypes/Nop/nopHandles.ts | 0 .../components/NodeTypes/Sleep/Sleep.tsx | 0 .../NodeTypes/Sleep/SleepDetails.tsx | 4 +-- .../components/NodeTypes/Sleep/index.ts | 0 .../NodeTypes/StartMultipleThreads.tsx | 0 .../components/NodeTypes/StartThread.tsx | 3 +- .../components/NodeTypes/StatusPin.tsx | 0 .../components/NodeTypes/Task/Task.tsx | 0 .../components/NodeTypes/Task/TaskDetails.tsx | 14 +++++----- .../components/NodeTypes/Task/getTaskRun.ts | 0 .../components/NodeTypes/Task/index.ts | 0 .../NodeTypes/ThrowEvent/ThrowEvent.tsx | 6 ++-- .../NodeTypes/ThrowEvent/getWorkflowEvent.tsx | 0 .../components/NodeTypes/ThrowEvent/index.ts | 0 .../UserTask/UserAndGroupAssignmentInfo.tsx | 0 .../NodeTypes/UserTask/UserTask.tsx | 10 +++---- .../NodeTypes/UserTask/UserTaskDefDetails.tsx | 2 +- .../NodeTypes/UserTask/UserTaskNotes.tsx | 0 .../NodeTypes/UserTask/getUserTaskRun.ts | 0 .../components/NodeTypes/UserTask/index.ts | 0 .../components/NodeTypes/WaitForThreads.tsx | 2 +- .../components/NodeTypes/extractNodes.ts | 0 .../(diagram)/components/NodeTypes/index.ts | 0 .../(diagram)/components/ThreadPanel.tsx | 0 .../(diagram)/context/ModalContext.tsx | 0 .../(diagram)/context/ThreadContext.tsx | 0 .../(diagram)/context/index.ts | 0 .../(diagram)/hooks/useModal.tsx | 0 .../(diagram)/hooks/useReplaceQueryValue.tsx | 0 .../(diagram)/hooks/useScrollbar.tsx | 0 .../(diagram)/hooks/useThread.tsx | 0 .../(diagram)/layout.tsx | 0 .../wfRun/[...ids]/components/Details.tsx | 10 +++---- .../wfRun/[...ids]/components/Variables.tsx | 0 .../wfRun/[...ids]/components/WfRun.tsx | 4 +-- .../(diagram)/wfRun/[...ids]/getWfRun.ts | 5 ++-- .../(diagram)/wfRun/[...ids]/page.tsx | 6 ++-- .../[...props]/actions/ScheduleWfRun.ts | 0 .../[...props]/actions/getScheduleWfSpec.ts | 0 .../wfSpec/[...props]/actions/getVersions.ts | 0 .../wfSpec/[...props]/actions/getWfSpec.ts | 0 .../wfSpec/[...props]/actions/runWfSpec.ts | 0 .../[...props]/actions/searchVariables.ts | 0 .../wfSpec/[...props]/actions/searchWfRun.ts | 0 .../wfSpec/[...props]/components/Details.tsx | 0 .../[...props]/components/Mutations.tsx | 0 .../components/SearchVariableDialog.tsx | 12 ++++---- .../wfSpec/[...props]/components/Thread.tsx | 0 .../[...props]/components/Variables.tsx | 0 .../wfSpec/[...props]/components/Versions.tsx | 5 ++-- .../wfSpec/[...props]/components/WfRuns.tsx | 16 ++++++----- .../[...props]/components/WfRunsHeader.tsx | 12 +++++--- .../wfSpec/[...props]/components/WfSpec.tsx | 6 ++-- .../(diagram)/wfSpec/[...props]/page.tsx | 7 ++--- .../components/Header.tsx | 7 +++-- .../[tenantId]/components/LinkWithTenant.tsx | 11 ++++++++ .../components/Navigation.tsx | 6 ++-- .../components/Principal.tsx | 0 .../components/QueryProvider.tsx | 0 .../components/Search.tsx | 8 ++---- .../components/SearchFooter.tsx | 0 .../components/SearchHeader.tsx | 12 ++++++-- .../components/TenantSelector.tsx | 24 ++++++++-------- .../components/VersionSelector.tsx | 4 +-- .../components/searchAction.ts | 0 .../tables/ExternalEventDefTable.tsx | 6 ++-- .../components/tables/TaskDefTable.tsx | 9 ++++-- .../components/tables/UserTaskDefTable.tsx | 19 +++++++------ .../components/tables/WfSpecTable.tsx | 15 +++++----- .../tables/WorkflowEventDefTable.tsx | 9 ++++-- .../components/tables/index.ts | 0 .../{(authenticated) => [tenantId]}/error.tsx | 0 .../[name]/actions/searchExternalEvent.ts | 0 .../[name]/components/Details.tsx | 0 .../[name]/components/ExternalEventDef.tsx | 14 +++++----- .../[name]/getExternalEventDef.ts | 4 +-- .../externalEventDef/[name]/page.tsx | 6 ++-- .../{(authenticated) => [tenantId]}/page.tsx | 0 .../taskDef/[name]/actions/searchTaskRun.ts | 0 .../taskDef/[name]/components/Details.tsx | 0 .../taskDef/[name]/components/InputVars.tsx | 0 .../taskDef/[name]/components/TaskDef.tsx | 14 +++++----- .../taskDef/[name]/getTaskDef.ts | 4 +-- .../taskDef/[name]/page.tsx | 6 ++-- .../[...props]/actions/searchUserTaskRun.ts | 0 .../[...props]/components/Details.tsx | 0 .../[...props]/components/Fields.tsx | 0 .../[...props]/components/UserTaskDef.tsx | 16 +++++------ .../[...props]/components/Versions.tsx | 5 ++-- .../[...props]/components/getVersions.ts | 0 .../userTaskDef/[...props]/getUserTaskDef.ts | 0 .../userTaskDef/[...props]/page.tsx | 0 .../[name]/actions/searchWorkflowEvent.ts | 0 .../[name]/components/Details.tsx | 0 .../[name]/components/WorkflowEventDef.tsx | 14 +++++----- .../[name]/getWorkflowEventDef.ts | 4 +-- .../workflowEventDef/[name]/page.tsx | 6 ++-- dashboard/src/app/layout.tsx | 27 ++++++++++++++---- dashboard/src/app/page.tsx | 17 +++++++++++ dashboard/src/contexts/WhoAmIContext.tsx | 9 +----- dashboard/src/middleware.ts | 1 - dashboard/src/setTenant.ts | 6 ---- 143 files changed, 253 insertions(+), 244 deletions(-) delete mode 100644 dashboard/src/app/(authenticated)/layout.tsx rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/Diagram.tsx (97%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/EdgeTypes/Default.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/EdgeTypes/EdgeDetails.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/EdgeTypes/extractEdges.ts (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/EdgeTypes/extractEdges.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/EdgeTypes/index.ts (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/Forms/WfRunForm.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/Forms/components/BaseFormField.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/Forms/components/FormFields.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/Forms/components/FormInput.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/Forms/components/FormSelect.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/Forms/components/FormTextarea.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/Forms/components/formType.ts (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/Forms/components/index.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/Forms/components/validation.ts (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/Layouter.tsx (97%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/Modals/Edge.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/Modals/ExecuteWorkflowRun.tsx (93%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/Modals/Modals.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/Modals/NodeRun/AccordionContent.ts (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/Modals/NodeRun/AccordionItem.tsx (98%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/Modals/NodeRun/ExternalEventDefDetail.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/Modals/NodeRun/NodeRun.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/Modals/NodeRun/SleepDefDetail.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/Modals/NodeRun/StartThreadDefDetail.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/Modals/NodeRun/TaskDefDetail.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/Modals/NodeRun/UserTaskDefDetail.tsx (96%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/Modals/NodeRun/WaitForThreadDefDetail.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/Modals/NodeRun/WorkflowEventDefDetail.tsx (86%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/Modals/NodeRun/index.ts (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/Modals/index.ts (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/NodeRunsList.tsx (87%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/NodeTypes/Entrypoint.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/NodeTypes/Exit.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/NodeTypes/ExternalEvent/ExternalEvent.tsx (95%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/NodeTypes/ExternalEvent/getExternalEvent.ts (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/NodeTypes/Fade.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/NodeTypes/NodeDetails.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/NodeTypes/Nop/Nop.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/NodeTypes/Nop/index.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/NodeTypes/Nop/nopHandles.ts (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/NodeTypes/Sleep/Sleep.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/NodeTypes/Sleep/SleepDetails.tsx (95%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/NodeTypes/Sleep/index.ts (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/NodeTypes/StartMultipleThreads.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/NodeTypes/StartThread.tsx (95%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/NodeTypes/StatusPin.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/NodeTypes/Task/Task.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/NodeTypes/Task/TaskDetails.tsx (91%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/NodeTypes/Task/getTaskRun.ts (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/NodeTypes/Task/index.ts (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/NodeTypes/ThrowEvent/ThrowEvent.tsx (94%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/NodeTypes/ThrowEvent/getWorkflowEvent.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/NodeTypes/ThrowEvent/index.ts (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/NodeTypes/UserTask/UserAndGroupAssignmentInfo.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/NodeTypes/UserTask/UserTask.tsx (88%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/NodeTypes/UserTask/UserTaskDefDetails.tsx (80%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/NodeTypes/UserTask/UserTaskNotes.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/NodeTypes/UserTask/getUserTaskRun.ts (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/NodeTypes/UserTask/index.ts (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/NodeTypes/WaitForThreads.tsx (95%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/NodeTypes/extractNodes.ts (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/NodeTypes/index.ts (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/components/ThreadPanel.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/context/ModalContext.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/context/ThreadContext.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/context/index.ts (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/hooks/useModal.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/hooks/useReplaceQueryValue.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/hooks/useScrollbar.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/hooks/useThread.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/layout.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/wfRun/[...ids]/components/Details.tsx (86%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/wfRun/[...ids]/components/Variables.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/wfRun/[...ids]/components/WfRun.tsx (87%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/wfRun/[...ids]/getWfRun.ts (89%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/wfRun/[...ids]/page.tsx (72%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/wfSpec/[...props]/actions/ScheduleWfRun.ts (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/wfSpec/[...props]/actions/getScheduleWfSpec.ts (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/wfSpec/[...props]/actions/getVersions.ts (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/wfSpec/[...props]/actions/getWfSpec.ts (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/wfSpec/[...props]/actions/runWfSpec.ts (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/wfSpec/[...props]/actions/searchVariables.ts (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/wfSpec/[...props]/actions/searchWfRun.ts (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/wfSpec/[...props]/components/Details.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/wfSpec/[...props]/components/Mutations.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/wfSpec/[...props]/components/SearchVariableDialog.tsx (93%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/wfSpec/[...props]/components/Thread.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/wfSpec/[...props]/components/Variables.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/wfSpec/[...props]/components/Versions.tsx (82%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/wfSpec/[...props]/components/WfRuns.tsx (85%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/wfSpec/[...props]/components/WfRunsHeader.tsx (87%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/wfSpec/[...props]/components/WfSpec.tsx (94%) rename dashboard/src/app/{(authenticated) => [tenantId]}/(diagram)/wfSpec/[...props]/page.tsx (81%) rename dashboard/src/app/{(authenticated) => [tenantId]}/components/Header.tsx (82%) create mode 100644 dashboard/src/app/[tenantId]/components/LinkWithTenant.tsx rename dashboard/src/app/{(authenticated) => [tenantId]}/components/Navigation.tsx (69%) rename dashboard/src/app/{(authenticated) => [tenantId]}/components/Principal.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/components/QueryProvider.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/components/Search.tsx (91%) rename dashboard/src/app/{(authenticated) => [tenantId]}/components/SearchFooter.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/components/SearchHeader.tsx (81%) rename dashboard/src/app/{(authenticated) => [tenantId]}/components/TenantSelector.tsx (82%) rename dashboard/src/app/{(authenticated) => [tenantId]}/components/VersionSelector.tsx (94%) rename dashboard/src/app/{(authenticated) => [tenantId]}/components/searchAction.ts (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/components/tables/ExternalEventDefTable.tsx (78%) rename dashboard/src/app/{(authenticated) => [tenantId]}/components/tables/TaskDefTable.tsx (71%) rename dashboard/src/app/{(authenticated) => [tenantId]}/components/tables/UserTaskDefTable.tsx (50%) rename dashboard/src/app/{(authenticated) => [tenantId]}/components/tables/WfSpecTable.tsx (87%) rename dashboard/src/app/{(authenticated) => [tenantId]}/components/tables/WorkflowEventDefTable.tsx (72%) rename dashboard/src/app/{(authenticated) => [tenantId]}/components/tables/index.ts (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/error.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/externalEventDef/[name]/actions/searchExternalEvent.ts (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/externalEventDef/[name]/components/Details.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/externalEventDef/[name]/components/ExternalEventDef.tsx (93%) rename dashboard/src/app/{(authenticated) => [tenantId]}/externalEventDef/[name]/getExternalEventDef.ts (54%) rename dashboard/src/app/{(authenticated) => [tenantId]}/externalEventDef/[name]/page.tsx (75%) rename dashboard/src/app/{(authenticated) => [tenantId]}/page.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/taskDef/[name]/actions/searchTaskRun.ts (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/taskDef/[name]/components/Details.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/taskDef/[name]/components/InputVars.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/taskDef/[name]/components/TaskDef.tsx (93%) rename dashboard/src/app/{(authenticated) => [tenantId]}/taskDef/[name]/getTaskDef.ts (72%) rename dashboard/src/app/{(authenticated) => [tenantId]}/taskDef/[name]/page.tsx (74%) rename dashboard/src/app/{(authenticated) => [tenantId]}/userTaskDef/[...props]/actions/searchUserTaskRun.ts (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/userTaskDef/[...props]/components/Details.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/userTaskDef/[...props]/components/Fields.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/userTaskDef/[...props]/components/UserTaskDef.tsx (94%) rename dashboard/src/app/{(authenticated) => [tenantId]}/userTaskDef/[...props]/components/Versions.tsx (80%) rename dashboard/src/app/{(authenticated) => [tenantId]}/userTaskDef/[...props]/components/getVersions.ts (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/userTaskDef/[...props]/getUserTaskDef.ts (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/userTaskDef/[...props]/page.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/workflowEventDef/[name]/actions/searchWorkflowEvent.ts (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/workflowEventDef/[name]/components/Details.tsx (100%) rename dashboard/src/app/{(authenticated) => [tenantId]}/workflowEventDef/[name]/components/WorkflowEventDef.tsx (93%) rename dashboard/src/app/{(authenticated) => [tenantId]}/workflowEventDef/[name]/getWorkflowEventDef.ts (54%) rename dashboard/src/app/{(authenticated) => [tenantId]}/workflowEventDef/[name]/page.tsx (75%) create mode 100644 dashboard/src/app/page.tsx delete mode 100644 dashboard/src/setTenant.ts diff --git a/dashboard/src/app/(authenticated)/layout.tsx b/dashboard/src/app/(authenticated)/layout.tsx deleted file mode 100644 index c4ce3aab7..000000000 --- a/dashboard/src/app/(authenticated)/layout.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import { WhoAmIContext } from '@/contexts/WhoAmIContext' -import type { Metadata } from 'next' -import { cookies } from 'next/headers' -import getWhoAmI from '../getWhoami' -import { Header } from './components/Header' -import { QueryProvider } from './components/QueryProvider' - -export const metadata: Metadata = { - title: 'LittleHorse | Dashboard', -} - -export default async function RootLayout({ - children, -}: Readonly<{ - children: React.ReactNode -}>) { - const { tenants, user } = await getWhoAmI() - const tenantId = cookies().get('tenantId')?.value - - return ( - -
- -
{children}
-
- - ) -} diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/Diagram.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/Diagram.tsx similarity index 97% rename from dashboard/src/app/(authenticated)/(diagram)/components/Diagram.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/Diagram.tsx index fb775fa9a..030511815 100644 --- a/dashboard/src/app/(authenticated)/(diagram)/components/Diagram.tsx +++ b/dashboard/src/app/[tenantId]/(diagram)/components/Diagram.tsx @@ -1,5 +1,5 @@ 'use client' -import { ThreadRunWithNodeRuns } from '@/app/(authenticated)/(diagram)/wfRun/[...ids]/getWfRun' +import { ThreadRunWithNodeRuns } from '@/app/[tenantId]/(diagram)/wfRun/[...ids]/getWfRun' import { NodeRun, WfRun, WfSpec } from 'littlehorse-client/proto' import { ReadonlyURLSearchParams, useSearchParams } from 'next/navigation' import { FC, useCallback, useEffect, useMemo, useState } from 'react' diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/EdgeTypes/Default.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/EdgeTypes/Default.tsx similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/EdgeTypes/Default.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/EdgeTypes/Default.tsx diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/EdgeTypes/EdgeDetails.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/EdgeTypes/EdgeDetails.tsx similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/EdgeTypes/EdgeDetails.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/EdgeTypes/EdgeDetails.tsx diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/EdgeTypes/extractEdges.ts b/dashboard/src/app/[tenantId]/(diagram)/components/EdgeTypes/extractEdges.ts similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/EdgeTypes/extractEdges.ts rename to dashboard/src/app/[tenantId]/(diagram)/components/EdgeTypes/extractEdges.ts diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/EdgeTypes/extractEdges.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/EdgeTypes/extractEdges.tsx similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/EdgeTypes/extractEdges.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/EdgeTypes/extractEdges.tsx diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/EdgeTypes/index.ts b/dashboard/src/app/[tenantId]/(diagram)/components/EdgeTypes/index.ts similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/EdgeTypes/index.ts rename to dashboard/src/app/[tenantId]/(diagram)/components/EdgeTypes/index.ts diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/Forms/WfRunForm.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/Forms/WfRunForm.tsx similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/Forms/WfRunForm.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/Forms/WfRunForm.tsx diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/Forms/components/BaseFormField.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/Forms/components/BaseFormField.tsx similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/Forms/components/BaseFormField.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/Forms/components/BaseFormField.tsx diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/Forms/components/FormFields.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/Forms/components/FormFields.tsx similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/Forms/components/FormFields.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/Forms/components/FormFields.tsx diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/Forms/components/FormInput.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/Forms/components/FormInput.tsx similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/Forms/components/FormInput.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/Forms/components/FormInput.tsx diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/Forms/components/FormSelect.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/Forms/components/FormSelect.tsx similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/Forms/components/FormSelect.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/Forms/components/FormSelect.tsx diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/Forms/components/FormTextarea.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/Forms/components/FormTextarea.tsx similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/Forms/components/FormTextarea.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/Forms/components/FormTextarea.tsx diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/Forms/components/formType.ts b/dashboard/src/app/[tenantId]/(diagram)/components/Forms/components/formType.ts similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/Forms/components/formType.ts rename to dashboard/src/app/[tenantId]/(diagram)/components/Forms/components/formType.ts diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/Forms/components/index.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/Forms/components/index.tsx similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/Forms/components/index.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/Forms/components/index.tsx diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/Forms/components/validation.ts b/dashboard/src/app/[tenantId]/(diagram)/components/Forms/components/validation.ts similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/Forms/components/validation.ts rename to dashboard/src/app/[tenantId]/(diagram)/components/Forms/components/validation.ts diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/Layouter.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/Layouter.tsx similarity index 97% rename from dashboard/src/app/(authenticated)/(diagram)/components/Layouter.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/Layouter.tsx index 50eed49ba..b020a5e83 100644 --- a/dashboard/src/app/(authenticated)/(diagram)/components/Layouter.tsx +++ b/dashboard/src/app/[tenantId]/(diagram)/components/Layouter.tsx @@ -52,7 +52,7 @@ export const Layouter: FC<{ nodeRuns?: NodeRun[]; nodeRunNameToBeHighlighted?: s setNodes(layoutedNodes) fitView() }, - [fitView, nodeRuns, setNodes] + [fitView, nodeRuns, setNodes, nodeRunNameToBeHighlighted] ) useEffect(() => { diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/Modals/Edge.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/Modals/Edge.tsx similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/Modals/Edge.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/Modals/Edge.tsx diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/Modals/ExecuteWorkflowRun.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/Modals/ExecuteWorkflowRun.tsx similarity index 93% rename from dashboard/src/app/(authenticated)/(diagram)/components/Modals/ExecuteWorkflowRun.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/Modals/ExecuteWorkflowRun.tsx index c99705106..6ee63587a 100644 --- a/dashboard/src/app/(authenticated)/(diagram)/components/Modals/ExecuteWorkflowRun.tsx +++ b/dashboard/src/app/[tenantId]/(diagram)/components/Modals/ExecuteWorkflowRun.tsx @@ -1,4 +1,3 @@ -import { FormValues, WfRunForm } from '@/app/(authenticated)/(diagram)/components/Forms/WfRunForm' import { Button } from '@/components/ui/button' import { Dialog, @@ -9,18 +8,19 @@ import { DialogHeader, DialogTitle, } from '@/components/ui/dialog' -import { useWhoAmI } from '@/contexts/WhoAmIContext' import { ThreadVarDef, VariableType, WfSpec } from 'littlehorse-client/proto' -import { useRouter } from 'next/navigation' +import { useParams, useRouter } from 'next/navigation' import { FC, useRef } from 'react' import { toast } from 'sonner' import { Modal } from '../../context' import { useModal } from '../../hooks/useModal' import { runWfSpec } from '../../wfSpec/[...props]/actions/runWfSpec' +import { FormValues, WfRunForm } from '../Forms/WfRunForm' + export const ExecuteWorkflowRun: FC = ({ data }) => { const { showModal, setShowModal } = useModal() const lhWorkflowSpec = data as WfSpec - const { tenantId } = useWhoAmI() + const tenantId = useParams().tenantId as string const router = useRouter() const formRef = useRef(null) const wfSpecVariables = lhWorkflowSpec.threadSpecs?.entrypoint?.variableDefs @@ -62,7 +62,6 @@ export const ExecuteWorkflowRun: FC = ({ data }) => { wfSpecName: lhWorkflowSpec.id.name, majorVersion: lhWorkflowSpec.id.majorVersion, revision: lhWorkflowSpec.id.revision, - id: customWfRunId || undefined, variables: formatVariablesPayload(values), }) diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/Modals/Modals.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/Modals/Modals.tsx similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/Modals/Modals.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/Modals/Modals.tsx diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/Modals/NodeRun/AccordionContent.ts b/dashboard/src/app/[tenantId]/(diagram)/components/Modals/NodeRun/AccordionContent.ts similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/Modals/NodeRun/AccordionContent.ts rename to dashboard/src/app/[tenantId]/(diagram)/components/Modals/NodeRun/AccordionContent.ts index 028240d51..57c3c5a04 100644 --- a/dashboard/src/app/(authenticated)/(diagram)/components/Modals/NodeRun/AccordionContent.ts +++ b/dashboard/src/app/[tenantId]/(diagram)/components/Modals/NodeRun/AccordionContent.ts @@ -1,4 +1,5 @@ import { NodeRun, UserTaskNode } from 'littlehorse-client/proto' +import { FC } from 'react' import { NodeType } from '../../NodeTypes/extractNodes' import { ExternalEventDefDetail, @@ -9,7 +10,6 @@ import { WaitForThreadDefDetail, WorkflowEventDefDetail, } from './' -import { FC } from 'react' export type AccordionNode = { nodeRun: NodeRun; userTaskNode?: UserTaskNode } type AccordionNodes = { diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/Modals/NodeRun/AccordionItem.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/Modals/NodeRun/AccordionItem.tsx similarity index 98% rename from dashboard/src/app/(authenticated)/(diagram)/components/Modals/NodeRun/AccordionItem.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/Modals/NodeRun/AccordionItem.tsx index 5f590889d..5fb7d1051 100644 --- a/dashboard/src/app/(authenticated)/(diagram)/components/Modals/NodeRun/AccordionItem.tsx +++ b/dashboard/src/app/[tenantId]/(diagram)/components/Modals/NodeRun/AccordionItem.tsx @@ -1,10 +1,10 @@ -import React, { FC } from 'react' -import { AccordionComponents } from './AccordionContent' -import { NodeRun, UserTaskNode } from 'littlehorse-client/proto' import * as AccordionRedux from '@radix-ui/react-accordion' +import { NodeRun, UserTaskNode } from 'littlehorse-client/proto' import { ChevronDownIcon } from 'lucide-react' +import { FC } from 'react' import { statusColors } from '../../../wfRun/[...ids]/components/Details' import { getNodeType } from '../../NodeTypes/extractNodes' +import { AccordionComponents } from './AccordionContent' export const AccordionItem: FC<{ node: NodeRun; userTaskNode?: UserTaskNode }> = ({ node, userTaskNode }) => { const nodeType = getNodeType(node) diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/Modals/NodeRun/ExternalEventDefDetail.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/Modals/NodeRun/ExternalEventDefDetail.tsx similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/Modals/NodeRun/ExternalEventDefDetail.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/Modals/NodeRun/ExternalEventDefDetail.tsx diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/Modals/NodeRun/NodeRun.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/Modals/NodeRun/NodeRun.tsx similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/Modals/NodeRun/NodeRun.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/Modals/NodeRun/NodeRun.tsx diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/Modals/NodeRun/SleepDefDetail.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/Modals/NodeRun/SleepDefDetail.tsx similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/Modals/NodeRun/SleepDefDetail.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/Modals/NodeRun/SleepDefDetail.tsx diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/Modals/NodeRun/StartThreadDefDetail.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/Modals/NodeRun/StartThreadDefDetail.tsx similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/Modals/NodeRun/StartThreadDefDetail.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/Modals/NodeRun/StartThreadDefDetail.tsx diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/Modals/NodeRun/TaskDefDetail.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/Modals/NodeRun/TaskDefDetail.tsx similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/Modals/NodeRun/TaskDefDetail.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/Modals/NodeRun/TaskDefDetail.tsx diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/Modals/NodeRun/UserTaskDefDetail.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/Modals/NodeRun/UserTaskDefDetail.tsx similarity index 96% rename from dashboard/src/app/(authenticated)/(diagram)/components/Modals/NodeRun/UserTaskDefDetail.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/Modals/NodeRun/UserTaskDefDetail.tsx index c93e17998..04c94db98 100644 --- a/dashboard/src/app/(authenticated)/(diagram)/components/Modals/NodeRun/UserTaskDefDetail.tsx +++ b/dashboard/src/app/[tenantId]/(diagram)/components/Modals/NodeRun/UserTaskDefDetail.tsx @@ -1,10 +1,10 @@ -import { FC } from 'react' -import { RefreshCwIcon, ClipboardIcon } from 'lucide-react' +import { getVariable, getVariableValue, utcToLocalDateTime } from '@/app/utils' import { useQuery } from '@tanstack/react-query' -import { UserTaskRunStatus, UserTaskRun as LHUserTaskRun } from 'littlehorse-client/proto' +import { UserTaskRun as LHUserTaskRun, UserTaskRunStatus } from 'littlehorse-client/proto' +import { ClipboardIcon, RefreshCwIcon } from 'lucide-react' +import { FC } from 'react' +import { getUserTaskRun } from '../../NodeTypes/UserTask/getUserTaskRun' import { AccordionNode } from './AccordionContent' -import { getVariableValue, getVariable, utcToLocalDateTime } from '@/app/utils' -import { getUserTaskRun } from '@/app/(authenticated)/(diagram)/components/NodeTypes/UserTask/getUserTaskRun' export const UserTaskDefDetail: FC = ({ nodeRun, userTaskNode }) => { const taskId = nodeRun?.userTask?.userTaskRunId?.userTaskGuid diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/Modals/NodeRun/WaitForThreadDefDetail.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/Modals/NodeRun/WaitForThreadDefDetail.tsx similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/Modals/NodeRun/WaitForThreadDefDetail.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/Modals/NodeRun/WaitForThreadDefDetail.tsx diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/Modals/NodeRun/WorkflowEventDefDetail.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/Modals/NodeRun/WorkflowEventDefDetail.tsx similarity index 86% rename from dashboard/src/app/(authenticated)/(diagram)/components/Modals/NodeRun/WorkflowEventDefDetail.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/Modals/NodeRun/WorkflowEventDefDetail.tsx index 762b42351..559287923 100644 --- a/dashboard/src/app/(authenticated)/(diagram)/components/Modals/NodeRun/WorkflowEventDefDetail.tsx +++ b/dashboard/src/app/[tenantId]/(diagram)/components/Modals/NodeRun/WorkflowEventDefDetail.tsx @@ -1,19 +1,18 @@ -import { FC } from 'react' -import { useWhoAmI } from '@/contexts/WhoAmIContext' -import { RefreshCwIcon, ClipboardIcon } from 'lucide-react' -import { NodeRun } from 'littlehorse-client/proto' -import { useQuery } from '@tanstack/react-query' - -import { cn } from '@/components/utils' import { getVariableValue, utcToLocalDateTime } from '@/app/utils' -import { getWorkflowEvent } from '@/app/(authenticated)/(diagram)/components/NodeTypes/ThrowEvent/getWorkflowEvent' +import { cn } from '@/components/utils' +import { useQuery } from '@tanstack/react-query' +import { NodeRun } from 'littlehorse-client/proto' +import { ClipboardIcon, RefreshCwIcon } from 'lucide-react' +import { useParams } from 'next/navigation' +import { FC } from 'react' +import { getWorkflowEvent } from '../../NodeTypes/ThrowEvent/getWorkflowEvent' export const WorkflowEventDefDetail: FC<{ nodeRun: NodeRun }> = ({ nodeRun }) => { - const { tenantId } = useWhoAmI() + const tenantId = useParams().tenantId as string const wfRunId = nodeRun?.throwEvent?.workflowEventId?.wfRunId?.id const workflowEventDefId = nodeRun?.throwEvent?.workflowEventId const { data, isLoading } = useQuery({ - queryKey: ['taskRun', wfRunId, workflowEventDefId], + queryKey: ['taskRun', wfRunId, workflowEventDefId, tenantId], queryFn: async () => { if (!wfRunId) return if (!workflowEventDefId) return diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/Modals/NodeRun/index.ts b/dashboard/src/app/[tenantId]/(diagram)/components/Modals/NodeRun/index.ts similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/Modals/NodeRun/index.ts rename to dashboard/src/app/[tenantId]/(diagram)/components/Modals/NodeRun/index.ts diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/Modals/index.ts b/dashboard/src/app/[tenantId]/(diagram)/components/Modals/index.ts similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/Modals/index.ts rename to dashboard/src/app/[tenantId]/(diagram)/components/Modals/index.ts diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/NodeRunsList.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/NodeRunsList.tsx similarity index 87% rename from dashboard/src/app/(authenticated)/(diagram)/components/NodeRunsList.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/NodeRunsList.tsx index 14aec0be6..e4ec2102b 100644 --- a/dashboard/src/app/(authenticated)/(diagram)/components/NodeRunsList.tsx +++ b/dashboard/src/app/[tenantId]/(diagram)/components/NodeRunsList.tsx @@ -1,7 +1,7 @@ import { NodeRun, TaskNode, UserTaskNode } from 'littlehorse-client/proto' -import { FC, useCallback } from 'react' import { EyeIcon } from 'lucide-react' -import { useModal } from '@/app/(authenticated)/(diagram)/hooks/useModal' +import { FC, useCallback } from 'react' +import { useModal } from '../hooks/useModal' type Prop = { nodeRuns: [NodeRun] @@ -14,7 +14,7 @@ export const NodeRunsList: FC = ({ nodeRuns, taskNode, userTaskNode, nodeR const showNodeRuns = useCallback(() => { setModal({ type: 'nodeRunList', data: { nodeRunsList: nodeRuns, taskNode, nodeRun, userTaskNode } }) setShowModal(true) - }, [nodeRuns, setModal, setShowModal, taskNode]) + }, [nodeRun, nodeRuns, setModal, setShowModal, taskNode, userTaskNode]) if (!nodeRuns?.length) return diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/Entrypoint.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/Entrypoint.tsx similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/Entrypoint.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/Entrypoint.tsx diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/Exit.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/Exit.tsx similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/Exit.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/Exit.tsx diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/ExternalEvent/ExternalEvent.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/ExternalEvent/ExternalEvent.tsx similarity index 95% rename from dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/ExternalEvent/ExternalEvent.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/ExternalEvent/ExternalEvent.tsx index 789bfa486..5cdc6897d 100644 --- a/dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/ExternalEvent/ExternalEvent.tsx +++ b/dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/ExternalEvent/ExternalEvent.tsx @@ -1,7 +1,6 @@ import { formatTime, getVariableValue } from '@/app/utils' import { Node as NodeProto } from 'littlehorse-client/proto' import { ExternalLinkIcon, MailOpenIcon } from 'lucide-react' -import Link from 'next/link' import { FC, memo } from 'react' import { Handle, Position } from 'reactflow' import { NodeProps } from '..' @@ -10,6 +9,7 @@ import { Fade } from '../Fade' import { NodeDetails } from '../NodeDetails' import { NodeRunsList } from '../../NodeRunsList' +import LinkWithTenant from '@/app/[tenantId]/components/LinkWithTenant' const Node: FC> = ({ data }) => { if (!data.externalEvent) return null @@ -22,13 +22,13 @@ const Node: FC> = ({ data }) => {

ExternalEventDef

- {externalEventNode.externalEventDefId?.name} - +
{
diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/ExternalEvent/getExternalEvent.ts b/dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/ExternalEvent/getExternalEvent.ts similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/ExternalEvent/getExternalEvent.ts rename to dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/ExternalEvent/getExternalEvent.ts diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/Fade.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/Fade.tsx similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/Fade.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/Fade.tsx diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/NodeDetails.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/NodeDetails.tsx similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/NodeDetails.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/NodeDetails.tsx diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/Nop/Nop.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/Nop/Nop.tsx similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/Nop/Nop.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/Nop/Nop.tsx diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/Nop/index.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/Nop/index.tsx similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/Nop/index.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/Nop/index.tsx diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/Nop/nopHandles.ts b/dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/Nop/nopHandles.ts similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/Nop/nopHandles.ts rename to dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/Nop/nopHandles.ts diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/Sleep/Sleep.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/Sleep/Sleep.tsx similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/Sleep/Sleep.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/Sleep/Sleep.tsx diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/Sleep/SleepDetails.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/Sleep/SleepDetails.tsx similarity index 95% rename from dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/Sleep/SleepDetails.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/Sleep/SleepDetails.tsx index 42be469bf..22d8e6b0b 100644 --- a/dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/Sleep/SleepDetails.tsx +++ b/dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/Sleep/SleepDetails.tsx @@ -1,8 +1,8 @@ +import { formatTime, getVariable } from '@/app/utils' import { NodeRun, SleepNode } from 'littlehorse-client/proto' import { FC } from 'react' -import { NodeDetails } from '../NodeDetails' -import { getVariable, formatTime } from '@/app/utils' import { NodeRunsList } from '../../NodeRunsList' +import { NodeDetails } from '../NodeDetails' export const SleepDetails: FC<{ sleepNode?: SleepNode; nodeRunsList: [NodeRun] }> = ({ sleepNode, nodeRunsList }) => { if (!sleepNode) return diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/Sleep/index.ts b/dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/Sleep/index.ts similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/Sleep/index.ts rename to dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/Sleep/index.ts diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/StartMultipleThreads.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/StartMultipleThreads.tsx similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/StartMultipleThreads.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/StartMultipleThreads.tsx diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/StartThread.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/StartThread.tsx similarity index 95% rename from dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/StartThread.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/StartThread.tsx index f6ed7b5c5..3439037ea 100644 --- a/dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/StartThread.tsx +++ b/dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/StartThread.tsx @@ -4,9 +4,10 @@ import { FC, memo } from 'react' import { Handle, Position } from 'reactflow' import { NodeProps } from '.' import { useThread } from '../../hooks/useThread' +import { NodeRunsList } from '../NodeRunsList' import { Fade } from './Fade' import { NodeDetails } from './NodeDetails' -import { NodeRunsList } from '@/app/(authenticated)/(diagram)/components/NodeRunsList' + const Node: FC = ({ data }) => { const { fade, nodeRunsList } = data const { setThread } = useThread() diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/StatusPin.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/StatusPin.tsx similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/StatusPin.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/StatusPin.tsx diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/Task/Task.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/Task/Task.tsx similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/Task/Task.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/Task/Task.tsx diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/Task/TaskDetails.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/Task/TaskDetails.tsx similarity index 91% rename from dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/Task/TaskDetails.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/Task/TaskDetails.tsx index 1120b1d22..2f9bde41a 100644 --- a/dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/Task/TaskDetails.tsx +++ b/dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/Task/TaskDetails.tsx @@ -1,10 +1,10 @@ -import { getTaskDef } from '@/app/(authenticated)/taskDef/[name]/getTaskDef' +import LinkWithTenant from '@/app/[tenantId]/components/LinkWithTenant' +import { getTaskDef } from '@/app/[tenantId]/taskDef/[name]/getTaskDef' import { getVariable, getVariableValue } from '@/app/utils' -import { useWhoAmI } from '@/contexts/WhoAmIContext' import { useQuery } from '@tanstack/react-query' import { NodeRun, TaskNode } from 'littlehorse-client/proto' import { ExternalLinkIcon } from 'lucide-react' -import Link from 'next/link' +import { useParams } from 'next/navigation' import { FC } from 'react' import { NodeRunsList } from '../../NodeRunsList' import { NodeDetails } from '../NodeDetails' @@ -16,7 +16,7 @@ export const TaskDetails: FC<{ selected: boolean nodeRunsList: [NodeRun] }> = ({ taskNode, nodeRun, selected, nodeRunsList }) => { - const { tenantId } = useWhoAmI() + const tenantId = useParams().tenantId as string const { data } = useQuery({ queryKey: ['taskRun', nodeRun, tenantId], queryFn: async () => { @@ -31,7 +31,7 @@ export const TaskDetails: FC<{ if (!taskNode?.taskDefId?.name) return null if (nodeRun?.task?.taskRunId) return null if (!selected) return null - const taskDef = await getTaskDef({ + const taskDef = await getTaskDef(tenantId, { name: taskNode?.taskDefId?.name, }) return taskDef @@ -95,12 +95,12 @@ export const TaskDetails: FC<{ export const TaskLink: FC<{ taskName?: string }> = ({ taskName }) => { return ( - {taskName} - + ) } diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/Task/getTaskRun.ts b/dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/Task/getTaskRun.ts similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/Task/getTaskRun.ts rename to dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/Task/getTaskRun.ts diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/Task/index.ts b/dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/Task/index.ts similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/Task/index.ts rename to dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/Task/index.ts diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/ThrowEvent/ThrowEvent.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/ThrowEvent/ThrowEvent.tsx similarity index 94% rename from dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/ThrowEvent/ThrowEvent.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/ThrowEvent/ThrowEvent.tsx index 9cae9ee49..5d14c9de6 100644 --- a/dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/ThrowEvent/ThrowEvent.tsx +++ b/dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/ThrowEvent/ThrowEvent.tsx @@ -1,10 +1,10 @@ import { Node as NodeProto } from 'littlehorse-client/proto' import { CircleArrowOutUpRightIcon, ExternalLinkIcon } from 'lucide-react' -import Link from 'next/link' import { FC, memo } from 'react' import { Handle, Position } from 'reactflow' import { NodeProps } from '..' +import LinkWithTenant from '@/app/[tenantId]/components/LinkWithTenant' import { Fade } from '../Fade' import { NodeDetails } from '../NodeDetails' @@ -21,13 +21,13 @@ const Node: FC> = ({ data }) => {

WorkflowEventDef

- {throwEventNode.eventDefId?.name} - +
diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/ThrowEvent/getWorkflowEvent.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/ThrowEvent/getWorkflowEvent.tsx similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/ThrowEvent/getWorkflowEvent.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/ThrowEvent/getWorkflowEvent.tsx diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/ThrowEvent/index.ts b/dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/ThrowEvent/index.ts similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/ThrowEvent/index.ts rename to dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/ThrowEvent/index.ts diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/UserTask/UserAndGroupAssignmentInfo.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/UserTask/UserAndGroupAssignmentInfo.tsx similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/UserTask/UserAndGroupAssignmentInfo.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/UserTask/UserAndGroupAssignmentInfo.tsx diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/UserTask/UserTask.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/UserTask/UserTask.tsx similarity index 88% rename from dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/UserTask/UserTask.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/UserTask/UserTask.tsx index 3abf045c3..4f502cdc4 100644 --- a/dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/UserTask/UserTask.tsx +++ b/dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/UserTask/UserTask.tsx @@ -1,12 +1,12 @@ -import { UserTaskDefDetails } from '@/app/(authenticated)/(diagram)/components/NodeTypes/UserTask/UserTaskDefDetails' +import { UserTaskDefDetails } from '@/app/[tenantId]/(diagram)/components/NodeTypes/UserTask/UserTaskDefDetails' +import LinkWithTenant from '@/app/[tenantId]/components/LinkWithTenant' import { ExternalLinkIcon, UserIcon } from 'lucide-react' -import Link from 'next/link' import { FC, memo } from 'react' import { Handle, Position } from 'reactflow' +import { NodeRunsList } from '../../NodeRunsList' import { Fade } from '../Fade' import { NodeProps } from '../index' import { NodeDetails } from '../NodeDetails' -import { NodeRunsList } from '../../NodeRunsList' const Node: FC = ({ data, selected }) => { if (!data.userTask) return null @@ -18,13 +18,13 @@ const Node: FC = ({ data, selected }) => {

UserTask

- {userTask.userTaskDefName} - +
{nodeRun ? ( diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/UserTask/UserTaskDefDetails.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/UserTask/UserTaskDefDetails.tsx similarity index 80% rename from dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/UserTask/UserTaskDefDetails.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/UserTask/UserTaskDefDetails.tsx index 6b4674417..dfa7ef909 100644 --- a/dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/UserTask/UserTaskDefDetails.tsx +++ b/dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/UserTask/UserTaskDefDetails.tsx @@ -1,4 +1,4 @@ -import { UserAndGroupAssignmentInfo } from '@/app/(authenticated)/(diagram)/components/NodeTypes/UserTask/UserAndGroupAssignmentInfo' +import { UserAndGroupAssignmentInfo } from '@/app/[tenantId]/(diagram)/components/NodeTypes/UserTask/UserAndGroupAssignmentInfo' import { getVariable } from '@/app/utils' import { UserTaskNode } from 'littlehorse-client/proto' import { FC } from 'react' diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/UserTask/UserTaskNotes.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/UserTask/UserTaskNotes.tsx similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/UserTask/UserTaskNotes.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/UserTask/UserTaskNotes.tsx diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/UserTask/getUserTaskRun.ts b/dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/UserTask/getUserTaskRun.ts similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/UserTask/getUserTaskRun.ts rename to dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/UserTask/getUserTaskRun.ts diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/UserTask/index.ts b/dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/UserTask/index.ts similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/UserTask/index.ts rename to dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/UserTask/index.ts diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/WaitForThreads.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/WaitForThreads.tsx similarity index 95% rename from dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/WaitForThreads.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/WaitForThreads.tsx index 3946134d1..4fe407968 100644 --- a/dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/WaitForThreads.tsx +++ b/dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/WaitForThreads.tsx @@ -3,9 +3,9 @@ import { PlusIcon } from 'lucide-react' import { FC, memo } from 'react' import { Handle, Position } from 'reactflow' import { NodeProps } from '.' +import { NodeRunsList } from '../NodeRunsList' import { Fade } from './Fade' import { NodeDetails } from './NodeDetails' -import { NodeRunsList } from '@/app/(authenticated)/(diagram)/components/NodeRunsList' const Node: FC = ({ data }) => { const { fade, nodeRunsList } = data diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/extractNodes.ts b/dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/extractNodes.ts similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/extractNodes.ts rename to dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/extractNodes.ts diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/index.ts b/dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/index.ts similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/NodeTypes/index.ts rename to dashboard/src/app/[tenantId]/(diagram)/components/NodeTypes/index.ts diff --git a/dashboard/src/app/(authenticated)/(diagram)/components/ThreadPanel.tsx b/dashboard/src/app/[tenantId]/(diagram)/components/ThreadPanel.tsx similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/components/ThreadPanel.tsx rename to dashboard/src/app/[tenantId]/(diagram)/components/ThreadPanel.tsx diff --git a/dashboard/src/app/(authenticated)/(diagram)/context/ModalContext.tsx b/dashboard/src/app/[tenantId]/(diagram)/context/ModalContext.tsx similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/context/ModalContext.tsx rename to dashboard/src/app/[tenantId]/(diagram)/context/ModalContext.tsx diff --git a/dashboard/src/app/(authenticated)/(diagram)/context/ThreadContext.tsx b/dashboard/src/app/[tenantId]/(diagram)/context/ThreadContext.tsx similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/context/ThreadContext.tsx rename to dashboard/src/app/[tenantId]/(diagram)/context/ThreadContext.tsx diff --git a/dashboard/src/app/(authenticated)/(diagram)/context/index.ts b/dashboard/src/app/[tenantId]/(diagram)/context/index.ts similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/context/index.ts rename to dashboard/src/app/[tenantId]/(diagram)/context/index.ts diff --git a/dashboard/src/app/(authenticated)/(diagram)/hooks/useModal.tsx b/dashboard/src/app/[tenantId]/(diagram)/hooks/useModal.tsx similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/hooks/useModal.tsx rename to dashboard/src/app/[tenantId]/(diagram)/hooks/useModal.tsx diff --git a/dashboard/src/app/(authenticated)/(diagram)/hooks/useReplaceQueryValue.tsx b/dashboard/src/app/[tenantId]/(diagram)/hooks/useReplaceQueryValue.tsx similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/hooks/useReplaceQueryValue.tsx rename to dashboard/src/app/[tenantId]/(diagram)/hooks/useReplaceQueryValue.tsx diff --git a/dashboard/src/app/(authenticated)/(diagram)/hooks/useScrollbar.tsx b/dashboard/src/app/[tenantId]/(diagram)/hooks/useScrollbar.tsx similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/hooks/useScrollbar.tsx rename to dashboard/src/app/[tenantId]/(diagram)/hooks/useScrollbar.tsx diff --git a/dashboard/src/app/(authenticated)/(diagram)/hooks/useThread.tsx b/dashboard/src/app/[tenantId]/(diagram)/hooks/useThread.tsx similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/hooks/useThread.tsx rename to dashboard/src/app/[tenantId]/(diagram)/hooks/useThread.tsx diff --git a/dashboard/src/app/(authenticated)/(diagram)/layout.tsx b/dashboard/src/app/[tenantId]/(diagram)/layout.tsx similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/layout.tsx rename to dashboard/src/app/[tenantId]/(diagram)/layout.tsx diff --git a/dashboard/src/app/(authenticated)/(diagram)/wfRun/[...ids]/components/Details.tsx b/dashboard/src/app/[tenantId]/(diagram)/wfRun/[...ids]/components/Details.tsx similarity index 86% rename from dashboard/src/app/(authenticated)/(diagram)/wfRun/[...ids]/components/Details.tsx rename to dashboard/src/app/[tenantId]/(diagram)/wfRun/[...ids]/components/Details.tsx index 83ee05701..b573821f3 100644 --- a/dashboard/src/app/(authenticated)/(diagram)/wfRun/[...ids]/components/Details.tsx +++ b/dashboard/src/app/[tenantId]/(diagram)/wfRun/[...ids]/components/Details.tsx @@ -1,7 +1,7 @@ 'use client' +import LinkWithTenant from '@/app/[tenantId]/components/LinkWithTenant' import { concatWfRunIds, formatDate } from '@/app/utils' import { WfRun } from 'littlehorse-client/proto' -import Link from 'next/link' import { FC } from 'react' type DetailsProps = WfRun @@ -25,20 +25,18 @@ export const Details: FC = ({ id, status, wfSpecId, startTime }) = {id?.parentWfRunId && (
Parent WfRun: - - {id?.parentWfRunId?.id} - + {id?.parentWfRunId?.id}
)}
WfSpec: - {`${wfSpecId?.name} ${wfSpecId?.majorVersion}.${wfSpecId?.revision}`} - +
Status: {`${status}`} diff --git a/dashboard/src/app/(authenticated)/(diagram)/wfRun/[...ids]/components/Variables.tsx b/dashboard/src/app/[tenantId]/(diagram)/wfRun/[...ids]/components/Variables.tsx similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/wfRun/[...ids]/components/Variables.tsx rename to dashboard/src/app/[tenantId]/(diagram)/wfRun/[...ids]/components/Variables.tsx diff --git a/dashboard/src/app/(authenticated)/(diagram)/wfRun/[...ids]/components/WfRun.tsx b/dashboard/src/app/[tenantId]/(diagram)/wfRun/[...ids]/components/WfRun.tsx similarity index 87% rename from dashboard/src/app/(authenticated)/(diagram)/wfRun/[...ids]/components/WfRun.tsx rename to dashboard/src/app/[tenantId]/(diagram)/wfRun/[...ids]/components/WfRun.tsx index 68c8b783d..04e666bf6 100644 --- a/dashboard/src/app/(authenticated)/(diagram)/wfRun/[...ids]/components/WfRun.tsx +++ b/dashboard/src/app/[tenantId]/(diagram)/wfRun/[...ids]/components/WfRun.tsx @@ -1,6 +1,6 @@ 'use client' -import { Diagram } from '@/app/(authenticated)/(diagram)/components/Diagram' -import { Navigation } from '@/app/(authenticated)/components/Navigation' +import { Diagram } from '@/app/[tenantId]/(diagram)/components/Diagram' +import { Navigation } from '@/app/[tenantId]/components/Navigation' import { useSearchParams } from 'next/navigation' import { FC } from 'react' import { Modals } from '../../../components/Modals' diff --git a/dashboard/src/app/(authenticated)/(diagram)/wfRun/[...ids]/getWfRun.ts b/dashboard/src/app/[tenantId]/(diagram)/wfRun/[...ids]/getWfRun.ts similarity index 89% rename from dashboard/src/app/(authenticated)/(diagram)/wfRun/[...ids]/getWfRun.ts rename to dashboard/src/app/[tenantId]/(diagram)/wfRun/[...ids]/getWfRun.ts index 8d153b702..921900794 100644 --- a/dashboard/src/app/(authenticated)/(diagram)/wfRun/[...ids]/getWfRun.ts +++ b/dashboard/src/app/[tenantId]/(diagram)/wfRun/[...ids]/getWfRun.ts @@ -2,10 +2,10 @@ import { lhClient } from '@/app/lhClient' import { NodeRun, ThreadRun, Variable, WfRun, WfRunId, WfSpec } from 'littlehorse-client/proto' -import { cookies } from 'next/headers' type Props = { ids: string[] + tenantId: string } export type ThreadRunWithNodeRuns = ThreadRun & { nodeRuns: NodeRun[] } @@ -16,8 +16,7 @@ export type WfRunResponse = { nodeRuns: NodeRun[] variables: Variable[] } -export const getWfRun = async ({ ids }: Props): Promise => { - const tenantId = cookies().get('tenantId')?.value +export const getWfRun = async ({ ids, tenantId }: Props): Promise => { const client = await lhClient({ tenantId }) const wfRunId = ids .reverse() diff --git a/dashboard/src/app/(authenticated)/(diagram)/wfRun/[...ids]/page.tsx b/dashboard/src/app/[tenantId]/(diagram)/wfRun/[...ids]/page.tsx similarity index 72% rename from dashboard/src/app/(authenticated)/(diagram)/wfRun/[...ids]/page.tsx rename to dashboard/src/app/[tenantId]/(diagram)/wfRun/[...ids]/page.tsx index 84970f6b9..7041e9dbc 100644 --- a/dashboard/src/app/(authenticated)/(diagram)/wfRun/[...ids]/page.tsx +++ b/dashboard/src/app/[tenantId]/(diagram)/wfRun/[...ids]/page.tsx @@ -4,11 +4,11 @@ import { ClientError, Status } from 'nice-grpc-common' import { WfRun } from './components/WfRun' import { getWfRun } from './getWfRun' -type Props = { params: { ids: string[] } } +type Props = { params: { ids: string[]; tenantId: string } } -export default async function Page({ params: { ids } }: Props) { +export default async function Page({ params: { ids, tenantId } }: Props) { try { - return + return } catch (error) { if (error instanceof ClientError && error.code === Status.NOT_FOUND) return notFound() throw error diff --git a/dashboard/src/app/(authenticated)/(diagram)/wfSpec/[...props]/actions/ScheduleWfRun.ts b/dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/actions/ScheduleWfRun.ts similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/wfSpec/[...props]/actions/ScheduleWfRun.ts rename to dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/actions/ScheduleWfRun.ts diff --git a/dashboard/src/app/(authenticated)/(diagram)/wfSpec/[...props]/actions/getScheduleWfSpec.ts b/dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/actions/getScheduleWfSpec.ts similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/wfSpec/[...props]/actions/getScheduleWfSpec.ts rename to dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/actions/getScheduleWfSpec.ts diff --git a/dashboard/src/app/(authenticated)/(diagram)/wfSpec/[...props]/actions/getVersions.ts b/dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/actions/getVersions.ts similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/wfSpec/[...props]/actions/getVersions.ts rename to dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/actions/getVersions.ts diff --git a/dashboard/src/app/(authenticated)/(diagram)/wfSpec/[...props]/actions/getWfSpec.ts b/dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/actions/getWfSpec.ts similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/wfSpec/[...props]/actions/getWfSpec.ts rename to dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/actions/getWfSpec.ts diff --git a/dashboard/src/app/(authenticated)/(diagram)/wfSpec/[...props]/actions/runWfSpec.ts b/dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/actions/runWfSpec.ts similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/wfSpec/[...props]/actions/runWfSpec.ts rename to dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/actions/runWfSpec.ts diff --git a/dashboard/src/app/(authenticated)/(diagram)/wfSpec/[...props]/actions/searchVariables.ts b/dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/actions/searchVariables.ts similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/wfSpec/[...props]/actions/searchVariables.ts rename to dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/actions/searchVariables.ts diff --git a/dashboard/src/app/(authenticated)/(diagram)/wfSpec/[...props]/actions/searchWfRun.ts b/dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/actions/searchWfRun.ts similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/wfSpec/[...props]/actions/searchWfRun.ts rename to dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/actions/searchWfRun.ts diff --git a/dashboard/src/app/(authenticated)/(diagram)/wfSpec/[...props]/components/Details.tsx b/dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/components/Details.tsx similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/wfSpec/[...props]/components/Details.tsx rename to dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/components/Details.tsx diff --git a/dashboard/src/app/(authenticated)/(diagram)/wfSpec/[...props]/components/Mutations.tsx b/dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/components/Mutations.tsx similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/wfSpec/[...props]/components/Mutations.tsx rename to dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/components/Mutations.tsx diff --git a/dashboard/src/app/(authenticated)/(diagram)/wfSpec/[...props]/components/SearchVariableDialog.tsx b/dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/components/SearchVariableDialog.tsx similarity index 93% rename from dashboard/src/app/(authenticated)/(diagram)/wfSpec/[...props]/components/SearchVariableDialog.tsx rename to dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/components/SearchVariableDialog.tsx index 52747649c..77448b88c 100644 --- a/dashboard/src/app/(authenticated)/(diagram)/wfSpec/[...props]/components/SearchVariableDialog.tsx +++ b/dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/components/SearchVariableDialog.tsx @@ -1,4 +1,5 @@ -import { SearchFooter } from '@/app/(authenticated)/components/SearchFooter' +import LinkWithTenant from '@/app/[tenantId]/components/LinkWithTenant' +import { SearchFooter } from '@/app/[tenantId]/components/SearchFooter' import { Button } from '@/components/ui/button' import { Dialog, @@ -10,12 +11,11 @@ import { } from '@/components/ui/dialog' import { Input } from '@/components/ui/input' import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select' -import { useWhoAmI } from '@/contexts/WhoAmIContext' import { WithBookmark } from '@/types' import { useInfiniteQuery } from '@tanstack/react-query' import { VariableDef, VariableValue, WfSpec } from 'littlehorse-client/proto' import { RefreshCwIcon } from 'lucide-react' -import Link from 'next/link' +import { useParams } from 'next/navigation' import { FC, Fragment, useState } from 'react' import { useDebounce } from 'use-debounce' import { searchVariables } from '../actions/searchVariables' @@ -38,7 +38,7 @@ export const SearchVariableDialog: FC = ({ spec }) => { const [variableValue, setVariableValue] = useState('') const [variableValueDebounced] = useDebounce(variableValue, 250) const [limit, setLimit] = useState(LIMIT) - const { tenantId } = useWhoAmI() + const tenantId = useParams().tenantId as string const { isPending, data, hasNextPage, fetchNextPage } = useInfiniteQuery({ queryKey: ['searchVariables', tenantId, limit, variable, variableValueDebounced], @@ -102,12 +102,12 @@ export const SearchVariableDialog: FC = ({ spec }) => { {page.results.map(variableId => (
- {variableId.wfRunId?.id} - +
))}
diff --git a/dashboard/src/app/(authenticated)/(diagram)/wfSpec/[...props]/components/Thread.tsx b/dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/components/Thread.tsx similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/wfSpec/[...props]/components/Thread.tsx rename to dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/components/Thread.tsx diff --git a/dashboard/src/app/(authenticated)/(diagram)/wfSpec/[...props]/components/Variables.tsx b/dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/components/Variables.tsx similarity index 100% rename from dashboard/src/app/(authenticated)/(diagram)/wfSpec/[...props]/components/Variables.tsx rename to dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/components/Variables.tsx diff --git a/dashboard/src/app/(authenticated)/(diagram)/wfSpec/[...props]/components/Versions.tsx b/dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/components/Versions.tsx similarity index 82% rename from dashboard/src/app/(authenticated)/(diagram)/wfSpec/[...props]/components/Versions.tsx rename to dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/components/Versions.tsx index 470e3819f..78a119e6d 100644 --- a/dashboard/src/app/(authenticated)/(diagram)/wfSpec/[...props]/components/Versions.tsx +++ b/dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/components/Versions.tsx @@ -1,5 +1,4 @@ -import { VersionSelector } from '@/app/(authenticated)/components/VersionSelector' -import { useWhoAmI } from '@/contexts/WhoAmIContext' +import { VersionSelector } from '@/app/[tenantId]/components/VersionSelector' import { WfSpecId } from 'littlehorse-client/proto' import { useParams } from 'next/navigation' import { FC, useCallback, useState } from 'react' @@ -7,9 +6,9 @@ import { getWfSpecVersions } from '../actions/getVersions' export const Versions: FC<{ wfSpecId?: WfSpecId }> = ({ wfSpecId }) => { const [versions, setVersions] = useState([]) - const { tenantId } = useWhoAmI() const { name, majorVersion, revision } = wfSpecId! const { props } = useParams() + const tenantId = useParams().tenantId as string const loadVersions = useCallback(async () => { const { versions } = await getWfSpecVersions({ name, tenantId }) diff --git a/dashboard/src/app/(authenticated)/(diagram)/wfSpec/[...props]/components/WfRuns.tsx b/dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/components/WfRuns.tsx similarity index 85% rename from dashboard/src/app/(authenticated)/(diagram)/wfSpec/[...props]/components/WfRuns.tsx rename to dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/components/WfRuns.tsx index fbd3bec3d..2099bd7b0 100644 --- a/dashboard/src/app/(authenticated)/(diagram)/wfSpec/[...props]/components/WfRuns.tsx +++ b/dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/components/WfRuns.tsx @@ -1,13 +1,12 @@ 'use client' -import { SearchFooter } from '@/app/(authenticated)/components/SearchFooter' +import LinkWithTenant from '@/app/[tenantId]/components/LinkWithTenant' +import { SearchFooter } from '@/app/[tenantId]/components/SearchFooter' import { SEARCH_DEFAULT_LIMIT, TIME_RANGES, TimeRange } from '@/app/constants' import { concatWfRunIds } from '@/app/utils' -import { useWhoAmI } from '@/contexts/WhoAmIContext' import { useInfiniteQuery } from '@tanstack/react-query' import { WfSpec, lHStatusFromJSON } from 'littlehorse-client/proto' import { RefreshCwIcon } from 'lucide-react' -import Link from 'next/link' -import { useSearchParams } from 'next/navigation' +import { useParams, useSearchParams } from 'next/navigation' import { FC, Fragment, useMemo, useState } from 'react' import { PaginatedWfRunIdList, searchWfRun } from '../actions/searchWfRun' import { WfRunsHeader } from './WfRunsHeader' @@ -17,7 +16,7 @@ export const WfRuns: FC = spec => { const status = searchParams.get('status') ? getStatus(searchParams.get('status')) || 'ALL' : 'ALL' const [limit, setLimit] = useState(SEARCH_DEFAULT_LIMIT) const [window, setWindow] = useState(TIME_RANGES[0]) - const { tenantId } = useWhoAmI() + const tenantId = useParams().tenantId as string const startTime = useMemo(() => { if (window === -1) return undefined @@ -63,9 +62,12 @@ export const WfRuns: FC = spec => { {page.results.map(wfRunId => (
- + {wfRunId.id} - +
))}
diff --git a/dashboard/src/app/(authenticated)/(diagram)/wfSpec/[...props]/components/WfRunsHeader.tsx b/dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/components/WfRunsHeader.tsx similarity index 87% rename from dashboard/src/app/(authenticated)/(diagram)/wfSpec/[...props]/components/WfRunsHeader.tsx rename to dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/components/WfRunsHeader.tsx index 207c98e67..dba18d8eb 100644 --- a/dashboard/src/app/(authenticated)/(diagram)/wfSpec/[...props]/components/WfRunsHeader.tsx +++ b/dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/components/WfRunsHeader.tsx @@ -2,9 +2,10 @@ import { TIME_RANGES, TIME_RANGES_NAMES, TimeRange, WF_RUN_STATUSES } from '@/ap import { Listbox, ListboxButton, ListboxOptions } from '@headlessui/react' import { LHStatus, WfSpec } from 'littlehorse-client/proto' import { ClockIcon } from 'lucide-react' -import Link from 'next/link' +import LinkWithTenant from '@/app/[tenantId]/components/LinkWithTenant' import { FC } from 'react' import { SearchVariableDialog } from './SearchVariableDialog' +import { usePathname } from 'next/navigation' type Props = { spec: WfSpec @@ -14,6 +15,9 @@ type Props = { } export const WfRunsHeader: FC = ({ spec, currentStatus, currentWindow, setWindow }) => { + const pathname = usePathname() + const pathWithoutTenant = pathname.replace(/^\/[^/]+/, '') + return (

WfRun Search

@@ -44,15 +48,15 @@ export const WfRunsHeader: FC = ({ spec, currentStatus, currentWindow, se
{['ALL', ...WF_RUN_STATUSES].map(status => ( - {status} - + ))}
{Object.keys(spec.threadSpecs).flatMap(threadSpec => diff --git a/dashboard/src/app/(authenticated)/(diagram)/wfSpec/[...props]/components/WfSpec.tsx b/dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/components/WfSpec.tsx similarity index 94% rename from dashboard/src/app/(authenticated)/(diagram)/wfSpec/[...props]/components/WfSpec.tsx rename to dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/components/WfSpec.tsx index 49320a127..96c492d86 100644 --- a/dashboard/src/app/(authenticated)/(diagram)/wfSpec/[...props]/components/WfSpec.tsx +++ b/dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/components/WfSpec.tsx @@ -1,13 +1,13 @@ 'use client' -import { Navigation } from '@/app/(authenticated)/components/Navigation' +import { Navigation } from '@/app/[tenantId]/components/Navigation' import { ScheduledWfRunIdList, WfSpec as Spec } from 'littlehorse-client/proto' +import { LucidePlayCircle } from 'lucide-react' import { FC, useCallback } from 'react' import { Diagram } from '../../../components/Diagram' +import { useModal } from '../../../hooks/useModal' import { Details } from './Details' import { Thread } from './Thread' import { WfRuns } from './WfRuns' -import { useModal } from '../../../hooks/useModal' -import { LucidePlayCircle } from 'lucide-react' type WfSpecProps = { spec: Spec diff --git a/dashboard/src/app/(authenticated)/(diagram)/wfSpec/[...props]/page.tsx b/dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/page.tsx similarity index 81% rename from dashboard/src/app/(authenticated)/(diagram)/wfSpec/[...props]/page.tsx rename to dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/page.tsx index 10e1480cf..b37d2bde8 100644 --- a/dashboard/src/app/(authenticated)/(diagram)/wfSpec/[...props]/page.tsx +++ b/dashboard/src/app/[tenantId]/(diagram)/wfSpec/[...props]/page.tsx @@ -1,19 +1,18 @@ import { Metadata } from 'next' -import { cookies } from 'next/headers' import { notFound } from 'next/navigation' import { ClientError, Status } from 'nice-grpc-common' import { getWfSpec } from './actions/getWfSpec' import { getScheduleWfSpec } from './actions/getScheduleWfSpec' import { WfSpec } from './components/WfSpec' -type Props = { params: { props: string[] } } +type Props = { params: { props: string[]; tenantId: string } } export const dynamic = 'force-dynamic' -export default async function Page({ params: { props } }: Props) { +export default async function Page({ params: { props, tenantId } }: Props) { const name = props[0] const version = props[1] - const tenantId = cookies().get('tenantId')?.value + try { const wfSpec = await getWfSpec({ tenantId, name, version }) const scheduleWfSpec = await getScheduleWfSpec({ tenantId, name, version }) diff --git a/dashboard/src/app/(authenticated)/components/Header.tsx b/dashboard/src/app/[tenantId]/components/Header.tsx similarity index 82% rename from dashboard/src/app/(authenticated)/components/Header.tsx rename to dashboard/src/app/[tenantId]/components/Header.tsx index ce66ac9a2..994a5403e 100644 --- a/dashboard/src/app/(authenticated)/components/Header.tsx +++ b/dashboard/src/app/[tenantId]/components/Header.tsx @@ -1,8 +1,9 @@ 'use client' -import { FC } from 'react' import LhLogo from '@/littlehorse.svg' +import { FC } from 'react' +import LinkWithTenant from './LinkWithTenant' import { Principal } from './Principal' import { TenantSelector } from './TenantSelector' @@ -10,13 +11,13 @@ export const Header: FC = () => { return (