@repobit/dex-data-layer 2.1.10 → 2.2.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/CHANGELOG.md CHANGED
@@ -3,6 +3,21 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.2.0](https://github.com/bitdefender/dex-core/compare/@repobit/dex-data-layer@2.1.11...@repobit/dex-data-layer@2.2.0) (2026-04-08)
7
+
8
+ ### Features
9
+
10
+ * **DEX-26966:** added getUserVisitorId function in utils
11
+
12
+
13
+ ## [2.1.11](https://github.com/bitdefender/dex-core/compare/@repobit/dex-data-layer@2.1.10...@repobit/dex-data-layer@2.1.11) (2026-04-07)
14
+
15
+ **Note:** Version bump only for package @repobit/dex-data-layer
16
+
17
+
18
+
19
+
20
+
6
21
  ## [2.1.10](https://github.com/bitdefender/dex-core/compare/@repobit/dex-data-layer@2.1.9...@repobit/dex-data-layer@2.1.10) (2026-04-06)
7
22
 
8
23
  **Note:** Version bump only for package @repobit/dex-data-layer
@@ -9,8 +9,8 @@ export class PageLoadStartedEvent {
9
9
  const [section = '', subSection = '', subSubSection = '', subSubSubSection = ''] = pageInfo.name.split(':');
10
10
  const topLevelDomain = window.location.hostname.split('.').splice(1, 2)
11
11
  .join('.');
12
- const referringURL = page.getParamValue('ref') ||
13
- page.getParamValue('adobe_mc_ref') ||
12
+ const referringURL = page.getParamValue('ref') ??
13
+ page.getParamValue('adobe_mc_ref') ??
14
14
  document.referrer;
15
15
  this.page = {
16
16
  info: {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/events/page-load-started-event/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAG1D,MAAM,OAAO,oBAAoB;IAC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AAE;gBACrC,IAAI,EAAiB,cAAc,EAAE;gBACrC,MAAM,EAAe,cAAc;gBACnC,YAAY,EAAS,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC;gBACnE,aAAa,EAAQ,cAAc,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,EAAE;gBAClE,OAAO,EAAc,cAAc,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,EAAE;gBAC5D,GAAG,cAAc;aAClB;SACF,CAAC;IACJ,CAAC;CACF","sourcesContent":["import { Page, UserAgent } from \"@repobit/dex-utils\";\nimport { getCurrentDate, getCurrentTime } from '../utils';\nimport { PageLoadStartedAttributes, PageLoadStartedCompletePageObject, PageLoadStartedInfo } from \"./typeDefinitions\";\n\nexport class PageLoadStartedEvent {\n public event = 'page load started' as const;\n public pageInstanceID: 'dev' | 'stage' | 'prod';\n public page : PageLoadStartedCompletePageObject;\n\n constructor(page: Page, pageInfo: PageLoadStartedInfo, pageAttributes: PageLoadStartedAttributes = {}) {\n this.pageInstanceID = page.environment;\n\n const [section = '', subSection = '', subSubSection = '', subSubSubSection = ''] = pageInfo.name.split(':');\n const topLevelDomain = window.location.hostname.split('.').splice(1, 2)\n .join('.');\n const referringURL = page.getParamValue('ref') ||\n page.getParamValue('adobe_mc_ref') ||\n document.referrer;\n\n this.page = {\n info: {\n ...pageInfo,\n section,\n subSection,\n subSubSection,\n subSubSubSection,\n destinationURL: window.location.href,\n queryString : window.location.search,\n referringURL : referringURL,\n serverName : window.location.hostname,\n sysEnv : UserAgent.os || '',\n language : page.locale\n },\n attributes: {\n internalPromotionID: page.getParamValue('icid') || '',\n trackingID : page.getParamValue('cid') || '',\n time : getCurrentTime(),\n date : getCurrentDate(),\n domain : topLevelDomain,\n domainPeriod : window.location.hostname.split('.').length - 1,\n ppvScrollData : sessionStorage.getItem('ppvScrollData') || '',\n ppvName : sessionStorage.getItem('ppvName') || '',\n ...pageA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E,IAAI,EAAE;gBAClC,QAAQ,EAAQ,IAAI,CAAC,MAAM;aAC5B;YACD,UAAU,EAAE;gBACV,mBAAmB,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,EAAE;gBACrD,UAAU,EAAW,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,EAAE;gBACpD,IAAI,EAAiB,cAAc,EAAE;gBACrC,IAAI,EAAiB,cAAc,EAAE;gBACrC,MAAM,EAAe,cAAc;gBACnC,YAAY,EAAS,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC;gBACnE,aAAa,EAAQ,cAAc,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,EAAE;gBAClE,OAAO,EAAc,cAAc,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,EAAE;gBAC5D,GAAG,cAAc;aAClB;SACF,CAAC;IACJ,CAAC;CACF","sourcesContent":["import { Page, UserAgent } from \"@repobit/dex-utils\";\nimport { getCurrentDate, getCurrentTime } from '../utils';\nimport { PageLoadStartedAttributes, PageLoadStartedCompletePageObject, PageLoadStartedInfo } from \"./typeDefinitions\";\n\nexport class PageLoadStartedEvent {\n public event = 'page load started' as const;\n public pageInstanceID: 'dev' | 'stage' | 'prod';\n public page : PageLoadStartedCompletePageObject;\n\n constructor(page: Page, pageInfo: PageLoadStartedInfo, pageAttributes: PageLoadStartedAttributes = {}) {\n this.pageInstanceID = page.environment;\n\n const [section = '', subSection = '', subSubSection = '', subSubSubSection = ''] = pageInfo.name.split(':');\n const topLevelDomain = window.location.hostname.split('.').splice(1, 2)\n .join('.');\n const referringURL = page.getParamValue('ref') ??\n page.getParamValue('adobe_mc_ref') ??\n document.referrer;\n\n this.page = {\n info: {\n ...pageInfo,\n section,\n subSection,\n subSubSection,\n subSubSubSection,\n destinationURL: window.location.href,\n queryString : window.location.search,\n referringURL : referringURL,\n serverName : window.location.hostname,\n sysEnv : UserAgent.os || '',\n language : page.locale\n },\n attributes: {\n internalPromotionID: page.getParamValue('icid') || '',\n trackingID : page.getParamValue('cid') || '',\n time : getCurrentTime(),\n date : getCurrentDate(),\n domain : topLevelDomain,\n domainPeriod : window.location.hostname.split('.').length - 1,\n ppvScrollData : sessionStorage.getItem('ppvScrollData') || '',\n ppvName : sessionStorage.getItem('ppvName') || '',\n ...pageAttributes\n }\n };\n }\n}\n"]}
@@ -10,6 +10,9 @@ export class UserDetectedEvent {
10
10
  if (userData.ID) {
11
11
  this.user.ID = userData.ID;
12
12
  }
13
+ if (userData.visitorID) {
14
+ this.user.visitorID = userData.visitorID;
15
+ }
13
16
  if (emarsysID) {
14
17
  this.user.emarsysID = emarsysID;
15
18
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/events/user-detected-event/index.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,iBAAiB;IAC5B,KAAK,GAAG,eAAwB,CAAC;IACjC,IAAI,CAA6B;IAIjC,YAAY,IAAW,EAAE,QAAyB;QAChD,IAAI,IAAI,IAAI,QAAQ,EAAE,CAAC;YACrB,MAAM,SAAS,GAAG,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,IAAI,SAAS,CAAC;YAE7F,IAAI,CAAC,IAAI,GAAG;gBACV,QAAQ,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK;aACrC,CAAA;YAED,IAAI,QAAQ,CAAC,EAAE,EAAE,CAAC;gBAChB,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,QAAQ,CAAC,EAAE,CAAC;YAC7B,CAAC;YAED,IAAI,SAAS,EAAE,CAAC;gBACd,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;YAClC,CAAC;YAED,IAAI,QAAQ,CAAC,cAAc,EAAE,CAAC;gBAC5B,IAAI,CAAC,IAAI,CAAC,cAAc,GAAG,QAAQ,CAAC,cAAc,CAAC;YACrD,CAAC;QACH,CAAC;aAAM,CAAC;YACN,wCAAwC;YACxC,MAAM,yBAAyB,GAAG,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,mBAAmB,CAAC,EAAE,CACjF,mBAAmB,CAAC,KAAK,KAAK,eAAe,CACzB,CAAC;YAEvB,IAAI,yBAAyB,EAAE,CAAC;gBAC9B,IAAI,CAAC,IAAI,GAAG,EAAE,GAAG,yBAAyB,CAAC,IAAI,EAAE,CAAC;YACpD,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,IAAI,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAA;YACjC,CAAC;QACH,CAAC;IACH,CAAC;CACF","sourcesContent":["import { Page } from \"@repobit/dex-utils\";\nimport { UserDataCompleteUserObject, UserDataObject } from \"./typeDefinitions\";\n\nexport class UserDetectedEvent {\n event = 'user detected' as const;\n user: UserDataCompleteUserObject;\n\n constructor();\n constructor(page: Page, userData: UserDataObject);\n constructor(page?: Page, userData?: UserDataObject) {\n if (page && userData) {\n const emarsysID = page.getParamValue('ems-uid') || page.getParamValue('sc_uid') || undefined;\n\n this.user = {\n loggedIN: userData.ID ? true : false\n }\n\n if (userData.ID) {\n this.user.ID = userData.ID;\n }\n\n if (emarsysID) {\n this.user.emarsysID = emarsysID;\n }\n\n if (userData.productFinding) {\n this.user.productFinding = userData.productFinding;\n }\n } else {\n // find the existing user detected entry\n const existingUserDetectedEvent = window.adobeDataLayer.find(adobeDataLayerEntry =>\n adobeDataLayerEntry.event === 'user detected'\n ) as UserDetectedEvent;\n\n if (existingUserDetectedEvent) {\n this.user = { ...existingUserDetectedEvent.user };\n } else {\n this.user = { loggedIN: false }\n }\n }\n }\n}"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/events/user-detected-event/index.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,iBAAiB;IAC5B,KAAK,GAAG,eAAwB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sourcesContent":["import { Page } from \"@repobit/dex-utils\";\nimport { UserDataCompleteUserObject, UserDataObject } from \"./typeDefinitions\";\n\nexport class UserDetectedEvent {\n event = 'user detected' as const;\n user: UserDataCompleteUserObject;\n\n constructor();\n constructor(page: Page, userData: UserDataObject);\n constructor(page?: Page, userData?: UserDataObject) {\n if (page && userData) {\n const emarsysID = page.getParamValue('ems-uid') || page.getParamValue('sc_uid') || undefined;\n\n this.user = {\n loggedIN: userData.ID ? true : false\n }\n\n if (userData.ID) {\n this.user.ID = userData.ID;\n }\n\n if (userData.visitorID) {\n this.user.visitorID = userData.visitorID;\n }\n\n if (emarsysID) {\n this.user.emarsysID = emarsysID;\n }\n\n if (userData.productFinding) {\n this.user.productFinding = userData.productFinding;\n }\n } else {\n // find the existing user detected entry\n const existingUserDetectedEvent = window.adobeDataLayer.find(adobeDataLayerEntry =>\n adobeDataLayerEntry.event === 'user detected'\n ) as UserDetectedEvent;\n\n if (existingUserDetectedEvent) {\n this.user = { ...existingUserDetectedEvent.user };\n } else {\n this.user = { loggedIN: false }\n }\n }\n }\n}"]}
@@ -1,10 +1,12 @@
1
1
  export type UserDataObject = {
2
2
  ID?: string;
3
3
  productFinding?: string;
4
+ visitorID?: string;
4
5
  };
5
6
  export type UserDataCompleteUserObject = {
6
7
  loggedIN: boolean;
7
8
  emarsysID?: string;
8
9
  ID?: string;
9
10
  productFinding?: string;
11
+ visitorID?: string;
10
12
  };
@@ -1 +1 @@
1
- {"version":3,"file":"typeDefinitions.js","sourceRoot":"","sources":["../../../../src/events/user-detected-event/typeDefinitions.ts"],"names":[],"mappings":"","sourcesContent":["export type UserDataObject = {\n ID ?: string,\n productFinding?: string\n};\n\nexport type UserDataCompleteUserObject = {\n loggedIN : boolean,\n emarsysID ?: string,\n ID ?: string,\n productFinding?: string\n}"]}
1
+ {"version":3,"file":"typeDefinitions.js","sourceRoot":"","sources":["../../../../src/events/user-detected-event/typeDefinitions.ts"],"names":[],"mappings":"","sourcesContent":["export type UserDataObject = {\n ID ?: string,\n productFinding?: string,\n visitorID ?: string,\n};\n\nexport type UserDataCompleteUserObject = {\n loggedIN : boolean,\n emarsysID ?: string,\n ID ?: string,\n productFinding?: string,\n visitorID ?: string,\n}"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@repobit/dex-data-layer",
3
- "version": "2.1.10",
3
+ "version": "2.2.0",
4
4
  "description": "Client for Adobe Data Layer",
5
5
  "author": "Constantin Ioan Mihai <iconstantin@bitdefender.com>",
6
6
  "homepage": "https://github.com/bitdefender/dex-core#readme",
@@ -30,9 +30,9 @@
30
30
  "type": "module",
31
31
  "types": "dist/src/index.d.ts",
32
32
  "dependencies": {
33
- "@repobit/dex-constants": "^2.0.1",
33
+ "@repobit/dex-constants": "^2.1.0",
34
34
  "@repobit/dex-store": "^0.3.0",
35
- "@repobit/dex-utils": "^2.1.12"
35
+ "@repobit/dex-utils": "^2.2.0"
36
36
  },
37
37
  "peerDependencies": {
38
38
  "deepmerge": "^4.3.1"
@@ -40,5 +40,5 @@
40
40
  "volta": {
41
41
  "node": "24.14.0"
42
42
  },
43
- "gitHead": "00c00c361b7510c13bb53e88419f1d558427fd39"
43
+ "gitHead": "99aa500ad3eeca630bd6f205bd9ce23660d1c7f9"
44
44
  }