@jitsu/js 1.9.18-canary.1288.20250415203911 → 1.9.18-canary.1288.20250415214028

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/jitsu.cjs.js CHANGED
@@ -1437,7 +1437,7 @@ function urlPath(url) {
1437
1437
  return "/" + pathMatch;
1438
1438
  }
1439
1439
  function adjustPayload(payload, config, storage, s2s) {
1440
- var _a, _b, _c, _d, _e, _f;
1440
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
1441
1441
  const runtime = config.runtime || (isInBrowser() ? windowRuntime(config) : emptyRuntime(config));
1442
1442
  const url = runtime.pageUrl();
1443
1443
  const parsedUrl = safeCall(() => new URL(url), undefined);
@@ -1462,11 +1462,12 @@ function adjustPayload(payload, config, storage, s2s) {
1462
1462
  categoryPreferences: config.privacy.consentCategories,
1463
1463
  }
1464
1464
  : undefined,
1465
- userAgent: runtime.userAgent(),
1466
- locale: runtime.language(),
1467
- screen: runtime.screen(),
1468
- ip: runtime === null || runtime === void 0 ? void 0 : runtime.ip(),
1469
- traits: payload.type != "identify" && payload.type != "group" ? Object.assign({}, (restoreTraits(storage) || {})) : undefined,
1465
+ userAgent: (_e = runtime.userAgent) === null || _e === void 0 ? void 0 : _e.call(runtime),
1466
+ locale: (_f = runtime.language) === null || _f === void 0 ? void 0 : _f.call(runtime),
1467
+ screen: (_g = runtime.screen) === null || _g === void 0 ? void 0 : _g.call(runtime),
1468
+ ip: (_h = runtime === null || runtime === void 0 ? void 0 : runtime.ip) === null || _h === void 0 ? void 0 : _h.call(runtime),
1469
+ traits: payload.type != "identify" && payload.type != "group"
1470
+ ? Object.assign(Object.assign({}, (restoreTraits(storage) || {})), (((_j = payload === null || payload === void 0 ? void 0 : payload.options) === null || _j === void 0 ? void 0 : _j.traits) || {})) : undefined,
1470
1471
  page: {
1471
1472
  path: properties.path || (parsedUrl && parsedUrl.pathname),
1472
1473
  referrer: referrer,
@@ -1477,13 +1478,13 @@ function adjustPayload(payload, config, storage, s2s) {
1477
1478
  url: properties.url || url,
1478
1479
  encoding: properties.encoding || runtime.documentEncoding(),
1479
1480
  },
1480
- clientIds: !((_e = config.privacy) === null || _e === void 0 ? void 0 : _e.disableUserIds) ? getClientIds(runtime, config.cookieCapture) : undefined,
1481
+ clientIds: !((_k = config.privacy) === null || _k === void 0 ? void 0 : _k.disableUserIds) ? getClientIds(runtime, config.cookieCapture) : undefined,
1481
1482
  campaign: parseUtms(query),
1482
1483
  };
1483
- const withContext = Object.assign(Object.assign({}, payload), { timestamp: new Date().toISOString(), sentAt: new Date().toISOString(), messageId: randomId(properties.path || (parsedUrl && parsedUrl.pathname)), writeKey: maskWriteKey(config.writeKey), groupId: storage.getItem("__group_id"), context: deepMerge(context, customContext) });
1484
+ const withContext = Object.assign(Object.assign({}, payload), { userId: ((_l = payload === null || payload === void 0 ? void 0 : payload.options) === null || _l === void 0 ? void 0 : _l.userId) || (payload === null || payload === void 0 ? void 0 : payload.userId), anonymousId: ((_m = payload === null || payload === void 0 ? void 0 : payload.options) === null || _m === void 0 ? void 0 : _m.anonymousId) || (payload === null || payload === void 0 ? void 0 : payload.anonymousId), groupId: ((_o = payload === null || payload === void 0 ? void 0 : payload.options) === null || _o === void 0 ? void 0 : _o.groupId) || storage.getItem("__group_id"), timestamp: new Date().toISOString(), sentAt: new Date().toISOString(), messageId: randomId(properties.path || (parsedUrl && parsedUrl.pathname)), writeKey: maskWriteKey(config.writeKey), context: deepMerge(context, customContext) });
1484
1485
  delete withContext.meta;
1485
1486
  delete withContext.options;
1486
- if ((_f = config.privacy) === null || _f === void 0 ? void 0 : _f.disableUserIds) {
1487
+ if ((_p = config.privacy) === null || _p === void 0 ? void 0 : _p.disableUserIds) {
1487
1488
  delete withContext.userId;
1488
1489
  delete withContext.anonymousId;
1489
1490
  delete withContext.context.traits;
package/dist/jitsu.es.js CHANGED
@@ -1435,7 +1435,7 @@ function urlPath(url) {
1435
1435
  return "/" + pathMatch;
1436
1436
  }
1437
1437
  function adjustPayload(payload, config, storage, s2s) {
1438
- var _a, _b, _c, _d, _e, _f;
1438
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
1439
1439
  const runtime = config.runtime || (isInBrowser() ? windowRuntime(config) : emptyRuntime(config));
1440
1440
  const url = runtime.pageUrl();
1441
1441
  const parsedUrl = safeCall(() => new URL(url), undefined);
@@ -1460,11 +1460,12 @@ function adjustPayload(payload, config, storage, s2s) {
1460
1460
  categoryPreferences: config.privacy.consentCategories,
1461
1461
  }
1462
1462
  : undefined,
1463
- userAgent: runtime.userAgent(),
1464
- locale: runtime.language(),
1465
- screen: runtime.screen(),
1466
- ip: runtime === null || runtime === void 0 ? void 0 : runtime.ip(),
1467
- traits: payload.type != "identify" && payload.type != "group" ? Object.assign({}, (restoreTraits(storage) || {})) : undefined,
1463
+ userAgent: (_e = runtime.userAgent) === null || _e === void 0 ? void 0 : _e.call(runtime),
1464
+ locale: (_f = runtime.language) === null || _f === void 0 ? void 0 : _f.call(runtime),
1465
+ screen: (_g = runtime.screen) === null || _g === void 0 ? void 0 : _g.call(runtime),
1466
+ ip: (_h = runtime === null || runtime === void 0 ? void 0 : runtime.ip) === null || _h === void 0 ? void 0 : _h.call(runtime),
1467
+ traits: payload.type != "identify" && payload.type != "group"
1468
+ ? Object.assign(Object.assign({}, (restoreTraits(storage) || {})), (((_j = payload === null || payload === void 0 ? void 0 : payload.options) === null || _j === void 0 ? void 0 : _j.traits) || {})) : undefined,
1468
1469
  page: {
1469
1470
  path: properties.path || (parsedUrl && parsedUrl.pathname),
1470
1471
  referrer: referrer,
@@ -1475,13 +1476,13 @@ function adjustPayload(payload, config, storage, s2s) {
1475
1476
  url: properties.url || url,
1476
1477
  encoding: properties.encoding || runtime.documentEncoding(),
1477
1478
  },
1478
- clientIds: !((_e = config.privacy) === null || _e === void 0 ? void 0 : _e.disableUserIds) ? getClientIds(runtime, config.cookieCapture) : undefined,
1479
+ clientIds: !((_k = config.privacy) === null || _k === void 0 ? void 0 : _k.disableUserIds) ? getClientIds(runtime, config.cookieCapture) : undefined,
1479
1480
  campaign: parseUtms(query),
1480
1481
  };
1481
- const withContext = Object.assign(Object.assign({}, payload), { timestamp: new Date().toISOString(), sentAt: new Date().toISOString(), messageId: randomId(properties.path || (parsedUrl && parsedUrl.pathname)), writeKey: maskWriteKey(config.writeKey), groupId: storage.getItem("__group_id"), context: deepMerge(context, customContext) });
1482
+ const withContext = Object.assign(Object.assign({}, payload), { userId: ((_l = payload === null || payload === void 0 ? void 0 : payload.options) === null || _l === void 0 ? void 0 : _l.userId) || (payload === null || payload === void 0 ? void 0 : payload.userId), anonymousId: ((_m = payload === null || payload === void 0 ? void 0 : payload.options) === null || _m === void 0 ? void 0 : _m.anonymousId) || (payload === null || payload === void 0 ? void 0 : payload.anonymousId), groupId: ((_o = payload === null || payload === void 0 ? void 0 : payload.options) === null || _o === void 0 ? void 0 : _o.groupId) || storage.getItem("__group_id"), timestamp: new Date().toISOString(), sentAt: new Date().toISOString(), messageId: randomId(properties.path || (parsedUrl && parsedUrl.pathname)), writeKey: maskWriteKey(config.writeKey), context: deepMerge(context, customContext) });
1482
1483
  delete withContext.meta;
1483
1484
  delete withContext.options;
1484
- if ((_f = config.privacy) === null || _f === void 0 ? void 0 : _f.disableUserIds) {
1485
+ if ((_p = config.privacy) === null || _p === void 0 ? void 0 : _p.disableUserIds) {
1485
1486
  delete withContext.userId;
1486
1487
  delete withContext.anonymousId;
1487
1488
  delete withContext.context.traits;
package/dist/web/p.js.txt CHANGED
@@ -1438,7 +1438,7 @@
1438
1438
  return "/" + pathMatch;
1439
1439
  }
1440
1440
  function adjustPayload(payload, config, storage, s2s) {
1441
- var _a, _b, _c, _d, _e, _f;
1441
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
1442
1442
  const runtime = config.runtime || (isInBrowser() ? windowRuntime(config) : emptyRuntime(config));
1443
1443
  const url = runtime.pageUrl();
1444
1444
  const parsedUrl = safeCall(() => new URL(url), undefined);
@@ -1463,11 +1463,12 @@
1463
1463
  categoryPreferences: config.privacy.consentCategories,
1464
1464
  }
1465
1465
  : undefined,
1466
- userAgent: runtime.userAgent(),
1467
- locale: runtime.language(),
1468
- screen: runtime.screen(),
1469
- ip: runtime === null || runtime === void 0 ? void 0 : runtime.ip(),
1470
- traits: payload.type != "identify" && payload.type != "group" ? Object.assign({}, (restoreTraits(storage) || {})) : undefined,
1466
+ userAgent: (_e = runtime.userAgent) === null || _e === void 0 ? void 0 : _e.call(runtime),
1467
+ locale: (_f = runtime.language) === null || _f === void 0 ? void 0 : _f.call(runtime),
1468
+ screen: (_g = runtime.screen) === null || _g === void 0 ? void 0 : _g.call(runtime),
1469
+ ip: (_h = runtime === null || runtime === void 0 ? void 0 : runtime.ip) === null || _h === void 0 ? void 0 : _h.call(runtime),
1470
+ traits: payload.type != "identify" && payload.type != "group"
1471
+ ? Object.assign(Object.assign({}, (restoreTraits(storage) || {})), (((_j = payload === null || payload === void 0 ? void 0 : payload.options) === null || _j === void 0 ? void 0 : _j.traits) || {})) : undefined,
1471
1472
  page: {
1472
1473
  path: properties.path || (parsedUrl && parsedUrl.pathname),
1473
1474
  referrer: referrer,
@@ -1478,13 +1479,13 @@
1478
1479
  url: properties.url || url,
1479
1480
  encoding: properties.encoding || runtime.documentEncoding(),
1480
1481
  },
1481
- clientIds: !((_e = config.privacy) === null || _e === void 0 ? void 0 : _e.disableUserIds) ? getClientIds(runtime, config.cookieCapture) : undefined,
1482
+ clientIds: !((_k = config.privacy) === null || _k === void 0 ? void 0 : _k.disableUserIds) ? getClientIds(runtime, config.cookieCapture) : undefined,
1482
1483
  campaign: parseUtms(query),
1483
1484
  };
1484
- const withContext = Object.assign(Object.assign({}, payload), { timestamp: new Date().toISOString(), sentAt: new Date().toISOString(), messageId: randomId(properties.path || (parsedUrl && parsedUrl.pathname)), writeKey: maskWriteKey(config.writeKey), groupId: storage.getItem("__group_id"), context: deepMerge(context, customContext) });
1485
+ const withContext = Object.assign(Object.assign({}, payload), { userId: ((_l = payload === null || payload === void 0 ? void 0 : payload.options) === null || _l === void 0 ? void 0 : _l.userId) || (payload === null || payload === void 0 ? void 0 : payload.userId), anonymousId: ((_m = payload === null || payload === void 0 ? void 0 : payload.options) === null || _m === void 0 ? void 0 : _m.anonymousId) || (payload === null || payload === void 0 ? void 0 : payload.anonymousId), groupId: ((_o = payload === null || payload === void 0 ? void 0 : payload.options) === null || _o === void 0 ? void 0 : _o.groupId) || storage.getItem("__group_id"), timestamp: new Date().toISOString(), sentAt: new Date().toISOString(), messageId: randomId(properties.path || (parsedUrl && parsedUrl.pathname)), writeKey: maskWriteKey(config.writeKey), context: deepMerge(context, customContext) });
1485
1486
  delete withContext.meta;
1486
1487
  delete withContext.options;
1487
- if ((_f = config.privacy) === null || _f === void 0 ? void 0 : _f.disableUserIds) {
1488
+ if ((_p = config.privacy) === null || _p === void 0 ? void 0 : _p.disableUserIds) {
1488
1489
  delete withContext.userId;
1489
1490
  delete withContext.anonymousId;
1490
1491
  delete withContext.context.traits;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jitsu/js",
3
- "version": "1.9.18-canary.1288.20250415203911",
3
+ "version": "1.9.18-canary.1288.20250415214028",
4
4
  "description": "",
5
5
  "author": "Jitsu Dev Team <dev@jitsu.com>",
6
6
  "main": "dist/jitsu.cjs.js",
@@ -38,10 +38,10 @@
38
38
  "rollup": "^3.29.5",
39
39
  "ts-jest": "29.0.5",
40
40
  "typescript": "^5.6.3",
41
- "jsondiffpatch": "1.9.18-canary.1288.20250415203911"
41
+ "jsondiffpatch": "1.9.18-canary.1288.20250415214028"
42
42
  },
43
43
  "peerDependencies": {
44
- "@jitsu/protocols": "1.9.18-canary.1288.20250415203911"
44
+ "@jitsu/protocols": "1.9.18-canary.1288.20250415214028"
45
45
  },
46
46
  "dependencies": {
47
47
  "analytics": "0.8.9"