From c80aa255ff7e2c120c51eee8564df53f4103f7fe Mon Sep 17 00:00:00 2001 From: Albert T Date: Mon, 23 Nov 2026 18:41:45 -0500 Subject: [PATCH 01/13] Type notetaker_settings on Notetaker requests and responses The Notetaker API takes notetaker_settings (recording_type, transcription, summary, action_items and more) and config_id, and deprecates the top-level name and meeting_settings fields. The SDK types only had the legacy fields, so TypeScript rejected the documented request shape (TS2353) and callers could not request summaries or action items without a cast. - Add NotetakerConfigSettings and its nested types, plus notetakerSettings and configId on create, notetakerSettings on update and on Notetaker. - Add the missing optional legacy meeting settings fields. - Mark the request name/meetingSettings fields deprecated. - Make Notetaker.name and Notetaker.meetingSettings optional: the API omits them for Notetakers created with notetakerSettings. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 8 + cjs-wrapper.d.ts | 8 + examples/calendars/event_with_notetaker.ts | 6 +- examples/notetakers/notetaker.ts | 11 +- src/models/notetakers.ts | 253 ++++++++++++++++++++- tests/resources/notetakers.spec.ts | 176 ++++++++++++++ tests/types/package.cts | 13 ++ tests/types/package.mts | 13 ++ 8 files changed, 477 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 24fe332f..d90981fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 Planned version: **8.5.1**. +### Added +- Type `notetakerSettings` and `configId` on Notetaker create and update requests, and `notetakerSettings` on Notetaker responses, matching the current Notetaker API. +- Type the summary, action item, transcription, silence and message fields on `NotetakerMeetingSettings`. + +### Changed +- Mark the Notetaker request `name` and `meetingSettings` fields as deprecated in favor of `notetakerSettings`. +- Make `Notetaker.name` and `Notetaker.meetingSettings` optional, because the API omits them for Notetakers created with `notetakerSettings`. + ### Fixed - Preserve upload-session HTTP header map keys while decoding API responses (NYL-476). - Patch vulnerable SDK tooling and example HTTP dependencies while preserving TypeDoc compatibility (NYL-471). diff --git a/cjs-wrapper.d.ts b/cjs-wrapper.d.ts index 94c8142a..771e56d8 100644 --- a/cjs-wrapper.d.ts +++ b/cjs-wrapper.d.ts @@ -181,14 +181,22 @@ declare namespace Nylas { export import MicrosoftCreateConnectorRequest = models.MicrosoftCreateConnectorRequest; export import MicrosoftCreateConnectorSettings = models.MicrosoftCreateConnectorSettings; export import Notetaker = models.Notetaker; + export import NotetakerConfigSettings = models.NotetakerConfigSettings; + export import NotetakerCustomInstructionsSettings = models.NotetakerCustomInstructionsSettings; export import NotetakerLeaveResponse = models.NotetakerLeaveResponse; export import NotetakerMedia = models.NotetakerMedia; export import NotetakerMeetingProvider = models.NotetakerMeetingProvider; export import NotetakerMeetingSettings = models.NotetakerMeetingSettings; + export import NotetakerMessages = models.NotetakerMessages; + export import NotetakerOnJoinMessage = models.NotetakerOnJoinMessage; + export import NotetakerOnParticipantJoinMessage = models.NotetakerOnParticipantJoinMessage; export import NotetakerRecording = models.NotetakerRecording; + export import NotetakerRecordingType = models.NotetakerRecordingType; export import NotetakerSettings = models.NotetakerSettings; export import NotetakerState = models.NotetakerState; export import NotetakerTranscript = models.NotetakerTranscript; + export import NotetakerTranscriptionSettings = models.NotetakerTranscriptionSettings; + export import NotetakerVideoOutput = models.NotetakerVideoOutput; export import NylasApiError = models.NylasApiError; export import NylasApiErrorResponse = models.NylasApiErrorResponse; export import NylasApiErrorResponseData = models.NylasApiErrorResponseData; diff --git a/examples/calendars/event_with_notetaker.ts b/examples/calendars/event_with_notetaker.ts index 6f63af67..481190c3 100644 --- a/examples/calendars/event_with_notetaker.ts +++ b/examples/calendars/event_with_notetaker.ts @@ -160,13 +160,13 @@ async function getEventNotetaker( console.log(`- Meeting Provider: ${notetaker.data.meetingProvider}`); console.log(`- Meeting Settings:`); console.log( - ` - Video Recording: ${notetaker.data.meetingSettings.videoRecording}` + ` - Video Recording: ${notetaker.data.meetingSettings?.videoRecording}` ); console.log( - ` - Audio Recording: ${notetaker.data.meetingSettings.audioRecording}` + ` - Audio Recording: ${notetaker.data.meetingSettings?.audioRecording}` ); console.log( - ` - Transcription: ${notetaker.data.meetingSettings.transcription}` + ` - Transcription: ${notetaker.data.meetingSettings?.transcription}` ); return notetaker; diff --git a/examples/notetakers/notetaker.ts b/examples/notetakers/notetaker.ts index cc3166fc..2e3c446b 100644 --- a/examples/notetakers/notetaker.ts +++ b/examples/notetakers/notetaker.ts @@ -45,11 +45,12 @@ async function inviteNotetaker(): Promise> { const requestBody: CreateNotetakerRequest = { meetingLink, - name: 'Nylas Notetaker', - meetingSettings: { - videoRecording: true, - audioRecording: true, + notetakerSettings: { + name: 'Nylas Notetaker', + recordingType: 'audio_video', transcription: true, + summary: true, + actionItems: true, }, }; @@ -58,7 +59,7 @@ async function inviteNotetaker(): Promise> { const notetaker = await nylas.notetakers.create({ requestBody }); console.log(`Invited Notetaker with ID: ${notetaker.data.id}`); - console.log(`Name: ${notetaker.data.name}`); + console.log(`Name: ${notetaker.data.notetakerSettings?.name}`); console.log(`State: ${notetaker.data.state}`); return notetaker; } catch (error) { diff --git a/src/models/notetakers.ts b/src/models/notetakers.ts index 2fefcdaf..8f9076e7 100644 --- a/src/models/notetakers.ts +++ b/src/models/notetakers.ts @@ -21,6 +21,193 @@ export type NotetakerState = | 'media_error' | 'media_deleted'; +/** + * What Notetaker records. + * `audio_video` produces an MP4 recording of the meeting's video and audio. + * `audio` produces an MP3 audio-only recording. + */ +export type NotetakerRecordingType = 'audio_video' | 'audio'; + +/** + * Optional settings that tune how Notetaker transcribes audio. + * `transcription` must be true for these settings to take effect. + */ +export interface NotetakerTranscriptionSettings { + /** + * Language codes the audio is expected to contain. + * When provided, it must contain at least one supported code. + */ + expectedLanguages?: string[]; + /** + * Language to use if Notetaker does not detect one of the expected languages. + */ + fallbackLanguage?: string; + /** + * Domain-specific terms that bias transcription toward recognizing them, + * such as names, acronyms, and product names. + */ + keywords?: string[]; + /** + * When true, Notetaker adds known speaker names to the keyword set. + */ + useSpeakerNamesAsKeywords?: boolean; +} + +/** + * Custom instructions for the AI model that generates a summary or action items. + */ +export interface NotetakerCustomInstructionsSettings { + /** + * A custom prompt for the AI model. + */ + customInstructions?: string; +} + +/** + * A message the Notetaker bot posts to the meeting chat shortly after joining. + */ +export interface NotetakerOnJoinMessage { + /** + * The message format. Currently only `text` is supported. + */ + type: 'text'; + /** + * The message text. HTML tags are stripped before the message is sent. + */ + content: string; + /** + * Delay in milliseconds between the bot joining and the message being posted. + */ + sendAfterMs: number; +} + +/** + * A message the Notetaker bot posts to the meeting chat when a new participant joins. + */ +export interface NotetakerOnParticipantJoinMessage { + /** + * The message format. Currently only `text` is supported. + */ + type: 'text'; + /** + * The message text. HTML tags are stripped before the message is sent. + */ + content: string; + /** + * Trailing debounce window in milliseconds. + * A burst of joins inside the window produces a single message. + */ + debounceMs: number; +} + +/** + * Custom announcements the Notetaker bot posts to the meeting chat. + */ +export interface NotetakerMessages { + /** + * Messages the bot sends shortly after it joins the meeting. Up to 10. + */ + onJoin?: NotetakerOnJoinMessage[] | null; + /** + * Messages the bot sends when a new participant joins the meeting. Up to 10. + */ + onParticipantJoin?: NotetakerOnParticipantJoinMessage[] | null; +} + +/** + * A static image the Notetaker bot shows as its camera feed. + * To upload an image, send `mediaType` and `data` together. + * Send an empty object to disable video output. + */ +export interface NotetakerVideoOutput { + /** + * The image MIME type. Required together with `data` when uploading an image. + */ + mediaType?: 'image/png' | 'image/jpeg' | 'image/webp'; + /** + * The base64-encoded image bytes. Write-only. + */ + data?: string; + /** + * The size of the stored image, in bytes. Read-only. + */ + readonly size?: number; + /** + * A signed URL for previewing the stored image. Read-only. + */ + readonly previewUrl?: string; + /** + * When `previewUrl` expires, in Unix timestamp format. Read-only. + */ + readonly previewUrlExpiresAt?: number; +} + +/** + * Interface representing Notetaker settings. + * Cannot be used together with the deprecated `name` and `meetingSettings` fields. + */ +export interface NotetakerConfigSettings { + /** + * The display name shown when the Notetaker joins a meeting. + */ + name?: string; + /** + * What Notetaker records. + * When no level of the configuration hierarchy sets it, Notetaker records audio and video. + */ + recordingType?: NotetakerRecordingType; + /** + * When true, Notetaker transcribes the meeting's audio. + */ + transcription?: boolean; + /** + * Optional settings that tune how Notetaker transcribes audio. + * Send `null` or `{}` to clear inherited settings. + */ + transcriptionSettings?: NotetakerTranscriptionSettings | null; + /** + * When true, Notetaker generates a summary of the meeting. + * Requires `transcription` to also be true. + */ + summary?: boolean; + /** + * Settings for the summary. + */ + summarySettings?: NotetakerCustomInstructionsSettings; + /** + * When true, Notetaker generates a list of action items. + * Requires `transcription` to also be true. + */ + actionItems?: boolean; + /** + * Settings for the action items. + */ + actionItemsSettings?: NotetakerCustomInstructionsSettings; + /** + * Seconds of continuous silence after which Notetaker leaves the meeting. + * Must be between 10 and 3600. + */ + leaveAfterSilenceSeconds?: number; + /** + * Seconds Notetaker waits after joining before it can leave automatically. + * Must be between 0 and 3600. + */ + leaveDetectionDelaySeconds?: number; + /** + * Custom announcements the Notetaker bot posts to the meeting chat. + */ + messages?: NotetakerMessages; + /** + * A static image the Notetaker bot shows as its camera feed. + */ + videoOutput?: NotetakerVideoOutput; + /** + * How long Notetaker media is kept before Nylas deletes it, in seconds. + * Must be between 300 and 2592000. + */ + retentionTime?: number; +} + /** * Interface representing Notetaker Meeting Settings */ @@ -38,6 +225,37 @@ export interface NotetakerMeetingSettings { * If transcription is true, audioRecording must also be true. */ transcription: boolean; + /** + * Optional settings that tune how Notetaker transcribes audio. + */ + transcriptionSettings?: NotetakerTranscriptionSettings | null; + /** + * When true, Notetaker generates a summary of the meeting. + * If summary is true, transcription must also be true. + */ + summary?: boolean; + /** + * Settings for the summary. + */ + summarySettings?: NotetakerCustomInstructionsSettings; + /** + * When true, Notetaker generates a list of action items. + * If actionItems is true, transcription must also be true. + */ + actionItems?: boolean; + /** + * Settings for the action items. + */ + actionItemsSettings?: NotetakerCustomInstructionsSettings; + /** + * Seconds of silence after which Notetaker leaves the meeting. + * Must be between 10 and 3600. + */ + leaveAfterSilenceSeconds?: number; + /** + * Custom announcements the Notetaker bot posts to the meeting chat. + */ + messages?: NotetakerMessages; } /** @@ -50,8 +268,9 @@ export interface Notetaker { id: string; /** * The display name for the Notetaker bot. + * Returned only for Notetakers created with the deprecated `name` and `meetingSettings` fields. */ - name: string; + name?: string; /** * When Notetaker joined the meeting, in Unix timestamp format. */ @@ -77,9 +296,15 @@ export interface Notetaker { */ eventId?: string; /** - * Notetaker Meeting Settings + * Notetaker Meeting Settings. + * Returned only for Notetakers created with the deprecated `name` and `meetingSettings` fields. */ - meetingSettings: NotetakerMeetingSettings; + meetingSettings?: NotetakerMeetingSettings; + /** + * The Notetaker's settings. + * Returned for Notetakers created or updated with `notetakerSettings`. + */ + notetakerSettings?: NotetakerConfigSettings; } /** @@ -180,14 +405,28 @@ export interface CreateNotetakerRequest { */ joinTime?: number; + /** + * The ID of an existing configuration to use for this Notetaker. + * Cannot be used together with `notetakerSettings`. + */ + configId?: string; + + /** + * Notetaker settings. + * Cannot be used together with `configId` or the deprecated `name` and `meetingSettings` fields. + */ + notetakerSettings?: NotetakerConfigSettings; + /** * The display name for the Notetaker bot. * Default: Nylas Notetaker + * @deprecated Use `notetakerSettings.name` instead. */ name?: string; /** * Notetaker Meeting Settings + * @deprecated Use `notetakerSettings` instead. */ meetingSettings?: Partial; } @@ -203,14 +442,22 @@ export interface UpdateNotetakerRequest { */ joinTime?: number; + /** + * Notetaker settings to change. Omitted fields keep their current values. + * Cannot be used together with the deprecated `name` and `meetingSettings` fields. + */ + notetakerSettings?: NotetakerConfigSettings; + /** * The display name for the Notetaker bot. * Default: Nylas Notetaker + * @deprecated Use `notetakerSettings.name` instead. */ name?: string; /** * Notetaker Meeting Settings + * @deprecated Use `notetakerSettings` instead. */ meetingSettings?: Partial; } diff --git a/tests/resources/notetakers.spec.ts b/tests/resources/notetakers.spec.ts index 7d42e57a..4aa50780 100644 --- a/tests/resources/notetakers.spec.ts +++ b/tests/resources/notetakers.spec.ts @@ -1,7 +1,17 @@ import APIClient from '../../src/apiClient'; import { Notetakers } from '../../src/resources/notetakers'; +import { + CreateNotetakerRequest, + Notetaker, + UpdateNotetakerRequest, +} from '../../src/models/notetakers'; +import { objKeysToCamelCase, objKeysToSnakeCase } from '../../src/utils'; jest.mock('../../src/apiClient'); +// Mirrors how APIClient serializes JSON request bodies. +const toWireFormat = (body: object): Record => + objKeysToSnakeCase(body as Record, ['metadata']); + describe('Notetakers', () => { let apiClient: jest.Mocked; let notetakers: Notetakers; @@ -275,6 +285,107 @@ describe('Notetakers', () => { }); }); + it('should create a notetaker with notetakerSettings', async () => { + const requestBody: CreateNotetakerRequest = { + meetingLink: 'https://meet.google.com/abc-defg-hij', + notetakerSettings: { + name: 'Nylas Notetaker', + recordingType: 'audio', + transcription: true, + transcriptionSettings: { + expectedLanguages: ['en', 'es'], + fallbackLanguage: 'en', + keywords: ['Nylas'], + useSpeakerNamesAsKeywords: true, + }, + summary: true, + summarySettings: { customInstructions: 'Use bullet points.' }, + actionItems: true, + actionItemsSettings: { customInstructions: 'Top 5 only.' }, + leaveAfterSilenceSeconds: 600, + leaveDetectionDelaySeconds: 30, + messages: { + onJoin: [{ type: 'text', content: 'Hello', sendAfterMs: 1000 }], + onParticipantJoin: [ + { type: 'text', content: 'Welcome', debounceMs: 5000 }, + ], + }, + videoOutput: { mediaType: 'image/png', data: 'aGVsbG8=' }, + retentionTime: 604800, + }, + }; + + await notetakers.create({ + identifier: 'id123', + requestBody, + }); + + expect(apiClient.request).toHaveBeenCalledWith({ + method: 'POST', + path: '/v3/grants/id123/notetakers', + body: requestBody, + }); + expect(toWireFormat(requestBody)).toEqual({ + meeting_link: 'https://meet.google.com/abc-defg-hij', + notetaker_settings: { + name: 'Nylas Notetaker', + recording_type: 'audio', + transcription: true, + transcription_settings: { + expected_languages: ['en', 'es'], + fallback_language: 'en', + keywords: ['Nylas'], + use_speaker_names_as_keywords: true, + }, + summary: true, + summary_settings: { custom_instructions: 'Use bullet points.' }, + action_items: true, + action_items_settings: { custom_instructions: 'Top 5 only.' }, + leave_after_silence_seconds: 600, + leave_detection_delay_seconds: 30, + messages: { + on_join: [{ type: 'text', content: 'Hello', send_after_ms: 1000 }], + on_participant_join: [ + { type: 'text', content: 'Welcome', debounce_ms: 5000 }, + ], + }, + video_output: { media_type: 'image/png', data: 'aGVsbG8=' }, + retention_time: 604800, + }, + }); + }); + + it('should create a notetaker from a configuration', async () => { + const requestBody: CreateNotetakerRequest = { + meetingLink: 'https://meet.google.com/abc-defg-hij', + configId: 'config123', + }; + + await notetakers.create({ requestBody }); + + expect(apiClient.request).toHaveBeenCalledWith({ + method: 'POST', + path: '/v3/notetakers', + body: requestBody, + }); + expect(toWireFormat(requestBody)).toEqual({ + meeting_link: 'https://meet.google.com/abc-defg-hij', + config_id: 'config123', + }); + }); + + it('should keep a null transcriptionSettings when serializing', () => { + const requestBody: CreateNotetakerRequest = { + meetingLink: 'https://meet.google.com/abc-defg-hij', + notetakerSettings: { transcriptionSettings: null }, + }; + + expect(toWireFormat(requestBody)).toEqual({ + meeting_link: 'https://meet.google.com/abc-defg-hij', + notetaker_settings: { transcription_settings: null }, + }); + }); + it('should create a notetaker without identifier', async () => { const requestBody = { meetingLink: 'https://meet.google.com/abc-def-ghi', @@ -330,6 +441,47 @@ describe('Notetakers', () => { }); }); + describe('response', () => { + it('should camelCase notetaker_settings in a notetaker response', () => { + const notetaker = objKeysToCamelCase({ + id: 'notetaker123', + join_time: 1234567890, + meeting_link: 'https://meet.google.com/abc-defg-hij', + meeting_provider: 'Google Meet', + state: 'scheduled', + notetaker_settings: { + name: 'Nylas Notetaker', + recording_type: 'audio', + transcription: true, + action_items: true, + messages: { on_join: null, on_participant_join: null }, + video_output: { + media_type: 'image/png', + size: 1024, + preview_url: 'https://example.com/preview.png', + preview_url_expires_at: 1234567890, + }, + }, + }) as Notetaker; + + expect(notetaker.name).toBeUndefined(); + expect(notetaker.meetingSettings).toBeUndefined(); + expect(notetaker.notetakerSettings).toEqual({ + name: 'Nylas Notetaker', + recordingType: 'audio', + transcription: true, + actionItems: true, + messages: { onJoin: null, onParticipantJoin: null }, + videoOutput: { + mediaType: 'image/png', + size: 1024, + previewUrl: 'https://example.com/preview.png', + previewUrlExpiresAt: 1234567890, + }, + }); + }); + }); + describe('find', () => { it('should find a notetaker by ID', async () => { await notetakers.find({ @@ -435,6 +587,30 @@ describe('Notetakers', () => { }); }); + it('should update a notetaker with notetakerSettings', async () => { + const requestBody: UpdateNotetakerRequest = { + notetakerSettings: { + recordingType: 'audio_video', + summary: false, + }, + }; + + await notetakers.update({ + identifier: 'id123', + notetakerId: 'notetaker123', + requestBody, + }); + + expect(apiClient.request).toHaveBeenCalledWith({ + method: 'PATCH', + path: '/v3/grants/id123/notetakers/notetaker123', + body: requestBody, + }); + expect(toWireFormat(requestBody)).toEqual({ + notetaker_settings: { recording_type: 'audio_video', summary: false }, + }); + }); + it('should update a notetaker with partial data', async () => { const requestBody = { name: 'Updated Notetaker', diff --git a/tests/types/package.cts b/tests/types/package.cts index bd92b80a..e851f92c 100644 --- a/tests/types/package.cts +++ b/tests/types/package.cts @@ -1,5 +1,6 @@ import Nylas, { Attachment, + CreateNotetakerRequest, NylasApiError, NylasOAuthError, NylasSdkTimeoutError, @@ -28,7 +29,19 @@ const apiError: NylasApiError = new NylasApiError({ void client; void classicClient; void classicDefaultClient; +const notetakerRequest: CreateNotetakerRequest = { + meetingLink: 'https://meet.google.com/abc-defg-hij', + notetakerSettings: { + name: 'Nylas Notetaker', + recordingType: 'audio', + transcription: true, + summary: true, + actionItems: true, + }, +}; + void attachment; +void notetakerRequest; void apiError; void NylasOAuthError; void NylasSdkTimeoutError; diff --git a/tests/types/package.mts b/tests/types/package.mts index 1e06b591..b37fd305 100644 --- a/tests/types/package.mts +++ b/tests/types/package.mts @@ -1,5 +1,6 @@ import Nylas, { Attachment, + CreateNotetakerRequest, NylasApiError, NylasOAuthError, NylasSdkTimeoutError, @@ -19,7 +20,19 @@ const apiError: NylasApiError = new NylasApiError({ }); void client; +const notetakerRequest: CreateNotetakerRequest = { + meetingLink: 'https://meet.google.com/abc-defg-hij', + notetakerSettings: { + name: 'Nylas Notetaker', + recordingType: 'audio', + transcription: true, + summary: true, + actionItems: true, + }, +}; + void attachment; +void notetakerRequest; void apiError; void NylasOAuthError; void NylasSdkTimeoutError; From 7d5c95c2ba99c7f8d783d9a7e5b79038d4287d35 Mon Sep 17 00:00:00 2001 From: Albert T Date: Mon, 23 Nov 2026 18:59:14 -0500 Subject: [PATCH 02/13] Keep Notetaker response fields required; split video output types - Restore Notetaker.name and Notetaker.meetingSettings as required so the change ships without breaking existing callers; document that the API omits them for Notetakers created with notetakerSettings. - Type video output uploads (mediaType + data, or {} to disable) apart from the stored image metadata returned in responses, so fetched settings cannot be passed back with read-only fields. - Fix the changelog: configId is on create only. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 3 +- cjs-wrapper.d.ts | 3 + examples/calendars/event_with_notetaker.ts | 6 +- examples/notetakers/notetaker.ts | 4 +- src/models/notetakers.ts | 75 ++++++++++++++++------ tests/resources/notetakers.spec.ts | 26 ++++++++ 6 files changed, 90 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d90981fe..e5fffbca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,12 +10,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 Planned version: **8.5.1**. ### Added -- Type `notetakerSettings` and `configId` on Notetaker create and update requests, and `notetakerSettings` on Notetaker responses, matching the current Notetaker API. +- Type `notetakerSettings` on Notetaker create and update requests, `configId` on Notetaker create requests, and `notetakerSettings` on Notetaker responses, matching the current Notetaker API. - Type the summary, action item, transcription, silence and message fields on `NotetakerMeetingSettings`. ### Changed - Mark the Notetaker request `name` and `meetingSettings` fields as deprecated in favor of `notetakerSettings`. -- Make `Notetaker.name` and `Notetaker.meetingSettings` optional, because the API omits them for Notetakers created with `notetakerSettings`. ### Fixed - Preserve upload-session HTTP header map keys while decoding API responses (NYL-476). diff --git a/cjs-wrapper.d.ts b/cjs-wrapper.d.ts index 771e56d8..0ab33421 100644 --- a/cjs-wrapper.d.ts +++ b/cjs-wrapper.d.ts @@ -182,6 +182,7 @@ declare namespace Nylas { export import MicrosoftCreateConnectorSettings = models.MicrosoftCreateConnectorSettings; export import Notetaker = models.Notetaker; export import NotetakerConfigSettings = models.NotetakerConfigSettings; + export import NotetakerConfigSettingsResponse = models.NotetakerConfigSettingsResponse; export import NotetakerCustomInstructionsSettings = models.NotetakerCustomInstructionsSettings; export import NotetakerLeaveResponse = models.NotetakerLeaveResponse; export import NotetakerMedia = models.NotetakerMedia; @@ -197,6 +198,8 @@ declare namespace Nylas { export import NotetakerTranscript = models.NotetakerTranscript; export import NotetakerTranscriptionSettings = models.NotetakerTranscriptionSettings; export import NotetakerVideoOutput = models.NotetakerVideoOutput; + export import NotetakerVideoOutputMediaType = models.NotetakerVideoOutputMediaType; + export import NotetakerVideoOutputUpload = models.NotetakerVideoOutputUpload; export import NylasApiError = models.NylasApiError; export import NylasApiErrorResponse = models.NylasApiErrorResponse; export import NylasApiErrorResponseData = models.NylasApiErrorResponseData; diff --git a/examples/calendars/event_with_notetaker.ts b/examples/calendars/event_with_notetaker.ts index 481190c3..6f63af67 100644 --- a/examples/calendars/event_with_notetaker.ts +++ b/examples/calendars/event_with_notetaker.ts @@ -160,13 +160,13 @@ async function getEventNotetaker( console.log(`- Meeting Provider: ${notetaker.data.meetingProvider}`); console.log(`- Meeting Settings:`); console.log( - ` - Video Recording: ${notetaker.data.meetingSettings?.videoRecording}` + ` - Video Recording: ${notetaker.data.meetingSettings.videoRecording}` ); console.log( - ` - Audio Recording: ${notetaker.data.meetingSettings?.audioRecording}` + ` - Audio Recording: ${notetaker.data.meetingSettings.audioRecording}` ); console.log( - ` - Transcription: ${notetaker.data.meetingSettings?.transcription}` + ` - Transcription: ${notetaker.data.meetingSettings.transcription}` ); return notetaker; diff --git a/examples/notetakers/notetaker.ts b/examples/notetakers/notetaker.ts index 2e3c446b..b80f80df 100644 --- a/examples/notetakers/notetaker.ts +++ b/examples/notetakers/notetaker.ts @@ -59,7 +59,9 @@ async function inviteNotetaker(): Promise> { const notetaker = await nylas.notetakers.create({ requestBody }); console.log(`Invited Notetaker with ID: ${notetaker.data.id}`); - console.log(`Name: ${notetaker.data.notetakerSettings?.name}`); + console.log( + `Name: ${notetaker.data.notetakerSettings?.name ?? notetaker.data.name}` + ); console.log(`State: ${notetaker.data.state}`); return notetaker; } catch (error) { diff --git a/src/models/notetakers.ts b/src/models/notetakers.ts index 8f9076e7..0af44bf9 100644 --- a/src/models/notetakers.ts +++ b/src/models/notetakers.ts @@ -115,31 +115,49 @@ export interface NotetakerMessages { } /** - * A static image the Notetaker bot shows as its camera feed. - * To upload an image, send `mediaType` and `data` together. - * Send an empty object to disable video output. + * The image formats Notetaker accepts for video output. + */ +export type NotetakerVideoOutputMediaType = + 'image/png' | 'image/jpeg' | 'image/webp'; + +/** + * A static image for the Notetaker bot to show as its camera feed. + * Send `mediaType` and base64 `data` together to upload an image, + * or an empty object to disable video output. + */ +export type NotetakerVideoOutputUpload = + | { + /** + * The image MIME type. Must match the actual file content. + */ + mediaType: NotetakerVideoOutputMediaType; + /** + * The base64-encoded image bytes. + */ + data: string; + } + | Record; + +/** + * The stored video output image returned in Notetaker responses. */ export interface NotetakerVideoOutput { /** - * The image MIME type. Required together with `data` when uploading an image. - */ - mediaType?: 'image/png' | 'image/jpeg' | 'image/webp'; - /** - * The base64-encoded image bytes. Write-only. + * The image MIME type. */ - data?: string; + mediaType?: NotetakerVideoOutputMediaType; /** - * The size of the stored image, in bytes. Read-only. + * The size of the stored image, in bytes. */ - readonly size?: number; + size?: number; /** - * A signed URL for previewing the stored image. Read-only. + * A signed URL for previewing the stored image. Valid for 1 hour. */ - readonly previewUrl?: string; + previewUrl?: string; /** - * When `previewUrl` expires, in Unix timestamp format. Read-only. + * When `previewUrl` expires, in Unix timestamp format. */ - readonly previewUrlExpiresAt?: number; + previewUrlExpiresAt?: number; } /** @@ -200,7 +218,7 @@ export interface NotetakerConfigSettings { /** * A static image the Notetaker bot shows as its camera feed. */ - videoOutput?: NotetakerVideoOutput; + videoOutput?: NotetakerVideoOutputUpload; /** * How long Notetaker media is kept before Nylas deletes it, in seconds. * Must be between 300 and 2592000. @@ -208,6 +226,19 @@ export interface NotetakerConfigSettings { retentionTime?: number; } +/** + * Notetaker settings as returned in Notetaker responses. + */ +export interface NotetakerConfigSettingsResponse extends Omit< + NotetakerConfigSettings, + 'videoOutput' +> { + /** + * The stored video output image, if one is set. + */ + videoOutput?: NotetakerVideoOutput; +} + /** * Interface representing Notetaker Meeting Settings */ @@ -268,9 +299,10 @@ export interface Notetaker { id: string; /** * The display name for the Notetaker bot. - * Returned only for Notetakers created with the deprecated `name` and `meetingSettings` fields. + * The API omits this field for Notetakers created with `notetakerSettings`; + * read `notetakerSettings.name` for those. */ - name?: string; + name: string; /** * When Notetaker joined the meeting, in Unix timestamp format. */ @@ -297,14 +329,15 @@ export interface Notetaker { eventId?: string; /** * Notetaker Meeting Settings. - * Returned only for Notetakers created with the deprecated `name` and `meetingSettings` fields. + * The API omits this field for Notetakers created with `notetakerSettings`; + * read `notetakerSettings` for those. */ - meetingSettings?: NotetakerMeetingSettings; + meetingSettings: NotetakerMeetingSettings; /** * The Notetaker's settings. * Returned for Notetakers created or updated with `notetakerSettings`. */ - notetakerSettings?: NotetakerConfigSettings; + notetakerSettings?: NotetakerConfigSettingsResponse; } /** diff --git a/tests/resources/notetakers.spec.ts b/tests/resources/notetakers.spec.ts index 4aa50780..326f7b13 100644 --- a/tests/resources/notetakers.spec.ts +++ b/tests/resources/notetakers.spec.ts @@ -374,6 +374,32 @@ describe('Notetakers', () => { }); }); + it('should type video output uploads separately from stored metadata', () => { + const disable: CreateNotetakerRequest = { + meetingLink: 'https://meet.google.com/abc-defg-hij', + notetakerSettings: { videoOutput: {} }, + }; + const missingMediaType: CreateNotetakerRequest = { + meetingLink: 'https://meet.google.com/abc-defg-hij', + // @ts-expect-error data requires mediaType + notetakerSettings: { videoOutput: { data: 'aGVsbG8=' } }, + }; + const responseMetadata: CreateNotetakerRequest = { + meetingLink: 'https://meet.google.com/abc-defg-hij', + notetakerSettings: { + // @ts-expect-error stored image metadata is read-only + videoOutput: { mediaType: 'image/png', size: 1024 }, + }, + }; + + expect(toWireFormat(disable)).toEqual({ + meeting_link: 'https://meet.google.com/abc-defg-hij', + notetaker_settings: { video_output: {} }, + }); + expect(missingMediaType).toBeDefined(); + expect(responseMetadata).toBeDefined(); + }); + it('should keep a null transcriptionSettings when serializing', () => { const requestBody: CreateNotetakerRequest = { meetingLink: 'https://meet.google.com/abc-defg-hij', From 2841ef67d3f72d42f960af0c13654e9837fb1a6e Mon Sep 17 00:00:00 2001 From: Albert T Date: Mon, 23 Nov 2026 19:12:49 -0500 Subject: [PATCH 03/13] Reject stored image fields on uploads; clarify Notetaker settings docs - Mark size, previewUrl and previewUrlExpiresAt as never on video output uploads so spreading fetched metadata into an upload fails to compile. - Document that on update, transcriptionSettings null restores inherited settings and {} clears them. - Note that configId also excludes the deprecated name and meetingSettings. Co-Authored-By: Claude Opus 5.5 --- src/models/notetakers.ts | 13 +++++++++++-- tests/resources/notetakers.spec.ts | 15 +++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/models/notetakers.ts b/src/models/notetakers.ts index 0af44bf9..e5fed1f3 100644 --- a/src/models/notetakers.ts +++ b/src/models/notetakers.ts @@ -135,6 +135,12 @@ export type NotetakerVideoOutputUpload = * The base64-encoded image bytes. */ data: string; + /** Read-only; not accepted on writes. */ + size?: never; + /** Read-only; not accepted on writes. */ + previewUrl?: never; + /** Read-only; not accepted on writes. */ + previewUrlExpiresAt?: never; } | Record; @@ -180,7 +186,9 @@ export interface NotetakerConfigSettings { transcription?: boolean; /** * Optional settings that tune how Notetaker transcribes audio. - * Send `null` or `{}` to clear inherited settings. + * On create, send `null` or `{}` to clear inherited settings. + * On update, `null` removes this Notetaker's override and restores the + * inherited settings, and `{}` clears them. */ transcriptionSettings?: NotetakerTranscriptionSettings | null; /** @@ -440,7 +448,8 @@ export interface CreateNotetakerRequest { /** * The ID of an existing configuration to use for this Notetaker. - * Cannot be used together with `notetakerSettings`. + * Cannot be used together with `notetakerSettings` or the deprecated + * `name` and `meetingSettings` fields. */ configId?: string; diff --git a/tests/resources/notetakers.spec.ts b/tests/resources/notetakers.spec.ts index 326f7b13..bfe96523 100644 --- a/tests/resources/notetakers.spec.ts +++ b/tests/resources/notetakers.spec.ts @@ -392,6 +392,21 @@ describe('Notetakers', () => { }, }; + const stored = { + mediaType: 'image/png' as const, + size: 1024, + previewUrl: 'https://example.com/preview.png', + previewUrlExpiresAt: 1234567890, + }; + const spreadStored: CreateNotetakerRequest = { + meetingLink: 'https://meet.google.com/abc-defg-hij', + notetakerSettings: { + // @ts-expect-error stored image metadata cannot ride along with an upload + videoOutput: { ...stored, data: 'aGVsbG8=' }, + }, + }; + + expect(spreadStored).toBeDefined(); expect(toWireFormat(disable)).toEqual({ meeting_link: 'https://meet.google.com/abc-defg-hij', notetaker_settings: { video_output: {} }, From d68fb3130457cbba9c276a7faf6f7be579ef2810 Mon Sep 17 00:00:00 2001 From: Albert T Date: Tue, 24 Nov 2026 00:54:14 -0500 Subject: [PATCH 04/13] Document when Notetaker responses omit name and meetingSettings The API returns notetakerSettings instead of name and meetingSettings for any Notetaker that uses Notetaker settings, including creates with configId and bare creates under a grant or application configuration. Also show how to drop videoOutput before sending fetched settings back. Co-Authored-By: Claude Opus 5.5 --- src/models/notetakers.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/models/notetakers.ts b/src/models/notetakers.ts index e5fed1f3..266ff256 100644 --- a/src/models/notetakers.ts +++ b/src/models/notetakers.ts @@ -236,6 +236,10 @@ export interface NotetakerConfigSettings { /** * Notetaker settings as returned in Notetaker responses. + * + * To send fetched settings back in an update, drop `videoOutput` first. The API + * rejects its stored image fields on writes: + * `const { videoOutput, ...settings } = notetaker.notetakerSettings ?? {};` */ export interface NotetakerConfigSettingsResponse extends Omit< NotetakerConfigSettings, @@ -307,8 +311,10 @@ export interface Notetaker { id: string; /** * The display name for the Notetaker bot. - * The API omits this field for Notetakers created with `notetakerSettings`; - * read `notetakerSettings.name` for those. + * The API omits this field for Notetakers that use Notetaker settings: those + * created with `notetakerSettings` or `configId`, and those created with + * neither while a Notetaker configuration applies to the grant or + * application. Read `notetakerSettings.name` for those. */ name: string; /** @@ -337,13 +343,13 @@ export interface Notetaker { eventId?: string; /** * Notetaker Meeting Settings. - * The API omits this field for Notetakers created with `notetakerSettings`; - * read `notetakerSettings` for those. + * The API omits this field for Notetakers that use Notetaker settings (see + * `name`). Read `notetakerSettings` for those. */ meetingSettings: NotetakerMeetingSettings; /** * The Notetaker's settings. - * Returned for Notetakers created or updated with `notetakerSettings`. + * Returned for Notetakers that use Notetaker settings (see `name`). */ notetakerSettings?: NotetakerConfigSettingsResponse; } From e04feec4ca354fa82253d0cfa33c1b571ef32be5 Mon Sep 17 00:00:00 2001 From: Albert T Date: Tue, 24 Nov 2026 01:35:33 -0500 Subject: [PATCH 05/13] Make Notetaker.name and meetingSettings optional; plan 8.6.0 The API omits name and meeting_settings for every Notetaker that uses Notetaker settings: creates with notetakerSettings or configId, and bare creates under a grant or application configuration. Typing them as always present let code like notetaker.name.toUpperCase() compile and then throw. Strict callers that read these fields now need a check or a fallback. The planned release moves from 8.5.1 to 8.6.0 for the new types, deprecations and this type change. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 3 ++- examples/calendars/event_with_notetaker.ts | 6 +++--- package-lock.json | 4 ++-- package.json | 2 +- src/models/notetakers.ts | 4 ++-- src/version.ts | 2 +- 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e5fffbca..08099560 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -Planned version: **8.5.1**. +Planned version: **8.6.0**. ### Added - Type `notetakerSettings` on Notetaker create and update requests, `configId` on Notetaker create requests, and `notetakerSettings` on Notetaker responses, matching the current Notetaker API. @@ -15,6 +15,7 @@ Planned version: **8.5.1**. ### Changed - Mark the Notetaker request `name` and `meetingSettings` fields as deprecated in favor of `notetakerSettings`. +- Make `Notetaker.name` and `Notetaker.meetingSettings` optional. The API omits them for Notetakers that use Notetaker settings, including Notetakers created with `configId` or under a grant or application configuration. Code that reads them under `strict` now needs a check or a fallback, such as `notetaker.notetakerSettings?.name ?? notetaker.name`. ### Fixed - Preserve upload-session HTTP header map keys while decoding API responses (NYL-476). diff --git a/examples/calendars/event_with_notetaker.ts b/examples/calendars/event_with_notetaker.ts index 6f63af67..481190c3 100644 --- a/examples/calendars/event_with_notetaker.ts +++ b/examples/calendars/event_with_notetaker.ts @@ -160,13 +160,13 @@ async function getEventNotetaker( console.log(`- Meeting Provider: ${notetaker.data.meetingProvider}`); console.log(`- Meeting Settings:`); console.log( - ` - Video Recording: ${notetaker.data.meetingSettings.videoRecording}` + ` - Video Recording: ${notetaker.data.meetingSettings?.videoRecording}` ); console.log( - ` - Audio Recording: ${notetaker.data.meetingSettings.audioRecording}` + ` - Audio Recording: ${notetaker.data.meetingSettings?.audioRecording}` ); console.log( - ` - Transcription: ${notetaker.data.meetingSettings.transcription}` + ` - Transcription: ${notetaker.data.meetingSettings?.transcription}` ); return notetaker; diff --git a/package-lock.json b/package-lock.json index 0df2677d..c9b98b1b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "nylas", - "version": "8.5.1", + "version": "8.6.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "nylas", - "version": "8.5.1", + "version": "8.6.0", "license": "MIT", "dependencies": { "change-case": "^4.1.2", diff --git a/package.json b/package.json index aa4ca580..d3182015 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nylas", - "version": "8.5.1", + "version": "8.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", diff --git a/src/models/notetakers.ts b/src/models/notetakers.ts index 266ff256..b7d14492 100644 --- a/src/models/notetakers.ts +++ b/src/models/notetakers.ts @@ -316,7 +316,7 @@ export interface Notetaker { * neither while a Notetaker configuration applies to the grant or * application. Read `notetakerSettings.name` for those. */ - name: string; + name?: string; /** * When Notetaker joined the meeting, in Unix timestamp format. */ @@ -346,7 +346,7 @@ export interface Notetaker { * The API omits this field for Notetakers that use Notetaker settings (see * `name`). Read `notetakerSettings` for those. */ - meetingSettings: NotetakerMeetingSettings; + meetingSettings?: NotetakerMeetingSettings; /** * The Notetaker's settings. * Returned for Notetakers that use Notetaker settings (see `name`). diff --git a/src/version.ts b/src/version.ts index 69694128..15436aa0 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1,2 +1,2 @@ // This file is generated by scripts/exportVersion.js -export const SDK_VERSION = '8.5.1'; +export const SDK_VERSION = '8.6.0'; From a8c9e2b05e2c0dc7a90a92e7d223d2d6879ecfd2 Mon Sep 17 00:00:00 2001 From: Albert T Date: Tue, 24 Nov 2026 01:45:56 -0500 Subject: [PATCH 06/13] Type notetaker_settings on calendar and event Notetakers; fix eventSelection values Calendar and event Notetaker settings take notetaker_settings, and calendars also take config_id, autocreate, deduplication_policy and nested AND groups in rules.event_selection. The SDK typed only the legacy fields, so these failed to compile. The SDK typed eventSelection values as ownEvents and participantOnly. Case conversion only renames keys, so those were sent unchanged and the API rejected them. Type the values the API accepts. Also apply round-3 review fixes: describe inherited configurations correctly, drop the settings round-trip recipe, document that PATCH replaces composite settings whole, and give the CHANGELOG fallback a string default. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 4 +- cjs-wrapper.d.ts | 1 + examples/notetakers/notetaker.ts | 2 +- src/models/calendars.ts | 59 +++++++++++++++++---- src/models/events.ts | 13 ++++- src/models/notetakers.ts | 15 +++--- tests/resources/calendars.spec.ts | 87 +++++++++++++++++++++++++++++++ tests/resources/events.spec.ts | 56 ++++++++++++++++++++ 8 files changed, 217 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 08099560..8cfb30d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,12 +12,14 @@ Planned version: **8.6.0**. ### Added - Type `notetakerSettings` on Notetaker create and update requests, `configId` on Notetaker create requests, and `notetakerSettings` on Notetaker responses, matching the current Notetaker API. - Type the summary, action item, transcription, silence and message fields on `NotetakerMeetingSettings`. +- Type `notetakerSettings`, `configId`, `autocreate` and `deduplicationPolicy` on calendar Notetaker settings, `notetakerSettings` on event Notetaker settings, and nested AND groups in calendar `rules.eventSelection`. ### Changed - Mark the Notetaker request `name` and `meetingSettings` fields as deprecated in favor of `notetakerSettings`. -- Make `Notetaker.name` and `Notetaker.meetingSettings` optional. The API omits them for Notetakers that use Notetaker settings, including Notetakers created with `configId` or under a grant or application configuration. Code that reads them under `strict` now needs a check or a fallback, such as `notetaker.notetakerSettings?.name ?? notetaker.name`. +- **Breaking TypeScript change:** make `Notetaker.name` and `Notetaker.meetingSettings` optional. The API omits them for Notetakers that use Notetaker settings: Notetakers created with `notetakerSettings` or `configId`, and Notetakers that inherit a Notetaker configuration, such as a workspace or application configuration. Code that reads them under `strict` now needs a check or a fallback, such as `notetaker.notetakerSettings?.name ?? notetaker.name ?? 'Nylas Notetaker'`. Read settings from `notetakerSettings` instead of `meetingSettings`. ### Fixed +- Type calendar Notetaker `rules.eventSelection` values as the API expects them (`own_events`, `participant_only`). The SDK sent `ownEvents` and `participantOnly` unchanged, and the API rejected them. - Preserve upload-session HTTP header map keys while decoding API responses (NYL-476). - Patch vulnerable SDK tooling and example HTTP dependencies while preserving TypeDoc compatibility (NYL-471). - Redact request bodies, provider errors, and stack traces from AWS Lambda example errors and logs (NYL-473). diff --git a/cjs-wrapper.d.ts b/cjs-wrapper.d.ts index 0ab33421..cd13ea5f 100644 --- a/cjs-wrapper.d.ts +++ b/cjs-wrapper.d.ts @@ -47,6 +47,7 @@ declare namespace Nylas { export import BuildServiceAccountHeadersParams = models.BuildServiceAccountHeadersParams; export import Calendar = models.Calendar; export import CalendarNotetaker = models.CalendarNotetaker; + export import CalendarNotetakerEventSelection = models.CalendarNotetakerEventSelection; export import CalendarNotetakerParticipantFilter = models.CalendarNotetakerParticipantFilter; export import CalendarNotetakerRules = models.CalendarNotetakerRules; export import CleanMessagesRequest = models.CleanMessagesRequest; diff --git a/examples/notetakers/notetaker.ts b/examples/notetakers/notetaker.ts index b80f80df..05318f02 100644 --- a/examples/notetakers/notetaker.ts +++ b/examples/notetakers/notetaker.ts @@ -97,7 +97,7 @@ async function listNotetakers(): Promise> { ); for (const notetaker of notetakers.data) { console.log( - `- ${notetaker.name} (ID: ${notetaker.id}, State: ${notetaker.state})` + `- ${notetaker.notetakerSettings?.name ?? notetaker.name} (ID: ${notetaker.id}, State: ${notetaker.state})` ); } diff --git a/src/models/calendars.ts b/src/models/calendars.ts index 2fe92a0a..a0f90afd 100644 --- a/src/models/calendars.ts +++ b/src/models/calendars.ts @@ -1,5 +1,8 @@ import { ListQueryParams } from './listQueryParams.js'; -import { NotetakerMeetingSettings } from './notetakers.js'; +import { + NotetakerConfigSettings, + NotetakerMeetingSettings, +} from './notetakers.js'; /** * Interface for Calendar Notetaker participant filter @@ -15,20 +18,30 @@ export interface CalendarNotetakerParticipantFilter { participantsLte?: number; } +/** + * A criterion for which events a calendar's Notetaker joins. + * "all": Events with meeting links. + * "internal": Events where the host's domain matches all participants' domains. + * "external": Events where the host's domain differs from any participant's domain. + * "own_events": Events where the user's grant is the host. + * "participant_only": Events where the user's grant is a participant but not the host. + */ +export type CalendarNotetakerEventSelection = + 'all' | 'internal' | 'external' | 'own_events' | 'participant_only'; + /** * Interface for Calendar Notetaker rules */ export interface CalendarNotetakerRules { /** - * Types of events to include for notetaking. This is a union of events that should have a Notetaker sent to them. - * "internal": Events where the host domain matches all participants' domain names - * "external": Events where the host domain differs from any participant's domain name - * "own_events": Events where the host is the same as the user's grant - * "participant_only": Events where the user's grant is a participant but not the host - * "all": When all options are included, all events with meeting links will have Notetakers + * Types of events to include for notetaking. + * Each item is a single criterion or a group of criteria. + * Top-level items are OR'd together, and criteria inside a group are AND'd. + * For example, `['internal', ['own_events', 'external']]` matches internal events, + * or events the user hosts that have at least one external participant. */ eventSelection?: Array< - 'internal' | 'external' | 'all' | 'ownEvents' | 'participantOnly' + CalendarNotetakerEventSelection | CalendarNotetakerEventSelection[] >; /** * Filters to apply based on the number of participants. This is an intersection with the event_selection. @@ -38,18 +51,46 @@ export interface CalendarNotetakerRules { } /** - * Interface for Calendar Notetaker settings + * Interface for Calendar Notetaker settings. + * Use one of `notetakerSettings`, `configId`, `autocreate`, or the deprecated + * `name` and `meetingSettings`. Combining them returns a validation error. + * `rules` can be combined with `notetakerSettings` or the deprecated fields. */ export interface CalendarNotetaker { /** * The display name for the Notetaker bot. * @default "Nylas Notetaker" + * @deprecated Use `notetakerSettings.name` instead. */ name?: string; /** * Notetaker Meeting Settings + * @deprecated Use `notetakerSettings` instead. */ meetingSettings?: NotetakerMeetingSettings; + /** + * Settings for the Notetakers that join this calendar's events. + * Nylas saves them as a calendar configuration. + * Requests replace the whole `notetaker` object, so include these settings + * when you update `rules`. + */ + notetakerSettings?: NotetakerConfigSettings; + /** + * The ID of an application or workspace Notetaker configuration to apply to this calendar. + */ + configId?: string; + /** + * When true, Nylas creates Notetakers for matching events using the settings + * inherited from your configurations. Must be true when set. + */ + autocreate?: boolean; + /** + * Whether Notetakers created from this calendar take part in deduplication. + * "inherit": Use the policy from your configurations. + * "disable": Opt this calendar out of deduplication. + * Only valid with `notetakerSettings`. + */ + deduplicationPolicy?: 'inherit' | 'disable'; /** * Rules for when the Notetaker should join a meeting. */ diff --git a/src/models/events.ts b/src/models/events.ts index 396d0f6d..18d3be86 100644 --- a/src/models/events.ts +++ b/src/models/events.ts @@ -2,10 +2,14 @@ import { Subset } from '../utils.js'; import { NylasApiErrorResponseData } from './error.js'; import { ListQueryParams } from './listQueryParams.js'; import { NylasBaseResponse } from './response.js'; -import { NotetakerMeetingSettings } from './notetakers.js'; +import { + NotetakerConfigSettings, + NotetakerMeetingSettings, +} from './notetakers.js'; /** - * Interface representing Notetaker settings + * Interface representing Notetaker settings for an event. + * Use either `notetakerSettings` or the older `name` and `meetingSettings`, not both. */ export interface NotetakerSettings { /** @@ -17,6 +21,11 @@ export interface NotetakerSettings { * Notetaker Meeting Settings */ meetingSettings?: NotetakerMeetingSettings; + /** + * Settings for the Notetaker that joins this event. + * Nylas saves them as an event configuration. + */ + notetakerSettings?: NotetakerConfigSettings; } /** diff --git a/src/models/notetakers.ts b/src/models/notetakers.ts index b7d14492..cc1275c7 100644 --- a/src/models/notetakers.ts +++ b/src/models/notetakers.ts @@ -236,10 +236,9 @@ export interface NotetakerConfigSettings { /** * Notetaker settings as returned in Notetaker responses. - * - * To send fetched settings back in an update, drop `videoOutput` first. The API - * rejects its stored image fields on writes: - * `const { videoOutput, ...settings } = notetaker.notetakerSettings ?? {};` + * Responses can include stored metadata that the API rejects on writes, so + * send only the fields you want to change in an update instead of the + * fetched settings. */ export interface NotetakerConfigSettingsResponse extends Omit< NotetakerConfigSettings, @@ -312,9 +311,9 @@ export interface Notetaker { /** * The display name for the Notetaker bot. * The API omits this field for Notetakers that use Notetaker settings: those - * created with `notetakerSettings` or `configId`, and those created with - * neither while a Notetaker configuration applies to the grant or - * application. Read `notetakerSettings.name` for those. + * created with `notetakerSettings` or `configId`, and those that inherit a + * Notetaker configuration, such as a workspace or application configuration. + * Read `notetakerSettings.name` for those. */ name?: string; /** @@ -492,6 +491,8 @@ export interface UpdateNotetakerRequest { /** * Notetaker settings to change. Omitted fields keep their current values. + * `transcriptionSettings`, `messages`, and `videoOutput` are replaced whole, + * so send the complete object you want to end up with. * Cannot be used together with the deprecated `name` and `meetingSettings` fields. */ notetakerSettings?: NotetakerConfigSettings; diff --git a/tests/resources/calendars.spec.ts b/tests/resources/calendars.spec.ts index 327d458b..8e439125 100644 --- a/tests/resources/calendars.spec.ts +++ b/tests/resources/calendars.spec.ts @@ -4,6 +4,11 @@ import { AvailabilityMethod, SpecificTimeAvailability, } from '../../src/models/availability'; +import { + CalendarNotetaker, + UpdateCalenderRequest, +} from '../../src/models/calendars'; +import { objKeysToCamelCase, objKeysToSnakeCase } from '../../src/utils'; jest.mock('../../src/apiClient'); describe('Calendars', () => { @@ -255,6 +260,88 @@ describe('Calendars', () => { }, }); }); + + it('should send notetakerSettings with nested event selection rules', async () => { + const requestBody: UpdateCalenderRequest = { + notetaker: { + notetakerSettings: { + name: 'Calendar Notetaker', + recordingType: 'audio', + transcription: true, + summary: true, + actionItems: true, + }, + deduplicationPolicy: 'disable', + rules: { + eventSelection: ['internal', ['own_events', 'external']], + participantFilter: { participantsGte: 2 }, + }, + }, + }; + + await calendars.update({ + identifier: 'id123', + calendarId: 'calendar123', + requestBody, + }); + + expect(apiClient.request).toHaveBeenCalledWith( + expect.objectContaining({ + method: 'PUT', + path: '/v3/grants/id123/calendars/calendar123', + body: requestBody, + }) + ); + expect( + objKeysToSnakeCase(requestBody as Record, ['metadata']) + ).toEqual({ + notetaker: { + notetaker_settings: { + name: 'Calendar Notetaker', + recording_type: 'audio', + transcription: true, + summary: true, + action_items: true, + }, + deduplication_policy: 'disable', + rules: { + event_selection: ['internal', ['own_events', 'external']], + participant_filter: { participants_gte: 2 }, + }, + }, + }); + }); + + it('should accept configId and autocreate modes', () => { + const fromConfig: CalendarNotetaker = { configId: 'config-123' }; + const autocreate: CalendarNotetaker = { + autocreate: true, + rules: { eventSelection: ['all'] }, + }; + expect(fromConfig.configId).toBe('config-123'); + expect(autocreate.autocreate).toBe(true); + }); + + it('should only accept event selection values the API accepts', () => { + const rules: CalendarNotetaker['rules'] = { + // @ts-expect-error The API takes own_events; values are not case-converted. + eventSelection: ['ownEvents'], + }; + expect(rules).toBeDefined(); + }); + + it('should camelCase notetakerSettings in calendar responses', () => { + const notetaker = objKeysToCamelCase({ + notetaker_settings: { + name: 'Calendar Notetaker', + recording_type: 'audio_video', + }, + rules: { event_selection: ['participant_only'] }, + }) as CalendarNotetaker; + + expect(notetaker.notetakerSettings?.recordingType).toBe('audio_video'); + expect(notetaker.rules?.eventSelection).toEqual(['participant_only']); + }); }); describe('destroy', () => { diff --git a/tests/resources/events.spec.ts b/tests/resources/events.spec.ts index 96c9a6f6..c014d8e3 100644 --- a/tests/resources/events.spec.ts +++ b/tests/resources/events.spec.ts @@ -1,5 +1,7 @@ import APIClient from '../../src/apiClient'; import { Events } from '../../src/resources/events'; +import { CreateEventRequest, NotetakerSettings } from '../../src/models/events'; +import { objKeysToCamelCase, objKeysToSnakeCase } from '../../src/utils'; jest.mock('../../src/apiClient'); describe('Events', () => { @@ -383,6 +385,60 @@ describe('Events', () => { }, }); }); + + it('should send notetakerSettings on an event', async () => { + const requestBody: CreateEventRequest = { + when: { time: 123, timezone: 'America/Toronto' }, + notetaker: { + notetakerSettings: { + name: 'Finance Meeting Notetaker', + recordingType: 'audio_video', + summary: true, + leaveAfterSilenceSeconds: 360, + }, + }, + }; + + await events.create({ + identifier: 'id123', + requestBody, + queryParams: { calendarId: 'calendar123' }, + }); + + expect(apiClient.request).toHaveBeenCalledWith( + expect.objectContaining({ + method: 'POST', + path: '/v3/grants/id123/events', + body: requestBody, + }) + ); + expect( + objKeysToSnakeCase(requestBody as unknown as Record, [ + 'metadata', + ]) + ).toEqual({ + when: { time: 123, timezone: 'America/Toronto' }, + notetaker: { + notetaker_settings: { + name: 'Finance Meeting Notetaker', + recording_type: 'audio_video', + summary: true, + leave_after_silence_seconds: 360, + }, + }, + }); + }); + + it('should camelCase notetakerSettings in event responses', () => { + const notetaker = objKeysToCamelCase({ + notetaker_settings: { + name: 'Finance Meeting Notetaker', + summary: true, + }, + }) as NotetakerSettings; + + expect(notetaker.notetakerSettings?.summary).toBe(true); + }); }); describe('update', () => { From 0b6e1a92722e217d5c0cd94bca8927a71a42d429 Mon Sep 17 00:00:00 2001 From: Albert T Date: Tue, 24 Nov 2026 01:56:19 -0500 Subject: [PATCH 07/13] Exclude videoOutput from sync settings; tighten calendar and event Notetaker types Calendar and event sync reject video_output, so their notetakerSettings use NotetakerSyncSettings, which omits it. autocreate must be true and cannot be combined with rules, so type it as true and fix the test that combined them. Add the documented event-level deduplicationPolicy opt-out, note that nested eventSelection groups need a criterion and that a rules-only calendar update resets settings to legacy defaults, and flag the eventSelection item change as breaking in the CHANGELOG. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 3 ++- cjs-wrapper.d.ts | 1 + src/models/calendars.ts | 14 ++++++++------ src/models/events.ts | 11 +++++++++-- src/models/notetakers.ts | 9 +++++++++ tests/resources/calendars.spec.ts | 15 +++++++++++---- tests/resources/events.spec.ts | 2 ++ 7 files changed, 42 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8cfb30d4..2d793c22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,11 +12,12 @@ Planned version: **8.6.0**. ### Added - Type `notetakerSettings` on Notetaker create and update requests, `configId` on Notetaker create requests, and `notetakerSettings` on Notetaker responses, matching the current Notetaker API. - Type the summary, action item, transcription, silence and message fields on `NotetakerMeetingSettings`. -- Type `notetakerSettings`, `configId`, `autocreate` and `deduplicationPolicy` on calendar Notetaker settings, `notetakerSettings` on event Notetaker settings, and nested AND groups in calendar `rules.eventSelection`. +- Type `notetakerSettings`, `configId`, `autocreate` and `deduplicationPolicy` on calendar Notetaker settings, `notetakerSettings` and `deduplicationPolicy` on event Notetaker settings, and nested AND groups in calendar `rules.eventSelection`. ### Changed - Mark the Notetaker request `name` and `meetingSettings` fields as deprecated in favor of `notetakerSettings`. - **Breaking TypeScript change:** make `Notetaker.name` and `Notetaker.meetingSettings` optional. The API omits them for Notetakers that use Notetaker settings: Notetakers created with `notetakerSettings` or `configId`, and Notetakers that inherit a Notetaker configuration, such as a workspace or application configuration. Code that reads them under `strict` now needs a check or a fallback, such as `notetaker.notetakerSettings?.name ?? notetaker.name ?? 'Nylas Notetaker'`. Read settings from `notetakerSettings` instead of `meetingSettings`. +- **Breaking TypeScript change:** calendar Notetaker `rules.eventSelection` items can now be nested groups, so code that treats the array as `string[]` needs to handle `string[]` items too. ### Fixed - Type calendar Notetaker `rules.eventSelection` values as the API expects them (`own_events`, `participant_only`). The SDK sent `ownEvents` and `participantOnly` unchanged, and the API rejected them. diff --git a/cjs-wrapper.d.ts b/cjs-wrapper.d.ts index cd13ea5f..2d404f22 100644 --- a/cjs-wrapper.d.ts +++ b/cjs-wrapper.d.ts @@ -196,6 +196,7 @@ declare namespace Nylas { export import NotetakerRecordingType = models.NotetakerRecordingType; export import NotetakerSettings = models.NotetakerSettings; export import NotetakerState = models.NotetakerState; + export import NotetakerSyncSettings = models.NotetakerSyncSettings; export import NotetakerTranscript = models.NotetakerTranscript; export import NotetakerTranscriptionSettings = models.NotetakerTranscriptionSettings; export import NotetakerVideoOutput = models.NotetakerVideoOutput; diff --git a/src/models/calendars.ts b/src/models/calendars.ts index a0f90afd..8b17d856 100644 --- a/src/models/calendars.ts +++ b/src/models/calendars.ts @@ -1,6 +1,6 @@ import { ListQueryParams } from './listQueryParams.js'; import { - NotetakerConfigSettings, + NotetakerSyncSettings, NotetakerMeetingSettings, } from './notetakers.js'; @@ -37,6 +37,7 @@ export interface CalendarNotetakerRules { * Types of events to include for notetaking. * Each item is a single criterion or a group of criteria. * Top-level items are OR'd together, and criteria inside a group are AND'd. + * Each group needs at least one criterion. * For example, `['internal', ['own_events', 'external']]` matches internal events, * or events the user hosts that have at least one external participant. */ @@ -71,19 +72,20 @@ export interface CalendarNotetaker { /** * Settings for the Notetakers that join this calendar's events. * Nylas saves them as a calendar configuration. - * Requests replace the whole `notetaker` object, so include these settings - * when you update `rules`. + * Requests replace the whole `notetaker` object. Include these settings when + * you update `rules`: a `notetaker` object with only `rules` replaces the + * calendar's settings with legacy defaults. */ - notetakerSettings?: NotetakerConfigSettings; + notetakerSettings?: NotetakerSyncSettings; /** * The ID of an application or workspace Notetaker configuration to apply to this calendar. */ configId?: string; /** * When true, Nylas creates Notetakers for matching events using the settings - * inherited from your configurations. Must be true when set. + * inherited from your configurations. Cannot be combined with `rules`. */ - autocreate?: boolean; + autocreate?: true; /** * Whether Notetakers created from this calendar take part in deduplication. * "inherit": Use the policy from your configurations. diff --git a/src/models/events.ts b/src/models/events.ts index 18d3be86..5acf0910 100644 --- a/src/models/events.ts +++ b/src/models/events.ts @@ -3,7 +3,7 @@ import { NylasApiErrorResponseData } from './error.js'; import { ListQueryParams } from './listQueryParams.js'; import { NylasBaseResponse } from './response.js'; import { - NotetakerConfigSettings, + NotetakerSyncSettings, NotetakerMeetingSettings, } from './notetakers.js'; @@ -25,7 +25,14 @@ export interface NotetakerSettings { * Settings for the Notetaker that joins this event. * Nylas saves them as an event configuration. */ - notetakerSettings?: NotetakerConfigSettings; + notetakerSettings?: NotetakerSyncSettings; + /** + * Whether this event's Notetaker takes part in deduplication. + * "inherit": Use the policy from your configurations. + * "disable": Exempt this event's Notetaker from deduplication. + * Only valid with `notetakerSettings`. + */ + deduplicationPolicy?: 'inherit' | 'disable'; } /** diff --git a/src/models/notetakers.ts b/src/models/notetakers.ts index cc1275c7..e1303090 100644 --- a/src/models/notetakers.ts +++ b/src/models/notetakers.ts @@ -234,6 +234,15 @@ export interface NotetakerConfigSettings { retentionTime?: number; } +/** + * Notetaker settings for calendar and event sync. + * Calendar and event sync do not support `videoOutput`. + */ +export type NotetakerSyncSettings = Omit< + NotetakerConfigSettings, + 'videoOutput' +>; + /** * Notetaker settings as returned in Notetaker responses. * Responses can include stored metadata that the API rejects on writes, so diff --git a/tests/resources/calendars.spec.ts b/tests/resources/calendars.spec.ts index 8e439125..6aa859b3 100644 --- a/tests/resources/calendars.spec.ts +++ b/tests/resources/calendars.spec.ts @@ -314,10 +314,7 @@ describe('Calendars', () => { it('should accept configId and autocreate modes', () => { const fromConfig: CalendarNotetaker = { configId: 'config-123' }; - const autocreate: CalendarNotetaker = { - autocreate: true, - rules: { eventSelection: ['all'] }, - }; + const autocreate: CalendarNotetaker = { autocreate: true }; expect(fromConfig.configId).toBe('config-123'); expect(autocreate.autocreate).toBe(true); }); @@ -330,6 +327,16 @@ describe('Calendars', () => { expect(rules).toBeDefined(); }); + it('should reject video output on calendar sync settings', () => { + const notetaker: CalendarNotetaker = { + notetakerSettings: { + // @ts-expect-error Calendar sync does not support videoOutput. + videoOutput: { mediaType: 'image/png', data: 'aGVsbG8=' }, + }, + }; + expect(notetaker).toBeDefined(); + }); + it('should camelCase notetakerSettings in calendar responses', () => { const notetaker = objKeysToCamelCase({ notetaker_settings: { diff --git a/tests/resources/events.spec.ts b/tests/resources/events.spec.ts index c014d8e3..59bffb0e 100644 --- a/tests/resources/events.spec.ts +++ b/tests/resources/events.spec.ts @@ -396,6 +396,7 @@ describe('Events', () => { summary: true, leaveAfterSilenceSeconds: 360, }, + deduplicationPolicy: 'disable', }, }; @@ -425,6 +426,7 @@ describe('Events', () => { summary: true, leave_after_silence_seconds: 360, }, + deduplication_policy: 'disable', }, }); }); From c0d56da26f3908d33c3a0d26a415912cca026d87 Mon Sep 17 00:00:00 2001 From: Albert T Date: Tue, 24 Nov 2026 02:04:06 -0500 Subject: [PATCH 08/13] Reject reused settings with videoOutput on sync; document dedup reset NotetakerSyncSettings now marks videoOutput as never, so a reused NotetakerConfigSettings object with an image no longer assigns to calendar or event sync settings. Document that calendar updates reset an omitted deduplicationPolicy to inherit, and that update payloads should be built from the fields being set rather than a fetched notetaker object. Co-Authored-By: Claude Opus 5.5 --- src/models/calendars.ts | 7 ++++++- src/models/notetakers.ts | 4 +++- tests/resources/calendars.spec.ts | 10 ++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/models/calendars.ts b/src/models/calendars.ts index 8b17d856..c22a98bb 100644 --- a/src/models/calendars.ts +++ b/src/models/calendars.ts @@ -56,6 +56,10 @@ export interface CalendarNotetakerRules { * Use one of `notetakerSettings`, `configId`, `autocreate`, or the deprecated * `name` and `meetingSettings`. Combining them returns a validation error. * `rules` can be combined with `notetakerSettings` or the deprecated fields. + * + * Build update requests from the fields you want to set. A fetched calendar's + * `notetaker` object can carry resolved values, such as stored image metadata, + * that the API rejects on writes. */ export interface CalendarNotetaker { /** @@ -90,7 +94,8 @@ export interface CalendarNotetaker { * Whether Notetakers created from this calendar take part in deduplication. * "inherit": Use the policy from your configurations. * "disable": Opt this calendar out of deduplication. - * Only valid with `notetakerSettings`. + * Only valid with `notetakerSettings`. Updates that omit it reset it to + * "inherit", so send it again to keep an opt-out. */ deduplicationPolicy?: 'inherit' | 'disable'; /** diff --git a/src/models/notetakers.ts b/src/models/notetakers.ts index e1303090..0b91afda 100644 --- a/src/models/notetakers.ts +++ b/src/models/notetakers.ts @@ -241,7 +241,9 @@ export interface NotetakerConfigSettings { export type NotetakerSyncSettings = Omit< NotetakerConfigSettings, 'videoOutput' ->; +> & { + videoOutput?: never; +}; /** * Notetaker settings as returned in Notetaker responses. diff --git a/tests/resources/calendars.spec.ts b/tests/resources/calendars.spec.ts index 6aa859b3..21cdba5c 100644 --- a/tests/resources/calendars.spec.ts +++ b/tests/resources/calendars.spec.ts @@ -8,6 +8,7 @@ import { CalendarNotetaker, UpdateCalenderRequest, } from '../../src/models/calendars'; +import { NotetakerConfigSettings } from '../../src/models/notetakers'; import { objKeysToCamelCase, objKeysToSnakeCase } from '../../src/utils'; jest.mock('../../src/apiClient'); @@ -335,6 +336,15 @@ describe('Calendars', () => { }, }; expect(notetaker).toBeDefined(); + + const shared: NotetakerConfigSettings = { + videoOutput: { mediaType: 'image/png', data: 'aGVsbG8=' }, + }; + const fromShared: CalendarNotetaker = { + // @ts-expect-error Reused settings with videoOutput are rejected too. + notetakerSettings: shared, + }; + expect(fromShared).toBeDefined(); }); it('should camelCase notetakerSettings in calendar responses', () => { From 219a2dea9a2da0539ffc458c0d04edd258f5ebfa Mon Sep 17 00:00:00 2001 From: Albert T Date: Tue, 24 Nov 2026 02:33:28 -0500 Subject: [PATCH 09/13] Give calendar and event Notetaker responses their own types A fetched calendar or event notetaker object can carry stored image metadata or a resolved active/inactive deduplication policy, which the API rejects on writes. With one shared type, copying a fetched object into an update compiled and then failed with a 400. Calendar.notetaker and Event.notetaker now use CalendarNotetakerResponse and EventNotetakerResponse, so that copy fails to compile and callers build the request from the fields they set. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 1 + cjs-wrapper.d.ts | 3 +++ src/models/calendars.ts | 28 +++++++++++++++++++++++++++- src/models/events.ts | 28 +++++++++++++++++++++++++++- src/models/notetakers.ts | 8 ++++++++ tests/resources/calendars.spec.ts | 29 ++++++++++++++++++++++++++++- tests/resources/events.spec.ts | 18 ++++++++++++++++-- 7 files changed, 110 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d793c22..ac6f1732 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ Planned version: **8.6.0**. - Mark the Notetaker request `name` and `meetingSettings` fields as deprecated in favor of `notetakerSettings`. - **Breaking TypeScript change:** make `Notetaker.name` and `Notetaker.meetingSettings` optional. The API omits them for Notetakers that use Notetaker settings: Notetakers created with `notetakerSettings` or `configId`, and Notetakers that inherit a Notetaker configuration, such as a workspace or application configuration. Code that reads them under `strict` now needs a check or a fallback, such as `notetaker.notetakerSettings?.name ?? notetaker.name ?? 'Nylas Notetaker'`. Read settings from `notetakerSettings` instead of `meetingSettings`. - **Breaking TypeScript change:** calendar Notetaker `rules.eventSelection` items can now be nested groups, so code that treats the array as `string[]` needs to handle `string[]` items too. +- **Breaking TypeScript change:** `Calendar.notetaker` and `Event.notetaker` are now typed as `CalendarNotetakerResponse` and `EventNotetakerResponse`. A fetched `notetaker` object can carry values the API rejects on writes, such as stored image metadata or a resolved `active` deduplication policy, so passing it straight into a create or update request no longer compiles. Build the request from the fields you want to set. ### Fixed - Type calendar Notetaker `rules.eventSelection` values as the API expects them (`own_events`, `participant_only`). The SDK sent `ownEvents` and `participantOnly` unchanged, and the API rejected them. diff --git a/cjs-wrapper.d.ts b/cjs-wrapper.d.ts index 2d404f22..dbe9242b 100644 --- a/cjs-wrapper.d.ts +++ b/cjs-wrapper.d.ts @@ -49,6 +49,7 @@ declare namespace Nylas { export import CalendarNotetaker = models.CalendarNotetaker; export import CalendarNotetakerEventSelection = models.CalendarNotetakerEventSelection; export import CalendarNotetakerParticipantFilter = models.CalendarNotetakerParticipantFilter; + export import CalendarNotetakerResponse = models.CalendarNotetakerResponse; export import CalendarNotetakerRules = models.CalendarNotetakerRules; export import CleanMessagesRequest = models.CleanMessagesRequest; export import CleanMessagesResponse = models.CleanMessagesResponse; @@ -121,6 +122,7 @@ declare namespace Nylas { export import EmailTemplate = models.EmailTemplate; export import Event = models.Event; export import EventBooking = models.EventBooking; + export import EventNotetakerResponse = models.EventNotetakerResponse; export import EventResource = models.EventResource; export import EventType = models.EventType; export import FindAttachmentQueryParams = models.FindAttachmentQueryParams; @@ -185,6 +187,7 @@ declare namespace Nylas { export import NotetakerConfigSettings = models.NotetakerConfigSettings; export import NotetakerConfigSettingsResponse = models.NotetakerConfigSettingsResponse; export import NotetakerCustomInstructionsSettings = models.NotetakerCustomInstructionsSettings; + export import NotetakerDeduplicationPolicy = models.NotetakerDeduplicationPolicy; export import NotetakerLeaveResponse = models.NotetakerLeaveResponse; export import NotetakerMedia = models.NotetakerMedia; export import NotetakerMeetingProvider = models.NotetakerMeetingProvider; diff --git a/src/models/calendars.ts b/src/models/calendars.ts index c22a98bb..23ffee51 100644 --- a/src/models/calendars.ts +++ b/src/models/calendars.ts @@ -1,5 +1,7 @@ import { ListQueryParams } from './listQueryParams.js'; import { + NotetakerConfigSettingsResponse, + NotetakerDeduplicationPolicy, NotetakerSyncSettings, NotetakerMeetingSettings, } from './notetakers.js'; @@ -104,6 +106,30 @@ export interface CalendarNotetaker { rules?: CalendarNotetakerRules; } +/** + * Calendar Notetaker settings as returned in Calendar responses. + * Responses can carry resolved values the API rejects on writes, so this type + * can't be passed straight into a create or update request. Build the request + * from the fields you want to set. + */ +export interface CalendarNotetakerResponse extends Omit< + CalendarNotetaker, + 'notetakerSettings' | 'autocreate' | 'deduplicationPolicy' +> { + /** + * Settings for the Notetakers that join this calendar's events. + */ + notetakerSettings?: NotetakerConfigSettingsResponse; + /** + * Whether Nylas creates Notetakers for matching events using inherited settings. + */ + autocreate?: boolean; + /** + * Whether Notetakers created from this calendar take part in deduplication. + */ + deduplicationPolicy?: NotetakerDeduplicationPolicy; +} + /** * Interface of the query parameters for listing calendars. */ @@ -233,5 +259,5 @@ export interface Calendar { /** * Notetaker meeting bot settings */ - notetaker?: CalendarNotetaker; + notetaker?: CalendarNotetakerResponse; } diff --git a/src/models/events.ts b/src/models/events.ts index 5acf0910..ea2855fc 100644 --- a/src/models/events.ts +++ b/src/models/events.ts @@ -3,6 +3,8 @@ import { NylasApiErrorResponseData } from './error.js'; import { ListQueryParams } from './listQueryParams.js'; import { NylasBaseResponse } from './response.js'; import { + NotetakerConfigSettingsResponse, + NotetakerDeduplicationPolicy, NotetakerSyncSettings, NotetakerMeetingSettings, } from './notetakers.js'; @@ -35,6 +37,30 @@ export interface NotetakerSettings { deduplicationPolicy?: 'inherit' | 'disable'; } +/** + * Event Notetaker settings as returned in Event responses. + * Responses can carry resolved values the API rejects on writes, so this type + * can't be passed straight into a create or update request. Build the request + * from the fields you want to set. + */ +export interface EventNotetakerResponse extends Omit< + NotetakerSettings, + 'notetakerSettings' | 'deduplicationPolicy' +> { + /** + * The Notetaker bot ID. + */ + id?: string; + /** + * Settings for the Notetaker that joins this event. + */ + notetakerSettings?: NotetakerConfigSettingsResponse; + /** + * Whether this event's Notetaker takes part in deduplication. + */ + deduplicationPolicy?: NotetakerDeduplicationPolicy; +} + /** * A bookable resource associated with an event, such as a room or equipment. */ @@ -194,7 +220,7 @@ export interface Event { /** * Notetaker meeting bot settings */ - notetaker?: NotetakerSettings; + notetaker?: EventNotetakerResponse; } /** diff --git a/src/models/notetakers.ts b/src/models/notetakers.ts index 0b91afda..c5728dea 100644 --- a/src/models/notetakers.ts +++ b/src/models/notetakers.ts @@ -234,6 +234,14 @@ export interface NotetakerConfigSettings { retentionTime?: number; } +/** + * A deduplication policy as returned in calendar and event responses. + * Requests accept only "inherit" and "disable"; responses can also carry the + * resolved "active" or "inactive" policy. + */ +export type NotetakerDeduplicationPolicy = + 'inherit' | 'disable' | 'active' | 'inactive'; + /** * Notetaker settings for calendar and event sync. * Calendar and event sync do not support `videoOutput`. diff --git a/tests/resources/calendars.spec.ts b/tests/resources/calendars.spec.ts index 21cdba5c..67730bc1 100644 --- a/tests/resources/calendars.spec.ts +++ b/tests/resources/calendars.spec.ts @@ -6,6 +6,7 @@ import { } from '../../src/models/availability'; import { CalendarNotetaker, + CalendarNotetakerResponse, UpdateCalenderRequest, } from '../../src/models/calendars'; import { NotetakerConfigSettings } from '../../src/models/notetakers'; @@ -352,13 +353,39 @@ describe('Calendars', () => { notetaker_settings: { name: 'Calendar Notetaker', recording_type: 'audio_video', + video_output: { media_type: 'image/png', size: 1024 }, }, + deduplication_policy: 'active', rules: { event_selection: ['participant_only'] }, - }) as CalendarNotetaker; + }) as CalendarNotetakerResponse; expect(notetaker.notetakerSettings?.recordingType).toBe('audio_video'); + expect(notetaker.notetakerSettings?.videoOutput?.size).toBe(1024); + expect(notetaker.deduplicationPolicy).toBe('active'); expect(notetaker.rules?.eventSelection).toEqual(['participant_only']); }); + + it('should not accept a fetched calendar notetaker as an update', () => { + const fetched: CalendarNotetakerResponse = { + notetakerSettings: { name: 'Calendar Notetaker', summary: true }, + deduplicationPolicy: 'active', + rules: { eventSelection: ['all'] }, + }; + const copied: UpdateCalenderRequest = { + // @ts-expect-error Fetched settings can carry values the API rejects on writes. + notetaker: fetched, + }; + const { videoOutput, ...settings } = fetched.notetakerSettings ?? {}; + const rebuilt: UpdateCalenderRequest = { + notetaker: { + notetakerSettings: settings, + rules: fetched.rules, + }, + }; + expect(copied).toBeDefined(); + expect(videoOutput).toBeUndefined(); + expect(rebuilt.notetaker?.notetakerSettings?.summary).toBe(true); + }); }); describe('destroy', () => { diff --git a/tests/resources/events.spec.ts b/tests/resources/events.spec.ts index 59bffb0e..ed75e3ed 100644 --- a/tests/resources/events.spec.ts +++ b/tests/resources/events.spec.ts @@ -1,6 +1,10 @@ import APIClient from '../../src/apiClient'; import { Events } from '../../src/resources/events'; -import { CreateEventRequest, NotetakerSettings } from '../../src/models/events'; +import { + CreateEventRequest, + EventNotetakerResponse, + UpdateEventRequest, +} from '../../src/models/events'; import { objKeysToCamelCase, objKeysToSnakeCase } from '../../src/utils'; jest.mock('../../src/apiClient'); @@ -433,13 +437,23 @@ describe('Events', () => { it('should camelCase notetakerSettings in event responses', () => { const notetaker = objKeysToCamelCase({ + id: 'notetaker-123', notetaker_settings: { name: 'Finance Meeting Notetaker', summary: true, }, - }) as NotetakerSettings; + deduplication_policy: 'inactive', + }) as EventNotetakerResponse; + expect(notetaker.id).toBe('notetaker-123'); expect(notetaker.notetakerSettings?.summary).toBe(true); + expect(notetaker.deduplicationPolicy).toBe('inactive'); + + const copied: UpdateEventRequest = { + // @ts-expect-error Fetched settings can carry values the API rejects on writes. + notetaker, + }; + expect(copied).toBeDefined(); }); }); From f58f9f40f7c4f4f52f2b92ac07102476c277fa22 Mon Sep 17 00:00:00 2001 From: Albert T Date: Tue, 24 Nov 2026 02:43:04 -0500 Subject: [PATCH 10/13] Mark Notetaker response settings as resolved and fall back to legacy fields - Say calendar and event response notetakerSettings and deduplicationPolicy include inherited values. - Drop configId and autocreate from CalendarNotetakerResponse; the API never returns them. - Tell callers to read notetakerSettings when present and fall back to name and meetingSettings. - Build the calendar update test from explicit fields instead of a fetched response. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 186 +++++++++++++++++++++++++++++- src/models/calendars.ts | 20 ++-- src/models/events.ts | 13 ++- src/models/notetakers.ts | 14 +-- tests/resources/calendars.spec.ts | 11 +- 5 files changed, 213 insertions(+), 31 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ac6f1732..4120d945 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,17 +10,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 Planned version: **8.6.0**. ### Added + - Type `notetakerSettings` on Notetaker create and update requests, `configId` on Notetaker create requests, and `notetakerSettings` on Notetaker responses, matching the current Notetaker API. - Type the summary, action item, transcription, silence and message fields on `NotetakerMeetingSettings`. - Type `notetakerSettings`, `configId`, `autocreate` and `deduplicationPolicy` on calendar Notetaker settings, `notetakerSettings` and `deduplicationPolicy` on event Notetaker settings, and nested AND groups in calendar `rules.eventSelection`. ### Changed + - Mark the Notetaker request `name` and `meetingSettings` fields as deprecated in favor of `notetakerSettings`. -- **Breaking TypeScript change:** make `Notetaker.name` and `Notetaker.meetingSettings` optional. The API omits them for Notetakers that use Notetaker settings: Notetakers created with `notetakerSettings` or `configId`, and Notetakers that inherit a Notetaker configuration, such as a workspace or application configuration. Code that reads them under `strict` now needs a check or a fallback, such as `notetaker.notetakerSettings?.name ?? notetaker.name ?? 'Nylas Notetaker'`. Read settings from `notetakerSettings` instead of `meetingSettings`. +- **Breaking TypeScript change:** make `Notetaker.name` and `Notetaker.meetingSettings` optional. The API omits them when it returns `notetakerSettings`, as it does for most Notetakers created with `notetakerSettings` or `configId` and for Notetakers that inherit a workspace or application configuration. Code that reads them under `strict` now needs a check or a fallback. Read `notetakerSettings` when present and fall back to the old fields, such as `notetaker.notetakerSettings?.name ?? notetaker.name ?? 'Nylas Notetaker'`. - **Breaking TypeScript change:** calendar Notetaker `rules.eventSelection` items can now be nested groups, so code that treats the array as `string[]` needs to handle `string[]` items too. -- **Breaking TypeScript change:** `Calendar.notetaker` and `Event.notetaker` are now typed as `CalendarNotetakerResponse` and `EventNotetakerResponse`. A fetched `notetaker` object can carry values the API rejects on writes, such as stored image metadata or a resolved `active` deduplication policy, so passing it straight into a create or update request no longer compiles. Build the request from the fields you want to set. +- **Breaking TypeScript change:** `Calendar.notetaker` and `Event.notetaker` are now typed as `CalendarNotetakerResponse` and `EventNotetakerResponse`. A fetched `notetaker` object carries resolved values, including inherited settings, and can carry values the API rejects on writes, such as stored image metadata or an `active` deduplication policy. Passing it straight into a create or update request no longer compiles. Build the request from the fields you want to set. ### Fixed + - Type calendar Notetaker `rules.eventSelection` values as the API expects them (`own_events`, `participant_only`). The SDK sent `ownEvents` and `participantOnly` unchanged, and the API rejected them. - Preserve upload-session HTTP header map keys while decoding API responses (NYL-476). - Patch vulnerable SDK tooling and example HTTP dependencies while preserving TypeDoc compatibility (NYL-471). @@ -39,16 +42,19 @@ Planned version: **8.6.0**. ## [8.5.0] - 2026-11-04 ### Added + - Added Events batch endpoint (Google and Microsoft), with typed operations and per-operation results returned for HTTP 207 responses (TT-5544) ([#770](https://github.com/nylas/nylas-nodejs/pull/770)). - Add `EventResource` and optional `resources` fields to event response, create, and update models for room/resource booking (CUST-5373) ([#766](https://github.com/nylas/nylas-nodejs/pull/766)). - Add optional `trackingOptions.domainName` support for custom link and open tracking hostnames ([#758](https://github.com/nylas/nylas-nodejs/pull/758)). - Add Contact metadata request/response types and `metadataPair` filtering, with contact webhook compatibility documentation (NYL-22) ([#759](https://github.com/nylas/nylas-nodejs/pull/759)). ### Changed + - Clarify that event `default` visibility is Google-only (TDT-2791) ([#754](https://github.com/nylas/nylas-nodejs/pull/754)). - Refresh SDK and example dependencies ([#768](https://github.com/nylas/nylas-nodejs/pull/768)). ### Fixed + - Stop sending the API key as `client_secret` in OAuth token exchange request bodies ([#753](https://github.com/nylas/nylas-nodejs/pull/753)). - Preserve custom metadata keys in nested request and response objects, including batch events ([#770](https://github.com/nylas/nylas-nodejs/pull/770)). - Reject invalid Events batch grant identifiers before sending HTTP requests ([#770](https://github.com/nylas/nylas-nodejs/pull/770)). @@ -57,30 +63,36 @@ Planned version: **8.6.0**. ## [8.4.0] - 2026-06-24 ### Added + - Add `nylas.transactionalSend.send()` for domain-based transactional email send (`POST /v3/domains/{domainName}/messages/send`) ([#747](https://github.com/nylas/nylas-nodejs/pull/747)) - Add optional `calendarId` and `eventId` fields to the `Notetaker` model ([#748](https://github.com/nylas/nylas-nodejs/pull/748)) ### Fixed + - Add `message.created.truncated` and `message.updated.truncated` to `WebhookTriggers` ([#748](https://github.com/nylas/nylas-nodejs/pull/748)) - Add missing webhook trigger types (`message.deleted`, `message.created.cleaned`, `grant.imap_sync_completed`, Notetaker triggers, Agent Account and transactional deliverability triggers, and legacy tracking triggers) ([#750](https://github.com/nylas/nylas-nodejs/pull/750)) ### Changed + - Bump dependencies to reasonable latest versions ([#749](https://github.com/nylas/nylas-nodejs/pull/749)) ## [8.3.0] - 2026-06-17 ### Added + - Add `htmlAsMarkdown` to `CleanMessagesRequest` for the message clean API ## [8.2.0] - 2026-06-17 ### Added + - Add Workspaces API support via `nylas.workspaces` — list, find, create, update (PATCH), destroy, plus `autoGroup()` and `manualAssign()` for grouping grants by domain, `invalidAlso`, `default`, `policyId`, and `ruleIds` ([#736](https://github.com/nylas/nylas-nodejs/pull/736)) - Add Agent Account Lists API support via `nylas.lists` — create lists with `name`, optional `description`, and immutable `type`, plus list, find, update, destroy, `listItems()`, `addItems()`, and `removeItems()` for managing `/v3/lists` ([#736](https://github.com/nylas/nylas-nodejs/pull/736)) - Add Manage Domains API support via `nylas.domains` — list, find, create, update, destroy, plus `info()` and `verify()` for domain verification (`/v3/admin/domains`). Includes `ServiceAccountSigner` support for Nylas Service Account request signing, bearer-auth suppression, and canonical signed wire bodies ([#736](https://github.com/nylas/nylas-nodejs/pull/736)) - Add `icalUid` to `ListEventQueryParams` ([#738](https://github.com/nylas/nylas-nodejs/pull/738)) ### Fixed + - Correct `Policies` `PolicyLimits` to expose `limitCountDailyMessageReceived` and `limitCountDailyEmailSent` (replacing a non-existent per-grant field) ([#736](https://github.com/nylas/nylas-nodejs/pull/736)) - Correct `Rules` `RuleEvaluation.messageId` to be omitted-when-absent (not nullable) and surface `blockedByEvaluationError` on applied actions ([#736](https://github.com/nylas/nylas-nodejs/pull/736)) - Correct `Rules` list (`GET /v3/rules`) to normalize its nested `{ data: { items, nextCursor } }` envelope back to the flat `{ data, nextCursor }` shape the list machinery expects ([#736](https://github.com/nylas/nylas-nodejs/pull/736)) @@ -93,57 +105,69 @@ Planned version: **8.6.0**. ## [8.1.2] - 2026-05-19 ### Added + - Add `attachments.downloadNodeStream()` as a Node.js convenience helper for converting attachment downloads to `NodeJS.ReadableStream` ([#731](https://github.com/nylas/nylas-nodejs/pull/731)) - Support `fields=include_headers` and `fields=include_basic_headers` query param on `messages.send()` ([#732](https://github.com/nylas/nylas-nodejs/pull/732)) ### Fixed + - Update `attachments.download()` documentation to describe its Web `ReadableStream` return type ([#731](https://github.com/nylas/nylas-nodejs/pull/731)) ## [8.1.1] - 2026-05-08 ### Fixed + - Preserve metadata key casing in multipart form-data requests ([#729](https://github.com/nylas/nylas-nodejs/pull/729)) ### Changed + - Refresh README — fix dashboard URL, drop v3-beta paths, cross-link to developer.nylas.com ([#728](https://github.com/nylas/nylas-nodejs/pull/728)) ## [8.1.0] - 2026-05-05 ### Added + - Add Agent Accounts SDK support ([#724](https://github.com/nylas/nylas-nodejs/pull/724)) - Add support for large attachments ([#725](https://github.com/nylas/nylas-nodejs/pull/725)) ## [8.0.5] - 2026-03-23 ### Added + - Add scheduling availability API: `scheduler.availability.get()` for `/v3/scheduling/availability` ([#720](https://github.com/nylas/nylas-nodejs/pull/720)) ## [8.0.4] - 2026-03-18 ### Added + - Add `specificTimeAvailability` support to calendars availability POST API ([#716](https://github.com/nylas/nylas-nodejs/pull/716)) ## [8.0.3] - 2026-03-17 ### Added + - Add multi-credential support for authentication ([#713](https://github.com/nylas/nylas-nodejs/pull/713)) ### Fixed + - Change credentials update method from PUT to PATCH ([#712](https://github.com/nylas/nylas-nodejs/pull/712)) ## [8.0.2] - 2026-02-18 ### Added + - Add `smtpRequired` option to hosted authentication URLs to enforce SMTP settings during IMAP authentication ([#702](https://github.com/nylas/nylas-nodejs/pull/702)) ## [8.0.1] - 2026-01-23 ### Added + - Add missing `originalStartTime` field to `Event` model for recurring event instances ## [8.0.0] - 2025-12-12 ### Added + - Migrated the SDK from `node-fetch` to the native Fetch API available in Node.js 18+. - Removed the custom fetch wrapper abstraction. - Updated Node.js engine requirements. @@ -151,44 +175,51 @@ Planned version: **8.6.0**. - Support for query parameters (`includeHiddenFolders`, `select`) in `folders.find` method ([#685](https://github.com/nylas/nylas-nodejs/issues/685)). ### Breaking change + - Requires Node.js 18+. Support for Node 16 has been dropped. ## [7.13.3] - 2025-10-10 ### Fixed + - Make `conferencing` property optional in `Event` model to handle events without conferencing details ([#678](https://github.com/nylas/nylas-nodejs/issues/678)) ## [7.13.2] - 2025-10-01 ### Fixed + - Make `Participant.email` optional in `Event` model to match API behavior ([#670](https://github.com/nylas/nylas-nodejs/issues/670)) - Updated `ListGrantsQueryParams.sortBy` values to match API expectations (`'created_at' | 'updated_at'` instead of `'createdAt' | 'updatedAt'`) ## [7.13.1] - 2025-09-18 ### Fixed + - Broken CJS build outputs resulted in a "TypeError: Nylas is not a constructor" error ## [7.13.0] - 2025-09-01 ### Added + - Support `isPlaintext` boolean for messages send and drafts create requests - Expose raw response headers on all responses via non-enumerable `rawHeaders` while keeping existing `headers` camelCased ## [7.12.0] - 2025-08-01 ### Changed + - Upgraded node-fetch from v2 to v3 for better ESM support and compatibility with edge environments ### Fixed + - Fixed test expectations for file attachment sizes and content types to match actual implementation behavior - Updated Jest configuration to properly handle ESM modules from node-fetch v3 - Removed incompatible AbortSignal import from node-fetch externals (now uses native Node.js AbortSignal) - ## [7.11.0] - 2025-06-23 ### Added + - Support for new message `fields` query parameter values: `include_tracking_options` and `raw_mime` - Support for `trackingOptions` property in Message responses when using `fields=include_tracking_options` - Support for `rawMime` property in Message responses when using `fields=raw_mime` @@ -197,15 +228,18 @@ Planned version: **8.6.0**. - Support for `singleLevel` query parameter in `ListFolderQueryParams` for Microsoft accounts to control folder hierarchy traversal ### Fixed + - Fixed 3MB payload size limit to consider total request size (message body + attachments) instead of just attachment size when determining whether to use multipart/form-data encoding ## [7.10.0] - 2025-05-27 ### Added + - Support for 'zoom' as a provider type in Auth module - Support for `tentativeAsBusy` parameter in FreeBusy requests to control how tentative events are treated ### Fixed + - Event status type to use 'maybe' instead of 'tentative' in Event interface to match API documentation - Missing `/cancel` suffix in Notetaker API endpoint - URL encoding for API path components to properly handle special characters @@ -213,36 +247,44 @@ Planned version: **8.6.0**. ## [7.9.0] - 2025-04-30 ### Added + - Support for Notetaker API endpoints - Notetaker settings to calendar and event models - Support for `tentativeAsBusy` parameter in availability and event listing ### Deprecated + - Providing timeout in milliseconds via request overrides - please use seconds instead ## [7.8.0] - 2025-03-03 ### Added + - Support for `listImportEvents` method to import events from a specified calendar within a given time frame - Support for returning all response headers in node sdk for error responses ### Fixed + - Grants support for queryParams in list method first parameter ## [7.7.4] - 2025-01-23 ### Fixed + - `any_email` was not transformed to a comma delimited list for messages.list ## [7.7.3] - 2025-01-23 ### Changed + - `latestMessageReceivedDate` & `latestMessageSentDate` to be optional on threads model ### Removed + - `createdAt` field from message model ### Fixed + - Issue where timeout was not being respected when overriding the timeout in the request options - Issue where query params with array values were not being transformed into comma-delimited strings - Transform anyEmail array into comma-delimited any_email parameter in threads list @@ -250,145 +292,177 @@ Planned version: **8.6.0**. ## [7.7.2] - 2024-12-02 ### Fixed + - `credentials` resource to use correct endpoint ## [7.7.1] - 2024-11-25 ### Fixed + - Query parameters for array values ## [7.7.0] - 2024-11-14 ### Added + - Support for Scheduling API ### Fixed + - Issue where inline attachments > 3Mb were not sent correctly ## [7.6.2] - 2024-10-31 ### Added + - Missing `select` field on query params - Missing `name` field on grant model - Missing `masterEventId` on Event model ### Fixed + - Webhook rotate secret calling the wrong endpoint ## [7.6.1] - 2024-10-30 ### Added + - Support for filtering events by masterEventID - Support for gzip compression ## [7.6.0] - 2024-10-18 ### Added + - Support for filtering events by attendee email - Buffer support for file attachments - New webhook trigger types - EWS as a provider ### Changed + - Rotate secret endpoint from being a PUT to a POST call ### Fixed + - Issue where crypto import was causing downstream Jest incompatibilities - FormData import compatibility issues with ESM ### Removed + - eslint-plugin-import from production dependencies ## [7.5.2] - 2024-07-12 ### Fixed + - Issue where metadata was being incorrectly modified before being sent to the API ## [7.5.1] - 2024-07-09 ### Added + - Collective availability method ### Fixed + - Crash when timeout encountered ### Security + - Bump `braces` sub-dependency from 3.0.2 to 3.0.3 ## [7.5.0] - 2024-05-17 ### Added + - Support for filtering by event type when listing events - Support for filtering a list of folders ### Fixed + - Query parameters not being formatted properly ## [7.4.0] - 2024-05-01 ### Added + - Support for `provider` field in code exchange response - Clean messages support ### Fixed + - Issue where attachments < 3mb were not being encoded correctly ## [7.3.0] - 2024-04-15 ### Added + - Response type to `sendRsvp` - Support for adding custom headers to outgoing requests - Support for custom headers field for drafts and messages - Support for setting `include_grant_scopes` for auth url generation ### Changed + - Incorrect `type` field in `When` models to `object` ### Fixed + - Inaccuracy in `ReminderOverride` model ## [7.2.1] - 2024-03-05 ### Added + - Default timeout to match API (90 seconds) ### Changed + - Improved message sending and draft create/update performance ### Fixed + - Serialization/deserialization of keys with numbers in them ## [7.2.0] - 2024-02-27 ### Added + - Support for `roundTo` field in availability response model - Support for `attributes` field in folder model - Support for icloud as an auth provider ### Fixed + - Query params not showing up in method parameters for finding a message - Missing fields in message models ### Removed + - Unnecessary `clientId` from detectProvider params ## [7.1.0] - 2024-02-12 ### Added + - Support for `/v3/connect/tokeninfo` endpoint - Models can now directly be imported from the top-level `nylas` package ### Fixed + - Inaccuracies in event and webhook models ## [7.0.0] - 2024-02-05 ### Added + - Support for both ES6 and CommonJS module systems - Models for all API resources and endpoints, for all HTTP methods to reduce confusion on which fields are available for each endpoint - Error classes for the different API errors as well as SDK-specific errors ### Changed + - **BREAKING**: Node SDK v7 supports the Nylas API v3 exclusively, dropping support for any endpoints that are not available in v3 - **BREAKING**: Convert `Nylas` class from a static to a non-static class - **BREAKING**: Officially support minimum Node 16 @@ -398,25 +472,30 @@ Planned version: **8.6.0**. - Removed the use of custom strings for serialization and deserialization, now automatically converting to camelCase and from the API's snake_case ### Removed + - **BREAKING**: Local Webhook development support is removed due to incompatibility ## [6.8.0] - 2023-02-03 ### Added + - Local webhook testing support - `hideParticipants` field to `Event` ## [6.7.0] - 2023-01-18 ### Added + - Support for rate limit errors - responseType to AuthenticateUrlConfig - New attributes for Event webhook notifications ### Changed + - Event `visibility` field to be writeable ### Security + - Bump `decode-uri-component` sub-dependency from 0.2.0 to 0.2.2 - Bump `qs` sub-dependency from 6.5.2 to 6.5.3 - Bump `json5` sub-dependency from 2.1.0 to 2.2.3 @@ -425,36 +504,44 @@ Planned version: **8.6.0**. ## [6.6.1] - 2022-10-21 ### Fixed + - Calendar color implementation ## [6.6.0] - 2022-10-14 ### Added + - Additional fields for job status webhook notifications - Support for calendar colors (for Microsoft calendars) - Support for event reminders ### Fixed + - Typo in `SchedulerBooking.calendarInviteToGuests` attribute ### Security + - Bump `minimist` sub-dependency from 1.2.5 to 1.2.6 ## [6.5.1] - 2022-09-16 ### Added + - Additional `Event` fields ### Fixed + - Issue with `EventParticipant` not sending status on new event creation ## [6.5.0] - 2022-07-29 ### Added + - `metadata` field to `JobStatus` - `interval_minutes` field in Scheduler booking config ### Fixed + - `Event.originalStartTime` type to be `Date` - `SchedulerBookingOpeningHours.accountId` deserialization - Json value for `confirmationEmailToHost` in `SchedulerBooking` @@ -462,99 +549,120 @@ Planned version: **8.6.0**. ## [6.4.2] - 2022-06-14 ### Added + - `Message.save()` functionality for updating existing messages - Missing `reminderMinutes` field in `Event` ## [6.4.1] - 2022-06-06 ### Fixed + - Issue where API response data was being lost - Incorrect tunnel index number in webhook example ## [6.4.0] - 2022-05-10 ### Added + - Support for collective and group events ### Fixed + - `fileIdsToAttach` field not being set when initializing a `Draft` ## [6.3.2] - 2022-05-04 ### Added + - Missing `fileIdsToAttach` field in `DraftProperties` ### Fixed + - JSON parse error when using `CalendarRestfulModelCollection.freeBusy` - Base URL not being set for `SchedulerRestfulModelCollection` functions ## [6.3.1] - 2022-04-22 ### Added + - Missing order and emails field in calendar availability ### Fixed + - Issue where passing in an array of one for `MessageRestfulModelCollection.findMultiple` throws an error ## [6.3.0] - 2022-04-14 ### Added + - Support for revoking a single access token - Improved Outbox job status support - Support Setting Redirect On Error in Authenticate URL Config ### Fixed + - Issue where an empty response body could trigger a JSON deserialization error ### Removed + - Usage of unreliable `node-fetch response.size` ## [6.2.2] - 2022-04-01 ### Added + - Allow getting raw message by message ID directly instead of needing to fetch the message first - New `authenticationType` field in `ManagementAccount` ### Fixed + - JSON error thrown when Nylas API returns non-JSON error payload ## [6.2.1] - 2022-03-25 ### Added + - Enable Nylas API v2.5 support ### Fixed + - Circular dependency issue in `Attribute` - `SchedulerBookingOpeningHoursProperties.days` and add missing fields to Scheduler models ### Security + - Bump `node-fetch` dependency from 2.6.1 to 2.6.7 - Bump `ajv` sub-dependency from 6.10.2 to 6.12.6 ## [6.2.0] - 2022-02-04 ### Added + - Support for returning multiple messages by a list of message IDs - New field in `Draft` for adding files by file IDs - Webhook Notification models - Improved `Delta` support: added `Delta` model and two new methods; `since` and `longpoll` ### Fixed + - Virtual Calendar logic and serialization ## [6.1.0] - 2022-01-28 ### Added + - Support for `Event` to ICS - `comment` and `phoneNumber` fields to `EventParticipant` - Support for `calendar` field in free-busy, availability, and consecutive availability queries ### Fixed + - Issue where properties of `Model` type were sending read-only attributes to the API ## [6.0.0] - 2022-01-12 ### Added + - Introduction of interfaces that accompany models to improve experience when instantiating API models and provides better insight on "required" fields - Several `Contact` fields that took an object as a value now take a corresponding `Contact` subclass type - New `FreeBusy` type for `CalendarRestfulModelCollection.freeBusy()` return value @@ -567,6 +675,7 @@ Planned version: **8.6.0**. - Introduction of `Enum` types ### Changed + - **BREAKING**: Refactored `RestfulModel` and `RestfulModelCollection`, introduced `Model` and `ModelCollection` superclass for models that do not directly interact with the Nylas API - **BREAKING**: Applied missing variable and return types, and applied stricter typing to improve deserialization and to adhere Typescript best practice - **BREAKING**: `Event.when` is now of `When` type @@ -583,6 +692,7 @@ Planned version: **8.6.0**. - **BREAKING**: `Nylas.application()` takes `ApplicationDetailProperties` type and returns an `ApplicationDetail` type ### Removed + - **BREAKING**: `RestfulModelCollection.build()` as it does not allow for proper property and type hinting in favor of instantiating via `new Model()` - **BREAKING**: `Connect.newAccount()` as it had no functionality - **BREAKING**: `File.metadata()` as it doesn't appear any different than making a `NylasConnection.files().find()` call @@ -590,17 +700,20 @@ Planned version: **8.6.0**. ## [5.10.3] - 2022-01-04 ### Fixed + - Prevent `Event` objects from sending an empty list of notifications when not set, causing errors for recurring events ## [5.10.3] - 2021-12-16 ### Added + - Missing `provider` option for `urlForAuthentication` - Job status improvements ## [5.10.2] - 2021-12-03 ### Fixed + - Scheduler and Component types - Component sending unmodifiable fields during update - Bug where updating an event resulted in an API error @@ -608,11 +721,13 @@ Planned version: **8.6.0**. ## [5.10.1] - 2021-11-22 ### Fixed + - Bug where booking a valid timeslot resulted in an API error ## [5.10.0] - 2021-11-18 ### Added + - Support for Event notifications - Support for remaining Scheduler endpoints - Metadata support for `Calendar`, `Message` and `ManagementAccount` @@ -620,15 +735,18 @@ Planned version: **8.6.0**. ## [5.9.0] - 2021-09-24 ### Added + - Component CRUD Support - Scheduler support ## [5.8.0] - 2021-09-16 ### Added + - Support for consecutive availability ### Fixed + - Issue where JSON.stringify would omit read-only values - Webhook example throwing error if body is not a raw body - Readonly calendar attributes being sent for POST and PUT calls @@ -636,59 +754,71 @@ Planned version: **8.6.0**. ## [5.7.0] - 2021-08-18 ### Added + - Missing fields for recurring events - Support for conferencing ### Fixed + - Minor issues with Neural API implementation - Not rejecting uncaught errors during requests ## [5.6.0] - 2021-07-14 ### Added + - Support for `/calendars/availability` endpoint - Support for the Neural API - Linting, enabled and set up eslint and prettier ### Fixed + - Jest test cases not respecting async methods - Issue with parsing raw MIME emails ## [5.5.1] - 2021-06-24 ### Fixed + - Tracking object not being added to a pre-existing `draft` object - `undefined` response when downloading file ### Removed + - `request` dependency and related import statements ## [5.5.0] - 2021-06-09 ### Added + - Custom error class `NylasApiError` to add more error details returned from the API - Support for read only fields - Enable Nylas API v2.2 support ### Changed + - Replaced deprecated `request` library with `node-fetch` ### Fixed + - Bug where saving a `draft` object with an undefined `filesIds` would throw an error - Typings for classes that extend `RestfulModelCollection` or `RestfulModelInstance` ## [5.4.0] - 2021-05-21 ### Added + - `metadata` field in the Event model to support new Event metadata feature - Support for filtering `metadata` using `metadata_key`, `metadata_value`, and `metadata_pair` ### Security + - Updated dependencies `lodash`, `y18n`, and `pug` to the latest stable version ## [5.3.3] - 2021-03-26 ### Changed + - Pass error message from the API to the SDK user - Migrate `delta` streaming to `node-fetch` - Migrate `exchangeCodeForToken` to `node-fetch` @@ -696,66 +826,81 @@ Planned version: **8.6.0**. ## [5.3.2] - 2021-01-11 ### Fixed + - Typing fixes to `nylas.drafts` and other `RestfulModelCollections` ## [5.3.1] - 2020-11-20 ### Added + - Update readme with syntax highlighting ### Changed + - Drop async dependency for smaller package fingerprint. Async is replaced with promises ### Removed + - Circular dependency in `nylas-connection.ts` ## [5.3.0] - 2020-09-23 ### Added + - `JobStatus` model and collection ### Changed + - Refactor parameter ordering in `find()` and `draft.send()` methods [backwards compatible] ### Fixed + - Bug where setting `event.start` and `event.end` did not set `event.when` if `event.when` didn't exist ## [5.2.0] - 2020-07-27 ### Added + - Implement support for GET /contacts/groups - Support GET /resources - Support POST, PUT and DELETE for calendars, and add location, timezone and isPrimary attributes - `object` attribute to `event.when` object ### Changed + - Update lodash import ## [5.1.0] - 2020-06-04 ### Added + - Support recurring events - Implement list & update application details endpoints - Support free-busy endpoint on Calendars collection ### Fixed + - Bug which was overwriting properties on message objects ## [5.0.0] - 2020-05-07 ### Changed + - **BREAKING**: Officially support minimum Node 16 ### Removed + - **BREAKING**: `appId` and `appSecret`. Please use `clientId` and `clientSecret` - **BREAKING**: `Thread.folder`. Please use `Thread.folders` ### Added + - Migrate to Typescript ## [4.10.1] - 2020-05-06 ### Fixed + - Update `exchangeCodeForToken` to reject when no `access_token` is returned - Unhandled error when response is undefined - Get contact picture request to correctly use callback, if provided @@ -763,143 +908,173 @@ Planned version: **8.6.0**. ## [4.10.0] - 2020-02-24 ### Added + - iCalUID attribute to Event model - Allow file streaming uploads ### Changed + - Update SUPPORTED_API_VERSION to 2.1 - Update Thread.folder to use Folder model, and rename to Thread.folders ## [4.9.0] - 2020-01-24 ### Added + - Update Thread participants to use EmailParticipant ### Changed + - Remove error handling in /connect models ### Security + - Bump handlebars version ## [4.8.0] - 2019-10-09 ### Added + - Support for `/connect/token` endpoint ### Fixed + - Events so that they support all time subojects ## [4.7.1] - 2019-09-18 ### Added + - Support for `/connect/authorize` endpoint - Improvements to example/webhooks ### Changed + - Update formatting for DeprecationWarnings - Update package-lock.json ### Fixed + - Draft deletion bug ## [4.7.0] - 2019-08-20 ### Added + - Support for `/token-info` endpoint - Webhooks CRUD functionality ### Changed + - Update app id and app secret to client id and client secret ## [4.6.2] - 2019-07-26 ### Added + - contentDisposition to File - emailAddress to ManagementAccount - provider to ManagementAccount - `groups` and `source` to contact attributes ### Changed + - Update dependancies ### Fixed + - Contact birthday type from date to string - `emailAddresses` attribute in Contact model ## [4.6.1] - 2019-07-10 ### Added + - billingState to Account model - Update webhooks example code ### Fixed + - Error to string reassignment bug ## [4.6.0] - 2019-06-20 ### Added + - Enable link tracking ## [4.5.0] - 2019-04-02 ### Added + - Support for `/ip_addresses` endpoint ## [4.4.0] - 2019-03-25 ### Added + - Support for `revoke-all` endpoint ## [4.3.0] - 2019-03-18 ### Added + - X-Nylas-Client-Id header for HTTP requests ## [4.2.3] - 2019-02-21 ### Changed + - Replace Underscore with lodash - Replace Bluebird promises with native promises - Upgrade all other dependencies and devDependencies to latest versions - Reduce package size by only including `lib` directory ### Removed + - Drop unnecessary dependencies: express-session, clone ## [4.2.2] - 2018-03-08 ### Added + - Status code to error to allow it to bubble up from API request errors - Improvements to example/sample-app - linkedAt to the account model ### Changed + - Move version mismatch warning to only print if both API and SDK versions are present. This will decrease unhelpful spamming - Parse response into JSON if it is a string ## [4.2.0] - 2018-02-07 ### Added + - Support for new contact fields and functionality ### Changed + - Bump supported Nylas API version to 2.0 ## [4.1.0] - 2017-12-27 ### Added + - Variable for supported version of Nylas API - set to `1.0` and will be updated when the SDK supports later versions of the API - Warnings when the version of the API that the SDK supports differs from the version of the API that the application is using ## [4.0.0] - 2017-11-06 ### Added + - ESLint and Prettier for linting - `search()` for messages and threads - `upgrade()` and `downgrade()` for account management - `getRaw()` for retrieving raw messages ### Changed + - **BREAKING**: Converted Coffeescript to ES6 - **BREAKING**: Updated test framework from Jasmine 1.0 to Jest - **BREAKING**: Changed Travis to run Node 8 and lint, build, and test code in CI @@ -914,6 +1089,7 @@ Planned version: **8.6.0**. - Return server errors for SMTP exceptions on send ### Removed + - **BREAKING**: `draft` attribute on `Message` and `Draft` objects, since the object type is already distinguished - **BREAKING**: Support for `Tag` objects, which has been deprecated, and instance methods on `Thread` for `Tag` changes - **BREAKING**: Support for `generateCursor()`, which has been deprecated @@ -922,10 +1098,12 @@ Planned version: **8.6.0**. ## [3.1.1] - 2017-10-06 ### Added + - Status to event model - Emit `DeltaStream` retry status as an event ### Fixed + - No longer throw an error after successful calls to `Message.sendRaw()` - Don't require secret for `urlForAuthentication()`, allowing client-side usage without leaking or faking the app secret - Catch rejected promises in some missing cases @@ -935,7 +1113,9 @@ Planned version: **8.6.0**. ## [3.0.0] - 2016-08-14 ### Added + - Support for `view=expanded` option. Now all methods on that hit the API can take querystring params as objects. Additionally, you can pass in `{expanded: true}` for convenience ### Changed + - **BREAKING**: `DeltaStream` now also supports `view=expanded`, `exclude_types`, and `include_types`, as well as any arbitrary query string param. `Delta::startStream` now takes an object as a second argument for query string params, instead of an `exclude_types` array diff --git a/src/models/calendars.ts b/src/models/calendars.ts index 23ffee51..9f19fb00 100644 --- a/src/models/calendars.ts +++ b/src/models/calendars.ts @@ -108,24 +108,24 @@ export interface CalendarNotetaker { /** * Calendar Notetaker settings as returned in Calendar responses. - * Responses can carry resolved values the API rejects on writes, so this type - * can't be passed straight into a create or update request. Build the request - * from the fields you want to set. + * `notetakerSettings` and `deduplicationPolicy` are resolved values: they + * include settings inherited from workspace and application configurations, + * not only what this calendar stores. Responses can carry values the API + * rejects on writes, so this type can't be passed straight into a create or + * update request. Build the request from the fields you want to set. + * Responses don't include `configId` or `autocreate`. */ export interface CalendarNotetakerResponse extends Omit< CalendarNotetaker, - 'notetakerSettings' | 'autocreate' | 'deduplicationPolicy' + 'notetakerSettings' | 'configId' | 'autocreate' | 'deduplicationPolicy' > { /** - * Settings for the Notetakers that join this calendar's events. + * Resolved settings for the Notetakers that join this calendar's events. */ notetakerSettings?: NotetakerConfigSettingsResponse; /** - * Whether Nylas creates Notetakers for matching events using inherited settings. - */ - autocreate?: boolean; - /** - * Whether Notetakers created from this calendar take part in deduplication. + * Resolved policy for whether Notetakers created from this calendar take + * part in deduplication. */ deduplicationPolicy?: NotetakerDeduplicationPolicy; } diff --git a/src/models/events.ts b/src/models/events.ts index ea2855fc..e043086b 100644 --- a/src/models/events.ts +++ b/src/models/events.ts @@ -39,9 +39,11 @@ export interface NotetakerSettings { /** * Event Notetaker settings as returned in Event responses. - * Responses can carry resolved values the API rejects on writes, so this type - * can't be passed straight into a create or update request. Build the request - * from the fields you want to set. + * `notetakerSettings` and `deduplicationPolicy` are resolved values: they + * include settings inherited from calendar, workspace and application + * configurations, not only what this event stores. Responses can carry values + * the API rejects on writes, so this type can't be passed straight into a + * create or update request. Build the request from the fields you want to set. */ export interface EventNotetakerResponse extends Omit< NotetakerSettings, @@ -52,11 +54,12 @@ export interface EventNotetakerResponse extends Omit< */ id?: string; /** - * Settings for the Notetaker that joins this event. + * Resolved settings for the Notetaker that joins this event. */ notetakerSettings?: NotetakerConfigSettingsResponse; /** - * Whether this event's Notetaker takes part in deduplication. + * Resolved policy for whether this event's Notetaker takes part in + * deduplication. */ deduplicationPolicy?: NotetakerDeduplicationPolicy; } diff --git a/src/models/notetakers.ts b/src/models/notetakers.ts index c5728dea..29a3bca0 100644 --- a/src/models/notetakers.ts +++ b/src/models/notetakers.ts @@ -329,10 +329,10 @@ export interface Notetaker { id: string; /** * The display name for the Notetaker bot. - * The API omits this field for Notetakers that use Notetaker settings: those - * created with `notetakerSettings` or `configId`, and those that inherit a - * Notetaker configuration, such as a workspace or application configuration. - * Read `notetakerSettings.name` for those. + * The API omits this field when it returns `notetakerSettings`, as it does + * for most Notetakers created with `notetakerSettings` or `configId` and for + * Notetakers that inherit a workspace or application configuration. Read + * `notetakerSettings.name` when present and fall back to this field. */ name?: string; /** @@ -361,13 +361,13 @@ export interface Notetaker { eventId?: string; /** * Notetaker Meeting Settings. - * The API omits this field for Notetakers that use Notetaker settings (see - * `name`). Read `notetakerSettings` for those. + * The API omits this field when it returns `notetakerSettings` (see `name`). + * Read `notetakerSettings` when present and fall back to this field. */ meetingSettings?: NotetakerMeetingSettings; /** * The Notetaker's settings. - * Returned for Notetakers that use Notetaker settings (see `name`). + * When present, use these instead of `name` and `meetingSettings`. */ notetakerSettings?: NotetakerConfigSettingsResponse; } diff --git a/tests/resources/calendars.spec.ts b/tests/resources/calendars.spec.ts index 67730bc1..d43c86d2 100644 --- a/tests/resources/calendars.spec.ts +++ b/tests/resources/calendars.spec.ts @@ -375,16 +375,15 @@ describe('Calendars', () => { // @ts-expect-error Fetched settings can carry values the API rejects on writes. notetaker: fetched, }; - const { videoOutput, ...settings } = fetched.notetakerSettings ?? {}; - const rebuilt: UpdateCalenderRequest = { + const update: UpdateCalenderRequest = { notetaker: { - notetakerSettings: settings, - rules: fetched.rules, + notetakerSettings: { name: 'Calendar Notetaker', summary: true }, + rules: { eventSelection: ['all'] }, + deduplicationPolicy: 'disable', }, }; expect(copied).toBeDefined(); - expect(videoOutput).toBeUndefined(); - expect(rebuilt.notetaker?.notetakerSettings?.summary).toBe(true); + expect(update.notetaker?.notetakerSettings?.summary).toBe(true); }); }); From 8f4320f3f949bd9c2459d6c9cc9d337c79ab27c6 Mon Sep 17 00:00:00 2001 From: Albert T Date: Tue, 24 Nov 2026 02:50:37 -0500 Subject: [PATCH 11/13] Keep configId and autocreate on calendar responses and describe the policy as the object's own - Calendar create and update responses return the settings that were sent, so configId and autocreate can appear there. - The deduplication policy in responses is the calendar's or event's own value, not the merged one; "inherit" means a parent configuration decides. - Restore CHANGELOG formatting outside the Unreleased section. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 184 +--------------------------------------- src/models/calendars.ts | 21 +++-- src/models/events.ts | 14 +-- 3 files changed, 22 insertions(+), 197 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4120d945..f63fae4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,20 +10,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 Planned version: **8.6.0**. ### Added - - Type `notetakerSettings` on Notetaker create and update requests, `configId` on Notetaker create requests, and `notetakerSettings` on Notetaker responses, matching the current Notetaker API. - Type the summary, action item, transcription, silence and message fields on `NotetakerMeetingSettings`. - Type `notetakerSettings`, `configId`, `autocreate` and `deduplicationPolicy` on calendar Notetaker settings, `notetakerSettings` and `deduplicationPolicy` on event Notetaker settings, and nested AND groups in calendar `rules.eventSelection`. ### Changed - - Mark the Notetaker request `name` and `meetingSettings` fields as deprecated in favor of `notetakerSettings`. - **Breaking TypeScript change:** make `Notetaker.name` and `Notetaker.meetingSettings` optional. The API omits them when it returns `notetakerSettings`, as it does for most Notetakers created with `notetakerSettings` or `configId` and for Notetakers that inherit a workspace or application configuration. Code that reads them under `strict` now needs a check or a fallback. Read `notetakerSettings` when present and fall back to the old fields, such as `notetaker.notetakerSettings?.name ?? notetaker.name ?? 'Nylas Notetaker'`. - **Breaking TypeScript change:** calendar Notetaker `rules.eventSelection` items can now be nested groups, so code that treats the array as `string[]` needs to handle `string[]` items too. -- **Breaking TypeScript change:** `Calendar.notetaker` and `Event.notetaker` are now typed as `CalendarNotetakerResponse` and `EventNotetakerResponse`. A fetched `notetaker` object carries resolved values, including inherited settings, and can carry values the API rejects on writes, such as stored image metadata or an `active` deduplication policy. Passing it straight into a create or update request no longer compiles. Build the request from the fields you want to set. +- **Breaking TypeScript change:** `Calendar.notetaker` and `Event.notetaker` are now typed as `CalendarNotetakerResponse` and `EventNotetakerResponse`. A fetched `notetaker` object carries resolved settings, including inherited ones, and can carry values the API rejects on writes, such as stored image metadata or an `active` deduplication policy. Passing it straight into a create or update request no longer compiles. Build the request from the fields you want to set. ### Fixed - - Type calendar Notetaker `rules.eventSelection` values as the API expects them (`own_events`, `participant_only`). The SDK sent `ownEvents` and `participantOnly` unchanged, and the API rejected them. - Preserve upload-session HTTP header map keys while decoding API responses (NYL-476). - Patch vulnerable SDK tooling and example HTTP dependencies while preserving TypeDoc compatibility (NYL-471). @@ -42,19 +39,16 @@ Planned version: **8.6.0**. ## [8.5.0] - 2026-11-04 ### Added - - Added Events batch endpoint (Google and Microsoft), with typed operations and per-operation results returned for HTTP 207 responses (TT-5544) ([#770](https://github.com/nylas/nylas-nodejs/pull/770)). - Add `EventResource` and optional `resources` fields to event response, create, and update models for room/resource booking (CUST-5373) ([#766](https://github.com/nylas/nylas-nodejs/pull/766)). - Add optional `trackingOptions.domainName` support for custom link and open tracking hostnames ([#758](https://github.com/nylas/nylas-nodejs/pull/758)). - Add Contact metadata request/response types and `metadataPair` filtering, with contact webhook compatibility documentation (NYL-22) ([#759](https://github.com/nylas/nylas-nodejs/pull/759)). ### Changed - - Clarify that event `default` visibility is Google-only (TDT-2791) ([#754](https://github.com/nylas/nylas-nodejs/pull/754)). - Refresh SDK and example dependencies ([#768](https://github.com/nylas/nylas-nodejs/pull/768)). ### Fixed - - Stop sending the API key as `client_secret` in OAuth token exchange request bodies ([#753](https://github.com/nylas/nylas-nodejs/pull/753)). - Preserve custom metadata keys in nested request and response objects, including batch events ([#770](https://github.com/nylas/nylas-nodejs/pull/770)). - Reject invalid Events batch grant identifiers before sending HTTP requests ([#770](https://github.com/nylas/nylas-nodejs/pull/770)). @@ -63,36 +57,30 @@ Planned version: **8.6.0**. ## [8.4.0] - 2026-06-24 ### Added - - Add `nylas.transactionalSend.send()` for domain-based transactional email send (`POST /v3/domains/{domainName}/messages/send`) ([#747](https://github.com/nylas/nylas-nodejs/pull/747)) - Add optional `calendarId` and `eventId` fields to the `Notetaker` model ([#748](https://github.com/nylas/nylas-nodejs/pull/748)) ### Fixed - - Add `message.created.truncated` and `message.updated.truncated` to `WebhookTriggers` ([#748](https://github.com/nylas/nylas-nodejs/pull/748)) - Add missing webhook trigger types (`message.deleted`, `message.created.cleaned`, `grant.imap_sync_completed`, Notetaker triggers, Agent Account and transactional deliverability triggers, and legacy tracking triggers) ([#750](https://github.com/nylas/nylas-nodejs/pull/750)) ### Changed - - Bump dependencies to reasonable latest versions ([#749](https://github.com/nylas/nylas-nodejs/pull/749)) ## [8.3.0] - 2026-06-17 ### Added - - Add `htmlAsMarkdown` to `CleanMessagesRequest` for the message clean API ## [8.2.0] - 2026-06-17 ### Added - - Add Workspaces API support via `nylas.workspaces` — list, find, create, update (PATCH), destroy, plus `autoGroup()` and `manualAssign()` for grouping grants by domain, `invalidAlso`, `default`, `policyId`, and `ruleIds` ([#736](https://github.com/nylas/nylas-nodejs/pull/736)) - Add Agent Account Lists API support via `nylas.lists` — create lists with `name`, optional `description`, and immutable `type`, plus list, find, update, destroy, `listItems()`, `addItems()`, and `removeItems()` for managing `/v3/lists` ([#736](https://github.com/nylas/nylas-nodejs/pull/736)) - Add Manage Domains API support via `nylas.domains` — list, find, create, update, destroy, plus `info()` and `verify()` for domain verification (`/v3/admin/domains`). Includes `ServiceAccountSigner` support for Nylas Service Account request signing, bearer-auth suppression, and canonical signed wire bodies ([#736](https://github.com/nylas/nylas-nodejs/pull/736)) - Add `icalUid` to `ListEventQueryParams` ([#738](https://github.com/nylas/nylas-nodejs/pull/738)) ### Fixed - - Correct `Policies` `PolicyLimits` to expose `limitCountDailyMessageReceived` and `limitCountDailyEmailSent` (replacing a non-existent per-grant field) ([#736](https://github.com/nylas/nylas-nodejs/pull/736)) - Correct `Rules` `RuleEvaluation.messageId` to be omitted-when-absent (not nullable) and surface `blockedByEvaluationError` on applied actions ([#736](https://github.com/nylas/nylas-nodejs/pull/736)) - Correct `Rules` list (`GET /v3/rules`) to normalize its nested `{ data: { items, nextCursor } }` envelope back to the flat `{ data, nextCursor }` shape the list machinery expects ([#736](https://github.com/nylas/nylas-nodejs/pull/736)) @@ -105,69 +93,57 @@ Planned version: **8.6.0**. ## [8.1.2] - 2026-05-19 ### Added - - Add `attachments.downloadNodeStream()` as a Node.js convenience helper for converting attachment downloads to `NodeJS.ReadableStream` ([#731](https://github.com/nylas/nylas-nodejs/pull/731)) - Support `fields=include_headers` and `fields=include_basic_headers` query param on `messages.send()` ([#732](https://github.com/nylas/nylas-nodejs/pull/732)) ### Fixed - - Update `attachments.download()` documentation to describe its Web `ReadableStream` return type ([#731](https://github.com/nylas/nylas-nodejs/pull/731)) ## [8.1.1] - 2026-05-08 ### Fixed - - Preserve metadata key casing in multipart form-data requests ([#729](https://github.com/nylas/nylas-nodejs/pull/729)) ### Changed - - Refresh README — fix dashboard URL, drop v3-beta paths, cross-link to developer.nylas.com ([#728](https://github.com/nylas/nylas-nodejs/pull/728)) ## [8.1.0] - 2026-05-05 ### Added - - Add Agent Accounts SDK support ([#724](https://github.com/nylas/nylas-nodejs/pull/724)) - Add support for large attachments ([#725](https://github.com/nylas/nylas-nodejs/pull/725)) ## [8.0.5] - 2026-03-23 ### Added - - Add scheduling availability API: `scheduler.availability.get()` for `/v3/scheduling/availability` ([#720](https://github.com/nylas/nylas-nodejs/pull/720)) ## [8.0.4] - 2026-03-18 ### Added - - Add `specificTimeAvailability` support to calendars availability POST API ([#716](https://github.com/nylas/nylas-nodejs/pull/716)) ## [8.0.3] - 2026-03-17 ### Added - - Add multi-credential support for authentication ([#713](https://github.com/nylas/nylas-nodejs/pull/713)) ### Fixed - - Change credentials update method from PUT to PATCH ([#712](https://github.com/nylas/nylas-nodejs/pull/712)) ## [8.0.2] - 2026-02-18 ### Added - - Add `smtpRequired` option to hosted authentication URLs to enforce SMTP settings during IMAP authentication ([#702](https://github.com/nylas/nylas-nodejs/pull/702)) ## [8.0.1] - 2026-01-23 ### Added - - Add missing `originalStartTime` field to `Event` model for recurring event instances ## [8.0.0] - 2025-12-12 ### Added - - Migrated the SDK from `node-fetch` to the native Fetch API available in Node.js 18+. - Removed the custom fetch wrapper abstraction. - Updated Node.js engine requirements. @@ -175,51 +151,44 @@ Planned version: **8.6.0**. - Support for query parameters (`includeHiddenFolders`, `select`) in `folders.find` method ([#685](https://github.com/nylas/nylas-nodejs/issues/685)). ### Breaking change - - Requires Node.js 18+. Support for Node 16 has been dropped. ## [7.13.3] - 2025-10-10 ### Fixed - - Make `conferencing` property optional in `Event` model to handle events without conferencing details ([#678](https://github.com/nylas/nylas-nodejs/issues/678)) ## [7.13.2] - 2025-10-01 ### Fixed - - Make `Participant.email` optional in `Event` model to match API behavior ([#670](https://github.com/nylas/nylas-nodejs/issues/670)) - Updated `ListGrantsQueryParams.sortBy` values to match API expectations (`'created_at' | 'updated_at'` instead of `'createdAt' | 'updatedAt'`) ## [7.13.1] - 2025-09-18 ### Fixed - - Broken CJS build outputs resulted in a "TypeError: Nylas is not a constructor" error ## [7.13.0] - 2025-09-01 ### Added - - Support `isPlaintext` boolean for messages send and drafts create requests - Expose raw response headers on all responses via non-enumerable `rawHeaders` while keeping existing `headers` camelCased ## [7.12.0] - 2025-08-01 ### Changed - - Upgraded node-fetch from v2 to v3 for better ESM support and compatibility with edge environments ### Fixed - - Fixed test expectations for file attachment sizes and content types to match actual implementation behavior - Updated Jest configuration to properly handle ESM modules from node-fetch v3 - Removed incompatible AbortSignal import from node-fetch externals (now uses native Node.js AbortSignal) + ## [7.11.0] - 2025-06-23 ### Added - - Support for new message `fields` query parameter values: `include_tracking_options` and `raw_mime` - Support for `trackingOptions` property in Message responses when using `fields=include_tracking_options` - Support for `rawMime` property in Message responses when using `fields=raw_mime` @@ -228,18 +197,15 @@ Planned version: **8.6.0**. - Support for `singleLevel` query parameter in `ListFolderQueryParams` for Microsoft accounts to control folder hierarchy traversal ### Fixed - - Fixed 3MB payload size limit to consider total request size (message body + attachments) instead of just attachment size when determining whether to use multipart/form-data encoding ## [7.10.0] - 2025-05-27 ### Added - - Support for 'zoom' as a provider type in Auth module - Support for `tentativeAsBusy` parameter in FreeBusy requests to control how tentative events are treated ### Fixed - - Event status type to use 'maybe' instead of 'tentative' in Event interface to match API documentation - Missing `/cancel` suffix in Notetaker API endpoint - URL encoding for API path components to properly handle special characters @@ -247,44 +213,36 @@ Planned version: **8.6.0**. ## [7.9.0] - 2025-04-30 ### Added - - Support for Notetaker API endpoints - Notetaker settings to calendar and event models - Support for `tentativeAsBusy` parameter in availability and event listing ### Deprecated - - Providing timeout in milliseconds via request overrides - please use seconds instead ## [7.8.0] - 2025-03-03 ### Added - - Support for `listImportEvents` method to import events from a specified calendar within a given time frame - Support for returning all response headers in node sdk for error responses ### Fixed - - Grants support for queryParams in list method first parameter ## [7.7.4] - 2025-01-23 ### Fixed - - `any_email` was not transformed to a comma delimited list for messages.list ## [7.7.3] - 2025-01-23 ### Changed - - `latestMessageReceivedDate` & `latestMessageSentDate` to be optional on threads model ### Removed - - `createdAt` field from message model ### Fixed - - Issue where timeout was not being respected when overriding the timeout in the request options - Issue where query params with array values were not being transformed into comma-delimited strings - Transform anyEmail array into comma-delimited any_email parameter in threads list @@ -292,177 +250,145 @@ Planned version: **8.6.0**. ## [7.7.2] - 2024-12-02 ### Fixed - - `credentials` resource to use correct endpoint ## [7.7.1] - 2024-11-25 ### Fixed - - Query parameters for array values ## [7.7.0] - 2024-11-14 ### Added - - Support for Scheduling API ### Fixed - - Issue where inline attachments > 3Mb were not sent correctly ## [7.6.2] - 2024-10-31 ### Added - - Missing `select` field on query params - Missing `name` field on grant model - Missing `masterEventId` on Event model ### Fixed - - Webhook rotate secret calling the wrong endpoint ## [7.6.1] - 2024-10-30 ### Added - - Support for filtering events by masterEventID - Support for gzip compression ## [7.6.0] - 2024-10-18 ### Added - - Support for filtering events by attendee email - Buffer support for file attachments - New webhook trigger types - EWS as a provider ### Changed - - Rotate secret endpoint from being a PUT to a POST call ### Fixed - - Issue where crypto import was causing downstream Jest incompatibilities - FormData import compatibility issues with ESM ### Removed - - eslint-plugin-import from production dependencies ## [7.5.2] - 2024-07-12 ### Fixed - - Issue where metadata was being incorrectly modified before being sent to the API ## [7.5.1] - 2024-07-09 ### Added - - Collective availability method ### Fixed - - Crash when timeout encountered ### Security - - Bump `braces` sub-dependency from 3.0.2 to 3.0.3 ## [7.5.0] - 2024-05-17 ### Added - - Support for filtering by event type when listing events - Support for filtering a list of folders ### Fixed - - Query parameters not being formatted properly ## [7.4.0] - 2024-05-01 ### Added - - Support for `provider` field in code exchange response - Clean messages support ### Fixed - - Issue where attachments < 3mb were not being encoded correctly ## [7.3.0] - 2024-04-15 ### Added - - Response type to `sendRsvp` - Support for adding custom headers to outgoing requests - Support for custom headers field for drafts and messages - Support for setting `include_grant_scopes` for auth url generation ### Changed - - Incorrect `type` field in `When` models to `object` ### Fixed - - Inaccuracy in `ReminderOverride` model ## [7.2.1] - 2024-03-05 ### Added - - Default timeout to match API (90 seconds) ### Changed - - Improved message sending and draft create/update performance ### Fixed - - Serialization/deserialization of keys with numbers in them ## [7.2.0] - 2024-02-27 ### Added - - Support for `roundTo` field in availability response model - Support for `attributes` field in folder model - Support for icloud as an auth provider ### Fixed - - Query params not showing up in method parameters for finding a message - Missing fields in message models ### Removed - - Unnecessary `clientId` from detectProvider params ## [7.1.0] - 2024-02-12 ### Added - - Support for `/v3/connect/tokeninfo` endpoint - Models can now directly be imported from the top-level `nylas` package ### Fixed - - Inaccuracies in event and webhook models ## [7.0.0] - 2024-02-05 ### Added - - Support for both ES6 and CommonJS module systems - Models for all API resources and endpoints, for all HTTP methods to reduce confusion on which fields are available for each endpoint - Error classes for the different API errors as well as SDK-specific errors ### Changed - - **BREAKING**: Node SDK v7 supports the Nylas API v3 exclusively, dropping support for any endpoints that are not available in v3 - **BREAKING**: Convert `Nylas` class from a static to a non-static class - **BREAKING**: Officially support minimum Node 16 @@ -472,30 +398,25 @@ Planned version: **8.6.0**. - Removed the use of custom strings for serialization and deserialization, now automatically converting to camelCase and from the API's snake_case ### Removed - - **BREAKING**: Local Webhook development support is removed due to incompatibility ## [6.8.0] - 2023-02-03 ### Added - - Local webhook testing support - `hideParticipants` field to `Event` ## [6.7.0] - 2023-01-18 ### Added - - Support for rate limit errors - responseType to AuthenticateUrlConfig - New attributes for Event webhook notifications ### Changed - - Event `visibility` field to be writeable ### Security - - Bump `decode-uri-component` sub-dependency from 0.2.0 to 0.2.2 - Bump `qs` sub-dependency from 6.5.2 to 6.5.3 - Bump `json5` sub-dependency from 2.1.0 to 2.2.3 @@ -504,44 +425,36 @@ Planned version: **8.6.0**. ## [6.6.1] - 2022-10-21 ### Fixed - - Calendar color implementation ## [6.6.0] - 2022-10-14 ### Added - - Additional fields for job status webhook notifications - Support for calendar colors (for Microsoft calendars) - Support for event reminders ### Fixed - - Typo in `SchedulerBooking.calendarInviteToGuests` attribute ### Security - - Bump `minimist` sub-dependency from 1.2.5 to 1.2.6 ## [6.5.1] - 2022-09-16 ### Added - - Additional `Event` fields ### Fixed - - Issue with `EventParticipant` not sending status on new event creation ## [6.5.0] - 2022-07-29 ### Added - - `metadata` field to `JobStatus` - `interval_minutes` field in Scheduler booking config ### Fixed - - `Event.originalStartTime` type to be `Date` - `SchedulerBookingOpeningHours.accountId` deserialization - Json value for `confirmationEmailToHost` in `SchedulerBooking` @@ -549,120 +462,99 @@ Planned version: **8.6.0**. ## [6.4.2] - 2022-06-14 ### Added - - `Message.save()` functionality for updating existing messages - Missing `reminderMinutes` field in `Event` ## [6.4.1] - 2022-06-06 ### Fixed - - Issue where API response data was being lost - Incorrect tunnel index number in webhook example ## [6.4.0] - 2022-05-10 ### Added - - Support for collective and group events ### Fixed - - `fileIdsToAttach` field not being set when initializing a `Draft` ## [6.3.2] - 2022-05-04 ### Added - - Missing `fileIdsToAttach` field in `DraftProperties` ### Fixed - - JSON parse error when using `CalendarRestfulModelCollection.freeBusy` - Base URL not being set for `SchedulerRestfulModelCollection` functions ## [6.3.1] - 2022-04-22 ### Added - - Missing order and emails field in calendar availability ### Fixed - - Issue where passing in an array of one for `MessageRestfulModelCollection.findMultiple` throws an error ## [6.3.0] - 2022-04-14 ### Added - - Support for revoking a single access token - Improved Outbox job status support - Support Setting Redirect On Error in Authenticate URL Config ### Fixed - - Issue where an empty response body could trigger a JSON deserialization error ### Removed - - Usage of unreliable `node-fetch response.size` ## [6.2.2] - 2022-04-01 ### Added - - Allow getting raw message by message ID directly instead of needing to fetch the message first - New `authenticationType` field in `ManagementAccount` ### Fixed - - JSON error thrown when Nylas API returns non-JSON error payload ## [6.2.1] - 2022-03-25 ### Added - - Enable Nylas API v2.5 support ### Fixed - - Circular dependency issue in `Attribute` - `SchedulerBookingOpeningHoursProperties.days` and add missing fields to Scheduler models ### Security - - Bump `node-fetch` dependency from 2.6.1 to 2.6.7 - Bump `ajv` sub-dependency from 6.10.2 to 6.12.6 ## [6.2.0] - 2022-02-04 ### Added - - Support for returning multiple messages by a list of message IDs - New field in `Draft` for adding files by file IDs - Webhook Notification models - Improved `Delta` support: added `Delta` model and two new methods; `since` and `longpoll` ### Fixed - - Virtual Calendar logic and serialization ## [6.1.0] - 2022-01-28 ### Added - - Support for `Event` to ICS - `comment` and `phoneNumber` fields to `EventParticipant` - Support for `calendar` field in free-busy, availability, and consecutive availability queries ### Fixed - - Issue where properties of `Model` type were sending read-only attributes to the API ## [6.0.0] - 2022-01-12 ### Added - - Introduction of interfaces that accompany models to improve experience when instantiating API models and provides better insight on "required" fields - Several `Contact` fields that took an object as a value now take a corresponding `Contact` subclass type - New `FreeBusy` type for `CalendarRestfulModelCollection.freeBusy()` return value @@ -675,7 +567,6 @@ Planned version: **8.6.0**. - Introduction of `Enum` types ### Changed - - **BREAKING**: Refactored `RestfulModel` and `RestfulModelCollection`, introduced `Model` and `ModelCollection` superclass for models that do not directly interact with the Nylas API - **BREAKING**: Applied missing variable and return types, and applied stricter typing to improve deserialization and to adhere Typescript best practice - **BREAKING**: `Event.when` is now of `When` type @@ -692,7 +583,6 @@ Planned version: **8.6.0**. - **BREAKING**: `Nylas.application()` takes `ApplicationDetailProperties` type and returns an `ApplicationDetail` type ### Removed - - **BREAKING**: `RestfulModelCollection.build()` as it does not allow for proper property and type hinting in favor of instantiating via `new Model()` - **BREAKING**: `Connect.newAccount()` as it had no functionality - **BREAKING**: `File.metadata()` as it doesn't appear any different than making a `NylasConnection.files().find()` call @@ -700,20 +590,17 @@ Planned version: **8.6.0**. ## [5.10.3] - 2022-01-04 ### Fixed - - Prevent `Event` objects from sending an empty list of notifications when not set, causing errors for recurring events ## [5.10.3] - 2021-12-16 ### Added - - Missing `provider` option for `urlForAuthentication` - Job status improvements ## [5.10.2] - 2021-12-03 ### Fixed - - Scheduler and Component types - Component sending unmodifiable fields during update - Bug where updating an event resulted in an API error @@ -721,13 +608,11 @@ Planned version: **8.6.0**. ## [5.10.1] - 2021-11-22 ### Fixed - - Bug where booking a valid timeslot resulted in an API error ## [5.10.0] - 2021-11-18 ### Added - - Support for Event notifications - Support for remaining Scheduler endpoints - Metadata support for `Calendar`, `Message` and `ManagementAccount` @@ -735,18 +620,15 @@ Planned version: **8.6.0**. ## [5.9.0] - 2021-09-24 ### Added - - Component CRUD Support - Scheduler support ## [5.8.0] - 2021-09-16 ### Added - - Support for consecutive availability ### Fixed - - Issue where JSON.stringify would omit read-only values - Webhook example throwing error if body is not a raw body - Readonly calendar attributes being sent for POST and PUT calls @@ -754,71 +636,59 @@ Planned version: **8.6.0**. ## [5.7.0] - 2021-08-18 ### Added - - Missing fields for recurring events - Support for conferencing ### Fixed - - Minor issues with Neural API implementation - Not rejecting uncaught errors during requests ## [5.6.0] - 2021-07-14 ### Added - - Support for `/calendars/availability` endpoint - Support for the Neural API - Linting, enabled and set up eslint and prettier ### Fixed - - Jest test cases not respecting async methods - Issue with parsing raw MIME emails ## [5.5.1] - 2021-06-24 ### Fixed - - Tracking object not being added to a pre-existing `draft` object - `undefined` response when downloading file ### Removed - - `request` dependency and related import statements ## [5.5.0] - 2021-06-09 ### Added - - Custom error class `NylasApiError` to add more error details returned from the API - Support for read only fields - Enable Nylas API v2.2 support ### Changed - - Replaced deprecated `request` library with `node-fetch` ### Fixed - - Bug where saving a `draft` object with an undefined `filesIds` would throw an error - Typings for classes that extend `RestfulModelCollection` or `RestfulModelInstance` ## [5.4.0] - 2021-05-21 ### Added - - `metadata` field in the Event model to support new Event metadata feature - Support for filtering `metadata` using `metadata_key`, `metadata_value`, and `metadata_pair` ### Security - - Updated dependencies `lodash`, `y18n`, and `pug` to the latest stable version ## [5.3.3] - 2021-03-26 ### Changed - - Pass error message from the API to the SDK user - Migrate `delta` streaming to `node-fetch` - Migrate `exchangeCodeForToken` to `node-fetch` @@ -826,81 +696,66 @@ Planned version: **8.6.0**. ## [5.3.2] - 2021-01-11 ### Fixed - - Typing fixes to `nylas.drafts` and other `RestfulModelCollections` ## [5.3.1] - 2020-11-20 ### Added - - Update readme with syntax highlighting ### Changed - - Drop async dependency for smaller package fingerprint. Async is replaced with promises ### Removed - - Circular dependency in `nylas-connection.ts` ## [5.3.0] - 2020-09-23 ### Added - - `JobStatus` model and collection ### Changed - - Refactor parameter ordering in `find()` and `draft.send()` methods [backwards compatible] ### Fixed - - Bug where setting `event.start` and `event.end` did not set `event.when` if `event.when` didn't exist ## [5.2.0] - 2020-07-27 ### Added - - Implement support for GET /contacts/groups - Support GET /resources - Support POST, PUT and DELETE for calendars, and add location, timezone and isPrimary attributes - `object` attribute to `event.when` object ### Changed - - Update lodash import ## [5.1.0] - 2020-06-04 ### Added - - Support recurring events - Implement list & update application details endpoints - Support free-busy endpoint on Calendars collection ### Fixed - - Bug which was overwriting properties on message objects ## [5.0.0] - 2020-05-07 ### Changed - - **BREAKING**: Officially support minimum Node 16 ### Removed - - **BREAKING**: `appId` and `appSecret`. Please use `clientId` and `clientSecret` - **BREAKING**: `Thread.folder`. Please use `Thread.folders` ### Added - - Migrate to Typescript ## [4.10.1] - 2020-05-06 ### Fixed - - Update `exchangeCodeForToken` to reject when no `access_token` is returned - Unhandled error when response is undefined - Get contact picture request to correctly use callback, if provided @@ -908,173 +763,143 @@ Planned version: **8.6.0**. ## [4.10.0] - 2020-02-24 ### Added - - iCalUID attribute to Event model - Allow file streaming uploads ### Changed - - Update SUPPORTED_API_VERSION to 2.1 - Update Thread.folder to use Folder model, and rename to Thread.folders ## [4.9.0] - 2020-01-24 ### Added - - Update Thread participants to use EmailParticipant ### Changed - - Remove error handling in /connect models ### Security - - Bump handlebars version ## [4.8.0] - 2019-10-09 ### Added - - Support for `/connect/token` endpoint ### Fixed - - Events so that they support all time subojects ## [4.7.1] - 2019-09-18 ### Added - - Support for `/connect/authorize` endpoint - Improvements to example/webhooks ### Changed - - Update formatting for DeprecationWarnings - Update package-lock.json ### Fixed - - Draft deletion bug ## [4.7.0] - 2019-08-20 ### Added - - Support for `/token-info` endpoint - Webhooks CRUD functionality ### Changed - - Update app id and app secret to client id and client secret ## [4.6.2] - 2019-07-26 ### Added - - contentDisposition to File - emailAddress to ManagementAccount - provider to ManagementAccount - `groups` and `source` to contact attributes ### Changed - - Update dependancies ### Fixed - - Contact birthday type from date to string - `emailAddresses` attribute in Contact model ## [4.6.1] - 2019-07-10 ### Added - - billingState to Account model - Update webhooks example code ### Fixed - - Error to string reassignment bug ## [4.6.0] - 2019-06-20 ### Added - - Enable link tracking ## [4.5.0] - 2019-04-02 ### Added - - Support for `/ip_addresses` endpoint ## [4.4.0] - 2019-03-25 ### Added - - Support for `revoke-all` endpoint ## [4.3.0] - 2019-03-18 ### Added - - X-Nylas-Client-Id header for HTTP requests ## [4.2.3] - 2019-02-21 ### Changed - - Replace Underscore with lodash - Replace Bluebird promises with native promises - Upgrade all other dependencies and devDependencies to latest versions - Reduce package size by only including `lib` directory ### Removed - - Drop unnecessary dependencies: express-session, clone ## [4.2.2] - 2018-03-08 ### Added - - Status code to error to allow it to bubble up from API request errors - Improvements to example/sample-app - linkedAt to the account model ### Changed - - Move version mismatch warning to only print if both API and SDK versions are present. This will decrease unhelpful spamming - Parse response into JSON if it is a string ## [4.2.0] - 2018-02-07 ### Added - - Support for new contact fields and functionality ### Changed - - Bump supported Nylas API version to 2.0 ## [4.1.0] - 2017-12-27 ### Added - - Variable for supported version of Nylas API - set to `1.0` and will be updated when the SDK supports later versions of the API - Warnings when the version of the API that the SDK supports differs from the version of the API that the application is using ## [4.0.0] - 2017-11-06 ### Added - - ESLint and Prettier for linting - `search()` for messages and threads - `upgrade()` and `downgrade()` for account management - `getRaw()` for retrieving raw messages ### Changed - - **BREAKING**: Converted Coffeescript to ES6 - **BREAKING**: Updated test framework from Jasmine 1.0 to Jest - **BREAKING**: Changed Travis to run Node 8 and lint, build, and test code in CI @@ -1089,7 +914,6 @@ Planned version: **8.6.0**. - Return server errors for SMTP exceptions on send ### Removed - - **BREAKING**: `draft` attribute on `Message` and `Draft` objects, since the object type is already distinguished - **BREAKING**: Support for `Tag` objects, which has been deprecated, and instance methods on `Thread` for `Tag` changes - **BREAKING**: Support for `generateCursor()`, which has been deprecated @@ -1098,12 +922,10 @@ Planned version: **8.6.0**. ## [3.1.1] - 2017-10-06 ### Added - - Status to event model - Emit `DeltaStream` retry status as an event ### Fixed - - No longer throw an error after successful calls to `Message.sendRaw()` - Don't require secret for `urlForAuthentication()`, allowing client-side usage without leaking or faking the app secret - Catch rejected promises in some missing cases @@ -1113,9 +935,7 @@ Planned version: **8.6.0**. ## [3.0.0] - 2016-08-14 ### Added - - Support for `view=expanded` option. Now all methods on that hit the API can take querystring params as objects. Additionally, you can pass in `{expanded: true}` for convenience ### Changed - - **BREAKING**: `DeltaStream` now also supports `view=expanded`, `exclude_types`, and `include_types`, as well as any arbitrary query string param. `Delta::startStream` now takes an object as a second argument for query string params, instead of an `exclude_types` array diff --git a/src/models/calendars.ts b/src/models/calendars.ts index 9f19fb00..1cb56fd6 100644 --- a/src/models/calendars.ts +++ b/src/models/calendars.ts @@ -108,24 +108,29 @@ export interface CalendarNotetaker { /** * Calendar Notetaker settings as returned in Calendar responses. - * `notetakerSettings` and `deduplicationPolicy` are resolved values: they - * include settings inherited from workspace and application configurations, - * not only what this calendar stores. Responses can carry values the API + * Calendar reads return resolved `notetakerSettings` that include settings + * inherited from workspace and application configurations. Create and update + * responses return the settings you sent. Responses can carry values the API * rejects on writes, so this type can't be passed straight into a create or * update request. Build the request from the fields you want to set. - * Responses don't include `configId` or `autocreate`. */ export interface CalendarNotetakerResponse extends Omit< CalendarNotetaker, - 'notetakerSettings' | 'configId' | 'autocreate' | 'deduplicationPolicy' + 'notetakerSettings' | 'autocreate' | 'deduplicationPolicy' > { /** - * Resolved settings for the Notetakers that join this calendar's events. + * Settings for the Notetakers that join this calendar's events. In calendar + * reads these are resolved and include inherited values. */ notetakerSettings?: NotetakerConfigSettingsResponse; /** - * Resolved policy for whether Notetakers created from this calendar take - * part in deduplication. + * Only in create and update responses, which return the settings you sent. + * Calendar reads don't include it. + */ + autocreate?: boolean; + /** + * This calendar's own deduplication policy. "inherit" means a parent + * configuration decides, so it doesn't say whether deduplication is active. */ deduplicationPolicy?: NotetakerDeduplicationPolicy; } diff --git a/src/models/events.ts b/src/models/events.ts index e043086b..2997e298 100644 --- a/src/models/events.ts +++ b/src/models/events.ts @@ -39,11 +39,11 @@ export interface NotetakerSettings { /** * Event Notetaker settings as returned in Event responses. - * `notetakerSettings` and `deduplicationPolicy` are resolved values: they - * include settings inherited from calendar, workspace and application - * configurations, not only what this event stores. Responses can carry values - * the API rejects on writes, so this type can't be passed straight into a - * create or update request. Build the request from the fields you want to set. + * `notetakerSettings` are resolved values that include inherited settings, + * such as those from the calendar, workspace or application configuration. + * Responses can carry values the API rejects on writes, so this type can't be + * passed straight into a create or update request. Build the request from the + * fields you want to set. */ export interface EventNotetakerResponse extends Omit< NotetakerSettings, @@ -58,8 +58,8 @@ export interface EventNotetakerResponse extends Omit< */ notetakerSettings?: NotetakerConfigSettingsResponse; /** - * Resolved policy for whether this event's Notetaker takes part in - * deduplication. + * This event's own deduplication policy. "inherit" means a parent + * configuration decides, so it doesn't say whether deduplication is active. */ deduplicationPolicy?: NotetakerDeduplicationPolicy; } From 13f002d335e671bedb6b94808afd66a748b00e70 Mon Sep 17 00:00:00 2001 From: Albert T Date: Tue, 24 Nov 2026 02:58:25 -0500 Subject: [PATCH 12/13] Attribute response dedup policy to the configuration in use, scope null transcriptionSettings - deduplicationPolicy in responses is the policy of the configuration the calendar or event uses: its own for inline settings, the referenced configuration's for configId or autocreate. - transcriptionSettings: null restores inherited settings only in notetakers.update(); calendar and event sync treat it as {}. - Event responses: read notetakerSettings when present, fall back to name and meetingSettings. Co-Authored-By: Claude Opus 5.5 --- src/models/calendars.ts | 7 +++++-- src/models/events.ts | 9 +++++++-- src/models/notetakers.ts | 10 ++++++---- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/models/calendars.ts b/src/models/calendars.ts index 1cb56fd6..4cd237b2 100644 --- a/src/models/calendars.ts +++ b/src/models/calendars.ts @@ -129,8 +129,11 @@ export interface CalendarNotetakerResponse extends Omit< */ autocreate?: boolean; /** - * This calendar's own deduplication policy. "inherit" means a parent - * configuration decides, so it doesn't say whether deduplication is active. + * The deduplication policy of the configuration this calendar uses. With + * inline `notetakerSettings` it is the calendar's own value, and "inherit" + * means a parent configuration decides. For a calendar that uses `configId` + * or `autocreate`, reads return that configuration's policy, which can be + * "active" or "inactive". */ deduplicationPolicy?: NotetakerDeduplicationPolicy; } diff --git a/src/models/events.ts b/src/models/events.ts index 2997e298..a804ac92 100644 --- a/src/models/events.ts +++ b/src/models/events.ts @@ -44,6 +44,8 @@ export interface NotetakerSettings { * Responses can carry values the API rejects on writes, so this type can't be * passed straight into a create or update request. Build the request from the * fields you want to set. + * Many event reads return only `id`, `name` and `meetingSettings`. Read + * `notetakerSettings` when present and fall back to those fields. */ export interface EventNotetakerResponse extends Omit< NotetakerSettings, @@ -58,8 +60,11 @@ export interface EventNotetakerResponse extends Omit< */ notetakerSettings?: NotetakerConfigSettingsResponse; /** - * This event's own deduplication policy. "inherit" means a parent - * configuration decides, so it doesn't say whether deduplication is active. + * The deduplication policy of the configuration this event uses. With + * inline `notetakerSettings` it is the event's own value, and "inherit" + * means a parent configuration decides. For an event that uses a + * configuration, reads return that configuration's policy, which can be + * "active" or "inactive". */ deduplicationPolicy?: NotetakerDeduplicationPolicy; } diff --git a/src/models/notetakers.ts b/src/models/notetakers.ts index 29a3bca0..a27ab759 100644 --- a/src/models/notetakers.ts +++ b/src/models/notetakers.ts @@ -187,8 +187,10 @@ export interface NotetakerConfigSettings { /** * Optional settings that tune how Notetaker transcribes audio. * On create, send `null` or `{}` to clear inherited settings. - * On update, `null` removes this Notetaker's override and restores the - * inherited settings, and `{}` clears them. + * In `notetakers.update()`, `null` removes this Notetaker's override and + * restores the inherited settings, and `{}` clears them. + * In calendar and event Notetaker settings, `null` clears them like `{}`. + * Leave the field out to inherit. */ transcriptionSettings?: NotetakerTranscriptionSettings | null; /** @@ -236,8 +238,8 @@ export interface NotetakerConfigSettings { /** * A deduplication policy as returned in calendar and event responses. - * Requests accept only "inherit" and "disable"; responses can also carry the - * resolved "active" or "inactive" policy. + * Requests accept only "inherit" and "disable"; responses can also carry + * "active" or "inactive" from a workspace or application configuration. */ export type NotetakerDeduplicationPolicy = 'inherit' | 'disable' | 'active' | 'inactive'; From 3da66f97040b97d723559b11c7160581adbf0936 Mon Sep 17 00:00:00 2001 From: Albert T Date: Tue, 24 Nov 2026 12:34:41 -0500 Subject: [PATCH 13/13] Plan 9.0.0 instead of 8.6.0 The Unreleased section has three breaking TypeScript changes, and the project follows Semantic Versioning, so this is a major release. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 2 +- package-lock.json | 4 ++-- package.json | 2 +- src/version.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f63fae4b..38cd36b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -Planned version: **8.6.0**. +Planned version: **9.0.0**, because of the breaking TypeScript changes below. ### Added - Type `notetakerSettings` on Notetaker create and update requests, `configId` on Notetaker create requests, and `notetakerSettings` on Notetaker responses, matching the current Notetaker API. diff --git a/package-lock.json b/package-lock.json index c9b98b1b..fe8e871b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "nylas", - "version": "8.6.0", + "version": "9.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "nylas", - "version": "8.6.0", + "version": "9.0.0", "license": "MIT", "dependencies": { "change-case": "^4.1.2", diff --git a/package.json b/package.json index d3182015..0fd1315c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nylas", - "version": "8.6.0", + "version": "9.0.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", diff --git a/src/version.ts b/src/version.ts index 15436aa0..28d8e3e0 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1,2 +1,2 @@ // This file is generated by scripts/exportVersion.js -export const SDK_VERSION = '8.6.0'; +export const SDK_VERSION = '9.0.0';