@depict-ai/dpc 2.6.25 → 2.6.26
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/ES10/index.cjs +14 -1
- package/ES10/index.d.ts +8 -2
- package/ES10/index.js +15 -2
- package/dist/index.cjs +14 -1
- package/dist/index.d.ts +8 -2
- package/dist/index.js +15 -2
- package/latest/index.cjs +14 -1
- package/latest/index.d.ts +8 -2
- package/latest/index.js +15 -2
- package/package.json +9 -5
package/ES10/index.cjs
CHANGED
|
@@ -17,7 +17,7 @@ function $parcel$interopDefault(a) {
|
|
|
17
17
|
$parcel$export(module.exports, "DPC", () => $89ae37e3a26189b4$export$820526014323765f);
|
|
18
18
|
$parcel$export(module.exports, "version", () => $fcc8287091fb489d$export$83d89fbfd8236492);
|
|
19
19
|
/*! Depict PerformanceClient */
|
|
20
|
-
const $fcc8287091fb489d$export$83d89fbfd8236492 = "2.6.
|
|
20
|
+
const $fcc8287091fb489d$export$83d89fbfd8236492 = "2.6.26";
|
|
21
21
|
let $405164bc961cc106$export$8ae64f3d447c14f7;
|
|
22
22
|
(function (ProductCardType) {
|
|
23
23
|
ProductCardType[ProductCardType["Recommendation"] = 0] = "Recommendation";
|
|
@@ -329,6 +329,18 @@ class $89ae37e3a26189b4$export$820526014323765f {
|
|
|
329
329
|
price: item.price,
|
|
330
330
|
quantity: item.quantity
|
|
331
331
|
}));
|
|
332
|
+
if ($9AWcE$depictaiutilishared.get_event_api() === "v4") {
|
|
333
|
+
const event = $9AWcE$depictaiutilishared.native_purchase_event({
|
|
334
|
+
event_id: $9AWcE$depictaiutilishared.random_string(),
|
|
335
|
+
market: this.market,
|
|
336
|
+
session_id: session_id,
|
|
337
|
+
transaction_id: data.transaction_id,
|
|
338
|
+
currency: data.currency,
|
|
339
|
+
items: items
|
|
340
|
+
}, new Date().toISOString());
|
|
341
|
+
// A purchase the contract can't take (a bad currency, say) still goes to v3 below.
|
|
342
|
+
if (event && $9AWcE$depictaiutilishared.queue_native_events(this.merchant, [event]) !== false) return;
|
|
343
|
+
}
|
|
332
344
|
const request = {
|
|
333
345
|
events: [{
|
|
334
346
|
event_type: "purchase",
|
|
@@ -426,6 +438,7 @@ function $89ae37e3a26189b4$var$_resetSentPageViewForCurrentHref2() {
|
|
|
426
438
|
function $89ae37e3a26189b4$var$_parseOptions2(options) {
|
|
427
439
|
if (options !== undefined) {
|
|
428
440
|
if (options.transport !== undefined) $9AWcE$depictaiutilishared.set_event_transport(options.transport);
|
|
441
|
+
if (options.api !== undefined) $9AWcE$depictaiutilishared.set_event_api(options.api);
|
|
429
442
|
if (options.auto_observe !== undefined) this.auto_observe = options.auto_observe;
|
|
430
443
|
if (options.market !== undefined) this.market = options.market;
|
|
431
444
|
}
|
package/ES10/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EventTransport } from "@depict-ai/utilishared/ES10";
|
|
2
|
-
export const version = "2.6.
|
|
1
|
+
import { EventTransport, EventApi } from "@depict-ai/utilishared/ES10";
|
|
2
|
+
export const version = "2.6.26";
|
|
3
3
|
enum ProductCardType {
|
|
4
4
|
Recommendation = 0,
|
|
5
5
|
SnakeRecommendation = 1,
|
|
@@ -56,6 +56,12 @@ type EventName = "purchase" | "addToCart" | "setMarket" | "setProductId" | "setS
|
|
|
56
56
|
interface Options {
|
|
57
57
|
/** Configure shared SDK tracking before sending events. Defaults to http; both enables the canary socket. */
|
|
58
58
|
transport?: EventTransport;
|
|
59
|
+
/**
|
|
60
|
+
* Which Depict API receives events: `"v3"` (the default) posts them to `/create-events`; `"v4"` posts every event the
|
|
61
|
+
* native V4 events contract can carry, purchases included, to `/v4/{merchant}/events`, and leaves the rest on v3.
|
|
62
|
+
* A `@depict-ai/ui` SDK created with `api: "v4"` sets this too when it shares this client's `@depict-ai/utilishared`.
|
|
63
|
+
*/
|
|
64
|
+
api?: EventApi;
|
|
59
65
|
/**
|
|
60
66
|
* The initial market. Should be specified if the market is known at the point of intializing DPC.
|
|
61
67
|
*/
|
package/ES10/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { add_to_version_info as $4uUHR$add_to_version_info, dlog as $4uUHR$dlog, impression_track_element as $4uUHR$impression_track_element, derror as $4uUHR$derror, depict_click as $4uUHR$depict_click, foolproof_send_beacon as $4uUHR$foolproof_send_beacon, base_url as $4uUHR$base_url, observer as $4uUHR$observer, instant_exec_on_suspect_history_change as $4uUHR$instant_exec_on_suspect_history_change, catchify as $4uUHR$catchify, set_event_transport as $4uUHR$set_event_transport, get_session_id as $4uUHR$get_session_id, get_tracking_event_context_data as $4uUHR$get_tracking_event_context_data, send_depict_unfiltered as $4uUHR$send_depict_unfiltered } from "@depict-ai/utilishared/ES10";
|
|
1
|
+
import { add_to_version_info as $4uUHR$add_to_version_info, dlog as $4uUHR$dlog, impression_track_element as $4uUHR$impression_track_element, derror as $4uUHR$derror, depict_click as $4uUHR$depict_click, get_event_api as $4uUHR$get_event_api, native_purchase_event as $4uUHR$native_purchase_event, random_string as $4uUHR$random_string, queue_native_events as $4uUHR$queue_native_events, foolproof_send_beacon as $4uUHR$foolproof_send_beacon, base_url as $4uUHR$base_url, observer as $4uUHR$observer, instant_exec_on_suspect_history_change as $4uUHR$instant_exec_on_suspect_history_change, catchify as $4uUHR$catchify, set_event_transport as $4uUHR$set_event_transport, set_event_api as $4uUHR$set_event_api, get_session_id as $4uUHR$get_session_id, get_tracking_event_context_data as $4uUHR$get_tracking_event_context_data, send_depict_unfiltered as $4uUHR$send_depict_unfiltered } from "@depict-ai/utilishared/ES10";
|
|
2
2
|
import $4uUHR$babelruntimehelpersdefineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import $4uUHR$babelruntimehelpersclassPrivateFieldGet from "@babel/runtime/helpers/classPrivateFieldGet";
|
|
4
4
|
import $4uUHR$babelruntimehelpersclassPrivateFieldSet from "@babel/runtime/helpers/classPrivateFieldSet";
|
|
@@ -6,7 +6,7 @@ import $4uUHR$babelruntimehelpersclassPrivateFieldSet from "@babel/runtime/helpe
|
|
|
6
6
|
/*! Depict PerformanceClient */
|
|
7
7
|
import { register_es_version } from "../multi_import_deduplicator.mjs";
|
|
8
8
|
register_es_version("performance-client", "ES10");
|
|
9
|
-
const $3242b911de3d57ad$export$83d89fbfd8236492 = "2.6.
|
|
9
|
+
const $3242b911de3d57ad$export$83d89fbfd8236492 = "2.6.26";
|
|
10
10
|
let $983195e3c4979825$export$8ae64f3d447c14f7;
|
|
11
11
|
(function (ProductCardType) {
|
|
12
12
|
ProductCardType[ProductCardType["Recommendation"] = 0] = "Recommendation";
|
|
@@ -318,6 +318,18 @@ class $53af71a3700e1e90$export$820526014323765f {
|
|
|
318
318
|
price: item.price,
|
|
319
319
|
quantity: item.quantity
|
|
320
320
|
}));
|
|
321
|
+
if ($4uUHR$get_event_api() === "v4") {
|
|
322
|
+
const event = $4uUHR$native_purchase_event({
|
|
323
|
+
event_id: $4uUHR$random_string(),
|
|
324
|
+
market: this.market,
|
|
325
|
+
session_id: session_id,
|
|
326
|
+
transaction_id: data.transaction_id,
|
|
327
|
+
currency: data.currency,
|
|
328
|
+
items: items
|
|
329
|
+
}, new Date().toISOString());
|
|
330
|
+
// A purchase the contract can't take (a bad currency, say) still goes to v3 below.
|
|
331
|
+
if (event && $4uUHR$queue_native_events(this.merchant, [event]) !== false) return;
|
|
332
|
+
}
|
|
321
333
|
const request = {
|
|
322
334
|
events: [{
|
|
323
335
|
event_type: "purchase",
|
|
@@ -415,6 +427,7 @@ function $53af71a3700e1e90$var$_resetSentPageViewForCurrentHref2() {
|
|
|
415
427
|
function $53af71a3700e1e90$var$_parseOptions2(options) {
|
|
416
428
|
if (options !== undefined) {
|
|
417
429
|
if (options.transport !== undefined) $4uUHR$set_event_transport(options.transport);
|
|
430
|
+
if (options.api !== undefined) $4uUHR$set_event_api(options.api);
|
|
418
431
|
if (options.auto_observe !== undefined) this.auto_observe = options.auto_observe;
|
|
419
432
|
if (options.market !== undefined) this.market = options.market;
|
|
420
433
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -17,7 +17,7 @@ function $parcel$interopDefault(a) {
|
|
|
17
17
|
$parcel$export(module.exports, "DPC", () => $89ae37e3a26189b4$export$820526014323765f);
|
|
18
18
|
$parcel$export(module.exports, "version", () => $fcc8287091fb489d$export$83d89fbfd8236492);
|
|
19
19
|
/*! Depict PerformanceClient */
|
|
20
|
-
const $fcc8287091fb489d$export$83d89fbfd8236492 = "2.6.
|
|
20
|
+
const $fcc8287091fb489d$export$83d89fbfd8236492 = "2.6.26";
|
|
21
21
|
let $405164bc961cc106$export$8ae64f3d447c14f7;
|
|
22
22
|
(function (ProductCardType) {
|
|
23
23
|
ProductCardType[ProductCardType["Recommendation"] = 0] = "Recommendation";
|
|
@@ -329,6 +329,18 @@ class $89ae37e3a26189b4$export$820526014323765f {
|
|
|
329
329
|
price: item.price,
|
|
330
330
|
quantity: item.quantity
|
|
331
331
|
}));
|
|
332
|
+
if ($9AWcE$depictaiutilishared.get_event_api() === "v4") {
|
|
333
|
+
const event = $9AWcE$depictaiutilishared.native_purchase_event({
|
|
334
|
+
event_id: $9AWcE$depictaiutilishared.random_string(),
|
|
335
|
+
market: this.market,
|
|
336
|
+
session_id: session_id,
|
|
337
|
+
transaction_id: data.transaction_id,
|
|
338
|
+
currency: data.currency,
|
|
339
|
+
items: items
|
|
340
|
+
}, new Date().toISOString());
|
|
341
|
+
// A purchase the contract can't take (a bad currency, say) still goes to v3 below.
|
|
342
|
+
if (event && $9AWcE$depictaiutilishared.queue_native_events(this.merchant, [event]) !== false) return;
|
|
343
|
+
}
|
|
332
344
|
const request = {
|
|
333
345
|
events: [{
|
|
334
346
|
event_type: "purchase",
|
|
@@ -426,6 +438,7 @@ function $89ae37e3a26189b4$var$_resetSentPageViewForCurrentHref2() {
|
|
|
426
438
|
function $89ae37e3a26189b4$var$_parseOptions2(options) {
|
|
427
439
|
if (options !== undefined) {
|
|
428
440
|
if (options.transport !== undefined) $9AWcE$depictaiutilishared.set_event_transport(options.transport);
|
|
441
|
+
if (options.api !== undefined) $9AWcE$depictaiutilishared.set_event_api(options.api);
|
|
429
442
|
if (options.auto_observe !== undefined) this.auto_observe = options.auto_observe;
|
|
430
443
|
if (options.market !== undefined) this.market = options.market;
|
|
431
444
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EventTransport } from "@depict-ai/utilishared/ES10";
|
|
2
|
-
export const version = "2.6.
|
|
1
|
+
import { EventTransport, EventApi } from "@depict-ai/utilishared/ES10";
|
|
2
|
+
export const version = "2.6.26";
|
|
3
3
|
enum ProductCardType {
|
|
4
4
|
Recommendation = 0,
|
|
5
5
|
SnakeRecommendation = 1,
|
|
@@ -56,6 +56,12 @@ type EventName = "purchase" | "addToCart" | "setMarket" | "setProductId" | "setS
|
|
|
56
56
|
interface Options {
|
|
57
57
|
/** Configure shared SDK tracking before sending events. Defaults to http; both enables the canary socket. */
|
|
58
58
|
transport?: EventTransport;
|
|
59
|
+
/**
|
|
60
|
+
* Which Depict API receives events: `"v3"` (the default) posts them to `/create-events`; `"v4"` posts every event the
|
|
61
|
+
* native V4 events contract can carry, purchases included, to `/v4/{merchant}/events`, and leaves the rest on v3.
|
|
62
|
+
* A `@depict-ai/ui` SDK created with `api: "v4"` sets this too when it shares this client's `@depict-ai/utilishared`.
|
|
63
|
+
*/
|
|
64
|
+
api?: EventApi;
|
|
59
65
|
/**
|
|
60
66
|
* The initial market. Should be specified if the market is known at the point of intializing DPC.
|
|
61
67
|
*/
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { add_to_version_info as $4uUHR$add_to_version_info, dlog as $4uUHR$dlog, impression_track_element as $4uUHR$impression_track_element, derror as $4uUHR$derror, depict_click as $4uUHR$depict_click, foolproof_send_beacon as $4uUHR$foolproof_send_beacon, base_url as $4uUHR$base_url, observer as $4uUHR$observer, instant_exec_on_suspect_history_change as $4uUHR$instant_exec_on_suspect_history_change, catchify as $4uUHR$catchify, set_event_transport as $4uUHR$set_event_transport, get_session_id as $4uUHR$get_session_id, get_tracking_event_context_data as $4uUHR$get_tracking_event_context_data, send_depict_unfiltered as $4uUHR$send_depict_unfiltered } from "@depict-ai/utilishared/ES10";
|
|
1
|
+
import { add_to_version_info as $4uUHR$add_to_version_info, dlog as $4uUHR$dlog, impression_track_element as $4uUHR$impression_track_element, derror as $4uUHR$derror, depict_click as $4uUHR$depict_click, get_event_api as $4uUHR$get_event_api, native_purchase_event as $4uUHR$native_purchase_event, random_string as $4uUHR$random_string, queue_native_events as $4uUHR$queue_native_events, foolproof_send_beacon as $4uUHR$foolproof_send_beacon, base_url as $4uUHR$base_url, observer as $4uUHR$observer, instant_exec_on_suspect_history_change as $4uUHR$instant_exec_on_suspect_history_change, catchify as $4uUHR$catchify, set_event_transport as $4uUHR$set_event_transport, set_event_api as $4uUHR$set_event_api, get_session_id as $4uUHR$get_session_id, get_tracking_event_context_data as $4uUHR$get_tracking_event_context_data, send_depict_unfiltered as $4uUHR$send_depict_unfiltered } from "@depict-ai/utilishared/ES10";
|
|
2
2
|
import $4uUHR$babelruntimehelpersdefineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import $4uUHR$babelruntimehelpersclassPrivateFieldGet from "@babel/runtime/helpers/classPrivateFieldGet";
|
|
4
4
|
import $4uUHR$babelruntimehelpersclassPrivateFieldSet from "@babel/runtime/helpers/classPrivateFieldSet";
|
|
@@ -6,7 +6,7 @@ import $4uUHR$babelruntimehelpersclassPrivateFieldSet from "@babel/runtime/helpe
|
|
|
6
6
|
/*! Depict PerformanceClient */
|
|
7
7
|
import { register_es_version } from "../multi_import_deduplicator.mjs";
|
|
8
8
|
register_es_version("performance-client", "ES10");
|
|
9
|
-
const $3242b911de3d57ad$export$83d89fbfd8236492 = "2.6.
|
|
9
|
+
const $3242b911de3d57ad$export$83d89fbfd8236492 = "2.6.26";
|
|
10
10
|
let $983195e3c4979825$export$8ae64f3d447c14f7;
|
|
11
11
|
(function (ProductCardType) {
|
|
12
12
|
ProductCardType[ProductCardType["Recommendation"] = 0] = "Recommendation";
|
|
@@ -318,6 +318,18 @@ class $53af71a3700e1e90$export$820526014323765f {
|
|
|
318
318
|
price: item.price,
|
|
319
319
|
quantity: item.quantity
|
|
320
320
|
}));
|
|
321
|
+
if ($4uUHR$get_event_api() === "v4") {
|
|
322
|
+
const event = $4uUHR$native_purchase_event({
|
|
323
|
+
event_id: $4uUHR$random_string(),
|
|
324
|
+
market: this.market,
|
|
325
|
+
session_id: session_id,
|
|
326
|
+
transaction_id: data.transaction_id,
|
|
327
|
+
currency: data.currency,
|
|
328
|
+
items: items
|
|
329
|
+
}, new Date().toISOString());
|
|
330
|
+
// A purchase the contract can't take (a bad currency, say) still goes to v3 below.
|
|
331
|
+
if (event && $4uUHR$queue_native_events(this.merchant, [event]) !== false) return;
|
|
332
|
+
}
|
|
321
333
|
const request = {
|
|
322
334
|
events: [{
|
|
323
335
|
event_type: "purchase",
|
|
@@ -415,6 +427,7 @@ function $53af71a3700e1e90$var$_resetSentPageViewForCurrentHref2() {
|
|
|
415
427
|
function $53af71a3700e1e90$var$_parseOptions2(options) {
|
|
416
428
|
if (options !== undefined) {
|
|
417
429
|
if (options.transport !== undefined) $4uUHR$set_event_transport(options.transport);
|
|
430
|
+
if (options.api !== undefined) $4uUHR$set_event_api(options.api);
|
|
418
431
|
if (options.auto_observe !== undefined) this.auto_observe = options.auto_observe;
|
|
419
432
|
if (options.market !== undefined) this.market = options.market;
|
|
420
433
|
}
|
package/latest/index.cjs
CHANGED
|
@@ -11,7 +11,7 @@ function $parcel$export(e, n, v, s) {
|
|
|
11
11
|
$parcel$export(module.exports, "DPC", () => $15e3eebad2263636$export$820526014323765f);
|
|
12
12
|
$parcel$export(module.exports, "version", () => $9c6b4a5c4c4f318d$export$83d89fbfd8236492);
|
|
13
13
|
/*! Depict PerformanceClient */
|
|
14
|
-
const $9c6b4a5c4c4f318d$export$83d89fbfd8236492 = "2.6.
|
|
14
|
+
const $9c6b4a5c4c4f318d$export$83d89fbfd8236492 = "2.6.26";
|
|
15
15
|
let $02e69dba644a2ef8$export$8ae64f3d447c14f7;
|
|
16
16
|
(function (ProductCardType) {
|
|
17
17
|
ProductCardType[ProductCardType["Recommendation"] = 0] = "Recommendation";
|
|
@@ -150,6 +150,7 @@ class $15e3eebad2263636$export$820526014323765f {
|
|
|
150
150
|
#parseOptions(options) {
|
|
151
151
|
if (options !== undefined) {
|
|
152
152
|
if (options.transport !== undefined) $dwOGf$depictaiutilishared.set_event_transport(options.transport);
|
|
153
|
+
if (options.api !== undefined) $dwOGf$depictaiutilishared.set_event_api(options.api);
|
|
153
154
|
if (options.auto_observe !== undefined) this.auto_observe = options.auto_observe;
|
|
154
155
|
if (options.market !== undefined) this.market = options.market;
|
|
155
156
|
}
|
|
@@ -326,6 +327,18 @@ class $15e3eebad2263636$export$820526014323765f {
|
|
|
326
327
|
price: item.price,
|
|
327
328
|
quantity: item.quantity
|
|
328
329
|
}));
|
|
330
|
+
if ($dwOGf$depictaiutilishared.get_event_api() === "v4") {
|
|
331
|
+
const event = $dwOGf$depictaiutilishared.native_purchase_event({
|
|
332
|
+
event_id: $dwOGf$depictaiutilishared.random_string(),
|
|
333
|
+
market: this.market,
|
|
334
|
+
session_id: session_id,
|
|
335
|
+
transaction_id: data.transaction_id,
|
|
336
|
+
currency: data.currency,
|
|
337
|
+
items: items
|
|
338
|
+
}, new Date().toISOString());
|
|
339
|
+
// A purchase the contract can't take (a bad currency, say) still goes to v3 below.
|
|
340
|
+
if (event && $dwOGf$depictaiutilishared.queue_native_events(this.merchant, [event]) !== false) return;
|
|
341
|
+
}
|
|
329
342
|
const request = {
|
|
330
343
|
events: [{
|
|
331
344
|
event_type: "purchase",
|
package/latest/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EventTransport } from "@depict-ai/utilishared/latest";
|
|
2
|
-
export const version = "2.6.
|
|
1
|
+
import { EventTransport, EventApi } from "@depict-ai/utilishared/latest";
|
|
2
|
+
export const version = "2.6.26";
|
|
3
3
|
enum ProductCardType {
|
|
4
4
|
Recommendation = 0,
|
|
5
5
|
SnakeRecommendation = 1,
|
|
@@ -56,6 +56,12 @@ type EventName = "purchase" | "addToCart" | "setMarket" | "setProductId" | "setS
|
|
|
56
56
|
interface Options {
|
|
57
57
|
/** Configure shared SDK tracking before sending events. Defaults to http; both enables the canary socket. */
|
|
58
58
|
transport?: EventTransport;
|
|
59
|
+
/**
|
|
60
|
+
* Which Depict API receives events: `"v3"` (the default) posts them to `/create-events`; `"v4"` posts every event the
|
|
61
|
+
* native V4 events contract can carry, purchases included, to `/v4/{merchant}/events`, and leaves the rest on v3.
|
|
62
|
+
* A `@depict-ai/ui` SDK created with `api: "v4"` sets this too when it shares this client's `@depict-ai/utilishared`.
|
|
63
|
+
*/
|
|
64
|
+
api?: EventApi;
|
|
59
65
|
/**
|
|
60
66
|
* The initial market. Should be specified if the market is known at the point of intializing DPC.
|
|
61
67
|
*/
|
package/latest/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { add_to_version_info as $lbGMC$add_to_version_info, dlog as $lbGMC$dlog, instant_exec_on_suspect_history_change as $lbGMC$instant_exec_on_suspect_history_change, catchify as $lbGMC$catchify, set_event_transport as $lbGMC$set_event_transport, get_session_id as $lbGMC$get_session_id, get_tracking_event_context_data as $lbGMC$get_tracking_event_context_data, impression_track_element as $lbGMC$impression_track_element, derror as $lbGMC$derror, send_depict_unfiltered as $lbGMC$send_depict_unfiltered, depict_click as $lbGMC$depict_click, foolproof_send_beacon as $lbGMC$foolproof_send_beacon, base_url as $lbGMC$base_url, observer as $lbGMC$observer } from "@depict-ai/utilishared/latest";
|
|
1
|
+
import { add_to_version_info as $lbGMC$add_to_version_info, dlog as $lbGMC$dlog, instant_exec_on_suspect_history_change as $lbGMC$instant_exec_on_suspect_history_change, catchify as $lbGMC$catchify, set_event_transport as $lbGMC$set_event_transport, set_event_api as $lbGMC$set_event_api, get_session_id as $lbGMC$get_session_id, get_tracking_event_context_data as $lbGMC$get_tracking_event_context_data, impression_track_element as $lbGMC$impression_track_element, derror as $lbGMC$derror, send_depict_unfiltered as $lbGMC$send_depict_unfiltered, depict_click as $lbGMC$depict_click, get_event_api as $lbGMC$get_event_api, native_purchase_event as $lbGMC$native_purchase_event, random_string as $lbGMC$random_string, queue_native_events as $lbGMC$queue_native_events, foolproof_send_beacon as $lbGMC$foolproof_send_beacon, base_url as $lbGMC$base_url, observer as $lbGMC$observer } from "@depict-ai/utilishared/latest";
|
|
2
2
|
|
|
3
3
|
/*! Depict PerformanceClient */
|
|
4
4
|
import { register_es_version } from "../multi_import_deduplicator.mjs";
|
|
5
5
|
register_es_version("performance-client", "latest");
|
|
6
|
-
const $3b068891cefe570d$export$83d89fbfd8236492 = "2.6.
|
|
6
|
+
const $3b068891cefe570d$export$83d89fbfd8236492 = "2.6.26";
|
|
7
7
|
let $ba8dc1a552d27224$export$8ae64f3d447c14f7;
|
|
8
8
|
(function (ProductCardType) {
|
|
9
9
|
ProductCardType[ProductCardType["Recommendation"] = 0] = "Recommendation";
|
|
@@ -142,6 +142,7 @@ class $fe563348936ab010$export$820526014323765f {
|
|
|
142
142
|
#parseOptions(options) {
|
|
143
143
|
if (options !== undefined) {
|
|
144
144
|
if (options.transport !== undefined) $lbGMC$set_event_transport(options.transport);
|
|
145
|
+
if (options.api !== undefined) $lbGMC$set_event_api(options.api);
|
|
145
146
|
if (options.auto_observe !== undefined) this.auto_observe = options.auto_observe;
|
|
146
147
|
if (options.market !== undefined) this.market = options.market;
|
|
147
148
|
}
|
|
@@ -318,6 +319,18 @@ class $fe563348936ab010$export$820526014323765f {
|
|
|
318
319
|
price: item.price,
|
|
319
320
|
quantity: item.quantity
|
|
320
321
|
}));
|
|
322
|
+
if ($lbGMC$get_event_api() === "v4") {
|
|
323
|
+
const event = $lbGMC$native_purchase_event({
|
|
324
|
+
event_id: $lbGMC$random_string(),
|
|
325
|
+
market: this.market,
|
|
326
|
+
session_id: session_id,
|
|
327
|
+
transaction_id: data.transaction_id,
|
|
328
|
+
currency: data.currency,
|
|
329
|
+
items: items
|
|
330
|
+
}, new Date().toISOString());
|
|
331
|
+
// A purchase the contract can't take (a bad currency, say) still goes to v3 below.
|
|
332
|
+
if (event && $lbGMC$queue_native_events(this.merchant, [event]) !== false) return;
|
|
333
|
+
}
|
|
321
334
|
const request = {
|
|
322
335
|
events: [{
|
|
323
336
|
event_type: "purchase",
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"url": "git+https://github.com/depict-org/depict-ui.git",
|
|
6
6
|
"directory": "browser-tags-v2/packages/performance-client"
|
|
7
7
|
},
|
|
8
|
-
"version": "2.6.
|
|
8
|
+
"version": "2.6.26",
|
|
9
9
|
"packageManager": "yarn@3.2.2",
|
|
10
10
|
"source": "./src/index.ts",
|
|
11
11
|
"types": "ES10/index.d.ts",
|
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
"build": "./scripts/build",
|
|
21
21
|
"publish": "yarn build && yarn npm publish",
|
|
22
22
|
"print-included-package-files": "yarn pack --dry-run",
|
|
23
|
-
"typecheck": "yarn g:tsc --build tsconfig.json"
|
|
23
|
+
"typecheck": "yarn g:tsc --build tsconfig.json",
|
|
24
|
+
"test": "jest"
|
|
24
25
|
},
|
|
25
26
|
"targets": {
|
|
26
27
|
"module_latest": {
|
|
@@ -90,15 +91,18 @@
|
|
|
90
91
|
"devDependencies": {
|
|
91
92
|
"@babel/core": "latest",
|
|
92
93
|
"@parcel/resolver-default": "^2.10.3",
|
|
94
|
+
"@types/jest": "^29.2.5",
|
|
93
95
|
"@types/node": "^18.11.10",
|
|
94
|
-
"
|
|
96
|
+
"jest": "^29.3.1",
|
|
97
|
+
"parcel": "^2.10.3",
|
|
98
|
+
"ts-jest": "^29.0.3"
|
|
95
99
|
},
|
|
96
100
|
"dependencies": {
|
|
97
101
|
"@babel/plugin-transform-typescript": "^7.22.9",
|
|
98
102
|
"@babel/runtime": "^7.22.6",
|
|
99
103
|
"@babel/runtime-corejs3": "^7.22.6",
|
|
100
|
-
"@depict-ai/types": "^5.6.
|
|
101
|
-
"@depict-ai/utilishared": "^2.6.
|
|
104
|
+
"@depict-ai/types": "^5.6.22",
|
|
105
|
+
"@depict-ai/utilishared": "^2.6.22"
|
|
102
106
|
},
|
|
103
107
|
"main": "ES10/index.cjs",
|
|
104
108
|
"module": "ES10/index.js"
|