@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
@@ -365,113 +365,6 @@
365
365
  }
366
366
  }
367
367
  ],
368
- "superProps": {
369
- "theme": [
370
- "light",
371
- "dark",
372
- "custom"
373
- ]
374
- },
375
- "userProps": {
376
- "title": {
377
- "$type": "string"
378
- },
379
- "luckyNumber": {
380
- "$range": [
381
- 102,
382
- 338
383
- ]
384
- },
385
- "spiritAnimal": [
386
- "duck",
387
- "dog",
388
- "otter",
389
- "penguin",
390
- "cat",
391
- "elephant",
392
- "lion",
393
- "cheetah",
394
- "giraffe",
395
- "zebra",
396
- "rhino",
397
- "hippo",
398
- "whale",
399
- "dolphin",
400
- "shark",
401
- "octopus",
402
- "squid",
403
- "jellyfish",
404
- "starfish",
405
- "seahorse",
406
- "crab",
407
- "lobster",
408
- "shrimp",
409
- "clam",
410
- "snail",
411
- "slug",
412
- "butterfly",
413
- "moth",
414
- "bee",
415
- "wasp",
416
- "ant",
417
- "beetle",
418
- "ladybug",
419
- "caterpillar",
420
- "centipede",
421
- "millipede",
422
- "scorpion",
423
- "spider",
424
- "tarantula",
425
- "tick",
426
- "mite",
427
- "mosquito",
428
- "fly",
429
- "dragonfly",
430
- "damselfly",
431
- "grasshopper",
432
- "cricket",
433
- "locust",
434
- "mantis",
435
- "cockroach",
436
- "termite",
437
- "praying mantis",
438
- "walking stick",
439
- "stick bug",
440
- "leaf insect",
441
- "lacewing",
442
- "aphid",
443
- "cicada",
444
- "thrips",
445
- "psyllid",
446
- "scale insect",
447
- "whitefly",
448
- "mealybug",
449
- "planthopper",
450
- "leafhopper",
451
- "treehopper",
452
- "flea",
453
- "louse",
454
- "bedbug",
455
- "flea beetle",
456
- "weevil",
457
- "longhorn beetle",
458
- "leaf beetle",
459
- "tiger beetle",
460
- "ground beetle",
461
- "lady beetle",
462
- "firefly",
463
- "click beetle",
464
- "rove beetle",
465
- "scarab beetle",
466
- "dung beetle",
467
- "stag beetle",
468
- "rhinoceros beetle",
469
- "hercules beetle",
470
- "goliath beetle",
471
- "jewel beetle",
472
- "tortoise beetle"
473
- ]
474
- },
475
368
  "funnels": [
476
369
  {
477
370
  "sequence": [
@@ -481,6 +374,7 @@
481
374
  "page view",
482
375
  "sign up"
483
376
  ],
377
+ "name": "Signup Flow",
484
378
  "isFirstFunnel": true,
485
379
  "conversionRate": 50,
486
380
  "timeToConvert": 2,
@@ -493,6 +387,7 @@
493
387
  "watch video",
494
388
  "like video"
495
389
  ],
390
+ "name": "Video Likes",
496
391
  "conversionRate": 60,
497
392
  "props": {
498
393
  "videoCategory": [
@@ -534,6 +429,7 @@
534
429
  "watch video",
535
430
  "dislike video"
536
431
  ],
432
+ "name": "Video Dislikes",
537
433
  "conversionRate": 20,
538
434
  "props": {
539
435
  "videoCategory": [
@@ -577,10 +473,132 @@
577
473
  "add to cart",
578
474
  "checkout"
579
475
  ],
476
+ "name": "eCommerce Purchase",
580
477
  "conversionRate": 15,
581
478
  "order": "last-fixed",
582
479
  "weight": 10,
583
480
  "requireRepeats": true
584
481
  }
585
- ]
482
+ ],
483
+ "superProps": {
484
+ "theme": [
485
+ "light",
486
+ "dark",
487
+ "custom"
488
+ ]
489
+ },
490
+ "userProps": {
491
+ "title": {
492
+ "$type": "string"
493
+ },
494
+ "luckyNumber": {
495
+ "$range": [
496
+ 102,
497
+ 338
498
+ ]
499
+ },
500
+ "spiritAnimal": [
501
+ "duck",
502
+ "dog",
503
+ "otter",
504
+ "penguin",
505
+ "cat",
506
+ "elephant",
507
+ "lion",
508
+ "cheetah",
509
+ "giraffe",
510
+ "zebra",
511
+ "rhino",
512
+ "hippo",
513
+ "whale",
514
+ "dolphin",
515
+ "shark",
516
+ "octopus",
517
+ "squid",
518
+ "jellyfish",
519
+ "starfish",
520
+ "seahorse",
521
+ "crab",
522
+ "lobster",
523
+ "shrimp",
524
+ "clam",
525
+ "snail",
526
+ "slug",
527
+ "butterfly",
528
+ "moth",
529
+ "bee",
530
+ "wasp",
531
+ "ant",
532
+ "beetle",
533
+ "ladybug",
534
+ "caterpillar",
535
+ "centipede",
536
+ "millipede",
537
+ "scorpion",
538
+ "spider",
539
+ "tarantula",
540
+ "tick",
541
+ "mite",
542
+ "mosquito",
543
+ "fly",
544
+ "dragonfly",
545
+ "damselfly",
546
+ "grasshopper",
547
+ "cricket",
548
+ "locust",
549
+ "mantis",
550
+ "cockroach",
551
+ "termite",
552
+ "praying mantis",
553
+ "walking stick",
554
+ "stick bug",
555
+ "leaf insect",
556
+ "lacewing",
557
+ "aphid",
558
+ "cicada",
559
+ "thrips",
560
+ "psyllid",
561
+ "scale insect",
562
+ "whitefly",
563
+ "mealybug",
564
+ "planthopper",
565
+ "leafhopper",
566
+ "treehopper",
567
+ "flea",
568
+ "louse",
569
+ "bedbug",
570
+ "flea beetle",
571
+ "weevil",
572
+ "longhorn beetle",
573
+ "leaf beetle",
574
+ "tiger beetle",
575
+ "ground beetle",
576
+ "lady beetle",
577
+ "firefly",
578
+ "click beetle",
579
+ "rove beetle",
580
+ "scarab beetle",
581
+ "dung beetle",
582
+ "stag beetle",
583
+ "rhinoceros beetle",
584
+ "hercules beetle",
585
+ "goliath beetle",
586
+ "jewel beetle",
587
+ "tortoise beetle"
588
+ ]
589
+ },
590
+ "scdProps": {
591
+ "loyalty_tier": {
592
+ "type": "user",
593
+ "frequency": "month",
594
+ "timing": "fuzzy",
595
+ "max": 8,
596
+ "values": [
597
+ "bronze",
598
+ "silver",
599
+ "gold",
600
+ "platinum"
601
+ ]
602
+ }
603
+ }
586
604
  }
