@ak--47/dungeon-master 1.1.0 → 1.2.1

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 (72) hide show
  1. package/dungeons/technical/ad-spend-schema.json +2 -2
  2. package/dungeons/technical/ad-spend.js +16 -5
  3. package/dungeons/technical/anonymous-users-schema.json +4 -3
  4. package/dungeons/technical/anonymous-users.js +16 -6
  5. package/dungeons/technical/array-of-object-lookup-schema.json +1 -1
  6. package/dungeons/technical/array-of-object-lookup.js +22 -6
  7. package/dungeons/technical/experiments-schema.json +25 -19
  8. package/dungeons/technical/experiments.js +24 -6
  9. package/dungeons/technical/foobar.js +29 -13
  10. package/dungeons/technical/group-analytics-schema.json +92 -0
  11. package/dungeons/technical/group-analytics.js +16 -6
  12. package/dungeons/technical/mirror-strategies-schema.json +4 -4
  13. package/dungeons/technical/mirror-strategies.js +16 -6
  14. package/dungeons/technical/nested-objects.js +16 -5
  15. package/dungeons/technical/retention-cadence.js +14 -9
  16. package/dungeons/technical/sanity-schema.json +22 -22
  17. package/dungeons/technical/sanity.js +26 -6
  18. package/dungeons/technical/scale-test.js +16 -5
  19. package/dungeons/technical/scd-schema.json +230 -33
  20. package/dungeons/technical/scd.js +25 -5
  21. package/dungeons/technical/simple-schema.json +132 -48
  22. package/dungeons/technical/simple.js +21 -6
  23. package/dungeons/technical/simplest-schema.json +168 -79
  24. package/dungeons/technical/simplest.js +24 -7
  25. package/dungeons/technical/text-generation-schema.json +7 -4
  26. package/dungeons/technical/text-generation.js +23 -8
  27. package/dungeons/user/.gitkeep +0 -0
  28. package/dungeons/user/shalini.js +847 -0
  29. package/dungeons/vertical/community-schema.json +71 -49
  30. package/dungeons/vertical/community.js +57 -30
  31. package/dungeons/vertical/devtools-schema.json +69 -48
  32. package/dungeons/vertical/devtools.js +58 -31
  33. package/dungeons/vertical/ecommerce-schema.json +126 -108
  34. package/dungeons/vertical/ecommerce.js +32 -8
  35. package/dungeons/vertical/education-schema.json +5261 -272
  36. package/dungeons/vertical/education.js +45 -22
  37. package/dungeons/vertical/fintech-schema.json +165 -98
  38. package/dungeons/vertical/fintech.js +43 -11
  39. package/dungeons/vertical/fitness-schema.json +69 -47
  40. package/dungeons/vertical/fitness.js +56 -24
  41. package/dungeons/vertical/food-delivery-schema.json +36237 -187
  42. package/dungeons/vertical/food-delivery.js +67 -15
  43. package/dungeons/vertical/gaming-schema.json +104 -60
  44. package/dungeons/vertical/gaming.js +61 -16
  45. package/dungeons/vertical/healthcare-schema.json +70 -48
  46. package/dungeons/vertical/healthcare.js +77 -42
  47. package/dungeons/vertical/insurance-application-schema.json +66 -47
  48. package/dungeons/vertical/insurance-application.js +34 -10
  49. package/dungeons/vertical/logistics-schema.json +60 -38
  50. package/dungeons/vertical/logistics.js +77 -43
  51. package/dungeons/vertical/marketplace-schema.json +65 -43
  52. package/dungeons/vertical/marketplace.js +52 -21
  53. package/dungeons/vertical/media-schema.json +4085 -123
  54. package/dungeons/vertical/media.js +65 -18
  55. package/dungeons/vertical/rpg-schema.json +1984 -147
  56. package/dungeons/vertical/rpg.js +47 -11
  57. package/dungeons/vertical/sass-schema.json +2622 -147
  58. package/dungeons/vertical/sass.js +40 -10
  59. package/dungeons/vertical/social-schema.json +146 -78
  60. package/dungeons/vertical/social.js +39 -10
  61. package/dungeons/vertical/travel-schema.json +57 -35
  62. package/dungeons/vertical/travel.js +58 -21
  63. package/index.js +4 -1
  64. package/lib/core/config-validator.js +13 -2
  65. package/lib/core/context.js +9 -0
  66. package/lib/core/storage.js +2 -0
  67. package/lib/generators/events.js +3 -5
  68. package/lib/orchestrators/user-loop.js +24 -1
  69. package/lib/utils/utils.js +129 -9
  70. package/package.json +1 -1
  71. package/scripts/extract-dungeon-schema.mjs +64 -18
  72. package/types.d.ts +8 -3
