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
@@ -1,172 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import { CeStorefrontCore } from "../core.js";
6
- import { encodeSimple } from "../lib/encodings.js";
7
- import * as M from "../lib/matchers.js";
8
- import { compactMap } from "../lib/primitives.js";
9
- import { safeParse } from "../lib/schemas.js";
10
- import { RequestOptions } from "../lib/sdks.js";
11
- import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
12
- import { pathToFunc } from "../lib/url.js";
13
- import { CeError } from "../models/errors/ceerror.js";
14
- import {
15
- ConnectionError,
16
- InvalidRequestError,
17
- RequestAbortedError,
18
- RequestTimeoutError,
19
- UnexpectedClientError,
20
- } from "../models/errors/httpclienterrors.js";
21
- import * as errors from "../models/errors/index.js";
22
- import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
23
- import * as operations from "../models/operations/index.js";
24
- import { APICall, APIPromise } from "../types/async.js";
25
- import { Result } from "../types/fp.js";
26
-
27
- /**
28
- * Check pincode deliverability
29
- *
30
- * @remarks
31
- * Check shipment delivery availability in an area by pincode
32
- */
33
- export function shippingCheckDeliveryAvailability(
34
- client: CeStorefrontCore,
35
- request: operations.CheckDeliveryAvailabilityRequest,
36
- options?: RequestOptions,
37
- ): APIPromise<
38
- Result<
39
- operations.CheckDeliveryAvailabilityResponseBody,
40
- | errors.Unauthorized
41
- | CeError
42
- | SDKValidationError
43
- | UnexpectedClientError
44
- | InvalidRequestError
45
- | RequestAbortedError
46
- | RequestTimeoutError
47
- | ConnectionError
48
- >
49
- > {
50
- return new APIPromise($do(
51
- client,
52
- request,
53
- options,
54
- ));
55
- }
56
-
57
- async function $do(
58
- client: CeStorefrontCore,
59
- request: operations.CheckDeliveryAvailabilityRequest,
60
- options?: RequestOptions,
61
- ): Promise<
62
- [
63
- Result<
64
- operations.CheckDeliveryAvailabilityResponseBody,
65
- | errors.Unauthorized
66
- | CeError
67
- | SDKValidationError
68
- | UnexpectedClientError
69
- | InvalidRequestError
70
- | RequestAbortedError
71
- | RequestTimeoutError
72
- | ConnectionError
73
- >,
74
- APICall,
75
- ]
76
- > {
77
- const parsed = safeParse(
78
- request,
79
- (value) =>
80
- operations.CheckDeliveryAvailabilityRequest$outboundSchema.parse(value),
81
- "Input validation failed",
82
- );
83
- if (!parsed.ok) {
84
- return [parsed, { status: "invalid" }];
85
- }
86
- const payload = parsed.value;
87
- const body = null;
88
-
89
- const pathParams = {
90
- pincode: encodeSimple("pincode", payload.pincode, {
91
- explode: false,
92
- charEncoding: "percent",
93
- }),
94
- };
95
-
96
- const path = pathToFunc("/shipment/pincode-serviceability/{pincode}")(
97
- pathParams,
98
- );
99
-
100
- const headers = new Headers(compactMap({
101
- Accept: "application/json",
102
- }));
103
-
104
- const secConfig = await extractSecurity(client._options.authorization);
105
- const securityInput = secConfig == null ? {} : { authorization: secConfig };
106
- const requestSecurity = resolveGlobalSecurity(securityInput);
107
-
108
- const context = {
109
- baseURL: options?.serverURL ?? client._baseURL ?? "",
110
- operationID: "check-delivery-availability",
111
- oAuth2Scopes: [],
112
-
113
- resolvedSecurity: requestSecurity,
114
-
115
- securitySource: client._options.authorization,
116
- retryConfig: options?.retries
117
- || client._options.retryConfig
118
- || { strategy: "none" },
119
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
120
- };
121
-
122
- const requestRes = client._createRequest(context, {
123
- security: requestSecurity,
124
- method: "GET",
125
- baseURL: options?.serverURL,
126
- path: path,
127
- headers: headers,
128
- body: body,
129
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
130
- }, options);
131
- if (!requestRes.ok) {
132
- return [requestRes, { status: "invalid" }];
133
- }
134
- const req = requestRes.value;
135
-
136
- const doResult = await client._do(req, {
137
- context,
138
- errorCodes: ["401", "4XX", "5XX"],
139
- retryConfig: context.retryConfig,
140
- retryCodes: context.retryCodes,
141
- });
142
- if (!doResult.ok) {
143
- return [doResult, { status: "request-error", request: req }];
144
- }
145
- const response = doResult.value;
146
-
147
- const responseFields = {
148
- HttpMeta: { Response: response, Request: req },
149
- };
150
-
151
- const [result] = await M.match<
152
- operations.CheckDeliveryAvailabilityResponseBody,
153
- | errors.Unauthorized
154
- | CeError
155
- | SDKValidationError
156
- | UnexpectedClientError
157
- | InvalidRequestError
158
- | RequestAbortedError
159
- | RequestTimeoutError
160
- | ConnectionError
161
- >(
162
- M.json(200, operations.CheckDeliveryAvailabilityResponseBody$inboundSchema),
163
- M.jsonErr(401, errors.Unauthorized$inboundSchema),
164
- M.fail("4XX"),
165
- M.fail("5XX"),
166
- )(response, { extraFields: responseFields });
167
- if (!result.ok) {
168
- return [result, { status: "complete", request: req, response }];
169
- }
170
-
171
- return [result, { status: "complete", request: req, response }];
172
- }
@@ -1,243 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod";
6
- import { remap as remap$ } from "../../lib/primitives.js";
7
- import { safeParse } from "../../lib/schemas.js";
8
- import { Result as SafeParseResult } from "../../types/fp.js";
9
- import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
-
11
- export type Packaging = {
12
- packWidth: number;
13
- packHeight: number;
14
- packLength: number;
15
- packDryWeight: number;
16
- };
17
-
18
- export type Products = {
19
- productId: string;
20
- variantId: string | null;
21
- quantity: number;
22
- packaging: Packaging;
23
- };
24
-
25
- export type ProductsBasedServiceabilityCheck = {
26
- pickupPincode: string;
27
- deliveryPincode: string;
28
- products: Array<Products>;
29
- };
30
-
31
- /** @internal */
32
- export const Packaging$inboundSchema: z.ZodType<
33
- Packaging,
34
- z.ZodTypeDef,
35
- unknown
36
- > = z.object({
37
- pack_width: z.number(),
38
- pack_height: z.number(),
39
- pack_length: z.number(),
40
- pack_dry_weight: z.number(),
41
- }).transform((v) => {
42
- return remap$(v, {
43
- "pack_width": "packWidth",
44
- "pack_height": "packHeight",
45
- "pack_length": "packLength",
46
- "pack_dry_weight": "packDryWeight",
47
- });
48
- });
49
-
50
- /** @internal */
51
- export type Packaging$Outbound = {
52
- pack_width: number;
53
- pack_height: number;
54
- pack_length: number;
55
- pack_dry_weight: number;
56
- };
57
-
58
- /** @internal */
59
- export const Packaging$outboundSchema: z.ZodType<
60
- Packaging$Outbound,
61
- z.ZodTypeDef,
62
- Packaging
63
- > = z.object({
64
- packWidth: z.number(),
65
- packHeight: z.number(),
66
- packLength: z.number(),
67
- packDryWeight: z.number(),
68
- }).transform((v) => {
69
- return remap$(v, {
70
- packWidth: "pack_width",
71
- packHeight: "pack_height",
72
- packLength: "pack_length",
73
- packDryWeight: "pack_dry_weight",
74
- });
75
- });
76
-
77
- /**
78
- * @internal
79
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
80
- */
81
- export namespace Packaging$ {
82
- /** @deprecated use `Packaging$inboundSchema` instead. */
83
- export const inboundSchema = Packaging$inboundSchema;
84
- /** @deprecated use `Packaging$outboundSchema` instead. */
85
- export const outboundSchema = Packaging$outboundSchema;
86
- /** @deprecated use `Packaging$Outbound` instead. */
87
- export type Outbound = Packaging$Outbound;
88
- }
89
-
90
- export function packagingToJSON(packaging: Packaging): string {
91
- return JSON.stringify(Packaging$outboundSchema.parse(packaging));
92
- }
93
-
94
- export function packagingFromJSON(
95
- jsonString: string,
96
- ): SafeParseResult<Packaging, SDKValidationError> {
97
- return safeParse(
98
- jsonString,
99
- (x) => Packaging$inboundSchema.parse(JSON.parse(x)),
100
- `Failed to parse 'Packaging' from JSON`,
101
- );
102
- }
103
-
104
- /** @internal */
105
- export const Products$inboundSchema: z.ZodType<
106
- Products,
107
- z.ZodTypeDef,
108
- unknown
109
- > = z.object({
110
- product_id: z.string(),
111
- variant_id: z.nullable(z.string()),
112
- quantity: z.number().int(),
113
- packaging: z.lazy(() => Packaging$inboundSchema),
114
- }).transform((v) => {
115
- return remap$(v, {
116
- "product_id": "productId",
117
- "variant_id": "variantId",
118
- });
119
- });
120
-
121
- /** @internal */
122
- export type Products$Outbound = {
123
- product_id: string;
124
- variant_id: string | null;
125
- quantity: number;
126
- packaging: Packaging$Outbound;
127
- };
128
-
129
- /** @internal */
130
- export const Products$outboundSchema: z.ZodType<
131
- Products$Outbound,
132
- z.ZodTypeDef,
133
- Products
134
- > = z.object({
135
- productId: z.string(),
136
- variantId: z.nullable(z.string()),
137
- quantity: z.number().int(),
138
- packaging: z.lazy(() => Packaging$outboundSchema),
139
- }).transform((v) => {
140
- return remap$(v, {
141
- productId: "product_id",
142
- variantId: "variant_id",
143
- });
144
- });
145
-
146
- /**
147
- * @internal
148
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
149
- */
150
- export namespace Products$ {
151
- /** @deprecated use `Products$inboundSchema` instead. */
152
- export const inboundSchema = Products$inboundSchema;
153
- /** @deprecated use `Products$outboundSchema` instead. */
154
- export const outboundSchema = Products$outboundSchema;
155
- /** @deprecated use `Products$Outbound` instead. */
156
- export type Outbound = Products$Outbound;
157
- }
158
-
159
- export function productsToJSON(products: Products): string {
160
- return JSON.stringify(Products$outboundSchema.parse(products));
161
- }
162
-
163
- export function productsFromJSON(
164
- jsonString: string,
165
- ): SafeParseResult<Products, SDKValidationError> {
166
- return safeParse(
167
- jsonString,
168
- (x) => Products$inboundSchema.parse(JSON.parse(x)),
169
- `Failed to parse 'Products' from JSON`,
170
- );
171
- }
172
-
173
- /** @internal */
174
- export const ProductsBasedServiceabilityCheck$inboundSchema: z.ZodType<
175
- ProductsBasedServiceabilityCheck,
176
- z.ZodTypeDef,
177
- unknown
178
- > = z.object({
179
- pickup_pincode: z.string(),
180
- delivery_pincode: z.string(),
181
- products: z.array(z.lazy(() => Products$inboundSchema)),
182
- }).transform((v) => {
183
- return remap$(v, {
184
- "pickup_pincode": "pickupPincode",
185
- "delivery_pincode": "deliveryPincode",
186
- });
187
- });
188
-
189
- /** @internal */
190
- export type ProductsBasedServiceabilityCheck$Outbound = {
191
- pickup_pincode: string;
192
- delivery_pincode: string;
193
- products: Array<Products$Outbound>;
194
- };
195
-
196
- /** @internal */
197
- export const ProductsBasedServiceabilityCheck$outboundSchema: z.ZodType<
198
- ProductsBasedServiceabilityCheck$Outbound,
199
- z.ZodTypeDef,
200
- ProductsBasedServiceabilityCheck
201
- > = z.object({
202
- pickupPincode: z.string(),
203
- deliveryPincode: z.string(),
204
- products: z.array(z.lazy(() => Products$outboundSchema)),
205
- }).transform((v) => {
206
- return remap$(v, {
207
- pickupPincode: "pickup_pincode",
208
- deliveryPincode: "delivery_pincode",
209
- });
210
- });
211
-
212
- /**
213
- * @internal
214
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
215
- */
216
- export namespace ProductsBasedServiceabilityCheck$ {
217
- /** @deprecated use `ProductsBasedServiceabilityCheck$inboundSchema` instead. */
218
- export const inboundSchema = ProductsBasedServiceabilityCheck$inboundSchema;
219
- /** @deprecated use `ProductsBasedServiceabilityCheck$outboundSchema` instead. */
220
- export const outboundSchema = ProductsBasedServiceabilityCheck$outboundSchema;
221
- /** @deprecated use `ProductsBasedServiceabilityCheck$Outbound` instead. */
222
- export type Outbound = ProductsBasedServiceabilityCheck$Outbound;
223
- }
224
-
225
- export function productsBasedServiceabilityCheckToJSON(
226
- productsBasedServiceabilityCheck: ProductsBasedServiceabilityCheck,
227
- ): string {
228
- return JSON.stringify(
229
- ProductsBasedServiceabilityCheck$outboundSchema.parse(
230
- productsBasedServiceabilityCheck,
231
- ),
232
- );
233
- }
234
-
235
- export function productsBasedServiceabilityCheckFromJSON(
236
- jsonString: string,
237
- ): SafeParseResult<ProductsBasedServiceabilityCheck, SDKValidationError> {
238
- return safeParse(
239
- jsonString,
240
- (x) => ProductsBasedServiceabilityCheck$inboundSchema.parse(JSON.parse(x)),
241
- `Failed to parse 'ProductsBasedServiceabilityCheck' from JSON`,
242
- );
243
- }
@@ -1,141 +0,0 @@
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 { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
-
10
- export type CheckDeliveryAvailabilityRequest = {
11
- /**
12
- * delivery location pincode
13
- */
14
- pincode?: string | undefined;
15
- };
16
-
17
- /**
18
- * OK
19
- */
20
- export type CheckDeliveryAvailabilityResponseBody = {
21
- message?: string | undefined;
22
- success?: boolean | undefined;
23
- };
24
-
25
- /** @internal */
26
- export const CheckDeliveryAvailabilityRequest$inboundSchema: z.ZodType<
27
- CheckDeliveryAvailabilityRequest,
28
- z.ZodTypeDef,
29
- unknown
30
- > = z.object({
31
- pincode: z.string().default("144552"),
32
- });
33
-
34
- /** @internal */
35
- export type CheckDeliveryAvailabilityRequest$Outbound = {
36
- pincode: string;
37
- };
38
-
39
- /** @internal */
40
- export const CheckDeliveryAvailabilityRequest$outboundSchema: z.ZodType<
41
- CheckDeliveryAvailabilityRequest$Outbound,
42
- z.ZodTypeDef,
43
- CheckDeliveryAvailabilityRequest
44
- > = z.object({
45
- pincode: z.string().default("144552"),
46
- });
47
-
48
- /**
49
- * @internal
50
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
51
- */
52
- export namespace CheckDeliveryAvailabilityRequest$ {
53
- /** @deprecated use `CheckDeliveryAvailabilityRequest$inboundSchema` instead. */
54
- export const inboundSchema = CheckDeliveryAvailabilityRequest$inboundSchema;
55
- /** @deprecated use `CheckDeliveryAvailabilityRequest$outboundSchema` instead. */
56
- export const outboundSchema = CheckDeliveryAvailabilityRequest$outboundSchema;
57
- /** @deprecated use `CheckDeliveryAvailabilityRequest$Outbound` instead. */
58
- export type Outbound = CheckDeliveryAvailabilityRequest$Outbound;
59
- }
60
-
61
- export function checkDeliveryAvailabilityRequestToJSON(
62
- checkDeliveryAvailabilityRequest: CheckDeliveryAvailabilityRequest,
63
- ): string {
64
- return JSON.stringify(
65
- CheckDeliveryAvailabilityRequest$outboundSchema.parse(
66
- checkDeliveryAvailabilityRequest,
67
- ),
68
- );
69
- }
70
-
71
- export function checkDeliveryAvailabilityRequestFromJSON(
72
- jsonString: string,
73
- ): SafeParseResult<CheckDeliveryAvailabilityRequest, SDKValidationError> {
74
- return safeParse(
75
- jsonString,
76
- (x) => CheckDeliveryAvailabilityRequest$inboundSchema.parse(JSON.parse(x)),
77
- `Failed to parse 'CheckDeliveryAvailabilityRequest' from JSON`,
78
- );
79
- }
80
-
81
- /** @internal */
82
- export const CheckDeliveryAvailabilityResponseBody$inboundSchema: z.ZodType<
83
- CheckDeliveryAvailabilityResponseBody,
84
- z.ZodTypeDef,
85
- unknown
86
- > = z.object({
87
- message: z.string().optional(),
88
- success: z.boolean().optional(),
89
- });
90
-
91
- /** @internal */
92
- export type CheckDeliveryAvailabilityResponseBody$Outbound = {
93
- message?: string | undefined;
94
- success?: boolean | undefined;
95
- };
96
-
97
- /** @internal */
98
- export const CheckDeliveryAvailabilityResponseBody$outboundSchema: z.ZodType<
99
- CheckDeliveryAvailabilityResponseBody$Outbound,
100
- z.ZodTypeDef,
101
- CheckDeliveryAvailabilityResponseBody
102
- > = z.object({
103
- message: z.string().optional(),
104
- success: z.boolean().optional(),
105
- });
106
-
107
- /**
108
- * @internal
109
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
110
- */
111
- export namespace CheckDeliveryAvailabilityResponseBody$ {
112
- /** @deprecated use `CheckDeliveryAvailabilityResponseBody$inboundSchema` instead. */
113
- export const inboundSchema =
114
- CheckDeliveryAvailabilityResponseBody$inboundSchema;
115
- /** @deprecated use `CheckDeliveryAvailabilityResponseBody$outboundSchema` instead. */
116
- export const outboundSchema =
117
- CheckDeliveryAvailabilityResponseBody$outboundSchema;
118
- /** @deprecated use `CheckDeliveryAvailabilityResponseBody$Outbound` instead. */
119
- export type Outbound = CheckDeliveryAvailabilityResponseBody$Outbound;
120
- }
121
-
122
- export function checkDeliveryAvailabilityResponseBodyToJSON(
123
- checkDeliveryAvailabilityResponseBody: CheckDeliveryAvailabilityResponseBody,
124
- ): string {
125
- return JSON.stringify(
126
- CheckDeliveryAvailabilityResponseBody$outboundSchema.parse(
127
- checkDeliveryAvailabilityResponseBody,
128
- ),
129
- );
130
- }
131
-
132
- export function checkDeliveryAvailabilityResponseBodyFromJSON(
133
- jsonString: string,
134
- ): SafeParseResult<CheckDeliveryAvailabilityResponseBody, SDKValidationError> {
135
- return safeParse(
136
- jsonString,
137
- (x) =>
138
- CheckDeliveryAvailabilityResponseBody$inboundSchema.parse(JSON.parse(x)),
139
- `Failed to parse 'CheckDeliveryAvailabilityResponseBody' from JSON`,
140
- );
141
- }
@@ -1,140 +0,0 @@
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 ShippingMethodsRequestBody =
12
- | components.CartBasedServiceabilityCheck
13
- | components.ProductsBasedServiceabilityCheck;
14
-
15
- /**
16
- * OK
17
- */
18
- export type ShippingMethodsResponseBody = {
19
- message: string;
20
- success: boolean;
21
- content: components.PincodeServiceability;
22
- };
23
-
24
- /** @internal */
25
- export const ShippingMethodsRequestBody$inboundSchema: z.ZodType<
26
- ShippingMethodsRequestBody,
27
- z.ZodTypeDef,
28
- unknown
29
- > = z.union([
30
- components.CartBasedServiceabilityCheck$inboundSchema,
31
- components.ProductsBasedServiceabilityCheck$inboundSchema,
32
- ]);
33
-
34
- /** @internal */
35
- export type ShippingMethodsRequestBody$Outbound =
36
- | components.CartBasedServiceabilityCheck$Outbound
37
- | components.ProductsBasedServiceabilityCheck$Outbound;
38
-
39
- /** @internal */
40
- export const ShippingMethodsRequestBody$outboundSchema: z.ZodType<
41
- ShippingMethodsRequestBody$Outbound,
42
- z.ZodTypeDef,
43
- ShippingMethodsRequestBody
44
- > = z.union([
45
- components.CartBasedServiceabilityCheck$outboundSchema,
46
- components.ProductsBasedServiceabilityCheck$outboundSchema,
47
- ]);
48
-
49
- /**
50
- * @internal
51
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
52
- */
53
- export namespace ShippingMethodsRequestBody$ {
54
- /** @deprecated use `ShippingMethodsRequestBody$inboundSchema` instead. */
55
- export const inboundSchema = ShippingMethodsRequestBody$inboundSchema;
56
- /** @deprecated use `ShippingMethodsRequestBody$outboundSchema` instead. */
57
- export const outboundSchema = ShippingMethodsRequestBody$outboundSchema;
58
- /** @deprecated use `ShippingMethodsRequestBody$Outbound` instead. */
59
- export type Outbound = ShippingMethodsRequestBody$Outbound;
60
- }
61
-
62
- export function shippingMethodsRequestBodyToJSON(
63
- shippingMethodsRequestBody: ShippingMethodsRequestBody,
64
- ): string {
65
- return JSON.stringify(
66
- ShippingMethodsRequestBody$outboundSchema.parse(shippingMethodsRequestBody),
67
- );
68
- }
69
-
70
- export function shippingMethodsRequestBodyFromJSON(
71
- jsonString: string,
72
- ): SafeParseResult<ShippingMethodsRequestBody, SDKValidationError> {
73
- return safeParse(
74
- jsonString,
75
- (x) => ShippingMethodsRequestBody$inboundSchema.parse(JSON.parse(x)),
76
- `Failed to parse 'ShippingMethodsRequestBody' from JSON`,
77
- );
78
- }
79
-
80
- /** @internal */
81
- export const ShippingMethodsResponseBody$inboundSchema: z.ZodType<
82
- ShippingMethodsResponseBody,
83
- z.ZodTypeDef,
84
- unknown
85
- > = z.object({
86
- message: z.string(),
87
- success: z.boolean(),
88
- content: components.PincodeServiceability$inboundSchema,
89
- });
90
-
91
- /** @internal */
92
- export type ShippingMethodsResponseBody$Outbound = {
93
- message: string;
94
- success: boolean;
95
- content: components.PincodeServiceability$Outbound;
96
- };
97
-
98
- /** @internal */
99
- export const ShippingMethodsResponseBody$outboundSchema: z.ZodType<
100
- ShippingMethodsResponseBody$Outbound,
101
- z.ZodTypeDef,
102
- ShippingMethodsResponseBody
103
- > = z.object({
104
- message: z.string(),
105
- success: z.boolean(),
106
- content: components.PincodeServiceability$outboundSchema,
107
- });
108
-
109
- /**
110
- * @internal
111
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
112
- */
113
- export namespace ShippingMethodsResponseBody$ {
114
- /** @deprecated use `ShippingMethodsResponseBody$inboundSchema` instead. */
115
- export const inboundSchema = ShippingMethodsResponseBody$inboundSchema;
116
- /** @deprecated use `ShippingMethodsResponseBody$outboundSchema` instead. */
117
- export const outboundSchema = ShippingMethodsResponseBody$outboundSchema;
118
- /** @deprecated use `ShippingMethodsResponseBody$Outbound` instead. */
119
- export type Outbound = ShippingMethodsResponseBody$Outbound;
120
- }
121
-
122
- export function shippingMethodsResponseBodyToJSON(
123
- shippingMethodsResponseBody: ShippingMethodsResponseBody,
124
- ): string {
125
- return JSON.stringify(
126
- ShippingMethodsResponseBody$outboundSchema.parse(
127
- shippingMethodsResponseBody,
128
- ),
129
- );
130
- }
131
-
132
- export function shippingMethodsResponseBodyFromJSON(
133
- jsonString: string,
134
- ): SafeParseResult<ShippingMethodsResponseBody, SDKValidationError> {
135
- return safeParse(
136
- jsonString,
137
- (x) => ShippingMethodsResponseBody$inboundSchema.parse(JSON.parse(x)),
138
- `Failed to parse 'ShippingMethodsResponseBody' from JSON`,
139
- );
140
- }