@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.
Files changed (3) hide show
  1. package/constants.js +10 -9
  2. package/index.js +2 -2
  3. 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
- export const UPPY_FILE_UPLOAD_ENDPOINT = {
5
- UPLOAD_START: "/upload/start",
6
- UPLOAD_COMPLETE: "/upload/complete",
7
- UPLOAD_SIGN_PART: "/upload/signpart",
8
- UPLOAD_ABORT: "/upload/abort",
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({ message: "wrong access key" });
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({ message: "file uploading failed", error });
69
+ throw new Error(error);
70
70
  });
71
71
  this.uppyIns.on("upload-success", () => {
72
72
  return { message: "file uploaded successfully" };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swan-admin/swan-ai-measurements",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "provides ai measurement suggestion",
5
5
  "main": "index.js",
6
6
  "type": "module",