make-mp-data 3.0.3 → 3.0.5

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 (70) hide show
  1. package/README.md +46 -0
  2. package/dungeons/array-of-object-lookup-schema.json +327 -0
  3. package/dungeons/array-of-object-lookup.js +29 -9
  4. package/dungeons/capstone/capstone-ic3.js +291 -0
  5. package/dungeons/capstone/capstone-ic4.js +598 -0
  6. package/dungeons/capstone/capstone-ic5.js +668 -0
  7. package/dungeons/capstone/generate-product-lookup.js +309 -0
  8. package/dungeons/ecommerce-schema.json +462 -0
  9. package/dungeons/{copilot.js → ecommerce.js} +79 -17
  10. package/dungeons/education-schema.json +2409 -0
  11. package/dungeons/education.js +226 -462
  12. package/dungeons/fintech-schema.json +14034 -0
  13. package/dungeons/fintech.js +134 -413
  14. package/dungeons/foobar-schema.json +403 -0
  15. package/dungeons/foobar.js +27 -4
  16. package/dungeons/food-delivery-schema.json +192 -0
  17. package/dungeons/food-delivery.js +602 -0
  18. package/dungeons/food-schema.json +1152 -0
  19. package/dungeons/food.js +173 -406
  20. package/dungeons/gaming-schema.json +1270 -0
  21. package/dungeons/gaming.js +182 -42
  22. package/dungeons/insurance-application-schema.json +204 -0
  23. package/dungeons/insurance-application.js +605 -0
  24. package/dungeons/media-schema.json +906 -0
  25. package/dungeons/media.js +250 -420
  26. package/dungeons/retention-cadence-schema.json +78 -0
  27. package/dungeons/retention-cadence.js +35 -1
  28. package/dungeons/rpg-schema.json +4526 -0
  29. package/dungeons/rpg.js +171 -429
  30. package/dungeons/sanity-schema.json +255 -0
  31. package/dungeons/sanity.js +21 -10
  32. package/dungeons/sass-schema.json +1291 -0
  33. package/dungeons/sass.js +241 -368
  34. package/dungeons/scd-schema.json +919 -0
  35. package/dungeons/scd.js +41 -13
  36. package/dungeons/simple-schema.json +608 -0
  37. package/dungeons/simple.js +52 -15
  38. package/dungeons/simplest-schema.json +1418 -0
  39. package/dungeons/simplest.js +392 -0
  40. package/dungeons/social-schema.json +1118 -0
  41. package/dungeons/social.js +150 -391
  42. package/dungeons/text-generation-schema.json +3096 -0
  43. package/dungeons/text-generation.js +71 -0
  44. package/index.js +8 -6
  45. package/lib/core/config-validator.js +28 -8
  46. package/lib/core/storage.js +5 -5
  47. package/lib/generators/events.js +4 -4
  48. package/lib/orchestrators/mixpanel-sender.js +16 -13
  49. package/lib/orchestrators/user-loop.js +14 -6
  50. package/lib/templates/soup-presets.js +188 -0
  51. package/lib/utils/utils.js +52 -6
  52. package/package.json +1 -1
  53. package/types.d.ts +20 -3
  54. package/dungeons/adspend.js +0 -130
  55. package/dungeons/anon.js +0 -128
  56. package/dungeons/benchmark-heavy.js +0 -240
  57. package/dungeons/benchmark-light.js +0 -140
  58. package/dungeons/big.js +0 -226
  59. package/dungeons/business.js +0 -391
  60. package/dungeons/complex.js +0 -428
  61. package/dungeons/experiments.js +0 -137
  62. package/dungeons/funnels.js +0 -309
  63. package/dungeons/mil.js +0 -323
  64. package/dungeons/mirror.js +0 -161
  65. package/dungeons/soup-test.js +0 -52
  66. package/dungeons/streaming.js +0 -372
  67. package/dungeons/strict-event-test.js +0 -30
  68. package/dungeons/student-teacher.js +0 -438
  69. package/dungeons/too-big-events.js +0 -203
  70. package/dungeons/user-agent.js +0 -209
