function mapTriggerType({ functionContext }) {
  const input = functionContext.options?.trigger?.type

  // Input types are found at:
  // https://github.com/Azure/azure-functions-nodejs-library/blob/138c021/src/trigger.ts
  // https://learn.microsoft.com/en-us/azure/azure-functions/functions-triggers-bindings?tabs=isolated-process%2Cnode-v4%2Cpython-v2&pivots=programming-language-javascript#supported-bindings
  switch (input) {
    case 'httpTrigger': {
      return 'http'
    }

    case 'timerTrigger': {
      return 'timer'
    }

    case 'blobTrigger':
    case 'cosmosDBTrigger':
    case 'daprBindingTrigger':
    case 'mysqlTrigger':
    case 'queueTrigger':
    case 'sqlTrigger': {
      return 'datasource'
    }

    case 'daprTopicTrigger':
    case 'eventGridTrigger':
    case 'eventHubTrigger':
    case 'kafkaTrigger':
    case 'rabbitMQTrigger':
    case 'redisListTrigger':
    case 'redisPubSubTrigger':
    case 'redisStreamTrigger':
    case 'serviceBusTrigger':
    case 'signalRTrigger':
    case 'webPubSubTrigger': {
      return 'pubsub'
    }

    default: {
      return 'other'
    }
  }
}
Inspects the provided function invocation context and returns a recognized
trigger type suitable for sending to the collector as `faas.trigger`.

@param {object} params Function parameters
@param {object} params.functionContext The function context as provided by
the Azure functions runtime.

@returns {string} A string appropriate for New Relic.