@mohasinac/appkit 4.30.19 → 4.31.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/_internal/client/features/layout/useSidebarSearch.d.ts +21 -5
- package/dist/_internal/client/features/layout/useSidebarSearch.js +27 -6
- package/dist/_internal/client/features/lottery/LotteryAdminEditView.d.ts +23 -3
- package/dist/_internal/client/features/lottery/LotteryAdminEditView.js +106 -87
- package/dist/_internal/client/features/lottery/LotteryPullForm.d.ts +16 -5
- package/dist/_internal/client/features/lottery/LotteryPullForm.js +65 -40
- package/dist/_internal/server/features/auth/permissions.d.ts +2 -0
- package/dist/_internal/server/features/auth/permissions.js +3 -2
- package/dist/_internal/server/features/categories/data.js +15 -4
- package/dist/_internal/server/features/classified/index.d.ts +0 -1
- package/dist/_internal/server/features/classified/index.js +0 -1
- package/dist/_internal/server/features/digital-code/index.d.ts +0 -1
- package/dist/_internal/server/features/digital-code/index.js +0 -1
- package/dist/_internal/server/features/live/index.d.ts +0 -1
- package/dist/_internal/server/features/live/index.js +0 -1
- package/dist/_internal/server/features/products/data.js +15 -5
- package/dist/_internal/server/features/products/list-public.d.ts +9 -0
- package/dist/_internal/server/features/products/list-public.js +95 -7
- package/dist/_internal/server/features/site-settings/adapters.d.ts +2 -2
- package/dist/_internal/server/features/site-settings/adapters.js +8 -5
- package/dist/_internal/server/features/tester/visibility.d.ts +2 -1
- package/dist/_internal/server/features/tester/visibility.js +2 -2
- package/dist/_internal/server/functions/scheduled.d.ts +3 -1
- package/dist/_internal/server/functions/scheduled.js +27 -1
- package/dist/_internal/server/jobs/core/hardBanCascade.js +4 -0
- package/dist/_internal/server/jobs/core/index.d.ts +2 -0
- package/dist/_internal/server/jobs/core/index.js +2 -0
- package/dist/_internal/server/jobs/core/pageViewPrune.d.ts +10 -0
- package/dist/_internal/server/jobs/core/pageViewPrune.js +44 -0
- package/dist/_internal/server/jobs/core/pageViewRollup.d.ts +2 -0
- package/dist/_internal/server/jobs/core/pageViewRollup.js +87 -0
- package/dist/_internal/server/jobs/handlers/index.d.ts +2 -0
- package/dist/_internal/server/jobs/handlers/index.js +2 -0
- package/dist/_internal/server/jobs/handlers/pageViewPrune.d.ts +2 -0
- package/dist/_internal/server/jobs/handlers/pageViewPrune.js +2 -0
- package/dist/_internal/server/jobs/handlers/pageViewRollup.d.ts +2 -0
- package/dist/_internal/server/jobs/handlers/pageViewRollup.js +2 -0
- package/dist/_internal/shared/actions/action-registry.d.ts +1 -1
- package/dist/_internal/shared/actions/action-registry.js +69 -22
- package/dist/_internal/shared/checkout/rules/classified.rule.d.ts +9 -4
- package/dist/_internal/shared/checkout/rules/classified.rule.js +7 -2
- package/dist/_internal/shared/features/layout/matchesNavQuery.d.ts +14 -0
- package/dist/_internal/shared/features/layout/matchesNavQuery.js +72 -0
- package/dist/_internal/shared/features/layout/types.d.ts +37 -1
- package/dist/_internal/shared/features/layout/types.js +19 -1
- package/dist/_internal/shared/features/notifications/action-url.d.ts +9 -1
- package/dist/_internal/shared/features/notifications/action-url.js +47 -0
- package/dist/_internal/shared/features/offers/config.d.ts +65 -0
- package/dist/_internal/shared/features/offers/config.js +73 -2
- package/dist/_internal/shared/features/orders/schema.d.ts +19 -1
- package/dist/_internal/shared/features/orders/schema.js +22 -2
- package/dist/_internal/shared/features/site-settings/types.d.ts +12 -3
- package/dist/_internal/shared/listing-types/capabilities.d.ts +8 -2
- package/dist/_internal/shared/listing-types/capabilities.js +6 -1
- package/dist/_internal/shared/listing-types/classified/ctas.js +6 -1
- package/dist/_internal/shared/listing-types/feature-flags.d.ts +10 -5
- package/dist/_internal/shared/listing-types/feature-flags.js +11 -6
- package/dist/client.d.ts +37 -20
- package/dist/client.js +36 -14
- package/dist/configs/next.js +10 -2
- package/dist/constants/api-endpoints.d.ts +18 -54
- package/dist/constants/api-endpoints.js +6 -26
- package/dist/constants/field-names.d.ts +6 -24
- package/dist/constants/field-names.js +10 -27
- package/dist/constants/geo/countries.d.ts +50 -0
- package/dist/constants/geo/countries.js +129 -0
- package/dist/constants/geo/subdivisions.d.ts +13 -0
- package/dist/constants/geo/subdivisions.js +104 -0
- package/dist/constants/index.d.ts +2 -2
- package/dist/constants/index.js +2 -2
- package/dist/constants/table-keys.d.ts +24 -0
- package/dist/constants/table-keys.js +28 -0
- package/dist/contracts/extend.d.ts +0 -9
- package/dist/contracts/index.d.ts +1 -1
- package/dist/contracts/realtime-session.js +7 -0
- package/dist/core/browser.d.ts +1 -1
- package/dist/core/browser.js +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/site-config.d.ts +0 -3
- package/dist/core/site-config.js +0 -3
- package/dist/errors/messages.d.ts +0 -8
- package/dist/errors/messages.js +0 -9
- package/dist/features/about/schemas/index.d.ts +8 -8
- package/dist/features/account/components/AddressFilters.js +32 -11
- package/dist/features/account/components/AddressForm.d.ts +26 -25
- package/dist/features/account/components/AddressForm.js +81 -103
- package/dist/features/account/components/AddressesIndexListing.js +8 -4
- package/dist/features/account/components/UserSidebar.d.ts +3 -4
- package/dist/features/account/components/UserSupportView.js +89 -58
- package/dist/features/account/components/index.d.ts +1 -7
- package/dist/features/account/components/index.js +0 -3
- package/dist/features/account/hooks/useAddresses.d.ts +4 -3
- package/dist/features/account/hooks/useAddresses.js +4 -6
- package/dist/features/account/hooks/useCollapsedSections.d.ts +51 -10
- package/dist/features/account/hooks/useCollapsedSections.js +211 -38
- package/dist/features/account/hooks/useProfile.d.ts +8 -0
- package/dist/features/account/index.d.ts +0 -3
- package/dist/features/account/index.js +0 -3
- package/dist/features/account/schemas/index.d.ts +0 -92
- package/dist/features/account/schemas/index.js +42 -20
- package/dist/features/addresses/components/AddressLocationFields.d.ts +13 -0
- package/dist/features/addresses/components/AddressLocationFields.js +41 -0
- package/dist/features/addresses/hooks/usePostalLookup.d.ts +17 -0
- package/dist/features/addresses/hooks/usePostalLookup.js +133 -0
- package/dist/features/addresses/schemas/address-form.d.ts +423 -0
- package/dist/features/addresses/schemas/address-form.js +212 -0
- package/dist/features/addresses/schemas/index.d.ts +1 -0
- package/dist/features/addresses/schemas/index.js +8 -0
- package/dist/features/admin/actions/admin-read-actions.d.ts +1 -1
- package/dist/features/admin/actions/index.d.ts +0 -1
- package/dist/features/admin/actions/index.js +0 -1
- package/dist/features/admin/actions/notification-actions.js +1 -41
- package/dist/features/admin/components/AdminActionIndexView.d.ts +32 -0
- package/dist/features/admin/components/AdminActionIndexView.js +128 -0
- package/dist/features/admin/components/AdminAdEditorView.js +159 -163
- package/dist/features/admin/components/AdminAddressEditorView.js +97 -55
- package/dist/features/admin/components/AdminBrandEditorView.d.ts +15 -0
- package/dist/features/admin/components/AdminBrandEditorView.js +113 -77
- package/dist/features/admin/components/AdminBundleEditorView.d.ts +19 -9
- package/dist/features/admin/components/AdminBundleEditorView.js +136 -168
- package/dist/features/admin/components/AdminCategoryEditorView.js +120 -43
- package/dist/features/admin/components/AdminCouponEditorView.js +145 -109
- package/dist/features/admin/components/AdminEmployeeEditorView.js +125 -56
- package/dist/features/admin/components/AdminFaqEditorView.js +112 -58
- package/dist/features/admin/components/AdminFeatureEditorView.js +108 -68
- package/dist/features/admin/components/AdminNavEditorView.js +69 -44
- package/dist/features/admin/components/AdminOrderEditorView.js +47 -10
- package/dist/features/admin/components/AdminPrizeDrawsView.js +16 -2
- package/dist/features/admin/components/AdminSidebar.d.ts +11 -7
- package/dist/features/admin/components/AdminSiteSettingsView.js +37 -37
- package/dist/features/admin/components/AdminStoreEditorView.js +75 -52
- package/dist/features/admin/components/AdminSublistingCategoryEditorView.js +71 -30
- package/dist/features/admin/components/AdminTesterChecklistItemEditorView.js +95 -65
- package/dist/features/admin/components/BrandQuickCreateForm.d.ts +10 -0
- package/dist/features/admin/components/BrandQuickCreateForm.js +49 -26
- package/dist/features/admin/components/CategoryQuickCreateForm.d.ts +11 -0
- package/dist/features/admin/components/CategoryQuickCreateForm.js +48 -26
- package/dist/features/admin/components/index.d.ts +2 -2
- package/dist/features/admin/components/index.js +1 -1
- package/dist/features/admin/constants/site-settings-tabs.d.ts +120 -0
- package/dist/features/admin/constants/site-settings-tabs.js +152 -0
- package/dist/features/admin/index.d.ts +0 -3
- package/dist/features/admin/index.js +0 -2
- package/dist/features/admin/repository/analytics-rollup.repository.d.ts +35 -0
- package/dist/features/admin/repository/analytics-rollup.repository.js +30 -0
- package/dist/features/admin/schemas/admin-editor-forms.d.ts +56 -57
- package/dist/features/admin/schemas/admin-editor-forms.js +97 -54
- package/dist/features/admin/schemas/admin-ops-forms.d.ts +57 -5
- package/dist/features/admin/schemas/admin-ops-forms.js +104 -20
- package/dist/features/admin/schemas/admin-user-form.js +7 -0
- package/dist/features/admin/schemas/firestore.d.ts +48 -95
- package/dist/features/admin/schemas/firestore.js +15 -151
- package/dist/features/admin/schemas/nav-item-form.js +9 -2
- package/dist/features/admin/server.d.ts +0 -4
- package/dist/features/admin/server.js +0 -2
- package/dist/features/admin/types/index.d.ts +0 -7
- package/dist/features/analytics/repository/page-views.repository.d.ts +14 -0
- package/dist/features/analytics/repository/page-views.repository.js +24 -0
- package/dist/features/auth/actions/index.d.ts +0 -1
- package/dist/features/auth/actions/index.js +0 -1
- package/dist/features/auth/actions/realtime-token-actions.js +1 -12
- package/dist/features/auth/auth-helpers.js +5 -7
- package/dist/features/auth/components/Guards.js +2 -1
- package/dist/features/auth/components/LoginForm.d.ts +0 -2
- package/dist/features/auth/components/LoginForm.js +1 -3
- package/dist/features/auth/components/RegisterForm.js +62 -19
- package/dist/features/auth/permissions/constants.d.ts +27 -1
- package/dist/features/auth/role-predicates.d.ts +75 -7
- package/dist/features/auth/role-predicates.js +28 -2
- package/dist/features/auth/schemas/firestore.d.ts +22 -0
- package/dist/features/auth/schemas/index.d.ts +1 -1
- package/dist/features/auth/schemas/index.js +44 -8
- package/dist/features/auth/types/index.d.ts +14 -1
- package/dist/features/blog/api/route.js +10 -2
- package/dist/features/blog/components/BlogIndexListing.js +1 -1
- package/dist/features/blog/hooks/useBlog.js +2 -2
- package/dist/features/blog/schemas/index.d.ts +4 -0
- package/dist/features/blog/schemas/index.js +2 -0
- package/dist/features/blog/types/index.d.ts +1 -1
- package/dist/features/catalogue/components/CatalogueItemEditorView.d.ts +22 -0
- package/dist/features/catalogue/components/CatalogueItemEditorView.js +112 -52
- package/dist/features/catalogue/schemas/validation.d.ts +4 -4
- package/dist/features/catalogue/schemas/validation.js +47 -10
- package/dist/features/categories/schemas/bundle-form.d.ts +142 -0
- package/dist/features/categories/schemas/bundle-form.js +149 -0
- package/dist/features/classified/components/ClassifiedDetailPageView.d.ts +5 -4
- package/dist/features/classified/components/ClassifiedDetailPageView.js +37 -16
- package/dist/features/consultation/components/ConsultationForm.js +1 -1
- package/dist/features/consultation/schemas/index.js +34 -10
- package/dist/features/corporate/schemas/index.js +36 -15
- package/dist/features/filters/FilterPanel.js +3 -3
- package/dist/features/filters/RangeFilter.d.ts +10 -0
- package/dist/features/filters/RangeFilter.js +41 -4
- package/dist/features/homepage/components/MarketplaceHomepageView.js +24 -5
- package/dist/features/homepage/hooks/useBlogArticles.js +1 -1
- package/dist/features/layout/BottomActions.js +84 -11
- package/dist/features/layout/BottomActionsContext.d.ts +1 -6
- package/dist/features/layout/BottomActionsContext.js +1 -1
- package/dist/features/layout/hooks/useBottomActions.js +2 -2
- package/dist/features/layout/hooks/useFormBottomActions.d.ts +12 -1
- package/dist/features/layout/hooks/useFormBottomActions.js +12 -6
- package/dist/features/lottery/schemas/config-write.d.ts +9 -5
- package/dist/features/lottery/schemas/config-write.js +69 -9
- package/dist/features/orders/schemas/buyer-forms.d.ts +6 -3
- package/dist/features/orders/schemas/buyer-forms.js +31 -3
- package/dist/features/orders/schemas/index.d.ts +2 -2
- package/dist/features/products/components/GroupSettingsPanel.js +3 -1
- package/dist/features/products/components/MakeOfferButton.d.ts +13 -2
- package/dist/features/products/components/MakeOfferButton.js +33 -11
- package/dist/features/products/components/ProductDetailActions.js +0 -1
- package/dist/features/products/components/ProductDetailPageView.d.ts +7 -3
- package/dist/features/products/components/ProductDetailPageView.js +8 -5
- package/dist/features/products/constants/action-defs.d.ts +1 -2
- package/dist/features/products/constants/action-defs.js +40 -43
- package/dist/features/products/repository/products.repository.d.ts +5 -1
- package/dist/features/products/repository/products.repository.js +23 -1
- package/dist/features/products/schemas/firestore.d.ts +7 -3
- package/dist/features/products/schemas/product-features.validators.js +3 -0
- package/dist/features/promotions/components/CouponCard.js +8 -7
- package/dist/features/scams/schemas/firestore.d.ts +15 -1
- package/dist/features/scams/schemas/report-form.d.ts +5 -5
- package/dist/features/scams/schemas/report-form.js +18 -3
- package/dist/features/search/action-index/derive.d.ts +49 -0
- package/dist/features/search/action-index/derive.js +121 -0
- package/dist/features/search/action-index/repository.d.ts +42 -0
- package/dist/features/search/action-index/repository.js +100 -0
- package/dist/features/search/action-index/settings-entries.d.ts +41 -0
- package/dist/features/search/action-index/settings-entries.js +268 -0
- package/dist/features/search/action-index/types.d.ts +81 -0
- package/dist/features/search/action-index/types.js +102 -0
- package/dist/features/search/action-index/validate-entry.d.ts +34 -0
- package/dist/features/search/action-index/validate-entry.js +114 -0
- package/dist/features/search/hooks/useNavSuggestions.d.ts +5 -1
- package/dist/features/search/hooks/useNavSuggestions.js +23 -3
- package/dist/features/search/repository/search.repository.js +3 -1
- package/dist/features/seller/actions/offer-actions.js +43 -24
- package/dist/features/seller/actions/seller-actions.js +29 -5
- package/dist/features/seller/components/CategoryChipPicker.d.ts +9 -0
- package/dist/features/seller/components/CategoryChipPicker.js +12 -0
- package/dist/features/seller/components/SellerAddressesView.js +5 -1
- package/dist/features/seller/components/SellerAnalyticsAlertsView.js +83 -43
- package/dist/features/seller/components/SellerArtView.d.ts +14 -7
- package/dist/features/seller/components/SellerArtView.js +4 -119
- package/dist/features/seller/components/SellerClassifiedView.d.ts +14 -7
- package/dist/features/seller/components/SellerClassifiedView.js +4 -124
- package/dist/features/seller/components/SellerCouponEditorView.d.ts +22 -1
- package/dist/features/seller/components/SellerCouponEditorView.js +91 -45
- package/dist/features/seller/components/SellerDigitalCodesView.d.ts +14 -7
- package/dist/features/seller/components/SellerDigitalCodesView.js +4 -126
- package/dist/features/seller/components/SellerListingTypeView.d.ts +66 -0
- package/dist/features/seller/components/SellerListingTypeView.js +277 -0
- package/dist/features/seller/components/SellerLiveView.d.ts +14 -7
- package/dist/features/seller/components/SellerLiveView.js +4 -126
- package/dist/features/seller/components/SellerSidebar.d.ts +3 -6
- package/dist/features/seller/components/SellerStickersView.d.ts +14 -7
- package/dist/features/seller/components/SellerStickersView.js +4 -119
- package/dist/features/seller/components/SellerSupportView.d.ts +31 -0
- package/dist/features/seller/components/SellerSupportView.js +100 -0
- package/dist/features/seller/components/index.d.ts +4 -8
- package/dist/features/seller/components/index.js +2 -4
- package/dist/features/seller/index.d.ts +0 -1
- package/dist/features/seller/index.js +0 -1
- package/dist/features/seller/schemas/coupon-form.d.ts +214 -0
- package/dist/features/seller/schemas/coupon-form.js +155 -23
- package/dist/features/seller/schemas/offer-forms.d.ts +16 -7
- package/dist/features/seller/schemas/offer-forms.js +28 -12
- package/dist/features/shell/FormShell.js +2 -2
- package/dist/features/shell/QuickFormDrawer.js +2 -2
- package/dist/features/shell/SectionForm.d.ts +19 -1
- package/dist/features/shell/SectionForm.js +104 -17
- package/dist/features/shell/build-sections.d.ts +23 -0
- package/dist/features/shell/build-sections.js +106 -8
- package/dist/features/shell/field-ui-meta.d.ts +44 -0
- package/dist/features/shell/field-ui-meta.js +14 -7
- package/dist/features/shell/form-sections.d.ts +46 -0
- package/dist/features/shell/form-sections.js +114 -0
- package/dist/features/shipments/components/AdminShipmentEditorView.js +87 -64
- package/dist/features/shipments/schemas/validation.d.ts +2 -2
- package/dist/features/shipments/schemas/validation.js +44 -13
- package/dist/features/store-extensions/schemas/custom-role-form.js +6 -2
- package/dist/features/store-extensions/schemas/listing-template-form.d.ts +7 -7
- package/dist/features/store-extensions/schemas/payout-method-form.js +14 -0
- package/dist/features/stores/actions/store-query-actions.js +3 -2
- package/dist/features/stores/api/[storeSlug]/auctions/route.js +3 -1
- package/dist/features/stores/api/[storeSlug]/products/route.js +3 -1
- package/dist/features/support/repository/support.repository.d.ts +21 -0
- package/dist/features/support/repository/support.repository.js +63 -0
- package/dist/features/support/schemas/firestore.d.ts +27 -2
- package/dist/features/support/schemas/firestore.js +2 -0
- package/dist/features/support/schemas/ticket-create-form.js +7 -0
- package/dist/features/tester/schemas/checklist-item-form.d.ts +43 -0
- package/dist/features/tester/schemas/checklist-item-form.js +109 -0
- package/dist/features/tester/seed-data/blog-tester-seed-data.js +2 -2
- package/dist/features/tester/seed-data/categories-tester-seed-data.js +2 -2
- package/dist/features/tester/seed-data/events-tester-seed-data.js +5 -5
- package/dist/features/tester/seed-data/orders-tester-seed-data.js +2 -2
- package/dist/features/tester/seed-data/products-tester-seed-data.js +48 -49
- package/dist/features/tester/seed-data/stores-tester-seed-data.js +3 -3
- package/dist/features/tester/seed-data/tester-checklist-seed-data.js +275 -29
- package/dist/features/whatsapp-bot/components/SellerWhatsAppSettingsView.js +48 -12
- package/dist/http/api-handler.js +2 -1
- package/dist/index.d.ts +24 -103
- package/dist/index.js +33 -141
- package/dist/jobs.d.ts +1 -1
- package/dist/jobs.js +1 -1
- package/dist/monitoring/browser.d.ts +0 -2
- package/dist/monitoring/browser.js +12 -1
- package/dist/monitoring/index.d.ts +0 -2
- package/dist/monitoring/index.js +0 -1
- package/dist/next/api/routeHandler.js +6 -3
- package/dist/next/index.d.ts +7 -2
- package/dist/next/index.js +36 -1
- package/dist/next/middleware/index.d.ts +0 -2
- package/dist/next/middleware/index.js +0 -1
- package/dist/next/routing/route-map.d.ts +8 -7
- package/dist/next/routing/route-map.js +10 -3
- package/dist/providers/db-firebase/admin.js +15 -1
- package/dist/providers/db-firebase/sieve.d.ts +22 -0
- package/dist/react/hooks/useListingTypeFlags.d.ts +1 -1
- package/dist/react/hooks/useListingTypeFlags.js +1 -1
- package/dist/react/hooks/usePendingFilters.js +5 -3
- package/dist/react/hooks/usePendingTable.js +15 -3
- package/dist/repositories/index.d.ts +0 -1
- package/dist/repositories/index.js +0 -1
- package/dist/schemas/registry.d.ts +197 -232
- package/dist/schemas/registry.js +5 -6
- package/dist/schemas/webhooks/razorpay.d.ts +50 -50
- package/dist/security/authorization.d.ts +9 -0
- package/dist/security/authorization.js +16 -2
- package/dist/security/browser.d.ts +1 -3
- package/dist/security/browser.js +5 -2
- package/dist/security/index.d.ts +1 -3
- package/dist/security/index.js +19 -2
- package/dist/security/pii-encrypt.js +16 -0
- package/dist/security/pii-schemas.d.ts +0 -14
- package/dist/security/pii-schemas.js +7 -15
- package/dist/seed/_helpers/category-forest.js +2 -2
- package/dist/seed/_helpers/media.d.ts +19 -0
- package/dist/seed/_helpers/media.js +75 -0
- package/dist/seed/blog-posts-seed-data.js +17 -17
- package/dist/seed/carousel-slides-seed-data.js +7 -7
- package/dist/seed/cart-seed-data.js +13 -13
- package/dist/seed/categories-seed-data.js +10 -10
- package/dist/seed/events-seed-data.js +24 -24
- package/dist/seed/factories/product.factory.js +4 -4
- package/dist/seed/factories/store.factory.js +3 -3
- package/dist/seed/factories/user.factory.js +2 -2
- package/dist/seed/grouped-listings-seed-data.js +11 -11
- package/dist/seed/homepage-sections-seed-data.js +2 -2
- package/dist/seed/index.d.ts +0 -1
- package/dist/seed/index.js +0 -1
- package/dist/seed/manifest.d.ts +1 -1
- package/dist/seed/manifest.js +0 -5
- package/dist/seed/notifications-seed-data.js +20 -1
- package/dist/seed/orders-seed-data.js +2 -2
- package/dist/seed/products-art-seed-data.js +16 -16
- package/dist/seed/products-auctions-seed-data.js +34 -34
- package/dist/seed/products-classifieds-seed-data.js +35 -37
- package/dist/seed/products-digital-codes-seed-data.js +20 -20
- package/dist/seed/products-live-items-seed-data.js +11 -11
- package/dist/seed/products-preorders-seed-data.js +13 -13
- package/dist/seed/products-prize-draws-seed-data.js +43 -43
- package/dist/seed/products-standard-seed-data.js +54 -54
- package/dist/seed/products-stickers-seed-data.js +15 -15
- package/dist/seed/reviews-seed-data.js +4 -4
- package/dist/seed/scammers-seed-data.js +3 -3
- package/dist/seed/site-settings-seed-data.js +11 -24
- package/dist/seed/store-extensions-seed-data.js +10 -10
- package/dist/seed/stores-seed-data.js +11 -11
- package/dist/seed/support-tickets-seed-data.d.ts +14 -0
- package/dist/seed/support-tickets-seed-data.js +20 -1
- package/dist/seed/users-seed-data.js +20 -20
- package/dist/server-entry.d.ts +0 -1
- package/dist/server-entry.js +0 -1
- package/dist/server.d.ts +9 -6
- package/dist/server.js +7 -13
- package/dist/styles.css +248 -68
- package/dist/tailwind-utilities.css +1 -1
- package/dist/tokens/themes/default-dark.js +2 -2
- package/dist/tokens/themes/default-light.js +2 -2
- package/dist/tokens/tokens.css +24 -4
- package/dist/ui/components/ActionRow.d.ts +50 -0
- package/dist/ui/components/ActionRow.js +53 -0
- package/dist/ui/components/ActionRow.style.css +145 -0
- package/dist/ui/components/Drawer.d.ts +10 -0
- package/dist/ui/components/Drawer.js +2 -1
- package/dist/ui/components/FilterDrawer.js +4 -1
- package/dist/ui/components/FilterDrawer.style.css +6 -12
- package/dist/ui/components/FormActionBar.js +14 -1
- package/dist/ui/components/FormActionBar.style.css +12 -11
- package/dist/ui/components/ListingLayout.js +8 -1
- package/dist/ui/components/ListingLayout.style.css +6 -13
- package/dist/ui/components/Modal.d.ts +15 -1
- package/dist/ui/components/Modal.js +17 -3
- package/dist/ui/components/QuickCreateModal.js +2 -2
- package/dist/ui/components/QuickCreateModal.style.css +78 -84
- package/dist/ui/components/RecordDetailModal.js +2 -2
- package/dist/ui/components/SideDrawer.d.ts +8 -0
- package/dist/ui/components/SideDrawer.js +2 -1
- package/dist/ui/components/SideDrawer.style.css +6 -3
- package/dist/ui/components/SideModal.d.ts +11 -1
- package/dist/ui/components/SideModal.js +3 -2
- package/dist/ui/components/SideModal.style.css +14 -0
- package/dist/ui/components/Typography.style.css +33 -24
- package/dist/ui/components/index.style.css +1 -0
- package/dist/ui/forms/FormShell.style.css +260 -311
- package/dist/ui/index.d.ts +2 -0
- package/dist/ui/index.js +1 -0
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.js +0 -1
- package/dist/validation/index.d.ts +1 -1
- package/dist/validation/index.js +1 -1
- package/dist/validation/schemas.d.ts +0 -19
- package/dist/validation/schemas.js +8 -19
- package/package.json +1 -1
- package/scripts/seed-cli.mjs +3 -6
|
@@ -9,9 +9,7 @@
|
|
|
9
9
|
// ---------------------------------------------------------------------------
|
|
10
10
|
// Config
|
|
11
11
|
// ---------------------------------------------------------------------------
|
|
12
|
-
export const CONFIG_ENDPOINTS = {
|
|
13
|
-
FEATURE_FLAGS: "/api/config/feature-flags",
|
|
14
|
-
};
|
|
12
|
+
export const CONFIG_ENDPOINTS = {};
|
|
15
13
|
// ---------------------------------------------------------------------------
|
|
16
14
|
// Logs
|
|
17
15
|
// ---------------------------------------------------------------------------
|
|
@@ -91,15 +89,6 @@ export const ACCOUNT_ENDPOINTS = {
|
|
|
91
89
|
TESTER_CHECKLIST_ITEM_BY_ID: (checklistItemId) => `/api/user/tester-checklist/${encodeURIComponent(checklistItemId)}`,
|
|
92
90
|
};
|
|
93
91
|
// ---------------------------------------------------------------------------
|
|
94
|
-
// Conversations (buyer messaging)
|
|
95
|
-
// ---------------------------------------------------------------------------
|
|
96
|
-
export const CONVERSATION_ENDPOINTS = {
|
|
97
|
-
LIST: "/api/user/conversations",
|
|
98
|
-
BY_ID: (id) => `/api/user/conversations/${encodeURIComponent(id)}`,
|
|
99
|
-
MESSAGES: (id) => `/api/user/conversations/${encodeURIComponent(id)}/messages`,
|
|
100
|
-
READ: (id) => `/api/user/conversations/${encodeURIComponent(id)}/read`,
|
|
101
|
-
};
|
|
102
|
-
// ---------------------------------------------------------------------------
|
|
103
92
|
// Notifications
|
|
104
93
|
// ---------------------------------------------------------------------------
|
|
105
94
|
export const NOTIFICATIONS_ENDPOINTS = {
|
|
@@ -122,8 +111,9 @@ export const ADMIN_ENDPOINTS = {
|
|
|
122
111
|
ANALYTICS: "/api/admin/analytics",
|
|
123
112
|
ANALYTICS_PAGE_VIEWS: "/api/admin/analytics/pageviews",
|
|
124
113
|
ADS: "/api/admin/ads",
|
|
114
|
+
/** The action-index control plane (W7 / D7) — GET the whole index, PATCH one override. */
|
|
115
|
+
ACTION_INDEX: "/api/admin/action-index",
|
|
125
116
|
AD_BY_ID: (id) => `/api/admin/ads/${id}`,
|
|
126
|
-
REALTIME_TOKEN: "/api/realtime/token",
|
|
127
117
|
PAYMENTS_SETTINGS: "/api/admin/payments/settings",
|
|
128
118
|
PRODUCTS: "/api/admin/products",
|
|
129
119
|
PRODUCT_BY_ID: (id) => `/api/admin/products/${id}`,
|
|
@@ -217,7 +207,6 @@ export const ADMIN_ENDPOINTS = {
|
|
|
217
207
|
ADMIN_WISHLISTS: "/api/admin/wishlists",
|
|
218
208
|
ADMIN_HISTORY: "/api/admin/history",
|
|
219
209
|
NEWSLETTER_EXPORT: "/api/admin/newsletter/export",
|
|
220
|
-
FEATURE_FLAGS: "/api/admin/feature-flags",
|
|
221
210
|
STORE_ADDRESSES: "/api/admin/store-addresses",
|
|
222
211
|
CAROUSEL: "/api/admin/carousel",
|
|
223
212
|
CAROUSEL_BY_ID: (id) => `/api/admin/carousel/${id}`,
|
|
@@ -256,14 +245,6 @@ export const ADMIN_ENDPOINTS = {
|
|
|
256
245
|
MEDIA_LIST: "/api/admin/media",
|
|
257
246
|
};
|
|
258
247
|
// ---------------------------------------------------------------------------
|
|
259
|
-
// Chat
|
|
260
|
-
// ---------------------------------------------------------------------------
|
|
261
|
-
export const CHAT_ENDPOINTS = {
|
|
262
|
-
LIST: "/api/chat",
|
|
263
|
-
BY_ID: (chatId) => `/api/chat/${chatId}`,
|
|
264
|
-
MESSAGES: (chatId) => `/api/chat/${chatId}/messages`,
|
|
265
|
-
};
|
|
266
|
-
// ---------------------------------------------------------------------------
|
|
267
248
|
// Auctions
|
|
268
249
|
// ---------------------------------------------------------------------------
|
|
269
250
|
export const AUCTION_ENDPOINTS = {
|
|
@@ -543,8 +524,9 @@ export const SELLER_ENDPOINTS = {
|
|
|
543
524
|
PRODUCTS_SCAN: (barcode) => `/api/store/products/scan?barcode=${encodeURIComponent(barcode)}`,
|
|
544
525
|
ORDERS_FULFILLMENT: "/api/store/fulfillment",
|
|
545
526
|
BUNDLES: "/api/store/bundles",
|
|
527
|
+
/** Tickets raised ABOUT this store (W11). */
|
|
528
|
+
SUPPORT: "/api/store/support",
|
|
546
529
|
BUNDLE_BY_ID: (id) => `/api/store/bundles/${id}`,
|
|
547
|
-
CONVERSATIONS: "/api/store/conversations",
|
|
548
530
|
ORDERS_ASSIGN: (orderId) => `/api/store/orders/${orderId}/assign`,
|
|
549
531
|
PRODUCT_BY_ID: (id) => `/api/store/products/${id}`,
|
|
550
532
|
PRODUCT_DUPLICATE: (id) => `/api/store/products/${id}/duplicate`,
|
|
@@ -564,7 +546,7 @@ export const BRAND_ENDPOINTS = {
|
|
|
564
546
|
export const BLOG_ENDPOINTS = {
|
|
565
547
|
LIST: "/api/blog",
|
|
566
548
|
BY_SLUG: (slug) => `/api/blog/${slug}`,
|
|
567
|
-
FEATURED: (
|
|
549
|
+
FEATURED: (pageSize) => `/api/blog?featured=true${pageSize !== undefined ? `&pageSize=${pageSize}` : ""}`,
|
|
568
550
|
SORTED: (sort) => `/api/blog?sort=${sort}`,
|
|
569
551
|
};
|
|
570
552
|
// ---------------------------------------------------------------------------
|
|
@@ -643,11 +625,9 @@ export const API_ENDPOINTS = {
|
|
|
643
625
|
CLIENT_ERRORS: CLIENT_ERROR_ENDPOINTS,
|
|
644
626
|
AUTH: AUTH_ENDPOINTS,
|
|
645
627
|
ACCOUNT: ACCOUNT_ENDPOINTS,
|
|
646
|
-
CONVERSATIONS: CONVERSATION_ENDPOINTS,
|
|
647
628
|
NOTIFICATIONS: NOTIFICATIONS_ENDPOINTS,
|
|
648
629
|
SITE_SETTINGS: SITE_SETTINGS_ENDPOINTS,
|
|
649
630
|
ADMIN: ADMIN_ENDPOINTS,
|
|
650
|
-
CHAT: CHAT_ENDPOINTS,
|
|
651
631
|
AUCTIONS: AUCTION_ENDPOINTS,
|
|
652
632
|
BIDS: BID_ENDPOINTS,
|
|
653
633
|
CART: CART_ENDPOINTS,
|
|
@@ -685,15 +685,6 @@ export declare const COUPON_USAGE_FIELDS: {
|
|
|
685
685
|
readonly LAST_USED_AT: "lastUsedAt";
|
|
686
686
|
readonly ORDERS: "orders";
|
|
687
687
|
};
|
|
688
|
-
export declare const CONVERSATION_FIELDS: {
|
|
689
|
-
readonly ID: "id";
|
|
690
|
-
readonly BUYER_ID: "buyerId";
|
|
691
|
-
readonly STORE_ID: "storeId";
|
|
692
|
-
readonly LAST_MESSAGE_AT: "lastMessageAt";
|
|
693
|
-
readonly LAST_MESSAGE: "lastMessage";
|
|
694
|
-
readonly CREATED_AT: "createdAt";
|
|
695
|
-
readonly UPDATED_AT: "updatedAt";
|
|
696
|
-
};
|
|
697
688
|
export declare const SCAMMER_FIELDS: {
|
|
698
689
|
readonly ID: "id";
|
|
699
690
|
readonly SCAM_TYPE: "scamType";
|
|
@@ -713,6 +704,8 @@ export declare const SUPPORT_TICKET_FIELDS: {
|
|
|
713
704
|
readonly ID: "id";
|
|
714
705
|
readonly USER_ID: "userId";
|
|
715
706
|
readonly STORE_ID: "storeId";
|
|
707
|
+
/** Word-prefix tokens over `subject` only — see the repository's hook. */
|
|
708
|
+
readonly SEARCH_TXT: "searchTxt";
|
|
716
709
|
readonly SUBJECT: "subject";
|
|
717
710
|
readonly CATEGORY: "category";
|
|
718
711
|
readonly STATUS: "status";
|
|
@@ -905,21 +898,10 @@ export declare const SITE_SETTINGS_FIELDS: {
|
|
|
905
898
|
readonly EMAIL_SETTINGS: "emailSettings";
|
|
906
899
|
readonly SEO: "seo";
|
|
907
900
|
readonly FEATURES: "features";
|
|
908
|
-
readonly
|
|
909
|
-
readonly
|
|
910
|
-
readonly
|
|
911
|
-
readonly
|
|
912
|
-
readonly TRANSLATIONS: "featureFlags.translations";
|
|
913
|
-
readonly WISHLISTS: "featureFlags.wishlists";
|
|
914
|
-
readonly AUCTIONS: "featureFlags.auctions";
|
|
915
|
-
readonly REVIEWS: "featureFlags.reviews";
|
|
916
|
-
readonly EVENTS: "featureFlags.events";
|
|
917
|
-
readonly BLOG: "featureFlags.blog";
|
|
918
|
-
readonly COUPONS: "featureFlags.coupons";
|
|
919
|
-
readonly NOTIFICATIONS: "featureFlags.notifications";
|
|
920
|
-
readonly SELLER_REGISTRATION: "featureFlags.sellerRegistration";
|
|
921
|
-
readonly PRE_ORDERS: "featureFlags.preOrders";
|
|
922
|
-
readonly OFFERS: "featureFlags.offers";
|
|
901
|
+
readonly LISTINGS: "listings";
|
|
902
|
+
readonly LISTINGS_FIELDS: {
|
|
903
|
+
readonly LISTING_TYPES: "listings.listingTypes";
|
|
904
|
+
readonly CATEGORY_TYPES: "listings.categoryTypes";
|
|
923
905
|
};
|
|
924
906
|
readonly LEGAL_PAGES: "legalPages";
|
|
925
907
|
readonly SHIPPING: "shipping";
|
|
@@ -794,18 +794,6 @@ export const COUPON_USAGE_FIELDS = {
|
|
|
794
794
|
ORDERS: "orders",
|
|
795
795
|
};
|
|
796
796
|
// ============================================================================
|
|
797
|
-
// CONVERSATION FIELDS
|
|
798
|
-
// ============================================================================
|
|
799
|
-
export const CONVERSATION_FIELDS = {
|
|
800
|
-
ID: "id",
|
|
801
|
-
BUYER_ID: "buyerId",
|
|
802
|
-
STORE_ID: "storeId",
|
|
803
|
-
LAST_MESSAGE_AT: "lastMessageAt",
|
|
804
|
-
LAST_MESSAGE: "lastMessage",
|
|
805
|
-
CREATED_AT: "createdAt",
|
|
806
|
-
UPDATED_AT: "updatedAt",
|
|
807
|
-
};
|
|
808
|
-
// ============================================================================
|
|
809
797
|
// SCAMMER FIELDS
|
|
810
798
|
// ============================================================================
|
|
811
799
|
export const SCAMMER_FIELDS = {
|
|
@@ -836,6 +824,8 @@ export const SUPPORT_TICKET_FIELDS = {
|
|
|
836
824
|
ID: "id",
|
|
837
825
|
USER_ID: "userId",
|
|
838
826
|
STORE_ID: "storeId",
|
|
827
|
+
/** Word-prefix tokens over `subject` only — see the repository's hook. */
|
|
828
|
+
SEARCH_TXT: "searchTxt",
|
|
839
829
|
SUBJECT: "subject",
|
|
840
830
|
CATEGORY: "category",
|
|
841
831
|
STATUS: "status",
|
|
@@ -1048,21 +1038,14 @@ export const SITE_SETTINGS_FIELDS = {
|
|
|
1048
1038
|
EMAIL_SETTINGS: "emailSettings",
|
|
1049
1039
|
SEO: "seo",
|
|
1050
1040
|
FEATURES: "features",
|
|
1051
|
-
FEATURE_FLAGS
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
EVENTS: "featureFlags.events",
|
|
1060
|
-
BLOG: "featureFlags.blog",
|
|
1061
|
-
COUPONS: "featureFlags.coupons",
|
|
1062
|
-
NOTIFICATIONS: "featureFlags.notifications",
|
|
1063
|
-
SELLER_REGISTRATION: "featureFlags.sellerRegistration",
|
|
1064
|
-
PRE_ORDERS: "featureFlags.preOrders",
|
|
1065
|
-
OFFERS: "featureFlags.offers",
|
|
1041
|
+
// FEATURE_FLAGS / FEATURE_FLAGS_FIELDS were deleted 2026-08-29 along with the
|
|
1042
|
+
// group itself — 11 of its 14 keys had no reader anywhere. The survivors that
|
|
1043
|
+
// were never flags live under LISTINGS below; the two with real behaviour
|
|
1044
|
+
// moved to `payment.smsVerification` and `payment.adminCheckoutBypass`.
|
|
1045
|
+
LISTINGS: "listings",
|
|
1046
|
+
LISTINGS_FIELDS: {
|
|
1047
|
+
LISTING_TYPES: "listings.listingTypes",
|
|
1048
|
+
CATEGORY_TYPES: "listings.categoryTypes",
|
|
1066
1049
|
},
|
|
1067
1050
|
LEGAL_PAGES: "legalPages",
|
|
1068
1051
|
SHIPPING: "shipping",
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/** One country, as an address form needs it. */
|
|
2
|
+
export interface CountryDef {
|
|
3
|
+
/** ISO-3166-1 alpha-2. Also the key. */
|
|
4
|
+
code: string;
|
|
5
|
+
name: string;
|
|
6
|
+
/**
|
|
7
|
+
* What a valid postal code looks like here, or `null` when we do not know.
|
|
8
|
+
*
|
|
9
|
+
* `null` is a real answer, not a gap to be filled with a guess: the
|
|
10
|
+
* fallback accepts 3–12 characters, which catches an empty box and a pasted
|
|
11
|
+
* paragraph and nothing in between.
|
|
12
|
+
*/
|
|
13
|
+
postalPattern: RegExp | null;
|
|
14
|
+
/** What the country calls it — "PIN code", "ZIP code", "Postcode". */
|
|
15
|
+
postalLabel: string;
|
|
16
|
+
/** Whether `SUBDIVISIONS` enumerates its states/provinces. */
|
|
17
|
+
hasStates: boolean;
|
|
18
|
+
/** E.164 calling code, without the `+`. */
|
|
19
|
+
dialCode: string;
|
|
20
|
+
}
|
|
21
|
+
/** The permissive bound applied when a country has no pattern. */
|
|
22
|
+
export declare const POSTAL_MIN = 3;
|
|
23
|
+
export declare const POSTAL_MAX = 12;
|
|
24
|
+
export declare const COUNTRIES: Record<string, CountryDef>;
|
|
25
|
+
export declare const COUNTRY_CODES: string[];
|
|
26
|
+
export type CountryCode = string;
|
|
27
|
+
/** Where this marketplace is, and what an address defaults to. */
|
|
28
|
+
export declare const DEFAULT_COUNTRY = "IN";
|
|
29
|
+
/**
|
|
30
|
+
* Resolve a country by code or by name.
|
|
31
|
+
*
|
|
32
|
+
* By NAME as well, because `AddressDocument.country` is a free-text string
|
|
33
|
+
* today and holds `"India"` on every seeded and user-entered row. A resolver
|
|
34
|
+
* that only understood codes would treat every existing address as an unknown
|
|
35
|
+
* country and silently drop to the permissive rule — the migration would look
|
|
36
|
+
* like it worked and would have switched validation off.
|
|
37
|
+
*/
|
|
38
|
+
export declare function countryFor(value: string | undefined | null): CountryDef | null;
|
|
39
|
+
/** The postal pattern for a country, or `null` when none is known. */
|
|
40
|
+
export declare function postalPatternFor(country: string | undefined | null): RegExp | null;
|
|
41
|
+
/** "PIN code" / "ZIP code" / "Postcode" — what to put on the label. */
|
|
42
|
+
export declare function postalLabelFor(country: string | undefined | null): string;
|
|
43
|
+
/**
|
|
44
|
+
* The ONE postal check, used by every form and every route.
|
|
45
|
+
*
|
|
46
|
+
* An empty code is NOT valid — required-ness is the caller's business, but a
|
|
47
|
+
* blank string is never a postal code, and letting it through here is how the
|
|
48
|
+
* `.min(1)` client rule came to disagree with the server in the first place.
|
|
49
|
+
*/
|
|
50
|
+
export declare function isValidPostalCode(country: string | undefined | null, postalCode: string | undefined | null): boolean;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* WHY: A postal code was validated by **fifteen** different rules, and they
|
|
3
|
+
* disagreed. Two of them are server-side rules on the SAME entity:
|
|
4
|
+
* `src/actions/address.actions.ts` said `.min(4).max(10)` while
|
|
5
|
+
* `src/validation/request-schemas.ts` said `/^\d{6}$/`. Another accepted
|
|
6
|
+
* 5-or-6 digits. And `src/app/api/admin/addresses/route.ts` used
|
|
7
|
+
* `.min(6).max(6)` — a LENGTH check with no character class, so
|
|
8
|
+
* `"abcdef"` was a valid Indian PIN code as far as it was concerned.
|
|
9
|
+
*
|
|
10
|
+
* Meanwhile the client form said `z.string().min(1)`, so `abc` passed
|
|
11
|
+
* every check the user could see and came back as a server 400 with
|
|
12
|
+
* nothing on the field.
|
|
13
|
+
*
|
|
14
|
+
* The India-only regex was itself a bug in waiting: `country` is a free
|
|
15
|
+
* text field, so a Canadian address was being held to `/^\d{6}$/`.
|
|
16
|
+
*
|
|
17
|
+
* WHAT: One postal rule per country, and the country list that carries it.
|
|
18
|
+
*
|
|
19
|
+
* ## Why this is curated rather than all 250 ISO countries
|
|
20
|
+
*
|
|
21
|
+
* A pattern is only worth having if it is RIGHT. Hand-typing 250 of them from
|
|
22
|
+
* memory produces a table that looks authoritative and quietly rejects real
|
|
23
|
+
* addresses — which is worse than not knowing, because the user cannot
|
|
24
|
+
* override it. So the list covers the countries this marketplace actually
|
|
25
|
+
* ships to and to which its sellers source, and everything else resolves to
|
|
26
|
+
* `null`, which means "accept anything plausible".
|
|
27
|
+
*
|
|
28
|
+
* 🛑 An unknown country must never BLOCK a save. A postal rule exists to catch
|
|
29
|
+
* a typo, not to police the atlas.
|
|
30
|
+
*
|
|
31
|
+
* EXPORTS:
|
|
32
|
+
* COUNTRIES, COUNTRY_CODES, DEFAULT_COUNTRY, type CountryCode,
|
|
33
|
+
* type CountryDef, countryFor, postalPatternFor, isValidPostalCode,
|
|
34
|
+
* postalLabelFor, POSTAL_MIN, POSTAL_MAX
|
|
35
|
+
*
|
|
36
|
+
* @tag domain:geo
|
|
37
|
+
* @tag layer:constants
|
|
38
|
+
* @tag pattern:registry
|
|
39
|
+
* @tag access:isomorphic
|
|
40
|
+
* @tag consumers:address forms,address routes,usePostalLookup
|
|
41
|
+
* @tag sideEffects:none
|
|
42
|
+
*/
|
|
43
|
+
/** The permissive bound applied when a country has no pattern. */
|
|
44
|
+
export const POSTAL_MIN = 3;
|
|
45
|
+
export const POSTAL_MAX = 12;
|
|
46
|
+
/**
|
|
47
|
+
* 🛑 Patterns are anchored and case-insensitive where the country's format
|
|
48
|
+
* includes letters. An unanchored pattern would accept a code with trailing
|
|
49
|
+
* junk, which is exactly the class of typo this is meant to catch.
|
|
50
|
+
*/
|
|
51
|
+
const COUNTRY_LIST = [
|
|
52
|
+
{ code: "IN", name: "India", postalPattern: /^[1-9]\d{5}$/, postalLabel: "PIN code", hasStates: true, dialCode: "91" },
|
|
53
|
+
{ code: "US", name: "United States", postalPattern: /^\d{5}(-\d{4})?$/, postalLabel: "ZIP code", hasStates: true, dialCode: "1" },
|
|
54
|
+
{ code: "GB", name: "United Kingdom", postalPattern: /^[A-Z]{1,2}\d[A-Z\d]?\s*\d[A-Z]{2}$/i, postalLabel: "Postcode", hasStates: false, dialCode: "44" },
|
|
55
|
+
{ code: "CA", name: "Canada", postalPattern: /^[A-Z]\d[A-Z]\s*\d[A-Z]\d$/i, postalLabel: "Postal code", hasStates: true, dialCode: "1" },
|
|
56
|
+
{ code: "AU", name: "Australia", postalPattern: /^\d{4}$/, postalLabel: "Postcode", hasStates: true, dialCode: "61" },
|
|
57
|
+
{ code: "NZ", name: "New Zealand", postalPattern: /^\d{4}$/, postalLabel: "Postcode", hasStates: false, dialCode: "64" },
|
|
58
|
+
{ code: "SG", name: "Singapore", postalPattern: /^\d{6}$/, postalLabel: "Postal code", hasStates: false, dialCode: "65" },
|
|
59
|
+
{ code: "MY", name: "Malaysia", postalPattern: /^\d{5}$/, postalLabel: "Postcode", hasStates: false, dialCode: "60" },
|
|
60
|
+
{ code: "JP", name: "Japan", postalPattern: /^\d{3}-?\d{4}$/, postalLabel: "Postal code", hasStates: false, dialCode: "81" },
|
|
61
|
+
{ code: "DE", name: "Germany", postalPattern: /^\d{5}$/, postalLabel: "PLZ", hasStates: false, dialCode: "49" },
|
|
62
|
+
{ code: "FR", name: "France", postalPattern: /^\d{5}$/, postalLabel: "Code postal", hasStates: false, dialCode: "33" },
|
|
63
|
+
{ code: "NL", name: "Netherlands", postalPattern: /^\d{4}\s*[A-Z]{2}$/i, postalLabel: "Postcode", hasStates: false, dialCode: "31" },
|
|
64
|
+
{ code: "IT", name: "Italy", postalPattern: /^\d{5}$/, postalLabel: "CAP", hasStates: false, dialCode: "39" },
|
|
65
|
+
{ code: "ES", name: "Spain", postalPattern: /^\d{5}$/, postalLabel: "Código postal", hasStates: false, dialCode: "34" },
|
|
66
|
+
{ code: "AE", name: "United Arab Emirates", postalPattern: null, postalLabel: "Postal code", hasStates: false, dialCode: "971" },
|
|
67
|
+
{ code: "SA", name: "Saudi Arabia", postalPattern: /^\d{5}$/, postalLabel: "Postal code", hasStates: false, dialCode: "966" },
|
|
68
|
+
{ code: "LK", name: "Sri Lanka", postalPattern: /^\d{5}$/, postalLabel: "Postal code", hasStates: false, dialCode: "94" },
|
|
69
|
+
{ code: "BD", name: "Bangladesh", postalPattern: /^\d{4}$/, postalLabel: "Postal code", hasStates: false, dialCode: "880" },
|
|
70
|
+
{ code: "NP", name: "Nepal", postalPattern: /^\d{5}$/, postalLabel: "Postal code", hasStates: false, dialCode: "977" },
|
|
71
|
+
{ code: "PK", name: "Pakistan", postalPattern: /^\d{5}$/, postalLabel: "Postal code", hasStates: false, dialCode: "92" },
|
|
72
|
+
{ code: "CN", name: "China", postalPattern: /^\d{6}$/, postalLabel: "Postal code", hasStates: false, dialCode: "86" },
|
|
73
|
+
{ code: "HK", name: "Hong Kong", postalPattern: null, postalLabel: "Postal code", hasStates: false, dialCode: "852" },
|
|
74
|
+
{ code: "TH", name: "Thailand", postalPattern: /^\d{5}$/, postalLabel: "Postal code", hasStates: false, dialCode: "66" },
|
|
75
|
+
{ code: "ID", name: "Indonesia", postalPattern: /^\d{5}$/, postalLabel: "Postal code", hasStates: false, dialCode: "62" },
|
|
76
|
+
{ code: "PH", name: "Philippines", postalPattern: /^\d{4}$/, postalLabel: "Postal code", hasStates: false, dialCode: "63" },
|
|
77
|
+
{ code: "ZA", name: "South Africa", postalPattern: /^\d{4}$/, postalLabel: "Postal code", hasStates: false, dialCode: "27" },
|
|
78
|
+
{ code: "BR", name: "Brazil", postalPattern: /^\d{5}-?\d{3}$/, postalLabel: "CEP", hasStates: false, dialCode: "55" },
|
|
79
|
+
{ code: "MX", name: "Mexico", postalPattern: /^\d{5}$/, postalLabel: "Código postal", hasStates: false, dialCode: "52" },
|
|
80
|
+
];
|
|
81
|
+
export const COUNTRIES = Object.fromEntries(COUNTRY_LIST.map((c) => [c.code, c]));
|
|
82
|
+
export const COUNTRY_CODES = COUNTRY_LIST.map((c) => c.code);
|
|
83
|
+
/** Where this marketplace is, and what an address defaults to. */
|
|
84
|
+
export const DEFAULT_COUNTRY = "IN";
|
|
85
|
+
/**
|
|
86
|
+
* Resolve a country by code or by name.
|
|
87
|
+
*
|
|
88
|
+
* By NAME as well, because `AddressDocument.country` is a free-text string
|
|
89
|
+
* today and holds `"India"` on every seeded and user-entered row. A resolver
|
|
90
|
+
* that only understood codes would treat every existing address as an unknown
|
|
91
|
+
* country and silently drop to the permissive rule — the migration would look
|
|
92
|
+
* like it worked and would have switched validation off.
|
|
93
|
+
*/
|
|
94
|
+
export function countryFor(value) {
|
|
95
|
+
if (!value)
|
|
96
|
+
return null;
|
|
97
|
+
const trimmed = value.trim();
|
|
98
|
+
if (!trimmed)
|
|
99
|
+
return null;
|
|
100
|
+
const byCode = COUNTRIES[trimmed.toUpperCase()];
|
|
101
|
+
if (byCode)
|
|
102
|
+
return byCode;
|
|
103
|
+
const lower = trimmed.toLowerCase();
|
|
104
|
+
return COUNTRY_LIST.find((c) => c.name.toLowerCase() === lower) ?? null;
|
|
105
|
+
}
|
|
106
|
+
/** The postal pattern for a country, or `null` when none is known. */
|
|
107
|
+
export function postalPatternFor(country) {
|
|
108
|
+
return countryFor(country)?.postalPattern ?? null;
|
|
109
|
+
}
|
|
110
|
+
/** "PIN code" / "ZIP code" / "Postcode" — what to put on the label. */
|
|
111
|
+
export function postalLabelFor(country) {
|
|
112
|
+
return countryFor(country)?.postalLabel ?? "Postal code";
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* The ONE postal check, used by every form and every route.
|
|
116
|
+
*
|
|
117
|
+
* An empty code is NOT valid — required-ness is the caller's business, but a
|
|
118
|
+
* blank string is never a postal code, and letting it through here is how the
|
|
119
|
+
* `.min(1)` client rule came to disagree with the server in the first place.
|
|
120
|
+
*/
|
|
121
|
+
export function isValidPostalCode(country, postalCode) {
|
|
122
|
+
const code = (postalCode ?? "").trim();
|
|
123
|
+
if (!code)
|
|
124
|
+
return false;
|
|
125
|
+
const pattern = postalPatternFor(country);
|
|
126
|
+
if (pattern)
|
|
127
|
+
return pattern.test(code);
|
|
128
|
+
return code.length >= POSTAL_MIN && code.length <= POSTAL_MAX;
|
|
129
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** India's 28 states + 8 union territories. */
|
|
2
|
+
declare const INDIA: readonly ["Andhra Pradesh", "Arunachal Pradesh", "Assam", "Bihar", "Chhattisgarh", "Goa", "Gujarat", "Haryana", "Himachal Pradesh", "Jharkhand", "Karnataka", "Kerala", "Madhya Pradesh", "Maharashtra", "Manipur", "Meghalaya", "Mizoram", "Nagaland", "Odisha", "Punjab", "Rajasthan", "Sikkim", "Tamil Nadu", "Telangana", "Tripura", "Uttar Pradesh", "Uttarakhand", "West Bengal", "Andaman and Nicobar Islands", "Chandigarh", "Dadra and Nagar Haveli and Daman and Diu", "Delhi", "Jammu and Kashmir", "Ladakh", "Lakshadweep", "Puducherry"];
|
|
3
|
+
export type IndianState = (typeof INDIA)[number];
|
|
4
|
+
/** Country code → its subdivisions, alphabetical within each. */
|
|
5
|
+
export declare const SUBDIVISIONS: Record<string, readonly string[]>;
|
|
6
|
+
/**
|
|
7
|
+
* The subdivisions for a country, or an empty list when it has none.
|
|
8
|
+
*
|
|
9
|
+
* An empty list is the signal to render a free-text State input rather than a
|
|
10
|
+
* picker — see `hasStates` on the country definition.
|
|
11
|
+
*/
|
|
12
|
+
export declare function subdivisionsFor(countryCode: string | undefined | null): readonly string[];
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* WHY: `INDIAN_STATES` existed and was used by **one** file — the admin
|
|
3
|
+
* address editor — while the user-facing `AddressForm` and
|
|
4
|
+
* `SellerAddressesView` both wrote the same `AddressDocument.state`
|
|
5
|
+
* through a FREE TEXT input. So the same field held "Karnataka",
|
|
6
|
+
* "karnataka", "KA" and "Karnatka" depending on which of the three
|
|
7
|
+
* surfaces created the row, and nothing could group or filter on it.
|
|
8
|
+
* WHAT: Country → subdivisions, for every country whose `hasStates` is true.
|
|
9
|
+
*
|
|
10
|
+
* ## Only what is enumerated
|
|
11
|
+
*
|
|
12
|
+
* A country appears here when `COUNTRIES[code].hasStates` is true, and the two
|
|
13
|
+
* must agree — `audit-address-shape` checks that. A country with `hasStates`
|
|
14
|
+
* and no list would render an empty picker with no way to type a state, which
|
|
15
|
+
* is strictly worse than the free-text box this replaces.
|
|
16
|
+
*
|
|
17
|
+
* EXPORTS: SUBDIVISIONS, subdivisionsFor, type IndianState
|
|
18
|
+
*
|
|
19
|
+
* @tag domain:geo
|
|
20
|
+
* @tag layer:constants
|
|
21
|
+
* @tag pattern:registry
|
|
22
|
+
* @tag access:isomorphic
|
|
23
|
+
* @tag consumers:address forms
|
|
24
|
+
* @tag sideEffects:none
|
|
25
|
+
*/
|
|
26
|
+
/** India's 28 states + 8 union territories. */
|
|
27
|
+
const INDIA = [
|
|
28
|
+
"Andhra Pradesh",
|
|
29
|
+
"Arunachal Pradesh",
|
|
30
|
+
"Assam",
|
|
31
|
+
"Bihar",
|
|
32
|
+
"Chhattisgarh",
|
|
33
|
+
"Goa",
|
|
34
|
+
"Gujarat",
|
|
35
|
+
"Haryana",
|
|
36
|
+
"Himachal Pradesh",
|
|
37
|
+
"Jharkhand",
|
|
38
|
+
"Karnataka",
|
|
39
|
+
"Kerala",
|
|
40
|
+
"Madhya Pradesh",
|
|
41
|
+
"Maharashtra",
|
|
42
|
+
"Manipur",
|
|
43
|
+
"Meghalaya",
|
|
44
|
+
"Mizoram",
|
|
45
|
+
"Nagaland",
|
|
46
|
+
"Odisha",
|
|
47
|
+
"Punjab",
|
|
48
|
+
"Rajasthan",
|
|
49
|
+
"Sikkim",
|
|
50
|
+
"Tamil Nadu",
|
|
51
|
+
"Telangana",
|
|
52
|
+
"Tripura",
|
|
53
|
+
"Uttar Pradesh",
|
|
54
|
+
"Uttarakhand",
|
|
55
|
+
"West Bengal",
|
|
56
|
+
"Andaman and Nicobar Islands",
|
|
57
|
+
"Chandigarh",
|
|
58
|
+
"Dadra and Nagar Haveli and Daman and Diu",
|
|
59
|
+
"Delhi",
|
|
60
|
+
"Jammu and Kashmir",
|
|
61
|
+
"Ladakh",
|
|
62
|
+
"Lakshadweep",
|
|
63
|
+
"Puducherry",
|
|
64
|
+
];
|
|
65
|
+
const US = [
|
|
66
|
+
"Alabama", "Alaska", "Arizona", "Arkansas", "California", "Colorado",
|
|
67
|
+
"Connecticut", "Delaware", "District of Columbia", "Florida", "Georgia",
|
|
68
|
+
"Hawaii", "Idaho", "Illinois", "Indiana", "Iowa", "Kansas", "Kentucky",
|
|
69
|
+
"Louisiana", "Maine", "Maryland", "Massachusetts", "Michigan", "Minnesota",
|
|
70
|
+
"Mississippi", "Missouri", "Montana", "Nebraska", "Nevada", "New Hampshire",
|
|
71
|
+
"New Jersey", "New Mexico", "New York", "North Carolina", "North Dakota",
|
|
72
|
+
"Ohio", "Oklahoma", "Oregon", "Pennsylvania", "Rhode Island",
|
|
73
|
+
"South Carolina", "South Dakota", "Tennessee", "Texas", "Utah", "Vermont",
|
|
74
|
+
"Virginia", "Washington", "West Virginia", "Wisconsin", "Wyoming",
|
|
75
|
+
];
|
|
76
|
+
const CA = [
|
|
77
|
+
"Alberta", "British Columbia", "Manitoba", "New Brunswick",
|
|
78
|
+
"Newfoundland and Labrador", "Northwest Territories", "Nova Scotia",
|
|
79
|
+
"Nunavut", "Ontario", "Prince Edward Island", "Quebec", "Saskatchewan",
|
|
80
|
+
"Yukon",
|
|
81
|
+
];
|
|
82
|
+
const AU = [
|
|
83
|
+
"Australian Capital Territory", "New South Wales", "Northern Territory",
|
|
84
|
+
"Queensland", "South Australia", "Tasmania", "Victoria",
|
|
85
|
+
"Western Australia",
|
|
86
|
+
];
|
|
87
|
+
/** Country code → its subdivisions, alphabetical within each. */
|
|
88
|
+
export const SUBDIVISIONS = {
|
|
89
|
+
IN: INDIA,
|
|
90
|
+
US,
|
|
91
|
+
CA,
|
|
92
|
+
AU,
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* The subdivisions for a country, or an empty list when it has none.
|
|
96
|
+
*
|
|
97
|
+
* An empty list is the signal to render a free-text State input rather than a
|
|
98
|
+
* picker — see `hasStates` on the country definition.
|
|
99
|
+
*/
|
|
100
|
+
export function subdivisionsFor(countryCode) {
|
|
101
|
+
if (!countryCode)
|
|
102
|
+
return [];
|
|
103
|
+
return SUBDIVISIONS[countryCode.trim().toUpperCase()] ?? [];
|
|
104
|
+
}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* import { COLLECTION_CACHE_PATHS } from "@mohasinac/appkit/constants";
|
|
10
10
|
* import { resolveEndpoint } from "@mohasinac/appkit/constants";
|
|
11
11
|
*/
|
|
12
|
-
export { API_ENDPOINTS, API_ROUTES, LOGS_ENDPOINTS, AUTH_ENDPOINTS, ACCOUNT_ENDPOINTS, NOTIFICATIONS_ENDPOINTS, SITE_SETTINGS_ENDPOINTS, ADMIN_ENDPOINTS,
|
|
12
|
+
export { API_ENDPOINTS, API_ROUTES, LOGS_ENDPOINTS, AUTH_ENDPOINTS, ACCOUNT_ENDPOINTS, NOTIFICATIONS_ENDPOINTS, SITE_SETTINGS_ENDPOINTS, ADMIN_ENDPOINTS, AUCTION_ENDPOINTS, BID_ENDPOINTS, CART_ENDPOINTS, CATEGORY_ENDPOINTS, CHECKOUT_ENDPOINTS, PAYMENT_ENDPOINTS, COLLECTION_ENDPOINTS, CONSULTATION_ENDPOINTS, COPILOT_ENDPOINTS, CORPORATE_ENDPOINTS, EVENT_ENDPOINTS, FAQ_ENDPOINTS, HOMEPAGE_ENDPOINTS, LOYALTY_ENDPOINTS, ANALYTICS_ENDPOINTS, MEDIA_ENDPOINTS, ORDER_ENDPOINTS, PREORDER_ENDPOINTS, PRODUCT_ENDPOINTS, PROMOTION_ENDPOINTS, REVIEW_ENDPOINTS, SEARCH_ENDPOINTS, SELLER_ENDPOINTS, BLOG_ENDPOINTS, STORE_ENDPOINTS, WISHLIST_ENDPOINTS, PROFILE_STATS_ENDPOINTS, } from "./api-endpoints";
|
|
13
13
|
export { COLLECTION_CACHE_PATHS } from "./cache-invalidation";
|
|
14
14
|
export { PAGE_SIZES, MAX_PAGE_SIZE, FEATURED_LIMITS, SITEMAP_LIMITS, } from "./pagination-presets";
|
|
15
15
|
export type { PageSizeKey } from "./pagination-presets";
|
|
@@ -18,6 +18,6 @@ export type { NotificationType } from "./notification-types";
|
|
|
18
18
|
export { resolveEndpoint, resolveEndpointFn } from "./api-endpoint-resolver";
|
|
19
19
|
export { ROUTES, PUBLIC_ROUTES, PROTECTED_ROUTES, AUTH_ROUTES } from "../next/routing/route-map";
|
|
20
20
|
export { WISHLIST_MAX, HISTORY_MAX, CART_MAX_ITEMS, WISHLIST_DOC_ID, HISTORY_DOC_ID, WISHLIST_COLLECTION, HISTORY_COLLECTION, } from "./limits";
|
|
21
|
-
export { PRODUCT_FIELDS, PRODUCT_STATUS_TRANSITIONS, ORDER_FIELDS, REVIEW_FIELDS, BID_FIELDS, AD_FIELDS, EVENT_FIELDS, EVENT_ENTRY_FIELDS, PAYOUT_FIELDS, STORE_FIELDS, CATEGORY_FIELDS, BLOG_FIELDS, USER_FIELDS, ADDRESS_FIELDS, BRAND_FIELDS, CART_FIELDS, WISHLIST_FIELDS, HISTORY_FIELDS, NOTIFICATION_FIELDS, SESSION_FIELDS, COUPON_USAGE_FIELDS,
|
|
21
|
+
export { PRODUCT_FIELDS, PRODUCT_STATUS_TRANSITIONS, ORDER_FIELDS, REVIEW_FIELDS, BID_FIELDS, AD_FIELDS, EVENT_FIELDS, EVENT_ENTRY_FIELDS, PAYOUT_FIELDS, STORE_FIELDS, CATEGORY_FIELDS, BLOG_FIELDS, USER_FIELDS, ADDRESS_FIELDS, BRAND_FIELDS, CART_FIELDS, WISHLIST_FIELDS, HISTORY_FIELDS, NOTIFICATION_FIELDS, SESSION_FIELDS, COUPON_USAGE_FIELDS, SCAMMER_FIELDS, SUPPORT_TICKET_FIELDS, CAROUSEL_FIELDS, COUPON_FIELDS, FAQ_FIELDS, HOMEPAGE_SECTION_FIELDS, SITE_SETTINGS_FIELDS, COMMON_FIELDS, OAUTH_STATE_VALUES, SCHEMA_DEFAULTS, } from "./field-names";
|
|
22
22
|
export { SELLER_LISTING_TABS, type SellerListingTabId, } from "../features/products/constants/listing-tabs";
|
|
23
23
|
export { ALL_TAB, EMPTY_TAB, ADMIN_PRODUCT_STATUS_TABS, ADMIN_PRODUCT_LISTING_TYPE_TABS, ADMIN_BLOG_STATUS_TABS, ADMIN_USER_STATUS_TABS, ADMIN_USER_ROLE_TABS, ADMIN_STORE_STATUS_TABS, ADMIN_PAYOUT_STATUS_TABS, ADMIN_ORDER_STATUS_TABS, ADMIN_REVIEW_STATUS_TABS, ADMIN_REVIEW_RATING_TABS, ADMIN_BID_STATUS_TABS, ADMIN_CONTACT_STATUS_TABS, ADMIN_NEWSLETTER_STATUS_TABS, ADMIN_EVENT_ENTRY_STATUS_TABS, ADMIN_EVENT_STATUS_TABS, ADMIN_CART_OWNERSHIP_TABS, ADMIN_COUPON_TYPE_TABS, SELLER_PRODUCT_STATUS_TABS, SELLER_AUCTION_STATUS_TABS, SELLER_ORDER_STATUS_TABS, SELLER_OFFER_STATUS_TABS, SELLER_BID_STATUS_TABS, } from "../features/admin/constants/filter-tabs";
|
package/dist/constants/index.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* import { COLLECTION_CACHE_PATHS } from "@mohasinac/appkit/constants";
|
|
10
10
|
* import { resolveEndpoint } from "@mohasinac/appkit/constants";
|
|
11
11
|
*/
|
|
12
|
-
export { API_ENDPOINTS, API_ROUTES, LOGS_ENDPOINTS, AUTH_ENDPOINTS, ACCOUNT_ENDPOINTS, NOTIFICATIONS_ENDPOINTS, SITE_SETTINGS_ENDPOINTS, ADMIN_ENDPOINTS,
|
|
12
|
+
export { API_ENDPOINTS, API_ROUTES, LOGS_ENDPOINTS, AUTH_ENDPOINTS, ACCOUNT_ENDPOINTS, NOTIFICATIONS_ENDPOINTS, SITE_SETTINGS_ENDPOINTS, ADMIN_ENDPOINTS, AUCTION_ENDPOINTS, BID_ENDPOINTS, CART_ENDPOINTS, CATEGORY_ENDPOINTS, CHECKOUT_ENDPOINTS, PAYMENT_ENDPOINTS, COLLECTION_ENDPOINTS, CONSULTATION_ENDPOINTS, COPILOT_ENDPOINTS, CORPORATE_ENDPOINTS, EVENT_ENDPOINTS, FAQ_ENDPOINTS, HOMEPAGE_ENDPOINTS, LOYALTY_ENDPOINTS, ANALYTICS_ENDPOINTS, MEDIA_ENDPOINTS, ORDER_ENDPOINTS, PREORDER_ENDPOINTS, PRODUCT_ENDPOINTS, PROMOTION_ENDPOINTS, REVIEW_ENDPOINTS, SEARCH_ENDPOINTS, SELLER_ENDPOINTS, BLOG_ENDPOINTS, STORE_ENDPOINTS, WISHLIST_ENDPOINTS, PROFILE_STATS_ENDPOINTS, } from "./api-endpoints";
|
|
13
13
|
export { COLLECTION_CACHE_PATHS } from "./cache-invalidation";
|
|
14
14
|
export { PAGE_SIZES, MAX_PAGE_SIZE, FEATURED_LIMITS, SITEMAP_LIMITS, } from "./pagination-presets";
|
|
15
15
|
export { NOTIFICATION_TYPES, NOTIFICATION_TYPE_TABS, } from "./notification-types";
|
|
@@ -21,7 +21,7 @@ export { WISHLIST_MAX, HISTORY_MAX, CART_MAX_ITEMS, WISHLIST_DOC_ID, HISTORY_DOC
|
|
|
21
21
|
// derived objects (e.g. Object.values(...) for a Zod enum) at module-eval
|
|
22
22
|
// time, which needs a small, synchronously-resolvable subpath rather than
|
|
23
23
|
// the much larger client.ts barrel.
|
|
24
|
-
export { PRODUCT_FIELDS, PRODUCT_STATUS_TRANSITIONS, ORDER_FIELDS, REVIEW_FIELDS, BID_FIELDS, AD_FIELDS, EVENT_FIELDS, EVENT_ENTRY_FIELDS, PAYOUT_FIELDS, STORE_FIELDS, CATEGORY_FIELDS, BLOG_FIELDS, USER_FIELDS, ADDRESS_FIELDS, BRAND_FIELDS, CART_FIELDS, WISHLIST_FIELDS, HISTORY_FIELDS, NOTIFICATION_FIELDS, SESSION_FIELDS, COUPON_USAGE_FIELDS,
|
|
24
|
+
export { PRODUCT_FIELDS, PRODUCT_STATUS_TRANSITIONS, ORDER_FIELDS, REVIEW_FIELDS, BID_FIELDS, AD_FIELDS, EVENT_FIELDS, EVENT_ENTRY_FIELDS, PAYOUT_FIELDS, STORE_FIELDS, CATEGORY_FIELDS, BLOG_FIELDS, USER_FIELDS, ADDRESS_FIELDS, BRAND_FIELDS, CART_FIELDS, WISHLIST_FIELDS, HISTORY_FIELDS, NOTIFICATION_FIELDS, SESSION_FIELDS, COUPON_USAGE_FIELDS, SCAMMER_FIELDS, SUPPORT_TICKET_FIELDS, CAROUSEL_FIELDS, COUPON_FIELDS, FAQ_FIELDS, HOMEPAGE_SECTION_FIELDS, SITE_SETTINGS_FIELDS, COMMON_FIELDS, OAUTH_STATE_VALUES, SCHEMA_DEFAULTS, } from "./field-names";
|
|
25
25
|
// Dashboard filter-tab sets — same rationale as the field-name maps above.
|
|
26
26
|
export { SELLER_LISTING_TABS, } from "../features/products/constants/listing-tabs";
|
|
27
27
|
export { ALL_TAB, EMPTY_TAB, ADMIN_PRODUCT_STATUS_TABS, ADMIN_PRODUCT_LISTING_TYPE_TABS, ADMIN_BLOG_STATUS_TABS, ADMIN_USER_STATUS_TABS, ADMIN_USER_ROLE_TABS, ADMIN_STORE_STATUS_TABS, ADMIN_PAYOUT_STATUS_TABS, ADMIN_ORDER_STATUS_TABS, ADMIN_REVIEW_STATUS_TABS, ADMIN_REVIEW_RATING_TABS, ADMIN_BID_STATUS_TABS, ADMIN_CONTACT_STATUS_TABS, ADMIN_NEWSLETTER_STATUS_TABS, ADMIN_EVENT_ENTRY_STATUS_TABS, ADMIN_EVENT_STATUS_TABS, ADMIN_CART_OWNERSHIP_TABS, ADMIN_COUPON_TYPE_TABS, SELLER_PRODUCT_STATUS_TABS, SELLER_AUCTION_STATUS_TABS, SELLER_ORDER_STATUS_TABS, SELLER_OFFER_STATUS_TABS, SELLER_BID_STATUS_TABS, } from "../features/admin/constants/filter-tabs";
|
|
@@ -68,6 +68,30 @@ export declare const TABLE_KEYS: {
|
|
|
68
68
|
readonly LIVE_TRANSPORT_METHOD: "liveTransportMethod";
|
|
69
69
|
};
|
|
70
70
|
export type TableKey = (typeof TABLE_KEYS)[keyof typeof TABLE_KEYS];
|
|
71
|
+
/**
|
|
72
|
+
* The one delimiter joining several values of ONE filter key in a URL.
|
|
73
|
+
*
|
|
74
|
+
* 🛑 `"|"`, never `","`. sievejs reads same-field `|` as an OR-group, which the
|
|
75
|
+
* Firestore adapter upgrades to an `in` query. A comma is a clause SEPARATOR —
|
|
76
|
+
* `condition==new,condition==used` is an AND of two equalities on one field and
|
|
77
|
+
* can never match a document.
|
|
78
|
+
*
|
|
79
|
+
* Two filter systems disagreed on this. `ProductFilters` and the 11 sites like
|
|
80
|
+
* it wrote `vals.join("|")`; `usePendingFilters` and `FilterPanel` split and
|
|
81
|
+
* joined on `","` for the SAME URL keys. Nothing broke visibly, because a
|
|
82
|
+
* pipe-joined string survives a comma split as a single element and round-trips
|
|
83
|
+
* intact — but it counts as ONE, so the active-filter badge reported 1 for a
|
|
84
|
+
* three-category selection, and `usePendingTable.get`'s `[0]` returned the
|
|
85
|
+
* whole `"a|b|c"` string and appeared correct for the same wrong reason.
|
|
86
|
+
*
|
|
87
|
+
* Split and join through the two helpers below rather than inlining either
|
|
88
|
+
* character; that is what keeps the count, the wire format and Sieve agreeing.
|
|
89
|
+
*/
|
|
90
|
+
export declare const FILTER_VALUE_DELIMITER = "|";
|
|
91
|
+
/** Parse a multi-value filter param. Empty string → no values, never `[""]`. */
|
|
92
|
+
export declare function splitFilterValues(raw: string | null | undefined): string[];
|
|
93
|
+
/** Serialise a multi-value filter param for the URL. */
|
|
94
|
+
export declare function joinFilterValues(values: readonly string[]): string;
|
|
71
95
|
export declare const VIEW_MODE: {
|
|
72
96
|
readonly GRID: "grid";
|
|
73
97
|
readonly LIST: "list";
|
|
@@ -70,6 +70,34 @@ export const TABLE_KEYS = {
|
|
|
70
70
|
LIVE_SEX: "liveSex",
|
|
71
71
|
LIVE_TRANSPORT_METHOD: "liveTransportMethod",
|
|
72
72
|
};
|
|
73
|
+
/**
|
|
74
|
+
* The one delimiter joining several values of ONE filter key in a URL.
|
|
75
|
+
*
|
|
76
|
+
* 🛑 `"|"`, never `","`. sievejs reads same-field `|` as an OR-group, which the
|
|
77
|
+
* Firestore adapter upgrades to an `in` query. A comma is a clause SEPARATOR —
|
|
78
|
+
* `condition==new,condition==used` is an AND of two equalities on one field and
|
|
79
|
+
* can never match a document.
|
|
80
|
+
*
|
|
81
|
+
* Two filter systems disagreed on this. `ProductFilters` and the 11 sites like
|
|
82
|
+
* it wrote `vals.join("|")`; `usePendingFilters` and `FilterPanel` split and
|
|
83
|
+
* joined on `","` for the SAME URL keys. Nothing broke visibly, because a
|
|
84
|
+
* pipe-joined string survives a comma split as a single element and round-trips
|
|
85
|
+
* intact — but it counts as ONE, so the active-filter badge reported 1 for a
|
|
86
|
+
* three-category selection, and `usePendingTable.get`'s `[0]` returned the
|
|
87
|
+
* whole `"a|b|c"` string and appeared correct for the same wrong reason.
|
|
88
|
+
*
|
|
89
|
+
* Split and join through the two helpers below rather than inlining either
|
|
90
|
+
* character; that is what keeps the count, the wire format and Sieve agreeing.
|
|
91
|
+
*/
|
|
92
|
+
export const FILTER_VALUE_DELIMITER = "|";
|
|
93
|
+
/** Parse a multi-value filter param. Empty string → no values, never `[""]`. */
|
|
94
|
+
export function splitFilterValues(raw) {
|
|
95
|
+
return raw ? raw.split(FILTER_VALUE_DELIMITER).filter(Boolean) : [];
|
|
96
|
+
}
|
|
97
|
+
/** Serialise a multi-value filter param for the URL. */
|
|
98
|
+
export function joinFilterValues(values) {
|
|
99
|
+
return values.filter(Boolean).join(FILTER_VALUE_DELIMITER);
|
|
100
|
+
}
|
|
73
101
|
export const VIEW_MODE = {
|
|
74
102
|
GRID: "grid",
|
|
75
103
|
LIST: "list",
|
|
@@ -52,15 +52,6 @@ export interface WithTransformOpts<Base, Target extends Base = Base> {
|
|
|
52
52
|
* Convenience helper: build a response type for list endpoints that mirrors
|
|
53
53
|
* the package's standard list-response shape but with a generic item type.
|
|
54
54
|
*/
|
|
55
|
-
export interface GenericListResponse<T> {
|
|
56
|
-
items: T[];
|
|
57
|
-
total: number;
|
|
58
|
-
page: number;
|
|
59
|
-
pageSize?: number;
|
|
60
|
-
perPage?: number;
|
|
61
|
-
totalPages: number;
|
|
62
|
-
hasMore?: boolean;
|
|
63
|
-
}
|
|
64
55
|
/**
|
|
65
56
|
* A single column definition for data tables.
|
|
66
57
|
* Defined here in contracts so feat-* packages can export default column sets
|
|
@@ -17,7 +17,7 @@ export type { ExtraFormField, ExtraFieldRenderArgs } from "./form";
|
|
|
17
17
|
export { registerFormFields, resolveFormFields, removeFormFields, _resetFormFields, } from "./form";
|
|
18
18
|
export type { RouteStub, ApiRouteStub, FeatureManifest, FeaturesConfig, } from "./feature";
|
|
19
19
|
export type { SiteConfig, NavItem } from "./config";
|
|
20
|
-
export type { WithTransformOpts,
|
|
20
|
+
export type { WithTransformOpts, TableColumn, ColumnPriority, ColumnExtensionOpts, LayoutSlots, FeatureExtension, } from "./extend";
|
|
21
21
|
export { COLUMN_PRIORITY_CLASS, COLUMN_PRIORITY_CLASS_BLOCK } from "./extend";
|
|
22
22
|
export type { PaginationConfig, StickyConfig, TableConfig, TableViewMode, } from "./table";
|
|
23
23
|
export { DEFAULT_PAGINATION_CONFIG, DEFAULT_STICKY_CONFIG, DEFAULT_TABLE_CONFIG, mergeTableConfig, } from "./table";
|