vwo-sdk 1.23.1 → 1.23.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f36297d491673769eab11fc07c0c33388da361b564fc1888a078f251a53a695e
4
- data.tar.gz: e1ef625b6ed40c6223d90a019f35e276fc6c5252e91b004f68d1ffab5fd72d41
3
+ metadata.gz: c878b24cefb4bf2da034a1dec355b96d38650c52018dc8516f7e324e8469ae0e
4
+ data.tar.gz: ea385bb48e6aebdc4975b08449161cd24dbf075dc582959492f8ff7d7bcc751f
5
5
  SHA512:
6
- metadata.gz: ec99893b52fad4cdfb156d8d46b69c3b2f526fb25f0bfda2c27205f938fe3918853edb969534256edb47d16100fc54cd1061924a5bd24097aea256b649c80431
7
- data.tar.gz: 73572a0f681bde9fd8f03b426097a4ee1bda9d8acda8048260f839559b3a20497f52f4c94dc6b28f41abde5a0fd91e4f31f2dc62031a423f7409970f1cfe8048
6
+ metadata.gz: b424bfd4bc9eaab32001d67da2c5acb57b072ab935c9e4f24206ad9329e7a29f76d3498d497224e9adace85b2dcff0d37ade16e9864a651e02c434e8e788443c
7
+ data.tar.gz: e16e7e7e276fbb9ccbaa9c605e17790116b1e925a766a5f0252991c187a91bfaa4d00fa2ff1445d5cf98443e02e55fa7516845dce36974dd0e56301a86296e86
data/lib/vwo/constants.rb CHANGED
@@ -27,7 +27,7 @@ class VWO
27
27
  HTTP_PROTOCOL = 'http://'
28
28
  HTTPS_PROTOCOL = 'https://'
29
29
  URL_NAMESPACE = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'
30
- SDK_VERSION = '1.23.1'
30
+ SDK_VERSION = '1.23.2'
31
31
  SDK_NAME = 'ruby'
32
32
  VWO_DELIMITER = '_vwo_'
33
33
  MAX_EVENTS_PER_REQUEST = 5000
@@ -95,6 +95,10 @@ class VWO
95
95
  :vwo_user_id => generator_for(user_id, @settings_file['accountId'])
96
96
  }
97
97
 
98
+ if campaign.has_key?("name")
99
+ decision[:campaign_name] = campaign['name']
100
+ end
101
+
98
102
  if is_campaign_part_of_group
99
103
  group_id = @settings_file["campaignGroups"][campaign["id"].to_s]
100
104
  decision[:group_id] = group_id
data/lib/vwo/enums.rb CHANGED
@@ -128,9 +128,9 @@ class VWO
128
128
  AUDIENCE_CONDITION_NOT_MET = '(%<file>s): userId:%<user_id>s does not become part of campaign because of not meeting audience conditions'
129
129
  GOT_VARIATION_FOR_USER = '(%<file>s): userId:%<user_id>s for campaign:%<campaign_key>s got variationName:%<variation_name>s'
130
130
  USER_GOT_NO_VARIATION = '(%<file>s): userId:%<user_id>s for campaign:%<campaign_key>s did not allot any variation'
131
- IMPRESSION_SUCCESS = '(%<file>s): Impression event - %<end_point>s was successfully received by VWO having main keys: sdkKey:%<sdk_key>s accountId:%<account_id>s campaignId:%<campaign_id>s and variationId:%<variation_id>s'
132
- MAIN_KEYS_FOR_IMPRESSION = '(%<file>s): Having main keys: {sdkKey:%<sdk_key>s accountId:%<account_id>s campaignId:%<campaign_id>s and variationId:%<variation_id>s}'
133
- MAIN_KEYS_FOR_PUSH_API = '(%<file>s): Having main keys: {sdkKey:%<sdk_key>s accountId:%<account_id>s u:%<u>s and tags:%<tags>s}'
131
+ IMPRESSION_SUCCESS = '(%<file>s): Impression event - %<end_point>s was successfully received by VWO having main keys: accountId:%<account_id>s campaignId:%<campaign_id>s and variationId:%<variation_id>s'
132
+ MAIN_KEYS_FOR_IMPRESSION = '(%<file>s): Having main keys: accountId:%<account_id>s campaignId:%<campaign_id>s and variationId:%<variation_id>s}'
133
+ MAIN_KEYS_FOR_PUSH_API = '(%<file>s): Having main keys: accountId:%<account_id>s u:%<u>s and tags:%<tags>s}'
134
134
  INVALID_VARIATION_KEY = '(%<file>s): Variation was not assigned to userId:%<user_id>s for campaign:%<campaign_key>s'
135
135
 
136
136
  USER_IN_FEATURE_ROLLOUT = '(%<file>s): User ID:%<user_id>s is in feature rollout:%<campaign_key>s'
@@ -73,6 +73,9 @@ class VWO
73
73
  key: {
74
74
  type: ['string']
75
75
  },
76
+ name: {
77
+ type: ['string']
78
+ },
76
79
  status: {
77
80
  type: ['string']
78
81
  },
@@ -78,7 +78,9 @@ class VWO
78
78
  i: @sdk_key,
79
79
  r: get_random_number,
80
80
  platform: 'server',
