@zero-transfer/sdk 0.1.0-alpha.0 → 0.1.2
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/LICENSE +21 -21
- package/README.md +182 -213
- package/assets/zero-transfer-logo.svg +201 -201
- package/dist/index.cjs +357 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +356 -5
- package/dist/index.d.ts +356 -5
- package/dist/index.mjs +367 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +16 -4
- package/CHANGELOG.md +0 -177
package/dist/index.d.mts
CHANGED
|
@@ -375,7 +375,17 @@ interface TlsProfile {
|
|
|
375
375
|
minVersion?: SecureVersion;
|
|
376
376
|
/** Maximum TLS protocol version accepted by the client. */
|
|
377
377
|
maxVersion?: SecureVersion;
|
|
378
|
-
/**
|
|
378
|
+
/**
|
|
379
|
+
* Optional. Expected server certificate SHA-256 fingerprint(s) for **certificate pinning**, in
|
|
380
|
+
* hex form with or without colons. When present, the TLS handshake additionally requires the
|
|
381
|
+
* leaf certificate's SHA-256 fingerprint to match one of these values.
|
|
382
|
+
*
|
|
383
|
+
* Not required for normal CA-trusted endpoints — public CAs and `ca` bundles already gate
|
|
384
|
+
* trust via `rejectUnauthorized`. Pinning is **recommended for production** when you control
|
|
385
|
+
* the server and want defence-in-depth against rogue certificates issued by trusted CAs.
|
|
386
|
+
*
|
|
387
|
+
* @example "AA:BB:CC:DD:EE:FF:00:11:22:33:44:55:66:77:88:99:AA:BB:CC:DD:EE:FF:00:11:22:33:44:55:66:77:88:99"
|
|
388
|
+
*/
|
|
379
389
|
pinnedFingerprint256?: string | readonly string[];
|
|
380
390
|
/** Optional custom server identity checker for private PKI or certificate pinning. */
|
|
381
391
|
checkServerIdentity?: (host: string, cert: PeerCertificate) => Error | undefined;
|
|
@@ -395,9 +405,25 @@ interface SshProfile {
|
|
|
395
405
|
privateKey?: SecretSource;
|
|
396
406
|
/** Passphrase used to decrypt an encrypted private key. */
|
|
397
407
|
passphrase?: SecretSource;
|
|
398
|
-
/**
|
|
408
|
+
/**
|
|
409
|
+
* Optional. OpenSSH `known_hosts` content used for **strict SFTP host-key verification**.
|
|
410
|
+
* Mutually exclusive with provider-level `hostHash`/`hostVerifier` options.
|
|
411
|
+
*
|
|
412
|
+
* Not required for the connection to succeed, but **strongly recommended for production**:
|
|
413
|
+
* without `knownHosts` (and without {@link SshProfile.pinnedHostKeySha256 | pinnedHostKeySha256}),
|
|
414
|
+
* the SSH session accepts any host key the server presents, leaving you exposed to MITM.
|
|
415
|
+
*/
|
|
399
416
|
knownHosts?: SshKnownHostsSource;
|
|
400
|
-
/**
|
|
417
|
+
/**
|
|
418
|
+
* Optional. SSH host-key SHA-256 fingerprint(s) the remote must present, in OpenSSH
|
|
419
|
+
* `SHA256:<base64>` form, raw base64, or hex.
|
|
420
|
+
*
|
|
421
|
+
* Use this as a lighter-weight alternative to a full `known_hosts` file when you only need
|
|
422
|
+
* to pin a single host. Like `knownHosts`, it is **optional but recommended for production**;
|
|
423
|
+
* leaving both unset disables host-key verification entirely.
|
|
424
|
+
*
|
|
425
|
+
* @example "SHA256:abc123basesixfourpinFromKnownHosts="
|
|
426
|
+
*/
|
|
401
427
|
pinnedHostKeySha256?: string | readonly string[];
|
|
402
428
|
/** Runtime callback that answers SSH keyboard-interactive authentication prompts. */
|
|
403
429
|
keyboardInteractive?: SshKeyboardInteractiveHandler;
|
|
@@ -406,6 +432,46 @@ interface SshProfile {
|
|
|
406
432
|
}
|
|
407
433
|
/**
|
|
408
434
|
* Connection settings accepted by facade and adapter implementations.
|
|
435
|
+
*
|
|
436
|
+
* Every `ConnectionProfile` has a `host` and a `provider` (or `protocol`).
|
|
437
|
+
* Authentication and transport-specific material is layered on via the
|
|
438
|
+
* optional `ssh`, `tls`, `oauth`, and provider-specific blocks (e.g. `s3`,
|
|
439
|
+
* `azure`, `dropbox`).
|
|
440
|
+
*
|
|
441
|
+
* @example SFTP with public-key auth
|
|
442
|
+
* ```ts
|
|
443
|
+
* const profile: ConnectionProfile = {
|
|
444
|
+
* host: "sftp.example.com",
|
|
445
|
+
* provider: "sftp",
|
|
446
|
+
* username: "deploy",
|
|
447
|
+
* ssh: {
|
|
448
|
+
* privateKey: { path: "./keys/id_ed25519" },
|
|
449
|
+
* pinnedHostKeySha256: "SHA256:abc123basesixfourpinFromKnownHosts=",
|
|
450
|
+
* },
|
|
451
|
+
* };
|
|
452
|
+
* ```
|
|
453
|
+
*
|
|
454
|
+
* @example FTPS with username/password and public-CA TLS
|
|
455
|
+
* ```ts
|
|
456
|
+
* const profile: ConnectionProfile = {
|
|
457
|
+
* host: "ftps.example.com",
|
|
458
|
+
* provider: "ftps",
|
|
459
|
+
* username: "deploy",
|
|
460
|
+
* password: { env: "FTPS_PASSWORD" },
|
|
461
|
+
* tls: { minVersion: "TLSv1.2" },
|
|
462
|
+
* };
|
|
463
|
+
* ```
|
|
464
|
+
*
|
|
465
|
+
* @example S3-compatible
|
|
466
|
+
* ```ts
|
|
467
|
+
* const profile: ConnectionProfile = {
|
|
468
|
+
* host: "my-bucket",
|
|
469
|
+
* provider: "s3",
|
|
470
|
+
* username: process.env.AWS_ACCESS_KEY_ID,
|
|
471
|
+
* password: { env: "AWS_SECRET_ACCESS_KEY" },
|
|
472
|
+
* s3: { region: "us-east-1" },
|
|
473
|
+
* };
|
|
474
|
+
* ```
|
|
409
475
|
*/
|
|
410
476
|
interface ConnectionProfile {
|
|
411
477
|
/** Provider to use for this connection. Prefer this over the compatibility protocol field. */
|
|
@@ -451,6 +517,44 @@ interface StatOptions {
|
|
|
451
517
|
/** Abort signal used to cancel the metadata operation. */
|
|
452
518
|
signal?: AbortSignal;
|
|
453
519
|
}
|
|
520
|
+
/**
|
|
521
|
+
* Options for removing a remote file entry.
|
|
522
|
+
*/
|
|
523
|
+
interface RemoveOptions {
|
|
524
|
+
/** Abort signal used to cancel the operation. */
|
|
525
|
+
signal?: AbortSignal;
|
|
526
|
+
/** When true, do not throw if the path does not exist. */
|
|
527
|
+
ignoreMissing?: boolean;
|
|
528
|
+
}
|
|
529
|
+
/**
|
|
530
|
+
* Options for renaming or moving a remote entry.
|
|
531
|
+
*/
|
|
532
|
+
interface RenameOptions {
|
|
533
|
+
/** Abort signal used to cancel the operation. */
|
|
534
|
+
signal?: AbortSignal;
|
|
535
|
+
/** Allow overwriting an existing destination when the provider supports it. */
|
|
536
|
+
overwrite?: boolean;
|
|
537
|
+
}
|
|
538
|
+
/**
|
|
539
|
+
* Options for creating a remote directory.
|
|
540
|
+
*/
|
|
541
|
+
interface MkdirOptions {
|
|
542
|
+
/** Abort signal used to cancel the operation. */
|
|
543
|
+
signal?: AbortSignal;
|
|
544
|
+
/** Create missing parent directories along the way. */
|
|
545
|
+
recursive?: boolean;
|
|
546
|
+
}
|
|
547
|
+
/**
|
|
548
|
+
* Options for removing a remote directory.
|
|
549
|
+
*/
|
|
550
|
+
interface RmdirOptions {
|
|
551
|
+
/** Abort signal used to cancel the operation. */
|
|
552
|
+
signal?: AbortSignal;
|
|
553
|
+
/** Recursively remove non-empty directory contents. */
|
|
554
|
+
recursive?: boolean;
|
|
555
|
+
/** When true, do not throw if the path does not exist. */
|
|
556
|
+
ignoreMissing?: boolean;
|
|
557
|
+
}
|
|
454
558
|
/**
|
|
455
559
|
* Progress snapshot emitted while a transfer is running.
|
|
456
560
|
*/
|
|
@@ -508,6 +612,14 @@ interface RemoteFileSystem {
|
|
|
508
612
|
list(path: string, options?: ListOptions): Promise<RemoteEntry[]>;
|
|
509
613
|
/** Reads metadata for a provider path. */
|
|
510
614
|
stat(path: string, options?: StatOptions): Promise<RemoteStat>;
|
|
615
|
+
/** Removes a file entry when supported by the provider. */
|
|
616
|
+
remove?(path: string, options?: RemoveOptions): Promise<void>;
|
|
617
|
+
/** Renames or moves an entry when supported by the provider. */
|
|
618
|
+
rename?(from: string, to: string, options?: RenameOptions): Promise<void>;
|
|
619
|
+
/** Creates a directory when supported by the provider. */
|
|
620
|
+
mkdir?(path: string, options?: MkdirOptions): Promise<void>;
|
|
621
|
+
/** Removes a directory when supported by the provider. */
|
|
622
|
+
rmdir?(path: string, options?: RmdirOptions): Promise<void>;
|
|
511
623
|
}
|
|
512
624
|
|
|
513
625
|
/**
|
|
@@ -982,8 +1094,50 @@ declare class TransferClient {
|
|
|
982
1094
|
/**
|
|
983
1095
|
* Creates a provider-neutral transfer client.
|
|
984
1096
|
*
|
|
1097
|
+
* The returned client owns a registry of provider factories and produces
|
|
1098
|
+
* `TransferSession` instances on demand via {@link TransferClient.connect}.
|
|
1099
|
+
* Registering only the providers you actually use keeps bundle size small
|
|
1100
|
+
* (each factory pulls in its own SDK dependencies).
|
|
1101
|
+
*
|
|
985
1102
|
* @param options - Optional registry, provider factories, and logger.
|
|
986
1103
|
* @returns A disconnected {@link TransferClient} instance.
|
|
1104
|
+
*
|
|
1105
|
+
* @example Multi-provider client
|
|
1106
|
+
* ```ts
|
|
1107
|
+
* import {
|
|
1108
|
+
* createS3ProviderFactory,
|
|
1109
|
+
* createSftpProviderFactory,
|
|
1110
|
+
* createTransferClient,
|
|
1111
|
+
* } from "@zero-transfer/sdk";
|
|
1112
|
+
*
|
|
1113
|
+
* const client = createTransferClient({
|
|
1114
|
+
* providers: [createSftpProviderFactory(), createS3ProviderFactory()],
|
|
1115
|
+
* });
|
|
1116
|
+
*
|
|
1117
|
+
* const session = await client.connect({
|
|
1118
|
+
* host: "sftp.example.com",
|
|
1119
|
+
* provider: "sftp",
|
|
1120
|
+
* username: "deploy",
|
|
1121
|
+
* ssh: { privateKey: { path: "./keys/id_ed25519" } },
|
|
1122
|
+
* });
|
|
1123
|
+
* try {
|
|
1124
|
+
* const list = await session.fs.list("/uploads");
|
|
1125
|
+
* console.log(list);
|
|
1126
|
+
* } finally {
|
|
1127
|
+
* await session.disconnect();
|
|
1128
|
+
* }
|
|
1129
|
+
* ```
|
|
1130
|
+
*
|
|
1131
|
+
* @example Friendly one-shot helpers
|
|
1132
|
+
* ```ts
|
|
1133
|
+
* import { uploadFile } from "@zero-transfer/sdk";
|
|
1134
|
+
*
|
|
1135
|
+
* await uploadFile({
|
|
1136
|
+
* client,
|
|
1137
|
+
* destination: { path: "/uploads/report.csv", profile },
|
|
1138
|
+
* localPath: "./out/report.csv",
|
|
1139
|
+
* });
|
|
1140
|
+
* ```
|
|
987
1141
|
*/
|
|
988
1142
|
declare function createTransferClient(options?: TransferClientOptions): TransferClient;
|
|
989
1143
|
|
|
@@ -1280,8 +1434,37 @@ interface UploadFileOptions extends FriendlyTransferOptions {
|
|
|
1280
1434
|
/**
|
|
1281
1435
|
* Uploads a single local file to a remote endpoint.
|
|
1282
1436
|
*
|
|
1437
|
+
* The remote provider is resolved from `destination.profile.provider`, so any
|
|
1438
|
+
* provider factory you registered with {@link createTransferClient} can be used
|
|
1439
|
+
* as the destination.
|
|
1440
|
+
*
|
|
1283
1441
|
* @param options - Friendly upload options.
|
|
1284
1442
|
* @returns Receipt produced by the underlying transfer engine.
|
|
1443
|
+
*
|
|
1444
|
+
* @example Upload to SFTP with public-key auth
|
|
1445
|
+
* ```ts
|
|
1446
|
+
* import {
|
|
1447
|
+
* createSftpProviderFactory,
|
|
1448
|
+
* createTransferClient,
|
|
1449
|
+
* uploadFile,
|
|
1450
|
+
* } from "@zero-transfer/sdk";
|
|
1451
|
+
*
|
|
1452
|
+
* const client = createTransferClient({ providers: [createSftpProviderFactory()] });
|
|
1453
|
+
*
|
|
1454
|
+
* await uploadFile({
|
|
1455
|
+
* client,
|
|
1456
|
+
* destination: {
|
|
1457
|
+
* path: "/uploads/report.csv",
|
|
1458
|
+
* profile: {
|
|
1459
|
+
* host: "sftp.example.com",
|
|
1460
|
+
* provider: "sftp",
|
|
1461
|
+
* username: "deploy",
|
|
1462
|
+
* ssh: { privateKey: { path: "./keys/id_ed25519" } },
|
|
1463
|
+
* },
|
|
1464
|
+
* },
|
|
1465
|
+
* localPath: "./out/report.csv",
|
|
1466
|
+
* });
|
|
1467
|
+
* ```
|
|
1285
1468
|
*/
|
|
1286
1469
|
declare function uploadFile(options: UploadFileOptions): Promise<TransferReceipt>;
|
|
1287
1470
|
/** Options for {@link downloadFile}. */
|
|
@@ -1296,8 +1479,35 @@ interface DownloadFileOptions extends FriendlyTransferOptions {
|
|
|
1296
1479
|
/**
|
|
1297
1480
|
* Downloads a single remote file to a local path.
|
|
1298
1481
|
*
|
|
1482
|
+
* The remote provider is resolved from `source.profile.provider`. The local
|
|
1483
|
+
* destination path is created (including parent directories) on demand.
|
|
1484
|
+
*
|
|
1299
1485
|
* @param options - Friendly download options.
|
|
1300
1486
|
* @returns Receipt produced by the underlying transfer engine.
|
|
1487
|
+
*
|
|
1488
|
+
* @example Download from S3
|
|
1489
|
+
* ```ts
|
|
1490
|
+
* import {
|
|
1491
|
+
* createS3ProviderFactory,
|
|
1492
|
+
* createTransferClient,
|
|
1493
|
+
* downloadFile,
|
|
1494
|
+
* } from "@zero-transfer/sdk";
|
|
1495
|
+
*
|
|
1496
|
+
* const client = createTransferClient({ providers: [createS3ProviderFactory()] });
|
|
1497
|
+
*
|
|
1498
|
+
* await downloadFile({
|
|
1499
|
+
* client,
|
|
1500
|
+
* localPath: "./tmp/snapshot.tar.gz",
|
|
1501
|
+
* source: {
|
|
1502
|
+
* path: "snapshots/2026-04-28/snapshot.tar.gz",
|
|
1503
|
+
* profile: {
|
|
1504
|
+
* host: "snapshots", // S3 bucket
|
|
1505
|
+
* provider: "s3",
|
|
1506
|
+
* s3: { region: "us-east-1" },
|
|
1507
|
+
* },
|
|
1508
|
+
* },
|
|
1509
|
+
* });
|
|
1510
|
+
* ```
|
|
1301
1511
|
*/
|
|
1302
1512
|
declare function downloadFile(options: DownloadFileOptions): Promise<TransferReceipt>;
|
|
1303
1513
|
/** Options for {@link copyBetween}. */
|
|
@@ -1312,8 +1522,38 @@ interface CopyBetweenOptions extends FriendlyTransferOptions {
|
|
|
1312
1522
|
/**
|
|
1313
1523
|
* Copies a file between two remote endpoints in a single call.
|
|
1314
1524
|
*
|
|
1525
|
+
* Both source and destination providers must be registered with the
|
|
1526
|
+
* {@link TransferClient}. Streams are piped end-to-end without staging the file
|
|
1527
|
+
* on the local disk.
|
|
1528
|
+
*
|
|
1315
1529
|
* @param options - Friendly copy options.
|
|
1316
1530
|
* @returns Receipt produced by the underlying transfer engine.
|
|
1531
|
+
*
|
|
1532
|
+
* @example Copy from SFTP to S3
|
|
1533
|
+
* ```ts
|
|
1534
|
+
* import {
|
|
1535
|
+
* copyBetween,
|
|
1536
|
+
* createS3ProviderFactory,
|
|
1537
|
+
* createSftpProviderFactory,
|
|
1538
|
+
* createTransferClient,
|
|
1539
|
+
* } from "@zero-transfer/sdk";
|
|
1540
|
+
*
|
|
1541
|
+
* const client = createTransferClient({
|
|
1542
|
+
* providers: [createSftpProviderFactory(), createS3ProviderFactory()],
|
|
1543
|
+
* });
|
|
1544
|
+
*
|
|
1545
|
+
* await copyBetween({
|
|
1546
|
+
* client,
|
|
1547
|
+
* source: {
|
|
1548
|
+
* path: "/exports/daily.csv",
|
|
1549
|
+
* profile: { host: "sftp.example.com", provider: "sftp", username: "etl" },
|
|
1550
|
+
* },
|
|
1551
|
+
* destination: {
|
|
1552
|
+
* path: "warehouse/daily.csv",
|
|
1553
|
+
* profile: { host: "warehouse", provider: "s3", s3: { region: "us-east-1" } },
|
|
1554
|
+
* },
|
|
1555
|
+
* });
|
|
1556
|
+
* ```
|
|
1317
1557
|
*/
|
|
1318
1558
|
declare function copyBetween(options: CopyBetweenOptions): Promise<TransferReceipt>;
|
|
1319
1559
|
|
|
@@ -1444,8 +1684,24 @@ interface LocalProviderOptions {
|
|
|
1444
1684
|
/**
|
|
1445
1685
|
* Creates a provider factory backed by the local filesystem.
|
|
1446
1686
|
*
|
|
1687
|
+
* Useful for copying files between two remote endpoints via a local staging
|
|
1688
|
+
* area, or as the destination for `downloadFile`. The friendly `uploadFile`
|
|
1689
|
+
* helper registers a local provider implicitly.
|
|
1690
|
+
*
|
|
1447
1691
|
* @param options - Optional local root path exposed through provider sessions.
|
|
1448
1692
|
* @returns Provider factory suitable for `createTransferClient({ providers: [...] })`.
|
|
1693
|
+
*
|
|
1694
|
+
* @example Use a fixed root directory
|
|
1695
|
+
* ```ts
|
|
1696
|
+
* import { createLocalProviderFactory, createTransferClient } from "@zero-transfer/sdk";
|
|
1697
|
+
*
|
|
1698
|
+
* const client = createTransferClient({
|
|
1699
|
+
* providers: [createLocalProviderFactory({ rootPath: "/var/lib/zt-staging" })],
|
|
1700
|
+
* });
|
|
1701
|
+
*
|
|
1702
|
+
* const session = await client.connect({ host: "staging", provider: "local" });
|
|
1703
|
+
* const list = await session.fs.list("/");
|
|
1704
|
+
* ```
|
|
1449
1705
|
*/
|
|
1450
1706
|
declare function createLocalProviderFactory(options?: LocalProviderOptions): ProviderFactory;
|
|
1451
1707
|
|
|
@@ -1692,7 +1948,7 @@ interface S3MultipartPart {
|
|
|
1692
1948
|
* Persistence contract for resuming partial multipart uploads across
|
|
1693
1949
|
* processes or retries. Implementations may be synchronous or asynchronous;
|
|
1694
1950
|
* `clear` is invoked once the multipart upload completes successfully (or is
|
|
1695
|
-
* explicitly aborted
|
|
1951
|
+
* explicitly aborted).
|
|
1696
1952
|
*/
|
|
1697
1953
|
interface S3MultipartResumeStore {
|
|
1698
1954
|
load(key: S3MultipartResumeKey): Promise<S3MultipartCheckpoint | undefined> | S3MultipartCheckpoint | undefined;
|
|
@@ -1707,6 +1963,34 @@ declare function createMemoryS3MultipartResumeStore(): S3MultipartResumeStore;
|
|
|
1707
1963
|
* Credentials must be supplied via the connection profile: `username` is the
|
|
1708
1964
|
* access key id and `password` is the secret access key. `profile.host` may
|
|
1709
1965
|
* be set to the bucket name (taking precedence over `options.bucket`).
|
|
1966
|
+
*
|
|
1967
|
+
* Works with AWS S3 and any S3-compatible API (MinIO, Cloudflare R2,
|
|
1968
|
+
* Backblaze B2, DigitalOcean Spaces, Wasabi, etc.) via `options.endpoint`.
|
|
1969
|
+
*
|
|
1970
|
+
* @example AWS S3
|
|
1971
|
+
* ```ts
|
|
1972
|
+
* import { createS3ProviderFactory, createTransferClient } from "@zero-transfer/sdk";
|
|
1973
|
+
*
|
|
1974
|
+
* const client = createTransferClient({ providers: [createS3ProviderFactory()] });
|
|
1975
|
+
*
|
|
1976
|
+
* const session = await client.connect({
|
|
1977
|
+
* host: "my-bucket",
|
|
1978
|
+
* provider: "s3",
|
|
1979
|
+
* username: process.env.AWS_ACCESS_KEY_ID,
|
|
1980
|
+
* password: { env: "AWS_SECRET_ACCESS_KEY" },
|
|
1981
|
+
* s3: { region: "us-east-1" },
|
|
1982
|
+
* });
|
|
1983
|
+
* ```
|
|
1984
|
+
*
|
|
1985
|
+
* @example MinIO / R2 / S3-compatible endpoint
|
|
1986
|
+
* ```ts
|
|
1987
|
+
* const client = createTransferClient({
|
|
1988
|
+
* providers: [createS3ProviderFactory({
|
|
1989
|
+
* endpoint: "https://minio.internal:9000",
|
|
1990
|
+
* pathStyle: true,
|
|
1991
|
+
* })],
|
|
1992
|
+
* });
|
|
1993
|
+
* ```
|
|
1710
1994
|
*/
|
|
1711
1995
|
declare function createS3ProviderFactory(options?: S3ProviderOptions): ProviderFactory;
|
|
1712
1996
|
|
|
@@ -2325,6 +2609,20 @@ interface FtpsProviderOptions extends FtpProviderOptions {
|
|
|
2325
2609
|
*
|
|
2326
2610
|
* @param options - Optional provider defaults.
|
|
2327
2611
|
* @returns Provider factory suitable for `createTransferClient({ providers: [...] })`.
|
|
2612
|
+
*
|
|
2613
|
+
* @example Plain FTP (cleartext — prefer FTPS or SFTP whenever possible)
|
|
2614
|
+
* ```ts
|
|
2615
|
+
* import { createFtpProviderFactory, createTransferClient } from "@zero-transfer/sdk";
|
|
2616
|
+
*
|
|
2617
|
+
* const client = createTransferClient({ providers: [createFtpProviderFactory()] });
|
|
2618
|
+
*
|
|
2619
|
+
* const session = await client.connect({
|
|
2620
|
+
* host: "ftp.example.com",
|
|
2621
|
+
* provider: "ftp",
|
|
2622
|
+
* username: "deploy",
|
|
2623
|
+
* password: { env: "FTP_PASSWORD" },
|
|
2624
|
+
* });
|
|
2625
|
+
* ```
|
|
2328
2626
|
*/
|
|
2329
2627
|
declare function createFtpProviderFactory(options?: FtpProviderOptions): ProviderFactory;
|
|
2330
2628
|
/**
|
|
@@ -2335,6 +2633,37 @@ declare function createFtpProviderFactory(options?: FtpProviderOptions): Provide
|
|
|
2335
2633
|
*
|
|
2336
2634
|
* @param options - Optional provider defaults.
|
|
2337
2635
|
* @returns Provider factory suitable for `createTransferClient({ providers: [...] })`.
|
|
2636
|
+
*
|
|
2637
|
+
* @example FTPS with public-CA TLS (no extra TLS material needed)
|
|
2638
|
+
* ```ts
|
|
2639
|
+
* import { createFtpsProviderFactory, createTransferClient } from "@zero-transfer/sdk";
|
|
2640
|
+
*
|
|
2641
|
+
* const client = createTransferClient({ providers: [createFtpsProviderFactory()] });
|
|
2642
|
+
*
|
|
2643
|
+
* const session = await client.connect({
|
|
2644
|
+
* host: "ftps.example.com",
|
|
2645
|
+
* provider: "ftps",
|
|
2646
|
+
* username: "deploy",
|
|
2647
|
+
* password: { env: "FTPS_PASSWORD" },
|
|
2648
|
+
* tls: { minVersion: "TLSv1.2" },
|
|
2649
|
+
* });
|
|
2650
|
+
* ```
|
|
2651
|
+
*
|
|
2652
|
+
* @example FTPS with private CA + certificate pinning (defence-in-depth)
|
|
2653
|
+
* ```ts
|
|
2654
|
+
* await client.connect({
|
|
2655
|
+
* host: "ftps.internal.example",
|
|
2656
|
+
* provider: "ftps",
|
|
2657
|
+
* username: "audit",
|
|
2658
|
+
* tls: {
|
|
2659
|
+
* ca: { path: "./certs/ca-bundle.pem" },
|
|
2660
|
+
* cert: { path: "./certs/client.crt" },
|
|
2661
|
+
* key: { path: "./certs/client.key" },
|
|
2662
|
+
* // Optional but recommended:
|
|
2663
|
+
* pinnedFingerprint256: "AA:BB:CC:DD:EE:FF:00:11:22:33:44:55:66:77:88:99:AA:BB:CC:DD:EE:FF:00:11:22:33:44:55:66:77:88:99",
|
|
2664
|
+
* },
|
|
2665
|
+
* });
|
|
2666
|
+
* ```
|
|
2338
2667
|
*/
|
|
2339
2668
|
declare function createFtpsProviderFactory(options?: FtpsProviderOptions): ProviderFactory;
|
|
2340
2669
|
|
|
@@ -2514,6 +2843,28 @@ interface SftpRawSession {
|
|
|
2514
2843
|
*
|
|
2515
2844
|
* @param options - Optional ssh2 host-key verifier and timeout defaults.
|
|
2516
2845
|
* @returns Provider factory suitable for `createTransferClient({ providers: [...] })`.
|
|
2846
|
+
*
|
|
2847
|
+
* @example Register and use
|
|
2848
|
+
* ```ts
|
|
2849
|
+
* import { createSftpProviderFactory, createTransferClient } from "@zero-transfer/sdk";
|
|
2850
|
+
*
|
|
2851
|
+
* const client = createTransferClient({ providers: [createSftpProviderFactory()] });
|
|
2852
|
+
*
|
|
2853
|
+
* const session = await client.connect({
|
|
2854
|
+
* host: "sftp.example.com",
|
|
2855
|
+
* provider: "sftp",
|
|
2856
|
+
* username: "deploy",
|
|
2857
|
+
* ssh: {
|
|
2858
|
+
* privateKey: { path: "./keys/id_ed25519" },
|
|
2859
|
+
* // Optional but recommended for production:
|
|
2860
|
+
* pinnedHostKeySha256: "SHA256:abc123basesixfourpinFromKnownHosts=",
|
|
2861
|
+
* },
|
|
2862
|
+
* });
|
|
2863
|
+
* ```
|
|
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.
|
|
2517
2868
|
*/
|
|
2518
2869
|
declare function createSftpProviderFactory(options?: SftpProviderOptions): ProviderFactory;
|
|
2519
2870
|
|
|
@@ -4183,4 +4534,4 @@ declare function joinRemotePath(...segments: string[]): string;
|
|
|
4183
4534
|
*/
|
|
4184
4535
|
declare function basenameRemotePath(input: string): string;
|
|
4185
4536
|
|
|
4186
|
-
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 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 ResolveSecretOptions, type ResolvedConnectionProfile, type ResolvedOpenSshHost, type ResolvedSshProfile, type ResolvedTlsProfile, type RetentionEvaluation, type RetentionPolicy, 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 SftpJumpHostOptions, 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 WebDavProviderOptions, type WebhookRetryPolicy, type WebhookSignature, type WebhookTarget, type WinScpSession, ZeroTransfer, type ZeroTransferCapabilities, ZeroTransferError, type ZeroTransferErrorDetails, type ZeroTransferLogger, type ZeroTransferOptions, assertSafeFtpArgument, basenameRemotePath, buildRemoteBreadcrumbs, compareRemoteManifests, composeAuditLogs, copyBetween, createApprovalGate, createAtomicDeployPlan, createAzureBlobProviderFactory, createBandwidthThrottle, createDropboxProviderFactory, createFtpProviderFactory, createFtpsProviderFactory, createGcsProviderFactory, createGoogleDriveProviderFactory, createHttpProviderFactory, createInboxRoute, createJsonlAuditLog, createLocalProviderFactory, createMemoryProviderFactory, createMemoryS3MultipartResumeStore, createOAuthTokenSecretSource, createOneDriveProviderFactory, createOutboxRoute, createProgressEvent, createProviderTransferExecutor, createRemoteBrowser, createRemoteManifest, createS3ProviderFactory, createSftpJumpHostSocketFactory, 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, 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 };
|
|
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 SftpJumpHostOptions, 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 WebDavProviderOptions, type WebhookRetryPolicy, type WebhookSignature, type WebhookTarget, type WinScpSession, ZeroTransfer, type ZeroTransferCapabilities, ZeroTransferError, type ZeroTransferErrorDetails, type ZeroTransferLogger, type ZeroTransferOptions, assertSafeFtpArgument, basenameRemotePath, buildRemoteBreadcrumbs, compareRemoteManifests, composeAuditLogs, copyBetween, createApprovalGate, createAtomicDeployPlan, createAzureBlobProviderFactory, createBandwidthThrottle, createDropboxProviderFactory, createFtpProviderFactory, createFtpsProviderFactory, createGcsProviderFactory, createGoogleDriveProviderFactory, createHttpProviderFactory, createInboxRoute, createJsonlAuditLog, createLocalProviderFactory, createMemoryProviderFactory, createMemoryS3MultipartResumeStore, createOAuthTokenSecretSource, createOneDriveProviderFactory, createOutboxRoute, createProgressEvent, createProviderTransferExecutor, createRemoteBrowser, createRemoteManifest, createS3ProviderFactory, createSftpJumpHostSocketFactory, 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, 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 };
|