@djust-b2b/djust-front-sdk 1.6.4 → 1.7.0

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/lib/index.d.ts CHANGED
@@ -82,6 +82,7 @@ export declare const DjustSDK: {
82
82
  getProductVariantAttributes({ productIdentifier, productIdType, locale, }: import("./interfaces").GetProductVariantAttributesParameters): Promise<import("./interfaces").GetProductVariantAttributesResponse>;
83
83
  createProductReview({ message, productSku, rating, }: import("./interfaces").CreateProductReviewParameters): Promise<import("./interfaces").CreateProductReviewResponse>;
84
84
  updateProductReview({ productReviewId, message, rating, }: import("./interfaces").UpdateProductReviewParameters): Promise<import("./interfaces").UpdateProductReviewResponse>;
85
+ getProductPaginatedOffers({ productIdentifier, productIdType, currency, locale, withoutPrices, pageable, }: import("./interfaces").GetProductPaginatedOffersParameters): Promise<import("./interfaces").GetProductPaginatedOffersResponse>;
85
86
  getNavigationCategories({ locale, }: import("./interfaces").GetNavigationCategoriesParameters): Promise<import("./interfaces").GetNavigationCategoriesResponse>;
86
87
  getNavigationCategory({ locale, idType, navigationCategoryId, }: import("./interfaces").GetNavigationCategoryParameters): Promise<import("./interfaces").GetNavigationCategoryResponse>;
87
88
  getNavigationCategoryBreadcrumbs({ locale, idType, navigationCategoryId, }: import("./interfaces").GetNavigationCategoryBreadcrumbsParameters): Promise<import("./interfaces").GetNavigationCategoryBreadcrumbsResponse>;
@@ -6,6 +6,7 @@ export interface AttributeValue {
6
6
  }
7
7
  export interface Attribute {
8
8
  id: string;
9
+ externalId: string;
9
10
  name: string;
10
11
  status: string;
11
12
  type: AttributeType;
@@ -4,6 +4,7 @@ import { OfferResponse } from "../../interfaces/models/offer";
4
4
  import { PageProductVariantResponse, Product, ProductAutocomplete, ProductReviewDto, ProductReviewRatings, ProductReviewsSummary, SearchThumbnailsAndAggregation } from "../../interfaces/models/product";
5
5
  import { SearchProduct } from "../../interfaces/models/searchProduct";
6
6
  import { SupplierSimpleView } from "../../interfaces/models/supplier";
7
+ import { Order, PageableObject } from "../../interfaces/models/common";
7
8
  /**
8
9
  * Requests parameters type definitions
9
10
  */
@@ -120,4 +121,25 @@ export interface GetProductVariantOffersResponse extends Array<OfferResponse> {
120
121
  }
121
122
  export interface GetRelatedProductsResponse extends SearchThumbnailsAndAggregation {
122
123
  }
124
+ export interface GetProductPaginatedOffersParameters {
125
+ productIdentifier: string;
126
+ productIdType?: string;
127
+ locale?: string;
128
+ currency?: string;
129
+ withoutPrices?: boolean;
130
+ pageable?: PageableParameters;
131
+ }
132
+ export interface GetProductPaginatedOffersResponse {
133
+ content: OfferResponse[];
134
+ empty: boolean;
135
+ first: boolean;
136
+ last: boolean;
137
+ number: number;
138
+ numberOfElements: number;
139
+ pageable: PageableObject;
140
+ size: number;
141
+ sort: Order[];
142
+ totalElements: number;
143
+ totalPages: number;
144
+ }
123
145
  export {};
@@ -1,4 +1,4 @@
1
- import { CreateProductReviewParameters, CreateProductReviewResponse, GetProductOffersParameters, GetProductOffersResponse, GetProductParameters, GetProductReviewsParameters, GetProductReviewsResponse, GetProductStatReviewsParameters, GetProductStatReviewsResponse, GetProductVariantAttributesParameters, GetProductVariantAttributesResponse, GetProductVariantOffersParameters, GetProductVariantOffersResponse, GetProductVariantSuppliersParameters, GetProductVariantSuppliersResponse, GetProductVariantsListParameters, GetProductVariantsListResponse, GetProductsListParameters, GetProductsListResponse, GetRelatedProductsParameters, AutoCompleteSearchProductsParameters, SearchProductsResponse, UpdateProductReviewParameters, UpdateProductReviewResponse } from "./definitions";
1
+ import { CreateProductReviewParameters, CreateProductReviewResponse, GetProductOffersParameters, GetProductOffersResponse, GetProductParameters, GetProductReviewsParameters, GetProductReviewsResponse, GetProductStatReviewsParameters, GetProductStatReviewsResponse, GetProductVariantAttributesParameters, GetProductVariantAttributesResponse, GetProductVariantOffersParameters, GetProductVariantOffersResponse, GetProductVariantSuppliersParameters, GetProductVariantSuppliersResponse, GetProductVariantsListParameters, GetProductVariantsListResponse, GetProductsListParameters, GetProductsListResponse, GetRelatedProductsParameters, AutoCompleteSearchProductsParameters, SearchProductsResponse, UpdateProductReviewParameters, UpdateProductReviewResponse, GetProductPaginatedOffersParameters, GetProductPaginatedOffersResponse } from "./definitions";
2
2
  /**
3
3
  * Search product with text expression for search and autocomplete
4
4
  */
@@ -51,3 +51,7 @@ export declare function createProductReview({ message, productSku, rating, }: Cr
51
51
  * Update a review for a product
52
52
  */
53
53
  export declare function updateProductReview({ productReviewId, message, rating, }: UpdateProductReviewParameters): Promise<UpdateProductReviewResponse>;
54
+ /**
55
+ * Get paginated offers of a product by sku, id or externalId
56
+ */
57
+ export declare function getProductPaginatedOffers({ productIdentifier, productIdType, currency, locale, withoutPrices, pageable, }: GetProductPaginatedOffersParameters): Promise<GetProductPaginatedOffersResponse>;
@@ -13,6 +13,7 @@ exports.getProductStatReviews = getProductStatReviews;
13
13
  exports.getProductVariantAttributes = getProductVariantAttributes;
14
14
  exports.createProductReview = createProductReview;
15
15
  exports.updateProductReview = updateProductReview;
16
+ exports.getProductPaginatedOffers = getProductPaginatedOffers;
16
17
  const parameters_validation_1 = require("../../helpers/parameters-validation");
17
18
  const fetch_instance_1 = require("../../settings/fetch-instance");
18
19
  /**
@@ -222,3 +223,23 @@ async function updateProductReview({ productReviewId, message, rating, }) {
222
223
  });
223
224
  return data;
224
225
  }
226
+ /**
227
+ * Get paginated offers of a product by sku, id or externalId
228
+ */
229
+ async function getProductPaginatedOffers({ productIdentifier, productIdType, currency, locale, withoutPrices, pageable, }) {
230
+ (0, parameters_validation_1.required)({ productIdentifier, productIdType });
231
+ const { data } = await (0, fetch_instance_1.enhancedFetch)({
232
+ method: "GET",
233
+ path: `/v1/shop/products/${productIdentifier}/paginated-offers`,
234
+ params: {
235
+ productIdType,
236
+ currency,
237
+ locale,
238
+ withoutPrices,
239
+ page: pageable === null || pageable === void 0 ? void 0 : pageable.page,
240
+ size: pageable === null || pageable === void 0 ? void 0 : pageable.size,
241
+ sort: pageable === null || pageable === void 0 ? void 0 : pageable.sort,
242
+ },
243
+ });
244
+ return data;
245
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@djust-b2b/djust-front-sdk",
3
- "version": "1.6.4",
3
+ "version": "1.7.0",
4
4
  "description": "DJUST Front SDK is a versatile JavaScript Software Development Kit (SDK) ",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",