@longvansoftware/storefront-js-client 4.0.0 → 4.0.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.
|
@@ -19,3 +19,4 @@ export declare const VALIDATE_OTP_MUTATION: import("graphql").DocumentNode;
|
|
|
19
19
|
export declare const CREATE_RESET_KEY: import("graphql").DocumentNode;
|
|
20
20
|
export declare const CHECK_RESET_KEY: import("graphql").DocumentNode;
|
|
21
21
|
export declare const RESET_PASSWORD: import("graphql").DocumentNode;
|
|
22
|
+
export declare const LOGOUT: 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_V3 = 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;
|
|
3
|
+
exports.LOGOUT = 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_V3 = 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!) {
|
|
@@ -328,3 +328,8 @@ exports.RESET_PASSWORD = (0, graphql_tag_1.gql) `
|
|
|
328
328
|
)
|
|
329
329
|
}
|
|
330
330
|
`;
|
|
331
|
+
exports.LOGOUT = (0, graphql_tag_1.gql) `
|
|
332
|
+
mutation Logout($accessToken: String!, $partyId: String!) {
|
|
333
|
+
logout(accessToken: $accessToken, partyId: $partyId)
|
|
334
|
+
}
|
|
335
|
+
`;
|
|
@@ -143,4 +143,5 @@ export declare class AuthService extends Service {
|
|
|
143
143
|
getOrganizationsByPartyId(partyId: String): Promise<any>;
|
|
144
144
|
getMenus(partyId: string, workspaceId: string, scope: string): Promise<any>;
|
|
145
145
|
getWorkspaces(partyId: string, scope: string): Promise<any>;
|
|
146
|
+
logout(token: string): Promise<any>;
|
|
146
147
|
}
|
|
@@ -682,5 +682,21 @@ class AuthService extends serviceSDK_1.Service {
|
|
|
682
682
|
}
|
|
683
683
|
});
|
|
684
684
|
}
|
|
685
|
+
logout(token) {
|
|
686
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
687
|
+
const mutation = mutations_1.LOGOUT;
|
|
688
|
+
const variables = {
|
|
689
|
+
accessToken: token,
|
|
690
|
+
partyId: this.orgId,
|
|
691
|
+
};
|
|
692
|
+
try {
|
|
693
|
+
const response = yield this.graphqlMutation(mutation, variables);
|
|
694
|
+
return response.logout;
|
|
695
|
+
}
|
|
696
|
+
catch (error) {
|
|
697
|
+
throw error;
|
|
698
|
+
}
|
|
699
|
+
});
|
|
700
|
+
}
|
|
685
701
|
}
|
|
686
702
|
exports.AuthService = AuthService;
|