@unvired/react-native-unvired-sdk 0.0.30 → 0.0.31

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/BuildNo.txt CHANGED
@@ -1 +1 @@
1
- R-0.000.0030
1
+ R-0.000.0031
@@ -165,7 +165,8 @@ export class DatabaseNative {
165
165
  },
166
166
  deleteUserData: async (options, callback, errorCallback) => {
167
167
  try {
168
- const db = this.getDatabase(options.dbName);
168
+ const dbName = options.dbName || options.userId;
169
+ const db = this.getDatabase(dbName);
169
170
  const query = options.userId
170
171
  ? "DELETE FROM user_data WHERE user_id = ?"
171
172
  : "DELETE FROM user_data";
@@ -2,23 +2,30 @@
2
2
  * Database types and interfaces for the Unvired SDK
3
3
  */
4
4
  export interface DatabaseOptions {
5
- name: string;
5
+ name?: string;
6
+ userId?: string;
6
7
  location?: string;
8
+ encryptionKey?: string;
7
9
  }
8
10
  export interface ExecuteOptions {
9
- dbName: string;
11
+ dbName?: string;
12
+ userId?: string;
13
+ dbType?: string;
10
14
  query: string;
11
15
  params?: any[];
16
+ args?: any[];
12
17
  }
13
18
  export interface SaveWebDBOptions {
14
- dbName: string;
15
- data: any;
19
+ dbName?: string;
20
+ userId?: string;
21
+ data?: any;
16
22
  }
17
23
  export interface ExportWebDBOptions {
18
- dbName: string;
24
+ dbName?: string;
25
+ userId?: string;
19
26
  }
20
27
  export interface DeleteUserDataOptions {
21
- dbName: string;
28
+ dbName?: string;
22
29
  userId?: string;
23
30
  }
24
31
  export type SuccessCallback<T = any> = (result: T) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unvired/react-native-unvired-sdk",
3
- "version": "0.0.30",
3
+ "version": "0.0.31",
4
4
  "description": "Unvired SDK for React Native with logging, database, notifications, and file system support",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/main.d.ts",