@longvansoftware/service-js-client 1.5.5 → 1.5.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.
@@ -6,3 +6,5 @@ export declare const RESET_PASSWORD_MUTATION: import("graphql").DocumentNode;
|
|
6
6
|
export declare const UPDATE_INFO_MUTATION: import("graphql").DocumentNode;
|
7
7
|
export declare const UPDATE_PASSWORD_MUTATION: import("graphql").DocumentNode;
|
8
8
|
export declare const LOGIN_v2: import("graphql").DocumentNode;
|
9
|
+
export declare const CREATE_RESET_KEY: import("graphql").DocumentNode;
|
10
|
+
export declare const CHECK_RESET_KEY: import("graphql").DocumentNode;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.LOGIN_v2 = 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.CHECK_RESET_KEY = exports.CREATE_RESET_KEY = exports.LOGIN_v2 = 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!) {
|
@@ -129,3 +129,17 @@ exports.LOGIN_v2 = (0, graphql_tag_1.gql) `
|
|
129
129
|
}
|
130
130
|
}
|
131
131
|
`;
|
132
|
+
exports.CREATE_RESET_KEY = (0, graphql_tag_1.gql) `
|
133
|
+
mutation CreateResetKey($userLoginId: String!) {
|
134
|
+
createResetKey(userLoginId: $userLoginId)
|
135
|
+
}
|
136
|
+
`;
|
137
|
+
exports.CHECK_RESET_KEY = (0, graphql_tag_1.gql) `
|
138
|
+
mutation CheckResetKey($resetKey: String!) {
|
139
|
+
checkResetKey(resetKey: $resetKey) {
|
140
|
+
userLoginId
|
141
|
+
isVerified
|
142
|
+
accessToken
|
143
|
+
}
|
144
|
+
}
|
145
|
+
`;
|
@@ -27,4 +27,6 @@ export declare class AuthService extends Service {
|
|
27
27
|
register(registerRequest: RegisterRequest): Promise<void>;
|
28
28
|
getUserDetail(accessToken: string): Promise<any>;
|
29
29
|
loginV2(loginRequest: LoginRequest): Promise<LoginResponse>;
|
30
|
+
createResetKey(userLoginId: string): Promise<any>;
|
31
|
+
checkResetKey(resetKey: string): Promise<any>;
|
30
32
|
}
|
@@ -90,5 +90,37 @@ class AuthService extends serviceSDK_1.Service {
|
|
90
90
|
}
|
91
91
|
});
|
92
92
|
}
|
93
|
+
createResetKey(userLoginId) {
|
94
|
+
return __awaiter(this, void 0, void 0, function* () {
|
95
|
+
const query = mutations_1.CREATE_RESET_KEY;
|
96
|
+
const variables = {
|
97
|
+
userLoginId,
|
98
|
+
};
|
99
|
+
try {
|
100
|
+
const response = yield this.graphqlMutation(query, variables);
|
101
|
+
return response.createResetKey;
|
102
|
+
}
|
103
|
+
catch (error) {
|
104
|
+
console.log(`Error in createResetKey: ${error}`);
|
105
|
+
throw error;
|
106
|
+
}
|
107
|
+
});
|
108
|
+
}
|
109
|
+
checkResetKey(resetKey) {
|
110
|
+
return __awaiter(this, void 0, void 0, function* () {
|
111
|
+
const query = mutations_1.CHECK_RESET_KEY;
|
112
|
+
const variables = {
|
113
|
+
resetKey,
|
114
|
+
};
|
115
|
+
try {
|
116
|
+
const response = yield this.graphqlMutation(query, variables);
|
117
|
+
return response.checkResetKey;
|
118
|
+
}
|
119
|
+
catch (error) {
|
120
|
+
console.log(`Error in checkResetKey: ${error}`);
|
121
|
+
throw error;
|
122
|
+
}
|
123
|
+
});
|
124
|
+
}
|
93
125
|
}
|
94
126
|
exports.AuthService = AuthService;
|