vortez 4.1.1

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 (86) hide show
  1. package/.gitignore +13 -0
  2. package/LICENSE +201 -0
  3. package/Notes.md +12 -0
  4. package/README.md +372 -0
  5. package/build/Beta/JwtManager.d.ts +114 -0
  6. package/build/Beta/JwtManager.js +249 -0
  7. package/build/Beta/JwtManager.js.map +1 -0
  8. package/build/Beta/Mail.d.ts +60 -0
  9. package/build/Beta/Mail.js +192 -0
  10. package/build/Beta/Mail.js.map +1 -0
  11. package/build/Config.d.ts +39 -0
  12. package/build/Config.js +33 -0
  13. package/build/Config.js.map +1 -0
  14. package/build/ConsoleUI.d.ts +57 -0
  15. package/build/ConsoleUI.js +110 -0
  16. package/build/ConsoleUI.js.map +1 -0
  17. package/build/Debug.d.ts +154 -0
  18. package/build/Debug.js +256 -0
  19. package/build/Debug.js.map +1 -0
  20. package/build/LoggerManager/Logger.d.ts +23 -0
  21. package/build/LoggerManager/Logger.js +23 -0
  22. package/build/LoggerManager/Logger.js.map +1 -0
  23. package/build/LoggerManager/LoggerManager.d.ts +18 -0
  24. package/build/LoggerManager/LoggerManager.js +30 -0
  25. package/build/LoggerManager/LoggerManager.js.map +1 -0
  26. package/build/Server/BodyParser.d.ts +125 -0
  27. package/build/Server/BodyParser.js +162 -0
  28. package/build/Server/BodyParser.js.map +1 -0
  29. package/build/Server/Cookie.d.ts +72 -0
  30. package/build/Server/Cookie.js +102 -0
  31. package/build/Server/Cookie.js.map +1 -0
  32. package/build/Server/Request.d.ts +61 -0
  33. package/build/Server/Request.js +79 -0
  34. package/build/Server/Request.js.map +1 -0
  35. package/build/Server/Response.d.ts +90 -0
  36. package/build/Server/Response.js +241 -0
  37. package/build/Server/Response.js.map +1 -0
  38. package/build/Server/Rule.d.ts +81 -0
  39. package/build/Server/Rule.js +146 -0
  40. package/build/Server/Rule.js.map +1 -0
  41. package/build/Server/Server.d.ts +157 -0
  42. package/build/Server/Server.js +330 -0
  43. package/build/Server/Server.js.map +1 -0
  44. package/build/Server/Session.d.ts +66 -0
  45. package/build/Server/Session.js +97 -0
  46. package/build/Server/Session.js.map +1 -0
  47. package/build/Server/WebSocket/Chunk.d.ts +36 -0
  48. package/build/Server/WebSocket/Chunk.js +81 -0
  49. package/build/Server/WebSocket/Chunk.js.map +1 -0
  50. package/build/Server/WebSocket/WebSocket.d.ts +70 -0
  51. package/build/Server/WebSocket/WebSocket.js +184 -0
  52. package/build/Server/WebSocket/WebSocket.js.map +1 -0
  53. package/build/Template.d.ts +32 -0
  54. package/build/Template.js +69 -0
  55. package/build/Template.js.map +1 -0
  56. package/build/Utilities/Env.d.ts +75 -0
  57. package/build/Utilities/Env.js +123 -0
  58. package/build/Utilities/Env.js.map +1 -0
  59. package/build/Utilities/Path.d.ts +18 -0
  60. package/build/Utilities/Path.js +27 -0
  61. package/build/Utilities/Path.js.map +1 -0
  62. package/build/Utilities/Utilities.d.ts +147 -0
  63. package/build/Utilities/Utilities.js +110 -0
  64. package/build/Utilities/Utilities.js.map +1 -0
  65. package/build/Vortez.d.ts +20 -0
  66. package/build/Vortez.js +22 -0
  67. package/build/Vortez.js.map +1 -0
  68. package/changes.md +89 -0
  69. package/examples/in-docs.js +96 -0
  70. package/global/Source/Logo_960.png +0 -0
  71. package/global/Source/Logo_SM_960.png +0 -0
  72. package/global/Style/Template/Error.css +30 -0
  73. package/global/Style/Template/Folder.css +77 -0
  74. package/global/Style/Template/Template.css +128 -0
  75. package/global/Template/Error.vhtml +29 -0
  76. package/global/Template/Folder.vhtml +41 -0
  77. package/package.json +47 -0
  78. package/tests/Template/template.js +18 -0
  79. package/tests/Template/template.txt +13 -0
  80. package/tests/Template/template.vhtml +23 -0
  81. package/tests/debug.js +28 -0
  82. package/tests/jwtManager/jwtManager.js +110 -0
  83. package/tests/test.js +129 -0
  84. package/tests/test.vhtml +14 -0
  85. package/tests/utilities.js +28 -0
  86. package/tests/websocket.vhtml +86 -0
