ce-storefront 0.18.1 → 0.18.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.
Files changed (67) hide show
  1. package/docs/sdks/orders/README.md +0 -16
  2. package/esm/lib/config.d.ts +3 -3
  3. package/esm/lib/config.js +3 -3
  4. package/esm/models/components/index.d.ts +8 -1
  5. package/esm/models/components/index.d.ts.map +1 -1
  6. package/esm/models/components/index.js +8 -1
  7. package/esm/models/components/index.js.map +1 -1
  8. package/esm/models/components/juspaycard.d.ts +86 -0
  9. package/esm/models/components/juspaycard.d.ts.map +1 -0
  10. package/esm/models/components/juspaycard.js +114 -0
  11. package/esm/models/components/juspaycard.js.map +1 -0
  12. package/esm/models/components/juspayexpresscheckout.d.ts +33 -0
  13. package/esm/models/components/juspayexpresscheckout.d.ts.map +1 -0
  14. package/esm/models/components/juspayexpresscheckout.js +44 -0
  15. package/esm/models/components/juspayexpresscheckout.js.map +1 -0
  16. package/esm/models/components/juspayhypercheckout.d.ts +63 -0
  17. package/esm/models/components/juspayhypercheckout.d.ts.map +1 -0
  18. package/esm/models/components/juspayhypercheckout.js +74 -0
  19. package/esm/models/components/juspayhypercheckout.js.map +1 -0
  20. package/esm/models/components/juspaynetbanking.d.ts +44 -0
  21. package/esm/models/components/juspaynetbanking.d.ts.map +1 -0
  22. package/esm/models/components/juspaynetbanking.js +65 -0
  23. package/esm/models/components/juspaynetbanking.js.map +1 -0
  24. package/esm/models/components/juspaypaymentgatewayparams.d.ts +8 -8
  25. package/esm/models/components/juspaypaymentgatewayparams.d.ts.map +1 -1
  26. package/esm/models/components/juspaypaymentgatewayparams.js +12 -13
  27. package/esm/models/components/juspaypaymentgatewayparams.js.map +1 -1
  28. package/esm/models/components/juspaysavedcardtoken.d.ts +80 -0
  29. package/esm/models/components/juspaysavedcardtoken.d.ts.map +1 -0
  30. package/esm/models/components/juspaysavedcardtoken.js +102 -0
  31. package/esm/models/components/juspaysavedcardtoken.js.map +1 -0
  32. package/esm/models/components/juspayupicollect.d.ts +46 -0
  33. package/esm/models/components/juspayupicollect.d.ts.map +1 -0
  34. package/esm/models/components/juspayupicollect.js +69 -0
  35. package/esm/models/components/juspayupicollect.js.map +1 -0
  36. package/esm/models/components/juspayupiintent.d.ts +48 -0
  37. package/esm/models/components/juspayupiintent.d.ts.map +1 -0
  38. package/esm/models/components/juspayupiintent.js +73 -0
  39. package/esm/models/components/juspayupiintent.js.map +1 -0
  40. package/esm/models/components/paymentmethodpayload.d.ts +30 -0
  41. package/esm/models/components/paymentmethodpayload.d.ts.map +1 -0
  42. package/esm/models/components/paymentmethodpayload.js +35 -0
  43. package/esm/models/components/paymentmethodpayload.js.map +1 -0
  44. package/esm/models/operations/createorder.d.ts +2 -4
  45. package/esm/models/operations/createorder.d.ts.map +1 -1
  46. package/esm/models/operations/createorder.js +4 -8
  47. package/esm/models/operations/createorder.js.map +1 -1
  48. package/examples/package-lock.json +1 -1
  49. package/jsr.json +1 -1
  50. package/package.json +1 -1
  51. package/src/lib/config.ts +3 -3
  52. package/src/models/components/index.ts +8 -1
  53. package/src/models/components/juspaycard.ts +185 -0
  54. package/src/models/components/juspayexpresscheckout.ts +113 -0
  55. package/src/models/components/juspayhypercheckout.ts +126 -0
  56. package/src/models/components/juspaynetbanking.ts +115 -0
  57. package/src/models/components/juspaypaymentgatewayparams.ts +18 -14
  58. package/src/models/components/juspaysavedcardtoken.ts +174 -0
  59. package/src/models/components/juspayupicollect.ts +121 -0
  60. package/src/models/components/juspayupiintent.ts +125 -0
  61. package/src/models/components/paymentmethodpayload.ts +81 -0
  62. package/src/models/operations/createorder.ts +6 -12
  63. package/esm/models/components/paymentgateway.d.ts +0 -34
  64. package/esm/models/components/paymentgateway.d.ts.map +0 -1
  65. package/esm/models/components/paymentgateway.js +0 -27
  66. package/esm/models/components/paymentgateway.js.map +0 -1
  67. package/src/models/components/paymentgateway.ts +0 -39
