Skip to content

Commit

Permalink
chore: expose internal RequestClient to users at top level (#668)
Browse files Browse the repository at this point in the history
  • Loading branch information
stern-shawn authored Mar 31, 2021
1 parent 521b6ac commit 04f9e91
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import TwilioClient = require('./lib/rest/Twilio');
import AccessToken = require('./lib/jwt/AccessToken');
import ClientCapability = require('./lib/jwt/ClientCapability');
import TaskRouterCapability = require('./lib/jwt/taskrouter/TaskRouterCapability');
import RequestClient = require('./lib/base/RequestClient');

interface TwimlConstructor<T> {
new (): T;
Expand Down Expand Up @@ -36,6 +37,7 @@ declare namespace twilio {
}
export const jwt: JwtInterface;
export const twiml: TwimlInterface;
export const RequestClient: RequestClient;
export const validateRequest: typeof webhookTools.validateRequest;
export const validateRequestWithBody: typeof webhookTools.validateRequestWithBody;
export const validateExpressRequest: typeof webhookTools.validateExpressRequest;
Expand Down
2 changes: 2 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
var Twilio = require('./rest/Twilio');
var webhooks = require('./webhooks/webhooks');
var obsolete = require('./base/obsolete');
var RequestClient = require('./base/RequestClient');

// Shorthand to automatically create a RestClient
var initializer = function(accountSid, authToken, opts) {
Expand All @@ -13,6 +14,7 @@ var initializer = function(accountSid, authToken, opts) {
initializer.Twilio = Twilio;
initializer.jwt = { };
initializer.twiml = { };
initializer.RequestClient = RequestClient;

var AccessToken;
Object.defineProperty(initializer.jwt,
Expand Down

0 comments on commit 04f9e91

Please sign in to comment.