@longvansoftware/service-js-client 1.1.5 → 1.1.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.
@@ -11,6 +11,8 @@ export declare const environmentEndpoints: {
11
11
  computing: string;
12
12
  cloud: string;
13
13
  dns: string;
14
+ crm_camping: string;
15
+ order_graphQL: string;
14
16
  };
15
17
  live: {
16
18
  product: string;
@@ -24,5 +26,7 @@ export declare const environmentEndpoints: {
24
26
  computing: string;
25
27
  cloud: string;
26
28
  dns: string;
29
+ crm_camping: string;
30
+ order_graphQL: string;
27
31
  };
28
32
  };
@@ -14,6 +14,8 @@ exports.environmentEndpoints = {
14
14
  computing: "https://api-gateway.dev.longvan.vn/computing-service/graphql",
15
15
  cloud: "https://api-gateway.dev.longvan.vn/cloud-service-api/graphql",
16
16
  dns: "https://admin-dev.longvan.net/powerdns/dns",
17
+ crm_camping: "https://crm.dev.longvan.vn/campaign-gateway/graphql",
18
+ order_graphQL: "https://api-gateway.dev.longvan.vn/order-cloud-service/graphql"
17
19
  },
18
20
  live: {
19
21
  product: "https://product-service.longvan.vn/product-service/graphql",
@@ -27,5 +29,7 @@ exports.environmentEndpoints = {
27
29
  computing: "https://api-gateway.longvan.vn/computing-service/graphql",
28
30
  cloud: "https://api-gateway.longvan.vn/cloud-service-api/graphql",
29
31
  dns: "https://admin.longvan.net/powerdns/dns",
32
+ crm_camping: "https://crm.longvan.vn/campaign-gateway/graphql",
33
+ order_graphQL: "https://api-gateway.longvan.vn/order-cloud-service/graphql"
30
34
  },
31
35
  };
@@ -3,3 +3,4 @@ export declare const GET_MAIL_RESOURCE: import("graphql").DocumentNode;
3
3
  export declare const GET_USER_MAIL_HOSTING: import("graphql").DocumentNode;
4
4
  export declare const SERVICE_TYPE: import("graphql").DocumentNode;
5
5
  export declare const SEARCH_SERVICE: import("graphql").DocumentNode;
6
+ export declare const GET_PRODUCTS_OF_SERVICE: import("graphql").DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SEARCH_SERVICE = exports.SERVICE_TYPE = exports.GET_USER_MAIL_HOSTING = exports.GET_MAIL_RESOURCE = exports.SERVICE_DETAIL = void 0;
3
+ exports.GET_PRODUCTS_OF_SERVICE = exports.SEARCH_SERVICE = exports.SERVICE_TYPE = exports.GET_USER_MAIL_HOSTING = exports.GET_MAIL_RESOURCE = exports.SERVICE_DETAIL = void 0;
4
4
  const graphql_tag_1 = require("graphql-tag");
5
5
  exports.SERVICE_DETAIL = (0, graphql_tag_1.gql) `
6
6
  query ServiceDetail($serviceId: String) {
@@ -119,3 +119,8 @@ exports.SEARCH_SERVICE = (0, graphql_tag_1.gql) `
119
119
  }
120
120
  }
