@simplewebauthn/browser 11.0.0 → 12.0.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 (110) hide show
  1. package/README.md +34 -24
  2. package/dist/bundle/index.es5.umd.min.js +2 -2
  3. package/dist/bundle/index.umd.min.js +2 -2
  4. package/esm/helpers/base64URLStringToBuffer.d.ts +9 -0
  5. package/esm/helpers/base64URLStringToBuffer.d.ts.map +1 -0
  6. package/esm/helpers/base64URLStringToBuffer.js +29 -0
  7. package/esm/helpers/browserSupportsWebAuthn.d.ts +8 -0
  8. package/esm/helpers/browserSupportsWebAuthn.d.ts.map +1 -0
  9. package/esm/helpers/browserSupportsWebAuthn.js +11 -0
  10. package/esm/helpers/browserSupportsWebAuthnAutofill.d.ts +9 -0
  11. package/esm/helpers/browserSupportsWebAuthnAutofill.d.ts.map +1 -0
  12. package/esm/helpers/browserSupportsWebAuthnAutofill.js +26 -0
  13. package/esm/helpers/bufferToBase64URLString.d.ts +8 -0
  14. package/esm/helpers/bufferToBase64URLString.d.ts.map +1 -0
  15. package/esm/helpers/bufferToBase64URLString.js +15 -0
  16. package/esm/helpers/identifyAuthenticationError.d.ts +9 -0
  17. package/esm/helpers/identifyAuthenticationError.d.ts.map +1 -0
  18. package/esm/helpers/identifyAuthenticationError.js +61 -0
  19. package/esm/helpers/identifyRegistrationError.d.ts +9 -0
  20. package/esm/helpers/identifyRegistrationError.d.ts.map +1 -0
  21. package/esm/helpers/identifyRegistrationError.js +126 -0
  22. package/esm/helpers/isValidDomain.d.ts +10 -0
  23. package/esm/helpers/isValidDomain.d.ts.map +1 -0
  24. package/esm/helpers/isValidDomain.js +14 -0
  25. package/esm/helpers/platformAuthenticatorIsAvailable.d.ts +8 -0
  26. package/esm/helpers/platformAuthenticatorIsAvailable.d.ts.map +1 -0
  27. package/esm/helpers/platformAuthenticatorIsAvailable.js +13 -0
  28. package/{dist/types → esm}/helpers/toAuthenticatorAttachment.d.ts +4 -0
  29. package/esm/helpers/toAuthenticatorAttachment.d.ts.map +1 -0
  30. package/esm/helpers/toAuthenticatorAttachment.js +13 -0
  31. package/esm/helpers/toPublicKeyCredentialDescriptor.d.ts +3 -0
  32. package/esm/helpers/toPublicKeyCredentialDescriptor.d.ts.map +1 -0
  33. package/esm/helpers/toPublicKeyCredentialDescriptor.js +14 -0
  34. package/esm/helpers/webAuthnAbortService.d.ts +14 -0
  35. package/esm/helpers/webAuthnAbortService.d.ts.map +1 -0
  36. package/esm/helpers/webAuthnAbortService.js +45 -0
  37. package/{dist/types → esm}/helpers/webAuthnError.d.ts +18 -0
  38. package/esm/helpers/webAuthnError.d.ts.map +1 -0
  39. package/esm/helpers/webAuthnError.js +31 -0
  40. package/esm/index.d.ts +16 -0
  41. package/esm/index.d.ts.map +1 -0
  42. package/{dist/types/index.d.ts → esm/index.js} +13 -10
  43. package/esm/methods/startAuthentication.d.ts +15 -0
  44. package/esm/methods/startAuthentication.d.ts.map +1 -0
  45. package/esm/methods/startAuthentication.js +89 -0
  46. package/esm/methods/startRegistration.d.ts +13 -0
  47. package/esm/methods/startRegistration.d.ts.map +1 -0
  48. package/esm/methods/startRegistration.js +115 -0
  49. package/esm/package.json +3 -0
  50. package/package.json +25 -29
  51. package/script/helpers/base64URLStringToBuffer.d.ts +9 -0
  52. package/script/helpers/base64URLStringToBuffer.d.ts.map +1 -0
  53. package/script/helpers/base64URLStringToBuffer.js +32 -0
  54. package/script/helpers/browserSupportsWebAuthn.d.ts +8 -0
  55. package/script/helpers/browserSupportsWebAuthn.d.ts.map +1 -0
  56. package/script/helpers/browserSupportsWebAuthn.js +15 -0
  57. package/script/helpers/browserSupportsWebAuthnAutofill.d.ts +9 -0
  58. package/script/helpers/browserSupportsWebAuthnAutofill.d.ts.map +1 -0
  59. package/script/helpers/browserSupportsWebAuthnAutofill.js +30 -0
  60. package/script/helpers/bufferToBase64URLString.d.ts +8 -0
  61. package/script/helpers/bufferToBase64URLString.d.ts.map +1 -0
  62. package/script/helpers/bufferToBase64URLString.js +18 -0
  63. package/script/helpers/identifyAuthenticationError.d.ts +9 -0
  64. package/script/helpers/identifyAuthenticationError.d.ts.map +1 -0
  65. package/script/helpers/identifyAuthenticationError.js +64 -0
  66. package/script/helpers/identifyRegistrationError.d.ts +9 -0
  67. package/script/helpers/identifyRegistrationError.d.ts.map +1 -0
  68. package/script/helpers/identifyRegistrationError.js +129 -0
  69. package/script/helpers/isValidDomain.d.ts +10 -0
  70. package/script/helpers/isValidDomain.d.ts.map +1 -0
  71. package/script/helpers/isValidDomain.js +17 -0
  72. package/script/helpers/platformAuthenticatorIsAvailable.d.ts +8 -0
  73. package/script/helpers/platformAuthenticatorIsAvailable.d.ts.map +1 -0
  74. package/script/helpers/platformAuthenticatorIsAvailable.js +16 -0
  75. package/script/helpers/toAuthenticatorAttachment.d.ts +6 -0
  76. package/script/helpers/toAuthenticatorAttachment.d.ts.map +1 -0
  77. package/script/helpers/toAuthenticatorAttachment.js +16 -0
  78. package/script/helpers/toPublicKeyCredentialDescriptor.d.ts +3 -0
  79. package/script/helpers/toPublicKeyCredentialDescriptor.d.ts.map +1 -0
  80. package/script/helpers/toPublicKeyCredentialDescriptor.js +17 -0
  81. package/script/helpers/webAuthnAbortService.d.ts +14 -0
  82. package/script/helpers/webAuthnAbortService.d.ts.map +1 -0
  83. package/script/helpers/webAuthnAbortService.js +48 -0
  84. package/script/helpers/webAuthnError.d.ts +28 -0
  85. package/script/helpers/webAuthnError.d.ts.map +1 -0
  86. package/script/helpers/webAuthnError.js +35 -0
  87. package/script/index.d.ts +16 -0
  88. package/script/index.d.ts.map +1 -0
  89. package/script/index.js +25 -0
  90. package/script/methods/startAuthentication.d.ts +15 -0
  91. package/script/methods/startAuthentication.d.ts.map +1 -0
  92. package/script/methods/startAuthentication.js +92 -0
  93. package/script/methods/startRegistration.d.ts +13 -0
  94. package/script/methods/startRegistration.d.ts.map +1 -0
  95. package/script/methods/startRegistration.js +118 -0
  96. package/script/package.json +3 -0
  97. package/dist/bundle/index.js +0 -398
  98. package/dist/types/helpers/base64URLStringToBuffer.d.ts +0 -1
  99. package/dist/types/helpers/browserSupportsWebAuthn.d.ts +0 -1
  100. package/dist/types/helpers/browserSupportsWebAuthnAutofill.d.ts +0 -1
  101. package/dist/types/helpers/bufferToBase64URLString.d.ts +0 -1
  102. package/dist/types/helpers/identifyAuthenticationError.d.ts +0 -5
  103. package/dist/types/helpers/identifyRegistrationError.d.ts +0 -5
  104. package/dist/types/helpers/isValidDomain.d.ts +0 -1
  105. package/dist/types/helpers/platformAuthenticatorIsAvailable.d.ts +0 -1
  106. package/dist/types/helpers/toPublicKeyCredentialDescriptor.d.ts +0 -2
  107. package/dist/types/helpers/webAuthnAbortService.d.ts +0 -7
  108. package/dist/types/methods/startAuthentication.d.ts +0 -7
  109. package/dist/types/methods/startRegistration.d.ts +0 -6
  110. package/jest-environment.js +0 -29
