Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nylas

Package Overview
Dependencies
Maintainers
11
Versions
98
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nylas - npm Package Compare versions

Comparing version 7.0.0-beta.4 to 7.0.0-beta.5

11

lib/cjs/models/events.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.WhenType = void 0;
/**
* Enum representing the different types of when objects.
*/
var WhenType;
(function (WhenType) {
WhenType["Time"] = "time";
WhenType["Timespan"] = "timespan";
WhenType["Date"] = "date";
WhenType["Datespan"] = "datespan";
})(WhenType = exports.WhenType || (exports.WhenType = {}));

16

lib/cjs/resources/auth.js

@@ -28,8 +28,4 @@ "use strict";

exchangeCodeForToken(request) {
const body = {
...request,
grantType: 'authorization_code',
};
if (request.codeVerifier) {
body.codeVerifier = request.codeVerifier;
if (!request.clientSecret) {
request.clientSecret = this.apiClient.apiKey;
}

@@ -39,3 +35,6 @@ return this.apiClient.request({

path: `/v3/connect/token`,
body,
body: {
...request,
grantType: 'authorization_code',
},
});

@@ -49,2 +48,5 @@ }

refreshAccessToken(request) {
if (!request.clientSecret) {
request.clientSecret = this.apiClient.apiKey;
}
return this.apiClient.request({

@@ -51,0 +53,0 @@ method: 'POST',

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Drafts = void 0;
const messages_js_1 = require("./messages.js");
const resource_js_1 = require("./resource.js");
const messages_js_1 = require("./messages.js");
/**

@@ -71,3 +71,3 @@ * Nylas Drafts API

* Send a Draft
* @return The sent draft
* @return The sent message
*/

@@ -74,0 +74,0 @@ send({ identifier, draftId, overrides, }) {

@@ -5,2 +5,2 @@ "use strict";

// This file is generated by scripts/exportVersion.js
exports.SDK_VERSION = '7.0.0-beta.4';
exports.SDK_VERSION = '7.0.0-beta.5';

@@ -1,1 +0,10 @@

export {};
/**
* Enum representing the different types of when objects.
*/
export var WhenType;
(function (WhenType) {
WhenType["Time"] = "time";
WhenType["Timespan"] = "timespan";
WhenType["Date"] = "date";
WhenType["Datespan"] = "datespan";
})(WhenType || (WhenType = {}));

@@ -25,8 +25,4 @@ import { v4 as uuid } from 'uuid';

exchangeCodeForToken(request) {
const body = {
...request,
grantType: 'authorization_code',
};
if (request.codeVerifier) {
body.codeVerifier = request.codeVerifier;
if (!request.clientSecret) {
request.clientSecret = this.apiClient.apiKey;
}

@@ -36,3 +32,6 @@ return this.apiClient.request({

path: `/v3/connect/token`,
body,
body: {
...request,
grantType: 'authorization_code',
},
});

@@ -46,2 +45,5 @@ }

refreshAccessToken(request) {
if (!request.clientSecret) {
request.clientSecret = this.apiClient.apiKey;
}
return this.apiClient.request({

@@ -48,0 +50,0 @@ method: 'POST',

@@ -0,3 +1,3 @@

import { Messages } from './messages.js';
import { Resource } from './resource.js';
import { Messages } from './messages.js';
/**

@@ -68,3 +68,3 @@ * Nylas Drafts API

* Send a Draft
* @return The sent draft
* @return The sent message
*/

@@ -71,0 +71,0 @@ send({ identifier, draftId, overrides, }) {

// This file is generated by scripts/exportVersion.js
export const SDK_VERSION = '7.0.0-beta.4';
export const SDK_VERSION = '7.0.0-beta.5';

@@ -0,10 +1,7 @@

/// <reference types="node" />
/**
* Interface of an attachment object from Nylas.
*/
export interface Attachment {
interface BaseAttachment {
/**
* A globally unique object identifier.
*/
id: string;
/**
* Attachment's name.

@@ -18,15 +15,41 @@ */

/**
* Grant ID of the Nylas account.
*/
grantId: string;
/**
* If it's an inline attachment.
*/
isInline: boolean;
isInline?: boolean;
/**
* Attachment's size in bytes.
*/
size: number;
size?: number;
/**
* Content ID of the attachment.
*/
contentId?: string;
/**
* Content disposition of the attachment.
*/
contentDisposition?: string;
}
/**
* Interface of a create attachment request.
*/
export interface CreateAttachmentRequest extends BaseAttachment {
/**
* Content of the attachment.
*/
content: NodeJS.ReadableStream;
}
/**
* Interface of an attachment object from Nylas.
*/
export interface Attachment extends BaseAttachment {
/**
* Attachment's ID.
*/
id: string;
/**
* Grant ID of the Nylas account.
*/
grantId: string;
}
/**
* Interface representing of the query parameters for finding an attachment's metadata.

@@ -44,1 +67,2 @@ */

export type DownloadAttachmentQueryParams = FindAttachmentQueryParams;
export {};

@@ -79,5 +79,5 @@ /**

/**
* Client secret of the application.
* Client secret of the application. If not provided, the API Key will be used instead.
*/
clientSecret: string;
clientSecret?: string;
/**

@@ -105,5 +105,5 @@ * The original plain text code verifier (code_challenge) used in the initial authorization request (PKCE).

/**
* Client secret of the application.
* Client secret of the application. If not provided, the API Key will be used instead.
*/
clientSecret: string;
clientSecret?: string;
}

@@ -110,0 +110,0 @@ /**

@@ -34,3 +34,2 @@ import { ListQueryParams } from './listQueryParams.js';

*/
export type ContactType = 'work' | 'home' | 'other';
export type SourceType = 'address_book' | 'inbox' | 'domain';

@@ -43,3 +42,3 @@ export type GroupType = 'user' | 'system' | 'other';

email?: string;
type?: ContactType;
type?: string;
}

@@ -58,3 +57,3 @@ /**

number?: string;
type?: ContactType;
type?: string;
}

@@ -71,3 +70,3 @@ /**

country?: string;
type?: ContactType;
type?: string;
}

@@ -79,3 +78,3 @@ /**

url?: string;
type?: ContactType;
type?: string;
}

@@ -82,0 +81,0 @@ /**

@@ -42,3 +42,8 @@ import { BaseMessage, BaseCreateMessage } from './messages.js';

*/
export type UpdateDraftRequest = Partial<CreateDraftRequest>;
export type UpdateDraftRequest = Partial<CreateDraftRequest> & {
/**
* Return drafts that are unread.
*/
unread?: boolean;
};
/**

@@ -45,0 +50,0 @@ * Interface representing the different tracking options for when a message is sent.

@@ -58,2 +58,6 @@ import { ListQueryParams } from './listQueryParams.js';

/**
* Visibility of the event, if the event is private or public.
*/
visibility: Visibility;
/**
* Description of the event.

@@ -95,3 +99,3 @@ */

*/
organizer: EmailName;
organizer?: EmailName;
/**

@@ -103,5 +107,5 @@ * An list of RRULE and EXDATE strings.

/**
* List of reminders for the event.
* A list of reminders to send for the event. If left empty or omitted, the event uses the provider defaults.
*/
reminders?: Reminder[];
reminders?: Reminders;
/**

@@ -111,6 +115,2 @@ * Status of the event.

status?: Status;
/**
* Visibility of the event, if the event is private or public.
*/
visibility?: Visibility;
}

@@ -128,3 +128,3 @@ /**

*/
when: When;
when: CreateWhen;
/**

@@ -153,11 +153,6 @@ * Title of the event.

/**
* The number of minutes before the event start time when a user wants a reminder for this event.
* Reminder minutes need to be entered in the following format: "[20]".
* A list of reminders to send for the event. If left empty or omitted, the event uses the provider defaults.
*/
reminderMinutes?: string;
reminders?: Reminders;
/**
* Method to remind the user about the event. (Google only).
*/
reminderMethod?: string;
/**
* A list of key-value pairs storing additional data.

@@ -216,3 +211,2 @@ */

showCancelled?: boolean;
eventId?: string;
/**

@@ -321,3 +315,3 @@ * Specify calendar ID of the event. "primary" is a supported value indicating the user's primary calendar.

*/
type Visibility = 'public' | 'private';
type Visibility = 'default' | 'public' | 'private';
/**

@@ -344,2 +338,15 @@ * Enum representing the supported conferencing providers.

/**
* Type representing the different objects representing time and duration when creating events.
*/
type CreateWhen = Omit<Time, 'type'> | Omit<Timespan, 'type'> | Omit<Date, 'type'> | Omit<Datespan, 'type'>;
/**
* Enum representing the different types of when objects.
*/
export declare enum WhenType {
Time = "time",
Timespan = "timespan",
Date = "date",
Datespan = "datespan"
}
/**
* Interface of a conferencing details object

@@ -411,2 +418,6 @@ */

timezone: string;
/**
* The type of 'when' object.
*/
type: WhenType.Time;
}

@@ -438,2 +449,6 @@ /**

endTimezone?: string;
/**
* The type of 'when' object.
*/
type: WhenType.Timespan;
}

@@ -450,2 +465,6 @@ /**

date: string;
/**
* The type of 'when' object.
*/
type: WhenType.Date;
}

@@ -467,2 +486,6 @@ /**

endDate: string;
/**
* The type of 'when' object.
*/
type: WhenType.Datespan;
}

@@ -497,4 +520,18 @@ /**

*/
export interface Reminder {
export interface Reminders {
/**
* Whether to use the default reminders for the calendar.
* When true, uses the default reminder settings for the calendar
*/
useDefault: boolean;
/**
* A list of reminders for the event if useDefault is set to false.
*/
overrides: ReminderOverride[];
}
/**
* Interface representing the reminder details for an event.
*/
export interface ReminderOverride {
/**
* The number of minutes before the event start time when a user wants a reminder for this event.

@@ -501,0 +538,0 @@ * Reminder minutes are in the following format: "[20]".

import { EmailName } from './events.js';
import { CreateFileRequest, File } from './files.js';
import { ListQueryParams } from './listQueryParams.js';
import { Attachment, CreateAttachmentRequest } from './attachments.js';
/**

@@ -27,9 +27,4 @@ * @internal Internal interface for creating a message.

*/
attachments?: CreateFileRequest[];
attachments?: CreateAttachmentRequest[];
/**
* A short snippet of the message body.
* This is the first 100 characters of the message body, with any HTML tags removed.
*/
snippet?: string;
/**
* The message subject.

@@ -39,7 +34,2 @@ */

/**
* A reference to the parent thread object.
* If this is a new draft, the thread will be empty.
*/
threadId?: string;
/**
* The full HTML message body.

@@ -53,6 +43,2 @@ * Messages with only plain-text representations are up-converted to HTML.

starred?: boolean;
/**
* Whether or not the message has been read by the user.
*/
unread?: boolean;
}

@@ -91,3 +77,17 @@ /**

*/
attachments?: File[];
attachments?: Attachment[];
/**
* A short snippet of the message body.
* This is the first 100 characters of the message body, with any HTML tags removed.
*/
snippet?: string;
/**
* A reference to the parent thread object.
* If this is a new draft, the thread will be empty.
*/
threadId?: string;
/**
* Whether or not the message has been read by the user.
*/
unread?: boolean;
}

@@ -94,0 +94,0 @@ /**

@@ -66,3 +66,3 @@ import { Resource } from './resource.js';

*/
detectProvider(params: ProviderDetectParams): Promise<ProviderDetectResponse>;
detectProvider(params: ProviderDetectParams): Promise<NylasResponse<ProviderDetectResponse>>;
private urlAuthBuilder;

@@ -69,0 +69,0 @@ private hashPKCESecret;

@@ -12,3 +12,3 @@ import { Overrides } from '../config.js';

*/
interface FindCalendarParams {
export interface FindCalendarParams {
identifier: string;

@@ -22,3 +22,3 @@ calendarId: string;

*/
interface ListCalendersParams {
export interface ListCalendersParams {
identifier: string;

@@ -32,3 +32,3 @@ queryParams?: ListCalendersQueryParams;

*/
interface CreateCalendarParams {
export interface CreateCalendarParams {
identifier: string;

@@ -42,3 +42,3 @@ requestBody: CreateCalenderRequest;

*/
interface UpdateCalendarParams {
export interface UpdateCalendarParams {
identifier: string;

@@ -53,3 +53,3 @@ calendarId: string;

*/
interface DestroyCalendarParams {
export interface DestroyCalendarParams {
identifier: string;

@@ -62,3 +62,3 @@ calendarId: string;

*/
interface GetAvailabilityParams {
export interface GetAvailabilityParams {
requestBody: GetAvailabilityRequest;

@@ -71,3 +71,3 @@ }

*/
interface GetFreeBusyParams {
export interface GetFreeBusyParams {
identifier: string;

@@ -119,2 +119,1 @@ requestBody: GetFreeBusyRequest;

}
export {};

@@ -0,4 +1,5 @@

import { Overrides } from '../config.js';
import { AsyncListResponse, Resource } from './resource.js';
import { CreateDraftRequest, Draft, ListDraftsQueryParams, UpdateDraftRequest } from '../models/drafts.js';
import { Overrides } from '../config.js';
import { Message } from '../models/messages.js';
import { NylasBaseResponse, NylasListResponse, NylasResponse } from '../models/response.js';

@@ -84,5 +85,5 @@ /**

* Send a Draft
* @return The sent draft
* @return The sent message
*/
send({ identifier, draftId, overrides, }: SendDraftParams & Overrides): Promise<NylasResponse<Draft>>;
send({ identifier, draftId, overrides, }: SendDraftParams & Overrides): Promise<NylasResponse<Message>>;
}

@@ -10,3 +10,3 @@ import { Overrides } from '../config.js';

*/
interface FindEventParams {
export interface FindEventParams {
identifier: string;

@@ -20,3 +20,3 @@ eventId: string;

*/
interface ListEventParams {
export interface ListEventParams {
identifier: string;

@@ -30,3 +30,3 @@ queryParams: ListEventQueryParams;

*/
interface CreateEventParams {
export interface CreateEventParams {
identifier: string;

@@ -42,3 +42,3 @@ requestBody: CreateEventRequest;

*/
interface UpdateEventParams {
export interface UpdateEventParams {
identifier: string;

@@ -54,3 +54,3 @@ eventId: string;

*/
interface DestroyEventParams {
export interface DestroyEventParams {
identifier: string;

@@ -57,0 +57,0 @@ eventId: string;

@@ -8,3 +8,3 @@ import { Resource } from './resource.js';

*/
interface FindGrantParams {
export interface FindGrantParams {
grantId: string;

@@ -16,3 +16,3 @@ }

*/
interface UpdateGrantParams {
export interface UpdateGrantParams {
grantId: string;

@@ -24,3 +24,3 @@ requestBody: UpdateGrantRequest;

*/
interface DestroyGrantParams {
export interface DestroyGrantParams {
grantId: string;

@@ -55,2 +55,1 @@ }

}
export {};

@@ -8,3 +8,3 @@ import { AsyncListResponse, Resource } from './resource.js';

*/
interface FindRedirectUrisParams {
export interface FindRedirectUrisParams {
redirectUriId: string;

@@ -15,3 +15,3 @@ }

*/
interface CreateRedirectUrisParams {
export interface CreateRedirectUrisParams {
requestBody: CreateRedirectUriRequest;

@@ -23,3 +23,3 @@ }

*/
interface UpdateRedirectUrisParams {
export interface UpdateRedirectUrisParams {
redirectUriId: string;

@@ -31,3 +31,3 @@ requestBody: UpdateRedirectUriRequest;

*/
interface DestroyRedirectUrisParams {
export interface DestroyRedirectUrisParams {
redirectUriId: string;

@@ -67,2 +67,1 @@ }

}
export {};

@@ -8,3 +8,3 @@ import { AsyncListResponse, Resource } from './resource.js';

*/
interface FindWebhookParams {
export interface FindWebhookParams {
webhookId: string;

@@ -15,3 +15,3 @@ }

*/
interface CreateWebhookParams {
export interface CreateWebhookParams {
requestBody: CreateWebhookRequest;

@@ -23,3 +23,3 @@ }

*/
interface UpdateWebhookParams {
export interface UpdateWebhookParams {
webhookId: string;

@@ -31,3 +31,3 @@ requestBody: UpdateWebhookRequest;

*/
interface DestroyWebhookParams {
export interface DestroyWebhookParams {
webhookId: string;

@@ -83,2 +83,1 @@ }

}
export {};

@@ -1,3 +0,3 @@

import { CreateFileRequest } from './models/files.js';
export declare function createFileRequestBuilder(filePath: string): CreateFileRequest;
import { CreateAttachmentRequest } from './models/attachments.js';
export declare function createFileRequestBuilder(filePath: string): CreateAttachmentRequest;
/**

@@ -4,0 +4,0 @@ * A utility function that recursively converts all keys in an object to camelCase.

@@ -1,1 +0,1 @@

export declare const SDK_VERSION = "7.0.0-beta.4";
export declare const SDK_VERSION = "7.0.0-beta.5";
{
"name": "nylas",
"version": "7.0.0-beta.4",
"version": "7.0.0-beta.5",
"description": "A NodeJS wrapper for the Nylas REST API for email, contacts, and calendar.",

@@ -5,0 +5,0 @@ "main": "lib/cjs/nylas.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc