@unvired/react-native-wrapper-sdk 0.0.5 → 0.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.
Files changed (33) hide show
  1. package/dist/UnviredWrapper.d.ts +12 -7
  2. package/dist/UnviredWrapper.d.ts.map +1 -1
  3. package/dist/UnviredWrapper.js +32 -28
  4. package/dist/index.d.ts +0 -3
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +0 -6
  7. package/dist/lib/AuthBuilder.d.ts +18 -6
  8. package/dist/lib/AuthBuilder.d.ts.map +1 -1
  9. package/dist/lib/AuthBuilder.js +24 -7
  10. package/package.json +1 -1
  11. package/src/UnviredWrapper.ts +35 -36
  12. package/src/index.ts +0 -5
  13. package/src/lib/AuthBuilder.ts +43 -28
  14. package/dist/core/UnviredSDK.d.ts +0 -107
  15. package/dist/core/UnviredSDK.d.ts.map +0 -1
  16. package/dist/core/UnviredSDK.js +0 -24
  17. package/dist/core/platform/CordovaPlatformAdapter.d.ts +0 -13
  18. package/dist/core/platform/CordovaPlatformAdapter.d.ts.map +0 -1
  19. package/dist/core/platform/CordovaPlatformAdapter.js +0 -62
  20. package/dist/core/platform/PlatformInterface.d.ts +0 -12
  21. package/dist/core/platform/PlatformInterface.d.ts.map +0 -1
  22. package/dist/core/platform/PlatformInterface.js +0 -2
  23. package/dist/core/platform/PlatformManager.d.ts +0 -10
  24. package/dist/core/platform/PlatformManager.d.ts.map +0 -1
  25. package/dist/core/platform/PlatformManager.js +0 -29
  26. package/dist/core/platform/ReactNativePlatformAdapter.d.ts +0 -13
  27. package/dist/core/platform/ReactNativePlatformAdapter.d.ts.map +0 -1
  28. package/dist/core/platform/ReactNativePlatformAdapter.js +0 -47
  29. package/src/core/UnviredSDK.ts +0 -126
  30. package/src/core/platform/CordovaPlatformAdapter.ts +0 -69
  31. package/src/core/platform/PlatformInterface.ts +0 -12
  32. package/src/core/platform/PlatformManager.ts +0 -35
  33. package/src/core/platform/ReactNativePlatformAdapter.ts +0 -57
@@ -1,8 +1,10 @@
1
1
  import AuthBuilder from './lib/AuthBuilder';
2
+ /**
3
+ * React Native Wrapper for Unvired Core SDK
4
+ * Provides a clean, fluent API for React Native applications
5
+ */
2
6
  export declare class UnviredWrapper {
3
- private unviredSDK;
4
7
  constructor();
5
- private static get logger();
6
8
  /**
7
9
  * Returns a builder for login method
8
10
  * Can be awaited directly: await sdk.login().setAppName("my-app")
@@ -18,19 +20,22 @@ export declare class UnviredWrapper {
18
20
  * Can be awaited directly: await sdk.authenticateLocal().setUsername("demo")
19
21
  */
20
22
  authenticateLocal(): AuthBuilder;
23
+ /**
24
+ * Logout method - Logs out the current user
25
+ */
26
+ logout(): Promise<any>;
27
+ /**
28
+ * Clear all data
29
+ */
30
+ clearData(): Promise<any>;
21
31
  static logInfo(className: string, methodName: string, message: string): void;
22
32
  static logError(className: string, methodName: string, message: string): void;
23
33
  static logDebug(className: string, methodName: string, message: string): void;
24
- static logWarning(className: string, methodName: string, message: string): void;
25
34
  static setLogLevel(level: string): void;
26
35
  static getLogFileURL(): Promise<string>;
27
36
  static getLogFileContent(): Promise<string>;
28
37
  static getBackupLogFileContent(): Promise<string>;
29
38
  static clearLogFile(): Promise<void>;
30
- /**
31
- * Logout method - Calls CoreWebSDK
32
- */
33
- logout(): Promise<boolean>;
34
39
  }
35
40
  export default UnviredWrapper;
36
41
  //# sourceMappingURL=UnviredWrapper.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"UnviredWrapper.d.ts","sourceRoot":"","sources":["../src/UnviredWrapper.ts"],"names":[],"mappings":"AACA,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAK5C,qBAAa,cAAc;IACzB,OAAO,CAAC,UAAU,CAAa;;IAM/B,OAAO,CAAC,MAAM,KAAK,MAAM,GAGxB;IAED;;;OAGG;IACH,KAAK,IAAI,WAAW;IAIpB;;;OAGG;IACH,uBAAuB,IAAI,WAAW;IAItC;;;OAGG;IACH,iBAAiB,IAAI,WAAW;IAIhC,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;IAMrE,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;IAItE,MAAM,CAAC,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;IAIxE,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;IAI1C;;OAEG;IACG,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC;CAGjC;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"}
@@ -4,71 +4,75 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.UnviredWrapper = void 0;
7
- const UnviredSDK_1 = __importDefault(require("./core/UnviredSDK"));
8
7
  const AuthBuilder_1 = __importDefault(require("./lib/AuthBuilder"));
