@unvired/react-native-wrapper-sdk 0.0.26 → 0.0.27
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,10 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.LoginType = exports.LoginParameters = void 0;
|
|
7
|
-
const
|
|
4
|
+
const unvired_ts_core_sdk_1 = require("@unvired/unvired-ts-core-sdk");
|
|
8
5
|
/**
|
|
9
6
|
* LoginParameters class - Local definition to avoid module resolution issues
|
|
10
7
|
*/
|
|
@@ -118,8 +115,8 @@ class AuthBuilder {
|
|
|
118
115
|
return this;
|
|
119
116
|
}
|
|
120
117
|
execute() {
|
|
121
|
-
//
|
|
122
|
-
const authService =
|
|
118
|
+
// Access the singleton instance via the static getter with type assertion
|
|
119
|
+
const authService = unvired_ts_core_sdk_1.AuthenticationService.instance;
|
|
123
120
|
switch (this.method) {
|
|
124
121
|
case 'login':
|
|
125
122
|
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;
|
|
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"}
|
|
@@ -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
|
|
8
|
+
const unvired_ts_core_sdk_1 = require("@unvired/unvired-ts-core-sdk");
|
|
9
9
|
/**
|
|
10
10
|
* Service for handling Authentication operations
|
|
11
11
|
*/
|
|
@@ -28,17 +28,19 @@ class AuthService {
|
|
|
28
28
|
authenticateLocal() {
|
|
29
29
|
return new AuthBuilder_1.default('authenticateLocal');
|
|
30
30
|
}
|
|
31
|
-
/**
|
|
31
|
+
/**x`
|
|
32
32
|
* Logout method - Logs out the current user
|
|
33
33
|
*/
|
|
34
34
|
async logout() {
|
|
35
|
-
|
|
35
|
+
const authService = unvired_ts_core_sdk_1.AuthenticationService.instance;
|
|
36
|
+
return authService.logout();
|
|
36
37
|
}
|
|
37
38
|
/**
|
|
38
39
|
* Clear all data
|
|
39
40
|
*/
|
|
40
41
|
async clearData() {
|
|
41
|
-
|
|
42
|
+
const authService = unvired_ts_core_sdk_1.AuthenticationService.instance;
|
|
43
|
+
return authService.clearData();
|
|
42
44
|
}
|
|
43
45
|
}
|
|
44
46
|
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.
|
|
3
|
+
"version": "0.0.27",
|
|
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
|
|
1
|
+
import { AuthenticationService } from '@unvired/unvired-ts-core-sdk';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* LoginParameters class - Local definition to avoid module resolution issues
|
|
@@ -160,8 +160,8 @@ export default class AuthBuilder implements PromiseLike<any> {
|
|
|
160
160
|
}
|
|
161
161
|
|
|
162
162
|
private execute(): Promise<any> {
|
|
163
|
-
//
|
|
164
|
-
const authService =
|
|
163
|
+
// Access the singleton instance via the static getter with type assertion
|
|
164
|
+
const authService = (AuthenticationService as any).instance;
|
|
165
165
|
|
|
166
166
|
switch (this.method) {
|
|
167
167
|
case 'login':
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import AuthBuilder from './AuthBuilder';
|
|
2
|
-
import
|
|
2
|
+
import { AuthenticationService } from '@unvired/unvired-ts-core-sdk';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Service for handling Authentication operations
|
|
@@ -27,17 +27,19 @@ export class AuthService {
|
|
|
27
27
|
return new AuthBuilder('authenticateLocal');
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
/**
|
|
30
|
+
/**x`
|
|
31
31
|
* Logout method - Logs out the current user
|
|
32
32
|
*/
|
|
33
33
|
async logout(): Promise<any> {
|
|
34
|
-
|
|
34
|
+
const authService = (AuthenticationService as any).instance;
|
|
35
|
+
return authService.logout();
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
/**
|
|
38
39
|
* Clear all data
|
|
39
40
|
*/
|
|
40
41
|
async clearData(): Promise<any> {
|
|
41
|
-
|
|
42
|
+
const authService = (AuthenticationService as any).instance;
|
|
43
|
+
return authService.clearData();
|
|
42
44
|
}
|
|
43
45
|
}
|