make-mp-data 1.5.53 → 1.5.55

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.
@@ -15,7 +15,7 @@
15
15
  "request": "launch",
16
16
  "name": "run dungeon",
17
17
  "runtimeExecutable": "nodemon",
18
- "runtimeArgs": ["--inspect"],
18
+ "runtimeArgs": ["--inspect", "--ignore", "./data"],
19
19
  "program": "${workspaceFolder}/index.js",
20
20
  "args": ["--ignore", "./data/*", "${file}"],
21
21
  "restart": true,
@@ -23,6 +23,7 @@
23
23
  "internalConsoleOptions": "neverOpen",
24
24
  "skipFiles": ["<node_internals>/**"],
25
25
  "preLaunchTask": "npm: prune",
26
+
26
27
  },
27
28
  {
28
29
  "type": "node",
@@ -35,7 +36,8 @@
35
36
  "internalConsoleOptions": "neverOpen",
36
37
  "env": {
37
38
  "NODE_ENV": "dev"
38
- }
39
+ },
40
+ "runtimeArgs": ["--ignore", "./data"],
39
41
  },
40
42
  {
41
43
  "command": "npm run func:local",
package/components/ai.js CHANGED
@@ -70,7 +70,7 @@ function validator(schema) {
70
70
  if (!schema) valid = false;
71
71
 
72
72
  //must have 3 or more events
73
- if (schema.events.length < 3) valid = false;
73
+ if (schema?.events?.length < 3) valid = false;
74
74
 
75
75
  //must have 2 or more superProps
76
76
  if (Object.keys(schema.superProps).length < 2) valid = false;
@@ -83,7 +83,35 @@ function validator(schema) {
83
83
 
84
84
 
85
85
  if (require.main === module) {
86
- generateSchema(`a dungeons and dragons inspired game where players can create characters, join parties, and go on quests and fight bosses!`)
86
+ generateSchema(`https://apps.apple.com/us/app/call-guardian-for-us-cellular/id1228680023 call guardian is an app for blocking spam calls made by TNS
87
+
88
+ this is the list of events we want:
89
+
90
+ Onboarding Started
91
+ Onboarding Completed (Basic)
92
+ Onboarding Completed (Premium)
93
+ Page Views (all "screens" within the app")
94
+ Enable/Disable High Risk Blocking
95
+ Enable/Disable Medium Risk Blocking
96
+ Enable/Disable Neighborhood Spoof Blocking
97
+ Call Blocked (Spam)
98
+ Call Blocked (Custom List)
99
+ Branded Call w/o Logo Received
100
+ Branded Call w/ Logo Received
101
+ Branded Call Answered
102
+ Branded Call Blocked
103
+ Enable/Disable Text Spam
104
+ Reverse Number Lookup
105
+ Report as Spam
106
+ Report as Not Spam
107
+ Custom Block List Number Add
108
+ Custom Block List Number Remove
109
+ Call Arrives Before Push
110
+ Error Scenarios
111
+ User Can't Authenticate
112
+ Xfinity Services Can't Connect
113
+ Verizon Services Can't Connect
114
+ Deep Links into app`)
87
115
  .then((result) => {
88
116
  if (NODE_ENV === "dev") debugger;
89
117
  })
package/components/cli.js CHANGED
@@ -47,8 +47,7 @@ DATA MODEL: https://github.com/ak--47/make-mp-data/blob/main/default.js
47
47
  type: 'string'
48
48
  })
49
49
  .option("format", {
50
- demandOption: false,
51
- default: 'json',
50
+ demandOption: false,
52
51
  alias: 'f',
53
52
  describe: 'csv or json',
54
53
  type: 'string'
@@ -604,6 +604,306 @@ const locations = [
604
604
  "region": "Oklahoma",
605
605
  "city": "Oklahoma City"
606
606
  },
607
+ {
608
+ "country": "United States",
609
+ "country_code": "US",
610
+ "region": "Alabama",
611
+ "city": "Birmingham"
612
+ },
613
+ {
614
+ "country": "United States",
615
+ "country_code": "US",
616
+ "region": "Alaska",
617
+ "city": "Anchorage"
618
+ },
619
+ {
620
+ "country": "United States",
621
+ "country_code": "US",
622
+ "region": "Arizona",
623
+ "city": "Tucson"
624
+ },
625
+ {
626
+ "country": "United States",
627
+ "country_code": "US",
628
+ "region": "Arkansas",
629
+ "city": "Little Rock"
630
+ },
631
+ {
632
+ "country": "United States",
633
+ "country_code": "US",
634
+ "region": "California",
635
+ "city": "Long Beach"
636
+ },
637
+ {
638
+ "country": "United States",
639
+ "country_code": "US",
640
+ "region": "Colorado",
641
+ "city": "Colorado Springs"
642
+ },
643
+ {
644
+ "country": "United States",
645
+ "country_code": "US",
646
+ "region": "Connecticut",
647
+ "city": "Hartford"
648
+ },
649
+ {
650
+ "country": "United States",
651
+ "country_code": "US",
652
+ "region": "Delaware",
653
+ "city": "Wilmington"
654
+ },
655
+ {
656
+ "country": "United States",
657
+ "country_code": "US",
658
+ "region": "Florida",
659
+ "city": "Miami"
660
+ },
661
+ {
662
+ "country": "United States",
663
+ "country_code": "US",
664
+ "region": "Georgia",
665
+ "city": "Atlanta"
666
+ },
667
+ {
668
+ "country": "United States",
669
+ "country_code": "US",
670
+ "region": "Hawaii",
671
+ "city": "Honolulu"
672
+ },
673
+ {
674
+ "country": "United States",
675
+ "country_code": "US",
676
+ "region": "Idaho",
677
+ "city": "Boise"
678
+ },
679
+ {
680
+ "country": "United States",
681
+ "country_code": "US",
682
+ "region": "Illinois",
683
+ "city": "Naperville"
684
+ },
685
+ {
686
+ "country": "United States",
687
+ "country_code": "US",
688
+ "region": "Indiana",
689
+ "city": "Fort Wayne"
690
+ },
691
+ {
692
+ "country": "United States",
693
+ "country_code": "US",
694
+ "region": "Iowa",
695
+ "city": "Des Moines"
696
+ },
697
+ {
698
+ "country": "United States",
699
+ "country_code": "US",
700
+ "region": "Kansas",
701
+ "city": "Wichita"
702
+ },
703
+ {
704
+ "country": "United States",
705
+ "country_code": "US",
706
+ "region": "Kentucky",
707
+ "city": "Louisville"
708
+ },
709
+ {
710
+ "country": "United States",
711
+ "country_code": "US",
712
+ "region": "Louisiana",
713
+ "city": "New Orleans"
714
+ },
715
+ {
716
+ "country": "United States",
717
+ "country_code": "US",
718
+ "region": "Maine",
719
+ "city": "Portland"
720
+ },
721
+ {
722
+ "country": "United States",
723
+ "country_code": "US",
724
+ "region": "Maryland",
725
+ "city": "Baltimore"
726
+ },
727
+ {
728
+ "country": "United States",
729
+ "country_code": "US",
730
+ "region": "Massachusetts",
731
+ "city": "Boston"
732
+ },
733
+ {
734
+ "country": "United States",
735
+ "country_code": "US",
736
+ "region": "Michigan",
737
+ "city": "Detroit"
738
+ },
739
+ {
740
+ "country": "United States",
741
+ "country_code": "US",
742
+ "region": "Minnesota",
743
+ "city": "Minneapolis"
744
+ },
745
+ {
746
+ "country": "United States",
747
+ "country_code": "US",
748
+ "region": "Mississippi",
749
+ "city": "Jackson"
750
+ },
751
+ {
752
+ "country": "United States",
753
+ "country_code": "US",
754
+ "region": "Missouri",
755
+ "city": "Kansas City"
756
+ },
757
+ {
758
+ "country": "United States",
759
+ "country_code": "US",
760
+ "region": "Montana",
761
+ "city": "Billings"
762
+ },
763
+ {
764
+ "country": "United States",
765
+ "country_code": "US",
766
+ "region": "Nebraska",
767
+ "city": "Omaha"
768
+ },
769
+ {
770
+ "country": "United States",
771
+ "country_code": "US",
772
+ "region": "Nevada",
773
+ "city": "Reno"
774
+ },
775
+ {
776
+ "country": "United States",
777
+ "country_code": "US",
778
+ "region": "New Hampshire",
779
+ "city": "Manchester"
780
+ },
781
+ {
782
+ "country": "United States",
783
+ "country_code": "US",
784
+ "region": "New Jersey",
785
+ "city": "Newark"
786
+ },
787
+ {
788
+ "country": "United States",
789
+ "country_code": "US",
790
+ "region": "New Mexico",
791
+ "city": "Albuquerque"
792
+ },
793
+ {
794
+ "country": "United States",
795
+ "country_code": "US",
796
+ "region": "New York",
797
+ "city": "Buffalo"
798
+ },
799
+ {
800
+ "country": "United States",
801
+ "country_code": "US",
802
+ "region": "North Carolina",
803
+ "city": "Charlotte"
804
+ },
805
+ {
806
+ "country": "United States",
807
+ "country_code": "US",
808
+ "region": "North Dakota",
809
+ "city": "Fargo"
810
+ },
811
+ {
812
+ "country": "United States",
813
+ "country_code": "US",
814
+ "region": "Ohio",
815
+ "city": "Cleveland"
816
+ },
817
+ {
818
+ "country": "United States",
819
+ "country_code": "US",
820
+ "region": "Oklahoma",
821
+ "city": "Tulsa"
822
+ },
823
+ {
824
+ "country": "United States",
825
+ "country_code": "US",
826
+ "region": "Oregon",
827
+ "city": "Salem"
828
+ },
829
+ {
830
+ "country": "United States",
831
+ "country_code": "US",
832
+ "region": "Pennsylvania",
833
+ "city": "Pittsburgh"
834
+ },
835
+ {
836
+ "country": "United States",
837
+ "country_code": "US",
838
+ "region": "Rhode Island",
839
+ "city": "Providence"
840
+ },
841
+ {
842
+ "country": "United States",
843
+ "country_code": "US",
844
+ "region": "South Carolina",
845
+ "city": "Columbia"
846
+ },
847
+ {
848
+ "country": "United States",
849
+ "country_code": "US",
850
+ "region": "South Dakota",
851
+ "city": "Sioux Falls"
852
+ },
853
+ {
854
+ "country": "United States",
855
+ "country_code": "US",
856
+ "region": "Tennessee",
857
+ "city": "Knoxville"
858
+ },
859
+ {
860
+ "country": "United States",
861
+ "country_code": "US",
862
+ "region": "Texas",
863
+ "city": "El Paso"
864
+ },
865
+ {
866
+ "country": "United States",
867
+ "country_code": "US",
868
+ "region": "Utah",
869
+ "city": "Salt Lake City"
870
+ },
871
+ {
872
+ "country": "United States",
873
+ "country_code": "US",
874
+ "region": "Vermont",
875
+ "city": "Burlington"
876
+ },
877
+ {
878
+ "country": "United States",
879
+ "country_code": "US",
880
+ "region": "Virginia",
881
+ "city": "Virginia Beach"
882
+ },
883
+ {
884
+ "country": "United States",
885
+ "country_code": "US",
886
+ "region": "Washington",
887
+ "city": "Tacoma"
888
+ },
889
+ {
890
+ "country": "United States",
891
+ "country_code": "US",
892
+ "region": "West Virginia",
893
+ "city": "Charleston"
894
+ },
895
+ {
896
+ "country": "United States",
897
+ "country_code": "US",
898
+ "region": "Wisconsin",
899
+ "city": "Milwaukee"
900
+ },
901
+ {
902
+ "country": "United States",
903
+ "country_code": "US",
904
+ "region": "Wyoming",
905
+ "city": "Cheyenne"
906
+ },
607
907
  {
608
908
  "country": "China",
609
909
  "country_code": "CN",
@@ -6,7 +6,7 @@ const { spawn } = require('child_process');
6
6
  const dayjs = require('dayjs');
7
7
  const utc = require('dayjs/plugin/utc');
8
8
  const path = require('path');
9
- const { mkdir } = require('ak-tools');
9
+ const { mkdir, parseGCSUri } = require('ak-tools');
10
10
  const { existsSync } = require('fs');
11
11
  dayjs.extend(utc);
12
12
  require('dotenv').config();
@@ -26,6 +26,11 @@ let chanceInitialized = false;
26
26
  const ACTUAL_NOW = dayjs.utc();
27
27
 
28
28
 
29
+ const { Storage: cloudStorage } = require('@google-cloud/storage');
30
+ const projectId = 'YOUR_PROJECT_ID';
31
+ const storage = new cloudStorage({ projectId });
32
+
33
+
29
34
  /*
30
35
  ----
31
36
  RNG
@@ -184,10 +189,10 @@ function choose(value) {
184
189
  try {
185
190
  // Keep resolving the value if it's a function
186
191
  while (typeof value === 'function') {
187
- value = value();
192
+ value = value();
188
193
  }
189
194
 
190
-
195
+
191
196
  // [[],[],[]] should pick one
192
197
  if (Array.isArray(value) && Array.isArray(value[0])) {
193
198
  return chance.pickone(value);
@@ -434,23 +439,38 @@ STREAMERS
434
439
  ----
435
440
  */
436
441
 
437
- function streamJSON(path, data) {
442
+ function streamJSON(filePath, data) {
438
443
  return new Promise((resolve, reject) => {
439
- const writeStream = fs.createWriteStream(path, { encoding: 'utf8' });
444
+ let writeStream;
445
+ if (filePath?.startsWith('gs://')) {
446
+ const { uri, bucket, file } = parseGCSUri(filePath);
447
+ writeStream = storage.bucket(bucket).file(file).createWriteStream({ gzip: true });
448
+ }
449
+ else {
450
+ writeStream = fs.createWriteStream(filePath, { encoding: 'utf8' });
451
+ }
440
452
  data.forEach(item => {
441
453
  writeStream.write(JSON.stringify(item) + '\n');
442
454
  });
443
455
  writeStream.end();
444
456
  writeStream.on('finish', () => {
445
- resolve(path);
457
+ resolve(filePath);
446
458
  });
447
459
  writeStream.on('error', reject);
448
460
  });
449
461
  }
450
462
 
451
- function streamCSV(path, data) {
463
+ function streamCSV(filePath, data) {
452
464
  return new Promise((resolve, reject) => {
453
- const writeStream = fs.createWriteStream(path, { encoding: 'utf8' });
465
+ let writeStream;
466
+ if (filePath?.startsWith('gs://')) {
467
+ const { uri, bucket, file } = parseGCSUri(filePath);
468
+ writeStream = storage.bucket(bucket).file(file).createWriteStream({ gzip: true });
469
+ }
470
+ else {
471
+ writeStream = fs.createWriteStream(filePath, { encoding: 'utf8' });
472
+ }
473
+
454
474
  // Extract all unique keys from the data array
455
475
  const columns = getUniqueKeys(data); // Assuming getUniqueKeys properly retrieves all keys
456
476
 
@@ -469,7 +489,7 @@ function streamCSV(path, data) {
469
489
 
470
490
  writeStream.end();
471
491
  writeStream.on('finish', () => {
472
- resolve(path);
492
+ resolve(filePath);
473
493
  });
474
494
  writeStream.on('error', reject);
475
495
  });