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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29yZS1pbXBvcnRzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vdG1wLWxpYnMtZm9yLWRpc3QvdG5wLWNvcmUvcHJvamVjdHMvdG5wLWNvcmUvc3JjL2xpYi9jb3JlLWltcG9ydHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBR0EsSUFBSSxVQUFVLEdBQUcsS0FBSyxDQUFDO0FBQ3ZCLEtBQUs7QUFDTCxLQUFLO0FBQ0wsS0FBSztBQUNMLEtBQUs7QUFDTCxLQUFLO0FBQ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aWYgKGlzV2luZG93cyAmJiByZWdleFdpblBhdGgxLnRlc3QocGF0aFN0cmluZ09yUGF0aFBhcnRzKSkge1xuICAgIHBhdGhTdHJpbmdPclBhdGhQYXJ0cyA9IHBhdGhTdHJpbmdPclBhdGhQYXJ0cy5zbGljZSgxKTtcbiAgfVxuXG5cblxuXG5cblxuXG5cblxuXG5cbiAgcmV0dXJuIHBhdGhTdHJpbmdPclBhdGhQYXJ0cztcbn07XG5cblxuXG5leHBvcnQgeyAgIF8sICAgcSwgICBtb21lbnQsICAgZGF0ZWZvcm1hdCwgICBjcm9zc1BsYXRmb3JtUGF0aCwgICB3aW4zMlBhdGgsICAgcGF0aCwgICBjaGFsaywgICBqc29uNSwgICAkLCB9Oy8qICovXG4vKiAqL1xuLyogKi9cbi8qICovXG4vKiAqL1xuLyogKi9cbi8qICovXG4vKiAqL1xuLyogKi9cbi8qICovXG4vKiAqL1xuXG5cbi8qICovXG4vKiAqL1xuLyogKi9cbi8qICovXG4vKiAqL1xuLyogKi9cbi8qICovXG4vKiAqL1xuLyogKi9cbi8qICovXG4vKiAqL1xuLyogKi9cbi8qICovXG4vKiAqL1xuLyogKi9cbi8qICovXG4vKiAqL1xuLyogKi9cbi8qICovXG4vKiAqL1xuLyogKi9cbi8qICovXG4vKiAqL1xuLyogKi9cbi8qICovXG4gIFxuXG5cbiA7KHt9KTsgLy8gQC0tZW5kLW9mLWZpbGUtZm9yLW1vZHVsZT10bnAtY29yZSBsaWIvY29yZS1pbXBvcnRzLnRzIl19
600
603
 
601
604
  var CoreModels;
