@simplewebauthn/browser 11.0.0 → 13.0.0-alpha1

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 (124) hide show
  1. package/README.md +33 -23
  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 +12 -0
  8. package/esm/helpers/browserSupportsWebAuthn.d.ts.map +1 -0
  9. package/esm/helpers/browserSupportsWebAuthn.js +14 -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/esm/helpers/toAuthenticatorAttachment.d.ts +6 -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 +22 -0
  35. package/esm/helpers/webAuthnAbortService.d.ts.map +1 -0
  36. package/esm/helpers/webAuthnAbortService.js +37 -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 +11 -0
  41. package/esm/index.d.ts.map +1 -0
  42. package/esm/index.js +10 -0
  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/esm/types/dom.d.ts +329 -0
  51. package/esm/types/dom.d.ts.map +1 -0
  52. package/esm/types/dom.js +1 -0
  53. package/esm/types/index.d.ts +205 -0
  54. package/esm/types/index.d.ts.map +1 -0
  55. package/esm/types/index.js +1 -0
  56. package/package.json +25 -31
  57. package/script/helpers/base64URLStringToBuffer.d.ts +9 -0
  58. package/script/helpers/base64URLStringToBuffer.d.ts.map +1 -0
  59. package/script/helpers/base64URLStringToBuffer.js +32 -0
  60. package/script/helpers/browserSupportsWebAuthn.d.ts +12 -0
  61. package/script/helpers/browserSupportsWebAuthn.d.ts.map +1 -0
  62. package/script/helpers/browserSupportsWebAuthn.js +18 -0
  63. package/script/helpers/browserSupportsWebAuthnAutofill.d.ts +9 -0
  64. package/script/helpers/browserSupportsWebAuthnAutofill.d.ts.map +1 -0
  65. package/script/helpers/browserSupportsWebAuthnAutofill.js +30 -0
  66. package/script/helpers/bufferToBase64URLString.d.ts +8 -0
  67. package/script/helpers/bufferToBase64URLString.d.ts.map +1 -0
  68. package/script/helpers/bufferToBase64URLString.js +18 -0
  69. package/script/helpers/identifyAuthenticationError.d.ts +9 -0
  70. package/script/helpers/identifyAuthenticationError.d.ts.map +1 -0
  71. package/script/helpers/identifyAuthenticationError.js +64 -0
  72. package/script/helpers/identifyRegistrationError.d.ts +9 -0
  73. package/script/helpers/identifyRegistrationError.d.ts.map +1 -0
  74. package/script/helpers/identifyRegistrationError.js +129 -0
  75. package/script/helpers/isValidDomain.d.ts +10 -0
  76. package/script/helpers/isValidDomain.d.ts.map +1 -0
  77. package/script/helpers/isValidDomain.js +17 -0
  78. package/script/helpers/platformAuthenticatorIsAvailable.d.ts +8 -0
  79. package/script/helpers/platformAuthenticatorIsAvailable.d.ts.map +1 -0
  80. package/script/helpers/platformAuthenticatorIsAvailable.js +16 -0
  81. package/script/helpers/toAuthenticatorAttachment.d.ts +6 -0
  82. package/script/helpers/toAuthenticatorAttachment.d.ts.map +1 -0
  83. package/script/helpers/toAuthenticatorAttachment.js +16 -0
  84. package/script/helpers/toPublicKeyCredentialDescriptor.d.ts +3 -0
  85. package/script/helpers/toPublicKeyCredentialDescriptor.d.ts.map +1 -0
  86. package/script/helpers/toPublicKeyCredentialDescriptor.js +17 -0
  87. package/script/helpers/webAuthnAbortService.d.ts +22 -0
  88. package/script/helpers/webAuthnAbortService.d.ts.map +1 -0
  89. package/script/helpers/webAuthnAbortService.js +40 -0
  90. package/script/helpers/webAuthnError.d.ts +28 -0
  91. package/script/helpers/webAuthnError.d.ts.map +1 -0
  92. package/script/helpers/webAuthnError.js +35 -0
  93. package/script/index.d.ts +11 -0
  94. package/script/index.d.ts.map +1 -0
  95. package/script/index.js +26 -0
  96. package/script/methods/startAuthentication.d.ts +15 -0
  97. package/script/methods/startAuthentication.d.ts.map +1 -0
  98. package/script/methods/startAuthentication.js +92 -0
  99. package/script/methods/startRegistration.d.ts +13 -0
  100. package/script/methods/startRegistration.d.ts.map +1 -0
  101. package/script/methods/startRegistration.js +118 -0
  102. package/script/package.json +3 -0
  103. package/script/types/dom.d.ts +329 -0
  104. package/script/types/dom.d.ts.map +1 -0
  105. package/script/types/dom.js +2 -0
  106. package/script/types/index.d.ts +205 -0
  107. package/script/types/index.d.ts.map +1 -0
  108. package/script/types/index.js +2 -0
  109. package/dist/bundle/index.js +0 -398
  110. package/dist/types/helpers/base64URLStringToBuffer.d.ts +0 -1
  111. package/dist/types/helpers/browserSupportsWebAuthn.d.ts +0 -1
  112. package/dist/types/helpers/browserSupportsWebAuthnAutofill.d.ts +0 -1
  113. package/dist/types/helpers/bufferToBase64URLString.d.ts +0 -1
  114. package/dist/types/helpers/identifyAuthenticationError.d.ts +0 -5
  115. package/dist/types/helpers/identifyRegistrationError.d.ts +0 -5
  116. package/dist/types/helpers/isValidDomain.d.ts +0 -1
  117. package/dist/types/helpers/platformAuthenticatorIsAvailable.d.ts +0 -1
  118. package/dist/types/helpers/toAuthenticatorAttachment.d.ts +0 -2
  119. package/dist/types/helpers/toPublicKeyCredentialDescriptor.d.ts +0 -2
  120. package/dist/types/helpers/webAuthnAbortService.d.ts +0 -7
  121. package/dist/types/index.d.ts +0 -11
  122. package/dist/types/methods/startAuthentication.d.ts +0 -7
  123. package/dist/types/methods/startRegistration.d.ts +0 -6
  124. package/jest-environment.js +0 -29
@@ -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;