Skip to content

Commit 2970b9f

Browse files
committed
Ran prettier
1 parent 9a68cb8 commit 2970b9f

File tree

13 files changed

+46
-41
lines changed

13 files changed

+46
-41
lines changed

scripts/generateModelIndex.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const comment = '// This file is generated by scripts/generateModelIndex.js\n';
55
const modelsDir = path.join(__dirname, '..', 'src', 'models');
66
let indexContent = '';
77

8-
fs.readdirSync(modelsDir).forEach((file) => {
8+
fs.readdirSync(modelsDir).forEach(file => {
99
if (file.endsWith('.ts') && file !== 'index.ts') {
1010
const modelName = file.replace('.ts', '.js');
1111
indexContent += `export * from './${modelName}';\n`;

src/models/connectors.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,7 @@ export type ImapCreateConnectorRequest = BaseCreateConnectionRequest;
104104
/**
105105
* Interface representing the base Nylas connector creation request.
106106
*/
107-
export type VirtualCalendarsCreateConnectorRequest =
108-
BaseCreateConnectionRequest;
107+
export type VirtualCalendarsCreateConnectorRequest = BaseCreateConnectionRequest;
109108

110109
/**
111110
* The type of the Nylas connector creation request.

src/models/error.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,8 @@ export abstract class AbstractNylasSdkError extends Error {}
2929
/**
3030
* Class representation of a general Nylas API error.
3131
*/
32-
export class NylasApiError
33-
extends AbstractNylasApiError
34-
implements NylasApiErrorResponseData
35-
{
32+
export class NylasApiError extends AbstractNylasApiError
33+
implements NylasApiErrorResponseData {
3634
/**
3735
* Error type.
3836
*/
@@ -62,10 +60,8 @@ export class NylasApiError
6260
/**
6361
* Class representing an OAuth error returned by the Nylas API.
6462
*/
65-
export class NylasOAuthError
66-
extends AbstractNylasApiError
67-
implements NylasOAuthErrorResponse
68-
{
63+
export class NylasOAuthError extends AbstractNylasApiError
64+
implements NylasOAuthErrorResponse {
6965
/**
7066
* Error type.
7167
*/

src/models/response.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,6 @@ export interface NylasListResponse<T> {
4949
/**
5050
* Helper type for pagination
5151
*/
52-
export type ListResponseInnerType<T> =
53-
T extends NylasListResponse<infer R> ? R : never;
52+
export type ListResponseInnerType<T> = T extends NylasListResponse<infer R>
53+
? R
54+
: never;

src/resources/auth.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,13 @@ export class Auth extends Resource {
220220
}
221221

222222
private hashPKCESecret(secret: string): string {
223-
const hash = createHash('sha256').update(secret).digest('hex');
223+
const hash = createHash('sha256')
224+
.update(secret)
225+
.digest('hex');
224226

225-
return Buffer.from(hash).toString('base64').replace(/=+$/, '');
227+
return Buffer.from(hash)
228+
.toString('base64')
229+
.replace(/=+$/, '');
226230
}
227231

228232
private getTokenInfo(

src/resources/notetakers.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,9 @@ export class Notetakers extends Resource {
9191
identifier,
9292
queryParams,
9393
overrides,
94-
}: ListNotetakersParams &
95-
Overrides): AsyncListResponse<ListNotetakersResponse> {
94+
}: ListNotetakersParams & Overrides): AsyncListResponse<
95+
ListNotetakersResponse
96+
> {
9697
return super._list({
9798
path: identifier
9899
? makePathParams('/v3/grants/{identifier}/notetakers', { identifier })

src/resources/resource.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,11 @@ export class Resource {
126126
): AsyncListResponse<T> {
127127
const iterator = this.listIterator(listParams);
128128
const first = iterator.next().then(
129-
(res) =>
129+
res =>
130130
({
131131
...res.value,
132132
next: iterator.next.bind(iterator),
133-
}) as ListYieldReturn<T>
133+
} as ListYieldReturn<T>)
134134
);
135135

136136
return Object.assign(first, {

tests/apiClient.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ describe('APIClient', () => {
464464
// We need to mock setTimeout to verify it's called with the correct duration
465465
const originalSetTimeout = global.setTimeout;
466466
const mockSetTimeout = jest.fn().mockImplementation(() => 123); // Return a timeout ID
467-
global.setTimeout = mockSetTimeout as unknown as typeof setTimeout;
467+
global.setTimeout = (mockSetTimeout as unknown) as typeof setTimeout;
468468

469469
try {
470470
// Mock fetch to return a successful response so we can verify setTimeout
@@ -499,7 +499,7 @@ describe('APIClient', () => {
499499
// We need to mock setTimeout to verify it's called with the correct duration
500500
const originalSetTimeout = global.setTimeout;
501501
const mockSetTimeout = jest.fn().mockImplementation(() => 123); // Return a timeout ID
502-
global.setTimeout = mockSetTimeout as unknown as typeof setTimeout;
502+
global.setTimeout = (mockSetTimeout as unknown) as typeof setTimeout;
503503

504504
try {
505505
// Mock fetch to return a successful response so we can verify setTimeout

tests/resources/configurations.spec.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ describe('Configurations', () => {
6868
});
6969
expect(apiClient.request).toHaveBeenCalledWith(
7070
expect.objectContaining({
71-
path: '/v3/grants/grant%20123/scheduling/configurations/configuration%2F123',
71+
path:
72+
'/v3/grants/grant%20123/scheduling/configurations/configuration%2F123',
7273
})
7374
);
7475
});
@@ -81,7 +82,8 @@ describe('Configurations', () => {
8182
});
8283
expect(apiClient.request).toHaveBeenCalledWith(
8384
expect.objectContaining({
84-
path: '/v3/grants/grant%20123/scheduling/configurations/configuration%2F123',
85+
path:
86+
'/v3/grants/grant%20123/scheduling/configurations/configuration%2F123',
8587
})
8688
);
8789
});
@@ -190,7 +192,8 @@ describe('Configurations', () => {
190192
});
191193
expect(apiClient.request).toHaveBeenCalledWith(
192194
expect.objectContaining({
193-
path: '/v3/grants/grant%20123/scheduling/configurations/configuration%2F123',
195+
path:
196+
'/v3/grants/grant%20123/scheduling/configurations/configuration%2F123',
194197
})
195198
);
196199
});
@@ -204,7 +207,8 @@ describe('Configurations', () => {
204207
});
205208
expect(apiClient.request).toHaveBeenCalledWith(
206209
expect.objectContaining({
207-
path: '/v3/grants/grant%20123/scheduling/configurations/configuration%2F123',
210+
path:
211+
'/v3/grants/grant%20123/scheduling/configurations/configuration%2F123',
208212
})
209213
);
210214
});
@@ -239,7 +243,8 @@ describe('Configurations', () => {
239243
});
240244
expect(apiClient.request).toHaveBeenCalledWith(
241245
expect.objectContaining({
242-
path: '/v3/grants/grant%20123/scheduling/configurations/configuration%2F123',
246+
path:
247+
'/v3/grants/grant%20123/scheduling/configurations/configuration%2F123',
243248
})
244249
);
245250
});
@@ -252,7 +257,8 @@ describe('Configurations', () => {
252257
});
253258
expect(apiClient.request).toHaveBeenCalledWith(
254259
expect.objectContaining({
255-
path: '/v3/grants/grant%20123/scheduling/configurations/configuration%2F123',
260+
path:
261+
'/v3/grants/grant%20123/scheduling/configurations/configuration%2F123',
256262
})
257263
);
258264
});

tests/resources/drafts.spec.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jest.mock('../src/apiClient');
77

88
// Mock the FormData constructor
99
jest.mock('form-data', () => {
10-
return jest.fn().mockImplementation(function (this: MockedFormData) {
10+
return jest.fn().mockImplementation(function(this: MockedFormData) {
1111
const appendedData: Record<string, any> = {};
1212

1313
this.append = (key: string, value: any): void => {
@@ -292,9 +292,7 @@ describe('Drafts', () => {
292292
});
293293

294294
const capturedRequest = apiClient.request.mock.calls[0][0];
295-
const formData = (
296-
capturedRequest.form as any as MockedFormData
297-
)._getAppendedData();
295+
const formData = ((capturedRequest.form as any) as MockedFormData)._getAppendedData();
298296
expect(formData.message).toEqual(JSON.stringify(messageJson));
299297
expect(formData.file0).toEqual(fileStream);
300298
expect(capturedRequest.method).toEqual('POST');
@@ -380,9 +378,7 @@ describe('Drafts', () => {
380378
});
381379

382380
const capturedRequest = apiClient.request.mock.calls[0][0];
383-
const formData = (
384-
capturedRequest.form as any as MockedFormData
385-
)._getAppendedData();
381+
const formData = ((capturedRequest.form as any) as MockedFormData)._getAppendedData();
386382
expect(formData.message).toEqual(JSON.stringify(messageJson));
387383
expect(formData.file0).toEqual(fileStream);
388384
expect(capturedRequest.method).toEqual('PUT');

0 commit comments

Comments
 (0)