@empiricalrun/r2-uploader 0.3.9 → 0.3.10
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/CHANGELOG.md +6 -0
- package/dist/fetch.d.ts.map +1 -1
- package/dist/fetch.js +6 -2
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/upload/buffer.d.ts.map +1 -1
- package/dist/upload/buffer.js +2 -0
- package/eslint.config.mjs +16 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/fetch.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../src/fetch.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,eAAO,MAAM,UAAU,GAAU,QAAQ,aAAa;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../src/fetch.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,eAAO,MAAM,UAAU,GAAU,QAAQ,aAAa;;;;;;;;;;IAmDrD,CAAC"}
|
package/dist/fetch.js
CHANGED
|
@@ -15,6 +15,7 @@ const fetchFiles = async (config) => {
|
|
|
15
15
|
const params = {
|
|
16
16
|
Bucket: config.bucket,
|
|
17
17
|
Prefix: config.prefix,
|
|
18
|
+
MaxKeys: 20_000,
|
|
18
19
|
};
|
|
19
20
|
const cmd = new client_s3_1.ListObjectsV2Command(params);
|
|
20
21
|
const data = await S3.send(cmd);
|
|
@@ -22,8 +23,11 @@ const fetchFiles = async (config) => {
|
|
|
22
23
|
if (KeyCount === 0) {
|
|
23
24
|
return [];
|
|
24
25
|
}
|
|
26
|
+
const filteredContents = config.suffix
|
|
27
|
+
? Contents?.filter((c) => c.Key.endsWith(config.suffix)) || []
|
|
28
|
+
: Contents || [];
|
|
25
29
|
if (config.withSignedUrl) {
|
|
26
|
-
return Promise.all(
|
|
30
|
+
return Promise.all(filteredContents.map(async (c) => {
|
|
27
31
|
const key = c.Key;
|
|
28
32
|
const getObjectCmd = new client_s3_1.GetObjectCommand({
|
|
29
33
|
Bucket: config.bucket,
|
|
@@ -39,7 +43,7 @@ const fetchFiles = async (config) => {
|
|
|
39
43
|
}));
|
|
40
44
|
}
|
|
41
45
|
else {
|
|
42
|
-
return
|
|
46
|
+
return filteredContents.map((c) => {
|
|
43
47
|
return {
|
|
44
48
|
key: c.Key,
|
|
45
49
|
lastModified: c.LastModified,
|
package/dist/types.d.ts
CHANGED
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,UAAU,YAAY;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,oBAAqB,SAAQ,YAAY;IACxD,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACpE;AAED,MAAM,WAAW,oBAAqB,SAAQ,YAAY;IACxD,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAClE;AAED,MAAM,WAAW,aAAc,SAAQ,YAAY;IACjD,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,UAAU,YAAY;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,oBAAqB,SAAQ,YAAY;IACxD,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACpE;AAED,MAAM,WAAW,oBAAqB,SAAQ,YAAY;IACxD,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAClE;AAED,MAAM,WAAW,aAAc,SAAQ,YAAY;IACjD,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,cAAe,SAAQ,YAAY;CAAG;AAEvD,MAAM,WAAW,OAAO;IACtB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buffer.d.ts","sourceRoot":"","sources":["../../src/upload/buffer.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEzD,eAAO,MAAM,iBAAiB,GAAU,QAAQ,oBAAoB,
|
|
1
|
+
{"version":3,"file":"buffer.d.ts","sourceRoot":"","sources":["../../src/upload/buffer.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEzD,eAAO,MAAM,iBAAiB,GAAU,QAAQ,oBAAoB,qBA+FnE,CAAC"}
|
package/dist/upload/buffer.js
CHANGED
|
@@ -71,6 +71,7 @@ const uploadFileBuffers = async (config) => {
|
|
|
71
71
|
if (err) {
|
|
72
72
|
const error = err;
|
|
73
73
|
logger_1.logger.warn("Upload retry attempt:", i, ":", file.fileName);
|
|
74
|
+
// TODO: r2-uploader Response status: undefined
|
|
74
75
|
logger_1.logger.warn("Response status:", error.$response?.statusCode);
|
|
75
76
|
}
|
|
76
77
|
},
|
|
@@ -79,6 +80,7 @@ const uploadFileBuffers = async (config) => {
|
|
|
79
80
|
catch (err) {
|
|
80
81
|
const error = err;
|
|
81
82
|
logger_1.logger.error(`R2 Error - ${file.fileName} \nError: ${error}`);
|
|
83
|
+
// TODO: r2-uploader Upload response undefined with status undefined
|
|
82
84
|
logger_1.logger.error("Upload response", error.$response, "with status", error.$metadata.httpStatusCode);
|
|
83
85
|
}
|
|
84
86
|
return;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import libraryConfig from "../eslint-config/library.mjs";
|
|
2
|
+
import tsParser from "@typescript-eslint/parser";
|
|
3
|
+
|
|
4
|
+
export default [
|
|
5
|
+
...libraryConfig,
|
|
6
|
+
{
|
|
7
|
+
files: ["src/**/*.ts", "src/**/*.tsx"],
|
|
8
|
+
languageOptions: {
|
|
9
|
+
parser: tsParser,
|
|
10
|
+
parserOptions: {
|
|
11
|
+
project: "./tsconfig.lint.json",
|
|
12
|
+
tsconfigRootDir: import.meta.dirname,
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
];
|