@mohasinac/appkit 4.61.0 → 4.62.1
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/dist/.build-stamp.json +3 -3
- package/dist/_internal/client/features/lottery/LotteryAdminEditView.js +19 -3
- package/dist/_internal/client/features/maintenance/views/AnalysisRunnerView.js +1 -1
- package/dist/_internal/client/features/maintenance/views/CloudLogsListView.js +1 -1
- package/dist/_internal/server/features/checkout/actions.d.ts +80 -0
- package/dist/_internal/server/features/checkout/actions.js +542 -26
- package/dist/_internal/server/features/invoicing/allocate.d.ts +63 -0
- package/dist/_internal/server/features/invoicing/allocate.js +162 -0
- package/dist/_internal/server/features/invoicing/credit-note.d.ts +57 -0
- package/dist/_internal/server/features/invoicing/credit-note.js +126 -0
- package/dist/_internal/server/features/invoicing/gstr1.d.ts +74 -0
- package/dist/_internal/server/features/invoicing/gstr1.js +251 -0
- package/dist/_internal/server/features/invoicing/issue.d.ts +96 -0
- package/dist/_internal/server/features/invoicing/issue.js +202 -0
- package/dist/_internal/server/features/orders/actions.d.ts +8 -1
- package/dist/_internal/server/features/orders/actions.js +81 -8
- package/dist/_internal/server/features/orders/adapters.js +33 -0
- package/dist/_internal/server/features/orders/cancellation-refund.d.ts +15 -9
- package/dist/_internal/server/features/orders/cancellation-refund.js +15 -9
- package/dist/_internal/server/features/points/award.js +46 -4
- package/dist/_internal/server/features/refunds/actions.js +26 -0
- package/dist/_internal/server/features/shipping/courier-block.d.ts +69 -0
- package/dist/_internal/server/features/shipping/courier-block.js +239 -0
- package/dist/_internal/server/features/site-settings/adapters.d.ts +1 -1
- package/dist/_internal/server/features/site-settings/adapters.js +15 -0
- package/dist/_internal/server/features/stores/adapters.d.ts +2 -2
- package/dist/_internal/server/features/stores/adapters.js +51 -0
- package/dist/_internal/server/functions/scheduled.js +38 -1
- package/dist/_internal/server/jobs/core/autoPayoutEligibility.js +9 -2
- package/dist/_internal/server/jobs/core/dailyStatusDigest.d.ts +4 -0
- package/dist/_internal/server/jobs/core/dailyStatusDigest.js +19 -2
- package/dist/_internal/server/jobs/core/index.d.ts +2 -1
- package/dist/_internal/server/jobs/core/index.js +2 -1
- package/dist/_internal/server/jobs/core/onJobCreated.d.ts +30 -7
- package/dist/_internal/server/jobs/core/onJobCreated.js +78 -45
- package/dist/_internal/server/jobs/core/onOrderStatusChange.d.ts +7 -0
- package/dist/_internal/server/jobs/core/onOrderStatusChange.js +62 -0
- package/dist/_internal/server/jobs/core/paymentReconcile.js +87 -97
- package/dist/_internal/server/jobs/core/paymentWindowTimeout.js +33 -0
- package/dist/_internal/server/jobs/core/runJobOnce.d.ts +48 -0
- package/dist/_internal/server/jobs/core/runJobOnce.js +195 -0
- package/dist/_internal/server/jobs/core/weeklyPayoutEligibility.js +10 -2
- package/dist/_internal/server/jobs/handlers/onOrderStatusChange.js +17 -0
- package/dist/_internal/server/notifications/channel-health.d.ts +26 -3
- package/dist/_internal/shared/actions/action-registry.js +177 -9
- package/dist/_internal/shared/checkout/coupon-discount.d.ts +43 -1
- package/dist/_internal/shared/checkout/coupon-discount.js +26 -1
- package/dist/_internal/shared/checkout/order-math.d.ts +145 -0
- package/dist/_internal/shared/checkout/order-math.js +173 -0
- package/dist/_internal/shared/checkout/refundable-base.d.ts +25 -0
- package/dist/_internal/shared/checkout/refundable-base.js +13 -1
- package/dist/_internal/shared/checkout/split.d.ts +87 -0
- package/dist/_internal/shared/checkout/split.js +100 -0
- package/dist/_internal/shared/content/disclaimers.d.ts +88 -0
- package/dist/_internal/shared/content/disclaimers.js +217 -0
- package/dist/_internal/shared/content/published-values.d.ts +88 -0
- package/dist/_internal/shared/content/published-values.js +198 -0
- package/dist/_internal/shared/features/admin/integrations.d.ts +109 -0
- package/dist/_internal/shared/features/admin/integrations.js +253 -0
- package/dist/_internal/shared/features/orders/dispute-reasons.d.ts +113 -0
- package/dist/_internal/shared/features/orders/dispute-reasons.js +181 -0
- package/dist/_internal/shared/features/orders/refund-copy.d.ts +1 -1
- package/dist/_internal/shared/features/orders/refund-copy.js +18 -1
- package/dist/_internal/shared/features/points/accepts.d.ts +36 -0
- package/dist/_internal/shared/features/points/accepts.js +43 -0
- package/dist/_internal/shared/features/shipping/shared-purchase.d.ts +91 -0
- package/dist/_internal/shared/features/shipping/shared-purchase.js +108 -0
- package/dist/_internal/shared/features/site-settings/types.d.ts +11 -0
- package/dist/_internal/shared/fees/calculator.d.ts +33 -1
- package/dist/_internal/shared/fees/calculator.js +32 -2
- package/dist/_internal/shared/media/limits.d.ts +10 -0
- package/dist/_internal/shared/media/limits.js +10 -0
- package/dist/_internal/shared/types/action-result.js +15 -1
- package/dist/client/api/surface-error.js +16 -2
- package/dist/client/api/useApiMutation.js +17 -1
- package/dist/client.d.ts +12 -1
- package/dist/client.js +31 -1
- package/dist/constants/api-endpoints.d.ts +45 -0
- package/dist/constants/api-endpoints.js +15 -0
- package/dist/constants/field-names.d.ts +18 -0
- package/dist/constants/field-names.js +28 -0
- package/dist/contracts/index.d.ts +1 -1
- package/dist/contracts/shipping.d.ts +45 -0
- package/dist/contracts/shipping.js +15 -0
- package/dist/core/server-action.js +19 -3
- package/dist/errors/error-mapping.js +26 -1
- package/dist/features/about/components/AboutView.js +1 -1
- package/dist/features/account/components/BuyerAuctionsGuideView.js +4 -1
- package/dist/features/account/components/UserOffersPanel.js +5 -3
- package/dist/features/account/components/UserOrdersView.js +19 -33
- package/dist/features/admin/components/AdminActionIndexView.js +100 -5
- package/dist/features/admin/components/AdminAddressClustersView.js +21 -2
- package/dist/features/admin/components/AdminBlogEditorView.js +8 -8
- package/dist/features/admin/components/AdminCarouselEditorView.js +1 -1
- package/dist/features/admin/components/AdminCarouselView.js +96 -4
- package/dist/features/admin/components/AdminCouponEditorView.js +17 -0
- package/dist/features/admin/components/AdminFulfillmentView.js +3 -2
- package/dist/features/admin/components/AdminInvoicingView.d.ts +2 -0
- package/dist/features/admin/components/AdminInvoicingView.js +65 -0
- package/dist/features/admin/components/AdminMediaView.js +36 -3
- package/dist/features/admin/components/AdminNavigationView.js +4 -1
- package/dist/features/admin/components/AdminOffersView.js +2 -1
- package/dist/features/admin/components/AdminOrderEditorView.d.ts +18 -1
- package/dist/features/admin/components/AdminOrderEditorView.js +11 -2
- package/dist/features/admin/components/AdminOrdersGuideView.js +23 -2
- package/dist/features/admin/components/AdminOrdersView.js +67 -5
- package/dist/features/admin/components/AdminPaymentClustersView.js +19 -2
- package/dist/features/admin/components/AdminProductEditorView.js +2 -2
- package/dist/features/admin/components/AdminSectionsView.d.ts +10 -0
- package/dist/features/admin/components/AdminSectionsView.js +486 -224
- package/dist/features/admin/components/OwnerQuickActions.js +24 -2
- package/dist/features/admin/components/ReferenceRecordEditor.js +1 -1
- package/dist/features/admin/constants/filter-tabs.d.ts +6 -0
- package/dist/features/admin/constants/filter-tabs.js +6 -0
- package/dist/features/admin/constants/site-settings-tabs.d.ts +1 -1
- package/dist/features/admin/hooks/useAdminListingData.js +16 -0
- package/dist/features/admin/hooks/useOptimisticRowFlag.d.ts +33 -0
- package/dist/features/admin/hooks/useOptimisticRowFlag.js +87 -0
- package/dist/features/admin/repository/notification.repository.d.ts +15 -0
- package/dist/features/admin/repository/notification.repository.js +32 -0
- package/dist/features/admin/schemas/action-index-form.d.ts +34 -0
- package/dist/features/admin/schemas/action-index-form.js +115 -0
- package/dist/features/admin/schemas/admin-user-form.d.ts +2 -2
- package/dist/features/admin/schemas/firestore.d.ts +30 -0
- package/dist/features/admin/schemas/firestore.js +5 -0
- package/dist/features/audit-log/schemas/firestore.d.ts +30 -0
- package/dist/features/audit-log/schemas/firestore.js +15 -0
- package/dist/features/auth/components/RegisterForm.js +2 -1
- package/dist/features/auth/permissions/constants.js +13 -0
- package/dist/features/cart/components/CartPriceBreakdown.d.ts +13 -0
- package/dist/features/cart/components/CartPriceBreakdown.js +6 -2
- package/dist/features/cart/components/PointsTenderPicker.d.ts +61 -0
- package/dist/features/cart/components/PointsTenderPicker.js +15 -0
- package/dist/features/cart/components/StoreAddonsPicker.js +2 -1
- package/dist/features/cart/components/index.d.ts +2 -0
- package/dist/features/cart/components/index.js +1 -0
- package/dist/features/cart/repository/cart.repository.d.ts +19 -0
- package/dist/features/cart/repository/cart.repository.js +27 -0
- package/dist/features/cart/schemas/firestore.d.ts +92 -0
- package/dist/features/catalogue/components/CatalogueItemEditorView.js +3 -3
- package/dist/features/contact/email.d.ts +27 -10
- package/dist/features/contact/email.js +20 -3
- package/dist/features/dispute-reasons/repository/dispute-reasons.repository.d.ts +38 -0
- package/dist/features/dispute-reasons/repository/dispute-reasons.repository.js +80 -0
- package/dist/features/dispute-reasons/schemas/firestore.d.ts +64 -0
- package/dist/features/dispute-reasons/schemas/firestore.js +40 -0
- package/dist/features/events/components/AdminEventEditorView.js +8 -6
- package/dist/features/faq/components/FAQAccordion.d.ts +13 -1
- package/dist/features/faq/components/FAQAccordion.js +29 -4
- package/dist/features/invoicing/schemas/firestore.d.ts +112 -0
- package/dist/features/invoicing/schemas/firestore.js +45 -0
- package/dist/features/invoicing/utils/financial-year.d.ts +43 -0
- package/dist/features/invoicing/utils/financial-year.js +53 -0
- package/dist/features/jobs/actions/enqueue-job.js +18 -1
- package/dist/features/jobs/repository/jobs.repository.d.ts +62 -1
- package/dist/features/jobs/repository/jobs.repository.js +84 -1
- package/dist/features/jobs/schemas/firestore.d.ts +80 -0
- package/dist/features/jobs/schemas/firestore.js +37 -0
- package/dist/features/layout/hooks/useFormBottomActions.js +20 -1
- package/dist/features/lottery/schemas/zod.d.ts +6 -6
- package/dist/features/media/MediaImage.js +22 -1
- package/dist/features/media/upload/ImageUpload.js +1 -1
- package/dist/features/obligations/constants/policies.js +24 -1
- package/dist/features/orders/components/EmiInstallmentsPanel.js +25 -7
- package/dist/features/orders/components/OrderPaymentSummary.js +10 -1
- package/dist/features/orders/components/OrderProvenanceCard.d.ts +8 -0
- package/dist/features/orders/components/OrderProvenanceCard.js +185 -0
- package/dist/features/orders/components/RaiseDisputeForm.d.ts +14 -0
- package/dist/features/orders/components/RaiseDisputeForm.js +111 -0
- package/dist/features/orders/components/RefundRequestView.js +22 -4
- package/dist/features/orders/components/index.d.ts +4 -0
- package/dist/features/orders/components/index.js +2 -0
- package/dist/features/orders/constants/order-lane-tabs.d.ts +69 -0
- package/dist/features/orders/constants/order-lane-tabs.js +88 -0
- package/dist/features/orders/repository/orders.repository.d.ts +57 -0
- package/dist/features/orders/repository/orders.repository.js +145 -0
- package/dist/features/orders/schemas/firestore.d.ts +196 -1
- package/dist/features/orders/schemas/index.d.ts +60 -12
- package/dist/features/orders/schemas/index.js +12 -0
- package/dist/features/orders/types/index.d.ts +26 -0
- package/dist/features/orders/utils/courier-block.d.ts +25 -0
- package/dist/features/orders/utils/courier-block.js +23 -0
- package/dist/features/payment-cases/schemas/firestore.d.ts +26 -1
- package/dist/features/payment-cases/schemas/firestore.js +1 -0
- package/dist/features/products/components/GroupMemberPicker.js +4 -1
- package/dist/features/products/components/PrizeDrawDetailPageView.js +2 -2
- package/dist/features/products/components/PrizeDrawEntryActions.js +2 -1
- package/dist/features/products/components/ProductDetailActions.js +2 -1
- package/dist/features/products/components/ProductDetailPageView.d.ts +17 -1
- package/dist/features/products/components/ProductDetailPageView.js +2 -2
- package/dist/features/products/schemas/product-features.validators.d.ts +10 -10
- package/dist/features/promotions/actions/coupon-stacking.d.ts +30 -3
- package/dist/features/promotions/actions/coupon-stacking.js +21 -2
- package/dist/features/promotions/components/CouponCard.js +13 -0
- package/dist/features/promotions/constants/coupon-help.d.ts +2 -2
- package/dist/features/promotions/constants/coupon-help.js +9 -1
- package/dist/features/promotions/schemas/firestore.d.ts +24 -0
- package/dist/features/promotions/schemas/firestore.js +4 -0
- package/dist/features/promotions/types/index.d.ts +19 -1
- package/dist/features/scams/components/ScamProfileView.js +2 -2
- package/dist/features/scams/components/ScamRegistryView.js +2 -2
- package/dist/features/search/action-index/tab-entries.js +1 -1
- package/dist/features/seller/actions/seller-actions.js +33 -3
- package/dist/features/seller/components/FulfillmentView.js +3 -2
- package/dist/features/seller/components/SellerAddressesView.js +32 -4
- package/dist/features/seller/components/SellerAnalyticsAlertsView.js +62 -3
- package/dist/features/seller/components/SellerBundlesView.js +53 -14
- package/dist/features/seller/components/SellerGroupedListingsView.js +23 -3
- package/dist/features/seller/components/SellerListingTypeView.js +56 -10
- package/dist/features/seller/components/SellerOrdersView.js +129 -27
- package/dist/features/seller/components/SellerPayoutMethodsView.js +33 -1
- package/dist/features/seller/components/SellerPayoutSettingsView.js +48 -9
- package/dist/features/seller/components/SellerProductsView.js +5 -1
- package/dist/features/seller/components/SellerShippingConfigsView.js +33 -1
- package/dist/features/seller/components/SellerShippingView.js +2 -1
- package/dist/features/seller/components/SellerStoreCategoriesView.js +33 -1
- package/dist/features/seller/components/SellerSupportView.js +69 -2
- package/dist/features/seller/hooks/useSellerListingData.js +25 -0
- package/dist/features/shell/SectionForm.js +20 -16
- package/dist/features/shell/build-sections.js +14 -1
- package/dist/features/shipments/components/AdminShipmentLotItemsView.js +54 -1
- package/dist/features/shipments/components/AdminShipmentProjectionsView.js +3 -2
- package/dist/features/shipments/schemas/validation.d.ts +4 -4
- package/dist/features/shipping-boxes/repository/shipping-boxes.repository.d.ts +43 -0
- package/dist/features/shipping-boxes/repository/shipping-boxes.repository.js +90 -0
- package/dist/features/shipping-boxes/schemas/firestore.d.ts +82 -0
- package/dist/features/shipping-boxes/schemas/firestore.js +53 -0
- package/dist/features/sticker-trace/components/StickerCommitPanel.js +2 -1
- package/dist/features/sticker-trace/components/StickerPrintPanel.js +2 -1
- package/dist/features/sticker-trace/components/StickerRetryPanel.js +24 -4
- package/dist/features/sticker-trace/components/StickerTraceStudio.js +2 -1
- package/dist/features/store-extensions/schemas/report-create-form.d.ts +2 -2
- package/dist/features/store-extensions/schemas/shipping-config-form.d.ts +2 -2
- package/dist/features/stores/components/StoreOrdersGuideView.js +6 -1
- package/dist/features/stores/schemas/firestore.d.ts +71 -0
- package/dist/features/stores/types/index.d.ts +19 -0
- package/dist/features/support/schemas/index.d.ts +6 -6
- package/dist/features/tester/components/AdminTesterFeedbackIssuesView.js +3 -2
- package/dist/features/wishlist/hooks/useWishlistWithGuest.d.ts +1 -1
- package/dist/index.d.ts +11 -2
- package/dist/index.js +17 -2
- package/dist/next/routing/route-map.d.ts +24 -0
- package/dist/next/routing/route-map.js +19 -0
- package/dist/providers/shipping-shiprocket/index.d.ts +27 -1
- package/dist/providers/shipping-shiprocket/index.js +84 -1
- package/dist/schemas/registry.d.ts +51 -22
- package/dist/schemas/sieve.d.ts +5 -5
- package/dist/server-entry.d.ts +2 -2
- package/dist/server-entry.js +8 -1
- package/dist/server.d.ts +11 -2
- package/dist/server.js +40 -2
- package/dist/styles.css +64 -80
- package/dist/tailwind-utilities.css +1 -1
- package/dist/tokens/themes/default-dark.js +1 -0
- package/dist/tokens/themes/default-light.js +1 -0
- package/dist/tokens/themes/required.d.ts +1 -1
- package/dist/tokens/themes/required.js +1 -0
- package/dist/tokens/tokens.css +15 -0
- package/dist/ui/components/Checkbox.js +10 -2
- package/dist/ui/components/DateInput.js +8 -1
- package/dist/ui/components/Disclaimer.d.ts +19 -0
- package/dist/ui/components/Disclaimer.js +74 -0
- package/dist/ui/components/Input.js +22 -2
- package/dist/ui/components/PaginatedSelect.d.ts +8 -19
- package/dist/ui/components/PaginatedSelect.js +43 -9
- package/dist/ui/components/Radio.js +8 -1
- package/dist/ui/components/Select.js +10 -2
- package/dist/ui/components/TagInput.d.ts +8 -1
- package/dist/ui/components/TagInput.js +4 -3
- package/dist/ui/components/Textarea.js +10 -2
- package/dist/ui/components/tabs-overflow.js +64 -11
- package/dist/ui/forms/FieldCheckbox.js +1 -1
- package/dist/ui/forms/FormErrorList.d.ts +0 -16
- package/dist/ui/forms/FormErrorList.js +34 -1
- package/dist/ui/forms/apply-zod-issues.d.ts +19 -1
- package/dist/ui/forms/apply-zod-issues.js +23 -1
- package/dist/ui/index.d.ts +2 -0
- package/dist/ui/index.js +6 -0
- package/dist/ui/rich-text/RichText.style.css +48 -79
- package/package.json +1 -1
- package/scripts/seed-cli.mjs +1831 -1822
|
@@ -182,6 +182,8 @@ export declare const DEFAULT_ROUTE_MAP: {
|
|
|
182
182
|
readonly CLAIMED_COUPONS: "/user/coupons";
|
|
183
183
|
/** Points balance + ledger. 1 point = ₹1, spendable at checkout. */
|
|
184
184
|
readonly POINTS: "/user/points";
|
|
185
|
+
readonly SESSIONS: "/user/sessions";
|
|
186
|
+
readonly PAYMENT_METHODS: "/user/payment-methods";
|
|
185
187
|
readonly BECOME_SELLER: "/user/become-seller";
|
|
186
188
|
readonly CART: "/cart";
|
|
187
189
|
readonly CHECKOUT: "/checkout";
|
|
@@ -375,6 +377,16 @@ export declare const DEFAULT_ROUTE_MAP: {
|
|
|
375
377
|
readonly AUDIT_LOG: "/admin/audit-log";
|
|
376
378
|
readonly MONEY_CASES: "/admin/money-cases";
|
|
377
379
|
readonly MONEY_CASE_DETAIL: (id: string) => string;
|
|
380
|
+
/**
|
|
381
|
+
* Phase 7 — the GSTR-1 draft export.
|
|
382
|
+
*
|
|
383
|
+
* 🛑 Under Finance for the same reason `MONEY_CASES` is, and the reason is
|
|
384
|
+
* stronger here: the export contains the company's tax position for a
|
|
385
|
+
* quarter plus every buyer's place of supply. That is not a maintenance
|
|
386
|
+
* diagnostic, and it is admin-only — deliberately not granted to
|
|
387
|
+
* `maintenance_employee`.
|
|
388
|
+
*/
|
|
389
|
+
readonly INVOICING: "/admin/invoicing";
|
|
378
390
|
readonly PROTECTION_CLAIMS: "/admin/protection-claims";
|
|
379
391
|
readonly MAINTENANCE_GATEWAY_EVENTS: "/admin/maintenance/gateway-events";
|
|
380
392
|
readonly MAINTENANCE_OBLIGATIONS: "/admin/maintenance/obligations";
|
|
@@ -634,6 +646,8 @@ export declare const ROUTES: {
|
|
|
634
646
|
readonly CLAIMED_COUPONS: "/user/coupons";
|
|
635
647
|
/** Points balance + ledger. 1 point = ₹1, spendable at checkout. */
|
|
636
648
|
readonly POINTS: "/user/points";
|
|
649
|
+
readonly SESSIONS: "/user/sessions";
|
|
650
|
+
readonly PAYMENT_METHODS: "/user/payment-methods";
|
|
637
651
|
readonly BECOME_SELLER: "/user/become-seller";
|
|
638
652
|
readonly CART: "/cart";
|
|
639
653
|
readonly CHECKOUT: "/checkout";
|
|
@@ -827,6 +841,16 @@ export declare const ROUTES: {
|
|
|
827
841
|
readonly AUDIT_LOG: "/admin/audit-log";
|
|
828
842
|
readonly MONEY_CASES: "/admin/money-cases";
|
|
829
843
|
readonly MONEY_CASE_DETAIL: (id: string) => string;
|
|
844
|
+
/**
|
|
845
|
+
* Phase 7 — the GSTR-1 draft export.
|
|
846
|
+
*
|
|
847
|
+
* 🛑 Under Finance for the same reason `MONEY_CASES` is, and the reason is
|
|
848
|
+
* stronger here: the export contains the company's tax position for a
|
|
849
|
+
* quarter plus every buyer's place of supply. That is not a maintenance
|
|
850
|
+
* diagnostic, and it is admin-only — deliberately not granted to
|
|
851
|
+
* `maintenance_employee`.
|
|
852
|
+
*/
|
|
853
|
+
readonly INVOICING: "/admin/invoicing";
|
|
830
854
|
readonly PROTECTION_CLAIMS: "/admin/protection-claims";
|
|
831
855
|
readonly MAINTENANCE_GATEWAY_EVENTS: "/admin/maintenance/gateway-events";
|
|
832
856
|
readonly MAINTENANCE_OBLIGATIONS: "/admin/maintenance/obligations";
|
|
@@ -302,6 +302,15 @@ export const DEFAULT_ROUTE_MAP = {
|
|
|
302
302
|
CLAIMED_COUPONS: "/user/coupons",
|
|
303
303
|
/** Points balance + ledger. 1 point = ₹1, spendable at checkout. */
|
|
304
304
|
POINTS: "/user/points",
|
|
305
|
+
/*
|
|
306
|
+
* 🛑 Both of these had a COMPLETE API and no page. `GET /api/user/sessions`
|
|
307
|
+
* + `DELETE [id]`, and `GET/POST /api/user/payment-methods` + `DELETE
|
|
308
|
+
* [id]`, were all live with zero consumers — and `BuyerAccountGuideView`
|
|
309
|
+
* already told buyers to "view all devices signed in at My Account →
|
|
310
|
+
* Sessions", pointing at a security control that did not exist.
|
|
311
|
+
*/
|
|
312
|
+
SESSIONS: "/user/sessions",
|
|
313
|
+
PAYMENT_METHODS: "/user/payment-methods",
|
|
305
314
|
BECOME_SELLER: "/user/become-seller",
|
|
306
315
|
CART: "/cart",
|
|
307
316
|
CHECKOUT: "/checkout",
|
|
@@ -570,6 +579,16 @@ export const DEFAULT_ROUTE_MAP = {
|
|
|
570
579
|
*/
|
|
571
580
|
MONEY_CASES: "/admin/money-cases",
|
|
572
581
|
MONEY_CASE_DETAIL: (id) => `/admin/money-cases/${id}`,
|
|
582
|
+
/**
|
|
583
|
+
* Phase 7 — the GSTR-1 draft export.
|
|
584
|
+
*
|
|
585
|
+
* 🛑 Under Finance for the same reason `MONEY_CASES` is, and the reason is
|
|
586
|
+
* stronger here: the export contains the company's tax position for a
|
|
587
|
+
* quarter plus every buyer's place of supply. That is not a maintenance
|
|
588
|
+
* diagnostic, and it is admin-only — deliberately not granted to
|
|
589
|
+
* `maintenance_employee`.
|
|
590
|
+
*/
|
|
591
|
+
INVOICING: "/admin/invoicing",
|
|
573
592
|
PROTECTION_CLAIMS: "/admin/protection-claims",
|
|
574
593
|
MAINTENANCE_GATEWAY_EVENTS: "/admin/maintenance/gateway-events",
|
|
575
594
|
MAINTENANCE_OBLIGATIONS: "/admin/maintenance/obligations",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
* @tag access:server-only
|
|
67
67
|
*/
|
|
68
68
|
import { IShippingProvider } from "../../contracts";
|
|
69
|
-
import type { CreateShipmentInput, Shipment, TrackingInfo, ServiceabilityResult } from "../../contracts";
|
|
69
|
+
import type { CreateShipmentInput, Shipment, TrackingInfo, ServiceabilityResult, WalletBalance } from "../../contracts";
|
|
70
70
|
export interface ShiprocketConfig {
|
|
71
71
|
/** The API user's email. See the header on why this is not a "login id". */
|
|
72
72
|
email: string;
|
|
@@ -74,6 +74,21 @@ export interface ShiprocketConfig {
|
|
|
74
74
|
/** Shiprocket pickup-location nickname, as registered in their dashboard. */
|
|
75
75
|
pickupLocation?: string;
|
|
76
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* Does this upstream error body look like "your wallet is empty"?
|
|
79
|
+
*
|
|
80
|
+
* 🛑 The substring list is UNVERIFIED and that is acceptable, because of where
|
|
81
|
+
* it sits in the design: a funding failure and any other booking failure take
|
|
82
|
+
* the SAME path — the order gets a `courierBlock`, the admin is alerted, the
|
|
83
|
+
* seller is offered retry-or-self-ship. Classifying only changes the WORDING
|
|
84
|
+
* of the operator's alert. So a false negative costs a less specific message
|
|
85
|
+
* and never a wrong action, which is why this is allowed to be a heuristic
|
|
86
|
+
* rather than something this plan pretended to have confirmed.
|
|
87
|
+
*
|
|
88
|
+
* Triggering the real error would mean deliberately booking a shipment against
|
|
89
|
+
* a drained wallet, which is not a probe anyone should run on a live account.
|
|
90
|
+
*/
|
|
91
|
+
export declare function looksLikeInsufficientFunds(body: string): boolean;
|
|
77
92
|
export declare class ShiprocketShippingProvider extends IShippingProvider {
|
|
78
93
|
private readonly config;
|
|
79
94
|
readonly name = "shiprocket";
|
|
@@ -119,6 +134,17 @@ export declare class ShiprocketShippingProvider extends IShippingProvider {
|
|
|
119
134
|
*/
|
|
120
135
|
createShipment(data: CreateShipmentInput): Promise<Shipment>;
|
|
121
136
|
trackShipment(trackingId: string): Promise<TrackingInfo>;
|
|
137
|
+
/**
|
|
138
|
+
* The prepaid wallet balance. Read-only; never charges anything.
|
|
139
|
+
*
|
|
140
|
+
* 🛑 Returns `{ known: false, supported: true }` on ANY failure rather than
|
|
141
|
+
* `0`. Shiprocket HAS a wallet, so `supported` is true regardless — the
|
|
142
|
+
* caller must treat "unreadable" as "attempt the booking anyway and let the
|
|
143
|
+
* attempt's own failure decide", because refusing on an unreadable balance
|
|
144
|
+
* would block every order on a transient network blip. A `0` here is a real
|
|
145
|
+
* decision to skip; an unreadable balance is not.
|
|
146
|
+
*/
|
|
147
|
+
getWalletBalance(): Promise<WalletBalance>;
|
|
122
148
|
cancelShipment(shipmentId: string): Promise<void>;
|
|
123
149
|
checkServiceability(pincode: string, weight: number): Promise<ServiceabilityResult>;
|
|
124
150
|
generateLabel(shipmentId: string): Promise<ArrayBuffer>;
|
|
@@ -117,6 +117,42 @@ const serviceabilityResponse = z.object({
|
|
|
117
117
|
.nullish(),
|
|
118
118
|
}),
|
|
119
119
|
});
|
|
120
|
+
/*
|
|
121
|
+
* Measured against the live API 2026-10-22 (read-only probe, one auth + GETs):
|
|
122
|
+
*
|
|
123
|
+
* GET /account/details/wallet-balance -> 200 { data: { balance_amount: string } }
|
|
124
|
+
* GET /account/details -> 404
|
|
125
|
+
*
|
|
126
|
+
* 🛑 `balance_amount` is a STRING, and there is NO credit-limit field — so
|
|
127
|
+
* postpaid headroom is not readable from this API at all. See `WalletBalance`
|
|
128
|
+
* in contracts/shipping.ts for why no such field is declared.
|
|
129
|
+
*/
|
|
130
|
+
const walletBalanceResponse = z.object({
|
|
131
|
+
data: z.object({
|
|
132
|
+
balance_amount: z.union([z.number(), z.string()]).nullish(),
|
|
133
|
+
}),
|
|
134
|
+
});
|
|
135
|
+
/**
|
|
136
|
+
* Does this upstream error body look like "your wallet is empty"?
|
|
137
|
+
*
|
|
138
|
+
* 🛑 The substring list is UNVERIFIED and that is acceptable, because of where
|
|
139
|
+
* it sits in the design: a funding failure and any other booking failure take
|
|
140
|
+
* the SAME path — the order gets a `courierBlock`, the admin is alerted, the
|
|
141
|
+
* seller is offered retry-or-self-ship. Classifying only changes the WORDING
|
|
142
|
+
* of the operator's alert. So a false negative costs a less specific message
|
|
143
|
+
* and never a wrong action, which is why this is allowed to be a heuristic
|
|
144
|
+
* rather than something this plan pretended to have confirmed.
|
|
145
|
+
*
|
|
146
|
+
* Triggering the real error would mean deliberately booking a shipment against
|
|
147
|
+
* a drained wallet, which is not a probe anyone should run on a live account.
|
|
148
|
+
*/
|
|
149
|
+
export function looksLikeInsufficientFunds(body) {
|
|
150
|
+
const s = body.toLowerCase();
|
|
151
|
+
return (s.includes("insufficient") ||
|
|
152
|
+
s.includes("low balance") ||
|
|
153
|
+
s.includes("recharge") ||
|
|
154
|
+
(s.includes("wallet") && s.includes("balance")));
|
|
155
|
+
}
|
|
120
156
|
function num(v, fallback = 0) {
|
|
121
157
|
const n = typeof v === "string" ? Number.parseFloat(v) : v;
|
|
122
158
|
return typeof n === "number" && Number.isFinite(n) ? n : fallback;
|
|
@@ -230,7 +266,24 @@ export class ShiprocketShippingProvider extends IShippingProvider {
|
|
|
230
266
|
res = await attempt(true);
|
|
231
267
|
}
|
|
232
268
|
if (!res.ok) {
|
|
233
|
-
|
|
269
|
+
/*
|
|
270
|
+
* The body is read and carried, not discarded.
|
|
271
|
+
*
|
|
272
|
+
* It used to throw on `res.status` alone, which meant a funding failure
|
|
273
|
+
* and a malformed-address failure were indistinguishable to every
|
|
274
|
+
* caller — and the first of those is the one an operator can actually
|
|
275
|
+
* fix, by topping up.
|
|
276
|
+
*
|
|
277
|
+
* Truncated, because an upstream error page can be a whole HTML
|
|
278
|
+
* document and this string ends up in a log line.
|
|
279
|
+
*/
|
|
280
|
+
const body = await res.text().catch(() => "");
|
|
281
|
+
const insufficient = looksLikeInsufficientFunds(body);
|
|
282
|
+
throw new ApiError(502, `Shiprocket ${path} failed (${res.status}).`, {
|
|
283
|
+
code: insufficient ? "SHIPROCKET_INSUFFICIENT_FUNDS" : "SHIPROCKET_REQUEST_FAILED",
|
|
284
|
+
upstreamStatus: res.status,
|
|
285
|
+
upstreamBody: body.slice(0, 500),
|
|
286
|
+
});
|
|
234
287
|
}
|
|
235
288
|
const json = await res.json();
|
|
236
289
|
return parseUpstream(contract, json, path);
|
|
@@ -331,6 +384,36 @@ export class ShiprocketShippingProvider extends IShippingProvider {
|
|
|
331
384
|
})),
|
|
332
385
|
};
|
|
333
386
|
}
|
|
387
|
+
/**
|
|
388
|
+
* The prepaid wallet balance. Read-only; never charges anything.
|
|
389
|
+
*
|
|
390
|
+
* 🛑 Returns `{ known: false, supported: true }` on ANY failure rather than
|
|
391
|
+
* `0`. Shiprocket HAS a wallet, so `supported` is true regardless — the
|
|
392
|
+
* caller must treat "unreadable" as "attempt the booking anyway and let the
|
|
393
|
+
* attempt's own failure decide", because refusing on an unreadable balance
|
|
394
|
+
* would block every order on a transient network blip. A `0` here is a real
|
|
395
|
+
* decision to skip; an unreadable balance is not.
|
|
396
|
+
*/
|
|
397
|
+
async getWalletBalance() {
|
|
398
|
+
try {
|
|
399
|
+
const out = await this.call("/account/details/wallet-balance", { method: "GET" }, walletBalanceResponse);
|
|
400
|
+
const raw = out.data.balance_amount;
|
|
401
|
+
/*
|
|
402
|
+
* `num()` would silently fold an unparseable string into its fallback,
|
|
403
|
+
* which is exactly the 0-means-unknown conflation this type exists to
|
|
404
|
+
* prevent. Parsed explicitly so a bad payload reports `known: false`.
|
|
405
|
+
*/
|
|
406
|
+
const parsed = typeof raw === "string" ? Number.parseFloat(raw) : raw;
|
|
407
|
+
if (typeof parsed !== "number" || !Number.isFinite(parsed)) {
|
|
408
|
+
return { known: false, supported: true, reason: "unparseable balance_amount" };
|
|
409
|
+
}
|
|
410
|
+
return { known: true, amount: parsed, currency: "INR" };
|
|
411
|
+
}
|
|
412
|
+
catch (err) {
|
|
413
|
+
const normalized = normalizeError(err);
|
|
414
|
+
return { known: false, supported: true, reason: normalized.message };
|
|
415
|
+
}
|
|
416
|
+
}
|
|
334
417
|
async cancelShipment(shipmentId) {
|
|
335
418
|
await this.call("/orders/cancel", { method: "POST", body: JSON.stringify({ ids: [shipmentId] }) },
|
|
336
419
|
// Their cancel returns a message envelope we do not read; accepting any
|
|
@@ -2801,8 +2801,8 @@ export declare const SCHEMAS: {
|
|
|
2801
2801
|
}, import("zod").ZodTypeAny, "passthrough">>]>>;
|
|
2802
2802
|
}, "strip", import("zod").ZodTypeAny, {
|
|
2803
2803
|
status: "paid" | "pending" | "overdue";
|
|
2804
|
-
amount: number;
|
|
2805
2804
|
index: number;
|
|
2805
|
+
amount: number;
|
|
2806
2806
|
dueDate: string | Date | import("zod").objectOutputType<{
|
|
2807
2807
|
toDate: import("zod").ZodFunction<import("zod").ZodTuple<[], import("zod").ZodUnknown>, import("zod").ZodDate>;
|
|
2808
2808
|
}, import("zod").ZodTypeAny, "passthrough">;
|
|
@@ -2816,8 +2816,8 @@ export declare const SCHEMAS: {
|
|
|
2816
2816
|
}, import("zod").ZodTypeAny, "passthrough"> | undefined;
|
|
2817
2817
|
}, {
|
|
2818
2818
|
status: "paid" | "pending" | "overdue";
|
|
2819
|
-
amount: number;
|
|
2820
2819
|
index: number;
|
|
2820
|
+
amount: number;
|
|
2821
2821
|
dueDate: string | Date | import("zod").objectInputType<{
|
|
2822
2822
|
toDate: import("zod").ZodFunction<import("zod").ZodTuple<[], import("zod").ZodUnknown>, import("zod").ZodDate>;
|
|
2823
2823
|
}, import("zod").ZodTypeAny, "passthrough">;
|
|
@@ -2895,6 +2895,15 @@ export declare const SCHEMAS: {
|
|
|
2895
2895
|
proofDocumentUrl: import("zod").ZodOptional<import("zod").ZodString>;
|
|
2896
2896
|
proofDocumentMimeType: import("zod").ZodOptional<import("zod").ZodString>;
|
|
2897
2897
|
overrideReason: import("zod").ZodOptional<import("zod").ZodString>;
|
|
2898
|
+
creditNoteNumber: import("zod").ZodOptional<import("zod").ZodString>;
|
|
2899
|
+
creditNoteIssuedAt: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodDate, import("zod").ZodString, import("zod").ZodObject<{
|
|
2900
|
+
toDate: import("zod").ZodFunction<import("zod").ZodTuple<[], import("zod").ZodUnknown>, import("zod").ZodDate>;
|
|
2901
|
+
}, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
|
|
2902
|
+
toDate: import("zod").ZodFunction<import("zod").ZodTuple<[], import("zod").ZodUnknown>, import("zod").ZodDate>;
|
|
2903
|
+
}, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
|
|
2904
|
+
toDate: import("zod").ZodFunction<import("zod").ZodTuple<[], import("zod").ZodUnknown>, import("zod").ZodDate>;
|
|
2905
|
+
}, import("zod").ZodTypeAny, "passthrough">>]>>;
|
|
2906
|
+
creditNoteStoragePath: import("zod").ZodOptional<import("zod").ZodString>;
|
|
2898
2907
|
}, "strip", import("zod").ZodTypeAny, {
|
|
2899
2908
|
type: "full" | "partial";
|
|
2900
2909
|
amount: number;
|
|
@@ -2905,8 +2914,8 @@ export declare const SCHEMAS: {
|
|
|
2905
2914
|
}, import("zod").ZodTypeAny, "passthrough">;
|
|
2906
2915
|
refundedBy: string;
|
|
2907
2916
|
status?: "failed" | "processed" | "reserved" | undefined;
|
|
2908
|
-
failureReason?: string | undefined;
|
|
2909
2917
|
gateway?: string | undefined;
|
|
2918
|
+
failureReason?: string | undefined;
|
|
2910
2919
|
itemIds?: string[] | undefined;
|
|
2911
2920
|
reasonCode?: string | undefined;
|
|
2912
2921
|
gatewayRefundId?: string | undefined;
|
|
@@ -2916,6 +2925,11 @@ export declare const SCHEMAS: {
|
|
|
2916
2925
|
proofDocumentUrl?: string | undefined;
|
|
2917
2926
|
proofDocumentMimeType?: string | undefined;
|
|
2918
2927
|
overrideReason?: string | undefined;
|
|
2928
|
+
creditNoteNumber?: string | undefined;
|
|
2929
|
+
creditNoteIssuedAt?: string | Date | import("zod").objectOutputType<{
|
|
2930
|
+
toDate: import("zod").ZodFunction<import("zod").ZodTuple<[], import("zod").ZodUnknown>, import("zod").ZodDate>;
|
|
2931
|
+
}, import("zod").ZodTypeAny, "passthrough"> | undefined;
|
|
2932
|
+
creditNoteStoragePath?: string | undefined;
|
|
2919
2933
|
}, {
|
|
2920
2934
|
type: "full" | "partial";
|
|
2921
2935
|
amount: number;
|
|
@@ -2926,8 +2940,8 @@ export declare const SCHEMAS: {
|
|
|
2926
2940
|
}, import("zod").ZodTypeAny, "passthrough">;
|
|
2927
2941
|
refundedBy: string;
|
|
2928
2942
|
status?: "failed" | "processed" | "reserved" | undefined;
|
|
2929
|
-
failureReason?: string | undefined;
|
|
2930
2943
|
gateway?: string | undefined;
|
|
2944
|
+
failureReason?: string | undefined;
|
|
2931
2945
|
itemIds?: string[] | undefined;
|
|
2932
2946
|
reasonCode?: string | undefined;
|
|
2933
2947
|
gatewayRefundId?: string | undefined;
|
|
@@ -2937,6 +2951,11 @@ export declare const SCHEMAS: {
|
|
|
2937
2951
|
proofDocumentUrl?: string | undefined;
|
|
2938
2952
|
proofDocumentMimeType?: string | undefined;
|
|
2939
2953
|
overrideReason?: string | undefined;
|
|
2954
|
+
creditNoteNumber?: string | undefined;
|
|
2955
|
+
creditNoteIssuedAt?: string | Date | import("zod").objectInputType<{
|
|
2956
|
+
toDate: import("zod").ZodFunction<import("zod").ZodTuple<[], import("zod").ZodUnknown>, import("zod").ZodDate>;
|
|
2957
|
+
}, import("zod").ZodTypeAny, "passthrough"> | undefined;
|
|
2958
|
+
creditNoteStoragePath?: string | undefined;
|
|
2940
2959
|
}>, "many">>;
|
|
2941
2960
|
contestable: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
2942
2961
|
adminBypassBy: import("zod").ZodOptional<import("zod").ZodString>;
|
|
@@ -3080,8 +3099,8 @@ export declare const SCHEMAS: {
|
|
|
3080
3099
|
emiSurchargeAmount?: number | undefined;
|
|
3081
3100
|
emiInstallments?: {
|
|
3082
3101
|
status: "paid" | "pending" | "overdue";
|
|
3083
|
-
amount: number;
|
|
3084
3102
|
index: number;
|
|
3103
|
+
amount: number;
|
|
3085
3104
|
dueDate: string | Date | import("zod").objectOutputType<{
|
|
3086
3105
|
toDate: import("zod").ZodFunction<import("zod").ZodTuple<[], import("zod").ZodUnknown>, import("zod").ZodDate>;
|
|
3087
3106
|
}, import("zod").ZodTypeAny, "passthrough">;
|
|
@@ -3107,8 +3126,8 @@ export declare const SCHEMAS: {
|
|
|
3107
3126
|
}, import("zod").ZodTypeAny, "passthrough">;
|
|
3108
3127
|
refundedBy: string;
|
|
3109
3128
|
status?: "failed" | "processed" | "reserved" | undefined;
|
|
3110
|
-
failureReason?: string | undefined;
|
|
3111
3129
|
gateway?: string | undefined;
|
|
3130
|
+
failureReason?: string | undefined;
|
|
3112
3131
|
itemIds?: string[] | undefined;
|
|
3113
3132
|
reasonCode?: string | undefined;
|
|
3114
3133
|
gatewayRefundId?: string | undefined;
|
|
@@ -3118,6 +3137,11 @@ export declare const SCHEMAS: {
|
|
|
3118
3137
|
proofDocumentUrl?: string | undefined;
|
|
3119
3138
|
proofDocumentMimeType?: string | undefined;
|
|
3120
3139
|
overrideReason?: string | undefined;
|
|
3140
|
+
creditNoteNumber?: string | undefined;
|
|
3141
|
+
creditNoteIssuedAt?: string | Date | import("zod").objectOutputType<{
|
|
3142
|
+
toDate: import("zod").ZodFunction<import("zod").ZodTuple<[], import("zod").ZodUnknown>, import("zod").ZodDate>;
|
|
3143
|
+
}, import("zod").ZodTypeAny, "passthrough"> | undefined;
|
|
3144
|
+
creditNoteStoragePath?: string | undefined;
|
|
3121
3145
|
}[] | undefined;
|
|
3122
3146
|
contestable?: boolean | undefined;
|
|
3123
3147
|
adminBypassBy?: string | undefined;
|
|
@@ -3234,8 +3258,8 @@ export declare const SCHEMAS: {
|
|
|
3234
3258
|
emiSurchargeAmount?: number | undefined;
|
|
3235
3259
|
emiInstallments?: {
|
|
3236
3260
|
status: "paid" | "pending" | "overdue";
|
|
3237
|
-
amount: number;
|
|
3238
3261
|
index: number;
|
|
3262
|
+
amount: number;
|
|
3239
3263
|
dueDate: string | Date | import("zod").objectInputType<{
|
|
3240
3264
|
toDate: import("zod").ZodFunction<import("zod").ZodTuple<[], import("zod").ZodUnknown>, import("zod").ZodDate>;
|
|
3241
3265
|
}, import("zod").ZodTypeAny, "passthrough">;
|
|
@@ -3261,8 +3285,8 @@ export declare const SCHEMAS: {
|
|
|
3261
3285
|
}, import("zod").ZodTypeAny, "passthrough">;
|
|
3262
3286
|
refundedBy: string;
|
|
3263
3287
|
status?: "failed" | "processed" | "reserved" | undefined;
|
|
3264
|
-
failureReason?: string | undefined;
|
|
3265
3288
|
gateway?: string | undefined;
|
|
3289
|
+
failureReason?: string | undefined;
|
|
3266
3290
|
itemIds?: string[] | undefined;
|
|
3267
3291
|
reasonCode?: string | undefined;
|
|
3268
3292
|
gatewayRefundId?: string | undefined;
|
|
@@ -3272,6 +3296,11 @@ export declare const SCHEMAS: {
|
|
|
3272
3296
|
proofDocumentUrl?: string | undefined;
|
|
3273
3297
|
proofDocumentMimeType?: string | undefined;
|
|
3274
3298
|
overrideReason?: string | undefined;
|
|
3299
|
+
creditNoteNumber?: string | undefined;
|
|
3300
|
+
creditNoteIssuedAt?: string | Date | import("zod").objectInputType<{
|
|
3301
|
+
toDate: import("zod").ZodFunction<import("zod").ZodTuple<[], import("zod").ZodUnknown>, import("zod").ZodDate>;
|
|
3302
|
+
}, import("zod").ZodTypeAny, "passthrough"> | undefined;
|
|
3303
|
+
creditNoteStoragePath?: string | undefined;
|
|
3275
3304
|
}[] | undefined;
|
|
3276
3305
|
contestable?: boolean | undefined;
|
|
3277
3306
|
adminBypassBy?: string | undefined;
|
|
@@ -4510,11 +4539,11 @@ export declare const SCHEMAS: {
|
|
|
4510
4539
|
attachments?: string[] | undefined;
|
|
4511
4540
|
}[];
|
|
4512
4541
|
orderId?: string | undefined;
|
|
4513
|
-
|
|
4514
|
-
resolvedAt?: string | Date | import("zod").objectOutputType<{
|
|
4542
|
+
closedAt?: string | Date | import("zod").objectOutputType<{
|
|
4515
4543
|
toDate: import("zod").ZodFunction<import("zod").ZodTuple<[], import("zod").ZodUnknown>, import("zod").ZodDate>;
|
|
4516
4544
|
}, import("zod").ZodTypeAny, "passthrough"> | undefined;
|
|
4517
|
-
|
|
4545
|
+
assignedTo?: string | undefined;
|
|
4546
|
+
resolvedAt?: string | Date | import("zod").objectOutputType<{
|
|
4518
4547
|
toDate: import("zod").ZodFunction<import("zod").ZodTuple<[], import("zod").ZodUnknown>, import("zod").ZodDate>;
|
|
4519
4548
|
}, import("zod").ZodTypeAny, "passthrough"> | undefined;
|
|
4520
4549
|
assignedToName?: string | undefined;
|
|
@@ -4553,11 +4582,11 @@ export declare const SCHEMAS: {
|
|
|
4553
4582
|
attachments?: string[] | undefined;
|
|
4554
4583
|
}[];
|
|
4555
4584
|
orderId?: string | undefined;
|
|
4556
|
-
|
|
4557
|
-
resolvedAt?: string | Date | import("zod").objectInputType<{
|
|
4585
|
+
closedAt?: string | Date | import("zod").objectInputType<{
|
|
4558
4586
|
toDate: import("zod").ZodFunction<import("zod").ZodTuple<[], import("zod").ZodUnknown>, import("zod").ZodDate>;
|
|
4559
4587
|
}, import("zod").ZodTypeAny, "passthrough"> | undefined;
|
|
4560
|
-
|
|
4588
|
+
assignedTo?: string | undefined;
|
|
4589
|
+
resolvedAt?: string | Date | import("zod").objectInputType<{
|
|
4561
4590
|
toDate: import("zod").ZodFunction<import("zod").ZodTuple<[], import("zod").ZodUnknown>, import("zod").ZodDate>;
|
|
4562
4591
|
}, import("zod").ZodTypeAny, "passthrough"> | undefined;
|
|
4563
4592
|
assignedToName?: string | undefined;
|
|
@@ -4997,7 +5026,7 @@ export declare const SCHEMAS: {
|
|
|
4997
5026
|
category: "shipping" | "seller" | "custom" | "condition" | "auction" | "platform" | "preorder";
|
|
4998
5027
|
isActive: boolean;
|
|
4999
5028
|
displayOrder: number;
|
|
5000
|
-
productTypes: ("all" | "classified" | "auction" | "prize-draw" | "digital-code" | "live" | "
|
|
5029
|
+
productTypes: ("all" | "classified" | "auction" | "prize-draw" | "digital-code" | "live" | "preorder" | "product")[];
|
|
5001
5030
|
storeId?: string | undefined;
|
|
5002
5031
|
description?: string | undefined;
|
|
5003
5032
|
iconColor?: string | undefined;
|
|
@@ -5008,7 +5037,7 @@ export declare const SCHEMAS: {
|
|
|
5008
5037
|
category: "shipping" | "seller" | "custom" | "condition" | "auction" | "platform" | "preorder";
|
|
5009
5038
|
isActive: boolean;
|
|
5010
5039
|
displayOrder: number;
|
|
5011
|
-
productTypes: ("all" | "classified" | "auction" | "prize-draw" | "digital-code" | "live" | "
|
|
5040
|
+
productTypes: ("all" | "classified" | "auction" | "prize-draw" | "digital-code" | "live" | "preorder" | "product")[];
|
|
5012
5041
|
storeId?: string | undefined;
|
|
5013
5042
|
description?: string | undefined;
|
|
5014
5043
|
iconColor?: string | undefined;
|
|
@@ -5019,7 +5048,7 @@ export declare const SCHEMAS: {
|
|
|
5019
5048
|
category: "shipping" | "seller" | "custom" | "condition" | "auction" | "platform" | "preorder";
|
|
5020
5049
|
isActive: boolean;
|
|
5021
5050
|
displayOrder: number;
|
|
5022
|
-
productTypes: ("all" | "classified" | "auction" | "prize-draw" | "digital-code" | "live" | "
|
|
5051
|
+
productTypes: ("all" | "classified" | "auction" | "prize-draw" | "digital-code" | "live" | "preorder" | "product")[];
|
|
5023
5052
|
storeId?: string | undefined;
|
|
5024
5053
|
description?: string | undefined;
|
|
5025
5054
|
iconColor?: string | undefined;
|
|
@@ -5030,7 +5059,7 @@ export declare const SCHEMAS: {
|
|
|
5030
5059
|
category: "shipping" | "seller" | "custom" | "condition" | "auction" | "platform" | "preorder";
|
|
5031
5060
|
isActive: boolean;
|
|
5032
5061
|
displayOrder: number;
|
|
5033
|
-
productTypes: ("all" | "classified" | "auction" | "prize-draw" | "digital-code" | "live" | "
|
|
5062
|
+
productTypes: ("all" | "classified" | "auction" | "prize-draw" | "digital-code" | "live" | "preorder" | "product")[];
|
|
5034
5063
|
storeId?: string | undefined;
|
|
5035
5064
|
description?: string | undefined;
|
|
5036
5065
|
iconColor?: string | undefined;
|
|
@@ -5341,14 +5370,14 @@ export declare const SCHEMAS: {
|
|
|
5341
5370
|
}, "strict", import("zod").ZodTypeAny, {
|
|
5342
5371
|
entityId: string;
|
|
5343
5372
|
entityType: import("..").ReportEntityType;
|
|
5344
|
-
detail: string;
|
|
5345
5373
|
reason: import("..").ReportReason;
|
|
5374
|
+
detail: string;
|
|
5346
5375
|
evidenceUrls?: string[] | undefined;
|
|
5347
5376
|
}, {
|
|
5348
5377
|
entityId: string;
|
|
5349
5378
|
entityType: import("..").ReportEntityType;
|
|
5350
|
-
detail: string;
|
|
5351
5379
|
reason: import("..").ReportReason;
|
|
5380
|
+
detail: string;
|
|
5352
5381
|
evidenceUrls?: string[] | undefined;
|
|
5353
5382
|
}>;
|
|
5354
5383
|
readonly itemRequest: import("zod").ZodObject<{
|
|
@@ -6254,13 +6283,13 @@ export declare const SCHEMAS: {
|
|
|
6254
6283
|
userPhone: import("zod").ZodUnion<[import("zod").ZodOptional<import("zod").ZodString>, import("zod").ZodLiteral<"">]>;
|
|
6255
6284
|
}, "strip", import("zod").ZodTypeAny, {
|
|
6256
6285
|
transactionId: string;
|
|
6257
|
-
sourceType: "
|
|
6286
|
+
sourceType: "product" | "event";
|
|
6258
6287
|
paymentTime: string;
|
|
6259
6288
|
purchasedItemNumber: number;
|
|
6260
6289
|
userPhone?: string | undefined;
|
|
6261
6290
|
}, {
|
|
6262
6291
|
transactionId: string;
|
|
6263
|
-
sourceType: "
|
|
6292
|
+
sourceType: "product" | "event";
|
|
6264
6293
|
paymentTime: string;
|
|
6265
6294
|
purchasedItemNumber: number;
|
|
6266
6295
|
userPhone?: string | undefined;
|
package/dist/schemas/sieve.d.ts
CHANGED
|
@@ -7,13 +7,13 @@ export declare const sieveGrammarSchema: z.ZodObject<{
|
|
|
7
7
|
}, "strip", z.ZodTypeAny, {
|
|
8
8
|
page: number;
|
|
9
9
|
pageSize: number;
|
|
10
|
-
filters: string;
|
|
11
10
|
sorts: string;
|
|
11
|
+
filters: string;
|
|
12
12
|
}, {
|
|
13
13
|
page?: number | undefined;
|
|
14
14
|
pageSize?: number | undefined;
|
|
15
|
-
filters?: string | undefined;
|
|
16
15
|
sorts?: string | undefined;
|
|
16
|
+
filters?: string | undefined;
|
|
17
17
|
}>;
|
|
18
18
|
export type SieveGrammar = z.infer<typeof sieveGrammarSchema>;
|
|
19
19
|
export declare const sieveWhereOpSchema: z.ZodEnum<["==", "!=", "<", "<=", ">", ">=", "array-contains", "in", "not-in", "array-contains-any"]>;
|
|
@@ -23,12 +23,12 @@ export declare const sieveFilterClauseSchema: z.ZodObject<{
|
|
|
23
23
|
value: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>, "many">]>;
|
|
24
24
|
}, "strip", z.ZodTypeAny, {
|
|
25
25
|
value: string | number | boolean | (string | number | boolean)[] | null;
|
|
26
|
-
op: "==" | "!=" | "<" | "<=" | ">" | ">=" | "array-contains" | "in" | "not-in" | "array-contains-any";
|
|
27
26
|
field: string;
|
|
27
|
+
op: "==" | "!=" | "<" | "<=" | ">" | ">=" | "array-contains" | "in" | "not-in" | "array-contains-any";
|
|
28
28
|
}, {
|
|
29
29
|
value: string | number | boolean | (string | number | boolean)[] | null;
|
|
30
|
-
op: "==" | "!=" | "<" | "<=" | ">" | ">=" | "array-contains" | "in" | "not-in" | "array-contains-any";
|
|
31
30
|
field: string;
|
|
31
|
+
op: "==" | "!=" | "<" | "<=" | ">" | ">=" | "array-contains" | "in" | "not-in" | "array-contains-any";
|
|
32
32
|
}>;
|
|
33
33
|
export type SieveFilterClause = z.infer<typeof sieveFilterClauseSchema>;
|
|
34
34
|
export type SieveWhereOp = z.infer<typeof sieveWhereOpSchema>;
|
|
@@ -36,8 +36,8 @@ export declare const sieveSortClauseSchema: z.ZodObject<{
|
|
|
36
36
|
field: z.ZodString;
|
|
37
37
|
direction: z.ZodDefault<z.ZodEnum<["asc", "desc"]>>;
|
|
38
38
|
}, "strip", z.ZodTypeAny, {
|
|
39
|
-
direction: "desc" | "asc";
|
|
40
39
|
field: string;
|
|
40
|
+
direction: "desc" | "asc";
|
|
41
41
|
}, {
|
|
42
42
|
field: string;
|
|
43
43
|
direction?: "desc" | "asc" | undefined;
|
package/dist/server-entry.d.ts
CHANGED
|
@@ -68,8 +68,8 @@ export { renderScamOg, renderScamOgImage, type ScamOgData, getScammerForDetail,
|
|
|
68
68
|
export { getCategoryForDetail, listRootCategories, listFeaturedCategories, listMenuCategories, getCategoryTree, listSitemapCategories, CATEGORIES_PAGE_SIZE, CATEGORIES_ROOT_TIER, CATEGORIES_MAX_DEPTH, CATEGORIES_SITEMAP_LIMIT, CATEGORIES_FEATURED_LIMIT, CATEGORIES_MENU_LIMIT, } from "./_internal/server/features/categories/index";
|
|
69
69
|
export { getGroupedListingForDetail, getGroupedListingWithItems, listGroupedListings, listFeaturedGroupedListings, listSitemapGroupedListings, getGroupsForProduct, getGroupsWithItemsForProduct, GROUPED_LISTINGS_PAGE_SIZE, GROUPED_LISTINGS_FEATURED_LIMIT, GROUPED_LISTINGS_SITEMAP_LIMIT, buildGroupedListingMetadata, renderGroupedListingOg, type GroupedListingWithItems, type ListGroupedListingsParams, type SitemapGroupedListing, type GroupedListingMetadataOptions, } from "./_internal/server/features/grouped/index";
|
|
70
70
|
export { createCheckoutOrderAction, attachPaymentAction, verifyAndPlaceGatewayOrderAction, previewCheckoutPricing, resolveShippingCost, formatShippingAddress, CHECKOUT_DEFAULT_COMMISSIONS, CHECKOUT_PAYMENT_METHODS, type CreateCheckoutOrderInput, type VerifyAndPlaceGatewayOrderInput, type CheckoutOrderResult, type CheckoutPaymentMethod, type CheckoutPricingPreviewInput, type CheckoutPricingPreview, } from "./_internal/server/features/checkout/index";
|
|
71
|
-
export { unitPriceFor, lineTotalFor, sumGroupGst, computePreOrderDepositAmount, type GroupGstSummary, type GstRateSlice, } from "./_internal/shared/checkout/order-math";
|
|
72
|
-
export { computeGroupCouponDiscount, computeCartCouponDiscount, type GroupCouponDiscountResult, } from "./_internal/shared/checkout/coupon-discount";
|
|
71
|
+
export { unitPriceFor, lineTotalFor, sumGroupGst, computePreOrderDepositAmount, allocatePointsAcrossGroups, resolvePointsTender, type GroupGstSummary, type GstRateSlice, } from "./_internal/shared/checkout/order-math";
|
|
72
|
+
export { computeGroupCouponDiscount, computeCartCouponDiscount, type GroupCouponDiscountResult, type CartCouponDiscountResult, } from "./_internal/shared/checkout/coupon-discount";
|
|
73
73
|
export { refundCapacity, refundableBase, committedRefundTotal, platformFeeWithheld, wouldBeFullRefund, MONEY_EPSILON, type RefundCapacity, type RefundableOrderLike, } from "./_internal/shared/checkout/refundable-base";
|
|
74
74
|
export { processRefundAction, type ProcessRefundInput, } from "./_internal/server/features/refunds/actions";
|
|
75
75
|
export { getSublistingCategoryForDetail } from "./_internal/server/features/sublisting-categories/index";
|
package/dist/server-entry.js
CHANGED
|
@@ -106,7 +106,14 @@ export { createCheckoutOrderAction, attachPaymentAction, verifyAndPlaceGatewayOr
|
|
|
106
106
|
// GST entirely, so the buyer was shown the tax, charged without it, and the
|
|
107
107
|
// order recorded none — with the verify-side mismatch guard omitting it too, so
|
|
108
108
|
// the three were consistently wrong and the undercharge was undetectable.
|
|
109
|
-
|
|
109
|
+
// `allocatePointsAcrossGroups` is the FOURTH symbol exported here for the same
|
|
110
|
+
// reason as the three above it, and the pattern is now the point: every money
|
|
111
|
+
// rule that `/api/payment/create-order` needs has had to be exported after that
|
|
112
|
+
// route was found hand-rolling it or omitting it. The points tender is exported
|
|
113
|
+
// BEFORE the route can get it wrong rather than after — which is the only
|
|
114
|
+
// difference between this entry and the three defects recorded in the comment
|
|
115
|
+
// above (D37, D38, C0c defect 1).
|
|
116
|
+
export { unitPriceFor, lineTotalFor, sumGroupGst, computePreOrderDepositAmount, allocatePointsAcrossGroups, resolvePointsTender, } from "./_internal/shared/checkout/order-math.js";
|
|
110
117
|
/*
|
|
111
118
|
* The coupon discount, exported for the SAME reason `sumGroupGst` above was —
|
|
112
119
|
* and it is the third defect of that exact shape in this one route.
|
package/dist/server.d.ts
CHANGED
|
@@ -260,7 +260,7 @@ export { updateEvent } from "./features/events/server";
|
|
|
260
260
|
export { triggerEventRaffleAction, assignSpinPrizeAction, resolveEventIdAction, } from "./_internal/server/features/raffle/actions";
|
|
261
261
|
export { reasonToHttp, EVENT_DRAW_REASON, type EventDrawReason, type EventDrawHttpMapping, } from "./_internal/server/jobs/core/event-draw-reasons";
|
|
262
262
|
export { processRefundAction, type ProcessRefundInput, } from "./_internal/server/features/refunds/actions";
|
|
263
|
-
export { computeCheckoutFees, computePayoutDeduction, computeCodHandlingFee, computeGiftWrapFee, computeShipmentProtectionFee, computeSaleProtectionFee, } from "./_internal/shared/fees/calculator";
|
|
263
|
+
export { computeCheckoutFees, allocateCheckoutFees, computePayoutDeduction, computeCodHandlingFee, computeGiftWrapFee, computeShipmentProtectionFee, computeSaleProtectionFee, } from "./_internal/shared/fees/calculator";
|
|
264
264
|
export { searchPriceIndex, getPriceIndexBandsForIds, PRICE_INDEX_SEARCH_LIMIT, PRICE_INDEX_MIN_QUERY_LENGTH } from "./_internal/server/features/price-index/search";
|
|
265
265
|
export type { PriceIndexSearchResponse, PriceIndexSearchResult, PriceIndexSearchResultBand, } from "./_internal/server/features/price-index/search";
|
|
266
266
|
export { getPriceIndexMarketForIds } from "./_internal/server/features/price-index/market";
|
|
@@ -502,7 +502,7 @@ export { LISTING_TYPE_REGISTRY, pluginFor, detectListingTypeFromSlug } from "./_
|
|
|
502
502
|
export type { ListingTypePlugin } from "./_internal/shared/listing-types/_registry";
|
|
503
503
|
export { applyMediaContextGuards, CONTEXT_LIMITS, } from "./_internal/server/features/media/contextGuards";
|
|
504
504
|
export type { GuardResult, GuardError, GuardSuccess } from "./_internal/server/features/media/contextGuards";
|
|
505
|
-
export { MEGABYTE, MAX_IMAGE_BYTES, MAX_PDF_BYTES, MAX_VIDEO_BYTES, MAX_LABEL, MAX_BYTES, ALLOWED_IMAGE_MIMES, IMAGE_ACCEPT_ATTR, ALLOWED_VIDEO_MIMES, ALLOWED_DOC_MIMES, ALLOWED_MIMES, ALLOWED_TYPES_LABEL, MIME_TO_EXT, PDF_MAGIC, VIDEO_CONVERSION_HINTS, classifyMime, isAllowedMime, maxBytesFor, getConversionHint, PRODUCT_MAX_IMAGES, PRODUCT_MAX_VIDEOS, PRODUCT_IMAGE_INDEX_MAX, } from "./_internal/shared/media/limits";
|
|
505
|
+
export { MEGABYTE, MAX_IMAGE_BYTES, MAX_PDF_BYTES, MAX_VIDEO_BYTES, MAX_LABEL, MAX_BYTES, ALLOWED_IMAGE_MIMES, IMAGE_ACCEPT_ATTR, ALLOWED_VIDEO_MIMES, ALLOWED_DOC_MIMES, ALLOWED_MIMES, ALLOWED_TYPES_LABEL, MIME_TO_EXT, PDF_MAGIC, VIDEO_CONVERSION_HINTS, classifyMime, isAllowedMime, maxBytesFor, getConversionHint, PRODUCT_MAX_IMAGES, REVIEW_MAX_IMAGES, PRODUCT_MAX_VIDEOS, PRODUCT_IMAGE_INDEX_MAX, } from "./_internal/shared/media/limits";
|
|
506
506
|
export type { MediaKind, AllowedImageMime, AllowedVideoMime, AllowedDocMime, AllowedMime, } from "./_internal/shared/media/limits";
|
|
507
507
|
export { getServerPermissions, checkPermission, checkAnyPermission, makeAdminSectionLayout, } from "./_internal/server/features/auth/permissions";
|
|
508
508
|
export type { ResolvedPermissions, AdminSectionLayoutOpts, } from "./_internal/server/features/auth/permissions";
|
|
@@ -573,6 +573,8 @@ export type { ActionIndexDocument } from "./features/search/action-index/reposit
|
|
|
573
573
|
export { REFUND_COPY } from "./_internal/shared/features/orders/refund-copy";
|
|
574
574
|
export { RETURN_REASON, FINAL_SALE_EXEMPT_REASONS, RETURN_REASON_LABEL, RETURN_REASON_GROUP_LABEL, isFinalSaleExempt, isReturnReason, selectableReturnReasons, } from "./_internal/shared/features/orders/return-reasons";
|
|
575
575
|
export type { ReturnReason } from "./_internal/shared/features/orders/return-reasons";
|
|
576
|
+
export { INTEGRATIONS, INTEGRATION_ORDER, readIntegrationStates, integrationPatch, allIntegrationsPatch, } from "./_internal/shared/features/admin/integrations";
|
|
577
|
+
export type { IntegrationId, IntegrationDescriptor, IntegrationState, } from "./_internal/shared/features/admin/integrations";
|
|
576
578
|
export { draftToProductInput, productToDraft, } from "./features/seller/utils/product-draft-mapping";
|
|
577
579
|
export { RETURN_CUSTODY_STATES, RETURN_CUSTODY_COPY, isTerminalCustody, canAdvanceCustody, nextCustodyState, custodyOwner, isActionableBy, } from "./_internal/shared/features/returns/custody";
|
|
578
580
|
export type { ReturnCustodyState } from "./_internal/shared/features/returns/custody";
|
|
@@ -604,3 +606,10 @@ export type { FileGrievanceInput } from "./_internal/server/features/grievance";
|
|
|
604
606
|
export { GRIEVANCE_PERIODS } from "./features/support/schemas/firestore";
|
|
605
607
|
export { getRateableItemsAction, rateOrderItemAction, markOrderCompleteAction, } from "./_internal/server/features/order-completion";
|
|
606
608
|
export type { RateableOrderItem, RateOrderItemInput, } from "./_internal/server/features/order-completion";
|
|
609
|
+
export { allocateSeriesNumber, type AllocateSeriesNumberInput, type AllocateSeriesNumberResult, } from "./_internal/server/features/invoicing/allocate";
|
|
610
|
+
export { issueInvoiceForOrder, readStoredInvoice, storeRenderedInvoice, INVOICE_PREFIX_PATH, type InvoiceRenderer, type IssueInvoiceResult, } from "./_internal/server/features/invoicing/issue";
|
|
611
|
+
export { issueCreditNoteForRefund, CREDIT_NOTE_PREFIX_PATH, type CreditNoteRenderer, type IssueCreditNoteResult, } from "./_internal/server/features/invoicing/credit-note";
|
|
612
|
+
export { financialYearLabel, formatSeriesNumber, INVOICE_PREFIX, CREDIT_NOTE_PREFIX, } from "./features/invoicing/utils/financial-year";
|
|
613
|
+
export type { InvoiceCounterDocument, InvoiceAllocationDocument, InvoiceSeriesKind, } from "./features/invoicing/schemas/firestore";
|
|
614
|
+
export { buildGstr1Export, gstr1ToCsv, type Gstr1Export, type Gstr1Row, } from "./_internal/server/features/invoicing/gstr1";
|
|
615
|
+
export { quoteSharedPurchase, countDestinations, type SharedPurchaseRates, type SharedPurchaseQuote, type SharedPurchaseQuoteInput, } from "./_internal/shared/features/shipping/shared-purchase";
|