@longvansoftware/storefront-js-client 3.8.9 → 3.9.1

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.
@@ -0,0 +1 @@
1
+ export declare const FIND_ORDER_BY_OWNER_PARTYID: import("graphql").DocumentNode;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FIND_ORDER_BY_OWNER_PARTYID = void 0;
4
+ const graphql_tag_1 = require("graphql-tag");
5
+ exports.FIND_ORDER_BY_OWNER_PARTYID = (0, graphql_tag_1.gql) `
6
+ query FindOrderByOwnerPartyId(
7
+ $partnerId: String!
8
+ $ownerPartyId: String!
9
+ ) {
10
+ findOrderByOwnerPartyId(partnerId: $partnerId, ownerPartyId: $ownerPartyId)
11
+ }
12
+ `;
@@ -538,4 +538,5 @@ export declare class OrderService extends Service {
538
538
  removeGiftInOrder(orderId: string, orderItemId: string): Promise<any>;
539
539
  tooglePaymentMethod(methodCode: string, status: boolean): Promise<any>;
540
540
  choosePaymentGatewayForPaymentMethod(methodCode: string, gatewayId: string): Promise<any>;
541
+ addCustomerToOder(orderId: string, customerData: any): Promise<any>;
541
542
  }
@@ -1695,5 +1695,19 @@ class OrderService extends serviceSDK_1.Service {
1695
1695
  }
1696
1696
  });
1697
1697
  }
1698
+ addCustomerToOder(orderId, customerData) {
1699
+ return __awaiter(this, void 0, void 0, function* () {
1700
+ const endpoint = `/front/orders/${this.orgId}/${orderId}/customerInfo`;
1701
+ const method = "PUT";
1702
+ const requestData = Object.assign({}, customerData);
1703
+ try {
1704
+ const response = yield this.restApiCallWithNoToken(endpoint, method, requestData);
1705
+ return response;
1706
+ }
1707
+ catch (error) {
1708
+ throw error;
1709
+ }
1710
+ });
1711
+ }
1698
1712
  }
1699
1713
  exports.OrderService = OrderService;
@@ -11,7 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.OrderCloudService = void 0;
13
13
  const serviceSDK_1 = require("../serviceSDK");
14
- const mutations_1 = require("../../graphql/orderCloud/mutations");
14
+ const queries_1 = require("../../graphql/orderCloud/queries");
15
15
  class OrderCloudService extends serviceSDK_1.Service {
16
16
  constructor(endpoint, orgId, storeId) {
17
17
  super(endpoint, orgId, storeId);
@@ -19,13 +19,13 @@ class OrderCloudService extends serviceSDK_1.Service {
19
19
  //
20
20
  findOrderByOwnerPartyId(ownerPartyId) {
21
21
  return __awaiter(this, void 0, void 0, function* () {
22
- const mutation = mutations_1.FIND_ORDER_BY_OWNER_PARTYID;
22
+ const query = queries_1.FIND_ORDER_BY_OWNER_PARTYID;
23
23
  const variables = {
24
24
  partnerId: this.orgId,
25
25
  ownerPartyId,
26
26
  };
27
27
  try {
28
- const response = yield this.graphqlMutation(mutation, variables);
28
+ const response = yield this.graphqlQuery(query, variables);
29
29
  return response.findOrderByOwnerPartyId;
30
30
  }
31
31
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/storefront-js-client",
3
- "version": "3.8.9",
3
+ "version": "3.9.1",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [