Skip to content

Commit 4217841

Browse files
committed
Simplify browser and server exports
1 parent 4d1803a commit 4217841

3 files changed

Lines changed: 32 additions & 133 deletions

File tree

packages/browser/src/index.ts

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,10 @@
1-
/**
2-
* @packageDocumentation
3-
* @module @simplewebauthn/browser
4-
*/
5-
import { startRegistration } from './methods/startRegistration.ts';
6-
import { startAuthentication } from './methods/startAuthentication.ts';
7-
import { browserSupportsWebAuthn } from './helpers/browserSupportsWebAuthn.ts';
8-
import { platformAuthenticatorIsAvailable } from './helpers/platformAuthenticatorIsAvailable.ts';
9-
import { browserSupportsWebAuthnAutofill } from './helpers/browserSupportsWebAuthnAutofill.ts';
10-
import { base64URLStringToBuffer } from './helpers/base64URLStringToBuffer.ts';
11-
import { bufferToBase64URLString } from './helpers/bufferToBase64URLString.ts';
12-
import { WebAuthnAbortService } from './helpers/webAuthnAbortService.ts';
13-
import { WebAuthnError } from './helpers/webAuthnError.ts';
14-
15-
export {
16-
base64URLStringToBuffer,
17-
browserSupportsWebAuthn,
18-
browserSupportsWebAuthnAutofill,
19-
bufferToBase64URLString,
20-
platformAuthenticatorIsAvailable,
21-
startAuthentication,
22-
startRegistration,
23-
WebAuthnAbortService,
24-
WebAuthnError,
25-
};
26-
27-
export type { WebAuthnErrorCode } from './helpers/webAuthnError.ts';
28-
1+
export * from './methods/startRegistration.ts';
2+
export * from './methods/startAuthentication.ts';
3+
export * from './helpers/browserSupportsWebAuthn.ts';
4+
export * from './helpers/platformAuthenticatorIsAvailable.ts';
5+
export * from './helpers/browserSupportsWebAuthnAutofill.ts';
6+
export * from './helpers/base64URLStringToBuffer.ts';
7+
export * from './helpers/bufferToBase64URLString.ts';
8+
export * from './helpers/webAuthnAbortService.ts';
9+
export * from './helpers/webAuthnError.ts';
2910
export * from './types/index.ts';
Lines changed: 16 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,16 @@
1-
import { convertAAGUIDToString } from './convertAAGUIDToString.ts';
2-
import { convertCertBufferToPEM } from './convertCertBufferToPEM.ts';
3-
import { convertCOSEtoPKCS } from './convertCOSEtoPKCS.ts';
4-
import { decodeAttestationObject } from './decodeAttestationObject.ts';
5-
import { decodeClientDataJSON } from './decodeClientDataJSON.ts';
6-
import { decodeCredentialPublicKey } from './decodeCredentialPublicKey.ts';
7-
import { generateChallenge } from './generateChallenge.ts';
8-
import { generateUserID } from './generateUserID.ts';
9-
import { getCertificateInfo } from './getCertificateInfo.ts';
10-
import { isCertRevoked } from './isCertRevoked.ts';
11-
import { parseAuthenticatorData } from './parseAuthenticatorData.ts';
12-
import { toHash } from './toHash.ts';
13-
import { validateCertificatePath } from './validateCertificatePath.ts';
14-
import { verifySignature } from './verifySignature.ts';
15-
import { isoBase64URL, isoCBOR, isoCrypto, isoUint8Array } from './iso/index.ts';
16-
import * as cose from './cose.ts';
17-
18-
export {
19-
convertAAGUIDToString,
20-
convertCertBufferToPEM,
21-
convertCOSEtoPKCS,
22-
cose,
23-
decodeAttestationObject,
24-
decodeClientDataJSON,
25-
decodeCredentialPublicKey,
26-
generateChallenge,
27-
generateUserID,
28-
getCertificateInfo,
29-
isCertRevoked,
30-
isoBase64URL,
31-
isoCBOR,
32-
isoCrypto,
33-
isoUint8Array,
34-
parseAuthenticatorData,
35-
toHash,
36-
validateCertificatePath,
37-
verifySignature,
38-
};
39-
40-
import type {
41-
AttestationFormat,
42-
AttestationObject,
43-
AttestationStatement,
44-
} from './decodeAttestationObject.ts';
45-
import type { CertificateInfo } from './getCertificateInfo.ts';
46-
import type { ClientDataJSON } from './decodeClientDataJSON.ts';
47-
import type {
48-
COSEPublicKey,
49-
COSEPublicKeyEC2,
50-
COSEPublicKeyOKP,
51-
COSEPublicKeyRSA,
52-
} from './cose.ts';
53-
import type { ParsedAuthenticatorData } from './parseAuthenticatorData.ts';
54-
55-
export type {
56-
AttestationFormat,
57-
AttestationObject,
58-
AttestationStatement,
59-
CertificateInfo,
60-
ClientDataJSON,
61-
COSEPublicKey,
62-
COSEPublicKeyEC2,
63-
COSEPublicKeyOKP,
64-
COSEPublicKeyRSA,
65-
ParsedAuthenticatorData,
66-
};
1+
export * from './convertAAGUIDToString.ts';
2+
export * from './convertCertBufferToPEM.ts';
3+
export * from './convertCOSEtoPKCS.ts';
4+
export * from './decodeAttestationObject.ts';
5+
export * from './decodeClientDataJSON.ts';
6+
export * from './decodeCredentialPublicKey.ts';
7+
export * from './generateChallenge.ts';
8+
export * from './generateUserID.ts';
9+
export * from './getCertificateInfo.ts';
10+
export * from './isCertRevoked.ts';
11+
export * from './parseAuthenticatorData.ts';
12+
export * from './toHash.ts';
13+
export * from './validateCertificatePath.ts';
14+
export * from './verifySignature.ts';
15+
export * from './iso/index.ts';
16+
export * as cose from './cose.ts';

