@unvired/react-native-wrapper-sdk 0.0.25 → 0.0.26

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.
@@ -1,7 +1,10 @@
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.LoginType = exports.LoginParameters = void 0;
4
- const unvired_ts_core_sdk_1 = require("@unvired/unvired-ts-core-sdk");
7
+ const authenticationService_1 = __importDefault(require("@unvired/unvired-ts-core-sdk/authenticationService"));
5
8
  /**
6
9
  * LoginParameters class - Local definition to avoid module resolution issues
7
10
  */
@@ -115,8 +118,8 @@ class AuthBuilder {
115
118
  return this;
116
119
  }
117
120
  execute() {
118
- // Get the singleton instance and call the appropriate authentication method
119
- const authService = unvired_ts_core_sdk_1.AuthenticationService.instance;
121
+ // Use the imported singleton instance directly
122
+ const authService = authenticationService_1.default;
120
123
  switch (this.method) {
121
124
  case 'login':
122
125
  return authService.login(this.loginParameters);
@@ -1 +1 @@
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
+ {"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;IAI5B;;OAEG;IACG,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC;CAGlC"}
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.AuthService = void 0;
7
7
  const AuthBuilder_1 = __importDefault(require("./AuthBuilder"));
8
- const unvired_ts_core_sdk_1 = require("@unvired/unvired-ts-core-sdk");
8
+ const authenticationService_1 = __importDefault(require("@unvired/unvired-ts-core-sdk/authenticationService"));
9
9
  /**
10
10
  * Service for handling Authentication operations
11
11
  */
@@ -32,15 +32,13 @@ class AuthService {
32
32
  * Logout method - Logs out the current user
33
33
  */
34
34
  async logout() {
35
- const authService = unvired_ts_core_sdk_1.AuthenticationService.instance;
36
- return authService.logout();
35
+ return authenticationService_1.default.logout();
37
36
  }
38
37
  /**
39
38
  * Clear all data
40
39
  */
41
40
  async clearData() {
42
- const authService = unvired_ts_core_sdk_1.AuthenticationService.instance;
43
- return authService.clearData();
41
+ return authenticationService_1.default.clearData();
44
42
  }
45
43
  }
46
44
  exports.AuthService = AuthService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unvired/react-native-wrapper-sdk",
3
- "version": "0.0.25",
3
+ "version": "0.0.26",
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,4 +1,4 @@
1
- import { AuthenticationService } from '@unvired/unvired-ts-core-sdk';
1
+ import AuthenticationServiceInstance from '@unvired/unvired-ts-core-sdk/authenticationService';
2
2
 
3
3
  /**
4
4
  * LoginParameters class - Local definition to avoid module resolution issues
@@ -160,16 +160,16 @@ export default class AuthBuilder implements PromiseLike<any> {
160
160
  }
161
161
 
162
162
  private execute(): Promise<any> {
163
- // Get the singleton instance and call the appropriate authentication method
164
- const authService = (AuthenticationService as any).instance;
163
+ // Use the imported singleton instance directly
164
+ const authService = AuthenticationServiceInstance;
165
165
 
166
166
  switch (this.method) {
167
167
  case 'login':
168
- return authService.login(this.loginParameters);
168
+ return authService.login(this.loginParameters as any);
169
169
  case 'authenticateAndActivate':
170
- return authService.authenticateAndActivate(this.loginParameters);
170
+ return authService.authenticateAndActivate(this.loginParameters as any);
171
171
  case 'authenticateLocal':
172
- return authService.authenticateLocal(this.loginParameters);
172
+ return authService.authenticateLocal(this.loginParameters as any);
173
173
  default:
174
174
  return Promise.reject(new Error(`Unknown method: ${this.method}`));
175
175
  }
@@ -1,5 +1,5 @@
1
1
  import AuthBuilder from './AuthBuilder';
2
- import { AuthenticationService } from '@unvired/unvired-ts-core-sdk';
2
+ import AuthenticationServiceInstance from '@unvired/unvired-ts-core-sdk/authenticationService';
3
3
 
4
4
  /**
5
5
  * Service for handling Authentication operations
@@ -31,15 +31,13 @@ export class AuthService {
31
31
  * Logout method - Logs out the current user
32
32
  */
33
33
  async logout(): Promise<any> {
34
- const authService = (AuthenticationService as any).instance;
35
- return authService.logout();
34
+ return AuthenticationServiceInstance.logout();
36
35
  }
37
36
 
38
37
  /**
39
38
  * Clear all data
40
39
  */
41
40
  async clearData(): Promise<any> {
42
- const authService = (AuthenticationService as any).instance;
43
- return authService.clearData();
41
+ return AuthenticationServiceInstance.clearData();
44
42
  }
45
43
  }