Files
elasticsearch-js/scripts/generate/js_api/templates/api_file.tmpl
Spencer Alger 5bb70fbe58 Moved the curl formatting into the log and changed the arguments for the log event listeneres to
receive both the "message" and the "curlCommand".

Added a "tracer" logger which allows you to create log files that a executable scripts. Those scripts
will write all of the log messages as script comments, and not comment out the curlCommands, so that they
can trace their application and use the generated script to recreate the issue.

Most changes are simply cased by adding the "unused" rule to jshint.
2013-11-15 19:10:45 -07:00

28 lines
616 B
Cheetah

/* jshint maxlen: false */
var ca = require('./client_action');
var api = module.exports = {};
api._namespaces = <%= stringify(namespaces) %>;<%
_.each(actions, function (action) {
var namespace = action.location.split('.').shift();
if (_.contains(namespaces, namespace)) {
_.pull(namespaces, namespace);
var className = _.studlyCase(namespace) + 'NS';
%>
api.<%= namespace %> = function <%= className %>(client) {
if (this instanceof <%= className %>) {
this.client = client;
} else {
return new <%= className %>(client);
}
};<%
}
%>
<%= partials.client_action(action) %><%
}); %>