@@ -1,3 +1,13 @@
1
+ // ── TWEAK THESE ──
2
+ const SEED = "simple is best";
3
+ const num_days = 108;
4
+ const num_users = 50_000;
5
+ const avg_events_per_user = 40;
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 { weighNumRange, date, integer, weighChoices, decimal } 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
  const videoCategories = ["funny", "educational", "inspirational", "music", "news", "sports", "cooking", "DIY", "travel", "gaming"];
11
22
  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"];
@@ -129,11 +140,11 @@ function makeProducts(maxItems = 5) {
129
140
 
130
141
  /** @type {import('../types.d.ts').Dungeon} */
131
142
  const config = {
132
- token: "",
133
- seed: "simple is best",
134
- numDays: 108, //how many days worth1 of data
135
- numEvents: 2_000_000, //how many events
136
- numUsers: 50_000, //how many users
143
+ token,
144
+ seed: SEED,
145
+ numDays: num_days,
146
+ numEvents: num_users * avg_events_per_user,
147
+ numUsers: num_users,
137
148
  format: 'json', //csv or json
138
149
  region: "US",
139
150
  hasAnonIds: false, //if true, anonymousIds are created for each user
@@ -148,7 +159,6 @@ const config = {
148
159
  isAnonymous: false,
149
160
  alsoInferFunnels: false,
150
161
  concurrency: 1,
151
- batchSize: 2_500_000,
152
162
  percentUsersBornInDataset: 25,
153
163
  events: [
154
164
  {
@@ -305,9 +315,17 @@ const config = {
305
315
  userProps: {
306
316
  title: chance.profession.bind(chance),
307
317
  luckyNumber: weighNumRange(42, 420, .3),
308
- spiritAnimal: spiritAnimals
318
+ spiritAnimal: spiritAnimals,
319
+ theme: ["light", "dark", "custom", "light", "dark"],
320
+ },
321
+ scdProps: {
322
+ loyalty_tier: {
323
+ values: ["bronze", "silver", "gold", "platinum"],
324
+ frequency: "month",
325
+ timing: "fuzzy",
326
+ max: 8
327
+ }
309
328
  },
310
- scdProps: {},
311
329
  mirrorProps: {},
312
330
 
313
331
  /*
@@ -411,6 +429,12 @@ const config = {
411
429
 
412
430
 
413
431
  if (type === "everything") {
432
+ // Stamp superProps from profile for consistency
433
+ const profile = meta.profile;
434
+ record.forEach(e => {
435
+ e.theme = profile.theme;
436
+ });
437
+
414
438
  // big themes!
415
439
 
416
440
  // users who view items in the home and garden category churn more frequently