@ix-xs/node-comfort 1.0.4 → 1.0.5

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 (41) hide show
  1. package/index.js +12 -14
  2. package/package.json +17 -17
  3. package/src/checker.js +76 -0
  4. package/src/cli.js +86 -0
  5. package/{core/FS.js → src/fs.js} +121 -229
  6. package/src/localStorage.js +242 -0
  7. package/{core/Logger.js → src/logger.js} +23 -97
  8. package/src/utils.js +225 -0
  9. package/tsconfig.json +1 -1
  10. package/types/index.d.ts +71 -53
  11. package/types/src/checker.d.ts +49 -0
  12. package/types/src/checker.d.ts.map +1 -0
  13. package/types/src/cli.d.ts +26 -0
  14. package/types/src/cli.d.ts.map +1 -0
  15. package/types/src/fs.d.ts +210 -0
  16. package/types/src/fs.d.ts.map +1 -0
  17. package/types/src/localStorage.d.ts +97 -0
  18. package/types/src/localStorage.d.ts.map +1 -0
  19. package/types/src/logger.d.ts +132 -0
  20. package/types/src/logger.d.ts.map +1 -0
  21. package/types/src/utils.d.ts +92 -0
  22. package/types/src/utils.d.ts.map +1 -0
  23. package/core/CLI.js +0 -95
  24. package/core/Checker.js +0 -127
  25. package/core/Stepper.js +0 -115
  26. package/core/Storage.js +0 -348
  27. package/core/Utils.js +0 -206
  28. package/types/core/CLI.d.ts +0 -25
  29. package/types/core/CLI.d.ts.map +0 -1
  30. package/types/core/Checker.d.ts +0 -73
  31. package/types/core/Checker.d.ts.map +0 -1
  32. package/types/core/FS.d.ts +0 -220
  33. package/types/core/FS.d.ts.map +0 -1
  34. package/types/core/Logger.d.ts +0 -253
  35. package/types/core/Logger.d.ts.map +0 -1
  36. package/types/core/Stepper.d.ts +0 -49
  37. package/types/core/Stepper.d.ts.map +0 -1
  38. package/types/core/Storage.d.ts +0 -111
  39. package/types/core/Storage.d.ts.map +0 -1
  40. package/types/core/Utils.d.ts +0 -55
  41. package/types/core/Utils.d.ts.map +0 -1
