diff --git a/package.json b/package.json index 455da1d7ce..5ba1593665 100644 --- a/package.json +++ b/package.json @@ -321,7 +321,7 @@ "build-fast:node-webcrypto-cjs": "npm run-script runtime-node-webcrypto && npm run-script -s esbuild-find | xargs -0 esbuild --log-level=warning --platform=node --target=esnext --outdir=dist/node/webcrypto/cjs --format=cjs", "build-fast:node-webcrypto-esm": "npm run-script runtime-node-webcrypto && npm run-script -s esbuild-find | xargs -0 esbuild --log-level=warning --platform=node --target=esnext --outdir=dist/node/webcrypto/esm --format=esm && echo '{\"type\": \"module\"}'> dist/node/webcrypto/esm/package.json", "build:browser": "run-s runtime-browser lint 'build -- -p ./tsconfig/browser.json' && echo '{\"type\": \"module\"}'> dist/browser/package.json", - "build:types": "npm run-script build -- -p ./tsconfig/types.json && cd src && find . -name '*.d.ts' -maxdepth 2 -type f -exec gcp --parents \"{}\" ../dist/types \\; && cd .. && node ./tools/strip-dts-comments", + "build:types": "npm run-script build -- -p ./tsconfig/types.json && cd src && find . -name '*.d.ts' -maxdepth 2 -type f -exec gcp --parents \"{}\" ../dist/types \\; && cd .. && node ./tools/strip-dts-comments && run-s -s types:find | xargs -0 sed -i '' -e \"s/.js//g\"", "build:node-cjs": "run-s runtime-node lint 'build -- -p ./tsconfig/node-cjs.json'", "build:node-esm": "run-s runtime-node lint 'build -- -p ./tsconfig/node-esm.json' && echo '{\"type\": \"module\"}'> dist/node/esm/package.json", "build:node-webcrypto-cjs": "run-s runtime-node-webcrypto lint 'build -- -p ./tsconfig/node-webcrypto-cjs.json'", @@ -340,6 +340,7 @@ "runtime:browser:copy": "cp ./src/runtime/browser/*.ts ./src/runtime", "runtime:clear": "run-s -s runtime:find | xargs -0 rm -f", "runtime:find": "find src/runtime -not -name '*.d.ts' -maxdepth 1 -type f -print0", + "types:find": "find dist/types -name '*.d.ts' -type f -print0", "runtime:node:copy": "cp ./src/runtime/node/*.ts ./src/runtime", "runtime:refs": "run-s -s runtime:find | xargs -0 sed -i '' -e \"s/'\\.\\.\\//'\\.\\//g\" -e \"s/'\\.\\/\\.\\./'../g\"", "test": "npm run-script test-cjs && ava", diff --git a/src/jwe/compact/decrypt.ts b/src/jwe/compact/decrypt.ts index 8c4512cf5e..7b54b37dd9 100644 --- a/src/jwe/compact/decrypt.ts +++ b/src/jwe/compact/decrypt.ts @@ -8,7 +8,7 @@ import type { GetKeyFunction, FlattenedJWE, CompactDecryptResult, -} from '../../types.d' +} from '../../types' /** * Interface for Compact JWE Decryption dynamic key resolution. diff --git a/src/jwe/compact/encrypt.ts b/src/jwe/compact/encrypt.ts index faa40d12f6..cda4a6570b 100644 --- a/src/jwe/compact/encrypt.ts +++ b/src/jwe/compact/encrypt.ts @@ -4,7 +4,7 @@ import type { JWEKeyManagementHeaderParameters, JWEHeaderParameters, EncryptOptions, -} from '../../types.d' +} from '../../types' /** * The CompactEncrypt class is a utility for creating Compact JWE strings. diff --git a/src/jwe/flattened/decrypt.ts b/src/jwe/flattened/decrypt.ts index 33f89655bb..b20d139dff 100644 --- a/src/jwe/flattened/decrypt.ts +++ b/src/jwe/flattened/decrypt.ts @@ -14,7 +14,7 @@ import type { JWEHeaderParameters, DecryptOptions, GetKeyFunction, -} from '../../types.d' +} from '../../types' import { encoder, decoder, concat } from '../../lib/buffer_utils.js' import cekFactory from '../../lib/cek.js' import random from '../../runtime/random.js' diff --git a/src/jwe/flattened/encrypt.ts b/src/jwe/flattened/encrypt.ts index 9c015c7330..32c7e41c83 100644 --- a/src/jwe/flattened/encrypt.ts +++ b/src/jwe/flattened/encrypt.ts @@ -4,8 +4,8 @@ import type { JWEHeaderParameters, JWEKeyManagementHeaderParameters, EncryptOptions, -} from '../../types.d' -import type { JWEKeyManagementHeaderResults } from '../../types.i.d' +} from '../../types' +import type { JWEKeyManagementHeaderResults } from '../../types.i' import ivFactory from '../../lib/iv.js' import { encode as base64url } from '../../runtime/base64url.js' import random from '../../runtime/random.js' diff --git a/src/jwe/general/decrypt.ts b/src/jwe/general/decrypt.ts index 03bfa3d131..2b636d38d9 100644 --- a/src/jwe/general/decrypt.ts +++ b/src/jwe/general/decrypt.ts @@ -8,7 +8,7 @@ import type { FlattenedJWE, GeneralJWE, GeneralDecryptResult, -} from '../../types.d' +} from '../../types' import isObject from '../../lib/is_object.js' /** diff --git a/src/jwk/embedded.ts b/src/jwk/embedded.ts index 7a51bd818e..045a8fbe73 100644 --- a/src/jwk/embedded.ts +++ b/src/jwk/embedded.ts @@ -1,6 +1,6 @@ /* eslint-disable jsdoc/require-param */ import type { KeyObject } from 'crypto' -import type { FlattenedJWSInput, JWSHeaderParameters } from '../types.d' +import type { FlattenedJWSInput, JWSHeaderParameters } from '../types' import parseJwk from './parse.js' import isObject from '../lib/is_object.js' import { JWSInvalid } from '../util/errors.js' diff --git a/src/jwk/from_key_like.ts b/src/jwk/from_key_like.ts index 242607e367..e2fd867820 100644 --- a/src/jwk/from_key_like.ts +++ b/src/jwk/from_key_like.ts @@ -1,4 +1,4 @@ -import type { JWK, KeyLike } from '../types.d' +import type { JWK, KeyLike } from '../types' import asJWK from '../runtime/key_to_jwk.js' /** diff --git a/src/jwk/parse.ts b/src/jwk/parse.ts index ccfde633ef..e6e103791e 100644 --- a/src/jwk/parse.ts +++ b/src/jwk/parse.ts @@ -2,7 +2,7 @@ import { decode as base64url } from '../runtime/base64url.js' import asKeyObject from '../runtime/jwk_to_key.js' import { JOSENotSupported } from '../util/errors.js' import isObject from '../lib/is_object.js' -import type { JWK, KeyLike } from '../types.d' +import type { JWK, KeyLike } from '../types' /** * Converts a JWK to a runtime-specific key representation (KeyLike). Either diff --git a/src/jwk/thumbprint.ts b/src/jwk/thumbprint.ts index 63faedf164..8bc94700c9 100644 --- a/src/jwk/thumbprint.ts +++ b/src/jwk/thumbprint.ts @@ -3,7 +3,7 @@ import { JOSENotSupported, JWKInvalid } from '../util/errors.js' import digest from '../runtime/digest.js' import { encode as base64url } from '../runtime/base64url.js' import { encoder } from '../lib/buffer_utils.js' -import type { JWK } from '../types.d' +import type { JWK } from '../types' import isObject from '../lib/is_object.js' const check = (value: unknown, description: string) => { diff --git a/src/jwks/remote.ts b/src/jwks/remote.ts index 560e7bcc4d..69a4b8a5f7 100644 --- a/src/jwks/remote.ts +++ b/src/jwks/remote.ts @@ -2,7 +2,7 @@ import type { KeyObject } from 'crypto' import type * as http from 'http' import type * as https from 'https' -import type { JWSHeaderParameters, JWK, FlattenedJWSInput, GetKeyFunction } from '../types.d' +import type { JWSHeaderParameters, JWK, FlattenedJWSInput, GetKeyFunction } from '../types' import parseJWK from '../jwk/parse.js' import { JWKSInvalid, diff --git a/src/jws/compact/sign.ts b/src/jws/compact/sign.ts index 73a243cc88..fa55f0efbe 100644 --- a/src/jws/compact/sign.ts +++ b/src/jws/compact/sign.ts @@ -1,7 +1,7 @@ /* eslint-disable no-underscore-dangle */ import FlattenedSign from '../flattened/sign.js' -import type { JWSHeaderParameters, KeyLike, SignOptions } from '../../types.d' +import type { JWSHeaderParameters, KeyLike, SignOptions } from '../../types' /** * The CompactSign class is a utility for creating Compact JWS strings. diff --git a/src/jws/compact/verify.ts b/src/jws/compact/verify.ts index 5bbd661613..6193339702 100644 --- a/src/jws/compact/verify.ts +++ b/src/jws/compact/verify.ts @@ -8,7 +8,7 @@ import type { JWSHeaderParameters, KeyLike, VerifyOptions, -} from '../../types.d' +} from '../../types' /** * Interface for Compact JWS Verification dynamic key resolution. diff --git a/src/jws/flattened/sign.ts b/src/jws/flattened/sign.ts index 401ee90e0f..22934d661d 100644 --- a/src/jws/flattened/sign.ts +++ b/src/jws/flattened/sign.ts @@ -6,7 +6,7 @@ import { encoder, decoder, concat } from '../../lib/buffer_utils.js' import { encode as base64url } from '../../runtime/base64url.js' import sign from '../../runtime/sign.js' -import type { KeyLike, FlattenedJWS, JWSHeaderParameters, SignOptions } from '../../types.d' +import type { KeyLike, FlattenedJWS, JWSHeaderParameters, SignOptions } from '../../types' import checkKeyType from '../../lib/check_key_type.js' import validateCrit from '../../lib/validate_crit.js' diff --git a/src/jws/flattened/verify.ts b/src/jws/flattened/verify.ts index ac515818ec..d909c40f5e 100644 --- a/src/jws/flattened/verify.ts +++ b/src/jws/flattened/verify.ts @@ -16,7 +16,7 @@ import type { JWSHeaderParameters, VerifyOptions, GetKeyFunction, -} from '../../types.d' +} from '../../types' const checkExtensions = validateCrit.bind(undefined, JWSInvalid, new Map([['b64', true]])) const checkAlgOption = validateAlgorithms.bind(undefined, 'algorithms') diff --git a/src/jws/general/sign.ts b/src/jws/general/sign.ts index e965fd5c00..db3db74a2f 100644 --- a/src/jws/general/sign.ts +++ b/src/jws/general/sign.ts @@ -2,7 +2,7 @@ import FlattenedSign from '../flattened/sign.js' import { JWSInvalid } from '../../util/errors.js' -import type { KeyLike, GeneralJWS, JWSHeaderParameters, SignOptions } from '../../types.d' +import type { KeyLike, GeneralJWS, JWSHeaderParameters, SignOptions } from '../../types' export interface Signature { /** diff --git a/src/jws/general/verify.ts b/src/jws/general/verify.ts index 3aae4ca276..b12b563b71 100644 --- a/src/jws/general/verify.ts +++ b/src/jws/general/verify.ts @@ -7,7 +7,7 @@ import type { JWSHeaderParameters, KeyLike, VerifyOptions, -} from '../../types.d' +} from '../../types' import { JWSInvalid, JWSSignatureVerificationFailed } from '../../util/errors.js' import isObject from '../../lib/is_object.js' diff --git a/src/jwt/decrypt.ts b/src/jwt/decrypt.ts index 800a3c49b0..aa0233262e 100644 --- a/src/jwt/decrypt.ts +++ b/src/jwt/decrypt.ts @@ -8,7 +8,7 @@ import type { JWEHeaderParameters, FlattenedJWE, JWTDecryptResult, -} from '../types.d' +} from '../types' import jwtPayload from '../lib/jwt_claims_set.js' import { JWTClaimValidationFailed } from '../util/errors.js' diff --git a/src/jwt/encrypt.ts b/src/jwt/encrypt.ts index 35f3fd9b59..f4a84b7102 100644 --- a/src/jwt/encrypt.ts +++ b/src/jwt/encrypt.ts @@ -7,7 +7,7 @@ import type { JWEKeyManagementHeaderParameters, JWTPayload, KeyLike, -} from '../types.d' +} from '../types' import { encoder } from '../lib/buffer_utils.js' import ProduceJWT from '../lib/jwt_producer.js' diff --git a/src/jwt/sign.ts b/src/jwt/sign.ts index acc6060f2e..11a84b2ec7 100644 --- a/src/jwt/sign.ts +++ b/src/jwt/sign.ts @@ -2,7 +2,7 @@ import CompactSign from '../jws/compact/sign.js' import { JWTInvalid } from '../util/errors.js' -import type { JWSHeaderParameters, JWTPayload, KeyLike, SignOptions } from '../types.d' +import type { JWSHeaderParameters, JWTPayload, KeyLike, SignOptions } from '../types' import { encoder } from '../lib/buffer_utils.js' import ProduceJWT from '../lib/jwt_producer.js' diff --git a/src/jwt/unsecured.ts b/src/jwt/unsecured.ts index f79fe8f555..8714dc70e2 100644 --- a/src/jwt/unsecured.ts +++ b/src/jwt/unsecured.ts @@ -1,6 +1,6 @@ /* eslint-disable no-underscore-dangle */ -import type { JWSHeaderParameters, JWTClaimVerificationOptions, JWTPayload } from '../types.d' +import type { JWSHeaderParameters, JWTClaimVerificationOptions, JWTPayload } from '../types' import { decoder } from '../lib/buffer_utils.js' import * as base64url from '../runtime/base64url.js' import { JWTInvalid } from '../util/errors.js' diff --git a/src/jwt/verify.ts b/src/jwt/verify.ts index 4ed58d3b8a..73239febf8 100644 --- a/src/jwt/verify.ts +++ b/src/jwt/verify.ts @@ -8,7 +8,7 @@ import type { GetKeyFunction, FlattenedJWSInput, JWTVerifyResult, -} from '../types.d' +} from '../types' import jwtPayload from '../lib/jwt_claims_set.js' import { JWTInvalid } from '../util/errors.js' diff --git a/src/lib/buffer_utils.ts b/src/lib/buffer_utils.ts index 1524f9c17d..c2355c4b80 100644 --- a/src/lib/buffer_utils.ts +++ b/src/lib/buffer_utils.ts @@ -1,6 +1,6 @@ /* eslint-disable no-await-in-loop */ -import type { DigestFunction } from '../runtime/interfaces.d' +import type { DigestFunction } from '../runtime/interfaces' export const encoder = new TextEncoder() export const decoder = new TextDecoder() diff --git a/src/lib/check_key_type.ts b/src/lib/check_key_type.ts index c1c3ee0868..6866089633 100644 --- a/src/lib/check_key_type.ts +++ b/src/lib/check_key_type.ts @@ -1,4 +1,4 @@ -import type { KeyLike } from '../types.d' +import type { KeyLike } from '../types' import invalidKeyInput from '../runtime/invalid_key_input.js' const checkKeyType = ( diff --git a/src/lib/decrypt_key_management.ts b/src/lib/decrypt_key_management.ts index d8e5cd6fc7..e04a80ffc4 100644 --- a/src/lib/decrypt_key_management.ts +++ b/src/lib/decrypt_key_management.ts @@ -1,5 +1,5 @@ -import type { JWEHeaderParameters, KeyLike } from '../types.d' -import type { JWEKeyManagementHeaderResults } from '../types.i.d' +import type { JWEHeaderParameters, KeyLike } from '../types' +import type { JWEKeyManagementHeaderResults } from '../types.i' import { JOSENotSupported, JWEInvalid } from '../util/errors.js' import { unwrap as aesKw } from '../runtime/aeskw.js' import * as ECDH from '../runtime/ecdhes.js' diff --git a/src/lib/encrypt_key_management.ts b/src/lib/encrypt_key_management.ts index a02a7bdcdc..2f494ece34 100644 --- a/src/lib/encrypt_key_management.ts +++ b/src/lib/encrypt_key_management.ts @@ -1,5 +1,5 @@ -import type { KeyLike, JWEKeyManagementHeaderParameters } from '../types.d' -import type { JWEKeyManagementHeaderResults } from '../types.i.d' +import type { KeyLike, JWEKeyManagementHeaderParameters } from '../types' +import type { JWEKeyManagementHeaderResults } from '../types.i' import cekFactory, { bitLengths as cekLengths } from '../lib/cek.js' import { JOSENotSupported } from '../util/errors.js' import random from '../runtime/random.js' diff --git a/src/lib/jwt_claims_set.ts b/src/lib/jwt_claims_set.ts index 2cffa4ddec..4d9349381d 100644 --- a/src/lib/jwt_claims_set.ts +++ b/src/lib/jwt_claims_set.ts @@ -3,7 +3,7 @@ import type { JWTClaimVerificationOptions, JWEHeaderParameters, JWSHeaderParameters, -} from '../types.d' +} from '../types' import { JWTClaimValidationFailed, JWTExpired, JWTInvalid } from '../util/errors.js' import { decoder } from './buffer_utils.js' import epoch from './epoch.js' diff --git a/src/lib/jwt_producer.ts b/src/lib/jwt_producer.ts index 83fdf4b260..2b672437d3 100644 --- a/src/lib/jwt_producer.ts +++ b/src/lib/jwt_producer.ts @@ -1,4 +1,4 @@ -import type { JWTPayload } from '../types.d' +import type { JWTPayload } from '../types' import epoch from './epoch.js' import isObject from './is_object.js' import secs from './secs.js' diff --git a/src/runtime/browser/aesgcmkw.ts b/src/runtime/browser/aesgcmkw.ts index efbf4d6557..ae028120b1 100644 --- a/src/runtime/browser/aesgcmkw.ts +++ b/src/runtime/browser/aesgcmkw.ts @@ -1,4 +1,4 @@ -import type { AesGcmKwUnwrapFunction, AesGcmKwWrapFunction } from '../interfaces.d' +import type { AesGcmKwUnwrapFunction, AesGcmKwWrapFunction } from '../interfaces' import encrypt from './encrypt.js' import decrypt from './decrypt.js' import ivFactory from '../../lib/iv.js' diff --git a/src/runtime/browser/aeskw.ts b/src/runtime/browser/aeskw.ts index ea2380bd3a..6554f94163 100644 --- a/src/runtime/browser/aeskw.ts +++ b/src/runtime/browser/aeskw.ts @@ -1,4 +1,4 @@ -import type { AesKwUnwrapFunction, AesKwWrapFunction } from '../interfaces.d' +import type { AesKwUnwrapFunction, AesKwWrapFunction } from '../interfaces' import bogusWebCrypto from './bogus.js' import crypto, { isCryptoKey } from './webcrypto.js' import invalidKeyInput from './invalid_key_input.js' diff --git a/src/runtime/browser/decrypt.ts b/src/runtime/browser/decrypt.ts index 408cca3c4d..680fafe2a8 100644 --- a/src/runtime/browser/decrypt.ts +++ b/src/runtime/browser/decrypt.ts @@ -1,6 +1,6 @@ import { concat, uint64be } from '../../lib/buffer_utils.js' -import type { DecryptFunction } from '../interfaces.d' +import type { DecryptFunction } from '../interfaces' import checkIvLength from '../../lib/check_iv_length.js' import checkCekLength from './check_cek_length.js' import timingSafeEqual from './timing_safe_equal.js' diff --git a/src/runtime/browser/digest.ts b/src/runtime/browser/digest.ts index cf735dd065..06ac32b7a7 100644 --- a/src/runtime/browser/digest.ts +++ b/src/runtime/browser/digest.ts @@ -1,5 +1,5 @@ import crypto from './webcrypto.js' -import type { DigestFunction } from '../interfaces.d' +import type { DigestFunction } from '../interfaces' const digest: DigestFunction = async ( algorithm: 'sha256' | 'sha384' | 'sha512', diff --git a/src/runtime/browser/encrypt.ts b/src/runtime/browser/encrypt.ts index 864cab7f2c..c2e523d85a 100644 --- a/src/runtime/browser/encrypt.ts +++ b/src/runtime/browser/encrypt.ts @@ -1,5 +1,5 @@ import { concat, uint64be } from '../../lib/buffer_utils.js' -import type { EncryptFunction } from '../interfaces.d' +import type { EncryptFunction } from '../interfaces' import checkIvLength from '../../lib/check_iv_length.js' import checkCekLength from './check_cek_length.js' import crypto, { isCryptoKey } from './webcrypto.js' diff --git a/src/runtime/browser/fetch_jwks.ts b/src/runtime/browser/fetch_jwks.ts index d648bbfe27..7b93555d2d 100644 --- a/src/runtime/browser/fetch_jwks.ts +++ b/src/runtime/browser/fetch_jwks.ts @@ -1,4 +1,4 @@ -import type { FetchFunction } from '../interfaces.d' +import type { FetchFunction } from '../interfaces' import { JOSEError } from '../../util/errors.js' import globalThis from './global.js' diff --git a/src/runtime/browser/jwk_to_key.ts b/src/runtime/browser/jwk_to_key.ts index 7b6970a6af..d08d5f0b17 100644 --- a/src/runtime/browser/jwk_to_key.ts +++ b/src/runtime/browser/jwk_to_key.ts @@ -1,7 +1,7 @@ import crypto from './webcrypto.js' -import type { JWKParseFunction } from '../interfaces.d' +import type { JWKParseFunction } from '../interfaces' import { JOSENotSupported } from '../../util/errors.js' -import type { JWK } from '../../types.d' +import type { JWK } from '../../types' import { decode as base64url } from './base64url.js' function subtleMapping(jwk: JWK): { diff --git a/src/runtime/browser/key_to_jwk.ts b/src/runtime/browser/key_to_jwk.ts index 0230f639ed..cbc3c4237d 100644 --- a/src/runtime/browser/key_to_jwk.ts +++ b/src/runtime/browser/key_to_jwk.ts @@ -1,6 +1,6 @@ import crypto, { isCryptoKey } from './webcrypto.js' -import type { JWKConvertFunction } from '../interfaces.d' -import type { JWK } from '../../types.d' +import type { JWKConvertFunction } from '../interfaces' +import type { JWK } from '../../types' import invalidKeyInput from './invalid_key_input.js' import { encode as base64url } from './base64url.js' diff --git a/src/runtime/browser/pbes2kw.ts b/src/runtime/browser/pbes2kw.ts index 544837e77d..f24bf15d7a 100644 --- a/src/runtime/browser/pbes2kw.ts +++ b/src/runtime/browser/pbes2kw.ts @@ -1,4 +1,4 @@ -import type { Pbes2KWDecryptFunction, Pbes2KWEncryptFunction } from '../interfaces.d' +import type { Pbes2KWDecryptFunction, Pbes2KWEncryptFunction } from '../interfaces' import random from './random.js' import { p2s as concatSalt } from '../../lib/buffer_utils.js' import { encode as base64url } from './base64url.js' diff --git a/src/runtime/browser/rsaes.ts b/src/runtime/browser/rsaes.ts index ecb5ef619e..17a1f86dbc 100644 --- a/src/runtime/browser/rsaes.ts +++ b/src/runtime/browser/rsaes.ts @@ -1,4 +1,4 @@ -import type { RsaEsDecryptFunction, RsaEsEncryptFunction } from '../interfaces.d' +import type { RsaEsDecryptFunction, RsaEsEncryptFunction } from '../interfaces' import subtleAlgorithm from './subtle_rsaes.js' import bogusWebCrypto from './bogus.js' import crypto, { isCryptoKey } from './webcrypto.js' diff --git a/src/runtime/browser/sign.ts b/src/runtime/browser/sign.ts index f1535d5b38..b646a59180 100644 --- a/src/runtime/browser/sign.ts +++ b/src/runtime/browser/sign.ts @@ -1,4 +1,4 @@ -import type { SignFunction } from '../interfaces.d' +import type { SignFunction } from '../interfaces' import subtleAlgorithm from './subtle_dsa.js' import crypto from './webcrypto.js' import checkKeyLength from './check_key_length.js' diff --git a/src/runtime/browser/timing_safe_equal.ts b/src/runtime/browser/timing_safe_equal.ts index 7b06568c63..efd18494cc 100644 --- a/src/runtime/browser/timing_safe_equal.ts +++ b/src/runtime/browser/timing_safe_equal.ts @@ -1,4 +1,4 @@ -import type { TimingSafeEqual } from '../interfaces.d' +import type { TimingSafeEqual } from '../interfaces' const timingSafeEqual: TimingSafeEqual = (a, b) => { if (!(a instanceof Uint8Array)) { diff --git a/src/runtime/browser/verify.ts b/src/runtime/browser/verify.ts index a7f5892bfc..bd016b1e9b 100644 --- a/src/runtime/browser/verify.ts +++ b/src/runtime/browser/verify.ts @@ -1,4 +1,4 @@ -import type { VerifyFunction } from '../interfaces.d' +import type { VerifyFunction } from '../interfaces' import subtleAlgorithm from './subtle_dsa.js' import crypto from './webcrypto.js' import checkKeyLength from './check_key_length.js' diff --git a/src/runtime/browser/zlib.ts b/src/runtime/browser/zlib.ts index ae2a4e4a5f..f2c05e59d3 100644 --- a/src/runtime/browser/zlib.ts +++ b/src/runtime/browser/zlib.ts @@ -1,5 +1,5 @@ import { JOSENotSupported } from '../../util/errors.js' -import type { InflateFunction, DeflateFunction } from '../../types.d' +import type { InflateFunction, DeflateFunction } from '../../types' export const inflate: InflateFunction = async () => { throw new JOSENotSupported( diff --git a/src/runtime/interfaces.d.ts b/src/runtime/interfaces.d.ts index 15b96e62b1..89a46c25fb 100644 --- a/src/runtime/interfaces.d.ts +++ b/src/runtime/interfaces.d.ts @@ -1,5 +1,5 @@ -import type { JWK, KeyLike } from '../types.d' -import type { AsyncOrSync } from '../types.i.d' +import type { JWK, KeyLike } from '../types' +import type { AsyncOrSync } from '../types.i' export interface TimingSafeEqual { (a: Uint8Array, b: Uint8Array): boolean diff --git a/src/runtime/node/aesgcmkw.ts b/src/runtime/node/aesgcmkw.ts index 68a2c07942..44750b78e5 100644 --- a/src/runtime/node/aesgcmkw.ts +++ b/src/runtime/node/aesgcmkw.ts @@ -1,4 +1,4 @@ -import type { AesGcmKwWrapFunction, AesGcmKwUnwrapFunction } from '../interfaces.d' +import type { AesGcmKwWrapFunction, AesGcmKwUnwrapFunction } from '../interfaces' import encrypt from './encrypt.js' import decrypt from './decrypt.js' import ivFactory from '../../lib/iv.js' diff --git a/src/runtime/node/aeskw.ts b/src/runtime/node/aeskw.ts index f7521d5e67..821a2067f9 100644 --- a/src/runtime/node/aeskw.ts +++ b/src/runtime/node/aeskw.ts @@ -1,6 +1,6 @@ import { KeyObject, createDecipheriv, createCipheriv, getCiphers } from 'crypto' import { JOSENotSupported } from '../../util/errors.js' -import type { AesKwUnwrapFunction, AesKwWrapFunction } from '../interfaces.d' +import type { AesKwUnwrapFunction, AesKwWrapFunction } from '../interfaces' import { concat } from '../../lib/buffer_utils.js' import getSecretKey from './secret_key.js' import { isCryptoKey, getKeyObject } from './webcrypto.js' diff --git a/src/runtime/node/decrypt.ts b/src/runtime/node/decrypt.ts index 55c3dc8333..1fa1b18705 100644 --- a/src/runtime/node/decrypt.ts +++ b/src/runtime/node/decrypt.ts @@ -1,7 +1,7 @@ import { getCiphers, KeyObject, createDecipheriv } from 'crypto' import type { CipherGCMTypes } from 'crypto' -import type { DecryptFunction } from '../interfaces.d' +import type { DecryptFunction } from '../interfaces' import checkIvLength from '../../lib/check_iv_length.js' import checkCekLength from './check_cek_length.js' import { concat } from '../../lib/buffer_utils.js' @@ -9,7 +9,7 @@ import { JOSENotSupported, JWEDecryptionFailed } from '../../util/errors.js' import timingSafeEqual from './timing_safe_equal.js' import cbcTag from './cbc_tag.js' import { isCryptoKey, getKeyObject } from './webcrypto.js' -import type { KeyLike } from '../../types.d' +import type { KeyLike } from '../../types' import isKeyObject from './is_key_object.js' import invalidKeyInput from './invalid_key_input.js' diff --git a/src/runtime/node/digest.ts b/src/runtime/node/digest.ts index 883df3a26c..b267f2e3c5 100644 --- a/src/runtime/node/digest.ts +++ b/src/runtime/node/digest.ts @@ -1,5 +1,5 @@ import { createHash } from 'crypto' -import type { DigestFunction } from '../interfaces.d' +import type { DigestFunction } from '../interfaces' const digest: DigestFunction = ( algorithm: 'sha256' | 'sha384' | 'sha512', diff --git a/src/runtime/node/encrypt.ts b/src/runtime/node/encrypt.ts index 4b35474d62..e040bb9613 100644 --- a/src/runtime/node/encrypt.ts +++ b/src/runtime/node/encrypt.ts @@ -1,12 +1,12 @@ import { KeyObject, createCipheriv } from 'crypto' import type { CipherGCMTypes } from 'crypto' -import type { EncryptFunction } from '../interfaces.d' +import type { EncryptFunction } from '../interfaces' import checkIvLength from '../../lib/check_iv_length.js' import checkCekLength from './check_cek_length.js' import { concat } from '../../lib/buffer_utils.js' import cbcTag from './cbc_tag.js' -import type { KeyLike } from '../../types.d' +import type { KeyLike } from '../../types' import { isCryptoKey, getKeyObject } from './webcrypto.js' import isKeyObject from './is_key_object.js' import invalidKeyInput from './invalid_key_input.js' diff --git a/src/runtime/node/fetch_jwks.ts b/src/runtime/node/fetch_jwks.ts index 42d8e96851..fe6e0e7e3c 100644 --- a/src/runtime/node/fetch_jwks.ts +++ b/src/runtime/node/fetch_jwks.ts @@ -4,7 +4,7 @@ import { once } from 'events' import type { ClientRequest, IncomingMessage } from 'http' import type { RequestOptions } from 'https' -import type { FetchFunction } from '../interfaces.d' +import type { FetchFunction } from '../interfaces' import { JOSEError } from '../../util/errors.js' import { concat, decoder } from '../../lib/buffer_utils.js' diff --git a/src/runtime/node/jwk_to_key.ts b/src/runtime/node/jwk_to_key.ts index 795cba3082..4dd9c1fe6e 100644 --- a/src/runtime/node/jwk_to_key.ts +++ b/src/runtime/node/jwk_to_key.ts @@ -1,13 +1,13 @@ import { createPrivateKey, createPublicKey, createSecretKey } from 'crypto' import type { KeyObject, PublicKeyInput, PrivateKeyInput } from 'crypto' -import type { JWKParseFunction } from '../interfaces.d' +import type { JWKParseFunction } from '../interfaces' import { decode as base64url } from './base64url.js' import { JOSENotSupported } from '../../util/errors.js' import { setCurve } from './get_named_curve.js' import { setModulusLength } from './check_modulus_length.js' import Asn1SequenceEncoder from './asn1_sequence_encoder.js' -import type { JWK } from '../../types.d' +import type { JWK } from '../../types' const [major, minor] = process.version .substr(1) diff --git a/src/runtime/node/key_to_jwk.ts b/src/runtime/node/key_to_jwk.ts index ae1753ce0f..294d385daa 100644 --- a/src/runtime/node/key_to_jwk.ts +++ b/src/runtime/node/key_to_jwk.ts @@ -1,6 +1,6 @@ import { KeyObject, createPublicKey } from 'crypto' -import type { JWKConvertFunction } from '../interfaces.d' -import type { JWK } from '../../types.d' +import type { JWKConvertFunction } from '../interfaces' +import type { JWK } from '../../types' import { encode as base64url } from './base64url.js' import Asn1SequenceDecoder from './asn1_sequence_decoder.js' import { JOSENotSupported } from '../../util/errors.js' diff --git a/src/runtime/node/pbes2kw.ts b/src/runtime/node/pbes2kw.ts index 5abf831f25..798df50e8a 100644 --- a/src/runtime/node/pbes2kw.ts +++ b/src/runtime/node/pbes2kw.ts @@ -1,6 +1,6 @@ import { promisify } from 'util' import { pbkdf2 as pbkdf2cb } from 'crypto' -import type { Pbes2KWDecryptFunction, Pbes2KWEncryptFunction } from '../interfaces.d' +import type { Pbes2KWDecryptFunction, Pbes2KWEncryptFunction } from '../interfaces' import random from './random.js' import { p2s as concatSalt } from '../../lib/buffer_utils.js' import { encode as base64url } from './base64url.js' diff --git a/src/runtime/node/rsaes.ts b/src/runtime/node/rsaes.ts index 219a0b68bd..66fc30c697 100644 --- a/src/runtime/node/rsaes.ts +++ b/src/runtime/node/rsaes.ts @@ -1,5 +1,5 @@ import { KeyObject, publicEncrypt, constants, privateDecrypt } from 'crypto' -import type { RsaEsDecryptFunction, RsaEsEncryptFunction } from '../interfaces.d' +import type { RsaEsDecryptFunction, RsaEsEncryptFunction } from '../interfaces' import checkModulusLength from './check_modulus_length.js' import { isCryptoKey, getKeyObject } from './webcrypto.js' import isKeyObject from './is_key_object.js' diff --git a/src/runtime/node/sign.ts b/src/runtime/node/sign.ts index fbc2c6f32c..e8d2e1d38e 100644 --- a/src/runtime/node/sign.ts +++ b/src/runtime/node/sign.ts @@ -1,7 +1,7 @@ import * as crypto from 'crypto' import { promisify } from 'util' -import type { SignFunction } from '../interfaces.d' +import type { SignFunction } from '../interfaces' import nodeDigest from './dsa_digest.js' import hmacDigest from './hmac_digest.js' import nodeKey from './node_key.js' diff --git a/src/runtime/node/timing_safe_equal.ts b/src/runtime/node/timing_safe_equal.ts index 3d0981f22f..fa7ed45a21 100644 --- a/src/runtime/node/timing_safe_equal.ts +++ b/src/runtime/node/timing_safe_equal.ts @@ -1,6 +1,6 @@ import { timingSafeEqual as impl } from 'crypto' -import type { TimingSafeEqual } from '../interfaces.d' +import type { TimingSafeEqual } from '../interfaces' const timingSafeEqual: TimingSafeEqual = impl diff --git a/src/runtime/node/verify.ts b/src/runtime/node/verify.ts index 40509871f3..e59cbf8bcb 100644 --- a/src/runtime/node/verify.ts +++ b/src/runtime/node/verify.ts @@ -1,7 +1,7 @@ import * as crypto from 'crypto' import { promisify } from 'util' -import type { VerifyFunction } from '../interfaces.d' +import type { VerifyFunction } from '../interfaces' import nodeDigest from './dsa_digest.js' import nodeKey from './node_key.js' import sign from './sign.js' diff --git a/src/runtime/node/zlib.ts b/src/runtime/node/zlib.ts index 30801a95bd..cb4bf5b72b 100644 --- a/src/runtime/node/zlib.ts +++ b/src/runtime/node/zlib.ts @@ -1,7 +1,7 @@ import { promisify } from 'util' import { inflateRaw as inflateRawCb, deflateRaw as deflateRawCb } from 'zlib' -import type { InflateFunction, DeflateFunction } from '../../types.d' +import type { InflateFunction, DeflateFunction } from '../../types' const inflateRaw = promisify(inflateRawCb) const deflateRaw = promisify(deflateRawCb) diff --git a/src/util/decode_protected_header.ts b/src/util/decode_protected_header.ts index 75eff2dbad..ca0160b7e4 100644 --- a/src/util/decode_protected_header.ts +++ b/src/util/decode_protected_header.ts @@ -1,7 +1,7 @@ import { decode as base64url } from './base64url.js' import { decoder } from '../lib/buffer_utils.js' import isObject from '../lib/is_object.js' -import type { JWSHeaderParameters, JWEHeaderParameters } from '../types.d' +import type { JWSHeaderParameters, JWEHeaderParameters } from '../types' export type ProtectedHeaderParameters = JWSHeaderParameters & JWEHeaderParameters diff --git a/src/util/generate_key_pair.ts b/src/util/generate_key_pair.ts index ac54a0d769..cba5e8084e 100644 --- a/src/util/generate_key_pair.ts +++ b/src/util/generate_key_pair.ts @@ -1,5 +1,5 @@ import { generateKeyPair as generate } from '../runtime/generate.js' -import type { KeyLike } from '../types.js' +import type { KeyLike } from '../types' export interface GenerateKeyPairOptions { /** diff --git a/src/util/generate_secret.ts b/src/util/generate_secret.ts index 8fc1e90593..6cbe30e075 100644 --- a/src/util/generate_secret.ts +++ b/src/util/generate_secret.ts @@ -1,5 +1,5 @@ import { generateSecret as generate } from '../runtime/generate.js' -import type { KeyLike } from '../types.d' +import type { KeyLike } from '../types' export interface GenerateSecretOptions { /**