9
- const PlatformManager_1 = __importDefault(require("@unvired/unvired-ts-core-sdk/platform/PlatformManager"));
8
+ const unvired_ts_core_sdk_1 = require("@unvired/unvired-ts-core-sdk");
9
+ /**
10
+ * React Native Wrapper for Unvired Core SDK
11
+ * Provides a clean, fluent API for React Native applications
12
+ */
10
13
  class UnviredWrapper {
11
14
  constructor() {
12
- this.unviredSDK = new UnviredSDK_1.default();
13
- }
14
- static get logger() {
15
- console.log('PlatformInterface from core SDK', PlatformManager_1.default);
16
- return UnviredSDK_1.default.getPlatformManager().getPlatformAdapter();
15
+ // AuthenticationService is a singleton, accessed via static instance getter
17
16
  }
18
17
  /**
19
18
  * Returns a builder for login method
20
19
  * Can be awaited directly: await sdk.login().setAppName("my-app")
21
20
  */
22
21
  login() {
23
- return new AuthBuilder_1.default(this.unviredSDK, 'login');
22
+ return new AuthBuilder_1.default('login');
24
23
  }
25
24
  /**
26
25
  * Returns a builder for authenticateAndActivate method
27
26
  * Can be awaited directly: await sdk.authenticateAndActivate().setUsername("demo")
28
27
  */
29
28
  authenticateAndActivate() {
30
- return new AuthBuilder_1.default(this.unviredSDK, 'authenticateAndActivate');
29
+ return new AuthBuilder_1.default('authenticateAndActivate');
31
30
  }
32
31
  /**
33
32
  * Returns a builder for authenticateLocal method
34
33
  * Can be awaited directly: await sdk.authenticateLocal().setUsername("demo")
35
34
  */
36
35
  authenticateLocal() {
37
- return new AuthBuilder_1.default(this.unviredSDK, 'authenticateLocal');
36
+ return new AuthBuilder_1.default('authenticateLocal');
38
37
  }
38
+ /**
39
+ * Logout method - Logs out the current user
40
+ */
41
+ async logout() {
42
+ const authService = unvired_ts_core_sdk_1.AuthenticationService.instance;
43
+ return authService.logout();
44
+ }
45
+ /**
46
+ * Clear all data
47
+ */
48
+ async clearData() {
49
+ const authService = unvired_ts_core_sdk_1.AuthenticationService.instance;
50
+ return authService.clearData();
51
+ }
52
+ // Logging methods - delegating to PlatformManager's adapter
39
53
  static logInfo(className, methodName, message) {
40
- console.log('PlatformInterface from core SDK', PlatformManager_1.default);
41
- this.logger.logInfo(className, methodName, message);
54
+ return unvired_ts_core_sdk_1.PlatformManager.getInstance().getPlatformAdapter().getLoggerAdapter().logInfo(className, methodName, message);
42
55
  }
43
56
  static logError(className, methodName, message) {
44
- this.logger.logError(className, methodName, message);
57
+ return unvired_ts_core_sdk_1.PlatformManager.getInstance().getPlatformAdapter().getLoggerAdapter().logError(className, methodName, message);
45
58
  }
46
59
  static logDebug(className, methodName, message) {
47
- this.logger.logDebug(className, methodName, message);
48
- }
49
- static logWarning(className, methodName, message) {
50
- this.logger.logWarning(className, methodName, message);
60
+ return unvired_ts_core_sdk_1.PlatformManager.getInstance().getPlatformAdapter().getLoggerAdapter().logDebug(className, methodName, message);
51
61
  }
52
62
  static setLogLevel(level) {
53
- this.logger.setLogLevel(level);
63
+ return unvired_ts_core_sdk_1.PlatformManager.getInstance().getPlatformAdapter().getLoggerAdapter().setLogLevel(level);
54
64
  }
55
65
  static async getLogFileURL() {
56
- return this.logger.getLogFileURL();
66
+ return unvired_ts_core_sdk_1.PlatformManager.getInstance().getPlatformAdapter().getLoggerAdapter().getLogFileURL();
57
67
  }
58
68
  static async getLogFileContent() {
59
- return this.logger.getLogFileContent();
69
+ return unvired_ts_core_sdk_1.PlatformManager.getInstance().getPlatformAdapter().getLoggerAdapter().getLogFileContent();
60
70
  }
61
71
  static async getBackupLogFileContent() {
62
- return this.logger.getBackupLogFileContent();
72
+ return unvired_ts_core_sdk_1.PlatformManager.getInstance().getPlatformAdapter().getLoggerAdapter().getBackupLogFileContent();
63
73
  }
64
74
  static async clearLogFile() {
65
- return this.logger.clearLogFile();
66
- }
67
- /**
68
- * Logout method - Calls CoreWebSDK
69
- */
70
- async logout() {
71
- return this.unviredSDK.logout();
75
+ return unvired_ts_core_sdk_1.PlatformManager.getInstance().getPlatformAdapter().getLoggerAdapter().clearLogFile();
72
76
  }
73
77
  }
74
78
  exports.UnviredWrapper = UnviredWrapper;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,3 @@
1
1
  import UnviredWrapper from './UnviredWrapper';
2
- export { LoginParameters, LoginType } from './core/UnviredSDK';
3
2
  export default UnviredWrapper;
4
- import UMP from '@unvired/unvired-ts-core-sdk';
5
- export { UMP };
6
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAG/D,eAAe,cAAc,CAAC;AAE9B,OAAO,GAAG,MAAM,8BAA8B,CAAC;AAC/C,OAAO,EAAE,GAAG,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAE9C,eAAe,cAAc,CAAC"}
package/dist/index.js CHANGED
@@ -3,13 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.UMP = exports.LoginType = exports.LoginParameters = void 0;
7
6
  // Export main SDK
8
7
  const UnviredWrapper_1 = __importDefault(require("./UnviredWrapper"));
9
- var UnviredSDK_1 = require("./core/UnviredSDK");
10
- Object.defineProperty(exports, "LoginParameters", { enumerable: true, get: function () { return UnviredSDK_1.LoginParameters; } });
11
- Object.defineProperty(exports, "LoginType", { enumerable: true, get: function () { return UnviredSDK_1.LoginType; } });
12
8
  // Export the default SDK instance
13
9
  exports.default = UnviredWrapper_1.default;
