make-mp-data 3.0.4 → 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 +28 -8
  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} +77 -15
  10. package/dungeons/education-schema.json +2409 -0
  11. package/dungeons/education.js +206 -442
  12. package/dungeons/fintech-schema.json +14034 -0
  13. package/dungeons/fintech.js +110 -389
  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 +150 -383
  20. package/dungeons/gaming-schema.json +1270 -0
  21. package/dungeons/gaming.js +143 -3
  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 +221 -391
  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 +130 -388
  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 +210 -337
  34. package/dungeons/scd-schema.json +919 -0
  35. package/dungeons/scd.js +38 -10
  36. package/dungeons/simple-schema.json +608 -0
  37. package/dungeons/simple.js +48 -11
  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 +124 -365
  42. package/dungeons/text-generation-schema.json +3096 -0
  43. package/dungeons/text-generation.js +71 -0
  44. package/index.js +6 -3
  45. package/lib/core/config-validator.js +18 -0
  46. package/lib/core/storage.js +5 -5
  47. package/lib/generators/events.js +4 -4
  48. package/lib/orchestrators/mixpanel-sender.js +12 -7
  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 -117
  55. package/dungeons/anon.js +0 -128
  56. package/dungeons/benchmark-heavy.js +0 -240
  57. package/dungeons/benchmark-light.js +0 -126
  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 -160
  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
package/README.md CHANGED
@@ -87,6 +87,52 @@ Here's a breakdown of the CLI options you can use with `make-mp-data`:
87
87
  - `--complex`: create a complex set models including groups, SCD, and lookup tables.
88
88
  - `--simple`: create a simple dataset including events, and users
89
89
 
90
+ ## ⏱️ TimeSoup — Realistic Time Distributions
91
+
92
+ TimeSoup controls how events are distributed across time. Out of the box, it produces realistic day-of-week and hour-of-day patterns derived from real Mixpanel data (weekday-heavy, Saturday valley, morning peak).
93
+
94
+ ### Presets
95
+
96
+ Use a preset string for quick configuration:
97
+
98
+ ```javascript
99
+ const config = {
100
+ soup: "growth", // default — gradual uptrend with weekly cycle
101
+ // ...
102
+ };
103
+ ```
104
+
105
+ | Preset | Pattern | Use Case |
106
+ |--------|---------|----------|
107
+ | `"steady"` | Flat, minimal variation | Enterprise B2B, utility apps |
108
+ | `"growth"` | Gradual uptrend + weekly cycle | General purpose (default) |
109
+ | `"spiky"` | Dramatic peaks and valleys | Gaming, social media, viral products |
110
+ | `"seasonal"` | 3-4 major waves | E-commerce, education |
111
+ | `"global"` | Flat DOW + flat HOD | Global SaaS, infrastructure tools |
112
+ | `"churny"` | Flat, no growth trend | Declining products (pair with churn hooks) |
113
+ | `"chaotic"` | Wild variation | Anomaly detection, incident response |
114
+
115
+ ### Custom Configuration
116
+
117
+ Override specific parameters or use a preset as a base:
118
+
119
+ ```javascript
120
+ // Preset + overrides
121
+ soup: { preset: "spiky", deviation: 5 }
122
+
123
+ // Fully custom
124
+ soup: {
125
+ peaks: 200,
126
+ deviation: 2,
127
+ mean: 0,
128
+ dayOfWeekWeights: [0.637, 1.0, 0.999, 0.998, 0.966, 0.802, 0.528], // [Sun..Sat]
129
+ hourOfDayWeights: [/* 24 values, index 0 = midnight UTC */],
130
+ }
131
+
132
+ // Disable cyclical patterns entirely
133
+ soup: { dayOfWeekWeights: null, hourOfDayWeights: null }
134
+ ```
135
+
90
136
  ## 🎯 Hooks — Engineering Trends in Data
91
137
 
92
138
  Hooks let you engineer deliberate, discoverable patterns into your generated data — things like "premium users convert 2x better" or "there was a service outage during days 40-47." A hook is a single transform function on your dungeon config:
