@swan-admin/swan-ai-measurements 1.0.7 → 1.0.9
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/constants.js +10 -9
- package/index.js +2 -2
- package/package.json +1 -1
package/constants.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import dotenv from "dotenv";
|
|
2
|
-
export const { FILE_UPLOAD_URL } = dotenv.config().parsed;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
// import dotenv from "dotenv";
|
|
2
|
+
// export const { FILE_UPLOAD_URL } = dotenv.config().parsed;
|
|
3
|
+
export const FILE_UPLOAD_URL = "https://9xc8mxwlkj.execute-api.us-east-1.amazonaws.com/staging";
|
|
4
|
+
|
|
5
|
+
export const UPPY_FILE_UPLOAD_ENDPOINT = {
|
|
6
|
+
UPLOAD_START: "/upload/start",
|
|
7
|
+
UPLOAD_COMPLETE: "/upload/complete",
|
|
8
|
+
UPLOAD_SIGN_PART: "/upload/signpart",
|
|
9
|
+
UPLOAD_ABORT: "/upload/abort",
|
|
10
|
+
};
|
package/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import AwsS3Multipart from "@uppy/aws-s3-multipart";
|
|
|
5
5
|
export default class Swan {
|
|
6
6
|
constructor(key) {
|
|
7
7
|
if (key !== 12345) {
|
|
8
|
-
throw new Error(
|
|
8
|
+
throw new Error("wrong access key");
|
|
9
9
|
}
|
|
10
10
|
this.uppyIns = null;
|
|
11
11
|
}
|
|
@@ -66,7 +66,7 @@ export default class Swan {
|
|
|
66
66
|
});
|
|
67
67
|
|
|
68
68
|
this.uppyIns.on("upload-error", (file, error, response) => {
|
|
69
|
-
throw new Error(
|
|
69
|
+
throw new Error(error);
|
|
70
70
|
});
|
|
71
71
|
this.uppyIns.on("upload-success", () => {
|
|
72
72
|
return { message: "file uploaded successfully" };
|