@rebuy/rebuy 3.43.1 → 3.44.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -324,7 +324,7 @@ export declare const preparePostPurchaseQuantityAdmissionView: (widgetId: number
324
324
  } | undefined;
325
325
  displayPrice?: {
326
326
  currencyCode: string;
327
- savingFormat: "amount" | "percent";
327
+ savingFormat: "amount" | "percent" | null;
328
328
  savingMinor: number;
329
329
  savingPercent: number;
330
330
  variantCompareAtPriceMinor: number | null;
@@ -418,7 +418,130 @@ export declare const preparePostPurchaseQuantityAdmissionView: (widgetId: number
418
418
  reason: string;
419
419
  status: "unsupported";
420
420
  };
421
- sections: null;
421
+ sections: {
422
+ alignment: {
423
+ horizontal: "start" | "center" | "end";
424
+ vertical: "top" | "middle" | "bottom";
425
+ };
426
+ border: {
427
+ radius: "small" | "none" | "base" | "large" | "fullyRounded";
428
+ style: "none" | "base" | "dotted" | "dashed";
429
+ width: "base" | "medium" | "thick";
430
+ };
431
+ direction: "columns" | "rows" | "grid";
432
+ padding: "none" | "base" | "extraTight" | "tight" | "loose" | "extraLoose";
433
+ sectionId: string;
434
+ sections: never[] | import("..").CABSection[];
435
+ sectionType: "layout";
436
+ spacing: "none" | "base" | "extraTight" | "tight" | "loose" | "extraLoose";
437
+ width: number;
438
+ editorMode: "checkoutExtension" | "postPurchaseOffer" | "thankYouPage" | "orderStatusPage" | "ordersIndexPage" | "customerProfilePage";
439
+ previewMode: boolean;
440
+ storeId: number | null;
441
+ targetArea: {
442
+ icon: string;
443
+ label: string;
444
+ width: string;
445
+ fill?: boolean | undefined;
446
+ flip?: "vertical" | "horizontal" | "both" | undefined;
447
+ } | null;
448
+ tracking: {
449
+ enableAttribution: boolean;
450
+ enableSource: boolean;
451
+ enableWidget: boolean;
452
+ };
453
+ type: "product" | "bundle_builder" | "cart" | "cart_subscription" | "dynamic_bundle" | "gift_with_purchase" | "placeholder" | "pre_purchase" | "product_addon" | "product_upsell" | "recharge_checkout" | "recharge_customer_portal" | "recharge_post_purchase" | "shopify_checkout" | "shopify_checkout_extension" | "shopify_post_purchase" | "shopify_post_purchase_extension" | "switch_to_subscription" | "ui_extension_ad" | "ui_extension_button" | "ui_extension_content_block" | "ui_extension_line_item_editor" | "ui_extension_progress_bar";
454
+ uiLabels: {
455
+ currentPage: Record<string, string>;
456
+ guest: Record<string, string>;
457
+ loadingOptions: Record<string, string>;
458
+ nextPage: Record<string, string>;
459
+ offerCarousel: Record<string, string>;
460
+ offerDialog: Record<string, string>;
461
+ page: Record<string, string>;
462
+ previousPage: Record<string, string>;
463
+ selected: Record<string, string>;
464
+ subscriptionOptions: Record<string, string>;
465
+ updating: Record<string, string>;
466
+ };
467
+ version: 2;
468
+ widgetId: number | null;
469
+ buttonField?: "declineAllOffers" | "declineOffer" | "removeFromOrder" | "undoAddToOrder" | "activePage" | "addedToCart" | "addingToCart" | "addToCart" | "buttonLabel" | "destinationUrl" | "inactivePage" | "overlayContent" | "payNow" | "progressReached" | "progressRemaining" | "redirectToCheckout" | "showVariant" | "showVariants" | "soldOut" | "subscriptionOption" | "switchToOneTimePurchase" | "switchToSubscriptionNoDiscount" | "switchToSubscriptionWithDiscount" | undefined;
470
+ frame?: "callout" | "offer-content" | undefined;
471
+ grid?: {
472
+ columns: (string | number)[];
473
+ rows: (string | number)[];
474
+ } | undefined;
475
+ name?: string | undefined;
476
+ viewUrl?: string | undefined;
477
+ wrapping?: {
478
+ breakAt: number;
479
+ maxPerLine: number;
480
+ } | undefined;
481
+ mutators?: {
482
+ effect: "set_false" | "set_true" | "toggle";
483
+ variable: string;
484
+ when: {
485
+ operator: "is_empty" | "is_not_empty";
486
+ type: "content";
487
+ } | {
488
+ operator: "equals" | "greater_than" | "less_than";
489
+ type: "result_count";
490
+ value: number;
491
+ } | {
492
+ operator: "contains" | "does_not_contain";
493
+ type: "result_tag";
494
+ value: string;
495
+ } | {
496
+ event: "item_added" | "quantity_changed" | "variant_selected";
497
+ type: "event";
498
+ };
499
+ }[] | undefined;
500
+ variables?: ({
501
+ defaultValue: string;
502
+ name: string;
503
+ type: "text";
504
+ seed?: undefined;
505
+ } | {
506
+ defaultValue: number;
507
+ name: string;
508
+ type: "number";
509
+ seed?: undefined;
510
+ } | {
511
+ defaultValue: boolean;
512
+ name: string;
513
+ type: "boolean";
514
+ seed?: {
515
+ dataSourceId: number | null;
516
+ ruleset: {
517
+ exitIfMatched: boolean;
518
+ logic: {
519
+ rules: {
520
+ operator: "equals" | "greater_than" | "less_than" | "contains" | "does_not_contain" | "after" | "anything" | "before" | "contains_any" | "does_not_contain_any" | "does_not_equal";
521
+ products: never[] | unknown[];
522
+ type: "product" | "date" | "cart" | "cart_count" | "cart_item_count" | "cart_line_count" | "cart_subtotal" | "collection" | "customer" | "customer_order_count" | "customer_tag" | "customer_total_spent" | "product_tag" | "product_title" | "product_type" | "product_vendor";
523
+ value: string;
524
+ }[];
525
+ }[];
526
+ output: {
527
+ key: string;
528
+ type: "data_json";
529
+ value: string;
530
+ }[];
531
+ }[];
532
+ } | undefined;
533
+ })[] | undefined;
534
+ visibility?: {
535
+ variable: string;
536
+ visibleWhen: boolean;
537
+ } | undefined;
538
+ experiment?: {
539
+ elementId: number;
540
+ experimentId: number;
541
+ experimentType: string;
542
+ selectedId: number;
543
+ } | undefined;
544
+ } | null;
422
545
  groupCatalog?: {
423
546
  memberProductId: number;
424
547
  options: {
@@ -312,7 +312,7 @@ export declare const preparePostPurchaseQuantityView: (widgetId: number, setting
312
312
  } | undefined;
313
313
  displayPrice?: {
314
314
  currencyCode: string;
315
- savingFormat: "amount" | "percent";
315
+ savingFormat: "amount" | "percent" | null;
316
316
  savingMinor: number;
317
317
  savingPercent: number;
318
318
  variantCompareAtPriceMinor: number | null;
@@ -406,7 +406,130 @@ export declare const preparePostPurchaseQuantityView: (widgetId: number, setting
406
406
  reason: string;
407
407
  status: "unsupported";
408
408
  };
409
- sections: null;
409
+ sections: {
410
+ alignment: {
411
+ horizontal: "start" | "center" | "end";
412
+ vertical: "top" | "middle" | "bottom";
413
+ };
414
+ border: {
415
+ radius: "small" | "none" | "base" | "large" | "fullyRounded";
416
+ style: "none" | "base" | "dotted" | "dashed";
417
+ width: "base" | "medium" | "thick";
418
+ };
419
+ direction: "columns" | "rows" | "grid";
420
+ padding: "none" | "base" | "extraTight" | "tight" | "loose" | "extraLoose";
421
+ sectionId: string;
422
+ sections: never[] | import("..").CABSection[];
423
+ sectionType: "layout";
424
+ spacing: "none" | "base" | "extraTight" | "tight" | "loose" | "extraLoose";
425
+ width: number;
426
+ editorMode: "checkoutExtension" | "postPurchaseOffer" | "thankYouPage" | "orderStatusPage" | "ordersIndexPage" | "customerProfilePage";
427
+ previewMode: boolean;
428
+ storeId: number | null;
429
+ targetArea: {
430
+ icon: string;
431
+ label: string;
432
+ width: string;
433
+ fill?: boolean | undefined;
434
+ flip?: "vertical" | "horizontal" | "both" | undefined;
435
+ } | null;
436
+ tracking: {
437
+ enableAttribution: boolean;
438
+ enableSource: boolean;
439
+ enableWidget: boolean;
440
+ };
441
+ type: "product" | "bundle_builder" | "cart" | "cart_subscription" | "dynamic_bundle" | "gift_with_purchase" | "placeholder" | "pre_purchase" | "product_addon" | "product_upsell" | "recharge_checkout" | "recharge_customer_portal" | "recharge_post_purchase" | "shopify_checkout" | "shopify_checkout_extension" | "shopify_post_purchase" | "shopify_post_purchase_extension" | "switch_to_subscription" | "ui_extension_ad" | "ui_extension_button" | "ui_extension_content_block" | "ui_extension_line_item_editor" | "ui_extension_progress_bar";
442
+ uiLabels: {
443
+ currentPage: Record<string, string>;
444
+ guest: Record<string, string>;
445
+ loadingOptions: Record<string, string>;
446
+ nextPage: Record<string, string>;
447
+ offerCarousel: Record<string, string>;
448
+ offerDialog: Record<string, string>;
449
+ page: Record<string, string>;
450
+ previousPage: Record<string, string>;
451
+ selected: Record<string, string>;
452
+ subscriptionOptions: Record<string, string>;
453
+ updating: Record<string, string>;
454
+ };
455
+ version: 2;
456
+ widgetId: number | null;
457
+ buttonField?: "declineAllOffers" | "declineOffer" | "removeFromOrder" | "undoAddToOrder" | "activePage" | "addedToCart" | "addingToCart" | "addToCart" | "buttonLabel" | "destinationUrl" | "inactivePage" | "overlayContent" | "payNow" | "progressReached" | "progressRemaining" | "redirectToCheckout" | "showVariant" | "showVariants" | "soldOut" | "subscriptionOption" | "switchToOneTimePurchase" | "switchToSubscriptionNoDiscount" | "switchToSubscriptionWithDiscount" | undefined;
458
+ frame?: "callout" | "offer-content" | undefined;
459
+ grid?: {
460
+ columns: (string | number)[];
461
+ rows: (string | number)[];
462
+ } | undefined;
463
+ name?: string | undefined;
464
+ viewUrl?: string | undefined;
465
+ wrapping?: {
466
+ breakAt: number;
467
+ maxPerLine: number;
468
+ } | undefined;
469
+ mutators?: {
470
+ effect: "set_false" | "set_true" | "toggle";
471
+ variable: string;
472
+ when: {
473
+ operator: "is_empty" | "is_not_empty";
474
+ type: "content";
475
+ } | {
476
+ operator: "equals" | "greater_than" | "less_than";
477
+ type: "result_count";
478
+ value: number;
479
+ } | {
480
+ operator: "contains" | "does_not_contain";
481
+ type: "result_tag";
482
+ value: string;
483
+ } | {
484
+ event: "item_added" | "quantity_changed" | "variant_selected";
485
+ type: "event";
486
+ };
487
+ }[] | undefined;
488
+ variables?: ({
489
+ defaultValue: string;
490
+ name: string;
491
+ type: "text";
492
+ seed?: undefined;
493
+ } | {
494
+ defaultValue: number;
495
+ name: string;
496
+ type: "number";
497
+ seed?: undefined;
498
+ } | {
499
+ defaultValue: boolean;
500
+ name: string;
501
+ type: "boolean";
502
+ seed?: {
503
+ dataSourceId: number | null;
504
+ ruleset: {
505
+ exitIfMatched: boolean;
506
+ logic: {
507
+ rules: {
508
+ operator: "equals" | "greater_than" | "less_than" | "contains" | "does_not_contain" | "after" | "anything" | "before" | "contains_any" | "does_not_contain_any" | "does_not_equal";
509
+ products: never[] | unknown[];
510
+ type: "product" | "date" | "cart" | "cart_count" | "cart_item_count" | "cart_line_count" | "cart_subtotal" | "collection" | "customer" | "customer_order_count" | "customer_tag" | "customer_total_spent" | "product_tag" | "product_title" | "product_type" | "product_vendor";
511
+ value: string;
512
+ }[];
513
+ }[];
514
+ output: {
515
+ key: string;
516
+ type: "data_json";
517
+ value: string;
518
+ }[];
519
+ }[];
520
+ } | undefined;
521
+ })[] | undefined;
522
+ visibility?: {
523
+ variable: string;
524
+ visibleWhen: boolean;
525
+ } | undefined;
526
+ experiment?: {
527
+ elementId: number;
528
+ experimentId: number;
529
+ experimentType: string;
530
+ selectedId: number;
531
+ } | undefined;
532
+ } | null;
410
533
  groupCatalog?: {
411
534
  memberProductId: number;
412
535
  options: {
@@ -3,6 +3,9 @@ import { PostPurchaseProductView } from '../schema/postPurchaseProductView';
3
3
  import { normalizePostPurchaseProduct } from '../server/normalizePostPurchaseProduct';
4
4
  import type { PostPurchaseQuantity } from '../server/readPostPurchaseQuantity';
5
5
  import type { Reporter } from '../server/shared';
6
- /** Convert from the same effective settings snapshot; no product values enter the section tree. */
6
+ /**
7
+ * Convert from the same effective settings snapshot; no product values enter the section tree. A choice-level
8
+ * unavailable product keeps its tree (`isChoiceUnavailable`); a configuration-level one answers `sections: null`.
9
+ */
7
10
  export declare const prepareNormalizedPostPurchaseView: (widgetId: number, normalized: ReturnType<typeof normalizePostPurchaseProduct>, report?: Reporter, choice?: PostPurchaseChoice, quantity?: PostPurchaseQuantity, allowCollection?: boolean) => PostPurchaseProductView;
8
11
  export declare const preparePostPurchaseView: (widgetId: number, settings: unknown, response: unknown, report?: Reporter, choice?: PostPurchaseChoice) => PostPurchaseProductView;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rebuy/rebuy",
3
- "version": "3.43.1",
3
+ "version": "3.44.0",
4
4
  "description": "Shared zod schemas, legacy-to-CAB widget transforms, and server orchestrators for Rebuy's Shopify consumers (rebuy-api, admin-nextjs, rebuy-shopify-extensions)",
5
5
  "license": "MIT",
6
6
  "author": "Rebuy, Inc.",