@longvansoftware/storefront-js-client 2.2.7-beta.1 → 2.2.7-beta.2
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.
|
@@ -120,26 +120,6 @@ exports.LINKING_USER_LOGIN_AND_USER_DETAIL_MUTATION = (0, graphql_tag_1.gql) `
|
|
|
120
120
|
linkingUserLoginAndUserDetail(userLoginId: $userLoginId, partyId: $partyId)
|
|
121
121
|
}
|
|
122
122
|
`;
|
|
123
|
-
// mutation CreateUserDetail {
|
|
124
|
-
// createUserDetail(userLoginId: "2312312312", partnerId: "FOX") {
|
|
125
|
-
// partyId
|
|
126
|
-
// orgId
|
|
127
|
-
// fullName
|
|
128
|
-
// email
|
|
129
|
-
// phone
|
|
130
|
-
// address
|
|
131
|
-
// identityNumber
|
|
132
|
-
// gender
|
|
133
|
-
// birthDate
|
|
134
|
-
// avatarUrl
|
|
135
|
-
// accessToken
|
|
136
|
-
// username
|
|
137
|
-
// readyV2
|
|
138
|
-
// orgPermissionsMap
|
|
139
|
-
// orgPositionsMap
|
|
140
|
-
// orgRolesMap
|
|
141
|
-
// }
|
|
142
|
-
// }
|
|
143
123
|
exports.CREATE_USER_DETAIL_MUTATION = (0, graphql_tag_1.gql) `
|
|
144
124
|
mutation CreateUserDetail($userLoginId: String!, $partnerId: String!) {
|
|
145
125
|
createUserDetail(userLoginId: $userLoginId, partnerId: $partnerId) {
|
|
@@ -37,4 +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
|
+
sendSmsVerifyCode(username: string): Promise<any>;
|
|
41
|
+
verifyCode(username: string, code: string): Promise<any>;
|
|
42
|
+
resetPassword(username: string, newPassword: string, accessToken: string): Promise<any>;
|
|
40
43
|
}
|
|
@@ -38,7 +38,6 @@ class AuthService extends serviceSDK_1.Service {
|
|
|
38
38
|
loginRequest: Object.assign({ orgId: this.orgId }, loginRequest),
|
|
39
39
|
};
|
|
40
40
|
const data = yield this.graphqlMutation(mutations_1.LOGIN_MUTATION, variables);
|
|
41
|
-
console.log("🚀 ~ AuthService ~ login ~ data:", data);
|
|
42
41
|
return data.login;
|
|
43
42
|
});
|
|
44
43
|
}
|
|
@@ -175,5 +174,80 @@ class AuthService extends serviceSDK_1.Service {
|
|
|
175
174
|
}
|
|
176
175
|
});
|
|
177
176
|
}
|
|
177
|
+
// mutation VerifyCode {
|
|
178
|
+
// sendSmsVerifyCode(orgId: "FYP", username: "0971879660") {
|
|
179
|
+
// id
|
|
180
|
+
// code
|
|
181
|
+
// username
|
|
182
|
+
// timeExpired
|
|
183
|
+
// }
|
|
184
|
+
// }
|
|
185
|
+
sendSmsVerifyCode(username) {
|
|
186
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
187
|
+
const query = mutations_1.SEND_SMS_VERIFY_CODE_MUTATION;
|
|
188
|
+
const variables = {
|
|
189
|
+
orgId: this.orgId,
|
|
190
|
+
username,
|
|
191
|
+
};
|
|
192
|
+
try {
|
|
193
|
+
const response = yield this.graphqlMutation(query, variables);
|
|
194
|
+
return response.sendSmsVerifyCode;
|
|
195
|
+
}
|
|
196
|
+
catch (error) {
|
|
197
|
+
console.log(`Error in sendSmsVerifyCode: ${error}`);
|
|
198
|
+
throw error;
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
// mutation VerifyCode {
|
|
203
|
+
// verifyCode(
|
|
204
|
+
// orgId: "FYP"
|
|
205
|
+
// verifyCodeRequest: { username: "0971879660", code: "999999" }
|
|
206
|
+
// )
|
|
207
|
+
// }
|
|
208
|
+
verifyCode(username, code) {
|
|
209
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
210
|
+
const query = mutations_1.VERIFY_CODE_MUTATION;
|
|
211
|
+
const variables = {
|
|
212
|
+
orgId: this.orgId,
|
|
213
|
+
verifyCodeRequest: { username, code },
|
|
214
|
+
};
|
|
215
|
+
try {
|
|
216
|
+
const response = yield this.graphqlMutation(query, variables);
|
|
217
|
+
return response.verifyCode;
|
|
218
|
+
}
|
|
219
|
+
catch (error) {
|
|
220
|
+
console.log(`Error in verifyCode: ${error}`);
|
|
221
|
+
throw error;
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
// mutation ResetPassword {
|
|
226
|
+
// resetPassword(
|
|
227
|
+
// orgId: "FYP"
|
|
228
|
+
// username: "0971879660"
|
|
229
|
+
// newPassword: "123123"
|
|
230
|
+
// accessToken: "882812312"
|
|
231
|
+
// )
|
|
232
|
+
// }
|
|
233
|
+
resetPassword(username, newPassword, accessToken) {
|
|
234
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
235
|
+
const query = mutations_1.RESET_PASSWORD_MUTATION;
|
|
236
|
+
const variables = {
|
|
237
|
+
orgId: this.orgId,
|
|
238
|
+
username,
|
|
239
|
+
newPassword,
|
|
240
|
+
accessToken,
|
|
241
|
+
};
|
|
242
|
+
try {
|
|
243
|
+
const response = yield this.graphqlMutation(query, variables);
|
|
244
|
+
return response.resetPassword;
|
|
245
|
+
}
|
|
246
|
+
catch (error) {
|
|
247
|
+
console.log(`Error in resetPassword: ${error}`);
|
|
248
|
+
throw error;
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
}
|
|
178
252
|
}
|
|
179
253
|
exports.AuthService = AuthService;
|