@longvansoftware/storefront-js-client 3.9.4 → 3.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.
- package/dist/src/graphql/product/queries.d.ts +1 -0
- package/dist/src/graphql/product/queries.js +33 -1
- package/dist/src/lib/order/index.d.ts +11 -0
- package/dist/src/lib/order/index.js +17 -0
- package/dist/src/lib/product/index.d.ts +1 -0
- package/dist/src/lib/product/index.js +17 -0
- package/package.json +1 -1
|
@@ -20,3 +20,4 @@ export declare const GET_GROUPS: import("graphql").DocumentNode;
|
|
|
20
20
|
export declare const GET_BRAND: import("graphql").DocumentNode;
|
|
21
21
|
export declare const GET_TAGS: import("graphql").DocumentNode;
|
|
22
22
|
export declare const GET_PRODUCT_BY_GROUPID: import("graphql").DocumentNode;
|
|
23
|
+
export declare const GET_CATEGORY_BY_ID: import("graphql").DocumentNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GET_PRODUCT_BY_GROUPID = exports.GET_TAGS = exports.GET_BRAND = exports.GET_GROUPS = exports.GET_PRODUCT_TEMPLATES = exports.GET_PRODUCT_VARIANT_BY_ID = exports.GET_UNITS = exports.GET_PRODUCT = exports.GET_PRODUCT_IMAGE = exports.GET_DETAIL_STORES = exports.GET_STORES = 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_CATEGORY_BY_ID = exports.GET_PRODUCT_BY_GROUPID = exports.GET_TAGS = exports.GET_BRAND = exports.GET_GROUPS = exports.GET_PRODUCT_TEMPLATES = exports.GET_PRODUCT_VARIANT_BY_ID = exports.GET_UNITS = exports.GET_PRODUCT = exports.GET_PRODUCT_IMAGE = exports.GET_DETAIL_STORES = exports.GET_STORES = 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(
|
|
@@ -832,3 +832,35 @@ exports.GET_PRODUCT_BY_GROUPID = (0, graphql_tag_1.gql) `
|
|
|
832
832
|
}
|
|
833
833
|
}
|
|
834
834
|
`;
|
|
835
|
+
exports.GET_CATEGORY_BY_ID = (0, graphql_tag_1.gql) `
|
|
836
|
+
query GetCategoryById(
|
|
837
|
+
$partnerId: String!
|
|
838
|
+
$storeChannel: String!
|
|
839
|
+
$categoryId: String!
|
|
840
|
+
) {
|
|
841
|
+
getCategoryById(
|
|
842
|
+
partnerId: $partnerId
|
|
843
|
+
storeChannel: $storeChannel
|
|
844
|
+
categoryId: $categoryId
|
|
845
|
+
) {
|
|
846
|
+
id
|
|
847
|
+
title
|
|
848
|
+
image
|
|
849
|
+
icon
|
|
850
|
+
parentId
|
|
851
|
+
level
|
|
852
|
+
handle
|
|
853
|
+
description
|
|
854
|
+
child {
|
|
855
|
+
id
|
|
856
|
+
title
|
|
857
|
+
image
|
|
858
|
+
icon
|
|
859
|
+
parentId
|
|
860
|
+
level
|
|
861
|
+
handle
|
|
862
|
+
description
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
`;
|
|
@@ -539,4 +539,15 @@ export declare class OrderService extends Service {
|
|
|
539
539
|
tooglePaymentMethod(methodCode: string, status: boolean): Promise<any>;
|
|
540
540
|
choosePaymentGatewayForPaymentMethod(methodCode: string, gatewayId: string): Promise<any>;
|
|
541
541
|
addCustomerToOder(orderId: string, customerData: any): Promise<any>;
|
|
542
|
+
updateShippingAddressWithoutLogin(orderId: string, shippingData: {
|
|
543
|
+
name: string;
|
|
544
|
+
phone: string;
|
|
545
|
+
address: string;
|
|
546
|
+
province: string;
|
|
547
|
+
district: string;
|
|
548
|
+
ward: string;
|
|
549
|
+
province_code: string;
|
|
550
|
+
district_code: string;
|
|
551
|
+
ward_code: string;
|
|
552
|
+
}): Promise<any>;
|
|
542
553
|
}
|
|
@@ -1709,5 +1709,22 @@ class OrderService extends serviceSDK_1.Service {
|
|
|
1709
1709
|
}
|
|
1710
1710
|
});
|
|
1711
1711
|
}
|
|
1712
|
+
updateShippingAddressWithoutLogin(orderId, shippingData) {
|
|
1713
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1714
|
+
const endpoint = `/front/orders/express/${this.orgId}/${this.storeId}/${orderId}/shipping-address`;
|
|
1715
|
+
const method = "PUT";
|
|
1716
|
+
try {
|
|
1717
|
+
const response = yield this.restApiCallWithNoToken(endpoint, method, shippingData);
|
|
1718
|
+
console.log("RESPONSE:", response);
|
|
1719
|
+
return response;
|
|
1720
|
+
}
|
|
1721
|
+
catch (error) {
|
|
1722
|
+
if (error.response && error.response.data) {
|
|
1723
|
+
console.error("Backend Error Detail:", JSON.stringify(error.response.data, null, 2));
|
|
1724
|
+
}
|
|
1725
|
+
throw error;
|
|
1726
|
+
}
|
|
1727
|
+
});
|
|
1728
|
+
}
|
|
1712
1729
|
}
|
|
1713
1730
|
exports.OrderService = OrderService;
|
|
@@ -76,4 +76,5 @@ export declare class ProductService extends Service {
|
|
|
76
76
|
CreateProduct(productInputDTO: any): Promise<void>;
|
|
77
77
|
RemoveProduct(productId: string): Promise<any>;
|
|
78
78
|
UpdateProductSubtype(productId: string, subType: string): Promise<any>;
|
|
79
|
+
getCategoryById(categoryId: string): Promise<any>;
|
|
79
80
|
}
|
|
@@ -828,5 +828,22 @@ class ProductService extends serviceSDK_1.Service {
|
|
|
828
828
|
}
|
|
829
829
|
});
|
|
830
830
|
}
|
|
831
|
+
getCategoryById(categoryId) {
|
|
832
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
833
|
+
const query = queries_1.GET_CATEGORY_BY_ID;
|
|
834
|
+
const variables = {
|
|
835
|
+
partnerId: this.orgId,
|
|
836
|
+
storeChannel: this.storeId,
|
|
837
|
+
categoryId: categoryId,
|
|
838
|
+
};
|
|
839
|
+
try {
|
|
840
|
+
const response = yield this.graphqlQuery(query, variables);
|
|
841
|
+
return response.getCategoryById;
|
|
842
|
+
}
|
|
843
|
+
catch (error) {
|
|
844
|
+
throw error;
|
|
845
|
+
}
|
|
846
|
+
});
|
|
847
|
+
}
|
|
831
848
|
}
|
|
832
849
|
exports.ProductService = ProductService;
|