make-mp-data 1.0.16 → 1.0.17

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 +6 -3
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -269,6 +269,9 @@ async function main(config) {
269
269
  console.log(`importing events to mixpanel...`);
270
270
  const imported = await mp(creds, eventData, {
271
271
  recordType: "event",
272
+ fixData: true,
273
+ fixJson: true,
274
+ strict: false,
272
275
  ...importOpts,
273
276
  });
274
277
  console.log(`\tsent ${comma(imported.success)} events\n`);
@@ -351,7 +354,7 @@ function makeEvent(distinct_id, earliestTime, events, superProps, groupKeys, isF
351
354
  $source: "AKsTimeSoup",
352
355
  };
353
356
 
354
- if (isFirstEvent) event.time = earliestTime;
357
+ if (isFirstEvent) event.time = dayjs.unix(earliestTime).toISOString();
355
358
  if (!isFirstEvent) event.time = AKsTimeSoup(earliestTime, NOW, PEAK_DAYS);
356
359
 
357
360
  const props = { ...chosenEvent.properties, ...superProps };
@@ -449,8 +452,8 @@ function AKsTimeSoup(earliestTime, latestTime = NOW, peakDays = PEAK_DAYS) {
449
452
 
450
453
  // usually, ensure the event time is within business hours
451
454
  if (chance.bool({ likelihood: 42 })) eventTime = Math.min(Math.max(eventTime, businessStart), businessEnd);
452
-
453
- return eventTime;
455
+
456
+ return dayjs.unix(eventTime).toISOString();
454
457
  }
455
458
 
456
459
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "make-mp-data",
3
- "version": "1.0.16",
3
+ "version": "1.0.17",
4
4
  "description": "builds all mixpanel primitives for a given project",
5
5
  "main": "index.js",
6
6
  "types": "types.d.ts",