@@ -95,15 +95,12 @@
95
95
  false
96
96
  ],
97
97
  "itemCategory": [
98
- "Health",
99
- "Wedding",
100
- "Handmade",
98
+ "Beauty",
101
99
  "Outdoors",
102
- "Computers",
103
- "Software",
100
+ "Toys",
101
+ "Pet",
104
102
  "Books",
105
- "Home",
106
- "Appliances"
103
+ "Health"
107
104
  ],
108
105
  "dateItemListed": {
109
106
  "$type": "string"
@@ -115,16 +112,19 @@
115
112
  "weight": 10,
116
113
  "properties": {
117
114
  "page": [
118
- "/peace",
119
- "/product",
115
+ "/",
120
116
  "/help",
117
+ "/account",
121
118
  "/watch",
119
+ "/listen",
120
+ "/product",
122
121
  "/people",
123
- "/listen"
122
+ "/peace"
124
123
  ],
125
124
  "utm_source": [
126
125
  "$organic",
127
126
  "google",
127
+ "facebook",
128
128
  "twitter",
129
129
  "linkedin"
130
130
  ]
@@ -135,12 +135,11 @@
135
135
  "weight": 8,
136
136
  "properties": {
137
137
  "videoCategory": [
138
- "cooking",
138
+ "news",
139
139
  "gaming",
140
- "educational",
141
- "travel",
142
- "funny",
143
- "inspirational"
140
+ "inspirational",
141
+ "DIY",
142
+ "sports"
144
143
  ],
145
144
  "isFeaturedItem": [
146
145
  true,
@@ -148,8 +147,8 @@
148
147
  ],
149
148
  "watchTimeSec": {
150
149
  "$range": [
151
- 130,
152
- 469
150
+ 131,
151
+ 467
153
152
  ]
154
153
  },
155
154
  "quality": [
@@ -181,10 +180,13 @@
181
180
  false
182
181
  ],
183
182
  "itemCategory": [
184
- "Games",
185
- "Music",
186
- "Books",
187
- "Garden"
183
+ "Automotive",
184
+ "Appliances",
185
+ "Baby",
186
+ "Kids",
187
+ "Sports",
188
+ "Beauty",
189
+ "Music"
188
190
  ],
189
191
  "dateItemListed": {
190
192
  "$type": "string"
@@ -200,11 +202,13 @@
200
202
  false
201
203
  ],
202
204
  "itemCategory": [
203
- "Food",
204
- "Art",
205
- "Wedding",
206
- "Toys",
207
- "Office"
205
+ "Computers",
206
+ "Books",
207
+ "Electronics",
208
+ "Sports",
209
+ "Beauty",
210
+ "Games",
211
+ "Food"
208
212
  ],
209
213
  "dateItemListed": {
210
214
  "$type": "string"
@@ -231,11 +235,28 @@
231
235
  }
232
236
  }
233
237
  ],
238
+ "funnels": [
239
+ {
240
+ "sequence": [
241
+ "page view",
242
+ "view item",
243
+ "save item",
244
+ "page view",
245
+ "sign up"
246
+ ],
247
+ "name": "Signup Flow",
248
+ "isFirstFunnel": true,
249
+ "conversionRate": 50,
250
+ "timeToConvert": 2,
251
+ "order": "first-and-last-fixed",
252
+ "experiment": true
253
+ }
254
+ ],
234
255
  "superProps": {
235
256
  "theme": [
236
- "custom",
257
+ "light",
237
258
  "dark",
238
- "light"
259
+ "custom"
239
260
  ]
240
261
  },
241
262
  "userProps": {
@@ -249,30 +270,93 @@
249
270
  ]
250
271
  },
