@zero-transfer/classic 0.4.2 → 0.4.7
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 +10 -2
- package/dist/index.cjs +25 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +18 -12
- package/dist/index.d.ts +18 -12
- package/dist/index.mjs +24 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -2
package/dist/index.d.mts
CHANGED
|
@@ -395,7 +395,7 @@ interface TlsProfile {
|
|
|
395
395
|
* hex form with or without colons. When present, the TLS handshake additionally requires the
|
|
396
396
|
* leaf certificate's SHA-256 fingerprint to match one of these values.
|
|
397
397
|
*
|
|
398
|
-
* Not required for normal CA-trusted endpoints
|
|
398
|
+
* Not required for normal CA-trusted endpoints - public CAs and `ca` bundles already gate
|
|
399
399
|
* trust via `rejectUnauthorized`. Pinning is **recommended for production** when you control
|
|
400
400
|
* the server and want defence-in-depth against rogue certificates issued by trusted CAs.
|
|
401
401
|
*
|
|
@@ -1723,7 +1723,7 @@ interface ConnectionPoolOptions {
|
|
|
1723
1723
|
/**
|
|
1724
1724
|
* Maximum number of *idle* sessions retained per pool key.
|
|
1725
1725
|
*
|
|
1726
|
-
* Active leases are not counted against this limit
|
|
1726
|
+
* Active leases are not counted against this limit - the cap only applies
|
|
1727
1727
|
* to sessions waiting in the pool. When more than `maxIdlePerKey` sessions
|
|
1728
1728
|
* become idle simultaneously, the oldest ones are disconnected. Defaults
|
|
1729
1729
|
* to `4`.
|
|
@@ -3003,7 +3003,7 @@ interface DiffRemoteTreesOptions {
|
|
|
3003
3003
|
* Compares two remote subtrees and produces an entry-level diff.
|
|
3004
3004
|
*
|
|
3005
3005
|
* Source and destination paths are walked independently; entries are then aligned by
|
|
3006
|
-
* the relative path from each tree root. Directory equality is structural
|
|
3006
|
+
* the relative path from each tree root. Directory equality is structural - directories
|
|
3007
3007
|
* are equal when their relative paths match and the entry types agree.
|
|
3008
3008
|
*
|
|
3009
3009
|
* @param source - Source-side remote file system.
|
|
@@ -3248,7 +3248,7 @@ interface CreateAtomicDeployPlanOptions {
|
|
|
3248
3248
|
* 2. Atomically swap the `current` symlink/rename to point at the new release.
|
|
3249
3249
|
* 3. Optionally prune old releases beyond `retain`.
|
|
3250
3250
|
*
|
|
3251
|
-
* No I/O is performed
|
|
3251
|
+
* No I/O is performed - the host executes the plan steps. Pair with
|
|
3252
3252
|
* {@link createTransferPlan} or {@link createTransferJobsFromPlan} to execute.
|
|
3253
3253
|
*
|
|
3254
3254
|
* @param options - Inputs and policies that shape the deploy.
|
|
@@ -3468,6 +3468,12 @@ declare function joinRemotePath(...segments: string[]): string;
|
|
|
3468
3468
|
*/
|
|
3469
3469
|
declare function basenameRemotePath(input: string): string;
|
|
3470
3470
|
|
|
3471
|
+
/**
|
|
3472
|
+
* Returns `true` when the file containing `import.meta.url` is the entry point
|
|
3473
|
+
* of the current Node.js process. Returns `false` outside Node.
|
|
3474
|
+
*/
|
|
3475
|
+
declare function isMainModule(importMetaUrl: string): boolean;
|
|
3476
|
+
|
|
3471
3477
|
/**
|
|
3472
3478
|
* FTPS control-channel TLS mode.
|
|
3473
3479
|
*
|
|
@@ -3510,7 +3516,7 @@ interface FtpsProviderOptions extends FtpProviderOptions {
|
|
|
3510
3516
|
* @param options - Optional provider defaults.
|
|
3511
3517
|
* @returns Provider factory suitable for `createTransferClient({ providers: [...] })`.
|
|
3512
3518
|
*
|
|
3513
|
-
* @example Plain FTP (cleartext
|
|
3519
|
+
* @example Plain FTP (cleartext - prefer FTPS or SFTP whenever possible)
|
|
3514
3520
|
* ```ts
|
|
3515
3521
|
* import { createFtpProviderFactory, createTransferClient } from "@zero-transfer/sdk";
|
|
3516
3522
|
*
|
|
@@ -4172,7 +4178,7 @@ declare class SftpSession {
|
|
|
4172
4178
|
}
|
|
4173
4179
|
|
|
4174
4180
|
/**
|
|
4175
|
-
* Options for {@link
|
|
4181
|
+
* Options for {@link createSftpProviderFactory}.
|
|
4176
4182
|
*
|
|
4177
4183
|
* The native provider is a zero-dependency replacement for the legacy
|
|
4178
4184
|
* `ssh2`-backed provider. It implements RFC 4253 SSH transport, RFC 4252 user
|
|
@@ -4180,7 +4186,7 @@ declare class SftpSession {
|
|
|
4180
4186
|
* Ed25519/RSA), RFC 5656 ECDSA host keys (`nistp256/384/521`), and the
|
|
4181
4187
|
* SFTP v3 client protocol multiplexed over a single channel.
|
|
4182
4188
|
*/
|
|
4183
|
-
interface
|
|
4189
|
+
interface SftpProviderOptions {
|
|
4184
4190
|
/**
|
|
4185
4191
|
* Default connection timeout in milliseconds when the profile omits
|
|
4186
4192
|
* `timeoutMs`. Bounds both the TCP connect *and* the SSH identification +
|
|
@@ -4211,7 +4217,7 @@ interface NativeSftpProviderOptions {
|
|
|
4211
4217
|
* advanced extension. Most applications should use the
|
|
4212
4218
|
* {@link TransferSession} returned from `client.connect()` instead.
|
|
4213
4219
|
*/
|
|
4214
|
-
interface
|
|
4220
|
+
interface SftpRawSession {
|
|
4215
4221
|
/** SFTP v3 client multiplexed over the SSH session channel. */
|
|
4216
4222
|
sftp: SftpSession;
|
|
4217
4223
|
/** Underlying SSH transport (key exchange, packet protection, channel mux). */
|
|
@@ -4219,7 +4225,7 @@ interface NativeSftpRawSession {
|
|
|
4219
4225
|
}
|
|
4220
4226
|
/**
|
|
4221
4227
|
* Creates a {@link ProviderFactory} backed by the native SSH/SFTP protocol
|
|
4222
|
-
* stack
|
|
4228
|
+
* stack - no `ssh2` dependency required.
|
|
4223
4229
|
*
|
|
4224
4230
|
* **Supported algorithms**
|
|
4225
4231
|
* - Key exchange: `curve25519-sha256`, `curve25519-sha256@libssh.org`
|
|
@@ -4250,7 +4256,7 @@ interface NativeSftpRawSession {
|
|
|
4250
4256
|
* @example
|
|
4251
4257
|
* ```ts
|
|
4252
4258
|
* const client = createTransferClient({
|
|
4253
|
-
* providers: [
|
|
4259
|
+
* providers: [createSftpProviderFactory({
|
|
4254
4260
|
* readyTimeoutMs: 10_000,
|
|
4255
4261
|
* keepaliveIntervalMs: 30_000,
|
|
4256
4262
|
* })],
|
|
@@ -4266,6 +4272,6 @@ interface NativeSftpRawSession {
|
|
|
4266
4272
|
* });
|
|
4267
4273
|
* ```
|
|
4268
4274
|
*/
|
|
4269
|
-
declare function
|
|
4275
|
+
declare function createSftpProviderFactory(options?: SftpProviderOptions): ProviderFactory;
|
|
4270
4276
|
|
|
4271
|
-
export { AbortError, type AtomicDeployActivateOperation, type AtomicDeployActivateStep, type AtomicDeployPlan, type AtomicDeployPruneStep, type AtomicDeployStrategy, type AuthenticationCapability, AuthenticationError, AuthorizationError, type BandwidthSleep, type BandwidthThrottle, type BandwidthThrottleOptions, type Base64EnvSecretSource, type BuiltInProviderId, CLASSIC_PROVIDER_IDS, type CapabilitySet, type ChecksumCapability, type ClassicProviderId, type ClientDiagnostics, type CompareRemoteManifestsOptions, ConfigurationError, type ConnectionDiagnosticTimings, type ConnectionDiagnosticsResult, ConnectionError, type ConnectionPoolOptions, type ConnectionProfile, type CopyBetweenOptions, type CreateAtomicDeployPlanOptions, type CreateRemoteBrowserOptions, type CreateRemoteManifestOptions, type CreateSyncPlanOptions, type DiffRemoteTreesOptions, type DownloadFileOptions, type EnvSecretSource, 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 ImportFileZillaSitesResult, type ImportOpenSshConfigOptions, type ImportOpenSshConfigResult, type ImportWinScpSessionsResult, type KnownHostsEntry, type KnownHostsMarker, type ListOptions, type LocalProviderOptions, type LogLevel, type LogRecord, type LogRecordInput, type LoggerMethod, type MemoryProviderEntry, type MemoryProviderOptions, type MetadataCapability, type MkdirOptions, type OAuthAccessToken, type OAuthRefreshCallback, type OAuthTokenSecretSourceOptions, type OpenSshConfigEntry, ParseError, PathAlreadyExistsError, PathNotFoundError, PermissionDeniedError, type PooledTransferClient, type ProgressEventInput, ProtocolError, type
|
|
4277
|
+
export { AbortError, type AtomicDeployActivateOperation, type AtomicDeployActivateStep, type AtomicDeployPlan, type AtomicDeployPruneStep, type AtomicDeployStrategy, type AuthenticationCapability, AuthenticationError, AuthorizationError, type BandwidthSleep, type BandwidthThrottle, type BandwidthThrottleOptions, type Base64EnvSecretSource, type BuiltInProviderId, CLASSIC_PROVIDER_IDS, type CapabilitySet, type ChecksumCapability, type ClassicProviderId, type ClientDiagnostics, type CompareRemoteManifestsOptions, ConfigurationError, type ConnectionDiagnosticTimings, type ConnectionDiagnosticsResult, ConnectionError, type ConnectionPoolOptions, type ConnectionProfile, type CopyBetweenOptions, type CreateAtomicDeployPlanOptions, type CreateRemoteBrowserOptions, type CreateRemoteManifestOptions, type CreateSyncPlanOptions, type DiffRemoteTreesOptions, type DownloadFileOptions, type EnvSecretSource, 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 ImportFileZillaSitesResult, type ImportOpenSshConfigOptions, type ImportOpenSshConfigResult, type ImportWinScpSessionsResult, type KnownHostsEntry, type KnownHostsMarker, type ListOptions, type LocalProviderOptions, type LogLevel, type LogRecord, type LogRecordInput, type LoggerMethod, type MemoryProviderEntry, type MemoryProviderOptions, type MetadataCapability, type MkdirOptions, type OAuthAccessToken, type OAuthRefreshCallback, type OAuthTokenSecretSourceOptions, type OpenSshConfigEntry, ParseError, PathAlreadyExistsError, PathNotFoundError, PermissionDeniedError, type PooledTransferClient, type ProgressEventInput, ProtocolError, type ProviderFactory, type ProviderId, 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 RmdirOptions, type RunConnectionDiagnosticsOptions, type SecretProvider, type SecretSource, type SecretValue, type SftpProviderOptions, type SftpRawSession, type SpecializedErrorDetails, type SshAgentSource, type SshAlgorithms, type SshKeyboardInteractiveChallenge, type SshKeyboardInteractiveHandler, type SshKeyboardInteractivePrompt, type SshKnownHostsSource, type SshProfile, type SshSocketFactory, type SshSocketFactoryContext, 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 WinScpSession, ZeroTransfer, type ZeroTransferCapabilities, ZeroTransferError, type ZeroTransferErrorDetails, type ZeroTransferLogger, type ZeroTransferOptions, assertSafeFtpArgument, basenameRemotePath, buildRemoteBreadcrumbs, compareRemoteManifests, copyBetween, createAtomicDeployPlan, createBandwidthThrottle, createFtpProviderFactory, createFtpsProviderFactory, createLocalProviderFactory, createMemoryProviderFactory, createOAuthTokenSecretSource, createPooledTransferClient, createProgressEvent, createProviderTransferExecutor, createRemoteBrowser, createRemoteManifest, createSftpProviderFactory, createSyncPlan, createTransferClient, createTransferJobsFromPlan, createTransferPlan, createTransferResult, diffRemoteTrees, downloadFile, emitLog, errorFromFtpReply, filterRemoteEntries, importFileZillaSites, importOpenSshConfig, importWinScpSessions, isClassicProviderId, isMainModule, isSensitiveKey, joinRemotePath, matchKnownHosts, matchKnownHostsEntry, noopLogger, normalizeRemotePath, parentRemotePath, parseFtpFeatures, parseFtpResponseLines, parseKnownHosts, parseMlsdLine, parseMlsdList, parseMlstTimestamp, parseOpenSshConfig, parseRemoteManifest, parseUnixList, parseUnixListLine, redactCommand, redactConnectionProfile, redactObject, redactSecretSource, redactValue, resolveConnectionProfileSecrets, resolveOpenSshHost, resolveProviderId, resolveSecret, runConnectionDiagnostics, serializeRemoteManifest, sortRemoteEntries, summarizeClientDiagnostics, summarizeTransferPlan, throttleByteIterable, uploadFile, validateConnectionProfile, walkRemoteTree };
|
package/dist/index.d.ts
CHANGED
|
@@ -395,7 +395,7 @@ interface TlsProfile {
|
|
|
395
395
|
* hex form with or without colons. When present, the TLS handshake additionally requires the
|
|
396
396
|
* leaf certificate's SHA-256 fingerprint to match one of these values.
|
|
397
397
|
*
|
|
398
|
-
* Not required for normal CA-trusted endpoints
|
|
398
|
+
* Not required for normal CA-trusted endpoints - public CAs and `ca` bundles already gate
|
|
399
399
|
* trust via `rejectUnauthorized`. Pinning is **recommended for production** when you control
|
|
400
400
|
* the server and want defence-in-depth against rogue certificates issued by trusted CAs.
|
|
401
401
|
*
|
|
@@ -1723,7 +1723,7 @@ interface ConnectionPoolOptions {
|
|
|
1723
1723
|
/**
|
|
1724
1724
|
* Maximum number of *idle* sessions retained per pool key.
|
|
1725
1725
|
*
|
|
1726
|
-
* Active leases are not counted against this limit
|
|
1726
|
+
* Active leases are not counted against this limit - the cap only applies
|
|
1727
1727
|
* to sessions waiting in the pool. When more than `maxIdlePerKey` sessions
|
|
1728
1728
|
* become idle simultaneously, the oldest ones are disconnected. Defaults
|
|
1729
1729
|
* to `4`.
|
|
@@ -3003,7 +3003,7 @@ interface DiffRemoteTreesOptions {
|
|
|
3003
3003
|
* Compares two remote subtrees and produces an entry-level diff.
|
|
3004
3004
|
*
|
|
3005
3005
|
* Source and destination paths are walked independently; entries are then aligned by
|
|
3006
|
-
* the relative path from each tree root. Directory equality is structural
|
|
3006
|
+
* the relative path from each tree root. Directory equality is structural - directories
|
|
3007
3007
|
* are equal when their relative paths match and the entry types agree.
|
|
3008
3008
|
*
|
|
3009
3009
|
* @param source - Source-side remote file system.
|
|
@@ -3248,7 +3248,7 @@ interface CreateAtomicDeployPlanOptions {
|
|
|
3248
3248
|
* 2. Atomically swap the `current` symlink/rename to point at the new release.
|
|
3249
3249
|
* 3. Optionally prune old releases beyond `retain`.
|
|
3250
3250
|
*
|
|
3251
|
-
* No I/O is performed
|
|
3251
|
+
* No I/O is performed - the host executes the plan steps. Pair with
|
|
3252
3252
|
* {@link createTransferPlan} or {@link createTransferJobsFromPlan} to execute.
|
|
3253
3253
|
*
|
|
3254
3254
|
* @param options - Inputs and policies that shape the deploy.
|
|
@@ -3468,6 +3468,12 @@ declare function joinRemotePath(...segments: string[]): string;
|
|
|
3468
3468
|
*/
|
|
3469
3469
|
declare function basenameRemotePath(input: string): string;
|
|
3470
3470
|
|
|
3471
|
+
/**
|
|
3472
|
+
* Returns `true` when the file containing `import.meta.url` is the entry point
|
|
3473
|
+
* of the current Node.js process. Returns `false` outside Node.
|
|
3474
|
+
*/
|
|
3475
|
+
declare function isMainModule(importMetaUrl: string): boolean;
|
|
3476
|
+
|
|
3471
3477
|
/**
|
|
3472
3478
|
* FTPS control-channel TLS mode.
|
|
3473
3479
|
*
|
|
@@ -3510,7 +3516,7 @@ interface FtpsProviderOptions extends FtpProviderOptions {
|
|
|
3510
3516
|
* @param options - Optional provider defaults.
|
|
3511
3517
|
* @returns Provider factory suitable for `createTransferClient({ providers: [...] })`.
|
|
3512
3518
|
*
|
|
3513
|
-
* @example Plain FTP (cleartext
|
|
3519
|
+
* @example Plain FTP (cleartext - prefer FTPS or SFTP whenever possible)
|
|
3514
3520
|
* ```ts
|
|
3515
3521
|
* import { createFtpProviderFactory, createTransferClient } from "@zero-transfer/sdk";
|
|
3516
3522
|
*
|
|
@@ -4172,7 +4178,7 @@ declare class SftpSession {
|
|
|
4172
4178
|
}
|
|
4173
4179
|
|
|
4174
4180
|
/**
|
|
4175
|
-
* Options for {@link
|
|
4181
|
+
* Options for {@link createSftpProviderFactory}.
|
|
4176
4182
|
*
|
|
4177
4183
|
* The native provider is a zero-dependency replacement for the legacy
|
|
4178
4184
|
* `ssh2`-backed provider. It implements RFC 4253 SSH transport, RFC 4252 user
|
|
@@ -4180,7 +4186,7 @@ declare class SftpSession {
|
|
|
4180
4186
|
* Ed25519/RSA), RFC 5656 ECDSA host keys (`nistp256/384/521`), and the
|
|
4181
4187
|
* SFTP v3 client protocol multiplexed over a single channel.
|
|
4182
4188
|
*/
|
|
4183
|
-
interface
|
|
4189
|
+
interface SftpProviderOptions {
|
|
4184
4190
|
/**
|
|
4185
4191
|
* Default connection timeout in milliseconds when the profile omits
|
|
4186
4192
|
* `timeoutMs`. Bounds both the TCP connect *and* the SSH identification +
|
|
@@ -4211,7 +4217,7 @@ interface NativeSftpProviderOptions {
|
|
|
4211
4217
|
* advanced extension. Most applications should use the
|
|
4212
4218
|
* {@link TransferSession} returned from `client.connect()` instead.
|
|
4213
4219
|
*/
|
|
4214
|
-
interface
|
|
4220
|
+
interface SftpRawSession {
|
|
4215
4221
|
/** SFTP v3 client multiplexed over the SSH session channel. */
|
|
4216
4222
|
sftp: SftpSession;
|
|
4217
4223
|
/** Underlying SSH transport (key exchange, packet protection, channel mux). */
|
|
@@ -4219,7 +4225,7 @@ interface NativeSftpRawSession {
|
|
|
4219
4225
|
}
|
|
4220
4226
|
/**
|
|
4221
4227
|
* Creates a {@link ProviderFactory} backed by the native SSH/SFTP protocol
|
|
4222
|
-
* stack
|
|
4228
|
+
* stack - no `ssh2` dependency required.
|
|
4223
4229
|
*
|
|
4224
4230
|
* **Supported algorithms**
|
|
4225
4231
|
* - Key exchange: `curve25519-sha256`, `curve25519-sha256@libssh.org`
|
|
@@ -4250,7 +4256,7 @@ interface NativeSftpRawSession {
|
|
|
4250
4256
|
* @example
|
|
4251
4257
|
* ```ts
|
|
4252
4258
|
* const client = createTransferClient({
|
|
4253
|
-
* providers: [
|
|
4259
|
+
* providers: [createSftpProviderFactory({
|
|
4254
4260
|
* readyTimeoutMs: 10_000,
|
|
4255
4261
|
* keepaliveIntervalMs: 30_000,
|
|
4256
4262
|
* })],
|
|
@@ -4266,6 +4272,6 @@ interface NativeSftpRawSession {
|
|
|
4266
4272
|
* });
|
|
4267
4273
|
* ```
|
|
4268
4274
|
*/
|
|
4269
|
-
declare function
|
|
4275
|
+
declare function createSftpProviderFactory(options?: SftpProviderOptions): ProviderFactory;
|
|
4270
4276
|
|
|
4271
|
-
export { AbortError, type AtomicDeployActivateOperation, type AtomicDeployActivateStep, type AtomicDeployPlan, type AtomicDeployPruneStep, type AtomicDeployStrategy, type AuthenticationCapability, AuthenticationError, AuthorizationError, type BandwidthSleep, type BandwidthThrottle, type BandwidthThrottleOptions, type Base64EnvSecretSource, type BuiltInProviderId, CLASSIC_PROVIDER_IDS, type CapabilitySet, type ChecksumCapability, type ClassicProviderId, type ClientDiagnostics, type CompareRemoteManifestsOptions, ConfigurationError, type ConnectionDiagnosticTimings, type ConnectionDiagnosticsResult, ConnectionError, type ConnectionPoolOptions, type ConnectionProfile, type CopyBetweenOptions, type CreateAtomicDeployPlanOptions, type CreateRemoteBrowserOptions, type CreateRemoteManifestOptions, type CreateSyncPlanOptions, type DiffRemoteTreesOptions, type DownloadFileOptions, type EnvSecretSource, 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 ImportFileZillaSitesResult, type ImportOpenSshConfigOptions, type ImportOpenSshConfigResult, type ImportWinScpSessionsResult, type KnownHostsEntry, type KnownHostsMarker, type ListOptions, type LocalProviderOptions, type LogLevel, type LogRecord, type LogRecordInput, type LoggerMethod, type MemoryProviderEntry, type MemoryProviderOptions, type MetadataCapability, type MkdirOptions, type OAuthAccessToken, type OAuthRefreshCallback, type OAuthTokenSecretSourceOptions, type OpenSshConfigEntry, ParseError, PathAlreadyExistsError, PathNotFoundError, PermissionDeniedError, type PooledTransferClient, type ProgressEventInput, ProtocolError, type
|
|
4277
|
+
export { AbortError, type AtomicDeployActivateOperation, type AtomicDeployActivateStep, type AtomicDeployPlan, type AtomicDeployPruneStep, type AtomicDeployStrategy, type AuthenticationCapability, AuthenticationError, AuthorizationError, type BandwidthSleep, type BandwidthThrottle, type BandwidthThrottleOptions, type Base64EnvSecretSource, type BuiltInProviderId, CLASSIC_PROVIDER_IDS, type CapabilitySet, type ChecksumCapability, type ClassicProviderId, type ClientDiagnostics, type CompareRemoteManifestsOptions, ConfigurationError, type ConnectionDiagnosticTimings, type ConnectionDiagnosticsResult, ConnectionError, type ConnectionPoolOptions, type ConnectionProfile, type CopyBetweenOptions, type CreateAtomicDeployPlanOptions, type CreateRemoteBrowserOptions, type CreateRemoteManifestOptions, type CreateSyncPlanOptions, type DiffRemoteTreesOptions, type DownloadFileOptions, type EnvSecretSource, 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 ImportFileZillaSitesResult, type ImportOpenSshConfigOptions, type ImportOpenSshConfigResult, type ImportWinScpSessionsResult, type KnownHostsEntry, type KnownHostsMarker, type ListOptions, type LocalProviderOptions, type LogLevel, type LogRecord, type LogRecordInput, type LoggerMethod, type MemoryProviderEntry, type MemoryProviderOptions, type MetadataCapability, type MkdirOptions, type OAuthAccessToken, type OAuthRefreshCallback, type OAuthTokenSecretSourceOptions, type OpenSshConfigEntry, ParseError, PathAlreadyExistsError, PathNotFoundError, PermissionDeniedError, type PooledTransferClient, type ProgressEventInput, ProtocolError, type ProviderFactory, type ProviderId, 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 RmdirOptions, type RunConnectionDiagnosticsOptions, type SecretProvider, type SecretSource, type SecretValue, type SftpProviderOptions, type SftpRawSession, type SpecializedErrorDetails, type SshAgentSource, type SshAlgorithms, type SshKeyboardInteractiveChallenge, type SshKeyboardInteractiveHandler, type SshKeyboardInteractivePrompt, type SshKnownHostsSource, type SshProfile, type SshSocketFactory, type SshSocketFactoryContext, 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 WinScpSession, ZeroTransfer, type ZeroTransferCapabilities, ZeroTransferError, type ZeroTransferErrorDetails, type ZeroTransferLogger, type ZeroTransferOptions, assertSafeFtpArgument, basenameRemotePath, buildRemoteBreadcrumbs, compareRemoteManifests, copyBetween, createAtomicDeployPlan, createBandwidthThrottle, createFtpProviderFactory, createFtpsProviderFactory, createLocalProviderFactory, createMemoryProviderFactory, createOAuthTokenSecretSource, createPooledTransferClient, createProgressEvent, createProviderTransferExecutor, createRemoteBrowser, createRemoteManifest, createSftpProviderFactory, createSyncPlan, createTransferClient, createTransferJobsFromPlan, createTransferPlan, createTransferResult, diffRemoteTrees, downloadFile, emitLog, errorFromFtpReply, filterRemoteEntries, importFileZillaSites, importOpenSshConfig, importWinScpSessions, isClassicProviderId, isMainModule, isSensitiveKey, joinRemotePath, matchKnownHosts, matchKnownHostsEntry, noopLogger, normalizeRemotePath, parentRemotePath, parseFtpFeatures, parseFtpResponseLines, parseKnownHosts, parseMlsdLine, parseMlsdList, parseMlstTimestamp, parseOpenSshConfig, parseRemoteManifest, parseUnixList, parseUnixListLine, redactCommand, redactConnectionProfile, redactObject, redactSecretSource, redactValue, resolveConnectionProfileSecrets, resolveOpenSshHost, resolveProviderId, resolveSecret, runConnectionDiagnostics, serializeRemoteManifest, sortRemoteEntries, summarizeClientDiagnostics, summarizeTransferPlan, throttleByteIterable, uploadFile, validateConnectionProfile, walkRemoteTree };
|
package/dist/index.mjs
CHANGED
|
@@ -4785,6 +4785,19 @@ function isModifiedAtDifferent2(source, destination, toleranceMs) {
|
|
|
4785
4785
|
return Math.abs(sourceTime - destinationTime) > toleranceMs;
|
|
4786
4786
|
}
|
|
4787
4787
|
|
|
4788
|
+
// src/utils/mainModule.ts
|
|
4789
|
+
import { fileURLToPath } from "url";
|
|
4790
|
+
function isMainModule(importMetaUrl) {
|
|
4791
|
+
if (typeof process === "undefined" || !process.argv || process.argv.length < 2) {
|
|
4792
|
+
return false;
|
|
4793
|
+
}
|
|
4794
|
+
try {
|
|
4795
|
+
return process.argv[1] === fileURLToPath(importMetaUrl);
|
|
4796
|
+
} catch {
|
|
4797
|
+
return false;
|
|
4798
|
+
}
|
|
4799
|
+
}
|
|
4800
|
+
|
|
4788
4801
|
// src/providers/classic/ftp/FtpProvider.ts
|
|
4789
4802
|
import { Buffer as Buffer7 } from "buffer";
|
|
4790
4803
|
import { createConnection, isIP } from "net";
|
|
@@ -8738,7 +8751,7 @@ var SshTransportPacketUnprotector = class {
|
|
|
8738
8751
|
}
|
|
8739
8752
|
/**
|
|
8740
8753
|
* Feeds raw encrypted bytes from the socket and returns any fully decoded payloads.
|
|
8741
|
-
* Maintains internal framing state across calls
|
|
8754
|
+
* Maintains internal framing state across calls - pass each `data` event chunk directly.
|
|
8742
8755
|
*/
|
|
8743
8756
|
pushBytes(chunk) {
|
|
8744
8757
|
this.framePendingRaw = Buffer18.concat([this.framePendingRaw, chunk]);
|
|
@@ -9246,7 +9259,7 @@ var SshTransportConnection = class {
|
|
|
9246
9259
|
assertConnected() {
|
|
9247
9260
|
if (!this.connected) {
|
|
9248
9261
|
throw new ProtocolError({
|
|
9249
|
-
message: "SshTransportConnection is not yet connected
|
|
9262
|
+
message: "SshTransportConnection is not yet connected - call connect() first",
|
|
9250
9263
|
protocol: "sftp",
|
|
9251
9264
|
retryable: false
|
|
9252
9265
|
});
|
|
@@ -9586,14 +9599,14 @@ function sftpStatusToError(status, path2) {
|
|
|
9586
9599
|
case SFTP_STATUS.NO_SUCH_FILE:
|
|
9587
9600
|
return new PathNotFoundError({
|
|
9588
9601
|
details: { path: path2, sftpMessage: status.errorMessage },
|
|
9589
|
-
message: `SFTP: no such file or directory${path2 !== void 0 ? `
|
|
9602
|
+
message: `SFTP: no such file or directory${path2 !== void 0 ? ` - ${path2}` : ""}`,
|
|
9590
9603
|
protocol: "sftp",
|
|
9591
9604
|
retryable: false
|
|
9592
9605
|
});
|
|
9593
9606
|
case SFTP_STATUS.PERMISSION_DENIED:
|
|
9594
9607
|
return new PermissionDeniedError({
|
|
9595
9608
|
details: { path: path2, sftpMessage: status.errorMessage },
|
|
9596
|
-
message: `SFTP: permission denied${path2 !== void 0 ? `
|
|
9609
|
+
message: `SFTP: permission denied${path2 !== void 0 ? ` - ${path2}` : ""}`,
|
|
9597
9610
|
protocol: "sftp",
|
|
9598
9611
|
retryable: false
|
|
9599
9612
|
});
|
|
@@ -9601,21 +9614,21 @@ function sftpStatusToError(status, path2) {
|
|
|
9601
9614
|
case SFTP_STATUS.CONNECTION_LOST:
|
|
9602
9615
|
return new ConnectionError({
|
|
9603
9616
|
details: { sftpMessage: status.errorMessage, statusCode: status.statusCode },
|
|
9604
|
-
message: `SFTP: connection error
|
|
9617
|
+
message: `SFTP: connection error - ${status.errorMessage}`,
|
|
9605
9618
|
protocol: "sftp",
|
|
9606
9619
|
retryable: true
|
|
9607
9620
|
});
|
|
9608
9621
|
case SFTP_STATUS.OP_UNSUPPORTED:
|
|
9609
9622
|
return new UnsupportedFeatureError({
|
|
9610
9623
|
details: { sftpMessage: status.errorMessage },
|
|
9611
|
-
message: `SFTP: operation unsupported
|
|
9624
|
+
message: `SFTP: operation unsupported - ${status.errorMessage}`,
|
|
9612
9625
|
protocol: "sftp",
|
|
9613
9626
|
retryable: false
|
|
9614
9627
|
});
|
|
9615
9628
|
case SFTP_STATUS.BAD_MESSAGE:
|
|
9616
9629
|
return new ProtocolError({
|
|
9617
9630
|
details: { sftpMessage: status.errorMessage },
|
|
9618
|
-
message: `SFTP: bad message
|
|
9631
|
+
message: `SFTP: bad message - ${status.errorMessage}`,
|
|
9619
9632
|
protocol: "sftp",
|
|
9620
9633
|
retryable: false
|
|
9621
9634
|
});
|
|
@@ -9623,7 +9636,7 @@ function sftpStatusToError(status, path2) {
|
|
|
9623
9636
|
return new ZeroTransferError({
|
|
9624
9637
|
code: "SFTP_FAILURE",
|
|
9625
9638
|
details: { sftpMessage: status.errorMessage, statusCode: status.statusCode },
|
|
9626
|
-
message: `SFTP: operation failed (status ${status.statusCode})
|
|
9639
|
+
message: `SFTP: operation failed (status ${status.statusCode}) - ${status.errorMessage}`,
|
|
9627
9640
|
protocol: "sftp",
|
|
9628
9641
|
retryable: false
|
|
9629
9642
|
});
|
|
@@ -10033,7 +10046,7 @@ function buildNativeSftpCapabilities(maxConcurrency) {
|
|
|
10033
10046
|
var NATIVE_SFTP_PROVIDER_CAPABILITIES = buildNativeSftpCapabilities(
|
|
10034
10047
|
NATIVE_SFTP_DEFAULT_MAX_CONCURRENCY
|
|
10035
10048
|
);
|
|
10036
|
-
function
|
|
10049
|
+
function createSftpProviderFactory(options = {}) {
|
|
10037
10050
|
validateNativeSftpOptions(options);
|
|
10038
10051
|
const capabilities = buildNativeSftpCapabilities(
|
|
10039
10052
|
options.maxConcurrency ?? NATIVE_SFTP_DEFAULT_MAX_CONCURRENCY
|
|
@@ -10731,7 +10744,7 @@ export {
|
|
|
10731
10744
|
createProviderTransferExecutor,
|
|
10732
10745
|
createRemoteBrowser,
|
|
10733
10746
|
createRemoteManifest,
|
|
10734
|
-
|
|
10747
|
+
createSftpProviderFactory,
|
|
10735
10748
|
createSyncPlan,
|
|
10736
10749
|
createTransferClient,
|
|
10737
10750
|
createTransferJobsFromPlan,
|
|
@@ -10746,6 +10759,7 @@ export {
|
|
|
10746
10759
|
importOpenSshConfig,
|
|
10747
10760
|
importWinScpSessions,
|
|
10748
10761
|
isClassicProviderId,
|
|
10762
|
+
isMainModule,
|
|
10749
10763
|
isSensitiveKey,
|
|
10750
10764
|
joinRemotePath,
|
|
10751
10765
|
matchKnownHosts,
|