ce-storefront 0.12.3 → 0.12.5

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.
Files changed (65) hide show
  1. package/README.md +2 -4
  2. package/docs/sdks/shipping/README.md +8 -86
  3. package/esm/funcs/shippingShippingMethods.d.ts +16 -0
  4. package/esm/funcs/shippingShippingMethods.d.ts.map +1 -0
  5. package/esm/funcs/{shippingCheckServiceability.js → shippingShippingMethods.js} +7 -7
  6. package/esm/funcs/shippingShippingMethods.js.map +1 -0
  7. package/esm/lib/config.d.ts +2 -2
  8. package/esm/lib/config.js +2 -2
  9. package/esm/models/components/cartitem.d.ts +8 -0
  10. package/esm/models/components/cartitem.d.ts.map +1 -1
  11. package/esm/models/components/cartitem.js +5 -0
  12. package/esm/models/components/cartitem.js.map +1 -1
  13. package/esm/models/components/index.d.ts +0 -1
  14. package/esm/models/components/index.d.ts.map +1 -1
  15. package/esm/models/components/index.js +0 -1
  16. package/esm/models/components/index.js.map +1 -1
  17. package/esm/models/components/orderitem.d.ts +74 -56
  18. package/esm/models/components/orderitem.d.ts.map +1 -1
  19. package/esm/models/components/orderitem.js +68 -56
  20. package/esm/models/components/orderitem.js.map +1 -1
  21. package/esm/models/operations/getshippingmethods.d.ts +58 -0
  22. package/esm/models/operations/getshippingmethods.d.ts.map +1 -0
  23. package/esm/models/operations/getshippingmethods.js +57 -0
  24. package/esm/models/operations/getshippingmethods.js.map +1 -0
  25. package/esm/models/operations/index.d.ts +1 -2
  26. package/esm/models/operations/index.d.ts.map +1 -1
  27. package/esm/models/operations/index.js +1 -2
  28. package/esm/models/operations/index.js.map +1 -1
  29. package/esm/sdk/shipping.d.ts +3 -10
  30. package/esm/sdk/shipping.d.ts.map +1 -1
  31. package/esm/sdk/shipping.js +5 -15
  32. package/esm/sdk/shipping.js.map +1 -1
  33. package/jsr.json +1 -1
  34. package/package.json +1 -1
  35. package/src/funcs/{shippingCheckServiceability.ts → shippingShippingMethods.ts} +11 -11
  36. package/src/lib/config.ts +2 -2
  37. package/src/models/components/cartitem.ts +17 -0
  38. package/src/models/components/index.ts +0 -1
  39. package/src/models/components/orderitem.ts +149 -112
  40. package/src/models/operations/getshippingmethods.ts +134 -0
  41. package/src/models/operations/index.ts +1 -2
  42. package/src/sdk/shipping.ts +7 -25
  43. package/esm/funcs/shippingCheckDeliveryAvailability.d.ts +0 -17
  44. package/esm/funcs/shippingCheckDeliveryAvailability.d.ts.map +0 -1
  45. package/esm/funcs/shippingCheckDeliveryAvailability.js +0 -85
  46. package/esm/funcs/shippingCheckDeliveryAvailability.js.map +0 -1
  47. package/esm/funcs/shippingCheckServiceability.d.ts +0 -16
  48. package/esm/funcs/shippingCheckServiceability.d.ts.map +0 -1
  49. package/esm/funcs/shippingCheckServiceability.js.map +0 -1
  50. package/esm/models/components/productsbasedserviceabilitycheck.d.ts +0 -95
  51. package/esm/models/components/productsbasedserviceabilitycheck.d.ts.map +0 -1
  52. package/esm/models/components/productsbasedserviceabilitycheck.js +0 -132
  53. package/esm/models/components/productsbasedserviceabilitycheck.js.map +0 -1
  54. package/esm/models/operations/checkdeliveryavailability.d.ts +0 -62
  55. package/esm/models/operations/checkdeliveryavailability.d.ts.map +0 -1
  56. package/esm/models/operations/checkdeliveryavailability.js +0 -58
  57. package/esm/models/operations/checkdeliveryavailability.js.map +0 -1
  58. package/esm/models/operations/shippingmethods.d.ts +0 -58
  59. package/esm/models/operations/shippingmethods.d.ts.map +0 -1
  60. package/esm/models/operations/shippingmethods.js +0 -63
  61. package/esm/models/operations/shippingmethods.js.map +0 -1
  62. package/src/funcs/shippingCheckDeliveryAvailability.ts +0 -172
  63. package/src/models/components/productsbasedserviceabilitycheck.ts +0 -243
  64. package/src/models/operations/checkdeliveryavailability.ts +0 -141
  65. package/src/models/operations/shippingmethods.ts +0 -140