@@ -0,0 +1,39 @@
1
+ /**
2
+ * @author NetFeez <codefeez.dev@gmail.com>
3
+ * @description add the config manager to the Vortez.
4
+ * @license Apache-2.0
5
+ */
6
+ import LoggerManager from "./LoggerManager/LoggerManager.js";
7
+ export declare class Config implements Config.Main {
8
+ templates: Config.Templates;
9
+ host: string;
10
+ port: number;
11
+ logger: LoggerManager;
12
+ ssl: Config.SSLOptions | null;
13
+ static instance: Config;
14
+ constructor(options?: Config.options);
15
+ get showAll(): boolean;
16
+ set showAll(value: boolean);
17
+ static defaultTemplates(): Config.Templates;
18
+ }
19
+ export declare namespace Config {
20
+ interface Templates {
21
+ folder?: string;
22
+ error?: string;
23
+ [key: string]: string | undefined;
24
+ }
25
+ type SSLOptions = {
26
+ pubKey: string;
27
+ privKey: string;
28
+ port?: number;
29
+ };
30
+ interface Main {
31
+ host: string;
32
+ port: number;
33
+ ssl: SSLOptions | null;
34
+ logger: LoggerManager;
35
+ templates: Templates;
36
+ }
37
+ type options = Partial<Main>;
38
+ }
39
+ export default Config;
@@ -0,0 +1,33 @@
1
+ /**
2
+ * @author NetFeez <codefeez.dev@gmail.com>
3
+ * @description add the config manager to the Vortez.
4
+ * @license Apache-2.0
5
+ */
6
+ import Debug from "./Debug.js";
7
+ import LoggerManager from "./LoggerManager/LoggerManager.js";
8
+ import Utilities from "./Utilities/Utilities.js";
9
+ export class Config {
10
+ templates;
11
+ host;
12
+ port;
13
+ logger;
14
+ ssl;
15
+ static instance;
16
+ constructor(options = {}) {
17
+ this.host = options.host ?? 'localhost';
18
+ this.port = options.port ?? 80;
19
+ this.ssl = options.ssl ?? null;
20
+ this.logger = options.logger ?? LoggerManager.getInstance();
21
+ this.templates = options.templates ?? Config.defaultTemplates();
22
+ }
23
+ get showAll() { return Debug.showAll; }
24
+ set showAll(value) { Debug.showAll = value; }
25
+ static defaultTemplates() {
26
+ return {
27
+ folder: Utilities.Path.relative('./global/Template/Folder.vhtml'),
28
+ error: Utilities.Path.relative('./global/Template/Error.vhtml')
29
+ };
30
+ }
31
+ }
32
+ export default Config;
33
+ //# sourceMappingURL=Config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Config.js","sourceRoot":"","sources":["../src/Config.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,aAAa,MAAM,kCAAkC,CAAC;AAC7D,OAAO,SAAS,MAAM,0BAA0B,CAAC;AAEjD,MAAM,OAAO,MAAM;IACR,SAAS,CAAmB;IAC5B,IAAI,CAAS;IACb,IAAI,CAAS;IACb,MAAM,CAAgB;IACtB,GAAG,CAA2B;IAC9B,MAAM,CAAC,QAAQ,CAAS;IAC/B,YAAmB,UAA0B,EAAE;QAC3C,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,WAAW,CAAC;QACxC,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC;QAC/B,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,IAAI,CAAC;QAC/B,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,aAAa,CAAC,WAAW,EAAE,CAAC;QAC5D,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,MAAM,CAAC,gBAAgB,EAAE,CAAC;IACpE,CAAC;IACD,IAAW,OAAO,KAAc,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;IACvD,IAAW,OAAO,CAAC,KAAc,IAAI,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC;IACtD,MAAM,CAAC,gBAAgB;QAC1B,OAAO;YACH,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,gCAAgC,CAAC;YACjE,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,+BAA+B,CAAC;SAClE,CAAC;IACN,CAAC;CACJ;AAuBD,eAAe,MAAM,CAAC"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * @author NetFeez <codefeez.dev@gmail.com>
3
+ * @description contains the basic functionalities for module NetFeez-Labs tools
4
+ * @license Apache-2.0
5
+ */
6
+ export declare class ConsoleUI {
7
+ private static formatString;
8
+ private static rgbString;
9
+ private static formats;
10
+ /**
11
+ * delete text formats and colors.
12
+ * @param text the text to clean.
13
+ * @param prefix the prefix.
14
+ */
15
+ static cleanFormat(text: string, prefix?: string): string;
16
+ /**
17
+ * colors the text.
18
+ * @param text the text to color.
19
+ * @param prefix the prefix.
20
+ * The default prefix is `&`
21
+ * Colors and formats
22
+ * - Formats:
23
+ * - - `N`: Bold
24
+ * - - `S`: Underline
25
+ * - - `P`: Blink
26
+ * - - `I`: Invert
27
+ * - - `R`: Reset
28
+ * - `B`: Used before a color to refer to the background.
29
+ * - - Example: `&B2Hello` will change the background of the text to green.
30
+ * - `C`: Used before a color to refer to the text.
31
+ * - - Example: `&C2Hello` will change the color of the text to green.
32
+ * - Colors:
33
+ * - - `(R,G,B)`: an RGB color, replace R, G, and B with their respective values.
34
+ * - - - No spaces after the `,`
35
+ * - - - Example: `&B(0,255,0)Hello` will change the background of the text to green.
36
+ * - - - Example: `&C(0,255,0)Hello` will change the color of the text to green.
37
+ * - - `0`: Black
38
+ * - - `1`: White
39
+ * - - `2`: Green
40
+ * - - `3`: Cyan
41
+ * - - `4`: Blue
42
+ * - - `5`: Magenta
43
+ * - - `6`: Red
44
+ * - - `7`: Yellow
45
+ */
46
+ static formatText(text: string, prefix?: string): string;
47
+ /**
48
+ * sends a message to the user through the console
49
+ * @param message the message(s) you want to send to the user
50
+ * @param newLine whether there is a line break or not
51
+ */
52
+ static send(message: string | string[], newLine?: boolean): void;
53
+ }
54
+ export declare namespace ConsoleUI {
55
+ type formatKey = ('N' | 'S' | 'P' | 'I' | 'R' | 'C0' | 'C1' | 'C2' | 'C3' | 'C4' | 'C5' | 'C6' | 'C7' | 'C' | 'B0' | 'B1' | 'B2' | 'B3' | 'B4' | 'B5' | 'B6' | 'B7' | 'B');
56
+ }
57
+ export default ConsoleUI;
@@ -0,0 +1,110 @@
1
+ /**
2
+ * @author NetFeez <codefeez.dev@gmail.com>
3
+ * @description contains the basic functionalities for module NetFeez-Labs tools
4
+ * @license Apache-2.0
5
+ */
6
+ export class ConsoleUI {
7
+ static formatString = '%prefix%((?:(?:[BC])[0-7])|[NSPIR])';
8
+ static rgbString = '%prefix%(?:([BC])\\((?:([0-2]?[0-9]{1,2}),([0-2]?[0-9]{1,2}),([0-2]?[0-9]{1,2}))\\))';
9
+ static formats = {
10
+ // Var - Code -- Text color
11
+ C0: '\x1B[30m', // Black
12
+ C1: '\x1B[31m', // Red
13
+ C2: '\x1B[32m', // Green
14
+ C3: '\x1B[33m', // Yellow
15
+ C4: '\x1B[34m', // Blue
16
+ C5: '\x1B[35m', // Magenta
17
+ C6: '\x1B[36m', // Cyan
18
+ C7: '\x1B[37m', // White
19
+ C: '\x1B[38;2;R;G;Bm', //(R,G,B)
20
+ // Var - Code -- Background color
21
+ B0: '\x1B[40m', // Black
22
+ B1: '\x1B[41m', // Red
23
+ B2: '\x1B[42m', // Green
24
+ B3: '\x1B[43m', // Yellow
25
+ B4: '\x1B[44m', // Blue
26
+ B5: '\x1B[45m', // Magenta
27
+ B6: '\x1B[46m', // Cyan
28
+ B7: '\x1B[47m', // White
29
+ B: '\x1B[48;2;R;G;Bm', //(R,G,B)
30
+ // Var - Code -- Text format
31
+ N: '\x1B[1m', // Bold
32
+ S: '\x1B[4m', // Underline
33
+ P: '\x1B[5m', // Blink
34
+ I: '\x1B[7m', // Invert
35
+ R: '\x1B[0m', // Reset
36
+ none: ''
37
+ };
38
+ /**
39
+ * delete text formats and colors.
40
+ * @param text the text to clean.
41
+ * @param prefix the prefix.
42
+ */
43
+ static cleanFormat(text, prefix = '&') {
44
+ const formatExp = new RegExp(this.formatString.replace('%prefix%', prefix), 'g');
45
+ const rgbExp = new RegExp(this.rgbString.replace('%prefix%', prefix), 'g');
46
+ return text.replace(formatExp, '').replace(rgbExp, '');
47
+ }
48
+ /**
49
+ * colors the text.
50
+ * @param text the text to color.
51
+ * @param prefix the prefix.
52
+ * The default prefix is `&`
53
+ * Colors and formats
54
+ * - Formats:
55
+ * - - `N`: Bold
56
+ * - - `S`: Underline
57
+ * - - `P`: Blink
58
+ * - - `I`: Invert
59
+ * - - `R`: Reset
60
+ * - `B`: Used before a color to refer to the background.
61
+ * - - Example: `&B2Hello` will change the background of the text to green.
62
+ * - `C`: Used before a color to refer to the text.
63
+ * - - Example: `&C2Hello` will change the color of the text to green.
64
+ * - Colors:
65
+ * - - `(R,G,B)`: an RGB color, replace R, G, and B with their respective values.
66
+ * - - - No spaces after the `,`
67
+ * - - - Example: `&B(0,255,0)Hello` will change the background of the text to green.
68
+ * - - - Example: `&C(0,255,0)Hello` will change the color of the text to green.
69
+ * - - `0`: Black
70
+ * - - `1`: White
71
+ * - - `2`: Green
72
+ * - - `3`: Cyan
73
+ * - - `4`: Blue
74
+ * - - `5`: Magenta
75
+ * - - `6`: Red
76
+ * - - `7`: Yellow
77
+ */
78
+ static formatText(text, prefix = '&') {
79
+ const formatExp = new RegExp(this.formatString.replace('%prefix%', prefix), 'g');
80
+ const rgbExp = new RegExp(this.rgbString.replace('%prefix%', prefix), 'g');
81
+ return `${text
82
+ .replace(formatExp, (result, format) => this.formats[format])
83
+ .replace(rgbExp, (result, type, R, G, B) => (this.formats[type]
84
+ .replace('R', R)
85
+ .replace('G', G)
86
+ .replace('B', B)))}${this.formats.R}`;
87
+ }
88
+ /**
89
+ * sends a message to the user through the console
90
+ * @param message the message(s) you want to send to the user
91
+ * @param newLine whether there is a line break or not
92
+ */
93
+ static send(message, newLine) {
94
+ if (typeof message === 'string') {
95
+ process.stdout.write(`${message}${newLine ? '\n' : ''}`, 'utf8');
96
+ }
97
+ else if (Array.isArray(message)) {
98
+ message.forEach((value) => {
99
+ this.send(value);
100
+ });
101
+ if (newLine)
102
+ process.stdout.write(`\n`, 'utf8');
103
+ }
104
+ else {
105
+ process.stdout.write('[consoleUI] You tried to send a failed type \n');
106
+ }
107
+ }
108
+ }
109
+ export default ConsoleUI;
110
+ //# sourceMappingURL=ConsoleUI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConsoleUI.js","sourceRoot":"","sources":["../src/ConsoleUI.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,OAAO,SAAS;IACV,MAAM,CAAC,YAAY,GAAG,qCAAqC,CAAC;IAC5D,MAAM,CAAC,SAAS,GAAG,sFAAsF,CAAC;IAC1G,MAAM,CAAC,OAAO,GAAG;QACrB,yCAAyC;QACzC,EAAE,EAAI,UAAU,EAAU,QAAQ;QAClC,EAAE,EAAI,UAAU,EAAU,MAAM;QAChC,EAAE,EAAI,UAAU,EAAU,QAAQ;QAClC,EAAE,EAAI,UAAU,EAAU,SAAS;QACnC,EAAE,EAAI,UAAU,EAAU,OAAO;QACjC,EAAE,EAAI,UAAU,EAAU,UAAU;QACpC,EAAE,EAAI,UAAU,EAAU,OAAO;QACjC,EAAE,EAAI,UAAU,EAAU,QAAQ;QAClC,CAAC,EAAK,kBAAkB,EAAE,SAAS;QACnC,+CAA+C;QAC/C,EAAE,EAAI,UAAU,EAAU,QAAQ;QAClC,EAAE,EAAI,UAAU,EAAU,MAAM;QAChC,EAAE,EAAI,UAAU,EAAU,QAAQ;QAClC,EAAE,EAAI,UAAU,EAAU,SAAS;QACnC,EAAE,EAAI,UAAU,EAAU,OAAO;QACjC,EAAE,EAAI,UAAU,EAAU,UAAU;QACpC,EAAE,EAAI,UAAU,EAAU,OAAO;QACjC,EAAE,EAAI,UAAU,EAAU,QAAQ;QAClC,CAAC,EAAK,kBAAkB,EAAE,SAAS;QACnC,0CAA0C;QAC1C,CAAC,EAAK,SAAS,EAAW,OAAO;QACjC,CAAC,EAAK,SAAS,EAAW,YAAY;QACtC,CAAC,EAAK,SAAS,EAAW,QAAQ;QAClC,CAAC,EAAK,SAAS,EAAW,SAAS;QACnC,C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AAC;aACf,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CACnB,CACL,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC;IACxB,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,IAAI,CAAC,OAA0B,EAAE,OAAiB;QAC5D,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;YAC9B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC;QACrE,CAAC;aAAM,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;YAChC,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;gBACtB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACrB,CAAC,CAAC,CAAC;YACH,IAAI,OAAO;gBAAE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACpD,CAAC;aAAM,CAAC;YACJ,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,gDAAgD,CAAC,CAAC;QAC3E,CAAC;IACL,CAAC;;AAWL,eAAe,SAAS,CAAC"}
@@ -0,0 +1,154 @@
1
+ /**
2
+ * @author NetFeez <codefeez.dev@gmail.com>
3
+ * @description Add the debug system to the Vortez.
4
+ * @license Apache-2.0
5
+ */
6
+ export declare class Debug {
7
+ private static debugs;
8
+ static showAll: boolean;
9
+ private id;
10
+ show: boolean;
11
+ private _save;
12
+ private filePath;
13
+ private rootPath;
14
+ private startDate;
15
+ private stream;
16
+ /**
17
+ * Create or retrieve a debug instance.
18
+ * @param id - Debug instance ID
19
+ * @param options - Debug instance options
20
+ * @returns The debug instance
21
+ */
22
+ static getInstance(id?: string, options?: Debug.options): Debug;
23
+ /**
24
+ * Create a new debug instance.
25
+ * @param id - Debug instance ID
26
+ * @param options - Debug instance options
27
+ */
28
+ private constructor();
29
+ get save(): boolean;
30
+ set save(value: boolean);
31
+ /**
32
+ * Get the stream to the debug file.
33
+ * @returns The stream to the debug file
34
+ */
35
+ private getStream;
36
+ /**
37
+ * Log data to the console and/or the debug file.
38
+ * @param data - Data to log
39
+ */
40
+ log(...data: any[]): void;
41
+ /**
42
+ * Log data to the console and/or the debug file.
43
+ * @param data - Data to log
44
+ */
45
+ info(...data: any[]): void;
46
+ /**
47
+ * Log data to the console and/or the debug file.
48
+ * @param data - Data to log
49
+ */
50
+ warn(...data: any[]): void;
51
+ /**
52
+ * Log data to the console and/or the debug file.
53
+ * @param data - Data to log
54
+ */
55
+ error(...data: any[]): void;
56
+ /**
57
+ * Log data to the console and/or the debug file with a specific prefix.
58
+ * @param data - Data to log
59
+ */
60
+ customLog(prefix: string, ...data: any[]): void;
61
+ /**
62
+ * Save data to the debug file.
63
+ * @param timestamp - Timestamp of the log
64
+ * @param prefix - Prefix of the log
65
+ * @param data - Data to log
66
+ */
67
+ private showLog;
68
+ /**
69
+ * Save data to the debug file.
70
+ * @param timestamp - Timestamp of the log
71
+ * @param prefix - Prefix of the log
72
+ * @param data - Data to log
73
+ */
74
+ private saveLog;
75
+ /**
76
+ * Log data using the default debug instance.
77
+ * @param Data - Data to log
78
+ */
79
+ static log(...Data: any): void;
80
+ /**
81
+ * Log data using the default debug instance.
82
+ * @param Data - Data to log
83
+ */
84
+ static info(...Data: any): void;
85
+ /**
86
+ * Log data using the default debug instance.
87
+ * @param Data - Data to log
88
+ */
89
+ static warn(...Data: any): void;
90
+ /**
91
+ * Log data using the default debug instance.
92
+ * @param Data - Data to log
93
+ */
94
+ static error(...Data: any): void;
95
+ /**
96
+ * Clean a path.
97
+ * @param path - Path to clean
98
+ * @returns Cleaned path
99
+ */
100
+ private static cleanPath;
101
+ /**
102
+ * Get the path to the debug file.
103
+ * @param id - Debug instance ID
104
+ * @param folderPath - Path to the debug folder
105
+ * @param date - Date of the debug instance
106
+ * @returns The path to the debug file
107
+ */
108
+ private static getFilePath;
109
+ /**
110
+ * Generate a stream to the debug file.
111
+ * @param id - Debug instance ID
112
+ * @param filePath - Path to the debug file
113
+ * @param date - Date of the debug instance
114
+ * @returns The stream to the debug file
115
+ */
116
+ private static generateStream;
117
+ /**
118
+ * Decorate a timestamp with color codes.
119
+ * @param timestamp - timestamp to decorate
120
+ * @returns Decorated timestamp
121
+ */
122
+ private static decorateTimestamp;
123
+ /**
124
+ * Generate a datetime timestamp.
125
+ * @returns Formatted datetime timestamp
126
+ */
127
+ private static getTimestamp;
128
+ /**
129
+ * Get the current date and time in formatted parts.
130
+ * @returns Object containing date parts and full formats
131
+ */
132
+ private static getDate;
133
+ }
134
+ export declare namespace Debug {
135
+ type debugMap = Map<string, Debug>;
136
+ interface options {
137
+ path?: string;
138
+ show?: boolean;
139
+ save?: boolean;
140
+ }
141
+ interface Date {
142
+ day: string;
143
+ month: string;
144
+ year: string;
145
+ hour: string;
146
+ minute: string;
147
+ second: string;
148
+ millisecond: string;
149
+ DateFormat: string;
150
+ TimeFormat: string;
151
+ now: globalThis.Date;
152
+ }
153
+ }
154
+ export default Debug;
package/build/Debug.js ADDED
@@ -0,0 +1,256 @@
1
+ /**
2
+ * @author NetFeez <codefeez.dev@gmail.com>
3
+ * @description Add the debug system to the Vortez.
4
+ * @license Apache-2.0
5
+ */
6
+ import fs from 'fs';
7
+ import ConsoleUI from './ConsoleUI.js';
8
+ import Utilities from './Utilities/Utilities.js';
9
+ export class Debug {
10
+ static debugs = new Map();
11
+ static showAll = false;
12
+ id;
13
+ show;
14
+ _save;
15
+ filePath;
16
+ rootPath;
17
+ startDate;
18
+ stream;
19
+ /**
20
+ * Create or retrieve a debug instance.
21
+ * @param id - Debug instance ID
22
+ * @param options - Debug instance options
23
+ * @returns The debug instance
24
+ */
25
+ static getInstance(id = '_debug', options = {}) {
26
+ const debug = Debug.debugs.get(id);
27
+ if (!debug)
28
+ return new Debug(id, options);
29
+ debug.save = options.save ?? debug.save;
30
+ debug.show = options.show ?? debug.show;
31
+ return debug;
32
+ }
33
+ /**
34
+ * Create a new debug instance.
35
+ * @param id - Debug instance ID
36
+ * @param options - Debug instance options
37
+ */
38
+ constructor(id = '_default', options = {}) {
39
+ const { path = '.debug', show = true, save = true } = options;
40
+ const now = Debug.getDate();
41
+ const rootPath = Debug.cleanPath(path);
42
+ const filePath = Debug.getFilePath(id, rootPath, now);
43
+ this.id = id;
44
+ this.show = show;
45
+ this._save = save;
46
+ this.rootPath = rootPath;
47
+ this.filePath = filePath;
48
+ this.startDate = now;
49
+ this.stream = null;
50
+ Debug.debugs.set(id, this);
51
+ }
52
+ get save() { return this._save; }
53
+ set save(value) {
54
+ this._save = value;
55
+ if (value)
56
+ this.stream = this.getStream();
57
+ else if (this.stream) {
58
+ this.stream.destroy();
59
+ this.stream = null;
60
+ }
61
+ }
62
+ /**
63
+ * Get the stream to the debug file.
64
+ * @returns The stream to the debug file
65
+ */
66
+ getStream() {
67
+ if (!this.stream) {
68
+ const id = this.id;
69
+ const date = this.startDate;
70
+ const stream = Debug.generateStream(this.filePath);
71
+ stream.write([
72
+ '/* +----------------------------+* /',
73
+ '/* | NetFeez-Labs/Debug by NetFeez |* /',
74
+ '/* | Use NetFeez-Labs ReadDebug |* /',
75
+ '/* +----------------------------+* /',
76
+ `/* the name of the DebugFile is the DateTime of initialize Debug with ID ${id} */`,
77
+ `/* the initialize stream DateTime is ${date.DateFormat} << ${date.TimeFormat} */`,
78
+ '', ''
79
+ ].join('\n'));
80
+ this.stream = stream;
81
+ const file = Utilities.Path.relative(this.filePath);
82
+ this.log(`&C2&PStream created to the debug file: &C6&S${file}`);
83
+ }
84
+ return this.stream;
85
+ }
86
+ /**
87
+ * Log data to the console and/or the debug file.
88
+ * @param data - Data to log
89
+ */
90
+ log(...data) { this.customLog('&C2[LOG]', ...data); }
91
+ /**
92
+ * Log data to the console and/or the debug file.
93
+ * @param data - Data to log
94
+ */
95
+ info(...data) { this.customLog('&C6[INF]', ...data); }
96
+ /**
97
+ * Log data to the console and/or the debug file.
98
+ * @param data - Data to log
99
+ */
100
+ warn(...data) { this.customLog('&C3[WRN]', ...data); }
101
+ /**
102
+ * Log data to the console and/or the debug file.
103
+ * @param data - Data to log
104
+ */
105
+ error(...data) { this.customLog('&C1[ERR]', ...data); }
106
+ /**
107
+ * Log data to the console and/or the debug file with a specific prefix.
108
+ * @param data - Data to log
109
+ */
110
+ customLog(prefix, ...data) {
111
+ const timestamp = Debug.getTimestamp();
112
+ if (this._save)
113
+ this.saveLog(timestamp, prefix, ...data);
114
+ if (this.show || Debug.showAll)
115
+ this.showLog(timestamp, prefix, ...data);
116
+ }
117
+ /**
118
+ * Save data to the debug file.
119
+ * @param timestamp - Timestamp of the log
120
+ * @param prefix - Prefix of the log
121
+ * @param data - Data to log
122
+ */
123
+ showLog(timestamp, prefix, ...data) {
124
+ timestamp = Debug.decorateTimestamp(timestamp);
125
+ timestamp = ConsoleUI.formatText(timestamp);
126
+ prefix = ConsoleUI.formatText(prefix);
127
+ const toShow = data.map((Datum) => typeof Datum === 'string' ?
128
+ ConsoleUI.formatText(Datum) : Datum);
129
+ console.log(`${timestamp} ${prefix} ->`, ...toShow);
130
+ }
131
+ /**
132
+ * Save data to the debug file.
133
+ * @param timestamp - Timestamp of the log
134
+ * @param prefix - Prefix of the log
135
+ * @param data - Data to log
136
+ */
137
+ saveLog(timestamp, prefix, ...data) {
138
+ timestamp = ConsoleUI.cleanFormat(timestamp);
139
+ prefix = ConsoleUI.cleanFormat(prefix);
140
+ const stream = this.getStream();
141
+ const toSave = data.map((Datum) => typeof Datum === 'string' ?
142
+ ConsoleUI.cleanFormat(Datum) : Datum);
143
+ stream.write(`${timestamp} ${prefix} -> ${JSON.stringify(toSave)}\n`);
144
+ }
145
+ /**
146
+ * Log data using the default debug instance.
147
+ * @param Data - Data to log
148
+ */
149
+ static log(...Data) {
150
+ const debug = this.getInstance();
151
+ debug.log(...Data);
152
+ }
153
+ /**
154
+ * Log data using the default debug instance.
155
+ * @param Data - Data to log
156
+ */
157
+ static info(...Data) {
158
+ const debug = this.getInstance();
159
+ debug.info(...Data);
160
+ }
161
+ /**
162
+ * Log data using the default debug instance.
163
+ * @param Data - Data to log
164
+ */
165
+ static warn(...Data) {
166
+ const debug = this.getInstance();
167
+ debug.warn(...Data);
168
+ }
169
+ /**
170
+ * Log data using the default debug instance.
171
+ * @param Data - Data to log
172
+ */
173
+ static error(...Data) {
174
+ const debug = this.getInstance();
175
+ debug.error(...Data);
176
+ }
177
+ /**
178
+ * Clean a path.
179
+ * @param path - Path to clean
180
+ * @returns Cleaned path
181
+ */
182
+ static cleanPath(path) {
183
+ path = Utilities.Path.normalize(path);
184
+ path = path.startsWith('/') ? path.slice(1) : path;
185
+ path = path.endsWith('/') ? path.slice(0, -1) : path;
186
+ return path;
187
+ }
188
+ /**
189
+ * Get the path to the debug file.
190
+ * @param id - Debug instance ID
191
+ * @param folderPath - Path to the debug folder
192
+ * @param date - Date of the debug instance
193
+ * @returns The path to the debug file
194
+ */
195
+ static getFilePath(id, folderPath, date) {
196
+ const file = `[${id}] - ${date.hour}.${date.minute}.${date.second}.${date.millisecond}.vlog`;
197
+ const folder = `${folderPath}/[${date.day}.${date.month}.${date.year}]`;
198
+ const path = `${folder}/${file}`;
199
+ return path;
200
+ }
201
+ /**
202
+ * Generate a stream to the debug file.
203
+ * @param id - Debug instance ID
204
+ * @param filePath - Path to the debug file
205
+ * @param date - Date of the debug instance
206
+ * @returns The stream to the debug file
207
+ */
208
+ static generateStream(filePath) {
209
+ const folder = filePath.slice(0, filePath.lastIndexOf('/'));
210
+ if (!fs.existsSync(folder))
211
+ fs.mkdirSync(folder, { recursive: true });
212
+ const stream = fs.createWriteStream(filePath, 'utf8');
213
+ return stream;
214
+ }
215
+ /**
216
+ * Decorate a timestamp with color codes.
217
+ * @param timestamp - timestamp to decorate
218
+ * @returns Decorated timestamp
219
+ */
220
+ static decorateTimestamp(timestamp) {
221
+ return ConsoleUI.formatText(`&C(255,255,255)${timestamp}&R`);
222
+ }
223
+ /**
224
+ * Generate a datetime timestamp.
225
+ * @returns Formatted datetime timestamp
226
+ */
227
+ static getTimestamp() {
228
+ const now = Debug.getDate();
229
+ const prefix = `[${now.hour}:${now.minute}:${now.second}:${now.millisecond}]`;
230
+ return prefix;
231
+ }
232
+ /**
233
+ * Get the current date and time in formatted parts.
234
+ * @returns Object containing date parts and full formats
235
+ */
236
+ static getDate() {
237
+ const now = new Date();
238
+ const day = now.getDate().toString().padStart(2, '0');
239
+ const month = (now.getMonth() + 1).toString().padStart(2, '0');
240
+ const year = now.getFullYear().toString().padStart(4, '0');
241
+ const hour = now.getHours().toString().padStart(2, '0');
242
+ const minute = now.getMinutes().toString().padStart(2, '0');
243
+ const second = now.getSeconds().toString().padStart(2, '0');
244
+ const millisecond = now.getMilliseconds().toString().padStart(3, '0');
245
+ const DateFormat = `${day}-${month}-${year}`;
246
+ const TimeFormat = `${hour}.${minute}.${second}.${millisecond}`;
247
+ const result = {
248
+ day, month, year,
249
+ hour, minute, second, millisecond,
250
+ DateFormat, TimeFormat, now
251
+ };
252
+ return result;
253
+ }
254
+ }
255
+ export default Debug;
256
+ //# sourceMappingURL=Debug.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Debug.js","sourceRoot":"","sources":["../src/Debug.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAmB,MAAM,IAAI,CAAC;AACrC,OAAO,SAAS,MAAM,gBAAgB,CAAC;AACvC,OAAO,SAAS,MAAM,0BAA0B,CAAC;AAEjD,MAAM,OAAO,KAAK;IACT,MAAM,CAAC,MAAM,GAAmB,IAAI,GAAG,EAAE,CAAC;IACxC,MAAM,CAAC,OAAO,GAAY,KAAK,CAAC;IAC/B,EAAE,CAAS;IACZ,IAAI,CAAU;IACb,KAAK,CAAU;IACf,QAAQ,CAAS;IACjB,QAAQ,CAAS;IACpB,SAAS,CAAa;IACnB,MAAM,CAAqB;IACnC;;;;;OAKG;IACI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