@commercengine/storefront-sdk 0.12.0 → 0.12.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/dist/index.d.mts +24 -15
- package/dist/index.iife.js +26 -11
- package/dist/index.iife.js.map +1 -1
- package/dist/index.mjs +26 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2098,13 +2098,16 @@ var CartClient = class extends StorefrontAPIClient {
|
|
|
2098
2098
|
/**
|
|
2099
2099
|
* Get fulfillment options for an order
|
|
2100
2100
|
*
|
|
2101
|
-
* @param body - Fulfillment options body containing cart_id and
|
|
2102
|
-
* @returns Promise with fulfillment options including collect and delivery methods
|
|
2101
|
+
* @param body - Fulfillment options body containing cart_id and optional fulfillment_type
|
|
2102
|
+
* @returns Promise with fulfillment options including collect and delivery methods. The response contains:
|
|
2103
|
+
* - `summary`: Object with `collect_available`, `deliver_available`, `recommended_fulfillment_type`, and optional `recommended_store`
|
|
2104
|
+
* - `collect`: Optional array of `CollectInStore` objects for collect-in-store options
|
|
2105
|
+
* - `deliver`: Optional `DeliveryOption` object with `is_serviceable` and `shipments` array. Each shipment contains `id`, `items`, and `shipping_methods` array. Shipping methods may have optional `courier_companies` for auto shipping types.
|
|
2103
2106
|
* @example
|
|
2104
2107
|
* ```typescript
|
|
2105
2108
|
* const { data, error } = await sdk.cart.getFulfillmentOptions({
|
|
2106
2109
|
* cart_id: "cart_01H9XYZ12345ABCDE",
|
|
2107
|
-
*
|
|
2110
|
+
* fulfillment_type: "delivery" // optional: "delivery" | "collect-in-store"
|
|
2108
2111
|
* });
|
|
2109
2112
|
*
|
|
2110
2113
|
* if (error) {
|
|
@@ -3577,8 +3580,11 @@ var HelpersClient = class extends StorefrontAPIClient {
|
|
|
3577
3580
|
* console.log("US Pincodes:", usPincodes.pincodes?.map(p => p.pincode).join(", "));
|
|
3578
3581
|
* ```
|
|
3579
3582
|
*/
|
|
3580
|
-
async listCountryPincodes(pathParams) {
|
|
3581
|
-
return this.executeRequest(() => this.client.GET("/common/countries/{country_iso_code}/pincodes", { params: {
|
|
3583
|
+
async listCountryPincodes(pathParams, queryParams) {
|
|
3584
|
+
return this.executeRequest(() => this.client.GET("/common/countries/{country_iso_code}/pincodes", { params: {
|
|
3585
|
+
path: pathParams,
|
|
3586
|
+
query: queryParams
|
|
3587
|
+
} }));
|
|
3582
3588
|
}
|
|
3583
3589
|
};
|
|
3584
3590
|
|
|
@@ -3698,8 +3704,11 @@ var CustomerClient = class extends StorefrontAPIClient {
|
|
|
3698
3704
|
* });
|
|
3699
3705
|
* ```
|
|
3700
3706
|
*/
|
|
3701
|
-
async listAddresses(pathParams) {
|
|
3702
|
-
return this.executeRequest(() => this.client.GET("/customers/{user_id}/addresses", { params: {
|
|
3707
|
+
async listAddresses(pathParams, queryParams) {
|
|
3708
|
+
return this.executeRequest(() => this.client.GET("/customers/{user_id}/addresses", { params: {
|
|
3709
|
+
path: pathParams,
|
|
3710
|
+
query: queryParams
|
|
3711
|
+
} }));
|
|
3703
3712
|
}
|
|
3704
3713
|
/**
|
|
3705
3714
|
* Create a new address for a customer
|
|
@@ -3874,8 +3883,11 @@ var CustomerClient = class extends StorefrontAPIClient {
|
|
|
3874
3883
|
* });
|
|
3875
3884
|
* ```
|
|
3876
3885
|
*/
|
|
3877
|
-
async listLoyaltyPointsActivity(pathParams) {
|
|
3878
|
-
return this.executeRequest(() => this.client.GET("/customers/{user_id}/loyalty-points-activity", { params: {
|
|
3886
|
+
async listLoyaltyPointsActivity(pathParams, queryParams) {
|
|
3887
|
+
return this.executeRequest(() => this.client.GET("/customers/{user_id}/loyalty-points-activity", { params: {
|
|
3888
|
+
path: pathParams,
|
|
3889
|
+
query: queryParams
|
|
3890
|
+
} }));
|
|
3879
3891
|
}
|
|
3880
3892
|
/**
|
|
3881
3893
|
* List all reviews left by a customer
|
|
@@ -3921,8 +3933,11 @@ var CustomerClient = class extends StorefrontAPIClient {
|
|
|
3921
3933
|
* console.log("Saved payment methods:", data.saved_payment_methods);
|
|
3922
3934
|
* ```
|
|
3923
3935
|
*/
|
|
3924
|
-
async listSavedPaymentMethods(pathParams) {
|
|
3925
|
-
return this.executeRequest(() => this.client.GET("/customers/{customer_id}/payment-methods", { params: {
|
|
3936
|
+
async listSavedPaymentMethods(pathParams, queryParams) {
|
|
3937
|
+
return this.executeRequest(() => this.client.GET("/customers/{customer_id}/payment-methods", { params: {
|
|
3938
|
+
path: pathParams,
|
|
3939
|
+
query: queryParams
|
|
3940
|
+
} }));
|
|
3926
3941
|
}
|
|
3927
3942
|
/**
|
|
3928
3943
|
* List all saved cards for a customer
|