Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

Planned version: **8.5.1**.
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.
- 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`.
- `certificateExpiresAt` and `thumbprint` on `Credential`, plus `CredentialType.CONNECTORCERTIFICATE` and `CredentialType.ADMINCONSENTCERTIFICATE`, for Dashboard-generated certificate credentials (NYL-515).

### 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 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.
- Populate `requestId` on API errors from the response body `request_id` when the `x-request-id` header is absent, e.g. on `api.provider_error` responses (CUST-5800).
- 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).
Expand Down
16 changes: 16 additions & 0 deletions cjs-wrapper.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ 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 CalendarNotetakerResponse = models.CalendarNotetakerResponse;
export import CalendarNotetakerRules = models.CalendarNotetakerRules;
export import CleanMessagesRequest = models.CleanMessagesRequest;
export import CleanMessagesResponse = models.CleanMessagesResponse;
Expand Down Expand Up @@ -120,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;
Expand Down Expand Up @@ -181,14 +184,27 @@ 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 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;
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 NotetakerSyncSettings = models.NotetakerSyncSettings;
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;
Expand Down
6 changes: 3 additions & 3 deletions examples/calendars/event_with_notetaker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
15 changes: 9 additions & 6 deletions examples/notetakers/notetaker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,12 @@ async function inviteNotetaker(): Promise<NylasResponse<Notetaker>> {

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,
},
};

Expand All @@ -58,7 +59,9 @@ async function inviteNotetaker(): Promise<NylasResponse<Notetaker>> {
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 ?? notetaker.data.name}`
);
console.log(`State: ${notetaker.data.state}`);
return notetaker;
} catch (error) {
Expand Down Expand Up @@ -94,7 +97,7 @@ async function listNotetakers(): Promise<NylasListResponse<Notetaker>> {
);
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})`
);
}

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nylas",
"version": "8.5.1",
"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",
Expand Down
102 changes: 92 additions & 10 deletions src/models/calendars.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { ListQueryParams } from './listQueryParams.js';
import { NotetakerMeetingSettings } from './notetakers.js';
import {
NotetakerConfigSettingsResponse,
NotetakerDeduplicationPolicy,
NotetakerSyncSettings,
NotetakerMeetingSettings,
} from './notetakers.js';

/**
* Interface for Calendar Notetaker participant filter
Expand All @@ -15,20 +20,31 @@ 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.
* 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.
*/
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.
Expand All @@ -38,24 +54,90 @@ 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.
*
* 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 {
/**
* 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. Include these settings when
* you update `rules`: a `notetaker` object with only `rules` replaces the
* calendar's settings with legacy defaults.
*/
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. Cannot be combined with `rules`.
*/
autocreate?: true;
/**
* 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`. Updates that omit it reset it to
* "inherit", so send it again to keep an opt-out.
*/
deduplicationPolicy?: 'inherit' | 'disable';
/**
* Rules for when the Notetaker should join a meeting.
*/
rules?: CalendarNotetakerRules;
}

/**
* Calendar Notetaker settings as returned in Calendar responses.
* 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.
*/
export interface CalendarNotetakerResponse extends Omit<
CalendarNotetaker,
'notetakerSettings' | 'autocreate' | 'deduplicationPolicy'
> {
/**
* Settings for the Notetakers that join this calendar's events. In calendar
* reads these are resolved and include inherited values.
*/
notetakerSettings?: NotetakerConfigSettingsResponse;
/**
* Only in create and update responses, which return the settings you sent.
* Calendar reads don't include it.
*/
autocreate?: boolean;
/**
* 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;
}

/**
* Interface of the query parameters for listing calendars.
*/
Expand Down Expand Up @@ -185,5 +267,5 @@ export interface Calendar {
/**
* Notetaker meeting bot settings
*/
notetaker?: CalendarNotetaker;
notetaker?: CalendarNotetakerResponse;
}
56 changes: 53 additions & 3 deletions src/models/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@ 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 {
NotetakerConfigSettingsResponse,
NotetakerDeduplicationPolicy,
NotetakerSyncSettings,
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 {
/**
Expand All @@ -17,6 +23,50 @@ export interface NotetakerSettings {
* Notetaker Meeting Settings
*/
meetingSettings?: NotetakerMeetingSettings;
/**
* Settings for the Notetaker that joins this event.
* Nylas saves them as an event configuration.
*/
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';
}

/**
* Event Notetaker settings as returned in Event responses.
* `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.
* 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,
'notetakerSettings' | 'deduplicationPolicy'
> {
/**
* The Notetaker bot ID.
*/
id?: string;
/**
* Resolved settings for the Notetaker that joins this event.
*/
notetakerSettings?: NotetakerConfigSettingsResponse;
/**
* 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;
}

/**
Expand Down Expand Up @@ -178,7 +228,7 @@ export interface Event {
/**
* Notetaker meeting bot settings
*/
notetaker?: NotetakerSettings;
notetaker?: EventNotetakerResponse;
}

/**
Expand Down
Loading
Loading