@spare-technologies/spare-link 0.1.0-beta.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/CHANGELOG.md +66 -0
- package/LICENSE +21 -0
- package/README.md +173 -0
- package/assets/fonts/MetroSans-Bold.otf +0 -0
- package/assets/fonts/MetroSans-Light.otf +0 -0
- package/assets/fonts/MetroSans-Medium.otf +0 -0
- package/assets/fonts/MetroSans-Regular.otf +0 -0
- package/assets/fonts/MetroSans-SemiBold.otf +0 -0
- package/assets/images/altareq_logo_mini.png +0 -0
- package/assets/images/altareq_logo_transparent_bg.png +0 -0
- package/assets/images/altareq_logo_white_bg.png +0 -0
- package/assets/images/spare_logo.png +0 -0
- package/lib/commonjs/core/client/link-api-client.js +297 -0
- package/lib/commonjs/core/client/link-api-client.js.map +1 -0
- package/lib/commonjs/core/errors/payment-api-error.js +35 -0
- package/lib/commonjs/core/errors/payment-api-error.js.map +1 -0
- package/lib/commonjs/core/models/index.js +2 -0
- package/lib/commonjs/core/models/index.js.map +1 -0
- package/lib/commonjs/core/models/link-session-status.js +14 -0
- package/lib/commonjs/core/models/link-session-status.js.map +1 -0
- package/lib/commonjs/core/models/payment-return-params.js +42 -0
- package/lib/commonjs/core/models/payment-return-params.js.map +1 -0
- package/lib/commonjs/core/models/payment-type.js +45 -0
- package/lib/commonjs/core/models/payment-type.js.map +1 -0
- package/lib/commonjs/core/models/wire-mappers.js +277 -0
- package/lib/commonjs/core/models/wire-mappers.js.map +1 -0
- package/lib/commonjs/core/services/consent-presenter.js +150 -0
- package/lib/commonjs/core/services/consent-presenter.js.map +1 -0
- package/lib/commonjs/core/services/execute-resume-if-needed.js +216 -0
- package/lib/commonjs/core/services/execute-resume-if-needed.js.map +1 -0
- package/lib/commonjs/core/services/multi-payment-rules-presenter.js +151 -0
- package/lib/commonjs/core/services/multi-payment-rules-presenter.js.map +1 -0
- package/lib/commonjs/core/services/payment-flow-controller.js +547 -0
- package/lib/commonjs/core/services/payment-flow-controller.js.map +1 -0
- package/lib/commonjs/core/services/payment-flow-state.js +110 -0
- package/lib/commonjs/core/services/payment-flow-state.js.map +1 -0
- package/lib/commonjs/core/services/payment-result-mapper.js +49 -0
- package/lib/commonjs/core/services/payment-result-mapper.js.map +1 -0
- package/lib/commonjs/core/services/pending-session-store.js +6 -0
- package/lib/commonjs/core/services/pending-session-store.js.map +1 -0
- package/lib/commonjs/core/services/presentation-utils.js +11 -0
- package/lib/commonjs/core/services/presentation-utils.js.map +1 -0
- package/lib/commonjs/core/services/redirect-buffer.js +40 -0
- package/lib/commonjs/core/services/redirect-buffer.js.map +1 -0
- package/lib/commonjs/core/services/user-friendly-messages.js +46 -0
- package/lib/commonjs/core/services/user-friendly-messages.js.map +1 -0
- package/lib/commonjs/index.js +294 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/internal/bank-redirect.js +53 -0
- package/lib/commonjs/internal/bank-redirect.js.map +1 -0
- package/lib/commonjs/internal/deep-link-listener.js +39 -0
- package/lib/commonjs/internal/deep-link-listener.js.map +1 -0
- package/lib/commonjs/internal/event-emitter.js +36 -0
- package/lib/commonjs/internal/event-emitter.js.map +1 -0
- package/lib/commonjs/internal/index.js +34 -0
- package/lib/commonjs/internal/index.js.map +1 -0
- package/lib/commonjs/internal/logger.js +67 -0
- package/lib/commonjs/internal/logger.js.map +1 -0
- package/lib/commonjs/internal/redact-uri.js +25 -0
- package/lib/commonjs/internal/redact-uri.js.map +1 -0
- package/lib/commonjs/internal/secure-store-pending-session-store.js +92 -0
- package/lib/commonjs/internal/secure-store-pending-session-store.js.map +1 -0
- package/lib/commonjs/internal/telemetry-collector.js +80 -0
- package/lib/commonjs/internal/telemetry-collector.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/public/constants.js +21 -0
- package/lib/commonjs/public/constants.js.map +1 -0
- package/lib/commonjs/public/index.js +152 -0
- package/lib/commonjs/public/index.js.map +1 -0
- package/lib/commonjs/public/payment-result.js +48 -0
- package/lib/commonjs/public/payment-result.js.map +1 -0
- package/lib/commonjs/public/recovery-result.js +40 -0
- package/lib/commonjs/public/recovery-result.js.map +1 -0
- package/lib/commonjs/public/spare-link-callbacks.js +6 -0
- package/lib/commonjs/public/spare-link-callbacks.js.map +1 -0
- package/lib/commonjs/public/spare-link-config.js +62 -0
- package/lib/commonjs/public/spare-link-config.js.map +1 -0
- package/lib/commonjs/public/spare-link-event.js +120 -0
- package/lib/commonjs/public/spare-link-event.js.map +1 -0
- package/lib/commonjs/public/spare-link-host-api.js +6 -0
- package/lib/commonjs/public/spare-link-host-api.js.map +1 -0
- package/lib/commonjs/public/spare-link-instance.js +285 -0
- package/lib/commonjs/public/spare-link-instance.js.map +1 -0
- package/lib/commonjs/public/spare-link-session.js +26 -0
- package/lib/commonjs/public/spare-link-session.js.map +1 -0
- package/lib/commonjs/public/spare-link.js +31 -0
- package/lib/commonjs/public/spare-link.js.map +1 -0
- package/lib/commonjs/ui/consent/charge-bearer-display.js +99 -0
- package/lib/commonjs/ui/consent/charge-bearer-display.js.map +1 -0
- package/lib/commonjs/ui/consent/consent-accordion.js +94 -0
- package/lib/commonjs/ui/consent/consent-accordion.js.map +1 -0
- package/lib/commonjs/ui/consent/consent-summary-section.js +27 -0
- package/lib/commonjs/ui/consent/consent-summary-section.js.map +1 -0
- package/lib/commonjs/ui/consent/cop-information.js +168 -0
- package/lib/commonjs/ui/consent/cop-information.js.map +1 -0
- package/lib/commonjs/ui/consent/international-payment-summary.js +98 -0
- package/lib/commonjs/ui/consent/international-payment-summary.js.map +1 -0
- package/lib/commonjs/ui/consent/label-value-rows.js +59 -0
- package/lib/commonjs/ui/consent/label-value-rows.js.map +1 -0
- package/lib/commonjs/ui/consent/multi-payment-rules-list.js +130 -0
- package/lib/commonjs/ui/consent/multi-payment-rules-list.js.map +1 -0
- package/lib/commonjs/ui/consent/multi-payment-summary.js +99 -0
- package/lib/commonjs/ui/consent/multi-payment-summary.js.map +1 -0
- package/lib/commonjs/ui/consent/single-payment-summary.js +158 -0
- package/lib/commonjs/ui/consent/single-payment-summary.js.map +1 -0
- package/lib/commonjs/ui/consent/terms-link.js +35 -0
- package/lib/commonjs/ui/consent/terms-link.js.map +1 -0
- package/lib/commonjs/ui/hooks/use-payment-flow-state.js +16 -0
- package/lib/commonjs/ui/hooks/use-payment-flow-state.js.map +1 -0
- package/lib/commonjs/ui/payment-flow-page.js +235 -0
- package/lib/commonjs/ui/payment-flow-page.js.map +1 -0
- package/lib/commonjs/ui/screens/bank-selection-screen.js +215 -0
- package/lib/commonjs/ui/screens/bank-selection-screen.js.map +1 -0
- package/lib/commonjs/ui/screens/consent-details-screen.js +124 -0
- package/lib/commonjs/ui/screens/consent-details-screen.js.map +1 -0
- package/lib/commonjs/ui/screens/index.js +48 -0
- package/lib/commonjs/ui/screens/index.js.map +1 -0
- package/lib/commonjs/ui/screens/mandate-setup-success-screen.js +79 -0
- package/lib/commonjs/ui/screens/mandate-setup-success-screen.js.map +1 -0
- package/lib/commonjs/ui/screens/redirect-handoff-screen.js +42 -0
- package/lib/commonjs/ui/screens/redirect-handoff-screen.js.map +1 -0
- package/lib/commonjs/ui/screens/result-screen.js +83 -0
- package/lib/commonjs/ui/screens/result-screen.js.map +1 -0
- package/lib/commonjs/ui/screens/resume-processing-screen.js +109 -0
- package/lib/commonjs/ui/screens/resume-processing-screen.js.map +1 -0
- package/lib/commonjs/ui/spare-link-host.js +354 -0
- package/lib/commonjs/ui/spare-link-host.js.map +1 -0
- package/lib/commonjs/ui/theme/assets.js +20 -0
- package/lib/commonjs/ui/theme/assets.js.map +1 -0
- package/lib/commonjs/ui/theme/colors.js +36 -0
- package/lib/commonjs/ui/theme/colors.js.map +1 -0
- package/lib/commonjs/ui/theme/fonts.js +29 -0
- package/lib/commonjs/ui/theme/fonts.js.map +1 -0
- package/lib/commonjs/ui/theme/index.js +53 -0
- package/lib/commonjs/ui/theme/index.js.map +1 -0
- package/lib/commonjs/ui/theme/typography.js +76 -0
- package/lib/commonjs/ui/theme/typography.js.map +1 -0
- package/lib/commonjs/ui/widgets/footer.js +144 -0
- package/lib/commonjs/ui/widgets/footer.js.map +1 -0
- package/lib/commonjs/ui/widgets/gradient-spinner.js +172 -0
- package/lib/commonjs/ui/widgets/gradient-spinner.js.map +1 -0
- package/lib/commonjs/ui/widgets/handoff-screen-layout.js +77 -0
- package/lib/commonjs/ui/widgets/handoff-screen-layout.js.map +1 -0
- package/lib/commonjs/ui/widgets/index.js +41 -0
- package/lib/commonjs/ui/widgets/index.js.map +1 -0
- package/lib/commonjs/ui/widgets/layout-w-header.js +106 -0
- package/lib/commonjs/ui/widgets/layout-w-header.js.map +1 -0
- package/lib/commonjs/ui/widgets/modal-dismiss-button.js +47 -0
- package/lib/commonjs/ui/widgets/modal-dismiss-button.js.map +1 -0
- package/lib/commonjs/ui/widgets/stepper.js +124 -0
- package/lib/commonjs/ui/widgets/stepper.js.map +1 -0
- package/lib/commonjs/version.js +14 -0
- package/lib/commonjs/version.js.map +1 -0
- package/lib/module/core/client/link-api-client.js +292 -0
- package/lib/module/core/client/link-api-client.js.map +1 -0
- package/lib/module/core/errors/payment-api-error.js +29 -0
- package/lib/module/core/errors/payment-api-error.js.map +1 -0
- package/lib/module/core/models/index.js +2 -0
- package/lib/module/core/models/index.js.map +1 -0
- package/lib/module/core/models/link-session-status.js +10 -0
- package/lib/module/core/models/link-session-status.js.map +1 -0
- package/lib/module/core/models/payment-return-params.js +37 -0
- package/lib/module/core/models/payment-return-params.js.map +1 -0
- package/lib/module/core/models/payment-type.js +36 -0
- package/lib/module/core/models/payment-type.js.map +1 -0
- package/lib/module/core/models/wire-mappers.js +263 -0
- package/lib/module/core/models/wire-mappers.js.map +1 -0
- package/lib/module/core/services/consent-presenter.js +140 -0
- package/lib/module/core/services/consent-presenter.js.map +1 -0
- package/lib/module/core/services/execute-resume-if-needed.js +211 -0
- package/lib/module/core/services/execute-resume-if-needed.js.map +1 -0
- package/lib/module/core/services/multi-payment-rules-presenter.js +146 -0
- package/lib/module/core/services/multi-payment-rules-presenter.js.map +1 -0
- package/lib/module/core/services/payment-flow-controller.js +544 -0
- package/lib/module/core/services/payment-flow-controller.js.map +1 -0
- package/lib/module/core/services/payment-flow-state.js +106 -0
- package/lib/module/core/services/payment-flow-state.js.map +1 -0
- package/lib/module/core/services/payment-result-mapper.js +45 -0
- package/lib/module/core/services/payment-result-mapper.js.map +1 -0
- package/lib/module/core/services/pending-session-store.js +4 -0
- package/lib/module/core/services/pending-session-store.js.map +1 -0
- package/lib/module/core/services/presentation-utils.js +7 -0
- package/lib/module/core/services/presentation-utils.js.map +1 -0
- package/lib/module/core/services/redirect-buffer.js +33 -0
- package/lib/module/core/services/redirect-buffer.js.map +1 -0
- package/lib/module/core/services/user-friendly-messages.js +42 -0
- package/lib/module/core/services/user-friendly-messages.js.map +1 -0
- package/lib/module/index.js +40 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/internal/bank-redirect.js +49 -0
- package/lib/module/internal/bank-redirect.js.map +1 -0
- package/lib/module/internal/deep-link-listener.js +34 -0
- package/lib/module/internal/deep-link-listener.js.map +1 -0
- package/lib/module/internal/event-emitter.js +32 -0
- package/lib/module/internal/event-emitter.js.map +1 -0
- package/lib/module/internal/index.js +7 -0
- package/lib/module/internal/index.js.map +1 -0
- package/lib/module/internal/logger.js +61 -0
- package/lib/module/internal/logger.js.map +1 -0
- package/lib/module/internal/redact-uri.js +21 -0
- package/lib/module/internal/redact-uri.js.map +1 -0
- package/lib/module/internal/secure-store-pending-session-store.js +88 -0
- package/lib/module/internal/secure-store-pending-session-store.js.map +1 -0
- package/lib/module/internal/telemetry-collector.js +75 -0
- package/lib/module/internal/telemetry-collector.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/public/constants.js +17 -0
- package/lib/module/public/constants.js.map +1 -0
- package/lib/module/public/index.js +11 -0
- package/lib/module/public/index.js.map +1 -0
- package/lib/module/public/payment-result.js +41 -0
- package/lib/module/public/payment-result.js.map +1 -0
- package/lib/module/public/recovery-result.js +34 -0
- package/lib/module/public/recovery-result.js.map +1 -0
- package/lib/module/public/spare-link-callbacks.js +4 -0
- package/lib/module/public/spare-link-callbacks.js.map +1 -0
- package/lib/module/public/spare-link-config.js +54 -0
- package/lib/module/public/spare-link-config.js.map +1 -0
- package/lib/module/public/spare-link-event.js +115 -0
- package/lib/module/public/spare-link-event.js.map +1 -0
- package/lib/module/public/spare-link-host-api.js +4 -0
- package/lib/module/public/spare-link-host-api.js.map +1 -0
- package/lib/module/public/spare-link-instance.js +273 -0
- package/lib/module/public/spare-link-instance.js.map +1 -0
- package/lib/module/public/spare-link-session.js +21 -0
- package/lib/module/public/spare-link-session.js.map +1 -0
- package/lib/module/public/spare-link.js +4 -0
- package/lib/module/public/spare-link.js.map +1 -0
- package/lib/module/ui/consent/charge-bearer-display.js +95 -0
- package/lib/module/ui/consent/charge-bearer-display.js.map +1 -0
- package/lib/module/ui/consent/consent-accordion.js +90 -0
- package/lib/module/ui/consent/consent-accordion.js.map +1 -0
- package/lib/module/ui/consent/consent-summary-section.js +23 -0
- package/lib/module/ui/consent/consent-summary-section.js.map +1 -0
- package/lib/module/ui/consent/cop-information.js +165 -0
- package/lib/module/ui/consent/cop-information.js.map +1 -0
- package/lib/module/ui/consent/international-payment-summary.js +94 -0
- package/lib/module/ui/consent/international-payment-summary.js.map +1 -0
- package/lib/module/ui/consent/label-value-rows.js +55 -0
- package/lib/module/ui/consent/label-value-rows.js.map +1 -0
- package/lib/module/ui/consent/multi-payment-rules-list.js +125 -0
- package/lib/module/ui/consent/multi-payment-rules-list.js.map +1 -0
- package/lib/module/ui/consent/multi-payment-summary.js +95 -0
- package/lib/module/ui/consent/multi-payment-summary.js.map +1 -0
- package/lib/module/ui/consent/single-payment-summary.js +154 -0
- package/lib/module/ui/consent/single-payment-summary.js.map +1 -0
- package/lib/module/ui/consent/terms-link.js +31 -0
- package/lib/module/ui/consent/terms-link.js.map +1 -0
- package/lib/module/ui/hooks/use-payment-flow-state.js +12 -0
- package/lib/module/ui/hooks/use-payment-flow-state.js.map +1 -0
- package/lib/module/ui/payment-flow-page.js +232 -0
- package/lib/module/ui/payment-flow-page.js.map +1 -0
- package/lib/module/ui/screens/bank-selection-screen.js +211 -0
- package/lib/module/ui/screens/bank-selection-screen.js.map +1 -0
- package/lib/module/ui/screens/consent-details-screen.js +120 -0
- package/lib/module/ui/screens/consent-details-screen.js.map +1 -0
- package/lib/module/ui/screens/index.js +9 -0
- package/lib/module/ui/screens/index.js.map +1 -0
- package/lib/module/ui/screens/mandate-setup-success-screen.js +75 -0
- package/lib/module/ui/screens/mandate-setup-success-screen.js.map +1 -0
- package/lib/module/ui/screens/redirect-handoff-screen.js +39 -0
- package/lib/module/ui/screens/redirect-handoff-screen.js.map +1 -0
- package/lib/module/ui/screens/result-screen.js +79 -0
- package/lib/module/ui/screens/result-screen.js.map +1 -0
- package/lib/module/ui/screens/resume-processing-screen.js +105 -0
- package/lib/module/ui/screens/resume-processing-screen.js.map +1 -0
- package/lib/module/ui/spare-link-host.js +350 -0
- package/lib/module/ui/spare-link-host.js.map +1 -0
- package/lib/module/ui/theme/assets.js +16 -0
- package/lib/module/ui/theme/assets.js.map +1 -0
- package/lib/module/ui/theme/colors.js +32 -0
- package/lib/module/ui/theme/colors.js.map +1 -0
- package/lib/module/ui/theme/fonts.js +23 -0
- package/lib/module/ui/theme/fonts.js.map +1 -0
- package/lib/module/ui/theme/index.js +13 -0
- package/lib/module/ui/theme/index.js.map +1 -0
- package/lib/module/ui/theme/typography.js +49 -0
- package/lib/module/ui/theme/typography.js.map +1 -0
- package/lib/module/ui/widgets/footer.js +140 -0
- package/lib/module/ui/widgets/footer.js.map +1 -0
- package/lib/module/ui/widgets/gradient-spinner.js +168 -0
- package/lib/module/ui/widgets/gradient-spinner.js.map +1 -0
- package/lib/module/ui/widgets/handoff-screen-layout.js +73 -0
- package/lib/module/ui/widgets/handoff-screen-layout.js.map +1 -0
- package/lib/module/ui/widgets/index.js +8 -0
- package/lib/module/ui/widgets/index.js.map +1 -0
- package/lib/module/ui/widgets/layout-w-header.js +102 -0
- package/lib/module/ui/widgets/layout-w-header.js.map +1 -0
- package/lib/module/ui/widgets/modal-dismiss-button.js +43 -0
- package/lib/module/ui/widgets/modal-dismiss-button.js.map +1 -0
- package/lib/module/ui/widgets/stepper.js +120 -0
- package/lib/module/ui/widgets/stepper.js.map +1 -0
- package/lib/module/version.js +10 -0
- package/lib/module/version.js.map +1 -0
- package/lib/typescript/commonjs/core/client/link-api-client.d.ts +70 -0
- package/lib/typescript/commonjs/core/client/link-api-client.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/errors/payment-api-error.d.ts +15 -0
- package/lib/typescript/commonjs/core/errors/payment-api-error.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/models/index.d.ts +124 -0
- package/lib/typescript/commonjs/core/models/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/models/link-session-status.d.ts +6 -0
- package/lib/typescript/commonjs/core/models/link-session-status.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/models/payment-return-params.d.ts +15 -0
- package/lib/typescript/commonjs/core/models/payment-return-params.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/models/payment-type.d.ts +18 -0
- package/lib/typescript/commonjs/core/models/payment-type.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/models/wire-mappers.d.ts +19 -0
- package/lib/typescript/commonjs/core/models/wire-mappers.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/services/consent-presenter.d.ts +67 -0
- package/lib/typescript/commonjs/core/services/consent-presenter.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/services/execute-resume-if-needed.d.ts +32 -0
- package/lib/typescript/commonjs/core/services/execute-resume-if-needed.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/services/multi-payment-rules-presenter.d.ts +9 -0
- package/lib/typescript/commonjs/core/services/multi-payment-rules-presenter.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/services/payment-flow-controller.d.ts +146 -0
- package/lib/typescript/commonjs/core/services/payment-flow-controller.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/services/payment-flow-state.d.ts +64 -0
- package/lib/typescript/commonjs/core/services/payment-flow-state.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/services/payment-result-mapper.d.ts +5 -0
- package/lib/typescript/commonjs/core/services/payment-result-mapper.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/services/pending-session-store.d.ts +12 -0
- package/lib/typescript/commonjs/core/services/pending-session-store.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/services/presentation-utils.d.ts +5 -0
- package/lib/typescript/commonjs/core/services/presentation-utils.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/services/redirect-buffer.d.ts +6 -0
- package/lib/typescript/commonjs/core/services/redirect-buffer.d.ts.map +1 -0
- package/lib/typescript/commonjs/core/services/user-friendly-messages.d.ts +6 -0
- package/lib/typescript/commonjs/core/services/user-friendly-messages.d.ts.map +1 -0
- package/lib/typescript/commonjs/index.d.ts +19 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/internal/bank-redirect.d.ts +6 -0
- package/lib/typescript/commonjs/internal/bank-redirect.d.ts.map +1 -0
- package/lib/typescript/commonjs/internal/deep-link-listener.d.ts +3 -0
- package/lib/typescript/commonjs/internal/deep-link-listener.d.ts.map +1 -0
- package/lib/typescript/commonjs/internal/event-emitter.d.ts +13 -0
- package/lib/typescript/commonjs/internal/event-emitter.d.ts.map +1 -0
- package/lib/typescript/commonjs/internal/index.d.ts +5 -0
- package/lib/typescript/commonjs/internal/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/internal/logger.d.ts +23 -0
- package/lib/typescript/commonjs/internal/logger.d.ts.map +1 -0
- package/lib/typescript/commonjs/internal/redact-uri.d.ts +3 -0
- package/lib/typescript/commonjs/internal/redact-uri.d.ts.map +1 -0
- package/lib/typescript/commonjs/internal/secure-store-pending-session-store.d.ts +33 -0
- package/lib/typescript/commonjs/internal/secure-store-pending-session-store.d.ts.map +1 -0
- package/lib/typescript/commonjs/internal/telemetry-collector.d.ts +2 -0
- package/lib/typescript/commonjs/internal/telemetry-collector.d.ts.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/public/constants.d.ts +12 -0
- package/lib/typescript/commonjs/public/constants.d.ts.map +1 -0
- package/lib/typescript/commonjs/public/index.d.ts +11 -0
- package/lib/typescript/commonjs/public/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/public/payment-result.d.ts +43 -0
- package/lib/typescript/commonjs/public/payment-result.d.ts.map +1 -0
- package/lib/typescript/commonjs/public/recovery-result.d.ts +36 -0
- package/lib/typescript/commonjs/public/recovery-result.d.ts.map +1 -0
- package/lib/typescript/commonjs/public/spare-link-callbacks.d.ts +14 -0
- package/lib/typescript/commonjs/public/spare-link-callbacks.d.ts.map +1 -0
- package/lib/typescript/commonjs/public/spare-link-config.d.ts +49 -0
- package/lib/typescript/commonjs/public/spare-link-config.d.ts.map +1 -0
- package/lib/typescript/commonjs/public/spare-link-event.d.ts +90 -0
- package/lib/typescript/commonjs/public/spare-link-event.d.ts.map +1 -0
- package/lib/typescript/commonjs/public/spare-link-host-api.d.ts +29 -0
- package/lib/typescript/commonjs/public/spare-link-host-api.d.ts.map +1 -0
- package/lib/typescript/commonjs/public/spare-link-instance.d.ts +89 -0
- package/lib/typescript/commonjs/public/spare-link-instance.d.ts.map +1 -0
- package/lib/typescript/commonjs/public/spare-link-session.d.ts +20 -0
- package/lib/typescript/commonjs/public/spare-link-session.d.ts.map +1 -0
- package/lib/typescript/commonjs/public/spare-link.d.ts +3 -0
- package/lib/typescript/commonjs/public/spare-link.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/consent/charge-bearer-display.d.ts +5 -0
- package/lib/typescript/commonjs/ui/consent/charge-bearer-display.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/consent/consent-accordion.d.ts +10 -0
- package/lib/typescript/commonjs/ui/consent/consent-accordion.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/consent/consent-summary-section.d.ts +6 -0
- package/lib/typescript/commonjs/ui/consent/consent-summary-section.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/consent/cop-information.d.ts +6 -0
- package/lib/typescript/commonjs/ui/consent/cop-information.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/consent/international-payment-summary.d.ts +6 -0
- package/lib/typescript/commonjs/ui/consent/international-payment-summary.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/consent/label-value-rows.d.ts +10 -0
- package/lib/typescript/commonjs/ui/consent/label-value-rows.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/consent/multi-payment-rules-list.d.ts +15 -0
- package/lib/typescript/commonjs/ui/consent/multi-payment-rules-list.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/consent/multi-payment-summary.d.ts +6 -0
- package/lib/typescript/commonjs/ui/consent/multi-payment-summary.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/consent/single-payment-summary.d.ts +6 -0
- package/lib/typescript/commonjs/ui/consent/single-payment-summary.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/consent/terms-link.d.ts +2 -0
- package/lib/typescript/commonjs/ui/consent/terms-link.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/hooks/use-payment-flow-state.d.ts +9 -0
- package/lib/typescript/commonjs/ui/hooks/use-payment-flow-state.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/payment-flow-page.d.ts +20 -0
- package/lib/typescript/commonjs/ui/payment-flow-page.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/bank-selection-screen.d.ts +15 -0
- package/lib/typescript/commonjs/ui/screens/bank-selection-screen.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/consent-details-screen.d.ts +13 -0
- package/lib/typescript/commonjs/ui/screens/consent-details-screen.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/index.d.ts +7 -0
- package/lib/typescript/commonjs/ui/screens/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/mandate-setup-success-screen.d.ts +10 -0
- package/lib/typescript/commonjs/ui/screens/mandate-setup-success-screen.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/redirect-handoff-screen.d.ts +3 -0
- package/lib/typescript/commonjs/ui/screens/redirect-handoff-screen.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/result-screen.d.ts +7 -0
- package/lib/typescript/commonjs/ui/screens/result-screen.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/screens/resume-processing-screen.d.ts +10 -0
- package/lib/typescript/commonjs/ui/screens/resume-processing-screen.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/spare-link-host.d.ts +23 -0
- package/lib/typescript/commonjs/ui/spare-link-host.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/theme/assets.d.ts +15 -0
- package/lib/typescript/commonjs/ui/theme/assets.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/theme/colors.d.ts +31 -0
- package/lib/typescript/commonjs/ui/theme/colors.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/theme/fonts.d.ts +12 -0
- package/lib/typescript/commonjs/ui/theme/fonts.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/theme/index.d.ts +11 -0
- package/lib/typescript/commonjs/ui/theme/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/theme/typography.d.ts +12 -0
- package/lib/typescript/commonjs/ui/theme/typography.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/widgets/footer.d.ts +23 -0
- package/lib/typescript/commonjs/ui/widgets/footer.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/widgets/gradient-spinner.d.ts +13 -0
- package/lib/typescript/commonjs/ui/widgets/gradient-spinner.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/widgets/handoff-screen-layout.d.ts +11 -0
- package/lib/typescript/commonjs/ui/widgets/handoff-screen-layout.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/widgets/index.d.ts +6 -0
- package/lib/typescript/commonjs/ui/widgets/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/widgets/layout-w-header.d.ts +20 -0
- package/lib/typescript/commonjs/ui/widgets/layout-w-header.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/widgets/modal-dismiss-button.d.ts +6 -0
- package/lib/typescript/commonjs/ui/widgets/modal-dismiss-button.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/widgets/stepper.d.ts +15 -0
- package/lib/typescript/commonjs/ui/widgets/stepper.d.ts.map +1 -0
- package/lib/typescript/commonjs/version.d.ts +8 -0
- package/lib/typescript/commonjs/version.d.ts.map +1 -0
- package/lib/typescript/module/core/client/link-api-client.d.ts +70 -0
- package/lib/typescript/module/core/client/link-api-client.d.ts.map +1 -0
- package/lib/typescript/module/core/errors/payment-api-error.d.ts +15 -0
- package/lib/typescript/module/core/errors/payment-api-error.d.ts.map +1 -0
- package/lib/typescript/module/core/models/index.d.ts +124 -0
- package/lib/typescript/module/core/models/index.d.ts.map +1 -0
- package/lib/typescript/module/core/models/link-session-status.d.ts +6 -0
- package/lib/typescript/module/core/models/link-session-status.d.ts.map +1 -0
- package/lib/typescript/module/core/models/payment-return-params.d.ts +15 -0
- package/lib/typescript/module/core/models/payment-return-params.d.ts.map +1 -0
- package/lib/typescript/module/core/models/payment-type.d.ts +18 -0
- package/lib/typescript/module/core/models/payment-type.d.ts.map +1 -0
- package/lib/typescript/module/core/models/wire-mappers.d.ts +19 -0
- package/lib/typescript/module/core/models/wire-mappers.d.ts.map +1 -0
- package/lib/typescript/module/core/services/consent-presenter.d.ts +67 -0
- package/lib/typescript/module/core/services/consent-presenter.d.ts.map +1 -0
- package/lib/typescript/module/core/services/execute-resume-if-needed.d.ts +32 -0
- package/lib/typescript/module/core/services/execute-resume-if-needed.d.ts.map +1 -0
- package/lib/typescript/module/core/services/multi-payment-rules-presenter.d.ts +9 -0
- package/lib/typescript/module/core/services/multi-payment-rules-presenter.d.ts.map +1 -0
- package/lib/typescript/module/core/services/payment-flow-controller.d.ts +146 -0
- package/lib/typescript/module/core/services/payment-flow-controller.d.ts.map +1 -0
- package/lib/typescript/module/core/services/payment-flow-state.d.ts +64 -0
- package/lib/typescript/module/core/services/payment-flow-state.d.ts.map +1 -0
- package/lib/typescript/module/core/services/payment-result-mapper.d.ts +5 -0
- package/lib/typescript/module/core/services/payment-result-mapper.d.ts.map +1 -0
- package/lib/typescript/module/core/services/pending-session-store.d.ts +12 -0
- package/lib/typescript/module/core/services/pending-session-store.d.ts.map +1 -0
- package/lib/typescript/module/core/services/presentation-utils.d.ts +5 -0
- package/lib/typescript/module/core/services/presentation-utils.d.ts.map +1 -0
- package/lib/typescript/module/core/services/redirect-buffer.d.ts +6 -0
- package/lib/typescript/module/core/services/redirect-buffer.d.ts.map +1 -0
- package/lib/typescript/module/core/services/user-friendly-messages.d.ts +6 -0
- package/lib/typescript/module/core/services/user-friendly-messages.d.ts.map +1 -0
- package/lib/typescript/module/index.d.ts +19 -0
- package/lib/typescript/module/index.d.ts.map +1 -0
- package/lib/typescript/module/internal/bank-redirect.d.ts +6 -0
- package/lib/typescript/module/internal/bank-redirect.d.ts.map +1 -0
- package/lib/typescript/module/internal/deep-link-listener.d.ts +3 -0
- package/lib/typescript/module/internal/deep-link-listener.d.ts.map +1 -0
- package/lib/typescript/module/internal/event-emitter.d.ts +13 -0
- package/lib/typescript/module/internal/event-emitter.d.ts.map +1 -0
- package/lib/typescript/module/internal/index.d.ts +5 -0
- package/lib/typescript/module/internal/index.d.ts.map +1 -0
- package/lib/typescript/module/internal/logger.d.ts +23 -0
- package/lib/typescript/module/internal/logger.d.ts.map +1 -0
- package/lib/typescript/module/internal/redact-uri.d.ts +3 -0
- package/lib/typescript/module/internal/redact-uri.d.ts.map +1 -0
- package/lib/typescript/module/internal/secure-store-pending-session-store.d.ts +33 -0
- package/lib/typescript/module/internal/secure-store-pending-session-store.d.ts.map +1 -0
- package/lib/typescript/module/internal/telemetry-collector.d.ts +2 -0
- package/lib/typescript/module/internal/telemetry-collector.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/public/constants.d.ts +12 -0
- package/lib/typescript/module/public/constants.d.ts.map +1 -0
- package/lib/typescript/module/public/index.d.ts +11 -0
- package/lib/typescript/module/public/index.d.ts.map +1 -0
- package/lib/typescript/module/public/payment-result.d.ts +43 -0
- package/lib/typescript/module/public/payment-result.d.ts.map +1 -0
- package/lib/typescript/module/public/recovery-result.d.ts +36 -0
- package/lib/typescript/module/public/recovery-result.d.ts.map +1 -0
- package/lib/typescript/module/public/spare-link-callbacks.d.ts +14 -0
- package/lib/typescript/module/public/spare-link-callbacks.d.ts.map +1 -0
- package/lib/typescript/module/public/spare-link-config.d.ts +49 -0
- package/lib/typescript/module/public/spare-link-config.d.ts.map +1 -0
- package/lib/typescript/module/public/spare-link-event.d.ts +90 -0
- package/lib/typescript/module/public/spare-link-event.d.ts.map +1 -0
- package/lib/typescript/module/public/spare-link-host-api.d.ts +29 -0
- package/lib/typescript/module/public/spare-link-host-api.d.ts.map +1 -0
- package/lib/typescript/module/public/spare-link-instance.d.ts +89 -0
- package/lib/typescript/module/public/spare-link-instance.d.ts.map +1 -0
- package/lib/typescript/module/public/spare-link-session.d.ts +20 -0
- package/lib/typescript/module/public/spare-link-session.d.ts.map +1 -0
- package/lib/typescript/module/public/spare-link.d.ts +3 -0
- package/lib/typescript/module/public/spare-link.d.ts.map +1 -0
- package/lib/typescript/module/ui/consent/charge-bearer-display.d.ts +5 -0
- package/lib/typescript/module/ui/consent/charge-bearer-display.d.ts.map +1 -0
- package/lib/typescript/module/ui/consent/consent-accordion.d.ts +10 -0
- package/lib/typescript/module/ui/consent/consent-accordion.d.ts.map +1 -0
- package/lib/typescript/module/ui/consent/consent-summary-section.d.ts +6 -0
- package/lib/typescript/module/ui/consent/consent-summary-section.d.ts.map +1 -0
- package/lib/typescript/module/ui/consent/cop-information.d.ts +6 -0
- package/lib/typescript/module/ui/consent/cop-information.d.ts.map +1 -0
- package/lib/typescript/module/ui/consent/international-payment-summary.d.ts +6 -0
- package/lib/typescript/module/ui/consent/international-payment-summary.d.ts.map +1 -0
- package/lib/typescript/module/ui/consent/label-value-rows.d.ts +10 -0
- package/lib/typescript/module/ui/consent/label-value-rows.d.ts.map +1 -0
- package/lib/typescript/module/ui/consent/multi-payment-rules-list.d.ts +15 -0
- package/lib/typescript/module/ui/consent/multi-payment-rules-list.d.ts.map +1 -0
- package/lib/typescript/module/ui/consent/multi-payment-summary.d.ts +6 -0
- package/lib/typescript/module/ui/consent/multi-payment-summary.d.ts.map +1 -0
- package/lib/typescript/module/ui/consent/single-payment-summary.d.ts +6 -0
- package/lib/typescript/module/ui/consent/single-payment-summary.d.ts.map +1 -0
- package/lib/typescript/module/ui/consent/terms-link.d.ts +2 -0
- package/lib/typescript/module/ui/consent/terms-link.d.ts.map +1 -0
- package/lib/typescript/module/ui/hooks/use-payment-flow-state.d.ts +9 -0
- package/lib/typescript/module/ui/hooks/use-payment-flow-state.d.ts.map +1 -0
- package/lib/typescript/module/ui/payment-flow-page.d.ts +20 -0
- package/lib/typescript/module/ui/payment-flow-page.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/bank-selection-screen.d.ts +15 -0
- package/lib/typescript/module/ui/screens/bank-selection-screen.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/consent-details-screen.d.ts +13 -0
- package/lib/typescript/module/ui/screens/consent-details-screen.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/index.d.ts +7 -0
- package/lib/typescript/module/ui/screens/index.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/mandate-setup-success-screen.d.ts +10 -0
- package/lib/typescript/module/ui/screens/mandate-setup-success-screen.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/redirect-handoff-screen.d.ts +3 -0
- package/lib/typescript/module/ui/screens/redirect-handoff-screen.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/result-screen.d.ts +7 -0
- package/lib/typescript/module/ui/screens/result-screen.d.ts.map +1 -0
- package/lib/typescript/module/ui/screens/resume-processing-screen.d.ts +10 -0
- package/lib/typescript/module/ui/screens/resume-processing-screen.d.ts.map +1 -0
- package/lib/typescript/module/ui/spare-link-host.d.ts +23 -0
- package/lib/typescript/module/ui/spare-link-host.d.ts.map +1 -0
- package/lib/typescript/module/ui/theme/assets.d.ts +15 -0
- package/lib/typescript/module/ui/theme/assets.d.ts.map +1 -0
- package/lib/typescript/module/ui/theme/colors.d.ts +31 -0
- package/lib/typescript/module/ui/theme/colors.d.ts.map +1 -0
- package/lib/typescript/module/ui/theme/fonts.d.ts +12 -0
- package/lib/typescript/module/ui/theme/fonts.d.ts.map +1 -0
- package/lib/typescript/module/ui/theme/index.d.ts +11 -0
- package/lib/typescript/module/ui/theme/index.d.ts.map +1 -0
- package/lib/typescript/module/ui/theme/typography.d.ts +12 -0
- package/lib/typescript/module/ui/theme/typography.d.ts.map +1 -0
- package/lib/typescript/module/ui/widgets/footer.d.ts +23 -0
- package/lib/typescript/module/ui/widgets/footer.d.ts.map +1 -0
- package/lib/typescript/module/ui/widgets/gradient-spinner.d.ts +13 -0
- package/lib/typescript/module/ui/widgets/gradient-spinner.d.ts.map +1 -0
- package/lib/typescript/module/ui/widgets/handoff-screen-layout.d.ts +11 -0
- package/lib/typescript/module/ui/widgets/handoff-screen-layout.d.ts.map +1 -0
- package/lib/typescript/module/ui/widgets/index.d.ts +6 -0
- package/lib/typescript/module/ui/widgets/index.d.ts.map +1 -0
- package/lib/typescript/module/ui/widgets/layout-w-header.d.ts +20 -0
- package/lib/typescript/module/ui/widgets/layout-w-header.d.ts.map +1 -0
- package/lib/typescript/module/ui/widgets/modal-dismiss-button.d.ts +6 -0
- package/lib/typescript/module/ui/widgets/modal-dismiss-button.d.ts.map +1 -0
- package/lib/typescript/module/ui/widgets/stepper.d.ts +15 -0
- package/lib/typescript/module/ui/widgets/stepper.d.ts.map +1 -0
- package/lib/typescript/module/version.d.ts +8 -0
- package/lib/typescript/module/version.d.ts.map +1 -0
- package/package.json +124 -0
- package/plugins/with-spare-link.js +98 -0
- package/src/core/client/link-api-client.ts +414 -0
- package/src/core/errors/payment-api-error.ts +35 -0
- package/src/core/models/index.ts +139 -0
- package/src/core/models/link-session-status.ts +7 -0
- package/src/core/models/payment-return-params.ts +34 -0
- package/src/core/models/payment-type.ts +54 -0
- package/src/core/models/wire-mappers.ts +315 -0
- package/src/core/services/consent-presenter.ts +213 -0
- package/src/core/services/execute-resume-if-needed.ts +243 -0
- package/src/core/services/multi-payment-rules-presenter.ts +158 -0
- package/src/core/services/payment-flow-controller.ts +607 -0
- package/src/core/services/payment-flow-state.ts +124 -0
- package/src/core/services/payment-result-mapper.ts +41 -0
- package/src/core/services/pending-session-store.ts +12 -0
- package/src/core/services/presentation-utils.ts +4 -0
- package/src/core/services/redirect-buffer.ts +34 -0
- package/src/core/services/user-friendly-messages.ts +39 -0
- package/src/index.ts +115 -0
- package/src/internal/bank-redirect.ts +61 -0
- package/src/internal/deep-link-listener.ts +31 -0
- package/src/internal/event-emitter.ts +42 -0
- package/src/internal/index.ts +4 -0
- package/src/internal/logger.ts +81 -0
- package/src/internal/redact-uri.ts +18 -0
- package/src/internal/secure-store-pending-session-store.ts +131 -0
- package/src/internal/telemetry-collector.ts +90 -0
- package/src/public/constants.ts +14 -0
- package/src/public/index.ts +80 -0
- package/src/public/payment-result.ts +61 -0
- package/src/public/recovery-result.ts +49 -0
- package/src/public/spare-link-callbacks.ts +20 -0
- package/src/public/spare-link-config.ts +87 -0
- package/src/public/spare-link-event.ts +146 -0
- package/src/public/spare-link-host-api.ts +28 -0
- package/src/public/spare-link-instance.ts +289 -0
- package/src/public/spare-link-session.ts +28 -0
- package/src/public/spare-link.ts +2 -0
- package/src/ui/consent/charge-bearer-display.tsx +68 -0
- package/src/ui/consent/consent-accordion.tsx +89 -0
- package/src/ui/consent/consent-summary-section.tsx +19 -0
- package/src/ui/consent/cop-information.tsx +121 -0
- package/src/ui/consent/international-payment-summary.tsx +83 -0
- package/src/ui/consent/label-value-rows.tsx +50 -0
- package/src/ui/consent/multi-payment-rules-list.tsx +138 -0
- package/src/ui/consent/multi-payment-summary.tsx +82 -0
- package/src/ui/consent/single-payment-summary.tsx +123 -0
- package/src/ui/consent/terms-link.tsx +27 -0
- package/src/ui/hooks/use-payment-flow-state.ts +16 -0
- package/src/ui/payment-flow-page.tsx +254 -0
- package/src/ui/screens/bank-selection-screen.tsx +209 -0
- package/src/ui/screens/consent-details-screen.tsx +106 -0
- package/src/ui/screens/index.ts +12 -0
- package/src/ui/screens/mandate-setup-success-screen.tsx +72 -0
- package/src/ui/screens/redirect-handoff-screen.tsx +33 -0
- package/src/ui/screens/result-screen.tsx +71 -0
- package/src/ui/screens/resume-processing-screen.tsx +111 -0
- package/src/ui/spare-link-host.tsx +394 -0
- package/src/ui/theme/assets.ts +17 -0
- package/src/ui/theme/colors.ts +32 -0
- package/src/ui/theme/fonts.ts +25 -0
- package/src/ui/theme/index.ts +11 -0
- package/src/ui/theme/typography.ts +47 -0
- package/src/ui/widgets/footer.tsx +138 -0
- package/src/ui/widgets/gradient-spinner.tsx +156 -0
- package/src/ui/widgets/handoff-screen-layout.tsx +70 -0
- package/src/ui/widgets/index.ts +5 -0
- package/src/ui/widgets/layout-w-header.tsx +89 -0
- package/src/ui/widgets/modal-dismiss-button.tsx +44 -0
- package/src/ui/widgets/stepper.tsx +126 -0
- package/src/version.ts +7 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["EMPTY_PROVIDERS","PaymentFlowStates","idle","phase","providers","hydrating","bankSelection","args","session","consentDetails","selectedProvider","copResponse","isCopLoading","undefined","copApplicable","redirecting","consent","awaitingCallback","providerName","succeeded","exchangeCode","linkSessionId","merchantRef","failed","errorCode","errorMessage","cancelled"],"sourceRoot":"../../../../src","sources":["core/services/payment-flow-state.ts"],"mappings":";;AAEA;;AAqCA,MAAMA,eAAkC,GAAG,EAAE;AAE7C,OAAO,MAAMC,i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B,IAAIjB,IAAI,CAACkB,YAAY,GAAG;QAAEA,YAAY,EAAElB,IAAI,CAACkB;MAAa,CAAC,GAAG,CAAC,CAAC;IAClE,CAAC;EACH,CAAC;EACDC,SAASA,CAAA,EAAqB;IAC5B,OAAO;MAAEvB,KAAK,EAAE,WAAW;MAAEC,SAAS,EAAEJ;IAAgB,CAAC;EAC3D;AACF,CAAU","ignoreList":[]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { paymentAbandoned, paymentCancelled, paymentFailed, paymentSuccess } from "../../public/payment-result.js";
|
|
4
|
+
/** Map a terminal controller state to a {@link PaymentResult}. */
|
|
5
|
+
export function paymentResultFromFlowState(state, linkToken, bankId) {
|
|
6
|
+
const resolvedBankId = bankId ?? state.selectedProvider?.id;
|
|
7
|
+
switch (state.phase) {
|
|
8
|
+
case 'succeeded':
|
|
9
|
+
return paymentSuccess({
|
|
10
|
+
linkToken,
|
|
11
|
+
...(state.exchangeCode ? {
|
|
12
|
+
exchangeCode: state.exchangeCode
|
|
13
|
+
} : {}),
|
|
14
|
+
...(state.linkSessionId ? {
|
|
15
|
+
linkSessionId: state.linkSessionId
|
|
16
|
+
} : {}),
|
|
17
|
+
...(state.merchantRef ? {
|
|
18
|
+
merchantRef: state.merchantRef
|
|
19
|
+
} : {}),
|
|
20
|
+
...(resolvedBankId ? {
|
|
21
|
+
bankId: resolvedBankId
|
|
22
|
+
} : {}),
|
|
23
|
+
resolvedAtMs: Date.now()
|
|
24
|
+
});
|
|
25
|
+
case 'failed':
|
|
26
|
+
return paymentFailed({
|
|
27
|
+
linkToken,
|
|
28
|
+
errorCode: state.errorCode ?? 'unknown_error',
|
|
29
|
+
resolvedAtMs: Date.now()
|
|
30
|
+
});
|
|
31
|
+
case 'cancelled':
|
|
32
|
+
return paymentCancelled({
|
|
33
|
+
linkToken,
|
|
34
|
+
...(resolvedBankId ? {
|
|
35
|
+
bankId: resolvedBankId
|
|
36
|
+
} : {}),
|
|
37
|
+
resolvedAtMs: Date.now()
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
return paymentAbandoned({
|
|
41
|
+
linkToken,
|
|
42
|
+
resolvedAtMs: Date.now()
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=payment-result-mapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["paymentAbandoned","paymentCancelled","paymentFailed","paymentSuccess","paymentResultFromFlowState","state","linkToken","bankId","resolvedBankId","selectedProvider","id","phase","exchangeCode","linkSessionId","merchantRef","resolvedAtMs","Date","now","errorCode"],"sourceRoot":"../../../../src","sources":["core/services/payment-result-mapper.ts"],"mappings":";;AACA,SACEA,gBAAgB,EAChBC,gBAAgB,EAChBC,aAAa,EACbC,cAAc,QACT,gCAA6B;AAGpC;AACA,OAAO,SAASC,0BAA0BA,CACxCC,KAAuB,EACvBC,SAAiB,EACjBC,MAAe,EACO;EACtB,MAAMC,cAAc,GAAGD,MAAM,IAAIF,KAAK,CAACI,gBAAgB,EAAEC,EAAE;EAC3D,QAAQL,KAAK,CAACM,KAAK;IACjB,KAAK,WAAW;MACd,OAAOR,cAAc,CAAC;QACpBG,SAAS;QACT,IAAID,KAAK,CAACO,YAAY,GAAG;UAAEA,YAAY,EAAEP,KAAK,CAACO;QAAa,CAAC,GAAG,CAAC,CAAC,CAAC;QACnE,IAAIP,KAAK,CAACQ,aAAa,GAAG;UAAEA,aAAa,EAAER,KAAK,CAACQ;QAAc,CAAC,GAAG,CAAC,CAAC,CAAC;QACtE,IAAIR,KAAK,CAACS,WAAW,GAAG;UAAEA,WAAW,EAAET,KAAK,CAACS;QAAY,CAAC,GAAG,CAAC,CAAC,CAAC;QAChE,IAAIN,cAAc,GAAG;UAAED,MAAM,EAAEC;QAAe,CAAC,GAAG,CAAC,CAAC,CAAC;QACrDO,YAAY,EAAEC,IAAI,CAACC,GAAG,CAAC;MACzB,CAAC,CAAC;IACJ,KAAK,QAAQ;MACX,OAAOf,aAAa,CAAC;QACnBI,SAAS;QACTY,SAAS,EAAEb,KAAK,CAACa,SAAS,IAAI,eAAe;QAC7CH,YAAY,EAAEC,IAAI,CAACC,GAAG,CAAC;MACzB,CAAC,CAAC;IACJ,KAAK,WAAW;MACd,OAAOhB,gBAAgB,CAAC;QACtBK,SAAS;QACT,IAAIE,cAAc,GAAG;UAAED,MAAM,EAAEC;QAAe,CAAC,GAAG,CAAC,CAAC,CAAC;QACrDO,YAAY,EAAEC,IAAI,CAACC,GAAG,CAAC;MACzB,CAAC,CAAC;EACN;EACA,OAAOjB,gBAAgB,CAAC;IAAEM,SAAS;IAAES,YAAY,EAAEC,IAAI,CAACC,GAAG,CAAC;EAAE,CAAC,CAAC;AAClE","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["core/services/pending-session-store.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["formatAmount","value","amount","currency"],"sourceRoot":"../../../../src","sources":["core/services/presentation-utils.ts"],"mappings":";;AAAA,OAAO,SAASA,YAAYA,CAACC,KAAuD,EAAU;EAC5F,IAAI,CAACA,KAAK,EAAE,OAAO,GAAG;EACtB,OAAO,GAAGA,KAAK,CAACC,MAAM,IAAID,KAAK,CAACE,QAAQ,EAAE;AAC5C","ignoreList":[]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/** Module-level buffer for a bank-return URI received before a flow is active. */
|
|
4
|
+
|
|
5
|
+
let buffered = null;
|
|
6
|
+
/** Fingerprint of the last consumed URI — blocks re-buffer after consume / double-delivery. */
|
|
7
|
+
let lastHandledUri = null;
|
|
8
|
+
export function setBufferedRedirect(uri) {
|
|
9
|
+
if (uri === buffered?.uri || uri === lastHandledUri) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
buffered = {
|
|
13
|
+
uri
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export function peekBufferedRedirect() {
|
|
17
|
+
return buffered?.uri ?? null;
|
|
18
|
+
}
|
|
19
|
+
export function consumeBufferedRedirect() {
|
|
20
|
+
const value = buffered?.uri ?? null;
|
|
21
|
+
buffered = null;
|
|
22
|
+
if (value) {
|
|
23
|
+
lastHandledUri = value;
|
|
24
|
+
}
|
|
25
|
+
return value;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** @internal Clears buffer state between tests. */
|
|
29
|
+
export function resetRedirectBufferForTests() {
|
|
30
|
+
buffered = null;
|
|
31
|
+
lastHandledUri = null;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=redirect-buffer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["buffered","lastHandledUri","setBufferedRedirect","uri","peekBufferedRedirect","consumeBufferedRedirect","value","resetRedirectBufferForTests"],"sourceRoot":"../../../../src","sources":["core/services/redirect-buffer.ts"],"mappings":";;AAAA;;AAKA,IAAIA,QAAiC,GAAG,IAAI;AAC5C;AACA,IAAIC,cAA6B,GAAG,IAAI;AAExC,OAAO,SAASC,mBAAmBA,CAACC,GAAW,EAAQ;EACrD,IAAIA,GAAG,KAAKH,QAAQ,EAAEG,GAAG,IAAIA,GAAG,KAAKF,cAAc,EAAE;IACnD;EACF;EACAD,QAAQ,GAAG;IAAEG;EAAI,CAAC;AACpB;AAEA,OAAO,SAASC,oBAAoBA,CAAA,EAAkB;EACpD,OAAOJ,QAAQ,EAAEG,GAAG,IAAI,IAAI;AAC9B;AAEA,OAAO,SAASE,uBAAuBA,CAAA,EAAkB;EACvD,MAAMC,KAAK,GAAGN,QAAQ,EAAEG,GAAG,IAAI,IAAI;EACnCH,QAAQ,GAAG,IAAI;EACf,IAAIM,KAAK,EAAE;IACTL,cAAc,GAAGK,KAAK;EACxB;EACA,OAAOA,KAAK;AACd;;AAEA;AACA,OAAO,SAASC,2BAA2BA,CAAA,EAAS;EAClDP,QAAQ,GAAG,IAAI;EACfC,cAAc,GAAG,IAAI;AACvB","ignoreList":[]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Maps machine-readable error codes to safe user-facing copy.
|
|
5
|
+
* Raw backend or bank messages must never be shown directly.
|
|
6
|
+
*/
|
|
7
|
+
export function userFriendlyMessageFor(errorCode) {
|
|
8
|
+
switch (errorCode) {
|
|
9
|
+
case 'network_timeout':
|
|
10
|
+
return 'Connection timed out. Please check your connection and try again.';
|
|
11
|
+
case 'session_expired':
|
|
12
|
+
return 'Your payment session has expired. Please start again.';
|
|
13
|
+
case 'session_cancelled':
|
|
14
|
+
return 'The payment was cancelled.';
|
|
15
|
+
case 'session_already_completed':
|
|
16
|
+
return 'This payment has already been completed.';
|
|
17
|
+
case 'invalid_token':
|
|
18
|
+
return 'The payment link is invalid or has expired.';
|
|
19
|
+
case 'bank_unavailable':
|
|
20
|
+
return 'Your bank is temporarily unavailable. Please try again later.';
|
|
21
|
+
case 'consent_creation_failed':
|
|
22
|
+
return 'Unable to initiate the payment. Please try again.';
|
|
23
|
+
case 'rate_limit_exceeded':
|
|
24
|
+
return 'Too many attempts. Please wait a moment and try again.';
|
|
25
|
+
case 'redirect_failed':
|
|
26
|
+
case 'bank_launch_failed':
|
|
27
|
+
return 'Unable to open your bank app. Please try again.';
|
|
28
|
+
case 'session_timeout':
|
|
29
|
+
return 'The payment timed out waiting for your bank. Please try again.';
|
|
30
|
+
case 'recovery_exhausted':
|
|
31
|
+
return 'This payment session could not be recovered. Please start again.';
|
|
32
|
+
case 'hydration_error':
|
|
33
|
+
case 'network_error':
|
|
34
|
+
case 'SP500':
|
|
35
|
+
return 'Your bank could not complete the payment. Please try again.';
|
|
36
|
+
case 'authorize_failed':
|
|
37
|
+
return 'Payment could not be completed. Please try again.';
|
|
38
|
+
default:
|
|
39
|
+
return 'Something went wrong. Please try again.';
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=user-friendly-messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["userFriendlyMessageFor","errorCode"],"sourceRoot":"../../../../src","sources":["core/services/user-friendly-messages.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA,OAAO,SAASA,sBAAsBA,CAACC,SAAiB,EAAU;EAChE,QAAQA,SAAS;IACf,KAAK,iBAAiB;MACpB,OAAO,mEAAmE;IAC5E,KAAK,iBAAiB;MACpB,OAAO,uDAAuD;IAChE,KAAK,mBAAmB;MACtB,OAAO,4BAA4B;IACrC,KAAK,2BAA2B;MAC9B,OAAO,0CAA0C;IACnD,KAAK,eAAe;MAClB,OAAO,6CAA6C;IACtD,KAAK,kBAAkB;MACrB,OAAO,+DAA+D;IACxE,KAAK,yBAAyB;MAC5B,OAAO,mDAAmD;IAC5D,KAAK,qBAAqB;MACxB,OAAO,wDAAwD;IACjE,KAAK,iBAAiB;IACtB,KAAK,oBAAoB;MACvB,OAAO,iDAAiD;IAC1D,KAAK,iBAAiB;MACpB,OAAO,gEAAgE;IACzE,KAAK,oBAAoB;MACvB,OAAO,kEAAkE;IAC3E,KAAK,iBAAiB;IACtB,KAAK,eAAe;IACpB,KAAK,OAAO;MACV,OAAO,6DAA6D;IACtE,KAAK,kBAAkB;MACrB,OAAO,mDAAmD;IAC5D;MACE,OAAO,yCAAyC;EACpD;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// Public exports of @spare-technologies/spare-link.
|
|
4
|
+
|
|
5
|
+
export { SDK_VERSION } from "./version.js";
|
|
6
|
+
export * from "./public/index.js";
|
|
7
|
+
|
|
8
|
+
// Errors
|
|
9
|
+
export { PaymentApiError, isPaymentApiError } from "./core/errors/payment-api-error.js";
|
|
10
|
+
|
|
11
|
+
// Models (camelCase SDK shapes)
|
|
12
|
+
|
|
13
|
+
// Bank-return URI helpers (handy for hosts implementing their own deep-link
|
|
14
|
+
// router that needs to know whether a URI belongs to the payment flow).
|
|
15
|
+
export { isPaymentReturnCallbackUri, extractPaymentReturnErrorCode } from "./core/models/payment-return-params.js";
|
|
16
|
+
|
|
17
|
+
// API client
|
|
18
|
+
export { LinkApiClient } from "./core/client/link-api-client.js";
|
|
19
|
+
|
|
20
|
+
// Controller + state machine
|
|
21
|
+
export { PaymentFlowController } from "./core/services/payment-flow-controller.js";
|
|
22
|
+
export { PaymentFlowStates } from "./core/services/payment-flow-state.js";
|
|
23
|
+
|
|
24
|
+
// Storage interface
|
|
25
|
+
|
|
26
|
+
// Consent presenter (UI helper, pure function)
|
|
27
|
+
export { presentConsent, summaryFromState, formatAmount, formatCop } from "./core/services/consent-presenter.js";
|
|
28
|
+
export { buildMultiPaymentRules, rulesSectionTitle } from "./core/services/multi-payment-rules-presenter.js";
|
|
29
|
+
export { isMultiPayment, isInternational, supportsConfirmationOfPayee, resolvedPaymentType, consentUiVariant, PaymentType } from "./core/models/payment-type.js";
|
|
30
|
+
|
|
31
|
+
// UI surface
|
|
32
|
+
export { SpareLinkHost } from "./ui/spare-link-host.js";
|
|
33
|
+
export { PaymentFlowPage } from "./ui/payment-flow-page.js";
|
|
34
|
+
export { usePaymentFlowState } from "./ui/hooks/use-payment-flow-state.js";
|
|
35
|
+
export { BankSelectionScreen, ConsentDetailsScreen, RedirectHandoffScreen, ResumeProcessingScreen, ResultScreen, MandateSetupSuccessScreen } from "./ui/screens/index.js";
|
|
36
|
+
export { Colors, Typography, Spacing, FONT_FAMILY } from "./ui/theme/index.js";
|
|
37
|
+
|
|
38
|
+
// Native platform integration
|
|
39
|
+
export { collectTelemetry, launchBankRedirect, SecureStorePendingSessionStore, useSpareLinkDeepLinks } from "./internal/index.js";
|
|
40
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["SDK_VERSION","PaymentApiError","isPaymentApiError","isPaymentReturnCallbackUri","extractPaymentReturnErrorCode","LinkApiClient","PaymentFlowController","PaymentFlowStates","presentConsent","summaryFromState","formatAmount","formatCop","buildMultiPaymentRules","rulesSectionTitle","isMultiPayment","isInternational","supportsConfirmationOfPayee","resolvedPaymentType","consentUiVariant","PaymentType","SpareLinkHost","PaymentFlowPage","usePaymentFlowState","BankSelectionScreen","ConsentDetailsScreen","RedirectHandoffScreen","ResumeProcessingScreen","ResultScreen","MandateSetupSuccessScreen","Colors","Typography","Spacing","FONT_FAMILY","collectTelemetry","launchBankRedirect","SecureStorePendingSessionStore","useSpareLinkDeepLinks"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA;;AAEA,SAASA,WAAW,QAAQ,cAAW;AAEvC,cAAc,mBAAU;;AAExB;AACA,SAASC,eAAe,EAAEC,iBAAiB,QAAQ,oCAAiC;;AAEpF;;AAoBA;AACA;AACA,SACEC,0BAA0B,EAC1BC,6BAA6B,QACxB,wCAAqC;;AAE5C;AACA,SAASC,aAAa,QAAmC,kCAA+B;;AAExF;AACA,SACEC,qBAAqB,QAGhB,4CAAyC;AAChD,SACEC,iBAAiB,QAGZ,uCAAoC;;AAE3C;;AAGA;AACA,SACEC,cAAc,EACdC,gBAAgB,EAChBC,YAAY,EACZC,SAAS,QAQJ,sCAAmC;AAE1C,SACEC,sBAAsB,EACtBC,iBAAiB,QAEZ,kDAA+C;AAEtD,SACEC,cAAc,EACdC,eAAe,EACfC,2BAA2B,EAC3BC,mBAAmB,EACnBC,gBAAgB,EAChBC,WAAW,QAEN,+BAA4B;;AAEnC;AACA,SACEC,aAAa,QAER,yBAAsB;AAC7B,SAASC,eAAe,QAAmC,2BAAwB;AACnF,SAASC,mBAAmB,QAAQ,sCAAmC;AACvE,SACEC,mBAAmB,EAEnBC,oBAAoB,EAEpBC,qBAAqB,EACrBC,sBAAsB,EAEtBC,YAAY,EAEZC,yBAAyB,QAEpB,uBAAc;AACrB,SAASC,MAAM,EAAEC,UAAU,EAAEC,OAAO,EAAEC,WAAW,QAAQ,qBAAY;;AAErE;AACA,SACEC,gBAAgB,EAChBC,kBAAkB,EAElBC,8BAA8B,EAC9BC,qBAAqB,QAChB,qBAAY","ignoreList":[]}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Bank redirect launcher. Port of Flutter `BankRedirect.launch`
|
|
5
|
+
* (lib/src/internal/bank_redirect.dart).
|
|
6
|
+
*
|
|
7
|
+
* Strategy:
|
|
8
|
+
* 1. If `mobileAppUrl` is provided (e.g. `altareq://authorize?...`), try
|
|
9
|
+
* `Linking.openURL` after checking `canOpenURL` — this launches the
|
|
10
|
+
* bank's app directly without a browser tab.
|
|
11
|
+
* 2. Otherwise (or if step 1 fails) open `authorizationUrl` via
|
|
12
|
+
* `expo-web-browser`'s in-app browser if installed; fall back to the
|
|
13
|
+
* system browser via `Linking.openURL`.
|
|
14
|
+
*/
|
|
15
|
+
import { Linking } from 'react-native';
|
|
16
|
+
import { createLogger } from "./logger.js";
|
|
17
|
+
const log = createLogger('BankRedirect');
|
|
18
|
+
async function loadWebBrowser() {
|
|
19
|
+
try {
|
|
20
|
+
return await import('expo-web-browser');
|
|
21
|
+
} catch {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export async function launchBankRedirect(args) {
|
|
26
|
+
if (args.mobileAppUrl) {
|
|
27
|
+
log.info('launch: trying mobile app deep link');
|
|
28
|
+
try {
|
|
29
|
+
const can = await Linking.canOpenURL(args.mobileAppUrl);
|
|
30
|
+
if (can) {
|
|
31
|
+
await Linking.openURL(args.mobileAppUrl);
|
|
32
|
+
log.info('launch: mobile app deep link succeeded');
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
log.warning('launch: mobile deep link unavailable — falling back to browser');
|
|
36
|
+
} catch (e) {
|
|
37
|
+
log.warning(`launch: mobile deep link failed (${e instanceof Error ? e.message : String(e)}) — falling back`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
const wb = await loadWebBrowser();
|
|
41
|
+
if (wb?.openBrowserAsync) {
|
|
42
|
+
log.info('launch: opening authorization URL in in-app browser');
|
|
43
|
+
await wb.openBrowserAsync(args.authorizationUrl);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
log.info('launch: opening authorization URL in system browser');
|
|
47
|
+
await Linking.openURL(args.authorizationUrl);
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=bank-redirect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Linking","createLogger","log","loadWebBrowser","launchBankRedirect","args","mobileAppUrl","info","can","canOpenURL","openURL","warning","e","Error","message","String","wb","openBrowserAsync","authorizationUrl"],"sourceRoot":"../../../src","sources":["internal/bank-redirect.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,cAAc;AACtC,SAASC,YAAY,QAAQ,aAAU;AAEvC,MAAMC,GAAG,GAAGD,YAAY,CAAC,cAAc,CAAC;AAWxC,eAAeE,cAAcA,CAAA,EAAmC;EAC9D,IAAI;IACF,OAAQ,MAAM,MAAM,CAAC,kBAAkB,CAAC;EAC1C,CAAC,CAAC,MAAM;IACN,OAAO,IAAI;EACb;AACF;AAEA,OAAO,eAAeC,kBAAkBA,CAACC,IAAsB,EAAiB;EAC9E,IAAIA,IAAI,CAACC,YAAY,EAAE;IACrBJ,GAAG,CAACK,IAAI,CAAC,qCAAqC,CAAC;IAC/C,IAAI;MACF,MAAMC,GAAG,GAAG,MAAMR,OAAO,CAACS,UAAU,CAACJ,IAAI,CAACC,YAAY,CAAC;MACvD,IAAIE,GAAG,EAAE;QACP,MAAMR,OAAO,CAACU,OAAO,CAACL,IAAI,CAACC,YAAY,CAAC;QACxCJ,GAAG,CAACK,IAAI,CAAC,wCAAwC,CAAC;QAClD;MACF;MACAL,GAAG,CAACS,OAAO,CAAC,gEAAgE,CAAC;IAC/E,CAAC,CAAC,OAAOC,CAAC,EAAE;MACVV,GAAG,CAACS,OAAO,CACT,oCAAoCC,CAAC,YAAYC,KAAK,GAAGD,CAAC,CAACE,OAAO,GAAGC,MAAM,CAACH,CAAC,CAAC,kBAChF,CAAC;IACH;EACF;EAEA,MAAMI,EAAE,GAAG,MAAMb,cAAc,CAAC,CAAC;EACjC,IAAIa,EAAE,EAAEC,gBAAgB,EAAE;IACxBf,GAAG,CAACK,IAAI,CAAC,qDAAqD,CAAC;IAC/D,MAAMS,EAAE,CAACC,gBAAgB,CAACZ,IAAI,CAACa,gBAAgB,CAAC;IAChD;EACF;EACAhB,GAAG,CAACK,IAAI,CAAC,qDAAqD,CAAC;EAC/D,MAAMP,OAAO,CAACU,OAAO,CAACL,IAAI,CAACa,gBAAgB,CAAC;AAC9C","ignoreList":[]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Convenience hook that wires `Linking.addEventListener('url', ...)` +
|
|
5
|
+
* `Linking.getInitialURL()` to {@link SpareLink.handleRedirect}.
|
|
6
|
+
*/
|
|
7
|
+
import { useEffect } from 'react';
|
|
8
|
+
import { Linking } from 'react-native';
|
|
9
|
+
export function useSpareLinkDeepLinks(spareLink) {
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
let removed = false;
|
|
12
|
+
let lastUrl = null;
|
|
13
|
+
const handle = url => {
|
|
14
|
+
if (url === lastUrl) return;
|
|
15
|
+
lastUrl = url;
|
|
16
|
+
void spareLink.handleRedirect(url);
|
|
17
|
+
};
|
|
18
|
+
const subscription = Linking.addEventListener('url', ({
|
|
19
|
+
url
|
|
20
|
+
}) => {
|
|
21
|
+
handle(url);
|
|
22
|
+
});
|
|
23
|
+
void Linking.getInitialURL().then(initial => {
|
|
24
|
+
if (initial && !removed) {
|
|
25
|
+
handle(initial);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
return () => {
|
|
29
|
+
removed = true;
|
|
30
|
+
subscription.remove();
|
|
31
|
+
};
|
|
32
|
+
}, [spareLink]);
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=deep-link-listener.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useEffect","Linking","useSpareLinkDeepLinks","spareLink","removed","lastUrl","handle","url","handleRedirect","subscription","addEventListener","getInitialURL","then","initial","remove"],"sourceRoot":"../../../src","sources":["internal/deep-link-listener.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,OAAO;AACjC,SAASC,OAAO,QAAQ,cAAc;AAGtC,OAAO,SAASC,qBAAqBA,CAACC,SAAoB,EAAQ;EAChEH,SAAS,CAAC,MAAM;IACd,IAAII,OAAO,GAAG,KAAK;IACnB,IAAIC,OAAsB,GAAG,IAAI;IACjC,MAAMC,MAAM,GAAIC,GAAW,IAAK;MAC9B,IAAIA,GAAG,KAAKF,OAAO,EAAE;MACrBA,OAAO,GAAGE,GAAG;MACb,KAAKJ,SAAS,CAACK,cAAc,CAACD,GAAG,CAAC;IACpC,CAAC;IACD,MAAME,YAAY,GAAGR,OAAO,CAACS,gBAAgB,CAAC,KAAK,EAAE,CAAC;MAAEH;IAAI,CAAC,KAAK;MAChED,MAAM,CAACC,GAAG,CAAC;IACb,CAAC,CAAC;IACF,KAAKN,OAAO,CAACU,aAAa,CAAC,CAAC,CAACC,IAAI,CAAEC,OAAO,IAAK;MAC7C,IAAIA,OAAO,IAAI,CAACT,OAAO,EAAE;QACvBE,MAAM,CAACO,OAAO,CAAC;MACjB;IACF,CAAC,CAAC;IACF,OAAO,MAAM;MACXT,OAAO,GAAG,IAAI;MACdK,YAAY,CAACK,MAAM,CAAC,CAAC;IACvB,CAAC;EACH,CAAC,EAAE,CAACX,SAAS,CAAC,CAAC;AACjB","ignoreList":[]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/** Minimal typed pub/sub — TypeScript equivalent of Dart's broadcast Stream. */
|
|
4
|
+
|
|
5
|
+
export function createEventEmitter() {
|
|
6
|
+
const listeners = new Set();
|
|
7
|
+
let closed = false;
|
|
8
|
+
function subscribe(listener) {
|
|
9
|
+
if (closed) return () => {};
|
|
10
|
+
listeners.add(listener);
|
|
11
|
+
return () => listeners.delete(listener);
|
|
12
|
+
}
|
|
13
|
+
return {
|
|
14
|
+
subscribe,
|
|
15
|
+
listen: subscribe,
|
|
16
|
+
emit(event) {
|
|
17
|
+
if (closed) return;
|
|
18
|
+
for (const listener of listeners) {
|
|
19
|
+
try {
|
|
20
|
+
listener(event);
|
|
21
|
+
} catch {
|
|
22
|
+
/* swallow — same as Flutter/Dart stream */
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
dispose() {
|
|
27
|
+
closed = true;
|
|
28
|
+
listeners.clear();
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=event-emitter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createEventEmitter","listeners","Set","closed","subscribe","listener","add","delete","listen","emit","event","dispose","clear"],"sourceRoot":"../../../src","sources":["internal/event-emitter.ts"],"mappings":";;AAAA;;AAUA,OAAO,SAASA,kBAAkBA,CAAA,EAGhC;EACA,MAAMC,SAAS,GAAG,IAAIC,GAAG,CAAqB,CAAC;EAC/C,IAAIC,MAAM,GAAG,KAAK;EAElB,SAASC,SAASA,CAACC,QAA4B,EAAe;IAC5D,IAAIF,MAAM,EAAE,OAAO,MAAM,CAAC,CAAC;IAC3BF,SAAS,CAACK,GAAG,CAACD,QAAQ,CAAC;IACvB,OAAO,MAAMJ,SAAS,CAACM,MAAM,CAACF,QAAQ,CAAC;EACzC;EAEA,OAAO;IACLD,SAAS;IACTI,MAAM,EAAEJ,SAAS;IACjBK,IAAIA,CAACC,KAAK,EAAE;MACV,IAAIP,MAAM,EAAE;MACZ,KAAK,MAAME,QAAQ,IAAIJ,SAAS,EAAE;QAChC,IAAI;UACFI,QAAQ,CAACK,KAAK,CAAC;QACjB,CAAC,CAAC,MAAM;UACN;QAAA;MAEJ;IACF,CAAC;IACDC,OAAOA,CAAA,EAAG;MACRR,MAAM,GAAG,IAAI;MACbF,SAAS,CAACW,KAAK,CAAC,CAAC;IACnB;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export { collectTelemetry } from "./telemetry-collector.js";
|
|
4
|
+
export { launchBankRedirect } from "./bank-redirect.js";
|
|
5
|
+
export { SecureStorePendingSessionStore } from "./secure-store-pending-session-store.js";
|
|
6
|
+
export { useSpareLinkDeepLinks } from "./deep-link-listener.js";
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["collectTelemetry","launchBankRedirect","SecureStorePendingSessionStore","useSpareLinkDeepLinks"],"sourceRoot":"../../../src","sources":["internal/index.ts"],"mappings":";;AAAA,SAASA,gBAAgB,QAAQ,0BAAuB;AACxD,SAASC,kBAAkB,QAA+B,oBAAiB;AAC3E,SAASC,8BAA8B,QAAQ,yCAAsC;AACrF,SAASC,qBAAqB,QAAQ,yBAAsB","ignoreList":[]}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const LEVEL_RANK = {
|
|
4
|
+
fine: 10,
|
|
5
|
+
info: 20,
|
|
6
|
+
warning: 30,
|
|
7
|
+
severe: 40
|
|
8
|
+
};
|
|
9
|
+
let config = null;
|
|
10
|
+
function isDevBuild() {
|
|
11
|
+
if (typeof __DEV__ === 'boolean') return __DEV__;
|
|
12
|
+
return process.env.NODE_ENV !== 'production';
|
|
13
|
+
}
|
|
14
|
+
function defaultLevel() {
|
|
15
|
+
return isDevBuild() ? 'info' : 'severe';
|
|
16
|
+
}
|
|
17
|
+
function defaultSink() {
|
|
18
|
+
return record => {
|
|
19
|
+
const line = `${record.level.toUpperCase()}: ${record.time.toISOString()}: ${record.loggerName}: ${record.message}`;
|
|
20
|
+
if (record.level === 'severe' || record.level === 'warning') {
|
|
21
|
+
console.warn(line);
|
|
22
|
+
} else {
|
|
23
|
+
console.info(line);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Configure SDK logging — mirrors Flutter `Logger.root.level` + `onRecord.listen`. */
|
|
29
|
+
export function configureSpareLinkLogging(opts) {
|
|
30
|
+
config = {
|
|
31
|
+
level: opts.level ?? defaultLevel(),
|
|
32
|
+
sink: opts.sink ?? defaultSink()
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** @internal test helper */
|
|
37
|
+
export function resetSpareLinkLoggingForTests() {
|
|
38
|
+
config = null;
|
|
39
|
+
}
|
|
40
|
+
export function createLogger(loggerName) {
|
|
41
|
+
const emit = (level, message) => {
|
|
42
|
+
const active = config ?? {
|
|
43
|
+
level: defaultLevel(),
|
|
44
|
+
sink: () => {}
|
|
45
|
+
};
|
|
46
|
+
if (LEVEL_RANK[level] < LEVEL_RANK[active.level]) return;
|
|
47
|
+
active.sink({
|
|
48
|
+
level,
|
|
49
|
+
loggerName,
|
|
50
|
+
message,
|
|
51
|
+
time: new Date()
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
return {
|
|
55
|
+
fine: m => emit('fine', m),
|
|
56
|
+
info: m => emit('info', m),
|
|
57
|
+
warning: m => emit('warning', m),
|
|
58
|
+
severe: m => emit('severe', m)
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["LEVEL_RANK","fine","info","warning","severe","config","isDevBuild","__DEV__","process","env","NODE_ENV","defaultLevel","defaultSink","record","line","level","toUpperCase","time","toISOString","loggerName","message","console","warn","configureSpareLinkLogging","opts","sink","resetSpareLinkLoggingForTests","createLogger","emit","active","Date","m"],"sourceRoot":"../../../src","sources":["internal/logger.ts"],"mappings":";;AAEA,MAAMA,UAA6C,GAAG;EACpDC,IAAI,EAAE,EAAE;EACRC,IAAI,EAAE,EAAE;EACRC,OAAO,EAAE,EAAE;EACXC,MAAM,EAAE;AACV,CAAC;AAgBD,IAAIC,MAA4B,GAAG,IAAI;AAEvC,SAASC,UAAUA,CAAA,EAAY;EAC7B,IAAI,OAAOC,OAAO,KAAK,SAAS,EAAE,OAAOA,OAAO;EAChD,OAAOC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY;AAC9C;AAEA,SAASC,YAAYA,CAAA,EAAsB;EACzC,OAAOL,UAAU,CAAC,CAAC,GAAG,MAAM,GAAG,QAAQ;AACzC;AAEA,SAASM,WAAWA,CAAA,EAAqB;EACvC,OAAQC,MAAM,IAAK;IACjB,MAAMC,IAAI,GAAG,GAAGD,MAAM,CAACE,KAAK,CAACC,WAAW,CAAC,CAAC,KAAKH,MAAM,CAACI,IAAI,CAACC,WAAW,CAAC,CAAC,KAAKL,MAAM,CAACM,UAAU,KAAKN,MAAM,CAACO,OAAO,EAAE;IACnH,IAAIP,MAAM,CAACE,KAAK,KAAK,QAAQ,IAAIF,MAAM,CAACE,KAAK,KAAK,SAAS,EAAE;MAC3DM,OAAO,CAACC,IAAI,CAACR,IAAI,CAAC;IACpB,CAAC,MAAM;MACLO,OAAO,CAACnB,IAAI,CAACY,IAAI,CAAC;IACpB;EACF,CAAC;AACH;;AAEA;AACA,OAAO,SAASS,yBAAyBA,CAACC,IAGzC,EAAQ;EACPnB,MAAM,GAAG;IACPU,KAAK,EAAES,IAAI,CAACT,KAAK,IAAIJ,YAAY,CAAC,CAAC;IACnCc,IAAI,EAAED,IAAI,CAACC,IAAI,IAAIb,WAAW,CAAC;EACjC,CAAC;AACH;;AAEA;AACA,OAAO,SAASc,6BAA6BA,CAAA,EAAS;EACpDrB,MAAM,GAAG,IAAI;AACf;AASA,OAAO,SAASsB,YAAYA,CAACR,UAAkB,EAAmB;EAChE,MAAMS,IAAI,GAAGA,CAACb,KAAwB,EAAEK,OAAe,KAAK;IAC1D,MAAMS,MAAM,GAAGxB,MAAM,IAAI;MAAEU,KAAK,EAAEJ,YAAY,CAAC,CAAC;MAAEc,IAAI,EAAEA,CAAA,KAAM,CAAC;IAAE,CAAC;IAClE,IAAIzB,UAAU,CAACe,KAAK,CAAC,GAAGf,UAAU,CAAC6B,MAAM,CAACd,KAAK,CAAC,EAAE;IAClDc,MAAM,CAACJ,IAAI,CAAC;MAAEV,KAAK;MAAEI,UAAU;MAAEC,OAAO;MAAEH,IAAI,EAAE,IAAIa,IAAI,CAAC;IAAE,CAAC,CAAC;EAC/D,CAAC;EACD,OAAO;IACL7B,IAAI,EAAG8B,CAAC,IAAKH,IAAI,CAAC,MAAM,EAAEG,CAAC,CAAC;IAC5B7B,IAAI,EAAG6B,CAAC,IAAKH,IAAI,CAAC,MAAM,EAAEG,CAAC,CAAC;IAC5B5B,OAAO,EAAG4B,CAAC,IAAKH,IAAI,CAAC,SAAS,EAAEG,CAAC,CAAC;IAClC3B,MAAM,EAAG2B,CAAC,IAAKH,IAAI,CAAC,QAAQ,EAAEG,CAAC;EACjC,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const SENSITIVE_QUERY_KEYS = new Set(['exchange_code', 'error_description']);
|
|
4
|
+
|
|
5
|
+
/** Redacts sensitive query params before logging bank-return URIs. */
|
|
6
|
+
export function redactPaymentReturnUri(uri) {
|
|
7
|
+
try {
|
|
8
|
+
const parsed = new URL(uri);
|
|
9
|
+
let changed = false;
|
|
10
|
+
for (const key of SENSITIVE_QUERY_KEYS) {
|
|
11
|
+
if (parsed.searchParams.has(key)) {
|
|
12
|
+
parsed.searchParams.set(key, '[REDACTED]');
|
|
13
|
+
changed = true;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return changed ? parsed.toString() : uri;
|
|
17
|
+
} catch {
|
|
18
|
+
return '[invalid-uri]';
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=redact-uri.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["SENSITIVE_QUERY_KEYS","Set","redactPaymentReturnUri","uri","parsed","URL","changed","key","searchParams","has","set","toString"],"sourceRoot":"../../../src","sources":["internal/redact-uri.ts"],"mappings":";;AAAA,MAAMA,oBAAoB,GAAG,IAAIC,GAAG,CAAC,CAAC,eAAe,EAAE,mBAAmB,CAAC,CAAC;;AAE5E;AACA,OAAO,SAASC,sBAAsBA,CAACC,GAAW,EAAU;EAC1D,IAAI;IACF,MAAMC,MAAM,GAAG,IAAIC,GAAG,CAACF,GAAG,CAAC;IAC3B,IAAIG,OAAO,GAAG,KAAK;IACnB,KAAK,MAAMC,GAAG,IAAIP,oBAAoB,EAAE;MACtC,IAAII,MAAM,CAACI,YAAY,CAACC,GAAG,CAACF,GAAG,CAAC,EAAE;QAChCH,MAAM,CAACI,YAAY,CAACE,GAAG,CAACH,GAAG,EAAE,YAAY,CAAC;QAC1CD,OAAO,GAAG,IAAI;MAChB;IACF;IACA,OAAOA,OAAO,GAAGF,MAAM,CAACO,QAAQ,CAAC,CAAC,GAAGR,GAAG;EAC1C,CAAC,CAAC,MAAM;IACN,OAAO,eAAe;EACxB;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Production `PendingSessionStore` backed by expo-secure-store. Persists a
|
|
5
|
+
* single in-flight payment session so the SDK can recover after cold start.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { createLogger } from "./logger.js";
|
|
9
|
+
const log = createLogger('SecureStorePendingSessionStore');
|
|
10
|
+
const KEYS = {
|
|
11
|
+
sessionId: 'spare_link_session_id',
|
|
12
|
+
bankId: 'spare_link_bank_id',
|
|
13
|
+
authUrl: 'spare_link_auth_url',
|
|
14
|
+
consentAt: 'spare_link_consent_at',
|
|
15
|
+
recoveryAttempts: 'spare_link_recovery_attempts',
|
|
16
|
+
merchantRef: 'spare_link_merchant_ref'
|
|
17
|
+
};
|
|
18
|
+
async function defaultLoader() {
|
|
19
|
+
try {
|
|
20
|
+
return await import('expo-secure-store');
|
|
21
|
+
} catch (err) {
|
|
22
|
+
throw new Error(`SecureStorePendingSessionStore requires 'expo-secure-store' — install it in your app. (${err instanceof Error ? err.message : String(err)})`);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export class SecureStorePendingSessionStore {
|
|
26
|
+
secureStore = null;
|
|
27
|
+
/**
|
|
28
|
+
* Promise chain serializing every write/clear so a `clear()` racing a
|
|
29
|
+
* partial `save()` can't leave the store in a half-written state.
|
|
30
|
+
*/
|
|
31
|
+
writeQueue = Promise.resolve();
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @param moduleLoader Optional override returning the secure-store module.
|
|
35
|
+
* Defaults to dynamically importing `expo-secure-store`.
|
|
36
|
+
* Tests inject an in-memory fake.
|
|
37
|
+
*/
|
|
38
|
+
constructor(moduleLoader = defaultLoader) {
|
|
39
|
+
this.loader = moduleLoader;
|
|
40
|
+
}
|
|
41
|
+
get module() {
|
|
42
|
+
if (!this.secureStore) this.secureStore = this.loader();
|
|
43
|
+
return this.secureStore;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** Serializes write operations so save+clear can't interleave. */
|
|
47
|
+
enqueueWrite(op) {
|
|
48
|
+
const next = this.writeQueue.then(op, op);
|
|
49
|
+
this.writeQueue = next.catch(() => {
|
|
50
|
+
// Swallow so one failure doesn't poison the queue.
|
|
51
|
+
});
|
|
52
|
+
return next;
|
|
53
|
+
}
|
|
54
|
+
save(record) {
|
|
55
|
+
return this.enqueueWrite(async () => {
|
|
56
|
+
const s = await this.module;
|
|
57
|
+
await Promise.all([s.setItemAsync(KEYS.sessionId, record.sessionId), s.setItemAsync(KEYS.bankId, record.selectedBankId), s.setItemAsync(KEYS.authUrl, record.authorizationUrl), record.consentAt !== undefined ? s.setItemAsync(KEYS.consentAt, String(record.consentAt)) : s.deleteItemAsync(KEYS.consentAt), s.setItemAsync(KEYS.recoveryAttempts, String(record.recoveryAttempts)), record.merchantRef ? s.setItemAsync(KEYS.merchantRef, record.merchantRef) : s.deleteItemAsync(KEYS.merchantRef)]);
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
async load() {
|
|
61
|
+
// Wait for any pending writes to settle so we read a consistent snapshot.
|
|
62
|
+
await this.writeQueue.catch(() => undefined);
|
|
63
|
+
const s = await this.module;
|
|
64
|
+
const [sessionId, bankId, authUrl, consentAtRaw, attemptsRaw, merchantRef] = await Promise.all([s.getItemAsync(KEYS.sessionId), s.getItemAsync(KEYS.bankId), s.getItemAsync(KEYS.authUrl), s.getItemAsync(KEYS.consentAt), s.getItemAsync(KEYS.recoveryAttempts), s.getItemAsync(KEYS.merchantRef)]);
|
|
65
|
+
if (!sessionId || !bankId || !authUrl) {
|
|
66
|
+
log.fine('load: no pending session found');
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
const consentAt = consentAtRaw ? Number(consentAtRaw) : undefined;
|
|
70
|
+
const recoveryAttempts = attemptsRaw ? Number(attemptsRaw) : 0;
|
|
71
|
+
const record = {
|
|
72
|
+
sessionId,
|
|
73
|
+
selectedBankId: bankId,
|
|
74
|
+
authorizationUrl: authUrl,
|
|
75
|
+
recoveryAttempts: Number.isFinite(recoveryAttempts) ? recoveryAttempts : 0
|
|
76
|
+
};
|
|
77
|
+
if (consentAt !== undefined && Number.isFinite(consentAt)) record.consentAt = consentAt;
|
|
78
|
+
if (merchantRef) record.merchantRef = merchantRef;
|
|
79
|
+
return record;
|
|
80
|
+
}
|
|
81
|
+
clear() {
|
|
82
|
+
return this.enqueueWrite(async () => {
|
|
83
|
+
const s = await this.module;
|
|
84
|
+
await Promise.all([s.deleteItemAsync(KEYS.sessionId), s.deleteItemAsync(KEYS.bankId), s.deleteItemAsync(KEYS.authUrl), s.deleteItemAsync(KEYS.consentAt), s.deleteItemAsync(KEYS.recoveryAttempts), s.deleteItemAsync(KEYS.merchantRef)]);
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=secure-store-pending-session-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createLogger","log","KEYS","sessionId","bankId","authUrl","consentAt","recoveryAttempts","merchantRef","defaultLoader","err","Error","message","String","SecureStorePendingSessionStore","secureStore","writeQueue","Promise","resolve","constructor","moduleLoader","loader","module","enqueueWrite","op","next","then","catch","save","record","s","all","setItemAsync","selectedBankId","authorizationUrl","undefined","deleteItemAsync","load","consentAtRaw","attemptsRaw","getItemAsync","fine","Number","isFinite","clear"],"sourceRoot":"../../../src","sources":["internal/secure-store-pending-session-store.ts"],"mappings":";;AAAA;AACA;AACA;AACA;;AAIA,SAASA,YAAY,QAAQ,aAAU;AAEvC,MAAMC,GAAG,GAAGD,YAAY,CAAC,gCAAgC,CAAC;AAE1D,MAAME,IAAI,GAAG;EACXC,SAAS,EAAE,uBAAuB;EAClCC,MAAM,EAAE,oBAAoB;EAC5BC,OAAO,EAAE,qBAAqB;EAC9BC,SAAS,EAAE,uBAAuB;EAClCC,gBAAgB,EAAE,8BAA8B;EAChDC,WAAW,EAAE;AACf,CAAU;AAQV,eAAeC,aAAaA,CAAA,EAA+B;EACzD,IAAI;IACF,OAAQ,MAAM,MAAM,CAAC,mBAAmB,CAAC;EAC3C,CAAC,CAAC,OAAOC,GAAG,EAAE;IACZ,MAAM,IAAIC,KAAK,CACb,0FACED,GAAG,YAAYC,KAAK,GAAGD,GAAG,CAACE,OAAO,GAAGC,MAAM,CAACH,GAAG,CAAC,GAEpD,CAAC;EACH;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AAC,GAAGH,SAAS;IACjE,MAAM5B,gBAAgB,GAAGgC,WAAW,GAAGG,MAAM,CAACH,WAAW,CAAC,GAAG,CAAC;IAC9D,MAAMV,MAA4B,GAAG;MACnC1B,SAAS;MACT8B,cAAc,EAAE7B,MAAM;MACtB8B,gBAAgB,EAAE7B,OAAO;MACzBE,gBAAgB,EAAEmC,MAAM,CAACC,QAAQ,CAACpC,gBAAgB,CAAC,GAAGA,gBAAgB,GAAG;IAC3E,CAAC;IACD,IAAID,SAAS,KAAK6B,SAAS,IAAIO,MAAM,CAACC,QAAQ,CAACrC,SAAS,CAAC,EAAEuB,MAAM,CAACvB,SAAS,GAAGA,SAAS;IACvF,IAAIE,WAAW,EAAEqB,MAAM,CAACrB,WAAW,GAAGA,WAAW;IACjD,OAAOqB,MAAM;EACf;EAEAe,KAAKA,CAAA,EAAkB;IACrB,OAAO,IAAI,CAACrB,YAAY,CAAC,YAAY;MACnC,MAAMO,CAAC,GAAG,MAAM,IAAI,CAACR,MAAM;MAC3B,MAAML,OAAO,CAACc,GAAG,CAAC,CAChBD,CAAC,CAACM,eAAe,CAAClC,IAAI,CAACC,SAAS,CAAC,EACjC2B,CAAC,CAACM,eAAe,CAAClC,IAAI,CAACE,MAAM,CAAC,EAC9B0B,CAAC,CAACM,eAAe,CAAClC,IAAI,CAACG,OAAO,CAAC,EAC/ByB,CAAC,CAACM,eAAe,CAAClC,IAAI,CAACI,SAAS,CAAC,EACjCwB,CAAC,CAACM,eAAe,CAAClC,IAAI,CAACK,gBAAgB,CAAC,EACxCuB,CAAC,CAACM,eAAe,CAAClC,IAAI,CAACM,WAAW,CAAC,CACpC,CAAC;IACJ,CAAC,CAAC;EACJ;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Best-effort device + geolocation telemetry collector. Each call site catches
|
|
5
|
+
* runtime failures so a permission denial or missing native module degrades
|
|
6
|
+
* to a partial payload instead of throwing.
|
|
7
|
+
*/
|
|
8
|
+
import { Platform } from 'react-native';
|
|
9
|
+
import { SDK_VERSION } from "../version.js";
|
|
10
|
+
import { createLogger } from "./logger.js";
|
|
11
|
+
const log = createLogger('TelemetryCollector');
|
|
12
|
+
const LOCATION_TIMEOUT_MS = 5_000;
|
|
13
|
+
async function loadDevice() {
|
|
14
|
+
try {
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
16
|
+
return require('expo-device');
|
|
17
|
+
} catch {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
async function loadLocation() {
|
|
22
|
+
try {
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
24
|
+
return require('expo-location');
|
|
25
|
+
} catch {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export async function collectTelemetry() {
|
|
30
|
+
log.fine('collect: gathering device telemetry');
|
|
31
|
+
const [deviceMod, locationMod] = await Promise.all([loadDevice(), loadLocation()]);
|
|
32
|
+
const payload = {
|
|
33
|
+
platform: 'react_native',
|
|
34
|
+
sdk_version: SDK_VERSION,
|
|
35
|
+
os: Platform.OS
|
|
36
|
+
};
|
|
37
|
+
const model = deviceMod?.modelName ?? null;
|
|
38
|
+
const osVersion = deviceMod?.osVersion ?? null;
|
|
39
|
+
if (model && osVersion) {
|
|
40
|
+
payload.device_fingerprint = `${model}_${osVersion}`;
|
|
41
|
+
}
|
|
42
|
+
if (locationMod) {
|
|
43
|
+
try {
|
|
44
|
+
const permission = await locationMod.requestForegroundPermissionsAsync();
|
|
45
|
+
if (permission.status === 'granted') {
|
|
46
|
+
const position = await Promise.race([locationMod.getCurrentPositionAsync({
|
|
47
|
+
accuracy: 3
|
|
48
|
+
}), new Promise(resolve => setTimeout(() => resolve(null), LOCATION_TIMEOUT_MS))]);
|
|
49
|
+
if (position) {
|
|
50
|
+
payload.geolocation = {
|
|
51
|
+
latitude: position.coords.latitude,
|
|
52
|
+
longitude: position.coords.longitude,
|
|
53
|
+
accuracy_m: position.coords.accuracy
|
|
54
|
+
};
|
|
55
|
+
} else {
|
|
56
|
+
payload.geolocation = {
|
|
57
|
+
unavailable: 'timeout'
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
} else {
|
|
61
|
+
payload.geolocation = {
|
|
62
|
+
unavailable: 'permission_denied'
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
} catch (e) {
|
|
66
|
+
log.warning(`collect: geolocation failed — ${e instanceof Error ? e.message : String(e)}`);
|
|
67
|
+
payload.geolocation = {
|
|
68
|
+
unavailable: 'error'
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
log.fine(`collect: payload keys=${Object.keys(payload).join(',')}`);
|
|
73
|
+
return payload;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=telemetry-collector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Platform","SDK_VERSION","createLogger","log","LOCATION_TIMEOUT_MS","loadDevice","require","loadLocation","collectTelemetry","fine","deviceMod","locationMod","Promise","all","payload","platform","sdk_version","os","OS","model","modelName","osVersion","device_fingerprint","permission","requestForegroundPermissionsAsync","status","position","race","getCurrentPositionAsync","accuracy","resolve","setTimeout","geolocation","latitude","coords","longitude","accuracy_m","unavailable","e","warning","Error","message","String","Object","keys","join"],"sourceRoot":"../../../src","sources":["internal/telemetry-collector.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,WAAW,QAAQ,eAAY;AACxC,SAASC,YAAY,QAAQ,aAAU;AAEvC,MAAMC,GAAG,GAAGD,YAAY,CAAC,oBAAoB,CAAC;AAE9C,MAAME,mBAAmB,GAAG,KAAK;AAcjC,eAAeC,UAAUA,CAAA,EAA+B;EACtD,IAAI;IACF;IACA,OAAOC,OAAO,CAAC,aAAa,CAAC;EAC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