@blotoutio/edgetag-sdk-browser 1.16.1 → 1.17.1

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.
Files changed (2) hide show
  1. package/index.js +27 -26
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -926,7 +926,7 @@
926
926
  referrer: getReferrer(destination),
927
927
  search: getSearch(destination),
928
928
  locale: getLocale(),
929
- sdkVersion: "1.16.1" ,
929
+ sdkVersion: "1.17.1" ,
930
930
  ...(payload || {}),
931
931
  };
932
932
  let storage = {};
@@ -1072,6 +1072,31 @@
1072
1072
  };
1073
1073
  };
1074
1074
 
1075
+ const processGetData = (destination, keys, callback) => {
1076
+ getRequest(getGetDataURL(destination, keys))
1077
+ .then((result) => {
1078
+ callback((result === null || result === void 0 ? void 0 : result.result) || {});
1079
+ })
1080
+ .catch(logger.error);
1081
+ };
1082
+ const handleGetData = (keys, callback, options) => {
1083
+ if (!keys || keys.length === 0) {
1084
+ logger.error('Provide keys for get data API.');
1085
+ return;
1086
+ }
1087
+ if (options === null || options === void 0 ? void 0 : options.destination) {
1088
+ processGetData(options.destination, keys, callback);
1089
+ return;
1090
+ }
1091
+ const instances = getInstances();
1092
+ if (instances.length > 1) {
1093
+ logger.error('Multiple instances found! Please provide destination.');
1094
+ callback({});
1095
+ return;
1096
+ }
1097
+ processGetData(instances[0], keys, callback);
1098
+ };
1099
+
1075
1100
  const sendTag = (destination, { eventName, eventId, data, providerData, providers, options }) => {
1076
1101
  const payload = {
1077
1102
  eventName,
@@ -1147,6 +1172,7 @@
1147
1172
  eventId,
1148
1173
  data: JSON.parse(JSON.stringify(payload)),
1149
1174
  sendTag: sendTag.bind(null, destination),
1175
+ getEdgeData: processGetData.bind(null, destination),
1150
1176
  manifestVariables: variable.variableSet,
1151
1177
  executionContext,
1152
1178
  destination,
@@ -1187,31 +1213,6 @@
1187
1213
  return false;
1188
1214
  };
1189
1215
 
1190
- const processGetData = (destination, keys, callback) => {
1191
- getRequest(getGetDataURL(destination, keys))
1192
- .then((result) => {
1193
- callback((result === null || result === void 0 ? void 0 : result.result) || {});
1194
- })
1195
- .catch(logger.error);
1196
- };
1197
- const handleGetData = (keys, callback, options) => {
1198
- if (!keys || keys.length === 0) {
1199
- logger.error('Provide keys for get data API.');
1200
- return;
1201
- }
1202
- if (options === null || options === void 0 ? void 0 : options.destination) {
1203
- processGetData(options.destination, keys, callback);
1204
- return;
1205
- }
1206
- const instances = getInstances();
1207
- if (instances.length > 1) {
1208
- logger.error('Multiple instances found! Please provide destination.');
1209
- callback({});
1210
- return;
1211
- }
1212
- processGetData(instances[0], keys, callback);
1213
- };
1214
-
1215
1216
  const processData = (destination, data, providers, options) => {
1216
1217
  saveKV(destination, data);
1217
1218
  const providerPackages = getSetting(destination, 'browserPackages');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blotoutio/edgetag-sdk-browser",
3
- "version": "1.16.1",
3
+ "version": "1.17.1",
4
4
  "description": "Browser SDK for EdgeTag",
5
5
  "author": "Blotout",
6
6
  "license": "MIT",