@mohasinac/appkit 4.70.0 → 4.71.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/PROVIDERS.md +190 -0
- package/dist/.build-stamp.json +3 -3
- package/dist/_internal/client/features/lottery/LotteryAdminSlotView.js +2 -1
- package/dist/_internal/server/features/checkout/actions.js +43 -8
- package/dist/_internal/server/features/orders/actions.js +2 -1
- package/dist/_internal/server/features/orders/adapters.js +18 -0
- package/dist/_internal/server/features/orders/balance.js +2 -1
- package/dist/_internal/server/features/orders/cancellation-refund.d.ts +0 -89
- package/dist/_internal/server/features/orders/cancellation-refund.js +3 -2
- package/dist/_internal/server/features/payouts/actions.js +2 -1
- package/dist/_internal/server/features/points/award.js +3 -2
- package/dist/_internal/server/features/protection-claims/actions.js +2 -1
- package/dist/_internal/server/features/refunds/actions.js +3 -2
- package/dist/_internal/server/features/shipping/courier-block.js +5 -2
- package/dist/_internal/server/features/shipping/reconcile.js +3 -2
- package/dist/_internal/server/features/shipping/reimbursement.js +3 -2
- package/dist/_internal/server/features/stores/adapters.d.ts +1 -1
- package/dist/_internal/server/features/stores/adapters.js +12 -2
- package/dist/_internal/server/jobs/core/dailyStatusDigest.js +7 -3
- package/dist/_internal/server/jobs/core/emiInstallmentReminder.js +2 -1
- package/dist/_internal/server/jobs/core/obligationSweep.js +5 -4
- package/dist/_internal/server/jobs/core/onScamReportCreate.js +2 -1
- package/dist/_internal/server/jobs/core/paymentReconcile.js +5 -4
- package/dist/_internal/shared/checkout/rules/auction.rule.js +25 -7
- package/dist/_internal/shared/checkout/rules/prize-draw.rule.js +26 -8
- package/dist/_internal/shared/config/schema.d.ts +15 -0
- package/dist/_internal/shared/content/published-values.d.ts +2 -2
- package/dist/_internal/shared/content/published-values.js +31 -12
- package/dist/_internal/shared/features/auctions/errors.js +2 -1
- package/dist/_internal/shared/features/orders/refund-copy.js +3 -2
- package/dist/_internal/shared/features/promotions/errors.js +2 -1
- package/dist/constants/field-names.d.ts +23 -0
- package/dist/constants/field-names.js +23 -0
- package/dist/constants/storage-keys.d.ts +90 -0
- package/dist/constants/storage-keys.js +119 -0
- package/dist/contracts/index.d.ts +1 -1
- package/dist/contracts/payment.d.ts +42 -0
- package/dist/contracts/registry.d.ts +8 -0
- package/dist/contracts/tax.d.ts +118 -0
- package/dist/contracts/tax.js +3 -0
- package/dist/core/brand-resolver.d.ts +92 -0
- package/dist/core/brand-resolver.js +120 -0
- package/dist/core/brand-text.d.ts +15 -0
- package/dist/core/brand-text.js +73 -0
- package/dist/core/hooks/useNewsletterSubscribe.d.ts +30 -0
- package/dist/core/hooks/useNewsletterSubscribe.js +121 -0
- package/dist/features/about/components/DeveloperView.js +2 -1
- package/dist/features/account/components/BuyerAccountGuideView.js +2 -1
- package/dist/features/account/components/BuyerAuctionsGuideView.js +4 -3
- package/dist/features/account/components/BuyerOrdersGuideView.js +6 -5
- package/dist/features/account/components/BuyerShoppingGuideView.js +3 -2
- package/dist/features/account/components/UserOffersPanel.js +2 -1
- package/dist/features/account/hooks/useCollapsedSections.js +5 -3
- package/dist/features/account/schemas/index.js +1 -1
- package/dist/features/admin/actions/notification-actions.js +9 -2
- package/dist/features/admin/components/AdminAnalyticsGuideView.js +2 -1
- package/dist/features/admin/components/AdminBundlesView.js +2 -1
- package/dist/features/admin/components/AdminCatalogGuideView.js +2 -1
- package/dist/features/admin/components/AdminContentGuideView.js +2 -1
- package/dist/features/admin/components/AdminFaqEditorView.js +2 -1
- package/dist/features/admin/components/AdminGatewayEventsView.js +2 -1
- package/dist/features/admin/components/AdminGuideHubView.js +2 -1
- package/dist/features/admin/components/AdminMoneyCasesView.js +2 -1
- package/dist/features/admin/components/AdminOrdersGuideView.js +2 -1
- package/dist/features/admin/components/AdminProductsView.js +3 -2
- package/dist/features/admin/components/AdminSectionsView.js +3 -2
- package/dist/features/admin/components/AdminSiteSettingsView.js +8 -7
- package/dist/features/admin/components/AdminStoresGuideView.js +2 -1
- package/dist/features/admin/components/AdminSupportTicketDetailView.js +2 -1
- package/dist/features/admin/components/AdminTeamGuideView.js +2 -1
- package/dist/features/admin/components/AdminTrustGuideView.js +3 -2
- package/dist/features/admin/components/AdminUsersGuideView.js +2 -1
- package/dist/features/admin/components/sections/adminSectionsTypes.js +1 -1
- package/dist/features/auth/actions/user-slug.js +21 -2
- package/dist/features/auth/hooks/useAuth.js +11 -4
- package/dist/features/cart/utils/pending-ops.js +16 -3
- package/dist/features/catalogue/utils/product-from-item.d.ts +18 -2
- package/dist/features/catalogue/utils/product-from-item.js +23 -4
- package/dist/features/categories/components/BundleItemsPicker.js +2 -1
- package/dist/features/categories/components/CategoryDetailPageView.js +2 -1
- package/dist/features/categories/components/ContextualTrail.d.ts +9 -2
- package/dist/features/categories/components/ContextualTrail.js +11 -3
- package/dist/features/categories/components/LastCategoryBeacon.js +2 -2
- package/dist/features/checkout/actions/checkout-value-otp-actions.js +9 -1
- package/dist/features/contact/email.js +11 -12
- package/dist/features/email/notification-templates.js +4 -5
- package/dist/features/email/render-static-markup.d.ts +34 -0
- package/dist/features/email/render-static-markup.js +4 -0
- package/dist/features/events/utils/event-charts.js +2 -1
- package/dist/features/homepage/components/AnnouncementBar.js +5 -3
- package/dist/features/homepage/components/WelcomeSection.d.ts +3 -1
- package/dist/features/homepage/components/WelcomeSection.js +2 -2
- package/dist/features/homepage/lib/section-renderer.d.ts +8 -0
- package/dist/features/homepage/lib/section-renderer.js +1 -1
- package/dist/features/layout/AppLayoutShell.d.ts +3 -1
- package/dist/features/layout/AppLayoutShell.js +2 -2
- package/dist/features/layout/TitleBarLayout.d.ts +8 -1
- package/dist/features/layout/TitleBarLayout.js +2 -2
- package/dist/features/media/MediaVideo.js +2 -1
- package/dist/features/orders/actions/refund-actions.js +3 -2
- package/dist/features/orders/components/RefundRequestView.js +15 -2
- package/dist/features/orders/repository/orders.repository.js +2 -1
- package/dist/features/orders/types/index.d.ts +14 -0
- package/dist/features/orders/utils/payment-proof-message.js +5 -2
- package/dist/features/price-index/components/PriceIndexToolView.js +6 -5
- package/dist/features/pricing/components/AdminPricingView.js +2 -1
- package/dist/features/print/components/labels.js +2 -1
- package/dist/features/products/components/CityCollectiblesView.js +2 -1
- package/dist/features/products/components/MakeOfferButton.js +2 -1
- package/dist/features/products/components/PrizeDrawCollage.js +3 -2
- package/dist/features/products/components/PrizeRevealModal.js +2 -1
- package/dist/features/products/repository/products.repository.js +2 -1
- package/dist/features/promotions/components/CouponCard.js +3 -2
- package/dist/features/promotions/components/CouponHelpDetails.js +2 -1
- package/dist/features/promotions/constants/coupon-help.d.ts +1 -1
- package/dist/features/promotions/constants/coupon-help.js +8 -1
- package/dist/features/scams/components/ScamAwarenessModal.js +2 -1
- package/dist/features/scams/components/ScamProfileView.js +5 -3
- package/dist/features/scams/components/ScamRegistryView.js +2 -1
- package/dist/features/scams/constants/scam-types.d.ts +13 -1
- package/dist/features/scams/constants/scam-types.js +67 -23
- package/dist/features/scams/schemas/firestore.js +1 -1
- package/dist/features/search/components/Search.js +5 -1
- package/dist/features/seller/actions/offer-actions.js +47 -9
- package/dist/features/seller/components/DispatchForm.js +3 -2
- package/dist/features/seller/components/PrintCenterView.js +4 -2
- package/dist/features/seller/components/SellerBundlesView.js +2 -1
- package/dist/features/seller/components/SellerPayoutSettingsView.js +3 -2
- package/dist/features/seller/components/SellerProductShell.js +3 -2
- package/dist/features/seller/components/SellerProductsView.js +4 -3
- package/dist/features/store-extensions/repository/store-extensions.repositories.d.ts +30 -4
- package/dist/features/store-extensions/repository/store-extensions.repositories.js +46 -7
- package/dist/features/store-extensions/schemas/firestore.d.ts +22 -3
- package/dist/features/store-extensions/schemas/firestore.js +20 -0
- package/dist/features/stores/components/StoreCapabilitiesGuideView.js +7 -6
- package/dist/features/stores/components/StoreFinanceGuideView.js +6 -5
- package/dist/features/stores/components/StoreGuideHubView.js +2 -1
- package/dist/features/stores/components/StoreListingsGuideView.js +2 -1
- package/dist/features/stores/components/StoreOrdersGuideView.js +5 -4
- package/dist/features/stores/components/StoreSettingsGuideView.js +2 -1
- package/dist/features/support/schemas/index.d.ts +2 -2
- package/dist/features/whatsapp-bot/components/SellerWhatsAppSettingsView.d.ts +1 -1
- package/dist/features/whatsapp-bot/components/SellerWhatsAppSettingsView.js +3 -2
- package/dist/features/whatsapp-bot/helpers/whatsapp.js +5 -2
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -2
- package/dist/providers/payment-manual/index.d.ts +11 -0
- package/dist/providers/payment-manual/index.js +13 -0
- package/dist/providers/payment-phonepe/index.d.ts +23 -7
- package/dist/providers/payment-phonepe/index.js +15 -0
- package/dist/providers/payment-razorpay/index.d.ts +13 -0
- package/dist/providers/payment-razorpay/index.js +21 -1
- package/dist/providers/tax-india-gst/index.d.ts +45 -0
- package/dist/providers/tax-india-gst/index.js +78 -0
- package/dist/react/hooks/useScrollToTop.d.ts +5 -0
- package/dist/react/hooks/useScrollToTop.js +70 -0
- package/dist/schemas/registry.d.ts +2 -2
- package/dist/seo/json-ld.js +25 -4
- package/dist/ui/components/SiteLogo.d.ts +20 -2
- package/dist/ui/components/SiteLogo.js +28 -6
- package/dist/ui/components/SiteMark.d.ts +1 -1
- package/dist/ui/components/SiteMark.js +21 -6
- package/dist/utils/date.formatter.d.ts +20 -0
- package/dist/utils/date.formatter.js +25 -0
- package/dist/utils/number.formatter.d.ts +47 -0
- package/dist/utils/number.formatter.js +79 -1
- package/dist/validation/phone.validator.d.ts +0 -1
- package/dist/validation/phone.validator.js +17 -3
- package/package.json +17 -3
|
@@ -192,3 +192,28 @@ export function formatCustomDate(date, format = "medium") {
|
|
|
192
192
|
const options = formatOptions[format] || formatOptions.medium;
|
|
193
193
|
return dateObj.toLocaleDateString(getDefaultLocale(), options);
|
|
194
194
|
}
|
|
195
|
+
/**
|
|
196
|
+
* Render a `YYYY-MM` period as "October 2026".
|
|
197
|
+
*
|
|
198
|
+
* Lifted from the consumer's `src/lib/format/inr.ts` (A7), where five
|
|
199
|
+
* ad-booking surfaces shared it.
|
|
200
|
+
*
|
|
201
|
+
* 🛑 `timeZone: "UTC"` is load-bearing and is NOT a default worth overriding.
|
|
202
|
+
* The period is a calendar month with no time in it, so constructing it as UTC
|
|
203
|
+
* midnight and formatting in the viewer's zone renders the PREVIOUS month for
|
|
204
|
+
* anyone west of UTC. India is UTC+5:30, so the bug is invisible to everyone
|
|
205
|
+
* testing it there — which is why the original carried this same note.
|
|
206
|
+
*
|
|
207
|
+
* 🛑 The locale was a hardcoded `"en-IN"` in the consumer copy. It now comes
|
|
208
|
+
* from the market profile, which is the one thing about that helper that was
|
|
209
|
+
* genuinely consumer-specific.
|
|
210
|
+
*
|
|
211
|
+
* Returns the input unchanged when it is not a parseable `YYYY-MM`, rather than
|
|
212
|
+
* rendering "Invalid Date" into a billing table.
|
|
213
|
+
*/
|
|
214
|
+
export function formatMonthLabel(period, locale) {
|
|
215
|
+
const [y, m] = period.split("-").map(Number);
|
|
216
|
+
if (!Number.isFinite(y) || !Number.isFinite(m) || m < 1 || m > 12)
|
|
217
|
+
return period;
|
|
218
|
+
return new Date(Date.UTC(y, m - 1, 1)).toLocaleDateString(locale ?? getDefaultLocale(), { month: "long", year: "numeric", timeZone: "UTC" });
|
|
219
|
+
}
|
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Number Formatting Utilities
|
|
3
3
|
*/
|
|
4
|
+
/**
|
|
5
|
+
* Money for PROSE — notification bodies, error messages, log lines, chips.
|
|
6
|
+
*
|
|
7
|
+
* ## Why this exists beside `formatCurrency`
|
|
8
|
+
*
|
|
9
|
+
* 71 call sites interpolated a hardcoded symbol next to a bare number —
|
|
10
|
+
* `` `Minimum offer is ₹${bounds.min}` `` — which is wrong three ways at once:
|
|
11
|
+
* the symbol is baked in, the grouping is absent (`₹1000`, not `₹1,000`), and
|
|
12
|
+
* ~20 more files reached for `toLocaleString("en-IN")` with the locale
|
|
13
|
+
* hardcoded too. All three read from the market profile now, which the consumer
|
|
14
|
+
* already configures via `configureMarketDefaults()`.
|
|
15
|
+
*
|
|
16
|
+
* ## 🛑 Why not just use `formatCurrency`
|
|
17
|
+
*
|
|
18
|
+
* `Intl.NumberFormat` with `style: "currency"` forces the currency's standard
|
|
19
|
+
* fraction digits, so every whole amount becomes `₹1,000.00`. Rewriting 71
|
|
20
|
+
* strings to add `.00` to prices, offers and refunds that are whole amounts is
|
|
21
|
+
* a user-visible copy change dressed up as a refactor. This shows the
|
|
22
|
+
* fractional part only when there is one: `₹1,000` and `₹1,000.50`.
|
|
23
|
+
*
|
|
24
|
+
* `formatCurrency` keeps its job — the ISO-correct, locale-placed rendering for
|
|
25
|
+
* tabular and formal surfaces (invoices, statements). Use that where the form
|
|
26
|
+
* matters and this where the sentence does.
|
|
27
|
+
*/
|
|
28
|
+
export declare function formatMoney(amount: number, locale?: string): string;
|
|
4
29
|
export declare function formatCurrency(amount: number, currency?: string, locale?: string): string;
|
|
5
30
|
export declare function formatNumber(num: number, locale?: string, options?: {
|
|
6
31
|
decimals?: number;
|
|
@@ -13,3 +38,25 @@ export declare function formatCompactNumber(num: number): string;
|
|
|
13
38
|
export declare function formatDecimal(num: number, decimals?: number): string;
|
|
14
39
|
export declare function formatOrdinal(num: number): string;
|
|
15
40
|
export declare function parseFormattedNumber(str: string): number;
|
|
41
|
+
/**
|
|
42
|
+
* Whole currency units — no fractional digits — with locale grouping.
|
|
43
|
+
*
|
|
44
|
+
* `₹1,500` for 1499.50. Lifted from the consumer's `src/lib/format/inr.ts`
|
|
45
|
+
* (A5b/A7), where six `/user/*` and ad-booking pages had carried byte-identical
|
|
46
|
+
* private copies before it was consolidated there.
|
|
47
|
+
*
|
|
48
|
+
* ## 🛑 This is NOT `formatMoney`, and must not be collapsed into it
|
|
49
|
+
*
|
|
50
|
+
* `maximumFractionDigits: 0` is the whole point: this ROUNDS, so 1499.50
|
|
51
|
+
* renders `₹1,500`. `formatMoney` keeps the fractional part when there is one.
|
|
52
|
+
* Both are
|
|
53
|
+
* correct for their own surfaces — this one is for figures where the fraction
|
|
54
|
+
* is noise (a monthly ad spend, an order total in a summary row), and the
|
|
55
|
+
* surfaces using it show booking and order totals, so a change in rounding is
|
|
56
|
+
* a change in a number a buyer reads.
|
|
57
|
+
*
|
|
58
|
+
* Converging the two is a product decision about displayed money, not a
|
|
59
|
+
* de-duplication. The consumer's copy carried that warning for exactly this
|
|
60
|
+
* reason and it travels with the function.
|
|
61
|
+
*/
|
|
62
|
+
export declare function formatWholeMoney(amount: number, locale?: string): string;
|
|
@@ -1,7 +1,57 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Number Formatting Utilities
|
|
3
3
|
*/
|
|
4
|
-
import { getDefaultCurrency, getDefaultLocale, } from "../core/baseline-resolver.js";
|
|
4
|
+
import { getDefaultCurrency, getDefaultCurrencySymbol, getDefaultLocale, } from "../core/baseline-resolver.js";
|
|
5
|
+
/**
|
|
6
|
+
* Money for PROSE — notification bodies, error messages, log lines, chips.
|
|
7
|
+
*
|
|
8
|
+
* ## Why this exists beside `formatCurrency`
|
|
9
|
+
*
|
|
10
|
+
* 71 call sites interpolated a hardcoded symbol next to a bare number —
|
|
11
|
+
* `` `Minimum offer is ₹${bounds.min}` `` — which is wrong three ways at once:
|
|
12
|
+
* the symbol is baked in, the grouping is absent (`₹1000`, not `₹1,000`), and
|
|
13
|
+
* ~20 more files reached for `toLocaleString("en-IN")` with the locale
|
|
14
|
+
* hardcoded too. All three read from the market profile now, which the consumer
|
|
15
|
+
* already configures via `configureMarketDefaults()`.
|
|
16
|
+
*
|
|
17
|
+
* ## 🛑 Why not just use `formatCurrency`
|
|
18
|
+
*
|
|
19
|
+
* `Intl.NumberFormat` with `style: "currency"` forces the currency's standard
|
|
20
|
+
* fraction digits, so every whole amount becomes `₹1,000.00`. Rewriting 71
|
|
21
|
+
* strings to add `.00` to prices, offers and refunds that are whole amounts is
|
|
22
|
+
* a user-visible copy change dressed up as a refactor. This shows the
|
|
23
|
+
* fractional part only when there is one: `₹1,000` and `₹1,000.50`.
|
|
24
|
+
*
|
|
25
|
+
* `formatCurrency` keeps its job — the ISO-correct, locale-placed rendering for
|
|
26
|
+
* tabular and formal surfaces (invoices, statements). Use that where the form
|
|
27
|
+
* matters and this where the sentence does.
|
|
28
|
+
*/
|
|
29
|
+
export function formatMoney(amount, locale) {
|
|
30
|
+
const resolvedLocale = locale ?? getDefaultLocale();
|
|
31
|
+
/*
|
|
32
|
+
* 🛑 0 decimals if integral, otherwise exactly 2 — NOT `min: 0, max: 2`.
|
|
33
|
+
*
|
|
34
|
+
* That first draft was wrong and `published-values.ts` caught it: with a
|
|
35
|
+
* floor of 0, `1499.5` renders "₹1,499.5", a money figure with one decimal
|
|
36
|
+
* place. The rule money actually wants is "no trailing .00 on a whole
|
|
37
|
+
* amount, but always both places when there is a fractional part" — exactly
|
|
38
|
+
* what the `formatRupees` this replaced encoded as
|
|
39
|
+
* `minimumFractionDigits: Number.isInteger(amount) ? 0 : 2`, and what its own
|
|
40
|
+
* docstring stated as `₹10`, `₹1,499.50`.
|
|
41
|
+
*/
|
|
42
|
+
const fractionDigits = Number.isInteger(amount) ? 0 : 2;
|
|
43
|
+
const grouped = new Intl.NumberFormat(resolvedLocale, {
|
|
44
|
+
minimumFractionDigits: fractionDigits,
|
|
45
|
+
maximumFractionDigits: fractionDigits,
|
|
46
|
+
}).format(amount);
|
|
47
|
+
/*
|
|
48
|
+
* Symbol then number, not `Intl`'s currency placement. These strings are
|
|
49
|
+
* assembled into sentences that already read "₹500" in copy the team wrote,
|
|
50
|
+
* and a locale whose convention is "1 000,00 ₹" would reorder mid-sentence.
|
|
51
|
+
* A market that needs the symbol elsewhere overrides `currencySymbol`.
|
|
52
|
+
*/
|
|
53
|
+
return `${getDefaultCurrencySymbol()}${grouped}`;
|
|
54
|
+
}
|
|
5
55
|
export function formatCurrency(amount, currency, locale) {
|
|
6
56
|
const resolvedCurrency = currency ?? getDefaultCurrency();
|
|
7
57
|
const resolvedLocale = locale ?? getDefaultLocale();
|
|
@@ -107,3 +157,31 @@ export function parseFormattedNumber(str) {
|
|
|
107
157
|
const num = parseFloat(result);
|
|
108
158
|
return isNegative ? -Math.abs(num) : num;
|
|
109
159
|
}
|
|
160
|
+
/**
|
|
161
|
+
* Whole currency units — no fractional digits — with locale grouping.
|
|
162
|
+
*
|
|
163
|
+
* `₹1,500` for 1499.50. Lifted from the consumer's `src/lib/format/inr.ts`
|
|
164
|
+
* (A5b/A7), where six `/user/*` and ad-booking pages had carried byte-identical
|
|
165
|
+
* private copies before it was consolidated there.
|
|
166
|
+
*
|
|
167
|
+
* ## 🛑 This is NOT `formatMoney`, and must not be collapsed into it
|
|
168
|
+
*
|
|
169
|
+
* `maximumFractionDigits: 0` is the whole point: this ROUNDS, so 1499.50
|
|
170
|
+
* renders `₹1,500`. `formatMoney` keeps the fractional part when there is one.
|
|
171
|
+
* Both are
|
|
172
|
+
* correct for their own surfaces — this one is for figures where the fraction
|
|
173
|
+
* is noise (a monthly ad spend, an order total in a summary row), and the
|
|
174
|
+
* surfaces using it show booking and order totals, so a change in rounding is
|
|
175
|
+
* a change in a number a buyer reads.
|
|
176
|
+
*
|
|
177
|
+
* Converging the two is a product decision about displayed money, not a
|
|
178
|
+
* de-duplication. The consumer's copy carried that warning for exactly this
|
|
179
|
+
* reason and it travels with the function.
|
|
180
|
+
*/
|
|
181
|
+
export function formatWholeMoney(amount, locale) {
|
|
182
|
+
return new Intl.NumberFormat(locale ?? getDefaultLocale(), {
|
|
183
|
+
style: "currency",
|
|
184
|
+
currency: getDefaultCurrency(),
|
|
185
|
+
maximumFractionDigits: 0,
|
|
186
|
+
}).format(amount);
|
|
187
|
+
}
|
|
@@ -6,4 +6,3 @@ export declare function normalizePhone(phone: string): string;
|
|
|
6
6
|
export declare function formatPhone(phone: string, countryCode?: string): string;
|
|
7
7
|
export declare function extractCountryCode(phone: string): string | null;
|
|
8
8
|
export declare function isValidMobile(phone: string, phonePrefix?: string): boolean;
|
|
9
|
-
export declare function isValidIndianPincode(pincode: string): boolean;
|
|
@@ -36,6 +36,20 @@ export function isValidMobile(phone, phonePrefix) {
|
|
|
36
36
|
// Generic: 10-15 digit number
|
|
37
37
|
return cleaned.length >= 10 && cleaned.length <= 15;
|
|
38
38
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
/*
|
|
40
|
+
* 🛑 `isValidIndianPincode` was REMOVED in A6c. It hardcoded `/^\d{6}$/` — one
|
|
41
|
+
* country's postcode shape in a library meant to be jurisdiction-neutral — and
|
|
42
|
+
* had **zero callers**: the only reference anywhere was its own re-export from
|
|
43
|
+
* `index.ts`, so it was dead code on appkit's public surface.
|
|
44
|
+
*
|
|
45
|
+
* `constants/geo/countries.ts` is the live answer and a better one: 26 countries
|
|
46
|
+
* as DATA (`postalPattern`, `postalLabel`, `hasStates`, `dialCode`) behind
|
|
47
|
+
* `isValidPostalCode` / `postalPatternFor` / `postalLabelFor`, with 17 reader
|
|
48
|
+
* files. Its own header records the bug this function's shape causes —
|
|
49
|
+
* "a Canadian address was being held to `/^\d{6}$/`".
|
|
50
|
+
*
|
|
51
|
+
* That table is also why A6's proposed `IAddressValidationProvider` was not
|
|
52
|
+
* built: the AK2 row describing appkit as doing "pincode-only India validation"
|
|
53
|
+
* predates `countries.ts` and is stale. Postcode rules are a 26-row table, not
|
|
54
|
+
* 26 provider implementations.
|
|
55
|
+
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mohasinac/appkit",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.71.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -67,7 +67,12 @@
|
|
|
67
67
|
"types": "./dist/contracts/registry.d.ts",
|
|
68
68
|
"import": "./dist/contracts/registry.js"
|
|
69
69
|
},
|
|
70
|
-
"./
|
|
70
|
+
"./cli": {
|
|
71
|
+
"types": "./dist/cli/index.d.ts",
|
|
72
|
+
"import": "./dist/cli/index.js",
|
|
73
|
+
"require": "./dist/cli/index.js"
|
|
74
|
+
},
|
|
75
|
+
"./core/baseline-resolver": {
|
|
71
76
|
"types": "./dist/core/baseline-resolver.d.ts",
|
|
72
77
|
"import": "./dist/core/baseline-resolver.js"
|
|
73
78
|
},
|
|
@@ -83,7 +88,15 @@
|
|
|
83
88
|
"types": "./dist/providers/email-resend/index.d.ts",
|
|
84
89
|
"import": "./dist/providers/email-resend/index.js"
|
|
85
90
|
},
|
|
86
|
-
"./providers/
|
|
91
|
+
"./providers/tax-india-gst": {
|
|
92
|
+
"types": "./dist/providers/tax-india-gst/index.d.ts",
|
|
93
|
+
"import": "./dist/providers/tax-india-gst/index.js"
|
|
94
|
+
},
|
|
95
|
+
"./providers/shipping-shiprocket": {
|
|
96
|
+
"types": "./dist/providers/shipping-shiprocket/index.d.ts",
|
|
97
|
+
"import": "./dist/providers/shipping-shiprocket/index.js"
|
|
98
|
+
},
|
|
99
|
+
"./providers/storage-firebase": {
|
|
87
100
|
"types": "./dist/providers/storage-firebase/index.d.ts",
|
|
88
101
|
"import": "./dist/providers/storage-firebase/index.js"
|
|
89
102
|
},
|
|
@@ -317,6 +330,7 @@
|
|
|
317
330
|
},
|
|
318
331
|
"files": [
|
|
319
332
|
"dist",
|
|
333
|
+
"PROVIDERS.md",
|
|
320
334
|
"tsconfig.base.json",
|
|
321
335
|
"scripts/sieve-audit.mjs",
|
|
322
336
|
"scripts/audit-violations.mjs",
|