@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.
@@ -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.13",
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
- "keywords": [
25
- "node",
26
- "aws",
27
- "s3",
28
- "backup",
29
- "upload",
30
- "compress",
31
- "copy"
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
- "ci": "yarn clean && yarn install",
35
- "clean": "yarn clean:packages",
36
- "clean:packages": "rm -fr yarn.lock package-lock.json dist bin build node_modules",
37
- "dev": "dotenv -e .env -- node -r ts-node/register -r tsconfig-paths/register src/test.ts",
38
- "cli:dev": "dotenv -e .env -- yarn cli",
39
- "cli": "node -r ts-node/register -r tsconfig-paths/register cli/cli.ts",
40
- "build:clean": "rimraf dist bin",
41
- "build:dist": "rollup -c",
42
- "build:dts": "dts-bundle-generator -o dist/index.d.ts src/index.ts",
43
- "build:pkg": "pkg -t node14-linux-x64 -o node-s3 bin/cli.js",
44
- "build:pkg:windows": "pkg -t node14-win-x64 -o node-s3.exe bin/cli.js",
45
- "build:pkg:macos": "pkg -t node14-macos-x64 -o node-s3 bin/cli.js",
46
- "build:base": "yarn build:clean && run-p build:dist build:dts",
47
- "build": "yarn build:base && yarn build:pkg",
48
- "build:windows": "run-s build:base build:pkg:windows",
49
- "build:macos": "run-s build:base build:pkg:macos",
50
- "test": "jest -i --colors",
51
- "test:fakeci": "dotenv -e test.env -- yarn test",
52
- "test:coverage": "yarn test --coverage",
53
- "test:send-coverages": "yarn coverage:codecovs && yarn coverage:coveralls && yarn coverage:codacy",
54
- "coverage:codecovs": "curl -s https://codecov.io/bash | bash",
55
- "coverage:coveralls": "cat ./coverage/lcov.info | coveralls",
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
- "archiver": "5.2.0",
66
- "aws-sdk": "2.843.0",
67
- "colors": "1.4.0",
68
- "command-line-args": "5.1.1",
69
- "command-line-usage": "6.1.1",
70
- "dayjs": "1.10.4",
71
- "glob": "7.1.6",
72
- "mime-types": "2.1.28",
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
- "@babel/core": "7.12.16",
78
- "@babel/plugin-syntax-import-meta": "7.10.4",
79
- "@babel/plugin-transform-regenerator": "7.12.13",
80
- "@babel/preset-env": "7.12.16",
81
- "@commitlint/cli": "11.0.0",
82
- "@commitlint/config-conventional": "11.0.0",
83
- "@rollup/plugin-json": "4.1.0",
84
- "@rollup/plugin-node-resolve": "11.2.0",
85
- "@semantic-release/changelog": "5.0.1",
86
- "@semantic-release/commit-analyzer": "8.0.1",
87
- "@semantic-release/git": "9.0.0",
88
- "@semantic-release/github": "7.2.0",
89
- "@semantic-release/npm": "7.0.10",
90
- "@semantic-release/release-notes-generator": "9.0.1",
91
- "@types/archiver": "5.1.0",
92
- "@types/command-line-args": "5.0.0",
93
- "@types/command-line-usage": "5.0.1",
94
- "@types/jest": "26.0.20",
95
- "@types/mime-types": "2.1.0",
96
- "@types/mkdirp": "1.0.1",
97
- "@types/node": "14.14.28",
98
- "@types/rollup-plugin-node-builtins": "2.1.1",
99
- "@types/rollup-plugin-node-globals": "1.4.0",
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
- "yarn format"
104
+ "{src,cli,tests}/**/*.ts": [
105
+ "pnpm lint:fix",
106
+ "pnpm format"
156
107
  ]
157
108
  },
158
- "publishConfig": {
159
- "registry": "https://registry.npmjs.org",
160
- "access": "public"
109
+ "engines": {
110
+ "node": ">=26.0.0"
161
111
  },
162
- "czConfig": {
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))