From 1259d4fa78c734599c23b29a06aecb046f84fe77 Mon Sep 17 00:00:00 2001 From: Prashanth Sadasivan Date: Wed, 19 Sep 2018 12:08:09 -0400 Subject: [PATCH] remove type restriction for job attach method --- lib/response.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/response.js b/lib/response.js index b342a38..d1b94a2 100644 --- a/lib/response.js +++ b/lib/response.js @@ -46,14 +46,10 @@ Response = (function () { } Response.prototype.job_attach = function (...attachments) { const requiredLabels = [ 'type', 'label', 'value' ] - const allowedTypes = [ 'link', 'password' ] for (const attachment of attachments) { if (!~requiredLabels.every(l => ~Object.keys(attachment).indexOf(l))) { throw new Error(`Attachment requires mandatory properties ${requiredLabels.join(', ')}`) } - if (!~allowedTypes.indexOf(attachment.type)) { - throw new Error(`Attachment must be of one of the following types ${allowedTypes.join(', ')}`) - } } this._attachments.push(...attachments) this.meta('set_job_attachments', JSON.stringify(this._attachments))