81
- 'api-version' => 1
81
+ 'api-version' => 1,
82
+ 'sdk-v' => VWO::CONSTANTS::SDK_VERSION,
83
+ 'sdk' => VWO::CONSTANTS::SDK_NAME
82
84
  }
83
85
  end
84
86
  end
@@ -17,6 +17,7 @@ require_relative '../logger'
17
17
  require_relative '../enums'
18
18
  require_relative '../constants'
19
19
  require_relative './impression'
20
+ require_relative './utility'
20
21
 
21
22
  # Utility module for helper math and random functions
22
23
  class VWO
@@ -25,6 +26,7 @@ class VWO
25
26
  include VWO::CONSTANTS
26
27
  include VWO::Enums
27
28
  include VWO::Utils::Impression
29
+ include VWO::Utils::Utility
28
30
 
29
31
  def get_url_params(settings_file, tag_key, tag_value, user_id, sdk_key)
30
32
  url = HTTPS_PROTOCOL + ENDPOINTS::BASE_URL + ENDPOINTS::PUSH
@@ -39,7 +41,7 @@ class VWO
39
41
  format(
40
42
  LogMessageEnum::DebugMessages::PARAMS_FOR_PUSH_CALL,
41
43
  file: FileNameEnum::CustomDimensionsUtil,
42
- properties: JSON.generate(params)
44
+ properties: remove_sensitive_properties(params)
43
45
  )
44
46
  )
45
47
  params
@@ -19,6 +19,7 @@ require_relative '../enums'
19
19
  require_relative '../constants'
20
20
  require_relative 'function'
21
21
  require_relative 'uuid'
22
+ require_relative 'utility'
22
23
 
23
24
  # Creates the impression from the arguments passed
24
25
  class VWO
@@ -28,6 +29,7 @@ class VWO
28
29
  include VWO::CONSTANTS
29
30
  include VWO::Utils::Function
30
31
  include UUID
32
+ include VWO::Utils::Utility
31
33
 
32
34
  # Creates the impression from the arguments passed
33
35
  #
@@ -76,7 +78,7 @@ class VWO
76
78
  format(
77
79
  LogMessageEnum::DebugMessages::IMPRESSION_FOR_TRACK_USER,
78
80
  file: FileNameEnum::ImpressionUtil,
79
- properties: JSON.generate(impression)
81
+ properties: remove_sensitive_properties(impression)
80
82
  )
81
83
  )
82
84
  else
@@ -88,7 +90,7 @@ class VWO
88
90
  format(
89
91
  LogMessageEnum::DebugMessages::IMPRESSION_FOR_TRACK_GOAL,
90
92
  file: FileNameEnum::ImpressionUtil,
91
- properties: JSON.generate(impression)
93
+ properties: remove_sensitive_properties(impression)
92
94
  )
93
95
  )
94
96
  end
@@ -35,6 +35,12 @@ class VWO
35
35
  end
36
36
  convertedHash
37
37
  end
38
+
39
+ def remove_sensitive_properties(properties)
40
+ properties.delete("env")
41
+ properties.delete("env".to_sym)
42
+ JSON.generate(properties)
43
+ end
38
44
  end
39
45
  end
40
46
  end
data/lib/vwo.rb CHANGED
@@ -408,7 +408,6 @@ class VWO
408
408
  format(
409
409
  LogMessageEnum::InfoMessages::IMPRESSION_SUCCESS,
410
410
  file: FILE,
411
- sdk_key: @sdk_key,
412
411
  account_id: @account_id,
413
412
  campaign_id: campaign['id'],
414
413
  variation_id: variation['id'],
@@ -725,7 +724,6 @@ class VWO
725
724
  format(
726
725
  LogMessageEnum::InfoMessages::IMPRESSION_SUCCESS,
727
726
  file: FILE,
728
- sdk_key: @sdk_key,
729
727
  account_id: @account_id,
730
728
  campaign_id: campaign['id'],
731
729
  variation_id: variation['id'],
@@ -737,7 +735,6 @@ class VWO
737
735
  format(
738
736
  LogMessageEnum::InfoMessages::MAIN_KEYS_FOR_IMPRESSION,
739
737
  file: FILE,
740
- sdk_key: @sdk_key,
741
738
  campaign_id: impression[:experiment_id],
742
739
  account_id: impression[:account_id],
743
740
  variation_id: impression[:combination]
@@ -905,7 +902,6 @@ class VWO
905
902
  LogMessageEnum::InfoMessages::MAIN_KEYS_FOR_IMPRESSION,
906
903
  file: FILE,
907
904
  campaign_id: impression[:experiment_id],
908
- sdk_key: @sdk_key,
909
905
  account_id: impression[:account_id],
910
906
  variation_id: impression[:combination]
911
907
  )
@@ -1206,7 +1202,6 @@ class VWO
1206
1202
  format(
1207
1203
  LogMessageEnum::InfoMessages::MAIN_KEYS_FOR_PUSH_API,
1208
1204
  file: FILE,
1209
- sdk_key: @sdk_key,
1210
1205
  u: impression['u'],
1211
1206
  account_id: impression['account_id'],
1212
1207
  tags: impression['tags']
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vwo-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.23.1
4
+ version: 1.23.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - VWO
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-21 00:00:00.000000000 Z
11
+ date: 2021-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: codecov