@ak--47/dungeon-master 1.0.0
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/README.md +518 -0
- package/dungeons/array-of-object-lookup-schema.json +327 -0
- package/dungeons/array-of-object-lookup.js +220 -0
- package/dungeons/ecommerce-schema.json +462 -0
- package/dungeons/ecommerce.js +447 -0
- package/dungeons/education-schema.json +2409 -0
- package/dungeons/education.js +768 -0
- package/dungeons/fintech-schema.json +14034 -0
- package/dungeons/fintech.js +696 -0
- package/dungeons/foobar-schema.json +403 -0
- package/dungeons/foobar.js +296 -0
- package/dungeons/food-delivery-schema.json +192 -0
- package/dungeons/food-delivery.js +602 -0
- package/dungeons/food-schema.json +1152 -0
- package/dungeons/food.js +754 -0
- package/dungeons/gaming-schema.json +1270 -0
- package/dungeons/gaming.js +508 -0
- package/dungeons/insurance-application-schema.json +204 -0
- package/dungeons/insurance-application.js +605 -0
- package/dungeons/media-schema.json +906 -0
- package/dungeons/media.js +790 -0
- package/dungeons/retention-cadence-schema.json +78 -0
- package/dungeons/retention-cadence.js +244 -0
- package/dungeons/rpg-schema.json +4526 -0
- package/dungeons/rpg.js +919 -0
- package/dungeons/sanity-schema.json +255 -0
- package/dungeons/sanity.js +152 -0
- package/dungeons/sass-schema.json +1291 -0
- package/dungeons/sass.js +795 -0
- package/dungeons/scd-schema.json +919 -0
- package/dungeons/scd.js +277 -0
- package/dungeons/simple-schema.json +608 -0
- package/dungeons/simple.js +285 -0
- package/dungeons/simplest-schema.json +1418 -0
- package/dungeons/simplest.js +392 -0
- package/dungeons/social-schema.json +1118 -0
- package/dungeons/social.js +686 -0
- package/dungeons/text-generation-schema.json +3096 -0
- package/dungeons/text-generation.js +812 -0
- package/index.js +567 -0
- package/lib/core/config-validator.js +395 -0
- package/lib/core/context.js +204 -0
- package/lib/core/dungeon-loader.js +337 -0
- package/lib/core/storage.js +379 -0
- package/lib/generators/adspend.js +132 -0
- package/lib/generators/events.js +271 -0
- package/lib/generators/funnels.js +407 -0
- package/lib/generators/mirror.js +167 -0
- package/lib/generators/product-lookup.js +262 -0
- package/lib/generators/product-names.js +195 -0
- package/lib/generators/profiles.js +93 -0
- package/lib/generators/scd.js +124 -0
- package/lib/generators/text.js +1192 -0
- package/lib/orchestrators/mixpanel-sender.js +266 -0
- package/lib/orchestrators/user-loop.js +335 -0
- package/lib/templates/abbreviated.d.ts +169 -0
- package/lib/templates/defaults.js +1405 -0
- package/lib/templates/phrases.js +2526 -0
- package/lib/templates/schema.d.ts +173 -0
- package/lib/templates/soup-presets.js +188 -0
- package/lib/utils/function-registry.js +302 -0
- package/lib/utils/json-evaluator.js +172 -0
- package/lib/utils/logger.js +34 -0
- package/lib/utils/utils.js +1490 -0
- package/package.json +89 -0
- package/types.d.ts +865 -0
|
@@ -0,0 +1,462 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema": {
|
|
3
|
+
"token": "",
|
|
4
|
+
"seed": "simple is best",
|
|
5
|
+
"numDays": 108,
|
|
6
|
+
"numEvents": 2000000,
|
|
7
|
+
"numUsers": 50000,
|
|
8
|
+
"format": "json",
|
|
9
|
+
"region": "US",
|
|
10
|
+
"hasAnonIds": false,
|
|
11
|
+
"hasSessionIds": false,
|
|
12
|
+
"hasAdSpend": false,
|
|
13
|
+
"hasLocation": true,
|
|
14
|
+
"hasAndroidDevices": true,
|
|
15
|
+
"hasIOSDevices": true,
|
|
16
|
+
"hasDesktopDevices": true,
|
|
17
|
+
"hasBrowser": true,
|
|
18
|
+
"hasCampaigns": false,
|
|
19
|
+
"isAnonymous": false,
|
|
20
|
+
"alsoInferFunnels": false,
|
|
21
|
+
"concurrency": 1,
|
|
22
|
+
"batchSize": 2500000,
|
|
23
|
+
"percentUsersBornInDataset": 25,
|
|
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\n\t\t\tconst item = {\n\t\t\t\t// product_id: product_id,\n\t\t\t\t// sku: integer(11111, 99999),\n\t\t\t\tamount: price,\n\t\t\t\tquantity: quantity,\n\t\t\t\ttotal_value: price * quantity,\n\t\t\t\tfeatured: chance.pickone([true, false, false]),\n\t\t\t\tcategory: category,\n\t\t\t\tdescriptor: descriptor,\n\t\t\t\tslug: slug,\n\t\t\t\tassetPreview: `https://example.com/assets/${slug}${asset}`,\n\t\t\t\tassetType: 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\n\t\t\tconst item = {\n\t\t\t\t// product_id: product_id,\n\t\t\t\t// sku: integer(11111, 99999),\n\t\t\t\tamount: price,\n\t\t\t\tquantity: quantity,\n\t\t\t\ttotal_value: price * quantity,\n\t\t\t\tfeatured: chance.pickone([true, false, false]),\n\t\t\t\tcategory: category,\n\t\t\t\tdescriptor: descriptor,\n\t\t\t\tslug: slug,\n\t\t\t\tassetPreview: `https://example.com/assets/${slug}${asset}`,\n\t\t\t\tassetType: 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\n\t\t\tconst item = {\n\t\t\t\t// product_id: product_id,\n\t\t\t\t// sku: integer(11111, 99999),\n\t\t\t\tamount: price,\n\t\t\t\tquantity: quantity,\n\t\t\t\ttotal_value: price * quantity,\n\t\t\t\tfeatured: chance.pickone([true, false, false]),\n\t\t\t\tcategory: category,\n\t\t\t\tdescriptor: descriptor,\n\t\t\t\tslug: slug,\n\t\t\t\tassetPreview: `https://example.com/assets/${slug}${asset}`,\n\t\t\t\tassetType: 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\n\t\t\tconst item = {\n\t\t\t\t// product_id: product_id,\n\t\t\t\t// sku: integer(11111, 99999),\n\t\t\t\tamount: price,\n\t\t\t\tquantity: quantity,\n\t\t\t\ttotal_value: price * quantity,\n\t\t\t\tfeatured: chance.pickone([true, false, false]),\n\t\t\t\tcategory: category,\n\t\t\t\tdescriptor: descriptor,\n\t\t\t\tslug: slug,\n\t\t\t\tassetPreview: `https://example.com/assets/${slug}${asset}`,\n\t\t\t\tassetType: 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
|
+
"event": "page view",
|
|
79
|
+
"weight": 10,
|
|
80
|
+
"properties": {
|
|
81
|
+
"page": [
|
|
82
|
+
"/",
|
|
83
|
+
"/help",
|
|
84
|
+
"/account",
|
|
85
|
+
"/watch",
|
|
86
|
+
"/listen",
|
|
87
|
+
"/product",
|
|
88
|
+
"/people",
|
|
89
|
+
"/peace"
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"event": "watch video",
|
|
95
|
+
"weight": 8,
|
|
96
|
+
"properties": {
|
|
97
|
+
"watchTimeSec": [
|
|
98
|
+
253,
|
|
99
|
+
478,
|
|
100
|
+
146,
|
|
101
|
+
160,
|
|
102
|
+
195,
|
|
103
|
+
218,
|
|
104
|
+
473,
|
|
105
|
+
435,
|
|
106
|
+
137,
|
|
107
|
+
359,
|
|
108
|
+
421,
|
|
109
|
+
167,
|
|
110
|
+
445,
|
|
111
|
+
160,
|
|
112
|
+
174,
|
|
113
|
+
156,
|
|
114
|
+
184,
|
|
115
|
+
463,
|
|
116
|
+
409,
|
|
117
|
+
436,
|
|
118
|
+
136,
|
|
119
|
+
181,
|
|
120
|
+
405,
|
|
121
|
+
193,
|
|
122
|
+
228,
|
|
123
|
+
194,
|
|
124
|
+
146,
|
|
125
|
+
410,
|
|
126
|
+
444,
|
|
127
|
+
156,
|
|
128
|
+
153,
|
|
129
|
+
456,
|
|
130
|
+
202,
|
|
131
|
+
158,
|
|
132
|
+
469,
|
|
133
|
+
154,
|
|
134
|
+
188,
|
|
135
|
+
152,
|
|
136
|
+
415,
|
|
137
|
+
238,
|
|
138
|
+
194,
|
|
139
|
+
160,
|
|
140
|
+
305,
|
|
141
|
+
181,
|
|
142
|
+
189,
|
|
143
|
+
195,
|
|
144
|
+
181,
|
|
145
|
+
401,
|
|
146
|
+
160,
|
|
147
|
+
257
|
|
148
|
+
]
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"event": "like video",
|
|
153
|
+
"weight": 6,
|
|
154
|
+
"properties": {}
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"event": "dislike video",
|
|
158
|
+
"weight": 4,
|
|
159
|
+
"properties": {}
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"event": "sign up",
|
|
163
|
+
"weight": 1,
|
|
164
|
+
"isFirstEvent": true,
|
|
165
|
+
"properties": {
|
|
166
|
+
"signupMethod": [
|
|
167
|
+
"email",
|
|
168
|
+
"google",
|
|
169
|
+
"facebook",
|
|
170
|
+
"twitter",
|
|
171
|
+
"linkedin",
|
|
172
|
+
"github"
|
|
173
|
+
],
|
|
174
|
+
"referral": {
|
|
175
|
+
"functionName": "arrow",
|
|
176
|
+
"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}"
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
],
|
|
181
|
+
"funnels": [
|
|
182
|
+
{
|
|
183
|
+
"sequence": [
|
|
184
|
+
"page view",
|
|
185
|
+
"view item",
|
|
186
|
+
"save item",
|
|
187
|
+
"page view",
|
|
188
|
+
"sign up"
|
|
189
|
+
],
|
|
190
|
+
"conversionRate": 50,
|
|
191
|
+
"order": "first-and-last-fixed",
|
|
192
|
+
"weight": 1,
|
|
193
|
+
"isFirstFunnel": true,
|
|
194
|
+
"timeToConvert": 2,
|
|
195
|
+
"experiment": false,
|
|
196
|
+
"name": "Signup Flow"
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"sequence": [
|
|
200
|
+
"watch video",
|
|
201
|
+
"like video",
|
|
202
|
+
"watch video",
|
|
203
|
+
"like video"
|
|
204
|
+
],
|
|
205
|
+
"name": "Video Likes",
|
|
206
|
+
"conversionRate": 60,
|
|
207
|
+
"props": {
|
|
208
|
+
"videoCategory": [
|
|
209
|
+
"funny",
|
|
210
|
+
"educational",
|
|
211
|
+
"inspirational",
|
|
212
|
+
"music",
|
|
213
|
+
"news",
|
|
214
|
+
"sports",
|
|
215
|
+
"cooking",
|
|
216
|
+
"DIY",
|
|
217
|
+
"travel",
|
|
218
|
+
"gaming"
|
|
219
|
+
],
|
|
220
|
+
"quality": [
|
|
221
|
+
"2160p",
|
|
222
|
+
"1440p",
|
|
223
|
+
"1080p",
|
|
224
|
+
"720p",
|
|
225
|
+
"480p",
|
|
226
|
+
"360p",
|
|
227
|
+
"240p"
|
|
228
|
+
],
|
|
229
|
+
"format": [
|
|
230
|
+
"mp4",
|
|
231
|
+
"avi",
|
|
232
|
+
"mov",
|
|
233
|
+
"mpg"
|
|
234
|
+
],
|
|
235
|
+
"uploader_id": {
|
|
236
|
+
"functionName": "arrow",
|
|
237
|
+
"body": "function () { [native code] }"
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"name": "Video Dislikes",
|
|
243
|
+
"sequence": [
|
|
244
|
+
"watch video",
|
|
245
|
+
"dislike video",
|
|
246
|
+
"watch video",
|
|
247
|
+
"dislike video"
|
|
248
|
+
],
|
|
249
|
+
"conversionRate": 20,
|
|
250
|
+
"props": {
|
|
251
|
+
"videoCategory": [
|
|
252
|
+
"funny",
|
|
253
|
+
"educational",
|
|
254
|
+
"inspirational",
|
|
255
|
+
"music",
|
|
256
|
+
"news",
|
|
257
|
+
"sports",
|
|
258
|
+
"cooking",
|
|
259
|
+
"DIY",
|
|
260
|
+
"travel",
|
|
261
|
+
"gaming"
|
|
262
|
+
],
|
|
263
|
+
"quality": [
|
|
264
|
+
"2160p",
|
|
265
|
+
"1440p",
|
|
266
|
+
"1080p",
|
|
267
|
+
"720p",
|
|
268
|
+
"480p",
|
|
269
|
+
"360p",
|
|
270
|
+
"240p"
|
|
271
|
+
],
|
|
272
|
+
"format": [
|
|
273
|
+
"mp4",
|
|
274
|
+
"avi",
|
|
275
|
+
"mov",
|
|
276
|
+
"mpg"
|
|
277
|
+
],
|
|
278
|
+
"uploader_id": {
|
|
279
|
+
"functionName": "arrow",
|
|
280
|
+
"body": "function () { [native code] }"
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
"name": "eCommerce Purchase",
|
|
286
|
+
"sequence": [
|
|
287
|
+
"view item",
|
|
288
|
+
"view item",
|
|
289
|
+
"add to cart",
|
|
290
|
+
"view item",
|
|
291
|
+
"add to cart",
|
|
292
|
+
"checkout"
|
|
293
|
+
],
|
|
294
|
+
"conversionRate": 15,
|
|
295
|
+
"requireRepeats": true,
|
|
296
|
+
"weight": 10,
|
|
297
|
+
"order": "last-fixed"
|
|
298
|
+
}
|
|
299
|
+
],
|
|
300
|
+
"superProps": {
|
|
301
|
+
"theme": {
|
|
302
|
+
"functionName": "arrow",
|
|
303
|
+
"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}"
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
"userProps": {
|
|
307
|
+
"title": {
|
|
308
|
+
"functionName": "arrow",
|
|
309
|
+
"body": "function () { [native code] }"
|
|
310
|
+
},
|
|
311
|
+
"luckyNumber": [
|
|
312
|
+
337,
|
|
313
|
+
319,
|
|
314
|
+
335,
|
|
315
|
+
137,
|
|
316
|
+
276,
|
|
317
|
+
133,
|
|
318
|
+
318,
|
|
319
|
+
144,
|
|
320
|
+
337,
|
|
321
|
+
131,
|
|
322
|
+
328,
|
|
323
|
+
328,
|
|
324
|
+
315,
|
|
325
|
+
139,
|
|
326
|
+
323,
|
|
327
|
+
146,
|
|
328
|
+
293,
|
|
329
|
+
338,
|
|
330
|
+
313,
|
|
331
|
+
170,
|
|
332
|
+
324,
|
|
333
|
+
153,
|
|
334
|
+
154,
|
|
335
|
+
175,
|
|
336
|
+
168,
|
|
337
|
+
137,
|
|
338
|
+
192,
|
|
339
|
+
159,
|
|
340
|
+
146,
|
|
341
|
+
145,
|
|
342
|
+
135,
|
|
343
|
+
295,
|
|
344
|
+
113,
|
|
345
|
+
119,
|
|
346
|
+
176,
|
|
347
|
+
166,
|
|
348
|
+
264,
|
|
349
|
+
162,
|
|
350
|
+
299,
|
|
351
|
+
314,
|
|
352
|
+
147,
|
|
353
|
+
141,
|
|
354
|
+
121,
|
|
355
|
+
136,
|
|
356
|
+
123,
|
|
357
|
+
181,
|
|
358
|
+
334,
|
|
359
|
+
131,
|
|
360
|
+
139,
|
|
361
|
+
121
|
|
362
|
+
],
|
|
363
|
+
"spiritAnimal": [
|
|
364
|
+
"duck",
|
|
365
|
+
"dog",
|
|
366
|
+
"otter",
|
|
367
|
+
"penguin",
|
|
368
|
+
"cat",
|
|
369
|
+
"elephant",
|
|
370
|
+
"lion",
|
|
371
|
+
"cheetah",
|
|
372
|
+
"giraffe",
|
|
373
|
+
"zebra",
|
|
374
|
+
"rhino",
|
|
375
|
+
"hippo",
|
|
376
|
+
"whale",
|
|
377
|
+
"dolphin",
|
|
378
|
+
"shark",
|
|
379
|
+
"octopus",
|
|
380
|
+
"squid",
|
|
381
|
+
"jellyfish",
|
|
382
|
+
"starfish",
|
|
383
|
+
"seahorse",
|
|
384
|
+
"crab",
|
|
385
|
+
"lobster",
|
|
386
|
+
"shrimp",
|
|
387
|
+
"clam",
|
|
388
|
+
"snail",
|
|
389
|
+
"slug",
|
|
390
|
+
"butterfly",
|
|
391
|
+
"moth",
|
|
392
|
+
"bee",
|
|
393
|
+
"wasp",
|
|
394
|
+
"ant",
|
|
395
|
+
"beetle",
|
|
396
|
+
"ladybug",
|
|
397
|
+
"caterpillar",
|
|
398
|
+
"centipede",
|
|
399
|
+
"millipede",
|
|
400
|
+
"scorpion",
|
|
401
|
+
"spider",
|
|
402
|
+
"tarantula",
|
|
403
|
+
"tick",
|
|
404
|
+
"mite",
|
|
405
|
+
"mosquito",
|
|
406
|
+
"fly",
|
|
407
|
+
"dragonfly",
|
|
408
|
+
"damselfly",
|
|
409
|
+
"grasshopper",
|
|
410
|
+
"cricket",
|
|
411
|
+
"locust",
|
|
412
|
+
"mantis",
|
|
413
|
+
"cockroach",
|
|
414
|
+
"termite",
|
|
415
|
+
"praying mantis",
|
|
416
|
+
"walking stick",
|
|
417
|
+
"stick bug",
|
|
418
|
+
"leaf insect",
|
|
419
|
+
"lacewing",
|
|
420
|
+
"aphid",
|
|
421
|
+
"cicada",
|
|
422
|
+
"thrips",
|
|
423
|
+
"psyllid",
|
|
424
|
+
"scale insect",
|
|
425
|
+
"whitefly",
|
|
426
|
+
"mealybug",
|
|
427
|
+
"planthopper",
|
|
428
|
+
"leafhopper",
|
|
429
|
+
"treehopper",
|
|
430
|
+
"flea",
|
|
431
|
+
"louse",
|
|
432
|
+
"bedbug",
|
|
433
|
+
"flea beetle",
|
|
434
|
+
"weevil",
|
|
435
|
+
"longhorn beetle",
|
|
436
|
+
"leaf beetle",
|
|
437
|
+
"tiger beetle",
|
|
438
|
+
"ground beetle",
|
|
439
|
+
"lady beetle",
|
|
440
|
+
"firefly",
|
|
441
|
+
"click beetle",
|
|
442
|
+
"rove beetle",
|
|
443
|
+
"scarab beetle",
|
|
444
|
+
"dung beetle",
|
|
445
|
+
"stag beetle",
|
|
446
|
+
"rhinoceros beetle",
|
|
447
|
+
"hercules beetle",
|
|
448
|
+
"goliath beetle",
|
|
449
|
+
"jewel beetle",
|
|
450
|
+
"tortoise beetle"
|
|
451
|
+
]
|
|
452
|
+
},
|
|
453
|
+
"scdProps": {},
|
|
454
|
+
"mirrorProps": {},
|
|
455
|
+
"groupKeys": [],
|
|
456
|
+
"groupProps": {},
|
|
457
|
+
"lookupTables": []
|
|
458
|
+
},
|
|
459
|
+
"hooks": "function (record, type, meta) {\n\n\t\tif (type === \"event\") {\n\t\t\tconst NOW = dayjs();\n\t\t\tconst DAY_SIGNUPS_IMPROVED = NOW.subtract(7, 'day');\n\t\t\tconst DAY_WATCH_TIME_WENT_UP = NOW.subtract(30, 'day');\n\t\t\tconst eventTime = dayjs(record.time);\n\n\t\t\t// unflattering 'items'\n\t\t\tif (record.item && Array.isArray(record.item)) {\n\t\t\t\trecord = { ...record, ...record.item[0] };\n\t\t\t\tdelete record.item;\n\t\t\t}\n\n\t\t\tif (record.event === 'sign up') {\n\t\t\t\trecord.signup_flow = \"v1\";\n\t\t\t\tif (eventTime.isBefore(DAY_SIGNUPS_IMPROVED)) {\n\t\t\t\t\t// tag 50% for removal (filtered in \"everything\" hook)\n\t\t\t\t\tif (chance.bool({ likelihood: 50 })) {\n\t\t\t\t\t\trecord._drop = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (eventTime.isAfter(DAY_SIGNUPS_IMPROVED)) {\n\t\t\t\t\trecord.signup_flow = \"v2\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (record.event === 'watch video') {\n\t\t\t\tconst factor = decimal(0.25, 0.79);\n\t\t\t\tif (eventTime.isBefore(DAY_WATCH_TIME_WENT_UP)) {\n\t\t\t\t\trecord.watchTimeSec = Math.round(record.watchTimeSec * (1 - factor));\n\t\t\t\t}\n\t\t\t\tif (eventTime.isAfter(DAY_WATCH_TIME_WENT_UP)) {\n\t\t\t\t\t// increase watch time by 33%\n\t\t\t\t\trecord.watchTimeSec = Math.round(record.watchTimeSec * (1 + factor));\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// toys + shoes frequently purchases together (and are higher cart values)\n\t\t\tif (record.event === 'checkout' && Array.isArray(record.cart)) {\n\t\t\t\tconst hasToys = record.cart.some(item => item.category === 'toys');\n\t\t\t\tconst hasShoes = record.cart.some(item => item.category === 'shoes');\n\t\t\t\tif (hasToys && !hasShoes) {\n\t\t\t\t\tconst bigCart = makeProducts(20)()()[0];\n\t\t\t\t\tconst shoeItems = bigCart.filter(item => item.category === 'shoes');\n\t\t\t\t\tif (shoeItems.length > 0) {\n\t\t\t\t\t\trecord.cart.push(shoeItems[0]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (hasShoes && !hasToys) {\n\t\t\t\t\tconst bigCart = makeProducts(20)()()[0];\n\t\t\t\t\tconst toyItems = bigCart.filter(item => item.category === 'toys');\n\t\t\t\t\tif (toyItems.length > 0) {\n\t\t\t\t\t\trecord.cart.push(toyItems[0]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!hasToys && !hasShoes) {\n\t\t\t\t\tconst cheapFactor = decimal(.75, 0.9);\n\t\t\t\t\t// make every item a bit cheaper\n\t\t\t\t\trecord.cart = record.cart.map(item => {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t...item,\n\t\t\t\t\t\t\tamount: Math.round(item.amount * cheapFactor),\n\t\t\t\t\t\t\ttotal_value: Math.round(item.total_value * cheapFactor)\n\t\t\t\t\t\t};\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\t// high quality video means longer watch times (lower quality shorter watch times)\n\t\t\tif (record.event === 'watch video') {\n\t\t\t\tconst qualityFactors = {\n\t\t\t\t\t\"2160p\": 1.5,\n\t\t\t\t\t\"1440p\": 1.4,\n\t\t\t\t\t\"1080p\": 1.3,\n\t\t\t\t\t\"720p\": 1.15,\n\t\t\t\t\t\"480p\": 1.0,\n\t\t\t\t\t\"360p\": 0.85,\n\t\t\t\t\t\"240p\": 0.7\n\t\t\t\t};\n\t\t\t\tconst quality = record.quality || \"480p\";\n\t\t\t\tconst factor = qualityFactors[quality] || 1.0;\n\t\t\t\trecord.watchTimeSec = Math.round(record.watchTimeSec * factor);\n\t\t\t}\n\n\n\n\t\t}\n\n\n\n\t\tif (type === \"everything\") {\n\t\t\t// big themes!\n\n\t\t\t// users who view items in the home and garden category churn more frequently\n\n\n\t\t\t// dark mode leads to faster purchase conversion\n\n\n\t\t\t// people who pay in bitcoin tend to buy more electronics and gadgets\n\n\n\t\t\t//custom themes purchase more:\n\t\t\t// const numCustomMode = record.filter(a => a.theme === 'custom').length;\n\t\t\t// const numLightMode = record.filter(a => a.theme === 'light').length;\n\t\t\t// const numDarkMode = record.filter(a => a.theme === 'dark').length;\n\t\t\t// if (numCustomMode > numLightMode || numCustomMode > numDarkMode) {\n\t\t\t// \t//triple their checkout events\n\t\t\t// \tconst checkoutEvents = record.filter(a => a.event === 'checkout');\n\t\t\t// \tconst newCheckouts = checkoutEvents.map(a => {\n\t\t\t// \t\tconst randomInt = integer(-48, 48);\n\t\t\t// \t\tconst newCheckout = {\n\t\t\t// \t\t\t...a,\n\t\t\t// \t\t\ttime: dayjs(a.time).add(randomInt, 'hour').toISOString(),\n\t\t\t// \t\t\tevent: \"checkout\",\n\t\t\t// \t\t\tamount: a.amount * 2,\n\t\t\t// \t\t\tcoupon: \"50%OFF\"\n\t\t\t// \t\t};\n\t\t\t// \t\treturn newCheckout;\n\t\t\t// \t});\n\t\t\t// \trecord.push(...newCheckouts);\n\t\t\t// }\n\n\t\t\t// //users who watch low quality videos churn more:\n\t\t\t// const loQuality = [\"480p\", \"360p\", \"240p\"];\n\t\t\t// const lowQualityWatches = record.filter(a => a.event === 'watch video' && loQuality.includes(a.quality));\n\t\t\t// const highQualityWatches = record.filter(a => a.event === 'watch video' && !loQuality.includes(a.quality));\n\t\t\t// if (lowQualityWatches.length > highQualityWatches.length) {\n\t\t\t// \tif (flip()) {\n\t\t\t// \t\t// find midpoint of records\n\t\t\t// \t\tconst midpoint = Math.floor(record.length / 2);\n\t\t\t// \t\trecord = record.slice(0, midpoint);\n\n\t\t\t// \t}\n\t\t\t// }\n\n\n\n\n\t\t}\n\n\t\t// Filter out events tagged for removal in the event hook\n\t\tif (type === \"everything\") {\n\t\t\trecord = record.filter(e => !e._drop);\n\t\t}\n\n\t\treturn record;\n\t}",
|
|
460
|
+
"timestamp": "2026-04-10T01:39:06.655Z",
|
|
461
|
+
"version": "4.0"
|
|
462
|
+
}
|