ce-storefront 0.12.0 → 0.12.2
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/docs/sdks/carts/README.md +1 -0
- package/docs/sdks/shipping/README.md +1 -1
- package/esm/funcs/cartsApplyCoupon.d.ts +1 -1
- package/esm/funcs/cartsApplyCoupon.d.ts.map +1 -1
- package/esm/funcs/cartsApplyCoupon.js +2 -2
- package/esm/funcs/cartsApplyCoupon.js.map +1 -1
- package/esm/funcs/shippingCheckServiceability.d.ts +1 -1
- package/esm/funcs/shippingCheckServiceability.js +1 -1
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/components/cartbasedserviceabilitycheck.d.ts +31 -0
- package/esm/models/components/cartbasedserviceabilitycheck.d.ts.map +1 -0
- package/esm/models/components/cartbasedserviceabilitycheck.js +44 -0
- package/esm/models/components/cartbasedserviceabilitycheck.js.map +1 -0
- package/esm/models/components/index.d.ts +2 -0
- package/esm/models/components/index.d.ts.map +1 -1
- package/esm/models/components/index.js +2 -0
- package/esm/models/components/index.js.map +1 -1
- package/esm/models/components/order.d.ts +4 -4
- package/esm/models/components/order.d.ts.map +1 -1
- package/esm/models/components/order.js +8 -8
- package/esm/models/components/order.js.map +1 -1
- package/esm/models/components/orderdetail.d.ts +4 -4
- package/esm/models/components/orderdetail.d.ts.map +1 -1
- package/esm/models/components/orderdetail.js +8 -8
- package/esm/models/components/orderdetail.js.map +1 -1
- package/esm/models/components/productsbasedserviceabilitycheck.d.ts +95 -0
- package/esm/models/components/productsbasedserviceabilitycheck.d.ts.map +1 -0
- package/esm/models/components/productsbasedserviceabilitycheck.js +132 -0
- package/esm/models/components/productsbasedserviceabilitycheck.js.map +1 -0
- package/esm/models/errors/badrequest.d.ts +8 -8
- package/esm/models/errors/badrequest.d.ts.map +1 -1
- package/esm/models/errors/badrequest.js +8 -10
- package/esm/models/errors/badrequest.js.map +1 -1
- package/esm/models/errors/notfound.d.ts +8 -8
- package/esm/models/errors/notfound.d.ts.map +1 -1
- package/esm/models/errors/notfound.js +8 -10
- package/esm/models/errors/notfound.js.map +1 -1
- package/esm/models/errors/unauthorized.d.ts +5 -5
- package/esm/models/errors/unauthorized.d.ts.map +1 -1
- package/esm/models/errors/unauthorized.js +5 -6
- package/esm/models/errors/unauthorized.js.map +1 -1
- package/esm/models/operations/shippingmethods.d.ts +2 -8
- package/esm/models/operations/shippingmethods.d.ts.map +1 -1
- package/esm/models/operations/shippingmethods.js +8 -19
- package/esm/models/operations/shippingmethods.js.map +1 -1
- package/esm/sdk/shipping.d.ts +1 -1
- package/esm/sdk/shipping.js +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/cartsApplyCoupon.ts +5 -1
- package/src/funcs/shippingCheckServiceability.ts +1 -1
- package/src/lib/config.ts +2 -2
- package/src/models/components/cartbasedserviceabilitycheck.ts +83 -0
- package/src/models/components/index.ts +2 -0
- package/src/models/components/order.ts +12 -12
- package/src/models/components/orderdetail.ts +12 -12
- package/src/models/components/productsbasedserviceabilitycheck.ts +243 -0
- package/src/models/errors/badrequest.ts +16 -16
- package/src/models/errors/notfound.ts +16 -16
- package/src/models/errors/unauthorized.ts +10 -10
- package/src/models/operations/shippingmethods.ts +14 -27
- package/src/sdk/shipping.ts +1 -1
|
@@ -12,16 +12,15 @@ export class Unauthorized extends Error {
|
|
|
12
12
|
this.data$ = err;
|
|
13
13
|
if (err.success != null)
|
|
14
14
|
this.success = err.success;
|
|
15
|
-
|
|
16
|
-
this.code = err.code;
|
|
15
|
+
this.code = err.code;
|
|
17
16
|
this.name = "Unauthorized";
|
|
18
17
|
}
|
|
19
18
|
}
|
|
20
19
|
/** @internal */
|
|
21
20
|
export const Unauthorized$inboundSchema = z.object({
|
|
22
|
-
message: z.string()
|
|
21
|
+
message: z.string(),
|
|
23
22
|
success: z.boolean().default(false),
|
|
24
|
-
code: z.string()
|
|
23
|
+
code: z.string(),
|
|
25
24
|
})
|
|
26
25
|
.transform((v) => {
|
|
27
26
|
return new Unauthorized(v);
|
|
@@ -30,9 +29,9 @@ export const Unauthorized$inboundSchema = z.object({
|
|
|
30
29
|
export const Unauthorized$outboundSchema = z.instanceof(Unauthorized)
|
|
31
30
|
.transform(v => v.data$)
|
|
32
31
|
.pipe(z.object({
|
|
33
|
-
message: z.string()
|
|
32
|
+
message: z.string(),
|
|
34
33
|
success: z.boolean().default(false),
|
|
35
|
-
code: z.string()
|
|
34
|
+
code: z.string(),
|
|
36
35
|
}));
|
|
37
36
|
/**
|
|
38
37
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unauthorized.js","sourceRoot":"","sources":["../../../src/models/errors/unauthorized.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAWzB;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,KAAK;IAOrC,YAAY,GAAqB;QAC/B,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,IAAI,oBAAoB,CAAC;QACpD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC;QAEjB,IAAI,GAAG,CAAC,OAAO,IAAI,IAAI;YAAE,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC;QACpD,IAAI,
|
|
1
|
+
{"version":3,"file":"unauthorized.js","sourceRoot":"","sources":["../../../src/models/errors/unauthorized.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAWzB;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,KAAK;IAOrC,YAAY,GAAqB;QAC/B,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,IAAI,oBAAoB,CAAC;QACpD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC;QAEjB,IAAI,GAAG,CAAC,OAAO,IAAI,IAAI;YAAE,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC;QACpD,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;QAErB,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;IAC7B,CAAC;CACF;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,0BAA0B,GAInC,CAAC,CAAC,MAAM,CAAC;IACX,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IACnC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;CACjB,CAAC;KACC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;IACf,OAAO,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC;AAC7B,CAAC,CAAC,CAAC;AASL,gBAAgB;AAChB,MAAM,CAAC,MAAM,2BAA2B,GAIpC,CAAC,CAAC,UAAU,CAAC,YAAY,CAAC;KAC3B,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;KACvB,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;IACb,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IACnC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;CACjB,CAAC,CAAC,CAAC;AAEN;;;GAGG;AACH,MAAM,KAAW,aAAa,CAO7B;AAPD,WAAiB,aAAa;IAC5B,4DAA4D;IAC/C,2BAAa,GAAG,0BAA0B,CAAC;IACxD,6DAA6D;IAChD,4BAAc,GAAG,2BAA2B,CAAC;AAG5D,CAAC,EAPgB,aAAa,KAAb,aAAa,QAO7B"}
|
|
@@ -2,10 +2,7 @@ import * as z from "zod";
|
|
|
2
2
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
3
3
|
import * as components from "../components/index.js";
|
|
4
4
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
5
|
-
export type ShippingMethodsRequestBody =
|
|
6
|
-
deliveryPincode: string;
|
|
7
|
-
cartId: string;
|
|
8
|
-
};
|
|
5
|
+
export type ShippingMethodsRequestBody = components.CartBasedServiceabilityCheck | components.ProductsBasedServiceabilityCheck;
|
|
9
6
|
/**
|
|
10
7
|
* OK
|
|
11
8
|
*/
|
|
@@ -17,10 +14,7 @@ export type ShippingMethodsResponseBody = {
|
|
|
17
14
|
/** @internal */
|
|
18
15
|
export declare const ShippingMethodsRequestBody$inboundSchema: z.ZodType<ShippingMethodsRequestBody, z.ZodTypeDef, unknown>;
|
|
19
16
|
/** @internal */
|
|
20
|
-
export type ShippingMethodsRequestBody$Outbound =
|
|
21
|
-
delivery_pincode: string;
|
|
22
|
-
cart_id: string;
|
|
23
|
-
};
|
|
17
|
+
export type ShippingMethodsRequestBody$Outbound = components.CartBasedServiceabilityCheck$Outbound | components.ProductsBasedServiceabilityCheck$Outbound;
|
|
24
18
|
/** @internal */
|
|
25
19
|
export declare const ShippingMethodsRequestBody$outboundSchema: z.ZodType<ShippingMethodsRequestBody$Outbound, z.ZodTypeDef, ShippingMethodsRequestBody>;
|
|
26
20
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shippingmethods.d.ts","sourceRoot":"","sources":["../../../src/models/operations/shippingmethods.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"shippingmethods.d.ts","sourceRoot":"","sources":["../../../src/models/operations/shippingmethods.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;A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E,UAAU,CAAC,8BAA8B,CAAC;CACpD,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,0CAA0C,EAAE,CAAC,CAAC,OAAO,CAChE,oCAAoC,EACpC,CAAC,CAAC,UAAU,EACZ,2BAA2B,CAK3B,CAAC;AAEH;;;GAGG;AACH,yBAAiB,4BAA4B,CAAC;IAC5C,2EAA2E;IACpE,MAAM,aAAa,+DAA4C,CAAC;IACvE,4EAA4E;IACrE,MAAM,cAAc,4FAA6C,CAAC;IACzE,sEAAsE;IACtE,KAAY,QAAQ,GAAG,oCAAoC,CAAC;CAC7D;AAED,wBAAgB,iCAAiC,CAC/C,2BAA2B,EAAE,2BAA2B,GACvD,MAAM,CAMR;AAED,wBAAgB,mCAAmC,CACjD,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,2BAA2B,EAAE,kBAAkB,CAAC,CAMlE"}
|
|
@@ -2,29 +2,18 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
import * as z from "zod";
|
|
5
|
-
import { remap as remap$ } from "../../lib/primitives.js";
|
|
6
5
|
import { safeParse } from "../../lib/schemas.js";
|
|
7
6
|
import * as components from "../components/index.js";
|
|
8
7
|
/** @internal */
|
|
9
|
-
export const ShippingMethodsRequestBody$inboundSchema = z.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return remap$(v, {
|
|
14
|
-
"delivery_pincode": "deliveryPincode",
|
|
15
|
-
"cart_id": "cartId",
|
|
16
|
-
});
|
|
17
|
-
});
|
|
8
|
+
export const ShippingMethodsRequestBody$inboundSchema = z.union([
|
|
9
|
+
components.CartBasedServiceabilityCheck$inboundSchema,
|
|
10
|
+
components.ProductsBasedServiceabilityCheck$inboundSchema,
|
|
11
|
+
]);
|
|
18
12
|
/** @internal */
|
|
19
|
-
export const ShippingMethodsRequestBody$outboundSchema = z.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return remap$(v, {
|
|
24
|
-
deliveryPincode: "delivery_pincode",
|
|
25
|
-
cartId: "cart_id",
|
|
26
|
-
});
|
|
27
|
-
});
|
|
13
|
+
export const ShippingMethodsRequestBody$outboundSchema = z.union([
|
|
14
|
+
components.CartBasedServiceabilityCheck$outboundSchema,
|
|
15
|
+
components.ProductsBasedServiceabilityCheck$outboundSchema,
|
|
16
|
+
]);
|
|
28
17
|
/**
|
|
29
18
|
* @internal
|
|
30
19
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shippingmethods.js","sourceRoot":"","sources":["../../../src/models/operations/shippingmethods.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"shippingmethods.js","sourceRoot":"","sources":["../../../src/models/operations/shippingmethods.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AAgBrD,gBAAgB;AAChB,MAAM,CAAC,MAAM,wCAAwC,GAIjD,CAAC,CAAC,KAAK,CAAC;IACV,UAAU,CAAC,0CAA0C;IACrD,UAAU,CAAC,8CAA8C;CAC1D,CAAC,CAAC;AAOH,gBAAgB;AAChB,MAAM,CAAC,MAAM,yCAAyC,GAIlD,CAAC,CAAC,KAAK,CAAC;IACV,UAAU,CAAC,2CAA2C;IACtD,UAAU,CAAC,+CAA+C;CAC3D,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,KAAW,2BAA2B,CAO3C;AAPD,WAAiB,2BAA2B;IAC1C,0EAA0E;IAC7D,yCAAa,GAAG,wCAAwC,CAAC;IACtE,2EAA2E;IAC9D,0CAAc,GAAG,yCAA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mC,CACjD,UAAkB;IAElB,OAAO,SAAS,CACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CAAC,yCAAyC,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EACrE,yDAAyD,CAC1D,CAAC;AACJ,CAAC"}
|
package/esm/sdk/shipping.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export declare class Shipping extends ClientSDK {
|
|
|
12
12
|
* Check serviceability
|
|
13
13
|
*
|
|
14
14
|
* @remarks
|
|
15
|
-
* Checking serviceability for a given pincode based provided cart_id.
|
|
15
|
+
* Checking serviceability for a given pincode based provided cart_id or based on products list & pickup pincode provided.
|
|
16
16
|
*/
|
|
17
17
|
checkServiceability(request?: operations.ShippingMethodsRequestBody | undefined, options?: RequestOptions): Promise<operations.ShippingMethodsResponseBody>;
|
|
18
18
|
}
|
package/esm/sdk/shipping.js
CHANGED
|
@@ -19,7 +19,7 @@ export class Shipping extends ClientSDK {
|
|
|
19
19
|
* Check serviceability
|
|
20
20
|
*
|
|
21
21
|
* @remarks
|
|
22
|
-
* Checking serviceability for a given pincode based provided cart_id.
|
|
22
|
+
* Checking serviceability for a given pincode based provided cart_id or based on products list & pickup pincode provided.
|
|
23
23
|
*/
|
|
24
24
|
async checkServiceability(request, options) {
|
|
25
25
|
return unwrapAsync(shippingCheckServiceability(this, request, options));
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -39,6 +39,7 @@ export function cartsApplyCoupon(
|
|
|
39
39
|
operations.ApplyCouponResponseBody,
|
|
40
40
|
| errors.BadRequest
|
|
41
41
|
| errors.Unauthorized
|
|
42
|
+
| errors.NotFound
|
|
42
43
|
| CeError
|
|
43
44
|
| SDKValidationError
|
|
44
45
|
| UnexpectedClientError
|
|
@@ -65,6 +66,7 @@ async function $do(
|
|
|
65
66
|
operations.ApplyCouponResponseBody,
|
|
66
67
|
| errors.BadRequest
|
|
67
68
|
| errors.Unauthorized
|
|
69
|
+
| errors.NotFound
|
|
68
70
|
| CeError
|
|
69
71
|
| SDKValidationError
|
|
70
72
|
| UnexpectedClientError
|
|
@@ -135,7 +137,7 @@ async function $do(
|
|
|
135
137
|
|
|
136
138
|
const doResult = await client._do(req, {
|
|
137
139
|
context,
|
|
138
|
-
errorCodes: ["400", "401", "4XX", "5XX"],
|
|
140
|
+
errorCodes: ["400", "401", "404", "4XX", "5XX"],
|
|
139
141
|
retryConfig: context.retryConfig,
|
|
140
142
|
retryCodes: context.retryCodes,
|
|
141
143
|
});
|
|
@@ -152,6 +154,7 @@ async function $do(
|
|
|
152
154
|
operations.ApplyCouponResponseBody,
|
|
153
155
|
| errors.BadRequest
|
|
154
156
|
| errors.Unauthorized
|
|
157
|
+
| errors.NotFound
|
|
155
158
|
| CeError
|
|
156
159
|
| SDKValidationError
|
|
157
160
|
| UnexpectedClientError
|
|
@@ -163,6 +166,7 @@ async function $do(
|
|
|
163
166
|
M.json(200, operations.ApplyCouponResponseBody$inboundSchema),
|
|
164
167
|
M.jsonErr(400, errors.BadRequest$inboundSchema),
|
|
165
168
|
M.jsonErr(401, errors.Unauthorized$inboundSchema),
|
|
169
|
+
M.jsonErr(404, errors.NotFound$inboundSchema),
|
|
166
170
|
M.fail("4XX"),
|
|
167
171
|
M.fail("5XX"),
|
|
168
172
|
)(response, { extraFields: responseFields });
|
|
@@ -27,7 +27,7 @@ import { Result } from "../types/fp.js";
|
|
|
27
27
|
* Check serviceability
|
|
28
28
|
*
|
|
29
29
|
* @remarks
|
|
30
|
-
* Checking serviceability for a given pincode based provided cart_id.
|
|
30
|
+
* Checking serviceability for a given pincode based provided cart_id or based on products list & pickup pincode provided.
|
|
31
31
|
*/
|
|
32
32
|
export function shippingCheckServiceability(
|
|
33
33
|
client: CeStorefrontCore,
|
package/src/lib/config.ts
CHANGED
|
@@ -76,7 +76,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
76
76
|
export const SDK_METADATA = {
|
|
77
77
|
language: "typescript",
|
|
78
78
|
openapiDocVersion: "1.0",
|
|
79
|
-
sdkVersion: "0.12.
|
|
79
|
+
sdkVersion: "0.12.2",
|
|
80
80
|
genVersion: "2.610.0",
|
|
81
|
-
userAgent: "speakeasy-sdk/typescript 0.12.
|
|
81
|
+
userAgent: "speakeasy-sdk/typescript 0.12.2 2.610.0 1.0 ce-storefront",
|
|
82
82
|
} as const;
|
|
@@ -0,0 +1,83 @@
|
|
|
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 CartBasedServiceabilityCheck = {
|
|
12
|
+
deliveryPincode: string;
|
|
13
|
+
cartId: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/** @internal */
|
|
17
|
+
export const CartBasedServiceabilityCheck$inboundSchema: z.ZodType<
|
|
18
|
+
CartBasedServiceabilityCheck,
|
|
19
|
+
z.ZodTypeDef,
|
|
20
|
+
unknown
|
|
21
|
+
> = z.object({
|
|
22
|
+
delivery_pincode: z.string(),
|
|
23
|
+
cart_id: z.string(),
|
|
24
|
+
}).transform((v) => {
|
|
25
|
+
return remap$(v, {
|
|
26
|
+
"delivery_pincode": "deliveryPincode",
|
|
27
|
+
"cart_id": "cartId",
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
/** @internal */
|
|
32
|
+
export type CartBasedServiceabilityCheck$Outbound = {
|
|
33
|
+
delivery_pincode: string;
|
|
34
|
+
cart_id: string;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/** @internal */
|
|
38
|
+
export const CartBasedServiceabilityCheck$outboundSchema: z.ZodType<
|
|
39
|
+
CartBasedServiceabilityCheck$Outbound,
|
|
40
|
+
z.ZodTypeDef,
|
|
41
|
+
CartBasedServiceabilityCheck
|
|
42
|
+
> = z.object({
|
|
43
|
+
deliveryPincode: z.string(),
|
|
44
|
+
cartId: z.string(),
|
|
45
|
+
}).transform((v) => {
|
|
46
|
+
return remap$(v, {
|
|
47
|
+
deliveryPincode: "delivery_pincode",
|
|
48
|
+
cartId: "cart_id",
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* @internal
|
|
54
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
55
|
+
*/
|
|
56
|
+
export namespace CartBasedServiceabilityCheck$ {
|
|
57
|
+
/** @deprecated use `CartBasedServiceabilityCheck$inboundSchema` instead. */
|
|
58
|
+
export const inboundSchema = CartBasedServiceabilityCheck$inboundSchema;
|
|
59
|
+
/** @deprecated use `CartBasedServiceabilityCheck$outboundSchema` instead. */
|
|
60
|
+
export const outboundSchema = CartBasedServiceabilityCheck$outboundSchema;
|
|
61
|
+
/** @deprecated use `CartBasedServiceabilityCheck$Outbound` instead. */
|
|
62
|
+
export type Outbound = CartBasedServiceabilityCheck$Outbound;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function cartBasedServiceabilityCheckToJSON(
|
|
66
|
+
cartBasedServiceabilityCheck: CartBasedServiceabilityCheck,
|
|
67
|
+
): string {
|
|
68
|
+
return JSON.stringify(
|
|
69
|
+
CartBasedServiceabilityCheck$outboundSchema.parse(
|
|
70
|
+
cartBasedServiceabilityCheck,
|
|
71
|
+
),
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function cartBasedServiceabilityCheckFromJSON(
|
|
76
|
+
jsonString: string,
|
|
77
|
+
): SafeParseResult<CartBasedServiceabilityCheck, SDKValidationError> {
|
|
78
|
+
return safeParse(
|
|
79
|
+
jsonString,
|
|
80
|
+
(x) => CartBasedServiceabilityCheck$inboundSchema.parse(JSON.parse(x)),
|
|
81
|
+
`Failed to parse 'CartBasedServiceabilityCheck' from JSON`,
|
|
82
|
+
);
|
|
83
|
+
}
|
|
@@ -8,6 +8,7 @@ export * from "./banktransfer.js";
|
|
|
8
8
|
export * from "./booleanattribute.js";
|
|
9
9
|
export * from "./cardpayment.js";
|
|
10
10
|
export * from "./cart.js";
|
|
11
|
+
export * from "./cartbasedserviceabilitycheck.js";
|
|
11
12
|
export * from "./cartitem.js";
|
|
12
13
|
export * from "./category.js";
|
|
13
14
|
export * from "./colorattribute.js";
|
|
@@ -50,6 +51,7 @@ export * from "./productimage.js";
|
|
|
50
51
|
export * from "./productpricing.js";
|
|
51
52
|
export * from "./productpromotion.js";
|
|
52
53
|
export * from "./productreview.js";
|
|
54
|
+
export * from "./productsbasedserviceabilitycheck.js";
|
|
53
55
|
export * from "./productshipping.js";
|
|
54
56
|
export * from "./productsubscription.js";
|
|
55
57
|
export * from "./productvideo.js";
|
|
@@ -170,8 +170,8 @@ export type Order = {
|
|
|
170
170
|
subtotal?: number | undefined;
|
|
171
171
|
itemTotalTax?: number | undefined;
|
|
172
172
|
subtotalIncludingTax?: number | undefined;
|
|
173
|
-
|
|
174
|
-
|
|
173
|
+
shippingEstimatedCost?: number | undefined;
|
|
174
|
+
shippingDiscountAmount?: number | undefined;
|
|
175
175
|
shippingAmount?: number | undefined;
|
|
176
176
|
shippingTaxRate?: number | undefined;
|
|
177
177
|
shippingTaxAmount?: number | undefined;
|
|
@@ -683,8 +683,8 @@ export const Order$inboundSchema: z.ZodType<Order, z.ZodTypeDef, unknown> = z
|
|
|
683
683
|
subtotal: z.number().optional(),
|
|
684
684
|
item_total_tax: z.number().optional(),
|
|
685
685
|
subtotal_including_tax: z.number().optional(),
|
|
686
|
-
|
|
687
|
-
|
|
686
|
+
shipping_estimated_cost: z.number().optional(),
|
|
687
|
+
shipping_discount_amount: z.number().optional(),
|
|
688
688
|
shipping_amount: z.number().optional(),
|
|
689
689
|
shipping_tax_rate: z.number().optional(),
|
|
690
690
|
shipping_tax_amount: z.number().optional(),
|
|
@@ -740,8 +740,8 @@ export const Order$inboundSchema: z.ZodType<Order, z.ZodTypeDef, unknown> = z
|
|
|
740
740
|
"on_subscription": "onSubscription",
|
|
741
741
|
"item_total_tax": "itemTotalTax",
|
|
742
742
|
"subtotal_including_tax": "subtotalIncludingTax",
|
|
743
|
-
"
|
|
744
|
-
"
|
|
743
|
+
"shipping_estimated_cost": "shippingEstimatedCost",
|
|
744
|
+
"shipping_discount_amount": "shippingDiscountAmount",
|
|
745
745
|
"shipping_amount": "shippingAmount",
|
|
746
746
|
"shipping_tax_rate": "shippingTaxRate",
|
|
747
747
|
"shipping_tax_amount": "shippingTaxAmount",
|
|
@@ -795,8 +795,8 @@ export type Order$Outbound = {
|
|
|
795
795
|
subtotal?: number | undefined;
|
|
796
796
|
item_total_tax?: number | undefined;
|
|
797
797
|
subtotal_including_tax?: number | undefined;
|
|
798
|
-
|
|
799
|
-
|
|
798
|
+
shipping_estimated_cost?: number | undefined;
|
|
799
|
+
shipping_discount_amount?: number | undefined;
|
|
800
800
|
shipping_amount?: number | undefined;
|
|
801
801
|
shipping_tax_rate?: number | undefined;
|
|
802
802
|
shipping_tax_amount?: number | undefined;
|
|
@@ -856,8 +856,8 @@ export const Order$outboundSchema: z.ZodType<
|
|
|
856
856
|
subtotal: z.number().optional(),
|
|
857
857
|
itemTotalTax: z.number().optional(),
|
|
858
858
|
subtotalIncludingTax: z.number().optional(),
|
|
859
|
-
|
|
860
|
-
|
|
859
|
+
shippingEstimatedCost: z.number().optional(),
|
|
860
|
+
shippingDiscountAmount: z.number().optional(),
|
|
861
861
|
shippingAmount: z.number().optional(),
|
|
862
862
|
shippingTaxRate: z.number().optional(),
|
|
863
863
|
shippingTaxAmount: z.number().optional(),
|
|
@@ -909,8 +909,8 @@ export const Order$outboundSchema: z.ZodType<
|
|
|
909
909
|
onSubscription: "on_subscription",
|
|
910
910
|
itemTotalTax: "item_total_tax",
|
|
911
911
|
subtotalIncludingTax: "subtotal_including_tax",
|
|
912
|
-
|
|
913
|
-
|
|
912
|
+
shippingEstimatedCost: "shipping_estimated_cost",
|
|
913
|
+
shippingDiscountAmount: "shipping_discount_amount",
|
|
914
914
|
shippingAmount: "shipping_amount",
|
|
915
915
|
shippingTaxRate: "shipping_tax_rate",
|
|
916
916
|
shippingTaxAmount: "shipping_tax_amount",
|
|
@@ -180,8 +180,8 @@ export type OrderDetail = {
|
|
|
180
180
|
subtotal?: number | undefined;
|
|
181
181
|
itemTotalTax?: number | undefined;
|
|
182
182
|
subtotalIncludingTax?: number | undefined;
|
|
183
|
-
|
|
184
|
-
|
|
183
|
+
shippingEstimatedCost?: number | undefined;
|
|
184
|
+
shippingDiscountAmount?: number | undefined;
|
|
185
185
|
shippingAmount?: number | undefined;
|
|
186
186
|
shippingTaxRate?: number | undefined;
|
|
187
187
|
shippingTaxAmount?: number | undefined;
|
|
@@ -714,8 +714,8 @@ export const OrderDetail$inboundSchema: z.ZodType<
|
|
|
714
714
|
subtotal: z.number().optional(),
|
|
715
715
|
item_total_tax: z.number().optional(),
|
|
716
716
|
subtotal_including_tax: z.number().optional(),
|
|
717
|
-
|
|
718
|
-
|
|
717
|
+
shipping_estimated_cost: z.number().optional(),
|
|
718
|
+
shipping_discount_amount: z.number().optional(),
|
|
719
719
|
shipping_amount: z.number().optional(),
|
|
720
720
|
shipping_tax_rate: z.number().optional(),
|
|
721
721
|
shipping_tax_amount: z.number().optional(),
|
|
@@ -770,8 +770,8 @@ export const OrderDetail$inboundSchema: z.ZodType<
|
|
|
770
770
|
"on_subscription": "onSubscription",
|
|
771
771
|
"item_total_tax": "itemTotalTax",
|
|
772
772
|
"subtotal_including_tax": "subtotalIncludingTax",
|
|
773
|
-
"
|
|
774
|
-
"
|
|
773
|
+
"shipping_estimated_cost": "shippingEstimatedCost",
|
|
774
|
+
"shipping_discount_amount": "shippingDiscountAmount",
|
|
775
775
|
"shipping_amount": "shippingAmount",
|
|
776
776
|
"shipping_tax_rate": "shippingTaxRate",
|
|
777
777
|
"shipping_tax_amount": "shippingTaxAmount",
|
|
@@ -825,8 +825,8 @@ export type OrderDetail$Outbound = {
|
|
|
825
825
|
subtotal?: number | undefined;
|
|
826
826
|
item_total_tax?: number | undefined;
|
|
827
827
|
subtotal_including_tax?: number | undefined;
|
|
828
|
-
|
|
829
|
-
|
|
828
|
+
shipping_estimated_cost?: number | undefined;
|
|
829
|
+
shipping_discount_amount?: number | undefined;
|
|
830
830
|
shipping_amount?: number | undefined;
|
|
831
831
|
shipping_tax_rate?: number | undefined;
|
|
832
832
|
shipping_tax_amount?: number | undefined;
|
|
@@ -891,8 +891,8 @@ export const OrderDetail$outboundSchema: z.ZodType<
|
|
|
891
891
|
subtotal: z.number().optional(),
|
|
892
892
|
itemTotalTax: z.number().optional(),
|
|
893
893
|
subtotalIncludingTax: z.number().optional(),
|
|
894
|
-
|
|
895
|
-
|
|
894
|
+
shippingEstimatedCost: z.number().optional(),
|
|
895
|
+
shippingDiscountAmount: z.number().optional(),
|
|
896
896
|
shippingAmount: z.number().optional(),
|
|
897
897
|
shippingTaxRate: z.number().optional(),
|
|
898
898
|
shippingTaxAmount: z.number().optional(),
|
|
@@ -945,8 +945,8 @@ export const OrderDetail$outboundSchema: z.ZodType<
|
|
|
945
945
|
onSubscription: "on_subscription",
|
|
946
946
|
itemTotalTax: "item_total_tax",
|
|
947
947
|
subtotalIncludingTax: "subtotal_including_tax",
|
|
948
|
-
|
|
949
|
-
|
|
948
|
+
shippingEstimatedCost: "shipping_estimated_cost",
|
|
949
|
+
shippingDiscountAmount: "shipping_discount_amount",
|
|
950
950
|
shippingAmount: "shipping_amount",
|
|
951
951
|
shippingTaxRate: "shipping_tax_rate",
|
|
952
952
|
shippingTaxAmount: "shipping_tax_amount",
|