@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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zero-transfer/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Unified TypeScript file transfer SDK for Node.js",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -17,22 +17,33 @@
|
|
|
17
17
|
"assets",
|
|
18
18
|
"dist",
|
|
19
19
|
"README.md",
|
|
20
|
-
"LICENSE"
|
|
21
|
-
"CHANGELOG.md"
|
|
20
|
+
"LICENSE"
|
|
22
21
|
],
|
|
23
22
|
"scripts": {
|
|
24
23
|
"build": "tsup",
|
|
25
|
-
"ci": "npm run
|
|
24
|
+
"ci": "npm run build && npm run packages:generate && npm run lint && npm run format:check && npm run typecheck && npm run test:coverage && npm run pack:dry",
|
|
26
25
|
"docs": "typedoc",
|
|
26
|
+
"docs:md": "typedoc --options typedoc.markdown.json",
|
|
27
|
+
"docs:scopes": "node scripts/generate-scope-docs.mjs",
|
|
28
|
+
"docs:all": "npm run docs && npm run docs:md && npm run docs:scopes",
|
|
27
29
|
"format": "prettier --write .",
|
|
28
30
|
"format:check": "prettier --check .",
|
|
29
31
|
"lint": "eslint .",
|
|
30
32
|
"pack:dry": "npm pack --dry-run",
|
|
31
33
|
"packages:generate": "node scripts/generate-package-stubs.mjs",
|
|
32
34
|
"packages:publish": "node scripts/publish-package-stubs.mjs",
|
|
35
|
+
"postinstall": "node scripts/link-sdk.mjs",
|
|
33
36
|
"prepack": "npm run build",
|
|
37
|
+
"release": "node scripts/release.mjs",
|
|
38
|
+
"release:patch": "node scripts/release.mjs patch",
|
|
39
|
+
"release:minor": "node scripts/release.mjs minor",
|
|
40
|
+
"release:major": "node scripts/release.mjs major",
|
|
41
|
+
"release:alpha": "node scripts/release.mjs prerelease alpha",
|
|
42
|
+
"release:beta": "node scripts/release.mjs prerelease beta",
|
|
43
|
+
"release:rc": "node scripts/release.mjs prerelease rc",
|
|
34
44
|
"test": "vitest run",
|
|
35
45
|
"test:coverage": "vitest run --coverage",
|
|
46
|
+
"test:report": "vitest run --reporter=default --reporter=json --outputFile=coverage/test-results.json --coverage",
|
|
36
47
|
"test:integration:ftp": "vitest run test/integration/ftpProvider.docker.test.ts",
|
|
37
48
|
"test:watch": "vitest",
|
|
38
49
|
"typecheck": "tsc --noEmit"
|
|
@@ -84,6 +95,7 @@
|
|
|
84
95
|
"prettier": "^3.8.3",
|
|
85
96
|
"tsup": "^8.5.1",
|
|
86
97
|
"typedoc": "^0.28.19",
|
|
98
|
+
"typedoc-plugin-markdown": "^4.11.0",
|
|
87
99
|
"typescript": "^6.0.3",
|
|
88
100
|
"typescript-eslint": "^8.59.0",
|
|
89
101
|
"vitest": "^4.1.5"
|
package/CHANGELOG.md
DELETED
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
## [0.1.0-alpha.0] - 2026-04-27
|
|
4
|
-
|
|
5
|
-
### Changed
|
|
6
|
-
|
|
7
|
-
- Prepared the package to publish under the `zero-transfer` npm organization as `@zero-transfer/sdk`.
|
|
8
|
-
- Updated repository metadata and documentation for the `tonywied17/zero-transfer` GitHub repository.
|
|
9
|
-
- Refreshed the animated ZeroTransfer logo and package tagline around a unified file-transfer SDK identity.
|
|
10
|
-
- Renamed package foundation from legacy FTP-first naming to `@zero-transfer/sdk`.
|
|
11
|
-
- Switched the package entry point to the new TypeScript `src/` rebuild output.
|
|
12
|
-
- Removed the old CommonJS FTP implementation after the TypeScript foundation became the package surface.
|
|
13
|
-
- Switched project licensing from ISC to MIT.
|
|
14
|
-
|
|
15
|
-
### Added
|
|
16
|
-
|
|
17
|
-
- TypeScript, build, lint, format, typecheck, test, coverage, and package dry-run scripts.
|
|
18
|
-
- Initial parser-first test harness with 90% coverage gates.
|
|
19
|
-
- Verbose JSDoc comments for the TypeScript API foundation.
|
|
20
|
-
- Animated ZeroTransfer SVG logo assets for the repository README and package.
|
|
21
|
-
- npmjs-only publishing metadata with provenance enabled.
|
|
22
|
-
- CI, release, CodeQL, Dependabot, and integration-server scaffolding.
|
|
23
|
-
|
|
24
|
-
## [2.3.0] - 2026-02-02
|
|
25
|
-
|
|
26
|
-
### Added
|
|
27
|
-
|
|
28
|
-
- `uploadFile(localPath, remotePath, ensureDir)` - Upload local files from disk
|
|
29
|
-
- `downloadFile(remotePath, localPath)` - Download files directly to disk
|
|
30
|
-
|
|
31
|
-
### Changed
|
|
32
|
-
|
|
33
|
-
- **Simplified `ensureDir()` API** - now auto-detects file paths (by extension) and creates parent directory
|
|
34
|
-
- No more confusing `ensureDir(path, true, true)` - just `ensureDir(path)` works for both files and directories
|
|
35
|
-
- Example: `ensureDir('/path/file.txt')` automatically creates `/path/` directory
|
|
36
|
-
|
|
37
|
-
## [2.2.0] - 2026-02-02
|
|
38
|
-
|
|
39
|
-
### Fixed
|
|
40
|
-
|
|
41
|
-
- **CRITICAL: Fixed 30-second timeout on all data transfers** - upload, download, list, downloadStream now complete instantly
|
|
42
|
-
- Commands with data connections no longer wait for 226 completion response, dramatically improving speed
|
|
43
|
-
- Download speed improved from 0.03 MB/s to 2.47 MB/s (80x faster!)
|
|
44
|
-
- Recursive directory deletion now blazing fast (sub-second instead of minutes)
|
|
45
|
-
|
|
46
|
-
### Added
|
|
47
|
-
|
|
48
|
-
- `removeDir(path, recursive)` - Remove directories with optional recursive deletion
|
|
49
|
-
- `chmod(path, mode)` - Change file permissions (Unix/Linux servers)
|
|
50
|
-
- `listDetailed(path)` - Get parsed directory listings with permissions, owner, size, etc.
|
|
51
|
-
- `site(command)` - Execute server-specific SITE commands
|
|
52
|
-
|
|
53
|
-
### Improved
|
|
54
|
-
|
|
55
|
-
- `listDetailed()` now filters out `.` and `..` entries automatically
|
|
56
|
-
- Better handling of unknown file types in recursive operations
|
|
57
|
-
|
|
58
|
-
## [2.1.0] - 2026-02-02
|
|
59
|
-
|
|
60
|
-
### Added
|
|
61
|
-
|
|
62
|
-
- `stat()` method returns detailed file/directory information: `{ exists, size, isFile, isDirectory }`
|
|
63
|
-
|
|
64
|
-
### Changed
|
|
65
|
-
|
|
66
|
-
- **Simplified performance system** - removed over-engineered preset configuration
|
|
67
|
-
- TCP optimizations (TCP_NODELAY, keep-alive) now applied by default at socket creation
|
|
68
|
-
- `createOptimizedSocket()` replaces repeated `optimizeSocket()` calls for cleaner code
|
|
69
|
-
- Updated `exists()` to use new `stat()` method internally
|
|
70
|
-
|
|
71
|
-
### Removed
|
|
72
|
-
|
|
73
|
-
- Performance presets (LOW_LATENCY, HIGH_THROUGHPUT, BALANCED) - unnecessary complexity
|
|
74
|
-
- `performancePreset` and `performance` constructor options
|
|
75
|
-
- `getOptimalChunkSize()` function - Node.js doesn't expose socket buffer controls
|
|
76
|
-
|
|
77
|
-
## [2.0.0] - 2026-02-02
|
|
78
|
-
|
|
79
|
-
### Breaking Changes
|
|
80
|
-
|
|
81
|
-
- Removed `ensureParentDir()` - use `ensureDir(path, true, true)` instead
|
|
82
|
-
- Removed `uploadFile()` - use `upload(data, path, true)` instead
|
|
83
|
-
|
|
84
|
-
### Added
|
|
85
|
-
|
|
86
|
-
- **Performance optimization system** with TCP tuning (inspired by HFT practices)
|
|
87
|
-
- `downloadStream()` method for memory-efficient large file transfers
|
|
88
|
-
- `isConnected()` method to check connection and authentication status
|
|
89
|
-
- Parameter validation for `connect()`, `upload()`, and `download()`
|
|
90
|
-
- Connection state validation before upload/download operations
|
|
91
|
-
- Better error messages with file path context
|
|
92
|
-
- Data socket cleanup in connection close
|
|
93
|
-
- New `lib/performance.js` module for TCP optimization utilities
|
|
94
|
-
|
|
95
|
-
### Improved
|
|
96
|
-
|
|
97
|
-
- **40-50% faster downloads** for small files with LOW_LATENCY preset
|
|
98
|
-
- **`exists()` now properly detects directories** (previously only detected files)
|
|
99
|
-
- All timeouts now respect `client.timeout` configuration (no more hardcoded values)
|
|
100
|
-
- Error messages include file paths for better debugging
|
|
101
|
-
- Connection cleanup includes data socket termination
|
|
102
|
-
- Code quality: added missing semicolons and consistent formatting
|
|
103
|
-
- All data connections now apply performance optimizations
|
|
104
|
-
|
|
105
|
-
### Changed
|
|
106
|
-
|
|
107
|
-
- `upload()` now accepts optional `ensureDir` boolean parameter (default: false)
|
|
108
|
-
- `ensureDir()` now accepts optional `isFilePath` boolean parameter (default: false)
|
|
109
|
-
- Consolidated API reduces method count while maintaining functionality
|
|
110
|
-
- TCP sockets now optimized on connection for better performance
|
|
111
|
-
|
|
112
|
-
## [1.2.1] - 2026-02-02
|
|
113
|
-
|
|
114
|
-
### Changed
|
|
115
|
-
|
|
116
|
-
- Improved README documentation
|
|
117
|
-
- Better examples for `ensureDir()`, `ensureParentDir()`, and `uploadFile()`
|
|
118
|
-
- Added architecture section explaining modular structure
|
|
119
|
-
- Enhanced feature list highlighting directory management capabilities
|
|
120
|
-
- Reorganized API documentation for better clarity
|
|
121
|
-
|
|
122
|
-
## [1.2.0] - 2026-02-02
|
|
123
|
-
|
|
124
|
-
### Changed
|
|
125
|
-
|
|
126
|
-
- **Major refactoring**: Improved separation of concerns
|
|
127
|
-
- `index.js` now serves as simple entry point
|
|
128
|
-
- Implementation moved to organized `lib/` structure:
|
|
129
|
-
- `lib/FTPClient.js` - Main class definition
|
|
130
|
-
- `lib/connection.js` - Connection and authentication logic
|
|
131
|
-
- `lib/commands.js` - All FTP command implementations
|
|
132
|
-
- `lib/utils.js` - Helper functions
|
|
133
|
-
- Better code maintainability and readability
|
|
134
|
-
- No breaking changes - API remains identical
|
|
135
|
-
|
|
136
|
-
## [1.1.0] - 2026-02-02
|
|
137
|
-
|
|
138
|
-
### Added
|
|
139
|
-
|
|
140
|
-
- `ensureDir(dirPath, recursive)` - Ensure directory exists, creating parent directories if needed
|
|
141
|
-
- `ensureParentDir(filePath)` - Ensure parent directory exists for a file path
|
|
142
|
-
- `uploadFile(data, remotePath, ensureDir)` - Upload with automatic directory creation
|
|
143
|
-
- Utility library (`lib/utils.js`) for better code organization
|
|
144
|
-
- Helper functions for FTP command parsing and path manipulation
|
|
145
|
-
|
|
146
|
-
### Changed
|
|
147
|
-
|
|
148
|
-
- Refactored internal code structure for better maintainability
|
|
149
|
-
- Improved path normalization across all directory operations
|
|
150
|
-
- Better error handling for directory creation
|
|
151
|
-
|
|
152
|
-
### Improved
|
|
153
|
-
|
|
154
|
-
- Cleaner API for common operations
|
|
155
|
-
- Reduced boilerplate code needed for directory handling
|
|
156
|
-
- More consistent error messages
|
|
157
|
-
|
|
158
|
-
## [1.0.1] - 2026-02-02
|
|
159
|
-
|
|
160
|
-
### Fixed
|
|
161
|
-
|
|
162
|
-
- Updated repository URLs to correct GitHub location
|
|
163
|
-
|
|
164
|
-
## [1.0.0] - 2026-02-02
|
|
165
|
-
|
|
166
|
-
### Initial Release
|
|
167
|
-
|
|
168
|
-
- Zero dependencies FTP client using native Node.js TCP sockets
|
|
169
|
-
- Promise-based API with async/await support
|
|
170
|
-
- Passive mode (PASV) for data transfers
|
|
171
|
-
- Debug logging with configurable options
|
|
172
|
-
- Connection keep-alive and timeout configuration
|
|
173
|
-
- Upload/download files with Buffer support
|
|
174
|
-
- Directory operations (list, cd, mkdir, pwd)
|
|
175
|
-
- File operations (delete, rename, size, exists, modifiedTime)
|
|
176
|
-
- Connection statistics tracking
|
|
177
|
-
- Event-based architecture
|