@unvired/react-native-unvired-sdk 0.0.30 → 0.0.32
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 +1 -1
- package/dist/database/services/DatabaseNative.js +7 -1
- package/dist/database/types.d.ts +17 -6
- package/dist/logger/BaseLogger.d.ts +1 -1
- package/dist/logger/Logger.types.d.ts +2 -2
- package/dist/logger/services/LoggerNative.js +3 -3
- package/dist/logger/services/LoggerWeb.d.ts +1 -1
- package/dist/logger/services/LoggerWeb.js +1 -1
- package/dist/logger/services/LoggerWindows.js +3 -3
- package/package.json +1 -1
package/BuildNo.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
R-0.000.
|
|
1
|
+
R-0.000.0032
|
|
@@ -165,7 +165,8 @@ export class DatabaseNative {
|
|
|
165
165
|
},
|
|
166
166
|
deleteUserData: async (options, callback, errorCallback) => {
|
|
167
167
|
try {
|
|
168
|
-
const
|
|
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";
|
|
@@ -177,6 +178,11 @@ export class DatabaseNative {
|
|
|
177
178
|
errorCallback(error instanceof Error ? error.message : String(error));
|
|
178
179
|
}
|
|
179
180
|
},
|
|
181
|
+
getEncryptionKey: (options, successCallback, errorCallback) => {
|
|
182
|
+
// Native encryption key logic can be implemented here if needed.
|
|
183
|
+
// For now, return empty or trigger errorCallback depending on support.
|
|
184
|
+
errorCallback();
|
|
185
|
+
},
|
|
180
186
|
};
|
|
181
187
|
}
|
|
182
188
|
}
|
package/dist/database/types.d.ts
CHANGED
|
@@ -2,23 +2,30 @@
|
|
|
2
2
|
* Database types and interfaces for the Unvired SDK
|
|
3
3
|
*/
|
|
4
4
|
export interface DatabaseOptions {
|
|
5
|
-
name
|
|
5
|
+
name?: string;
|
|
6
|
+
userId?: string;
|
|
6
7
|
location?: string;
|
|
8
|
+
encryptionKey?: string;
|
|
7
9
|
}
|
|
8
10
|
export interface ExecuteOptions {
|
|
9
|
-
dbName
|
|
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
|
|
15
|
-
|
|
19
|
+
dbName?: string;
|
|
20
|
+
userId?: string;
|
|
21
|
+
data?: any;
|
|
16
22
|
}
|
|
17
23
|
export interface ExportWebDBOptions {
|
|
18
|
-
dbName
|
|
24
|
+
dbName?: string;
|
|
25
|
+
userId?: string;
|
|
19
26
|
}
|
|
20
27
|
export interface DeleteUserDataOptions {
|
|
21
|
-
dbName
|
|
28
|
+
dbName?: string;
|
|
22
29
|
userId?: string;
|
|
23
30
|
}
|
|
24
31
|
export type SuccessCallback<T = any> = (result: T) => void;
|
|
@@ -64,6 +71,10 @@ export interface IDatabaseAdapter {
|
|
|
64
71
|
* Delete user data from database
|
|
65
72
|
*/
|
|
66
73
|
deleteUserData(options: DeleteUserDataOptions, callback: ResultCallback<void>, errorCallback: ErrorCallback): void;
|
|
74
|
+
/**
|
|
75
|
+
* Get encryption key
|
|
76
|
+
*/
|
|
77
|
+
getEncryptionKey(options: any, successCallback: (key: string) => void, errorCallback: () => void): void;
|
|
67
78
|
}
|
|
68
79
|
/**
|
|
69
80
|
* SQL result set interface
|
|
@@ -14,6 +14,6 @@ export declare class BaseLogger {
|
|
|
14
14
|
logError(c: string, m: string, msg: string): void;
|
|
15
15
|
getLogFileURL(): Promise<string>;
|
|
16
16
|
getLogFileContent(): Promise<string>;
|
|
17
|
-
getBackupLogFileContent(): Promise<string
|
|
17
|
+
getBackupLogFileContent(): Promise<string>;
|
|
18
18
|
clearLogFile(): Promise<void>;
|
|
19
19
|
}
|
|
@@ -15,7 +15,7 @@ export interface ILoggerImplementation {
|
|
|
15
15
|
writeLine(line: string, maxSize: number): Promise<void>;
|
|
16
16
|
getLogFileURL(): Promise<string>;
|
|
17
17
|
getLogFileContent(): Promise<string>;
|
|
18
|
-
getBackupLogFileContent(): Promise<string
|
|
18
|
+
getBackupLogFileContent(): Promise<string>;
|
|
19
19
|
clear(): Promise<void>;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
@@ -29,6 +29,6 @@ export interface ILogger {
|
|
|
29
29
|
logError(className: string, methodName: string, message: string): void;
|
|
30
30
|
getLogFileURL(): Promise<string>;
|
|
31
31
|
getLogFileContent(): Promise<string>;
|
|
32
|
-
getBackupLogFileContent(): Promise<string
|
|
32
|
+
getBackupLogFileContent(): Promise<string>;
|
|
33
33
|
clearLogFile(): Promise<void>;
|
|
34
34
|
}
|
|
@@ -186,7 +186,7 @@ export class LoggerNative {
|
|
|
186
186
|
}
|
|
187
187
|
async getBackupLogFileContent() {
|
|
188
188
|
if (!this.isAvailable || !RNFS)
|
|
189
|
-
return
|
|
189
|
+
return "";
|
|
190
190
|
try {
|
|
191
191
|
// Do NOT force rotation. Only return existing backup if present.
|
|
192
192
|
// await this.rotateLog();
|
|
@@ -194,11 +194,11 @@ export class LoggerNative {
|
|
|
194
194
|
// Return base64 content for download/upload
|
|
195
195
|
return await RNFS.readFile(this.backupZip, 'base64');
|
|
196
196
|
}
|
|
197
|
-
return
|
|
197
|
+
return "";
|
|
198
198
|
}
|
|
199
199
|
catch (e) {
|
|
200
200
|
console.error('❌ LoggerNative getBackupLogFileContent error:', e);
|
|
201
|
-
return
|
|
201
|
+
return "";
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
async clear() {
|
|
@@ -5,6 +5,6 @@ export declare class LoggerWeb implements ILoggerImplementation {
|
|
|
5
5
|
writeLine(line: string, maxSize: number): Promise<void>;
|
|
6
6
|
getLogFileURL(): Promise<string>;
|
|
7
7
|
getLogFileContent(): Promise<string>;
|
|
8
|
-
getBackupLogFileContent(): Promise<
|
|
8
|
+
getBackupLogFileContent(): Promise<string>;
|
|
9
9
|
clear(): Promise<void>;
|
|
10
10
|
}
|
|
@@ -191,7 +191,7 @@ export class LoggerWindows {
|
|
|
191
191
|
}
|
|
192
192
|
async getBackupLogFileContent() {
|
|
193
193
|
if (!this.isAvailable || !RNFS)
|
|
194
|
-
return
|
|
194
|
+
return "";
|
|
195
195
|
try {
|
|
196
196
|
// Do NOT force rotation. Only return existing backup if present.
|
|
197
197
|
// await this.rotateLog();
|
|
@@ -203,11 +203,11 @@ export class LoggerWindows {
|
|
|
203
203
|
// Yes, so we can just read it back.
|
|
204
204
|
return await RNFS.readFile(this.backupZip, 'base64');
|
|
205
205
|
}
|
|
206
|
-
return
|
|
206
|
+
return "";
|
|
207
207
|
}
|
|
208
208
|
catch (e) {
|
|
209
209
|
console.error('❌ LoggerWindows getBackupLogFileContent error:', e);
|
|
210
|
-
return
|
|
210
|
+
return "";
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
async clear() {
|
package/package.json
CHANGED