14
- const unvired_ts_core_sdk_1 = __importDefault(require("@unvired/unvired-ts-core-sdk"));
15
- exports.UMP = unvired_ts_core_sdk_1.default;
@@ -1,9 +1,20 @@
1
- import UnviredSDK, { LoginParameters, LoginType } from './../core/UnviredSDK';
2
- export default class AuthBuilder implements PromiseLike<string> {
3
- private sdk;
1
+ import { LoginParameters } from '@unvired/unvired-ts-core-sdk/helper/utils';
2
+ /**
3
+ * LoginType enum for different authentication types
4
+ */
5
+ export declare enum LoginType {
6
+ UNVIRED = "UNVIRED",
7
+ LDAP = "LDAP",
8
+ SSO = "SSO"
9
+ }
10
+ /**
11
+ * AuthBuilder - Fluent API for building authentication requests
12
+ * Can be awaited directly without calling .execute()
13
+ */
14
+ export default class AuthBuilder implements PromiseLike<any> {
4
15
  private method;
5
16
  private loginParameters;
6
- constructor(sdk: UnviredSDK, method: 'login' | 'authenticateAndActivate' | 'authenticateLocal');
17
+ constructor(method: 'login' | 'authenticateAndActivate' | 'authenticateLocal');
7
18
  setAppName(appName: string): AuthBuilder;
8
19
  setCompany(company: string): AuthBuilder;
9
20
  setUsername(username: string): AuthBuilder;
@@ -25,8 +36,9 @@ export default class AuthBuilder implements PromiseLike<string> {
25
36
  setLoginLanguage(loginLanguage: string): AuthBuilder;
26
37
  setCacheWebData(cacheWebData: boolean): AuthBuilder;
27
38
  setRequireClientCredentials(requireClientCredentials: boolean): AuthBuilder;
28
- setItem(key: keyof LoginParameters, value: any): AuthBuilder;
39
+ setItem(key: string, value: any): AuthBuilder;
29
40
  private execute;
30
- then<TResult1 = string, TResult2 = never>(onfulfilled?: ((value: string) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): PromiseLike<TResult1 | TResult2>;
41
+ then<TResult1 = any, TResult2 = never>(onfulfilled?: ((value: any) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): PromiseLike<TResult1 | TResult2>;
31
42
  }
43
+ export { LoginParameters };
32
44
  //# sourceMappingURL=AuthBuilder.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AuthBuilder.d.ts","sourceRoot":"","sources":["../../src/lib/AuthBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,EAAE,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAE9E,MAAM,CAAC,OAAO,OAAO,WAAY,YAAW,WAAW,CAAC,MAAM,CAAC;IAC3D,OAAO,CAAC,GAAG,CAAa;IACxB,OAAO,CAAC,MAAM,CAA4D;IAC1E,OAAO,CAAC,eAAe,CAAkB;gBAGrC,GAAG,EAAE,UAAU,EACf,MAAM,EAAE,OAAO,GAAG,yBAAyB,GAAG,mBAAmB;IAOrE,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW;IAKxC,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW;IAKxC,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW;IAK1C,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW;IAK1C,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW;IAKhC,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW;IAKtC,YAAY,CAAC,SAAS,EAAE,SAAS,GAAG,WAAW;IAK/C,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW;IAK1C,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW;IAKlC,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,WAAW;IAKlD,6BAA6B,CAAC,0BAA0B,EAAE,OAAO,GAAG,WAAW;IAK/E,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,WAAW;IAKlD,eAAe,CAAC,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,EAAE,KAAK,EAAE,GAAG,GAAG,WAAW;IAK5D,OAAO,CAAC,OAAO;IAaf,IAAI,CAAC,QAAQ,GAAG,MAAM,EAAE,QAAQ,GAAG,KAAK,EACpC,WAAW,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC,GAAG,SAAS,GAAG,IAAI,EACtF,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
+ {"version":3,"file":"AuthBuilder.d.ts","sourceRoot":"","sources":["../../src/lib/AuthBuilder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAE5E;;GAEG;AACH,oBAAY,SAAS;IACjB,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,GAAG,QAAQ;CACd;AAED;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,WAAY,YAAW,WAAW,CAAC,GAAG,CAAC;IACxD,OAAO,CAAC,MAAM,CAA4D;IAC1E,OAAO,CAAC,eAAe,CAAkB;gBAE7B,MAAM,EAAE,OAAO,GAAG,yBAAyB,GAAG,mBAAmB;IAK7E,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW;IAKxC,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW;IAKxC,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW;IAK1C,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW;IAK1C,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW;IAKhC,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW;IAKtC,YAAY,CAAC,SAAS,EAAE,SAAS,GAAG,WAAW;IAK/C,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW;IAK1C,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW;IAKlC,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,WAAW;IAKlD,6BAA6B,CAAC,0BAA0B,EAAE,OAAO,GAAG,WAAW;IAK/E,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,WAAW;IAKlD,eAAe,CAAC,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;AAGD,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -1,11 +1,26 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const UnviredSDK_1 = require("./../core/UnviredSDK");
3
+ exports.LoginParameters = exports.LoginType = void 0;
4
+ const unvired_ts_core_sdk_1 = require("@unvired/unvired-ts-core-sdk");
5
+ const utils_1 = require("@unvired/unvired-ts-core-sdk/helper/utils");
6
+ Object.defineProperty(exports, "LoginParameters", { enumerable: true, get: function () { return utils_1.LoginParameters; } });
7
+ /**
8
+ * LoginType enum for different authentication types
9
+ */
10
+ var LoginType;
11
+ (function (LoginType) {
12
+ LoginType["UNVIRED"] = "UNVIRED";
13
+ LoginType["LDAP"] = "LDAP";
14
+ LoginType["SSO"] = "SSO";
15
+ })(LoginType || (exports.LoginType = LoginType = {}));
16
+ /**
17
+ * AuthBuilder - Fluent API for building authentication requests
18
+ * Can be awaited directly without calling .execute()
19
+ */
4
20
  class AuthBuilder {
5
- constructor(sdk, method) {
6
- this.sdk = sdk;
21
+ constructor(method) {
7
22
  this.method = method;
8
- this.loginParameters = new UnviredSDK_1.LoginParameters();
23
+ this.loginParameters = new utils_1.LoginParameters();
9
24
  }
10
25
  setAppName(appName) {
11
26
  this.loginParameters.appName = appName;
@@ -96,13 +111,15 @@ class AuthBuilder {
96
111
  return this;
97
112
  }
98
113
  execute() {
114
+ // Get the singleton instance and call the appropriate authentication method
115
+ const authService = unvired_ts_core_sdk_1.AuthenticationService.instance;
99
116
  switch (this.method) {
100
117
  case 'login':
101
- return this.sdk.login(this.loginParameters);
118
+ return authService.login(this.loginParameters);
102
119
  case 'authenticateAndActivate':
103
- return this.sdk.authenticateAndActivate(this.loginParameters);
120
+ return authService.authenticateAndActivate(this.loginParameters);
104
121
  case 'authenticateLocal':
105
- return this.sdk.authenticateLocal(this.loginParameters);
122
+ return authService.authenticateLocal(this.loginParameters);
106
123
  default:
107
124
  return Promise.reject(new Error(`Unknown method: ${this.method}`));
108
125
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unvired/react-native-wrapper-sdk",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
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",
@@ -1,19 +1,13 @@
1
- import UnviredSDK from './core/UnviredSDK';
2
- import AuthBuilder from './lib/AuthBuilder';
3
-
4
- import PlatformInterface from '@unvired/unvired-ts-core-sdk/platform/PlatformManager';
5
-
1
+ import AuthBuilder from './lib/AuthBuilder';
2
+ import { AuthenticationService, PlatformManager } from '@unvired/unvired-ts-core-sdk';
6
3
 
4
+ /**
5
+ * React Native Wrapper for Unvired Core SDK
6
+ * Provides a clean, fluent API for React Native applications
7
+ */
7
8
  export class UnviredWrapper {
8
- private unviredSDK: UnviredSDK;
9
-
10
9
  constructor() {
11
- this.unviredSDK = new UnviredSDK();
12
- }
13
-
14
- private static get logger() {
15
- console.log('PlatformInterface from core SDK', PlatformInterface);
16
- return UnviredSDK.getPlatformManager().getPlatformAdapter();
10
+ // AuthenticationService is a singleton, accessed via static instance getter
17
11
  }
18
12
 
19
13
  /**
@@ -21,7 +15,7 @@ export class UnviredWrapper {
21
15
  * Can be awaited directly: await sdk.login().setAppName("my-app")
22
16
  */
23
17
  login(): AuthBuilder {
24
- return new AuthBuilder(this.unviredSDK, 'login');
18
+ return new AuthBuilder('login');
25
19
  }
26
20
 
27
21
  /**
@@ -29,7 +23,7 @@ export class UnviredWrapper {
29
23
  * Can be awaited directly: await sdk.authenticateAndActivate().setUsername("demo")
30
24
  */
31
25
  authenticateAndActivate(): AuthBuilder {
32
- return new AuthBuilder(this.unviredSDK, 'authenticateAndActivate');
26
+ return new AuthBuilder('authenticateAndActivate');
33
27
  }
34
28
 
35
29
  /**
@@ -37,52 +31,57 @@ export class UnviredWrapper {
37
31
  * Can be awaited directly: await sdk.authenticateLocal().setUsername("demo")
38
32
  */
39
33
  authenticateLocal(): AuthBuilder {
40
- return new AuthBuilder(this.unviredSDK, 'authenticateLocal');
34
+ return new AuthBuilder('authenticateLocal');
41
35
  }
42
36
 
43
- static logInfo(className: string, methodName: string, message: string) {
37
+ /**
38
+ * Logout method - Logs out the current user
39
+ */
40
+ async logout(): Promise<any> {
41
+ const authService = (AuthenticationService as any).instance;
42
+ return authService.logout();
43
+ }
44
44
 
45
- console.log('PlatformInterface from core SDK', PlatformInterface);
46
- this.logger.logInfo(className, methodName, message);
45
+ /**
46
+ * Clear all data
47
+ */
48
+ async clearData(): Promise<any> {
49
+ const authService = (AuthenticationService as any).instance;
50
+ return authService.clearData();
51
+ }
52
+
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);
47
56
  }
48
57
 
49
58
  static logError(className: string, methodName: string, message: string) {
50
- this.logger.logError(className, methodName, message);
59
+ return PlatformManager.getInstance().getPlatformAdapter().getLoggerAdapter().logError(className, methodName, message);
51
60
  }
52
61
 
53
62
  static logDebug(className: string, methodName: string, message: string) {
54
- this.logger.logDebug(className, methodName, message);
63
+ return PlatformManager.getInstance().getPlatformAdapter().getLoggerAdapter().logDebug(className, methodName, message);
55
64
  }
56
65
 
57
- static logWarning(className: string, methodName: string, message: string) {
58
- this.logger.logWarning(className, methodName, message);
59
- }
60
66
 
61
67
  static setLogLevel(level: string) {
62
- this.logger.setLogLevel(level);
68
+ return PlatformManager.getInstance().getPlatformAdapter().getLoggerAdapter().setLogLevel(level);
63
69
  }
64
70
 
65
71
  static async getLogFileURL(): Promise<string> {
66
- return this.logger.getLogFileURL();
72
+ return PlatformManager.getInstance().getPlatformAdapter().getLoggerAdapter().getLogFileURL();
67
73
  }
68
74
 
69
75
  static async getLogFileContent(): Promise<string> {
70
- return this.logger.getLogFileContent();
76
+ return PlatformManager.getInstance().getPlatformAdapter().getLoggerAdapter().getLogFileContent();
71
77
  }
72
78
 
73
79
  static async getBackupLogFileContent(): Promise<string> {
74
- return this.logger.getBackupLogFileContent();
80
+ return PlatformManager.getInstance().getPlatformAdapter().getLoggerAdapter().getBackupLogFileContent();
75
81
  }
76
82
 
77
83
  static async clearLogFile(): Promise<void> {
78
- return this.logger.clearLogFile();
79
- }
80
-
81
- /**
82
- * Logout method - Calls CoreWebSDK
83
- */
84
- async logout(): Promise<boolean> {
85
- return this.unviredSDK.logout();
84
+ return PlatformManager.getInstance().getPlatformAdapter().getLoggerAdapter().clearLogFile();
86
85
  }
87
86
  }
88
87
 
package/src/index.ts CHANGED
@@ -1,10 +1,5 @@
1
1
  // Export main SDK
2
2
  import UnviredWrapper from './UnviredWrapper';
3
-
4
- export { LoginParameters, LoginType } from './core/UnviredSDK';
5
-
6
3
  // Export the default SDK instance
7
4
  export default UnviredWrapper;
8
5
 
9
- import UMP from '@unvired/unvired-ts-core-sdk';
10
- export { UMP };
@@ -1,15 +1,24 @@
1
- import UnviredSDK, { LoginParameters, LoginType } from './../core/UnviredSDK';
1
+ import { AuthenticationService } from '@unvired/unvired-ts-core-sdk';
2
+ import { LoginParameters } from '@unvired/unvired-ts-core-sdk/helper/utils';
3
+
4
+ /**
5
+ * LoginType enum for different authentication types
6
+ */
7
+ export enum LoginType {
8
+ UNVIRED = 'UNVIRED',
9
+ LDAP = 'LDAP',
10
+ SSO = 'SSO'
11
+ }
2
12
 
3
- export default class AuthBuilder implements PromiseLike<string> {
4
- private sdk: UnviredSDK;
13
+ /**
14
+ * AuthBuilder - Fluent API for building authentication requests
15
+ * Can be awaited directly without calling .execute()
16
+ */
17
+ export default class AuthBuilder implements PromiseLike<any> {
5
18
  private method: 'login' | 'authenticateAndActivate' | 'authenticateLocal';
6
19
  private loginParameters: LoginParameters;
7
20
 
8
- constructor(
9
- sdk: UnviredSDK,
10
- method: 'login' | 'authenticateAndActivate' | 'authenticateLocal'
11
- ) {
12
- this.sdk = sdk;
21
+ constructor(method: 'login' | 'authenticateAndActivate' | 'authenticateLocal') {
13
22
  this.method = method;
14
23
  this.loginParameters = new LoginParameters();
15
24
  }
@@ -45,7 +54,7 @@ export default class AuthBuilder implements PromiseLike<string> {
45
54
  }
46
55
 
47
56
  setLoginType(loginType: LoginType): AuthBuilder {
48
- this.loginParameters.loginType = loginType;
57
+ this.loginParameters.loginType = loginType as any;
49
58
  return this;
50
59
  }
51
60
 
@@ -60,87 +69,93 @@ export default class AuthBuilder implements PromiseLike<string> {
60
69
  }
61
70
 
62
71
  setMetadataPath(metadataPath: string): AuthBuilder {
63
- this.loginParameters.metadataPath = metadataPath;
72
+ (this.loginParameters as any).metadataPath = metadataPath;
64
73
  return this;
65
74
  }
66
75
 
67
76
  setIsRequiredAttachmentBase64(isRequiredAttachmentBase64: boolean): AuthBuilder {
68
- this.loginParameters.isRequiredAttachmentBase64 = isRequiredAttachmentBase64;
77
+ (this.loginParameters as any).isRequiredAttachmentBase64 = isRequiredAttachmentBase64;
69
78
  return this;
70
79
  }
71
80
 
72
81
  setAutoSendTime(autoSendTime: string): AuthBuilder {
73
- this.loginParameters.autoSendTime = autoSendTime;
82
+ (this.loginParameters as any).autoSendTime = autoSendTime;
74
83
  return this;
75
84
  }
76
85
 
77
86
  setAutoSyncTime(autoSyncTime: string): AuthBuilder {
78
- this.loginParameters.autoSyncTime = autoSyncTime;
87
+ (this.loginParameters as any).autoSyncTime = autoSyncTime;
79
88
  return this;
80
89
  }
81
90
 
82
91
  setMetadataJSON(metadataJSON: string): AuthBuilder {
83
- this.loginParameters.metadataJSON = metadataJSON;
92
+ (this.loginParameters as any).metadataJSON = metadataJSON;
84
93
  return this;
85
94
  }
86
95
 
87
96
  setDemoData(demoData: string): AuthBuilder {
88
- this.loginParameters.demoData = demoData;
97
+ (this.loginParameters as any).demoData = demoData;
89
98
  return this;
90
99
  }
91
100
 
92
101
  setDemoModeRequired(demoModeRequired: boolean): AuthBuilder {
93
- this.loginParameters.demoModeRequired = demoModeRequired;
102
+ (this.loginParameters as any).demoModeRequired = demoModeRequired;
94
103
  return this;
95
104
  }
96
105
 
97
106
  setPersistWebDb(persistWebDb: boolean): AuthBuilder {
98
- this.loginParameters.persistWebDb = persistWebDb;
107
+ (this.loginParameters as any).persistWebDb = persistWebDb;
99
108
  return this;
100
109
  }
101
110
 
102
111
  setJwtOptions(jwtOptions: object): AuthBuilder {
103
- this.loginParameters.jwtOptions = jwtOptions;
112
+ (this.loginParameters as any).jwtOptions = jwtOptions;
104
113
  return this;
105
114
  }
106
115
 
107
116
  setLoginLanguage(loginLanguage: string): AuthBuilder {
108
- this.loginParameters.loginLanguage = loginLanguage;
117
+ (this.loginParameters as any).loginLanguage = loginLanguage;
109
118
  return this;
110
119
  }
111
120
 
112
121
  setCacheWebData(cacheWebData: boolean): AuthBuilder {
113
- this.loginParameters.cacheWebData = cacheWebData;
122
+ (this.loginParameters as any).cacheWebData = cacheWebData;
114
123
  return this;
115
124
  }
116
125
 
117
126
  setRequireClientCredentials(requireClientCredentials: boolean): AuthBuilder {
118
- this.loginParameters.requireClientCredentials = requireClientCredentials;
127
+ (this.loginParameters as any).requireClientCredentials = requireClientCredentials;
119
128
  return this;
120
129
  }
121
130
 
122
- setItem(key: keyof LoginParameters, value: any): AuthBuilder {
131
+ setItem(key: string, value: any): AuthBuilder {
123
132
  (this.loginParameters as any)[key] = value;
124
133
  return this;
125
134
  }
126
135
 
127
- private execute(): Promise<string> {
136
+ private execute(): Promise<any> {
137
+ // Get the singleton instance and call the appropriate authentication method
138
+ const authService = (AuthenticationService as any).instance;
139
+
128
140
  switch (this.method) {
129
141
  case 'login':
130
- return this.sdk.login(this.loginParameters);
142
+ return authService.login(this.loginParameters);
131
143
  case 'authenticateAndActivate':
132
- return this.sdk.authenticateAndActivate(this.loginParameters);
144
+ return authService.authenticateAndActivate(this.loginParameters);
133
145
  case 'authenticateLocal':
134
- return this.sdk.authenticateLocal(this.loginParameters);
146
+ return authService.authenticateLocal(this.loginParameters);
135
147
  default:
136
148
  return Promise.reject(new Error(`Unknown method: ${this.method}`));
137
149
  }
138
150
  }
139
151
 
140
- then<TResult1 = string, TResult2 = never>(
141
- onfulfilled?: ((value: string) => TResult1 | PromiseLike<TResult1>) | undefined | null,
152
+ then<TResult1 = any, TResult2 = never>(
153
+ onfulfilled?: ((value: any) => TResult1 | PromiseLike<TResult1>) | undefined | null,
142
154
  onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null
143
155
  ): PromiseLike<TResult1 | TResult2> {
144
156
  return this.execute().then(onfulfilled, onrejected);
145
157
  }
146
158
  }
159
+
160
+ // Re-export LoginParameters for convenience
161
+ export { LoginParameters };
@@ -1,107 +0,0 @@
1
- import { PlatformManager } from './platform/PlatformManager';
2
- export declare enum LoginType {
3
- unvired = "UNVIRED_ID"
4
- }
5
- export declare class LoginParameters {
6
- /**
7
- * Set the application name as configured in UMP.
8
- */
9
- appName: string;
10
- /**
11
- * Company name as configured in UMP.
12
- */
13
- company: string;
14
- /**
15
- * Username of the user trying to login.
16
- */
17
- username: string;
18
- /**
19
- * Password of the user trying to login.
20
- */
21
- password: string;
22
- /**
23
- * UMP URL. For example: https://umpdev.unvired.io/UMP
24
- */
25
- url: string;
26
- /**
27
- * Domain name. Required only if the login type is ADS or SAP.
28
- */
29
- domain: string;
30
- /**
31
- * Set this value to one of the allowed login types for your app as configured in UMP.
32
- */
33
- loginType: LoginType;
34
- /**
35
- * FrontEndUserId: This id uniquely identifies the user across devices of same type. If the Unvired user has multiple front end ids for a device type, you need to set this value.
36
- * If the Unvired user has only one front end id, leave this field blank.
37
- */
38
- feUserId: string;
39
- /**
40
- * Required only if the loginType is 'sap'. This sets the SAP Port Name.
41
- */
42
- port: string;
43
- /**
44
- * Required for Browser Platform.
45
- * For iOS Platform include the metadata.xml file as part of App Bundle
46
- * For Android Platform include the metadata.xml file in src > res > raw
47
- */
48
- metadataPath: string;
49
- /**
50
- * This is required for Android only. Setting this value would save the attachments as Base64 string for easy access.
51
- */
52
- isRequiredAttachmentBase64: boolean;
53
- /**
54
- * Set an interval in seconds at which the framework has to make an attempt to send data from outbox.
55
- * If the data-sender fails for reason, then the framework does not restart even if there are outbox items.
56
- * In those cases, you will have to set this value, so that the framework always makes an attempt to send from outbox.
57
- * Example:
58
- * loginParameters.autoSendTime = '5' // Make an attempt to send data every 5 seconds.
59
- */
60
- autoSendTime: string;
61
- /**
62
- * Set the number of seconds at which GetMessage should automatically run. When this value is set, GetMessage would run in a interval as long as there are entries in Sent Items.
63
- * You may need to set this value if your app doesn't support Push Notifications.
64
- * By default, the framework does not do GetMessage automatically.
65
- * Example:
66
- * loginParameters.autoSyncTime = '5' // Make an attempt to receive data (GetMessage) every 5 seconds.
67
- */
68
- autoSyncTime: string;
69
- /**
70
- * Specify the metadata as a JSON string. This will override metadata.xml set at platform level.
71
- */
72
- metadataJSON: string;
73
- /**
74
- * Specify the demo data xml string for demo mode.
75
- */
76
- demoData: string;
77
- /**
78
- * Set 'true' if the application supports demo mode otherwise set 'false'.
79
- */
80
- demoModeRequired: boolean;
81
- persistWebDb: boolean;
82
- jwtOptions: object;
83
- /**
84
- * Language code to be sent to UMP. Specify a two-letter language code.
85
- * The default value of this is 'en'.
86
- */
87
- loginLanguage: string;
88
- /**
89
- * Applicable for browser only. Set this flag to indicate that saved data should be reloaded upon launch.
90
- */
91
- cacheWebData: boolean;
92
- /**
93
- * Set this value if you the login process requires client credentials to be set.
94
- * You can pass the client credentials with the method: |unviredSDK.setClientCredentials(credentials)|
95
- * The passed credentials will be used based on this flag.
96
- */
97
- requireClientCredentials: boolean;
98
- }
99
- declare class UnviredSDK {
100
- static getPlatformManager(): PlatformManager;
101
- login(_loginParameters: LoginParameters): Promise<string>;
102
- logout(): Promise<boolean>;
103
- authenticateLocal(_loginParameters: LoginParameters): Promise<string>;
104
- authenticateAndActivate(_loginParameters: LoginParameters): Promise<string>;
105
- }
106
- export default UnviredSDK;
107
- //# sourceMappingURL=UnviredSDK.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"UnviredSDK.d.ts","sourceRoot":"","sources":["../../src/core/UnviredSDK.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D,MAAM,CAAC,OAAO,MAAM,SAAS;IAC3B,OAAO,eAAe;CACvB;AACD,MAAM,CAAC,OAAO,OAAO,eAAe;IAClC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,SAAS,EAAE,SAAS,CAAC;IACrB;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,0BAA0B,EAAE,OAAO,CAAC;IACpC;;;;;;OAMG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;;;;;OAMG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,gBAAgB,EAAE,OAAO,CAAC;IAC1B,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,YAAY,EAAE,OAAO,CAAC;IACtB;;;;OAIG;IACH,wBAAwB,EAAE,OAAO,CAAC;CACnC;AAED,cAAM,UAAU;IACd,MAAM,CAAC,kBAAkB,IAAI,eAAe;IAItC,KAAK,CAAC,gBAAgB,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC;IAKzD,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC;IAI1B,iBAAiB,CAAC,gBAAgB,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC;IAKrE,uBAAuB,CAAC,gBAAgB,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC;CAIlF;AAED,eAAe,UAAU,CAAC"}
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const PlatformManager_1 = require("./platform/PlatformManager");
4
- class UnviredSDK {
5
- static getPlatformManager() {
6
- return PlatformManager_1.PlatformManager.getInstance();
7
- }
8
- async login(_loginParameters) {
9
- // Returns one of: auth_activation_required, app_requires_login, login_success, app_requires_current_account, login_demo
10
- return 'auth_activation_required';
11
- }
12
- async logout() {
13
- return true;
14
- }
15
- async authenticateLocal(_loginParameters) {
16
- // Returns one of: login_success, login_error
17
- return 'login_success';
18
- }
19
- async authenticateAndActivate(_loginParameters) {
20
- // Returns one of: auth_activation_success, auth_activation_error
21
- return 'auth_activation_success';
22
- }
23
- }
24
- exports.default = UnviredSDK;
@@ -1,13 +0,0 @@
1
- import { PlatformInterface } from './PlatformInterface';
2
- export declare class CordovaPlatformAdapter implements PlatformInterface {
3
- logInfo(className: string, methodName: string, message: string): void;
4
- logError(className: string, methodName: string, message: string): void;
5
- logDebug(className: string, methodName: string, message: string): void;
6
- logWarning(className: string, methodName: string, message: string): void;
7
- setLogLevel(level: string): void;
8
- getLogFileURL(): Promise<string>;
9
- getLogFileContent(): Promise<string>;
10
- getBackupLogFileContent(): Promise<string>;
11
- clearLogFile(): Promise<void>;
12
- }
13
- //# sourceMappingURL=CordovaPlatformAdapter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CordovaPlatformAdapter.d.ts","sourceRoot":"","sources":["../../../src/core/platform/CordovaPlatformAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAIxD,qBAAa,sBAAuB,YAAW,iBAAiB;IAG5D,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAIrE,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAItE,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAItE,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAIxE,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAI1B,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC;IAWhC,iBAAiB,IAAI,OAAO,CAAC,MAAM,CAAC;IAUpC,uBAAuB,IAAI,OAAO,CAAC,MAAM,CAAC;IAU1C,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;CAUtC"}
@@ -1,62 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CordovaPlatformAdapter = void 0;
4
- class CordovaPlatformAdapter {
5
- // Logger
6
- logInfo(className, methodName, message) {
7
- Logger.logInfo(className, methodName, message);
8
- }
9
- logError(className, methodName, message) {
10
- Logger.logError(className, methodName, message);
11
- }
12
- logDebug(className, methodName, message) {
13
- Logger.logDebug(className, methodName, message);
14
- }
15
- logWarning(className, methodName, message) {
16
- Logger.logWarning(className, methodName, message);
17
- }
18
- setLogLevel(level) {
19
- Logger.setLogLevel(level);
20
- }
21
- async getLogFileURL() {
22
- return new Promise((resolve, reject) => {
23
- try {
24
- const url = Logger.getLogFileURL();
25
- resolve(url);
26
- }
27
- catch (e) {
28
- reject(e);
29
- }
30
- });
31
- }
32
- async getLogFileContent() {
33
- return new Promise((resolve, reject) => {
34
- Logger.getLogFileContent((content) => {
35
- resolve(content);
36
- }, (error) => {
37
- reject(error);
38
- });
39
- });
40
- }
41
- async getBackupLogFileContent() {
42
- return new Promise((resolve, reject) => {
43
- Logger.getBackupLogFileContent((content) => {
44
- resolve(content);
45
- }, (error) => {
46
- reject(error);
47
- });
48
- });
49
- }
50
- async clearLogFile() {
51
- return new Promise((resolve, reject) => {
52
- try {
53
- Logger.clearLogFile();
54
- resolve();
55
- }
56
- catch (e) {
57
- reject(e);
58
- }
59
- });
60
- }
61
- }
62
- exports.CordovaPlatformAdapter = CordovaPlatformAdapter;
@@ -1,12 +0,0 @@
1
- export interface PlatformInterface {
2
- logInfo(className: string, methodName: string, message: string): void;
3
- logError(className: string, methodName: string, message: string): void;
4
- logDebug(className: string, methodName: string, message: string): void;
5
- logWarning(className: string, methodName: string, message: string): void;
6
- setLogLevel(level: string): void;
7
- getLogFileURL(): Promise<string>;
8
- getLogFileContent(): Promise<string>;
9
- getBackupLogFileContent(): Promise<string>;
10
- clearLogFile(): Promise<void>;
11
- }
12
- //# sourceMappingURL=PlatformInterface.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PlatformInterface.d.ts","sourceRoot":"","sources":["../../../src/core/platform/PlatformInterface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAE9B,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACtE,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvE,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvE,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACzE,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IACjC,iBAAiB,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IACrC,uBAAuB,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAC3C,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACjC"}
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,10 +0,0 @@
1
- import { PlatformInterface } from './PlatformInterface';
2
- export declare class PlatformManager {
3
- private static instance;
4
- private platformAdapter;
5
- private constructor();
6
- static getInstance(): PlatformManager;
7
- getPlatformAdapter(): PlatformInterface;
8
- setPlatformAdapter(adapter: PlatformInterface): void;
9
- }
10
- //# sourceMappingURL=PlatformManager.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PlatformManager.d.ts","sourceRoot":"","sources":["../../../src/core/platform/PlatformManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD,qBAAa,eAAe;IACxB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAkB;IACzC,OAAO,CAAC,eAAe,CAAoB;IAE3C,OAAO;WAMO,WAAW,IAAI,eAAe;IAOrC,kBAAkB,IAAI,iBAAiB;IAIvC,kBAAkB,CAAC,OAAO,EAAE,iBAAiB;CAGvD"}
@@ -1,29 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PlatformManager = void 0;
4
- const ReactNativePlatformAdapter_1 = require("./ReactNativePlatformAdapter");
5
- class PlatformManager {
6
- constructor() {
7
- // Default to Cordova for now, or detect environment
8
- // In a real scenario, we might inject this or detect based on environment variables
9
- this.platformAdapter = new ReactNativePlatformAdapter_1.ReactNativePlatformAdapter();
10
- }
11
- static getInstance() {
12
- if (!PlatformManager.instance) {
13
- PlatformManager.instance = new PlatformManager();
14
- }
15
- return PlatformManager.instance;
16
- }
17
- getPlatformAdapter() {
18
- return this.platformAdapter;
19
- }
20
- setPlatformAdapter(adapter) {
21
- this.platformAdapter = adapter;
22
- }
23
- }
24
- exports.PlatformManager = PlatformManager;
25
- // Usage:
26
- // import { PlatformManager } from './platform/PlatformManager';
27
- // import { ReactNativePlatformAdapter } from './platform/ReactNativePlatformAdapter';
28
- // // Initialize with React Native adapter
29
- // PlatformManager.getInstance().setPlatformAdapter(new ReactNativePlatformAdapter());
@@ -1,13 +0,0 @@
1
- import { PlatformInterface } from './PlatformInterface';
2
- export declare class ReactNativePlatformAdapter implements PlatformInterface {
3
- logInfo(className: string, methodName: string, message: string): void;
4
- logError(className: string, methodName: string, message: string): void;
5
- logDebug(className: string, methodName: string, message: string): void;
6
- logWarning(className: string, methodName: string, message: string): void;
7
- setLogLevel(level: string): void;
8
- getLogFileURL(): Promise<string>;
9
- getLogFileContent(): Promise<string>;
10
- getBackupLogFileContent(): Promise<string>;
11
- clearLogFile(): Promise<void>;
12
- }
13
- //# sourceMappingURL=ReactNativePlatformAdapter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ReactNativePlatformAdapter.d.ts","sourceRoot":"","sources":["../../../src/core/platform/ReactNativePlatformAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD,qBAAa,0BAA2B,YAAW,iBAAiB;IAElE,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAMrE,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAMtE,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAMtE,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAYxE,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAM1B,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC;IAIhC,iBAAiB,IAAI,OAAO,CAAC,MAAM,CAAC;IAIpC,uBAAuB,IAAI,OAAO,CAAC,MAAM,CAAC;IAI1C,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;CAGpC"}
@@ -1,47 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ReactNativePlatformAdapter = void 0;
4
- const react_native_unvired_sdk_1 = require("@unvired/react-native-unvired-sdk");
5
- class ReactNativePlatformAdapter {
6
- // Logger
7
- logInfo(className, methodName, message) {
8
- react_native_unvired_sdk_1.logger.logInfo(className, methodName, message);
9
- console.log(`[INFO] ${className}.${methodName}: ${message}`);
10
- }
11
- logError(className, methodName, message) {
12
- react_native_unvired_sdk_1.logger.logError(className, methodName, message);
13
- console.error(`[ERROR] ${className}.${methodName}: ${message}`);
14
- }
15
- logDebug(className, methodName, message) {
16
- react_native_unvired_sdk_1.logger.logDebug(className, methodName, message);
17
- console.debug(`[DEBUG] ${className}.${methodName}: ${message}`);
18
- }
19
- logWarning(className, methodName, message) {
20
- // TODO: Update to logger.logWarning once available in react-native-wrapper-sdk
21
- // Using logInfo as fallback for now
22
- if (typeof react_native_unvired_sdk_1.logger.logWarning === 'function') {
23
- react_native_unvired_sdk_1.logger.logWarning(className, methodName, message);
24
- }
25
- else {
26
- react_native_unvired_sdk_1.logger.logInfo(className, methodName, `[WARNING] ${message}`);
27
- }
28
- console.warn(`[WARNING] ${className}.${methodName}: ${message}`);
29
- }
30
- setLogLevel(level) {
31
- react_native_unvired_sdk_1.logger.setLogLevel(level.toUpperCase());
32
- console.log(`[setLogLevel] ${level}`);
33
- }
34
- async getLogFileURL() {
35
- return await react_native_unvired_sdk_1.logger.getLogFileURL();
36
- }
37
- async getLogFileContent() {
38
- return await react_native_unvired_sdk_1.logger.getLogFileContent();
39
- }
40
- async getBackupLogFileContent() {
41
- return await react_native_unvired_sdk_1.logger.getBackupLogFileContent();
42
- }
43
- async clearLogFile() {
44
- await react_native_unvired_sdk_1.logger.clearLogFile();
45
- }
46
- }
47
- exports.ReactNativePlatformAdapter = ReactNativePlatformAdapter;
@@ -1,126 +0,0 @@
1
- import { PlatformManager } from './platform/PlatformManager';
2
-
3
- export declare enum LoginType {
4
- unvired = 'UNVIRED_ID',
5
- }
6
- export declare class LoginParameters {
7
- /**
8
- * Set the application name as configured in UMP.
9
- */
10
- appName: string;
11
- /**
12
- * Company name as configured in UMP.
13
- */
14
- company: string;
15
- /**
16
- * Username of the user trying to login.
17
- */
18
- username: string;
19
- /**
20
- * Password of the user trying to login.
21
- */
22
- password: string;
23
- /**
24
- * UMP URL. For example: https://umpdev.unvired.io/UMP
25
- */
26
- url: string;
27
- /**
28
- * Domain name. Required only if the login type is ADS or SAP.
29
- */
30
- domain: string;
31
- /**
32
- * Set this value to one of the allowed login types for your app as configured in UMP.
33
- */
34
- loginType: LoginType;
35
- /**
36
- * FrontEndUserId: This id uniquely identifies the user across devices of same type. If the Unvired user has multiple front end ids for a device type, you need to set this value.
37
- * If the Unvired user has only one front end id, leave this field blank.
38
- */
39
- feUserId: string;
40
- /**
41
- * Required only if the loginType is 'sap'. This sets the SAP Port Name.
42
- */
43
- port: string;
44
- /**
45
- * Required for Browser Platform.
46
- * For iOS Platform include the metadata.xml file as part of App Bundle
47
- * For Android Platform include the metadata.xml file in src > res > raw
48
- */
49
- metadataPath: string;
50
- /**
51
- * This is required for Android only. Setting this value would save the attachments as Base64 string for easy access.
52
- */
53
- isRequiredAttachmentBase64: boolean;
54
- /**
55
- * Set an interval in seconds at which the framework has to make an attempt to send data from outbox.
56
- * If the data-sender fails for reason, then the framework does not restart even if there are outbox items.
57
- * In those cases, you will have to set this value, so that the framework always makes an attempt to send from outbox.
58
- * Example:
59
- * loginParameters.autoSendTime = '5' // Make an attempt to send data every 5 seconds.
60
- */
61
- autoSendTime: string;
62
- /**
63
- * Set the number of seconds at which GetMessage should automatically run. When this value is set, GetMessage would run in a interval as long as there are entries in Sent Items.
64
- * You may need to set this value if your app doesn't support Push Notifications.
65
- * By default, the framework does not do GetMessage automatically.
66
- * Example:
67
- * loginParameters.autoSyncTime = '5' // Make an attempt to receive data (GetMessage) every 5 seconds.
68
- */
69
- autoSyncTime: string;
70
- /**
71
- * Specify the metadata as a JSON string. This will override metadata.xml set at platform level.
72
- */
73
- metadataJSON: string;
74
- /**
75
- * Specify the demo data xml string for demo mode.
76
- */
77
- demoData: string;
78
- /**
79
- * Set 'true' if the application supports demo mode otherwise set 'false'.
80
- */
81
- demoModeRequired: boolean;
82
- persistWebDb: boolean;
83
- jwtOptions: object;
84
- /**
85
- * Language code to be sent to UMP. Specify a two-letter language code.
86
- * The default value of this is 'en'.
87
- */
88
- loginLanguage: string;
89
- /**
90
- * Applicable for browser only. Set this flag to indicate that saved data should be reloaded upon launch.
91
- */
92
- cacheWebData: boolean;
93
- /**
94
- * Set this value if you the login process requires client credentials to be set.
95
- * You can pass the client credentials with the method: |unviredSDK.setClientCredentials(credentials)|
96
- * The passed credentials will be used based on this flag.
97
- */
98
- requireClientCredentials: boolean;
99
- }
100
-
101
- class UnviredSDK {
102
- static getPlatformManager(): PlatformManager {
103
- return PlatformManager.getInstance();
104
- }
105
-
106
- async login(_loginParameters: LoginParameters): Promise<string> {
107
- // Returns one of: auth_activation_required, app_requires_login, login_success, app_requires_current_account, login_demo
108
- return 'auth_activation_required';
109
- }
110
-
111
- async logout(): Promise<boolean> {
112
- return true;
113
- }
114
-
115
- async authenticateLocal(_loginParameters: LoginParameters): Promise<string> {
116
- // Returns one of: login_success, login_error
117
- return 'login_success';
118
- }
119
-
120
- async authenticateAndActivate(_loginParameters: LoginParameters): Promise<string> {
121
- // Returns one of: auth_activation_success, auth_activation_error
122
- return 'auth_activation_success';
123
- }
124
- }
125
-
126
- export default UnviredSDK;
@@ -1,69 +0,0 @@
1
- import { PlatformInterface } from './PlatformInterface';
2
-
3
- declare var Logger: any;
4
-
5
- export class CordovaPlatformAdapter implements PlatformInterface {
6
-
7
- // Logger
8
- logInfo(className: string, methodName: string, message: string): void {
9
- Logger.logInfo(className, methodName, message);
10
- }
11
-
12
- logError(className: string, methodName: string, message: string): void {
13
- Logger.logError(className, methodName, message);
14
- }
15
-
16
- logDebug(className: string, methodName: string, message: string): void {
17
- Logger.logDebug(className, methodName, message);
18
- }
19
-
20
- logWarning(className: string, methodName: string, message: string): void {
21
- Logger.logWarning(className, methodName, message);
22
- }
23
-
24
- setLogLevel(level: string): void {
25
- Logger.setLogLevel(level);
26
- }
27
-
28
- async getLogFileURL(): Promise<string> {
29
- return new Promise((resolve, reject) => {
30
- try {
31
- const url = Logger.getLogFileURL();
32
- resolve(url);
33
- } catch (e) {
34
- reject(e);
35
- }
36
- });
37
- }
38
-
39
- async getLogFileContent(): Promise<string> {
40
- return new Promise((resolve, reject) => {
41
- Logger.getLogFileContent((content: string) => {
42
- resolve(content);
43
- }, (error: any) => {
44
- reject(error);
45
- });
46
- });
47
- }
48
-
49
- async getBackupLogFileContent(): Promise<string> {
50
- return new Promise((resolve, reject) => {
51
- Logger.getBackupLogFileContent((content: string) => {
52
- resolve(content);
53
- }, (error: any) => {
54
- reject(error);
55
- });
56
- });
57
- }
58
-
59
- async clearLogFile(): Promise<void> {
60
- return new Promise((resolve, reject) => {
61
- try {
62
- Logger.clearLogFile();
63
- resolve();
64
- } catch (e) {
65
- reject(e);
66
- }
67
- });
68
- }
69
- }
@@ -1,12 +0,0 @@
1
- export interface PlatformInterface {
2
- // Logger
3
- logInfo(className: string, methodName: string, message: string): void;
4
- logError(className: string, methodName: string, message: string): void;
5
- logDebug(className: string, methodName: string, message: string): void;
6
- logWarning(className: string, methodName: string, message: string): void;
7
- setLogLevel(level: string): void;
8
- getLogFileURL(): Promise<string>;
9
- getLogFileContent(): Promise<string>;
10
- getBackupLogFileContent(): Promise<string>;
11
- clearLogFile(): Promise<void>;
12
- }
@@ -1,35 +0,0 @@
1
- import { PlatformInterface } from './PlatformInterface';
2
- import { ReactNativePlatformAdapter } from './ReactNativePlatformAdapter';
3
-
4
- export class PlatformManager {
5
- private static instance: PlatformManager;
6
- private platformAdapter: PlatformInterface;
7
-
8
- private constructor() {
9
- // Default to Cordova for now, or detect environment
10
- // In a real scenario, we might inject this or detect based on environment variables
11
- this.platformAdapter = new ReactNativePlatformAdapter();
12
- }
13
-
14
- public static getInstance(): PlatformManager {
15
- if (!PlatformManager.instance) {
16
- PlatformManager.instance = new PlatformManager();
17
- }
18
- return PlatformManager.instance;
19
- }
20
-
21
- public getPlatformAdapter(): PlatformInterface {
22
- return this.platformAdapter;
23
- }
24
-
25
- public setPlatformAdapter(adapter: PlatformInterface) {
26
- this.platformAdapter = adapter;
27
- }
28
- }
29
-
30
- // Usage:
31
- // import { PlatformManager } from './platform/PlatformManager';
32
- // import { ReactNativePlatformAdapter } from './platform/ReactNativePlatformAdapter';
33
-
34
- // // Initialize with React Native adapter
35
- // PlatformManager.getInstance().setPlatformAdapter(new ReactNativePlatformAdapter());
@@ -1,57 +0,0 @@
1
- import { PlatformInterface } from './PlatformInterface';
2
- import { logger, LogLevel } from '@unvired/react-native-unvired-sdk';
3
-
4
- export class ReactNativePlatformAdapter implements PlatformInterface {
5
- // Logger
6
- logInfo(className: string, methodName: string, message: string): void {
7
- logger.logInfo(className, methodName, message);
8
-
9
- console.log(`[INFO] ${className}.${methodName}: ${message}`);
10
- }
11
-
12
- logError(className: string, methodName: string, message: string): void {
13
- logger.logError(className, methodName, message);
14
-
15
- console.error(`[ERROR] ${className}.${methodName}: ${message}`);
16
- }
17
-
18
- logDebug(className: string, methodName: string, message: string): void {
19
- logger.logDebug(className, methodName, message);
20
-
21
- console.debug(`[DEBUG] ${className}.${methodName}: ${message}`);
22
- }
23
-
24
- logWarning(className: string, methodName: string, message: string): void {
25
- // TODO: Update to logger.logWarning once available in react-native-wrapper-sdk
26
- // Using logInfo as fallback for now
27
- if (typeof (logger as any).logWarning === 'function') {
28
- (logger as any).logWarning(className, methodName, message);
29
- } else {
30
- logger.logInfo(className, methodName, `[WARNING] ${message}`);
31
- }
32
-
33
- console.warn(`[WARNING] ${className}.${methodName}: ${message}`);
34
- }
35
-
36
- setLogLevel(level: string): void {
37
- logger.setLogLevel(level.toUpperCase() as LogLevel);
38
-
39
- console.log(`[setLogLevel] ${level}`);
40
- }
41
-
42
- async getLogFileURL(): Promise<string> {
43
- return await logger.getLogFileURL();
44
- }
45
-
46
- async getLogFileContent(): Promise<string> {
47
- return await logger.getLogFileContent();
48
- }
49
-
50
- async getBackupLogFileContent(): Promise<string> {
51
- return await logger.getBackupLogFileContent();
52
- }
53
-
54
- async clearLogFile(): Promise<void> {
55
- await logger.clearLogFile();
56
- }
57
- }