import { GraphQLClient as GraphQLClientClass } from 'graphql-request/dist/index' ; import crypto from 'crypto' ; import Api from './api' ; class Webhooks extends Api { constructor ( client ) { super ( client ) ; } static validateSignature ( signature , body , token ) { const hmacSignature = crypto . createHmac ( 'sha1' , token ) . update ( body ) . digest ( 'hex' ) ; return crypto . timingSafeEqual ( Buffer . from ( signature ) , Buffer . from ( hmacSignature ) ) ; } } export default Webhooks ;