ce-storefront 0.14.0 → 0.14.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/catalog/README.md +7 -3
- package/esm/funcs/catalogGetProductDetail.js +1 -1
- package/esm/funcs/catalogGetProductDetail.js.map +1 -1
- package/esm/funcs/catalogGetVariantDetail.js +1 -1
- package/esm/funcs/catalogGetVariantDetail.js.map +1 -1
- package/esm/funcs/catalogListCrosssellProducts.js +1 -1
- package/esm/funcs/catalogListCrosssellProducts.js.map +1 -1
- package/esm/funcs/catalogListProductVariants.js +1 -1
- package/esm/funcs/catalogListProductVariants.js.map +1 -1
- package/esm/funcs/catalogListProducts.js +1 -1
- package/esm/funcs/catalogListProducts.js.map +1 -1
- package/esm/funcs/catalogListSimilarProducts.js +1 -1
- package/esm/funcs/catalogListSimilarProducts.js.map +1 -1
- package/esm/funcs/catalogListSkus.js +1 -1
- package/esm/funcs/catalogListSkus.js.map +1 -1
- package/esm/funcs/catalogListUpsellProducts.js +1 -1
- package/esm/funcs/catalogListUpsellProducts.js.map +1 -1
- package/esm/funcs/catalogSearchProducts.d.ts +1 -2
- package/esm/funcs/catalogSearchProducts.d.ts.map +1 -1
- package/esm/funcs/catalogSearchProducts.js +4 -4
- package/esm/funcs/catalogSearchProducts.js.map +1 -1
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/lib/files.d.ts +5 -0
- package/esm/lib/files.d.ts.map +1 -1
- package/esm/lib/files.js +40 -0
- package/esm/lib/files.js.map +1 -1
- package/esm/lib/security.d.ts +2 -2
- package/esm/lib/security.d.ts.map +1 -1
- package/esm/models/components/cart.d.ts +12 -12
- package/esm/models/components/cart.d.ts.map +1 -1
- package/esm/models/components/cart.js +12 -12
- package/esm/models/components/cart.js.map +1 -1
- package/esm/models/components/coloroption.js +1 -1
- package/esm/models/components/coloroption.js.map +1 -1
- package/esm/models/components/customeraddress.js +1 -1
- package/esm/models/components/customeraddress.js.map +1 -1
- package/esm/models/components/customeraddressinput.js +1 -1
- package/esm/models/components/customeraddressinput.js.map +1 -1
- package/esm/models/components/discountbasedpromotion.js +1 -1
- package/esm/models/components/discountbasedpromotion.js.map +1 -1
- package/esm/models/components/fixedpricepromotion.js +1 -1
- package/esm/models/components/fixedpricepromotion.js.map +1 -1
- package/esm/models/components/freegoodspromotion.js +1 -1
- package/esm/models/components/freegoodspromotion.js.map +1 -1
- package/esm/models/components/generateotpwithemail.js +1 -1
- package/esm/models/components/generateotpwithemail.js.map +1 -1
- package/esm/models/components/juspaypaymentinfo.d.ts.map +1 -1
- package/esm/models/components/juspaypaymentinfo.js +3 -2
- package/esm/models/components/juspaypaymentinfo.js.map +1 -1
- package/esm/models/components/orderpayment.d.ts +2 -2
- package/esm/models/components/orderpayment.d.ts.map +1 -1
- package/esm/models/components/orderpayment.js +2 -2
- package/esm/models/components/orderpayment.js.map +1 -1
- package/esm/models/components/payupaymentinfo.js +3 -3
- package/esm/models/components/payupaymentinfo.js.map +1 -1
- package/esm/models/components/productpromotion.d.ts +20 -20
- package/esm/models/components/productpromotion.d.ts.map +1 -1
- package/esm/models/components/productpromotion.js +16 -16
- package/esm/models/components/productpromotion.js.map +1 -1
- package/esm/models/components/searchproduct.d.ts +0 -5
- package/esm/models/components/searchproduct.d.ts.map +1 -1
- package/esm/models/components/searchproduct.js +0 -11
- package/esm/models/components/searchproduct.js.map +1 -1
- package/esm/models/components/singleselectoption.js +1 -1
- package/esm/models/components/singleselectoption.js.map +1 -1
- package/esm/models/components/volumebasedpromotion.js +1 -1
- package/esm/models/components/volumebasedpromotion.js.map +1 -1
- package/esm/models/operations/createaddress.js +1 -1
- package/esm/models/operations/createaddress.js.map +1 -1
- package/esm/models/operations/createorder.d.ts +16 -16
- package/esm/models/operations/createorder.d.ts.map +1 -1
- package/esm/models/operations/createorder.js +12 -12
- package/esm/models/operations/createorder.js.map +1 -1
- package/esm/models/operations/generateotp.d.ts +2 -2
- package/esm/models/operations/generateotp.js +2 -2
- package/esm/models/operations/getaddressdetail.js +1 -1
- package/esm/models/operations/getaddressdetail.js.map +1 -1
- package/esm/models/operations/getproductdetail.d.ts +3 -3
- package/esm/models/operations/getproductdetail.d.ts.map +1 -1
- package/esm/models/operations/getproductdetail.js +4 -4
- package/esm/models/operations/getproductdetail.js.map +1 -1
- package/esm/models/operations/getvariantdetail.d.ts +3 -3
- package/esm/models/operations/getvariantdetail.d.ts.map +1 -1
- package/esm/models/operations/getvariantdetail.js +4 -4
- package/esm/models/operations/getvariantdetail.js.map +1 -1
- package/esm/models/operations/listaddresses.js +1 -1
- package/esm/models/operations/listaddresses.js.map +1 -1
- package/esm/models/operations/listcrosssellproducts.d.ts +3 -3
- package/esm/models/operations/listcrosssellproducts.d.ts.map +1 -1
- package/esm/models/operations/listcrosssellproducts.js +4 -4
- package/esm/models/operations/listcrosssellproducts.js.map +1 -1
- package/esm/models/operations/listproducts.d.ts +3 -3
- package/esm/models/operations/listproducts.d.ts.map +1 -1
- package/esm/models/operations/listproducts.js +4 -4
- package/esm/models/operations/listproducts.js.map +1 -1
- package/esm/models/operations/listproductvariants.d.ts +3 -3
- package/esm/models/operations/listproductvariants.d.ts.map +1 -1
- package/esm/models/operations/listproductvariants.js +4 -4
- package/esm/models/operations/listproductvariants.js.map +1 -1
- package/esm/models/operations/listsimilarproducts.d.ts +3 -3
- package/esm/models/operations/listsimilarproducts.d.ts.map +1 -1
- package/esm/models/operations/listsimilarproducts.js +4 -4
- package/esm/models/operations/listsimilarproducts.js.map +1 -1
- package/esm/models/operations/listskus.d.ts +3 -3
- package/esm/models/operations/listskus.d.ts.map +1 -1
- package/esm/models/operations/listskus.js +4 -4
- package/esm/models/operations/listskus.js.map +1 -1
- package/esm/models/operations/listupsellproducts.d.ts +3 -3
- package/esm/models/operations/listupsellproducts.d.ts.map +1 -1
- package/esm/models/operations/listupsellproducts.js +4 -4
- package/esm/models/operations/listupsellproducts.js.map +1 -1
- package/esm/models/operations/loginwithwhatsapp.js +1 -1
- package/esm/models/operations/loginwithwhatsapp.js.map +1 -1
- package/esm/models/operations/retryorderpayment.d.ts +16 -16
- package/esm/models/operations/retryorderpayment.d.ts.map +1 -1
- package/esm/models/operations/retryorderpayment.js +12 -12
- package/esm/models/operations/retryorderpayment.js.map +1 -1
- package/esm/models/operations/searchproducts.d.ts +30 -0
- package/esm/models/operations/searchproducts.d.ts.map +1 -1
- package/esm/models/operations/searchproducts.js +37 -0
- package/esm/models/operations/searchproducts.js.map +1 -1
- package/esm/models/operations/updateaddressdetail.js +1 -1
- package/esm/models/operations/updateaddressdetail.js.map +1 -1
- package/esm/sdk/catalog.d.ts +1 -2
- package/esm/sdk/catalog.d.ts.map +1 -1
- package/esm/sdk/catalog.js.map +1 -1
- package/esm/types/constdatetime.js +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/catalogGetProductDetail.ts +3 -3
- package/src/funcs/catalogGetVariantDetail.ts +3 -3
- package/src/funcs/catalogListCrosssellProducts.ts +3 -3
- package/src/funcs/catalogListProductVariants.ts +3 -3
- package/src/funcs/catalogListProducts.ts +3 -3
- package/src/funcs/catalogListSimilarProducts.ts +3 -3
- package/src/funcs/catalogListSkus.ts +3 -3
- package/src/funcs/catalogListUpsellProducts.ts +3 -3
- package/src/funcs/catalogSearchProducts.ts +10 -6
- package/src/lib/config.ts +3 -3
- package/src/lib/files.ts +42 -0
- package/src/lib/security.ts +2 -2
- package/src/models/components/cart.ts +24 -24
- package/src/models/components/coloroption.ts +1 -1
- package/src/models/components/customeraddress.ts +1 -1
- package/src/models/components/customeraddressinput.ts +1 -1
- package/src/models/components/discountbasedpromotion.ts +1 -1
- package/src/models/components/fixedpricepromotion.ts +1 -1
- package/src/models/components/freegoodspromotion.ts +1 -1
- package/src/models/components/generateotpwithemail.ts +1 -1
- package/src/models/components/juspaypaymentinfo.ts +3 -2
- package/src/models/components/orderpayment.ts +4 -4
- package/src/models/components/payupaymentinfo.ts +3 -3
- package/src/models/components/productpromotion.ts +48 -48
- package/src/models/components/searchproduct.ts +0 -16
- package/src/models/components/singleselectoption.ts +1 -1
- package/src/models/components/volumebasedpromotion.ts +1 -1
- package/src/models/operations/createaddress.ts +1 -1
- package/src/models/operations/createorder.ts +37 -35
- package/src/models/operations/generateotp.ts +6 -6
- package/src/models/operations/getaddressdetail.ts +1 -1
- package/src/models/operations/getproductdetail.ts +7 -7
- package/src/models/operations/getvariantdetail.ts +7 -7
- package/src/models/operations/listaddresses.ts +1 -1
- package/src/models/operations/listcrosssellproducts.ts +7 -7
- package/src/models/operations/listproducts.ts +7 -7
- package/src/models/operations/listproductvariants.ts +7 -7
- package/src/models/operations/listsimilarproducts.ts +7 -7
- package/src/models/operations/listskus.ts +7 -7
- package/src/models/operations/listupsellproducts.ts +7 -7
- package/src/models/operations/loginwithwhatsapp.ts +1 -1
- package/src/models/operations/retryorderpayment.ts +37 -35
- package/src/models/operations/searchproducts.ts +75 -0
- package/src/models/operations/updateaddressdetail.ts +1 -1
- package/src/sdk/catalog.ts +1 -2
- package/src/types/constdatetime.ts +1 -1
package/esm/sdk/catalog.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog.js","sourceRoot":"","sources":["../../src/sdk/catalog.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,4BAA4B,EAAE,MAAM,0CAA0C,CAAC;AACxF,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAClF,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AACpF,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,C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O,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,qBAAqB,CACzB,OAAgD,EAChD,OAAwB;QAExB,OAAO,WAAW,CAAC,4BAA4B,CAC7C,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,cAAc,CAClB,OAAyC,EACzC,OAAwB;QAExB,OAAO,WAAW,CAAC,qBAAqB,CACtC,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -5,6 +5,6 @@ import * as z from "zod";
|
|
|
5
5
|
export function constDateTime(val) {
|
|
6
6
|
return z.custom((v) => {
|
|
7
7
|
return (typeof v === "string" && new Date(v).getTime() === new Date(val).getTime());
|
|
8
|
-
}, `Value must be
|
|
8
|
+
}, `Value must be equivalent to ${val}`);
|
|
9
9
|
}
|
|
10
10
|
//# sourceMappingURL=constdatetime.js.map
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -102,9 +102,9 @@ async function $do(
|
|
|
102
102
|
|
|
103
103
|
const headers = new Headers(compactMap({
|
|
104
104
|
Accept: "application/json",
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
payload
|
|
105
|
+
"x-customer-group-id": encodeSimple(
|
|
106
|
+
"x-customer-group-id",
|
|
107
|
+
payload["x-customer-group-id"],
|
|
108
108
|
{ explode: false, charEncoding: "none" },
|
|
109
109
|
),
|
|
110
110
|
}));
|
|
@@ -107,9 +107,9 @@ async function $do(
|
|
|
107
107
|
|
|
108
108
|
const headers = new Headers(compactMap({
|
|
109
109
|
Accept: "application/json",
|
|
110
|
-
"
|
|
111
|
-
"
|
|
112
|
-
payload
|
|
110
|
+
"x-customer-group-id": encodeSimple(
|
|
111
|
+
"x-customer-group-id",
|
|
112
|
+
payload["x-customer-group-id"],
|
|
113
113
|
{ explode: false, charEncoding: "none" },
|
|
114
114
|
),
|
|
115
115
|
}));
|
|
@@ -102,9 +102,9 @@ async function $do(
|
|
|
102
102
|
|
|
103
103
|
const headers = new Headers(compactMap({
|
|
104
104
|
Accept: "application/json",
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
payload
|
|
105
|
+
"x-customer-group-id": encodeSimple(
|
|
106
|
+
"x-customer-group-id",
|
|
107
|
+
payload["x-customer-group-id"],
|
|
108
108
|
{ explode: false, charEncoding: "none" },
|
|
109
109
|
),
|
|
110
110
|
}));
|
|
@@ -104,9 +104,9 @@ async function $do(
|
|
|
104
104
|
|
|
105
105
|
const headers = new Headers(compactMap({
|
|
106
106
|
Accept: "application/json",
|
|
107
|
-
"
|
|
108
|
-
"
|
|
109
|
-
payload
|
|
107
|
+
"x-customer-group-id": encodeSimple(
|
|
108
|
+
"x-customer-group-id",
|
|
109
|
+
payload["x-customer-group-id"],
|
|
110
110
|
{ explode: false, charEncoding: "none" },
|
|
111
111
|
),
|
|
112
112
|
}));
|
|
@@ -102,9 +102,9 @@ async function $do(
|
|
|
102
102
|
|
|
103
103
|
const headers = new Headers(compactMap({
|
|
104
104
|
Accept: "application/json",
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
payload
|
|
105
|
+
"x-customer-group-id": encodeSimple(
|
|
106
|
+
"x-customer-group-id",
|
|
107
|
+
payload["x-customer-group-id"],
|
|
108
108
|
{ explode: false, charEncoding: "none" },
|
|
109
109
|
),
|
|
110
110
|
}));
|
|
@@ -102,9 +102,9 @@ async function $do(
|
|
|
102
102
|
|
|
103
103
|
const headers = new Headers(compactMap({
|
|
104
104
|
Accept: "application/json",
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
payload
|
|
105
|
+
"x-customer-group-id": encodeSimple(
|
|
106
|
+
"x-customer-group-id",
|
|
107
|
+
payload["x-customer-group-id"],
|
|
108
108
|
{ explode: false, charEncoding: "none" },
|
|
109
109
|
),
|
|
110
110
|
}));
|
|
@@ -102,9 +102,9 @@ async function $do(
|
|
|
102
102
|
|
|
103
103
|
const headers = new Headers(compactMap({
|
|
104
104
|
Accept: "application/json",
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
payload
|
|
105
|
+
"x-customer-group-id": encodeSimple(
|
|
106
|
+
"x-customer-group-id",
|
|
107
|
+
payload["x-customer-group-id"],
|
|
108
108
|
{ explode: false, charEncoding: "none" },
|
|
109
109
|
),
|
|
110
110
|
}));
|
|
@@ -101,9 +101,9 @@ async function $do(
|
|
|
101
101
|
|
|
102
102
|
const headers = new Headers(compactMap({
|
|
103
103
|
Accept: "application/json",
|
|
104
|
-
"
|
|
105
|
-
"
|
|
106
|
-
payload
|
|
104
|
+
"x-customer-group-id": encodeSimple(
|
|
105
|
+
"x-customer-group-id",
|
|
106
|
+
payload["x-customer-group-id"],
|
|
107
107
|
{ explode: false, charEncoding: "none" },
|
|
108
108
|
),
|
|
109
109
|
}));
|
|
@@ -3,14 +3,13 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { CeStorefrontCore } from "../core.js";
|
|
6
|
-
import { encodeJSON } from "../lib/encodings.js";
|
|
6
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
7
7
|
import * as M from "../lib/matchers.js";
|
|
8
8
|
import { compactMap } from "../lib/primitives.js";
|
|
9
9
|
import { safeParse } from "../lib/schemas.js";
|
|
10
10
|
import { RequestOptions } from "../lib/sdks.js";
|
|
11
11
|
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
12
|
import { pathToFunc } from "../lib/url.js";
|
|
13
|
-
import * as components from "../models/components/index.js";
|
|
14
13
|
import { CeStorefrontError } from "../models/errors/cestorefronterror.js";
|
|
15
14
|
import {
|
|
16
15
|
ConnectionError,
|
|
@@ -34,7 +33,7 @@ import { Result } from "../types/fp.js";
|
|
|
34
33
|
*/
|
|
35
34
|
export function catalogSearchProducts(
|
|
36
35
|
client: CeStorefrontCore,
|
|
37
|
-
request:
|
|
36
|
+
request: operations.SearchProductsRequest,
|
|
38
37
|
options?: RequestOptions,
|
|
39
38
|
): APIPromise<
|
|
40
39
|
Result<
|
|
@@ -59,7 +58,7 @@ export function catalogSearchProducts(
|
|
|
59
58
|
|
|
60
59
|
async function $do(
|
|
61
60
|
client: CeStorefrontCore,
|
|
62
|
-
request:
|
|
61
|
+
request: operations.SearchProductsRequest,
|
|
63
62
|
options?: RequestOptions,
|
|
64
63
|
): Promise<
|
|
65
64
|
[
|
|
@@ -80,20 +79,25 @@ async function $do(
|
|
|
80
79
|
> {
|
|
81
80
|
const parsed = safeParse(
|
|
82
81
|
request,
|
|
83
|
-
(value) =>
|
|
82
|
+
(value) => operations.SearchProductsRequest$outboundSchema.parse(value),
|
|
84
83
|
"Input validation failed",
|
|
85
84
|
);
|
|
86
85
|
if (!parsed.ok) {
|
|
87
86
|
return [parsed, { status: "invalid" }];
|
|
88
87
|
}
|
|
89
88
|
const payload = parsed.value;
|
|
90
|
-
const body = encodeJSON("body", payload, { explode: true });
|
|
89
|
+
const body = encodeJSON("body", payload.SearchProduct, { explode: true });
|
|
91
90
|
|
|
92
91
|
const path = pathToFunc("/catalog/products/search")();
|
|
93
92
|
|
|
94
93
|
const headers = new Headers(compactMap({
|
|
95
94
|
"Content-Type": "application/json",
|
|
96
95
|
Accept: "application/json",
|
|
96
|
+
"x-customer-group-id": encodeSimple(
|
|
97
|
+
"x-customer-group-id",
|
|
98
|
+
payload["x-customer-group-id"],
|
|
99
|
+
{ explode: false, charEncoding: "none" },
|
|
100
|
+
),
|
|
97
101
|
}));
|
|
98
102
|
|
|
99
103
|
const secConfig = await extractSecurity(client._options.authorization);
|
package/src/lib/config.ts
CHANGED
|
@@ -80,7 +80,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
80
80
|
export const SDK_METADATA = {
|
|
81
81
|
language: "typescript",
|
|
82
82
|
openapiDocVersion: "1.0",
|
|
83
|
-
sdkVersion: "0.14.
|
|
84
|
-
genVersion: "2.
|
|
85
|
-
userAgent: "speakeasy-sdk/typescript 0.14.
|
|
83
|
+
sdkVersion: "0.14.2",
|
|
84
|
+
genVersion: "2.634.1",
|
|
85
|
+
userAgent: "speakeasy-sdk/typescript 0.14.2 2.634.1 1.0 ce-storefront",
|
|
86
86
|
} as const;
|
package/src/lib/files.ts
CHANGED
|
@@ -38,3 +38,45 @@ export async function readableStreamToArrayBuffer(
|
|
|
38
38
|
|
|
39
39
|
return concatenatedChunks.buffer as ArrayBuffer;
|
|
40
40
|
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Determines the MIME content type based on a file's extension.
|
|
44
|
+
* Returns null if the extension is not recognized.
|
|
45
|
+
*/
|
|
46
|
+
export function getContentTypeFromFileName(fileName: string): string | null {
|
|
47
|
+
if (!fileName) return null;
|
|
48
|
+
|
|
49
|
+
const ext = fileName.toLowerCase().split(".").pop();
|
|
50
|
+
if (!ext) return null;
|
|
51
|
+
|
|
52
|
+
const mimeTypes: Record<string, string> = {
|
|
53
|
+
json: "application/json",
|
|
54
|
+
xml: "application/xml",
|
|
55
|
+
html: "text/html",
|
|
56
|
+
htm: "text/html",
|
|
57
|
+
txt: "text/plain",
|
|
58
|
+
csv: "text/csv",
|
|
59
|
+
pdf: "application/pdf",
|
|
60
|
+
png: "image/png",
|
|
61
|
+
jpg: "image/jpeg",
|
|
62
|
+
jpeg: "image/jpeg",
|
|
63
|
+
gif: "image/gif",
|
|
64
|
+
svg: "image/svg+xml",
|
|
65
|
+
js: "application/javascript",
|
|
66
|
+
css: "text/css",
|
|
67
|
+
zip: "application/zip",
|
|
68
|
+
tar: "application/x-tar",
|
|
69
|
+
gz: "application/gzip",
|
|
70
|
+
mp4: "video/mp4",
|
|
71
|
+
mp3: "audio/mpeg",
|
|
72
|
+
wav: "audio/wav",
|
|
73
|
+
webp: "image/webp",
|
|
74
|
+
ico: "image/x-icon",
|
|
75
|
+
woff: "font/woff",
|
|
76
|
+
woff2: "font/woff2",
|
|
77
|
+
ttf: "font/ttf",
|
|
78
|
+
otf: "font/otf",
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
return mimeTypes[ext] || null;
|
|
82
|
+
}
|
package/src/lib/security.ts
CHANGED
|
@@ -6,8 +6,8 @@ import * as components from "../models/components/index.js";
|
|
|
6
6
|
|
|
7
7
|
type OAuth2PasswordFlow = {
|
|
8
8
|
username: string;
|
|
9
|
-
password
|
|
10
|
-
clientID
|
|
9
|
+
password: string;
|
|
10
|
+
clientID?: string | undefined;
|
|
11
11
|
clientSecret?: string | undefined;
|
|
12
12
|
tokenURL: string;
|
|
13
13
|
};
|
|
@@ -97,27 +97,27 @@ export type Cart = {
|
|
|
97
97
|
/**
|
|
98
98
|
* Estimated cost of shipping.
|
|
99
99
|
*/
|
|
100
|
-
shippingEstimatedCost: number;
|
|
100
|
+
shippingEstimatedCost: number | null;
|
|
101
101
|
/**
|
|
102
102
|
* Discount applied on estimated shipping cost.
|
|
103
103
|
*/
|
|
104
|
-
shippingDiscountAmount: number;
|
|
104
|
+
shippingDiscountAmount: number | null;
|
|
105
105
|
/**
|
|
106
106
|
* Shipping amount chargable to customer.
|
|
107
107
|
*/
|
|
108
|
-
shippingAmount: number;
|
|
108
|
+
shippingAmount: number | null;
|
|
109
109
|
/**
|
|
110
110
|
* Shipping tax rate applied on shipping amount.
|
|
111
111
|
*/
|
|
112
|
-
shippingTaxRate: number;
|
|
112
|
+
shippingTaxRate: number | null;
|
|
113
113
|
/**
|
|
114
114
|
* Tax applied on shipping_amount.
|
|
115
115
|
*/
|
|
116
|
-
shippingTaxAmount: number;
|
|
116
|
+
shippingTaxAmount: number | null;
|
|
117
117
|
/**
|
|
118
118
|
* Shipping amount including shipping tax.
|
|
119
119
|
*/
|
|
120
|
-
shippingAmountIncludingTax: number;
|
|
120
|
+
shippingAmountIncludingTax: number | null;
|
|
121
121
|
shippingProviderId: string | null;
|
|
122
122
|
shippingProviderName: string | null;
|
|
123
123
|
courierCompanyId: string | null;
|
|
@@ -203,12 +203,12 @@ export const Cart$inboundSchema: z.ZodType<Cart, z.ZodTypeDef, unknown> = z
|
|
|
203
203
|
subtotal: z.number(),
|
|
204
204
|
items_tax_amount: z.number(),
|
|
205
205
|
subtotal_including_tax: z.number(),
|
|
206
|
-
shipping_estimated_cost: z.number(),
|
|
207
|
-
shipping_discount_amount: z.number(),
|
|
208
|
-
shipping_amount: z.number(),
|
|
209
|
-
shipping_tax_rate: z.number(),
|
|
210
|
-
shipping_tax_amount: z.number(),
|
|
211
|
-
shipping_amount_including_tax: z.number(),
|
|
206
|
+
shipping_estimated_cost: z.nullable(z.number()),
|
|
207
|
+
shipping_discount_amount: z.nullable(z.number()),
|
|
208
|
+
shipping_amount: z.nullable(z.number()),
|
|
209
|
+
shipping_tax_rate: z.nullable(z.number()),
|
|
210
|
+
shipping_tax_amount: z.nullable(z.number()),
|
|
211
|
+
shipping_amount_including_tax: z.nullable(z.number()),
|
|
212
212
|
shipping_provider_id: z.nullable(z.string()),
|
|
213
213
|
shipping_provider_name: z.nullable(z.string()),
|
|
214
214
|
courier_company_id: z.nullable(z.string()),
|
|
@@ -297,12 +297,12 @@ export type Cart$Outbound = {
|
|
|
297
297
|
subtotal: number;
|
|
298
298
|
items_tax_amount: number;
|
|
299
299
|
subtotal_including_tax: number;
|
|
300
|
-
shipping_estimated_cost: number;
|
|
301
|
-
shipping_discount_amount: number;
|
|
302
|
-
shipping_amount: number;
|
|
303
|
-
shipping_tax_rate: number;
|
|
304
|
-
shipping_tax_amount: number;
|
|
305
|
-
shipping_amount_including_tax: number;
|
|
300
|
+
shipping_estimated_cost: number | null;
|
|
301
|
+
shipping_discount_amount: number | null;
|
|
302
|
+
shipping_amount: number | null;
|
|
303
|
+
shipping_tax_rate: number | null;
|
|
304
|
+
shipping_tax_amount: number | null;
|
|
305
|
+
shipping_amount_including_tax: number | null;
|
|
306
306
|
shipping_provider_id: string | null;
|
|
307
307
|
shipping_provider_name: string | null;
|
|
308
308
|
courier_company_id: string | null;
|
|
@@ -347,12 +347,12 @@ export const Cart$outboundSchema: z.ZodType<Cart$Outbound, z.ZodTypeDef, Cart> =
|
|
|
347
347
|
subtotal: z.number(),
|
|
348
348
|
itemsTaxAmount: z.number(),
|
|
349
349
|
subtotalIncludingTax: z.number(),
|
|
350
|
-
shippingEstimatedCost: z.number(),
|
|
351
|
-
shippingDiscountAmount: z.number(),
|
|
352
|
-
shippingAmount: z.number(),
|
|
353
|
-
shippingTaxRate: z.number(),
|
|
354
|
-
shippingTaxAmount: z.number(),
|
|
355
|
-
shippingAmountIncludingTax: z.number(),
|
|
350
|
+
shippingEstimatedCost: z.nullable(z.number()),
|
|
351
|
+
shippingDiscountAmount: z.nullable(z.number()),
|
|
352
|
+
shippingAmount: z.nullable(z.number()),
|
|
353
|
+
shippingTaxRate: z.nullable(z.number()),
|
|
354
|
+
shippingTaxAmount: z.nullable(z.number()),
|
|
355
|
+
shippingAmountIncludingTax: z.nullable(z.number()),
|
|
356
356
|
shippingProviderId: z.nullable(z.string()),
|
|
357
357
|
shippingProviderName: z.nullable(z.string()),
|
|
358
358
|
courierCompanyId: z.nullable(z.string()),
|
|
@@ -94,7 +94,7 @@ export const ColorOption$inboundSchema: z.ZodType<
|
|
|
94
94
|
unknown
|
|
95
95
|
> = z.object({
|
|
96
96
|
name: z.string(),
|
|
97
|
-
type: z.literal("color").optional(),
|
|
97
|
+
type: z.literal("color").default("color").optional(),
|
|
98
98
|
value: z.lazy(() => ColorOptionValue$inboundSchema),
|
|
99
99
|
});
|
|
100
100
|
|
|
@@ -63,7 +63,7 @@ export const CustomerAddress$inboundSchema: z.ZodType<
|
|
|
63
63
|
pincode: z.string(),
|
|
64
64
|
city: z.string(),
|
|
65
65
|
state: z.string(),
|
|
66
|
-
country: z.literal("India").optional(),
|
|
66
|
+
country: z.literal("India").default("India").optional(),
|
|
67
67
|
tax_identification_number: z.nullable(z.string()),
|
|
68
68
|
business_name: z.nullable(z.string()),
|
|
69
69
|
is_phone_verified: z.boolean(),
|
|
@@ -61,7 +61,7 @@ export const CustomerAddressInput$inboundSchema: z.ZodType<
|
|
|
61
61
|
pincode: z.string(),
|
|
62
62
|
city: z.string(),
|
|
63
63
|
state: z.string(),
|
|
64
|
-
country: z.literal("India").optional(),
|
|
64
|
+
country: z.literal("India").default("India").optional(),
|
|
65
65
|
tax_identification_number: z.nullable(z.string()),
|
|
66
66
|
business_name: z.nullable(z.string()),
|
|
67
67
|
}).transform((v) => {
|
|
@@ -82,7 +82,7 @@ export const DiscountBasedPromotion$inboundSchema: z.ZodType<
|
|
|
82
82
|
z.ZodTypeDef,
|
|
83
83
|
unknown
|
|
84
84
|
> = z.object({
|
|
85
|
-
promotion_type: z.literal("discount").optional(),
|
|
85
|
+
promotion_type: z.literal("discount").default("discount").optional(),
|
|
86
86
|
discount_type: DiscountType$inboundSchema,
|
|
87
87
|
discount_percent: z.number().optional(),
|
|
88
88
|
discount_fixed_amount: z.number().int().optional(),
|
|
@@ -51,7 +51,7 @@ export const FixedPricePromotion$inboundSchema: z.ZodType<
|
|
|
51
51
|
z.ZodTypeDef,
|
|
52
52
|
unknown
|
|
53
53
|
> = z.object({
|
|
54
|
-
promotion_type: z.literal("fixed-price").optional(),
|
|
54
|
+
promotion_type: z.literal("fixed-price").default("fixed-price").optional(),
|
|
55
55
|
offer_price: z.number(),
|
|
56
56
|
}).transform((v) => {
|
|
57
57
|
return remap$(v, {
|
|
@@ -58,7 +58,7 @@ export const FreeGoodsPromotion$inboundSchema: z.ZodType<
|
|
|
58
58
|
z.ZodTypeDef,
|
|
59
59
|
unknown
|
|
60
60
|
> = z.object({
|
|
61
|
-
promotion_type: z.literal("free-goods").optional(),
|
|
61
|
+
promotion_type: z.literal("free-goods").default("free-goods").optional(),
|
|
62
62
|
buy_quantity: z.number().int(),
|
|
63
63
|
get_quantity: z.number().int(),
|
|
64
64
|
}).transform((v) => {
|
|
@@ -52,7 +52,7 @@ export const GenerateOtpWithEmail$inboundSchema: z.ZodType<
|
|
|
52
52
|
z.ZodTypeDef,
|
|
53
53
|
unknown
|
|
54
54
|
> = z.object({
|
|
55
|
-
channel: z.literal("email").optional(),
|
|
55
|
+
channel: z.literal("email").default("email").optional(),
|
|
56
56
|
email: z.string(),
|
|
57
57
|
otp_action: GenerateOtpWithEmailOtpAction$inboundSchema,
|
|
58
58
|
}).transform((v) => {
|
|
@@ -203,11 +203,12 @@ export const Payload$inboundSchema: z.ZodType<Payload, z.ZodTypeDef, unknown> =
|
|
|
203
203
|
customerEmail: z.string().optional(),
|
|
204
204
|
currency: z.string().optional(),
|
|
205
205
|
description: z.string().optional(),
|
|
206
|
-
"options.createMandate": z.literal("REQUIRED").
|
|
206
|
+
"options.createMandate": z.literal("REQUIRED").default("REQUIRED")
|
|
207
|
+
.optional(),
|
|
207
208
|
"mandate.maxAmount": z.string().optional(),
|
|
208
209
|
"mandate.start_date ": z.string().optional(),
|
|
209
210
|
"mandate.end_date ": z.string().optional(),
|
|
210
|
-
"mandate.frequency": z.literal("MONTHLY").optional(),
|
|
211
|
+
"mandate.frequency": z.literal("MONTHLY").default("MONTHLY").optional(),
|
|
211
212
|
"mandate.rule_value ": MandateRuleValue$inboundSchema.optional(),
|
|
212
213
|
}).transform((v) => {
|
|
213
214
|
return remap$(v, {
|
|
@@ -41,10 +41,10 @@ import {
|
|
|
41
41
|
* Order Payment
|
|
42
42
|
*/
|
|
43
43
|
export type OrderPayment =
|
|
44
|
+
| CardPayment
|
|
44
45
|
| NetbankingPayment
|
|
45
46
|
| UpiPayment
|
|
46
47
|
| WalletPayment
|
|
47
|
-
| CardPayment
|
|
48
48
|
| BankTransfer;
|
|
49
49
|
|
|
50
50
|
/** @internal */
|
|
@@ -53,19 +53,19 @@ export const OrderPayment$inboundSchema: z.ZodType<
|
|
|
53
53
|
z.ZodTypeDef,
|
|
54
54
|
unknown
|
|
55
55
|
> = z.union([
|
|
56
|
+
CardPayment$inboundSchema,
|
|
56
57
|
NetbankingPayment$inboundSchema,
|
|
57
58
|
UpiPayment$inboundSchema,
|
|
58
59
|
WalletPayment$inboundSchema,
|
|
59
|
-
CardPayment$inboundSchema,
|
|
60
60
|
BankTransfer$inboundSchema,
|
|
61
61
|
]);
|
|
62
62
|
|
|
63
63
|
/** @internal */
|
|
64
64
|
export type OrderPayment$Outbound =
|
|
65
|
+
| CardPayment$Outbound
|
|
65
66
|
| NetbankingPayment$Outbound
|
|
66
67
|
| UpiPayment$Outbound
|
|
67
68
|
| WalletPayment$Outbound
|
|
68
|
-
| CardPayment$Outbound
|
|
69
69
|
| BankTransfer$Outbound;
|
|
70
70
|
|
|
71
71
|
/** @internal */
|
|
@@ -74,10 +74,10 @@ export const OrderPayment$outboundSchema: z.ZodType<
|
|
|
74
74
|
z.ZodTypeDef,
|
|
75
75
|
OrderPayment
|
|
76
76
|
> = z.union([
|
|
77
|
+
CardPayment$outboundSchema,
|
|
77
78
|
NetbankingPayment$outboundSchema,
|
|
78
79
|
UpiPayment$outboundSchema,
|
|
79
80
|
WalletPayment$outboundSchema,
|
|
80
|
-
CardPayment$outboundSchema,
|
|
81
81
|
BankTransfer$outboundSchema,
|
|
82
82
|
]);
|
|
83
83
|
|
|
@@ -81,8 +81,8 @@ export const SiDetails$inboundSchema: z.ZodType<
|
|
|
81
81
|
unknown
|
|
82
82
|
> = z.object({
|
|
83
83
|
billingAmount: z.number().optional(),
|
|
84
|
-
billingCurrency: z.literal("INR").optional(),
|
|
85
|
-
billingCycle: z.literal("MONTHLY").optional(),
|
|
84
|
+
billingCurrency: z.literal("INR").default("INR").optional(),
|
|
85
|
+
billingCycle: z.literal("MONTHLY").default("MONTHLY").optional(),
|
|
86
86
|
billingInterval: z.number().int().optional(),
|
|
87
87
|
paymentStartDate: z.string().transform(v => new RFCDate(v)).optional(),
|
|
88
88
|
paymentEndDate: z.string().transform(v => new RFCDate(v)).optional(),
|
|
@@ -154,7 +154,7 @@ export const PayuPaymentInfo$inboundSchema: z.ZodType<
|
|
|
154
154
|
lastname: z.string().optional(),
|
|
155
155
|
email: z.string().optional(),
|
|
156
156
|
phone: z.string().optional(),
|
|
157
|
-
si: z.literal(1).optional(),
|
|
157
|
+
si: z.literal(1).default(1).optional(),
|
|
158
158
|
si_details: z.lazy(() => SiDetails$inboundSchema).optional(),
|
|
159
159
|
furl: z.string().optional(),
|
|
160
160
|
surl: z.string().optional(),
|