@@ -1,220 +0,0 @@
1
- /**
2
- * Safely read an environment variable.
3
- *
4
- * Loads variables from the default `.env` file (if present) and then
5
- * returns the value for the given key. When `options.envFile` is provided,
6
- * the function expects `process.env[options.envFile]` to be an object
7
- * containing namespaced environment variables (e.g. per environment).
8
- *
9
- * @param {string} env - Environment variable name (e.g. "PORT").
10
- * @param {object} [options] - Optional configuration object.
11
- * @param {string} [options.envFile] - Name of a namespaced env container under `process.env`.
12
- * @returns {string|undefined} The environment variable value, or `undefined` if not found.
13
- */
14
- export function getEnv(env: string, options?: {
15
- envFile?: string;
16
- }): string | undefined;
17
- /**
18
- * Resolves path relative to caller file or current directory.
19
- * Supports `./`, `../`, absolute paths, and searches for existing paths.
20
- * @param {string} [path=process.cwd()] - Path to resolve.
21
- * @returns {string} Resolved absolute path.
22
- * @example
23
- * nodeComfort.createPath("./data/users"); // Resolves from caller file
24
- */
25
- export function createPath(path?: string): string;
26
- /**
27
- * Returns all folders in path (recursive option).
28
- * @param {string} [path=process.cwd()] - Starting directory.
29
- * @param {boolean} [recursive=true] - Include subfolders.
30
- * @returns {string[]|undefined} Array of folder paths.
31
- */
32
- export function getFoldersIn(path?: string, recursive?: boolean): string[] | undefined;
33
- /**
34
- * Resolves and returns existing folder path.
35
- * @param {string} [path=process.cwd()] - Folder path.
36
- * @returns {string|undefined} Absolute folder path.
37
- */
38
- export function getFolder(path?: string): string | undefined;
39
- /**
40
- * Returns all files in path (recursive option).
41
- * @param {string} [path=process.cwd()] - Starting directory.
42
- * @param {boolean} [recursive=true] - Include subdirectories.
43
- * @returns {string[]|undefined} Array of file paths.
44
- */
45
- export function getFilesIn(path?: string, recursive?: boolean): string[] | undefined;
46
- /**
47
- * Resolves and returns existing file path.
48
- * @param {string} path - File path.
49
- * @returns {string|undefined} Absolute file path.
50
- */
51
- export function getFile(path: string): string | undefined;
52
- /**
53
- * Creates folder (recursive) with force overwrite option.
54
- * @param {string} path - Folder path to create.
55
- * @param {boolean} [force=false] - Overwrite if exists.
56
- * @returns {boolean|undefined} Success status.
57
- */
58
- export function createFolder(path: string, force?: boolean): boolean | undefined;
59
- /**
60
- * Creates file with auto-directory creation and content serialization.
61
- * Supports string, object (→ JSON), null/undefined (→ empty).
62
- * @param {string} path - File path.
63
- * @param {boolean} [force=false] - Overwrite if exists.
64
- * @param {string|object|null|undefined} [data] - File content.
65
- * @returns {boolean|undefined} Success status.
66
- * @example
67
- * nodeComfort.createFile("config.json", false, { apiKey: "secret" });
68
- */
69
- export function createFile(path: string, force?: boolean, data?: string | object | null | undefined): boolean | undefined;
70
- /**
71
- * Deletes multiple folders matching filter.
72
- * @param {string} [path=process.cwd()] - Starting directory.
73
- * @param {(folder: string) => boolean} [filter] - Folder filter function.
74
- * @returns {number|undefined} Count of deleted folders.
75
- */
76
- export function deleteFoldersIn(path?: string, filter?: (folder: string) => boolean): number | undefined;
77
- /**
78
- * Deletes folder and all contents recursively.
79
- * @param {string} path - Folder path.
80
- * @returns {boolean|undefined} Success status.
81
- */
82
- export function deleteFolder(path: string): boolean | undefined;
83
- /**
84
- * Deletes multiple files matching filter.
85
- * @param {string} [path=process.cwd()] - Starting directory.
86
- * @param {boolean} [recursive=false] - Search subdirectories.
87
- * @param {(file: string) => boolean} [filter] - File filter function.
88
- * @returns {number|undefined} Count of deleted files.
89
- */
90
- export function deleteFilesIn(path?: string, recursive?: boolean, filter?: (file: string) => boolean): number | undefined;
91
- /**
92
- * Deletes single file.
93
- * @param {string} path - File path.
94
- * @returns {boolean|undefined} Success status.
95
- */
96
- export function deleteFile(path: string): boolean | undefined;
97
- /**
98
- * Copies multiple folders with optional files and recursive support.
99
- * @param {Object} options - Copy options.
100
- * @param {string} options.dest - Destination base path.
101
- * @param {string} [options.path] - Source path.
102
- * @param {boolean} [options.recursive=true] - Copy subfolders.
103
- * @param {boolean} [options.withFiles=false] - Include files.
104
- * @param {boolean} [options.force=false] - Overwrite existing.
105
- * @param {(folder: string) => boolean} [options.filter] - Folder filter.
106
- * @returns {number|undefined} Count of copied folders.
107
- */
108
- export function copyFoldersIn(options: {
109
- dest: string;
110
- path?: string;
111
- recursive?: boolean;
112
- withFiles?: boolean;
113
- force?: boolean;
114
- filter?: (folder: string) => boolean;
115
- }): number | undefined;
116
- /**
117
- * Copies single folder with optional contents.
118
- * @param {Object} options - Copy options.
119
- * @param {string} options.dest - Destination path.
120
- * @param {string} [options.path] - Source path.
121
- * @param {boolean} [options.recursive=false] - Copy subfolders.
122
- * @param {boolean} [options.withFiles=false] - Include files.
123
- * @param {boolean} [options.force=false] - Overwrite existing.
124
- * @returns {boolean|undefined} Success status.
125
- */
126
- export function copyFolder(options: {
127
- dest: string;
128
- path?: string;
129
- recursive?: boolean;
130
- withFiles?: boolean;
131
- force?: boolean;
132
- }): boolean | undefined;
133
- /**
134
- * Copies multiple files with optional recursive structure preservation.
135
- * @param {Object} options - Copy options.
136
- * @param {string} options.dest - Destination base path.
137
- * @param {string} [options.path] - Source path.
138
- * @param {boolean} [options.recursive=true] - Preserve directory structure.
139
- * @param {boolean} [options.force=false] - Overwrite existing.
140
- * @param {(file: string) => boolean} [options.filter] - File filter.
141
- * @returns {number|undefined} Count of copied files.
142
- */
143
- export function copyFilesIn(options: {
144
- dest: string;
145
- path?: string;
146
- recursive?: boolean;
147
- force?: boolean;
148
- filter?: (file: string) => boolean;
149
- }): number | undefined;
150
- /**
151
- * Copies single file to destination (auto-creates parent folders).
152
- * @param {Object} options - Copy options.
153
- * @param {string} options.path - Source file path.
154
- * @param {string} options.dest - Destination path or folder.
155
- * @param {boolean} [options.force=false] - Overwrite existing.
156
- * @returns {boolean|undefined} Success status.
157
- */
158
- export function copyFile(options: {
159
- path: string;
160
- dest: string;
161
- force?: boolean;
162
- }): boolean | undefined;
163
- /**
164
- * Moves multiple folders (copy + delete source).
165
- * @param {Object} options - Move options (same as copyFoldersIn).
166
- * @returns {number|undefined} Count of moved folders.
167
- */
168
- export function moveFoldersIn(options: any): number | undefined;
169
- /**
170
- * Moves single folder (copy + delete source).
171
- * @param {Object} options - Move options (same as copyFolder).
172
- * @returns {boolean|undefined} Success status.
173
- */
174
- export function moveFolder(options: any): boolean | undefined;
175
- /**
176
- * Moves multiple files (copy + delete source).
177
- * @param {Object} options - Move options (same as copyFilesIn).
178
- * @returns {number|undefined} Count of moved files.
179
- */
180
- export function moveFilesIn(options: any): number | undefined;
181
- /**
182
- * Moves single file (copy + delete source).
183
- * @param {Object} options - Move options (same as copyFile).
184
- * @returns {boolean|undefined} Success status.
185
- */
186
- export function moveFile(options: any): boolean | undefined;
187
- /**
188
- * Reads file content synchronously.
189
- * @param {string} path - File path.
190
- * @returns {string|undefined} File content or undefined.
191
- */
192
- export function readFile(path: string): string | undefined;
193
- /**
194
- * Creates file system watcher with event filtering and pause/resume.
195
- * @param {Object} [options] - Watcher options.
196
- * @param {string} [options.path=process.cwd()] - Watch path.
197
- * @param {boolean} [options.recursive=false] - Watch subdirectories.
198
- * @param {(event: string, file: string) => boolean} [options.filter] - Event filter.
199
- * @example
200
- * const watcher = nodeComfort.watch({ path: "./src", recursive: true });
201
- * watcher.on("change", (file) => console.log("Changed:", file));
202
- * watcher.on("rename", (file) => console.log("Renamed:", file));
203
- * watcher.on("all", (event, file) => console.log(event, file));
204
- */
205
- export function watch(options?: {
206
- path?: string;
207
- recursive?: boolean;
208
- filter?: (event: string, file: string) => boolean;
209
- }): {
210
- /**
211
- * Adds event listener.
212
- * @param {"change"|"rename"|"all"} event - Event type.
213
- * @param {function} callback - Callback function.
214
- */
215
- on(event: "change" | "rename" | "all", callback: Function): void;
216
- stop(): void;
217
- pause(): void;
218
- resume(): void;
219
- };
220
- //# sourceMappingURL=FS.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FS.d.ts","sourceRoot":"","sources":["../../core/FS.js"],"names":[],"mappings":"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"}
@@ -1,253 +0,0 @@
1
- /**
2
- * Logs content with colors, timestamp, and group indentation.
3
- * Supports strings, objects (pretty JSON), and chaining.
4
- *
5
- * @param {any} content - Content to log (string, object, or primitive).
6
- * @example
7
- * nodeComfort.log("<%greenBright ✓ Done%>");
8
- * nodeComfort.log({ users: 42, active: true });
9
- * nodeComfort.group("Files").log("Processing...").groupEnd();
10
- */
11
- export function log(content: any): {
12
- log(content: any): /*elided*/ any;
13
- /**
14
- * Formats content with colors, timestamp, and group indentation (no console output).
15
- *
16
- * @param {any} content - Content to format.
17
- * @returns {string} Formatted string.
18
- * @example
19
- * const msg = nodeComfort.logify("<%redBright ERROR%> Invalid input");
20
- * console.log(msg);
21
- */
22
- logify(content: any): string;
23
- /**
24
- * Starts a new log group with ▼ indicator and increased indentation.
25
- *
26
- * @param {string} label - Group label (supports colors).
27
- * @example
28
- * nodeComfort.group("<%yellow Processing%>").log("Step 1").groupEnd();
29
- */
30
- group(label: string): /*elided*/ any;
31
- /**
32
- * Ends current group and reduces indentation.
33
- *
34
- * @example
35
- * nodeComfort.group("Work").groupEnd();
36
- */
37
- groupEnd(): /*elided*/ any;
38
- /**
39
- * Configures logger options (delimiters and timestamp).
40
- *
41
- * @param {object} [options] - Logger options.
42
- * @param {object} [options.delimiters] - Template delimiters.
43
- * @param {string} [options.delimiters.start="<%="] - Start delimiter.
44
- * @param {string} [options.delimiters.end="%>"] - End delimiter.
45
- * @param {boolean} [options.timestamp=true] - Show timestamps.
46
- * @example
47
- * nodeComfort.setLogger({
48
- * delimiters: { start: "{{", end: "}}" },
49
- * timestamp: false
50
- * }).log("{{ bgGreen new delimiters }}");
51
- */
52
- setLogger(options?: {
53
- delimiters?: {
54
- start?: string;
55
- end?: string;
56
- };
57
- timestamp?: boolean;
58
- }): /*elided*/ any;
59
- };
60
- /**
61
- * Formats content with colors, timestamp, and group indentation (no console output).
62
- *
63
- * @param {any} content - Content to format.
64
- * @returns {string} Formatted string.
65
- * @example
66
- * const msg = nodeComfort.logify("<%redBright ERROR%> Invalid input");
67
- * console.log(msg);
68
- */
69
- export function logify(content: any): string;
70
- /**
71
- * Starts a new log group with ▼ indicator and increased indentation.
72
- *
73
- * @param {string} label - Group label (supports colors).
74
- * @example
75
- * nodeComfort.group("<%yellow Processing%>").log("Step 1").groupEnd();
76
- */
77
- export function group(label: string): {
78
- /**
79
- * Logs content with colors, timestamp, and group indentation.
80
- * Supports strings, objects (pretty JSON), and chaining.
81
- *
82
- * @param {any} content - Content to log (string, object, or primitive).
83
- * @example
84
- * nodeComfort.log("<%greenBright ✓ Done%>");
85
- * nodeComfort.log({ users: 42, active: true });
86
- * nodeComfort.group("Files").log("Processing...").groupEnd();
87
- */
88
- log(content: any): /*elided*/ any;
89
- /**
90
- * Formats content with colors, timestamp, and group indentation (no console output).
91
- *
92
- * @param {any} content - Content to format.
93
- * @returns {string} Formatted string.
94
- * @example
95
- * const msg = nodeComfort.logify("<%redBright ERROR%> Invalid input");
96
- * console.log(msg);
97
- */
98
- logify(content: any): string;
99
- group(label: string): /*elided*/ any;
100
- /**
101
- * Ends current group and reduces indentation.
102
- *
103
- * @example
104
- * nodeComfort.group("Work").groupEnd();
105
- */
106
- groupEnd(): /*elided*/ any;
107
- /**
108
- * Configures logger options (delimiters and timestamp).
109
- *
110
- * @param {object} [options] - Logger options.
111
- * @param {object} [options.delimiters] - Template delimiters.
112
- * @param {string} [options.delimiters.start="<%="] - Start delimiter.
113
- * @param {string} [options.delimiters.end="%>"] - End delimiter.
114
- * @param {boolean} [options.timestamp=true] - Show timestamps.
115
- * @example
116
- * nodeComfort.setLogger({
117
- * delimiters: { start: "{{", end: "}}" },
118
- * timestamp: false
119
- * }).log("{{ bgGreen new delimiters }}");
120
- */
121
- setLogger(options?: {
122
- delimiters?: {
123
- start?: string;
124
- end?: string;
125
- };
126
- timestamp?: boolean;
127
- }): /*elided*/ any;
128
- };
129
- /**
130
- * Ends current group and reduces indentation.
131
- *
132
- * @example
133
- * nodeComfort.group("Work").groupEnd();
134
- */
135
- export function groupEnd(): {
136
- /**
137
- * Logs content with colors, timestamp, and group indentation.
138
- * Supports strings, objects (pretty JSON), and chaining.
139
- *
140
- * @param {any} content - Content to log (string, object, or primitive).
141
- * @example
142
- * nodeComfort.log("<%greenBright ✓ Done%>");
143
- * nodeComfort.log({ users: 42, active: true });
144
- * nodeComfort.group("Files").log("Processing...").groupEnd();
145
- */
146
- log(content: any): /*elided*/ any;
147
- /**
148
- * Formats content with colors, timestamp, and group indentation (no console output).
149
- *
150
- * @param {any} content - Content to format.
151
- * @returns {string} Formatted string.
152
- * @example
153
- * const msg = nodeComfort.logify("<%redBright ERROR%> Invalid input");
154
- * console.log(msg);
155
- */
156
- logify(content: any): string;
157
- /**
158
- * Starts a new log group with ▼ indicator and increased indentation.
159
- *
160
- * @param {string} label - Group label (supports colors).
161
- * @example
162
- * nodeComfort.group("<%yellow Processing%>").log("Step 1").groupEnd();
163
- */
164
- group(label: string): /*elided*/ any;
165
- groupEnd(): /*elided*/ any;
166
- /**
167
- * Configures logger options (delimiters and timestamp).
168
- *
169
- * @param {object} [options] - Logger options.
170
- * @param {object} [options.delimiters] - Template delimiters.
171
- * @param {string} [options.delimiters.start="<%="] - Start delimiter.
172
- * @param {string} [options.delimiters.end="%>"] - End delimiter.
173
- * @param {boolean} [options.timestamp=true] - Show timestamps.
174
- * @example
175
- * nodeComfort.setLogger({
176
- * delimiters: { start: "{{", end: "}}" },
177
- * timestamp: false
178
- * }).log("{{ bgGreen new delimiters }}");
179
- */
180
- setLogger(options?: {
181
- delimiters?: {
182
- start?: string;
183
- end?: string;
184
- };
185
- timestamp?: boolean;
186
- }): /*elided*/ any;
187
- };
188
- /**
189
- * Configures logger options (delimiters and timestamp).
190
- *
191
- * @param {object} [options] - Logger options.
192
- * @param {object} [options.delimiters] - Template delimiters.
193
- * @param {string} [options.delimiters.start="<%="] - Start delimiter.
194
- * @param {string} [options.delimiters.end="%>"] - End delimiter.
195
- * @param {boolean} [options.timestamp=true] - Show timestamps.
196
- * @example
197
- * nodeComfort.setLogger({
198
- * delimiters: { start: "{{", end: "}}" },
199
- * timestamp: false
200
- * }).log("{{ bgGreen new delimiters }}");
201
- */
202
- export function setLogger(options?: {
203
- delimiters?: {
204
- start?: string;
205
- end?: string;
206
- };
207
- timestamp?: boolean;
208
- }): {
209
- /**
210
- * Logs content with colors, timestamp, and group indentation.
211
- * Supports strings, objects (pretty JSON), and chaining.
212
- *
213
- * @param {any} content - Content to log (string, object, or primitive).
214
- * @example
215
- * nodeComfort.log("<%greenBright ✓ Done%>");
216
- * nodeComfort.log({ users: 42, active: true });
217
- * nodeComfort.group("Files").log("Processing...").groupEnd();
218
- */
219
- log(content: any): /*elided*/ any;
220
- /**
221
- * Formats content with colors, timestamp, and group indentation (no console output).
222
- *
223
- * @param {any} content - Content to format.
224
- * @returns {string} Formatted string.
225
- * @example
226
- * const msg = nodeComfort.logify("<%redBright ERROR%> Invalid input");
227
- * console.log(msg);
228
- */
229
- logify(content: any): string;
230
- /**
231
- * Starts a new log group with ▼ indicator and increased indentation.
232
- *
233
- * @param {string} label - Group label (supports colors).
234
- * @example
235
- * nodeComfort.group("<%yellow Processing%>").log("Step 1").groupEnd();
236
- */
237
- group(label: string): /*elided*/ any;
238
- /**
239
- * Ends current group and reduces indentation.
240
- *
241
- * @example
242
- * nodeComfort.group("Work").groupEnd();
243
- */
244
- groupEnd(): /*elided*/ any;
245
- setLogger(options?: {
246
- delimiters?: {
247
- start?: string;
248
- end?: string;
249
- };
250
- timestamp?: boolean;
251
- }): /*elided*/ any;
252
- };
253
- //# sourceMappingURL=Logger.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Logger.d.ts","sourceRoot":"","sources":["../../core/Logger.js"],"names":[],"mappings":"AAuME;;;;;;;;;KASE;AACF,6BANU,GAAG;iBAAH,GAAG;IAuCb;;;;;;;;SAQE;oBALQ,GAAG,GACD,MAAM;IAmBlB;;;;;;SAME;iBAHQ,MAAM;IAWhB;;;;;SAKE;;IAMF;;;;;;;;;;;;;SAaE;wBATA;QAAyB,UAAU,GACnC;YAAoC,KAAK,GAAjC,MAAM;YACsB,GAAG,GAA/B,MAAM;SACd;QAA0B,SAAS,GAA3B,OAAO;KACf;EA1DD;AAED;;;;;;;;KAQE;AACF,gCANU,GAAG,GACD,MAAM,CAiBjB;AAED;;;;;;KAME;AACF,6BAJU,MAAM;IArEhB;;;;;;;;;SASE;iBALQ,GAAG;IAuCb;;;;;;;;SAQE;oBALQ,GAAG,GACD,MAAM;iBAsBR,MAAM;IAWhB;;;;;SAKE;;IAMF;;;;;;;;;;;;;SAaE;wBATA;QAAyB,UAAU,GACnC;YAAoC,KAAK,GAAjC,MAAM;YACsB,GAAG,GAA/B,MAAM;SACd;QAA0B,SAAS,GAA3B,OAAO;KACf;EArBD;AAED;;;;;KAKE;AACF;IAtFA;;;;;;;;;SASE;iBALQ,GAAG;IAuCb;;;;;;;;SAQE;oBALQ,GAAG,GACD,MAAM;IAmBlB;;;;;;SAME;iBAHQ,MAAM;;IAsBhB;;;;;;;;;;;;;SAaE;wBATA;QAAyB,UAAU,GACnC;YAAoC,KAAK,GAAjC,MAAM;YACsB,GAAG,GAA/B,MAAM;SACd;QAA0B,SAAS,GAA3B,OAAO;KACf;EAVD;AAED;;;;;;;;;;;;;KAaE;AACF,oCAVE;IAAyB,UAAU,GACnC;QAAoC,KAAK,GAAjC,MAAM;QACsB,GAAG,GAA/B,MAAM;KACd;IAA0B,SAAS,GAA3B,OAAO;CACf;IAnGF;;;;;;;;;SASE;iBALQ,GAAG;IAuCb;;;;;;;;SAQE;oBALQ,GAAG,GACD,MAAM;IAmBlB;;;;;;SAME;iBAHQ,MAAM;IAWhB;;;;;SAKE;;wBAUA;QAAyB,UAAU,GACnC;YAAoC,KAAK,GAAjC,MAAM;YACsB,GAAG,GAA/B,MAAM;SACd;QAA0B,SAAS,GAA3B,OAAO;KACf;EAiBD"}
@@ -1,49 +0,0 @@
1
- /**
2
- * Creates a step controller for sequential function execution.
3
- *
4
- * Returns fluent API with `next()`, `back()`, `at()`, `ignore()`, `reset()` methods.
5
- *
6
- * @param {Array<() => void>} steps - Array of step functions to execute.
7
- *
8
- * @example
9
- * const steps = nodeComfort.step([
10
- * () => console.log("Install dependencies"),
11
- * () => console.log("Compile TypeScript"),
12
- * () => console.log("Run tests")
13
- * ]);
14
- *
15
- * steps.next().next(); // Execute steps 0, 1
16
- * steps.back(); // Go back to step 0
17
- * steps.at(2); // Jump to step 2
18
- */
19
- export function step(steps: Array<() => void>): {
20
- currentIndex: number;
21
- currentStep: () => void;
22
- /**
23
- * Advances to next step and executes it (if exists).
24
- */
25
- next(): /*elided*/ any;
26
- /**
27
- * Goes back to previous step and re-executes it (if exists).
28
- */
29
- back(): /*elided*/ any;
30
- /**
31
- * Jumps to specific step index and executes it.
32
- * @param {number} index - Step index (0 to steps.length-1).
33
- * @example
34
- * steps.at(2); // Jump to 3rd step
35
- */
36
- at(index: number): /*elided*/ any;
37
- /**
38
- * Advances index without executing current step.
39
- * @example
40
- * steps.next().ignore().next(); // Execute 0, skip 1, execute 2
41
- */
42
- ignore(): /*elided*/ any;
43
- /**
44
- * Resets to initial state (index: -1).
45
- */
46
- reset(): /*elided*/ any;
47
- all(): /*elided*/ any;
48
- };
49
- //# sourceMappingURL=Stepper.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Stepper.d.ts","sourceRoot":"","sources":["../../core/Stepper.js"],"names":[],"mappings":"AA6BE;;;;;;;;;;;;;;;;;KAiBE;AACF,4BAbU,KAAK,CAAC,MAAM,IAAI,CAAC;;uBAAL,IAAI;IAmBtB;;aAEA;;IAQA;;aAEA;;IAQA;;;;;aAKA;cAHQ,MAAM;IAWd;;;;aAIA;;IAOA;;aAEA;;;EAcH"}
@@ -1,111 +0,0 @@
1
- export = Storage;
2
- declare class Storage {
3
- /**
4
- * @param {string} [path = ":memomry"]
5
- */
6
- constructor(path?: string);
7
- /**
8
- * @param {string} sql
9
- * @param {array|object} [options = []]
10
- */
11
- exec(sql: string, options?: any[] | object): {
12
- changes: any;
13
- lastInsertRowid: any;
14
- };
15
- /**
16
- * @param {string} sql
17
- * @param {array|object} [options = []]
18
- */
19
- getOne(sql: string, options?: any[] | object): any;
20
- /**
21
- * @param {string} sql
22
- * @param {array|object} [options = []]
23
- */
24
- getAll(sql: string, options?: any[] | object): any;
25
- /**
26
- * @param {string} name
27
- * @param {string} sql
28
- */
29
- prepare(name: string, sql: string): any;
30
- /**
31
- * @param {string} table
32
- * @param {object} schema
33
- */
34
- createTable(table: string, schema: object): void;
35
- /**
36
- * @param {string} table
37
- * @param {object} data
38
- */
39
- insert(table: string, data: object): any;
40
- /**
41
- * @param {string} table
42
- * @param {number} id
43
- * @returns {object|null}
44
- */
45
- findById(table: string, id: number): object | null;
46
- /**
47
- * @param {string} table
48
- * @param {object} [where = {}]
49
- * @param {object} [options = {}]
50
- */
51
- findAll(table: string, where?: object, options?: object): any;
52
- /**
53
- * @param {string} table
54
- * @param {object} [where]
55
- */
56
- count(table: string, where?: object): any;
57
- /**
58
- * @param {string} table
59
- * @param {number} id
60
- * @param {object} data
61
- */
62
- update(table: string, id: number, data: object): any;
63
- /**
64
- * @param {string} table
65
- * @param {number} id
66
- */
67
- delete(table: string, id: number): any;
68
- /**
69
- * @param {string} table
70
- * @param {object} data
71
- * @param {string} [conflictColumn]
72
- */
73
- upsert(table: string, data: object, conflictColumn?: string): {
74
- changes: any;
75
- lastInsertRowid: any;
76
- };
77
- /**
78
- * @param {function} callback
79
- */
80
- transaction(callback: Function): any;
81
- /**
82
- * @param {string} migrationsDir - Répertoire contenant les migrations
83
- */
84
- runMigrations(migrationsDir: string): void;
85
- /**
86
- * @param {string} table
87
- */
88
- export(table: string): any;
89
- /**
90
- * @param {string} table
91
- * @param {array} data
92
- */
93
- import(table: string, data: any[]): number;
94
- /**
95
- * @param {string} table
96
- */
97
- truncate(table: string): void;
98
- /**
99
- * @param {string} indexName
100
- * @param {string} table
101
- * @param {string} columns
102
- */
103
- createIndex(indexName: string, table: string, columns: string): void;
104
- /**
105
- * @returns {object}
106
- */
107
- stats(): object;
108
- close(): void;
109
- #private;
110
- }
111
- //# sourceMappingURL=Storage.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Storage.d.ts","sourceRoot":"","sources":["../../core/Storage.js"],"names":[],"mappings":";AAmBiB;IAIf;;OAEG;IACH,mBAFW,MAAM,EAehB;IAED;;;OAGG;IACH,UAHW,MAAM,YACN,QAAM,MAAM;;;MAetB;IAED;;;OAGG;IACH,YAHW,MAAM,YACN,QAAM,MAAM,OAUtB;IAED;;;OAGG;IACH,YAHW,MAAM,YACN,QAAM,MAAM,OAUtB;IAED;;;OAGG;IACH,cAHW,MAAM,OACN,MAAM,OAYhB;IAED;;;OAGG;IACH,mBAHW,MAAM,UACN,MAAM,QAUhB;IAED;;;OAGG;IACH,cAHW,MAAM,QACN,MAAM,OAUhB;IAED;;;;OAIG;IACH,gBAJW,MAAM,MACN,MAAM,GACJ,MAAM,GAAC,IAAI,CAIvB;IAED;;;;OAIG;IACH,eAJW,MAAM,UACN,MAAM,YACN,MAAM,OAmBhB;IAED;;;OAGG;IACH,aAHW,MAAM,UACN,MAAM,OAehB;IAED;;;;OAIG;IACH,cAJW,MAAM,MACN,MAAM,QACN,MAAM,OAUhB;IAED;;;OAGG;IACH,cAHW,MAAM,MACN,MAAM,OAOhB;IAED;;;;OAIG;IACH,cAJW,MAAM,QACN,MAAM,mBACN,MAAM;;;MAkBhB;IAED;;OAEG;IACH,qCAaC;IAED;;OAEG;IACH,6BAFW,MAAM,QA+BhB;IAED;;OAEG;IACH,cAFW,MAAM,OAIhB;IAED;;;OAGG;IACH,cAHW,MAAM,uBAYhB;IAED;;OAEG;IACH,gBAFW,MAAM,QAIhB;IAED;;;;OAIG;IACH,uBAJW,MAAM,SACN,MAAM,WACN,MAAM,QAIhB;IAED;;OAEG;IACH,SAFa,MAAM,CAclB;IAED,cAMC;;CACF"}