ce-storefront 0.14.2 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/docs/sdks/auth/README.md +2 -0
- package/docs/sdks/orders/README.md +4 -0
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/models/components/banktransfer.d.ts +2 -2
- package/esm/models/components/banktransfer.d.ts.map +1 -1
- package/esm/models/components/banktransfer.js +2 -2
- package/esm/models/components/banktransfer.js.map +1 -1
- package/esm/models/components/cardpayment.d.ts +2 -2
- package/esm/models/components/cardpayment.d.ts.map +1 -1
- package/esm/models/components/cardpayment.js +2 -2
- package/esm/models/components/cardpayment.js.map +1 -1
- package/esm/models/components/cart.d.ts +16 -4
- package/esm/models/components/cart.d.ts.map +1 -1
- package/esm/models/components/cart.js +16 -4
- package/esm/models/components/cart.js.map +1 -1
- package/esm/models/components/netbankingpayment.d.ts +2 -2
- package/esm/models/components/netbankingpayment.d.ts.map +1 -1
- package/esm/models/components/netbankingpayment.js +2 -2
- package/esm/models/components/netbankingpayment.js.map +1 -1
- package/esm/models/components/order.d.ts +33 -20
- package/esm/models/components/order.d.ts.map +1 -1
- package/esm/models/components/order.js +40 -33
- package/esm/models/components/order.js.map +1 -1
- package/esm/models/components/orderdetail.d.ts +25 -12
- package/esm/models/components/orderdetail.d.ts.map +1 -1
- package/esm/models/components/orderdetail.js +28 -22
- package/esm/models/components/orderdetail.js.map +1 -1
- package/esm/models/components/upipayment.d.ts +2 -2
- package/esm/models/components/upipayment.d.ts.map +1 -1
- package/esm/models/components/upipayment.js +2 -2
- package/esm/models/components/upipayment.js.map +1 -1
- package/esm/models/components/walletpayment.d.ts +2 -2
- package/esm/models/components/walletpayment.d.ts.map +1 -1
- package/esm/models/components/walletpayment.js +2 -2
- package/esm/models/components/walletpayment.js.map +1 -1
- package/esm/models/errors/badrequest.js +1 -1
- package/esm/models/errors/badrequest.js.map +1 -1
- package/esm/models/errors/ceerror.d.ts.map +1 -1
- package/esm/models/errors/ceerror.js +8 -2
- package/esm/models/errors/ceerror.js.map +1 -1
- package/esm/models/errors/notfound.js +1 -1
- package/esm/models/errors/notfound.js.map +1 -1
- package/esm/models/errors/unauthorized.js +1 -1
- package/esm/models/errors/unauthorized.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/lib/config.ts +3 -3
- package/src/models/components/banktransfer.ts +4 -4
- package/src/models/components/cardpayment.ts +4 -4
- package/src/models/components/cart.ts +32 -8
- package/src/models/components/netbankingpayment.ts +4 -4
- package/src/models/components/order.ts +65 -50
- package/src/models/components/orderdetail.ts +49 -34
- package/src/models/components/upipayment.ts +4 -4
- package/src/models/components/walletpayment.ts +4 -4
- package/src/models/errors/badrequest.ts +1 -1
- package/src/models/errors/ceerror.ts +8 -2
- package/src/models/errors/notfound.ts +1 -1
- package/src/models/errors/unauthorized.ts +1 -1
|
@@ -122,10 +122,12 @@ export type OrderDetail = {
|
|
|
122
122
|
customerPhone?: string | null | undefined;
|
|
123
123
|
customerNote?: string | null | undefined;
|
|
124
124
|
isPromotionApplied?: boolean | undefined;
|
|
125
|
-
promotionDiscountAmount?: number |
|
|
125
|
+
promotionDiscountAmount?: number | undefined;
|
|
126
|
+
promotionDiscountPercent?: number | undefined;
|
|
126
127
|
isCouponApplied?: boolean | undefined;
|
|
127
128
|
couponCode?: string | null | undefined;
|
|
128
|
-
couponDiscountAmount?: number |
|
|
129
|
+
couponDiscountAmount?: number | undefined;
|
|
130
|
+
couponDiscountPercent?: number | undefined;
|
|
129
131
|
/**
|
|
130
132
|
* Information about the promotional offers that have been applied to the cart.
|
|
131
133
|
*/
|
|
@@ -149,14 +151,15 @@ export type OrderDetail = {
|
|
|
149
151
|
shippingTaxAmount?: number | undefined;
|
|
150
152
|
shippingAmountIncludingTax?: number | undefined;
|
|
151
153
|
shippingProviderId?: string | null | undefined;
|
|
154
|
+
shippingProviderName?: string | null | undefined;
|
|
152
155
|
courierCompanyId?: string | null | undefined;
|
|
156
|
+
courierCompanyName?: string | null | undefined;
|
|
157
|
+
estimatedDeliveryDays?: number | null | undefined;
|
|
153
158
|
handlingChargeExcludingTax?: number | undefined;
|
|
154
159
|
handlingChargeTaxAmount?: number | undefined;
|
|
155
160
|
handlingChargeIncludingTax?: number | undefined;
|
|
156
161
|
totalTax?: number | undefined;
|
|
157
162
|
grandTotal?: number | undefined;
|
|
158
|
-
loyaltyPointRedeemed?: number | undefined;
|
|
159
|
-
loyaltyPointEarned?: number | undefined;
|
|
160
163
|
loyaltyPointsEarned?: number | undefined;
|
|
161
164
|
loyaltyPointsRedeemed?: number | undefined;
|
|
162
165
|
creditBalanceUsed?: number | undefined;
|
|
@@ -166,6 +169,10 @@ export type OrderDetail = {
|
|
|
166
169
|
billingAddress?: CustomerAddress | null | undefined;
|
|
167
170
|
shippingAddress?: CustomerAddress | null | undefined;
|
|
168
171
|
currency?: OrderDetailCurrency | undefined;
|
|
172
|
+
/**
|
|
173
|
+
* Additional metadata associated with the order.
|
|
174
|
+
*/
|
|
175
|
+
metadata?: { [k: string]: string } | null | undefined;
|
|
169
176
|
/**
|
|
170
177
|
* order cancellation option should be visible only if this flag is true.
|
|
171
178
|
*/
|
|
@@ -174,8 +181,7 @@ export type OrderDetail = {
|
|
|
174
181
|
* to show refundable details in order cancellation ui.
|
|
175
182
|
*/
|
|
176
183
|
cancellationRefundDetails?: OrderDetailCancellationRefundDetails | undefined;
|
|
177
|
-
|
|
178
|
-
modifiedAt?: Date | undefined;
|
|
184
|
+
feedback?: string | null | undefined;
|
|
179
185
|
payments?: Array<OrderPayment> | undefined;
|
|
180
186
|
};
|
|
181
187
|
|
|
@@ -405,10 +411,12 @@ export const OrderDetail$inboundSchema: z.ZodType<
|
|
|
405
411
|
customer_phone: z.nullable(z.string()).optional(),
|
|
406
412
|
customer_note: z.nullable(z.string()).optional(),
|
|
407
413
|
is_promotion_applied: z.boolean().optional(),
|
|
408
|
-
promotion_discount_amount: z.
|
|
414
|
+
promotion_discount_amount: z.number().optional(),
|
|
415
|
+
promotion_discount_percent: z.number().optional(),
|
|
409
416
|
is_coupon_applied: z.boolean().optional(),
|
|
410
417
|
coupon_code: z.nullable(z.string()).optional(),
|
|
411
|
-
coupon_discount_amount: z.
|
|
418
|
+
coupon_discount_amount: z.number().optional(),
|
|
419
|
+
coupon_discount_percent: z.number().optional(),
|
|
412
420
|
applied_promotions: z.array(AppliedPromotion$inboundSchema),
|
|
413
421
|
applied_coupons: z.array(AppliedCoupon$inboundSchema),
|
|
414
422
|
promotion_savings: z.number().optional(),
|
|
@@ -426,14 +434,15 @@ export const OrderDetail$inboundSchema: z.ZodType<
|
|
|
426
434
|
shipping_tax_amount: z.number().optional(),
|
|
427
435
|
shipping_amount_including_tax: z.number().optional(),
|
|
428
436
|
shipping_provider_id: z.nullable(z.string()).optional(),
|
|
437
|
+
shipping_provider_name: z.nullable(z.string()).optional(),
|
|
429
438
|
courier_company_id: z.nullable(z.string()).optional(),
|
|
439
|
+
courier_company_name: z.nullable(z.string()).optional(),
|
|
440
|
+
estimated_delivery_days: z.nullable(z.number().int()).optional(),
|
|
430
441
|
handling_charge_excluding_tax: z.number().optional(),
|
|
431
442
|
handling_charge_tax_amount: z.number().optional(),
|
|
432
443
|
handling_charge_including_tax: z.number().optional(),
|
|
433
444
|
total_tax: z.number().optional(),
|
|
434
445
|
grand_total: z.number().optional(),
|
|
435
|
-
loyalty_point_redeemed: z.number().int().optional(),
|
|
436
|
-
loyalty_point_earned: z.number().int().optional(),
|
|
437
446
|
loyalty_points_earned: z.number().int().optional(),
|
|
438
447
|
loyalty_points_redeemed: z.number().int().optional(),
|
|
439
448
|
credit_balance_used: z.number().int().optional(),
|
|
@@ -443,14 +452,12 @@ export const OrderDetail$inboundSchema: z.ZodType<
|
|
|
443
452
|
billing_address: z.nullable(CustomerAddress$inboundSchema).optional(),
|
|
444
453
|
shipping_address: z.nullable(CustomerAddress$inboundSchema).optional(),
|
|
445
454
|
currency: z.lazy(() => OrderDetailCurrency$inboundSchema).optional(),
|
|
455
|
+
metadata: z.nullable(z.record(z.string())).optional(),
|
|
446
456
|
is_cancellation_allowed: z.boolean().optional(),
|
|
447
457
|
cancellation_refund_details: z.lazy(() =>
|
|
448
458
|
OrderDetailCancellationRefundDetails$inboundSchema
|
|
449
459
|
).optional(),
|
|
450
|
-
|
|
451
|
-
.optional(),
|
|
452
|
-
modified_at: z.string().datetime({ offset: true }).transform(v => new Date(v))
|
|
453
|
-
.optional(),
|
|
460
|
+
feedback: z.nullable(z.string()).optional(),
|
|
454
461
|
payments: z.array(OrderPayment$inboundSchema).optional(),
|
|
455
462
|
}).transform((v) => {
|
|
456
463
|
return remap$(v, {
|
|
@@ -463,9 +470,11 @@ export const OrderDetail$inboundSchema: z.ZodType<
|
|
|
463
470
|
"customer_note": "customerNote",
|
|
464
471
|
"is_promotion_applied": "isPromotionApplied",
|
|
465
472
|
"promotion_discount_amount": "promotionDiscountAmount",
|
|
473
|
+
"promotion_discount_percent": "promotionDiscountPercent",
|
|
466
474
|
"is_coupon_applied": "isCouponApplied",
|
|
467
475
|
"coupon_code": "couponCode",
|
|
468
476
|
"coupon_discount_amount": "couponDiscountAmount",
|
|
477
|
+
"coupon_discount_percent": "couponDiscountPercent",
|
|
469
478
|
"applied_promotions": "appliedPromotions",
|
|
470
479
|
"applied_coupons": "appliedCoupons",
|
|
471
480
|
"promotion_savings": "promotionSavings",
|
|
@@ -482,14 +491,15 @@ export const OrderDetail$inboundSchema: z.ZodType<
|
|
|
482
491
|
"shipping_tax_amount": "shippingTaxAmount",
|
|
483
492
|
"shipping_amount_including_tax": "shippingAmountIncludingTax",
|
|
484
493
|
"shipping_provider_id": "shippingProviderId",
|
|
494
|
+
"shipping_provider_name": "shippingProviderName",
|
|
485
495
|
"courier_company_id": "courierCompanyId",
|
|
496
|
+
"courier_company_name": "courierCompanyName",
|
|
497
|
+
"estimated_delivery_days": "estimatedDeliveryDays",
|
|
486
498
|
"handling_charge_excluding_tax": "handlingChargeExcludingTax",
|
|
487
499
|
"handling_charge_tax_amount": "handlingChargeTaxAmount",
|
|
488
500
|
"handling_charge_including_tax": "handlingChargeIncludingTax",
|
|
489
501
|
"total_tax": "totalTax",
|
|
490
502
|
"grand_total": "grandTotal",
|
|
491
|
-
"loyalty_point_redeemed": "loyaltyPointRedeemed",
|
|
492
|
-
"loyalty_point_earned": "loyaltyPointEarned",
|
|
493
503
|
"loyalty_points_earned": "loyaltyPointsEarned",
|
|
494
504
|
"loyalty_points_redeemed": "loyaltyPointsRedeemed",
|
|
495
505
|
"credit_balance_used": "creditBalanceUsed",
|
|
@@ -500,8 +510,6 @@ export const OrderDetail$inboundSchema: z.ZodType<
|
|
|
500
510
|
"shipping_address": "shippingAddress",
|
|
501
511
|
"is_cancellation_allowed": "isCancellationAllowed",
|
|
502
512
|
"cancellation_refund_details": "cancellationRefundDetails",
|
|
503
|
-
"created_at": "createdAt",
|
|
504
|
-
"modified_at": "modifiedAt",
|
|
505
513
|
});
|
|
506
514
|
});
|
|
507
515
|
|
|
@@ -516,10 +524,12 @@ export type OrderDetail$Outbound = {
|
|
|
516
524
|
customer_phone?: string | null | undefined;
|
|
517
525
|
customer_note?: string | null | undefined;
|
|
518
526
|
is_promotion_applied?: boolean | undefined;
|
|
519
|
-
promotion_discount_amount?: number |
|
|
527
|
+
promotion_discount_amount?: number | undefined;
|
|
528
|
+
promotion_discount_percent?: number | undefined;
|
|
520
529
|
is_coupon_applied?: boolean | undefined;
|
|
521
530
|
coupon_code?: string | null | undefined;
|
|
522
|
-
coupon_discount_amount?: number |
|
|
531
|
+
coupon_discount_amount?: number | undefined;
|
|
532
|
+
coupon_discount_percent?: number | undefined;
|
|
523
533
|
applied_promotions: Array<AppliedPromotion$Outbound>;
|
|
524
534
|
applied_coupons: Array<AppliedCoupon$Outbound>;
|
|
525
535
|
promotion_savings?: number | undefined;
|
|
@@ -537,14 +547,15 @@ export type OrderDetail$Outbound = {
|
|
|
537
547
|
shipping_tax_amount?: number | undefined;
|
|
538
548
|
shipping_amount_including_tax?: number | undefined;
|
|
539
549
|
shipping_provider_id?: string | null | undefined;
|
|
550
|
+
shipping_provider_name?: string | null | undefined;
|
|
540
551
|
courier_company_id?: string | null | undefined;
|
|
552
|
+
courier_company_name?: string | null | undefined;
|
|
553
|
+
estimated_delivery_days?: number | null | undefined;
|
|
541
554
|
handling_charge_excluding_tax?: number | undefined;
|
|
542
555
|
handling_charge_tax_amount?: number | undefined;
|
|
543
556
|
handling_charge_including_tax?: number | undefined;
|
|
544
557
|
total_tax?: number | undefined;
|
|
545
558
|
grand_total?: number | undefined;
|
|
546
|
-
loyalty_point_redeemed?: number | undefined;
|
|
547
|
-
loyalty_point_earned?: number | undefined;
|
|
548
559
|
loyalty_points_earned?: number | undefined;
|
|
549
560
|
loyalty_points_redeemed?: number | undefined;
|
|
550
561
|
credit_balance_used?: number | undefined;
|
|
@@ -554,12 +565,12 @@ export type OrderDetail$Outbound = {
|
|
|
554
565
|
billing_address?: CustomerAddress$Outbound | null | undefined;
|
|
555
566
|
shipping_address?: CustomerAddress$Outbound | null | undefined;
|
|
556
567
|
currency?: OrderDetailCurrency$Outbound | undefined;
|
|
568
|
+
metadata?: { [k: string]: string } | null | undefined;
|
|
557
569
|
is_cancellation_allowed?: boolean | undefined;
|
|
558
570
|
cancellation_refund_details?:
|
|
559
571
|
| OrderDetailCancellationRefundDetails$Outbound
|
|
560
572
|
| undefined;
|
|
561
|
-
|
|
562
|
-
modified_at?: string | undefined;
|
|
573
|
+
feedback?: string | null | undefined;
|
|
563
574
|
payments?: Array<OrderPayment$Outbound> | undefined;
|
|
564
575
|
};
|
|
565
576
|
|
|
@@ -578,10 +589,12 @@ export const OrderDetail$outboundSchema: z.ZodType<
|
|
|
578
589
|
customerPhone: z.nullable(z.string()).optional(),
|
|
579
590
|
customerNote: z.nullable(z.string()).optional(),
|
|
580
591
|
isPromotionApplied: z.boolean().optional(),
|
|
581
|
-
promotionDiscountAmount: z.
|
|
592
|
+
promotionDiscountAmount: z.number().optional(),
|
|
593
|
+
promotionDiscountPercent: z.number().optional(),
|
|
582
594
|
isCouponApplied: z.boolean().optional(),
|
|
583
595
|
couponCode: z.nullable(z.string()).optional(),
|
|
584
|
-
couponDiscountAmount: z.
|
|
596
|
+
couponDiscountAmount: z.number().optional(),
|
|
597
|
+
couponDiscountPercent: z.number().optional(),
|
|
585
598
|
appliedPromotions: z.array(AppliedPromotion$outboundSchema),
|
|
586
599
|
appliedCoupons: z.array(AppliedCoupon$outboundSchema),
|
|
587
600
|
promotionSavings: z.number().optional(),
|
|
@@ -599,14 +612,15 @@ export const OrderDetail$outboundSchema: z.ZodType<
|
|
|
599
612
|
shippingTaxAmount: z.number().optional(),
|
|
600
613
|
shippingAmountIncludingTax: z.number().optional(),
|
|
601
614
|
shippingProviderId: z.nullable(z.string()).optional(),
|
|
615
|
+
shippingProviderName: z.nullable(z.string()).optional(),
|
|
602
616
|
courierCompanyId: z.nullable(z.string()).optional(),
|
|
617
|
+
courierCompanyName: z.nullable(z.string()).optional(),
|
|
618
|
+
estimatedDeliveryDays: z.nullable(z.number().int()).optional(),
|
|
603
619
|
handlingChargeExcludingTax: z.number().optional(),
|
|
604
620
|
handlingChargeTaxAmount: z.number().optional(),
|
|
605
621
|
handlingChargeIncludingTax: z.number().optional(),
|
|
606
622
|
totalTax: z.number().optional(),
|
|
607
623
|
grandTotal: z.number().optional(),
|
|
608
|
-
loyaltyPointRedeemed: z.number().int().optional(),
|
|
609
|
-
loyaltyPointEarned: z.number().int().optional(),
|
|
610
624
|
loyaltyPointsEarned: z.number().int().optional(),
|
|
611
625
|
loyaltyPointsRedeemed: z.number().int().optional(),
|
|
612
626
|
creditBalanceUsed: z.number().int().optional(),
|
|
@@ -616,12 +630,12 @@ export const OrderDetail$outboundSchema: z.ZodType<
|
|
|
616
630
|
billingAddress: z.nullable(CustomerAddress$outboundSchema).optional(),
|
|
617
631
|
shippingAddress: z.nullable(CustomerAddress$outboundSchema).optional(),
|
|
618
632
|
currency: z.lazy(() => OrderDetailCurrency$outboundSchema).optional(),
|
|
633
|
+
metadata: z.nullable(z.record(z.string())).optional(),
|
|
619
634
|
isCancellationAllowed: z.boolean().optional(),
|
|
620
635
|
cancellationRefundDetails: z.lazy(() =>
|
|
621
636
|
OrderDetailCancellationRefundDetails$outboundSchema
|
|
622
637
|
).optional(),
|
|
623
|
-
|
|
624
|
-
modifiedAt: z.date().transform(v => v.toISOString()).optional(),
|
|
638
|
+
feedback: z.nullable(z.string()).optional(),
|
|
625
639
|
payments: z.array(OrderPayment$outboundSchema).optional(),
|
|
626
640
|
}).transform((v) => {
|
|
627
641
|
return remap$(v, {
|
|
@@ -634,9 +648,11 @@ export const OrderDetail$outboundSchema: z.ZodType<
|
|
|
634
648
|
customerNote: "customer_note",
|
|
635
649
|
isPromotionApplied: "is_promotion_applied",
|
|
636
650
|
promotionDiscountAmount: "promotion_discount_amount",
|
|
651
|
+
promotionDiscountPercent: "promotion_discount_percent",
|
|
637
652
|
isCouponApplied: "is_coupon_applied",
|
|
638
653
|
couponCode: "coupon_code",
|
|
639
654
|
couponDiscountAmount: "coupon_discount_amount",
|
|
655
|
+
couponDiscountPercent: "coupon_discount_percent",
|
|
640
656
|
appliedPromotions: "applied_promotions",
|
|
641
657
|
appliedCoupons: "applied_coupons",
|
|
642
658
|
promotionSavings: "promotion_savings",
|
|
@@ -653,14 +669,15 @@ export const OrderDetail$outboundSchema: z.ZodType<
|
|
|
653
669
|
shippingTaxAmount: "shipping_tax_amount",
|
|
654
670
|
shippingAmountIncludingTax: "shipping_amount_including_tax",
|
|
655
671
|
shippingProviderId: "shipping_provider_id",
|
|
672
|
+
shippingProviderName: "shipping_provider_name",
|
|
656
673
|
courierCompanyId: "courier_company_id",
|
|
674
|
+
courierCompanyName: "courier_company_name",
|
|
675
|
+
estimatedDeliveryDays: "estimated_delivery_days",
|
|
657
676
|
handlingChargeExcludingTax: "handling_charge_excluding_tax",
|
|
658
677
|
handlingChargeTaxAmount: "handling_charge_tax_amount",
|
|
659
678
|
handlingChargeIncludingTax: "handling_charge_including_tax",
|
|
660
679
|
totalTax: "total_tax",
|
|
661
680
|
grandTotal: "grand_total",
|
|
662
|
-
loyaltyPointRedeemed: "loyalty_point_redeemed",
|
|
663
|
-
loyaltyPointEarned: "loyalty_point_earned",
|
|
664
681
|
loyaltyPointsEarned: "loyalty_points_earned",
|
|
665
682
|
loyaltyPointsRedeemed: "loyalty_points_redeemed",
|
|
666
683
|
creditBalanceUsed: "credit_balance_used",
|
|
@@ -671,8 +688,6 @@ export const OrderDetail$outboundSchema: z.ZodType<
|
|
|
671
688
|
shippingAddress: "shipping_address",
|
|
672
689
|
isCancellationAllowed: "is_cancellation_allowed",
|
|
673
690
|
cancellationRefundDetails: "cancellation_refund_details",
|
|
674
|
-
createdAt: "created_at",
|
|
675
|
-
modifiedAt: "modified_at",
|
|
676
691
|
});
|
|
677
692
|
});
|
|
678
693
|
|
|
@@ -38,7 +38,7 @@ export type UpiPayment = {
|
|
|
38
38
|
paymentStatus?: UpiPaymentPaymentStatus | undefined;
|
|
39
39
|
paymentDate?: Date | undefined;
|
|
40
40
|
paymentReferenceNumber?: string | null | undefined;
|
|
41
|
-
paymentMethod?: string | undefined;
|
|
41
|
+
paymentMethod?: string | null | undefined;
|
|
42
42
|
iconUrl?: string | null | undefined;
|
|
43
43
|
upiId?: string | undefined;
|
|
44
44
|
};
|
|
@@ -99,7 +99,7 @@ export const UpiPayment$inboundSchema: z.ZodType<
|
|
|
99
99
|
new Date(v)
|
|
100
100
|
).optional(),
|
|
101
101
|
payment_reference_number: z.nullable(z.string()).optional(),
|
|
102
|
-
payment_method: z.string().optional(),
|
|
102
|
+
payment_method: z.nullable(z.string()).optional(),
|
|
103
103
|
icon_url: z.nullable(z.string()).optional(),
|
|
104
104
|
upi_id: z.string().optional(),
|
|
105
105
|
}).transform((v) => {
|
|
@@ -123,7 +123,7 @@ export type UpiPayment$Outbound = {
|
|
|
123
123
|
payment_status?: string | undefined;
|
|
124
124
|
payment_date?: string | undefined;
|
|
125
125
|
payment_reference_number?: string | null | undefined;
|
|
126
|
-
payment_method?: string | undefined;
|
|
126
|
+
payment_method?: string | null | undefined;
|
|
127
127
|
icon_url?: string | null | undefined;
|
|
128
128
|
upi_id?: string | undefined;
|
|
129
129
|
};
|
|
@@ -140,7 +140,7 @@ export const UpiPayment$outboundSchema: z.ZodType<
|
|
|
140
140
|
paymentStatus: UpiPaymentPaymentStatus$outboundSchema.optional(),
|
|
141
141
|
paymentDate: z.date().transform(v => v.toISOString()).optional(),
|
|
142
142
|
paymentReferenceNumber: z.nullable(z.string()).optional(),
|
|
143
|
-
paymentMethod: z.string().optional(),
|
|
143
|
+
paymentMethod: z.nullable(z.string()).optional(),
|
|
144
144
|
iconUrl: z.nullable(z.string()).optional(),
|
|
145
145
|
upiId: z.string().optional(),
|
|
146
146
|
}).transform((v) => {
|
|
@@ -38,7 +38,7 @@ export type WalletPayment = {
|
|
|
38
38
|
paymentStatus?: WalletPaymentPaymentStatus | undefined;
|
|
39
39
|
paymentDate?: Date | undefined;
|
|
40
40
|
paymentReferenceNumber?: string | null | undefined;
|
|
41
|
-
paymentMethod?: string | undefined;
|
|
41
|
+
paymentMethod?: string | null | undefined;
|
|
42
42
|
iconUrl?: string | null | undefined;
|
|
43
43
|
walletName?: string | undefined;
|
|
44
44
|
};
|
|
@@ -99,7 +99,7 @@ export const WalletPayment$inboundSchema: z.ZodType<
|
|
|
99
99
|
new Date(v)
|
|
100
100
|
).optional(),
|
|
101
101
|
payment_reference_number: z.nullable(z.string()).optional(),
|
|
102
|
-
payment_method: z.string().optional(),
|
|
102
|
+
payment_method: z.nullable(z.string()).optional(),
|
|
103
103
|
icon_url: z.nullable(z.string()).optional(),
|
|
104
104
|
wallet_name: z.string().optional(),
|
|
105
105
|
}).transform((v) => {
|
|
@@ -123,7 +123,7 @@ export type WalletPayment$Outbound = {
|
|
|
123
123
|
payment_status?: string | undefined;
|
|
124
124
|
payment_date?: string | undefined;
|
|
125
125
|
payment_reference_number?: string | null | undefined;
|
|
126
|
-
payment_method?: string | undefined;
|
|
126
|
+
payment_method?: string | null | undefined;
|
|
127
127
|
icon_url?: string | null | undefined;
|
|
128
128
|
wallet_name?: string | undefined;
|
|
129
129
|
};
|
|
@@ -140,7 +140,7 @@ export const WalletPayment$outboundSchema: z.ZodType<
|
|
|
140
140
|
paymentStatus: WalletPaymentPaymentStatus$outboundSchema.optional(),
|
|
141
141
|
paymentDate: z.date().transform(v => v.toISOString()).optional(),
|
|
142
142
|
paymentReferenceNumber: z.nullable(z.string()).optional(),
|
|
143
|
-
paymentMethod: z.string().optional(),
|
|
143
|
+
paymentMethod: z.nullable(z.string()).optional(),
|
|
144
144
|
iconUrl: z.nullable(z.string()).optional(),
|
|
145
145
|
walletName: z.string().optional(),
|
|
146
146
|
}).transform((v) => {
|
|
@@ -37,7 +37,7 @@ export class BadRequest extends CeStorefrontError {
|
|
|
37
37
|
err: BadRequestData,
|
|
38
38
|
httpMeta: { response: Response; request: Request; body: string },
|
|
39
39
|
) {
|
|
40
|
-
const message = err.message ||
|
|
40
|
+
const message = err.message || `API error occurred: ${JSON.stringify(err)}`;
|
|
41
41
|
super(message, httpMeta);
|
|
42
42
|
this.data$ = err;
|
|
43
43
|
this.success = err.success;
|
|
@@ -25,8 +25,14 @@ export class CeError extends CeStorefrontError {
|
|
|
25
25
|
}`;
|
|
26
26
|
}
|
|
27
27
|
const body = httpMeta.body || `""`;
|
|
28
|
-
message += body.length > 100 ? "\n" : " ";
|
|
29
|
-
|
|
28
|
+
message += body.length > 100 ? "\n" : ". ";
|
|
29
|
+
let bodyDisplay = body;
|
|
30
|
+
if (body.length > 10000) {
|
|
31
|
+
const truncated = body.substring(0, 10000);
|
|
32
|
+
const remaining = body.length - 10000;
|
|
33
|
+
bodyDisplay = `${truncated}...and ${remaining} more chars`;
|
|
34
|
+
}
|
|
35
|
+
message += `Body: ${bodyDisplay}`;
|
|
30
36
|
message = message.trim();
|
|
31
37
|
super(message, httpMeta);
|
|
32
38
|
this.name = "CeError";
|
|
@@ -28,7 +28,7 @@ export class NotFound extends CeStorefrontError {
|
|
|
28
28
|
err: NotFoundData,
|
|
29
29
|
httpMeta: { response: Response; request: Request; body: string },
|
|
30
30
|
) {
|
|
31
|
-
const message = err.message ||
|
|
31
|
+
const message = err.message || `API error occurred: ${JSON.stringify(err)}`;
|
|
32
32
|
super(message, httpMeta);
|
|
33
33
|
this.data$ = err;
|
|
34
34
|
this.success = err.success;
|
|
@@ -28,7 +28,7 @@ export class Unauthorized extends CeStorefrontError {
|
|
|
28
28
|
err: UnauthorizedData,
|
|
29
29
|
httpMeta: { response: Response; request: Request; body: string },
|
|
30
30
|
) {
|
|
31
|
-
const message = err.message ||
|
|
31
|
+
const message = err.message || `API error occurred: ${JSON.stringify(err)}`;
|
|
32
32
|
super(message, httpMeta);
|
|
33
33
|
this.data$ = err;
|
|
34
34
|
if (err.success != null) this.success = err.success;
|