make-mp-data 1.1.13 → 1.1.15

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/e2e.test.js CHANGED
@@ -3,7 +3,7 @@
3
3
  /* eslint-disable no-undef */
4
4
  /* eslint-disable no-debugger */
5
5
  /* eslint-disable no-unused-vars */
6
- const { generate } = require('./index.js');
6
+ const generate = require('./index.js');
7
7
  require('dotenv').config();
8
8
  const { execSync } = require("child_process");
9
9
  const u = require('ak-tools');
@@ -52,7 +52,7 @@ describe('e2e', () => {
52
52
 
53
53
  const invalidEvents = eventData.filter(e => !validateEvent(e));
54
54
  const invalidUsers = userProfilesData.filter(u => !validateUser(u));
55
-
55
+
56
56
  expect(areEventsValid).toBe(true);
57
57
  expect(areUsersValid).toBe(true);
58
58
  }, timeout);
package/index.js CHANGED
@@ -96,7 +96,7 @@ async function main(config) {
96
96
  log(`------------------SETUP------------------`, "\n");
97
97
 
98
98
 
99
- //the function which generates $distinct_id + $anonymoud_ids, $session_ids, and $created, skewing towards the present
99
+ //the function which generates $distinct_id + $anonymous_ids, $session_ids, and $created, skewing towards the present
100
100
  function generateUser() {
101
101
  const distinct_id = uuidChance.guid();
102
102
  let z = boxMullerRandom();
@@ -575,21 +575,7 @@ if (require.main === module) {
575
575
  openFinder(path.resolve("./data"));
576
576
  });
577
577
  } else {
578
- module.exports = {
579
- generate: main,
580
- weightedRange,
581
- pick,
582
- day,
583
- integer,
584
- makeProducts,
585
- date,
586
- progress,
587
- person,
588
- choose,
589
- range,
590
- exhaust,
591
- openFinder,
592
- };
578
+ module.exports = main;
593
579
  }
594
580
 
595
581
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "make-mp-data",
3
- "version": "1.1.13",
3
+ "version": "1.1.15",
4
4
  "description": "builds all mixpanel primitives for a given project",
5
5
  "main": "index.js",
6
6
  "types": "types.d.ts",
@@ -38,10 +38,11 @@
38
38
  },
39
39
  "homepage": "https://github.com/ak--47/make-mp-data#readme",
40
40
  "dependencies": {
41
- "ak-tools": "^1.0.53",
42
- "chance": "^1.1.7",
43
- "dayjs": "^1.11.10",
44
- "mixpanel-import": "^2.5.5",
41
+ "ak-tools": "^1.0.55",
42
+ "chance": "^1.1.11",
43
+ "dayjs": "^1.11.11",
44
+ "mixpanel-import": "^2.5.51",
45
+ "papaparse": "^5.4.1",
45
46
  "yargs": "^17.7.2"
46
47
  }
47
48
  }
@@ -0,0 +1,5 @@
1
+ /* eslint-disable no-unused-vars */
2
+ // @ts-check
3
+ const module = require('../index.js');
4
+
5
+ module({})
package/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // types.d.ts
1
+ declare namespace main {
2
2
 
3
3
  type primitives = string | number | boolean | Date | Object;
4
4
  type valueValid = primitives | primitives[] | (() => primitives | primitives[]);
@@ -45,3 +45,38 @@ interface LookupTable {
45
45
  [key?: string]: valueValid;
46
46
  };
47
47
  }
48
+
49
+ type Result = {
50
+ eventData: {
51
+ event: any;
52
+ $source: string;
53
+ }[];
54
+ userProfilesData: any[];
55
+ scdTableData: any[];
56
+ groupProfilesData: {
57
+ key: string;
58
+ data: any[];
59
+ }[];
60
+ lookupTableData: {
61
+ key: string;
62
+ data: any[];
63
+ }[];
64
+ import?: undefined;
65
+ files?: undefined;
66
+ }
67
+
68
+ }
69
+
70
+
71
+ /**
72
+ * Mixpanel Data Generator
73
+ * model events, users, groups, and lookup tables (and SCD props!)
74
+ * @example
75
+ * const gen = require('make-mp-data')
76
+ * const dta = gen({writeToDisk: false})
77
+ */
78
+ declare function main(
79
+ config: main.Config
80
+ ): Promise<main.Result>;
81
+ export = main;
82
+