@swan-admin/swan-ai-measurements 1.0.90 → 1.0.92

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.
@@ -150,9 +150,7 @@ class FileUpload {
150
150
  },
151
151
  throwError: true,
152
152
  });
153
- console.log(res, "res for start");
154
153
  const totalChunks = getFileChunks(file);
155
- console.log(totalChunks, "total chunks");
156
154
  const parts = [];
157
155
  for (let i = 0; i < totalChunks.length; i++) {
158
156
  const data = yield fetchData({
@@ -165,12 +163,11 @@ class FileUpload {
165
163
  },
166
164
  throwError: true,
167
165
  });
168
- console.log(data, "data for signed url");
169
166
  const val = yield axios.put(data === null || data === void 0 ? void 0 : data.url, totalChunks[i], {
170
167
  headers: { "Content-Type": file.type, "X-Api-Key": __classPrivateFieldGet(this, _FileUpload_accessKey, "f") },
171
168
  });
172
169
  parts.push({ PartNumber: i + 1, ETag: '"958057f9cd1d264e94fcc0d2ccabc09f"' });
173
- console.log(val === null || val === void 0 ? void 0 : val.data, "after uploading");
170
+ console.log(val, "after uploading");
174
171
  }
175
172
  const completeValue = yield fetchData({
176
173
  path: FILE_UPLOAD_ENDPOINT.UPLOAD_COMPLETE,
@@ -181,6 +178,7 @@ class FileUpload {
181
178
  parts,
182
179
  originalFileName: file.name,
183
180
  },
181
+ throwError: true,
184
182
  });
185
183
  resolve({ message: "successfully uploaded", data: completeValue });
186
184
  } catch (error) {
@@ -100,9 +100,7 @@ class FileUpload {
100
100
  },
101
101
  throwError: true,
102
102
  });
103
- console.log(res, "res for start");
104
103
  const totalChunks = (0, utils_js_1.getFileChunks)(file);
105
- console.log(totalChunks, "total chunks");
106
104
  const parts = [];
107
105
  for (let i = 0; i < totalChunks.length; i++) {
108
106
  const data = await (0, utils_js_1.fetchData)({
@@ -115,10 +113,9 @@ class FileUpload {
115
113
  },
116
114
  throwError: true,
117
115
  });
118
- console.log(data, "data for signed url");
119
116
  const val = await axios_1.default.put(data?.url, totalChunks[i], { headers: { "Content-Type": file.type, "X-Api-Key": this.#accessKey } });
120
117
  parts.push({ PartNumber: i + 1, ETag: '"958057f9cd1d264e94fcc0d2ccabc09f"' });
121
- console.log(val?.data, "after uploading");
118
+ console.log(val, "after uploading");
122
119
  }
123
120
  const completeValue = await (0, utils_js_1.fetchData)({
124
121
  path: constants_js_1.FILE_UPLOAD_ENDPOINT.UPLOAD_COMPLETE,
@@ -129,6 +126,7 @@ class FileUpload {
129
126
  parts,
130
127
  originalFileName: file.name,
131
128
  },
129
+ throwError: true,
132
130
  });
133
131
  resolve({ message: "successfully uploaded", data: completeValue });
134
132
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swan-admin/swan-ai-measurements",
3
- "version": "1.0.90",
3
+ "version": "1.0.92",
4
4
  "description": "provides ai measurement suggestion",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/esm/index.js",
package/src/fileUpload.ts CHANGED
@@ -122,9 +122,7 @@ export default class FileUpload {
122
122
  },
123
123
  throwError: true,
124
124
  });
125
- console.log(res, "res for start");
126
125
  const totalChunks = getFileChunks(file);
127
- console.log(totalChunks, "total chunks");
128
126
  const parts = [];
129
127
  for (let i = 0; i < totalChunks.length; i++) {
130
128
  const data: { url: string } = await fetchData({
@@ -137,10 +135,9 @@ export default class FileUpload {
137
135
  },
138
136
  throwError: true,
139
137
  });
140
- console.log(data, "data for signed url");
141
138
  const val = await axios.put(data?.url, totalChunks[i], { headers: { "Content-Type": file.type, "X-Api-Key": this.#accessKey } });
142
139
  parts.push({ PartNumber: i + 1, ETag: '"958057f9cd1d264e94fcc0d2ccabc09f"' });
143
- console.log(val?.data, "after uploading");
140
+ console.log(val, "after uploading");
144
141
  }
145
142
  const completeValue = await fetchData({
146
143
  path: FILE_UPLOAD_ENDPOINT.UPLOAD_COMPLETE,
@@ -151,6 +148,7 @@ export default class FileUpload {
151
148
  parts,
152
149
  originalFileName: file.name,
153
150
  },
151
+ throwError: true,
154
152
  });
155
153
  resolve({ message: "successfully uploaded", data: completeValue });
156
154
  } catch (error: any) {