@mparticle/web-criteo-kit 2.0.3 → 3.2.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/CriteoEventForwarder.common.js +268 -237
- package/package.json +39 -35
|
@@ -16,303 +16,334 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
16
16
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
17
17
|
// See the License for the specific language governing permissions and
|
|
18
18
|
// limitations under the License.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
19
|
+
var name = 'Criteo',
|
|
20
|
+
moduleId = 1010,
|
|
21
|
+
MessageType = {
|
|
22
|
+
SessionStart: 1,
|
|
23
|
+
SessionEnd: 2,
|
|
24
|
+
PageView: 3,
|
|
25
|
+
PageEvent: 4,
|
|
26
|
+
CrashReport: 5,
|
|
27
|
+
OptOut: 6,
|
|
28
|
+
Commerce: 16,
|
|
29
|
+
},
|
|
30
|
+
// below are custom types for logging page views and setting site types for Criteo
|
|
31
|
+
CRITEO_SITETYPE = 'CRITEO_SITETYPE',
|
|
32
|
+
CRITEO_VIEW_HOMEPAGE = 'CRITEO_VIEW_HOMEPAGE';
|
|
33
|
+
|
|
34
|
+
var constructor = function() {
|
|
35
|
+
var self = this,
|
|
36
|
+
reportingService,
|
|
37
|
+
mpCustomFlags;
|
|
38
|
+
|
|
39
|
+
setDefaultCriteoEvents();
|
|
40
|
+
|
|
41
|
+
self.name = name;
|
|
42
|
+
|
|
43
|
+
function initForwarder(
|
|
44
|
+
forwarderSettings,
|
|
45
|
+
service,
|
|
46
|
+
testMode,
|
|
47
|
+
trackerId,
|
|
48
|
+
userAttributes,
|
|
49
|
+
userIdentities,
|
|
50
|
+
appVersion,
|
|
51
|
+
appName,
|
|
52
|
+
customFlags
|
|
53
|
+
) {
|
|
54
|
+
mpCustomFlags = customFlags;
|
|
55
|
+
if (!testMode) {
|
|
56
|
+
reportingService = service;
|
|
57
|
+
settings = forwarderSettings;
|
|
58
|
+
try {
|
|
59
|
+
var criteoScript = document.createElement('script');
|
|
60
|
+
window.criteo_q = window.criteo_q || [];
|
|
61
|
+
criteoScript.type = 'text/javascript';
|
|
62
|
+
criteoScript.async = true;
|
|
63
|
+
criteoScript.src = 'https://static.criteo.net/js/ld/ld.js';
|
|
64
|
+
(
|
|
65
|
+
document.getElementsByTagName('head')[0] ||
|
|
66
|
+
document.getElementsByTagName('body')[0]
|
|
67
|
+
).appendChild(criteoScript);
|
|
68
|
+
} catch (e) {
|
|
69
|
+
return 'Failed to initialize: ' + e;
|
|
62
70
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
71
|
+
} else {
|
|
72
|
+
// each event needs to be defaulted for tests
|
|
73
|
+
setDefaultCriteoEvents();
|
|
66
74
|
}
|
|
67
75
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
setAccountEvent = { event: 'setAccount' },
|
|
72
|
-
setSiteTypeEvent = { event: 'setSiteType' },
|
|
73
|
-
setEmailEvent = { event: 'setEmail' },
|
|
74
|
-
setCustomerIdEvent = { event: 'setCustomerId' },
|
|
75
|
-
setDataEvent = { event: 'setData' };
|
|
76
|
-
}
|
|
76
|
+
setAccountEvent.account = forwarderSettings.apiKey;
|
|
77
|
+
return 'Criteo successfully loaded';
|
|
78
|
+
}
|
|
77
79
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
// each of the following Criteo Event Types are set and then an
|
|
81
|
+
// array of them are processed in processQueuedCriteoEvent
|
|
82
|
+
function setDefaultCriteoEvents() {
|
|
83
|
+
(setAccountEvent = { event: 'setAccount' }),
|
|
84
|
+
(setSiteTypeEvent = { event: 'setSiteType' }),
|
|
85
|
+
(setEmailEvent = { event: 'setEmail' }),
|
|
86
|
+
(setCustomerIdEvent = { event: 'setCustomerId' }),
|
|
87
|
+
(setDataEvent = { event: 'setData' });
|
|
88
|
+
}
|
|
81
89
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
90
|
+
function processEvent(event) {
|
|
91
|
+
var reportEvent = false;
|
|
92
|
+
var criteoEvent;
|
|
93
|
+
|
|
94
|
+
try {
|
|
95
|
+
if (event.EventDataType === MessageType.Commerce) {
|
|
96
|
+
if (
|
|
97
|
+
event.EventCategory ===
|
|
98
|
+
mParticle.CommerceEventType.ProductAddToCart
|
|
99
|
+
) {
|
|
100
|
+
criteoEvent = createViewBasket(event);
|
|
101
|
+
} else if (
|
|
102
|
+
event.EventCategory ===
|
|
103
|
+
mParticle.CommerceEventType.ProductViewDetail
|
|
104
|
+
) {
|
|
105
|
+
criteoEvent = createViewProduct(event);
|
|
106
|
+
} else if (
|
|
107
|
+
event.EventCategory ===
|
|
108
|
+
mParticle.CommerceEventType.ProductImpression
|
|
109
|
+
) {
|
|
110
|
+
criteoEvent = createViewList(event);
|
|
111
|
+
} else if (
|
|
112
|
+
event.EventCategory ===
|
|
113
|
+
mParticle.CommerceEventType.ProductPurchase
|
|
114
|
+
) {
|
|
115
|
+
criteoEvent = createTrackTransactionEvent(event);
|
|
96
116
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
117
|
+
} else if (event.EventDataType === MessageType.PageView) {
|
|
118
|
+
if (
|
|
119
|
+
event.CustomFlags &&
|
|
120
|
+
event.CustomFlags[CRITEO_VIEW_HOMEPAGE]
|
|
121
|
+
) {
|
|
122
|
+
criteoEvent = { event: 'viewHome' };
|
|
103
123
|
} else {
|
|
104
|
-
return
|
|
124
|
+
return "Error - Criteo home page views are logged via mParticle.logPageView('homepage), no other logPageViews are sent to Criteo";
|
|
105
125
|
}
|
|
126
|
+
} else {
|
|
127
|
+
return (
|
|
128
|
+
'Error - Criteo does not support the event type - ' +
|
|
129
|
+
event.EventDataType
|
|
130
|
+
);
|
|
131
|
+
}
|
|
106
132
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
133
|
+
modifySetSiteTypeEvent();
|
|
134
|
+
modifySetDataEvent(event);
|
|
135
|
+
queueCriteoEvent(criteoEvent);
|
|
110
136
|
|
|
111
|
-
|
|
137
|
+
reportEvent = true;
|
|
112
138
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
catch (e) {
|
|
122
|
-
return 'Failed to send to: ' + name + ' ' + e;
|
|
139
|
+
if (reportEvent === true && reportingService) {
|
|
140
|
+
reportingService(self, event);
|
|
141
|
+
return 'Successfully sent to ' + name;
|
|
142
|
+
} else {
|
|
143
|
+
return (
|
|
144
|
+
'Error logging event or event type not supported - ' +
|
|
145
|
+
reportEvent.error
|
|
146
|
+
);
|
|
123
147
|
}
|
|
148
|
+
} catch (e) {
|
|
149
|
+
return 'Failed to send to: ' + name + ' ' + e;
|
|
124
150
|
}
|
|
151
|
+
}
|
|
125
152
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
}
|
|
153
|
+
function modifySetSiteTypeEvent() {
|
|
154
|
+
if (mpCustomFlags && mpCustomFlags[CRITEO_SITETYPE]) {
|
|
155
|
+
setSiteTypeEvent.type = mpCustomFlags[CRITEO_SITETYPE];
|
|
156
|
+
} else {
|
|
157
|
+
setSiteTypeEvent.type = 'd';
|
|
132
158
|
}
|
|
159
|
+
}
|
|
133
160
|
|
|
134
|
-
|
|
135
|
-
|
|
161
|
+
function modifySetDataEvent(event) {
|
|
162
|
+
var eventAttributes = event.EventAttributes || {};
|
|
136
163
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
}
|
|
164
|
+
if (Object.keys(eventAttributes).length) {
|
|
165
|
+
for (var key in eventAttributes) {
|
|
166
|
+
if (key !== 'siteType') {
|
|
167
|
+
if (eventAttributes.hasOwnProperty(key)) {
|
|
168
|
+
setDataEvent[key] = eventAttributes[key];
|
|
143
169
|
}
|
|
144
170
|
}
|
|
145
171
|
}
|
|
146
172
|
}
|
|
173
|
+
}
|
|
147
174
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
175
|
+
function resetSetDataEventAfterQueuingEvent() {
|
|
176
|
+
setDataEvent = {
|
|
177
|
+
event: 'setData',
|
|
178
|
+
};
|
|
179
|
+
}
|
|
153
180
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
181
|
+
function queueCriteoEvent(criteoEvent) {
|
|
182
|
+
var eventQueue = [setAccountEvent, setSiteTypeEvent];
|
|
183
|
+
if (setEmailEvent.email) {
|
|
184
|
+
eventQueue.push(setEmailEvent);
|
|
185
|
+
}
|
|
186
|
+
if (setCustomerIdEvent.id) {
|
|
187
|
+
eventQueue.push(setCustomerIdEvent);
|
|
188
|
+
}
|
|
162
189
|
|
|
163
|
-
|
|
190
|
+
eventQueue.push(criteoEvent);
|
|
164
191
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
192
|
+
if (Object.keys(setDataEvent).length > 1) {
|
|
193
|
+
eventQueue.push(setDataEvent);
|
|
194
|
+
}
|
|
168
195
|
|
|
169
|
-
|
|
196
|
+
window.criteo_q.push.apply(
|
|
197
|
+
window.criteo_q,
|
|
198
|
+
JSON.parse(JSON.stringify(eventQueue))
|
|
199
|
+
);
|
|
170
200
|
|
|
171
|
-
|
|
172
|
-
|
|
201
|
+
resetSetDataEventAfterQueuingEvent();
|
|
202
|
+
}
|
|
173
203
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
204
|
+
function createViewBasket(event) {
|
|
205
|
+
var criteoEvent = { event: 'viewBasket' },
|
|
206
|
+
items = [];
|
|
177
207
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
});
|
|
208
|
+
event.ProductAction.ProductList.forEach(function(product) {
|
|
209
|
+
items.push({
|
|
210
|
+
id: product.Sku,
|
|
211
|
+
price: product.Price,
|
|
212
|
+
quantity: product.Quantity,
|
|
184
213
|
});
|
|
214
|
+
});
|
|
185
215
|
|
|
186
|
-
|
|
216
|
+
criteoEvent.item = items;
|
|
187
217
|
|
|
188
|
-
|
|
189
|
-
|
|
218
|
+
return criteoEvent;
|
|
219
|
+
}
|
|
190
220
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
221
|
+
function createViewProduct(event) {
|
|
222
|
+
var criteoEvent = { event: 'viewItem' },
|
|
223
|
+
items = [];
|
|
194
224
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
225
|
+
event.ProductAction.ProductList.forEach(function(product) {
|
|
226
|
+
if (product.Sku) {
|
|
227
|
+
items.push(product.Sku);
|
|
228
|
+
}
|
|
229
|
+
});
|
|
200
230
|
|
|
201
|
-
|
|
231
|
+
criteoEvent.item = items;
|
|
202
232
|
|
|
203
|
-
|
|
204
|
-
|
|
233
|
+
return criteoEvent;
|
|
234
|
+
}
|
|
205
235
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
236
|
+
function createViewList(event) {
|
|
237
|
+
var criteoEvent = { event: 'viewList' },
|
|
238
|
+
items = [];
|
|
209
239
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
});
|
|
240
|
+
event.ProductImpressions.forEach(function(impression) {
|
|
241
|
+
impression.ProductList.forEach(function(product) {
|
|
242
|
+
if (product.Sku) {
|
|
243
|
+
items.push(product.Sku);
|
|
244
|
+
}
|
|
216
245
|
});
|
|
246
|
+
});
|
|
217
247
|
|
|
218
|
-
|
|
248
|
+
criteoEvent.item = items;
|
|
219
249
|
|
|
220
|
-
|
|
221
|
-
|
|
250
|
+
return criteoEvent;
|
|
251
|
+
}
|
|
222
252
|
|
|
223
|
-
|
|
224
|
-
|
|
253
|
+
function createTrackTransactionEvent(event) {
|
|
254
|
+
var criteoEvent = { event: 'trackTransaction' };
|
|
225
255
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
256
|
+
if (event.ProductAction.TransactionId) {
|
|
257
|
+
criteoEvent.id = event.ProductAction.TransactionId;
|
|
258
|
+
}
|
|
229
259
|
|
|
230
|
-
|
|
260
|
+
var criteoProductList = [];
|
|
231
261
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
});
|
|
262
|
+
event.ProductAction.ProductList.forEach(function(product) {
|
|
263
|
+
criteoProductList.push({
|
|
264
|
+
id: product.Sku,
|
|
265
|
+
price: parseFloat(product.Price),
|
|
266
|
+
quantity: product.Quantity,
|
|
238
267
|
});
|
|
268
|
+
});
|
|
239
269
|
|
|
240
|
-
|
|
270
|
+
criteoEvent.item = criteoProductList;
|
|
241
271
|
|
|
242
|
-
|
|
243
|
-
|
|
272
|
+
return criteoEvent;
|
|
273
|
+
}
|
|
244
274
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
else {
|
|
254
|
-
return 'Only CustomerID and Email types are available on Criteo';
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
catch (e) {
|
|
258
|
-
return 'Failed to call setUserIdentity on ' + name + ' ' + e;
|
|
275
|
+
function setUserIdentity(id, type) {
|
|
276
|
+
try {
|
|
277
|
+
if (type === window.mParticle.IdentityType.CustomerId) {
|
|
278
|
+
setCustomerIdEvent.id = id;
|
|
279
|
+
} else if (type === window.mParticle.IdentityType.Email) {
|
|
280
|
+
setEmailEvent.email = id.trim().toLowerCase();
|
|
281
|
+
} else {
|
|
282
|
+
return 'Only CustomerID and Email types are available on Criteo';
|
|
259
283
|
}
|
|
284
|
+
} catch (e) {
|
|
285
|
+
return 'Failed to call setUserIdentity on ' + name + ' ' + e;
|
|
260
286
|
}
|
|
261
|
-
|
|
262
|
-
this.init = initForwarder;
|
|
263
|
-
this.process = processEvent;
|
|
264
|
-
this.setUserIdentity = setUserIdentity;
|
|
265
|
-
};
|
|
266
|
-
|
|
267
|
-
function getId() {
|
|
268
|
-
return moduleId;
|
|
269
287
|
}
|
|
270
288
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
289
|
+
this.init = initForwarder;
|
|
290
|
+
this.process = processEvent;
|
|
291
|
+
this.setUserIdentity = setUserIdentity;
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
function getId() {
|
|
295
|
+
return moduleId;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
function isObject(val) {
|
|
299
|
+
return (
|
|
300
|
+
val != null && typeof val === 'object' && Array.isArray(val) === false
|
|
301
|
+
);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
function register(config) {
|
|
305
|
+
if (!config) {
|
|
306
|
+
console.log(
|
|
307
|
+
'You must pass a config object to register the kit ' + name
|
|
276
308
|
);
|
|
309
|
+
return;
|
|
277
310
|
}
|
|
278
311
|
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
if (!isObject(config)) {
|
|
286
|
-
console.log('\'config\' must be an object. You passed in a ' + typeof config);
|
|
287
|
-
return;
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
if (isObject(config.kits)) {
|
|
291
|
-
config.kits[name] = {
|
|
292
|
-
constructor: constructor
|
|
293
|
-
};
|
|
294
|
-
} else {
|
|
295
|
-
config.kits = {};
|
|
296
|
-
config.kits[name] = {
|
|
297
|
-
constructor: constructor
|
|
298
|
-
};
|
|
299
|
-
}
|
|
300
|
-
console.log('Successfully registered ' + name + ' to your mParticle configuration');
|
|
312
|
+
if (!isObject(config)) {
|
|
313
|
+
console.log(
|
|
314
|
+
"'config' must be an object. You passed in a " + typeof config
|
|
315
|
+
);
|
|
316
|
+
return;
|
|
301
317
|
}
|
|
302
318
|
|
|
303
|
-
if (
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
319
|
+
if (isObject(config.kits)) {
|
|
320
|
+
config.kits[name] = {
|
|
321
|
+
constructor: constructor,
|
|
322
|
+
};
|
|
323
|
+
} else {
|
|
324
|
+
config.kits = {};
|
|
325
|
+
config.kits[name] = {
|
|
326
|
+
constructor: constructor,
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
console.log(
|
|
330
|
+
'Successfully registered ' + name + ' to your mParticle configuration'
|
|
331
|
+
);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
if (typeof window !== 'undefined') {
|
|
335
|
+
if (window && window.mParticle && window.mParticle.addForwarder) {
|
|
336
|
+
window.mParticle.addForwarder({
|
|
337
|
+
name: name,
|
|
338
|
+
constructor: constructor,
|
|
339
|
+
getId: getId,
|
|
340
|
+
});
|
|
311
341
|
}
|
|
342
|
+
}
|
|
312
343
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
344
|
+
var CriteoEventForwarder = {
|
|
345
|
+
register: register,
|
|
346
|
+
};
|
|
316
347
|
var CriteoEventForwarder_1 = CriteoEventForwarder.register;
|
|
317
348
|
|
|
318
349
|
exports.default = CriteoEventForwarder;
|
package/package.json
CHANGED
|
@@ -1,37 +1,41 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
2
|
+
"name": "@mparticle/web-criteo-kit",
|
|
3
|
+
"version": "3.2.0",
|
|
4
|
+
"author": "mParticle Developers <developers@mparticle.com> (https://www.mparticle.com)",
|
|
5
|
+
"description": "mParticle integration sdk for Criteo",
|
|
6
|
+
"browser": "dist/CriteoEventForwarder.common.js",
|
|
7
|
+
"main": "dist/CriteoEventForwarder.common.js",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist/CriteoEventForwarder.common.js"
|
|
10
|
+
],
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/mParticle/mparticle-web-sdk",
|
|
14
|
+
"directory": "kits/criteo"
|
|
15
|
+
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "rollup --config rollup.config.js",
|
|
18
|
+
"watch": "rollup --config rollup.config.js -w",
|
|
19
|
+
"build:test": "rollup --config rollup.test.config.js",
|
|
20
|
+
"test": "npm run build && npm run build:test && DEBUG=false karma start test/karma.config.js",
|
|
21
|
+
"test:debug": "npm run build && npm run build:test && DEBUG=true karma start test/karma.config.js"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@mparticle/web-sdk": "^3.0.0",
|
|
25
|
+
"@semantic-release/changelog": "^5.0.1",
|
|
26
|
+
"@semantic-release/exec": "^5.0.0",
|
|
27
|
+
"@semantic-release/git": "^9.0.0",
|
|
28
|
+
"chai": "^4.2.0",
|
|
29
|
+
"karma": "^5.1.0",
|
|
30
|
+
"karma-chai": "^0.1.0",
|
|
31
|
+
"karma-chrome-launcher": "^3.1.0",
|
|
32
|
+
"karma-firefox-launcher": "^1.3.0",
|
|
33
|
+
"karma-mocha": "^2.0.1",
|
|
34
|
+
"mocha": "^2.3.2",
|
|
35
|
+
"rollup": "^1.13.1",
|
|
36
|
+
"rollup-plugin-commonjs": "^10.0.0",
|
|
37
|
+
"rollup-plugin-node-resolve": "^5.0.1",
|
|
38
|
+
"should": "^7.1.0"
|
|
39
|
+
},
|
|
40
|
+
"license": "Apache-2.0"
|
|
37
41
|
}
|