make-mp-data 1.5.0 → 1.5.2
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/.gcloudignore +17 -0
- package/.vscode/launch.json +54 -19
- package/.vscode/settings.json +2 -0
- package/.vscode/tasks.json +12 -0
- package/components/ai.js +93 -0
- package/{src → components}/chart.js +14 -0
- package/{src → components}/cli.js +7 -1
- package/components/project.js +166 -0
- package/components/prompt.txt +98 -0
- package/{src → components}/utils.js +142 -41
- package/{schemas → dungeons}/adspend.js +2 -2
- package/{schemas → dungeons}/anon.js +2 -2
- package/{schemas → dungeons}/big.js +2 -2
- package/dungeons/business.js +327 -0
- package/{schemas → dungeons}/complex.js +10 -10
- package/dungeons/foobar.js +241 -0
- package/{schemas → dungeons}/funnels.js +3 -4
- package/dungeons/gaming.js +314 -0
- package/{schemas → dungeons}/mirror.js +2 -2
- package/{schemas/foobar.js → dungeons/sanity.js} +20 -27
- package/dungeons/scd.js +205 -0
- package/dungeons/session-replay.js +175 -0
- package/{schemas → dungeons}/simple.js +3 -3
- package/dungeons/userAgent.js +190 -0
- package/env.yaml +1 -0
- package/index.js +482 -167
- package/package.json +13 -6
- package/scripts/deploy.sh +11 -0
- package/scripts/jsdoctest.js +1 -1
- package/scripts/{new.sh → new-dungeon.sh} +39 -10
- package/scripts/new-project.mjs +14 -0
- package/scripts/update-deps.sh +4 -0
- package/tests/benchmark/concurrency.mjs +2 -2
- package/tests/cli.test.js +121 -0
- package/tests/e2e.test.js +134 -186
- package/tests/int.test.js +14 -12
- package/tests/jest.config.js +8 -0
- package/tests/testCases.mjs +1 -1
- package/tests/testSoup.mjs +4 -3
- package/tests/unit.test.js +16 -15
- package/tsconfig.json +1 -1
- package/types.d.ts +40 -8
- package/scripts/deps.sh +0 -3
- /package/{src → components}/defaults.js +0 -0
- /package/dungeons/{.gitkeep → customers/.gitkeep} +0 -0
- /package/scripts/{go.sh → run-index.sh} +0 -0
package/tests/int.test.js
CHANGED
|
@@ -6,7 +6,7 @@ dayjs.extend(utc);
|
|
|
6
6
|
require('dotenv').config();
|
|
7
7
|
const path = require('path');
|
|
8
8
|
|
|
9
|
-
/** @typedef {import('../types.js').
|
|
9
|
+
/** @typedef {import('../types.js').Dungeon} Config */
|
|
10
10
|
/** @typedef {import('../types.js').EventConfig} EventConfig */
|
|
11
11
|
/** @typedef {import("../types.js").EventSchema} EventSchema */
|
|
12
12
|
/** @typedef {import('../types.js').ValueValid} ValueValid */
|
|
@@ -23,7 +23,7 @@ const { generators, orchestrators, meta } = MAIN;
|
|
|
23
23
|
const { makeAdSpend, makeEvent, makeFunnel, makeProfile, makeSCD, makeMirror } = generators;
|
|
24
24
|
const { sendToMixpanel, userLoop, validateDungeonConfig } = orchestrators;
|
|
25
25
|
const { hookArray, inferFunnels } = meta;
|
|
26
|
-
const { validEvent } = require('../
|
|
26
|
+
const { validEvent } = require('../components/utils.js');
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
// Mock the global variables
|
|
@@ -31,7 +31,7 @@ let CAMPAIGNS;
|
|
|
31
31
|
let DEFAULTS;
|
|
32
32
|
let STORAGE;
|
|
33
33
|
let CONFIG;
|
|
34
|
-
const { campaigns, devices, locations } = require('../
|
|
34
|
+
const { campaigns, devices, locations } = require('../components/defaults.js');
|
|
35
35
|
|
|
36
36
|
beforeEach(async () => {
|
|
37
37
|
// Reset global variables before each test
|
|
@@ -72,7 +72,8 @@ beforeEach(async () => {
|
|
|
72
72
|
global.DEFAULTS = DEFAULTS;
|
|
73
73
|
global.STORAGE = STORAGE;
|
|
74
74
|
global.CONFIG = CONFIG;
|
|
75
|
-
|
|
75
|
+
const FIXED_NOW = dayjs('2024-02-02').unix();
|
|
76
|
+
global.FIXED_NOW = FIXED_NOW;
|
|
76
77
|
|
|
77
78
|
});
|
|
78
79
|
|
|
@@ -137,7 +138,7 @@ describe('generators', () => {
|
|
|
137
138
|
prop3: ["value5"]
|
|
138
139
|
},
|
|
139
140
|
};
|
|
140
|
-
const result = await makeEvent("known_id", dayjs().subtract(
|
|
141
|
+
const result = await makeEvent("known_id", dayjs.unix(global.FIXED_NOW).subtract(30, 'd').unix(), eventConfig, ["anon_id"], ["session_id"]);
|
|
141
142
|
expect(result).toHaveProperty('event', 'test_event');
|
|
142
143
|
expect(result).toHaveProperty('device_id', 'anon_id');
|
|
143
144
|
// expect(result).toHaveProperty('user_id', 'known_id'); // Known ID not always on the event
|
|
@@ -154,7 +155,7 @@ describe('generators', () => {
|
|
|
154
155
|
|
|
155
156
|
test('makeEvent: opt params', async () => {
|
|
156
157
|
const eventConfig = { event: "test_event", properties: {} };
|
|
157
|
-
const result = await makeEvent("known_id",
|
|
158
|
+
const result = await makeEvent("known_id",dayjs.unix(global.FIXED_NOW).subtract(30, 'd').unix(), eventConfig);
|
|
158
159
|
expect(result).toHaveProperty('event', 'test_event');
|
|
159
160
|
expect(result).toHaveProperty('user_id', 'known_id');
|
|
160
161
|
expect(result).toHaveProperty('source', 'dm4');
|
|
@@ -170,7 +171,7 @@ describe('generators', () => {
|
|
|
170
171
|
prop2: ["value3", "value4"]
|
|
171
172
|
},
|
|
172
173
|
};
|
|
173
|
-
const result = await makeEvent("known_id",
|
|
174
|
+
const result = await makeEvent("known_id",dayjs.unix(global.FIXED_NOW).subtract(30, 'd').unix(), eventConfig, ["anon_id"], ["session_id"]);
|
|
174
175
|
expect(result.prop1 === "value1" || result.prop1 === "value2").toBeTruthy();
|
|
175
176
|
expect(result.prop2 === "value3" || result.prop2 === "value4").toBeTruthy();
|
|
176
177
|
});
|
|
@@ -189,7 +190,7 @@ describe('generators', () => {
|
|
|
189
190
|
/** @type {Record<string, SCDSchema[]>} */
|
|
190
191
|
const scd = { "scd_example": [{ distinct_id: "user1", insertTime: dayjs().toISOString(), startTime: dayjs().toISOString() }] };
|
|
191
192
|
|
|
192
|
-
const [result, converted] = await makeFunnel(funnelConfig, user,
|
|
193
|
+
const [result, converted] = await makeFunnel(funnelConfig, user,dayjs.unix(global.FIXED_NOW).subtract(30, 'd').unix(), profile, scd, {});
|
|
193
194
|
expect(result.length).toBe(2);
|
|
194
195
|
expect(converted).toBe(true);
|
|
195
196
|
expect(result.every(e => validEvent(e))).toBeTruthy();
|
|
@@ -205,7 +206,7 @@ describe('generators', () => {
|
|
|
205
206
|
const profile = { created: dayjs().toISOString(), distinct_id: "user1" };
|
|
206
207
|
const scd = { "scd_example": [{ distinct_id: "user1", insertTime: dayjs().toISOString(), startTime: dayjs().toISOString() }] };
|
|
207
208
|
|
|
208
|
-
const [result, converted] = await makeFunnel(funnelConfig, user, dayjs().unix(), profile, scd, {});
|
|
209
|
+
const [result, converted] = await makeFunnel(funnelConfig, user, dayjs.unix(global.FIXED_NOW).subtract(30, 'd').unix(), profile, scd, {});
|
|
209
210
|
expect(result.length).toBeGreaterThanOrEqual(1);
|
|
210
211
|
expect(result.length).toBeLessThanOrEqual(3);
|
|
211
212
|
expect(result.every(e => validEvent(e))).toBeTruthy();
|
|
@@ -221,7 +222,7 @@ describe('generators', () => {
|
|
|
221
222
|
const profile = { created: dayjs().toISOString(), distinct_id: "user1" };
|
|
222
223
|
const scd = { "scd_example": [{ distinct_id: "user1", insertTime: dayjs().toISOString(), startTime: dayjs().toISOString() }] };
|
|
223
224
|
|
|
224
|
-
const [result, converted] = await makeFunnel(funnelConfig, user, dayjs().unix(), profile, scd, {});
|
|
225
|
+
const [result, converted] = await makeFunnel(funnelConfig, user, dayjs.unix(global.FIXED_NOW).subtract(30, 'd').unix(), profile, scd, {});
|
|
225
226
|
expect(result.length).toBe(3);
|
|
226
227
|
expect(converted).toBe(true);
|
|
227
228
|
expect(result.every(e => validEvent(e))).toBeTruthy();
|
|
@@ -490,12 +491,12 @@ describe('orchestrators', () => {
|
|
|
490
491
|
};
|
|
491
492
|
const result = await sendToMixpanel(CONFIG, STORAGE);
|
|
492
493
|
expect(result.events.success).toBe(0);
|
|
493
|
-
expect(result.users.success).toBe(0)
|
|
494
|
+
expect(result.users.success).toBe(0);
|
|
494
495
|
expect(result.groups).toHaveLength(0);
|
|
495
496
|
});
|
|
496
497
|
|
|
497
498
|
|
|
498
|
-
test('userLoop: works (no funnels)', async () => {
|
|
499
|
+
test('userLoop: works (no funnels; no inference)', async () => {
|
|
499
500
|
/** @type {Config} */
|
|
500
501
|
const config = {
|
|
501
502
|
numUsers: 2,
|
|
@@ -508,6 +509,7 @@ describe('orchestrators', () => {
|
|
|
508
509
|
hasAnonIds: false,
|
|
509
510
|
hasSessionIds: false,
|
|
510
511
|
hasLocation: false,
|
|
512
|
+
alsoInferFunnels: false,
|
|
511
513
|
events: [{ event: "foo" }, { event: "bar" }, { event: "baz" }]
|
|
512
514
|
};
|
|
513
515
|
await userLoop(config, STORAGE);
|
package/tests/jest.config.js
CHANGED
|
@@ -7,6 +7,13 @@ const jestConfig = {
|
|
|
7
7
|
verbose: isDebugMode,
|
|
8
8
|
watch: false,
|
|
9
9
|
projects: [
|
|
10
|
+
{
|
|
11
|
+
"displayName": "cli",
|
|
12
|
+
"testMatch": [
|
|
13
|
+
"<rootDir>/tests/cli.test.js"
|
|
14
|
+
],
|
|
15
|
+
maxWorkers: 1
|
|
16
|
+
},
|
|
10
17
|
{
|
|
11
18
|
"displayName": "e2e",
|
|
12
19
|
"testMatch": [
|
|
@@ -14,6 +21,7 @@ const jestConfig = {
|
|
|
14
21
|
],
|
|
15
22
|
// @ts-ignore
|
|
16
23
|
maxWorkers: 1
|
|
24
|
+
|
|
17
25
|
|
|
18
26
|
},
|
|
19
27
|
{
|
package/tests/testCases.mjs
CHANGED
package/tests/testSoup.mjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { generateLineChart } from '../
|
|
2
|
-
import { TimeSoup } from '../
|
|
1
|
+
import { generateLineChart } from '../components/chart.js';
|
|
2
|
+
import { TimeSoup } from '../components/utils.js';
|
|
3
3
|
import dayjs from 'dayjs';
|
|
4
4
|
import { progress } from 'ak-tools';
|
|
5
5
|
import TEST_CASES from './testCases.mjs';
|
|
6
|
+
|
|
6
7
|
import execSync from 'child_process';
|
|
7
8
|
|
|
8
9
|
async function genViz(soup) {
|
|
@@ -12,7 +13,7 @@ async function genViz(soup) {
|
|
|
12
13
|
const end = dayjs().unix();
|
|
13
14
|
console.log(`\n\nTEST CASE: ${name}\n\n`);
|
|
14
15
|
for (let i = 0; i < 100_000; i++) {
|
|
15
|
-
progress('processing', i);
|
|
16
|
+
progress([['processing', i]]);
|
|
16
17
|
const time = TimeSoup(start, end, peaks, deviation, mean);
|
|
17
18
|
data.push({ time });
|
|
18
19
|
}
|
package/tests/unit.test.js
CHANGED
|
@@ -6,7 +6,7 @@ const u = require('ak-tools');
|
|
|
6
6
|
dayjs.extend(utc);
|
|
7
7
|
require('dotenv').config();
|
|
8
8
|
|
|
9
|
-
/** @typedef {import('../types').
|
|
9
|
+
/** @typedef {import('../types').Dungeon} Config */
|
|
10
10
|
/** @typedef {import('../types').EventConfig} EventConfig */
|
|
11
11
|
/** @typedef {import('../types').ValueValid} ValueValid */
|
|
12
12
|
/** @typedef {import('../types').HookedArray} hookArray */
|
|
@@ -57,7 +57,7 @@ const {
|
|
|
57
57
|
|
|
58
58
|
datesBetween,
|
|
59
59
|
weighChoices
|
|
60
|
-
} = require('../
|
|
60
|
+
} = require('../components/utils.js');
|
|
61
61
|
|
|
62
62
|
const main = require('../index.js');
|
|
63
63
|
//todo: test for funnel inference
|
|
@@ -283,7 +283,7 @@ describe('generation', () => {
|
|
|
283
283
|
const user = generateUser('uuid-123', { numDays });
|
|
284
284
|
const createdDate = dayjs(user.created, 'YYYY-MM-DD');
|
|
285
285
|
expect(createdDate.isValid()).toBeTruthy();
|
|
286
|
-
expect(createdDate.isBefore(dayjs
|
|
286
|
+
expect(createdDate.isBefore(dayjs())).toBeTruthy();
|
|
287
287
|
});
|
|
288
288
|
|
|
289
289
|
|
|
@@ -393,7 +393,8 @@ describe('generation', () => {
|
|
|
393
393
|
describe('validation', () => {
|
|
394
394
|
|
|
395
395
|
beforeAll(() => {
|
|
396
|
-
global.
|
|
396
|
+
global.FIXED_NOW = 1672531200; // fixed point in time for testing
|
|
397
|
+
global.FIXED_BEGIN = global.FIXED_NOW - (60 * 60 * 24 * 30); // 30 days ago
|
|
397
398
|
});
|
|
398
399
|
|
|
399
400
|
test('events: non arrays', () => {
|
|
@@ -438,33 +439,33 @@ describe('validation', () => {
|
|
|
438
439
|
});
|
|
439
440
|
|
|
440
441
|
test('time: between', () => {
|
|
441
|
-
const chosenTime = global.
|
|
442
|
-
const earliestTime = global.
|
|
443
|
-
const latestTime = global.
|
|
442
|
+
const chosenTime = global.FIXED_NOW - (60 * 60 * 24 * 15); // 15 days ago
|
|
443
|
+
const earliestTime = global.FIXED_NOW - (60 * 60 * 24 * 30); // 30 days ago
|
|
444
|
+
const latestTime = global.FIXED_NOW;
|
|
444
445
|
expect(validTime(chosenTime, earliestTime, latestTime)).toBe(true);
|
|
445
446
|
});
|
|
446
447
|
|
|
447
448
|
test('time: outside earliest', () => {
|
|
448
|
-
const chosenTime = global.
|
|
449
|
-
const earliestTime = global.
|
|
450
|
-
const latestTime = global.
|
|
449
|
+
const chosenTime = global.FIXED_NOW - (60 * 60 * 24 * 31); // 31 days ago
|
|
450
|
+
const earliestTime = global.FIXED_NOW - (60 * 60 * 24 * 30); // 30 days ago
|
|
451
|
+
const latestTime = global.FIXED_NOW;
|
|
451
452
|
expect(validTime(chosenTime, earliestTime, latestTime)).toBe(false);
|
|
452
453
|
});
|
|
453
454
|
|
|
454
455
|
test('time: outside latest', () => {
|
|
455
456
|
const chosenTime = -1;
|
|
456
|
-
const earliestTime = global.
|
|
457
|
-
const latestTime = global.
|
|
457
|
+
const earliestTime = global.FIXED_NOW - (60 * 60 * 24 * 30); // 30 days ago
|
|
458
|
+
const latestTime = global.FIXED_NOW;
|
|
458
459
|
expect(validTime(chosenTime, earliestTime, latestTime)).toBe(false);
|
|
459
460
|
});
|
|
460
461
|
|
|
461
462
|
test('time: inference in', () => {
|
|
462
|
-
const chosenTime = global.
|
|
463
|
+
const chosenTime = global.FIXED_NOW - (60 * 60 * 24 * 15); // 15 days ago
|
|
463
464
|
expect(validTime(chosenTime)).toBe(true);
|
|
464
465
|
});
|
|
465
466
|
|
|
466
467
|
test('time: inference out', () => {
|
|
467
|
-
const chosenTime = global.
|
|
468
|
+
const chosenTime = global.FIXED_NOW - (60 * 60 * 24 * 31); // 31 days ago
|
|
468
469
|
expect(validTime(chosenTime)).toBe(false);
|
|
469
470
|
});
|
|
470
471
|
});
|
|
@@ -547,7 +548,7 @@ describe('utilities', () => {
|
|
|
547
548
|
test('date: future', () => {
|
|
548
549
|
const futureDate = date(10, false, 'YYYY-MM-DD')();
|
|
549
550
|
expect(dayjs(futureDate, 'YYYY-MM-DD').isValid()).toBeTruthy();
|
|
550
|
-
expect(dayjs(futureDate).isAfter(dayjs.unix(global.
|
|
551
|
+
expect(dayjs(futureDate).isAfter(dayjs.unix(global.FIXED_NOW))).toBeTruthy();
|
|
551
552
|
});
|
|
552
553
|
|
|
553
554
|
test('dates: pairs', () => {
|
package/tsconfig.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
},
|
|
12
12
|
"include": [
|
|
13
13
|
"**/*.js"
|
|
14
|
-
, "soupTemplates.mjs", "tests/testSoup.mjs", "tests/testCases.mjs", "tests/benchmark/concurrency.mjs" ],
|
|
14
|
+
, "soupTemplates.mjs", "tests/testSoup.mjs", "tests/testCases.mjs", "tests/benchmark/concurrency.mjs", "dungeons/customers/pos.mjs", "scripts/new-project.mjs" ],
|
|
15
15
|
"exclude": [
|
|
16
16
|
"node_modules"
|
|
17
17
|
]
|
package/types.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ declare namespace main {
|
|
|
12
12
|
/**
|
|
13
13
|
* main config object for the entire data generation
|
|
14
14
|
*/
|
|
15
|
-
export interface
|
|
15
|
+
export interface Dungeon {
|
|
16
16
|
// constants
|
|
17
17
|
token?: string;
|
|
18
18
|
seed?: string;
|
|
@@ -23,9 +23,13 @@ declare namespace main {
|
|
|
23
23
|
numUsers?: number;
|
|
24
24
|
format?: "csv" | "json" | string;
|
|
25
25
|
region?: "US" | "EU";
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
concurrency?: number;
|
|
27
|
+
batchSize?: number;
|
|
28
28
|
|
|
29
|
+
serviceAccount?: string;
|
|
30
|
+
serviceSecret?: string;
|
|
31
|
+
projectId?: string;
|
|
32
|
+
|
|
29
33
|
// ids
|
|
30
34
|
simulationName?: string;
|
|
31
35
|
name?: string;
|
|
@@ -44,6 +48,7 @@ declare namespace main {
|
|
|
44
48
|
verbose?: boolean;
|
|
45
49
|
hasAnonIds?: boolean;
|
|
46
50
|
hasSessionIds?: boolean;
|
|
51
|
+
alsoInferFunnels?: boolean;
|
|
47
52
|
makeChart?: boolean | string;
|
|
48
53
|
|
|
49
54
|
//models
|
|
@@ -51,18 +56,34 @@ declare namespace main {
|
|
|
51
56
|
superProps?: Record<string, ValueValid>;
|
|
52
57
|
funnels?: Funnel[];
|
|
53
58
|
userProps?: Record<string, ValueValid>;
|
|
54
|
-
scdProps?: Record<string,
|
|
59
|
+
scdProps?: Record<string, SCDProp>;
|
|
55
60
|
mirrorProps?: Record<string, MirrorProps>;
|
|
56
61
|
groupKeys?: [string, number][] | [string, number, string[]][]; // [key, numGroups, [events]]
|
|
57
62
|
groupProps?: Record<string, Record<string, ValueValid>>;
|
|
63
|
+
groupEvents?: GroupEventConfig[];
|
|
58
64
|
lookupTables?: LookupTableSchema[];
|
|
59
65
|
soup?: soup;
|
|
60
66
|
hook?: Hook<any>;
|
|
61
67
|
|
|
62
68
|
//allow anything to be on the config
|
|
63
69
|
[key: string]: any;
|
|
70
|
+
|
|
71
|
+
//probabilities
|
|
72
|
+
percentUsersBornInDataset?: number;
|
|
64
73
|
}
|
|
65
74
|
|
|
75
|
+
export type complexSCDProp = {
|
|
76
|
+
type: string;
|
|
77
|
+
frequency: "day" | "week" | "month" | "year";
|
|
78
|
+
values: ValueValid;
|
|
79
|
+
timing: "fixed" | "fuzzy";
|
|
80
|
+
max?: number;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export type SimpleSCDProp = string[];
|
|
84
|
+
|
|
85
|
+
export type SCDProp = complexSCDProp | SimpleSCDProp;
|
|
86
|
+
|
|
66
87
|
/**
|
|
67
88
|
* the soup is a set of parameters that determine the distribution of events over time
|
|
68
89
|
*/
|
|
@@ -81,11 +102,14 @@ declare namespace main {
|
|
|
81
102
|
| "group"
|
|
82
103
|
| "lookup"
|
|
83
104
|
| "scd"
|
|
105
|
+
| "scd-pre"
|
|
84
106
|
| "mirror"
|
|
85
107
|
| "funnel-pre"
|
|
86
108
|
| "funnel-post"
|
|
87
109
|
| "ad-spend"
|
|
88
110
|
| "churn"
|
|
111
|
+
| "group-event"
|
|
112
|
+
| "everything"
|
|
89
113
|
| "";
|
|
90
114
|
|
|
91
115
|
/**
|
|
@@ -98,7 +122,7 @@ declare namespace main {
|
|
|
98
122
|
type?: hookTypes;
|
|
99
123
|
filename?: string;
|
|
100
124
|
format?: "csv" | "json" | string;
|
|
101
|
-
|
|
125
|
+
concurrency?: number;
|
|
102
126
|
[key: string]: any;
|
|
103
127
|
}
|
|
104
128
|
|
|
@@ -106,10 +130,10 @@ declare namespace main {
|
|
|
106
130
|
* an enriched array is an array that has a hookPush method that can be used to transform-then-push items into the array
|
|
107
131
|
*/
|
|
108
132
|
export interface HookedArray<T> extends Array<T> {
|
|
109
|
-
hookPush: (item: T | T[]) => any;
|
|
133
|
+
hookPush: (item: T | T[], ...meta) => any;
|
|
110
134
|
flush: () => void;
|
|
111
135
|
getWriteDir: () => string;
|
|
112
|
-
|
|
136
|
+
getWritePath: () => string;
|
|
113
137
|
[key: string]: any;
|
|
114
138
|
}
|
|
115
139
|
|
|
@@ -132,6 +156,7 @@ declare namespace main {
|
|
|
132
156
|
groupProfilesData?: HookedArray<GroupProfileSchema>[];
|
|
133
157
|
lookupTableData?: HookedArray<LookupTableSchema>[];
|
|
134
158
|
scdTableData?: HookedArray<SCDSchema>[];
|
|
159
|
+
groupEventData?: HookedArray<EventSchema>;
|
|
135
160
|
}
|
|
136
161
|
|
|
137
162
|
/**
|
|
@@ -146,6 +171,13 @@ declare namespace main {
|
|
|
146
171
|
relativeTimeMs?: number;
|
|
147
172
|
}
|
|
148
173
|
|
|
174
|
+
export interface GroupEventConfig extends EventConfig {
|
|
175
|
+
frequency: number; //how often the event occurs (in days)
|
|
176
|
+
group_key: string; //the key that the group is based on
|
|
177
|
+
attribute_to_user: boolean; //if true, the event also goes to a user
|
|
178
|
+
group_size: number; //the number of users in the group
|
|
179
|
+
}
|
|
180
|
+
|
|
149
181
|
/**
|
|
150
182
|
* the generated event data
|
|
151
183
|
*/
|
|
@@ -323,6 +355,6 @@ declare namespace main {
|
|
|
323
355
|
* const gen = require('make-mp-data')
|
|
324
356
|
* const dta = gen({writeToDisk: false})
|
|
325
357
|
*/
|
|
326
|
-
declare function main(config: main.
|
|
358
|
+
declare function main(config: main.Dungeon): Promise<main.Result>;
|
|
327
359
|
|
|
328
360
|
export = main;
|
package/scripts/deps.sh
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|