@longvansoftware/storefront-js-client 3.1.6 → 3.1.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.
- package/dist/src/graphql/campaign/queries.js +3 -0
- package/dist/src/graphql/product/queries.d.ts +1 -0
- package/dist/src/graphql/product/queries.js +44 -1
- package/dist/src/lib/campaign/index.d.ts +1 -1
- package/dist/src/lib/campaign/index.js +2 -1
- package/dist/src/lib/product/index.d.ts +1 -0
- package/dist/src/lib/product/index.js +17 -0
- package/package.json +1 -1
|
@@ -365,12 +365,14 @@ exports.SEARCH_PRODUCT_GIFT_PROMOTION_RESPONSE = (0, graphql_tag_1.gql) `
|
|
|
365
365
|
query SearchProductGiftPromotionResponse(
|
|
366
366
|
$partyId: String!
|
|
367
367
|
$storeId: String
|
|
368
|
+
$productIds: [String]
|
|
368
369
|
$campaignActionId: String
|
|
369
370
|
) {
|
|
370
371
|
searchProductGiftPromotionResponse(
|
|
371
372
|
parameterSearchProductGift: {
|
|
372
373
|
partyId: $partyId
|
|
373
374
|
storeId: $storeId
|
|
375
|
+
productIds: $productIds
|
|
374
376
|
campaignActionId: $campaignActionId
|
|
375
377
|
}
|
|
376
378
|
) {
|
|
@@ -392,6 +394,7 @@ exports.SEARCH_PRODUCT_GIFT_PROMOTION_RESPONSE = (0, graphql_tag_1.gql) `
|
|
|
392
394
|
quantityLimit
|
|
393
395
|
campaignActionName
|
|
394
396
|
startDate
|
|
397
|
+
productParentId
|
|
395
398
|
endDate
|
|
396
399
|
newCustomer
|
|
397
400
|
createdStamp
|
|
@@ -14,3 +14,4 @@ export declare const GET_DETAIL_STORES: import("graphql").DocumentNode;
|
|
|
14
14
|
export declare const GET_PRODUCT_IMAGE: import("graphql").DocumentNode;
|
|
15
15
|
export declare const GET_PRODUCT: import("graphql").DocumentNode;
|
|
16
16
|
export declare const GET_UNITS: import("graphql").DocumentNode;
|
|
17
|
+
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_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_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(
|
|
@@ -577,3 +577,46 @@ exports.GET_UNITS = (0, graphql_tag_1.gql) `
|
|
|
577
577
|
}
|
|
578
578
|
}
|
|
579
579
|
`;
|
|
580
|
+
exports.GET_PRODUCT_VARIANT_BY_ID = (0, graphql_tag_1.gql) `
|
|
581
|
+
query GetProductVariantById(
|
|
582
|
+
$partnerId: String!
|
|
583
|
+
$storeChannel: String!
|
|
584
|
+
$variantId: String!
|
|
585
|
+
) {
|
|
586
|
+
getProductVariantById(
|
|
587
|
+
partnerId: $partnerId
|
|
588
|
+
storeChannel: $storeChannel
|
|
589
|
+
variantId: $variantId
|
|
590
|
+
) {
|
|
591
|
+
id
|
|
592
|
+
title
|
|
593
|
+
subType
|
|
594
|
+
description
|
|
595
|
+
sku
|
|
596
|
+
shortDescription
|
|
597
|
+
weight
|
|
598
|
+
width
|
|
599
|
+
depth
|
|
600
|
+
height
|
|
601
|
+
vat
|
|
602
|
+
qualify
|
|
603
|
+
parentId
|
|
604
|
+
handle
|
|
605
|
+
price
|
|
606
|
+
displayPrice
|
|
607
|
+
hint
|
|
608
|
+
compareAtPrices
|
|
609
|
+
priceUnit
|
|
610
|
+
priceQuantity
|
|
611
|
+
priceType
|
|
612
|
+
salePolicy
|
|
613
|
+
priceTypeName
|
|
614
|
+
priceVaries
|
|
615
|
+
available
|
|
616
|
+
tags
|
|
617
|
+
options
|
|
618
|
+
optionsRelationship
|
|
619
|
+
compareAtPrice
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
`;
|
|
@@ -16,5 +16,5 @@ export declare class CampaignService extends Service {
|
|
|
16
16
|
addCustomerToVoucher(voucherCode: string, userId: string, affiliateId: string): Promise<any>;
|
|
17
17
|
suggestVoucher(customerId: string): Promise<any>;
|
|
18
18
|
getCampaignActionById(id: string): Promise<any>;
|
|
19
|
-
searchProductGiftPromotionResponse(campaignActionId: string): Promise<any>;
|
|
19
|
+
searchProductGiftPromotionResponse(productIds: string[], campaignActionId: string): Promise<any>;
|
|
20
20
|
}
|
|
@@ -192,12 +192,13 @@ class CampaignService extends serviceSDK_1.Service {
|
|
|
192
192
|
}
|
|
193
193
|
});
|
|
194
194
|
}
|
|
195
|
-
searchProductGiftPromotionResponse(campaignActionId) {
|
|
195
|
+
searchProductGiftPromotionResponse(productIds, campaignActionId) {
|
|
196
196
|
return __awaiter(this, void 0, void 0, function* () {
|
|
197
197
|
const query = queries_1.SEARCH_PRODUCT_GIFT_PROMOTION_RESPONSE;
|
|
198
198
|
const variables = {
|
|
199
199
|
partyId: this.orgId,
|
|
200
200
|
storeId: this.storeId,
|
|
201
|
+
productIds: productIds,
|
|
201
202
|
campaignActionId: campaignActionId,
|
|
202
203
|
};
|
|
203
204
|
try {
|
|
@@ -365,5 +365,22 @@ class ProductService extends serviceSDK_1.Service {
|
|
|
365
365
|
}
|
|
366
366
|
});
|
|
367
367
|
}
|
|
368
|
+
getProductVariantById(variantId) {
|
|
369
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
370
|
+
const query = queries_1.GET_PRODUCT_VARIANT_BY_ID;
|
|
371
|
+
const variables = {
|
|
372
|
+
partnerId: this.orgId,
|
|
373
|
+
storeChannel: this.storeId,
|
|
374
|
+
variantId,
|
|
375
|
+
};
|
|
376
|
+
try {
|
|
377
|
+
const response = yield this.graphqlQuery(query, variables);
|
|
378
|
+
return response.getProductVariantById;
|
|
379
|
+
}
|
|
380
|
+
catch (error) {
|
|
381
|
+
throw error;
|
|
382
|
+
}
|
|
383
|
+
});
|
|
384
|
+
}
|
|
368
385
|
}
|
|
369
386
|
exports.ProductService = ProductService;
|