@zero-transfer/sdk 0.1.6 → 0.4.0
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/README.md +2 -4
- package/assets/zero-transfer-logo.svg +0 -35
- package/dist/index.cjs +4556 -1136
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +918 -59
- package/dist/index.d.ts +918 -59
- package/dist/index.mjs +4552 -1134
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -4
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { EventEmitter } from 'node:events';
|
|
2
2
|
import { SecureVersion, PeerCertificate } from 'node:tls';
|
|
3
3
|
import { Readable } from 'node:stream';
|
|
4
|
-
import { BaseAgent, Algorithms, ConnectConfig, Client, SFTPWrapper } from 'ssh2';
|
|
5
4
|
import { Buffer as Buffer$1 } from 'node:buffer';
|
|
5
|
+
import { Socket } from 'node:net';
|
|
6
|
+
import { KeyObject } from 'node:crypto';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Structured logging contracts and helpers for ZeroTransfer.
|
|
@@ -306,10 +307,25 @@ interface RemoteStat extends RemoteEntry {
|
|
|
306
307
|
type TlsSecretSource = SecretSource | SecretSource[];
|
|
307
308
|
/** Known-hosts material source accepted by SSH connection profiles. */
|
|
308
309
|
type SshKnownHostsSource = SecretSource | SecretSource[];
|
|
310
|
+
/** Minimal SSH agent contract used by profile validation and SSH adapters. */
|
|
311
|
+
interface SshAgentLike {
|
|
312
|
+
/** Returns public identities exposed by the agent implementation. */
|
|
313
|
+
getIdentities: (...args: any[]) => unknown;
|
|
314
|
+
/** Signs payloads using a selected identity. */
|
|
315
|
+
sign: (...args: any[]) => unknown;
|
|
316
|
+
}
|
|
317
|
+
/** Ordered algorithm list mutation operations used by SSH adapters. */
|
|
318
|
+
interface SshAlgorithmMutations {
|
|
319
|
+
append?: string | readonly string[];
|
|
320
|
+
prepend?: string | readonly string[];
|
|
321
|
+
remove?: string | readonly string[];
|
|
322
|
+
}
|
|
323
|
+
/** Single SSH algorithm override value accepted by connection profiles. */
|
|
324
|
+
type SshAlgorithmOverride = readonly string[] | SshAlgorithmMutations;
|
|
309
325
|
/** SSH agent source accepted by SFTP providers. */
|
|
310
|
-
type SshAgentSource = string |
|
|
326
|
+
type SshAgentSource = string | SshAgentLike;
|
|
311
327
|
/** SSH transport algorithm overrides accepted by SFTP providers. */
|
|
312
|
-
type SshAlgorithms =
|
|
328
|
+
type SshAlgorithms = Record<string, SshAlgorithmOverride | undefined>;
|
|
313
329
|
/** Context passed to SSH socket factories before opening an SSH session. */
|
|
314
330
|
interface SshSocketFactoryContext {
|
|
315
331
|
/** Target SSH host from the resolved connection profile. */
|
|
@@ -327,7 +343,7 @@ interface SshSocketFactoryContext {
|
|
|
327
343
|
* Use this hook for HTTP CONNECT, SOCKS, bastion, or custom tunnel integrations.
|
|
328
344
|
*
|
|
329
345
|
* @param context - Resolved SSH target information for the socket being opened.
|
|
330
|
-
* @returns Preconnected readable stream, or a promise for one, passed to
|
|
346
|
+
* @returns Preconnected readable stream, or a promise for one, passed to the SSH adapter socket option.
|
|
331
347
|
*/
|
|
332
348
|
type SshSocketFactory = (context: SshSocketFactoryContext) => Readable | Promise<Readable>;
|
|
333
349
|
/** Prompt metadata supplied by an SSH keyboard-interactive server challenge. */
|
|
@@ -1637,23 +1653,83 @@ interface RunConnectionDiagnosticsOptions {
|
|
|
1637
1653
|
*/
|
|
1638
1654
|
declare function runConnectionDiagnostics(options: RunConnectionDiagnosticsOptions): Promise<ConnectionDiagnosticsResult>;
|
|
1639
1655
|
|
|
1656
|
+
/** Options for {@link createPooledTransferClient}. */
|
|
1657
|
+
interface ConnectionPoolOptions {
|
|
1658
|
+
/**
|
|
1659
|
+
* Maximum number of *idle* sessions retained per pool key.
|
|
1660
|
+
*
|
|
1661
|
+
* Active leases are not counted against this limit — the cap only applies
|
|
1662
|
+
* to sessions waiting in the pool. When more than `maxIdlePerKey` sessions
|
|
1663
|
+
* become idle simultaneously, the oldest ones are disconnected. Defaults
|
|
1664
|
+
* to `4`.
|
|
1665
|
+
*/
|
|
1666
|
+
maxIdlePerKey?: number;
|
|
1667
|
+
/**
|
|
1668
|
+
* How long an idle session may sit unused before it is automatically
|
|
1669
|
+
* disconnected. Defaults to `60_000` ms. Set to `0` to disable the timer
|
|
1670
|
+
* (idle sessions persist until `drainPool()` is called).
|
|
1671
|
+
*/
|
|
1672
|
+
idleTimeoutMs?: number;
|
|
1673
|
+
/**
|
|
1674
|
+
* Custom pool key derivation. Receives the resolved
|
|
1675
|
+
* {@link ConnectionProfile} (after TransferClient validation) and must
|
|
1676
|
+
* return a string. Sessions with matching keys are pooled together; never
|
|
1677
|
+
* include secrets in the key.
|
|
1678
|
+
*
|
|
1679
|
+
* The default derives the key from `provider`, `host`, `port`, and
|
|
1680
|
+
* `username`.
|
|
1681
|
+
*/
|
|
1682
|
+
keyOf?: (profile: ConnectionProfile) => string;
|
|
1683
|
+
}
|
|
1684
|
+
/**
|
|
1685
|
+
* Pool-aware {@link TransferClient} returned by
|
|
1686
|
+
* {@link createPooledTransferClient}.
|
|
1687
|
+
*/
|
|
1688
|
+
interface PooledTransferClient {
|
|
1689
|
+
/** Opens (or leases) a pooled provider session. */
|
|
1690
|
+
connect(profile: ConnectionProfile): Promise<TransferSession>;
|
|
1691
|
+
/** Inspects the registered providers (delegated to the underlying client). */
|
|
1692
|
+
hasProvider(providerId: ProviderId): boolean;
|
|
1693
|
+
/** Returns the registered capability snapshots (delegated). */
|
|
1694
|
+
getCapabilities(): CapabilitySet[];
|
|
1695
|
+
/** Returns a specific capability snapshot (delegated). */
|
|
1696
|
+
getCapabilities(providerId: ProviderId): CapabilitySet;
|
|
1697
|
+
/**
|
|
1698
|
+
* Disconnects every idle session and prevents further pooling. After
|
|
1699
|
+
* `drainPool()` resolves, subsequent `connect()` calls still work but
|
|
1700
|
+
* always create fresh sessions (and never return them to the pool).
|
|
1701
|
+
*/
|
|
1702
|
+
drainPool(): Promise<void>;
|
|
1703
|
+
/** Returns the number of idle sessions currently held in the pool. */
|
|
1704
|
+
poolSize(): number;
|
|
1705
|
+
}
|
|
1706
|
+
/**
|
|
1707
|
+
* Wraps a {@link TransferClient} with connection pooling.
|
|
1708
|
+
*
|
|
1709
|
+
* @param inner - Underlying client used to create real provider sessions.
|
|
1710
|
+
* @param options - Pool sizing, eviction, and key-derivation overrides.
|
|
1711
|
+
* @returns A {@link PooledTransferClient} that reuses idle sessions.
|
|
1712
|
+
*/
|
|
1713
|
+
declare function createPooledTransferClient(inner: TransferClient, options?: ConnectionPoolOptions): PooledTransferClient;
|
|
1714
|
+
|
|
1640
1715
|
/**
|
|
1641
1716
|
* Built-in provider capability matrix.
|
|
1642
1717
|
*
|
|
1643
1718
|
* Aggregates the {@link CapabilitySet} advertised by every shipped provider
|
|
1644
1719
|
* factory so applications, docs, and diagnostics can compare features across
|
|
1645
1720
|
* providers without instantiating each one. The S3 entry is captured twice —
|
|
1646
|
-
* once with
|
|
1647
|
-
*
|
|
1721
|
+
* once with the new multipart-by-default configuration and once with
|
|
1722
|
+
* `multipart.enabled: false` for the legacy single-shot variant — because
|
|
1723
|
+
* that flag flips `resumeUpload`.
|
|
1648
1724
|
*
|
|
1649
1725
|
* @module providers/capabilityMatrix
|
|
1650
1726
|
*/
|
|
1651
1727
|
|
|
1652
1728
|
/** Identifier for an entry in {@link getBuiltinCapabilityMatrix}. */
|
|
1653
|
-
type BuiltinProviderMatrixId = ProviderId | "s3:
|
|
1729
|
+
type BuiltinProviderMatrixId = ProviderId | "s3:single-shot";
|
|
1654
1730
|
/** Single entry in the built-in capability matrix. */
|
|
1655
1731
|
interface BuiltinCapabilityMatrixEntry {
|
|
1656
|
-
/** Stable matrix identifier (provider id, or `s3:
|
|
1732
|
+
/** Stable matrix identifier (provider id, or `s3:single-shot` for the legacy variant). */
|
|
1657
1733
|
id: BuiltinProviderMatrixId;
|
|
1658
1734
|
/** Human-readable label, suitable for documentation tables. */
|
|
1659
1735
|
label: string;
|
|
@@ -1877,6 +1953,24 @@ interface WebDavProviderOptions {
|
|
|
1877
1953
|
fetch?: HttpFetch;
|
|
1878
1954
|
/** Default headers applied to every request. */
|
|
1879
1955
|
defaultHeaders?: Record<string, string>;
|
|
1956
|
+
/**
|
|
1957
|
+
* Streaming policy for `PUT` request bodies.
|
|
1958
|
+
*
|
|
1959
|
+
* - `"when-known-size"` (default) — stream when the caller declares
|
|
1960
|
+
* `request.totalBytes` (an explicit `Content-Length` is sent so all
|
|
1961
|
+
* WebDAV servers accept the upload); otherwise buffer the entire body in
|
|
1962
|
+
* memory before sending. This is the safe default that does not require
|
|
1963
|
+
* the server to accept HTTP/1.1 chunked transfer-encoding.
|
|
1964
|
+
* - `"always"` — always stream the body, even when the size is unknown
|
|
1965
|
+
* (the runtime will use chunked transfer-encoding). Some legacy WebDAV
|
|
1966
|
+
* servers reject `Transfer-Encoding: chunked` and will respond `411
|
|
1967
|
+
* Length Required` or `501 Not Implemented`; only enable this for
|
|
1968
|
+
* servers known to accept chunked uploads (modern Apache/nginx, IIS
|
|
1969
|
+
* with chunked transfer enabled, Nextcloud, ownCloud, sabre/dav).
|
|
1970
|
+
* - `"never"` — always buffer (legacy behaviour pre-0.4.0). Use for
|
|
1971
|
+
* maximum compatibility at the cost of memory.
|
|
1972
|
+
*/
|
|
1973
|
+
uploadStreaming?: "when-known-size" | "always" | "never";
|
|
1880
1974
|
}
|
|
1881
1975
|
/**
|
|
1882
1976
|
* Creates a WebDAV provider factory.
|
|
@@ -1911,7 +2005,14 @@ interface S3ProviderOptions {
|
|
|
1911
2005
|
}
|
|
1912
2006
|
/** Multipart upload tuning for the S3 provider. */
|
|
1913
2007
|
interface S3MultipartOptions {
|
|
1914
|
-
/**
|
|
2008
|
+
/**
|
|
2009
|
+
* Enable multipart upload. **Defaults to `true`** so large objects stream
|
|
2010
|
+
* in fixed-size parts instead of being buffered in memory before a single
|
|
2011
|
+
* `PUT`. Payloads at or below {@link S3MultipartOptions.thresholdBytes}
|
|
2012
|
+
* still fall back to a single-shot `PUT` automatically. Set to `false` to
|
|
2013
|
+
* force the legacy single-shot behaviour (e.g. when targeting an
|
|
2014
|
+
* S3-compatible endpoint that does not support `CreateMultipartUpload`).
|
|
2015
|
+
*/
|
|
1915
2016
|
enabled?: boolean;
|
|
1916
2017
|
/** Object size threshold in bytes above which multipart is used. Defaults to 8 MiB. */
|
|
1917
2018
|
thresholdBytes?: number;
|
|
@@ -1957,6 +2058,41 @@ interface S3MultipartResumeStore {
|
|
|
1957
2058
|
}
|
|
1958
2059
|
/** Creates an in-memory {@link S3MultipartResumeStore}. */
|
|
1959
2060
|
declare function createMemoryS3MultipartResumeStore(): S3MultipartResumeStore;
|
|
2061
|
+
/** Options for {@link createFileSystemS3MultipartResumeStore}. */
|
|
2062
|
+
interface FileSystemS3MultipartResumeStoreOptions {
|
|
2063
|
+
/**
|
|
2064
|
+
* Directory under which checkpoint JSON files are written. Created
|
|
2065
|
+
* recursively if it does not exist. Each upload occupies a single file
|
|
2066
|
+
* named after a SHA-256 hash of the resume key, so the directory is safe
|
|
2067
|
+
* to share across many concurrent uploads.
|
|
2068
|
+
*/
|
|
2069
|
+
directory: string;
|
|
2070
|
+
}
|
|
2071
|
+
/**
|
|
2072
|
+
* File-system backed {@link S3MultipartResumeStore} that survives process
|
|
2073
|
+
* restarts. Each in-flight multipart upload is checkpointed to a single
|
|
2074
|
+
* JSON file in `options.directory` after every part. On retry the upload
|
|
2075
|
+
* reuses the stored `uploadId` and skips parts that S3 has already
|
|
2076
|
+
* accepted.
|
|
2077
|
+
*
|
|
2078
|
+
* The implementation writes atomically (`<file>.tmp` then `rename`) so a
|
|
2079
|
+
* crash mid-write cannot leave a corrupt checkpoint.
|
|
2080
|
+
*
|
|
2081
|
+
* @example
|
|
2082
|
+
* ```ts
|
|
2083
|
+
* import { createFileSystemS3MultipartResumeStore, createS3ProviderFactory }
|
|
2084
|
+
* from "@zero-transfer/sdk";
|
|
2085
|
+
*
|
|
2086
|
+
* const resumeStore = createFileSystemS3MultipartResumeStore({
|
|
2087
|
+
* directory: "./.zt-s3-resume",
|
|
2088
|
+
* });
|
|
2089
|
+
*
|
|
2090
|
+
* const factory = createS3ProviderFactory({
|
|
2091
|
+
* multipart: { enabled: true, resumeStore },
|
|
2092
|
+
* });
|
|
2093
|
+
* ```
|
|
2094
|
+
*/
|
|
2095
|
+
declare function createFileSystemS3MultipartResumeStore(options: FileSystemS3MultipartResumeStoreOptions): S3MultipartResumeStore;
|
|
1960
2096
|
/**
|
|
1961
2097
|
* Creates an S3-compatible provider factory.
|
|
1962
2098
|
*
|
|
@@ -2568,6 +2704,554 @@ declare function redactValue(value: unknown): unknown;
|
|
|
2568
2704
|
*/
|
|
2569
2705
|
declare function redactObject(input: Record<string, unknown>): Record<string, unknown>;
|
|
2570
2706
|
|
|
2707
|
+
/** Algorithm lists exchanged during SSH KEXINIT negotiation. */
|
|
2708
|
+
interface SshAlgorithmPreferences {
|
|
2709
|
+
compressionClientToServer: readonly string[];
|
|
2710
|
+
compressionServerToClient: readonly string[];
|
|
2711
|
+
encryptionClientToServer: readonly string[];
|
|
2712
|
+
encryptionServerToClient: readonly string[];
|
|
2713
|
+
kexAlgorithms: readonly string[];
|
|
2714
|
+
languagesClientToServer: readonly string[];
|
|
2715
|
+
languagesServerToClient: readonly string[];
|
|
2716
|
+
macClientToServer: readonly string[];
|
|
2717
|
+
macServerToClient: readonly string[];
|
|
2718
|
+
serverHostKeyAlgorithms: readonly string[];
|
|
2719
|
+
}
|
|
2720
|
+
/** Selected algorithms after intersecting client preferences with server capabilities. */
|
|
2721
|
+
interface NegotiatedSshAlgorithms {
|
|
2722
|
+
compressionClientToServer: string;
|
|
2723
|
+
compressionServerToClient: string;
|
|
2724
|
+
encryptionClientToServer: string;
|
|
2725
|
+
encryptionServerToClient: string;
|
|
2726
|
+
kexAlgorithm: string;
|
|
2727
|
+
languageClientToServer?: string;
|
|
2728
|
+
languageServerToClient?: string;
|
|
2729
|
+
macClientToServer: string;
|
|
2730
|
+
macServerToClient: string;
|
|
2731
|
+
serverHostKeyAlgorithm: string;
|
|
2732
|
+
}
|
|
2733
|
+
/**
|
|
2734
|
+
* Baseline algorithm order for the initial native SSH transport implementation.
|
|
2735
|
+
*/
|
|
2736
|
+
declare const DEFAULT_SSH_ALGORITHM_PREFERENCES: Readonly<SshAlgorithmPreferences>;
|
|
2737
|
+
/**
|
|
2738
|
+
* Intersects client and server algorithm lists using SSH's client-priority selection model.
|
|
2739
|
+
*/
|
|
2740
|
+
declare function negotiateSshAlgorithms(client: SshAlgorithmPreferences, server: SshAlgorithmPreferences): NegotiatedSshAlgorithms;
|
|
2741
|
+
|
|
2742
|
+
/** Parsed SSH identification components from the RFC 4253 banner line. */
|
|
2743
|
+
interface SshIdentification {
|
|
2744
|
+
protocolVersion: string;
|
|
2745
|
+
softwareVersion: string;
|
|
2746
|
+
comments?: string;
|
|
2747
|
+
raw: string;
|
|
2748
|
+
}
|
|
2749
|
+
|
|
2750
|
+
/** Parsed SSH_MSG_KEXINIT payload. */
|
|
2751
|
+
interface SshKexInitMessage extends SshAlgorithmPreferences {
|
|
2752
|
+
cookie: Buffer$1;
|
|
2753
|
+
firstKexPacketFollows: boolean;
|
|
2754
|
+
messageType: number;
|
|
2755
|
+
reserved: number;
|
|
2756
|
+
}
|
|
2757
|
+
|
|
2758
|
+
/** Directional key material used after SSH NEWKEYS. */
|
|
2759
|
+
interface SshTransportDirectionKeys {
|
|
2760
|
+
encryptionKey: Buffer$1;
|
|
2761
|
+
iv: Buffer$1;
|
|
2762
|
+
macKey: Buffer$1;
|
|
2763
|
+
}
|
|
2764
|
+
/** Session key bundle derived from K, H, and session id. */
|
|
2765
|
+
interface SshDerivedSessionKeys {
|
|
2766
|
+
clientToServer: SshTransportDirectionKeys;
|
|
2767
|
+
exchangeHash: Buffer$1;
|
|
2768
|
+
serverToClient: SshTransportDirectionKeys;
|
|
2769
|
+
sessionId: Buffer$1;
|
|
2770
|
+
}
|
|
2771
|
+
|
|
2772
|
+
/** Initial client-side handshake state before key exchange math starts. */
|
|
2773
|
+
interface SshTransportHandshakeResult {
|
|
2774
|
+
keyExchange: {
|
|
2775
|
+
algorithm: string;
|
|
2776
|
+
clientKexInitPayload: Buffer$1;
|
|
2777
|
+
clientPublicKey: Buffer$1;
|
|
2778
|
+
exchangeHash: Buffer$1;
|
|
2779
|
+
serverHostKey: Buffer$1;
|
|
2780
|
+
serverKexInitPayload: Buffer$1;
|
|
2781
|
+
serverPublicKey: Buffer$1;
|
|
2782
|
+
serverSignature: Buffer$1;
|
|
2783
|
+
sessionId: Buffer$1;
|
|
2784
|
+
sharedSecret: Buffer$1;
|
|
2785
|
+
transportKeys: {
|
|
2786
|
+
clientToServer: SshDerivedSessionKeys["clientToServer"];
|
|
2787
|
+
serverToClient: SshDerivedSessionKeys["serverToClient"];
|
|
2788
|
+
};
|
|
2789
|
+
};
|
|
2790
|
+
negotiatedAlgorithms: NegotiatedSshAlgorithms;
|
|
2791
|
+
serverIdentification: SshIdentification;
|
|
2792
|
+
serverKexInit: SshKexInitMessage;
|
|
2793
|
+
/**
|
|
2794
|
+
* Number of unencrypted packets the client sent during the handshake (KEXINIT,
|
|
2795
|
+
* KEX_ECDH_INIT, NEWKEYS). Per RFC 4253 §6.4, packet sequence numbers are never
|
|
2796
|
+
* reset across NEWKEYS, so this value seeds the outbound protector.
|
|
2797
|
+
*/
|
|
2798
|
+
outboundPacketCount: number;
|
|
2799
|
+
/**
|
|
2800
|
+
* Number of unencrypted packets the client received from the server during the
|
|
2801
|
+
* handshake (server KEXINIT, KEX_ECDH_REPLY, NEWKEYS). Seeds the inbound unprotector.
|
|
2802
|
+
*/
|
|
2803
|
+
inboundPacketCount: number;
|
|
2804
|
+
}
|
|
2805
|
+
/**
|
|
2806
|
+
* Client-side SSH handshake coordinator for version exchange and KEXINIT negotiation.
|
|
2807
|
+
*/
|
|
2808
|
+
declare class SshTransportHandshake {
|
|
2809
|
+
private readonly options;
|
|
2810
|
+
private readonly clientAlgorithms;
|
|
2811
|
+
private readonly clientIdentificationLine;
|
|
2812
|
+
private readonly clientKexInitPayload;
|
|
2813
|
+
private readonly identificationLines;
|
|
2814
|
+
private readonly packetFramer;
|
|
2815
|
+
private readonly pendingIdentification;
|
|
2816
|
+
private phase;
|
|
2817
|
+
private inboundPacketCount;
|
|
2818
|
+
private outboundPacketCount;
|
|
2819
|
+
private pendingCurve25519;
|
|
2820
|
+
private pendingKeyExchange;
|
|
2821
|
+
private serverIdentification;
|
|
2822
|
+
constructor(options?: {
|
|
2823
|
+
algorithms?: SshAlgorithmPreferences;
|
|
2824
|
+
clientComments?: string;
|
|
2825
|
+
clientSoftwareVersion?: string;
|
|
2826
|
+
kexCookie?: Uint8Array;
|
|
2827
|
+
/**
|
|
2828
|
+
* Verifies the server's host key after the signature check passes.
|
|
2829
|
+
* Receives the SSH wire-format host key blob and its SHA-256 digest.
|
|
2830
|
+
* Throwing rejects the handshake; resolving accepts it.
|
|
2831
|
+
*
|
|
2832
|
+
* If omitted, the host key is accepted as long as its signature over the
|
|
2833
|
+
* exchange hash verifies. Callers SHOULD supply this hook in production
|
|
2834
|
+
* to enforce known_hosts or pinned-fingerprint policies.
|
|
2835
|
+
*/
|
|
2836
|
+
verifyHostKey?: (input: {
|
|
2837
|
+
hostKeyBlob: Buffer$1;
|
|
2838
|
+
hostKeySha256: Buffer$1;
|
|
2839
|
+
algorithmName: string;
|
|
2840
|
+
}) => void | Promise<void>;
|
|
2841
|
+
});
|
|
2842
|
+
/** Creates the first outbound bytes (client identification line). */
|
|
2843
|
+
createInitialClientBytes(): Buffer$1;
|
|
2844
|
+
/**
|
|
2845
|
+
* Feeds raw server bytes into the handshake state machine.
|
|
2846
|
+
*/
|
|
2847
|
+
pushServerBytes(chunk: Uint8Array): {
|
|
2848
|
+
outbound: Buffer$1[];
|
|
2849
|
+
result?: SshTransportHandshakeResult;
|
|
2850
|
+
};
|
|
2851
|
+
getServerBannerLines(): readonly string[];
|
|
2852
|
+
isComplete(): boolean;
|
|
2853
|
+
/**
|
|
2854
|
+
* Returns any bytes received after the last complete handshake packet and clears the buffer.
|
|
2855
|
+
* Call this once after `pushServerBytes` returns a result to drain bytes that belong to the
|
|
2856
|
+
* post-NEWKEYS encrypted phase but arrived in the same TCP segment as NEWKEYS.
|
|
2857
|
+
*/
|
|
2858
|
+
takeRemainingBytes(): Buffer$1;
|
|
2859
|
+
private pushServerBytesWithPhase;
|
|
2860
|
+
}
|
|
2861
|
+
|
|
2862
|
+
/** Standard SSH disconnect reason codes (RFC 4253 §11.1). */
|
|
2863
|
+
declare const SshDisconnectReason: {
|
|
2864
|
+
readonly HOST_NOT_ALLOWED_TO_CONNECT: 1;
|
|
2865
|
+
readonly PROTOCOL_ERROR: 2;
|
|
2866
|
+
readonly KEY_EXCHANGE_FAILED: 3;
|
|
2867
|
+
readonly MAC_ERROR: 5;
|
|
2868
|
+
readonly COMPRESSION_ERROR: 6;
|
|
2869
|
+
readonly SERVICE_NOT_AVAILABLE: 7;
|
|
2870
|
+
readonly PROTOCOL_VERSION_NOT_SUPPORTED: 8;
|
|
2871
|
+
readonly HOST_KEY_NOT_VERIFIABLE: 9;
|
|
2872
|
+
readonly CONNECTION_LOST: 10;
|
|
2873
|
+
readonly BY_APPLICATION: 11;
|
|
2874
|
+
readonly TOO_MANY_CONNECTIONS: 12;
|
|
2875
|
+
readonly AUTH_CANCELLED_BY_USER: 13;
|
|
2876
|
+
readonly NO_MORE_AUTH_METHODS: 14;
|
|
2877
|
+
readonly ILLEGAL_USER_NAME: 15;
|
|
2878
|
+
};
|
|
2879
|
+
type SshDisconnectReason = (typeof SshDisconnectReason)[keyof typeof SshDisconnectReason];
|
|
2880
|
+
interface SshTransportConnectionOptions {
|
|
2881
|
+
/** AbortSignal that cancels the in-flight `connect()` call and tears down the socket. */
|
|
2882
|
+
abortSignal?: AbortSignal;
|
|
2883
|
+
/** Algorithm preference overrides. Defaults to the library defaults. */
|
|
2884
|
+
algorithms?: SshAlgorithmPreferences;
|
|
2885
|
+
/** SSH software version string embedded in the identification line. */
|
|
2886
|
+
clientSoftwareVersion?: string;
|
|
2887
|
+
/**
|
|
2888
|
+
* Hard cap (milliseconds) on the SSH identification + key exchange + first
|
|
2889
|
+
* NEWKEYS handshake. If exceeded the socket is destroyed and `connect()`
|
|
2890
|
+
* rejects with a `TimeoutError`. Has no effect once `connect()` resolves.
|
|
2891
|
+
*/
|
|
2892
|
+
handshakeTimeoutMs?: number;
|
|
2893
|
+
/**
|
|
2894
|
+
* If set, sends a `SSH_MSG_IGNORE` packet every `keepaliveIntervalMs`
|
|
2895
|
+
* milliseconds while the transport is connected and idle. This prevents
|
|
2896
|
+
* stateful NAT / firewall devices from dropping long-lived idle sessions
|
|
2897
|
+
* (e.g. between batches in a transfer queue). The timer is reset on every
|
|
2898
|
+
* outbound payload, so active transfers do not generate extra traffic.
|
|
2899
|
+
*/
|
|
2900
|
+
keepaliveIntervalMs?: number;
|
|
2901
|
+
/**
|
|
2902
|
+
* Synchronous host-key policy hook invoked after the signature on the SSH
|
|
2903
|
+
* exchange hash is verified. Throw to reject the server's identity.
|
|
2904
|
+
*/
|
|
2905
|
+
verifyHostKey?: (input: {
|
|
2906
|
+
hostKeyBlob: Buffer$1;
|
|
2907
|
+
hostKeySha256: Buffer$1;
|
|
2908
|
+
algorithmName: string;
|
|
2909
|
+
}) => void;
|
|
2910
|
+
}
|
|
2911
|
+
/**
|
|
2912
|
+
* Live SSH transport connection over a TCP socket.
|
|
2913
|
+
*
|
|
2914
|
+
* Runs the SSH identification exchange and key exchange handshake on the supplied socket,
|
|
2915
|
+
* then provides an encrypted packet send/receive interface for higher-level SSH layers
|
|
2916
|
+
* (authentication, connection, SFTP subsystem).
|
|
2917
|
+
*
|
|
2918
|
+
* Usage:
|
|
2919
|
+
* ```ts
|
|
2920
|
+
* const conn = new SshTransportConnection();
|
|
2921
|
+
* const result = await conn.connect(socket); // runs handshake
|
|
2922
|
+
* conn.sendPayload(payload); // post-NEWKEYS send
|
|
2923
|
+
* for await (const payload of conn.receivePayloads()) { ... }
|
|
2924
|
+
* conn.disconnect();
|
|
2925
|
+
* ```
|
|
2926
|
+
*/
|
|
2927
|
+
declare class SshTransportConnection {
|
|
2928
|
+
private readonly options;
|
|
2929
|
+
private connected;
|
|
2930
|
+
private disposed;
|
|
2931
|
+
private protector;
|
|
2932
|
+
private unprotector;
|
|
2933
|
+
private socket;
|
|
2934
|
+
private keepaliveTimer;
|
|
2935
|
+
private readonly inboundQueue;
|
|
2936
|
+
/**
|
|
2937
|
+
* FIFO of waiters when the queue is empty. Multiple iterators may suspend on
|
|
2938
|
+
* the same transport (auth session, channel setup, connection-manager pump);
|
|
2939
|
+
* each receives exactly one entry in arrival order. A single-slot field would
|
|
2940
|
+
* lose wakeups when a second consumer suspends before the first is resolved.
|
|
2941
|
+
*/
|
|
2942
|
+
private readonly waitingConsumers;
|
|
2943
|
+
constructor(options?: SshTransportConnectionOptions);
|
|
2944
|
+
/**
|
|
2945
|
+
* Runs the SSH handshake on a TCP-connected socket.
|
|
2946
|
+
* Resolves when NEWKEYS completes and the transport is ready for encrypted messages.
|
|
2947
|
+
* Rejects on socket error, abort, or protocol failure.
|
|
2948
|
+
*/
|
|
2949
|
+
connect(socket: Socket): Promise<SshTransportHandshakeResult>;
|
|
2950
|
+
/**
|
|
2951
|
+
* Sends an SSH payload over the encrypted transport.
|
|
2952
|
+
* The payload must start with the SSH message type byte.
|
|
2953
|
+
*/
|
|
2954
|
+
sendPayload(payload: Buffer$1 | Uint8Array): void;
|
|
2955
|
+
/**
|
|
2956
|
+
* Async generator that yields inbound SSH payloads (post-NEWKEYS).
|
|
2957
|
+
*
|
|
2958
|
+
* Transparent handling:
|
|
2959
|
+
* - SSH_MSG_IGNORE (2) and SSH_MSG_DEBUG (4) are silently dropped.
|
|
2960
|
+
* - SSH_MSG_DISCONNECT (1) from the server throws a `ConnectionError`.
|
|
2961
|
+
* - Socket error or close terminates the generator.
|
|
2962
|
+
*/
|
|
2963
|
+
receivePayloads(): AsyncGenerator<Buffer$1>;
|
|
2964
|
+
/**
|
|
2965
|
+
* Sends SSH_MSG_DISCONNECT and ends the socket.
|
|
2966
|
+
* Safe to call multiple times; subsequent calls are no-ops.
|
|
2967
|
+
*/
|
|
2968
|
+
disconnect(reason?: SshDisconnectReason, description?: string): void;
|
|
2969
|
+
isConnected(): boolean;
|
|
2970
|
+
private onEncryptedData;
|
|
2971
|
+
private onSocketError;
|
|
2972
|
+
private onSocketClose;
|
|
2973
|
+
private enqueueEntry;
|
|
2974
|
+
private dequeuePayload;
|
|
2975
|
+
private assertConnected;
|
|
2976
|
+
private startKeepalive;
|
|
2977
|
+
private stopKeepalive;
|
|
2978
|
+
private resetKeepaliveTimer;
|
|
2979
|
+
private sendKeepalivePing;
|
|
2980
|
+
}
|
|
2981
|
+
|
|
2982
|
+
interface SshPasswordCredential {
|
|
2983
|
+
type: "password";
|
|
2984
|
+
username: string;
|
|
2985
|
+
password: string;
|
|
2986
|
+
}
|
|
2987
|
+
interface SshPublickeyCredential {
|
|
2988
|
+
type: "publickey";
|
|
2989
|
+
username: string;
|
|
2990
|
+
algorithmName: string;
|
|
2991
|
+
/** Raw public key blob in SSH wire format (e.g. the bytes returned by ssh-keygen -e -f key.pub). */
|
|
2992
|
+
publicKeyBlob: Uint8Array;
|
|
2993
|
+
/**
|
|
2994
|
+
* Signs the challenge data. The data is already the complete sign-data per RFC 4252 §7.
|
|
2995
|
+
* Should return the signature blob (without algorithm prefix; caller adds wrapping).
|
|
2996
|
+
*/
|
|
2997
|
+
sign: (data: Uint8Array) => Promise<Uint8Array> | Uint8Array;
|
|
2998
|
+
}
|
|
2999
|
+
interface SshKeyboardInteractiveCredential {
|
|
3000
|
+
type: "keyboard-interactive";
|
|
3001
|
+
username: string;
|
|
3002
|
+
/**
|
|
3003
|
+
* Called for each INFO_REQUEST round. Return one string per prompt in order.
|
|
3004
|
+
*/
|
|
3005
|
+
respond: (name: string, instruction: string, prompts: Array<{
|
|
3006
|
+
echo: boolean;
|
|
3007
|
+
prompt: string;
|
|
3008
|
+
}>) => Promise<string[]> | string[];
|
|
3009
|
+
}
|
|
3010
|
+
type SshCredential = SshPasswordCredential | SshPublickeyCredential | SshKeyboardInteractiveCredential;
|
|
3011
|
+
interface SshAuthOptions {
|
|
3012
|
+
credential: SshCredential;
|
|
3013
|
+
/** SSH session id (exchange hash) from key exchange — required for publickey signing. */
|
|
3014
|
+
sessionId: Uint8Array;
|
|
3015
|
+
/** Maximum number of USERAUTH_FAILURE retries before giving up. Defaults to 4. */
|
|
3016
|
+
maxAttempts?: number;
|
|
3017
|
+
}
|
|
3018
|
+
interface SshAuthResult {
|
|
3019
|
+
/** Banner lines received from the server during authentication. */
|
|
3020
|
+
bannerLines: string[];
|
|
3021
|
+
/** Auth method that succeeded. */
|
|
3022
|
+
method: string;
|
|
3023
|
+
}
|
|
3024
|
+
/**
|
|
3025
|
+
* Runs SSH user authentication over an encrypted transport connection.
|
|
3026
|
+
*
|
|
3027
|
+
* Call this after `SshTransportConnection.connect()` completes.
|
|
3028
|
+
* Returns a generator of inbound payloads for the upper (connection) layer to consume.
|
|
3029
|
+
* Resolves with an `SshAuthResult` on success; throws `AuthenticationError` on failure.
|
|
3030
|
+
*/
|
|
3031
|
+
declare class SshAuthSession {
|
|
3032
|
+
private readonly transport;
|
|
3033
|
+
constructor(transport: SshTransportConnection);
|
|
3034
|
+
authenticate(options: SshAuthOptions): Promise<SshAuthResult>;
|
|
3035
|
+
private runKeyboardInteractiveRounds;
|
|
3036
|
+
private pendingPayload;
|
|
3037
|
+
private nextPayload;
|
|
3038
|
+
private nextPayloadSkippingBanners;
|
|
3039
|
+
}
|
|
3040
|
+
|
|
3041
|
+
interface BuildPublickeyCredentialOptions {
|
|
3042
|
+
/** Username to authenticate as. */
|
|
3043
|
+
username: string;
|
|
3044
|
+
/** Decoded private key (OpenSSH or PKCS8 PEM accepted by `crypto.createPrivateKey`). */
|
|
3045
|
+
privateKey: KeyObject;
|
|
3046
|
+
/**
|
|
3047
|
+
* For RSA keys, the SSH signature algorithm. Defaults to `rsa-sha2-512`.
|
|
3048
|
+
* Ignored for Ed25519 keys.
|
|
3049
|
+
*/
|
|
3050
|
+
rsaSignatureAlgorithm?: "rsa-sha2-256" | "rsa-sha2-512";
|
|
3051
|
+
}
|
|
3052
|
+
declare function buildPublickeyCredential(options: BuildPublickeyCredentialOptions): SshPublickeyCredential;
|
|
3053
|
+
|
|
3054
|
+
/**
|
|
3055
|
+
* SSH session channel (RFC 4254 §6).
|
|
3056
|
+
*
|
|
3057
|
+
* Manages a single "session" channel from the client side:
|
|
3058
|
+
* CHANNEL_OPEN → OPEN_CONFIRMATION → CHANNEL_REQUEST (subsystem/exec) →
|
|
3059
|
+
* bidirectional CHANNEL_DATA with window management → CHANNEL_EOF/CLOSE.
|
|
3060
|
+
*
|
|
3061
|
+
* Window management strategy:
|
|
3062
|
+
* - Local window starts at INITIAL_WINDOW_SIZE.
|
|
3063
|
+
* - When consumed bytes exceed WINDOW_REFILL_THRESHOLD, a WINDOW_ADJUST is sent.
|
|
3064
|
+
* - Outbound data respects the remote window; excess is queued and flushed
|
|
3065
|
+
* as the remote issues WINDOW_ADJUST messages.
|
|
3066
|
+
*/
|
|
3067
|
+
|
|
3068
|
+
interface SshSessionChannelOptions {
|
|
3069
|
+
/**
|
|
3070
|
+
* Local channel id allocated by the caller.
|
|
3071
|
+
* If omitted, defaults to 0 (single-channel use case).
|
|
3072
|
+
*/
|
|
3073
|
+
localChannelId?: number;
|
|
3074
|
+
}
|
|
3075
|
+
/**
|
|
3076
|
+
* A single SSH session channel.
|
|
3077
|
+
* Not safe to share across concurrent callers; each SftpSession should own one.
|
|
3078
|
+
*/
|
|
3079
|
+
declare class SshSessionChannel {
|
|
3080
|
+
private readonly transport;
|
|
3081
|
+
private phase;
|
|
3082
|
+
/** Remote channel id assigned by the server in OPEN_CONFIRMATION. */
|
|
3083
|
+
private remoteChannelId;
|
|
3084
|
+
/** Bytes the remote side can still receive before we must stop sending. */
|
|
3085
|
+
private remoteWindowRemaining;
|
|
3086
|
+
/** Maximum packet data size the remote accepts. */
|
|
3087
|
+
private remoteMaxPacketSize;
|
|
3088
|
+
/** Local window: bytes we can still accept from remote. */
|
|
3089
|
+
private localWindowConsumed;
|
|
3090
|
+
private localWindowSize;
|
|
3091
|
+
/** Queue of inbound data for the `receiveData()` generator. */
|
|
3092
|
+
private readonly inboundQueue;
|
|
3093
|
+
private waitingConsumer;
|
|
3094
|
+
/** Queue of outbound data waiting for remote window space. */
|
|
3095
|
+
private readonly outboundQueue;
|
|
3096
|
+
/**
|
|
3097
|
+
* FIFO of waiters blocked on remote window credit. Each WINDOW_ADJUST wakes
|
|
3098
|
+
* exactly one waiter; concurrent senders must not lose wakeups.
|
|
3099
|
+
*/
|
|
3100
|
+
private readonly outboundDrainedWaiters;
|
|
3101
|
+
/** Serializes sendData() calls so byte order on the wire matches call order. */
|
|
3102
|
+
private sendChain;
|
|
3103
|
+
private readonly localChannelId;
|
|
3104
|
+
constructor(transport: SshTransportConnection, options?: SshSessionChannelOptions);
|
|
3105
|
+
/**
|
|
3106
|
+
* Opens the channel and requests a subsystem.
|
|
3107
|
+
* Resolves once the server confirms both CHANNEL_OPEN and the subsystem request.
|
|
3108
|
+
*/
|
|
3109
|
+
openSubsystem(subsystemName: string): Promise<void>;
|
|
3110
|
+
/**
|
|
3111
|
+
* Opens the channel and executes a command.
|
|
3112
|
+
*/
|
|
3113
|
+
openExec(command: string): Promise<void>;
|
|
3114
|
+
private openChannel;
|
|
3115
|
+
private requestSubsystem;
|
|
3116
|
+
private requestExec;
|
|
3117
|
+
private awaitChannelRequestReply;
|
|
3118
|
+
/**
|
|
3119
|
+
* Sends data on the channel. Respects the remote window; if there is no space,
|
|
3120
|
+
* splits the data and queues the remainder for when WINDOW_ADJUST arrives.
|
|
3121
|
+
*
|
|
3122
|
+
* Concurrent calls are serialized so wire byte order matches call order.
|
|
3123
|
+
*/
|
|
3124
|
+
sendData(data: Uint8Array): Promise<void>;
|
|
3125
|
+
private sendDataLocked;
|
|
3126
|
+
/**
|
|
3127
|
+
* Async generator that yields raw data buffers from the channel.
|
|
3128
|
+
* Returns (done) when the channel receives EOF or CLOSE.
|
|
3129
|
+
*/
|
|
3130
|
+
receiveData(): AsyncGenerator<Buffer$1, void, undefined>;
|
|
3131
|
+
/**
|
|
3132
|
+
* Sends EOF and CLOSE. Should be called when the client is done sending.
|
|
3133
|
+
*/
|
|
3134
|
+
close(): void;
|
|
3135
|
+
/**
|
|
3136
|
+
* Feed an inbound transport payload to this channel.
|
|
3137
|
+
* Called by the channel multiplexer (`SshConnectionManager`).
|
|
3138
|
+
*/
|
|
3139
|
+
dispatch(payload: Buffer$1): void;
|
|
3140
|
+
dispatchError(error: Error): void;
|
|
3141
|
+
private consumeLocalWindow;
|
|
3142
|
+
private enqueueInbound;
|
|
3143
|
+
private dequeueInbound;
|
|
3144
|
+
/** Pull the next payload from the transport (used during channel setup only). */
|
|
3145
|
+
private nextPayload;
|
|
3146
|
+
}
|
|
3147
|
+
|
|
3148
|
+
/**
|
|
3149
|
+
* SSH connection protocol manager (RFC 4254).
|
|
3150
|
+
*
|
|
3151
|
+
* Drives the transport-level `receivePayloads()` generator and dispatches each
|
|
3152
|
+
* payload to the right `SshSessionChannel` by recipient channel id.
|
|
3153
|
+
*
|
|
3154
|
+
* Lifecycle:
|
|
3155
|
+
* 1. Create after auth succeeds.
|
|
3156
|
+
* 2. Call `openSubsystemChannel("sftp")` or `openExecChannel(cmd)` to get a channel.
|
|
3157
|
+
* 3. Drive the pump: `start()` returns a Promise that resolves when the transport
|
|
3158
|
+
* closes cleanly or rejects on a fatal error.
|
|
3159
|
+
*/
|
|
3160
|
+
|
|
3161
|
+
declare class SshConnectionManager {
|
|
3162
|
+
private readonly transport;
|
|
3163
|
+
private readonly channels;
|
|
3164
|
+
private nextLocalId;
|
|
3165
|
+
private pumpPromise;
|
|
3166
|
+
private pumpResolve;
|
|
3167
|
+
private pumpReject;
|
|
3168
|
+
/** Payloads that arrived before any channel registered (buffered for the first channel). */
|
|
3169
|
+
private readonly pendingSetupPayloads;
|
|
3170
|
+
private setupPayloadConsumer;
|
|
3171
|
+
constructor(transport: SshTransportConnection);
|
|
3172
|
+
/**
|
|
3173
|
+
* Delivers the next connection-layer payload to callers during channel setup.
|
|
3174
|
+
* Called by `SshSessionChannel` during `openChannel()` / `requestSubsystem()`.
|
|
3175
|
+
*
|
|
3176
|
+
* Channel setup happens sequentially before `start()` begins pumping, so we
|
|
3177
|
+
* pull directly from the transport iterator here.
|
|
3178
|
+
*/
|
|
3179
|
+
nextSetupPayload(): Promise<Buffer$1>;
|
|
3180
|
+
/**
|
|
3181
|
+
* Opens a session channel and starts the SFTP subsystem on it.
|
|
3182
|
+
* Must be called before `start()`.
|
|
3183
|
+
*/
|
|
3184
|
+
openSubsystemChannel(subsystemName: string): Promise<SshSessionChannel>;
|
|
3185
|
+
/**
|
|
3186
|
+
* Opens a session channel and runs the given command on it.
|
|
3187
|
+
* Must be called before `start()`.
|
|
3188
|
+
*/
|
|
3189
|
+
openExecChannel(command: string): Promise<SshSessionChannel>;
|
|
3190
|
+
/**
|
|
3191
|
+
* Starts the main dispatch loop. Returns a Promise that resolves when the
|
|
3192
|
+
* connection closes cleanly, or rejects on a fatal transport error.
|
|
3193
|
+
*
|
|
3194
|
+
* Call this after all channels have been opened and the application is ready
|
|
3195
|
+
* to receive data.
|
|
3196
|
+
*/
|
|
3197
|
+
start(): Promise<void>;
|
|
3198
|
+
/**
|
|
3199
|
+
* Runs channel setup (open + request) with a dedicated payload pump that
|
|
3200
|
+
* pulls from the transport iterator and dispatches non-channel-setup messages
|
|
3201
|
+
* to `pendingSetupPayloads` for later processing.
|
|
3202
|
+
*/
|
|
3203
|
+
private runChannelSetup;
|
|
3204
|
+
private pump;
|
|
3205
|
+
private dispatch;
|
|
3206
|
+
private terminateChannels;
|
|
3207
|
+
}
|
|
3208
|
+
|
|
3209
|
+
/**
|
|
3210
|
+
* Stateful SSH primitive decoder that reads sequential values from a packet payload.
|
|
3211
|
+
*/
|
|
3212
|
+
declare class SshDataReader {
|
|
3213
|
+
private readonly source;
|
|
3214
|
+
private offset;
|
|
3215
|
+
constructor(source: Uint8Array);
|
|
3216
|
+
get remaining(): number;
|
|
3217
|
+
hasMore(): boolean;
|
|
3218
|
+
readByte(): number;
|
|
3219
|
+
readBoolean(): boolean;
|
|
3220
|
+
readBytes(length: number): Buffer$1;
|
|
3221
|
+
readUint32(): number;
|
|
3222
|
+
readUint64(): bigint;
|
|
3223
|
+
readString(): Buffer$1;
|
|
3224
|
+
readUtf8String(): string;
|
|
3225
|
+
readNameList(): string[];
|
|
3226
|
+
/**
|
|
3227
|
+
* Reads an SSH `mpint` value (RFC 4251 §5): a length-prefixed two's-complement
|
|
3228
|
+
* big-endian integer. Returns the raw magnitude bytes (non-negative integers
|
|
3229
|
+
* may have a leading 0x00 byte preserved by the caller as needed).
|
|
3230
|
+
*/
|
|
3231
|
+
readMpint(): Buffer$1;
|
|
3232
|
+
assertFinished(): void;
|
|
3233
|
+
private ensureAvailable;
|
|
3234
|
+
}
|
|
3235
|
+
|
|
3236
|
+
/**
|
|
3237
|
+
* Minimal SSH primitive encoder for transport and authentication packets.
|
|
3238
|
+
*/
|
|
3239
|
+
declare class SshDataWriter {
|
|
3240
|
+
private readonly chunks;
|
|
3241
|
+
private length;
|
|
3242
|
+
writeByte(value: number): this;
|
|
3243
|
+
writeBoolean(value: boolean): this;
|
|
3244
|
+
writeBytes(value: Uint8Array): this;
|
|
3245
|
+
writeUint32(value: number): this;
|
|
3246
|
+
writeUint64(value: bigint): this;
|
|
3247
|
+
writeString(value: string | Uint8Array, encoding?: BufferEncoding): this;
|
|
3248
|
+
writeMpint(value: Uint8Array): this;
|
|
3249
|
+
writeNameList(values: readonly string[]): this;
|
|
3250
|
+
toBuffer(): Buffer$1;
|
|
3251
|
+
private push;
|
|
3252
|
+
private assertByte;
|
|
3253
|
+
}
|
|
3254
|
+
|
|
2571
3255
|
/**
|
|
2572
3256
|
* FTPS control-channel TLS mode.
|
|
2573
3257
|
*
|
|
@@ -2822,71 +3506,246 @@ declare function parseMlsdLine(line: string, directory?: string): RemoteEntry;
|
|
|
2822
3506
|
*/
|
|
2823
3507
|
declare function parseMlstTimestamp(input: string | undefined): Date | undefined;
|
|
2824
3508
|
|
|
2825
|
-
/**
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
3509
|
+
/**
|
|
3510
|
+
* SFTP v3 file attribute encoding and decoding (draft-ietf-secsh-filexfer-02 §5).
|
|
3511
|
+
*
|
|
3512
|
+
* ATTRS flags:
|
|
3513
|
+
* SSH_FILEXFER_ATTR_SIZE 0x00000001
|
|
3514
|
+
* SSH_FILEXFER_ATTR_UIDGID 0x00000002
|
|
3515
|
+
* SSH_FILEXFER_ATTR_PERMISSIONS 0x00000004
|
|
3516
|
+
* SSH_FILEXFER_ATTR_ACMODTIME 0x00000008
|
|
3517
|
+
* SSH_FILEXFER_ATTR_EXTENDED 0x80000000
|
|
3518
|
+
*/
|
|
3519
|
+
|
|
3520
|
+
interface SftpFileAttributes {
|
|
3521
|
+
/** File size in bytes. Present when SFTP_ATTR_FLAG.SIZE is set. */
|
|
3522
|
+
size?: bigint;
|
|
3523
|
+
/** User id. Present when SFTP_ATTR_FLAG.UIDGID is set. */
|
|
3524
|
+
uid?: number;
|
|
3525
|
+
/** Group id. Present when SFTP_ATTR_FLAG.UIDGID is set. */
|
|
3526
|
+
gid?: number;
|
|
3527
|
+
/** POSIX file permissions (octal mode). Present when SFTP_ATTR_FLAG.PERMISSIONS is set. */
|
|
3528
|
+
permissions?: number;
|
|
3529
|
+
/** Access time (seconds since Unix epoch). Present when SFTP_ATTR_FLAG.ACMODTIME is set. */
|
|
3530
|
+
atime?: number;
|
|
3531
|
+
/** Modification time (seconds since Unix epoch). Present when SFTP_ATTR_FLAG.ACMODTIME is set. */
|
|
3532
|
+
mtime?: number;
|
|
3533
|
+
/**
|
|
3534
|
+
* Extended attributes as key-value pairs.
|
|
3535
|
+
* Present when SFTP_ATTR_FLAG.EXTENDED is set.
|
|
3536
|
+
*/
|
|
3537
|
+
extended?: Array<{
|
|
3538
|
+
type: string;
|
|
3539
|
+
data: Buffer$1;
|
|
3540
|
+
}>;
|
|
3541
|
+
}
|
|
3542
|
+
|
|
3543
|
+
/**
|
|
3544
|
+
* SFTP v3 request and response message codecs (draft-ietf-secsh-filexfer-02).
|
|
3545
|
+
*
|
|
3546
|
+
* Each encode function produces the payload bytes that go inside an
|
|
3547
|
+
* SSH_FXP_* packet (the type byte and length prefix are added by the framer).
|
|
3548
|
+
*
|
|
3549
|
+
* Each decode function accepts the full framed packet payload (starting at the
|
|
3550
|
+
* byte immediately after the type byte, i.e. at request-id).
|
|
3551
|
+
*/
|
|
3552
|
+
|
|
3553
|
+
interface SftpVersionResponse {
|
|
3554
|
+
version: number;
|
|
3555
|
+
extensions: Array<{
|
|
3556
|
+
name: string;
|
|
3557
|
+
data: string;
|
|
3558
|
+
}>;
|
|
3559
|
+
}
|
|
3560
|
+
/** A single entry returned by SSH_FXP_NAME. */
|
|
3561
|
+
interface SftpNameEntry {
|
|
3562
|
+
filename: string;
|
|
3563
|
+
longname: string;
|
|
3564
|
+
attrs: SftpFileAttributes;
|
|
3565
|
+
}
|
|
3566
|
+
|
|
3567
|
+
/**
|
|
3568
|
+
* SFTP v3 client session (draft-ietf-secsh-filexfer-02).
|
|
3569
|
+
*
|
|
3570
|
+
* Provides a fully concurrent, typed API over an open SSH session channel.
|
|
3571
|
+
* Multiple requests can be in flight simultaneously; each is tracked by its
|
|
3572
|
+
* SFTP request id. Responses are dispatched to the correct awaiter.
|
|
3573
|
+
*
|
|
3574
|
+
* Lifecycle:
|
|
3575
|
+
* const channel = await connectionManager.openSubsystemChannel("sftp");
|
|
3576
|
+
* const sftp = new SftpSession(channel);
|
|
3577
|
+
* await sftp.init();
|
|
3578
|
+
* const handle = await sftp.open("/path/to/file", SFTP_OPEN_FLAG.READ, {});
|
|
3579
|
+
* const data = await sftp.read(handle, 0n, 4096);
|
|
3580
|
+
* await sftp.close(handle);
|
|
3581
|
+
*/
|
|
3582
|
+
|
|
3583
|
+
declare class SftpSession {
|
|
3584
|
+
private readonly channel;
|
|
3585
|
+
private nextRequestId;
|
|
3586
|
+
private readonly pending;
|
|
3587
|
+
private readonly framer;
|
|
3588
|
+
/** Resolves on the first packet (VERSION) during init(). */
|
|
3589
|
+
private versionWaiter;
|
|
3590
|
+
private serverVersion;
|
|
3591
|
+
constructor(channel: SshSessionChannel);
|
|
3592
|
+
/**
|
|
3593
|
+
* Sends SSH_FXP_INIT and awaits SSH_FXP_VERSION.
|
|
3594
|
+
* Must be called once before any other operation.
|
|
3595
|
+
*/
|
|
3596
|
+
init(): Promise<SftpVersionResponse>;
|
|
3597
|
+
get negotiatedVersion(): number;
|
|
3598
|
+
/**
|
|
3599
|
+
* Opens a remote file. Returns an opaque handle buffer.
|
|
3600
|
+
*/
|
|
3601
|
+
open(path: string, pflags: number, attrs?: SftpFileAttributes): Promise<Buffer$1>;
|
|
3602
|
+
/**
|
|
3603
|
+
* Closes a file or directory handle.
|
|
3604
|
+
*/
|
|
3605
|
+
close(handle: Uint8Array): Promise<void>;
|
|
3606
|
+
/**
|
|
3607
|
+
* Reads up to `length` bytes from `handle` at `offset`.
|
|
3608
|
+
* Returns `null` on EOF.
|
|
3609
|
+
*/
|
|
3610
|
+
read(handle: Uint8Array, offset: bigint, length: number): Promise<Buffer$1 | null>;
|
|
3611
|
+
/**
|
|
3612
|
+
* Writes `data` to `handle` at `offset`.
|
|
3613
|
+
*/
|
|
3614
|
+
write(handle: Uint8Array, offset: bigint, data: Uint8Array): Promise<void>;
|
|
3615
|
+
stat(path: string): Promise<SftpFileAttributes>;
|
|
3616
|
+
lstat(path: string): Promise<SftpFileAttributes>;
|
|
3617
|
+
fstat(handle: Uint8Array): Promise<SftpFileAttributes>;
|
|
3618
|
+
setstat(path: string, attrs: SftpFileAttributes): Promise<void>;
|
|
3619
|
+
fsetstat(handle: Uint8Array, attrs: SftpFileAttributes): Promise<void>;
|
|
3620
|
+
opendir(path: string): Promise<Buffer$1>;
|
|
3621
|
+
/**
|
|
3622
|
+
* Reads one batch of directory entries.
|
|
3623
|
+
* Returns an empty array when the server sends SSH_FX_EOF.
|
|
3624
|
+
*/
|
|
3625
|
+
readdir(handle: Uint8Array): Promise<SftpNameEntry[]>;
|
|
3626
|
+
/**
|
|
3627
|
+
* Convenience: opens a directory, reads all entries, and closes the handle.
|
|
3628
|
+
*/
|
|
3629
|
+
readdirAll(path: string): Promise<SftpNameEntry[]>;
|
|
3630
|
+
remove(path: string): Promise<void>;
|
|
3631
|
+
mkdir(path: string, attrs?: SftpFileAttributes): Promise<void>;
|
|
3632
|
+
rmdir(path: string): Promise<void>;
|
|
3633
|
+
realpath(path: string): Promise<string>;
|
|
3634
|
+
rename(oldPath: string, newPath: string): Promise<void>;
|
|
3635
|
+
readlink(path: string): Promise<string>;
|
|
3636
|
+
symlink(linkPath: string, targetPath: string): Promise<void>;
|
|
3637
|
+
private allocRequestId;
|
|
3638
|
+
/**
|
|
3639
|
+
* Sends raw SFTP message bytes over the channel.
|
|
3640
|
+
* The message encoders embed the type byte at position 0, followed by the body.
|
|
3641
|
+
* We prefix with a uint32 length so the remote SFTP framer can parse the frame.
|
|
3642
|
+
*
|
|
3643
|
+
* Send is asynchronous because the underlying SSH channel may apply
|
|
3644
|
+
* backpressure when the remote window is exhausted; the channel itself
|
|
3645
|
+
* serializes concurrent calls so byte ordering is preserved.
|
|
3646
|
+
*/
|
|
3647
|
+
private sendRaw;
|
|
3648
|
+
private pump;
|
|
3649
|
+
private dispatchPacket;
|
|
3650
|
+
private awaitResponse;
|
|
3651
|
+
}
|
|
3652
|
+
|
|
3653
|
+
/**
|
|
3654
|
+
* Options for {@link createNativeSftpProviderFactory}.
|
|
3655
|
+
*
|
|
3656
|
+
* The native provider is a zero-dependency replacement for the legacy
|
|
3657
|
+
* `ssh2`-backed provider. It implements RFC 4253 SSH transport, RFC 4252 user
|
|
3658
|
+
* authentication (`password`, `keyboard-interactive`, `publickey` with
|
|
3659
|
+
* Ed25519/RSA), RFC 5656 ECDSA host keys (`nistp256/384/521`), and the
|
|
3660
|
+
* SFTP v3 client protocol multiplexed over a single channel.
|
|
3661
|
+
*/
|
|
3662
|
+
interface NativeSftpProviderOptions {
|
|
3663
|
+
/**
|
|
3664
|
+
* Default connection timeout in milliseconds when the profile omits
|
|
3665
|
+
* `timeoutMs`. Bounds both the TCP connect *and* the SSH identification +
|
|
3666
|
+
* key-exchange handshake, so a hung server cannot stall `connect()`
|
|
3667
|
+
* indefinitely after the socket is accepted.
|
|
3668
|
+
*/
|
|
2832
3669
|
readyTimeoutMs?: number;
|
|
3670
|
+
/**
|
|
3671
|
+
* Default interval (milliseconds) between SSH-level keepalive pings sent
|
|
3672
|
+
* once the transport is connected and idle. Prevents stateful firewalls /
|
|
3673
|
+
* NAT devices from dropping long-lived sessions. The timer is reset on
|
|
3674
|
+
* every outbound payload so active transfers do not generate extra
|
|
3675
|
+
* traffic. Disabled when omitted or `0`.
|
|
3676
|
+
*/
|
|
3677
|
+
keepaliveIntervalMs?: number;
|
|
3678
|
+
/**
|
|
3679
|
+
* Maximum concurrent file-transfer operations the engine should schedule
|
|
3680
|
+
* against a single SFTP session. Each in-flight read/write occupies an
|
|
3681
|
+
* outstanding SFTP request slot multiplexed over the same SSH channel; the
|
|
3682
|
+
* default of `8` keeps memory bounded on commodity servers, but high-RTT
|
|
3683
|
+
* links and modern OpenSSH builds can comfortably handle 16\u201364. Must be
|
|
3684
|
+
* a positive integer.
|
|
3685
|
+
*/
|
|
3686
|
+
maxConcurrency?: number;
|
|
2833
3687
|
}
|
|
2834
|
-
/**
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
3688
|
+
/**
|
|
3689
|
+
* Low-level handles exposed by a native SFTP session for diagnostics and
|
|
3690
|
+
* advanced extension. Most applications should use the
|
|
3691
|
+
* {@link TransferSession} returned from `client.connect()` instead.
|
|
3692
|
+
*/
|
|
3693
|
+
interface NativeSftpRawSession {
|
|
3694
|
+
/** SFTP v3 client multiplexed over the SSH session channel. */
|
|
3695
|
+
sftp: SftpSession;
|
|
3696
|
+
/** Underlying SSH transport (key exchange, packet protection, channel mux). */
|
|
3697
|
+
transport: SshTransportConnection;
|
|
2840
3698
|
}
|
|
2841
3699
|
/**
|
|
2842
|
-
* Creates
|
|
3700
|
+
* Creates a {@link ProviderFactory} backed by the native SSH/SFTP protocol
|
|
3701
|
+
* stack — no `ssh2` dependency required.
|
|
2843
3702
|
*
|
|
2844
|
-
*
|
|
2845
|
-
*
|
|
3703
|
+
* **Supported algorithms**
|
|
3704
|
+
* - Key exchange: `curve25519-sha256`, `curve25519-sha256@libssh.org`
|
|
3705
|
+
* - Host keys: `ssh-ed25519`, `ecdsa-sha2-nistp256/384/521`, `rsa-sha2-256`,
|
|
3706
|
+
* `rsa-sha2-512` (legacy SHA-1 `ssh-rsa` is rejected)
|
|
3707
|
+
* - Ciphers: `aes128-ctr`, `aes256-ctr`
|
|
3708
|
+
* - MACs: `hmac-sha2-256`, `hmac-sha2-512`
|
|
2846
3709
|
*
|
|
2847
|
-
*
|
|
2848
|
-
*
|
|
2849
|
-
*
|
|
3710
|
+
* **Authentication**
|
|
3711
|
+
* - `password`
|
|
3712
|
+
* - `keyboard-interactive` (RFC 4256)
|
|
3713
|
+
* - `publickey` for Ed25519 and RSA private keys (`rsa-sha2-512` preferred,
|
|
3714
|
+
* `rsa-sha2-256` fallback). Encrypted keys are unlocked via
|
|
3715
|
+
* `profile.ssh.passphrase`.
|
|
2850
3716
|
*
|
|
2851
|
-
*
|
|
3717
|
+
* **Host-key verification**
|
|
3718
|
+
* - The server's signature over the exchange hash is always verified.
|
|
3719
|
+
* - Optional pinning via `profile.ssh.pinnedHostKeySha256` (`SHA256:...`,
|
|
3720
|
+
* raw base64, or hex).
|
|
3721
|
+
* - Optional `profile.ssh.knownHosts` (OpenSSH format, hashed and plain
|
|
3722
|
+
* patterns, `[host]:port`, negation, and `@revoked` markers).
|
|
3723
|
+
*
|
|
3724
|
+
* **Resilience**
|
|
3725
|
+
* - `readyTimeoutMs` bounds TCP connect + SSH handshake.
|
|
3726
|
+
* - `keepaliveIntervalMs` keeps idle sessions alive through stateful
|
|
3727
|
+
* firewalls / NAT.
|
|
2852
3728
|
*
|
|
3729
|
+
* @example
|
|
3730
|
+
* ```ts
|
|
3731
|
+
* const client = createTransferClient({
|
|
3732
|
+
* providers: [createNativeSftpProviderFactory({
|
|
3733
|
+
* readyTimeoutMs: 10_000,
|
|
3734
|
+
* keepaliveIntervalMs: 30_000,
|
|
3735
|
+
* })],
|
|
3736
|
+
* });
|
|
2853
3737
|
* const session = await client.connect({
|
|
2854
|
-
* host: "sftp.example.com",
|
|
2855
3738
|
* provider: "sftp",
|
|
3739
|
+
* host: "sftp.example.com",
|
|
2856
3740
|
* username: "deploy",
|
|
2857
3741
|
* ssh: {
|
|
2858
|
-
* privateKey: {
|
|
2859
|
-
*
|
|
2860
|
-
* pinnedHostKeySha256: "SHA256:abc123basesixfourpinFromKnownHosts=",
|
|
3742
|
+
* privateKey: { kind: "literal", value: process.env.DEPLOY_KEY! },
|
|
3743
|
+
* pinnedHostKeySha256: "SHA256:abc...",
|
|
2861
3744
|
* },
|
|
2862
3745
|
* });
|
|
2863
3746
|
* ```
|
|
2864
|
-
*
|
|
2865
|
-
* Host-key verification (`ssh.knownHosts` and/or `ssh.pinnedHostKeySha256`) is
|
|
2866
|
-
* optional; without either, the client trusts whatever host key the server
|
|
2867
|
-
* presents. Use one for any non-lab deployment.
|
|
2868
|
-
*/
|
|
2869
|
-
declare function createSftpProviderFactory(options?: SftpProviderOptions): ProviderFactory;
|
|
2870
|
-
|
|
2871
|
-
/** Options for {@link createSftpJumpHostSocketFactory}. */
|
|
2872
|
-
interface SftpJumpHostOptions {
|
|
2873
|
-
/** Static ssh2 connect configuration for the bastion. Mutually exclusive with {@link buildBastion}. */
|
|
2874
|
-
bastion?: ConnectConfig;
|
|
2875
|
-
/** Per-connection builder used to refresh credentials before each tunnel attempt. */
|
|
2876
|
-
buildBastion?: (context: SshSocketFactoryContext) => ConnectConfig | Promise<ConnectConfig>;
|
|
2877
|
-
/** Optional logger used for tunnel diagnostics. */
|
|
2878
|
-
logger?: ZeroTransferLogger;
|
|
2879
|
-
/** Optional ssh2 client factory override used in tests. */
|
|
2880
|
-
createClient?: () => Client;
|
|
2881
|
-
}
|
|
2882
|
-
/**
|
|
2883
|
-
* Builds an {@link SshSocketFactory} that tunnels SFTP connections through a bastion host.
|
|
2884
|
-
*
|
|
2885
|
-
* @param options - Bastion configuration and overrides.
|
|
2886
|
-
* @returns Factory that returns a forwarded ssh2 channel stream when invoked.
|
|
2887
|
-
* @throws {@link ConfigurationError} When neither {@link SftpJumpHostOptions.bastion} nor {@link SftpJumpHostOptions.buildBastion} is supplied.
|
|
2888
3747
|
*/
|
|
2889
|
-
declare function
|
|
3748
|
+
declare function createNativeSftpProviderFactory(options?: NativeSftpProviderOptions): ProviderFactory;
|
|
2890
3749
|
|
|
2891
3750
|
/**
|
|
2892
3751
|
* Transfer result and progress calculation helpers.
|
|
@@ -4534,4 +5393,4 @@ declare function joinRemotePath(...segments: string[]): string;
|
|
|
4534
5393
|
*/
|
|
4535
5394
|
declare function basenameRemotePath(input: string): string;
|
|
4536
5395
|
|
|
4537
|
-
export { AbortError, type AgeRetentionPolicy, ApprovalRegistry, ApprovalRejectedError, type ApprovalRequest, type ApprovalStatus, type AtomicDeployActivateOperation, type AtomicDeployActivateStep, type AtomicDeployPlan, type AtomicDeployPruneStep, type AtomicDeployStrategy, type AuthenticationCapability, AuthenticationError, AuthorizationError, type AzureBlobProviderOptions, type BandwidthSleep, type BandwidthThrottle, type BandwidthThrottleOptions, type Base64EnvSecretSource, type BuiltInProviderId, type BuiltinCapabilityMatrixEntry, type BuiltinProviderMatrixId, CLASSIC_PROVIDER_IDS, type CapabilitySet, type ChecksumCapability, type ClassicProviderId, type ClientDiagnostics, type CompareRemoteManifestsOptions, ConfigurationError, type ConnectionDiagnosticTimings, type ConnectionDiagnosticsResult, ConnectionError, type ConnectionProfile, type ConventionEndpoint, type CopyBetweenOptions, type CountRetentionPolicy, type CreateApprovalGateOptions, type CreateAtomicDeployPlanOptions, type CreateInboxRouteOptions, type CreateOutboxRouteOptions, type CreateRemoteBrowserOptions, type CreateRemoteManifestOptions, type CreateSyncPlanOptions, type CreateWebhookAuditLogOptions, type CronExpression, type CronField, type CronScheduleTrigger, DEFAULT_FAILED_SUBDIR, DEFAULT_PROCESSED_SUBDIR, type DiffRemoteTreesOptions, type DispatchWebhookOptions, type DispatchWebhookResult, type DownloadFileOptions, type DropboxProviderOptions, type EnvSecretSource, type EvaluateRetentionOptions, type FileSecretSource, type FileZillaSite, type FriendlyTransferOptions, type FtpFeatures, type FtpPassiveHostStrategy, type FtpProviderOptions, type FtpReplyErrorInput, type FtpResponse, FtpResponseParser, type FtpResponseStatus, type FtpsDataProtection, type FtpsMode, type FtpsProviderOptions, type GcsProviderOptions, type GoogleDriveProviderOptions, type HttpFetch, type HttpProviderOptions, type ImportFileZillaSitesResult, type ImportOpenSshConfigOptions, type ImportOpenSshConfigResult, type ImportWinScpSessionsResult, InMemoryAuditLog, type IntervalScheduleTrigger, type JsonlWriter, type KnownHostsEntry, type KnownHostsMarker, type ListOptions, type LocalProviderOptions, type LogLevel, type LogRecord, type LogRecordInput, type LoggerMethod, type MemoryProviderEntry, type MemoryProviderOptions, type MetadataCapability, type MftAuditEntry, type MftAuditEntryType, type MftAuditLog, type MftInboxConvention, type MftOutboxConvention, type MftRoute, type MftRouteEndpoint, type MftRouteFilter, type MftRouteOperation, type MftSchedule, type MftScheduleTrigger, MftScheduler, type MftSchedulerOptions, type MkdirOptions, type OAuthAccessToken, type OAuthRefreshCallback, type OAuthTokenSecretSourceOptions, type OneDriveProviderOptions, type OpenSshConfigEntry, ParseError, PathAlreadyExistsError, PathNotFoundError, PermissionDeniedError, type ProgressEventInput, ProtocolError, type AuthenticationCapability as ProviderAuthenticationCapability, type CapabilitySet as ProviderCapabilities, type ChecksumCapability as ProviderChecksumCapability, type ProviderFactory, type ProviderId, type MetadataCapability as ProviderMetadataCapability, ProviderRegistry, type ProviderSelection, type ProviderTransferEndpointRole, type ProviderTransferExecutorOptions, type ProviderTransferOperations, type ProviderTransferReadRequest, type ProviderTransferReadResult, type ProviderTransferRequest, type ProviderTransferSessionResolver, type ProviderTransferSessionResolverInput, type ProviderTransferWriteRequest, type ProviderTransferWriteResult, REDACTED, REMOTE_MANIFEST_FORMAT_VERSION, type RemoteBreadcrumb, type RemoteBrowser, type RemoteBrowserFilter, type RemoteBrowserSnapshot, type RemoteEntry, type RemoteEntrySortKey, type RemoteEntrySortOrder, type RemoteEntryType, type RemoteFileAdapter, type RemoteFileEndpoint, type RemoteFileSystem, type RemoteManifest, type RemoteManifestEntry, type RemotePermissions, type RemoteProtocol, type RemoteStat, type RemoteTreeDiff, type RemoteTreeDiffEntry, type RemoteTreeDiffReason, type RemoteTreeDiffStatus, type RemoteTreeDiffSummary, type RemoteTreeEntry, type RemoteTreeFilter, type RemoveOptions, type RenameOptions, type ResolveSecretOptions, type ResolvedConnectionProfile, type ResolvedOpenSshHost, type ResolvedSshProfile, type ResolvedTlsProfile, type RetentionEvaluation, type RetentionPolicy, type RmdirOptions, RouteRegistry, type RunConnectionDiagnosticsOptions, type RunRouteOptions, type S3MultipartCheckpoint, type S3MultipartOptions, type S3MultipartPart, type S3MultipartResumeKey, type S3MultipartResumeStore, type S3ProviderOptions, ScheduleRegistry, type ScheduleRouteRunner, type ScheduleTimerHooks, type SecretProvider, type SecretSource, type SecretValue, type
|
|
5396
|
+
export { AbortError, type AgeRetentionPolicy, ApprovalRegistry, ApprovalRejectedError, type ApprovalRequest, type ApprovalStatus, type AtomicDeployActivateOperation, type AtomicDeployActivateStep, type AtomicDeployPlan, type AtomicDeployPruneStep, type AtomicDeployStrategy, type AuthenticationCapability, AuthenticationError, AuthorizationError, type AzureBlobProviderOptions, type BandwidthSleep, type BandwidthThrottle, type BandwidthThrottleOptions, type Base64EnvSecretSource, type BuiltInProviderId, type BuiltinCapabilityMatrixEntry, type BuiltinProviderMatrixId, CLASSIC_PROVIDER_IDS, type CapabilitySet, type ChecksumCapability, type ClassicProviderId, type ClientDiagnostics, type CompareRemoteManifestsOptions, ConfigurationError, type ConnectionDiagnosticTimings, type ConnectionDiagnosticsResult, ConnectionError, type ConnectionPoolOptions, type ConnectionProfile, type ConventionEndpoint, type CopyBetweenOptions, type CountRetentionPolicy, type CreateApprovalGateOptions, type CreateAtomicDeployPlanOptions, type CreateInboxRouteOptions, type CreateOutboxRouteOptions, type CreateRemoteBrowserOptions, type CreateRemoteManifestOptions, type CreateSyncPlanOptions, type CreateWebhookAuditLogOptions, type CronExpression, type CronField, type CronScheduleTrigger, DEFAULT_FAILED_SUBDIR, DEFAULT_PROCESSED_SUBDIR, DEFAULT_SSH_ALGORITHM_PREFERENCES, type DiffRemoteTreesOptions, type DispatchWebhookOptions, type DispatchWebhookResult, type DownloadFileOptions, type DropboxProviderOptions, type EnvSecretSource, type EvaluateRetentionOptions, type FileSecretSource, type FileSystemS3MultipartResumeStoreOptions, type FileZillaSite, type FriendlyTransferOptions, type FtpFeatures, type FtpPassiveHostStrategy, type FtpProviderOptions, type FtpReplyErrorInput, type FtpResponse, FtpResponseParser, type FtpResponseStatus, type FtpsDataProtection, type FtpsMode, type FtpsProviderOptions, type GcsProviderOptions, type GoogleDriveProviderOptions, type HttpFetch, type HttpProviderOptions, type ImportFileZillaSitesResult, type ImportOpenSshConfigOptions, type ImportOpenSshConfigResult, type ImportWinScpSessionsResult, InMemoryAuditLog, type IntervalScheduleTrigger, type JsonlWriter, type KnownHostsEntry, type KnownHostsMarker, type ListOptions, type LocalProviderOptions, type LogLevel, type LogRecord, type LogRecordInput, type LoggerMethod, type MemoryProviderEntry, type MemoryProviderOptions, type MetadataCapability, type MftAuditEntry, type MftAuditEntryType, type MftAuditLog, type MftInboxConvention, type MftOutboxConvention, type MftRoute, type MftRouteEndpoint, type MftRouteFilter, type MftRouteOperation, type MftSchedule, type MftScheduleTrigger, MftScheduler, type MftSchedulerOptions, type MkdirOptions, type NativeSftpProviderOptions, type NativeSftpRawSession, type NegotiatedSshAlgorithms, type OAuthAccessToken, type OAuthRefreshCallback, type OAuthTokenSecretSourceOptions, type OneDriveProviderOptions, type OpenSshConfigEntry, ParseError, PathAlreadyExistsError, PathNotFoundError, PermissionDeniedError, type PooledTransferClient, type ProgressEventInput, ProtocolError, type AuthenticationCapability as ProviderAuthenticationCapability, type CapabilitySet as ProviderCapabilities, type ChecksumCapability as ProviderChecksumCapability, type ProviderFactory, type ProviderId, type MetadataCapability as ProviderMetadataCapability, ProviderRegistry, type ProviderSelection, type ProviderTransferEndpointRole, type ProviderTransferExecutorOptions, type ProviderTransferOperations, type ProviderTransferReadRequest, type ProviderTransferReadResult, type ProviderTransferRequest, type ProviderTransferSessionResolver, type ProviderTransferSessionResolverInput, type ProviderTransferWriteRequest, type ProviderTransferWriteResult, REDACTED, REMOTE_MANIFEST_FORMAT_VERSION, type RemoteBreadcrumb, type RemoteBrowser, type RemoteBrowserFilter, type RemoteBrowserSnapshot, type RemoteEntry, type RemoteEntrySortKey, type RemoteEntrySortOrder, type RemoteEntryType, type RemoteFileAdapter, type RemoteFileEndpoint, type RemoteFileSystem, type RemoteManifest, type RemoteManifestEntry, type RemotePermissions, type RemoteProtocol, type RemoteStat, type RemoteTreeDiff, type RemoteTreeDiffEntry, type RemoteTreeDiffReason, type RemoteTreeDiffStatus, type RemoteTreeDiffSummary, type RemoteTreeEntry, type RemoteTreeFilter, type RemoveOptions, type RenameOptions, type ResolveSecretOptions, type ResolvedConnectionProfile, type ResolvedOpenSshHost, type ResolvedSshProfile, type ResolvedTlsProfile, type RetentionEvaluation, type RetentionPolicy, type RmdirOptions, RouteRegistry, type RunConnectionDiagnosticsOptions, type RunRouteOptions, type S3MultipartCheckpoint, type S3MultipartOptions, type S3MultipartPart, type S3MultipartResumeKey, type S3MultipartResumeStore, type S3ProviderOptions, ScheduleRegistry, type ScheduleRouteRunner, type ScheduleTimerHooks, type SecretProvider, type SecretSource, type SecretValue, type NativeSftpProviderOptions as SftpProviderOptions, type NativeSftpRawSession as SftpRawSession, type SpecializedErrorDetails, type SshAgentSource, type SshAlgorithmPreferences, type SshAlgorithms, SshAuthSession, SshConnectionManager, SshDataReader, SshDataWriter, SshDisconnectReason, type SshKeyboardInteractiveChallenge, type SshKeyboardInteractiveCredential, type SshKeyboardInteractiveHandler, type SshKeyboardInteractivePrompt, type SshKnownHostsSource, type SshPasswordCredential, type SshProfile, type SshPublickeyCredential, SshSessionChannel, type SshSocketFactory, type SshSocketFactoryContext, SshTransportConnection, type SshTransportConnectionOptions, SshTransportHandshake, type SshTransportHandshakeResult, type StatOptions, type SyncConflictPolicy, type SyncDeletePolicy, type SyncDirection, type SyncEndpointInput, TimeoutError, type TlsProfile, type TlsSecretSource, type TransferAttempt, type TransferAttemptError, type TransferBandwidthLimit, type TransferByteRange, TransferClient, type TransferClientOptions, type TransferDataChunk, type TransferDataSource, type TransferEndpoint, TransferEngine, type TransferEngineExecuteOptions, type TransferEngineOptions, TransferError, type TransferExecutionContext, type TransferExecutionResult, type TransferExecutor, type TransferJob, type TransferOperation, type TransferPlan, type TransferPlanAction, type TransferPlanInput, type TransferPlanStep, type TransferPlanSummary, type TransferProgressEvent, type TransferProvider, TransferQueue, type TransferQueueExecutorResolver, type TransferQueueItem, type TransferQueueItemStatus, type TransferQueueOptions, type TransferQueueRunOptions, type TransferQueueSummary, type TransferReceipt, type TransferResult, type TransferResultInput, type TransferRetryDecisionInput, type TransferRetryPolicy, type TransferSession, type TransferTimeoutPolicy, type TransferVerificationResult, UnsupportedFeatureError, type UploadFileOptions, type ValueSecretSource, VerificationError, type WalkRemoteTreeOptions, type WebDavProviderOptions, type WebhookRetryPolicy, type WebhookSignature, type WebhookTarget, type WinScpSession, ZeroTransfer, type ZeroTransferCapabilities, ZeroTransferError, type ZeroTransferErrorDetails, type ZeroTransferLogger, type ZeroTransferOptions, assertSafeFtpArgument, basenameRemotePath, buildPublickeyCredential, buildRemoteBreadcrumbs, compareRemoteManifests, composeAuditLogs, copyBetween, createApprovalGate, createAtomicDeployPlan, createAzureBlobProviderFactory, createBandwidthThrottle, createDropboxProviderFactory, createFileSystemS3MultipartResumeStore, createFtpProviderFactory, createFtpsProviderFactory, createGcsProviderFactory, createGoogleDriveProviderFactory, createHttpProviderFactory, createInboxRoute, createJsonlAuditLog, createLocalProviderFactory, createMemoryProviderFactory, createMemoryS3MultipartResumeStore, createNativeSftpProviderFactory, createOAuthTokenSecretSource, createOneDriveProviderFactory, createOutboxRoute, createPooledTransferClient, createProgressEvent, createProviderTransferExecutor, createRemoteBrowser, createRemoteManifest, createS3ProviderFactory, createNativeSftpProviderFactory as createSftpProviderFactory, createSyncPlan, createTransferClient, createTransferJobsFromPlan, createTransferPlan, createTransferResult, createWebDavProviderFactory, createWebhookAuditLog, diffRemoteTrees, dispatchWebhook, downloadFile, emitLog, errorFromFtpReply, evaluateRetention, filterRemoteEntries, formatCapabilityMatrixMarkdown, freezeReceipt, getBuiltinCapabilityMatrix, importFileZillaSites, importOpenSshConfig, importWinScpSessions, inboxFailedPath, inboxProcessedPath, isClassicProviderId, isSensitiveKey, joinRemotePath, matchKnownHosts, matchKnownHostsEntry, negotiateSshAlgorithms, nextCronFireAt, nextScheduleFireAt, noopLogger, normalizeRemotePath, parentRemotePath, parseCronExpression, parseFtpFeatures, parseFtpResponseLines, parseKnownHosts, parseMlsdLine, parseMlsdList, parseMlstTimestamp, parseOpenSshConfig, parseRemoteManifest, parseUnixList, parseUnixListLine, redactCommand, redactConnectionProfile, redactObject, redactSecretSource, redactValue, resolveConnectionProfileSecrets, resolveOpenSshHost, resolveProviderId, resolveSecret, runConnectionDiagnostics, runRoute, serializeRemoteManifest, signWebhookPayload, sortRemoteEntries, summarizeClientDiagnostics, summarizeError, summarizeTransferPlan, throttleByteIterable, uploadFile, validateConnectionProfile, validateSchedule, walkRemoteTree };
|