@simpleapps-com/augur-utils 2.3.1 → 2026.11.1
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/EXPORTS.md +24 -31
- package/README.md +19 -180
- package/dist/address-comparison.d.ts +18 -0
- package/dist/address-comparison.d.ts.map +1 -0
- package/dist/address-schemas.d.ts +45 -0
- package/dist/address-schemas.d.ts.map +1 -0
- package/dist/analytics.d.ts +66 -0
- package/dist/analytics.d.ts.map +1 -0
- package/dist/build-checkout-payload.d.ts +37 -0
- package/dist/build-checkout-payload.d.ts.map +1 -0
- package/dist/cache-config.d.ts +42 -0
- package/dist/cache-config.d.ts.map +1 -0
- package/dist/chunk-5UMFBGVA.cjs.map +1 -1
- package/dist/date-helpers.d.ts +16 -0
- package/dist/date-helpers.d.ts.map +1 -0
- package/dist/derive-price.d.ts +49 -0
- package/dist/derive-price.d.ts.map +1 -0
- package/dist/format-price.d.ts +6 -0
- package/dist/format-price.d.ts.map +1 -0
- package/dist/get-payment-status.d.ts +10 -0
- package/dist/get-payment-status.d.ts.map +1 -0
- package/dist/image-rules.d.ts +70 -0
- package/dist/image-rules.d.ts.map +1 -0
- package/dist/image.d.ts +80 -0
- package/dist/image.d.ts.map +1 -0
- package/dist/index.cjs +385 -171
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +63 -1409
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +374 -160
- package/dist/index.js.map +1 -1
- package/dist/json-ld-rules.d.ts +50 -0
- package/dist/json-ld-rules.d.ts.map +1 -0
- package/dist/json-ld.d.ts +34 -0
- package/dist/json-ld.d.ts.map +1 -0
- package/dist/money.d.ts +37 -0
- package/dist/money.d.ts.map +1 -0
- package/dist/price-breaks.d.ts +16 -0
- package/dist/price-breaks.d.ts.map +1 -0
- package/dist/price-outcome.d.ts +19 -0
- package/dist/price-outcome.d.ts.map +1 -0
- package/dist/resolve-stock.d.ts +22 -0
- package/dist/resolve-stock.d.ts.map +1 -0
- package/dist/result.d.ts +33 -0
- package/dist/result.d.ts.map +1 -0
- package/dist/rules.d.ts +45 -0
- package/dist/rules.d.ts.map +1 -0
- package/dist/schema-availability.d.ts +11 -0
- package/dist/schema-availability.d.ts.map +1 -0
- package/dist/transform-ship-to-address.d.ts +15 -0
- package/dist/transform-ship-to-address.d.ts.map +1 -0
- package/dist/transforms.d.ts +70 -0
- package/dist/transforms.d.ts.map +1 -0
- package/dist/types/api.d.ts +8 -0
- package/dist/types/api.d.ts.map +1 -0
- package/dist/types/attribute.d.ts +12 -0
- package/dist/types/attribute.d.ts.map +1 -0
- package/dist/types/cart.d.ts +25 -0
- package/dist/types/cart.d.ts.map +1 -0
- package/dist/types/category-items.d.ts +4 -0
- package/dist/types/category-items.d.ts.map +1 -0
- package/dist/types/category.d.ts +19 -0
- package/dist/types/category.d.ts.map +1 -0
- package/dist/types/checkout.d.ts +4 -0
- package/dist/types/checkout.d.ts.map +1 -0
- package/dist/types/customer.d.ts +4 -0
- package/dist/types/customer.d.ts.map +1 -0
- package/dist/types/filter.d.ts +9 -0
- package/dist/types/filter.d.ts.map +1 -0
- package/dist/types/inventory.d.ts +10 -0
- package/dist/types/inventory.d.ts.map +1 -0
- package/dist/types/joomla.d.ts +11 -0
- package/dist/types/joomla.d.ts.map +1 -0
- package/dist/types/ltl-shipping.d.ts +45 -0
- package/dist/types/ltl-shipping.d.ts.map +1 -0
- package/dist/types/menu.d.ts +14 -0
- package/dist/types/menu.d.ts.map +1 -0
- package/dist/types/meta.d.ts +11 -0
- package/dist/types/meta.d.ts.map +1 -0
- package/dist/types/order.d.ts +72 -0
- package/dist/types/order.d.ts.map +1 -0
- package/dist/types/password.d.ts +7 -0
- package/dist/types/password.d.ts.map +1 -0
- package/dist/types/payment.d.ts +69 -0
- package/dist/types/payment.d.ts.map +1 -0
- package/dist/types/pricing.d.ts +25 -0
- package/dist/types/pricing.d.ts.map +1 -0
- package/dist/types/product.d.ts +58 -0
- package/dist/types/product.d.ts.map +1 -0
- package/dist/types/search.d.ts +16 -0
- package/dist/types/search.d.ts.map +1 -0
- package/dist/types/shipping.d.ts +4 -0
- package/dist/types/shipping.d.ts.map +1 -0
- package/dist/types/smarty-streets.d.ts +4 -0
- package/dist/types/smarty-streets.d.ts.map +1 -0
- package/dist/types/supplier.d.ts +4 -0
- package/dist/types/supplier.d.ts.map +1 -0
- package/dist/types/tax.d.ts +6 -0
- package/dist/types/tax.d.ts.map +1 -0
- package/dist/types/uom.d.ts +4 -0
- package/dist/types/uom.d.ts.map +1 -0
- package/dist/types/user-profile.d.ts +5 -0
- package/dist/types/user-profile.d.ts.map +1 -0
- package/dist/us-states.d.ts +15 -0
- package/dist/us-states.d.ts.map +1 -0
- package/dist/validation-patterns.d.ts +22 -0
- package/dist/validation-patterns.d.ts.map +1 -0
- package/dist/web.cjs.map +1 -1
- package/dist/web.d.ts +3 -5
- package/dist/web.d.ts.map +1 -0
- package/llms.txt +44 -38
- package/package.json +25 -13
- package/dist/index.d.cts +0 -1409
- package/dist/web.d.cts +0 -6
package/dist/index.d.cts
DELETED
|
@@ -1,1409 +0,0 @@
|
|
|
1
|
-
export { cn } from './web.cjs';
|
|
2
|
-
import * as v from 'valibot';
|
|
3
|
-
import { State } from 'states-us';
|
|
4
|
-
export { State as USState } from 'states-us';
|
|
5
|
-
import 'clsx';
|
|
6
|
-
|
|
7
|
-
type TCartLine = {
|
|
8
|
-
cartHdrUid?: string | number;
|
|
9
|
-
invMastUid: number;
|
|
10
|
-
invMastUidCount: number;
|
|
11
|
-
isAssembly: string;
|
|
12
|
-
itemId: string;
|
|
13
|
-
lineNo: number;
|
|
14
|
-
lineNote: string | null;
|
|
15
|
-
quantity: number;
|
|
16
|
-
unitOfMeasure: string;
|
|
17
|
-
unitPrice?: number;
|
|
18
|
-
extendedPrice?: number;
|
|
19
|
-
listPrice?: number;
|
|
20
|
-
itemDescription?: string;
|
|
21
|
-
};
|
|
22
|
-
type TCartLookUp = {
|
|
23
|
-
cartHdrUid: number;
|
|
24
|
-
cartToken: string;
|
|
25
|
-
contactId: number;
|
|
26
|
-
customerId: number;
|
|
27
|
-
userId: number;
|
|
28
|
-
};
|
|
29
|
-
type TCartHdrUid = Pick<TCartLine, "cartHdrUid">;
|
|
30
|
-
type TOrderCartLine = {
|
|
31
|
-
inv_mast_uid: number;
|
|
32
|
-
item_id: string;
|
|
33
|
-
qty: number;
|
|
34
|
-
uom: string;
|
|
35
|
-
weight: number;
|
|
36
|
-
classId5: string | null;
|
|
37
|
-
unitPrice: number;
|
|
38
|
-
manualPriceOverride?: string;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
type TCategoryChild = {
|
|
42
|
-
itemCategoryUid: number;
|
|
43
|
-
itemCategoryId: string;
|
|
44
|
-
itemCategoryDesc: string;
|
|
45
|
-
fullPath: string;
|
|
46
|
-
cleanPath: string;
|
|
47
|
-
categoryImage: string;
|
|
48
|
-
sequenceNo: number;
|
|
49
|
-
productCollection: null;
|
|
50
|
-
itemCount: number;
|
|
51
|
-
};
|
|
52
|
-
type TCategory = {
|
|
53
|
-
itemCategoryUid: number;
|
|
54
|
-
itemCategoryId: string;
|
|
55
|
-
itemCategoryDesc: string;
|
|
56
|
-
categoryImage: string | null;
|
|
57
|
-
parentItemCategoryUid: number;
|
|
58
|
-
nodeCount: number;
|
|
59
|
-
fullPath: string;
|
|
60
|
-
cleanPath: string;
|
|
61
|
-
displayOnWebFlag: string;
|
|
62
|
-
subItemCategoryUids: number[];
|
|
63
|
-
maxItems: number;
|
|
64
|
-
itemsByCategory: number;
|
|
65
|
-
children: TCategoryChild[];
|
|
66
|
-
childrenTotal: number;
|
|
67
|
-
childrenCount: number;
|
|
68
|
-
};
|
|
69
|
-
type TItemCategory = {
|
|
70
|
-
itemCategoryUid: number;
|
|
71
|
-
itemCategoryId: string;
|
|
72
|
-
itemCategoryDesc: string;
|
|
73
|
-
masterCategoryFlag: string;
|
|
74
|
-
parentCategoryFlag: string;
|
|
75
|
-
displayOnWebFlag: string;
|
|
76
|
-
displayMasterProductFlag: string;
|
|
77
|
-
catalogPage: string | null;
|
|
78
|
-
deleteFlag: string;
|
|
79
|
-
dateCreated: string;
|
|
80
|
-
createdBy: string;
|
|
81
|
-
dateLastModified: string;
|
|
82
|
-
lastMaintainedBy: string;
|
|
83
|
-
subCategoryImageFile: string | null;
|
|
84
|
-
updateCd: number;
|
|
85
|
-
statusCd: number;
|
|
86
|
-
processCd: number;
|
|
87
|
-
itemCount: number;
|
|
88
|
-
};
|
|
89
|
-
type TProductCategory = {
|
|
90
|
-
fullPath: string;
|
|
91
|
-
itemCategoryDesc: string;
|
|
92
|
-
itemCategoryId: string;
|
|
93
|
-
itemCategoryUid: number;
|
|
94
|
-
itemCount: number;
|
|
95
|
-
productCollection: string | null;
|
|
96
|
-
sequenceNo: number;
|
|
97
|
-
children: TProductCategory[];
|
|
98
|
-
childrenTotal: number;
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
type TInventorySupplier = {
|
|
102
|
-
inventorySupplierUid: number;
|
|
103
|
-
invMastUid: number;
|
|
104
|
-
supplierId: number;
|
|
105
|
-
upcCode: string;
|
|
106
|
-
checkDigit: string;
|
|
107
|
-
upc: string;
|
|
108
|
-
supplierPartNo: string;
|
|
109
|
-
primarySupplierFlag: string | null;
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
type TItemUom = {
|
|
113
|
-
unitOfMeasure: string;
|
|
114
|
-
unitSize: number;
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
type TItemAttribute = {
|
|
118
|
-
attributeName: string;
|
|
119
|
-
attributeValue: string;
|
|
120
|
-
};
|
|
121
|
-
type TAttributeValue = {
|
|
122
|
-
attributeValue: string;
|
|
123
|
-
attributeValueUid: number;
|
|
124
|
-
};
|
|
125
|
-
type TAttribute = {
|
|
126
|
-
attributeDesc: string;
|
|
127
|
-
attributeId: string;
|
|
128
|
-
attributeUid: number;
|
|
129
|
-
sequenceNo: number;
|
|
130
|
-
valueCount: number;
|
|
131
|
-
values: TAttributeValue[];
|
|
132
|
-
};
|
|
133
|
-
/** Wrapper returned by the OpenSearch item category attributes endpoint. */
|
|
134
|
-
type TItemAttributes = {
|
|
135
|
-
attributes: TAttribute[];
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
type TInvMast = {
|
|
139
|
-
invMastUid: number;
|
|
140
|
-
itemId: string;
|
|
141
|
-
itemDesc: string;
|
|
142
|
-
deleteFlag: string;
|
|
143
|
-
weight: number;
|
|
144
|
-
dateCreated: string;
|
|
145
|
-
dateLastModified: string;
|
|
146
|
-
inactive: string;
|
|
147
|
-
classId1: string;
|
|
148
|
-
classId2: string | null;
|
|
149
|
-
classId3: string | null;
|
|
150
|
-
classId4: string;
|
|
151
|
-
classId5: string;
|
|
152
|
-
upcOrEan: string;
|
|
153
|
-
upcOrEanId: string;
|
|
154
|
-
serialized: string;
|
|
155
|
-
productType: string;
|
|
156
|
-
dLength: string | null;
|
|
157
|
-
shortCode: string;
|
|
158
|
-
price1: number;
|
|
159
|
-
price2: number;
|
|
160
|
-
price3: number;
|
|
161
|
-
price4: number;
|
|
162
|
-
price5: number;
|
|
163
|
-
price6: number;
|
|
164
|
-
price7: number;
|
|
165
|
-
price8: number;
|
|
166
|
-
price9: number;
|
|
167
|
-
price10: number;
|
|
168
|
-
extendedDesc: string | null;
|
|
169
|
-
defaultSellingUnit: string;
|
|
170
|
-
hazMatFlag: string;
|
|
171
|
-
keywords: string;
|
|
172
|
-
disposition: string;
|
|
173
|
-
baseUnit: string;
|
|
174
|
-
restrictedFlag: string | null;
|
|
175
|
-
parkerProductCd: number | null;
|
|
176
|
-
parkerDivisionCd: number | null;
|
|
177
|
-
commodityCode: string;
|
|
178
|
-
unspscCode: string | null;
|
|
179
|
-
dciCode: string | null;
|
|
180
|
-
epaCertReqFlag: string;
|
|
181
|
-
length: null;
|
|
182
|
-
width: null;
|
|
183
|
-
height: null;
|
|
184
|
-
itemNotes: null;
|
|
185
|
-
vndrStock: unknown | null;
|
|
186
|
-
manufacturerName: string;
|
|
187
|
-
brandName: string;
|
|
188
|
-
partNumber: null;
|
|
189
|
-
updateCd: number;
|
|
190
|
-
defaultProductGroup: string;
|
|
191
|
-
upcOrEanPrefix: string;
|
|
192
|
-
upcOrEanItem: string;
|
|
193
|
-
attributeGroupUid: number | null;
|
|
194
|
-
defaultPriceFamilyUid: number;
|
|
195
|
-
purchasePricingUnit: string;
|
|
196
|
-
purchasePricingUnitSize: number;
|
|
197
|
-
salesPricingUnit: string;
|
|
198
|
-
salesPricingUnitSize: number;
|
|
199
|
-
defaultPurchasingUnit: string;
|
|
200
|
-
statusCd: number;
|
|
201
|
-
onlineCd: number;
|
|
202
|
-
processCd: number;
|
|
203
|
-
};
|
|
204
|
-
type TStockData = {
|
|
205
|
-
baseUnit: string;
|
|
206
|
-
baseUnitSize: number;
|
|
207
|
-
calcQtyAllocated: number;
|
|
208
|
-
calcQtyAvailable: number;
|
|
209
|
-
calcQtyOnHand: number;
|
|
210
|
-
companyId: string;
|
|
211
|
-
defaultSellingUnit: string;
|
|
212
|
-
defaultSellingUnitSize: number;
|
|
213
|
-
discontinued: string;
|
|
214
|
-
divisor: number;
|
|
215
|
-
locationId: number;
|
|
216
|
-
locationName: string;
|
|
217
|
-
nextDueInPoDate: string | null;
|
|
218
|
-
orderQuantity: number;
|
|
219
|
-
primaryBin: string;
|
|
220
|
-
productGroupId: string;
|
|
221
|
-
qtyAllocated: number;
|
|
222
|
-
qtyAvailable: number;
|
|
223
|
-
qtyBackordered: number;
|
|
224
|
-
qtyFrozen: number;
|
|
225
|
-
qtyOnHand: number;
|
|
226
|
-
qtyQuarantined: number;
|
|
227
|
-
stockable: string;
|
|
228
|
-
unallocated: number;
|
|
229
|
-
};
|
|
230
|
-
type TStock = {
|
|
231
|
-
companySummary: Record<string, number>;
|
|
232
|
-
stockData: TStockData[];
|
|
233
|
-
};
|
|
234
|
-
type TInvMastDoc = {
|
|
235
|
-
invMastUid: number;
|
|
236
|
-
itemId: string;
|
|
237
|
-
itemDesc: string;
|
|
238
|
-
displayDesc: string;
|
|
239
|
-
extendedDesc: string | null;
|
|
240
|
-
defaultSellingUnit: string;
|
|
241
|
-
baseUnit: string;
|
|
242
|
-
vndrStock: number | null;
|
|
243
|
-
classId1: string | null;
|
|
244
|
-
classId2: string | null;
|
|
245
|
-
classId3: string | null;
|
|
246
|
-
classId4: string | null;
|
|
247
|
-
classId5: string | null;
|
|
248
|
-
defaultProductGroup: string | null;
|
|
249
|
-
upcOrEanId: string | null;
|
|
250
|
-
upcOrEan: string | null;
|
|
251
|
-
weight: number | null;
|
|
252
|
-
length: number | null;
|
|
253
|
-
width: number | null;
|
|
254
|
-
height: number | null;
|
|
255
|
-
inventorySupplier: TInventorySupplier[];
|
|
256
|
-
itemUom: TItemUom[];
|
|
257
|
-
attributes: TItemAttribute[];
|
|
258
|
-
images: string[];
|
|
259
|
-
categoryList: number[];
|
|
260
|
-
userDefined: string[];
|
|
261
|
-
invMastText: string[];
|
|
262
|
-
stock: TStock;
|
|
263
|
-
brandName?: string;
|
|
264
|
-
parkerProductCd?: string;
|
|
265
|
-
onlineCd: number;
|
|
266
|
-
statusCd: number;
|
|
267
|
-
deleteFlag: string;
|
|
268
|
-
};
|
|
269
|
-
|
|
270
|
-
type TProductStockData = {
|
|
271
|
-
locationId: number;
|
|
272
|
-
companyId: string;
|
|
273
|
-
qtyOnHand: number;
|
|
274
|
-
qtyAllocated: number;
|
|
275
|
-
stockable: string;
|
|
276
|
-
unallocated: number;
|
|
277
|
-
nextDueInPoDate: string | null;
|
|
278
|
-
qtyBackordered: number;
|
|
279
|
-
primaryBin: string;
|
|
280
|
-
discontinued: string;
|
|
281
|
-
qtyFrozen: number;
|
|
282
|
-
qtyQuarantined: number;
|
|
283
|
-
qtyAvailable: number;
|
|
284
|
-
};
|
|
285
|
-
type TProductItem = {
|
|
286
|
-
brandName: string;
|
|
287
|
-
defaultSellingUnit: string;
|
|
288
|
-
extendedDesc: string;
|
|
289
|
-
images: string[];
|
|
290
|
-
invMastUid: number;
|
|
291
|
-
itemDesc: string;
|
|
292
|
-
itemId: string;
|
|
293
|
-
displayDesc: string;
|
|
294
|
-
manufacturerName: string;
|
|
295
|
-
shortCode: string | null;
|
|
296
|
-
classId5: string;
|
|
297
|
-
stock: {
|
|
298
|
-
stockData: TProductStockData[];
|
|
299
|
-
companySummary: Record<string, number>;
|
|
300
|
-
};
|
|
301
|
-
sourceFields: {
|
|
302
|
-
display_desc: string;
|
|
303
|
-
};
|
|
304
|
-
vndrStock: number;
|
|
305
|
-
};
|
|
306
|
-
type TItemDetails = {
|
|
307
|
-
attributes: TItemAttribute[];
|
|
308
|
-
categoryList: number[];
|
|
309
|
-
classId1: string | null;
|
|
310
|
-
classId2: string | null;
|
|
311
|
-
classId3: string | null;
|
|
312
|
-
classId4: string | null;
|
|
313
|
-
classId5: string | null;
|
|
314
|
-
defaultSellingUnit: string;
|
|
315
|
-
displayDesc: string;
|
|
316
|
-
extendedDesc: string;
|
|
317
|
-
images: string[];
|
|
318
|
-
invMastText: string[];
|
|
319
|
-
invMastUid: number;
|
|
320
|
-
itemDesc: string;
|
|
321
|
-
itemId: string;
|
|
322
|
-
itemUom: TItemUom[];
|
|
323
|
-
length: number;
|
|
324
|
-
vndrStock: number | null;
|
|
325
|
-
userDefined: string[];
|
|
326
|
-
isWood: boolean;
|
|
327
|
-
defaultProductGroup: string | null;
|
|
328
|
-
};
|
|
329
|
-
type TItemAccessory = {
|
|
330
|
-
childItemUom: TItemUom[];
|
|
331
|
-
childItemDesc: string;
|
|
332
|
-
childInvMastUid: number;
|
|
333
|
-
childItemId: string;
|
|
334
|
-
};
|
|
335
|
-
type TItemRelatedProduct = TItemDetails & {
|
|
336
|
-
childItemUom: TItemUom[];
|
|
337
|
-
childItemDesc: string;
|
|
338
|
-
childInvMastUid: number;
|
|
339
|
-
childItemId: string;
|
|
340
|
-
childImages: string[];
|
|
341
|
-
};
|
|
342
|
-
/** Flat related product shape from the Items service (also-bought, accessories). */
|
|
343
|
-
type TRelatedProduct = {
|
|
344
|
-
invAccessoryUid: number;
|
|
345
|
-
parentInvMastUid: number;
|
|
346
|
-
childInvMastUid: number;
|
|
347
|
-
childItemId: string;
|
|
348
|
-
childItemDesc: string;
|
|
349
|
-
childDisplayDesc: string;
|
|
350
|
-
childDefaultSellingUnit: string;
|
|
351
|
-
classId1: string;
|
|
352
|
-
classId2: string;
|
|
353
|
-
classId3: string;
|
|
354
|
-
classId4: string;
|
|
355
|
-
classId5: string;
|
|
356
|
-
childItemUom: {
|
|
357
|
-
unitOfMeasure: string;
|
|
358
|
-
unitSize: number;
|
|
359
|
-
}[];
|
|
360
|
-
childImages: string[];
|
|
361
|
-
};
|
|
362
|
-
|
|
363
|
-
type TLibraryPriceBreak = {
|
|
364
|
-
calculationValue: number;
|
|
365
|
-
break: number;
|
|
366
|
-
unitPrice: number;
|
|
367
|
-
};
|
|
368
|
-
type TLibraryPriceData = {
|
|
369
|
-
unitPrice: number;
|
|
370
|
-
quantity: number;
|
|
371
|
-
pricePageUid: number;
|
|
372
|
-
pricePageCdType: number;
|
|
373
|
-
pricePageCdDesc: string;
|
|
374
|
-
effectiveDate: string;
|
|
375
|
-
expirationDate: string;
|
|
376
|
-
itemId: string;
|
|
377
|
-
invMastUid: number;
|
|
378
|
-
pricingMethodCd: number;
|
|
379
|
-
pricingMethodCdDesc: string;
|
|
380
|
-
sourcePriceCd: number;
|
|
381
|
-
sourcePriceCdDesc: string;
|
|
382
|
-
calculationMethodCd: number;
|
|
383
|
-
calculationMethodCdDesc: string;
|
|
384
|
-
totalingMethodCd: number;
|
|
385
|
-
totalingMethodCdDesc: string;
|
|
386
|
-
purchasePricingUnit: string;
|
|
387
|
-
purchasePricingUnitSize: number;
|
|
388
|
-
salesPricingUnit: string;
|
|
389
|
-
salesPricingUnitSize: number;
|
|
390
|
-
unitOfMeasure: string;
|
|
391
|
-
unitOfMeasureSize: number;
|
|
392
|
-
defaultSellingUnit: string;
|
|
393
|
-
defaultSellingUnitSize: number;
|
|
394
|
-
defaultPurchasingUnit: string;
|
|
395
|
-
defaultPurchasingUnitSize: number;
|
|
396
|
-
baseUnit: string;
|
|
397
|
-
baseUnitSize: number;
|
|
398
|
-
sourcePrice: number;
|
|
399
|
-
multiplier: number;
|
|
400
|
-
pricePageDiscountGroupId: string;
|
|
401
|
-
invLocSalesDiscountGroup: string;
|
|
402
|
-
baseSize: number;
|
|
403
|
-
basePrice: number;
|
|
404
|
-
breaks: Record<string, TLibraryPriceBreak>;
|
|
405
|
-
};
|
|
406
|
-
type TPriceData = {
|
|
407
|
-
pricedFrom: string;
|
|
408
|
-
unitPrice: number;
|
|
409
|
-
unitOfMeasure?: string;
|
|
410
|
-
jobPrice: boolean;
|
|
411
|
-
priceType: string;
|
|
412
|
-
customer: {
|
|
413
|
-
customerId: number;
|
|
414
|
-
valid: boolean;
|
|
415
|
-
sourcePriceCd: boolean;
|
|
416
|
-
hasJobPricing: boolean;
|
|
417
|
-
};
|
|
418
|
-
item: {
|
|
419
|
-
itemId: string;
|
|
420
|
-
valid: boolean;
|
|
421
|
-
invMastUid: number;
|
|
422
|
-
quantity: number;
|
|
423
|
-
unitOfMeasure: string;
|
|
424
|
-
};
|
|
425
|
-
options: {
|
|
426
|
-
customerId: string;
|
|
427
|
-
itemId: string;
|
|
428
|
-
cacheTtl: number;
|
|
429
|
-
};
|
|
430
|
-
messages: string[];
|
|
431
|
-
libraryPriceData: TLibraryPriceData;
|
|
432
|
-
listPrice: number;
|
|
433
|
-
};
|
|
434
|
-
|
|
435
|
-
type TItemsFilters = {
|
|
436
|
-
filters: [string, string][];
|
|
437
|
-
limit: number;
|
|
438
|
-
offset: number;
|
|
439
|
-
sortBy: string;
|
|
440
|
-
q: string;
|
|
441
|
-
page?: number;
|
|
442
|
-
};
|
|
443
|
-
|
|
444
|
-
type TApiResponse<T> = {
|
|
445
|
-
status: string;
|
|
446
|
-
data: T | undefined;
|
|
447
|
-
error: {
|
|
448
|
-
message: string;
|
|
449
|
-
} | undefined;
|
|
450
|
-
};
|
|
451
|
-
|
|
452
|
-
type CustomerDocument = {
|
|
453
|
-
customerId: number;
|
|
454
|
-
companyId: string;
|
|
455
|
-
customerName: string;
|
|
456
|
-
class1Id: string;
|
|
457
|
-
class2Id: string | null;
|
|
458
|
-
class3Id: string | null;
|
|
459
|
-
class4Id: string | null;
|
|
460
|
-
class5Id: string | null;
|
|
461
|
-
webEnabledFlag: string;
|
|
462
|
-
deleteFlag: string;
|
|
463
|
-
salesRepId: string;
|
|
464
|
-
poNoRequired: string;
|
|
465
|
-
termsId: string;
|
|
466
|
-
termsDesc: string;
|
|
467
|
-
taxableFlag: string;
|
|
468
|
-
userDefined: string[];
|
|
469
|
-
};
|
|
470
|
-
|
|
471
|
-
type MenuItem = {
|
|
472
|
-
id: number;
|
|
473
|
-
access: number;
|
|
474
|
-
alias: string;
|
|
475
|
-
level: number;
|
|
476
|
-
link: string;
|
|
477
|
-
menuType: string;
|
|
478
|
-
parentId: number;
|
|
479
|
-
path: string;
|
|
480
|
-
published: number;
|
|
481
|
-
title: string;
|
|
482
|
-
type: string;
|
|
483
|
-
children: MenuItem[];
|
|
484
|
-
};
|
|
485
|
-
type TMenu = {
|
|
486
|
-
id: number;
|
|
487
|
-
title: string;
|
|
488
|
-
alias: string;
|
|
489
|
-
link: string;
|
|
490
|
-
level: number;
|
|
491
|
-
parentId: number;
|
|
492
|
-
path: string;
|
|
493
|
-
published: number;
|
|
494
|
-
type: string;
|
|
495
|
-
menutype: string;
|
|
496
|
-
lft: number;
|
|
497
|
-
rgt: number;
|
|
498
|
-
checkedOut: number;
|
|
499
|
-
checkedOutTime: string;
|
|
500
|
-
componentId: number;
|
|
501
|
-
clientId: number;
|
|
502
|
-
browserNav: number;
|
|
503
|
-
templateStyleId: number;
|
|
504
|
-
note: string;
|
|
505
|
-
language: string;
|
|
506
|
-
params: string;
|
|
507
|
-
};
|
|
508
|
-
type TMenuFilters = {
|
|
509
|
-
limit: number;
|
|
510
|
-
offset: number;
|
|
511
|
-
menutype: string;
|
|
512
|
-
parentId: number;
|
|
513
|
-
published: number;
|
|
514
|
-
orderBy: string;
|
|
515
|
-
};
|
|
516
|
-
|
|
517
|
-
type TSmartyStreets = {
|
|
518
|
-
addressee: string | null;
|
|
519
|
-
carrierRoute: string;
|
|
520
|
-
cityName: string;
|
|
521
|
-
congressionalDistrict: string;
|
|
522
|
-
defaultCityName: string;
|
|
523
|
-
deliveryLine1: string;
|
|
524
|
-
deliveryLine2: string | null;
|
|
525
|
-
deliveryPoint: string;
|
|
526
|
-
deliveryPointCheckDigit: string;
|
|
527
|
-
dpvCmra: string;
|
|
528
|
-
dpvConfirmation: string;
|
|
529
|
-
dpvFootnotes: string;
|
|
530
|
-
dpvNoStat: string;
|
|
531
|
-
dpvVacant: string;
|
|
532
|
-
elotSequence: string;
|
|
533
|
-
elotSort: string;
|
|
534
|
-
ewsMatch: boolean;
|
|
535
|
-
fipsCountyCode: string;
|
|
536
|
-
footnotes: string;
|
|
537
|
-
lacsLinkCode: string;
|
|
538
|
-
lacsLinkIndicator: string;
|
|
539
|
-
lastLine: string;
|
|
540
|
-
latitude: number;
|
|
541
|
-
longitude: number;
|
|
542
|
-
plus4Code: string;
|
|
543
|
-
postOfficeCity: string;
|
|
544
|
-
postOfficeState: string;
|
|
545
|
-
precision: string;
|
|
546
|
-
primaryNumber: string;
|
|
547
|
-
recordType: string;
|
|
548
|
-
rdi: string;
|
|
549
|
-
secondaryDesignator: string;
|
|
550
|
-
secondaryNumber: string;
|
|
551
|
-
stateAbbreviation: string;
|
|
552
|
-
streetName: string;
|
|
553
|
-
streetPostdirection: string;
|
|
554
|
-
streetPredirection: string;
|
|
555
|
-
streetSuffix: string;
|
|
556
|
-
suiteboxNotFound: string;
|
|
557
|
-
urbanization: string;
|
|
558
|
-
zipCode: string;
|
|
559
|
-
zipCodeType: string;
|
|
560
|
-
};
|
|
561
|
-
|
|
562
|
-
type TJoomlaContent = {
|
|
563
|
-
id: number;
|
|
564
|
-
title: string;
|
|
565
|
-
alias: string;
|
|
566
|
-
catid: number;
|
|
567
|
-
introtext: string;
|
|
568
|
-
fulltext: string;
|
|
569
|
-
ordering: number;
|
|
570
|
-
images: string[];
|
|
571
|
-
imageIntro: string;
|
|
572
|
-
fields: Record<string, unknown>;
|
|
573
|
-
};
|
|
574
|
-
type TJoomlaContentFilters = {
|
|
575
|
-
limit: number;
|
|
576
|
-
offset: number;
|
|
577
|
-
q: string;
|
|
578
|
-
sortBy: string;
|
|
579
|
-
tagslist: string;
|
|
580
|
-
};
|
|
581
|
-
|
|
582
|
-
type TProfileValues = Record<string, string | number | undefined>;
|
|
583
|
-
type TUserProfile = {
|
|
584
|
-
email: string;
|
|
585
|
-
id: number;
|
|
586
|
-
name: string;
|
|
587
|
-
username: string;
|
|
588
|
-
customerId: number | string | undefined;
|
|
589
|
-
contactId: number | string | undefined;
|
|
590
|
-
profileValues: TProfileValues;
|
|
591
|
-
groups: {
|
|
592
|
-
id: number | string;
|
|
593
|
-
title: string;
|
|
594
|
-
}[];
|
|
595
|
-
};
|
|
596
|
-
|
|
597
|
-
type OrderHeader = {
|
|
598
|
-
carrier_id: string;
|
|
599
|
-
carrier_name: string;
|
|
600
|
-
contact_id: string;
|
|
601
|
-
customer_id: string;
|
|
602
|
-
company_id: string;
|
|
603
|
-
user_id: string;
|
|
604
|
-
user_email: string;
|
|
605
|
-
quote: "Y" | "N";
|
|
606
|
-
import_as_quote: "Y" | "N";
|
|
607
|
-
ip_address: string;
|
|
608
|
-
order_source: string;
|
|
609
|
-
web_source: string;
|
|
610
|
-
class_id1: string | null;
|
|
611
|
-
class_id2: string | null;
|
|
612
|
-
class_id3: string | null;
|
|
613
|
-
class_id4: string | null;
|
|
614
|
-
class_id5: string | null;
|
|
615
|
-
generate_po_number: number;
|
|
616
|
-
is_sample: string;
|
|
617
|
-
order_date: string;
|
|
618
|
-
customer_po_number: string;
|
|
619
|
-
ship_to_name: string;
|
|
620
|
-
ship_to_address1: string;
|
|
621
|
-
ship_to_address2: string;
|
|
622
|
-
ship_to_city: string;
|
|
623
|
-
ship_to_state: string;
|
|
624
|
-
ship_to_country: string;
|
|
625
|
-
ship_to_postal_code: string;
|
|
626
|
-
ship_to_address3: string | null;
|
|
627
|
-
ship_to_companyname: string;
|
|
628
|
-
ship_to_phone: string;
|
|
629
|
-
ship_to_email: string;
|
|
630
|
-
terms: string | null;
|
|
631
|
-
packing_basis: string | null;
|
|
632
|
-
delivery_instructions: string | null;
|
|
633
|
-
cart_tax: {
|
|
634
|
-
tax_amount: number;
|
|
635
|
-
tax_amount_string: string;
|
|
636
|
-
};
|
|
637
|
-
shipping_estimate: number;
|
|
638
|
-
incoming_freight: number;
|
|
639
|
-
handling_fee: number;
|
|
640
|
-
manager_approval_needed: number;
|
|
641
|
-
};
|
|
642
|
-
type OrderLine = {
|
|
643
|
-
item_id: string;
|
|
644
|
-
item_name: string;
|
|
645
|
-
currency: string;
|
|
646
|
-
index: number;
|
|
647
|
-
item_category: string;
|
|
648
|
-
price: number;
|
|
649
|
-
quantity: number;
|
|
650
|
-
displayDesc: string;
|
|
651
|
-
};
|
|
652
|
-
type OrderPayment = {
|
|
653
|
-
first_name: string;
|
|
654
|
-
last_name: string;
|
|
655
|
-
street_address1: string;
|
|
656
|
-
street_address2: string;
|
|
657
|
-
city: string;
|
|
658
|
-
state: string;
|
|
659
|
-
zip_code: string;
|
|
660
|
-
country: string;
|
|
661
|
-
processor: "invoice" | "element";
|
|
662
|
-
paymentType: "unified" | "invoice";
|
|
663
|
-
};
|
|
664
|
-
type OrderNote = {
|
|
665
|
-
note: string;
|
|
666
|
-
note_areas: string[];
|
|
667
|
-
};
|
|
668
|
-
|
|
669
|
-
type TShippingMethod = {
|
|
670
|
-
billingWeight: number;
|
|
671
|
-
billingWeightUom: string | null;
|
|
672
|
-
guaranteedDaysToDelivery: string | null;
|
|
673
|
-
negotiatedRates: number;
|
|
674
|
-
scheduledDeliveryTime: string | null;
|
|
675
|
-
serviceCode: string;
|
|
676
|
-
serviceName: string;
|
|
677
|
-
serviceOptionsCharges: number;
|
|
678
|
-
totalCharges: number;
|
|
679
|
-
transportationCharges: number;
|
|
680
|
-
};
|
|
681
|
-
|
|
682
|
-
type TLtlRatesResponse = {
|
|
683
|
-
vendorContractId: string;
|
|
684
|
-
vendorId: string;
|
|
685
|
-
vendorName: string;
|
|
686
|
-
transitDays: number;
|
|
687
|
-
estimatedDeliveryDate: string;
|
|
688
|
-
milesInTransit: string;
|
|
689
|
-
totalCharges: number;
|
|
690
|
-
};
|
|
691
|
-
type TLtlShipmentData = {
|
|
692
|
-
international: boolean;
|
|
693
|
-
fromAddressLine: string;
|
|
694
|
-
fromCity: string;
|
|
695
|
-
fromState: string;
|
|
696
|
-
fromPostalCode: string;
|
|
697
|
-
fromCountryCode: string;
|
|
698
|
-
fromCompanyName: string;
|
|
699
|
-
fromPhone: string;
|
|
700
|
-
fromFirstName: string;
|
|
701
|
-
fromLastName: string;
|
|
702
|
-
toAddressLine: string;
|
|
703
|
-
toCity: string;
|
|
704
|
-
toRegion: string;
|
|
705
|
-
toPostalCode: string;
|
|
706
|
-
toCountryCode: string;
|
|
707
|
-
toCompanyName: string;
|
|
708
|
-
toPhone: string;
|
|
709
|
-
toFirstName: string;
|
|
710
|
-
toLastName: string;
|
|
711
|
-
totalWeight: number;
|
|
712
|
-
handlingCharge: number;
|
|
713
|
-
handlingChargeUnit: string;
|
|
714
|
-
pickupInstructions: string;
|
|
715
|
-
deliveryInstructions: string;
|
|
716
|
-
packageLength: number;
|
|
717
|
-
packageWidth: number;
|
|
718
|
-
packageHeight: number;
|
|
719
|
-
dimensionUnit: string;
|
|
720
|
-
weightUnit: string;
|
|
721
|
-
quantity: number;
|
|
722
|
-
responseFormat: string;
|
|
723
|
-
version: string;
|
|
724
|
-
siteid: string;
|
|
725
|
-
};
|
|
726
|
-
|
|
727
|
-
type TSearchSuggestion = {
|
|
728
|
-
suggestionsUid: number;
|
|
729
|
-
queryStringUid: number;
|
|
730
|
-
suggestionsString: string;
|
|
731
|
-
suggestionsMetaphone: string | null;
|
|
732
|
-
avgTotalResults: number;
|
|
733
|
-
dateCreated: string;
|
|
734
|
-
dateLastModified: string;
|
|
735
|
-
updateCd: number;
|
|
736
|
-
statusCd: number;
|
|
737
|
-
processCd: number;
|
|
738
|
-
score: number;
|
|
739
|
-
};
|
|
740
|
-
type TSearchSuggestionsResponse = {
|
|
741
|
-
count: number;
|
|
742
|
-
data: TSearchSuggestion[];
|
|
743
|
-
message: string;
|
|
744
|
-
options: unknown[];
|
|
745
|
-
params: unknown[];
|
|
746
|
-
status: number;
|
|
747
|
-
total: number;
|
|
748
|
-
totalResults: number;
|
|
749
|
-
};
|
|
750
|
-
|
|
751
|
-
type TTaxItem = {
|
|
752
|
-
itemId: string;
|
|
753
|
-
quantity: number;
|
|
754
|
-
unitOfMeasure: string;
|
|
755
|
-
unitPrice: number;
|
|
756
|
-
};
|
|
757
|
-
type TTax = {
|
|
758
|
-
taxEstimate: number;
|
|
759
|
-
customerId: number;
|
|
760
|
-
postalCode: string;
|
|
761
|
-
taxRate: number;
|
|
762
|
-
items: TTaxItem[];
|
|
763
|
-
};
|
|
764
|
-
|
|
765
|
-
type TCategoryItemsResult = {
|
|
766
|
-
itemCategoryUid: number;
|
|
767
|
-
itemCategoryId?: string;
|
|
768
|
-
itemCategoryDesc?: string;
|
|
769
|
-
took: number;
|
|
770
|
-
total: number;
|
|
771
|
-
items: TProductItem[];
|
|
772
|
-
};
|
|
773
|
-
|
|
774
|
-
type TTransactionSetup = {
|
|
775
|
-
transactionSetupId: string;
|
|
776
|
-
uiEndpoint?: string;
|
|
777
|
-
};
|
|
778
|
-
type TAccountQuery = {
|
|
779
|
-
PaymentAccountID: string;
|
|
780
|
-
TransactionSetupID?: string;
|
|
781
|
-
ExpressResponseCode?: string;
|
|
782
|
-
ExpressResponseMessage?: string;
|
|
783
|
-
ValidationCode?: string;
|
|
784
|
-
TruncatedCardNumber?: string;
|
|
785
|
-
ExpirationMonth?: string;
|
|
786
|
-
ExpirationYear?: string;
|
|
787
|
-
PaymentBrand?: string;
|
|
788
|
-
Bin?: string;
|
|
789
|
-
};
|
|
790
|
-
type TCardInfo = {
|
|
791
|
-
cardNumber?: string;
|
|
792
|
-
expMonth?: string;
|
|
793
|
-
expYear?: string;
|
|
794
|
-
transactionSetupId?: string;
|
|
795
|
-
};
|
|
796
|
-
type TSurcharge = {
|
|
797
|
-
surchargeAmount: number;
|
|
798
|
-
surchargeRate?: number;
|
|
799
|
-
};
|
|
800
|
-
type TBillingUpdate = {
|
|
801
|
-
success: boolean;
|
|
802
|
-
message?: string;
|
|
803
|
-
};
|
|
804
|
-
type TPaymentValidation = {
|
|
805
|
-
valid: boolean;
|
|
806
|
-
message?: string;
|
|
807
|
-
};
|
|
808
|
-
type CheckoutPayment = {
|
|
809
|
-
first_name: string;
|
|
810
|
-
last_name: string;
|
|
811
|
-
street_address1: string;
|
|
812
|
-
street_address2: string;
|
|
813
|
-
city: string;
|
|
814
|
-
state: string;
|
|
815
|
-
zip_code: string;
|
|
816
|
-
country: string;
|
|
817
|
-
processor: "invoice" | "element";
|
|
818
|
-
paymentType: "unified" | "invoice";
|
|
819
|
-
TransactionSetupID?: string;
|
|
820
|
-
PaymentAccountID?: string;
|
|
821
|
-
LastFour?: string;
|
|
822
|
-
ValidationCode?: string;
|
|
823
|
-
ExpirationMonth?: string;
|
|
824
|
-
ExpirationYear?: string;
|
|
825
|
-
PaymentBrand?: string;
|
|
826
|
-
Bin?: string;
|
|
827
|
-
};
|
|
828
|
-
|
|
829
|
-
type TCheckoutResult = {
|
|
830
|
-
checkoutUid?: number;
|
|
831
|
-
body?: {
|
|
832
|
-
header?: Record<string, unknown>;
|
|
833
|
-
lines?: Record<string, unknown>[];
|
|
834
|
-
};
|
|
835
|
-
header?: Record<string, unknown>;
|
|
836
|
-
lines?: Record<string, unknown>[];
|
|
837
|
-
msg?: string;
|
|
838
|
-
};
|
|
839
|
-
|
|
840
|
-
type TPasswordVerification = {
|
|
841
|
-
valid: boolean;
|
|
842
|
-
userId: number;
|
|
843
|
-
};
|
|
844
|
-
|
|
845
|
-
type TMetaTags = {
|
|
846
|
-
invMastExtUid: number;
|
|
847
|
-
invMastUid: number;
|
|
848
|
-
metaTitle: string;
|
|
849
|
-
metaDescription: string;
|
|
850
|
-
metaKeywords: string;
|
|
851
|
-
};
|
|
852
|
-
type TWebDesc = {
|
|
853
|
-
invMastUid: number;
|
|
854
|
-
invMastWebDescUid: number;
|
|
855
|
-
webDesc1: string | null;
|
|
856
|
-
webDesc2: string | null;
|
|
857
|
-
webDesc3: string | null;
|
|
858
|
-
webDesc4: string | null;
|
|
859
|
-
webDescFull: string | null;
|
|
860
|
-
};
|
|
861
|
-
|
|
862
|
-
/**
|
|
863
|
-
* Centralized cache configuration for React Query (TanStack Query)
|
|
864
|
-
*
|
|
865
|
-
* staleTime -- How long cached data is considered "fresh". While fresh,
|
|
866
|
-
* React Query serves the cache instantly and does NOT refetch in the
|
|
867
|
-
* background. After staleTime expires the data is "stale" and will be
|
|
868
|
-
* refetched on the next access (mount, window focus, etc.).
|
|
869
|
-
*
|
|
870
|
-
* gcTime (garbage collection time) -- How long UNUSED cached data stays in
|
|
871
|
-
* memory after all components using it unmount. Once gcTime expires the
|
|
872
|
-
* cache entry is deleted entirely.
|
|
873
|
-
*
|
|
874
|
-
* STATIC (1h): categories, menus, item details
|
|
875
|
-
* SEMI_STATIC (10m): pricing, stock, search results
|
|
876
|
-
* DYNAMIC (5m): infinite scroll data
|
|
877
|
-
* CART (2m): cart lines, cart header
|
|
878
|
-
* REALTIME (0): active orders, checkout state
|
|
879
|
-
*/
|
|
880
|
-
declare const CACHE_CONFIG: {
|
|
881
|
-
readonly STATIC: {
|
|
882
|
-
readonly staleTime: number;
|
|
883
|
-
readonly gcTime: number;
|
|
884
|
-
};
|
|
885
|
-
readonly SEMI_STATIC: {
|
|
886
|
-
readonly staleTime: number;
|
|
887
|
-
readonly gcTime: number;
|
|
888
|
-
};
|
|
889
|
-
readonly DYNAMIC: {
|
|
890
|
-
readonly staleTime: number;
|
|
891
|
-
readonly gcTime: number;
|
|
892
|
-
};
|
|
893
|
-
readonly CART: {
|
|
894
|
-
readonly staleTime: number;
|
|
895
|
-
readonly gcTime: number;
|
|
896
|
-
};
|
|
897
|
-
readonly REALTIME: {
|
|
898
|
-
readonly staleTime: 0;
|
|
899
|
-
readonly gcTime: number;
|
|
900
|
-
};
|
|
901
|
-
};
|
|
902
|
-
type CacheTier = keyof typeof CACHE_CONFIG;
|
|
903
|
-
|
|
904
|
-
/**
|
|
905
|
-
* Locale-aware currency formatting.
|
|
906
|
-
* Defaults to USD -- consumers can override locale and currency.
|
|
907
|
-
*/
|
|
908
|
-
declare function formatPrice(price: number, locale?: string, currency?: string): string;
|
|
909
|
-
|
|
910
|
-
/** User-entered address fields for comparison. */
|
|
911
|
-
interface UserAddress {
|
|
912
|
-
address1: string;
|
|
913
|
-
city: string;
|
|
914
|
-
state: string;
|
|
915
|
-
postalCode: string;
|
|
916
|
-
}
|
|
917
|
-
/**
|
|
918
|
-
* Compares a user-entered address with a SmartyStreets-validated address.
|
|
919
|
-
* Returns true if any field differs (case-insensitive for address/city,
|
|
920
|
-
* exact match for state abbreviation and zip code).
|
|
921
|
-
*
|
|
922
|
-
* Used in checkout to prompt users when their input differs from the
|
|
923
|
-
* USPS-validated address.
|
|
924
|
-
*/
|
|
925
|
-
declare function isAddressDifferent(userAddress: UserAddress, smartyAddress: TSmartyStreets): boolean;
|
|
926
|
-
|
|
927
|
-
type PaymentStatusInvoice = {
|
|
928
|
-
paidInFullFlag?: string | null;
|
|
929
|
-
amountPaid?: number;
|
|
930
|
-
totalAmount?: number;
|
|
931
|
-
};
|
|
932
|
-
type PaymentStatus = "Paid" | "Partially Paid" | "Unpaid";
|
|
933
|
-
/** Returns "Paid", "Partially Paid", or "Unpaid" based on invoice payment flags and amounts. */
|
|
934
|
-
declare function getPaymentStatus(invoice: PaymentStatusInvoice): PaymentStatus;
|
|
935
|
-
|
|
936
|
-
type ShipToAddress = {
|
|
937
|
-
shipToId: string | number;
|
|
938
|
-
name: string;
|
|
939
|
-
address1: string;
|
|
940
|
-
address2?: string;
|
|
941
|
-
city: string;
|
|
942
|
-
state: string;
|
|
943
|
-
zip: string;
|
|
944
|
-
country?: string;
|
|
945
|
-
};
|
|
946
|
-
type RawShipTo = Record<string, unknown>;
|
|
947
|
-
/** Normalizes a raw ship-to address object (camelCase or snake_case, physical or mailing) into a consistent ShipToAddress shape. */
|
|
948
|
-
declare function transformShipToAddress(raw: RawShipTo): ShipToAddress;
|
|
949
|
-
|
|
950
|
-
type OeHdr = {
|
|
951
|
-
customer_id: number;
|
|
952
|
-
company_id: string;
|
|
953
|
-
sales_location_id: number;
|
|
954
|
-
user_id: number;
|
|
955
|
-
user_email: string;
|
|
956
|
-
taker: string;
|
|
957
|
-
customer_po_no?: string;
|
|
958
|
-
ship_to_id?: string | number;
|
|
959
|
-
delivery_instructions?: string;
|
|
960
|
-
};
|
|
961
|
-
type OeLine = {
|
|
962
|
-
item_id: string;
|
|
963
|
-
unit_quantity: number;
|
|
964
|
-
unit_of_measure: string;
|
|
965
|
-
inv_mast_uid: number;
|
|
966
|
-
unit_price?: number;
|
|
967
|
-
};
|
|
968
|
-
type CheckoutInput = {
|
|
969
|
-
customerId: number;
|
|
970
|
-
companyId: string;
|
|
971
|
-
salesLocationId: number;
|
|
972
|
-
userId: number;
|
|
973
|
-
userEmail: string;
|
|
974
|
-
taker?: string;
|
|
975
|
-
cartLines: TCartLine[];
|
|
976
|
-
poNumber?: string;
|
|
977
|
-
shipToId?: string | number;
|
|
978
|
-
deliveryInstructions?: string;
|
|
979
|
-
};
|
|
980
|
-
/** Builds the oe_hdr + oe_line payload required by the commerce checkout API from cart data. */
|
|
981
|
-
declare function buildCheckoutPayload(input: CheckoutInput): {
|
|
982
|
-
oe_hdr: OeHdr;
|
|
983
|
-
oe_line: OeLine[];
|
|
984
|
-
};
|
|
985
|
-
|
|
986
|
-
interface DerivedPrice {
|
|
987
|
-
unitPrice: number;
|
|
988
|
-
unitOfMeasure: string;
|
|
989
|
-
total: number;
|
|
990
|
-
isCallForPrice: boolean;
|
|
991
|
-
}
|
|
992
|
-
interface DerivePriceInput {
|
|
993
|
-
priceData: TPriceData | null | undefined;
|
|
994
|
-
quantity?: number;
|
|
995
|
-
}
|
|
996
|
-
/**
|
|
997
|
-
* Pure price derivation — usable in hooks AND server components.
|
|
998
|
-
*
|
|
999
|
-
* Returns `null` when `priceData` is missing (loading / error state).
|
|
1000
|
-
*/
|
|
1001
|
-
declare function derivePrice(input: DerivePriceInput): DerivedPrice | null;
|
|
1002
|
-
|
|
1003
|
-
interface ResolveStockInput {
|
|
1004
|
-
stock: TStock | null | undefined;
|
|
1005
|
-
companyKey?: string;
|
|
1006
|
-
round?: boolean;
|
|
1007
|
-
lowStockThreshold?: number;
|
|
1008
|
-
showQuantity?: boolean;
|
|
1009
|
-
}
|
|
1010
|
-
interface ResolvedStock {
|
|
1011
|
-
quantity: number;
|
|
1012
|
-
isInStock: boolean;
|
|
1013
|
-
isLowStock: boolean;
|
|
1014
|
-
isDiscontinued: boolean;
|
|
1015
|
-
displayQuantity: number | null;
|
|
1016
|
-
}
|
|
1017
|
-
/**
|
|
1018
|
-
* Pure stock resolution -- usable in hooks AND server components.
|
|
1019
|
-
*
|
|
1020
|
-
* Returns `null` when `stock` is missing (loading / error state).
|
|
1021
|
-
*/
|
|
1022
|
-
declare function resolveStock(input: ResolveStockInput): ResolvedStock | null;
|
|
1023
|
-
|
|
1024
|
-
type SchemaAvailability = "https://schema.org/InStock" | "https://schema.org/OutOfStock" | "https://schema.org/LimitedAvailability" | "https://schema.org/BackOrder" | "https://schema.org/Discontinued";
|
|
1025
|
-
/**
|
|
1026
|
-
* Maps resolved stock to a Schema.org availability URL.
|
|
1027
|
-
*
|
|
1028
|
-
* - InStock: quantity > 0
|
|
1029
|
-
* - OutOfStock: discontinued at all locations with zero inventory
|
|
1030
|
-
* - BackOrder: zero stock but not discontinued (accepts backorders)
|
|
1031
|
-
*/
|
|
1032
|
-
declare function getSchemaAvailability(resolved: ResolvedStock | null | undefined): SchemaAvailability;
|
|
1033
|
-
|
|
1034
|
-
interface BreadcrumbJsonLdItem {
|
|
1035
|
-
name: string;
|
|
1036
|
-
url: string;
|
|
1037
|
-
}
|
|
1038
|
-
/** Generates a Schema.org BreadcrumbList JSON-LD object from an array of breadcrumb items. */
|
|
1039
|
-
declare function generateBreadcrumbJsonLd(items: BreadcrumbJsonLdItem[]): Record<string, unknown>;
|
|
1040
|
-
interface ProductJsonLdAggregateRating {
|
|
1041
|
-
ratingValue: number;
|
|
1042
|
-
reviewCount: number;
|
|
1043
|
-
}
|
|
1044
|
-
interface ProductJsonLdSeller {
|
|
1045
|
-
name: string;
|
|
1046
|
-
url?: string;
|
|
1047
|
-
}
|
|
1048
|
-
interface ProductJsonLdOptions {
|
|
1049
|
-
unitPrice: number;
|
|
1050
|
-
currency?: string;
|
|
1051
|
-
siteUrl?: string;
|
|
1052
|
-
itemPath?: string;
|
|
1053
|
-
seller?: ProductJsonLdSeller;
|
|
1054
|
-
priceValidDays?: number;
|
|
1055
|
-
imageUrlTransform?: (path: string) => string;
|
|
1056
|
-
returnPolicy?: Record<string, unknown>;
|
|
1057
|
-
shippingDetails?: Record<string, unknown>;
|
|
1058
|
-
aggregateRating?: ProductJsonLdAggregateRating;
|
|
1059
|
-
companyKey?: string;
|
|
1060
|
-
weightUnit?: string;
|
|
1061
|
-
dimensionUnit?: string;
|
|
1062
|
-
overrides?: Record<string, unknown>;
|
|
1063
|
-
}
|
|
1064
|
-
/** Generates a Schema.org Product JSON-LD string from an inventory document. Returns null if the item is suppressed, unnamed, or has no price. */
|
|
1065
|
-
declare function generateProductJsonLd(doc: TInvMastDoc, options: ProductJsonLdOptions): string | null;
|
|
1066
|
-
|
|
1067
|
-
/** Result type for safe action wrappers. */
|
|
1068
|
-
type SafeActionResult<T> = {
|
|
1069
|
-
ok: true;
|
|
1070
|
-
data: T;
|
|
1071
|
-
} | {
|
|
1072
|
-
ok: false;
|
|
1073
|
-
error: string;
|
|
1074
|
-
};
|
|
1075
|
-
/**
|
|
1076
|
-
* Extracts the data from a `SafeActionResult`, throwing on error.
|
|
1077
|
-
*
|
|
1078
|
-
* Ideal for React Query `queryFn` where errors should propagate
|
|
1079
|
-
* to the error boundary.
|
|
1080
|
-
*
|
|
1081
|
-
* @example
|
|
1082
|
-
* ```ts
|
|
1083
|
-
* const cart = unwrap(await getCartLines(cartId));
|
|
1084
|
-
* ```
|
|
1085
|
-
*/
|
|
1086
|
-
declare function unwrap<T>(result: SafeActionResult<T>): T;
|
|
1087
|
-
/**
|
|
1088
|
-
* Extracts the data from a `SafeActionResult`, returning `null` on error.
|
|
1089
|
-
*
|
|
1090
|
-
* For direct calls that prefer `null` over thrown errors.
|
|
1091
|
-
*
|
|
1092
|
-
* @example
|
|
1093
|
-
* ```ts
|
|
1094
|
-
* const cart = unwrapOr(await getCartLines(cartId));
|
|
1095
|
-
* if (!cart) { /* handle missing data *\/ }
|
|
1096
|
-
* ```
|
|
1097
|
-
*/
|
|
1098
|
-
declare function unwrapOr<T>(result: SafeActionResult<T>): T | null;
|
|
1099
|
-
|
|
1100
|
-
/**
|
|
1101
|
-
* Image CDN utilities for agr.media.
|
|
1102
|
-
* Pure functions -- no DOM or React dependencies. Safe for server, web, and mobile.
|
|
1103
|
-
*/
|
|
1104
|
-
/** 1x1 transparent PNG for Next.js `<Image blurDataURL={...}>` placeholders. */
|
|
1105
|
-
declare const BLUR_DATA_URL = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mN88P/BfwYABQoBfqVKzQAAAABJRU5ErkJggg==";
|
|
1106
|
-
interface ImageTransforms {
|
|
1107
|
-
width?: number;
|
|
1108
|
-
height?: number;
|
|
1109
|
-
format?: "auto" | "webp" | "avif" | "jpeg" | "jpg" | "png";
|
|
1110
|
-
quality?: number;
|
|
1111
|
-
fit?: "cover" | "contain" | "fill" | "inside" | "outside";
|
|
1112
|
-
}
|
|
1113
|
-
interface ImageConfig {
|
|
1114
|
-
readonly clientDomain: string;
|
|
1115
|
-
readonly defaultImage?: string;
|
|
1116
|
-
readonly defaultTransforms?: ImageTransforms;
|
|
1117
|
-
readonly stripPrefixes?: string[];
|
|
1118
|
-
readonly defaultPath?: string;
|
|
1119
|
-
}
|
|
1120
|
-
interface ImageUrlOptions {
|
|
1121
|
-
defaultImage?: string;
|
|
1122
|
-
}
|
|
1123
|
-
/**
|
|
1124
|
-
* Creates a frozen ImageConfig object.
|
|
1125
|
-
*
|
|
1126
|
-
* `stripPrefixes` defaults to `["/images", "images"]` — set to `[]` to disable.
|
|
1127
|
-
*/
|
|
1128
|
-
declare function createImageConfig(clientDomain: string, opts?: {
|
|
1129
|
-
defaultImage?: string;
|
|
1130
|
-
defaultTransforms?: ImageTransforms;
|
|
1131
|
-
stripPrefixes?: string[];
|
|
1132
|
-
defaultPath?: string;
|
|
1133
|
-
}): ImageConfig;
|
|
1134
|
-
/**
|
|
1135
|
-
* Serializes transform options into the CDN path segment.
|
|
1136
|
-
* Example: `{ width: 400, format: "webp" }` → `"w_400,f_webp"`
|
|
1137
|
-
*/
|
|
1138
|
-
declare function serializeTransforms(transforms: ImageTransforms): string;
|
|
1139
|
-
/**
|
|
1140
|
-
* Normalizes an image path by:
|
|
1141
|
-
* 1. Returning it as-is if it starts with `http` (external URL).
|
|
1142
|
-
* 2. Stripping configured prefixes (defaults: `/images`, `images`).
|
|
1143
|
-
* 3. Prepending `defaultPath` for bare filenames (no `/`).
|
|
1144
|
-
* 4. Stripping leading slashes.
|
|
1145
|
-
*/
|
|
1146
|
-
declare function normalizePath(config: ImageConfig, raw: string): string;
|
|
1147
|
-
/**
|
|
1148
|
-
* Builds a full agr.media URL for the given image path and transforms.
|
|
1149
|
-
*
|
|
1150
|
-
* - Empty/nullish paths return the default image URL.
|
|
1151
|
-
* - Paths starting with `http` are returned as-is (external CDN).
|
|
1152
|
-
* - Configured prefixes (default: `/images`) are stripped automatically.
|
|
1153
|
-
* - Bare filenames are prepended with `config.defaultPath` if set.
|
|
1154
|
-
*/
|
|
1155
|
-
declare function getImageUrl(config: ImageConfig, imagePath: string | undefined | null, transforms?: ImageTransforms, options?: ImageUrlOptions): string;
|
|
1156
|
-
/**
|
|
1157
|
-
* Returns the default/placeholder image URL.
|
|
1158
|
-
* Per-call `options.defaultImage` overrides `config.defaultImage`.
|
|
1159
|
-
*/
|
|
1160
|
-
declare function getDefaultImageUrl(config: ImageConfig, options?: ImageUrlOptions): string;
|
|
1161
|
-
/**
|
|
1162
|
-
* Generates a `srcset` string for responsive images.
|
|
1163
|
-
*/
|
|
1164
|
-
declare function getImageSrcSet(config: ImageConfig, imagePath: string, widths: number[], transforms?: ImageTransforms): string;
|
|
1165
|
-
/**
|
|
1166
|
-
* Returns a loader function compatible with Next.js `<Image loader={...}>`.
|
|
1167
|
-
*/
|
|
1168
|
-
declare function buildImageLoader(config: ImageConfig, transforms?: ImageTransforms): (props: {
|
|
1169
|
-
src: string;
|
|
1170
|
-
width: number;
|
|
1171
|
-
quality?: number;
|
|
1172
|
-
}) => string;
|
|
1173
|
-
/**
|
|
1174
|
-
* Rewrites `<img src="...">` attributes in an HTML string to use agr.media URLs.
|
|
1175
|
-
* Useful for CMS/Joomla content that contains raw image references.
|
|
1176
|
-
*/
|
|
1177
|
-
declare function sanitizeHtmlImages(config: ImageConfig, html: string, transforms?: ImageTransforms): string;
|
|
1178
|
-
|
|
1179
|
-
/**
|
|
1180
|
-
* Common regex patterns used for form validation across augur-hosted sites.
|
|
1181
|
-
*/
|
|
1182
|
-
declare const VALIDATION_PATTERNS: {
|
|
1183
|
-
/** Phone number format: (123) 456-7890 or 123-456-7890 or 123.456.7890 */
|
|
1184
|
-
readonly phoneNumber: RegExp;
|
|
1185
|
-
/** Name format: Must start with non-hyphen/space, allow word chars, spaces, hyphens */
|
|
1186
|
-
readonly nameFormat: RegExp;
|
|
1187
|
-
/** Name must not contain numbers */
|
|
1188
|
-
readonly nameNoNumbers: RegExp;
|
|
1189
|
-
/** Address format: Allow word chars, spaces, hyphens, slashes, periods, hash, commas */
|
|
1190
|
-
readonly addressFormat: RegExp;
|
|
1191
|
-
/** No PO Box pattern - prevents PO Box addresses */
|
|
1192
|
-
readonly noPOBox: RegExp;
|
|
1193
|
-
/** Zip code: Exactly 5 digits */
|
|
1194
|
-
readonly zipCode: RegExp;
|
|
1195
|
-
/** City: Letters, spaces, periods, hyphens, apostrophes only */
|
|
1196
|
-
readonly cityFormat: RegExp;
|
|
1197
|
-
/** Address must contain at least one number */
|
|
1198
|
-
readonly hasNumber: RegExp;
|
|
1199
|
-
};
|
|
1200
|
-
|
|
1201
|
-
/**
|
|
1202
|
-
* Valibot schema for shipping address validation.
|
|
1203
|
-
* Enforces no PO Box, requires street number, formats phone number.
|
|
1204
|
-
*/
|
|
1205
|
-
declare const ShippingAddressSchema: v.ObjectSchema<{
|
|
1206
|
-
readonly companyName: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1207
|
-
readonly firstName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "First name is required">, v.RegexAction<string, "Invalid first name">, v.RegexAction<string, "Invalid first name">]>;
|
|
1208
|
-
readonly lastName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "Last name is required">, v.RegexAction<string, "Invalid last name">, v.RegexAction<string, "Invalid last name">]>;
|
|
1209
|
-
readonly address1: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "Address 1 is required">, v.RegexAction<string, "Invalid address">, v.RegexAction<string, "PO Box addresses are not allowed for shipping">, v.RegexAction<string, "Address must contain at least one number">]>;
|
|
1210
|
-
readonly address2: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "Invalid address format">, v.CheckAction<string, "PO Box addresses are not allowed for shipping">]>, undefined>;
|
|
1211
|
-
readonly postalCode: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "Zip code is required">, v.RegexAction<string, "Zip code must be exactly 5 digits">]>;
|
|
1212
|
-
readonly city: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 2, "City is required">, v.RegexAction<string, "City must contain only letters, spaces, periods, hyphens, or apostrophes">]>;
|
|
1213
|
-
readonly state: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "State is required">, v.PicklistSchema<[string, ...string[]], "Please select a valid US state">]>;
|
|
1214
|
-
readonly country: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "Country is required">]>;
|
|
1215
|
-
readonly email: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "Email is required">, v.EmailAction<string, "Invalid email">]>;
|
|
1216
|
-
readonly phoneNumber: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "Phone number is required">, v.RegexAction<string, "Invalid phone number">, v.TransformAction<string, string>]>;
|
|
1217
|
-
readonly notes: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1218
|
-
readonly plus4Code: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1219
|
-
}, undefined>;
|
|
1220
|
-
/**
|
|
1221
|
-
* Valibot schema for billing address validation.
|
|
1222
|
-
* Less strict than shipping: allows PO Box, no email/phone required.
|
|
1223
|
-
*/
|
|
1224
|
-
declare const BillingAddressSchema: v.ObjectSchema<{
|
|
1225
|
-
readonly poNumber: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1226
|
-
readonly firstName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "First name is required">, v.RegexAction<string, "Invalid first name">, v.RegexAction<string, "Invalid first name">]>;
|
|
1227
|
-
readonly lastName: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "Last name is required">, v.RegexAction<string, "Invalid last name">, v.RegexAction<string, "Invalid last name">]>;
|
|
1228
|
-
readonly address1: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "Address 1 is required">, v.RegexAction<string, "Invalid address">]>;
|
|
1229
|
-
readonly address2: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1230
|
-
readonly postalCode: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "Zip code is required">]>;
|
|
1231
|
-
readonly city: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "City is required">]>;
|
|
1232
|
-
readonly state: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "State is required">]>;
|
|
1233
|
-
readonly country: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "Country is required">]>;
|
|
1234
|
-
readonly plus4Code: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1235
|
-
}, undefined>;
|
|
1236
|
-
/**
|
|
1237
|
-
* Valibot schema for billing address with required PO number (invoice payments).
|
|
1238
|
-
*/
|
|
1239
|
-
declare const BillingAddressInvoiceSchema: v.ObjectSchema<{
|
|
1240
|
-
readonly poNumber: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 2, "PO number is required">]>;
|
|
1241
|
-
}, undefined>;
|
|
1242
|
-
type ShippingAddress = v.InferOutput<typeof ShippingAddressSchema>;
|
|
1243
|
-
type BillingAddress = v.InferOutput<typeof BillingAddressSchema>;
|
|
1244
|
-
|
|
1245
|
-
/** All US states and territories — full data from states-us. */
|
|
1246
|
-
declare const US_STATES_FULL: State[];
|
|
1247
|
-
/** All US states and territories — backward-compatible {code, name} shape. */
|
|
1248
|
-
declare const US_STATES: {
|
|
1249
|
-
code: string;
|
|
1250
|
-
name: string;
|
|
1251
|
-
}[];
|
|
1252
|
-
/** Lower 48 contiguous states. */
|
|
1253
|
-
declare const CONTIGUOUS_STATES: State[];
|
|
1254
|
-
/** US territories (PR, GU, VI, AS, MP). */
|
|
1255
|
-
declare const US_TERRITORIES: State[];
|
|
1256
|
-
type USStateCode = (typeof US_STATES)[number]["code"];
|
|
1257
|
-
|
|
1258
|
-
/**
|
|
1259
|
-
* Date utility functions for shipping calculations.
|
|
1260
|
-
*/
|
|
1261
|
-
/**
|
|
1262
|
-
* Get the Nth business day from today (skipping weekends).
|
|
1263
|
-
* @param businessDaysFromNow - Number of business days to add
|
|
1264
|
-
* @returns Formatted date string
|
|
1265
|
-
*/
|
|
1266
|
-
declare function getBusinessDay(businessDaysFromNow: number): string;
|
|
1267
|
-
/**
|
|
1268
|
-
* Get shipping lead date estimate based on days string.
|
|
1269
|
-
* @param days - Shipping days string (e.g., "1-2", "2-3", "3")
|
|
1270
|
-
* @returns Formatted date range or single date
|
|
1271
|
-
*/
|
|
1272
|
-
declare function getShippingLeadDate(days: string): string;
|
|
1273
|
-
|
|
1274
|
-
/**
|
|
1275
|
-
* Options for category item filter serialization.
|
|
1276
|
-
* All fields optional — omit what you don't need.
|
|
1277
|
-
*/
|
|
1278
|
-
interface CategoryFilterOptions {
|
|
1279
|
-
/** Prefix prepended to non-empty sortBy values (e.g. "item_category_sequence_no_min|"). */
|
|
1280
|
-
sortByPrefix?: string;
|
|
1281
|
-
/** Whether to include stock data in results. Default: true. */
|
|
1282
|
-
includeStock?: boolean;
|
|
1283
|
-
}
|
|
1284
|
-
/**
|
|
1285
|
-
* Options for search param serialization.
|
|
1286
|
-
* All fields optional — omit what you don't need.
|
|
1287
|
-
*/
|
|
1288
|
-
interface SearchParamOptions {
|
|
1289
|
-
/** Category UID to scope search results. Converted to classId5List string. */
|
|
1290
|
-
categoryUid?: number | string;
|
|
1291
|
-
/** Source fields for search results. Default: "display_desc". */
|
|
1292
|
-
sourceFields?: string;
|
|
1293
|
-
}
|
|
1294
|
-
/**
|
|
1295
|
-
* Converts TItemsFilters to the SDK params shape for category item endpoints.
|
|
1296
|
-
*
|
|
1297
|
-
* Pure function. Idempotent. Produces params ready to spread into
|
|
1298
|
-
* `q.items.itemCategory.categoryItems.list(uid, params)`.
|
|
1299
|
-
*
|
|
1300
|
-
* Transforms applied:
|
|
1301
|
-
* - filters: [string, string][] -> JSON string
|
|
1302
|
-
* - sortBy: prefixed with sortByPrefix if configured and non-empty
|
|
1303
|
-
* - includeStock: "Y" added by default
|
|
1304
|
-
* - page field: stripped (SDK uses limit/offset, not page)
|
|
1305
|
-
*/
|
|
1306
|
-
declare function serializeCategoryFilters(filters: TItemsFilters, options?: CategoryFilterOptions): Record<string, unknown>;
|
|
1307
|
-
/**
|
|
1308
|
-
* Converts TItemsFilters to the SDK params shape for search endpoints.
|
|
1309
|
-
*
|
|
1310
|
-
* Pure function. Idempotent. Produces params ready to spread into
|
|
1311
|
-
* `q.openSearch.itemSearch.list(params)`.
|
|
1312
|
-
*
|
|
1313
|
-
* Transforms applied:
|
|
1314
|
-
* - limit -> size, offset -> from (field rename)
|
|
1315
|
-
* - searchType: "query" injected
|
|
1316
|
-
* - categoryUid -> classId5List (string conversion)
|
|
1317
|
-
* - filters: [string, string][] -> JSON string (or undefined if empty)
|
|
1318
|
-
* - sourceFieldsList: injected from options or default "display_desc"
|
|
1319
|
-
* - page field: stripped
|
|
1320
|
-
*/
|
|
1321
|
-
declare function serializeSearchParams(filters: TItemsFilters, options?: SearchParamOptions): Record<string, unknown>;
|
|
1322
|
-
/**
|
|
1323
|
-
* Returns a copy of filters with offset adjusted for the given page.
|
|
1324
|
-
*
|
|
1325
|
-
* Pure function. Idempotent. Use with useInfiniteQuery's pageParam
|
|
1326
|
-
* to compute the correct offset for each page.
|
|
1327
|
-
*
|
|
1328
|
-
* @example
|
|
1329
|
-
* ```tsx
|
|
1330
|
-
* useInfiniteQuery({
|
|
1331
|
-
* ...q.items.itemCategory.categoryItems.list(
|
|
1332
|
-
* uid,
|
|
1333
|
-
* serializeCategoryFilters(paginateOffset(filters, pageParam), site)
|
|
1334
|
-
* ),
|
|
1335
|
-
* initialPageParam: 0,
|
|
1336
|
-
* getNextPageParam: (last, _all, lastPage) =>
|
|
1337
|
-
* (lastPage + 1) * filters.limit < last.total ? lastPage + 1 : undefined,
|
|
1338
|
-
* });
|
|
1339
|
-
* ```
|
|
1340
|
-
*/
|
|
1341
|
-
declare function paginateOffset(filters: TItemsFilters, pageParam: number): TItemsFilters;
|
|
1342
|
-
|
|
1343
|
-
/**
|
|
1344
|
-
* Analytics utility functions for tracking ecommerce events via Google Analytics.
|
|
1345
|
-
*/
|
|
1346
|
-
declare global {
|
|
1347
|
-
interface Window {
|
|
1348
|
-
dataLayer?: Record<string, unknown>[];
|
|
1349
|
-
gtag?: (...args: unknown[]) => void;
|
|
1350
|
-
}
|
|
1351
|
-
}
|
|
1352
|
-
interface AddToCartEventParams {
|
|
1353
|
-
itemId: string;
|
|
1354
|
-
itemName: string;
|
|
1355
|
-
price: number;
|
|
1356
|
-
quantity: number;
|
|
1357
|
-
estimatedCost: number;
|
|
1358
|
-
}
|
|
1359
|
-
/**
|
|
1360
|
-
* Track add_to_cart event to Google Analytics dataLayer.
|
|
1361
|
-
*/
|
|
1362
|
-
declare function trackAddToCart({ itemId, itemName, price, quantity, estimatedCost, }: AddToCartEventParams): void;
|
|
1363
|
-
interface ViewItemEventParams {
|
|
1364
|
-
itemId: string;
|
|
1365
|
-
itemName: string;
|
|
1366
|
-
price: number;
|
|
1367
|
-
category?: string;
|
|
1368
|
-
}
|
|
1369
|
-
/**
|
|
1370
|
-
* Track view_item event to Google Analytics dataLayer.
|
|
1371
|
-
*/
|
|
1372
|
-
declare function trackViewItem({ itemId, itemName, price, category, }: ViewItemEventParams): void;
|
|
1373
|
-
interface TrackingItem {
|
|
1374
|
-
item_id: string;
|
|
1375
|
-
item_name: string;
|
|
1376
|
-
currency: string;
|
|
1377
|
-
index: number;
|
|
1378
|
-
item_category: string;
|
|
1379
|
-
price: number;
|
|
1380
|
-
quantity: number;
|
|
1381
|
-
}
|
|
1382
|
-
interface TrackingData {
|
|
1383
|
-
event: string;
|
|
1384
|
-
currency: string;
|
|
1385
|
-
value: number;
|
|
1386
|
-
items: TrackingItem[];
|
|
1387
|
-
}
|
|
1388
|
-
interface BuildTrackingDataInput {
|
|
1389
|
-
cartLines: {
|
|
1390
|
-
itemId: string;
|
|
1391
|
-
quantity: number;
|
|
1392
|
-
}[];
|
|
1393
|
-
itemDetails: Record<string, {
|
|
1394
|
-
itemDesc?: string;
|
|
1395
|
-
classId5?: string;
|
|
1396
|
-
}>;
|
|
1397
|
-
getUnitPrice: (itemId: string) => number;
|
|
1398
|
-
currency?: string;
|
|
1399
|
-
}
|
|
1400
|
-
/**
|
|
1401
|
-
* Build a GA4 begin_checkout ecommerce payload from cart lines, item details, and prices.
|
|
1402
|
-
*/
|
|
1403
|
-
declare function buildTrackingData({ cartLines, itemDetails, getUnitPrice, currency, }: BuildTrackingDataInput): TrackingData;
|
|
1404
|
-
/**
|
|
1405
|
-
* Push ecommerce tracking data to window.dataLayer using the GA4 clear-then-push pattern.
|
|
1406
|
-
*/
|
|
1407
|
-
declare function pushTrackingData(data: TrackingData): void;
|
|
1408
|
-
|
|
1409
|
-
export { type AddToCartEventParams, BLUR_DATA_URL, type BillingAddress, BillingAddressInvoiceSchema, BillingAddressSchema, type BreadcrumbJsonLdItem, type BuildTrackingDataInput, CACHE_CONFIG, CONTIGUOUS_STATES, type CacheTier, type CategoryFilterOptions, type CheckoutInput, type CheckoutPayment, type CustomerDocument, type DerivePriceInput, type DerivedPrice, type ImageConfig, type ImageTransforms, type ImageUrlOptions, type MenuItem, type OeHdr, type OeLine, type OrderHeader, type OrderLine, type OrderNote, type OrderPayment, type PaymentStatus, type PaymentStatusInvoice, type ProductJsonLdAggregateRating, type ProductJsonLdOptions, type ProductJsonLdSeller, type ResolveStockInput, type ResolvedStock, type SafeActionResult, type SchemaAvailability, type SearchParamOptions, type ShipToAddress, type ShippingAddress, ShippingAddressSchema, type TAccountQuery, type TApiResponse, type TAttribute, type TAttributeValue, type TBillingUpdate, type TCardInfo, type TCartHdrUid, type TCartLine, type TCartLookUp, type TCategory, type TCategoryChild, type TCategoryItemsResult, type TCheckoutResult, type TInvMast, type TInvMastDoc, type TInventorySupplier, type TItemAccessory, type TItemAttribute, type TItemAttributes, type TItemCategory, type TItemDetails, type TItemRelatedProduct, type TItemUom, type TItemsFilters, type TJoomlaContent, type TJoomlaContentFilters, type TLibraryPriceBreak, type TLibraryPriceData, type TLtlRatesResponse, type TLtlShipmentData, type TMenu, type TMenuFilters, type TMetaTags, type TOrderCartLine, type TPasswordVerification, type TPaymentValidation, type TPriceData, type TProductCategory, type TProductItem, type TProductStockData, type TProfileValues, type TRelatedProduct, type TSearchSuggestion, type TSearchSuggestionsResponse, type TShippingMethod, type TSmartyStreets, type TStock, type TStockData, type TSurcharge, type TTax, type TTaxItem, type TTransactionSetup, type TUserProfile, type TWebDesc, type TrackingData, type TrackingItem, type USStateCode, US_STATES, US_STATES_FULL, US_TERRITORIES, type UserAddress, VALIDATION_PATTERNS, type ViewItemEventParams, buildCheckoutPayload, buildImageLoader, buildTrackingData, createImageConfig, derivePrice, formatPrice, generateBreadcrumbJsonLd, generateProductJsonLd, getBusinessDay, getDefaultImageUrl, getImageSrcSet, getImageUrl, getPaymentStatus, getSchemaAvailability, getShippingLeadDate, isAddressDifferent, normalizePath, paginateOffset, pushTrackingData, resolveStock, sanitizeHtmlImages, serializeCategoryFilters, serializeSearchParams, serializeTransforms, trackAddToCart, trackViewItem, transformShipToAddress, unwrap, unwrapOr };
|