diff --git a/rest/rest-tests.ts b/rest/rest-tests.ts index cedc11b00..813a06785 100644 --- a/rest/rest-tests.ts +++ b/rest/rest-tests.ts @@ -13,6 +13,7 @@ import oAuth = require('rest/interceptor/oAuth'); import csrf = require('rest/interceptor/csrf'); import errorCode = require('rest/interceptor/errorCode'); import retry = require('rest/interceptor/retry'); +import template = require('rest/interceptor/template'); import timeout = require('rest/interceptor/timeout'); import jsonp = require('rest/interceptor/jsonp'); import xdomain = require('rest/interceptor/ie/xdomain'); @@ -117,24 +118,25 @@ var promiseOrResponse = interceptor({ }); client = rest - .wrap(defaultRequest) - .wrap(hateoas) - .wrap(location) - .wrap(mime) - .wrap(pathPrefix) - .wrap(basicAuth) - .wrap(oAuth) - .wrap(csrf) - .wrap(errorCode) - .wrap(retry) - .wrap(timeout) - .wrap(jsonp) - .wrap(xdomain) - .wrap(xhr) - .wrap(noop) - .wrap(fail) - .wrap(knownConfig, { prop: 'value' }) - .wrap(transformedConfig, { prop: 'value' }); + .wrap(defaultRequest) + .wrap(hateoas) + .wrap(location) + .wrap(mime) + .wrap(pathPrefix) + .wrap(basicAuth) + .wrap(oAuth) + .wrap(csrf) + .wrap(errorCode) + .wrap(retry) + .wrap(template, { template: 'auth={token}', params: { token: 'hunter2' } }) + .wrap(timeout) + .wrap(jsonp) + .wrap(xdomain) + .wrap(xhr) + .wrap(noop) + .wrap(fail) + .wrap(knownConfig, { prop: 'value' }) + .wrap(transformedConfig, { prop: 'value' }); import xhrClient = require('rest/client/xhr'); import nodeClient = require('rest/client/node'); diff --git a/rest/rest.d.ts b/rest/rest.d.ts index a96e0822a..e000e1e93 100644 --- a/rest/rest.d.ts +++ b/rest/rest.d.ts @@ -1,4 +1,4 @@ -// Type definitions for rest.js v1.2.0 +// Type definitions for rest.js v1.3.1 // Project: https://github.com/cujojs/rest // Definitions by: Wim Looman // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -255,6 +255,23 @@ declare module "rest/interceptor/retry" { export = retry; } +declare module "rest/interceptor/template" { + import rest = require("rest"); + + var template: rest.Interceptor; + + module template { + interface Config { + template?: string; + params?: { + [name: string]: any; + }; + } + } + + export = template; +} + declare module "rest/interceptor/timeout" { import rest = require("rest");