@mailbiz/onsite-yampi-vendor 0.1.0 → 0.1.2

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.
@@ -8,9 +8,15 @@ interface YampiWindow extends OnsiteCoreWindow {
8
8
  };
9
9
  checkout?: YampiCheckoutContext;
10
10
  orderData?: YampiOrderData;
11
+ merchant?: YampiMerchantContext;
11
12
  }
12
13
  //#endregion
13
14
  //#region [Global contexts]
15
+ interface YampiMerchantContext {
16
+ checkout?: {
17
+ base_domain?: string;
18
+ };
19
+ }
14
20
  interface YampiProductContext {
15
21
  id: number;
16
22
  sku_id: number;
@@ -125,6 +131,7 @@ interface YampiCheckoutContext {
125
131
  updateDomAfterInstallmentLoad?: boolean;
126
132
  eventsInitialized?: boolean;
127
133
  };
134
+ orderbump?: Record<string, unknown>;
128
135
  }
129
136
  interface YampiCheckoutCart {
130
137
  id: number;
@@ -159,8 +166,52 @@ interface YampiCheckoutPrices {
159
166
  items_discount: number;
160
167
  shipment: number;
161
168
  shipment_original_value: number | null;
169
+ shipment_discount_value?: number;
170
+ shipment_discount_percent?: string;
171
+ promocode_discount_value?: number;
172
+ progressive_discount_value?: number;
173
+ kits_discount_value?: number;
162
174
  total: number;
163
175
  value_for_free_shipment: number;
176
+ installments?: YampiInstallments;
177
+ promocode_subtotal?: number | null;
178
+ items_amount_formated?: string;
179
+ subtotal_formated?: string;
180
+ items_discount_formated?: string;
181
+ discount_formated?: string;
182
+ shipment_original_value_formated?: string;
183
+ shipment_formated?: string;
184
+ total_format?: string;
185
+ total_formated?: string;
186
+ value_for_free_shipment_formated?: string;
187
+ }
188
+ interface YampiInstallment {
189
+ amount: string;
190
+ amount_formated: string;
191
+ base_value: string;
192
+ tax: string;
193
+ tax_value: number;
194
+ discount_percent: string;
195
+ discount_value: string;
196
+ discount_value_formated: string;
197
+ installment: number;
198
+ installment_value: string;
199
+ installment_value_formated: string;
200
+ text: string;
201
+ text_with_tax: string;
202
+ text_discount_percent: string | null;
203
+ text_discount: string | null;
204
+ }
205
+ interface YampiInstallments {
206
+ max_installment: number;
207
+ max_installment_value: string;
208
+ amount: string;
209
+ text: string;
210
+ text_with_tax?: string;
211
+ text_discount_percent?: string | null;
212
+ text_discount?: string | null;
213
+ formula?: string;
214
+ installments?: YampiInstallment[];
164
215
  }
165
216
  interface YampiGridItem {
166
217
  name: string;
@@ -195,8 +246,9 @@ interface YampiCheckoutCartItem {
195
246
  is_freebie: boolean;
196
247
  freebie: unknown | null;
197
248
  group_name: string;
198
- product_metadata: Record<string, string>;
249
+ product_metadata: Record<string, string> | unknown[];
199
250
  metadata: unknown[];
251
+ bundle?: YampiCartItemBundle;
200
252
  small: string;
201
253
  thumb: string;
202
254
  medium: string;
@@ -205,11 +257,17 @@ interface YampiCheckoutCartItem {
205
257
  price_gift_formated: string;
206
258
  price_sale: string;
207
259
  price_sale_formated: string;
208
- price: string;
260
+ price: string | number;
209
261
  price_total: number;
210
262
  price_total_with_item_discount: number;
263
+ has_item_discount?: boolean;
264
+ has_item_discount_display?: boolean;
265
+ price_total_with_discount_display?: number;
266
+ progressive_discount_upsell?: unknown | null;
211
267
  price_formated: string;
212
268
  price_total_formated: string;
269
+ price_total_with_item_discount_formated?: string;
270
+ price_total_with_discount_display_formated?: string;
213
271
  name: string;
214
272
  name_with_grids: string;
215
273
  sku: string;
@@ -220,10 +278,14 @@ interface YampiCheckoutCartItem {
220
278
  grids: YampiGridItem[];
221
279
  is_digital: boolean;
222
280
  short_description: string;
281
+ rack_ids?: number[];
223
282
  customizations: unknown[];
224
283
  customized: boolean;
225
284
  allow_sell_without_customization: number;
226
285
  selected_customizations: number;
286
+ order_bump_id?: number | null;
287
+ shopify_variant_id?: number | null;
288
+ shopify_product_id?: number | null;
227
289
  product_option?: {
228
290
  id: number;
229
291
  store_id: number;
@@ -235,6 +297,7 @@ interface YampiCheckoutCartItem {
235
297
  availability: number;
236
298
  availability_soldout: number;
237
299
  allow_sell_without_customization: number;
300
+ grid_option?: unknown;
238
301
  product?: {
239
302
  id: number;
240
303
  name: string;
@@ -243,16 +306,39 @@ interface YampiCheckoutCartItem {
243
306
  is_digital: number;
244
307
  seo_description: string;
245
308
  brand_id: number;
309
+ facebook_pixel_id?: string | null;
246
310
  custom_shipping: number;
247
311
  shipping_price: string;
248
312
  store_id: number;
249
313
  simple: number;
250
- brand?: {
251
- id: number;
252
- name: string;
253
- };
314
+ brand?: YampiBrand;
254
315
  };
255
316
  };
317
+ discounts?: unknown[];
318
+ }
319
+ interface YampiCartItemBundle {
320
+ name: string;
321
+ modifiable: boolean;
322
+ image_url: string;
323
+ quantity: number;
324
+ shipping: {
325
+ custom: boolean;
326
+ price: number;
327
+ days: number | null;
328
+ type: string | null;
329
+ };
330
+ }
331
+ interface YampiBrand {
332
+ id: number;
333
+ name: string;
334
+ store_id?: number;
335
+ active?: number;
336
+ featured?: number;
337
+ description?: string | null;
338
+ logo?: string | null;
339
+ created_at?: string;
340
+ updated_at?: string;
341
+ deleted_at?: string | null;
256
342
  }
257
343
  interface YampiOrderData {
258
344
  pageCategory?: string;
@@ -342,8 +428,9 @@ interface YampiCartModel {
342
428
  created_at: string;
343
429
  updated_at: string;
344
430
  deleted_at: string | null;
431
+ metadata?: unknown[];
345
432
  items?: YampiCartModelItem[];
346
- customer?: YampiCustomer;
433
+ customer?: YampiCustomer | null;
347
434
  payment?: unknown | null;
348
435
  kits?: unknown[];
349
436
  store?: YampiStore;
@@ -395,13 +482,14 @@ interface YampiCartModelItem {
395
482
  created_at: string;
396
483
  updated_at: string;
397
484
  freebie_id: number | null;
485
+ metadata?: unknown[];
398
486
  product_option?: {
399
487
  id: number;
400
488
  store_id: number;
401
489
  product_id: number;
402
490
  sku: string;
403
491
  token: string;
404
- barcode: string;
492
+ barcode: string | null;
405
493
  allow_sell_without_customization: number;
406
494
  price_sale: string;
407
495
  price_discount: string;
@@ -445,11 +533,18 @@ interface YampiStore {
445
533
  suspended_at: string | null;
446
534
  created_at: string;
447
535
  deleted_at: string | null;
536
+ use_open_code?: number | null;
537
+ open_code_theme?: unknown | null;
538
+ cashback_rule?: unknown | null;
539
+ flow_stage?: string | null;
540
+ flow_started_at?: string | null;
541
+ hubspot_id?: string | number | null;
448
542
  checkout_config?: {
449
543
  id: number;
450
544
  store_id: number;
451
545
  active: number;
452
546
  currency: string;
547
+ [setting: string]: unknown;
453
548
  };
454
549
  }
455
550
  declare global {