@@ -0,0 +1,392 @@
1
+ import Chance from 'chance';
2
+ let chance = new Chance();
3
+ import dayjs from "dayjs";
4
+ import utc from "dayjs/plugin/utc.js";
5
+ dayjs.extend(utc);
6
+ import { uid, comma } from 'ak-tools';
7
+ import { pickAWinner, weighNumRange, date, integer, weighChoices } from "../lib/utils/utils.js";
8
+
9
+ const itemCategories = ["Books", "Movies", "Music", "Games", "Electronics", "Computers", "Smart Home", "Home", "Garden", "Pet", "Beauty", "Health", "Toys", "Kids", "Baby", "Handmade", "Sports", "Outdoors", "Automotive", "Industrial", "Entertainment", "Art", "Food", "Appliances", "Office", "Wedding", "Software"];
10
+
11
+ const videoCategories = ["funny", "educational", "inspirational", "music", "news", "sports", "cooking", "DIY", "travel", "gaming"];
12
+
13
+ /**
14
+ * ═══════════════════════════════════════════════════════════════
15
+ * DATASET OVERVIEW
16
+ * ═══════════════════════════════════════════════════════════════
17
+ *
18
+ * Simplest E-Commerce App — the minimal dungeon with no hooks.
19
+ * - 2,500 users over 100 days, ~250K events
20
+ * - 25 event types covering browse, search, cart, checkout,
21
+ * notifications, reviews, wishlists, rewards
22
+ * - 11 funnels (signup, purchase, content, browse-to-cart, etc.)
23
+ * - No device/location/campaign data — pure event stream
24
+ *
25
+ * ═══════════════════════════════════════════════════════════════
26
+ * ANALYTICS HOOKS
27
+ * ═══════════════════════════════════════════════════════════════
28
+ *
29
+ * None — this is a baseline dungeon with a no-op hook function.
30
+ * Use it for testing core generation, funnel inference, or as a
31
+ * starting template for new dungeons.
32
+ */
33
+
34
+ /** @type {import('../types.js').Dungeon} */
35
+ const config = {
36
+ token: "",
37
+ seed: "simple is best",
38
+ numDays: 100, //how many days worth1 of data
39
+ numEvents: 250_000, //how many events
40
+ numUsers: 2_500, //how many users
41
+ format: 'json', //csv or json
42
+ region: "US",
43
+ hasAnonIds: false, //if true, anonymousIds are created for each user
44
+ hasSessionIds: false, //if true, hasSessionIds are created for each user
45
+ hasAdSpend: false,
46
+ hasLocation: false,
47
+ hasAndroidDevices: false,
48
+ hasIOSDevices: false,
49
+ hasDesktopDevices: false,
50
+ hasBrowser: false,
51
+ hasCampaigns: false,
52
+ isAnonymous: false,
53
+ alsoInferFunnels: false,
54
+ concurrency: 1,
55
+ batchSize: 2_500_000,
56
+ writeToDisk: false,
57
+
58
+ events: [
59
+ {
60
+ event: "page view",
61
+ weight: 10,
62
+ properties: {
63
+ page: pickAWinner(["/", "/", "/help", "/account", "/pricing", "/product", "/about", "/blog"]),
64
+ utm_source: pickAWinner(["$organic", "$organic", "$organic", "$organic", "google", "google", "google", "facebook", "facebook", "twitter", "linkedin"]),
65
+ }
66
+ },
67
+ {
68
+ event: "sign up",
69
+ weight: 1,
70
+ isFirstEvent: true,
71
+ properties: {
72
+ signupMethod: ["email", "google", "facebook", "github"],
73
+ referral: weighChoices(["none", "none", "none", "friend", "ad", "ad", "friend", "friend"]),
74
+ }
75
+ },
76
+ {
77
+ event: "login",
78
+ weight: 8,
79
+ properties: {
80
+ method: ["password", "google", "facebook", "github"],
81
+ }
82
+ },
83
+ {
84
+ event: "search",
85
+ weight: 7,
86
+ properties: {
87
+ query_length: weighNumRange(1, 50),
88
+ resultsReturned: weighNumRange(0, 100, .25),
89
+ category: pickAWinner(itemCategories, integer(0, 27)),
90
+ }
91
+ },
92
+ {
93
+ event: "view item",
94
+ weight: 9,
95
+ properties: {
96
+ isFeaturedItem: [true, false, false],
97
+ itemCategory: pickAWinner(itemCategories, integer(0, 27)),
98
+ price: weighNumRange(5, 500, .25),
99
+ rating: weighNumRange(1, 5),
100
+ }
101
+ },
102
+ {
103
+ event: "add to cart",
104
+ weight: 5,
105
+ properties: {
106
+ amount: weighNumRange(5, 500, .25),
107
+ itemCategory: pickAWinner(itemCategories, integer(0, 27)),
108
+ numItems: weighNumRange(1, 5),
109
+ }
110
+ },
111
+ {
112
+ event: "checkout",
113
+ weight: 3,
114
+ properties: {
115
+ amount: weighNumRange(10, 500, .25),
116
+ currency: ["USD", "CAD", "EUR", "JPY"],
117
+ coupon: weighChoices(["none", "none", "none", "none", "10%OFF", "20%OFF", "30%OFF"]),
118
+ numItems: weighNumRange(1, 10),
119
+ }
120
+ },
121
+ {
122
+ event: "watch video",
123
+ weight: 6,
124
+ properties: {
125
+ videoCategory: pickAWinner(videoCategories, integer(0, 9)),
126
+ watchTimeSec: weighNumRange(10, 600, .25),
127
+ quality: ["1080p", "720p", "480p", "360p"],
128
+ }
129
+ },
130
+ {
131
+ event: "share content",
132
+ weight: 2,
133
+ properties: {
134
+ platform: ["twitter", "facebook", "linkedin", "email", "link"],
135
+ contentType: ["video", "product", "article"],
136
+ }
137
+ },
138
+ {
139
+ event: "rate item",
140
+ weight: 4,
141
+ properties: {
142
+ rating: weighNumRange(1, 5),
143
+ itemCategory: pickAWinner(itemCategories, integer(0, 27)),
144
+ hasReviewText: [true, false, false, false],
145
+ }
146
+ },
147
+ // weight 1 used by sign up (isFirstEvent)
148
+ // weights 1-10 across 26 events; some sharing is unavoidable
149
+ // but no two adjacent events share a weight
150
+ {
151
+ event: "support ticket",
152
+ weight: 2,
153
+ properties: {
154
+ priority: weighChoices(["low", "low", "medium", "medium", "medium", "high"]),
155
+ category: ["billing", "technical", "account", "shipping", "returns"],
156
+ }
157
+ },
158
+ {
159
+ event: "add to wishlist",
160
+ weight: 4,
161
+ properties: {
162
+ itemCategory: pickAWinner(itemCategories, integer(0, 27)),
163
+ price: weighNumRange(5, 500, .25),
164
+ }
165
+ },
166
+ {
167
+ event: "remove from cart",
168
+ weight: 3,
169
+ properties: {
170
+ reason: weighChoices(["changed mind", "too expensive", "found better", "duplicate", "changed mind", "changed mind"]),
171
+ }
172
+ },
173
+ {
174
+ event: "apply coupon",
175
+ weight: 2,
176
+ properties: {
177
+ couponCode: weighChoices(["SAVE10", "SAVE20", "WELCOME", "FREESHIP", "VIP30", "SAVE10", "SAVE10"]),
178
+ discountPercent: weighNumRange(5, 50),
179
+ }
180
+ },
181
+ {
182
+ event: "notification received",
183
+ weight: 7,
184
+ properties: {
185
+ channel: ["push", "email", "in-app", "sms"],
186
+ type: ["promo", "order update", "recommendation", "reminder"],
187
+ }
188
+ },
189
+ {
190
+ event: "notification clicked",
191
+ weight: 5,
192
+ properties: {
193
+ channel: ["push", "email", "in-app", "sms"],
194
+ type: ["promo", "order update", "recommendation", "reminder"],
195
+ }
196
+ },
197
+ {
198
+ event: "add payment method",
199
+ weight: 1,
200
+ properties: {
201
+ type: ["credit card", "debit card", "paypal", "apple pay", "google pay"],
202
+ }
203
+ },
204
+ {
205
+ event: "update profile",
206
+ weight: 3,
207
+ properties: {
208
+ field: ["avatar", "name", "email", "address", "phone", "preferences"],
209
+ }
210
+ },
211
+ {
212
+ event: "invite friend",
213
+ weight: 1,
214
+ properties: {
215
+ method: ["email", "link", "sms"],
216
+ }
217
+ },
218
+ {
219
+ event: "view category",
220
+ weight: 8,
221
+ properties: {
222
+ category: pickAWinner(itemCategories, integer(0, 27)),
223
+ sortBy: ["popular", "newest", "price low", "price high", "rating"],
224
+ }
225
+ },
226
+ {
227
+ event: "save address",
228
+ weight: 1,
229
+ properties: {
230
+ type: ["home", "work", "other"],
231
+ }
232
+ },
233
+ {
234
+ event: "compare items",
235
+ weight: 3,
236
+ properties: {
237
+ numItems: weighNumRange(2, 5),
238
+ itemCategory: pickAWinner(itemCategories, integer(0, 27)),
239
+ }
240
+ },
241
+ {
242
+ event: "subscribe newsletter",
243
+ weight: 1,
244
+ properties: {
245
+ frequency: ["daily", "weekly", "monthly"],
246
+ topics: pickAWinner(["deals", "new arrivals", "recommendations", "deals", "deals"]),
247
+ }
248
+ },
249
+ {
250
+ event: "leave review",
251
+ weight: 2,
252
+ properties: {
253
+ rating: weighNumRange(1, 5),
254
+ wordCount: weighNumRange(10, 200, .25),
255
+ hasPhotos: [true, false, false, false, false],
256
+ }
257
+ },
258
+ {
259
+ event: "redeem reward",
260
+ weight: 1,
261
+ properties: {
262
+ rewardType: ["discount", "free shipping", "free item", "points bonus"],
263
+ pointsUsed: weighNumRange(100, 5000, .25),
264
+ }
265
+ },
266
+
267
+ ],
268
+ funnels: [
269
+ {
270
+ sequence: ["page view", "sign up"],
271
+ conversionRate: 55,
272
+ order: "sequential",
273
+ weight: 5,
274
+ isFirstFunnel: true,
275
+ timeToConvert: 1,
276
+ name: "Signup Funnel"
277
+ },
278
+ {
279
+ sequence: ["search", "view item", "add to cart", "checkout"],
280
+ conversionRate: 35,
281
+ order: "sequential",
282
+ weight: 8,
283
+ timeToConvert: 3,
284
+ name: "Purchase Funnel"
285
+ },
286
+ {
287
+ sequence: ["page view", "watch video", "share content"],
288
+ conversionRate: 40,
289
+ order: "sequential",
290
+ weight: 6,
291
+ timeToConvert: 2,
292
+ name: "Content Engagement"
293
+ },
294
+ {
295
+ sequence: ["view item", "rate item"],
296
+ conversionRate: 25,
297
+ order: "sequential",
298
+ weight: 3,
299
+ timeToConvert: 5,
300
+ name: "Review Funnel"
301
+ },
302
+ {
303
+ sequence: ["view category", "view item", "compare items", "add to cart"],
304
+ conversionRate: 30,
305
+ order: "sequential",
306
+ weight: 7,
307
+ timeToConvert: 3,
308
+ name: "Browse to Cart"
309
+ },
310
+ {
311
+ sequence: ["notification received", "notification clicked", "view item"],
312
+ conversionRate: 45,
313
+ order: "sequential",
314
+ weight: 4,
315
+ timeToConvert: 1,
316
+ name: "Notification Engagement"
317
+ },
318
+ {
319
+ sequence: ["view item", "add to wishlist", "apply coupon", "add to cart", "checkout"],
320
+ conversionRate: 20,
321
+ order: "sequential",
322
+ weight: 2,
323
+ timeToConvert: 7,
324
+ name: "Wishlist to Purchase"
325
+ },
326
+ {
327
+ sequence: ["checkout", "leave review", "invite friend"],
328
+ conversionRate: 15,
329
+ order: "sequential",
330
+ weight: 1,
331
+ timeToConvert: 14,
332
+ name: "Post-Purchase Advocacy"
333
+ },
334
+ {
335
+ sequence: ["login", "view item", "add to cart", "apply coupon", "checkout"],
336
+ conversionRate: 30,
337
+ order: "sequential",
338
+ weight: 9,
339
+ timeToConvert: 2,
340
+ name: "Coupon Purchase Flow"
341
+ },
342
+ {
343
+ sequence: ["subscribe newsletter", "notification received", "notification clicked", "checkout"],
344
+ conversionRate: 10,
345
+ order: "sequential",
346
+ weight: 3,
347
+ timeToConvert: 14,
348
+ name: "Newsletter to Purchase"
349
+ },
350
+ {
351
+ sequence: ["support ticket", "update profile", "checkout"],
352
+ conversionRate: 20,
353
+ order: "sequential",
354
+ weight: 10,
355
+ timeToConvert: 7,
356
+ name: "Support Recovery"
357
+ },
358
+
359
+ ],
360
+ superProps: {
361
+ theme: pickAWinner(["light", "dark", "custom", "light", "dark"]),
362
+ },
363
+ /*
364
+ user properties work the same as event properties
365
+ each key should be an array or function reference
366
+ */
367
+ userProps: {
368
+ title: chance.profession.bind(chance),
369
+ luckyNumber: weighNumRange(42, 420, .3),
370
+ spiritAnimal: pickAWinner(["duck", "dog", "otter", "penguin", "cat", "elephant", "lion", "cheetah", "giraffe", "zebra", "rhino", "hippo", "whale", "dolphin", "shark", "octopus", "squid", "jellyfish", "starfish", "seahorse", "crab", "lobster", "shrimp", "clam", "snail", "slug", "butterfly", "moth", "bee", "wasp", "ant", "beetle", "ladybug", "caterpillar", "centipede", "millipede", "scorpion", "spider", "tarantula", "tick", "mite", "mosquito", "fly", "dragonfly", "damselfly", "grasshopper", "cricket", "locust", "mantis", "cockroach", "termite", "praying mantis", "walking stick", "stick bug", "leaf insect", "lacewing", "aphid", "cicada", "thrips", "psyllid", "scale insect", "whitefly", "mealybug", "planthopper", "leafhopper", "treehopper", "flea", "louse", "bedbug", "flea beetle", "weevil", "longhorn beetle", "leaf beetle", "tiger beetle", "ground beetle", "lady beetle", "firefly", "click beetle", "rove beetle", "scarab beetle", "dung beetle", "stag beetle", "rhinoceros beetle", "hercules beetle", "goliath beetle", "jewel beetle", "tortoise beetle"])
371
+ },
372
+ scdProps: {},
373
+ mirrorProps: {},
374
+
375
+ /*
376
+ for group analytics keys, we need an array of arrays [[],[],[]]
377
+ each pair represents a group_key and the number of profiles for that key
378
+ */
379
+ groupKeys: [],
380
+ groupProps: {},
381
+ lookupTables: [],
382
+ hook: function (record, type, meta) {
383
+
384
+ // no hooks!
385
+ return record;
386
+ }
387
+ };
388
+
389
+
390
+
391
+
392
+ export default config;