@longvansoftware/service-js-client 1.1.7 → 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.
- package/dist/src/graphql/orderGraphQL/queries.d.ts +1 -0
- package/dist/src/graphql/orderGraphQL/queries.js +77 -1
- package/dist/src/graphql/product/queries.d.ts +2 -0
- package/dist/src/graphql/product/queries.js +116 -1
- package/dist/src/lib/orderGraphQL/index.d.ts +1 -0
- package/dist/src/lib/orderGraphQL/index.js +17 -0
- package/dist/src/lib/product/index.d.ts +2 -0
- package/dist/src/lib/product/index.js +36 -0
- package/package.json +1 -1
@@ -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
|
+
`;
|
@@ -11,3 +11,5 @@ export declare const GET_PRODUCT_OPTION: import("graphql").DocumentNode;
|
|
11
11
|
export declare const GET_POLICY: import("graphql").DocumentNode;
|
12
12
|
export declare const GET_PRODUCTS: import("graphql").DocumentNode;
|
13
13
|
export declare const GET_HANDLE_BY_SERVICETYPE: import("graphql").DocumentNode;
|
14
|
+
export declare const GET_RESOURCE_BY_PRODUCT: import("graphql").DocumentNode;
|
15
|
+
export declare const GET_PRODUCT_VARIANT_BY_ID: import("graphql").DocumentNode;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.GET_HANDLE_BY_SERVICETYPE = exports.GET_PRODUCTS = exports.GET_POLICY = exports.GET_PRODUCT_OPTION = exports.GET_BRAND_DETAIL_QUERY = exports.GET_BRANDS_BY_CATEGORY_QUERY = exports.GET_BRANDS_QUERY = exports.GET_CATEGORY_BY_ID_QUERY = exports.GET_CATEGORY_BY_HANDLE_QUERY = exports.GET_CATEGORIES_QUERY = exports.GET_SIMPLE_PRODUCTS_QUERY = exports.GET_PRODUCT_BY_SLUG_QUERY = exports.GET_PRODUCT_BY_ID_QUERY = void 0;
|
3
|
+
exports.GET_PRODUCT_VARIANT_BY_ID = exports.GET_RESOURCE_BY_PRODUCT = exports.GET_HANDLE_BY_SERVICETYPE = exports.GET_PRODUCTS = exports.GET_POLICY = exports.GET_PRODUCT_OPTION = exports.GET_BRAND_DETAIL_QUERY = exports.GET_BRANDS_BY_CATEGORY_QUERY = exports.GET_BRANDS_QUERY = exports.GET_CATEGORY_BY_ID_QUERY = exports.GET_CATEGORY_BY_HANDLE_QUERY = exports.GET_CATEGORIES_QUERY = exports.GET_SIMPLE_PRODUCTS_QUERY = exports.GET_PRODUCT_BY_SLUG_QUERY = exports.GET_PRODUCT_BY_ID_QUERY = void 0;
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
5
5
|
// export const GET_PRODUCT_BY_ID_QUERY = gql`
|
6
6
|
// query GetProductById(
|
@@ -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
|
@@ -627,3 +629,116 @@ exports.GET_HANDLE_BY_SERVICETYPE = (0, graphql_tag_1.gql) `
|
|
627
629
|
)
|
628
630
|
}
|
629
631
|
`;
|
632
|
+
exports.GET_RESOURCE_BY_PRODUCT = (0, graphql_tag_1.gql) `
|
633
|
+
query getResourceByProduct(
|
634
|
+
$partnerId: String!
|
635
|
+
$storeChannel: String!
|
636
|
+
$productId: String!
|
637
|
+
) {
|
638
|
+
getResourceByProduct(
|
639
|
+
partnerId: $partnerId
|
640
|
+
storeChannel: $storeChannel
|
641
|
+
productId: $productId
|
642
|
+
) {
|
643
|
+
id
|
644
|
+
quantity
|
645
|
+
qualify
|
646
|
+
handle
|
647
|
+
unitDTO {
|
648
|
+
id
|
649
|
+
name
|
650
|
+
}
|
651
|
+
productId
|
652
|
+
productName
|
653
|
+
resourceName
|
654
|
+
resourceUnit
|
655
|
+
price
|
656
|
+
}
|
657
|
+
}
|
658
|
+
`;
|
659
|
+
exports.GET_PRODUCT_VARIANT_BY_ID = (0, graphql_tag_1.gql) `
|
660
|
+
query GetProductVariantById(
|
661
|
+
$partnerId: String!
|
662
|
+
$storeChannel: String!
|
663
|
+
$variantId: String!
|
664
|
+
) {
|
665
|
+
getProductVariantById(
|
666
|
+
partnerId: $partnerId
|
667
|
+
storeChannel: $storeChannel
|
668
|
+
variantId: $variantId
|
669
|
+
) {
|
670
|
+
id
|
671
|
+
title
|
672
|
+
description
|
673
|
+
sku
|
674
|
+
shortDescription
|
675
|
+
subType
|
676
|
+
weight
|
677
|
+
width
|
678
|
+
depth
|
679
|
+
height
|
680
|
+
vat
|
681
|
+
unitDTO {
|
682
|
+
id
|
683
|
+
name
|
684
|
+
}
|
685
|
+
productAttributes {
|
686
|
+
attributeName
|
687
|
+
attributeValue
|
688
|
+
}
|
689
|
+
qualify
|
690
|
+
parentId
|
691
|
+
handle
|
692
|
+
price
|
693
|
+
priceType
|
694
|
+
salePolicy
|
695
|
+
priceTypeName
|
696
|
+
priceVaries
|
697
|
+
available
|
698
|
+
tags
|
699
|
+
options
|
700
|
+
optionsRelationship
|
701
|
+
compareAtPrice
|
702
|
+
featuredImage
|
703
|
+
images
|
704
|
+
variants {
|
705
|
+
id
|
706
|
+
handle
|
707
|
+
title
|
708
|
+
price
|
709
|
+
compareAtPrice
|
710
|
+
options
|
711
|
+
optionsIds
|
712
|
+
featuredImage
|
713
|
+
sku
|
714
|
+
}
|
715
|
+
featureTypes {
|
716
|
+
id
|
717
|
+
name
|
718
|
+
position
|
719
|
+
type
|
720
|
+
subType
|
721
|
+
fill
|
722
|
+
requireData
|
723
|
+
values
|
724
|
+
createStamp
|
725
|
+
createdBy
|
726
|
+
}
|
727
|
+
categories {
|
728
|
+
id
|
729
|
+
title
|
730
|
+
image
|
731
|
+
icon
|
732
|
+
parentId
|
733
|
+
level
|
734
|
+
handle
|
735
|
+
}
|
736
|
+
groups {
|
737
|
+
id
|
738
|
+
name
|
739
|
+
policy
|
740
|
+
image
|
741
|
+
}
|
742
|
+
}
|
743
|
+
}
|
744
|
+
`;
|
@@ -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;
|
@@ -36,4 +36,6 @@ export declare class ProductService extends Service {
|
|
36
36
|
getPolicy(groupId: string): Promise<any>;
|
37
37
|
getProducts(param: getProduct): Promise<any>;
|
38
38
|
getHandleByServiceTypes(serviceTypes: [string]): Promise<any>;
|
39
|
+
getResourceByProduct(productId: string): Promise<any>;
|
40
|
+
getProductVariantById(variantId: string): Promise<any>;
|
39
41
|
}
|
@@ -160,5 +160,41 @@ class ProductService extends serviceSDK_1.Service {
|
|
160
160
|
}
|
161
161
|
});
|
162
162
|
}
|
163
|
+
getResourceByProduct(productId) {
|
164
|
+
return __awaiter(this, void 0, void 0, function* () {
|
165
|
+
const query = queries_1.GET_RESOURCE_BY_PRODUCT;
|
166
|
+
const variablesHandle = {
|
167
|
+
partnerId: this.orgId,
|
168
|
+
storeChannel: this.storeId,
|
169
|
+
productId,
|
170
|
+
};
|
171
|
+
try {
|
172
|
+
const response = yield this.graphqlQueryV2(query, variablesHandle);
|
173
|
+
return response.getResourceByProduct;
|
174
|
+
}
|
175
|
+
catch (error) {
|
176
|
+
console.log(`Error fetching getResourceByProduct error : ${error}`);
|
177
|
+
throw error;
|
178
|
+
}
|
179
|
+
});
|
180
|
+
}
|
181
|
+
getProductVariantById(variantId) {
|
182
|
+
return __awaiter(this, void 0, void 0, function* () {
|
183
|
+
const query = queries_1.GET_PRODUCT_VARIANT_BY_ID;
|
184
|
+
const variablesHandle = {
|
185
|
+
partnerId: this.orgId,
|
186
|
+
storeChannel: this.storeId,
|
187
|
+
variantId,
|
188
|
+
};
|
189
|
+
try {
|
190
|
+
const response = yield this.graphqlQueryV2(query, variablesHandle);
|
191
|
+
return response.getProductVariantById;
|
192
|
+
}
|
193
|
+
catch (error) {
|
194
|
+
console.log(`Error fetching getProductVariantById error : ${error}`);
|
195
|
+
throw error;
|
196
|
+
}
|
197
|
+
});
|
198
|
+
}
|
163
199
|
}
|
164
200
|
exports.ProductService = ProductService;
|