@imtbl/sdk 0.45.5 → 1.0.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.
package/dist/checkout.js CHANGED
@@ -115,7 +115,7 @@ const getDetail$1 = (key) => {
115
115
  const getAllDetails$1 = () => RUNTIME_DETAILS$1;
116
116
  // Events
117
117
  const getEvents$1 = () => EVENT_STORE$1;
118
- const addEvent = (event) => {
118
+ const addEvent$1 = (event) => {
119
119
  EVENT_STORE$1.push(event);
120
120
  setItem$1(Store$1.EVENTS, EVENT_STORE$1);
121
121
  };
@@ -126,7 +126,10 @@ const removeSentEvents$1 = (numberOfEvents) => {
126
126
  const flattenProperties$1 = (properties) => {
127
127
  const propertyMap = [];
128
128
  Object.entries(properties).forEach(([key, value]) => {
129
- if (typeof value === 'string' || typeof value === 'number') {
129
+ if (typeof key === 'string'
130
+ || typeof value === 'string'
131
+ || typeof value === 'number'
132
+ || typeof value === 'boolean') {
130
133
  propertyMap.push([key, value.toString()]);
131
134
  }
132
135
  });
@@ -215,15 +218,15 @@ function isTestEnvironment$1() {
215
218
  }
216
219
 
217
220
  // Store the event in the event store
218
- const trackFn = (moduleName, eventName, properties) => {
221
+ const trackFn$1 = (moduleName, eventName, properties) => {
219
222
  const event = {
220
223
  event: `${moduleName}.${eventName}`,
221
224
  time: new Date().toISOString(),
222
225
  ...(properties && { properties: flattenProperties$1(properties) }),
223
226
  };
224
- addEvent(event);
227
+ addEvent$1(event);
225
228
  };
226
- const track = errorBoundary$1(trackFn);
229
+ const track$1 = errorBoundary$1(trackFn$1);
227
230
  // Sending events to the server
228
231
  const flushFn$1 = async () => {
229
232
  // Don't flush if not initialised
@@ -269,6 +272,10 @@ const setEnvironmentFn = (env) => {
269
272
  };
270
273
  const setEnvironment = errorBoundary$1(setEnvironmentFn);
271
274
 
275
+ track$1('metrics', 'sdk_version', {
276
+ version: '1.0.0',
277
+ });
278
+
272
279
  var Environment$1;
273
280
  (function (Environment) {
274
281
  Environment["PRODUCTION"] = "production";
@@ -282,7 +289,7 @@ class ImmutableConfiguration {
282
289
  constructor(options) {
283
290
  this.environment = options.environment;
284
291
  setEnvironment(options.environment);
285
- track('config', 'load_imtbl_config');
292
+ track$1('config', 'created_imtbl_config');
286
293
  }
287
294
  }
288
295
 
@@ -17059,6 +17066,10 @@ const getDetail = (key) => {
17059
17066
  const getAllDetails = () => RUNTIME_DETAILS;
17060
17067
  // Events
17061
17068
  const getEvents = () => EVENT_STORE;
17069
+ const addEvent = (event) => {
17070
+ EVENT_STORE.push(event);
17071
+ setItem(Store.EVENTS, EVENT_STORE);
17072
+ };
17062
17073
  const removeSentEvents = (numberOfEvents) => {
17063
17074
  EVENT_STORE = EVENT_STORE.slice(numberOfEvents);
17064
17075
  setItem(Store.EVENTS, EVENT_STORE);
@@ -17066,7 +17077,10 @@ const removeSentEvents = (numberOfEvents) => {
17066
17077
  const flattenProperties = (properties) => {
17067
17078
  const propertyMap = [];
17068
17079
  Object.entries(properties).forEach(([key, value]) => {
17069
- if (typeof value === 'string' || typeof value === 'number') {
17080
+ if (typeof key === 'string'
17081
+ || typeof value === 'string'
17082
+ || typeof value === 'number'
17083
+ || typeof value === 'boolean') {
17070
17084
  propertyMap.push([key, value.toString()]);
17071
17085
  }
17072
17086
  });
@@ -17153,6 +17167,17 @@ function isTestEnvironment() {
17153
17167
  }
17154
17168
  return process.env.JEST_WORKER_ID !== undefined;
17155
17169
  }
17170
+
17171
+ // Store the event in the event store
17172
+ const trackFn = (moduleName, eventName, properties) => {
17173
+ const event = {
17174
+ event: `${moduleName}.${eventName}`,
17175
+ time: new Date().toISOString(),
17176
+ ...(properties && { properties: flattenProperties(properties) }),
17177
+ };
17178
+ addEvent(event);
17179
+ };
17180
+ const track = errorBoundary(trackFn);
17156
17181
  // Sending events to the server
17157
17182
  const flushFn = async () => {
17158
17183
  // Don't flush if not initialised
@@ -17193,6 +17218,10 @@ if (!isTestEnvironment()) {
17193
17218
  errorBoundary(flushPoll)();
17194
17219
  }
17195
17220
 
17221
+ track('metrics', 'sdk_version', {
17222
+ version: '1.0.0',
17223
+ });
17224
+
17196
17225
  var Environment;
17197
17226
  (function (Environment) {
17198
17227
  Environment["PRODUCTION"] = "production";
@@ -26834,7 +26863,7 @@ class APIError extends Error {
26834
26863
 
26835
26864
  /* eslint-disable implicit-arrow-linebreak */
26836
26865
  const defaultHeaders = {
26837
- sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-0.45.5',
26866
+ sdkVersion: 'ts-immutable-sdk-multi-rollup-api-client-1.0.0',
26838
26867
  };
26839
26868
  /**
26840
26869
  * createAPIConfiguration to create a custom Configuration
@@ -28196,7 +28225,7 @@ const IMMUTABLE_ZKVEM_GAS_OVERRIDES = {
28196
28225
  maxPriorityFeePerGas: BigNumber$1.from(10e9),
28197
28226
  };
28198
28227
 
28199
- const SDK_VERSION_MARKER = '0.45.5';
28228
+ const SDK_VERSION_MARKER = '1.0.0';
28200
28229
  // This SDK version is replaced by the `yarn build` command ran on the root level
28201
28230
  const globalPackageVersion = () => SDK_VERSION_MARKER;
28202
28231
 
package/dist/config.js CHANGED
@@ -115,7 +115,10 @@ const removeSentEvents = (numberOfEvents) => {
115
115
  const flattenProperties = (properties) => {
116
116
  const propertyMap = [];
117
117
  Object.entries(properties).forEach(([key, value]) => {
118
- if (typeof value === 'string' || typeof value === 'number') {
118
+ if (typeof key === 'string'
119
+ || typeof value === 'string'
120
+ || typeof value === 'number'
121
+ || typeof value === 'boolean') {
119
122
  propertyMap.push([key, value.toString()]);
120
123
  }
121
124
  });
@@ -262,6 +265,10 @@ const setPublishableApiKeyFn = (publishableApiKey) => {
262
265
  };
263
266
  const setPublishableApiKey = errorBoundary(setPublishableApiKeyFn);
264
267
 
268
+ track('metrics', 'sdk_version', {
269
+ version: '1.0.0',
270
+ });
271
+
265
272
  var Environment;
266
273
  (function (Environment) {
267
274
  Environment["PRODUCTION"] = "production";
@@ -275,7 +282,7 @@ class ImmutableConfiguration {
275
282
  constructor(options) {
276
283
  this.environment = options.environment;
277
284
  setEnvironment(options.environment);
278
- track('config', 'load_imtbl_config');
285
+ track('config', 'created_imtbl_config');
279
286
  }
280
287
  }
281
288
  const API_KEY_PREFIX = 'sk_imapik-';