@longvansoftware/service-js-client 1.10.2 → 1.10.3

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,3 +1,4 @@
1
1
  export declare const GET_ORDER_DETAIL: import("graphql").DocumentNode;
2
+ export declare const GET_QUANTITY_ORDER_LINEITEMS: import("graphql").DocumentNode;
2
3
  export declare const GET_ORDER_LINE_ITEM_BY_SERVICE_ID: import("graphql").DocumentNode;
3
4
  export declare const GET_ORDER_BY_SERVICE_ID: import("graphql").DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GET_ORDER_BY_SERVICE_ID = exports.GET_ORDER_LINE_ITEM_BY_SERVICE_ID = exports.GET_ORDER_DETAIL = void 0;
3
+ exports.GET_ORDER_BY_SERVICE_ID = exports.GET_ORDER_LINE_ITEM_BY_SERVICE_ID = exports.GET_QUANTITY_ORDER_LINEITEMS = exports.GET_ORDER_DETAIL = void 0;
4
4
  const graphql_tag_1 = require("graphql-tag");
5
5
  exports.GET_ORDER_DETAIL = (0, graphql_tag_1.gql) `
6
6
  query getOrderDetail($orderId: String!) {
@@ -132,6 +132,27 @@ exports.GET_ORDER_DETAIL = (0, graphql_tag_1.gql) `
132
132
  }
133
133
  }
134
134
  `;
135
+ exports.GET_QUANTITY_ORDER_LINEITEMS = (0, graphql_tag_1.gql) `
136
+ query getOrderDetail($orderId: String!) {
137
+ orderDetail(orderId: $orderId) {
138
+ order {
139
+ orderStatus
140
+ orderType
141
+ customAttribute
142
+ ownerPartyId
143
+ }
144
+ lineItems {
145
+ orderLineItem {
146
+ variant {
147
+ title
148
+ }
149
+ itemType
150
+ orderLineItemParentId
151
+ }
152
+ }
153
+ }
154
+ }
155
+ `;
135
156
  exports.GET_ORDER_LINE_ITEM_BY_SERVICE_ID = (0, graphql_tag_1.gql) `
136
157
  query GetOrderLineItemByServiceId($partnerId: String!, $serviceId: String!) {
137
158
  getOrderLineItemByServiceId(partnerId: $partnerId, serviceId: $serviceId) {
@@ -5,6 +5,7 @@ export declare class OrderGraphQLService extends Service {
5
5
  setStoreId(storeId: string): void;
6
6
  createOrder(input: any): Promise<any>;
7
7
  getOrderDetail(orderId: string): Promise<any>;
8
+ getQuantityOrderLineItems(orderId: string): Promise<any>;
8
9
  updateQuantityV2(payload: any): Promise<any>;
9
10
  getOrderLineItemByServiceId(serviceId: string): Promise<any>;
10
11
  getOrderByServiceId(serviceId: string): Promise<any>;
@@ -55,6 +55,22 @@ class OrderGraphQLService extends serviceSDK_1.Service {
55
55
  }
56
56
  });
57
57
  }