packages/server/src/index.ts

Lines changed: 7 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,8 @@
1-
import { generateRegistrationOptions } from './registration/generateRegistrationOptions.ts';
2-
import { verifyRegistrationResponse } from './registration/verifyRegistrationResponse.ts';
3-
import { generateAuthenticationOptions } from './authentication/generateAuthenticationOptions.ts';
4-
import { verifyAuthenticationResponse } from './authentication/verifyAuthenticationResponse.ts';
5-
import { MetadataService } from './services/metadataService.ts';
6-
import { SettingsService } from './services/settingsService.ts';
7-
8-
export {
9-
generateAuthenticationOptions,
10-
generateRegistrationOptions,
11-
MetadataService,
12-
SettingsService,
13-
verifyAuthenticationResponse,
14-
verifyRegistrationResponse,
15-
};
16-
17-
import type { GenerateRegistrationOptionsOpts } from './registration/generateRegistrationOptions.ts';
18-
import type { GenerateAuthenticationOptionsOpts } from './authentication/generateAuthenticationOptions.ts';
19-
import type { MetadataStatement } from './metadata/mdsTypes.ts';
20-
import type {
21-
VerifiedRegistrationResponse,
22-
VerifyRegistrationResponseOpts,
23-
} from './registration/verifyRegistrationResponse.ts';
24-
import type {
25-
VerifiedAuthenticationResponse,
26-
VerifyAuthenticationResponseOpts,
27-
} from './authentication/verifyAuthenticationResponse.ts';
28-
29-
export type {
30-
GenerateAuthenticationOptionsOpts,
31-
GenerateRegistrationOptionsOpts,
32-
MetadataStatement,
33-
VerifiedAuthenticationResponse,
34-
VerifiedRegistrationResponse,
35-
VerifyAuthenticationResponseOpts,
36-
VerifyRegistrationResponseOpts,
37-
};
38-
39-
export * from './types/index.ts';
1+
export * from './registration/generateRegistrationOptions.ts';
2+
export * from './registration/verifyRegistrationResponse.ts';
3+
export * from './authentication/generateAuthenticationOptions.ts';
4+
export * from './authentication/verifyAuthenticationResponse.ts';
5+
export * from './services/metadataService.ts';
6+
export * from './services/settingsService.ts';
407
export * from './metadata/mdsTypes.ts';
8+
export * from './types/index.ts';

0 commit comments

Comments
 (0)