@@ -0,0 +1,327 @@
1
+ {
2
+ "schema": {
3
+ "seed": "test array of objects lookup",
4
+ "name": "array-of-object-lookup",
5
+ "numDays": 60,
6
+ "numEvents": 100000,
7
+ "numUsers": 1000,
8
+ "format": "json",
9
+ "region": "US",
10
+ "hasAnonIds": true,
11
+ "hasSessionIds": true,
12
+ "hasAdSpend": false,
13
+ "hasLocation": true,
14
+ "hasAndroidDevices": false,
15
+ "hasIOSDevices": false,
16
+ "hasDesktopDevices": true,
17
+ "hasBrowser": true,
18
+ "hasCampaigns": false,
19
+ "isAnonymous": false,
20
+ "alsoInferFunnels": true,
21
+ "concurrency": 1,
22
+ "batchSize": 250000,
23
+ "writeToDisk": false,
24
+ "events": [
25
+ {
26
+ "event": "checkout",
27
+ "weight": 2,
28
+ "properties": {
29
+ "currency": [
30
+ "USD",
31
+ "CAD",
32
+ "EUR",
33
+ "BTC",
34
+ "ETH",
35
+ "JPY"
36
+ ],
37
+ "coupon": {
38
+ "functionName": "arrow",
39
+ "body": "function generateWeightedArray() {\n\t\tconst weightedArray = [];\n\n\t\t// Add each value to the array the number of times specified by its weight\n\t\tweightedItems.forEach(({ value, weight }) => {\n\t\t\tif (!weight) weight = 1;\n\t\t\tfor (let i = 0; i < weight; i++) {\n\t\t\t\tweightedArray.push(value);\n\t\t\t}\n\t\t});\n\n\t\treturn weightedArray;\n\t}"
40
+ },
41
+ "cart": {
42
+ "functionName": "arrow",
43
+ "body": "function () {\n\t\tconst categories = [\"electronics\", \"books\", \"clothing\", \"home\", \"garden\", \"toys\", \"sports\", \"automotive\", \"beauty\", \"health\", \"grocery\", \"jewelry\", \"shoes\", \"tools\", \"office supplies\"];\n\t\tconst descriptors = [\"brand new\", \"open box\", \"refurbished\", \"used\", \"like new\", \"vintage\", \"antique\", \"collectible\"];\n\t\tconst suffix = [\"item\", \"product\", \"good\", \"merchandise\", \"thing\", \"object\", \"widget\", \"gadget\", \"device\", \"apparatus\", \"contraption\", \"instrument\", \"tool\", \"implement\", \"utensil\", \"appliance\", \"machine\", \"equipment\", \"gear\", \"kit\", \"set\", \"package\"];\n\t\tconst assetPreview = ['.png', '.jpg', '.jpeg', '.heic', '.mp4', '.mov', '.avi'];\n\t\tconst data = [];\n\t\tconst numOfItems = integer(1, maxItems);\n\n\t\tfor (var i = 0; i < numOfItems; i++) {\n\t\t\tconst category = chance.pickone(categories);\n\t\t\tconst descriptor = chance.pickone(descriptors);\n\t\t\tconst suffixWord = chance.pickone(suffix);\n\t\t\tconst slug = `${descriptor.replace(/\\s+/g, '-').toLowerCase()}-${suffixWord.replace(/\\s+/g, '-').toLowerCase()}`;\n\t\t\tconst asset = chance.pickone(assetPreview);\n\n\t\t\t// const product_id = chance.guid();\n\t\t\tconst price = integer(1, 100);\n\t\t\tconst quantity = integer(1, 5);\n\t\t\tconst product_id = integer(1, 1_000);\n\n\t\t\tconst item = {\n\t\t\t\tproduct_id: product_id,\n\t\t\t\tproduct_url: `https://example.com/assets/${product_id}`,\n\t\t\t\t// sku: integer(11111, 99999),\n\t\t\t\t// amount: price,\n\t\t\t\t// quantity: quantity,\n\t\t\t\t// total_value: price * quantity,\n\t\t\t\t// featured: chance.pickone([true, false, false]),\n\t\t\t\t// category: category,\n\t\t\t\t// descriptor: descriptor,\n\t\t\t\t// slug: slug,\n\t\t\t\t\n\t\t\t\t// assetType: asset\n\n\t\t\t};\n\n\t\t\tdata.push(item);\n\t\t}\n\n\t\treturn () => [data];\n\t}"
44
+ }
45
+ }
46
+ },
47
+ {
48
+ "event": "add to cart",
49
+ "weight": 4,
50
+ "properties": {
51
+ "item": {
52
+ "functionName": "arrow",
53
+ "body": "function () {\n\t\tconst categories = [\"electronics\", \"books\", \"clothing\", \"home\", \"garden\", \"toys\", \"sports\", \"automotive\", \"beauty\", \"health\", \"grocery\", \"jewelry\", \"shoes\", \"tools\", \"office supplies\"];\n\t\tconst descriptors = [\"brand new\", \"open box\", \"refurbished\", \"used\", \"like new\", \"vintage\", \"antique\", \"collectible\"];\n\t\tconst suffix = [\"item\", \"product\", \"good\", \"merchandise\", \"thing\", \"object\", \"widget\", \"gadget\", \"device\", \"apparatus\", \"contraption\", \"instrument\", \"tool\", \"implement\", \"utensil\", \"appliance\", \"machine\", \"equipment\", \"gear\", \"kit\", \"set\", \"package\"];\n\t\tconst assetPreview = ['.png', '.jpg', '.jpeg', '.heic', '.mp4', '.mov', '.avi'];\n\t\tconst data = [];\n\t\tconst numOfItems = integer(1, maxItems);\n\n\t\tfor (var i = 0; i < numOfItems; i++) {\n\t\t\tconst category = chance.pickone(categories);\n\t\t\tconst descriptor = chance.pickone(descriptors);\n\t\t\tconst suffixWord = chance.pickone(suffix);\n\t\t\tconst slug = `${descriptor.replace(/\\s+/g, '-').toLowerCase()}-${suffixWord.replace(/\\s+/g, '-').toLowerCase()}`;\n\t\t\tconst asset = chance.pickone(assetPreview);\n\n\t\t\t// const product_id = chance.guid();\n\t\t\tconst price = integer(1, 100);\n\t\t\tconst quantity = integer(1, 5);\n\t\t\tconst product_id = integer(1, 1_000);\n\n\t\t\tconst item = {\n\t\t\t\tproduct_id: product_id,\n\t\t\t\tproduct_url: `https://example.com/assets/${product_id}`,\n\t\t\t\t// sku: integer(11111, 99999),\n\t\t\t\t// amount: price,\n\t\t\t\t// quantity: quantity,\n\t\t\t\t// total_value: price * quantity,\n\t\t\t\t// featured: chance.pickone([true, false, false]),\n\t\t\t\t// category: category,\n\t\t\t\t// descriptor: descriptor,\n\t\t\t\t// slug: slug,\n\t\t\t\t\n\t\t\t\t// assetType: asset\n\n\t\t\t};\n\n\t\t\tdata.push(item);\n\t\t}\n\n\t\treturn () => [data];\n\t}"
54
+ }
55
+ }
56
+ },
57
+ {
58
+ "event": "view item",
59
+ "weight": 8,
60
+ "properties": {
61
+ "item": {
62
+ "functionName": "arrow",
63
+ "body": "function () {\n\t\tconst categories = [\"electronics\", \"books\", \"clothing\", \"home\", \"garden\", \"toys\", \"sports\", \"automotive\", \"beauty\", \"health\", \"grocery\", \"jewelry\", \"shoes\", \"tools\", \"office supplies\"];\n\t\tconst descriptors = [\"brand new\", \"open box\", \"refurbished\", \"used\", \"like new\", \"vintage\", \"antique\", \"collectible\"];\n\t\tconst suffix = [\"item\", \"product\", \"good\", \"merchandise\", \"thing\", \"object\", \"widget\", \"gadget\", \"device\", \"apparatus\", \"contraption\", \"instrument\", \"tool\", \"implement\", \"utensil\", \"appliance\", \"machine\", \"equipment\", \"gear\", \"kit\", \"set\", \"package\"];\n\t\tconst assetPreview = ['.png', '.jpg', '.jpeg', '.heic', '.mp4', '.mov', '.avi'];\n\t\tconst data = [];\n\t\tconst numOfItems = integer(1, maxItems);\n\n\t\tfor (var i = 0; i < numOfItems; i++) {\n\t\t\tconst category = chance.pickone(categories);\n\t\t\tconst descriptor = chance.pickone(descriptors);\n\t\t\tconst suffixWord = chance.pickone(suffix);\n\t\t\tconst slug = `${descriptor.replace(/\\s+/g, '-').toLowerCase()}-${suffixWord.replace(/\\s+/g, '-').toLowerCase()}`;\n\t\t\tconst asset = chance.pickone(assetPreview);\n\n\t\t\t// const product_id = chance.guid();\n\t\t\tconst price = integer(1, 100);\n\t\t\tconst quantity = integer(1, 5);\n\t\t\tconst product_id = integer(1, 1_000);\n\n\t\t\tconst item = {\n\t\t\t\tproduct_id: product_id,\n\t\t\t\tproduct_url: `https://example.com/assets/${product_id}`,\n\t\t\t\t// sku: integer(11111, 99999),\n\t\t\t\t// amount: price,\n\t\t\t\t// quantity: quantity,\n\t\t\t\t// total_value: price * quantity,\n\t\t\t\t// featured: chance.pickone([true, false, false]),\n\t\t\t\t// category: category,\n\t\t\t\t// descriptor: descriptor,\n\t\t\t\t// slug: slug,\n\t\t\t\t\n\t\t\t\t// assetType: asset\n\n\t\t\t};\n\n\t\t\tdata.push(item);\n\t\t}\n\n\t\treturn () => [data];\n\t}"
64
+ }
65
+ }
66
+ },
67
+ {
68
+ "event": "save item",
69
+ "weight": 5,
70
+ "properties": {
71
+ "item": {
72
+ "functionName": "arrow",
73
+ "body": "function () {\n\t\tconst categories = [\"electronics\", \"books\", \"clothing\", \"home\", \"garden\", \"toys\", \"sports\", \"automotive\", \"beauty\", \"health\", \"grocery\", \"jewelry\", \"shoes\", \"tools\", \"office supplies\"];\n\t\tconst descriptors = [\"brand new\", \"open box\", \"refurbished\", \"used\", \"like new\", \"vintage\", \"antique\", \"collectible\"];\n\t\tconst suffix = [\"item\", \"product\", \"good\", \"merchandise\", \"thing\", \"object\", \"widget\", \"gadget\", \"device\", \"apparatus\", \"contraption\", \"instrument\", \"tool\", \"implement\", \"utensil\", \"appliance\", \"machine\", \"equipment\", \"gear\", \"kit\", \"set\", \"package\"];\n\t\tconst assetPreview = ['.png', '.jpg', '.jpeg', '.heic', '.mp4', '.mov', '.avi'];\n\t\tconst data = [];\n\t\tconst numOfItems = integer(1, maxItems);\n\n\t\tfor (var i = 0; i < numOfItems; i++) {\n\t\t\tconst category = chance.pickone(categories);\n\t\t\tconst descriptor = chance.pickone(descriptors);\n\t\t\tconst suffixWord = chance.pickone(suffix);\n\t\t\tconst slug = `${descriptor.replace(/\\s+/g, '-').toLowerCase()}-${suffixWord.replace(/\\s+/g, '-').toLowerCase()}`;\n\t\t\tconst asset = chance.pickone(assetPreview);\n\n\t\t\t// const product_id = chance.guid();\n\t\t\tconst price = integer(1, 100);\n\t\t\tconst quantity = integer(1, 5);\n\t\t\tconst product_id = integer(1, 1_000);\n\n\t\t\tconst item = {\n\t\t\t\tproduct_id: product_id,\n\t\t\t\tproduct_url: `https://example.com/assets/${product_id}`,\n\t\t\t\t// sku: integer(11111, 99999),\n\t\t\t\t// amount: price,\n\t\t\t\t// quantity: quantity,\n\t\t\t\t// total_value: price * quantity,\n\t\t\t\t// featured: chance.pickone([true, false, false]),\n\t\t\t\t// category: category,\n\t\t\t\t// descriptor: descriptor,\n\t\t\t\t// slug: slug,\n\t\t\t\t\n\t\t\t\t// assetType: asset\n\n\t\t\t};\n\n\t\t\tdata.push(item);\n\t\t}\n\n\t\treturn () => [data];\n\t}"
74
+ }
75
+ }
76
+ }
77
+ ],
78
+ "funnels": [],
79
+ "superProps": {
80
+ "theme": {
81
+ "functionName": "arrow",
82
+ "body": "function () {\n\t\tconst weighted = [];\n\t\tfor (let i = 0; i < 10; i++) {\n\t\t\tconst rand = chance.d10(); // Random number between 1 and 10\n\n\t\t\t// 35% chance to favor the most chosen index\n\t\t\tif (chance.bool({ likelihood: 35 })) {\n\t\t\t\t// 50% chance to slightly alter the index\n\t\t\t\tif (chance.bool({ likelihood: 50 })) {\n\t\t\t\t\tweighted.push(items[mostChosenIndex]);\n\t\t\t\t} else {\n\t\t\t\t\tconst addOrSubtract = chance.bool({ likelihood: 50 }) ? -rand : rand;\n\t\t\t\t\tlet newIndex = mostChosenIndex + addOrSubtract;\n\n\t\t\t\t\t// Ensure newIndex is within bounds\n\t\t\t\t\tif (newIndex < 0) newIndex = 0;\n\t\t\t\t\tif (newIndex >= items.length) newIndex = items.length - 1;\n\t\t\t\t\tweighted.push(items[newIndex]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// 25% chance to favor the second most chosen index\n\t\t\telse if (chance.bool({ likelihood: 25 })) {\n\t\t\t\tweighted.push(items[secondMostChosenIndex]);\n\t\t\t}\n\t\t\t// 15% chance to favor the third most chosen index\n\t\t\telse if (chance.bool({ likelihood: 15 })) {\n\t\t\t\tweighted.push(items[thirdMostChosenIndex]);\n\t\t\t}\n\t\t\t// Otherwise, pick a random item from the list\n\t\t\telse {\n\t\t\t\tweighted.push(chance.pickone(items));\n\t\t\t}\n\t\t}\n\t\treturn weighted;\n\t}"
83
+ }
84
+ },
85
+ "userProps": {
86
+ "spiritAnimal": [
87
+ "duck",
88
+ "dog",
89
+ "otter",
90
+ "penguin",
91
+ "cat",
92
+ "elephant",
93
+ "lion",
94
+ "cheetah",
95
+ "giraffe",
96
+ "zebra",
97
+ "rhino",
98
+ "hippo",
99
+ "whale",
100
+ "dolphin",
101
+ "shark",
102
+ "octopus",
103
+ "squid",
104
+ "jellyfish",
105
+ "starfish",
106
+ "seahorse",
107
+ "crab",
108
+ "lobster",
109
+ "shrimp",
110
+ "clam",
111
+ "snail",
112
+ "slug",
113
+ "butterfly",
114
+ "moth",
115
+ "bee",
116
+ "wasp",
117
+ "ant",
118
+ "beetle",
119
+ "ladybug",
120
+ "caterpillar",
121
+ "centipede",
122
+ "millipede",
123
+ "scorpion",
124
+ "spider",
125
+ "tarantula",
126
+ "tick",
127
+ "mite",
128
+ "mosquito",
129
+ "fly",
130
+ "dragonfly",
131
+ "damselfly",
132
+ "grasshopper",
133
+ "cricket",
134
+ "locust",
135
+ "mantis",
136
+ "cockroach",
137
+ "termite",
138
+ "praying mantis",
139
+ "walking stick",
140
+ "stick bug",
141
+ "leaf insect",
142
+ "lacewing",
143
+ "aphid",
144
+ "cicada",
145
+ "thrips",
146
+ "psyllid",
147
+ "scale insect",
148
+ "whitefly",
149
+ "mealybug",
150
+ "planthopper",
151
+ "leafhopper",
152
+ "treehopper",
153
+ "flea",
154
+ "louse",
155
+ "bedbug",
156
+ "flea beetle",
157
+ "weevil",
158
+ "longhorn beetle",
159
+ "leaf beetle",
160
+ "tiger beetle",
161
+ "ground beetle",
162
+ "lady beetle",
163
+ "firefly",
164
+ "click beetle",
165
+ "rove beetle",
166
+ "scarab beetle",
167
+ "dung beetle",
168
+ "stag beetle",
169
+ "rhinoceros beetle",
170
+ "hercules beetle",
171
+ "goliath beetle",
172
+ "jewel beetle",
173
+ "tortoise beetle"
174
+ ]
175
+ },
176
+ "scdProps": {},
177
+ "mirrorProps": {},
178
+ "groupKeys": [],
179
+ "groupProps": {},
180
+ "lookupTables": [
181
+ {
182
+ "key": "product_id",
183
+ "entries": 1000,
184
+ "attributes": {
185
+ "amount": [
186
+ 259,
187
+ 247,
188
+ 271,
189
+ 269,
190
+ 209,
191
+ 305,
192
+ 706,
193
+ 344,
194
+ 350,
195
+ 327,
196
+ 259,
197
+ 225,
198
+ 269,
199
+ 267,
200
+ 256,
201
+ 705,
202
+ 196,
203
+ 588,
204
+ 775,
205
+ 235,
206
+ 737,
207
+ 341,
208
+ 268,
209
+ 409,
210
+ 233,
211
+ 246,
212
+ 239,
213
+ 737,
214
+ 701,
215
+ 741,
216
+ 227,
217
+ 230,
218
+ 693,
219
+ 719,
220
+ 277,
221
+ 706,
222
+ 292,
223
+ 274,
224
+ 596,
225
+ 263,
226
+ 250,
227
+ 279,
228
+ 275,
229
+ 799,
230
+ 236,
231
+ 267,
232
+ 221,
233
+ 230,
234
+ 730,
235
+ 789
236
+ ],
237
+ "quantity": [
238
+ 4,
239
+ 5,
240
+ 7,
241
+ 4,
242
+ 8,
243
+ 6,
244
+ 3,
245
+ 3,
246
+ 4,
247
+ 6,
248
+ 3,
249
+ 3,
250
+ 8,
251
+ 3,
252
+ 3,
253
+ 8,
254
+ 3,
255
+ 8,
256
+ 7,
257
+ 4,
258
+ 8,
259
+ 4,
260
+ 4,
261
+ 4,
262
+ 4,
263
+ 3,
264
+ 5,
265
+ 4,
266
+ 3,
267
+ 3,
268
+ 3,
269
+ 7,
270
+ 3,
271
+ 3,
272
+ 4,
273
+ 4,
274
+ 6,
275
+ 4,
276
+ 7,
277
+ 7,
278
+ 4,
279
+ 3,
280
+ 3,
281
+ 3,
282
+ 3,
283
+ 4,
284
+ 8,
285
+ 3,
286
+ 3,
287
+ 3
288
+ ],
289
+ "featured": {
290
+ "functionName": "arrow",
291
+ "body": "function flip(likelihood = 50) {\n\treturn chance.bool({ likelihood });\n}"
292
+ },
293
+ "category": [
294
+ "electronics",
295
+ "books",
296
+ "clothing",
297
+ "home",
298
+ "garden",
299
+ "toys",
300
+ "sports",
301
+ "automotive",
302
+ "beauty",
303
+ "health",
304
+ "grocery",
305
+ "jewelry",
306
+ "shoes",
307
+ "tools",
308
+ "office supplies"
309
+ ],
310
+ "descriptor": [
311
+ "brand new",
312
+ "open box",
313
+ "refurbished",
314
+ "used",
315
+ "like new",
316
+ "vintage",
317
+ "antique",
318
+ "collectible"
319
+ ]
320
+ }
321
+ }
322
+ ]
323
+ },
324
+ "hooks": "function (record, type, meta) {\n\n\t\tconst NOW = dayjs();\n\n\t\tif (type === \"event\") {\n\t\t\t// Pattern 1: Checkouts with coupons get a discount_applied flag and adjusted total\n\t\t\tif (record.event === \"checkout\" && record.coupon && record.coupon !== \"none\") {\n\t\t\t\trecord.discount_applied = true;\n\t\t\t\tconst pctMatch = record.coupon.match(/(\\d+)%/);\n\t\t\t\tif (pctMatch) {\n\t\t\t\t\trecord.discount_percent = parseInt(pctMatch[1]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Pattern 2: \"save item\" events on weekends are tagged as wishlist behavior\n\t\t\tif (record.event === \"save item\") {\n\t\t\t\tconst dow = dayjs(record.time).day();\n\t\t\t\tif (dow === 0 || dow === 6) {\n\t\t\t\t\trecord.save_context = \"weekend_browse\";\n\t\t\t\t} else {\n\t\t\t\t\trecord.save_context = \"weekday_intent\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (type === \"everything\") {\n\t\t\t// Pattern 3: Users who view 5+ items but never checkout are tagged as window shoppers\n\t\t\tconst views = record.filter(e => e.event === \"view item\").length;\n\t\t\tconst checkouts = record.filter(e => e.event === \"checkout\").length;\n\t\t\tif (views >= 5 && checkouts === 0) {\n\t\t\t\tfor (const e of record) {\n\t\t\t\t\te.user_segment = \"window_shopper\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn record;\n\t}",
325
+ "timestamp": "2026-04-10T01:39:06.554Z",
326
+ "version": "4.0"
327
+ }
@@ -1,11 +1,3 @@
1
- /**
2
- * This is the default configuration file for the data generator in SIMPLE mode
3
- * notice how the config object is structured, and see it's type definition in ./types.d.ts
4
- * feel free to modify this file to customize the data you generate
5
- * see helper functions in utils.js for more ways to generate data
6
- */
7
-
8
-
9
1
  import Chance from 'chance';