@@ -0,0 +1,125 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
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
+ /**
12
+ * @see {@link https://llm-docs.commercengine.io/storefront/schemas/JuspayUpiIntent} - API reference for the JuspayUpiIntent schema
13
+ */
14
+ export type JuspayUpiIntent = {
15
+ paymentMethodSlug: string;
16
+ integrationType?: "express-checkout" | undefined;
17
+ gatewayReferenceId: string;
18
+ returnUrl?: string | undefined;
19
+ redirectAfterPayment: boolean;
20
+ paymentMethodType?: "UPI" | undefined;
21
+ paymentMethod?: "UPI_PAY" | undefined;
22
+ sdkParams: boolean;
23
+ upiApp: string;
24
+ };
25
+
26
+ /** @internal */
27
+ export const JuspayUpiIntent$inboundSchema: z.ZodType<
28
+ JuspayUpiIntent,
29
+ z.ZodTypeDef,
30
+ unknown
31
+ > = z.object({
32
+ payment_method_slug: z.string(),
33
+ integration_type: z.literal("express-checkout").default("express-checkout")
34
+ .optional(),
35
+ gateway_reference_id: z.string(),
36
+ return_url: z.string().optional(),
37
+ redirect_after_payment: z.boolean(),
38
+ payment_method_type: z.literal("UPI").default("UPI").optional(),
39
+ payment_method: z.literal("UPI_PAY").default("UPI_PAY").optional(),
40
+ sdk_params: z.boolean(),
41
+ upi_app: z.string(),
42
+ }).transform((v) => {
43
+ return remap$(v, {
44
+ "payment_method_slug": "paymentMethodSlug",
45
+ "integration_type": "integrationType",
46
+ "gateway_reference_id": "gatewayReferenceId",
47
+ "return_url": "returnUrl",
48
+ "redirect_after_payment": "redirectAfterPayment",
49
+ "payment_method_type": "paymentMethodType",
50
+ "payment_method": "paymentMethod",
51
+ "sdk_params": "sdkParams",
52
+ "upi_app": "upiApp",
53
+ });
54
+ });
55
+
56
+ /** @internal */
57
+ export type JuspayUpiIntent$Outbound = {
58
+ payment_method_slug: string;
59
+ integration_type: "express-checkout";
60
+ gateway_reference_id: string;
61
+ return_url?: string | undefined;
62
+ redirect_after_payment: boolean;
63
+ payment_method_type: "UPI";
64
+ payment_method: "UPI_PAY";
65
+ sdk_params: boolean;
66
+ upi_app: string;
67
+ };
68
+
69
+ /** @internal */
70
+ export const JuspayUpiIntent$outboundSchema: z.ZodType<
71
+ JuspayUpiIntent$Outbound,
72
+ z.ZodTypeDef,
73
+ JuspayUpiIntent
74
+ > = z.object({
75
+ paymentMethodSlug: z.string(),
76
+ integrationType: z.literal("express-checkout"),
77
+ gatewayReferenceId: z.string(),
78
+ returnUrl: z.string().optional(),
79
+ redirectAfterPayment: z.boolean(),
80
+ paymentMethodType: z.literal("UPI"),
81
+ paymentMethod: z.literal("UPI_PAY"),
82
+ sdkParams: z.boolean(),
83
+ upiApp: z.string(),
84
+ }).transform((v) => {
85
+ return remap$(v, {
86
+ paymentMethodSlug: "payment_method_slug",
87
+ integrationType: "integration_type",
88
+ gatewayReferenceId: "gateway_reference_id",
89
+ returnUrl: "return_url",
90
+ redirectAfterPayment: "redirect_after_payment",
91
+ paymentMethodType: "payment_method_type",
92
+ paymentMethod: "payment_method",
93
+ sdkParams: "sdk_params",
94
+ upiApp: "upi_app",
95
+ });
96
+ });
97
+
98
+ /**
99
+ * @internal
100
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
101
+ */
102
+ export namespace JuspayUpiIntent$ {
103
+ /** @deprecated use `JuspayUpiIntent$inboundSchema` instead. */
104
+ export const inboundSchema = JuspayUpiIntent$inboundSchema;
105
+ /** @deprecated use `JuspayUpiIntent$outboundSchema` instead. */
106
+ export const outboundSchema = JuspayUpiIntent$outboundSchema;
107
+ /** @deprecated use `JuspayUpiIntent$Outbound` instead. */
108
+ export type Outbound = JuspayUpiIntent$Outbound;
109
+ }
110
+
111
+ export function juspayUpiIntentToJSON(
112
+ juspayUpiIntent: JuspayUpiIntent,
113
+ ): string {
114
+ return JSON.stringify(JuspayUpiIntent$outboundSchema.parse(juspayUpiIntent));
115
+ }
116
+
117
+ export function juspayUpiIntentFromJSON(
118
+ jsonString: string,
119
+ ): SafeParseResult<JuspayUpiIntent, SDKValidationError> {
120
+ return safeParse(
121
+ jsonString,
122
+ (x) => JuspayUpiIntent$inboundSchema.parse(JSON.parse(x)),
123
+ `Failed to parse 'JuspayUpiIntent' from JSON`,
124
+ );
125
+ }
@@ -0,0 +1,81 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+ import {
10
+ JusPayExpressCheckout,
11
+ JusPayExpressCheckout$inboundSchema,
12
+ JusPayExpressCheckout$Outbound,
13
+ JusPayExpressCheckout$outboundSchema,
14
+ } from "./juspayexpresscheckout.js";
15
+ import {
16
+ JusPayHyperCheckout,
17
+ JusPayHyperCheckout$inboundSchema,
18
+ JusPayHyperCheckout$Outbound,
19
+ JusPayHyperCheckout$outboundSchema,
20
+ } from "./juspayhypercheckout.js";
21
+
22
+ /**
23
+ * @see {@link https://llm-docs.commercengine.io/storefront/schemas/PaymentMethodPayload} - API reference for the PaymentMethodPayload schema
24
+ */
25
+ export type PaymentMethodPayload = JusPayHyperCheckout | JusPayExpressCheckout;
26
+
27
+ /** @internal */
28
+ export const PaymentMethodPayload$inboundSchema: z.ZodType<
29
+ PaymentMethodPayload,
30
+ z.ZodTypeDef,
31
+ unknown
32
+ > = z.union([
33
+ JusPayHyperCheckout$inboundSchema,
34
+ JusPayExpressCheckout$inboundSchema,
35
+ ]);
36
+
37
+ /** @internal */
38
+ export type PaymentMethodPayload$Outbound =
39
+ | JusPayHyperCheckout$Outbound
40
+ | JusPayExpressCheckout$Outbound;
41
+
42
+ /** @internal */
43
+ export const PaymentMethodPayload$outboundSchema: z.ZodType<
44
+ PaymentMethodPayload$Outbound,
45
+ z.ZodTypeDef,
46
+ PaymentMethodPayload
47
+ > = z.union([
48
+ JusPayHyperCheckout$outboundSchema,
49
+ JusPayExpressCheckout$outboundSchema,
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 PaymentMethodPayload$ {
57
+ /** @deprecated use `PaymentMethodPayload$inboundSchema` instead. */
58
+ export const inboundSchema = PaymentMethodPayload$inboundSchema;
59
+ /** @deprecated use `PaymentMethodPayload$outboundSchema` instead. */
60
+ export const outboundSchema = PaymentMethodPayload$outboundSchema;
61
+ /** @deprecated use `PaymentMethodPayload$Outbound` instead. */
62
+ export type Outbound = PaymentMethodPayload$Outbound;
63
+ }
64
+
65
+ export function paymentMethodPayloadToJSON(
66
+ paymentMethodPayload: PaymentMethodPayload,
67
+ ): string {
68
+ return JSON.stringify(
69
+ PaymentMethodPayload$outboundSchema.parse(paymentMethodPayload),
70
+ );
71
+ }
72
+
73
+ export function paymentMethodPayloadFromJSON(
74
+ jsonString: string,
75
+ ): SafeParseResult<PaymentMethodPayload, SDKValidationError> {
76
+ return safeParse(
77
+ jsonString,
78
+ (x) => PaymentMethodPayload$inboundSchema.parse(JSON.parse(x)),
79
+ `Failed to parse 'PaymentMethodPayload' from JSON`,
80
+ );
81
+ }
@@ -14,8 +14,7 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
14
14
  */
15
15
  export type CreateOrderRequestBody = {
16
16
  cartId: string;
17
- paymentGateway: components.PaymentGateway;
18
- paymentGatewayParams: components.PaymentGatewayParams;
17
+ paymentMethod?: components.PaymentMethodPayload | undefined;
19
18
  };
20
19
 
21
20
  export type PaymentInfo =
@@ -44,21 +43,18 @@ export const CreateOrderRequestBody$inboundSchema: z.ZodType<
44
43
  unknown
45
44
  > = z.object({
46
45
  cart_id: z.string(),
47
- payment_gateway: components.PaymentGateway$inboundSchema,
48
- payment_gateway_params: components.PaymentGatewayParams$inboundSchema,
46
+ payment_method: components.PaymentMethodPayload$inboundSchema.optional(),
49
47
  }).transform((v) => {
50
48
  return remap$(v, {
51
49
  "cart_id": "cartId",
52
- "payment_gateway": "paymentGateway",
53
- "payment_gateway_params": "paymentGatewayParams",
50
+ "payment_method": "paymentMethod",
54
51
  });
55
52
  });
56
53
 
57
54
  /** @internal */
58
55
  export type CreateOrderRequestBody$Outbound = {
59
56
  cart_id: string;
60
- payment_gateway: string;
61
- payment_gateway_params: components.PaymentGatewayParams$Outbound;
57
+ payment_method?: components.PaymentMethodPayload$Outbound | undefined;
62
58
  };
63
59
 
64
60
  /** @internal */
@@ -68,13 +64,11 @@ export const CreateOrderRequestBody$outboundSchema: z.ZodType<
68
64
  CreateOrderRequestBody
69
65
  > = z.object({
70
66
  cartId: z.string(),
71
- paymentGateway: components.PaymentGateway$outboundSchema,
72
- paymentGatewayParams: components.PaymentGatewayParams$outboundSchema,
67
+ paymentMethod: components.PaymentMethodPayload$outboundSchema.optional(),
73
68
  }).transform((v) => {
74
69
  return remap$(v, {
75
70
  cartId: "cart_id",
76
- paymentGateway: "payment_gateway",
77
- paymentGatewayParams: "payment_gateway_params",
71
+ paymentMethod: "payment_method",
78
72
  });
79
73
  });
80
74
 
@@ -1,34 +0,0 @@
1
- import * as z from "zod/v3";
2
- import { ClosedEnum } from "../../types/enums.js";
3
- /**
4
- * @see {@link https://llm-docs.commercengine.io/storefront/schemas/PaymentGateway} - API reference for the PaymentGateway schema
5
- */
6
- export declare const PaymentGateway: {
7
- readonly Payu: "PAYU";
8
- readonly Juspay: "JUSPAY";
9
- };
10
- /**
11
- * @see {@link https://llm-docs.commercengine.io/storefront/schemas/PaymentGateway} - API reference for the PaymentGateway schema
12
- */
13
- export type PaymentGateway = ClosedEnum<typeof PaymentGateway>;
14
- /** @internal */
15
- export declare const PaymentGateway$inboundSchema: z.ZodNativeEnum<typeof PaymentGateway>;
16
- /** @internal */
17
- export declare const PaymentGateway$outboundSchema: z.ZodNativeEnum<typeof PaymentGateway>;
18
- /**
19
- * @internal
20
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
21
- */
22
- export declare namespace PaymentGateway$ {
23
- /** @deprecated use `PaymentGateway$inboundSchema` instead. */
24
- const inboundSchema: z.ZodNativeEnum<{
25
- readonly Payu: "PAYU";
26
- readonly Juspay: "JUSPAY";
27
- }>;
28
- /** @deprecated use `PaymentGateway$outboundSchema` instead. */
29
- const outboundSchema: z.ZodNativeEnum<{
30
- readonly Payu: "PAYU";
31
- readonly Juspay: "JUSPAY";
32
- }>;
33
- }
34
- //# sourceMappingURL=paymentgateway.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"paymentgateway.d.ts","sourceRoot":"","sources":["../../../src/models/components/paymentgateway.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD;;GAEG;AACH,eAAO,MAAM,cAAc;;;CAGjB,CAAC;AACX;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAE/D,gBAAgB;AAChB,eAAO,MAAM,4BAA4B,EAAE,CAAC,CAAC,aAAa,CACxD,OAAO,cAAc,CACS,CAAC;AAEjC,gBAAgB;AAChB,eAAO,MAAM,6BAA6B,EAAE,CAAC,CAAC,aAAa,CACzD,OAAO,cAAc,CACS,CAAC;AAEjC;;;GAGG;AACH,yBAAiB,eAAe,CAAC;IAC/B,8DAA8D;IACvD,MAAM,aAAa;;;MAA+B,CAAC;IAC1D,+DAA+D;IACxD,MAAM,cAAc;;;MAAgC,CAAC;CAC7D"}
@@ -1,27 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
- import * as z from "zod/v3";
5
- /**
6
- * @see {@link https://llm-docs.commercengine.io/storefront/schemas/PaymentGateway} - API reference for the PaymentGateway schema
7
- */
8
- export const PaymentGateway = {
9
- Payu: "PAYU",
10
- Juspay: "JUSPAY",
11
- };
12
- /** @internal */
13
- export const PaymentGateway$inboundSchema = z.nativeEnum(PaymentGateway);
14
- /** @internal */
15
- export const PaymentGateway$outboundSchema = PaymentGateway$inboundSchema;
16
- /**
17
- * @internal
18
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
19
- */
20
- export var PaymentGateway$;
21
- (function (PaymentGateway$) {
22
- /** @deprecated use `PaymentGateway$inboundSchema` instead. */
23
- PaymentGateway$.inboundSchema = PaymentGateway$inboundSchema;
24
- /** @deprecated use `PaymentGateway$outboundSchema` instead. */
25
- PaymentGateway$.outboundSchema = PaymentGateway$outboundSchema;
26
- })(PaymentGateway$ || (PaymentGateway$ = {}));
27
- //# sourceMappingURL=paymentgateway.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"paymentgateway.js","sourceRoot":"","sources":["../../../src/models/components/paymentgateway.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAG5B;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;CACR,CAAC;AAMX,gBAAgB;AAChB,MAAM,CAAC,MAAM,4BAA4B,GAErC,CAAC,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;AAEjC,gBAAgB;AAChB,MAAM,CAAC,MAAM,6BAA6B,GAEtC,4BAA4B,CAAC;AAEjC;;;GAGG;AACH,MAAM,KAAW,eAAe,CAK/B;AALD,WAAiB,eAAe;IAC9B,8DAA8D;IACjD,6BAAa,GAAG,4BAA4B,CAAC;IAC1D,+DAA+D;IAClD,8BAAc,GAAG,6BAA6B,CAAC;AAC9D,CAAC,EALgB,eAAe,KAAf,eAAe,QAK/B"}
@@ -1,39 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod/v3";
6
- import { ClosedEnum } from "../../types/enums.js";
7
-
8
- /**
9
- * @see {@link https://llm-docs.commercengine.io/storefront/schemas/PaymentGateway} - API reference for the PaymentGateway schema
10
- */
11
- export const PaymentGateway = {
12
- Payu: "PAYU",
13
- Juspay: "JUSPAY",
14
- } as const;
15
- /**
16
- * @see {@link https://llm-docs.commercengine.io/storefront/schemas/PaymentGateway} - API reference for the PaymentGateway schema
17
- */
18
- export type PaymentGateway = ClosedEnum<typeof PaymentGateway>;
19
-
20
- /** @internal */
21
- export const PaymentGateway$inboundSchema: z.ZodNativeEnum<
22
- typeof PaymentGateway
23
- > = z.nativeEnum(PaymentGateway);
24
-
25
- /** @internal */
26
- export const PaymentGateway$outboundSchema: z.ZodNativeEnum<
27
- typeof PaymentGateway
28
- > = PaymentGateway$inboundSchema;
29
-
30
- /**
31
- * @internal
32
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
33
- */
34
- export namespace PaymentGateway$ {
35
- /** @deprecated use `PaymentGateway$inboundSchema` instead. */
36
- export const inboundSchema = PaymentGateway$inboundSchema;
37
- /** @deprecated use `PaymentGateway$outboundSchema` instead. */
38
- export const outboundSchema = PaymentGateway$outboundSchema;
39
- }