@longvansoftware/service-js-client 1.1.8 → 1.1.9

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 +1,2 @@
1
1
  export declare const GET_ORDER_DETAIL: import("graphql").DocumentNode;
2
+ export declare const GET_ORDER_LINE_ITEM_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_DETAIL = void 0;
3
+ exports.GET_ORDER_LINE_ITEM_BY_SERVICE_ID = 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!) {
@@ -59,3 +59,79 @@ exports.GET_ORDER_DETAIL = (0, graphql_tag_1.gql) `
59
59
  }
60
60
  }
61
61
  `;
62
+ exports.GET_ORDER_LINE_ITEM_BY_SERVICE_ID = (0, graphql_tag_1.gql) `
63
+ query GetOrderLineItemByServiceId($partnerId: String!, $serviceId: String!) {
64
+ getOrderLineItemByServiceId(partnerId: $partnerId, serviceId: $serviceId) {
65
+ id
66
+ partnerId
67
+ currentQuantity
68
+ customAttributes {
69
+ key
70
+ value
71
+ }
72
+ discountedTotalPrice {
73
+ amount
74
+ currencyCode
75
+ }
76
+ originalTotalPrice {
77
+ amount
78
+ currencyCode
79
+ }
80
+ quantity
81
+ variant {
82
+ availableForSale
83
+ barcode
84
+
85
+ currentlyNotInStock
86
+ id
87
+
88
+ price {
89
+ amount
90
+ currencyCode
91
+ }
92
+
93
+ unitPrice {
94
+ amount
95
+ currencyCode
96
+ }
97
+
98
+ quantityAvailable
99
+ requiresShipping
100
+ sku
101
+ title
102
+
103
+ weight
104
+ weightUnit
105
+ }
106
+ orderId
107
+ orderItemId
108
+ fulfilledQuantity
109
+ fulfillingQuantity
110
+ orderItemName
111
+ note
112
+ createdStamp
113
+ updatedStamp
114
+ completedAt
115
+ orderLineItemParentId
116
+ orderStatus
117
+ totalVAT {
118
+ amount
119
+ currencyCode
120
+ }
121
+ vatRate {
122
+ amount
123
+ currencyCode
124
+ }
125
+ totalTax {
126
+ amount
127
+ currencyCode
128
+ }
129
+ unitType
130
+ productOptions {
131
+ idOption
132
+ name
133
+ value
134
+ }
135
+ }
136
+ }
137
+ `;
@@ -105,6 +105,7 @@ exports.GET_PRODUCT_BY_ID_QUERY = (0, graphql_tag_1.gql) `
105
105
  description
106
106
  sku
107
107
  shortDescription
108
+ subType
108
109
  weight
109
110
  width
110
111
  depth
@@ -138,6 +139,7 @@ exports.GET_PRODUCT_BY_ID_QUERY = (0, graphql_tag_1.gql) `
138
139
  handle
139
140
  title
140
141
  price
142
+ priceType
141
143
  compareAtPrice
142
144
  options
143
145
  optionsIds
@@ -648,7 +650,8 @@ exports.GET_RESOURCE_BY_PRODUCT = (0, graphql_tag_1.gql) `
648
650
  }
649
651
  productId
650
652
  productName
651
- groupName
653
+ resourceName
654
+ resourceUnit
652
655
  price
653
656
  }
654
657
  }
@@ -669,6 +672,7 @@ exports.GET_PRODUCT_VARIANT_BY_ID = (0, graphql_tag_1.gql) `
669
672
  description
670
673
  sku
671
674
  shortDescription
675
+ subType
672
676
  weight
673
677
  width
674
678
  depth
@@ -5,4 +5,5 @@ export declare class OrderGraphQLService extends Service {
5
5
  createOrder(input: any): Promise<any>;
6
6
  getOrderDetail(orderId: string): Promise<any>;
7
7
  updateQuantityV2(payload: any): Promise<any>;
8
+ getOrderLineItemByServiceId(serviceId: string): Promise<any>;
8
9
  }
@@ -66,5 +66,22 @@ class OrderGraphQLService extends serviceSDK_1.Service {
66
66
  }
67
67
  });
68
68
  }
69
+ getOrderLineItemByServiceId(serviceId) {
70
+ return __awaiter(this, void 0, void 0, function* () {
71
+ const query = queries_1.GET_ORDER_LINE_ITEM_BY_SERVICE_ID;
72
+ const variables = {
73
+ partnerId: this.orgId,
74
+ serviceId,
75
+ };
76
+ try {
77
+ const response = yield this.graphqlQueryV2(query, variables);
78
+ return response.getOrderLineItemByServiceId;
79
+ }
80
+ catch (error) {
81
+ console.log(`Error in getOrderLineItemByServiceId: ${error}`);
82
+ throw error;
83
+ }
84
+ });
85
+ }
69
86
  }
70
87
  exports.OrderGraphQLService = OrderGraphQLService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/service-js-client",
3
- "version": "1.1.8",
3
+ "version": "1.1.9",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [