@orangecheck/auth-client 2.50.1 → 2.52.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.
Files changed (37) hide show
  1. package/dist/bond.mjs +4 -4
  2. package/dist/{chunk-NJEQHNVI.mjs → chunk-2FBI2M6N.mjs} +324 -41
  3. package/dist/chunk-2FBI2M6N.mjs.map +1 -0
  4. package/dist/{chunk-XVLOTOCX.mjs → chunk-6UIOGWHT.mjs} +96 -4
  5. package/dist/chunk-6UIOGWHT.mjs.map +1 -0
  6. package/dist/{chunk-MIBVEZLP.mjs → chunk-7VBIHZVF.mjs} +3 -3
  7. package/dist/chunk-F6XAMBPI.mjs +107 -0
  8. package/dist/chunk-F6XAMBPI.mjs.map +1 -0
  9. package/dist/{chunk-IKNAIRW5.mjs → chunk-FDN374RW.mjs} +2 -2
  10. package/dist/{chunk-OKIFTNEO.mjs → chunk-HQ6APBHF.mjs} +8 -2
  11. package/dist/{chunk-OKIFTNEO.mjs.map → chunk-HQ6APBHF.mjs.map} +1 -1
  12. package/dist/{chunk-MGZ4NVXW.mjs → chunk-LKYBT4Q7.mjs} +5 -5
  13. package/dist/chunk-QHZ6E64O.mjs +61 -0
  14. package/dist/chunk-QHZ6E64O.mjs.map +1 -0
  15. package/dist/{chunk-2NCLRIVO.mjs → chunk-W6YYHOYL.mjs} +3 -3
  16. package/dist/chunk-W6YYHOYL.mjs.map +1 -0
  17. package/dist/components.mjs +3 -3
  18. package/dist/held-link.mjs +19 -0
  19. package/dist/held-link.mjs.map +1 -0
  20. package/dist/index.d.ts +34 -2
  21. package/dist/index.js +547 -37
  22. package/dist/index.js.map +1 -1
  23. package/dist/index.mjs +22 -18
  24. package/dist/linked-identities.mjs +2 -2
  25. package/dist/passkey.mjs +9 -0
  26. package/dist/passkey.mjs.map +1 -0
  27. package/dist/provider.mjs +2 -2
  28. package/dist/refusal.mjs +1 -1
  29. package/dist/signin.mjs +7 -5
  30. package/dist/webauthn.mjs +6 -3
  31. package/package.json +1 -1
  32. package/dist/chunk-2NCLRIVO.mjs.map +0 -1
  33. package/dist/chunk-NJEQHNVI.mjs.map +0 -1
  34. package/dist/chunk-XVLOTOCX.mjs.map +0 -1
  35. /package/dist/{chunk-MIBVEZLP.mjs.map → chunk-7VBIHZVF.mjs.map} +0 -0
  36. /package/dist/{chunk-IKNAIRW5.mjs.map → chunk-FDN374RW.mjs.map} +0 -0
  37. /package/dist/{chunk-MGZ4NVXW.mjs.map → chunk-LKYBT4Q7.mjs.map} +0 -0
