@plentymarkets/shop-api 0.168.1 → 0.169.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/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 +3342 -21
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.es.js +3342 -21
- 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/package.json +3 -3
- 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/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
|
@@ -1,54 +1,322 @@
|
|
|
1
1
|
import type { OrderPropertiesGroup, OrderPropertiesGroups, OrderPropertyLabel, Product, ProductProperty, VariationProperty, VariationPropertyGroup } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Returns whether a property with the given ID exists in the property groups.
|
|
4
|
+
* @param id - The numeric ID of the property to check.
|
|
5
|
+
* @param propertyGroups - The array of variation property groups.
|
|
6
|
+
* @returns `true` if the property exists, otherwise `false`.
|
|
7
|
+
*/
|
|
2
8
|
declare function hasProperty(id: number, propertyGroups: VariationPropertyGroup[]): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Finds the first property with the given ID across all property groups.
|
|
11
|
+
* @param id - The numeric ID of the property to find.
|
|
12
|
+
* @param propertyGroups - The array of variation property groups.
|
|
13
|
+
* @returns The matching {@link VariationProperty}, or `null` if not found.
|
|
14
|
+
*/
|
|
3
15
|
declare function getProperty(id: number, propertyGroups: VariationPropertyGroup[]): VariationProperty | null;
|
|
16
|
+
/**
|
|
17
|
+
* Finds the property with the given ID within a single property group.
|
|
18
|
+
* @param id - The numeric ID of the property to find.
|
|
19
|
+
* @param propertyGroup - The variation property group to search within.
|
|
20
|
+
* @returns The matching {@link VariationProperty}, or `null` if not found.
|
|
21
|
+
*/
|
|
4
22
|
declare function getPropertyFromGroup(id: number, propertyGroup: VariationPropertyGroup): VariationProperty | null;
|
|
23
|
+
/**
|
|
24
|
+
* Returns all properties belonging to a variation property group.
|
|
25
|
+
* @param propertyGroup - The variation property group.
|
|
26
|
+
* @returns An array of {@link VariationProperty} objects.
|
|
27
|
+
*/
|
|
5
28
|
declare function getProperties(propertyGroup: VariationPropertyGroup): VariationProperty[];
|
|
29
|
+
/**
|
|
30
|
+
* Returns whether a group with the given ID exists in the property groups.
|
|
31
|
+
* @param id - The numeric ID of the group to check.
|
|
32
|
+
* @param propertyGroups - The array of variation property groups.
|
|
33
|
+
* @returns `true` if the group exists, otherwise `false`.
|
|
34
|
+
*/
|
|
6
35
|
declare function hasGroup(id: number, propertyGroups: VariationPropertyGroup[]): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Finds the variation property group with the given ID.
|
|
38
|
+
* @param id - The numeric ID of the group to find.
|
|
39
|
+
* @param propertyGroups - The array of variation property groups.
|
|
40
|
+
* @returns The matching {@link VariationPropertyGroup}, or `null` if not found.
|
|
41
|
+
*/
|
|
7
42
|
declare function getGroup(id: number, propertyGroups: VariationPropertyGroup[]): VariationPropertyGroup | null;
|
|
43
|
+
/**
|
|
44
|
+
* Returns the numeric ID of a variation property.
|
|
45
|
+
* @param property - The variation property.
|
|
46
|
+
* @returns The property ID.
|
|
47
|
+
*/
|
|
8
48
|
declare function getPropertyId(property: VariationProperty): number;
|
|
49
|
+
/**
|
|
50
|
+
* Returns the cast type of a variation property (e.g. `"text"`, `"html"`, `"file"`).
|
|
51
|
+
* @param property - The variation property.
|
|
52
|
+
* @returns The cast type string.
|
|
53
|
+
*/
|
|
9
54
|
declare function getPropertyCast(property: VariationProperty): string;
|
|
55
|
+
/**
|
|
56
|
+
* Returns whether the property value is an MP4 video file.
|
|
57
|
+
* @param property - The variation property.
|
|
58
|
+
* @returns `true` if the cast is `"file"` and the extension is `.mp4`, otherwise `false`.
|
|
59
|
+
*/
|
|
10
60
|
declare function isMP4File(property: VariationProperty): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Returns whether the property value is an image file (JPEG or WebP).
|
|
63
|
+
* @param property - The variation property.
|
|
64
|
+
* @returns `true` if the property value is a JPEG or WebP image, otherwise `false`.
|
|
65
|
+
*/
|
|
11
66
|
declare function isImage(property: VariationProperty): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Returns whether the property value is a WebP image file.
|
|
69
|
+
* @param property - The variation property.
|
|
70
|
+
* @returns `true` if the cast is `"file"` and the extension is `.webp`, otherwise `false`.
|
|
71
|
+
*/
|
|
12
72
|
declare function isWebpFile(property: VariationProperty): boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Returns whether the property value is a JPEG image file.
|
|
75
|
+
* @param property - The variation property.
|
|
76
|
+
* @returns `true` if the cast is `"file"` and the extension is `.jpg` or `.jpeg`, otherwise `false`.
|
|
77
|
+
*/
|
|
13
78
|
declare function isJpegFile(property: VariationProperty): boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Returns whether the property cast type is `"html"`.
|
|
81
|
+
* @param property - The variation property.
|
|
82
|
+
* @returns `true` if the cast is HTML, otherwise `false`.
|
|
83
|
+
*/
|
|
14
84
|
declare function isHTML(property: VariationProperty): boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Returns whether the property cast type is `"text"`.
|
|
87
|
+
* @param property - The variation property.
|
|
88
|
+
* @returns `true` if the cast is plain text, otherwise `false`.
|
|
89
|
+
*/
|
|
15
90
|
declare function isText(property: VariationProperty): boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Returns the string value of a variation property.
|
|
93
|
+
* @param property - The variation property.
|
|
94
|
+
* @returns The property value string.
|
|
95
|
+
*/
|
|
16
96
|
declare function getPropertyValue(property: VariationProperty): string;
|
|
97
|
+
/**
|
|
98
|
+
* Returns the download link URL for a file-type variation property.
|
|
99
|
+
* @param property - The variation property.
|
|
100
|
+
* @returns The download link URL string, or an empty string if not set.
|
|
101
|
+
*/
|
|
17
102
|
declare function getPropertyDownloadLink(property: VariationProperty): string;
|
|
103
|
+
/**
|
|
104
|
+
* Returns the display name of a variation property.
|
|
105
|
+
* @param property - The variation property.
|
|
106
|
+
* @returns The property name string, or an empty string if not set.
|
|
107
|
+
*/
|
|
18
108
|
declare function getPropertyName(property: VariationProperty): string;
|
|
109
|
+
/**
|
|
110
|
+
* Returns the description of a variation property's name entry.
|
|
111
|
+
* @param property - The variation property.
|
|
112
|
+
* @returns The name description string, or an empty string if not set.
|
|
113
|
+
*/
|
|
19
114
|
declare function getPropertyNameDescription(property: VariationProperty): string;
|
|
115
|
+
/**
|
|
116
|
+
* Returns the description of a variation property's value entry.
|
|
117
|
+
* @param property - The variation property.
|
|
118
|
+
* @returns The value description string.
|
|
119
|
+
*/
|
|
20
120
|
declare function getPropertyValueDescription(property: VariationProperty): string;
|
|
121
|
+
/**
|
|
122
|
+
* Returns the numeric ID of the selected property value.
|
|
123
|
+
* @param property - The variation property.
|
|
124
|
+
* @returns The value ID, or `-1` if not set.
|
|
125
|
+
*/
|
|
21
126
|
declare function getPropertyValueId(property: VariationProperty): number;
|
|
127
|
+
/**
|
|
128
|
+
* Returns the group ID of a variation property (the ID of its parent group).
|
|
129
|
+
* @param propertyGroup - The variation property (despite its name, accesses `groupId`).
|
|
130
|
+
* @returns The group ID.
|
|
131
|
+
*/
|
|
22
132
|
declare function getGroupId(propertyGroup: VariationProperty): number;
|
|
133
|
+
/**
|
|
134
|
+
* Returns the display name of a variation property group.
|
|
135
|
+
* @param propertyGroup - The variation property group.
|
|
136
|
+
* @returns The group name string, or an empty string if not set.
|
|
137
|
+
*/
|
|
23
138
|
declare function getGroupName(propertyGroup: VariationPropertyGroup): string;
|
|
139
|
+
/**
|
|
140
|
+
* Returns the description of a variation property group.
|
|
141
|
+
* @param propertyGroup - The variation property group.
|
|
142
|
+
* @returns The group description string, or an empty string if not set.
|
|
143
|
+
*/
|
|
24
144
|
declare function getGroupDescription(propertyGroup: VariationPropertyGroup): string;
|
|
145
|
+
/**
|
|
146
|
+
* Returns the display name of an order property group.
|
|
147
|
+
* @param propertyGroup - The order properties group object.
|
|
148
|
+
* @returns The group name string.
|
|
149
|
+
*/
|
|
25
150
|
declare function getOrderPropertyGroupName(propertyGroup: OrderPropertiesGroup): string;
|
|
151
|
+
/**
|
|
152
|
+
* Returns the description of an order property group.
|
|
153
|
+
* @param propertyGroup - The order properties group object.
|
|
154
|
+
* @returns The group description string.
|
|
155
|
+
*/
|
|
26
156
|
declare function getOrderPropertyGroupDescription(propertyGroup: OrderPropertiesGroup): string;
|
|
157
|
+
/**
|
|
158
|
+
* Returns whether an order property has a non-empty description.
|
|
159
|
+
* @param property - The product property object.
|
|
160
|
+
* @returns `true` if the property has a description, otherwise `false`.
|
|
161
|
+
*/
|
|
27
162
|
declare function hasOrderPropertyDescription(property: ProductProperty): boolean;
|
|
163
|
+
/**
|
|
164
|
+
* Returns the description of an order property.
|
|
165
|
+
* @param property - The product property object.
|
|
166
|
+
* @returns The description string, or an empty string if not set.
|
|
167
|
+
*/
|
|
28
168
|
declare function getOrderPropertyDescription(property: ProductProperty): string;
|
|
169
|
+
/**
|
|
170
|
+
* Returns whether any group in the order properties groups has a tooltip (property description).
|
|
171
|
+
* @param orderPropertiesGroups - The full order properties groups object.
|
|
172
|
+
* @returns `true` if at least one group has a property with a description, otherwise `false`.
|
|
173
|
+
*/
|
|
29
174
|
declare function hasOrderPropertiesGroupsTooltips(orderPropertiesGroups: OrderPropertiesGroups): boolean;
|
|
175
|
+
/**
|
|
176
|
+
* Returns whether the product property is an order property.
|
|
177
|
+
* @param property - The product property object.
|
|
178
|
+
* @returns `true` if the property is marked as an order property, otherwise `false`.
|
|
179
|
+
*/
|
|
30
180
|
declare function isOrderProperty(property: ProductProperty): boolean;
|
|
181
|
+
/**
|
|
182
|
+
* Returns whether the order property uses multiline text input.
|
|
183
|
+
* @param property - The product property object.
|
|
184
|
+
* @returns `true` if the property is multiline, otherwise `false`.
|
|
185
|
+
*/
|
|
31
186
|
declare function isMultiline(property: ProductProperty): boolean;
|
|
187
|
+
/**
|
|
188
|
+
* Returns whether the property has a VAT ID assigned (optionally restricted to order properties only).
|
|
189
|
+
* @param forOrderProperty - When `true`, only considers order properties.
|
|
190
|
+
* @param property - The product property object.
|
|
191
|
+
* @returns `true` if a VAT ID is set (and the order property condition is satisfied), otherwise `false`.
|
|
192
|
+
*/
|
|
32
193
|
declare function hasPropertyVat(forOrderProperty: boolean, property: ProductProperty): boolean;
|
|
194
|
+
/**
|
|
195
|
+
* Returns whether the property is configured to be shown as an additional cost line.
|
|
196
|
+
* Optionally restricts the check to order properties only.
|
|
197
|
+
* @param forOrderProperty - When `true`, only considers order properties.
|
|
198
|
+
* @param property - The product property object.
|
|
199
|
+
* @returns `true` if the property should be shown as additional costs, otherwise `false`.
|
|
200
|
+
*/
|
|
33
201
|
declare function isPropertyShownAsAdditionalCosts(forOrderProperty: boolean, property: ProductProperty): boolean;
|
|
202
|
+
/**
|
|
203
|
+
* Finds a product property by its numeric ID in the given properties list.
|
|
204
|
+
* @param id - The numeric ID of the property to find.
|
|
205
|
+
* @param productProperties - The array of product properties to search.
|
|
206
|
+
* @returns The matching {@link ProductProperty}, or `null` if not found.
|
|
207
|
+
*/
|
|
34
208
|
declare function getProductProperty(id: number, productProperties: ProductProperty[]): ProductProperty | null;
|
|
209
|
+
/**
|
|
210
|
+
* Returns whether the product has any order properties.
|
|
211
|
+
* @param product - The product object.
|
|
212
|
+
* @returns `true` if the product has order properties, otherwise `false`.
|
|
213
|
+
*/
|
|
35
214
|
declare function hasOrderProperties(product: Product): boolean;
|
|
215
|
+
/**
|
|
216
|
+
* Groups the order properties of a product by their group ID and returns them sorted by position.
|
|
217
|
+
* Properties without a group are placed in group `0`.
|
|
218
|
+
* @param product - The product object.
|
|
219
|
+
* @returns A sorted {@link OrderPropertiesGroups} object keyed by group ID.
|
|
220
|
+
*/
|
|
36
221
|
declare function getOrderPropertiesGroups(product: Product): OrderPropertiesGroups;
|
|
222
|
+
/**
|
|
223
|
+
* Computes the surcharge label metadata for an order property.
|
|
224
|
+
* Determines the surcharge type (`"plus"` or `"incl"`), the surcharge indicator (`"*"`), and the required indicator (`"**"`).
|
|
225
|
+
* @param property - The product property object.
|
|
226
|
+
* @returns An {@link OrderPropertyLabel} object containing `surchargeType`, `surchargeIndicator`, and `requiredIndicator`.
|
|
227
|
+
*/
|
|
37
228
|
declare function getOrderPropertyLabel(property: ProductProperty): OrderPropertyLabel;
|
|
229
|
+
/**
|
|
230
|
+
* Returns the surcharge amount for an order property.
|
|
231
|
+
* Uses the property-level surcharge first, falling back to the inner property surcharge.
|
|
232
|
+
* @param property - The product property object.
|
|
233
|
+
* @returns The surcharge amount as a number.
|
|
234
|
+
*/
|
|
38
235
|
declare function getOrderPropertySurcharge(property: ProductProperty): number;
|
|
236
|
+
/**
|
|
237
|
+
* Returns whether the order property is required.
|
|
238
|
+
* @param property - The product property object.
|
|
239
|
+
* @returns `true` if the property must be filled in by the customer, otherwise `false`.
|
|
240
|
+
*/
|
|
39
241
|
declare function isOrderPropertyRequired(property: ProductProperty): boolean;
|
|
242
|
+
/**
|
|
243
|
+
* Returns whether the order property should be hidden in the UI.
|
|
244
|
+
* A property is hidden when it is both required and pre-selected.
|
|
245
|
+
* @param property - The product property object.
|
|
246
|
+
* @returns `true` if the property is required and pre-selected (i.e. should be hidden), otherwise `false`.
|
|
247
|
+
*/
|
|
40
248
|
declare function isOrderPropertyHidden(property: ProductProperty): boolean;
|
|
249
|
+
/**
|
|
250
|
+
* Returns whether the order property is pre-selected by default.
|
|
251
|
+
* @param property - The product property object.
|
|
252
|
+
* @returns `true` if the property is pre-selected, otherwise `false`.
|
|
253
|
+
*/
|
|
41
254
|
declare function isOrderPropertyPreSelected(property: ProductProperty): boolean;
|
|
255
|
+
/**
|
|
256
|
+
* Returns whether the order property is a checkbox (value type `"empty"`).
|
|
257
|
+
* @param property - The product property object.
|
|
258
|
+
* @returns `true` if the property value type is `"empty"`, otherwise `false`.
|
|
259
|
+
*/
|
|
42
260
|
declare function isOrderPropertyCheckbox(property: ProductProperty): boolean;
|
|
261
|
+
/**
|
|
262
|
+
* Returns whether the order property accepts free-text input (value type `"text"`).
|
|
263
|
+
* @param property - The product property object.
|
|
264
|
+
* @returns `true` if the value type is `"text"`, otherwise `false`.
|
|
265
|
+
*/
|
|
43
266
|
declare function isOrderPropertyText(property: ProductProperty): boolean;
|
|
267
|
+
/**
|
|
268
|
+
* Returns whether the order property accepts integer input (value type `"int"`).
|
|
269
|
+
* @param property - The product property object.
|
|
270
|
+
* @returns `true` if the value type is `"int"`, otherwise `false`.
|
|
271
|
+
*/
|
|
44
272
|
declare function isOrderPropertyInt(property: ProductProperty): boolean;
|
|
273
|
+
/**
|
|
274
|
+
* Returns whether the order property accepts decimal/float input (value type `"float"`).
|
|
275
|
+
* @param property - The product property object.
|
|
276
|
+
* @returns `true` if the value type is `"float"`, otherwise `false`.
|
|
277
|
+
*/
|
|
45
278
|
declare function isOrderPropertyFloat(property: ProductProperty): boolean;
|
|
279
|
+
/**
|
|
280
|
+
* Returns whether the order property is a dropdown/selection (value type `"selection"`).
|
|
281
|
+
* @param property - The product property object.
|
|
282
|
+
* @returns `true` if the value type is `"selection"`, otherwise `false`.
|
|
283
|
+
*/
|
|
46
284
|
declare function isOrderPropertySelection(property: ProductProperty): boolean;
|
|
285
|
+
/**
|
|
286
|
+
* Returns whether the order property accepts a file upload (value type `"file"`).
|
|
287
|
+
* @param property - The product property object.
|
|
288
|
+
* @returns `true` if the value type is `"file"`, otherwise `false`.
|
|
289
|
+
*/
|
|
47
290
|
declare function isOrderPropertyFile(property: ProductProperty): boolean;
|
|
291
|
+
/**
|
|
292
|
+
* Returns the display name of an order property.
|
|
293
|
+
* @param property - The product property object.
|
|
294
|
+
* @returns The property name string, or an empty string if not set.
|
|
295
|
+
*/
|
|
48
296
|
declare function getOrderPropertyName(property: ProductProperty): string;
|
|
297
|
+
/**
|
|
298
|
+
* Returns the numeric ID of an order property's inner property definition.
|
|
299
|
+
* @param property - The product property object.
|
|
300
|
+
* @returns The property ID.
|
|
301
|
+
*/
|
|
49
302
|
declare function getOrderPropertyId(property: ProductProperty): number;
|
|
303
|
+
/**
|
|
304
|
+
* Returns the value type of an order property (e.g. `"text"`, `"int"`, `"selection"`, `"file"`, `"empty"`).
|
|
305
|
+
* @param property - The product property object.
|
|
306
|
+
* @returns The value type string.
|
|
307
|
+
*/
|
|
50
308
|
declare function getOrderPropertyValueType(property: ProductProperty): string;
|
|
309
|
+
/**
|
|
310
|
+
* Returns whether the order property accepts text-like input (text, integer, or float).
|
|
311
|
+
* @param property - The product property object.
|
|
312
|
+
* @returns `true` if the property accepts text, integer, or float input, otherwise `false`.
|
|
313
|
+
*/
|
|
51
314
|
declare function isOrderPropertyInput(property: ProductProperty): boolean;
|
|
315
|
+
/**
|
|
316
|
+
* Returns whether any group in the order properties groups contains a required order property.
|
|
317
|
+
* @param groups - The order properties groups object.
|
|
318
|
+
* @returns `true` if at least one group contains a required order property, otherwise `false`.
|
|
319
|
+
*/
|
|
52
320
|
declare function groupsHasRequiredOrderProperties(groups: OrderPropertiesGroups): boolean;
|
|
53
321
|
export declare const productPropertyGetters: {
|
|
54
322
|
hasProperty: typeof hasProperty;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"productPropertyGetters.d.ts","sourceRoot":"","sources":["../../src/getters/productPropertyGetters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,OAAO,EACP,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACvB,MAAM,UAAU,CAAC;AAElB,iBAAS,WAAW,CAClB,EAAE,EAAE,MAAM,EACV,cAAc,EAAE,sBAAsB,EAAE,GACvC,OAAO,CAET;AAED,iBAAS,WAAW,CAClB,EAAE,EAAE,MAAM,EACV,cAAc,EAAE,sBAAsB,EAAE,GACvC,iBAAiB,GAAG,IAAI,CAS1B;AAED,iBAAS,oBAAoB,CAC3B,EAAE,EAAE,MAAM,EACV,aAAa,EAAE,sBAAsB,GACpC,iBAAiB,GAAG,IAAI,CAO1B;AAED,iBAAS,aAAa,CACpB,aAAa,EAAE,sBAAsB,GACpC,iBAAiB,EAAE,CAErB;AAED,iBAAS,QAAQ,CACf,EAAE,EAAE,MAAM,EACV,cAAc,EAAE,sBAAsB,EAAE,GACvC,OAAO,CAET;AAED,iBAAS,QAAQ,CACf,EAAE,EAAE,MAAM,EACV,cAAc,EAAE,sBAAsB,EAAE,GACvC,sBAAsB,GAAG,IAAI,CAO/B;AAED,iBAAS,aAAa,CAAC,QAAQ,EAAE,iBAAiB,GAAG,MAAM,CAE1D;AAED,iBAAS,eAAe,CAAC,QAAQ,EAAE,iBAAiB,GAAG,MAAM,CAE5D;
|
|
1
|
+
{"version":3,"file":"productPropertyGetters.d.ts","sourceRoot":"","sources":["../../src/getters/productPropertyGetters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,OAAO,EACP,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACvB,MAAM,UAAU,CAAC;AAElB;;;;;GAKG;AACH,iBAAS,WAAW,CAClB,EAAE,EAAE,MAAM,EACV,cAAc,EAAE,sBAAsB,EAAE,GACvC,OAAO,CAET;AAED;;;;;GAKG;AACH,iBAAS,WAAW,CAClB,EAAE,EAAE,MAAM,EACV,cAAc,EAAE,sBAAsB,EAAE,GACvC,iBAAiB,GAAG,IAAI,CAS1B;AAED;;;;;GAKG;AACH,iBAAS,oBAAoB,CAC3B,EAAE,EAAE,MAAM,EACV,aAAa,EAAE,sBAAsB,GACpC,iBAAiB,GAAG,IAAI,CAO1B;AAED;;;;GAIG;AACH,iBAAS,aAAa,CACpB,aAAa,EAAE,sBAAsB,GACpC,iBA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;;;;GAIG;AACH,iBAAS,yBAAyB,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,CAEpE;AAED;;;;GAIG;AACH,iBAAS,oBAAoB,CAAC,QAAQ,EAAE,eAAe,GAAG,OAAO,CAMhE;AAED;;;;GAIG;AACH,iBAAS,gCAAgC,CACvC,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAOT;AAED,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoDlC,CAAC"}
|
|
@@ -1,23 +1,118 @@
|
|
|
1
1
|
import type { Product } from '../types';
|
|
2
2
|
import { CanonicalAlternate, ProductCanonical } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Returns the structured data condition of the product item (e.g. `"NewCondition"`, `"UsedCondition"`).
|
|
5
|
+
* @param product - The product object.
|
|
6
|
+
* @returns The condition string, or an empty string if not set.
|
|
7
|
+
*/
|
|
3
8
|
declare function getConditionOfItem(product: Product): string;
|
|
9
|
+
/**
|
|
10
|
+
* Returns the mapped availability value for structured data (e.g. `"InStock"`, `"OutOfStock"`).
|
|
11
|
+
* @param product - The product object.
|
|
12
|
+
* @returns The mapped availability string, or an empty string if not set.
|
|
13
|
+
*/
|
|
4
14
|
declare function getMappedAvailability(product: Product): string;
|
|
15
|
+
/**
|
|
16
|
+
* Returns the brand name of the product for structured data.
|
|
17
|
+
* @param product - The product object.
|
|
18
|
+
* @returns The brand name string, or an empty string if not set.
|
|
19
|
+
*/
|
|
5
20
|
declare function getBrand(product: Product): string;
|
|
21
|
+
/**
|
|
22
|
+
* Returns the manufacturer name used in structured data SEO settings.
|
|
23
|
+
* @param product - The product object.
|
|
24
|
+
* @returns The manufacturer name string, or an empty string if not set.
|
|
25
|
+
*/
|
|
6
26
|
declare function getSeoManufacturer(product: Product): string;
|
|
27
|
+
/**
|
|
28
|
+
* Returns the GTIN (Global Trade Item Number) of the product.
|
|
29
|
+
* @param product - The product object.
|
|
30
|
+
* @returns The GTIN string, or an empty string if not set.
|
|
31
|
+
*/
|
|
7
32
|
declare function getGtin(product: Product): string;
|
|
33
|
+
/**
|
|
34
|
+
* Returns the GTIN-8 barcode of the product.
|
|
35
|
+
* @param product - The product object.
|
|
36
|
+
* @returns The GTIN-8 string, or an empty string if not set.
|
|
37
|
+
*/
|
|
8
38
|
declare function getGtin8(product: Product): string;
|
|
39
|
+
/**
|
|
40
|
+
* Returns the GTIN-13 (EAN) barcode of the product.
|
|
41
|
+
* @param product - The product object.
|
|
42
|
+
* @returns The GTIN-13 string, or an empty string if not set.
|
|
43
|
+
*/
|
|
9
44
|
declare function getGtin13(product: Product): string;
|
|
45
|
+
/**
|
|
46
|
+
* Returns the ISBN of the product.
|
|
47
|
+
* @param product - The product object.
|
|
48
|
+
* @returns The ISBN string, or an empty string if not set.
|
|
49
|
+
*/
|
|
10
50
|
declare function getIsbn(product: Product): string;
|
|
51
|
+
/**
|
|
52
|
+
* Returns the MPN (Manufacturer Part Number) of the product.
|
|
53
|
+
* @param product - The product object.
|
|
54
|
+
* @returns The MPN string, or an empty string if not set.
|
|
55
|
+
*/
|
|
11
56
|
declare function getMpn(product: Product): string;
|
|
57
|
+
/**
|
|
58
|
+
* Returns the date until which the product price is valid (for structured data).
|
|
59
|
+
* @param product - The product object.
|
|
60
|
+
* @returns The price valid until date string, or an empty string if not set.
|
|
61
|
+
*/
|
|
12
62
|
declare function getPriceValidUntil(product: Product): string;
|
|
63
|
+
/**
|
|
64
|
+
* Returns the SKU (Stock Keeping Unit) of the product for structured data.
|
|
65
|
+
* @param product - The product object.
|
|
66
|
+
* @returns The SKU string, or an empty string if not set.
|
|
67
|
+
*/
|
|
13
68
|
declare function getSku(product: Product): string;
|
|
69
|
+
/**
|
|
70
|
+
* Returns the robots meta tag setting from the product's SEO settings.
|
|
71
|
+
* @param product - The product object.
|
|
72
|
+
* @returns The robots directive string (e.g. `"ALL"`, `"NOINDEX"`), or an empty string if not set.
|
|
73
|
+
*/
|
|
14
74
|
declare function getRobots(product: Product): string;
|
|
75
|
+
/**
|
|
76
|
+
* Returns the forced robots value override from the product's SEO settings.
|
|
77
|
+
* @param product - The product object.
|
|
78
|
+
* @returns The forced robots directive string, or an empty string if not set.
|
|
79
|
+
*/
|
|
15
80
|
declare function getForceRobotsValue(product: Product): string;
|
|
81
|
+
/**
|
|
82
|
+
* Returns the forced canonical URL from the product's SEO settings.
|
|
83
|
+
* @param product - The product object.
|
|
84
|
+
* @returns The forced canonical URL string, or an empty string if not set.
|
|
85
|
+
*/
|
|
16
86
|
declare function getForcedCanonicalUrl(product: Product): string;
|
|
87
|
+
/**
|
|
88
|
+
* Returns the canonical URL configuration from the product's SEO settings.
|
|
89
|
+
* @param product - The product object.
|
|
90
|
+
* @returns The {@link ProductCanonical} object, or an empty object cast to `ProductCanonical` if not set.
|
|
91
|
+
*/
|
|
17
92
|
declare function getCanonical(product: Product): ProductCanonical;
|
|
93
|
+
/**
|
|
94
|
+
* Returns the canonical `href` URL from a canonical configuration object.
|
|
95
|
+
* @param canonical - The product canonical object.
|
|
96
|
+
* @returns The href URL string, or an empty string if not set.
|
|
97
|
+
*/
|
|
18
98
|
declare function getCanonicalHref(canonical: ProductCanonical): string;
|
|
99
|
+
/**
|
|
100
|
+
* Returns the list of alternate (hreflang) entries from a canonical configuration object.
|
|
101
|
+
* @param canonical - The product canonical object.
|
|
102
|
+
* @returns An array of {@link CanonicalAlternate} objects, or an empty array if not set.
|
|
103
|
+
*/
|
|
19
104
|
declare function getCanonicalAlternate(canonical: ProductCanonical): CanonicalAlternate[];
|
|
105
|
+
/**
|
|
106
|
+
* Returns the `href` URL of a canonical alternate entry.
|
|
107
|
+
* @param alternate - The canonical alternate object.
|
|
108
|
+
* @returns The href URL string, or an empty string if not set.
|
|
109
|
+
*/
|
|
20
110
|
declare function getCanonicalAlternateHref(alternate: CanonicalAlternate): string;
|
|
111
|
+
/**
|
|
112
|
+
* Returns the `hreflang` language tag of a canonical alternate entry.
|
|
113
|
+
* @param alternate - The canonical alternate object.
|
|
114
|
+
* @returns The hreflang string (e.g. `"de-DE"`), or an empty string if not set.
|
|
115
|
+
*/
|
|
21
116
|
declare function getCanonicalAlternateHreflang(alternate: CanonicalAlternate): string;
|
|
22
117
|
export declare const productSeoSettingsGetters: {
|
|
23
118
|
getConditionOfItem: typeof getConditionOfItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"productSeoSettingsGetters.d.ts","sourceRoot":"","sources":["../../src/getters/productSeoSettingsGetters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEhE,iBAAS,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAEpD;AAED,iBAAS,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAEvD;AAED,iBAAS,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAE1C;AAED,iBAAS,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAEpD;AAED,iBAAS,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAEzC;AAED,iBAAS,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAE1C;AAED,iBAAS,SAAS,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAE3C;AAED,iBAAS,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAEzC;AAED,iBAAS,MAAM,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAExC;AAED,iBAAS,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAEpD;AAED,iBAAS,MAAM,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAExC;AAED,iBAAS,SAAS,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAE3C;AAED,iBAAS,mBAAmB,CAAC,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,EAAE,OAAO,GAAG,MAAM,CAE3C;AAED;;;;GAIG;AACH,iBAAS,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAEzC;AAED;;;;GAIG;AACH,iBAAS,MAAM,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAExC;AAED;;;;GAIG;AACH,iBAAS,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAEpD;AAED;;;;GAIG;AACH,iBAAS,MAAM,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAExC;AAED;;;;GAIG;AACH,iBAAS,SAAS,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAE3C;AAED;;;;GAIG;AACH,iBAAS,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAErD;AAED;;;;GAIG;AACH,iBAAS,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAEvD;AAED;;;;GAIG;AACH,iBAAS,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,gBAAgB,CAExD;AAED;;;;GAIG;AACH,iBAAS,gBAAgB,CAAC,SAAS,EAAE,gBAAgB,GAAG,MAAM,CAE7D;AAED;;;;GAIG;AACH,iBAAS,qBAAqB,CAC5B,SAAS,EAAE,gBAAgB,GAC1B,kBAAkB,EAAE,CAEtB;AAED;;;;GAIG;AACH,iBAAS,yBAAyB,CAAC,SAAS,EAAE,kBAAkB,GAAG,MAAM,CAExE;AAED;;;;GAIG;AACH,iBAAS,6BAA6B,CAAC,SAAS,EAAE,kBAAkB,GAAG,MAAM,CAE5E;AAED,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;CAoBrC,CAAC"}
|
|
@@ -1,27 +1,138 @@
|
|
|
1
1
|
import { AgnosticPagination } from './agnostic';
|
|
2
2
|
import type { GetOrdersResponse, Order, OrderItem, GetReturnsResponse, OrderReturnReason } from '../types';
|
|
3
3
|
import { OrderReturnsResponse } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
* Returns the creation date of a return item as a localised date-time string.
|
|
6
|
+
* @param returnItem - The return order object.
|
|
7
|
+
* @returns The formatted date-time string, or an empty string if the date is not available.
|
|
8
|
+
*/
|
|
4
9
|
declare function getDate(returnItem: Order): string;
|
|
10
|
+
/**
|
|
11
|
+
* Returns the unique ID of a return item as a string.
|
|
12
|
+
* @param returnItem - The return order object.
|
|
13
|
+
* @returns The order ID string, or an empty string if not set.
|
|
14
|
+
*/
|
|
5
15
|
declare function getId(returnItem: Order): string;
|
|
16
|
+
/**
|
|
17
|
+
* Returns the status name of a return item.
|
|
18
|
+
* @param returnItem - The return order object.
|
|
19
|
+
* @returns The status name string, or an empty string if not set.
|
|
20
|
+
*/
|
|
6
21
|
declare function getStatus(returnItem: Order): string;
|
|
22
|
+
/**
|
|
23
|
+
* Returns the gross total price of a return item.
|
|
24
|
+
* @param returnItem - The return order object.
|
|
25
|
+
* @returns The gross total as a number, or `0` if not set.
|
|
26
|
+
*/
|
|
7
27
|
declare function getPrice(returnItem: Order): number;
|
|
28
|
+
/**
|
|
29
|
+
* Returns all order items belonging to a return.
|
|
30
|
+
* @param returnItem - The return order object.
|
|
31
|
+
* @returns An array of {@link OrderItem} objects, or an empty array if none exist.
|
|
32
|
+
*/
|
|
8
33
|
declare function getItems(returnItem: Order): OrderItem[];
|
|
34
|
+
/**
|
|
35
|
+
* @deprecated Not yet implemented — always returns an empty string.
|
|
36
|
+
* @param item - The order item (currently unused).
|
|
37
|
+
* @returns An empty string.
|
|
38
|
+
*/
|
|
9
39
|
declare function getItemSku(item: OrderItem): string;
|
|
40
|
+
/**
|
|
41
|
+
* Returns the display name of a return order item.
|
|
42
|
+
* @param item - The order item.
|
|
43
|
+
* @returns The order item name string, or an empty string if not set.
|
|
44
|
+
*/
|
|
10
45
|
declare function getItemName(item: OrderItem): string;
|
|
46
|
+
/**
|
|
47
|
+
* Returns the quantity of a return order item.
|
|
48
|
+
* @param item - The order item.
|
|
49
|
+
* @returns The item quantity, or `0` if not set.
|
|
50
|
+
*/
|
|
11
51
|
declare function getItemQty(item: OrderItem): number;
|
|
52
|
+
/**
|
|
53
|
+
* Returns the variation ID of a return order item.
|
|
54
|
+
* @param item - The order item.
|
|
55
|
+
* @returns The item variation ID, or `0` if not set.
|
|
56
|
+
*/
|
|
12
57
|
declare function getItemVariationId(item: OrderItem): number;
|
|
58
|
+
/**
|
|
59
|
+
* Returns the gross unit price of a return order item.
|
|
60
|
+
* @param item - The order item.
|
|
61
|
+
* @returns The original gross price, or `0` if not set.
|
|
62
|
+
*/
|
|
13
63
|
declare function getItemPrice(item: OrderItem): number;
|
|
64
|
+
/**
|
|
65
|
+
* Returns the price as a formatted string.
|
|
66
|
+
* @param price - The numeric price value.
|
|
67
|
+
* @returns The price as a string, or `"0"` if falsy.
|
|
68
|
+
*/
|
|
14
69
|
declare function getFormattedPrice(price: number): string;
|
|
70
|
+
/**
|
|
71
|
+
* Returns the total count of returns from a returns response.
|
|
72
|
+
* @param returns - The paginated orders response object.
|
|
73
|
+
* @returns The total number of returns, or `0` if not set.
|
|
74
|
+
*/
|
|
15
75
|
declare function getOrdersTotal(returns: GetOrdersResponse): number;
|
|
76
|
+
/**
|
|
77
|
+
* Returns the pagination data for a returns response.
|
|
78
|
+
* @param returns - The paginated orders response object.
|
|
79
|
+
* @returns An {@link AgnosticPagination} object with current page, total pages, total items, items per page, and page options.
|
|
80
|
+
*/
|
|
16
81
|
declare function getPagination(returns: GetOrdersResponse): AgnosticPagination;
|
|
82
|
+
/**
|
|
83
|
+
* Returns the URL path to the product page for a return order item.
|
|
84
|
+
* @param order - The return order object containing variation data.
|
|
85
|
+
* @param productId - The numeric ID of the product.
|
|
86
|
+
* @returns The product URL path string.
|
|
87
|
+
*/
|
|
17
88
|
declare function getOrderItemLink(order: Order, productId: number): string;
|
|
89
|
+
/**
|
|
90
|
+
* Returns all return orders from a returns response.
|
|
91
|
+
* @param returns - The returns response object.
|
|
92
|
+
* @returns An array of {@link Order} objects, or an empty array if none exist.
|
|
93
|
+
*/
|
|
18
94
|
declare function getOrders(returns: GetReturnsResponse): Order[];
|
|
95
|
+
/**
|
|
96
|
+
* Returns the return reason associated with a return order item.
|
|
97
|
+
* @param returnItem - The order item.
|
|
98
|
+
* @returns The {@link OrderReturnReason} object, or `null` if not set.
|
|
99
|
+
*/
|
|
19
100
|
declare function getOrderItemReturnReason(returnItem: OrderItem): OrderReturnReason | null;
|
|
101
|
+
/**
|
|
102
|
+
* Returns the name of the return reason for a return order item.
|
|
103
|
+
* @param returnItem - The order item.
|
|
104
|
+
* @returns The return reason name string, or an empty string if not set.
|
|
105
|
+
*/
|
|
20
106
|
declare function getOrderItemReturnReasonName(returnItem: OrderItem): string;
|
|
107
|
+
/**
|
|
108
|
+
* Returns the numeric ID of the return reason for a return order item.
|
|
109
|
+
* @param returnItem - The order item.
|
|
110
|
+
* @returns The return reason ID, or `0` if not set.
|
|
111
|
+
*/
|
|
21
112
|
declare function getOrderItemReturnReasonId(returnItem: OrderItem): number;
|
|
113
|
+
/**
|
|
114
|
+
* Returns the list of available return reasons from a returns response.
|
|
115
|
+
* @param data - The order returns response object.
|
|
116
|
+
* @returns An array of {@link OrderReturnReason} objects.
|
|
117
|
+
*/
|
|
22
118
|
declare function getReturnReasons(data: OrderReturnsResponse): OrderReturnReason[];
|
|
119
|
+
/**
|
|
120
|
+
* Returns the name of a return reason.
|
|
121
|
+
* @param reason - The return reason object.
|
|
122
|
+
* @returns The reason name string.
|
|
123
|
+
*/
|
|
23
124
|
declare function getReturnReasonName(reason: OrderReturnReason): string;
|
|
125
|
+
/**
|
|
126
|
+
* Returns the numeric ID of a return reason.
|
|
127
|
+
* @param reason - The return reason object.
|
|
128
|
+
* @returns The reason ID.
|
|
129
|
+
*/
|
|
24
130
|
declare function getReturnReasonId(reason: OrderReturnReason): number;
|
|
131
|
+
/**
|
|
132
|
+
* Returns the ID of the default return reason from a returns response.
|
|
133
|
+
* @param data - The order returns response object.
|
|
134
|
+
* @returns The default return reason ID, or `null` if not set.
|
|
135
|
+
*/
|
|
25
136
|
declare function getDefaultReturnReasonId(data: OrderReturnsResponse): number | null;
|
|
26
137
|
export declare const returnGetters: {
|
|
27
138
|
getDate: typeof getDate;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"returnGetters.d.ts","sourceRoot":"","sources":["../../src/getters/returnGetters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EACV,iBAAiB,EACjB,KAAK,EACL,SAAS,EACT,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEhD,iBAAS,OAAO,CAAC,UAAU,EAAE,KAAK,GAAG,MAAM,CAM1C;AAED,iBAAS,KAAK,CAAC,UAAU,EAAE,KAAK,GAAG,MAAM,CAExC;AAED,iBAAS,SAAS,CAAC,UAAU,EAAE,KAAK,GAAG,MAAM,CAE5C;AAED,iBAAS,QAAQ,CAAC,UAAU,EAAE,KAAK,GAAG,MAAM,CAE3C;AAED,iBAAS,QAAQ,CAAC,UAAU,EAAE,KAAK,GAAG,SAAS,EAAE,CAEhD;
|
|
1
|
+
{"version":3,"file":"returnGetters.d.ts","sourceRoot":"","sources":["../../src/getters/returnGetters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EACV,iBAAiB,EACjB,KAAK,EACL,SAAS,EACT,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEhD;;;;GAIG;AACH,iBAAS,OAAO,CAAC,UAAU,EAAE,KAAK,GAAG,MAAM,CAM1C;AAED;;;;GAIG;AACH,iBAAS,KAAK,CAAC,UAAU,EAAE,KAAK,GAAG,MAAM,CAExC;AAED;;;;GAIG;AACH,iBAAS,SAA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