@longvansoftware/service-js-client 2.9.4 → 2.9.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.
@@ -1,2 +1,3 @@
1
1
  import { DocumentNode } from "graphql";
2
2
  export declare const MERGE_ORDER_CART: (fields?: string[]) => DocumentNode;
3
+ export declare const UPDATE_ORDER_CUSTOMER: (fields?: string[]) => DocumentNode;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.MERGE_ORDER_CART = void 0;
6
+ exports.UPDATE_ORDER_CUSTOMER = exports.MERGE_ORDER_CART = void 0;
7
7
  const helpers_1 = require("../../utils/helpers");
8
8
  const graphql_tag_1 = __importDefault(require("graphql-tag"));
9
9
  const MERGE_ORDER_CART = (fields = []) => {
@@ -26,3 +26,17 @@ const MERGE_ORDER_CART = (fields = []) => {
26
26
  `;
27
27
  };
28
28
  exports.MERGE_ORDER_CART = MERGE_ORDER_CART;
29
+ const UPDATE_ORDER_CUSTOMER = (fields = []) => {
30
+ const fieldStr = fields.join("\n ");
31
+ const hasFields = fields.length > 0;
32
+ return (0, graphql_tag_1.default) `
33
+ mutation UpdateOrderCustomer($partnerId: String!, $orderId: String!, $input: UpdateCustomerAndAddressDTOInput!){
34
+ updateOrderCustomer(
35
+ partnerId: $partnerId
36
+ orderId: $orderId
37
+ input: $input
38
+ ) ${hasFields ? `{ ${fieldStr} }` : ""}
39
+ }
40
+ `;
41
+ };
42
+ exports.UPDATE_ORDER_CUSTOMER = UPDATE_ORDER_CUSTOMER;
@@ -6,4 +6,5 @@ export declare class StorefrontService extends Service {
6
6
  mergeOrderCart(oldCartId: string, newCartId: string, actorId: string, isAllowedToMergeItem: boolean, fields?: string[]): Promise<any>;
7
7
  getReferralCodes(partnerId: string, ownerReferralId: string, size?: number, page?: number, onlyWithBalance?: boolean, status?: string, fields?: string[]): Promise<any>;
8
8
  getReferralCodeDetail(partnerId: string, voucherCode: string, fields?: string[]): Promise<any>;
9
+ updateOrderCustomer(orderId: string, input: any, fields: string[]): Promise<any>;
9
10
  }
@@ -79,5 +79,22 @@ class StorefrontService extends serviceSDK_1.Service {
79
79
  }
80
80
  });
81
81
  }
82
+ updateOrderCustomer(orderId, input, fields) {
83
+ return __awaiter(this, void 0, void 0, function* () {
84
+ const mutation = (0, mutation_1.UPDATE_ORDER_CUSTOMER)(fields);
85
+ const variables = {
86
+ partnerId: this.orgId,
87
+ orderId,
88
+ input
89
+ };
90
+ try {
91
+ const response = yield this.graphqlMutationV2(mutation, variables);
92
+ return response.updateOrderCustomer;
93
+ }
94
+ catch (error) {
95
+ throw error;
96
+ }
97
+ });
98
+ }
82
99
  }
83
100
  exports.StorefrontService = StorefrontService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/service-js-client",
3
- "version": "2.9.4",
3
+ "version": "2.9.6",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [