@bagelink/sdk 0.0.566 → 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 CHANGED
@@ -530,7 +530,10 @@ class Bagel {
530
530
  this._setAuthorization();
531
531
  const formData = new FormData();
532
532
  formData.append("file", file);
533
- const { data } = await axios.post("/static_files/upload", formData, {
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
@@ -19,6 +19,7 @@ interface User {
19
19
  }
20
20
  interface UploadOptions {
21
21
  onUploadProgress?: (progressEvent: any) => void;
22
+ topic?: string;
22
23
  }
23
24
  declare class DataRequest<T extends Tables = Tables> {
24
25
  data_table: T | Tables;
package/dist/index.d.mts CHANGED
@@ -19,6 +19,7 @@ interface User {
19
19
  }
20
20
  interface UploadOptions {
21
21
  onUploadProgress?: (progressEvent: any) => void;
22
+ topic?: string;
22
23
  }
23
24
  declare class DataRequest<T extends Tables = Tables> {
24
25
  data_table: T | Tables;
package/dist/index.d.ts CHANGED
@@ -19,6 +19,7 @@ interface User {
19
19
  }
20
20
  interface UploadOptions {
21
21
  onUploadProgress?: (progressEvent: any) => void;
22
+ topic?: string;
22
23
  }
23
24
  declare class DataRequest<T extends Tables = Tables> {
24
25
  data_table: T | Tables;
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
- const { data } = await axios.post("/static_files/upload", formData, {
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/sdk",
3
3
  "type": "module",
4
- "version": "0.0.566",
4
+ "version": "0.0.570",
5
5
  "description": "Bagel core sdk packages",
6
6
  "author": {
7
7
  "name": "Neveh Allon",
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
  },