Skip to content
This repository was archived by the owner on Apr 14, 2025. It is now read-only.

Deep Dive | Templates

Tim S edited this page Jan 6, 2017 · 7 revisions

The templates property is an object containing configuration objects used to transform data into a specific format to prepare it for export. This is the top level schema with all possible properties:

{
  "templates": {
    "<template_name>": {
      "name": "",
      "template": "",
      "templateFile": "",
      "fileName": "",
      "customData": {}
    }
  }
}

Notes

  • Replace <request_name> with any name desired. This name is only used for reference purposes

Table of Contents

Property Documentation

name

(string) The human-friendly name of the object. This value is completely arbitrary.

template

(string) The template is used to generate output using API data after transforms have been applied. The result of the template is exported to a file with the given fileName based on the configured exports. For more information on templating, see Deep Dive | Templating.

templateFile

(string) Instead of providing a template inline using the template property, a path to a file can be provided that contains the contents of the template. The path can be an absolute or relative path. If relative, it will be evaluated relative to the location of index.js, not the invocation path. This file's contents will be read at the time the template is processed. This property will only be used if template is not specified.

fileName

(string) The fileName is used to determine the name of the file to use when exporting the result of the template. This property supports templating. For more information on templating, see Deep Dive | Templating.

customData

(Object) An object of key/value pairs defining custom data to be made available to the request and template. Each key/value pair will be set to def.vars as def.vars[key] = value.

Clone this wiki locally