@longvansoftware/storefront-js-client 3.5.9 → 3.6.1
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/mutations.d.ts +2 -0
- package/dist/src/graphql/product/mutations.js +28 -3
- package/dist/src/lib/order/index.d.ts +2 -0
- package/dist/src/lib/order/index.js +26 -0
- package/dist/src/lib/product/index.d.ts +2 -0
- package/dist/src/lib/product/index.js +33 -1
- package/package.json +1 -1
|
@@ -20,3 +20,5 @@ export declare const CREATE_CATEGORY: import("graphql").DocumentNode;
|
|
|
20
20
|
export declare const CREATE_BRAND: import("graphql").DocumentNode;
|
|
21
21
|
export declare const CREATE_UNIT: import("graphql").DocumentNode;
|
|
22
22
|
export declare const CREATE_PRODUCT_IMAGES: import("graphql").DocumentNode;
|
|
23
|
+
export declare const BUILD_PRODUCT_PREBUILD_BY_PRODUCT: import("graphql").DocumentNode;
|
|
24
|
+
export declare const BUILD_PRODUCT_PREBUILD_BY_STORE: import("graphql").DocumentNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CREATE_PRODUCT_IMAGES = exports.CREATE_UNIT = exports.CREATE_BRAND = exports.CREATE_CATEGORY = exports.CREATE_GROUP = exports.UPDATE_PRODUCT_VAT = exports.UPDATE_PRODUCT_SKU = exports.CREATE_PRODUCT_VARIANT = exports.REMOVE_PRODUCT_ATTRIBUTE = exports.UPDATE_PRODUCT_ATTRIBUTE = exports.UPDATE_PRODUCT_BRAND = exports.SAVE_PRODUCT_DRAFT = exports.ADD_PRODUCT_ATTRIBUTE = exports.CREATE_PRODUCT_FROM_TEMPLATE = exports.CREATE_PRODUCT_TEMPLATES_BY_PARTNER = exports.CLEAR_ALL_CACHES = exports.UPDATE_UNIT = exports.UPDATE_SHORT_DESCRIPTION = exports.UPDATE_CATEGORY = exports.UPDATE_PRICE_PROMOTION = exports.UPDATE_PRICE = exports.UPDATE_PRODUCT_TITLE = void 0;
|
|
3
|
+
exports.BUILD_PRODUCT_PREBUILD_BY_STORE = exports.BUILD_PRODUCT_PREBUILD_BY_PRODUCT = exports.CREATE_PRODUCT_IMAGES = exports.CREATE_UNIT = exports.CREATE_BRAND = exports.CREATE_CATEGORY = exports.CREATE_GROUP = exports.UPDATE_PRODUCT_VAT = exports.UPDATE_PRODUCT_SKU = exports.CREATE_PRODUCT_VARIANT = exports.REMOVE_PRODUCT_ATTRIBUTE = exports.UPDATE_PRODUCT_ATTRIBUTE = exports.UPDATE_PRODUCT_BRAND = exports.SAVE_PRODUCT_DRAFT = exports.ADD_PRODUCT_ATTRIBUTE = exports.CREATE_PRODUCT_FROM_TEMPLATE = exports.CREATE_PRODUCT_TEMPLATES_BY_PARTNER = exports.CLEAR_ALL_CACHES = exports.UPDATE_UNIT = exports.UPDATE_SHORT_DESCRIPTION = exports.UPDATE_CATEGORY = exports.UPDATE_PRICE_PROMOTION = exports.UPDATE_PRICE = exports.UPDATE_PRODUCT_TITLE = void 0;
|
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
|
5
5
|
exports.UPDATE_PRODUCT_TITLE = (0, graphql_tag_1.gql) `
|
|
6
6
|
mutation UpdateProductTitle(
|
|
@@ -527,8 +527,33 @@ exports.CREATE_PRODUCT_IMAGES = (0, graphql_tag_1.gql) `
|
|
|
527
527
|
createdBy: $createdBy
|
|
528
528
|
imageDTO: $imageDTO
|
|
529
529
|
) {
|
|
530
|
-
|
|
531
|
-
|
|
530
|
+
status
|
|
531
|
+
message
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
`;
|
|
535
|
+
exports.BUILD_PRODUCT_PREBUILD_BY_PRODUCT = (0, graphql_tag_1.gql) `
|
|
536
|
+
mutation BuildProductPreBuildByProduct(
|
|
537
|
+
$partnerId: String!
|
|
538
|
+
$productId: String!
|
|
539
|
+
) {
|
|
540
|
+
buildProductPreBuildByProduct(
|
|
541
|
+
partnerId: $partnerId
|
|
542
|
+
productId: $productId
|
|
543
|
+
) {
|
|
544
|
+
status
|
|
545
|
+
message
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
`;
|
|
549
|
+
exports.BUILD_PRODUCT_PREBUILD_BY_STORE = (0, graphql_tag_1.gql) `
|
|
550
|
+
mutation BuildProductPreBuildByStore(
|
|
551
|
+
$partnerId: String!
|
|
552
|
+
$storeIds: [String]!
|
|
553
|
+
) {
|
|
554
|
+
buildProductPreBuildByStore(partnerId: $partnerId, storeIds: $storeIds) {
|
|
555
|
+
status
|
|
556
|
+
message
|
|
532
557
|
}
|
|
533
558
|
}
|
|
534
559
|
`;
|
|
@@ -500,6 +500,7 @@ export declare class OrderService extends Service {
|
|
|
500
500
|
* @throws If an error occurs while creating the order.
|
|
501
501
|
*/
|
|
502
502
|
reportByDetail(employee_assign: string, type_view: string, date_from: number, date_to: number): Promise<any>;
|
|
503
|
+
reportByDetailV2(employee_assign: string, type_view: string, date_from: number, date_to: number, storeId: string): Promise<any>;
|
|
503
504
|
/**
|
|
504
505
|
* report by store
|
|
505
506
|
* @param date_from
|
|
@@ -508,6 +509,7 @@ export declare class OrderService extends Service {
|
|
|
508
509
|
* @throws If an error occurs while creating the order.
|
|
509
510
|
*/
|
|
510
511
|
reporByStores(date_from: number, date_to: number): Promise<any>;
|
|
512
|
+
reporByStoresV2(date_from: number, date_to: number, storeId: string): Promise<any>;
|
|
511
513
|
updateExchangeOrder(exchangeOrder: string, returnOrder: string, sellOrder: string): Promise<any>;
|
|
512
514
|
removeShippingAddress(orderId: string, updateBy: string): Promise<any>;
|
|
513
515
|
removeShippingInfo(orderId: string, updateBy: string): Promise<any>;
|
|
@@ -1475,6 +1475,19 @@ class OrderService extends serviceSDK_1.Service {
|
|
|
1475
1475
|
}
|
|
1476
1476
|
});
|
|
1477
1477
|
}
|
|
1478
|
+
reportByDetailV2(employee_assign, type_view, date_from, date_to, storeId) {
|
|
1479
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1480
|
+
const endpoint = `/orders/${this.orgId}/${storeId}/${employee_assign}/reportByDetail?type_view=${type_view}&date_from=${date_from}&date_to=${date_to}`;
|
|
1481
|
+
const method = "GET";
|
|
1482
|
+
try {
|
|
1483
|
+
const response = yield this.restApiCallWithToken(endpoint, method);
|
|
1484
|
+
return response;
|
|
1485
|
+
}
|
|
1486
|
+
catch (error) {
|
|
1487
|
+
throw error;
|
|
1488
|
+
}
|
|
1489
|
+
});
|
|
1490
|
+
}
|
|
1478
1491
|
/**
|
|
1479
1492
|
* report by store
|
|
1480
1493
|
* @param date_from
|
|
@@ -1495,6 +1508,19 @@ class OrderService extends serviceSDK_1.Service {
|
|
|
1495
1508
|
}
|
|
1496
1509
|
});
|
|
1497
1510
|
}
|
|
1511
|
+
reporByStoresV2(date_from, date_to, storeId) {
|
|
1512
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1513
|
+
const endpoint = `/orders/${this.orgId}/${storeId}/reportByStores?date_from=${date_from}&date_to=${date_to}`;
|
|
1514
|
+
const method = "GET";
|
|
1515
|
+
try {
|
|
1516
|
+
const response = yield this.restApiCallWithToken(endpoint, method);
|
|
1517
|
+
return response;
|
|
1518
|
+
}
|
|
1519
|
+
catch (error) {
|
|
1520
|
+
throw error;
|
|
1521
|
+
}
|
|
1522
|
+
});
|
|
1523
|
+
}
|
|
1498
1524
|
updateExchangeOrder(exchangeOrder, returnOrder, sellOrder) {
|
|
1499
1525
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1500
1526
|
const endpoint = `/orders/${this.orgId}/${exchangeOrder}/${returnOrder}/${sellOrder}/updateExchangeOrder`;
|
|
@@ -68,4 +68,6 @@ export declare class ProductService extends Service {
|
|
|
68
68
|
createBrand(brandName: string, createdBy: string): Promise<any>;
|
|
69
69
|
createUnit(name: string): Promise<any>;
|
|
70
70
|
createProductImages(productId: string, createdBy: string, imageDTO: any): Promise<any>;
|
|
71
|
+
buildProductPreBuildByProduct(productId: string): Promise<any>;
|
|
72
|
+
buildProductPreBuildByStore(storeIds: [string]): Promise<any>;
|
|
71
73
|
}
|
|
@@ -688,7 +688,7 @@ class ProductService extends serviceSDK_1.Service {
|
|
|
688
688
|
partnerId: this.orgId,
|
|
689
689
|
productId,
|
|
690
690
|
createdBy,
|
|
691
|
-
imageDTO
|
|
691
|
+
imageDTO,
|
|
692
692
|
};
|
|
693
693
|
try {
|
|
694
694
|
const response = yield this.graphqlMutation(mutations, variables);
|
|
@@ -699,5 +699,37 @@ class ProductService extends serviceSDK_1.Service {
|
|
|
699
699
|
}
|
|
700
700
|
});
|
|
701
701
|
}
|
|
702
|
+
buildProductPreBuildByProduct(productId) {
|
|
703
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
704
|
+
const mutation = mutations_1.BUILD_PRODUCT_PREBUILD_BY_PRODUCT;
|
|
705
|
+
const variables = {
|
|
706
|
+
partnerId: this.orgId,
|
|
707
|
+
productId,
|
|
708
|
+
};
|
|
709
|
+
try {
|
|
710
|
+
const response = yield this.graphqlMutation(mutation, variables);
|
|
711
|
+
return response.buildProductPreBuildByProduct;
|
|
712
|
+
}
|
|
713
|
+
catch (error) {
|
|
714
|
+
throw error;
|
|
715
|
+
}
|
|
716
|
+
});
|
|
717
|
+
}
|
|
718
|
+
buildProductPreBuildByStore(storeIds) {
|
|
719
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
720
|
+
const mutation = mutations_1.BUILD_PRODUCT_PREBUILD_BY_STORE;
|
|
721
|
+
const variables = {
|
|
722
|
+
partnerId: this.orgId,
|
|
723
|
+
storeIds,
|
|
724
|
+
};
|
|
725
|
+
try {
|
|
726
|
+
const response = yield this.graphqlMutation(mutation, variables);
|
|
727
|
+
return response.buildProductPreBuildByStore;
|
|
728
|
+
}
|
|
729
|
+
catch (error) {
|
|
730
|
+
throw error;
|
|
731
|
+
}
|
|
732
|
+
});
|
|
733
|
+
}
|
|
702
734
|
}
|
|
703
735
|
exports.ProductService = ProductService;
|