@kikiutils/shared 15.0.0 → 15.0.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.
- package/dist/classes/ssh-client.d.ts +3 -3
- package/dist/classes/ssh-client.d.ts.map +1 -1
- package/dist/consola.d.ts +3 -3
- package/dist/consola.d.ts.map +1 -1
- package/dist/pino.d.ts +3 -3
- package/dist/string.js +1 -1
- package/dist/string.js.map +1 -1
- package/package.json +22 -22
- package/src/string.ts +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Nullable } from "../types/index.js";
|
|
2
2
|
import { PathLike } from "./path.js";
|
|
3
|
-
import * as node_ssh0 from "node-ssh";
|
|
3
|
+
import * as _$node_ssh0 from "node-ssh";
|
|
4
4
|
import { Config, NodeSSH, SSHExecCommandOptions, SSHGetPutDirectoryOptions, SSHPutFilesOptions } from "node-ssh";
|
|
5
5
|
import { SFTPWrapper, TransferOptions } from "ssh2";
|
|
6
6
|
|
|
@@ -22,8 +22,8 @@ declare class SshClient {
|
|
|
22
22
|
get nodeSsh(): NodeSSH;
|
|
23
23
|
connect(): Promise<boolean>;
|
|
24
24
|
disconnect(): boolean;
|
|
25
|
-
execCommand(command: string, options?: SSHExecCommandOptions): Promise<void | node_ssh0.SSHExecCommandResponse>;
|
|
26
|
-
execCommandWithIo(command: string, options?: SSHExecCommandOptions): Promise<void | node_ssh0.SSHExecCommandResponse>;
|
|
25
|
+
execCommand(command: string, options?: SSHExecCommandOptions): Promise<void | _$node_ssh0.SSHExecCommandResponse>;
|
|
26
|
+
execCommandWithIo(command: string, options?: SSHExecCommandOptions): Promise<void | _$node_ssh0.SSHExecCommandResponse>;
|
|
27
27
|
getDir: (localDirectory: PathLike, remoteDirectory: PathLike, options?: SSHGetPutDirectoryOptions) => Promise<boolean>;
|
|
28
28
|
getDirectory(localDirectory: PathLike, remoteDirectory: PathLike, options?: SSHGetPutDirectoryOptions): Promise<boolean>;
|
|
29
29
|
getFile(localFile: PathLike, remoteFile: PathLike, givenSftp?: Nullable<SFTPWrapper>, transferOptions?: Nullable<TransferOptions>): Promise<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssh-client.d.ts","names":[],"sources":["../../src/classes/ssh-client.ts"],"mappings":";;;;;;;cAkBM,qCAAA;EAAA;;;;;;;;;;cAYO,SAAA;EAAA;cAMG,IAAA,UAAc,QAAA,UAAkB,QAAA,UAAkB,IAAA,WAAmB,aAAA,GAAgB,MAAA;EAAA,IAc7F,OAAA,CAAA,GAAO,OAAA;EAIL,OAAA,CAAA,GAAO,OAAA;EAUb,UAAA,CAAA;EAUA,WAAA,CAAY,OAAA,UAAiB,OAAA,GAAU,qBAAA,GAAqB,OAAA,QAAA,
|
|
1
|
+
{"version":3,"file":"ssh-client.d.ts","names":[],"sources":["../../src/classes/ssh-client.ts"],"mappings":";;;;;;;cAkBM,qCAAA;EAAA;;;;;;;;;;cAYO,SAAA;EAAA;cAMG,IAAA,UAAc,QAAA,UAAkB,QAAA,UAAkB,IAAA,WAAmB,aAAA,GAAgB,MAAA;EAAA,IAc7F,OAAA,CAAA,GAAO,OAAA;EAIL,OAAA,CAAA,GAAO,OAAA;EAUb,UAAA,CAAA;EAUA,WAAA,CAAY,OAAA,UAAiB,OAAA,GAAU,qBAAA,GAAqB,OAAA,QAAA,WAAA,CAAA,sBAAA;EAI5D,iBAAA,CAAkB,OAAA,UAAiB,OAAA,GAAU,qBAAA,GAAqB,OAAA,QAAA,WAAA,CAAA,sBAAA;EAWlE,MAAA,GAAM,cAAA,EAE6B,QAAA,EAAQ,eAAA,EAAmB,QAAA,EAAQ,OAAA,GAAY,yBAAA,KAAyB,OAAA;EAArG,YAAA,CAAa,cAAA,EAAgB,QAAA,EAAU,eAAA,EAAiB,QAAA,EAAU,OAAA,GAAU,yBAAA,GAAyB,OAAA;EASrG,OAAA,CACF,SAAA,EAAW,QAAA,EACX,UAAA,EAAY,QAAA,EACZ,SAAA,GAAY,QAAA,CAAS,WAAA,GACrB,eAAA,GAAkB,QAAA,CAAS,eAAA,IAAgB,OAAA;EAW/C,WAAA,CAAA;EAIM,KAAA,CAAM,IAAA,EAAM,QAAA,GAAQ,OAAA;EAU1B,MAAA,GAAM,cAAA,EAE6B,QAAA,EAAQ,eAAA,EAAmB,QAAA,EAAQ,OAAA,GAAY,yBAAA,KAAyB,OAAA;EAArG,YAAA,CAAa,cAAA,EAAgB,QAAA,EAAU,eAAA,EAAiB,QAAA,EAAU,OAAA,GAAU,yBAAA,GAAyB,OAAA;EASrG,OAAA,CACF,SAAA,EAAW,QAAA,EACX,UAAA,EAAY,QAAA,EACZ,SAAA,GAAY,QAAA,CAAS,WAAA,GACrB,eAAA,GAAkB,QAAA,CAAS,eAAA,IAAgB,OAAA;EAWzC,QAAA,CAAS,KAAA;IAAS,KAAA,EAAO,QAAA;IAAU,MAAA,EAAQ,QAAA;EAAA,KAAc,OAAA,GAAU,kBAAA,GAAkB,OAAA;EAe3F,cAAA,CAAe,KAAA,eAAoB,qCAAA;AAAA"}
|
package/dist/consola.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as consola from "consola";
|
|
1
|
+
import * as _$consola from "consola";
|
|
2
2
|
|
|
3
3
|
//#region src/consola.d.ts
|
|
4
4
|
/**
|
|
@@ -22,8 +22,8 @@ import * as consola from "consola";
|
|
|
22
22
|
* logger.level = 3;
|
|
23
23
|
* ```
|
|
24
24
|
*/
|
|
25
|
-
declare const consolaLogger: consola.ConsolaInstance;
|
|
26
|
-
declare const logger: consola.ConsolaInstance;
|
|
25
|
+
declare const consolaLogger: _$consola.ConsolaInstance;
|
|
26
|
+
declare const logger: _$consola.ConsolaInstance;
|
|
27
27
|
//#endregion
|
|
28
28
|
export { consolaLogger, logger };
|
|
29
29
|
//# sourceMappingURL=consola.d.ts.map
|
package/dist/consola.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consola.d.ts","names":[],"sources":["../src/consola.ts"],"mappings":";;;;;;AAuBA;;;;;AACA;;;;;;;;;;;;;cADa,aAAA,EAA+B,
|
|
1
|
+
{"version":3,"file":"consola.d.ts","names":[],"sources":["../src/consola.ts"],"mappings":";;;;;;AAuBA;;;;;AACA;;;;;;;;;;;;;cADa,aAAA,EAA+B,SAAA,CAAlB,eAAA;AAAA,cACb,MAAA,EAAsB,SAAA,CAAhB,eAAA"}
|
package/dist/pino.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as pino
|
|
1
|
+
import * as _$pino from "pino";
|
|
2
2
|
|
|
3
3
|
//#region src/pino.d.ts
|
|
4
4
|
/**
|
|
@@ -22,8 +22,8 @@ import * as pino$1 from "pino";
|
|
|
22
22
|
* logger.level = 'info';
|
|
23
23
|
* ```
|
|
24
24
|
*/
|
|
25
|
-
declare const pinoLogger: pino
|
|
26
|
-
declare const logger: pino
|
|
25
|
+
declare const pinoLogger: _$pino.Logger<never, boolean>;
|
|
26
|
+
declare const logger: _$pino.Logger<never, boolean>;
|
|
27
27
|
//#endregion
|
|
28
28
|
export { logger, pinoLogger };
|
|
29
29
|
//# sourceMappingURL=pino.d.ts.map
|
package/dist/string.js
CHANGED
|
@@ -34,7 +34,7 @@ function randomString(length, mode = "alphabetic") {
|
|
|
34
34
|
if (!Number.isInteger(length) || length <= 0) throw new Error(`Invalid length: ${length}. Must be a positive integer`);
|
|
35
35
|
const charset = CHARSETS[mode];
|
|
36
36
|
if (!charset) throw new Error(`Unsupported mode: ${mode}`);
|
|
37
|
-
return Array.from({ length })
|
|
37
|
+
return Array.from({ length }, () => charset[Math.floor(Math.random() * charset.length)]).join("");
|
|
38
38
|
}
|
|
39
39
|
//#endregion
|
|
40
40
|
export { randomString };
|
package/dist/string.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string.js","names":[],"sources":["../src/string.ts"],"sourcesContent":["export type RandomStringMode =\n | 'alphabetic'\n | 'alphanumeric'\n | 'lowercase'\n | 'lowercase-numeric'\n | 'numeric'\n | 'uppercase'\n | 'uppercase-numeric';\n\nconst DIGITS = '0123456789';\nconst LOWERCASE = 'abcdefghijklmnopqrstuvwxyz';\nconst UPPERCASE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\nconst CHARSETS: Record<RandomStringMode, string> = {\n 'alphabetic': LOWERCASE + UPPERCASE,\n 'alphanumeric': DIGITS + LOWERCASE + UPPERCASE,\n 'lowercase': LOWERCASE,\n 'lowercase-numeric': DIGITS + LOWERCASE,\n 'numeric': DIGITS,\n 'uppercase': UPPERCASE,\n 'uppercase-numeric': DIGITS + UPPERCASE,\n};\n\n/**\n * Generates a random string of a given length using a specified character set.\n *\n * @param {number} length - The length of the string to generate. Must be a positive integer\n * @param {RandomStringMode} [mode] - The character set to use\n *\n * @returns {string} The generated random string\n *\n * @throws {Error} If the length is not a positive integer or the mode is unsupported\n *\n * @example\n * ```typescript\n * import { randomString } from '@kikiutils/shared/string';\n *\n * console.log(randomString(8)); // e.g. 'aZbXwTyQ' (alphabetic)\n * console.log(randomString(6, 'numeric')); // e.g. '402398'\n * console.log(randomString(10, 'alphanumeric')); // e.g. 'a9Z4pQ8xY2'\n * ```\n */\nexport function randomString(length: number, mode: RandomStringMode = 'alphabetic') {\n if (!Number.isInteger(length) || length <= 0) {\n throw new Error(`Invalid length: ${length}. Must be a positive integer`);\n }\n\n const charset = CHARSETS[mode];\n if (!charset) throw new Error(`Unsupported mode: ${mode}`);\n return Array.from({ length })
|
|
1
|
+
{"version":3,"file":"string.js","names":[],"sources":["../src/string.ts"],"sourcesContent":["export type RandomStringMode =\n | 'alphabetic'\n | 'alphanumeric'\n | 'lowercase'\n | 'lowercase-numeric'\n | 'numeric'\n | 'uppercase'\n | 'uppercase-numeric';\n\nconst DIGITS = '0123456789';\nconst LOWERCASE = 'abcdefghijklmnopqrstuvwxyz';\nconst UPPERCASE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\nconst CHARSETS: Record<RandomStringMode, string> = {\n 'alphabetic': LOWERCASE + UPPERCASE,\n 'alphanumeric': DIGITS + LOWERCASE + UPPERCASE,\n 'lowercase': LOWERCASE,\n 'lowercase-numeric': DIGITS + LOWERCASE,\n 'numeric': DIGITS,\n 'uppercase': UPPERCASE,\n 'uppercase-numeric': DIGITS + UPPERCASE,\n};\n\n/**\n * Generates a random string of a given length using a specified character set.\n *\n * @param {number} length - The length of the string to generate. Must be a positive integer\n * @param {RandomStringMode} [mode] - The character set to use\n *\n * @returns {string} The generated random string\n *\n * @throws {Error} If the length is not a positive integer or the mode is unsupported\n *\n * @example\n * ```typescript\n * import { randomString } from '@kikiutils/shared/string';\n *\n * console.log(randomString(8)); // e.g. 'aZbXwTyQ' (alphabetic)\n * console.log(randomString(6, 'numeric')); // e.g. '402398'\n * console.log(randomString(10, 'alphanumeric')); // e.g. 'a9Z4pQ8xY2'\n * ```\n */\nexport function randomString(length: number, mode: RandomStringMode = 'alphabetic') {\n if (!Number.isInteger(length) || length <= 0) {\n throw new Error(`Invalid length: ${length}. Must be a positive integer`);\n }\n\n const charset = CHARSETS[mode];\n if (!charset) throw new Error(`Unsupported mode: ${mode}`);\n return Array.from({ length }, () => charset[Math.floor(Math.random() * charset.length)]).join('');\n}\n"],"mappings":";AASA,MAAM,SAAS;AACf,MAAM,YAAY;AAClB,MAAM,YAAY;AAClB,MAAM,WAA6C;CAC/C,cAAc,YAAY;CAC1B,gBAAgB,SAAS,YAAY;CACrC,aAAa;CACb,qBAAqB,SAAS;CAC9B,WAAW;CACX,aAAa;CACb,qBAAqB,SAAS;CACjC;;;;;;;;;;;;;;;;;;;;AAqBD,SAAgB,aAAa,QAAgB,OAAyB,cAAc;AAChF,KAAI,CAAC,OAAO,UAAU,OAAO,IAAI,UAAU,EACvC,OAAM,IAAI,MAAM,mBAAmB,OAAO,8BAA8B;CAG5E,MAAM,UAAU,SAAS;AACzB,KAAI,CAAC,QAAS,OAAM,IAAI,MAAM,qBAAqB,OAAO;AAC1D,QAAO,MAAM,KAAK,EAAE,QAAQ,QAAQ,QAAQ,KAAK,MAAM,KAAK,QAAQ,GAAG,QAAQ,OAAO,EAAE,CAAC,KAAK,GAAG"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kikiutils/shared",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "15.0.
|
|
4
|
+
"version": "15.0.1",
|
|
5
5
|
"description": "A lightweight and modular utility library for modern JavaScript and TypeScript — includes secure hashing, flexible logging, datetime tools, Vue/web helpers, storage abstraction, and more.",
|
|
6
6
|
"author": "kiki-kanri",
|
|
7
7
|
"license": "MIT",
|
|
@@ -67,21 +67,21 @@
|
|
|
67
67
|
"typecheck": "tsc -b --noEmit"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
|
-
"@noble/hashes": "^2.0
|
|
70
|
+
"@noble/hashes": "^2.2.0",
|
|
71
71
|
"@types/ssh2": "^1.15.5",
|
|
72
72
|
"async-validator": "^4.2.5",
|
|
73
73
|
"bson": "^7.2.0",
|
|
74
74
|
"consola": "^3.4.2",
|
|
75
75
|
"date-fns": "^4.1.0",
|
|
76
76
|
"decimal.js": "^10.6.0",
|
|
77
|
-
"element-plus": "^2.13.
|
|
78
|
-
"lru-cache": "^11.
|
|
77
|
+
"element-plus": "^2.13.7",
|
|
78
|
+
"lru-cache": "^11.3.5",
|
|
79
79
|
"millify": "^6.1.0",
|
|
80
|
-
"msgpackr": "^1.11.
|
|
80
|
+
"msgpackr": "^1.11.9",
|
|
81
81
|
"node-ssh": "^13.2.1",
|
|
82
82
|
"pino": "^10.3.1",
|
|
83
83
|
"pino-pretty": "^13.1.3",
|
|
84
|
-
"vue": "^3.5.
|
|
84
|
+
"vue": "^3.5.32",
|
|
85
85
|
"vue-router": ">= 4.6.4"
|
|
86
86
|
},
|
|
87
87
|
"peerDependenciesMeta": {
|
|
@@ -135,13 +135,13 @@
|
|
|
135
135
|
}
|
|
136
136
|
},
|
|
137
137
|
"devDependencies": {
|
|
138
|
-
"@antfu/eslint-config": "^
|
|
139
|
-
"@kikiutils/eslint-config": "^
|
|
140
|
-
"@kikiutils/tsconfigs": "^
|
|
141
|
-
"@noble/hashes": "^2.0
|
|
142
|
-
"@types/node": "^25.
|
|
138
|
+
"@antfu/eslint-config": "^8.2.0",
|
|
139
|
+
"@kikiutils/eslint-config": "^9.0.1",
|
|
140
|
+
"@kikiutils/tsconfigs": "^6.0.0",
|
|
141
|
+
"@noble/hashes": "^2.2.0",
|
|
142
|
+
"@types/node": "^25.6.0",
|
|
143
143
|
"@types/ssh2": "^1.15.5",
|
|
144
|
-
"@vitest/coverage-v8": "^4.
|
|
144
|
+
"@vitest/coverage-v8": "^4.1.4",
|
|
145
145
|
"async-validator": "^4.2.5",
|
|
146
146
|
"bson": "^7.2.0",
|
|
147
147
|
"changelogen": "^0.6.2",
|
|
@@ -149,22 +149,22 @@
|
|
|
149
149
|
"cross-env": "^10.1.0",
|
|
150
150
|
"date-fns": "^4.1.0",
|
|
151
151
|
"decimal.js": "^10.6.0",
|
|
152
|
-
"element-plus": "^2.13.
|
|
153
|
-
"jsdom": "^
|
|
154
|
-
"knip": "^
|
|
155
|
-
"lru-cache": "^11.
|
|
152
|
+
"element-plus": "^2.13.7",
|
|
153
|
+
"jsdom": "^29.0.2",
|
|
154
|
+
"knip": "^6.4.1",
|
|
155
|
+
"lru-cache": "^11.3.5",
|
|
156
156
|
"millify": "^6.1.0",
|
|
157
|
-
"msgpackr": "^1.11.
|
|
157
|
+
"msgpackr": "^1.11.10",
|
|
158
158
|
"node-ssh": "^13.2.1",
|
|
159
159
|
"pino": "^10.3.1",
|
|
160
160
|
"pino-pretty": "^13.1.3",
|
|
161
161
|
"publint": "^0.3.18",
|
|
162
|
-
"tsdown": "^0.21.
|
|
163
|
-
"typescript": "^
|
|
162
|
+
"tsdown": "^0.21.9",
|
|
163
|
+
"typescript": "^6.0.3",
|
|
164
164
|
"unplugin-unused": "^0.5.7",
|
|
165
|
-
"vitest": "^4.
|
|
166
|
-
"vue": "^3.5.
|
|
167
|
-
"vue-router": "^5.0.
|
|
165
|
+
"vitest": "^4.1.4",
|
|
166
|
+
"vue": "^3.5.32",
|
|
167
|
+
"vue-router": "^5.0.4"
|
|
168
168
|
},
|
|
169
169
|
"pnpm": {
|
|
170
170
|
"onlyBuiltDependencies": [
|
package/src/string.ts
CHANGED
|
@@ -46,5 +46,5 @@ export function randomString(length: number, mode: RandomStringMode = 'alphabeti
|
|
|
46
46
|
|
|
47
47
|
const charset = CHARSETS[mode];
|
|
48
48
|
if (!charset) throw new Error(`Unsupported mode: ${mode}`);
|
|
49
|
-
return Array.from({ length })
|
|
49
|
+
return Array.from({ length }, () => charset[Math.floor(Math.random() * charset.length)]).join('');
|
|
50
50
|
}
|