index.js
function editRecord(options) {
    return find(options.domain, getQueryParams(options, ['name', 'type', 'query'])).then(function (response) {
      const records = response.data.result;
      //Properties that are editable
      options = mapRecordOptions(options);
      if (records.length === 0) {
        throw new Error('No matching records found');
      } else if (records.length === 1) {
        let record = records[0];
        options.type = options.type || record.type;
        options.content = options.content || record.content;
        return self.cloudflareClient.editRecord(record.zone_id, record.id, options);
      } else {
        throw new Error(format('%d matching records found, unable to update', records.count));
      }
    }).then(function (response) {
      let record = response.data.result;
      return new Result([
        format('Updated %s record %s (id: %s)', record.type, record.name, record.id)
      ]);
    });
  }
function editRecord(options) {
    return find(options.domain, getQueryParams(options, ['name', 'type', 'query'])).then(function (response) {
      const records = response.data.result;
      //Properties that are editable
      options = mapRecordOptions(options);
      if (records.length === 0) {
        throw new Error('No matching records found');
      } else if (records.length === 1) {
        let record = records[0];
        options.type = options.type || record.type;
        options.content = options.content || record.content;
        return self.cloudflareClient.editRecord(record.zone_id, record.id, options);
      } else {
        throw new Error(format('%d matching records found, unable to update', records.count));
      }
    }).then(function (response) {
      let record = response.data.result;
      return new Result([
        format('Updated %s record %s (id: %s)', record.type, record.name, record.id)
      ]);
    });
  }
function editRecord ( options ) { return find ( options . domain , getQueryParams ( options , [ 'name' , 'type' , 'query' ] ) ) . then ( function ( response ) { const records = response . data . result ; //Properties that are editable options = mapRecordOptions ( options ) ; if ( records . length === 0 ) { throw new Error ( 'No matching records found' ) ; } else if ( records . length === 1 ) { let record = records [ 0 ] ; options . type = options . type || record . type ; options . content = options . content || record . content ; return self . cloudflareClient . editRecord ( record . zone_id , record . id , options ) ; } else { throw new Error ( format ( '%d matching records found, unable to update' , records . count ) ) ; } } ) . then ( function ( response ) { let record = response . data . result ; return new Result ( [ format ( 'Updated %s record %s (id: %s)' , record . type , record . name , record . id ) ] ) ; } ) ; }
Edit a record
@param options
@returns {Promise}
Edit a record