@bagelink/sdk 0.0.568 → 0.0.570
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/dist/index.cjs +4 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +4 -1
- package/package.json +1 -1
- package/src/index.ts +5 -3
package/dist/index.cjs
CHANGED
|
@@ -530,7 +530,10 @@ class Bagel {
|
|
|
530
530
|
this._setAuthorization();
|
|
531
531
|
const formData = new FormData();
|
|
532
532
|
formData.append("file", file);
|
|
533
|
-
|
|
533
|
+
let url = "/static_files/upload";
|
|
534
|
+
if (options?.topic)
|
|
535
|
+
url = `/static_files/upload?topic=${options.topic}`;
|
|
536
|
+
const { data } = await axios.post(url, formData, {
|
|
534
537
|
headers: {
|
|
535
538
|
"Content-Type": "multipart/form-data"
|
|
536
539
|
},
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -524,7 +524,10 @@ class Bagel {
|
|
|
524
524
|
this._setAuthorization();
|
|
525
525
|
const formData = new FormData();
|
|
526
526
|
formData.append("file", file);
|
|
527
|
-
|
|
527
|
+
let url = "/static_files/upload";
|
|
528
|
+
if (options?.topic)
|
|
529
|
+
url = `/static_files/upload?topic=${options.topic}`;
|
|
530
|
+
const { data } = await axios.post(url, formData, {
|
|
528
531
|
headers: {
|
|
529
532
|
"Content-Type": "multipart/form-data"
|
|
530
533
|
},
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -18,7 +18,8 @@ export interface User {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
interface UploadOptions {
|
|
21
|
-
onUploadProgress?: (progressEvent: any) => void
|
|
21
|
+
onUploadProgress?: (progressEvent: any) => void,
|
|
22
|
+
topic?: string,
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
const axios = ax.create({
|
|
@@ -318,9 +319,10 @@ export class Bagel {
|
|
|
318
319
|
this._setAuthorization()
|
|
319
320
|
const formData = new FormData()
|
|
320
321
|
formData.append('file', file)
|
|
322
|
+
let url = '/static_files/upload'
|
|
323
|
+
if (options?.topic) url = `/static_files/upload?topic=${options.topic}`
|
|
321
324
|
// get an indication of the progress
|
|
322
|
-
|
|
323
|
-
const { data } = await axios.post<T>('/static_files/upload', formData, {
|
|
325
|
+
const { data } = await axios.post<T>(url, formData, {
|
|
324
326
|
headers: {
|
|
325
327
|
'Content-Type': 'multipart/form-data',
|
|
326
328
|
},
|