@longvansoftware/storefront-js-client 1.2.5 → 1.2.7
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
|
+
`;
|
|
@@ -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;
|
|
@@ -25,7 +25,7 @@ class PaymentService extends service_1.Service {
|
|
|
25
25
|
};
|
|
26
26
|
try {
|
|
27
27
|
const response = yield this.graphqlQuery(query, variables);
|
|
28
|
-
return response.
|
|
28
|
+
return response.getPaymentMethod;
|
|
29
29
|
}
|
|
30
30
|
catch (error) {
|
|
31
31
|
console.log(`Error fetching get payment method: ${error}`);
|