121
121
  `;
122
+ exports.GET_PRODUCTS_OF_SERVICE = (0, graphql_tag_1.gql) `
123
+ query GetProductsOfService($serviceId: String!){
124
+ getProductsOfService(serviceId: $serviceId)
125
+ }
126
+ `;
@@ -0,0 +1 @@
1
+ export declare const SEARCH_PRODUCT_QUANTITY_PROMOTION_ACTION: import("graphql").DocumentNode;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SEARCH_PRODUCT_QUANTITY_PROMOTION_ACTION = void 0;
4
+ const graphql_tag_1 = require("graphql-tag");
5
+ exports.SEARCH_PRODUCT_QUANTITY_PROMOTION_ACTION = (0, graphql_tag_1.gql) `
6
+ query SearchProductQuantityPromotionAction(
7
+ $productId: String!
8
+ $partyId: String!
9
+ $storeChannel: String!
10
+ ) {
11
+ searchProductQuantityPromotionAction(
12
+ productId: $productId
13
+ partyId: $partyId
14
+ storeChannel: $storeChannel
15
+ )
16
+ }
17
+ `;
@@ -0,0 +1,2 @@
1
+ export declare const CREATE_ORDER: import("graphql").DocumentNode;
2
+ export declare const UPDATE_QUANTITY_V2: import("graphql").DocumentNode;
@@ -0,0 +1,272 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UPDATE_QUANTITY_V2 = exports.CREATE_ORDER = void 0;
4
+ const graphql_tag_1 = require("graphql-tag");
5
+ exports.CREATE_ORDER = (0, graphql_tag_1.gql) `
6
+ mutation CreateOrder($input: CreateOrderInput!) {
7
+ createOrder(input: $input) {
8
+ cancelReason
9
+ currencyCode
10
+ currentSubtotalPrice {
11
+ amount
12
+ currencyCode
13
+ }
14
+ currentTotalDuties {
15
+ amount
16
+ currencyCode
17
+ }
18
+ currentTotalPrice {
19
+ amount
20
+ currencyCode
21
+ }
22
+ currentTotalTax {
23
+ amount
24
+ currencyCode
25
+ }
26
+ edited
27
+ financialStatus
28
+ fulfillmentStatus
29
+ orderStatus
30
+ id
31
+ partnerId
32
+ ownerName
33
+ ownerEmail
34
+ ownerPhone
35
+ orderNumber
36
+ originalTotalDuties {
37
+ amount
38
+ currencyCode
39
+ }
40
+ originalTotalPrice {
41
+ amount
42
+ currencyCode
43
+ }
44
+ shippingAddress {
45
+ address1
46
+ address2
47
+ city
48
+ company
49
+ country
50
+ countryCode
51
+ firstName
52
+ formattedArea
53
+ id
54
+ lastName
55
+ latitude
56
+ longitude
57
+ name
58
+ phone
59
+ province
60
+ provinceCode
61
+ zip
62
+ }
63
+ subtotalPrice {
64
+ amount
65
+ currencyCode
66
+ }
67
+ totalPrice {
68
+ amount
69
+ currencyCode
70
+ }
71
+ totalRefunded {
72
+ amount
73
+ currencyCode
74
+ }
75
+ totalShippingPrice {
76
+ amount
77
+ currencyCode
78
+ }
79
+ totalTax {
80
+ amount
81
+ currencyCode
82
+ }
83
+ discountTotalPrice {
84
+ amount
85
+ currencyCode
86
+ }
87
+ cod {
88
+ amount
89
+ currencyCode
90
+ }
91
+ rawData
92
+ orderId
93
+ note
94
+ pending
95
+ checkCommodities
96
+ shipmentNote
97
+ shopId
98
+ facilityId
99
+ orderType
100
+ shippingServiceId
101
+ carrierId
102
+ fromOrderId
103
+ externalCode
104
+ createdAt
105
+ createdStamp
106
+ canceledAt
107
+ updatedAt
108
+ approvedAt
109
+ processedAt
110
+ completedAt
111
+ createdBy
112
+ saleName
113
+ salePartyId
114
+ ownerPartyId
115
+ customerLocale
116
+ orderParentId
117
+ totalVAT {
118
+ amount
119
+ currencyCode
120
+ }
121
+ shopName
122
+ version
123
+ discountApplications {
124
+ allocationMethod
125
+ targetSelection
126
+ targetType
127
+ title
128
+ value {
129
+ amount
130
+ currencyCode
131
+ }
132
+ }
133
+ }
134
+ }
135
+ `;
136
+ exports.UPDATE_QUANTITY_V2 = (0, graphql_tag_1.gql) `
137
+ mutation UpdateQuantityV2(
138
+ $partnerId: String!
139
+ $orderId: String!
140
+ $updateItemInputs: [UpdateItemInput]!
141
+ $updateBy: String!
142
+ ) {
143
+ updateQuantityV2(
144
+ partnerId: $partnerId
145
+ orderId: $orderId
146
+ updateItemInputs: $updateItemInputs
147
+ updateBy: $updateBy
148
+ ) {
149
+ cancelReason
150
+ currencyCode
151
+ currentSubtotalPrice {
152
+ amount
153
+ currencyCode
154
+ }
155
+ currentTotalDuties {
156
+ amount
157
+ currencyCode
158
+ }
159
+ currentTotalPrice {
160
+ amount
161
+ currencyCode
162
+ }
163
+ currentTotalTax {
164
+ amount
165
+ currencyCode
166
+ }
167
+ edited
168
+ financialStatus
169
+ fulfillmentStatus
170
+ orderStatus
171
+ id
172
+ partnerId
173
+ ownerName
174
+ ownerEmail
175
+ ownerPhone
176
+ orderNumber
177
+ originalTotalDuties {
178
+ amount
179
+ currencyCode
180
+ }
181
+ originalTotalPrice {
182
+ amount
183
+ currencyCode
184
+ }
185
+ shippingAddress {
186
+ address1
187
+ address2
188
+ city
189
+ company
190
+ country
191
+ countryCode
192
+ firstName
193
+ formattedArea
194
+ id
195
+ lastName
196
+ latitude
197
+ longitude
198
+ name
199
+ phone
200
+ province
201
+ provinceCode
202
+ zip
203
+ }
204
+ subtotalPrice {
205
+ amount
206
+ currencyCode
207
+ }
208
+ totalPrice {
209
+ amount
210
+ currencyCode
211
+ }
212
+ totalRefunded {
213
+ amount
214
+ currencyCode
215
+ }
216
+ totalShippingPrice {
217
+ amount
218
+ currencyCode
219
+ }
220
+ totalTax {
221
+ amount
222
+ currencyCode
223
+ }
224
+ discountTotalPrice {
225
+ amount
226
+ currencyCode
227
+ }
228
+ cod {
229
+ amount
230
+ currencyCode
231
+ }
232
+ rawData
233
+ orderId
234
+ note
235
+ pending
236
+ checkCommodities
237
+ shipmentNote
238
+ shopId
239
+ facilityId
240
+ orderType
241
+ shippingServiceId
242
+ carrierId
243
+ fromOrderId
244
+ externalCode
245
+ createdAt
246
+ createdStamp
247
+ canceledAt
248
+ updatedAt
249
+ approvedAt
250
+ processedAt
251
+ completedAt
252
+ createdBy
253
+ saleName
254
+ salePartyId
255
+ ownerPartyId
256
+ customerLocale
257
+ orderParentId
258
+ totalVAT {
259
+ amount
260
+ currencyCode
261
+ }
262
+ shopName
263
+ version
264
+ discountApplications {
265
+ allocationMethod
266
+ targetSelection
267
+ targetType
268
+ title
269
+ }
270
+ }
271
+ }
272
+ `;
@@ -0,0 +1 @@
1
+ export declare const GET_ORDER_DETAIL: import("graphql").DocumentNode;
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GET_ORDER_DETAIL = void 0;
4
+ const graphql_tag_1 = require("graphql-tag");
5
+ exports.GET_ORDER_DETAIL = (0, graphql_tag_1.gql) `
6
+ query getOrderDetail($orderId: String!) {
7
+ orderDetail(orderId: $orderId) {
8
+ order {
9
+ financialStatus
10
+ orderStatus
11
+ ownerName
12
+ ownerEmail
13
+ ownerPhone
14
+ orderId
15
+ id
16
+ createdAt
17
+ currentTotalPrice {
18
+ amount
19
+ currencyCode
20
+ }
21
+ }
22
+ lineItems {
23
+ orderLineItem {
24
+ unitType
25
+ customAttributes {
26
+ key
27
+ value
28
+ }
29
+ id
30
+ orderItemId
31
+ quantity
32
+ totalVAT {
33
+ amount
34
+ currencyCode
35
+ }
36
+ variant {
37
+ id
38
+ price {
39
+ amount
40
+ currencyCode
41
+ }
42
+ product {
43
+ id
44
+ title
45
+ }
46
+ title
47
+ unitPrice {
48
+ amount
49
+ currencyCode
50
+ }
51
+ }
52
+ productOptions {
53
+ idOption
54
+ name
55
+ value
56
+ }
57
+ }
58
+ }
59
+ }
60
+ }
61
+ `;
@@ -9,11 +9,11 @@ exports.CREATE_PAYMENT_ORDER_MUTATION = (0, graphql_tag_1.gql) `
9
9
  $paymentMethod: String!