58
+ getQuantityOrderLineItems(orderId) {
59
+ return __awaiter(this, void 0, void 0, function* () {
60
+ const query = queries_1.GET_QUANTITY_ORDER_LINEITEMS;
61
+ const variables = {
62
+ orderId,
63
+ };
64
+ try {
65
+ const response = yield this.graphqlQueryV2(query, variables);
66
+ return response.orderDetail;
67
+ }
68
+ catch (error) {
69
+ console.log(`Error in orderDetail: ${error}`);
70
+ throw error;
71
+ }
72
+ });
73
+ }
58
74
  updateQuantityV2(payload) {
59
75
  return __awaiter(this, void 0, void 0, function* () {
60
76
  const mutations = mutations_1.UPDATE_QUANTITY_V2;
@@ -28,7 +28,7 @@ class UserService extends serviceSDK_1.Service {
28
28
  const query = queries_1.GET_PERSON_BY_IDS_QUERY;
29
29
  const variables = { partyIds };
30
30
  try {
31
- const response = yield this.graphqlQuery(query, variables);
31
+ const response = yield this.graphqlQueryV2(query, variables);
32
32
  return response.getPersonByPartyIds;
33
33
  }
34
34
  catch (error) {
@@ -47,7 +47,7 @@ class UserService extends serviceSDK_1.Service {
47
47
  createdBy,
48
48
  };
49
49
  try {
50
- const response = yield this.graphqlMutation(mutation, variables);
50
+ const response = yield this.graphqlMutationV2(mutation, variables);
51
51
  return response.createCompany;
52
52
  }
53
53
  catch (error) {
@@ -67,7 +67,7 @@ class UserService extends serviceSDK_1.Service {
67
67
  updatedBy,
68
68
  };
69
69
  try {
70
- const response = yield this.graphqlMutation(mutation, variables);
70
+ const response = yield this.graphqlMutationV2(mutation, variables);
71
71
  return response.updateCompanyInfo;
72
72
  }
73
73
  catch (error) {
@@ -86,7 +86,7 @@ class UserService extends serviceSDK_1.Service {
86
86
  updatedBy,
87
87
  };
88
88
  try {
89
- const response = yield this.graphqlMutation(mutation, variables);
89
+ const response = yield this.graphqlMutationV2(mutation, variables);
90
90
  return response.updateCustomerV2;
91
91
  }
92
92
  catch (error) {
@@ -102,7 +102,7 @@ class UserService extends serviceSDK_1.Service {
102
102
  id,
103
103
  };
104
104
  try {
105
- const response = yield this.graphqlQuery(query, variables);
105
+ const response = yield this.graphqlQueryV2(query, variables);
106
106
  return response.getCustomerById;
107
107
  }
108
108
  catch (error) {
@@ -120,7 +120,7 @@ class UserService extends serviceSDK_1.Service {
120
120
  limit,
121
121
  };
122
122
  try {
123
- const response = yield this.graphqlQuery(query, variables);
123
+ const response = yield this.graphqlQueryV2(query, variables);
124
124
  return response.searchCompany;
125
125
  }
126
126
  catch (error) {
@@ -141,7 +141,7 @@ class UserService extends serviceSDK_1.Service {
141
141
  createdBy: createdBy,
142
142
  };
143
143
  try {
144
- const response = yield this.graphqlMutation(mutation, variables);
144
+ const response = yield this.graphqlMutationV2(mutation, variables);
145
145
  return response.createCustomerV2;
146
146
  }
147
147
  catch (error) {
@@ -189,7 +189,7 @@ class UserService extends serviceSDK_1.Service {
189
189
  pageSize: searchParams.pageSize,
190
190
  };
191
191
  try {
192
- const response = yield this.graphqlQuery(query, variables);
192
+ const response = yield this.graphqlQueryV2(query, variables);
193
193
  return response.searchCustomers;
194
194
  }
195
195
  catch (error) {
@@ -207,7 +207,7 @@ class UserService extends serviceSDK_1.Service {
207
207
  positionShortName: searchParams.positionShortName,
208
208
  };
209
209
  try {
210
- const response = yield this.graphqlQuery(query, variables);
210
+ const response = yield this.graphqlQueryV2(query, variables);
211
211
  return response.searchEmployees;
212
212
  }
213
213
  catch (error) {
@@ -224,7 +224,7 @@ class UserService extends serviceSDK_1.Service {
224
224
  partnerId: this.orgId,
225
225
  };
226
226
  try {
227
- const response = yield this.graphqlQuery(query, variables);
227
+ const response = yield this.graphqlQueryV2(query, variables);
228
228
  return response.getPositionsByEmployeeId;
229
229
  }
230
230
  catch (error) {
@@ -241,7 +241,7 @@ class UserService extends serviceSDK_1.Service {
241
241
  partnerId: this.orgId,
242
242
  };
243
243
  try {
244
- const response = yield this.graphqlQuery(query, variables);
244
+ const response = yield this.graphqlQueryV2(query, variables);
245
245
  return response.getStoreChannelIdsByEmployeeId;
246
246
  }
247
247
  catch (error) {
@@ -258,7 +258,7 @@ class UserService extends serviceSDK_1.Service {
258
258
  partnerId: this.orgId,
259
259
  };
260
260
  try {
261
- const response = yield this.graphqlQuery(query, variables);
261
+ const response = yield this.graphqlQueryV2(query, variables);
262
262
  return response.getEmployeesByStoreChannelId;
263
263
  }
264
264
  catch (error) {
@@ -275,7 +275,7 @@ class UserService extends serviceSDK_1.Service {
275
275
  partnerId: this.orgId,
276
276
  };
277
277
  try {
278
- const response = yield this.graphqlQuery(query, variables);
278
+ const response = yield this.graphqlQueryV2(query, variables);
279
279
  return response.getCompanyByContactInfoId;
280
280
  }
281
281
  catch (error) {
@@ -292,7 +292,7 @@ class UserService extends serviceSDK_1.Service {
292
292
  partnerId: this.orgId,
293
293
  };
294
294
  try {
295
- const response = yield this.graphqlQuery(query, variables);
295
+ const response = yield this.graphqlQueryV2(query, variables);
296
296
  return response.getContactInfosByCompanyId;
297
297
  }
298
298
  catch (error) {
@@ -306,7 +306,7 @@ class UserService extends serviceSDK_1.Service {
306
306
  const query = queries_1.GET_PROVINCES;
307
307
  const variables = {};
308
308
  try {
309
- const response = yield this.graphqlQuery(query, variables);
309
+ const response = yield this.graphqlQueryV2(query, variables);
310
310
  return response.getProvinces;
311
311
  }
312
312
  catch (error) {
@@ -322,7 +322,7 @@ class UserService extends serviceSDK_1.Service {
322
322
  provinceId,
323
323
  };
324
324
  try {
325
- const response = yield this.graphqlQuery(query, variables);
325
+ const response = yield this.graphqlQueryV2(query, variables);
326
326
  return response.getDistricts;
327
327
  }
328
328
  catch (error) {
@@ -338,7 +338,7 @@ class UserService extends serviceSDK_1.Service {
338
338
  districtId,
339
339
  };
340
340
  try {
341
- const response = yield this.graphqlQuery(query, variables);
341
+ const response = yield this.graphqlQueryV2(query, variables);
342
342
  return response.getWards;
343
343
  }
344
344
  catch (error) {
@@ -354,7 +354,7 @@ class UserService extends serviceSDK_1.Service {
354
354
  ownerPartyId,
355
355
  };
356
356
  try {
357
- const response = yield this.graphqlQuery(query, variables);
357
+ const response = yield this.graphqlQueryV2(query, variables);
358
358
  return response.getVatInfoByOwnerPartyId;
359
359
  }
360
360
  catch (error) {
@@ -371,7 +371,7 @@ class UserService extends serviceSDK_1.Service {
371
371
  createdBy,
372
372
  };
373
373
  try {
374
- const response = yield this.graphqlMutation(mutation, variables);
374
+ const response = yield this.graphqlMutationV2(mutation, variables);
375
375
  return response.createVatInfo;
376
376
  }
377
377
  catch (error) {
@@ -389,7 +389,7 @@ class UserService extends serviceSDK_1.Service {
389
389
  updateBy,
390
390
  };
391
391
  try {
392
- const response = yield this.graphqlMutation(mutation, variables);
392
+ const response = yield this.graphqlMutationV2(mutation, variables);
393
393
  return response.updateVatInfo;
394
394
  }
395
395
  catch (error) {
@@ -406,7 +406,7 @@ class UserService extends serviceSDK_1.Service {
406
406
  updatedBy,
407
407
  };
408
408
  try {
409
- const response = yield this.graphqlMutation(mutation, variables);
409
+ const response = yield this.graphqlMutationV2(mutation, variables);
410
410
  return response.deleteVatInfo;
411
411
  }
412
412
  catch (error) {
@@ -424,7 +424,7 @@ class UserService extends serviceSDK_1.Service {
424
424
  createdBy,
425
425
  };
426
426
  try {
427
- const response = yield this.graphqlMutation(mutation, variables);
427
+ const response = yield this.graphqlMutationV2(mutation, variables);
428
428
  return response.createTeam;
429
429
  }
430
430
  catch (error) {
@@ -441,7 +441,7 @@ class UserService extends serviceSDK_1.Service {
441
441
  partnerId: this.orgId,
442
442
  };
443
443
  try {
444
- const response = yield this.graphqlQuery(query, variables);
444
+ const response = yield this.graphqlQueryV2(query, variables);
445
445
  return response.getTeamByUserId;
446
446
  }
447
447
  catch (error) {
@@ -457,7 +457,7 @@ class UserService extends serviceSDK_1.Service {
457
457
  teamId,
458
458
  };
459
459
  try {
460
- const response = yield this.graphqlQuery(query, variables);
460
+ const response = yield this.graphqlQueryV2(query, variables);
461
461
  return response.getUsersByTeamId;
462
462
  }
463
463
  catch (error) {
@@ -476,7 +476,7 @@ class UserService extends serviceSDK_1.Service {
476
476
  createdBy,
477
477
  };
478
478
  try {
479
- const response = yield this.graphqlMutation(query, variables);
479
+ const response = yield this.graphqlMutationV2(query, variables);
480
480
  return response.addUserToTeam;
481
481
  }
482
482
  catch (error) {
@@ -495,7 +495,7 @@ class UserService extends serviceSDK_1.Service {
495
495
  deletedBy,
496
496
  };
497
497
  try {
498
- const response = yield this.graphqlMutation(query, variables);
498
+ const response = yield this.graphqlMutationV2(query, variables);
499
499
  return response.removeUserFromTeam;
500
500
  }
501
501
  catch (error) {
@@ -513,7 +513,7 @@ class UserService extends serviceSDK_1.Service {
513
513
  updatedBy,
514
514
  };
515
515
  try {
516
- const response = yield this.graphqlMutation(query, variables);
516
+ const response = yield this.graphqlMutationV2(query, variables);
517
517
  return response.updateTeamName;
518
518
  }
519
519
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/service-js-client",
3
- "version": "1.10.2",
3
+ "version": "1.10.3",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [