@aranova/tracking-react 0.20.2 → 0.21.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/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +23 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +23 -18
- package/dist/index.mjs.map +1 -1
- package/dist/{sales-DrH6dY5F.d.mts → sales-CBQJ2SBT.d.mts} +21 -19
- package/dist/{sales-DrH6dY5F.d.ts → sales-CBQJ2SBT.d.ts} +21 -19
- package/dist/sales.d.mts +1 -1
- package/dist/sales.d.ts +1 -1
- package/dist/sales.js +22 -17
- package/dist/sales.js.map +1 -1
- package/dist/sales.mjs +22 -17
- package/dist/sales.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -967,6 +967,21 @@ function automaticThresholdMet(goal, eventType, metadata) {
|
|
|
967
967
|
}
|
|
968
968
|
}
|
|
969
969
|
|
|
970
|
+
// ../tracking-core/src/resources/intl/date.ts
|
|
971
|
+
function formatDateInTz(iso, timeZone, opts, locale) {
|
|
972
|
+
const date = new Date(iso);
|
|
973
|
+
if (Number.isNaN(date.getTime())) return iso;
|
|
974
|
+
return new Intl.DateTimeFormat(locale, {
|
|
975
|
+
year: "numeric",
|
|
976
|
+
month: "short",
|
|
977
|
+
day: "2-digit",
|
|
978
|
+
hour: "2-digit",
|
|
979
|
+
minute: "2-digit",
|
|
980
|
+
...opts,
|
|
981
|
+
timeZone
|
|
982
|
+
}).format(date);
|
|
983
|
+
}
|
|
984
|
+
|
|
970
985
|
// ../tracking-core/src/resources/sales/money.ts
|
|
971
986
|
var MINOR_UNIT_EXPONENT = {
|
|
972
987
|
USD: 2,
|
|
@@ -986,19 +1001,6 @@ function formatMoney(cents, currency, locale) {
|
|
|
986
1001
|
fromMinor(cents, currency)
|
|
987
1002
|
);
|
|
988
1003
|
}
|
|
989
|
-
function formatDateInTz(iso, timeZone, opts, locale) {
|
|
990
|
-
const date = new Date(iso);
|
|
991
|
-
if (Number.isNaN(date.getTime())) return iso;
|
|
992
|
-
return new Intl.DateTimeFormat(locale, {
|
|
993
|
-
year: "numeric",
|
|
994
|
-
month: "short",
|
|
995
|
-
day: "2-digit",
|
|
996
|
-
hour: "2-digit",
|
|
997
|
-
minute: "2-digit",
|
|
998
|
-
...opts,
|
|
999
|
-
timeZone
|
|
1000
|
-
}).format(date);
|
|
1001
|
-
}
|
|
1002
1004
|
|
|
1003
1005
|
// ../tracking-core/src/resources/tracking-config-runtime.ts
|
|
1004
1006
|
var CACHE_PREFIX2 = "_aranova_cfg_runtime_";
|
|
@@ -2874,7 +2876,7 @@ function attachPhoneClickCapture(client, config) {
|
|
|
2874
2876
|
};
|
|
2875
2877
|
}
|
|
2876
2878
|
|
|
2877
|
-
// ../tracking-core/src/resources/
|
|
2879
|
+
// ../tracking-core/src/resources/http/errors.ts
|
|
2878
2880
|
var AranovaApiError = class extends Error {
|
|
2879
2881
|
constructor(message, options) {
|
|
2880
2882
|
super(message);
|
|
@@ -2885,7 +2887,7 @@ var AranovaApiError = class extends Error {
|
|
|
2885
2887
|
}
|
|
2886
2888
|
};
|
|
2887
2889
|
|
|
2888
|
-
// ../tracking-core/src/resources/
|
|
2890
|
+
// ../tracking-core/src/resources/http/request.ts
|
|
2889
2891
|
function identityHeaders(config) {
|
|
2890
2892
|
const headers = { [API_KEY_HEADER]: config.apiKey };
|
|
2891
2893
|
if (config.sdkVersion) headers[SDK_VERSION_HEADER] = config.sdkVersion;
|
|
@@ -2897,8 +2899,8 @@ function identityHeaders(config) {
|
|
|
2897
2899
|
function joinUrl(endpoint, path) {
|
|
2898
2900
|
return `${endpoint.replace(/\/$/, "")}${path}`;
|
|
2899
2901
|
}
|
|
2900
|
-
async function
|
|
2901
|
-
const headers = identityHeaders(config);
|
|
2902
|
+
async function apiRequest(config, method, path, body, extraHeaders) {
|
|
2903
|
+
const headers = { ...identityHeaders(config), ...extraHeaders };
|
|
2902
2904
|
if (body !== void 0) headers["Content-Type"] = "application/json";
|
|
2903
2905
|
const response = await fetch(joinUrl(config.endpoint, path), {
|
|
2904
2906
|
method,
|
|
@@ -2927,6 +2929,9 @@ async function salesRequest(config, method, path, body) {
|
|
|
2927
2929
|
return await response.json();
|
|
2928
2930
|
}
|
|
2929
2931
|
|
|
2932
|
+
// ../tracking-core/src/resources/sales/transport.ts
|
|
2933
|
+
var salesRequest = apiRequest;
|
|
2934
|
+
|
|
2930
2935
|
// ../tracking-core/src/resources/sales/client.ts
|
|
2931
2936
|
function fireRecordedConversions(firing, input, recorded, sale, currency) {
|
|
2932
2937
|
if (!firing) return;
|
|
@@ -3555,7 +3560,7 @@ function GoogleAdsTracking(props) {
|
|
|
3555
3560
|
import { createContext as createContext2, useContext as useContext2, useEffect as useEffect5, useMemo as useMemo4 } from "react";
|
|
3556
3561
|
|
|
3557
3562
|
// package.json
|
|
3558
|
-
var version = "0.
|
|
3563
|
+
var version = "0.21.0";
|
|
3559
3564
|
|
|
3560
3565
|
// ../tracking-core/src/phone-react.tsx
|
|
3561
3566
|
import {
|