From 3afaa349b77a0fa135ff2f7f342a8ac3e8df303d Mon Sep 17 00:00:00 2001 From: Raju Ahmed Date: Wed, 8 Oct 2025 00:09:54 +0600 Subject: [PATCH 1/5] [FSSDK-11925] fix type in event.experimentIds field in projectConfig --- lib/core/optimizely_config/index.ts | 1 - lib/core/project_config/index.ts | 10 ++++++++++ lib/shared_types.ts | 6 +++++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/lib/core/optimizely_config/index.ts b/lib/core/optimizely_config/index.ts index 4b435b830..8fd66246e 100644 --- a/lib/core/optimizely_config/index.ts +++ b/lib/core/optimizely_config/index.ts @@ -62,7 +62,6 @@ export class OptimizelyConfig { public events: OptimizelyEvent[]; private datafile: string; - constructor(configObj: ProjectConfig, datafile: string, logger?: LoggerFacade) { this.sdkKey = configObj.sdkKey ?? ''; this.environmentKey = configObj.environmentKey ?? ''; diff --git a/lib/core/project_config/index.ts b/lib/core/project_config/index.ts index a52b46efa..e3a2528a2 100644 --- a/lib/core/project_config/index.ts +++ b/lib/core/project_config/index.ts @@ -50,6 +50,10 @@ interface Event { key: string; id: string; experimentsIds: string[]; + + // the field is named experimentIds in the datafile, but this type previously defined it as experimentsIds. + // keeping both to avoid breaking changes, removed experimentsIds in v6. + experimentIds: string[]; // fix typo in property name (https://github.com/optimizely/javascript-sdk/issues/991) } interface VariableUsageMap { @@ -142,6 +146,12 @@ export const createProjectConfig = function(datafileObj?: JSON, datafileStr: str projectConfig.__datafileStr = datafileStr === null ? JSON.stringify(datafileObj) : datafileStr; + // Copy experimentIds to experimentsIds in each event to fix typo in property name + // https://github.com/optimizely/javascript-sdk/issues/991 + projectConfig.events.forEach(event => { + event.experimentsIds = event.experimentIds; + }); + /* * Conditions of audiences in projectConfig.typedAudiences are not * expected to be string-encoded as they are here in projectConfig.audiences. diff --git a/lib/shared_types.ts b/lib/shared_types.ts index 75885b83e..9e52c8a69 100644 --- a/lib/shared_types.ts +++ b/lib/shared_types.ts @@ -1,5 +1,5 @@ /** - * Copyright 2020-2024, Optimizely + * Copyright 2020-2025, Optimizely * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -469,6 +469,10 @@ export type OptimizelyEvent = { id: string; key: string; experimentsIds: string[]; + + // the field is named experimentIds in the datafile, but this type previously defined it as experimentsIds. + // keeping both to avoid breaking changes, removed experimentsIds in v6. + experimentIds: string[]; // fix typo in property name (https://github.com/optimizely/javascript-sdk/issues/991) }; export interface OptimizelyFeature { From 7e0489ec16bd526b6ba9ab7f92fbd55fcb2b9e14 Mon Sep 17 00:00:00 2001 From: Raju Ahmed Date: Wed, 8 Oct 2025 00:15:48 +0600 Subject: [PATCH 2/5] up --- lib/core/project_config/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/core/project_config/index.ts b/lib/core/project_config/index.ts index e3a2528a2..be307cbb8 100644 --- a/lib/core/project_config/index.ts +++ b/lib/core/project_config/index.ts @@ -148,6 +148,10 @@ export const createProjectConfig = function(datafileObj?: JSON, datafileStr: str // Copy experimentIds to experimentsIds in each event to fix typo in property name // https://github.com/optimizely/javascript-sdk/issues/991 + if (!projectConfig.events) { + projectConfig.events = []; + } + projectConfig.events.forEach(event => { event.experimentsIds = event.experimentIds; }); From 16c3ee245879d18507f4484a8f564a5f86d1a858 Mon Sep 17 00:00:00 2001 From: Raju Ahmed Date: Thu, 9 Oct 2025 16:38:00 +0600 Subject: [PATCH 3/5] fix --- lib/core/project_config/index.tests.js | 25 +++-- lib/core/project_config/index.ts | 20 ++-- lib/message/error_message.gen.ts | 142 +++++++++++++++++++++++++ lib/message/log_message.gen.ts | 76 +++++++++++++ 4 files changed, 245 insertions(+), 18 deletions(-) create mode 100644 lib/message/error_message.gen.ts create mode 100644 lib/message/log_message.gen.ts diff --git a/lib/core/project_config/index.tests.js b/lib/core/project_config/index.tests.js index 24134e3cd..d920ed7a3 100644 --- a/lib/core/project_config/index.tests.js +++ b/lib/core/project_config/index.tests.js @@ -31,6 +31,15 @@ var logger = getLogger(); describe('lib/core/project_config', function() { describe('createProjectConfig method', function() { + // Copy experimentIds to experimentsIds in each event to fix typo in property name + // https://github.com/optimizely/javascript-sdk/issues/991 + const copyEventExperimentIds = (event) => { + return { + ...event, + experimentsIds: event.experimentIds, + } + }; + it('should set properties correctly when createProjectConfig is called', function() { var testData = testDatafile.getTestProjectConfig(); var configObj = projectConfig.createProjectConfig(testData); @@ -42,7 +51,7 @@ describe('lib/core/project_config', function() { assert.strictEqual(configObj.accountId, testData.accountId); assert.strictEqual(configObj.projectId, testData.projectId); assert.strictEqual(configObj.revision, testData.revision); - assert.deepEqual(configObj.events, testData.events); + assert.deepEqual(configObj.events, testData.events.map((e) => copyEventExperimentIds(e))); assert.deepEqual(configObj.audiences, testData.audiences); testData.groups.forEach(function(group) { group.experiments.forEach(function(experiment) { @@ -99,13 +108,13 @@ describe('lib/core/project_config', function() { assert.deepEqual(configObj.experimentKeyMap, expectedExperimentKeyMap); var expectedEventKeyMap = { - testEvent: testData.events[0], - 'Total Revenue': testData.events[1], - testEventWithAudiences: testData.events[2], - testEventWithoutExperiments: testData.events[3], - testEventWithExperimentNotRunning: testData.events[4], - testEventWithMultipleExperiments: testData.events[5], - testEventLaunched: testData.events[6], + testEvent: copyEventExperimentIds(testData.events[0]), + 'Total Revenue': copyEventExperimentIds(testData.events[1]), + testEventWithAudiences: copyEventExperimentIds(testData.events[2]), + testEventWithoutExperiments: copyEventExperimentIds(testData.events[3]), + testEventWithExperimentNotRunning: copyEventExperimentIds(testData.events[4]), + testEventWithMultipleExperiments: copyEventExperimentIds(testData.events[5]), + testEventLaunched: copyEventExperimentIds(testData.events[6]), }; assert.deepEqual(configObj.eventKeyMap, expectedEventKeyMap); diff --git a/lib/core/project_config/index.ts b/lib/core/project_config/index.ts index be307cbb8..c0ec2ef1b 100644 --- a/lib/core/project_config/index.ts +++ b/lib/core/project_config/index.ts @@ -105,6 +105,16 @@ const MODULE_NAME = 'PROJECT_CONFIG'; // eslint-disable-next-line @typescript-eslint/no-explicit-any function createMutationSafeDatafileCopy(datafile: any): ProjectConfig { const datafileCopy = assign({}, datafile); + + datafileCopy.events = (datafile.events || []).map((event: Event) => { + const eventCopy: Event = assign({}, event); + + // Copy experimentIds to experimentsIds in each event to fix typo in property name + // https://github.com/optimizely/javascript-sdk/issues/991 + eventCopy.experimentsIds = event.experimentIds; + return eventCopy; + }); + datafileCopy.audiences = (datafile.audiences || []).map((audience: Audience) => { return assign({}, audience); }); @@ -146,16 +156,6 @@ export const createProjectConfig = function(datafileObj?: JSON, datafileStr: str projectConfig.__datafileStr = datafileStr === null ? JSON.stringify(datafileObj) : datafileStr; - // Copy experimentIds to experimentsIds in each event to fix typo in property name - // https://github.com/optimizely/javascript-sdk/issues/991 - if (!projectConfig.events) { - projectConfig.events = []; - } - - projectConfig.events.forEach(event => { - event.experimentsIds = event.experimentIds; - }); - /* * Conditions of audiences in projectConfig.typedAudiences are not * expected to be string-encoded as they are here in projectConfig.audiences. diff --git a/lib/message/error_message.gen.ts b/lib/message/error_message.gen.ts new file mode 100644 index 000000000..2f88cf7cc --- /dev/null +++ b/lib/message/error_message.gen.ts @@ -0,0 +1,142 @@ +export const BUCKETING_ID_NOT_STRING = '0'; +export const CMAB_FETCH_FAILED = '1'; +export const CONDITION_EVALUATOR_ERROR = '2'; +export const DATAFILE_FETCH_REQUEST_FAILED = '3'; +export const ERROR_FETCHING_DATAFILE = '4'; +export const EVENT_ACTION_INVALID = '5'; +export const EVENT_DATA_INVALID = '6'; +export const EVENT_KEY_NOT_FOUND = '7'; +export const EXPERIMENT_KEY_NOT_IN_DATAFILE = '8'; +export const FAILED_TO_DISPATCH_EVENTS = '9'; +export const FAILED_TO_SEND_ODP_EVENTS = '10'; +export const FEATURE_NOT_IN_DATAFILE = '11'; +export const INVALID_ATTRIBUTES = '12'; +export const INVALID_BUCKETING_ID = '13'; +export const INVALID_CMAB_FETCH_RESPONSE = '14'; +export const INVALID_CONFIG = '15'; +export const INVALID_DATAFILE = '16'; +export const INVALID_DATAFILE_MALFORMED = '17'; +export const INVALID_DATAFILE_VERSION = '18'; +export const INVALID_EVENT_TAGS = '19'; +export const INVALID_EXPERIMENT_ID = '20'; +export const INVALID_EXPERIMENT_KEY = '21'; +export const INVALID_GROUP_ID = '22'; +export const INVALID_INPUT_FORMAT = '23'; +export const INVALID_JSON = '24'; +export const INVALID_USER_ID = '25'; +export const INVALID_USER_PROFILE_SERVICE = '26'; +export const INVALID_VARIATION_KEY = '27'; +export const MISSING_INTEGRATION_KEY = '28'; +export const NOTIFICATION_LISTENER_EXCEPTION = '29'; +export const NOT_TRACKING_USER = '30'; +export const NO_DATAFILE_SPECIFIED = '31'; +export const NO_EVENT_PROCESSOR = '32'; +export const NO_JSON_PROVIDED = '33'; +export const NO_PROJECT_CONFIG_FAILURE = '34'; +export const NO_STATUS_CODE_IN_RESPONSE = '35'; +export const NO_VARIATION_FOR_EXPERIMENT_KEY = '36'; +export const ODP_CONFIG_NOT_AVAILABLE = '37'; +export const ODP_EVENTS_SHOULD_HAVE_ATLEAST_ONE_KEY_VALUE = '38'; +export const ODP_EVENT_FAILED = '39'; +export const ODP_EVENT_FAILED_ODP_MANAGER_MISSING = '40'; +export const ODP_EVENT_MANAGER_STOPPED = '41'; +export const ODP_NOT_INTEGRATED = '42'; +export const ONLY_POST_REQUESTS_ARE_SUPPORTED = '43'; +export const OUT_OF_BOUNDS = '44'; +export const PROMISE_NOT_ALLOWED = '45'; +export const REQUEST_ERROR = '46'; +export const REQUEST_TIMEOUT = '47'; +export const RETRY_CANCELLED = '48'; +export const SEND_BEACON_FAILED = '49'; +export const SERVICE_NOT_RUNNING = '50'; +export const UNABLE_TO_ATTACH_UNLOAD = '51'; +export const UNABLE_TO_CAST_VALUE = '52'; +export const UNABLE_TO_GET_VUID_VUID_MANAGER_NOT_AVAILABLE = '53'; +export const UNABLE_TO_PARSE_AND_SKIPPED_HEADER = '54'; +export const UNDEFINED_ATTRIBUTE = '55'; +export const UNEXPECTED_CONDITION_VALUE = '56'; +export const UNEXPECTED_RESERVED_ATTRIBUTE_PREFIX = '57'; +export const UNEXPECTED_TYPE = '58'; +export const UNKNOWN_CONDITION_TYPE = '59'; +export const UNKNOWN_MATCH_TYPE = '60'; +export const UNRECOGNIZED_ATTRIBUTE = '61'; +export const UNRECOGNIZED_DECIDE_OPTION = '62'; +export const UNSUPPORTED_PROTOCOL = '63'; +export const USER_NOT_IN_FORCED_VARIATION = '64'; +export const USER_PROFILE_LOOKUP_ERROR = '65'; +export const USER_PROFILE_SAVE_ERROR = '66'; +export const VARIABLE_KEY_NOT_IN_DATAFILE = '67'; +export const VARIABLE_REQUESTED_WITH_WRONG_TYPE = '68'; +export const VARIATION_ID_NOT_IN_DATAFILE = '69'; +export const messages = [ + "BucketingID attribute is not a string. Defaulted to userId", + "CMAB decision fetch failed with status: %s", + "Error evaluating audience condition of type %s: %s", + "Datafile fetch request failed with status: %s", + "Error fetching datafile: %s", + "Event action invalid.", + "Event data invalid.", + "Event key %s is not in datafile.", + "Experiment key %s is not in datafile.", + "Failed to dispatch events, status: %s", + "failed to send odp events", + "Feature key %s is not in datafile.", + "Provided attributes are in an invalid format.", + "Unable to generate hash for bucketing ID %s: %s", + "Invalid CMAB fetch response", + "Provided Optimizely config is in an invalid format.", + "Datafile is invalid - property %s: %s", + "Datafile is invalid because it is malformed.", + "This version of the JavaScript SDK does not support the given datafile version: %s", + "Provided event tags are in an invalid format.", + "Experiment ID %s is not in datafile.", + "Experiment key %s is not in datafile. It is either invalid, paused, or archived.", + "Group ID %s is not in datafile.", + "Provided %s is in an invalid format.", + "JSON object is not valid.", + "Provided user ID is in an invalid format.", + "Provided user profile service instance is in an invalid format: %s.", + "Provided variation key is in an invalid format.", + "Integration key missing from datafile. All integrations should include a key.", + "Notification listener for (%s) threw exception: %s", + "Not tracking user %s.", + "No datafile specified. Cannot start optimizely.", + "No event processor is provided", + "No JSON object to validate against schema.", + "No project config available. Failing %s.", + "No status code in response", + "No variation key %s defined in datafile for experiment %s.", + "ODP config is not available.", + "ODP events should have at least one key-value pair in identifiers.", + "ODP event send failed.", + "ODP Event failed to send. (ODP Manager not available).", + "ODP event manager stopped before it could start", + "ODP is not integrated", + "Only POST requests are supported", + "Audience condition %s evaluated to UNKNOWN because the number value for user attribute \"%s\" is not in the range [-2^53, +2^53].", + "Promise value is not allowed in sync operation", + "Request error", + "Request timeout", + "Retry cancelled", + "sendBeacon failed", + "%s not running", + "unable to bind optimizely.close() to page unload event: \"%s\"", + "Unable to cast value %s to type %s, returning null.", + "Unable to get VUID - VuidManager is not available", + "Unable to parse & skipped header item", + "Provided attribute: %s has an undefined value.", + "Audience condition %s evaluated to UNKNOWN because the condition value is not supported.", + "Attribute %s unexpectedly has reserved prefix %s; using attribute ID instead of reserved attribute name.", + "Audience condition %s evaluated to UNKNOWN because a value of type \"%s\" was passed for user attribute \"%s\".", + "Audience condition %s has an unknown condition type. You may need to upgrade to a newer release of the Optimizely SDK.", + "Audience condition %s uses an unknown match type. You may need to upgrade to a newer release of the Optimizely SDK.", + "Unrecognized attribute %s provided. Pruning before sending event to Optimizely.", + "Unrecognized decide option %s provided.", + "Unsupported protocol: %s", + "User %s is not in the forced variation map. Cannot remove their forced variation.", + "Error while looking up user profile for user ID \"%s\": %s.", + "Error while saving user profile for user ID \"%s\": %s.", + "Variable with key \"%s\" associated with feature with key \"%s\" is not in datafile.", + "Requested variable type \"%s\", but variable is of type \"%s\". Use correct API to retrieve value. Returning None.", + "Variation ID %s is not in the datafile." +]; \ No newline at end of file diff --git a/lib/message/log_message.gen.ts b/lib/message/log_message.gen.ts new file mode 100644 index 000000000..449de30ff --- /dev/null +++ b/lib/message/log_message.gen.ts @@ -0,0 +1,76 @@ +export const ADDING_AUTHORIZATION_HEADER_WITH_BEARER_TOKEN = '0'; +export const AUDIENCE_EVALUATION_RESULT = '1'; +export const EVALUATING_AUDIENCE = '2'; +export const EVENT_STORE_FULL = '3'; +export const FAILED_TO_PARSE_REVENUE = '4'; +export const FAILED_TO_PARSE_VALUE = '5'; +export const FEATURE_ENABLED_FOR_USER = '6'; +export const FEATURE_NOT_ENABLED_FOR_USER = '7'; +export const FEATURE_NOT_ENABLED_RETURN_DEFAULT_VARIABLE_VALUE = '8'; +export const INVALID_CLIENT_ENGINE = '9'; +export const INVALID_DECIDE_OPTIONS = '10'; +export const INVALID_DEFAULT_DECIDE_OPTIONS = '11'; +export const INVALID_EXPERIMENT_KEY_INFO = '12'; +export const MAKING_DATAFILE_REQ_TO_URL_WITH_HEADERS = '13'; +export const MISSING_ATTRIBUTE_VALUE = '14'; +export const NOT_ACTIVATING_USER = '15'; +export const PARSED_NUMERIC_VALUE = '16'; +export const PARSED_REVENUE_VALUE = '17'; +export const RESPONSE_STATUS_CODE = '18'; +export const SAVED_LAST_MODIFIED_HEADER_VALUE_FROM_RESPONSE = '19'; +export const SAVED_USER_VARIATION = '20'; +export const SAVED_VARIATION_NOT_FOUND = '21'; +export const SHOULD_NOT_DISPATCH_ACTIVATE = '22'; +export const SKIPPING_JSON_VALIDATION = '23'; +export const TRACK_EVENT = '24'; +export const UNEXPECTED_TYPE_NULL = '25'; +export const UPDATED_OPTIMIZELY_CONFIG = '26'; +export const USER_HAS_NO_FORCED_VARIATION = '27'; +export const USER_HAS_NO_FORCED_VARIATION_FOR_EXPERIMENT = '28'; +export const USER_MAPPED_TO_FORCED_VARIATION = '29'; +export const USER_RECEIVED_DEFAULT_VARIABLE_VALUE = '30'; +export const USER_RECEIVED_VARIABLE_VALUE = '31'; +export const VALID_BUCKETING_ID = '32'; +export const VALID_DATAFILE = '33'; +export const VALID_USER_PROFILE_SERVICE = '34'; +export const VARIABLE_NOT_USED_RETURN_DEFAULT_VARIABLE_VALUE = '35'; +export const VARIATION_REMOVED_FOR_USER = '36'; +export const messages = [ + "Adding Authorization header with Bearer Token", + "Audience \"%s\" evaluated to %s.", + "Starting to evaluate audience \"%s\" with conditions: %s.", + "Event store is full. Not saving event with id %d.", + "Failed to parse revenue value \"%s\" from event tags.", + "Failed to parse event value \"%s\" from event tags.", + "Feature %s is enabled for user %s.", + "Feature %s is not enabled for user %s.", + "Feature \"%s\" is not enabled for user %s. Returning the default variable value \"%s\".", + "Invalid client engine passed: %s. Defaulting to node-sdk.", + "Provided decide options is not an array. Using default decide options.", + "Provided default decide options is not an array.", + "Experiment key %s is not in datafile. It is either invalid, paused, or archived.", + "Making datafile request to url %s with headers: %s", + "Audience condition %s evaluated to UNKNOWN because no value was passed for user attribute \"%s\".", + "Not activating user %s for experiment %s.", + "Parsed event value \"%s\" from event tags.", + "Parsed revenue value \"%s\" from event tags.", + "Response status code: %s", + "Saved last modified header value from response: %s", + "Saved user profile for user \"%s\".", + "User %s was previously bucketed into variation with ID %s for experiment %s, but no matching variation was found.", + "Experiment %s is not in \"Running\" state. Not activating user.", + "Skipping JSON schema validation.", + "Tracking event %s for user %s.", + "Audience condition %s evaluated to UNKNOWN because a null value was passed for user attribute \"%s\".", + "Updated Optimizely config to revision %s (project id %s)", + "User %s is not in the forced variation map.", + "No experiment %s mapped to user %s in the forced variation map.", + "Set variation %s for experiment %s and user %s in the forced variation map.", + "User \"%s\" is not in any variation or rollout rule. Returning default value for variable \"%s\" of feature flag \"%s\".", + "Got variable value \"%s\" for variable \"%s\" of feature flag \"%s\"", + "BucketingId is valid: \"%s\"", + "Datafile is valid.", + "Valid user profile service provided.", + "Variable \"%s\" is not used in variation \"%s\". Returning default value.", + "Variation mapped to experiment %s has been removed for user %s." +]; \ No newline at end of file From 02fad6aa11563523f8aad83d8dd21561d0cdbe7b Mon Sep 17 00:00:00 2001 From: Raju Ahmed Date: Thu, 9 Oct 2025 17:02:14 +0600 Subject: [PATCH 4/5] rm --- lib/message/error_message.gen.ts | 142 ------------------------------- lib/message/log_message.gen.ts | 76 ----------------- 2 files changed, 218 deletions(-) delete mode 100644 lib/message/error_message.gen.ts delete mode 100644 lib/message/log_message.gen.ts diff --git a/lib/message/error_message.gen.ts b/lib/message/error_message.gen.ts deleted file mode 100644 index 2f88cf7cc..000000000 --- a/lib/message/error_message.gen.ts +++ /dev/null @@ -1,142 +0,0 @@ -export const BUCKETING_ID_NOT_STRING = '0'; -export const CMAB_FETCH_FAILED = '1'; -export const CONDITION_EVALUATOR_ERROR = '2'; -export const DATAFILE_FETCH_REQUEST_FAILED = '3'; -export const ERROR_FETCHING_DATAFILE = '4'; -export const EVENT_ACTION_INVALID = '5'; -export const EVENT_DATA_INVALID = '6'; -export const EVENT_KEY_NOT_FOUND = '7'; -export const EXPERIMENT_KEY_NOT_IN_DATAFILE = '8'; -export const FAILED_TO_DISPATCH_EVENTS = '9'; -export const FAILED_TO_SEND_ODP_EVENTS = '10'; -export const FEATURE_NOT_IN_DATAFILE = '11'; -export const INVALID_ATTRIBUTES = '12'; -export const INVALID_BUCKETING_ID = '13'; -export const INVALID_CMAB_FETCH_RESPONSE = '14'; -export const INVALID_CONFIG = '15'; -export const INVALID_DATAFILE = '16'; -export const INVALID_DATAFILE_MALFORMED = '17'; -export const INVALID_DATAFILE_VERSION = '18'; -export const INVALID_EVENT_TAGS = '19'; -export const INVALID_EXPERIMENT_ID = '20'; -export const INVALID_EXPERIMENT_KEY = '21'; -export const INVALID_GROUP_ID = '22'; -export const INVALID_INPUT_FORMAT = '23'; -export const INVALID_JSON = '24'; -export const INVALID_USER_ID = '25'; -export const INVALID_USER_PROFILE_SERVICE = '26'; -export const INVALID_VARIATION_KEY = '27'; -export const MISSING_INTEGRATION_KEY = '28'; -export const NOTIFICATION_LISTENER_EXCEPTION = '29'; -export const NOT_TRACKING_USER = '30'; -export const NO_DATAFILE_SPECIFIED = '31'; -export const NO_EVENT_PROCESSOR = '32'; -export const NO_JSON_PROVIDED = '33'; -export const NO_PROJECT_CONFIG_FAILURE = '34'; -export const NO_STATUS_CODE_IN_RESPONSE = '35'; -export const NO_VARIATION_FOR_EXPERIMENT_KEY = '36'; -export const ODP_CONFIG_NOT_AVAILABLE = '37'; -export const ODP_EVENTS_SHOULD_HAVE_ATLEAST_ONE_KEY_VALUE = '38'; -export const ODP_EVENT_FAILED = '39'; -export const ODP_EVENT_FAILED_ODP_MANAGER_MISSING = '40'; -export const ODP_EVENT_MANAGER_STOPPED = '41'; -export const ODP_NOT_INTEGRATED = '42'; -export const ONLY_POST_REQUESTS_ARE_SUPPORTED = '43'; -export const OUT_OF_BOUNDS = '44'; -export const PROMISE_NOT_ALLOWED = '45'; -export const REQUEST_ERROR = '46'; -export const REQUEST_TIMEOUT = '47'; -export const RETRY_CANCELLED = '48'; -export const SEND_BEACON_FAILED = '49'; -export const SERVICE_NOT_RUNNING = '50'; -export const UNABLE_TO_ATTACH_UNLOAD = '51'; -export const UNABLE_TO_CAST_VALUE = '52'; -export const UNABLE_TO_GET_VUID_VUID_MANAGER_NOT_AVAILABLE = '53'; -export const UNABLE_TO_PARSE_AND_SKIPPED_HEADER = '54'; -export const UNDEFINED_ATTRIBUTE = '55'; -export const UNEXPECTED_CONDITION_VALUE = '56'; -export const UNEXPECTED_RESERVED_ATTRIBUTE_PREFIX = '57'; -export const UNEXPECTED_TYPE = '58'; -export const UNKNOWN_CONDITION_TYPE = '59'; -export const UNKNOWN_MATCH_TYPE = '60'; -export const UNRECOGNIZED_ATTRIBUTE = '61'; -export const UNRECOGNIZED_DECIDE_OPTION = '62'; -export const UNSUPPORTED_PROTOCOL = '63'; -export const USER_NOT_IN_FORCED_VARIATION = '64'; -export const USER_PROFILE_LOOKUP_ERROR = '65'; -export const USER_PROFILE_SAVE_ERROR = '66'; -export const VARIABLE_KEY_NOT_IN_DATAFILE = '67'; -export const VARIABLE_REQUESTED_WITH_WRONG_TYPE = '68'; -export const VARIATION_ID_NOT_IN_DATAFILE = '69'; -export const messages = [ - "BucketingID attribute is not a string. Defaulted to userId", - "CMAB decision fetch failed with status: %s", - "Error evaluating audience condition of type %s: %s", - "Datafile fetch request failed with status: %s", - "Error fetching datafile: %s", - "Event action invalid.", - "Event data invalid.", - "Event key %s is not in datafile.", - "Experiment key %s is not in datafile.", - "Failed to dispatch events, status: %s", - "failed to send odp events", - "Feature key %s is not in datafile.", - "Provided attributes are in an invalid format.", - "Unable to generate hash for bucketing ID %s: %s", - "Invalid CMAB fetch response", - "Provided Optimizely config is in an invalid format.", - "Datafile is invalid - property %s: %s", - "Datafile is invalid because it is malformed.", - "This version of the JavaScript SDK does not support the given datafile version: %s", - "Provided event tags are in an invalid format.", - "Experiment ID %s is not in datafile.", - "Experiment key %s is not in datafile. It is either invalid, paused, or archived.", - "Group ID %s is not in datafile.", - "Provided %s is in an invalid format.", - "JSON object is not valid.", - "Provided user ID is in an invalid format.", - "Provided user profile service instance is in an invalid format: %s.", - "Provided variation key is in an invalid format.", - "Integration key missing from datafile. All integrations should include a key.", - "Notification listener for (%s) threw exception: %s", - "Not tracking user %s.", - "No datafile specified. Cannot start optimizely.", - "No event processor is provided", - "No JSON object to validate against schema.", - "No project config available. Failing %s.", - "No status code in response", - "No variation key %s defined in datafile for experiment %s.", - "ODP config is not available.", - "ODP events should have at least one key-value pair in identifiers.", - "ODP event send failed.", - "ODP Event failed to send. (ODP Manager not available).", - "ODP event manager stopped before it could start", - "ODP is not integrated", - "Only POST requests are supported", - "Audience condition %s evaluated to UNKNOWN because the number value for user attribute \"%s\" is not in the range [-2^53, +2^53].", - "Promise value is not allowed in sync operation", - "Request error", - "Request timeout", - "Retry cancelled", - "sendBeacon failed", - "%s not running", - "unable to bind optimizely.close() to page unload event: \"%s\"", - "Unable to cast value %s to type %s, returning null.", - "Unable to get VUID - VuidManager is not available", - "Unable to parse & skipped header item", - "Provided attribute: %s has an undefined value.", - "Audience condition %s evaluated to UNKNOWN because the condition value is not supported.", - "Attribute %s unexpectedly has reserved prefix %s; using attribute ID instead of reserved attribute name.", - "Audience condition %s evaluated to UNKNOWN because a value of type \"%s\" was passed for user attribute \"%s\".", - "Audience condition %s has an unknown condition type. You may need to upgrade to a newer release of the Optimizely SDK.", - "Audience condition %s uses an unknown match type. You may need to upgrade to a newer release of the Optimizely SDK.", - "Unrecognized attribute %s provided. Pruning before sending event to Optimizely.", - "Unrecognized decide option %s provided.", - "Unsupported protocol: %s", - "User %s is not in the forced variation map. Cannot remove their forced variation.", - "Error while looking up user profile for user ID \"%s\": %s.", - "Error while saving user profile for user ID \"%s\": %s.", - "Variable with key \"%s\" associated with feature with key \"%s\" is not in datafile.", - "Requested variable type \"%s\", but variable is of type \"%s\". Use correct API to retrieve value. Returning None.", - "Variation ID %s is not in the datafile." -]; \ No newline at end of file diff --git a/lib/message/log_message.gen.ts b/lib/message/log_message.gen.ts deleted file mode 100644 index 449de30ff..000000000 --- a/lib/message/log_message.gen.ts +++ /dev/null @@ -1,76 +0,0 @@ -export const ADDING_AUTHORIZATION_HEADER_WITH_BEARER_TOKEN = '0'; -export const AUDIENCE_EVALUATION_RESULT = '1'; -export const EVALUATING_AUDIENCE = '2'; -export const EVENT_STORE_FULL = '3'; -export const FAILED_TO_PARSE_REVENUE = '4'; -export const FAILED_TO_PARSE_VALUE = '5'; -export const FEATURE_ENABLED_FOR_USER = '6'; -export const FEATURE_NOT_ENABLED_FOR_USER = '7'; -export const FEATURE_NOT_ENABLED_RETURN_DEFAULT_VARIABLE_VALUE = '8'; -export const INVALID_CLIENT_ENGINE = '9'; -export const INVALID_DECIDE_OPTIONS = '10'; -export const INVALID_DEFAULT_DECIDE_OPTIONS = '11'; -export const INVALID_EXPERIMENT_KEY_INFO = '12'; -export const MAKING_DATAFILE_REQ_TO_URL_WITH_HEADERS = '13'; -export const MISSING_ATTRIBUTE_VALUE = '14'; -export const NOT_ACTIVATING_USER = '15'; -export const PARSED_NUMERIC_VALUE = '16'; -export const PARSED_REVENUE_VALUE = '17'; -export const RESPONSE_STATUS_CODE = '18'; -export const SAVED_LAST_MODIFIED_HEADER_VALUE_FROM_RESPONSE = '19'; -export const SAVED_USER_VARIATION = '20'; -export const SAVED_VARIATION_NOT_FOUND = '21'; -export const SHOULD_NOT_DISPATCH_ACTIVATE = '22'; -export const SKIPPING_JSON_VALIDATION = '23'; -export const TRACK_EVENT = '24'; -export const UNEXPECTED_TYPE_NULL = '25'; -export const UPDATED_OPTIMIZELY_CONFIG = '26'; -export const USER_HAS_NO_FORCED_VARIATION = '27'; -export const USER_HAS_NO_FORCED_VARIATION_FOR_EXPERIMENT = '28'; -export const USER_MAPPED_TO_FORCED_VARIATION = '29'; -export const USER_RECEIVED_DEFAULT_VARIABLE_VALUE = '30'; -export const USER_RECEIVED_VARIABLE_VALUE = '31'; -export const VALID_BUCKETING_ID = '32'; -export const VALID_DATAFILE = '33'; -export const VALID_USER_PROFILE_SERVICE = '34'; -export const VARIABLE_NOT_USED_RETURN_DEFAULT_VARIABLE_VALUE = '35'; -export const VARIATION_REMOVED_FOR_USER = '36'; -export const messages = [ - "Adding Authorization header with Bearer Token", - "Audience \"%s\" evaluated to %s.", - "Starting to evaluate audience \"%s\" with conditions: %s.", - "Event store is full. Not saving event with id %d.", - "Failed to parse revenue value \"%s\" from event tags.", - "Failed to parse event value \"%s\" from event tags.", - "Feature %s is enabled for user %s.", - "Feature %s is not enabled for user %s.", - "Feature \"%s\" is not enabled for user %s. Returning the default variable value \"%s\".", - "Invalid client engine passed: %s. Defaulting to node-sdk.", - "Provided decide options is not an array. Using default decide options.", - "Provided default decide options is not an array.", - "Experiment key %s is not in datafile. It is either invalid, paused, or archived.", - "Making datafile request to url %s with headers: %s", - "Audience condition %s evaluated to UNKNOWN because no value was passed for user attribute \"%s\".", - "Not activating user %s for experiment %s.", - "Parsed event value \"%s\" from event tags.", - "Parsed revenue value \"%s\" from event tags.", - "Response status code: %s", - "Saved last modified header value from response: %s", - "Saved user profile for user \"%s\".", - "User %s was previously bucketed into variation with ID %s for experiment %s, but no matching variation was found.", - "Experiment %s is not in \"Running\" state. Not activating user.", - "Skipping JSON schema validation.", - "Tracking event %s for user %s.", - "Audience condition %s evaluated to UNKNOWN because a null value was passed for user attribute \"%s\".", - "Updated Optimizely config to revision %s (project id %s)", - "User %s is not in the forced variation map.", - "No experiment %s mapped to user %s in the forced variation map.", - "Set variation %s for experiment %s and user %s in the forced variation map.", - "User \"%s\" is not in any variation or rollout rule. Returning default value for variable \"%s\" of feature flag \"%s\".", - "Got variable value \"%s\" for variable \"%s\" of feature flag \"%s\"", - "BucketingId is valid: \"%s\"", - "Datafile is valid.", - "Valid user profile service provided.", - "Variable \"%s\" is not used in variation \"%s\". Returning default value.", - "Variation mapped to experiment %s has been removed for user %s." -]; \ No newline at end of file From f764e96920ad82877d66cc0c9eb87175481597cb Mon Sep 17 00:00:00 2001 From: Raju Ahmed Date: Thu, 9 Oct 2025 18:06:53 +0600 Subject: [PATCH 5/5] cr --- lib/core/project_config/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/core/project_config/index.ts b/lib/core/project_config/index.ts index c0ec2ef1b..9f0258fac 100644 --- a/lib/core/project_config/index.ts +++ b/lib/core/project_config/index.ts @@ -1,5 +1,5 @@ /** - * Copyright 2016-2024, Optimizely + * Copyright 2016-2025, Optimizely * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.