diff --git a/backend/gen/go/protos/mgmt/v1alpha1/transformer.pb.go b/backend/gen/go/protos/mgmt/v1alpha1/transformer.pb.go
index 367ad7cb17..fdb34e7bf5 100644
--- a/backend/gen/go/protos/mgmt/v1alpha1/transformer.pb.go
+++ b/backend/gen/go/protos/mgmt/v1alpha1/transformer.pb.go
@@ -2426,9 +2426,9 @@ type TransformEmail struct {
unknownFields protoimpl.UnknownFields
// Whether or not to preserve the original domain, barring what has been specified in the excluded_domains property.
- PreserveDomain bool `protobuf:"varint,1,opt,name=preserve_domain,json=preserveDomain,proto3" json:"preserve_domain,omitempty"`
+ PreserveDomain *bool `protobuf:"varint,1,opt,name=preserve_domain,json=preserveDomain,proto3,oneof" json:"preserve_domain,omitempty"`
// Whether or not to preserve the original length of the email. This causes the transformed email to retain the original length.
- PreserveLength bool `protobuf:"varint,2,opt,name=preserve_length,json=preserveLength,proto3" json:"preserve_length,omitempty"`
+ PreserveLength *bool `protobuf:"varint,2,opt,name=preserve_length,json=preserveLength,proto3,oneof" json:"preserve_length,omitempty"`
// A lsit of email domains that should be excluded. This changes based on the preserve_domain flag. See the docs for more details.
ExcludedDomains []string `protobuf:"bytes,3,rep,name=excluded_domains,json=excludedDomains,proto3" json:"excluded_domains,omitempty"`
// Optionally specify the type of email to generate. The types specified determine the contents on the left side of the @.
@@ -2468,15 +2468,15 @@ func (*TransformEmail) Descriptor() ([]byte, []int) {
}
func (x *TransformEmail) GetPreserveDomain() bool {
- if x != nil {
- return x.PreserveDomain
+ if x != nil && x.PreserveDomain != nil {
+ return *x.PreserveDomain
}
return false
}
func (x *TransformEmail) GetPreserveLength() bool {
- if x != nil {
- return x.PreserveLength
+ if x != nil && x.PreserveLength != nil {
+ return *x.PreserveLength
}
return false
}
@@ -2543,7 +2543,7 @@ type GenerateCardNumber struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
- ValidLuhn bool `protobuf:"varint,1,opt,name=valid_luhn,json=validLuhn,proto3" json:"valid_luhn,omitempty"`
+ ValidLuhn *bool `protobuf:"varint,1,opt,name=valid_luhn,json=validLuhn,proto3,oneof" json:"valid_luhn,omitempty"`
}
func (x *GenerateCardNumber) Reset() {
@@ -2577,8 +2577,8 @@ func (*GenerateCardNumber) Descriptor() ([]byte, []int) {
}
func (x *GenerateCardNumber) GetValidLuhn() bool {
- if x != nil {
- return x.ValidLuhn
+ if x != nil && x.ValidLuhn != nil {
+ return *x.ValidLuhn
}
return false
}
@@ -2660,8 +2660,8 @@ type GenerateE164PhoneNumber struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
- Min int64 `protobuf:"varint,1,opt,name=min,proto3" json:"min,omitempty"`
- Max int64 `protobuf:"varint,2,opt,name=max,proto3" json:"max,omitempty"`
+ Min *int64 `protobuf:"varint,1,opt,name=min,proto3,oneof" json:"min,omitempty"`
+ Max *int64 `protobuf:"varint,2,opt,name=max,proto3,oneof" json:"max,omitempty"`
}
func (x *GenerateE164PhoneNumber) Reset() {
@@ -2695,15 +2695,15 @@ func (*GenerateE164PhoneNumber) Descriptor() ([]byte, []int) {
}
func (x *GenerateE164PhoneNumber) GetMin() int64 {
- if x != nil {
- return x.Min
+ if x != nil && x.Min != nil {
+ return *x.Min
}
return 0
}
func (x *GenerateE164PhoneNumber) GetMax() int64 {
- if x != nil {
- return x.Max
+ if x != nil && x.Max != nil {
+ return *x.Max
}
return 0
}
@@ -2749,10 +2749,10 @@ type GenerateFloat64 struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
- RandomizeSign bool `protobuf:"varint,1,opt,name=randomize_sign,json=randomizeSign,proto3" json:"randomize_sign,omitempty"`
- Min float64 `protobuf:"fixed64,2,opt,name=min,proto3" json:"min,omitempty"`
- Max float64 `protobuf:"fixed64,3,opt,name=max,proto3" json:"max,omitempty"`
- Precision int64 `protobuf:"varint,4,opt,name=precision,proto3" json:"precision,omitempty"`
+ RandomizeSign *bool `protobuf:"varint,1,opt,name=randomize_sign,json=randomizeSign,proto3,oneof" json:"randomize_sign,omitempty"`
+ Min *float64 `protobuf:"fixed64,2,opt,name=min,proto3,oneof" json:"min,omitempty"`
+ Max *float64 `protobuf:"fixed64,3,opt,name=max,proto3,oneof" json:"max,omitempty"`
+ Precision *int64 `protobuf:"varint,4,opt,name=precision,proto3,oneof" json:"precision,omitempty"`
}
func (x *GenerateFloat64) Reset() {
@@ -2786,29 +2786,29 @@ func (*GenerateFloat64) Descriptor() ([]byte, []int) {
}
func (x *GenerateFloat64) GetRandomizeSign() bool {
- if x != nil {
- return x.RandomizeSign
+ if x != nil && x.RandomizeSign != nil {
+ return *x.RandomizeSign
}
return false
}
func (x *GenerateFloat64) GetMin() float64 {
- if x != nil {
- return x.Min
+ if x != nil && x.Min != nil {
+ return *x.Min
}
return 0
}
func (x *GenerateFloat64) GetMax() float64 {
- if x != nil {
- return x.Max
+ if x != nil && x.Max != nil {
+ return *x.Max
}
return 0
}
func (x *GenerateFloat64) GetPrecision() int64 {
- if x != nil {
- return x.Precision
+ if x != nil && x.Precision != nil {
+ return *x.Precision
}
return 0
}
@@ -2890,7 +2890,7 @@ type GenerateGender struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
- Abbreviate bool `protobuf:"varint,1,opt,name=abbreviate,proto3" json:"abbreviate,omitempty"`
+ Abbreviate *bool `protobuf:"varint,1,opt,name=abbreviate,proto3,oneof" json:"abbreviate,omitempty"`
}
func (x *GenerateGender) Reset() {
@@ -2924,8 +2924,8 @@ func (*GenerateGender) Descriptor() ([]byte, []int) {
}
func (x *GenerateGender) GetAbbreviate() bool {
- if x != nil {
- return x.Abbreviate
+ if x != nil && x.Abbreviate != nil {
+ return *x.Abbreviate
}
return false
}
@@ -2971,9 +2971,9 @@ type GenerateInt64 struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
- RandomizeSign bool `protobuf:"varint,1,opt,name=randomize_sign,json=randomizeSign,proto3" json:"randomize_sign,omitempty"`
- Min int64 `protobuf:"varint,2,opt,name=min,proto3" json:"min,omitempty"`
- Max int64 `protobuf:"varint,3,opt,name=max,proto3" json:"max,omitempty"`
+ RandomizeSign *bool `protobuf:"varint,1,opt,name=randomize_sign,json=randomizeSign,proto3,oneof" json:"randomize_sign,omitempty"`
+ Min *int64 `protobuf:"varint,2,opt,name=min,proto3,oneof" json:"min,omitempty"`
+ Max *int64 `protobuf:"varint,3,opt,name=max,proto3,oneof" json:"max,omitempty"`
}
func (x *GenerateInt64) Reset() {
@@ -3007,22 +3007,22 @@ func (*GenerateInt64) Descriptor() ([]byte, []int) {
}
func (x *GenerateInt64) GetRandomizeSign() bool {
- if x != nil {
- return x.RandomizeSign
+ if x != nil && x.RandomizeSign != nil {
+ return *x.RandomizeSign
}
return false
}
func (x *GenerateInt64) GetMin() int64 {
- if x != nil {
- return x.Min
+ if x != nil && x.Min != nil {
+ return *x.Min
}
return 0
}
func (x *GenerateInt64) GetMax() int64 {
- if x != nil {
- return x.Max
+ if x != nil && x.Max != nil {
+ return *x.Max
}
return 0
}
@@ -3141,7 +3141,7 @@ type GenerateState struct {
unknownFields protoimpl.UnknownFields
// An option to return the full state name of the randomly selected state or return the default of a 2-letter state code.
- GenerateFullName bool `protobuf:"varint,1,opt,name=generate_full_name,json=generateFullName,proto3" json:"generate_full_name,omitempty"`
+ GenerateFullName *bool `protobuf:"varint,1,opt,name=generate_full_name,json=generateFullName,proto3,oneof" json:"generate_full_name,omitempty"`
}
func (x *GenerateState) Reset() {
@@ -3175,8 +3175,8 @@ func (*GenerateState) Descriptor() ([]byte, []int) {
}
func (x *GenerateState) GetGenerateFullName() bool {
- if x != nil {
- return x.GenerateFullName
+ if x != nil && x.GenerateFullName != nil {
+ return *x.GenerateFullName
}
return false
}
@@ -3222,8 +3222,8 @@ type GenerateStringPhoneNumber struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
- Min int64 `protobuf:"varint,2,opt,name=min,proto3" json:"min,omitempty"`
- Max int64 `protobuf:"varint,3,opt,name=max,proto3" json:"max,omitempty"`
+ Min *int64 `protobuf:"varint,2,opt,name=min,proto3,oneof" json:"min,omitempty"`
+ Max *int64 `protobuf:"varint,3,opt,name=max,proto3,oneof" json:"max,omitempty"`
}
func (x *GenerateStringPhoneNumber) Reset() {
@@ -3257,15 +3257,15 @@ func (*GenerateStringPhoneNumber) Descriptor() ([]byte, []int) {
}
func (x *GenerateStringPhoneNumber) GetMin() int64 {
- if x != nil {
- return x.Min
+ if x != nil && x.Min != nil {
+ return *x.Min
}
return 0
}
func (x *GenerateStringPhoneNumber) GetMax() int64 {
- if x != nil {
- return x.Max
+ if x != nil && x.Max != nil {
+ return *x.Max
}
return 0
}
@@ -3275,8 +3275,8 @@ type GenerateString struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
- Min int64 `protobuf:"varint,1,opt,name=min,proto3" json:"min,omitempty"`
- Max int64 `protobuf:"varint,2,opt,name=max,proto3" json:"max,omitempty"`
+ Min *int64 `protobuf:"varint,1,opt,name=min,proto3,oneof" json:"min,omitempty"`
+ Max *int64 `protobuf:"varint,2,opt,name=max,proto3,oneof" json:"max,omitempty"`
}
func (x *GenerateString) Reset() {
@@ -3310,15 +3310,15 @@ func (*GenerateString) Descriptor() ([]byte, []int) {
}
func (x *GenerateString) GetMin() int64 {
- if x != nil {
- return x.Min
+ if x != nil && x.Min != nil {
+ return *x.Min
}
return 0
}
func (x *GenerateString) GetMax() int64 {
- if x != nil {
- return x.Max
+ if x != nil && x.Max != nil {
+ return *x.Max
}
return 0
}
@@ -3436,7 +3436,7 @@ type GenerateUuid struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
- IncludeHyphens bool `protobuf:"varint,1,opt,name=include_hyphens,json=includeHyphens,proto3" json:"include_hyphens,omitempty"`
+ IncludeHyphens *bool `protobuf:"varint,1,opt,name=include_hyphens,json=includeHyphens,proto3,oneof" json:"include_hyphens,omitempty"`
}
func (x *GenerateUuid) Reset() {
@@ -3470,8 +3470,8 @@ func (*GenerateUuid) Descriptor() ([]byte, []int) {
}
func (x *GenerateUuid) GetIncludeHyphens() bool {
- if x != nil {
- return x.IncludeHyphens
+ if x != nil && x.IncludeHyphens != nil {
+ return *x.IncludeHyphens
}
return false
}
@@ -3517,7 +3517,7 @@ type TransformE164PhoneNumber struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
- PreserveLength bool `protobuf:"varint,1,opt,name=preserve_length,json=preserveLength,proto3" json:"preserve_length,omitempty"`
+ PreserveLength *bool `protobuf:"varint,1,opt,name=preserve_length,json=preserveLength,proto3,oneof" json:"preserve_length,omitempty"`
}
func (x *TransformE164PhoneNumber) Reset() {
@@ -3551,8 +3551,8 @@ func (*TransformE164PhoneNumber) Descriptor() ([]byte, []int) {
}
func (x *TransformE164PhoneNumber) GetPreserveLength() bool {
- if x != nil {
- return x.PreserveLength
+ if x != nil && x.PreserveLength != nil {
+ return *x.PreserveLength
}
return false
}
@@ -3562,7 +3562,7 @@ type TransformFirstName struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
- PreserveLength bool `protobuf:"varint,1,opt,name=preserve_length,json=preserveLength,proto3" json:"preserve_length,omitempty"`
+ PreserveLength *bool `protobuf:"varint,1,opt,name=preserve_length,json=preserveLength,proto3,oneof" json:"preserve_length,omitempty"`
}
func (x *TransformFirstName) Reset() {
@@ -3596,8 +3596,8 @@ func (*TransformFirstName) Descriptor() ([]byte, []int) {
}
func (x *TransformFirstName) GetPreserveLength() bool {
- if x != nil {
- return x.PreserveLength
+ if x != nil && x.PreserveLength != nil {
+ return *x.PreserveLength
}
return false
}
@@ -3607,8 +3607,8 @@ type TransformFloat64 struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
- RandomizationRangeMin float64 `protobuf:"fixed64,1,opt,name=randomization_range_min,json=randomizationRangeMin,proto3" json:"randomization_range_min,omitempty"`
- RandomizationRangeMax float64 `protobuf:"fixed64,2,opt,name=randomization_range_max,json=randomizationRangeMax,proto3" json:"randomization_range_max,omitempty"`
+ RandomizationRangeMin *float64 `protobuf:"fixed64,1,opt,name=randomization_range_min,json=randomizationRangeMin,proto3,oneof" json:"randomization_range_min,omitempty"`
+ RandomizationRangeMax *float64 `protobuf:"fixed64,2,opt,name=randomization_range_max,json=randomizationRangeMax,proto3,oneof" json:"randomization_range_max,omitempty"`
}
func (x *TransformFloat64) Reset() {
@@ -3642,15 +3642,15 @@ func (*TransformFloat64) Descriptor() ([]byte, []int) {
}
func (x *TransformFloat64) GetRandomizationRangeMin() float64 {
- if x != nil {
- return x.RandomizationRangeMin
+ if x != nil && x.RandomizationRangeMin != nil {
+ return *x.RandomizationRangeMin
}
return 0
}
func (x *TransformFloat64) GetRandomizationRangeMax() float64 {
- if x != nil {
- return x.RandomizationRangeMax
+ if x != nil && x.RandomizationRangeMax != nil {
+ return *x.RandomizationRangeMax
}
return 0
}
@@ -3660,7 +3660,7 @@ type TransformFullName struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
- PreserveLength bool `protobuf:"varint,1,opt,name=preserve_length,json=preserveLength,proto3" json:"preserve_length,omitempty"`
+ PreserveLength *bool `protobuf:"varint,1,opt,name=preserve_length,json=preserveLength,proto3,oneof" json:"preserve_length,omitempty"`
}
func (x *TransformFullName) Reset() {
@@ -3694,8 +3694,8 @@ func (*TransformFullName) Descriptor() ([]byte, []int) {
}
func (x *TransformFullName) GetPreserveLength() bool {
- if x != nil {
- return x.PreserveLength
+ if x != nil && x.PreserveLength != nil {
+ return *x.PreserveLength
}
return false
}
@@ -3705,7 +3705,7 @@ type TransformInt64PhoneNumber struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
- PreserveLength bool `protobuf:"varint,1,opt,name=preserve_length,json=preserveLength,proto3" json:"preserve_length,omitempty"`
+ PreserveLength *bool `protobuf:"varint,1,opt,name=preserve_length,json=preserveLength,proto3,oneof" json:"preserve_length,omitempty"`
}
func (x *TransformInt64PhoneNumber) Reset() {
@@ -3739,8 +3739,8 @@ func (*TransformInt64PhoneNumber) Descriptor() ([]byte, []int) {
}
func (x *TransformInt64PhoneNumber) GetPreserveLength() bool {
- if x != nil {
- return x.PreserveLength
+ if x != nil && x.PreserveLength != nil {
+ return *x.PreserveLength
}
return false
}
@@ -3750,8 +3750,8 @@ type TransformInt64 struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
- RandomizationRangeMin int64 `protobuf:"varint,1,opt,name=randomization_range_min,json=randomizationRangeMin,proto3" json:"randomization_range_min,omitempty"`
- RandomizationRangeMax int64 `protobuf:"varint,2,opt,name=randomization_range_max,json=randomizationRangeMax,proto3" json:"randomization_range_max,omitempty"`
+ RandomizationRangeMin *int64 `protobuf:"varint,1,opt,name=randomization_range_min,json=randomizationRangeMin,proto3,oneof" json:"randomization_range_min,omitempty"`
+ RandomizationRangeMax *int64 `protobuf:"varint,2,opt,name=randomization_range_max,json=randomizationRangeMax,proto3,oneof" json:"randomization_range_max,omitempty"`
}
func (x *TransformInt64) Reset() {
@@ -3785,15 +3785,15 @@ func (*TransformInt64) Descriptor() ([]byte, []int) {
}
func (x *TransformInt64) GetRandomizationRangeMin() int64 {
- if x != nil {
- return x.RandomizationRangeMin
+ if x != nil && x.RandomizationRangeMin != nil {
+ return *x.RandomizationRangeMin
}
return 0
}
func (x *TransformInt64) GetRandomizationRangeMax() int64 {
- if x != nil {
- return x.RandomizationRangeMax
+ if x != nil && x.RandomizationRangeMax != nil {
+ return *x.RandomizationRangeMax
}
return 0
}
@@ -3803,7 +3803,7 @@ type TransformLastName struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
- PreserveLength bool `protobuf:"varint,1,opt,name=preserve_length,json=preserveLength,proto3" json:"preserve_length,omitempty"`
+ PreserveLength *bool `protobuf:"varint,1,opt,name=preserve_length,json=preserveLength,proto3,oneof" json:"preserve_length,omitempty"`
}
func (x *TransformLastName) Reset() {
@@ -3837,8 +3837,8 @@ func (*TransformLastName) Descriptor() ([]byte, []int) {
}
func (x *TransformLastName) GetPreserveLength() bool {
- if x != nil {
- return x.PreserveLength
+ if x != nil && x.PreserveLength != nil {
+ return *x.PreserveLength
}
return false
}
@@ -3848,7 +3848,7 @@ type TransformPhoneNumber struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
- PreserveLength bool `protobuf:"varint,1,opt,name=preserve_length,json=preserveLength,proto3" json:"preserve_length,omitempty"`
+ PreserveLength *bool `protobuf:"varint,1,opt,name=preserve_length,json=preserveLength,proto3,oneof" json:"preserve_length,omitempty"`
}
func (x *TransformPhoneNumber) Reset() {
@@ -3882,8 +3882,8 @@ func (*TransformPhoneNumber) Descriptor() ([]byte, []int) {
}
func (x *TransformPhoneNumber) GetPreserveLength() bool {
- if x != nil {
- return x.PreserveLength
+ if x != nil && x.PreserveLength != nil {
+ return *x.PreserveLength
}
return false
}
@@ -3893,7 +3893,7 @@ type TransformString struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
- PreserveLength bool `protobuf:"varint,1,opt,name=preserve_length,json=preserveLength,proto3" json:"preserve_length,omitempty"`
+ PreserveLength *bool `protobuf:"varint,1,opt,name=preserve_length,json=preserveLength,proto3,oneof" json:"preserve_length,omitempty"`
}
func (x *TransformString) Reset() {
@@ -3927,8 +3927,8 @@ func (*TransformString) Descriptor() ([]byte, []int) {
}
func (x *TransformString) GetPreserveLength() bool {
- if x != nil {
- return x.PreserveLength
+ if x != nil && x.PreserveLength != nil {
+ return *x.PreserveLength
}
return false
}
@@ -4199,7 +4199,7 @@ type GenerateCategorical struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
- Categories string `protobuf:"bytes,1,opt,name=categories,proto3" json:"categories,omitempty"`
+ Categories *string `protobuf:"bytes,1,opt,name=categories,proto3,oneof" json:"categories,omitempty"`
}
func (x *GenerateCategorical) Reset() {
@@ -4233,8 +4233,8 @@ func (*GenerateCategorical) Descriptor() ([]byte, []int) {
}
func (x *GenerateCategorical) GetCategories() string {
- if x != nil {
- return x.Categories
+ if x != nil && x.Categories != nil {
+ return *x.Categories
}
return ""
}
@@ -4435,7 +4435,7 @@ type GenerateCountry struct {
unknownFields protoimpl.UnknownFields
// An option to return the full country name of the randomly selected country or return the default of a 2-letter country code.
- GenerateFullName bool `protobuf:"varint,1,opt,name=generate_full_name,json=generateFullName,proto3" json:"generate_full_name,omitempty"`
+ GenerateFullName *bool `protobuf:"varint,1,opt,name=generate_full_name,json=generateFullName,proto3,oneof" json:"generate_full_name,omitempty"`
}
func (x *GenerateCountry) Reset() {
@@ -4469,8 +4469,8 @@ func (*GenerateCountry) Descriptor() ([]byte, []int) {
}
func (x *GenerateCountry) GetGenerateFullName() bool {
- if x != nil {
- return x.GenerateFullName
+ if x != nil && x.GenerateFullName != nil {
+ return *x.GenerateFullName
}
return false
}
@@ -5189,452 +5189,495 @@ var file_mgmt_v1alpha1_transformer_proto_rawDesc = []byte{
0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65,
0x45, 0x6d, 0x61, 0x69, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x48, 0x00, 0x52, 0x09, 0x65, 0x6d, 0x61,
0x69, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x88, 0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x65, 0x6d,
- 0x61, 0x69, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x22, 0xd5, 0x02, 0x0a, 0x0e, 0x54, 0x72, 0x61,
- 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x27, 0x0a, 0x0f, 0x70,
+ 0x61, 0x69, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x22, 0x87, 0x03, 0x0a, 0x0e, 0x54, 0x72, 0x61,
+ 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x2c, 0x0a, 0x0f, 0x70,
0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x01,
- 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x70, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x44, 0x6f,
- 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x27, 0x0a, 0x0f, 0x70, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65,
- 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x70,
- 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x29, 0x0a,
- 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x64, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e,
- 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65,
- 0x64, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, 0x12, 0x44, 0x0a, 0x0a, 0x65, 0x6d, 0x61, 0x69,
- 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x6d,
- 0x67, 0x6d, 0x74, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x6e,
- 0x65, 0x72, 0x61, 0x74, 0x65, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x48, 0x00,
- 0x52, 0x09, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x88, 0x01, 0x01, 0x12, 0x58,
- 0x0a, 0x14, 0x69, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x5f, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x5f,
- 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x6d,
- 0x67, 0x6d, 0x74, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x76,
- 0x61, 0x6c, 0x69, 0x64, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x48,
- 0x01, 0x52, 0x12, 0x69, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x41,
- 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x65, 0x6d, 0x61,
- 0x69, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x42, 0x17, 0x0a, 0x15, 0x5f, 0x69, 0x6e, 0x76, 0x61,
+ 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x0e, 0x70, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65,
+ 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x2c, 0x0a, 0x0f, 0x70, 0x72, 0x65,
+ 0x73, 0x65, 0x72, 0x76, 0x65, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01,
+ 0x28, 0x08, 0x48, 0x01, 0x52, 0x0e, 0x70, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x4c, 0x65,
+ 0x6e, 0x67, 0x74, 0x68, 0x88, 0x01, 0x01, 0x12, 0x29, 0x0a, 0x10, 0x65, 0x78, 0x63, 0x6c, 0x75,
+ 0x64, 0x65, 0x64, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28,
+ 0x09, 0x52, 0x0f, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x64, 0x44, 0x6f, 0x6d, 0x61, 0x69,
+ 0x6e, 0x73, 0x12, 0x44, 0x0a, 0x0a, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65,
+ 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x76, 0x31,
+ 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x45,
+ 0x6d, 0x61, 0x69, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x48, 0x02, 0x52, 0x09, 0x65, 0x6d, 0x61, 0x69,
+ 0x6c, 0x54, 0x79, 0x70, 0x65, 0x88, 0x01, 0x01, 0x12, 0x58, 0x0a, 0x14, 0x69, 0x6e, 0x76, 0x61,
0x6c, 0x69, 0x64, 0x5f, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e,
- 0x22, 0x0e, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x42, 0x6f, 0x6f, 0x6c,
- 0x22, 0x33, 0x0a, 0x12, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x43, 0x61, 0x72, 0x64,
- 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x5f,
- 0x6c, 0x75, 0x68, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69,
- 0x64, 0x4c, 0x75, 0x68, 0x6e, 0x22, 0x0e, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
- 0x65, 0x43, 0x69, 0x74, 0x79, 0x22, 0x11, 0x0a, 0x0f, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
- 0x65, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x22, 0x3d, 0x0a, 0x17, 0x47, 0x65, 0x6e, 0x65,
- 0x72, 0x61, 0x74, 0x65, 0x45, 0x31, 0x36, 0x34, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d,
- 0x62, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03,
- 0x52, 0x03, 0x6d, 0x69, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x61, 0x78, 0x18, 0x02, 0x20, 0x01,
- 0x28, 0x03, 0x52, 0x03, 0x6d, 0x61, 0x78, 0x22, 0x13, 0x0a, 0x11, 0x47, 0x65, 0x6e, 0x65, 0x72,
- 0x61, 0x74, 0x65, 0x46, 0x69, 0x72, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x7a, 0x0a, 0x0f,
- 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x36, 0x34, 0x12,
- 0x25, 0x0a, 0x0e, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x69, 0x7a, 0x65, 0x5f, 0x73, 0x69, 0x67,
- 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x69,
- 0x7a, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x69, 0x6e, 0x18, 0x02, 0x20,
- 0x01, 0x28, 0x01, 0x52, 0x03, 0x6d, 0x69, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x61, 0x78, 0x18,
- 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, 0x03, 0x6d, 0x61, 0x78, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x72,
- 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x70,
- 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x15, 0x0a, 0x13, 0x47, 0x65, 0x6e, 0x65,
- 0x72, 0x61, 0x74, 0x65, 0x46, 0x75, 0x6c, 0x6c, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22,
- 0x12, 0x0a, 0x10, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x46, 0x75, 0x6c, 0x6c, 0x4e,
- 0x61, 0x6d, 0x65, 0x22, 0x30, 0x0a, 0x0e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x47,
- 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x62, 0x62, 0x72, 0x65, 0x76, 0x69,
- 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x61, 0x62, 0x62, 0x72, 0x65,
- 0x76, 0x69, 0x61, 0x74, 0x65, 0x22, 0x1a, 0x0a, 0x18, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
- 0x65, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65,
- 0x72, 0x22, 0x5a, 0x0a, 0x0d, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x74,
- 0x36, 0x34, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x69, 0x7a, 0x65, 0x5f,
- 0x73, 0x69, 0x67, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x72, 0x61, 0x6e, 0x64,
- 0x6f, 0x6d, 0x69, 0x7a, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x69, 0x6e,
- 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6d, 0x69, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x6d,
- 0x61, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6d, 0x61, 0x78, 0x22, 0x12, 0x0a,
- 0x10, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x4c, 0x61, 0x73, 0x74, 0x4e, 0x61, 0x6d,
- 0x65, 0x22, 0x14, 0x0a, 0x12, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x53, 0x68, 0x61,
- 0x32, 0x35, 0x36, 0x48, 0x61, 0x73, 0x68, 0x22, 0x0d, 0x0a, 0x0b, 0x47, 0x65, 0x6e, 0x65, 0x72,
- 0x61, 0x74, 0x65, 0x53, 0x53, 0x4e, 0x22, 0x3d, 0x0a, 0x0d, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61,
- 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x67, 0x65, 0x6e, 0x65, 0x72,
- 0x61, 0x74, 0x65, 0x5f, 0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20,
- 0x01, 0x28, 0x08, 0x52, 0x10, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x46, 0x75, 0x6c,
- 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x17, 0x0a, 0x15, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
- 0x65, 0x53, 0x74, 0x72, 0x65, 0x65, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x3f,
- 0x0a, 0x19, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67,
- 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6d,
- 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6d, 0x69, 0x6e, 0x12, 0x10, 0x0a,
- 0x03, 0x6d, 0x61, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6d, 0x61, 0x78, 0x22,
- 0x34, 0x0a, 0x0e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x53, 0x74, 0x72, 0x69, 0x6e,
- 0x67, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03,
- 0x6d, 0x69, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x61, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03,
- 0x52, 0x03, 0x6d, 0x61, 0x78, 0x22, 0x17, 0x0a, 0x15, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
- 0x65, 0x55, 0x6e, 0x69, 0x78, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x12,
- 0x0a, 0x10, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61,
- 0x6d, 0x65, 0x22, 0x16, 0x0a, 0x14, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x55, 0x74,
- 0x63, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x37, 0x0a, 0x0c, 0x47, 0x65,
- 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x55, 0x75, 0x69, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x69, 0x6e,
- 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x68, 0x79, 0x70, 0x68, 0x65, 0x6e, 0x73, 0x18, 0x01, 0x20,
- 0x01, 0x28, 0x08, 0x52, 0x0e, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x48, 0x79, 0x70, 0x68,
- 0x65, 0x6e, 0x73, 0x22, 0x11, 0x0a, 0x0f, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x5a,
- 0x69, 0x70, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x43, 0x0a, 0x18, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66,
- 0x6f, 0x72, 0x6d, 0x45, 0x31, 0x36, 0x34, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62,
- 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0f, 0x70, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x5f, 0x6c,
- 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x70, 0x72, 0x65,
- 0x73, 0x65, 0x72, 0x76, 0x65, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x22, 0x3d, 0x0a, 0x12, 0x54,
- 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x46, 0x69, 0x72, 0x73, 0x74, 0x4e, 0x61, 0x6d,
- 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x70, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x5f, 0x6c, 0x65,
- 0x6e, 0x67, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x70, 0x72, 0x65, 0x73,
- 0x65, 0x72, 0x76, 0x65, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x22, 0x82, 0x01, 0x0a, 0x10, 0x54,
- 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x36, 0x34, 0x12,
- 0x36, 0x0a, 0x17, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e,
- 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x6d, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01,
- 0x52, 0x15, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52,
- 0x61, 0x6e, 0x67, 0x65, 0x4d, 0x69, 0x6e, 0x12, 0x36, 0x0a, 0x17, 0x72, 0x61, 0x6e, 0x64, 0x6f,
+ 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x76, 0x31,
+ 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x45, 0x6d,
+ 0x61, 0x69, 0x6c, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x03, 0x52, 0x12, 0x69, 0x6e, 0x76,
+ 0x61, 0x6c, 0x69, 0x64, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x88,
+ 0x01, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x70, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x5f,
+ 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x70, 0x72, 0x65, 0x73, 0x65,
+ 0x72, 0x76, 0x65, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x65,
+ 0x6d, 0x61, 0x69, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x42, 0x17, 0x0a, 0x15, 0x5f, 0x69, 0x6e,
+ 0x76, 0x61, 0x6c, 0x69, 0x64, 0x5f, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x5f, 0x61, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x22, 0x0e, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x42, 0x6f,
+ 0x6f, 0x6c, 0x22, 0x47, 0x0a, 0x12, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x43, 0x61,
+ 0x72, 0x64, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x22, 0x0a, 0x0a, 0x76, 0x61, 0x6c, 0x69,
+ 0x64, 0x5f, 0x6c, 0x75, 0x68, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x09,
+ 0x76, 0x61, 0x6c, 0x69, 0x64, 0x4c, 0x75, 0x68, 0x6e, 0x88, 0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b,
+ 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x5f, 0x6c, 0x75, 0x68, 0x6e, 0x22, 0x0e, 0x0a, 0x0c, 0x47,
+ 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x43, 0x69, 0x74, 0x79, 0x22, 0x11, 0x0a, 0x0f, 0x47,
+ 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x22, 0x57,
+ 0x0a, 0x17, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x45, 0x31, 0x36, 0x34, 0x50, 0x68,
+ 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x15, 0x0a, 0x03, 0x6d, 0x69, 0x6e,
+ 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x03, 0x6d, 0x69, 0x6e, 0x88, 0x01, 0x01,
+ 0x12, 0x15, 0x0a, 0x03, 0x6d, 0x61, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, 0x52,
+ 0x03, 0x6d, 0x61, 0x78, 0x88, 0x01, 0x01, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x6d, 0x69, 0x6e, 0x42,
+ 0x06, 0x0a, 0x04, 0x5f, 0x6d, 0x61, 0x78, 0x22, 0x13, 0x0a, 0x11, 0x47, 0x65, 0x6e, 0x65, 0x72,
+ 0x61, 0x74, 0x65, 0x46, 0x69, 0x72, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0xbf, 0x01, 0x0a,
+ 0x0f, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x36, 0x34,
+ 0x12, 0x2a, 0x0a, 0x0e, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x69, 0x7a, 0x65, 0x5f, 0x73, 0x69,
+ 0x67, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x0d, 0x72, 0x61, 0x6e, 0x64,
+ 0x6f, 0x6d, 0x69, 0x7a, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x15, 0x0a, 0x03,
+ 0x6d, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x48, 0x01, 0x52, 0x03, 0x6d, 0x69, 0x6e,
+ 0x88, 0x01, 0x01, 0x12, 0x15, 0x0a, 0x03, 0x6d, 0x61, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01,
+ 0x48, 0x02, 0x52, 0x03, 0x6d, 0x61, 0x78, 0x88, 0x01, 0x01, 0x12, 0x21, 0x0a, 0x09, 0x70, 0x72,
+ 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x48, 0x03, 0x52,
+ 0x09, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x42, 0x11, 0x0a,
+ 0x0f, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x69, 0x7a, 0x65, 0x5f, 0x73, 0x69, 0x67, 0x6e,
+ 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x6d, 0x69, 0x6e, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x6d, 0x61, 0x78,
+ 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x70, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x15,
+ 0x0a, 0x13, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x46, 0x75, 0x6c, 0x6c, 0x41, 0x64,
+ 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x12, 0x0a, 0x10, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
+ 0x65, 0x46, 0x75, 0x6c, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x44, 0x0a, 0x0e, 0x47, 0x65, 0x6e,
+ 0x65, 0x72, 0x61, 0x74, 0x65, 0x47, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x23, 0x0a, 0x0a, 0x61,
+ 0x62, 0x62, 0x72, 0x65, 0x76, 0x69, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x48,
+ 0x00, 0x52, 0x0a, 0x61, 0x62, 0x62, 0x72, 0x65, 0x76, 0x69, 0x61, 0x74, 0x65, 0x88, 0x01, 0x01,
+ 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x61, 0x62, 0x62, 0x72, 0x65, 0x76, 0x69, 0x61, 0x74, 0x65, 0x22,
+ 0x1a, 0x0a, 0x18, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x74, 0x36, 0x34,
+ 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x8c, 0x01, 0x0a, 0x0d,
+ 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x12, 0x2a, 0x0a,
+ 0x0e, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x69, 0x7a, 0x65, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x18,
+ 0x01, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x0d, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x69,
+ 0x7a, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x15, 0x0a, 0x03, 0x6d, 0x69, 0x6e,
+ 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, 0x52, 0x03, 0x6d, 0x69, 0x6e, 0x88, 0x01, 0x01,
+ 0x12, 0x15, 0x0a, 0x03, 0x6d, 0x61, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x48, 0x02, 0x52,
+ 0x03, 0x6d, 0x61, 0x78, 0x88, 0x01, 0x01, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x72, 0x61, 0x6e, 0x64,
+ 0x6f, 0x6d, 0x69, 0x7a, 0x65, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x6d,
+ 0x69, 0x6e, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x6d, 0x61, 0x78, 0x22, 0x12, 0x0a, 0x10, 0x47, 0x65,
+ 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x4c, 0x61, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x14,
+ 0x0a, 0x12, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x53, 0x68, 0x61, 0x32, 0x35, 0x36,
+ 0x48, 0x61, 0x73, 0x68, 0x22, 0x0d, 0x0a, 0x0b, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65,
+ 0x53, 0x53, 0x4e, 0x22, 0x59, 0x0a, 0x0d, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x53,
+ 0x74, 0x61, 0x74, 0x65, 0x12, 0x31, 0x0a, 0x12, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65,
+ 0x5f, 0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08,
+ 0x48, 0x00, 0x52, 0x10, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x46, 0x75, 0x6c, 0x6c,
+ 0x4e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x67, 0x65, 0x6e, 0x65,
+ 0x72, 0x61, 0x74, 0x65, 0x5f, 0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x17,
+ 0x0a, 0x15, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x53, 0x74, 0x72, 0x65, 0x65, 0x74,
+ 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x59, 0x0a, 0x19, 0x47, 0x65, 0x6e, 0x65, 0x72,
+ 0x61, 0x74, 0x65, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75,
+ 0x6d, 0x62, 0x65, 0x72, 0x12, 0x15, 0x0a, 0x03, 0x6d, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28,
+ 0x03, 0x48, 0x00, 0x52, 0x03, 0x6d, 0x69, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x15, 0x0a, 0x03, 0x6d,
+ 0x61, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, 0x52, 0x03, 0x6d, 0x61, 0x78, 0x88,
+ 0x01, 0x01, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x6d, 0x69, 0x6e, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x6d,
+ 0x61, 0x78, 0x22, 0x4e, 0x0a, 0x0e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x53, 0x74,
+ 0x72, 0x69, 0x6e, 0x67, 0x12, 0x15, 0x0a, 0x03, 0x6d, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28,
+ 0x03, 0x48, 0x00, 0x52, 0x03, 0x6d, 0x69, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x15, 0x0a, 0x03, 0x6d,
+ 0x61, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, 0x52, 0x03, 0x6d, 0x61, 0x78, 0x88,
+ 0x01, 0x01, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x6d, 0x69, 0x6e, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x6d,
+ 0x61, 0x78, 0x22, 0x17, 0x0a, 0x15, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x55, 0x6e,
+ 0x69, 0x78, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x12, 0x0a, 0x10, 0x47,
+ 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x22,
+ 0x16, 0x0a, 0x14, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x55, 0x74, 0x63, 0x54, 0x69,
+ 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x50, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x72,
+ 0x61, 0x74, 0x65, 0x55, 0x75, 0x69, 0x64, 0x12, 0x2c, 0x0a, 0x0f, 0x69, 0x6e, 0x63, 0x6c, 0x75,
+ 0x64, 0x65, 0x5f, 0x68, 0x79, 0x70, 0x68, 0x65, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08,
+ 0x48, 0x00, 0x52, 0x0e, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x48, 0x79, 0x70, 0x68, 0x65,
+ 0x6e, 0x73, 0x88, 0x01, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64,
+ 0x65, 0x5f, 0x68, 0x79, 0x70, 0x68, 0x65, 0x6e, 0x73, 0x22, 0x11, 0x0a, 0x0f, 0x47, 0x65, 0x6e,
+ 0x65, 0x72, 0x61, 0x74, 0x65, 0x5a, 0x69, 0x70, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x5c, 0x0a, 0x18,
+ 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x45, 0x31, 0x36, 0x34, 0x50, 0x68, 0x6f,
+ 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x2c, 0x0a, 0x0f, 0x70, 0x72, 0x65, 0x73,
+ 0x65, 0x72, 0x76, 0x65, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28,
+ 0x08, 0x48, 0x00, 0x52, 0x0e, 0x70, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x4c, 0x65, 0x6e,
+ 0x67, 0x74, 0x68, 0x88, 0x01, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x70, 0x72, 0x65, 0x73, 0x65,
+ 0x72, 0x76, 0x65, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x22, 0x56, 0x0a, 0x12, 0x54, 0x72,
+ 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x46, 0x69, 0x72, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65,
+ 0x12, 0x2c, 0x0a, 0x0f, 0x70, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x5f, 0x6c, 0x65, 0x6e,
+ 0x67, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x0e, 0x70, 0x72, 0x65,
+ 0x73, 0x65, 0x72, 0x76, 0x65, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x88, 0x01, 0x01, 0x42, 0x12,
+ 0x0a, 0x10, 0x5f, 0x70, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x5f, 0x6c, 0x65, 0x6e, 0x67,
+ 0x74, 0x68, 0x22, 0xc4, 0x01, 0x0a, 0x10, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d,
+ 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x36, 0x34, 0x12, 0x3b, 0x0a, 0x17, 0x72, 0x61, 0x6e, 0x64, 0x6f,
0x6d, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x6d,
- 0x61, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x15, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d,
- 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x4d, 0x61, 0x78, 0x22,
- 0x3c, 0x0a, 0x11, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x46, 0x75, 0x6c, 0x6c,
- 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x70, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65,
- 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x70,
- 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x22, 0x44, 0x0a,
- 0x19, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x50,
- 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0f, 0x70, 0x72,
- 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x01, 0x20,
- 0x01, 0x28, 0x08, 0x52, 0x0e, 0x70, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x4c, 0x65, 0x6e,
- 0x67, 0x74, 0x68, 0x22, 0x80, 0x01, 0x0a, 0x0e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72,
- 0x6d, 0x49, 0x6e, 0x74, 0x36, 0x34, 0x12, 0x36, 0x0a, 0x17, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d,
- 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x6d, 0x69,
- 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x15, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x69,
- 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x4d, 0x69, 0x6e, 0x12, 0x36,
- 0x0a, 0x17, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f,
- 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x6d, 0x61, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52,
- 0x15, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x61,
- 0x6e, 0x67, 0x65, 0x4d, 0x61, 0x78, 0x22, 0x3c, 0x0a, 0x11, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66,
- 0x6f, 0x72, 0x6d, 0x4c, 0x61, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x70,
- 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x01,
- 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x70, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x4c, 0x65,
- 0x6e, 0x67, 0x74, 0x68, 0x22, 0x3f, 0x0a, 0x14, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72,
- 0x6d, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0f,
- 0x70, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18,
- 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x70, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x4c,
- 0x65, 0x6e, 0x67, 0x74, 0x68, 0x22, 0x3a, 0x0a, 0x0f, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f,
- 0x72, 0x6d, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x27, 0x0a, 0x0f, 0x70, 0x72, 0x65, 0x73,
+ 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x48, 0x00, 0x52, 0x15, 0x72, 0x61, 0x6e, 0x64,
+ 0x6f, 0x6d, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x4d, 0x69,
+ 0x6e, 0x88, 0x01, 0x01, 0x12, 0x3b, 0x0a, 0x17, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x69, 0x7a,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x6d, 0x61, 0x78, 0x18,
+ 0x02, 0x20, 0x01, 0x28, 0x01, 0x48, 0x01, 0x52, 0x15, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x69,
+ 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x4d, 0x61, 0x78, 0x88, 0x01,
+ 0x01, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x69, 0x7a, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x6d, 0x69, 0x6e, 0x42, 0x1a, 0x0a,
+ 0x18, 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f,
+ 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x6d, 0x61, 0x78, 0x22, 0x55, 0x0a, 0x11, 0x54, 0x72, 0x61,
+ 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x46, 0x75, 0x6c, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2c,
+ 0x0a, 0x0f, 0x70, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74,
+ 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x0e, 0x70, 0x72, 0x65, 0x73, 0x65,
+ 0x72, 0x76, 0x65, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x88, 0x01, 0x01, 0x42, 0x12, 0x0a, 0x10,
+ 0x5f, 0x70, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68,
+ 0x22, 0x5d, 0x0a, 0x19, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x49, 0x6e, 0x74,
+ 0x36, 0x34, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x2c, 0x0a,
+ 0x0f, 0x70, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68,
+ 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x0e, 0x70, 0x72, 0x65, 0x73, 0x65, 0x72,
+ 0x76, 0x65, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x88, 0x01, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x5f,
+ 0x70, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x22,
+ 0xc2, 0x01, 0x0a, 0x0e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x49, 0x6e, 0x74,
+ 0x36, 0x34, 0x12, 0x3b, 0x0a, 0x17, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x69, 0x7a, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x6d, 0x69, 0x6e, 0x18, 0x01, 0x20,
+ 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x15, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x69, 0x7a, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x4d, 0x69, 0x6e, 0x88, 0x01, 0x01, 0x12,
+ 0x3b, 0x0a, 0x17, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x6d, 0x61, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03,
+ 0x48, 0x01, 0x52, 0x15, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x4d, 0x61, 0x78, 0x88, 0x01, 0x01, 0x42, 0x1a, 0x0a, 0x18,
+ 0x5f, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72,
+ 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x6d, 0x69, 0x6e, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x72, 0x61, 0x6e,
+ 0x64, 0x6f, 0x6d, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65,
+ 0x5f, 0x6d, 0x61, 0x78, 0x22, 0x55, 0x0a, 0x11, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72,
+ 0x6d, 0x4c, 0x61, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2c, 0x0a, 0x0f, 0x70, 0x72, 0x65,
+ 0x73, 0x65, 0x72, 0x76, 0x65, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01,
+ 0x28, 0x08, 0x48, 0x00, 0x52, 0x0e, 0x70, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x4c, 0x65,
+ 0x6e, 0x67, 0x74, 0x68, 0x88, 0x01, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x70, 0x72, 0x65, 0x73,
+ 0x65, 0x72, 0x76, 0x65, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x22, 0x58, 0x0a, 0x14, 0x54,
+ 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d,
+ 0x62, 0x65, 0x72, 0x12, 0x2c, 0x0a, 0x0f, 0x70, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x5f,
+ 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x0e,
+ 0x70, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x88, 0x01,
+ 0x01, 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x70, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x5f, 0x6c,
+ 0x65, 0x6e, 0x67, 0x74, 0x68, 0x22, 0x53, 0x0a, 0x0f, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f,
+ 0x72, 0x6d, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x2c, 0x0a, 0x0f, 0x70, 0x72, 0x65, 0x73,
0x65, 0x72, 0x76, 0x65, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28,
- 0x08, 0x52, 0x0e, 0x70, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x4c, 0x65, 0x6e, 0x67, 0x74,
- 0x68, 0x22, 0x0d, 0x0a, 0x0b, 0x50, 0x61, 0x73, 0x73, 0x74, 0x68, 0x72, 0x6f, 0x75, 0x67, 0x68,
- 0x22, 0x06, 0x0a, 0x04, 0x4e, 0x75, 0x6c, 0x6c, 0x22, 0x29, 0x0a, 0x13, 0x54, 0x72, 0x61, 0x6e,
- 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x4a, 0x61, 0x76, 0x61, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x12,
+ 0x08, 0x48, 0x00, 0x52, 0x0e, 0x70, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x4c, 0x65, 0x6e,
+ 0x67, 0x74, 0x68, 0x88, 0x01, 0x01, 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x70, 0x72, 0x65, 0x73, 0x65,
+ 0x72, 0x76, 0x65, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x22, 0x0d, 0x0a, 0x0b, 0x50, 0x61,
+ 0x73, 0x73, 0x74, 0x68, 0x72, 0x6f, 0x75, 0x67, 0x68, 0x22, 0x06, 0x0a, 0x04, 0x4e, 0x75, 0x6c,
+ 0x6c, 0x22, 0x29, 0x0a, 0x13, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x4a, 0x61,
+ 0x76, 0x61, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65,
+ 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x38, 0x0a, 0x1c,
+ 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73,
+ 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x18, 0x0a, 0x02,
+ 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xba, 0x48, 0x05, 0x72, 0x03, 0xb0,
+ 0x01, 0x01, 0x52, 0x02, 0x69, 0x64, 0x22, 0x5f, 0x0a, 0x21, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61,
+ 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x4a, 0x61, 0x76, 0x61, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74,
+ 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x61,
+ 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
+ 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1b, 0x0a, 0x04, 0x63, 0x6f,
+ 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10,
+ 0x01, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x3a, 0x0a, 0x22, 0x56, 0x61, 0x6c, 0x69, 0x64,
+ 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x4a, 0x61, 0x76, 0x61, 0x73, 0x63, 0x72, 0x69, 0x70,
+ 0x74, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a,
+ 0x05, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61,
+ 0x6c, 0x69, 0x64, 0x22, 0x49, 0x0a, 0x13, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x43,
+ 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x12, 0x23, 0x0a, 0x0a, 0x63, 0x61,
+ 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00,
+ 0x52, 0x0a, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x88, 0x01, 0x01, 0x42,
+ 0x0d, 0x0a, 0x0b, 0x5f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x22, 0x69,
+ 0x0a, 0x1a, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x43, 0x68, 0x61, 0x72, 0x61,
+ 0x63, 0x74, 0x65, 0x72, 0x53, 0x63, 0x72, 0x61, 0x6d, 0x62, 0x6c, 0x65, 0x12, 0x33, 0x0a, 0x13,
+ 0x75, 0x73, 0x65, 0x72, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x5f, 0x72, 0x65,
+ 0x67, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x11, 0x75, 0x73, 0x65,
+ 0x72, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x52, 0x65, 0x67, 0x65, 0x78, 0x88, 0x01,
+ 0x01, 0x42, 0x16, 0x0a, 0x14, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69,
+ 0x64, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x67, 0x65, 0x78, 0x22, 0x28, 0x0a, 0x12, 0x47, 0x65, 0x6e,
+ 0x65, 0x72, 0x61, 0x74, 0x65, 0x4a, 0x61, 0x76, 0x61, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x12,
0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63,
- 0x6f, 0x64, 0x65, 0x22, 0x38, 0x0a, 0x1c, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x66, 0x69, 0x6e,
- 0x65, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x43, 0x6f, 0x6e,
- 0x66, 0x69, 0x67, 0x12, 0x18, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42,
- 0x08, 0xba, 0x48, 0x05, 0x72, 0x03, 0xb0, 0x01, 0x01, 0x52, 0x02, 0x69, 0x64, 0x22, 0x5f, 0x0a,
- 0x21, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x4a, 0x61, 0x76,
- 0x61, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65,
- 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64,
- 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49,
- 0x64, 0x12, 0x1b, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42,
- 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x3a,
- 0x0a, 0x22, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x4a, 0x61,
- 0x76, 0x61, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70,
- 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x18, 0x01, 0x20,
- 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x22, 0x35, 0x0a, 0x13, 0x47, 0x65,
- 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x63, 0x61,
- 0x6c, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x18,
- 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x69, 0x65,
- 0x73, 0x22, 0x69, 0x0a, 0x1a, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x43, 0x68,
- 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x53, 0x63, 0x72, 0x61, 0x6d, 0x62, 0x6c, 0x65, 0x12,
- 0x33, 0x0a, 0x13, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64,
- 0x5f, 0x72, 0x65, 0x67, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x11,
- 0x75, 0x73, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x52, 0x65, 0x67, 0x65,
- 0x78, 0x88, 0x01, 0x01, 0x42, 0x16, 0x0a, 0x14, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x70, 0x72,
- 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x67, 0x65, 0x78, 0x22, 0x28, 0x0a, 0x12,
- 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x4a, 0x61, 0x76, 0x61, 0x73, 0x63, 0x72, 0x69,
- 0x70, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
- 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x6d, 0x0a, 0x1c, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61,
- 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x67, 0x65, 0x78, 0x43, 0x6f, 0x64, 0x65, 0x52,
- 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e,
- 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f,
- 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x13, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x70, 0x72,
- 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x67, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01,
- 0x28, 0x09, 0x52, 0x11, 0x75, 0x73, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64,
- 0x52, 0x65, 0x67, 0x65, 0x78, 0x22, 0x35, 0x0a, 0x1d, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74,
- 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x67, 0x65, 0x78, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65,
- 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x18,
- 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x22, 0x3f, 0x0a, 0x0f,
- 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x12,
- 0x2c, 0x0a, 0x12, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x66, 0x75, 0x6c, 0x6c,
- 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x67, 0x65, 0x6e,
- 0x65, 0x72, 0x61, 0x74, 0x65, 0x46, 0x75, 0x6c, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x2a, 0x85, 0x10,
- 0x0a, 0x11, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x53, 0x6f, 0x75,
- 0x72, 0x63, 0x65, 0x12, 0x22, 0x0a, 0x1e, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d,
- 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43,
- 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x22, 0x0a, 0x1e, 0x54, 0x52, 0x41, 0x4e, 0x53,
- 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x50, 0x41,
- 0x53, 0x53, 0x54, 0x48, 0x52, 0x4f, 0x55, 0x47, 0x48, 0x10, 0x01, 0x12, 0x27, 0x0a, 0x23, 0x54,
- 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43,
- 0x45, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x44, 0x45, 0x46, 0x41, 0x55,
- 0x4c, 0x54, 0x10, 0x02, 0x12, 0x2b, 0x0a, 0x27, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52,
- 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53,
- 0x46, 0x4f, 0x52, 0x4d, 0x5f, 0x4a, 0x41, 0x56, 0x41, 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x10,
- 0x03, 0x12, 0x25, 0x0a, 0x21, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52,
- 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45,
- 0x5f, 0x45, 0x4d, 0x41, 0x49, 0x4c, 0x10, 0x04, 0x12, 0x26, 0x0a, 0x22, 0x54, 0x52, 0x41, 0x4e,
- 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x54,
- 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x5f, 0x45, 0x4d, 0x41, 0x49, 0x4c, 0x10, 0x05,
- 0x12, 0x24, 0x0a, 0x20, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f,
- 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45, 0x5f,
- 0x42, 0x4f, 0x4f, 0x4c, 0x10, 0x06, 0x12, 0x2b, 0x0a, 0x27, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46,
- 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x47, 0x45, 0x4e,
- 0x45, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x43, 0x41, 0x52, 0x44, 0x5f, 0x4e, 0x55, 0x4d, 0x42, 0x45,
- 0x52, 0x10, 0x07, 0x12, 0x24, 0x0a, 0x20, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d,
- 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41,
- 0x54, 0x45, 0x5f, 0x43, 0x49, 0x54, 0x59, 0x10, 0x08, 0x12, 0x31, 0x0a, 0x2d, 0x54, 0x52, 0x41,
+ 0x6f, 0x64, 0x65, 0x22, 0x6d, 0x0a, 0x1c, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x55,
+ 0x73, 0x65, 0x72, 0x52, 0x65, 0x67, 0x65, 0x78, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75,
+ 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69,
+ 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74,
+ 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x13, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69,
+ 0x64, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x67, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
+ 0x11, 0x75, 0x73, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x52, 0x65, 0x67,
+ 0x65, 0x78, 0x22, 0x35, 0x0a, 0x1d, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73,
+ 0x65, 0x72, 0x52, 0x65, 0x67, 0x65, 0x78, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f,
+ 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
+ 0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x22, 0x5b, 0x0a, 0x0f, 0x47, 0x65, 0x6e,
+ 0x65, 0x72, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x31, 0x0a, 0x12,
+ 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x6e, 0x61,
+ 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x10, 0x67, 0x65, 0x6e, 0x65,
+ 0x72, 0x61, 0x74, 0x65, 0x46, 0x75, 0x6c, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x42,
+ 0x15, 0x0a, 0x13, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x66, 0x75, 0x6c,
+ 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x2a, 0x85, 0x10, 0x0a, 0x11, 0x54, 0x72, 0x61, 0x6e, 0x73,
+ 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x22, 0x0a, 0x1e,
+ 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52,
+ 0x43, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00,
+ 0x12, 0x22, 0x0a, 0x1e, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f,
+ 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x50, 0x41, 0x53, 0x53, 0x54, 0x48, 0x52, 0x4f, 0x55,
+ 0x47, 0x48, 0x10, 0x01, 0x12, 0x27, 0x0a, 0x23, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52,
+ 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52,
+ 0x41, 0x54, 0x45, 0x5f, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x02, 0x12, 0x2b, 0x0a,
+ 0x27, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55,
+ 0x52, 0x43, 0x45, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x5f, 0x4a, 0x41,
+ 0x56, 0x41, 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x10, 0x03, 0x12, 0x25, 0x0a, 0x21, 0x54, 0x52,
+ 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45,
+ 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x45, 0x4d, 0x41, 0x49, 0x4c, 0x10,
+ 0x04, 0x12, 0x26, 0x0a, 0x22, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52,
+ 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52,
+ 0x4d, 0x5f, 0x45, 0x4d, 0x41, 0x49, 0x4c, 0x10, 0x05, 0x12, 0x24, 0x0a, 0x20, 0x54, 0x52, 0x41,
0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f,
- 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x45, 0x31, 0x36, 0x34, 0x5f, 0x50, 0x48,
- 0x4f, 0x4e, 0x45, 0x5f, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x10, 0x09, 0x12, 0x2a, 0x0a, 0x26,
+ 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x42, 0x4f, 0x4f, 0x4c, 0x10, 0x06, 0x12,
+ 0x2b, 0x0a, 0x27, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53,
+ 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x43,
+ 0x41, 0x52, 0x44, 0x5f, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x10, 0x07, 0x12, 0x24, 0x0a, 0x20,
0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52,
- 0x43, 0x45, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x46, 0x49, 0x52, 0x53,
- 0x54, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x10, 0x0a, 0x12, 0x27, 0x0a, 0x23, 0x54, 0x52, 0x41, 0x4e,
- 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x47,
- 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x46, 0x4c, 0x4f, 0x41, 0x54, 0x36, 0x34, 0x10,
- 0x0b, 0x12, 0x2c, 0x0a, 0x28, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52,
+ 0x43, 0x45, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x43, 0x49, 0x54, 0x59,
+ 0x10, 0x08, 0x12, 0x31, 0x0a, 0x2d, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45,
+ 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54,
+ 0x45, 0x5f, 0x45, 0x31, 0x36, 0x34, 0x5f, 0x50, 0x48, 0x4f, 0x4e, 0x45, 0x5f, 0x4e, 0x55, 0x4d,
+ 0x42, 0x45, 0x52, 0x10, 0x09, 0x12, 0x2a, 0x0a, 0x26, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f,
+ 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x47, 0x45, 0x4e, 0x45,
+ 0x52, 0x41, 0x54, 0x45, 0x5f, 0x46, 0x49, 0x52, 0x53, 0x54, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x10,
+ 0x0a, 0x12, 0x27, 0x0a, 0x23, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52,
0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45,
- 0x5f, 0x46, 0x55, 0x4c, 0x4c, 0x5f, 0x41, 0x44, 0x44, 0x52, 0x45, 0x53, 0x53, 0x10, 0x0c, 0x12,
- 0x29, 0x0a, 0x25, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53,
- 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x46,
- 0x55, 0x4c, 0x4c, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x10, 0x0d, 0x12, 0x26, 0x0a, 0x22, 0x54, 0x52,
+ 0x5f, 0x46, 0x4c, 0x4f, 0x41, 0x54, 0x36, 0x34, 0x10, 0x0b, 0x12, 0x2c, 0x0a, 0x28, 0x54, 0x52,
0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45,
- 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x47, 0x45, 0x4e, 0x44, 0x45, 0x52,
- 0x10, 0x0e, 0x12, 0x32, 0x0a, 0x2e, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45,
- 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54,
- 0x45, 0x5f, 0x49, 0x4e, 0x54, 0x36, 0x34, 0x5f, 0x50, 0x48, 0x4f, 0x4e, 0x45, 0x5f, 0x4e, 0x55,
- 0x4d, 0x42, 0x45, 0x52, 0x10, 0x0f, 0x12, 0x25, 0x0a, 0x21, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46,
- 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x47, 0x45, 0x4e,
- 0x45, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x49, 0x4e, 0x54, 0x36, 0x34, 0x10, 0x10, 0x12, 0x2c, 0x0a,
- 0x28, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55,
- 0x52, 0x43, 0x45, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x52, 0x41, 0x4e,
- 0x44, 0x4f, 0x4d, 0x5f, 0x49, 0x4e, 0x54, 0x36, 0x34, 0x10, 0x11, 0x12, 0x29, 0x0a, 0x25, 0x54,
+ 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x46, 0x55, 0x4c, 0x4c, 0x5f, 0x41,
+ 0x44, 0x44, 0x52, 0x45, 0x53, 0x53, 0x10, 0x0c, 0x12, 0x29, 0x0a, 0x25, 0x54, 0x52, 0x41, 0x4e,
+ 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x47,
+ 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x46, 0x55, 0x4c, 0x4c, 0x5f, 0x4e, 0x41, 0x4d,
+ 0x45, 0x10, 0x0d, 0x12, 0x26, 0x0a, 0x22, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d,
+ 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41,
+ 0x54, 0x45, 0x5f, 0x47, 0x45, 0x4e, 0x44, 0x45, 0x52, 0x10, 0x0e, 0x12, 0x32, 0x0a, 0x2e, 0x54,
0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43,
- 0x45, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x4c, 0x41, 0x53, 0x54, 0x5f,
- 0x4e, 0x41, 0x4d, 0x45, 0x10, 0x12, 0x12, 0x2a, 0x0a, 0x26, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46,
+ 0x45, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x49, 0x4e, 0x54, 0x36, 0x34,
+ 0x5f, 0x50, 0x48, 0x4f, 0x4e, 0x45, 0x5f, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x10, 0x0f, 0x12,
+ 0x25, 0x0a, 0x21, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53,
+ 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x49,
+ 0x4e, 0x54, 0x36, 0x34, 0x10, 0x10, 0x12, 0x2c, 0x0a, 0x28, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46,
0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x47, 0x45, 0x4e,
- 0x45, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x48, 0x41, 0x53, 0x48,
- 0x10, 0x13, 0x12, 0x23, 0x0a, 0x1f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45,
- 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54,
- 0x45, 0x5f, 0x53, 0x53, 0x4e, 0x10, 0x14, 0x12, 0x25, 0x0a, 0x21, 0x54, 0x52, 0x41, 0x4e, 0x53,
+ 0x45, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x52, 0x41, 0x4e, 0x44, 0x4f, 0x4d, 0x5f, 0x49, 0x4e, 0x54,
+ 0x36, 0x34, 0x10, 0x11, 0x12, 0x29, 0x0a, 0x25, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52,
+ 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52,
+ 0x41, 0x54, 0x45, 0x5f, 0x4c, 0x41, 0x53, 0x54, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x10, 0x12, 0x12,
+ 0x2a, 0x0a, 0x26, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53,
+ 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x53,
+ 0x48, 0x41, 0x32, 0x35, 0x36, 0x48, 0x41, 0x53, 0x48, 0x10, 0x13, 0x12, 0x23, 0x0a, 0x1f, 0x54,
+ 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43,
+ 0x45, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x53, 0x53, 0x4e, 0x10, 0x14,
+ 0x12, 0x25, 0x0a, 0x21, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f,
+ 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45, 0x5f,
+ 0x53, 0x54, 0x41, 0x54, 0x45, 0x10, 0x15, 0x12, 0x2e, 0x0a, 0x2a, 0x54, 0x52, 0x41, 0x4e, 0x53,
+ 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x47, 0x45,
+ 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x53, 0x54, 0x52, 0x45, 0x45, 0x54, 0x5f, 0x41, 0x44,
+ 0x44, 0x52, 0x45, 0x53, 0x53, 0x10, 0x16, 0x12, 0x33, 0x0a, 0x2f, 0x54, 0x52, 0x41, 0x4e, 0x53,
0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x47, 0x45,
- 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x45, 0x10, 0x15, 0x12, 0x2e,
- 0x0a, 0x2a, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f,
- 0x55, 0x52, 0x43, 0x45, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x53, 0x54,
- 0x52, 0x45, 0x45, 0x54, 0x5f, 0x41, 0x44, 0x44, 0x52, 0x45, 0x53, 0x53, 0x10, 0x16, 0x12, 0x33,
- 0x0a, 0x2f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f,
- 0x55, 0x52, 0x43, 0x45, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x53, 0x54,
- 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x50, 0x48, 0x4f, 0x4e, 0x45, 0x5f, 0x4e, 0x55, 0x4d, 0x42, 0x45,
- 0x52, 0x10, 0x17, 0x12, 0x26, 0x0a, 0x22, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d,
+ 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x50, 0x48,
+ 0x4f, 0x4e, 0x45, 0x5f, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x10, 0x17, 0x12, 0x26, 0x0a, 0x22,
+ 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52,
+ 0x43, 0x45, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x53, 0x54, 0x52, 0x49,
+ 0x4e, 0x47, 0x10, 0x18, 0x12, 0x2d, 0x0a, 0x29, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52,
+ 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52,
+ 0x41, 0x54, 0x45, 0x5f, 0x52, 0x41, 0x4e, 0x44, 0x4f, 0x4d, 0x5f, 0x53, 0x54, 0x52, 0x49, 0x4e,
+ 0x47, 0x10, 0x19, 0x12, 0x2d, 0x0a, 0x29, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d,
0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41,
- 0x54, 0x45, 0x5f, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x10, 0x18, 0x12, 0x2d, 0x0a, 0x29, 0x54,
- 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43,
- 0x45, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x52, 0x41, 0x4e, 0x44, 0x4f,
- 0x4d, 0x5f, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x10, 0x19, 0x12, 0x2d, 0x0a, 0x29, 0x54, 0x52,
+ 0x54, 0x45, 0x5f, 0x55, 0x4e, 0x49, 0x58, 0x54, 0x49, 0x4d, 0x45, 0x53, 0x54, 0x41, 0x4d, 0x50,
+ 0x10, 0x1a, 0x12, 0x28, 0x0a, 0x24, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45,
+ 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54,
+ 0x45, 0x5f, 0x55, 0x53, 0x45, 0x52, 0x4e, 0x41, 0x4d, 0x45, 0x10, 0x1b, 0x12, 0x2c, 0x0a, 0x28,
+ 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52,
+ 0x43, 0x45, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x55, 0x54, 0x43, 0x54,
+ 0x49, 0x4d, 0x45, 0x53, 0x54, 0x41, 0x4d, 0x50, 0x10, 0x1c, 0x12, 0x24, 0x0a, 0x20, 0x54, 0x52,
0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45,
- 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x55, 0x4e, 0x49, 0x58, 0x54, 0x49,
- 0x4d, 0x45, 0x53, 0x54, 0x41, 0x4d, 0x50, 0x10, 0x1a, 0x12, 0x28, 0x0a, 0x24, 0x54, 0x52, 0x41,
+ 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x55, 0x55, 0x49, 0x44, 0x10, 0x1d,
+ 0x12, 0x27, 0x0a, 0x23, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f,
+ 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45, 0x5f,
+ 0x5a, 0x49, 0x50, 0x43, 0x4f, 0x44, 0x45, 0x10, 0x1e, 0x12, 0x32, 0x0a, 0x2e, 0x54, 0x52, 0x41,
0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f,
- 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x55, 0x53, 0x45, 0x52, 0x4e, 0x41, 0x4d,
- 0x45, 0x10, 0x1b, 0x12, 0x2c, 0x0a, 0x28, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d,
- 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41,
- 0x54, 0x45, 0x5f, 0x55, 0x54, 0x43, 0x54, 0x49, 0x4d, 0x45, 0x53, 0x54, 0x41, 0x4d, 0x50, 0x10,
- 0x1c, 0x12, 0x24, 0x0a, 0x20, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52,
- 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45,
- 0x5f, 0x55, 0x55, 0x49, 0x44, 0x10, 0x1d, 0x12, 0x27, 0x0a, 0x23, 0x54, 0x52, 0x41, 0x4e, 0x53,
- 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x47, 0x45,
- 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x5a, 0x49, 0x50, 0x43, 0x4f, 0x44, 0x45, 0x10, 0x1e,
- 0x12, 0x32, 0x0a, 0x2e, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f,
- 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d,
- 0x5f, 0x45, 0x31, 0x36, 0x34, 0x5f, 0x50, 0x48, 0x4f, 0x4e, 0x45, 0x5f, 0x4e, 0x55, 0x4d, 0x42,
- 0x45, 0x52, 0x10, 0x1f, 0x12, 0x2b, 0x0a, 0x27, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52,
- 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53,
- 0x46, 0x4f, 0x52, 0x4d, 0x5f, 0x46, 0x49, 0x52, 0x53, 0x54, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x10,
- 0x20, 0x12, 0x28, 0x0a, 0x24, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52,
- 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52,
- 0x4d, 0x5f, 0x46, 0x4c, 0x4f, 0x41, 0x54, 0x36, 0x34, 0x10, 0x21, 0x12, 0x2a, 0x0a, 0x26, 0x54,
- 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43,
- 0x45, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x5f, 0x46, 0x55, 0x4c, 0x4c,
- 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x10, 0x22, 0x12, 0x33, 0x0a, 0x2f, 0x54, 0x52, 0x41, 0x4e, 0x53,
- 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x54, 0x52,
- 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x5f, 0x49, 0x4e, 0x54, 0x36, 0x34, 0x5f, 0x50, 0x48,
- 0x4f, 0x4e, 0x45, 0x5f, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x10, 0x23, 0x12, 0x26, 0x0a, 0x22,
- 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52,
- 0x43, 0x45, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x5f, 0x49, 0x4e, 0x54,
- 0x36, 0x34, 0x10, 0x24, 0x12, 0x2a, 0x0a, 0x26, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52,
+ 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x5f, 0x45, 0x31, 0x36, 0x34, 0x5f, 0x50,
+ 0x48, 0x4f, 0x4e, 0x45, 0x5f, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x10, 0x1f, 0x12, 0x2b, 0x0a,
+ 0x27, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55,
+ 0x52, 0x43, 0x45, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x5f, 0x46, 0x49,
+ 0x52, 0x53, 0x54, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x10, 0x20, 0x12, 0x28, 0x0a, 0x24, 0x54, 0x52,
+ 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45,
+ 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x5f, 0x46, 0x4c, 0x4f, 0x41, 0x54,
+ 0x36, 0x34, 0x10, 0x21, 0x12, 0x2a, 0x0a, 0x26, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52,
0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53,
- 0x46, 0x4f, 0x52, 0x4d, 0x5f, 0x4c, 0x41, 0x53, 0x54, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x10, 0x25,
- 0x12, 0x2d, 0x0a, 0x29, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f,
+ 0x46, 0x4f, 0x52, 0x4d, 0x5f, 0x46, 0x55, 0x4c, 0x4c, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x10, 0x22,
+ 0x12, 0x33, 0x0a, 0x2f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f,
0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d,
- 0x5f, 0x50, 0x48, 0x4f, 0x4e, 0x45, 0x5f, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x10, 0x26, 0x12,
- 0x27, 0x0a, 0x23, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53,
- 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x5f,
- 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x10, 0x27, 0x12, 0x24, 0x0a, 0x20, 0x54, 0x52, 0x41, 0x4e,
- 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x47,
- 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x4e, 0x55, 0x4c, 0x4c, 0x10, 0x28, 0x12, 0x2b,
- 0x0a, 0x27, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f,
- 0x55, 0x52, 0x43, 0x45, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x43, 0x41,
- 0x54, 0x45, 0x47, 0x4f, 0x52, 0x49, 0x43, 0x41, 0x4c, 0x10, 0x2a, 0x12, 0x33, 0x0a, 0x2f, 0x54,
- 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43,
- 0x45, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x5f, 0x43, 0x48, 0x41, 0x52,
- 0x41, 0x43, 0x54, 0x45, 0x52, 0x5f, 0x53, 0x43, 0x52, 0x41, 0x4d, 0x42, 0x4c, 0x45, 0x10, 0x2b,
- 0x12, 0x23, 0x0a, 0x1f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f,
- 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x44, 0x45, 0x46, 0x49,
- 0x4e, 0x45, 0x44, 0x10, 0x2c, 0x12, 0x2a, 0x0a, 0x26, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f,
- 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x47, 0x45, 0x4e, 0x45,
- 0x52, 0x41, 0x54, 0x45, 0x5f, 0x4a, 0x41, 0x56, 0x41, 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x10,
- 0x2d, 0x12, 0x27, 0x0a, 0x23, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52,
+ 0x5f, 0x49, 0x4e, 0x54, 0x36, 0x34, 0x5f, 0x50, 0x48, 0x4f, 0x4e, 0x45, 0x5f, 0x4e, 0x55, 0x4d,
+ 0x42, 0x45, 0x52, 0x10, 0x23, 0x12, 0x26, 0x0a, 0x22, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f,
+ 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x54, 0x52, 0x41, 0x4e,
+ 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x5f, 0x49, 0x4e, 0x54, 0x36, 0x34, 0x10, 0x24, 0x12, 0x2a, 0x0a,
+ 0x26, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55,
+ 0x52, 0x43, 0x45, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x5f, 0x4c, 0x41,
+ 0x53, 0x54, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x10, 0x25, 0x12, 0x2d, 0x0a, 0x29, 0x54, 0x52, 0x41,
+ 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f,
+ 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x5f, 0x50, 0x48, 0x4f, 0x4e, 0x45, 0x5f,
+ 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x10, 0x26, 0x12, 0x27, 0x0a, 0x23, 0x54, 0x52, 0x41, 0x4e,
+ 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x54,
+ 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x5f, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x10,
+ 0x27, 0x12, 0x24, 0x0a, 0x20, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52,
0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45,
- 0x5f, 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x52, 0x59, 0x10, 0x2e, 0x12, 0x29, 0x0a, 0x25, 0x54, 0x52,
+ 0x5f, 0x4e, 0x55, 0x4c, 0x4c, 0x10, 0x28, 0x12, 0x2b, 0x0a, 0x27, 0x54, 0x52, 0x41, 0x4e, 0x53,
+ 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x47, 0x45,
+ 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x43, 0x41, 0x54, 0x45, 0x47, 0x4f, 0x52, 0x49, 0x43,
+ 0x41, 0x4c, 0x10, 0x2a, 0x12, 0x33, 0x0a, 0x2f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52,
+ 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53,
+ 0x46, 0x4f, 0x52, 0x4d, 0x5f, 0x43, 0x48, 0x41, 0x52, 0x41, 0x43, 0x54, 0x45, 0x52, 0x5f, 0x53,
+ 0x43, 0x52, 0x41, 0x4d, 0x42, 0x4c, 0x45, 0x10, 0x2b, 0x12, 0x23, 0x0a, 0x1f, 0x54, 0x52, 0x41,
+ 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f,
+ 0x55, 0x53, 0x45, 0x52, 0x5f, 0x44, 0x45, 0x46, 0x49, 0x4e, 0x45, 0x44, 0x10, 0x2c, 0x12, 0x2a,
+ 0x0a, 0x26, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f,
+ 0x55, 0x52, 0x43, 0x45, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x4a, 0x41,
+ 0x56, 0x41, 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x10, 0x2d, 0x12, 0x27, 0x0a, 0x23, 0x54, 0x52,
0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45,
- 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x5f, 0x50, 0x49, 0x49, 0x5f, 0x54,
- 0x45, 0x58, 0x54, 0x10, 0x2f, 0x2a, 0xc4, 0x02, 0x0a, 0x13, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66,
- 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, 0x25, 0x0a,
- 0x21, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x44, 0x41, 0x54,
- 0x41, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49,
- 0x45, 0x44, 0x10, 0x00, 0x12, 0x20, 0x0a, 0x1c, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52,
- 0x4d, 0x45, 0x52, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x54,
- 0x52, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x1f, 0x0a, 0x1b, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46,
+ 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x52,
+ 0x59, 0x10, 0x2e, 0x12, 0x29, 0x0a, 0x25, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d,
+ 0x45, 0x52, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46,
+ 0x4f, 0x52, 0x4d, 0x5f, 0x50, 0x49, 0x49, 0x5f, 0x54, 0x45, 0x58, 0x54, 0x10, 0x2f, 0x2a, 0xc4,
+ 0x02, 0x0a, 0x13, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x44, 0x61,
+ 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x12, 0x25, 0x0a, 0x21, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46,
0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f,
- 0x49, 0x4e, 0x54, 0x36, 0x34, 0x10, 0x02, 0x12, 0x21, 0x0a, 0x1d, 0x54, 0x52, 0x41, 0x4e, 0x53,
- 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x5f, 0x54, 0x59, 0x50, 0x45,
- 0x5f, 0x42, 0x4f, 0x4f, 0x4c, 0x45, 0x41, 0x4e, 0x10, 0x03, 0x12, 0x21, 0x0a, 0x1d, 0x54, 0x52,
- 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x5f, 0x54,
- 0x59, 0x50, 0x45, 0x5f, 0x46, 0x4c, 0x4f, 0x41, 0x54, 0x36, 0x34, 0x10, 0x04, 0x12, 0x1e, 0x0a,
- 0x1a, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x44, 0x41, 0x54,
- 0x41, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4e, 0x55, 0x4c, 0x4c, 0x10, 0x05, 0x12, 0x1d, 0x0a,
- 0x19, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x44, 0x41, 0x54,
- 0x41, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x41, 0x4e, 0x59, 0x10, 0x06, 0x12, 0x1e, 0x0a, 0x1a,
- 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x44, 0x41, 0x54, 0x41,
- 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x54, 0x49, 0x4d, 0x45, 0x10, 0x07, 0x12, 0x1e, 0x0a, 0x1a,
- 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x44, 0x41, 0x54, 0x41,
- 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x55, 0x49, 0x44, 0x10, 0x08, 0x2a, 0x74, 0x0a, 0x10,
- 0x53, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x4a, 0x6f, 0x62, 0x54, 0x79, 0x70, 0x65,
- 0x12, 0x22, 0x0a, 0x1e, 0x53, 0x55, 0x50, 0x50, 0x4f, 0x52, 0x54, 0x45, 0x44, 0x5f, 0x4a, 0x4f,
- 0x42, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49,
- 0x45, 0x44, 0x10, 0x00, 0x12, 0x1b, 0x0a, 0x17, 0x53, 0x55, 0x50, 0x50, 0x4f, 0x52, 0x54, 0x45,
- 0x44, 0x5f, 0x4a, 0x4f, 0x42, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x59, 0x4e, 0x43, 0x10,
- 0x01, 0x12, 0x1f, 0x0a, 0x1b, 0x53, 0x55, 0x50, 0x50, 0x4f, 0x52, 0x54, 0x45, 0x44, 0x5f, 0x4a,
- 0x4f, 0x42, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45,
- 0x10, 0x02, 0x2a, 0x7b, 0x0a, 0x11, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x45, 0x6d,
- 0x61, 0x69, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x1f, 0x47, 0x45, 0x4e, 0x45, 0x52,
- 0x41, 0x54, 0x45, 0x5f, 0x45, 0x4d, 0x41, 0x49, 0x4c, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55,
- 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1f, 0x0a, 0x1b,
- 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x45, 0x4d, 0x41, 0x49, 0x4c, 0x5f, 0x54,
- 0x59, 0x50, 0x45, 0x5f, 0x55, 0x55, 0x49, 0x44, 0x5f, 0x56, 0x34, 0x10, 0x01, 0x12, 0x20, 0x0a,
- 0x1c, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x45, 0x4d, 0x41, 0x49, 0x4c, 0x5f,
- 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x55, 0x4c, 0x4c, 0x4e, 0x41, 0x4d, 0x45, 0x10, 0x02, 0x2a,
- 0xc3, 0x01, 0x0a, 0x12, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x45, 0x6d, 0x61, 0x69, 0x6c,
- 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x0a, 0x20, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49,
- 0x44, 0x5f, 0x45, 0x4d, 0x41, 0x49, 0x4c, 0x5f, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55,
- 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1f, 0x0a, 0x1b,
- 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x45, 0x4d, 0x41, 0x49, 0x4c, 0x5f, 0x41, 0x43,
- 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x4a, 0x45, 0x43, 0x54, 0x10, 0x01, 0x12, 0x1d, 0x0a,
- 0x19, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x45, 0x4d, 0x41, 0x49, 0x4c, 0x5f, 0x41,
- 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4e, 0x55, 0x4c, 0x4c, 0x10, 0x02, 0x12, 0x24, 0x0a, 0x20,
- 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x45, 0x4d, 0x41, 0x49, 0x4c, 0x5f, 0x41, 0x43,
- 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x50, 0x41, 0x53, 0x53, 0x54, 0x48, 0x52, 0x4f, 0x55, 0x47, 0x48,
- 0x10, 0x03, 0x12, 0x21, 0x0a, 0x1d, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x45, 0x4d,
- 0x41, 0x49, 0x4c, 0x5f, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52,
- 0x41, 0x54, 0x45, 0x10, 0x04, 0x32, 0xd2, 0x0a, 0x0a, 0x13, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66,
- 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x73, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x74, 0x0a,
- 0x15, 0x47, 0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66,
- 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x73, 0x12, 0x2b, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x76, 0x31,
- 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d,
- 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75,
- 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70,
- 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x54, 0x72, 0x61,
- 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
- 0x65, 0x22, 0x00, 0x12, 0x89, 0x01, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65,
- 0x6d, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x42, 0x79, 0x53, 0x6f,
- 0x75, 0x72, 0x63, 0x65, 0x12, 0x32, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x76, 0x31, 0x61, 0x6c,
- 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x54, 0x72,
- 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x42, 0x79, 0x53, 0x6f, 0x75, 0x72, 0x63,
- 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e,
- 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x79, 0x73, 0x74,
- 0x65, 0x6d, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x42, 0x79, 0x53,
- 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12,
- 0x83, 0x01, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x66, 0x69, 0x6e,
- 0x65, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x73, 0x12, 0x30,
- 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47,
- 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x54, 0x72, 0x61,
- 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
- 0x1a, 0x31, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31,
- 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x54,
- 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f,
- 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x8c, 0x01, 0x0a, 0x1d, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65,
- 0x72, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72,
- 0x6d, 0x65, 0x72, 0x42, 0x79, 0x49, 0x64, 0x12, 0x33, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x76,
- 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x44,
- 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65,
- 0x72, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x6d,
+ 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x20, 0x0a,
+ 0x1c, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x44, 0x41, 0x54,
+ 0x41, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12,
+ 0x1f, 0x0a, 0x1b, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x44,
+ 0x41, 0x54, 0x41, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4e, 0x54, 0x36, 0x34, 0x10, 0x02,
+ 0x12, 0x21, 0x0a, 0x1d, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f,
+ 0x44, 0x41, 0x54, 0x41, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x4f, 0x4f, 0x4c, 0x45, 0x41,
+ 0x4e, 0x10, 0x03, 0x12, 0x21, 0x0a, 0x1d, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f, 0x52, 0x4d,
+ 0x45, 0x52, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x4c, 0x4f,
+ 0x41, 0x54, 0x36, 0x34, 0x10, 0x04, 0x12, 0x1e, 0x0a, 0x1a, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46,
+ 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f,
+ 0x4e, 0x55, 0x4c, 0x4c, 0x10, 0x05, 0x12, 0x1d, 0x0a, 0x19, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46,
+ 0x4f, 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f,
+ 0x41, 0x4e, 0x59, 0x10, 0x06, 0x12, 0x1e, 0x0a, 0x1a, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f,
+ 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x54,
+ 0x49, 0x4d, 0x45, 0x10, 0x07, 0x12, 0x1e, 0x0a, 0x1a, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x4f,
+ 0x52, 0x4d, 0x45, 0x52, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55,
+ 0x55, 0x49, 0x44, 0x10, 0x08, 0x2a, 0x74, 0x0a, 0x10, 0x53, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74,
+ 0x65, 0x64, 0x4a, 0x6f, 0x62, 0x54, 0x79, 0x70, 0x65, 0x12, 0x22, 0x0a, 0x1e, 0x53, 0x55, 0x50,
+ 0x50, 0x4f, 0x52, 0x54, 0x45, 0x44, 0x5f, 0x4a, 0x4f, 0x42, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f,
+ 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1b, 0x0a,
+ 0x17, 0x53, 0x55, 0x50, 0x50, 0x4f, 0x52, 0x54, 0x45, 0x44, 0x5f, 0x4a, 0x4f, 0x42, 0x5f, 0x54,
+ 0x59, 0x50, 0x45, 0x5f, 0x53, 0x59, 0x4e, 0x43, 0x10, 0x01, 0x12, 0x1f, 0x0a, 0x1b, 0x53, 0x55,
+ 0x50, 0x50, 0x4f, 0x52, 0x54, 0x45, 0x44, 0x5f, 0x4a, 0x4f, 0x42, 0x5f, 0x54, 0x59, 0x50, 0x45,
+ 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45, 0x10, 0x02, 0x2a, 0x7b, 0x0a, 0x11, 0x47,
+ 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x54, 0x79, 0x70, 0x65,
+ 0x12, 0x23, 0x0a, 0x1f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x45, 0x4d, 0x41,
+ 0x49, 0x4c, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46,
+ 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1f, 0x0a, 0x1b, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54,
+ 0x45, 0x5f, 0x45, 0x4d, 0x41, 0x49, 0x4c, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x55, 0x49,
+ 0x44, 0x5f, 0x56, 0x34, 0x10, 0x01, 0x12, 0x20, 0x0a, 0x1c, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41,
+ 0x54, 0x45, 0x5f, 0x45, 0x4d, 0x41, 0x49, 0x4c, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x55,
+ 0x4c, 0x4c, 0x4e, 0x41, 0x4d, 0x45, 0x10, 0x02, 0x2a, 0xc3, 0x01, 0x0a, 0x12, 0x49, 0x6e, 0x76,
+ 0x61, 0x6c, 0x69, 0x64, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12,
+ 0x24, 0x0a, 0x20, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x45, 0x4d, 0x41, 0x49, 0x4c,
+ 0x5f, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46,
+ 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1f, 0x0a, 0x1b, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44,
+ 0x5f, 0x45, 0x4d, 0x41, 0x49, 0x4c, 0x5f, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x45,
+ 0x4a, 0x45, 0x43, 0x54, 0x10, 0x01, 0x12, 0x1d, 0x0a, 0x19, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49,
+ 0x44, 0x5f, 0x45, 0x4d, 0x41, 0x49, 0x4c, 0x5f, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4e,
+ 0x55, 0x4c, 0x4c, 0x10, 0x02, 0x12, 0x24, 0x0a, 0x20, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44,
+ 0x5f, 0x45, 0x4d, 0x41, 0x49, 0x4c, 0x5f, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x50, 0x41,
+ 0x53, 0x53, 0x54, 0x48, 0x52, 0x4f, 0x55, 0x47, 0x48, 0x10, 0x03, 0x12, 0x21, 0x0a, 0x1d, 0x49,
+ 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x45, 0x4d, 0x41, 0x49, 0x4c, 0x5f, 0x41, 0x43, 0x54,
+ 0x49, 0x4f, 0x4e, 0x5f, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x41, 0x54, 0x45, 0x10, 0x04, 0x32, 0xd2,
+ 0x0a, 0x0a, 0x13, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x73, 0x53,
+ 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x74, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x53, 0x79, 0x73,
+ 0x74, 0x65, 0x6d, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x73, 0x12,
+ 0x2b, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e,
+ 0x47, 0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f,
+ 0x72, 0x6d, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x6d,
0x67, 0x6d, 0x74, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74,
+ 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65,
+ 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x89, 0x01, 0x0a,
+ 0x1c, 0x47, 0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66,
+ 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x42, 0x79, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x32, 0x2e,
+ 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65,
+ 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d,
+ 0x65, 0x72, 0x42, 0x79, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
+ 0x74, 0x1a, 0x33, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61,
+ 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x54, 0x72, 0x61, 0x6e, 0x73,
+ 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x42, 0x79, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65,
+ 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x83, 0x01, 0x0a, 0x1a, 0x47, 0x65, 0x74,
0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73,
- 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
- 0x73, 0x65, 0x22, 0x00, 0x12, 0x89, 0x01, 0x0a, 0x1c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55,
- 0x73, 0x65, 0x72, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66,
- 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x12, 0x32, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x76, 0x31, 0x61,
- 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72,
- 0x44, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d,
- 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x6d, 0x67, 0x6d, 0x74,
- 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65,
- 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73,
- 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00,
- 0x12, 0x89, 0x01, 0x0a, 0x1c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x44,
+ 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x73, 0x12, 0x30, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x76,
+ 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x44,
0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65,
- 0x72, 0x12, 0x32, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61,
- 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x66, 0x69,
- 0x6e, 0x65, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x52, 0x65,
- 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x76, 0x31, 0x61,
- 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72,
- 0x44, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d,
- 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x89, 0x01, 0x0a,
- 0x1c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x66, 0x69, 0x6e,
- 0x65, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x12, 0x32, 0x2e,
- 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x70,
- 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x54,
- 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
- 0x74, 0x1a, 0x33, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61,
- 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x66, 0x69,
- 0x6e, 0x65, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x52, 0x65,
- 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x83, 0x01, 0x0a, 0x1a, 0x49, 0x73, 0x54,
- 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x41, 0x76,
- 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x30, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x76,
- 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x49, 0x73, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66,
- 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62,
- 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x6d, 0x67, 0x6d, 0x74,
- 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x49, 0x73, 0x54, 0x72, 0x61, 0x6e,
- 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x41, 0x76, 0x61, 0x69, 0x6c,
- 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x83,
- 0x01, 0x0a, 0x1a, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x4a,
- 0x61, 0x76, 0x61, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x30, 0x2e,
- 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61,
- 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x4a, 0x61, 0x76, 0x61, 0x73, 0x63,
- 0x72, 0x69, 0x70, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
- 0x31, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e,
- 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x4a, 0x61, 0x76, 0x61,
- 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
- 0x73, 0x65, 0x22, 0x00, 0x12, 0x74, 0x0a, 0x15, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65,
- 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x67, 0x65, 0x78, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x2b, 0x2e,
- 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61,
- 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x67, 0x65, 0x78, 0x43,
- 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x6d, 0x67, 0x6d,
- 0x74, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64,
- 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x67, 0x65, 0x78, 0x43, 0x6f, 0x64, 0x65,
- 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0xcc, 0x01, 0x0a, 0x11, 0x63,
- 0x6f, 0x6d, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31,
- 0x42, 0x10, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x50, 0x72, 0x6f,
- 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x50, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
- 0x2f, 0x6e, 0x75, 0x63, 0x6c, 0x65, 0x75, 0x73, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x6e, 0x65,
- 0x6f, 0x73, 0x79, 0x6e, 0x63, 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x2f, 0x67, 0x65,
- 0x6e, 0x2f, 0x67, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x6d, 0x67, 0x6d, 0x74,
- 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x6d, 0x67, 0x6d, 0x74, 0x76, 0x31,
- 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x4d, 0x58, 0x58, 0xaa, 0x02, 0x0d, 0x4d,
- 0x67, 0x6d, 0x74, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x0d, 0x4d,
- 0x67, 0x6d, 0x74, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, 0x19, 0x4d,
- 0x67, 0x6d, 0x74, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42,
- 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4d, 0x67, 0x6d, 0x74, 0x3a,
- 0x3a, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
- 0x33,
+ 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x6d, 0x67, 0x6d, 0x74,
+ 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65,
+ 0x72, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72,
+ 0x6d, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x8c,
+ 0x01, 0x0a, 0x1d, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x65,
+ 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x42, 0x79, 0x49, 0x64,
+ 0x12, 0x33, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31,
+ 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x54,
+ 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x42, 0x79, 0x49, 0x64, 0x52, 0x65,
+ 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x76, 0x31, 0x61,
+ 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x66,
+ 0x69, 0x6e, 0x65, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x42,
+ 0x79, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x89, 0x01,
+ 0x0a, 0x1c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x66, 0x69,
+ 0x6e, 0x65, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x12, 0x32,
+ 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43,
+ 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64,
+ 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65,
+ 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68,
+ 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x66,
+ 0x69, 0x6e, 0x65, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x52,
+ 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x89, 0x01, 0x0a, 0x1c, 0x44, 0x65,
+ 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x54,
+ 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x12, 0x32, 0x2e, 0x6d, 0x67, 0x6d,
+ 0x74, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74,
+ 0x65, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x54, 0x72, 0x61, 0x6e,
+ 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33,
+ 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44,
+ 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64,
+ 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f,
+ 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x89, 0x01, 0x0a, 0x1c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
+ 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73,
+ 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x12, 0x32, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x76, 0x31,
+ 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65,
+ 0x72, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72,
+ 0x6d, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x6d, 0x67, 0x6d,
+ 0x74, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74,
+ 0x65, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x54, 0x72, 0x61, 0x6e,
+ 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
+ 0x00, 0x12, 0x83, 0x01, 0x0a, 0x1a, 0x49, 0x73, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72,
+ 0x6d, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65,
+ 0x12, 0x30, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31,
+ 0x2e, 0x49, 0x73, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x4e, 0x61,
+ 0x6d, 0x65, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65,
+ 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68,
+ 0x61, 0x31, 0x2e, 0x49, 0x73, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72,
+ 0x4e, 0x61, 0x6d, 0x65, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x73,
+ 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x83, 0x01, 0x0a, 0x1a, 0x56, 0x61, 0x6c, 0x69,
+ 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x4a, 0x61, 0x76, 0x61, 0x73, 0x63, 0x72, 0x69,
+ 0x70, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x30, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x76, 0x31,
+ 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x55,
+ 0x73, 0x65, 0x72, 0x4a, 0x61, 0x76, 0x61, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x43, 0x6f, 0x64,
+ 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e,
+ 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74,
+ 0x65, 0x55, 0x73, 0x65, 0x72, 0x4a, 0x61, 0x76, 0x61, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x43,
+ 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x74, 0x0a,
+ 0x15, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x67,
+ 0x65, 0x78, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x2b, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x76, 0x31,
+ 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x55,
+ 0x73, 0x65, 0x72, 0x52, 0x65, 0x67, 0x65, 0x78, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75,
+ 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x6d, 0x67, 0x6d, 0x74, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70,
+ 0x68, 0x61, 0x31, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72,
+ 0x52, 0x65, 0x67, 0x65, 0x78, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
+ 0x65, 0x22, 0x00, 0x42, 0xcc, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x67, 0x6d, 0x74,
+ 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x10, 0x54, 0x72, 0x61, 0x6e, 0x73,
+ 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x50, 0x67,
+ 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6e, 0x75, 0x63, 0x6c, 0x65, 0x75,
+ 0x73, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x6e, 0x65, 0x6f, 0x73, 0x79, 0x6e, 0x63, 0x2f, 0x62,
+ 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x6f, 0x2f, 0x70, 0x72,
+ 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x6d, 0x67, 0x6d, 0x74, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68,
+ 0x61, 0x31, 0x3b, 0x6d, 0x67, 0x6d, 0x74, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2,
+ 0x02, 0x03, 0x4d, 0x58, 0x58, 0xaa, 0x02, 0x0d, 0x4d, 0x67, 0x6d, 0x74, 0x2e, 0x56, 0x31, 0x61,
+ 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x0d, 0x4d, 0x67, 0x6d, 0x74, 0x5c, 0x56, 0x31, 0x61,
+ 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, 0x19, 0x4d, 0x67, 0x6d, 0x74, 0x5c, 0x56, 0x31, 0x61,
+ 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74,
+ 0x61, 0xea, 0x02, 0x0e, 0x4d, 0x67, 0x6d, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68,
+ 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -5895,7 +5938,27 @@ func file_mgmt_v1alpha1_transformer_proto_init() {
}
file_mgmt_v1alpha1_transformer_proto_msgTypes[22].OneofWrappers = []any{}
file_mgmt_v1alpha1_transformer_proto_msgTypes[23].OneofWrappers = []any{}
+ file_mgmt_v1alpha1_transformer_proto_msgTypes[25].OneofWrappers = []any{}
+ file_mgmt_v1alpha1_transformer_proto_msgTypes[28].OneofWrappers = []any{}
+ file_mgmt_v1alpha1_transformer_proto_msgTypes[30].OneofWrappers = []any{}
+ file_mgmt_v1alpha1_transformer_proto_msgTypes[33].OneofWrappers = []any{}
+ file_mgmt_v1alpha1_transformer_proto_msgTypes[35].OneofWrappers = []any{}
+ file_mgmt_v1alpha1_transformer_proto_msgTypes[39].OneofWrappers = []any{}
+ file_mgmt_v1alpha1_transformer_proto_msgTypes[41].OneofWrappers = []any{}
+ file_mgmt_v1alpha1_transformer_proto_msgTypes[42].OneofWrappers = []any{}
+ file_mgmt_v1alpha1_transformer_proto_msgTypes[46].OneofWrappers = []any{}
+ file_mgmt_v1alpha1_transformer_proto_msgTypes[48].OneofWrappers = []any{}
+ file_mgmt_v1alpha1_transformer_proto_msgTypes[49].OneofWrappers = []any{}
+ file_mgmt_v1alpha1_transformer_proto_msgTypes[50].OneofWrappers = []any{}
+ file_mgmt_v1alpha1_transformer_proto_msgTypes[51].OneofWrappers = []any{}
+ file_mgmt_v1alpha1_transformer_proto_msgTypes[52].OneofWrappers = []any{}
+ file_mgmt_v1alpha1_transformer_proto_msgTypes[53].OneofWrappers = []any{}
+ file_mgmt_v1alpha1_transformer_proto_msgTypes[54].OneofWrappers = []any{}
+ file_mgmt_v1alpha1_transformer_proto_msgTypes[55].OneofWrappers = []any{}
+ file_mgmt_v1alpha1_transformer_proto_msgTypes[56].OneofWrappers = []any{}
+ file_mgmt_v1alpha1_transformer_proto_msgTypes[63].OneofWrappers = []any{}
file_mgmt_v1alpha1_transformer_proto_msgTypes[64].OneofWrappers = []any{}
+ file_mgmt_v1alpha1_transformer_proto_msgTypes[68].OneofWrappers = []any{}
file_mgmt_v1alpha1_transformer_proto_msgTypes[69].OneofWrappers = []any{}
file_mgmt_v1alpha1_transformer_proto_msgTypes[71].OneofWrappers = []any{}
file_mgmt_v1alpha1_transformer_proto_msgTypes[72].OneofWrappers = []any{}
diff --git a/backend/protos/mgmt/v1alpha1/transformer.proto b/backend/protos/mgmt/v1alpha1/transformer.proto
index 2d63dcd002..b3b44f9777 100644
--- a/backend/protos/mgmt/v1alpha1/transformer.proto
+++ b/backend/protos/mgmt/v1alpha1/transformer.proto
@@ -317,9 +317,9 @@ enum InvalidEmailAction {
message TransformEmail {
// Whether or not to preserve the original domain, barring what has been specified in the excluded_domains property.
- bool preserve_domain = 1;
+ optional bool preserve_domain = 1;
// Whether or not to preserve the original length of the email. This causes the transformed email to retain the original length.
- bool preserve_length = 2;
+ optional bool preserve_length = 2;
// A lsit of email domains that should be excluded. This changes based on the preserve_domain flag. See the docs for more details.
repeated string excluded_domains = 3;
// Optionally specify the type of email to generate. The types specified determine the contents on the left side of the @.
@@ -331,7 +331,7 @@ message TransformEmail {
message GenerateBool {}
message GenerateCardNumber {
- bool valid_luhn = 1;
+ optional bool valid_luhn = 1;
}
message GenerateCity {}
@@ -339,17 +339,17 @@ message GenerateCity {}
message GenerateDefault {}
message GenerateE164PhoneNumber {
- int64 min = 1;
- int64 max = 2;
+ optional int64 min = 1;
+ optional int64 max = 2;
}
message GenerateFirstName {}
message GenerateFloat64 {
- bool randomize_sign = 1;
- double min = 2;
- double max = 3;
- int64 precision = 4;
+ optional bool randomize_sign = 1;
+ optional double min = 2;
+ optional double max = 3;
+ optional int64 precision = 4;
}
message GenerateFullAddress {}
@@ -357,15 +357,15 @@ message GenerateFullAddress {}
message GenerateFullName {}
message GenerateGender {
- bool abbreviate = 1;
+ optional bool abbreviate = 1;
}
message GenerateInt64PhoneNumber {}
message GenerateInt64 {
- bool randomize_sign = 1;
- int64 min = 2;
- int64 max = 3;
+ optional bool randomize_sign = 1;
+ optional int64 min = 2;
+ optional int64 max = 3;
}
message GenerateLastName {}
@@ -375,19 +375,19 @@ message GenerateSSN {}
message GenerateState {
// An option to return the full state name of the randomly selected state or return the default of a 2-letter state code.
- bool generate_full_name = 1;
+ optional bool generate_full_name = 1;
}
message GenerateStreetAddress {}
message GenerateStringPhoneNumber {
- int64 min = 2;
- int64 max = 3;
+ optional int64 min = 2;
+ optional int64 max = 3;
}
message GenerateString {
- int64 min = 1;
- int64 max = 2;
+ optional int64 min = 1;
+ optional int64 max = 2;
}
message GenerateUnixTimestamp {}
@@ -397,47 +397,47 @@ message GenerateUsername {}
message GenerateUtcTimestamp {}
message GenerateUuid {
- bool include_hyphens = 1;
+ optional bool include_hyphens = 1;
}
message GenerateZipcode {}
message TransformE164PhoneNumber {
- bool preserve_length = 1;
+ optional bool preserve_length = 1;
}
message TransformFirstName {
- bool preserve_length = 1;
+ optional bool preserve_length = 1;
}
message TransformFloat64 {
- double randomization_range_min = 1;
- double randomization_range_max = 2;
+ optional double randomization_range_min = 1;
+ optional double randomization_range_max = 2;
}
message TransformFullName {
- bool preserve_length = 1;
+ optional bool preserve_length = 1;
}
message TransformInt64PhoneNumber {
- bool preserve_length = 1;
+ optional bool preserve_length = 1;
}
message TransformInt64 {
- int64 randomization_range_min = 1;
- int64 randomization_range_max = 2;
+ optional int64 randomization_range_min = 1;
+ optional int64 randomization_range_max = 2;
}
message TransformLastName {
- bool preserve_length = 1;
+ optional bool preserve_length = 1;
}
message TransformPhoneNumber {
- bool preserve_length = 1;
+ optional bool preserve_length = 1;
}
message TransformString {
- bool preserve_length = 1;
+ optional bool preserve_length = 1;
}
message Passthrough {}
@@ -463,7 +463,7 @@ message ValidateUserJavascriptCodeResponse {
}
message GenerateCategorical {
- string categories = 1;
+ optional string categories = 1;
}
message TransformCharacterScramble {
@@ -487,7 +487,7 @@ message ValidateUserRegexCodeResponse {
message GenerateCountry {
// An option to return the full country name of the randomly selected country or return the default of a 2-letter country code.
- bool generate_full_name = 1;
+ optional bool generate_full_name = 1;
}
service TransformersService {
diff --git a/backend/services/mgmt/v1alpha1/integration_tests/anonymization-service_integration_test.go b/backend/services/mgmt/v1alpha1/integration_tests/anonymization-service_integration_test.go
index 67225f24d3..37255bcccd 100644
--- a/backend/services/mgmt/v1alpha1/integration_tests/anonymization-service_integration_test.go
+++ b/backend/services/mgmt/v1alpha1/integration_tests/anonymization-service_integration_test.go
@@ -8,6 +8,7 @@ import (
"connectrpc.com/connect"
mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
+ "github.com/nucleuscloud/neosync/internal/gotypeutil"
"github.com/stretchr/testify/require"
"github.com/stripe/stripe-go/v79"
)
@@ -105,8 +106,8 @@ func (s *IntegrationTestSuite) Test_AnonymizeService_AnonymizeMany() {
N: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_GenerateInt64Config{
GenerateInt64Config: &mgmtv1alpha1.GenerateInt64{
- Min: 18,
- Max: 30,
+ Min: gotypeutil.ToPtr(int64(18)),
+ Max: gotypeutil.ToPtr(int64(30)),
},
},
},
@@ -179,8 +180,8 @@ func (s *IntegrationTestSuite) Test_AnonymizeService_AnonymizeSingle() {
N: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_GenerateInt64Config{
GenerateInt64Config: &mgmtv1alpha1.GenerateInt64{
- Min: 18,
- Max: 30,
+ Min: gotypeutil.ToPtr(int64(18)),
+ Max: gotypeutil.ToPtr(int64(30)),
},
},
},
diff --git a/backend/services/mgmt/v1alpha1/transformers-service/system_transformers.go b/backend/services/mgmt/v1alpha1/transformers-service/system_transformers.go
index 43d69034d2..c9c07b9d5a 100644
--- a/backend/services/mgmt/v1alpha1/transformers-service/system_transformers.go
+++ b/backend/services/mgmt/v1alpha1/transformers-service/system_transformers.go
@@ -9,6 +9,7 @@ import (
mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
nucleuserrors "github.com/nucleuscloud/neosync/backend/internal/errors"
ee_transformers "github.com/nucleuscloud/neosync/internal/ee/transformers"
+ "github.com/nucleuscloud/neosync/internal/gotypeutil"
"github.com/spf13/viper"
)
@@ -44,8 +45,8 @@ var (
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_TransformEmailConfig{
TransformEmailConfig: &mgmtv1alpha1.TransformEmail{
- PreserveDomain: false,
- PreserveLength: false,
+ PreserveDomain: gotypeutil.ToPtr(false),
+ PreserveLength: gotypeutil.ToPtr(false),
ExcludedDomains: []string{},
EmailType: &defaultGenerateEmailType,
InvalidEmailAction: &defaultInvalidEmailAction,
@@ -76,7 +77,7 @@ var (
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_GenerateCardNumberConfig{
GenerateCardNumberConfig: &mgmtv1alpha1.GenerateCardNumber{
- ValidLuhn: true,
+ ValidLuhn: gotypeutil.ToPtr(true),
},
},
},
@@ -117,8 +118,8 @@ var (
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_GenerateE164PhoneNumberConfig{
GenerateE164PhoneNumberConfig: &mgmtv1alpha1.GenerateE164PhoneNumber{
- Min: 9,
- Max: 15,
+ Min: gotypeutil.ToPtr(int64(9)),
+ Max: gotypeutil.ToPtr(int64(15)),
},
},
},
@@ -146,10 +147,10 @@ var (
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_GenerateFloat64Config{
GenerateFloat64Config: &mgmtv1alpha1.GenerateFloat64{
- RandomizeSign: false,
- Min: 1.00,
- Max: 100.00,
- Precision: 6,
+ RandomizeSign: gotypeutil.ToPtr(false),
+ Min: gotypeutil.ToPtr(1.00),
+ Max: gotypeutil.ToPtr(100.00),
+ Precision: gotypeutil.ToPtr(int64(6)),
},
},
},
@@ -190,7 +191,7 @@ var (
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_GenerateGenderConfig{
GenerateGenderConfig: &mgmtv1alpha1.GenerateGender{
- Abbreviate: false,
+ Abbreviate: gotypeutil.ToPtr(false),
},
},
},
@@ -218,9 +219,9 @@ var (
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_GenerateInt64Config{
GenerateInt64Config: &mgmtv1alpha1.GenerateInt64{
- RandomizeSign: false,
- Min: 1,
- Max: 40,
+ RandomizeSign: gotypeutil.ToPtr(false),
+ Min: gotypeutil.ToPtr(int64(1)),
+ Max: gotypeutil.ToPtr(int64(40)),
},
},
},
@@ -274,7 +275,7 @@ var (
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_GenerateStateConfig{
GenerateStateConfig: &mgmtv1alpha1.GenerateState{
- GenerateFullName: false,
+ GenerateFullName: gotypeutil.ToPtr(false),
},
},
},
@@ -302,8 +303,8 @@ var (
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_GenerateStringPhoneNumberConfig{
GenerateStringPhoneNumberConfig: &mgmtv1alpha1.GenerateStringPhoneNumber{
- Min: 9,
- Max: 14,
+ Min: gotypeutil.ToPtr(int64(9)),
+ Max: gotypeutil.ToPtr(int64(14)),
},
},
},
@@ -318,8 +319,8 @@ var (
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_GenerateStringConfig{
GenerateStringConfig: &mgmtv1alpha1.GenerateString{
- Min: 2,
- Max: 7,
+ Min: gotypeutil.ToPtr(int64(2)),
+ Max: gotypeutil.ToPtr(int64(7)),
},
},
},
@@ -373,7 +374,7 @@ var (
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_GenerateUuidConfig{
GenerateUuidConfig: &mgmtv1alpha1.GenerateUuid{
- IncludeHyphens: true,
+ IncludeHyphens: gotypeutil.ToPtr(true),
},
},
},
@@ -401,7 +402,7 @@ var (
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_TransformE164PhoneNumberConfig{
TransformE164PhoneNumberConfig: &mgmtv1alpha1.TransformE164PhoneNumber{
- PreserveLength: false,
+ PreserveLength: gotypeutil.ToPtr(false),
},
},
},
@@ -416,7 +417,7 @@ var (
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_TransformFirstNameConfig{
TransformFirstNameConfig: &mgmtv1alpha1.TransformFirstName{
- PreserveLength: false,
+ PreserveLength: gotypeutil.ToPtr(false),
},
},
},
@@ -431,8 +432,8 @@ var (
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_TransformFloat64Config{
TransformFloat64Config: &mgmtv1alpha1.TransformFloat64{
- RandomizationRangeMin: 20.00,
- RandomizationRangeMax: 50.00,
+ RandomizationRangeMin: gotypeutil.ToPtr(20.00),
+ RandomizationRangeMax: gotypeutil.ToPtr(50.00),
},
},
},
@@ -447,7 +448,7 @@ var (
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_TransformFullNameConfig{
TransformFullNameConfig: &mgmtv1alpha1.TransformFullName{
- PreserveLength: false,
+ PreserveLength: gotypeutil.ToPtr(false),
},
},
},
@@ -462,7 +463,7 @@ var (
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_TransformInt64PhoneNumberConfig{
TransformInt64PhoneNumberConfig: &mgmtv1alpha1.TransformInt64PhoneNumber{
- PreserveLength: false,
+ PreserveLength: gotypeutil.ToPtr(false),
},
},
},
@@ -477,8 +478,8 @@ var (
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_TransformInt64Config{
TransformInt64Config: &mgmtv1alpha1.TransformInt64{
- RandomizationRangeMin: 20,
- RandomizationRangeMax: 50,
+ RandomizationRangeMin: gotypeutil.ToPtr(int64(20)),
+ RandomizationRangeMax: gotypeutil.ToPtr(int64(50)),
},
},
},
@@ -493,7 +494,7 @@ var (
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_TransformLastNameConfig{
TransformLastNameConfig: &mgmtv1alpha1.TransformLastName{
- PreserveLength: false,
+ PreserveLength: gotypeutil.ToPtr(false),
},
},
},
@@ -508,7 +509,7 @@ var (
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_TransformPhoneNumberConfig{
TransformPhoneNumberConfig: &mgmtv1alpha1.TransformPhoneNumber{
- PreserveLength: false,
+ PreserveLength: gotypeutil.ToPtr(false),
},
},
},
@@ -523,7 +524,7 @@ var (
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_TransformStringConfig{
TransformStringConfig: &mgmtv1alpha1.TransformString{
- PreserveLength: false,
+ PreserveLength: gotypeutil.ToPtr(false),
},
},
},
@@ -577,7 +578,7 @@ var (
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_GenerateCategoricalConfig{
GenerateCategoricalConfig: &mgmtv1alpha1.GenerateCategorical{
- Categories: "value1,value2",
+ Categories: gotypeutil.ToPtr("value1,value2"),
},
},
},
@@ -620,7 +621,7 @@ var (
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_GenerateCountryConfig{
GenerateCountryConfig: &mgmtv1alpha1.GenerateCountry{
- GenerateFullName: false,
+ GenerateFullName: gotypeutil.ToPtr(false),
},
},
},
diff --git a/backend/sql/postgresql/models/transformers.go b/backend/sql/postgresql/models/transformers.go
index 87d5b067bb..7fe7ae1909 100644
--- a/backend/sql/postgresql/models/transformers.go
+++ b/backend/sql/postgresql/models/transformers.go
@@ -60,8 +60,8 @@ type GenerateEmailConfig struct {
}
type TransformEmailConfig struct {
- PreserveLength bool `json:"preserveLength"`
- PreserveDomain bool `json:"preserveDomain"`
+ PreserveLength *bool `json:"preserveLength,omitempty"`
+ PreserveDomain *bool `json:"preserveDomain,omitempty"`
ExcludedDomains []string `json:"excludedDomains"`
EmailType *int32 `json:"emailType,omitempty"`
InvalidEmailAction *int32 `json:"invalidEmailAction,omitempty"`
@@ -70,7 +70,7 @@ type TransformEmailConfig struct {
type GenerateBoolConfig struct{}
type GenerateCardNumberConfig struct {
- ValidLuhn bool `json:"validLuhn"`
+ ValidLuhn *bool `json:"validLuhn,omitempty"`
}
type GenerateCityConfig struct{}
@@ -78,16 +78,16 @@ type GenerateCityConfig struct{}
type GenerateDefaultConfig struct{}
type GenerateE164PhoneNumberConfig struct {
- Min int64 `json:"min"`
- Max int64 `json:"max"`
+ Min *int64 `json:"min,omitempty"`
+ Max *int64 `json:"max,omitempty"`
}
type GenerateFirstNameConfig struct{}
type GenerateFloat64Config struct {
- RandomizeSign bool `json:"randomizeSign"`
- Min float64 `json:"min"`
- Max float64 `json:"max"`
- Precision int64 `json:"precision"`
+ RandomizeSign *bool `json:"randomizeSign,omitempty"`
+ Min *float64 `json:"min,omitempty"`
+ Max *float64 `json:"max,omitempty"`
+ Precision *int64 `json:"precision,omitempty"`
}
type GenerateFullAddressConfig struct{}
@@ -95,15 +95,15 @@ type GenerateFullAddressConfig struct{}
type GenerateFullNameConfig struct{}
type GenerateGenderConfig struct {
- Abbreviate bool `json:"abbreviate"`
+ Abbreviate *bool `json:"abbreviate,omitempty"`
}
type GenerateInt64PhoneNumberConfig struct{}
type GenerateInt64Config struct {
- RandomizeSign bool `json:"randomizeSign"`
- Min int64 `json:"min"`
- Max int64 `json:"max"`
+ RandomizeSign *bool `json:"randomizeSign,omitempty"`
+ Min *int64 `json:"min,omitempty"`
+ Max *int64 `json:"max,omitempty"`
}
type GenerateLastNameConfig struct{}
@@ -113,19 +113,19 @@ type GenerateSha256HashConfig struct{}
type GenerateSsnConfig struct{}
type GenerateStateConfig struct {
- GenerateFullName bool `json:"generateFullName"`
+ GenerateFullName *bool `json:"generateFullName,omitempty"`
}
type GenerateStreetAddressConfig struct{}
type GenerateStringPhoneNumberConfig struct {
- Min int64 `json:"min"`
- Max int64 `json:"max"`
+ Min *int64 `json:"min,omitempty"`
+ Max *int64 `json:"max,omitempty"`
}
type GenerateStringConfig struct {
- Min int64 `json:"min"`
- Max int64 `json:"max"`
+ Min *int64 `json:"min,omitempty"`
+ Max *int64 `json:"max,omitempty"`
}
type GenerateUnixTimestampConfig struct{}
@@ -134,47 +134,47 @@ type GenerateUsernameConfig struct{}
type GenerateUtcTimestampConfig struct{}
type GenerateUuidConfig struct {
- IncludeHyphens bool `json:"includeHyphens"`
+ IncludeHyphens *bool `json:"includeHyphens,omitempty"`
}
type GenerateZipcodeConfig struct{}
type TransformE164PhoneNumberConfig struct {
- PreserveLength bool `json:"preserveLength"`
+ PreserveLength *bool `json:"preserveLength,omitempty"`
}
type TransformFirstNameConfig struct {
- PreserveLength bool `json:"preserveLength"`
+ PreserveLength *bool `json:"preserveLength,omitempty"`
}
type TransformFloat64Config struct {
- RandomizationRangeMin float64 `json:"randomizationRangeMin"`
- RandomizationRangeMax float64 `json:"randomizationRangeMax"`
+ RandomizationRangeMin *float64 `json:"randomizationRangeMin,omitempty"`
+ RandomizationRangeMax *float64 `json:"randomizationRangeMax,omitempty"`
}
type TransformFullNameConfig struct {
- PreserveLength bool `json:"preserveLength"`
+ PreserveLength *bool `json:"preserveLength,omitempty"`
}
type TransformInt64PhoneNumberConfig struct {
- PreserveLength bool `json:"preserveLength"`
+ PreserveLength *bool `json:"preserveLength,omitempty"`
}
type TransformInt64Config struct {
- RandomizationRangeMin int64 `json:"randomizationRangeMin"`
- RandomizationRangeMax int64 `json:"randomizationRangeMax"`
+ RandomizationRangeMin *int64 `json:"randomizationRangeMin,omitempty"`
+ RandomizationRangeMax *int64 `json:"randomizationRangeMax,omitempty"`
}
type TransformLastNameConfig struct {
- PreserveLength bool `json:"preserveLength"`
+ PreserveLength *bool `json:"preserveLength,omitempty"`
}
type TransformPhoneNumberConfig struct {
- PreserveLength bool `json:"preserveLength"`
+ PreserveLength *bool `json:"preserveLength,omitempty"`
}
type TransformStringConfig struct {
- PreserveLength bool `json:"preserveLength"`
+ PreserveLength *bool `json:"preserveLength,omitempty"`
}
type PassthroughConfig struct{}
@@ -190,7 +190,7 @@ type TransformJavascriptConfig struct {
}
type GenerateCategoricalConfig struct {
- Categories string `json:"categories"`
+ Categories *string `json:"categories,omitempty"`
}
type TransformCharacterScramble struct {
@@ -202,7 +202,7 @@ type GenerateJavascript struct {
}
type GenerateCountryConfig struct {
- GenerateFullName bool `json:"generateFullName"`
+ GenerateFullName *bool `json:"generateFullName,omitempty"`
}
// from API -> DB
diff --git a/docs/docs/transformers/gen-javascript-transformer.md b/docs/docs/transformers/gen-javascript-transformer.md
index 2b949b73d6..fb6aea2703 100644
--- a/docs/docs/transformers/gen-javascript-transformer.md
+++ b/docs/docs/transformers/gen-javascript-transformer.md
@@ -77,8 +77,8 @@ Description: Value that will be transformed
| Field | Type | Default | Required | Description |
| -------- | ---- | ------- | -------- | ----------- |
-| preserveLength | bool | | true | Whether the original length of the input data should be preserved during transformation. If set to true, the transformation logic will ensure that the output data has the same length as the input data.
-| maxLength | int64 | | false | Specifies the maximum length for the transformed data. This field ensures that the output does not exceed a certain number of characters.
+| preserveLength | bool | false | false | Whether the original length of the input data should be preserved during transformation. If set to true, the transformation logic will ensure that the output data has the same length as the input data.
+| maxLength | int64 | 15 | false | Specifies the maximum length for the transformed data. This field ensures that the output does not exceed a certain number of characters.
| seed | int64 | | false | An optional seed value used to generate deterministic outputs.
**Example**
@@ -86,8 +86,8 @@ Description: Value that will be transformed
```javascript
const newValue = neosync.transformE164PhoneNumber(value, {
- preserveLength: false,
- maxLength: 1,
+ preserveLength: false,
+ maxLength: 15,
seed: 1,
});
@@ -116,7 +116,7 @@ Description: Value that will be transformed
| preserveLength | bool | false | false | Specifies the maximum length for the transformed data. This field ensures that the output does not exceed a certain number of characters.
| preserveDomain | bool | false | false | A boolean indicating whether the domain part of the email should be preserved.
| excludedDomains | any | [] | false | A list of domains that should be excluded from the transformation
-| maxLength | int64 | 10000 | false | Whether the original length of the input data should be preserved during transformation. If set to true, the transformation logic will ensure that the output data has the same length as the input data.
+| maxLength | int64 | 100 | false | Whether the original length of the input data should be preserved during transformation. If set to true, the transformation logic will ensure that the output data has the same length as the input data.
| seed | int64 | | false | An optional seed value used for generating deterministic transformations.
| emailType | string | 'uuidv4' | false | Specifies the type of email to transform, with options including `uuidv4`, `fullname`, or `any`.
| invalidEmailAction | string | 'reject' | false | Specifies the action to take when an invalid email is encountered, with options including `reject`, `passthrough`, `null`, or `generate`.
@@ -129,7 +129,7 @@ const newValue = neosync.transformEmail(value, {
preserveLength: false,
preserveDomain: false,
excludedDomains: [],
- maxLength: 10000,
+ maxLength: 100,
seed: 1,
emailType: 'uuidv4',
invalidEmailAction: 'reject',
@@ -157,7 +157,7 @@ Description: Value that will be transformed
| Field | Type | Default | Required | Description |
| -------- | ---- | ------- | -------- | ----------- |
-| maxLength | int64 | 10000 | false | Specifies the maximum length for the transformed data. This field ensures that the output does not exceed a certain number of characters.
+| maxLength | int64 | 100 | false | Specifies the maximum length for the transformed data. This field ensures that the output does not exceed a certain number of characters.
| preserveLength | bool | false | false | Whether the original length of the input data should be preserved during transformation. If set to true, the transformation logic will ensure that the output data has the same length as the input data.
| seed | int64 | | false | An optional seed value used for generating deterministic transformations.
@@ -166,7 +166,7 @@ Description: Value that will be transformed
```javascript
const newValue = neosync.transformFirstName(value, {
- maxLength: 10000,
+ maxLength: 100,
preserveLength: false,
seed: 1,
});
@@ -193,8 +193,8 @@ Description: Value that will be transformed
| Field | Type | Default | Required | Description |
| -------- | ---- | ------- | -------- | ----------- |
-| randomizationRangeMin | float64 | | true | Specifies the minimum value for the range of the float.
-| randomizationRangeMax | float64 | | true | Specifies the maximum value for the randomization range of the float.
+| randomizationRangeMin | float64 | 1 | false | Specifies the minimum value for the range of the float.
+| randomizationRangeMax | float64 | 10000 | false | Specifies the maximum value for the randomization range of the float.
| precision | int64 | | false | An optional parameter that defines the number of significant digits for the float.
| scale | int64 | | false | An optional parameter that defines the number of decimal places for the float.
| seed | int64 | | false | An optional seed value used for generating deterministic transformations.
@@ -204,8 +204,8 @@ Description: Value that will be transformed
```javascript
const newValue = neosync.transformFloat64(value, {
- randomizationRangeMin: 1.12,
- randomizationRangeMax: 1.12,
+ randomizationRangeMin: 1,
+ randomizationRangeMax: 10000,
precision: 1,
scale: 1,
seed: 1,
@@ -233,7 +233,7 @@ Description: Value that will be transformed
| Field | Type | Default | Required | Description |
| -------- | ---- | ------- | -------- | ----------- |
-| maxLength | int64 | 10000 | false |
+| maxLength | int64 | 100 | false | Specifies the maximum length for the transformed data. This field ensures that the output does not exceed a certain number of characters.
| preserveLength | bool | false | false | Whether the original length of the input data should be preserved during transformation. If set to true, the transformation logic will ensure that the output data has the same length as the input data.
| seed | int64 | | false | An optional seed value used for generating deterministic transformations.
@@ -242,7 +242,7 @@ Description: Value that will be transformed
```javascript
const newValue = neosync.transformFullName(value, {
- maxLength: 10000,
+ maxLength: 100,
preserveLength: false,
seed: 1,
});
@@ -269,8 +269,8 @@ Description: Value that will be transformed
| Field | Type | Default | Required | Description |
| -------- | ---- | ------- | -------- | ----------- |
-| randomizationRangeMin | int64 | | true | Specifies the minimum value for the range of the int.
-| randomizationRangeMax | int64 | | true | Specifies the maximum value for the range of the int.
+| randomizationRangeMin | int64 | 1 | false | Specifies the minimum value for the range of the int.
+| randomizationRangeMax | int64 | 10000 | false | Specifies the maximum value for the range of the int.
| seed | int64 | | false | An optional seed value used to generate deterministic outputs.
**Example**
@@ -278,8 +278,8 @@ Description: Value that will be transformed
```javascript
const newValue = neosync.transformInt64(value, {
- randomizationRangeMin: 1,
- randomizationRangeMax: 1,
+ randomizationRangeMin: 1,
+ randomizationRangeMax: 10000,
seed: 1,
});
@@ -305,7 +305,7 @@ Description: Value that will be transformed
| Field | Type | Default | Required | Description |
| -------- | ---- | ------- | -------- | ----------- |
-| preserveLength | bool | | true | Whether the original length of the input data should be preserved during transformation. If set to true, the transformation logic will ensure that the output data has the same length as the input data.
+| preserveLength | bool | false | false | Whether the original length of the input data should be preserved during transformation. If set to true, the transformation logic will ensure that the output data has the same length as the input data.
| seed | int64 | | false | An optional seed value used to generate deterministic outputs.
**Example**
@@ -313,7 +313,7 @@ Description: Value that will be transformed
```javascript
const newValue = neosync.transformInt64PhoneNumber(value, {
- preserveLength: false,
+ preserveLength: false,
seed: 1,
});
@@ -339,7 +339,7 @@ Description: Value that will be transformed
| Field | Type | Default | Required | Description |
| -------- | ---- | ------- | -------- | ----------- |
-| maxLength | int64 | 10000 | false | Specifies the maximum length for the transformed data. This field ensures that the output does not exceed a certain number of characters.
+| maxLength | int64 | 100 | false | Specifies the maximum length for the transformed data. This field ensures that the output does not exceed a certain number of characters.
| preserveLength | bool | false | false | Whether the original length of the input data should be preserved during transformation. If set to true, the transformation logic will ensure that the output data has the same length as the input data.
| seed | int64 | | false | An optional seed value used for generating deterministic transformations.
@@ -348,7 +348,7 @@ Description: Value that will be transformed
```javascript
const newValue = neosync.transformLastName(value, {
- maxLength: 10000,
+ maxLength: 100,
preserveLength: false,
seed: 1,
});
@@ -377,7 +377,7 @@ Description: Value that will be transformed
| -------- | ---- | ------- | -------- | ----------- |
| preserveLength | bool | false | false | Whether the original length of the input data should be preserved during transformation. If set to true, the transformation logic will ensure that the output data has the same length as the input data.
| minLength | int64 | 1 | false | Specifies the minimum length of the transformed value.
-| maxLength | int64 | 20 | false | Specifies the maximum length of the transformed value.
+| maxLength | int64 | 100 | false | Specifies the maximum length of the transformed value.
| seed | int64 | | false | An optional seed value used to generate deterministic outputs.
**Example**
@@ -387,7 +387,7 @@ Description: Value that will be transformed
const newValue = neosync.transformString(value, {
preserveLength: false,
minLength: 1,
- maxLength: 20,
+ maxLength: 100,
seed: 1,
});
@@ -413,8 +413,8 @@ Description: Value that will be transformed
| Field | Type | Default | Required | Description |
| -------- | ---- | ------- | -------- | ----------- |
-| preserveLength | bool | | true | Whether the original length of the input data should be preserved during transformation. If set to true, the transformation logic will ensure that the output data has the same length as the input data.
-| maxLength | int64 | | true | Specifies the maximum length for the transformed data. This field ensures that the output does not exceed a certain number of characters.
+| preserveLength | bool | false | false | Whether the original length of the input data should be preserved during transformation. If set to true, the transformation logic will ensure that the output data has the same length as the input data.
+| maxLength | int64 | 100 | false | Specifies the maximum length for the transformed data. This field ensures that the output does not exceed a certain number of characters.
| seed | int64 | | false | An optional seed value used to generate deterministic outputs.
**Example**
@@ -422,8 +422,8 @@ Description: Value that will be transformed
```javascript
const newValue = neosync.transformStringPhoneNumber(value, {
- preserveLength: false,
- maxLength: 1,
+ preserveLength: false,
+ maxLength: 100,
seed: 1,
});
@@ -483,7 +483,7 @@ Generates a 16 digit card number that is valid by Luhn valid by default.
| Field | Type | Default | Required | Description |
| -------- | ---- | ------- | -------- | ----------- |
-| validLuhn | bool | | true | A boolean indicating whether the generated value should pass the Luhn algorithm check.
+| validLuhn | bool | false | false | A boolean indicating whether the generated value should pass the Luhn algorithm check.
| seed | int64 | | false | An optional seed value used to generate deterministic outputs.
@@ -492,7 +492,7 @@ Generates a 16 digit card number that is valid by Luhn valid by default.
```javascript
const newValue = neosync.generateCardNumber({
- validLuhn: false,
+ validLuhn: false,
seed: 1,
});
@@ -514,7 +514,7 @@ Randomly selects a value from a defined set of categorical values.
| Field | Type | Default | Required | Description |
| -------- | ---- | ------- | -------- | ----------- |
-| categories | string | | true | A list of comma-separated string values to randomly select from.
+| categories | string | "ultimo,proximo,semper" | false | A list of comma-separated string values to randomly select from.
| seed | int64 | | false | An optional seed value used to generate deterministic outputs.
@@ -523,7 +523,7 @@ Randomly selects a value from a defined set of categorical values.
```javascript
const newValue = neosync.generateCategorical({
- categories: "",
+ categories: "ultimo,proximo,semper",
seed: 1,
});
@@ -545,7 +545,7 @@ Randomly selects a city from a list of predefined US cities.
| Field | Type | Default | Required | Description |
| -------- | ---- | ------- | -------- | ----------- |
-| maxLength | int64 | | true | Specifies the maximum length for the generated data. This field ensures that the output does not exceed a certain number of characters.
+| maxLength | int64 | 100 | false | Specifies the maximum length for the generated data. This field ensures that the output does not exceed a certain number of characters.
| seed | int64 | | false | An optional seed value used to generate deterministic outputs.
@@ -554,7 +554,7 @@ Randomly selects a city from a list of predefined US cities.
```javascript
const newValue = neosync.generateCity({
- maxLength: 1,
+ maxLength: 100,
seed: 1,
});
@@ -640,7 +640,7 @@ Generates a random first name between 2 and 12 characters long.
| Field | Type | Default | Required | Description |
| -------- | ---- | ------- | -------- | ----------- |
-| maxLength | int64 | 10000 | false | Specifies the maximum length for the generated data. This field ensures that the output does not exceed a certain number of characters.
+| maxLength | int64 | 100 | false | Specifies the maximum length for the generated data. This field ensures that the output does not exceed a certain number of characters.
| seed | int64 | | false | An optional seed value used to generate deterministic outputs.
@@ -649,7 +649,7 @@ Generates a random first name between 2 and 12 characters long.
```javascript
const newValue = neosync.generateFirstName({
- maxLength: 10000,
+ maxLength: 100,
seed: 1,
});
@@ -672,8 +672,8 @@ Generates a random floating point number with a max precision of 17. Go float64
| Field | Type | Default | Required | Description |
| -------- | ---- | ------- | -------- | ----------- |
| randomizeSign | bool | false | false | A boolean indicating whether the sign of the float should be randomized.
-| min | float64 | | true | Specifies the minimum value for the generated float.
-| max | float64 | | true | Specifies the maximum value for the generated float
+| min | float64 | 1 | false | Specifies the minimum value for the generated float.
+| max | float64 | 10000 | false | Specifies the maximum value for the generated float
| precision | int64 | | false | An optional parameter that defines the number of significant digits for the generated float.
| scale | int64 | | false | An optional parameter that defines the number of decimal places for the generated float.
| seed | int64 | | false | An optional seed value used to generate deterministic outputs.
@@ -685,8 +685,8 @@ Generates a random floating point number with a max precision of 17. Go float64
const newValue = neosync.generateFloat64({
randomizeSign: false,
- min: 1.12,
- max: 1.12,
+ min: 1,
+ max: 10000,
precision: 1,
scale: 1,
seed: 1,
@@ -710,7 +710,7 @@ Generates a randomly selected real full address that exists in the United States
| Field | Type | Default | Required | Description |
| -------- | ---- | ------- | -------- | ----------- |
-| maxLength | int64 | | true | Specifies the maximum length for the generated data. This field ensures that the output does not exceed a certain number of characters.
+| maxLength | int64 | 100 | false | Specifies the maximum length for the generated data. This field ensures that the output does not exceed a certain number of characters.
| seed | int64 | | false | An optional seed value used to generate deterministic outputs.
@@ -719,7 +719,7 @@ Generates a randomly selected real full address that exists in the United States
```javascript
const newValue = neosync.generateFullAddress({
- maxLength: 1,
+ maxLength: 100,
seed: 1,
});
@@ -741,7 +741,7 @@ Generates a new full name consisting of a first and last name.
| Field | Type | Default | Required | Description |
| -------- | ---- | ------- | -------- | ----------- |
-| maxLength | int64 | 10000 | false | Specifies the maximum length for the generated data. This field ensures that the output does not exceed a certain number of characters.
+| maxLength | int64 | 100 | false | Specifies the maximum length for the generated data. This field ensures that the output does not exceed a certain number of characters.
| seed | int64 | | false | An optional seed value used to generate deterministic outputs.
@@ -750,7 +750,7 @@ Generates a new full name consisting of a first and last name.
```javascript
const newValue = neosync.generateFullName({
- maxLength: 10000,
+ maxLength: 100,
seed: 1,
});
@@ -773,7 +773,7 @@ Randomly generates one of the following genders: female (f), male (m), undefined
| Field | Type | Default | Required | Description |
| -------- | ---- | ------- | -------- | ----------- |
| abbreviate | bool | false | false | Shortens length of generated value to 1.
-| maxLength | int64 | 10000 | false | Specifies the maximum length for the generated data. This field ensures that the output does not exceed a certain number of characters.
+| maxLength | int64 | 100 | false | Specifies the maximum length for the generated data. This field ensures that the output does not exceed a certain number of characters.
| seed | int64 | | false | An optional seed value used to generate deterministic outputs.
@@ -783,7 +783,7 @@ Randomly generates one of the following genders: female (f), male (m), undefined
const newValue = neosync.generateGender({
abbreviate: false,
- maxLength: 10000,
+ maxLength: 100,
seed: 1,
});
@@ -806,8 +806,8 @@ Generates a random int64 value with a default length of 4.
| Field | Type | Default | Required | Description |
| -------- | ---- | ------- | -------- | ----------- |
| randomizeSign | bool | false | false | A boolean indicating whether the sign of the float should be randomized.
-| min | int64 | | true | Specifies the minimum value for the generated int.
-| max | int64 | | true | Specifies the maximum value for the generated int.
+| min | int64 | 1 | false | Specifies the minimum value for the generated int.
+| max | int64 | 10000 | false | Specifies the maximum value for the generated int.
| seed | int64 | | false | An optional seed value used to generate deterministic outputs.
@@ -817,8 +817,8 @@ Generates a random int64 value with a default length of 4.
const newValue = neosync.generateInt64({
randomizeSign: false,
- min: 1,
- max: 1,
+ min: 1,
+ max: 10000,
seed: 1,
});
@@ -869,8 +869,8 @@ Generates a new random international phone number including the + sign and no hy
| Field | Type | Default | Required | Description |
| -------- | ---- | ------- | -------- | ----------- |
-| min | int64 | | true | Specifies the minimum value for the generated phone number.
-| max | int64 | | true | Specifies the maximum value for the generated phone number.
+| min | int64 | 9 | false | Specifies the minimum value for the generated phone number.
+| max | int64 | 15 | false | Specifies the maximum value for the generated phone number.
| seed | int64 | | false | An optional seed value used to generate deterministic outputs.
@@ -879,8 +879,8 @@ Generates a new random international phone number including the + sign and no hy
```javascript
const newValue = neosync.generateInternationalPhoneNumber({
- min: 1,
- max: 1,
+ min: 9,
+ max: 15,
seed: 1,
});
@@ -902,7 +902,7 @@ Generates a random last name.
| Field | Type | Default | Required | Description |
| -------- | ---- | ------- | -------- | ----------- |
-| maxLength | int64 | 10000 | false | Specifies the maximum length for the generated data. This field ensures that the output does not exceed a certain number of characters.
+| maxLength | int64 | 100 | false | Specifies the maximum length for the generated data. This field ensures that the output does not exceed a certain number of characters.
| seed | int64 | | false | An optional seed value used to generate deterministic outputs.
@@ -911,7 +911,7 @@ Generates a random last name.
```javascript
const newValue = neosync.generateLastName({
- maxLength: 10000,
+ maxLength: 100,
seed: 1,
});
@@ -933,8 +933,8 @@ Generates a random string of alphanumeric characters..
| Field | Type | Default | Required | Description |
| -------- | ---- | ------- | -------- | ----------- |
-| min | int64 | | true | Specifies the minimum length for the generated string.
-| max | int64 | | true | Specifies the maximum length for the generated string.
+| min | int64 | 1 | false | Specifies the minimum length for the generated string.
+| max | int64 | 100 | false | Specifies the maximum length for the generated string.
| seed | int64 | | false | An optional seed value used to generate deterministic outputs.
@@ -943,8 +943,8 @@ Generates a random string of alphanumeric characters..
```javascript
const newValue = neosync.generateRandomString({
- min: 1,
- max: 1,
+ min: 1,
+ max: 100,
seed: 1,
});
@@ -1052,7 +1052,7 @@ Randomly generates a street address.
| Field | Type | Default | Required | Description |
| -------- | ---- | ------- | -------- | ----------- |
-| maxLength | int64 | | true | Specifies the maximum length for the generated data. This field ensures that the output does not exceed a certain number of characters.
+| maxLength | int64 | 100 | false | Specifies the maximum length for the generated data. This field ensures that the output does not exceed a certain number of characters.
| seed | int64 | | false | An optional seed value used to generate deterministic outputs.
@@ -1061,7 +1061,7 @@ Randomly generates a street address.
```javascript
const newValue = neosync.generateStreetAddress({
- maxLength: 1,
+ maxLength: 100,
seed: 1,
});
@@ -1083,8 +1083,8 @@ Generates a random 10 digit phone number and returns it as a string with no hyph
| Field | Type | Default | Required | Description |
| -------- | ---- | ------- | -------- | ----------- |
-| min | int64 | | true | Specifies the minimum length for the generated phone number.
-| max | int64 | | true | Specifies the maximum length for the generated phone number.
+| min | int64 | 9 | false | Specifies the minimum length for the generated phone number.
+| max | int64 | 15 | false | Specifies the maximum length for the generated phone number.
| seed | int64 | | false | An optional seed value used to generate deterministic outputs.
@@ -1093,8 +1093,8 @@ Generates a random 10 digit phone number and returns it as a string with no hyph
```javascript
const newValue = neosync.generateStringPhoneNumber({
- min: 1,
- max: 1,
+ min: 9,
+ max: 15,
seed: 1,
});
@@ -1145,7 +1145,7 @@ Randomly generates a username
| Field | Type | Default | Required | Description |
| -------- | ---- | ------- | -------- | ----------- |
-| maxLength | int64 | 10000 | false | Specifies the maximum length for the generated data. This field ensures that the output does not exceed a certain number of characters.
+| maxLength | int64 | 100 | false | Specifies the maximum length for the generated data. This field ensures that the output does not exceed a certain number of characters.
| seed | int64 | | false | An optional seed value used to generate deterministic outputs.
@@ -1154,7 +1154,7 @@ Randomly generates a username
```javascript
const newValue = neosync.generateUsername({
- maxLength: 10000,
+ maxLength: 100,
seed: 1,
});
diff --git a/docs/protos/proto_docs.json b/docs/protos/proto_docs.json
index 68af4537e9..83f4e56360 100644
--- a/docs/protos/proto_docs.json
+++ b/docs/protos/proto_docs.json
@@ -576,19 +576,19 @@
"description": "",
"hasExtensions": false,
"hasFields": true,
- "hasOneofs": false,
+ "hasOneofs": true,
"extensions": [],
"fields": [
{
"name": "valid_luhn",
"description": "",
- "label": "",
+ "label": "optional",
"type": "bool",
"longType": "bool",
"fullType": "bool",
"ismap": false,
- "isoneof": false,
- "oneofdecl": "",
+ "isoneof": true,
+ "oneofdecl": "_valid_luhn",
"defaultValue": ""
}
]
@@ -600,19 +600,19 @@
"description": "",
"hasExtensions": false,
"hasFields": true,
- "hasOneofs": false,
+ "hasOneofs": true,
"extensions": [],
"fields": [
{
"name": "categories",
"description": "",
- "label": "",
+ "label": "optional",
"type": "string",
"longType": "string",
"fullType": "string",
"ismap": false,
- "isoneof": false,
- "oneofdecl": "",
+ "isoneof": true,
+ "oneofdecl": "_categories",
"defaultValue": ""
}
]
@@ -635,19 +635,19 @@
"description": "",
"hasExtensions": false,
"hasFields": true,
- "hasOneofs": false,
+ "hasOneofs": true,
"extensions": [],
"fields": [
{
"name": "generate_full_name",
"description": "An option to return the full country name of the randomly selected country or return the default of a 2-letter country code.",
- "label": "",
+ "label": "optional",
"type": "bool",
"longType": "bool",
"fullType": "bool",
"ismap": false,
- "isoneof": false,
- "oneofdecl": "",
+ "isoneof": true,
+ "oneofdecl": "_generate_full_name",
"defaultValue": ""
}
]
@@ -670,31 +670,31 @@
"description": "",
"hasExtensions": false,
"hasFields": true,
- "hasOneofs": false,
+ "hasOneofs": true,
"extensions": [],
"fields": [
{
"name": "min",
"description": "",
- "label": "",
+ "label": "optional",
"type": "int64",
"longType": "int64",
"fullType": "int64",
"ismap": false,
- "isoneof": false,
- "oneofdecl": "",
+ "isoneof": true,
+ "oneofdecl": "_min",
"defaultValue": ""
},
{
"name": "max",
"description": "",
- "label": "",
+ "label": "optional",
"type": "int64",
"longType": "int64",
"fullType": "int64",
"ismap": false,
- "isoneof": false,
- "oneofdecl": "",
+ "isoneof": true,
+ "oneofdecl": "_max",
"defaultValue": ""
}
]
@@ -741,55 +741,55 @@
"description": "",
"hasExtensions": false,
"hasFields": true,
- "hasOneofs": false,
+ "hasOneofs": true,
"extensions": [],
"fields": [
{
"name": "randomize_sign",
"description": "",
- "label": "",
+ "label": "optional",
"type": "bool",
"longType": "bool",
"fullType": "bool",
"ismap": false,
- "isoneof": false,
- "oneofdecl": "",
+ "isoneof": true,
+ "oneofdecl": "_randomize_sign",
"defaultValue": ""
},
{
"name": "min",
"description": "",
- "label": "",
+ "label": "optional",
"type": "double",
"longType": "double",
"fullType": "double",
"ismap": false,
- "isoneof": false,
- "oneofdecl": "",
+ "isoneof": true,
+ "oneofdecl": "_min",
"defaultValue": ""
},
{
"name": "max",
"description": "",
- "label": "",
+ "label": "optional",
"type": "double",
"longType": "double",
"fullType": "double",
"ismap": false,
- "isoneof": false,
- "oneofdecl": "",
+ "isoneof": true,
+ "oneofdecl": "_max",
"defaultValue": ""
},
{
"name": "precision",
"description": "",
- "label": "",
+ "label": "optional",
"type": "int64",
"longType": "int64",
"fullType": "int64",
"ismap": false,
- "isoneof": false,
- "oneofdecl": "",
+ "isoneof": true,
+ "oneofdecl": "_precision",
"defaultValue": ""
}
]
@@ -823,19 +823,19 @@
"description": "",
"hasExtensions": false,
"hasFields": true,
- "hasOneofs": false,
+ "hasOneofs": true,
"extensions": [],
"fields": [
{
"name": "abbreviate",
"description": "",
- "label": "",
+ "label": "optional",
"type": "bool",
"longType": "bool",
"fullType": "bool",
"ismap": false,
- "isoneof": false,
- "oneofdecl": "",
+ "isoneof": true,
+ "oneofdecl": "_abbreviate",
"defaultValue": ""
}
]
@@ -847,43 +847,43 @@
"description": "",
"hasExtensions": false,
"hasFields": true,
- "hasOneofs": false,
+ "hasOneofs": true,
"extensions": [],
"fields": [
{
"name": "randomize_sign",
"description": "",
- "label": "",
+ "label": "optional",
"type": "bool",
"longType": "bool",
"fullType": "bool",
"ismap": false,
- "isoneof": false,
- "oneofdecl": "",
+ "isoneof": true,
+ "oneofdecl": "_randomize_sign",
"defaultValue": ""
},
{
"name": "min",
"description": "",
- "label": "",
+ "label": "optional",
"type": "int64",
"longType": "int64",
"fullType": "int64",
"ismap": false,
- "isoneof": false,
- "oneofdecl": "",
+ "isoneof": true,
+ "oneofdecl": "_min",
"defaultValue": ""
},
{
"name": "max",
"description": "",
- "label": "",
+ "label": "optional",
"type": "int64",
"longType": "int64",
"fullType": "int64",
"ismap": false,
- "isoneof": false,
- "oneofdecl": "",
+ "isoneof": true,
+ "oneofdecl": "_max",
"defaultValue": ""
}
]
@@ -963,19 +963,19 @@
"description": "",
"hasExtensions": false,
"hasFields": true,
- "hasOneofs": false,
+ "hasOneofs": true,
"extensions": [],
"fields": [
{
"name": "generate_full_name",
"description": "An option to return the full state name of the randomly selected state or return the default of a 2-letter state code.",
- "label": "",
+ "label": "optional",
"type": "bool",
"longType": "bool",
"fullType": "bool",
"ismap": false,
- "isoneof": false,
- "oneofdecl": "",
+ "isoneof": true,
+ "oneofdecl": "_generate_full_name",
"defaultValue": ""
}
]
@@ -998,31 +998,31 @@
"description": "",
"hasExtensions": false,
"hasFields": true,
- "hasOneofs": false,
+ "hasOneofs": true,
"extensions": [],
"fields": [
{
"name": "min",
"description": "",
- "label": "",
+ "label": "optional",
"type": "int64",
"longType": "int64",
"fullType": "int64",
"ismap": false,
- "isoneof": false,
- "oneofdecl": "",
+ "isoneof": true,
+ "oneofdecl": "_min",
"defaultValue": ""
},
{
"name": "max",
"description": "",
- "label": "",
+ "label": "optional",
"type": "int64",
"longType": "int64",
"fullType": "int64",
"ismap": false,
- "isoneof": false,
- "oneofdecl": "",
+ "isoneof": true,
+ "oneofdecl": "_max",
"defaultValue": ""
}
]
@@ -1034,31 +1034,31 @@
"description": "",
"hasExtensions": false,
"hasFields": true,
- "hasOneofs": false,
+ "hasOneofs": true,
"extensions": [],
"fields": [
{
"name": "min",
"description": "",
- "label": "",
+ "label": "optional",
"type": "int64",
"longType": "int64",
"fullType": "int64",
"ismap": false,
- "isoneof": false,
- "oneofdecl": "",
+ "isoneof": true,
+ "oneofdecl": "_min",
"defaultValue": ""
},
{
"name": "max",
"description": "",
- "label": "",
+ "label": "optional",
"type": "int64",
"longType": "int64",
"fullType": "int64",
"ismap": false,
- "isoneof": false,
- "oneofdecl": "",
+ "isoneof": true,
+ "oneofdecl": "_max",
"defaultValue": ""
}
]
@@ -1103,19 +1103,19 @@
"description": "",
"hasExtensions": false,
"hasFields": true,
- "hasOneofs": false,
+ "hasOneofs": true,
"extensions": [],
"fields": [
{
"name": "include_hyphens",
"description": "",
- "label": "",
+ "label": "optional",
"type": "bool",
"longType": "bool",
"fullType": "bool",
"ismap": false,
- "isoneof": false,
- "oneofdecl": "",
+ "isoneof": true,
+ "oneofdecl": "_include_hyphens",
"defaultValue": ""
}
]
@@ -1722,19 +1722,19 @@
"description": "",
"hasExtensions": false,
"hasFields": true,
- "hasOneofs": false,
+ "hasOneofs": true,
"extensions": [],
"fields": [
{
"name": "preserve_length",
"description": "",
- "label": "",
+ "label": "optional",
"type": "bool",
"longType": "bool",
"fullType": "bool",
"ismap": false,
- "isoneof": false,
- "oneofdecl": "",
+ "isoneof": true,
+ "oneofdecl": "_preserve_length",
"defaultValue": ""
}
]
@@ -1752,25 +1752,25 @@
{
"name": "preserve_domain",
"description": "Whether or not to preserve the original domain, barring what has been specified in the excluded_domains property.",
- "label": "",
+ "label": "optional",
"type": "bool",
"longType": "bool",
"fullType": "bool",
"ismap": false,
- "isoneof": false,
- "oneofdecl": "",
+ "isoneof": true,
+ "oneofdecl": "_preserve_domain",
"defaultValue": ""
},
{
"name": "preserve_length",
"description": "Whether or not to preserve the original length of the email. This causes the transformed email to retain the original length.",
- "label": "",
+ "label": "optional",
"type": "bool",
"longType": "bool",
"fullType": "bool",
"ismap": false,
- "isoneof": false,
- "oneofdecl": "",
+ "isoneof": true,
+ "oneofdecl": "_preserve_length",
"defaultValue": ""
},
{
@@ -1818,19 +1818,19 @@
"description": "",
"hasExtensions": false,
"hasFields": true,
- "hasOneofs": false,
+ "hasOneofs": true,
"extensions": [],
"fields": [
{
"name": "preserve_length",
"description": "",
- "label": "",
+ "label": "optional",
"type": "bool",
"longType": "bool",
"fullType": "bool",
"ismap": false,
- "isoneof": false,
- "oneofdecl": "",
+ "isoneof": true,
+ "oneofdecl": "_preserve_length",
"defaultValue": ""
}
]
@@ -1842,31 +1842,31 @@
"description": "",
"hasExtensions": false,
"hasFields": true,
- "hasOneofs": false,
+ "hasOneofs": true,
"extensions": [],
"fields": [
{
"name": "randomization_range_min",
"description": "",
- "label": "",
+ "label": "optional",
"type": "double",
"longType": "double",
"fullType": "double",
"ismap": false,
- "isoneof": false,
- "oneofdecl": "",
+ "isoneof": true,
+ "oneofdecl": "_randomization_range_min",
"defaultValue": ""
},
{
"name": "randomization_range_max",
"description": "",
- "label": "",
+ "label": "optional",
"type": "double",
"longType": "double",
"fullType": "double",
"ismap": false,
- "isoneof": false,
- "oneofdecl": "",
+ "isoneof": true,
+ "oneofdecl": "_randomization_range_max",
"defaultValue": ""
}
]
@@ -1878,19 +1878,19 @@
"description": "",
"hasExtensions": false,
"hasFields": true,
- "hasOneofs": false,
+ "hasOneofs": true,
"extensions": [],
"fields": [
{
"name": "preserve_length",
"description": "",
- "label": "",
+ "label": "optional",
"type": "bool",
"longType": "bool",
"fullType": "bool",
"ismap": false,
- "isoneof": false,
- "oneofdecl": "",
+ "isoneof": true,
+ "oneofdecl": "_preserve_length",
"defaultValue": ""
}
]
@@ -1902,31 +1902,31 @@
"description": "",
"hasExtensions": false,
"hasFields": true,
- "hasOneofs": false,
+ "hasOneofs": true,
"extensions": [],
"fields": [
{
"name": "randomization_range_min",
"description": "",
- "label": "",
+ "label": "optional",
"type": "int64",
"longType": "int64",
"fullType": "int64",
"ismap": false,
- "isoneof": false,
- "oneofdecl": "",
+ "isoneof": true,
+ "oneofdecl": "_randomization_range_min",
"defaultValue": ""
},
{
"name": "randomization_range_max",
"description": "",
- "label": "",
+ "label": "optional",
"type": "int64",
"longType": "int64",
"fullType": "int64",
"ismap": false,
- "isoneof": false,
- "oneofdecl": "",
+ "isoneof": true,
+ "oneofdecl": "_randomization_range_max",
"defaultValue": ""
}
]
@@ -1938,19 +1938,19 @@
"description": "",
"hasExtensions": false,
"hasFields": true,
- "hasOneofs": false,
+ "hasOneofs": true,
"extensions": [],
"fields": [
{
"name": "preserve_length",
"description": "",
- "label": "",
+ "label": "optional",
"type": "bool",
"longType": "bool",
"fullType": "bool",
"ismap": false,
- "isoneof": false,
- "oneofdecl": "",
+ "isoneof": true,
+ "oneofdecl": "_preserve_length",
"defaultValue": ""
}
]
@@ -1986,19 +1986,19 @@
"description": "",
"hasExtensions": false,
"hasFields": true,
- "hasOneofs": false,
+ "hasOneofs": true,
"extensions": [],
"fields": [
{
"name": "preserve_length",
"description": "",
- "label": "",
+ "label": "optional",
"type": "bool",
"longType": "bool",
"fullType": "bool",
"ismap": false,
- "isoneof": false,
- "oneofdecl": "",
+ "isoneof": true,
+ "oneofdecl": "_preserve_length",
"defaultValue": ""
}
]
@@ -2010,19 +2010,19 @@
"description": "",
"hasExtensions": false,
"hasFields": true,
- "hasOneofs": false,
+ "hasOneofs": true,
"extensions": [],
"fields": [
{
"name": "preserve_length",
"description": "",
- "label": "",
+ "label": "optional",
"type": "bool",
"longType": "bool",
"fullType": "bool",
"ismap": false,
- "isoneof": false,
- "oneofdecl": "",
+ "isoneof": true,
+ "oneofdecl": "_preserve_length",
"defaultValue": ""
}
]
@@ -2082,19 +2082,19 @@
"description": "",
"hasExtensions": false,
"hasFields": true,
- "hasOneofs": false,
+ "hasOneofs": true,
"extensions": [],
"fields": [
{
"name": "preserve_length",
"description": "",
- "label": "",
+ "label": "optional",
"type": "bool",
"longType": "bool",
"fullType": "bool",
"ismap": false,
- "isoneof": false,
- "oneofdecl": "",
+ "isoneof": true,
+ "oneofdecl": "_preserve_length",
"defaultValue": ""
}
]
diff --git a/frontend/apps/web/@types/neosync-transformers.d.ts b/frontend/apps/web/@types/neosync-transformers.d.ts
index 8377deef3e..3c2c4ea0a4 100644
--- a/frontend/apps/web/@types/neosync-transformers.d.ts
+++ b/frontend/apps/web/@types/neosync-transformers.d.ts
@@ -27,7 +27,7 @@ declare namespace neosync {
export interface TransformE164PhoneNumberOptions {
/** Whether the original length of the input data should be preserved during transformation. If set to true, the transformation logic will ensure that the output data has the same length as the input data. */
- preserveLength: boolean;
+ preserveLength?: boolean;
/** Specifies the maximum length for the transformed data. This field ensures that the output does not exceed a certain number of characters. */
maxLength?: number;
/** An optional seed value used to generate deterministic outputs. */
@@ -80,9 +80,9 @@ declare namespace neosync {
export interface TransformFloat64Options {
/** Specifies the minimum value for the range of the float. */
- randomizationRangeMin: number;
+ randomizationRangeMin?: number;
/** Specifies the maximum value for the randomization range of the float. */
- randomizationRangeMax: number;
+ randomizationRangeMax?: number;
/** An optional parameter that defines the number of significant digits for the float. */
precision?: number;
/** An optional parameter that defines the number of decimal places for the float. */
@@ -98,7 +98,7 @@ declare namespace neosync {
export interface TransformFullNameOptions {
- /** */
+ /** Specifies the maximum length for the transformed data. This field ensures that the output does not exceed a certain number of characters. */
maxLength?: number;
/** Whether the original length of the input data should be preserved during transformation. If set to true, the transformation logic will ensure that the output data has the same length as the input data. */
preserveLength?: boolean;
@@ -114,9 +114,9 @@ declare namespace neosync {
export interface TransformInt64Options {
/** Specifies the minimum value for the range of the int. */
- randomizationRangeMin: number;
+ randomizationRangeMin?: number;
/** Specifies the maximum value for the range of the int. */
- randomizationRangeMax: number;
+ randomizationRangeMax?: number;
/** An optional seed value used to generate deterministic outputs. */
seed?: number;
}
@@ -129,7 +129,7 @@ declare namespace neosync {
export interface TransformInt64PhoneNumberOptions {
/** Whether the original length of the input data should be preserved during transformation. If set to true, the transformation logic will ensure that the output data has the same length as the input data. */
- preserveLength: boolean;
+ preserveLength?: boolean;
/** An optional seed value used to generate deterministic outputs. */
seed?: number;
}
@@ -174,9 +174,9 @@ declare namespace neosync {
export interface TransformStringPhoneNumberOptions {
/** Whether the original length of the input data should be preserved during transformation. If set to true, the transformation logic will ensure that the output data has the same length as the input data. */
- preserveLength: boolean;
+ preserveLength?: boolean;
/** Specifies the maximum length for the transformed data. This field ensures that the output does not exceed a certain number of characters. */
- maxLength: number;
+ maxLength?: number;
/** An optional seed value used to generate deterministic outputs. */
seed?: number;
}
@@ -206,7 +206,7 @@ declare namespace neosync {
export interface GenerateCardNumberOptions {
/** A boolean indicating whether the generated value should pass the Luhn algorithm check. */
- validLuhn: boolean;
+ validLuhn?: boolean;
/** An optional seed value used to generate deterministic outputs. */
seed?: number;
}
@@ -219,7 +219,7 @@ declare namespace neosync {
export interface GenerateCategoricalOptions {
/** A list of comma-separated string values to randomly select from. */
- categories: string;
+ categories?: string;
/** An optional seed value used to generate deterministic outputs. */
seed?: number;
}
@@ -232,7 +232,7 @@ declare namespace neosync {
export interface GenerateCityOptions {
/** Specifies the maximum length for the generated data. This field ensures that the output does not exceed a certain number of characters. */
- maxLength: number;
+ maxLength?: number;
/** An optional seed value used to generate deterministic outputs. */
seed?: number;
}
@@ -288,9 +288,9 @@ declare namespace neosync {
/** A boolean indicating whether the sign of the float should be randomized. */
randomizeSign?: boolean;
/** Specifies the minimum value for the generated float. */
- min: number;
+ min?: number;
/** Specifies the maximum value for the generated float */
- max: number;
+ max?: number;
/** An optional parameter that defines the number of significant digits for the generated float. */
precision?: number;
/** An optional parameter that defines the number of decimal places for the generated float. */
@@ -307,7 +307,7 @@ declare namespace neosync {
export interface GenerateFullAddressOptions {
/** Specifies the maximum length for the generated data. This field ensures that the output does not exceed a certain number of characters. */
- maxLength: number;
+ maxLength?: number;
/** An optional seed value used to generate deterministic outputs. */
seed?: number;
}
@@ -350,9 +350,9 @@ declare namespace neosync {
/** A boolean indicating whether the sign of the float should be randomized. */
randomizeSign?: boolean;
/** Specifies the minimum value for the generated int. */
- min: number;
+ min?: number;
/** Specifies the maximum value for the generated int. */
- max: number;
+ max?: number;
/** An optional seed value used to generate deterministic outputs. */
seed?: number;
}
@@ -376,9 +376,9 @@ declare namespace neosync {
export interface GenerateInternationalPhoneNumberOptions {
/** Specifies the minimum value for the generated phone number. */
- min: number;
+ min?: number;
/** Specifies the maximum value for the generated phone number. */
- max: number;
+ max?: number;
/** An optional seed value used to generate deterministic outputs. */
seed?: number;
}
@@ -404,9 +404,9 @@ declare namespace neosync {
export interface GenerateRandomStringOptions {
/** Specifies the minimum length for the generated string. */
- min: number;
+ min?: number;
/** Specifies the maximum length for the generated string. */
- max: number;
+ max?: number;
/** An optional seed value used to generate deterministic outputs. */
seed?: number;
}
@@ -452,7 +452,7 @@ declare namespace neosync {
export interface GenerateStreetAddressOptions {
/** Specifies the maximum length for the generated data. This field ensures that the output does not exceed a certain number of characters. */
- maxLength: number;
+ maxLength?: number;
/** An optional seed value used to generate deterministic outputs. */
seed?: number;
}
@@ -465,9 +465,9 @@ declare namespace neosync {
export interface GenerateStringPhoneNumberOptions {
/** Specifies the minimum length for the generated phone number. */
- min: number;
+ min?: number;
/** Specifies the maximum length for the generated phone number. */
- max: number;
+ max?: number;
/** An optional seed value used to generate deterministic outputs. */
seed?: number;
}
diff --git a/frontend/packages/sdk/src/client/mgmt/v1alpha1/transformer_pb.ts b/frontend/packages/sdk/src/client/mgmt/v1alpha1/transformer_pb.ts
index f81f064ac2..ef97b8ec1d 100644
--- a/frontend/packages/sdk/src/client/mgmt/v1alpha1/transformer_pb.ts
+++ b/frontend/packages/sdk/src/client/mgmt/v1alpha1/transformer_pb.ts
@@ -4,7 +4,7 @@
// @ts-nocheck
import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
-import { Message, proto3, protoInt64, Timestamp } from "@bufbuild/protobuf";
+import { Message, proto3, Timestamp } from "@bufbuild/protobuf";
/**
* @generated from enum mgmt.v1alpha1.TransformerSource
@@ -2042,16 +2042,16 @@ export class TransformEmail extends Message {
/**
* Whether or not to preserve the original domain, barring what has been specified in the excluded_domains property.
*
- * @generated from field: bool preserve_domain = 1;
+ * @generated from field: optional bool preserve_domain = 1;
*/
- preserveDomain = false;
+ preserveDomain?: boolean;
/**
* Whether or not to preserve the original length of the email. This causes the transformed email to retain the original length.
*
- * @generated from field: bool preserve_length = 2;
+ * @generated from field: optional bool preserve_length = 2;
*/
- preserveLength = false;
+ preserveLength?: boolean;
/**
* A lsit of email domains that should be excluded. This changes based on the preserve_domain flag. See the docs for more details.
@@ -2082,8 +2082,8 @@ export class TransformEmail extends Message {
static readonly runtime: typeof proto3 = proto3;
static readonly typeName = "mgmt.v1alpha1.TransformEmail";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
- { no: 1, name: "preserve_domain", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
- { no: 2, name: "preserve_length", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
+ { no: 1, name: "preserve_domain", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
+ { no: 2, name: "preserve_length", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
{ no: 3, name: "excluded_domains", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true },
{ no: 4, name: "email_type", kind: "enum", T: proto3.getEnumType(GenerateEmailType), opt: true },
{ no: 5, name: "invalid_email_action", kind: "enum", T: proto3.getEnumType(InvalidEmailAction), opt: true },
@@ -2142,9 +2142,9 @@ export class GenerateBool extends Message {
*/
export class GenerateCardNumber extends Message {
/**
- * @generated from field: bool valid_luhn = 1;
+ * @generated from field: optional bool valid_luhn = 1;
*/
- validLuhn = false;
+ validLuhn?: boolean;
constructor(data?: PartialMessage) {
super();
@@ -2154,7 +2154,7 @@ export class GenerateCardNumber extends Message {
static readonly runtime: typeof proto3 = proto3;
static readonly typeName = "mgmt.v1alpha1.GenerateCardNumber";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
- { no: 1, name: "valid_luhn", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
+ { no: 1, name: "valid_luhn", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
]);
static fromBinary(bytes: Uint8Array, options?: Partial): GenerateCardNumber {
@@ -2241,14 +2241,14 @@ export class GenerateDefault extends Message {
*/
export class GenerateE164PhoneNumber extends Message {
/**
- * @generated from field: int64 min = 1;
+ * @generated from field: optional int64 min = 1;
*/
- min = protoInt64.zero;
+ min?: bigint;
/**
- * @generated from field: int64 max = 2;
+ * @generated from field: optional int64 max = 2;
*/
- max = protoInt64.zero;
+ max?: bigint;
constructor(data?: PartialMessage) {
super();
@@ -2258,8 +2258,8 @@ export class GenerateE164PhoneNumber extends Message {
static readonly runtime: typeof proto3 = proto3;
static readonly typeName = "mgmt.v1alpha1.GenerateE164PhoneNumber";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
- { no: 1, name: "min", kind: "scalar", T: 3 /* ScalarType.INT64 */ },
- { no: 2, name: "max", kind: "scalar", T: 3 /* ScalarType.INT64 */ },
+ { no: 1, name: "min", kind: "scalar", T: 3 /* ScalarType.INT64 */, opt: true },
+ { no: 2, name: "max", kind: "scalar", T: 3 /* ScalarType.INT64 */, opt: true },
]);
static fromBinary(bytes: Uint8Array, options?: Partial): GenerateE164PhoneNumber {
@@ -2315,24 +2315,24 @@ export class GenerateFirstName extends Message {
*/
export class GenerateFloat64 extends Message {
/**
- * @generated from field: bool randomize_sign = 1;
+ * @generated from field: optional bool randomize_sign = 1;
*/
- randomizeSign = false;
+ randomizeSign?: boolean;
/**
- * @generated from field: double min = 2;
+ * @generated from field: optional double min = 2;
*/
- min = 0;
+ min?: number;
/**
- * @generated from field: double max = 3;
+ * @generated from field: optional double max = 3;
*/
- max = 0;
+ max?: number;
/**
- * @generated from field: int64 precision = 4;
+ * @generated from field: optional int64 precision = 4;
*/
- precision = protoInt64.zero;
+ precision?: bigint;
constructor(data?: PartialMessage) {
super();
@@ -2342,10 +2342,10 @@ export class GenerateFloat64 extends Message {
static readonly runtime: typeof proto3 = proto3;
static readonly typeName = "mgmt.v1alpha1.GenerateFloat64";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
- { no: 1, name: "randomize_sign", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
- { no: 2, name: "min", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ },
- { no: 3, name: "max", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ },
- { no: 4, name: "precision", kind: "scalar", T: 3 /* ScalarType.INT64 */ },
+ { no: 1, name: "randomize_sign", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
+ { no: 2, name: "min", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, opt: true },
+ { no: 3, name: "max", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, opt: true },
+ { no: 4, name: "precision", kind: "scalar", T: 3 /* ScalarType.INT64 */, opt: true },
]);
static fromBinary(bytes: Uint8Array, options?: Partial): GenerateFloat64 {
@@ -2432,9 +2432,9 @@ export class GenerateFullName extends Message {
*/
export class GenerateGender extends Message {
/**
- * @generated from field: bool abbreviate = 1;
+ * @generated from field: optional bool abbreviate = 1;
*/
- abbreviate = false;
+ abbreviate?: boolean;
constructor(data?: PartialMessage) {
super();
@@ -2444,7 +2444,7 @@ export class GenerateGender extends Message {
static readonly runtime: typeof proto3 = proto3;
static readonly typeName = "mgmt.v1alpha1.GenerateGender";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
- { no: 1, name: "abbreviate", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
+ { no: 1, name: "abbreviate", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
]);
static fromBinary(bytes: Uint8Array, options?: Partial): GenerateGender {
@@ -2500,19 +2500,19 @@ export class GenerateInt64PhoneNumber extends Message
*/
export class GenerateInt64 extends Message {
/**
- * @generated from field: bool randomize_sign = 1;
+ * @generated from field: optional bool randomize_sign = 1;
*/
- randomizeSign = false;
+ randomizeSign?: boolean;
/**
- * @generated from field: int64 min = 2;
+ * @generated from field: optional int64 min = 2;
*/
- min = protoInt64.zero;
+ min?: bigint;
/**
- * @generated from field: int64 max = 3;
+ * @generated from field: optional int64 max = 3;
*/
- max = protoInt64.zero;
+ max?: bigint;
constructor(data?: PartialMessage) {
super();
@@ -2522,9 +2522,9 @@ export class GenerateInt64 extends Message {
static readonly runtime: typeof proto3 = proto3;
static readonly typeName = "mgmt.v1alpha1.GenerateInt64";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
- { no: 1, name: "randomize_sign", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
- { no: 2, name: "min", kind: "scalar", T: 3 /* ScalarType.INT64 */ },
- { no: 3, name: "max", kind: "scalar", T: 3 /* ScalarType.INT64 */ },
+ { no: 1, name: "randomize_sign", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
+ { no: 2, name: "min", kind: "scalar", T: 3 /* ScalarType.INT64 */, opt: true },
+ { no: 3, name: "max", kind: "scalar", T: 3 /* ScalarType.INT64 */, opt: true },
]);
static fromBinary(bytes: Uint8Array, options?: Partial): GenerateInt64 {
@@ -2644,9 +2644,9 @@ export class GenerateState extends Message {
/**
* An option to return the full state name of the randomly selected state or return the default of a 2-letter state code.
*
- * @generated from field: bool generate_full_name = 1;
+ * @generated from field: optional bool generate_full_name = 1;
*/
- generateFullName = false;
+ generateFullName?: boolean;
constructor(data?: PartialMessage) {
super();
@@ -2656,7 +2656,7 @@ export class GenerateState extends Message {
static readonly runtime: typeof proto3 = proto3;
static readonly typeName = "mgmt.v1alpha1.GenerateState";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
- { no: 1, name: "generate_full_name", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
+ { no: 1, name: "generate_full_name", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
]);
static fromBinary(bytes: Uint8Array, options?: Partial): GenerateState {
@@ -2712,14 +2712,14 @@ export class GenerateStreetAddress extends Message {
*/
export class GenerateStringPhoneNumber extends Message {
/**
- * @generated from field: int64 min = 2;
+ * @generated from field: optional int64 min = 2;
*/
- min = protoInt64.zero;
+ min?: bigint;
/**
- * @generated from field: int64 max = 3;
+ * @generated from field: optional int64 max = 3;
*/
- max = protoInt64.zero;
+ max?: bigint;
constructor(data?: PartialMessage) {
super();
@@ -2729,8 +2729,8 @@ export class GenerateStringPhoneNumber extends Message [
- { no: 2, name: "min", kind: "scalar", T: 3 /* ScalarType.INT64 */ },
- { no: 3, name: "max", kind: "scalar", T: 3 /* ScalarType.INT64 */ },
+ { no: 2, name: "min", kind: "scalar", T: 3 /* ScalarType.INT64 */, opt: true },
+ { no: 3, name: "max", kind: "scalar", T: 3 /* ScalarType.INT64 */, opt: true },
]);
static fromBinary(bytes: Uint8Array, options?: Partial): GenerateStringPhoneNumber {
@@ -2755,14 +2755,14 @@ export class GenerateStringPhoneNumber extends Message {
/**
- * @generated from field: int64 min = 1;
+ * @generated from field: optional int64 min = 1;
*/
- min = protoInt64.zero;
+ min?: bigint;
/**
- * @generated from field: int64 max = 2;
+ * @generated from field: optional int64 max = 2;
*/
- max = protoInt64.zero;
+ max?: bigint;
constructor(data?: PartialMessage) {
super();
@@ -2772,8 +2772,8 @@ export class GenerateString extends Message {
static readonly runtime: typeof proto3 = proto3;
static readonly typeName = "mgmt.v1alpha1.GenerateString";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
- { no: 1, name: "min", kind: "scalar", T: 3 /* ScalarType.INT64 */ },
- { no: 2, name: "max", kind: "scalar", T: 3 /* ScalarType.INT64 */ },
+ { no: 1, name: "min", kind: "scalar", T: 3 /* ScalarType.INT64 */, opt: true },
+ { no: 2, name: "max", kind: "scalar", T: 3 /* ScalarType.INT64 */, opt: true },
]);
static fromBinary(bytes: Uint8Array, options?: Partial): GenerateString {
@@ -2891,9 +2891,9 @@ export class GenerateUtcTimestamp extends Message {
*/
export class GenerateUuid extends Message {
/**
- * @generated from field: bool include_hyphens = 1;
+ * @generated from field: optional bool include_hyphens = 1;
*/
- includeHyphens = false;
+ includeHyphens?: boolean;
constructor(data?: PartialMessage) {
super();
@@ -2903,7 +2903,7 @@ export class GenerateUuid extends Message {
static readonly runtime: typeof proto3 = proto3;
static readonly typeName = "mgmt.v1alpha1.GenerateUuid";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
- { no: 1, name: "include_hyphens", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
+ { no: 1, name: "include_hyphens", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
]);
static fromBinary(bytes: Uint8Array, options?: Partial): GenerateUuid {
@@ -2959,9 +2959,9 @@ export class GenerateZipcode extends Message {
*/
export class TransformE164PhoneNumber extends Message {
/**
- * @generated from field: bool preserve_length = 1;
+ * @generated from field: optional bool preserve_length = 1;
*/
- preserveLength = false;
+ preserveLength?: boolean;
constructor(data?: PartialMessage) {
super();
@@ -2971,7 +2971,7 @@ export class TransformE164PhoneNumber extends Message
static readonly runtime: typeof proto3 = proto3;
static readonly typeName = "mgmt.v1alpha1.TransformE164PhoneNumber";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
- { no: 1, name: "preserve_length", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
+ { no: 1, name: "preserve_length", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
]);
static fromBinary(bytes: Uint8Array, options?: Partial): TransformE164PhoneNumber {
@@ -2996,9 +2996,9 @@ export class TransformE164PhoneNumber extends Message
*/
export class TransformFirstName extends Message {
/**
- * @generated from field: bool preserve_length = 1;
+ * @generated from field: optional bool preserve_length = 1;
*/
- preserveLength = false;
+ preserveLength?: boolean;
constructor(data?: PartialMessage) {
super();
@@ -3008,7 +3008,7 @@ export class TransformFirstName extends Message {
static readonly runtime: typeof proto3 = proto3;
static readonly typeName = "mgmt.v1alpha1.TransformFirstName";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
- { no: 1, name: "preserve_length", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
+ { no: 1, name: "preserve_length", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
]);
static fromBinary(bytes: Uint8Array, options?: Partial): TransformFirstName {
@@ -3033,14 +3033,14 @@ export class TransformFirstName extends Message {
*/
export class TransformFloat64 extends Message {
/**
- * @generated from field: double randomization_range_min = 1;
+ * @generated from field: optional double randomization_range_min = 1;
*/
- randomizationRangeMin = 0;
+ randomizationRangeMin?: number;
/**
- * @generated from field: double randomization_range_max = 2;
+ * @generated from field: optional double randomization_range_max = 2;
*/
- randomizationRangeMax = 0;
+ randomizationRangeMax?: number;
constructor(data?: PartialMessage) {
super();
@@ -3050,8 +3050,8 @@ export class TransformFloat64 extends Message {
static readonly runtime: typeof proto3 = proto3;
static readonly typeName = "mgmt.v1alpha1.TransformFloat64";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
- { no: 1, name: "randomization_range_min", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ },
- { no: 2, name: "randomization_range_max", kind: "scalar", T: 1 /* ScalarType.DOUBLE */ },
+ { no: 1, name: "randomization_range_min", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, opt: true },
+ { no: 2, name: "randomization_range_max", kind: "scalar", T: 1 /* ScalarType.DOUBLE */, opt: true },
]);
static fromBinary(bytes: Uint8Array, options?: Partial): TransformFloat64 {
@@ -3076,9 +3076,9 @@ export class TransformFloat64 extends Message {
*/
export class TransformFullName extends Message {
/**
- * @generated from field: bool preserve_length = 1;
+ * @generated from field: optional bool preserve_length = 1;
*/
- preserveLength = false;
+ preserveLength?: boolean;
constructor(data?: PartialMessage) {
super();
@@ -3088,7 +3088,7 @@ export class TransformFullName extends Message {
static readonly runtime: typeof proto3 = proto3;
static readonly typeName = "mgmt.v1alpha1.TransformFullName";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
- { no: 1, name: "preserve_length", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
+ { no: 1, name: "preserve_length", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
]);
static fromBinary(bytes: Uint8Array, options?: Partial): TransformFullName {
@@ -3113,9 +3113,9 @@ export class TransformFullName extends Message {
*/
export class TransformInt64PhoneNumber extends Message {
/**
- * @generated from field: bool preserve_length = 1;
+ * @generated from field: optional bool preserve_length = 1;
*/
- preserveLength = false;
+ preserveLength?: boolean;
constructor(data?: PartialMessage) {
super();
@@ -3125,7 +3125,7 @@ export class TransformInt64PhoneNumber extends Message [
- { no: 1, name: "preserve_length", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
+ { no: 1, name: "preserve_length", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
]);
static fromBinary(bytes: Uint8Array, options?: Partial): TransformInt64PhoneNumber {
@@ -3150,14 +3150,14 @@ export class TransformInt64PhoneNumber extends Message {
/**
- * @generated from field: int64 randomization_range_min = 1;
+ * @generated from field: optional int64 randomization_range_min = 1;
*/
- randomizationRangeMin = protoInt64.zero;
+ randomizationRangeMin?: bigint;
/**
- * @generated from field: int64 randomization_range_max = 2;
+ * @generated from field: optional int64 randomization_range_max = 2;
*/
- randomizationRangeMax = protoInt64.zero;
+ randomizationRangeMax?: bigint;
constructor(data?: PartialMessage) {
super();
@@ -3167,8 +3167,8 @@ export class TransformInt64 extends Message {
static readonly runtime: typeof proto3 = proto3;
static readonly typeName = "mgmt.v1alpha1.TransformInt64";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
- { no: 1, name: "randomization_range_min", kind: "scalar", T: 3 /* ScalarType.INT64 */ },
- { no: 2, name: "randomization_range_max", kind: "scalar", T: 3 /* ScalarType.INT64 */ },
+ { no: 1, name: "randomization_range_min", kind: "scalar", T: 3 /* ScalarType.INT64 */, opt: true },
+ { no: 2, name: "randomization_range_max", kind: "scalar", T: 3 /* ScalarType.INT64 */, opt: true },
]);
static fromBinary(bytes: Uint8Array, options?: Partial): TransformInt64 {
@@ -3193,9 +3193,9 @@ export class TransformInt64 extends Message {
*/
export class TransformLastName extends Message {
/**
- * @generated from field: bool preserve_length = 1;
+ * @generated from field: optional bool preserve_length = 1;
*/
- preserveLength = false;
+ preserveLength?: boolean;
constructor(data?: PartialMessage) {
super();
@@ -3205,7 +3205,7 @@ export class TransformLastName extends Message {
static readonly runtime: typeof proto3 = proto3;
static readonly typeName = "mgmt.v1alpha1.TransformLastName";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
- { no: 1, name: "preserve_length", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
+ { no: 1, name: "preserve_length", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
]);
static fromBinary(bytes: Uint8Array, options?: Partial): TransformLastName {
@@ -3230,9 +3230,9 @@ export class TransformLastName extends Message {
*/
export class TransformPhoneNumber extends Message {
/**
- * @generated from field: bool preserve_length = 1;
+ * @generated from field: optional bool preserve_length = 1;
*/
- preserveLength = false;
+ preserveLength?: boolean;
constructor(data?: PartialMessage) {
super();
@@ -3242,7 +3242,7 @@ export class TransformPhoneNumber extends Message {
static readonly runtime: typeof proto3 = proto3;
static readonly typeName = "mgmt.v1alpha1.TransformPhoneNumber";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
- { no: 1, name: "preserve_length", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
+ { no: 1, name: "preserve_length", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
]);
static fromBinary(bytes: Uint8Array, options?: Partial): TransformPhoneNumber {
@@ -3267,9 +3267,9 @@ export class TransformPhoneNumber extends Message {
*/
export class TransformString extends Message {
/**
- * @generated from field: bool preserve_length = 1;
+ * @generated from field: optional bool preserve_length = 1;
*/
- preserveLength = false;
+ preserveLength?: boolean;
constructor(data?: PartialMessage) {
super();
@@ -3279,7 +3279,7 @@ export class TransformString extends Message {
static readonly runtime: typeof proto3 = proto3;
static readonly typeName = "mgmt.v1alpha1.TransformString";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
- { no: 1, name: "preserve_length", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
+ { no: 1, name: "preserve_length", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
]);
static fromBinary(bytes: Uint8Array, options?: Partial): TransformString {
@@ -3522,9 +3522,9 @@ export class ValidateUserJavascriptCodeResponse extends Message {
/**
- * @generated from field: string categories = 1;
+ * @generated from field: optional string categories = 1;
*/
- categories = "";
+ categories?: string;
constructor(data?: PartialMessage) {
super();
@@ -3534,7 +3534,7 @@ export class GenerateCategorical extends Message {
static readonly runtime: typeof proto3 = proto3;
static readonly typeName = "mgmt.v1alpha1.GenerateCategorical";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
- { no: 1, name: "categories", kind: "scalar", T: 9 /* ScalarType.STRING */ },
+ { no: 1, name: "categories", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
]);
static fromBinary(bytes: Uint8Array, options?: Partial): GenerateCategorical {
@@ -3719,9 +3719,9 @@ export class GenerateCountry extends Message {
/**
* An option to return the full country name of the randomly selected country or return the default of a 2-letter country code.
*
- * @generated from field: bool generate_full_name = 1;
+ * @generated from field: optional bool generate_full_name = 1;
*/
- generateFullName = false;
+ generateFullName?: boolean;
constructor(data?: PartialMessage) {
super();
@@ -3731,7 +3731,7 @@ export class GenerateCountry extends Message {
static readonly runtime: typeof proto3 = proto3;
static readonly typeName = "mgmt.v1alpha1.GenerateCountry";
static readonly fields: FieldList = proto3.util.newFieldList(() => [
- { no: 1, name: "generate_full_name", kind: "scalar", T: 8 /* ScalarType.BOOL */ },
+ { no: 1, name: "generate_full_name", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
]);
static fromBinary(bytes: Uint8Array, options?: Partial): GenerateCountry {
diff --git a/internal/gotypeutil/parsers.go b/internal/gotypeutil/parsers.go
index 63820a1f1e..b8621def03 100644
--- a/internal/gotypeutil/parsers.go
+++ b/internal/gotypeutil/parsers.go
@@ -50,3 +50,7 @@ func ParseSlice(input any) ([]any, error) {
}
return result, nil
}
+
+func ToPtr[T any](value T) *T {
+ return &value
+}
diff --git a/internal/json-anonymizer/json-anonymizer_test.go b/internal/json-anonymizer/json-anonymizer_test.go
index 800080a365..a8f02e2900 100644
--- a/internal/json-anonymizer/json-anonymizer_test.go
+++ b/internal/json-anonymizer/json-anonymizer_test.go
@@ -287,13 +287,14 @@ func Test_AnonymizeJSON_Largedata(t *testing.T) {
inputStrings, inputObjects, err := getTestData("./testdata/company.json")
require.NoError(t, err)
+ preserveLength := true
// Define transformer mappings
mappings := []*mgmtv1alpha1.TransformerMapping{
{
Expression: ".companyName",
Transformer: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_TransformStringConfig{
- TransformStringConfig: &mgmtv1alpha1.TransformString{PreserveLength: true},
+ TransformStringConfig: &mgmtv1alpha1.TransformString{PreserveLength: &preserveLength},
},
},
},
diff --git a/worker/pkg/benthos/transformers/gen_generate_bool.go b/worker/pkg/benthos/transformers/gen_generate_bool.go
index 2bdc7d61c1..faed0d4efb 100644
--- a/worker/pkg/benthos/transformers/gen_generate_bool.go
+++ b/worker/pkg/benthos/transformers/gen_generate_bool.go
@@ -5,8 +5,8 @@
package transformers
import (
+ "strings"
"fmt"
-
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -36,6 +36,20 @@ func NewGenerateBoolOpts(
}, nil
}
+func (o *GenerateBoolOpts) BuildBloblangString(
+) string {
+ fnStr := []string{
+ }
+
+ params := []any{
+ }
+
+
+
+ template := fmt.Sprintf("generate_bool(%s)", strings.Join(fnStr, ","))
+ return fmt.Sprintf(template, params...)
+}
+
func (t *GenerateBool) GetJsTemplateData() (*TemplateData, error) {
return &TemplateData{
Name: "generateBool",
diff --git a/worker/pkg/benthos/transformers/gen_generate_card_number.go b/worker/pkg/benthos/transformers/gen_generate_card_number.go
index 84e42adf5a..e2c22bc74d 100644
--- a/worker/pkg/benthos/transformers/gen_generate_card_number.go
+++ b/worker/pkg/benthos/transformers/gen_generate_card_number.go
@@ -5,8 +5,8 @@
package transformers
import (
+ "strings"
"fmt"
-
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -25,9 +25,14 @@ func NewGenerateCardNumber() *GenerateCardNumber {
}
func NewGenerateCardNumberOpts(
- validLuhn bool,
+ validLuhnArg *bool,
seedArg *int64,
) (*GenerateCardNumberOpts, error) {
+ validLuhn := bool(false)
+ if validLuhnArg != nil {
+ validLuhn = *validLuhnArg
+ }
+
seed, err := transformer_utils.GetSeedOrDefault(seedArg)
if err != nil {
return nil, fmt.Errorf("unable to generate seed: %w", err)
@@ -39,6 +44,22 @@ func NewGenerateCardNumberOpts(
}, nil
}
+func (o *GenerateCardNumberOpts) BuildBloblangString(
+) string {
+ fnStr := []string{
+ "valid_luhn:%v",
+ }
+
+ params := []any{
+ o.validLuhn,
+ }
+
+
+
+ template := fmt.Sprintf("generate_card_number(%s)", strings.Join(fnStr, ","))
+ return fmt.Sprintf(template, params...)
+}
+
func (t *GenerateCardNumber) GetJsTemplateData() (*TemplateData, error) {
return &TemplateData{
Name: "generateCardNumber",
@@ -50,10 +71,10 @@ func (t *GenerateCardNumber) GetJsTemplateData() (*TemplateData, error) {
func (t *GenerateCardNumber) ParseOptions(opts map[string]any) (any, error) {
transformerOpts := &GenerateCardNumberOpts{}
- if _, ok := opts["validLuhn"].(bool); !ok {
- return nil, fmt.Errorf("missing required argument. function: %s argument: %s", "generateCardNumber", "validLuhn")
+ validLuhn, ok := opts["validLuhn"].(bool)
+ if !ok {
+ validLuhn = false
}
- validLuhn := opts["validLuhn"].(bool)
transformerOpts.validLuhn = validLuhn
var seedArg *int64
diff --git a/worker/pkg/benthos/transformers/gen_generate_categorical.go b/worker/pkg/benthos/transformers/gen_generate_categorical.go
index 590113b47a..85bfbf33d8 100644
--- a/worker/pkg/benthos/transformers/gen_generate_categorical.go
+++ b/worker/pkg/benthos/transformers/gen_generate_categorical.go
@@ -5,8 +5,8 @@
package transformers
import (
+ "strings"
"fmt"
-
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -25,9 +25,14 @@ func NewGenerateCategorical() *GenerateCategorical {
}
func NewGenerateCategoricalOpts(
- categories string,
+ categoriesArg *string,
seedArg *int64,
) (*GenerateCategoricalOpts, error) {
+ categories := string("ultimo,proximo,semper")
+ if categoriesArg != nil {
+ categories = *categoriesArg
+ }
+
seed, err := transformer_utils.GetSeedOrDefault(seedArg)
if err != nil {
return nil, fmt.Errorf("unable to generate seed: %w", err)
@@ -39,6 +44,22 @@ func NewGenerateCategoricalOpts(
}, nil
}
+func (o *GenerateCategoricalOpts) BuildBloblangString(
+) string {
+ fnStr := []string{
+ "categories:%q",
+ }
+
+ params := []any{
+ o.categories,
+ }
+
+
+
+ template := fmt.Sprintf("generate_categorical(%s)", strings.Join(fnStr, ","))
+ return fmt.Sprintf(template, params...)
+}
+
func (t *GenerateCategorical) GetJsTemplateData() (*TemplateData, error) {
return &TemplateData{
Name: "generateCategorical",
@@ -50,10 +71,10 @@ func (t *GenerateCategorical) GetJsTemplateData() (*TemplateData, error) {
func (t *GenerateCategorical) ParseOptions(opts map[string]any) (any, error) {
transformerOpts := &GenerateCategoricalOpts{}
- if _, ok := opts["categories"].(string); !ok {
- return nil, fmt.Errorf("missing required argument. function: %s argument: %s", "generateCategorical", "categories")
+ categories, ok := opts["categories"].(string)
+ if !ok {
+ categories = "ultimo,proximo,semper"
}
- categories := opts["categories"].(string)
transformerOpts.categories = categories
var seedArg *int64
diff --git a/worker/pkg/benthos/transformers/gen_generate_city.go b/worker/pkg/benthos/transformers/gen_generate_city.go
index 76d707a263..ce84948925 100644
--- a/worker/pkg/benthos/transformers/gen_generate_city.go
+++ b/worker/pkg/benthos/transformers/gen_generate_city.go
@@ -5,8 +5,8 @@
package transformers
import (
+ "strings"
"fmt"
-
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -25,9 +25,14 @@ func NewGenerateCity() *GenerateCity {
}
func NewGenerateCityOpts(
- maxLength int64,
+ maxLengthArg *int64,
seedArg *int64,
) (*GenerateCityOpts, error) {
+ maxLength := int64(100)
+ if maxLengthArg != nil {
+ maxLength = *maxLengthArg
+ }
+
seed, err := transformer_utils.GetSeedOrDefault(seedArg)
if err != nil {
return nil, fmt.Errorf("unable to generate seed: %w", err)
@@ -39,6 +44,22 @@ func NewGenerateCityOpts(
}, nil
}
+func (o *GenerateCityOpts) BuildBloblangString(
+) string {
+ fnStr := []string{
+ "max_length:%v",
+ }
+
+ params := []any{
+ o.maxLength,
+ }
+
+
+
+ template := fmt.Sprintf("generate_city(%s)", strings.Join(fnStr, ","))
+ return fmt.Sprintf(template, params...)
+}
+
func (t *GenerateCity) GetJsTemplateData() (*TemplateData, error) {
return &TemplateData{
Name: "generateCity",
@@ -50,10 +71,10 @@ func (t *GenerateCity) GetJsTemplateData() (*TemplateData, error) {
func (t *GenerateCity) ParseOptions(opts map[string]any) (any, error) {
transformerOpts := &GenerateCityOpts{}
- if _, ok := opts["maxLength"].(int64); !ok {
- return nil, fmt.Errorf("missing required argument. function: %s argument: %s", "generateCity", "maxLength")
+ maxLength, ok := opts["maxLength"].(int64)
+ if !ok {
+ maxLength = 100
}
- maxLength := opts["maxLength"].(int64)
transformerOpts.maxLength = maxLength
var seedArg *int64
diff --git a/worker/pkg/benthos/transformers/gen_generate_country.go b/worker/pkg/benthos/transformers/gen_generate_country.go
index 4abd4caf9a..179e2390e0 100644
--- a/worker/pkg/benthos/transformers/gen_generate_country.go
+++ b/worker/pkg/benthos/transformers/gen_generate_country.go
@@ -5,8 +5,8 @@
package transformers
import (
+ "strings"
"fmt"
-
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -28,7 +28,7 @@ func NewGenerateCountryOpts(
generateFullNameArg *bool,
seedArg *int64,
) (*GenerateCountryOpts, error) {
- generateFullName := bool(false)
+ generateFullName := bool(false)
if generateFullNameArg != nil {
generateFullName = *generateFullNameArg
}
@@ -44,6 +44,22 @@ func NewGenerateCountryOpts(
}, nil
}
+func (o *GenerateCountryOpts) BuildBloblangString(
+) string {
+ fnStr := []string{
+ "generate_full_name:%v",
+ }
+
+ params := []any{
+ o.generateFullName,
+ }
+
+
+
+ template := fmt.Sprintf("generate_country(%s)", strings.Join(fnStr, ","))
+ return fmt.Sprintf(template, params...)
+}
+
func (t *GenerateCountry) GetJsTemplateData() (*TemplateData, error) {
return &TemplateData{
Name: "generateCountry",
diff --git a/worker/pkg/benthos/transformers/gen_generate_email.go b/worker/pkg/benthos/transformers/gen_generate_email.go
index cf6debb37d..5d31d1011a 100644
--- a/worker/pkg/benthos/transformers/gen_generate_email.go
+++ b/worker/pkg/benthos/transformers/gen_generate_email.go
@@ -5,8 +5,8 @@
package transformers
import (
+ "strings"
"fmt"
-
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -30,12 +30,12 @@ func NewGenerateEmailOpts(
emailTypeArg *string,
seedArg *int64,
) (*GenerateEmailOpts, error) {
- maxLength := int64(100000)
+ maxLength := int64(100000)
if maxLengthArg != nil {
maxLength = *maxLengthArg
}
- emailType := string(GenerateEmailType_UuidV4.String())
+ emailType := string(GenerateEmailType_UuidV4.String())
if emailTypeArg != nil {
emailType = *emailTypeArg
}
@@ -52,6 +52,24 @@ func NewGenerateEmailOpts(
}, nil
}
+func (o *GenerateEmailOpts) BuildBloblangString(
+) string {
+ fnStr := []string{
+ "max_length:%v",
+ "email_type:%q",
+ }
+
+ params := []any{
+ o.maxLength,
+ o.emailType,
+ }
+
+
+
+ template := fmt.Sprintf("generate_email(%s)", strings.Join(fnStr, ","))
+ return fmt.Sprintf(template, params...)
+}
+
func (t *GenerateEmail) GetJsTemplateData() (*TemplateData, error) {
return &TemplateData{
Name: "generateEmail",
diff --git a/worker/pkg/benthos/transformers/gen_generate_first_name.go b/worker/pkg/benthos/transformers/gen_generate_first_name.go
index eeedfd934c..5080c9e426 100644
--- a/worker/pkg/benthos/transformers/gen_generate_first_name.go
+++ b/worker/pkg/benthos/transformers/gen_generate_first_name.go
@@ -5,8 +5,8 @@
package transformers
import (
+ "strings"
"fmt"
-
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -28,7 +28,7 @@ func NewGenerateFirstNameOpts(
maxLengthArg *int64,
seedArg *int64,
) (*GenerateFirstNameOpts, error) {
- maxLength := int64(10000)
+ maxLength := int64(100)
if maxLengthArg != nil {
maxLength = *maxLengthArg
}
@@ -44,6 +44,22 @@ func NewGenerateFirstNameOpts(
}, nil
}
+func (o *GenerateFirstNameOpts) BuildBloblangString(
+) string {
+ fnStr := []string{
+ "max_length:%v",
+ }
+
+ params := []any{
+ o.maxLength,
+ }
+
+
+
+ template := fmt.Sprintf("generate_first_name(%s)", strings.Join(fnStr, ","))
+ return fmt.Sprintf(template, params...)
+}
+
func (t *GenerateFirstName) GetJsTemplateData() (*TemplateData, error) {
return &TemplateData{
Name: "generateFirstName",
@@ -57,7 +73,7 @@ func (t *GenerateFirstName) ParseOptions(opts map[string]any) (any, error) {
maxLength, ok := opts["maxLength"].(int64)
if !ok {
- maxLength = 10000
+ maxLength = 100
}
transformerOpts.maxLength = maxLength
diff --git a/worker/pkg/benthos/transformers/gen_generate_float.go b/worker/pkg/benthos/transformers/gen_generate_float.go
index 45af37875b..a6c1edb3ea 100644
--- a/worker/pkg/benthos/transformers/gen_generate_float.go
+++ b/worker/pkg/benthos/transformers/gen_generate_float.go
@@ -5,8 +5,8 @@
package transformers
import (
+ "strings"
"fmt"
-
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -30,17 +30,27 @@ func NewGenerateFloat64() *GenerateFloat64 {
func NewGenerateFloat64Opts(
randomizeSignArg *bool,
- min float64,
- max float64,
+ minArg *float64,
+ maxArg *float64,
precision *int64,
scale *int64,
seedArg *int64,
) (*GenerateFloat64Opts, error) {
- randomizeSign := bool(false)
+ randomizeSign := bool(false)
if randomizeSignArg != nil {
randomizeSign = *randomizeSignArg
}
+ min := float64(1)
+ if minArg != nil {
+ min = *minArg
+ }
+
+ max := float64(10000)
+ if maxArg != nil {
+ max = *maxArg
+ }
+
seed, err := transformer_utils.GetSeedOrDefault(seedArg)
if err != nil {
return nil, fmt.Errorf("unable to generate seed: %w", err)
@@ -56,6 +66,34 @@ func NewGenerateFloat64Opts(
}, nil
}
+func (o *GenerateFloat64Opts) BuildBloblangString(
+) string {
+ fnStr := []string{
+ "randomize_sign:%v",
+ "min:%v",
+ "max:%v",
+ }
+
+ params := []any{
+ o.randomizeSign,
+ o.min,
+ o.max,
+ }
+
+
+ if o.precision != nil {
+ fnStr = append(fnStr, "precision:%v")
+ params = append(params, *o.precision)
+ }
+ if o.scale != nil {
+ fnStr = append(fnStr, "scale:%v")
+ params = append(params, *o.scale)
+ }
+
+ template := fmt.Sprintf("generate_float64(%s)", strings.Join(fnStr, ","))
+ return fmt.Sprintf(template, params...)
+}
+
func (t *GenerateFloat64) GetJsTemplateData() (*TemplateData, error) {
return &TemplateData{
Name: "generateFloat64",
@@ -73,16 +111,16 @@ func (t *GenerateFloat64) ParseOptions(opts map[string]any) (any, error) {
}
transformerOpts.randomizeSign = randomizeSign
- if _, ok := opts["min"].(float64); !ok {
- return nil, fmt.Errorf("missing required argument. function: %s argument: %s", "generateFloat64", "min")
+ min, ok := opts["min"].(float64)
+ if !ok {
+ min = 1
}
- min := opts["min"].(float64)
transformerOpts.min = min
- if _, ok := opts["max"].(float64); !ok {
- return nil, fmt.Errorf("missing required argument. function: %s argument: %s", "generateFloat64", "max")
+ max, ok := opts["max"].(float64)
+ if !ok {
+ max = 10000
}
- max := opts["max"].(float64)
transformerOpts.max = max
var precision *int64
diff --git a/worker/pkg/benthos/transformers/gen_generate_full_address.go b/worker/pkg/benthos/transformers/gen_generate_full_address.go
index 67cf3833fa..84f318bb0c 100644
--- a/worker/pkg/benthos/transformers/gen_generate_full_address.go
+++ b/worker/pkg/benthos/transformers/gen_generate_full_address.go
@@ -5,8 +5,8 @@
package transformers
import (
+ "strings"
"fmt"
-
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -25,9 +25,14 @@ func NewGenerateFullAddress() *GenerateFullAddress {
}
func NewGenerateFullAddressOpts(
- maxLength int64,
+ maxLengthArg *int64,
seedArg *int64,
) (*GenerateFullAddressOpts, error) {
+ maxLength := int64(100)
+ if maxLengthArg != nil {
+ maxLength = *maxLengthArg
+ }
+
seed, err := transformer_utils.GetSeedOrDefault(seedArg)
if err != nil {
return nil, fmt.Errorf("unable to generate seed: %w", err)
@@ -39,6 +44,22 @@ func NewGenerateFullAddressOpts(
}, nil
}
+func (o *GenerateFullAddressOpts) BuildBloblangString(
+) string {
+ fnStr := []string{
+ "max_length:%v",
+ }
+
+ params := []any{
+ o.maxLength,
+ }
+
+
+
+ template := fmt.Sprintf("generate_full_address(%s)", strings.Join(fnStr, ","))
+ return fmt.Sprintf(template, params...)
+}
+
func (t *GenerateFullAddress) GetJsTemplateData() (*TemplateData, error) {
return &TemplateData{
Name: "generateFullAddress",
@@ -50,10 +71,10 @@ func (t *GenerateFullAddress) GetJsTemplateData() (*TemplateData, error) {
func (t *GenerateFullAddress) ParseOptions(opts map[string]any) (any, error) {
transformerOpts := &GenerateFullAddressOpts{}
- if _, ok := opts["maxLength"].(int64); !ok {
- return nil, fmt.Errorf("missing required argument. function: %s argument: %s", "generateFullAddress", "maxLength")
+ maxLength, ok := opts["maxLength"].(int64)
+ if !ok {
+ maxLength = 100
}
- maxLength := opts["maxLength"].(int64)
transformerOpts.maxLength = maxLength
var seedArg *int64
diff --git a/worker/pkg/benthos/transformers/gen_generate_full_name.go b/worker/pkg/benthos/transformers/gen_generate_full_name.go
index f0eee8b1e8..8d8ae5bc8e 100644
--- a/worker/pkg/benthos/transformers/gen_generate_full_name.go
+++ b/worker/pkg/benthos/transformers/gen_generate_full_name.go
@@ -5,8 +5,8 @@
package transformers
import (
+ "strings"
"fmt"
-
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -28,7 +28,7 @@ func NewGenerateFullNameOpts(
maxLengthArg *int64,
seedArg *int64,
) (*GenerateFullNameOpts, error) {
- maxLength := int64(10000)
+ maxLength := int64(100)
if maxLengthArg != nil {
maxLength = *maxLengthArg
}
@@ -44,6 +44,22 @@ func NewGenerateFullNameOpts(
}, nil
}
+func (o *GenerateFullNameOpts) BuildBloblangString(
+) string {
+ fnStr := []string{
+ "max_length:%v",
+ }
+
+ params := []any{
+ o.maxLength,
+ }
+
+
+
+ template := fmt.Sprintf("generate_full_name(%s)", strings.Join(fnStr, ","))
+ return fmt.Sprintf(template, params...)
+}
+
func (t *GenerateFullName) GetJsTemplateData() (*TemplateData, error) {
return &TemplateData{
Name: "generateFullName",
@@ -57,7 +73,7 @@ func (t *GenerateFullName) ParseOptions(opts map[string]any) (any, error) {
maxLength, ok := opts["maxLength"].(int64)
if !ok {
- maxLength = 10000
+ maxLength = 100
}
transformerOpts.maxLength = maxLength
diff --git a/worker/pkg/benthos/transformers/gen_generate_gender.go b/worker/pkg/benthos/transformers/gen_generate_gender.go
index d46ca6d5f7..b9efd73e5d 100644
--- a/worker/pkg/benthos/transformers/gen_generate_gender.go
+++ b/worker/pkg/benthos/transformers/gen_generate_gender.go
@@ -5,8 +5,8 @@
package transformers
import (
+ "strings"
"fmt"
-
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -30,12 +30,12 @@ func NewGenerateGenderOpts(
maxLengthArg *int64,
seedArg *int64,
) (*GenerateGenderOpts, error) {
- abbreviate := bool(false)
+ abbreviate := bool(false)
if abbreviateArg != nil {
abbreviate = *abbreviateArg
}
- maxLength := int64(10000)
+ maxLength := int64(100)
if maxLengthArg != nil {
maxLength = *maxLengthArg
}
@@ -52,6 +52,24 @@ func NewGenerateGenderOpts(
}, nil
}
+func (o *GenerateGenderOpts) BuildBloblangString(
+) string {
+ fnStr := []string{
+ "abbreviate:%v",
+ "max_length:%v",
+ }
+
+ params := []any{
+ o.abbreviate,
+ o.maxLength,
+ }
+
+
+
+ template := fmt.Sprintf("generate_gender(%s)", strings.Join(fnStr, ","))
+ return fmt.Sprintf(template, params...)
+}
+
func (t *GenerateGender) GetJsTemplateData() (*TemplateData, error) {
return &TemplateData{
Name: "generateGender",
@@ -71,7 +89,7 @@ func (t *GenerateGender) ParseOptions(opts map[string]any) (any, error) {
maxLength, ok := opts["maxLength"].(int64)
if !ok {
- maxLength = 10000
+ maxLength = 100
}
transformerOpts.maxLength = maxLength
diff --git a/worker/pkg/benthos/transformers/gen_generate_int64.go b/worker/pkg/benthos/transformers/gen_generate_int64.go
index 9f273d716f..c183b37db8 100644
--- a/worker/pkg/benthos/transformers/gen_generate_int64.go
+++ b/worker/pkg/benthos/transformers/gen_generate_int64.go
@@ -5,8 +5,8 @@
package transformers
import (
+ "strings"
"fmt"
-
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -28,15 +28,25 @@ func NewGenerateInt64() *GenerateInt64 {
func NewGenerateInt64Opts(
randomizeSignArg *bool,
- min int64,
- max int64,
+ minArg *int64,
+ maxArg *int64,
seedArg *int64,
) (*GenerateInt64Opts, error) {
- randomizeSign := bool(false)
+ randomizeSign := bool(false)
if randomizeSignArg != nil {
randomizeSign = *randomizeSignArg
}
+ min := int64(1)
+ if minArg != nil {
+ min = *minArg
+ }
+
+ max := int64(10000)
+ if maxArg != nil {
+ max = *maxArg
+ }
+
seed, err := transformer_utils.GetSeedOrDefault(seedArg)
if err != nil {
return nil, fmt.Errorf("unable to generate seed: %w", err)
@@ -50,6 +60,26 @@ func NewGenerateInt64Opts(
}, nil
}
+func (o *GenerateInt64Opts) BuildBloblangString(
+) string {
+ fnStr := []string{
+ "randomize_sign:%v",
+ "min:%v",
+ "max:%v",
+ }
+
+ params := []any{
+ o.randomizeSign,
+ o.min,
+ o.max,
+ }
+
+
+
+ template := fmt.Sprintf("generate_int64(%s)", strings.Join(fnStr, ","))
+ return fmt.Sprintf(template, params...)
+}
+
func (t *GenerateInt64) GetJsTemplateData() (*TemplateData, error) {
return &TemplateData{
Name: "generateInt64",
@@ -67,16 +97,16 @@ func (t *GenerateInt64) ParseOptions(opts map[string]any) (any, error) {
}
transformerOpts.randomizeSign = randomizeSign
- if _, ok := opts["min"].(int64); !ok {
- return nil, fmt.Errorf("missing required argument. function: %s argument: %s", "generateInt64", "min")
+ min, ok := opts["min"].(int64)
+ if !ok {
+ min = 1
}
- min := opts["min"].(int64)
transformerOpts.min = min
- if _, ok := opts["max"].(int64); !ok {
- return nil, fmt.Errorf("missing required argument. function: %s argument: %s", "generateInt64", "max")
+ max, ok := opts["max"].(int64)
+ if !ok {
+ max = 10000
}
- max := opts["max"].(int64)
transformerOpts.max = max
var seedArg *int64
diff --git a/worker/pkg/benthos/transformers/gen_generate_int64_phone_number.go b/worker/pkg/benthos/transformers/gen_generate_int64_phone_number.go
index 4b1cda478e..6a3fc1ebd4 100644
--- a/worker/pkg/benthos/transformers/gen_generate_int64_phone_number.go
+++ b/worker/pkg/benthos/transformers/gen_generate_int64_phone_number.go
@@ -5,8 +5,8 @@
package transformers
import (
+ "strings"
"fmt"
-
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -36,6 +36,20 @@ func NewGenerateInt64PhoneNumberOpts(
}, nil
}
+func (o *GenerateInt64PhoneNumberOpts) BuildBloblangString(
+) string {
+ fnStr := []string{
+ }
+
+ params := []any{
+ }
+
+
+
+ template := fmt.Sprintf("generate_int64_phone_number(%s)", strings.Join(fnStr, ","))
+ return fmt.Sprintf(template, params...)
+}
+
func (t *GenerateInt64PhoneNumber) GetJsTemplateData() (*TemplateData, error) {
return &TemplateData{
Name: "generateInt64PhoneNumber",
diff --git a/worker/pkg/benthos/transformers/gen_generate_international_phone_number.go b/worker/pkg/benthos/transformers/gen_generate_international_phone_number.go
index 93771ff975..731c18bf2d 100644
--- a/worker/pkg/benthos/transformers/gen_generate_international_phone_number.go
+++ b/worker/pkg/benthos/transformers/gen_generate_international_phone_number.go
@@ -5,8 +5,8 @@
package transformers
import (
+ "strings"
"fmt"
-
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -26,10 +26,20 @@ func NewGenerateInternationalPhoneNumber() *GenerateInternationalPhoneNumber {
}
func NewGenerateInternationalPhoneNumberOpts(
- min int64,
- max int64,
+ minArg *int64,
+ maxArg *int64,
seedArg *int64,
) (*GenerateInternationalPhoneNumberOpts, error) {
+ min := int64(9)
+ if minArg != nil {
+ min = *minArg
+ }
+
+ max := int64(15)
+ if maxArg != nil {
+ max = *maxArg
+ }
+
seed, err := transformer_utils.GetSeedOrDefault(seedArg)
if err != nil {
return nil, fmt.Errorf("unable to generate seed: %w", err)
@@ -42,6 +52,24 @@ func NewGenerateInternationalPhoneNumberOpts(
}, nil
}
+func (o *GenerateInternationalPhoneNumberOpts) BuildBloblangString(
+) string {
+ fnStr := []string{
+ "min:%v",
+ "max:%v",
+ }
+
+ params := []any{
+ o.min,
+ o.max,
+ }
+
+
+
+ template := fmt.Sprintf("generate_e164_phone_number(%s)", strings.Join(fnStr, ","))
+ return fmt.Sprintf(template, params...)
+}
+
func (t *GenerateInternationalPhoneNumber) GetJsTemplateData() (*TemplateData, error) {
return &TemplateData{
Name: "generateInternationalPhoneNumber",
@@ -53,16 +81,16 @@ func (t *GenerateInternationalPhoneNumber) GetJsTemplateData() (*TemplateData, e
func (t *GenerateInternationalPhoneNumber) ParseOptions(opts map[string]any) (any, error) {
transformerOpts := &GenerateInternationalPhoneNumberOpts{}
- if _, ok := opts["min"].(int64); !ok {
- return nil, fmt.Errorf("missing required argument. function: %s argument: %s", "generateInternationalPhoneNumber", "min")
+ min, ok := opts["min"].(int64)
+ if !ok {
+ min = 9
}
- min := opts["min"].(int64)
transformerOpts.min = min
- if _, ok := opts["max"].(int64); !ok {
- return nil, fmt.Errorf("missing required argument. function: %s argument: %s", "generateInternationalPhoneNumber", "max")
+ max, ok := opts["max"].(int64)
+ if !ok {
+ max = 15
}
- max := opts["max"].(int64)
transformerOpts.max = max
var seedArg *int64
diff --git a/worker/pkg/benthos/transformers/gen_generate_last_name.go b/worker/pkg/benthos/transformers/gen_generate_last_name.go
index b14e945bf7..e12a6bd536 100644
--- a/worker/pkg/benthos/transformers/gen_generate_last_name.go
+++ b/worker/pkg/benthos/transformers/gen_generate_last_name.go
@@ -5,8 +5,8 @@
package transformers
import (
+ "strings"
"fmt"
-
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -28,7 +28,7 @@ func NewGenerateLastNameOpts(
maxLengthArg *int64,
seedArg *int64,
) (*GenerateLastNameOpts, error) {
- maxLength := int64(10000)
+ maxLength := int64(100)
if maxLengthArg != nil {
maxLength = *maxLengthArg
}
@@ -44,6 +44,22 @@ func NewGenerateLastNameOpts(
}, nil
}
+func (o *GenerateLastNameOpts) BuildBloblangString(
+) string {
+ fnStr := []string{
+ "max_length:%v",
+ }
+
+ params := []any{
+ o.maxLength,
+ }
+
+
+
+ template := fmt.Sprintf("generate_last_name(%s)", strings.Join(fnStr, ","))
+ return fmt.Sprintf(template, params...)
+}
+
func (t *GenerateLastName) GetJsTemplateData() (*TemplateData, error) {
return &TemplateData{
Name: "generateLastName",
@@ -57,7 +73,7 @@ func (t *GenerateLastName) ParseOptions(opts map[string]any) (any, error) {
maxLength, ok := opts["maxLength"].(int64)
if !ok {
- maxLength = 10000
+ maxLength = 100
}
transformerOpts.maxLength = maxLength
diff --git a/worker/pkg/benthos/transformers/gen_generate_random_string.go b/worker/pkg/benthos/transformers/gen_generate_random_string.go
index 7e17bc5088..aa008bd6c8 100644
--- a/worker/pkg/benthos/transformers/gen_generate_random_string.go
+++ b/worker/pkg/benthos/transformers/gen_generate_random_string.go
@@ -5,8 +5,8 @@
package transformers
import (
+ "strings"
"fmt"
-
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -26,10 +26,20 @@ func NewGenerateRandomString() *GenerateRandomString {
}
func NewGenerateRandomStringOpts(
- min int64,
- max int64,
+ minArg *int64,
+ maxArg *int64,
seedArg *int64,
) (*GenerateRandomStringOpts, error) {
+ min := int64(1)
+ if minArg != nil {
+ min = *minArg
+ }
+
+ max := int64(100)
+ if maxArg != nil {
+ max = *maxArg
+ }
+
seed, err := transformer_utils.GetSeedOrDefault(seedArg)
if err != nil {
return nil, fmt.Errorf("unable to generate seed: %w", err)
@@ -42,6 +52,24 @@ func NewGenerateRandomStringOpts(
}, nil
}
+func (o *GenerateRandomStringOpts) BuildBloblangString(
+) string {
+ fnStr := []string{
+ "min:%v",
+ "max:%v",
+ }
+
+ params := []any{
+ o.min,
+ o.max,
+ }
+
+
+
+ template := fmt.Sprintf("generate_string(%s)", strings.Join(fnStr, ","))
+ return fmt.Sprintf(template, params...)
+}
+
func (t *GenerateRandomString) GetJsTemplateData() (*TemplateData, error) {
return &TemplateData{
Name: "generateRandomString",
@@ -53,16 +81,16 @@ func (t *GenerateRandomString) GetJsTemplateData() (*TemplateData, error) {
func (t *GenerateRandomString) ParseOptions(opts map[string]any) (any, error) {
transformerOpts := &GenerateRandomStringOpts{}
- if _, ok := opts["min"].(int64); !ok {
- return nil, fmt.Errorf("missing required argument. function: %s argument: %s", "generateRandomString", "min")
+ min, ok := opts["min"].(int64)
+ if !ok {
+ min = 1
}
- min := opts["min"].(int64)
transformerOpts.min = min
- if _, ok := opts["max"].(int64); !ok {
- return nil, fmt.Errorf("missing required argument. function: %s argument: %s", "generateRandomString", "max")
+ max, ok := opts["max"].(int64)
+ if !ok {
+ max = 100
}
- max := opts["max"].(int64)
transformerOpts.max = max
var seedArg *int64
diff --git a/worker/pkg/benthos/transformers/gen_generate_sha256hash.go b/worker/pkg/benthos/transformers/gen_generate_sha256hash.go
index 70f225ff5e..063801e6db 100644
--- a/worker/pkg/benthos/transformers/gen_generate_sha256hash.go
+++ b/worker/pkg/benthos/transformers/gen_generate_sha256hash.go
@@ -5,6 +5,8 @@
package transformers
import (
+ "strings"
+ "fmt"
)
type GenerateSHA256Hash struct{}
@@ -22,6 +24,20 @@ func NewGenerateSHA256HashOpts(
}, nil
}
+func (o *GenerateSHA256HashOpts) BuildBloblangString(
+) string {
+ fnStr := []string{
+ }
+
+ params := []any{
+ }
+
+
+
+ template := fmt.Sprintf("generate_sha256hash(%s)", strings.Join(fnStr, ","))
+ return fmt.Sprintf(template, params...)
+}
+
func (t *GenerateSHA256Hash) GetJsTemplateData() (*TemplateData, error) {
return &TemplateData{
Name: "generateSHA256Hash",
diff --git a/worker/pkg/benthos/transformers/gen_generate_ssn.go b/worker/pkg/benthos/transformers/gen_generate_ssn.go
index 444c4dd79a..b079a90e8f 100644
--- a/worker/pkg/benthos/transformers/gen_generate_ssn.go
+++ b/worker/pkg/benthos/transformers/gen_generate_ssn.go
@@ -5,8 +5,8 @@
package transformers
import (
+ "strings"
"fmt"
-
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -36,6 +36,20 @@ func NewGenerateSSNOpts(
}, nil
}
+func (o *GenerateSSNOpts) BuildBloblangString(
+) string {
+ fnStr := []string{
+ }
+
+ params := []any{
+ }
+
+
+
+ template := fmt.Sprintf("generate_ssn(%s)", strings.Join(fnStr, ","))
+ return fmt.Sprintf(template, params...)
+}
+
func (t *GenerateSSN) GetJsTemplateData() (*TemplateData, error) {
return &TemplateData{
Name: "generateSSN",
diff --git a/worker/pkg/benthos/transformers/gen_generate_state.go b/worker/pkg/benthos/transformers/gen_generate_state.go
index 59d29160a1..10faa54a4b 100644
--- a/worker/pkg/benthos/transformers/gen_generate_state.go
+++ b/worker/pkg/benthos/transformers/gen_generate_state.go
@@ -5,8 +5,8 @@
package transformers
import (
+ "strings"
"fmt"
-
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -28,7 +28,7 @@ func NewGenerateStateOpts(
generateFullNameArg *bool,
seedArg *int64,
) (*GenerateStateOpts, error) {
- generateFullName := bool(false)
+ generateFullName := bool(false)
if generateFullNameArg != nil {
generateFullName = *generateFullNameArg
}
@@ -44,6 +44,22 @@ func NewGenerateStateOpts(
}, nil
}
+func (o *GenerateStateOpts) BuildBloblangString(
+) string {
+ fnStr := []string{
+ "generate_full_name:%v",
+ }
+
+ params := []any{
+ o.generateFullName,
+ }
+
+
+
+ template := fmt.Sprintf("generate_state(%s)", strings.Join(fnStr, ","))
+ return fmt.Sprintf(template, params...)
+}
+
func (t *GenerateState) GetJsTemplateData() (*TemplateData, error) {
return &TemplateData{
Name: "generateState",
diff --git a/worker/pkg/benthos/transformers/gen_generate_street_address.go b/worker/pkg/benthos/transformers/gen_generate_street_address.go
index 4cf7647693..7d175dd316 100644
--- a/worker/pkg/benthos/transformers/gen_generate_street_address.go
+++ b/worker/pkg/benthos/transformers/gen_generate_street_address.go
@@ -5,8 +5,8 @@
package transformers
import (
+ "strings"
"fmt"
-
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -25,9 +25,14 @@ func NewGenerateStreetAddress() *GenerateStreetAddress {
}
func NewGenerateStreetAddressOpts(
- maxLength int64,
+ maxLengthArg *int64,
seedArg *int64,
) (*GenerateStreetAddressOpts, error) {
+ maxLength := int64(100)
+ if maxLengthArg != nil {
+ maxLength = *maxLengthArg
+ }
+
seed, err := transformer_utils.GetSeedOrDefault(seedArg)
if err != nil {
return nil, fmt.Errorf("unable to generate seed: %w", err)
@@ -39,6 +44,22 @@ func NewGenerateStreetAddressOpts(
}, nil
}
+func (o *GenerateStreetAddressOpts) BuildBloblangString(
+) string {
+ fnStr := []string{
+ "max_length:%v",
+ }
+
+ params := []any{
+ o.maxLength,
+ }
+
+
+
+ template := fmt.Sprintf("generate_street_address(%s)", strings.Join(fnStr, ","))
+ return fmt.Sprintf(template, params...)
+}
+
func (t *GenerateStreetAddress) GetJsTemplateData() (*TemplateData, error) {
return &TemplateData{
Name: "generateStreetAddress",
@@ -50,10 +71,10 @@ func (t *GenerateStreetAddress) GetJsTemplateData() (*TemplateData, error) {
func (t *GenerateStreetAddress) ParseOptions(opts map[string]any) (any, error) {
transformerOpts := &GenerateStreetAddressOpts{}
- if _, ok := opts["maxLength"].(int64); !ok {
- return nil, fmt.Errorf("missing required argument. function: %s argument: %s", "generateStreetAddress", "maxLength")
+ maxLength, ok := opts["maxLength"].(int64)
+ if !ok {
+ maxLength = 100
}
- maxLength := opts["maxLength"].(int64)
transformerOpts.maxLength = maxLength
var seedArg *int64
diff --git a/worker/pkg/benthos/transformers/gen_generate_string_phone_number.go b/worker/pkg/benthos/transformers/gen_generate_string_phone_number.go
index 0070207924..3432df9c3c 100644
--- a/worker/pkg/benthos/transformers/gen_generate_string_phone_number.go
+++ b/worker/pkg/benthos/transformers/gen_generate_string_phone_number.go
@@ -5,8 +5,8 @@
package transformers
import (
+ "strings"
"fmt"
-
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -26,10 +26,20 @@ func NewGenerateStringPhoneNumber() *GenerateStringPhoneNumber {
}
func NewGenerateStringPhoneNumberOpts(
- min int64,
- max int64,
+ minArg *int64,
+ maxArg *int64,
seedArg *int64,
) (*GenerateStringPhoneNumberOpts, error) {
+ min := int64(9)
+ if minArg != nil {
+ min = *minArg
+ }
+
+ max := int64(15)
+ if maxArg != nil {
+ max = *maxArg
+ }
+
seed, err := transformer_utils.GetSeedOrDefault(seedArg)
if err != nil {
return nil, fmt.Errorf("unable to generate seed: %w", err)
@@ -42,6 +52,24 @@ func NewGenerateStringPhoneNumberOpts(
}, nil
}
+func (o *GenerateStringPhoneNumberOpts) BuildBloblangString(
+) string {
+ fnStr := []string{
+ "min:%v",
+ "max:%v",
+ }
+
+ params := []any{
+ o.min,
+ o.max,
+ }
+
+
+
+ template := fmt.Sprintf("generate_string_phone_number(%s)", strings.Join(fnStr, ","))
+ return fmt.Sprintf(template, params...)
+}
+
func (t *GenerateStringPhoneNumber) GetJsTemplateData() (*TemplateData, error) {
return &TemplateData{
Name: "generateStringPhoneNumber",
@@ -53,16 +81,16 @@ func (t *GenerateStringPhoneNumber) GetJsTemplateData() (*TemplateData, error) {
func (t *GenerateStringPhoneNumber) ParseOptions(opts map[string]any) (any, error) {
transformerOpts := &GenerateStringPhoneNumberOpts{}
- if _, ok := opts["min"].(int64); !ok {
- return nil, fmt.Errorf("missing required argument. function: %s argument: %s", "generateStringPhoneNumber", "min")
+ min, ok := opts["min"].(int64)
+ if !ok {
+ min = 9
}
- min := opts["min"].(int64)
transformerOpts.min = min
- if _, ok := opts["max"].(int64); !ok {
- return nil, fmt.Errorf("missing required argument. function: %s argument: %s", "generateStringPhoneNumber", "max")
+ max, ok := opts["max"].(int64)
+ if !ok {
+ max = 15
}
- max := opts["max"].(int64)
transformerOpts.max = max
var seedArg *int64
diff --git a/worker/pkg/benthos/transformers/gen_generate_unix_timestamp.go b/worker/pkg/benthos/transformers/gen_generate_unix_timestamp.go
index f95717afe5..1f3334c07c 100644
--- a/worker/pkg/benthos/transformers/gen_generate_unix_timestamp.go
+++ b/worker/pkg/benthos/transformers/gen_generate_unix_timestamp.go
@@ -5,8 +5,8 @@
package transformers
import (
+ "strings"
"fmt"
-
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -36,6 +36,20 @@ func NewGenerateUnixTimestampOpts(
}, nil
}
+func (o *GenerateUnixTimestampOpts) BuildBloblangString(
+) string {
+ fnStr := []string{
+ }
+
+ params := []any{
+ }
+
+
+
+ template := fmt.Sprintf("generate_unixtimestamp(%s)", strings.Join(fnStr, ","))
+ return fmt.Sprintf(template, params...)
+}
+
func (t *GenerateUnixTimestamp) GetJsTemplateData() (*TemplateData, error) {
return &TemplateData{
Name: "generateUnixTimestamp",
diff --git a/worker/pkg/benthos/transformers/gen_generate_username.go b/worker/pkg/benthos/transformers/gen_generate_username.go
index 413305d27c..1cb3e0cd3c 100644
--- a/worker/pkg/benthos/transformers/gen_generate_username.go
+++ b/worker/pkg/benthos/transformers/gen_generate_username.go
@@ -5,8 +5,8 @@
package transformers
import (
+ "strings"
"fmt"
-
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -28,7 +28,7 @@ func NewGenerateUsernameOpts(
maxLengthArg *int64,
seedArg *int64,
) (*GenerateUsernameOpts, error) {
- maxLength := int64(10000)
+ maxLength := int64(100)
if maxLengthArg != nil {
maxLength = *maxLengthArg
}
@@ -44,6 +44,22 @@ func NewGenerateUsernameOpts(
}, nil
}
+func (o *GenerateUsernameOpts) BuildBloblangString(
+) string {
+ fnStr := []string{
+ "max_length:%v",
+ }
+
+ params := []any{
+ o.maxLength,
+ }
+
+
+
+ template := fmt.Sprintf("generate_username(%s)", strings.Join(fnStr, ","))
+ return fmt.Sprintf(template, params...)
+}
+
func (t *GenerateUsername) GetJsTemplateData() (*TemplateData, error) {
return &TemplateData{
Name: "generateUsername",
@@ -57,7 +73,7 @@ func (t *GenerateUsername) ParseOptions(opts map[string]any) (any, error) {
maxLength, ok := opts["maxLength"].(int64)
if !ok {
- maxLength = 10000
+ maxLength = 100
}
transformerOpts.maxLength = maxLength
diff --git a/worker/pkg/benthos/transformers/gen_generate_utc_timestamp.go b/worker/pkg/benthos/transformers/gen_generate_utc_timestamp.go
index cbd99cdb08..8df5bf4c0f 100644
--- a/worker/pkg/benthos/transformers/gen_generate_utc_timestamp.go
+++ b/worker/pkg/benthos/transformers/gen_generate_utc_timestamp.go
@@ -5,8 +5,8 @@
package transformers
import (
+ "strings"
"fmt"
-
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -36,6 +36,20 @@ func NewGenerateUTCTimestampOpts(
}, nil
}
+func (o *GenerateUTCTimestampOpts) BuildBloblangString(
+) string {
+ fnStr := []string{
+ }
+
+ params := []any{
+ }
+
+
+
+ template := fmt.Sprintf("generate_utctimestamp(%s)", strings.Join(fnStr, ","))
+ return fmt.Sprintf(template, params...)
+}
+
func (t *GenerateUTCTimestamp) GetJsTemplateData() (*TemplateData, error) {
return &TemplateData{
Name: "generateUTCTimestamp",
diff --git a/worker/pkg/benthos/transformers/gen_generate_uuid.go b/worker/pkg/benthos/transformers/gen_generate_uuid.go
index 3c6801badb..0a0cbb1dd3 100644
--- a/worker/pkg/benthos/transformers/gen_generate_uuid.go
+++ b/worker/pkg/benthos/transformers/gen_generate_uuid.go
@@ -5,6 +5,8 @@
package transformers
import (
+ "strings"
+ "fmt"
)
type GenerateUUID struct{}
@@ -20,7 +22,7 @@ func NewGenerateUUID() *GenerateUUID {
func NewGenerateUUIDOpts(
includeHyphensArg *bool,
) (*GenerateUUIDOpts, error) {
- includeHyphens := bool(true)
+ includeHyphens := bool(true)
if includeHyphensArg != nil {
includeHyphens = *includeHyphensArg
}
@@ -30,6 +32,22 @@ func NewGenerateUUIDOpts(
}, nil
}
+func (o *GenerateUUIDOpts) BuildBloblangString(
+) string {
+ fnStr := []string{
+ "include_hyphens:%v",
+ }
+
+ params := []any{
+ o.includeHyphens,
+ }
+
+
+
+ template := fmt.Sprintf("generate_uuid(%s)", strings.Join(fnStr, ","))
+ return fmt.Sprintf(template, params...)
+}
+
func (t *GenerateUUID) GetJsTemplateData() (*TemplateData, error) {
return &TemplateData{
Name: "generateUUID",
diff --git a/worker/pkg/benthos/transformers/gen_generate_zipcode.go b/worker/pkg/benthos/transformers/gen_generate_zipcode.go
index 2e1ab3bfb9..7fdc6d45e2 100644
--- a/worker/pkg/benthos/transformers/gen_generate_zipcode.go
+++ b/worker/pkg/benthos/transformers/gen_generate_zipcode.go
@@ -5,8 +5,8 @@
package transformers
import (
+ "strings"
"fmt"
-
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -36,6 +36,20 @@ func NewGenerateZipcodeOpts(
}, nil
}
+func (o *GenerateZipcodeOpts) BuildBloblangString(
+) string {
+ fnStr := []string{
+ }
+
+ params := []any{
+ }
+
+
+
+ template := fmt.Sprintf("generate_zipcode(%s)", strings.Join(fnStr, ","))
+ return fmt.Sprintf(template, params...)
+}
+
func (t *GenerateZipcode) GetJsTemplateData() (*TemplateData, error) {
return &TemplateData{
Name: "generateZipcode",
diff --git a/worker/pkg/benthos/transformers/gen_transform_character_scramble.go b/worker/pkg/benthos/transformers/gen_transform_character_scramble.go
index 5228484eb2..31a7c3d1d5 100644
--- a/worker/pkg/benthos/transformers/gen_transform_character_scramble.go
+++ b/worker/pkg/benthos/transformers/gen_transform_character_scramble.go
@@ -5,8 +5,8 @@
package transformers
import (
+ "strings"
"fmt"
-
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -39,6 +39,27 @@ func NewTransformCharacterScrambleOpts(
}, nil
}
+func (o *TransformCharacterScrambleOpts) BuildBloblangString(
+ valuePath string,
+) string {
+ fnStr := []string{
+ "value:this.%s",
+ }
+
+ params := []any{
+ valuePath,
+ }
+
+
+ if o.userProvidedRegex != nil {
+ fnStr = append(fnStr, "user_provided_regex:%q")
+ params = append(params, *o.userProvidedRegex)
+ }
+
+ template := fmt.Sprintf("transform_character_scramble(%s)", strings.Join(fnStr, ","))
+ return fmt.Sprintf(template, params...)
+}
+
func (t *TransformCharacterScramble) GetJsTemplateData() (*TemplateData, error) {
return &TemplateData{
Name: "transformCharacterScramble",
diff --git a/worker/pkg/benthos/transformers/gen_transform_e164_phone_number.go b/worker/pkg/benthos/transformers/gen_transform_e164_phone_number.go
index 788c5d5b96..56870b7065 100644
--- a/worker/pkg/benthos/transformers/gen_transform_e164_phone_number.go
+++ b/worker/pkg/benthos/transformers/gen_transform_e164_phone_number.go
@@ -5,8 +5,8 @@
package transformers
import (
+ "strings"
"fmt"
-
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -18,7 +18,7 @@ type TransformE164PhoneNumberOpts struct {
randomizer rng.Rand
preserveLength bool
- maxLength *int64
+ maxLength int64
}
func NewTransformE164PhoneNumber() *TransformE164PhoneNumber {
@@ -26,10 +26,20 @@ func NewTransformE164PhoneNumber() *TransformE164PhoneNumber {
}
func NewTransformE164PhoneNumberOpts(
- preserveLength bool,
- maxLength *int64,
+ preserveLengthArg *bool,
+ maxLengthArg *int64,
seedArg *int64,
) (*TransformE164PhoneNumberOpts, error) {
+ preserveLength := bool(false)
+ if preserveLengthArg != nil {
+ preserveLength = *preserveLengthArg
+ }
+
+ maxLength := int64(15)
+ if maxLengthArg != nil {
+ maxLength = *maxLengthArg
+ }
+
seed, err := transformer_utils.GetSeedOrDefault(seedArg)
if err != nil {
return nil, fmt.Errorf("unable to generate seed: %w", err)
@@ -42,6 +52,27 @@ func NewTransformE164PhoneNumberOpts(
}, nil
}
+func (o *TransformE164PhoneNumberOpts) BuildBloblangString(
+ valuePath string,
+) string {
+ fnStr := []string{
+ "value:this.%s",
+ "preserve_length:%v",
+ "max_length:%v",
+ }
+
+ params := []any{
+ valuePath,
+ o.preserveLength,
+ o.maxLength,
+ }
+
+
+
+ template := fmt.Sprintf("transform_e164_phone_number(%s)", strings.Join(fnStr, ","))
+ return fmt.Sprintf(template, params...)
+}
+
func (t *TransformE164PhoneNumber) GetJsTemplateData() (*TemplateData, error) {
return &TemplateData{
Name: "transformE164PhoneNumber",
@@ -53,15 +84,15 @@ func (t *TransformE164PhoneNumber) GetJsTemplateData() (*TemplateData, error) {
func (t *TransformE164PhoneNumber) ParseOptions(opts map[string]any) (any, error) {
transformerOpts := &TransformE164PhoneNumberOpts{}
- if _, ok := opts["preserveLength"].(bool); !ok {
- return nil, fmt.Errorf("missing required argument. function: %s argument: %s", "transformE164PhoneNumber", "preserveLength")
+ preserveLength, ok := opts["preserveLength"].(bool)
+ if !ok {
+ preserveLength = false
}
- preserveLength := opts["preserveLength"].(bool)
transformerOpts.preserveLength = preserveLength
- var maxLength *int64
- if arg, ok := opts["maxLength"].(int64); ok {
- maxLength = &arg
+ maxLength, ok := opts["maxLength"].(int64)
+ if !ok {
+ maxLength = 15
}
transformerOpts.maxLength = maxLength
diff --git a/worker/pkg/benthos/transformers/gen_transform_email.go b/worker/pkg/benthos/transformers/gen_transform_email.go
index 2e42bb0c7e..b98577d440 100644
--- a/worker/pkg/benthos/transformers/gen_transform_email.go
+++ b/worker/pkg/benthos/transformers/gen_transform_email.go
@@ -5,8 +5,8 @@
package transformers
import (
+ "strings"
"fmt"
-
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -38,22 +38,22 @@ func NewTransformEmailOpts(
emailTypeArg *string,
invalidEmailActionArg *string,
) (*TransformEmailOpts, error) {
- preserveLength := bool(false)
+ preserveLength := bool(false)
if preserveLengthArg != nil {
preserveLength = *preserveLengthArg
}
- preserveDomain := bool(false)
+ preserveDomain := bool(false)
if preserveDomainArg != nil {
preserveDomain = *preserveDomainArg
}
- excludedDomains := any([]any{})
+ var excludedDomains any
if excludedDomainsArg != nil {
excludedDomains = *excludedDomainsArg
}
- maxLength := int64(10000)
+ maxLength := int64(100)
if maxLengthArg != nil {
maxLength = *maxLengthArg
}
@@ -63,12 +63,12 @@ func NewTransformEmailOpts(
return nil, fmt.Errorf("unable to generate seed: %w", err)
}
- emailType := string(GenerateEmailType_UuidV4.String())
+ emailType := string(GenerateEmailType_UuidV4.String())
if emailTypeArg != nil {
emailType = *emailTypeArg
}
- invalidEmailAction := string(InvalidEmailAction_Reject.String())
+ invalidEmailAction := string(InvalidEmailAction_Reject.String())
if invalidEmailActionArg != nil {
invalidEmailAction = *invalidEmailActionArg
}
@@ -84,6 +84,35 @@ func NewTransformEmailOpts(
}, nil
}
+func (o *TransformEmailOpts) BuildBloblangString(
+ valuePath string,
+) string {
+ fnStr := []string{
+ "value:this.%s",
+ "preserve_length:%v",
+ "preserve_domain:%v",
+ "excluded_domains:%v",
+ "max_length:%v",
+ "email_type:%q",
+ "invalid_email_action:%q",
+ }
+
+ params := []any{
+ valuePath,
+ o.preserveLength,
+ o.preserveDomain,
+ o.excludedDomains,
+ o.maxLength,
+ o.emailType,
+ o.invalidEmailAction,
+ }
+
+
+
+ template := fmt.Sprintf("transform_email(%s)", strings.Join(fnStr, ","))
+ return fmt.Sprintf(template, params...)
+}
+
func (t *TransformEmail) GetJsTemplateData() (*TemplateData, error) {
return &TemplateData{
Name: "transformEmail",
@@ -115,7 +144,7 @@ func (t *TransformEmail) ParseOptions(opts map[string]any) (any, error) {
maxLength, ok := opts["maxLength"].(int64)
if !ok {
- maxLength = 10000
+ maxLength = 100
}
transformerOpts.maxLength = maxLength
diff --git a/worker/pkg/benthos/transformers/gen_transform_first_name.go b/worker/pkg/benthos/transformers/gen_transform_first_name.go
index d501318f54..f5f673d2d8 100644
--- a/worker/pkg/benthos/transformers/gen_transform_first_name.go
+++ b/worker/pkg/benthos/transformers/gen_transform_first_name.go
@@ -5,8 +5,8 @@
package transformers
import (
+ "strings"
"fmt"
-
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -30,12 +30,12 @@ func NewTransformFirstNameOpts(
preserveLengthArg *bool,
seedArg *int64,
) (*TransformFirstNameOpts, error) {
- maxLength := int64(10000)
+ maxLength := int64(100)
if maxLengthArg != nil {
maxLength = *maxLengthArg
}
- preserveLength := bool(false)
+ preserveLength := bool(false)
if preserveLengthArg != nil {
preserveLength = *preserveLengthArg
}
@@ -52,6 +52,27 @@ func NewTransformFirstNameOpts(
}, nil
}
+func (o *TransformFirstNameOpts) BuildBloblangString(
+ valuePath string,
+) string {
+ fnStr := []string{
+ "max_length:%v",
+ "value:this.%s",
+ "preserve_length:%v",
+ }
+
+ params := []any{
+ o.maxLength,
+ valuePath,
+ o.preserveLength,
+ }
+
+
+
+ template := fmt.Sprintf("transform_first_name(%s)", strings.Join(fnStr, ","))
+ return fmt.Sprintf(template, params...)
+}
+
func (t *TransformFirstName) GetJsTemplateData() (*TemplateData, error) {
return &TemplateData{
Name: "transformFirstName",
@@ -65,7 +86,7 @@ func (t *TransformFirstName) ParseOptions(opts map[string]any) (any, error) {
maxLength, ok := opts["maxLength"].(int64)
if !ok {
- maxLength = 10000
+ maxLength = 100
}
transformerOpts.maxLength = maxLength
diff --git a/worker/pkg/benthos/transformers/gen_transform_float.go b/worker/pkg/benthos/transformers/gen_transform_float.go
index e3df94d15a..938cf2a2ac 100644
--- a/worker/pkg/benthos/transformers/gen_transform_float.go
+++ b/worker/pkg/benthos/transformers/gen_transform_float.go
@@ -5,8 +5,8 @@
package transformers
import (
+ "strings"
"fmt"
-
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -28,12 +28,22 @@ func NewTransformFloat64() *TransformFloat64 {
}
func NewTransformFloat64Opts(
- randomizationRangeMin float64,
- randomizationRangeMax float64,
+ randomizationRangeMinArg *float64,
+ randomizationRangeMaxArg *float64,
precision *int64,
scale *int64,
seedArg *int64,
) (*TransformFloat64Opts, error) {
+ randomizationRangeMin := float64(1)
+ if randomizationRangeMinArg != nil {
+ randomizationRangeMin = *randomizationRangeMinArg
+ }
+
+ randomizationRangeMax := float64(10000)
+ if randomizationRangeMaxArg != nil {
+ randomizationRangeMax = *randomizationRangeMaxArg
+ }
+
seed, err := transformer_utils.GetSeedOrDefault(seedArg)
if err != nil {
return nil, fmt.Errorf("unable to generate seed: %w", err)
@@ -48,6 +58,35 @@ func NewTransformFloat64Opts(
}, nil
}
+func (o *TransformFloat64Opts) BuildBloblangString(
+ valuePath string,
+) string {
+ fnStr := []string{
+ "value:this.%s",
+ "randomization_range_min:%v",
+ "randomization_range_max:%v",
+ }
+
+ params := []any{
+ valuePath,
+ o.randomizationRangeMin,
+ o.randomizationRangeMax,
+ }
+
+
+ if o.precision != nil {
+ fnStr = append(fnStr, "precision:%v")
+ params = append(params, *o.precision)
+ }
+ if o.scale != nil {
+ fnStr = append(fnStr, "scale:%v")
+ params = append(params, *o.scale)
+ }
+
+ template := fmt.Sprintf("transform_float64(%s)", strings.Join(fnStr, ","))
+ return fmt.Sprintf(template, params...)
+}
+
func (t *TransformFloat64) GetJsTemplateData() (*TemplateData, error) {
return &TemplateData{
Name: "transformFloat64",
@@ -59,16 +98,16 @@ func (t *TransformFloat64) GetJsTemplateData() (*TemplateData, error) {
func (t *TransformFloat64) ParseOptions(opts map[string]any) (any, error) {
transformerOpts := &TransformFloat64Opts{}
- if _, ok := opts["randomizationRangeMin"].(float64); !ok {
- return nil, fmt.Errorf("missing required argument. function: %s argument: %s", "transformFloat64", "randomizationRangeMin")
+ randomizationRangeMin, ok := opts["randomizationRangeMin"].(float64)
+ if !ok {
+ randomizationRangeMin = 1
}
- randomizationRangeMin := opts["randomizationRangeMin"].(float64)
transformerOpts.randomizationRangeMin = randomizationRangeMin
- if _, ok := opts["randomizationRangeMax"].(float64); !ok {
- return nil, fmt.Errorf("missing required argument. function: %s argument: %s", "transformFloat64", "randomizationRangeMax")
+ randomizationRangeMax, ok := opts["randomizationRangeMax"].(float64)
+ if !ok {
+ randomizationRangeMax = 10000
}
- randomizationRangeMax := opts["randomizationRangeMax"].(float64)
transformerOpts.randomizationRangeMax = randomizationRangeMax
var precision *int64
diff --git a/worker/pkg/benthos/transformers/gen_transform_full_name.go b/worker/pkg/benthos/transformers/gen_transform_full_name.go
index 1bcf18852f..49217a7314 100644
--- a/worker/pkg/benthos/transformers/gen_transform_full_name.go
+++ b/worker/pkg/benthos/transformers/gen_transform_full_name.go
@@ -5,8 +5,8 @@
package transformers
import (
+ "strings"
"fmt"
-
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -30,12 +30,12 @@ func NewTransformFullNameOpts(
preserveLengthArg *bool,
seedArg *int64,
) (*TransformFullNameOpts, error) {
- maxLength := int64(10000)
+ maxLength := int64(100)
if maxLengthArg != nil {
maxLength = *maxLengthArg
}
- preserveLength := bool(false)
+ preserveLength := bool(false)
if preserveLengthArg != nil {
preserveLength = *preserveLengthArg
}
@@ -52,6 +52,27 @@ func NewTransformFullNameOpts(
}, nil
}
+func (o *TransformFullNameOpts) BuildBloblangString(
+ valuePath string,
+) string {
+ fnStr := []string{
+ "max_length:%v",
+ "value:this.%s",
+ "preserve_length:%v",
+ }
+
+ params := []any{
+ o.maxLength,
+ valuePath,
+ o.preserveLength,
+ }
+
+
+
+ template := fmt.Sprintf("transform_full_name(%s)", strings.Join(fnStr, ","))
+ return fmt.Sprintf(template, params...)
+}
+
func (t *TransformFullName) GetJsTemplateData() (*TemplateData, error) {
return &TemplateData{
Name: "transformFullName",
@@ -65,7 +86,7 @@ func (t *TransformFullName) ParseOptions(opts map[string]any) (any, error) {
maxLength, ok := opts["maxLength"].(int64)
if !ok {
- maxLength = 10000
+ maxLength = 100
}
transformerOpts.maxLength = maxLength
diff --git a/worker/pkg/benthos/transformers/gen_transform_int64.go b/worker/pkg/benthos/transformers/gen_transform_int64.go
index ce6cfe3f8a..a3424225ed 100644
--- a/worker/pkg/benthos/transformers/gen_transform_int64.go
+++ b/worker/pkg/benthos/transformers/gen_transform_int64.go
@@ -5,8 +5,8 @@
package transformers
import (
+ "strings"
"fmt"
-
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -26,10 +26,20 @@ func NewTransformInt64() *TransformInt64 {
}
func NewTransformInt64Opts(
- randomizationRangeMin int64,
- randomizationRangeMax int64,
+ randomizationRangeMinArg *int64,
+ randomizationRangeMaxArg *int64,
seedArg *int64,
) (*TransformInt64Opts, error) {
+ randomizationRangeMin := int64(1)
+ if randomizationRangeMinArg != nil {
+ randomizationRangeMin = *randomizationRangeMinArg
+ }
+
+ randomizationRangeMax := int64(10000)
+ if randomizationRangeMaxArg != nil {
+ randomizationRangeMax = *randomizationRangeMaxArg
+ }
+
seed, err := transformer_utils.GetSeedOrDefault(seedArg)
if err != nil {
return nil, fmt.Errorf("unable to generate seed: %w", err)
@@ -42,6 +52,27 @@ func NewTransformInt64Opts(
}, nil
}
+func (o *TransformInt64Opts) BuildBloblangString(
+ valuePath string,
+) string {
+ fnStr := []string{
+ "value:this.%s",
+ "randomization_range_min:%v",
+ "randomization_range_max:%v",
+ }
+
+ params := []any{
+ valuePath,
+ o.randomizationRangeMin,
+ o.randomizationRangeMax,
+ }
+
+
+
+ template := fmt.Sprintf("transform_int64(%s)", strings.Join(fnStr, ","))
+ return fmt.Sprintf(template, params...)
+}
+
func (t *TransformInt64) GetJsTemplateData() (*TemplateData, error) {
return &TemplateData{
Name: "transformInt64",
@@ -53,16 +84,16 @@ func (t *TransformInt64) GetJsTemplateData() (*TemplateData, error) {
func (t *TransformInt64) ParseOptions(opts map[string]any) (any, error) {
transformerOpts := &TransformInt64Opts{}
- if _, ok := opts["randomizationRangeMin"].(int64); !ok {
- return nil, fmt.Errorf("missing required argument. function: %s argument: %s", "transformInt64", "randomizationRangeMin")
+ randomizationRangeMin, ok := opts["randomizationRangeMin"].(int64)
+ if !ok {
+ randomizationRangeMin = 1
}
- randomizationRangeMin := opts["randomizationRangeMin"].(int64)
transformerOpts.randomizationRangeMin = randomizationRangeMin
- if _, ok := opts["randomizationRangeMax"].(int64); !ok {
- return nil, fmt.Errorf("missing required argument. function: %s argument: %s", "transformInt64", "randomizationRangeMax")
+ randomizationRangeMax, ok := opts["randomizationRangeMax"].(int64)
+ if !ok {
+ randomizationRangeMax = 10000
}
- randomizationRangeMax := opts["randomizationRangeMax"].(int64)
transformerOpts.randomizationRangeMax = randomizationRangeMax
var seedArg *int64
diff --git a/worker/pkg/benthos/transformers/gen_transform_int64_phone_number.go b/worker/pkg/benthos/transformers/gen_transform_int64_phone_number.go
index c6a8b5cb73..c3d44c711e 100644
--- a/worker/pkg/benthos/transformers/gen_transform_int64_phone_number.go
+++ b/worker/pkg/benthos/transformers/gen_transform_int64_phone_number.go
@@ -5,8 +5,8 @@
package transformers
import (
+ "strings"
"fmt"
-
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -25,9 +25,14 @@ func NewTransformInt64PhoneNumber() *TransformInt64PhoneNumber {
}
func NewTransformInt64PhoneNumberOpts(
- preserveLength bool,
+ preserveLengthArg *bool,
seedArg *int64,
) (*TransformInt64PhoneNumberOpts, error) {
+ preserveLength := bool(false)
+ if preserveLengthArg != nil {
+ preserveLength = *preserveLengthArg
+ }
+
seed, err := transformer_utils.GetSeedOrDefault(seedArg)
if err != nil {
return nil, fmt.Errorf("unable to generate seed: %w", err)
@@ -39,6 +44,25 @@ func NewTransformInt64PhoneNumberOpts(
}, nil
}
+func (o *TransformInt64PhoneNumberOpts) BuildBloblangString(
+ valuePath string,
+) string {
+ fnStr := []string{
+ "value:this.%s",
+ "preserve_length:%v",
+ }
+
+ params := []any{
+ valuePath,
+ o.preserveLength,
+ }
+
+
+
+ template := fmt.Sprintf("transform_int64_phone_number(%s)", strings.Join(fnStr, ","))
+ return fmt.Sprintf(template, params...)
+}
+
func (t *TransformInt64PhoneNumber) GetJsTemplateData() (*TemplateData, error) {
return &TemplateData{
Name: "transformInt64PhoneNumber",
@@ -50,10 +74,10 @@ func (t *TransformInt64PhoneNumber) GetJsTemplateData() (*TemplateData, error) {
func (t *TransformInt64PhoneNumber) ParseOptions(opts map[string]any) (any, error) {
transformerOpts := &TransformInt64PhoneNumberOpts{}
- if _, ok := opts["preserveLength"].(bool); !ok {
- return nil, fmt.Errorf("missing required argument. function: %s argument: %s", "transformInt64PhoneNumber", "preserveLength")
+ preserveLength, ok := opts["preserveLength"].(bool)
+ if !ok {
+ preserveLength = false
}
- preserveLength := opts["preserveLength"].(bool)
transformerOpts.preserveLength = preserveLength
var seedArg *int64
diff --git a/worker/pkg/benthos/transformers/gen_transform_lastname.go b/worker/pkg/benthos/transformers/gen_transform_lastname.go
index f9db4a28ed..e6e72f3a26 100644
--- a/worker/pkg/benthos/transformers/gen_transform_lastname.go
+++ b/worker/pkg/benthos/transformers/gen_transform_lastname.go
@@ -5,8 +5,8 @@
package transformers
import (
+ "strings"
"fmt"
-
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -30,12 +30,12 @@ func NewTransformLastNameOpts(
preserveLengthArg *bool,
seedArg *int64,
) (*TransformLastNameOpts, error) {
- maxLength := int64(10000)
+ maxLength := int64(100)
if maxLengthArg != nil {
maxLength = *maxLengthArg
}
- preserveLength := bool(false)
+ preserveLength := bool(false)
if preserveLengthArg != nil {
preserveLength = *preserveLengthArg
}
@@ -52,6 +52,27 @@ func NewTransformLastNameOpts(
}, nil
}
+func (o *TransformLastNameOpts) BuildBloblangString(
+ valuePath string,
+) string {
+ fnStr := []string{
+ "max_length:%v",
+ "value:this.%s",
+ "preserve_length:%v",
+ }
+
+ params := []any{
+ o.maxLength,
+ valuePath,
+ o.preserveLength,
+ }
+
+
+
+ template := fmt.Sprintf("transform_last_name(%s)", strings.Join(fnStr, ","))
+ return fmt.Sprintf(template, params...)
+}
+
func (t *TransformLastName) GetJsTemplateData() (*TemplateData, error) {
return &TemplateData{
Name: "transformLastName",
@@ -65,7 +86,7 @@ func (t *TransformLastName) ParseOptions(opts map[string]any) (any, error) {
maxLength, ok := opts["maxLength"].(int64)
if !ok {
- maxLength = 10000
+ maxLength = 100
}
transformerOpts.maxLength = maxLength
diff --git a/worker/pkg/benthos/transformers/gen_transform_string.go b/worker/pkg/benthos/transformers/gen_transform_string.go
index 6e0b8e4e1c..b36aaf3dd1 100644
--- a/worker/pkg/benthos/transformers/gen_transform_string.go
+++ b/worker/pkg/benthos/transformers/gen_transform_string.go
@@ -5,8 +5,8 @@
package transformers
import (
+ "strings"
"fmt"
-
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -32,17 +32,17 @@ func NewTransformStringOpts(
maxLengthArg *int64,
seedArg *int64,
) (*TransformStringOpts, error) {
- preserveLength := bool(false)
+ preserveLength := bool(false)
if preserveLengthArg != nil {
preserveLength = *preserveLengthArg
}
- minLength := int64(1)
+ minLength := int64(1)
if minLengthArg != nil {
minLength = *minLengthArg
}
- maxLength := int64(20)
+ maxLength := int64(100)
if maxLengthArg != nil {
maxLength = *maxLengthArg
}
@@ -60,6 +60,29 @@ func NewTransformStringOpts(
}, nil
}
+func (o *TransformStringOpts) BuildBloblangString(
+ valuePath string,
+) string {
+ fnStr := []string{
+ "value:this.%s",
+ "preserve_length:%v",
+ "min_length:%v",
+ "max_length:%v",
+ }
+
+ params := []any{
+ valuePath,
+ o.preserveLength,
+ o.minLength,
+ o.maxLength,
+ }
+
+
+
+ template := fmt.Sprintf("transform_string(%s)", strings.Join(fnStr, ","))
+ return fmt.Sprintf(template, params...)
+}
+
func (t *TransformString) GetJsTemplateData() (*TemplateData, error) {
return &TemplateData{
Name: "transformString",
@@ -85,7 +108,7 @@ func (t *TransformString) ParseOptions(opts map[string]any) (any, error) {
maxLength, ok := opts["maxLength"].(int64)
if !ok {
- maxLength = 20
+ maxLength = 100
}
transformerOpts.maxLength = maxLength
diff --git a/worker/pkg/benthos/transformers/gen_transform_string_phone_number.go b/worker/pkg/benthos/transformers/gen_transform_string_phone_number.go
index 92f77f2898..d32a70dc4b 100644
--- a/worker/pkg/benthos/transformers/gen_transform_string_phone_number.go
+++ b/worker/pkg/benthos/transformers/gen_transform_string_phone_number.go
@@ -5,8 +5,8 @@
package transformers
import (
+ "strings"
"fmt"
-
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -26,10 +26,20 @@ func NewTransformStringPhoneNumber() *TransformStringPhoneNumber {
}
func NewTransformStringPhoneNumberOpts(
- preserveLength bool,
- maxLength int64,
+ preserveLengthArg *bool,
+ maxLengthArg *int64,
seedArg *int64,
) (*TransformStringPhoneNumberOpts, error) {
+ preserveLength := bool(false)
+ if preserveLengthArg != nil {
+ preserveLength = *preserveLengthArg
+ }
+
+ maxLength := int64(100)
+ if maxLengthArg != nil {
+ maxLength = *maxLengthArg
+ }
+
seed, err := transformer_utils.GetSeedOrDefault(seedArg)
if err != nil {
return nil, fmt.Errorf("unable to generate seed: %w", err)
@@ -42,6 +52,27 @@ func NewTransformStringPhoneNumberOpts(
}, nil
}
+func (o *TransformStringPhoneNumberOpts) BuildBloblangString(
+ valuePath string,
+) string {
+ fnStr := []string{
+ "value:this.%s",
+ "preserve_length:%v",
+ "max_length:%v",
+ }
+
+ params := []any{
+ valuePath,
+ o.preserveLength,
+ o.maxLength,
+ }
+
+
+
+ template := fmt.Sprintf("transform_phone_number(%s)", strings.Join(fnStr, ","))
+ return fmt.Sprintf(template, params...)
+}
+
func (t *TransformStringPhoneNumber) GetJsTemplateData() (*TemplateData, error) {
return &TemplateData{
Name: "transformStringPhoneNumber",
@@ -53,16 +84,16 @@ func (t *TransformStringPhoneNumber) GetJsTemplateData() (*TemplateData, error)
func (t *TransformStringPhoneNumber) ParseOptions(opts map[string]any) (any, error) {
transformerOpts := &TransformStringPhoneNumberOpts{}
- if _, ok := opts["preserveLength"].(bool); !ok {
- return nil, fmt.Errorf("missing required argument. function: %s argument: %s", "transformStringPhoneNumber", "preserveLength")
+ preserveLength, ok := opts["preserveLength"].(bool)
+ if !ok {
+ preserveLength = false
}
- preserveLength := opts["preserveLength"].(bool)
transformerOpts.preserveLength = preserveLength
- if _, ok := opts["maxLength"].(int64); !ok {
- return nil, fmt.Errorf("missing required argument. function: %s argument: %s", "transformStringPhoneNumber", "maxLength")
+ maxLength, ok := opts["maxLength"].(int64)
+ if !ok {
+ maxLength = 100
}
- maxLength := opts["maxLength"].(int64)
transformerOpts.maxLength = maxLength
var seedArg *int64
diff --git a/worker/pkg/benthos/transformers/generate_bool.go b/worker/pkg/benthos/transformers/generate_bool.go
index 1ca1fe3b46..c7816fa749 100644
--- a/worker/pkg/benthos/transformers/generate_bool.go
+++ b/worker/pkg/benthos/transformers/generate_bool.go
@@ -3,6 +3,7 @@ package transformers
import (
"fmt"
+ mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
"github.com/warpstreamlabs/bento/public/bloblang"
@@ -36,6 +37,10 @@ func init() {
}
}
+func NewGenerateBoolOptsFromConfig(config *mgmtv1alpha1.GenerateBool) (*GenerateBoolOpts, error) {
+ return NewGenerateBoolOpts(nil)
+}
+
func (t *GenerateBool) Generate(opts any) (any, error) {
parsedOpts, ok := opts.(*GenerateBoolOpts)
if !ok {
diff --git a/worker/pkg/benthos/transformers/generate_card_number.go b/worker/pkg/benthos/transformers/generate_card_number.go
index de77c2c7d3..c1f6e7796a 100644
--- a/worker/pkg/benthos/transformers/generate_card_number.go
+++ b/worker/pkg/benthos/transformers/generate_card_number.go
@@ -4,6 +4,7 @@ import (
"fmt"
"strconv"
+ mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
"github.com/warpstreamlabs/bento/public/bloblang"
@@ -17,7 +18,7 @@ const defaultIIN = 400000
func init() {
spec := bloblang.NewPluginSpec().
Description("Generates a 16 digit card number that is valid by Luhn valid by default.").
- Param(bloblang.NewBoolParam("valid_luhn").Description("A boolean indicating whether the generated value should pass the Luhn algorithm check.")).
+ Param(bloblang.NewBoolParam("valid_luhn").Default(false).Description("A boolean indicating whether the generated value should pass the Luhn algorithm check.")).
Param(bloblang.NewInt64Param("seed").Optional().Description("An optional seed value used to generate deterministic outputs."))
err := bloblang.RegisterFunctionV2("generate_card_number", spec, func(args *bloblang.ParsedParams) (bloblang.Function, error) {
@@ -52,6 +53,13 @@ func init() {
}
}
+func NewGenerateCardNumberOptsFromConfig(config *mgmtv1alpha1.GenerateCardNumber) (*GenerateCardNumberOpts, error) {
+ if config == nil {
+ return NewGenerateCardNumberOpts(nil, nil)
+ }
+ return NewGenerateCardNumberOpts(config.ValidLuhn, nil)
+}
+
func (t *GenerateCardNumber) Generate(opts any) (any, error) {
parsedOpts, ok := opts.(*GenerateCardNumberOpts)
if !ok {
diff --git a/worker/pkg/benthos/transformers/generate_card_number_test.go b/worker/pkg/benthos/transformers/generate_card_number_test.go
index 5ae5b28a77..3172616c96 100644
--- a/worker/pkg/benthos/transformers/generate_card_number_test.go
+++ b/worker/pkg/benthos/transformers/generate_card_number_test.go
@@ -37,6 +37,17 @@ func Test_GenerateCardNumberTransformer(t *testing.T) {
assert.Equal(t, true, isValidLuhn(res.(int64)), "The output card number should pass luhn validation")
}
+func Test_GenerateCardNumberTransformer_NoOptions(t *testing.T) {
+ mapping := `root = generate_card_number()`
+ ex, err := bloblang.Parse(mapping)
+ assert.NoError(t, err, "failed to parse the random int transformer")
+
+ res, err := ex.Query(nil)
+ assert.NoError(t, err)
+
+ assert.Len(t, strconv.FormatInt(res.(int64), 10), 16, "The output card should be 16 characters long")
+}
+
func isValidLuhn(cc int64) bool {
return (cc%10+checksum(cc/10))%10 == 0
}
diff --git a/worker/pkg/benthos/transformers/generate_categorical.go b/worker/pkg/benthos/transformers/generate_categorical.go
index 339cd5fcd8..5e69035d63 100644
--- a/worker/pkg/benthos/transformers/generate_categorical.go
+++ b/worker/pkg/benthos/transformers/generate_categorical.go
@@ -4,6 +4,7 @@ import (
"fmt"
"strings"
+ mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
"github.com/warpstreamlabs/bento/public/bloblang"
@@ -14,7 +15,7 @@ import (
func init() {
spec := bloblang.NewPluginSpec().
Description("Randomly selects a value from a defined set of categorical values.").
- Param(bloblang.NewStringParam("categories").Description("A list of comma-separated string values to randomly select from.")).
+ Param(bloblang.NewStringParam("categories").Default("ultimo,proximo,semper").Description("A list of comma-separated string values to randomly select from.")).
Param(bloblang.NewInt64Param("seed").Optional().Description("An optional seed value used to generate deterministic outputs."))
err := bloblang.RegisterFunctionV2("generate_categorical", spec, func(args *bloblang.ParsedParams) (bloblang.Function, error) {
@@ -46,6 +47,13 @@ func init() {
}
}
+func NewGenerateCategoricalOptsFromConfig(config *mgmtv1alpha1.GenerateCategorical) (*GenerateCategoricalOpts, error) {
+ if config == nil {
+ return NewGenerateCategoricalOpts(nil, nil)
+ }
+ return NewGenerateCategoricalOpts(config.Categories, nil)
+}
+
func (t *GenerateCategorical) Generate(opts any) (any, error) {
parsedOpts, ok := opts.(*GenerateCategoricalOpts)
if !ok {
diff --git a/worker/pkg/benthos/transformers/generate_city.go b/worker/pkg/benthos/transformers/generate_city.go
index 355a42cd0a..120ec4ab67 100644
--- a/worker/pkg/benthos/transformers/generate_city.go
+++ b/worker/pkg/benthos/transformers/generate_city.go
@@ -3,6 +3,7 @@ package transformers
import (
"fmt"
+ mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
transformers_dataset "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/data-sets"
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -14,7 +15,7 @@ import (
func init() {
spec := bloblang.NewPluginSpec().
Description("Randomly selects a city from a list of predefined US cities.").
- Param(bloblang.NewInt64Param("max_length").Description("Specifies the maximum length for the generated data. This field ensures that the output does not exceed a certain number of characters.")).
+ Param(bloblang.NewInt64Param("max_length").Default(100).Description("Specifies the maximum length for the generated data. This field ensures that the output does not exceed a certain number of characters.")).
Param(bloblang.NewInt64Param("seed").Optional().Description("An optional seed value used to generate deterministic outputs."))
err := bloblang.RegisterFunctionV2("generate_city", spec, func(args *bloblang.ParsedParams) (bloblang.Function, error) {
@@ -47,6 +48,18 @@ func init() {
}
}
+func NewGenerateCityOptsFromConfig(config *mgmtv1alpha1.GenerateCity, maxLength *int64) (*GenerateCityOpts, error) {
+ if config == nil {
+ return NewGenerateCityOpts(
+ nil,
+ nil,
+ )
+ }
+ return NewGenerateCityOpts(
+ maxLength, nil,
+ )
+}
+
func (t *GenerateCity) Generate(opts any) (any, error) {
parsedOpts, ok := opts.(*GenerateCityOpts)
if !ok {
diff --git a/worker/pkg/benthos/transformers/generate_city_test.go b/worker/pkg/benthos/transformers/generate_city_test.go
index 5042bb25c6..7a0aae01a8 100644
--- a/worker/pkg/benthos/transformers/generate_city_test.go
+++ b/worker/pkg/benthos/transformers/generate_city_test.go
@@ -40,3 +40,16 @@ func Test_CityTransformer(t *testing.T) {
assert.LessOrEqual(t, int64(len(res.(string))), maxLength, fmt.Sprintf("The city should be less than or equal to the max length. This is the error city:%s", res))
}
+
+func Test_CityTransformer_NoOptions(t *testing.T) {
+ mapping := `root = generate_city()`
+ ex, err := bloblang.Parse(mapping)
+ assert.NoError(t, err, "failed to parse the city transformer")
+
+ res, err := ex.Query(nil)
+ assert.NoError(t, err)
+
+ assert.IsType(t, "", res, "The returned city should be a string")
+
+ assert.NotEmptyf(t, res, fmt.Sprintf("The city should be not be empty. This is the error city:%s", res))
+}
diff --git a/worker/pkg/benthos/transformers/generate_country.go b/worker/pkg/benthos/transformers/generate_country.go
index 12a2fad51c..c409470aed 100644
--- a/worker/pkg/benthos/transformers/generate_country.go
+++ b/worker/pkg/benthos/transformers/generate_country.go
@@ -3,6 +3,7 @@ package transformers
import (
"fmt"
+ mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
transformers_dataset "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/data-sets"
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -41,6 +42,18 @@ func init() {
}
}
+func NewGenerateCountryOptsFromConfig(config *mgmtv1alpha1.GenerateCountry) (*GenerateCountryOpts, error) {
+ if config == nil {
+ return NewGenerateCountryOpts(
+ nil,
+ nil,
+ )
+ }
+ return NewGenerateCountryOpts(
+ config.GenerateFullName, nil,
+ )
+}
+
func (t *GenerateCountry) Generate(opts any) (any, error) {
parsedOpts, ok := opts.(*GenerateCountryOpts)
if !ok {
diff --git a/worker/pkg/benthos/transformers/generate_country_test.go b/worker/pkg/benthos/transformers/generate_country_test.go
index 6e6f39fdfd..9cc536d5b4 100644
--- a/worker/pkg/benthos/transformers/generate_country_test.go
+++ b/worker/pkg/benthos/transformers/generate_country_test.go
@@ -81,3 +81,25 @@ func Test_CountryTransformer(t *testing.T) {
assert.Len(t, res, 2)
assert.True(t, countryExists, "The generated country should exist in the countrys.go file")
}
+
+func Test_CountryTransformer_NoOptions(t *testing.T) {
+ mapping := `root = generate_country()`
+ ex, err := bloblang.Parse(mapping)
+ assert.NoError(t, err, "failed to parse the country transformer")
+
+ res, err := ex.Query(nil)
+ assert.NoError(t, err)
+
+ assert.IsType(t, Address{}.City, res, "The returned country should be a string")
+
+ countryExists := false
+ for _, country := range transformers_dataset.Countries {
+ if country.Code == res {
+ countryExists = true
+ break
+ }
+ }
+
+ assert.Len(t, res, 2)
+ assert.True(t, countryExists, "The generated country should exist in the countrys.go file")
+}
diff --git a/worker/pkg/benthos/transformers/generate_email.go b/worker/pkg/benthos/transformers/generate_email.go
index c3fa8056c7..5b1670fc99 100644
--- a/worker/pkg/benthos/transformers/generate_email.go
+++ b/worker/pkg/benthos/transformers/generate_email.go
@@ -6,6 +6,7 @@ import (
"strings"
"github.com/google/uuid"
+ mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
transformers_dataset "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/data-sets"
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -75,6 +76,21 @@ func init() {
}
}
+func NewGenerateEmailOptsFromConfig(config *mgmtv1alpha1.GenerateEmail, maxLength *int64) (*GenerateEmailOpts, error) {
+ if config == nil {
+ return NewGenerateEmailOpts(nil, nil, nil)
+ }
+ var emailType *string
+ if config.EmailType != nil {
+ emailTypeStr := dtoEmailTypeToTransformerEmailType(config.GetEmailType()).String()
+ emailType = &emailTypeStr
+ }
+ return NewGenerateEmailOpts(
+ maxLength,
+ emailType, nil,
+ )
+}
+
func (t *GenerateEmail) Generate(opts any) (any, error) {
parsedOpts, ok := opts.(*GenerateEmailOpts)
if !ok {
diff --git a/worker/pkg/benthos/transformers/generate_email_test.go b/worker/pkg/benthos/transformers/generate_email_test.go
index 22910d29c5..7608f7ef4c 100644
--- a/worker/pkg/benthos/transformers/generate_email_test.go
+++ b/worker/pkg/benthos/transformers/generate_email_test.go
@@ -73,3 +73,20 @@ func Test_RandomEmailTransformer(t *testing.T) {
require.Equal(t, true, transformer_utils.IsValidEmail(res.(string)), "The expected email should have a valid email format")
}
+
+func Test_RandomEmailTransformer_NoOptions(t *testing.T) {
+ mapping := `root = generate_email()`
+ ex, err := bloblang.Parse(mapping)
+ require.NoError(t, err)
+ require.NotEmpty(t, ex)
+
+ res, err := ex.Query(nil)
+ require.NoError(t, err)
+ require.NotEmpty(t, res)
+
+ resStr, ok := res.(string)
+ require.True(t, ok)
+ require.NotEmpty(t, resStr)
+
+ require.NotEmptyf(t, resStr, fmt.Sprintf("The email should be less than or equal to the max length. This is the error email:%s", res))
+}
diff --git a/worker/pkg/benthos/transformers/generate_first_name.go b/worker/pkg/benthos/transformers/generate_first_name.go
index 3bf4c7aac4..910f44184c 100644
--- a/worker/pkg/benthos/transformers/generate_first_name.go
+++ b/worker/pkg/benthos/transformers/generate_first_name.go
@@ -3,6 +3,7 @@ package transformers
import (
"fmt"
+ mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
transformers_dataset "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/data-sets"
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -14,7 +15,7 @@ import (
func init() {
spec := bloblang.NewPluginSpec().
Description("Generates a random first name between 2 and 12 characters long.").
- Param(bloblang.NewInt64Param("max_length").Default(10000).Description("Specifies the maximum length for the generated data. This field ensures that the output does not exceed a certain number of characters.")).
+ Param(bloblang.NewInt64Param("max_length").Default(100).Description("Specifies the maximum length for the generated data. This field ensures that the output does not exceed a certain number of characters.")).
Param(bloblang.NewInt64Param("seed").Optional().Description("An optional seed value used to generate deterministic outputs."))
err := bloblang.RegisterFunctionV2("generate_first_name", spec, func(args *bloblang.ParsedParams) (bloblang.Function, error) {
@@ -47,6 +48,15 @@ func init() {
}
}
+func NewGenerateFirstNameOptsFromConfig(config *mgmtv1alpha1.GenerateFirstName, maxLength *int64) (*GenerateFirstNameOpts, error) {
+ if config == nil {
+ return NewGenerateFirstNameOpts(nil, nil)
+ }
+ return NewGenerateFirstNameOpts(
+ maxLength, nil,
+ )
+}
+
func (t *GenerateFirstName) Generate(opts any) (any, error) {
parsedOpts, ok := opts.(*GenerateFirstNameOpts)
if !ok {
diff --git a/worker/pkg/benthos/transformers/generate_first_name_test.go b/worker/pkg/benthos/transformers/generate_first_name_test.go
index d5d771eb21..115b914fd7 100644
--- a/worker/pkg/benthos/transformers/generate_first_name_test.go
+++ b/worker/pkg/benthos/transformers/generate_first_name_test.go
@@ -56,3 +56,18 @@ func Test_GenerateRandomFirstNameTransformer(t *testing.T) {
assert.NotEmpty(t, resStr)
assert.LessOrEqual(t, int64(len(resStr)), maxCharacterLimit, "output should be less than or equal to max char limit")
}
+
+func Test_GenerateRandomFirstNameTransformer_NoOptions(t *testing.T) {
+ mapping := `root = generate_first_name()`
+ ex, err := bloblang.Parse(mapping)
+ assert.NoError(t, err, "failed to parse the first name transformer")
+ assert.NotNil(t, ex)
+
+ res, err := ex.Query(nil)
+ assert.NoError(t, err)
+
+ resStr, ok := res.(string)
+ require.True(t, ok)
+
+ assert.NotEmpty(t, resStr)
+}
diff --git a/worker/pkg/benthos/transformers/generate_float.go b/worker/pkg/benthos/transformers/generate_float.go
index c4e5df7466..d1e348bf88 100644
--- a/worker/pkg/benthos/transformers/generate_float.go
+++ b/worker/pkg/benthos/transformers/generate_float.go
@@ -6,6 +6,7 @@ import (
"strconv"
"strings"
+ mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
"github.com/warpstreamlabs/bento/public/bloblang"
@@ -17,8 +18,8 @@ func init() {
spec := bloblang.NewPluginSpec().
Description("Generates a random floating point number with a max precision of 17. Go float64 adheres to the IEEE 754 standard for double-precision floating-point numbers.").
Param(bloblang.NewBoolParam("randomize_sign").Default(false).Description("A boolean indicating whether the sign of the float should be randomized.")).
- Param(bloblang.NewFloat64Param("min").Description("Specifies the minimum value for the generated float.")).
- Param(bloblang.NewFloat64Param("max").Description("Specifies the maximum value for the generated float")).
+ Param(bloblang.NewFloat64Param("min").Default(1).Description("Specifies the minimum value for the generated float.")).
+ Param(bloblang.NewFloat64Param("max").Default(10000).Description("Specifies the maximum value for the generated float")).
Param(bloblang.NewInt64Param("precision").Optional().Description("An optional parameter that defines the number of significant digits for the generated float.")).
Param(bloblang.NewInt64Param("scale").Optional().Description("An optional parameter that defines the number of decimal places for the generated float.")).
Param(bloblang.NewInt64Param("seed").Optional().Description("An optional seed value used to generate deterministic outputs."))
@@ -72,6 +73,20 @@ func init() {
}
}
+func NewGenerateFloat64OptsFromConfig(config *mgmtv1alpha1.GenerateFloat64, scale *int64) (*GenerateFloat64Opts, error) {
+ if config == nil {
+ return NewGenerateFloat64Opts(nil, nil, nil, nil, nil, nil)
+ }
+ return NewGenerateFloat64Opts(
+ config.RandomizeSign,
+ config.Min,
+ config.Max,
+ config.Precision,
+ nil,
+ nil,
+ )
+}
+
func (t *GenerateFloat64) Generate(opts any) (any, error) {
parsedOpts, ok := opts.(*GenerateFloat64Opts)
if !ok {
diff --git a/worker/pkg/benthos/transformers/generate_float_test.go b/worker/pkg/benthos/transformers/generate_float_test.go
index 69bdec4f94..6a2fb78110 100644
--- a/worker/pkg/benthos/transformers/generate_float_test.go
+++ b/worker/pkg/benthos/transformers/generate_float_test.go
@@ -91,3 +91,13 @@ func Test_GenerateRandomFloat_Benthos(t *testing.T) {
assert.GreaterOrEqual(t, res.(float64), minValue, "The result should be greater or equal to the minimum")
assert.LessOrEqual(t, res.(float64), maxValue, "The result should be less or equal to the maximum")
}
+
+func Test_GenerateRandomFloat_Benthos_NoOptions(t *testing.T) {
+ mapping := `root = generate_float64()`
+ ex, err := bloblang.Parse(mapping)
+ assert.NoError(t, err, "failed to parse the generate float transformer")
+
+ res, err := ex.Query(nil)
+ assert.NoError(t, err)
+ assert.NotEmpty(t, res)
+}
diff --git a/worker/pkg/benthos/transformers/generate_full_address.go b/worker/pkg/benthos/transformers/generate_full_address.go
index a5805109fa..d773cff6b2 100644
--- a/worker/pkg/benthos/transformers/generate_full_address.go
+++ b/worker/pkg/benthos/transformers/generate_full_address.go
@@ -3,6 +3,7 @@ package transformers
import (
"fmt"
+ mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
transformers_dataset "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/data-sets"
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -14,7 +15,7 @@ import (
func init() {
spec := bloblang.NewPluginSpec().
Description("Generates a randomly selected real full address that exists in the United States.").
- Param(bloblang.NewInt64Param("max_length").Description("Specifies the maximum length for the generated data. This field ensures that the output does not exceed a certain number of characters.")).
+ Param(bloblang.NewInt64Param("max_length").Default(100).Description("Specifies the maximum length for the generated data. This field ensures that the output does not exceed a certain number of characters.")).
Param(bloblang.NewInt64Param("seed").Optional().Description("An optional seed value used to generate deterministic outputs."))
err := bloblang.RegisterFunctionV2("generate_full_address", spec, func(args *bloblang.ParsedParams) (bloblang.Function, error) {
@@ -47,6 +48,18 @@ func init() {
}
}
+func NewGenerateFullAddressOptsFromConfig(config *mgmtv1alpha1.GenerateFullAddress, maxLength *int64) (*GenerateFullAddressOpts, error) {
+ if config == nil {
+ return NewGenerateFullAddressOpts(
+ nil,
+ nil,
+ )
+ }
+ return NewGenerateFullAddressOpts(
+ maxLength, nil,
+ )
+}
+
func (t *GenerateFullAddress) Generate(opts any) (any, error) {
parsedOpts, ok := opts.(*GenerateFullAddressOpts)
if !ok {
diff --git a/worker/pkg/benthos/transformers/generate_full_address_test.go b/worker/pkg/benthos/transformers/generate_full_address_test.go
index 46baad5e76..88b98ca3d2 100644
--- a/worker/pkg/benthos/transformers/generate_full_address_test.go
+++ b/worker/pkg/benthos/transformers/generate_full_address_test.go
@@ -51,3 +51,13 @@ func Test_FullAddressTransformer(t *testing.T) {
assert.IsType(t, "", res, "The returned full address should be a string")
assert.LessOrEqual(t, int64(len(res.(string))), faMaxLength, fmt.Sprintf("The city should be less than or equal to the max length. This is the error address:%s", res))
}
+
+func Test_FullAddressTransformer_NoOptions(t *testing.T) {
+ mapping := `root = generate_full_address()`
+ ex, err := bloblang.Parse(mapping)
+ assert.NoError(t, err, "failed to parse the full address transformer")
+
+ res, err := ex.Query(nil)
+ assert.NoError(t, err)
+ assert.NotEmpty(t, res)
+}
diff --git a/worker/pkg/benthos/transformers/generate_full_name.go b/worker/pkg/benthos/transformers/generate_full_name.go
index f1adcac246..9541d1d2db 100644
--- a/worker/pkg/benthos/transformers/generate_full_name.go
+++ b/worker/pkg/benthos/transformers/generate_full_name.go
@@ -3,6 +3,7 @@ package transformers
import (
"fmt"
+ mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
transformers_dataset "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/data-sets"
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -14,7 +15,7 @@ import (
func init() {
spec := bloblang.NewPluginSpec().
Description("Generates a new full name consisting of a first and last name.").
- Param(bloblang.NewInt64Param("max_length").Default(10000).Description("Specifies the maximum length for the generated data. This field ensures that the output does not exceed a certain number of characters.")).
+ Param(bloblang.NewInt64Param("max_length").Default(100).Description("Specifies the maximum length for the generated data. This field ensures that the output does not exceed a certain number of characters.")).
Param(bloblang.NewInt64Param("seed").Optional().Description("An optional seed value used to generate deterministic outputs."))
err := bloblang.RegisterFunctionV2("generate_full_name", spec, func(args *bloblang.ParsedParams) (bloblang.Function, error) {
@@ -47,6 +48,18 @@ func init() {
}
}
+func NewGenerateFullNameOptsFromConfig(config *mgmtv1alpha1.GenerateFullName, maxLength *int64) (*GenerateFullNameOpts, error) {
+ if config == nil {
+ return NewGenerateFullNameOpts(
+ nil,
+ nil,
+ )
+ }
+ return NewGenerateFullNameOpts(
+ maxLength, nil,
+ )
+}
+
func (t *GenerateFullName) Generate(opts any) (any, error) {
parsedOpts, ok := opts.(*GenerateFullNameOpts)
if !ok {
diff --git a/worker/pkg/benthos/transformers/generate_full_name_test.go b/worker/pkg/benthos/transformers/generate_full_name_test.go
index 5c63a3b860..33db84648f 100644
--- a/worker/pkg/benthos/transformers/generate_full_name_test.go
+++ b/worker/pkg/benthos/transformers/generate_full_name_test.go
@@ -55,3 +55,14 @@ func Test_GenerateRandomFullNameTransformer(t *testing.T) {
assert.NotEmpty(t, resStr)
assert.LessOrEqual(t, int64(len(resStr)), maxCharacterLimit, "output should be less than or equal to max char limit")
}
+
+func Test_GenerateRandomFullNameTransformer_NoOptions(t *testing.T) {
+ mapping := `root = generate_full_name()`
+ ex, err := bloblang.Parse(mapping)
+ assert.NoError(t, err, "failed to parse the first name transformer")
+ assert.NotNil(t, ex)
+
+ res, err := ex.Query(nil)
+ assert.NoError(t, err)
+ assert.NotEmpty(t, res)
+}
diff --git a/worker/pkg/benthos/transformers/generate_gender.go b/worker/pkg/benthos/transformers/generate_gender.go
index f8b89e9a28..2c6010aadc 100644
--- a/worker/pkg/benthos/transformers/generate_gender.go
+++ b/worker/pkg/benthos/transformers/generate_gender.go
@@ -3,6 +3,7 @@ package transformers
import (
"fmt"
+ mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
"github.com/warpstreamlabs/bento/public/bloblang"
@@ -14,7 +15,7 @@ func init() {
spec := bloblang.NewPluginSpec().
Description("Randomly generates one of the following genders: female (f), male (m), undefined (u), nonbinary (n).").
Param(bloblang.NewBoolParam("abbreviate").Default(false).Description("Shortens length of generated value to 1.")).
- Param(bloblang.NewInt64Param("max_length").Default(10000).Description("Specifies the maximum length for the generated data. This field ensures that the output does not exceed a certain number of characters.")).
+ Param(bloblang.NewInt64Param("max_length").Default(100).Description("Specifies the maximum length for the generated data. This field ensures that the output does not exceed a certain number of characters.")).
Param(bloblang.NewInt64Param("seed").Optional().Description("An optional seed value used to generate deterministic outputs."))
err := bloblang.RegisterFunctionV2("generate_gender", spec, func(args *bloblang.ParsedParams) (bloblang.Function, error) {
@@ -49,6 +50,20 @@ func init() {
}
}
+func NewGenerateGenderOptsFromConfig(config *mgmtv1alpha1.GenerateGender, maxLength *int64) (*GenerateGenderOpts, error) {
+ if config == nil {
+ return NewGenerateGenderOpts(
+ nil,
+ nil,
+ nil,
+ )
+ }
+ return NewGenerateGenderOpts(
+ config.Abbreviate,
+ maxLength, nil,
+ )
+}
+
func (t *GenerateGender) Generate(opts any) (any, error) {
parsedOpts, ok := opts.(*GenerateGenderOpts)
if !ok {
diff --git a/worker/pkg/benthos/transformers/generate_gender_test.go b/worker/pkg/benthos/transformers/generate_gender_test.go
index 74c7735b61..5425ec9bb6 100644
--- a/worker/pkg/benthos/transformers/generate_gender_test.go
+++ b/worker/pkg/benthos/transformers/generate_gender_test.go
@@ -42,3 +42,13 @@ func Test_GenderTransformer(t *testing.T) {
assert.Contains(t, valid, res, "Gender should be one of female, male, undefined, nonbinary")
assert.Equal(t, int64(len(res.(string))), int64(1), "the length should be 1")
}
+
+func Test_GenderTransformer_NoOptions(t *testing.T) {
+ mapping := `root = generate_gender()`
+ ex, err := bloblang.Parse(mapping)
+ assert.NoError(t, err, "failed to parse the gender transformer")
+
+ res, err := ex.Query(nil)
+ assert.NoError(t, err)
+ assert.NotEmpty(t, res)
+}
diff --git a/worker/pkg/benthos/transformers/generate_int64.go b/worker/pkg/benthos/transformers/generate_int64.go
index 7b3943b1b5..31b0451c40 100644
--- a/worker/pkg/benthos/transformers/generate_int64.go
+++ b/worker/pkg/benthos/transformers/generate_int64.go
@@ -3,6 +3,7 @@ package transformers
import (
"fmt"
+ mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
"github.com/warpstreamlabs/bento/public/bloblang"
@@ -30,8 +31,8 @@ func init() {
spec := bloblang.NewPluginSpec().
Description("Generates a random int64 value with a default length of 4.").
Param(bloblang.NewBoolParam("randomize_sign").Default(false).Description("A boolean indicating whether the sign of the float should be randomized.")).
- Param(bloblang.NewInt64Param("min").Description("Specifies the minimum value for the generated int.")).
- Param(bloblang.NewInt64Param("max").Description("Specifies the maximum value for the generated int.")).
+ Param(bloblang.NewInt64Param("min").Default(1).Description("Specifies the minimum value for the generated int.")).
+ Param(bloblang.NewInt64Param("max").Default(10000).Description("Specifies the maximum value for the generated int.")).
Param(bloblang.NewInt64Param("seed").Optional().Description("An optional seed value used to generate deterministic outputs."))
err := bloblang.RegisterFunctionV2("generate_int64", spec, func(args *bloblang.ParsedParams) (bloblang.Function, error) {
@@ -76,6 +77,22 @@ func init() {
}
}
+func NewGenerateInt64OptsFromConfig(config *mgmtv1alpha1.GenerateInt64) (*GenerateInt64Opts, error) {
+ if config == nil {
+ return NewGenerateInt64Opts(
+ nil,
+ nil,
+ nil,
+ nil,
+ )
+ }
+ return NewGenerateInt64Opts(
+ config.RandomizeSign,
+ config.Min,
+ config.Max, nil,
+ )
+}
+
func (t *GenerateInt64) Generate(opts any) (any, error) {
parsedOpts, ok := opts.(*GenerateInt64Opts)
if !ok {
diff --git a/worker/pkg/benthos/transformers/generate_int64_phone_number.go b/worker/pkg/benthos/transformers/generate_int64_phone_number.go
index 688ac3a10c..2e4dc359ee 100644
--- a/worker/pkg/benthos/transformers/generate_int64_phone_number.go
+++ b/worker/pkg/benthos/transformers/generate_int64_phone_number.go
@@ -3,6 +3,7 @@ package transformers
import (
"fmt"
+ mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
transformers_dataset "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/data-sets"
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -44,6 +45,10 @@ func init() {
}
}
+func NewGenerateInt64PhoneNumberOptsFromConfig(config *mgmtv1alpha1.GenerateInt64PhoneNumber) (*GenerateInt64PhoneNumberOpts, error) {
+ return NewGenerateInt64PhoneNumberOpts(nil)
+}
+
func (t *GenerateInt64PhoneNumber) Generate(opts any) (any, error) {
parsedOpts, ok := opts.(*GenerateInt64PhoneNumberOpts)
if !ok {
diff --git a/worker/pkg/benthos/transformers/generate_int64_test.go b/worker/pkg/benthos/transformers/generate_int64_test.go
index 0675811e79..192cf7922e 100644
--- a/worker/pkg/benthos/transformers/generate_int64_test.go
+++ b/worker/pkg/benthos/transformers/generate_int64_test.go
@@ -82,3 +82,13 @@ func Test_GenerateRandomInt_Benthos(t *testing.T) {
assert.GreaterOrEqual(t, res, minValue, "The result should be greater or equal to the minimum")
assert.LessOrEqual(t, res, maxValue, "The result should be less or equal to the maximum")
}
+
+func Test_GenerateRandomInt_Benthos_NoOptions(t *testing.T) {
+ mapping := `root = generate_int64()`
+ ex, err := bloblang.Parse(mapping)
+ assert.NoError(t, err, "failed to parse the random int transformer")
+
+ res, err := ex.Query(nil)
+ assert.NoError(t, err)
+ assert.NotEmpty(t, res)
+}
diff --git a/worker/pkg/benthos/transformers/generate_international_phone_number.go b/worker/pkg/benthos/transformers/generate_international_phone_number.go
index aba30b98a2..f10a4a8c62 100644
--- a/worker/pkg/benthos/transformers/generate_international_phone_number.go
+++ b/worker/pkg/benthos/transformers/generate_international_phone_number.go
@@ -5,6 +5,7 @@ import (
"fmt"
"strings"
+ mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
"github.com/warpstreamlabs/bento/public/bloblang"
@@ -15,8 +16,8 @@ import (
func init() {
spec := bloblang.NewPluginSpec().
Description("Generates a new random international phone number including the + sign and no hyphens.").
- Param(bloblang.NewInt64Param("min").Description("Specifies the minimum value for the generated phone number.")).
- Param(bloblang.NewInt64Param("max").Description("Specifies the maximum value for the generated phone number.")).
+ Param(bloblang.NewInt64Param("min").Default(9).Description("Specifies the minimum value for the generated phone number.")).
+ Param(bloblang.NewInt64Param("max").Default(15).Description("Specifies the maximum value for the generated phone number.")).
Param(bloblang.NewInt64Param("seed").Optional().Description("An optional seed value used to generate deterministic outputs."))
err := bloblang.RegisterFunctionV2("generate_e164_phone_number", spec, func(args *bloblang.ParsedParams) (bloblang.Function, error) {
@@ -56,6 +57,21 @@ func init() {
}
}
+func NewGenerateInternationalPhoneNumberOptsFromConfig(config *mgmtv1alpha1.GenerateE164PhoneNumber) (*GenerateInternationalPhoneNumberOpts, error) {
+ if config == nil {
+ return NewGenerateInternationalPhoneNumberOpts(
+ nil,
+ nil,
+ nil,
+ )
+ }
+ return NewGenerateInternationalPhoneNumberOpts(
+ config.Min,
+ config.Max,
+ nil,
+ )
+}
+
func (t *GenerateInternationalPhoneNumber) Generate(opts any) (any, error) {
parsedOpts, ok := opts.(*GenerateInternationalPhoneNumberOpts)
if !ok {
diff --git a/worker/pkg/benthos/transformers/generate_international_phone_number_test.go b/worker/pkg/benthos/transformers/generate_international_phone_number_test.go
index b4e76d5e5e..67de222bda 100644
--- a/worker/pkg/benthos/transformers/generate_international_phone_number_test.go
+++ b/worker/pkg/benthos/transformers/generate_international_phone_number_test.go
@@ -48,6 +48,16 @@ func Test_GenerateInternationalPhoneNumberTransformer(t *testing.T) {
assert.LessOrEqual(t, len(res.(string)), 15+1, "Should be less than 16 characters in length. 15 for the number and 1 for the plus sign.")
}
+func Test_GenerateInternationalPhoneNumberTransformer_NoOptions(t *testing.T) {
+ mapping := `root = generate_e164_phone_number()`
+ ex, err := bloblang.Parse(mapping)
+ assert.NoError(t, err, "failed to parse the international phone number transformer")
+
+ res, err := ex.Query(nil)
+ assert.NoError(t, err)
+ assert.NotEmpty(t, res)
+}
+
func Test_ValidateE164True(t *testing.T) {
val := "+6272636472"
diff --git a/worker/pkg/benthos/transformers/generate_last_name.go b/worker/pkg/benthos/transformers/generate_last_name.go
index 68b8c31327..a971ffd74d 100644
--- a/worker/pkg/benthos/transformers/generate_last_name.go
+++ b/worker/pkg/benthos/transformers/generate_last_name.go
@@ -3,6 +3,7 @@ package transformers
import (
"fmt"
+ mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
transformers_dataset "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/data-sets"
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -14,7 +15,7 @@ import (
func init() {
spec := bloblang.NewPluginSpec().
Description("Generates a random last name.").
- Param(bloblang.NewInt64Param("max_length").Default(10000).Description("Specifies the maximum length for the generated data. This field ensures that the output does not exceed a certain number of characters.")).
+ Param(bloblang.NewInt64Param("max_length").Default(100).Description("Specifies the maximum length for the generated data. This field ensures that the output does not exceed a certain number of characters.")).
Param(bloblang.NewInt64Param("seed").Optional().Description("An optional seed value used to generate deterministic outputs."))
err := bloblang.RegisterFunctionV2("generate_last_name", spec, func(args *bloblang.ParsedParams) (bloblang.Function, error) {
@@ -47,6 +48,18 @@ func init() {
}
}
+func NewGenerateLastNameOptsFromConfig(config *mgmtv1alpha1.GenerateLastName, maxLength *int64) (*GenerateLastNameOpts, error) {
+ if config == nil {
+ return NewGenerateLastNameOpts(
+ nil,
+ nil,
+ )
+ }
+ return NewGenerateLastNameOpts(
+ maxLength, nil,
+ )
+}
+
func (t *GenerateLastName) Generate(opts any) (any, error) {
parsedOpts, ok := opts.(*GenerateLastNameOpts)
if !ok {
diff --git a/worker/pkg/benthos/transformers/generate_last_name_test.go b/worker/pkg/benthos/transformers/generate_last_name_test.go
index 25421cbb1c..384c345889 100644
--- a/worker/pkg/benthos/transformers/generate_last_name_test.go
+++ b/worker/pkg/benthos/transformers/generate_last_name_test.go
@@ -56,3 +56,14 @@ func Test_GenerateRandomLastNameTransformer(t *testing.T) {
assert.NotEmpty(t, resStr)
assert.LessOrEqual(t, int64(len(resStr)), maxCharacterLimit, "The last name should be less than or equal to max char limit")
}
+
+func Test_GenerateRandomLastNameTransformer_NoOptions(t *testing.T) {
+ mapping := `root = generate_last_name()`
+ ex, err := bloblang.Parse(mapping)
+ assert.NoError(t, err, "failed to parse the last name transformer")
+ assert.NotNil(t, ex)
+
+ res, err := ex.Query(nil)
+ assert.NoError(t, err)
+ assert.NotEmpty(t, res)
+}
diff --git a/worker/pkg/benthos/transformers/generate_random_string.go b/worker/pkg/benthos/transformers/generate_random_string.go
index 89d462ea00..4f0a4cca0b 100644
--- a/worker/pkg/benthos/transformers/generate_random_string.go
+++ b/worker/pkg/benthos/transformers/generate_random_string.go
@@ -3,6 +3,7 @@ package transformers
import (
"fmt"
+ mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
"github.com/warpstreamlabs/bento/public/bloblang"
@@ -13,8 +14,8 @@ import (
func init() {
spec := bloblang.NewPluginSpec().
Description("Generates a random string of alphanumeric characters..").
- Param(bloblang.NewInt64Param("min").Description("Specifies the minimum length for the generated string.")).
- Param(bloblang.NewInt64Param("max").Description("Specifies the maximum length for the generated string.")).
+ Param(bloblang.NewInt64Param("min").Default(1).Description("Specifies the minimum length for the generated string.")).
+ Param(bloblang.NewInt64Param("max").Default(100).Description("Specifies the maximum length for the generated string.")).
Param(bloblang.NewInt64Param("seed").Optional().Description("An optional seed value used to generate deterministic outputs."))
err := bloblang.RegisterFunctionV2("generate_string", spec, func(args *bloblang.ParsedParams) (bloblang.Function, error) {
@@ -54,6 +55,36 @@ func init() {
}
}
+func NewGenerateRandomStringOptsFromConfig(config *mgmtv1alpha1.GenerateString, maxLen *int64) (*GenerateRandomStringOpts, error) {
+ if config == nil {
+ return NewGenerateRandomStringOpts(
+ nil,
+ maxLen,
+ nil,
+ )
+ }
+ minValue := config.Min
+ maxValue := config.Max
+ if maxLen != nil {
+ if maxValue == nil {
+ maxValue = maxLen
+ } else {
+ newMax := transformer_utils.Ceil(*maxValue, *maxLen)
+ maxValue = &newMax
+ }
+ }
+ if minValue != nil {
+ newMin := transformer_utils.MinInt(*minValue, *maxValue) // ensure the min is not larger than the max allowed length
+ minValue = &newMin
+ }
+
+ return NewGenerateRandomStringOpts(
+ minValue,
+ maxValue,
+ nil,
+ )
+}
+
func (t *GenerateRandomString) Generate(opts any) (any, error) {
parsedOpts, ok := opts.(*GenerateRandomStringOpts)
if !ok {
diff --git a/worker/pkg/benthos/transformers/generate_random_string_test.go b/worker/pkg/benthos/transformers/generate_random_string_test.go
index c1957519df..831a6a20dd 100644
--- a/worker/pkg/benthos/transformers/generate_random_string_test.go
+++ b/worker/pkg/benthos/transformers/generate_random_string_test.go
@@ -23,3 +23,13 @@ func Test_GenerateRandomStringTransformerWithValue(t *testing.T) {
assert.GreaterOrEqual(t, int64(len(res.(string))), minValue, "The output string should be greater than or equal to the min")
assert.LessOrEqual(t, int64(len(res.(string))), maxValue, "The output string should be less than or equal to the max")
}
+
+func Test_GenerateRandomStringTransformer_NoOptions(t *testing.T) {
+ mapping := `root = generate_string()`
+ ex, err := bloblang.Parse(mapping)
+ assert.NoError(t, err, "failed to parse the generate random string transformer")
+
+ res, err := ex.Query(nil)
+ assert.NoError(t, err)
+ assert.NotEmpty(t, res)
+}
diff --git a/worker/pkg/benthos/transformers/generate_sha256hash.go b/worker/pkg/benthos/transformers/generate_sha256hash.go
index 640af643e5..8123c2db37 100644
--- a/worker/pkg/benthos/transformers/generate_sha256hash.go
+++ b/worker/pkg/benthos/transformers/generate_sha256hash.go
@@ -6,6 +6,7 @@ import (
"fmt"
"github.com/google/uuid"
+ mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
"github.com/warpstreamlabs/bento/public/bloblang"
)
@@ -28,6 +29,10 @@ func init() {
}
}
+func NewGenerateSHA256HashOptsFromConfig(config *mgmtv1alpha1.GenerateSha256Hash) (*GenerateSHA256HashOpts, error) {
+ return NewGenerateSHA256HashOpts()
+}
+
func (t *GenerateSHA256Hash) Generate(opts any) (any, error) {
return generateRandomSHA256Hash(uuid.NewString())
}
diff --git a/worker/pkg/benthos/transformers/generate_ssn.go b/worker/pkg/benthos/transformers/generate_ssn.go
index 25ef097699..9eb9eb70b5 100644
--- a/worker/pkg/benthos/transformers/generate_ssn.go
+++ b/worker/pkg/benthos/transformers/generate_ssn.go
@@ -3,6 +3,7 @@ package transformers
import (
"fmt"
+ mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
"github.com/warpstreamlabs/bento/public/bloblang"
@@ -36,6 +37,10 @@ func init() {
}
}
+func NewGenerateSSNOptsFromConfig(config *mgmtv1alpha1.GenerateSSN) (*GenerateSSNOpts, error) {
+ return NewGenerateSSNOpts(nil)
+}
+
func (t *GenerateSSN) Generate(opts any) (any, error) {
parsedOpts, ok := opts.(*GenerateSSNOpts)
if !ok {
diff --git a/worker/pkg/benthos/transformers/generate_state.go b/worker/pkg/benthos/transformers/generate_state.go
index 214582057e..23537597c0 100644
--- a/worker/pkg/benthos/transformers/generate_state.go
+++ b/worker/pkg/benthos/transformers/generate_state.go
@@ -3,6 +3,7 @@ package transformers
import (
"fmt"
+ mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
transformers_dataset "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/data-sets"
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -41,6 +42,13 @@ func init() {
}
}
+func NewGenerateStateOptsFromConfig(config *mgmtv1alpha1.GenerateState) (*GenerateStateOpts, error) {
+ if config == nil {
+ return NewGenerateStateOpts(nil, nil)
+ }
+ return NewGenerateStateOpts(config.GenerateFullName, nil)
+}
+
func (t *GenerateState) Generate(opts any) (any, error) {
parsedOpts, ok := opts.(*GenerateStateOpts)
if !ok {
diff --git a/worker/pkg/benthos/transformers/generate_state_test.go b/worker/pkg/benthos/transformers/generate_state_test.go
index 472422beca..1fe4fb9ca5 100644
--- a/worker/pkg/benthos/transformers/generate_state_test.go
+++ b/worker/pkg/benthos/transformers/generate_state_test.go
@@ -81,3 +81,13 @@ func Test_StateTransformer(t *testing.T) {
assert.Len(t, res, 2)
assert.True(t, stateExists, "The generated state should exist in the states.go file")
}
+
+func Test_StateTransformer_NoOptions(t *testing.T) {
+ mapping := `root = generate_state()`
+ ex, err := bloblang.Parse(mapping)
+ assert.NoError(t, err, "failed to parse the state transformer")
+
+ res, err := ex.Query(nil)
+ assert.NoError(t, err)
+ assert.NotEmpty(t, res)
+}
diff --git a/worker/pkg/benthos/transformers/generate_street_address.go b/worker/pkg/benthos/transformers/generate_street_address.go
index 6d3f48d38c..6edd3c0469 100644
--- a/worker/pkg/benthos/transformers/generate_street_address.go
+++ b/worker/pkg/benthos/transformers/generate_street_address.go
@@ -3,6 +3,7 @@ package transformers
import (
"fmt"
+ mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
transformers_dataset "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/data-sets"
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -22,7 +23,7 @@ type Address struct {
func init() {
spec := bloblang.NewPluginSpec().
Description("Randomly generates a street address.").
- Param(bloblang.NewInt64Param("max_length").Description("Specifies the maximum length for the generated data. This field ensures that the output does not exceed a certain number of characters.")).
+ Param(bloblang.NewInt64Param("max_length").Default(100).Description("Specifies the maximum length for the generated data. This field ensures that the output does not exceed a certain number of characters.")).
Param(bloblang.NewInt64Param("seed").Optional().Description("An optional seed value used to generate deterministic outputs."))
err := bloblang.RegisterFunctionV2("generate_street_address", spec, func(args *bloblang.ParsedParams) (bloblang.Function, error) {
@@ -55,6 +56,15 @@ func init() {
}
}
+func NewGenerateStreetAddressOptsFromConfig(config *mgmtv1alpha1.GenerateStreetAddress, maxLength *int64) (*GenerateStreetAddressOpts, error) {
+ if config == nil {
+ return NewGenerateStreetAddressOpts(nil, nil)
+ }
+ return NewGenerateStreetAddressOpts(
+ maxLength, nil,
+ )
+}
+
func (t *GenerateStreetAddress) Generate(opts any) (any, error) {
parsedOpts, ok := opts.(*GenerateStreetAddressOpts)
if !ok {
diff --git a/worker/pkg/benthos/transformers/generate_street_address_test.go b/worker/pkg/benthos/transformers/generate_street_address_test.go
index f37934f002..b557ad772a 100644
--- a/worker/pkg/benthos/transformers/generate_street_address_test.go
+++ b/worker/pkg/benthos/transformers/generate_street_address_test.go
@@ -48,3 +48,13 @@ func Test_StreetAddressTransformer(t *testing.T) {
assert.IsType(t, Address{}.Address1, res, "The returned street address should be a string")
assert.LessOrEqual(t, int64(len(res.(string))), maxLength, fmt.Sprintf("The city should be less than or equal to the max length. This is the error street address:%s", res))
}
+
+func Test_StreetAddressTransformer_NoOptions(t *testing.T) {
+ mapping := `root = generate_street_address()`
+ ex, err := bloblang.Parse(mapping)
+ assert.NoError(t, err, "failed to parse the street address transformer")
+
+ res, err := ex.Query(nil)
+ assert.NoError(t, err)
+ assert.NotEmpty(t, res)
+}
diff --git a/worker/pkg/benthos/transformers/generate_string_phone_number.go b/worker/pkg/benthos/transformers/generate_string_phone_number.go
index a09fe3a69e..8d13247ae1 100644
--- a/worker/pkg/benthos/transformers/generate_string_phone_number.go
+++ b/worker/pkg/benthos/transformers/generate_string_phone_number.go
@@ -3,6 +3,7 @@ package transformers
import (
"fmt"
+ mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
"github.com/warpstreamlabs/bento/public/bloblang"
@@ -13,8 +14,8 @@ import (
func init() {
spec := bloblang.NewPluginSpec().
Description("Generates a random 10 digit phone number and returns it as a string with no hyphens.").
- Param(bloblang.NewInt64Param("min").Description("Specifies the minimum length for the generated phone number.")).
- Param(bloblang.NewInt64Param("max").Description("Specifies the maximum length for the generated phone number.")).
+ Param(bloblang.NewInt64Param("min").Default(9).Description("Specifies the minimum length for the generated phone number.")).
+ Param(bloblang.NewInt64Param("max").Default(15).Description("Specifies the maximum length for the generated phone number.")).
Param(bloblang.NewInt64Param("seed").Optional().Description("An optional seed value used to generate deterministic outputs."))
err := bloblang.RegisterFunctionV2("generate_string_phone_number", spec, func(args *bloblang.ParsedParams) (bloblang.Function, error) {
@@ -54,6 +55,13 @@ func init() {
}
}
+func NewGenerateStringPhoneNumberOptsFromConfig(config *mgmtv1alpha1.GenerateStringPhoneNumber) (*GenerateStringPhoneNumberOpts, error) {
+ if config == nil {
+ return NewGenerateStringPhoneNumberOpts(nil, nil, nil)
+ }
+ return NewGenerateStringPhoneNumberOpts(config.Min, config.Max, nil)
+}
+
func (t *GenerateStringPhoneNumber) Generate(opts any) (any, error) {
parsedOpts, ok := opts.(*GenerateStringPhoneNumberOpts)
if !ok {
diff --git a/worker/pkg/benthos/transformers/generate_string_phone_number_test.go b/worker/pkg/benthos/transformers/generate_string_phone_number_test.go
index afc78a49ec..547bc96a1c 100644
--- a/worker/pkg/benthos/transformers/generate_string_phone_number_test.go
+++ b/worker/pkg/benthos/transformers/generate_string_phone_number_test.go
@@ -57,3 +57,13 @@ func Test_GenerateStringPhoneNumberTransformer(t *testing.T) {
assert.GreaterOrEqual(t, len(res.(string)), 8, "Should be greater than 9 characters in length. 9 for the number and 1 for the plus sign.")
assert.LessOrEqual(t, len(res.(string)), 15, "Should be less than 16 characters in length. 15 for the number and 1 for the plus sign.")
}
+
+func Test_GenerateStringPhoneNumberTransformer_NoOptions(t *testing.T) {
+ mapping := `root = generate_string_phone_number()`
+ ex, err := bloblang.Parse(mapping)
+ assert.NoError(t, err, "failed to parse the phone transformer")
+
+ res, err := ex.Query(nil)
+ assert.NoError(t, err)
+ assert.NotEmpty(t, res)
+}
diff --git a/worker/pkg/benthos/transformers/generate_unix_timestamp.go b/worker/pkg/benthos/transformers/generate_unix_timestamp.go
index c283313753..24c9702f88 100644
--- a/worker/pkg/benthos/transformers/generate_unix_timestamp.go
+++ b/worker/pkg/benthos/transformers/generate_unix_timestamp.go
@@ -4,6 +4,7 @@ import (
"fmt"
"time"
+ mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
"github.com/warpstreamlabs/bento/public/bloblang"
@@ -35,6 +36,9 @@ func init() {
panic(err)
}
}
+func NewGenerateUnixTimestampOptsFromConfig(config *mgmtv1alpha1.GenerateUnixTimestamp) (*GenerateUnixTimestampOpts, error) {
+ return NewGenerateUnixTimestampOpts(nil)
+}
func (t *GenerateUnixTimestamp) Generate(opts any) (any, error) {
parsedOpts, ok := opts.(*GenerateUnixTimestampOpts)
diff --git a/worker/pkg/benthos/transformers/generate_username.go b/worker/pkg/benthos/transformers/generate_username.go
index 30c7a49549..36d9745564 100644
--- a/worker/pkg/benthos/transformers/generate_username.go
+++ b/worker/pkg/benthos/transformers/generate_username.go
@@ -4,6 +4,7 @@ import (
"fmt"
"strings"
+ mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
"github.com/warpstreamlabs/bento/public/bloblang"
@@ -14,7 +15,7 @@ import (
func init() {
spec := bloblang.NewPluginSpec().
Description("Randomly generates a username").
- Param(bloblang.NewInt64Param("max_length").Default(10000).Description("Specifies the maximum length for the generated data. This field ensures that the output does not exceed a certain number of characters.")).
+ Param(bloblang.NewInt64Param("max_length").Default(100).Description("Specifies the maximum length for the generated data. This field ensures that the output does not exceed a certain number of characters.")).
Param(bloblang.NewInt64Param("seed").Optional().Description("An optional seed value used to generate deterministic outputs."))
err := bloblang.RegisterFunctionV2("generate_username", spec, func(args *bloblang.ParsedParams) (bloblang.Function, error) {
@@ -46,6 +47,14 @@ func init() {
panic(err)
}
}
+func NewGenerateUsernameOptsFromConfig(config *mgmtv1alpha1.GenerateUsername, maxLength *int64) (*GenerateUsernameOpts, error) {
+ if config == nil {
+ return NewGenerateUsernameOpts(nil, nil)
+ }
+ return NewGenerateUsernameOpts(
+ maxLength, nil,
+ )
+}
func (t *GenerateUsername) Generate(opts any) (any, error) {
parsedOpts, ok := opts.(*GenerateUsernameOpts)
diff --git a/worker/pkg/benthos/transformers/generate_username_test.go b/worker/pkg/benthos/transformers/generate_username_test.go
index fc86c487b5..6998f04042 100644
--- a/worker/pkg/benthos/transformers/generate_username_test.go
+++ b/worker/pkg/benthos/transformers/generate_username_test.go
@@ -49,3 +49,14 @@ func Test_UsernamelTransformer(t *testing.T) {
assert.IsType(t, "", res, "The expected username should have a valid username")
}
+
+func Test_UsernamelTransformer_NoOptions(t *testing.T) {
+ mapping := `root = generate_username()`
+ ex, err := bloblang.Parse(mapping)
+
+ assert.NoError(t, err, "failed to parse the realistic username transformer")
+
+ res, err := ex.Query(nil)
+ assert.NoError(t, err)
+ assert.NotEmpty(t, res)
+}
diff --git a/worker/pkg/benthos/transformers/generate_utc_timestamp.go b/worker/pkg/benthos/transformers/generate_utc_timestamp.go
index d6ffb7fbb9..d751bdda83 100644
--- a/worker/pkg/benthos/transformers/generate_utc_timestamp.go
+++ b/worker/pkg/benthos/transformers/generate_utc_timestamp.go
@@ -4,6 +4,7 @@ import (
"fmt"
"time"
+ mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
"github.com/warpstreamlabs/bento/public/bloblang"
@@ -36,6 +37,10 @@ func init() {
}
}
+func NewGenerateUTCTimestampOptsFromConfig(config *mgmtv1alpha1.GenerateUtcTimestamp) (*GenerateUTCTimestampOpts, error) {
+ return NewGenerateUTCTimestampOpts(nil)
+}
+
func (t *GenerateUTCTimestamp) Generate(opts any) (any, error) {
parsedOpts, ok := opts.(*GenerateUTCTimestampOpts)
if !ok {
diff --git a/worker/pkg/benthos/transformers/generate_uuid.go b/worker/pkg/benthos/transformers/generate_uuid.go
index 3a0d672a9d..3ec66c28da 100644
--- a/worker/pkg/benthos/transformers/generate_uuid.go
+++ b/worker/pkg/benthos/transformers/generate_uuid.go
@@ -6,6 +6,7 @@ import (
"github.com/google/uuid"
+ mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
"github.com/warpstreamlabs/bento/public/bloblang"
)
@@ -33,6 +34,13 @@ func init() {
}
}
+func NewGenerateUUIDOptsFromConfig(config *mgmtv1alpha1.GenerateUuid) (*GenerateUUIDOpts, error) {
+ if config == nil {
+ return NewGenerateUUIDOpts(nil)
+ }
+ return NewGenerateUUIDOpts(config.IncludeHyphens)
+}
+
func (t *GenerateUUID) Generate(opts any) (any, error) {
parsedOpts, ok := opts.(*GenerateUUIDOpts)
if !ok {
diff --git a/worker/pkg/benthos/transformers/generate_uuid_test.go b/worker/pkg/benthos/transformers/generate_uuid_test.go
index e4daa720ad..584a91763b 100644
--- a/worker/pkg/benthos/transformers/generate_uuid_test.go
+++ b/worker/pkg/benthos/transformers/generate_uuid_test.go
@@ -39,3 +39,13 @@ func TestUUIDTransformer(t *testing.T) {
assert.Len(t, res.(string), 36, "UUIDs with hyphens must have 36 characters")
}
+
+func TestUUIDTransformer_NoOptions(t *testing.T) {
+ mapping := `root = generate_uuid()`
+ ex, err := bloblang.Parse(mapping)
+ assert.NoError(t, err, "failed to parse the uuid transformer")
+
+ res, err := ex.Query(nil) // input is ignored here
+ assert.NoError(t, err)
+ assert.NotEmpty(t, res)
+}
diff --git a/worker/pkg/benthos/transformers/generate_zipcode.go b/worker/pkg/benthos/transformers/generate_zipcode.go
index 2f4a55abd4..56ca8e835a 100644
--- a/worker/pkg/benthos/transformers/generate_zipcode.go
+++ b/worker/pkg/benthos/transformers/generate_zipcode.go
@@ -3,6 +3,7 @@ package transformers
import (
"fmt"
+ mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
transformers_dataset "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/data-sets"
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -37,6 +38,10 @@ func init() {
}
}
+func NewGenerateZipcodeOptsFromConfig(config *mgmtv1alpha1.GenerateZipcode) (*GenerateZipcodeOpts, error) {
+ return NewGenerateZipcodeOpts(nil)
+}
+
func (t *GenerateZipcode) Generate(opts any) (any, error) {
parsedOpts, ok := opts.(*GenerateZipcodeOpts)
if !ok {
diff --git a/worker/pkg/benthos/transformers/generator_utils.go b/worker/pkg/benthos/transformers/generator_utils.go
index 79aa96bd80..0960af1035 100644
--- a/worker/pkg/benthos/transformers/generator_utils.go
+++ b/worker/pkg/benthos/transformers/generator_utils.go
@@ -35,26 +35,29 @@ func toCamelCase(snake string) string {
}
type BenthosSpecParam struct {
- Name string
- TypeStr string
- IsOptional bool
- HasDefault bool
- Default string
- Description string
+ Name string
+ BloblangName string
+ TypeStr string
+ IsOptional bool
+ HasDefault bool
+ Default string
+ Description string
}
type BenthosSpec struct {
- Name string
- Description string
- Example string
- Params []*BenthosSpecParam
- Type string
- SourceFile string
+ Name string
+ BloblangFuncName string
+ Description string
+ Example string
+ Params []*BenthosSpecParam
+ Type string
+ SourceFile string
}
type ParsedBenthosSpec struct {
- Params []*BenthosSpecParam
- SpecDescription string
+ Params []*BenthosSpecParam
+ BloblangFuncName string
+ SpecDescription string
}
func ExtractBenthosSpec(fileSet *token.FileSet) ([]*BenthosSpec, error) {
@@ -111,7 +114,8 @@ func ParseBloblangSpec(benthosSpec *BenthosSpec) (*ParsedBenthosSpec, error) {
start = true
benthosSpecStr += strings.TrimSpace(fileScanner.Text())
} else if start {
- if strings.Contains(line, ":=") {
+ if strings.Contains(line, "bloblang.RegisterFunctionV2") {
+ benthosSpecStr += strings.TrimSpace(fileScanner.Text())
break
}
benthosSpecStr += strings.TrimSpace(fileScanner.Text())
@@ -139,24 +143,44 @@ func ParseBloblangSpec(benthosSpec *BenthosSpec) (*ParsedBenthosSpec, error) {
}
}
param := &BenthosSpecParam{
- TypeStr: lowercaseFirst(matches[1]),
- Name: toCamelCase(matches[2]),
- IsOptional: strings.Contains(line, ".Optional()"),
- HasDefault: defaultVal != "",
- Default: defaultVal,
- Description: description,
+ TypeStr: lowercaseFirst(matches[1]),
+ Name: toCamelCase(matches[2]),
+ BloblangName: matches[2],
+ IsOptional: strings.Contains(line, ".Optional()"),
+ HasDefault: defaultVal != "",
+ Default: defaultVal,
+ Description: description,
}
params = append(params, param)
}
}
}
+ bloblangFuncName, err := extractBloblangFunctionName(benthosSpecStr, benthosSpec.SourceFile)
+ if err != nil {
+ return nil, err
+ }
+
return &ParsedBenthosSpec{
- Params: params,
- SpecDescription: specDescription,
+ BloblangFuncName: bloblangFuncName,
+ Params: params,
+ SpecDescription: specDescription,
}, nil
}
+func extractBloblangFunctionName(input, sourceFile string) (string, error) {
+ // Looks for bloblang.RegisterFunctionV2 and captures the function name in quotes
+ re := regexp.MustCompile(`bloblang\.RegisterFunctionV2\("([^"]+)"`)
+
+ matches := re.FindStringSubmatch(input)
+
+ if len(matches) > 1 {
+ return matches[1], nil
+ }
+
+ return "", fmt.Errorf("bloblang function name not found: %s", sourceFile)
+}
+
func lowercaseFirst(s string) string {
if s == "" {
return s
diff --git a/worker/pkg/benthos/transformers/neosync_transformer_generator.go b/worker/pkg/benthos/transformers/neosync_transformer_generator.go
index 8aa00921a2..3454912da0 100644
--- a/worker/pkg/benthos/transformers/neosync_transformer_generator.go
+++ b/worker/pkg/benthos/transformers/neosync_transformer_generator.go
@@ -65,6 +65,7 @@ func main() {
}
tf.Params = p.Params
tf.Description = p.SpecDescription
+ tf.BloblangFuncName = p.BloblangFuncName
}
for _, tf := range transformerFuncs {
@@ -96,9 +97,8 @@ const codeTemplate = `
package {{.PackageName}}
import (
- {{- if eq .ImportFmt true}}
+ "strings"
"fmt"
- {{ end }}
{{- if eq .HasSeedParam true}}
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -148,7 +148,11 @@ func New{{.StructName}}Opts(
return nil, fmt.Errorf("unable to generate seed: %w", err)
}
{{ else if $param.HasDefault }}
+ {{- if eq $param.TypeStr "any" }}
+ var {{$param.Name}} any
+ {{- else}}
{{$param.Name}} := {{$param.TypeStr}}({{$param.Default}})
+ {{- end }}
if {{$param.Name}}Arg != nil {
{{$param.Name}} = *{{$param.Name}}Arg
}
@@ -166,6 +170,48 @@ func New{{.StructName}}Opts(
}, nil
}
+func (o *{{.StructName}}Opts) BuildBloblangString(
+{{- if .IsTransformer }}
+ valuePath string,
+{{- end }}
+) string {
+ fnStr := []string{
+ {{- range $index, $param := .FunctInfo.Params }}
+ {{- if eq $param.Name "seed" }}{{ continue }}{{ end }}
+ {{- if eq $param.Name "value" }}
+ "value:this.%s",
+ {{- else if not $param.IsOptional }}
+ "{{$param.BloblangName}}:{{- if eq $param.TypeStr "string" }}%q{{else}}%v{{end}}",
+ {{- end }}
+ {{- end }}
+ }
+
+ params := []any{
+ {{- range $index, $param := .FunctInfo.Params }}
+ {{- if eq $param.Name "seed" }}{{ continue }}{{ end }}
+ {{- if eq $param.Name "value" }}
+ valuePath,
+ {{- else if not $param.IsOptional }}
+ o.{{$param.Name}},
+ {{- end }}
+ {{- end }}
+ }
+
+ {{ range $index, $param := .FunctInfo.Params }}
+ {{- if eq $param.Name "value" }}{{ continue }}{{ end }}
+ {{- if eq $param.Name "seed" }}{{ continue }}{{ end }}
+ {{- if $param.IsOptional }}
+ if o.{{$param.Name}} != nil {
+ fnStr = append(fnStr, "{{$param.BloblangName}}:{{- if eq $param.TypeStr "string" }}%q{{else}}%v{{end}}")
+ params = append(params, *o.{{$param.Name}})
+ }
+ {{- end -}}
+ {{- end }}
+
+ template := fmt.Sprintf("{{ .FunctInfo.BloblangFuncName }}(%s)", strings.Join(fnStr, ","))
+ return fmt.Sprintf(template, params...)
+}
+
func (t *{{.StructName}}) GetJsTemplateData() (*TemplateData, error) {
return &TemplateData{
Name: "{{.FunctInfo.Name}}",
@@ -223,12 +269,12 @@ func (t *{{.StructName}}) ParseOptions(opts map[string]any) (any, error) {
`
type TemplateData struct {
- SourceFile string
- PackageName string
- FunctInfo transformers.BenthosSpec
- StructName string
- ImportFmt bool
- HasSeedParam bool
+ SourceFile string
+ PackageName string
+ FunctInfo transformers.BenthosSpec
+ StructName string
+ HasSeedParam bool
+ IsTransformer bool
}
func generateCode(pkgName string, funcInfo *transformers.BenthosSpec) (string, error) {
@@ -241,10 +287,9 @@ func generateCode(pkgName string, funcInfo *transformers.BenthosSpec) (string, e
for _, p := range funcInfo.Params {
if p.Name == "seed" {
data.HasSeedParam = true
- data.ImportFmt = true
}
- if !p.IsOptional && !p.HasDefault {
- data.ImportFmt = true
+ if p.Name == "value" {
+ data.IsTransformer = true
}
}
t := template.Must(template.New("neosyncTransformerImpl").Parse(codeTemplate))
diff --git a/worker/pkg/benthos/transformers/transform_character_scramble.go b/worker/pkg/benthos/transformers/transform_character_scramble.go
index b5b94c088f..dd80e75256 100644
--- a/worker/pkg/benthos/transformers/transform_character_scramble.go
+++ b/worker/pkg/benthos/transformers/transform_character_scramble.go
@@ -6,6 +6,7 @@ import (
"strings"
"unicode"
+ mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
"github.com/warpstreamlabs/bento/public/bloblang"
@@ -68,6 +69,13 @@ func init() {
}
}
+func NewTransformCharacterScrambleOptsFromConfig(config *mgmtv1alpha1.TransformCharacterScramble) (*TransformCharacterScrambleOpts, error) {
+ if config == nil {
+ return NewTransformCharacterScrambleOpts(nil, nil)
+ }
+ return NewTransformCharacterScrambleOpts(config.UserProvidedRegex, nil)
+}
+
func (t *TransformCharacterScramble) Transform(value, opts any) (any, error) {
parsedOpts, ok := opts.(*TransformCharacterScrambleOpts)
if !ok {
diff --git a/worker/pkg/benthos/transformers/transform_e164_phone_number.go b/worker/pkg/benthos/transformers/transform_e164_phone_number.go
index a4e94661e9..47bcde55bd 100644
--- a/worker/pkg/benthos/transformers/transform_e164_phone_number.go
+++ b/worker/pkg/benthos/transformers/transform_e164_phone_number.go
@@ -5,6 +5,7 @@ import (
"fmt"
"strings"
+ mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
"github.com/warpstreamlabs/bento/public/bloblang"
@@ -16,8 +17,8 @@ func init() {
spec := bloblang.NewPluginSpec().
Description("Transforms an existing E164 formatted phone number.").
Param(bloblang.NewAnyParam("value").Optional()).
- Param(bloblang.NewBoolParam("preserve_length").Description("Whether the original length of the input data should be preserved during transformation. If set to true, the transformation logic will ensure that the output data has the same length as the input data.")).
- Param(bloblang.NewInt64Param("max_length").Optional().Description("Specifies the maximum length for the transformed data. This field ensures that the output does not exceed a certain number of characters.")).
+ Param(bloblang.NewBoolParam("preserve_length").Default(false).Description("Whether the original length of the input data should be preserved during transformation. If set to true, the transformation logic will ensure that the output data has the same length as the input data.")).
+ Param(bloblang.NewInt64Param("max_length").Default(15).Description("Specifies the maximum length for the transformed data. This field ensures that the output does not exceed a certain number of characters.")).
Param(bloblang.NewInt64Param("seed").Optional().Description("An optional seed value used to generate deterministic outputs."))
err := bloblang.RegisterFunctionV2("transform_e164_phone_number", spec, func(args *bloblang.ParsedParams) (bloblang.Function, error) {
@@ -67,6 +68,13 @@ func init() {
}
}
+func NewTransformE164PhoneNumberOptsFromConfig(config *mgmtv1alpha1.TransformE164PhoneNumber, maxLength *int64) (*TransformE164PhoneNumberOpts, error) {
+ if config == nil {
+ return NewTransformE164PhoneNumberOpts(nil, nil, nil)
+ }
+ return NewTransformE164PhoneNumberOpts(config.PreserveLength, maxLength, nil)
+}
+
func (t *TransformE164PhoneNumber) Transform(value, opts any) (any, error) {
parsedOpts, ok := opts.(*TransformE164PhoneNumberOpts)
if !ok {
@@ -78,7 +86,7 @@ func (t *TransformE164PhoneNumber) Transform(value, opts any) (any, error) {
return nil, errors.New("value is not a string")
}
- return transformE164PhoneNumber(parsedOpts.randomizer, valueStr, parsedOpts.preserveLength, parsedOpts.maxLength)
+ return transformE164PhoneNumber(parsedOpts.randomizer, valueStr, parsedOpts.preserveLength, &parsedOpts.maxLength)
}
// Generates a random phone number and returns it as a string
diff --git a/worker/pkg/benthos/transformers/transform_e164_phone_number_test.go b/worker/pkg/benthos/transformers/transform_e164_phone_number_test.go
index db04d2645d..ef5847652e 100644
--- a/worker/pkg/benthos/transformers/transform_e164_phone_number_test.go
+++ b/worker/pkg/benthos/transformers/transform_e164_phone_number_test.go
@@ -68,3 +68,14 @@ func Test_TransformE164PhoneTransformerWithEmptyValue(t *testing.T) {
_, err = ex.Query(nil)
assert.NoError(t, err)
}
+
+func Test_TransformE164PhoneTransformer_NoOptions(t *testing.T) {
+ nilE164Phone := "12323"
+ mapping := fmt.Sprintf(`root = transform_e164_phone_number(value:%q)`, nilE164Phone)
+ ex, err := bloblang.Parse(mapping)
+ assert.NoError(t, err, "failed to parse the e164 phone transformer")
+
+ res, err := ex.Query(nil)
+ assert.NoError(t, err)
+ assert.NotEmpty(t, res)
+}
diff --git a/worker/pkg/benthos/transformers/transform_email.go b/worker/pkg/benthos/transformers/transform_email.go
index 82362482bd..b6dfd77fae 100644
--- a/worker/pkg/benthos/transformers/transform_email.go
+++ b/worker/pkg/benthos/transformers/transform_email.go
@@ -1,6 +1,7 @@
package transformers
import (
+ "encoding/json"
"errors"
"fmt"
"math"
@@ -8,6 +9,7 @@ import (
"strings"
"github.com/google/uuid"
+ mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
"github.com/warpstreamlabs/bento/public/bloblang"
@@ -42,7 +44,7 @@ func init() {
Param(bloblang.NewBoolParam("preserve_length").Default(false).Description("Specifies the maximum length for the transformed data. This field ensures that the output does not exceed a certain number of characters.")).
Param(bloblang.NewBoolParam("preserve_domain").Default(false).Description("A boolean indicating whether the domain part of the email should be preserved.")).
Param(bloblang.NewAnyParam("excluded_domains").Default([]any{}).Description("A list of domains that should be excluded from the transformation")).
- Param(bloblang.NewInt64Param("max_length").Default(10000).Description("Whether the original length of the input data should be preserved during transformation. If set to true, the transformation logic will ensure that the output data has the same length as the input data.")).
+ Param(bloblang.NewInt64Param("max_length").Default(100).Description("Whether the original length of the input data should be preserved during transformation. If set to true, the transformation logic will ensure that the output data has the same length as the input data.")).
Param(bloblang.NewInt64Param("seed").Optional().Description("An optional seed value used for generating deterministic transformations.")).
Param(bloblang.NewStringParam("email_type").Default(GenerateEmailType_UuidV4.String()).Description("Specifies the type of email to transform, with options including `uuidv4`, `fullname`, or `any`.")).
Param(bloblang.NewStringParam("invalid_email_action").Default(InvalidEmailAction_Reject.String()).Description("Specifies the action to take when an invalid email is encountered, with options including `reject`, `passthrough`, `null`, or `generate`."))
@@ -129,6 +131,37 @@ func init() {
}
}
+func NewTransformEmailOptsFromConfig(config *mgmtv1alpha1.TransformEmail, maxLength *int64) (*TransformEmailOpts, error) {
+ if config == nil {
+ var excludedDomains any = "[]"
+ return NewTransformEmailOpts(nil, nil, &excludedDomains, nil, nil, nil, nil)
+ }
+ var emailType *string
+ if config.EmailType != nil {
+ emailTypeStr := dtoEmailTypeToTransformerEmailType(config.GetEmailType()).String()
+ emailType = &emailTypeStr
+ }
+ var invalidEmailAction *string
+ if config.InvalidEmailAction != nil {
+ invalidEmailActionStr := dtoInvalidEmailActionToTransformerInvalidEmailAction(config.GetInvalidEmailAction()).String()
+ invalidEmailAction = &invalidEmailActionStr
+ }
+ excludedDomainsStr, err := convertStringSliceToString(config.GetExcludedDomains())
+ if err != nil {
+ return nil, err
+ }
+ var excludedDomains any = excludedDomainsStr
+ return NewTransformEmailOpts(
+ config.PreserveLength,
+ config.PreserveDomain,
+ &excludedDomains,
+ maxLength,
+ nil,
+ emailType,
+ invalidEmailAction,
+ )
+}
+
func (t *TransformEmail) Transform(value, opts any) (any, error) {
parsedOpts, ok := opts.(*TransformEmailOpts)
if !ok {
@@ -151,6 +184,9 @@ func (t *TransformEmail) Transform(value, opts any) (any, error) {
excludedDomains = exDomainsStrs
case []string:
excludedDomains = v
+ case string:
+ css := strings.TrimSuffix(strings.TrimPrefix(v, "["), "]")
+ excludedDomains = strings.Split(css, ",")
default:
return nil, fmt.Errorf("excludedDomains is of type %T, not []any or []string", v)
}
@@ -296,3 +332,40 @@ func transformEmail(
generatedemail := fmt.Sprintf("%s@%s", newname, newdomain)
return &generatedemail, nil
}
+
+func dtoEmailTypeToTransformerEmailType(dto mgmtv1alpha1.GenerateEmailType) GenerateEmailType {
+ switch dto {
+ case mgmtv1alpha1.GenerateEmailType_GENERATE_EMAIL_TYPE_FULLNAME:
+ return GenerateEmailType_FullName
+ default:
+ return GenerateEmailType_UuidV4
+ }
+}
+
+func dtoInvalidEmailActionToTransformerInvalidEmailAction(dto mgmtv1alpha1.InvalidEmailAction) InvalidEmailAction {
+ switch dto {
+ case mgmtv1alpha1.InvalidEmailAction_INVALID_EMAIL_ACTION_GENERATE:
+ return InvalidEmailAction_Generate
+ case mgmtv1alpha1.InvalidEmailAction_INVALID_EMAIL_ACTION_NULL:
+ return InvalidEmailAction_Null
+ case mgmtv1alpha1.InvalidEmailAction_INVALID_EMAIL_ACTION_PASSTHROUGH:
+ return InvalidEmailAction_Passthrough
+ default:
+ return InvalidEmailAction_Reject
+ }
+}
+
+func convertStringSliceToString(slc []string) (string, error) {
+ var returnStr string
+
+ if len(slc) == 0 {
+ returnStr = "[]"
+ } else {
+ sliceBytes, err := json.Marshal(slc)
+ if err != nil {
+ return "", err
+ }
+ returnStr = string(sliceBytes)
+ }
+ return returnStr, nil
+}
diff --git a/worker/pkg/benthos/transformers/transform_email_test.go b/worker/pkg/benthos/transformers/transform_email_test.go
index 049e04ad30..0c53d4a0af 100644
--- a/worker/pkg/benthos/transformers/transform_email_test.go
+++ b/worker/pkg/benthos/transformers/transform_email_test.go
@@ -395,6 +395,16 @@ func Test_TransformEmailTransformer_InvalidEmailArg(t *testing.T) {
require.NoError(t, err)
}
+func Test_TransformEmailTransformer_NoOptions(t *testing.T) {
+ mapping := fmt.Sprintf(`root = transform_email(value:%q)`, "nick@neosync.dev")
+ ex, err := bloblang.Parse(mapping)
+ require.NoError(t, err, "failed to parse the email transformer")
+
+ res, err := ex.Query(nil)
+ require.NoError(t, err)
+ require.NotEmpty(t, res)
+}
+
func Test_fromAnyToStringSlice(t *testing.T) {
var foo any = []any{"123", "456"}
output, err := fromAnyToStringSlice(foo)
@@ -421,3 +431,19 @@ func Test_fromAnyToStringSlice(t *testing.T) {
require.NoError(t, err)
require.Empty(t, output)
}
+
+func Test_ConverStringSliceToStringEmptySlice(t *testing.T) {
+ slc := []string{}
+
+ res, err := convertStringSliceToString(slc)
+ require.NoError(t, err)
+ require.Equal(t, "[]", res)
+}
+
+func Test_ConverStringSliceToStringNotEmptySlice(t *testing.T) {
+ slc := []string{"gmail.com", "yahoo.com"}
+
+ res, err := convertStringSliceToString(slc)
+ require.NoError(t, err)
+ require.Equal(t, `["gmail.com","yahoo.com"]`, res)
+}
diff --git a/worker/pkg/benthos/transformers/transform_first_name.go b/worker/pkg/benthos/transformers/transform_first_name.go
index 34920fece6..50573ce9ac 100644
--- a/worker/pkg/benthos/transformers/transform_first_name.go
+++ b/worker/pkg/benthos/transformers/transform_first_name.go
@@ -4,6 +4,7 @@ import (
"errors"
"fmt"
+ mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
"github.com/warpstreamlabs/bento/public/bloblang"
@@ -14,7 +15,7 @@ import (
func init() {
spec := bloblang.NewPluginSpec().
Description("Transforms an existing first name").
- Param(bloblang.NewInt64Param("max_length").Default(10000).Description("Specifies the maximum length for the transformed data. This field ensures that the output does not exceed a certain number of characters.")).
+ Param(bloblang.NewInt64Param("max_length").Default(100).Description("Specifies the maximum length for the transformed data. This field ensures that the output does not exceed a certain number of characters.")).
Param(bloblang.NewAnyParam("value").Optional()).
Param(bloblang.NewBoolParam("preserve_length").Default(false).Description("Whether the original length of the input data should be preserved during transformation. If set to true, the transformation logic will ensure that the output data has the same length as the input data.")).
Param(bloblang.NewInt64Param("seed").Optional().Description("An optional seed value used for generating deterministic transformations."))
@@ -66,6 +67,17 @@ func init() {
}
}
+func NewTransformFirstNameOptsFromConfig(config *mgmtv1alpha1.TransformFirstName, maxLength *int64) (*TransformFirstNameOpts, error) {
+ if config == nil {
+ return NewTransformFirstNameOpts(nil, nil, nil)
+ }
+ return NewTransformFirstNameOpts(
+ maxLength,
+ config.PreserveLength,
+ nil,
+ )
+}
+
func (t *TransformFirstName) Transform(value, opts any) (any, error) {
parsedOpts, ok := opts.(*TransformFirstNameOpts)
if !ok {
diff --git a/worker/pkg/benthos/transformers/transform_first_name_test.go b/worker/pkg/benthos/transformers/transform_first_name_test.go
index 4a9667fe0d..e8a0eeeaa1 100644
--- a/worker/pkg/benthos/transformers/transform_first_name_test.go
+++ b/worker/pkg/benthos/transformers/transform_first_name_test.go
@@ -105,3 +105,13 @@ func Test_TransformFirstNameTransformerWithEmptyValue(t *testing.T) {
_, err = ex.Query(nil)
assert.NoError(t, err)
}
+
+func Test_TransformFirstNameTransformer_NoOptions(t *testing.T) {
+ mapping := fmt.Sprintf(`root = transform_first_name(value:%q)`, "name")
+ ex, err := bloblang.Parse(mapping)
+ assert.NoError(t, err, "failed to parse the first name transformer")
+
+ res, err := ex.Query(nil)
+ assert.NoError(t, err)
+ assert.NotEmpty(t, res)
+}
diff --git a/worker/pkg/benthos/transformers/transform_float.go b/worker/pkg/benthos/transformers/transform_float.go
index 46b13f6979..9730112d28 100644
--- a/worker/pkg/benthos/transformers/transform_float.go
+++ b/worker/pkg/benthos/transformers/transform_float.go
@@ -6,6 +6,7 @@ import (
"strconv"
"sync"
+ mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
"github.com/warpstreamlabs/bento/public/bloblang"
@@ -17,8 +18,8 @@ func init() {
spec := bloblang.NewPluginSpec().
Description("Anonymizes and transforms an existing float value.").
Param(bloblang.NewAnyParam("value").Optional()).
- Param(bloblang.NewFloat64Param("randomization_range_min").Description("Specifies the minimum value for the range of the float.")).
- Param(bloblang.NewFloat64Param("randomization_range_max").Description("Specifies the maximum value for the randomization range of the float.")).
+ Param(bloblang.NewFloat64Param("randomization_range_min").Default(1).Description("Specifies the minimum value for the range of the float.")).
+ Param(bloblang.NewFloat64Param("randomization_range_max").Default(10000).Description("Specifies the maximum value for the randomization range of the float.")).
Param(bloblang.NewInt64Param("precision").Optional().Description("An optional parameter that defines the number of significant digits for the float.")).
Param(bloblang.NewInt64Param("scale").Optional().Description("An optional parameter that defines the number of decimal places for the float.")).
Param(bloblang.NewInt64Param("seed").Optional().Description("An optional seed value used for generating deterministic transformations."))
@@ -74,6 +75,19 @@ func init() {
}
}
+func NewTransformFloat64OptsFromConfig(config *mgmtv1alpha1.TransformFloat64, scale, precision *int64) (*TransformFloat64Opts, error) {
+ if config == nil {
+ return NewTransformFloat64Opts(nil, nil, nil, nil, nil)
+ }
+ return NewTransformFloat64Opts(
+ config.RandomizationRangeMin,
+ config.RandomizationRangeMax,
+ precision,
+ scale,
+ nil,
+ )
+}
+
func (t *TransformFloat64) Transform(value, opts any) (any, error) {
parsedOpts, ok := opts.(*TransformFloat64Opts)
if !ok {
diff --git a/worker/pkg/benthos/transformers/transform_float_test.go b/worker/pkg/benthos/transformers/transform_float_test.go
index 91d5006d7a..e9a7f2124c 100644
--- a/worker/pkg/benthos/transformers/transform_float_test.go
+++ b/worker/pkg/benthos/transformers/transform_float_test.go
@@ -49,6 +49,17 @@ func Test_TransformFloat64_Benthos(t *testing.T) {
}
}
+func Test_TransformFloat64_Benthos_NoOptions(t *testing.T) {
+ val := float64(27.35)
+ mapping := fmt.Sprintf(`root = transform_float64(value:%f)`, val)
+ ex, err := bloblang.Parse(mapping)
+ require.NoError(t, err, "failed to parse the email transformer")
+
+ res, err := ex.Query(nil)
+ require.NoError(t, err)
+ require.NotEmpty(t, res)
+}
+
func Test_calculateMaxNumber(t *testing.T) {
tests := []struct {
precision int
diff --git a/worker/pkg/benthos/transformers/transform_full_name.go b/worker/pkg/benthos/transformers/transform_full_name.go
index bfd1bb173f..465e934559 100644
--- a/worker/pkg/benthos/transformers/transform_full_name.go
+++ b/worker/pkg/benthos/transformers/transform_full_name.go
@@ -5,6 +5,7 @@ import (
"fmt"
"strings"
+ mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
"github.com/warpstreamlabs/bento/public/bloblang"
@@ -15,7 +16,7 @@ import (
func init() {
spec := bloblang.NewPluginSpec().
Description("Transforms an existing full name.").
- Param(bloblang.NewInt64Param("max_length").Default(10000).Default("Specifies the maximum length for the transformed data. This field ensures that the output does not exceed a certain number of characters.")).
+ Param(bloblang.NewInt64Param("max_length").Default(100).Description("Specifies the maximum length for the transformed data. This field ensures that the output does not exceed a certain number of characters.")).
Param(bloblang.NewAnyParam("value").Optional()).
Param(bloblang.NewBoolParam("preserve_length").Default(false).Description("Whether the original length of the input data should be preserved during transformation. If set to true, the transformation logic will ensure that the output data has the same length as the input data.")).
Param(bloblang.NewInt64Param("seed").Optional().Description("An optional seed value used for generating deterministic transformations."))
@@ -67,6 +68,17 @@ func init() {
}
}
+func NewTransformFullNameOptsFromConfig(config *mgmtv1alpha1.TransformFullName, maxLength *int64) (*TransformFullNameOpts, error) {
+ if config == nil {
+ return NewTransformFullNameOpts(nil, nil, nil)
+ }
+ return NewTransformFullNameOpts(
+ maxLength,
+ config.PreserveLength,
+ nil,
+ )
+}
+
func (t *TransformFullName) Transform(value, opts any) (any, error) {
parsedOpts, ok := opts.(*TransformFullNameOpts)
if !ok {
diff --git a/worker/pkg/benthos/transformers/transform_full_name_test.go b/worker/pkg/benthos/transformers/transform_full_name_test.go
index 15dc4642d7..fe2e48e0eb 100644
--- a/worker/pkg/benthos/transformers/transform_full_name_test.go
+++ b/worker/pkg/benthos/transformers/transform_full_name_test.go
@@ -75,3 +75,13 @@ func Test_TransformFullNamelTransformerWithEmptyValue(t *testing.T) {
_, err = ex.Query(nil)
assert.NoError(t, err)
}
+
+func Test_TransformFullNamelTransformer_NoOptions(t *testing.T) {
+ mapping := fmt.Sprintf(`root = transform_full_name(value:%q)`, "full name")
+ ex, err := bloblang.Parse(mapping)
+ assert.NoError(t, err, "failed to parse the full name transformer")
+
+ res, err := ex.Query(nil)
+ assert.NoError(t, err)
+ assert.NotEmpty(t, res)
+}
diff --git a/worker/pkg/benthos/transformers/transform_int64.go b/worker/pkg/benthos/transformers/transform_int64.go
index b5db1830c5..24d861d6ca 100644
--- a/worker/pkg/benthos/transformers/transform_int64.go
+++ b/worker/pkg/benthos/transformers/transform_int64.go
@@ -4,6 +4,7 @@ import (
"fmt"
"reflect"
+ mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
"github.com/warpstreamlabs/bento/public/bloblang"
@@ -15,8 +16,8 @@ func init() {
spec := bloblang.NewPluginSpec().
Description("Anonymizes and transforms an existing int64 value.").
Param(bloblang.NewAnyParam("value").Optional()).
- Param(bloblang.NewInt64Param("randomization_range_min").Description("Specifies the minimum value for the range of the int.")).
- Param(bloblang.NewInt64Param("randomization_range_max").Description("Specifies the maximum value for the range of the int.")).
+ Param(bloblang.NewInt64Param("randomization_range_min").Default(1).Description("Specifies the minimum value for the range of the int.")).
+ Param(bloblang.NewInt64Param("randomization_range_max").Default(10000).Description("Specifies the maximum value for the range of the int.")).
Param(bloblang.NewInt64Param("seed").Optional().Description("An optional seed value used to generate deterministic outputs."))
err := bloblang.RegisterFunctionV2("transform_int64", spec, func(args *bloblang.ParsedParams) (bloblang.Function, error) {
@@ -61,6 +62,17 @@ func init() {
}
}
+func NewTransformInt64OptsFromConfig(config *mgmtv1alpha1.TransformInt64) (*TransformInt64Opts, error) {
+ if config == nil {
+ return NewTransformInt64Opts(nil, nil, nil)
+ }
+ return NewTransformInt64Opts(
+ config.RandomizationRangeMin,
+ config.RandomizationRangeMax,
+ nil,
+ )
+}
+
func (t *TransformInt64) Transform(value, opts any) (any, error) {
parsedOpts, ok := opts.(*TransformInt64Opts)
if !ok {
diff --git a/worker/pkg/benthos/transformers/transform_int64_phone_number.go b/worker/pkg/benthos/transformers/transform_int64_phone_number.go
index 227d8ba3fc..00a8082bab 100644
--- a/worker/pkg/benthos/transformers/transform_int64_phone_number.go
+++ b/worker/pkg/benthos/transformers/transform_int64_phone_number.go
@@ -4,6 +4,7 @@ import (
"fmt"
"reflect"
+ mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
transformers_dataset "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/data-sets"
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
@@ -16,7 +17,7 @@ func init() {
spec := bloblang.NewPluginSpec().
Description("Anonymizes and transforms an existing int64 phone number.").
Param(bloblang.NewAnyParam("value").Optional()).
- Param(bloblang.NewBoolParam("preserve_length").Description("Whether the original length of the input data should be preserved during transformation. If set to true, the transformation logic will ensure that the output data has the same length as the input data.")).
+ Param(bloblang.NewBoolParam("preserve_length").Default(false).Description("Whether the original length of the input data should be preserved during transformation. If set to true, the transformation logic will ensure that the output data has the same length as the input data.")).
Param(bloblang.NewInt64Param("seed").Optional().Description("An optional seed value used to generate deterministic outputs."))
err := bloblang.RegisterFunctionV2("transform_int64_phone_number", spec, func(args *bloblang.ParsedParams) (bloblang.Function, error) {
@@ -61,6 +62,13 @@ func init() {
}
}
+func NewTransformInt64PhoneNumberOptsFromConfig(config *mgmtv1alpha1.TransformInt64PhoneNumber) (*TransformInt64PhoneNumberOpts, error) {
+ if config == nil {
+ return NewTransformInt64PhoneNumberOpts(nil, nil)
+ }
+ return NewTransformInt64PhoneNumberOpts(config.PreserveLength, nil)
+}
+
func (t *TransformInt64PhoneNumber) Transform(value, opts any) (any, error) {
parsedOpts, ok := opts.(*TransformInt64PhoneNumberOpts)
if !ok {
diff --git a/worker/pkg/benthos/transformers/transform_int64_phone_number_test.go b/worker/pkg/benthos/transformers/transform_int64_phone_number_test.go
index 4a7338a30b..90c551d908 100644
--- a/worker/pkg/benthos/transformers/transform_int64_phone_number_test.go
+++ b/worker/pkg/benthos/transformers/transform_int64_phone_number_test.go
@@ -75,3 +75,13 @@ func Test_TransformIntPhoneTransformerWithEmptyValue(t *testing.T) {
_, err = ex.Query(nil)
assert.NoError(t, err)
}
+
+func Test_TransformIntPhoneTransformer_NoOptions(t *testing.T) {
+ mapping := fmt.Sprintf(`root = transform_int64_phone_number(value:%d)`, 123123)
+ ex, err := bloblang.Parse(mapping)
+ assert.NoError(t, err, "failed to parse the int phone number transformer")
+
+ res, err := ex.Query(nil)
+ assert.NoError(t, err)
+ assert.NotEmpty(t, res)
+}
diff --git a/worker/pkg/benthos/transformers/transform_int64_test.go b/worker/pkg/benthos/transformers/transform_int64_test.go
index 27d429d343..84425032fe 100644
--- a/worker/pkg/benthos/transformers/transform_int64_test.go
+++ b/worker/pkg/benthos/transformers/transform_int64_test.go
@@ -47,3 +47,14 @@ func Test_TransformInt64_Benthos(t *testing.T) {
require.Error(t, err, "Expected the pointer to resolve to an int64")
}
}
+
+func Test_TransformInt64_Benthos_NoOptions(t *testing.T) {
+ val := int64(27)
+ mapping := fmt.Sprintf(`root = transform_int64(value:%d)`, val)
+ ex, err := bloblang.Parse(mapping)
+ require.NoError(t, err, "failed to parse the email transformer")
+
+ res, err := ex.Query(nil)
+ require.NoError(t, err)
+ require.NotEmpty(t, res)
+}
diff --git a/worker/pkg/benthos/transformers/transform_lastname.go b/worker/pkg/benthos/transformers/transform_lastname.go
index 77f91c859b..04f71abc9b 100644
--- a/worker/pkg/benthos/transformers/transform_lastname.go
+++ b/worker/pkg/benthos/transformers/transform_lastname.go
@@ -4,6 +4,7 @@ import (
"errors"
"fmt"
+ mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
"github.com/warpstreamlabs/bento/public/bloblang"
@@ -14,7 +15,7 @@ import (
func init() {
spec := bloblang.NewPluginSpec().
Description("Anonymizes and transforms an existing last name.").
- Param(bloblang.NewInt64Param("max_length").Default(10000).Description("Specifies the maximum length for the transformed data. This field ensures that the output does not exceed a certain number of characters.")).
+ Param(bloblang.NewInt64Param("max_length").Default(100).Description("Specifies the maximum length for the transformed data. This field ensures that the output does not exceed a certain number of characters.")).
Param(bloblang.NewAnyParam("value").Optional()).
Param(bloblang.NewBoolParam("preserve_length").Default(false).Description("Whether the original length of the input data should be preserved during transformation. If set to true, the transformation logic will ensure that the output data has the same length as the input data.")).
Param(bloblang.NewInt64Param("seed").Optional().Description("An optional seed value used for generating deterministic transformations."))
@@ -65,6 +66,17 @@ func init() {
}
}
+func NewTransformLastNameOptsFromConfig(config *mgmtv1alpha1.TransformLastName, maxLength *int64) (*TransformLastNameOpts, error) {
+ if config == nil {
+ return NewTransformLastNameOpts(nil, nil, nil)
+ }
+ return NewTransformLastNameOpts(
+ maxLength,
+ config.PreserveLength,
+ nil,
+ )
+}
+
func (t *TransformLastName) Transform(value, opts any) (any, error) {
parsedOpts, ok := opts.(*TransformLastNameOpts)
if !ok {
diff --git a/worker/pkg/benthos/transformers/transform_lastname_test.go b/worker/pkg/benthos/transformers/transform_lastname_test.go
index 4297a60dc4..853fdf6dbf 100644
--- a/worker/pkg/benthos/transformers/transform_lastname_test.go
+++ b/worker/pkg/benthos/transformers/transform_lastname_test.go
@@ -92,3 +92,13 @@ func Test_TransformLastNameTransformerWithEmptyValue(t *testing.T) {
_, err = ex.Query(nil)
assert.NoError(t, err)
}
+
+func Test_TransformLastNameTransformer_NoOptions(t *testing.T) {
+ mapping := fmt.Sprintf(`root = transform_last_name(value:%q)`, "lastname")
+ ex, err := bloblang.Parse(mapping)
+ assert.NoError(t, err, "failed to parse the last name transformer")
+
+ res, err := ex.Query(nil)
+ assert.NoError(t, err)
+ assert.NotEmpty(t, res)
+}
diff --git a/worker/pkg/benthos/transformers/transform_string.go b/worker/pkg/benthos/transformers/transform_string.go
index 7ed06b21e4..f18e246c25 100644
--- a/worker/pkg/benthos/transformers/transform_string.go
+++ b/worker/pkg/benthos/transformers/transform_string.go
@@ -4,6 +4,7 @@ import (
"errors"
"fmt"
+ mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
"github.com/warpstreamlabs/bento/public/bloblang"
@@ -17,7 +18,7 @@ func init() {
Param(bloblang.NewAnyParam("value").Optional()).
Param(bloblang.NewBoolParam("preserve_length").Default(false).Description("Whether the original length of the input data should be preserved during transformation. If set to true, the transformation logic will ensure that the output data has the same length as the input data.")).
Param(bloblang.NewInt64Param("min_length").Default(1).Description("Specifies the minimum length of the transformed value.")).
- Param(bloblang.NewInt64Param("max_length").Default(20).Description("Specifies the maximum length of the transformed value.")).
+ Param(bloblang.NewInt64Param("max_length").Default(100).Description("Specifies the maximum length of the transformed value.")).
Param(bloblang.NewInt64Param("seed").Optional().Description("An optional seed value used to generate deterministic outputs."))
err := bloblang.RegisterFunctionV2("transform_string", spec, func(args *bloblang.ParsedParams) (bloblang.Function, error) {
@@ -67,6 +68,18 @@ func init() {
}
}
+func NewTransformStringOptsFromConfig(config *mgmtv1alpha1.TransformString, minLength, maxLength *int64) (*TransformStringOpts, error) {
+ if config == nil {
+ return NewTransformStringOpts(nil, nil, nil, nil)
+ }
+ return NewTransformStringOpts(
+ config.PreserveLength,
+ minLength,
+ maxLength,
+ nil,
+ )
+}
+
func (t *TransformString) Transform(value, opts any) (any, error) {
parsedOpts, ok := opts.(*TransformStringOpts)
if !ok {
diff --git a/worker/pkg/benthos/transformers/transform_string_phone_number.go b/worker/pkg/benthos/transformers/transform_string_phone_number.go
index 455f25195a..fce89e77ca 100644
--- a/worker/pkg/benthos/transformers/transform_string_phone_number.go
+++ b/worker/pkg/benthos/transformers/transform_string_phone_number.go
@@ -4,6 +4,7 @@ import (
"errors"
"fmt"
+ mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
"github.com/nucleuscloud/neosync/worker/pkg/rng"
"github.com/warpstreamlabs/bento/public/bloblang"
@@ -15,8 +16,8 @@ func init() {
spec := bloblang.NewPluginSpec().
Description("Anonymizes and transforms an existing phone number that is typed as a string.").
Param(bloblang.NewAnyParam("value").Optional()).
- Param(bloblang.NewBoolParam("preserve_length").Description("Whether the original length of the input data should be preserved during transformation. If set to true, the transformation logic will ensure that the output data has the same length as the input data.")).
- Param(bloblang.NewInt64Param("max_length").Description("Specifies the maximum length for the transformed data. This field ensures that the output does not exceed a certain number of characters.")).
+ Param(bloblang.NewBoolParam("preserve_length").Default(false).Description("Whether the original length of the input data should be preserved during transformation. If set to true, the transformation logic will ensure that the output data has the same length as the input data.")).
+ Param(bloblang.NewInt64Param("max_length").Default(100).Description("Specifies the maximum length for the transformed data. This field ensures that the output does not exceed a certain number of characters.")).
Param(bloblang.NewInt64Param("seed").Optional().Description("An optional seed value used to generate deterministic outputs."))
err := bloblang.RegisterFunctionV2("transform_phone_number", spec, func(args *bloblang.ParsedParams) (bloblang.Function, error) {
@@ -61,6 +62,16 @@ func init() {
}
}
+func NewTransformStringPhoneNumberOptsFromConfig(config *mgmtv1alpha1.TransformPhoneNumber, maxLength *int64) (*TransformStringPhoneNumberOpts, error) {
+ if config == nil {
+ return NewTransformStringPhoneNumberOpts(nil, nil, nil)
+ }
+ return NewTransformStringPhoneNumberOpts(
+ config.PreserveLength,
+ maxLength, nil,
+ )
+}
+
func (t *TransformStringPhoneNumber) Transform(value, opts any) (any, error) {
parsedOpts, ok := opts.(*TransformStringPhoneNumberOpts)
if !ok {
diff --git a/worker/pkg/benthos/transformers/transform_string_phone_number_test.go b/worker/pkg/benthos/transformers/transform_string_phone_number_test.go
index 20f6467eb6..4e2d308cd0 100644
--- a/worker/pkg/benthos/transformers/transform_string_phone_number_test.go
+++ b/worker/pkg/benthos/transformers/transform_string_phone_number_test.go
@@ -58,3 +58,13 @@ func Test_TransformStringPhoneNumberTransformerWithEmptyValue(t *testing.T) {
_, err = ex.Query(nil)
assert.NoError(t, err)
}
+
+func Test_TransformStringPhoneNumberTransformer_NoOptions(t *testing.T) {
+ mapping := fmt.Sprintf(`root = transform_phone_number(value:%q)`, testPhone)
+ ex, err := bloblang.Parse(mapping)
+ assert.NoError(t, err, "failed to parse the transform phone transformer")
+
+ res, err := ex.Query(nil)
+ assert.NoError(t, err)
+ assert.NotEmpty(t, res)
+}
diff --git a/worker/pkg/benthos/transformers/transform_string_test.go b/worker/pkg/benthos/transformers/transform_string_test.go
index 38aa9ea75c..c0fa7fab8c 100644
--- a/worker/pkg/benthos/transformers/transform_string_test.go
+++ b/worker/pkg/benthos/transformers/transform_string_test.go
@@ -68,3 +68,13 @@ func Test_TransformStringTransformerWithEmptyValue(t *testing.T) {
_, err = ex.Query(nil)
assert.NoError(t, err)
}
+
+func Test_TransformStringTransformer_NoOptions(t *testing.T) {
+ mapping := fmt.Sprintf(`root = transform_string(value:%q)`, testStringValue)
+ ex, err := bloblang.Parse(mapping)
+ assert.NoError(t, err, "failed to parse the email transformer")
+
+ res, err := ex.Query(nil)
+ assert.NoError(t, err)
+ assert.NotEmpty(t, res)
+}
diff --git a/worker/pkg/benthos/transformers/transformer_initializer.go b/worker/pkg/benthos/transformers/transformer_initializer.go
index 96a0eb909f..e6999a3404 100644
--- a/worker/pkg/benthos/transformers/transformer_initializer.go
+++ b/worker/pkg/benthos/transformers/transformer_initializer.go
@@ -8,7 +8,6 @@ import (
mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
presidioapi "github.com/nucleuscloud/neosync/internal/ee/presidio"
ee_transformer_fns "github.com/nucleuscloud/neosync/internal/ee/transformers/functions"
- transformer_utils "github.com/nucleuscloud/neosync/worker/pkg/benthos/transformers/utils"
)
type TransformerExecutor struct {
@@ -46,7 +45,7 @@ func InitializeTransformerByConfigType(transformerConfig *mgmtv1alpha1.Transform
opt(execCfg)
}
- maxLength := int64(10000) // TODO: update this based on colInfo if available
+ maxLength := int64(100) // TODO: update this based on colInfo if available
switch transformerConfig.GetConfig().(type) {
case *mgmtv1alpha1.TransformerConfig_PassthroughConfig:
return &TransformerExecutor{
@@ -56,8 +55,8 @@ func InitializeTransformerByConfigType(transformerConfig *mgmtv1alpha1.Transform
},
}, nil
case *mgmtv1alpha1.TransformerConfig_GenerateCategoricalConfig:
- categories := transformerConfig.GetGenerateCategoricalConfig().GetCategories()
- opts, err := NewGenerateCategoricalOpts(categories, nil)
+ config := transformerConfig.GetGenerateCategoricalConfig()
+ opts, err := NewGenerateCategoricalOptsFromConfig(config)
if err != nil {
return nil, err
}
@@ -70,7 +69,8 @@ func InitializeTransformerByConfigType(transformerConfig *mgmtv1alpha1.Transform
}, nil
case *mgmtv1alpha1.TransformerConfig_GenerateBoolConfig:
- opts, err := NewGenerateBoolOpts(nil)
+ config := transformerConfig.GetGenerateBoolConfig()
+ opts, err := NewGenerateBoolOptsFromConfig(config)
if err != nil {
return nil, err
}
@@ -83,9 +83,9 @@ func InitializeTransformerByConfigType(transformerConfig *mgmtv1alpha1.Transform
}, nil
case *mgmtv1alpha1.TransformerConfig_TransformStringConfig:
- pl := transformerConfig.GetTransformStringConfig().GetPreserveLength()
+ config := transformerConfig.GetTransformStringConfig()
minLength := int64(3) // TODO: pull this value from the database schema
- opts, err := NewTransformStringOpts(&pl, &minLength, &maxLength, nil)
+ opts, err := NewTransformStringOptsFromConfig(config, &minLength, &maxLength)
if err != nil {
return nil, err
}
@@ -97,9 +97,8 @@ func InitializeTransformerByConfigType(transformerConfig *mgmtv1alpha1.Transform
},
}, nil
case *mgmtv1alpha1.TransformerConfig_TransformInt64Config:
- rMin := transformerConfig.GetTransformInt64Config().GetRandomizationRangeMin()
- rMax := transformerConfig.GetTransformInt64Config().GetRandomizationRangeMax()
- opts, err := NewTransformInt64Opts(rMin, rMax, nil)
+ config := transformerConfig.GetTransformInt64Config()
+ opts, err := NewTransformInt64OptsFromConfig(config)
if err != nil {
return nil, err
}
@@ -112,8 +111,8 @@ func InitializeTransformerByConfigType(transformerConfig *mgmtv1alpha1.Transform
}, nil
case *mgmtv1alpha1.TransformerConfig_TransformFullNameConfig:
- pl := transformerConfig.GetTransformFullNameConfig().GetPreserveLength()
- opts, err := NewTransformFullNameOpts(&maxLength, &pl, nil)
+ config := transformerConfig.GetTransformFullNameConfig()
+ opts, err := NewTransformFullNameOptsFromConfig(config, &maxLength)
if err != nil {
return nil, err
}
@@ -127,12 +126,7 @@ func InitializeTransformerByConfigType(transformerConfig *mgmtv1alpha1.Transform
case *mgmtv1alpha1.TransformerConfig_GenerateEmailConfig:
config := transformerConfig.GetGenerateEmailConfig()
- var emailType *string
- if config.EmailType != nil {
- emailTypeStr := config.GetEmailType().String()
- emailType = &emailTypeStr
- }
- opts, err := NewGenerateEmailOpts(&maxLength, emailType, nil)
+ opts, err := NewGenerateEmailOptsFromConfig(config, &maxLength)
if err != nil {
return nil, err
}
@@ -146,26 +140,7 @@ func InitializeTransformerByConfigType(transformerConfig *mgmtv1alpha1.Transform
case *mgmtv1alpha1.TransformerConfig_TransformEmailConfig:
config := transformerConfig.GetTransformEmailConfig()
- var emailType *string
- if config.EmailType != nil {
- emailTypeStr := config.GetEmailType().String()
- emailType = &emailTypeStr
- }
- var invalidEmailAction *string
- if config.InvalidEmailAction != nil {
- invalidEmailActionStr := config.GetInvalidEmailAction().String()
- invalidEmailAction = &invalidEmailActionStr
- }
- var excludedDomains any = config.GetExcludedDomains()
- opts, err := NewTransformEmailOpts(
- &config.PreserveDomain,
- &config.PreserveLength,
- &excludedDomains,
- &maxLength,
- nil,
- emailType,
- invalidEmailAction,
- )
+ opts, err := NewTransformEmailOptsFromConfig(config, &maxLength)
if err != nil {
return nil, err
}
@@ -178,8 +153,8 @@ func InitializeTransformerByConfigType(transformerConfig *mgmtv1alpha1.Transform
}, nil
case *mgmtv1alpha1.TransformerConfig_GenerateCardNumberConfig:
- luhn := transformerConfig.GetGenerateCardNumberConfig().GetValidLuhn()
- opts, err := NewGenerateCardNumberOpts(luhn, nil)
+ config := transformerConfig.GetGenerateCardNumberConfig()
+ opts, err := NewGenerateCardNumberOptsFromConfig(config)
if err != nil {
return nil, err
}
@@ -192,7 +167,8 @@ func InitializeTransformerByConfigType(transformerConfig *mgmtv1alpha1.Transform
}, nil
case *mgmtv1alpha1.TransformerConfig_GenerateCityConfig:
- opts, err := NewGenerateCityOpts(maxLength, nil)
+ config := transformerConfig.GetGenerateCityConfig()
+ opts, err := NewGenerateCityOptsFromConfig(config, &maxLength)
if err != nil {
return nil, err
}
@@ -205,9 +181,8 @@ func InitializeTransformerByConfigType(transformerConfig *mgmtv1alpha1.Transform
}, nil
case *mgmtv1alpha1.TransformerConfig_GenerateE164PhoneNumberConfig:
- minValue := transformerConfig.GetGenerateE164PhoneNumberConfig().GetMin()
- maxValue := transformerConfig.GetGenerateE164PhoneNumberConfig().GetMax()
- opts, err := NewGenerateInternationalPhoneNumberOpts(minValue, maxValue, nil)
+ config := transformerConfig.GetGenerateE164PhoneNumberConfig()
+ opts, err := NewGenerateInternationalPhoneNumberOptsFromConfig(config)
if err != nil {
return nil, err
}
@@ -219,7 +194,8 @@ func InitializeTransformerByConfigType(transformerConfig *mgmtv1alpha1.Transform
},
}, nil
case *mgmtv1alpha1.TransformerConfig_GenerateFirstNameConfig:
- opts, err := NewGenerateFirstNameOpts(&maxLength, nil)
+ config := transformerConfig.GetGenerateFirstNameConfig()
+ opts, err := NewGenerateFirstNameOptsFromConfig(config, &maxLength)
if err != nil {
return nil, err
}
@@ -233,14 +209,7 @@ func InitializeTransformerByConfigType(transformerConfig *mgmtv1alpha1.Transform
case *mgmtv1alpha1.TransformerConfig_GenerateFloat64Config:
config := transformerConfig.GetGenerateFloat64Config()
- opts, err := NewGenerateFloat64Opts(
- &config.RandomizeSign,
- config.GetMin(),
- config.GetMax(),
- &config.Precision,
- nil, // TODO: update scale based on colInfo if available
- nil,
- )
+ opts, err := NewGenerateFloat64OptsFromConfig(config, nil)
if err != nil {
return nil, err
}
@@ -253,7 +222,8 @@ func InitializeTransformerByConfigType(transformerConfig *mgmtv1alpha1.Transform
}, nil
case *mgmtv1alpha1.TransformerConfig_GenerateFullAddressConfig:
- opts, err := NewGenerateFullAddressOpts(maxLength, nil)
+ config := transformerConfig.GetGenerateFullAddressConfig()
+ opts, err := NewGenerateFullAddressOptsFromConfig(config, &maxLength)
if err != nil {
return nil, err
}
@@ -266,7 +236,8 @@ func InitializeTransformerByConfigType(transformerConfig *mgmtv1alpha1.Transform
}, nil
case *mgmtv1alpha1.TransformerConfig_GenerateFullNameConfig:
- opts, err := NewGenerateFullNameOpts(&maxLength, nil)
+ config := transformerConfig.GetGenerateFullNameConfig()
+ opts, err := NewGenerateFullNameOptsFromConfig(config, &maxLength)
if err != nil {
return nil, err
}
@@ -279,8 +250,8 @@ func InitializeTransformerByConfigType(transformerConfig *mgmtv1alpha1.Transform
}, nil
case *mgmtv1alpha1.TransformerConfig_GenerateGenderConfig:
- ab := transformerConfig.GetGenerateGenderConfig().GetAbbreviate()
- opts, err := NewGenerateGenderOpts(&ab, &maxLength, nil)
+ config := transformerConfig.GetGenerateGenderConfig()
+ opts, err := NewGenerateGenderOptsFromConfig(config, &maxLength)
if err != nil {
return nil, err
}
@@ -293,7 +264,8 @@ func InitializeTransformerByConfigType(transformerConfig *mgmtv1alpha1.Transform
}, nil
case *mgmtv1alpha1.TransformerConfig_GenerateInt64PhoneNumberConfig:
- opts, err := NewGenerateInt64PhoneNumberOpts(nil)
+ config := transformerConfig.GetGenerateInt64PhoneNumberConfig()
+ opts, err := NewGenerateInt64PhoneNumberOptsFromConfig(config)
if err != nil {
return nil, err
}
@@ -307,7 +279,7 @@ func InitializeTransformerByConfigType(transformerConfig *mgmtv1alpha1.Transform
case *mgmtv1alpha1.TransformerConfig_GenerateInt64Config:
config := transformerConfig.GetGenerateInt64Config()
- opts, err := NewGenerateInt64Opts(&config.RandomizeSign, config.GetMin(), config.GetMax(), nil)
+ opts, err := NewGenerateInt64OptsFromConfig(config)
if err != nil {
return nil, err
}
@@ -320,7 +292,8 @@ func InitializeTransformerByConfigType(transformerConfig *mgmtv1alpha1.Transform
}, nil
case *mgmtv1alpha1.TransformerConfig_GenerateLastNameConfig:
- opts, err := NewGenerateLastNameOpts(&maxLength, nil)
+ config := transformerConfig.GetGenerateLastNameConfig()
+ opts, err := NewGenerateLastNameOptsFromConfig(config, &maxLength)
if err != nil {
return nil, err
}
@@ -333,7 +306,8 @@ func InitializeTransformerByConfigType(transformerConfig *mgmtv1alpha1.Transform
}, nil
case *mgmtv1alpha1.TransformerConfig_GenerateSha256HashConfig:
- opts, err := NewGenerateSHA256HashOpts()
+ config := transformerConfig.GetGenerateSha256HashConfig()
+ opts, err := NewGenerateSHA256HashOptsFromConfig(config)
if err != nil {
return nil, err
}
@@ -346,7 +320,8 @@ func InitializeTransformerByConfigType(transformerConfig *mgmtv1alpha1.Transform
}, nil
case *mgmtv1alpha1.TransformerConfig_GenerateSsnConfig:
- opts, err := NewGenerateSSNOpts(nil)
+ config := transformerConfig.GetGenerateSsnConfig()
+ opts, err := NewGenerateSSNOptsFromConfig(config)
if err != nil {
return nil, err
}
@@ -359,8 +334,8 @@ func InitializeTransformerByConfigType(transformerConfig *mgmtv1alpha1.Transform
}, nil
case *mgmtv1alpha1.TransformerConfig_GenerateStateConfig:
- generateFullName := transformerConfig.GetGenerateStateConfig().GetGenerateFullName()
- opts, err := NewGenerateStateOpts(&generateFullName, nil)
+ config := transformerConfig.GetGenerateStateConfig()
+ opts, err := NewGenerateStateOptsFromConfig(config)
if err != nil {
return nil, err
}
@@ -373,7 +348,8 @@ func InitializeTransformerByConfigType(transformerConfig *mgmtv1alpha1.Transform
}, nil
case *mgmtv1alpha1.TransformerConfig_GenerateStreetAddressConfig:
- opts, err := NewGenerateStreetAddressOpts(maxLength, nil)
+ config := transformerConfig.GetGenerateStreetAddressConfig()
+ opts, err := NewGenerateStreetAddressOptsFromConfig(config, &maxLength)
if err != nil {
return nil, err
}
@@ -386,11 +362,8 @@ func InitializeTransformerByConfigType(transformerConfig *mgmtv1alpha1.Transform
}, nil
case *mgmtv1alpha1.TransformerConfig_GenerateStringPhoneNumberConfig:
- minValue := transformerConfig.GetGenerateStringPhoneNumberConfig().GetMin()
- maxValue := transformerConfig.GetGenerateStringPhoneNumberConfig().GetMax()
- minValue = transformer_utils.MinInt(minValue, maxLength)
- maxValue = transformer_utils.Ceil(maxValue, maxLength)
- opts, err := NewGenerateStringPhoneNumberOpts(minValue, maxValue, nil)
+ config := transformerConfig.GetGenerateStringPhoneNumberConfig()
+ opts, err := NewGenerateStringPhoneNumberOptsFromConfig(config)
if err != nil {
return nil, err
}
@@ -404,7 +377,7 @@ func InitializeTransformerByConfigType(transformerConfig *mgmtv1alpha1.Transform
case *mgmtv1alpha1.TransformerConfig_GenerateStringConfig:
config := transformerConfig.GetGenerateStringConfig()
- opts, err := NewGenerateRandomStringOpts(config.GetMin(), config.GetMax(), nil)
+ opts, err := NewGenerateRandomStringOptsFromConfig(config, &maxLength)
if err != nil {
return nil, err
}
@@ -417,7 +390,8 @@ func InitializeTransformerByConfigType(transformerConfig *mgmtv1alpha1.Transform
}, nil
case *mgmtv1alpha1.TransformerConfig_GenerateUnixtimestampConfig:
- opts, err := NewGenerateUnixTimestampOpts(nil)
+ config := transformerConfig.GetGenerateUnixtimestampConfig()
+ opts, err := NewGenerateUnixTimestampOptsFromConfig(config)
if err != nil {
return nil, err
}
@@ -430,7 +404,8 @@ func InitializeTransformerByConfigType(transformerConfig *mgmtv1alpha1.Transform
}, nil
case *mgmtv1alpha1.TransformerConfig_GenerateUsernameConfig:
- opts, err := NewGenerateUsernameOpts(&maxLength, nil)
+ config := transformerConfig.GetGenerateUsernameConfig()
+ opts, err := NewGenerateUsernameOptsFromConfig(config, &maxLength)
if err != nil {
return nil, err
}
@@ -443,7 +418,8 @@ func InitializeTransformerByConfigType(transformerConfig *mgmtv1alpha1.Transform
}, nil
case *mgmtv1alpha1.TransformerConfig_GenerateUtctimestampConfig:
- opts, err := NewGenerateUTCTimestampOpts(nil)
+ config := transformerConfig.GetGenerateUtctimestampConfig()
+ opts, err := NewGenerateUTCTimestampOptsFromConfig(config)
if err != nil {
return nil, err
}
@@ -456,8 +432,8 @@ func InitializeTransformerByConfigType(transformerConfig *mgmtv1alpha1.Transform
}, nil
case *mgmtv1alpha1.TransformerConfig_GenerateUuidConfig:
- ih := transformerConfig.GetGenerateUuidConfig().GetIncludeHyphens()
- opts, err := NewGenerateUUIDOpts(&ih)
+ config := transformerConfig.GetGenerateUuidConfig()
+ opts, err := NewGenerateUUIDOptsFromConfig(config)
if err != nil {
return nil, err
}
@@ -470,7 +446,8 @@ func InitializeTransformerByConfigType(transformerConfig *mgmtv1alpha1.Transform
}, nil
case *mgmtv1alpha1.TransformerConfig_GenerateZipcodeConfig:
- opts, err := NewGenerateZipcodeOpts(nil)
+ config := transformerConfig.GetGenerateZipcodeConfig()
+ opts, err := NewGenerateZipcodeOptsFromConfig(config)
if err != nil {
return nil, err
}
@@ -484,7 +461,7 @@ func InitializeTransformerByConfigType(transformerConfig *mgmtv1alpha1.Transform
case *mgmtv1alpha1.TransformerConfig_TransformE164PhoneNumberConfig:
config := transformerConfig.GetTransformE164PhoneNumberConfig()
- opts, err := NewTransformE164PhoneNumberOpts(config.GetPreserveLength(), &maxLength, nil)
+ opts, err := NewTransformE164PhoneNumberOptsFromConfig(config, nil)
if err != nil {
return nil, err
}
@@ -498,7 +475,7 @@ func InitializeTransformerByConfigType(transformerConfig *mgmtv1alpha1.Transform
case *mgmtv1alpha1.TransformerConfig_TransformFirstNameConfig:
config := transformerConfig.GetTransformFirstNameConfig()
- opts, err := NewTransformFirstNameOpts(&maxLength, &config.PreserveLength, nil)
+ opts, err := NewTransformFirstNameOptsFromConfig(config, &maxLength)
if err != nil {
return nil, err
}
@@ -512,13 +489,7 @@ func InitializeTransformerByConfigType(transformerConfig *mgmtv1alpha1.Transform
case *mgmtv1alpha1.TransformerConfig_TransformFloat64Config:
config := transformerConfig.GetTransformFloat64Config()
- opts, err := NewTransformFloat64Opts(
- config.GetRandomizationRangeMin(),
- config.GetRandomizationRangeMax(),
- nil, // TODO: update precision based on colInfo if available
- nil, // TODO: update scale based on colInfo if available
- nil,
- )
+ opts, err := NewTransformFloat64OptsFromConfig(config, nil, nil)
if err != nil {
return nil, err
}
@@ -532,7 +503,7 @@ func InitializeTransformerByConfigType(transformerConfig *mgmtv1alpha1.Transform
case *mgmtv1alpha1.TransformerConfig_TransformInt64PhoneNumberConfig:
config := transformerConfig.GetTransformInt64PhoneNumberConfig()
- opts, err := NewTransformInt64PhoneNumberOpts(config.GetPreserveLength(), nil)
+ opts, err := NewTransformInt64PhoneNumberOptsFromConfig(config)
if err != nil {
return nil, err
}
@@ -546,7 +517,7 @@ func InitializeTransformerByConfigType(transformerConfig *mgmtv1alpha1.Transform
case *mgmtv1alpha1.TransformerConfig_TransformLastNameConfig:
config := transformerConfig.GetTransformLastNameConfig()
- opts, err := NewTransformLastNameOpts(&maxLength, &config.PreserveLength, nil)
+ opts, err := NewTransformLastNameOptsFromConfig(config, &maxLength)
if err != nil {
return nil, err
}
@@ -560,7 +531,7 @@ func InitializeTransformerByConfigType(transformerConfig *mgmtv1alpha1.Transform
case *mgmtv1alpha1.TransformerConfig_TransformPhoneNumberConfig:
config := transformerConfig.GetTransformPhoneNumberConfig()
- opts, err := NewTransformStringPhoneNumberOpts(config.GetPreserveLength(), maxLength, nil)
+ opts, err := NewTransformStringPhoneNumberOptsFromConfig(config, &maxLength)
if err != nil {
return nil, err
}
@@ -590,7 +561,7 @@ func InitializeTransformerByConfigType(transformerConfig *mgmtv1alpha1.Transform
case *mgmtv1alpha1.TransformerConfig_TransformCharacterScrambleConfig:
config := transformerConfig.GetTransformCharacterScrambleConfig()
- opts, err := NewTransformCharacterScrambleOpts(config.UserProvidedRegex, nil)
+ opts, err := NewTransformCharacterScrambleOptsFromConfig(config)
if err != nil {
return nil, err
}
@@ -603,8 +574,8 @@ func InitializeTransformerByConfigType(transformerConfig *mgmtv1alpha1.Transform
}, nil
case *mgmtv1alpha1.TransformerConfig_GenerateCountryConfig:
- generateFullName := transformerConfig.GetGenerateCountryConfig().GenerateFullName
- opts, err := NewGenerateCountryOpts(&generateFullName, nil)
+ config := transformerConfig.GetGenerateCountryConfig()
+ opts, err := NewGenerateCountryOptsFromConfig(config)
if err != nil {
return nil, err
}
diff --git a/worker/pkg/benthos/transformers/transformer_initializer_test.go b/worker/pkg/benthos/transformers/transformer_initializer_test.go
new file mode 100644
index 0000000000..153fc346fe
--- /dev/null
+++ b/worker/pkg/benthos/transformers/transformer_initializer_test.go
@@ -0,0 +1,1624 @@
+package transformers
+
+import (
+ "strconv"
+ "testing"
+ "time"
+
+ mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
+ presidioapi "github.com/nucleuscloud/neosync/internal/ee/presidio"
+ "github.com/stretchr/testify/mock"
+ "github.com/stretchr/testify/require"
+)
+
+func Test_InitializeTransformerByConfigType(t *testing.T) {
+ t.Run("PassthroughConfig", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_PassthroughConfig{},
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate("test", nil)
+ require.NoError(t, err)
+ require.Equal(t, "test", result)
+ })
+
+ t.Run("GenerateCategoricalConfig", func(t *testing.T) {
+ categories := "A,B,C"
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateCategoricalConfig{
+ GenerateCategoricalConfig: &mgmtv1alpha1.GenerateCategorical{
+ Categories: &categories,
+ },
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.Contains(t, []string{"A", "B", "C"}, result)
+ })
+
+ t.Run("GenerateCategoricalConfig_Empty", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateCategoricalConfig{
+ GenerateCategoricalConfig: &mgmtv1alpha1.GenerateCategorical{},
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("GenerateCategoricalConfig_Nil", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateCategoricalConfig{},
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("GenerateBoolConfig", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateBoolConfig{},
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, bool(true), result)
+ })
+
+ t.Run("GenerateBoolConfig_Nil", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateBoolConfig{},
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, bool(true), result)
+ })
+
+ t.Run("TransformStringConfig", func(t *testing.T) {
+ preserveLength := true
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_TransformStringConfig{
+ TransformStringConfig: &mgmtv1alpha1.TransformString{
+ PreserveLength: &preserveLength,
+ },
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate("test", executor.Opts)
+ require.NoError(t, err)
+ require.Len(t, *result.(*string), 4)
+ })
+
+ t.Run("TransformStringConfig_Empty", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_TransformStringConfig{
+ TransformStringConfig: &mgmtv1alpha1.TransformString{},
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate("test", executor.Opts)
+ require.NoError(t, err)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("TransformStringConfig_Nil", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_TransformStringConfig{},
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate("test", executor.Opts)
+ require.NoError(t, err)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("TransformInt64Config", func(t *testing.T) {
+ rmin, rmax := int64(1), int64(5)
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_TransformInt64Config{
+ TransformInt64Config: &mgmtv1alpha1.TransformInt64{
+ RandomizationRangeMin: &rmin,
+ RandomizationRangeMax: &rmax,
+ },
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(int64(50), executor.Opts)
+ require.NoError(t, err)
+ require.GreaterOrEqual(t, *result.(*int64), int64(48))
+ require.LessOrEqual(t, *result.(*int64), int64(55))
+ })
+
+ t.Run("TransformInt64Config_Empty", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_TransformInt64Config{
+ TransformInt64Config: &mgmtv1alpha1.TransformInt64{},
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(int64(50), executor.Opts)
+ require.NoError(t, err)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("TransformInt64Config_Nil", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_TransformInt64Config{},
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(int64(50), executor.Opts)
+ require.NoError(t, err)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("TransformFullNameConfig", func(t *testing.T) {
+ preserveLength := true
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_TransformFullNameConfig{
+ TransformFullNameConfig: &mgmtv1alpha1.TransformFullName{
+ PreserveLength: &preserveLength,
+ },
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate("John Doe", executor.Opts)
+ require.NoError(t, err)
+ require.Len(t, *result.(*string), 8)
+ })
+ t.Run("TransformFullNameConfig_Empty", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_TransformFullNameConfig{
+ TransformFullNameConfig: &mgmtv1alpha1.TransformFullName{},
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate("John Doe", executor.Opts)
+ require.NoError(t, err)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("TransformFullNameConfig_Nil", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_TransformFullNameConfig{},
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate("John Doe", executor.Opts)
+ require.NoError(t, err)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("GenerateEmailConfig", func(t *testing.T) {
+ emailType := mgmtv1alpha1.GenerateEmailType_GENERATE_EMAIL_TYPE_FULLNAME
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateEmailConfig{
+ GenerateEmailConfig: &mgmtv1alpha1.GenerateEmail{
+ EmailType: &emailType,
+ },
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("GenerateEmailConfig_Empty", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateEmailConfig{
+ GenerateEmailConfig: &mgmtv1alpha1.GenerateEmail{},
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("GenerateEmailConfig_Nil", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateEmailConfig{},
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("TransformEmailConfig", func(t *testing.T) {
+ preserve := true
+ emailType := mgmtv1alpha1.GenerateEmailType_GENERATE_EMAIL_TYPE_FULLNAME
+ invalidEmailAction := mgmtv1alpha1.InvalidEmailAction_INVALID_EMAIL_ACTION_GENERATE
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_TransformEmailConfig{
+ TransformEmailConfig: &mgmtv1alpha1.TransformEmail{
+ PreserveDomain: &preserve,
+ PreserveLength: &preserve,
+ EmailType: &emailType,
+ InvalidEmailAction: &invalidEmailAction,
+ ExcludedDomains: []string{"gmail", "yahoo"},
+ },
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate("test@example.com", executor.Opts)
+ require.NoError(t, err)
+ require.Regexp(t, `^[a-zA-Z0-9._%+-]+@example\.com$`, *result.(*string))
+ require.Len(t, *result.(*string), 16)
+ })
+
+ t.Run("TransformEmailConfig_Empty", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_TransformEmailConfig{
+ TransformEmailConfig: &mgmtv1alpha1.TransformEmail{},
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate("test@example.com", executor.Opts)
+ require.NoError(t, err)
+ require.NotEmpty(t, result)
+ })
+ t.Run("TransformEmailConfig_Nil", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_TransformEmailConfig{
+ TransformEmailConfig: &mgmtv1alpha1.TransformEmail{},
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate("test@example.com", executor.Opts)
+ require.NoError(t, err)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("GenerateCardNumberConfig", func(t *testing.T) {
+ valid := true
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateCardNumberConfig{
+ GenerateCardNumberConfig: &mgmtv1alpha1.GenerateCardNumber{
+ ValidLuhn: &valid,
+ },
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.Regexp(t, `^\d{13,19}$`, result)
+ })
+
+ t.Run("GenerateCardNumber_Empty", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateCardNumberConfig{
+ GenerateCardNumberConfig: &mgmtv1alpha1.GenerateCardNumber{},
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.Regexp(t, `^\d{13,19}$`, result)
+ })
+
+ t.Run("GenerateCardNumber_Nil", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateCardNumberConfig{
+ GenerateCardNumberConfig: &mgmtv1alpha1.GenerateCardNumber{},
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.Regexp(t, `^\d{13,19}$`, result)
+ })
+
+ t.Run("GenerateCityConfig_Empty", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateCityConfig{
+ GenerateCityConfig: &mgmtv1alpha1.GenerateCity{},
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, "", result)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("GenerateCityConfig_Nil", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateCityConfig{},
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, "", result)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("GenerateInternationalPhoneNumberConfig", func(t *testing.T) {
+ rmin, rmax := int64(10), int64(10)
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateE164PhoneNumberConfig{
+ GenerateE164PhoneNumberConfig: &mgmtv1alpha1.GenerateE164PhoneNumber{
+ Min: &rmin,
+ Max: &rmax,
+ },
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.Regexp(t, `^\+\d{10}$`, result)
+ })
+
+ t.Run("GenerateInternationPhoneNumberConfig_Empty", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateE164PhoneNumberConfig{
+ GenerateE164PhoneNumberConfig: &mgmtv1alpha1.GenerateE164PhoneNumber{},
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("GenerateInternationPhoneNumberConfig_Nil", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateE164PhoneNumberConfig{},
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("GenerateFirstNameConfig_Empty", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateFirstNameConfig{
+ GenerateFirstNameConfig: &mgmtv1alpha1.GenerateFirstName{},
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, "", result)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("GenerateFirstNameConfig_Nil", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateFirstNameConfig{},
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, "", result)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("GenerateFloat64Config", func(t *testing.T) {
+ randomizeSign := true
+ rmin, rmax := float64(-10), float64(10)
+ precision := int64(2)
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateFloat64Config{
+ GenerateFloat64Config: &mgmtv1alpha1.GenerateFloat64{
+ RandomizeSign: &randomizeSign,
+ Min: &rmin,
+ Max: &rmax,
+ Precision: &precision,
+ },
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, float64(0), result)
+ floatResult := result.(float64)
+ require.GreaterOrEqual(t, floatResult, rmin)
+ require.LessOrEqual(t, floatResult, rmax)
+ })
+
+ t.Run("GenerateFloat64Config_Empty", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateFloat64Config{
+ GenerateFloat64Config: &mgmtv1alpha1.GenerateFloat64{},
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, float64(0), result)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("GenerateFloat64Config_Nil", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateFloat64Config{},
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, float64(0), result)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("GenerateFullAddressConfig_Empty", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateFullAddressConfig{
+ GenerateFullAddressConfig: &mgmtv1alpha1.GenerateFullAddress{},
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, "", result)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("GenerateFullAddressConfig_Nil", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateFullAddressConfig{},
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, "", result)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("GenerateFullNameConfig_Empty", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateFullNameConfig{
+ GenerateFullNameConfig: &mgmtv1alpha1.GenerateFullName{},
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, "", result)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("GenerateFullNameConfig_Nil", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateFullNameConfig{},
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, "", result)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("GenerateGenderConfig", func(t *testing.T) {
+ abb := true
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateGenderConfig{
+ GenerateGenderConfig: &mgmtv1alpha1.GenerateGender{
+ Abbreviate: &abb,
+ },
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, "", result)
+ require.NotEmpty(t, result)
+ require.Len(t, result, 1)
+ })
+
+ t.Run("GenerateGenderConfig_Empty", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateGenderConfig{
+ GenerateGenderConfig: &mgmtv1alpha1.GenerateGender{},
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, "", result)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("GenerateGenderConfig_Nil", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateGenderConfig{},
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, "", result)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("GenerateInt64PhoneNumberConfig_Empty", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateInt64PhoneNumberConfig{
+ GenerateInt64PhoneNumberConfig: &mgmtv1alpha1.GenerateInt64PhoneNumber{},
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, int64(0), result)
+ require.Regexp(t, `^[1-9]\d{9}$`, strconv.FormatInt(result.(int64), 10))
+ })
+
+ t.Run("GenerateInt64PhoneNumberConfig_Nil", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateInt64PhoneNumberConfig{
+ GenerateInt64PhoneNumberConfig: &mgmtv1alpha1.GenerateInt64PhoneNumber{},
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, int64(0), result)
+ require.Regexp(t, `^[1-9]\d{9}$`, strconv.FormatInt(result.(int64), 10))
+ })
+
+ t.Run("GenerateInt64Config", func(t *testing.T) {
+ randomizeSign := true
+ rmin, rmax := int64(-1000), int64(1000)
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateInt64Config{
+ GenerateInt64Config: &mgmtv1alpha1.GenerateInt64{
+ RandomizeSign: &randomizeSign,
+ Min: &rmin,
+ Max: &rmax,
+ },
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, int64(0), result)
+ intResult := result.(int64)
+ require.GreaterOrEqual(t, intResult, rmin)
+ require.LessOrEqual(t, intResult, rmax)
+ })
+
+ t.Run("GenerateInt64Config_Empty", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateInt64Config{
+ GenerateInt64Config: &mgmtv1alpha1.GenerateInt64{},
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, int64(0), result)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("GenerateInt64Config_Nil", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateInt64Config{},
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, int64(0), result)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("GenerateLastNameConfig_Empty", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateLastNameConfig{
+ GenerateLastNameConfig: &mgmtv1alpha1.GenerateLastName{},
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, "", result)
+ require.NotEmpty(t, result)
+ require.Regexp(t, `^[A-Z][a-z]+$`, result)
+ })
+
+ t.Run("GenerateLastNameConfig_Nil", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateLastNameConfig{},
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, "", result)
+ require.NotEmpty(t, result)
+ require.Regexp(t, `^[A-Z][a-z]+$`, result)
+ })
+
+ t.Run("GenerateSha256HashConfig_Empty", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateSha256HashConfig{
+ GenerateSha256HashConfig: &mgmtv1alpha1.GenerateSha256Hash{},
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, "", result)
+ require.Regexp(t, `^[a-f0-9]{64}$`, result)
+ })
+
+ t.Run("GenerateSha256HashConfig_Nil", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateSha256HashConfig{},
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, "", result)
+ require.Regexp(t, `^[a-f0-9]{64}$`, result)
+ })
+
+ t.Run("GenerateSsnConfig_Empty", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateSsnConfig{
+ GenerateSsnConfig: &mgmtv1alpha1.GenerateSSN{},
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, "", result)
+ require.Regexp(t, `^\d{3}-\d{2}-\d{4}$`, result)
+ })
+
+ t.Run("GenerateSsnConfig_Nil", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateSsnConfig{},
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, "", result)
+ require.Regexp(t, `^\d{3}-\d{2}-\d{4}$`, result)
+ })
+
+ t.Run("GenerateStateConfig", func(t *testing.T) {
+ genFullName := true
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateStateConfig{
+ GenerateStateConfig: &mgmtv1alpha1.GenerateState{
+ GenerateFullName: &genFullName,
+ },
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, "", result)
+ require.NotEmpty(t, result)
+ require.Regexp(t, `^[A-Z][a-z]+( [A-Z][a-z]+)*$`, result)
+ })
+
+ t.Run("GenerateStateConfig_Empty", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateStateConfig{
+ GenerateStateConfig: &mgmtv1alpha1.GenerateState{},
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, "", result)
+ require.NotEmpty(t, result)
+ require.Len(t, result, 2)
+ })
+
+ t.Run("GenerateStateConfig_Nil", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateStateConfig{},
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, "", result)
+ require.NotEmpty(t, result)
+ require.Len(t, result, 2)
+ })
+
+ t.Run("GenerateStreetAddressConfig_Empty", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateStreetAddressConfig{
+ GenerateStreetAddressConfig: &mgmtv1alpha1.GenerateStreetAddress{},
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, "", result)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("GenerateStreetAddressConfig_Nil", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateStreetAddressConfig{},
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, "", result)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("GenerateStringPhoneNumberConfig", func(t *testing.T) {
+ rmin, rmax := int64(10), int64(12)
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateStringPhoneNumberConfig{
+ GenerateStringPhoneNumberConfig: &mgmtv1alpha1.GenerateStringPhoneNumber{
+ Min: &rmin,
+ Max: &rmax,
+ },
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, "", result)
+ require.Regexp(t, `^\+?1?\d{10,12}$`, result)
+ })
+
+ t.Run("GenerateStringPhoneNumberConfig_Empty", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateStringPhoneNumberConfig{
+ GenerateStringPhoneNumberConfig: &mgmtv1alpha1.GenerateStringPhoneNumber{},
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, "", result)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("GenerateStringPhoneNumberConfig_Nil", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateStringPhoneNumberConfig{},
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, "", result)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("GenerateStringConfig", func(t *testing.T) {
+ rmin, rmax := int64(5), int64(10)
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateStringConfig{
+ GenerateStringConfig: &mgmtv1alpha1.GenerateString{
+ Min: &rmin,
+ Max: &rmax,
+ },
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, "", result)
+ require.GreaterOrEqual(t, len(result.(string)), int(rmin))
+ require.LessOrEqual(t, len(result.(string)), int(rmax))
+ })
+
+ t.Run("GenerateStringConfig_Empty", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateStringConfig{
+ GenerateStringConfig: &mgmtv1alpha1.GenerateString{},
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, "", result)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("GenerateStringConfig_Nil", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateStringConfig{},
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, "", result)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("GenerateUnixtimestampConfig_Empty", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateUnixtimestampConfig{
+ GenerateUnixtimestampConfig: &mgmtv1alpha1.GenerateUnixTimestamp{},
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, int64(0), result)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("GenerateUnixtimestampConfig_Nil", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateUnixtimestampConfig{},
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, int64(0), result)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("GenerateUsernameConfig_Empty", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateUsernameConfig{
+ GenerateUsernameConfig: &mgmtv1alpha1.GenerateUsername{},
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, "", result)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("GenerateUsernameConfig_Nil", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateUsernameConfig{},
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, "", result)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("GenerateUtctimestampConfig_Empty", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateUtctimestampConfig{
+ GenerateUtctimestampConfig: &mgmtv1alpha1.GenerateUtcTimestamp{},
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, time.Now(), result)
+ })
+
+ t.Run("GenerateUtctimestampConfig_Nil", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateUtctimestampConfig{},
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, time.Now(), result)
+ })
+
+ t.Run("GenerateUuidConfig", func(t *testing.T) {
+ hyphens := false
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateUuidConfig{
+ GenerateUuidConfig: &mgmtv1alpha1.GenerateUuid{
+ IncludeHyphens: &hyphens,
+ },
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, "", result)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("GenerateUuidConfig_Empty", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateUuidConfig{
+ GenerateUuidConfig: &mgmtv1alpha1.GenerateUuid{},
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, "", result)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("GenerateUuidConfig_Nil", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateUuidConfig{},
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, "", result)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("GenerateZipcodeConfig_Empty", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateZipcodeConfig{
+ GenerateZipcodeConfig: &mgmtv1alpha1.GenerateZipcode{},
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, "", result)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("GenerateZipcodeConfig_Nil", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateZipcodeConfig{},
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, "", result)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("TransformE164PhoneNumberConfig", func(t *testing.T) {
+ preserveLength := true
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_TransformE164PhoneNumberConfig{
+ TransformE164PhoneNumberConfig: &mgmtv1alpha1.TransformE164PhoneNumber{
+ PreserveLength: &preserveLength,
+ },
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ originalNumber := "+12345678901"
+ result, err := executor.Mutate(originalNumber, executor.Opts)
+ require.NoError(t, err)
+ require.NotEqual(t, originalNumber, result)
+ require.Equal(t, len(originalNumber), len(*result.(*string)))
+ })
+
+ t.Run("TransformE164PhoneNumberConfig_Empty", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_TransformE164PhoneNumberConfig{
+ TransformE164PhoneNumberConfig: &mgmtv1alpha1.TransformE164PhoneNumber{},
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ originalNumber := "+12345678901"
+ result, err := executor.Mutate(originalNumber, executor.Opts)
+ require.NoError(t, err)
+ require.NotEmpty(t, result)
+ require.NotEqual(t, originalNumber, result)
+ })
+
+ t.Run("TransformE164PhoneNumberConfig_Nil", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_TransformE164PhoneNumberConfig{},
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ originalNumber := "+12345678901"
+ result, err := executor.Mutate(originalNumber, executor.Opts)
+ require.NoError(t, err)
+ require.NotEmpty(t, result)
+ require.NotEqual(t, originalNumber, result)
+ })
+
+ t.Run("TransformFirstNameConfig", func(t *testing.T) {
+ preserveLength := true
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_TransformFirstNameConfig{
+ TransformFirstNameConfig: &mgmtv1alpha1.TransformFirstName{
+ PreserveLength: &preserveLength,
+ },
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ originalName := "John"
+ result, err := executor.Mutate(originalName, executor.Opts)
+ require.NoError(t, err)
+ require.NotEqual(t, originalName, result)
+ require.Equal(t, len(originalName), len(*result.(*string)))
+ })
+
+ t.Run("TransformFirstNameConfig_Empty", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_TransformFirstNameConfig{
+ TransformFirstNameConfig: &mgmtv1alpha1.TransformFirstName{},
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ originalName := "John"
+ result, err := executor.Mutate(originalName, executor.Opts)
+ require.NoError(t, err)
+ require.NotEqual(t, originalName, result)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("TransformFirstNameConfig_Nil", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_TransformFirstNameConfig{},
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ originalName := "John"
+ result, err := executor.Mutate(originalName, executor.Opts)
+ require.NoError(t, err)
+ require.NotEqual(t, originalName, result)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("TransformFloat64Config", func(t *testing.T) {
+ randomizationRangeMin := float64(-10.0)
+ randomizationRangeMax := float64(10.0)
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_TransformFloat64Config{
+ TransformFloat64Config: &mgmtv1alpha1.TransformFloat64{
+ RandomizationRangeMin: &randomizationRangeMin,
+ RandomizationRangeMax: &randomizationRangeMax,
+ },
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ originalValue := float64(5.5)
+ result, err := executor.Mutate(originalValue, executor.Opts)
+ require.NoError(t, err)
+ transformedValue := *result.(*float64)
+ require.NotEqual(t, originalValue, transformedValue)
+ require.GreaterOrEqual(t, transformedValue, originalValue+randomizationRangeMin)
+ require.LessOrEqual(t, transformedValue, originalValue+randomizationRangeMax)
+ })
+
+ t.Run("TransformFloat64Config_Empty", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_TransformFloat64Config{
+ TransformFloat64Config: &mgmtv1alpha1.TransformFloat64{},
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ originalValue := float64(5.5)
+ result, err := executor.Mutate(originalValue, executor.Opts)
+ require.NoError(t, err)
+ transformedValue := *result.(*float64)
+ require.NotEqual(t, originalValue, transformedValue)
+ })
+
+ t.Run("TransformFloat64Config_Nil", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_TransformFloat64Config{},
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ originalValue := float64(5.5)
+ result, err := executor.Mutate(originalValue, executor.Opts)
+ require.NoError(t, err)
+ transformedValue := *result.(*float64)
+ require.NotEqual(t, originalValue, transformedValue)
+ })
+
+ t.Run("TransformInt64PhoneNumberConfig", func(t *testing.T) {
+ preserveLength := true
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_TransformInt64PhoneNumberConfig{
+ TransformInt64PhoneNumberConfig: &mgmtv1alpha1.TransformInt64PhoneNumber{
+ PreserveLength: &preserveLength,
+ },
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ originalNumber := int64(1234567890)
+ result, err := executor.Mutate(originalNumber, executor.Opts)
+ require.NoError(t, err)
+ transformedNumber := *result.(*int64)
+ require.NotEqual(t, originalNumber, transformedNumber)
+ require.GreaterOrEqual(t, transformedNumber, int64(1000000000))
+ require.Less(t, transformedNumber, int64(10000000000))
+ })
+
+ t.Run("TransformInt64PhoneNumberConfig_Empty", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_TransformInt64PhoneNumberConfig{
+ TransformInt64PhoneNumberConfig: &mgmtv1alpha1.TransformInt64PhoneNumber{},
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ originalNumber := int64(1234567890)
+ result, err := executor.Mutate(originalNumber, executor.Opts)
+ require.NoError(t, err)
+ transformedNumber := *result.(*int64)
+ require.NotEqual(t, originalNumber, transformedNumber)
+ require.NotEmpty(t, transformedNumber)
+ })
+
+ t.Run("TransformInt64PhoneNumberConfig_Nil", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_TransformInt64PhoneNumberConfig{},
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ originalNumber := int64(1234567890)
+ result, err := executor.Mutate(originalNumber, executor.Opts)
+ require.NoError(t, err)
+ transformedNumber := *result.(*int64)
+ require.NotEqual(t, originalNumber, transformedNumber)
+ require.NotEmpty(t, transformedNumber)
+ })
+
+ t.Run("TransformLastNameConfig", func(t *testing.T) {
+ preserveLength := true
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_TransformLastNameConfig{
+ TransformLastNameConfig: &mgmtv1alpha1.TransformLastName{
+ PreserveLength: &preserveLength,
+ },
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ originalName := "Smith"
+ result, err := executor.Mutate(originalName, executor.Opts)
+ require.NoError(t, err)
+ require.NotEqual(t, originalName, result)
+ require.Equal(t, len(originalName), len(*result.(*string)))
+ })
+
+ t.Run("TransformLastNameConfig_Empty", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_TransformLastNameConfig{
+ TransformLastNameConfig: &mgmtv1alpha1.TransformLastName{},
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ originalName := "Smith"
+ result, err := executor.Mutate(originalName, executor.Opts)
+ require.NoError(t, err)
+ require.NotEmpty(t, result)
+ require.NotEqual(t, originalName, result)
+ })
+
+ t.Run("TransformLastNameConfig_Nil", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_TransformLastNameConfig{},
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ originalName := "Smith"
+ result, err := executor.Mutate(originalName, executor.Opts)
+ require.NoError(t, err)
+ require.NotEmpty(t, result)
+ require.NotEqual(t, originalName, result)
+ })
+
+ t.Run("TransformPhoneNumberConfig", func(t *testing.T) {
+ preserveLength := true
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_TransformPhoneNumberConfig{
+ TransformPhoneNumberConfig: &mgmtv1alpha1.TransformPhoneNumber{
+ PreserveLength: &preserveLength,
+ },
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ originalNumber := "123-456-7890"
+ result, err := executor.Mutate(originalNumber, executor.Opts)
+ require.NoError(t, err)
+ require.NotEqual(t, originalNumber, result)
+ require.Equal(t, len(originalNumber), len(*result.(*string)))
+ })
+
+ t.Run("TransformPhoneNumberConfig_Empty", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_TransformPhoneNumberConfig{
+ TransformPhoneNumberConfig: &mgmtv1alpha1.TransformPhoneNumber{},
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ originalNumber := "123-456-7890"
+ result, err := executor.Mutate(originalNumber, executor.Opts)
+ require.NoError(t, err)
+ require.NotEmpty(t, result)
+ require.NotEqual(t, originalNumber, result)
+ })
+
+ t.Run("TransformPhoneNumberConfig_Nil", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_TransformPhoneNumberConfig{},
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ originalNumber := "123-456-7890"
+ result, err := executor.Mutate(originalNumber, executor.Opts)
+ require.NoError(t, err)
+ require.NotEmpty(t, result)
+ require.NotEqual(t, originalNumber, result)
+ })
+
+ t.Run("Nullconfig", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_Nullconfig{
+ Nullconfig: &mgmtv1alpha1.Null{},
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate("any value", executor.Opts)
+ require.NoError(t, err)
+ require.Equal(t, "null", result)
+ })
+
+ t.Run("GenerateDefaultConfig", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateDefaultConfig{
+ GenerateDefaultConfig: &mgmtv1alpha1.GenerateDefault{},
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate("any value", executor.Opts)
+ require.NoError(t, err)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("TransformCharacterScrambleConfig", func(t *testing.T) {
+ userProvidedRegex := `[a-zA-Z]`
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_TransformCharacterScrambleConfig{
+ TransformCharacterScrambleConfig: &mgmtv1alpha1.TransformCharacterScramble{
+ UserProvidedRegex: &userProvidedRegex,
+ },
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ originalString := "Hello123World"
+ result, err := executor.Mutate(originalString, executor.Opts)
+ require.NoError(t, err)
+ require.NotEqual(t, originalString, result)
+ require.Equal(t, len(originalString), len(*result.(*string)))
+ })
+
+ t.Run("TransformCharacterScrambleConfig_Empty", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_TransformCharacterScrambleConfig{
+ TransformCharacterScrambleConfig: &mgmtv1alpha1.TransformCharacterScramble{},
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ originalString := "Hello123World"
+ result, err := executor.Mutate(originalString, executor.Opts)
+ require.NoError(t, err)
+ require.NotEqual(t, originalString, result)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("TransformCharacterScrambleConfig_Nil", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_TransformCharacterScrambleConfig{},
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ originalString := "Hello123World"
+ result, err := executor.Mutate(originalString, executor.Opts)
+ require.NoError(t, err)
+ require.NotEqual(t, originalString, result)
+ require.NotEmpty(t, result)
+ })
+
+ t.Run("GenerateCountryConfig", func(t *testing.T) {
+ genFull := true
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateCountryConfig{
+ GenerateCountryConfig: &mgmtv1alpha1.GenerateCountry{
+ GenerateFullName: &genFull,
+ },
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, "", result)
+ require.NotEmpty(t, result)
+ require.Greater(t, len(result.(string)), 2)
+ })
+
+ t.Run("GenerateCountryConfig_Empty", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateCountryConfig{
+ GenerateCountryConfig: &mgmtv1alpha1.GenerateCountry{},
+ },
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, "", result)
+ require.NotEmpty(t, result)
+ require.LessOrEqual(t, len(result.(string)), 2)
+ })
+
+ t.Run("GenerateCountryConfig_Nil", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_GenerateCountryConfig{},
+ }
+ executor, err := InitializeTransformerByConfigType(config)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+ result, err := executor.Mutate(nil, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, "", result)
+ require.NotEmpty(t, result)
+ require.LessOrEqual(t, len(result.(string)), 2)
+ })
+
+ t.Run("TransformPiiTextConfig_Empty", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_TransformPiiTextConfig{
+ TransformPiiTextConfig: &mgmtv1alpha1.TransformPiiText{},
+ },
+ }
+
+ mockanalyze := presidioapi.NewMockAnalyzeInterface(t)
+ mockanon := presidioapi.NewMockAnonymizeInterface(t)
+
+ mockanalyze.On("PostAnalyzeWithResponse", mock.Anything, mock.Anything).
+ Return(&presidioapi.PostAnalyzeResponse{
+ JSON200: &[]presidioapi.RecognizerResultWithAnaysisExplanation{
+ {},
+ },
+ }, nil)
+
+ mockText := "bar"
+ mockanon.On("PostAnonymizeWithResponse", mock.Anything, mock.Anything).
+ Return(&presidioapi.PostAnonymizeResponse{
+ JSON200: &presidioapi.AnonymizeResponse{Text: &mockText},
+ }, nil)
+
+ execOpts := []TransformerExecutorOption{
+ WithTransformPiiTextConfig(mockanalyze, mockanon),
+ }
+ executor, err := InitializeTransformerByConfigType(config, execOpts...)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+
+ originalText := "Hello, John Doe!"
+ result, err := executor.Mutate(originalText, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, "", result)
+ require.NotEqual(t, originalText, result)
+ require.Equal(t, mockText, result)
+ })
+
+ t.Run("TransformPiiTextConfig_Nil", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: &mgmtv1alpha1.TransformerConfig_TransformPiiTextConfig{},
+ }
+
+ mockanalyze := presidioapi.NewMockAnalyzeInterface(t)
+ mockanon := presidioapi.NewMockAnonymizeInterface(t)
+
+ mockanalyze.On("PostAnalyzeWithResponse", mock.Anything, mock.Anything).
+ Return(&presidioapi.PostAnalyzeResponse{
+ JSON200: &[]presidioapi.RecognizerResultWithAnaysisExplanation{
+ {},
+ },
+ }, nil)
+
+ mockText := "bar"
+ mockanon.On("PostAnonymizeWithResponse", mock.Anything, mock.Anything).
+ Return(&presidioapi.PostAnonymizeResponse{
+ JSON200: &presidioapi.AnonymizeResponse{Text: &mockText},
+ }, nil)
+
+ execOpts := []TransformerExecutorOption{
+ WithTransformPiiTextConfig(mockanalyze, mockanon),
+ }
+ executor, err := InitializeTransformerByConfigType(config, execOpts...)
+ require.NoError(t, err)
+ require.NotNil(t, executor)
+
+ originalText := "Hello, John Doe!"
+ result, err := executor.Mutate(originalText, executor.Opts)
+ require.NoError(t, err)
+ require.IsType(t, "", result)
+ require.NotEqual(t, originalText, result)
+ require.Equal(t, mockText, result)
+ })
+
+ t.Run("UnsupportedConfig", func(t *testing.T) {
+ config := &mgmtv1alpha1.TransformerConfig{
+ Config: nil,
+ }
+ _, err := InitializeTransformerByConfigType(config)
+ require.Error(t, err)
+ require.Contains(t, err.Error(), "unsupported transformer")
+ })
+}
diff --git a/worker/pkg/workflows/datasync/activities/gen-benthos-configs/benthos-builder_test.go b/worker/pkg/workflows/datasync/activities/gen-benthos-configs/benthos-builder_test.go
index 60e138df73..63bc7f1a53 100644
--- a/worker/pkg/workflows/datasync/activities/gen-benthos-configs/benthos-builder_test.go
+++ b/worker/pkg/workflows/datasync/activities/gen-benthos-configs/benthos-builder_test.go
@@ -16,6 +16,7 @@ import (
sqlmanager_shared "github.com/nucleuscloud/neosync/backend/pkg/sqlmanager/shared"
tabledependency "github.com/nucleuscloud/neosync/backend/pkg/table-dependency"
pg_models "github.com/nucleuscloud/neosync/backend/sql/postgresql/models"
+ "github.com/nucleuscloud/neosync/internal/gotypeutil"
"github.com/nucleuscloud/neosync/worker/pkg/workflows/datasync/activities/shared"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
@@ -371,8 +372,8 @@ func Test_buildProcessorConfigsMutation(t *testing.T) {
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_TransformEmailConfig{
TransformEmailConfig: &mgmtv1alpha1.TransformEmail{
- PreserveDomain: true,
- PreserveLength: false,
+ PreserveDomain: gotypeutil.ToPtr(true),
+ PreserveLength: gotypeutil.ToPtr(false),
ExcludedDomains: []string{},
},
},
@@ -399,7 +400,7 @@ func Test_buildProcessorConfigsMutation(t *testing.T) {
{Schema: "public", Table: "users", Column: "email", Transformer: &mgmtv1alpha1.JobMappingTransformer{Source: jsT.Source, Config: jsT.Config}}}, groupedSchemas, map[string][]*referenceKey{}, []string{}, mockJobId, mockRunId, nil, runconfig, nil, []string{})
require.Nil(t, err)
- require.Equal(t, *output[0].Mutation, `root."email" = transform_email(value:this."email",preserve_domain:true,preserve_length:false,excluded_domains:[],max_length:40,email_type:"uuidv4",invalid_email_action:"reject")`)
+ require.Equal(t, `root."email" = transform_email(value:this."email",preserve_length:false,preserve_domain:true,excluded_domains:[],max_length:40,email_type:"uuidv4",invalid_email_action:"reject")`, *output[0].Mutation)
}
func Test_ShouldProcessColumnTrue(t *testing.T) {
@@ -475,8 +476,8 @@ func Test_convertUserDefinedFunctionConfig(t *testing.T) {
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_TransformEmailConfig{
TransformEmailConfig: &mgmtv1alpha1.TransformEmail{
- PreserveDomain: true,
- PreserveLength: false,
+ PreserveDomain: gotypeutil.ToPtr(true),
+ PreserveLength: gotypeutil.ToPtr(false),
ExcludedDomains: []string{},
},
},
@@ -500,8 +501,8 @@ func Test_convertUserDefinedFunctionConfig(t *testing.T) {
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_TransformEmailConfig{
TransformEmailConfig: &mgmtv1alpha1.TransformEmail{
- PreserveDomain: true,
- PreserveLength: false,
+ PreserveDomain: gotypeutil.ToPtr(true),
+ PreserveLength: gotypeutil.ToPtr(false),
ExcludedDomains: []string{},
},
},
@@ -635,9 +636,9 @@ func Test_computeMutationFunction_Validate_Bloblang_Output(t *testing.T) {
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_TransformEmailConfig{
TransformEmailConfig: &mgmtv1alpha1.TransformEmail{
- PreserveDomain: false,
- PreserveLength: false,
- ExcludedDomains: []string{},
+ PreserveDomain: gotypeutil.ToPtr(false),
+ PreserveLength: gotypeutil.ToPtr(false),
+ ExcludedDomains: []string{"gmail", "yahoo"},
EmailType: &uuidEmailType,
},
},
@@ -656,7 +657,7 @@ func Test_computeMutationFunction_Validate_Bloblang_Output(t *testing.T) {
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_GenerateCardNumberConfig{
GenerateCardNumberConfig: &mgmtv1alpha1.GenerateCardNumber{
- ValidLuhn: true,
+ ValidLuhn: gotypeutil.ToPtr(true),
},
},
},
@@ -674,8 +675,8 @@ func Test_computeMutationFunction_Validate_Bloblang_Output(t *testing.T) {
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_GenerateE164PhoneNumberConfig{
GenerateE164PhoneNumberConfig: &mgmtv1alpha1.GenerateE164PhoneNumber{
- Min: 9,
- Max: 15,
+ Min: gotypeutil.ToPtr(int64(9)),
+ Max: gotypeutil.ToPtr(int64(15)),
},
},
},
@@ -693,10 +694,10 @@ func Test_computeMutationFunction_Validate_Bloblang_Output(t *testing.T) {
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_GenerateFloat64Config{
GenerateFloat64Config: &mgmtv1alpha1.GenerateFloat64{
- RandomizeSign: true,
- Min: 1.00,
- Max: 100.00,
- Precision: 6,
+ RandomizeSign: gotypeutil.ToPtr(true),
+ Min: gotypeutil.ToPtr(1.00),
+ Max: gotypeutil.ToPtr(100.00),
+ Precision: gotypeutil.ToPtr(int64(6)),
},
},
},
@@ -722,7 +723,7 @@ func Test_computeMutationFunction_Validate_Bloblang_Output(t *testing.T) {
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_GenerateGenderConfig{
GenerateGenderConfig: &mgmtv1alpha1.GenerateGender{
- Abbreviate: false,
+ Abbreviate: gotypeutil.ToPtr(false),
},
},
},
@@ -740,9 +741,9 @@ func Test_computeMutationFunction_Validate_Bloblang_Output(t *testing.T) {
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_GenerateInt64Config{
GenerateInt64Config: &mgmtv1alpha1.GenerateInt64{
- RandomizeSign: true,
- Min: 1,
- Max: 40,
+ RandomizeSign: gotypeutil.ToPtr(true),
+ Min: gotypeutil.ToPtr(int64(1)),
+ Max: gotypeutil.ToPtr(int64(40)),
},
},
},
@@ -776,7 +777,7 @@ func Test_computeMutationFunction_Validate_Bloblang_Output(t *testing.T) {
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_GenerateStateConfig{
GenerateStateConfig: &mgmtv1alpha1.GenerateState{
- GenerateFullName: false,
+ GenerateFullName: gotypeutil.ToPtr(false),
},
},
},
@@ -794,8 +795,8 @@ func Test_computeMutationFunction_Validate_Bloblang_Output(t *testing.T) {
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_GenerateStringPhoneNumberConfig{
GenerateStringPhoneNumberConfig: &mgmtv1alpha1.GenerateStringPhoneNumber{
- Min: 9,
- Max: 14,
+ Min: gotypeutil.ToPtr(int64(9)),
+ Max: gotypeutil.ToPtr(int64(14)),
},
},
},
@@ -805,8 +806,8 @@ func Test_computeMutationFunction_Validate_Bloblang_Output(t *testing.T) {
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_GenerateStringConfig{
GenerateStringConfig: &mgmtv1alpha1.GenerateString{
- Min: 2,
- Max: 7,
+ Min: gotypeutil.ToPtr(int64(2)),
+ Max: gotypeutil.ToPtr(int64(7)),
},
},
},
@@ -840,7 +841,7 @@ func Test_computeMutationFunction_Validate_Bloblang_Output(t *testing.T) {
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_GenerateUuidConfig{
GenerateUuidConfig: &mgmtv1alpha1.GenerateUuid{
- IncludeHyphens: true,
+ IncludeHyphens: gotypeutil.ToPtr(true),
},
},
},
@@ -858,7 +859,7 @@ func Test_computeMutationFunction_Validate_Bloblang_Output(t *testing.T) {
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_TransformE164PhoneNumberConfig{
TransformE164PhoneNumberConfig: &mgmtv1alpha1.TransformE164PhoneNumber{
- PreserveLength: false,
+ PreserveLength: gotypeutil.ToPtr(false),
},
},
},
@@ -868,7 +869,7 @@ func Test_computeMutationFunction_Validate_Bloblang_Output(t *testing.T) {
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_TransformFirstNameConfig{
TransformFirstNameConfig: &mgmtv1alpha1.TransformFirstName{
- PreserveLength: false,
+ PreserveLength: gotypeutil.ToPtr(false),
},
},
},
@@ -878,8 +879,8 @@ func Test_computeMutationFunction_Validate_Bloblang_Output(t *testing.T) {
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_TransformFloat64Config{
TransformFloat64Config: &mgmtv1alpha1.TransformFloat64{
- RandomizationRangeMin: 20.00,
- RandomizationRangeMax: 50.00,
+ RandomizationRangeMin: gotypeutil.ToPtr(20.00),
+ RandomizationRangeMax: gotypeutil.ToPtr(50.00),
},
},
},
@@ -889,7 +890,7 @@ func Test_computeMutationFunction_Validate_Bloblang_Output(t *testing.T) {
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_TransformFullNameConfig{
TransformFullNameConfig: &mgmtv1alpha1.TransformFullName{
- PreserveLength: false,
+ PreserveLength: gotypeutil.ToPtr(false),
},
},
},
@@ -899,7 +900,7 @@ func Test_computeMutationFunction_Validate_Bloblang_Output(t *testing.T) {
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_TransformInt64PhoneNumberConfig{
TransformInt64PhoneNumberConfig: &mgmtv1alpha1.TransformInt64PhoneNumber{
- PreserveLength: false,
+ PreserveLength: gotypeutil.ToPtr(false),
},
},
},
@@ -909,8 +910,8 @@ func Test_computeMutationFunction_Validate_Bloblang_Output(t *testing.T) {
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_TransformInt64Config{
TransformInt64Config: &mgmtv1alpha1.TransformInt64{
- RandomizationRangeMin: 20,
- RandomizationRangeMax: 50,
+ RandomizationRangeMin: gotypeutil.ToPtr(int64(20)),
+ RandomizationRangeMax: gotypeutil.ToPtr(int64(50)),
},
},
},
@@ -920,7 +921,7 @@ func Test_computeMutationFunction_Validate_Bloblang_Output(t *testing.T) {
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_TransformLastNameConfig{
TransformLastNameConfig: &mgmtv1alpha1.TransformLastName{
- PreserveLength: false,
+ PreserveLength: gotypeutil.ToPtr(false),
},
},
},
@@ -930,7 +931,7 @@ func Test_computeMutationFunction_Validate_Bloblang_Output(t *testing.T) {
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_TransformPhoneNumberConfig{
TransformPhoneNumberConfig: &mgmtv1alpha1.TransformPhoneNumber{
- PreserveLength: false,
+ PreserveLength: gotypeutil.ToPtr(false),
},
},
},
@@ -940,7 +941,7 @@ func Test_computeMutationFunction_Validate_Bloblang_Output(t *testing.T) {
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_TransformStringConfig{
TransformStringConfig: &mgmtv1alpha1.TransformString{
- PreserveLength: false,
+ PreserveLength: gotypeutil.ToPtr(false),
},
},
},
@@ -950,7 +951,7 @@ func Test_computeMutationFunction_Validate_Bloblang_Output(t *testing.T) {
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_GenerateCategoricalConfig{
GenerateCategoricalConfig: &mgmtv1alpha1.GenerateCategorical{
- Categories: "value1,value2",
+ Categories: gotypeutil.ToPtr("value1,value2"),
},
},
},
@@ -986,7 +987,7 @@ func Test_computeMutationFunction_Validate_Bloblang_Output(t *testing.T) {
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_GenerateCountryConfig{
GenerateCountryConfig: &mgmtv1alpha1.GenerateCountry{
- GenerateFullName: false,
+ GenerateFullName: gotypeutil.ToPtr(false),
},
},
},
@@ -1022,6 +1023,195 @@ func Test_computeMutationFunction_Validate_Bloblang_Output(t *testing.T) {
}
}
+func Test_computeMutationFunction_Validate_Bloblang_Output_EmptyConfigs(t *testing.T) {
+ transformers := []*mgmtv1alpha1.SystemTransformer{
+ {
+ Source: mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_EMAIL,
+ Config: &mgmtv1alpha1.TransformerConfig{},
+ },
+ {
+ Source: mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_TRANSFORM_EMAIL,
+ Config: &mgmtv1alpha1.TransformerConfig{},
+ },
+ {
+ Source: mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_BOOL,
+ Config: &mgmtv1alpha1.TransformerConfig{},
+ },
+ {
+ Source: mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_CARD_NUMBER,
+ Config: &mgmtv1alpha1.TransformerConfig{},
+ },
+ {
+ Source: mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_CITY,
+ Config: &mgmtv1alpha1.TransformerConfig{},
+ },
+ {
+ Source: mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_E164_PHONE_NUMBER,
+ Config: &mgmtv1alpha1.TransformerConfig{},
+ },
+ {
+ Source: mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_FIRST_NAME,
+ Config: &mgmtv1alpha1.TransformerConfig{},
+ },
+ {
+ Source: mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_FLOAT64,
+ Config: &mgmtv1alpha1.TransformerConfig{},
+ },
+ {
+ Source: mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_FULL_ADDRESS,
+ Config: &mgmtv1alpha1.TransformerConfig{},
+ },
+ {
+ Source: mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_FULL_NAME,
+ Config: &mgmtv1alpha1.TransformerConfig{},
+ },
+ {
+ Source: mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_GENDER,
+ Config: &mgmtv1alpha1.TransformerConfig{},
+ },
+ {
+ Source: mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_INT64_PHONE_NUMBER,
+ Config: &mgmtv1alpha1.TransformerConfig{},
+ },
+ {
+ Source: mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_INT64,
+ Config: &mgmtv1alpha1.TransformerConfig{},
+ },
+ {
+ Source: mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_LAST_NAME,
+ Config: &mgmtv1alpha1.TransformerConfig{},
+ },
+ {
+ Source: mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_SHA256HASH,
+ Config: &mgmtv1alpha1.TransformerConfig{},
+ },
+ {
+ Source: mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_SSN,
+ Config: &mgmtv1alpha1.TransformerConfig{},
+ },
+ {
+ Source: mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_STATE,
+ Config: &mgmtv1alpha1.TransformerConfig{},
+ },
+ {
+ Source: mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_STREET_ADDRESS,
+ Config: &mgmtv1alpha1.TransformerConfig{},
+ },
+ {
+ Source: mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_STRING_PHONE_NUMBER,
+ Config: &mgmtv1alpha1.TransformerConfig{},
+ },
+ {
+ Source: mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_RANDOM_STRING,
+ Config: &mgmtv1alpha1.TransformerConfig{},
+ },
+ {
+ Source: mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_UNIXTIMESTAMP,
+ Config: &mgmtv1alpha1.TransformerConfig{},
+ },
+ {
+ Source: mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_USERNAME,
+ Config: &mgmtv1alpha1.TransformerConfig{},
+ },
+ {
+ Source: mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_UTCTIMESTAMP,
+ Config: &mgmtv1alpha1.TransformerConfig{},
+ },
+ {
+ Source: mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_UUID,
+ Config: &mgmtv1alpha1.TransformerConfig{},
+ },
+ {
+ Source: mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_ZIPCODE,
+ Config: &mgmtv1alpha1.TransformerConfig{},
+ },
+ {
+ Source: mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_TRANSFORM_E164_PHONE_NUMBER,
+ Config: &mgmtv1alpha1.TransformerConfig{},
+ },
+ {
+ Source: mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_TRANSFORM_FIRST_NAME,
+ Config: &mgmtv1alpha1.TransformerConfig{},
+ },
+ {
+ Source: mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_TRANSFORM_FLOAT64,
+ Config: &mgmtv1alpha1.TransformerConfig{},
+ },
+ {
+ Source: mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_TRANSFORM_FULL_NAME,
+ Config: &mgmtv1alpha1.TransformerConfig{},
+ },
+ {
+ Source: mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_TRANSFORM_INT64_PHONE_NUMBER,
+ Config: &mgmtv1alpha1.TransformerConfig{},
+ },
+ {
+ Source: mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_TRANSFORM_INT64,
+ Config: &mgmtv1alpha1.TransformerConfig{},
+ },
+ {
+ Source: mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_TRANSFORM_LAST_NAME,
+ Config: &mgmtv1alpha1.TransformerConfig{},
+ },
+ {
+ Source: mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_TRANSFORM_PHONE_NUMBER,
+ Config: &mgmtv1alpha1.TransformerConfig{},
+ },
+ {
+ Source: mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_TRANSFORM_STRING,
+ Config: &mgmtv1alpha1.TransformerConfig{},
+ },
+ {
+ Source: mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_CATEGORICAL,
+ Config: &mgmtv1alpha1.TransformerConfig{},
+ },
+ {
+ Source: mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_TRANSFORM_CHARACTER_SCRAMBLE,
+ Config: &mgmtv1alpha1.TransformerConfig{},
+ },
+ {
+ Source: mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_DEFAULT,
+ Config: &mgmtv1alpha1.TransformerConfig{},
+ },
+ {
+ Source: mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_NULL,
+ Config: &mgmtv1alpha1.TransformerConfig{},
+ },
+ {
+ Source: mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_COUNTRY,
+ Config: &mgmtv1alpha1.TransformerConfig{},
+ },
+ }
+
+ emailColInfo := &sqlmanager_shared.ColumnInfo{
+ OrdinalPosition: 2,
+ ColumnDefault: "",
+ IsNullable: true,
+ DataType: "timestamptz",
+ CharacterMaximumLength: shared.Ptr(40),
+ NumericPrecision: nil,
+ NumericScale: nil,
+ }
+
+ for _, transformer := range transformers {
+ t.Run(fmt.Sprintf("%s_%s_lint", t.Name(), transformer.Source), func(t *testing.T) {
+ val, err := computeMutationFunction(
+ &mgmtv1alpha1.JobMapping{
+ Column: "email",
+ Transformer: &mgmtv1alpha1.JobMappingTransformer{
+ Source: transformer.Source,
+ Config: transformer.Config,
+ },
+ }, emailColInfo, false)
+ require.NoError(t, err)
+ ex, err := bloblang.Parse(val)
+ require.NoError(t, err, fmt.Sprintf("transformer lint failed, check that the transformer string is being constructed correctly. Failing source: %s", transformer.Source))
+ _, err = ex.Query(nil)
+ require.NoError(t, err)
+ })
+ }
+}
+
func Test_computeMutationFunction_handles_Db_Maxlen(t *testing.T) {
type testcase struct {
jm *mgmtv1alpha1.JobMapping
@@ -1034,8 +1224,8 @@ func Test_computeMutationFunction_handles_Db_Maxlen(t *testing.T) {
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_GenerateStringConfig{
GenerateStringConfig: &mgmtv1alpha1.GenerateString{
- Min: 2,
- Max: 7,
+ Min: gotypeutil.ToPtr(int64(2)),
+ Max: gotypeutil.ToPtr(int64(7)),
},
},
},
@@ -1212,22 +1402,6 @@ func Test_buildBranchCacheConfigs_self_referencing(t *testing.T) {
require.Len(t, resp, 0)
}
-func Test_ConverStringSliceToStringEmptySlice(t *testing.T) {
- slc := []string{}
-
- res, err := convertStringSliceToString(slc)
- require.NoError(t, err)
- require.Equal(t, "[]", res)
-}
-
-func Test_ConverStringSliceToStringNotEmptySlice(t *testing.T) {
- slc := []string{"gmail.com", "yahoo.com"}
-
- res, err := convertStringSliceToString(slc)
- require.NoError(t, err)
- require.Equal(t, `["gmail.com","yahoo.com"]`, res)
-}
-
func Test_getPrimaryKeyDependencyMap(t *testing.T) {
tableDependencies := map[string][]*sqlmanager_shared.ForeignConstraint{
"hr.countries": {
diff --git a/worker/pkg/workflows/datasync/activities/gen-benthos-configs/processors.go b/worker/pkg/workflows/datasync/activities/gen-benthos-configs/processors.go
index 8d602d0843..7b3667ad69 100644
--- a/worker/pkg/workflows/datasync/activities/gen-benthos-configs/processors.go
+++ b/worker/pkg/workflows/datasync/activities/gen-benthos-configs/processors.go
@@ -432,67 +432,71 @@ func computeMutationFunction(col *mgmtv1alpha1.JobMapping, colInfo *sqlmanager_s
}
formattedColPath := getBenthosColumnKey(col.Column, splitColumnPath)
+ config := col.GetTransformer().GetConfig()
switch col.Transformer.Source {
case mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_CATEGORICAL:
- categories := col.Transformer.Config.GetGenerateCategoricalConfig().Categories
- return fmt.Sprintf(`generate_categorical(categories: %q)`, categories), nil
- case mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_EMAIL:
- emailType := col.GetTransformer().GetConfig().GetGenerateEmailConfig().GetEmailType()
- if emailType == mgmtv1alpha1.GenerateEmailType_GENERATE_EMAIL_TYPE_UNSPECIFIED {
- emailType = mgmtv1alpha1.GenerateEmailType_GENERATE_EMAIL_TYPE_UUID_V4
- }
- return fmt.Sprintf(`generate_email(max_length:%d,email_type:%q)`, maxLen, dtoEmailTypeToBenthosEmailType(emailType)), nil
- case mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_TRANSFORM_EMAIL:
- pd := col.Transformer.Config.GetTransformEmailConfig().PreserveDomain
- pl := col.Transformer.Config.GetTransformEmailConfig().PreserveLength
- excludedDomains := col.Transformer.Config.GetTransformEmailConfig().ExcludedDomains
-
- excludedDomainsStr, err := convertStringSliceToString(excludedDomains)
+ opts, err := transformers.NewGenerateCategoricalOptsFromConfig(config.GetGenerateCategoricalConfig())
if err != nil {
return "", err
}
- emailType := col.GetTransformer().GetConfig().GetTransformEmailConfig().GetEmailType()
- if emailType == mgmtv1alpha1.GenerateEmailType_GENERATE_EMAIL_TYPE_UNSPECIFIED {
- emailType = mgmtv1alpha1.GenerateEmailType_GENERATE_EMAIL_TYPE_UUID_V4
+ return opts.BuildBloblangString(), nil
+ case mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_EMAIL:
+ opts, err := transformers.NewGenerateEmailOptsFromConfig(config.GetGenerateEmailConfig(), &maxLen)
+ if err != nil {
+ return "", err
}
-
- invalidEmailAction := col.GetTransformer().GetConfig().GetTransformEmailConfig().GetInvalidEmailAction()
- if invalidEmailAction == mgmtv1alpha1.InvalidEmailAction_INVALID_EMAIL_ACTION_UNSPECIFIED {
- invalidEmailAction = mgmtv1alpha1.InvalidEmailAction_INVALID_EMAIL_ACTION_REJECT
+ return opts.BuildBloblangString(), nil
+ case mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_TRANSFORM_EMAIL:
+ opts, err := transformers.NewTransformEmailOptsFromConfig(config.GetTransformEmailConfig(), &maxLen)
+ if err != nil {
+ return "", nil
}
-
- return fmt.Sprintf(
- "transform_email(value:this.%s,preserve_domain:%t,preserve_length:%t,excluded_domains:%v,max_length:%d,email_type:%q,invalid_email_action:%q)",
- formattedColPath, pd, pl, excludedDomainsStr, maxLen, dtoEmailTypeToBenthosEmailType(emailType), dtoInvalidEmailActionToBenthosInvalidEmailAction(invalidEmailAction),
- ), nil
+ return opts.BuildBloblangString(formattedColPath), nil
case mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_BOOL:
- return "generate_bool()", nil
+ opts, err := transformers.NewGenerateBoolOptsFromConfig(config.GetGenerateBoolConfig())
+ if err != nil {
+ return "", nil
+ }
+ return opts.BuildBloblangString(), nil
case mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_CARD_NUMBER:
- luhn := col.Transformer.Config.GetGenerateCardNumberConfig().ValidLuhn
- return fmt.Sprintf(`generate_card_number(valid_luhn:%t)`, luhn), nil
+ opts, err := transformers.NewGenerateCardNumberOptsFromConfig(config.GetGenerateCardNumberConfig())
+ if err != nil {
+ return "", err
+ }
+ return opts.BuildBloblangString(), nil
case mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_CITY:
- return fmt.Sprintf(`generate_city(max_length:%d)`, maxLen), nil
+ opts, err := transformers.NewGenerateCityOptsFromConfig(config.GetGenerateCityConfig(), &maxLen)
+ if err != nil {
+ return "", err
+ }
+ return opts.BuildBloblangString(), nil
case mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_E164_PHONE_NUMBER:
- minValue := col.Transformer.Config.GetGenerateE164PhoneNumberConfig().Min
- maxValue := col.Transformer.Config.GetGenerateE164PhoneNumberConfig().Max
- return fmt.Sprintf(`generate_e164_phone_number(min:%d,max:%d)`, minValue, maxValue), nil
+ opts, err := transformers.NewGenerateInternationalPhoneNumberOptsFromConfig(config.GetGenerateE164PhoneNumberConfig())
+ if err != nil {
+ return "", nil
+ }
+ return opts.BuildBloblangString(), nil
case mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_FIRST_NAME:
- return fmt.Sprintf(`generate_first_name(max_length:%d)`, maxLen), nil
+ opts, err := transformers.NewGenerateFirstNameOptsFromConfig(config.GetGenerateFirstNameConfig(), &maxLen)
+ if err != nil {
+ return "", nil
+ }
+ return opts.BuildBloblangString(), nil
case mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_FLOAT64:
- randomSign := col.Transformer.Config.GetGenerateFloat64Config().RandomizeSign
- minValue := col.Transformer.Config.GetGenerateFloat64Config().Min
- maxValue := col.Transformer.Config.GetGenerateFloat64Config().Max
-
var precision *int64
- if col.GetTransformer().GetConfig().GetGenerateFloat64Config().GetPrecision() > 0 {
- userDefinedPrecision := col.GetTransformer().GetConfig().GetGenerateFloat64Config().GetPrecision()
+ if config != nil && config.GetGenerateFloat64Config() != nil && config.GetGenerateFloat64Config().GetPrecision() > 0 {
+ userDefinedPrecision := config.GetGenerateFloat64Config().GetPrecision()
precision = &userDefinedPrecision
+ config.GetGenerateFloat64Config().Precision = &userDefinedPrecision
}
if colInfo != nil && colInfo.NumericPrecision != nil && *colInfo.NumericPrecision > 0 {
newPrecision := transformer_utils.Ceil(*precision, int64(*colInfo.NumericPrecision))
precision = &newPrecision
}
+ if config != nil && config.GetGenerateFloat64Config() != nil && precision != nil {
+ config.GetGenerateFloat64Config().Precision = precision
+ }
var scale *int64
if colInfo != nil && colInfo.NumericScale != nil && *colInfo.NumericScale >= 0 {
@@ -500,163 +504,196 @@ func computeMutationFunction(col *mgmtv1alpha1.JobMapping, colInfo *sqlmanager_s
scale = &newScale
}
- fnStr := []string{"randomize_sign:%t", "min:%f", "max:%f"}
- params := []any{randomSign, minValue, maxValue}
-
- if precision != nil {
- fnStr = append(fnStr, "precision: %d")
- params = append(params, *precision)
- }
- if scale != nil {
- fnStr = append(fnStr, "scale: %d")
- params = append(params, *scale)
+ opts, err := transformers.NewGenerateFloat64OptsFromConfig(col.Transformer.Config.GetGenerateFloat64Config(), scale)
+ if err != nil {
+ return "", err
}
- template := fmt.Sprintf("generate_float64(%s)", strings.Join(fnStr, ", "))
- return fmt.Sprintf(template, params...), nil
+ return opts.BuildBloblangString(), nil
case mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_FULL_ADDRESS:
- return fmt.Sprintf(`generate_full_address(max_length:%d)`, maxLen), nil
+ opts, err := transformers.NewGenerateFullAddressOptsFromConfig(config.GetGenerateFullAddressConfig(), &maxLen)
+ if err != nil {
+ return "", err
+ }
+ return opts.BuildBloblangString(), nil
case mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_FULL_NAME:
- return fmt.Sprintf(`generate_full_name(max_length:%d)`, maxLen), nil
+ opts, err := transformers.NewGenerateFullNameOptsFromConfig(config.GetGenerateFullNameConfig(), &maxLen)
+ if err != nil {
+ return "", err
+ }
+ return opts.BuildBloblangString(), nil
case mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_GENDER:
- ab := col.Transformer.Config.GetGenerateGenderConfig().Abbreviate
- return fmt.Sprintf(`generate_gender(abbreviate:%t,max_length:%d)`, ab, maxLen), nil
+ opts, err := transformers.NewGenerateGenderOptsFromConfig(config.GetGenerateGenderConfig(), &maxLen)
+ if err != nil {
+ return "", err
+ }
+ return opts.BuildBloblangString(), nil
case mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_INT64_PHONE_NUMBER:
- return "generate_int64_phone_number()", nil
+ opts, err := transformers.NewGenerateInt64PhoneNumberOptsFromConfig(config.GetGenerateInt64PhoneNumberConfig())
+ if err != nil {
+ return "", err
+ }
+ return opts.BuildBloblangString(), nil
case mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_INT64:
- sign := col.Transformer.Config.GetGenerateInt64Config().RandomizeSign
- minValue := col.Transformer.Config.GetGenerateInt64Config().Min
- maxValue := col.Transformer.Config.GetGenerateInt64Config().Max
- return fmt.Sprintf(`generate_int64(randomize_sign:%t,min:%d, max:%d)`, sign, minValue, maxValue), nil
+ opts, err := transformers.NewGenerateInt64OptsFromConfig(config.GetGenerateInt64Config())
+ if err != nil {
+ return "", err
+ }
+ return opts.BuildBloblangString(), nil
case mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_LAST_NAME:
- return fmt.Sprintf(`generate_last_name(max_length:%d)`, maxLen), nil
+ opts, err := transformers.NewGenerateLastNameOptsFromConfig(config.GetGenerateLastNameConfig(), &maxLen)
+ if err != nil {
+ return "", err
+ }
+ return opts.BuildBloblangString(), nil
case mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_SHA256HASH:
- return `generate_sha256hash()`, nil
+ opts, err := transformers.NewGenerateSHA256HashOptsFromConfig(config.GetGenerateSha256HashConfig())
+ if err != nil {
+ return "", err
+ }
+ return opts.BuildBloblangString(), nil
case mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_SSN:
- return "generate_ssn()", nil
+ opts, err := transformers.NewGenerateSSNOptsFromConfig(config.GetGenerateSsnConfig())
+ if err != nil {
+ return "", err
+ }
+ return opts.BuildBloblangString(), nil
case mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_STATE:
- generateFullName := col.Transformer.Config.GetGenerateStateConfig().GenerateFullName
- return fmt.Sprintf(`generate_state(generate_full_name:%t)`, generateFullName), nil
+ opts, err := transformers.NewGenerateStateOptsFromConfig(config.GetGenerateStateConfig())
+ if err != nil {
+ return "", err
+ }
+ return opts.BuildBloblangString(), nil
case mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_STREET_ADDRESS:
- return fmt.Sprintf(`generate_street_address(max_length:%d)`, maxLen), nil
+ opts, err := transformers.NewGenerateStreetAddressOptsFromConfig(config.GetGenerateStreetAddressConfig(), &maxLen)
+ if err != nil {
+ return "", err
+ }
+ return opts.BuildBloblangString(), nil
case mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_STRING_PHONE_NUMBER:
- minValue := col.Transformer.Config.GetGenerateStringPhoneNumberConfig().Min
- maxValue := col.Transformer.Config.GetGenerateStringPhoneNumberConfig().Max
- minValue = transformer_utils.MinInt(minValue, maxLen)
- maxValue = transformer_utils.Ceil(maxValue, maxLen)
- return fmt.Sprintf("generate_string_phone_number(min:%d,max:%d)", minValue, maxValue), nil
+ opts, err := transformers.NewGenerateStringPhoneNumberOptsFromConfig(config.GetGenerateStringPhoneNumberConfig())
+ if err != nil {
+ return "", err
+ }
+ return opts.BuildBloblangString(), nil
case mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_RANDOM_STRING:
- minValue := col.Transformer.Config.GetGenerateStringConfig().Min
- maxValue := col.Transformer.Config.GetGenerateStringConfig().Max
- minValue = transformer_utils.MinInt(minValue, maxLen) // ensure the min is not larger than the max allowed length
- maxValue = transformer_utils.Ceil(maxValue, maxLen)
// todo: we need to pull in the min from the database schema
- return fmt.Sprintf(`generate_string(min:%d,max:%d)`, minValue, maxValue), nil
+ opts, err := transformers.NewGenerateRandomStringOptsFromConfig(config.GetGenerateStringConfig(), &maxLen)
+ if err != nil {
+ return "", err
+ }
+ return opts.BuildBloblangString(), nil
case mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_UNIXTIMESTAMP:
- return "generate_unixtimestamp()", nil
+ opts, err := transformers.NewGenerateUnixTimestampOptsFromConfig(config.GetGenerateUnixtimestampConfig())
+ if err != nil {
+ return "", err
+ }
+ return opts.BuildBloblangString(), nil
case mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_USERNAME:
- return fmt.Sprintf(`generate_username(max_length:%d)`, maxLen), nil
+ opts, err := transformers.NewGenerateUsernameOptsFromConfig(config.GetGenerateUsernameConfig(), &maxLen)
+ if err != nil {
+ return "", err
+ }
+ return opts.BuildBloblangString(), nil
case mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_UTCTIMESTAMP:
- return "generate_utctimestamp()", nil
+ opts, err := transformers.NewGenerateUTCTimestampOptsFromConfig(config.GetGenerateUtctimestampConfig())
+ if err != nil {
+ return "", err
+ }
+ return opts.BuildBloblangString(), nil
case mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_UUID:
- ih := col.Transformer.Config.GetGenerateUuidConfig().IncludeHyphens
- return fmt.Sprintf("generate_uuid(include_hyphens:%t)", ih), nil
+ opts, err := transformers.NewGenerateUUIDOptsFromConfig(config.GetGenerateUuidConfig())
+ if err != nil {
+ return "", err
+ }
+ return opts.BuildBloblangString(), nil
case mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_ZIPCODE:
- return "generate_zipcode()", nil
+ opts, err := transformers.NewGenerateZipcodeOptsFromConfig(config.GetGenerateZipcodeConfig())
+ if err != nil {
+ return "", err
+ }
+ return opts.BuildBloblangString(), nil
case mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_TRANSFORM_E164_PHONE_NUMBER:
- pl := col.Transformer.Config.GetTransformE164PhoneNumberConfig().PreserveLength
- return fmt.Sprintf("transform_e164_phone_number(value:this.%s,preserve_length:%t,max_length:%d)", formattedColPath, pl, maxLen), nil
+ opts, err := transformers.NewTransformE164PhoneNumberOptsFromConfig(config.GetTransformE164PhoneNumberConfig(), &maxLen)
+ if err != nil {
+ return "", err
+ }
+ return opts.BuildBloblangString(formattedColPath), nil
case mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_TRANSFORM_FIRST_NAME:
- pl := col.Transformer.Config.GetTransformFirstNameConfig().PreserveLength
- return fmt.Sprintf("transform_first_name(value:this.%s,preserve_length:%t,max_length:%d)", formattedColPath, pl, maxLen), nil
+ opts, err := transformers.NewTransformFirstNameOptsFromConfig(config.GetTransformFirstNameConfig(), &maxLen)
+ if err != nil {
+ return "", err
+ }
+ return opts.BuildBloblangString(formattedColPath), nil
case mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_TRANSFORM_FLOAT64:
- rMin := col.Transformer.Config.GetTransformFloat64Config().RandomizationRangeMin
- rMax := col.Transformer.Config.GetTransformFloat64Config().RandomizationRangeMax
-
var precision *int64
if colInfo != nil && colInfo.NumericPrecision != nil && *colInfo.NumericPrecision > 0 {
newPrecision := int64(*colInfo.NumericPrecision)
precision = &newPrecision
}
-
var scale *int64
if colInfo != nil && colInfo.NumericScale != nil && *colInfo.NumericScale >= 0 {
newScale := int64(*colInfo.NumericScale)
scale = &newScale
}
-
- fnStr := []string{"value:this.%s", "randomization_range_min:%f", "randomization_range_max:%f"}
- params := []any{formattedColPath, rMin, rMax}
-
- if precision != nil {
- fnStr = append(fnStr, "precision:%d")
- params = append(params, *precision)
- }
- if scale != nil {
- fnStr = append(fnStr, "scale:%d")
- params = append(params, *scale)
+ opts, err := transformers.NewTransformFloat64OptsFromConfig(col.Transformer.Config.GetTransformFloat64Config(), scale, precision)
+ if err != nil {
+ return "", err
}
- template := fmt.Sprintf(`transform_float64(%s)`, strings.Join(fnStr, ", "))
- return fmt.Sprintf(template, params...), nil
+ return opts.BuildBloblangString(formattedColPath), nil
case mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_TRANSFORM_FULL_NAME:
- pl := col.Transformer.Config.GetTransformFullNameConfig().PreserveLength
- return fmt.Sprintf("transform_full_name(value:this.%s,preserve_length:%t,max_length:%d)", formattedColPath, pl, maxLen), nil
+ opts, err := transformers.NewTransformFullNameOptsFromConfig(config.GetTransformFullNameConfig(), &maxLen)
+ if err != nil {
+ return "", err
+ }
+ return opts.BuildBloblangString(formattedColPath), nil
case mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_TRANSFORM_INT64_PHONE_NUMBER:
- pl := col.Transformer.Config.GetTransformInt64PhoneNumberConfig().PreserveLength
- return fmt.Sprintf("transform_int64_phone_number(value:this.%s,preserve_length:%t)", formattedColPath, pl), nil
+ opts, err := transformers.NewTransformInt64PhoneNumberOptsFromConfig(config.GetTransformInt64PhoneNumberConfig())
+ if err != nil {
+ return "", err
+ }
+ return opts.BuildBloblangString(formattedColPath), nil
case mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_TRANSFORM_INT64:
- rMin := col.Transformer.Config.GetTransformInt64Config().RandomizationRangeMin
- rMax := col.Transformer.Config.GetTransformInt64Config().RandomizationRangeMax
- return fmt.Sprintf(`transform_int64(value:this.%s,randomization_range_min:%d,randomization_range_max:%d)`, formattedColPath, rMin, rMax), nil
+ opts, err := transformers.NewTransformInt64OptsFromConfig(config.GetTransformInt64Config())
+ if err != nil {
+ return "", err
+ }
+ return opts.BuildBloblangString(formattedColPath), nil
case mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_TRANSFORM_LAST_NAME:
- pl := col.Transformer.Config.GetTransformLastNameConfig().PreserveLength
- return fmt.Sprintf("transform_last_name(value:this.%s,preserve_length:%t,max_length:%d)", formattedColPath, pl, maxLen), nil
+ opts, err := transformers.NewTransformLastNameOptsFromConfig(config.GetTransformLastNameConfig(), &maxLen)
+ if err != nil {
+ return "", err
+ }
+ return opts.BuildBloblangString(formattedColPath), nil
case mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_TRANSFORM_PHONE_NUMBER:
- pl := col.Transformer.Config.GetTransformPhoneNumberConfig().PreserveLength
- return fmt.Sprintf("transform_phone_number(value:this.%s,preserve_length:%t,max_length:%d)", formattedColPath, pl, maxLen), nil
+ opts, err := transformers.NewTransformStringPhoneNumberOptsFromConfig(config.GetTransformPhoneNumberConfig(), &maxLen)
+ if err != nil {
+ return "", err
+ }
+ return opts.BuildBloblangString(formattedColPath), nil
case mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_TRANSFORM_STRING:
- pl := col.Transformer.Config.GetTransformStringConfig().PreserveLength
minLength := int64(3) // todo: we need to pull in this value from the database schema
- return fmt.Sprintf(`transform_string(value:this.%s,preserve_length:%t,min_length:%d,max_length:%d)`, formattedColPath, pl, minLength, maxLen), nil
+ opts, err := transformers.NewTransformStringOptsFromConfig(config.GetTransformStringConfig(), &minLength, &maxLen)
+ if err != nil {
+ return "", err
+ }
+ return opts.BuildBloblangString(formattedColPath), nil
case mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_NULL:
return shared.NullString, nil
case mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_DEFAULT:
return `"DEFAULT"`, nil
case mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_TRANSFORM_CHARACTER_SCRAMBLE:
- regex := col.Transformer.Config.GetTransformCharacterScrambleConfig().UserProvidedRegex
-
- if regex != nil {
- regexValue := *regex
- return fmt.Sprintf(`transform_character_scramble(value:this.%s,user_provided_regex:%q)`, formattedColPath, regexValue), nil
- } else {
- return fmt.Sprintf(`transform_character_scramble(value:this.%s)`, formattedColPath), nil
+ opts, err := transformers.NewTransformCharacterScrambleOptsFromConfig(config.GetTransformCharacterScrambleConfig())
+ if err != nil {
+ return "", err
}
+ return opts.BuildBloblangString(formattedColPath), nil
case mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_GENERATE_COUNTRY:
- generateFullName := col.Transformer.Config.GetGenerateCountryConfig().GenerateFullName
- return fmt.Sprintf(`generate_country(generate_full_name:%t)`, generateFullName), nil
-
+ opts, err := transformers.NewGenerateCountryOptsFromConfig(config.GetGenerateCountryConfig())
+ if err != nil {
+ return "", err
+ }
+ return opts.BuildBloblangString(), nil
default:
return "", fmt.Errorf("unsupported transformer")
}
}
-
-func dtoEmailTypeToBenthosEmailType(dto mgmtv1alpha1.GenerateEmailType) transformers.GenerateEmailType {
- switch dto {
- case mgmtv1alpha1.GenerateEmailType_GENERATE_EMAIL_TYPE_FULLNAME:
- return transformers.GenerateEmailType_FullName
- default:
- return transformers.GenerateEmailType_UuidV4
- }
-}
-
-func dtoInvalidEmailActionToBenthosInvalidEmailAction(dto mgmtv1alpha1.InvalidEmailAction) transformers.InvalidEmailAction {
- switch dto {
- case mgmtv1alpha1.InvalidEmailAction_INVALID_EMAIL_ACTION_GENERATE:
- return transformers.InvalidEmailAction_Generate
- case mgmtv1alpha1.InvalidEmailAction_INVALID_EMAIL_ACTION_NULL:
- return transformers.InvalidEmailAction_Null
- case mgmtv1alpha1.InvalidEmailAction_INVALID_EMAIL_ACTION_PASSTHROUGH:
- return transformers.InvalidEmailAction_Passthrough
- default:
- return transformers.InvalidEmailAction_Reject
- }
-}
diff --git a/worker/pkg/workflows/datasync/activities/gen-benthos-configs/utils.go b/worker/pkg/workflows/datasync/activities/gen-benthos-configs/utils.go
index 620c787367..5da2ccc3ac 100644
--- a/worker/pkg/workflows/datasync/activities/gen-benthos-configs/utils.go
+++ b/worker/pkg/workflows/datasync/activities/gen-benthos-configs/utils.go
@@ -1,28 +1,12 @@
package genbenthosconfigs_activity
import (
- "encoding/json"
"fmt"
"strings"
mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
)
-func convertStringSliceToString(slc []string) (string, error) {
- var returnStr string
-
- if len(slc) == 0 {
- returnStr = "[]"
- } else {
- sliceBytes, err := json.Marshal(slc)
- if err != nil {
- return "", err
- }
- returnStr = string(sliceBytes)
- }
- return returnStr, nil
-}
-
func getMapValuesCount[K comparable, V any](m map[K][]V) int {
count := 0
for _, v := range m {
diff --git a/worker/pkg/workflows/datasync/activities/run-sql-init-table-stmts/init-statement-builder_test.go b/worker/pkg/workflows/datasync/activities/run-sql-init-table-stmts/init-statement-builder_test.go
index 924bdb1142..e73d480a5a 100644
--- a/worker/pkg/workflows/datasync/activities/run-sql-init-table-stmts/init-statement-builder_test.go
+++ b/worker/pkg/workflows/datasync/activities/run-sql-init-table-stmts/init-statement-builder_test.go
@@ -11,6 +11,7 @@ import (
"github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1/mgmtv1alpha1connect"
"github.com/nucleuscloud/neosync/backend/pkg/sqlmanager"
sqlmanager_shared "github.com/nucleuscloud/neosync/backend/pkg/sqlmanager/shared"
+ "github.com/nucleuscloud/neosync/internal/gotypeutil"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
)
@@ -56,7 +57,7 @@ func Test_InitStatementBuilder_Pg_Generate_InitSchema(t *testing.T) {
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_GenerateUuidConfig{
GenerateUuidConfig: &mgmtv1alpha1.GenerateUuid{
- IncludeHyphens: true,
+ IncludeHyphens: gotypeutil.ToPtr(true),
},
},
},
@@ -204,7 +205,7 @@ func Test_InitStatementBuilder_Pg_Generate_NoInitStatement(t *testing.T) {
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_GenerateUuidConfig{
GenerateUuidConfig: &mgmtv1alpha1.GenerateUuid{
- IncludeHyphens: true,
+ IncludeHyphens: gotypeutil.ToPtr(true),
},
},
},
@@ -307,7 +308,7 @@ func Test_InitStatementBuilder_Pg_TruncateCascade(t *testing.T) {
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_GenerateUuidConfig{
GenerateUuidConfig: &mgmtv1alpha1.GenerateUuid{
- IncludeHyphens: true,
+ IncludeHyphens: gotypeutil.ToPtr(true),
},
},
},
@@ -335,7 +336,7 @@ func Test_InitStatementBuilder_Pg_TruncateCascade(t *testing.T) {
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_GenerateUuidConfig{
GenerateUuidConfig: &mgmtv1alpha1.GenerateUuid{
- IncludeHyphens: true,
+ IncludeHyphens: gotypeutil.ToPtr(true),
},
},
},
@@ -439,7 +440,7 @@ func Test_InitStatementBuilder_Pg_Truncate(t *testing.T) {
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_GenerateUuidConfig{
GenerateUuidConfig: &mgmtv1alpha1.GenerateUuid{
- IncludeHyphens: true,
+ IncludeHyphens: gotypeutil.ToPtr(true),
},
},
},
@@ -467,7 +468,7 @@ func Test_InitStatementBuilder_Pg_Truncate(t *testing.T) {
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_GenerateUuidConfig{
GenerateUuidConfig: &mgmtv1alpha1.GenerateUuid{
- IncludeHyphens: true,
+ IncludeHyphens: gotypeutil.ToPtr(true),
},
},
},
@@ -579,7 +580,7 @@ func Test_InitStatementBuilder_Pg_InitSchema(t *testing.T) {
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_GenerateUuidConfig{
GenerateUuidConfig: &mgmtv1alpha1.GenerateUuid{
- IncludeHyphens: true,
+ IncludeHyphens: gotypeutil.ToPtr(true),
},
},
},
@@ -607,7 +608,7 @@ func Test_InitStatementBuilder_Pg_InitSchema(t *testing.T) {
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_GenerateUuidConfig{
GenerateUuidConfig: &mgmtv1alpha1.GenerateUuid{
- IncludeHyphens: true,
+ IncludeHyphens: gotypeutil.ToPtr(true),
},
},
},
@@ -722,7 +723,7 @@ func Test_InitStatementBuilder_Mysql_Generate(t *testing.T) {
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_GenerateUuidConfig{
GenerateUuidConfig: &mgmtv1alpha1.GenerateUuid{
- IncludeHyphens: true,
+ IncludeHyphens: gotypeutil.ToPtr(true),
},
},
},
diff --git a/worker/pkg/workflows/datasync/workflow/testdata/mysql/composite-keys/tests.go b/worker/pkg/workflows/datasync/workflow/testdata/mysql/composite-keys/tests.go
index e7a8933dea..ba260078da 100644
--- a/worker/pkg/workflows/datasync/workflow/testdata/mysql/composite-keys/tests.go
+++ b/worker/pkg/workflows/datasync/workflow/testdata/mysql/composite-keys/tests.go
@@ -2,6 +2,7 @@ package mysql_compositekeys
import (
mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
+ "github.com/nucleuscloud/neosync/internal/gotypeutil"
workflow_testdata "github.com/nucleuscloud/neosync/worker/pkg/workflows/datasync/workflow/testdata"
)
@@ -43,7 +44,7 @@ func getPkTransformerJobmappings() []*mgmtv1alpha1.JobMapping {
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_GenerateUuidConfig{
GenerateUuidConfig: &mgmtv1alpha1.GenerateUuid{
- IncludeHyphens: true,
+ IncludeHyphens: gotypeutil.ToPtr(true),
},
},
},
diff --git a/worker/pkg/workflows/datasync/workflow/testdata/primary-key-transformer/tests.go b/worker/pkg/workflows/datasync/workflow/testdata/primary-key-transformer/tests.go
index 3a9e0d6362..098067bfd2 100644
--- a/worker/pkg/workflows/datasync/workflow/testdata/primary-key-transformer/tests.go
+++ b/worker/pkg/workflows/datasync/workflow/testdata/primary-key-transformer/tests.go
@@ -2,6 +2,7 @@ package testdata_primarykeytransformer
import (
mgmtv1alpha1 "github.com/nucleuscloud/neosync/backend/gen/go/protos/mgmt/v1alpha1"
+ "github.com/nucleuscloud/neosync/internal/gotypeutil"
workflow_testdata "github.com/nucleuscloud/neosync/worker/pkg/workflows/datasync/workflow/testdata"
)
@@ -42,7 +43,7 @@ func getPkTransformerJobmappings() []*mgmtv1alpha1.JobMapping {
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_GenerateUuidConfig{
GenerateUuidConfig: &mgmtv1alpha1.GenerateUuid{
- IncludeHyphens: true,
+ IncludeHyphens: gotypeutil.ToPtr(true),
},
},
},
diff --git a/worker/pkg/workflows/datasync/workflow/workflow_integration_test.go b/worker/pkg/workflows/datasync/workflow/workflow_integration_test.go
index 3af8e4e0aa..77153757e5 100644
--- a/worker/pkg/workflows/datasync/workflow/workflow_integration_test.go
+++ b/worker/pkg/workflows/datasync/workflow/workflow_integration_test.go
@@ -19,6 +19,7 @@ import (
"github.com/nucleuscloud/neosync/backend/pkg/sqlconnect"
sql_manager "github.com/nucleuscloud/neosync/backend/pkg/sqlmanager"
sqlmanager_shared "github.com/nucleuscloud/neosync/backend/pkg/sqlmanager/shared"
+ "github.com/nucleuscloud/neosync/internal/gotypeutil"
accountstatus_activity "github.com/nucleuscloud/neosync/worker/pkg/workflows/datasync/activities/account-status"
genbenthosconfigs_activity "github.com/nucleuscloud/neosync/worker/pkg/workflows/datasync/activities/gen-benthos-configs"
runsqlinittablestmts_activity "github.com/nucleuscloud/neosync/worker/pkg/workflows/datasync/activities/run-sql-init-table-stmts"
@@ -1072,7 +1073,7 @@ func getAllDynamoDBSyncTests() map[string][]*workflow_testdata.IntegrationTest {
Source: mgmtv1alpha1.TransformerSource_TRANSFORMER_SOURCE_TRANSFORM_INT64,
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_TransformInt64Config{
- TransformInt64Config: &mgmtv1alpha1.TransformInt64{RandomizationRangeMin: 10, RandomizationRangeMax: 1000},
+ TransformInt64Config: &mgmtv1alpha1.TransformInt64{RandomizationRangeMin: gotypeutil.ToPtr(int64(10)), RandomizationRangeMax: gotypeutil.ToPtr(int64(1000))},
},
},
},
@@ -1309,7 +1310,7 @@ func getAllMongoDBSyncTests() map[string][]*workflow_testdata.IntegrationTest {
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_TransformStringConfig{
TransformStringConfig: &mgmtv1alpha1.TransformString{
- PreserveLength: true,
+ PreserveLength: gotypeutil.ToPtr(true),
},
},
},
@@ -1337,8 +1338,8 @@ func getAllMongoDBSyncTests() map[string][]*workflow_testdata.IntegrationTest {
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_TransformFloat64Config{
TransformFloat64Config: &mgmtv1alpha1.TransformFloat64{
- RandomizationRangeMin: 0,
- RandomizationRangeMax: 300,
+ RandomizationRangeMin: gotypeutil.ToPtr(float64(0)),
+ RandomizationRangeMax: gotypeutil.ToPtr(float64(300)),
},
},
},
@@ -1353,8 +1354,8 @@ func getAllMongoDBSyncTests() map[string][]*workflow_testdata.IntegrationTest {
Config: &mgmtv1alpha1.TransformerConfig{
Config: &mgmtv1alpha1.TransformerConfig_TransformInt64Config{
TransformInt64Config: &mgmtv1alpha1.TransformInt64{
- RandomizationRangeMin: 0,
- RandomizationRangeMax: 300,
+ RandomizationRangeMin: gotypeutil.ToPtr(int64(0)),
+ RandomizationRangeMax: gotypeutil.ToPtr(int64(300)),
},
},
},