@movmo_app/react-common 0.17.1 → 0.18.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/dist/index.d.ts CHANGED
@@ -8,6 +8,7 @@ import { MovmoCodeFlow } from '@movmo_app/types';
8
8
  import { MovmoLoginResponse } from '@movmo_app/types';
9
9
  import { MovmoVerifyResponse } from '@movmo_app/types';
10
10
  import { OTPAction } from '@movmo_app/types';
11
+ import { PasskeyListResponse } from '@movmo_app/types';
11
12
  import { PasskeyOptionsResponse } from '@movmo_app/types';
12
13
  import { PasskeyRegistrationStart } from '@movmo_app/types';
13
14
  import { PasskeySummary } from '@movmo_app/types';
@@ -362,6 +363,8 @@ export declare interface MovmoAuthApi {
362
363
  verifyCode(flowId: string, code: string): Promise<MovmoVerifyResponse>;
363
364
  verifyPasskey(flowId: string, credential: CredentialJSON): Promise<MovmoVerifyResponse>;
364
365
  listPasskeys(): Promise<PasskeySummary[]>;
366
+ /** The raw list response, including the optional `user_handle`/`rp_id`/identity keys. */
367
+ fetchPasskeyList(): Promise<PasskeyListResponse>;
365
368
  startRegistration(): Promise<PasskeyRegistrationStart>;
366
369
  completeRegistration(flowId: string, credential: CredentialJSON): Promise<PasskeySummary>;
367
370
  /** Rejects an id that isn't base64url (1–512 chars) with `invalid_request`, before any request. */
@@ -604,6 +607,12 @@ export declare interface PasskeyListProps {
604
607
  recoveryUntil?: string | null;
605
608
  }
606
609
 
610
+ /** The `user_handle`/`rp_id` cached from the last list that carried them. */
611
+ export declare interface PasskeySignalFallback {
612
+ user_handle: string;
613
+ rp_id: string;
614
+ }
615
+
607
616
  export declare const PhoneInput: default_2.FC<PhoneInputProps>;
608
617
 
609
618
  export declare interface PhoneInputProps {
@@ -772,6 +781,35 @@ export declare const ShieldTickIcon: (props: IconProps) => JSX_2.Element;
772
781
  */
773
782
  export declare function shouldOfferPasskey(now?: number, s?: PromptState | null): boolean;
774
783
 
784
+ /**
785
+ * Tells the credential provider which passkeys the server still accepts and the
786
+ * account's current name (WebAuthn Signal API; MOVMO-738). Best effort:
787
+ * synchronous, returns nothing, never awaited (Safari's promise may never
788
+ * settle), never logs (the user handle is a stable per-user identifier).
789
+ *
790
+ * Always pass the SERVER's list, never a locally edited one: a passkey added on
791
+ * another device since the page loaded would otherwise be removed by the
792
+ * provider.
793
+ *
794
+ * `fallback` covers the last removal, where the server returns no handle or
795
+ * `rp_id`; it is used only for the accepted-credentials signal (an empty list
796
+ * carries no user details). Pass it only with proof that `list` is the cached
797
+ * handle's account (PasskeyList: a 204 removal of a passkey that handle's list
798
+ * held), never after a 404 or an add: an empty list from another account
799
+ * would hide every passkey of the cached one.
800
+ */
801
+ export declare function signalPasskeyState(list: PasskeyListResponse, fallback?: PasskeySignalFallback): void;
802
+
803
+ /**
804
+ * Tells the provider one credential is gone (`signalUnknownCredential`). Call it
805
+ * only after the server answered 204 to the DELETE: after the LAST removal the
806
+ * server forgets the user handle, so `signalAllAcceptedCredentials` could never
807
+ * hide it on a later page load. Needs no handle. Same rules as
808
+ * `signalPasskeyState`: best effort, synchronous, never awaited, never logged,
809
+ * no-op when framed.
810
+ */
811
+ export declare function signalRemovedPasskey(rpId: string, credentialId: string): void;
812
+
775
813
  /**
776
814
  * User-facing copy for the sign-in state machine (`useMovmoSignIn`).
777
815
  * English only (D3); strings are verbatim from the MOVMO-685/718 design