Skip to content

Commit 910e725

Browse files
authored
move SaveField to help with rust generation (#112)
Signed-off-by: Matt Klein <mklein@bitdrift.io>
1 parent fbf7546 commit 910e725

File tree

2 files changed

+32
-21
lines changed

2 files changed

+32
-21
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// api - bitdrift's client/server API definitions
2+
// Copyright Bitdrift, Inc. All rights reserved.
3+
//
4+
// Use of this source code and APIs are governed by a source available license that can be found in
5+
// the LICENSE file or at:
6+
// https://polyformproject.org/wp-content/uploads/2020/06/PolyForm-Shield-1.0.0.txt
7+
8+
syntax = "proto3";
9+
10+
package bitdrift_public.protobuf.workflow.v1;
11+
12+
// The log's field value, if available, will be snapped, and persisted to the workflow state.
13+
// This can be looked up by ID by further transitions.
14+
message SaveField {
15+
string id = 1;
16+
17+
oneof save_field_type {
18+
// Saves the value of a specified field from the log. If the field is not present, nothing
19+
// is saved.
20+
string field_name = 2;
21+
22+
// Saves the message of the log.
23+
bool message = 3;
24+
}
25+
26+
// If provided, this must specify a regex with a single capture group. The value of the
27+
// captured group will be saved instead of the whole field value. If not provided, the whole
28+
// field value will be saved. If the regex doesn't match the field value, nothing will be
29+
// saved.
30+
optional string regex_capture = 4;
31+
}

src/bitdrift_public/protobuf/workflow/v1/workflow.proto

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ package bitdrift_public.protobuf.workflow.v1;
1212
import "bitdrift_public/protobuf/matcher/v1/log_matcher.proto";
1313
import "bitdrift_public/protobuf/state/v1/matcher.proto";
1414
import "bitdrift_public/protobuf/state/v1/scope.proto";
15+
import "bitdrift_public/protobuf/workflow/v1/save_field.proto";
1516
import "validate/validate.proto";
1617

1718
// The wrapper for the list of workflows. Top-level item used to send information
@@ -110,27 +111,6 @@ message Workflow {
110111
string id = 1;
111112
}
112113

113-
// The log's field value, if available, will be snapped, and persisted to the workflow state.
114-
// This can be looked up by ID by further transitions.
115-
message SaveField {
116-
string id = 1;
117-
118-
oneof save_field_type {
119-
// Saves the value of a specified field from the log. If the field is not present, nothing
120-
// is saved.
121-
string field_name = 2;
122-
123-
// Saves the message of the log.
124-
bool message = 3;
125-
}
126-
127-
// If provided, this must specify a regex with a single capture group. The value of the
128-
// captured group will be saved instead of the whole field value. If not provided, the whole
129-
// field value will be saved. If the regex doesn't match the field value, nothing will be
130-
// saved.
131-
optional string regex_capture = 4;
132-
}
133-
134114
// The configuration of a value extraction for a Sankey diagram.
135115
message SankeyDiagramValueExtraction {
136116
// The ID of the Sankey diagram to extract the value for.

0 commit comments

Comments
 (0)