@@ -1 +0,0 @@
1
- export declare function isValidDomain(hostname: string): boolean;
@@ -1 +0,0 @@
1
- export declare function platformAuthenticatorIsAvailable(): Promise<boolean>;
@@ -1,2 +0,0 @@
1
- import type { PublicKeyCredentialDescriptorJSON } from '@simplewebauthn/types';
2
- export declare function toPublicKeyCredentialDescriptor(descriptor: PublicKeyCredentialDescriptorJSON): PublicKeyCredentialDescriptor;
@@ -1,7 +0,0 @@
1
- declare class BaseWebAuthnAbortService {
2
- private controller;
3
- createNewAbortSignal(): AbortSignal;
4
- cancelCeremony(): void;
5
- }
6
- export declare const WebAuthnAbortService: BaseWebAuthnAbortService;
7
- export {};
@@ -1,7 +0,0 @@
1
- import { AuthenticationResponseJSON, PublicKeyCredentialRequestOptionsJSON } from '@simplewebauthn/types';
2
- export type StartAuthenticationOpts = {
3
- optionsJSON: PublicKeyCredentialRequestOptionsJSON;
4
- useBrowserAutofill?: boolean;
5
- verifyBrowserAutofillInput?: boolean;
6
- };
7
- export declare function startAuthentication(options: StartAuthenticationOpts): Promise<AuthenticationResponseJSON>;
@@ -1,6 +0,0 @@
1
- import { PublicKeyCredentialCreationOptionsJSON, RegistrationResponseJSON } from '@simplewebauthn/types';
2
- export type StartRegistrationOpts = {
3
- optionsJSON: PublicKeyCredentialCreationOptionsJSON;
4
- useAutoRegister?: boolean;
5
- };
6
- export declare function startRegistration(options: StartRegistrationOpts): Promise<RegistrationResponseJSON>;
@@ -1,29 +0,0 @@
1
- import { TestEnvironment } from 'jest-environment-jsdom';
2
-
3
- /**
4
- * Set up a custom JSDOM-based test environment for Jest so we can add things JSDOM doesn't support
5
- */
6
- class CustomTestEnvironment extends TestEnvironment {
7
- async setup() {
8
- await super.setup();
9
- /**
10
- * JSDOM doesn't implement TextEncoder so we need to fake it with Node's
11
- *
12
- * Solved thanks to https://stackoverflow.com/a/57713960/2133271
13
- */
14
- if (typeof this.global.TextEncoder === 'undefined') {
15
- const { TextEncoder } = await import('util');
16
- this.global.TextEncoder = TextEncoder;
17
- }
18
-
19
- /**
20
- * Add support for TextDecoder to JSDOM
21
- */
22
- if (typeof this.global.TextDecoder === 'undefined') {
23
- const { TextDecoder } = await import('util');
24
- this.global.TextDecoder = TextDecoder;
25
- }
26
- }
27
- }
28
-
29
- export default CustomTestEnvironment;