@longvansoftware/storefront-js-client 1.2.5 → 1.2.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.
@@ -0,0 +1 @@
1
+ export declare const GET_USER_DETAIL: import("graphql").DocumentNode;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GET_USER_DETAIL = void 0;
4
+ const graphql_tag_1 = require("graphql-tag");
5
+ exports.GET_USER_DETAIL = (0, graphql_tag_1.gql) `
6
+ query GetUserDetail($orgId: String!, $accessToken: String!) {
7
+ getUserDetail(orgId: $orgId, accessToken: $accessToken) {
8
+ partyId
9
+ orgId
10
+ fullName
11
+ email
12
+ phone
13
+ address
14
+ identityNumber
15
+ gender
16
+ birthDate
17
+ avatarUrl
18
+ accessToken
19
+ username
20
+ orgPermissionsMap
21
+ orgPositionsMap
22
+ orgRolesMap
23
+ }
24
+ }
25
+ `;
@@ -23,4 +23,5 @@ export declare class AuthService extends Service {
23
23
  * @returns A promise that resolves when the registration is successful.
24
24
  */
25
25
  register(registerRequest: RegisterRequest): Promise<void>;
26
+ getUserDetail(accessToken: string): Promise<any>;
26
27
  }
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.AuthService = void 0;
13
13
  const service_1 = require("../service");
14
14
  const mutations_1 = require("../../graphql/auth/mutations");
15
+ const queries_1 = require("../../graphql/auth/queries");
15
16
  /**
16
17
  * Represents the authentication service.
17
18
  */
@@ -50,5 +51,22 @@ class AuthService extends service_1.Service {
50
51
  yield this.graphqlMutation(mutations_1.REGISTER_MUTATION, variables);
51
52
  });
52
53
  }
54
+ getUserDetail(accessToken) {
55
+ return __awaiter(this, void 0, void 0, function* () {
56
+ const query = queries_1.GET_USER_DETAIL;
57
+ const variables = {
58
+ orgId: this.orgId,
59
+ accessToken,
60
+ };
61
+ try {
62
+ const response = yield this.graphqlQuery(query, variables);
63
+ return response.getUserDetail;
64
+ }
65
+ catch (error) {
66
+ console.log(`Error in getUserDetail: ${error}`);
67
+ throw error;
68
+ }
69
+ });
70
+ }
53
71
  }
54
72
  exports.AuthService = AuthService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/storefront-js-client",
3
- "version": "1.2.5",
3
+ "version": "1.2.6",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [