diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..59f25f9 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,5 @@ +module.exports = { + extends: [ + 'semistandard' + ] +}; diff --git a/lib/app.ts b/lib/app.ts index 350fdf1..b34a7c5 100644 --- a/lib/app.ts +++ b/lib/app.ts @@ -18,10 +18,10 @@ app.use(cookie()); app.keys = [process.env.SESSION_KEYS as string]; app.use(session({}, app)); -app.use(passport.initialize()) -app.use(passport.session()) +app.use(passport.initialize()); +app.use(passport.session()); // Application error logging. app.on('error', console.error); -export default app; \ No newline at end of file +export default app; diff --git a/lib/constants/strategies.ts b/lib/constants/strategies.ts index ea91c22..2b56a03 100644 --- a/lib/constants/strategies.ts +++ b/lib/constants/strategies.ts @@ -1,7 +1,7 @@ export enum STRATEGIES { - LOCAL, - APPLE, - FACEBOOK, - FIDO2, - GOOGLE, + LOCAL, + APPLE, + FACEBOOK, + FIDO2, + GOOGLE, } diff --git a/lib/controllers/auth.ts b/lib/controllers/auth.ts index 8fc1ddc..1f83fb4 100644 --- a/lib/controllers/auth.ts +++ b/lib/controllers/auth.ts @@ -1,8 +1,149 @@ -// const errors = require('restify-errors'); +// // const errors = require('restify-errors'); -// const config = require('../config'); +// // const config = require('../config'); -// const handlePassportResponse = (req, res, next) => (err, user, info) => { +// // const handlePassportResponse = (req, res, next) => (err, user, info) => { +// // if (err) { +// // return next(err); +// // } + +// // const isVerifiedUser = user && +// // user.isRegistrationVerified(); + +// // if (user && isVerifiedUser) { +// // return res.send({ ...user.toAuthJSON() }); +// // } else if (user && !isVerifiedUser){ +// // return res.send({ +// // registrationSuccess: true, +// // nextSteps: 'Check your email for our confirmation email, you will not be able to login without confirming.' +// // }); +// // } + +// // return res.send(400, info); +// // }; + +// // module.exports = function (server, auth) { +// // const { passport } = auth; + +// // /* Local Auth */ +// // server.post('/auth', (req, res, next) => { +// // const { body: { username = null, password = null } = {} } = req; + +// // if (!username || !password) { +// // let errors = {}; + +// // if (!username) { +// // errors.username = 'is required'; +// // } + +// // if (!password) { +// // errors.password = 'is required'; +// // } + +// // return res.send(422, { errors }); +// // } + +// // const callback = handlePassportResponse(req, res, next); +// // return passport.authenticate('local', { session: false }.then(callback)(req, res, next); +// // }); + +// // /** +// // * SERVICES +// // */ + +// // /* Google */ +// // server.get( +// // '/auth/google', +// // passport.authenticate('google', { scope: 'profile email', session: false }), +// // ); + +// // server.get( +// // '/auth/google/callback', +// // (req, res, next) => { +// // const callback = handlePassportResponse(req, res, next); +// // return passport.authenticate( +// // 'google', +// // { failureRedirect: '/login' }, +// // callback, +// // )(req, res, next); +// // }, +// // ); + +// // /* Facebook */ +// // server.get( +// // '/auth/facebook/login', +// // passport.authenticate('facebook', { +// // scope: ['email', 'public_profile'], +// // session: false, +// // }), +// // ); + +// // server.get( +// // '/auth/facebook/loggedin', +// // (req, res, next) => { +// // const callback = handlePassportResponse(req, res, next); +// // return passport.authenticate( +// // 'facebook', +// // { failureRedirect: '/login' }, +// // callback, +// // )(req, res, next); +// // } +// // ); + +// // server.get( +// // '/auth/facebook/link', +// // auth.secure, +// // (req, res, next) => { +// // req.user.record.setLinkCheckBit((err, linkCheckBit) => { +// // passport.authenticate('facebookLink', { +// // scope: ['email', 'public_profile'], +// // session: false, +// // state: linkCheckbit, +// // })(req, res, next); +// // }); +// // }, +// // ); +// // +// // server.get( +// // '/auth/facebook/linked', +// // (req, res, next) => { +// // const linkCheckBit = req.query.state; +// // +// // return passport.authenticate( +// // 'facebook', +// // { failureRedirect: '/profile' }, +// // (err, profile) => { +// // if (err) { +// // return next(err); +// // } +// // +// // User.linkFacebookProfile(linkCheckBit, profile, (err, user) => { +// // if (err) { +// // return next(err); +// // } +// // +// // if (!user) { +// // return next(err, false, 'Linking the account to Facebook was unsuccessful, please try again.'); +// // } +// // +// // res.send({ +// // success: true, +// // info: 'Facerbook account successfully linked', +// // }); +// // }); +// // }, +// // )(req, res, next); +// // } +// // ); +// }; + +// import Koa from 'koa'; +// import Router from 'koa-router'; +// import { StatusCodes } from 'http-status-codes'; + +// import Users from 'grow-db/lib/models/users'; + +// const handlePassportResponse = (ctx: Koa.Context) => (err, user, info) => { // if (err) { // return next(err); // } @@ -22,210 +163,65 @@ // return res.send(400, info); // }; -// module.exports = function (server, auth) { -// const { passport } = auth; +// const routerOpts: Router.IRouterOptions = { +// prefix: '/auth', +// }; -// /* Local Auth */ -// server.post('/auth', (req, res, next) => { -// const { body: { username = null, password = null } = {} } = req; +// const router: Router = new Router(routerOpts); -// if (!username || !password) { -// let errors = {}; +// router.get('/', async (ctx: Koa.Context) => { +// const data = await Customers.find({}).exec(); +// ctx.body = { data }; +// }); -// if (!username) { -// errors.username = 'is required'; -// } +// router.get('/:customer_id', async (ctx: Koa.Context) => { +// const data = await Customers.findById(ctx.params.customer_id).populate('person').exec(); +// if (!data) { +// ctx.throw(StatusCodes.NOT_FOUND); +// } +// ctx.body = { data }; +// }); -// if (!password) { -// errors.password = 'is required'; -// } +// router.delete('/:customer_id', async (ctx: Koa.Context) => { +// const data = await Customers.findByIdAndDelete(ctx.params.customer_id).exec(); +// if (!data) { +// ctx.throw(StatusCodes.NOT_FOUND); +// } +// ctx.body = { success: true, data }; +// }); -// return res.send(422, { errors }); +// router.post('/', async (ctx: Koa.Context) => { +// const data = await Customers.create(ctx.body); +// data.save(); +// ctx.body = { success: true, data }; +// }); + +// router.post('/', async (ctx: Koa.Context) => { +// const { body: { username = null, password = null } = {} } = ctx; + +// if (!username || !password) { +// let errors = {}; + +// if (!username) { +// errors.username = 'is required'; // } -// const callback = handlePassportResponse(req, res, next); -// return passport.authenticate('local', { session: false }.then(callback)(req, res, next); -// }); +// if (!password) { +// errors.password = 'is required'; +// } -// /** -// * SERVICES -// */ +// ctx.status = StatusCodes.UNPROCESSABLE_ENTITY; +// ctx.throw(422, { errors }); +// } -// /* Google */ -// server.get( -// '/auth/google', -// passport.authenticate('google', { scope: 'profile email', session: false }), -// ); +// const callback = handlePassportResponse(req, res, next); +// return passport.authenticate('local', { session: false }, callback)(req, res, next); +// }); -// server.get( -// '/auth/google/callback', -// (req, res, next) => { -// const callback = handlePassportResponse(req, res, next); -// return passport.authenticate( -// 'google', -// { failureRedirect: '/login' }, -// callback, -// )(req, res, next); -// }, -// ); - -// /* Facebook */ -// server.get( -// '/auth/facebook/login', -// passport.authenticate('facebook', { -// scope: ['email', 'public_profile'], -// session: false, -// }), -// ); - -// server.get( -// '/auth/facebook/loggedin', -// (req, res, next) => { -// const callback = handlePassportResponse(req, res, next); -// return passport.authenticate( -// 'facebook', -// { failureRedirect: '/login' }, -// callback, -// )(req, res, next); -// } -// ); - -// server.get( -// '/auth/facebook/link', -// auth.secure, -// (req, res, next) => { -// req.user.record.setLinkCheckBit((err, linkCheckBit) => { -// passport.authenticate('facebookLink', { -// scope: ['email', 'public_profile'], -// session: false, -// state: linkCheckbit, -// })(req, res, next); -// }); -// }, -// ); -// -// server.get( -// '/auth/facebook/linked', -// (req, res, next) => { -// const linkCheckBit = req.query.state; -// -// return passport.authenticate( -// 'facebook', -// { failureRedirect: '/profile' }, -// (err, profile) => { -// if (err) { -// return next(err); -// } -// -// User.linkFacebookProfile(linkCheckBit, profile, (err, user) => { -// if (err) { -// return next(err); -// } -// -// if (!user) { -// return next(err, false, 'Linking the account to Facebook was unsuccessful, please try again.'); -// } -// -// res.send({ -// success: true, -// info: 'Facerbook account successfully linked', -// }); -// }); -// }, -// )(req, res, next); -// } -// ); -}; - -import Koa from 'koa'; -import Router from 'koa-router'; -import { StatusCodes } from 'http-status-codes'; - -import Users from 'grow-db/lib/models/users'; - -const handlePassportResponse = (ctx: Koa.Context) => (err, user, info) => { - if (err) { - return next(err); - } - - const isVerifiedUser = user && - user.isRegistrationVerified(); - - if (user && isVerifiedUser) { - return res.send({ ...user.toAuthJSON() }); - } else if (user && !isVerifiedUser){ - return res.send({ - registrationSuccess: true, - nextSteps: 'Check your email for our confirmation email, you will not be able to login without confirming.' - }); - } - - return res.send(400, info); -}; - -const routerOpts: Router.IRouterOptions = { - prefix: '/auth', -}; - -const router: Router = new Router(routerOpts); - -router.get('/', async (ctx: Koa.Context) => { - const data = await Customers.find({}).exec(); - ctx.body = { data }; -}); - - -router.get('/:customer_id', async (ctx: Koa.Context) => { - const data = await Customers.findById(ctx.params.customer_id).populate('person').exec(); - if (!data) { - ctx.throw(StatusCodes.NOT_FOUND); - } - ctx.body = { data }; -}); - -router.delete('/:customer_id', async (ctx: Koa.Context) => { - const data = await Customers.findByIdAndDelete(ctx.params.customer_id).exec(); - if (!data) { - ctx.throw(StatusCodes.NOT_FOUND); - } - ctx.body = { success: true, data }; -}); - - -router.post('/', async (ctx: Koa.Context) => { - const data = await Customers.create(ctx.body); - data.save(); - ctx.body = { success: true, data }; -}); - - -router.post('/', async (ctx: Koa.Context) => { - const { body: { username = null, password = null } = {} } = ctx; - - if (!username || !password) { - let errors = {}; - - if (!username) { - errors.username = 'is required'; - } - - if (!password) { - errors.password = 'is required'; - } - - ctx.status = StatusCodes.UNPROCESSABLE_ENTITY; - ctx.throw(422, { errors }); - } - - const callback = handlePassportResponse(req, res, next); - return passport.authenticate('local', { session: false }, callback)(req, res, next); -}); - - -router.patch('/:customer_id', async (ctx: Koa.Context) => { - const data = await Customers.findByIdAndUpdate(ctx.params.customer_id); - if (!data) { - ctx.throw(StatusCodes.NOT_FOUND); - } - ctx.body = { success: true, data }; -}); \ No newline at end of file +// router.patch('/:customer_id', async (ctx: Koa.Context) => { +// const data = await Customers.findByIdAndUpdate(ctx.params.customer_id); +// if (!data) { +// ctx.throw(StatusCodes.NOT_FOUND); +// } +// ctx.body = { success: true, data }; +// }); diff --git a/lib/database/database.connection.ts b/lib/database/database.connection.ts index 4675347..7d275f5 100644 --- a/lib/database/database.connection.ts +++ b/lib/database/database.connection.ts @@ -7,5 +7,5 @@ const DB_PORT = process.env.DB_PORT || 27017; const DB_NAME = process.env.DB_NAME || 'auth'; export const connection = mongoose.connect( - `${DB_USER}:${DB_PASS}@${DB_HOST}:${DB_PORT}/${DB_NAME}` + `${DB_USER}:${DB_PASS}@${DB_HOST}:${DB_PORT}/${DB_NAME}` ); diff --git a/lib/middleware/errorHandler.ts b/lib/middleware/errorHandler.ts index 27dfea6..2f6579b 100644 --- a/lib/middleware/errorHandler.ts +++ b/lib/middleware/errorHandler.ts @@ -1,13 +1,14 @@ -import { StatusCodes } from "http-status-codes"; -import { Context, Next } from "koa"; +import { StatusCodes } from 'http-status-codes'; +import { Context, Next } from 'koa'; export const errorHandler = async (ctx: Context, next: Next) => { - try { - await next(); - } catch (error: any) { - ctx.status = error.statusCode || error.status || StatusCodes.INTERNAL_SERVER_ERROR; - error.status = ctx.status; - ctx.body = { error }; - ctx.app.emit('error', error, ctx); - } + try { + await next(); + } catch (error: any) { + ctx.status = + error.statusCode || error.status || StatusCodes.INTERNAL_SERVER_ERROR; + error.status = ctx.status; + ctx.body = { error }; + ctx.app.emit('error', error, ctx); + } }; diff --git a/lib/middleware/performance.ts b/lib/middleware/performance.ts index 54d4c66..524aa09 100644 --- a/lib/middleware/performance.ts +++ b/lib/middleware/performance.ts @@ -2,14 +2,14 @@ import { Next } from 'koa'; import { KoaContext } from '../types/KoaContext'; export const performanceLogger = async (ctx: KoaContext, next: Next) => { - await next(); - const rt = ctx.response.get('X-Response-Time'); - console.log(`${ctx.method} ${ctx.url} - ${rt}`); + await next(); + const rt = ctx.response.get('X-Response-Time'); + console.log(`${ctx.method} ${ctx.url} - ${rt}`); }; export const perfromanceTimer = async (ctx: KoaContext, next: Next) => { - const start = Date.now(); - await next(); - const ms = Date.now() - start; - ctx.set('X-Response-Time', `${ms}ms`); + const start = Date.now(); + await next(); + const ms = Date.now() - start; + ctx.set('X-Response-Time', `${ms}ms`); }; diff --git a/lib/schema/auth.ts b/lib/schema/auth.ts index cd603d4..00d8594 100644 --- a/lib/schema/auth.ts +++ b/lib/schema/auth.ts @@ -1,5 +1,11 @@ import { JwtPayload } from 'jsonwebtoken'; -import { Document, InferSchemaType, Model, Schema, StringSchemaDefinition, Types } from 'mongoose'; +import { + InferSchemaType, + Model, + Schema, + StringSchemaDefinition, + Types, +} from 'mongoose'; import { Strategy } from './strategy'; import { STRATEGIES } from '../constants/strategies'; @@ -8,127 +14,139 @@ import { encrypt, verify as verifyPassword } from '../utils/password'; import { generateResetToken } from '../utils/tokens'; export type Auth = { - is2FA?: boolean; - record: StringSchemaDefinition; - username: string; -} + is2FA?: boolean; + record: StringSchemaDefinition; + username: string; +}; export type AuthPrivate = Auth & { - strategies: Types.ArraySubdocument; -} + strategies: Types.ArraySubdocument; +}; export interface AuthMethods { - authenticate(password: string): boolean; - getAuthStrategy(method?: STRATEGIES): Strategy | false; - getResetLink(route: string): Promise; - getResetToken(): Promise; - getToken(props?: Omit): string; - setPassword(password: string): Promise; + authenticate(password: string): boolean; + getAuthStrategy(method?: STRATEGIES): Strategy | false; + getResetLink(route: string): Promise; + getResetToken(): Promise; + getToken(props?: Omit): string; + setPassword(password: string): Promise; } export interface AuthModel extends Model { - authenticate(password: any): boolean; - findByUsername(username: string): Promise; - isUsernameAvailable(username: string): Promise; - findUserForReset(strategy: STRATEGIES, token: string): Promise; - resetPassword(token: string, password: string): Promise; -} + authenticate(password: any): boolean; + findByUsername(username: string): Promise; + isUsernameAvailable(username: string): Promise; + findUserForReset( + strategy: STRATEGIES, + token: string + ): Promise; + resetPassword(token: string, password: string): Promise; +} export const AuthSchema = new Schema( - { - is2FA: { type: Boolean, default: false }, - record: { type: Types.ObjectId }, - strategies: { type: Types.ArraySubdocument, required: true }, - username: { type: String, required: true, unique: true }, - }, - { - minimize: true, - timestamps: true, - }, + { + is2FA: { type: Boolean, default: false }, + record: { type: Types.ObjectId }, + strategies: { type: Types.ArraySubdocument, required: true }, + username: { type: String, required: true, unique: true }, + }, + { + minimize: true, + timestamps: true, + } ); AuthSchema.methods = { - authenticate: function(password: string) { - const strategy = this.getAuthStrategy(STRATEGIES.LOCAL); - return !!strategy && verifyPassword(password, strategy.key); - }, + authenticate: function (password: string) { + const strategy = this.getAuthStrategy(STRATEGIES.LOCAL); + return !!strategy && verifyPassword(password, strategy.key); + }, - getAuthStrategy: function(method = STRATEGIES.LOCAL) { - return this.strategies.filter((strategy: Strategy) => strategy.method === method).pop() || false; - }, + getAuthStrategy: function (method = STRATEGIES.LOCAL) { + return ( + this.strategies + .filter((strategy: Strategy) => strategy.method === method) + .pop() || false + ); + }, - getToken: function(props = {}) { - return sign({ - sub: this._id, - ...props, - }); - }, + getToken: function (props = {}) { + return sign({ + sub: this._id, + ...props, + }); + }, - getResetLink: async function (route) { - const resetToken = await this.getResetToken(); - if (resetToken) { - let resetRoute = route; - resetRoute = resetRoute.replace(':user_id', this._id); - resetRoute = resetRoute.replace(':reset_token?', resetToken); - const resetUrl = `${process.env.URL}${resetRoute}`; - console.log('[sendPasswordReset] resetUrl:', resetUrl); - return resetUrl; - } - }, + getResetLink: async function (route) { + const resetToken = await this.getResetToken(); + if (resetToken) { + let resetRoute = route; + resetRoute = resetRoute.replace(':user_id', this._id); + resetRoute = resetRoute.replace(':reset_token?', resetToken); + const resetUrl = `${process.env.URL}${resetRoute}`; + console.log('[sendPasswordReset] resetUrl:', resetUrl); + return resetUrl; + } + }, - getResetToken: async function () { - const { key, token } = generateResetToken(this._id); - this.resetCheckBit = key; - await this.save().catch(() => undefined); - return token; - }, - - setPassword: async function (password) { - const key = encrypt(password); - const hasLocalStrategy = !!this.getAuthStrategy(STRATEGIES.LOCAL); - const strategy = { - key, - method: STRATEGIES.LOCAL, - resetToken: undefined, - }; - - if (hasLocalStrategy) { - await this.model('User').findOneAndUpdate( - { _id: this._id, 'strategies.method': STRATEGIES.LOCAL }, - { $set: { 'strategies.$': strategy } }, - { upsert: true }, - ).catch(); - return true; - } - this.credentials.push(strategy); - await this.save().catch(() => false); - return true; - }, + getResetToken: async function () { + const { key, token } = generateResetToken(this._id); + this.resetCheckBit = key; + await this.save().catch(() => undefined); + return token; + }, + + setPassword: async function (password) { + const key = encrypt(password); + const hasLocalStrategy = !!this.getAuthStrategy(STRATEGIES.LOCAL); + const strategy = { + key, + method: STRATEGIES.LOCAL, + resetToken: undefined, + }; + + if (hasLocalStrategy) { + await this.model('User') + .findOneAndUpdate( + { _id: this._id, 'strategies.method': STRATEGIES.LOCAL }, + { $set: { 'strategies.$': strategy } }, + { upsert: true }, + ) + .catch(); + return true; + } + this.credentials.push(strategy); + await this.save().catch(() => false); + return true; + } }; AuthSchema.statics = { - // authenticateAndGetRecordLocator: async function (username, password) { - // const auth = await this.findByUserName(username); - // if (auth && auth.authenticate(password)) { - // return auth?.record; - // } - // return false; - // }, + // authenticateAndGetRecordLocator: async function (username, password) { + // const auth = await this.findByUserName(username); + // if (auth && auth.authenticate(password)) { + // return auth?.record; + // } + // return false; + // }, - findByUsername: async function (username) { - return this.findOne({ username }); - }, + findByUsername: async function (username) { + return this.findOne({ username }); + }, - isUsernameAvailable: async function (username) { - return !!!this.findByUsername(username); - }, + isUsernameAvailable: async function (username) { + return !this.findByUsername(username); + }, - resetPassword: async function (token, password) { - const decoded = verifyJwt(token); - const { sub, key } = decoded as JwtPayload; - const auth = await this.findOne({ _id: sub, 'strategies.resetToken': key }).catch(); - return !!auth && auth.setPassword(password); - }, + resetPassword: async function (token, password) { + const decoded = verifyJwt(token); + const { sub, key } = decoded as JwtPayload; + const auth = await this.findOne({ + _id: sub, + 'strategies.resetToken': key, + }).catch(); + return !!auth && auth.setPassword(password); + } }; export type AuthSchema = InferSchemaType; diff --git a/lib/schema/strategy.ts b/lib/schema/strategy.ts index 11d450c..a97551c 100644 --- a/lib/schema/strategy.ts +++ b/lib/schema/strategy.ts @@ -2,24 +2,24 @@ import { InferSchemaType, Schema, Types } from 'mongoose'; import { STRATEGIES } from '../constants/strategies'; export const Strategy = new Schema( - { - method: { - type: Number, - enum: Object.values(STRATEGIES), - index: true, - required: true, - unique: true, - }, - externalId: { type: String, index: true }, - key: { type: String, required: true, trim: true }, - profile: {}, - resetToken: { type: String }, - forceReset: { type: Boolean }, - }, - { - minimize: true, - timestamps: true, + { + method: { + type: Number, + enum: Object.values(STRATEGIES), + index: true, + required: true, + unique: true }, + externalId: { type: String, index: true }, + key: { type: String, required: true, trim: true }, + profile: {}, + resetToken: { type: String }, + forceReset: { type: Boolean } + }, + { + minimize: true, + timestamps: true + } ); export type Strategy = InferSchemaType; diff --git a/lib/server.ts b/lib/server.ts index f05dc4a..9a8f2b8 100644 --- a/lib/server.ts +++ b/lib/server.ts @@ -1,12 +1,12 @@ import dotenv from 'dotenv'; -dotenv.config(); import app from './app'; import { connection } from './database/database.connection'; +dotenv.config(); const PORT: number = Number(process.env.PORT) || 9000; connection.then( - () => app.listen(PORT), - (err) => console.error('ERROR!', err), + () => app.listen(PORT), + (err) => console.error('ERROR!', err), ); diff --git a/lib/strategies/local.ts b/lib/strategies/local.ts index 85236d6..8e85cca 100644 --- a/lib/strategies/local.ts +++ b/lib/strategies/local.ts @@ -1,20 +1,19 @@ import passport from 'koa-passport'; import { Strategy } from 'passport-local'; -import bcrypt from 'bcrypt'; import Auth from '../model/auth'; -import { AuthSchema } from '../schema/auth'; -export const LocalStrategy = passport.use(new Strategy(async (username, password, done) => { +export const localStrategy = passport.use( + new Strategy(async (username, password, done) => { const user = await Auth.findOne({ - where: { - username, - } + where: { + username, + } }).catch(); if (user && user.authenticate(password)) { - done(null, user); + done(null, user); } else { - done(null, false); + done(null, false); } - } -)); + }) +); diff --git a/lib/utils/auth.ts b/lib/utils/auth.ts index b8b8ae4..1daf80b 100644 --- a/lib/utils/auth.ts +++ b/lib/utils/auth.ts @@ -2,13 +2,16 @@ import Auth from '../model/auth'; import { AuthModel, AuthPrivate } from '../schema/auth'; import { sign } from './jwt'; -export const getAuthenticationBundle = async (username: string, password: string) => { - const auth = await Auth.findByUsername(username).catch(); - const isAuthenticated = !!auth && (auth as AuthModel).authenticate(password); - const record = isAuthenticated ? (auth as AuthPrivate).record : null; - const token = isAuthenticated ? (auth as AuthModel).getToken() : sign(); - return { - record, - token, - }; +export const getAuthenticationBundle = async ( + username: string, + password: string, +) => { + const auth = await Auth.findByUsername(username).catch(); + const isAuthenticated = !!auth && (auth as AuthModel).authenticate(password); + const record = isAuthenticated ? (auth as AuthPrivate).record : null; + const token = isAuthenticated ? (auth as AuthModel).getToken() : sign(); + return { + record, + token, + }; }; diff --git a/lib/utils/jwt.ts b/lib/utils/jwt.ts index 053a1c8..5c55a3a 100644 --- a/lib/utils/jwt.ts +++ b/lib/utils/jwt.ts @@ -1,31 +1,40 @@ import jwt, { JwtPayload } from 'jsonwebtoken'; export interface TokenProps { - aud?: string; - exp?: number | Date; - iss?: string; - sub: string | null; - [key: string]: any; + aud?: string; + exp?: number | Date; + iss?: string; + sub: string | null; + [key: string]: any; } export type SignProps = string | TokenProps | void; export const sign = (props: SignProps) => { - const today = new Date(); - const { sub = null, ...rest }: TokenProps = typeof props === 'string' || typeof props === 'undefined' ? { sub: props || null } : props; - let exp = rest.exp; - if (!exp) { - exp = new Date(today); - exp.setDate(today.getDate() + parseInt(process.env.JWT_DAYS_VALID as string)); - exp = exp.getTime() / 1000; - } - return jwt.sign({ - aud: rest.aud || process.env.JWT_AUDIENCE, - exp, - iat: today.getTime(), - iss: rest.iss || process.env.JWT_ISSUER, - sub, - }, process.env.JWT_SECRET || 'secret'); + const today = new Date(); + const { sub = null, ...rest }: TokenProps = + typeof props === 'string' || typeof props === 'undefined' + ? { sub: props || null } + : props; + let exp = rest.exp; + if (!exp) { + exp = new Date(today); + exp.setDate( + today.getDate() + parseInt(process.env.JWT_DAYS_VALID as string), + ); + exp = exp.getTime() / 1000; + } + return jwt.sign( + { + exp, + sub, + aud: rest.aud || process.env.JWT_AUDIENCE, + iat: today.getTime(), + iss: rest.iss || process.env.JWT_ISSUER, + }, + process.env.JWT_SECRET || 'secret', + ); }; -export const verify = (token: string) => jwt.verify(token, process.env.JWT_SECRET || 'secret'); \ No newline at end of file +export const verify = (token: string) => + jwt.verify(token, process.env.JWT_SECRET || 'secret'); diff --git a/lib/utils/password.ts b/lib/utils/password.ts index 922f138..24908a8 100644 --- a/lib/utils/password.ts +++ b/lib/utils/password.ts @@ -1,12 +1,12 @@ import { pbkdf2Sync, randomBytes } from 'crypto'; export const encrypt = (password: string) => { - const salt = randomBytes(16).toString('hex'); - const hash = pbkdf2Sync(password, salt, 10000, 512, 'sha512').toString('hex'); - return `${salt}:${hash}`; + const salt = randomBytes(16).toString('hex'); + const hash = pbkdf2Sync(password, salt, 10000, 512, 'sha512').toString('hex'); + return `${salt}:${hash}`; }; export const verify = (test: string, secret: string) => { - const [salt, hash] = secret.split(':'); - return pbkdf2Sync(test, salt, 10000, 512, 'sha512').toString('hex') === hash; + const [salt, hash] = secret.split(':'); + return pbkdf2Sync(test, salt, 10000, 512, 'sha512').toString('hex') === hash; }; diff --git a/lib/utils/tokens.ts b/lib/utils/tokens.ts index eb8aa90..fcc8f75 100644 --- a/lib/utils/tokens.ts +++ b/lib/utils/tokens.ts @@ -1,13 +1,13 @@ import crypto from 'crypto'; -import { sign } from "./jwt"; +import { sign } from './jwt'; export const generateResetToken = (sub: string) => { - const key = crypto.randomBytes(16).toString('hex'); - const token = sign({ - sub, - key, - exp: (Date.now() + (24 * 60 * 60 * 1000)), - }); - return { key, token }; -}; \ No newline at end of file + const key = crypto.randomBytes(16).toString('hex'); + const token = sign({ + sub, + key, + exp: Date.now() + 24 * 60 * 60 * 1000, + }); + return { key, token }; +}; diff --git a/package.json b/package.json index 7715ac3..80e6273 100644 --- a/package.json +++ b/package.json @@ -6,14 +6,12 @@ "scripts": { "build": "tsc", "lint": "tslint --project tsconfig.json --format stylish", - "prettier:fix": "prettier-eslint --eslint-config-path ./.eslintrc.js --write '**/*.ts'", + "prettier:fix": "prettier-eslint --write '**/*.ts'", "serve": "ts-node src/server.ts", "start": "nodemon" }, "devDependencies": { "@tsconfig/node16": "^1.0.3", - "@types/bcrypt": "^5.0.0", - "@types/crypto-js": "^4.1.1", "@types/dotenv": "^8.2.0", "@types/http-status-codes": "^1.2.0", "@types/jsonwebtoken": "^9.0.1", @@ -32,6 +30,12 @@ "@types/passport-google-oauth": "^1.0.42", "@types/passport-jwt": "^3.0.8", "@types/passport-local": "^1.0.35", + "eslint": "^8.13.0", + "eslint-config-semistandard": "latest", + "eslint-config-standard": "^17.0.0", + "eslint-plugin-import": "^2.26.0", + "eslint-plugin-n": "^15.0.0", + "eslint-plugin-promise": "^6.0.0", "jest": "^29.4.2", "nodemon": "^2.0.20", "prettier": "^2.8.4", @@ -45,8 +49,6 @@ }, "dependencies": { "@simplewebauthn/server": "^7.2.0", - "bcrypt": "^5.1.0", - "crypto": "^1.0.1", "dotenv": "^16.0.3", "http-status-codes": "^2.2.0", "jsonwebtoken": "^9.0.0", diff --git a/yarn.lock b/yarn.lock index 17a189c..dcd2191 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1366,6 +1366,13 @@ __metadata: languageName: node linkType: hard +"@eslint/js@npm:8.39.0": + version: 8.39.0 + resolution: "@eslint/js@npm:8.39.0" + checksum: 63fe36e2bfb5ff5705d1c1a8ccecd8eb2f81d9af239713489e767b0e398759c0177fcc75ad62581d02942f2776903a8496d5fae48dc2d883dff1b96fcb19e9e2 + languageName: node + linkType: hard + "@fimbul/bifrost@npm:^0.21.0": version: 0.21.0 resolution: "@fimbul/bifrost@npm:0.21.0" @@ -1750,25 +1757,6 @@ __metadata: languageName: node linkType: hard -"@mapbox/node-pre-gyp@npm:^1.0.10": - version: 1.0.10 - resolution: "@mapbox/node-pre-gyp@npm:1.0.10" - dependencies: - detect-libc: ^2.0.0 - https-proxy-agent: ^5.0.0 - make-dir: ^3.1.0 - node-fetch: ^2.6.7 - nopt: ^5.0.0 - npmlog: ^5.0.1 - rimraf: ^3.0.2 - semver: ^7.3.5 - tar: ^6.1.11 - bin: - node-pre-gyp: bin/node-pre-gyp - checksum: 1a98db05d955b74dad3814679593df293b9194853698f3f5f1ed00ecd93128cdd4b14fb8767fe44ac6981ef05c23effcfdc88710e7c1de99ccb6f647890597c8 - languageName: node - linkType: hard - "@messageformat/core@npm:^3.0.1": version: 3.1.0 resolution: "@messageformat/core@npm:3.1.0" @@ -1821,8 +1809,6 @@ __metadata: dependencies: "@simplewebauthn/server": ^7.2.0 "@tsconfig/node16": ^1.0.3 - "@types/bcrypt": ^5.0.0 - "@types/crypto-js": ^4.1.1 "@types/dotenv": ^8.2.0 "@types/http-status-codes": ^1.2.0 "@types/jsonwebtoken": ^9.0.1 @@ -1841,9 +1827,13 @@ __metadata: "@types/passport-google-oauth": ^1.0.42 "@types/passport-jwt": ^3.0.8 "@types/passport-local": ^1.0.35 - bcrypt: ^5.1.0 - crypto: ^1.0.1 dotenv: ^16.0.3 + eslint: ^8.13.0 + eslint-config-semistandard: latest + eslint-config-standard: ^17.0.0 + eslint-plugin-import: ^2.26.0 + eslint-plugin-n: ^15.0.0 + eslint-plugin-promise: ^6.0.0 http-status-codes: ^2.2.0 jest: ^29.4.2 jsonwebtoken: ^9.0.0 @@ -2149,15 +2139,6 @@ __metadata: languageName: node linkType: hard -"@types/bcrypt@npm:^5.0.0": - version: 5.0.0 - resolution: "@types/bcrypt@npm:5.0.0" - dependencies: - "@types/node": "*" - checksum: 063c32c7a519d64768dfc0169a319b8244d6a6cb50a355c93992b3c5fee1dbc236526a1111f0e7bb25abc8b0473e5f40a5edfeb8b33cad2a6ea35aa2d7d7db14 - languageName: node - linkType: hard - "@types/body-parser@npm:*": version: 1.19.2 resolution: "@types/body-parser@npm:1.19.2" @@ -2196,13 +2177,6 @@ __metadata: languageName: node linkType: hard -"@types/crypto-js@npm:^4.1.1": - version: 4.1.1 - resolution: "@types/crypto-js@npm:4.1.1" - checksum: ea3d6a67b69f88baeb6af96004395903d2367a41bd5cd86306da23a44dd96589749495da50974a9b01bb5163c500764c8a33706831eade036bddae016417e3ea - languageName: node - linkType: hard - "@types/debug@npm:^4.1.7": version: 4.1.7 resolution: "@types/debug@npm:4.1.7" @@ -2325,6 +2299,13 @@ __metadata: languageName: node linkType: hard +"@types/json5@npm:^0.0.29": + version: 0.0.29 + resolution: "@types/json5@npm:0.0.29" + checksum: e60b153664572116dfea673c5bda7778dbff150498f44f998e34b5886d8afc47f16799280e4b6e241c0472aef1bc36add771c569c68fc5125fc2ae519a3eb9ac + languageName: node + linkType: hard + "@types/jsonwebtoken@npm:*, @types/jsonwebtoken@npm:^9.0.1": version: 9.0.1 resolution: "@types/jsonwebtoken@npm:9.0.1" @@ -2824,16 +2805,6 @@ __metadata: languageName: node linkType: hard -"are-we-there-yet@npm:^2.0.0": - version: 2.0.0 - resolution: "are-we-there-yet@npm:2.0.0" - dependencies: - delegates: ^1.0.0 - readable-stream: ^3.6.0 - checksum: 6c80b4fd04ecee6ba6e737e0b72a4b41bdc64b7d279edfc998678567ff583c8df27e27523bc789f2c99be603ffa9eaa612803da1d886962d2086e7ff6fa90c7c - languageName: node - linkType: hard - "are-we-there-yet@npm:^3.0.0": version: 3.0.1 resolution: "are-we-there-yet@npm:3.0.1" @@ -2867,6 +2838,29 @@ __metadata: languageName: node linkType: hard +"array-buffer-byte-length@npm:^1.0.0": + version: 1.0.0 + resolution: "array-buffer-byte-length@npm:1.0.0" + dependencies: + call-bind: ^1.0.2 + is-array-buffer: ^3.0.1 + checksum: 044e101ce150f4804ad19c51d6c4d4cfa505c5b2577bd179256e4aa3f3f6a0a5e9874c78cd428ee566ac574c8a04d7ce21af9fe52e844abfdccb82b33035a7c3 + languageName: node + linkType: hard + +"array-includes@npm:^3.1.6": + version: 3.1.6 + resolution: "array-includes@npm:3.1.6" + dependencies: + call-bind: ^1.0.2 + define-properties: ^1.1.4 + es-abstract: ^1.20.4 + get-intrinsic: ^1.1.3 + is-string: ^1.0.7 + checksum: f22f8cd8ba8a6448d91eebdc69f04e4e55085d09232b5216ee2d476dab3ef59984e8d1889e662c6a0ed939dcb1b57fd05b2c0209c3370942fc41b752c82a2ca5 + languageName: node + linkType: hard + "array-union@npm:^2.1.0": version: 2.1.0 resolution: "array-union@npm:2.1.0" @@ -2874,6 +2868,30 @@ __metadata: languageName: node linkType: hard +"array.prototype.flat@npm:^1.3.1": + version: 1.3.1 + resolution: "array.prototype.flat@npm:1.3.1" + dependencies: + call-bind: ^1.0.2 + define-properties: ^1.1.4 + es-abstract: ^1.20.4 + es-shim-unscopables: ^1.0.0 + checksum: 5a8415949df79bf6e01afd7e8839bbde5a3581300e8ad5d8449dea52639e9e59b26a467665622783697917b43bf39940a6e621877c7dd9b3d1c1f97484b9b88b + languageName: node + linkType: hard + +"array.prototype.flatmap@npm:^1.3.1": + version: 1.3.1 + resolution: "array.prototype.flatmap@npm:1.3.1" + dependencies: + call-bind: ^1.0.2 + define-properties: ^1.1.4 + es-abstract: ^1.20.4 + es-shim-unscopables: ^1.0.0 + checksum: 8c1c43a4995f12cf12523436da28515184c753807b3f0bc2ca6c075f71c470b099e2090cc67dba8e5280958fea401c1d0c59e1db0143272aef6cd1103921a987 + languageName: node + linkType: hard + "arrify@npm:^2.0.1": version: 2.0.1 resolution: "arrify@npm:2.0.1" @@ -2904,6 +2922,13 @@ __metadata: languageName: node linkType: hard +"available-typed-arrays@npm:^1.0.5": + version: 1.0.5 + resolution: "available-typed-arrays@npm:1.0.5" + checksum: 20eb47b3cefd7db027b9bbb993c658abd36d4edd3fe1060e83699a03ee275b0c9b216cc076ff3f2db29073225fb70e7613987af14269ac1fe2a19803ccc97f1a + languageName: node + linkType: hard + "babel-jest@npm:^29.5.0": version: 29.5.0 resolution: "babel-jest@npm:29.5.0" @@ -3001,16 +3026,6 @@ __metadata: languageName: node linkType: hard -"bcrypt@npm:^5.1.0": - version: 5.1.0 - resolution: "bcrypt@npm:5.1.0" - dependencies: - "@mapbox/node-pre-gyp": ^1.0.10 - node-addon-api: ^5.0.0 - checksum: a590b65d276d75d861dc85acc3128508b8f78c87431719658ea3be7996368b34b397b6efefe6bca0a3d555bf41a9267307fd4ce04e956598fca3ba81199c6706 - languageName: node - linkType: hard - "bignumber.js@npm:^9.0.0": version: 9.1.1 resolution: "bignumber.js@npm:9.1.1" @@ -3151,6 +3166,15 @@ __metadata: languageName: node linkType: hard +"builtins@npm:^5.0.1": + version: 5.0.1 + resolution: "builtins@npm:5.0.1" + dependencies: + semver: ^7.0.0 + checksum: 66d204657fe36522822a95b288943ad11b58f5eaede235b11d8c4edaa28ce4800087d44a2681524c340494aadb120a0068011acabe99d30e8f11a7d826d83515 + languageName: node + linkType: hard + "bytes@npm:3.1.2": version: 3.1.2 resolution: "bytes@npm:3.1.2" @@ -3194,7 +3218,7 @@ __metadata: languageName: node linkType: hard -"call-bind@npm:^1.0.0": +"call-bind@npm:^1.0.0, call-bind@npm:^1.0.2": version: 1.0.2 resolution: "call-bind@npm:1.0.2" dependencies: @@ -3488,7 +3512,7 @@ __metadata: languageName: node linkType: hard -"color-support@npm:^1.1.2, color-support@npm:^1.1.3": +"color-support@npm:^1.1.3": version: 1.1.3 resolution: "color-support@npm:1.1.3" bin: @@ -3525,7 +3549,7 @@ __metadata: languageName: node linkType: hard -"console-control-strings@npm:^1.0.0, console-control-strings@npm:^1.1.0": +"console-control-strings@npm:^1.1.0": version: 1.1.0 resolution: "console-control-strings@npm:1.1.0" checksum: 8755d76787f94e6cf79ce4666f0c5519906d7f5b02d4b884cf41e11dcd759ed69c57da0670afd9236d229a46e0f9cf519db0cd829c6dca820bb5a5c3def584ed @@ -3638,13 +3662,6 @@ __metadata: languageName: node linkType: hard -"crypto@npm:^1.0.1": - version: 1.0.1 - resolution: "crypto@npm:1.0.1" - checksum: 087fe3165bd94c333a49e6ed66a0193911f63eac38a24f379b3001a5fe260a59c413646e53a0f67875ba13902b2686d81dc703cb2c147a4ec727dcdc04e5645e - languageName: node - linkType: hard - "debug@npm:4, debug@npm:4.x, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4": version: 4.3.4 resolution: "debug@npm:4.3.4" @@ -3701,6 +3718,16 @@ __metadata: languageName: node linkType: hard +"define-properties@npm:^1.1.3, define-properties@npm:^1.1.4, define-properties@npm:^1.2.0": + version: 1.2.0 + resolution: "define-properties@npm:1.2.0" + dependencies: + has-property-descriptors: ^1.0.0 + object-keys: ^1.1.1 + checksum: e60aee6a19b102df4e2b1f301816804e81ab48bb91f00d0d935f269bf4b3f79c88b39e4f89eaa132890d23267335fd1140dfcd8d5ccd61031a0a2c41a54e33a6 + languageName: node + linkType: hard + "delegates@npm:^1.0.0": version: 1.0.0 resolution: "delegates@npm:1.0.0" @@ -3736,13 +3763,6 @@ __metadata: languageName: node linkType: hard -"detect-libc@npm:^2.0.0": - version: 2.0.1 - resolution: "detect-libc@npm:2.0.1" - checksum: ccb05fcabbb555beb544d48080179c18523a343face9ee4e1a86605a8715b4169f94d663c21a03c310ac824592f2ba9a5270218819bb411ad7be578a527593d7 - languageName: node - linkType: hard - "detect-newline@npm:^3.0.0": version: 3.1.0 resolution: "detect-newline@npm:3.1.0" @@ -3790,6 +3810,15 @@ __metadata: languageName: node linkType: hard +"doctrine@npm:^2.1.0": + version: 2.1.0 + resolution: "doctrine@npm:2.1.0" + dependencies: + esutils: ^2.0.2 + checksum: a45e277f7feaed309fe658ace1ff286c6e2002ac515af0aaf37145b8baa96e49899638c7cd47dccf84c3d32abfc113246625b3ac8f552d1046072adee13b0dc8 + languageName: node + linkType: hard + "doctrine@npm:^3.0.0": version: 3.0.0 resolution: "doctrine@npm:3.0.0" @@ -3904,6 +3933,79 @@ __metadata: languageName: node linkType: hard +"es-abstract@npm:^1.19.0, es-abstract@npm:^1.20.4": + version: 1.21.2 + resolution: "es-abstract@npm:1.21.2" + dependencies: + array-buffer-byte-length: ^1.0.0 + available-typed-arrays: ^1.0.5 + call-bind: ^1.0.2 + es-set-tostringtag: ^2.0.1 + es-to-primitive: ^1.2.1 + function.prototype.name: ^1.1.5 + get-intrinsic: ^1.2.0 + get-symbol-description: ^1.0.0 + globalthis: ^1.0.3 + gopd: ^1.0.1 + has: ^1.0.3 + has-property-descriptors: ^1.0.0 + has-proto: ^1.0.1 + has-symbols: ^1.0.3 + internal-slot: ^1.0.5 + is-array-buffer: ^3.0.2 + is-callable: ^1.2.7 + is-negative-zero: ^2.0.2 + is-regex: ^1.1.4 + is-shared-array-buffer: ^1.0.2 + is-string: ^1.0.7 + is-typed-array: ^1.1.10 + is-weakref: ^1.0.2 + object-inspect: ^1.12.3 + object-keys: ^1.1.1 + object.assign: ^4.1.4 + regexp.prototype.flags: ^1.4.3 + safe-regex-test: ^1.0.0 + string.prototype.trim: ^1.2.7 + string.prototype.trimend: ^1.0.6 + string.prototype.trimstart: ^1.0.6 + typed-array-length: ^1.0.4 + unbox-primitive: ^1.0.2 + which-typed-array: ^1.1.9 + checksum: 037f55ee5e1cdf2e5edbab5524095a4f97144d95b94ea29e3611b77d852fd8c8a40e7ae7101fa6a759a9b9b1405f188c3c70928f2d3cd88d543a07fc0d5ad41a + languageName: node + linkType: hard + +"es-set-tostringtag@npm:^2.0.1": + version: 2.0.1 + resolution: "es-set-tostringtag@npm:2.0.1" + dependencies: + get-intrinsic: ^1.1.3 + has: ^1.0.3 + has-tostringtag: ^1.0.0 + checksum: ec416a12948cefb4b2a5932e62093a7cf36ddc3efd58d6c58ca7ae7064475ace556434b869b0bbeb0c365f1032a8ccd577211101234b69837ad83ad204fff884 + languageName: node + linkType: hard + +"es-shim-unscopables@npm:^1.0.0": + version: 1.0.0 + resolution: "es-shim-unscopables@npm:1.0.0" + dependencies: + has: ^1.0.3 + checksum: 83e95cadbb6ee44d3644dfad60dcad7929edbc42c85e66c3e99aefd68a3a5c5665f2686885cddb47dfeabfd77bd5ea5a7060f2092a955a729bbd8834f0d86fa1 + languageName: node + linkType: hard + +"es-to-primitive@npm:^1.2.1": + version: 1.2.1 + resolution: "es-to-primitive@npm:1.2.1" + dependencies: + is-callable: ^1.1.4 + is-date-object: ^1.0.1 + is-symbol: ^1.0.2 + checksum: 4ead6671a2c1402619bdd77f3503991232ca15e17e46222b0a41a5d81aebc8740a77822f5b3c965008e631153e9ef0580540007744521e72de8e33599fca2eed + languageName: node + linkType: hard + "escalade@npm:^3.1.1": version: 3.1.1 resolution: "escalade@npm:3.1.1" @@ -3939,7 +4041,119 @@ __metadata: languageName: node linkType: hard -"eslint-scope@npm:^7.0.0, eslint-scope@npm:^7.1.1": +"eslint-config-semistandard@npm:latest": + version: 17.0.0 + resolution: "eslint-config-semistandard@npm:17.0.0" + peerDependencies: + eslint: ^8.13.0 + eslint-config-standard: ^17.0.0 + eslint-plugin-import: ^2.26.0 + eslint-plugin-n: ^15.0.0 + eslint-plugin-promise: ^6.0.0 + checksum: 89ac11b2eb3aa95b3dcdf6e1d45c2b23707f7ec21dd8ee58850b73ce014895710e5ff3824d38f40f7dfbf105a89363b38d7f6e585d9a5cccfe62cdfd04279b2f + languageName: node + linkType: hard + +"eslint-config-standard@npm:^17.0.0": + version: 17.0.0 + resolution: "eslint-config-standard@npm:17.0.0" + peerDependencies: + eslint: ^8.0.1 + eslint-plugin-import: ^2.25.2 + eslint-plugin-n: ^15.0.0 + eslint-plugin-promise: ^6.0.0 + checksum: dc0ed51e186fd963ff2c0819d33ef580afce11b11036cbcf5e74427e26e514c2b1be96b8ffe74fd2fd00263554a0d49cc873fcf76f17c3dfdba614b45d7fd7da + languageName: node + linkType: hard + +"eslint-import-resolver-node@npm:^0.3.7": + version: 0.3.7 + resolution: "eslint-import-resolver-node@npm:0.3.7" + dependencies: + debug: ^3.2.7 + is-core-module: ^2.11.0 + resolve: ^1.22.1 + checksum: 3379aacf1d2c6952c1b9666c6fa5982c3023df695430b0d391c0029f6403a7775414873d90f397e98ba6245372b6c8960e16e74d9e4a3b0c0a4582f3bdbe3d6e + languageName: node + linkType: hard + +"eslint-module-utils@npm:^2.7.4": + version: 2.8.0 + resolution: "eslint-module-utils@npm:2.8.0" + dependencies: + debug: ^3.2.7 + peerDependenciesMeta: + eslint: + optional: true + checksum: 74c6dfea7641ebcfe174be61168541a11a14aa8d72e515f5f09af55cd0d0862686104b0524aa4b8e0ce66418a44aa38a94d2588743db5fd07a6b49ffd16921d2 + languageName: node + linkType: hard + +"eslint-plugin-es@npm:^4.1.0": + version: 4.1.0 + resolution: "eslint-plugin-es@npm:4.1.0" + dependencies: + eslint-utils: ^2.0.0 + regexpp: ^3.0.0 + peerDependencies: + eslint: ">=4.19.1" + checksum: 26b87a216d3625612b1d3ca8653ac8a1d261046d2a973bb0eb2759070267d2bfb0509051facdeb5ae03dc8dfb51a434be23aff7309a752ca901d637da535677f + languageName: node + linkType: hard + +"eslint-plugin-import@npm:^2.26.0": + version: 2.27.5 + resolution: "eslint-plugin-import@npm:2.27.5" + dependencies: + array-includes: ^3.1.6 + array.prototype.flat: ^1.3.1 + array.prototype.flatmap: ^1.3.1 + debug: ^3.2.7 + doctrine: ^2.1.0 + eslint-import-resolver-node: ^0.3.7 + eslint-module-utils: ^2.7.4 + has: ^1.0.3 + is-core-module: ^2.11.0 + is-glob: ^4.0.3 + minimatch: ^3.1.2 + object.values: ^1.1.6 + resolve: ^1.22.1 + semver: ^6.3.0 + tsconfig-paths: ^3.14.1 + peerDependencies: + eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 + checksum: f500571a380167e25d72a4d925ef9a7aae8899eada57653e5f3051ec3d3c16d08271fcefe41a30a9a2f4fefc232f066253673ee4ea77b30dba65ae173dade85d + languageName: node + linkType: hard + +"eslint-plugin-n@npm:^15.0.0": + version: 15.7.0 + resolution: "eslint-plugin-n@npm:15.7.0" + dependencies: + builtins: ^5.0.1 + eslint-plugin-es: ^4.1.0 + eslint-utils: ^3.0.0 + ignore: ^5.1.1 + is-core-module: ^2.11.0 + minimatch: ^3.1.2 + resolve: ^1.22.1 + semver: ^7.3.8 + peerDependencies: + eslint: ">=7.0.0" + checksum: cfbcc67e62adf27712afdeadf13223cb9717f95d4af8442056d9d4c97a8b88af76b7969f75deaac26fa98481023d6b7c9e43a28909e7f0468f40b3024b7bcfae + languageName: node + linkType: hard + +"eslint-plugin-promise@npm:^6.0.0": + version: 6.1.1 + resolution: "eslint-plugin-promise@npm:6.1.1" + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 + checksum: 46b9a4f79dae5539987922afc27cc17cbccdecf4f0ba19c0ccbf911b0e31853e9f39d9959eefb9637461b52772afa1a482f1f87ff16c1ba38bdb6fcf21897e9a + languageName: node + linkType: hard + +"eslint-scope@npm:^7.0.0, eslint-scope@npm:^7.1.1, eslint-scope@npm:^7.2.0": version: 7.2.0 resolution: "eslint-scope@npm:7.2.0" dependencies: @@ -3949,6 +4163,40 @@ __metadata: languageName: node linkType: hard +"eslint-utils@npm:^2.0.0": + version: 2.1.0 + resolution: "eslint-utils@npm:2.1.0" + dependencies: + eslint-visitor-keys: ^1.1.0 + checksum: 27500938f348da42100d9e6ad03ae29b3de19ba757ae1a7f4a087bdcf83ac60949bbb54286492ca61fac1f5f3ac8692dd21537ce6214240bf95ad0122f24d71d + languageName: node + linkType: hard + +"eslint-utils@npm:^3.0.0": + version: 3.0.0 + resolution: "eslint-utils@npm:3.0.0" + dependencies: + eslint-visitor-keys: ^2.0.0 + peerDependencies: + eslint: ">=5" + checksum: 0668fe02f5adab2e5a367eee5089f4c39033af20499df88fe4e6aba2015c20720404d8c3d6349b6f716b08fdf91b9da4e5d5481f265049278099c4c836ccb619 + languageName: node + linkType: hard + +"eslint-visitor-keys@npm:^1.1.0": + version: 1.3.0 + resolution: "eslint-visitor-keys@npm:1.3.0" + checksum: 37a19b712f42f4c9027e8ba98c2b06031c17e0c0a4c696cd429bd9ee04eb43889c446f2cd545e1ff51bef9593fcec94ecd2c2ef89129fcbbf3adadbef520376a + languageName: node + linkType: hard + +"eslint-visitor-keys@npm:^2.0.0": + version: 2.1.0 + resolution: "eslint-visitor-keys@npm:2.1.0" + checksum: e3081d7dd2611a35f0388bbdc2f5da60b3a3c5b8b6e928daffff7391146b434d691577aa95064c8b7faad0b8a680266bcda0a42439c18c717b80e6718d7e267d + languageName: node + linkType: hard + "eslint-visitor-keys@npm:^3.1.0, eslint-visitor-keys@npm:^3.3.0, eslint-visitor-keys@npm:^3.4.0": version: 3.4.0 resolution: "eslint-visitor-keys@npm:3.4.0" @@ -3956,6 +4204,56 @@ __metadata: languageName: node linkType: hard +"eslint@npm:^8.13.0": + version: 8.39.0 + resolution: "eslint@npm:8.39.0" + dependencies: + "@eslint-community/eslint-utils": ^4.2.0 + "@eslint-community/regexpp": ^4.4.0 + "@eslint/eslintrc": ^2.0.2 + "@eslint/js": 8.39.0 + "@humanwhocodes/config-array": ^0.11.8 + "@humanwhocodes/module-importer": ^1.0.1 + "@nodelib/fs.walk": ^1.2.8 + ajv: ^6.10.0 + chalk: ^4.0.0 + cross-spawn: ^7.0.2 + debug: ^4.3.2 + doctrine: ^3.0.0 + escape-string-regexp: ^4.0.0 + eslint-scope: ^7.2.0 + eslint-visitor-keys: ^3.4.0 + espree: ^9.5.1 + esquery: ^1.4.2 + esutils: ^2.0.2 + fast-deep-equal: ^3.1.3 + file-entry-cache: ^6.0.1 + find-up: ^5.0.0 + glob-parent: ^6.0.2 + globals: ^13.19.0 + grapheme-splitter: ^1.0.4 + ignore: ^5.2.0 + import-fresh: ^3.0.0 + imurmurhash: ^0.1.4 + is-glob: ^4.0.0 + is-path-inside: ^3.0.3 + js-sdsl: ^4.1.4 + js-yaml: ^4.1.0 + json-stable-stringify-without-jsonify: ^1.0.1 + levn: ^0.4.1 + lodash.merge: ^4.6.2 + minimatch: ^3.1.2 + natural-compare: ^1.4.0 + optionator: ^0.9.1 + strip-ansi: ^6.0.1 + strip-json-comments: ^3.1.0 + text-table: ^0.2.0 + bin: + eslint: bin/eslint.js + checksum: d7a074ff326e7ea482500dc0427a7d4b0260460f0f812d19b46b1cca681806b67309f23da9d17cd3de8eb74dd3c14cb549c4d58b05b140564d14cc1a391122a0 + languageName: node + linkType: hard + "eslint@npm:^8.21.0, eslint@npm:^8.7.0": version: 8.38.0 resolution: "eslint@npm:8.38.0" @@ -4230,6 +4528,15 @@ __metadata: languageName: node linkType: hard +"for-each@npm:^0.3.3": + version: 0.3.3 + resolution: "for-each@npm:0.3.3" + dependencies: + is-callable: ^1.1.3 + checksum: 6c48ff2bc63362319c65e2edca4a8e1e3483a2fabc72fbe7feaf8c73db94fc7861bd53bc02c8a66a0c1dd709da6b04eec42e0abdd6b40ce47305ae92a25e5d28 + languageName: node + linkType: hard + "fresh@npm:~0.5.2": version: 0.5.2 resolution: "fresh@npm:0.5.2" @@ -4279,20 +4586,22 @@ __metadata: languageName: node linkType: hard -"gauge@npm:^3.0.0": - version: 3.0.2 - resolution: "gauge@npm:3.0.2" +"function.prototype.name@npm:^1.1.5": + version: 1.1.5 + resolution: "function.prototype.name@npm:1.1.5" dependencies: - aproba: ^1.0.3 || ^2.0.0 - color-support: ^1.1.2 - console-control-strings: ^1.0.0 - has-unicode: ^2.0.1 - object-assign: ^4.1.1 - signal-exit: ^3.0.0 - string-width: ^4.2.3 - strip-ansi: ^6.0.1 - wide-align: ^1.1.2 - checksum: 81296c00c7410cdd48f997800155fbead4f32e4f82109be0719c63edc8560e6579946cc8abd04205297640691ec26d21b578837fd13a4e96288ab4b40b1dc3e9 + call-bind: ^1.0.2 + define-properties: ^1.1.3 + es-abstract: ^1.19.0 + functions-have-names: ^1.2.2 + checksum: acd21d733a9b649c2c442f067567743214af5fa248dbeee69d8278ce7df3329ea5abac572be9f7470b4ec1cd4d8f1040e3c5caccf98ebf2bf861a0deab735c27 + languageName: node + linkType: hard + +"functions-have-names@npm:^1.2.2, functions-have-names@npm:^1.2.3": + version: 1.2.3 + resolution: "functions-have-names@npm:1.2.3" + checksum: c3f1f5ba20f4e962efb71344ce0a40722163e85bee2101ce25f88214e78182d2d2476aa85ef37950c579eb6cf6ee811c17b3101bb84004bb75655f3e33f3fdb5 languageName: node linkType: hard @@ -4326,7 +4635,7 @@ __metadata: languageName: node linkType: hard -"get-intrinsic@npm:^1.0.2": +"get-intrinsic@npm:^1.0.2, get-intrinsic@npm:^1.1.1, get-intrinsic@npm:^1.1.3, get-intrinsic@npm:^1.2.0": version: 1.2.0 resolution: "get-intrinsic@npm:1.2.0" dependencies: @@ -4358,6 +4667,16 @@ __metadata: languageName: node linkType: hard +"get-symbol-description@npm:^1.0.0": + version: 1.0.0 + resolution: "get-symbol-description@npm:1.0.0" + dependencies: + call-bind: ^1.0.2 + get-intrinsic: ^1.1.1 + checksum: 9ceff8fe968f9270a37a1f73bf3f1f7bda69ca80f4f80850670e0e7b9444ff99323f7ac52f96567f8b5f5fbe7ac717a0d81d3407c7313e82810c6199446a5247 + languageName: node + linkType: hard + "glob-parent@npm:^5.1.2, glob-parent@npm:~5.1.2": version: 5.1.2 resolution: "glob-parent@npm:5.1.2" @@ -4419,6 +4738,15 @@ __metadata: languageName: node linkType: hard +"globalthis@npm:^1.0.3": + version: 1.0.3 + resolution: "globalthis@npm:1.0.3" + dependencies: + define-properties: ^1.1.3 + checksum: fbd7d760dc464c886d0196166d92e5ffb4c84d0730846d6621a39fbbc068aeeb9c8d1421ad330e94b7bca4bb4ea092f5f21f3d36077812af5d098b4dc006c998 + languageName: node + linkType: hard + "globby@npm:^11.1.0": version: 11.1.0 resolution: "globby@npm:11.1.0" @@ -4433,6 +4761,15 @@ __metadata: languageName: node linkType: hard +"gopd@npm:^1.0.1": + version: 1.0.1 + resolution: "gopd@npm:1.0.1" + dependencies: + get-intrinsic: ^1.1.3 + checksum: a5ccfb8806e0917a94e0b3de2af2ea4979c1da920bc381667c260e00e7cafdbe844e2cb9c5bcfef4e5412e8bf73bab837285bc35c7ba73aaaf0134d4583393a6 + languageName: node + linkType: hard + "graceful-fs@npm:^4.2.6, graceful-fs@npm:^4.2.9": version: 4.2.11 resolution: "graceful-fs@npm:4.2.11" @@ -4456,6 +4793,13 @@ __metadata: languageName: node linkType: hard +"has-bigints@npm:^1.0.1, has-bigints@npm:^1.0.2": + version: 1.0.2 + resolution: "has-bigints@npm:1.0.2" + checksum: 390e31e7be7e5c6fe68b81babb73dfc35d413604d7ee5f56da101417027a4b4ce6a27e46eff97ad040c835b5d228676eae99a9b5c3bc0e23c8e81a49241ff45b + languageName: node + linkType: hard + "has-flag@npm:^3.0.0": version: 3.0.0 resolution: "has-flag@npm:3.0.0" @@ -4470,6 +4814,22 @@ __metadata: languageName: node linkType: hard +"has-property-descriptors@npm:^1.0.0": + version: 1.0.0 + resolution: "has-property-descriptors@npm:1.0.0" + dependencies: + get-intrinsic: ^1.1.1 + checksum: a6d3f0a266d0294d972e354782e872e2fe1b6495b321e6ef678c9b7a06a40408a6891817350c62e752adced73a94ac903c54734fee05bf65b1905ee1368194bb + languageName: node + linkType: hard + +"has-proto@npm:^1.0.1": + version: 1.0.1 + resolution: "has-proto@npm:1.0.1" + checksum: febc5b5b531de8022806ad7407935e2135f1cc9e64636c3916c6842bd7995994ca3b29871ecd7954bd35f9e2986c17b3b227880484d22259e2f8e6ce63fd383e + languageName: node + linkType: hard + "has-symbols@npm:^1.0.2, has-symbols@npm:^1.0.3": version: 1.0.3 resolution: "has-symbols@npm:1.0.3" @@ -4649,7 +5009,7 @@ __metadata: languageName: node linkType: hard -"ignore@npm:^5.2.0": +"ignore@npm:^5.1.1, ignore@npm:^5.2.0": version: 5.2.4 resolution: "ignore@npm:5.2.4" checksum: 3d4c309c6006e2621659311783eaea7ebcd41fe4ca1d78c91c473157ad6666a57a2df790fe0d07a12300d9aac2888204d7be8d59f9aaf665b1c7fcdb432517ef @@ -4723,6 +5083,17 @@ __metadata: languageName: node linkType: hard +"internal-slot@npm:^1.0.5": + version: 1.0.5 + resolution: "internal-slot@npm:1.0.5" + dependencies: + get-intrinsic: ^1.2.0 + has: ^1.0.3 + side-channel: ^1.0.4 + checksum: 97e84046bf9e7574d0956bd98d7162313ce7057883b6db6c5c7b5e5f05688864b0978ba07610c726d15d66544ffe4b1050107d93f8a39ebc59b15d8b429b497a + languageName: node + linkType: hard + "inversify@npm:^5.0.0": version: 5.1.1 resolution: "inversify@npm:5.1.1" @@ -4744,6 +5115,17 @@ __metadata: languageName: node linkType: hard +"is-array-buffer@npm:^3.0.1, is-array-buffer@npm:^3.0.2": + version: 3.0.2 + resolution: "is-array-buffer@npm:3.0.2" + dependencies: + call-bind: ^1.0.2 + get-intrinsic: ^1.2.0 + is-typed-array: ^1.1.10 + checksum: dcac9dda66ff17df9cabdc58214172bf41082f956eab30bb0d86bc0fab1e44b690fc8e1f855cf2481245caf4e8a5a006a982a71ddccec84032ed41f9d8da8c14 + languageName: node + linkType: hard + "is-arrayish@npm:^0.2.1": version: 0.2.1 resolution: "is-arrayish@npm:0.2.1" @@ -4751,6 +5133,15 @@ __metadata: languageName: node linkType: hard +"is-bigint@npm:^1.0.1": + version: 1.0.4 + resolution: "is-bigint@npm:1.0.4" + dependencies: + has-bigints: ^1.0.1 + checksum: c56edfe09b1154f8668e53ebe8252b6f185ee852a50f9b41e8d921cb2bed425652049fbe438723f6cb48a63ca1aa051e948e7e401e093477c99c84eba244f666 + languageName: node + linkType: hard + "is-binary-path@npm:~2.1.0": version: 2.1.0 resolution: "is-binary-path@npm:2.1.0" @@ -4760,6 +5151,23 @@ __metadata: languageName: node linkType: hard +"is-boolean-object@npm:^1.1.0": + version: 1.1.2 + resolution: "is-boolean-object@npm:1.1.2" + dependencies: + call-bind: ^1.0.2 + has-tostringtag: ^1.0.0 + checksum: c03b23dbaacadc18940defb12c1c0e3aaece7553ef58b162a0f6bba0c2a7e1551b59f365b91e00d2dbac0522392d576ef322628cb1d036a0fe51eb466db67222 + languageName: node + linkType: hard + +"is-callable@npm:^1.1.3, is-callable@npm:^1.1.4, is-callable@npm:^1.2.7": + version: 1.2.7 + resolution: "is-callable@npm:1.2.7" + checksum: 61fd57d03b0d984e2ed3720fb1c7a897827ea174bd44402878e059542ea8c4aeedee0ea0985998aa5cc2736b2fa6e271c08587addb5b3959ac52cf665173d1ac + languageName: node + linkType: hard + "is-class-hotfix@npm:~0.0.6": version: 0.0.6 resolution: "is-class-hotfix@npm:0.0.6" @@ -4767,7 +5175,7 @@ __metadata: languageName: node linkType: hard -"is-core-module@npm:^2.12.0": +"is-core-module@npm:^2.11.0, is-core-module@npm:^2.12.0": version: 2.12.0 resolution: "is-core-module@npm:2.12.0" dependencies: @@ -4776,6 +5184,15 @@ __metadata: languageName: node linkType: hard +"is-date-object@npm:^1.0.1": + version: 1.0.5 + resolution: "is-date-object@npm:1.0.5" + dependencies: + has-tostringtag: ^1.0.0 + checksum: baa9077cdf15eb7b58c79398604ca57379b2fc4cf9aa7a9b9e295278648f628c9b201400c01c5e0f7afae56507d741185730307cbe7cad3b9f90a77e5ee342fc + languageName: node + linkType: hard + "is-extglob@npm:^2.1.1": version: 2.1.1 resolution: "is-extglob@npm:2.1.1" @@ -4829,6 +5246,22 @@ __metadata: languageName: node linkType: hard +"is-negative-zero@npm:^2.0.2": + version: 2.0.2 + resolution: "is-negative-zero@npm:2.0.2" + checksum: f3232194c47a549da60c3d509c9a09be442507616b69454716692e37ae9f37c4dea264fb208ad0c9f3efd15a796a46b79df07c7e53c6227c32170608b809149a + languageName: node + linkType: hard + +"is-number-object@npm:^1.0.4": + version: 1.0.7 + resolution: "is-number-object@npm:1.0.7" + dependencies: + has-tostringtag: ^1.0.0 + checksum: d1e8d01bb0a7134c74649c4e62da0c6118a0bfc6771ea3c560914d52a627873e6920dd0fd0ebc0e12ad2ff4687eac4c308f7e80320b973b2c8a2c8f97a7524f7 + languageName: node + linkType: hard + "is-number@npm:^7.0.0": version: 7.0.0 resolution: "is-number@npm:7.0.0" @@ -4843,6 +5276,25 @@ __metadata: languageName: node linkType: hard +"is-regex@npm:^1.1.4": + version: 1.1.4 + resolution: "is-regex@npm:1.1.4" + dependencies: + call-bind: ^1.0.2 + has-tostringtag: ^1.0.0 + checksum: 362399b33535bc8f386d96c45c9feb04cf7f8b41c182f54174c1a45c9abbbe5e31290bbad09a458583ff6bf3b2048672cdb1881b13289569a7c548370856a652 + languageName: node + linkType: hard + +"is-shared-array-buffer@npm:^1.0.2": + version: 1.0.2 + resolution: "is-shared-array-buffer@npm:1.0.2" + dependencies: + call-bind: ^1.0.2 + checksum: 9508929cf14fdc1afc9d61d723c6e8d34f5e117f0bffda4d97e7a5d88c3a8681f633a74f8e3ad1fe92d5113f9b921dc5ca44356492079612f9a247efbce7032a + languageName: node + linkType: hard + "is-stream@npm:^2.0.0": version: 2.0.1 resolution: "is-stream@npm:2.0.1" @@ -4850,6 +5302,24 @@ __metadata: languageName: node linkType: hard +"is-string@npm:^1.0.5, is-string@npm:^1.0.7": + version: 1.0.7 + resolution: "is-string@npm:1.0.7" + dependencies: + has-tostringtag: ^1.0.0 + checksum: 323b3d04622f78d45077cf89aab783b2f49d24dc641aa89b5ad1a72114cfeff2585efc8c12ef42466dff32bde93d839ad321b26884cf75e5a7892a938b089989 + languageName: node + linkType: hard + +"is-symbol@npm:^1.0.2, is-symbol@npm:^1.0.3": + version: 1.0.4 + resolution: "is-symbol@npm:1.0.4" + dependencies: + has-symbols: ^1.0.2 + checksum: 92805812ef590738d9de49d677cd17dfd486794773fb6fa0032d16452af46e9b91bb43ffe82c983570f015b37136f4b53b28b8523bfb10b0ece7a66c31a54510 + languageName: node + linkType: hard + "is-type-of@npm:^1.2.1": version: 1.2.1 resolution: "is-type-of@npm:1.2.1" @@ -4861,6 +5331,28 @@ __metadata: languageName: node linkType: hard +"is-typed-array@npm:^1.1.10, is-typed-array@npm:^1.1.9": + version: 1.1.10 + resolution: "is-typed-array@npm:1.1.10" + dependencies: + available-typed-arrays: ^1.0.5 + call-bind: ^1.0.2 + for-each: ^0.3.3 + gopd: ^1.0.1 + has-tostringtag: ^1.0.0 + checksum: aac6ecb59d4c56a1cdeb69b1f129154ef462bbffe434cb8a8235ca89b42f258b7ae94073c41b3cb7bce37f6a1733ad4499f07882d5d5093a7ba84dfc4ebb8017 + languageName: node + linkType: hard + +"is-weakref@npm:^1.0.2": + version: 1.0.2 + resolution: "is-weakref@npm:1.0.2" + dependencies: + call-bind: ^1.0.2 + checksum: 95bd9a57cdcb58c63b1c401c60a474b0f45b94719c30f548c891860f051bc2231575c290a6b420c6bc6e7ed99459d424c652bd5bf9a1d5259505dc35b4bf83de + languageName: node + linkType: hard + "isarray@npm:0.0.1": version: 0.0.1 resolution: "isarray@npm:0.0.1" @@ -5452,6 +5944,17 @@ __metadata: languageName: node linkType: hard +"json5@npm:^1.0.2": + version: 1.0.2 + resolution: "json5@npm:1.0.2" + dependencies: + minimist: ^1.2.0 + bin: + json5: lib/cli.js + checksum: 866458a8c58a95a49bef3adba929c625e82532bcff1fe93f01d29cb02cac7c3fe1f4b79951b7792c2da9de0b32871a8401a6e3c5b36778ad852bf5b8a61165d7 + languageName: node + linkType: hard + "json5@npm:^2.2.2": version: 2.2.3 resolution: "json5@npm:2.2.3" @@ -5769,7 +6272,7 @@ __metadata: languageName: node linkType: hard -"make-dir@npm:^3.0.0, make-dir@npm:^3.1.0": +"make-dir@npm:^3.0.0": version: 3.1.0 resolution: "make-dir@npm:3.1.0" dependencies: @@ -5932,7 +6435,7 @@ __metadata: languageName: node linkType: hard -"minimist@npm:^1.2.6": +"minimist@npm:^1.2.0, minimist@npm:^1.2.6": version: 1.2.8 resolution: "minimist@npm:1.2.8" checksum: 75a6d645fb122dad29c06a7597bddea977258957ed88d7a6df59b5cd3fe4a527e253e9bbf2e783e4b73657f9098b96a5fe96ab8a113655d4109108577ecf85b0 @@ -6180,15 +6683,6 @@ __metadata: languageName: node linkType: hard -"node-addon-api@npm:^5.0.0": - version: 5.1.0 - resolution: "node-addon-api@npm:5.1.0" - dependencies: - node-gyp: latest - checksum: 2508bd2d2981945406243a7bd31362fc7af8b70b8b4d65f869c61731800058fb818cc2fd36c8eac714ddd0e568cc85becf5e165cebbdf7b5024d5151bbc75ea1 - languageName: node - linkType: hard - "node-fetch@npm:2.6.7": version: 2.6.7 resolution: "node-fetch@npm:2.6.7" @@ -6203,20 +6697,6 @@ __metadata: languageName: node linkType: hard -"node-fetch@npm:^2.6.7": - version: 2.6.9 - resolution: "node-fetch@npm:2.6.9" - dependencies: - whatwg-url: ^5.0.0 - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - checksum: acb04f9ce7224965b2b59e71b33c639794d8991efd73855b0b250921382b38331ffc9d61bce502571f6cc6e11a8905ca9b1b6d4aeb586ab093e2756a1fd190d0 - languageName: node - linkType: hard - "node-gyp-build-optional-packages@npm:5.0.3": version: 5.0.3 resolution: "node-gyp-build-optional-packages@npm:5.0.3" @@ -6296,17 +6776,6 @@ __metadata: languageName: node linkType: hard -"nopt@npm:^5.0.0": - version: 5.0.0 - resolution: "nopt@npm:5.0.0" - dependencies: - abbrev: 1 - bin: - nopt: bin/nopt.js - checksum: d35fdec187269503843924e0114c0c6533fb54bbf1620d0f28b4b60ba01712d6687f62565c55cc20a504eff0fbe5c63e22340c3fad549ad40469ffb611b04f2f - languageName: node - linkType: hard - "nopt@npm:^6.0.0": version: 6.0.0 resolution: "nopt@npm:6.0.0" @@ -6345,18 +6814,6 @@ __metadata: languageName: node linkType: hard -"npmlog@npm:^5.0.1": - version: 5.0.1 - resolution: "npmlog@npm:5.0.1" - dependencies: - are-we-there-yet: ^2.0.0 - console-control-strings: ^1.1.0 - gauge: ^3.0.0 - set-blocking: ^2.0.0 - checksum: 516b2663028761f062d13e8beb3f00069c5664925871a9b57989642ebe09f23ab02145bf3ab88da7866c4e112cafff72401f61a672c7c8a20edc585a7016ef5f - languageName: node - linkType: hard - "npmlog@npm:^6.0.0": version: 6.0.2 resolution: "npmlog@npm:6.0.2" @@ -6376,20 +6833,43 @@ __metadata: languageName: node linkType: hard -"object-assign@npm:^4.1.1": - version: 4.1.1 - resolution: "object-assign@npm:4.1.1" - checksum: fcc6e4ea8c7fe48abfbb552578b1c53e0d194086e2e6bbbf59e0a536381a292f39943c6e9628af05b5528aa5e3318bb30d6b2e53cadaf5b8fe9e12c4b69af23f - languageName: node - linkType: hard - -"object-inspect@npm:^1.9.0": +"object-inspect@npm:^1.12.3, object-inspect@npm:^1.9.0": version: 1.12.3 resolution: "object-inspect@npm:1.12.3" checksum: dabfd824d97a5f407e6d5d24810d888859f6be394d8b733a77442b277e0808860555176719c5905e765e3743a7cada6b8b0a3b85e5331c530fd418cc8ae991db languageName: node linkType: hard +"object-keys@npm:^1.1.1": + version: 1.1.1 + resolution: "object-keys@npm:1.1.1" + checksum: b363c5e7644b1e1b04aa507e88dcb8e3a2f52b6ffd0ea801e4c7a62d5aa559affe21c55a07fd4b1fd55fc03a33c610d73426664b20032405d7b92a1414c34d6a + languageName: node + linkType: hard + +"object.assign@npm:^4.1.4": + version: 4.1.4 + resolution: "object.assign@npm:4.1.4" + dependencies: + call-bind: ^1.0.2 + define-properties: ^1.1.4 + has-symbols: ^1.0.3 + object-keys: ^1.1.1 + checksum: 76cab513a5999acbfe0ff355f15a6a125e71805fcf53de4e9d4e082e1989bdb81d1e329291e1e4e0ae7719f0e4ef80e88fb2d367ae60500d79d25a6224ac8864 + languageName: node + linkType: hard + +"object.values@npm:^1.1.6": + version: 1.1.6 + resolution: "object.values@npm:1.1.6" + dependencies: + call-bind: ^1.0.2 + define-properties: ^1.1.4 + es-abstract: ^1.20.4 + checksum: f6fff9fd817c24cfd8107f50fb33061d81cd11bacc4e3dbb3852e9ff7692fde4dbce823d4333ea27cd9637ef1b6690df5fbb61f1ed314fa2959598dc3ae23d8e + languageName: node + linkType: hard + "on-finished@npm:^2.3.0": version: 2.4.1 resolution: "on-finished@npm:2.4.1" @@ -6929,6 +7409,24 @@ __metadata: languageName: node linkType: hard +"regexp.prototype.flags@npm:^1.4.3": + version: 1.5.0 + resolution: "regexp.prototype.flags@npm:1.5.0" + dependencies: + call-bind: ^1.0.2 + define-properties: ^1.2.0 + functions-have-names: ^1.2.3 + checksum: c541687cdbdfff1b9a07f6e44879f82c66bbf07665f9a7544c5fd16acdb3ec8d1436caab01662d2fbcad403f3499d49ab0b77fbc7ef29ef961d98cc4bc9755b4 + languageName: node + linkType: hard + +"regexpp@npm:^3.0.0": + version: 3.2.0 + resolution: "regexpp@npm:3.2.0" + checksum: a78dc5c7158ad9ddcfe01aa9144f46e192ddbfa7b263895a70a5c6c73edd9ce85faf7c0430e59ac38839e1734e275b9c3de5c57ee3ab6edc0e0b1bdebefccef8 + languageName: node + linkType: hard + "require-directory@npm:^2.1.1": version: 2.1.1 resolution: "require-directory@npm:2.1.1" @@ -6980,7 +7478,7 @@ __metadata: languageName: node linkType: hard -"resolve@npm:^1.20.0, resolve@npm:^1.3.2": +"resolve@npm:^1.20.0, resolve@npm:^1.22.1, resolve@npm:^1.3.2": version: 1.22.3 resolution: "resolve@npm:1.22.3" dependencies: @@ -6993,7 +7491,7 @@ __metadata: languageName: node linkType: hard -"resolve@patch:resolve@^1.20.0#~builtin, resolve@patch:resolve@^1.3.2#~builtin": +"resolve@patch:resolve@^1.20.0#~builtin, resolve@patch:resolve@^1.22.1#~builtin, resolve@patch:resolve@^1.3.2#~builtin": version: 1.22.3 resolution: "resolve@patch:resolve@npm%3A1.22.3#~builtin::version=1.22.3&hash=c3c19d" dependencies: @@ -7063,6 +7561,17 @@ __metadata: languageName: node linkType: hard +"safe-regex-test@npm:^1.0.0": + version: 1.0.0 + resolution: "safe-regex-test@npm:1.0.0" + dependencies: + call-bind: ^1.0.2 + get-intrinsic: ^1.1.3 + is-regex: ^1.1.4 + checksum: bc566d8beb8b43c01b94e67de3f070fd2781685e835959bbbaaec91cc53381145ca91f69bd837ce6ec244817afa0a5e974fc4e40a2957f0aca68ac3add1ddd34 + languageName: node + linkType: hard + "safer-buffer@npm:>= 2.1.2 < 3, safer-buffer@npm:>= 2.1.2 < 3.0.0, safer-buffer@npm:^2.1.0": version: 2.1.2 resolution: "safer-buffer@npm:2.1.2" @@ -7097,7 +7606,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.3.8": +"semver@npm:^7.0.0, semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.3.8": version: 7.5.0 resolution: "semver@npm:7.5.0" dependencies: @@ -7165,7 +7674,7 @@ __metadata: languageName: node linkType: hard -"signal-exit@npm:^3.0.0, signal-exit@npm:^3.0.3, signal-exit@npm:^3.0.7": +"signal-exit@npm:^3.0.3, signal-exit@npm:^3.0.7": version: 3.0.7 resolution: "signal-exit@npm:3.0.7" checksum: a2f098f247adc367dffc27845853e9959b9e88b01cb301658cfe4194352d8d2bb32e18467c786a7fe15f1d44b233ea35633d076d5e737870b7139949d1ab6318 @@ -7320,6 +7829,39 @@ __metadata: languageName: node linkType: hard +"string.prototype.trim@npm:^1.2.7": + version: 1.2.7 + resolution: "string.prototype.trim@npm:1.2.7" + dependencies: + call-bind: ^1.0.2 + define-properties: ^1.1.4 + es-abstract: ^1.20.4 + checksum: 05b7b2d6af63648e70e44c4a8d10d8cc457536df78b55b9d6230918bde75c5987f6b8604438c4c8652eb55e4fc9725d2912789eb4ec457d6995f3495af190c09 + languageName: node + linkType: hard + +"string.prototype.trimend@npm:^1.0.6": + version: 1.0.6 + resolution: "string.prototype.trimend@npm:1.0.6" + dependencies: + call-bind: ^1.0.2 + define-properties: ^1.1.4 + es-abstract: ^1.20.4 + checksum: 0fdc34645a639bd35179b5a08227a353b88dc089adf438f46be8a7c197fc3f22f8514c1c9be4629b3cd29c281582730a8cbbad6466c60f76b5f99cf2addb132e + languageName: node + linkType: hard + +"string.prototype.trimstart@npm:^1.0.6": + version: 1.0.6 + resolution: "string.prototype.trimstart@npm:1.0.6" + dependencies: + call-bind: ^1.0.2 + define-properties: ^1.1.4 + es-abstract: ^1.20.4 + checksum: 89080feef416621e6ef1279588994305477a7a91648d9436490d56010a1f7adc39167cddac7ce0b9884b8cdbef086987c4dcb2960209f2af8bac0d23ceff4f41 + languageName: node + linkType: hard + "string_decoder@npm:^1.1.1": version: 1.3.0 resolution: "string_decoder@npm:1.3.0" @@ -7356,6 +7898,13 @@ __metadata: languageName: node linkType: hard +"strip-bom@npm:^3.0.0": + version: 3.0.0 + resolution: "strip-bom@npm:3.0.0" + checksum: 8d50ff27b7ebe5ecc78f1fe1e00fcdff7af014e73cf724b46fb81ef889eeb1015fc5184b64e81a2efe002180f3ba431bdd77e300da5c6685d702780fbf0c8d5b + languageName: node + linkType: hard + "strip-bom@npm:^4.0.0": version: 4.0.0 resolution: "strip-bom@npm:4.0.0" @@ -7552,6 +8101,18 @@ __metadata: languageName: node linkType: hard +"tsconfig-paths@npm:^3.14.1": + version: 3.14.2 + resolution: "tsconfig-paths@npm:3.14.2" + dependencies: + "@types/json5": ^0.0.29 + json5: ^1.0.2 + minimist: ^1.2.6 + strip-bom: ^3.0.0 + checksum: a6162eaa1aed680537f93621b82399c7856afd10ec299867b13a0675e981acac4e0ec00896860480efc59fc10fd0b16fdc928c0b885865b52be62cadac692447 + languageName: node + linkType: hard + "tslib@npm:1.9.0": version: 1.9.0 resolution: "tslib@npm:1.9.0" @@ -7738,6 +8299,17 @@ __metadata: languageName: node linkType: hard +"typed-array-length@npm:^1.0.4": + version: 1.0.4 + resolution: "typed-array-length@npm:1.0.4" + dependencies: + call-bind: ^1.0.2 + for-each: ^0.3.3 + is-typed-array: ^1.1.9 + checksum: 2228febc93c7feff142b8c96a58d4a0d7623ecde6c7a24b2b98eb3170e99f7c7eff8c114f9b283085cd59dcd2bd43aadf20e25bba4b034a53c5bb292f71f8956 + languageName: node + linkType: hard + "typescript@npm:^4.5.4, typescript@npm:^4.9.5": version: 4.9.5 resolution: "typescript@npm:4.9.5" @@ -7765,6 +8337,18 @@ __metadata: languageName: node linkType: hard +"unbox-primitive@npm:^1.0.2": + version: 1.0.2 + resolution: "unbox-primitive@npm:1.0.2" + dependencies: + call-bind: ^1.0.2 + has-bigints: ^1.0.2 + has-symbols: ^1.0.3 + which-boxed-primitive: ^1.0.2 + checksum: b7a1cf5862b5e4b5deb091672ffa579aa274f648410009c81cca63fed3b62b610c4f3b773f912ce545bb4e31edc3138975b5bc777fc6e4817dca51affb6380e9 + languageName: node + linkType: hard + "undefsafe@npm:^2.0.5": version: 2.0.5 resolution: "undefsafe@npm:2.0.5" @@ -7928,6 +8512,19 @@ __metadata: languageName: node linkType: hard +"which-boxed-primitive@npm:^1.0.2": + version: 1.0.2 + resolution: "which-boxed-primitive@npm:1.0.2" + dependencies: + is-bigint: ^1.0.1 + is-boolean-object: ^1.1.0 + is-number-object: ^1.0.4 + is-string: ^1.0.5 + is-symbol: ^1.0.3 + checksum: 53ce774c7379071729533922adcca47220228405e1895f26673bbd71bdf7fb09bee38c1d6399395927c6289476b5ae0629863427fd151491b71c4b6cb04f3a5e + languageName: node + linkType: hard + "which-module@npm:^2.0.0": version: 2.0.0 resolution: "which-module@npm:2.0.0" @@ -7935,6 +8532,20 @@ __metadata: languageName: node linkType: hard +"which-typed-array@npm:^1.1.9": + version: 1.1.9 + resolution: "which-typed-array@npm:1.1.9" + dependencies: + available-typed-arrays: ^1.0.5 + call-bind: ^1.0.2 + for-each: ^0.3.3 + gopd: ^1.0.1 + has-tostringtag: ^1.0.0 + is-typed-array: ^1.1.10 + checksum: fe0178ca44c57699ca2c0e657b64eaa8d2db2372a4e2851184f568f98c478ae3dc3fdb5f7e46c384487046b0cf9e23241423242b277e03e8ba3dabc7c84c98ef + languageName: node + linkType: hard + "which@npm:^2.0.1, which@npm:^2.0.2": version: 2.0.2 resolution: "which@npm:2.0.2" @@ -7946,7 +8557,7 @@ __metadata: languageName: node linkType: hard -"wide-align@npm:^1.1.2, wide-align@npm:^1.1.5": +"wide-align@npm:^1.1.5": version: 1.1.5 resolution: "wide-align@npm:1.1.5" dependencies: