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
package/dungeons/big.js DELETED
@@ -1,226 +0,0 @@
1
- import Chance from 'chance';
2
- import dayjs from 'dayjs';
3
- import utc from 'dayjs/plugin/utc.js';
4
- import { uid, comma, makeName } from 'ak-tools';
5
- import { pickAWinner, weighNumRange, integer, date, choose } from "../lib/utils/utils.js";
6
-
7
- const seed = "lets go big";
8
- const chance = new Chance();
9
- dayjs.extend(utc);
10
-
11
-
12
- const eventsPerQuarter = 10_000_000 // 50M
13
- const numQuarters = 4; // 12 months
14
- // const parallelism = 5000;
15
- const totalEvents = Math.floor((eventsPerQuarter * numQuarters));
16
- const eventPerUser = 500;
17
- const totalUsers = Math.floor(totalEvents / eventPerUser);
18
- const totalDays = (numQuarters * 90) + 10;
19
-
20
- /** @type {import('../types').Dungeon} */
21
- const config = {
22
- // token: "",
23
- seed: seed,
24
- numDays: totalDays,
25
- numEvents: totalEvents,
26
- numUsers: totalUsers,
27
- strictEventCount: true,
28
- format: 'json', //csv or json
29
- region: "US",
30
- hasAnonIds: false, //if true, anonymousIds are created for each user
31
- hasSessionIds: false, //if true, hasSessionIds are created for each user
32
- hasLocation: false,
33
- hasAndroidDevices: false,
34
- alsoInferFunnels: false,
35
- batchSize: 2_000_000,
36
- hasAvatar: false,
37
- hasAdSpend: false,
38
- hasBrowser: false,
39
- hasCampaigns: false,
40
- hasDesktopDevices: false,
41
- hasIOSDevices: false,
42
- writeToDisk: true,
43
- funnels: [
44
- {
45
- "sequence": ["foo", "bar", "baz", "qux", "garply", "durtle", "linny", "fonk", "crumn", "yak"],
46
- weight: 1,
47
- order: "sequential"
48
- },
49
- {
50
- "sequence": ["foo", "bar"],
51
- weight: 25,
52
- order: "sequential"
53
- },
54
- {
55
- "sequence": ["foo", "bar", "baz"],
56
- weight: 20,
57
- order: "sequential"
58
- },
59
- {
60
- "sequence": ["foo", "bar", "baz", "qux"],
61
- weight: 15,
62
- order: "sequential"
63
- },
64
- {
65
- "sequence": ["foo", "bar", "baz", "qux", "garply"],
66
- weight: 10,
67
- order: "sequential"
68
- },
69
- {
70
- "sequence": ["foo", "bar", "baz", "qux", "garply", "durtle"],
71
- weight: 8,
72
- order: "sequential"
73
- },
74
- {
75
- "sequence": ["foo", "bar", "baz", "qux", "garply", "durtle", "linny"],
76
- weight: 6,
77
- order: "sequential"
78
- },
79
- {
80
- "sequence": ["foo", "bar", "baz", "qux", "garply", "durtle", "linny", "fonk"],
81
- weight: 4,
82
- order: "sequential"
83
- },
84
- {
85
- "sequence": ["foo", "bar", "baz", "qux", "garply", "durtle", "linny", "fonk", "crumn"],
86
- weight: 2,
87
- order: "sequential"
88
- },
89
- {
90
- "sequence": ["foo", "bar", "baz", "qux", "garply", "durtle", "linny", "fonk", "crumn", "yak"],
91
- weight: 1,
92
- order: "sequential"
93
- }
94
-
95
- ],
96
- events: [
97
- { event: "foo" },
98
- { event: "bar" },
99
- { event: "baz" },
100
- { event: "qux" },
101
- { event: "garply" },
102
- { event: "durtle" },
103
- { event: "linny" },
104
- { event: "fonk" },
105
- { event: "crumn" },
106
- { event: "yak" }
107
- ],
108
- //? https://docs.mixpanel.com/docs/data-structure/property-reference/data-type
109
- superProps: {
110
- "string": pickAWinner(["red", "orange", "yellow", "green", "blue", "indigo", "violet"]),
111
- "number": integer,
112
- "boolean": [true, true, false],
113
- "date": () => date(90),
114
- "string []": buildStringArray,
115
- "number []": buildNumberArray,
116
- "object {}": buildObjectProp,
117
- "object [{}]": buildObjArrayProp
118
- },
119
- userProps: {
120
- title: chance.profession.bind(chance),
121
- luckyNumber: weighNumRange(42, 420),
122
- 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"]),
123
- isHappyCustomer: pickAWinner([true, true, false]),
124
- },
125
- hook: function (record, type, meta) {
126
-
127
-
128
- // if (type === "event") {
129
- // debugger;
130
- // }
131
-
132
- // if (type === "user") {
133
-
134
- // }
135
-
136
- // if (type === "funnel-post") {
137
-
138
- // }
139
-
140
- // if (type === "funnel-pre") {
141
-
142
- // }
143
-
144
- // if (type === "scd") {
145
-
146
- // }
147
-
148
- // if (type === "everything") {
149
- // debugger;
150
- // }
151
-
152
- return record;
153
- }
154
- };
155
-
156
-
157
- function buildObjectProp() {
158
- return function () {
159
- return {
160
- "foo key": choose(pickAWinner(["red", "orange", "yellow", "green", "blue", "indigo", "violet"])()),
161
- "bar key": integer(1, 100),
162
- "baz key": choose(pickAWinner([true, true, false])()),
163
- };
164
- };
165
- }
166
-
167
-
168
- function buildNumberArray() {
169
- return function () {
170
- const arr = [];
171
- const times = integer(1, 10);
172
- for (let i = 0; i < times; i++) {
173
- arr.push(integer(1, 100));
174
- }
175
- return [arr];
176
- };
177
- }
178
-
179
- function buildStringArray() {
180
- return function () {
181
- const arr = [];
182
- const times = integer(1, 10);
183
- for (let i = 0; i < times; i++) {
184
- arr.push(makeName(integer(1, 3), " "));
185
- }
186
- return [arr];
187
- };
188
- }
189
-
190
-
191
- function buildObjArrayProp(maxItems = 5) {
192
-
193
- return function () {
194
- const categories = ["Device Accessories", "eBooks", "Automotive", "Baby Products", "Beauty", "Books", "Camera & Photo", "Cell Phones & Accessories", "Collectible Coins", "Consumer Electronics", "Entertainment Collectibles", "Fine Art", "Grocery & Gourmet Food", "Health & Personal Care", "Home & Garden", "Independent Design", "Industrial & Scientific", "Accessories", "Major Appliances", "Music", "Musical Instruments", "Office Products", "Outdoors", "Personal Computers", "Pet Supplies", "Software", "Sports", "Sports Collectibles", "Tools & Home Improvement", "Toys & Games", "Video, DVD & Blu-ray", "Video Games", "Watches"];
195
- const slugs = ['/sale/', '/featured/', '/home/', '/search/', '/wishlist/', '/'];
196
- const assetExtension = ['.png', '.jpg', '.jpeg', '.heic', '.mp4', '.mov', '.avi'];
197
- const data = [];
198
- const numOfItems = integer(1, maxItems);
199
-
200
- for (var i = 0; i < numOfItems; i++) {
201
- const category = chance.pickone(categories);
202
- const slug = chance.pickone(slugs);
203
- const asset = chance.pickone(assetExtension);
204
- const price = integer(1, 300);
205
- const quantity = integer(1, 5);
206
-
207
- const item = {
208
- sku: integer(11111, 99999),
209
- amount: price,
210
- quantity: quantity,
211
- total: price * quantity,
212
- featured: chance.pickone([true, false]),
213
- category: category,
214
- urlSlug: slug + category,
215
- asset: `${category}-${integer(1, 20)}${asset}`
216
- };
217
-
218
- data.push(item);
219
- }
220
-
221
- return () => [data];
222
- };
223
- };
224
-
225
-
226
- export default config;
@@ -1,391 +0,0 @@
1
- /**
2
- * Video platform dungeon (business/complex mode)
3
- */
4
-
5
- import Chance from 'chance';
6
- import dayjs from 'dayjs';
7
- import utc from 'dayjs/plugin/utc.js';
8
- dayjs.extend(utc);
9
- import { weighNumRange, pickAWinner, exhaust } from '../lib/utils/utils.js';
10
- import * as v from 'ak-tools';
11
-
12
- const chance = new Chance();
13
- const integer = (min, max) => chance.integer({ min, max });
14
-
15
- const channel_ids = [...Array(1234).keys()].map(i => i + 1).map(n => `channel_id_${n}`);
16
- const channel_names = chance.n(v.makeName, 1234);
17
- const video_ids = [...Array(50000).keys()].map(i => i + 1).map(n => n.toString());
18
- const video_names = chance.n(v.makeName, 50000);
19
-
20
- const EVENTS = 50_000
21
- const USERS = EVENTS / 100
22
-
23
-
24
- /** @type {import('../types.js').Dungeon} */
25
- const config = {
26
- token: "",
27
- seed: "it's business time...",
28
- numDays: 90, //how many days worth of data
29
- numEvents: EVENTS, //how many events
30
- numUsers: USERS, //how many users
31
- format: 'json', //csv or json
32
- region: "US",
33
- hasAnonIds: false, //if true, anonymousIds are created for each user
34
- hasSessionIds: false, //if true, hasSessionIds are created for each user
35
- hasLocation: true,
36
- hasAndroidDevices: true,
37
- hasIOSDevices: true,
38
- hasDesktopDevices: true,
39
- hasBrowser: true,
40
- hasCampaigns: true,
41
- isAnonymous: false,
42
- hasAdSpend: true,
43
-
44
- hasAvatar: false,
45
-
46
- batchSize: 500_000,
47
- concurrency: 1,
48
-
49
- funnels: [
50
- {
51
- sequence: ["watch video", "like video", "subscribe", "purchase video"],
52
- conversionRate: 35,
53
- props: {
54
- channel_id: pickAWinner(channel_ids),
55
- video_id: weighNumRange(1, 50000, 1.4),
56
- category: pickAWinner(["funny", "educational", "music", "news", "sports", "cooking", "DIY", "travel", "gaming"]),
57
- isFeatured: () => { chance.bool({ likelihood: 25 }); },
58
- }
59
- },
60
- {
61
- sequence: ["watch video", "dislike video"],
62
- conversionRate: 10,
63
- order: "sequential",
64
- props: {
65
- channel_id: pickAWinner(channel_ids),
66
- video_id: weighNumRange(1, 50000, .67),
67
- category: pickAWinner(["funny", "educational", "music", "news", "sports", "cooking", "DIY", "travel", "gaming"]),
68
- isFeatured: () => { chance.bool({ likelihood: 25 }); },
69
- }
70
- },
71
- ],
72
- events: [
73
- {
74
- "event": "watch video",
75
- "weight": 75,
76
- "properties": {
77
- "#hashtags": makeHashTags,
78
- "watch time (sec)": weighNumRange(10, 600, .25),
79
- "quality": pickAWinner(["2160p", "1440p", "1080p", "720p", "480p", "360p", "240p"], 1)
80
- }
81
- },
82
- {
83
- "event": "like video",
84
- "weight": 30,
85
- "properties": {
86
-
87
- }
88
- },
89
- {
90
- "event": "dislike video",
91
- "weight": 15,
92
- "properties": {
93
-
94
- }
95
- },
96
- {
97
- "event": "subscribe",
98
- "weight": 10,
99
- "properties": {
100
- "UI": pickAWinner(["button", "link", "modal", "menu"]),
101
- }
102
- },
103
- {
104
- "event": "search",
105
- "weight": 10,
106
- "properties": {
107
- term: () => { return chance.word(); },
108
- "# results": weighNumRange(1, 100, .25),
109
- "UI": pickAWinner(["button", "link", "modal", "menu"]),
110
- }
111
- },
112
- {
113
- "event": "comment",
114
- "weight": 6,
115
- "properties": {
116
- length: weighNumRange(1, 500, .25),
117
- video_id: weighNumRange(1, 50000, .72),
118
- "has replies": [true, false, false, false, false],
119
- "has photos": [true, false, false, false, false],
120
-
121
- }
122
- },
123
- {
124
- "event": "save video",
125
- "weight": 17,
126
- "properties": {
127
- video_id: weighNumRange(1, 50000, 1.4),
128
- UI: pickAWinner(["toolbar", "menu", "keyboard"])
129
-
130
- }
131
- },
132
- {
133
- "event": "create playlist",
134
- "weight": 5,
135
- "properties": {
136
- "# of videos": weighNumRange(1, 100, .25),
137
- "UI": pickAWinner(["toolbar", "menu", "keyboard"]),
138
- "visibility": pickAWinner(["public", "private", "unlisted"]),
139
- }
140
- },
141
- {
142
- "event": "purchase video",
143
- "weight": 12,
144
- "properties": {
145
- video_id: weighNumRange(1, 50000, 1.4),
146
- basket: makeProducts(5),
147
-
148
-
149
- }
150
- },
151
- {
152
- "event": "support ticket",
153
- "weight": 10,
154
- "properties": {
155
- description: chance.sentence.bind(chance),
156
- severity: ["low", "medium", "high"],
157
- ticket_id: chance.guid.bind(chance)
158
- }
159
- },
160
- {
161
- "event": "app error",
162
- "weight": 15,
163
- "properties": {
164
- code: pickAWinner(["404", "500", "403", "401", "400", "503", "504", "429"]),
165
- error: chance.sentence.bind(chance),
166
- component: pickAWinner(["video player", "search", "comment", "profile", "settings", "billing", "support"]),
167
- }
168
- },
169
- {
170
- "event": "sign up",
171
- "isFirstEvent": true,
172
- "weight": 0,
173
- "properties": {
174
-
175
- }
176
- }
177
- ],
178
- superProps: {
179
-
180
-
181
- },
182
- /*
183
- user properties work the same as event properties
184
- each key should be an array or function reference
185
- */
186
- userProps: {
187
- title: chance.profession.bind(chance),
188
- luckyNumber: weighNumRange(42, 420),
189
- experiment: designExperiment(),
190
- spiritAnimal: ["unicorn", "dragon", "phoenix", "sasquatch", "yeti", "kraken", "jackalope", "thunderbird", "mothman", "nessie", "chupacabra", "jersey devil", "bigfoot", "weindgo", "bunyip", "mokele-mbembe", "tatzelwurm", "megalodon"],
191
-
192
- ip: chance.ip.bind(chance),
193
-
194
- },
195
-
196
- /** each generates it's own table */
197
- scdProps: {
198
- plan: {
199
- type: "user",
200
- frequency: "month",
201
- values: ["free", "free", "free", "free", "basic", "basic", "basic", "premium", "premium", "enterprise"],
202
- timing: "fixed",
203
- max: 3
204
- },
205
- MRR: {
206
- type: "user",
207
- frequency: "month",
208
- values: weighNumRange(0, 10000, .15),
209
- timing: "fixed",
210
- max: 5
211
- },
212
- NPS: {
213
- type: "user",
214
- frequency: "month",
215
- values: weighNumRange(0, 10, 2, 150),
216
- timing: "fixed",
217
- max: 3
218
- }
219
- },
220
-
221
- mirrorProps: {
222
-
223
- },
224
-
225
- /*
226
- for group analytics keys, we need an array of arrays [[],[],[]]
227
- each pair represents a group_key and the number of profiles for that key
228
- */
229
- groupKeys: [
230
- ['channel_id', 1234, ["save video", "comment", "watch video", "purchase video", "like video", "dislike video", "subscribe"]],
231
-
232
- ],
233
- groupProps: {
234
- channel_id: {
235
- "name": exhaust(channel_names),
236
- "viewers": weighNumRange(5, 500, .25),
237
- "rating": weighNumRange(1, 5),
238
- "reviews": weighNumRange(0, 35)
239
- }
240
-
241
- },
242
-
243
- lookupTables: [
244
- {
245
- key: "video_id",
246
- entries: 50000,
247
- attributes: {
248
- isFlagged: [true, false, false, false, false],
249
- copyright: ["all rights reserved", "creative commons", "creative commons", "public domain", "fair use"],
250
- uploader_id: chance.guid.bind(chance),
251
- "uploader influence": ["low", "low", "low", "medium", "medium", "high"],
252
- thumbs: weighNumRange(0, 4000, .25),
253
- video_name: exhaust(video_names),
254
- rating: ["G", "PG", "PG-13", "R", "NC-17", "PG-13", "R", "NC-17", "R", "PG", "PG"]
255
- }
256
-
257
- }
258
- ],
259
-
260
- hook: function (record, type, meta) {
261
- // --- user hook: tag users by their experiment variant ---
262
- if (type === "user") {
263
- const exp = record.experiment;
264
- if (exp && Array.isArray(exp) && exp[0]) {
265
- record.experimentGroup = exp[0].variant || "unknown";
266
- }
267
- return record;
268
- }
269
-
270
- // --- event hook: weekend watch time boost + premium quality bias ---
271
- if (type === "event") {
272
- if (record.event === "watch video" && record.time) {
273
- const day = dayjs(record.time).day();
274
- if (day === 0 || day === 6) {
275
- record["watch time (sec)"] = Math.round((record["watch time (sec)"] || 60) * 1.8);
276
- record.is_weekend_session = true;
277
- }
278
- }
279
- // app errors on weekends are more severe (skeleton crew)
280
- if (record.event === "app error" && record.time) {
281
- const day = dayjs(record.time).day();
282
- if (day === 0 || day === 6) {
283
- record.weekend_incident = true;
284
- }
285
- }
286
- return record;
287
- }
288
-
289
- // --- everything hook: binge watchers (5+ watch events) get a "binge_session" event ---
290
- if (type === "everything") {
291
- const watches = record.filter(e => e.event === "watch video");
292
- if (watches.length >= 5) {
293
- const totalWatchTime = watches.reduce((sum, e) => sum + (e["watch time (sec)"] || 0), 0);
294
- const lastWatch = watches[watches.length - 1];
295
- record.push({
296
- event: "binge_session",
297
- time: dayjs(lastWatch.time).add(1, "minute").toISOString(),
298
- user_id: lastWatch.user_id,
299
- videos_watched: watches.length,
300
- total_watch_time_sec: totalWatchTime,
301
- avg_watch_time_sec: Math.round(totalWatchTime / watches.length)
302
- });
303
- }
304
- return record;
305
- }
306
-
307
- return record;
308
- }
309
- };
310
-
311
-
312
-
313
- function makeHashTags() {
314
- const possibleHashtags = [];
315
- for (let i = 0; i < 20; i++) {
316
- possibleHashtags.push('#' + v.makeName(2, ''));
317
- }
318
-
319
- const numHashtags = integer(integer(1, 5), integer(5, 10));
320
- const hashtags = [];
321
- for (let i = 0; i < numHashtags; i++) {
322
- hashtags.push(chance.pickone(possibleHashtags));
323
- }
324
- return [hashtags];
325
- };
326
-
327
- function makeProducts(maxItems = 10) {
328
- return function () {
329
- const categories = ["Device Accessories", "eBooks", "Automotive", "Baby Products", "Beauty", "Books", "Camera & Photo", "Cell Phones & Accessories", "Collectible Coins", "Consumer Electronics", "Entertainment Collectibles", "Fine Art", "Grocery & Gourmet Food", "Health & Personal Care", "Home & Garden", "Independent Design", "Industrial & Scientific", "Accessories", "Major Appliances", "Music", "Musical Instruments", "Office Products", "Outdoors", "Personal Computers", "Pet Supplies", "Software", "Sports", "Sports Collectibles", "Tools & Home Improvement", "Toys & Games", "Video, DVD & Blu-ray", "Video Games", "Watches"];
330
- const slugs = ['/sale/', '/featured/', '/home/', '/search/', '/wishlist/', '/'];
331
- const assetExtension = ['.png', '.jpg', '.jpeg', '.heic', '.mp4', '.mov', '.avi'];
332
- const data = [];
333
- const numOfItems = integer(1, 12);
334
-
335
- for (var i = 0; i < numOfItems; i++) {
336
- const category = chance.pickone(categories);
337
- const slug = chance.pickone(slugs);
338
- const asset = chance.pickone(assetExtension);
339
- const product_id = chance.guid();
340
- const price = integer(1, 300);
341
- const quantity = integer(1, 5);
342
-
343
- const item = {
344
- product_id: product_id,
345
- sku: integer(11111, 99999),
346
- amount: price,
347
- quantity: quantity,
348
- value: price * quantity,
349
- featured: chance.pickone([true, false]),
350
- category: category,
351
- urlSlug: slug + category,
352
- asset: `${category}-${integer(1, 20)}${asset}`
353
- };
354
-
355
- data.push(item);
356
- }
357
-
358
- return [data];
359
- };
360
- };
361
-
362
-
363
- function designExperiment() {
364
- return function () {
365
- const variants = ["A", "B", "C", "Control"];
366
- const variant = chance.pickone(variants);
367
- const experiments = ["no password", "social sign in", "new tutorial", "new search"];
368
- const experiment = chance.pickone(experiments);
369
- const multi_variates = ["A/B", "A/B/C", "A/B/C/D", "Control"];
370
- const multi_variate = chance.pickone(multi_variates);
371
- const impression_id = chance.guid();
372
-
373
-
374
-
375
- const chosen = {
376
- variant,
377
- experiment,
378
- multi_variate,
379
- impression_id
380
- };
381
-
382
- return [chosen];
383
- };
384
- }
385
-
386
-
387
-
388
-
389
-
390
-
391
- export default config;