@repobit/dex-target 2.9.0 → 2.10.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,20 @@
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.10.0](https://github.com/bitdefender/dex-core/compare/@repobit/dex-target@2.9.0...@repobit/dex-target@2.10.0) (2026-02-03)
7
+
8
+
9
+ ### Features
10
+
11
+ * **DEX-26244:** add track offer event ([f3f0b4a](https://github.com/bitdefender/dex-core/commit/f3f0b4ab193f11a5db3be6917d707e4a95543ce8))
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * **DEX-21811:** delete test case ([4ff5482](https://github.com/bitdefender/dex-core/commit/4ff548219e1c138426f3b97c4d2bca0c7bf4008c))
17
+
18
+
19
+
6
20
  ## [2.9.0](https://github.com/bitdefender/dex-core/compare/@repobit/dex-target@2.8.0...@repobit/dex-target@2.9.0) (2026-02-02)
7
21
 
8
22
 
@@ -1,4 +1,4 @@
1
- import { PageLoadStartedEvent } from '@repobit/dex-data-layer';
1
+ import { AlloyResponsePropositions, PageLoadStartedEvent } from '@repobit/dex-data-layer';
2
2
  import { AlloyFunction, CdpData, ConfigMbox, MboxParameters, MboxProfileParameters } from './typeDefinitions.js';
3
3
  declare global {
4
4
  interface Window {
@@ -70,4 +70,14 @@ export default class Target {
70
70
  parameters?: MboxParameters;
71
71
  profileParameters?: MboxProfileParameters;
72
72
  }): Promise<Record<string, object | undefined>>;
73
+ getMboxProposition<T extends object = object>(param: {
74
+ mboxName: string;
75
+ parameters?: MboxParameters;
76
+ profileParameters?: MboxProfileParameters;
77
+ }): Promise<AlloyResponsePropositions<T> | undefined>;
78
+ trackOffer(param: {
79
+ id: AlloyResponsePropositions["id"];
80
+ scope: AlloyResponsePropositions["scope"];
81
+ scopeDetails: AlloyResponsePropositions["scopeDetails"];
82
+ }): Promise<void>;
73
83
  }
package/dist/src/index.js CHANGED
@@ -164,7 +164,7 @@ export default class Target {
164
164
  notRequestedMboxes.forEach(mbox => {
165
165
  const receivedMboxOfferCall = new Promise((resolve, reject) => {
166
166
  notRequestedOffersCall.then(result => {
167
- const mboxResult = result.propositions.find((offer) => offer.scope === mbox)?.items?.[0]?.data?.content;
167
+ const mboxResult = result.propositions.find((offer) => offer.scope === mbox);
168
168
  resolve(mboxResult);
169
169
  }).catch(e => {
170
170
  reject(e);
@@ -177,11 +177,32 @@ export default class Target {
177
177
  const mboxesPromises = mboxNames.map(mboxName => this.cachedMboxes.get(`${mboxName}_${JSON.stringify(parameters)}_${JSON.stringify(profileParameters)}`));
178
178
  const resolvedMboxes = await Promise.allSettled(mboxesPromises);
179
179
  const offersResult = mboxNames.reduce((acc, mboxName, index) => {
180
- acc[mboxName] = resolvedMboxes[index].status === 'fulfilled' ? resolvedMboxes[index].value : undefined;
180
+ acc[mboxName] = resolvedMboxes[index].status === 'fulfilled' ? resolvedMboxes[index].value?.items?.[0]?.data?.content : undefined;
181
181
  return acc;
182
182
  }, {});
183
183
  return isInitialyArray ? offersResult : offersResult[mboxNames[0]];
184
184
  }
185
+ async getMboxProposition(param) {
186
+ return await this.cachedMboxes.get(`${param.mboxName}_${JSON.stringify(param.parameters)}_${JSON.stringify(param.profileParameters)}`);
187
+ }
188
+ async trackOffer(param) {
189
+ await window.alloyProxy('sendEvent', {
190
+ type: 'decisioning.propositionInteract',
191
+ xdm: {
192
+ _experience: {
193
+ decisioning: {
194
+ propositions: [
195
+ {
196
+ id: param.id,
197
+ scope: param.scope,
198
+ scopeDetails: param.scopeDetails
199
+ }
200
+ ]
201
+ }
202
+ }
203
+ }
204
+ });
205
+ }
185
206
  }
186
207
  window.BD = window.BD || {};
187
208
  window.BD.state = window.BD.state || {};
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAA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QACL,CAAC;QAED,MAAM,cAAc,GAAG,SAAS,CAAC,GAAG,CAClC,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,QAAQ,IAAI,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,EAAE,CAAC,CACpH,CAAC;QACF,MAAM,cAAc,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;QAEhE,MAAM,YAAY,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE;YAC7D,GAAG,CAAC,QAAQ,CAAC,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;YACvG,OAAO,GAAG,CAAC;QACb,CAAC,EAAE,EAAwC,CAAC,CAAC;QAE7C,OAAO,eAAe,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;IACrE,CAAC;CACF;AAED,MAAM,CAAC,EAAE,GAAG,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC;AAC5B,MAAM,CAAC,EAAE,CAAC,KAAK,GAAG,MAAM,CAAC,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC","sourcesContent":["import { Constants } from '@repobit/dex-constants';\nimport { AdobeDataLayerService, CdpEvent, DecisionsDisplayedEvent, PageLoadStartedEvent } from '@repobit/dex-data-layer';\nimport {\n AlloyAppendIdentityToUrlResponse,\n AlloyApplyPropositionsResponse,\n AlloyFunction,\n AlloySendEventResponse,\n AppendIdentityToUrlCall,\n ApplyPropositionsCall,\n CdpData,\n CdpDataJson,\n ConfigMbox,\n GetIdentityCall,\n GetIdentityResponse,\n MboxParameters,\n MboxProfileParameters,\n SendEventCall,\n URLParameters\n} from './typeDefinitions';\n\ndeclare global {\n interface Window {\n alloyProxy: AlloyFunction;\n BD: {\n state: {\n cdpDataPromise: Promise<CdpData>\n }\n }\n }\n}\n\nif (!window.Promise.withResolvers) {\n window.Promise.withResolvers = function<T>() {\n let resolve, reject;\n const promise = new Promise<T>((res, rej) => {\n resolve = res;\n reject = rej;\n });\n return { resolve, reject, promise } as unknown as PromiseWithResolvers<T>;\n }\n}\n\nexport default class Target {\n private urlParameters : URLParameters;\n private profileUrlParameters: { [key: string]: string | undefined };\n private cachedMboxes : Map<string, Promise<object | undefined>>;\n private _configMbox : Promise<ConfigMbox | undefined>;\n private controller : AbortController = new AbortController();\n private _visitorInfo : Promise<GetIdentityResponse>;\n private cdpData : Promise<CdpData>;\n\n constructor(config?: Partial<{ pageLoadStartedEvent: PageLoadStartedEvent }>) {\n this.urlParameters = this.getUrlParameters();\n this.profileUrlParameters = this.transfromIntoProfileParameters(this.urlParameters);\n this.cachedMboxes = new Map();\n\n if (!window.alloyProxy) {\n function __alloy(...args: SendEventCall): Promise<AlloySendEventResponse>;\n function __alloy(...args: AppendIdentityToUrlCall): Promise<AlloyAppendIdentityToUrlResponse>;\n function __alloy(...args: ApplyPropositionsCall): Promise<AlloyApplyPropositionsResponse>;\n function __alloy(...args: GetIdentityCall): Promise<GetIdentityResponse>;\n function __alloy(...args: SendEventCall | AppendIdentityToUrlCall | ApplyPropositionsCall | GetIdentityCall):\n Promise<AlloySendEventResponse | AlloyAppendIdentityToUrlResponse | AlloyApplyPropositionsResponse | GetIdentityResponse> {\n return new Promise((resolve, reject) => {\n window.alloyProxy.q.push([resolve, reject, args]);\n });\n }\n\n window.alloyProxy = __alloy as AlloyFunction;\n window.alloyProxy.q = [];\n }\n\n // check for dotest=1 in URL. If it exists abort all target calls\n const urlParams = new URLSearchParams(window.location.search);\n if (urlParams.get('dotest') === '1') {\n this.abort();\n }\n\n this._visitorInfo = new Promise((resolve) => {\n if (this.controller.signal?.aborted) {\n resolve({});\n }\n\n window.alloyProxy('getIdentity').then(result => resolve(result))\n .catch(() => resolve({}));\n this.controller.signal?.addEventListener('abort', () => resolve({}));\n });\n this.cdpData = config?.pageLoadStartedEvent && urlParams.get('dotest') !== '1'\n ? this.sendCdpData(config?.pageLoadStartedEvent)\n : Promise.resolve({} as CdpData);\n this._configMbox = this.getOffers({ mboxNames: 'config-mbox' });\n }\n\n /** get an object containing all the url query parameters */\n private getUrlParameters(): URLParameters {\n const urlParams = new URLSearchParams(window.location.search);\n const parameters: URLParameters = {};\n\n urlParams.forEach((value: string, key: string) => {\n parameters[key] = value;\n });\n\n return parameters;\n }\n\n public get configMbox() {\n return this._configMbox;\n }\n\n public get visitorInfo() {\n return this._visitorInfo;\n }\n\n /** add adobe_mc parameter at the end of the url */\n public appendVisitorIDsTo(url: string): Promise<string> {\n if (this.controller.signal?.aborted || url.includes('adobe_mc')) {\n return Promise.resolve(url);\n }\n\n return new Promise((resolve) => {\n window.alloyProxy('appendIdentityToUrl', { url }).then(result => resolve(result.url))\n .catch(() => resolve(url));\n this.controller.signal?.addEventListener('abort', () => resolve(url));\n });\n }\n\n /** abort all the Target calls for casese where Target does not load */\n public abort(): void {\n this.controller.abort();\n }\n\n public async sendCdpData(pageLoadStartedEvent: PageLoadStartedEvent): Promise<CdpData> {\n const cdpDataPromise = Promise.withResolvers<CdpData>();\n let cdpData: CdpData = {};\n if (window.BD.state.cdpDataPromise) {\n return await window.BD.state.cdpDataPromise;\n }\n window.BD.state.cdpDataPromise = cdpDataPromise.promise;\n\n try {\n const ecid = (await this.visitorInfo)?.identity?.ECID;\n const cdpDataCall = await fetch(\n `${Constants.PUBLIC_URL_ORIGIN}/cdp/`,\n {\n method: 'POST',\n body : JSON.stringify({\n mcvisid: ecid || '',\n ...pageLoadStartedEvent.page\n })\n }\n );\n\n /** @type {{auds: string[], mdl: {key: string, value: string}[], ub: any[] vid: string}} */\n const receivedCdpData: CdpDataJson = await cdpDataCall.json();\n cdpData = {\n auds: receivedCdpData?.auds[0] || ''\n };\n\n if (receivedCdpData.mdl) {\n cdpData = receivedCdpData?.mdl.reduce((acc, mdlValue) => {\n acc[mdlValue.key] = mdlValue.value;\n return acc;\n }, cdpData);\n }\n\n AdobeDataLayerService.push(new CdpEvent(cdpData));\n } catch (e) {\n console.warn(e);\n }\n\n cdpDataPromise.resolve(cdpData);\n return cdpData;\n }\n\n private transfromIntoProfileParameters(object: { [key: string]: string | undefined }) {\n const profileObject: { [key: string]: string | undefined } = Object.keys(object).reduce((acc, key) => {\n acc[`profile.${key}`] = object[key];\n return acc;\n }, {} as { [key: string]: string | undefined });\n\n return profileObject;\n }\n\n public async getOffers(param: {\n mboxNames : 'config-mbox',\n parameters? : MboxParameters,\n profileParameters?: MboxProfileParameters\n }): Promise<ConfigMbox | undefined>;\n public async getOffers(param: {\n mboxNames : string,\n parameters? : MboxParameters,\n profileParameters?: MboxProfileParameters\n }): Promise<object | undefined>;\n public async getOffers(param: {\n mboxNames : string[],\n parameters? : MboxParameters,\n profileParameters?: MboxProfileParameters\n }): Promise<Record<string, object | undefined>>;\n public async getOffers(param: {\n mboxNames : string[] | string,\n parameters? : MboxParameters,\n profileParameters?: MboxProfileParameters\n }) {\n let { mboxNames } = param;\n const isInitialyArray = Array.isArray(mboxNames);\n const { parameters, profileParameters } = param;\n if (!Array.isArray(mboxNames)) {\n mboxNames = [mboxNames];\n }\n\n const cdpData = await this.cdpData;\n if (this.controller.signal?.aborted) {\n return mboxNames.length > 1 ? {} : undefined;\n }\n\n const notRequestedMboxes = mboxNames.filter(\n mbox => !this.cachedMboxes.has(`${mbox}_${JSON.stringify(parameters)}`)\n );\n if (notRequestedMboxes.length) {\n const notRequestedOffersCall = window.alloyProxy('sendEvent', {\n type : 'decisioning.propositionFetch',\n decisionScopes: notRequestedMboxes,\n data : {\n '__adobe': {\n 'target': Object.assign(\n {},\n this.urlParameters,\n this.profileUrlParameters,\n parameters ? parameters : {},\n profileParameters ? profileParameters : {},\n cdpData,\n this.transfromIntoProfileParameters(cdpData)\n )\n }\n }\n });\n\n notRequestedOffersCall.then(result => {\n const htmlPropositions = result.propositions.filter(\n proposition => proposition?.items?.some(item => item.data?.format?.includes('html') || !item.data)\n );\n const jsonPropositions = result.propositions.filter(\n proposition => proposition?.items?.some(item => item.data?.format?.includes('json'))\n ).map(proposition => {\n const { ...propositionCopy } = proposition;\n delete propositionCopy.items;\n delete propositionCopy.renderAttempted;\n return propositionCopy;\n });\n\n if (htmlPropositions.length) {\n window.alloyProxy('applyPropositions', {\n 'propositions': htmlPropositions,\n 'viewName' : window.location.href\n });\n }\n\n if (jsonPropositions.length) {\n AdobeDataLayerService.push(new DecisionsDisplayedEvent(jsonPropositions));\n }\n });\n\n notRequestedMboxes.forEach(mbox => {\n const receivedMboxOfferCall: Promise<object | undefined> = new Promise((resolve, reject) => {\n notRequestedOffersCall.then(result => {\n const mboxResult = result.propositions.find(\n (offer) => offer.scope === mbox\n )?.items?.[0]?.data?.content;\n\n resolve(mboxResult);\n }).catch(e => {\n reject(e);\n });\n\n this.controller.signal?.addEventListener('abort', reject);\n });\n\n this.cachedMboxes.set(`${mbox}_${JSON.stringify(parameters)}_${JSON.stringify(profileParameters)}`, receivedMboxOfferCall);\n });\n }\n\n const mboxesPromises = mboxNames.map(\n mboxName => this.cachedMboxes.get(`${mboxName}_${JSON.stringify(parameters)}_${JSON.stringify(profileParameters)}`)\n );\n const resolvedMboxes = await Promise.allSettled(mboxesPromises);\n\n const offersResult = mboxNames.reduce((acc, mboxName, index) => {\n acc[mboxName] = resolvedMboxes[index].status === 'fulfilled' ? resolvedMboxes[index].value : undefined;\n return acc;\n }, {} as Record<string, object | undefined>);\n\n return isInitialyArray ? offersResult : offersResult[mboxNames[0]];\n }\n}\n\nwindow.BD = window.BD || {};\nwindow.BD.state = window.BD.state || {};"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,M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AAC,EAAE;gCACtB,KAAK,EAAS,KAAK,CAAC,KAAK;gCACzB,YAAY,EAAE,KAAK,CAAC,YAAY;6BACjC;yBACF;qBACF;iBACF;aACF;SACF,CAAC,CAAC;IACL,CAAC;CACF;AAED,MAAM,CAAC,EAAE,GAAG,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC;AAC5B,MAAM,CAAC,EAAE,CAAC,KAAK,GAAG,MAAM,CAAC,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC","sourcesContent":["import { Constants } from '@repobit/dex-constants';\nimport { AdobeDataLayerService, AlloyResponsePropositions, CdpEvent, DecisionsDisplayedEvent, PageLoadStartedEvent } from '@repobit/dex-data-layer';\nimport {\n AlloyAppendIdentityToUrlResponse,\n AlloyApplyPropositionsResponse,\n AlloyFunction,\n AlloySendEventResponse,\n AppendIdentityToUrlCall,\n ApplyPropositionsCall,\n CdpData,\n CdpDataJson,\n ConfigMbox,\n GetIdentityCall,\n GetIdentityResponse,\n MboxParameters,\n MboxProfileParameters,\n SendEventCall,\n URLParameters\n} from './typeDefinitions';\n\ndeclare global {\n interface Window {\n alloyProxy: AlloyFunction;\n BD: {\n state: {\n cdpDataPromise: Promise<CdpData>\n }\n }\n }\n}\n\nif (!window.Promise.withResolvers) {\n window.Promise.withResolvers = function<T>() {\n let resolve, reject;\n const promise = new Promise<T>((res, rej) => {\n resolve = res;\n reject = rej;\n });\n return { resolve, reject, promise } as unknown as PromiseWithResolvers<T>;\n }\n}\n\nexport default class Target {\n private urlParameters : URLParameters;\n private profileUrlParameters: { [key: string]: string | undefined };\n private cachedMboxes : Map<string, Promise<AlloyResponsePropositions | undefined>>;\n private _configMbox : Promise<ConfigMbox | undefined>;\n private controller : AbortController = new AbortController();\n private _visitorInfo : Promise<GetIdentityResponse>;\n private cdpData : Promise<CdpData>;\n\n constructor(config?: Partial<{ pageLoadStartedEvent: PageLoadStartedEvent }>) {\n this.urlParameters = this.getUrlParameters();\n this.profileUrlParameters = this.transfromIntoProfileParameters(this.urlParameters);\n this.cachedMboxes = new Map();\n\n if (!window.alloyProxy) {\n function __alloy(...args: SendEventCall): Promise<AlloySendEventResponse>;\n function __alloy(...args: AppendIdentityToUrlCall): Promise<AlloyAppendIdentityToUrlResponse>;\n function __alloy(...args: ApplyPropositionsCall): Promise<AlloyApplyPropositionsResponse>;\n function __alloy(...args: GetIdentityCall): Promise<GetIdentityResponse>;\n function __alloy(...args: SendEventCall | AppendIdentityToUrlCall | ApplyPropositionsCall | GetIdentityCall):\n Promise<AlloySendEventResponse | AlloyAppendIdentityToUrlResponse | AlloyApplyPropositionsResponse | GetIdentityResponse> {\n return new Promise((resolve, reject) => {\n window.alloyProxy.q.push([resolve, reject, args]);\n });\n }\n\n window.alloyProxy = __alloy as AlloyFunction;\n window.alloyProxy.q = [];\n }\n\n // check for dotest=1 in URL. If it exists abort all target calls\n const urlParams = new URLSearchParams(window.location.search);\n if (urlParams.get('dotest') === '1') {\n this.abort();\n }\n\n this._visitorInfo = new Promise((resolve) => {\n if (this.controller.signal?.aborted) {\n resolve({});\n }\n\n window.alloyProxy('getIdentity').then(result => resolve(result))\n .catch(() => resolve({}));\n this.controller.signal?.addEventListener('abort', () => resolve({}));\n });\n this.cdpData = config?.pageLoadStartedEvent && urlParams.get('dotest') !== '1'\n ? this.sendCdpData(config?.pageLoadStartedEvent)\n : Promise.resolve({} as CdpData);\n this._configMbox = this.getOffers({ mboxNames: 'config-mbox' });\n }\n\n /** get an object containing all the url query parameters */\n private getUrlParameters(): URLParameters {\n const urlParams = new URLSearchParams(window.location.search);\n const parameters: URLParameters = {};\n\n urlParams.forEach((value: string, key: string) => {\n parameters[key] = value;\n });\n\n return parameters;\n }\n\n public get configMbox() {\n return this._configMbox;\n }\n\n public get visitorInfo() {\n return this._visitorInfo;\n }\n\n /** add adobe_mc parameter at the end of the url */\n public appendVisitorIDsTo(url: string): Promise<string> {\n if (this.controller.signal?.aborted || url.includes('adobe_mc')) {\n return Promise.resolve(url);\n }\n\n return new Promise((resolve) => {\n window.alloyProxy('appendIdentityToUrl', { url }).then(result => resolve(result.url))\n .catch(() => resolve(url));\n this.controller.signal?.addEventListener('abort', () => resolve(url));\n });\n }\n\n /** abort all the Target calls for casese where Target does not load */\n public abort(): void {\n this.controller.abort();\n }\n\n public async sendCdpData(pageLoadStartedEvent: PageLoadStartedEvent): Promise<CdpData> {\n const cdpDataPromise = Promise.withResolvers<CdpData>();\n let cdpData: CdpData = {};\n if (window.BD.state.cdpDataPromise) {\n return await window.BD.state.cdpDataPromise;\n }\n window.BD.state.cdpDataPromise = cdpDataPromise.promise;\n\n try {\n const ecid = (await this.visitorInfo)?.identity?.ECID;\n const cdpDataCall = await fetch(\n `${Constants.PUBLIC_URL_ORIGIN}/cdp/`,\n {\n method: 'POST',\n body : JSON.stringify({\n mcvisid: ecid || '',\n ...pageLoadStartedEvent.page\n })\n }\n );\n\n /** @type {{auds: string[], mdl: {key: string, value: string}[], ub: any[] vid: string}} */\n const receivedCdpData: CdpDataJson = await cdpDataCall.json();\n cdpData = {\n auds: receivedCdpData?.auds[0] || ''\n };\n\n if (receivedCdpData.mdl) {\n cdpData = receivedCdpData?.mdl.reduce((acc, mdlValue) => {\n acc[mdlValue.key] = mdlValue.value;\n return acc;\n }, cdpData);\n }\n\n AdobeDataLayerService.push(new CdpEvent(cdpData));\n } catch (e) {\n console.warn(e);\n }\n\n cdpDataPromise.resolve(cdpData);\n return cdpData;\n }\n\n private transfromIntoProfileParameters(object: { [key: string]: string | undefined }) {\n const profileObject: { [key: string]: string | undefined } = Object.keys(object).reduce((acc, key) => {\n acc[`profile.${key}`] = object[key];\n return acc;\n }, {} as { [key: string]: string | undefined });\n\n return profileObject;\n }\n\n public async getOffers(param: {\n mboxNames : 'config-mbox',\n parameters? : MboxParameters,\n profileParameters?: MboxProfileParameters\n }): Promise<ConfigMbox | undefined>;\n public async getOffers(param: {\n mboxNames : string,\n parameters? : MboxParameters,\n profileParameters?: MboxProfileParameters\n }): Promise<object | undefined>;\n public async getOffers(param: {\n mboxNames : string[],\n parameters? : MboxParameters,\n profileParameters?: MboxProfileParameters\n }): Promise<Record<string, object | undefined>>;\n public async getOffers(param: {\n mboxNames : string[] | string,\n parameters? : MboxParameters,\n profileParameters?: MboxProfileParameters\n }) {\n let { mboxNames } = param;\n const isInitialyArray = Array.isArray(mboxNames);\n const { parameters, profileParameters } = param;\n if (!Array.isArray(mboxNames)) {\n mboxNames = [mboxNames];\n }\n\n const cdpData = await this.cdpData;\n if (this.controller.signal?.aborted) {\n return mboxNames.length > 1 ? {} : undefined;\n }\n\n const notRequestedMboxes = mboxNames.filter(\n mbox => !this.cachedMboxes.has(`${mbox}_${JSON.stringify(parameters)}`)\n );\n if (notRequestedMboxes.length) {\n const notRequestedOffersCall = window.alloyProxy('sendEvent', {\n type : 'decisioning.propositionFetch',\n decisionScopes: notRequestedMboxes,\n data : {\n '__adobe': {\n 'target': Object.assign(\n {},\n this.urlParameters,\n this.profileUrlParameters,\n parameters ? parameters : {},\n profileParameters ? profileParameters : {},\n cdpData,\n this.transfromIntoProfileParameters(cdpData)\n )\n }\n }\n });\n\n notRequestedOffersCall.then(result => {\n const htmlPropositions = result.propositions.filter(\n proposition => proposition?.items?.some(item => item.data?.format?.includes('html') || !item.data)\n );\n const jsonPropositions = result.propositions.filter(\n proposition => proposition?.items?.some(item => item.data?.format?.includes('json'))\n ).map(proposition => {\n const { ...propositionCopy } = proposition;\n delete propositionCopy.items;\n delete propositionCopy.renderAttempted;\n return propositionCopy;\n });\n\n if (htmlPropositions.length) {\n window.alloyProxy('applyPropositions', {\n 'propositions': htmlPropositions,\n 'viewName' : window.location.href\n });\n }\n\n if (jsonPropositions.length) {\n AdobeDataLayerService.push(new DecisionsDisplayedEvent(jsonPropositions));\n }\n });\n\n notRequestedMboxes.forEach(mbox => {\n const receivedMboxOfferCall: Promise<AlloyResponsePropositions | undefined> = new Promise((resolve, reject) => {\n notRequestedOffersCall.then(result => {\n const mboxResult = result.propositions.find(\n (offer) => offer.scope === mbox\n );\n\n resolve(mboxResult);\n }).catch(e => {\n reject(e);\n });\n\n this.controller.signal?.addEventListener('abort', reject);\n });\n\n this.cachedMboxes.set(`${mbox}_${JSON.stringify(parameters)}_${JSON.stringify(profileParameters)}`, receivedMboxOfferCall);\n });\n }\n\n const mboxesPromises = mboxNames.map(\n mboxName => this.cachedMboxes.get(`${mboxName}_${JSON.stringify(parameters)}_${JSON.stringify(profileParameters)}`)\n );\n const resolvedMboxes = await Promise.allSettled(mboxesPromises);\n\n const offersResult = mboxNames.reduce((acc, mboxName, index) => {\n acc[mboxName] = resolvedMboxes[index].status === 'fulfilled' ? resolvedMboxes[index].value?.items?.[0]?.data?.content : undefined;\n return acc;\n }, {} as Record<string, object | undefined>);\n\n return isInitialyArray ? offersResult : offersResult[mboxNames[0]];\n }\n\n public async getMboxProposition<T extends object = object>(\n param: { mboxName: string, parameters?: MboxParameters, profileParameters?: MboxProfileParameters }\n ): Promise<AlloyResponsePropositions<T> | undefined> {\n return await this.cachedMboxes.get(\n `${param.mboxName}_${JSON.stringify(param.parameters)}_${JSON.stringify(param.profileParameters)}`\n ) as AlloyResponsePropositions<T> | undefined;\n }\n\n public async trackOffer(param: { id: AlloyResponsePropositions[\"id\"], scope: AlloyResponsePropositions[\"scope\"], scopeDetails: AlloyResponsePropositions[\"scopeDetails\"] }) {\n await window.alloyProxy('sendEvent', {\n type: 'decisioning.propositionInteract',\n xdm : {\n _experience: {\n decisioning: {\n propositions: [\n {\n id : param.id,\n scope : param.scope,\n scopeDetails: param.scopeDetails\n }\n ]\n }\n }\n }\n });\n }\n}\n\nwindow.BD = window.BD || {};\nwindow.BD.state = window.BD.state || {};\n"]}
@@ -12,7 +12,7 @@ export type SendEventCall = [
12
12
  'sendEvent',
13
13
  {
14
14
  type?: string;
15
- decisionScopes: string[];
15
+ decisionScopes?: string[];
16
16
  data?: {
17
17
  '__adobe': {
18
18
  'target': {
@@ -20,6 +20,13 @@ export type SendEventCall = [
20
20
  };
21
21
  };
22
22
  };
23
+ xdm?: {
24
+ _experience?: {
25
+ decisioning?: {
26
+ propositions?: object[];
27
+ };
28
+ };
29
+ };
23
30
  renderDecisions?: boolean;
24
31
  }
25
32
  ];
@@ -1 +1 @@
1
- {"version":3,"file":"typeDefinitions.js","sourceRoot":"","sources":["../../src/typeDefinitions.ts"],"names":[],"mappings":"","sourcesContent":["import { AlloyResponseDecision, AlloyResponsePropositions } from '@repobit/dex-data-layer';\n\nexport type MboxProfileParameters = {\n [key: `profile.${string}`]: string\n};\n\nexport type MboxParameters = {\n [key: string]: string\n};\n\nexport type URLParameters = {\n [key: string]: string\n};\n\nexport type SendEventCall = [\n 'sendEvent',\n {\n type ?: string,\n decisionScopes : string[],\n data?: {\n '__adobe': {\n 'target': {\n [key: string]: string\n }\n }\n },\n renderDecisions?: boolean,\n }\n];\n\nexport type DisplayPropositionsCall = [\n 'sendEvent',\n Partial<{\n type : string,\n personalization: {\n decisionScopes: string[]\n }\n \"xdm\": {\n \"_experience\": {\n \"decisioning\": {\n \"propositions\":\n {\n \"id\" : string,\n \"scope\" : string,\n \"scopeDetails\": object\n }[],\n \"propositionEventType\": {\n \"display\": number\n }\n }\n }\n }\n }>\n];\n\nexport type AppendIdentityToUrlCall = [\n 'appendIdentityToUrl',\n { url: string }\n];\n\nexport type ApplyPropositionsCall = [\n 'applyPropositions',\n {\n propositions: AlloyResponsePropositions[],\n viewName : string\n }\n];\n\nexport type GetIdentityCall = [\n 'getIdentity'\n];\n\nexport type AlloySendEventResponse = {\n decisions : AlloyResponseDecision[],\n propositions: AlloyResponsePropositions[],\n destinations: object[]\n};\n\nexport type DisplayPropositionsResponse = {\n propositions: AlloyResponsePropositions[],\n destinations: object[]\n}\n\nexport type AlloyAppendIdentityToUrlResponse = {\n url: string\n}\n\nexport type AlloyApplyPropositionsResponse = {\n propositions: AlloyResponsePropositions[]\n}\n\nexport type GetIdentityResponse = Partial<{\n edge: {\n regionId?: number\n },\n identity: {\n ECID: string\n }\n}>;\n\nexport type AlloyFunction = {\n (...args: DisplayPropositionsCall): Promise<DisplayPropositionsResponse>,\n (...args: SendEventCall): Promise<AlloySendEventResponse>,\n (...args: AppendIdentityToUrlCall): Promise<AlloyAppendIdentityToUrlResponse>,\n (...args: ApplyPropositionsCall): Promise<AlloyApplyPropositionsResponse>\n (...args: GetIdentityCall): Promise<GetIdentityResponse>\n q: Array<\n [\n // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n resolve: Function,\n // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n reject: Function,\n args: SendEventCall | AppendIdentityToUrlCall | ApplyPropositionsCall | GetIdentityCall | DisplayPropositionsCall\n ]\n >;\n};\n\nexport type ConfigMbox = Partial<{\n promotion: string,\n provider : 'init' | 'vlaicu',\n products: {\n [key: string]: {\n [key: `${number}-${number}`]: Partial<{\n extraParameters: {\n key : string,\n value: string\n }[],\n price : number,\n discountedPrice: number,\n buyLink : string\n }>\n }\n },\n useGeoIpPricing: boolean\n}>;\n\nexport type CdpData = {\n auds ?: string,\n [key: string] : string | undefined\n};\n\nexport type CdpDataJson = {\n auds: string[],\n mdl : { key: string, value: string }[],\n ub : unknown[],\n vid : string\n}"]}
1
+ {"version":3,"file":"typeDefinitions.js","sourceRoot":"","sources":["../../src/typeDefinitions.ts"],"names":[],"mappings":"","sourcesContent":["import { AlloyResponseDecision, AlloyResponsePropositions } from '@repobit/dex-data-layer';\n\nexport type MboxProfileParameters = {\n [key: `profile.${string}`]: string\n};\n\nexport type MboxParameters = {\n [key: string]: string\n};\n\nexport type URLParameters = {\n [key: string]: string\n};\n\nexport type SendEventCall = [\n 'sendEvent',\n {\n type ? : string,\n decisionScopes ?: string[],\n data?: {\n '__adobe': {\n 'target': {\n [key: string]: string\n }\n }\n },\n xdm?: {\n _experience?: {\n decisioning?: {\n propositions?: object[],\n }\n }\n }\n renderDecisions?: boolean,\n }\n];\n\nexport type DisplayPropositionsCall = [\n 'sendEvent',\n Partial<{\n type : string,\n personalization: {\n decisionScopes: string[]\n }\n \"xdm\": {\n \"_experience\": {\n \"decisioning\": {\n \"propositions\":\n {\n \"id\" : string,\n \"scope\" : string,\n \"scopeDetails\": object\n }[],\n \"propositionEventType\": {\n \"display\": number\n }\n }\n }\n }\n }>\n];\n\nexport type AppendIdentityToUrlCall = [\n 'appendIdentityToUrl',\n { url: string }\n];\n\nexport type ApplyPropositionsCall = [\n 'applyPropositions',\n {\n propositions: AlloyResponsePropositions[],\n viewName : string\n }\n];\n\nexport type GetIdentityCall = [\n 'getIdentity'\n];\n\nexport type AlloySendEventResponse = {\n decisions : AlloyResponseDecision[],\n propositions: AlloyResponsePropositions[],\n destinations: object[]\n};\n\nexport type DisplayPropositionsResponse = {\n propositions: AlloyResponsePropositions[],\n destinations: object[]\n}\n\nexport type AlloyAppendIdentityToUrlResponse = {\n url: string\n}\n\nexport type AlloyApplyPropositionsResponse = {\n propositions: AlloyResponsePropositions[]\n}\n\nexport type GetIdentityResponse = Partial<{\n edge: {\n regionId?: number\n },\n identity: {\n ECID: string\n }\n}>;\n\nexport type AlloyFunction = {\n (...args: DisplayPropositionsCall): Promise<DisplayPropositionsResponse>,\n (...args: SendEventCall): Promise<AlloySendEventResponse>,\n (...args: AppendIdentityToUrlCall): Promise<AlloyAppendIdentityToUrlResponse>,\n (...args: ApplyPropositionsCall): Promise<AlloyApplyPropositionsResponse>\n (...args: GetIdentityCall): Promise<GetIdentityResponse>\n q: Array<\n [\n // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n resolve: Function,\n // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n reject: Function,\n args: SendEventCall | AppendIdentityToUrlCall | ApplyPropositionsCall | GetIdentityCall | DisplayPropositionsCall\n ]\n >;\n};\n\nexport type ConfigMbox = Partial<{\n promotion: string,\n provider : 'init' | 'vlaicu',\n products: {\n [key: string]: {\n [key: `${number}-${number}`]: Partial<{\n extraParameters: {\n key : string,\n value: string\n }[],\n price : number,\n discountedPrice: number,\n buyLink : string\n }>\n }\n },\n useGeoIpPricing: boolean\n}>;\n\nexport type CdpData = {\n auds ?: string,\n [key: string] : string | undefined\n};\n\nexport type CdpDataJson = {\n auds: string[],\n mdl : { key: string, value: string }[],\n ub : unknown[],\n vid : string\n}"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@repobit/dex-target",
3
- "version": "2.9.0",
3
+ "version": "2.10.0",
4
4
  "description": "Client for Adobe Target",
5
5
  "author": "Constantin Ioan Mihai <iconstantin@bitdefender.com>",
6
6
  "homepage": "https://github.com/bitdefender/dex-core#readme",
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "@repobit/dex-constants": "^1.3.0",
31
- "@repobit/dex-data-layer": "^2.0.2"
31
+ "@repobit/dex-data-layer": "^2.1.0"
32
32
  },
33
33
  "module": "dist/src/index.js",
34
34
  "type": "module",
@@ -36,5 +36,5 @@
36
36
  "volta": {
37
37
  "node": "22.14.0"
38
38
  },
39
- "gitHead": "96b9972a8daf95c3fee675368cdf42f529201e33"
39
+ "gitHead": "8ca0efc414789020c41463cbe11cd8ad1dc209c7"
40
40
  }