@swan-admin/swan-ai-measurements 1.0.9 → 1.0.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.
Files changed (3) hide show
  1. package/index.js +5 -1
  2. package/package.json +1 -1
  3. package/utils.js +0 -1
package/index.js CHANGED
@@ -9,7 +9,7 @@ export default class Swan {
9
9
  }
10
10
  this.uppyIns = null;
11
11
  }
12
- uploadFile({ file, objMetaData, scanId }) {
12
+ async uploadFile({ file, objMetaData, scanId, apiKey }) {
13
13
  this.uppyIns = new Uppy({ autoProceed: true });
14
14
  this.uppyIns.use(AwsS3Multipart, {
15
15
  limit: 10,
@@ -19,6 +19,7 @@ export default class Swan {
19
19
  const objectKey = `${scanId}.${file.extension}`;
20
20
  return fetchData({
21
21
  path: UPPY_FILE_UPLOAD_ENDPOINT.UPLOAD_START,
22
+ apiKey,
22
23
  body: {
23
24
  objectKey,
24
25
  contentType: file.type,
@@ -29,6 +30,7 @@ export default class Swan {
29
30
  completeMultipartUpload: (file, { uploadId, key, parts }) =>
30
31
  fetchData({
31
32
  path: UPPY_FILE_UPLOAD_ENDPOINT.UPLOAD_COMPLETE,
33
+ apiKey,
32
34
  body: {
33
35
  uploadId,
34
36
  objectKey: key,
@@ -40,6 +42,7 @@ export default class Swan {
40
42
  signPart: (file, partData) =>
41
43
  fetchData({
42
44
  path: UPPY_FILE_UPLOAD_ENDPOINT.UPLOAD_SIGN_PART,
45
+ apiKey,
43
46
  body: {
44
47
  objectKey: partData.key,
45
48
  uploadId: partData.uploadId,
@@ -50,6 +53,7 @@ export default class Swan {
50
53
  abortMultipartUpload: (file, { uploadId, key }) =>
51
54
  fetchData({
52
55
  path: UPPY_FILE_UPLOAD_ENDPOINT.UPLOAD_ABORT,
56
+ apiKey,
53
57
  body: {
54
58
  uploadId,
55
59
  objectKey: key,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swan-admin/swan-ai-measurements",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "provides ai measurement suggestion",
5
5
  "main": "index.js",
6
6
  "type": "module",
package/utils.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import { FILE_UPLOAD_URL } from "./constants.js";
2
2
  import axios from "axios";
3
-
4
3
  export async function fetchData({
5
4
  path,
6
5
  body,