@unvired/react-native-wrapper-sdk 0.0.15 → 0.0.16

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.
Files changed (38) hide show
  1. package/dist/UnviredWrapper.d.ts +22 -25
  2. package/dist/UnviredWrapper.d.ts.map +1 -1
  3. package/dist/UnviredWrapper.js +48 -32
  4. package/dist/lib/AuthBuilder.d.ts.map +1 -0
  5. package/package.json +3 -3
  6. package/src/UnviredWrapper.ts +52 -34
  7. package/dist/lib/auth/AuthBuilder.d.ts.map +0 -1
  8. package/dist/lib/auth/AuthService.d.ts +0 -27
  9. package/dist/lib/auth/AuthService.d.ts.map +0 -1
  10. package/dist/lib/auth/AuthService.js +0 -46
  11. package/dist/lib/database/DatabaseService.d.ts +0 -86
  12. package/dist/lib/database/DatabaseService.d.ts.map +0 -1
  13. package/dist/lib/database/DatabaseService.js +0 -134
  14. package/dist/lib/file/FileService.d.ts +0 -72
  15. package/dist/lib/file/FileService.d.ts.map +0 -1
  16. package/dist/lib/file/FileService.js +0 -136
  17. package/dist/lib/logger/LoggerService.d.ts +0 -45
  18. package/dist/lib/logger/LoggerService.d.ts.map +0 -1
  19. package/dist/lib/logger/LoggerService.js +0 -65
  20. package/dist/lib/notification/NotificationService.d.ts +0 -28
  21. package/dist/lib/notification/NotificationService.d.ts.map +0 -1
  22. package/dist/lib/notification/NotificationService.js +0 -47
  23. package/dist/lib/settings/SettingsService.d.ts +0 -41
  24. package/dist/lib/settings/SettingsService.d.ts.map +0 -1
  25. package/dist/lib/settings/SettingsService.js +0 -108
  26. package/dist/lib/sync/SyncService.d.ts +0 -96
  27. package/dist/lib/sync/SyncService.d.ts.map +0 -1
  28. package/dist/lib/sync/SyncService.js +0 -139
  29. package/src/lib/auth/AuthService.ts +0 -45
  30. package/src/lib/database/DatabaseService.ts +0 -148
  31. package/src/lib/file/FileService.ts +0 -149
  32. package/src/lib/logger/LoggerService.ts +0 -70
  33. package/src/lib/notification/NotificationService.ts +0 -45
  34. package/src/lib/settings/SettingsService.ts +0 -126
  35. package/src/lib/sync/SyncService.ts +0 -160
  36. /package/dist/lib/{auth/AuthBuilder.d.ts → AuthBuilder.d.ts} +0 -0
  37. /package/dist/lib/{auth/AuthBuilder.js → AuthBuilder.js} +0 -0
  38. /package/src/lib/{auth/AuthBuilder.ts → AuthBuilder.ts} +0 -0
@@ -1,10 +1,4 @@
1
- import { AuthService } from './lib/auth/AuthService';
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
- * Access Authentication operations
9
+ * Returns a builder for login method
10
+ * Can be awaited directly: await sdk.login().setAppName("my-app")
16
11
  */
17
- auth(): AuthService;
12
+ login(): AuthBuilder;
18
13
  /**
19
- * Access Database operations
14
+ * Returns a builder for authenticateAndActivate method
15
+ * Can be awaited directly: await sdk.authenticateAndActivate().setUsername("demo")
20
16
  */
21
- database(): DatabaseService;
17
+ authenticateAndActivate(): AuthBuilder;
22
18
  /**
23
- * Access File/Attachment operations
19
+ * Returns a builder for authenticateLocal method
20
+ * Can be awaited directly: await sdk.authenticateLocal().setUsername("demo")
24
21
  */
25
- file(): FileService;
22
+ authenticateLocal(): AuthBuilder;
26
23
  /**
27
- * Access Notification operations
24
+ * Logout method - Logs out the current user
28
25
  */
29
- notification(): NotificationService;
26
+ logout(): Promise<any>;
30
27
  /**
31
- * Access Synchronization operations
28
+ * Clear all data
32
29
  */