10
10
  $storeId: String!
11
11
  $source: String!
12
- $appliedAmount: BigDecimal!
13
- $payDate: String!
12
+ $appliedAmount: BigDecimal
13
+ $payDate: String
14
14
  $returnUrl: String
15
- $paymentType: String!
16
- $createBy: String!
15
+ $paymentType: String
16
+ $createBy: String
17
17
  ) {
18
18
  createPaymentOrder(
19
19
  orgId: $orgId
@@ -30,6 +30,11 @@ exports.CREATE_PAYMENT_ORDER_MUTATION = (0, graphql_tag_1.gql) `
30
30
  code
31
31
  message
32
32
  data
33
+ qrCodeUrl
34
+ deeplink
35
+ deeplinkMiniApp
36
+ invoiceId
37
+ orderId
33
38
  }
34
39
  }
35
40
  `;
@@ -8,16 +8,23 @@ exports.GET_PAYMENT_METHOD = (0, graphql_tag_1.gql) `
8
8
  id
9
9
  code
10
10
  name
11
+ image
12
+ description
11
13
  }
12
14
  }
13
15
  `;
14
16
  exports.GEN_QR_PAYMENT = (0, graphql_tag_1.gql) `
15
- query GenQRPayment($orgId: String!, $orderId: String!, $storeId: String!, $totalAmount: BigDecimal){
17
+ query GenQRPayment(
18
+ $orgId: String!
19
+ $orderId: String!
20
+ $storeId: String!
21
+ $totalAmount: BigDecimal
22
+ ) {
16
23
  genQRPayment(
17
24
  orgId: $orgId
18
25
  orderId: $orderId
19
26
  storeId: $storeId
20
27
  totalAmount: $totalAmount
21
28
  )
22
- }
29
+ }
23
30
  `;
@@ -110,19 +110,29 @@ exports.GET_PRODUCT_BY_ID_QUERY = (0, graphql_tag_1.gql) `
110
110
  depth
111
111
  height
112
112
  vat
113
+ unitDTO {
114
+ id
115
+ name
116
+ }
117
+ productAttributes {
118
+ attributeName
119
+ attributeValue
120
+ }
113
121
  qualify
114
122
  parentId
115
123
  handle
116
124
  price
125
+ priceType
126
+ salePolicy
127
+ priceTypeName
128
+ priceVaries
129
+ available
130
+ tags
117
131
  options
118
132
  optionsRelationship
119
133
  compareAtPrice
120
134
  featuredImage
121
135
  images
122
- productAttributes {
123
- attributeName
124
- attributeValue
125
- }
126
136
  variants {
127
137
  id
128
138
  handle
@@ -137,15 +147,38 @@ exports.GET_PRODUCT_BY_ID_QUERY = (0, graphql_tag_1.gql) `
137
147
  featureTypes {
138
148
  id
139
149
  name
150
+ position
151
+ type
152
+ subType
153
+ fill
154
+ requireData
140
155
  values
141
- valuesFull {
156
+ productFeatureDTOS {
157
+ featureTypeId
142
158
  id
143
- name
159
+ productOptionConfigs {
160
+ id
161
+ productId
162
+ productName
163
+ price
164
+ }
165
+ productOptionGroupItemDTOS {
166
+ id
167
+ price
168
+ productId
169
+ productName
170
+ }
144
171
  }
172
+ createStamp
173
+ createdBy
145
174
  }
146
175
  categories {
147
176
  id
148
177
  title
178
+ image
179
+ icon
180
+ parentId
181
+ level
149
182
  handle
150
183
  }
151
184
  }
@@ -9,6 +9,8 @@ import { WarehouseService } from "../lib/warehouse/index";
9
9
  import { ComputingService } from "../lib/computing/index";
10
10
  import { CloudService } from "./cloud";
11
11
  import { DnsService } from "../lib/dns/index";
12
+ import { CrmCampingService } from "./crm_camping";
13
+ import { OrderGraphQLService } from "./orderGraphQL";
12
14
  export interface Endpoints {
13
15
  product: string;
14
16
  crm: string;
@@ -21,6 +23,8 @@ export interface Endpoints {
21
23
  computing: string;
22
24
  cloud: string;
23
25
  dns: string;
26
+ crm_camping: string;
27
+ order_graphQL: string;
24
28
  }
25
29
  export declare class SDK {
26
30
  orgId: string;
@@ -38,6 +42,8 @@ export declare class SDK {
38
42
  computing: ComputingService;
39
43
  cloud: CloudService;
40
44
  dns: DnsService;
45
+ crm_camping: CrmCampingService;
46
+ order_graphQL: OrderGraphQLService;
41
47
  token: string | null;
42
48
  constructor(orgId: string, storeId: string, storefrontAccessToken: string, environment: string);
43
49
  setToken(token: string): void;
@@ -15,6 +15,8 @@ const index_8 = require("../lib/warehouse/index");
15
15
  const index_9 = require("../lib/computing/index");
16
16
  const cloud_1 = require("./cloud");
17
17
  const index_10 = require("../lib/dns/index");
18
+ const crm_camping_1 = require("./crm_camping");
19
+ const orderGraphQL_1 = require("./orderGraphQL");
18
20
  class SDK {
19
21
  constructor(orgId, storeId, storefrontAccessToken, environment) {
20
22
  this.orgId = orgId;
@@ -39,6 +41,8 @@ class SDK {
39
41
  this.computing = new index_9.ComputingService(endpoints.computing, orgId, storeId);
40
42
  this.cloud = new cloud_1.CloudService(endpoints.cloud, orgId, storeId);
41
43
  this.dns = new index_10.DnsService(endpoints.dns, orgId, storeId);
44
+ this.crm_camping = new crm_camping_1.CrmCampingService(endpoints.crm_camping, orgId, storeId);
45
+ this.order_graphQL = new orderGraphQL_1.OrderGraphQLService(endpoints.order_graphQL, orgId, storeId);
42
46
  // Initialize other services here
43
47
  }
44
48
  setToken(token) {
@@ -55,6 +59,8 @@ class SDK {
55
59
  this.computing.setToken(token);
56
60
  this.cloud.setToken(token);
57
61
  this.dns.setToken(token);
62
+ this.crm_camping.setToken(token);
63
+ this.order_graphQL.setToken(token);
58
64
  // Set token for other services here
59
65
  }
60
66
  // các module export từ serviceSDK.ts set storeId vào serviceSDK.ts
@@ -22,4 +22,5 @@ export declare class CloudService extends Service {
22
22
  serviceTypes(): Promise<any>;
23
23
  searchService(filter: Filter): Promise<any>;
24
24
  updateDNS(payload: {}): Promise<any>;
25
+ getProductsOfService(serviceId: string): Promise<any>;
25
26
  }
@@ -244,5 +244,21 @@ class CloudService extends serviceSDK_1.Service {
244
244
  }
245
245
  });
246
246
  }
247
+ getProductsOfService(serviceId) {
248
+ return __awaiter(this, void 0, void 0, function* () {
249
+ const query = queries_1.GET_PRODUCTS_OF_SERVICE;
250
+ const variables = {
251
+ serviceId,
252
+ };
253
+ try {
254
+ const response = yield this.graphqlQueryV2(query, variables);
255
+ return response.getProductsOfService;
256
+ }
257
+ catch (error) {
258
+ console.log(`Error in getProductsOfService: ${error}`);
259
+ throw error;
260
+ }
261
+ });
262
+ }
247
263
  }
248
264
  exports.CloudService = CloudService;
@@ -0,0 +1,6 @@
1
+ import { Service } from "../serviceSDK";
2
+ export declare class CrmCampingService extends Service {
3
+ constructor(endpoint: string, orgId: string, storeId: string);
4
+ setToken(token: string): void;
5
+ searchProductQuantityPromotionAction(productId: string): Promise<any>;
6
+ }
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.CrmCampingService = void 0;
13
+ const queries_1 = require("../../graphql/crm_camping/queries");
14
+ const serviceSDK_1 = require("../serviceSDK");
15
+ class CrmCampingService extends serviceSDK_1.Service {
16
+ constructor(endpoint, orgId, storeId) {
17
+ super(endpoint, orgId, storeId);
18
+ }
19
+ setToken(token) {
20
+ this.token = token;
21
+ }
22
+ searchProductQuantityPromotionAction(productId) {
23
+ return __awaiter(this, void 0, void 0, function* () {
24
+ const query = queries_1.SEARCH_PRODUCT_QUANTITY_PROMOTION_ACTION;
25
+ const variables = {
26
+ productId,
27
+ partyId: this.orgId,
28
+ storeChannel: this.storeId
29
+ };
30
+ try {
31
+ const response = yield this.graphqlQueryV2(query, variables);
32
+ return response.searchProductQuantityPromotionAction;
33
+ }
34
+ catch (error) {
35
+ console.log(`Error in searchProductQuantityPromotionAction: ${error}`);
36
+ throw error;
37
+ }
38
+ });
39
+ }
40
+ }
41
+ exports.CrmCampingService = CrmCampingService;
@@ -20,6 +20,7 @@ class DnsService extends serviceSDK_1.Service {
20
20
  }
21
21
  getDomain(params) {
22
22
  return __awaiter(this, void 0, void 0, function* () {
23
+ console.log("🚀 ~ DnsService ~ getDomain ~ params:", params);
23
24
  const endpoint = `/domain`;
24
25
  const method = "POST";
25
26
  try {
@@ -0,0 +1,8 @@
1
+ import { Service } from "../serviceSDK";
2
+ export declare class OrderGraphQLService extends Service {
3
+ constructor(endpoint: string, orgId: string, storeId: string);
4
+ setToken(token: string): void;
5
+ createOrder(input: any): Promise<any>;
6
+ getOrderDetail(orderId: string): Promise<any>;
7
+ updateQuantityV2(payload: any): Promise<any>;
8
+ }
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.OrderGraphQLService = void 0;
13
+ const mutations_1 = require("../../graphql/orderGraphQL/mutations");
14
+ const queries_1 = require("../../graphql/orderGraphQL/queries");
15
+ const serviceSDK_1 = require("../serviceSDK");
16
+ class OrderGraphQLService extends serviceSDK_1.Service {
17
+ constructor(endpoint, orgId, storeId) {
18
+ super(endpoint, orgId, storeId);
19
+ }
20
+ setToken(token) {
21
+ this.token = token;
22
+ }
23
+ createOrder(input) {
24
+ return __awaiter(this, void 0, void 0, function* () {
25
+ const mutation = mutations_1.CREATE_ORDER;
26
+ const variables = {
27
+ input,
28
+ };
29
+ try {
30
+ const response = yield this.graphqlMutationV2(mutation, variables);
31
+ return response.createOrder;
32
+ }
33
+ catch (error) {
34
+ console.log(`Error in createOrder: ${error}`);
35
+ throw error;
36
+ }
37
+ });
38
+ }
39
+ getOrderDetail(orderId) {
40
+ return __awaiter(this, void 0, void 0, function* () {
41
+ const query = queries_1.GET_ORDER_DETAIL;
42
+ const variables = {
43
+ orderId,
44
+ };
45
+ try {
46
+ const response = yield this.graphqlQueryV2(query, variables);
47
+ return response.orderDetail;
48
+ }
49
+ catch (error) {
50
+ console.log(`Error in orderDetail: ${error}`);
51
+ throw error;
52
+ }
53
+ });
54
+ }
55
+ updateQuantityV2(payload) {
56
+ return __awaiter(this, void 0, void 0, function* () {
57
+ const mutations = mutations_1.UPDATE_QUANTITY_V2;
58
+ const variables = Object.assign({ partnerId: this.orgId }, payload);
59
+ try {
60
+ const response = yield this.graphqlMutationV2(mutations, variables);
61
+ return response.updateQuantityV2;
62
+ }
63
+ catch (error) {
64
+ console.log(`Error in updateQuantityV2: ${error}`);
65
+ throw error;
66
+ }
67
+ });
68
+ }
69
+ }
70
+ exports.OrderGraphQLService = OrderGraphQLService;
@@ -22,6 +22,7 @@ class PaymentService extends serviceSDK_1.Service {
22
22
  const query = queries_1.GET_PAYMENT_METHOD;
23
23
  const variables = {
24
24
  orgId: this.orgId,
25
+ storeChannelId: this.storeId,
25
26
  };
26
27
  try {
27
28
  const response = yield this.graphqlQuery(query, variables);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/service-js-client",
3
- "version": "1.1.5",
3
+ "version": "1.1.6",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [