@takeshape/purchase-order-chat 1.51.0-beta.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/README.md +305 -0
- package/dist/pdf-CYwqEJpJ.js +20562 -0
- package/dist/pdf-CYwqEJpJ.js.map +1 -0
- package/dist/pdf.worker-eoyvlo7V.js +37634 -0
- package/dist/pdf.worker-eoyvlo7V.js.map +1 -0
- package/dist/purchase-order-chat-wrapper-D8d5NFc9.js +7899 -0
- package/dist/purchase-order-chat-wrapper-D8d5NFc9.js.map +1 -0
- package/dist/shadow.d.ts +1505 -0
- package/dist/shadow.js +58 -0
- package/dist/shadow.js.map +1 -0
- package/dist/sources.css +4 -0
- package/dist/tailwind.d.ts +1502 -0
- package/dist/tailwind.js +15 -0
- package/dist/tailwind.js.map +1 -0
- package/dist/testing.d.ts +456 -0
- package/dist/testing.js +610 -0
- package/dist/testing.js.map +1 -0
- package/dist/theme.css +75 -0
- package/dist/utilities.css +233 -0
- package/package.json +87 -0
package/dist/testing.js
ADDED
|
@@ -0,0 +1,610 @@
|
|
|
1
|
+
class I {
|
|
2
|
+
carts = /* @__PURE__ */ new Map();
|
|
3
|
+
checkouts = /* @__PURE__ */ new Map();
|
|
4
|
+
checkoutToCartId = /* @__PURE__ */ new Map();
|
|
5
|
+
nextCartId = 1;
|
|
6
|
+
nextCheckoutId = 1;
|
|
7
|
+
nextLineItemId = 1;
|
|
8
|
+
nextConsignmentId = 1;
|
|
9
|
+
nextShippingOptionId = 1;
|
|
10
|
+
channelId = 1;
|
|
11
|
+
// Default channel ID for mock
|
|
12
|
+
constructor(t) {
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Helper: Create a Money object
|
|
16
|
+
*/
|
|
17
|
+
createMoney(t) {
|
|
18
|
+
return {
|
|
19
|
+
value: t,
|
|
20
|
+
currencyCode: "USD"
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Helper: Generate cart entity ID
|
|
25
|
+
*/
|
|
26
|
+
generateCartId() {
|
|
27
|
+
return `cart-${this.nextCartId++}`;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Helper: Generate checkout entity ID
|
|
31
|
+
*/
|
|
32
|
+
generateCheckoutId() {
|
|
33
|
+
return `checkout-${this.nextCheckoutId++}`;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Helper: Generate line item entity ID
|
|
37
|
+
*/
|
|
38
|
+
generateLineItemId() {
|
|
39
|
+
return `item-${this.nextLineItemId++}`;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Helper: Generate consignment entity ID
|
|
43
|
+
*/
|
|
44
|
+
generateConsignmentId() {
|
|
45
|
+
return `consignment-${this.nextConsignmentId++}`;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Helper: Generate shipping option entity ID
|
|
49
|
+
*/
|
|
50
|
+
generateShippingOptionId() {
|
|
51
|
+
return `shipping-option-${this.nextShippingOptionId++}`;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Helper: Create a cart line item from input
|
|
55
|
+
*/
|
|
56
|
+
createCartLineItem(t) {
|
|
57
|
+
const e = t.productEntityId * 0.1, n = e * t.quantity;
|
|
58
|
+
return {
|
|
59
|
+
entityId: this.generateLineItemId(),
|
|
60
|
+
productEntityId: t.productEntityId,
|
|
61
|
+
variantEntityId: t.variantEntityId ?? t.productEntityId,
|
|
62
|
+
quantity: t.quantity,
|
|
63
|
+
name: `Product ${t.productEntityId}`,
|
|
64
|
+
sku: `SKU-${t.productEntityId}`,
|
|
65
|
+
originalPrice: this.createMoney(e),
|
|
66
|
+
listPrice: this.createMoney(e),
|
|
67
|
+
extendedListPrice: this.createMoney(n),
|
|
68
|
+
extendedSalePrice: this.createMoney(n),
|
|
69
|
+
imageUrl: null
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Helper: Calculate cart totals
|
|
74
|
+
*/
|
|
75
|
+
calculateCartTotals(t) {
|
|
76
|
+
const e = t.reduce(
|
|
77
|
+
(n, r) => n + r.extendedSalePrice.value,
|
|
78
|
+
0
|
|
79
|
+
);
|
|
80
|
+
return {
|
|
81
|
+
amount: this.createMoney(e),
|
|
82
|
+
baseAmount: this.createMoney(e),
|
|
83
|
+
discountedAmount: this.createMoney(0)
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Helper: Calculate checkout totals
|
|
88
|
+
*/
|
|
89
|
+
calculateCheckoutTotals(t) {
|
|
90
|
+
const e = this.checkoutToCartId.get(t.entityId), r = (e ? this.carts.get(e) : void 0)?.amount.value ?? 0;
|
|
91
|
+
let o = 0, s = 0;
|
|
92
|
+
t.shippingConsignments && t.shippingConsignments.length > 0 && (o = r * 0.08);
|
|
93
|
+
for (const i of t.shippingConsignments ?? [])
|
|
94
|
+
i.selectedShippingOption && (s += i.selectedShippingOption.cost.value);
|
|
95
|
+
t.subtotal = this.createMoney(r), t.taxTotal = this.createMoney(o), t.shippingCostTotal = this.createMoney(s), t.handlingCostTotal = this.createMoney(0), t.grandTotal = this.createMoney(r + o + s);
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Get an existing cart by ID
|
|
99
|
+
*/
|
|
100
|
+
async getCart(t) {
|
|
101
|
+
return t ? this.carts.get(t) ?? null : null;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Create a new cart with line items
|
|
105
|
+
*/
|
|
106
|
+
async createCart(t) {
|
|
107
|
+
if (t.length === 0)
|
|
108
|
+
throw new Error("Cannot create cart with no line items");
|
|
109
|
+
const e = this.generateCartId(), n = this.generateCheckoutId(), r = { utc: (/* @__PURE__ */ new Date()).toISOString() }, o = t.map(
|
|
110
|
+
(c) => this.createCartLineItem(c)
|
|
111
|
+
), s = this.calculateCartTotals(o), i = {
|
|
112
|
+
id: e,
|
|
113
|
+
entityId: e,
|
|
114
|
+
lineItems: {
|
|
115
|
+
physicalItems: o,
|
|
116
|
+
digitalItems: []
|
|
117
|
+
},
|
|
118
|
+
amount: s.amount,
|
|
119
|
+
baseAmount: s.baseAmount,
|
|
120
|
+
discountedAmount: s.discountedAmount,
|
|
121
|
+
createdAt: r,
|
|
122
|
+
updatedAt: r
|
|
123
|
+
};
|
|
124
|
+
this.carts.set(e, i);
|
|
125
|
+
const a = {
|
|
126
|
+
entityId: n,
|
|
127
|
+
subtotal: i.amount,
|
|
128
|
+
taxTotal: this.createMoney(0),
|
|
129
|
+
grandTotal: i.amount,
|
|
130
|
+
shippingCostTotal: this.createMoney(0),
|
|
131
|
+
handlingCostTotal: this.createMoney(0),
|
|
132
|
+
billingAddress: null,
|
|
133
|
+
shippingConsignments: null
|
|
134
|
+
};
|
|
135
|
+
return this.checkouts.set(n, a), this.checkoutToCartId.set(n, e), i;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Add line items to an existing cart
|
|
139
|
+
*/
|
|
140
|
+
async addCartLineItems(t, e) {
|
|
141
|
+
const n = this.carts.get(t);
|
|
142
|
+
if (!n)
|
|
143
|
+
return null;
|
|
144
|
+
if (e.length === 0)
|
|
145
|
+
return n;
|
|
146
|
+
const r = e.map((a) => this.createCartLineItem(a)), o = [...n.lineItems.physicalItems, ...r], s = this.calculateCartTotals(o), i = {
|
|
147
|
+
...n,
|
|
148
|
+
lineItems: {
|
|
149
|
+
...n.lineItems,
|
|
150
|
+
physicalItems: o
|
|
151
|
+
},
|
|
152
|
+
amount: s.amount,
|
|
153
|
+
baseAmount: s.baseAmount,
|
|
154
|
+
discountedAmount: s.discountedAmount,
|
|
155
|
+
updatedAt: { utc: (/* @__PURE__ */ new Date()).toISOString() }
|
|
156
|
+
};
|
|
157
|
+
this.carts.set(t, i);
|
|
158
|
+
for (const [a, c] of this.checkoutToCartId.entries())
|
|
159
|
+
if (c === t) {
|
|
160
|
+
const u = this.checkouts.get(a);
|
|
161
|
+
if (u) {
|
|
162
|
+
const l = { ...u };
|
|
163
|
+
this.calculateCheckoutTotals(l), this.checkouts.set(a, l);
|
|
164
|
+
}
|
|
165
|
+
break;
|
|
166
|
+
}
|
|
167
|
+
return i;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Update the quantity of a cart line item
|
|
171
|
+
*/
|
|
172
|
+
async updateCartLineItem(t, e, n, r, o) {
|
|
173
|
+
const s = this.carts.get(t);
|
|
174
|
+
if (!s)
|
|
175
|
+
return null;
|
|
176
|
+
const i = s.lineItems.physicalItems.findIndex(
|
|
177
|
+
(d) => d.entityId === e
|
|
178
|
+
);
|
|
179
|
+
if (i === -1)
|
|
180
|
+
return null;
|
|
181
|
+
const a = [...s.lineItems.physicalItems], c = a[i];
|
|
182
|
+
if (!c)
|
|
183
|
+
return null;
|
|
184
|
+
const l = c.listPrice.value * n;
|
|
185
|
+
a[i] = {
|
|
186
|
+
...c,
|
|
187
|
+
quantity: n,
|
|
188
|
+
extendedListPrice: this.createMoney(l),
|
|
189
|
+
extendedSalePrice: this.createMoney(l)
|
|
190
|
+
};
|
|
191
|
+
const h = this.calculateCartTotals(a), m = {
|
|
192
|
+
...s,
|
|
193
|
+
lineItems: {
|
|
194
|
+
...s.lineItems,
|
|
195
|
+
physicalItems: a
|
|
196
|
+
},
|
|
197
|
+
amount: h.amount,
|
|
198
|
+
baseAmount: h.baseAmount,
|
|
199
|
+
discountedAmount: h.discountedAmount,
|
|
200
|
+
updatedAt: { utc: (/* @__PURE__ */ new Date()).toISOString() }
|
|
201
|
+
};
|
|
202
|
+
this.carts.set(t, m);
|
|
203
|
+
for (const [d, y] of this.checkoutToCartId.entries())
|
|
204
|
+
if (y === t) {
|
|
205
|
+
const g = this.checkouts.get(d);
|
|
206
|
+
if (g) {
|
|
207
|
+
const C = { ...g };
|
|
208
|
+
this.calculateCheckoutTotals(C), this.checkouts.set(d, C);
|
|
209
|
+
}
|
|
210
|
+
break;
|
|
211
|
+
}
|
|
212
|
+
return m;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Remove a line item from the cart
|
|
216
|
+
*/
|
|
217
|
+
async deleteCartLineItem(t, e) {
|
|
218
|
+
const n = this.carts.get(t);
|
|
219
|
+
if (!n || !n.lineItems.physicalItems.some(
|
|
220
|
+
(a) => a.entityId === e
|
|
221
|
+
))
|
|
222
|
+
return null;
|
|
223
|
+
const o = n.lineItems.physicalItems.filter(
|
|
224
|
+
(a) => a.entityId !== e
|
|
225
|
+
), s = this.calculateCartTotals(o), i = {
|
|
226
|
+
...n,
|
|
227
|
+
lineItems: {
|
|
228
|
+
...n.lineItems,
|
|
229
|
+
physicalItems: o
|
|
230
|
+
},
|
|
231
|
+
amount: s.amount,
|
|
232
|
+
baseAmount: s.baseAmount,
|
|
233
|
+
discountedAmount: s.discountedAmount,
|
|
234
|
+
updatedAt: { utc: (/* @__PURE__ */ new Date()).toISOString() }
|
|
235
|
+
};
|
|
236
|
+
this.carts.set(t, i);
|
|
237
|
+
for (const [a, c] of this.checkoutToCartId.entries())
|
|
238
|
+
if (c === t) {
|
|
239
|
+
const u = this.checkouts.get(a);
|
|
240
|
+
if (u) {
|
|
241
|
+
const l = { ...u };
|
|
242
|
+
this.calculateCheckoutTotals(l), this.checkouts.set(a, l);
|
|
243
|
+
}
|
|
244
|
+
break;
|
|
245
|
+
}
|
|
246
|
+
return i;
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Delete an entire cart
|
|
250
|
+
*/
|
|
251
|
+
async deleteCart(t) {
|
|
252
|
+
if (!this.carts.get(t))
|
|
253
|
+
return null;
|
|
254
|
+
this.carts.delete(t);
|
|
255
|
+
for (const [n, r] of this.checkoutToCartId.entries())
|
|
256
|
+
if (r === t) {
|
|
257
|
+
this.checkouts.delete(n), this.checkoutToCartId.delete(n);
|
|
258
|
+
break;
|
|
259
|
+
}
|
|
260
|
+
return t;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Create a cart or add to existing cart
|
|
264
|
+
* Convenience method that handles both cases
|
|
265
|
+
*/
|
|
266
|
+
async addToCart(t, e) {
|
|
267
|
+
return e ? this.addCartLineItems(e, t) : this.createCart(t);
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Create single-use redirect URLs for a cart
|
|
271
|
+
*/
|
|
272
|
+
async createCartRedirectUrls(t) {
|
|
273
|
+
return this.carts.get(t) ? {
|
|
274
|
+
redirectedCheckoutUrl: `https://store.example.com/cart/${t}`
|
|
275
|
+
} : null;
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Get checkout by entity ID
|
|
279
|
+
*/
|
|
280
|
+
async getCheckout(t) {
|
|
281
|
+
return t ? this.checkouts.get(t) ?? null : null;
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Add shipping consignments (addresses) to a checkout
|
|
285
|
+
*/
|
|
286
|
+
async setCheckoutShippingAddress(t, e, n) {
|
|
287
|
+
const r = this.checkouts.get(t);
|
|
288
|
+
if (!r)
|
|
289
|
+
return null;
|
|
290
|
+
const o = this.generateConsignmentId(), s = [
|
|
291
|
+
{
|
|
292
|
+
entityId: this.generateShippingOptionId(),
|
|
293
|
+
description: "Standard Shipping",
|
|
294
|
+
type: "shipping_flatrate",
|
|
295
|
+
cost: this.createMoney(5)
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
entityId: this.generateShippingOptionId(),
|
|
299
|
+
description: "Express Shipping",
|
|
300
|
+
type: "shipping_express",
|
|
301
|
+
cost: this.createMoney(15)
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
entityId: this.generateShippingOptionId(),
|
|
305
|
+
description: "Overnight Shipping",
|
|
306
|
+
type: "shipping_overnight",
|
|
307
|
+
cost: this.createMoney(25)
|
|
308
|
+
}
|
|
309
|
+
], i = {
|
|
310
|
+
entityId: o,
|
|
311
|
+
address: {
|
|
312
|
+
firstName: e.firstName ?? null,
|
|
313
|
+
lastName: e.lastName ?? null,
|
|
314
|
+
address1: e.address1 ?? null,
|
|
315
|
+
address2: e.address2 ?? null,
|
|
316
|
+
city: e.city ?? null,
|
|
317
|
+
stateOrProvince: e.stateOrProvince ?? null,
|
|
318
|
+
stateOrProvinceCode: e.stateOrProvinceCode ?? null,
|
|
319
|
+
countryCode: e.countryCode,
|
|
320
|
+
postalCode: e.postalCode ?? null,
|
|
321
|
+
phone: e.phone ?? null,
|
|
322
|
+
email: e.email ?? null
|
|
323
|
+
},
|
|
324
|
+
availableShippingOptions: s,
|
|
325
|
+
selectedShippingOption: null,
|
|
326
|
+
shippingCost: null,
|
|
327
|
+
lineItemIds: n.map((c) => c.lineItemEntityId)
|
|
328
|
+
}, a = {
|
|
329
|
+
...r,
|
|
330
|
+
shippingConsignments: [
|
|
331
|
+
...r.shippingConsignments ?? [],
|
|
332
|
+
i
|
|
333
|
+
]
|
|
334
|
+
};
|
|
335
|
+
return this.calculateCheckoutTotals(a), this.checkouts.set(t, a), a;
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Add billing address to a checkout
|
|
339
|
+
*/
|
|
340
|
+
async setCheckoutBillingAddress(t, e) {
|
|
341
|
+
const n = this.checkouts.get(t);
|
|
342
|
+
return n ? (n.billingAddress = {
|
|
343
|
+
firstName: e.firstName ?? null,
|
|
344
|
+
lastName: e.lastName ?? null,
|
|
345
|
+
address1: e.address1 ?? null,
|
|
346
|
+
address2: e.address2 ?? null,
|
|
347
|
+
city: e.city ?? null,
|
|
348
|
+
stateOrProvince: e.stateOrProvince ?? null,
|
|
349
|
+
stateOrProvinceCode: e.stateOrProvinceCode ?? null,
|
|
350
|
+
countryCode: e.countryCode,
|
|
351
|
+
postalCode: e.postalCode ?? null,
|
|
352
|
+
phone: e.phone ?? null,
|
|
353
|
+
email: e.email ?? null
|
|
354
|
+
}, this.checkouts.set(t, n), n) : null;
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Get customer's saved addresses and customer info
|
|
358
|
+
* Always returns empty for mock (simulates logged-out state)
|
|
359
|
+
*/
|
|
360
|
+
async getCustomerAddresses() {
|
|
361
|
+
return {
|
|
362
|
+
customerInfo: null,
|
|
363
|
+
addresses: []
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Update checkout customer message (order notes)
|
|
368
|
+
*/
|
|
369
|
+
async updateCheckoutCustomerMessage(t, e) {
|
|
370
|
+
const n = this.checkouts.get(t);
|
|
371
|
+
return n || null;
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* Create a metafield on a cart (no-op in mock)
|
|
375
|
+
*/
|
|
376
|
+
async createCartMetafield(t, e, n) {
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* Low-level request method (not implemented in mock)
|
|
380
|
+
*/
|
|
381
|
+
async request(t) {
|
|
382
|
+
throw new Error(
|
|
383
|
+
"MockBigCommerceClient.request() is not implemented. Use specific methods instead."
|
|
384
|
+
);
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Get product paths for building product page URLs
|
|
388
|
+
* Returns a map of productEntityId to path
|
|
389
|
+
*/
|
|
390
|
+
async getProductPaths(t) {
|
|
391
|
+
const e = /* @__PURE__ */ new Map();
|
|
392
|
+
for (const n of t)
|
|
393
|
+
e.set(n, `/products/product-${n}/`);
|
|
394
|
+
return e;
|
|
395
|
+
}
|
|
396
|
+
/**
|
|
397
|
+
* Get products for display (used by showProducts tool)
|
|
398
|
+
* Returns mock product names, images, prices, and variant information
|
|
399
|
+
*/
|
|
400
|
+
async getProductsForDisplay(t) {
|
|
401
|
+
return t.map((e) => ({
|
|
402
|
+
entityId: e,
|
|
403
|
+
name: `Product ${e}`,
|
|
404
|
+
sku: `SKU-${e}`,
|
|
405
|
+
path: `/products/product-${e}/`,
|
|
406
|
+
defaultImage: {
|
|
407
|
+
urlTemplate: "https://cdn11.bigcommerce.com/s-abc/images/stencil/200w/products/{:size}/sample.jpg"
|
|
408
|
+
},
|
|
409
|
+
variants: [
|
|
410
|
+
{
|
|
411
|
+
entityId: e * 1e3 + 1,
|
|
412
|
+
sku: `SKU-${e}-V1`,
|
|
413
|
+
isPurchasable: !0,
|
|
414
|
+
defaultImage: {
|
|
415
|
+
urlTemplate: "https://cdn11.bigcommerce.com/s-abc/images/stencil/200w/products/{:size}/variant1.jpg"
|
|
416
|
+
},
|
|
417
|
+
prices: { price: { value: 29.99, currencyCode: "USD" } },
|
|
418
|
+
inventory: {
|
|
419
|
+
isInStock: !0,
|
|
420
|
+
aggregated: { availableToSell: 10, warningLevel: 3 }
|
|
421
|
+
}
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
entityId: e * 1e3 + 2,
|
|
425
|
+
sku: `SKU-${e}-V2`,
|
|
426
|
+
isPurchasable: !0,
|
|
427
|
+
defaultImage: {
|
|
428
|
+
urlTemplate: "https://cdn11.bigcommerce.com/s-abc/images/stencil/200w/products/{:size}/variant2.jpg"
|
|
429
|
+
},
|
|
430
|
+
prices: { price: { value: 34.99, currencyCode: "USD" } },
|
|
431
|
+
inventory: {
|
|
432
|
+
isInStock: !0,
|
|
433
|
+
aggregated: { availableToSell: 5, warningLevel: 3 }
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
]
|
|
437
|
+
}));
|
|
438
|
+
}
|
|
439
|
+
/**
|
|
440
|
+
* Get product variant details for multiple products
|
|
441
|
+
* Returns mock product options and variants
|
|
442
|
+
*/
|
|
443
|
+
async getProductVariantDetails(t) {
|
|
444
|
+
return t.map((e) => ({
|
|
445
|
+
entityId: e,
|
|
446
|
+
productOptions: [
|
|
447
|
+
{
|
|
448
|
+
entityId: e * 100,
|
|
449
|
+
displayName: "Size",
|
|
450
|
+
isRequired: !0,
|
|
451
|
+
isVariantOption: !0,
|
|
452
|
+
displayStyle: "DropdownList",
|
|
453
|
+
values: [
|
|
454
|
+
{ entityId: e * 100 + 1, label: "Small", isDefault: !0 },
|
|
455
|
+
{ entityId: e * 100 + 2, label: "Medium", isDefault: !1 },
|
|
456
|
+
{ entityId: e * 100 + 3, label: "Large", isDefault: !1 }
|
|
457
|
+
]
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
entityId: e * 100 + 10,
|
|
461
|
+
displayName: "Color",
|
|
462
|
+
isRequired: !0,
|
|
463
|
+
isVariantOption: !0,
|
|
464
|
+
displayStyle: "DropdownList",
|
|
465
|
+
values: [
|
|
466
|
+
{ entityId: e * 100 + 11, label: "Red", isDefault: !0 },
|
|
467
|
+
{ entityId: e * 100 + 12, label: "Blue", isDefault: !1 }
|
|
468
|
+
]
|
|
469
|
+
}
|
|
470
|
+
],
|
|
471
|
+
variants: [
|
|
472
|
+
// Small + Red
|
|
473
|
+
{
|
|
474
|
+
entityId: e * 1e3 + 1,
|
|
475
|
+
sku: `SKU-${e}-S-R`,
|
|
476
|
+
isPurchasable: !0,
|
|
477
|
+
prices: { price: { value: 29.99, currencyCode: "USD" } },
|
|
478
|
+
inventory: { aggregated: { availableToSell: 10, warningLevel: 3 } },
|
|
479
|
+
options: [
|
|
480
|
+
{
|
|
481
|
+
entityId: e * 100,
|
|
482
|
+
displayName: "Size",
|
|
483
|
+
values: [{ entityId: e * 100 + 1, label: "Small" }]
|
|
484
|
+
},
|
|
485
|
+
{
|
|
486
|
+
entityId: e * 100 + 10,
|
|
487
|
+
displayName: "Color",
|
|
488
|
+
values: [{ entityId: e * 100 + 11, label: "Red" }]
|
|
489
|
+
}
|
|
490
|
+
]
|
|
491
|
+
},
|
|
492
|
+
// Small + Blue
|
|
493
|
+
{
|
|
494
|
+
entityId: e * 1e3 + 2,
|
|
495
|
+
sku: `SKU-${e}-S-B`,
|
|
496
|
+
isPurchasable: !0,
|
|
497
|
+
prices: { price: { value: 29.99, currencyCode: "USD" } },
|
|
498
|
+
inventory: { aggregated: { availableToSell: 5, warningLevel: 3 } },
|
|
499
|
+
options: [
|
|
500
|
+
{
|
|
501
|
+
entityId: e * 100,
|
|
502
|
+
displayName: "Size",
|
|
503
|
+
values: [{ entityId: e * 100 + 1, label: "Small" }]
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
entityId: e * 100 + 10,
|
|
507
|
+
displayName: "Color",
|
|
508
|
+
values: [{ entityId: e * 100 + 12, label: "Blue" }]
|
|
509
|
+
}
|
|
510
|
+
]
|
|
511
|
+
},
|
|
512
|
+
// Medium + Red
|
|
513
|
+
{
|
|
514
|
+
entityId: e * 1e3 + 3,
|
|
515
|
+
sku: `SKU-${e}-M-R`,
|
|
516
|
+
isPurchasable: !0,
|
|
517
|
+
prices: { price: { value: 34.99, currencyCode: "USD" } },
|
|
518
|
+
inventory: { aggregated: { availableToSell: 8, warningLevel: 3 } },
|
|
519
|
+
options: [
|
|
520
|
+
{
|
|
521
|
+
entityId: e * 100,
|
|
522
|
+
displayName: "Size",
|
|
523
|
+
values: [{ entityId: e * 100 + 2, label: "Medium" }]
|
|
524
|
+
},
|
|
525
|
+
{
|
|
526
|
+
entityId: e * 100 + 10,
|
|
527
|
+
displayName: "Color",
|
|
528
|
+
values: [{ entityId: e * 100 + 11, label: "Red" }]
|
|
529
|
+
}
|
|
530
|
+
]
|
|
531
|
+
},
|
|
532
|
+
// Medium + Blue
|
|
533
|
+
{
|
|
534
|
+
entityId: e * 1e3 + 4,
|
|
535
|
+
sku: `SKU-${e}-M-B`,
|
|
536
|
+
isPurchasable: !1,
|
|
537
|
+
// Out of stock example
|
|
538
|
+
prices: { price: { value: 34.99, currencyCode: "USD" } },
|
|
539
|
+
inventory: { aggregated: { availableToSell: 0, warningLevel: 3 } },
|
|
540
|
+
options: [
|
|
541
|
+
{
|
|
542
|
+
entityId: e * 100,
|
|
543
|
+
displayName: "Size",
|
|
544
|
+
values: [{ entityId: e * 100 + 2, label: "Medium" }]
|
|
545
|
+
},
|
|
546
|
+
{
|
|
547
|
+
entityId: e * 100 + 10,
|
|
548
|
+
displayName: "Color",
|
|
549
|
+
values: [{ entityId: e * 100 + 12, label: "Blue" }]
|
|
550
|
+
}
|
|
551
|
+
]
|
|
552
|
+
},
|
|
553
|
+
// Large + Red
|
|
554
|
+
{
|
|
555
|
+
entityId: e * 1e3 + 5,
|
|
556
|
+
sku: `SKU-${e}-L-R`,
|
|
557
|
+
isPurchasable: !0,
|
|
558
|
+
prices: { price: { value: 39.99, currencyCode: "USD" } },
|
|
559
|
+
inventory: { aggregated: { availableToSell: 12, warningLevel: 3 } },
|
|
560
|
+
options: [
|
|
561
|
+
{
|
|
562
|
+
entityId: e * 100,
|
|
563
|
+
displayName: "Size",
|
|
564
|
+
values: [{ entityId: e * 100 + 3, label: "Large" }]
|
|
565
|
+
},
|
|
566
|
+
{
|
|
567
|
+
entityId: e * 100 + 10,
|
|
568
|
+
displayName: "Color",
|
|
569
|
+
values: [{ entityId: e * 100 + 11, label: "Red" }]
|
|
570
|
+
}
|
|
571
|
+
]
|
|
572
|
+
},
|
|
573
|
+
// Large + Blue
|
|
574
|
+
{
|
|
575
|
+
entityId: e * 1e3 + 6,
|
|
576
|
+
sku: `SKU-${e}-L-B`,
|
|
577
|
+
isPurchasable: !0,
|
|
578
|
+
prices: { price: { value: 39.99, currencyCode: "USD" } },
|
|
579
|
+
inventory: { aggregated: { availableToSell: 7, warningLevel: 3 } },
|
|
580
|
+
options: [
|
|
581
|
+
{
|
|
582
|
+
entityId: e * 100,
|
|
583
|
+
displayName: "Size",
|
|
584
|
+
values: [{ entityId: e * 100 + 3, label: "Large" }]
|
|
585
|
+
},
|
|
586
|
+
{
|
|
587
|
+
entityId: e * 100 + 10,
|
|
588
|
+
displayName: "Color",
|
|
589
|
+
values: [{ entityId: e * 100 + 12, label: "Blue" }]
|
|
590
|
+
}
|
|
591
|
+
]
|
|
592
|
+
}
|
|
593
|
+
]
|
|
594
|
+
}));
|
|
595
|
+
}
|
|
596
|
+
/**
|
|
597
|
+
* Reset all state (useful for testing)
|
|
598
|
+
*/
|
|
599
|
+
reset() {
|
|
600
|
+
this.carts.clear(), this.checkouts.clear(), this.checkoutToCartId.clear(), this.nextCartId = 1, this.nextCheckoutId = 1, this.nextLineItemId = 1, this.nextConsignmentId = 1, this.nextShippingOptionId = 1;
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
function v(p) {
|
|
604
|
+
return new I(p);
|
|
605
|
+
}
|
|
606
|
+
export {
|
|
607
|
+
I as MockBigCommerceClient,
|
|
608
|
+
v as createMockBigCommerceClient
|
|
609
|
+
};
|
|
610
|
+
//# sourceMappingURL=testing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testing.js","sources":["../src/lib/bigcommerce/storefront/mock-client.ts"],"sourcesContent":["// Mock BigCommerce Client for Development/Demo Mode\n\nimport type {\n BigCommerceConfig,\n Cart,\n CartLineItem,\n CartLineItemInput,\n CartRedirectUrls,\n Checkout,\n CheckoutAddress,\n CheckoutConsignment,\n CheckoutConsignmentLineItem,\n CheckoutShippingOption,\n CustomerAddress,\n CustomerInfo,\n Money,\n ProductForDisplay,\n ProductVariantDetails\n} from './types.js';\n\nexport class MockBigCommerceClient {\n private carts: Map<string, Cart> = new Map();\n private checkouts: Map<string, Checkout> = new Map();\n private checkoutToCartId: Map<string, string> = new Map();\n private nextCartId = 1;\n private nextCheckoutId = 1;\n private nextLineItemId = 1;\n private nextConsignmentId = 1;\n private nextShippingOptionId = 1;\n\n readonly channelId = 1; // Default channel ID for mock\n\n constructor(_config?: BigCommerceConfig) {\n // Config not used in mock\n }\n\n /**\n * Helper: Create a Money object\n */\n private createMoney(value: number): Money {\n return {\n value,\n currencyCode: 'USD'\n };\n }\n\n /**\n * Helper: Generate cart entity ID\n */\n private generateCartId(): string {\n return `cart-${this.nextCartId++}`;\n }\n\n /**\n * Helper: Generate checkout entity ID\n */\n private generateCheckoutId(): string {\n return `checkout-${this.nextCheckoutId++}`;\n }\n\n /**\n * Helper: Generate line item entity ID\n */\n private generateLineItemId(): string {\n return `item-${this.nextLineItemId++}`;\n }\n\n /**\n * Helper: Generate consignment entity ID\n */\n private generateConsignmentId(): string {\n return `consignment-${this.nextConsignmentId++}`;\n }\n\n /**\n * Helper: Generate shipping option entity ID\n */\n private generateShippingOptionId(): string {\n return `shipping-option-${this.nextShippingOptionId++}`;\n }\n\n /**\n * Helper: Create a cart line item from input\n */\n private createCartLineItem(input: CartLineItemInput): CartLineItem {\n const price = input.productEntityId * 0.1;\n const extendedPrice = price * input.quantity;\n\n return {\n entityId: this.generateLineItemId(),\n productEntityId: input.productEntityId,\n variantEntityId: input.variantEntityId ?? input.productEntityId,\n quantity: input.quantity,\n name: `Product ${input.productEntityId}`,\n sku: `SKU-${input.productEntityId}`,\n originalPrice: this.createMoney(price),\n listPrice: this.createMoney(price),\n extendedListPrice: this.createMoney(extendedPrice),\n extendedSalePrice: this.createMoney(extendedPrice),\n imageUrl: null\n };\n }\n\n /**\n * Helper: Calculate cart totals\n */\n private calculateCartTotals(items: CartLineItem[]): {\n amount: Money;\n baseAmount: Money;\n discountedAmount: Money;\n } {\n const total = items.reduce(\n (sum, item) => sum + item.extendedSalePrice.value,\n 0\n );\n\n return {\n amount: this.createMoney(total),\n baseAmount: this.createMoney(total),\n discountedAmount: this.createMoney(0)\n };\n }\n\n /**\n * Helper: Calculate checkout totals\n */\n private calculateCheckoutTotals(checkout: Checkout): void {\n const cartId = this.checkoutToCartId.get(checkout.entityId);\n const cart = cartId ? this.carts.get(cartId) : undefined;\n const subtotal = cart?.amount.value ?? 0;\n let tax = 0;\n let shipping = 0;\n\n // Calculate tax if shipping consignment exists (8% rate)\n if (\n checkout.shippingConsignments &&\n checkout.shippingConsignments.length > 0\n ) {\n tax = subtotal * 0.08;\n }\n\n // Calculate shipping from selected options\n for (const consignment of checkout.shippingConsignments ?? []) {\n if (consignment.selectedShippingOption) {\n shipping += consignment.selectedShippingOption.cost.value;\n }\n }\n\n checkout.subtotal = this.createMoney(subtotal);\n checkout.taxTotal = this.createMoney(tax);\n checkout.shippingCostTotal = this.createMoney(shipping);\n checkout.handlingCostTotal = this.createMoney(0);\n checkout.grandTotal = this.createMoney(subtotal + tax + shipping);\n }\n\n /**\n * Get an existing cart by ID\n */\n async getCart(cartEntityId?: string): Promise<Cart | null> {\n if (!cartEntityId) {\n return null;\n }\n return this.carts.get(cartEntityId) ?? null;\n }\n\n /**\n * Create a new cart with line items\n */\n async createCart(lineItems: CartLineItemInput[]): Promise<Cart | null> {\n if (lineItems.length === 0) {\n throw new Error('Cannot create cart with no line items');\n }\n\n const cartId = this.generateCartId();\n const checkoutId = this.generateCheckoutId();\n const now = { utc: new Date().toISOString() };\n\n const physicalItems = lineItems.map((item) =>\n this.createCartLineItem(item)\n );\n const totals = this.calculateCartTotals(physicalItems);\n\n const cart: Cart = {\n id: cartId,\n entityId: cartId,\n lineItems: {\n physicalItems,\n digitalItems: []\n },\n amount: totals.amount,\n baseAmount: totals.baseAmount,\n discountedAmount: totals.discountedAmount,\n createdAt: now,\n updatedAt: now\n };\n\n this.carts.set(cartId, cart);\n\n // Create corresponding checkout\n const checkout: Checkout = {\n entityId: checkoutId,\n subtotal: cart.amount,\n taxTotal: this.createMoney(0),\n grandTotal: cart.amount,\n shippingCostTotal: this.createMoney(0),\n handlingCostTotal: this.createMoney(0),\n billingAddress: null,\n shippingConsignments: null\n };\n\n this.checkouts.set(checkoutId, checkout);\n this.checkoutToCartId.set(checkoutId, cartId);\n\n return cart;\n }\n\n /**\n * Add line items to an existing cart\n */\n async addCartLineItems(\n cartEntityId: string,\n lineItems: CartLineItemInput[]\n ): Promise<Cart | null> {\n const cart = this.carts.get(cartEntityId);\n if (!cart) {\n return null;\n }\n\n if (lineItems.length === 0) {\n return cart;\n }\n\n const newItems = lineItems.map((item) => this.createCartLineItem(item));\n const allItems = [...cart.lineItems.physicalItems, ...newItems];\n const totals = this.calculateCartTotals(allItems);\n\n const updatedCart: Cart = {\n ...cart,\n lineItems: {\n ...cart.lineItems,\n physicalItems: allItems\n },\n amount: totals.amount,\n baseAmount: totals.baseAmount,\n discountedAmount: totals.discountedAmount,\n updatedAt: { utc: new Date().toISOString() }\n };\n\n this.carts.set(cartEntityId, updatedCart);\n\n // Update corresponding checkout\n for (const [checkoutId, cartId] of this.checkoutToCartId.entries()) {\n if (cartId === cartEntityId) {\n const checkout = this.checkouts.get(checkoutId);\n if (checkout) {\n const updatedCheckout = { ...checkout };\n this.calculateCheckoutTotals(updatedCheckout);\n this.checkouts.set(checkoutId, updatedCheckout);\n }\n break;\n }\n }\n\n return updatedCart;\n }\n\n /**\n * Update the quantity of a cart line item\n */\n async updateCartLineItem(\n cartEntityId: string,\n lineItemEntityId: string,\n quantity: number,\n _productEntityId: number,\n _variantEntityId?: number\n ): Promise<Cart | null> {\n const cart = this.carts.get(cartEntityId);\n if (!cart) {\n return null;\n }\n\n const itemIndex = cart.lineItems.physicalItems.findIndex(\n (item) => item.entityId === lineItemEntityId\n );\n if (itemIndex === -1) {\n return null;\n }\n\n const updatedItems = [...cart.lineItems.physicalItems];\n const item = updatedItems[itemIndex];\n if (!item) {\n return null;\n }\n\n const price = item.listPrice.value;\n const extendedPrice = price * quantity;\n\n updatedItems[itemIndex] = {\n ...item,\n quantity,\n extendedListPrice: this.createMoney(extendedPrice),\n extendedSalePrice: this.createMoney(extendedPrice)\n };\n\n const totals = this.calculateCartTotals(updatedItems);\n\n const updatedCart: Cart = {\n ...cart,\n lineItems: {\n ...cart.lineItems,\n physicalItems: updatedItems\n },\n amount: totals.amount,\n baseAmount: totals.baseAmount,\n discountedAmount: totals.discountedAmount,\n updatedAt: { utc: new Date().toISOString() }\n };\n\n this.carts.set(cartEntityId, updatedCart);\n\n // Update corresponding checkout\n for (const [checkoutId, cartId] of this.checkoutToCartId.entries()) {\n if (cartId === cartEntityId) {\n const checkout = this.checkouts.get(checkoutId);\n if (checkout) {\n const updatedCheckout = { ...checkout };\n this.calculateCheckoutTotals(updatedCheckout);\n this.checkouts.set(checkoutId, updatedCheckout);\n }\n break;\n }\n }\n\n return updatedCart;\n }\n\n /**\n * Remove a line item from the cart\n */\n async deleteCartLineItem(\n cartEntityId: string,\n lineItemEntityId: string\n ): Promise<Cart | null> {\n const cart = this.carts.get(cartEntityId);\n if (!cart) {\n return null;\n }\n\n const itemExists = cart.lineItems.physicalItems.some(\n (item) => item.entityId === lineItemEntityId\n );\n if (!itemExists) {\n return null;\n }\n\n const updatedItems = cart.lineItems.physicalItems.filter(\n (item) => item.entityId !== lineItemEntityId\n );\n const totals = this.calculateCartTotals(updatedItems);\n\n const updatedCart: Cart = {\n ...cart,\n lineItems: {\n ...cart.lineItems,\n physicalItems: updatedItems\n },\n amount: totals.amount,\n baseAmount: totals.baseAmount,\n discountedAmount: totals.discountedAmount,\n updatedAt: { utc: new Date().toISOString() }\n };\n\n this.carts.set(cartEntityId, updatedCart);\n\n // Update corresponding checkout\n for (const [checkoutId, cartId] of this.checkoutToCartId.entries()) {\n if (cartId === cartEntityId) {\n const checkout = this.checkouts.get(checkoutId);\n if (checkout) {\n const updatedCheckout = { ...checkout };\n this.calculateCheckoutTotals(updatedCheckout);\n this.checkouts.set(checkoutId, updatedCheckout);\n }\n break;\n }\n }\n\n return updatedCart;\n }\n\n /**\n * Delete an entire cart\n */\n async deleteCart(cartEntityId: string): Promise<string | null> {\n const cart = this.carts.get(cartEntityId);\n if (!cart) {\n return null;\n }\n\n this.carts.delete(cartEntityId);\n\n // Delete corresponding checkout\n for (const [checkoutId, cartId] of this.checkoutToCartId.entries()) {\n if (cartId === cartEntityId) {\n this.checkouts.delete(checkoutId);\n this.checkoutToCartId.delete(checkoutId);\n break;\n }\n }\n\n return cartEntityId;\n }\n\n /**\n * Create a cart or add to existing cart\n * Convenience method that handles both cases\n */\n async addToCart(\n lineItems: CartLineItemInput[],\n existingCartId?: string\n ): Promise<Cart | null> {\n if (existingCartId) {\n return this.addCartLineItems(existingCartId, lineItems);\n }\n return this.createCart(lineItems);\n }\n\n /**\n * Create single-use redirect URLs for a cart\n */\n async createCartRedirectUrls(\n cartEntityId: string\n ): Promise<CartRedirectUrls | null> {\n const cart = this.carts.get(cartEntityId);\n if (!cart) {\n return null;\n }\n\n return {\n redirectedCheckoutUrl: `https://store.example.com/cart/${cartEntityId}`\n };\n }\n\n /**\n * Get checkout by entity ID\n */\n async getCheckout(checkoutEntityId?: string): Promise<Checkout | null> {\n if (!checkoutEntityId) {\n return null;\n }\n return this.checkouts.get(checkoutEntityId) ?? null;\n }\n\n /**\n * Add shipping consignments (addresses) to a checkout\n */\n async setCheckoutShippingAddress(\n checkoutEntityId: string,\n address: CheckoutAddress,\n lineItems: CheckoutConsignmentLineItem[]\n ): Promise<Checkout | null> {\n const checkout = this.checkouts.get(checkoutEntityId);\n if (!checkout) {\n return null;\n }\n\n const consignmentId = this.generateConsignmentId();\n\n // Generate shipping options\n const shippingOptions: CheckoutShippingOption[] = [\n {\n entityId: this.generateShippingOptionId(),\n description: 'Standard Shipping',\n type: 'shipping_flatrate',\n cost: this.createMoney(5)\n },\n {\n entityId: this.generateShippingOptionId(),\n description: 'Express Shipping',\n type: 'shipping_express',\n cost: this.createMoney(15)\n },\n {\n entityId: this.generateShippingOptionId(),\n description: 'Overnight Shipping',\n type: 'shipping_overnight',\n cost: this.createMoney(25)\n }\n ];\n\n const consignment: CheckoutConsignment = {\n entityId: consignmentId,\n address: {\n firstName: address.firstName ?? null,\n lastName: address.lastName ?? null,\n address1: address.address1 ?? null,\n address2: address.address2 ?? null,\n city: address.city ?? null,\n stateOrProvince: address.stateOrProvince ?? null,\n stateOrProvinceCode: address.stateOrProvinceCode ?? null,\n countryCode: address.countryCode,\n postalCode: address.postalCode ?? null,\n phone: address.phone ?? null,\n email: address.email ?? null\n },\n availableShippingOptions: shippingOptions,\n selectedShippingOption: null,\n shippingCost: null,\n lineItemIds: lineItems.map((item) => item.lineItemEntityId)\n };\n\n const updatedCheckout: Checkout = {\n ...checkout,\n shippingConsignments: [\n ...(checkout.shippingConsignments ?? []),\n consignment\n ]\n };\n\n this.calculateCheckoutTotals(updatedCheckout);\n this.checkouts.set(checkoutEntityId, updatedCheckout);\n\n return updatedCheckout;\n }\n\n /**\n * Add billing address to a checkout\n */\n async setCheckoutBillingAddress(\n checkoutEntityId: string,\n address: CheckoutAddress\n ): Promise<Checkout | null> {\n const checkout = this.checkouts.get(checkoutEntityId);\n if (!checkout) {\n return null;\n }\n\n checkout.billingAddress = {\n firstName: address.firstName ?? null,\n lastName: address.lastName ?? null,\n address1: address.address1 ?? null,\n address2: address.address2 ?? null,\n city: address.city ?? null,\n stateOrProvince: address.stateOrProvince ?? null,\n stateOrProvinceCode: address.stateOrProvinceCode ?? null,\n countryCode: address.countryCode,\n postalCode: address.postalCode ?? null,\n phone: address.phone ?? null,\n email: address.email ?? null\n };\n\n this.checkouts.set(checkoutEntityId, checkout);\n return checkout;\n }\n\n /**\n * Get customer's saved addresses and customer info\n * Always returns empty for mock (simulates logged-out state)\n */\n async getCustomerAddresses(): Promise<{\n customerInfo: CustomerInfo | null;\n addresses: CustomerAddress[];\n }> {\n return {\n customerInfo: null,\n addresses: []\n };\n }\n\n /**\n * Update checkout customer message (order notes)\n */\n async updateCheckoutCustomerMessage(\n checkoutEntityId: string,\n _message: any\n ): Promise<Checkout | null> {\n const checkout = this.checkouts.get(checkoutEntityId);\n if (!checkout) {\n return null;\n }\n\n // Note: The Checkout type doesn't have a message field,\n // but we can still update and return the checkout\n // In a real implementation, this would be stored on the checkout\n return checkout;\n }\n\n /**\n * Create a metafield on a cart (no-op in mock)\n */\n async createCartMetafield(\n _cartEntityId: string,\n _key: string,\n _value: string\n ): Promise<void> {\n // No-op in mock client\n }\n\n /**\n * Low-level request method (not implemented in mock)\n */\n async request<T = unknown>(_options: unknown): Promise<T> {\n throw new Error(\n 'MockBigCommerceClient.request() is not implemented. Use specific methods instead.'\n );\n }\n\n /**\n * Get product paths for building product page URLs\n * Returns a map of productEntityId to path\n */\n async getProductPaths(\n productEntityIds: number[]\n ): Promise<Map<number, string>> {\n const paths = new Map<number, string>();\n for (const entityId of productEntityIds) {\n paths.set(entityId, `/products/product-${entityId}/`);\n }\n return paths;\n }\n\n /**\n * Get products for display (used by showProducts tool)\n * Returns mock product names, images, prices, and variant information\n */\n async getProductsForDisplay(\n productEntityIds: number[]\n ): Promise<ProductForDisplay[]> {\n return productEntityIds.map((entityId) => ({\n entityId,\n name: `Product ${entityId}`,\n sku: `SKU-${entityId}`,\n path: `/products/product-${entityId}/`,\n defaultImage: {\n urlTemplate:\n 'https://cdn11.bigcommerce.com/s-abc/images/stencil/200w/products/{:size}/sample.jpg'\n },\n variants: [\n {\n entityId: entityId * 1000 + 1,\n sku: `SKU-${entityId}-V1`,\n isPurchasable: true,\n defaultImage: {\n urlTemplate:\n 'https://cdn11.bigcommerce.com/s-abc/images/stencil/200w/products/{:size}/variant1.jpg'\n },\n prices: { price: { value: 29.99, currencyCode: 'USD' } },\n inventory: {\n isInStock: true,\n aggregated: { availableToSell: 10, warningLevel: 3 }\n }\n },\n {\n entityId: entityId * 1000 + 2,\n sku: `SKU-${entityId}-V2`,\n isPurchasable: true,\n defaultImage: {\n urlTemplate:\n 'https://cdn11.bigcommerce.com/s-abc/images/stencil/200w/products/{:size}/variant2.jpg'\n },\n prices: { price: { value: 34.99, currencyCode: 'USD' } },\n inventory: {\n isInStock: true,\n aggregated: { availableToSell: 5, warningLevel: 3 }\n }\n }\n ]\n }));\n }\n\n /**\n * Get product variant details for multiple products\n * Returns mock product options and variants\n */\n async getProductVariantDetails(\n productEntityIds: number[]\n ): Promise<ProductVariantDetails[]> {\n return productEntityIds.map((entityId) => ({\n entityId,\n productOptions: [\n {\n entityId: entityId * 100,\n displayName: 'Size',\n isRequired: true,\n isVariantOption: true,\n displayStyle: 'DropdownList',\n values: [\n { entityId: entityId * 100 + 1, label: 'Small', isDefault: true },\n { entityId: entityId * 100 + 2, label: 'Medium', isDefault: false },\n { entityId: entityId * 100 + 3, label: 'Large', isDefault: false }\n ]\n },\n {\n entityId: entityId * 100 + 10,\n displayName: 'Color',\n isRequired: true,\n isVariantOption: true,\n displayStyle: 'DropdownList',\n values: [\n { entityId: entityId * 100 + 11, label: 'Red', isDefault: true },\n { entityId: entityId * 100 + 12, label: 'Blue', isDefault: false }\n ]\n }\n ],\n variants: [\n // Small + Red\n {\n entityId: entityId * 1000 + 1,\n sku: `SKU-${entityId}-S-R`,\n isPurchasable: true,\n prices: { price: { value: 29.99, currencyCode: 'USD' } },\n inventory: { aggregated: { availableToSell: 10, warningLevel: 3 } },\n options: [\n {\n entityId: entityId * 100,\n displayName: 'Size',\n values: [{ entityId: entityId * 100 + 1, label: 'Small' }]\n },\n {\n entityId: entityId * 100 + 10,\n displayName: 'Color',\n values: [{ entityId: entityId * 100 + 11, label: 'Red' }]\n }\n ]\n },\n // Small + Blue\n {\n entityId: entityId * 1000 + 2,\n sku: `SKU-${entityId}-S-B`,\n isPurchasable: true,\n prices: { price: { value: 29.99, currencyCode: 'USD' } },\n inventory: { aggregated: { availableToSell: 5, warningLevel: 3 } },\n options: [\n {\n entityId: entityId * 100,\n displayName: 'Size',\n values: [{ entityId: entityId * 100 + 1, label: 'Small' }]\n },\n {\n entityId: entityId * 100 + 10,\n displayName: 'Color',\n values: [{ entityId: entityId * 100 + 12, label: 'Blue' }]\n }\n ]\n },\n // Medium + Red\n {\n entityId: entityId * 1000 + 3,\n sku: `SKU-${entityId}-M-R`,\n isPurchasable: true,\n prices: { price: { value: 34.99, currencyCode: 'USD' } },\n inventory: { aggregated: { availableToSell: 8, warningLevel: 3 } },\n options: [\n {\n entityId: entityId * 100,\n displayName: 'Size',\n values: [{ entityId: entityId * 100 + 2, label: 'Medium' }]\n },\n {\n entityId: entityId * 100 + 10,\n displayName: 'Color',\n values: [{ entityId: entityId * 100 + 11, label: 'Red' }]\n }\n ]\n },\n // Medium + Blue\n {\n entityId: entityId * 1000 + 4,\n sku: `SKU-${entityId}-M-B`,\n isPurchasable: false, // Out of stock example\n prices: { price: { value: 34.99, currencyCode: 'USD' } },\n inventory: { aggregated: { availableToSell: 0, warningLevel: 3 } },\n options: [\n {\n entityId: entityId * 100,\n displayName: 'Size',\n values: [{ entityId: entityId * 100 + 2, label: 'Medium' }]\n },\n {\n entityId: entityId * 100 + 10,\n displayName: 'Color',\n values: [{ entityId: entityId * 100 + 12, label: 'Blue' }]\n }\n ]\n },\n // Large + Red\n {\n entityId: entityId * 1000 + 5,\n sku: `SKU-${entityId}-L-R`,\n isPurchasable: true,\n prices: { price: { value: 39.99, currencyCode: 'USD' } },\n inventory: { aggregated: { availableToSell: 12, warningLevel: 3 } },\n options: [\n {\n entityId: entityId * 100,\n displayName: 'Size',\n values: [{ entityId: entityId * 100 + 3, label: 'Large' }]\n },\n {\n entityId: entityId * 100 + 10,\n displayName: 'Color',\n values: [{ entityId: entityId * 100 + 11, label: 'Red' }]\n }\n ]\n },\n // Large + Blue\n {\n entityId: entityId * 1000 + 6,\n sku: `SKU-${entityId}-L-B`,\n isPurchasable: true,\n prices: { price: { value: 39.99, currencyCode: 'USD' } },\n inventory: { aggregated: { availableToSell: 7, warningLevel: 3 } },\n options: [\n {\n entityId: entityId * 100,\n displayName: 'Size',\n values: [{ entityId: entityId * 100 + 3, label: 'Large' }]\n },\n {\n entityId: entityId * 100 + 10,\n displayName: 'Color',\n values: [{ entityId: entityId * 100 + 12, label: 'Blue' }]\n }\n ]\n }\n ]\n }));\n }\n\n /**\n * Reset all state (useful for testing)\n */\n reset(): void {\n this.carts.clear();\n this.checkouts.clear();\n this.checkoutToCartId.clear();\n this.nextCartId = 1;\n this.nextCheckoutId = 1;\n this.nextLineItemId = 1;\n this.nextConsignmentId = 1;\n this.nextShippingOptionId = 1;\n }\n}\n\n/**\n * Create a mock BigCommerce client instance\n */\nexport function createMockBigCommerceClient(\n config?: BigCommerceConfig\n): MockBigCommerceClient {\n return new MockBigCommerceClient(config);\n}\n"],"names":["MockBigCommerceClient","_config","value","input","price","extendedPrice","items","total","sum","item","checkout","cartId","subtotal","tax","shipping","consignment","cartEntityId","lineItems","checkoutId","now","physicalItems","totals","cart","newItems","allItems","updatedCart","updatedCheckout","lineItemEntityId","quantity","_productEntityId","_variantEntityId","itemIndex","updatedItems","existingCartId","checkoutEntityId","address","consignmentId","shippingOptions","_message","_cartEntityId","_key","_value","_options","productEntityIds","paths","entityId","createMockBigCommerceClient","config"],"mappings":"AAoBO,MAAMA,EAAsB;AAAA,EACzB,4BAA+B,IAAA;AAAA,EAC/B,gCAAuC,IAAA;AAAA,EACvC,uCAA4C,IAAA;AAAA,EAC5C,aAAa;AAAA,EACb,iBAAiB;AAAA,EACjB,iBAAiB;AAAA,EACjB,oBAAoB;AAAA,EACpB,uBAAuB;AAAA,EAEtB,YAAY;AAAA;AAAA,EAErB,YAAYC,GAA6B;AAAA,EAEzC;AAAA;AAAA;AAAA;AAAA,EAKQ,YAAYC,GAAsB;AACxC,WAAO;AAAA,MACL,OAAAA;AAAA,MACA,cAAc;AAAA,IAAA;AAAA,EAElB;AAAA;AAAA;AAAA;AAAA,EAKQ,iBAAyB;AAC/B,WAAO,QAAQ,KAAK,YAAY;AAAA,EAClC;AAAA;AAAA;AAAA;AAAA,EAKQ,qBAA6B;AACnC,WAAO,YAAY,KAAK,gBAAgB;AAAA,EAC1C;AAAA;AAAA;AAAA;AAAA,EAKQ,qBAA6B;AACnC,WAAO,QAAQ,KAAK,gBAAgB;AAAA,EACtC;AAAA;AAAA;AAAA;AAAA,EAKQ,wBAAgC;AACtC,WAAO,eAAe,KAAK,mBAAmB;AAAA,EAChD;AAAA;AAAA;AAAA;AAAA,EAKQ,2BAAmC;AACzC,WAAO,mBAAmB,KAAK,sBAAsB;AAAA,EACvD;AAAA;AAAA;AAAA;AAAA,EAKQ,mBAAmBC,GAAwC;AACjE,UAAMC,IAAQD,EAAM,kBAAkB,KAChCE,IAAgBD,IAAQD,EAAM;AAEpC,WAAO;AAAA,MACL,UAAU,KAAK,mBAAA;AAAA,MACf,iBAAiBA,EAAM;AAAA,MACvB,iBAAiBA,EAAM,mBAAmBA,EAAM;AAAA,MAChD,UAAUA,EAAM;AAAA,MAChB,MAAM,WAAWA,EAAM,eAAe;AAAA,MACtC,KAAK,OAAOA,EAAM,eAAe;AAAA,MACjC,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