vwo-fme-ruby-sdk 1.2.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/resources/debug_messages.json +8 -1
- data/lib/resources/error_messages.json +5 -1
- data/lib/resources/info_messages.json +9 -1
- data/lib/vwo/api/get_flag.rb +30 -27
- data/lib/vwo/api/set_attribute.rb +10 -3
- data/lib/vwo/api/track_event.rb +11 -3
- data/lib/vwo/constants/constants.rb +6 -2
- data/lib/vwo/decorators/storage_decorator.rb +1 -1
- data/lib/vwo/enums/api_enum.rb +1 -1
- data/lib/vwo/enums/campaign_type_enum.rb +1 -1
- data/lib/vwo/enums/decision_types_enum.rb +1 -1
- data/lib/vwo/enums/event_enum.rb +1 -1
- data/lib/vwo/enums/headers_enum.rb +1 -1
- data/lib/vwo/enums/hooks_enum.rb +1 -1
- data/lib/vwo/enums/http_method_enum.rb +1 -1
- data/lib/vwo/enums/log_level_enum.rb +1 -1
- data/lib/vwo/enums/log_level_to_number.rb +27 -0
- data/lib/vwo/enums/status_enum.rb +1 -1
- data/lib/vwo/enums/storage_enum.rb +1 -1
- data/lib/vwo/enums/url_enum.rb +2 -1
- data/lib/vwo/models/campaign/campaign_model.rb +1 -1
- data/lib/vwo/models/campaign/feature_model.rb +1 -1
- data/lib/vwo/models/campaign/impact_campaign_model.rb +1 -1
- data/lib/vwo/models/campaign/metric_model.rb +1 -1
- data/lib/vwo/models/campaign/rule_model.rb +1 -1
- data/lib/vwo/models/campaign/variable_model.rb +1 -1
- data/lib/vwo/models/campaign/variation_model.rb +1 -1
- data/lib/vwo/models/gateway_service_model.rb +1 -1
- data/lib/vwo/models/schemas/settings_schema_validation.rb +1 -1
- data/lib/vwo/models/settings/settings_model.rb +8 -2
- data/lib/vwo/models/storage/storage_data_model.rb +1 -1
- data/lib/vwo/models/user/context_model.rb +1 -1
- data/lib/vwo/models/user/context_vwo_model.rb +1 -1
- data/lib/vwo/models/user/get_flag_response.rb +1 -1
- data/lib/vwo/models/vwo_options_model.rb +13 -2
- data/lib/vwo/packages/decision_maker/decision_maker.rb +1 -1
- data/lib/vwo/packages/logger/core/log_manager.rb +1 -1
- data/lib/vwo/packages/logger/core/transport_manager.rb +4 -15
- data/lib/vwo/packages/logger/log_message_builder.rb +1 -1
- data/lib/vwo/packages/logger/logger.rb +1 -1
- data/lib/vwo/packages/logger/transports/console_transport.rb +1 -1
- data/lib/vwo/packages/network_layer/client/network_client.rb +39 -25
- data/lib/vwo/packages/network_layer/handlers/request_handler.rb +1 -1
- data/lib/vwo/packages/network_layer/manager/network_manager.rb +6 -4
- data/lib/vwo/packages/network_layer/models/global_request_model.rb +1 -1
- data/lib/vwo/packages/network_layer/models/request_model.rb +1 -1
- data/lib/vwo/packages/network_layer/models/response_model.rb +9 -1
- data/lib/vwo/packages/segmentation_evaluator/core/segmentation_manager.rb +1 -1
- data/lib/vwo/packages/segmentation_evaluator/enums/segment_operand_regex_enum.rb +1 -1
- data/lib/vwo/packages/segmentation_evaluator/enums/segment_operand_value_enum.rb +1 -1
- data/lib/vwo/packages/segmentation_evaluator/enums/segment_operator_value_enum.rb +1 -1
- data/lib/vwo/packages/segmentation_evaluator/evaluators/segment_evaluator.rb +1 -1
- data/lib/vwo/packages/segmentation_evaluator/evaluators/segment_operand_evaluator.rb +1 -1
- data/lib/vwo/packages/segmentation_evaluator/utils/segment_util.rb +1 -1
- data/lib/vwo/packages/storage/connector.rb +1 -1
- data/lib/vwo/packages/storage/storage.rb +3 -1
- data/lib/vwo/services/batch_event_queue.rb +179 -0
- data/lib/vwo/services/campaign_decision_service.rb +1 -1
- data/lib/vwo/services/hooks_service.rb +1 -1
- data/lib/vwo/services/logger_service.rb +1 -1
- data/lib/vwo/services/settings_service.rb +4 -2
- data/lib/vwo/services/storage_service.rb +1 -1
- data/lib/vwo/utils/batch_event_dispatcher.rb +117 -0
- data/lib/vwo/utils/campaign_util.rb +1 -1
- data/lib/vwo/utils/data_type_util.rb +1 -1
- data/lib/vwo/utils/decision_util.rb +1 -1
- data/lib/vwo/utils/function_util.rb +5 -1
- data/lib/vwo/utils/gateway_service_util.rb +1 -1
- data/lib/vwo/utils/impression_util.rb +10 -3
- data/lib/vwo/utils/log_message_util.rb +1 -1
- data/lib/vwo/utils/meg_util.rb +1 -1
- data/lib/vwo/utils/network_util.rb +31 -8
- data/lib/vwo/utils/rule_evaluation_util.rb +1 -1
- data/lib/vwo/utils/settings_util.rb +1 -1
- data/lib/vwo/utils/url_util.rb +1 -1
- data/lib/vwo/utils/usage_stats_util.rb +117 -0
- data/lib/vwo/utils/uuid_util.rb +1 -1
- data/lib/vwo/vwo_builder.rb +107 -24
- data/lib/vwo/vwo_client.rb +23 -4
- data/lib/vwo.rb +3 -1
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a93237647aaaac411d5ecd0d6eed52c33778282ab781ffc236ea2b46ed88a3e5
|
4
|
+
data.tar.gz: 52eecf7bf9d7f96c194715e510e0190346aa1f1f63f941fbbf311e9786364097
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6eb2497b2968e79662cd6161ee4b4fa849510bb1fa6edefd3b4becaec0b10be48c01bb7aec48f84f4b139048bec79cdf4dd97366a2a124519491c940a6c82fe
|
7
|
+
data.tar.gz: 8db5b2ee18a59597d9ef3072e847defaf7aaab30d93426cf1c15229a451591903c91e8c2f0627a6b48b1c5d85a59beff749e017d222f2a494cae7869915dac5d
|
@@ -1,6 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"API_CALLED": "API - {apiName} called",
|
3
3
|
"SERVICE_INITIALIZED": "VWO {service} initialized while creating an instance of SDK",
|
4
|
+
"USING_POLL_INTERVAL_FROM_SETTINGS": "key: poll_interval not found or invalid. Using poll_interval from {source} ({pollInterval})",
|
4
5
|
|
5
6
|
"EXPERIMENTS_EVALUATION_WHEN_ROLLOUT_PASSED": "Rollout rule got passed for user {userId}. Hence, evaluating experiments",
|
6
7
|
"EXPERIMENTS_EVALUATION_WHEN_NO_ROLLOUT_PRESENT": "No Rollout rules present for the feature. Hence, checking experiment rules",
|
@@ -9,5 +10,11 @@
|
|
9
10
|
|
10
11
|
"IMPRESSION_FOR_TRACK_USER": "Impression built for vwo_variationShown(VWO standard event for tracking user) event haivng Account ID:{accountId}, User ID:{userId}, and experiment ID:{campaignId}",
|
11
12
|
"IMPRESSION_FOR_TRACK_GOAL": "Impression built for event:{eventName} event having Account ID:{accountId}, and user ID:{userId}",
|
12
|
-
"IMPRESSION_FOR_SYNC_VISITOR_PROP": "Impression built for {eventName}(VWO internal event) event for Account ID:{accountId}, and user ID:{userId}"
|
13
|
+
"IMPRESSION_FOR_SYNC_VISITOR_PROP": "Impression built for {eventName}(VWO internal event) event for Account ID:{accountId}, and user ID:{userId}",
|
14
|
+
|
15
|
+
"CONFIG_BATCH_EVENT_LIMIT_EXCEEDED": "Impression event - {endPoint} failed due to exceeding payload size. Parameter eventsPerRequest in batchEvents config in init API has value:{eventsPerRequest} for account ID:{accountId}. Please read the official documentation for knowing the size limits",
|
16
|
+
|
17
|
+
"EVENT_BATCH_BEFORE_FLUSHING": "Flushing event queue {manually} having {length} events for Account ID:{accountId}. {timer}",
|
18
|
+
"EVENT_BATCH_FLUSH": "Manually flushing batch events for Account ID:{accountId} having {queueLength} events",
|
19
|
+
"BATCH_QUEUE_EMPTY": "Batch queue is empty. Nothing to flush."
|
13
20
|
}
|
@@ -26,5 +26,9 @@
|
|
26
26
|
"NETWORK_CALL_FAILED": "Error occurred while sending {method} request. Error:{err}",
|
27
27
|
"SETTINGS_FETCH_FAILED": "Failed to fetch settings and hence VWO client instance couldn't be updated when API: {apiName} got called having isViaWebhook param as {isViaWebhook}. Error: {err}",
|
28
28
|
"NETWORK_CALL_RETRY_ATTEMPT": "Request failed for {endPoint}, Error: {err}. Retrying in {delay} seconds, attempt {attempt} of {maxRetries}",
|
29
|
-
"NETWORK_CALL_RETRY_FAILED": "Max retries reached. Request failed for {endPoint}, Error: {err}"
|
29
|
+
"NETWORK_CALL_RETRY_FAILED": "Max retries reached. Request failed for {endPoint}, Error: {err}",
|
30
|
+
|
31
|
+
"CONFIG_PARAMETER_INVALID": "{parameter} paased in {api} API is not correct. It should be of type:{type}}",
|
32
|
+
"BATCH_QUEUE_EMPTY": "No batch queue present for account:{accountId} when calling flushEvents API. Check batchEvents config in init API",
|
33
|
+
"INVALID_BATCH_EVENTS_CONFIG": "Invalid batch events config, should be a hash, events_per_request should be a number greater than 0 and request_time_interval should be a number greater than 0"
|
30
34
|
}
|
@@ -29,5 +29,13 @@
|
|
29
29
|
"MEG_CAMPAIGN_ELIGIBLE": "Campaign {campaignKey} is eligible for user ID:{userId}",
|
30
30
|
"MEG_WINNER_CAMPAIGN": "MEG: Campaign {campaignKey} is the winner for group {groupId} for user ID:{userId} {algo}",
|
31
31
|
"SETTINGS_UPDATED": "Settings fetched and updated successfully on the current VWO client instance when API: {apiName} got called having isViaWebhook param as {isViaWebhook}",
|
32
|
-
"NETWORK_CALL_SUCCESS": "Impression for {event} - {endPoint} was successfully received by VWO having Account ID:{accountId}, User ID:{userId} and UUID: {uuid}"
|
32
|
+
"NETWORK_CALL_SUCCESS": "Impression for {event} - {endPoint} was successfully received by VWO having Account ID:{accountId}, User ID:{userId} and UUID: {uuid}",
|
33
|
+
|
34
|
+
"EVENT_BATCH_DEFAULTS": "{parameter} in SDK configuration is missing or invalid (should be greater than {minLimit}). Using default value: {defaultValue}",
|
35
|
+
"EVENT_QUEUE": "Event with payload:{event} pushed to the {queueType} queue",
|
36
|
+
"EVENT_BATCH_After_FLUSHING": "Event queue having {length} events has been flushed {manually}",
|
37
|
+
"IMPRESSION_BATCH_SUCCESS": "Impression event - {endPoint} was successfully received by VWO having Account ID:{accountId}",
|
38
|
+
"IMPRESSION_BATCH_FAILED": "Batch events couldn\"t be received by VWO. Calling Flush Callback with error and data",
|
39
|
+
"EVENT_BATCH_MAX_LIMIT": "{parameter} passed in SDK configuration is greater than the maximum limit of {maxLimit}. Setting it to the maximum limit",
|
40
|
+
"GATEWAY_AND_BATCH_EVENTS_CONFIG_MISMATCH": "Batch Events config passed in SDK configuration will not work as the gatewayService is already configured. Please check the documentation for more details"
|
33
41
|
}
|
data/lib/vwo/api/get_flag.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright 2025 Wingify Software Pvt. Ltd.
|
1
|
+
# Copyright 2024-2025 Wingify Software Pvt. Ltd.
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
@@ -26,6 +26,7 @@ require_relative '../utils/rule_evaluation_util'
|
|
26
26
|
require_relative '../utils/impression_util'
|
27
27
|
require_relative '../utils/decision_util'
|
28
28
|
require_relative '../models/user/get_flag_response'
|
29
|
+
require_relative '../packages/storage/storage'
|
29
30
|
|
30
31
|
class FlagApi
|
31
32
|
# Get the flag for a given feature key and context
|
@@ -55,35 +56,37 @@ class FlagApi
|
|
55
56
|
}
|
56
57
|
|
57
58
|
storage_service = StorageService.new
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
if stored_data[:
|
62
|
-
|
63
|
-
|
59
|
+
if Storage.instance.is_storage_enabled
|
60
|
+
stored_data = StorageDecorator.new.get_feature_from_storage(feature_key, context, storage_service)
|
61
|
+
|
62
|
+
if stored_data && stored_data[:experiment_variation_id]
|
63
|
+
if stored_data[:experiment_key]
|
64
|
+
variation = CampaignUtil.get_variation_from_campaign_key(settings, stored_data[:experiment_key], stored_data[:experiment_variation_id])
|
65
|
+
|
66
|
+
if variation
|
67
|
+
LoggerService.log(LogLevelEnum::INFO, "STORED_VARIATION_FOUND", {variationKey: variation.get_key, userId: context.get_id, experimentKey: stored_data[:experiment_key], experimentType: "experiment"})
|
68
|
+
return GetFlagResponse.new(true, variation.get_variables)
|
69
|
+
end
|
70
|
+
end
|
71
|
+
elsif stored_data && stored_data[:rollout_key] && stored_data[:rollout_id]
|
72
|
+
variation = CampaignUtil.get_variation_from_campaign_key(settings, stored_data[:rollout_key], stored_data[:rollout_variation_id])
|
73
|
+
|
64
74
|
if variation
|
65
|
-
LoggerService.log(LogLevelEnum::INFO, "STORED_VARIATION_FOUND", {variationKey: variation.get_key, userId: context.get_id, experimentKey: stored_data[:
|
66
|
-
|
75
|
+
LoggerService.log(LogLevelEnum::INFO, "STORED_VARIATION_FOUND", {variationKey: variation.get_key, userId: context.get_id, experimentKey: stored_data[:rollout_key], experimentType: "rollout"})
|
76
|
+
LoggerService.log(LogLevelEnum::DEBUG, "EXPERIMENTS_EVALUATION_WHEN_ROLLOUT_PASSED", {userId: context.get_id})
|
77
|
+
|
78
|
+
is_enabled = true
|
79
|
+
should_check_for_experiments_rules = true
|
80
|
+
rollout_variation_to_return = variation
|
81
|
+
feature_info = {
|
82
|
+
rollout_id: stored_data[:rollout_id],
|
83
|
+
rollout_key: stored_data[:rollout_key],
|
84
|
+
rollout_variation_id: stored_data[:rollout_variation_id]
|
85
|
+
}
|
86
|
+
evaluated_feature_map[feature_key] = feature_info
|
87
|
+
passed_rules_information.merge!(feature_info)
|
67
88
|
end
|
68
89
|
end
|
69
|
-
elsif stored_data && stored_data[:rollout_key] && stored_data[:rollout_id]
|
70
|
-
variation = CampaignUtil.get_variation_from_campaign_key(settings, stored_data[:rollout_key], stored_data[:rollout_variation_id])
|
71
|
-
|
72
|
-
if variation
|
73
|
-
LoggerService.log(LogLevelEnum::INFO, "STORED_VARIATION_FOUND", {variationKey: variation.get_key, userId: context.get_id, experimentKey: stored_data[:rollout_key], experimentType: "rollout"})
|
74
|
-
LoggerService.log(LogLevelEnum::DEBUG, "EXPERIMENTS_EVALUATION_WHEN_ROLLOUT_PASSED", {userId: context.get_id})
|
75
|
-
|
76
|
-
is_enabled = true
|
77
|
-
should_check_for_experiments_rules = true
|
78
|
-
rollout_variation_to_return = variation
|
79
|
-
feature_info = {
|
80
|
-
rollout_id: stored_data[:rollout_id],
|
81
|
-
rollout_key: stored_data[:rollout_key],
|
82
|
-
rollout_variation_id: stored_data[:rollout_variation_id]
|
83
|
-
}
|
84
|
-
evaluated_feature_map[feature_key] = feature_info
|
85
|
-
passed_rules_information.merge!(feature_info)
|
86
|
-
end
|
87
90
|
end
|
88
91
|
|
89
92
|
if feature.nil?
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright 2025 Wingify Software Pvt. Ltd.
|
1
|
+
# Copyright 2024-2025 Wingify Software Pvt. Ltd.
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
@@ -16,6 +16,7 @@ require_relative '../models/user/context_model'
|
|
16
16
|
require_relative '../enums/event_enum'
|
17
17
|
require_relative '../utils/network_util'
|
18
18
|
require_relative '../models/settings/settings_model'
|
19
|
+
require_relative '../services/batch_event_queue'
|
19
20
|
|
20
21
|
class SetAttributeApi
|
21
22
|
# Sets multiple attributes for a user in a single network call.
|
@@ -51,7 +52,13 @@ class SetAttributeApi
|
|
51
52
|
context.ip_address
|
52
53
|
)
|
53
54
|
|
54
|
-
#
|
55
|
-
|
55
|
+
# check if batching is enabled
|
56
|
+
if BatchEventsQueue.instance
|
57
|
+
# add the payload to the batch events queue
|
58
|
+
BatchEventsQueue.instance.enqueue(payload)
|
59
|
+
else
|
60
|
+
# Send the constructed payload via POST request
|
61
|
+
NetworkUtil.send_post_api_request(properties, payload)
|
62
|
+
end
|
56
63
|
end
|
57
64
|
end
|
data/lib/vwo/api/track_event.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright 2025 Wingify Software Pvt. Ltd.
|
1
|
+
# Copyright 2024-2025 Wingify Software Pvt. Ltd.
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
@@ -19,6 +19,8 @@ require_relative '../services/hooks_service'
|
|
19
19
|
require_relative '../utils/function_util'
|
20
20
|
require_relative '../utils/network_util'
|
21
21
|
require_relative '../services/logger_service'
|
22
|
+
require_relative '../services/batch_event_queue'
|
23
|
+
|
22
24
|
class TrackApi
|
23
25
|
# Tracks an event with given properties and context.
|
24
26
|
# @param settings [SettingsModel] Configuration settings.
|
@@ -71,7 +73,13 @@ class TrackApi
|
|
71
73
|
context.ip_address
|
72
74
|
)
|
73
75
|
|
74
|
-
#
|
75
|
-
|
76
|
+
# check if batching is enabled
|
77
|
+
if BatchEventsQueue.instance
|
78
|
+
# add the payload to the batch events queue
|
79
|
+
BatchEventsQueue.instance.enqueue(payload)
|
80
|
+
else
|
81
|
+
# Send the prepared payload via POST API request
|
82
|
+
NetworkUtil.send_post_api_request(properties, payload)
|
83
|
+
end
|
76
84
|
end
|
77
85
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright 2025 Wingify Software Pvt. Ltd.
|
1
|
+
# Copyright 2024-2025 Wingify Software Pvt. Ltd.
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
@@ -17,7 +17,7 @@
|
|
17
17
|
# Define the Constants module
|
18
18
|
module Constants
|
19
19
|
SDK_NAME = 'vwo-fme-ruby-sdk'.freeze
|
20
|
-
SDK_VERSION = '1.
|
20
|
+
SDK_VERSION = '1.3.1'.freeze
|
21
21
|
|
22
22
|
MAX_TRAFFIC_PERCENT = 100
|
23
23
|
MAX_TRAFFIC_VALUE = 10_000
|
@@ -27,6 +27,8 @@ module Constants
|
|
27
27
|
MAX_EVENTS_PER_REQUEST = 5_000
|
28
28
|
DEFAULT_REQUEST_TIME_INTERVAL = 600 # 10 minutes in seconds
|
29
29
|
DEFAULT_EVENTS_PER_REQUEST = 100
|
30
|
+
MIN_REQUEST_TIME_INTERVAL = 2
|
31
|
+
MIN_EVENTS_PER_REQUEST = 1
|
30
32
|
|
31
33
|
SEED_URL = 'https://vwo.com'.freeze # Define SEED_URL
|
32
34
|
HTTP_PROTOCOL = 'http'.freeze
|
@@ -35,6 +37,7 @@ module Constants
|
|
35
37
|
SETTINGS = 'settings'.freeze
|
36
38
|
SETTINGS_EXPIRY = 10_000_000
|
37
39
|
SETTINGS_TIMEOUT = 50_000
|
40
|
+
POLLING_INTERVAL = 600_000 # 10 minutes in milliseconds
|
38
41
|
|
39
42
|
HOST_NAME = 'dev.visualwebsiteoptimizer.com'.freeze
|
40
43
|
SETTINGS_ENDPOINT = '/server-side/v2-settings'.freeze
|
@@ -51,4 +54,5 @@ module Constants
|
|
51
54
|
|
52
55
|
SHOULD_USE_THREADING = true
|
53
56
|
MAX_POOL_SIZE = 5
|
57
|
+
MAX_QUEUE_SIZE = 10000
|
54
58
|
end
|
data/lib/vwo/enums/api_enum.rb
CHANGED
data/lib/vwo/enums/event_enum.rb
CHANGED
data/lib/vwo/enums/hooks_enum.rb
CHANGED
@@ -0,0 +1,27 @@
|
|
1
|
+
# Copyright 2024-2025 Wingify Software Pvt. Ltd.
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
module LogLevelToNumber
|
16
|
+
LEVELS = {
|
17
|
+
'TRACE' => 0,
|
18
|
+
'DEBUG' => 1,
|
19
|
+
'INFO' => 2,
|
20
|
+
'WARN' => 3,
|
21
|
+
'ERROR' => 4
|
22
|
+
}.freeze
|
23
|
+
|
24
|
+
def self.to_number(level)
|
25
|
+
LEVELS[level.to_s.upcase] || 0
|
26
|
+
end
|
27
|
+
end
|
data/lib/vwo/enums/url_enum.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright 2025 Wingify Software Pvt. Ltd.
|
1
|
+
# Copyright 2024-2025 Wingify Software Pvt. Ltd.
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
@@ -18,4 +18,5 @@ module UrlEnum
|
|
18
18
|
EVENTS = '/events/t'
|
19
19
|
ATTRIBUTE_CHECK = '/check-attribute'
|
20
20
|
GET_USER_DATA = '/get-user-details'
|
21
|
+
BATCH_EVENTS = '/server-side/batch-events-v2'
|
21
22
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright 2025 Wingify Software Pvt. Ltd.
|
1
|
+
# Copyright 2024-2025 Wingify Software Pvt. Ltd.
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
@@ -14,16 +14,18 @@
|
|
14
14
|
|
15
15
|
require_relative '../campaign/campaign_model'
|
16
16
|
require_relative '../campaign/feature_model'
|
17
|
+
require_relative '../../constants/constants'
|
17
18
|
|
18
19
|
class SettingsModel
|
19
20
|
attr_reader :sdk_key, :account_id, :version, :collection_prefix,
|
20
|
-
:features, :campaigns, :campaign_groups, :groups
|
21
|
+
:features, :campaigns, :campaign_groups, :groups, :poll_interval
|
21
22
|
|
22
23
|
def initialize(settings)
|
23
24
|
@sdk_key = settings["sdkKey"]
|
24
25
|
@account_id = settings["accountId"]
|
25
26
|
@version = settings["version"]
|
26
27
|
@collection_prefix = settings["collectionPrefix"]
|
28
|
+
@poll_interval = settings["pollInterval"] || Constants::POLLING_INTERVAL
|
27
29
|
@features = []
|
28
30
|
@campaigns = []
|
29
31
|
@campaign_groups = settings["campaignGroups"] || {}
|
@@ -65,6 +67,10 @@ class SettingsModel
|
|
65
67
|
@collection_prefix
|
66
68
|
end
|
67
69
|
|
70
|
+
def get_poll_interval
|
71
|
+
@poll_interval
|
72
|
+
end
|
73
|
+
|
68
74
|
def process_features(settings)
|
69
75
|
feature_list = settings["features"]
|
70
76
|
return unless feature_list.is_a?(Array)
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright 2025 Wingify Software Pvt. Ltd.
|
1
|
+
# Copyright 2024-2025 Wingify Software Pvt. Ltd.
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
@@ -15,7 +15,7 @@
|
|
15
15
|
class VWOOptionsModel
|
16
16
|
attr_accessor :account_id, :sdk_key, :is_development_mode, :storage, :gateway_service,
|
17
17
|
:poll_interval, :logger, :segmentation, :integrations, :network,
|
18
|
-
:should_wait_for_tracking_calls, :settings, :vwo_builder
|
18
|
+
:should_wait_for_tracking_calls, :settings, :vwo_builder, :is_usage_stats_disabled, :_vwo_meta
|
19
19
|
|
20
20
|
def initialize(options = {})
|
21
21
|
@account_id = options[:account_id]
|
@@ -31,6 +31,8 @@ class VWOOptionsModel
|
|
31
31
|
@should_wait_for_tracking_calls = options[:should_wait_for_tracking_calls]
|
32
32
|
@settings = options[:settings]
|
33
33
|
@vwo_builder = options[:vwo_builder]
|
34
|
+
@is_usage_stats_disabled = options[:is_usage_stats_disabled]
|
35
|
+
@_vwo_meta = options[:_vwo_meta]
|
34
36
|
end
|
35
37
|
|
36
38
|
# Creates a model instance from a hash (dictionary)
|
@@ -104,4 +106,13 @@ class VWOOptionsModel
|
|
104
106
|
def get_vwo_builder
|
105
107
|
@vwo_builder
|
106
108
|
end
|
109
|
+
|
110
|
+
def get_is_usage_stats_disabled
|
111
|
+
@is_usage_stats_disabled
|
112
|
+
end
|
113
|
+
|
114
|
+
def get_vwo_meta
|
115
|
+
@_vwo_meta
|
116
|
+
end
|
117
|
+
|
107
118
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright 2025 Wingify Software Pvt. Ltd.
|
1
|
+
# Copyright 2024-2025 Wingify Software Pvt. Ltd.
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
@@ -13,6 +13,7 @@
|
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
15
|
require_relative '../log_message_builder'
|
16
|
+
require_relative '../../../enums/log_level_to_number'
|
16
17
|
|
17
18
|
class LogTransportManager
|
18
19
|
def initialize(config)
|
@@ -25,8 +26,8 @@ class LogTransportManager
|
|
25
26
|
end
|
26
27
|
|
27
28
|
def should_log?(transport_level, config_level)
|
28
|
-
target_level =
|
29
|
-
desired_level =
|
29
|
+
target_level = LogLevelToNumber.to_number(transport_level)
|
30
|
+
desired_level = LogLevelToNumber.to_number(config_level || @config[:level])
|
30
31
|
target_level >= desired_level
|
31
32
|
end
|
32
33
|
|
@@ -70,18 +71,6 @@ class LogTransportManager
|
|
70
71
|
end
|
71
72
|
end
|
72
73
|
end
|
73
|
-
|
74
|
-
private
|
75
|
-
|
76
|
-
def log_level_to_number(level)
|
77
|
-
{
|
78
|
-
'TRACE' => 0,
|
79
|
-
'DEBUG' => 1,
|
80
|
-
'INFO' => 2,
|
81
|
-
'WARN' => 3,
|
82
|
-
'ERROR' => 4
|
83
|
-
}[level.upcase] || 0
|
84
|
-
end
|
85
74
|
end
|
86
75
|
|
87
76
|
|