@@ -14,6 +14,12 @@ import {
14
14
  AssociatedOption$Outbound,
15
15
  AssociatedOption$outboundSchema,
16
16
  } from "./associatedoption.js";
17
+ import {
18
+ ProductAttribute,
19
+ ProductAttribute$inboundSchema,
20
+ ProductAttribute$Outbound,
21
+ ProductAttribute$outboundSchema,
22
+ } from "./productattribute.js";
17
23
  import {
18
24
  ProductSubscription,
19
25
  ProductSubscription$inboundSchema,
@@ -65,6 +71,10 @@ export type CartItem = {
65
71
  * Indicates whether the product is currently in stock.
66
72
  */
67
73
  stockAvailable: boolean;
74
+ /**
75
+ * Indicates whether the item is being fulfilled as a backorder. When true, the item is not currently in stock and will ship later once inventory is available. This may result in the order being split into multiple shipments, with delays for the backordered portion.
76
+ */
77
+ backorder: boolean;
68
78
  /**
69
79
  * Indicates whether the product is currently on offer.
70
80
  */
@@ -129,6 +139,7 @@ export type CartItem = {
129
139
  */
130
140
  taxAmount: number;
131
141
  associatedOptions: { [k: string]: AssociatedOption } | null;
142
+ attributes: Array<ProductAttribute>;
132
143
  subscriptions: Array<ProductSubscription> | null;
133
144
  };
134
145
 
@@ -168,6 +179,7 @@ export const CartItem$inboundSchema: z.ZodType<
168
179
  product_type: CartItemProductType$inboundSchema,
169
180
  product_image_url: z.string(),
170
181
  stock_available: z.boolean(),
182
+ backorder: z.boolean(),
171
183
  on_offer: z.boolean(),
172
184
  on_subscription: z.boolean(),
173
185
  on_promotion: z.boolean(),
@@ -190,6 +202,7 @@ export const CartItem$inboundSchema: z.ZodType<
190
202
  tax_rate: z.number(),
191
203
  tax_amount: z.number(),
192
204
  associated_options: z.nullable(z.record(AssociatedOption$inboundSchema)),
205
+ attributes: z.array(ProductAttribute$inboundSchema),
193
206
  subscriptions: z.nullable(z.array(ProductSubscription$inboundSchema)),
194
207
  }).transform((v) => {
195
208
  return remap$(v, {
@@ -235,6 +248,7 @@ export type CartItem$Outbound = {
235
248
  product_type: string;
236
249
  product_image_url: string;
237
250
  stock_available: boolean;
251
+ backorder: boolean;
238
252
  on_offer: boolean;
239
253
  on_subscription: boolean;
240
254
  on_promotion: boolean;
@@ -257,6 +271,7 @@ export type CartItem$Outbound = {
257
271
  tax_rate: number;
258
272
  tax_amount: number;
259
273
  associated_options: { [k: string]: AssociatedOption$Outbound } | null;
274
+ attributes: Array<ProductAttribute$Outbound>;
260
275
  subscriptions: Array<ProductSubscription$Outbound> | null;
261
276
  };
262
277
 
@@ -275,6 +290,7 @@ export const CartItem$outboundSchema: z.ZodType<
275
290
  productType: CartItemProductType$outboundSchema,
276
291
  productImageUrl: z.string(),
277
292
  stockAvailable: z.boolean(),
293
+ backorder: z.boolean(),
278
294
  onOffer: z.boolean(),
279
295
  onSubscription: z.boolean(),
280
296
  onPromotion: z.boolean(),
@@ -297,6 +313,7 @@ export const CartItem$outboundSchema: z.ZodType<
297
313
  taxRate: z.number(),
298
314
  taxAmount: z.number(),
299
315
  associatedOptions: z.nullable(z.record(AssociatedOption$outboundSchema)),
316
+ attributes: z.array(ProductAttribute$outboundSchema),
300
317
  subscriptions: z.nullable(z.array(ProductSubscription$outboundSchema)),
301
318
  }).transform((v) => {
302
319
  return remap$(v, {
@@ -51,7 +51,6 @@ export * from "./productimage.js";
51
51
  export * from "./productpricing.js";
52
52
  export * from "./productpromotion.js";
53
53
  export * from "./productreview.js";
54
- export * from "./productsbasedserviceabilitycheck.js";
55
54
  export * from "./productshipping.js";
56
55
  export * from "./productsubscription.js";
57
56
  export * from "./productvideo.js";
@@ -8,6 +8,18 @@ import { safeParse } from "../../lib/schemas.js";
8
8
  import { ClosedEnum } from "../../types/enums.js";
9
9
  import { Result as SafeParseResult } from "../../types/fp.js";
10
10
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+ import {
12
+ AssociatedOption,
13
+ AssociatedOption$inboundSchema,
14
+ AssociatedOption$Outbound,
15
+ AssociatedOption$outboundSchema,
16
+ } from "./associatedoption.js";
17
+ import {
18
+ ProductAttribute,
19
+ ProductAttribute$inboundSchema,
20
+ ProductAttribute$Outbound,
21
+ ProductAttribute$outboundSchema,
22
+ } from "./productattribute.js";
11
23
 
12
24
  export const OrderItemProductType = {
13
25
  Physical: "physical",
@@ -17,35 +29,44 @@ export const OrderItemProductType = {
17
29
  export type OrderItemProductType = ClosedEnum<typeof OrderItemProductType>;
18
30
 
19
31
  export type OrderItem = {
20
- productId?: string | undefined;
21
- productName?: string | undefined;
22
- productImageUrl?: string | null | undefined;
23
- productType?: OrderItemProductType | undefined;
24
- sku?: string | undefined;
25
- slug?: string | undefined;
26
- variantId?: string | null | undefined;
27
- variantName?: string | null | undefined;
28
- onOffer?: boolean | undefined;
29
- onPromotion?: boolean | undefined;
30
- onSubscription?: boolean | undefined;
31
- subscriptionPlan?: string | null | undefined;
32
- subscriptionInterval?: number | null | undefined;
33
- subscriptionFrequency?: string | null | undefined;
34
- quantity?: number | undefined;
35
- freeQuantity?: number | undefined;
36
- isFreeItem?: boolean | undefined;
37
- priceIncludingTax?: boolean | undefined;
38
- sellingPrice?: number | undefined;
39
- listingPrice?: number | undefined;
40
- sellingPriceExcludingTax?: number | undefined;
41
- promotionDiscountAmount?: number | undefined;
42
- couponDiscountAmount?: number | undefined;
32
+ productId: string;
33
+ productName: string;
34
+ productImageUrl: string | null;
35
+ productType: OrderItemProductType;
36
+ sku: string;
37
+ slug: string;
38
+ variantId: string | null;
39
+ variantName: string | null;
40
+ /**
41
+ * @remarks
42
+ * backorder
43
+ *
44
+ * Indicates whether the item is being fulfilled as a backorder. When true, the item is not currently in stock and will ship later once inventory is available. This may result in the order being split into multiple shipments, with delays for the backordered portion.
45
+ */
46
+ backorder: boolean;
47
+ onOffer: boolean;
48
+ onPromotion: boolean;
49
+ onSubscription: boolean;
50
+ subscriptionPlan: string | null;
51
+ subscriptionInterval: number | null;
52
+ subscriptionFrequency: string | null;
53
+ quantity: number;
54
+ freeQuantity: number;
55
+ isFreeItem: boolean;
56
+ priceIncludingTax: boolean;
57
+ sellingPrice: number;
58
+ listingPrice: number;
59
+ sellingPriceExcludingTax: number;
60
+ promotionDiscountAmount: number;
61
+ couponDiscountAmount: number;
43
62
  taxType?: "GST" | undefined;
44
- taxRate?: number | undefined;
45
- taxAmount?: number | undefined;
46
- handlingChargeExcludingTax?: number | undefined;
47
- handlingChargeTaxRate?: number | undefined;
48
- handlingChargeIncludingTax?: number | undefined;
63
+ taxRate: number;
64
+ taxAmount: number;
65
+ handlingChargeExcludingTax: number;
66
+ handlingChargeTaxRate: number;
67
+ handlingChargeIncludingTax: number;
68
+ associatedOptions?: { [k: string]: AssociatedOption } | null | undefined;
69
+ attributes?: Array<ProductAttribute> | undefined;
49
70
  };
50
71
 
51
72
  /** @internal */
@@ -75,35 +96,39 @@ export const OrderItem$inboundSchema: z.ZodType<
75
96
  z.ZodTypeDef,
76
97
  unknown
77
98
  > = z.object({
78
- product_id: z.string().optional(),
79
- product_name: z.string().optional(),
80
- product_image_url: z.nullable(z.string()).optional(),
81
- product_type: OrderItemProductType$inboundSchema.optional(),
82
- sku: z.string().optional(),
83
- slug: z.string().optional(),
84
- variant_id: z.nullable(z.string()).optional(),
85
- variant_name: z.nullable(z.string()).optional(),
86
- on_offer: z.boolean().optional(),
87
- on_promotion: z.boolean().optional(),
88
- on_subscription: z.boolean().optional(),
89
- subscription_plan: z.nullable(z.string()).optional(),
90
- subscription_interval: z.nullable(z.number().int()).optional(),
91
- subscription_frequency: z.nullable(z.string()).optional(),
92
- quantity: z.number().int().optional(),
93
- free_quantity: z.number().int().optional(),
94
- is_free_item: z.boolean().optional(),
95
- price_including_tax: z.boolean().optional(),
96
- selling_price: z.number().optional(),
97
- listing_price: z.number().optional(),
98
- selling_price_excluding_tax: z.number().optional(),
99
- promotion_discount_amount: z.number().optional(),
100
- coupon_discount_amount: z.number().optional(),
99
+ product_id: z.string(),
100
+ product_name: z.string(),
101
+ product_image_url: z.nullable(z.string()),
102
+ product_type: OrderItemProductType$inboundSchema,
103
+ sku: z.string(),
104
+ slug: z.string(),
105
+ variant_id: z.nullable(z.string()),
106
+ variant_name: z.nullable(z.string()),
107
+ backorder: z.boolean(),
108
+ on_offer: z.boolean(),
109
+ on_promotion: z.boolean(),
110
+ on_subscription: z.boolean(),
111
+ subscription_plan: z.nullable(z.string()),
112
+ subscription_interval: z.nullable(z.number().int()),
113
+ subscription_frequency: z.nullable(z.string()),
114
+ quantity: z.number().int(),
115
+ free_quantity: z.number().int(),
116
+ is_free_item: z.boolean(),
117
+ price_including_tax: z.boolean(),
118
+ selling_price: z.number(),
119
+ listing_price: z.number(),
120
+ selling_price_excluding_tax: z.number(),
121
+ promotion_discount_amount: z.number(),
122
+ coupon_discount_amount: z.number(),
101
123
  tax_type: z.literal("GST").default("GST"),
102
- tax_rate: z.number().optional(),
103
- tax_amount: z.number().optional(),
104
- handling_charge_excluding_tax: z.number().optional(),
105
- handling_charge_tax_rate: z.number().optional(),
106
- handling_charge_including_tax: z.number().optional(),
124
+ tax_rate: z.number(),
125
+ tax_amount: z.number(),
126
+ handling_charge_excluding_tax: z.number(),
127
+ handling_charge_tax_rate: z.number(),
128
+ handling_charge_including_tax: z.number(),
129
+ associated_options: z.nullable(z.record(AssociatedOption$inboundSchema))
130
+ .optional(),
131
+ attributes: z.array(ProductAttribute$inboundSchema).optional(),
107
132
  }).transform((v) => {
108
133
  return remap$(v, {
109
134
  "product_id": "productId",
@@ -132,40 +157,47 @@ export const OrderItem$inboundSchema: z.ZodType<
132
157
  "handling_charge_excluding_tax": "handlingChargeExcludingTax",
133
158
  "handling_charge_tax_rate": "handlingChargeTaxRate",
134
159
  "handling_charge_including_tax": "handlingChargeIncludingTax",
160
+ "associated_options": "associatedOptions",
135
161
  });
136
162
  });
137
163
 
138
164
  /** @internal */
139
165
  export type OrderItem$Outbound = {
140
- product_id?: string | undefined;
141
- product_name?: string | undefined;
142
- product_image_url?: string | null | undefined;
143
- product_type?: string | undefined;
144
- sku?: string | undefined;
145
- slug?: string | undefined;
146
- variant_id?: string | null | undefined;
147
- variant_name?: string | null | undefined;
148
- on_offer?: boolean | undefined;
149
- on_promotion?: boolean | undefined;
150
- on_subscription?: boolean | undefined;
151
- subscription_plan?: string | null | undefined;
152
- subscription_interval?: number | null | undefined;
153
- subscription_frequency?: string | null | undefined;
154
- quantity?: number | undefined;
155
- free_quantity?: number | undefined;
156
- is_free_item?: boolean | undefined;
157
- price_including_tax?: boolean | undefined;
158
- selling_price?: number | undefined;
159
- listing_price?: number | undefined;
160
- selling_price_excluding_tax?: number | undefined;
161
- promotion_discount_amount?: number | undefined;
162
- coupon_discount_amount?: number | undefined;
166
+ product_id: string;
167
+ product_name: string;
168
+ product_image_url: string | null;
169
+ product_type: string;
170
+ sku: string;
171
+ slug: string;
172
+ variant_id: string | null;
173
+ variant_name: string | null;
174
+ backorder: boolean;
175
+ on_offer: boolean;
176
+ on_promotion: boolean;
177
+ on_subscription: boolean;
178
+ subscription_plan: string | null;
179
+ subscription_interval: number | null;
180
+ subscription_frequency: string | null;
181
+ quantity: number;
182
+ free_quantity: number;
183
+ is_free_item: boolean;
184
+ price_including_tax: boolean;
185
+ selling_price: number;
186
+ listing_price: number;
187
+ selling_price_excluding_tax: number;
188
+ promotion_discount_amount: number;
189
+ coupon_discount_amount: number;
163
190
  tax_type: "GST";
164
- tax_rate?: number | undefined;
165
- tax_amount?: number | undefined;
166
- handling_charge_excluding_tax?: number | undefined;
167
- handling_charge_tax_rate?: number | undefined;
168
- handling_charge_including_tax?: number | undefined;
191
+ tax_rate: number;
192
+ tax_amount: number;
193
+ handling_charge_excluding_tax: number;
194
+ handling_charge_tax_rate: number;
195
+ handling_charge_including_tax: number;
196
+ associated_options?:
197
+ | { [k: string]: AssociatedOption$Outbound }
198
+ | null
199
+ | undefined;
200
+ attributes?: Array<ProductAttribute$Outbound> | undefined;
169
201
  };
170
202
 
171
203
  /** @internal */
@@ -174,35 +206,39 @@ export const OrderItem$outboundSchema: z.ZodType<
174
206
  z.ZodTypeDef,
175
207
  OrderItem
176
208
  > = z.object({
177
- productId: z.string().optional(),
178
- productName: z.string().optional(),
179
- productImageUrl: z.nullable(z.string()).optional(),
180
- productType: OrderItemProductType$outboundSchema.optional(),
181
- sku: z.string().optional(),
182
- slug: z.string().optional(),
183
- variantId: z.nullable(z.string()).optional(),
184
- variantName: z.nullable(z.string()).optional(),
185
- onOffer: z.boolean().optional(),
186
- onPromotion: z.boolean().optional(),
187
- onSubscription: z.boolean().optional(),
188
- subscriptionPlan: z.nullable(z.string()).optional(),
189
- subscriptionInterval: z.nullable(z.number().int()).optional(),
190
- subscriptionFrequency: z.nullable(z.string()).optional(),
191
- quantity: z.number().int().optional(),
192
- freeQuantity: z.number().int().optional(),
193
- isFreeItem: z.boolean().optional(),
194
- priceIncludingTax: z.boolean().optional(),
195
- sellingPrice: z.number().optional(),
196
- listingPrice: z.number().optional(),
197
- sellingPriceExcludingTax: z.number().optional(),
198
- promotionDiscountAmount: z.number().optional(),
199
- couponDiscountAmount: z.number().optional(),
209
+ productId: z.string(),
210
+ productName: z.string(),
211
+ productImageUrl: z.nullable(z.string()),
212
+ productType: OrderItemProductType$outboundSchema,
213
+ sku: z.string(),
214
+ slug: z.string(),
215
+ variantId: z.nullable(z.string()),
216
+ variantName: z.nullable(z.string()),
217
+ backorder: z.boolean(),
218
+ onOffer: z.boolean(),
219
+ onPromotion: z.boolean(),
220
+ onSubscription: z.boolean(),
221
+ subscriptionPlan: z.nullable(z.string()),
222
+ subscriptionInterval: z.nullable(z.number().int()),
223
+ subscriptionFrequency: z.nullable(z.string()),
224
+ quantity: z.number().int(),
225
+ freeQuantity: z.number().int(),
226
+ isFreeItem: z.boolean(),
227
+ priceIncludingTax: z.boolean(),
228
+ sellingPrice: z.number(),
229
+ listingPrice: z.number(),
230
+ sellingPriceExcludingTax: z.number(),
231
+ promotionDiscountAmount: z.number(),
232
+ couponDiscountAmount: z.number(),
200
233
  taxType: z.literal("GST").default("GST" as const),
201
- taxRate: z.number().optional(),
202
- taxAmount: z.number().optional(),
203
- handlingChargeExcludingTax: z.number().optional(),
204
- handlingChargeTaxRate: z.number().optional(),
205
- handlingChargeIncludingTax: z.number().optional(),
234
+ taxRate: z.number(),
235
+ taxAmount: z.number(),
236
+ handlingChargeExcludingTax: z.number(),
237
+ handlingChargeTaxRate: z.number(),
238
+ handlingChargeIncludingTax: z.number(),
239
+ associatedOptions: z.nullable(z.record(AssociatedOption$outboundSchema))
240
+ .optional(),
241
+ attributes: z.array(ProductAttribute$outboundSchema).optional(),
206
242
  }).transform((v) => {
207
243
  return remap$(v, {
208
244
  productId: "product_id",
@@ -231,6 +267,7 @@ export const OrderItem$outboundSchema: z.ZodType<
231
267
  handlingChargeExcludingTax: "handling_charge_excluding_tax",
232
268
  handlingChargeTaxRate: "handling_charge_tax_rate",
233
269
  handlingChargeIncludingTax: "handling_charge_including_tax",
270
+ associatedOptions: "associated_options",
234
271
  });
235
272
  });
236
273
 
@@ -0,0 +1,134 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import * as components from "../components/index.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ export type GetShippingMethodsRequestBody =
12
+ components.CartBasedServiceabilityCheck;
13
+
14
+ /**
15
+ * OK
16
+ */
17
+ export type GetShippingMethodsResponseBody = {
18
+ message: string;
19
+ success: boolean;
20
+ content: components.PincodeServiceability;
21
+ };
22
+
23
+ /** @internal */
24
+ export const GetShippingMethodsRequestBody$inboundSchema: z.ZodType<
25
+ GetShippingMethodsRequestBody,
26
+ z.ZodTypeDef,
27
+ unknown
28
+ > = components.CartBasedServiceabilityCheck$inboundSchema;
29
+
30
+ /** @internal */
31
+ export type GetShippingMethodsRequestBody$Outbound =
32
+ components.CartBasedServiceabilityCheck$Outbound;
33
+
34
+ /** @internal */
35
+ export const GetShippingMethodsRequestBody$outboundSchema: z.ZodType<
36
+ GetShippingMethodsRequestBody$Outbound,
37
+ z.ZodTypeDef,
38
+ GetShippingMethodsRequestBody
39
+ > = components.CartBasedServiceabilityCheck$outboundSchema;
40
+
41
+ /**
42
+ * @internal
43
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
44
+ */
45
+ export namespace GetShippingMethodsRequestBody$ {
46
+ /** @deprecated use `GetShippingMethodsRequestBody$inboundSchema` instead. */
47
+ export const inboundSchema = GetShippingMethodsRequestBody$inboundSchema;
48
+ /** @deprecated use `GetShippingMethodsRequestBody$outboundSchema` instead. */
49
+ export const outboundSchema = GetShippingMethodsRequestBody$outboundSchema;
50
+ /** @deprecated use `GetShippingMethodsRequestBody$Outbound` instead. */
51
+ export type Outbound = GetShippingMethodsRequestBody$Outbound;
52
+ }
53
+
54
+ export function getShippingMethodsRequestBodyToJSON(
55
+ getShippingMethodsRequestBody: GetShippingMethodsRequestBody,
56
+ ): string {
57
+ return JSON.stringify(
58
+ GetShippingMethodsRequestBody$outboundSchema.parse(
59
+ getShippingMethodsRequestBody,
60
+ ),
61
+ );
62
+ }
63
+
64
+ export function getShippingMethodsRequestBodyFromJSON(
65
+ jsonString: string,
66
+ ): SafeParseResult<GetShippingMethodsRequestBody, SDKValidationError> {
67
+ return safeParse(
68
+ jsonString,
69
+ (x) => GetShippingMethodsRequestBody$inboundSchema.parse(JSON.parse(x)),
70
+ `Failed to parse 'GetShippingMethodsRequestBody' from JSON`,
71
+ );
72
+ }
73
+
74
+ /** @internal */
75
+ export const GetShippingMethodsResponseBody$inboundSchema: z.ZodType<
76
+ GetShippingMethodsResponseBody,
77
+ z.ZodTypeDef,
78
+ unknown
79
+ > = z.object({
80
+ message: z.string(),
81
+ success: z.boolean(),
82
+ content: components.PincodeServiceability$inboundSchema,
83
+ });
84
+
85
+ /** @internal */
86
+ export type GetShippingMethodsResponseBody$Outbound = {
87
+ message: string;
88
+ success: boolean;
89
+ content: components.PincodeServiceability$Outbound;
90
+ };
91
+
92
+ /** @internal */
93
+ export const GetShippingMethodsResponseBody$outboundSchema: z.ZodType<
94
+ GetShippingMethodsResponseBody$Outbound,
95
+ z.ZodTypeDef,
96
+ GetShippingMethodsResponseBody
97
+ > = z.object({
98
+ message: z.string(),
99
+ success: z.boolean(),
100
+ content: components.PincodeServiceability$outboundSchema,
101
+ });
102
+
103
+ /**
104
+ * @internal
105
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
106
+ */
107
+ export namespace GetShippingMethodsResponseBody$ {
108
+ /** @deprecated use `GetShippingMethodsResponseBody$inboundSchema` instead. */
109
+ export const inboundSchema = GetShippingMethodsResponseBody$inboundSchema;
110
+ /** @deprecated use `GetShippingMethodsResponseBody$outboundSchema` instead. */
111
+ export const outboundSchema = GetShippingMethodsResponseBody$outboundSchema;
112
+ /** @deprecated use `GetShippingMethodsResponseBody$Outbound` instead. */
113
+ export type Outbound = GetShippingMethodsResponseBody$Outbound;
114
+ }
115
+
116
+ export function getShippingMethodsResponseBodyToJSON(
117
+ getShippingMethodsResponseBody: GetShippingMethodsResponseBody,
118
+ ): string {
119
+ return JSON.stringify(
120
+ GetShippingMethodsResponseBody$outboundSchema.parse(
121
+ getShippingMethodsResponseBody,
122
+ ),
123
+ );
124
+ }
125
+
126
+ export function getShippingMethodsResponseBodyFromJSON(
127
+ jsonString: string,
128
+ ): SafeParseResult<GetShippingMethodsResponseBody, SDKValidationError> {
129
+ return safeParse(
130
+ jsonString,
131
+ (x) => GetShippingMethodsResponseBody$inboundSchema.parse(JSON.parse(x)),
132
+ `Failed to parse 'GetShippingMethodsResponseBody' from JSON`,
133
+ );
134
+ }
@@ -4,7 +4,6 @@
4
4
 
5
5
  export * from "./applycoupon.js";
6
6
  export * from "./cancelorder.js";
7
- export * from "./checkdeliveryavailability.js";
8
7
  export * from "./createaddress.js";
9
8
  export * from "./createcart.js";
10
9
  export * from "./createcartaddress.js";
@@ -20,6 +19,7 @@ export * from "./getloyaltydetails.js";
20
19
  export * from "./getorderdetail.js";
21
20
  export * from "./getpaymentstatus.js";
22
21
  export * from "./getproductdetail.js";
22
+ export * from "./getshippingmethods.js";
23
23
  export * from "./getusercart.js";
24
24
  export * from "./getuserdetail.js";
25
25
  export * from "./getvariantdetail.js";
@@ -46,7 +46,6 @@ export * from "./removecoupon.js";
46
46
  export * from "./removeloyaltypoints.js";
47
47
  export * from "./retryorderpayment.js";
48
48
  export * from "./searchproducts.js";
49
- export * from "./shippingmethods.js";
50
49
  export * from "./updateaddressdetail.js";
51
50
  export * from "./updatecart.js";
52
51
  export * from "./updateshippingmethod.js";
@@ -2,41 +2,23 @@
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
3
  */
4
4
 
5
- import { shippingCheckDeliveryAvailability } from "../funcs/shippingCheckDeliveryAvailability.js";
6
- import { shippingCheckServiceability } from "../funcs/shippingCheckServiceability.js";
5
+ import { shippingShippingMethods } from "../funcs/shippingShippingMethods.js";
7
6
  import { ClientSDK, RequestOptions } from "../lib/sdks.js";
8
7
  import * as operations from "../models/operations/index.js";
9
8
  import { unwrapAsync } from "../types/fp.js";
10
9
 
11
10
  export class Shipping extends ClientSDK {
12
11
  /**
13
- * Check pincode deliverability
12
+ * List available shipping methods
14
13
  *
15
14
  * @remarks
16
- * Check shipment delivery availability in an area by pincode
15
+ * Checks whether a given pincode is serviceable and returns all available shipping methods based on delivery address
17
16
  */
18
- async checkDeliveryAvailability(
19
- request: operations.CheckDeliveryAvailabilityRequest,
17
+ async shippingMethods(
18
+ request?: operations.GetShippingMethodsRequestBody | undefined,
20
19
  options?: RequestOptions,
21
- ): Promise<operations.CheckDeliveryAvailabilityResponseBody> {
22
- return unwrapAsync(shippingCheckDeliveryAvailability(
23
- this,
24
- request,
25
- options,
26
- ));
27
- }
28
-
29
- /**
30
- * Check serviceability
31
- *
32
- * @remarks
33
- * Checking serviceability for a given pincode based provided cart_id or based on products list & pickup pincode provided.
34
- */
35
- async checkServiceability(
36
- request?: operations.ShippingMethodsRequestBody | undefined,
37
- options?: RequestOptions,
38
- ): Promise<operations.ShippingMethodsResponseBody> {
39
- return unwrapAsync(shippingCheckServiceability(
20
+ ): Promise<operations.GetShippingMethodsResponseBody> {
21
+ return unwrapAsync(shippingShippingMethods(
40
22
  this,
41
23
  request,
42
24
  options,
@@ -1,17 +0,0 @@
1
- import { CeStorefrontCore } from "../core.js";
2
- import { RequestOptions } from "../lib/sdks.js";
3
- import { CeError } from "../models/errors/ceerror.js";
4
- import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
5
- import * as errors from "../models/errors/index.js";
6
- import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
7
- import * as operations from "../models/operations/index.js";
8
- import { APIPromise } from "../types/async.js";
9
- import { Result } from "../types/fp.js";
10
- /**
11
- * Check pincode deliverability
12
- *
13
- * @remarks
14
- * Check shipment delivery availability in an area by pincode
15
- */
16
- export declare function shippingCheckDeliveryAvailability(client: CeStorefrontCore, request: operations.CheckDeliveryAvailabilityRequest, options?: RequestOptions): APIPromise<Result<operations.CheckDeliveryAvailabilityResponseBody, errors.Unauthorized | CeError | SDKValidationError | UnexpectedClientError | InvalidRequestError | RequestAbortedError | RequestTimeoutError | ConnectionError>>;
17
- //# sourceMappingURL=shippingCheckDeliveryAvailability.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"shippingCheckDeliveryAvailability.d.ts","sourceRoot":"","sources":["../../src/funcs/shippingCheckDeliveryAvailability.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAK9C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAW,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;;;;GAKG;AACH,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,UAAU,CAAC,gCAAgC,EACpD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CACX,MAAM,CACJ,UAAU,CAAC,qCAAqC,EAC9C,MAAM,CAAC,YAAY,GACnB,OAAO,GACP,kBAAkB,GAClB,qBAAqB,GACrB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,eAAe,CAClB,CACF,CAMA"}