@ovok/native 1.10.0 → 1.10.2
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/lib/commonjs/index.js +13 -2
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/modules/auth/delete-account-button/components/delete-account-button.js +17 -2
- package/lib/commonjs/modules/auth/delete-account-button/components/delete-account-button.js.map +1 -1
- package/lib/commonjs/modules/auth/hooks/use-auth-action.js +12 -5
- package/lib/commonjs/modules/auth/hooks/use-auth-action.js.map +1 -1
- package/lib/commonjs/modules/auth/hooks/use-session.js +1 -1
- package/lib/commonjs/modules/auth/hooks/use-session.js.map +1 -1
- package/lib/commonjs/modules/auth/hooks/use-sign-in.js +4 -4
- package/lib/commonjs/modules/auth/hooks/use-sign-in.js.map +1 -1
- package/lib/commonjs/modules/auth/hooks/use-social-sign-in.js +2 -10
- package/lib/commonjs/modules/auth/hooks/use-social-sign-in.js.map +1 -1
- package/lib/commonjs/modules/auth/index.js +11 -0
- package/lib/commonjs/modules/auth/index.js.map +1 -1
- package/lib/commonjs/modules/auth/profile/components/form-phone-country-picker.js +97 -0
- package/lib/commonjs/modules/auth/profile/components/form-phone-country-picker.js.map +1 -0
- package/lib/commonjs/modules/auth/profile/components/form-phone-field.js +21 -38
- package/lib/commonjs/modules/auth/profile/components/form-phone-field.js.map +1 -1
- package/lib/commonjs/modules/auth/profile/components/profile-form-choice-field.js +8 -1
- package/lib/commonjs/modules/auth/profile/components/profile-form-choice-field.js.map +1 -1
- package/lib/commonjs/modules/auth/profile/components/profile-form-field-component.js +2 -0
- package/lib/commonjs/modules/auth/profile/components/profile-form-field-component.js.map +1 -1
- package/lib/commonjs/modules/auth/profile/components/profile-form-provider.js +45 -35
- package/lib/commonjs/modules/auth/profile/components/profile-form-provider.js.map +1 -1
- package/lib/commonjs/modules/auth/profile/components/profile-form.js +2 -0
- package/lib/commonjs/modules/auth/profile/components/profile-form.js.map +1 -1
- package/lib/commonjs/modules/auth/profile/utils/phone-countries.js +55 -0
- package/lib/commonjs/modules/auth/profile/utils/phone-countries.js.map +1 -0
- package/lib/commonjs/modules/auth/register/components/form/inputs.js +6 -1
- package/lib/commonjs/modules/auth/register/components/form/inputs.js.map +1 -1
- package/lib/commonjs/modules/auth/register/components/form/register-form-provider.js +12 -12
- package/lib/commonjs/modules/auth/register/components/form/register-form-provider.js.map +1 -1
- package/lib/commonjs/modules/auth/reset-password/components/form/reset-password-form-provider.js +7 -6
- package/lib/commonjs/modules/auth/reset-password/components/form/reset-password-form-provider.js.map +1 -1
- package/lib/commonjs/modules/auth/session/session-errors.js +21 -0
- package/lib/commonjs/modules/auth/session/session-errors.js.map +1 -0
- package/lib/commonjs/modules/auth/session/session-store.js +54 -21
- package/lib/commonjs/modules/auth/session/session-store.js.map +1 -1
- package/lib/commonjs/modules/auth/sign-in/components/social-logins/apple-login-button.js +5 -10
- package/lib/commonjs/modules/auth/sign-in/components/social-logins/apple-login-button.js.map +1 -1
- package/lib/commonjs/modules/auth/sign-in/components/social-logins/google-login-button.js +4 -9
- package/lib/commonjs/modules/auth/sign-in/components/social-logins/google-login-button.js.map +1 -1
- package/lib/commonjs/modules/auth/utils/sign-in-error.js +4 -4
- package/lib/commonjs/modules/auth/utils/sign-in-error.js.map +1 -1
- package/lib/commonjs/modules/auth/utils/sign-out-google.js +10 -3
- package/lib/commonjs/modules/auth/utils/sign-out-google.js.map +1 -1
- package/lib/commonjs/modules/bt-device/constants/supported-device-catalog-entries.js +2 -2
- package/lib/commonjs/modules/bt-device/constants/supported-device-catalog-entries.js.map +1 -1
- package/lib/commonjs/modules/bt-device/constants/supported-devices.js +7 -3
- package/lib/commonjs/modules/bt-device/constants/supported-devices.js.map +1 -1
- package/lib/commonjs/modules/bt-management/components/bt-provider-child-wrapper.js +30 -6
- package/lib/commonjs/modules/bt-management/components/bt-provider-child-wrapper.js.map +1 -1
- package/lib/commonjs/modules/bt-management/components/bt-provider.js +12 -4
- package/lib/commonjs/modules/bt-management/components/bt-provider.js.map +1 -1
- package/lib/commonjs/modules/bt-management/components/default-permission-fallback.js +43 -3
- package/lib/commonjs/modules/bt-management/components/default-permission-fallback.js.map +1 -1
- package/lib/commonjs/modules/bt-management/hooks/declined-device-storage.js +44 -0
- package/lib/commonjs/modules/bt-management/hooks/declined-device-storage.js.map +1 -0
- package/lib/commonjs/modules/bt-management/hooks/runtime-context.js +12 -2
- package/lib/commonjs/modules/bt-management/hooks/runtime-context.js.map +1 -1
- package/lib/commonjs/modules/bt-management/hooks/use-bluetooth-permission.js +7 -0
- package/lib/commonjs/modules/bt-management/hooks/use-bluetooth-permission.js.map +1 -1
- package/lib/commonjs/modules/bt-management/hooks/use-bluetooth-state.js +11 -2
- package/lib/commonjs/modules/bt-management/hooks/use-bluetooth-state.js.map +1 -1
- package/lib/commonjs/modules/bt-management/hooks/use-nearby-device-offer.js +11 -15
- package/lib/commonjs/modules/bt-management/hooks/use-nearby-device-offer.js.map +1 -1
- package/lib/commonjs/modules/bt-management/hooks/use-request-permissions.js +3 -1
- package/lib/commonjs/modules/bt-management/hooks/use-request-permissions.js.map +1 -1
- package/lib/commonjs/modules/bt-management/index.js +12 -0
- package/lib/commonjs/modules/bt-management/index.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js +5 -2
- package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.device-names.js +4 -1
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.device-names.js.map +1 -1
- package/lib/commonjs/modules/bt-management/types/bluetooth-error.js +2 -1
- package/lib/commonjs/modules/bt-management/types/bluetooth-error.js.map +1 -1
- package/lib/commonjs/modules/bt-management/types/bluetooth-permission-status.js +2 -0
- package/lib/commonjs/modules/bt-management/types/bluetooth-permission-status.js.map +1 -0
- package/lib/commonjs/modules/helpers/form-items/form-field.js +1 -1
- package/lib/commonjs/modules/helpers/form-items/form-field.js.map +1 -1
- package/lib/commonjs/modules/progress-ring/components/progress-ring.js +94 -0
- package/lib/commonjs/modules/progress-ring/components/progress-ring.js.map +1 -0
- package/lib/commonjs/modules/progress-ring/index.js +28 -0
- package/lib/commonjs/modules/progress-ring/index.js.map +1 -0
- package/lib/commonjs/modules/progress-ring/types/progress-ring-props.js +6 -0
- package/lib/commonjs/modules/progress-ring/types/progress-ring-props.js.map +1 -0
- package/lib/commonjs/modules/ui/components/bluetooth-state-notice.js +15 -6
- package/lib/commonjs/modules/ui/components/bluetooth-state-notice.js.map +1 -1
- package/lib/commonjs/modules/ui/components/flow-frame.js +163 -0
- package/lib/commonjs/modules/ui/components/flow-frame.js.map +1 -0
- package/lib/commonjs/modules/ui/components/nearby-device-prompt.js +7 -4
- package/lib/commonjs/modules/ui/components/nearby-device-prompt.js.map +1 -1
- package/lib/commonjs/modules/ui/index.js +11 -0
- package/lib/commonjs/modules/ui/index.js.map +1 -1
- package/lib/commonjs/polyfills/index.js +12 -0
- package/lib/commonjs/polyfills/index.js.map +1 -1
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/modules/auth/delete-account-button/components/delete-account-button.js +17 -2
- package/lib/module/modules/auth/delete-account-button/components/delete-account-button.js.map +1 -1
- package/lib/module/modules/auth/hooks/use-auth-action.js +12 -5
- package/lib/module/modules/auth/hooks/use-auth-action.js.map +1 -1
- package/lib/module/modules/auth/hooks/use-session.js +1 -1
- package/lib/module/modules/auth/hooks/use-session.js.map +1 -1
- package/lib/module/modules/auth/hooks/use-sign-in.js +4 -4
- package/lib/module/modules/auth/hooks/use-sign-in.js.map +1 -1
- package/lib/module/modules/auth/hooks/use-social-sign-in.js +2 -10
- package/lib/module/modules/auth/hooks/use-social-sign-in.js.map +1 -1
- package/lib/module/modules/auth/index.js +1 -0
- package/lib/module/modules/auth/index.js.map +1 -1
- package/lib/module/modules/auth/profile/components/form-phone-country-picker.js +92 -0
- package/lib/module/modules/auth/profile/components/form-phone-country-picker.js.map +1 -0
- package/lib/module/modules/auth/profile/components/form-phone-field.js +18 -40
- package/lib/module/modules/auth/profile/components/form-phone-field.js.map +1 -1
- package/lib/module/modules/auth/profile/components/profile-form-choice-field.js +9 -2
- package/lib/module/modules/auth/profile/components/profile-form-choice-field.js.map +1 -1
- package/lib/module/modules/auth/profile/components/profile-form-field-component.js +2 -0
- package/lib/module/modules/auth/profile/components/profile-form-field-component.js.map +1 -1
- package/lib/module/modules/auth/profile/components/profile-form-provider.js +45 -35
- package/lib/module/modules/auth/profile/components/profile-form-provider.js.map +1 -1
- package/lib/module/modules/auth/profile/components/profile-form.js +2 -0
- package/lib/module/modules/auth/profile/components/profile-form.js.map +1 -1
- package/lib/module/modules/auth/profile/utils/phone-countries.js +49 -0
- package/lib/module/modules/auth/profile/utils/phone-countries.js.map +1 -0
- package/lib/module/modules/auth/register/components/form/inputs.js +6 -1
- package/lib/module/modules/auth/register/components/form/inputs.js.map +1 -1
- package/lib/module/modules/auth/register/components/form/register-form-provider.js +12 -12
- package/lib/module/modules/auth/register/components/form/register-form-provider.js.map +1 -1
- package/lib/module/modules/auth/reset-password/components/form/reset-password-form-provider.js +7 -6
- package/lib/module/modules/auth/reset-password/components/form/reset-password-form-provider.js.map +1 -1
- package/lib/module/modules/auth/session/session-errors.js +16 -0
- package/lib/module/modules/auth/session/session-errors.js.map +1 -0
- package/lib/module/modules/auth/session/session-store.js +54 -21
- package/lib/module/modules/auth/session/session-store.js.map +1 -1
- package/lib/module/modules/auth/sign-in/components/social-logins/apple-login-button.js +5 -10
- package/lib/module/modules/auth/sign-in/components/social-logins/apple-login-button.js.map +1 -1
- package/lib/module/modules/auth/sign-in/components/social-logins/google-login-button.js +4 -9
- package/lib/module/modules/auth/sign-in/components/social-logins/google-login-button.js.map +1 -1
- package/lib/module/modules/auth/utils/sign-in-error.js +4 -4
- package/lib/module/modules/auth/utils/sign-in-error.js.map +1 -1
- package/lib/module/modules/auth/utils/sign-out-google.js +10 -3
- package/lib/module/modules/auth/utils/sign-out-google.js.map +1 -1
- package/lib/module/modules/bt-device/constants/supported-device-catalog-entries.js +3 -3
- package/lib/module/modules/bt-device/constants/supported-device-catalog-entries.js.map +1 -1
- package/lib/module/modules/bt-device/constants/supported-devices.js +7 -3
- package/lib/module/modules/bt-device/constants/supported-devices.js.map +1 -1
- package/lib/module/modules/bt-management/components/bt-provider-child-wrapper.js +31 -7
- package/lib/module/modules/bt-management/components/bt-provider-child-wrapper.js.map +1 -1
- package/lib/module/modules/bt-management/components/bt-provider.js +12 -4
- package/lib/module/modules/bt-management/components/bt-provider.js.map +1 -1
- package/lib/module/modules/bt-management/components/default-permission-fallback.js +43 -4
- package/lib/module/modules/bt-management/components/default-permission-fallback.js.map +1 -1
- package/lib/module/modules/bt-management/hooks/declined-device-storage.js +39 -0
- package/lib/module/modules/bt-management/hooks/declined-device-storage.js.map +1 -0
- package/lib/module/modules/bt-management/hooks/runtime-context.js +12 -2
- package/lib/module/modules/bt-management/hooks/runtime-context.js.map +1 -1
- package/lib/module/modules/bt-management/hooks/use-bluetooth-permission.js +2 -1
- package/lib/module/modules/bt-management/hooks/use-bluetooth-permission.js.map +1 -1
- package/lib/module/modules/bt-management/hooks/use-bluetooth-state.js +11 -2
- package/lib/module/modules/bt-management/hooks/use-bluetooth-state.js.map +1 -1
- package/lib/module/modules/bt-management/hooks/use-nearby-device-offer.js +11 -15
- package/lib/module/modules/bt-management/hooks/use-nearby-device-offer.js.map +1 -1
- package/lib/module/modules/bt-management/hooks/use-request-permissions.js +3 -1
- package/lib/module/modules/bt-management/hooks/use-request-permissions.js.map +1 -1
- package/lib/module/modules/bt-management/index.js +1 -0
- package/lib/module/modules/bt-management/index.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/custom/custom.device.js +5 -2
- package/lib/module/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.device-names.js +4 -1
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.device-names.js.map +1 -1
- package/lib/module/modules/bt-management/types/bluetooth-error.js +2 -1
- package/lib/module/modules/bt-management/types/bluetooth-error.js.map +1 -1
- package/lib/module/modules/bt-management/types/bluetooth-permission-status.js +2 -0
- package/lib/module/modules/bt-management/types/bluetooth-permission-status.js.map +1 -0
- package/lib/module/modules/helpers/form-items/form-field.js +1 -1
- package/lib/module/modules/helpers/form-items/form-field.js.map +1 -1
- package/lib/module/modules/progress-ring/components/progress-ring.js +88 -0
- package/lib/module/modules/progress-ring/components/progress-ring.js.map +1 -0
- package/lib/module/modules/progress-ring/index.js +5 -0
- package/lib/module/modules/progress-ring/index.js.map +1 -0
- package/lib/module/modules/progress-ring/types/progress-ring-props.js +4 -0
- package/lib/module/modules/progress-ring/types/progress-ring-props.js.map +1 -0
- package/lib/module/modules/ui/components/bluetooth-state-notice.js +15 -6
- package/lib/module/modules/ui/components/bluetooth-state-notice.js.map +1 -1
- package/lib/module/modules/ui/components/flow-frame.js +157 -0
- package/lib/module/modules/ui/components/flow-frame.js.map +1 -0
- package/lib/module/modules/ui/components/nearby-device-prompt.js +7 -4
- package/lib/module/modules/ui/components/nearby-device-prompt.js.map +1 -1
- package/lib/module/modules/ui/index.js +1 -0
- package/lib/module/modules/ui/index.js.map +1 -1
- package/lib/module/polyfills/index.js +1 -1
- package/lib/module/polyfills/index.js.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +1 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/delete-account-button/components/delete-account-button.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/hooks/use-auth-action.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/hooks/use-social-sign-in.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/index.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/auth/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/profile/components/form-phone-country-picker.d.ts +14 -0
- package/lib/typescript/commonjs/src/modules/auth/profile/components/form-phone-country-picker.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/auth/profile/components/form-phone-field.d.ts +4 -2
- package/lib/typescript/commonjs/src/modules/auth/profile/components/form-phone-field.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/profile/components/profile-form-choice-field.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/profile/components/profile-form-field-component.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/profile/components/profile-form-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/profile/components/profile-form.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/profile/types/profile-form-field.d.ts +5 -0
- package/lib/typescript/commonjs/src/modules/auth/profile/types/profile-form-field.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/profile/types/profile-form-props.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/auth/profile/types/profile-form-props.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/profile/utils/phone-countries.d.ts +10 -0
- package/lib/typescript/commonjs/src/modules/auth/profile/utils/phone-countries.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/auth/register/components/form/inputs.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/register/components/form/register-form-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/reset-password/components/form/reset-password-form-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/session/session-errors.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/auth/session/session-errors.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/auth/session/session-store.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/sign-in/components/social-logins/apple-login-button.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/sign-in/components/social-logins/google-login-button.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/types/session.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/auth/types/session.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/utils/sign-in-error.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/auth/utils/sign-in-error.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/utils/sign-out-google.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-device-catalog-entries.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-device-catalog-entries.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-devices.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-devices.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/components/bt-provider-child-wrapper.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/components/bt-provider-child-wrapper.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/components/bt-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/components/default-permission-fallback.d.ts +3 -3
- package/lib/typescript/commonjs/src/modules/bt-management/components/default-permission-fallback.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/declined-device-storage.d.ts +5 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/declined-device-storage.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/runtime-context.d.ts +3 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/runtime-context.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-bluetooth-permission.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-bluetooth-permission.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-bluetooth-state.d.ts +3 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-bluetooth-state.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-nearby-device-offer.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-nearby-device-offer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-request-permissions.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-request-permissions.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts +2 -0
- package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-managed-device.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom.device.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.device-names.d.ts +3 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.device-names.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.duo-control-device.d.ts +2 -2
- package/lib/typescript/commonjs/src/modules/bt-management/types/bluetooth-error.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/bluetooth-permission-status.d.ts +2 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/bluetooth-permission-status.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/btprovider-children-props.d.ts +2 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/btprovider-children-props.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/btprovider-props.d.ts +9 -2
- package/lib/typescript/commonjs/src/modules/bt-management/types/btprovider-props.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-measurement.d.ts +5 -7
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-measurement.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/device-measurement-map.d.ts +2 -2
- package/lib/typescript/commonjs/src/modules/bt-management/types/device-measurement-map.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/result-callback.d.ts +7 -2
- package/lib/typescript/commonjs/src/modules/bt-management/types/result-callback.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/progress-ring/components/progress-ring.d.ts +3 -0
- package/lib/typescript/commonjs/src/modules/progress-ring/components/progress-ring.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/progress-ring/index.d.ts +3 -0
- package/lib/typescript/commonjs/src/modules/progress-ring/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/progress-ring/types/progress-ring-props.d.ts +12 -0
- package/lib/typescript/commonjs/src/modules/progress-ring/types/progress-ring-props.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/ui/components/bluetooth-state-notice.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/ui/components/flow-frame.d.ts +23 -0
- package/lib/typescript/commonjs/src/modules/ui/components/flow-frame.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/ui/components/nearby-device-prompt.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/ui/index.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/ui/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/polyfills/index.d.ts +1 -1
- package/lib/typescript/commonjs/src/polyfills/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/type-tests/result-callback.d.ts +9 -0
- package/lib/typescript/commonjs/type-tests/result-callback.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +1 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/delete-account-button/components/delete-account-button.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/hooks/use-auth-action.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/hooks/use-social-sign-in.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/index.d.ts +1 -1
- package/lib/typescript/module/src/modules/auth/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/profile/components/form-phone-country-picker.d.ts +14 -0
- package/lib/typescript/module/src/modules/auth/profile/components/form-phone-country-picker.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/auth/profile/components/form-phone-field.d.ts +4 -2
- package/lib/typescript/module/src/modules/auth/profile/components/form-phone-field.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/profile/components/profile-form-choice-field.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/profile/components/profile-form-field-component.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/profile/components/profile-form-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/profile/components/profile-form.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/profile/types/profile-form-field.d.ts +5 -0
- package/lib/typescript/module/src/modules/auth/profile/types/profile-form-field.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/profile/types/profile-form-props.d.ts +1 -1
- package/lib/typescript/module/src/modules/auth/profile/types/profile-form-props.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/profile/utils/phone-countries.d.ts +10 -0
- package/lib/typescript/module/src/modules/auth/profile/utils/phone-countries.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/auth/register/components/form/inputs.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/register/components/form/register-form-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/reset-password/components/form/reset-password-form-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/session/session-errors.d.ts +4 -0
- package/lib/typescript/module/src/modules/auth/session/session-errors.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/auth/session/session-store.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/sign-in/components/social-logins/apple-login-button.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/sign-in/components/social-logins/google-login-button.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/types/session.d.ts +1 -1
- package/lib/typescript/module/src/modules/auth/types/session.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/utils/sign-in-error.d.ts +1 -0
- package/lib/typescript/module/src/modules/auth/utils/sign-in-error.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/utils/sign-out-google.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-device/constants/supported-device-catalog-entries.d.ts +1 -1
- package/lib/typescript/module/src/modules/bt-device/constants/supported-device-catalog-entries.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-device/constants/supported-devices.d.ts +1 -1
- package/lib/typescript/module/src/modules/bt-device/constants/supported-devices.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/components/bt-provider-child-wrapper.d.ts +1 -1
- package/lib/typescript/module/src/modules/bt-management/components/bt-provider-child-wrapper.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/components/bt-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/components/default-permission-fallback.d.ts +3 -3
- package/lib/typescript/module/src/modules/bt-management/components/default-permission-fallback.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/hooks/declined-device-storage.d.ts +5 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/declined-device-storage.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/runtime-context.d.ts +3 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/runtime-context.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/hooks/use-bluetooth-permission.d.ts +1 -1
- package/lib/typescript/module/src/modules/bt-management/hooks/use-bluetooth-permission.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/hooks/use-bluetooth-state.d.ts +3 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-bluetooth-state.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/hooks/use-nearby-device-offer.d.ts +1 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-nearby-device-offer.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/hooks/use-request-permissions.d.ts +1 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-request-permissions.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/index.d.ts +2 -0
- package/lib/typescript/module/src/modules/bt-management/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-managed-device.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom.device.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.device-names.d.ts +3 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.device-names.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.duo-control-device.d.ts +2 -2
- package/lib/typescript/module/src/modules/bt-management/types/bluetooth-error.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/bluetooth-permission-status.d.ts +2 -0
- package/lib/typescript/module/src/modules/bt-management/types/bluetooth-permission-status.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/btprovider-children-props.d.ts +2 -0
- package/lib/typescript/module/src/modules/bt-management/types/btprovider-children-props.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/btprovider-props.d.ts +9 -2
- package/lib/typescript/module/src/modules/bt-management/types/btprovider-props.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/custom-measurement.d.ts +5 -7
- package/lib/typescript/module/src/modules/bt-management/types/custom-measurement.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/device-measurement-map.d.ts +2 -2
- package/lib/typescript/module/src/modules/bt-management/types/device-measurement-map.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/result-callback.d.ts +7 -2
- package/lib/typescript/module/src/modules/bt-management/types/result-callback.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/progress-ring/components/progress-ring.d.ts +3 -0
- package/lib/typescript/module/src/modules/progress-ring/components/progress-ring.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/progress-ring/index.d.ts +3 -0
- package/lib/typescript/module/src/modules/progress-ring/index.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/progress-ring/types/progress-ring-props.d.ts +12 -0
- package/lib/typescript/module/src/modules/progress-ring/types/progress-ring-props.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/ui/components/bluetooth-state-notice.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/ui/components/flow-frame.d.ts +23 -0
- package/lib/typescript/module/src/modules/ui/components/flow-frame.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/ui/components/nearby-device-prompt.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/ui/index.d.ts +1 -0
- package/lib/typescript/module/src/modules/ui/index.d.ts.map +1 -1
- package/lib/typescript/module/src/polyfills/index.d.ts +1 -1
- package/lib/typescript/module/src/polyfills/index.d.ts.map +1 -1
- package/lib/typescript/module/type-tests/result-callback.d.ts +9 -0
- package/lib/typescript/module/type-tests/result-callback.d.ts.map +1 -0
- package/package.json +5 -3
package/lib/module/modules/auth/reset-password/components/form/reset-password-form-provider.js
CHANGED
|
@@ -5,6 +5,7 @@ import { useFormik } from "formik";
|
|
|
5
5
|
import * as Yup from "yup";
|
|
6
6
|
import { useShallowStableValue } from "../../../../helpers/hooks/use-shallow-stable-value.js";
|
|
7
7
|
import { setRateLimitFormError } from "../../../utils/rate-limit.js";
|
|
8
|
+
import { parseSignInError } from "../../../utils/sign-in-error.js";
|
|
8
9
|
import { ResetPasswordFormContext } from "../../contexts/reset-password-form-context.js";
|
|
9
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
11
|
export const ResetPasswordFormProvider = ({
|
|
@@ -38,14 +39,14 @@ export const ResetPasswordFormProvider = ({
|
|
|
38
39
|
};
|
|
39
40
|
onSuccess?.(data);
|
|
40
41
|
} catch (error) {
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
const parsedError = parseSignInError(error, {
|
|
43
|
+
isSignIn: false
|
|
44
|
+
});
|
|
45
|
+
onError?.(parsedError.error);
|
|
46
|
+
if (setRateLimitFormError(parsedError.error, helpers)) {
|
|
43
47
|
return;
|
|
44
48
|
}
|
|
45
|
-
|
|
46
|
-
// TODO: fix this after backend is fixed
|
|
47
|
-
helpers.setFieldError("submit", "Something went wrong");
|
|
48
|
-
onError?.(new Error("Something went wrong"));
|
|
49
|
+
helpers.setFieldError("submit", parsedError.error.message);
|
|
49
50
|
}
|
|
50
51
|
}
|
|
51
52
|
});
|
package/lib/module/modules/auth/reset-password/components/form/reset-password-form-provider.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useClient","useFormik","Yup","useShallowStableValue","setRateLimitFormError","ResetPasswordFormContext","jsx","_jsx","ResetPasswordFormProvider","children","type","onSubmit","onSuccess","onError","client","formik","initialValues","email","submit","validationSchema","object","string","trim","lowercase","matches","required","oneOf","values","helpers","resetPassword","data","message","error","
|
|
1
|
+
{"version":3,"names":["useClient","useFormik","Yup","useShallowStableValue","setRateLimitFormError","parseSignInError","ResetPasswordFormContext","jsx","_jsx","ResetPasswordFormProvider","children","type","onSubmit","onSuccess","onError","client","formik","initialValues","email","submit","validationSchema","object","string","trim","lowercase","matches","required","oneOf","values","helpers","resetPassword","data","message","error","parsedError","isSignIn","setFieldError","contextValue","typeLocked","undefined","Provider","value"],"sourceRoot":"../../../../../../../src","sources":["modules/auth/reset-password/components/form/reset-password-form-provider.tsx"],"mappings":";;AAAA,SAASA,SAAS,QAAQ,YAAY;AACtC,SAASC,SAAS,QAAQ,QAAQ;AAClC,OAAO,KAAKC,GAAG,MAAM,KAAK;AAE1B,SAASC,qBAAqB,QAAQ,uDAAoD;AAC1F,SAASC,qBAAqB,QAAQ,8BAA2B;AACjE,SAASC,gBAAgB,QAAQ,iCAA8B;AAC/D,SAASC,wBAAwB,QAAQ,+CAA4C;AAAC,SAAAC,GAAA,IAAAC,IAAA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AEJ,OAAO,CAAC,EAAE;UAErD;QACF;QAEAA,OAAO,CAACO,aAAa,CAAC,QAAQ,EAAEF,WAAW,CAACD,KAAK,CAACD,OAAO,CAAC;MAC5D;IACF;EACF,CAAC,CAAC;EAEF,MAAMK,YAAY,GAAGlC,qBAAqB,CAAC;IACzC,GAAGa,MAAM;IACTsB,UAAU,EAAE3B,IAAI,KAAK4B;EACvB,CAAC,CAAC;EAEF,oBACE/B,IAAA,CAACF,wBAAwB,CAACkC,QAAQ;IAACC,KAAK,EAAEJ,YAAa;IAAA3B,QAAA,EACpDA;EAAQ,CACwB,CAAC;AAExC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const getHttpStatus = cause => {
|
|
4
|
+
if (!cause || typeof cause !== "object") {
|
|
5
|
+
return undefined;
|
|
6
|
+
}
|
|
7
|
+
const error = cause;
|
|
8
|
+
const status = error.status ?? error.statusCode ?? error.response?.status;
|
|
9
|
+
if (typeof status === "number") {
|
|
10
|
+
return status;
|
|
11
|
+
}
|
|
12
|
+
return error.cause === cause ? undefined : getHttpStatus(error.cause);
|
|
13
|
+
};
|
|
14
|
+
const toError = cause => cause instanceof Error ? cause : new Error(String(cause));
|
|
15
|
+
export { getHttpStatus, toError };
|
|
16
|
+
//# sourceMappingURL=session-errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getHttpStatus","cause","undefined","error","status","statusCode","response","toError","Error","String"],"sourceRoot":"../../../../../src","sources":["modules/auth/session/session-errors.ts"],"mappings":";;AAAA,MAAMA,aAAa,GAAIC,KAAc,IAAyB;EAC5D,IAAI,CAACA,KAAK,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IACvC,OAAOC,SAAS;EAClB;EAEA,MAAMC,KAAK,GAAGF,KAKb;EAED,MAAMG,MAAM,GAAGD,KAAK,CAACC,MAAM,IAAID,KAAK,CAACE,UAAU,IAAIF,KAAK,CAACG,QAAQ,EAAEF,MAAM;EAEzE,IAAI,OAAOA,MAAM,KAAK,QAAQ,EAAE;IAC9B,OAAOA,MAAM;EACf;EAEA,OAAOD,KAAK,CAACF,KAAK,KAAKA,KAAK,GAAGC,SAAS,GAAGF,aAAa,CAACG,KAAK,CAACF,KAAK,CAAC;AACvE,CAAC;AAED,MAAMM,OAAO,GAAIN,KAAc,IAC7BA,KAAK,YAAYO,KAAK,GAAGP,KAAK,GAAG,IAAIO,KAAK,CAACC,MAAM,CAACR,KAAK,CAAC,CAAC;AAE3D,SAASD,aAAa,EAAEO,OAAO","ignoreList":[]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { logoutSession } from "./logout-session.js";
|
|
4
|
+
import { getHttpStatus, toError } from "./session-errors.js";
|
|
4
5
|
const stores = new WeakMap();
|
|
5
6
|
const normalizeSession = session => {
|
|
6
7
|
const legacy = session;
|
|
@@ -17,6 +18,7 @@ const createSessionStore = client => {
|
|
|
17
18
|
let profileRequest;
|
|
18
19
|
let sessionsRequest;
|
|
19
20
|
let logoutRequest;
|
|
21
|
+
let profileNeedsRefresh = false;
|
|
20
22
|
let authRevision = 0;
|
|
21
23
|
const store = {
|
|
22
24
|
snapshot: {
|
|
@@ -38,7 +40,8 @@ const createSessionStore = client => {
|
|
|
38
40
|
return;
|
|
39
41
|
}
|
|
40
42
|
const revision = ++authRevision;
|
|
41
|
-
|
|
43
|
+
const previousSnapshot = store.snapshot;
|
|
44
|
+
if (store.snapshot.status !== "authenticated" && store.snapshot.status !== "offline") {
|
|
42
45
|
store.snapshot = {
|
|
43
46
|
...store.snapshot,
|
|
44
47
|
status: "loading",
|
|
@@ -46,7 +49,13 @@ const createSessionStore = client => {
|
|
|
46
49
|
};
|
|
47
50
|
listeners.forEach(listener => listener());
|
|
48
51
|
}
|
|
49
|
-
profileRequest ??= client.getProfileAsync().
|
|
52
|
+
profileRequest ??= (profileNeedsRefresh ? client.refetchProfile() : client.getProfileAsync()).then(profile => {
|
|
53
|
+
profileNeedsRefresh = false;
|
|
54
|
+
return profile;
|
|
55
|
+
}).catch(cause => {
|
|
56
|
+
profileNeedsRefresh = true;
|
|
57
|
+
throw cause;
|
|
58
|
+
}).finally(() => {
|
|
50
59
|
profileRequest = undefined;
|
|
51
60
|
});
|
|
52
61
|
const currentProfileRequest = profileRequest;
|
|
@@ -56,24 +65,40 @@ const createSessionStore = client => {
|
|
|
56
65
|
});
|
|
57
66
|
}
|
|
58
67
|
const currentSessionsRequest = sessionsRequest;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
68
|
+
const [profileResult, sessionsResult] = await Promise.all([currentProfileRequest.then(profile => ({
|
|
69
|
+
profile
|
|
70
|
+
}), error => ({
|
|
71
|
+
error
|
|
72
|
+
})), (includeSessions && currentSessionsRequest ? currentSessionsRequest : Promise.resolve(previousSnapshot.sessions)).then(sessions => ({
|
|
73
|
+
sessions
|
|
74
|
+
}), error => ({
|
|
75
|
+
error
|
|
76
|
+
}))]);
|
|
77
|
+
if (revision !== authRevision) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
const profile = "profile" in profileResult ? profileResult.profile : previousSnapshot.profile;
|
|
81
|
+
const sessions = "sessions" in sessionsResult ? sessionsResult.sessions : previousSnapshot.sessions;
|
|
82
|
+
const error = "error" in profileResult ? profileResult.error : "error" in sessionsResult ? sessionsResult.error : undefined;
|
|
83
|
+
if (!client.getActiveLogin() || getHttpStatus(error) === 401) {
|
|
64
84
|
store.snapshot = {
|
|
65
|
-
status: "
|
|
85
|
+
status: "signed-out",
|
|
86
|
+
sessions: [],
|
|
87
|
+
error: error === undefined ? undefined : toError(error)
|
|
88
|
+
};
|
|
89
|
+
} else if ("error" in profileResult) {
|
|
90
|
+
store.snapshot = {
|
|
91
|
+
status: "offline",
|
|
66
92
|
profile,
|
|
67
|
-
sessions: sessions.map(normalizeSession)
|
|
93
|
+
sessions: sessions.map(normalizeSession),
|
|
94
|
+
error: toError(profileResult.error)
|
|
68
95
|
};
|
|
69
|
-
}
|
|
70
|
-
if (revision !== authRevision) {
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
96
|
+
} else {
|
|
73
97
|
store.snapshot = {
|
|
74
|
-
status: "
|
|
75
|
-
|
|
76
|
-
|
|
98
|
+
status: "authenticated",
|
|
99
|
+
profile,
|
|
100
|
+
sessions: sessions.map(normalizeSession),
|
|
101
|
+
error: "error" in sessionsResult ? toError(sessionsResult.error) : undefined
|
|
77
102
|
};
|
|
78
103
|
}
|
|
79
104
|
listeners.forEach(listener => listener());
|
|
@@ -99,11 +124,19 @@ const createSessionStore = client => {
|
|
|
99
124
|
};
|
|
100
125
|
listeners.forEach(listener => listener());
|
|
101
126
|
} catch (cause) {
|
|
102
|
-
const error =
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
127
|
+
const error = toError(cause);
|
|
128
|
+
if (!client.getActiveLogin() || getHttpStatus(cause) === 401) {
|
|
129
|
+
store.snapshot = {
|
|
130
|
+
status: "signed-out",
|
|
131
|
+
sessions: [],
|
|
132
|
+
error
|
|
133
|
+
};
|
|
134
|
+
} else {
|
|
135
|
+
store.snapshot = {
|
|
136
|
+
...store.snapshot,
|
|
137
|
+
error
|
|
138
|
+
};
|
|
139
|
+
}
|
|
107
140
|
listeners.forEach(listener => listener());
|
|
108
141
|
throw error;
|
|
109
142
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["logoutSession","stores","WeakMap","normalizeSession","session","legacy","id","authMethod","remoteAddress","ip","lastUpdated","lastActiveAt","createdAt","createSessionStore","client","sessionClient","listeners","Set","profileRequest","sessionsRequest","logoutRequest","authRevision","store","snapshot","status","sessions","subscribe","listener","add","delete","refresh","includeSessions","getActiveLogin","forEach","revision","error","undefined","getProfileAsync","
|
|
1
|
+
{"version":3,"names":["logoutSession","getHttpStatus","toError","stores","WeakMap","normalizeSession","session","legacy","id","authMethod","remoteAddress","ip","lastUpdated","lastActiveAt","createdAt","createSessionStore","client","sessionClient","listeners","Set","profileRequest","sessionsRequest","logoutRequest","profileNeedsRefresh","authRevision","store","snapshot","status","sessions","subscribe","listener","add","delete","refresh","includeSessions","getActiveLogin","forEach","revision","previousSnapshot","error","undefined","refetchProfile","getProfileAsync","then","profile","catch","cause","finally","currentProfileRequest","getSessions","currentSessionsRequest","profileResult","sessionsResult","Promise","all","resolve","map","refreshSessions","logout","revokeSessions","option","getSessionStore","key","existing","get","next","set"],"sourceRoot":"../../../../../src","sources":["modules/auth/session/session-store.ts"],"mappings":";;AAIA,SAASA,aAAa,QAAQ,qBAAkB;AAChD,SAASC,aAAa,EAAEC,OAAO,QAAQ,qBAAkB;AA2BzD,MAAMC,MAAM,GAAG,IAAIC,OAAO,CAAuB,CAAC;AAElD,MAAMC,gBAAgB,GAAIC,OAA0B,IAAwB;EAC1E,MAAMC,MAAM,GAAGD,OAId;EAED,OAAO;IACLE,EAAE,EAAEF,OAAO,CAACE,EAAE;IACdC,UAAU,EAAEH,OAAO,CAACG,UAAU;IAC9BC,aAAa,EAAEJ,OAAO,CAACI,aAAa,IAAIH,MAAM,CAACI,EAAE;IACjDC,WAAW,EAAEN,OAAO,CAACM,WAAW,IAAIL,MAAM,CAACM,YAAY,IAAIN,MAAM,CAACO;EACpE,CAAC;AACH,CAAC;AAED,MAAMC,kBAAkB,GAAIC,MAAc,IAAmB;EAC3D,MAAMC,aAAa,GAAGD,MAAkC;EACxD,MAAME,SAAS,GAAG,IAAIC,GAAG,CAAa,CAAC;EACvC,IAAIC,cAA4C;EAChD,IAAIC,eAAyD;EAC7D,IAAIC,aAAwC;EAC5C,IAAIC,mBAAmB,GAAG,KAAK;EAC/B,IAAIC,YAAY,GAAG,CAAC;EAEpB,MAAMC,KAAmB,GAAG;IAC1BC,QAAQ,EAAE;MAAEC,MAAM,EAAE,SAAS;MAAEC,QAAQ,EAAE;IAAG,CAAC;IAC7C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AC0C,cAAc,CAACC,MAAM,CAAC;MAC1C,MAAMnC,KAAK,CAACQ,OAAO,CAAC,IAAI,CAAC;IAC3B;EACF,CAAC;EAED,OAAOR,KAAK;AACd,CAAC;AAED,MAAMoC,eAAe,GAAI7C,MAAc,IAAmB;EACxD,MAAM8C,GAAG,GAAG9C,MAAgB;EAC5B,MAAM+C,QAAQ,GAAG5D,MAAM,CAAC6D,GAAG,CAACF,GAAG,CAAC;EAEhC,IAAIC,QAAQ,EAAE;IACZ,OAAOA,QAAQ;EACjB;EAEA,MAAME,IAAI,GAAGlD,kBAAkB,CAACC,MAAM,CAAC;EAEvCb,MAAM,CAAC+D,GAAG,CAACJ,GAAG,EAAEG,IAAI,CAAC;EAErB,OAAOA,IAAI;AACb,CAAC;AAED,SAASJ,eAAe","ignoreList":[]}
|
|
@@ -6,6 +6,7 @@ import React from "react";
|
|
|
6
6
|
import { StyleSheet, TouchableOpacity } from "react-native";
|
|
7
7
|
import { useAppTheme } from "../../../../theme/index.js";
|
|
8
8
|
import { notifySessionChanged } from "../../../session/events.js";
|
|
9
|
+
import { parseSignInError } from "../../../utils/sign-in-error.js";
|
|
9
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
11
|
export const AppleLoginButton = ({
|
|
11
12
|
testID,
|
|
@@ -40,14 +41,8 @@ export const AppleLoginButton = ({
|
|
|
40
41
|
const data = {
|
|
41
42
|
accessToken: loginResponse.accessToken,
|
|
42
43
|
refreshToken: loginResponse.refreshToken,
|
|
43
|
-
profile:
|
|
44
|
-
|
|
45
|
-
display: loginResponse.profile.display
|
|
46
|
-
},
|
|
47
|
-
project: {
|
|
48
|
-
reference: typeof loginResponse.project.reference === "string" ? loginResponse.project.reference : loginResponse.project.reference.reference,
|
|
49
|
-
display: loginResponse.project.display
|
|
50
|
-
}
|
|
44
|
+
profile: loginResponse.profile,
|
|
45
|
+
project: loginResponse.project
|
|
51
46
|
};
|
|
52
47
|
await client.setActiveLogin(data);
|
|
53
48
|
notifySessionChanged();
|
|
@@ -55,14 +50,14 @@ export const AppleLoginButton = ({
|
|
|
55
50
|
} catch (cause) {
|
|
56
51
|
const error = cause;
|
|
57
52
|
if (error.code !== "ERR_REQUEST_CANCELED" && error.code !== "ERR_REQUEST_UNKNOWN") {
|
|
58
|
-
onError?.(error);
|
|
53
|
+
onError?.(parseSignInError(error).error);
|
|
59
54
|
}
|
|
60
55
|
} finally {
|
|
61
56
|
setIsLoading(false);
|
|
62
57
|
}
|
|
63
58
|
}, [client, internalId, onError, onSuccess]);
|
|
64
59
|
React.useEffect(() => {
|
|
65
|
-
AppleAuthentication.isAvailableAsync().then(setIsAppleLoginAvailable).catch(onError);
|
|
60
|
+
AppleAuthentication.isAvailableAsync().then(setIsAppleLoginAvailable).catch(error => onError?.(parseSignInError(error).error));
|
|
66
61
|
}, [onError]);
|
|
67
62
|
if (!isAppleLoginAvailable) {
|
|
68
63
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useClient","AppleAuthentication","React","StyleSheet","TouchableOpacity","useAppTheme","notifySessionChanged","jsx","_jsx","AppleLoginButton","testID","internalId","onSuccess","onError","style","disabled","children","props","client","theme","isAppleLoginAvailable","setIsAppleLoginAvailable","useState","isLoading","setIsLoading","handleAppleLogin","useCallback","credentials","signInAsync","requestedScopes","AppleAuthenticationScope","FULL_NAME","EMAIL","identityToken","authorizationCode","Error","loginResponse","appleLogin","email","data","accessToken","refreshToken","profile","
|
|
1
|
+
{"version":3,"names":["useClient","AppleAuthentication","React","StyleSheet","TouchableOpacity","useAppTheme","notifySessionChanged","parseSignInError","jsx","_jsx","AppleLoginButton","testID","internalId","onSuccess","onError","style","disabled","children","props","client","theme","isAppleLoginAvailable","setIsAppleLoginAvailable","useState","isLoading","setIsLoading","handleAppleLogin","useCallback","credentials","signInAsync","requestedScopes","AppleAuthenticationScope","FULL_NAME","EMAIL","identityToken","authorizationCode","Error","loginResponse","appleLogin","email","data","accessToken","refreshToken","profile","project","setActiveLogin","cause","error","code","useEffect","isAvailableAsync","then","catch","styles","container","gap","spacing","paddingVertical","backgroundColor","borderColor","dark","colors","gray","onPress","create","flexDirection","alignItems","justifyContent","flexGrow","borderWidth","hairlineWidth","borderRadius","opacity"],"sourceRoot":"../../../../../../../src","sources":["modules/auth/sign-in/components/social-logins/apple-login-button.tsx"],"mappings":";;AAAA,SAASA,SAAS,QAAQ,YAAY;AACtC,OAAO,KAAKC,mBAAmB,MAAM,2BAA2B;AAChE,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,EAAEC,gBAAgB,QAAQ,cAAc;AAE3D,SAASC,WAAW,QAAQ,4BAAmB;AAC/C,SAASC,oBAAoB,QAAQ,4BAAyB;AAC9D,SAASC,gBAAgB,QAAQ,iCAA8B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGhE,OAAO,MAAMC,gBAAgB,GAAGA,CAAC;EAC/BC,MAAM;EACNC,UAAU;EACVC,SAAS;EACTC,OAAO;EACPC,KAAK;EACLC,QAAQ;EACRC,QAAQ;EACR,GAAGC;AACqC,CAAC,KAAK;EAC9C,MAAMC,MAAM,GAAGnB,SAAS,CAAC,CAAC;EAC1B,MAAMoB,KAAK,GAAGf,WAAW,CAAC,CAAC;EAE3B,MAAM,CAACgB,qBAAqB,EAAEC,wBAAwB,CAAC,GACrDpB,KAAK,CAACqB,QAAQ,CAAC,KAAK,CAAC;EAEvB,MAAM,CAACC,SAAS,EAAEC,YAAY,CAAC,GAAGvB,KAAK,CAACqB,QAAQ,CAAC,KAAK,CAAC;EAEvD,MAAMG,gBAAgB,GAAGxB,KAAK,CAACyB,WAAW,CAAC,YAAY;IACrD,IAAI;MACFF,YAAY,CAAC,IAAI,CAAC;MAClB,MAAMG,WAAW,GAAG,MAAM3B,mBAAmB,CAAC4B,WAAW,CAAC;QACxDC,eAAe,EAAE,CACf7B,mBAAmB,CAAC8B,wBAAwB,CAACC,SAAS,EACtD/B,mBAAmB,CAAC8B,wBAAwB,CAACE,KAAK;MA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P,gBAAgB,CAACwC,KAAK,CAAC,CAACA,KAAK,CAAC,CAAC;EACxE,CAAC,EAAE,CAACjC,OAAO,CAAC,CAAC;EAEb,IAAI,CAACO,qBAAqB,EAAE;IAC1B,OAAO,IAAI;EACb;EAEA,oBACEZ,IAAA,CAACL,gBAAgB;IAAA,GACXc,KAAK;IACTH,KAAK,EAAE,CACLsC,MAAM,CAACC,SAAS,EAChB;MACEC,GAAG,EAAEnC,KAAK,CAACoC,OAAO,CAAC,CAAC,CAAC;MACrBC,eAAe,EAAErC,KAAK,CAACoC,OAAO,CAAC,CAAC,CAAC;MACjCE,eAAe,EAAE,MAAM;MACvBC,WAAW,EAAEvC,KAAK,CAACwC,IAAI,GACnBxC,KAAK,CAACyC,MAAM,CAACC,IAAI,CAAC,GAAG,CAAC,GACtB1C,KAAK,CAACyC,MAAM,CAACC,IAAI,CAAC,GAAG;IAC3B,CAAC,EACD,CAAC9C,QAAQ,IAAIQ,SAAS,KAAK6B,MAAM,CAACrC,QAAQ,EAC1CD,KAAK,CACL;IACFC,QAAQ,EAAEA,QAAQ,IAAIQ,SAAU;IAChCuC,OAAO,EAAErC,gBAAiB;IAC1Bf,MAAM,EAAEA,MAAO;IAAAM,QAAA,EAEdA;EAAQ,CACO,CAAC;AAEvB,CAAC;AAED,MAAMoC,MAAM,GAAGlD,UAAU,CAAC6D,MAAM,CAAC;EAC/BV,SAAS,EAAE;IACTW,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IACxBC,QAAQ,EAAE,CAAC;IACXC,WAAW,EAAElE,UAAU,CAACmE,aAAa;IACrCC,YAAY,EAAE;EAChB,CAAC;EACDvD,QAAQ,EAAE;IACRwD,OAAO,EAAE;EACX;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -7,6 +7,7 @@ import { StyleSheet, TouchableOpacity } from "react-native";
|
|
|
7
7
|
import { slog } from "../../../../helpers/index.js";
|
|
8
8
|
import { useAppTheme } from "../../../../theme/index.js";
|
|
9
9
|
import { notifySessionChanged } from "../../../session/events.js";
|
|
10
|
+
import { parseSignInError } from "../../../utils/sign-in-error.js";
|
|
10
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
12
|
export const GoogleLoginButton = ({
|
|
12
13
|
googleIosClientId,
|
|
@@ -51,21 +52,15 @@ export const GoogleLoginButton = ({
|
|
|
51
52
|
const data = {
|
|
52
53
|
accessToken: loginResponse.accessToken,
|
|
53
54
|
refreshToken: loginResponse.refreshToken,
|
|
54
|
-
profile:
|
|
55
|
-
|
|
56
|
-
display: loginResponse.profile.display
|
|
57
|
-
},
|
|
58
|
-
project: {
|
|
59
|
-
reference: typeof loginResponse.project.reference === "string" ? loginResponse.project.reference : loginResponse.project.reference.reference,
|
|
60
|
-
display: loginResponse.project.display
|
|
61
|
-
}
|
|
55
|
+
profile: loginResponse.profile,
|
|
56
|
+
project: loginResponse.project
|
|
62
57
|
};
|
|
63
58
|
await client.setActiveLogin(data);
|
|
64
59
|
notifySessionChanged();
|
|
65
60
|
onSuccess?.(loginResponse);
|
|
66
61
|
} catch (error) {
|
|
67
62
|
if (!isCancelledResponse(error)) {
|
|
68
|
-
onError?.(error);
|
|
63
|
+
onError?.(parseSignInError(error).error);
|
|
69
64
|
}
|
|
70
65
|
} finally {
|
|
71
66
|
setIsLoading(false);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useClient","GoogleSignin","isCancelledResponse","isSuccessResponse","React","StyleSheet","TouchableOpacity","slog","useAppTheme","notifySessionChanged","jsx","_jsx","GoogleLoginButton","googleIosClientId","googleWebClientId","internalId","onSuccess","onError","testID","style","disabled","children","props","theme","client","isConfigured","setIsConfigured","useState","isLoading","setIsLoading","isDisabled","handleGetIdToken","useCallback","hasPlayServices","Error","response","signIn","tokens","getTokens","idToken","handleGoogleSignIn","loginResponse","googleLogin","data","accessToken","refreshToken","profile","
|
|
1
|
+
{"version":3,"names":["useClient","GoogleSignin","isCancelledResponse","isSuccessResponse","React","StyleSheet","TouchableOpacity","slog","useAppTheme","notifySessionChanged","parseSignInError","jsx","_jsx","GoogleLoginButton","googleIosClientId","googleWebClientId","internalId","onSuccess","onError","testID","style","disabled","children","props","theme","client","isConfigured","setIsConfigured","useState","isLoading","setIsLoading","isDisabled","handleGetIdToken","useCallback","hasPlayServices","Error","response","signIn","tokens","getTokens","idToken","handleGoogleSignIn","loginResponse","googleLogin","data","accessToken","refreshToken","profile","project","setActiveLogin","error","useEffect","configure","iosClientId","webClientId","styles","container","gap","spacing","paddingVertical","backgroundColor","dark","borderColor","colors","gray","onPress","create","flexDirection","alignItems","justifyContent","flexGrow","borderWidth","hairlineWidth","borderRadius","opacity"],"sourceRoot":"../../../../../../../src","sources":["modules/auth/sign-in/components/social-logins/google-login-button.tsx"],"mappings":";;AAAA,SAASA,SAAS,QAAQ,YAAY;AACtC,SACEC,YAAY,EAEZC,mBAAmB,EACnBC,iBAAiB,QACZ,2CAA2C;AAClD,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,UAAU,EAAEC,gBAAgB,QAAQ,cAAc;AAE3D,SAASC,IAAI,QAAQ,8BAAqB;AAC1C,SAASC,WAAW,QAAQ,4BAAmB;AAC/C,SAASC,oBAAoB,QAAQ,4BAAyB;AAC9D,SAASC,gBAAgB,QAAQ,iCAA8B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGhE,OAAO,MAAMC,iBAAiB,GAAGA,CAAC;EAChCC,iBAAiB;EACjBC,iBAAiB;EACjBC,UAAU;EACVC,SAAS;EACTC,OAAO;EACPC,MAAM;EACNC,KAAK;EACLC,QAAQ;EACRC,QAAQ;EACR,GAAGC;AACsC,CAAC,KAAK;EAC/C,MAAMC,KAAK,GAAGhB,WAAW,CAAC,CAAC;EAC3B,MAAMiB,MAAM,GAAGzB,SAAS,CAAC,CAAC;EAE1B,MAAM,CAAC0B,YAAY,EAAEC,eAAe,CAAC,GAAGvB,KAAK,CAACwB,QAAQ,CA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AC7BD,KAAK,CACL;IACFC,QAAQ,EAAEU,UAAW;IACrBkC,OAAO,EAAExB,kBAAmB;IAC5BtB,MAAM,EAAEA,MAAO;IAAAG,QAAA,EAEdA;EAAQ,CACO,CAAC;AAEvB,CAAC;AAED,MAAMiC,MAAM,GAAGlD,UAAU,CAAC6D,MAAM,CAAC;EAC/BV,SAAS,EAAE;IACTW,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IACxBC,QAAQ,EAAE,CAAC;IACXC,WAAW,EAAElE,UAAU,CAACmE,aAAa;IACrCC,YAAY,EAAE;EAChB,CAAC;EACDpD,QAAQ,EAAE;IACRqD,OAAO,EAAE;EACX;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -19,14 +19,14 @@ const stringValue = (...values) => {
|
|
|
19
19
|
const value = values.find(candidate => typeof candidate === "string" && candidate.length > 0);
|
|
20
20
|
return typeof value === "string" ? value : undefined;
|
|
21
21
|
};
|
|
22
|
-
const messageKeyForStatus = (status, isMfaVerification) => {
|
|
22
|
+
const messageKeyForStatus = (status, isMfaVerification, isSignIn) => {
|
|
23
23
|
switch (status) {
|
|
24
24
|
case 400:
|
|
25
25
|
case 401:
|
|
26
|
-
return isMfaVerification ? "sign-in.mfa.invalid" : "sign-in.errors.invalid-credentials";
|
|
26
|
+
return isSignIn ? isMfaVerification ? "sign-in.mfa.invalid" : "sign-in.errors.invalid-credentials" : undefined;
|
|
27
27
|
case 403:
|
|
28
28
|
case 404:
|
|
29
|
-
return "sign-in.errors.unavailable";
|
|
29
|
+
return isSignIn ? "sign-in.errors.unavailable" : undefined;
|
|
30
30
|
case 429:
|
|
31
31
|
return "auth.rate-limit";
|
|
32
32
|
default:
|
|
@@ -46,7 +46,7 @@ const parseSignInError = (error, options = {}) => {
|
|
|
46
46
|
const code = stringValue(body?.code, nestedError?.code, root?.code);
|
|
47
47
|
const requestId = stringValue(body?.requestId, root?.requestId);
|
|
48
48
|
const fieldErrors = Array.isArray(body?.errors) ? body.errors : Array.isArray(nestedError?.errors) ? nestedError.errors : [];
|
|
49
|
-
const message = messageKeyForStatus(status, options.isMfaVerification === true) ?? (isNetworkError(error, originalMessage) ? "sign-in.errors.network" : "sign-in.errors.generic");
|
|
49
|
+
const message = messageKeyForStatus(status, options.isMfaVerification === true, options.isSignIn !== false) ?? (isNetworkError(error, originalMessage) ? "sign-in.errors.network" : "sign-in.errors.generic");
|
|
50
50
|
const signInError = new Error(message);
|
|
51
51
|
if (status !== undefined) {
|
|
52
52
|
signInError.status = status;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["asRecord","value","undefined","parseJsonRecord","JSON","parse","numberValue","values","find","candidate","Number","isFinite","stringValue","length","messageKeyForStatus","status","isMfaVerification","isNetworkError","error","message","TypeError","test","parseSignInError","options","root","originalMessage","Error","response","body","data","nestedError","statusCode","code","requestId","fieldErrors","Array","isArray","errors","signInError"],"sourceRoot":"../../../../../src","sources":["modules/auth/utils/sign-in-error.ts"],"mappings":";;AAeA,MAAMA,QAAQ,GAAIC,KAAc,IAC9B,OAAOA,KAAK,KAAK,QAAQ,IAAIA,KAAK,KAAK,IAAI,GACtCA,KAAK,GACNC,SAAS;AAEf,MAAMC,eAAe,GAAIF,KAAc,IAA8B;EACnE,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC7B,OAAOC,SAAS;EAClB;EAEA,IAAI;IACF,OAAOF,QAAQ,CAACI,IAAI,CAACC,KAAK,CAACJ,KAAK,CAAC,CAAC;EACpC,CAAC,CAAC,MAAM;IACN,OAAOC,SAAS;EAClB;AACF,CAAC;AAED,MAAMI,WAAW,GAAGA,CAAC,GAAGC,MAAiB,KAAyB;EAChE,MAAMN,KAAK,GAAGM,MAAM,CAACC,IAAI,CACtBC,SAAS,IACR,OAAOA,SAAS,KAAK,QAAQ,IAAIC,MAAM,CAACC,QAAQ,CAACF,SAAS,CAC9D,CAAC;EAED,OAAO,OAAOR,KAAK,KAAK,QAAQ,GAAGA,KAAK,GAAGC,SAAS;AACtD,CAAC;AAED,MAAMU,WAAW,GAAGA,CAAC,GAAGL,MAAiB,KAAyB;EAChE,MAAMN,KAAK,GAAGM,MAAM,CAACC,IAAI,CACtBC,SAAS,IAAK,OAAOA,SAAS,KAAK,QAAQ,IAAIA,SAAS,CAACI,MAAM,GAAG,CACrE,CAAC;EAED,OAAO,OAAOZ,KAAK,KAAK,QAAQ,GAAGA,KAAK,GAAGC,SAAS;AACtD,CAAC;AAED,MAAMY,mBAAmB,GAAGA,CAC1BC,MAA0B,EAC1BC,iBAA0B,
|
|
1
|
+
{"version":3,"names":["asRecord","value","undefined","parseJsonRecord","JSON","parse","numberValue","values","find","candidate","Number","isFinite","stringValue","length","messageKeyForStatus","status","isMfaVerification","isSignIn","isNetworkError","error","message","TypeError","test","parseSignInError","options","root","originalMessage","Error","response","body","data","nestedError","statusCode","code","requestId","fieldErrors","Array","isArray","errors","signInError"],"sourceRoot":"../../../../../src","sources":["modules/auth/utils/sign-in-error.ts"],"mappings":";;AAeA,MAAMA,QAAQ,GAAIC,KAAc,IAC9B,OAAOA,KAAK,KAAK,QAAQ,IAAIA,KAAK,KAAK,IAAI,GACtCA,KAAK,GACNC,SAAS;AAEf,MAAMC,eAAe,GAAIF,KAAc,IAA8B;EACnE,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC7B,OAAOC,SAAS;EAClB;EAEA,IAAI;IACF,OAAOF,QAAQ,CAACI,IAAI,CAACC,KAAK,CAACJ,KAAK,CAAC,CAAC;EACpC,CAAC,CAAC,MAAM;IACN,OAAOC,SAAS;EAClB;AACF,CAAC;AAED,MAAMI,WAAW,GAAGA,CAAC,GAAGC,MAAiB,KAAyB;EAChE,MAAMN,KAAK,GAAGM,MAAM,CAACC,IAAI,CACtBC,SAAS,IACR,OAAOA,SAAS,KAAK,QAAQ,IAAIC,MAAM,CAACC,QAAQ,CAACF,SAAS,CAC9D,CAAC;EAED,OAAO,OAAOR,K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AAE;IAC3BqC,WAAW,CAACL,SAAS,GAAGA,SAAS;EACnC;EACA,IAAID,IAAI,KAAK/B,SAAS,EAAE;IACtBqC,WAAW,CAACN,IAAI,GAAGA,IAAI;EACzB;EAEA,OAAO;IAAEd,KAAK,EAAEoB,WAAW;IAAEJ;EAAY,CAAC;AAC5C,CAAC;AAED,SAASZ,gBAAgB","ignoreList":[]}
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { GoogleSignin } from "@react-native-google-signin/google-signin";
|
|
4
|
+
import { slog } from "../../helpers/index.js";
|
|
4
5
|
|
|
5
6
|
/** Clears the native Google account only when this app has one signed in. */
|
|
6
7
|
export const signOutGoogleIfNeeded = async () => {
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
try {
|
|
9
|
+
if (typeof GoogleSignin.getCurrentUser !== "function" || !GoogleSignin.getCurrentUser()) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
await GoogleSignin.signOut();
|
|
13
|
+
} catch {
|
|
14
|
+
// Native provider cleanup is best-effort; do not expose provider details or
|
|
15
|
+
// prevent the app session from being cleared.
|
|
16
|
+
slog(new Error("Google sign-out failed"), "google-sign-out");
|
|
9
17
|
}
|
|
10
|
-
await GoogleSignin.signOut();
|
|
11
18
|
};
|
|
12
19
|
//# sourceMappingURL=sign-out-google.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["GoogleSignin","signOutGoogleIfNeeded","getCurrentUser","signOut"],"sourceRoot":"../../../../../src","sources":["modules/auth/utils/sign-out-google.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,2CAA2C;;
|
|
1
|
+
{"version":3,"names":["GoogleSignin","slog","signOutGoogleIfNeeded","getCurrentUser","signOut","Error"],"sourceRoot":"../../../../../src","sources":["modules/auth/utils/sign-out-google.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,2CAA2C;AAExE,SAASC,IAAI,QAAQ,wBAAe;;AAEpC;AACA,OAAO,MAAMC,qBAAqB,GAAG,MAAAA,CAAA,KAA2B;EAC9D,IAAI;IACF,IACE,OAAOF,YAAY,CAACG,cAAc,KAAK,UAAU,IACjD,CAACH,YAAY,CAACG,cAAc,CAAC,CAAC,EAC9B;MACA;IACF;IAEA,MAAMH,YAAY,CAACI,OAAO,CAAC,CAAC;EAC9B,CAAC,CAAC,MAAM;IACN;IACA;IACAH,IAAI,CAAC,IAAII,KAAK,CAAC,wBAAwB,CAAC,EAAE,iBAAiB,CAAC;EAC9D;AACF,CAAC","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { LEPU_CATALOG_EXCLUDED_DEVICE_NAMES, LEPU_DEVICE_NAMES } from "../../bt-management/services/devices/lepu/lepu.device-names.js";
|
|
3
|
+
import { LEPU_CATALOG_EXCLUDED_DEVICE_NAMES, LEPU_CATALOG_HIDDEN_DEVICE_NAMES, LEPU_DEVICE_NAMES } from "../../bt-management/services/devices/lepu/lepu.device-names.js";
|
|
4
4
|
import { babySleepClipImage, babySleepClipImageCredit } from "./baby-sleep-clip-catalog-asset.js";
|
|
5
5
|
import { deviceImages } from "./device-images.js";
|
|
6
6
|
import { alivecorCredit, bundledAssetCredit, cosinussCredit, foraCredit, taidocCredit, transtekCredit, viatomBodyScaleCredit, viatomBp3Credit, viatomBp3Image, viatomEcgCredit, viatomEr1Image, viatomF4Image, viatomO2RingImage, viatomOximeterCredit, viatomR20Credit, viatomR20Image, viatomR200Credit, viatomR200Image } from "./supported-device-catalog-assets.js";
|
|
@@ -55,6 +55,6 @@ const catalogEntry = (name, nameKey, manufacturer, manufacturerKey, logo, credit
|
|
|
55
55
|
logo,
|
|
56
56
|
creditsForImage
|
|
57
57
|
});
|
|
58
|
-
const lepuViatomModelCatalog = LEPU_DEVICE_NAMES.filter(model => model !== "Checkme" && !LEPU_CATALOG_EXCLUDED_DEVICE_NAMES.includes(model)).map((model, index) => catalogEntry(model, modelKey(model, index), "Lepu Medical / Viatom", "devices.catalog.manufacturers.lepu-viatom", modelImage(model), modelCredit(model)));
|
|
59
|
-
export const additionalSupportedDevices = [catalogEntry("TaiDoc TD4216", "devices.catalog.taidoc-td4216.name", "TaiDoc Technology Corporation", "devices.catalog.manufacturers.taidoc", deviceImages.taidocTD4216DeviceImage, taidocCredit), catalogEntry("GlucoCheck Gold", "devices.catalog.glucocheck-gold.name", "GlucoCheck", "devices.catalog.manufacturers.glucocheck", deviceImages.glucocheckDeviceImage, bundledAssetCredit), catalogEntry("Andesfit TEMP", "devices.catalog.andesfit-temp.name", "Andesfit", "devices.catalog.manufacturers.andesfit", deviceImages.andesfitB33ADeviceImage, bundledAssetCredit), catalogEntry("FORA IR20", "devices.catalog.fora-ir20.name", "ForaCare", "devices.catalog.manufacturers.fora", deviceImages.foraIR20DeviceImage, foraCredit), catalogEntry("cosinuss° Two", "devices.catalog.cosinuss-two.name", "cosinuss°", "devices.catalog.manufacturers.cosinuss", deviceImages.cosinussDeviceImage, cosinussCredit), catalogEntry("FORA W550", "devices.catalog.fora-w550.name", "ForaCare", "devices.catalog.manufacturers.fora", deviceImages.foraW550DeviceImage, foraCredit), catalogEntry("Transtek GBS-2012-B", "devices.catalog.transtek-gbs-2012-b.name", "Transtek Electronics", "devices.catalog.manufacturers.transtek", deviceImages.telerpmDeviceImage, transtekCredit), catalogEntry("TaiDoc TD1107", "devices.catalog.taidoc-td1107.name", "TaiDoc Technology Corporation", "devices.catalog.manufacturers.taidoc", deviceImages.taidocTD1107DeviceImage, taidocCredit), catalogEntry("cosinuss° c-med° alpha", "devices.catalog.cosinuss-cmed-alpha.name", "cosinuss°", "devices.catalog.manufacturers.cosinuss", deviceImages.cosinussDeviceImage, cosinussCredit), catalogEntry("Pulmo80B", "devices.catalog.pulmo80b.name", "Lepu Medical", "devices.catalog.manufacturers.lepu", deviceImages.sp80bDeviceImage, bundledAssetCredit), catalogEntry("
|
|
58
|
+
const lepuViatomModelCatalog = LEPU_DEVICE_NAMES.filter(model => model !== "Checkme" && !LEPU_CATALOG_EXCLUDED_DEVICE_NAMES.includes(model)).map((model, index) => catalogEntry(model, modelKey(model, index), "Lepu Medical / Viatom", "devices.catalog.manufacturers.lepu-viatom", modelImage(model), modelCredit(model))).filter(device => !LEPU_CATALOG_HIDDEN_DEVICE_NAMES.includes(device.name));
|
|
59
|
+
export const additionalSupportedDevices = [catalogEntry("TaiDoc TD4216", "devices.catalog.taidoc-td4216.name", "TaiDoc Technology Corporation", "devices.catalog.manufacturers.taidoc", deviceImages.taidocTD4216DeviceImage, taidocCredit), catalogEntry("GlucoCheck Gold", "devices.catalog.glucocheck-gold.name", "GlucoCheck", "devices.catalog.manufacturers.glucocheck", deviceImages.glucocheckDeviceImage, bundledAssetCredit), catalogEntry("Andesfit TEMP", "devices.catalog.andesfit-temp.name", "Andesfit", "devices.catalog.manufacturers.andesfit", deviceImages.andesfitB33ADeviceImage, bundledAssetCredit), catalogEntry("FORA IR20", "devices.catalog.fora-ir20.name", "ForaCare", "devices.catalog.manufacturers.fora", deviceImages.foraIR20DeviceImage, foraCredit), catalogEntry("cosinuss° Two", "devices.catalog.cosinuss-two.name", "cosinuss°", "devices.catalog.manufacturers.cosinuss", deviceImages.cosinussDeviceImage, cosinussCredit), catalogEntry("FORA W550", "devices.catalog.fora-w550.name", "ForaCare", "devices.catalog.manufacturers.fora", deviceImages.foraW550DeviceImage, foraCredit), catalogEntry("Transtek GBS-2012-B", "devices.catalog.transtek-gbs-2012-b.name", "Transtek Electronics", "devices.catalog.manufacturers.transtek", deviceImages.telerpmDeviceImage, transtekCredit), catalogEntry("TaiDoc TD1107", "devices.catalog.taidoc-td1107.name", "TaiDoc Technology Corporation", "devices.catalog.manufacturers.taidoc", deviceImages.taidocTD1107DeviceImage, taidocCredit), catalogEntry("cosinuss° c-med° alpha", "devices.catalog.cosinuss-cmed-alpha.name", "cosinuss°", "devices.catalog.manufacturers.cosinuss", deviceImages.cosinussDeviceImage, cosinussCredit), catalogEntry("Pulmo80B", "devices.catalog.pulmo80b.name", "Lepu Medical", "devices.catalog.manufacturers.lepu", deviceImages.sp80bDeviceImage, bundledAssetCredit), catalogEntry("AliveCor KardiaMobile", "devices.catalog.alivecor-kardiamobile.name", "AliveCor", "devices.catalog.manufacturers.alivecor", deviceImages.alivecorDeviceImage, alivecorCredit), catalogEntry("TeleBGM Gen1 BLE", "devices.catalog.telebgm-gen1.name", "TaiDoc Technology Corporation", "devices.catalog.manufacturers.taidoc", deviceImages.bgmDeviceImage, taidocCredit), ...lepuViatomModelCatalog];
|
|
60
60
|
//# sourceMappingURL=supported-device-catalog-entries.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["LEPU_CATALOG_EXCLUDED_DEVICE_NAMES","LEPU_DEVICE_NAMES","babySleepClipImage","babySleepClipImageCredit","deviceImages","alivecorCredit","bundledAssetCredit","cosinussCredit","foraCredit","taidocCredit","transtekCredit","viatomBodyScaleCredit","viatomBp3Credit","viatomBp3Image","viatomEcgCredit","viatomEr1Image","viatomF4Image","viatomO2RingImage","viatomOximeterCredit","viatomR20Credit","viatomR20Image","viatomR200Credit","viatomR200Image","modelKey","model","index","toLowerCase","replace","modelImage","test","modelCredit","catalogEntry","name","nameKey","manufacturer","manufacturerKey","logo","creditsForImage","lepuViatomModelCatalog","filter","includes","map","additionalSupportedDevices","taidocTD4216DeviceImage","glucocheckDeviceImage","andesfitB33ADeviceImage","foraIR20DeviceImage","cosinussDeviceImage","foraW550DeviceImage","telerpmDeviceImage","taidocTD1107DeviceImage","sp80bDeviceImage","
|
|
1
|
+
{"version":3,"names":["LEPU_CATALOG_EXCLUDED_DEVICE_NAMES","LEPU_CATALOG_HIDDEN_DEVICE_NAMES","LEPU_DEVICE_NAMES","babySleepClipImage","babySleepClipImageCredit","deviceImages","alivecorCredit","bundledAssetCredit","cosinussCredit","foraCredit","taidocCredit","transtekCredit","viatomBodyScaleCredit","viatomBp3Credit","viatomBp3Image","viatomEcgCredit","viatomEr1Image","viatomF4Image","viatomO2RingImage","viatomOximeterCredit","viatomR20Credit","viatomR20Image","viatomR200Credit","viatomR200Image","modelKey","model","index","toLowerCase","replace","modelImage","test","modelCredit","catalogEntry","name","nameKey","manufacturer","manufacturerKey","logo","creditsForImage","lepuViatomModelCatalog","filter","includes","map","device","additionalSupportedDevices","taidocTD4216DeviceImage","glucocheckDeviceImage","andesfitB33ADeviceImage","foraIR20DeviceImage","cosinussDeviceImage","foraW550DeviceImage","telerpmDeviceImage","taidocTD1107DeviceImage","sp80bDeviceImage","alivecorDeviceImage","bgmDeviceImage"],"sourceRoot":"../../../../../src","sources":["modules/bt-device/constants/supported-device-catalog-entries.ts"],"mappings":";;AAEA,SACEA,kCAAkC,EAClCC,gCAAgC,EAChCC,iBAAiB,QACZ,gEAA6D;AAEpE,SACEC,kBAAkB,EAClBC,wBAAwB,QACnB,oCAAiC;AACxC,SAASC,YAAY,QAAQ,oBAAiB;AAC9C,SACEC,cAAc,EACdC,kBAAkB,EAClBC,cAAc,EACdC,UAAU,EACVC,YAAY,EACZC,cAAc,EACdC,qBAAqB,EACrBC,eAAe,EACfC,cAAc,EACdC,eAAe,EACfC,cAAc,EACdC,aAAa,EACbC,iBAAiB,EACjBC,oBAAoB,EACpBC,eAAe,EACfC,cAAc,EACdC,gBAAgB,EAChBC,eAAe,QACV,sCAAmC;AAE1C,MAAMC,QAAQ,GAAGA,CAACC,KAAa,EAAEC,KAAa,KAC5C,+BAA+BA,KAAK,IAAID,KAAK,CAC1CE,WAAW,CAAC,CAAC,CACbC,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC,CAC3BA,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,EAAE;AAE5B,MAAMC,UAAU,GAAIJ,KAAa,IAAa;EAC5C,IAAIA,KAAK,KAAK,UAAU,EAAE;IACxB,OAAOtB,kBAAkB;EAC3B;EAEA,IAAIsB,KAAK,KAAK,KAAK,EAAE;IACnB,OAAOJ,cAA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+C,uBAAuB,EACpC1C,YACF,CAAC,EACDsB,YAAY,CACV,wBAAwB,EACxB,0CAA0C,EAC1C,WAAW,EACX,wCAAwC,EACxC3B,YAAY,CAAC4C,mBAAmB,EAChCzC,cACF,CAAC,EACDwB,YAAY,CACV,UAAU,EACV,+BAA+B,EAC/B,cAAc,EACd,oCAAoC,EACpC3B,YAAY,CAACgD,gBAAgB,EAC7B9C,kBACF,CAAC,EACDyB,YAAY,CACV,uBAAuB,EACvB,4CAA4C,EAC5C,UAAU,EACV,wCAAwC,EACxC3B,YAAY,CAACiD,mBAAmB,EAChChD,cACF,CAAC,EACD0B,YAAY,CACV,kBAAkB,EAClB,mCAAmC,EACnC,+BAA+B,EAC/B,sCAAsC,EACtC3B,YAAY,CAACkD,cAAc,EAC3B7C,YACF,CAAC,EACD,GAAG6B,sBAAsB,CACoB","ignoreList":[]}
|
|
@@ -598,7 +598,6 @@ const definitionsFor = name => {
|
|
|
598
598
|
"BBSM BS1": IntegratedDevices.VIATOM_BBSM_BS1,
|
|
599
599
|
"BBSM S3": IntegratedDevices.BBSM_S3,
|
|
600
600
|
"Viatom F4 / Lescale": IntegratedDevices.F4,
|
|
601
|
-
"Lepu Le S5": IntegratedDevices.LEPU_F4_SCALE,
|
|
602
601
|
"Le S5": IntegratedDevices.S5,
|
|
603
602
|
"Lescale F3": IntegratedDevices.LEPU_F4_SCALE,
|
|
604
603
|
"Lescale F4P": IntegratedDevices.LEPU_F4_SCALE,
|
|
@@ -648,10 +647,15 @@ const definitionsFor = name => {
|
|
|
648
647
|
/** One joined catalog for apps that need names, artwork and ready-made accept-list entries. */
|
|
649
648
|
const supportedDevices = Devices.map(device => {
|
|
650
649
|
const definitions = definitionsFor(device.name);
|
|
650
|
+
const isLepuWeightScale = device.manufacturerKey === "devices.catalog.manufacturers.lepu-viatom" && definitions.measurementTypes.includes(MeasurementTypeKey.bodyWeight);
|
|
651
651
|
return {
|
|
652
652
|
...device,
|
|
653
|
-
|
|
654
|
-
...
|
|
653
|
+
...definitions,
|
|
654
|
+
...(isLepuWeightScale ? {
|
|
655
|
+
logo: viatomF4Image,
|
|
656
|
+
creditsForImage: viatomBodyScaleCredit
|
|
657
|
+
} : {}),
|
|
658
|
+
id: customId(device.name)
|
|
655
659
|
};
|
|
656
660
|
}).filter(device => device.acceptedDevices.length > 0);
|
|
657
661
|
const SUPPORTED_DEVICES = supportedDevices;
|