ares-ssh-deploy 1.0.2 → 1.0.3
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/CHANGELOG.md +6 -0
- package/dist/index.d.cts +2 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/shared/ssh-deploy.BPGd0bH8.d.cts +59 -0
- package/dist/shared/ssh-deploy.BPGd0bH8.d.mts +59 -0
- package/dist/shared/ssh-deploy.BPGd0bH8.d.ts +59 -0
- package/dist/types/index.d.ts +56 -59
- package/dist/utils/common.cjs +1 -1
- package/dist/utils/common.d.cts +3 -0
- package/dist/utils/common.d.mts +3 -0
- package/dist/utils/common.d.ts +3 -0
- package/dist/utils/deploy-linux-bastion.d.cts +2 -0
- package/dist/utils/deploy-linux-bastion.d.mts +2 -0
- package/dist/utils/deploy-linux-bastion.d.ts +2 -0
- package/dist/utils/deploy-windows-server.d.cts +2 -0
- package/dist/utils/deploy-windows-server.d.mts +2 -0
- package/dist/utils/deploy-windows-server.d.ts +2 -0
- package/dist/utils/ssh.d.cts +2 -58
- package/dist/utils/ssh.d.mts +2 -58
- package/dist/utils/ssh.d.ts +2 -58
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
package/dist/index.d.cts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export { deployToWindowsServer } from './utils/deploy-windows-server.cjs';
|
|
2
2
|
export { deployToLinuxBastionInternalServer, disableLinuxBastionHealthCheck, enableLinuxBastionHealthCheck } from './utils/deploy-linux-bastion.cjs';
|
|
3
3
|
import 'node-ssh';
|
|
4
|
+
import './shared/ssh-deploy.BPGd0bH8.cjs';
|
|
5
|
+
import 'ssh2';
|
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export { deployToWindowsServer } from './utils/deploy-windows-server.mjs';
|
|
2
2
|
export { deployToLinuxBastionInternalServer, disableLinuxBastionHealthCheck, enableLinuxBastionHealthCheck } from './utils/deploy-linux-bastion.mjs';
|
|
3
3
|
import 'node-ssh';
|
|
4
|
+
import './shared/ssh-deploy.BPGd0bH8.mjs';
|
|
5
|
+
import 'ssh2';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export { deployToWindowsServer } from './utils/deploy-windows-server.js';
|
|
2
2
|
export { deployToLinuxBastionInternalServer, disableLinuxBastionHealthCheck, enableLinuxBastionHealthCheck } from './utils/deploy-linux-bastion.js';
|
|
3
3
|
import 'node-ssh';
|
|
4
|
+
import './shared/ssh-deploy.BPGd0bH8.js';
|
|
5
|
+
import 'ssh2';
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { SFTPWrapper } from 'ssh2';
|
|
2
|
+
|
|
3
|
+
interface SSHClientConfig {
|
|
4
|
+
host?: string
|
|
5
|
+
port?: number | string
|
|
6
|
+
username?: string
|
|
7
|
+
password?: string
|
|
8
|
+
privateKey?: string
|
|
9
|
+
[key: string]: any
|
|
10
|
+
}
|
|
11
|
+
interface BastionSSHClientConfig extends SSHClientConfig {
|
|
12
|
+
[key: string]: any
|
|
13
|
+
}
|
|
14
|
+
interface TargetSSHClientConfig extends SSHClientConfig {
|
|
15
|
+
localDeployDir?: string
|
|
16
|
+
localDownloadDir?: string
|
|
17
|
+
|
|
18
|
+
remoteBackupDir?: string
|
|
19
|
+
remoteDir?: string
|
|
20
|
+
remoteDirTemp?: string
|
|
21
|
+
|
|
22
|
+
remoteHealthDir?: string
|
|
23
|
+
remoteHideHealthFileDir?: string
|
|
24
|
+
remoteHealthFile?: string
|
|
25
|
+
remoteHealthHiddenFile?: string
|
|
26
|
+
[key: string]: any
|
|
27
|
+
}
|
|
28
|
+
interface BastionChannelConfig {
|
|
29
|
+
srcIP?: string
|
|
30
|
+
srcPort?: number | string
|
|
31
|
+
dstIP?: string
|
|
32
|
+
dstPort?: number | string
|
|
33
|
+
[key: string]: any
|
|
34
|
+
}
|
|
35
|
+
interface IntraServerSSHClientConfig {
|
|
36
|
+
username?: string
|
|
37
|
+
password?: string
|
|
38
|
+
[key: string]: any
|
|
39
|
+
}
|
|
40
|
+
interface UploadDownloadConfig {
|
|
41
|
+
localDir?: string
|
|
42
|
+
remoteDir?: string
|
|
43
|
+
[key: string]: any
|
|
44
|
+
}
|
|
45
|
+
interface MakeDirectoryConfig {
|
|
46
|
+
path: string
|
|
47
|
+
method?: 'sftp' | 'exec'
|
|
48
|
+
givenSftp?: SFTPWrapper
|
|
49
|
+
[key: string]: any
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
interface BuildConfig {
|
|
53
|
+
build?: boolean
|
|
54
|
+
mode?: string
|
|
55
|
+
projectDir?: string
|
|
56
|
+
[key: string]: any
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export type { BuildConfig as B, IntraServerSSHClientConfig as I, MakeDirectoryConfig as M, SSHClientConfig as S, TargetSSHClientConfig as T, UploadDownloadConfig as U, BastionChannelConfig as a, BastionSSHClientConfig as b };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { SFTPWrapper } from 'ssh2';
|
|
2
|
+
|
|
3
|
+
interface SSHClientConfig {
|
|
4
|
+
host?: string
|
|
5
|
+
port?: number | string
|
|
6
|
+
username?: string
|
|
7
|
+
password?: string
|
|
8
|
+
privateKey?: string
|
|
9
|
+
[key: string]: any
|
|
10
|
+
}
|
|
11
|
+
interface BastionSSHClientConfig extends SSHClientConfig {
|
|
12
|
+
[key: string]: any
|
|
13
|
+
}
|
|
14
|
+
interface TargetSSHClientConfig extends SSHClientConfig {
|
|
15
|
+
localDeployDir?: string
|
|
16
|
+
localDownloadDir?: string
|
|
17
|
+
|
|
18
|
+
remoteBackupDir?: string
|
|
19
|
+
remoteDir?: string
|
|
20
|
+
remoteDirTemp?: string
|
|
21
|
+
|
|
22
|
+
remoteHealthDir?: string
|
|
23
|
+
remoteHideHealthFileDir?: string
|
|
24
|
+
remoteHealthFile?: string
|
|
25
|
+
remoteHealthHiddenFile?: string
|
|
26
|
+
[key: string]: any
|
|
27
|
+
}
|
|
28
|
+
interface BastionChannelConfig {
|
|
29
|
+
srcIP?: string
|
|
30
|
+
srcPort?: number | string
|
|
31
|
+
dstIP?: string
|
|
32
|
+
dstPort?: number | string
|
|
33
|
+
[key: string]: any
|
|
34
|
+
}
|
|
35
|
+
interface IntraServerSSHClientConfig {
|
|
36
|
+
username?: string
|
|
37
|
+
password?: string
|
|
38
|
+
[key: string]: any
|
|
39
|
+
}
|
|
40
|
+
interface UploadDownloadConfig {
|
|
41
|
+
localDir?: string
|
|
42
|
+
remoteDir?: string
|
|
43
|
+
[key: string]: any
|
|
44
|
+
}
|
|
45
|
+
interface MakeDirectoryConfig {
|
|
46
|
+
path: string
|
|
47
|
+
method?: 'sftp' | 'exec'
|
|
48
|
+
givenSftp?: SFTPWrapper
|
|
49
|
+
[key: string]: any
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
interface BuildConfig {
|
|
53
|
+
build?: boolean
|
|
54
|
+
mode?: string
|
|
55
|
+
projectDir?: string
|
|
56
|
+
[key: string]: any
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export type { BuildConfig as B, IntraServerSSHClientConfig as I, MakeDirectoryConfig as M, SSHClientConfig as S, TargetSSHClientConfig as T, UploadDownloadConfig as U, BastionChannelConfig as a, BastionSSHClientConfig as b };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { SFTPWrapper } from 'ssh2';
|
|
2
|
+
|
|
3
|
+
interface SSHClientConfig {
|
|
4
|
+
host?: string
|
|
5
|
+
port?: number | string
|
|
6
|
+
username?: string
|
|
7
|
+
password?: string
|
|
8
|
+
privateKey?: string
|
|
9
|
+
[key: string]: any
|
|
10
|
+
}
|
|
11
|
+
interface BastionSSHClientConfig extends SSHClientConfig {
|
|
12
|
+
[key: string]: any
|
|
13
|
+
}
|
|
14
|
+
interface TargetSSHClientConfig extends SSHClientConfig {
|
|
15
|
+
localDeployDir?: string
|
|
16
|
+
localDownloadDir?: string
|
|
17
|
+
|
|
18
|
+
remoteBackupDir?: string
|
|
19
|
+
remoteDir?: string
|
|
20
|
+
remoteDirTemp?: string
|
|
21
|
+
|
|
22
|
+
remoteHealthDir?: string
|
|
23
|
+
remoteHideHealthFileDir?: string
|
|
24
|
+
remoteHealthFile?: string
|
|
25
|
+
remoteHealthHiddenFile?: string
|
|
26
|
+
[key: string]: any
|
|
27
|
+
}
|
|
28
|
+
interface BastionChannelConfig {
|
|
29
|
+
srcIP?: string
|
|
30
|
+
srcPort?: number | string
|
|
31
|
+
dstIP?: string
|
|
32
|
+
dstPort?: number | string
|
|
33
|
+
[key: string]: any
|
|
34
|
+
}
|
|
35
|
+
interface IntraServerSSHClientConfig {
|
|
36
|
+
username?: string
|
|
37
|
+
password?: string
|
|
38
|
+
[key: string]: any
|
|
39
|
+
}
|
|
40
|
+
interface UploadDownloadConfig {
|
|
41
|
+
localDir?: string
|
|
42
|
+
remoteDir?: string
|
|
43
|
+
[key: string]: any
|
|
44
|
+
}
|
|
45
|
+
interface MakeDirectoryConfig {
|
|
46
|
+
path: string
|
|
47
|
+
method?: 'sftp' | 'exec'
|
|
48
|
+
givenSftp?: SFTPWrapper
|
|
49
|
+
[key: string]: any
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
interface BuildConfig {
|
|
53
|
+
build?: boolean
|
|
54
|
+
mode?: string
|
|
55
|
+
projectDir?: string
|
|
56
|
+
[key: string]: any
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export type { BuildConfig as B, IntraServerSSHClientConfig as I, MakeDirectoryConfig as M, SSHClientConfig as S, TargetSSHClientConfig as T, UploadDownloadConfig as U, BastionChannelConfig as a, BastionSSHClientConfig as b };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,67 +1,64 @@
|
|
|
1
1
|
import type { SFTPWrapper } from 'ssh2'
|
|
2
2
|
|
|
3
|
-
export {};
|
|
4
3
|
|
|
5
|
-
|
|
4
|
+
export type Recordable<K extends string | number | symbol = string, T = any> = Record<
|
|
5
|
+
K extends null | undefined ? string : K,
|
|
6
|
+
T
|
|
7
|
+
>
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
[key: string]: any
|
|
22
|
-
}
|
|
23
|
-
interface TargetSSHClientConfig extends SSHClientConfig {
|
|
24
|
-
localDeployDir?: string
|
|
25
|
-
localDownloadDir?: string
|
|
9
|
+
export interface SSHClientConfig {
|
|
10
|
+
host?: string
|
|
11
|
+
port?: number | string
|
|
12
|
+
username?: string
|
|
13
|
+
password?: string
|
|
14
|
+
privateKey?: string
|
|
15
|
+
[key: string]: any
|
|
16
|
+
}
|
|
17
|
+
export interface BastionSSHClientConfig extends SSHClientConfig {
|
|
18
|
+
[key: string]: any
|
|
19
|
+
}
|
|
20
|
+
export interface TargetSSHClientConfig extends SSHClientConfig {
|
|
21
|
+
localDeployDir?: string
|
|
22
|
+
localDownloadDir?: string
|
|
26
23
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
remoteBackupDir?: string
|
|
25
|
+
remoteDir?: string
|
|
26
|
+
remoteDirTemp?: string
|
|
30
27
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
28
|
+
remoteHealthDir?: string
|
|
29
|
+
remoteHideHealthFileDir?: string
|
|
30
|
+
remoteHealthFile?: string
|
|
31
|
+
remoteHealthHiddenFile?: string
|
|
32
|
+
[key: string]: any
|
|
33
|
+
}
|
|
34
|
+
export interface BastionChannelConfig {
|
|
35
|
+
srcIP?: string
|
|
36
|
+
srcPort?: number | string
|
|
37
|
+
dstIP?: string
|
|
38
|
+
dstPort?: number | string
|
|
39
|
+
[key: string]: any
|
|
40
|
+
}
|
|
41
|
+
export interface IntraServerSSHClientConfig {
|
|
42
|
+
username?: string
|
|
43
|
+
password?: string
|
|
44
|
+
[key: string]: any
|
|
45
|
+
}
|
|
46
|
+
export interface UploadDownloadConfig {
|
|
47
|
+
localDir?: string
|
|
48
|
+
remoteDir?: string
|
|
49
|
+
[key: string]: any
|
|
50
|
+
}
|
|
51
|
+
export interface MakeDirectoryConfig {
|
|
52
|
+
path: string
|
|
53
|
+
method?: 'sftp' | 'exec'
|
|
54
|
+
givenSftp?: SFTPWrapper
|
|
55
|
+
[key: string]: any
|
|
56
|
+
}
|
|
60
57
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
58
|
+
export interface BuildConfig {
|
|
59
|
+
build?: boolean
|
|
60
|
+
mode?: string
|
|
61
|
+
projectDir?: string
|
|
62
|
+
[key: string]: any
|
|
67
63
|
}
|
|
64
|
+
|
package/dist/utils/common.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const lodashEs=require("lodash-es"),utils_logger=require("./logger.cjs"),utils_childProcess=require("./childProcess.cjs"),{BUILD_PROJECT:
|
|
1
|
+
"use strict";const lodashEs=require("lodash-es"),utils_logger=require("./logger.cjs"),utils_childProcess=require("./childProcess.cjs"),{BUILD_PROJECT:E,BUILD_MODE:R,PROJECT_DIR:f,LOCAL_DEPLOY_DIR:i,LOCAL_DOWNLOAD_DIR:n,BASTION_SSH_HOST:u,BASTION_SSH_USER:A,BASTION_SSH_PASSWORD:d,BASTION_SSH_PORT:B,BASTION_SSH_PRIVATE_KEY:I,TARGET_SSH_HOST:S,TARGET_SSH_USER:T,TARGET_SSH_PASSWORD:a,TARGET_SSH_PORT:_,TARGET_SSH_PRIVATE_KEY:l,TARGET_BK_DIR:C,TARGET_DIR:D,TARGET_DIR_TEMP:H,TARGET_HEALTH_DIR:c,TARGET_HIDE_HEALTH_FILE_DIR:O,TARGET_HEALTH_FILE:P,TARGET_HEALTH_HIDDEN_FILE:L}=process.env;function getBastionConfig(e={}){return lodashEs.merge({host:u,port:B,username:A,password:d,privateKey:I},e)}function getBastionTargetConfig(e={}){return lodashEs.merge({host:S,port:_,username:T,password:a,privateKey:l,localDeployDir:i,localDownloadDir:n,remoteBackupDir:C,remoteDir:D,remoteDirTemp:H,remoteHealthDir:c,remoteHideHealthFileDir:O,remoteHealthFile:P,remoteHealthHiddenFile:L},e)}function getBastionChannelConfig(e={}){const o=getBastionTargetConfig(e);return lodashEs.merge({dstIP:o.host,dstPort:o.port},e)}function getWindowsServerTargetConfig(e={}){return lodashEs.merge({host:S,port:_,username:T,password:a,privateKey:l,localDeployDir:i,localDownloadDir:n,remoteBackupDir:C,remoteDir:D,remoteDirTemp:H},e)}function getBuildConfig(e){return lodashEs.merge({build:e.build||E==="true",mode:e.mode||R,projectDir:e.projectDir||f},e)}async function buildProject(e){const{mode:o,projectDir:r}=getBuildConfig(e),t=o?`build:${o}`:"build";utils_logger.logger.info("\u5F00\u59CB\u6253\u5305\u9879\u76EE...");const s=await utils_childProcess.execProjectPNPMCommand(r,t);return utils_logger.logger.info("\u6253\u5305\u9879\u76EE\u5B8C\u6210"),s}exports.buildProject=buildProject,exports.getBastionChannelConfig=getBastionChannelConfig,exports.getBastionConfig=getBastionConfig,exports.getBastionTargetConfig=getBastionTargetConfig,exports.getBuildConfig=getBuildConfig,exports.getWindowsServerTargetConfig=getWindowsServerTargetConfig;
|
package/dist/utils/common.d.cts
CHANGED
package/dist/utils/common.d.mts
CHANGED
package/dist/utils/common.d.ts
CHANGED
package/dist/utils/ssh.d.cts
CHANGED
|
@@ -1,62 +1,6 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { NodeSSH, SSHExecCommandResponse, SSHExecCommandOptions } from 'node-ssh';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
type ChannelType = "session" | "sftp" | "direct-tcpip" | "direct-streamlocal@openssh.com";
|
|
6
|
-
|
|
7
|
-
type ChannelSubType = "exec" | "shell";
|
|
8
|
-
|
|
9
|
-
interface Channel extends Duplex {
|
|
10
|
-
/** Standard input for the Channel. */
|
|
11
|
-
stdin: this;
|
|
12
|
-
/** Standard output for the Channel. */
|
|
13
|
-
stdout: this;
|
|
14
|
-
/** Standard error for the Channel. */
|
|
15
|
-
stderr: Writable | Readable;
|
|
16
|
-
/** Indicates whether this is a server or client channel. */
|
|
17
|
-
server: boolean;
|
|
18
|
-
/** The channel type, usually "session". */
|
|
19
|
-
type: ChannelType;
|
|
20
|
-
/** The channel subtype, usually "exec", "shell", or undefined. */
|
|
21
|
-
subtype?: ChannelSubType;
|
|
22
|
-
incoming: unknown;
|
|
23
|
-
outgoing: unknown;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Sends EOF to the remote side.
|
|
27
|
-
*/
|
|
28
|
-
eof(): void;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Closes the channel on both sides.
|
|
32
|
-
*/
|
|
33
|
-
close(...args: any[]): void;
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Shuts down the channel on this side.
|
|
37
|
-
*/
|
|
38
|
-
destroy(): this;
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Session type-specific methods
|
|
42
|
-
*/
|
|
43
|
-
setWindow(rows: number, cols: number, height: number, width: number): void;
|
|
44
|
-
signal(signalName: string): void;
|
|
45
|
-
exit(status: number): void;
|
|
46
|
-
exit(signalName: string, coreDumped?: boolean, msg?: string): void;
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Emitted once the channel is completely closed on both the client and the server.
|
|
50
|
-
*/
|
|
51
|
-
on(event: "close", listener: () => void): this;
|
|
52
|
-
on(event: "eof", listener: () => void): this;
|
|
53
|
-
on(event: "end", listener: () => void): this;
|
|
54
|
-
on(event: string | symbol, listener: Function): this;
|
|
55
|
-
once(event: "close", listener: () => void): this;
|
|
56
|
-
once(event: "eof", listener: () => void): this;
|
|
57
|
-
once(event: "end", listener: () => void): this;
|
|
58
|
-
once(event: string | symbol, listener: Function): this;
|
|
59
|
-
}
|
|
2
|
+
import { Channel } from 'ssh2';
|
|
3
|
+
import { a as BastionChannelConfig, I as IntraServerSSHClientConfig, S as SSHClientConfig, U as UploadDownloadConfig, M as MakeDirectoryConfig } from '../shared/ssh-deploy.BPGd0bH8.cjs';
|
|
60
4
|
|
|
61
5
|
/**
|
|
62
6
|
* @author: ares
|
package/dist/utils/ssh.d.mts
CHANGED
|
@@ -1,62 +1,6 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { NodeSSH, SSHExecCommandResponse, SSHExecCommandOptions } from 'node-ssh';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
type ChannelType = "session" | "sftp" | "direct-tcpip" | "direct-streamlocal@openssh.com";
|
|
6
|
-
|
|
7
|
-
type ChannelSubType = "exec" | "shell";
|
|
8
|
-
|
|
9
|
-
interface Channel extends Duplex {
|
|
10
|
-
/** Standard input for the Channel. */
|
|
11
|
-
stdin: this;
|
|
12
|
-
/** Standard output for the Channel. */
|
|
13
|
-
stdout: this;
|
|
14
|
-
/** Standard error for the Channel. */
|
|
15
|
-
stderr: Writable | Readable;
|
|
16
|
-
/** Indicates whether this is a server or client channel. */
|
|
17
|
-
server: boolean;
|
|
18
|
-
/** The channel type, usually "session". */
|
|
19
|
-
type: ChannelType;
|
|
20
|
-
/** The channel subtype, usually "exec", "shell", or undefined. */
|
|
21
|
-
subtype?: ChannelSubType;
|
|
22
|
-
incoming: unknown;
|
|
23
|
-
outgoing: unknown;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Sends EOF to the remote side.
|
|
27
|
-
*/
|
|
28
|
-
eof(): void;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Closes the channel on both sides.
|
|
32
|
-
*/
|
|
33
|
-
close(...args: any[]): void;
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Shuts down the channel on this side.
|
|
37
|
-
*/
|
|
38
|
-
destroy(): this;
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Session type-specific methods
|
|
42
|
-
*/
|
|
43
|
-
setWindow(rows: number, cols: number, height: number, width: number): void;
|
|
44
|
-
signal(signalName: string): void;
|
|
45
|
-
exit(status: number): void;
|
|
46
|
-
exit(signalName: string, coreDumped?: boolean, msg?: string): void;
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Emitted once the channel is completely closed on both the client and the server.
|
|
50
|
-
*/
|
|
51
|
-
on(event: "close", listener: () => void): this;
|
|
52
|
-
on(event: "eof", listener: () => void): this;
|
|
53
|
-
on(event: "end", listener: () => void): this;
|
|
54
|
-
on(event: string | symbol, listener: Function): this;
|
|
55
|
-
once(event: "close", listener: () => void): this;
|
|
56
|
-
once(event: "eof", listener: () => void): this;
|
|
57
|
-
once(event: "end", listener: () => void): this;
|
|
58
|
-
once(event: string | symbol, listener: Function): this;
|
|
59
|
-
}
|
|
2
|
+
import { Channel } from 'ssh2';
|
|
3
|
+
import { a as BastionChannelConfig, I as IntraServerSSHClientConfig, S as SSHClientConfig, U as UploadDownloadConfig, M as MakeDirectoryConfig } from '../shared/ssh-deploy.BPGd0bH8.mjs';
|
|
60
4
|
|
|
61
5
|
/**
|
|
62
6
|
* @author: ares
|
package/dist/utils/ssh.d.ts
CHANGED
|
@@ -1,62 +1,6 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { NodeSSH, SSHExecCommandResponse, SSHExecCommandOptions } from 'node-ssh';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
type ChannelType = "session" | "sftp" | "direct-tcpip" | "direct-streamlocal@openssh.com";
|
|
6
|
-
|
|
7
|
-
type ChannelSubType = "exec" | "shell";
|
|
8
|
-
|
|
9
|
-
interface Channel extends Duplex {
|
|
10
|
-
/** Standard input for the Channel. */
|
|
11
|
-
stdin: this;
|
|
12
|
-
/** Standard output for the Channel. */
|
|
13
|
-
stdout: this;
|
|
14
|
-
/** Standard error for the Channel. */
|
|
15
|
-
stderr: Writable | Readable;
|
|
16
|
-
/** Indicates whether this is a server or client channel. */
|
|
17
|
-
server: boolean;
|
|
18
|
-
/** The channel type, usually "session". */
|
|
19
|
-
type: ChannelType;
|
|
20
|
-
/** The channel subtype, usually "exec", "shell", or undefined. */
|
|
21
|
-
subtype?: ChannelSubType;
|
|
22
|
-
incoming: unknown;
|
|
23
|
-
outgoing: unknown;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Sends EOF to the remote side.
|
|
27
|
-
*/
|
|
28
|
-
eof(): void;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Closes the channel on both sides.
|
|
32
|
-
*/
|
|
33
|
-
close(...args: any[]): void;
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Shuts down the channel on this side.
|
|
37
|
-
*/
|
|
38
|
-
destroy(): this;
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Session type-specific methods
|
|
42
|
-
*/
|
|
43
|
-
setWindow(rows: number, cols: number, height: number, width: number): void;
|
|
44
|
-
signal(signalName: string): void;
|
|
45
|
-
exit(status: number): void;
|
|
46
|
-
exit(signalName: string, coreDumped?: boolean, msg?: string): void;
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Emitted once the channel is completely closed on both the client and the server.
|
|
50
|
-
*/
|
|
51
|
-
on(event: "close", listener: () => void): this;
|
|
52
|
-
on(event: "eof", listener: () => void): this;
|
|
53
|
-
on(event: "end", listener: () => void): this;
|
|
54
|
-
on(event: string | symbol, listener: Function): this;
|
|
55
|
-
once(event: "close", listener: () => void): this;
|
|
56
|
-
once(event: "eof", listener: () => void): this;
|
|
57
|
-
once(event: "end", listener: () => void): this;
|
|
58
|
-
once(event: string | symbol, listener: Function): this;
|
|
59
|
-
}
|
|
2
|
+
import { Channel } from 'ssh2';
|
|
3
|
+
import { a as BastionChannelConfig, I as IntraServerSSHClientConfig, S as SSHClientConfig, U as UploadDownloadConfig, M as MakeDirectoryConfig } from '../shared/ssh-deploy.BPGd0bH8.js';
|
|
60
4
|
|
|
61
5
|
/**
|
|
62
6
|
* @author: ares
|
package/package.json
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ares-ssh-deploy",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "ssh deploy tools",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
7
|
-
"types": "./dist/
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
11
11
|
"import": "./dist/index.mjs",
|
|
12
12
|
"require": "./dist/index.cjs"
|
|
13
13
|
},
|
|
14
|
-
"./utils/*": "./dist/utils/*"
|
|
14
|
+
"./utils/*": "./dist/utils/*",
|
|
15
|
+
"./types": "././dist/types/index.d.ts"
|
|
15
16
|
},
|
|
16
17
|
"scripts": {
|
|
17
18
|
"deploy:windows-server": "dotenvx run --env-file=.env.windows-server -- node src/utils/deploy-windows-server.js",
|