@blotoutio/edgetag-sdk-js 1.16.0 → 1.17.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/index.cjs.js +27 -26
- package/index.mjs +27 -26
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -925,7 +925,7 @@ const getStandardPayload = (destination, payload) => {
|
|
|
925
925
|
referrer: getReferrer(destination),
|
|
926
926
|
search: getSearch(destination),
|
|
927
927
|
locale: getLocale(),
|
|
928
|
-
sdkVersion: "1.
|
|
928
|
+
sdkVersion: "1.17.0" ,
|
|
929
929
|
...(payload || {}),
|
|
930
930
|
};
|
|
931
931
|
let storage = {};
|
|
@@ -1071,6 +1071,31 @@ const preparePayloadWithConversion = (payloadData, currencySettings) => {
|
|
|
1071
1071
|
};
|
|
1072
1072
|
};
|
|
1073
1073
|
|
|
1074
|
+
const processGetData = (destination, keys, callback) => {
|
|
1075
|
+
getRequest(getGetDataURL(destination, keys))
|
|
1076
|
+
.then((result) => {
|
|
1077
|
+
callback((result === null || result === void 0 ? void 0 : result.result) || {});
|
|
1078
|
+
})
|
|
1079
|
+
.catch(logger.error);
|
|
1080
|
+
};
|
|
1081
|
+
const handleGetData = (keys, callback, options) => {
|
|
1082
|
+
if (!keys || keys.length === 0) {
|
|
1083
|
+
logger.error('Provide keys for get data API.');
|
|
1084
|
+
return;
|
|
1085
|
+
}
|
|
1086
|
+
if (options === null || options === void 0 ? void 0 : options.destination) {
|
|
1087
|
+
processGetData(options.destination, keys, callback);
|
|
1088
|
+
return;
|
|
1089
|
+
}
|
|
1090
|
+
const instances = getInstances();
|
|
1091
|
+
if (instances.length > 1) {
|
|
1092
|
+
logger.error('Multiple instances found! Please provide destination.');
|
|
1093
|
+
callback({});
|
|
1094
|
+
return;
|
|
1095
|
+
}
|
|
1096
|
+
processGetData(instances[0], keys, callback);
|
|
1097
|
+
};
|
|
1098
|
+
|
|
1074
1099
|
const sendTag = (destination, { eventName, eventId, data, providerData, providers, options }) => {
|
|
1075
1100
|
const payload = {
|
|
1076
1101
|
eventName,
|
|
@@ -1146,6 +1171,7 @@ const processTag = (destination, eventName, data = {}, providers, options) => {
|
|
|
1146
1171
|
eventId,
|
|
1147
1172
|
data: JSON.parse(JSON.stringify(payload)),
|
|
1148
1173
|
sendTag: sendTag.bind(null, destination),
|
|
1174
|
+
getEdgeData: processGetData.bind(null, destination),
|
|
1149
1175
|
manifestVariables: variable.variableSet,
|
|
1150
1176
|
executionContext,
|
|
1151
1177
|
destination,
|
|
@@ -1186,31 +1212,6 @@ const hasAllowedManifestTags = (tags, consent, providersConfig) => {
|
|
|
1186
1212
|
return false;
|
|
1187
1213
|
};
|
|
1188
1214
|
|
|
1189
|
-
const processGetData = (destination, keys, callback) => {
|
|
1190
|
-
getRequest(getGetDataURL(destination, keys))
|
|
1191
|
-
.then((result) => {
|
|
1192
|
-
callback((result === null || result === void 0 ? void 0 : result.result) || {});
|
|
1193
|
-
})
|
|
1194
|
-
.catch(logger.error);
|
|
1195
|
-
};
|
|
1196
|
-
const handleGetData = (keys, callback, options) => {
|
|
1197
|
-
if (!keys || keys.length === 0) {
|
|
1198
|
-
logger.error('Provide keys for get data API.');
|
|
1199
|
-
return;
|
|
1200
|
-
}
|
|
1201
|
-
if (options === null || options === void 0 ? void 0 : options.destination) {
|
|
1202
|
-
processGetData(options.destination, keys, callback);
|
|
1203
|
-
return;
|
|
1204
|
-
}
|
|
1205
|
-
const instances = getInstances();
|
|
1206
|
-
if (instances.length > 1) {
|
|
1207
|
-
logger.error('Multiple instances found! Please provide destination.');
|
|
1208
|
-
callback({});
|
|
1209
|
-
return;
|
|
1210
|
-
}
|
|
1211
|
-
processGetData(instances[0], keys, callback);
|
|
1212
|
-
};
|
|
1213
|
-
|
|
1214
1215
|
const processData = (destination, data, providers, options) => {
|
|
1215
1216
|
saveKV(destination, data);
|
|
1216
1217
|
const providerPackages = getSetting(destination, 'browserPackages');
|
package/index.mjs
CHANGED
|
@@ -923,7 +923,7 @@ const getStandardPayload = (destination, payload) => {
|
|
|
923
923
|
referrer: getReferrer(destination),
|
|
924
924
|
search: getSearch(destination),
|
|
925
925
|
locale: getLocale(),
|
|
926
|
-
sdkVersion: "1.
|
|
926
|
+
sdkVersion: "1.17.0" ,
|
|
927
927
|
...(payload || {}),
|
|
928
928
|
};
|
|
929
929
|
let storage = {};
|
|
@@ -1069,6 +1069,31 @@ const preparePayloadWithConversion = (payloadData, currencySettings) => {
|
|
|
1069
1069
|
};
|
|
1070
1070
|
};
|
|
1071
1071
|
|
|
1072
|
+
const processGetData = (destination, keys, callback) => {
|
|
1073
|
+
getRequest(getGetDataURL(destination, keys))
|
|
1074
|
+
.then((result) => {
|
|
1075
|
+
callback((result === null || result === void 0 ? void 0 : result.result) || {});
|
|
1076
|
+
})
|
|
1077
|
+
.catch(logger.error);
|
|
1078
|
+
};
|
|
1079
|
+
const handleGetData = (keys, callback, options) => {
|
|
1080
|
+
if (!keys || keys.length === 0) {
|
|
1081
|
+
logger.error('Provide keys for get data API.');
|
|
1082
|
+
return;
|
|
1083
|
+
}
|
|
1084
|
+
if (options === null || options === void 0 ? void 0 : options.destination) {
|
|
1085
|
+
processGetData(options.destination, keys, callback);
|
|
1086
|
+
return;
|
|
1087
|
+
}
|
|
1088
|
+
const instances = getInstances();
|
|
1089
|
+
if (instances.length > 1) {
|
|
1090
|
+
logger.error('Multiple instances found! Please provide destination.');
|
|
1091
|
+
callback({});
|
|
1092
|
+
return;
|
|
1093
|
+
}
|
|
1094
|
+
processGetData(instances[0], keys, callback);
|
|
1095
|
+
};
|
|
1096
|
+
|
|
1072
1097
|
const sendTag = (destination, { eventName, eventId, data, providerData, providers, options }) => {
|
|
1073
1098
|
const payload = {
|
|
1074
1099
|
eventName,
|
|
@@ -1144,6 +1169,7 @@ const processTag = (destination, eventName, data = {}, providers, options) => {
|
|
|
1144
1169
|
eventId,
|
|
1145
1170
|
data: JSON.parse(JSON.stringify(payload)),
|
|
1146
1171
|
sendTag: sendTag.bind(null, destination),
|
|
1172
|
+
getEdgeData: processGetData.bind(null, destination),
|
|
1147
1173
|
manifestVariables: variable.variableSet,
|
|
1148
1174
|
executionContext,
|
|
1149
1175
|
destination,
|
|
@@ -1184,31 +1210,6 @@ const hasAllowedManifestTags = (tags, consent, providersConfig) => {
|
|
|
1184
1210
|
return false;
|
|
1185
1211
|
};
|
|
1186
1212
|
|
|
1187
|
-
const processGetData = (destination, keys, callback) => {
|
|
1188
|
-
getRequest(getGetDataURL(destination, keys))
|
|
1189
|
-
.then((result) => {
|
|
1190
|
-
callback((result === null || result === void 0 ? void 0 : result.result) || {});
|
|
1191
|
-
})
|
|
1192
|
-
.catch(logger.error);
|
|
1193
|
-
};
|
|
1194
|
-
const handleGetData = (keys, callback, options) => {
|
|
1195
|
-
if (!keys || keys.length === 0) {
|
|
1196
|
-
logger.error('Provide keys for get data API.');
|
|
1197
|
-
return;
|
|
1198
|
-
}
|
|
1199
|
-
if (options === null || options === void 0 ? void 0 : options.destination) {
|
|
1200
|
-
processGetData(options.destination, keys, callback);
|
|
1201
|
-
return;
|
|
1202
|
-
}
|
|
1203
|
-
const instances = getInstances();
|
|
1204
|
-
if (instances.length > 1) {
|
|
1205
|
-
logger.error('Multiple instances found! Please provide destination.');
|
|
1206
|
-
callback({});
|
|
1207
|
-
return;
|
|
1208
|
-
}
|
|
1209
|
-
processGetData(instances[0], keys, callback);
|
|
1210
|
-
};
|
|
1211
|
-
|
|
1212
1213
|
const processData = (destination, data, providers, options) => {
|
|
1213
1214
|
saveKV(destination, data);
|
|
1214
1215
|
const providerPackages = getSetting(destination, 'browserPackages');
|