@longvansoftware/service-js-client 2.2.9 → 2.3.0

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.
@@ -17,3 +17,4 @@ export declare const VALIDATE_OTP: DocumentNode;
17
17
  export declare const CREATE_USER_LOGIN: DocumentNode;
18
18
  export declare const CREATE_USER_DETAIL_WITHOUT_USER_LOGIN: DocumentNode;
19
19
  export declare const CREATE_PARTY_DETAIL: (fields?: string[]) => DocumentNode;
20
+ export declare const LOGOUT: DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CREATE_PARTY_DETAIL = exports.CREATE_USER_DETAIL_WITHOUT_USER_LOGIN = exports.CREATE_USER_LOGIN = exports.VALIDATE_OTP = exports.SEND_OTP = exports.LINKING_USER_LOGIN_AND_USER_DETAIL = exports.CREATE_USER_DETAIL = exports.UPDATE_PROFILE = 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;
3
+ exports.LOGOUT = exports.CREATE_PARTY_DETAIL = exports.CREATE_USER_DETAIL_WITHOUT_USER_LOGIN = exports.CREATE_USER_LOGIN = exports.VALIDATE_OTP = exports.SEND_OTP = exports.LINKING_USER_LOGIN_AND_USER_DETAIL = exports.CREATE_USER_DETAIL = exports.UPDATE_PROFILE = 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!) {
@@ -250,3 +250,14 @@ const CREATE_PARTY_DETAIL = (fields = []) => {
250
250
  `;
251
251
  };
252
252
  exports.CREATE_PARTY_DETAIL = CREATE_PARTY_DETAIL;
253
+ exports.LOGOUT = (0, graphql_tag_1.gql) `
254
+ mutation logout(
255
+ $accessToken: String!
256
+ $partyId: String!
257
+ ) {
258
+ logout(
259
+ accessToken: $accessToken
260
+ partyId: $partyId
261
+ )
262
+ }
263
+ `;
@@ -48,4 +48,5 @@ export declare class AuthService extends Service {
48
48
  createPartyDetail(name: string, phone: string, createdBy: string, source: string, fields: string[]): Promise<any>;
49
49
  getOrganizationsByPartyIdDynamic(partyId: string, fields: string[]): Promise<any>;
50
50
  checkEnabled2FA(partyId: string, fields: string[]): Promise<any>;
51
+ logout(accessToken: string, partyId: string): Promise<any>;
51
52
  }
@@ -460,5 +460,22 @@ class AuthService extends serviceSDK_1.Service {
460
460
  }
461
461
  });
462
462
  }
463
+ logout(accessToken, partyId) {
464
+ return __awaiter(this, void 0, void 0, function* () {
465
+ const mutation = mutations_1.LOGOUT;
466
+ const variables = {
467
+ accessToken,
468
+ partyId,
469
+ };
470
+ try {
471
+ const response = yield this.graphqlMutation(mutation, variables);
472
+ return response.logout;
473
+ }
474
+ catch (error) {
475
+ console.log(`Error in logout: ${error}`);
476
+ throw error;
477
+ }
478
+ });
479
+ }
463
480
  }
464
481
  exports.AuthService = AuthService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/service-js-client",
3
- "version": "2.2.9",
3
+ "version": "2.3.0",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [