diff --git a/src/constants.ts b/src/constants.ts index 1272c6e..0c24aca 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -3,9 +3,7 @@ // // SPDX-License-Identifier: MIT -import fs from 'fs'; - -const pkg = JSON.parse(fs.readFileSync('package.json', { encoding: 'utf-8' })); +import { version } from '../package.json'; export const CLIENT_ID_LENGTH = 20; export const CLIENT_SECRET_LENGTH = 40; @@ -16,7 +14,7 @@ export const JTI_LENGTH = 36; export const JWT_EXPIRATION = 300; export const JWT_LEEWAY = 60; -export const USER_AGENT = `duo_universal_node/${pkg.version}`; +export const USER_AGENT = `duo_universal_node/${version}`; export const SIG_ALGORITHM = 'HS512'; export const GRANT_TYPE = 'authorization_code'; export const CLIENT_ASSERTION_TYPE = 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer'; diff --git a/tsconfig.json b/tsconfig.json index 504e139..738556a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,19 +11,10 @@ "declaration": true, "strict": true, "esModuleInterop": true, - "rootDir": "src", - "types": [ - "node", - "jest", - "jest-extended" - ] + "resolveJsonModule": true, + "rootDirs": ["src", "."], + "types": ["node", "jest", "jest-extended"] }, - "include": [ - "src/**/*.ts", - "test/**/*.ts" - ], - "exclude": [ - "node_modules", - "dist" - ] + "include": ["src/**/*.ts", "test/**/*.ts"], + "exclude": ["node_modules", "dist"] }