lib/alerts/index.js
function( options, callback ) {

    var self = this

    var path = '/alerts/rest/v1/json/testdelivery/' +
      options.airlineCode + '/' + options.flightNumber +
      '/from/' + options.departureAirport +
      '/to/' + options.arrivalAirport

    var extensions = [
      'includeNewFields',
      'useInlinedReferences'
    ]

    if( Array.isArray( options.extendedOptions ) ) {
      extensions = extensions.concat( options.extendedOptions )
    }

    return this.client._clientRequest({
      url: path,
      extendedOptions: extensions,
      qs: {
        deliverTo: options.deliverTo,
        type: options.type || 'JSON',
      },
    }, function( error, data ) {
      callback.call( self.client, error, data )
    })

  }
function( options, callback ) {

    var self = this

    var path = '/alerts/rest/v1/json/testdelivery/' +
      options.airlineCode + '/' + options.flightNumber +
      '/from/' + options.departureAirport +
      '/to/' + options.arrivalAirport

    var extensions = [
      'includeNewFields',
      'useInlinedReferences'
    ]

    if( Array.isArray( options.extendedOptions ) ) {
      extensions = extensions.concat( options.extendedOptions )
    }

    return this.client._clientRequest({
      url: path,
      extendedOptions: extensions,
      qs: {
        deliverTo: options.deliverTo,
        type: options.type || 'JSON',
      },
    }, function( error, data ) {
      callback.call( self.client, error, data )
    })

  }
function ( options , callback ) { var self = this var path = '/alerts/rest/v1/json/testdelivery/' + options . airlineCode + '/' + options . flightNumber + '/from/' + options . departureAirport + '/to/' + options . arrivalAirport var extensions = [ 'includeNewFields' , 'useInlinedReferences' ] if ( Array . isArray ( options . extendedOptions ) ) { extensions = extensions . concat ( options . extendedOptions ) } return this . client . _clientRequest ( { url : path , extendedOptions : extensions , qs : { deliverTo : options . deliverTo , type : options . type || 'JSON' , } , } , function ( error , data ) { callback . call ( self . client , error , data ) } ) }
Simulate a fake event for a fake flight
@param {Object} options
@param {String} options.airlineCode
@param {String} options.arrivalAirport
@param {String} options.deliverTo (can be smtp://username@domain.com for testing)
@param {String} options.departureAirport
@param {String} options.flightNumber
@param {?Array<String>} [options.extendedOptions] optional
@param {String} options.type - optional (JSON|XML), defaults to JSON
@param {Function} callback( error, result )
@return {Request}
Simulate a fake event for a fake flight