@blotoutio/providers-app-lovin-sdk 1.3.0 → 1.5.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 +40 -7
- package/index.js +40 -7
- package/index.mjs +40 -7
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -45,6 +45,38 @@ const init = ({ manifest }) => {
|
|
|
45
45
|
window['axon']('init');
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
+
const canLog = () => {
|
|
49
|
+
try {
|
|
50
|
+
return localStorage.getItem('edgeTagDebug') === '1';
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
const prefix = `[EdgeTag]`;
|
|
57
|
+
const logger = {
|
|
58
|
+
log: (...args) => {
|
|
59
|
+
if (canLog()) {
|
|
60
|
+
console.log(prefix, ...args);
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
error: (...args) => {
|
|
64
|
+
if (canLog()) {
|
|
65
|
+
console.error(prefix, ...args);
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
info: (...args) => {
|
|
69
|
+
if (canLog()) {
|
|
70
|
+
console.info(prefix, ...args);
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
trace: (...args) => {
|
|
74
|
+
if (canLog()) {
|
|
75
|
+
console.trace(prefix, ...args);
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
|
|
48
80
|
const getItems = (contents) => contents.map((item) => {
|
|
49
81
|
return {
|
|
50
82
|
item_id: item.id,
|
|
@@ -153,23 +185,24 @@ const getEventData = (eventName, userId, data) => {
|
|
|
153
185
|
},
|
|
154
186
|
};
|
|
155
187
|
}
|
|
156
|
-
default: {
|
|
157
|
-
throw new Error(`Event: ${eventName} is not supported.`);
|
|
158
|
-
}
|
|
159
188
|
}
|
|
160
189
|
};
|
|
161
190
|
|
|
162
191
|
const tag = ({ data, eventName, manifestVariables, userId }) => {
|
|
163
192
|
const payload = {
|
|
164
|
-
sdkVersion: "1.
|
|
193
|
+
sdkVersion: "1.5.0" ,
|
|
165
194
|
};
|
|
166
195
|
if (window.axon && manifestVariables['enableBrowser'] === '1') {
|
|
167
196
|
try {
|
|
168
|
-
const
|
|
169
|
-
|
|
197
|
+
const event = getEventData(eventName, userId, data);
|
|
198
|
+
if (!event) {
|
|
199
|
+
logger.log(`[${packageName}] ${eventName} not supported`);
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
window.axon('track', event.name, event.data);
|
|
170
203
|
}
|
|
171
204
|
catch (e) {
|
|
172
|
-
|
|
205
|
+
logger.error(e);
|
|
173
206
|
}
|
|
174
207
|
}
|
|
175
208
|
return payload;
|
package/index.js
CHANGED
|
@@ -46,6 +46,38 @@ var ProvidersAppLovinSdk = (function () {
|
|
|
46
46
|
window['axon']('init');
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
+
const canLog = () => {
|
|
50
|
+
try {
|
|
51
|
+
return localStorage.getItem('edgeTagDebug') === '1';
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
const prefix = `[EdgeTag]`;
|
|
58
|
+
const logger = {
|
|
59
|
+
log: (...args) => {
|
|
60
|
+
if (canLog()) {
|
|
61
|
+
console.log(prefix, ...args);
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
error: (...args) => {
|
|
65
|
+
if (canLog()) {
|
|
66
|
+
console.error(prefix, ...args);
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
info: (...args) => {
|
|
70
|
+
if (canLog()) {
|
|
71
|
+
console.info(prefix, ...args);
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
trace: (...args) => {
|
|
75
|
+
if (canLog()) {
|
|
76
|
+
console.trace(prefix, ...args);
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
|
|
49
81
|
const getItems = (contents) => contents.map((item) => {
|
|
50
82
|
return {
|
|
51
83
|
item_id: item.id,
|
|
@@ -154,23 +186,24 @@ var ProvidersAppLovinSdk = (function () {
|
|
|
154
186
|
},
|
|
155
187
|
};
|
|
156
188
|
}
|
|
157
|
-
default: {
|
|
158
|
-
throw new Error(`Event: ${eventName} is not supported.`);
|
|
159
|
-
}
|
|
160
189
|
}
|
|
161
190
|
};
|
|
162
191
|
|
|
163
192
|
const tag = ({ data, eventName, manifestVariables, userId }) => {
|
|
164
193
|
const payload = {
|
|
165
|
-
sdkVersion: "1.
|
|
194
|
+
sdkVersion: "1.5.0" ,
|
|
166
195
|
};
|
|
167
196
|
if (window.axon && manifestVariables['enableBrowser'] === '1') {
|
|
168
197
|
try {
|
|
169
|
-
const
|
|
170
|
-
|
|
198
|
+
const event = getEventData(eventName, userId, data);
|
|
199
|
+
if (!event) {
|
|
200
|
+
logger.log(`[${packageName}] ${eventName} not supported`);
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
window.axon('track', event.name, event.data);
|
|
171
204
|
}
|
|
172
205
|
catch (e) {
|
|
173
|
-
|
|
206
|
+
logger.error(e);
|
|
174
207
|
}
|
|
175
208
|
}
|
|
176
209
|
return payload;
|
package/index.mjs
CHANGED
|
@@ -43,6 +43,38 @@ const init = ({ manifest }) => {
|
|
|
43
43
|
window['axon']('init');
|
|
44
44
|
};
|
|
45
45
|
|
|
46
|
+
const canLog = () => {
|
|
47
|
+
try {
|
|
48
|
+
return localStorage.getItem('edgeTagDebug') === '1';
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
const prefix = `[EdgeTag]`;
|
|
55
|
+
const logger = {
|
|
56
|
+
log: (...args) => {
|
|
57
|
+
if (canLog()) {
|
|
58
|
+
console.log(prefix, ...args);
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
error: (...args) => {
|
|
62
|
+
if (canLog()) {
|
|
63
|
+
console.error(prefix, ...args);
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
info: (...args) => {
|
|
67
|
+
if (canLog()) {
|
|
68
|
+
console.info(prefix, ...args);
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
trace: (...args) => {
|
|
72
|
+
if (canLog()) {
|
|
73
|
+
console.trace(prefix, ...args);
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
|
|
46
78
|
const getItems = (contents) => contents.map((item) => {
|
|
47
79
|
return {
|
|
48
80
|
item_id: item.id,
|
|
@@ -151,23 +183,24 @@ const getEventData = (eventName, userId, data) => {
|
|
|
151
183
|
},
|
|
152
184
|
};
|
|
153
185
|
}
|
|
154
|
-
default: {
|
|
155
|
-
throw new Error(`Event: ${eventName} is not supported.`);
|
|
156
|
-
}
|
|
157
186
|
}
|
|
158
187
|
};
|
|
159
188
|
|
|
160
189
|
const tag = ({ data, eventName, manifestVariables, userId }) => {
|
|
161
190
|
const payload = {
|
|
162
|
-
sdkVersion: "1.
|
|
191
|
+
sdkVersion: "1.5.0" ,
|
|
163
192
|
};
|
|
164
193
|
if (window.axon && manifestVariables['enableBrowser'] === '1') {
|
|
165
194
|
try {
|
|
166
|
-
const
|
|
167
|
-
|
|
195
|
+
const event = getEventData(eventName, userId, data);
|
|
196
|
+
if (!event) {
|
|
197
|
+
logger.log(`[${packageName}] ${eventName} not supported`);
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
window.axon('track', event.name, event.data);
|
|
168
201
|
}
|
|
169
202
|
catch (e) {
|
|
170
|
-
|
|
203
|
+
logger.error(e);
|
|
171
204
|
}
|
|
172
205
|
}
|
|
173
206
|
return payload;
|