ce-storefront 0.12.4 → 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.
- package/README.md +2 -4
- package/docs/sdks/shipping/README.md +8 -86
- package/esm/funcs/shippingShippingMethods.d.ts +16 -0
- package/esm/funcs/shippingShippingMethods.d.ts.map +1 -0
- package/esm/funcs/{shippingCheckServiceability.js → shippingShippingMethods.js} +7 -7
- package/esm/funcs/shippingShippingMethods.js.map +1 -0
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/components/cartitem.d.ts +8 -0
- package/esm/models/components/cartitem.d.ts.map +1 -1
- package/esm/models/components/cartitem.js +5 -0
- package/esm/models/components/cartitem.js.map +1 -1
- package/esm/models/components/orderitem.d.ts +74 -56
- package/esm/models/components/orderitem.d.ts.map +1 -1
- package/esm/models/components/orderitem.js +68 -56
- package/esm/models/components/orderitem.js.map +1 -1
- package/esm/models/operations/getshippingmethods.d.ts +58 -0
- package/esm/models/operations/getshippingmethods.d.ts.map +1 -0
- package/esm/models/operations/getshippingmethods.js +57 -0
- package/esm/models/operations/getshippingmethods.js.map +1 -0
- package/esm/models/operations/index.d.ts +1 -2
- package/esm/models/operations/index.d.ts.map +1 -1
- package/esm/models/operations/index.js +1 -2
- package/esm/models/operations/index.js.map +1 -1
- package/esm/sdk/shipping.d.ts +3 -10
- package/esm/sdk/shipping.d.ts.map +1 -1
- package/esm/sdk/shipping.js +5 -15
- package/esm/sdk/shipping.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/{shippingCheckServiceability.ts → shippingShippingMethods.ts} +11 -11
- package/src/lib/config.ts +2 -2
- package/src/models/components/cartitem.ts +17 -0
- package/src/models/components/orderitem.ts +149 -112
- package/src/models/operations/getshippingmethods.ts +134 -0
- package/src/models/operations/index.ts +1 -2
- package/src/sdk/shipping.ts +7 -25
- package/esm/funcs/shippingCheckDeliveryAvailability.d.ts +0 -17
- package/esm/funcs/shippingCheckDeliveryAvailability.d.ts.map +0 -1
- package/esm/funcs/shippingCheckDeliveryAvailability.js +0 -85
- package/esm/funcs/shippingCheckDeliveryAvailability.js.map +0 -1
- package/esm/funcs/shippingCheckServiceability.d.ts +0 -16
- package/esm/funcs/shippingCheckServiceability.d.ts.map +0 -1
- package/esm/funcs/shippingCheckServiceability.js.map +0 -1
- package/esm/models/operations/checkdeliveryavailability.d.ts +0 -62
- package/esm/models/operations/checkdeliveryavailability.d.ts.map +0 -1
- package/esm/models/operations/checkdeliveryavailability.js +0 -58
- package/esm/models/operations/checkdeliveryavailability.js.map +0 -1
- package/esm/models/operations/shippingmethods.d.ts +0 -58
- package/esm/models/operations/shippingmethods.d.ts.map +0 -1
- package/esm/models/operations/shippingmethods.js +0 -57
- package/esm/models/operations/shippingmethods.js.map +0 -1
- package/src/funcs/shippingCheckDeliveryAvailability.ts +0 -172
- package/src/models/operations/checkdeliveryavailability.ts +0 -141
- package/src/models/operations/shippingmethods.ts +0 -132
|
@@ -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, {
|
|
@@ -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
|
|
21
|
-
productName
|
|
22
|
-
productImageUrl
|
|
23
|
-
productType
|
|
24
|
-
sku
|
|
25
|
-
slug
|
|
26
|
-
variantId
|
|
27
|
-
variantName
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
|
45
|
-
taxAmount
|
|
46
|
-
handlingChargeExcludingTax
|
|
47
|
-
handlingChargeTaxRate
|
|
48
|
-
handlingChargeIncludingTax
|
|
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()
|
|
79
|
-
product_name: z.string()
|
|
80
|
-
product_image_url: z.nullable(z.string())
|
|
81
|
-
product_type: OrderItemProductType$inboundSchema
|
|
82
|
-
sku: z.string()
|
|
83
|
-
slug: z.string()
|
|
84
|
-
variant_id: z.nullable(z.string())
|
|
85
|
-
variant_name: z.nullable(z.string())
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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()
|
|
103
|
-
tax_amount: z.number()
|
|
104
|
-
handling_charge_excluding_tax: z.number()
|
|
105
|
-
handling_charge_tax_rate: z.number()
|
|
106
|
-
handling_charge_including_tax: z.number()
|
|
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
|
|
141
|
-
product_name
|
|
142
|
-
product_image_url
|
|
143
|
-
product_type
|
|
144
|
-
sku
|
|
145
|
-
slug
|
|
146
|
-
variant_id
|
|
147
|
-
variant_name
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
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
|
|
165
|
-
tax_amount
|
|
166
|
-
handling_charge_excluding_tax
|
|
167
|
-
handling_charge_tax_rate
|
|
168
|
-
handling_charge_including_tax
|
|
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()
|
|
178
|
-
productName: z.string()
|
|
179
|
-
productImageUrl: z.nullable(z.string())
|
|
180
|
-
productType: OrderItemProductType$outboundSchema
|
|
181
|
-
sku: z.string()
|
|
182
|
-
slug: z.string()
|
|
183
|
-
variantId: z.nullable(z.string())
|
|
184
|
-
variantName: z.nullable(z.string())
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
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()
|
|
202
|
-
taxAmount: z.number()
|
|
203
|
-
handlingChargeExcludingTax: z.number()
|
|
204
|
-
handlingChargeTaxRate: z.number()
|
|
205
|
-
handlingChargeIncludingTax: z.number()
|
|
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";
|
package/src/sdk/shipping.ts
CHANGED
|
@@ -2,41 +2,23 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import {
|
|
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
|
-
*
|
|
12
|
+
* List available shipping methods
|
|
14
13
|
*
|
|
15
14
|
* @remarks
|
|
16
|
-
*
|
|
15
|
+
* Checks whether a given pincode is serviceable and returns all available shipping methods based on delivery address
|
|
17
16
|
*/
|
|
18
|
-
async
|
|
19
|
-
request
|
|
17
|
+
async shippingMethods(
|
|
18
|
+
request?: operations.GetShippingMethodsRequestBody | undefined,
|
|
20
19
|
options?: RequestOptions,
|
|
21
|
-
): Promise<operations.
|
|
22
|
-
return unwrapAsync(
|
|
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"}
|