responses = {}; responses.failure = (key, msg) => ` \ FAILED \ ${key} \ ${msg} \ ` ; responses.checksumError = responses.failure("checksumError", "You did not pass the checksum security check."); responses.createSuccess = (id, permanent, getRaw) => ` \ SUCCESS \ ${id} \ ${permanent} \ ${getRaw} \ ` ; responses.createFailure = responses.failure("createHookError", "An error happened while creating your hook. Check the logs."); responses.createDuplicated = id => ` \ SUCCESS \ ${id} \ duplicateWarning \ There is already a hook for this callback URL. \ ` ; responses.destroySuccess = ` \ SUCCESS \ true \ `; responses.destroyFailure = responses.failure("destroyHookError", "An error happened while removing your hook. Check the logs."); responses.destroyNoHook = responses.failure("destroyMissingHook", "The hook informed was not found."); responses.missingParamCallbackURL = responses.failure("missingParamCallbackURL", "You must specify a callbackURL in the parameters."); responses.missingParamHookID = responses.failure("missingParamHookID", "You must specify a hookID in the parameters."); module.exports = responses;