@plentymarkets/shop-api 0.168.1 → 0.170.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/api/__tests__/unit/doAddShopLogs.unit.spec.d.ts +2 -0
- package/lib/api/__tests__/unit/doAddShopLogs.unit.spec.d.ts.map +1 -0
- package/lib/api/doAddShopLogs/index.d.ts +36 -0
- package/lib/api/doAddShopLogs/index.d.ts.map +1 -0
- package/lib/api/index.d.ts +1 -0
- package/lib/api/index.d.ts.map +1 -1
- package/lib/getters/additionalInformationGetters.d.ts.map +1 -1
- package/lib/getters/bannerGetters.d.ts +40 -0
- package/lib/getters/bannerGetters.d.ts.map +1 -1
- package/lib/getters/barcodeGetters.d.ts +35 -0
- package/lib/getters/barcodeGetters.d.ts.map +1 -1
- package/lib/getters/breadcrumbGetters.d.ts +10 -0
- package/lib/getters/breadcrumbGetters.d.ts.map +1 -1
- package/lib/getters/cartGetters.d.ts +250 -0
- package/lib/getters/cartGetters.d.ts.map +1 -1
- package/lib/getters/categoryEntryGetters.d.ts +75 -0
- package/lib/getters/categoryEntryGetters.d.ts.map +1 -1
- package/lib/getters/categoryGetters.d.ts +81 -1
- package/lib/getters/categoryGetters.d.ts.map +1 -1
- package/lib/getters/categoryTreeGetters.d.ts +98 -0
- package/lib/getters/categoryTreeGetters.d.ts.map +1 -1
- package/lib/getters/companyGetters.d.ts +20 -0
- package/lib/getters/companyGetters.d.ts.map +1 -1
- package/lib/getters/cookieBarGetters.d.ts +40 -0
- package/lib/getters/cookieBarGetters.d.ts.map +1 -1
- package/lib/getters/countryGetters.d.ts +42 -0
- package/lib/getters/countryGetters.d.ts.map +1 -1
- package/lib/getters/facetGetters.d.ts +61 -0
- package/lib/getters/facetGetters.d.ts.map +1 -1
- package/lib/getters/forgotPasswordGetters.d.ts +10 -0
- package/lib/getters/forgotPasswordGetters.d.ts.map +1 -1
- package/lib/getters/heroesGetters.d.ts +25 -0
- package/lib/getters/heroesGetters.d.ts.map +1 -1
- package/lib/getters/itemSearchAutocompleteGetters.d.ts.map +1 -1
- package/lib/getters/legalGetters.d.ts +5 -0
- package/lib/getters/legalGetters.d.ts.map +1 -1
- package/lib/getters/localesGetters.d.ts +10 -0
- package/lib/getters/localesGetters.d.ts.map +1 -1
- package/lib/getters/manufacturerGetters.d.ts +120 -0
- package/lib/getters/manufacturerGetters.d.ts.map +1 -1
- package/lib/getters/offerGetters.d.ts +78 -0
- package/lib/getters/offerGetters.d.ts.map +1 -1
- package/lib/getters/orderConfirmationGetters.d.ts.map +1 -1
- package/lib/getters/orderDocumentGetters.d.ts +10 -0
- package/lib/getters/orderDocumentGetters.d.ts.map +1 -1
- package/lib/getters/orderGetters.d.ts +567 -0
- package/lib/getters/orderGetters.d.ts.map +1 -1
- package/lib/getters/paginationGetters.d.ts +15 -0
- package/lib/getters/paginationGetters.d.ts.map +1 -1
- package/lib/getters/paymentProviderGetters.d.ts +54 -0
- package/lib/getters/paymentProviderGetters.d.ts.map +1 -1
- package/lib/getters/paypalGetters.d.ts +15 -0
- package/lib/getters/paypalGetters.d.ts.map +1 -1
- package/lib/getters/productAttributeGetters.d.ts +53 -0
- package/lib/getters/productAttributeGetters.d.ts.map +1 -1
- package/lib/getters/productBundleGetters.d.ts +49 -0
- package/lib/getters/productBundleGetters.d.ts.map +1 -1
- package/lib/getters/productGetters.d.ts +366 -0
- package/lib/getters/productGetters.d.ts.map +1 -1
- package/lib/getters/productImageGetters.d.ts +50 -0
- package/lib/getters/productImageGetters.d.ts.map +1 -1
- package/lib/getters/productPriceGetters.d.ts.map +1 -1
- package/lib/getters/productPropertyGetters.d.ts +268 -0
- package/lib/getters/productPropertyGetters.d.ts.map +1 -1
- package/lib/getters/productSeoSettingsGetters.d.ts +95 -0
- package/lib/getters/productSeoSettingsGetters.d.ts.map +1 -1
- package/lib/getters/returnGetters.d.ts +111 -0
- package/lib/getters/returnGetters.d.ts.map +1 -1
- package/lib/getters/reviewGetters.d.ts +110 -0
- package/lib/getters/reviewGetters.d.ts.map +1 -1
- package/lib/getters/robotGetters.d.ts +45 -0
- package/lib/getters/robotGetters.d.ts.map +1 -1
- package/lib/getters/shippingProviderGetters.d.ts +45 -0
- package/lib/getters/shippingProviderGetters.d.ts.map +1 -1
- package/lib/getters/tagGetters.d.ts +31 -0
- package/lib/getters/tagGetters.d.ts.map +1 -1
- package/lib/getters/userAddressGetters.d.ts +111 -0
- package/lib/getters/userAddressGetters.d.ts.map +1 -1
- package/lib/getters/userGetters.d.ts +25 -0
- package/lib/getters/userGetters.d.ts.map +1 -1
- package/lib/getters/wishlistGetters.d.ts +83 -0
- package/lib/getters/wishlistGetters.d.ts.map +1 -1
- package/lib/index.cjs.js +3381 -21
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.es.js +3381 -22
- package/lib/index.es.js.map +1 -1
- package/lib/types/api/breadcrumbs.d.ts +1 -0
- package/lib/types/api/breadcrumbs.d.ts.map +1 -1
- package/lib/types/api/category.d.ts +7 -0
- package/lib/types/api/category.d.ts.map +1 -1
- package/lib/types/api/index.d.ts +1 -0
- package/lib/types/api/index.d.ts.map +1 -1
- package/lib/types/api/logs.d.ts +12 -0
- package/lib/types/api/logs.d.ts.map +1 -0
- package/package.json +3 -3
- package/server/api/__tests__/unit/doAddShopLogs.unit.spec.d.ts +2 -0
- package/server/api/__tests__/unit/doAddShopLogs.unit.spec.d.ts.map +1 -0
- package/server/api/doAddShopLogs/index.d.ts +36 -0
- package/server/api/doAddShopLogs/index.d.ts.map +1 -0
- package/server/api/index.d.ts +1 -0
- package/server/api/index.d.ts.map +1 -1
- package/server/getters/additionalInformationGetters.d.ts.map +1 -1
- package/server/getters/bannerGetters.d.ts +40 -0
- package/server/getters/bannerGetters.d.ts.map +1 -1
- package/server/getters/barcodeGetters.d.ts +35 -0
- package/server/getters/barcodeGetters.d.ts.map +1 -1
- package/server/getters/breadcrumbGetters.d.ts +10 -0
- package/server/getters/breadcrumbGetters.d.ts.map +1 -1
- package/server/getters/cartGetters.d.ts +250 -0
- package/server/getters/cartGetters.d.ts.map +1 -1
- package/server/getters/categoryEntryGetters.d.ts +75 -0
- package/server/getters/categoryEntryGetters.d.ts.map +1 -1
- package/server/getters/categoryGetters.d.ts +81 -1
- package/server/getters/categoryGetters.d.ts.map +1 -1
- package/server/getters/categoryTreeGetters.d.ts +98 -0
- package/server/getters/categoryTreeGetters.d.ts.map +1 -1
- package/server/getters/companyGetters.d.ts +20 -0
- package/server/getters/companyGetters.d.ts.map +1 -1
- package/server/getters/cookieBarGetters.d.ts +40 -0
- package/server/getters/cookieBarGetters.d.ts.map +1 -1
- package/server/getters/countryGetters.d.ts +42 -0
- package/server/getters/countryGetters.d.ts.map +1 -1
- package/server/getters/facetGetters.d.ts +61 -0
- package/server/getters/facetGetters.d.ts.map +1 -1
- package/server/getters/forgotPasswordGetters.d.ts +10 -0
- package/server/getters/forgotPasswordGetters.d.ts.map +1 -1
- package/server/getters/heroesGetters.d.ts +25 -0
- package/server/getters/heroesGetters.d.ts.map +1 -1
- package/server/getters/itemSearchAutocompleteGetters.d.ts.map +1 -1
- package/server/getters/legalGetters.d.ts +5 -0
- package/server/getters/legalGetters.d.ts.map +1 -1
- package/server/getters/localesGetters.d.ts +10 -0
- package/server/getters/localesGetters.d.ts.map +1 -1
- package/server/getters/manufacturerGetters.d.ts +120 -0
- package/server/getters/manufacturerGetters.d.ts.map +1 -1
- package/server/getters/offerGetters.d.ts +78 -0
- package/server/getters/offerGetters.d.ts.map +1 -1
- package/server/getters/orderConfirmationGetters.d.ts.map +1 -1
- package/server/getters/orderDocumentGetters.d.ts +10 -0
- package/server/getters/orderDocumentGetters.d.ts.map +1 -1
- package/server/getters/orderGetters.d.ts +567 -0
- package/server/getters/orderGetters.d.ts.map +1 -1
- package/server/getters/paginationGetters.d.ts +15 -0
- package/server/getters/paginationGetters.d.ts.map +1 -1
- package/server/getters/paymentProviderGetters.d.ts +54 -0
- package/server/getters/paymentProviderGetters.d.ts.map +1 -1
- package/server/getters/paypalGetters.d.ts +15 -0
- package/server/getters/paypalGetters.d.ts.map +1 -1
- package/server/getters/productAttributeGetters.d.ts +53 -0
- package/server/getters/productAttributeGetters.d.ts.map +1 -1
- package/server/getters/productBundleGetters.d.ts +49 -0
- package/server/getters/productBundleGetters.d.ts.map +1 -1
- package/server/getters/productGetters.d.ts +366 -0
- package/server/getters/productGetters.d.ts.map +1 -1
- package/server/getters/productImageGetters.d.ts +50 -0
- package/server/getters/productImageGetters.d.ts.map +1 -1
- package/server/getters/productPriceGetters.d.ts.map +1 -1
- package/server/getters/productPropertyGetters.d.ts +268 -0
- package/server/getters/productPropertyGetters.d.ts.map +1 -1
- package/server/getters/productSeoSettingsGetters.d.ts +95 -0
- package/server/getters/productSeoSettingsGetters.d.ts.map +1 -1
- package/server/getters/returnGetters.d.ts +111 -0
- package/server/getters/returnGetters.d.ts.map +1 -1
- package/server/getters/reviewGetters.d.ts +110 -0
- package/server/getters/reviewGetters.d.ts.map +1 -1
- package/server/getters/robotGetters.d.ts +45 -0
- package/server/getters/robotGetters.d.ts.map +1 -1
- package/server/getters/shippingProviderGetters.d.ts +45 -0
- package/server/getters/shippingProviderGetters.d.ts.map +1 -1
- package/server/getters/tagGetters.d.ts +31 -0
- package/server/getters/tagGetters.d.ts.map +1 -1
- package/server/getters/userAddressGetters.d.ts +111 -0
- package/server/getters/userAddressGetters.d.ts.map +1 -1
- package/server/getters/userGetters.d.ts +25 -0
- package/server/getters/userGetters.d.ts.map +1 -1
- package/server/getters/wishlistGetters.d.ts +83 -0
- package/server/getters/wishlistGetters.d.ts.map +1 -1
- package/server/index.js +39 -0
- package/server/index.js.map +1 -1
- package/server/types/api/breadcrumbs.d.ts +1 -0
- package/server/types/api/breadcrumbs.d.ts.map +1 -1
- package/server/types/api/category.d.ts +7 -0
- package/server/types/api/category.d.ts.map +1 -1
- package/server/types/api/index.d.ts +1 -0
- package/server/types/api/index.d.ts.map +1 -1
- package/server/types/api/logs.d.ts +12 -0
- package/server/types/api/logs.d.ts.map +1 -0
|
@@ -1,75 +1,441 @@
|
|
|
1
1
|
import { AgnosticImage, ProductAttributeValue } from './agnostic';
|
|
2
2
|
import type { CategoryTreeItem, Product, VariationMapProductVariation, VariationProperty, VariationPropertyGroup, ImagesData, Manufacturer, Barcode, ProductGroupedAttribute } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Returns the primary name (`name1`) of the product.
|
|
5
|
+
* @param product - The product object.
|
|
6
|
+
* @returns The primary product name, or an empty string if not set.
|
|
7
|
+
*/
|
|
3
8
|
declare function getName(product: Product): string;
|
|
9
|
+
/**
|
|
10
|
+
* Returns the secondary name (`name2`) of the product.
|
|
11
|
+
* @param product - The product object.
|
|
12
|
+
* @returns The secondary product name, or an empty string if not set.
|
|
13
|
+
*/
|
|
14
|
+
declare function getName2(product: Product): string;
|
|
15
|
+
/**
|
|
16
|
+
* Returns the tertiary name (`name3`) of the product.
|
|
17
|
+
* @param product - The product object.
|
|
18
|
+
* @returns The tertiary product name, or an empty string if not set.
|
|
19
|
+
*/
|
|
20
|
+
declare function getName3(product: Product): string;
|
|
21
|
+
/**
|
|
22
|
+
* Returns the URL slug (last segment of the URL path) of the product.
|
|
23
|
+
* @param product - The product object.
|
|
24
|
+
* @returns The slug string, or an empty string if not set.
|
|
25
|
+
*/
|
|
4
26
|
declare function getSlug(product: Product): string;
|
|
27
|
+
/**
|
|
28
|
+
* Returns the full URL path of the product.
|
|
29
|
+
* @param product - The product object.
|
|
30
|
+
* @returns The URL path string, or an empty string if not set.
|
|
31
|
+
*/
|
|
5
32
|
declare function getUrlPath(product: Product): string;
|
|
33
|
+
/**
|
|
34
|
+
* Returns the minimum order quantity for the product variation.
|
|
35
|
+
* @param product - The product object.
|
|
36
|
+
* @returns The minimum order quantity, defaulting to `1`.
|
|
37
|
+
*/
|
|
6
38
|
declare function getMinimumOrderQuantity(product: Product): number;
|
|
39
|
+
/**
|
|
40
|
+
* Returns the image gallery for the product.
|
|
41
|
+
* Prefers variation-specific images; falls back to all item images.
|
|
42
|
+
* @param product - The product object.
|
|
43
|
+
* @returns An array of image data objects, or an empty array if the product is not defined.
|
|
44
|
+
*/
|
|
7
45
|
declare function getGallery(product: Product): ImagesData[] | [];
|
|
46
|
+
/**
|
|
47
|
+
* Returns the width of the first gallery image in pixels.
|
|
48
|
+
* @param product - The product object.
|
|
49
|
+
* @returns The image width, or `0` if not set.
|
|
50
|
+
*/
|
|
8
51
|
declare function getImageWidth(product: Product): number;
|
|
52
|
+
/**
|
|
53
|
+
* Returns the height of the first gallery image in pixels.
|
|
54
|
+
* @param product - The product object.
|
|
55
|
+
* @returns The image height, or `0` if not set.
|
|
56
|
+
*/
|
|
9
57
|
declare function getImageHeight(product: Product): number;
|
|
58
|
+
/**
|
|
59
|
+
* Returns the URL path for the product's primary default category.
|
|
60
|
+
* @param product - The product object.
|
|
61
|
+
* @param categories - The full category tree.
|
|
62
|
+
* @returns The category URL path, or an empty string if the category is not found.
|
|
63
|
+
*/
|
|
10
64
|
declare function getCategoryUrlPath(product: Product, categories: CategoryTreeItem[]): string;
|
|
65
|
+
/**
|
|
66
|
+
* Returns the normal-size URL of the product's primary cover image.
|
|
67
|
+
* @param product - The product object.
|
|
68
|
+
* @returns The cover image URL, or an empty string if not available.
|
|
69
|
+
*/
|
|
11
70
|
declare function getCoverImage(product: Product): string;
|
|
71
|
+
/**
|
|
72
|
+
* Returns the normal-size URL of the product's second cover image.
|
|
73
|
+
* @param product - The product object.
|
|
74
|
+
* @returns The second cover image URL, or an empty string if not available.
|
|
75
|
+
*/
|
|
12
76
|
declare function getSecondCoverImage(product: Product): string;
|
|
77
|
+
/**
|
|
78
|
+
* Returns the small-size preview URL of the product's primary cover image.
|
|
79
|
+
* @param product - The product object.
|
|
80
|
+
* @returns The cover image preview URL, or an empty string if not available.
|
|
81
|
+
*/
|
|
13
82
|
declare function getCoverImagePreview(product: Product): string;
|
|
83
|
+
/**
|
|
84
|
+
* Returns the full-size image URL, preferring a variation-specific image over the general item image.
|
|
85
|
+
* @param product - The product object.
|
|
86
|
+
* @returns The full-size image URL, or an empty string if not available.
|
|
87
|
+
*/
|
|
14
88
|
declare function getFullImage(product: Product): string;
|
|
89
|
+
/**
|
|
90
|
+
* Returns the medium-size image URL, preferring a variation-specific image over the general item image.
|
|
91
|
+
* @param product - The product object.
|
|
92
|
+
* @returns The medium-size image URL, or an empty string if not available.
|
|
93
|
+
*/
|
|
15
94
|
declare function getMiddleImage(product: Product): string;
|
|
95
|
+
/**
|
|
96
|
+
* Returns the second preview image URL, preferring a variation-specific image over the general item image.
|
|
97
|
+
* @param product - The product object.
|
|
98
|
+
* @returns The second preview image URL, or an empty string if not available.
|
|
99
|
+
*/
|
|
16
100
|
declare function getSecondPreviewImage(product: Product): string;
|
|
101
|
+
/**
|
|
102
|
+
* Returns the preview image URL, preferring a variation-specific image over the general item image.
|
|
103
|
+
* @param product - The product object.
|
|
104
|
+
* @returns The preview image URL, or an empty string if not available.
|
|
105
|
+
*/
|
|
17
106
|
declare function getPreviewImage(product: Product): string;
|
|
107
|
+
/**
|
|
108
|
+
* Returns the first product image as an {@link AgnosticImage} with a URL and alt text.
|
|
109
|
+
* Prefers variation-specific images; falls back to all item images.
|
|
110
|
+
* @param product - The product object.
|
|
111
|
+
* @returns An `AgnosticImage` containing the medium-size URL and a clean image name as alt text.
|
|
112
|
+
*/
|
|
18
113
|
declare function getFirstImage(product: Product): AgnosticImage;
|
|
114
|
+
/**
|
|
115
|
+
* Returns a three-dimensional array of attribute values for each product.
|
|
116
|
+
* The structure is `[product][attribute][attributeValue]`.
|
|
117
|
+
* @param products - An array of product objects.
|
|
118
|
+
* @returns A nested array of {@link ProductAttributeValue} objects.
|
|
119
|
+
*/
|
|
19
120
|
declare function getAttributes(products: Product[]): ProductAttributeValue[][][];
|
|
121
|
+
/**
|
|
122
|
+
* Builds a map of unit combination IDs to unit names from all product variations.
|
|
123
|
+
* @param products - An array of product objects.
|
|
124
|
+
* @returns A record mapping `unitCombinationId` to its display name.
|
|
125
|
+
*/
|
|
20
126
|
declare function getUnits(products: Product[]): Record<number, string>;
|
|
127
|
+
/**
|
|
128
|
+
* Returns all variations from the product's variation attribute map.
|
|
129
|
+
* @param product - The product object.
|
|
130
|
+
* @returns An array of {@link VariationMapProductVariation} objects, or an empty array.
|
|
131
|
+
*/
|
|
21
132
|
declare function getAttributeMapVariations(product: Product): VariationMapProductVariation[];
|
|
133
|
+
/**
|
|
134
|
+
* Returns the unique unit combinations available for the product.
|
|
135
|
+
* Filters out duplicate `unitCombinationId` entries, keeping the first occurrence.
|
|
136
|
+
* @param product - The product object.
|
|
137
|
+
* @returns An array of {@link VariationMapProductVariation} objects with distinct unit combinations.
|
|
138
|
+
*/
|
|
22
139
|
declare function possibleUnitCombination(product: Product): VariationMapProductVariation[];
|
|
140
|
+
/**
|
|
141
|
+
* Finds the variation ID that matches a given attribute value and unit combination.
|
|
142
|
+
* @param product - The product object.
|
|
143
|
+
* @param selectedAttributId - The ID of the selected attribute value as a string.
|
|
144
|
+
* @param unitCombinationId - The unit combination ID to match, or `null` to ignore unit filtering.
|
|
145
|
+
* @returns The matching variation ID, or `-1` if no match is found.
|
|
146
|
+
*/
|
|
23
147
|
declare function getVariationIdForAttributes(product: Product, selectedAttributId: string, unitCombinationId: string | null): number;
|
|
148
|
+
/**
|
|
149
|
+
* Returns the variation matching the given variation ID, or `null` if not found.
|
|
150
|
+
* @param product - The product object.
|
|
151
|
+
* @param variationId - The numeric ID of the variation to look up.
|
|
152
|
+
* @returns The matching {@link VariationMapProductVariation}, or `null`.
|
|
153
|
+
*/
|
|
24
154
|
declare function getVariariationById(product: Product, variationId: number): VariationMapProductVariation | null;
|
|
155
|
+
/**
|
|
156
|
+
* Returns the SEO title of the product.
|
|
157
|
+
* @param product - The product object.
|
|
158
|
+
* @returns The product title, or an empty string if not set.
|
|
159
|
+
*/
|
|
25
160
|
declare function getTitle(product: Product): string;
|
|
161
|
+
/**
|
|
162
|
+
* Returns the full HTML description of the product.
|
|
163
|
+
* @param product - The product object.
|
|
164
|
+
* @returns The product description, or an empty string if not set.
|
|
165
|
+
*/
|
|
26
166
|
declare function getDescription(product: Product): string;
|
|
167
|
+
/**
|
|
168
|
+
* Returns the short description of the product.
|
|
169
|
+
* @param product - The product object.
|
|
170
|
+
* @returns The short description, or an empty string if not set.
|
|
171
|
+
*/
|
|
27
172
|
declare function getShortDescription(product: Product): string;
|
|
173
|
+
/**
|
|
174
|
+
* Returns the technical data text of the product.
|
|
175
|
+
* @param product - The product object.
|
|
176
|
+
* @returns The technical data string, or an empty string if not set.
|
|
177
|
+
*/
|
|
28
178
|
declare function getTechnicalData(product: Product): string;
|
|
179
|
+
/**
|
|
180
|
+
* Returns the meta description of the product for SEO purposes.
|
|
181
|
+
* @param product - The product object.
|
|
182
|
+
* @returns The meta description string, or an empty string if not set.
|
|
183
|
+
*/
|
|
29
184
|
declare function getMetaDescription(product: Product): string;
|
|
185
|
+
/**
|
|
186
|
+
* Returns the meta keywords of the product for SEO purposes.
|
|
187
|
+
* @param product - The product object.
|
|
188
|
+
* @returns The keywords string, or an empty string if not set.
|
|
189
|
+
*/
|
|
30
190
|
declare function getMetaKeywords(product: Product): string;
|
|
191
|
+
/**
|
|
192
|
+
* Returns an array of category IDs for all of the product's default categories.
|
|
193
|
+
* @param product - The product object.
|
|
194
|
+
* @returns An array of category ID strings, or `['']` if no categories are assigned.
|
|
195
|
+
*/
|
|
31
196
|
declare function getCategoryIds(product: Product): string[];
|
|
197
|
+
/**
|
|
198
|
+
* Returns the name of the product's primary default category.
|
|
199
|
+
* @param product - The product object.
|
|
200
|
+
* @returns The category name, or an empty string if no default category is assigned.
|
|
201
|
+
*/
|
|
32
202
|
declare function getCategoryName(product: Product): string;
|
|
203
|
+
/**
|
|
204
|
+
* Returns the variation ID as a string.
|
|
205
|
+
* @param product - The product object.
|
|
206
|
+
* @returns The variation ID string, or an empty string if not set.
|
|
207
|
+
*/
|
|
33
208
|
declare function getId(product: Product): string;
|
|
209
|
+
/**
|
|
210
|
+
* Returns the item ID (parent product ID) as a string.
|
|
211
|
+
* @param product - The product object.
|
|
212
|
+
* @returns The item ID string, or an empty string if not set.
|
|
213
|
+
*/
|
|
34
214
|
declare function getItemId(product: Product): string;
|
|
215
|
+
/**
|
|
216
|
+
* Returns the unit content quantity of the product (e.g. `500` for 500 ml).
|
|
217
|
+
* @param product - The product object.
|
|
218
|
+
* @returns The unit content as a number.
|
|
219
|
+
*/
|
|
35
220
|
declare function getUnitContent(product: Product): number;
|
|
221
|
+
/**
|
|
222
|
+
* Returns the unit name of the product (e.g. `"ml"`, `"kg"`).
|
|
223
|
+
* @param product - The product object.
|
|
224
|
+
* @returns The unit name string.
|
|
225
|
+
*/
|
|
36
226
|
declare function getUnitName(product: Product): string;
|
|
227
|
+
/**
|
|
228
|
+
* Returns the total number of customer reviews for the product.
|
|
229
|
+
* @param product - The product object.
|
|
230
|
+
* @returns The review count, or `0` if not set.
|
|
231
|
+
*/
|
|
37
232
|
declare function getTotalReviews(product: Product): number;
|
|
233
|
+
/**
|
|
234
|
+
* Returns the average customer rating of the product.
|
|
235
|
+
* @param product - The product object.
|
|
236
|
+
* @param roundOption - Optional rounding strategy: `'half'` rounds to the nearest 0.5, `'tenth'` rounds to the nearest 0.1.
|
|
237
|
+
* @returns The average rating as a number, or `0` if not set.
|
|
238
|
+
*/
|
|
38
239
|
declare function getAverageRating(product: Product, roundOption?: 'half' | 'tenth'): number;
|
|
240
|
+
/**
|
|
241
|
+
* Returns `true` if at least one variation of the product is salable.
|
|
242
|
+
* @param product - The product object.
|
|
243
|
+
* @returns `true` if any variation is salable, otherwise `false`.
|
|
244
|
+
*/
|
|
39
245
|
declare function isSalable(product: Product): boolean;
|
|
246
|
+
/**
|
|
247
|
+
* Returns `true` if the currently active variation of the product is salable.
|
|
248
|
+
* @param product - The product object.
|
|
249
|
+
* @returns `true` if the active variation is salable, otherwise `false`.
|
|
250
|
+
*/
|
|
40
251
|
declare function isActiveVariationSalable(product: Product): boolean;
|
|
252
|
+
/**
|
|
253
|
+
* Returns the maximum possible rating value.
|
|
254
|
+
* @param product - The product object (currently unused).
|
|
255
|
+
* @returns Always returns `5`.
|
|
256
|
+
*/
|
|
41
257
|
declare function getMaxRating(product: Product): number;
|
|
258
|
+
/**
|
|
259
|
+
* Determines whether the product can be added directly to the cart from a category page.
|
|
260
|
+
* Returns `false` if the product is not salable, has required order properties,
|
|
261
|
+
* is a set item, has a minimum order quantity other than 1, has an interval order
|
|
262
|
+
* quantity greater than 1, has multiple salable variations, or has graduated prices.
|
|
263
|
+
* @param product - The product object.
|
|
264
|
+
* @returns `true` if the product can be added to cart from the category page.
|
|
265
|
+
*/
|
|
42
266
|
declare function canBeAddedToCartFromCategoryPage(product: Product): boolean;
|
|
267
|
+
/**
|
|
268
|
+
* Returns `true` if the product has order properties and all of them are required and preselected.
|
|
269
|
+
* @param product - The product object.
|
|
270
|
+
* @returns `true` when all order properties are required and already preselected.
|
|
271
|
+
*/
|
|
43
272
|
declare function hasOrderPropertiesRequiredAndPreselected(product: Product): boolean;
|
|
273
|
+
/**
|
|
274
|
+
* Determines whether a "from" price prefix should be shown for the product.
|
|
275
|
+
* Returns `true` when the product has multiple salable variations with cheapest-sorting
|
|
276
|
+
* enabled, or when a single variation has more than one graduated price step.
|
|
277
|
+
* Always returns `false` for set items.
|
|
278
|
+
* @param product - The product object.
|
|
279
|
+
* @returns `true` if the "from" prefix should be displayed alongside the price.
|
|
280
|
+
*/
|
|
44
281
|
declare function showFromText(product: Product): boolean;
|
|
282
|
+
/**
|
|
283
|
+
* Returns all variation property groups for the product.
|
|
284
|
+
* @param product - The product object.
|
|
285
|
+
* @returns An array of {@link VariationPropertyGroup} objects, or an empty array.
|
|
286
|
+
*/
|
|
45
287
|
declare function getPropertyGroups(product: Product): VariationPropertyGroup[];
|
|
288
|
+
/**
|
|
289
|
+
* Returns the variation property group with the given ID.
|
|
290
|
+
* @param id - The numeric ID of the property group.
|
|
291
|
+
* @param product - The product object.
|
|
292
|
+
* @returns The matching {@link VariationPropertyGroup}.
|
|
293
|
+
*/
|
|
46
294
|
declare function getPropertyGroupById(id: number, product: Product): VariationPropertyGroup;
|
|
295
|
+
/**
|
|
296
|
+
* Returns the variation property with the given ID.
|
|
297
|
+
* @param id - The numeric ID of the property.
|
|
298
|
+
* @param product - The product object.
|
|
299
|
+
* @returns The matching {@link VariationProperty}.
|
|
300
|
+
*/
|
|
47
301
|
declare function getPropertyById(id: number, product: Product): VariationProperty;
|
|
302
|
+
/**
|
|
303
|
+
* Returns the numeric ID of the current product variation.
|
|
304
|
+
* @param product - The product object.
|
|
305
|
+
* @returns The variation ID, or `0` if not set.
|
|
306
|
+
*/
|
|
48
307
|
declare function getVariationId(product: Product): number;
|
|
308
|
+
/**
|
|
309
|
+
* Returns the variation number (SKU / external ID) of the product variation.
|
|
310
|
+
* @param product - The product object.
|
|
311
|
+
* @returns The variation number string, or an empty string if not set.
|
|
312
|
+
*/
|
|
49
313
|
declare function getVariationNumber(product: Product): string;
|
|
314
|
+
/**
|
|
315
|
+
* Returns the total number of salable variations for the product.
|
|
316
|
+
* @param product - The product object.
|
|
317
|
+
* @returns The salable variation count, or `0` if not set.
|
|
318
|
+
*/
|
|
50
319
|
declare function getSalableVariationCount(product: Product): number;
|
|
320
|
+
/**
|
|
321
|
+
* Returns the date until which the variation is available for sale.
|
|
322
|
+
* @param product - The product object.
|
|
323
|
+
* @returns The availability end date value.
|
|
324
|
+
*/
|
|
51
325
|
declare function getVariationAvailableUntil(product: Product): unknown;
|
|
326
|
+
/**
|
|
327
|
+
* Returns the width of the product variation in millimeters.
|
|
328
|
+
* @param product - The product object.
|
|
329
|
+
* @returns The width in mm, or `0` if not set.
|
|
330
|
+
*/
|
|
52
331
|
declare function getWidthMM(product: Product): number;
|
|
332
|
+
/**
|
|
333
|
+
* Returns the height of the product variation in millimeters.
|
|
334
|
+
* @param product - The product object.
|
|
335
|
+
* @returns The height in mm, or `0` if not set.
|
|
336
|
+
*/
|
|
53
337
|
declare function getHeightMM(product: Product): number;
|
|
338
|
+
/**
|
|
339
|
+
* Returns the weight of the product variation in grams.
|
|
340
|
+
* @param product - The product object.
|
|
341
|
+
* @returns The weight in grams, or `0` if not set.
|
|
342
|
+
*/
|
|
54
343
|
declare function getWeightG(product: Product): number;
|
|
344
|
+
/**
|
|
345
|
+
* Returns the length of the product variation in millimeters.
|
|
346
|
+
* @param product - The product object.
|
|
347
|
+
* @returns The length in mm, or `0` if not set.
|
|
348
|
+
*/
|
|
55
349
|
declare function getLengthMM(product: Product): number;
|
|
350
|
+
/**
|
|
351
|
+
* Returns the availability ID for the product variation (1–10).
|
|
352
|
+
* @param product - The product object.
|
|
353
|
+
* @returns The numeric availability ID.
|
|
354
|
+
*/
|
|
56
355
|
declare function getAvailabilityId(product: Product): number;
|
|
356
|
+
/**
|
|
357
|
+
* Returns the average number of days for the variation's availability (e.g. delivery time).
|
|
358
|
+
* @param product - The product object.
|
|
359
|
+
* @returns The average days as a number.
|
|
360
|
+
*/
|
|
57
361
|
declare function getAvailabilityAverageDays(product: Product): number;
|
|
362
|
+
/**
|
|
363
|
+
* Returns the display name of the variation's availability state.
|
|
364
|
+
* @param product - The product object.
|
|
365
|
+
* @returns The availability name string.
|
|
366
|
+
*/
|
|
58
367
|
declare function getAvailabilityName(product: Product): string;
|
|
368
|
+
/**
|
|
369
|
+
* Returns a CSS class name derived from the variation's availability ID
|
|
370
|
+
* (e.g. `"availability-1"`).
|
|
371
|
+
* @param product - The product object.
|
|
372
|
+
* @returns The CSS class name string.
|
|
373
|
+
*/
|
|
59
374
|
declare function getAgenciesAvailabilityCLass(product: Product): string;
|
|
375
|
+
/**
|
|
376
|
+
* Returns the background color associated with the variation's availability state.
|
|
377
|
+
* @param product - The product object.
|
|
378
|
+
* @returns The background color value from {@link AvailabilityBackgroundColor}.
|
|
379
|
+
*/
|
|
60
380
|
declare function getAvailabilityBackgroundColor(product: Product): string;
|
|
381
|
+
/**
|
|
382
|
+
* Returns the text color associated with the variation's availability state.
|
|
383
|
+
* @param product - The product object.
|
|
384
|
+
* @returns The text color value from {@link AvailabilityTextColor}.
|
|
385
|
+
*/
|
|
61
386
|
declare function getAvailabilityTextColor(product: Product): string;
|
|
387
|
+
/**
|
|
388
|
+
* Returns the parent category ID of the product's first default category.
|
|
389
|
+
* @param product - The product object.
|
|
390
|
+
* @returns The parent category ID, or `0` if not set.
|
|
391
|
+
*/
|
|
62
392
|
declare function getParentCategoryId(product: Product): number;
|
|
393
|
+
/**
|
|
394
|
+
* Returns the numeric ID of the product's first default category.
|
|
395
|
+
* @param product - The product object.
|
|
396
|
+
* @returns The category ID, or `0` if not set.
|
|
397
|
+
*/
|
|
63
398
|
declare function getCategoryId(product: Product): number;
|
|
399
|
+
/**
|
|
400
|
+
* Returns the list of barcodes associated with the product.
|
|
401
|
+
* @param product - The product object.
|
|
402
|
+
* @returns An array of {@link Barcode} objects, or an empty array.
|
|
403
|
+
*/
|
|
64
404
|
declare function getBarcodes(product: Product): Barcode[];
|
|
405
|
+
/**
|
|
406
|
+
* Returns the manufacturer of the product.
|
|
407
|
+
* When the manufacturer data is an array, the first entry is returned.
|
|
408
|
+
* @param product - The product object.
|
|
409
|
+
* @returns The {@link Manufacturer} object.
|
|
410
|
+
*/
|
|
65
411
|
declare function getManufacturer(product: Product): Manufacturer;
|
|
412
|
+
/**
|
|
413
|
+
* Returns the grouped attributes for the product (e.g. color and size combined).
|
|
414
|
+
* @param product - The product object.
|
|
415
|
+
* @returns An array of {@link ProductGroupedAttribute} objects, or an empty array.
|
|
416
|
+
*/
|
|
66
417
|
declare function getGroupedAttributes(product: Product): ProductGroupedAttribute[];
|
|
418
|
+
/**
|
|
419
|
+
* Returns a formatted string of all grouped attributes in `", name: value"` format.
|
|
420
|
+
* Returns an empty string if the product has no grouped attributes.
|
|
421
|
+
* @param product - The product object.
|
|
422
|
+
* @returns A concatenated attribute string prefixed with `", "`, or an empty string.
|
|
423
|
+
*/
|
|
67
424
|
declare function getGroupedAttributesString(product: Product): string;
|
|
425
|
+
/**
|
|
426
|
+
* Determines whether the variation ID should be appended to the product URL.
|
|
427
|
+
* Returns `true` if there is exactly one salable variation with a valid variation ID,
|
|
428
|
+
* or if the product has any grouped attributes.
|
|
429
|
+
* @param product - The product object.
|
|
430
|
+
* @returns `true` if the variation should be included in the link.
|
|
431
|
+
*/
|
|
68
432
|
declare function shouldAppendVariationToLink(product: Product): boolean;
|
|
69
433
|
export declare const productGetters: {
|
|
70
434
|
getUnitContent: typeof getUnitContent;
|
|
71
435
|
getUnitName: typeof getUnitName;
|
|
72
436
|
getName: typeof getName;
|
|
437
|
+
getName2: typeof getName2;
|
|
438
|
+
getName3: typeof getName3;
|
|
73
439
|
getMinimumOrderQuantity: typeof getMinimumOrderQuantity;
|
|
74
440
|
getSlug: typeof getSlug;
|
|
75
441
|
getUrlPath: typeof getUrlPath;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"productGetters.d.ts","sourceRoot":"","sources":["../../src/getters/productGetters.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAKb,qBAAqB,EACtB,MAAM,YAAY,CAAC;AAEpB,OAAO,KAAK,EACV,gBAAgB,EAChB,OAAO,EAEP,4BAA4B,EAC5B,iBAAiB,EACjB,sBAAsB,EACtB,UAAU,EACV,YAAY,EACZ,OAAO,EACP,uBAAuB,EACxB,MAAM,UAAU,CAAC;AAWlB,iBAAS,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAEzC;AAED,iBAAS,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAEzC;AAED,iBAAS,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAE5C;AAED,iBAAS,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAEzD;AAED,iBAAS,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,UAAU,EAAE,GAAG,EAAE,CAOvD;AAED,iBAAS,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM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AAO,GAAG,MAAM,CAE/C;AAED;;;;GAIG;AACH,iBAAS,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,EAAE,CAEhD;AAED;;;;;GAKG;AACH,iBAAS,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,YAAY,CAMvD;AAED;;;;GAIG;AACH,iBAAS,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,uBAAuB,EAAE,CAEzE;AAED;;;;;GAKG;AACH,iBAAS,0BAA0B,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAM5D;AAED;;;;;;GAMG;AACH,iBAAS,2BAA2B,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAM9D;AAED,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmF1B,CAAC"}
|
|
@@ -1,13 +1,63 @@
|
|
|
1
1
|
import type { ImagesData, Product } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the alternate text for an image.
|
|
4
|
+
* @param image - The image data object.
|
|
5
|
+
* @returns The alternate text string, or an empty string if names is an array or not set.
|
|
6
|
+
*/
|
|
2
7
|
declare function getImageAlternate(image: ImagesData): string;
|
|
8
|
+
/**
|
|
9
|
+
* Returns the display name of an image.
|
|
10
|
+
* @param image - The image data object.
|
|
11
|
+
* @returns The name string, or an empty string if names is an array or not set.
|
|
12
|
+
*/
|
|
3
13
|
declare function getImageName(image: ImagesData): string;
|
|
14
|
+
/**
|
|
15
|
+
* Returns the clean (filename-safe) name of an image.
|
|
16
|
+
* @param image - The image data object.
|
|
17
|
+
* @returns The clean image name string, or an empty string if not set.
|
|
18
|
+
*/
|
|
4
19
|
declare function getCleanImageName(image: ImagesData): string;
|
|
20
|
+
/**
|
|
21
|
+
* Returns the full-size URL of an image.
|
|
22
|
+
* @param image - The image data object.
|
|
23
|
+
* @returns The image URL string, or an empty string if not set.
|
|
24
|
+
*/
|
|
5
25
|
declare function getImageUrl(image: ImagesData): string;
|
|
26
|
+
/**
|
|
27
|
+
* Returns the preview URL of an image.
|
|
28
|
+
* @param image - The image data object.
|
|
29
|
+
* @returns The preview image URL string, or an empty string if not set.
|
|
30
|
+
*/
|
|
6
31
|
declare function getImageUrlPreview(image: ImagesData): string;
|
|
32
|
+
/**
|
|
33
|
+
* Returns the second preview URL of an image.
|
|
34
|
+
* @param image - The image data object.
|
|
35
|
+
* @returns The second preview image URL string, or an empty string if not set.
|
|
36
|
+
*/
|
|
7
37
|
declare function getImageUrlSecondPreview(image: ImagesData): string;
|
|
38
|
+
/**
|
|
39
|
+
* Returns the medium-size URL of an image.
|
|
40
|
+
* @param image - The image data object.
|
|
41
|
+
* @returns The medium image URL string, or an empty string if not set.
|
|
42
|
+
*/
|
|
8
43
|
declare function getImageUrlMiddle(image: ImagesData): string;
|
|
44
|
+
/**
|
|
45
|
+
* Returns the width of an image in pixels.
|
|
46
|
+
* @param image - The image data object.
|
|
47
|
+
* @returns The image width, or `0` if not set.
|
|
48
|
+
*/
|
|
9
49
|
declare function getImageWidth(image: ImagesData): number;
|
|
50
|
+
/**
|
|
51
|
+
* Returns the height of an image in pixels.
|
|
52
|
+
* @param image - The image data object.
|
|
53
|
+
* @returns The image height, or `0` if not set.
|
|
54
|
+
*/
|
|
10
55
|
declare function getImageHeight(image: ImagesData): number;
|
|
56
|
+
/**
|
|
57
|
+
* Returns the first image from the product's `all` image list.
|
|
58
|
+
* @param product - The product object.
|
|
59
|
+
* @returns The first {@link ImagesData} object in the all-images list.
|
|
60
|
+
*/
|
|
11
61
|
declare function getFirstImage(product: Product): ImagesData;
|
|
12
62
|
export declare const productImageGetters: {
|
|
13
63
|
getImageAlternate: typeof getImageAlternate;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"productImageGetters.d.ts","sourceRoot":"","sources":["../../src/getters/productImageGetters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,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K,EAAE,UAAU,GAAG,MAAM,CAErD;AAED;;;;GAIG;AACH,iBAAS,wBAAwB,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAE3D;AAED;;;;GAIG;AACH,iBAAS,iBAAiB,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAEpD;AAED;;;;GAIG;AACH,iBAAS,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAEhD;AAED;;;;GAIG;AACH,iBAAS,cAAc,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAEjD;AAED;;;;GAIG;AACH,iBAAS,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,UAAU,CAEnD;AAED,eAAO,MAAM,mBAAmB;;;;;;;;;;;CAW/B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"productPriceGetters.d.ts","sourceRoot":"","sources":["../../src/getters/productPriceGetters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"productPriceGetters.d.ts","sourceRoot":"","sources":["../../src/getters/productPriceGetters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAyMjE,eAAO,MAAM,mBAAmB;wBAlML,OAAO,KAAG,MAAM,GAAG,IAAI;+BAShB,OAAO,KAAG,MAAM,GAAG,IAAI;+BASvB,OAAO,KAAG,MAAM,GAAG,IAAI;8BASxB,OAAO,KAAG,MAAM,GAAG,IAAI;kCASnB,OAAO,KAAG,OAAO,EAAE;2CAiB7C,OAAO,YACN,MAAM,KACf,OAAO,GAAG,IAAI;gCAmBkB,OAAO,KAAG,kBAAkB,EAAE;yCAuBrB,OAAO,KAAG,MAAM;kDAaP,OAAO,KAAG,MAAM;wCA+B1B,OAAO,KAAG,MAAM;iCATvB,OAAO,KAAG,MAAM;wCATT,OAAO,KAAG,MAAM;gCA6BxB,OAAO,KAAG,OAAO;yCAWR,OAAO,KAAG,MAAM;mCAStB,OAAO,KAAG,MAAM;uCASZ,OAAO,KAAG,MAAM;uCAShB,OAAO,KAAG,MAAM;CAsBzD,CAAC"}
|