33
- sync(): SyncService;
34
- /**
35
- * Access Settings and Utility operations
36
- */
37
- settings(): SettingsService;
38
- /**
39
- * Access Logger operations
40
- */
41
- logger(): LoggerService;
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":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D;;;GAGG;AACH,qBAAa,cAAc;;IAKzB;;OAEG;IACH,IAAI,IAAI,WAAW;IAInB;;OAEG;IACH,QAAQ,IAAI,eAAe;IAI3B;;OAEG;IACH,IAAI,IAAI,WAAW;IAInB;;OAEG;IACH,YAAY,IAAI,mBAAmB;IAInC;;OAEG;IACH,IAAI,IAAI,WAAW;IAInB;;OAEG;IACH,QAAQ,IAAI,eAAe;IAI3B;;OAEG;IACH,MAAM,IAAI,aAAa;CAIxB;AAED,eAAe,cAAc,CAAC"}
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"}
@@ -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 AuthService_1 = require("./lib/auth/AuthService");
5
- const DatabaseService_1 = require("./lib/database/DatabaseService");
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
- * Access Authentication operations
18
+ * Returns a builder for login method
19
+ * Can be awaited directly: await sdk.login().setAppName("my-app")
21
20
  */
22
- auth() {
23
- return new AuthService_1.AuthService();
21
+ login() {
22
+ return new AuthBuilder_1.default('login');
24
23
  }
25
24
  /**
26
- * Access Database operations
25
+ * Returns a builder for authenticateAndActivate method
26
+ * Can be awaited directly: await sdk.authenticateAndActivate().setUsername("demo")
27
27
  */
28
- database() {
29
- return new DatabaseService_1.DatabaseService();
28
+ authenticateAndActivate() {
29
+ return new AuthBuilder_1.default('authenticateAndActivate');
30
30
  }
31
31
  /**
32
- * Access File/Attachment operations
32
+ * Returns a builder for authenticateLocal method
33
+ * Can be awaited directly: await sdk.authenticateLocal().setUsername("demo")
33
34
  */
34
- file() {
35
- return new FileService_1.FileService();
35
+ authenticateLocal() {
36
+ return new AuthBuilder_1.default('authenticateLocal');
36
37
  }
37
38
  /**
38
- * Access Notification operations
39
+ * Logout method - Logs out the current user
39
40
  */
40
- notification() {
41
- return new NotificationService_1.NotificationService();
41
+ async logout() {
42
+ const authService = unvired_ts_core_sdk_1.AuthenticationService.instance;
43
+ return authService.logout();
42
44
  }
43
45
  /**
44
- * Access Synchronization operations
46
+ * Clear all data
45
47
  */
46
- sync() {
47
- return new SyncService_1.SyncService();
48
+ async clearData() {
49
+ const authService = unvired_ts_core_sdk_1.AuthenticationService.instance;
50
+ return authService.clearData();
48
51
  }
49
- /**
50
- * Access Settings and Utility operations
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
- * Access Logger operations
57
- */
58
- logger() {
59
- return new LoggerService_1.LoggerService();
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 @@
1
+ {"version":3,"file":"AuthBuilder.d.ts","sourceRoot":"","sources":["../../src/lib/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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GtC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unvired/react-native-wrapper-sdk",
3
- "version": "0.0.15",
3
+ "version": "0.0.16",
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",
@@ -27,8 +27,8 @@
27
27
  "react-native": ">=0.60.0"
28
28
  },
29
29
  "dependencies": {
30
- "@unvired/react-native-unvired-sdk": "^0.0.15",
31
- "@unvired/unvired-ts-core-sdk": "^0.0.15",
30
+ "@unvired/react-native-unvired-sdk": "^0.0.12",
31
+ "@unvired/unvired-ts-core-sdk": "^0.0.14",
32
32
  "axios": "^1.6.5",
33
33
  "crypto-js": "^4.2.0",
34
34
  "uuid": "^9.0.1"
@@ -1,11 +1,5 @@
1
- import { AuthenticationService } from '@unvired/unvired-ts-core-sdk';
2
- import { AuthService } from './lib/auth/AuthService';
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
- * Access Authentication operations
14
+ * Returns a builder for login method
15
+ * Can be awaited directly: await sdk.login().setAppName("my-app")
21
16
  */
22
- auth(): AuthService {
23
- return new AuthService();
17
+ login(): AuthBuilder {
18
+ return new AuthBuilder('login');
24
19
  }
25
20
 
26
21
  /**
27
- * Access Database operations
22
+ * Returns a builder for authenticateAndActivate method
23
+ * Can be awaited directly: await sdk.authenticateAndActivate().setUsername("demo")
28
24
  */
29
- database(): DatabaseService {
30
- return new DatabaseService();
25
+ authenticateAndActivate(): AuthBuilder {
26
+ return new AuthBuilder('authenticateAndActivate');
31
27
  }
32
28
 
33
29
  /**
34
- * Access File/Attachment operations
30
+ * Returns a builder for authenticateLocal method
31
+ * Can be awaited directly: await sdk.authenticateLocal().setUsername("demo")
35
32
  */
36
- file(): FileService {
37
- return new FileService();
33
+ authenticateLocal(): AuthBuilder {
34
+ return new AuthBuilder('authenticateLocal');
38
35
  }
39
36
 
40
37
  /**
41
- * Access Notification operations
38
+ * Logout method - Logs out the current user
42
39
  */
43
- notification(): NotificationService {
44
- return new NotificationService();
40
+ async logout(): Promise<any> {
41
+ const authService = (AuthenticationService as any).instance;
42
+ return authService.logout();
45
43
  }
46
44
 
47
45
  /**
48
- * Access Synchronization operations
46
+ * Clear all data
49
47
  */
50
- sync(): SyncService {
51
- return new SyncService();
48
+ async clearData(): Promise<any> {
49
+ const authService = (AuthenticationService as any).instance;
50
+ return authService.clearData();
52
51
  }
53
52
 
54
- /**
55
- * Access Settings and Utility operations
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
- * Access Logger operations
63
- */
64
- logger(): LoggerService {
65
- return new LoggerService();
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,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YA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AAU,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,86 +0,0 @@
1
- export declare class DatabaseService {
2
- private db;
3
- constructor();
4
- /**
5
- * Selects data from the database
6
- * @param tableName Name of the table
7
- * @param whereClause Optional SQL where clause
8
- */
9
- select(tableName: string, whereClause?: string): Promise<any>;
10
- /**
11
- * Inserts data into the database
12
- * @param tableName Name of the table
13
- * @param structureObject Data object to insert
14
- * @param isHeader Whether the data is a header or an item
15
- */
16
- insert(tableName: string, structureObject: any, isHeader: boolean): Promise<any>;
17
- /**
18
- * Inserts or updates data in the database
19
- * @param tableName Name of the table
20
- * @param structureObject Data object to insert or update
21
- * @param isHeader Whether the data is a header or an item
22
- */
23
- insertOrUpdate(tableName: string, structureObject: any, isHeader: boolean): Promise<any>;
24
- /**
25
- * Deletes data from the database
26
- * @param tableName Name of the table
27
- * @param whereClause Optional SQL where clause
28
- */
29
- delete(tableName: string, whereClause?: string): Promise<any>;
30
- /**
31
- * Updates data in the database
32
- * @param tableName Name of the table
33
- * @param updatedObject Object with updated values
34
- * @param whereClause SQL where clause identifying rows to update
35
- */
36
- update(tableName: string, updatedObject: any, whereClause: any): Promise<any>;
37
- /**
38
- * Executes a raw SQL statement
39
- * @param query SQL query
40
- */
41
- executeStatement(query: string): Promise<any>;
42
- /**
43
- * Begins a transaction
44
- */
45
- beginTransaction(): Promise<void>;
46
- /**
47
- * Ends (commits) a transaction
48
- */
49
- endTransaction(): Promise<void>;
50
- /**
51
- * Rolls back a transaction
52
- */
53
- rollbackTransaction(): Promise<void>;
54
- /**
55
- * Creates a save point
56
- * @param savePoint Name of the save point
57
- */
58
- createSavePoint(savePoint: string): Promise<void>;
59
- /**
60
- * Releases a save point
61
- * @param savePoint Name of the save point
62
- */
63
- releaseSavePoint(savePoint: string): Promise<void>;
64
- /**
65
- * Rolls back to a save point
66
- * @param savePoint Name of the save point
67
- */
68
- rollbackToSavePoint(savePoint: string): Promise<void>;
69
- /**
70
- * Saves Web Data (Browser only)
71
- */
72
- saveWebData(): Promise<void>;
73
- /**
74
- * Exports Web Data
75
- */
76
- exportWebData(): Promise<void>;
77
- /**
78
- * Prepares database for export
79
- */
80
- prepareDatabaseForExport(): Promise<void>;
81
- /**
82
- * Gets the database directory path
83
- */
84
- getDatabasePath(): Promise<string>;
85
- }
86
- //# sourceMappingURL=DatabaseService.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Datab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AI3D;;OAEG;IACG,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAMlC;;OAEG;IACG,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAIpC;;OAEG;IACG,wBAAwB,IAAI,OAAO,CAAC,IAAI,CAAC;IAI/C;;OAEG;IACG,eAAe,IAAI,OAAO,CAAC,MAAM,CAAC;CAW3C"}
@@ -1,134 +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
- constructor() {
7
- this.db = unvired_ts_core_sdk_1.AppDatabaseManager.getInstance();
8
- }
9
- /**
10
- * Selects data from the database
11
- * @param tableName Name of the table
12
- * @param whereClause Optional SQL where clause
13
- */
14
- async select(tableName, whereClause) {
15
- return this.db.select(tableName, whereClause);
16
- }
17
- /**
18
- * Inserts data into the database
19
- * @param tableName Name of the table
20
- * @param structureObject Data object to insert
21
- * @param isHeader Whether the data is a header or an item
22
- */
23
- async insert(tableName, structureObject, isHeader) {
24
- return this.db.insert(tableName, structureObject, isHeader);
25
- }
26
- /**
27
- * Inserts or updates data in the database
28
- * @param tableName Name of the table
29
- * @param structureObject Data object to insert or update
30
- * @param isHeader Whether the data is a header or an item
31
- */
32
- async insertOrUpdate(tableName, structureObject, isHeader) {
33
- return this.db.insertOrUpdate(tableName, structureObject, isHeader);
34
- }
35
- /**
36
- * Deletes data from the database
37
- * @param tableName Name of the table
38
- * @param whereClause Optional SQL where clause
39
- */
40
- async delete(tableName, whereClause) {
41
- return this.db.delete(tableName, whereClause);
42
- }
43
- /**
44
- * Updates data in the database
45
- * @param tableName Name of the table
46
- * @param updatedObject Object with updated values
47
- * @param whereClause SQL where clause identifying rows to update
48
- */
49
- async update(tableName, updatedObject, whereClause) {
50
- return this.db.update(tableName, updatedObject, whereClause);
51
- }
52
- /**
53
- * Executes a raw SQL statement
54
- * @param query SQL query
55
- */
56
- async executeStatement(query) {
57
- return this.db.executeStatement(query);
58
- }
59
- /**
60
- * Begins a transaction
61
- */
62
- async beginTransaction() {
63
- return this.db.beginTransaction();
64
- }
65
- /**
66
- * Ends (commits) a transaction
67
- */
68
- async endTransaction() {
69
- return this.db.endTransaction();
70
- }
71
- /**
72
- * Rolls back a transaction
73
- */
74
- async rollbackTransaction() {
75
- return this.db.rollbackTransaction();
76
- }
77
- /**
78
- * Creates a save point
79
- * @param savePoint Name of the save point
80
- */
81
- async createSavePoint(savePoint) {
82
- return this.db.createSavePoint(savePoint);
83
- }
84
- /**
85
- * Releases a save point
86
- * @param savePoint Name of the save point
87
- */
88
- async releaseSavePoint(savePoint) {
89
- return this.db.releaseSavePoint(savePoint);
90
- }
91
- /**
92
- * Rolls back to a save point
93
- * @param savePoint Name of the save point
94
- */
95
- async rollbackToSavePoint(savePoint) {
96
- return this.db.rollbackToSavePoint(savePoint);
97
- }
98
- /**
99
- * Saves Web Data (Browser only)
100
- */
101
- async saveWebData() {
102
- if (unvired_ts_core_sdk_1.FrameworkHelper.getPlatform() === 'browser') {
103
- return unvired_ts_core_sdk_1.DatabaseManager.getInstance().saveWebData();
104
- }
105
- }
106
- /**
107
- * Exports Web Data
108
- */
109
- async exportWebData() {
110
- return unvired_ts_core_sdk_1.DatabaseManager.getInstance().exportWebData();
111
- }
112
- /**
113
- * Prepares database for export
114
- */
115
- async prepareDatabaseForExport() {
116
- return unvired_ts_core_sdk_1.SettingsHelper.prepareDatabaseForExport();
117
- }
118
- /**
119
- * Gets the database directory path
120
- */
121
- async getDatabasePath() {
122
- return new Promise((resolve, reject) => {
123
- try {
124
- const adapter = unvired_ts_core_sdk_1.PlatformManager.getInstance().getPlatformAdapter().getDatabaseAdapter();
125
- // @ts-ignore - The type might be mismatch in d.ts but logical flow is correct
126
- adapter.getDBFilePath({ dbType: unvired_ts_core_sdk_1.DatabaseType.AppDb }, (path) => resolve(path));
127
- }
128
- catch (e) {
129
- reject(e);
130
- }
131
- });
132
- }
133
- }
134
- exports.DatabaseService = DatabaseService;