@cedros/pay-react 0.1.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/LICENSE +21 -0
- package/README.md +1731 -0
- package/dist/CedrosContext-B3iCqN6e.js +11 -0
- package/dist/CedrosContext-vX9uqZKp.mjs +1796 -0
- package/dist/ar-LVoQZTFI.js +1 -0
- package/dist/ar-w27mU-4x.mjs +19 -0
- package/dist/bn-BR5Cv1T4.js +1 -0
- package/dist/bn-Ba_k3Kex.mjs +19 -0
- package/dist/components/CedrosPay.d.ts +54 -0
- package/dist/components/CedrosPay.d.ts.map +1 -0
- package/dist/components/CryptoButton.d.ts +26 -0
- package/dist/components/CryptoButton.d.ts.map +1 -0
- package/dist/components/PaymentModal.d.ts +28 -0
- package/dist/components/PaymentModal.d.ts.map +1 -0
- package/dist/components/ProductPrice.d.ts +56 -0
- package/dist/components/ProductPrice.d.ts.map +1 -0
- package/dist/components/PurchaseButton.d.ts +52 -0
- package/dist/components/PurchaseButton.d.ts.map +1 -0
- package/dist/components/StripeButton.d.ts +27 -0
- package/dist/components/StripeButton.d.ts.map +1 -0
- package/dist/context/CedrosContext.d.ts +46 -0
- package/dist/context/CedrosContext.d.ts.map +1 -0
- package/dist/context/ThemeContext.d.ts +30 -0
- package/dist/context/ThemeContext.d.ts.map +1 -0
- package/dist/context/index.d.ts +3 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/crypto-only.d.ts +33 -0
- package/dist/crypto-only.d.ts.map +1 -0
- package/dist/crypto-only.js +1 -0
- package/dist/crypto-only.mjs +35 -0
- package/dist/de-CoZiPFN7.mjs +19 -0
- package/dist/de-pQxy-oD1.js +1 -0
- package/dist/en-CSsJl3nf.mjs +19 -0
- package/dist/en-D-uY3ltT.js +1 -0
- package/dist/es-BWGIBp2f.mjs +19 -0
- package/dist/es-D24cg8dD.js +1 -0
- package/dist/fil-BOBft9G-.js +1 -0
- package/dist/fil-Czo27xmj.mjs +19 -0
- package/dist/fr-Ct9ub8Fa.js +1 -0
- package/dist/fr-DQ-2ThBv.mjs +19 -0
- package/dist/he-DpV1WnBQ.mjs +19 -0
- package/dist/he-DtQqRKRq.js +1 -0
- package/dist/hooks/usePaymentMode.d.ts +39 -0
- package/dist/hooks/usePaymentMode.d.ts.map +1 -0
- package/dist/hooks/useRefundVerification.d.ts +30 -0
- package/dist/hooks/useRefundVerification.d.ts.map +1 -0
- package/dist/hooks/useStripeCheckout.d.ts +20 -0
- package/dist/hooks/useStripeCheckout.d.ts.map +1 -0
- package/dist/hooks/useX402Payment.d.ts +24 -0
- package/dist/hooks/useX402Payment.d.ts.map +1 -0
- package/dist/i18n/index.d.ts +107 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/useTranslation.d.ts +55 -0
- package/dist/i18n/useTranslation.d.ts.map +1 -0
- package/dist/id-BJMqsu19.mjs +19 -0
- package/dist/id-CiM2mL7C.js +1 -0
- package/dist/in-BxgxKLQH.mjs +19 -0
- package/dist/in-Bzcjmxcc.js +1 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -0
- package/dist/index.mjs +626 -0
- package/dist/it-Blb_pIJl.js +1 -0
- package/dist/it-DZFFPALf.mjs +19 -0
- package/dist/jp-9NHyIuwY.js +1 -0
- package/dist/jp-ZExTrlHK.mjs +19 -0
- package/dist/kr-DHX3i4Ht.mjs +19 -0
- package/dist/kr-DvzJ-0yX.js +1 -0
- package/dist/managers/ManagerCache.d.ts +49 -0
- package/dist/managers/ManagerCache.d.ts.map +1 -0
- package/dist/managers/RouteDiscoveryManager.d.ts +72 -0
- package/dist/managers/RouteDiscoveryManager.d.ts.map +1 -0
- package/dist/managers/StripeManager.d.ts +110 -0
- package/dist/managers/StripeManager.d.ts.map +1 -0
- package/dist/managers/WalletManager.d.ts +150 -0
- package/dist/managers/WalletManager.d.ts.map +1 -0
- package/dist/managers/X402Manager.d.ts +176 -0
- package/dist/managers/X402Manager.d.ts.map +1 -0
- package/dist/ms-BOAu5pUB.js +1 -0
- package/dist/ms-Cv1fdIi2.mjs +19 -0
- package/dist/nl-BmGonsKb.mjs +19 -0
- package/dist/nl-WHh_DfO8.js +1 -0
- package/dist/pa-B7kIhZCF.js +1 -0
- package/dist/pa-BfwcJIar.mjs +19 -0
- package/dist/pay-react.css +1 -0
- package/dist/pl-DE5IB9xv.mjs +19 -0
- package/dist/pl-H0hBKdvF.js +1 -0
- package/dist/pt-CLzkqDzf.mjs +19 -0
- package/dist/pt-DwGrViQ3.js +1 -0
- package/dist/ru-CB2m0UDT.js +1 -0
- package/dist/ru-DM6-oUR0.mjs +19 -0
- package/dist/stripe-only.d.ts +31 -0
- package/dist/stripe-only.d.ts.map +1 -0
- package/dist/stripe-only.js +1 -0
- package/dist/stripe-only.mjs +33 -0
- package/dist/styles-D3XGpsqb.js +1 -0
- package/dist/styles-zgmHs6Hs.mjs +1601 -0
- package/dist/ta-A5HnrGb5.mjs +19 -0
- package/dist/ta-CAS197uN.js +1 -0
- package/dist/telemetry.d.ts +27 -0
- package/dist/telemetry.d.ts.map +1 -0
- package/dist/telemetry.js +1 -0
- package/dist/telemetry.mjs +127 -0
- package/dist/testing/__tests__/providers.test.d.ts +10 -0
- package/dist/testing/__tests__/providers.test.d.ts.map +1 -0
- package/dist/testing/helpers.d.ts +242 -0
- package/dist/testing/helpers.d.ts.map +1 -0
- package/dist/testing/index.d.ts +12 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +1 -0
- package/dist/testing/index.mjs +374 -0
- package/dist/testing/mocks.d.ts +225 -0
- package/dist/testing/mocks.d.ts.map +1 -0
- package/dist/testing/providers.d.ts +89 -0
- package/dist/testing/providers.d.ts.map +1 -0
- package/dist/th-3fbB3Ytp.mjs +19 -0
- package/dist/th-Cpz2cFcg.js +1 -0
- package/dist/tr-BrgfFFdq.mjs +19 -0
- package/dist/tr-hQrEFk86.js +1 -0
- package/dist/types/componentOptions.d.ts +138 -0
- package/dist/types/componentOptions.d.ts.map +1 -0
- package/dist/types/errors.d.ts +213 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/index.d.ts +248 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/uk-0hFun_g_.mjs +19 -0
- package/dist/uk-DrK2Sv8C.js +1 -0
- package/dist/ur-CaOjJXai.mjs +19 -0
- package/dist/ur-D5-7mN9a.js +1 -0
- package/dist/utils/__tests__/cspHelper.test.d.ts +9 -0
- package/dist/utils/__tests__/cspHelper.test.d.ts.map +1 -0
- package/dist/utils/__tests__/fetchWithTimeout.test.d.ts +11 -0
- package/dist/utils/__tests__/fetchWithTimeout.test.d.ts.map +1 -0
- package/dist/utils/cartHelpers.d.ts +105 -0
- package/dist/utils/cartHelpers.d.ts.map +1 -0
- package/dist/utils/circuitBreaker.d.ts +112 -0
- package/dist/utils/circuitBreaker.d.ts.map +1 -0
- package/dist/utils/couponHelpers.d.ts +50 -0
- package/dist/utils/couponHelpers.d.ts.map +1 -0
- package/dist/utils/cspHelper.d.ts +162 -0
- package/dist/utils/cspHelper.d.ts.map +1 -0
- package/dist/utils/deprecation.d.ts +128 -0
- package/dist/utils/deprecation.d.ts.map +1 -0
- package/dist/utils/errorHandling.d.ts +30 -0
- package/dist/utils/errorHandling.d.ts.map +1 -0
- package/dist/utils/errorMessages.d.ts +47 -0
- package/dist/utils/errorMessages.d.ts.map +1 -0
- package/dist/utils/errorParser.d.ts +37 -0
- package/dist/utils/errorParser.d.ts.map +1 -0
- package/dist/utils/eventEmitter.d.ts +119 -0
- package/dist/utils/eventEmitter.d.ts.map +1 -0
- package/dist/utils/exponentialBackoff.d.ts +104 -0
- package/dist/utils/exponentialBackoff.d.ts.map +1 -0
- package/dist/utils/fetchWithTimeout.d.ts +13 -0
- package/dist/utils/fetchWithTimeout.d.ts.map +1 -0
- package/dist/utils/index.d.ts +15 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/logger.d.ts +76 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/modalStyles.d.ts +13 -0
- package/dist/utils/modalStyles.d.ts.map +1 -0
- package/dist/utils/rateLimiter.d.ts +88 -0
- package/dist/utils/rateLimiter.d.ts.map +1 -0
- package/dist/utils/requestDeduplication.d.ts +124 -0
- package/dist/utils/requestDeduplication.d.ts.map +1 -0
- package/dist/utils/securityValidation.d.ts +75 -0
- package/dist/utils/securityValidation.d.ts.map +1 -0
- package/dist/utils/solanaCheck.d.ts +10 -0
- package/dist/utils/solanaCheck.d.ts.map +1 -0
- package/dist/utils/telemetry.d.ts +277 -0
- package/dist/utils/telemetry.d.ts.map +1 -0
- package/dist/utils/tokenMintValidator.d.ts +77 -0
- package/dist/utils/tokenMintValidator.d.ts.map +1 -0
- package/dist/utils/uuid.d.ts +13 -0
- package/dist/utils/uuid.d.ts.map +1 -0
- package/dist/utils/validateConfig.d.ts +13 -0
- package/dist/utils/validateConfig.d.ts.map +1 -0
- package/dist/utils/walletDetection.d.ts +6 -0
- package/dist/utils/walletDetection.d.ts.map +1 -0
- package/dist/utils/walletPool.d.ts +57 -0
- package/dist/utils/walletPool.d.ts.map +1 -0
- package/dist/uuid-C0iMjdcc.js +1 -0
- package/dist/uuid-UlzrVY8Y.mjs +17 -0
- package/dist/vn-0nlIZFLP.mjs +19 -0
- package/dist/vn-B_iut9YL.js +1 -0
- package/dist/walletDetection-JZR3UCOa.mjs +27 -0
- package/dist/walletDetection-bNmV5ItZ.js +1 -0
- package/dist/zh-B4Endr1F.mjs +19 -0
- package/dist/zh-PR82dCHr.js +1 -0
- package/package.json +139 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const e = "CEDROS PAY - மொழிபெயர்ப்பு கோப்பு (தமிழ்)", a = "1.0.0", i = "ta", n = { pay_with_card: "கார்டு மூலம் செலுத்தவும்", pay_with_crypto: "USDC மூலம் செலுத்தவும்", pay_with_usdc: "USDC மூலம் செலுத்தவும்", purchase: "கொள்முதல்", card: "கார்டு", usdc_solana: "USDC (சோலானா)", crypto: "கிரிப்டோ", connect_wallet: "வாலெட்டை இணைக்கவும்", connecting: "இணைக்கிறது...", processing: "செயலாக்கம் நடைபெறுகிறது...", loading: "ஏற்றுகிறது...", close: "மூடு", cancel: "ரத்து செய்", confirm: "உறுதிப்படுத்தவும்", retry: "மீண்டும் முயற்சி செய்", go_back: "திரும்பிச் செல்லவும்", contact_support: "உதவியைத் தொடர்புகொள்ளவும்" }, o = { invalid_payment_proof: { message: "கட்டண சரிபார்ப்பு தோல்வியடைந்தது", action: "உங்கள் கட்டணத்தை மீண்டும் முயற்சிக்கவும். இது தொடர்ந்தால், உதவியை தொடர்புக்கொள்ளவும்." }, invalid_signature: { message: "பரிவர்த்தனை கையொப்பம் தவறானது", action: "உங்கள் வாலெட்டில் பரிவர்த்தனையை அங்கீகரித்து மீண்டும் முயற்சிக்கவும்." }, invalid_transaction: { message: "பரிவர்த்தனை வடிவம் தவறானது", action: "உங்கள் கட்டணத்தை மீண்டும் முயற்சிக்கவும். இது தொடர்ந்தால், உங்கள் வாலெட் செயலியைப் புதுப்பித்து முயற்சிக்கவும்." }, transaction_not_found: { message: "பரிவர்த்தனை பிளாக்செயினில் கிடைக்கவில்லை", action: "உங்கள் பரிவர்த்தனை இன்னும் செயலாக்கத்தில் இருக்கலாம். ஒரு நிமிடம் காத்திருந்து உங்கள் வாலெட்டில் சரிபார்க்கவும், அல்லது மீண்டும் முயற்சிக்கவும்." }, transaction_not_confirmed: { message: "பரிவர்த்தனை இன்னும் செயலாக்கத்தில் உள்ளது", action: "பிளாக்செயின் உங்கள் பரிவர்த்தனையை உறுதிப்படுத்த ஒரு நிமிடம் காத்திருந்து பின்னர் முயற்சிக்கவும்." }, transaction_failed: { message: "பரிவர்த்தனை பிளாக்செயினில் தோல்வியடைந்தது", action: "விவரங்களுக்கு உங்கள் வாலெட்டைச் சரிபார்க்கவும். பிணையக் கட்டணங்களுக்கு கூடுதல் SOL சேர்க்க அல்லது பரிவர்த்தனை அமைப்புகளை மாற்ற வேண்டியிருக்கும்." }, transaction_expired: { message: "பரிவர்த்தனை செயலாக்கத்திற்கு அதிக நேரம் எடுத்துக் கொண்டது", action: "உங்கள் கட்டணத்தை மீண்டும் முயற்சிக்கவும். உங்கள் வாலெட் ஆதரித்தால் பரிவர்த்தனை முன்னுரிமையை உயர்த்திப் பார்க்கவும்." }, invalid_recipient: { message: "கட்டணம் தவறான முகவரிக்கு அனுப்பப்பட்டுள்ளது", action: "மீண்டும் முயற்சிக்கவும் மற்றும் உங்கள் வாலெட்டில் சரியான பரிவர்த்தனையை அங்கீகரிக்க உறுதிசெய்யவும்." }, invalid_sender: { message: "கட்டண அனுப்புநர் வாலெட் தவறானது", action: "உங்கள் வாலெட்டை மீண்டும் இணைத்து முயற்சிக்கவும்." }, unauthorized_refund_issuer: { message: "பணம் திருப்பி அளிக்க நீங்கள் அனுமதிக்கப்பட்டவர் அல்ல", action: "அங்கீகரிக்கப்பட்ட கணக்குகள் மட்டுமே பணத்தை திருப்பி அளிக்க முடியும். இது தவறு என்று நினைத்தால், உதவியை தொடர்புக்கொள்ளவும்." }, amount_below_minimum: { message: "கட்டணத் தொகை மிகவும் குறைவு", action: "தேவையான தொகையைச் சரிபார்த்து மீண்டும் முயற்சிக்கவும்." }, amount_mismatch: { message: "கட்டணத் தொகை கூறிய விலையில் பொருந்தவில்லை", action: "விலை மாற்றியிருக்கலாம். புதுப்பித்து உங்கள் கட்டணத்தை மீண்டும் முயற்சிக்கவும்." }, insufficient_funds_sol: { message: "பரிவர்த்தனை கட்டணங்களுக்கு போதுமான SOL இல்லை", action: "பிணையக் கட்டணங்களைச் செலுத்த உங்கள் வாலெட்டில் குறைந்தது 0.001 SOL சேர்த்து, பின்னர் முயற்சிக்கவும்." }, insufficient_funds_token: { message: "உங்கள் வாலெட்டில் போதுமான இருப்பு இல்லை", action: "கூடுதல் நிதியைச் சேர்த்து மீண்டும் முயற்சிக்கவும்." }, invalid_token_mint: { message: "தவறான கட்டண டோக்கன்", action: "கட்டண விவரங்களில் காட்டப்பட்ட சரியான டோக்கனுடன் செலுத்தவும்." }, not_spl_transfer: { message: "பரிவர்த்தனை செல்லுபடியாகும் டோக்கன் பரிமாற்றம் அல்ல", action: "உங்கள் வாலெட்டிலிருந்து சரியான டோக்கன் வகையை அனுப்புகிறீர்கள் என்பதை உறுதிசெய்யவும்." }, missing_token_account: { message: "டோக்கன் கணக்கு கிடைக்கவில்லை", action: "முதலில் உங்கள் வாலெட் ஒரு டோக்கன் கணக்கை உருவாக்க வேண்டியிருக்கும். மீண்டும் முயற்சிக்கவோ அல்லது வேறு வாலெட்டை பயன்படுத்தவோ செய்யவும்." }, invalid_token_program: { message: "டோக்கன் நிரல் தவறானது", action: "உங்கள் கட்டணத்தை மீண்டும் முயற்சிக்கவும். இது தொடர்ந்தால், வேறு வாலெட்டை பயன்படுத்திப் பார்க்கவும்." }, missing_memo: { message: "கட்டண மெமோ தேவைப்படுகிறது ஆனால் சேர்க்கப்படவில்லை", action: "உங்கள் கட்டணத்தை மீண்டும் முயற்சித்து, வாலெட்டில் பரிவர்த்தனை விவரங்களை அங்கீகரிக்கவும்." }, invalid_memo: { message: "கட்டண மெமோவின் வடிவம் தவறானது", action: "உங்கள் கட்டணத்தை மீண்டும் முயற்சிக்கவும்." }, payment_already_used: { message: "இந்த கட்டணம் ஏற்கனவே செயலாக்கப்பட்டது", action: "உங்கள் பரிவர்த்தனை வரலாற்றைச் சரிபார்க்கவும். மற்றொரு கட்டணம் செய்ய வேண்டுமெனில் புதிய பரிவர்த்தனையை தொடங்கவும்." }, signature_reused: { message: "பரிவர்த்தனைக் கையொப்பம் ஏற்கனவே பயன்படுத்தப்பட்டுள்ளது", action: "புதிய கட்டண பரிவர்த்தனையை உருவாக்கவும்." }, quote_expired: { message: "விலை மேற்கோள் காலாவதியானது", action: "விலைகள் அடிக்கடி புதுப்பிக்கப்படுகின்றன. புதுப்பித்து உங்கள் கட்டணத்தை மீண்டும் முயற்சிக்கவும்." }, missing_field: { message: "தேவையான தகவல் காணப்படவில்லை", action: "அனைத்து தேவையான புலங்களையும் சரிபார்த்து மீண்டும் முயற்சிக்கவும்." }, invalid_field: { message: "சில தகவல்கள் தவறானவை", action: "உங்கள் உள்ளீட்டைப் பரிசீலித்து மீண்டும் முயற்சிக்கவும்." }, invalid_amount: { message: "கட்டண தொகை தவறானது", action: "தொகையைச் சரிபார்த்து மீண்டும் முயற்சிக்கவும்." }, invalid_wallet: { message: "வாலெட் முகவரி தவறானது", action: "உங்கள் வாலெட்டை மீண்டும் இணைத்து முயற்சிக்கவும்." }, invalid_resource: { message: "தவறான உருப்படி தேர்வு", action: "பக்கத்தை புதுப்பித்து மீண்டும் முயற்சிக்கவும்." }, invalid_coupon: { message: "தவறான கூப்பன் குறியீடு", action: "கூப்பன் குறியீட்டைச் சரிபார்த்து மீண்டும் முயற்சிக்கவும்." }, invalid_cart_item: { message: "ஒரு அல்லது அதற்கு மேற்பட்ட கார்ட் உருப்படிகள் தவறானவை", action: "உங்கள் கார்டை பரிசீலித்து மீண்டும் முயற்சிக்கவும்." }, empty_cart: { message: "உங்கள் கார்ட் காலியாக உள்ளது", action: "காசோலை செய்யும் முன் உருப்படிகளைச் சேர்க்கவும்." }, resource_not_found: { message: "உருப்படி கிடைக்கவில்லை", action: "இந்த உருப்படி இனி கிடைக்காமல் இருக்கலாம். புதுப்பித்து மீண்டும் முயற்சிக்கவும்." }, cart_not_found: { message: "ஷாப்பிங் கார்ட் கிடைக்கவில்லை", action: "உங்கள் கார்ட் காலாவதியாகியிருக்கலாம். புதிய ஆர்டரைத் தொடங்கவும்." }, refund_not_found: { message: "பணம் திருப்பிச் செலுத்துதல் கிடைக்கவில்லை", action: "உங்கள் திருப்பு குறிப்பு எண்ணைச் சரிபார்க்கவோ அல்லது உதவியைத் தொடர்புகொள்ளவோ செய்யவும்." }, product_not_found: { message: "தயாரிப்பு கிடைக்கவில்லை", action: "இந்த தயாரிப்பு இனி கிடைக்காமல் இருக்கலாம். எங்களின் தற்போதைய தெரிவுகளை உலாவவும்." }, coupon_not_found: { message: "கூப்பன் குறியீடு கிடைக்கவில்லை", action: "கூப்பன் குறியீட்டைச் சரிபார்க்கவோ அல்லது அதை நீக்கி தொடரவோ செய்யவும்." }, session_not_found: { message: "கட்டண அமர்வு காலாவதியானது", action: "புதிய கட்டணத்தைத் தொடங்கவும்." }, cart_already_paid: { message: "இந்த ஆர்டருக்கு ஏற்கனவே கட்டணம் செலுத்தப்பட்டுள்ளது", action: "உங்கள் ஆர்டர் வரலாற்றைச் சரிபார்க்கவும். மற்றொரு கொள்முதல் செய்ய வேண்டுமெனில் புதிய ஆர்டர் தொடங்கவும்." }, refund_already_processed: { message: "இந்த பணத்தைத் திருப்பிச் செலுத்துதல் ஏற்கனவே செயலாக்கப்பட்டுள்ளது", action: "உங்கள் பரிவர்த்தனை வரலாறைச் சரிபார்க்கவோ அல்லது விவரங்களுக்கு உதவியைத் தொடர்புகொள்ளவோ செய்யவும்." }, coupon_expired: { message: "கூப்பன் காலாவதியானது", action: "கூப்பன் குறியீட்டை அகற்றவோ அல்லது வேறொரு குறியீட்டை பயன்படுத்தவோ செய்யவும்." }, coupon_usage_limit_reached: { message: "கூப்பன் பயன்பாட்டு வரம்பு எட்டப்பட்டுள்ளது", action: "இந்த கூப்பன் முழுமையாக பயன்படுத்தப்பட்டுள்ளது. வேறு குறியீட்டை முயற்சிக்கவும்." }, coupon_not_applicable: { message: "இந்த கொள்முதலுக்கு கூப்பன் பயன்படுத்த முடியாது", action: "கூப்பன் நிபந்தனைகளைச் சரிபார்க்கவோ அல்லது அதை நீக்கி தொடரவோ செய்யவும்." }, coupon_wrong_payment_method: { message: "இந்த கட்டண முறைக்கு கூப்பன் செல்லாது", action: "வேறு கட்டண முறையை முயற்சிக்கவோ அல்லது கூப்பன் குறியீட்டை நீக்கவோ செய்யவும்." }, stripe_error: { message: "கார்டு கட்டண சேவை தற்காலிகமாக கிடைக்கவில்லை", action: "சிறிது நேரத்தில் மீண்டும் முயற்சிக்கவோ, அல்லது மாற்றாக கிரிப்டோகரன்சி கட்டணத்தைப் பயன்படுத்தவோ செய்யவும்." }, rpc_error: { message: "பிளாக்செயின் நெட்வொர்க் தற்காலிகமாக கிடைக்கவில்லை", action: "சிறிது நேரத்தில் மீண்டும் முயற்சிக்கவோ, அல்லது மாற்றாக கார்டு கட்டணத்தைப் பயன்படுத்தவோ செய்யவும்." }, network_error: { message: "நெட்வொர்க் இணைப்பு சிக்கல்", action: "உங்கள் இன்டர்நெட் இணைப்பைச் சரிபார்த்து மீண்டும் முயற்சிக்கவும்." }, internal_error: { message: "எங்களின் பக்கத்தில் ஏதோ தவறு ஏற்பட்டது", action: "மீண்டும் முயற்சிக்கவும். இது தொடர்ந்தால், உதவியைத் தொடர்புகொள்ளவும்." }, database_error: { message: "சேவை தற்காலிகமாக கிடைக்கவில்லை", action: "சிறிது நேரத்தில் மீண்டும் முயற்சிக்கவும்." }, config_error: { message: "சேவை கட்டமைப்பு பிழை", action: "உதவியைத் தொடர்புகொண்டு வழிகாட்டலைப் பெறவும்." }, unknown_error: { message: "எதிர்பாராத பிழை ஏற்பட்டது", action: "மீண்டும் முயற்சிக்கவோ அல்லது இது தொடர்ந்தால் உதவியைத் தொடர்புகொள்ளவோ செய்யவும்." } }, s = { unknown_token_mint: "எச்சரிக்கை: அறியப்படாத டோக்கன் மின்ட் முகவரி. நிதி இழப்பைத் தவிர்க்க இது சரியான டோக்கன் என்பதை இருமுறையும் சரிபார்க்கவும்.", token_typo_warning: "டோக்கன் முகவரி அறியப்பட்ட ஸ்டேபிள்காயின்களுடன் (USDC, USDT, PYUSD, CASH) பொருந்தவில்லை. நிரந்தர நிதி இழப்பைத் தவிர்க்க கவனமாக சரிபார்க்கவும்." }, t = { no_wallet_detected: "சோலானா வாலெட் கண்டறியப்படவில்லை", install_wallet: "Phantom, Solflare, Backpack போன்ற சோலானா வாலெட்டை நிறுவவும்.", wallet_not_connected: "வாலெட் இணைக்கப்படவில்லை", connect_your_wallet: "தொடர வாலெட்டை இணைக்கவும்.", wallet_connection_failed: "வாலெட்டை இணைக்க முடியவில்லை", try_again: "மீண்டும் இணைக்க முயற்சிக்கவும்.", transaction_rejected: "பரிவர்த்தனை நிராகரிக்கப்பட்டது", approve_in_wallet: "தொடர உங்கள் வாலெட்டில் பரிவர்த்தனையை அங்கீகரிக்கவும்." }, c = {
|
|
2
|
+
comment: e,
|
|
3
|
+
version: a,
|
|
4
|
+
locale: "ta",
|
|
5
|
+
ui: n,
|
|
6
|
+
errors: o,
|
|
7
|
+
validation: s,
|
|
8
|
+
wallet: t
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
e as comment,
|
|
12
|
+
c as default,
|
|
13
|
+
o as errors,
|
|
14
|
+
i as locale,
|
|
15
|
+
n as ui,
|
|
16
|
+
s as validation,
|
|
17
|
+
a as version,
|
|
18
|
+
t as wallet
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="CEDROS PAY - மொழிபெயர்ப்பு கோப்பு (தமிழ்)",a="1.0.0",n="ta",o={pay_with_card:"கார்டு மூலம் செலுத்தவும்",pay_with_crypto:"USDC மூலம் செலுத்தவும்",pay_with_usdc:"USDC மூலம் செலுத்தவும்",purchase:"கொள்முதல்",card:"கார்டு",usdc_solana:"USDC (சோலானா)",crypto:"கிரிப்டோ",connect_wallet:"வாலெட்டை இணைக்கவும்",connecting:"இணைக்கிறது...",processing:"செயலாக்கம் நடைபெறுகிறது...",loading:"ஏற்றுகிறது...",close:"மூடு",cancel:"ரத்து செய்",confirm:"உறுதிப்படுத்தவும்",retry:"மீண்டும் முயற்சி செய்",go_back:"திரும்பிச் செல்லவும்",contact_support:"உதவியைத் தொடர்புகொள்ளவும்"},t={invalid_payment_proof:{message:"கட்டண சரிபார்ப்பு தோல்வியடைந்தது",action:"உங்கள் கட்டணத்தை மீண்டும் முயற்சிக்கவும். இது தொடர்ந்தால், உதவியை தொடர்புக்கொள்ளவும்."},invalid_signature:{message:"பரிவர்த்தனை கையொப்பம் தவறானது",action:"உங்கள் வாலெட்டில் பரிவர்த்தனையை அங்கீகரித்து மீண்டும் முயற்சிக்கவும்."},invalid_transaction:{message:"பரிவர்த்தனை வடிவம் தவறானது",action:"உங்கள் கட்டணத்தை மீண்டும் முயற்சிக்கவும். இது தொடர்ந்தால், உங்கள் வாலெட் செயலியைப் புதுப்பித்து முயற்சிக்கவும்."},transaction_not_found:{message:"பரிவர்த்தனை பிளாக்செயினில் கிடைக்கவில்லை",action:"உங்கள் பரிவர்த்தனை இன்னும் செயலாக்கத்தில் இருக்கலாம். ஒரு நிமிடம் காத்திருந்து உங்கள் வாலெட்டில் சரிபார்க்கவும், அல்லது மீண்டும் முயற்சிக்கவும்."},transaction_not_confirmed:{message:"பரிவர்த்தனை இன்னும் செயலாக்கத்தில் உள்ளது",action:"பிளாக்செயின் உங்கள் பரிவர்த்தனையை உறுதிப்படுத்த ஒரு நிமிடம் காத்திருந்து பின்னர் முயற்சிக்கவும்."},transaction_failed:{message:"பரிவர்த்தனை பிளாக்செயினில் தோல்வியடைந்தது",action:"விவரங்களுக்கு உங்கள் வாலெட்டைச் சரிபார்க்கவும். பிணையக் கட்டணங்களுக்கு கூடுதல் SOL சேர்க்க அல்லது பரிவர்த்தனை அமைப்புகளை மாற்ற வேண்டியிருக்கும்."},transaction_expired:{message:"பரிவர்த்தனை செயலாக்கத்திற்கு அதிக நேரம் எடுத்துக் கொண்டது",action:"உங்கள் கட்டணத்தை மீண்டும் முயற்சிக்கவும். உங்கள் வாலெட் ஆதரித்தால் பரிவர்த்தனை முன்னுரிமையை உயர்த்திப் பார்க்கவும்."},invalid_recipient:{message:"கட்டணம் தவறான முகவரிக்கு அனுப்பப்பட்டுள்ளது",action:"மீண்டும் முயற்சிக்கவும் மற்றும் உங்கள் வாலெட்டில் சரியான பரிவர்த்தனையை அங்கீகரிக்க உறுதிசெய்யவும்."},invalid_sender:{message:"கட்டண அனுப்புநர் வாலெட் தவறானது",action:"உங்கள் வாலெட்டை மீண்டும் இணைத்து முயற்சிக்கவும்."},unauthorized_refund_issuer:{message:"பணம் திருப்பி அளிக்க நீங்கள் அனுமதிக்கப்பட்டவர் அல்ல",action:"அங்கீகரிக்கப்பட்ட கணக்குகள் மட்டுமே பணத்தை திருப்பி அளிக்க முடியும். இது தவறு என்று நினைத்தால், உதவியை தொடர்புக்கொள்ளவும்."},amount_below_minimum:{message:"கட்டணத் தொகை மிகவும் குறைவு",action:"தேவையான தொகையைச் சரிபார்த்து மீண்டும் முயற்சிக்கவும்."},amount_mismatch:{message:"கட்டணத் தொகை கூறிய விலையில் பொருந்தவில்லை",action:"விலை மாற்றியிருக்கலாம். புதுப்பித்து உங்கள் கட்டணத்தை மீண்டும் முயற்சிக்கவும்."},insufficient_funds_sol:{message:"பரிவர்த்தனை கட்டணங்களுக்கு போதுமான SOL இல்லை",action:"பிணையக் கட்டணங்களைச் செலுத்த உங்கள் வாலெட்டில் குறைந்தது 0.001 SOL சேர்த்து, பின்னர் முயற்சிக்கவும்."},insufficient_funds_token:{message:"உங்கள் வாலெட்டில் போதுமான இருப்பு இல்லை",action:"கூடுதல் நிதியைச் சேர்த்து மீண்டும் முயற்சிக்கவும்."},invalid_token_mint:{message:"தவறான கட்டண டோக்கன்",action:"கட்டண விவரங்களில் காட்டப்பட்ட சரியான டோக்கனுடன் செலுத்தவும்."},not_spl_transfer:{message:"பரிவர்த்தனை செல்லுபடியாகும் டோக்கன் பரிமாற்றம் அல்ல",action:"உங்கள் வாலெட்டிலிருந்து சரியான டோக்கன் வகையை அனுப்புகிறீர்கள் என்பதை உறுதிசெய்யவும்."},missing_token_account:{message:"டோக்கன் கணக்கு கிடைக்கவில்லை",action:"முதலில் உங்கள் வாலெட் ஒரு டோக்கன் கணக்கை உருவாக்க வேண்டியிருக்கும். மீண்டும் முயற்சிக்கவோ அல்லது வேறு வாலெட்டை பயன்படுத்தவோ செய்யவும்."},invalid_token_program:{message:"டோக்கன் நிரல் தவறானது",action:"உங்கள் கட்டணத்தை மீண்டும் முயற்சிக்கவும். இது தொடர்ந்தால், வேறு வாலெட்டை பயன்படுத்திப் பார்க்கவும்."},missing_memo:{message:"கட்டண மெமோ தேவைப்படுகிறது ஆனால் சேர்க்கப்படவில்லை",action:"உங்கள் கட்டணத்தை மீண்டும் முயற்சித்து, வாலெட்டில் பரிவர்த்தனை விவரங்களை அங்கீகரிக்கவும்."},invalid_memo:{message:"கட்டண மெமோவின் வடிவம் தவறானது",action:"உங்கள் கட்டணத்தை மீண்டும் முயற்சிக்கவும்."},payment_already_used:{message:"இந்த கட்டணம் ஏற்கனவே செயலாக்கப்பட்டது",action:"உங்கள் பரிவர்த்தனை வரலாற்றைச் சரிபார்க்கவும். மற்றொரு கட்டணம் செய்ய வேண்டுமெனில் புதிய பரிவர்த்தனையை தொடங்கவும்."},signature_reused:{message:"பரிவர்த்தனைக் கையொப்பம் ஏற்கனவே பயன்படுத்தப்பட்டுள்ளது",action:"புதிய கட்டண பரிவர்த்தனையை உருவாக்கவும்."},quote_expired:{message:"விலை மேற்கோள் காலாவதியானது",action:"விலைகள் அடிக்கடி புதுப்பிக்கப்படுகின்றன. புதுப்பித்து உங்கள் கட்டணத்தை மீண்டும் முயற்சிக்கவும்."},missing_field:{message:"தேவையான தகவல் காணப்படவில்லை",action:"அனைத்து தேவையான புலங்களையும் சரிபார்த்து மீண்டும் முயற்சிக்கவும்."},invalid_field:{message:"சில தகவல்கள் தவறானவை",action:"உங்கள் உள்ளீட்டைப் பரிசீலித்து மீண்டும் முயற்சிக்கவும்."},invalid_amount:{message:"கட்டண தொகை தவறானது",action:"தொகையைச் சரிபார்த்து மீண்டும் முயற்சிக்கவும்."},invalid_wallet:{message:"வாலெட் முகவரி தவறானது",action:"உங்கள் வாலெட்டை மீண்டும் இணைத்து முயற்சிக்கவும்."},invalid_resource:{message:"தவறான உருப்படி தேர்வு",action:"பக்கத்தை புதுப்பித்து மீண்டும் முயற்சிக்கவும்."},invalid_coupon:{message:"தவறான கூப்பன் குறியீடு",action:"கூப்பன் குறியீட்டைச் சரிபார்த்து மீண்டும் முயற்சிக்கவும்."},invalid_cart_item:{message:"ஒரு அல்லது அதற்கு மேற்பட்ட கார்ட் உருப்படிகள் தவறானவை",action:"உங்கள் கார்டை பரிசீலித்து மீண்டும் முயற்சிக்கவும்."},empty_cart:{message:"உங்கள் கார்ட் காலியாக உள்ளது",action:"காசோலை செய்யும் முன் உருப்படிகளைச் சேர்க்கவும்."},resource_not_found:{message:"உருப்படி கிடைக்கவில்லை",action:"இந்த உருப்படி இனி கிடைக்காமல் இருக்கலாம். புதுப்பித்து மீண்டும் முயற்சிக்கவும்."},cart_not_found:{message:"ஷாப்பிங் கார்ட் கிடைக்கவில்லை",action:"உங்கள் கார்ட் காலாவதியாகியிருக்கலாம். புதிய ஆர்டரைத் தொடங்கவும்."},refund_not_found:{message:"பணம் திருப்பிச் செலுத்துதல் கிடைக்கவில்லை",action:"உங்கள் திருப்பு குறிப்பு எண்ணைச் சரிபார்க்கவோ அல்லது உதவியைத் தொடர்புகொள்ளவோ செய்யவும்."},product_not_found:{message:"தயாரிப்பு கிடைக்கவில்லை",action:"இந்த தயாரிப்பு இனி கிடைக்காமல் இருக்கலாம். எங்களின் தற்போதைய தெரிவுகளை உலாவவும்."},coupon_not_found:{message:"கூப்பன் குறியீடு கிடைக்கவில்லை",action:"கூப்பன் குறியீட்டைச் சரிபார்க்கவோ அல்லது அதை நீக்கி தொடரவோ செய்யவும்."},session_not_found:{message:"கட்டண அமர்வு காலாவதியானது",action:"புதிய கட்டணத்தைத் தொடங்கவும்."},cart_already_paid:{message:"இந்த ஆர்டருக்கு ஏற்கனவே கட்டணம் செலுத்தப்பட்டுள்ளது",action:"உங்கள் ஆர்டர் வரலாற்றைச் சரிபார்க்கவும். மற்றொரு கொள்முதல் செய்ய வேண்டுமெனில் புதிய ஆர்டர் தொடங்கவும்."},refund_already_processed:{message:"இந்த பணத்தைத் திருப்பிச் செலுத்துதல் ஏற்கனவே செயலாக்கப்பட்டுள்ளது",action:"உங்கள் பரிவர்த்தனை வரலாறைச் சரிபார்க்கவோ அல்லது விவரங்களுக்கு உதவியைத் தொடர்புகொள்ளவோ செய்யவும்."},coupon_expired:{message:"கூப்பன் காலாவதியானது",action:"கூப்பன் குறியீட்டை அகற்றவோ அல்லது வேறொரு குறியீட்டை பயன்படுத்தவோ செய்யவும்."},coupon_usage_limit_reached:{message:"கூப்பன் பயன்பாட்டு வரம்பு எட்டப்பட்டுள்ளது",action:"இந்த கூப்பன் முழுமையாக பயன்படுத்தப்பட்டுள்ளது. வேறு குறியீட்டை முயற்சிக்கவும்."},coupon_not_applicable:{message:"இந்த கொள்முதலுக்கு கூப்பன் பயன்படுத்த முடியாது",action:"கூப்பன் நிபந்தனைகளைச் சரிபார்க்கவோ அல்லது அதை நீக்கி தொடரவோ செய்யவும்."},coupon_wrong_payment_method:{message:"இந்த கட்டண முறைக்கு கூப்பன் செல்லாது",action:"வேறு கட்டண முறையை முயற்சிக்கவோ அல்லது கூப்பன் குறியீட்டை நீக்கவோ செய்யவும்."},stripe_error:{message:"கார்டு கட்டண சேவை தற்காலிகமாக கிடைக்கவில்லை",action:"சிறிது நேரத்தில் மீண்டும் முயற்சிக்கவோ, அல்லது மாற்றாக கிரிப்டோகரன்சி கட்டணத்தைப் பயன்படுத்தவோ செய்யவும்."},rpc_error:{message:"பிளாக்செயின் நெட்வொர்க் தற்காலிகமாக கிடைக்கவில்லை",action:"சிறிது நேரத்தில் மீண்டும் முயற்சிக்கவோ, அல்லது மாற்றாக கார்டு கட்டணத்தைப் பயன்படுத்தவோ செய்யவும்."},network_error:{message:"நெட்வொர்க் இணைப்பு சிக்கல்",action:"உங்கள் இன்டர்நெட் இணைப்பைச் சரிபார்த்து மீண்டும் முயற்சிக்கவும்."},internal_error:{message:"எங்களின் பக்கத்தில் ஏதோ தவறு ஏற்பட்டது",action:"மீண்டும் முயற்சிக்கவும். இது தொடர்ந்தால், உதவியைத் தொடர்புகொள்ளவும்."},database_error:{message:"சேவை தற்காலிகமாக கிடைக்கவில்லை",action:"சிறிது நேரத்தில் மீண்டும் முயற்சிக்கவும்."},config_error:{message:"சேவை கட்டமைப்பு பிழை",action:"உதவியைத் தொடர்புகொண்டு வழிகாட்டலைப் பெறவும்."},unknown_error:{message:"எதிர்பாராத பிழை ஏற்பட்டது",action:"மீண்டும் முயற்சிக்கவோ அல்லது இது தொடர்ந்தால் உதவியைத் தொடர்புகொள்ளவோ செய்யவும்."}},s={unknown_token_mint:"எச்சரிக்கை: அறியப்படாத டோக்கன் மின்ட் முகவரி. நிதி இழப்பைத் தவிர்க்க இது சரியான டோக்கன் என்பதை இருமுறையும் சரிபார்க்கவும்.",token_typo_warning:"டோக்கன் முகவரி அறியப்பட்ட ஸ்டேபிள்காயின்களுடன் (USDC, USDT, PYUSD, CASH) பொருந்தவில்லை. நிரந்தர நிதி இழப்பைத் தவிர்க்க கவனமாக சரிபார்க்கவும்."},i={no_wallet_detected:"சோலானா வாலெட் கண்டறியப்படவில்லை",install_wallet:"Phantom, Solflare, Backpack போன்ற சோலானா வாலெட்டை நிறுவவும்.",wallet_not_connected:"வாலெட் இணைக்கப்படவில்லை",connect_your_wallet:"தொடர வாலெட்டை இணைக்கவும்.",wallet_connection_failed:"வாலெட்டை இணைக்க முடியவில்லை",try_again:"மீண்டும் இணைக்க முயற்சிக்கவும்.",transaction_rejected:"பரிவர்த்தனை நிராகரிக்கப்பட்டது",approve_in_wallet:"தொடர உங்கள் வாலெட்டில் பரிவர்த்தனையை அங்கீகரிக்கவும்."},c={comment:e,version:a,locale:n,ui:o,errors:t,validation:s,wallet:i};exports.comment=e;exports.default=c;exports.errors=t;exports.locale=n;exports.ui=o;exports.validation=s;exports.version=a;exports.wallet=i;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @cedros/pay-react/telemetry - Optional error telemetry module
|
|
3
|
+
*
|
|
4
|
+
* This module is opt-in and provides error tracking, correlation IDs,
|
|
5
|
+
* and PII sanitization for integration with monitoring services.
|
|
6
|
+
*
|
|
7
|
+
* **Usage:**
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { configureTelemetry, ErrorSeverity } from '@cedros/pay-react/telemetry';
|
|
10
|
+
* import * as Sentry from '@sentry/react';
|
|
11
|
+
*
|
|
12
|
+
* configureTelemetry({
|
|
13
|
+
* enabled: true,
|
|
14
|
+
* sanitizePII: true,
|
|
15
|
+
* onError: (error) => {
|
|
16
|
+
* Sentry.captureException(error.error, {
|
|
17
|
+
* extra: { correlationId: error.correlationId },
|
|
18
|
+
* });
|
|
19
|
+
* },
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* By default, telemetry is **disabled** and this module adds **no overhead**
|
|
24
|
+
* unless explicitly imported and configured.
|
|
25
|
+
*/
|
|
26
|
+
export { configureTelemetry, getTelemetryConfig, generateCorrelationId, sanitizePII, sanitizeError, enrichError, reportError, createErrorReporter, resetTelemetry, ErrorSeverity, type CorrelationId, type PaymentContext, type EnrichedError, type TelemetryHook, } from './utils/telemetry';
|
|
27
|
+
//# sourceMappingURL=telemetry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../src/telemetry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,WAAW,EACX,aAAa,EACb,WAAW,EACX,WAAW,EACX,mBAAmB,EACnB,cAAc,EACd,aAAa,EACb,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,aAAa,GACnB,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./uuid-C0iMjdcc.js");var c=(e=>(e.DEBUG="debug",e.INFO="info",e.WARNING="warning",e.ERROR="error",e.CRITICAL="critical",e))(c||{});let r={enabled:!1,sanitizePII:!0};function f(e){r={...r,...e}}function m(){return{...r}}function g(){const e=Date.now(),t=l.generateUUID().slice(0,12);return`cedros_${e}_${t}`}const z=[/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b/g,/\b(\+?\d{1,3}[-.\s]?)?\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}\b/g,/\b\d{4}[\s-]?\d{4}[\s-]?\d{4}[\s-]?\d{4}\b/g,/\b\d{3}-\d{2}-\d{4}\b/g,/\b(?:\d{1,3}\.){3}\d{1,3}\b/g,/\b[1-9A-HJ-NP-Za-km-z]{87,88}\b/g,/\b[1-9A-HJ-NP-Za-km-z]{32,44}\b/g,/\b0x[a-fA-F0-9]{64}\b/g,/\b0x[a-fA-F0-9]{40}\b/g,/\b([a-z]+\s+){11,23}[a-z]+\b/gi,/\beyJ[a-zA-Z0-9_-]+\.eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\b/g,/\b(sk|pk|api|secret|key)_[a-zA-Z0-9]{16,128}\b/gi,/\bsk_(test|live)_[a-zA-Z0-9]{24,}\b/g,/\b[1-9A-HJ-NP-Za-km-z]{86,90}\b/g,/\b[A-Za-z0-9+/]{100,}={0,2}\b/g,/\b[a-fA-F0-9]{64,}\b/g];function o(e){if(!r.enabled||!r.sanitizePII)return e;let t=e;for(const n of z)t=t.replace(n,"[REDACTED]");return t}function d(e){const t=new Error(o(e.message));return t.name=e.name,e.stack&&(t.stack=o(e.stack)),t}function b(e,t={}){const n=typeof e=="string"?new Error(e):e,a=r.sanitizePII?d(n):n,s=Date.now();return{correlationId:t.correlationId||g(),timestamp:s,timestampISO:new Date(s).toISOString(),severity:t.severity||"error",code:t.code,message:a.message,error:a,stack:a.stack,paymentContext:t.paymentContext,userAgent:typeof navigator<"u"?navigator.userAgent:void 0,sdkVersion:r.sdkVersion,environment:r.environment,tags:{...r.globalTags,...t.tags}}}function u(e,t){if(!r.enabled||!r.onError)return;const n=typeof e=="object"&&"correlationId"in e?e:b(e,t||{});try{r.onError(n)}catch(i){console.error("[CedrosPay] Telemetry hook failed:",i)}}function I(e){return(t,n={})=>{u(t,{...n,tags:{...e,...n.tags}})}}function A(){r={enabled:!1,sanitizePII:!0}}exports.ErrorSeverity=c;exports.configureTelemetry=f;exports.createErrorReporter=I;exports.enrichError=b;exports.generateCorrelationId=g;exports.getTelemetryConfig=m;exports.reportError=u;exports.resetTelemetry=A;exports.sanitizeError=d;exports.sanitizePII=o;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { g as c } from "./uuid-UlzrVY8Y.mjs";
|
|
2
|
+
var b = /* @__PURE__ */ ((e) => (e.DEBUG = "debug", e.INFO = "info", e.WARNING = "warning", e.ERROR = "error", e.CRITICAL = "critical", e))(b || {});
|
|
3
|
+
let n = {
|
|
4
|
+
enabled: !1,
|
|
5
|
+
sanitizePII: !0
|
|
6
|
+
};
|
|
7
|
+
function z(e) {
|
|
8
|
+
n = {
|
|
9
|
+
...n,
|
|
10
|
+
...e
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function I() {
|
|
14
|
+
return { ...n };
|
|
15
|
+
}
|
|
16
|
+
function g() {
|
|
17
|
+
const e = Date.now(), t = c().slice(0, 12);
|
|
18
|
+
return `cedros_${e}_${t}`;
|
|
19
|
+
}
|
|
20
|
+
const d = [
|
|
21
|
+
// Email addresses
|
|
22
|
+
/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b/g,
|
|
23
|
+
// Phone numbers (various formats)
|
|
24
|
+
/\b(\+?\d{1,3}[-.\s]?)?\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}\b/g,
|
|
25
|
+
// Credit card numbers (basic pattern)
|
|
26
|
+
/\b\d{4}[\s-]?\d{4}[\s-]?\d{4}[\s-]?\d{4}\b/g,
|
|
27
|
+
// SSN (US)
|
|
28
|
+
/\b\d{3}-\d{2}-\d{4}\b/g,
|
|
29
|
+
// IP addresses (IPv4)
|
|
30
|
+
/\b(?:\d{1,3}\.){3}\d{1,3}\b/g,
|
|
31
|
+
// ====== CRYPTO-SPECIFIC SENSITIVE DATA ======
|
|
32
|
+
// Solana private keys (Base58 encoded, typically 88 chars)
|
|
33
|
+
/\b[1-9A-HJ-NP-Za-km-z]{87,88}\b/g,
|
|
34
|
+
// Solana wallet addresses (Base58, 32-44 chars)
|
|
35
|
+
/\b[1-9A-HJ-NP-Za-km-z]{32,44}\b/g,
|
|
36
|
+
// Ethereum private keys (0x + 64 hex chars)
|
|
37
|
+
/\b0x[a-fA-F0-9]{64}\b/g,
|
|
38
|
+
// Ethereum addresses (0x + 40 hex chars)
|
|
39
|
+
/\b0x[a-fA-F0-9]{40}\b/g,
|
|
40
|
+
// BIP39 seed phrases (12, 15, 18, 21, or 24 words)
|
|
41
|
+
// Matches common patterns like "word word word..." (very conservative)
|
|
42
|
+
/\b([a-z]+\s+){11,23}[a-z]+\b/gi,
|
|
43
|
+
// JWT tokens (header.payload.signature format)
|
|
44
|
+
/\beyJ[a-zA-Z0-9_-]+\.eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\b/g,
|
|
45
|
+
// API keys (common patterns: sk_, pk_, api_, secret_)
|
|
46
|
+
/\b(sk|pk|api|secret|key)_[a-zA-Z0-9]{16,128}\b/gi,
|
|
47
|
+
// Stripe secret keys
|
|
48
|
+
/\bsk_(test|live)_[a-zA-Z0-9]{24,}\b/g,
|
|
49
|
+
// Transaction signatures (Base58, ~88 chars)
|
|
50
|
+
/\b[1-9A-HJ-NP-Za-km-z]{86,90}\b/g,
|
|
51
|
+
// Base64 encoded data (could be keys) - very long strings
|
|
52
|
+
/\b[A-Za-z0-9+/]{100,}={0,2}\b/g,
|
|
53
|
+
// Hex strings longer than 32 chars (could be keys)
|
|
54
|
+
/\b[a-fA-F0-9]{64,}\b/g
|
|
55
|
+
];
|
|
56
|
+
function i(e) {
|
|
57
|
+
if (!n.enabled || !n.sanitizePII)
|
|
58
|
+
return e;
|
|
59
|
+
let t = e;
|
|
60
|
+
for (const a of d)
|
|
61
|
+
t = t.replace(a, "[REDACTED]");
|
|
62
|
+
return t;
|
|
63
|
+
}
|
|
64
|
+
function f(e) {
|
|
65
|
+
const t = new Error(i(e.message));
|
|
66
|
+
return t.name = e.name, e.stack && (t.stack = i(e.stack)), t;
|
|
67
|
+
}
|
|
68
|
+
function u(e, t = {}) {
|
|
69
|
+
const a = typeof e == "string" ? new Error(e) : e, r = n.sanitizePII ? f(a) : a, o = Date.now();
|
|
70
|
+
return {
|
|
71
|
+
correlationId: t.correlationId || g(),
|
|
72
|
+
timestamp: o,
|
|
73
|
+
timestampISO: new Date(o).toISOString(),
|
|
74
|
+
severity: t.severity || "error",
|
|
75
|
+
code: t.code,
|
|
76
|
+
message: r.message,
|
|
77
|
+
error: r,
|
|
78
|
+
stack: r.stack,
|
|
79
|
+
paymentContext: t.paymentContext,
|
|
80
|
+
userAgent: typeof navigator < "u" ? navigator.userAgent : void 0,
|
|
81
|
+
sdkVersion: n.sdkVersion,
|
|
82
|
+
environment: n.environment,
|
|
83
|
+
tags: {
|
|
84
|
+
...n.globalTags,
|
|
85
|
+
...t.tags
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
function l(e, t) {
|
|
90
|
+
if (!n.enabled || !n.onError)
|
|
91
|
+
return;
|
|
92
|
+
const a = typeof e == "object" && "correlationId" in e ? e : u(e, t || {});
|
|
93
|
+
try {
|
|
94
|
+
n.onError(a);
|
|
95
|
+
} catch (s) {
|
|
96
|
+
console.error("[CedrosPay] Telemetry hook failed:", s);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function A(e) {
|
|
100
|
+
return (t, a = {}) => {
|
|
101
|
+
l(t, {
|
|
102
|
+
...a,
|
|
103
|
+
tags: {
|
|
104
|
+
...e,
|
|
105
|
+
...a.tags
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
function k() {
|
|
111
|
+
n = {
|
|
112
|
+
enabled: !1,
|
|
113
|
+
sanitizePII: !0
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
export {
|
|
117
|
+
b as ErrorSeverity,
|
|
118
|
+
z as configureTelemetry,
|
|
119
|
+
A as createErrorReporter,
|
|
120
|
+
u as enrichError,
|
|
121
|
+
g as generateCorrelationId,
|
|
122
|
+
I as getTelemetryConfig,
|
|
123
|
+
l as reportError,
|
|
124
|
+
k as resetTelemetry,
|
|
125
|
+
f as sanitizeError,
|
|
126
|
+
i as sanitizePII
|
|
127
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tests for testing provider utilities
|
|
3
|
+
*
|
|
4
|
+
* Regression test for TEST-001/TEST-002:
|
|
5
|
+
* - Verify createMockCedrosProvider provides functional context
|
|
6
|
+
* - Verify useCedrosContext() works inside mock provider
|
|
7
|
+
* - Verify mock config is applied correctly
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=providers.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"providers.test.d.ts","sourceRoot":"","sources":["../../../src/testing/__tests__/providers.test.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { vi } from 'vitest';
|
|
2
|
+
import { PaymentResult, X402Requirement, SettlementResponse } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Simulates a successful Stripe payment
|
|
5
|
+
*
|
|
6
|
+
* @param sessionId - Mock session ID
|
|
7
|
+
* @returns Mock payment result
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* const result = mockPaymentSuccess('cs_test_123');
|
|
12
|
+
* expect(result.success).toBe(true);
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare function mockPaymentSuccess(sessionId?: string): PaymentResult;
|
|
16
|
+
/**
|
|
17
|
+
* Simulates a failed Stripe payment
|
|
18
|
+
*
|
|
19
|
+
* @param error - Error message
|
|
20
|
+
* @returns Mock payment result
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* const result = mockPaymentFailure('Card declined');
|
|
25
|
+
* expect(result.success).toBe(false);
|
|
26
|
+
* expect(result.error).toBe('Card declined');
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare function mockPaymentFailure(error?: string): PaymentResult;
|
|
30
|
+
/**
|
|
31
|
+
* Creates a mock x402 requirement (payment quote)
|
|
32
|
+
*
|
|
33
|
+
* @param options - Quote options
|
|
34
|
+
* @returns Mock x402 requirement
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```typescript
|
|
38
|
+
* const quote = mockX402Quote({
|
|
39
|
+
* maxAmountRequired: '1000000', // 1 USDC
|
|
40
|
+
* payTo: 'recipientWallet123',
|
|
41
|
+
* });
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export declare function mockX402Quote(options?: {
|
|
45
|
+
scheme?: string;
|
|
46
|
+
network?: string;
|
|
47
|
+
maxAmountRequired?: string;
|
|
48
|
+
resource?: string;
|
|
49
|
+
description?: string;
|
|
50
|
+
mimeType?: string;
|
|
51
|
+
payTo?: string;
|
|
52
|
+
maxTimeoutSeconds?: number;
|
|
53
|
+
asset?: string;
|
|
54
|
+
extra?: {
|
|
55
|
+
recipientTokenAccount?: string;
|
|
56
|
+
decimals?: number;
|
|
57
|
+
tokenSymbol?: string;
|
|
58
|
+
memo?: string;
|
|
59
|
+
feePayer?: string;
|
|
60
|
+
};
|
|
61
|
+
}): X402Requirement;
|
|
62
|
+
/**
|
|
63
|
+
* Creates a mock settlement response (payment verification)
|
|
64
|
+
*
|
|
65
|
+
* @param options - Settlement options
|
|
66
|
+
* @returns Mock settlement response
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```typescript
|
|
70
|
+
* const settlement = mockSettlement({
|
|
71
|
+
* txHash: 'tx123',
|
|
72
|
+
* success: true,
|
|
73
|
+
* });
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
export declare function mockSettlement(options?: {
|
|
77
|
+
success?: boolean;
|
|
78
|
+
error?: string | null;
|
|
79
|
+
txHash?: string | null;
|
|
80
|
+
networkId?: string | null;
|
|
81
|
+
metadata?: Record<string, string | undefined>;
|
|
82
|
+
}): SettlementResponse;
|
|
83
|
+
/**
|
|
84
|
+
* Wait for next tick (useful for testing async operations)
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```typescript
|
|
88
|
+
* await waitForNextTick();
|
|
89
|
+
* expect(mockFn).toHaveBeenCalled();
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
export declare function waitForNextTick(): Promise<void>;
|
|
93
|
+
/**
|
|
94
|
+
* Wait for a specific amount of time
|
|
95
|
+
*
|
|
96
|
+
* @param ms - Milliseconds to wait
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* ```typescript
|
|
100
|
+
* await wait(1000); // Wait 1 second
|
|
101
|
+
* ```
|
|
102
|
+
*/
|
|
103
|
+
export declare function wait(ms: number): Promise<void>;
|
|
104
|
+
/**
|
|
105
|
+
* Creates a mock backend response for /paywall/v1/quote
|
|
106
|
+
*
|
|
107
|
+
* @param resourceId - Resource ID
|
|
108
|
+
* @param options - Quote options
|
|
109
|
+
* @returns Mock fetch response
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* ```typescript
|
|
113
|
+
* global.fetch = vi.fn().mockResolvedValue(
|
|
114
|
+
* mockQuoteResponse('premium-article')
|
|
115
|
+
* );
|
|
116
|
+
* ```
|
|
117
|
+
*/
|
|
118
|
+
export declare function mockQuoteResponse(resourceId: string, options?: {
|
|
119
|
+
maxAmountRequired?: string;
|
|
120
|
+
asset?: string;
|
|
121
|
+
payTo?: string;
|
|
122
|
+
}): {
|
|
123
|
+
ok: boolean;
|
|
124
|
+
status: number;
|
|
125
|
+
json: () => Promise<{
|
|
126
|
+
x402Version: number;
|
|
127
|
+
error: string;
|
|
128
|
+
accepts: {
|
|
129
|
+
scheme: string;
|
|
130
|
+
network: string;
|
|
131
|
+
maxAmountRequired: string;
|
|
132
|
+
resource: string;
|
|
133
|
+
description: string;
|
|
134
|
+
mimeType: string;
|
|
135
|
+
payTo: string;
|
|
136
|
+
maxTimeoutSeconds: number;
|
|
137
|
+
asset: string;
|
|
138
|
+
extra: {
|
|
139
|
+
recipientTokenAccount: string;
|
|
140
|
+
decimals: number;
|
|
141
|
+
tokenSymbol: string;
|
|
142
|
+
memo: string;
|
|
143
|
+
};
|
|
144
|
+
}[];
|
|
145
|
+
}>;
|
|
146
|
+
headers: Map<string, string>;
|
|
147
|
+
};
|
|
148
|
+
/**
|
|
149
|
+
* Creates a mock backend response for /paywall/v1/verify
|
|
150
|
+
*
|
|
151
|
+
* @param success - Whether verification succeeded
|
|
152
|
+
* @returns Mock fetch response
|
|
153
|
+
*
|
|
154
|
+
* @example
|
|
155
|
+
* ```typescript
|
|
156
|
+
* global.fetch = vi.fn().mockResolvedValue(
|
|
157
|
+
* mockVerifyResponse(true)
|
|
158
|
+
* );
|
|
159
|
+
* ```
|
|
160
|
+
*/
|
|
161
|
+
export declare function mockVerifyResponse(success?: boolean): {
|
|
162
|
+
ok: boolean;
|
|
163
|
+
status: number;
|
|
164
|
+
json: () => Promise<import("../types").v1.SettlementResponse>;
|
|
165
|
+
headers: Map<string, string>;
|
|
166
|
+
};
|
|
167
|
+
/**
|
|
168
|
+
* Creates a mock backend response for /paywall/v1/stripe-session
|
|
169
|
+
*
|
|
170
|
+
* @param sessionId - Stripe session ID
|
|
171
|
+
* @returns Mock fetch response
|
|
172
|
+
*
|
|
173
|
+
* @example
|
|
174
|
+
* ```typescript
|
|
175
|
+
* global.fetch = vi.fn().mockResolvedValue(
|
|
176
|
+
* mockStripeSessionResponse('cs_test_123')
|
|
177
|
+
* );
|
|
178
|
+
* ```
|
|
179
|
+
*/
|
|
180
|
+
export declare function mockStripeSessionResponse(sessionId?: string): {
|
|
181
|
+
ok: boolean;
|
|
182
|
+
status: number;
|
|
183
|
+
json: () => Promise<{
|
|
184
|
+
sessionId: string;
|
|
185
|
+
url: string;
|
|
186
|
+
}>;
|
|
187
|
+
};
|
|
188
|
+
/**
|
|
189
|
+
* Simulates wallet connection flow
|
|
190
|
+
*
|
|
191
|
+
* @returns Mock wallet connect result
|
|
192
|
+
*
|
|
193
|
+
* @example
|
|
194
|
+
* ```typescript
|
|
195
|
+
* const mockConnect = vi.fn().mockResolvedValue(mockWalletConnect());
|
|
196
|
+
* ```
|
|
197
|
+
*/
|
|
198
|
+
export declare function mockWalletConnect(publicKey?: string): {
|
|
199
|
+
publicKey: {
|
|
200
|
+
toBase58: () => string;
|
|
201
|
+
toString: () => string;
|
|
202
|
+
};
|
|
203
|
+
};
|
|
204
|
+
/**
|
|
205
|
+
* Simulates transaction signing
|
|
206
|
+
*
|
|
207
|
+
* @returns Mock signed transaction
|
|
208
|
+
*
|
|
209
|
+
* @example
|
|
210
|
+
* ```typescript
|
|
211
|
+
* const mockSign = vi.fn().mockResolvedValue(mockSignTransaction());
|
|
212
|
+
* ```
|
|
213
|
+
*/
|
|
214
|
+
export declare function mockSignTransaction(): {
|
|
215
|
+
signature: Uint8Array<ArrayBuffer>;
|
|
216
|
+
serialize: () => Uint8Array<ArrayBuffer>;
|
|
217
|
+
};
|
|
218
|
+
/**
|
|
219
|
+
* Creates a spy function that tracks calls
|
|
220
|
+
*
|
|
221
|
+
* @param implementation - Optional implementation
|
|
222
|
+
* @returns Spy function
|
|
223
|
+
*
|
|
224
|
+
* @example
|
|
225
|
+
* ```typescript
|
|
226
|
+
* const onSuccess = createSpy((result) => console.log(result));
|
|
227
|
+
* // Use in your test
|
|
228
|
+
* expect(onSuccess).toHaveBeenCalledWith(expectedResult);
|
|
229
|
+
* ```
|
|
230
|
+
*/
|
|
231
|
+
export declare function createSpy<T extends (...args: never[]) => unknown>(implementation?: T): ReturnType<typeof vi.fn>;
|
|
232
|
+
/**
|
|
233
|
+
* Flushes all pending promises (useful for testing)
|
|
234
|
+
*
|
|
235
|
+
* @example
|
|
236
|
+
* ```typescript
|
|
237
|
+
* await flushPromises();
|
|
238
|
+
* expect(asyncOperation).toHaveCompleted();
|
|
239
|
+
* ```
|
|
240
|
+
*/
|
|
241
|
+
export declare function flushPromises(): Promise<void>;
|
|
242
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/testing/helpers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC5B,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAEnF;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,GAAE,MAA0B,GAAG,aAAa,CAMvF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,GAAE,MAAyB,GAAG,aAAa,CAMlF;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,OAAO,GAAE;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE;QACN,qBAAqB,CAAC,EAAE,MAAM,CAAC;QAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;CACE,GAAG,eAAe,CA+BvB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,OAAO,GAAE;IACtC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;CAC1C,GAAG,kBAAkB,CAgB1B;AAED;;;;;;;;GAQG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CAErD;AAED;;;;;;;;;GASG;AACH,wBAAsB,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEpD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE;IACP,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CACX;;;;;;;;;;;;;;;;;;;;;;;;;EAsCP;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,GAAE,OAAc;;;;;EAuBzD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,yBAAyB,CAAC,SAAS,GAAE,MAA0B;;;;;;;EAS9E;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,GAAE,MAAwB;;;;;EAOpE;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB;;;EAKlC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,OAAO,EAC/D,cAAc,CAAC,EAAE,CAAC,GACjB,UAAU,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,CAE1B;AAED;;;;;;;;GAQG;AACH,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAEnD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Testing Utilities for Cedros Pay
|
|
3
|
+
*
|
|
4
|
+
* Export mock providers and helpers to make testing payment flows easier.
|
|
5
|
+
* Import from '@cedros/pay-react/testing' in your tests.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
export * from './mocks';
|
|
10
|
+
export * from './providers';
|
|
11
|
+
export * from './helpers';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/testing/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vitest"),c=require("react/jsx-runtime"),p=require("../CedrosContext-B3iCqN6e.js"),y={clusterApiUrl:n.vi.fn(()=>"https://api.devnet.solana.com"),Connection:class{async getLatestBlockhash(){return{blockhash:"mockedBlockhash123",lastValidBlockHeight:1e6}}async getBalance(){return 1e9}async getSignatureStatus(){return{value:{confirmationStatus:"confirmed"}}}async getAccountInfo(){return{data:new Uint8Array,executable:!1,lamports:1e6,owner:new Uint8Array(32),rentEpoch:0}}async sendRawTransaction(){return"mockedSignature123"}async confirmTransaction(){return{value:{err:null}}}},SystemProgram:{transfer:n.vi.fn(()=>({keys:[],programId:{},data:new Uint8Array}))},Transaction:class{recentBlockhash;feePayer;instructions=[];add(t){return this.instructions.push(t),this}serialize(){return new Uint8Array([1,2,3,4,5])}},LAMPORTS_PER_SOL:1e9,PublicKey:class{constructor(t){this.value=t}toString(){return typeof this.value=="string"?this.value:"mockPublicKey123"}toBase58(){return this.toString()}toBytes(){return new Uint8Array(32)}}},f={getAssociatedTokenAddress:n.vi.fn(async()=>({toBase58:()=>"mockTokenAddress123"})),createTransferInstruction:n.vi.fn(()=>({keys:[],programId:{},data:new Uint8Array})),TOKEN_PROGRAM_ID:"mockTokenProgramId"},v={ConnectionProvider:({children:e})=>e,WalletProvider:({children:e})=>e,useWallet:()=>({connected:!1,connecting:!1,connect:n.vi.fn(),disconnect:n.vi.fn(),publicKey:null,signTransaction:n.vi.fn(),signAllTransactions:n.vi.fn(),select:n.vi.fn()})},S={PhantomWalletAdapter:class{},SolflareWalletAdapter:class{},BackpackWalletAdapter:class{}},h={loadStripe:n.vi.fn(async()=>({redirectToCheckout:n.vi.fn(async e=>({error:null})),confirmCardPayment:n.vi.fn(async()=>({paymentIntent:{id:"pi_mock123",status:"succeeded"},error:null}))}))};function P(e=!0,t="mockWallet123"){return{connected:e,connecting:!1,connect:n.vi.fn().mockResolvedValue(void 0),disconnect:n.vi.fn().mockResolvedValue(void 0),publicKey:e?{toBase58:()=>t,toString:()=>t}:null,signTransaction:n.vi.fn().mockResolvedValue({signature:new Uint8Array(64),serialize:()=>new Uint8Array([1,2,3])}),signAllTransactions:n.vi.fn().mockResolvedValue([]),select:n.vi.fn()}}function g(e={}){const{redirectSuccess:t=!0}=e,o=e.sessionId??"cs_test_mock123";return{redirectToCheckout:n.vi.fn().mockResolvedValue({error:t?null:{message:"Mock redirect error"}}),confirmCardPayment:n.vi.fn().mockResolvedValue({paymentIntent:{id:"pi_mock123",status:"succeeded"},error:null}),_sessionId:o}}function A(e){return n.vi.fn(t=>{for(const[o,r]of Object.entries(e))if(t.includes(o))return Promise.resolve({ok:r.status>=200&&r.status<300,status:r.status,json:async()=>r.body,text:async()=>JSON.stringify(r.body),headers:new Map(Object.entries(r.headers||{}))});return Promise.resolve({ok:!1,status:404,json:async()=>({error:"Not found"}),text:async()=>JSON.stringify({error:"Not found"}),headers:new Map})})}function i(e={}){return function({children:o}){const r={stripePublicKey:e.stripePublicKey??"pk_test_mock_key_for_testing",serverUrl:e.serverUrl??"http://localhost:8080",solanaCluster:e.solanaCluster??"devnet",solanaEndpoint:e.solanaEndpoint,theme:e.theme??"light",themeOverrides:e.themeOverrides,unstyled:!1,tokenMint:void 0,dangerouslyAllowUnknownMint:!0,logLevel:4};return c.jsx(p.CedrosProvider,{config:r,children:o})}}function T(){return i({stripePublicKey:"pk_test_minimal",serverUrl:"http://localhost:8080",solanaCluster:"devnet"})}function w(e={}){return e.connected,e.publicKey,e.connecting,function({children:o}){return c.jsx(c.Fragment,{children:o})}}function M(e="cs_test_mock123"){return{success:!0,transactionId:e,error:void 0}}function W(e="Payment failed"){return{success:!1,transactionId:void 0,error:e}}function b(e={}){const{scheme:t="solana-spl-transfer",network:o="mainnet-beta",maxAmountRequired:r="1000000",resource:s="test-resource",description:a="Test Payment",mimeType:l="application/json",payTo:u="mockRecipient123",maxTimeoutSeconds:m=300,asset:k="EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",extra:d={recipientTokenAccount:"mockTokenAccount123",decimals:6,tokenSymbol:"USDC",memo:"test-payment"}}=e;return{scheme:t,network:o,maxAmountRequired:r,resource:s,description:a,mimeType:l,payTo:u,maxTimeoutSeconds:m,asset:k,extra:d}}function C(e={}){const{success:t=!0,error:o=null,txHash:r="mockSignature123",networkId:s="mainnet-beta",metadata:a}=e;return{success:t,error:o,txHash:r,networkId:s,metadata:a}}async function x(){return new Promise(e=>setTimeout(e,0))}async function R(e){return new Promise(t=>setTimeout(t,e))}function _(e,t={}){const{maxAmountRequired:o="1000000",asset:r="EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",payTo:s="mockRecipient123"}=t;return{ok:!1,status:402,json:async()=>({x402Version:0,error:"payment required",accepts:[{scheme:"solana-spl-transfer",network:"mainnet-beta",maxAmountRequired:o,resource:e,description:"Payment required",mimeType:"application/json",payTo:s,maxTimeoutSeconds:300,asset:r,extra:{recipientTokenAccount:"mockTokenAccount123",decimals:6,tokenSymbol:"USDC",memo:`${e}:${Date.now()}`}}]}),headers:new Map([["content-type","application/json"]])}}function U(e=!0){const t=e?{success:!0,error:null,txHash:"mockSignature123",networkId:"mainnet-beta"}:{success:!1,error:"Payment verification failed",txHash:null,networkId:null};return{ok:e,status:e?200:402,json:async()=>t,headers:new Map([["x-payment-response",JSON.stringify(t)]])}}function j(e="cs_test_mock123"){return{ok:!0,status:200,json:async()=>({sessionId:e,url:`https://checkout.stripe.com/pay/${e}`})}}function I(e="mockWallet123"){return{publicKey:{toBase58:()=>e,toString:()=>e}}}function q(){return{signature:new Uint8Array(64).fill(1),serialize:()=>new Uint8Array([1,2,3,4,5])}}function B(e){return n.vi.fn(e)}async function O(){return new Promise(e=>setImmediate(e))}exports.createMinimalMockProvider=T;exports.createMockCedrosProvider=i;exports.createMockFetch=A;exports.createMockStripe=g;exports.createMockWallet=P;exports.createSpy=B;exports.flushPromises=O;exports.mockPaymentFailure=W;exports.mockPaymentSuccess=M;exports.mockQuoteResponse=_;exports.mockSettlement=C;exports.mockSignTransaction=q;exports.mockSolanaWeb3=y;exports.mockSplToken=f;exports.mockStripeJs=h;exports.mockStripeSessionResponse=j;exports.mockVerifyResponse=U;exports.mockWalletAdapter=v;exports.mockWalletAdapterWallets=S;exports.mockWalletConnect=I;exports.mockWalletProvider=w;exports.mockX402Quote=b;exports.wait=R;exports.waitForNextTick=x;
|