@unvired/react-native-wrapper-sdk 0.0.20 → 0.0.22
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/UnviredWrapper.d.ts +22 -25
- package/dist/UnviredWrapper.d.ts.map +1 -1
- package/dist/UnviredWrapper.js +48 -32
- package/dist/lib/AuthBuilder.d.ts.map +1 -0
- package/package.json +6 -11
- package/src/UnviredWrapper.ts +52 -34
- package/dist/lib/auth/AuthBuilder.d.ts.map +0 -1
- package/dist/lib/auth/AuthService.d.ts +0 -27
- package/dist/lib/auth/AuthService.d.ts.map +0 -1
- package/dist/lib/auth/AuthService.js +0 -46
- package/dist/lib/database/DatabaseService.d.ts +0 -43
- package/dist/lib/database/DatabaseService.d.ts.map +0 -1
- package/dist/lib/database/DatabaseService.js +0 -34
- package/dist/lib/file/FileService.d.ts +0 -95
- package/dist/lib/file/FileService.d.ts.map +0 -1
- package/dist/lib/file/FileService.js +0 -152
- package/dist/lib/logger/LoggerService.d.ts +0 -45
- package/dist/lib/logger/LoggerService.d.ts.map +0 -1
- package/dist/lib/logger/LoggerService.js +0 -65
- package/dist/lib/notification/NotificationService.d.ts +0 -28
- package/dist/lib/notification/NotificationService.d.ts.map +0 -1
- package/dist/lib/notification/NotificationService.js +0 -47
- package/dist/lib/settings/SettingsService.d.ts +0 -41
- package/dist/lib/settings/SettingsService.d.ts.map +0 -1
- package/dist/lib/settings/SettingsService.js +0 -108
- package/dist/lib/storage/StorageService.d.ts +0 -13
- package/dist/lib/storage/StorageService.d.ts.map +0 -1
- package/dist/lib/storage/StorageService.js +0 -19
- package/dist/lib/sync/SyncService.d.ts +0 -96
- package/dist/lib/sync/SyncService.d.ts.map +0 -1
- package/dist/lib/sync/SyncService.js +0 -139
- package/src/lib/auth/AuthService.ts +0 -45
- package/src/lib/database/DatabaseService.ts +0 -53
- package/src/lib/file/FileService.ts +0 -186
- package/src/lib/logger/LoggerService.ts +0 -70
- package/src/lib/notification/NotificationService.ts +0 -45
- package/src/lib/settings/SettingsService.ts +0 -126
- package/src/lib/storage/StorageService.ts +0 -27
- package/src/lib/sync/SyncService.ts +0 -160
- /package/dist/lib/{auth/AuthBuilder.d.ts → AuthBuilder.d.ts} +0 -0
- /package/dist/lib/{auth/AuthBuilder.js → AuthBuilder.js} +0 -0
- /package/src/lib/{auth/AuthBuilder.ts → AuthBuilder.ts} +0 -0
package/dist/UnviredWrapper.d.ts
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { DatabaseService } from './lib/database/DatabaseService';
|
|
3
|
-
import { FileService } from './lib/file/FileService';
|
|
4
|
-
import { NotificationService } from './lib/notification/NotificationService';
|
|
5
|
-
import { SyncService } from './lib/sync/SyncService';
|
|
6
|
-
import { SettingsService } from './lib/settings/SettingsService';
|
|
7
|
-
import { LoggerService } from './lib/logger/LoggerService';
|
|
1
|
+
import AuthBuilder from './lib/AuthBuilder';
|
|
8
2
|
/**
|
|
9
3
|
* React Native Wrapper for Unvired Core SDK
|
|
10
4
|
* Provides a clean, fluent API for React Native applications
|
|
@@ -12,33 +6,36 @@ import { LoggerService } from './lib/logger/LoggerService';
|
|
|
12
6
|
export declare class UnviredWrapper {
|
|
13
7
|
constructor();
|
|
14
8
|
/**
|
|
15
|
-
*
|
|
9
|
+
* Returns a builder for login method
|
|
10
|
+
* Can be awaited directly: await sdk.login().setAppName("my-app")
|
|
16
11
|
*/
|
|
17
|
-
|
|
12
|
+
login(): AuthBuilder;
|
|
18
13
|
/**
|
|
19
|
-
*
|
|
14
|
+
* Returns a builder for authenticateAndActivate method
|
|
15
|
+
* Can be awaited directly: await sdk.authenticateAndActivate().setUsername("demo")
|
|
20
16
|
*/
|
|
21
|
-
|
|
17
|
+
authenticateAndActivate(): AuthBuilder;
|
|
22
18
|
/**
|
|
23
|
-
*
|
|
19
|
+
* Returns a builder for authenticateLocal method
|
|
20
|
+
* Can be awaited directly: await sdk.authenticateLocal().setUsername("demo")
|
|
24
21
|
*/
|
|
25
|
-
|
|
22
|
+
authenticateLocal(): AuthBuilder;
|
|
26
23
|
/**
|
|
27
|
-
*
|
|
24
|
+
* Logout method - Logs out the current user
|
|
28
25
|
*/
|
|
29
|
-
|
|
26
|
+
logout(): Promise<any>;
|
|
30
27
|
/**
|
|
31
|
-
*
|
|
28
|
+
* Clear all data
|
|
32
29
|
*/
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
30
|
+
clearData(): Promise<any>;
|
|
31
|
+
static logInfo(className: string, methodName: string, message: string): void;
|
|
32
|
+
static logError(className: string, methodName: string, message: string): void;
|
|
33
|
+
static logDebug(className: string, methodName: string, message: string): void;
|
|
34
|
+
static setLogLevel(level: string): void;
|
|
35
|
+
static getLogFileURL(): Promise<string>;
|
|
36
|
+
static getLogFileContent(): Promise<string>;
|
|
37
|
+
static getBackupLogFileContent(): Promise<string>;
|
|
38
|
+
static clearLogFile(): Promise<void>;
|
|
42
39
|
}
|
|
43
40
|
export default UnviredWrapper;
|
|
44
41
|
//# sourceMappingURL=UnviredWrapper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnviredWrapper.d.ts","sourceRoot":"","sources":["../src/UnviredWrapper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UnviredWrapper.d.ts","sourceRoot":"","sources":["../src/UnviredWrapper.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAG5C;;;GAGG;AACH,qBAAa,cAAc;;IAKzB;;;OAGG;IACH,KAAK,IAAI,WAAW;IAIpB;;;OAGG;IACH,uBAAuB,IAAI,WAAW;IAItC;;;OAGG;IACH,iBAAiB,IAAI,WAAW;IAIhC;;OAEG;IACG,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC;IAK5B;;OAEG;IACG,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC;IAM/B,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;IAIrE,MAAM,CAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;IAItE,MAAM,CAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;IAKtE,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,MAAM;WAInB,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC;WAIhC,iBAAiB,IAAI,OAAO,CAAC,MAAM,CAAC;WAIpC,uBAAuB,IAAI,OAAO,CAAC,MAAM,CAAC;WAI1C,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;CAG3C;AAED,eAAe,cAAc,CAAC"}
|
package/dist/UnviredWrapper.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.UnviredWrapper = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const FileService_1 = require("./lib/file/FileService");
|
|
7
|
-
const NotificationService_1 = require("./lib/notification/NotificationService");
|
|
8
|
-
const SyncService_1 = require("./lib/sync/SyncService");
|
|
9
|
-
const SettingsService_1 = require("./lib/settings/SettingsService");
|
|
10
|
-
const LoggerService_1 = require("./lib/logger/LoggerService");
|
|
7
|
+
const AuthBuilder_1 = __importDefault(require("./lib/AuthBuilder"));
|
|
8
|
+
const unvired_ts_core_sdk_1 = require("@unvired/unvired-ts-core-sdk");
|
|
11
9
|
/**
|
|
12
10
|
* React Native Wrapper for Unvired Core SDK
|
|
13
11
|
* Provides a clean, fluent API for React Native applications
|
|
@@ -17,46 +15,64 @@ class UnviredWrapper {
|
|
|
17
15
|
// AuthenticationService is a singleton, accessed via static instance getter
|
|
18
16
|
}
|
|
19
17
|
/**
|
|
20
|
-
*
|
|
18
|
+
* Returns a builder for login method
|
|
19
|
+
* Can be awaited directly: await sdk.login().setAppName("my-app")
|
|
21
20
|
*/
|
|
22
|
-
|
|
23
|
-
return new
|
|
21
|
+
login() {
|
|
22
|
+
return new AuthBuilder_1.default('login');
|
|
24
23
|
}
|
|
25
24
|
/**
|
|
26
|
-
*
|
|
25
|
+
* Returns a builder for authenticateAndActivate method
|
|
26
|
+
* Can be awaited directly: await sdk.authenticateAndActivate().setUsername("demo")
|
|
27
27
|
*/
|
|
28
|
-
|
|
29
|
-
return new
|
|
28
|
+
authenticateAndActivate() {
|
|
29
|
+
return new AuthBuilder_1.default('authenticateAndActivate');
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
32
|
+
* Returns a builder for authenticateLocal method
|
|
33
|
+
* Can be awaited directly: await sdk.authenticateLocal().setUsername("demo")
|
|
33
34
|
*/
|
|
34
|
-
|
|
35
|
-
return new
|
|
35
|
+
authenticateLocal() {
|
|
36
|
+
return new AuthBuilder_1.default('authenticateLocal');
|
|
36
37
|
}
|
|
37
38
|
/**
|
|
38
|
-
*
|
|
39
|
+
* Logout method - Logs out the current user
|
|
39
40
|
*/
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
async logout() {
|
|
42
|
+
const authService = unvired_ts_core_sdk_1.AuthenticationService.instance;
|
|
43
|
+
return authService.logout();
|
|
42
44
|
}
|
|
43
45
|
/**
|
|
44
|
-
*
|
|
46
|
+
* Clear all data
|
|
45
47
|
*/
|
|
46
|
-
|
|
47
|
-
|
|
48
|
+
async clearData() {
|
|
49
|
+
const authService = unvired_ts_core_sdk_1.AuthenticationService.instance;
|
|
50
|
+
return authService.clearData();
|
|
48
51
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
settings() {
|
|
53
|
-
return new SettingsService_1.SettingsService();
|
|
52
|
+
// Logging methods - delegating to PlatformManager's adapter
|
|
53
|
+
static logInfo(className, methodName, message) {
|
|
54
|
+
return unvired_ts_core_sdk_1.PlatformManager.getInstance().getPlatformAdapter().getLoggerAdapter().logInfo(className, methodName, message);
|
|
54
55
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return
|
|
56
|
+
static logError(className, methodName, message) {
|
|
57
|
+
return unvired_ts_core_sdk_1.PlatformManager.getInstance().getPlatformAdapter().getLoggerAdapter().logError(className, methodName, message);
|
|
58
|
+
}
|
|
59
|
+
static logDebug(className, methodName, message) {
|
|
60
|
+
return unvired_ts_core_sdk_1.PlatformManager.getInstance().getPlatformAdapter().getLoggerAdapter().logDebug(className, methodName, message);
|
|
61
|
+
}
|
|
62
|
+
static setLogLevel(level) {
|
|
63
|
+
return unvired_ts_core_sdk_1.PlatformManager.getInstance().getPlatformAdapter().getLoggerAdapter().setLogLevel(level);
|
|
64
|
+
}
|
|
65
|
+
static async getLogFileURL() {
|
|
66
|
+
return unvired_ts_core_sdk_1.PlatformManager.getInstance().getPlatformAdapter().getLoggerAdapter().getLogFileURL();
|
|
67
|
+
}
|
|
68
|
+
static async getLogFileContent() {
|
|
69
|
+
return unvired_ts_core_sdk_1.PlatformManager.getInstance().getPlatformAdapter().getLoggerAdapter().getLogFileContent();
|
|
70
|
+
}
|
|
71
|
+
static async getBackupLogFileContent() {
|
|
72
|
+
return unvired_ts_core_sdk_1.PlatformManager.getInstance().getPlatformAdapter().getLoggerAdapter().getBackupLogFileContent();
|
|
73
|
+
}
|
|
74
|
+
static async clearLogFile() {
|
|
75
|
+
return unvired_ts_core_sdk_1.PlatformManager.getInstance().getPlatformAdapter().getLoggerAdapter().clearLogFile();
|
|
60
76
|
}
|
|
61
77
|
}
|
|
62
78
|
exports.UnviredWrapper = UnviredWrapper;
|
|
@@ -0,0 +1 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KAAK,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,GAAG,SAAS,GAAG,IAAI,EACnF,UAAU,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,GAAG,KAAK,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,GAAG,SAAS,GAAG,IAAI,GACpF,WAAW,CAAC,QAAQ,GAAG,QAAQ,CAAC;CAGtC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unvired/react-native-wrapper-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.22",
|
|
4
4
|
"description": "Unvired SDK for React Native - Enterprise mobile platform SDK with authentication, sync, and offline database",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -23,24 +23,19 @@
|
|
|
23
23
|
"author": "Unvired Inc.",
|
|
24
24
|
"license": "UNLICENSED",
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"@react-native-firebase/messaging": "^21.8.1",
|
|
29
|
-
"react": ">=18",
|
|
30
|
-
"react-native": ">=0.73",
|
|
31
|
-
"react-native-device-info": "^15.0.1",
|
|
32
|
-
"react-native-fs": "^2.20.0",
|
|
33
|
-
"react-native-zip-archive": "^7.0.2"
|
|
26
|
+
"react": ">=16.8.0",
|
|
27
|
+
"react-native": ">=0.60.0"
|
|
34
28
|
},
|
|
35
29
|
"dependencies": {
|
|
36
|
-
"@unvired/
|
|
30
|
+
"@unvired/react-native-unvired-sdk": "^0.0.12",
|
|
31
|
+
"@unvired/unvired-ts-core-sdk": "^0.0.14",
|
|
37
32
|
"axios": "^1.6.5",
|
|
38
33
|
"crypto-js": "^4.2.0",
|
|
39
34
|
"uuid": "^9.0.1"
|
|
40
35
|
},
|
|
41
36
|
"devDependencies": {
|
|
42
37
|
"@types/crypto-js": "^4.2.2",
|
|
43
|
-
"@types/react": "^
|
|
38
|
+
"@types/react": "^18.2.0",
|
|
44
39
|
"@types/react-native": "^0.73.0",
|
|
45
40
|
"@types/uuid": "^9.0.7",
|
|
46
41
|
"typescript": "^5.3.3"
|
package/src/UnviredWrapper.ts
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { DatabaseService } from './lib/database/DatabaseService';
|
|
4
|
-
import { FileService } from './lib/file/FileService';
|
|
5
|
-
import { NotificationService } from './lib/notification/NotificationService';
|
|
6
|
-
import { SyncService } from './lib/sync/SyncService';
|
|
7
|
-
import { SettingsService } from './lib/settings/SettingsService';
|
|
8
|
-
import { LoggerService } from './lib/logger/LoggerService';
|
|
1
|
+
import AuthBuilder from './lib/AuthBuilder';
|
|
2
|
+
import { AuthenticationService, PlatformManager } from '@unvired/unvired-ts-core-sdk';
|
|
9
3
|
|
|
10
4
|
/**
|
|
11
5
|
* React Native Wrapper for Unvired Core SDK
|
|
@@ -17,54 +11,78 @@ export class UnviredWrapper {
|
|
|
17
11
|
}
|
|
18
12
|
|
|
19
13
|
/**
|
|
20
|
-
*
|
|
14
|
+
* Returns a builder for login method
|
|
15
|
+
* Can be awaited directly: await sdk.login().setAppName("my-app")
|
|
21
16
|
*/
|
|
22
|
-
|
|
23
|
-
return new
|
|
17
|
+
login(): AuthBuilder {
|
|
18
|
+
return new AuthBuilder('login');
|
|
24
19
|
}
|
|
25
20
|
|
|
26
21
|
/**
|
|
27
|
-
*
|
|
22
|
+
* Returns a builder for authenticateAndActivate method
|
|
23
|
+
* Can be awaited directly: await sdk.authenticateAndActivate().setUsername("demo")
|
|
28
24
|
*/
|
|
29
|
-
|
|
30
|
-
return new
|
|
25
|
+
authenticateAndActivate(): AuthBuilder {
|
|
26
|
+
return new AuthBuilder('authenticateAndActivate');
|
|
31
27
|
}
|
|
32
28
|
|
|
33
29
|
/**
|
|
34
|
-
*
|
|
30
|
+
* Returns a builder for authenticateLocal method
|
|
31
|
+
* Can be awaited directly: await sdk.authenticateLocal().setUsername("demo")
|
|
35
32
|
*/
|
|
36
|
-
|
|
37
|
-
return new
|
|
33
|
+
authenticateLocal(): AuthBuilder {
|
|
34
|
+
return new AuthBuilder('authenticateLocal');
|
|
38
35
|
}
|
|
39
36
|
|
|
40
37
|
/**
|
|
41
|
-
*
|
|
38
|
+
* Logout method - Logs out the current user
|
|
42
39
|
*/
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
async logout(): Promise<any> {
|
|
41
|
+
const authService = (AuthenticationService as any).instance;
|
|
42
|
+
return authService.logout();
|
|
45
43
|
}
|
|
46
44
|
|
|
47
45
|
/**
|
|
48
|
-
*
|
|
46
|
+
* Clear all data
|
|
49
47
|
*/
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
async clearData(): Promise<any> {
|
|
49
|
+
const authService = (AuthenticationService as any).instance;
|
|
50
|
+
return authService.clearData();
|
|
52
51
|
}
|
|
53
52
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
settings(): SettingsService {
|
|
58
|
-
return new SettingsService();
|
|
53
|
+
// Logging methods - delegating to PlatformManager's adapter
|
|
54
|
+
static logInfo(className: string, methodName: string, message: string) {
|
|
55
|
+
return PlatformManager.getInstance().getPlatformAdapter().getLoggerAdapter().logInfo(className, methodName, message);
|
|
59
56
|
}
|
|
60
57
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
58
|
+
static logError(className: string, methodName: string, message: string) {
|
|
59
|
+
return PlatformManager.getInstance().getPlatformAdapter().getLoggerAdapter().logError(className, methodName, message);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
static logDebug(className: string, methodName: string, message: string) {
|
|
63
|
+
return PlatformManager.getInstance().getPlatformAdapter().getLoggerAdapter().logDebug(className, methodName, message);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
static setLogLevel(level: string) {
|
|
68
|
+
return PlatformManager.getInstance().getPlatformAdapter().getLoggerAdapter().setLogLevel(level);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
static async getLogFileURL(): Promise<string> {
|
|
72
|
+
return PlatformManager.getInstance().getPlatformAdapter().getLoggerAdapter().getLogFileURL();
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
static async getLogFileContent(): Promise<string> {
|
|
76
|
+
return PlatformManager.getInstance().getPlatformAdapter().getLoggerAdapter().getLogFileContent();
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
static async getBackupLogFileContent(): Promise<string> {
|
|
80
|
+
return PlatformManager.getInstance().getPlatformAdapter().getLoggerAdapter().getBackupLogFileContent();
|
|
66
81
|
}
|
|
67
82
|
|
|
83
|
+
static async clearLogFile(): Promise<void> {
|
|
84
|
+
return PlatformManager.getInstance().getPlatformAdapter().getLoggerAdapter().clearLogFile();
|
|
85
|
+
}
|
|
68
86
|
}
|
|
69
87
|
|
|
70
|
-
export default UnviredWrapper;
|
|
88
|
+
export default UnviredWrapper;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AuthBuilder.d.ts","sourceRoot":"","sources":["../../../src/lib/auth/AuthBuilder.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,qBAAa,eAAe;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY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,YAAY,EAAE,MAAM,GAAG,WAAW;IAKlD,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,WAAW;IAKlD,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW;IAK1C,mBAAmB,CAAC,gBAAgB,EAAE,OAAO,GAAG,WAAW;IAK3D,eAAe,CAAC,YAAY,EAAE,OAAO,GAAG,WAAW;IAKnD,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,WAAW;IAK9C,gBAAgB,CAAC,aAAa,EAAE,MAAM,GAAG,WAAW;IAKpD,eAAe,CAAC,YAAY,EAAE,OAAO,GAAG,WAAW;IAKnD,2BAA2B,CAAC,wBAAwB,EAAE,OAAO,GAAG,WAAW;IAK3E,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,WAAW;IAK7C,OAAO,CAAC,OAAO;IAgBf,IAAI,CAAC,QAAQ,GAAG,GAAG,EAAE,QAAQ,GAAG,KAAK,EACjC,WAAW,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,GAAG,SAAS,GAAG,IAAI,EACnF,UAAU,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,GAAG,KAAK,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,GAAG,SAAS,GAAG,IAAI,GACpF,WAAW,CAAC,QAAQ,GAAG,QAAQ,CAAC;CAGtC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import AuthBuilder from './AuthBuilder';
|
|
2
|
-
/**
|
|
3
|
-
* Service for handling Authentication operations
|
|
4
|
-
*/
|
|
5
|
-
export declare class AuthService {
|
|
6
|
-
/**
|
|
7
|
-
* Returns a builder for login method
|
|
8
|
-
*/
|
|
9
|
-
login(): AuthBuilder;
|
|
10
|
-
/**
|
|
11
|
-
* Returns a builder for authenticateAndActivate method
|
|
12
|
-
*/
|
|
13
|
-
authenticateAndActivate(): AuthBuilder;
|
|
14
|
-
/**
|
|
15
|
-
* Returns a builder for authenticateLocal method
|
|
16
|
-
*/
|
|
17
|
-
authenticateLocal(): AuthBuilder;
|
|
18
|
-
/**
|
|
19
|
-
* Logout method - Logs out the current user
|
|
20
|
-
*/
|
|
21
|
-
logout(): Promise<any>;
|
|
22
|
-
/**
|
|
23
|
-
* Clear all data
|
|
24
|
-
*/
|
|
25
|
-
clearData(): Promise<any>;
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=AuthService.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AuthService.d.ts","sourceRoot":"","sources":["../../../src/lib/auth/AuthService.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,eAAe,CAAC;AAGxC;;GAEG;AACH,qBAAa,WAAW;IAEpB;;OAEG;IACH,KAAK,IAAI,WAAW;IAIpB;;OAEG;IACH,uBAAuB,IAAI,WAAW;IAItC;;OAEG;IACH,iBAAiB,IAAI,WAAW;IAIhC;;OAEG;IACG,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC;IAK5B;;OAEG;IACG,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC;CAIlC"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.AuthService = void 0;
|
|
7
|
-
const AuthBuilder_1 = __importDefault(require("./AuthBuilder"));
|
|
8
|
-
const unvired_ts_core_sdk_1 = require("@unvired/unvired-ts-core-sdk");
|
|
9
|
-
/**
|
|
10
|
-
* Service for handling Authentication operations
|
|
11
|
-
*/
|
|
12
|
-
class AuthService {
|
|
13
|
-
/**
|
|
14
|
-
* Returns a builder for login method
|
|
15
|
-
*/
|
|
16
|
-
login() {
|
|
17
|
-
return new AuthBuilder_1.default('login');
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Returns a builder for authenticateAndActivate method
|
|
21
|
-
*/
|
|
22
|
-
authenticateAndActivate() {
|
|
23
|
-
return new AuthBuilder_1.default('authenticateAndActivate');
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Returns a builder for authenticateLocal method
|
|
27
|
-
*/
|
|
28
|
-
authenticateLocal() {
|
|
29
|
-
return new AuthBuilder_1.default('authenticateLocal');
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Logout method - Logs out the current user
|
|
33
|
-
*/
|
|
34
|
-
async logout() {
|
|
35
|
-
const authService = unvired_ts_core_sdk_1.AuthenticationService.instance;
|
|
36
|
-
return authService.logout();
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Clear all data
|
|
40
|
-
*/
|
|
41
|
-
async clearData() {
|
|
42
|
-
const authService = unvired_ts_core_sdk_1.AuthenticationService.instance;
|
|
43
|
-
return authService.clearData();
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
exports.AuthService = AuthService;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
export interface IDatabaseAdapter {
|
|
2
|
-
create(options: {
|
|
3
|
-
userId: string;
|
|
4
|
-
}, successCallback: (result: any) => void, errorCallback: (error: any) => void): void;
|
|
5
|
-
execute(options: any, successCallback: (result: any) => void, errorCallback: (error: any) => void): void;
|
|
6
|
-
executeStatementOnPath(dbPath: string, sqlQuery: string, callback: (result: any) => void): void;
|
|
7
|
-
selectFromPath(dbPath: string, sqlQuery: string, callback: (result: any) => void): void;
|
|
8
|
-
createDatabase(dbPath: string, callback: () => void): void;
|
|
9
|
-
getDBFilePath(options: {
|
|
10
|
-
dbType: string;
|
|
11
|
-
}, callback: (path: string) => void): void;
|
|
12
|
-
saveWebDB(options: {
|
|
13
|
-
userId: string;
|
|
14
|
-
}, callback: (result: any) => void, errorCallback: (error: any) => void): void;
|
|
15
|
-
exportWebDB(options: {
|
|
16
|
-
userId: string;
|
|
17
|
-
}, callback: (result: any) => void, errorCallback: (error: any) => void): void;
|
|
18
|
-
deleteUserData(options: {
|
|
19
|
-
userId: string;
|
|
20
|
-
}, callback: () => void, errorCallback: (error: any) => void): void;
|
|
21
|
-
}
|
|
22
|
-
export declare class DatabaseService {
|
|
23
|
-
create(options: {
|
|
24
|
-
userId: string;
|
|
25
|
-
}, successCallback: (result: any) => void, errorCallback: (error: any) => void): void;
|
|
26
|
-
execute(options: any, successCallback: (result: any) => void, errorCallback: (error: any) => void): void;
|
|
27
|
-
executeStatementOnPath(dbPath: string, sqlQuery: string, callback: (result: any) => void): void;
|
|
28
|
-
selectFromPath(dbPath: string, sqlQuery: string, callback: (result: any) => void): void;
|
|
29
|
-
createDatabase(dbPath: string, callback: () => void): void;
|
|
30
|
-
getDBFilePath(options: {
|
|
31
|
-
dbType: string;
|
|
32
|
-
}, callback: (path: string) => void): void;
|
|
33
|
-
saveWebDB(options: {
|
|
34
|
-
userId: string;
|
|
35
|
-
}, callback: (result: any) => void, errorCallback: (error: any) => void): void;
|
|
36
|
-
exportWebDB(options: {
|
|
37
|
-
userId: string;
|
|
38
|
-
}, callback: (result: any) => void, errorCallback: (error: any) => void): void;
|
|
39
|
-
deleteUserData(options: {
|
|
40
|
-
userId: string;
|
|
41
|
-
}, callback: () => void, errorCallback: (error: any) => void): void;
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=DatabaseService.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DatabaseService.d.ts","sourceRoot":"","sources":["../../../src/lib/database/DatabaseService.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,gBAAgB;IAC7B,MAAM,CAAC,OAAO,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,EAAE,eAAe,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,EAAE,aAAa,EAAE,CAAC,KAAK,EAAE,GAAG,KA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AI;IAIpH,cAAc,CAAC,OAAO,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,EAAE,QAAQ,EAAE,MAAM,IAAI,EAAE,aAAa,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI;CAG/G"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DatabaseService = void 0;
|
|
4
|
-
const unvired_ts_core_sdk_1 = require("@unvired/unvired-ts-core-sdk");
|
|
5
|
-
class DatabaseService {
|
|
6
|
-
create(options, successCallback, errorCallback) {
|
|
7
|
-
unvired_ts_core_sdk_1.PlatformManager.getInstance().getPlatformAdapter().getDatabaseAdapter().create(options, successCallback, errorCallback);
|
|
8
|
-
}
|
|
9
|
-
execute(options, successCallback, errorCallback) {
|
|
10
|
-
unvired_ts_core_sdk_1.PlatformManager.getInstance().getPlatformAdapter().getDatabaseAdapter().execute(options, successCallback, errorCallback);
|
|
11
|
-
}
|
|
12
|
-
executeStatementOnPath(dbPath, sqlQuery, callback) {
|
|
13
|
-
unvired_ts_core_sdk_1.PlatformManager.getInstance().getPlatformAdapter().getDatabaseAdapter().executeStatementOnPath(dbPath, sqlQuery, callback);
|
|
14
|
-
}
|
|
15
|
-
selectFromPath(dbPath, sqlQuery, callback) {
|
|
16
|
-
unvired_ts_core_sdk_1.PlatformManager.getInstance().getPlatformAdapter().getDatabaseAdapter().selectFromPath(dbPath, sqlQuery, callback);
|
|
17
|
-
}
|
|
18
|
-
createDatabase(dbPath, callback) {
|
|
19
|
-
unvired_ts_core_sdk_1.PlatformManager.getInstance().getPlatformAdapter().getDatabaseAdapter().createDatabase(dbPath, callback);
|
|
20
|
-
}
|
|
21
|
-
getDBFilePath(options, callback) {
|
|
22
|
-
unvired_ts_core_sdk_1.PlatformManager.getInstance().getPlatformAdapter().getDatabaseAdapter().getDBFilePath(options, callback);
|
|
23
|
-
}
|
|
24
|
-
saveWebDB(options, callback, errorCallback) {
|
|
25
|
-
unvired_ts_core_sdk_1.PlatformManager.getInstance().getPlatformAdapter().getDatabaseAdapter().saveWebDB(options, callback, errorCallback);
|
|
26
|
-
}
|
|
27
|
-
exportWebDB(options, callback, errorCallback) {
|
|
28
|
-
unvired_ts_core_sdk_1.PlatformManager.getInstance().getPlatformAdapter().getDatabaseAdapter().exportWebDB(options, callback, errorCallback);
|
|
29
|
-
}
|
|
30
|
-
deleteUserData(options, callback, errorCallback) {
|
|
31
|
-
unvired_ts_core_sdk_1.PlatformManager.getInstance().getPlatformAdapter().getDatabaseAdapter().deleteUserData(options, callback, errorCallback);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
exports.DatabaseService = DatabaseService;
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
export interface IDirectoryReader {
|
|
2
|
-
readEntries(successCallback: (entries: IFileEntry[]) => void, errorCallback: (error: any) => void): void;
|
|
3
|
-
}
|
|
4
|
-
export interface IFileEntry {
|
|
5
|
-
fullPath: string;
|
|
6
|
-
nativeURL: string;
|
|
7
|
-
isDirectory?: boolean;
|
|
8
|
-
remove(callback: () => void, errorCallback: (error: any) => void): void;
|
|
9
|
-
removeRecursively(callback: () => void, errorCallback: (error: any) => void): void;
|
|
10
|
-
createReader(): IDirectoryReader;
|
|
11
|
-
getDirectory?(path: string, options: {
|
|
12
|
-
create: boolean;
|
|
13
|
-
}, callback: (entry: IFileEntry) => void, errorCallback: (error: any) => void): void;
|
|
14
|
-
getFile?(path: string, options: {
|
|
15
|
-
create: boolean;
|
|
16
|
-
}, callback: (entry: IFileEntry) => void, errorCallback: (error: any) => void): void;
|
|
17
|
-
file?(callback: (file: File) => void, errorCallback: (error: any) => void): void;
|
|
18
|
-
createWriter?(callback: (writer: any) => void, errorCallback: (error: any) => void): void;
|
|
19
|
-
}
|
|
20
|
-
export declare class FileService {
|
|
21
|
-
getDocumentDirectory(): string;
|
|
22
|
-
resolveLocalFileSystemURL(url: string): Promise<IFileEntry>;
|
|
23
|
-
getFolderBasedOnUserId(userId: string): Promise<string>;
|
|
24
|
-
deleteUserFolder(userId: string): Promise<void>;
|
|
25
|
-
/**
|
|
26
|
-
* Gets the directory used for storing attachments
|
|
27
|
-
*/
|
|
28
|
-
getAttachmentDirectory(): Promise<string>;
|
|
29
|
-
/**
|
|
30
|
-
* Adds an attachment
|
|
31
|
-
* @param attachmentName Name of the attachment
|
|
32
|
-
* @param attachmentData Data as ArrayBuffer
|
|
33
|
-
*/
|
|
34
|
-
addAttachment(attachmentName: string, attachmentData: ArrayBuffer): Promise<string>;
|
|
35
|
-
/**
|
|
36
|
-
* Gets an attachment's data
|
|
37
|
-
* @param attachmentName Name of the attachment
|
|
38
|
-
*/
|
|
39
|
-
getAttachment(attachmentName: string): Promise<ArrayBuffer>;
|
|
40
|
-
/**
|
|
41
|
-
* Deletes an attachment
|
|
42
|
-
* @param attachmentName Name of the attachment
|
|
43
|
-
*/
|
|
44
|
-
deleteAttachment(attachmentName: string): Promise<void>;
|
|
45
|
-
/**
|
|
46
|
-
* Gets the file system path of an attachment
|
|
47
|
-
* @param attachmentName Name of the attachment
|
|
48
|
-
*/
|
|
49
|
-
getAttachmentPath(attachmentName: string): Promise<string>;
|
|
50
|
-
/**
|
|
51
|
-
* Reads a file from the filesystem as ArrayBuffer
|
|
52
|
-
* @param filePath Absolute path to the file
|
|
53
|
-
*/
|
|
54
|
-
readFileAsArrayBuffer(filePath: string): Promise<ArrayBuffer>;
|
|
55
|
-
/**
|
|
56
|
-
* Checks if a file exists
|
|
57
|
-
* @param filePath Absolute path to the file
|
|
58
|
-
*/
|
|
59
|
-
fileExists(filePath: string): Promise<boolean>;
|
|
60
|
-
/**
|
|
61
|
-
* Reads an external file
|
|
62
|
-
* @param filePath Absolute path to the file
|
|
63
|
-
*/
|
|
64
|
-
readExternalFile(filePath: string): Promise<ArrayBuffer>;
|
|
65
|
-
/**
|
|
66
|
-
* Writes data to an external file
|
|
67
|
-
* @param filePath Parent directory path
|
|
68
|
-
* @param fileName File name
|
|
69
|
-
* @param data Data to write
|
|
70
|
-
*/
|
|
71
|
-
writeExternalFile(filePath: string, fileName: string, data: ArrayBuffer): Promise<void>;
|
|
72
|
-
/**
|
|
73
|
-
* Deletes an external file
|
|
74
|
-
* @param filePath Absolute path to the file
|
|
75
|
-
*/
|
|
76
|
-
deleteExternalFile(filePath: string): Promise<void>;
|
|
77
|
-
/**
|
|
78
|
-
* Create Attachment Item - Copies file to attachment folder and inserts record in DB
|
|
79
|
-
* @param tableName Table name for attachment
|
|
80
|
-
* @param structureObject Attachment item object
|
|
81
|
-
*/
|
|
82
|
-
createAttachmentItem(tableName: string, structureObject: any): Promise<any>;
|
|
83
|
-
/**
|
|
84
|
-
* Queues an attachment for download
|
|
85
|
-
* @param tableName Table name
|
|
86
|
-
* @param structureObject Structure object
|
|
87
|
-
*/
|
|
88
|
-
downloadAttachment(tableName: string, structureObject: any): Promise<any>;
|
|
89
|
-
/**
|
|
90
|
-
* Downloads an attachment synchronously (waits for completion)
|
|
91
|
-
* @param structureObject Structure object with UID and FileName
|
|
92
|
-
*/
|
|
93
|
-
downloadAttachmentSync(structureObject: any): Promise<any>;
|
|
94
|
-
}
|
|
95
|
-
//# sourceMappingURL=FileService.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FileService.d.ts","sourceRoot":"","sources":["../../../src/lib/file/FileService.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,gBAAgB;IAC7B,WAAW,CAAC,eAAe,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,IAAI,EAAE,aAAa,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI,CAAC;CAC5G;AAED,MAAM,WAAW,UAAU;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,MAAM,CAAC,QAAQ,E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