@putiikkipalvelu/storefront-sdk 0.2.1 → 0.2.3

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
@@ -184,8 +184,10 @@ interface ShipitShippingMethod {
184
184
  length: number;
185
185
  /** Package width in cm */
186
186
  width: number;
187
- /** Package weight in kg */
187
+ /** Package weight in kg @deprecated Use maxWeight instead */
188
188
  weight: number;
189
+ /** Maximum package weight in kg for this shipping tier */
190
+ maxWeight: number;
189
191
  /** Service type */
190
192
  type: string;
191
193
  /** Shipit price in cents */
@@ -275,6 +277,8 @@ interface ProductVariationListing {
275
277
  * Full product variation (for product detail page)
276
278
  */
277
279
  interface ProductVariation extends ProductVariationListing {
280
+ /** Variation weight in kg (null = use product weight) */
281
+ weight: number | null;
278
282
  /** Available quantity (null = unlimited) */
279
283
  quantity: number | null;
280
284
  /** Stock keeping unit */
@@ -323,6 +327,8 @@ interface Product {
323
327
  * Used by: /product/{slug}
324
328
  */
325
329
  interface ProductDetail extends Omit<Product, "variations"> {
330
+ /** Product weight in kg (for shipping calculations) */
331
+ weight: number;
326
332
  /** Stock keeping unit */
327
333
  sku: string | null;
328
334
  /** SEO meta title */
@@ -573,42 +579,42 @@ interface PickupLocationOpeningHours {
573
579
  * Returned from Shipit API with merchant pricing added
574
580
  */
575
581
  interface PickupLocation {
576
- /** Unique location ID */
582
+ /** Unique location ID from Shipit */
577
583
  id: string;
584
+ /** Shipit service ID */
585
+ serviceId: string;
578
586
  /** Location name */
579
587
  name: string;
580
588
  /** Street address */
581
589
  address1: string;
582
- /** Postal code */
583
- zipcode: string;
584
590
  /** City */
585
591
  city: string;
592
+ /** Postal code */
593
+ zipcode: string;
586
594
  /** Country code (e.g., "FI") */
587
595
  countryCode: string;
588
- /** Shipit service ID */
589
- serviceId: string;
590
- /** Carrier name */
596
+ /** Carrier name (e.g., "Posti", "Matkahuolto") */
591
597
  carrier: string;
592
- /** Shipit price in cents (may be null) */
593
- price: number | null;
594
- /** Merchant's price in cents (from store settings) */
595
- merchantPrice: number | null;
596
598
  /** Carrier logo URL */
597
599
  carrierLogo: string;
598
- /** Structured opening hours */
599
- openingHours: PickupLocationOpeningHours | null;
600
- /** Raw opening hours string */
601
- openingHoursRaw: string | null;
602
600
  /** GPS latitude */
603
- latitude: number;
601
+ latitude?: number;
604
602
  /** GPS longitude */
605
- longitude: number;
603
+ longitude?: number;
606
604
  /** Distance from postal code in meters */
607
605
  distanceInMeters: number;
608
606
  /** Distance from postal code in kilometers */
609
607
  distanceInKilometers: number;
608
+ /** Location type */
609
+ type?: string;
610
+ /** Structured opening hours */
611
+ openingHours?: PickupLocationOpeningHours | null;
612
+ /** Raw opening hours string from Shipit */
613
+ openingHoursRaw?: string | null;
610
614
  /** Additional metadata */
611
- metadata: unknown | null;
615
+ metadata?: unknown | null;
616
+ /** Merchant's price in cents (from store settings) */
617
+ merchantPrice: number | null;
612
618
  }
613
619
  /**
614
620
  * Response from GET /shipment-methods
@@ -629,15 +635,49 @@ interface ShipmentMethodsWithLocationsResponse {
629
635
  }
630
636
 
631
637
  /**
632
- * Customer Types
638
+ * Order Types
633
639
  *
634
- * Types for customer authentication and account management API endpoints.
640
+ * Types for fetching order details from the Storefront API.
641
+ * These types represent the raw order data returned by GET /order/{id}.
642
+ *
643
+ * Note: These differ from CustomerOrder types in customer.ts which are
644
+ * transformed for customer order history display.
635
645
  */
636
646
  /**
637
- * Basic customer information returned from most customer endpoints
647
+ * Item type for order line items
638
648
  */
639
- interface Customer {
640
- /** Unique customer ID */
649
+ type ConfirmationItemType = "PRODUCT" | "VARIATION" | "SHIPPING";
650
+ /**
651
+ * A single line item in an order confirmation
652
+ * Represents raw data as stored in the database
653
+ */
654
+ interface ConfirmationOrderLineItem {
655
+ /** Unique line item ID */
656
+ id: string;
657
+ /** Parent order ID */
658
+ orderId: string;
659
+ /** Type of item: PRODUCT, VARIATION, or SHIPPING */
660
+ itemType: ConfirmationItemType;
661
+ /** Quantity ordered */
662
+ quantity: number;
663
+ /** Price per unit in cents */
664
+ price: number;
665
+ /** Total amount in cents (price * quantity) */
666
+ totalAmount: number;
667
+ /** Product or variation code (ID reference) */
668
+ productCode: string;
669
+ /** Display name of the item */
670
+ name: string;
671
+ /** VAT rate percentage */
672
+ vatRate: number;
673
+ /** Product images array */
674
+ images: string[];
675
+ }
676
+ /**
677
+ * Customer delivery information attached to an order
678
+ */
679
+ interface ConfirmationOrderCustomerData {
680
+ /** Customer data record ID */
641
681
  id: string;
642
682
  /** Customer's first name */
643
683
  firstName: string;
@@ -645,26 +685,97 @@ interface Customer {
645
685
  lastName: string;
646
686
  /** Customer's email address */
647
687
  email: string;
688
+ /** Customer's phone number */
689
+ phone: string | null;
690
+ /** Delivery street address */
691
+ address: string;
692
+ /** Delivery city */
693
+ city: string;
694
+ /** Delivery postal code */
695
+ postalCode: string;
648
696
  }
649
697
  /**
650
- * Extended customer information returned after registration
698
+ * Shipment method information attached to an order
699
+ * Includes tracking information when available
651
700
  */
652
- interface CustomerWithVerification extends Customer {
653
- /** Account creation timestamp */
654
- createdAt: string;
655
- /** Email verification token (for sending verification emails) */
656
- emailVerificationToken: string;
657
- /** Token expiration timestamp */
658
- emailVerificationExpiresAt: string;
701
+ interface ConfirmationOrderShipmentMethod {
702
+ /** Shipment method record ID */
703
+ id: string;
704
+ /** Carrier service ID (for Shipit integration) */
705
+ serviceId: string | null;
706
+ /** Shipment method display name */
707
+ name: string;
708
+ /** Description of the shipment method */
709
+ description: string | null;
710
+ /** Carrier logo URL */
711
+ logo: string | null;
712
+ /** Shipping price in cents */
713
+ price: number;
714
+ /** Parent order ID */
715
+ orderId: string;
716
+ /** VAT rate percentage */
717
+ vatRate: number | null;
718
+ /** Tracking number (when shipped) */
719
+ trackingNumber: string | null;
720
+ /** Array of tracking URLs */
721
+ trackingUrls: string[];
722
+ /** Shipit shipment number */
723
+ shipmentNumber: string | null;
724
+ /** Freight document URLs */
725
+ freightDoc: string[];
659
726
  }
660
727
  /**
661
- * Customer information returned after login
728
+ * Order status values (matches Prisma OrderStatus enum)
662
729
  */
663
- interface CustomerWithEmailStatus extends Customer {
664
- /** Email verification timestamp (null if not verified) */
665
- emailVerified: string | null;
666
- /** Account creation timestamp */
730
+ type OrderStatus = "PENDING" | "COMPLETED" | "CANCELLED" | "FAILED" | "PAID" | "SHIPPED" | "PARTIALLY_REFUNDED" | "REFUNDED";
731
+ /**
732
+ * Complete order information returned by GET /order/{id}
733
+ * Used for order confirmation pages and order detail views
734
+ */
735
+ interface Order {
736
+ /** Unique order ID */
737
+ id: string;
738
+ /** Store ID this order belongs to */
739
+ storeId: string;
740
+ /** Order creation timestamp */
667
741
  createdAt: string;
742
+ /** Total order amount in cents */
743
+ totalAmount: number;
744
+ /** Current order status */
745
+ status: OrderStatus;
746
+ /** Human-readable order number */
747
+ orderNumber: number;
748
+ /** Order line items (products, variations, shipping) */
749
+ OrderLineItems: ConfirmationOrderLineItem[];
750
+ /** Customer delivery information */
751
+ orderCustomerData: ConfirmationOrderCustomerData | null;
752
+ /** Shipment method with tracking info */
753
+ orderShipmentMethod: ConfirmationOrderShipmentMethod | null;
754
+ }
755
+
756
+ /**
757
+ * Customer Types
758
+ *
759
+ * Types for customer authentication and account management API endpoints.
760
+ */
761
+
762
+ /**
763
+ * Customer information returned from API endpoints.
764
+ * Some fields are optional depending on which endpoint is called.
765
+ */
766
+ interface Customer {
767
+ /** Unique customer ID */
768
+ id: string;
769
+ /** Customer's first name */
770
+ firstName: string;
771
+ /** Customer's last name */
772
+ lastName: string;
773
+ /** Customer's email address */
774
+ email: string;
775
+ /** Account creation timestamp (included in register, login, edit responses) */
776
+ createdAt?: string;
777
+ /** Email verification timestamp - null if not verified (only in login response) */
778
+ emailVerified?: string | null;
668
779
  }
669
780
  /**
670
781
  * Data required to register a new customer account
@@ -687,13 +798,14 @@ interface LoginOptions {
687
798
  cartId?: string;
688
799
  }
689
800
  /**
690
- * Response from successful registration
801
+ * Response from successful registration.
802
+ * Note: Verification email is sent server-side automatically.
691
803
  */
692
804
  interface RegisterResponse {
693
805
  /** Whether the operation was successful */
694
806
  success: true;
695
- /** Created customer with verification token */
696
- customer: CustomerWithVerification;
807
+ /** Created customer (verification email sent automatically) */
808
+ customer: Customer;
697
809
  /** Success message */
698
810
  message: string;
699
811
  }
@@ -703,8 +815,8 @@ interface RegisterResponse {
703
815
  interface LoginResponse {
704
816
  /** Whether the operation was successful */
705
817
  success: true;
706
- /** Authenticated customer data */
707
- customer: CustomerWithEmailStatus;
818
+ /** Authenticated customer data (includes emailVerified and createdAt) */
819
+ customer: Customer;
708
820
  /** Success message */
709
821
  message: string;
710
822
  /** Session token for authenticated requests */
@@ -753,13 +865,12 @@ interface VerifyEmailResponse {
753
865
  message: string;
754
866
  }
755
867
  /**
756
- * Response from resend verification email
868
+ * Response from resend verification email.
869
+ * Note: Verification email is sent server-side automatically.
757
870
  */
758
871
  interface ResendVerificationResponse {
759
872
  /** Whether the operation was successful */
760
873
  success: true;
761
- /** Updated customer with new verification token */
762
- customer: CustomerWithVerification;
763
874
  /** Success message */
764
875
  message: string;
765
876
  }
@@ -774,13 +885,6 @@ interface UpdateProfileData {
774
885
  /** Updated email address */
775
886
  email?: string;
776
887
  }
777
- /**
778
- * Extended customer info returned after profile update
779
- */
780
- interface CustomerWithCreatedAt extends Customer {
781
- /** Account creation timestamp */
782
- createdAt: string;
783
- }
784
888
  /**
785
889
  * Response from updating profile
786
890
  */
@@ -788,7 +892,7 @@ interface UpdateProfileResponse {
788
892
  /** Success message */
789
893
  message: string;
790
894
  /** Updated customer data */
791
- customer: CustomerWithCreatedAt;
895
+ customer: Customer;
792
896
  }
793
897
  /**
794
898
  * Response from deleting account
@@ -856,10 +960,7 @@ interface OrderShipmentMethod {
856
960
  /** Carrier logo URL */
857
961
  logo: string | null;
858
962
  }
859
- /**
860
- * Order status values
861
- */
862
- type OrderStatus = "PENDING" | "PROCESSING" | "SHIPPED" | "DELIVERED" | "CANCELLED" | "REFUNDED";
963
+
863
964
  /**
864
965
  * A customer order
865
966
  */
@@ -994,124 +1095,25 @@ interface RemoveFromWishlistResponse {
994
1095
  /** Success message */
995
1096
  message: string;
996
1097
  }
997
-
998
1098
  /**
999
- * Order Types
1000
- *
1001
- * Types for fetching order details from the Storefront API.
1002
- * These types represent the raw order data returned by GET /order/{id}.
1003
- *
1004
- * Note: These differ from CustomerOrder types in customer.ts which are
1005
- * transformed for customer order history display.
1006
- */
1007
- /**
1008
- * Item type for order line items
1009
- */
1010
- type ConfirmationItemType = "PRODUCT" | "VARIATION" | "SHIPPING";
1011
- /**
1012
- * A single line item in an order confirmation
1013
- * Represents raw data as stored in the database
1014
- */
1015
- interface ConfirmationOrderLineItem {
1016
- /** Unique line item ID */
1017
- id: string;
1018
- /** Parent order ID */
1019
- orderId: string;
1020
- /** Type of item: PRODUCT, VARIATION, or SHIPPING */
1021
- itemType: ConfirmationItemType;
1022
- /** Quantity ordered */
1023
- quantity: number;
1024
- /** Price per unit in cents */
1025
- price: number;
1026
- /** Total amount in cents (price * quantity) */
1027
- totalAmount: number;
1028
- /** Product or variation code (ID reference) */
1029
- productCode: string;
1030
- /** Display name of the item */
1031
- name: string;
1032
- /** VAT rate percentage */
1033
- vatRate: number;
1034
- /** Product images array */
1035
- images: string[];
1036
- }
1037
- /**
1038
- * Customer delivery information attached to an order
1099
+ * Response from forgot password request.
1100
+ * Always returns same response to prevent email enumeration.
1101
+ * Email with reset link is sent server-side (token never exposed to client).
1039
1102
  */
1040
- interface ConfirmationOrderCustomerData {
1041
- /** Customer data record ID */
1042
- id: string;
1043
- /** Customer's first name */
1044
- firstName: string;
1045
- /** Customer's last name */
1046
- lastName: string;
1047
- /** Customer's email address */
1048
- email: string;
1049
- /** Customer's phone number */
1050
- phone: string | null;
1051
- /** Delivery street address */
1052
- address: string;
1053
- /** Delivery city */
1054
- city: string;
1055
- /** Delivery postal code */
1056
- postalCode: string;
1057
- }
1058
- /**
1059
- * Shipment method information attached to an order
1060
- * Includes tracking information when available
1061
- */
1062
- interface ConfirmationOrderShipmentMethod {
1063
- /** Shipment method record ID */
1064
- id: string;
1065
- /** Carrier service ID (for Shipit integration) */
1066
- serviceId: string | null;
1067
- /** Shipment method display name */
1068
- name: string;
1069
- /** Description of the shipment method */
1070
- description: string | null;
1071
- /** Carrier logo URL */
1072
- logo: string | null;
1073
- /** Shipping price in cents */
1074
- price: number;
1075
- /** Parent order ID */
1076
- orderId: string;
1077
- /** VAT rate percentage */
1078
- vatRate: number | null;
1079
- /** Tracking number (when shipped) */
1080
- trackingNumber: string | null;
1081
- /** Array of tracking URLs */
1082
- trackingUrls: string[];
1083
- /** Shipit shipment number */
1084
- shipmentNumber: string | null;
1085
- /** Freight document URLs */
1086
- freightDoc: string[];
1103
+ interface ForgotPasswordResponse {
1104
+ /** Whether the operation was successful */
1105
+ success: true;
1106
+ /** Success message (same regardless of whether email exists) */
1107
+ message: string;
1087
1108
  }
1088
1109
  /**
1089
- * Order status values
1090
- */
1091
- type ConfirmationOrderStatus = "PENDING" | "PAID" | "SHIPPED" | "DELIVERED" | "CANCELLED" | "REFUNDED";
1092
- /**
1093
- * Complete order information returned by GET /order/{id}
1094
- * Used for order confirmation pages and order detail views
1110
+ * Response from successful password reset
1095
1111
  */
1096
- interface Order {
1097
- /** Unique order ID */
1098
- id: string;
1099
- /** Store ID this order belongs to */
1100
- storeId: string;
1101
- /** Order creation timestamp */
1102
- createdAt: string;
1103
- /** Total order amount in cents */
1104
- totalAmount: number;
1105
- /** Current order status */
1106
- status: ConfirmationOrderStatus;
1107
- /** Human-readable order number */
1108
- orderNumber: number;
1109
- /** Order line items (products, variations, shipping) */
1110
- OrderLineItems: ConfirmationOrderLineItem[];
1111
- /** Customer delivery information */
1112
- orderCustomerData: ConfirmationOrderCustomerData | null;
1113
- /** Shipment method with tracking info */
1114
- orderShipmentMethod: ConfirmationOrderShipmentMethod | null;
1112
+ interface ResetPasswordResponse {
1113
+ /** Whether the operation was successful */
1114
+ success: true;
1115
+ /** Success message */
1116
+ message: string;
1115
1117
  }
1116
1118
 
1117
1119
  /**
@@ -1703,6 +1705,13 @@ type CartResource = ReturnType<typeof createCartResource>;
1703
1705
  * Methods for fetching shipment methods and pickup locations.
1704
1706
  */
1705
1707
 
1708
+ /**
1709
+ * Options for fetching shipment methods with weight-based filtering
1710
+ */
1711
+ interface GetMethodsOptions extends FetchOptions {
1712
+ /** Cart items - weight will be calculated automatically */
1713
+ cartItems?: CartItem[];
1714
+ }
1706
1715
  /**
1707
1716
  * Shipping resource for fetching shipment methods and pickup locations
1708
1717
  */
@@ -1711,7 +1720,7 @@ declare function createShippingResource(fetcher: Fetcher): {
1711
1720
  * Get all available shipment methods for the store.
1712
1721
  * Returns methods without pickup locations - use `getWithLocations` for postal code specific data.
1713
1722
  *
1714
- * @param options - Fetch options (caching, headers, etc.)
1723
+ * @param options - Fetch options including optional cartItems for weight-based filtering
1715
1724
  * @returns Available shipment methods
1716
1725
  *
1717
1726
  * @example
@@ -1722,14 +1731,22 @@ declare function createShippingResource(fetcher: Fetcher): {
1722
1731
  * console.log(`${method.name}: ${method.price / 100}€`);
1723
1732
  * });
1724
1733
  * ```
1734
+ *
1735
+ * @example Weight-based filtering
1736
+ * ```typescript
1737
+ * // Pass cart items - SDK calculates weight automatically
1738
+ * const { shipmentMethods } = await client.shipping.getMethods({
1739
+ * cartItems: cartItems
1740
+ * });
1741
+ * ```
1725
1742
  */
1726
- getMethods(options?: FetchOptions): Promise<ShipmentMethodsResponse>;
1743
+ getMethods(options?: GetMethodsOptions): Promise<ShipmentMethodsResponse>;
1727
1744
  /**
1728
1745
  * Get shipment methods with pickup locations for a specific postal code.
1729
1746
  * Calls the Shipit API to fetch nearby pickup points (parcel lockers, etc.)
1730
1747
  *
1731
1748
  * @param postalCode - Customer's postal code (e.g., "00100")
1732
- * @param options - Fetch options (caching, headers, etc.)
1749
+ * @param options - Fetch options including optional cartItems for weight-based filtering
1733
1750
  * @returns Shipment methods and nearby pickup locations with pricing
1734
1751
  *
1735
1752
  * @example
@@ -1745,16 +1762,17 @@ declare function createShippingResource(fetcher: Fetcher): {
1745
1762
  * });
1746
1763
  * ```
1747
1764
  *
1748
- * @example Filter by carrier
1765
+ * @example Weight-based filtering with postal code
1749
1766
  * ```typescript
1750
- * const { pricedLocations } = await client.shipping.getWithLocations("00100");
1751
- *
1752
- * const postiLocations = pricedLocations.filter(
1753
- * loc => loc.carrier === "Posti"
1767
+ * const { shipmentMethods, pricedLocations } = await client.shipping.getWithLocations(
1768
+ * "00100",
1769
+ * { cartItems: cartItems }
1754
1770
  * );
1771
+ *
1772
+ * // Only shows methods that support the cart's total weight
1755
1773
  * ```
1756
1774
  */
1757
- getWithLocations(postalCode: string, options?: FetchOptions): Promise<ShipmentMethodsWithLocationsResponse>;
1775
+ getWithLocations(postalCode: string, options?: GetMethodsOptions): Promise<ShipmentMethodsWithLocationsResponse>;
1758
1776
  };
1759
1777
  /**
1760
1778
  * Type for the shipping resource
@@ -1774,11 +1792,12 @@ type ShippingResource = ReturnType<typeof createShippingResource>;
1774
1792
  declare function createCustomerResource(fetcher: Fetcher): {
1775
1793
  /**
1776
1794
  * Register a new customer account.
1777
- * After registration, the customer must verify their email before logging in.
1795
+ * A verification email is sent automatically by the server.
1796
+ * The customer must verify their email before logging in.
1778
1797
  *
1779
1798
  * @param data - Registration data (firstName, lastName, email, password)
1780
1799
  * @param fetchOptions - Fetch options
1781
- * @returns Created customer with verification token
1800
+ * @returns Created customer data and success message
1782
1801
  *
1783
1802
  * @example
1784
1803
  * ```typescript
@@ -1789,7 +1808,7 @@ declare function createCustomerResource(fetcher: Fetcher): {
1789
1808
  * password: 'securePassword123'
1790
1809
  * });
1791
1810
  *
1792
- * // Send verification email using customer.emailVerificationToken
1811
+ * // Verification email is sent automatically by the server
1793
1812
  * console.log('Account created:', message);
1794
1813
  * ```
1795
1814
  */
@@ -1887,24 +1906,77 @@ declare function createCustomerResource(fetcher: Fetcher): {
1887
1906
  */
1888
1907
  verifyEmail(token: string, fetchOptions?: FetchOptions): Promise<VerifyEmailResponse>;
1889
1908
  /**
1890
- * Resend the email verification token for an unverified customer.
1891
- * Generates a new token valid for 24 hours.
1909
+ * Resend the verification email for an unverified customer.
1910
+ * A new verification email is sent automatically by the server.
1892
1911
  *
1893
1912
  * @param customerId - The customer's ID (from failed login response)
1894
1913
  * @param fetchOptions - Fetch options
1895
- * @returns Updated customer with new verification token
1914
+ * @returns Success message
1896
1915
  * @throws ValidationError if customer is already verified or not found
1897
1916
  *
1898
1917
  * @example
1899
1918
  * ```typescript
1900
1919
  * // After login fails with requiresVerification
1901
- * const { customer } = await client.customer.resendVerification(customerId);
1920
+ * const { message } = await client.customer.resendVerification(customerId);
1902
1921
  *
1903
- * // Send new verification email using customer.emailVerificationToken
1904
- * await sendVerificationEmail(customer.email, customer.emailVerificationToken);
1922
+ * // Verification email is sent automatically by the server
1923
+ * console.log(message); // "Verification email sent."
1905
1924
  * ```
1906
1925
  */
1907
1926
  resendVerification(customerId: string, fetchOptions?: FetchOptions): Promise<ResendVerificationResponse>;
1927
+ /**
1928
+ * Request a password reset for a customer account.
1929
+ * The server sends a password reset email directly to the customer.
1930
+ * Returns success even if email doesn't exist (to prevent email enumeration).
1931
+ *
1932
+ * Note: The reset token is never exposed to the client for security.
1933
+ * The email is sent server-side with the reset link.
1934
+ *
1935
+ * @param email - Customer's email address
1936
+ * @param fetchOptions - Fetch options
1937
+ * @returns Generic success message (same whether email exists or not)
1938
+ *
1939
+ * @example
1940
+ * ```typescript
1941
+ * const response = await client.customer.forgotPassword('john@example.com');
1942
+ *
1943
+ * // Always show same message to user (email sent server-side)
1944
+ * console.log(response.message);
1945
+ * // "If an account exists with that email, password reset instructions have been sent."
1946
+ * ```
1947
+ */
1948
+ forgotPassword(email: string, fetchOptions?: FetchOptions): Promise<ForgotPasswordResponse>;
1949
+ /**
1950
+ * Reset a customer's password using a valid reset token.
1951
+ * The token is sent via email by the forgotPassword endpoint.
1952
+ * After successful reset, all existing sessions are invalidated.
1953
+ *
1954
+ * @param token - Password reset token (from email link)
1955
+ * @param password - New password (minimum 8 characters)
1956
+ * @param fetchOptions - Fetch options
1957
+ * @returns Success confirmation
1958
+ * @throws ValidationError if token is invalid or expired
1959
+ *
1960
+ * @example
1961
+ * ```typescript
1962
+ * // Token comes from the reset email link
1963
+ * const token = searchParams.get('token');
1964
+ *
1965
+ * try {
1966
+ * const { message } = await client.customer.resetPassword(token, newPassword);
1967
+ * console.log(message); // "Password reset successful..."
1968
+ *
1969
+ * // Redirect to login page
1970
+ * redirect('/login?reset=success');
1971
+ * } catch (error) {
1972
+ * if (error instanceof ValidationError) {
1973
+ * // Token invalid or expired
1974
+ * console.error('Please request a new password reset');
1975
+ * }
1976
+ * }
1977
+ * ```
1978
+ */
1979
+ resetPassword(token: string, password: string, fetchOptions?: FetchOptions): Promise<ResetPasswordResponse>;
1908
1980
  /**
1909
1981
  * Update the authenticated customer's profile.
1910
1982
  *
@@ -2416,4 +2488,4 @@ declare class VerificationRequiredError extends StorefrontError {
2416
2488
  constructor(message: string, customerId: string);
2417
2489
  }
2418
2490
 
2419
- export { type AddToCartParams, type AddToWishlistResponse, AuthError, type BuyXPayYCampaign, type CalculatedCartItem, type Campaign, type CampaignType, type CartCalculationResult, type CartItem, type CartResponse, type CartSessionOptions, type CartValidationChanges, type CartValidationResponse, type Category, type CategoryReference, type CategoryResponse, type CheckoutCustomerData, type CheckoutErrorCode, type CheckoutErrorDetails, type CheckoutOptions, type CheckoutParams, type CheckoutShipmentMethod, type ConfirmationItemType, type ConfirmationOrderCustomerData, type ConfirmationOrderLineItem, type ConfirmationOrderShipmentMethod, type ConfirmationOrderStatus, type Customer, type CustomerOrder, type CustomerWithCreatedAt, type CustomerWithEmailStatus, type CustomerWithVerification, type DeleteAccountResponse, type FeatureFlags, type FetchOptions, type FreeShippingCampaign, type FreeShippingStatus, type GetOrdersResponse, type GetUserResponse, type LoginOptions, type LoginResponse, type LoginVerificationRequiredResponse, type LogoutResponse, NotFoundError, type Order, type OrderLineItem, type OrderProductInfo, type OrderShipmentMethod, type OrderStatus, type PaymentConfig, type PaytrailCheckoutResponse, type PaytrailGroup, type PaytrailProvider, type PickupLocation, type PickupLocationOpeningHours, type PriceInfo, type Product, type ProductCountResponse, type ProductDetail, type ProductListParams, type ProductListResponse, type ProductSortOption, type ProductVariation, type ProductVariationListing, RateLimitError, type RegisterData, type RegisterResponse, type RemoveFromCartParams, type RemoveFromWishlistResponse, type ResendVerificationResponse, type ShipitShippingMethod, type ShipmentMethod, type ShipmentMethodsResponse, type ShipmentMethodsWithLocationsResponse, type StoreConfig, type StoreInfo, type StoreSeo, type StorefrontClient, type StorefrontClientConfig, StorefrontError, type StripeCheckoutResponse, type UpdateCartQuantityParams, type UpdateProfileData, type UpdateProfileResponse, ValidationError, type VariationOption, VerificationRequiredError, type VerifyEmailResponse, type WishlistItem, type WishlistProduct, type WishlistResponse, type WishlistVariation, type WishlistVariationOption, calculateCartWithCampaigns, createStorefrontClient, getPriceInfo, isSaleActive };
2491
+ export { type AddToCartParams, type AddToWishlistResponse, AuthError, type BuyXPayYCampaign, type CalculatedCartItem, type Campaign, type CampaignType, type CartCalculationResult, type CartItem, type CartResponse, type CartSessionOptions, type CartValidationChanges, type CartValidationResponse, type Category, type CategoryReference, type CategoryResponse, type CheckoutCustomerData, type CheckoutErrorCode, type CheckoutErrorDetails, type CheckoutOptions, type CheckoutParams, type CheckoutShipmentMethod, type ConfirmationItemType, type ConfirmationOrderCustomerData, type ConfirmationOrderLineItem, type ConfirmationOrderShipmentMethod, type Customer, type CustomerOrder, type DeleteAccountResponse, type FeatureFlags, type FetchOptions, type ForgotPasswordResponse, type FreeShippingCampaign, type FreeShippingStatus, type GetOrdersResponse, type GetUserResponse, type LoginOptions, type LoginResponse, type LoginVerificationRequiredResponse, type LogoutResponse, NotFoundError, type Order, type OrderLineItem, type OrderProductInfo, type OrderShipmentMethod, type OrderStatus, type PaymentConfig, type PaytrailCheckoutResponse, type PaytrailGroup, type PaytrailProvider, type PickupLocation, type PriceInfo, type Product, type ProductCountResponse, type ProductDetail, type ProductListParams, type ProductListResponse, type ProductSortOption, type ProductVariation, type ProductVariationListing, RateLimitError, type RegisterData, type RegisterResponse, type RemoveFromCartParams, type RemoveFromWishlistResponse, type ResendVerificationResponse, type ResetPasswordResponse, type ShipitShippingMethod, type ShipmentMethod, type ShipmentMethodsResponse, type ShipmentMethodsWithLocationsResponse, type StoreConfig, type StoreInfo, type StoreSeo, type StorefrontClient, type StorefrontClientConfig, StorefrontError, type StripeCheckoutResponse, type UpdateCartQuantityParams, type UpdateProfileData, type UpdateProfileResponse, ValidationError, type VariationOption, VerificationRequiredError, type VerifyEmailResponse, type WishlistItem, type WishlistProduct, type WishlistResponse, type WishlistVariation, type WishlistVariationOption, calculateCartWithCampaigns, createStorefrontClient, getPriceInfo, isSaleActive };