@empiricalrun/r2-uploader 0.1.1 → 0.1.3
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 +12 -0
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @empiricalrun/r2-uploader
|
|
2
2
|
|
|
3
|
+
## 0.1.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- ae142a5: feat: queue uploads in reporter
|
|
8
|
+
|
|
9
|
+
## 0.1.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 7a51a93: fix: upload individual attachments per test and add logs
|
|
14
|
+
|
|
3
15
|
## 0.1.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
interface FileMap {
|
|
1
|
+
export interface FileMap {
|
|
2
2
|
[file: string]: string;
|
|
3
3
|
}
|
|
4
4
|
export declare function uploadDirectory({ sourceDir, fileList, destinationDir, uploadBucket, accountId, accessKeyId, secretAccessKey, }: {
|
|
@@ -10,5 +10,4 @@ export declare function uploadDirectory({ sourceDir, fileList, destinationDir, u
|
|
|
10
10
|
accessKeyId?: string;
|
|
11
11
|
secretAccessKey?: string;
|
|
12
12
|
}): Promise<FileMap>;
|
|
13
|
-
export {};
|
|
14
13
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAuBA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAuBA,MAAM,WAAW,OAAO;IACtB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB;AA2ID,wBAAsB,eAAe,CAAC,EACpC,SAAS,EACT,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,SAAS,EACT,WAAW,EACX,eAAe,GAChB,EAAE;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,OAAO,CAAC,OAAO,CAAC,CAYnB"}
|
package/dist/index.js
CHANGED
|
@@ -69,6 +69,7 @@ const run = async (config) => {
|
|
|
69
69
|
files = getFileList(config.sourceDir);
|
|
70
70
|
}
|
|
71
71
|
await Promise.all(files.map(async (file) => {
|
|
72
|
+
// console.log("\nStarting file upload for : ", file);
|
|
72
73
|
const fileStream = fs.readFileSync(file);
|
|
73
74
|
const fileName = file.replace(config.sourceDir, "");
|
|
74
75
|
const fileKey = path_1.default.join(config.destinationDir !== "" ? config.destinationDir : config.sourceDir, fileName);
|
|
@@ -102,13 +103,16 @@ const run = async (config) => {
|
|
|
102
103
|
try {
|
|
103
104
|
await (0, async_retry_1.default)(async () => {
|
|
104
105
|
try {
|
|
106
|
+
console.log("\n\nStarting file upload for: ", file, "\n\n");
|
|
105
107
|
const data = await S3.send(cmd);
|
|
106
108
|
// console.log(`R2 Success - ${file}`);
|
|
107
109
|
map.set(file, data);
|
|
108
110
|
const fileUrl = await (0, s3_request_presigner_1.getSignedUrl)(S3, cmd);
|
|
109
111
|
urls[file] = fileUrl;
|
|
112
|
+
console.log("\n\nFinished file upload for: ", file, "\n\n");
|
|
110
113
|
}
|
|
111
114
|
catch (err) {
|
|
115
|
+
console.log("\n\nError uploading file: ", file, err, "\n\n");
|
|
112
116
|
const error = err;
|
|
113
117
|
if (error["$metadata"]) {
|
|
114
118
|
// throw only those errors that are not 412 Precondition Failed
|