@longvansoftware/storefront-js-client 4.3.0 → 4.3.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.
@@ -11,3 +11,4 @@ export declare const GET_ORGANIZATIONS_BY_PARTY_ID: import("graphql").DocumentNo
11
11
  export declare const GET_MENUS: import("graphql").DocumentNode;
12
12
  export declare const GET_WORK_SPACES: import("graphql").DocumentNode;
13
13
  export declare const GET_ORGANIZATION_BY_ID: import("graphql").DocumentNode;
14
+ export declare const SHOW_LOGIN_SOCIAL: import("graphql").DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GET_ORGANIZATION_BY_ID = 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;
3
+ exports.SHOW_LOGIN_SOCIAL = exports.GET_ORGANIZATION_BY_ID = 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!) {
@@ -220,3 +220,8 @@ exports.GET_ORGANIZATION_BY_ID = (0, graphql_tag_1.gql) `
220
220
  }
221
221
  }
222
222
  `;
223
+ exports.SHOW_LOGIN_SOCIAL = (0, graphql_tag_1.gql) `
224
+ query ShowLoginSocial($orgId: String, $serviceOperator: String) {
225
+ showLoginSocial(orgId: $orgId, serviceOperator: $serviceOperator)
226
+ }
227
+ `;
@@ -93,6 +93,7 @@ exports.CREATE_CUSTOMER_V2 = (0, graphql_tag_1.gql) `
93
93
  $birthDate: DateCustom
94
94
  $tenantId: String!
95
95
  $createdBy: String
96
+ $source: String
96
97
  ) {
97
98
  createCustomerV2(
98
99
  name: $name
@@ -101,6 +102,7 @@ exports.CREATE_CUSTOMER_V2 = (0, graphql_tag_1.gql) `
101
102
  birthDate: $birthDate
102
103
  tenantId: $tenantId
103
104
  createdBy: $createdBy
105
+ source: $source
104
106
  ) {
105
107
  id
106
108
  name
@@ -145,4 +145,5 @@ export declare class AuthService extends Service {
145
145
  getWorkspaces(partyId: string, scope: string): Promise<any>;
146
146
  logout(token: string): Promise<any>;
147
147
  getOrganizationById(orgId: string): Promise<any>;
148
+ showLoginSocial(data: any): Promise<any>;
148
149
  }
@@ -716,5 +716,17 @@ class AuthService extends serviceSDK_1.Service {
716
716
  }
717
717
  });
718
718
  }
719
+ showLoginSocial(data) {
720
+ return __awaiter(this, void 0, void 0, function* () {
721
+ const queries = queries_1.SHOW_LOGIN_SOCIAL;
722
+ try {
723
+ const response = yield this.graphqlMutation(queries, data);
724
+ return response.showLoginSocial;
725
+ }
726
+ catch (error) {
727
+ throw error;
728
+ }
729
+ });
730
+ }
719
731
  }
720
732
  exports.AuthService = AuthService;
@@ -550,4 +550,6 @@ export declare class OrderService extends Service {
550
550
  district_code: string;
551
551
  ward_code: string;
552
552
  }): Promise<any>;
553
+ addEmployeeToStore(employeeId: string): Promise<any>;
554
+ deleteEmployeeToStore(employeeId: string): Promise<any>;
553
555
  }
@@ -1726,5 +1726,31 @@ class OrderService extends serviceSDK_1.Service {
1726
1726
  }
1727
1727
  });
1728
1728
  }
1729
+ addEmployeeToStore(employeeId) {
1730
+ return __awaiter(this, void 0, void 0, function* () {
1731
+ const endpoint = `/store-channels/${this.orgId}/${this.storeId}/employee/${employeeId}`;
1732
+ const method = "PUT";
1733
+ try {
1734
+ const response = yield this.restApiCallWithToken(endpoint, method);
1735
+ return response;
1736
+ }
1737
+ catch (error) {
1738
+ throw error;
1739
+ }
1740
+ });
1741
+ }
1742
+ deleteEmployeeToStore(employeeId) {
1743
+ return __awaiter(this, void 0, void 0, function* () {
1744
+ const endpoint = `/store-channels/${this.orgId}/${this.storeId}/employee/${employeeId}`;
1745
+ const method = "DELETE";
1746
+ try {
1747
+ const response = yield this.restApiCallWithToken(endpoint, method);
1748
+ return response;
1749
+ }
1750
+ catch (error) {
1751
+ throw error;
1752
+ }
1753
+ });
1754
+ }
1729
1755
  }
1730
1756
  exports.OrderService = OrderService;
@@ -1,5 +1,5 @@
1
1
  import { Service } from "../serviceSDK";
2
- import { createCompanyRequest, createCustomerRequest, dataCustomerRequest, updateCustomerRequest, customerQuery, searchCustomersResponse, employeesQuery } from "../../types/user";
2
+ import { createCompanyRequest, dataCustomerRequest, updateCustomerRequest, customerQuery, searchCustomersResponse, employeesQuery } from "../../types/user";
3
3
  export declare class UserService extends Service {
4
4
  constructor(endpoint: string, orgId: string, storeId: string);
5
5
  getPersonByPartyIds(partyIds: string[]): Promise<any>;
@@ -8,7 +8,7 @@ export declare class UserService extends Service {
8
8
  updateCustomer(id: string, customerItem: updateCustomerRequest, updatedBy: string): Promise<any>;
9
9
  getCustomerById(id: string): Promise<any>;
10
10
  searchCompany(keyword: string, limit: number): Promise<any>;
11
- createCustomerV2(createCustomerRequest: createCustomerRequest, createdBy: string): Promise<any>;
11
+ createCustomerV2(createCustomerRequest: any, createdBy: string): Promise<any>;
12
12
  createCustomer(dataCustomerRequest: dataCustomerRequest, createdBy: string, type: string): Promise<any>;
13
13
  searchCustomer(searchParams: customerQuery): Promise<searchCustomersResponse>;
14
14
  searchEmployees(searchParams: employeesQuery): Promise<any>;
@@ -131,6 +131,7 @@ class UserService extends serviceSDK_1.Service {
131
131
  phone: (createCustomerRequest === null || createCustomerRequest === void 0 ? void 0 : createCustomerRequest.phone) || "",
132
132
  email: (createCustomerRequest === null || createCustomerRequest === void 0 ? void 0 : createCustomerRequest.email) || "",
133
133
  birthDate: (createCustomerRequest === null || createCustomerRequest === void 0 ? void 0 : createCustomerRequest.birthDate) || null,
134
+ source: (createCustomerRequest === null || createCustomerRequest === void 0 ? void 0 : createCustomerRequest.source) || "",
134
135
  tenantId: this.orgId,
135
136
  createdBy: createdBy,
136
137
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/storefront-js-client",
3
- "version": "4.3.0",
3
+ "version": "4.3.2",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [