@d0whc3r/node-s3 1.3.13 → 1.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/LICENSE +21 -0
- package/README.md +226 -72
- package/bin/cli.js +2 -2
- package/dist/config.d.ts +36 -0
- package/dist/crypto.d.ts +3 -0
- package/dist/index.d.ts +31 -45
- package/dist/s3/buckets.d.ts +12 -0
- package/dist/s3/files.d.ts +37 -0
- package/dist/s3.cjs.js +2 -2
- package/dist/s3.es.mjs +772 -3
- package/dist/types.d.ts +55 -0
- package/package.json +81 -133
- package/CHANGELOG.md +0 -71
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { ObjectCannedACL, ServerSideEncryption, StorageClass } from '@aws-sdk/client-s3';
|
|
2
|
+
export interface Logger {
|
|
3
|
+
info?: (...args: unknown[]) => void;
|
|
4
|
+
warn?: (...args: unknown[]) => void;
|
|
5
|
+
error?: (...args: unknown[]) => void;
|
|
6
|
+
}
|
|
7
|
+
export interface UploadProgress {
|
|
8
|
+
loaded?: number;
|
|
9
|
+
total?: number;
|
|
10
|
+
part?: number;
|
|
11
|
+
key?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface S3Config {
|
|
14
|
+
endpoint?: string;
|
|
15
|
+
bucket?: string;
|
|
16
|
+
region?: string;
|
|
17
|
+
accessKeyId?: string;
|
|
18
|
+
secretAccessKey?: string;
|
|
19
|
+
sessionToken?: string;
|
|
20
|
+
maxRetries?: number;
|
|
21
|
+
forcePathStyle?: boolean;
|
|
22
|
+
sslEnabled?: boolean;
|
|
23
|
+
dryRun?: boolean;
|
|
24
|
+
onProgress?: (progress: UploadProgress) => void;
|
|
25
|
+
logger?: Logger;
|
|
26
|
+
}
|
|
27
|
+
export interface UploadOptionsBasic {
|
|
28
|
+
create?: boolean;
|
|
29
|
+
replace?: boolean;
|
|
30
|
+
expire?: string;
|
|
31
|
+
expireDate?: Date;
|
|
32
|
+
storageClass?: StorageClass;
|
|
33
|
+
acl?: ObjectCannedACL;
|
|
34
|
+
serverSideEncryption?: ServerSideEncryption;
|
|
35
|
+
kmsKeyId?: string;
|
|
36
|
+
dryRun?: boolean;
|
|
37
|
+
encryptKey?: string;
|
|
38
|
+
onProgress?: (progress: UploadProgress) => void;
|
|
39
|
+
skipBucketCheck?: boolean;
|
|
40
|
+
}
|
|
41
|
+
export interface UploadOptions extends UploadOptionsBasic {
|
|
42
|
+
compress?: string | boolean;
|
|
43
|
+
baseDir?: string;
|
|
44
|
+
compressionLevel?: number;
|
|
45
|
+
concurrency?: number;
|
|
46
|
+
followSymlinks?: boolean;
|
|
47
|
+
exclude?: string | string[];
|
|
48
|
+
}
|
|
49
|
+
export interface CleanOlderOptions {
|
|
50
|
+
dryRun?: boolean;
|
|
51
|
+
keepLast?: number;
|
|
52
|
+
}
|
|
53
|
+
export interface DownloadOptions {
|
|
54
|
+
decryptKey?: string;
|
|
55
|
+
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@d0whc3r/node-s3",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
|
+
"keywords": [
|
|
5
|
+
"aws",
|
|
6
|
+
"backup",
|
|
7
|
+
"compress",
|
|
8
|
+
"copy",
|
|
9
|
+
"node",
|
|
10
|
+
"s3",
|
|
11
|
+
"upload"
|
|
12
|
+
],
|
|
4
13
|
"license": "MIT",
|
|
5
14
|
"author": {
|
|
6
|
-
"email": "d0whc3r@gmail.com",
|
|
7
15
|
"name": "d0whc3r",
|
|
16
|
+
"email": "d0whc3r@gmail.com",
|
|
8
17
|
"url": "https://github.com/d0whc3r"
|
|
9
18
|
},
|
|
10
19
|
"repository": {
|
|
@@ -21,145 +30,84 @@
|
|
|
21
30
|
"main": "dist/s3.cjs.js",
|
|
22
31
|
"module": "dist/s3.es.mjs",
|
|
23
32
|
"types": "dist/index.d.ts",
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
"exports": {
|
|
34
|
+
".": {
|
|
35
|
+
"types": "./dist/index.d.ts",
|
|
36
|
+
"import": "./dist/s3.es.mjs",
|
|
37
|
+
"require": "./dist/s3.cjs.js"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"publishConfig": {
|
|
41
|
+
"access": "public",
|
|
42
|
+
"registry": "https://registry.npmjs.org"
|
|
43
|
+
},
|
|
33
44
|
"scripts": {
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"build:
|
|
41
|
-
"build:
|
|
42
|
-
"build:
|
|
43
|
-
"build:
|
|
44
|
-
"build
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"coverage:codacy": "wget -q https://coverage.codacy.com/get.sh && bash get.sh report -l typescript -r coverage/lcov.info",
|
|
57
|
-
"eslint": "eslint -c .eslintrc.js --ext .ts,.js src cli",
|
|
58
|
-
"eslint:fix": "yarn eslint --fix",
|
|
59
|
-
"format": "pretty-quick \"{src,cli}/**/*.ts\" --write --staged",
|
|
60
|
-
"commit": "git-cz",
|
|
61
|
-
"semantic-release": "semantic-release",
|
|
62
|
-
"postversion": "git commit -am 'chore(bump): bump version [skip-ci]' && git push --follow-tags"
|
|
45
|
+
"clean": "node -e \"import('node:fs').then(fs => ['dist','bin','build','coverage','node-s3','node-s3.exe'].forEach(p => fs.rmSync(p, {recursive:true,force:true})))\"",
|
|
46
|
+
"cli:dev": "node --env-file=.env cli/cli.ts",
|
|
47
|
+
"cli": "node cli/cli.ts",
|
|
48
|
+
"typecheck": "tsc --noEmit",
|
|
49
|
+
"build:clean": "node -e \"import('node:fs').then(fs => ['dist','bin'].forEach(p => fs.rmSync(p, {recursive:true,force:true})))\"",
|
|
50
|
+
"build:lib": "vite build --config vite.config.mts",
|
|
51
|
+
"build:cli": "vite build --config vite.cli.config.mts",
|
|
52
|
+
"build:dts": "tsc -p tsconfig.build.json --emitDeclarationOnly",
|
|
53
|
+
"build:base": "pnpm build:clean && pnpm build:lib && pnpm build:cli && pnpm build:dts",
|
|
54
|
+
"build:sea": "vite build --config vite.sea.config.mts && node scripts/build-sea.mjs",
|
|
55
|
+
"build": "pnpm build:base && pnpm build:sea",
|
|
56
|
+
"test": "vitest run",
|
|
57
|
+
"test:unit": "vitest run tests/*.unit.spec.ts",
|
|
58
|
+
"test:integration": "vitest run tests/*.integration.spec.ts",
|
|
59
|
+
"test:watch": "vitest",
|
|
60
|
+
"test:coverage": "vitest run --coverage",
|
|
61
|
+
"lint": "oxlint",
|
|
62
|
+
"lint:fix": "oxlint --fix",
|
|
63
|
+
"format": "oxfmt --write",
|
|
64
|
+
"format:check": "oxfmt --check",
|
|
65
|
+
"prepare": "husky",
|
|
66
|
+
"semantic-release": "semantic-release"
|
|
63
67
|
},
|
|
64
68
|
"dependencies": {
|
|
65
|
-
"
|
|
66
|
-
"aws-sdk": "
|
|
67
|
-
"
|
|
68
|
-
"command-line-args": "
|
|
69
|
-
"command-line-usage": "
|
|
70
|
-
"dayjs": "1.
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"mkdirp": "1.0.4",
|
|
74
|
-
"mysqldump": "3.2.0"
|
|
69
|
+
"@aws-sdk/client-s3": "^3.1177.0",
|
|
70
|
+
"@aws-sdk/lib-storage": "^3.1177.0",
|
|
71
|
+
"archiver": "^8.0.0",
|
|
72
|
+
"command-line-args": "^6.0.2",
|
|
73
|
+
"command-line-usage": "^7.0.4",
|
|
74
|
+
"dayjs": "^1.11.23",
|
|
75
|
+
"mime-types": "^3.0.2",
|
|
76
|
+
"mysqldump": "^3.2.0"
|
|
75
77
|
},
|
|
76
78
|
"devDependencies": {
|
|
77
|
-
"@
|
|
78
|
-
"@
|
|
79
|
-
"@
|
|
80
|
-
"@
|
|
81
|
-
"@
|
|
82
|
-
"@
|
|
83
|
-
"@
|
|
84
|
-
"@
|
|
85
|
-
"@
|
|
86
|
-
"@
|
|
87
|
-
"@
|
|
88
|
-
"@
|
|
89
|
-
"@
|
|
90
|
-
"@
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
"
|
|
100
|
-
"@typescript-eslint/eslint-plugin": "4.15.0",
|
|
101
|
-
"@typescript-eslint/parser": "4.15.0",
|
|
102
|
-
"builtin-modules": "3.2.0",
|
|
103
|
-
"commitizen": "4.2.3",
|
|
104
|
-
"core-js": "3.8.3",
|
|
105
|
-
"coveralls": "3.1.0",
|
|
106
|
-
"dotenv": "8.2.0",
|
|
107
|
-
"dotenv-cli": "4.0.0",
|
|
108
|
-
"dts-bundle-generator": "5.7.0",
|
|
109
|
-
"esbuild": "0.8.46",
|
|
110
|
-
"eslint": "7.20.0",
|
|
111
|
-
"eslint-config-prettier": "7.2.0",
|
|
112
|
-
"eslint-plugin-prettier": "3.3.1",
|
|
113
|
-
"eslint-plugin-sonarjs": "0.6.0",
|
|
114
|
-
"find-node-modules": "2.1.2",
|
|
115
|
-
"husky": "4.3.8",
|
|
116
|
-
"jest": "26.6.3",
|
|
117
|
-
"jest-chain": "1.1.5",
|
|
118
|
-
"jest-extended": "0.11.5",
|
|
119
|
-
"jest-junit": "12.0.0",
|
|
120
|
-
"jest-sonar-reporter": "2.0.0",
|
|
121
|
-
"lint-staged": "10.5.4",
|
|
122
|
-
"npm-run-all": "4.1.5",
|
|
123
|
-
"pkg": "4.4.9",
|
|
124
|
-
"prettier": "2.2.1",
|
|
125
|
-
"pretty-quick": "3.1.0",
|
|
126
|
-
"regenerator-runtime": "0.13.7",
|
|
127
|
-
"rimraf": "3.0.2",
|
|
128
|
-
"rollup": "2.39.0",
|
|
129
|
-
"rollup-plugin-auto-external": "2.0.0",
|
|
130
|
-
"rollup-plugin-esbuild": "2.6.1",
|
|
131
|
-
"rollup-plugin-node-builtins": "2.1.2",
|
|
132
|
-
"semantic-release": "17.3.9",
|
|
133
|
-
"sonar-scanner": "3.1.0",
|
|
134
|
-
"ts-jest": "26.5.1",
|
|
135
|
-
"ts-node": "9.1.1",
|
|
136
|
-
"tsconfig-paths": "3.9.0",
|
|
137
|
-
"typescript": "4.1.5"
|
|
138
|
-
},
|
|
139
|
-
"jestSonar": {
|
|
140
|
-
"reportPath": "coverage",
|
|
141
|
-
"reportFile": "test-report.xml"
|
|
142
|
-
},
|
|
143
|
-
"jest-junit": {
|
|
144
|
-
"outputDirectory": "./coverage",
|
|
145
|
-
"outputName": "./junit.xml"
|
|
146
|
-
},
|
|
147
|
-
"husky": {
|
|
148
|
-
"hooks": {
|
|
149
|
-
"pre-commit": "yarn eslint:fix && lint-staged",
|
|
150
|
-
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
|
|
151
|
-
}
|
|
79
|
+
"@commitlint/cli": "^21.2.4",
|
|
80
|
+
"@commitlint/config-conventional": "^21.2.4",
|
|
81
|
+
"@semantic-release/changelog": "^7.0.0",
|
|
82
|
+
"@semantic-release/commit-analyzer": "^13.0.1",
|
|
83
|
+
"@semantic-release/git": "^11.0.1",
|
|
84
|
+
"@semantic-release/github": "^12.0.11",
|
|
85
|
+
"@semantic-release/npm": "^13.2.0",
|
|
86
|
+
"@semantic-release/release-notes-generator": "^14.1.1",
|
|
87
|
+
"@types/archiver": "^8.0.0",
|
|
88
|
+
"@types/command-line-args": "^5.2.3",
|
|
89
|
+
"@types/command-line-usage": "^5.0.4",
|
|
90
|
+
"@types/mime-types": "^3.0.1",
|
|
91
|
+
"@types/node": "^26.6.10",
|
|
92
|
+
"@vitest/coverage-v8": "^5.1.2",
|
|
93
|
+
"aws-sdk-client-mock": "^4.1.0",
|
|
94
|
+
"husky": "^9.1.7",
|
|
95
|
+
"lint-staged": "^17.6.2",
|
|
96
|
+
"oxfmt": "^0.80.0",
|
|
97
|
+
"oxlint": "^1.95.0",
|
|
98
|
+
"semantic-release": "^26.0.1",
|
|
99
|
+
"typescript": "^7.0.2",
|
|
100
|
+
"vite": "^8.3.8",
|
|
101
|
+
"vitest": "^5.1.2"
|
|
152
102
|
},
|
|
153
103
|
"lint-staged": {
|
|
154
|
-
"{src,cli}/**/*.ts": [
|
|
155
|
-
"
|
|
104
|
+
"{src,cli,tests}/**/*.ts": [
|
|
105
|
+
"pnpm lint:fix",
|
|
106
|
+
"pnpm format"
|
|
156
107
|
]
|
|
157
108
|
},
|
|
158
|
-
"
|
|
159
|
-
"
|
|
160
|
-
"access": "public"
|
|
109
|
+
"engines": {
|
|
110
|
+
"node": ">=26.0.0"
|
|
161
111
|
},
|
|
162
|
-
"
|
|
163
|
-
"path": "node_modules/cz-conventional-changelog"
|
|
164
|
-
}
|
|
112
|
+
"packageManager": "pnpm@12.16.1"
|
|
165
113
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
## [1.3.13](https://github.com/d0whc3r/node-s3/compare/v1.3.12...v1.3.13) (2021-02-15)
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
### Bug Fixes
|
|
7
|
-
|
|
8
|
-
* **folders:** keep folder structure ([fb51c57](https://github.com/d0whc3r/node-s3/commit/fb51c57941d49d8f8dc08c16daad285f15295508)), closes [#131](https://github.com/d0whc3r/node-s3/issues/131)
|
|
9
|
-
|
|
10
|
-
## [1.3.12](https://github.com/d0whc3r/node-s3/compare/v1.3.11...v1.3.12) (2020-08-14)
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
### Bug Fixes
|
|
14
|
-
|
|
15
|
-
* **deps:** update dependency aws-sdk to v2.734.0 ([6250d83](https://github.com/d0whc3r/node-s3/commit/6250d83d95e2d3a84ad27ec3ad388824f43b26a6))
|
|
16
|
-
|
|
17
|
-
## [1.3.11](https://github.com/d0whc3r/node-s3/compare/v1.3.10...v1.3.11) (2020-08-14)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
### Bug Fixes
|
|
21
|
-
|
|
22
|
-
* update dependencies ([8e8c2a9](https://github.com/d0whc3r/node-s3/commit/8e8c2a91d272aa0ca78c7a3f68213eb8ad5f5a34))
|
|
23
|
-
|
|
24
|
-
## [1.3.10](https://github.com/d0whc3r/node-s3/compare/v1.3.9...v1.3.10) (2020-07-23)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
### Bug Fixes
|
|
28
|
-
|
|
29
|
-
* **deps:** update dependency archiver to v5 ([66beea0](https://github.com/d0whc3r/node-s3/commit/66beea0dbc5f5fec78c3ae48e1f33ae2195ec17b))
|
|
30
|
-
* **deps:** update dependency aws-sdk to v2.718.0 ([c068eb8](https://github.com/d0whc3r/node-s3/commit/c068eb8b39ce98f30f77fca81e75f03d17f8eceb))
|
|
31
|
-
* **deps:** update dependency dayjs to v1.8.30 ([3573f36](https://github.com/d0whc3r/node-s3/commit/3573f3680e60bd309a4760b43abe543b9ca7f4b6))
|
|
32
|
-
|
|
33
|
-
## [1.3.9](https://github.com/d0whc3r/node-s3/compare/v1.3.8...v1.3.9) (2020-07-19)
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
### Bug Fixes
|
|
37
|
-
|
|
38
|
-
* **deps:** update dependencies ([9171526](https://github.com/d0whc3r/node-s3/commit/9171526596edd6519a751f6ab39858c696cc68a9))
|
|
39
|
-
|
|
40
|
-
Changelog
|
|
41
|
-
|
|
42
|
-
## [1.3.8](https://github.com/d0whc3r/node-s3/compare/v1.3.7...v1.3.8) (2020-07-17)
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
### Bug Fixes
|
|
46
|
-
|
|
47
|
-
* **build:** update build to output es2015 code ([2d8568b](https://github.com/d0whc3r/node-s3/commit/2d8568b2e1e598637e66044156e8961b98ba61bb))
|
|
48
|
-
* **deps:** update dependencies ([adf3571](https://github.com/d0whc3r/node-s3/commit/adf3571e59c4c0bda0168fe45b192defb80786b5))
|
|
49
|
-
|
|
50
|
-
## [1.3.7](https://github.com/d0whc3r/node-s3/compare/v1.3.6...v1.3.7) (2020-07-10)
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
### Bug Fixes
|
|
54
|
-
|
|
55
|
-
* **deps:** update dependency aws-sdk to v2.713.0 ([060f299](https://github.com/d0whc3r/node-s3/commit/060f299d4f35db44699aeb910d36dd55846e8ee8))
|
|
56
|
-
|
|
57
|
-
## [1.3.6](https://github.com/d0whc3r/node-s3/compare/v1.3.5...v1.3.6) (2020-07-07)
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
### Bug Fixes
|
|
61
|
-
|
|
62
|
-
* **deps:** update dependency aws-sdk to v2.710.0 ([a348d1f](https://github.com/d0whc3r/node-s3/commit/a348d1f91609f0ab90bfd952df07a2317625d408))
|
|
63
|
-
|
|
64
|
-
# Changelog
|
|
65
|
-
|
|
66
|
-
## [1.3.5](https://github.com/d0whc3r/node-s3/compare/v1.3.4...v1.3.5) (2020-07-06)
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
### Bug Fixes
|
|
70
|
-
|
|
71
|
-
* add changelog ([a476842](https://github.com/d0whc3r/node-s3/commit/a476842e9e485abf5b0e47b359ac2259123a218a))
|