@longvansoftware/storefront-js-client 3.6.6 → 3.6.8
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.
- package/dist/src/graphql/auth/mutations.d.ts +1 -0
- package/dist/src/graphql/auth/mutations.js +28 -2
- package/dist/src/graphql/auth/queries.d.ts +1 -0
- package/dist/src/graphql/auth/queries.js +22 -1
- package/dist/src/lib/auth/index.d.ts +2 -0
- package/dist/src/lib/auth/index.js +34 -0
- package/package.json +1 -1
|
@@ -9,6 +9,7 @@ export declare const CREATE_PASSWORD_MUTATION: import("graphql").DocumentNode;
|
|
|
9
9
|
export declare const UPDATE_PROFILE_MUTATION: import("graphql").DocumentNode;
|
|
10
10
|
export declare const LINKING_USER_LOGIN_AND_USER_DETAIL_MUTATION: import("graphql").DocumentNode;
|
|
11
11
|
export declare const CREATE_USER_DETAIL_MUTATION: import("graphql").DocumentNode;
|
|
12
|
+
export declare const CREATE_USER_DETAIL_MUTATION_V2: import("graphql").DocumentNode;
|
|
12
13
|
export declare const CREATE_ORG_MUTATION: import("graphql").DocumentNode;
|
|
13
14
|
export declare const ADD_ROLE_USER_MUTATION: import("graphql").DocumentNode;
|
|
14
15
|
export declare const CREATE_USER_LOGIN_MUTATION: import("graphql").DocumentNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RESET_PASSWORD = exports.CHECK_RESET_KEY = exports.CREATE_RESET_KEY = exports.VALIDATE_OTP_MUTATION = exports.SEND_OTP_MUTATION = exports.CREATE_USER_LOGIN_MUTATION = exports.ADD_ROLE_USER_MUTATION = exports.CREATE_ORG_MUTATION = exports.CREATE_USER_DETAIL_MUTATION = exports.LINKING_USER_LOGIN_AND_USER_DETAIL_MUTATION = exports.UPDATE_PROFILE_MUTATION = exports.CREATE_PASSWORD_MUTATION = exports.UPDATE_PASSWORD_MUTATION = exports.UPDATE_INFO_MUTATION = exports.RESET_PASSWORD_MUTATION = exports.VERIFY_CODE_MUTATION = exports.SEND_SMS_VERIFY_CODE_MUTATION = exports.REGISTER_MUTATION = exports.LOGIN_MUTATION = void 0;
|
|
3
|
+
exports.RESET_PASSWORD = exports.CHECK_RESET_KEY = exports.CREATE_RESET_KEY = exports.VALIDATE_OTP_MUTATION = exports.SEND_OTP_MUTATION = exports.CREATE_USER_LOGIN_MUTATION = exports.ADD_ROLE_USER_MUTATION = exports.CREATE_ORG_MUTATION = exports.CREATE_USER_DETAIL_MUTATION_V2 = exports.CREATE_USER_DETAIL_MUTATION = exports.LINKING_USER_LOGIN_AND_USER_DETAIL_MUTATION = exports.UPDATE_PROFILE_MUTATION = exports.CREATE_PASSWORD_MUTATION = exports.UPDATE_PASSWORD_MUTATION = exports.UPDATE_INFO_MUTATION = exports.RESET_PASSWORD_MUTATION = exports.VERIFY_CODE_MUTATION = exports.SEND_SMS_VERIFY_CODE_MUTATION = exports.REGISTER_MUTATION = exports.LOGIN_MUTATION = void 0;
|
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
|
5
5
|
exports.LOGIN_MUTATION = (0, graphql_tag_1.gql) `
|
|
6
6
|
mutation Login($loginRequest: LoginRequest!) {
|
|
@@ -161,6 +161,32 @@ exports.CREATE_USER_DETAIL_MUTATION = (0, graphql_tag_1.gql) `
|
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
`;
|
|
164
|
+
exports.CREATE_USER_DETAIL_MUTATION_V2 = (0, graphql_tag_1.gql) `
|
|
165
|
+
mutation CreateUserDetail(
|
|
166
|
+
$userLoginId: String!
|
|
167
|
+
$orgId: String!
|
|
168
|
+
$phone: String
|
|
169
|
+
) {
|
|
170
|
+
createUserDetail(userLoginId: $userLoginId, orgId: $orgId, phone: $phone) {
|
|
171
|
+
partyId
|
|
172
|
+
orgId
|
|
173
|
+
fullName
|
|
174
|
+
email
|
|
175
|
+
phone
|
|
176
|
+
address
|
|
177
|
+
identityNumber
|
|
178
|
+
gender
|
|
179
|
+
birthDate
|
|
180
|
+
avatarUrl
|
|
181
|
+
accessToken
|
|
182
|
+
username
|
|
183
|
+
readyV2
|
|
184
|
+
orgPermissionsMap
|
|
185
|
+
orgPositionsMap
|
|
186
|
+
orgRolesMap
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
`;
|
|
164
190
|
exports.CREATE_ORG_MUTATION = (0, graphql_tag_1.gql) `
|
|
165
191
|
mutation CreateOrg($orgName: String!) {
|
|
166
192
|
createOrg(orgName: $orgName) {
|
|
@@ -232,7 +258,7 @@ exports.VALIDATE_OTP_MUTATION = (0, graphql_tag_1.gql) `
|
|
|
232
258
|
`;
|
|
233
259
|
exports.CREATE_RESET_KEY = (0, graphql_tag_1.gql) `
|
|
234
260
|
mutation CreateResetKey($userLoginId: String!) {
|
|
235
|
-
createResetKey(userLoginId: $userLoginId)
|
|
261
|
+
createResetKey(userLoginId: $userLoginId)
|
|
236
262
|
}
|
|
237
263
|
`;
|
|
238
264
|
exports.CHECK_RESET_KEY = (0, graphql_tag_1.gql) `
|
|
@@ -9,3 +9,4 @@ export declare const CHECK_USER_LOGIN: import("graphql").DocumentNode;
|
|
|
9
9
|
export declare const GET_ACCESS_TOKEN_BY_OTP_QUERY: import("graphql").DocumentNode;
|
|
10
10
|
export declare const GET_ORGANIZATIONS_BY_PARTY_ID: import("graphql").DocumentNode;
|
|
11
11
|
export declare const GET_MENUS: import("graphql").DocumentNode;
|
|
12
|
+
export declare const GET_WORK_SPACES: import("graphql").DocumentNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GET_MENUS = exports.GET_ORGANIZATIONS_BY_PARTY_ID = exports.GET_ACCESS_TOKEN_BY_OTP_QUERY = exports.CHECK_USER_LOGIN = exports.LOGIN_ZALO = exports.LOGIN_FACEBOOK = exports.LOGIN_GOOGLE = exports.CHECK_USERNAME_EXISTED = exports.GET_USER_LOGIN_BY_USER_LOGIN_ID = exports.GET_USER_LOGIN_BY_TOKEN = exports.GET_USER_DETAIL = void 0;
|
|
3
|
+
exports.GET_WORK_SPACES = exports.GET_MENUS = exports.GET_ORGANIZATIONS_BY_PARTY_ID = exports.GET_ACCESS_TOKEN_BY_OTP_QUERY = exports.CHECK_USER_LOGIN = exports.LOGIN_ZALO = exports.LOGIN_FACEBOOK = exports.LOGIN_GOOGLE = exports.CHECK_USERNAME_EXISTED = exports.GET_USER_LOGIN_BY_USER_LOGIN_ID = exports.GET_USER_LOGIN_BY_TOKEN = exports.GET_USER_DETAIL = void 0;
|
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
|
5
5
|
exports.GET_USER_DETAIL = (0, graphql_tag_1.gql) `
|
|
6
6
|
query GetUserDetail($orgId: String!, $accessToken: String!) {
|
|
@@ -140,3 +140,24 @@ exports.GET_MENUS = (0, graphql_tag_1.gql) `
|
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
`;
|
|
143
|
+
exports.GET_WORK_SPACES = (0, graphql_tag_1.gql) `
|
|
144
|
+
query GetWorkspaces($partyId: String!, $orgId: String!, $scope: String) {
|
|
145
|
+
getWorkspaces(partyId: $partyId, orgId: $orgId, scope: $scope) {
|
|
146
|
+
id
|
|
147
|
+
name
|
|
148
|
+
icon
|
|
149
|
+
menus {
|
|
150
|
+
id
|
|
151
|
+
name
|
|
152
|
+
icon
|
|
153
|
+
url
|
|
154
|
+
childrenMenu {
|
|
155
|
+
id
|
|
156
|
+
name
|
|
157
|
+
icon
|
|
158
|
+
url
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
`;
|
|
@@ -37,6 +37,7 @@ export declare class AuthService extends Service {
|
|
|
37
37
|
checkUsernameExisted(username: string): Promise<any>;
|
|
38
38
|
linkingUserLoginAndUserDetail(userLoginId: string, partyId: string): Promise<any>;
|
|
39
39
|
createUserDetail(userLoginId: string): Promise<any>;
|
|
40
|
+
createUserDetailV2(userLoginId: string, phone: string): Promise<any>;
|
|
40
41
|
sendSmsVerifyCode(username: string): Promise<any>;
|
|
41
42
|
verifyCode(username: string, code: string): Promise<any>;
|
|
42
43
|
resetPassword(username: string, newPassword: string, accessToken: string): Promise<any>;
|
|
@@ -140,4 +141,5 @@ export declare class AuthService extends Service {
|
|
|
140
141
|
resetPasswordV2(orgId: string, username: string, newPassword: string, accessToken: string): Promise<any>;
|
|
141
142
|
getOrganizationsByPartyId(partyId: String): Promise<any>;
|
|
142
143
|
getMenus(partyId: string, workspaceId: string, scope: string): Promise<any>;
|
|
144
|
+
getWorkspaces(partyId: string, scope: string): Promise<any>;
|
|
143
145
|
}
|
|
@@ -174,6 +174,23 @@ class AuthService extends serviceSDK_1.Service {
|
|
|
174
174
|
}
|
|
175
175
|
});
|
|
176
176
|
}
|
|
177
|
+
createUserDetailV2(userLoginId, phone) {
|
|
178
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
179
|
+
const variables = {
|
|
180
|
+
userLoginId,
|
|
181
|
+
orgId: this.orgId,
|
|
182
|
+
phone,
|
|
183
|
+
};
|
|
184
|
+
try {
|
|
185
|
+
const response = yield this.graphqlMutation(mutations_1.CREATE_USER_DETAIL_MUTATION_V2, variables);
|
|
186
|
+
return response.createUserDetail;
|
|
187
|
+
}
|
|
188
|
+
catch (error) {
|
|
189
|
+
console.log(`Error in createUserDetail: ${error}`);
|
|
190
|
+
throw error;
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
}
|
|
177
194
|
// mutation VerifyCode {
|
|
178
195
|
// sendSmsVerifyCode(orgId: "FYP", username: "0971879660") {
|
|
179
196
|
// id
|
|
@@ -625,5 +642,22 @@ class AuthService extends serviceSDK_1.Service {
|
|
|
625
642
|
}
|
|
626
643
|
});
|
|
627
644
|
}
|
|
645
|
+
getWorkspaces(partyId, scope) {
|
|
646
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
647
|
+
const query = queries_1.GET_WORK_SPACES;
|
|
648
|
+
const variables = {
|
|
649
|
+
partyId: partyId,
|
|
650
|
+
orgId: this.orgId,
|
|
651
|
+
scope: scope,
|
|
652
|
+
};
|
|
653
|
+
try {
|
|
654
|
+
const response = yield this.graphqlQueryV4(query, variables);
|
|
655
|
+
return response.getWorkspaces;
|
|
656
|
+
}
|
|
657
|
+
catch (error) {
|
|
658
|
+
throw error;
|
|
659
|
+
}
|
|
660
|
+
});
|
|
661
|
+
}
|
|
628
662
|
}
|
|
629
663
|
exports.AuthService = AuthService;
|