package/dist/index.d.ts CHANGED
@@ -130,6 +130,9 @@ interface UseOcAddressSuggestionReturn {
130
130
  declare function useOcAddressSuggestion(options: UseOcAddressSuggestionOptions): UseOcAddressSuggestionReturn;
131
131
  declare const OcAddressInput: React.ForwardRefExoticComponent<OcAddressInputProps & React.RefAttributes<HTMLInputElement>>;
132
132
 
133
+ type PasskeyPath = 'off' | 'with' | 'layered' | 'only';
134
+ type PasskeyKind = 'signin' | 'layer';
135
+
133
136
  interface OcSignInBaseProps {
134
137
  audience: string;
135
138
  returnTo?: string;
@@ -142,6 +145,7 @@ interface OcSignInBaseProps {
142
145
  wallet?: boolean;
143
146
  email?: boolean;
144
147
  };
148
+ passkey?: PasskeyPath;
145
149
  linkPrompt?: boolean;
146
150
  add?: boolean;
147
151
  onSeveralSessions?: () => unknown;
@@ -154,10 +158,11 @@ type OcSignInProps = OcSignInBaseProps & ({
154
158
  mode: 'first-party';
155
159
  onSuccess: (account: OcAccount, token?: string) => void;
156
160
  providerHref?: (providerId: string) => string;
161
+ passkey?: Exclude<PasskeyPath, 'layered'>;
157
162
  });
158
163
  declare function safeReturnTo(input: string | undefined): string;
159
164
  declare function familyReturnTarget(input: string | undefined | null): string | undefined;
160
- declare function OcSignIn({ audience, returnTo, onSuccess, resolveReturnTo, linkPrompt: linkPromptProp, add: addProp, onSeveralSessions, authOrigin, initialPath, providersFirst, paths, className, mode, providerHref, }: OcSignInProps): React.ReactElement;
165
+ declare function OcSignIn({ audience, returnTo, onSuccess, resolveReturnTo, linkPrompt: linkPromptProp, add: addProp, onSeveralSessions, authOrigin, initialPath, providersFirst, paths, className, mode, providerHref, passkey, }: OcSignInProps): React.ReactElement;
161
166
 
162
167
  declare function otpNetworkCapText(retryAt: unknown, instead?: string): string;
163
168
  declare function newAccountsCapText(retryAt: unknown): string;
@@ -248,19 +253,46 @@ interface UseHostOptions {
248
253
  type WebAuthnRegisterResult = {
249
254
  ok: true;
250
255
  credential: WebAuthnCredentialPublic;
256
+ binding?: {
257
+ ok: true;
258
+ } | {
259
+ ok: false;
260
+ reason: string;
261
+ };
251
262
  } | {
252
263
  ok: false;
253
264
  reason: string;
254
265
  };
266
+ type BindSigner = (statement: string, address: string) => Promise<string>;
255
267
  interface UseWebAuthnRegisterReturn {
256
268
  status: WebAuthnRegisterStatus;
257
269
  error: Error | null;
258
270
  register: (args?: {
259
271
  label?: string;
272
+ bind?: BindSigner;
260
273
  }) => Promise<WebAuthnRegisterResult>;
261
274
  reset: () => void;
262
275
  }
263
276
  declare function useWebAuthnRegister(opts?: UseHostOptions): UseWebAuthnRegisterReturn;
277
+ type PasskeySignInResult = {
278
+ ok: true;
279
+ account: OcAccount;
280
+ token?: string;
281
+ } | {
282
+ ok: false;
283
+ reason: string;
284
+ };
285
+ interface UsePasskeySignInReturn {
286
+ status: WebAuthnAssertionStatus;
287
+ error: Error | null;
288
+ signIn: (args?: {
289
+ kind?: PasskeyKind;
290
+ add?: boolean;
291
+ credentials?: RequestCredentials;
292
+ }) => Promise<PasskeySignInResult>;
293
+ reset: () => void;
294
+ }
295
+ declare function usePasskeySignIn(opts?: UseHostOptions): UsePasskeySignInReturn;
264
296
  type WebAuthnRenameResult = {
265
297
  ok: true;
266
298
  credential: WebAuthnCredentialPublic;
@@ -316,4 +348,4 @@ declare function isSudoAccountMismatch(body: {
316
348
  reason?: string;
317
349
  } | null | undefined): boolean;
318
350
 
319
- export { DEFAULT_CONFIG, DISPLAY_IDENTITY_KINDS, type DisplayIdentity, type DisplayIdentityKind, FRAGMENT_TTL_MS, type OcAccount, OcAccountChip, type OcAccountChipProps, OcAccountPill, type OcAccountPillProps, type OcAccountSummary, OcAddressInput, type OcAddressInputProps, type OcAuthConfig, OcBond, type OcBondProps, type OcBondView, OcLinkedIdentities, type OcLinkedIdentitiesProps, type OcLinkedIdentity, OcSessionProvider, type OcSessionState, type OcSessionStatus, OcSignIn, OcSignInButton, type OcSignInButtonProps, type OcSignInProps, type OcSignOutResult, type OcSignOutScope, type OcTabSession, type RedirectToSudoArgs, SUDO_ACCOUNT_MISMATCH_MESSAGE, TAB_ACCOUNT_HINT_KEY, TAB_ADOPT_HASH, TAB_SESSION_HEADER, TAB_SESSION_STORAGE_KEY, type UseOcAddressSuggestionOptions, type UseOcAddressSuggestionReturn, type UseStepUpAuthReturn, type UseWebAuthnListReturn, type UseWebAuthnRegisterReturn, type WebAuthnAssertionStatus, type WebAuthnCredentialPublic, type WebAuthnListStatus, type WebAuthnRegisterResult, type WebAuthnRegisterStatus, type WebAuthnRemoveResult, type WebAuthnRenameResult, type WebAuthnStepUpResult, bondFloorsText, buildAddAccountUrl, buildSignInUrl, capText, clearTabSession, consumeTabAccountHint, consumeTabAdoptMarker, familyReturnTarget, fetchOcBond, fetchOcLinkedIdentities, handleSudoRequired, installTabFetchInterceptor, installTabLinkDecorator, isSudoAccountMismatch, keepFragmentOnReturnLinks, newAccountsCapText, otpNetworkCapText, readTabSession, redirectToSudo, restoreReturnFragment, returnToHere, safeReturnTo, stripFragment, tabSessionHeader, useOcAddressSuggestion, useOcSession, useOptionalOcSession, useStepUpAuth, useWebAuthnList, useWebAuthnRegister, withoutFragment, writeTabSession };
351
+ export { type BindSigner, DEFAULT_CONFIG, DISPLAY_IDENTITY_KINDS, type DisplayIdentity, type DisplayIdentityKind, FRAGMENT_TTL_MS, type OcAccount, OcAccountChip, type OcAccountChipProps, OcAccountPill, type OcAccountPillProps, type OcAccountSummary, OcAddressInput, type OcAddressInputProps, type OcAuthConfig, OcBond, type OcBondProps, type OcBondView, OcLinkedIdentities, type OcLinkedIdentitiesProps, type OcLinkedIdentity, OcSessionProvider, type OcSessionState, type OcSessionStatus, OcSignIn, OcSignInButton, type OcSignInButtonProps, type OcSignInProps, type OcSignOutResult, type OcSignOutScope, type OcTabSession, type PasskeyPath, type PasskeySignInResult, type RedirectToSudoArgs, SUDO_ACCOUNT_MISMATCH_MESSAGE, TAB_ACCOUNT_HINT_KEY, TAB_ADOPT_HASH, TAB_SESSION_HEADER, TAB_SESSION_STORAGE_KEY, type UseOcAddressSuggestionOptions, type UseOcAddressSuggestionReturn, type UsePasskeySignInReturn, type UseStepUpAuthReturn, type UseWebAuthnListReturn, type UseWebAuthnRegisterReturn, type WebAuthnAssertionStatus, type WebAuthnCredentialPublic, type WebAuthnListStatus, type WebAuthnRegisterResult, type WebAuthnRegisterStatus, type WebAuthnRemoveResult, type WebAuthnRenameResult, type WebAuthnStepUpResult, bondFloorsText, buildAddAccountUrl, buildSignInUrl, capText, clearTabSession, consumeTabAccountHint, consumeTabAdoptMarker, familyReturnTarget, fetchOcBond, fetchOcLinkedIdentities, handleSudoRequired, installTabFetchInterceptor, installTabLinkDecorator, isSudoAccountMismatch, keepFragmentOnReturnLinks, newAccountsCapText, otpNetworkCapText, readTabSession, redirectToSudo, restoreReturnFragment, returnToHere, safeReturnTo, stripFragment, tabSessionHeader, useOcAddressSuggestion, useOcSession, useOptionalOcSession, usePasskeySignIn, useStepUpAuth, useWebAuthnList, useWebAuthnRegister, withoutFragment, writeTabSession };