@taruvi/sdk 1.0.4 → 1.0.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taruvi/sdk",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "Taruvi SDK",
5
5
  "main": "src/index.ts",
6
6
  "type": "module",
@@ -21,7 +21,7 @@ export class Database {
21
21
  this.body = body
22
22
  this.config = this.client.getConfig()
23
23
  this.filters = filters
24
- }
24
+ }
25
25
 
26
26
  from(dataTables: string): Database {
27
27
  return new Database(this.client, { ...this.urlParams, dataTables }, undefined, undefined)
@@ -35,14 +35,17 @@ export class Database {
35
35
  return new Database(this.client, this.urlParams = { ...this.urlParams, recordId }, HttpMethod.GET)
36
36
  }
37
37
 
38
- update(body: any): Database {
38
+ create(body: any): Database {
39
39
  return new Database(this.client, this.urlParams = { ...this.urlParams }, HttpMethod.POST, body)
40
40
  }
41
41
 
42
+ update(body: any): Database {
43
+ return new Database(this.client, this.urlParams = { ...this.urlParams }, HttpMethod.PUT, body)
44
+ }
45
+
42
46
  delete(recordId?: any): Database {
43
47
  return new Database(this.client, this.urlParams = { ...this.urlParams, recordId }, HttpMethod.DELETE)
44
48
  }
45
-
46
49
  private buildRoute(): string {
47
50
  return (
48
51
  DatabaseRoutes.baseUrl(this.config.appSlug) +
@@ -33,8 +33,10 @@ export class Storage {
33
33
  return new Storage(this.client, { ...this.urlParams }, undefined, undefined, filters)
34
34
  }
35
35
 
36
- delete(path: string): Storage {
37
- return new Storage(this.client, { ...this.urlParams, path }, HttpMethod.DELETE)
36
+ delete(paths: string[]): Storage {
37
+ return new Storage(this.client, {
38
+ ...this.urlParams, delete: "delete"
39
+ } as any, HttpMethod.POST, { paths })
38
40
  }
39
41
 
40
42
  update(path: string, body: object): Storage {
@@ -3,7 +3,8 @@ export interface BucketUrlParams {
3
3
  appSlug: string
4
4
  bucket: string
5
5
  path?: string | undefined
6
- upload: string,
6
+ upload?: string
7
+ delete?: string
7
8
  }
8
9
 
9
10
  export interface BucketFileUpload {