@shoppexio/storefront 1.0.107 → 1.0.108

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/dist/index.d.cts CHANGED
@@ -3,6 +3,7 @@ import { NavigationMenuSlot } from '@shoppex/contracts/navigation';
3
3
  export { NavigationMenuSlot } from '@shoppex/contracts/navigation';
4
4
  import { StorefrontDeliveryType } from '@shoppex/contracts/storefront-delivery-type';
5
5
  import { createApiClient } from '@shoppex/contracts/api-client';
6
+ import { BuyerStatusFilter } from '@shoppex/contracts/buyer-invoice-status';
6
7
  import { CustomerWarrantyClaimWire, CustomerPortalAffiliateCreateLinkWire, CustomerPortalDashboardWire, CustomerPortalPaginatedInvoicesWire, CustomerPortalInvoiceDetailWire, CustomerLoyaltyWire, CustomerLoyaltyRedeemWire, CustomerWarrantyListWire, CustomerPortalOrderReviewWire, CustomerPortalNotificationPreferencesWire } from '@shoppex/contracts/customer-account-wire';
7
8
  export { CATALOG_UNIT_PRICE_DECIMAL_PLACES, CATALOG_UNIT_PRICE_FORMAT_OPTIONS, PAYABLE_AMOUNT_DECIMAL_PLACES, roundPayableAmount } from '@shoppex/contracts/catalog-unit-price';
8
9
 
@@ -541,21 +542,30 @@ interface Subscription {
541
542
  interval?: SubscriptionInterval;
542
543
  flags?: SubscriptionFlags;
543
544
  }
545
+ /**
546
+ * The public invoice read (`GET /v1/invoices/unique/:id`, InvoiceEnricher).
547
+ * Its lines arrive as `product`; it carries no `products` or `created_at`.
548
+ */
544
549
  interface Invoice {
545
550
  uniqid: string;
546
- status: string;
547
- total: number;
548
- currency: string;
549
- gateway?: string;
550
- products: InvoiceProduct[];
551
- created_at: string;
551
+ status: string | null;
552
+ /**
553
+ * The invoice total in USD (InvoiceEnricher maps `totalUsd` here), a decimal
554
+ * string such as "15.38". It is not in `currency`.
555
+ */
556
+ total: string | number;
557
+ currency: string | null;
558
+ gateway: string | null;
559
+ product: InvoiceProduct[];
552
560
  rewards?: BuyerRewards | null;
553
561
  }
554
562
  interface InvoiceProduct {
555
- product_id: string;
563
+ /** The product's id; null on a line that has no catalog product. */
564
+ uniqid: string | null;
556
565
  title: string;
557
566
  quantity: number;
558
- price: number;
567
+ /** The line total in the invoice currency. */
568
+ total: number;
559
569
  }
560
570
  type RewardActionType = 'WALLET_CREDIT' | 'COUPON';
561
571
  type RewardGrantStatus = 'PENDING' | 'FULFILLED' | 'FAILED' | 'REVOKED';
@@ -594,9 +604,17 @@ interface CouponValidation {
594
604
  source?: 'COUPON' | 'AFFILIATE';
595
605
  product_restricted?: boolean;
596
606
  variant_restricted?: boolean;
597
- restriction_scope?: 'all' | 'products' | 'variants' | 'products_and_variants';
607
+ restriction_scope?: 'all' | 'all_except' | 'products' | 'variants' | 'products_and_variants';
598
608
  allowed_product_ids?: string[];
599
609
  allowed_variant_ids?: string[];
610
+ /** 'all_except': every product but these. */
611
+ excluded_product_ids?: string[];
612
+ /** Products with a discount of their own on this coupon; a fixed amount is in the shop currency. */
613
+ product_discounts?: Array<{
614
+ product_id: string;
615
+ discount_type: 'percentage' | 'fixed';
616
+ discount: number;
617
+ }>;
600
618
  message?: string;
601
619
  }
