tnp-core 18.0.39 → 18.0.42

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 (88) hide show
  1. package/README.md +20 -20
  2. package/assets/shared/shared_folder_info.txt +1 -1
  3. package/browser/README.md +24 -24
  4. package/browser/esm2022/lib/core-imports.mjs +4 -1
  5. package/browser/esm2022/lib/helpers-isomorphic.mjs +26 -30
  6. package/browser/esm2022/lib/helpers-messages.mjs +45 -16
  7. package/browser/esm2022/lib/helpers.mjs +22 -28
  8. package/browser/esm2022/lib/index.mjs +2 -2
  9. package/browser/esm2022/lib/required-global-npm-packages.mjs +79 -0
  10. package/browser/esm2022/lib/utils.mjs +308 -2
  11. package/browser/fesm2022/tnp-core.mjs +1884 -1551
  12. package/browser/fesm2022/tnp-core.mjs.map +1 -1
  13. package/browser/lib/helpers-isomorphic.d.ts +20 -0
  14. package/browser/lib/helpers-messages.d.ts +11 -0
  15. package/browser/lib/helpers.d.ts +16 -2
  16. package/browser/lib/index.d.ts +1 -1
  17. package/{websql/lib/required.d.ts → browser/lib/required-global-npm-packages.d.ts} +4 -0
  18. package/browser/lib/utils.d.ts +61 -8
  19. package/cli.backend.js +2 -2
  20. package/client/README.md +24 -24
  21. package/client/esm2022/lib/core-imports.mjs +4 -1
  22. package/client/esm2022/lib/helpers-isomorphic.mjs +26 -30
  23. package/client/esm2022/lib/helpers-messages.mjs +45 -16
  24. package/client/esm2022/lib/helpers.mjs +22 -28
  25. package/client/esm2022/lib/index.mjs +2 -2
  26. package/client/esm2022/lib/required-global-npm-packages.mjs +79 -0
  27. package/client/esm2022/lib/utils.mjs +308 -2
  28. package/client/fesm2022/tnp-core.mjs +1884 -1551
  29. package/client/fesm2022/tnp-core.mjs.map +1 -1
  30. package/client/lib/helpers-isomorphic.d.ts +20 -0
  31. package/client/lib/helpers-messages.d.ts +11 -0
  32. package/client/lib/helpers.d.ts +16 -2
  33. package/client/lib/index.d.ts +1 -1
  34. package/{browser/lib/required.d.ts → client/lib/required-global-npm-packages.d.ts} +4 -0
  35. package/client/lib/utils.d.ts +61 -8
  36. package/lib/core-cli.js +3 -3
  37. package/lib/core-cli.js.map +1 -1
  38. package/lib/core-imports.d.ts +5 -1
  39. package/lib/core-imports.js.map +1 -1
  40. package/lib/helpers-isomorphic.d.ts +20 -0
  41. package/lib/helpers-isomorphic.js +25 -35
  42. package/lib/helpers-isomorphic.js.map +1 -1
  43. package/lib/helpers-messages.d.ts +11 -0
  44. package/lib/helpers-messages.js +58 -16
  45. package/lib/helpers-messages.js.map +1 -1
  46. package/lib/helpers.d.ts +14 -0
  47. package/lib/helpers.js +33 -28
  48. package/lib/helpers.js.map +1 -1
  49. package/lib/index.d.ts +1 -1
  50. package/lib/index.js +1 -1
  51. package/lib/index.js.map +1 -1
  52. package/lib/node-chalk-mock.js +2 -2
  53. package/lib/node-path-mock.js +2 -2
  54. package/lib/{required.d.ts → required-global-npm-packages.d.ts} +6 -2
  55. package/lib/{required.js → required-global-npm-packages.js} +8 -1
  56. package/lib/required-global-npm-packages.js.map +1 -0
  57. package/lib/utils.d.ts +61 -8
  58. package/lib/utils.js +368 -3
  59. package/lib/utils.js.map +1 -1
  60. package/migrations/index.d.ts +1 -0
  61. package/migrations/index.js +6 -0
  62. package/migrations/index.js.map +1 -0
  63. package/migrations/migrations_index._auto-generated_.d.ts +0 -0
  64. package/migrations/migrations_index._auto-generated_.js +4 -0
  65. package/migrations/migrations_index._auto-generated_.js.map +1 -0
  66. package/package.json +3 -3
  67. package/taon.jsonc +65 -65
  68. package/tmp-environment.json +39 -31
  69. package/websql/README.md +24 -24
  70. package/websql/esm2022/lib/core-imports.mjs +4 -1
  71. package/websql/esm2022/lib/helpers-isomorphic.mjs +26 -29
  72. package/websql/esm2022/lib/helpers-messages.mjs +45 -16
  73. package/websql/esm2022/lib/helpers.mjs +22 -28
  74. package/websql/esm2022/lib/index.mjs +2 -2
  75. package/websql/esm2022/lib/required-global-npm-packages.mjs +79 -0
  76. package/websql/esm2022/lib/utils.mjs +307 -2
  77. package/websql/fesm2022/tnp-core.mjs +1885 -1552
  78. package/websql/fesm2022/tnp-core.mjs.map +1 -1
  79. package/websql/lib/helpers-isomorphic.d.ts +20 -0
  80. package/websql/lib/helpers-messages.d.ts +11 -0
  81. package/websql/lib/helpers.d.ts +16 -2
  82. package/websql/lib/index.d.ts +1 -1
  83. package/{client/lib/required.d.ts → websql/lib/required-global-npm-packages.d.ts} +4 -0
  84. package/websql/lib/utils.d.ts +61 -8
  85. package/browser/esm2022/lib/required.mjs +0 -72
  86. package/client/esm2022/lib/required.mjs +0 -72
  87. package/lib/required.js.map +0 -1
  88. package/websql/esm2022/lib/required.mjs +0 -72
@@ -9,8 +9,8 @@ import * as dateformat from 'dateformat';
9
9
  export { dateformat };
10
10
  import * as json5 from 'json5';
11
11
  export { json5 };
12
- import { Subject } from 'rxjs';
13
12
  import axios from 'axios';
13
+ import { Subject } from 'rxjs';
14
14
 
15
15
  let isBrowser = false;
16
16
  isBrowser = true;
