1 | // Generated by CoffeeScript 1.11.1
|
2 | (function() {
|
3 | module.exports = function(client) {
|
4 | return function(bulk, callback) {
|
5 | return bulk.reduce(function(p, c) {
|
6 | return p.then(function() {
|
7 | var t;
|
8 | t = c.template;
|
9 | return client.indices.putTemplate({
|
10 | name: t._name,
|
11 | body: t._template
|
12 | });
|
13 | });
|
14 | }, Promise.resolve()).then(function() {
|
15 | return callback(null, {});
|
16 | })["catch"](function(err) {
|
17 | return callback(err);
|
18 | });
|
19 | };
|
20 | };
|
21 |
|
22 | }).call(this);
|
23 |
|
24 | //# sourceMappingURL=write-template.js.map
|