mixpanel-browser 2.69.1 → 2.70.0

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.
@@ -14041,7 +14041,7 @@ define((function () { 'use strict';
14041
14041
 
14042
14042
  var Config = {
14043
14043
  DEBUG: false,
14044
- LIB_VERSION: '2.69.0'
14044
+ LIB_VERSION: '2.70.0'
14045
14045
  };
14046
14046
 
14047
14047
  /* eslint camelcase: "off", eqeqeq: "off" */
@@ -18877,17 +18877,21 @@ define((function () { 'use strict';
18877
18877
  var distinctId = this.getMpProperty('distinct_id');
18878
18878
  var deviceId = this.getMpProperty('$device_id');
18879
18879
  logger.log('Fetching flags for distinct ID: ' + distinctId);
18880
- var reqParams = {
18881
- 'context': _.extend({'distinct_id': distinctId, 'device_id': deviceId}, this.getConfig(CONFIG_CONTEXT))
18882
- };
18880
+
18881
+ var context = _.extend({'distinct_id': distinctId, 'device_id': deviceId}, this.getConfig(CONFIG_CONTEXT));
18882
+ var searchParams = new URLSearchParams();
18883
+ searchParams.set('context', JSON.stringify(context));
18884
+ searchParams.set('token', this.getMpConfig('token'));
18885
+ searchParams.set('mp_lib', 'web');
18886
+ searchParams.set('$lib_version', Config.LIB_VERSION);
18887
+ var url = this.getFullApiRoute() + '?' + searchParams.toString();
18888
+
18883
18889
  this._fetchInProgressStartTime = Date.now();
18884
- this.fetchPromise = win['fetch'](this.getFullApiRoute(), {
18885
- 'method': 'POST',
18890
+ this.fetchPromise = win['fetch'](url, {
18891
+ 'method': 'GET',
18886
18892
  'headers': {
18887
- 'Authorization': 'Basic ' + btoa(this.getMpConfig('token') + ':'),
18888
- 'Content-Type': 'application/octet-stream'
18889
- },
18890
- 'body': JSON.stringify(reqParams)
18893
+ 'Authorization': 'Basic ' + btoa(this.getMpConfig('token') + ':')
18894
+ }
18891
18895
  }).then(function(response) {
18892
18896
  this.markFetchComplete();
18893
18897
  return response.json().then(function(responseBody) {
@@ -14041,7 +14041,7 @@ if (typeof Promise !== 'undefined' && Promise.toString().indexOf('[native code]'
14041
14041
 
14042
14042
  var Config = {
14043
14043
  DEBUG: false,
14044
- LIB_VERSION: '2.69.0'
14044
+ LIB_VERSION: '2.70.0'
14045
14045
  };
14046
14046
 
14047
14047
  /* eslint camelcase: "off", eqeqeq: "off" */
@@ -18877,17 +18877,21 @@ FeatureFlagManager.prototype.fetchFlags = function() {
18877
18877
  var distinctId = this.getMpProperty('distinct_id');
18878
18878
  var deviceId = this.getMpProperty('$device_id');
18879
18879
  logger.log('Fetching flags for distinct ID: ' + distinctId);
18880
- var reqParams = {
18881
- 'context': _.extend({'distinct_id': distinctId, 'device_id': deviceId}, this.getConfig(CONFIG_CONTEXT))
18882
- };
18880
+
18881
+ var context = _.extend({'distinct_id': distinctId, 'device_id': deviceId}, this.getConfig(CONFIG_CONTEXT));
18882
+ var searchParams = new URLSearchParams();
18883
+ searchParams.set('context', JSON.stringify(context));
18884
+ searchParams.set('token', this.getMpConfig('token'));
18885
+ searchParams.set('mp_lib', 'web');
18886
+ searchParams.set('$lib_version', Config.LIB_VERSION);
18887
+ var url = this.getFullApiRoute() + '?' + searchParams.toString();
18888
+
18883
18889
  this._fetchInProgressStartTime = Date.now();
18884
- this.fetchPromise = win['fetch'](this.getFullApiRoute(), {
18885
- 'method': 'POST',
18890
+ this.fetchPromise = win['fetch'](url, {
18891
+ 'method': 'GET',
18886
18892
  'headers': {
18887
- 'Authorization': 'Basic ' + btoa(this.getMpConfig('token') + ':'),
18888
- 'Content-Type': 'application/octet-stream'
18889
- },
18890
- 'body': JSON.stringify(reqParams)
18893
+ 'Authorization': 'Basic ' + btoa(this.getMpConfig('token') + ':')
18894
+ }
18891
18895
  }).then(function(response) {
18892
18896
  this.markFetchComplete();
18893
18897
  return response.json().then(function(responseBody) {
@@ -3,7 +3,7 @@
3
3
 
4
4
  var Config = {
5
5
  DEBUG: false,
6
- LIB_VERSION: '2.69.0'
6
+ LIB_VERSION: '2.70.0'
7
7
  };
8
8
 
9
9
  // since es6 imports are static and we run unit tests from the console, window won't be defined when importing this file
@@ -3164,17 +3164,21 @@
3164
3164
  var distinctId = this.getMpProperty('distinct_id');
3165
3165
  var deviceId = this.getMpProperty('$device_id');
3166
3166
  logger$3.log('Fetching flags for distinct ID: ' + distinctId);
3167
- var reqParams = {
3168
- 'context': _.extend({'distinct_id': distinctId, 'device_id': deviceId}, this.getConfig(CONFIG_CONTEXT))
3169
- };
3167
+
3168
+ var context = _.extend({'distinct_id': distinctId, 'device_id': deviceId}, this.getConfig(CONFIG_CONTEXT));
3169
+ var searchParams = new URLSearchParams();
3170
+ searchParams.set('context', JSON.stringify(context));
3171
+ searchParams.set('token', this.getMpConfig('token'));
3172
+ searchParams.set('mp_lib', 'web');
3173
+ searchParams.set('$lib_version', Config.LIB_VERSION);
3174
+ var url = this.getFullApiRoute() + '?' + searchParams.toString();
3175
+
3170
3176
  this._fetchInProgressStartTime = Date.now();
3171
- this.fetchPromise = win['fetch'](this.getFullApiRoute(), {
3172
- 'method': 'POST',
3177
+ this.fetchPromise = win['fetch'](url, {
3178
+ 'method': 'GET',
3173
3179
  'headers': {
3174
- 'Authorization': 'Basic ' + btoa(this.getMpConfig('token') + ':'),
3175
- 'Content-Type': 'application/octet-stream'
3176
- },
3177
- 'body': JSON.stringify(reqParams)
3180
+ 'Authorization': 'Basic ' + btoa(this.getMpConfig('token') + ':')
3181
+ }
3178
3182
  }).then(function(response) {
3179
3183
  this.markFetchComplete();
3180
3184
  return response.json().then(function(responseBody) {