602
620
  interface CouponValidationOptions {
@@ -1832,6 +1850,11 @@ interface CustomerOrdersQuery {
1832
1850
  * actually chose.
1833
1851
  */
1834
1852
  status?: string;
1853
+ /**
1854
+ * One order-list group of the buyer status table (`@shoppex/contracts/buyer-invoice-status`):
1855
+ * "paid" holds COMPLETED and AWAITING_STOCK, which a single `status` cannot.
1856
+ */
1857
+ statusGroup?: BuyerStatusFilter;
1835
1858
  /** Partial invoice-id search. The producer trims it to 64 characters. */
1836
1859
  search?: string;
1837
1860
  }
package/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@ import { NavigationMenuSlot } from '@shoppex/contracts/navigation';
3
3
  export { NavigationMenuSlot } from '@shoppex/contracts/navigation';
4
4
  import { StorefrontDeliveryType } from '@shoppex/contracts/storefront-delivery-type';
5
5
  import { createApiClient } from '@shoppex/contracts/api-client';
6
+ import { BuyerStatusFilter } from '@shoppex/contracts/buyer-invoice-status';
6
7
  import { CustomerWarrantyClaimWire, CustomerPortalAffiliateCreateLinkWire, CustomerPortalDashboardWire, CustomerPortalPaginatedInvoicesWire, CustomerPortalInvoiceDetailWire, CustomerLoyaltyWire, CustomerLoyaltyRedeemWire, CustomerWarrantyListWire, CustomerPortalOrderReviewWire, CustomerPortalNotificationPreferencesWire } from '@shoppex/contracts/customer-account-wire';
7
8
  export { CATALOG_UNIT_PRICE_DECIMAL_PLACES, CATALOG_UNIT_PRICE_FORMAT_OPTIONS, PAYABLE_AMOUNT_DECIMAL_PLACES, roundPayableAmount } from '@shoppex/contracts/catalog-unit-price';
8
9
 
@@ -541,21 +542,30 @@ interface Subscription {
541
542
  interval?: SubscriptionInterval;
542
543
  flags?: SubscriptionFlags;
543
544
  }
545
+ /**
546
+ * The public invoice read (`GET /v1/invoices/unique/:id`, InvoiceEnricher).
547
+ * Its lines arrive as `product`; it carries no `products` or `created_at`.
548
+ */
544
549
  interface Invoice {
545
550
  uniqid: string;
546
- status: string;
547
- total: number;
548
- currency: string;
549
- gateway?: string;
550
- products: InvoiceProduct[];
551
- created_at: string;
551
+ status: string | null;
552
+ /**
553
+ * The invoice total in USD (InvoiceEnricher maps `totalUsd` here), a decimal
554
+ * string such as "15.38". It is not in `currency`.
555
+ */
556
+ total: string | number;
557
+ currency: string | null;
558
+ gateway: string | null;
559
+ product: InvoiceProduct[];
552
560
  rewards?: BuyerRewards | null;
553
561
  }
554
562
  interface InvoiceProduct {
555
- product_id: string;
563
+ /** The product's id; null on a line that has no catalog product. */
564
+ uniqid: string | null;
556
565
  title: string;
557
566
  quantity: number;
558
- price: number;
567
+ /** The line total in the invoice currency. */
568
+ total: number;
559
569
  }
560
570
  type RewardActionType = 'WALLET_CREDIT' | 'COUPON';
561
571
  type RewardGrantStatus = 'PENDING' | 'FULFILLED' | 'FAILED' | 'REVOKED';
@@ -594,9 +604,17 @@ interface CouponValidation {
594
604
  source?: 'COUPON' | 'AFFILIATE';
595
605
  product_restricted?: boolean;
596
606
  variant_restricted?: boolean;
597
- restriction_scope?: 'all' | 'products' | 'variants' | 'products_and_variants';
607
+ restriction_scope?: 'all' | 'all_except' | 'products' | 'variants' | 'products_and_variants';
598
608
  allowed_product_ids?: string[];
599
609
  allowed_variant_ids?: string[];
610
+ /** 'all_except': every product but these. */
611
+ excluded_product_ids?: string[];
612
+ /** Products with a discount of their own on this coupon; a fixed amount is in the shop currency. */
613
+ product_discounts?: Array<{
614
+ product_id: string;
615
+ discount_type: 'percentage' | 'fixed';
616
+ discount: number;
617
+ }>;
600
618
  message?: string;
601
619
  }
602
620
  interface CouponValidationOptions {
@@ -1832,6 +1850,11 @@ interface CustomerOrdersQuery {
1832
1850
  * actually chose.
1833
1851
  */
1834
1852
  status?: string;
1853
+ /**
1854
+ * One order-list group of the buyer status table (`@shoppex/contracts/buyer-invoice-status`):
1855
+ * "paid" holds COMPLETED and AWAITING_STOCK, which a single `status` cannot.
1856
+ */
1857
+ statusGroup?: BuyerStatusFilter;
1835
1858
  /** Partial invoice-id search. The producer trims it to 64 characters. */
1836
1859
  search?: string;
1837
1860
  }
package/dist/index.js CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  customerWarrantyClaimSchema,
11
11
  customerWarrantyListSchema,
12
12
  storefrontStorageKey
13
- } from "./chunk-P7MN6RXP.js";
13
+ } from "./chunk-HMEEWD3P.js";
14
14
 
15
15
  // ../sdk/src/core/errors.ts
16
16
  var CURRENCY_UNAVAILABLE_ERROR_CODE = "errors.storefront.currency_unavailable";
@@ -2686,8 +2686,10 @@ function priceVariantToProductVariant(variant) {
2686
2686
  cloudflareImageId: variant.cloudflareImageId,
2687
2687
  image_url: variant.image_url,
2688
2688
  imageUrl: variant.imageUrl,
2689
+ is_featured: variant.is_featured,
2689
2690
  visibility: variant.visibility,
2690
- is_private: variant.is_private
2691
+ is_private: variant.is_private,
2692
+ license_period: variant.license_period
2691
2693
  };
2692
2694
  }
2693
2695
  function normalizeProduct(product) {
@@ -4479,6 +4481,7 @@ function orders(options = {}) {
4479
4481
  if (options.page !== void 0) query.set("page", String(options.page));
4480
4482
  if (options.limit !== void 0) query.set("limit", String(options.limit));
4481
4483
  if (options.status) query.set("status", options.status);
4484
+ if (options.statusGroup) query.set("status_group", options.statusGroup);
4482
4485
  if (options.search) query.set("q", options.search);
4483
4486
  const suffix = query.size > 0 ? `?${query.toString()}` : "";
4484
4487
  return requestCustomer(`/invoices${suffix}`, { schema: customerPortalPaginatedInvoicesSchema });