Compare commits

...
6 Commits
Author SHA1 Message Date
fyears be2b168c6c artifact has styles 2021-11-10 01:06:00 +08:00
fyears 6b296d6110 bump to 0.0.14 2021-11-10 01:04:09 +08:00
fyears 6757348ac9 use multipart-upload 2021-11-10 01:03:33 +08:00
fyears a7e6bed071 fix typo 2021-11-10 00:30:30 +08:00
fyears 8b8c5bdb98 fix letter 2021-11-10 00:30:11 +08:00
fyears 5b77b23e9f xregexp should be dep not dev-dep 2021-11-10 00:16:24 +08:00
6 changed files with 25 additions and 12 deletions
+1
View File
@@ -38,3 +38,4 @@ jobs:
path: |
main.js
manifest.json
styles.css
+2 -2
View File
@@ -1,7 +1,7 @@
{
"id": "obsdian-save-remote",
"id": "obsidian-save-remote",
"name": "Save remote",
"version": "0.0.13",
"version": "0.0.14",
"minAppVersion": "0.12.15",
"description": "This is yet another plugin allowing users to sync notes between local device and the cloud.",
"author": "fyears",
+5 -4
View File
@@ -1,6 +1,6 @@
{
"name": "obsidian-save-remote",
"version": "0.0.13",
"version": "0.0.14",
"description": "This is yet another sync plugin for Obsidian app.",
"scripts": {
"dev": "webpack --mode development --watch",
@@ -31,11 +31,11 @@
"typescript": "^4.4.4",
"webdav-server": "^2.6.2",
"webpack": "^5.58.2",
"webpack-cli": "^4.9.1",
"xregexp": "^5.1.0"
"webpack-cli": "^4.9.1"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.37.0",
"@aws-sdk/lib-storage": "^3.40.1",
"@aws-sdk/signature-v4-crt": "^3.37.0",
"acorn": "^8.5.0",
"aws-crt": "^1.10.1",
@@ -50,6 +50,7 @@
"rimraf": "^3.0.2",
"stream-browserify": "^3.0.0",
"webdav": "^4.7.0",
"webdav-fs": "^4.0.0"
"webdav-fs": "^4.0.0",
"xregexp": "^5.1.0"
}
}
+1 -1
View File
@@ -2,7 +2,7 @@ import { Vault } from "obsidian";
import * as path from "path";
import { base32 } from "rfc4648";
import XRegExp from "XRegExp";
import XRegExp from "xregexp";
export type SUPPORTED_SERVICES_TYPE = "s3" | "webdav" | "ftp";
+15 -4
View File
@@ -3,6 +3,7 @@ import { Readable } from "stream";
import { Vault } from "obsidian";
import { Upload } from "@aws-sdk/lib-storage";
import {
S3Client,
ListObjectsV2Command,
@@ -115,14 +116,24 @@ export const uploadToRemote = async (
remoteContent = await encryptArrayBuffer(localContent, password);
}
const body = arrayBufferToBuffer(remoteContent);
await s3Client.send(
new PutObjectCommand({
const upload = new Upload({
client: s3Client,
queueSize: 20, // concurrency
partSize: 5242880, // minimal 5MB by default
leavePartsOnError: false,
params: {
Bucket: s3Config.s3BucketName,
Key: uploadFile,
Body: body,
ContentType: contentType,
})
);
},
});
upload.on("httpUploadProgress", (progress) => {
// console.log(progress);
});
await upload.done();
return await getRemoteMeta(s3Client, s3Config, uploadFile);
}
};
+1 -1
View File
@@ -1,3 +1,3 @@
{
"0.0.13": "0.12.15"
"0.0.14": "0.12.15"
}