make-mp-data 1.5.55 → 1.5.56
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/.vscode/launch.json +16 -2
- package/index.js +12 -2
- package/log.json +705 -94
- package/package.json +9 -2
- package/types.d.ts +8 -7
- package/dungeons/adspend.js +0 -96
- package/dungeons/anon.js +0 -104
- package/dungeons/big.js +0 -224
- package/dungeons/business.js +0 -327
- package/dungeons/complex.js +0 -396
- package/dungeons/foobar.js +0 -241
- package/dungeons/funnels.js +0 -220
- package/dungeons/gaming-experiments.js +0 -323
- package/dungeons/gaming.js +0 -314
- package/dungeons/governance.js +0 -288
- package/dungeons/mirror.js +0 -129
- package/dungeons/sanity.js +0 -118
- package/dungeons/scd.js +0 -205
- package/dungeons/session-replay.js +0 -175
- package/dungeons/simple.js +0 -150
- package/dungeons/userAgent.js +0 -190
package/.vscode/launch.json
CHANGED
|
@@ -13,11 +13,25 @@
|
|
|
13
13
|
{
|
|
14
14
|
"type": "node",
|
|
15
15
|
"request": "launch",
|
|
16
|
-
"name": "run dungeon",
|
|
16
|
+
"name": "run dungeon (debug)",
|
|
17
17
|
"runtimeExecutable": "nodemon",
|
|
18
18
|
"runtimeArgs": ["--inspect", "--ignore", "./data"],
|
|
19
19
|
"program": "${workspaceFolder}/index.js",
|
|
20
|
-
"args": ["
|
|
20
|
+
"args": ["${file}"],
|
|
21
|
+
"restart": true,
|
|
22
|
+
"console": "integratedTerminal",
|
|
23
|
+
"internalConsoleOptions": "neverOpen",
|
|
24
|
+
"skipFiles": ["<node_internals>/**"],
|
|
25
|
+
"preLaunchTask": "npm: prune",
|
|
26
|
+
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"type": "node",
|
|
30
|
+
"request": "launch",
|
|
31
|
+
"name": "run dungeon (one shot)",
|
|
32
|
+
"runtimeExecutable": "node",
|
|
33
|
+
"program": "${workspaceFolder}/index.js",
|
|
34
|
+
"args": ["${file}"],
|
|
21
35
|
"restart": true,
|
|
22
36
|
"console": "integratedTerminal",
|
|
23
37
|
"internalConsoleOptions": "neverOpen",
|
package/index.js
CHANGED
|
@@ -346,7 +346,7 @@ async function main(config) {
|
|
|
346
346
|
jobTimer.stop(false);
|
|
347
347
|
const { start, end, delta, human } = jobTimer.report(false);
|
|
348
348
|
|
|
349
|
-
if (process.env.NODE_ENV === 'dev')
|
|
349
|
+
// if (process.env.NODE_ENV === 'dev')debugger;
|
|
350
350
|
return {
|
|
351
351
|
...STORAGE,
|
|
352
352
|
importResults,
|
|
@@ -700,6 +700,8 @@ async function makeFunnel(funnel, user, firstEventTime, profile, scd, config) {
|
|
|
700
700
|
if (!user) throw new Error("no user");
|
|
701
701
|
if (!profile) profile = {};
|
|
702
702
|
if (!scd) scd = {};
|
|
703
|
+
const sessionStartEvents = config?.events?.filter(a => a.isSessionStartEvent) || [];
|
|
704
|
+
|
|
703
705
|
|
|
704
706
|
const chance = u.getChance();
|
|
705
707
|
const { hook = async (a) => a } = config;
|
|
@@ -839,6 +841,15 @@ async function makeFunnel(funnel, user, firstEventTime, profile, scd, config) {
|
|
|
839
841
|
|
|
840
842
|
const earliestTime = firstEventTime || dayjs(created).unix();
|
|
841
843
|
let funnelStartTime;
|
|
844
|
+
|
|
845
|
+
|
|
846
|
+
if (sessionStartEvents.length) {
|
|
847
|
+
const sessionStartEvent = chance.pickone(sessionStartEvents);
|
|
848
|
+
sessionStartEvent.relativeTimeMs = -15000;
|
|
849
|
+
funnelActualEventsWithOffset.push(sessionStartEvent);
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
|
|
842
853
|
let finalEvents = await Promise.all(funnelActualEventsWithOffset
|
|
843
854
|
.map(async (event, index) => {
|
|
844
855
|
const newEvent = await makeEvent(distinct_id, earliestTime, event, anonymousIds, sessionIds, {}, groupKeys);
|
|
@@ -858,7 +869,6 @@ async function makeFunnel(funnel, user, firstEventTime, profile, scd, config) {
|
|
|
858
869
|
}
|
|
859
870
|
}));
|
|
860
871
|
|
|
861
|
-
|
|
862
872
|
await hook(finalEvents, "funnel-post", { user, profile, scd, funnel, config });
|
|
863
873
|
return [finalEvents, doesUserConvert];
|
|
864
874
|
}
|