@longvansoftware/storefront-js-client 3.5.7 → 3.5.8
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.
|
@@ -19,3 +19,4 @@ export declare const CREATE_GROUP: import("graphql").DocumentNode;
|
|
|
19
19
|
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
|
+
export declare const CREATE_PRODUCT_IMAGES: import("graphql").DocumentNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
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.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(
|
|
@@ -381,6 +381,7 @@ exports.CREATE_PRODUCT_VARIANT = (0, graphql_tag_1.gql) `
|
|
|
381
381
|
featureIds
|
|
382
382
|
brandId
|
|
383
383
|
variant
|
|
384
|
+
price
|
|
384
385
|
parentId
|
|
385
386
|
attributeDTOS {
|
|
386
387
|
id
|
|
@@ -513,3 +514,21 @@ exports.CREATE_UNIT = (0, graphql_tag_1.gql) `
|
|
|
513
514
|
}
|
|
514
515
|
}
|
|
515
516
|
`;
|
|
517
|
+
exports.CREATE_PRODUCT_IMAGES = (0, graphql_tag_1.gql) `
|
|
518
|
+
mutation CreateProductImages(
|
|
519
|
+
$partnerId: String!
|
|
520
|
+
$productId: String!
|
|
521
|
+
$createdBy: String!
|
|
522
|
+
$imageDTO: ImageDTOInput
|
|
523
|
+
) {
|
|
524
|
+
createProductImages(
|
|
525
|
+
partnerId: $partnerId
|
|
526
|
+
productId: $productId
|
|
527
|
+
createdBy: $createdBy
|
|
528
|
+
imageDTO: $imageDTO
|
|
529
|
+
) {
|
|
530
|
+
mainImage
|
|
531
|
+
images
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
`;
|
|
@@ -67,4 +67,5 @@ export declare class ProductService extends Service {
|
|
|
67
67
|
createCategory(name: string, createdBy: string): Promise<any>;
|
|
68
68
|
createBrand(brandName: string, createdBy: string): Promise<any>;
|
|
69
69
|
createUnit(name: string): Promise<any>;
|
|
70
|
+
createProductImages(productId: string, createdBy: string, imageDTO: any): Promise<any>;
|
|
70
71
|
}
|
|
@@ -681,5 +681,23 @@ class ProductService extends serviceSDK_1.Service {
|
|
|
681
681
|
}
|
|
682
682
|
});
|
|
683
683
|
}
|
|
684
|
+
createProductImages(productId, createdBy, imageDTO) {
|
|
685
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
686
|
+
const mutations = mutations_1.CREATE_PRODUCT_IMAGES;
|
|
687
|
+
const variables = {
|
|
688
|
+
partnerId: this.orgId,
|
|
689
|
+
productId,
|
|
690
|
+
createdBy,
|
|
691
|
+
imageDTO
|
|
692
|
+
};
|
|
693
|
+
try {
|
|
694
|
+
const response = yield this.graphqlMutation(mutations, variables);
|
|
695
|
+
return response.createProductImages;
|
|
696
|
+
}
|
|
697
|
+
catch (error) {
|
|
698
|
+
throw error;
|
|
699
|
+
}
|
|
700
|
+
});
|
|
701
|
+
}
|
|
684
702
|
}
|
|
685
703
|
exports.ProductService = ProductService;
|