251
272
  "spiritAnimal": [
252
- "millipede",
273
+ "duck",
274
+ "dog",
275
+ "otter",
276
+ "penguin",
277
+ "cat",
278
+ "elephant",
279
+ "lion",
280
+ "cheetah",
253
281
  "giraffe",
282
+ "zebra",
283
+ "rhino",
284
+ "hippo",
285
+ "whale",
286
+ "dolphin",
287
+ "shark",
288
+ "octopus",
289
+ "squid",
290
+ "jellyfish",
291
+ "starfish",
292
+ "seahorse",
293
+ "crab",
294
+ "lobster",
295
+ "shrimp",
296
+ "clam",
297
+ "snail",
298
+ "slug",
299
+ "butterfly",
300
+ "moth",
301
+ "bee",
302
+ "wasp",
303
+ "ant",
304
+ "beetle",
305
+ "ladybug",
306
+ "caterpillar",
307
+ "centipede",
308
+ "millipede",
309
+ "scorpion",
310
+ "spider",
254
311
  "tarantula",
255
- "bedbug",
312
+ "tick",
313
+ "mite",
314
+ "mosquito",
315
+ "fly",
316
+ "dragonfly",
317
+ "damselfly",
318
+ "grasshopper",
319
+ "cricket",
320
+ "locust",
321
+ "mantis",
322
+ "cockroach",
323
+ "termite",
324
+ "praying mantis",
325
+ "walking stick",
326
+ "stick bug",
327
+ "leaf insect",
328
+ "lacewing",
329
+ "aphid",
330
+ "cicada",
331
+ "thrips",
332
+ "psyllid",
333
+ "scale insect",
334
+ "whitefly",
335
+ "mealybug",
336
+ "planthopper",
337
+ "leafhopper",
338
+ "treehopper",
339
+ "flea",
256
340
  "louse",
341
+ "bedbug",
257
342
  "flea beetle",
343
+ "weevil",
344
+ "longhorn beetle",
258
345
  "leaf beetle",
259
- "cricket"
346
+ "tiger beetle",
347
+ "ground beetle",
348
+ "lady beetle",
349
+ "firefly",
350
+ "click beetle",
351
+ "rove beetle",
352
+ "scarab beetle",
353
+ "dung beetle",
354
+ "stag beetle",
355
+ "rhinoceros beetle",
356
+ "hercules beetle",
357
+ "goliath beetle",
358
+ "jewel beetle",
359
+ "tortoise beetle"
260
360
  ]
261
- },
262
- "funnels": [
263
- {
264
- "sequence": [
265
- "page view",
266
- "view item",
267
- "save item",
268
- "page view",
269
- "sign up"
270
- ],
271
- "isFirstFunnel": true,
272
- "conversionRate": 50,
273
- "timeToConvert": 2,
274
- "order": "first-and-last-fixed",
275
- "experiment": true
276
- }
277
- ]
361
+ }
278
362
  }
@@ -1,3 +1,13 @@
1
+ // ── TWEAK THESE ──
2
+ const SEED = "simple is best";
3
+ const num_days = 100;
4
+ const num_users = 5_000;
5
+ const avg_events_per_user = 100;
6
+ let token = "your-mixpanel-token";
7
+
8
+ // ── env overrides ──
9
+ if (process.env.MP_TOKEN) token = process.env.MP_TOKEN;
10
+
1
11
  import Chance from 'chance';
2
12
  let chance = new Chance();
3
13
  import dayjs from "dayjs";
@@ -6,6 +16,7 @@ dayjs.extend(utc);
6
16
  import { uid, comma } from 'ak-tools';
7
17
  import { pickAWinner, weighNumRange, date, integer, weighChoices } from "../../lib/utils/utils.js";
8
18
 
19
+ /** @typedef {import("../../types").Dungeon} Config */
9
20
  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
21
 
11
22
  const videoCategories = ["funny", "educational", "inspirational", "music", "news", "sports", "cooking", "DIY", "travel", "gaming"];
@@ -59,11 +70,11 @@ const videoCategories = ["funny", "educational", "inspirational", "music", "news
59
70
 
60
71
  /** @type {import('../../types').Dungeon} */
61
72
  const config = {
62
- token: "",
63
- seed: "simple is best",
64
- numDays: 100, //how many days worth1 of data
65
- numEvents: 500_000, //how many events
66
- numUsers: 5_000, //how many users
73
+ token,
74
+ seed: SEED,
75
+ numDays: num_days,
76
+ numEvents: num_users * avg_events_per_user,
77
+ numUsers: num_users,
67
78
  format: 'json', //csv or json
68
79
  region: "US",
69
80
  hasAnonIds: true, //if true, anonymousIds are created for each user
@@ -78,7 +89,6 @@ const config = {
78
89
  isAnonymous: false,
79
90
  alsoInferFunnels: true,
80
91
  concurrency: 1,
81
- batchSize: 2_500_000,
82
92
 
83
93
 
84
94
  events: [
@@ -191,6 +201,7 @@ const config = {
191
201
  each key should be an array or function reference
192
202
  */
193
203
  userProps: {
204
+ theme: ["light", "dark", "custom", "light", "dark"],
194
205
  title: chance.profession.bind(chance),
195
206
  luckyNumber: weighNumRange(42, 420, .3),
196
207
  spiritAnimal: ["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"]
@@ -234,6 +245,10 @@ const config = {
234
245
  }
235
246
 
236
247
  if (type === "everything") {
248
+ const profile = meta.profile;
249
+ record.forEach(e => {
250
+ e.theme = profile.theme;
251
+ });
237
252
 
238
253
  //custom themes purchase more:
239
254
  const numCustomMode = record.filter(a => a.theme === 'custom').length;