nylas / nylas-nodejs

A NodeJS wrapper for the Nylas REST API for email, contacts, and calendar.
MIT License
169 stars 118 forks source link

Allow configurable timeout for API calls #427

Closed mrashed-dev closed 1 year ago

mrashed-dev commented 1 year ago

Description

This PR enables support for configuring a timeout for all outgoing API calls, closing #421.

Usage

To set the timeout you can add it as part of the initial Nylas SDK config:

const Nylas = require('nylas');

// Initialize an instance of the Nylas SDK using the client credentials and timeout
Nylas.config({
  clientId: "CLIENT_ID",
  clientSecret: "CLIENT_SECRET",
  timeout: 60 // 60 second timeout
});

License

I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.

codecov[bot] commented 1 year ago

Codecov Report

Merging #427 (c686e18) into main (4b37091) will increase coverage by 0.05%. The diff coverage is 94.73%.

@@            Coverage Diff             @@
##             main     #427      +/-   ##
==========================================
+ Coverage   91.66%   91.71%   +0.05%     
==========================================
  Files          62       62              
  Lines        2614     2632      +18     
  Branches      475      479       +4     
==========================================
+ Hits         2396     2414      +18     
  Misses        217      217              
  Partials        1        1              
Impacted Files Coverage Δ
src/nylas-connection.ts 92.89% <90.90%> (+0.44%) :arrow_up:
src/config.ts 100.00% <100.00%> (ø)
src/nylas.ts 88.69% <100.00%> (+0.51%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.