602
605
  (function (CoreModels) {
@@ -722,149 +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
- /* */
735
- /* */
736
- return false;
737
- }
738
- get isNode() {
739
- /* */
740
- /* */
741
- return false;
742
- }
743
- get isElectron() {
744
- // @ts-ignore
745
- if (typeof window !== 'undefined' &&
746
- typeof window.process === 'object' &&
747
- window.process.type === 'renderer') {
748
- return true;
749
- }
750
- // @ts-ignore
751
- if (typeof process !== 'undefined' &&
752
- typeof process.versions === 'object' &&
753
- !!process.versions.electron) {
754
- return true;
755
- }
756
- if (typeof navigator === 'object' &&
757
- typeof navigator.userAgent === 'string' &&
758
- navigator.userAgent.indexOf('Electron') >= 0) {
759
- return true;
760
- }
761
- return false;
762
- }
763
- contain(arr, item) {
764
- return (arr.filter(l => {
765
- if (l instanceof RegExp) {
766
- return l.test(item);
767
- }
768
- if (l === item) {
769
- return true;
770
- }
771
- if (item.match && typeof item.match === 'function' ? item.match(l) : false) {
772
- return true;
773
- }
774
- return false;
775
- }).length > 0);
776
- }
777
- }
778
- ;
779
- ({}); // @--end-of-file-for-module=tnp-core lib/helpers-isomorphic.ts
780
-
781
- /* */
782
- /* */
783
- /* */
784
- const KEY = {
785
- LAST_ERROR: Symbol(),
786
- LAST_INFO: Symbol(),
787
- LAST_WARN: Symbol(),
788
- LAST_LOG: Symbol(),
789
- LAST_SUCCESS: Symbol(),
790
- LAST_TASK_STARTED: Symbol(),
791
- LAST_TASK_DONE: Symbol(),
792
- };
793
- const KEY_COUNT = {
794
- LAST_ERROR: Symbol(),
795
- LAST_INFO: Symbol(),
796
- LAST_WARN: Symbol(),
797
- LAST_LOG: Symbol(),
798
- LAST_SUCCESS: Symbol(),
799
- LAST_TASK_STARTED: Symbol(),
800
- LAST_TASK_DONE: Symbol(),
801
- };
802
- const KEY_IMPORTANTCE = {
803
- LAST_ERROR: Symbol(),
804
- LAST_INFO: Symbol(),
805
- LAST_WARN: Symbol(),
806
- LAST_LOG: Symbol(),
807
- LAST_SUCCESS: Symbol(),
808
- LAST_TASK_STARTED: Symbol(),
809
- LAST_TASK_DONE: Symbol(),
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
- /* */
832
- const LIMIT = 10;
833
- class HelpersMessages extends HelpersIsomorphic {
834
- msgCacheClear() {
835
- /* */
836
- /* */
837
- /* */
838
- /* */
839
- /* */
840
- }
841
- renderError(err) {
842
- if (this.isBrowser) {
843
- console.error(err);
844
- }
845
- else {
846
- /* */
847
- /* */
848
- /* */
849
- /* */
850
- /* */
851
- /* */
852
- /* */
853
- /* */
854
- /* */
855
- }
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, '');
856
755
  }
857
- error(details, noExit = false, noTrace = false) {
858
- if (Helpers.isBrowser) {
859
- console.error(details);
860
- return;
861
- }
862
- /* */
863
- /* */
756
+ Utils.removeChalkSpecialChars = removeChalkSpecialChars;
757
+ Utils.fullDateTime = () => {
864
758
  /* */
865
759
  /* */
760
+ return (void 0);
761
+ };
762
+ Utils.fullDate = () => {
866
763
  /* */
867
764
  /* */
765
+ return (void 0);
766
+ };
767
+ const takenPorts = [];
768
+ Utils.getFreePort = async (options) => {
868
769
  /* */
869
770
  /* */
870
771
  /* */
@@ -898,8 +799,246 @@ class HelpersMessages extends HelpersIsomorphic {
898
799
  /* */
899
800
  /* */
900
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";
901
890
  /* */
902
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;
903
1042
  /* */
904
1043
  /* */
905
1044
  /* */
@@ -909,18 +1048,26 @@ class HelpersMessages extends HelpersIsomorphic {
909
1048
  /* */
910
1049
  /* */
911
1050
  /* */
912
- }
913
- info(details, repeatable = false) {
914
1051
  /* */
915
1052
  /* */
916
1053
  /* */
917
1054
  /* */
918
1055
  /* */
919
1056
  /* */
920
- if (Helpers.isBrowser) {
921
- console.info(details);
922
- return;
1057
+ async function fileToBlob(file) {
1058
+ return new Blob([new Uint8Array(await file.arrayBuffer())], {
1059
+ type: file.type,
1060
+ });
923
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);
1069
+ }
1070
+ binary.blobToFile = blobToFile;
924
1071
  /* */
925
1072
  /* */
926
1073
  /* */
@@ -947,6 +1094,80 @@ class HelpersMessages extends HelpersIsomorphic {
947
1094
  /* */
948
1095
  /* */
949
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 = () => {
950
1171
  /* */
951
1172
  /* */
952
1173
  /* */
@@ -955,12 +1176,6 @@ class HelpersMessages extends HelpersIsomorphic {
955
1176
  /* */
956
1177
  /* */
957
1178
  /* */
958
- }
959
- success(details) {
960
- if (Helpers.isBrowser) {
961
- console.info(details);
962
- return;
963
- }
964
1179
  /* */
965
1180
  /* */
966
1181
  /* */
@@ -971,6 +1186,13 @@ class HelpersMessages extends HelpersIsomorphic {
971
1186
  /* */
972
1187
  /* */
973
1188
  /* */
1189
+ return (void 0);
1190
+ };
1191
+ /**
1192
+ * TODO IMPLEMENT
1193
+ * start async node process
1194
+ */
1195
+ UtilsProcess.startInNewTerminalWindow = (command, options) => {
974
1196
  /* */
975
1197
  /* */
976
1198
  /* */
@@ -998,18 +1220,6 @@ class HelpersMessages extends HelpersIsomorphic {
998
1220
  /* */
999
1221
  /* */
1000
1222
  /* */
1001
- }
1002
- /**
1003
- *
1004
- * @param details
1005
- * @param isLogTask is less important log task
1006
- * @returns
1007
- */
1008
- taskStarted(details, isLogTask = false) {
1009
- if (Helpers.isBrowser) {
1010
- console.info(details);
1011
- return;
1012
- }
1013
1223
  /* */
1014
1224
  /* */
1015
1225
  /* */
@@ -1057,16 +1267,6 @@ class HelpersMessages extends HelpersIsomorphic {
1057
1267
  /* */
1058
1268
  /* */
1059
1269
  /* */
1060
- }
1061
- taskDone(details, isLessImportant = false) {
1062
- if (Helpers.isBrowser) {
1063
- console.info(details);
1064
- return;
1065
- }
1066
- /* */
1067
- /* */
1068
- /* */
1069
- /* */
1070
1270
  /* */
1071
1271
  /* */
1072
1272
  /* */
@@ -1094,6 +1294,10 @@ class HelpersMessages extends HelpersIsomorphic {
1094
1294
  /* */
1095
1295
  /* */
1096
1296
  /* */
1297
+ return (void 0);
1298
+ };
1299
+ UtilsProcess.getBashOrShellName = () => {
1300
+ return 'browser';
1097
1301
  /* */
1098
1302
  /* */
1099
1303
  /* */
@@ -1115,12 +1319,6 @@ class HelpersMessages extends HelpersIsomorphic {
1115
1319
  /* */
1116
1320
  /* */
1117
1321
  /* */
1118
- }
1119
- log(details, debugLevel = 0) {
1120
- if (Helpers.isBrowser) {
1121
- console.log(details);
1122
- return;
1123
- }
1124
1322
  /* */
1125
1323
  /* */
1126
1324
  /* */
@@ -1132,14 +1330,72 @@ class HelpersMessages extends HelpersIsomorphic {
1132
1330
  /* */
1133
1331
  /* */
1134
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 = () => {
1135
1344
  /* */
1136
1345
  /* */
1346
+ return true;
1347
+ };
1348
+ /**
1349
+ * check if script is running in nodejs
1350
+ * (backend script or electron script)
1351
+ */
1352
+ UtilsOs.isRunningInNode = () => {
1137
1353
  /* */
1138
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 = () => {
1139
1363
  /* */
1140
1364
  /* */
1141
1365
  /* */
1142
1366
  /* */
1367
+ return false;
1368
+ };
1369
+ /**
1370
+ * check whether the current process is running inside
1371
+ * Electron backend or browser.
1372
+ */
1373
+ UtilsOs.isRunningInElectron = () => {
1374
+ // @ts-ignore
1375
+ if (typeof window !== 'undefined' &&
1376
+ typeof window.process === 'object' &&
1377
+ window.process.type === 'renderer') {
1378
+ return true;
1379
+ }
1380
+ // @ts-ignore
1381
+ if (typeof process !== 'undefined' &&
1382
+ typeof process.versions === 'object' &&
1383
+ !!process.versions.electron) {
1384
+ return true;
1385
+ }
1386
+ if (typeof navigator === 'object' &&
1387
+ typeof navigator.userAgent === 'string' &&
1388
+ navigator.userAgent.indexOf('Electron') >= 0) {
1389
+ return true;
1390
+ }
1391
+ return false;
1392
+ };
1393
+ /**
1394
+ * Check wether the current process is running inside
1395
+ * windows subsystem for linux (WSL).
1396
+ */
1397
+ UtilsOs.isRunningInWsl = () => {
1398
+ return false;
1143
1399
  /* */
1144
1400
  /* */
1145
1401
  /* */
@@ -1157,6 +1413,10 @@ class HelpersMessages extends HelpersIsomorphic {
1157
1413
  /* */
1158
1414
  /* */
1159
1415
  /* */
1416
+ return (void 0);
1417
+ };
1418
+ UtilsOs.isRunningInDocker = () => {
1419
+ return false;
1160
1420
  /* */
1161
1421
  /* */
1162
1422
  /* */
@@ -1164,6 +1424,9 @@ class HelpersMessages extends HelpersIsomorphic {
1164
1424
  /* */
1165
1425
  /* */
1166
1426
  /* */
1427
+ return (void 0);
1428
+ };
1429
+ UtilsOs.isRunningInLinuxGraphicsCapableEnvironment = () => {
1167
1430
  /* */
1168
1431
  /* */
1169
1432
  /* */
@@ -1171,54 +1434,219 @@ class HelpersMessages extends HelpersIsomorphic {
1171
1434
  /* */
1172
1435
  /* */
1173
1436
  /* */
1437
+ return (void 0);
1438
+ };
1439
+ })(UtilsOs || (UtilsOs = {}));
1440
+ var UtilsString;
1441
+ (function (UtilsString) {
1442
+ UtilsString.kebabCaseNoSplitNumbers = (input) => {
1443
+ return (input
1444
+ .replace(/\s+/g, '-')
1445
+ .replace(/([a-z0-9])([A-Z])/g, '$1-$2')
1446
+ .toLowerCase());
1447
+ };
1448
+ })(UtilsString || (UtilsString = {}));
1449
+ /**
1450
+ * Taon migration utilities
1451
+ */
1452
+ var UtilsMigrations;
1453
+ (function (UtilsMigrations) {
1454
+ UtilsMigrations.getTimestampFromClassName = (className) => {
1455
+ const [maybeTimestamp1, maybeTimestamp2] = className.split('_') || [];
1456
+ const timestamp1 = parseInt(maybeTimestamp1);
1457
+ const timestamp2 = parseInt(maybeTimestamp2);
1458
+ const timestamp = !_.isNaN(timestamp1) ? timestamp1 : timestamp2;
1459
+ return UtilsMigrations.isValidTimestamp(timestamp) ? timestamp : void 0;
1460
+ };
1461
+ UtilsMigrations.getFormattedTimestampFromClassName = (className) => {
1462
+ const timestamp = UtilsMigrations.getTimestampFromClassName(className);
1463
+ if (!timestamp) {
1464
+ return void 0;
1465
+ }
1466
+ return UtilsMigrations.formatTimestamp(timestamp);
1467
+ };
1468
+ UtilsMigrations.formatTimestamp = (timestamp) => {
1469
+ const dateFromTimestamp = new Date(timestamp);
1470
+ return `${dateformat(dateFromTimestamp, 'dd-mm-yyyy HH:MM:ss')}`;
1471
+ };
1472
+ UtilsMigrations.isValidTimestamp = (value) => {
1473
+ if (typeof value !== 'number') {
1474
+ return false; // Must be a number
1475
+ }
1476
+ const minTimestamp = 0; // Minimum possible timestamp (Unix epoch)
1477
+ const maxTimestamp = 8640000000000000; // Max safe timestamp in JS (represents year ~275760)
1478
+ return value >= minTimestamp && value <= maxTimestamp;
1479
+ };
1480
+ })(UtilsMigrations || (UtilsMigrations = {}));
1481
+ ;
1482
+ ({}); // @--end-of-file-for-module=tnp-core lib/utils.ts
1483
+
1484
+ class HelpersIsomorphic {
1485
+ /**
1486
+ * @deprecated
1487
+ * use UtilsOs.isRunningInBrowser() instead
1488
+ */
1489
+ get isBrowser() {
1490
+ return UtilsOs.isRunningInBrowser();
1174
1491
  }
1175
1492
  /**
1176
- * Logs not visible in normal use of taon-cli
1493
+ * @deprecated
1494
+ * use UtilsOs.isRunningInWebSQL() instead
1177
1495
  */
1178
- logSuccess(details) {
1179
- /* */
1180
- /* */
1181
- /* */
1182
- /* */
1183
- /* */
1184
- return (void 0);
1496
+ get isWebSQL() {
1497
+ return UtilsOs.isRunningInWebSQL();
1185
1498
  }
1186
1499
  /**
1187
- * Logs not visible in normal use of taon-cli
1500
+ * @deprecated
1501
+ * use UtilsOs.isRunningInNode() instead
1188
1502
  */
1189
- logInfo(details, repeatable = false) {
1190
- /* */
1191
- /* */
1192
- /* */
1193
- /* */
1194
- /* */
1195
- return (void 0);
1503
+ get isNode() {
1504
+ return UtilsOs.isRunningInNode();
1196
1505
  }
1197
1506
  /**
1198
- * Logs not visible in normal use of taon-cli
1507
+ * @deprecated
1508
+ * use UtilsOs.isRunningInElectron() instead
1199
1509
  */
1200
- logError(details, noExit = false, noTrace = false) {
1201
- /* */
1202
- /* */
1203
- /* */
1204
- /* */
1205
- /* */
1206
- return (void 0);
1510
+ get isElectron() {
1511
+ return UtilsOs.isRunningInElectron();
1207
1512
  }
1208
1513
  /**
1209
- * Logs not visible in normal use of taon-cli
1514
+ * TODO what is the purpose of this function?
1515
+ * @deprecated
1210
1516
  */
1211
- logWarn(details, trace = false) {
1517
+ contain(arr, item) {
1518
+ return (arr.filter(l => {
1519
+ if (l instanceof RegExp) {
1520
+ return l.test(item);
1521
+ }
1522
+ if (l === item) {
1523
+ return true;
1524
+ }
1525
+ if (item.match && typeof item.match === 'function' ? item.match(l) : false) {
1526
+ return true;
1527
+ }
1528
+ return false;
1529
+ }).length > 0);
1530
+ }
1531
+ }
1532
+ ;
1533
+ ({}); // @--end-of-file-for-module=tnp-core lib/helpers-isomorphic.ts
1534
+
1535
+ /* */
1536
+ /* */
1537
+ /* */
1538
+ const KEY = {
1539
+ LAST_ERROR: Symbol(),
1540
+ LAST_INFO: Symbol(),
1541
+ LAST_WARN: Symbol(),
1542
+ LAST_LOG: Symbol(),
1543
+ LAST_SUCCESS: Symbol(),
1544
+ LAST_TASK_STARTED: Symbol(),
1545
+ LAST_TASK_DONE: Symbol(),
1546
+ };
1547
+ const KEY_COUNT = {
1548
+ LAST_ERROR: Symbol(),
1549
+ LAST_INFO: Symbol(),
1550
+ LAST_WARN: Symbol(),
1551
+ LAST_LOG: Symbol(),
1552
+ LAST_SUCCESS: Symbol(),
1553
+ LAST_TASK_STARTED: Symbol(),
1554
+ LAST_TASK_DONE: Symbol(),
1555
+ };
1556
+ const KEY_IMPORTANTCE = {
1557
+ LAST_ERROR: Symbol(),
1558
+ LAST_INFO: Symbol(),
1559
+ LAST_WARN: Symbol(),
1560
+ LAST_LOG: Symbol(),
1561
+ LAST_SUCCESS: Symbol(),
1562
+ LAST_TASK_STARTED: Symbol(),
1563
+ LAST_TASK_DONE: Symbol(),
1564
+ };
1565
+ /* */
1566
+ /* */
1567
+ /* */
1568
+ /* */
1569
+ /* */
1570
+ /* */
1571
+ /* */
1572
+ /* */
1573
+ /* */
1574
+ /* */
1575
+ /* */
1576
+ /* */
1577
+ /* */
1578
+ /* */
1579
+ /* */
1580
+ /* */
1581
+ /* */
1582
+ /* */
1583
+ /* */
1584
+ /* */
1585
+ /* */
1586
+ const LIMIT = 10;
1587
+ /**
1588
+ * @param details any data to be transformed
1589
+ * @returns string ready to be displayed
1590
+ */
1591
+ const transformData = (details) => {
1592
+ if (typeof details === 'object') {
1593
+ try {
1594
+ const json = JSON.stringify(details, null, 2);
1595
+ details = json;
1596
+ }
1597
+ catch (error) {
1598
+ return details;
1599
+ }
1600
+ }
1601
+ return details;
1602
+ };
1603
+ class HelpersMessages extends HelpersIsomorphic {
1604
+ msgCacheClear() {
1212
1605
  /* */
1213
1606
  /* */
1214
1607
  /* */
1215
1608
  /* */
1216
1609
  /* */
1217
- return (void 0);
1218
1610
  }
1219
- warn(details, trace = false) {
1611
+ renderError(err) {
1612
+ if (this.isBrowser) {
1613
+ console.error(err);
1614
+ }
1615
+ else {
1616
+ /* */
1617
+ /* */
1618
+ /* */
1619
+ /* */
1620
+ /* */
1621
+ /* */
1622
+ /* */
1623
+ /* */
1624
+ /* */
1625
+ }
1626
+ }
1627
+ /**
1628
+ * Throw error and exit process
1629
+ * make sure browser or nodejs will not continue
1630
+ * @param details
1631
+ */
1632
+ throw(details) {
1633
+ if (this.isBrowser) {
1634
+ document.body.innerHTML =
1635
+ '<h1>Application has encountered an error and stopped.</h1>';
1636
+ document.body.style.pointerEvents = 'none';
1637
+ /* */
1638
+ /* */
1639
+ /* */
1640
+ /* */
1641
+ }
1642
+ throw new Error(details);
1643
+ }
1644
+ tryCatchError(error) {
1645
+ Helpers.error(error, true, true);
1646
+ }
1647
+ error(details, noExit = false, noTrace = false) {
1220
1648
  if (Helpers.isBrowser) {
1221
- console.warn(details);
1649
+ console.error(details);
1222
1650
  return;
1223
1651
  }
1224
1652
  /* */
@@ -1271,62 +1699,23 @@ class HelpersMessages extends HelpersIsomorphic {
1271
1699
  /* */
1272
1700
  /* */
1273
1701
  /* */
1702
+ }
1703
+ info(details, repeatable = false) {
1274
1704
  /* */
1275
1705
  /* */
1276
- }
1277
- }
1278
- function transformData(details) {
1279
- if (typeof details === 'object') {
1280
- if (Array.isArray(details)) {
1281
- return details.join('\n');
1282
- }
1283
- try {
1284
- const json = JSON.stringify(details);
1285
- details = json;
1286
- }
1287
- catch (error) {
1288
- return details;
1289
- }
1290
- }
1291
- return details;
1292
- }
1293
- ;
1294
- ({}); // @--end-of-file-for-module=tnp-core lib/helpers-messages.ts
1295
-
1296
- const encoding = 'utf8';
1297
- /* */
1298
- /* */
1299
- /* */
1300
- const WEBSQL_PROC_MOCK_PROCESSES_PID = {};
1301
- const WEBSQL_PROC_MOCK_PROCESSES_PPID = {};
1302
- class HelpersCore extends HelpersMessages {
1303
- static get InstanceCore() {
1304
- if (!HelpersCore._instanceCore) {
1305
- HelpersCore._instanceCore = new HelpersCore();
1706
+ /* */
1707
+ /* */
1708
+ /* */
1709
+ /* */
1710
+ if (Helpers.isBrowser) {
1711
+ console.info(details);
1712
+ return;
1306
1713
  }
1307
- return HelpersCore._instanceCore;
1308
- }
1309
- /* */
1310
- /* */
1311
- /* */
1312
- /* */
1313
- /* */
1314
- /* */
1315
- /* */
1316
- /* */
1317
- /* */
1318
- /* */
1319
- /* */
1320
- constructor() {
1321
- super();
1322
1714
  /* */
1323
1715
  /* */
1324
- this.bigMaxBuffer = 2024 * 500;
1325
1716
  /* */
1326
1717
  /* */
1327
1718
  /* */
1328
- }
1329
- get isWsl() {
1330
1719
  /* */
1331
1720
  /* */
1332
1721
  /* */
@@ -1344,9 +1733,6 @@ class HelpersCore extends HelpersMessages {
1344
1733
  /* */
1345
1734
  /* */
1346
1735
  /* */
1347
- return (void 0);
1348
- }
1349
- isRunningInDocker() {
1350
1736
  /* */
1351
1737
  /* */
1352
1738
  /* */
@@ -1354,47 +1740,78 @@ class HelpersCore extends HelpersMessages {
1354
1740
  /* */
1355
1741
  /* */
1356
1742
  /* */
1357
- return (void 0);
1358
- }
1359
- clearConsole() {
1360
- Helpers.msgCacheClear();
1361
- console.log('\x1Bc');
1362
- }
1363
- /**
1364
- * get electron browser ipc renderer
1365
- */
1366
- get ipcRenderer() {
1367
1743
  /* */
1368
1744
  /* */
1369
- if (!this.isElectron) {
1370
- return;
1371
- }
1372
- return window.require('electron')
1373
- .ipcRenderer;
1374
- }
1375
- /**
1376
- * get electron web frame
1377
- */
1378
- get webFrame() {
1379
1745
  /* */
1380
1746
  /* */
1381
- if (!this.isElectron) {
1747
+ /* */
1748
+ }
1749
+ success(details) {
1750
+ if (Helpers.isBrowser) {
1751
+ console.info(details);
1382
1752
  return;
1383
1753
  }
1384
- return window.require('electron').webFrame;
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
+ /* */
1385
1791
  }
1386
1792
  /**
1387
- * get electron backend ipc main proces
1793
+ *
1794
+ * @param details
1795
+ * @param isLogTask is less important log task
1796
+ * @returns
1388
1797
  */
1389
- get ipcMain() {
1798
+ taskStarted(details, isLogTask = false) {
1799
+ if (Helpers.isBrowser) {
1800
+ console.info(details);
1801
+ return;
1802
+ }
1803
+ /* */
1804
+ /* */
1805
+ /* */
1806
+ /* */
1807
+ /* */
1808
+ /* */
1809
+ /* */
1390
1810
  /* */
1391
1811
  /* */
1392
1812
  /* */
1393
1813
  /* */
1394
1814
  /* */
1395
- return (void 0);
1396
- }
1397
- getElectronWindow({ allowRunningInsecureContent = true, } = {}) {
1398
1815
  /* */
1399
1816
  /* */
1400
1817
  /* */
@@ -1410,19 +1827,8 @@ class HelpersCore extends HelpersMessages {
1410
1827
  /* */
1411
1828
  /* */
1412
1829
  /* */
1413
- return (void 0);
1414
- }
1415
- mediaTypeFromSrc(src) {
1416
- const ext = path.extname(src);
1417
- const media = CoreModels.mimeTypes[ext];
1418
- return _.first(media?.split('/'));
1419
- }
1420
- sleep(seconds = 1) {
1421
1830
  /* */
1422
1831
  /* */
1423
- return (void 0);
1424
- }
1425
- removeIfExists(absoluteFileOrFolderPath) {
1426
1832
  /* */
1427
1833
  /* */
1428
1834
  /* */
@@ -1441,12 +1847,37 @@ class HelpersCore extends HelpersMessages {
1441
1847
  /* */
1442
1848
  /* */
1443
1849
  /* */
1444
- return (void 0);
1445
- }
1446
- relative(cwd, to) {
1447
- return crossPlatformPath(path.relative(cwd, to));
1448
1850
  }
1449
- removeFileIfExists(absoluteFilePath) {
1851
+ taskDone(details, isLessImportant = false) {
1852
+ if (Helpers.isBrowser) {
1853
+ console.info(details);
1854
+ return;
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
+ /* */
1450
1881
  /* */
1451
1882
  /* */
1452
1883
  /* */
@@ -1460,9 +1891,6 @@ class HelpersCore extends HelpersMessages {
1460
1891
  /* */
1461
1892
  /* */
1462
1893
  /* */
1463
- return (void 0);
1464
- }
1465
- removeFolderIfExists(absoluteFolderPath) {
1466
1894
  /* */
1467
1895
  /* */
1468
1896
  /* */
@@ -1477,36 +1905,24 @@ class HelpersCore extends HelpersMessages {
1477
1905
  /* */
1478
1906
  /* */
1479
1907
  /* */
1480
- return (void 0);
1481
1908
  }
1482
- /**
1483
- * leave max 1 empty line
1484
- */
1485
- removeEmptyLineFromString(str) {
1486
- const lines = (str || '').split('\n');
1487
- let previousWasEmpty = false;
1488
- return lines
1489
- .filter(line => {
1490
- if (line.trim() === '') {
1491
- if (previousWasEmpty) {
1492
- return false;
1493
- }
1494
- else {
1495
- previousWasEmpty = true;
1496
- return true;
1497
- }
1498
- }
1499
- else {
1500
- previousWasEmpty = false;
1501
- return true;
1502
- }
1503
- })
1504
- .join('\n');
1909
+ get isVerboseMode() {
1910
+ return true; // TODO what it means in browser
1911
+ /* */
1912
+ /* */
1505
1913
  }
1506
1914
  /**
1507
- * @deprecated
1915
+ * log messages only available in verbose mode
1508
1916
  */
1509
- tryRemoveDir(dirpath, contentOnly = false, omitWarningNotExisted = false) {
1917
+ log(details, debugLevel = 0) {
1918
+ if (Helpers.isBrowser) {
1919
+ console.log(details);
1920
+ return;
1921
+ }
1922
+ /* */
1923
+ /* */
1924
+ /* */
1925
+ /* */
1510
1926
  /* */
1511
1927
  /* */
1512
1928
  /* */
@@ -1543,9 +1959,6 @@ class HelpersCore extends HelpersMessages {
1543
1959
  /* */
1544
1960
  /* */
1545
1961
  /* */
1546
- return (void 0);
1547
- }
1548
- remove(fileOrFolderPathOrPatter, exactFolder = false) {
1549
1962
  /* */
1550
1963
  /* */
1551
1964
  /* */
@@ -1556,22 +1969,22 @@ class HelpersCore extends HelpersMessages {
1556
1969
  /* */
1557
1970
  /* */
1558
1971
  /* */
1559
- return (void 0);
1560
1972
  }
1561
- /* */
1562
- /* */
1563
- /* */
1564
- /* */
1565
- /* */
1566
- /* */
1567
- /* */
1568
- /* */
1569
- /* */
1570
- /* */
1571
- get isRunningInGitBash() {
1973
+ /**
1974
+ * Logs not visible in normal use of taon-cli
1975
+ */
1976
+ logSuccess(details) {
1977
+ /* */
1978
+ /* */
1572
1979
  /* */
1573
1980
  /* */
1574
1981
  /* */
1982
+ return (void 0);
1983
+ }
1984
+ /**
1985
+ * Logs not visible in normal use of taon-cli
1986
+ */
1987
+ logInfo(details, repeatable = false) {
1575
1988
  /* */
1576
1989
  /* */
1577
1990
  /* */
@@ -1580,70 +1993,101 @@ class HelpersCore extends HelpersMessages {
1580
1993
  return (void 0);
1581
1994
  }
1582
1995
  /**
1583
- * Check if the current shell is supported by Taon framework.
1996
+ * Logs not visible in normal use of taon-cli
1584
1997
  */
1585
- get isSupportedTaonTerminal() {
1998
+ logError(details, noExit = false, noTrace = false) {
1999
+ /* */
2000
+ /* */
2001
+ /* */
1586
2002
  /* */
1587
2003
  /* */
1588
2004
  return (void 0);
1589
2005
  }
1590
2006
  /**
1591
- * check if function is class
2007
+ * Logs not visible in normal use of taon-cli
1592
2008
  */
1593
- isClass(funcOrClass) {
1594
- let isClass = false;
1595
- if (typeof funcOrClass === 'function') {
1596
- isClass =
1597
- !!funcOrClass.prototype &&
1598
- Object.getOwnPropertyNames(funcOrClass.prototype).filter(f => f !== 'constructor').length > 0;
1599
- }
1600
- return isClass;
1601
- }
1602
- /**
1603
- * check if data is nodejs/browser blob
1604
- *
1605
- * @param maybeBlob
1606
- * @returns
1607
- */
1608
- isBlob(maybeBlob) {
1609
- return maybeBlob instanceof Blob; // || toString.call(maybeBlob) === '[object Blob]';
1610
- }
1611
- /**
1612
- * Check if data is nodejs buffer
1613
- *
1614
- * @param maybeNodejsBuffer
1615
- * @returns
1616
- */
1617
- /* */
1618
- /* */
1619
- /* */
1620
- /* */
1621
- removeSlashAtEnd(s) {
1622
- s = s?.endsWith(`/`) ? s.slice(0, s.length - 1) : s;
1623
- return s;
1624
- }
1625
- removeSlashAtBegin(s) {
1626
- s = s?.startsWith(`/`) ? s.slice(1) : s;
1627
- return s;
1628
- }
1629
- /**
1630
- * stringify to pretty json string
1631
- */
1632
- stringify(inputObject) {
1633
- return JSON.stringify(inputObject, null, 2);
2009
+ logWarn(details, trace = false) {
2010
+ /* */
2011
+ /* */
2012
+ /* */
2013
+ /* */
2014
+ /* */
2015
+ return (void 0);
1634
2016
  }
1635
- async runSyncOrAsync(fnOrOptions) {
1636
- if (_.isUndefined(fnOrOptions)) {
1637
- return void 0;
2017
+ warn(details, trace = false) {
2018
+ if (Helpers.isBrowser) {
2019
+ console.warn(details);
2020
+ return;
1638
2021
  }
1639
- let promisOrValue;
1640
- const { functionFn, context, arrayOfParams } = fnOrOptions;
1641
- promisOrValue = functionFn.apply(context, arrayOfParams);
1642
- // // @ts-ignore
1643
- if (promisOrValue instanceof Promise) {
1644
- promisOrValue = Promise.resolve(promisOrValue);
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
+ ;
2077
+ ({}); // @--end-of-file-for-module=tnp-core lib/helpers-messages.ts
2078
+
2079
+ const encoding = 'utf8';
2080
+ /* */
2081
+ /* */
2082
+ /* */
2083
+ const WEBSQL_PROC_MOCK_PROCESSES_PID = {};
2084
+ const WEBSQL_PROC_MOCK_PROCESSES_PPID = {};
2085
+ class HelpersCore extends HelpersMessages {
2086
+ static get InstanceCore() {
2087
+ if (!HelpersCore._instanceCore) {
2088
+ HelpersCore._instanceCore = new HelpersCore();
1645
2089
  }
1646
- return promisOrValue;
2090
+ return HelpersCore._instanceCore;
1647
2091
  }
1648
2092
  /* */
1649
2093
  /* */
@@ -1656,254 +2100,72 @@ class HelpersCore extends HelpersMessages {
1656
2100
  /* */
1657
2101
  /* */
1658
2102
  /* */
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
- /* */
1893
- /* */
2103
+ constructor() {
2104
+ super();
2105
+ /* */
2106
+ /* */
2107
+ this.bigMaxBuffer = 2024 * 500;
2108
+ /* */
2109
+ /* */
2110
+ /* */
2111
+ }
1894
2112
  /**
1895
- * symlink may have existed or unexisted destiantion url
1896
- * @param destUrl M
2113
+ * @deprecated use UtilsOs.isRunningInsideWsl()
1897
2114
  */
1898
- isSymlinkThatMatchesUrl(possibleSymlink, destUrl, absoluteFileMatch = false) {
2115
+ get isWsl() {
2116
+ return UtilsOs.isRunningInWsl();
2117
+ }
2118
+ /**
2119
+ * @deprecated use UtilsOs.isRunningInDocker
2120
+ */
2121
+ isRunningInDocker() {
2122
+ return UtilsOs.isRunningInDocker();
2123
+ }
2124
+ /**
2125
+ * @deprecated use UtilsOs.isRunningInLinuxGraphicEnvironment
2126
+ */
2127
+ isRunningInLinuxGraphicsCapableEnvironment() {
2128
+ return UtilsOs.isRunningInLinuxGraphicsCapableEnvironment();
2129
+ }
2130
+ clearConsole() {
2131
+ Helpers.msgCacheClear();
2132
+ console.log('\x1Bc');
2133
+ }
2134
+ /**
2135
+ * get electron browser ipc renderer
2136
+ */
2137
+ get ipcRenderer() {
2138
+ /* */
1899
2139
  /* */
2140
+ if (!this.isElectron) {
2141
+ return;
2142
+ }
2143
+ return window.require('electron')
2144
+ .ipcRenderer;
2145
+ }
2146
+ /**
2147
+ * get electron web frame
2148
+ */
2149
+ get webFrame() {
1900
2150
  /* */
1901
2151
  /* */
2152
+ if (!this.isElectron) {
2153
+ return;
2154
+ }
2155
+ return window.require('electron').webFrame;
2156
+ }
2157
+ /**
2158
+ * get electron backend ipc main proces
2159
+ */
2160
+ get ipcMain() {
1902
2161
  /* */
1903
2162
  /* */
1904
2163
  /* */
1905
2164
  /* */
1906
2165
  /* */
2166
+ return (void 0);
2167
+ }
2168
+ getElectronWindow({ allowRunningInsecureContent = true, } = {}) {
1907
2169
  /* */
1908
2170
  /* */
1909
2171
  /* */
@@ -1919,8 +2181,19 @@ class HelpersCore extends HelpersMessages {
1919
2181
  /* */
1920
2182
  /* */
1921
2183
  /* */
2184
+ return (void 0);
2185
+ }
2186
+ mediaTypeFromSrc(src) {
2187
+ const ext = path.extname(src);
2188
+ const media = CoreModels.mimeTypes[ext];
2189
+ return _.first(media?.split('/'));
2190
+ }
2191
+ sleep(seconds = 1) {
1922
2192
  /* */
1923
2193
  /* */
2194
+ return (void 0);
2195
+ }
2196
+ removeIfExists(absoluteFileOrFolderPath) {
1924
2197
  /* */
1925
2198
  /* */
1926
2199
  /* */
@@ -1929,9 +2202,6 @@ class HelpersCore extends HelpersMessages {
1929
2202
  /* */
1930
2203
  /* */
1931
2204
  /* */
1932
- return (void 0);
1933
- }
1934
- isSymlinkFileExitedOrUnexisted(filePath) {
1935
2205
  /* */
1936
2206
  /* */
1937
2207
  /* */
@@ -1945,15 +2215,28 @@ class HelpersCore extends HelpersMessages {
1945
2215
  return (void 0);
1946
2216
  }
1947
2217
  /**
1948
- * If symbolnk link that target file does not exits
2218
+ * path.relative that return cross platform path
1949
2219
  */
1950
- isUnexistedLink(filePath) {
2220
+ relative(cwd, to) {
2221
+ return crossPlatformPath(path.relative(cwd, to));
2222
+ }
2223
+ removeFileIfExists(absoluteFilePath) {
2224
+ /* */
2225
+ /* */
2226
+ /* */
2227
+ /* */
1951
2228
  /* */
1952
2229
  /* */
1953
2230
  /* */
1954
2231
  /* */
1955
2232
  /* */
1956
2233
  /* */
2234
+ /* */
2235
+ /* */
2236
+ /* */
2237
+ return (void 0);
2238
+ }
2239
+ removeFolderIfExists(absoluteFolderPath) {
1957
2240
  /* */
1958
2241
  /* */
1959
2242
  /* */
@@ -1971,9 +2254,33 @@ class HelpersCore extends HelpersMessages {
1971
2254
  return (void 0);
1972
2255
  }
1973
2256
  /**
1974
- * @param existedLink check if source of link exists
2257
+ * leave max 1 empty line
1975
2258
  */
1976
- isExistedSymlink(filePath) {
2259
+ removeEmptyLineFromString(str) {
2260
+ const lines = (str || '').split('\n');
2261
+ let previousWasEmpty = false;
2262
+ return lines
2263
+ .filter(line => {
2264
+ if (line.trim() === '') {
2265
+ if (previousWasEmpty) {
2266
+ return false;
2267
+ }
2268
+ else {
2269
+ previousWasEmpty = true;
2270
+ return true;
2271
+ }
2272
+ }
2273
+ else {
2274
+ previousWasEmpty = false;
2275
+ return true;
2276
+ }
2277
+ })
2278
+ .join('\n');
2279
+ }
2280
+ /**
2281
+ * @deprecated
2282
+ */
2283
+ tryRemoveDir(dirpath, contentOnly = false, omitWarningNotExisted = false) {
1977
2284
  /* */
1978
2285
  /* */
1979
2286
  /* */
@@ -1996,27 +2303,6 @@ class HelpersCore extends HelpersMessages {
1996
2303
  /* */
1997
2304
  /* */
1998
2305
  /* */
1999
- return (void 0);
2000
- }
2001
- /* */
2002
- /* */
2003
- /* */
2004
- /* */
2005
- /* */
2006
- /* */
2007
- /* */
2008
- /* */
2009
- /* */
2010
- /* */
2011
- /* */
2012
- /* */
2013
- /* */
2014
- /* */
2015
- /* */
2016
- /* */
2017
- /* */
2018
- /* */
2019
- exists(folderOrFilePath) {
2020
2306
  /* */
2021
2307
  /* */
2022
2308
  /* */
@@ -2031,6 +2317,9 @@ class HelpersCore extends HelpersMessages {
2031
2317
  /* */
2032
2318
  /* */
2033
2319
  /* */
2320
+ return (void 0);
2321
+ }
2322
+ remove(fileOrFolderPathOrPatter, exactFolder = false) {
2034
2323
  /* */
2035
2324
  /* */
2036
2325
  /* */
@@ -2043,67 +2332,17 @@ class HelpersCore extends HelpersMessages {
2043
2332
  /* */
2044
2333
  return (void 0);
2045
2334
  }
2046
- /**
2047
- * this is HACK for running procesess inside processes
2048
- */
2049
- _fixCommand(command) {
2050
- if ((command.startsWith('tnp ') || command.startsWith('taon ')) && // TODO every cli projects here that uses run and need to kill process easly!
2051
- command.search('-spinner=false') === -1 &&
2052
- command.search('-spinner=off') === -1) {
2053
- command = `${command} -spinner=false`;
2054
- }
2055
- if (global.skipCoreCheck &&
2056
- (command.startsWith('tnp ') || command.startsWith('taon '))) {
2057
- command = `${command} --skipCoreCheck`;
2058
- }
2059
- return command;
2060
- }
2061
- command(command) {
2062
- command = Helpers._fixCommand(command);
2063
- return {
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
- /* */
2106
- /* */
2335
+ /* */
2336
+ /* */
2337
+ /* */
2338
+ /* */
2339
+ /* */
2340
+ /* */
2341
+ /* */
2342
+ /* */
2343
+ /* */
2344
+ /* */
2345
+ get isRunningInGitBash() {
2107
2346
  /* */
2108
2347
  /* */
2109
2348
  /* */
@@ -2112,21 +2351,74 @@ class HelpersCore extends HelpersMessages {
2112
2351
  /* */
2113
2352
  /* */
2114
2353
  /* */
2354
+ return (void 0);
2355
+ }
2356
+ /**
2357
+ * Check if the current shell is supported by Taon framework.
2358
+ */
2359
+ get isSupportedTaonTerminal() {
2115
2360
  /* */
2116
2361
  /* */
2117
- };
2362
+ return (void 0);
2118
2363
  }
2119
- wait(second) {
2120
- return new Promise((resolve, reject) => {
2121
- setTimeout(() => {
2122
- resolve(void 0);
2123
- }, second * 1000);
2124
- });
2364
+ /**
2365
+ * check if function is class
2366
+ */
2367
+ isClass(funcOrClass) {
2368
+ let isClass = false;
2369
+ if (typeof funcOrClass === 'function') {
2370
+ isClass =
2371
+ !!funcOrClass.prototype &&
2372
+ Object.getOwnPropertyNames(funcOrClass.prototype).filter(f => f !== 'constructor').length > 0;
2373
+ }
2374
+ return isClass;
2375
+ }
2376
+ /**
2377
+ * check if data is nodejs/browser blob
2378
+ *
2379
+ * @param maybeBlob
2380
+ * @returns
2381
+ */
2382
+ isBlob(maybeBlob) {
2383
+ return maybeBlob instanceof Blob; // || toString.call(maybeBlob) === '[object Blob]';
2125
2384
  }
2385
+ /**
2386
+ * Check if data is nodejs buffer
2387
+ *
2388
+ * @param maybeNodejsBuffer
2389
+ * @returns
2390
+ */
2126
2391
  /* */
2127
2392
  /* */
2128
2393
  /* */
2129
2394
  /* */
2395
+ removeSlashAtEnd(s) {
2396
+ s = s?.endsWith(`/`) ? s.slice(0, s.length - 1) : s;
2397
+ return s;
2398
+ }
2399
+ removeSlashAtBegin(s) {
2400
+ s = s?.startsWith(`/`) ? s.slice(1) : s;
2401
+ return s;
2402
+ }
2403
+ /**
2404
+ * stringify to pretty json string
2405
+ */
2406
+ stringify(inputObject) {
2407
+ return JSON.stringify(inputObject, null, 2);
2408
+ }
2409
+ async runSyncOrAsync(fnOrOptions) {
2410
+ if (_.isUndefined(fnOrOptions)) {
2411
+ return void 0;
2412
+ }
2413
+ let promisOrValue;
2414
+ const { functionFn, context, arrayOfParams } = fnOrOptions;
2415
+ promisOrValue = functionFn.apply(context, arrayOfParams);
2416
+ // // @ts-ignore
2417
+ if (promisOrValue instanceof Promise) {
2418
+ promisOrValue = Promise.resolve(promisOrValue);
2419
+ }
2420
+ return promisOrValue;
2421
+ }
2130
2422
  /* */
2131
2423
  /* */
2132
2424
  /* */
@@ -2201,137 +2493,622 @@ class HelpersCore extends HelpersMessages {
2201
2493
  /* */
2202
2494
  /* */
2203
2495
  /* */
2204
- async killProcessByPort(portOrPortsToKill, options) {
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
- /* */
2249
- return (void 0);
2250
- }
2251
- async killOnPort(portOrPortsToKill, options) {
2252
- return await Helpers.killProcessByPort(portOrPortsToKill, options);
2253
- }
2254
- killProcess(byPid) {
2255
- /* */
2256
- /* */
2257
- /* */
2258
- /* */
2259
- /* */
2260
- /* */
2261
- /* */
2262
- /* */
2263
- /* */
2264
- /* */
2265
- /* */
2266
- /* */
2267
- /* */
2268
- /* */
2269
- /* */
2270
- /* */
2271
- /* */
2272
- /* */
2273
- /* */
2274
- /* */
2275
- /* */
2276
- /* */
2277
- /* */
2278
- /* */
2279
- /* */
2280
- /* */
2281
- /* */
2282
- }
2283
- run(command, options) {
2284
- command = Helpers._fixCommand(command);
2285
- /* */
2286
- /* */
2287
- /* */
2288
- /* */
2289
- /* */
2290
- /* */
2291
- /* */
2292
- /* */
2293
- return {
2294
- /**
2295
- * start command as synchronous nodej proces
2296
- */
2297
- sync() {
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
- /* */
2325
- /* */
2326
- /* */
2327
- /* */
2328
- /* */
2329
- return (void 0);
2330
- },
2331
- /**
2332
- * start command as asynchronous nodej proces
2333
- * @param detach (default: false) - if true process will be detached
2334
- */
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
+ /**
2669
+ * symlink may have existed or unexisted destiantion url
2670
+ * @param destUrl M
2671
+ */
2672
+ isSymlinkThatMatchesUrl(possibleSymlink, destUrl, absoluteFileMatch = false) {
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
+ return (void 0);
2707
+ }
2708
+ isSymlinkFileExitedOrUnexisted(filePath) {
2709
+ /* */
2710
+ /* */
2711
+ /* */
2712
+ /* */
2713
+ /* */
2714
+ /* */
2715
+ /* */
2716
+ /* */
2717
+ /* */
2718
+ /* */
2719
+ return (void 0);
2720
+ }
2721
+ /**
2722
+ * If symbolnk link that target file does not exits
2723
+ */
2724
+ isUnexistedLink(filePath) {
2725
+ /* */
2726
+ /* */
2727
+ /* */
2728
+ /* */
2729
+ /* */
2730
+ /* */
2731
+ /* */
2732
+ /* */
2733
+ /* */
2734
+ /* */
2735
+ /* */
2736
+ /* */
2737
+ /* */
2738
+ /* */
2739
+ /* */
2740
+ /* */
2741
+ /* */
2742
+ /* */
2743
+ /* */
2744
+ /* */
2745
+ return (void 0);
2746
+ }
2747
+ /**
2748
+ * @param existedLink check if source of link exists
2749
+ */
2750
+ isExistedSymlink(filePath) {
2751
+ /* */
2752
+ /* */
2753
+ /* */
2754
+ /* */
2755
+ /* */
2756
+ /* */
2757
+ /* */
2758
+ /* */
2759
+ /* */
2760
+ /* */
2761
+ /* */
2762
+ /* */
2763
+ /* */
2764
+ /* */
2765
+ /* */
2766
+ /* */
2767
+ /* */
2768
+ /* */
2769
+ /* */
2770
+ /* */
2771
+ /* */
2772
+ /* */
2773
+ return (void 0);
2774
+ }
2775
+ /* */
2776
+ /* */
2777
+ /* */
2778
+ /* */
2779
+ /* */
2780
+ /* */
2781
+ /* */
2782
+ /* */
2783
+ /* */
2784
+ /* */
2785
+ /* */
2786
+ /* */
2787
+ /* */
2788
+ /* */
2789
+ /* */
2790
+ /* */
2791
+ /* */
2792
+ /* */
2793
+ exists(folderOrFilePath) {
2794
+ /* */
2795
+ /* */
2796
+ /* */
2797
+ /* */
2798
+ /* */
2799
+ /* */
2800
+ /* */
2801
+ /* */
2802
+ /* */
2803
+ /* */
2804
+ /* */
2805
+ /* */
2806
+ /* */
2807
+ /* */
2808
+ /* */
2809
+ /* */
2810
+ /* */
2811
+ /* */
2812
+ /* */
2813
+ /* */
2814
+ /* */
2815
+ /* */
2816
+ /* */
2817
+ /* */
2818
+ return (void 0);
2819
+ }
2820
+ /**
2821
+ * this is HACK for running procesess inside processes
2822
+ */
2823
+ _fixCommand(command) {
2824
+ if ((command.startsWith('tnp ') || command.startsWith('taon ')) && // TODO every cli projects here that uses run and need to kill process easly!
2825
+ command.search('-spinner=false') === -1 &&
2826
+ command.search('-spinner=off') === -1) {
2827
+ command = `${command} -spinner=false`;
2828
+ }
2829
+ if (global.skipCoreCheck &&
2830
+ (command.startsWith('tnp ') || command.startsWith('taon '))) {
2831
+ command = `${command} --skipCoreCheck`;
2832
+ }
2833
+ return command;
2834
+ }
2835
+ command(command) {
2836
+ command = Helpers._fixCommand(command);
2837
+ return {
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
+ }
2893
+ wait(second) {
2894
+ return new Promise((resolve, reject) => {
2895
+ setTimeout(() => {
2896
+ resolve(void 0);
2897
+ }, second * 1000);
2898
+ });
2899
+ }
2900
+ async timeout(seconds) {
2901
+ return await Helpers.wait(seconds);
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
+ /* */
2981
+ async killProcessByPort(portOrPortsToKill, options) {
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
+ /* */
3026
+ return (void 0);
3027
+ }
3028
+ async killOnPort(portOrPortsToKill, options) {
3029
+ return await Helpers.killProcessByPort(portOrPortsToKill, options);
3030
+ }
3031
+ killProcess(byPid) {
3032
+ /* */
3033
+ /* */
3034
+ /* */
3035
+ /* */
3036
+ /* */
3037
+ /* */
3038
+ /* */
3039
+ /* */
3040
+ /* */
3041
+ /* */
3042
+ /* */
3043
+ /* */
3044
+ /* */
3045
+ /* */
3046
+ /* */
3047
+ /* */
3048
+ /* */
3049
+ /* */
3050
+ /* */
3051
+ /* */
3052
+ /* */
3053
+ /* */
3054
+ /* */
3055
+ /* */
3056
+ /* */
3057
+ /* */
3058
+ /* */
3059
+ }
3060
+ run(command, options) {
3061
+ command = Helpers._fixCommand(command);
3062
+ /* */
3063
+ /* */
3064
+ /* */
3065
+ /* */
3066
+ /* */
3067
+ /* */
3068
+ /* */
3069
+ /* */
3070
+ return {
3071
+ /**
3072
+ * start command as synchronous nodej proces
3073
+ */
3074
+ sync() {
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
+ /* */
3102
+ /* */
3103
+ /* */
3104
+ /* */
3105
+ /* */
3106
+ return (void 0);
3107
+ },
3108
+ /**
3109
+ * start command as asynchronous nodej proces
3110
+ * @param detach (default: false) - if true process will be detached
3111
+ */
2335
3112
  async(detach = false, mockFun) {
2336
3113
  if (mockFun) {
2337
3114
  const subStdoutSub = new Subject();
@@ -2656,168 +3433,15 @@ class HelpersCore extends HelpersMessages {
2656
3433
  /* */
2657
3434
  /* */
2658
3435
  /* */
2659
- /* */
2660
- /* */
2661
- /* */
2662
- /* */
2663
- /* */
2664
- /* */
2665
- /* */
2666
- return (void 0);
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
- /* */
2816
- /* */
2817
- /* */
2818
- /* */
2819
- /* */
2820
- /* */
3436
+ /* */
3437
+ /* */
3438
+ /* */
3439
+ /* */
3440
+ /* */
3441
+ /* */
3442
+ /* */
3443
+ return (void 0);
3444
+ }
2821
3445
  /* */
2822
3446
  /* */
2823
3447
  /* */
@@ -3184,23 +3808,6 @@ class HelpersCore extends HelpersMessages {
3184
3808
  /* */
3185
3809
  /* */
3186
3810
  /* */
3187
- /**
3188
- * Quick fix for object values
3189
- * @deprecated
3190
- */
3191
- values(obj) {
3192
- if (_.isObject(obj) && !Array.isArray(obj)) {
3193
- const values = [];
3194
- for (const key in obj) {
3195
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
3196
- // @ts-ignore
3197
- values.push(obj[key]);
3198
- }
3199
- }
3200
- return values;
3201
- }
3202
- return [];
3203
- }
3204
3811
  /* */
3205
3812
  /* */
3206
3813
  /* */
@@ -3354,6 +3961,23 @@ class HelpersCore extends HelpersMessages {
3354
3961
  /* */
3355
3962
  /* */
3356
3963
  /* */
3964
+ /**
3965
+ * Quick fix for object values
3966
+ * @deprecated
3967
+ */
3968
+ values(obj) {
3969
+ if (_.isObject(obj) && !Array.isArray(obj)) {
3970
+ const values = [];
3971
+ for (const key in obj) {
3972
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
3973
+ // @ts-ignore
3974
+ values.push(obj[key]);
3975
+ }
3976
+ }
3977
+ return values;
3978
+ }
3979
+ return [];
3980
+ }
3357
3981
  /* */
3358
3982
  /* */
3359
3983
  /* */
@@ -3363,14 +3987,6 @@ class HelpersCore extends HelpersMessages {
3363
3987
  /* */
3364
3988
  /* */
3365
3989
  /* */
3366
- replaceLinesInFile(absoluteFilePath, lineReplaceFn) {
3367
- /* */
3368
- /* */
3369
- /* */
3370
- /* */
3371
- /* */
3372
- /* */
3373
- }
3374
3990
  /* */
3375
3991
  /* */
3376
3992
  /* */
@@ -3524,6 +4140,14 @@ class HelpersCore extends HelpersMessages {
3524
4140
  /* */
3525
4141
  /* */
3526
4142
  /* */
4143
+ replaceLinesInFile(absoluteFilePath, lineReplaceFn) {
4144
+ /* */
4145
+ /* */
4146
+ /* */
4147
+ /* */
4148
+ /* */
4149
+ /* */
4150
+ }
3527
4151
  /* */
3528
4152
  /* */
3529
4153
  /* */
@@ -3707,360 +4331,181 @@ class HelpersCore extends HelpersMessages {
3707
4331
  /* */
3708
4332
  /* */
3709
4333
  /* */
3710
- hideNodeWarnings() {
3711
- /* */
3712
- /* */
3713
- /* */
3714
- }
3715
- }
3716
- ;
3717
- ({}); // @--end-of-file-for-module=tnp-core lib/helpers.ts
3718
-
3719
- const CoreConfig = {
3720
- message: {
3721
- globalSystemToolMode: 'globalSystemToolMode',
3722
- },
3723
- };
3724
- ;
3725
- ({}); // @--end-of-file-for-module=tnp-core lib/core-config.ts
3726
-
3727
- class PROGRESS_DATA {
3728
- constructor() {
3729
- this.type = 'event';
3730
- }
3731
- static log(log) {
3732
- /* */
3733
- /* */
3734
- /* */
3735
- /* */
3736
- /* */
3737
- /* */
3738
- /* */
3739
- }
3740
- static resolveFrom(chunk, callbackOnFounded, checkSplit = true) {
3741
- let progress;
3742
- let res = [];
3743
- if (!_.isString(chunk)) {
3744
- return [];
3745
- }
3746
- chunk = chunk.trim();
3747
- if (checkSplit) {
3748
- const split = chunk.split(/\r\n|\n|\r/);
3749
- if (split.length > 1) {
3750
- split.forEach(s => {
3751
- res = res.concat(this.resolveFrom(s, callbackOnFounded, false));
3752
- });
3753
- return res;
3754
- }
3755
- }
3756
- if (/\[\[\[.*\]\]\]/g.test(chunk)) {
3757
- chunk = chunk.replace(/^\[\[\[/g, '').replace(/\]\]\]$/g, '');
3758
- progress = chunk;
3759
- }
3760
- if (!_.isUndefined(progress)) {
3761
- try {
3762
- const p = JSON.parse(progress);
3763
- const single = _.merge(new PROGRESS_DATA(), p);
3764
- res = res.concat([single]);
3765
- if (_.isFunction(callbackOnFounded)) {
3766
- callbackOnFounded(single);
3767
- }
3768
- }
3769
- catch (err) {
3770
- Helpers.error(err, true, true);
3771
- Helpers.error(`ProgresssBarData: fail to parse "${progress}"`, true, true);
3772
- }
3773
- }
3774
- return res;
3775
- }
3776
- }
3777
- ;
3778
- ({}); // @--end-of-file-for-module=tnp-core lib/progress-data.ts
3779
-
3780
- /* */
3781
- /* */
3782
- /* */
3783
- const BLOB_SUPPORTED_IN_SQLJS = false;
3784
- var Utils;
3785
- (function (Utils) {
3786
- Utils.uniqArray = (array, uniqueProperty) => {
3787
- var seen = {};
3788
- return array
3789
- .filter(f => !!f)
3790
- .filter(function (item) {
3791
- return seen.hasOwnProperty(uniqueProperty ? item[uniqueProperty] : item)
3792
- ? false
3793
- : (seen[uniqueProperty ? item[uniqueProperty] : item] = true);
3794
- });
3795
- };
3796
- /**
3797
- * Example:
3798
- * new RegExp(escapeStringForRegEx('a.b.c'),'g') => /a\.b\.c/g
3799
- */
3800
- Utils.escapeStringForRegEx = (stringForRegExp) => {
3801
- return stringForRegExp.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
3802
- };
3803
- function removeChalkSpecialChars(str) {
3804
- const ansiRegex = /\u001b\[[0-9;]*m/g;
3805
- return str.replace(ansiRegex, '');
3806
- }
3807
- Utils.removeChalkSpecialChars = removeChalkSpecialChars;
3808
- Utils.fullDateTime = () => {
3809
- /* */
3810
- /* */
3811
- return (void 0);
3812
- };
3813
- Utils.fullDate = () => {
3814
- /* */
3815
- /* */
3816
- return (void 0);
3817
- };
3818
- let json;
3819
- (function (json) {
3820
- json.getAtrributies = (jsonDeepPath, // lodash path to property in json ex. deep.path.to.prop
3821
- fileContent) => {
3822
- const lines = fileContent.split('\n');
3823
- const pathParts = jsonDeepPath.split('.').reduce((a, b) => {
3824
- if (a.length === 0) {
3825
- return [b];
3826
- }
3827
- const last = a[a.length - 1];
3828
- if ((last.startsWith(`['`) && b.endsWith(`']`)) ||
3829
- (last.startsWith(`["`) && b.endsWith(`"]`))) {
3830
- a[a.length - 1] = [last, b].join('.');
3831
- }
3832
- else {
3833
- a.push(b);
3834
- }
3835
- return a;
3836
- }, []);
3837
- const keyName = pathParts.pop().replace(/^\["(.+)"\]$/, '$1');
3838
- let currentPath = '';
3839
- let attributes = [];
3840
- let collectedComments = [];
3841
- for (const line of lines) {
3842
- const trimmedLine = line.trim();
3843
- if (trimmedLine.startsWith('//')) {
3844
- collectedComments.push(trimmedLine);
3845
- }
3846
- else if (trimmedLine.startsWith('"') || trimmedLine.startsWith("'")) {
3847
- const match = trimmedLine.match(/["']([^"']+)["']\s*:/);
3848
- if (match) {
3849
- const key = match[1];
3850
- currentPath = currentPath
3851
- ? `${currentPath}.${key.includes('.') ? `['${key}']` : key}`
3852
- : key;
3853
- if ((currentPath.endsWith(keyName) &&
3854
- !currentPath.endsWith('/' + keyName)) ||
3855
- currentPath.endsWith(`['${keyName}']`)) {
3856
- attributes = extractAttributesFromComments(collectedComments);
3857
- break;
3858
- }
3859
- collectedComments = [];
3860
- }
3861
- }
3862
- }
3863
- return attributes;
3864
- };
3865
- const extractAttributesFromComments = (comments) => {
3866
- const attributes = [];
3867
- const attrRegex = /@(\w+)(?:\s*=\s*([^\s@]+))?/g;
3868
- for (const comment of comments) {
3869
- let match;
3870
- while ((match = attrRegex.exec(comment)) !== null) {
3871
- const [, name, value] = match;
3872
- const existingAttribute = attributes.find(attr => attr.name === `@${name}`);
3873
- if (existingAttribute) {
3874
- if (value) {
3875
- if (Array.isArray(existingAttribute.value)) {
3876
- existingAttribute.value.push(value);
3877
- }
3878
- else {
3879
- existingAttribute.value = [existingAttribute.value, value];
3880
- }
3881
- }
3882
- }
3883
- else {
3884
- attributes.push({
3885
- name: `@${name}`,
3886
- value: value ? value : true,
3887
- });
3888
- }
3889
- }
3890
- }
3891
- attributes.forEach(attr => {
3892
- if (Array.isArray(attr.value) && attr.value.length === 1) {
3893
- attr.value = attr.value[0];
3894
- }
3895
- });
3896
- return attributes;
3897
- };
3898
- })(json = Utils.json || (Utils.json = {}));
3899
- let DbBinaryFormatEnum;
3900
- (function (DbBinaryFormatEnum) {
3901
- DbBinaryFormatEnum["Blob"] = "Blob";
3902
- DbBinaryFormatEnum["File"] = "File";
3903
- DbBinaryFormatEnum["string"] = "string";
3904
- /* */
3905
- /* */
3906
- })(DbBinaryFormatEnum = Utils.DbBinaryFormatEnum || (Utils.DbBinaryFormatEnum = {}));
3907
4334
  /* */
3908
4335
  /* */
3909
- let binary;
3910
- (function (binary) {
3911
- /**
3912
- * This is for BROWSER ONLY
3913
- *
3914
- * @param buffer
3915
- * @param contentType
3916
- * @returns
3917
- */
3918
- async function arrayBufferToBlob(buffer, contentType) {
3919
- // @ts-ignore
3920
- return new Blob([buffer], { type: contentType });
3921
- }
3922
- binary.arrayBufferToBlob = arrayBufferToBlob;
3923
- /**
3924
- * This is for BROWSER ONLY
3925
- * @param blob
3926
- * @returns
3927
- */
3928
- async function blobToArrayBuffer(blob) {
3929
- return await new Promise((resolve, reject) => {
3930
- const reader = new FileReader();
3931
- reader.addEventListener('loadend', () => {
3932
- resolve(reader.result);
3933
- });
3934
- reader.addEventListener('error', reject); // @ts-ignore
3935
- reader.readAsArrayBuffer(blob);
3936
- });
3937
- }
3938
- binary.blobToArrayBuffer = blobToArrayBuffer;
3939
- /**
3940
- * it is revers to base64toBlob
3941
- * @param blob
3942
- * @returns
3943
- */
3944
- function blobToBase64(blob) {
3945
- return new Promise((resolve, _) => {
3946
- const reader = new FileReader();
3947
- reader.onloadend = () => resolve(reader.result); // @ts-ignore
3948
- reader.readAsDataURL(blob);
3949
- });
3950
- }
3951
- binary.blobToBase64 = blobToBase64;
3952
- /**
3953
- * it is revers to blobToBase64()
3954
- * @param base64Data
3955
- * @returns
3956
- */
3957
- async function base64toBlob(base64Data, contentTypeOverride) {
3958
- let content_type = void 0;
3959
- let file_base64 = void 0;
3960
- if (!contentTypeOverride) {
3961
- const m = /^data:(.+?);base64,(.+)$/.exec(base64Data);
3962
- if (!m) {
3963
- throw new Error(`[taon-framework][base64toBlob] Not a base64 blob [${base64Data}]`);
3964
- }
3965
- var [__, contenttype, filebase64] = m;
3966
- content_type = contenttype;
3967
- file_base64 = filebase64;
3968
- }
3969
- content_type = (contentTypeOverride ? contentTypeOverride : content_type || '');
3970
- base64Data = contentTypeOverride ? base64Data : file_base64;
3971
- const sliceSize = 1024;
3972
- const byteCharacters = atob(base64Data);
3973
- const bytesLength = byteCharacters.length;
3974
- const slicesCount = Math.ceil(bytesLength / sliceSize);
3975
- const byteArrays = new Array(slicesCount);
3976
- for (let sliceIndex = 0; sliceIndex < slicesCount; ++sliceIndex) {
3977
- const begin = sliceIndex * sliceSize;
3978
- const end = Math.min(begin + sliceSize, bytesLength);
3979
- const bytes = new Array(end - begin);
3980
- for (let offset = begin, i = 0; offset < end; ++i, ++offset) {
3981
- bytes[i] = byteCharacters[offset].charCodeAt(0);
3982
- }
3983
- byteArrays[sliceIndex] = new Uint8Array(bytes);
3984
- }
3985
- return new Blob(byteArrays, { type: content_type });
3986
- }
3987
- binary.base64toBlob = base64toBlob;
3988
- async function base64toDbBinaryFormat(text) {
3989
- let result;
3990
- result = await (async () => {
3991
- if (BLOB_SUPPORTED_IN_SQLJS) {
3992
- const blob = await base64toBlob(text);
3993
- return blob;
3994
- }
3995
- return text;
3996
- })();
3997
- /* */
3998
- /* */
3999
- /* */
4000
- /* */
4001
- /* */
4002
- return result;
4003
- }
4004
- binary.base64toDbBinaryFormat = base64toDbBinaryFormat;
4005
- async function dbBinaryFormatToBase64(binaryFormat) {
4006
- let result;
4007
- result = await (async () => {
4008
- if (BLOB_SUPPORTED_IN_SQLJS) {
4009
- const text = await blobToBase64(binaryFormat);
4010
- return text;
4011
- }
4012
- return binaryFormat;
4013
- })();
4014
- /* */
4015
- /* */
4016
- /* */
4017
- /* */
4018
- /* */
4019
- return result;
4020
- }
4021
- binary.dbBinaryFormatToBase64 = dbBinaryFormatToBase64;
4022
- async function textToDbBinaryFormat(text) {
4023
- let result;
4024
- result = await (async () => {
4025
- if (BLOB_SUPPORTED_IN_SQLJS) {
4026
- const blob = await textToBlob(text);
4027
- return blob;
4028
- }
4029
- return text;
4030
- })();
4031
- /* */
4032
- /* */
4033
- /* */
4034
- /* */
4035
- /* */
4036
- return result;
4037
- }
4038
- binary.textToDbBinaryFormat = textToDbBinaryFormat;
4039
- async function dbBinaryFormatToText(binaryFormat) {
4040
- let result;
4041
- result = await (async () => {
4042
- if (BLOB_SUPPORTED_IN_SQLJS) {
4043
- const text = await blobToText(binaryFormat);
4044
- return text;
4045
- }
4046
- return binaryFormat;
4047
- })();
4048
- /* */
4049
- /* */
4050
- /* */
4051
- /* */
4052
- /* */
4053
- return result;
4054
- }
4055
- binary.dbBinaryFormatToText = dbBinaryFormatToText;
4056
- /* */
4057
- /* */
4058
- /* */
4059
- /* */
4060
- /* */
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
+ /* */
4483
+ /* */
4484
+ /* */
4485
+ /* */
4486
+ /* */
4487
+ hideNodeWarnings() {
4061
4488
  /* */
4062
4489
  /* */
4063
4490
  /* */
4491
+ }
4492
+ }
4493
+ ;
4494
+ ({}); // @--end-of-file-for-module=tnp-core lib/helpers.ts
4495
+
4496
+ const CoreConfig = {
4497
+ message: {
4498
+ globalSystemToolMode: 'globalSystemToolMode',
4499
+ },
4500
+ };
4501
+ ;
4502
+ ({}); // @--end-of-file-for-module=tnp-core lib/core-config.ts
4503
+
4504
+ class PROGRESS_DATA {
4505
+ constructor() {
4506
+ this.type = 'event';
4507
+ }
4508
+ static log(log) {
4064
4509
  /* */
4065
4510
  /* */
4066
4511
  /* */
@@ -4068,165 +4513,46 @@ var Utils;
4068
4513
  /* */
4069
4514
  /* */
4070
4515
  /* */
4071
- async function fileToBlob(file) {
4072
- return new Blob([new Uint8Array(await file.arrayBuffer())], {
4073
- type: file.type,
4074
- });
4516
+ }
4517
+ static resolveFrom(chunk, callbackOnFounded, checkSplit = true) {
4518
+ let progress;
4519
+ let res = [];
4520
+ if (!_.isString(chunk)) {
4521
+ return [];
4075
4522
  }
4076
- binary.fileToBlob = fileToBlob;
4077
- async function blobToFile(blob, nameForFile = 'my-file-name') {
4078
- if (!nameForFile) {
4079
- nameForFile = 'nonamefile' + new Date().getTime();
4523
+ chunk = chunk.trim();
4524
+ if (checkSplit) {
4525
+ const split = chunk.split(/\r\n|\n|\r/);
4526
+ if (split.length > 1) {
4527
+ split.forEach(s => {
4528
+ res = res.concat(this.resolveFrom(s, callbackOnFounded, false));
4529
+ });
4530
+ return res;
4080
4531
  }
4081
- // @ts-ignore
4082
- return new File([blob], nameForFile);
4083
- }
4084
- binary.blobToFile = blobToFile;
4085
- /* */
4086
- /* */
4087
- /* */
4088
- /* */
4089
- /* */
4090
- /* */
4091
- /* */
4092
- /* */
4093
- /* */
4094
- /* */
4095
- /* */
4096
- /* */
4097
- /* */
4098
- /* */
4099
- /* */
4100
- /* */
4101
- /* */
4102
- /* */
4103
- /* */
4104
- /* */
4105
- /* */
4106
- /* */
4107
- /* */
4108
- /* */
4109
- /* */
4110
- /* */
4111
- async function textToBlob(text, type = 'text/plain') {
4112
- const blob = new Blob([text], { type });
4113
- return blob;
4114
- }
4115
- binary.textToBlob = textToBlob;
4116
- async function blobToText(blob) {
4117
- return await blob.text();
4118
- }
4119
- binary.blobToText = blobToText;
4120
- async function textToFile(text, fileRelativePathOrName) {
4121
- const ext = path.extname(fileRelativePathOrName);
4122
- const type = CoreModels.mimeTypes[ext];
4123
- const blob = new Blob([text], { type });
4124
- const file = await blobToFile(blob, fileRelativePathOrName);
4125
- return file;
4126
- }
4127
- binary.textToFile = textToFile;
4128
- async function fileToText(file) {
4129
- return await file.text();
4130
- }
4131
- binary.fileToText = fileToText;
4132
- async function jsonToBlob(jsonObj) {
4133
- const blob = new Blob([JSON.stringify(jsonObj, null, 2)], {
4134
- type: 'application/json',
4135
- });
4136
- return blob;
4137
4532
  }
4138
- binary.jsonToBlob = jsonToBlob;
4139
- /**
4140
- * TODO NOT TESTED
4141
- */
4142
- async function blobToJson(blob) {
4143
- return JSON.parse(await blob.text());
4144
- }
4145
- binary.blobToJson = blobToJson;
4146
- async function getBlobFrom(url) {
4147
- const response = await axios({
4148
- url,
4149
- method: 'get',
4150
- responseType: 'blob',
4151
- });
4152
- return response.data;
4533
+ if (/\[\[\[.*\]\]\]/g.test(chunk)) {
4534
+ chunk = chunk.replace(/^\[\[\[/g, '').replace(/\]\]\]$/g, '');
4535
+ progress = chunk;
4153
4536
  }
4154
- binary.getBlobFrom = getBlobFrom;
4155
- })(binary = Utils.binary || (Utils.binary = {}));
4156
- let css;
4157
- (function (css) {
4158
- /**
4159
- *
4160
- * @param pixelsCss pixels ex. 100px
4161
- * @returns
4162
- */
4163
- function numValue(pixelsCss) {
4164
- return parseInt(pixelsCss?.toString()?.replace('px', ''));
4537
+ if (!_.isUndefined(progress)) {
4538
+ try {
4539
+ const p = JSON.parse(progress);
4540
+ const single = _.merge(new PROGRESS_DATA(), p);
4541
+ res = res.concat([single]);
4542
+ if (_.isFunction(callbackOnFounded)) {
4543
+ callbackOnFounded(single);
4544
+ }
4545
+ }
4546
+ catch (err) {
4547
+ Helpers.error(err, true, true);
4548
+ Helpers.error(`ProgresssBarData: fail to parse "${progress}"`, true, true);
4549
+ }
4165
4550
  }
4166
- css.numValue = numValue;
4167
- })(css = Utils.css || (Utils.css = {}));
4168
- })(Utils || (Utils = {}));
4169
- var UtilsProcess;
4170
- (function (UtilsProcess) {
4171
- /**
4172
- * TODO IMPLEMENT
4173
- */
4174
- async function startAsync(command, options) {
4175
- }
4176
- UtilsProcess.startAsync = startAsync;
4177
- /**
4178
- * TODO IMPLEMENT
4179
- */
4180
- function startSync(command, options) {
4551
+ return res;
4181
4552
  }
4182
- UtilsProcess.startSync = startSync;
4183
- UtilsProcess.getBashOrShellName = () => {
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
- /* */
4212
- /* */
4213
- /* */
4214
- /* */
4215
- /* */
4216
- return (void 0);
4217
- };
4218
- })(UtilsProcess || (UtilsProcess = {}));
4219
- var UtilsString;
4220
- (function (UtilsString) {
4221
- UtilsString.kebabCaseNoSplitNumbers = (input) => {
4222
- return (input
4223
- .replace(/\s+/g, '-')
4224
- .replace(/([a-z0-9])([A-Z])/g, '$1-$2')
4225
- .toLowerCase());
4226
- };
4227
- })(UtilsString || (UtilsString = {}));
4553
+ }
4228
4554
  ;
4229
- ({}); // @--end-of-file-for-module=tnp-core lib/utils.ts
4555
+ ({}); // @--end-of-file-for-module=tnp-core lib/progress-data.ts
4230
4556
 
4231
4557
  /* */
4232
4558
  /* */
@@ -4248,6 +4574,10 @@ class CLI {
4248
4574
  ;
4249
4575
  ({}); // @--end-of-file-for-module=tnp-core lib/core-cli.ts
4250
4576
 
4577
+ /**
4578
+ * TODO slowly refactor this.. only actually globally needed are:
4579
+ * pm2, yarn, npm-run, ts-node ???
4580
+ */
4251
4581
  const requiredForDev = {
4252
4582
  npm: [
4253
4583
  /* */
@@ -4282,6 +4612,9 @@ const requiredForDev = {
4282
4612
  /* */
4283
4613
  /* */
4284
4614
  /* */
4615
+ /* */
4616
+ /* */
4617
+ /* */
4285
4618
  ],
4286
4619
  niceTools: [
4287
4620
  /* */
@@ -4318,7 +4651,7 @@ const requiredForDev = {
4318
4651
  ],
4319
4652
  };
4320
4653
  ;
4321
- ({}); // @--end-of-file-for-module=tnp-core lib/required.ts
4654
+ ({}); // @--end-of-file-for-module=tnp-core lib/required-global-npm-packages.ts
4322
4655
 
4323
4656
  let Helpers = HelpersCore.InstanceCore;
4324
4657
  ;
@@ -4328,5 +4661,5 @@ let Helpers = HelpersCore.InstanceCore;
4328
4661
  * Generated bundle index. Do not edit.
4329
4662
  */
4330
4663
 
4331
- export { $, CLI, CoreConfig, HelpersCore as CoreHelpers, CoreModels, Helpers, PROGRESS_DATA, Utils, UtilsProcess, UtilsString, chalk, crossPlatformPath, frameworkName, frameworkNameBe, path, requiredForDev, win32Path };
4664
+ export { $, CLI, CoreConfig, HelpersCore as CoreHelpers, CoreModels, Helpers, PROGRESS_DATA, Utils, UtilsMigrations, UtilsOs, UtilsProcess, UtilsString, chalk, crossPlatformPath, frameworkName, frameworkNameBe, path, requiredForDev, win32Path };
4332
4665
  //# sourceMappingURL=tnp-core.mjs.map