10
2
  let chance = new Chance();
11
3
  import dayjs from "dayjs";
@@ -17,6 +9,34 @@ import { pickAWinner, weighNumRange, date, integer, weighChoices } from "../lib/
17
9
  const videoCategories = ["funny", "educational", "inspirational", "music", "news", "sports", "cooking", "DIY", "travel", "gaming"];
18
10
  const spiritAnimals = ["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"];
19
11
 
12
+ /**
13
+ * ═══════════════════════════════════════════════════════════════
14
+ * DATASET OVERVIEW
15
+ * ═══════════════════════════════════════════════════════════════
16
+ *
17
+ * Array-of-Object Lookup Test — tests nested product arrays in events.
18
+ * - 1,000 users over 60 days, ~100K events
19
+ * - Events: checkout (cart array), add to cart, view/save item (single item)
20
+ * - Lookup table: 1,000 products with price, category, descriptor
21
+ * - Tests Mixpanel's array-of-objects property handling
22
+ *
23
+ * ═══════════════════════════════════════════════════════════════
24
+ * ANALYTICS HOOKS (3 patterns)
25
+ * ═══════════════════════════════════════════════════════════════
26
+ *
27
+ * 1. COUPON DISCOUNT TAGGING (event hook)
28
+ * Checkout events with coupons get discount_applied: true and
29
+ * discount_percent extracted from the coupon string.
30
+ *
31
+ * 2. WEEKEND BROWSE vs WEEKDAY INTENT (event hook)
32
+ * Save item events on weekends tagged save_context: "weekend_browse",
33
+ * weekdays tagged "weekday_intent".
34
+ *
35
+ * 3. WINDOW SHOPPERS (everything hook)
36
+ * Users with 5+ view item events but 0 checkouts get all their
37
+ * events tagged user_segment: "window_shopper".
38
+ */
39
+
20
40
  /** @type {import('../types.js').Dungeon} */
21
41
  const config = {
22
42
  // token: "",