@@ -594,9 +594,12 @@ const crossPlatformPath = (pathStringOrPathParts) => {
594
594
  /* */
595
595
  /* */
596
596
  /* */
597
+ /* */
598
+ /* */
599
+ /* */
597
600
  ;
598
601
  ({}); // @--end-of-file-for-module=tnp-core lib/core-imports.ts
599
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29yZS1pbXBvcnRzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vdG1wLWxpYnMtZm9yLWRpc3Qtd2Vic3FsL3RucC1jb3JlL3Byb2plY3RzL3RucC1jb3JlL3NyYy9saWIvY29yZS1pbXBvcnRzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUdBLElBQUksVUFBVSxHQUFHLEtBQUssQ0FBQztBQUN2QixLQUFLO0FBQ0wsS0FBSztBQUNMLEtBQUs7QUFDTCxLQUFLO0FBQ0wsS0FBSzt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6LztcblxuXG4gIGlmIChpc1dpbmRvd3MgJiYgcmVnZXhXaW5QYXRoMS50ZXN0KHBhdGhTdHJpbmdPclBhdGhQYXJ0cykpIHtcbiAgICBwYXRoU3RyaW5nT3JQYXRoUGFydHMgPSBwYXRoU3RyaW5nT3JQYXRoUGFydHMuc2xpY2UoMSk7XG4gIH1cblxuXG5cblxuXG5cblxuXG5cblxuXG4gIHJldHVybiBwYXRoU3RyaW5nT3JQYXRoUGFydHM7XG59O1xuXG5cblxuZXhwb3J0IHsgICBfLCAgIHEsICAgbW9tZW50LCAgIGRhdGVmb3JtYXQsICAgY3Jvc3NQbGF0Zm9ybVBhdGgsICAgd2luMzJQYXRoLCAgIHBhdGgsICAgY2hhbGssICAganNvbjUsICAgJCwgfTsvKiAqL1xuLyogKi9cbi8qICovXG4vKiAqL1xuLyogKi9cbi8qICovXG4vKiAqL1xuLyogKi9cbi8qICovXG4vKiAqL1xuLyogKi9cblxuXG4vKiAqL1xuLyogKi9cbi8qICovXG4vKiAqL1xuLyogKi9cbi8qICovXG4vKiAqL1xuLyogKi9cbi8qICovXG4vKiAqL1xuLyogKi9cbi8qICovXG4vKiAqL1xuLyogKi9cbi8qICovXG4vKiAqL1xuLyogKi9cbi8qICovXG4vKiAqL1xuLyogKi9cbi8qICovXG4vKiAqL1xuLyogKi9cbi8qICovXG4vKiAqL1xuICBcblxuXG4gOyh7fSk7IC8vIEAtLWVuZC1vZi1maWxlLWZvci1tb2R1bGU9dG5wLWNvcmUgbGliL2NvcmUtaW1wb3J0cy50cyJdfQ==
600
603
 
601
604
  var CoreModels;
602
605
  (function (CoreModels) {
@@ -722,148 +725,47 @@ var CoreModels;
722
725
  ;
723
726
  ({}); // @--end-of-file-for-module=tnp-core lib/core-models.ts
724
727
 
725
- class HelpersIsomorphic {
726
- get isBrowser() {
727
- /* */
728
- /* */
729
- return true;
730
- }
731
- get isWebSQL() {
732
- /* */
733
- /* */
734
- return true;
735
- return false;
736
- }
737
- get isNode() {
738
- /* */
739
- /* */
740
- return false;
741
- }
742
- get isElectron() {
743
- // @ts-ignore
744
- if (typeof window !== 'undefined' &&
745
- typeof window.process === 'object' &&
746
- window.process.type === 'renderer') {
747
- return true;
748
- }
749
- // @ts-ignore
750
- if (typeof process !== 'undefined' &&
751
- typeof process.versions === 'object' &&
752
- !!process.versions.electron) {
753
- return true;
754
- }
755
- if (typeof navigator === 'object' &&
756
- typeof navigator.userAgent === 'string' &&
757
- navigator.userAgent.indexOf('Electron') >= 0) {
758
- return true;
759
- }
760
- return false;
761
- }
762
- contain(arr, item) {
763
- return (arr.filter(l => {
764
- if (l instanceof RegExp) {
765
- return l.test(item);
766
- }
767
- if (l === item) {
768
- return true;
769
- }
770
- if (item.match && typeof item.match === 'function' ? item.match(l) : false) {
771
- return true;
772
- }
773
- return false;
774
- }).length > 0);
775
- }
776
- }
777
- ;
778
- ({}); // @--end-of-file-for-module=tnp-core lib/helpers-isomorphic.ts
779
-
780
- /* */
781
- /* */
782
- /* */
783
- const KEY = {
784
- LAST_ERROR: Symbol(),
785
- LAST_INFO: Symbol(),
786
- LAST_WARN: Symbol(),
787
- LAST_LOG: Symbol(),
788
- LAST_SUCCESS: Symbol(),
789
- LAST_TASK_STARTED: Symbol(),
790
- LAST_TASK_DONE: Symbol(),
791
- };
792
- const KEY_COUNT = {
793
- LAST_ERROR: Symbol(),
794
- LAST_INFO: Symbol(),
795
- LAST_WARN: Symbol(),
796
- LAST_LOG: Symbol(),
797
- LAST_SUCCESS: Symbol(),
798
- LAST_TASK_STARTED: Symbol(),
799
- LAST_TASK_DONE: Symbol(),
800
- };
801
- const KEY_IMPORTANTCE = {
802
- LAST_ERROR: Symbol(),
803
- LAST_INFO: Symbol(),
804
- LAST_WARN: Symbol(),
805
- LAST_LOG: Symbol(),
806
- LAST_SUCCESS: Symbol(),
807
- LAST_TASK_STARTED: Symbol(),
808
- LAST_TASK_DONE: Symbol(),
809
- };
810
- /* */
811
- /* */
812
- /* */
813
- /* */
814
- /* */
815
- /* */
816
728
  /* */
817
729
  /* */
818
730
  /* */
819
731
  /* */
820
- /* */
821
- /* */
822
- /* */
823
- /* */
824
- /* */
825
- /* */
826
- /* */
827
- /* */
828
- /* */
829
- /* */
830
- /* */
831
- const LIMIT = 10;
832
- class HelpersMessages extends HelpersIsomorphic {
833
- msgCacheClear() {
834
- /* */
835
- /* */
836
- /* */
837
- /* */
838
- /* */
839
- }
840
- renderError(err) {
841
- if (this.isBrowser) {
842
- console.error(err);
843
- }
844
- else {
845
- /* */
846
- /* */
847
- /* */
848
- /* */
849
- /* */
850
- /* */
851
- /* */
852
- /* */
853
- /* */
854
- }
732
+ const BLOB_SUPPORTED_IN_SQLJS = false;
733
+ var Utils;
734
+ (function (Utils) {
735
+ Utils.uniqArray = (array, uniqueProperty) => {
736
+ var seen = {};
737
+ return array
738
+ .filter(f => !!f)
739
+ .filter(function (item) {
740
+ return seen.hasOwnProperty(uniqueProperty ? item[uniqueProperty] : item)
741
+ ? false
742
+ : (seen[uniqueProperty ? item[uniqueProperty] : item] = true);
743
+ });
744
+ };
745
+ /**
746
+ * Example:
747
+ * new RegExp(escapeStringForRegEx('a.b.c'),'g') => /a\.b\.c/g
748
+ */
749
+ Utils.escapeStringForRegEx = (stringForRegExp) => {
750
+ return stringForRegExp.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
751
+ };
752
+ function removeChalkSpecialChars(str) {
753
+ const ansiRegex = /\u001b\[[0-9;]*m/g;
754
+ return str.replace(ansiRegex, '');
855
755
  }
856
- error(details, noExit = false, noTrace = false) {
857
- if (Helpers.isBrowser) {
858
- console.error(details);
859
- return;
860
- }
861
- /* */
862
- /* */
756
+ Utils.removeChalkSpecialChars = removeChalkSpecialChars;
757
+ Utils.fullDateTime = () => {
863
758
  /* */
864
759
  /* */
760
+ return (void 0);
761
+ };
762
+ Utils.fullDate = () => {
865
763
  /* */
866
764
  /* */
765
+ return (void 0);
766
+ };
767
+ const takenPorts = [];
768
+ Utils.getFreePort = async (options) => {
867
769
  /* */
868
770
  /* */
869
771
  /* */
@@ -897,8 +799,246 @@ class HelpersMessages extends HelpersIsomorphic {
897
799
  /* */
898
800
  /* */
899
801
  /* */
802
+ return (void 0);
803
+ };
804
+ let json;
805
+ (function (json) {
806
+ json.getAtrributies = (jsonDeepPath, // lodash path to property in json ex. deep.path.to.prop
807
+ fileContent) => {
808
+ const lines = fileContent.split('\n');
809
+ const pathParts = jsonDeepPath.split('.').reduce((a, b) => {
810
+ if (a.length === 0) {
811
+ return [b];
812
+ }
813
+ const last = a[a.length - 1];
814
+ if ((last.startsWith(`['`) && b.endsWith(`']`)) ||
815
+ (last.startsWith(`["`) && b.endsWith(`"]`))) {
816
+ a[a.length - 1] = [last, b].join('.');
817
+ }
818
+ else {
819
+ a.push(b);
820
+ }
821
+ return a;
822
+ }, []);
823
+ const keyName = pathParts.pop().replace(/^\["(.+)"\]$/, '$1');
824
+ let currentPath = '';
825
+ let attributes = [];
826
+ let collectedComments = [];
827
+ for (const line of lines) {
828
+ const trimmedLine = line.trim();
829
+ if (trimmedLine.startsWith('//')) {
830
+ collectedComments.push(trimmedLine);
831
+ }
832
+ else if (trimmedLine.startsWith('"') || trimmedLine.startsWith("'")) {
833
+ const match = trimmedLine.match(/["']([^"']+)["']\s*:/);
834
+ if (match) {
835
+ const key = match[1];
836
+ currentPath = currentPath
837
+ ? `${currentPath}.${key.includes('.') ? `['${key}']` : key}`
838
+ : key;
839
+ if ((currentPath.endsWith(keyName) &&
840
+ !currentPath.endsWith('/' + keyName)) ||
841
+ currentPath.endsWith(`['${keyName}']`)) {
842
+ attributes = extractAttributesFromComments(collectedComments);
843
+ break;
844
+ }
845
+ collectedComments = [];
846
+ }
847
+ }
848
+ }
849
+ return attributes;
850
+ };
851
+ const extractAttributesFromComments = (comments) => {
852
+ const attributes = [];
853
+ const attrRegex = /@(\w+)(?:\s*=\s*([^\s@]+))?/g;
854
+ for (const comment of comments) {
855
+ let match;
856
+ while ((match = attrRegex.exec(comment)) !== null) {
857
+ const [, name, value] = match;
858
+ const existingAttribute = attributes.find(attr => attr.name === `@${name}`);
859
+ if (existingAttribute) {
860
+ if (value) {
861
+ if (Array.isArray(existingAttribute.value)) {
862
+ existingAttribute.value.push(value);
863
+ }
864
+ else {
865
+ existingAttribute.value = [existingAttribute.value, value];
866
+ }
867
+ }
868
+ }
869
+ else {
870
+ attributes.push({
871
+ name: `@${name}`,
872
+ value: value ? value : true,
873
+ });
874
+ }
875
+ }
876
+ }
877
+ attributes.forEach(attr => {
878
+ if (Array.isArray(attr.value) && attr.value.length === 1) {
879
+ attr.value = attr.value[0];
880
+ }
881
+ });
882
+ return attributes;
883
+ };
884
+ })(json = Utils.json || (Utils.json = {}));
885
+ let DbBinaryFormatEnum;
886
+ (function (DbBinaryFormatEnum) {
887
+ DbBinaryFormatEnum["Blob"] = "Blob";
888
+ DbBinaryFormatEnum["File"] = "File";
889
+ DbBinaryFormatEnum["string"] = "string";
900
890
  /* */
901
891
  /* */
892
+ })(DbBinaryFormatEnum = Utils.DbBinaryFormatEnum || (Utils.DbBinaryFormatEnum = {}));
893
+ /* */
894
+ /* */
895
+ let binary;
896
+ (function (binary) {
897
+ /**
898
+ * This is for BROWSER ONLY
899
+ *
900
+ * @param buffer
901
+ * @param contentType
902
+ * @returns
903
+ */
904
+ async function arrayBufferToBlob(buffer, contentType) {
905
+ // @ts-ignore
906
+ return new Blob([buffer], { type: contentType });
907
+ }
908
+ binary.arrayBufferToBlob = arrayBufferToBlob;
909
+ /**
910
+ * This is for BROWSER ONLY
911
+ * @param blob
912
+ * @returns
913
+ */
914
+ async function blobToArrayBuffer(blob) {
915
+ return await new Promise((resolve, reject) => {
916
+ const reader = new FileReader();
917
+ reader.addEventListener('loadend', () => {
918
+ resolve(reader.result);
919
+ });
920
+ reader.addEventListener('error', reject); // @ts-ignore
921
+ reader.readAsArrayBuffer(blob);
922
+ });
923
+ }
924
+ binary.blobToArrayBuffer = blobToArrayBuffer;
925
+ /**
926
+ * it is revers to base64toBlob
927
+ * @param blob
928
+ * @returns
929
+ */
930
+ function blobToBase64(blob) {
931
+ return new Promise((resolve, _) => {
932
+ const reader = new FileReader();
933
+ reader.onloadend = () => resolve(reader.result); // @ts-ignore
934
+ reader.readAsDataURL(blob);
935
+ });
936
+ }
937
+ binary.blobToBase64 = blobToBase64;
938
+ /**
939
+ * it is revers to blobToBase64()
940
+ * @param base64Data
941
+ * @returns
942
+ */
943
+ async function base64toBlob(base64Data, contentTypeOverride) {
944
+ let content_type = void 0;
945
+ let file_base64 = void 0;
946
+ if (!contentTypeOverride) {
947
+ const m = /^data:(.+?);base64,(.+)$/.exec(base64Data);
948
+ if (!m) {
949
+ throw new Error(`[taon-framework][base64toBlob] Not a base64 blob [${base64Data}]`);
950
+ }
951
+ var [__, contenttype, filebase64] = m;
952
+ content_type = contenttype;
953
+ file_base64 = filebase64;
954
+ }
955
+ content_type = (contentTypeOverride ? contentTypeOverride : content_type || '');
956
+ base64Data = contentTypeOverride ? base64Data : file_base64;
957
+ const sliceSize = 1024;
958
+ const byteCharacters = atob(base64Data);
959
+ const bytesLength = byteCharacters.length;
960
+ const slicesCount = Math.ceil(bytesLength / sliceSize);
961
+ const byteArrays = new Array(slicesCount);
962
+ for (let sliceIndex = 0; sliceIndex < slicesCount; ++sliceIndex) {
963
+ const begin = sliceIndex * sliceSize;
964
+ const end = Math.min(begin + sliceSize, bytesLength);
965
+ const bytes = new Array(end - begin);
966
+ for (let offset = begin, i = 0; offset < end; ++i, ++offset) {
967
+ bytes[i] = byteCharacters[offset].charCodeAt(0);
968
+ }
969
+ byteArrays[sliceIndex] = new Uint8Array(bytes);
970
+ }
971
+ return new Blob(byteArrays, { type: content_type });
972
+ }
973
+ binary.base64toBlob = base64toBlob;
974
+ async function base64toDbBinaryFormat(text) {
975
+ let result;
976
+ result = await (async () => {
977
+ if (BLOB_SUPPORTED_IN_SQLJS) {
978
+ const blob = await base64toBlob(text);
979
+ return blob;
980
+ }
981
+ return text;
982
+ })();
983
+ /* */
984
+ /* */
985
+ /* */
986
+ /* */
987
+ /* */
988
+ return result;
989
+ }
990
+ binary.base64toDbBinaryFormat = base64toDbBinaryFormat;
991
+ async function dbBinaryFormatToBase64(binaryFormat) {
992
+ let result;
993
+ result = await (async () => {
994
+ if (BLOB_SUPPORTED_IN_SQLJS) {
995
+ const text = await blobToBase64(binaryFormat);
996
+ return text;
997
+ }
998
+ return binaryFormat;
999
+ })();
1000
+ /* */
1001
+ /* */
1002
+ /* */
1003
+ /* */
1004
+ /* */
1005
+ return result;
1006
+ }
1007
+ binary.dbBinaryFormatToBase64 = dbBinaryFormatToBase64;
1008
+ async function textToDbBinaryFormat(text) {
1009
+ let result;
1010
+ result = await (async () => {
1011
+ if (BLOB_SUPPORTED_IN_SQLJS) {
1012
+ const blob = await textToBlob(text);
1013
+ return blob;
1014
+ }
1015
+ return text;
1016
+ })();
1017
+ /* */
1018
+ /* */
1019
+ /* */
1020
+ /* */
1021
+ /* */
1022
+ return result;
1023
+ }
1024
+ binary.textToDbBinaryFormat = textToDbBinaryFormat;
1025
+ async function dbBinaryFormatToText(binaryFormat) {
1026
+ let result;
1027
+ result = await (async () => {
1028
+ if (BLOB_SUPPORTED_IN_SQLJS) {
1029
+ const text = await blobToText(binaryFormat);
1030
+ return text;
1031
+ }
1032
+ return binaryFormat;
1033
+ })();
1034
+ /* */
1035
+ /* */
1036
+ /* */
1037
+ /* */
1038
+ /* */
1039
+ return result;
1040
+ }
1041
+ binary.dbBinaryFormatToText = dbBinaryFormatToText;
902
1042
  /* */
903
1043
  /* */
904
1044
  /* */
@@ -908,18 +1048,26 @@ class HelpersMessages extends HelpersIsomorphic {
908
1048
  /* */
909
1049
  /* */
910
1050
  /* */
911
- }
912
- info(details, repeatable = false) {
913
1051
  /* */
914
1052
  /* */
915
1053
  /* */
916
1054
  /* */
917
1055
  /* */
918
1056
  /* */
919
- if (Helpers.isBrowser) {
920
- console.info(details);
921
- return;
1057
+ async function fileToBlob(file) {
1058
+ return new Blob([new Uint8Array(await file.arrayBuffer())], {
1059
+ type: file.type,
1060
+ });
1061
+ }
1062
+ binary.fileToBlob = fileToBlob;
1063
+ async function blobToFile(blob, nameForFile = 'my-file-name') {
1064
+ if (!nameForFile) {
1065
+ nameForFile = 'nonamefile' + new Date().getTime();
1066
+ }
1067
+ // @ts-ignore
1068
+ return new File([blob], nameForFile);
922
1069
  }
1070
+ binary.blobToFile = blobToFile;
923
1071
  /* */
924
1072
  /* */
925
1073
  /* */
@@ -946,6 +1094,80 @@ class HelpersMessages extends HelpersIsomorphic {
946
1094
  /* */
947
1095
  /* */
948
1096
  /* */
1097
+ async function textToBlob(text, type = 'text/plain') {
1098
+ const blob = new Blob([text], { type });
1099
+ return blob;
1100
+ }
1101
+ binary.textToBlob = textToBlob;
1102
+ async function blobToText(blob) {
1103
+ return await blob.text();
1104
+ }
1105
+ binary.blobToText = blobToText;
1106
+ async function textToFile(text, fileRelativePathOrName) {
1107
+ const ext = path.extname(fileRelativePathOrName);
1108
+ const type = CoreModels.mimeTypes[ext];
1109
+ const blob = new Blob([text], { type });
1110
+ const file = await blobToFile(blob, fileRelativePathOrName);
1111
+ return file;
1112
+ }
1113
+ binary.textToFile = textToFile;
1114
+ async function fileToText(file) {
1115
+ return await file.text();
1116
+ }
1117
+ binary.fileToText = fileToText;
1118
+ async function jsonToBlob(jsonObj) {
1119
+ const blob = new Blob([JSON.stringify(jsonObj, null, 2)], {
1120
+ type: 'application/json',
1121
+ });
1122
+ return blob;
1123
+ }
1124
+ binary.jsonToBlob = jsonToBlob;
1125
+ /**
1126
+ * TODO NOT TESTED
1127
+ */
1128
+ async function blobToJson(blob) {
1129
+ return JSON.parse(await blob.text());
1130
+ }
1131
+ binary.blobToJson = blobToJson;
1132
+ async function getBlobFrom(url) {
1133
+ const response = await axios({
1134
+ url,
1135
+ method: 'get',
1136
+ responseType: 'blob',
1137
+ });
1138
+ return response.data;
1139
+ }
1140
+ binary.getBlobFrom = getBlobFrom;
1141
+ })(binary = Utils.binary || (Utils.binary = {}));
1142
+ let css;
1143
+ (function (css) {
1144
+ /**
1145
+ *
1146
+ * @param pixelsCss pixels ex. 100px
1147
+ * @returns
1148
+ */
1149
+ function numValue(pixelsCss) {
1150
+ return parseInt(pixelsCss?.toString()?.replace('px', ''));
1151
+ }
1152
+ css.numValue = numValue;
1153
+ })(css = Utils.css || (Utils.css = {}));
1154
+ })(Utils || (Utils = {}));
1155
+ var UtilsProcess;
1156
+ (function (UtilsProcess) {
1157
+ /**
1158
+ * TODO IMPLEMENT
1159
+ * start async node process
1160
+ */
1161
+ async function startAsync(command, options) {
1162
+ }
1163
+ UtilsProcess.startAsync = startAsync;
1164
+ /**
1165
+ * TODO IMPLEMENT
1166
+ */
1167
+ function startSync(command, options) {
1168
+ }
1169
+ UtilsProcess.startSync = startSync;
1170
+ UtilsProcess.getGitBashPath = () => {
949
1171
  /* */
950
1172
  /* */
951
1173
  /* */
@@ -954,12 +1176,6 @@ class HelpersMessages extends HelpersIsomorphic {
954
1176
  /* */
955
1177
  /* */
956
1178
  /* */
957
- }
958
- success(details) {
959
- if (Helpers.isBrowser) {
960
- console.info(details);
961
- return;
962
- }
963
1179
  /* */
964
1180
  /* */
965
1181
  /* */
@@ -970,6 +1186,13 @@ class HelpersMessages extends HelpersIsomorphic {
970
1186
  /* */
971
1187
  /* */
972
1188
  /* */
1189
+ return (void 0);
1190
+ };
1191
+ /**
1192
+ * TODO IMPLEMENT
1193
+ * start async node process
1194
+ */
1195
+ UtilsProcess.startInNewTerminalWindow = (command, options) => {
973
1196
  /* */
974
1197
  /* */
975
1198
  /* */
@@ -997,19 +1220,6 @@ class HelpersMessages extends HelpersIsomorphic {
997
1220
  /* */
998
1221
  /* */
999
1222
  /* */
1000
- }
1001
- /**
1002
- *
1003
- * @param details
1004
- * @param isLogTask is less important log task
1005
- * @returns
1006
- */
1007
- taskStarted(details, isLogTask = false) {
1008
- if (Helpers.isBrowser) {
1009
- console.info(details);
1010
- return;
1011
- }
1012
- /* */
1013
1223
  /* */
1014
1224
  /* */
1015
1225
  /* */
@@ -1056,17 +1266,6 @@ class HelpersMessages extends HelpersIsomorphic {
1056
1266
  /* */
1057
1267
  /* */
1058
1268
  /* */
1059
- }
1060
- taskDone(details, isLessImportant = false) {
1061
- if (Helpers.isBrowser) {
1062
- console.info(details);
1063
- return;
1064
- }
1065
- /* */
1066
- /* */
1067
- /* */
1068
- /* */
1069
- /* */
1070
1269
  /* */
1071
1270
  /* */
1072
1271
  /* */
@@ -1095,6 +1294,10 @@ class HelpersMessages extends HelpersIsomorphic {
1095
1294
  /* */
1096
1295
  /* */
1097
1296
  /* */
1297
+ return (void 0);
1298
+ };
1299
+ UtilsProcess.getBashOrShellName = () => {
1300
+ return 'browser';
1098
1301
  /* */
1099
1302
  /* */
1100
1303
  /* */
@@ -1114,12 +1317,6 @@ class HelpersMessages extends HelpersIsomorphic {
1114
1317
  /* */
1115
1318
  /* */
1116
1319
  /* */
1117
- }
1118
- log(details, debugLevel = 0) {
1119
- if (Helpers.isBrowser) {
1120
- console.log(details);
1121
- return;
1122
- }
1123
1320
  /* */
1124
1321
  /* */
1125
1322
  /* */
@@ -1133,12 +1330,71 @@ class HelpersMessages extends HelpersIsomorphic {
1133
1330
  /* */
1134
1331
  /* */
1135
1332
  /* */
1333
+ return (void 0);
1334
+ };
1335
+ })(UtilsProcess || (UtilsProcess = {}));
1336
+ var UtilsOs;
1337
+ (function (UtilsOs) {
1338
+ /**
1339
+ * check if script is running in client browser
1340
+ * (websql model -> is also considered as browser
1341
+ * because it is running in browser)
1342
+ */
1343
+ UtilsOs.isRunningInBrowser = () => {
1136
1344
  /* */
1137
1345
  /* */
1346
+ return true;
1347
+ };
1348
+ /**
1349
+ * check if script is running in nodejs
1350
+ * (backend script or electron script)
1351
+ */
1352
+ UtilsOs.isRunningInNode = () => {
1138
1353
  /* */
1139
1354
  /* */
1355
+ return false;
1356
+ };
1357
+ /**
1358
+ * check if script is running special
1359
+ * browser mode that has sql.js backend
1360
+ * and executes sql queries in browser
1361
+ */
1362
+ UtilsOs.isRunningInWebSQL = () => {
1140
1363
  /* */
1141
1364
  /* */
1365
+ return true;
1366
+ return false;
1367
+ };
1368
+ /**
1369
+ * check whether the current process is running inside
1370
+ * Electron backend or browser.
1371
+ */
1372
+ UtilsOs.isRunningInElectron = () => {
1373
+ // @ts-ignore
1374
+ if (typeof window !== 'undefined' &&
1375
+ typeof window.process === 'object' &&
1376
+ window.process.type === 'renderer') {
1377
+ return true;
1378
+ }
1379
+ // @ts-ignore
1380
+ if (typeof process !== 'undefined' &&
1381
+ typeof process.versions === 'object' &&
1382
+ !!process.versions.electron) {
1383
+ return true;
1384
+ }
1385
+ if (typeof navigator === 'object' &&
1386
+ typeof navigator.userAgent === 'string' &&
1387
+ navigator.userAgent.indexOf('Electron') >= 0) {
1388
+ return true;
1389
+ }
1390
+ return false;
1391
+ };
1392
+ /**
1393
+ * Check wether the current process is running inside
1394
+ * windows subsystem for linux (WSL).
1395
+ */
1396
+ UtilsOs.isRunningInWsl = () => {
1397
+ return false;
1142
1398
  /* */
1143
1399
  /* */
1144
1400
  /* */
@@ -1156,6 +1412,10 @@ class HelpersMessages extends HelpersIsomorphic {
1156
1412
  /* */
1157
1413
  /* */
1158
1414
  /* */
1415
+ return (void 0);
1416
+ };
1417
+ UtilsOs.isRunningInDocker = () => {
1418
+ return false;
1159
1419
  /* */
1160
1420
  /* */
1161
1421
  /* */
@@ -1163,6 +1423,9 @@ class HelpersMessages extends HelpersIsomorphic {
1163
1423
  /* */
1164
1424
  /* */
1165
1425
  /* */
1426
+ return (void 0);
1427
+ };
1428
+ UtilsOs.isRunningInLinuxGraphicsCapableEnvironment = () => {
1166
1429
  /* */
1167
1430
  /* */
1168
1431
  /* */
@@ -1170,54 +1433,219 @@ class HelpersMessages extends HelpersIsomorphic {
1170
1433
  /* */
1171
1434
  /* */
1172
1435
  /* */
1436
+ return (void 0);
1437
+ };
1438
+ })(UtilsOs || (UtilsOs = {}));
1439
+ var UtilsString;
1440
+ (function (UtilsString) {
1441
+ UtilsString.kebabCaseNoSplitNumbers = (input) => {
1442
+ return (input
1443
+ .replace(/\s+/g, '-')
1444
+ .replace(/([a-z0-9])([A-Z])/g, '$1-$2')
1445
+ .toLowerCase());
1446
+ };
1447
+ })(UtilsString || (UtilsString = {}));
1448
+ /**
1449
+ * Taon migration utilities
1450
+ */
1451
+ var UtilsMigrations;
1452
+ (function (UtilsMigrations) {
1453
+ UtilsMigrations.getTimestampFromClassName = (className) => {
1454
+ const [maybeTimestamp1, maybeTimestamp2] = className.split('_') || [];
1455
+ const timestamp1 = parseInt(maybeTimestamp1);
1456
+ const timestamp2 = parseInt(maybeTimestamp2);
1457
+ const timestamp = !_.isNaN(timestamp1) ? timestamp1 : timestamp2;
1458
+ return UtilsMigrations.isValidTimestamp(timestamp) ? timestamp : void 0;
1459
+ };
1460
+ UtilsMigrations.getFormattedTimestampFromClassName = (className) => {
1461
+ const timestamp = UtilsMigrations.getTimestampFromClassName(className);
1462
+ if (!timestamp) {
1463
+ return void 0;
1464
+ }
1465
+ return UtilsMigrations.formatTimestamp(timestamp);
1466
+ };
1467
+ UtilsMigrations.formatTimestamp = (timestamp) => {
1468
+ const dateFromTimestamp = new Date(timestamp);
1469
+ return `${dateformat(dateFromTimestamp, 'dd-mm-yyyy HH:MM:ss')}`;
1470
+ };
1471
+ UtilsMigrations.isValidTimestamp = (value) => {
1472
+ if (typeof value !== 'number') {
1473
+ return false; // Must be a number
1474
+ }
1475
+ const minTimestamp = 0; // Minimum possible timestamp (Unix epoch)
1476
+ const maxTimestamp = 8640000000000000; // Max safe timestamp in JS (represents year ~275760)
1477
+ return value >= minTimestamp && value <= maxTimestamp;
1478
+ };
1479
+ })(UtilsMigrations || (UtilsMigrations = {}));
1480
+ ;
1481
+ ({}); // @--end-of-file-for-module=tnp-core lib/utils.ts
1482
+
1483
+ class HelpersIsomorphic {
1484
+ /**
1485
+ * @deprecated
1486
+ * use UtilsOs.isRunningInBrowser() instead
1487
+ */
1488
+ get isBrowser() {
1489
+ return UtilsOs.isRunningInBrowser();
1173
1490
  }
1174
1491
  /**
1175
- * Logs not visible in normal use of taon-cli
1492
+ * @deprecated
1493
+ * use UtilsOs.isRunningInWebSQL() instead
1176
1494
  */
1177
- logSuccess(details) {
1178
- /* */
1179
- /* */
1180
- /* */
1181
- /* */
1182
- /* */
1183
- return (void 0);
1495
+ get isWebSQL() {
1496
+ return UtilsOs.isRunningInWebSQL();
1184
1497
  }
1185
1498
  /**
1186
- * Logs not visible in normal use of taon-cli
1499
+ * @deprecated
1500
+ * use UtilsOs.isRunningInNode() instead
1187
1501
  */
1188
- logInfo(details, repeatable = false) {
1189
- /* */
1190
- /* */
1191
- /* */
1192
- /* */
1193
- /* */
1194
- return (void 0);
1502
+ get isNode() {
1503
+ return UtilsOs.isRunningInNode();
1195
1504
  }
1196
1505
  /**
1197
- * Logs not visible in normal use of taon-cli
1506
+ * @deprecated
1507
+ * use UtilsOs.isRunningInElectron() instead
1198
1508
  */
1199
- logError(details, noExit = false, noTrace = false) {
1200
- /* */
1201
- /* */
1202
- /* */
1203
- /* */
1204
- /* */
1205
- return (void 0);
1509
+ get isElectron() {
1510
+ return UtilsOs.isRunningInElectron();
1206
1511
  }
1207
1512
  /**
1208
- * Logs not visible in normal use of taon-cli
1513
+ * TODO what is the purpose of this function?
1514
+ * @deprecated
1209
1515
  */
1210
- logWarn(details, trace = false) {
1516
+ contain(arr, item) {
1517
+ return (arr.filter(l => {
1518
+ if (l instanceof RegExp) {
1519
+ return l.test(item);
1520
+ }
1521
+ if (l === item) {
1522
+ return true;
1523
+ }
1524
+ if (item.match && typeof item.match === 'function' ? item.match(l) : false) {
1525
+ return true;
1526
+ }
1527
+ return false;
1528
+ }).length > 0);
1529
+ }
1530
+ }
1531
+ ;
1532
+ ({}); // @--end-of-file-for-module=tnp-core lib/helpers-isomorphic.ts
1533
+
1534
+ /* */
1535
+ /* */
1536
+ /* */
1537
+ const KEY = {
1538
+ LAST_ERROR: Symbol(),
1539
+ LAST_INFO: Symbol(),
1540
+ LAST_WARN: Symbol(),
1541
+ LAST_LOG: Symbol(),
1542
+ LAST_SUCCESS: Symbol(),
1543
+ LAST_TASK_STARTED: Symbol(),
1544
+ LAST_TASK_DONE: Symbol(),
1545
+ };
1546
+ const KEY_COUNT = {
1547
+ LAST_ERROR: Symbol(),
1548
+ LAST_INFO: Symbol(),
1549
+ LAST_WARN: Symbol(),
1550
+ LAST_LOG: Symbol(),
1551
+ LAST_SUCCESS: Symbol(),
1552
+ LAST_TASK_STARTED: Symbol(),
1553
+ LAST_TASK_DONE: Symbol(),
1554
+ };
1555
+ const KEY_IMPORTANTCE = {
1556
+ LAST_ERROR: Symbol(),
1557
+ LAST_INFO: Symbol(),
1558
+ LAST_WARN: Symbol(),
1559
+ LAST_LOG: Symbol(),
1560
+ LAST_SUCCESS: Symbol(),
1561
+ LAST_TASK_STARTED: Symbol(),
1562
+ LAST_TASK_DONE: Symbol(),
1563
+ };
1564
+ /* */
1565
+ /* */
1566
+ /* */
1567
+ /* */
1568
+ /* */
1569
+ /* */
1570
+ /* */
1571
+ /* */
1572
+ /* */
1573
+ /* */
1574
+ /* */
1575
+ /* */
1576
+ /* */
1577
+ /* */
1578
+ /* */
1579
+ /* */
1580
+ /* */
1581
+ /* */
1582
+ /* */
1583
+ /* */
1584
+ /* */
1585
+ const LIMIT = 10;
1586
+ /**
1587
+ * @param details any data to be transformed
1588
+ * @returns string ready to be displayed
1589
+ */
1590
+ const transformData = (details) => {
1591
+ if (typeof details === 'object') {
1592
+ try {
1593
+ const json = JSON.stringify(details, null, 2);
1594
+ details = json;
1595
+ }
1596
+ catch (error) {
1597
+ return details;
1598
+ }
1599
+ }
1600
+ return details;
1601
+ };
1602
+ class HelpersMessages extends HelpersIsomorphic {
1603
+ msgCacheClear() {
1211
1604
  /* */
1212
1605
  /* */
1213
1606
  /* */
1214
1607
  /* */
1215
1608
  /* */
1216
- return (void 0);
1217
1609
  }
1218
- warn(details, trace = false) {
1610
+ renderError(err) {
1611
+ if (this.isBrowser) {
1612
+ console.error(err);
1613
+ }
1614
+ else {
1615
+ /* */
1616
+ /* */
1617
+ /* */
1618
+ /* */
1619
+ /* */
1620
+ /* */
1621
+ /* */
1622
+ /* */
1623
+ /* */
1624
+ }
1625
+ }
1626
+ /**
1627
+ * Throw error and exit process
1628
+ * make sure browser or nodejs will not continue
1629
+ * @param details
1630
+ */
1631
+ throw(details) {
1632
+ if (this.isBrowser) {
1633
+ document.body.innerHTML =
1634
+ '<h1>Application has encountered an error and stopped.</h1>';
1635
+ document.body.style.pointerEvents = 'none';
1636
+ /* */
1637
+ /* */
1638
+ /* */
1639
+ /* */
1640
+ }
1641
+ throw new Error(details);
1642
+ }
1643
+ tryCatchError(error) {
1644
+ Helpers.error(error, true, true);
1645
+ }
1646
+ error(details, noExit = false, noTrace = false) {
1219
1647
  if (Helpers.isBrowser) {
1220
- console.warn(details);
1648
+ console.error(details);
1221
1649
  return;
1222
1650
  }
1223
1651
  /* */
@@ -1270,62 +1698,23 @@ class HelpersMessages extends HelpersIsomorphic {
1270
1698
  /* */
1271
1699
  /* */
1272
1700
  /* */
1701
+ }
1702
+ info(details, repeatable = false) {
1273
1703
  /* */
1274
1704
  /* */
1275
- }
1276
- }
1277
- function transformData(details) {
1278
- if (typeof details === 'object') {
1279
- if (Array.isArray(details)) {
1280
- return details.join('\n');
1281
- }
1282
- try {
1283
- const json = JSON.stringify(details);
1284
- details = json;
1285
- }
1286
- catch (error) {
1287
- return details;
1288
- }
1289
- }
1290
- return details;
1291
- }
1292
- ;
1293
- ({}); // @--end-of-file-for-module=tnp-core lib/helpers-messages.ts
1294
-
1295
- const encoding = 'utf8';
1296
- /* */
1297
- /* */
1298
- /* */
1299
- const WEBSQL_PROC_MOCK_PROCESSES_PID = {};
1300
- const WEBSQL_PROC_MOCK_PROCESSES_PPID = {};
1301
- class HelpersCore extends HelpersMessages {
1302
- static get InstanceCore() {
1303
- if (!HelpersCore._instanceCore) {
1304
- HelpersCore._instanceCore = new HelpersCore();
1705
+ /* */
1706
+ /* */
1707
+ /* */
1708
+ /* */
1709
+ if (Helpers.isBrowser) {
1710
+ console.info(details);
1711
+ return;
1305
1712
  }
1306
- return HelpersCore._instanceCore;
1307
- }
1308
- /* */
1309
- /* */
1310
- /* */
1311
- /* */
1312
- /* */
1313
- /* */
1314
- /* */
1315
- /* */
1316
- /* */
1317
- /* */
1318
- /* */
1319
- constructor() {
1320
- super();
1321
1713
  /* */
1322
1714
  /* */
1323
- this.bigMaxBuffer = 2024 * 500;
1324
1715
  /* */
1325
1716
  /* */
1326
1717
  /* */
1327
- }
1328
- get isWsl() {
1329
1718
  /* */
1330
1719
  /* */
1331
1720
  /* */
@@ -1343,9 +1732,6 @@ class HelpersCore extends HelpersMessages {
1343
1732
  /* */
1344
1733
  /* */
1345
1734
  /* */
1346
- return (void 0);
1347
- }
1348
- isRunningInDocker() {
1349
1735
  /* */
1350
1736
  /* */
1351
1737
  /* */
@@ -1353,47 +1739,78 @@ class HelpersCore extends HelpersMessages {
1353
1739
  /* */
1354
1740
  /* */
1355
1741
  /* */
1356
- return (void 0);
1357
- }
1358
- clearConsole() {
1359
- Helpers.msgCacheClear();
1360
- console.log('\x1Bc');
1361
- }
1362
- /**
1363
- * get electron browser ipc renderer
1364
- */
1365
- get ipcRenderer() {
1366
1742
  /* */
1367
1743
  /* */
1368
- if (!this.isElectron) {
1369
- return;
1370
- }
1371
- return window.require('electron')
1372
- .ipcRenderer;
1373
- }
1374
- /**
1375
- * get electron web frame
1376
- */
1377
- get webFrame() {
1378
1744
  /* */
1379
1745
  /* */
1380
- if (!this.isElectron) {
1746
+ /* */
1747
+ }
1748
+ success(details) {
1749
+ if (Helpers.isBrowser) {
1750
+ console.info(details);
1381
1751
  return;
1382
1752
  }
1383
- return window.require('electron').webFrame;
1753
+ /* */
1754
+ /* */
1755
+ /* */
1756
+ /* */
1757
+ /* */
1758
+ /* */
1759
+ /* */
1760
+ /* */
1761
+ /* */
1762
+ /* */
1763
+ /* */
1764
+ /* */
1765
+ /* */
1766
+ /* */
1767
+ /* */
1768
+ /* */
1769
+ /* */
1770
+ /* */
1771
+ /* */
1772
+ /* */
1773
+ /* */
1774
+ /* */
1775
+ /* */
1776
+ /* */
1777
+ /* */
1778
+ /* */
1779
+ /* */
1780
+ /* */
1781
+ /* */
1782
+ /* */
1783
+ /* */
1784
+ /* */
1785
+ /* */
1786
+ /* */
1787
+ /* */
1788
+ /* */
1789
+ /* */
1384
1790
  }
1385
1791
  /**
1386
- * get electron backend ipc main proces
1792
+ *
1793
+ * @param details
1794
+ * @param isLogTask is less important log task
1795
+ * @returns
1387
1796
  */
1388
- get ipcMain() {
1797
+ taskStarted(details, isLogTask = false) {
1798
+ if (Helpers.isBrowser) {
1799
+ console.info(details);
1800
+ return;
1801
+ }
1802
+ /* */
1803
+ /* */
1804
+ /* */
1805
+ /* */
1806
+ /* */
1807
+ /* */
1808
+ /* */
1389
1809
  /* */
1390
1810
  /* */
1391
1811
  /* */
1392
1812
  /* */
1393
1813
  /* */
1394
- return (void 0);
1395
- }
1396
- getElectronWindow({ allowRunningInsecureContent = true, } = {}) {
1397
1814
  /* */
1398
1815
  /* */
1399
1816
  /* */
@@ -1409,19 +1826,8 @@ class HelpersCore extends HelpersMessages {
1409
1826
  /* */
1410
1827
  /* */
1411
1828
  /* */
1412
- return (void 0);
1413
- }
1414
- mediaTypeFromSrc(src) {
1415
- const ext = path.extname(src);
1416
- const media = CoreModels.mimeTypes[ext];
1417
- return _.first(media?.split('/'));
1418
- }
1419
- sleep(seconds = 1) {
1420
1829
  /* */
1421
1830
  /* */
1422
- return (void 0);
1423
- }
1424
- removeIfExists(absoluteFileOrFolderPath) {
1425
1831
  /* */
1426
1832
  /* */
1427
1833
  /* */
@@ -1440,12 +1846,37 @@ class HelpersCore extends HelpersMessages {
1440
1846
  /* */
1441
1847
  /* */
1442
1848
  /* */
1443
- return (void 0);
1444
- }
1445
- relative(cwd, to) {
1446
- return crossPlatformPath(path.relative(cwd, to));
1447
1849
  }
1448
- removeFileIfExists(absoluteFilePath) {
1850
+ taskDone(details, isLessImportant = false) {
1851
+ if (Helpers.isBrowser) {
1852
+ console.info(details);
1853
+ return;
1854
+ }
1855
+ /* */
1856
+ /* */
1857
+ /* */
1858
+ /* */
1859
+ /* */
1860
+ /* */
1861
+ /* */
1862
+ /* */
1863
+ /* */
1864
+ /* */
1865
+ /* */
1866
+ /* */
1867
+ /* */
1868
+ /* */
1869
+ /* */
1870
+ /* */
1871
+ /* */
1872
+ /* */
1873
+ /* */
1874
+ /* */
1875
+ /* */
1876
+ /* */
1877
+ /* */
1878
+ /* */
1879
+ /* */
1449
1880
  /* */
1450
1881
  /* */
1451
1882
  /* */
@@ -1459,9 +1890,6 @@ class HelpersCore extends HelpersMessages {
1459
1890
  /* */
1460
1891
  /* */
1461
1892
  /* */
1462
- return (void 0);
1463
- }
1464
- removeFolderIfExists(absoluteFolderPath) {
1465
1893
  /* */
1466
1894
  /* */
1467
1895
  /* */
@@ -1476,36 +1904,21 @@ class HelpersCore extends HelpersMessages {
1476
1904
  /* */
1477
1905
  /* */
1478
1906
  /* */
1479
- return (void 0);
1480
1907
  }
1481
- /**
1482
- * leave max 1 empty line
1483
- */
1484
- removeEmptyLineFromString(str) {
1485
- const lines = (str || '').split('\n');
1486
- let previousWasEmpty = false;
1487
- return lines
1488
- .filter(line => {
1489
- if (line.trim() === '') {
1490
- if (previousWasEmpty) {
1491
- return false;
1492
- }
1493
- else {
1494
- previousWasEmpty = true;
1495
- return true;
1496
- }
1497
- }
1498
- else {
1499
- previousWasEmpty = false;
1500
- return true;
1501
- }
1502
- })
1503
- .join('\n');
1908
+ get isVerboseMode() {
1909
+ return true; // TODO what it means in browser
1910
+ /* */
1911
+ /* */
1504
1912
  }
1505
1913
  /**
1506
- * @deprecated
1914
+ * log messages only available in verbose mode
1507
1915
  */
1508
- tryRemoveDir(dirpath, contentOnly = false, omitWarningNotExisted = false) {
1916
+ log(details, debugLevel = 0) {
1917
+ if (Helpers.isBrowser) {
1918
+ console.log(details);
1919
+ return;
1920
+ }
1921
+ /* */
1509
1922
  /* */
1510
1923
  /* */
1511
1924
  /* */
@@ -1542,9 +1955,6 @@ class HelpersCore extends HelpersMessages {
1542
1955
  /* */
1543
1956
  /* */
1544
1957
  /* */
1545
- return (void 0);
1546
- }
1547
- remove(fileOrFolderPathOrPatter, exactFolder = false) {
1548
1958
  /* */
1549
1959
  /* */
1550
1960
  /* */
@@ -1555,22 +1965,14 @@ class HelpersCore extends HelpersMessages {
1555
1965
  /* */
1556
1966
  /* */
1557
1967
  /* */
1558
- return (void 0);
1559
- }
1560
- /* */
1561
- /* */
1562
- /* */
1563
- /* */
1564
- /* */
1565
- /* */
1566
- /* */
1567
- /* */
1568
- /* */
1569
- /* */
1570
- get isRunningInGitBash() {
1571
1968
  /* */
1572
1969
  /* */
1573
1970
  /* */
1971
+ }
1972
+ /**
1973
+ * Logs not visible in normal use of taon-cli
1974
+ */
1975
+ logSuccess(details) {
1574
1976
  /* */
1575
1977
  /* */
1576
1978
  /* */
@@ -1579,70 +1981,112 @@ class HelpersCore extends HelpersMessages {
1579
1981
  return (void 0);
1580
1982
  }
1581
1983
  /**
1582
- * Check if the current shell is supported by Taon framework.
1984
+ * Logs not visible in normal use of taon-cli
1583
1985
  */
1584
- get isSupportedTaonTerminal() {
1986
+ logInfo(details, repeatable = false) {
1987
+ /* */
1988
+ /* */
1989
+ /* */
1585
1990
  /* */
1586
1991
  /* */
1587
1992
  return (void 0);
1588
1993
  }
1589
1994
  /**
1590
- * check if function is class
1995
+ * Logs not visible in normal use of taon-cli
1591
1996
  */
1592
- isClass(funcOrClass) {
1593
- let isClass = false;
1594
- if (typeof funcOrClass === 'function') {
1595
- isClass =
1596
- !!funcOrClass.prototype &&
1597
- Object.getOwnPropertyNames(funcOrClass.prototype).filter(f => f !== 'constructor').length > 0;
1598
- }
1599
- return isClass;
1600
- }
1601
- /**
1602
- * check if data is nodejs/browser blob
1603
- *
1604
- * @param maybeBlob
1605
- * @returns
1606
- */
1607
- isBlob(maybeBlob) {
1608
- return maybeBlob instanceof Blob; // || toString.call(maybeBlob) === '[object Blob]';
1609
- }
1610
- /**
1611
- * Check if data is nodejs buffer
1612
- *
1613
- * @param maybeNodejsBuffer
1614
- * @returns
1615
- */
1616
- /* */
1617
- /* */
1618
- /* */
1619
- /* */
1620
- removeSlashAtEnd(s) {
1621
- s = s?.endsWith(`/`) ? s.slice(0, s.length - 1) : s;
1622
- return s;
1623
- }
1624
- removeSlashAtBegin(s) {
1625
- s = s?.startsWith(`/`) ? s.slice(1) : s;
1626
- return s;
1997
+ logError(details, noExit = false, noTrace = false) {
1998
+ /* */
1999
+ /* */
2000
+ /* */
2001
+ /* */
2002
+ /* */
2003
+ return (void 0);
1627
2004
  }
1628
2005
  /**
1629
- * stringify to pretty json string
2006
+ * Logs not visible in normal use of taon-cli
1630
2007
  */
1631
- stringify(inputObject) {
1632
- return JSON.stringify(inputObject, null, 2);
2008
+ logWarn(details, trace = false) {
2009
+ /* */
2010
+ /* */
2011
+ /* */
2012
+ /* */
2013
+ /* */
2014
+ return (void 0);
1633
2015
  }
1634
- async runSyncOrAsync(fnOrOptions) {
1635
- if (_.isUndefined(fnOrOptions)) {
1636
- return void 0;
2016
+ warn(details, trace = false) {
2017
+ if (Helpers.isBrowser) {
2018
+ console.warn(details);
2019
+ return;
1637
2020
  }
1638
- let promisOrValue;
1639
- const { functionFn, context, arrayOfParams } = fnOrOptions;
1640
- promisOrValue = functionFn.apply(context, arrayOfParams);
1641
- // // @ts-ignore
1642
- if (promisOrValue instanceof Promise) {
1643
- promisOrValue = Promise.resolve(promisOrValue);
2021
+ /* */
2022
+ /* */
2023
+ /* */
2024
+ /* */
2025
+ /* */
2026
+ /* */
2027
+ /* */
2028
+ /* */
2029
+ /* */
2030
+ /* */
2031
+ /* */
2032
+ /* */
2033
+ /* */
2034
+ /* */
2035
+ /* */
2036
+ /* */
2037
+ /* */
2038
+ /* */
2039
+ /* */
2040
+ /* */
2041
+ /* */
2042
+ /* */
2043
+ /* */
2044
+ /* */
2045
+ /* */
2046
+ /* */
2047
+ /* */
2048
+ /* */
2049
+ /* */
2050
+ /* */
2051
+ /* */
2052
+ /* */
2053
+ /* */
2054
+ /* */
2055
+ /* */
2056
+ /* */
2057
+ /* */
2058
+ /* */
2059
+ /* */
2060
+ /* */
2061
+ /* */
2062
+ /* */
2063
+ /* */
2064
+ /* */
2065
+ /* */
2066
+ /* */
2067
+ /* */
2068
+ /* */
2069
+ /* */
2070
+ /* */
2071
+ /* */
2072
+ /* */
2073
+ }
2074
+ }
2075
+ ;
2076
+ ({}); // @--end-of-file-for-module=tnp-core lib/helpers-messages.ts
2077
+
2078
+ const encoding = 'utf8';
2079
+ /* */
2080
+ /* */
2081
+ /* */
2082
+ const WEBSQL_PROC_MOCK_PROCESSES_PID = {};
2083
+ const WEBSQL_PROC_MOCK_PROCESSES_PPID = {};
2084
+ class HelpersCore extends HelpersMessages {
2085
+ static get InstanceCore() {
2086
+ if (!HelpersCore._instanceCore) {
2087
+ HelpersCore._instanceCore = new HelpersCore();
1644
2088
  }
1645
- return promisOrValue;
2089
+ return HelpersCore._instanceCore;
1646
2090
  }
1647
2091
  /* */
1648
2092
  /* */
@@ -1655,254 +2099,72 @@ class HelpersCore extends HelpersMessages {
1655
2099
  /* */
1656
2100
  /* */
1657
2101
  /* */
1658
- /* */
1659
- /* */
1660
- /* */
1661
- /* */
1662
- /* */
1663
- /* */
1664
- /* */
1665
- /* */
1666
- /* */
1667
- /* */
1668
- /* */
1669
- /* */
1670
- /* */
1671
- /* */
1672
- /* */
1673
- /* */
1674
- /* */
1675
- /* */
1676
- /* */
1677
- /* */
1678
- /* */
1679
- /* */
1680
- /* */
1681
- /* */
1682
- /* */
1683
- /* */
1684
- /* */
1685
- /* */
1686
- /* */
1687
- /* */
1688
- /* */
1689
- /* */
1690
- /* */
1691
- /* */
1692
- /* */
1693
- /* */
1694
- /* */
1695
- /* */
1696
- /* */
1697
- /* */
1698
- /* */
1699
- /* */
1700
- /* */
1701
- /* */
1702
- /* */
1703
- /* */
1704
- /* */
1705
- /* */
1706
- /* */
1707
- /* */
1708
- /* */
1709
- /* */
1710
- /* */
1711
- /* */
1712
- /* */
1713
- /* */
1714
- /* */
1715
- /* */
1716
- /* */
1717
- /* */
1718
- /* */
1719
- /* */
1720
- /* */
1721
- /* */
1722
- /* */
1723
- /* */
1724
- /* */
1725
- /* */
1726
- /* */
1727
- /* */
1728
- /* */
1729
- /* */
1730
- /* */
1731
- /* */
1732
- /* */
1733
- /* */
1734
- /* */
1735
- /* */
1736
- /* */
1737
- /* */
1738
- /* */
1739
- /* */
1740
- /* */
1741
- /* */
1742
- /* */
1743
- /* */
1744
- /* */
1745
- /* */
1746
- /* */
1747
- /* */
1748
- /* */
1749
- /* */
1750
- /* */
1751
- /* */
1752
- /* */
1753
- /* */
1754
- /* */
1755
- /* */
1756
- /* */
1757
- /* */
1758
- /* */
1759
- /* */
1760
- /* */
1761
- /* */
1762
- /* */
1763
- /* */
1764
- /* */
1765
- /* */
1766
- /* */
1767
- /* */
1768
- /* */
1769
- /* */
1770
- /* */
1771
- /* */
1772
- /* */
1773
- /* */
1774
- /* */
1775
- /* */
1776
- /* */
1777
- /* */
1778
- /* */
1779
- /* */
1780
- /* */
1781
- /* */
1782
- /* */
1783
- /* */
1784
- /* */
1785
- /* */
1786
- /* */
1787
- /* */
1788
- /* */
1789
- /* */
1790
- /* */
1791
- /* */
1792
- /* */
1793
- /* */
1794
- /* */
1795
- /* */
1796
- /* */
1797
- /* */
1798
- /* */
1799
- /* */
1800
- /* */
1801
- /* */
1802
- /* */
1803
- /* */
1804
- /* */
1805
- /* */
1806
- /* */
1807
- /* */
1808
- /* */
1809
- /* */
1810
- /* */
1811
- /* */
1812
- /* */
1813
- /* */
1814
- /* */
1815
- /* */
1816
- /* */
1817
- /* */
1818
- /* */
1819
- /* */
1820
- /* */
1821
- /* */
1822
- /* */
1823
- /* */
1824
- /* */
1825
- /* */
1826
- /* */
1827
- /* */
1828
- /* */
1829
- /* */
1830
- /* */
1831
- /* */
1832
- /* */
1833
- /* */
1834
- /* */
1835
- /* */
1836
- /* */
1837
- /* */
1838
- /* */
1839
- /* */
1840
- /* */
1841
- /* */
1842
- /* */
1843
- /* */
1844
- /* */
1845
- /* */
1846
- /* */
1847
- /* */
1848
- /* */
1849
- /* */
1850
- /* */
1851
- /* */
1852
- /* */
1853
- /* */
1854
- /* */
1855
- /* */
1856
- /* */
1857
- /* */
1858
- /* */
1859
- /* */
1860
- /* */
1861
- /* */
1862
- /* */
1863
- /* */
1864
- /* */
1865
- /* */
1866
- /* */
1867
- /* */
1868
- /* */
1869
- /* */
1870
- /* */
1871
- /* */
1872
- /* */
1873
- /* */
1874
- /* */
1875
- /* */
1876
- /* */
1877
- /* */
1878
- /* */
1879
- /* */
1880
- /* */
1881
- /* */
1882
- /* */
1883
- /* */
1884
- /* */
1885
- /* */
1886
- /* */
1887
- /* */
1888
- /* */
1889
- /* */
1890
- /* */
1891
- /* */
1892
- /* */
2102
+ constructor() {
2103
+ super();
2104
+ /* */
2105
+ /* */
2106
+ this.bigMaxBuffer = 2024 * 500;
2107
+ /* */
2108
+ /* */
2109
+ /* */
2110
+ }
1893
2111
  /**
1894
- * symlink may have existed or unexisted destiantion url
1895
- * @param destUrl M
2112
+ * @deprecated use UtilsOs.isRunningInsideWsl()
1896
2113
  */
1897
- isSymlinkThatMatchesUrl(possibleSymlink, destUrl, absoluteFileMatch = false) {
2114
+ get isWsl() {
2115
+ return UtilsOs.isRunningInWsl();
2116
+ }
2117
+ /**
2118
+ * @deprecated use UtilsOs.isRunningInDocker
2119
+ */
2120
+ isRunningInDocker() {
2121
+ return UtilsOs.isRunningInDocker();
2122
+ }
2123
+ /**
2124
+ * @deprecated use UtilsOs.isRunningInLinuxGraphicEnvironment
2125
+ */
2126
+ isRunningInLinuxGraphicsCapableEnvironment() {
2127
+ return UtilsOs.isRunningInLinuxGraphicsCapableEnvironment();
2128
+ }
2129
+ clearConsole() {
2130
+ Helpers.msgCacheClear();
2131
+ console.log('\x1Bc');
2132
+ }
2133
+ /**
2134
+ * get electron browser ipc renderer
2135
+ */
2136
+ get ipcRenderer() {
2137
+ /* */
1898
2138
  /* */
2139
+ if (!this.isElectron) {
2140
+ return;
2141
+ }
2142
+ return window.require('electron')
2143
+ .ipcRenderer;
2144
+ }
2145
+ /**
2146
+ * get electron web frame
2147
+ */
2148
+ get webFrame() {
1899
2149
  /* */
1900
2150
  /* */
2151
+ if (!this.isElectron) {
2152
+ return;
2153
+ }
2154
+ return window.require('electron').webFrame;
2155
+ }
2156
+ /**
2157
+ * get electron backend ipc main proces
2158
+ */
2159
+ get ipcMain() {
1901
2160
  /* */
1902
2161
  /* */
1903
2162
  /* */
1904
2163
  /* */
1905
2164
  /* */
2165
+ return (void 0);
2166
+ }
2167
+ getElectronWindow({ allowRunningInsecureContent = true, } = {}) {
1906
2168
  /* */
1907
2169
  /* */
1908
2170
  /* */
@@ -1918,8 +2180,19 @@ class HelpersCore extends HelpersMessages {
1918
2180
  /* */
1919
2181
  /* */
1920
2182
  /* */
2183
+ return (void 0);
2184
+ }
2185
+ mediaTypeFromSrc(src) {
2186
+ const ext = path.extname(src);
2187
+ const media = CoreModels.mimeTypes[ext];
2188
+ return _.first(media?.split('/'));
2189
+ }
2190
+ sleep(seconds = 1) {
1921
2191
  /* */
1922
2192
  /* */
2193
+ return (void 0);
2194
+ }
2195
+ removeIfExists(absoluteFileOrFolderPath) {
1923
2196
  /* */
1924
2197
  /* */
1925
2198
  /* */
@@ -1928,9 +2201,6 @@ class HelpersCore extends HelpersMessages {
1928
2201
  /* */
1929
2202
  /* */
1930
2203
  /* */
1931
- return (void 0);
1932
- }
1933
- isSymlinkFileExitedOrUnexisted(filePath) {
1934
2204
  /* */
1935
2205
  /* */
1936
2206
  /* */
@@ -1944,15 +2214,28 @@ class HelpersCore extends HelpersMessages {
1944
2214
  return (void 0);
1945
2215
  }
1946
2216
  /**
1947
- * If symbolnk link that target file does not exits
2217
+ * path.relative that return cross platform path
1948
2218
  */
1949
- isUnexistedLink(filePath) {
2219
+ relative(cwd, to) {
2220
+ return crossPlatformPath(path.relative(cwd, to));
2221
+ }
2222
+ removeFileIfExists(absoluteFilePath) {
2223
+ /* */
2224
+ /* */
2225
+ /* */
2226
+ /* */
2227
+ /* */
2228
+ /* */
1950
2229
  /* */
1951
2230
  /* */
1952
2231
  /* */
1953
2232
  /* */
1954
2233
  /* */
1955
2234
  /* */
2235
+ /* */
2236
+ return (void 0);
2237
+ }
2238
+ removeFolderIfExists(absoluteFolderPath) {
1956
2239
  /* */
1957
2240
  /* */
1958
2241
  /* */
@@ -1970,9 +2253,33 @@ class HelpersCore extends HelpersMessages {
1970
2253
  return (void 0);
1971
2254
  }
1972
2255
  /**
1973
- * @param existedLink check if source of link exists
2256
+ * leave max 1 empty line
1974
2257
  */
1975
- isExistedSymlink(filePath) {
2258
+ removeEmptyLineFromString(str) {
2259
+ const lines = (str || '').split('\n');
2260
+ let previousWasEmpty = false;
2261
+ return lines
2262
+ .filter(line => {
2263
+ if (line.trim() === '') {
2264
+ if (previousWasEmpty) {
2265
+ return false;
2266
+ }
2267
+ else {
2268
+ previousWasEmpty = true;
2269
+ return true;
2270
+ }
2271
+ }
2272
+ else {
2273
+ previousWasEmpty = false;
2274
+ return true;
2275
+ }
2276
+ })
2277
+ .join('\n');
2278
+ }
2279
+ /**
2280
+ * @deprecated
2281
+ */
2282
+ tryRemoveDir(dirpath, contentOnly = false, omitWarningNotExisted = false) {
1976
2283
  /* */
1977
2284
  /* */
1978
2285
  /* */
@@ -1995,27 +2302,6 @@ class HelpersCore extends HelpersMessages {
1995
2302
  /* */
1996
2303
  /* */
1997
2304
  /* */
1998
- return (void 0);
1999
- }
2000
- /* */
2001
- /* */
2002
- /* */
2003
- /* */
2004
- /* */
2005
- /* */
2006
- /* */
2007
- /* */
2008
- /* */
2009
- /* */
2010
- /* */
2011
- /* */
2012
- /* */
2013
- /* */
2014
- /* */
2015
- /* */
2016
- /* */
2017
- /* */
2018
- exists(folderOrFilePath) {
2019
2305
  /* */
2020
2306
  /* */
2021
2307
  /* */
@@ -2030,6 +2316,9 @@ class HelpersCore extends HelpersMessages {
2030
2316
  /* */
2031
2317
  /* */
2032
2318
  /* */
2319
+ return (void 0);
2320
+ }
2321
+ remove(fileOrFolderPathOrPatter, exactFolder = false) {
2033
2322
  /* */
2034
2323
  /* */
2035
2324
  /* */
@@ -2042,67 +2331,17 @@ class HelpersCore extends HelpersMessages {
2042
2331
  /* */
2043
2332
  return (void 0);
2044
2333
  }
2045
- /**
2046
- * this is HACK for running procesess inside processes
2047
- */
2048
- _fixCommand(command) {
2049
- if ((command.startsWith('tnp ') || command.startsWith('taon ')) && // TODO every cli projects here that uses run and need to kill process easly!
2050
- command.search('-spinner=false') === -1 &&
2051
- command.search('-spinner=off') === -1) {
2052
- command = `${command} -spinner=false`;
2053
- }
2054
- if (global.skipCoreCheck &&
2055
- (command.startsWith('tnp ') || command.startsWith('taon '))) {
2056
- command = `${command} --skipCoreCheck`;
2057
- }
2058
- return command;
2059
- }
2060
- command(command) {
2061
- command = Helpers._fixCommand(command);
2062
- return {
2063
- /* */
2064
- /* */
2065
- /* */
2066
- /* */
2067
- /* */
2068
- /* */
2069
- /* */
2070
- /* */
2071
- /* */
2072
- /* */
2073
- /* */
2074
- /* */
2075
- /* */
2076
- /* */
2077
- /* */
2078
- /* */
2079
- /* */
2080
- /* */
2081
- /* */
2082
- /* */
2083
- /* */
2084
- /* */
2085
- /* */
2086
- /* */
2087
- /* */
2088
- /* */
2089
- /* */
2090
- /* */
2091
- /* */
2092
- /* */
2093
- /* */
2094
- /* */
2095
- /* */
2096
- /* */
2097
- /* */
2098
- /* */
2099
- /* */
2100
- /* */
2101
- /* */
2102
- /* */
2103
- /* */
2104
- /* */
2105
- /* */
2334
+ /* */
2335
+ /* */
2336
+ /* */
2337
+ /* */
2338
+ /* */
2339
+ /* */
2340
+ /* */
2341
+ /* */
2342
+ /* */
2343
+ /* */
2344
+ get isRunningInGitBash() {
2106
2345
  /* */
2107
2346
  /* */
2108
2347
  /* */
@@ -2111,21 +2350,74 @@ class HelpersCore extends HelpersMessages {
2111
2350
  /* */
2112
2351
  /* */
2113
2352
  /* */
2353
+ return (void 0);
2354
+ }
2355
+ /**
2356
+ * Check if the current shell is supported by Taon framework.
2357
+ */
2358
+ get isSupportedTaonTerminal() {
2114
2359
  /* */
2115
2360
  /* */
2116
- };
2361
+ return (void 0);
2117
2362
  }
2118
- wait(second) {
2119
- return new Promise((resolve, reject) => {
2120
- setTimeout(() => {
2121
- resolve(void 0);
2122
- }, second * 1000);
2123
- });
2363
+ /**
2364
+ * check if function is class
2365
+ */
2366
+ isClass(funcOrClass) {
2367
+ let isClass = false;
2368
+ if (typeof funcOrClass === 'function') {
2369
+ isClass =
2370
+ !!funcOrClass.prototype &&
2371
+ Object.getOwnPropertyNames(funcOrClass.prototype).filter(f => f !== 'constructor').length > 0;
2372
+ }
2373
+ return isClass;
2374
+ }
2375
+ /**
2376
+ * check if data is nodejs/browser blob
2377
+ *
2378
+ * @param maybeBlob
2379
+ * @returns
2380
+ */
2381
+ isBlob(maybeBlob) {
2382
+ return maybeBlob instanceof Blob; // || toString.call(maybeBlob) === '[object Blob]';
2124
2383
  }
2384
+ /**
2385
+ * Check if data is nodejs buffer
2386
+ *
2387
+ * @param maybeNodejsBuffer
2388
+ * @returns
2389
+ */
2125
2390
  /* */
2126
2391
  /* */
2127
2392
  /* */
2128
2393
  /* */
2394
+ removeSlashAtEnd(s) {
2395
+ s = s?.endsWith(`/`) ? s.slice(0, s.length - 1) : s;
2396
+ return s;
2397
+ }
2398
+ removeSlashAtBegin(s) {
2399
+ s = s?.startsWith(`/`) ? s.slice(1) : s;
2400
+ return s;
2401
+ }
2402
+ /**
2403
+ * stringify to pretty json string
2404
+ */
2405
+ stringify(inputObject) {
2406
+ return JSON.stringify(inputObject, null, 2);
2407
+ }
2408
+ async runSyncOrAsync(fnOrOptions) {
2409
+ if (_.isUndefined(fnOrOptions)) {
2410
+ return void 0;
2411
+ }
2412
+ let promisOrValue;
2413
+ const { functionFn, context, arrayOfParams } = fnOrOptions;
2414
+ promisOrValue = functionFn.apply(context, arrayOfParams);
2415
+ // // @ts-ignore
2416
+ if (promisOrValue instanceof Promise) {
2417
+ promisOrValue = Promise.resolve(promisOrValue);
2418
+ }
2419
+ return promisOrValue;
2420
+ }
2129
2421
  /* */
2130
2422
  /* */
2131
2423
  /* */
@@ -2200,139 +2492,624 @@ class HelpersCore extends HelpersMessages {
2200
2492
  /* */
2201
2493
  /* */
2202
2494
  /* */
2203
- async killProcessByPort(portOrPortsToKill, options) {
2204
- /* */
2205
- /* */
2206
- /* */
2207
- /* */
2208
- /* */
2209
- /* */
2210
- /* */
2211
- /* */
2212
- /* */
2213
- /* */
2214
- /* */
2215
- /* */
2216
- /* */
2217
- /* */
2218
- /* */
2219
- /* */
2220
- /* */
2221
- /* */
2222
- /* */
2223
- /* */
2224
- /* */
2225
- /* */
2226
- /* */
2227
- /* */
2228
- /* */
2229
- /* */
2230
- /* */
2231
- /* */
2232
- /* */
2233
- /* */
2234
- /* */
2235
- /* */
2236
- /* */
2237
- /* */
2238
- /* */
2239
- /* */
2240
- /* */
2241
- /* */
2242
- /* */
2243
- /* */
2244
- /* */
2245
- /* */
2246
- /* */
2247
- /* */
2248
- return (void 0);
2249
- }
2250
- async killOnPort(portOrPortsToKill, options) {
2251
- return await Helpers.killProcessByPort(portOrPortsToKill, options);
2252
- }
2253
- killProcess(byPid) {
2254
- /* */
2255
- /* */
2256
- /* */
2257
- /* */
2258
- /* */
2259
- if (WEBSQL_PROC_MOCK_PROCESSES_PID[byPid]) {
2260
- const ppid = WEBSQL_PROC_MOCK_PROCESSES_PID[byPid].ppid;
2261
- if (WEBSQL_PROC_MOCK_PROCESSES_PPID[ppid]) {
2262
- const allChilds = WEBSQL_PROC_MOCK_PROCESSES_PPID[ppid]
2263
- .childProcesses;
2264
- WEBSQL_PROC_MOCK_PROCESSES_PPID[ppid].childProcesses = allChilds.filter(p => p !== byPid);
2265
- }
2266
- delete WEBSQL_PROC_MOCK_PROCESSES_PID[byPid];
2267
- }
2268
- if (WEBSQL_PROC_MOCK_PROCESSES_PPID[byPid]) {
2269
- const childs = WEBSQL_PROC_MOCK_PROCESSES_PPID[byPid]
2270
- .childProcesses;
2271
- for (let index = 0; index < childs.length; index++) {
2272
- const childPid = childs[index];
2273
- delete WEBSQL_PROC_MOCK_PROCESSES_PID[childPid];
2274
- }
2275
- delete WEBSQL_PROC_MOCK_PROCESSES_PPID[byPid];
2276
- }
2277
- }
2278
- run(command, options) {
2279
- command = Helpers._fixCommand(command);
2280
- /* */
2281
- /* */
2282
- /* */
2283
- /* */
2284
- /* */
2285
- /* */
2286
- /* */
2287
- /* */
2288
- return {
2289
- /**
2290
- * start command as synchronous nodej proces
2291
- */
2292
- sync() {
2293
- /* */
2294
- /* */
2295
- /* */
2296
- /* */
2297
- /* */
2298
- /* */
2299
- /* */
2300
- /* */
2301
- /* */
2302
- /* */
2303
- /* */
2304
- /* */
2305
- /* */
2306
- /* */
2307
- /* */
2308
- /* */
2309
- /* */
2310
- /* */
2311
- /* */
2312
- /* */
2313
- /* */
2314
- /* */
2315
- /* */
2316
- /* */
2317
- /* */
2318
- /* */
2319
- /* */
2320
- /* */
2321
- /* */
2322
- /* */
2323
- /* */
2324
- return (void 0);
2325
- },
2326
- /**
2327
- * start command as asynchronous nodej proces
2328
- * @param detach (default: false) - if true process will be detached
2329
- */
2330
- async(detach = false, mockFun) {
2331
- if (mockFun) {
2332
- const subStdoutSub = new Subject();
2333
- const subStderSub = new Subject();
2334
- const exitSub = new Subject();
2335
- const subscribtions = [];
2495
+ /* */
2496
+ /* */
2497
+ /* */
2498
+ /* */
2499
+ /* */
2500
+ /* */
2501
+ /* */
2502
+ /* */
2503
+ /* */
2504
+ /* */
2505
+ /* */
2506
+ /* */
2507
+ /* */
2508
+ /* */
2509
+ /* */
2510
+ /* */
2511
+ /* */
2512
+ /* */
2513
+ /* */
2514
+ /* */
2515
+ /* */
2516
+ /* */
2517
+ /* */
2518
+ /* */
2519
+ /* */
2520
+ /* */
2521
+ /* */
2522
+ /* */
2523
+ /* */
2524
+ /* */
2525
+ /* */
2526
+ /* */
2527
+ /* */
2528
+ /* */
2529
+ /* */
2530
+ /* */
2531
+ /* */
2532
+ /* */
2533
+ /* */
2534
+ /* */
2535
+ /* */
2536
+ /* */
2537
+ /* */
2538
+ /* */
2539
+ /* */
2540
+ /* */
2541
+ /* */
2542
+ /* */
2543
+ /* */
2544
+ /* */
2545
+ /* */
2546
+ /* */
2547
+ /* */
2548
+ /* */
2549
+ /* */
2550
+ /* */
2551
+ /* */
2552
+ /* */
2553
+ /* */
2554
+ /* */
2555
+ /* */
2556
+ /* */
2557
+ /* */
2558
+ /* */
2559
+ /* */
2560
+ /* */
2561
+ /* */
2562
+ /* */
2563
+ /* */
2564
+ /* */
2565
+ /* */
2566
+ /* */
2567
+ /* */
2568
+ /* */
2569
+ /* */
2570
+ /* */
2571
+ /* */
2572
+ /* */
2573
+ /* */
2574
+ /* */
2575
+ /* */
2576
+ /* */
2577
+ /* */
2578
+ /* */
2579
+ /* */
2580
+ /* */
2581
+ /* */
2582
+ /* */
2583
+ /* */
2584
+ /* */
2585
+ /* */
2586
+ /* */
2587
+ /* */
2588
+ /* */
2589
+ /* */
2590
+ /* */
2591
+ /* */
2592
+ /* */
2593
+ /* */
2594
+ /* */
2595
+ /* */
2596
+ /* */
2597
+ /* */
2598
+ /* */
2599
+ /* */
2600
+ /* */
2601
+ /* */
2602
+ /* */
2603
+ /* */
2604
+ /* */
2605
+ /* */
2606
+ /* */
2607
+ /* */
2608
+ /* */
2609
+ /* */
2610
+ /* */
2611
+ /* */
2612
+ /* */
2613
+ /* */
2614
+ /* */
2615
+ /* */
2616
+ /* */
2617
+ /* */
2618
+ /* */
2619
+ /* */
2620
+ /* */
2621
+ /* */
2622
+ /* */
2623
+ /* */
2624
+ /* */
2625
+ /* */
2626
+ /* */
2627
+ /* */
2628
+ /* */
2629
+ /* */
2630
+ /* */
2631
+ /* */
2632
+ /* */
2633
+ /* */
2634
+ /* */
2635
+ /* */
2636
+ /* */
2637
+ /* */
2638
+ /* */
2639
+ /* */
2640
+ /* */
2641
+ /* */
2642
+ /* */
2643
+ /* */
2644
+ /* */
2645
+ /* */
2646
+ /* */
2647
+ /* */
2648
+ /* */
2649
+ /* */
2650
+ /* */
2651
+ /* */
2652
+ /* */
2653
+ /* */
2654
+ /* */
2655
+ /* */
2656
+ /* */
2657
+ /* */
2658
+ /* */
2659
+ /* */
2660
+ /* */
2661
+ /* */
2662
+ /* */
2663
+ /* */
2664
+ /* */
2665
+ /* */
2666
+ /* */
2667
+ /**
2668
+ * symlink may have existed or unexisted destiantion url
2669
+ * @param destUrl M
2670
+ */
2671
+ isSymlinkThatMatchesUrl(possibleSymlink, destUrl, absoluteFileMatch = false) {
2672
+ /* */
2673
+ /* */
2674
+ /* */
2675
+ /* */
2676
+ /* */
2677
+ /* */
2678
+ /* */
2679
+ /* */
2680
+ /* */
2681
+ /* */
2682
+ /* */
2683
+ /* */
2684
+ /* */
2685
+ /* */
2686
+ /* */
2687
+ /* */
2688
+ /* */
2689
+ /* */
2690
+ /* */
2691
+ /* */
2692
+ /* */
2693
+ /* */
2694
+ /* */
2695
+ /* */
2696
+ /* */
2697
+ /* */
2698
+ /* */
2699
+ /* */
2700
+ /* */
2701
+ /* */
2702
+ /* */
2703
+ /* */
2704
+ /* */
2705
+ return (void 0);
2706
+ }
2707
+ isSymlinkFileExitedOrUnexisted(filePath) {
2708
+ /* */
2709
+ /* */
2710
+ /* */
2711
+ /* */
2712
+ /* */
2713
+ /* */
2714
+ /* */
2715
+ /* */
2716
+ /* */
2717
+ /* */
2718
+ return (void 0);
2719
+ }
2720
+ /**
2721
+ * If symbolnk link that target file does not exits
2722
+ */
2723
+ isUnexistedLink(filePath) {
2724
+ /* */
2725
+ /* */
2726
+ /* */
2727
+ /* */
2728
+ /* */
2729
+ /* */
2730
+ /* */
2731
+ /* */
2732
+ /* */
2733
+ /* */
2734
+ /* */
2735
+ /* */
2736
+ /* */
2737
+ /* */
2738
+ /* */
2739
+ /* */
2740
+ /* */
2741
+ /* */
2742
+ /* */
2743
+ /* */
2744
+ return (void 0);
2745
+ }
2746
+ /**
2747
+ * @param existedLink check if source of link exists
2748
+ */
2749
+ isExistedSymlink(filePath) {
2750
+ /* */
2751
+ /* */
2752
+ /* */
2753
+ /* */
2754
+ /* */
2755
+ /* */
2756
+ /* */
2757
+ /* */
2758
+ /* */
2759
+ /* */
2760
+ /* */
2761
+ /* */
2762
+ /* */
2763
+ /* */
2764
+ /* */
2765
+ /* */
2766
+ /* */
2767
+ /* */
2768
+ /* */
2769
+ /* */
2770
+ /* */
2771
+ /* */
2772
+ return (void 0);
2773
+ }
2774
+ /* */
2775
+ /* */
2776
+ /* */
2777
+ /* */
2778
+ /* */
2779
+ /* */
2780
+ /* */
2781
+ /* */
2782
+ /* */
2783
+ /* */
2784
+ /* */
2785
+ /* */
2786
+ /* */
2787
+ /* */
2788
+ /* */
2789
+ /* */
2790
+ /* */
2791
+ /* */
2792
+ exists(folderOrFilePath) {
2793
+ /* */
2794
+ /* */
2795
+ /* */
2796
+ /* */
2797
+ /* */
2798
+ /* */
2799
+ /* */
2800
+ /* */
2801
+ /* */
2802
+ /* */
2803
+ /* */
2804
+ /* */
2805
+ /* */
2806
+ /* */
2807
+ /* */
2808
+ /* */
2809
+ /* */
2810
+ /* */
2811
+ /* */
2812
+ /* */
2813
+ /* */
2814
+ /* */
2815
+ /* */
2816
+ /* */
2817
+ return (void 0);
2818
+ }
2819
+ /**
2820
+ * this is HACK for running procesess inside processes
2821
+ */
2822
+ _fixCommand(command) {
2823
+ if ((command.startsWith('tnp ') || command.startsWith('taon ')) && // TODO every cli projects here that uses run and need to kill process easly!
2824
+ command.search('-spinner=false') === -1 &&
2825
+ command.search('-spinner=off') === -1) {
2826
+ command = `${command} -spinner=false`;
2827
+ }
2828
+ if (global.skipCoreCheck &&
2829
+ (command.startsWith('tnp ') || command.startsWith('taon '))) {
2830
+ command = `${command} --skipCoreCheck`;
2831
+ }
2832
+ return command;
2833
+ }
2834
+ command(command) {
2835
+ command = Helpers._fixCommand(command);
2836
+ return {
2837
+ /* */
2838
+ /* */
2839
+ /* */
2840
+ /* */
2841
+ /* */
2842
+ /* */
2843
+ /* */
2844
+ /* */
2845
+ /* */
2846
+ /* */
2847
+ /* */
2848
+ /* */
2849
+ /* */
2850
+ /* */
2851
+ /* */
2852
+ /* */
2853
+ /* */
2854
+ /* */
2855
+ /* */
2856
+ /* */
2857
+ /* */
2858
+ /* */
2859
+ /* */
2860
+ /* */
2861
+ /* */
2862
+ /* */
2863
+ /* */
2864
+ /* */
2865
+ /* */
2866
+ /* */
2867
+ /* */
2868
+ /* */
2869
+ /* */
2870
+ /* */
2871
+ /* */
2872
+ /* */
2873
+ /* */
2874
+ /* */
2875
+ /* */
2876
+ /* */
2877
+ /* */
2878
+ /* */
2879
+ /* */
2880
+ /* */
2881
+ /* */
2882
+ /* */
2883
+ /* */
2884
+ /* */
2885
+ /* */
2886
+ /* */
2887
+ /* */
2888
+ /* */
2889
+ /* */
2890
+ };
2891
+ }
2892
+ wait(second) {
2893
+ return new Promise((resolve, reject) => {
2894
+ setTimeout(() => {
2895
+ resolve(void 0);
2896
+ }, second * 1000);
2897
+ });
2898
+ }
2899
+ async timeout(seconds) {
2900
+ return await Helpers.wait(seconds);
2901
+ }
2902
+ /* */
2903
+ /* */
2904
+ /* */
2905
+ /* */
2906
+ /* */
2907
+ /* */
2908
+ /* */
2909
+ /* */
2910
+ /* */
2911
+ /* */
2912
+ /* */
2913
+ /* */
2914
+ /* */
2915
+ /* */
2916
+ /* */
2917
+ /* */
2918
+ /* */
2919
+ /* */
2920
+ /* */
2921
+ /* */
2922
+ /* */
2923
+ /* */
2924
+ /* */
2925
+ /* */
2926
+ /* */
2927
+ /* */
2928
+ /* */
2929
+ /* */
2930
+ /* */
2931
+ /* */
2932
+ /* */
2933
+ /* */
2934
+ /* */
2935
+ /* */
2936
+ /* */
2937
+ /* */
2938
+ /* */
2939
+ /* */
2940
+ /* */
2941
+ /* */
2942
+ /* */
2943
+ /* */
2944
+ /* */
2945
+ /* */
2946
+ /* */
2947
+ /* */
2948
+ /* */
2949
+ /* */
2950
+ /* */
2951
+ /* */
2952
+ /* */
2953
+ /* */
2954
+ /* */
2955
+ /* */
2956
+ /* */
2957
+ /* */
2958
+ /* */
2959
+ /* */
2960
+ /* */
2961
+ /* */
2962
+ /* */
2963
+ /* */
2964
+ /* */
2965
+ /* */
2966
+ /* */
2967
+ /* */
2968
+ /* */
2969
+ /* */
2970
+ /* */
2971
+ /* */
2972
+ /* */
2973
+ /* */
2974
+ /* */
2975
+ /* */
2976
+ /* */
2977
+ /* */
2978
+ /* */
2979
+ /* */
2980
+ async killProcessByPort(portOrPortsToKill, options) {
2981
+ /* */
2982
+ /* */
2983
+ /* */
2984
+ /* */
2985
+ /* */
2986
+ /* */
2987
+ /* */
2988
+ /* */
2989
+ /* */
2990
+ /* */
2991
+ /* */
2992
+ /* */
2993
+ /* */
2994
+ /* */
2995
+ /* */
2996
+ /* */
2997
+ /* */
2998
+ /* */
2999
+ /* */
3000
+ /* */
3001
+ /* */
3002
+ /* */
3003
+ /* */
3004
+ /* */
3005
+ /* */
3006
+ /* */
3007
+ /* */
3008
+ /* */
3009
+ /* */
3010
+ /* */
3011
+ /* */
3012
+ /* */
3013
+ /* */
3014
+ /* */
3015
+ /* */
3016
+ /* */
3017
+ /* */
3018
+ /* */
3019
+ /* */
3020
+ /* */
3021
+ /* */
3022
+ /* */
3023
+ /* */
3024
+ /* */
3025
+ return (void 0);
3026
+ }
3027
+ async killOnPort(portOrPortsToKill, options) {
3028
+ return await Helpers.killProcessByPort(portOrPortsToKill, options);
3029
+ }
3030
+ killProcess(byPid) {
3031
+ /* */
3032
+ /* */
3033
+ /* */
3034
+ /* */
3035
+ /* */
3036
+ if (WEBSQL_PROC_MOCK_PROCESSES_PID[byPid]) {
3037
+ const ppid = WEBSQL_PROC_MOCK_PROCESSES_PID[byPid].ppid;
3038
+ if (WEBSQL_PROC_MOCK_PROCESSES_PPID[ppid]) {
3039
+ const allChilds = WEBSQL_PROC_MOCK_PROCESSES_PPID[ppid]
3040
+ .childProcesses;
3041
+ WEBSQL_PROC_MOCK_PROCESSES_PPID[ppid].childProcesses = allChilds.filter(p => p !== byPid);
3042
+ }
3043
+ delete WEBSQL_PROC_MOCK_PROCESSES_PID[byPid];
3044
+ }
3045
+ if (WEBSQL_PROC_MOCK_PROCESSES_PPID[byPid]) {
3046
+ const childs = WEBSQL_PROC_MOCK_PROCESSES_PPID[byPid]
3047
+ .childProcesses;
3048
+ for (let index = 0; index < childs.length; index++) {
3049
+ const childPid = childs[index];
3050
+ delete WEBSQL_PROC_MOCK_PROCESSES_PID[childPid];
3051
+ }
3052
+ delete WEBSQL_PROC_MOCK_PROCESSES_PPID[byPid];
3053
+ }
3054
+ }
3055
+ run(command, options) {
3056
+ command = Helpers._fixCommand(command);
3057
+ /* */
3058
+ /* */
3059
+ /* */
3060
+ /* */
3061
+ /* */
3062
+ /* */
3063
+ /* */
3064
+ /* */
3065
+ return {
3066
+ /**
3067
+ * start command as synchronous nodej proces
3068
+ */
3069
+ sync() {
3070
+ /* */
3071
+ /* */
3072
+ /* */
3073
+ /* */
3074
+ /* */
3075
+ /* */
3076
+ /* */
3077
+ /* */
3078
+ /* */
3079
+ /* */
3080
+ /* */
3081
+ /* */
3082
+ /* */
3083
+ /* */
3084
+ /* */
3085
+ /* */
3086
+ /* */
3087
+ /* */
3088
+ /* */
3089
+ /* */
3090
+ /* */
3091
+ /* */
3092
+ /* */
3093
+ /* */
3094
+ /* */
3095
+ /* */
3096
+ /* */
3097
+ /* */
3098
+ /* */
3099
+ /* */
3100
+ /* */
3101
+ return (void 0);
3102
+ },
3103
+ /**
3104
+ * start command as asynchronous nodej proces
3105
+ * @param detach (default: false) - if true process will be detached
3106
+ */
3107
+ async(detach = false, mockFun) {
3108
+ if (mockFun) {
3109
+ const subStdoutSub = new Subject();
3110
+ const subStderSub = new Subject();
3111
+ const exitSub = new Subject();
3112
+ const subscribtions = [];
2336
3113
  const procDummy = {
2337
3114
  stdout: {
2338
3115
  on(action, stdoutCallback) {
@@ -2651,168 +3428,15 @@ class HelpersCore extends HelpersMessages {
2651
3428
  /* */
2652
3429
  /* */
2653
3430
  /* */
2654
- /* */
2655
- /* */
2656
- /* */
2657
- /* */
2658
- /* */
2659
- /* */
2660
- /* */
2661
- return (void 0);
2662
- }
2663
- /* */
2664
- /* */
2665
- /* */
2666
- /* */
2667
- /* */
2668
- /* */
2669
- /* */
2670
- /* */
2671
- /* */
2672
- /* */
2673
- /* */
2674
- /* */
2675
- /* */
2676
- /* */
2677
- /* */
2678
- /* */
2679
- /* */
2680
- /* */
2681
- /* */
2682
- /* */
2683
- /* */
2684
- /* */
2685
- /* */
2686
- /* */
2687
- /* */
2688
- /* */
2689
- /* */
2690
- /* */
2691
- /* */
2692
- /* */
2693
- /* */
2694
- /* */
2695
- /* */
2696
- /* */
2697
- /* */
2698
- /* */
2699
- /* */
2700
- /* */
2701
- /* */
2702
- /* */
2703
- /* */
2704
- /* */
2705
- /* */
2706
- /* */
2707
- /* */
2708
- /* */
2709
- /* */
2710
- /* */
2711
- /* */
2712
- /* */
2713
- /* */
2714
- /* */
2715
- /* */
2716
- /* */
2717
- /* */
2718
- /* */
2719
- /* */
2720
- /* */
2721
- /* */
2722
- /* */
2723
- /* */
2724
- /* */
2725
- /* */
2726
- /* */
2727
- /* */
2728
- /* */
2729
- /* */
2730
- /* */
2731
- /* */
2732
- /* */
2733
- /* */
2734
- /* */
2735
- /* */
2736
- /* */
2737
- /* */
2738
- /* */
2739
- /* */
2740
- /* */
2741
- /* */
2742
- /* */
2743
- /* */
2744
- /* */
2745
- /* */
2746
- /* */
2747
- /* */
2748
- /* */
2749
- /* */
2750
- /* */
2751
- /* */
2752
- /* */
2753
- /* */
2754
- /* */
2755
- /* */
2756
- /* */
2757
- /* */
2758
- /* */
2759
- /* */
2760
- /* */
2761
- /* */
2762
- /* */
2763
- /* */
2764
- /* */
2765
- /* */
2766
- /* */
2767
- /* */
2768
- /* */
2769
- /* */
2770
- /* */
2771
- /* */
2772
- /* */
2773
- /* */
2774
- /* */
2775
- /* */
2776
- /* */
2777
- /* */
2778
- /* */
2779
- /* */
2780
- /* */
2781
- /* */
2782
- /* */
2783
- /* */
2784
- /* */
2785
- /* */
2786
- /* */
2787
- /* */
2788
- /* */
2789
- /* */
2790
- /* */
2791
- /* */
2792
- /* */
2793
- /* */
2794
- /* */
2795
- /* */
2796
- /* */
2797
- /* */
2798
- /* */
2799
- /* */
2800
- /* */
2801
- /* */
2802
- /* */
2803
- /* */
2804
- /* */
2805
- /* */
2806
- /* */
2807
- /* */
2808
- /* */
2809
- /* */
2810
- /* */
2811
- /* */
2812
- /* */
2813
- /* */
2814
- /* */
2815
- /* */
3431
+ /* */
3432
+ /* */
3433
+ /* */
3434
+ /* */
3435
+ /* */
3436
+ /* */
3437
+ /* */
3438
+ return (void 0);
3439
+ }
2816
3440
  /* */
2817
3441
  /* */
2818
3442
  /* */
@@ -3179,23 +3803,6 @@ class HelpersCore extends HelpersMessages {
3179
3803
  /* */
3180
3804
  /* */
3181
3805
  /* */
3182
- /**
3183
- * Quick fix for object values
3184
- * @deprecated
3185
- */
3186
- values(obj) {
3187
- if (_.isObject(obj) && !Array.isArray(obj)) {
3188
- const values = [];
3189
- for (const key in obj) {
3190
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
3191
- // @ts-ignore
3192
- values.push(obj[key]);
3193
- }
3194
- }
3195
- return values;
3196
- }
3197
- return [];
3198
- }
3199
3806
  /* */
3200
3807
  /* */
3201
3808
  /* */
@@ -3349,6 +3956,23 @@ class HelpersCore extends HelpersMessages {
3349
3956
  /* */
3350
3957
  /* */
3351
3958
  /* */
3959
+ /**
3960
+ * Quick fix for object values
3961
+ * @deprecated
3962
+ */
3963
+ values(obj) {
3964
+ if (_.isObject(obj) && !Array.isArray(obj)) {
3965
+ const values = [];
3966
+ for (const key in obj) {
3967
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
3968
+ // @ts-ignore
3969
+ values.push(obj[key]);
3970
+ }
3971
+ }
3972
+ return values;
3973
+ }
3974
+ return [];
3975
+ }
3352
3976
  /* */
3353
3977
  /* */
3354
3978
  /* */
@@ -3358,14 +3982,6 @@ class HelpersCore extends HelpersMessages {
3358
3982
  /* */
3359
3983
  /* */
3360
3984
  /* */
3361
- replaceLinesInFile(absoluteFilePath, lineReplaceFn) {
3362
- /* */
3363
- /* */
3364
- /* */
3365
- /* */
3366
- /* */
3367
- /* */
3368
- }
3369
3985
  /* */
3370
3986
  /* */
3371
3987
  /* */
@@ -3519,6 +4135,14 @@ class HelpersCore extends HelpersMessages {
3519
4135
  /* */
3520
4136
  /* */
3521
4137
  /* */
4138
+ replaceLinesInFile(absoluteFilePath, lineReplaceFn) {
4139
+ /* */
4140
+ /* */
4141
+ /* */
4142
+ /* */
4143
+ /* */
4144
+ /* */
4145
+ }
3522
4146
  /* */
3523
4147
  /* */
3524
4148
  /* */
@@ -3702,360 +4326,181 @@ class HelpersCore extends HelpersMessages {
3702
4326
  /* */
3703
4327
  /* */
3704
4328
  /* */
3705
- hideNodeWarnings() {
3706
- /* */
3707
- /* */
3708
- /* */
3709
- }
3710
- }
3711
- ;
3712
- ({}); // @--end-of-file-for-module=tnp-core lib/helpers.ts
3713
-
3714
- const CoreConfig = {
3715
- message: {
3716
- globalSystemToolMode: 'globalSystemToolMode',
3717
- },
3718
- };
3719
- ;
3720
- ({}); // @--end-of-file-for-module=tnp-core lib/core-config.ts
3721
-
3722
- class PROGRESS_DATA {
3723
- constructor() {
3724
- this.type = 'event';
3725
- }
3726
- static log(log) {
3727
- /* */
3728
- /* */
3729
- /* */
3730
- /* */
3731
- /* */
3732
- /* */
3733
- /* */
3734
- }
3735
- static resolveFrom(chunk, callbackOnFounded, checkSplit = true) {
3736
- let progress;
3737
- let res = [];
3738
- if (!_.isString(chunk)) {
3739
- return [];
3740
- }
3741
- chunk = chunk.trim();
3742
- if (checkSplit) {
3743
- const split = chunk.split(/\r\n|\n|\r/);
3744
- if (split.length > 1) {
3745
- split.forEach(s => {
3746
- res = res.concat(this.resolveFrom(s, callbackOnFounded, false));
3747
- });
3748
- return res;
3749
- }
3750
- }
3751
- if (/\[\[\[.*\]\]\]/g.test(chunk)) {
3752
- chunk = chunk.replace(/^\[\[\[/g, '').replace(/\]\]\]$/g, '');
3753
- progress = chunk;
3754
- }
3755
- if (!_.isUndefined(progress)) {
3756
- try {
3757
- const p = JSON.parse(progress);
3758
- const single = _.merge(new PROGRESS_DATA(), p);
3759
- res = res.concat([single]);
3760
- if (_.isFunction(callbackOnFounded)) {
3761
- callbackOnFounded(single);
3762
- }
3763
- }
3764
- catch (err) {
3765
- Helpers.error(err, true, true);
3766
- Helpers.error(`ProgresssBarData: fail to parse "${progress}"`, true, true);
3767
- }
3768
- }
3769
- return res;
3770
- }
3771
- }
3772
- ;
3773
- ({}); // @--end-of-file-for-module=tnp-core lib/progress-data.ts
3774
-
3775
- /* */
3776
- /* */
3777
- /* */
3778
- const BLOB_SUPPORTED_IN_SQLJS = false;
3779
- var Utils;
3780
- (function (Utils) {
3781
- Utils.uniqArray = (array, uniqueProperty) => {
3782
- var seen = {};
3783
- return array
3784
- .filter(f => !!f)
3785
- .filter(function (item) {
3786
- return seen.hasOwnProperty(uniqueProperty ? item[uniqueProperty] : item)
3787
- ? false
3788
- : (seen[uniqueProperty ? item[uniqueProperty] : item] = true);
3789
- });
3790
- };
3791
- /**
3792
- * Example:
3793
- * new RegExp(escapeStringForRegEx('a.b.c'),'g') => /a\.b\.c/g
3794
- */
3795
- Utils.escapeStringForRegEx = (stringForRegExp) => {
3796
- return stringForRegExp.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
3797
- };
3798
- function removeChalkSpecialChars(str) {
3799
- const ansiRegex = /\u001b\[[0-9;]*m/g;
3800
- return str.replace(ansiRegex, '');
3801
- }
3802
- Utils.removeChalkSpecialChars = removeChalkSpecialChars;
3803
- Utils.fullDateTime = () => {
3804
- /* */
3805
- /* */
3806
- return (void 0);
3807
- };
3808
- Utils.fullDate = () => {
3809
- /* */
3810
- /* */
3811
- return (void 0);
3812
- };
3813
- let json;
3814
- (function (json) {
3815
- json.getAtrributies = (jsonDeepPath, // lodash path to property in json ex. deep.path.to.prop
3816
- fileContent) => {
3817
- const lines = fileContent.split('\n');
3818
- const pathParts = jsonDeepPath.split('.').reduce((a, b) => {
3819
- if (a.length === 0) {
3820
- return [b];
3821
- }
3822
- const last = a[a.length - 1];
3823
- if ((last.startsWith(`['`) && b.endsWith(`']`)) ||
3824
- (last.startsWith(`["`) && b.endsWith(`"]`))) {
3825
- a[a.length - 1] = [last, b].join('.');
3826
- }
3827
- else {
3828
- a.push(b);
3829
- }
3830
- return a;
3831
- }, []);
3832
- const keyName = pathParts.pop().replace(/^\["(.+)"\]$/, '$1');
3833
- let currentPath = '';
3834
- let attributes = [];
3835
- let collectedComments = [];
3836
- for (const line of lines) {
3837
- const trimmedLine = line.trim();
3838
- if (trimmedLine.startsWith('//')) {
3839
- collectedComments.push(trimmedLine);
3840
- }
3841
- else if (trimmedLine.startsWith('"') || trimmedLine.startsWith("'")) {
3842
- const match = trimmedLine.match(/["']([^"']+)["']\s*:/);
3843
- if (match) {
3844
- const key = match[1];
3845
- currentPath = currentPath
3846
- ? `${currentPath}.${key.includes('.') ? `['${key}']` : key}`
3847
- : key;
3848
- if ((currentPath.endsWith(keyName) &&
3849
- !currentPath.endsWith('/' + keyName)) ||
3850
- currentPath.endsWith(`['${keyName}']`)) {
3851
- attributes = extractAttributesFromComments(collectedComments);
3852
- break;
3853
- }
3854
- collectedComments = [];
3855
- }
3856
- }
3857
- }
3858
- return attributes;
3859
- };
3860
- const extractAttributesFromComments = (comments) => {
3861
- const attributes = [];
3862
- const attrRegex = /@(\w+)(?:\s*=\s*([^\s@]+))?/g;
3863
- for (const comment of comments) {
3864
- let match;
3865
- while ((match = attrRegex.exec(comment)) !== null) {
3866
- const [, name, value] = match;
3867
- const existingAttribute = attributes.find(attr => attr.name === `@${name}`);
3868
- if (existingAttribute) {
3869
- if (value) {
3870
- if (Array.isArray(existingAttribute.value)) {
3871
- existingAttribute.value.push(value);
3872
- }
3873
- else {
3874
- existingAttribute.value = [existingAttribute.value, value];
3875
- }
3876
- }
3877
- }
3878
- else {
3879
- attributes.push({
3880
- name: `@${name}`,
3881
- value: value ? value : true,
3882
- });
3883
- }
3884
- }
3885
- }
3886
- attributes.forEach(attr => {
3887
- if (Array.isArray(attr.value) && attr.value.length === 1) {
3888
- attr.value = attr.value[0];
3889
- }
3890
- });
3891
- return attributes;
3892
- };
3893
- })(json = Utils.json || (Utils.json = {}));
3894
- let DbBinaryFormatEnum;
3895
- (function (DbBinaryFormatEnum) {
3896
- DbBinaryFormatEnum["Blob"] = "Blob";
3897
- DbBinaryFormatEnum["File"] = "File";
3898
- DbBinaryFormatEnum["string"] = "string";
3899
- /* */
3900
- /* */
3901
- })(DbBinaryFormatEnum = Utils.DbBinaryFormatEnum || (Utils.DbBinaryFormatEnum = {}));
3902
4329
  /* */
3903
4330
  /* */
3904
- let binary;
3905
- (function (binary) {
3906
- /**
3907
- * This is for BROWSER ONLY
3908
- *
3909
- * @param buffer
3910
- * @param contentType
3911
- * @returns
3912
- */
3913
- async function arrayBufferToBlob(buffer, contentType) {
3914
- // @ts-ignore
3915
- return new Blob([buffer], { type: contentType });
3916
- }
3917
- binary.arrayBufferToBlob = arrayBufferToBlob;
3918
- /**
3919
- * This is for BROWSER ONLY
3920
- * @param blob
3921
- * @returns
3922
- */
3923
- async function blobToArrayBuffer(blob) {
3924
- return await new Promise((resolve, reject) => {
3925
- const reader = new FileReader();
3926
- reader.addEventListener('loadend', () => {
3927
- resolve(reader.result);
3928
- });
3929
- reader.addEventListener('error', reject); // @ts-ignore
3930
- reader.readAsArrayBuffer(blob);
3931
- });
3932
- }
3933
- binary.blobToArrayBuffer = blobToArrayBuffer;
3934
- /**
3935
- * it is revers to base64toBlob
3936
- * @param blob
3937
- * @returns
3938
- */
3939
- function blobToBase64(blob) {
3940
- return new Promise((resolve, _) => {
3941
- const reader = new FileReader();
3942
- reader.onloadend = () => resolve(reader.result); // @ts-ignore
3943
- reader.readAsDataURL(blob);
3944
- });
3945
- }
3946
- binary.blobToBase64 = blobToBase64;
3947
- /**
3948
- * it is revers to blobToBase64()
3949
- * @param base64Data
3950
- * @returns
3951
- */
3952
- async function base64toBlob(base64Data, contentTypeOverride) {
3953
- let content_type = void 0;
3954
- let file_base64 = void 0;
3955
- if (!contentTypeOverride) {
3956
- const m = /^data:(.+?);base64,(.+)$/.exec(base64Data);
3957
- if (!m) {
3958
- throw new Error(`[taon-framework][base64toBlob] Not a base64 blob [${base64Data}]`);
3959
- }
3960
- var [__, contenttype, filebase64] = m;
3961
- content_type = contenttype;
3962
- file_base64 = filebase64;
3963
- }
3964
- content_type = (contentTypeOverride ? contentTypeOverride : content_type || '');
3965
- base64Data = contentTypeOverride ? base64Data : file_base64;
3966
- const sliceSize = 1024;
3967
- const byteCharacters = atob(base64Data);
3968
- const bytesLength = byteCharacters.length;
3969
- const slicesCount = Math.ceil(bytesLength / sliceSize);
3970
- const byteArrays = new Array(slicesCount);
3971
- for (let sliceIndex = 0; sliceIndex < slicesCount; ++sliceIndex) {
3972
- const begin = sliceIndex * sliceSize;
3973
- const end = Math.min(begin + sliceSize, bytesLength);
3974
- const bytes = new Array(end - begin);
3975
- for (let offset = begin, i = 0; offset < end; ++i, ++offset) {
3976
- bytes[i] = byteCharacters[offset].charCodeAt(0);
3977
- }
3978
- byteArrays[sliceIndex] = new Uint8Array(bytes);
3979
- }
3980
- return new Blob(byteArrays, { type: content_type });
3981
- }
3982
- binary.base64toBlob = base64toBlob;
3983
- async function base64toDbBinaryFormat(text) {
3984
- let result;
3985
- result = await (async () => {
3986
- if (BLOB_SUPPORTED_IN_SQLJS) {
3987
- const blob = await base64toBlob(text);
3988
- return blob;
3989
- }
3990
- return text;
3991
- })();
3992
- /* */
3993
- /* */
3994
- /* */
3995
- /* */
3996
- /* */
3997
- return result;
3998
- }
3999
- binary.base64toDbBinaryFormat = base64toDbBinaryFormat;
4000
- async function dbBinaryFormatToBase64(binaryFormat) {
4001
- let result;
4002
- result = await (async () => {
4003
- if (BLOB_SUPPORTED_IN_SQLJS) {
4004
- const text = await blobToBase64(binaryFormat);
4005
- return text;
4006
- }
4007
- return binaryFormat;
4008
- })();
4009
- /* */
4010
- /* */
4011
- /* */
4012
- /* */
4013
- /* */
4014
- return result;
4015
- }
4016
- binary.dbBinaryFormatToBase64 = dbBinaryFormatToBase64;
4017
- async function textToDbBinaryFormat(text) {
4018
- let result;
4019
- result = await (async () => {
4020
- if (BLOB_SUPPORTED_IN_SQLJS) {
4021
- const blob = await textToBlob(text);
4022
- return blob;
4023
- }
4024
- return text;
4025
- })();
4026
- /* */
4027
- /* */
4028
- /* */
4029
- /* */
4030
- /* */
4031
- return result;
4032
- }
4033
- binary.textToDbBinaryFormat = textToDbBinaryFormat;
4034
- async function dbBinaryFormatToText(binaryFormat) {
4035
- let result;
4036
- result = await (async () => {
4037
- if (BLOB_SUPPORTED_IN_SQLJS) {
4038
- const text = await blobToText(binaryFormat);
4039
- return text;
4040
- }
4041
- return binaryFormat;
4042
- })();
4043
- /* */
4044
- /* */
4045
- /* */
4046
- /* */
4047
- /* */
4048
- return result;
4049
- }
4050
- binary.dbBinaryFormatToText = dbBinaryFormatToText;
4051
- /* */
4052
- /* */
4053
- /* */
4054
- /* */
4055
- /* */
4331
+ /* */
4332
+ /* */
4333
+ /* */
4334
+ /* */
4335
+ /* */
4336
+ /* */
4337
+ /* */
4338
+ /* */
4339
+ /* */
4340
+ /* */
4341
+ /* */
4342
+ /* */
4343
+ /* */
4344
+ /* */
4345
+ /* */
4346
+ /* */
4347
+ /* */
4348
+ /* */
4349
+ /* */
4350
+ /* */
4351
+ /* */
4352
+ /* */
4353
+ /* */
4354
+ /* */
4355
+ /* */
4356
+ /* */
4357
+ /* */
4358
+ /* */
4359
+ /* */
4360
+ /* */
4361
+ /* */
4362
+ /* */
4363
+ /* */
4364
+ /* */
4365
+ /* */
4366
+ /* */
4367
+ /* */
4368
+ /* */
4369
+ /* */
4370
+ /* */
4371
+ /* */
4372
+ /* */
4373
+ /* */
4374
+ /* */
4375
+ /* */
4376
+ /* */
4377
+ /* */
4378
+ /* */
4379
+ /* */
4380
+ /* */
4381
+ /* */
4382
+ /* */
4383
+ /* */
4384
+ /* */
4385
+ /* */
4386
+ /* */
4387
+ /* */
4388
+ /* */
4389
+ /* */
4390
+ /* */
4391
+ /* */
4392
+ /* */
4393
+ /* */
4394
+ /* */
4395
+ /* */
4396
+ /* */
4397
+ /* */
4398
+ /* */
4399
+ /* */
4400
+ /* */
4401
+ /* */
4402
+ /* */
4403
+ /* */
4404
+ /* */
4405
+ /* */
4406
+ /* */
4407
+ /* */
4408
+ /* */
4409
+ /* */
4410
+ /* */
4411
+ /* */
4412
+ /* */
4413
+ /* */
4414
+ /* */
4415
+ /* */
4416
+ /* */
4417
+ /* */
4418
+ /* */
4419
+ /* */
4420
+ /* */
4421
+ /* */
4422
+ /* */
4423
+ /* */
4424
+ /* */
4425
+ /* */
4426
+ /* */
4427
+ /* */
4428
+ /* */
4429
+ /* */
4430
+ /* */
4431
+ /* */
4432
+ /* */
4433
+ /* */
4434
+ /* */
4435
+ /* */
4436
+ /* */
4437
+ /* */
4438
+ /* */
4439
+ /* */
4440
+ /* */
4441
+ /* */
4442
+ /* */
4443
+ /* */
4444
+ /* */
4445
+ /* */
4446
+ /* */
4447
+ /* */
4448
+ /* */
4449
+ /* */
4450
+ /* */
4451
+ /* */
4452
+ /* */
4453
+ /* */
4454
+ /* */
4455
+ /* */
4456
+ /* */
4457
+ /* */
4458
+ /* */
4459
+ /* */
4460
+ /* */
4461
+ /* */
4462
+ /* */
4463
+ /* */
4464
+ /* */
4465
+ /* */
4466
+ /* */
4467
+ /* */
4468
+ /* */
4469
+ /* */
4470
+ /* */
4471
+ /* */
4472
+ /* */
4473
+ /* */
4474
+ /* */
4475
+ /* */
4476
+ /* */
4477
+ /* */
4478
+ /* */
4479
+ /* */
4480
+ /* */
4481
+ /* */
4482
+ hideNodeWarnings() {
4056
4483
  /* */
4057
4484
  /* */
4058
4485
  /* */
4486
+ }
4487
+ }
4488
+ ;
4489
+ ({}); // @--end-of-file-for-module=tnp-core lib/helpers.ts
4490
+
4491
+ const CoreConfig = {
4492
+ message: {
4493
+ globalSystemToolMode: 'globalSystemToolMode',
4494
+ },
4495
+ };
4496
+ ;
4497
+ ({}); // @--end-of-file-for-module=tnp-core lib/core-config.ts
4498
+
4499
+ class PROGRESS_DATA {
4500
+ constructor() {
4501
+ this.type = 'event';
4502
+ }
4503
+ static log(log) {
4059
4504
  /* */
4060
4505
  /* */
4061
4506
  /* */
@@ -4063,165 +4508,46 @@ var Utils;
4063
4508
  /* */
4064
4509
  /* */
4065
4510
  /* */
4066
- async function fileToBlob(file) {
4067
- return new Blob([new Uint8Array(await file.arrayBuffer())], {
4068
- type: file.type,
4069
- });
4511
+ }
4512
+ static resolveFrom(chunk, callbackOnFounded, checkSplit = true) {
4513
+ let progress;
4514
+ let res = [];
4515
+ if (!_.isString(chunk)) {
4516
+ return [];
4070
4517
  }
4071
- binary.fileToBlob = fileToBlob;
4072
- async function blobToFile(blob, nameForFile = 'my-file-name') {
4073
- if (!nameForFile) {
4074
- nameForFile = 'nonamefile' + new Date().getTime();
4518
+ chunk = chunk.trim();
4519
+ if (checkSplit) {
4520
+ const split = chunk.split(/\r\n|\n|\r/);
4521
+ if (split.length > 1) {
4522
+ split.forEach(s => {
4523
+ res = res.concat(this.resolveFrom(s, callbackOnFounded, false));
4524
+ });
4525
+ return res;
4075
4526
  }
4076
- // @ts-ignore
4077
- return new File([blob], nameForFile);
4078
- }
4079
- binary.blobToFile = blobToFile;
4080
- /* */
4081
- /* */
4082
- /* */
4083
- /* */
4084
- /* */
4085
- /* */
4086
- /* */
4087
- /* */
4088
- /* */
4089
- /* */
4090
- /* */
4091
- /* */
4092
- /* */
4093
- /* */
4094
- /* */
4095
- /* */
4096
- /* */
4097
- /* */
4098
- /* */
4099
- /* */
4100
- /* */
4101
- /* */
4102
- /* */
4103
- /* */
4104
- /* */
4105
- /* */
4106
- async function textToBlob(text, type = 'text/plain') {
4107
- const blob = new Blob([text], { type });
4108
- return blob;
4109
- }
4110
- binary.textToBlob = textToBlob;
4111
- async function blobToText(blob) {
4112
- return await blob.text();
4113
- }
4114
- binary.blobToText = blobToText;
4115
- async function textToFile(text, fileRelativePathOrName) {
4116
- const ext = path.extname(fileRelativePathOrName);
4117
- const type = CoreModels.mimeTypes[ext];
4118
- const blob = new Blob([text], { type });
4119
- const file = await blobToFile(blob, fileRelativePathOrName);
4120
- return file;
4121
- }
4122
- binary.textToFile = textToFile;
4123
- async function fileToText(file) {
4124
- return await file.text();
4125
- }
4126
- binary.fileToText = fileToText;
4127
- async function jsonToBlob(jsonObj) {
4128
- const blob = new Blob([JSON.stringify(jsonObj, null, 2)], {
4129
- type: 'application/json',
4130
- });
4131
- return blob;
4132
4527
  }
4133
- binary.jsonToBlob = jsonToBlob;
4134
- /**
4135
- * TODO NOT TESTED
4136
- */
4137
- async function blobToJson(blob) {
4138
- return JSON.parse(await blob.text());
4139
- }
4140
- binary.blobToJson = blobToJson;
4141
- async function getBlobFrom(url) {
4142
- const response = await axios({
4143
- url,
4144
- method: 'get',
4145
- responseType: 'blob',
4146
- });
4147
- return response.data;
4528
+ if (/\[\[\[.*\]\]\]/g.test(chunk)) {
4529
+ chunk = chunk.replace(/^\[\[\[/g, '').replace(/\]\]\]$/g, '');
4530
+ progress = chunk;
4148
4531
  }
4149
- binary.getBlobFrom = getBlobFrom;
4150
- })(binary = Utils.binary || (Utils.binary = {}));
4151
- let css;
4152
- (function (css) {
4153
- /**
4154
- *
4155
- * @param pixelsCss pixels ex. 100px
4156
- * @returns
4157
- */
4158
- function numValue(pixelsCss) {
4159
- return parseInt(pixelsCss?.toString()?.replace('px', ''));
4532
+ if (!_.isUndefined(progress)) {
4533
+ try {
4534
+ const p = JSON.parse(progress);
4535
+ const single = _.merge(new PROGRESS_DATA(), p);
4536
+ res = res.concat([single]);
4537
+ if (_.isFunction(callbackOnFounded)) {
4538
+ callbackOnFounded(single);
4539
+ }
4540
+ }
4541
+ catch (err) {
4542
+ Helpers.error(err, true, true);
4543
+ Helpers.error(`ProgresssBarData: fail to parse "${progress}"`, true, true);
4544
+ }
4160
4545
  }
4161
- css.numValue = numValue;
4162
- })(css = Utils.css || (Utils.css = {}));
4163
- })(Utils || (Utils = {}));
4164
- var UtilsProcess;
4165
- (function (UtilsProcess) {
4166
- /**
4167
- * TODO IMPLEMENT
4168
- */
4169
- async function startAsync(command, options) {
4170
- }
4171
- UtilsProcess.startAsync = startAsync;
4172
- /**
4173
- * TODO IMPLEMENT
4174
- */
4175
- function startSync(command, options) {
4546
+ return res;
4176
4547
  }
4177
- UtilsProcess.startSync = startSync;
4178
- UtilsProcess.getBashOrShellName = () => {
4179
- /* */
4180
- /* */
4181
- /* */
4182
- /* */
4183
- /* */
4184
- /* */
4185
- /* */
4186
- /* */
4187
- /* */
4188
- /* */
4189
- /* */
4190
- /* */
4191
- /* */
4192
- /* */
4193
- /* */
4194
- /* */
4195
- /* */
4196
- /* */
4197
- /* */
4198
- /* */
4199
- /* */
4200
- /* */
4201
- /* */
4202
- /* */
4203
- /* */
4204
- /* */
4205
- /* */
4206
- /* */
4207
- /* */
4208
- /* */
4209
- /* */
4210
- /* */
4211
- return (void 0);
4212
- };
4213
- })(UtilsProcess || (UtilsProcess = {}));
4214
- var UtilsString;
4215
- (function (UtilsString) {
4216
- UtilsString.kebabCaseNoSplitNumbers = (input) => {
4217
- return (input
4218
- .replace(/\s+/g, '-')
4219
- .replace(/([a-z0-9])([A-Z])/g, '$1-$2')
4220
- .toLowerCase());
4221
- };
4222
- })(UtilsString || (UtilsString = {}));
4548
+ }
4223
4549
  ;
4224
- ({}); // @--end-of-file-for-module=tnp-core lib/utils.ts
4550
+ ({}); // @--end-of-file-for-module=tnp-core lib/progress-data.ts
4225
4551
 
4226
4552
  /* */
4227
4553
  /* */
@@ -4243,6 +4569,10 @@ class CLI {
4243
4569
  ;
4244
4570
  ({}); // @--end-of-file-for-module=tnp-core lib/core-cli.ts
4245
4571
 
4572
+ /**
4573
+ * TODO slowly refactor this.. only actually globally needed are:
4574
+ * pm2, yarn, npm-run, ts-node ???
4575
+ */
4246
4576
  const requiredForDev = {
4247
4577
  npm: [
4248
4578
  /* */
@@ -4277,6 +4607,9 @@ const requiredForDev = {
4277
4607
  /* */
4278
4608
  /* */
4279
4609
  /* */
4610
+ /* */
4611
+ /* */
4612
+ /* */
4280
4613
  ],
4281
4614
  niceTools: [
4282
4615
  /* */
@@ -4313,7 +4646,7 @@ const requiredForDev = {
4313
4646
  ],
4314
4647
  };
4315
4648
  ;
4316
- ({}); // @--end-of-file-for-module=tnp-core lib/required.ts
4649
+ ({}); // @--end-of-file-for-module=tnp-core lib/required-global-npm-packages.ts
4317
4650
 
4318
4651
  let Helpers = HelpersCore.InstanceCore;
4319
4652
  ;
@@ -4323,5 +4656,5 @@ let Helpers = HelpersCore.InstanceCore;
4323
4656
  * Generated bundle index. Do not edit.
4324
4657
  */
4325
4658
 
4326
- export { $, CLI, CoreConfig, HelpersCore as CoreHelpers, CoreModels, Helpers, PROGRESS_DATA, Utils, UtilsProcess, UtilsString, chalk, crossPlatformPath, frameworkName, frameworkNameBe, path, requiredForDev, win32Path };
4659
+ export { $, CLI, CoreConfig, HelpersCore as CoreHelpers, CoreModels, Helpers, PROGRESS_DATA, Utils, UtilsMigrations, UtilsOs, UtilsProcess, UtilsString, chalk, crossPlatformPath, frameworkName, frameworkNameBe, path, requiredForDev, win32Path };
4327
4660
  //# sourceMappingURL=tnp-core.mjs.map