Skip to content

Commit

Permalink
Merge branch 'main' into SS-769-node-scheduler-sdk-support
Browse files Browse the repository at this point in the history
  • Loading branch information
SubashPradhan authored Oct 21, 2024
2 parents dc9253b + 214cb58 commit e8af157
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 6 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# Changelog

### Unreleased
### 7.6.0 / 2024-10-18
* Add support for filtering events by attendee email
* Add buffer support for file attachments
* Add new webhook trigger types
* Add ews as a provider
* Change rotate secret endpoint from being a PUT to a POST call
* Fix issue where crypto import was causing downstream Jest incompatibilities
* Fix FormData import compatibility issues with ESM
* Remove eslint-plugin-import from production dependencies

### 7.5.2 / 2024-07-12
* Fix issue where metadata was being incorrectly modified before being sent to the API
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nylas",
"version": "7.5.2",
"version": "7.6.0",
"description": "A NodeJS wrapper for the Nylas REST API for email, contacts, and calendar.",
"main": "lib/cjs/nylas.js",
"types": "lib/types/nylas.d.ts",
Expand Down
1 change: 1 addition & 0 deletions src/apiClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ export default class APIClient {
objKeysToSnakeCase(optionParams.body, ['metadata']) // metadata should remain as is
);
requestOptions.headers['Content-Type'] = 'application/json';
requestOptions.headers['Accept-Encoding'] = 'gzip';
}

if (optionParams.form) {
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// This file is generated by scripts/exportVersion.js
export const SDK_VERSION = '7.5.2';
export const SDK_VERSION = '7.6.0';
13 changes: 12 additions & 1 deletion tests/apiClient.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ describe('APIClient', () => {
timeout: 30,
headers: {
'X-SDK-Test-Header': 'This is a test',
'Accept-Encoding': 'gzip',
},
});

Expand All @@ -28,6 +29,7 @@ describe('APIClient', () => {
expect(client.timeout).toBe(30000);
expect(client.headers).toEqual({
'X-SDK-Test-Header': 'This is a test',
'Accept-Encoding': 'gzip',
});
});
});
Expand All @@ -49,7 +51,10 @@ describe('APIClient', () => {
const options = client.requestOptions({
path: '/test',
method: 'GET',
headers: { 'X-SDK-Test-Header': 'This is a test' },
headers: {
'X-SDK-Test-Header': 'This is a test',
'Accept-Encoding': 'gzip',
},
queryParams: { param: 'value' },
body: { id: 'abc123' },
overrides: { apiUri: 'https://test.api.nylas.com' },
Expand All @@ -60,6 +65,7 @@ describe('APIClient', () => {
Accept: 'application/json',
Authorization: 'Bearer testApiKey',
'Content-Type': 'application/json',
'Accept-Encoding': 'gzip',
'User-Agent': `Nylas Node SDK v${SDK_VERSION}`,
'X-SDK-Test-Header': 'This is a test',
});
Expand All @@ -73,12 +79,16 @@ describe('APIClient', () => {
const options = client.requestOptions({
path: '/test',
method: 'POST',
headers: {
'Accept-Encoding': 'gzip',
},
});

expect(options.method).toBe('POST');
expect(options.headers).toEqual({
Accept: 'application/json',
Authorization: 'Bearer testApiKey',
'Accept-Encoding': 'gzip',
'User-Agent': `Nylas Node SDK v${SDK_VERSION}`,
});
expect(options.url).toEqual(new URL('https://api.us.nylas.com/test'));
Expand Down Expand Up @@ -167,6 +177,7 @@ describe('APIClient', () => {
Accept: ['application/json'],
Authorization: ['Bearer testApiKey'],
'Content-Type': ['application/json'],
'Accept-Encoding': ['gzip'],
'User-Agent': [`Nylas Node SDK v${SDK_VERSION}`],
'X-SDK-Test-Header': ['This is a test'],
'global-header': ['global-value'],
Expand Down

0 comments on commit e8af157

Please sign in to comment.