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

nylas

Package Overview
Dependencies
Maintainers
10
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 6.0.0 to 6.1.0

2

lib/models/access-token.d.ts
import Model from './model';
import { Attribute } from './attributes';
export declare type AccessTokenProperties = {

@@ -15,3 +16,4 @@ accessToken: string;

tokenType: string;
static attributes: Record<string, Attribute>;
constructor(props?: AccessTokenProperties);
}

42

lib/models/access-token.js

@@ -33,25 +33,25 @@ "use strict";

}
AccessToken.attributes = {
accessToken: attributes_1.default.String({
modelKey: 'accessToken',
jsonKey: 'access_token',
}),
accountId: attributes_1.default.String({
modelKey: 'accountId',
jsonKey: 'account_id',
}),
emailAddress: attributes_1.default.String({
modelKey: 'emailAddress',
jsonKey: 'email_address',
}),
provider: attributes_1.default.String({
modelKey: 'provider',
}),
tokenType: attributes_1.default.String({
modelKey: 'tokenType',
jsonKey: 'token_type',
}),
};
return AccessToken;
}(model_1.default));
exports.default = AccessToken;
AccessToken.attributes = {
accessToken: attributes_1.default.String({
modelKey: 'accessToken',
jsonKey: 'access_token',
}),
accountId: attributes_1.default.String({
modelKey: 'accountId',
jsonKey: 'account_id',
}),
emailAddress: attributes_1.default.String({
modelKey: 'emailAddress',
jsonKey: 'email_address',
}),
provider: attributes_1.default.String({
modelKey: 'provider',
}),
tokenType: attributes_1.default.String({
modelKey: 'tokenType',
jsonKey: 'token_type',
}),
};
import RestfulModel from './restful-model';
import { Attribute } from './attributes';
import NylasConnection from '../nylas-connection';

@@ -22,3 +23,6 @@ export declare type AccountProperties = {

billingState?: string;
static collectionName: string;
static endpointName: string;
static attributes: Record<string, Attribute>;
constructor(connection: NylasConnection, props?: AccountProperties);
}

@@ -46,29 +46,29 @@ "use strict";

}
Account.collectionName = 'accounts';
Account.endpointName = 'account';
Account.attributes = __assign(__assign({}, restful_model_1.default.attributes), { name: attributes_1.default.String({
modelKey: 'name',
}), emailAddress: attributes_1.default.String({
modelKey: 'emailAddress',
jsonKey: 'email_address',
}), provider: attributes_1.default.String({
modelKey: 'provider',
}), organizationUnit: attributes_1.default.String({
modelKey: 'organizationUnit',
jsonKey: 'organization_unit',
}), syncState: attributes_1.default.String({
modelKey: 'syncState',
jsonKey: 'sync_state',
}), billingState: attributes_1.default.String({
modelKey: 'billingState',
jsonKey: 'billing_state',
}), linkedAt: attributes_1.default.DateTime({
modelKey: 'linkedAt',
jsonKey: 'linked_at',
}), accessToken: attributes_1.default.String({
modelKey: 'accessToken',
jsonKey: 'access_token',
}) });
return Account;
}(restful_model_1.default));
exports.default = Account;
Account.collectionName = 'accounts';
Account.endpointName = 'account';
Account.attributes = __assign(__assign({}, restful_model_1.default.attributes), { name: attributes_1.default.String({
modelKey: 'name',
}), emailAddress: attributes_1.default.String({
modelKey: 'emailAddress',
jsonKey: 'email_address',
}), provider: attributes_1.default.String({
modelKey: 'provider',
}), organizationUnit: attributes_1.default.String({
modelKey: 'organizationUnit',
jsonKey: 'organization_unit',
}), syncState: attributes_1.default.String({
modelKey: 'syncState',
jsonKey: 'sync_state',
}), billingState: attributes_1.default.String({
modelKey: 'billingState',
jsonKey: 'billing_state',
}), linkedAt: attributes_1.default.DateTime({
modelKey: 'linkedAt',
jsonKey: 'linked_at',
}), accessToken: attributes_1.default.String({
modelKey: 'accessToken',
jsonKey: 'access_token',
}) });
import Model from './model';
import { Attribute } from './attributes';
export declare type ApplicationDetailsProperties = {

@@ -11,3 +12,4 @@ applicationName?: string;

redirectUris: string[];
static attributes: Record<string, Attribute>;
constructor(props?: ApplicationDetailsProperties);
}

@@ -31,18 +31,18 @@ "use strict";

}
ApplicationDetails.attributes = {
applicationName: attributes_1.default.String({
modelKey: 'applicationName',
jsonKey: 'application_name',
}),
iconUrl: attributes_1.default.String({
modelKey: 'iconUrl',
jsonKey: 'icon_url',
}),
redirectUris: attributes_1.default.StringList({
modelKey: 'redirectUris',
jsonKey: 'redirect_uris',
}),
};
return ApplicationDetails;
}(model_1.default));
exports.default = ApplicationDetails;
ApplicationDetails.attributes = {
applicationName: attributes_1.default.String({
modelKey: 'applicationName',
jsonKey: 'application_name',
}),
iconUrl: attributes_1.default.String({
modelKey: 'iconUrl',
jsonKey: 'icon_url',
}),
redirectUris: attributes_1.default.StringList({
modelKey: 'redirectUris',
jsonKey: 'redirect_uris',
}),
};
import Model from './model';
import { FreeBusyProperties, TimeSlot, TimeSlotProperties } from './free-busy';
import { Attribute } from './attributes';
import { FreeBusyProperties, TimeSlot, TimeSlotProperties, FreeBusyCalendarProperties } from './free-busy';
export declare enum RoundRobin {

@@ -25,9 +26,11 @@ MaxAvailability = "max-availability",

openHours?: OpenHoursProperties[];
calendars?: FreeBusyCalendarProperties[];
};
export declare type SingleAvailabilityQuery = AvailabilityQuery & {
emails: string[];
emails?: string[];
eventCollectionId?: string;
roundRobin?: RoundRobin;
};
export declare type ConsecutiveAvailabilityQuery = AvailabilityQuery & {
emails: Array<string[]>;
emails?: Array<string[]>;
};

@@ -48,2 +51,3 @@ export declare type OpenHoursProperties = {

end: string;
static attributes: Record<string, Attribute>;
constructor(props?: OpenHoursProperties);

@@ -60,2 +64,3 @@ }

endTime: number;
static attributes: Record<string, Attribute>;
constructor(props?: CalendarConsecutiveAvailabilityProperties);

@@ -69,4 +74,5 @@ }

timeSlots: TimeSlot[];
static attributes: Record<string, Attribute>;
constructor(props?: CalendarAvailabilityProperties);
}
export {};

@@ -50,26 +50,26 @@ "use strict";

}
OpenHours.attributes = {
objectType: attributes_1.default.String({
modelKey: 'objectType',
jsonKey: 'object_type',
}),
emails: attributes_1.default.StringList({
modelKey: 'emails',
}),
days: attributes_1.default.NumberList({
modelKey: 'days',
}),
timezone: attributes_1.default.String({
modelKey: 'timezone',
}),
start: attributes_1.default.String({
modelKey: 'start',
}),
end: attributes_1.default.String({
modelKey: 'end',
}),
};
return OpenHours;
}(model_1.default));
exports.OpenHours = OpenHours;
OpenHours.attributes = {
objectType: attributes_1.default.String({
modelKey: 'objectType',
jsonKey: 'object_type',
}),
emails: attributes_1.default.StringList({
modelKey: 'emails',
}),
days: attributes_1.default.NumberList({
modelKey: 'days',
}),
timezone: attributes_1.default.String({
modelKey: 'timezone',
}),
start: attributes_1.default.String({
modelKey: 'start',
}),
end: attributes_1.default.String({
modelKey: 'end',
}),
};
var CalendarConsecutiveAvailability = /** @class */ (function (_super) {

@@ -85,18 +85,18 @@ __extends(CalendarConsecutiveAvailability, _super);

}
CalendarConsecutiveAvailability.attributes = {
emails: attributes_1.default.StringList({
modelKey: 'emails',
}),
startTime: attributes_1.default.Number({
modelKey: 'startTime',
jsonKey: 'start_time',
}),
endTime: attributes_1.default.Number({
modelKey: 'endTime',
jsonKey: 'end_time',
}),
};
return CalendarConsecutiveAvailability;
}(model_1.default));
exports.CalendarConsecutiveAvailability = CalendarConsecutiveAvailability;
CalendarConsecutiveAvailability.attributes = {
emails: attributes_1.default.StringList({
modelKey: 'emails',
}),
startTime: attributes_1.default.Number({
modelKey: 'startTime',
jsonKey: 'start_time',
}),
endTime: attributes_1.default.Number({
modelKey: 'endTime',
jsonKey: 'end_time',
}),
};
var CalendarAvailability = /** @class */ (function (_super) {

@@ -111,11 +111,11 @@ __extends(CalendarAvailability, _super);

}
CalendarAvailability.attributes = {
timeSlots: attributes_1.default.Collection({
modelKey: 'timeSlots',
jsonKey: 'time_slots',
itemClass: free_busy_1.TimeSlot,
}),
};
return CalendarAvailability;
}(model_1.default));
exports.default = CalendarAvailability;
CalendarAvailability.attributes = {
timeSlots: attributes_1.default.Collection({
modelKey: 'timeSlots',
jsonKey: 'time_slots',
itemClass: free_busy_1.TimeSlot,
}),
};

@@ -15,2 +15,4 @@ import Calendar from './calendar';

}) => void): Promise<CalendarConsecutiveAvailability>;
private buildAvailabilityPayload;
private queryIsValid;
}

@@ -15,2 +15,13 @@ "use strict";

})();
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -29,3 +40,3 @@ return (mod && mod.__esModule) ? mod : { "default": mod };

var restful_model_collection_1 = __importDefault(require("./restful-model-collection"));
var free_busy_1 = __importDefault(require("./free-busy"));
var free_busy_1 = __importStar(require("./free-busy"));
var calendar_availability_1 = __importStar(require("./calendar-availability"));

@@ -41,2 +52,6 @@ var CalendarRestfulModelCollection = /** @class */ (function (_super) {

CalendarRestfulModelCollection.prototype.freeBusy = function (options, callback) {
this.queryIsValid(options);
var calendarsJson = options.calendars
? options.calendars.map(function (cal) { return new free_busy_1.FreeBusyCalendar(cal).toJSON(true); })
: [];
return this.connection

@@ -49,3 +64,4 @@ .request({

end_time: options.endTime.toString(),
emails: options.emails,
emails: options.emails || [],
calendars: calendarsJson,
},

@@ -72,9 +88,3 @@ })

CalendarRestfulModelCollection.prototype.availability = function (options, callback) {
// Instantiate objects from properties to get JSON formatted for the API call
var freeBusyJson = options.freeBusy
? options.freeBusy.map(function (fb) { return new free_busy_1.default(fb).toJSON(true); })
: [];
var openHoursJson = options.openHours
? options.openHours.map(function (oh) { return new calendar_availability_1.OpenHours(oh).toJSON(true); })
: [];
this.queryIsValid(options);
return this.connection

@@ -84,14 +94,3 @@ .request({

path: "/calendars/availability",
body: {
emails: options.emails,
duration_minutes: options.duration,
interval_minutes: options.interval,
start_time: options.startTime,
end_time: options.endTime,
buffer: options.buffer,
tentative_busy: options.tentativeBusy,
round_robin: options.roundRobin,
free_busy: freeBusyJson,
open_hours: openHoursJson,
},
body: __assign(__assign({}, this.buildAvailabilityPayload(options)), { event_collection_id: options.eventCollectionId, round_robin: options.roundRobin }),
})

@@ -112,29 +111,25 @@ .then(function (json) {

CalendarRestfulModelCollection.prototype.consecutiveAvailability = function (options, callback) {
// If open hours contains any emails not present in the main emails key
// or in the free busy email list as this would raise an error on the API side
var freeBusyEmails = options.freeBusy
? options.freeBusy.map(function (fb) { return fb.email; })
: [];
if (options.openHours) {
for (var _i = 0, _a = options.openHours; _i < _a.length; _i++) {
var openHour = _a[_i];
var _loop_1 = function (email) {
if (!options.emails.some(function (row) { return row.includes(email); }) &&
!freeBusyEmails.includes(email)) {
throw new Error('Open Hours cannot contain an email not present in the main email list or the free busy email list.');
this.queryIsValid(options);
if (options.emails) {
// If open hours contains any emails not present in the main emails key
// or in the free busy email list as this would raise an error on the API side
var freeBusyEmails = options.freeBusy
? options.freeBusy.map(function (fb) { return fb.email; })
: [];
if (options.openHours) {
for (var _i = 0, _a = options.openHours; _i < _a.length; _i++) {
var openHour = _a[_i];
var _loop_1 = function (email) {
if (!options.emails.some(function (row) { return row.includes(email); }) &&
!freeBusyEmails.includes(email)) {
throw new Error('Open Hours cannot contain an email not present in the main email list or the free busy email list.');
}
};
for (var _b = 0, _c = openHour.emails; _b < _c.length; _b++) {
var email = _c[_b];
_loop_1(email);
}
};
for (var _b = 0, _c = openHour.emails; _b < _c.length; _b++) {
var email = _c[_b];
_loop_1(email);
}
}
}
// Instantiate objects from properties to get JSON formatted for the API call
var freeBusyJson = options.freeBusy
? options.freeBusy.map(function (fb) { return new free_busy_1.default(fb).toJSON(true); })
: [];
var openHoursJson = options.openHours
? options.openHours.map(function (oh) { return new calendar_availability_1.OpenHours(oh).toJSON(true); })
: [];
return this.connection

@@ -144,13 +139,3 @@ .request({

path: "/calendars/availability/consecutive",
body: {
emails: options.emails,
duration_minutes: options.duration,
interval_minutes: options.interval,
start_time: options.startTime,
end_time: options.endTime,
buffer: options.buffer,
tentative_busy: options.tentativeBusy,
free_busy: freeBusyJson,
open_hours: openHoursJson,
},
body: this.buildAvailabilityPayload(options),
})

@@ -170,4 +155,36 @@ .then(function (json) {

};
CalendarRestfulModelCollection.prototype.buildAvailabilityPayload = function (options) {
// Instantiate objects from properties to get JSON formatted for the API call
var freeBusyJson = options.freeBusy
? options.freeBusy.map(function (fb) { return new free_busy_1.default(fb).toJSON(true); })
: [];
var openHoursJson = options.openHours
? options.openHours.map(function (oh) { return new calendar_availability_1.OpenHours(oh).toJSON(true); })
: [];
var calendarsJson = options.calendars
? options.calendars.map(function (cal) { return new free_busy_1.FreeBusyCalendar(cal).toJSON(true); })
: [];
return {
emails: options.emails,
duration_minutes: options.duration,
interval_minutes: options.interval,
start_time: options.startTime,
end_time: options.endTime,
buffer: options.buffer,
tentative_busy: options.tentativeBusy,
free_busy: freeBusyJson,
open_hours: openHoursJson,
calendars: calendarsJson,
};
};
// Helper function to check if a query is valid
CalendarRestfulModelCollection.prototype.queryIsValid = function (query) {
if ((!query.emails || query.emails.length == 0) &&
(!query.calendars || query.calendars.length == 0)) {
throw new Error("Must set either 'emails' or 'calendars' in the query.");
}
return true;
};
return CalendarRestfulModelCollection;
}(restful_model_collection_1.default));
exports.default = CalendarRestfulModelCollection;
import RestfulModel, { SaveCallback } from './restful-model';
import { GetCallback } from './model-collection';
import { Attribute } from './attributes';
import NylasConnection from '../nylas-connection';

@@ -24,2 +25,4 @@ import JobStatus from './job-status';

metadata?: object;
static collectionName: string;
static attributes: Record<string, Attribute>;
constructor(connection: NylasConnection, props?: CalendarProperties);

@@ -26,0 +29,0 @@ save(params?: {} | SaveCallback, callback?: SaveCallback): Promise<this>;

@@ -67,28 +67,28 @@ "use strict";

};
Calendar.collectionName = 'calendars';
Calendar.attributes = __assign(__assign({}, restful_model_1.default.attributes), { name: attributes_1.default.String({
modelKey: 'name',
}), description: attributes_1.default.String({
modelKey: 'description',
}), readOnly: attributes_1.default.Boolean({
modelKey: 'readOnly',
jsonKey: 'read_only',
readOnly: true,
}), location: attributes_1.default.String({
modelKey: 'location',
}), timezone: attributes_1.default.String({
modelKey: 'timezone',
}), isPrimary: attributes_1.default.Boolean({
modelKey: 'isPrimary',
jsonKey: 'is_primary',
readOnly: true,
}), jobStatusId: attributes_1.default.String({
modelKey: 'jobStatusId',
jsonKey: 'job_status_id',
readOnly: true,
}), metadata: attributes_1.default.Object({
modelKey: 'metadata',
}) });
return Calendar;
}(restful_model_1.default));
exports.default = Calendar;
Calendar.collectionName = 'calendars';
Calendar.attributes = __assign(__assign({}, restful_model_1.default.attributes), { name: attributes_1.default.String({
modelKey: 'name',
}), description: attributes_1.default.String({
modelKey: 'description',
}), readOnly: attributes_1.default.Boolean({
modelKey: 'readOnly',
jsonKey: 'read_only',
readOnly: true,
}), location: attributes_1.default.String({
modelKey: 'location',
}), timezone: attributes_1.default.String({
modelKey: 'timezone',
}), isPrimary: attributes_1.default.Boolean({
modelKey: 'isPrimary',
jsonKey: 'is_primary',
readOnly: true,
}), jobStatusId: attributes_1.default.String({
modelKey: 'jobStatusId',
jsonKey: 'job_status_id',
readOnly: true,
}), metadata: attributes_1.default.Object({
modelKey: 'metadata',
}) });
import RestfulModel, { SaveCallback } from './restful-model';
import { Attribute } from './attributes';
import NylasConnection from '../nylas-connection';

@@ -30,2 +31,4 @@ export declare type ComponentProperties = {

updatedAt?: Date;
static collectionName: string;
static attributes: Record<string, Attribute>;
constructor(connection: NylasConnection, props?: ComponentProperties);

@@ -32,0 +35,0 @@ saveEndpoint(): string;

@@ -56,37 +56,37 @@ "use strict";

};
Component.collectionName = 'component';
Component.attributes = __assign(__assign({}, restful_model_1.default.attributes), { name: attributes_1.default.String({
modelKey: 'name',
}), type: attributes_1.default.String({
modelKey: 'type',
}), action: attributes_1.default.Number({
modelKey: 'action',
}), active: attributes_1.default.Boolean({
modelKey: 'active',
}), settings: attributes_1.default.Object({
modelKey: 'settings',
}), allowedDomains: attributes_1.default.StringList({
modelKey: 'allowedDomains',
jsonKey: 'allowed_domains',
}), publicAccountId: attributes_1.default.String({
modelKey: 'publicAccountId',
jsonKey: 'public_account_id',
}), publicTokenId: attributes_1.default.String({
modelKey: 'publicTokenId',
jsonKey: 'public_token_id',
}), publicApplicationId: attributes_1.default.String({
modelKey: 'publicApplicationId',
jsonKey: 'public_application_id',
}), accessToken: attributes_1.default.String({
modelKey: 'accessToken',
jsonKey: 'access_token',
}), createdAt: attributes_1.default.Date({
modelKey: 'createdAt',
jsonKey: 'created_at',
}), updatedAt: attributes_1.default.Date({
modelKey: 'updatedAt',
jsonKey: 'updated_at',
}) });
return Component;
}(restful_model_1.default));
exports.default = Component;
Component.collectionName = 'component';
Component.attributes = __assign(__assign({}, restful_model_1.default.attributes), { name: attributes_1.default.String({
modelKey: 'name',
}), type: attributes_1.default.String({
modelKey: 'type',
}), action: attributes_1.default.Number({
modelKey: 'action',
}), active: attributes_1.default.Boolean({
modelKey: 'active',
}), settings: attributes_1.default.Object({
modelKey: 'settings',
}), allowedDomains: attributes_1.default.StringList({
modelKey: 'allowedDomains',
jsonKey: 'allowed_domains',
}), publicAccountId: attributes_1.default.String({
modelKey: 'publicAccountId',
jsonKey: 'public_account_id',
}), publicTokenId: attributes_1.default.String({
modelKey: 'publicTokenId',
jsonKey: 'public_token_id',
}), publicApplicationId: attributes_1.default.String({
modelKey: 'publicApplicationId',
jsonKey: 'public_application_id',
}), accessToken: attributes_1.default.String({
modelKey: 'accessToken',
jsonKey: 'access_token',
}), createdAt: attributes_1.default.Date({
modelKey: 'createdAt',
jsonKey: 'created_at',
}), updatedAt: attributes_1.default.Date({
modelKey: 'updatedAt',
jsonKey: 'updated_at',
}) });
import NylasConnection from '../nylas-connection';
import Model from './model';
import { Attribute } from './attributes';
import Account from './account';

@@ -32,2 +33,3 @@ export declare enum Scope {

clientId?: string;
static attributes: Record<string, Attribute>;
constructor(props?: VirtualCalendarProperties);

@@ -60,2 +62,3 @@ }

clientId?: string;
static attributes: Record<string, Attribute>;
constructor(props?: NativeAuthenticationProperties);

@@ -62,0 +65,0 @@ toJSON(): Record<string, unknown>;

@@ -49,28 +49,28 @@ "use strict";

}
VirtualCalendar.attributes = {
provider: attributes_1.default.String({
modelKey: 'provider',
}),
clientId: attributes_1.default.String({
modelKey: 'clientId',
jsonKey: 'client_id',
}),
emailAddress: attributes_1.default.String({
modelKey: 'emailAddress',
jsonKey: 'email',
}),
name: attributes_1.default.String({
modelKey: 'name',
}),
scopes: attributes_1.default.EnumList({
modelKey: 'scopes',
itemClass: Scope,
}),
settings: attributes_1.default.Object({
modelKey: 'settings',
}),
};
return VirtualCalendar;
}(model_1.default));
exports.VirtualCalendar = VirtualCalendar;
VirtualCalendar.attributes = {
provider: attributes_1.default.String({
modelKey: 'provider',
}),
clientId: attributes_1.default.String({
modelKey: 'clientId',
jsonKey: 'client_id',
}),
emailAddress: attributes_1.default.String({
modelKey: 'emailAddress',
jsonKey: 'email',
}),
name: attributes_1.default.String({
modelKey: 'name',
}),
scopes: attributes_1.default.EnumList({
modelKey: 'scopes',
itemClass: Scope,
}),
settings: attributes_1.default.Object({
modelKey: 'settings',
}),
};
var NativeAuthenticationProvider;

@@ -111,29 +111,29 @@ (function (NativeAuthenticationProvider) {

};
NativeAuthentication.attributes = {
clientId: attributes_1.default.String({
modelKey: 'clientId',
jsonKey: 'client_id',
}),
name: attributes_1.default.String({
modelKey: 'name',
}),
emailAddress: attributes_1.default.String({
modelKey: 'emailAddress',
jsonKey: 'email_address',
}),
provider: attributes_1.default.Enum({
modelKey: 'provider',
itemClass: NativeAuthenticationProvider,
}),
scopes: attributes_1.default.EnumList({
modelKey: 'scopes',
itemClass: Scope,
}),
settings: attributes_1.default.Object({
modelKey: 'settings',
}),
};
return NativeAuthentication;
}(model_1.default));
exports.NativeAuthentication = NativeAuthentication;
NativeAuthentication.attributes = {
clientId: attributes_1.default.String({
modelKey: 'clientId',
jsonKey: 'client_id',
}),
name: attributes_1.default.String({
modelKey: 'name',
}),
emailAddress: attributes_1.default.String({
modelKey: 'emailAddress',
jsonKey: 'email_address',
}),
provider: attributes_1.default.Enum({
modelKey: 'provider',
itemClass: NativeAuthenticationProvider,
}),
scopes: attributes_1.default.EnumList({
modelKey: 'scopes',
itemClass: Scope,
}),
settings: attributes_1.default.Object({
modelKey: 'settings',
}),
};
var Connect = /** @class */ (function () {

@@ -140,0 +140,0 @@ function Connect(connection, clientId, clientSecret) {

import RestfulModel, { SaveCallback } from './restful-model';
import { Attribute } from './attributes';
import Model from './model';

@@ -11,2 +12,3 @@ import NylasConnection from '../nylas-connection';

email: string;
static attributes: Record<string, Attribute>;
constructor(props?: EmailAddressProperties);

@@ -21,2 +23,3 @@ }

imAddress: string;
static attributes: Record<string, Attribute>;
constructor(props?: IMAddressProperties);

@@ -43,2 +46,3 @@ }

address: string;
static attributes: Record<string, Attribute>;
constructor(props?: PhysicalAddressProperties);

@@ -54,2 +58,3 @@ toJSON(): Record<string, string>;

number: string;
static attributes: Record<string, Attribute>;
constructor(props?: PhoneNumberProperties);

@@ -64,2 +69,3 @@ }

url: string;
static attributes: Record<string, Attribute>;
constructor(props?: WebPageProperties);

@@ -80,2 +86,3 @@ }

object?: string;
static attributes: Record<string, Attribute>;
constructor(props?: GroupProperties);

@@ -123,2 +130,4 @@ }

jobStatusId?: string;
static collectionName: string;
static attributes: Record<string, Attribute>;
constructor(connection: NylasConnection, props?: ContactProperties);

@@ -125,0 +134,0 @@ getPicture(params?: Record<string, any>, callback?: (error: Error | null, result?: any) => void): any;

@@ -42,13 +42,13 @@ "use strict";

}
EmailAddress.attributes = {
type: attributes_1.default.String({
modelKey: 'type',
}),
email: attributes_1.default.String({
modelKey: 'email',
}),
};
return EmailAddress;
}(model_1.default));
exports.EmailAddress = EmailAddress;
EmailAddress.attributes = {
type: attributes_1.default.String({
modelKey: 'type',
}),
email: attributes_1.default.String({
modelKey: 'email',
}),
};
var IMAddress = /** @class */ (function (_super) {

@@ -63,14 +63,14 @@ __extends(IMAddress, _super);

}
IMAddress.attributes = {
type: attributes_1.default.String({
modelKey: 'type',
}),
imAddress: attributes_1.default.String({
modelKey: 'imAddress',
jsonKey: 'im_address',
}),
};
return IMAddress;
}(model_1.default));
exports.IMAddress = IMAddress;
IMAddress.attributes = {
type: attributes_1.default.String({
modelKey: 'type',
}),
imAddress: attributes_1.default.String({
modelKey: 'imAddress',
jsonKey: 'im_address',
}),
};
var PhysicalAddress = /** @class */ (function (_super) {

@@ -108,33 +108,33 @@ __extends(PhysicalAddress, _super);

};
PhysicalAddress.attributes = {
type: attributes_1.default.String({
modelKey: 'type',
}),
format: attributes_1.default.String({
modelKey: 'format',
}),
address: attributes_1.default.String({
modelKey: 'address',
}),
streetAddress: attributes_1.default.String({
modelKey: 'streetAddress',
jsonKey: 'street_address',
}),
city: attributes_1.default.String({
modelKey: 'city',
}),
postalCode: attributes_1.default.String({
modelKey: 'postalCode',
jsonKey: 'postal_code',
}),
state: attributes_1.default.String({
modelKey: 'state',
}),
country: attributes_1.default.String({
modelKey: 'country',
}),
};
return PhysicalAddress;
}(model_1.default));
exports.PhysicalAddress = PhysicalAddress;
PhysicalAddress.attributes = {
type: attributes_1.default.String({
modelKey: 'type',
}),
format: attributes_1.default.String({
modelKey: 'format',
}),
address: attributes_1.default.String({
modelKey: 'address',
}),
streetAddress: attributes_1.default.String({
modelKey: 'streetAddress',
jsonKey: 'street_address',
}),
city: attributes_1.default.String({
modelKey: 'city',
}),
postalCode: attributes_1.default.String({
modelKey: 'postalCode',
jsonKey: 'postal_code',
}),
state: attributes_1.default.String({
modelKey: 'state',
}),
country: attributes_1.default.String({
modelKey: 'country',
}),
};
var PhoneNumber = /** @class */ (function (_super) {

@@ -149,13 +149,13 @@ __extends(PhoneNumber, _super);

}
PhoneNumber.attributes = {
type: attributes_1.default.String({
modelKey: 'type',
}),
number: attributes_1.default.String({
modelKey: 'number',
}),
};
return PhoneNumber;
}(model_1.default));
exports.PhoneNumber = PhoneNumber;
PhoneNumber.attributes = {
type: attributes_1.default.String({
modelKey: 'type',
}),
number: attributes_1.default.String({
modelKey: 'number',
}),
};
var WebPage = /** @class */ (function (_super) {

@@ -170,13 +170,13 @@ __extends(WebPage, _super);

}
WebPage.attributes = {
type: attributes_1.default.String({
modelKey: 'type',
}),
url: attributes_1.default.String({
modelKey: 'url',
}),
};
return WebPage;
}(model_1.default));
exports.WebPage = WebPage;
WebPage.attributes = {
type: attributes_1.default.String({
modelKey: 'type',
}),
url: attributes_1.default.String({
modelKey: 'url',
}),
};
var Group = /** @class */ (function (_super) {

@@ -191,26 +191,26 @@ __extends(Group, _super);

}
Group.attributes = {
name: attributes_1.default.String({
modelKey: 'name',
}),
path: attributes_1.default.String({
modelKey: 'path',
}),
id: attributes_1.default.String({
modelKey: 'id',
readOnly: true,
}),
object: attributes_1.default.String({
modelKey: 'object',
readOnly: true,
}),
accountId: attributes_1.default.String({
modelKey: 'accountId',
jsonKey: 'account_id',
readOnly: true,
}),
};
return Group;
}(model_1.default));
exports.Group = Group;
Group.attributes = {
name: attributes_1.default.String({
modelKey: 'name',
}),
path: attributes_1.default.String({
modelKey: 'path',
}),
id: attributes_1.default.String({
modelKey: 'id',
readOnly: true,
}),
object: attributes_1.default.String({
modelKey: 'object',
readOnly: true,
}),
accountId: attributes_1.default.String({
modelKey: 'accountId',
jsonKey: 'account_id',
readOnly: true,
}),
};
var Contact = /** @class */ (function (_super) {

@@ -231,66 +231,66 @@ __extends(Contact, _super);

};
Contact.collectionName = 'contacts';
Contact.attributes = __assign(__assign({}, restful_model_1.default.attributes), { givenName: attributes_1.default.String({
modelKey: 'givenName',
jsonKey: 'given_name',
}), middleName: attributes_1.default.String({
modelKey: 'middleName',
jsonKey: 'middle_name',
}), surname: attributes_1.default.String({
modelKey: 'surname',
}), suffix: attributes_1.default.String({
modelKey: 'suffix',
}), nickname: attributes_1.default.String({
modelKey: 'nickname',
}), birthday: attributes_1.default.String({
modelKey: 'birthday',
}), companyName: attributes_1.default.String({
modelKey: 'companyName',
jsonKey: 'company_name',
}), jobTitle: attributes_1.default.String({
modelKey: 'jobTitle',
jsonKey: 'job_title',
}), managerName: attributes_1.default.String({
modelKey: 'managerName',
jsonKey: 'manager_name',
}), officeLocation: attributes_1.default.String({
modelKey: 'officeLocation',
jsonKey: 'office_location',
}), notes: attributes_1.default.String({
modelKey: 'notes',
}), pictureUrl: attributes_1.default.String({
modelKey: 'pictureUrl',
jsonKey: 'picture_url',
}), emailAddresses: attributes_1.default.Collection({
modelKey: 'emailAddresses',
jsonKey: 'emails',
itemClass: EmailAddress,
}), imAddresses: attributes_1.default.Collection({
modelKey: 'imAddresses',
jsonKey: 'im_addresses',
itemClass: IMAddress,
}), physicalAddresses: attributes_1.default.Collection({
modelKey: 'physicalAddresses',
jsonKey: 'physical_addresses',
itemClass: PhysicalAddress,
}), phoneNumbers: attributes_1.default.Collection({
modelKey: 'phoneNumbers',
jsonKey: 'phone_numbers',
itemClass: PhoneNumber,
}), webPages: attributes_1.default.Collection({
modelKey: 'webPages',
jsonKey: 'web_pages',
itemClass: WebPage,
}), groups: attributes_1.default.Collection({
modelKey: 'groups',
itemClass: Group,
}), source: attributes_1.default.String({
modelKey: 'source',
}), jobStatusId: attributes_1.default.String({
modelKey: 'jobStatusId',
jsonKey: 'job_status_id',
readOnly: true,
}) });
return Contact;
}(restful_model_1.default));
exports.default = Contact;
Contact.collectionName = 'contacts';
Contact.attributes = __assign(__assign({}, restful_model_1.default.attributes), { givenName: attributes_1.default.String({
modelKey: 'givenName',
jsonKey: 'given_name',
}), middleName: attributes_1.default.String({
modelKey: 'middleName',
jsonKey: 'middle_name',
}), surname: attributes_1.default.String({
modelKey: 'surname',
}), suffix: attributes_1.default.String({
modelKey: 'suffix',
}), nickname: attributes_1.default.String({
modelKey: 'nickname',
}), birthday: attributes_1.default.String({
modelKey: 'birthday',
}), companyName: attributes_1.default.String({
modelKey: 'companyName',
jsonKey: 'company_name',
}), jobTitle: attributes_1.default.String({
modelKey: 'jobTitle',
jsonKey: 'job_title',
}), managerName: attributes_1.default.String({
modelKey: 'managerName',
jsonKey: 'manager_name',
}), officeLocation: attributes_1.default.String({
modelKey: 'officeLocation',
jsonKey: 'office_location',
}), notes: attributes_1.default.String({
modelKey: 'notes',
}), pictureUrl: attributes_1.default.String({
modelKey: 'pictureUrl',
jsonKey: 'picture_url',
}), emailAddresses: attributes_1.default.Collection({
modelKey: 'emailAddresses',
jsonKey: 'emails',
itemClass: EmailAddress,
}), imAddresses: attributes_1.default.Collection({
modelKey: 'imAddresses',
jsonKey: 'im_addresses',
itemClass: IMAddress,
}), physicalAddresses: attributes_1.default.Collection({
modelKey: 'physicalAddresses',
jsonKey: 'physical_addresses',
itemClass: PhysicalAddress,
}), phoneNumbers: attributes_1.default.Collection({
modelKey: 'phoneNumbers',
jsonKey: 'phone_numbers',
itemClass: PhoneNumber,
}), webPages: attributes_1.default.Collection({
modelKey: 'webPages',
jsonKey: 'web_pages',
itemClass: WebPage,
}), groups: attributes_1.default.Collection({
modelKey: 'groups',
itemClass: Group,
}), source: attributes_1.default.String({
modelKey: 'source',
}), jobStatusId: attributes_1.default.String({
modelKey: 'jobStatusId',
jsonKey: 'job_status_id',
readOnly: true,
}) });
import Message, { MessageProperties } from './message';
import { Attribute } from './attributes';
import { SaveCallback } from './restful-model';

@@ -14,2 +15,4 @@ import NylasConnection from '../nylas-connection';

version?: number;
static collectionName: string;
static attributes: Record<string, Attribute>;
constructor(connection: NylasConnection, props?: DraftProperties);

@@ -16,0 +19,0 @@ toJSON(enforceReadOnly?: boolean): Record<string, any>;

@@ -134,14 +134,14 @@ "use strict";

};
Draft.collectionName = 'drafts';
Draft.attributes = __assign(__assign({}, message_1.default.attributes), { version: attributes_1.default.Number({
modelKey: 'version',
}), replyToMessageId: attributes_1.default.String({
modelKey: 'replyToMessageId',
jsonKey: 'reply_to_message_id',
}), rawMime: attributes_1.default.String({
modelKey: 'rawMime',
readOnly: true,
}) });
return Draft;
}(message_1.default));
exports.default = Draft;
Draft.collectionName = 'drafts';
Draft.attributes = __assign(__assign({}, message_1.default.attributes), { version: attributes_1.default.Number({
modelKey: 'version',
}), replyToMessageId: attributes_1.default.String({
modelKey: 'replyToMessageId',
jsonKey: 'reply_to_message_id',
}), rawMime: attributes_1.default.String({
modelKey: 'rawMime',
readOnly: true,
}) });

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

import { Attribute } from './attributes';
import Model from './model';

@@ -9,4 +10,5 @@ export declare type EmailParticipantProperties = {

name?: string;
static attributes: Record<string, Attribute>;
constructor(props?: EmailParticipantProperties);
toJSON(): Record<string, unknown>;
}

@@ -36,12 +36,12 @@ "use strict";

};
EmailParticipant.attributes = {
name: attributes_1.default.String({
modelKey: 'name',
}),
email: attributes_1.default.String({
modelKey: 'email',
}),
};
return EmailParticipant;
}(model_1.default));
exports.default = EmailParticipant;
EmailParticipant.attributes = {
name: attributes_1.default.String({
modelKey: 'name',
}),
email: attributes_1.default.String({
modelKey: 'email',
}),
};

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

import { Attribute } from './attributes';
import Model from './model';

@@ -15,2 +16,3 @@ export declare type EventConferencingDetailsProperties = {

url?: string;
static attributes: Record<string, Attribute>;
constructor(props?: EventConferencingProperties);

@@ -31,3 +33,4 @@ }

};
static attributes: Record<string, Attribute>;
constructor(props?: EventConferencingProperties);
}

@@ -28,23 +28,23 @@ "use strict";

}
EventConferencingDetails.attributes = {
meetingCode: attributes_1.default.String({
modelKey: 'meetingCode',
jsonKey: 'meeting_code',
}),
phone: attributes_1.default.StringList({
modelKey: 'phone',
}),
password: attributes_1.default.String({
modelKey: 'password',
}),
pin: attributes_1.default.String({
modelKey: 'pin',
}),
url: attributes_1.default.String({
modelKey: 'url',
}),
};
return EventConferencingDetails;
}(model_1.default));
exports.EventConferencingDetails = EventConferencingDetails;
EventConferencingDetails.attributes = {
meetingCode: attributes_1.default.String({
modelKey: 'meetingCode',
jsonKey: 'meeting_code',
}),
phone: attributes_1.default.StringList({
modelKey: 'phone',
}),
password: attributes_1.default.String({
modelKey: 'password',
}),
pin: attributes_1.default.String({
modelKey: 'pin',
}),
url: attributes_1.default.String({
modelKey: 'url',
}),
};
var EventConferencing = /** @class */ (function (_super) {

@@ -58,16 +58,16 @@ __extends(EventConferencing, _super);

}
EventConferencing.attributes = {
details: attributes_1.default.Object({
modelKey: 'details',
itemClass: EventConferencingDetails,
}),
provider: attributes_1.default.String({
modelKey: 'provider',
}),
autocreate: attributes_1.default.Object({
modelKey: 'autocreate',
}),
};
return EventConferencing;
}(model_1.default));
exports.default = EventConferencing;
EventConferencing.attributes = {
details: attributes_1.default.Object({
modelKey: 'details',
itemClass: EventConferencingDetails,
}),
provider: attributes_1.default.String({
modelKey: 'provider',
}),
autocreate: attributes_1.default.Object({
modelKey: 'autocreate',
}),
};

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

import { Attribute } from './attributes';
import Model from './model';

@@ -24,3 +25,4 @@ export declare enum EventNotificationType {

message?: string;
static attributes: Record<string, Attribute>;
constructor(props?: EventNotificationProperties);
}

@@ -36,28 +36,28 @@ "use strict";

}
EventNotification.attributes = {
type: attributes_1.default.String({
modelKey: 'type',
}),
minutesBeforeEvent: attributes_1.default.Number({
modelKey: 'minutesBeforeEvent',
jsonKey: 'minutes_before_event',
}),
url: attributes_1.default.String({
modelKey: 'url',
}),
payload: attributes_1.default.String({
modelKey: 'payload',
}),
subject: attributes_1.default.String({
modelKey: 'subject',
}),
body: attributes_1.default.String({
modelKey: 'body',
}),
message: attributes_1.default.String({
modelKey: 'message',
}),
};
return EventNotification;
}(model_1.default));
exports.default = EventNotification;
EventNotification.attributes = {
type: attributes_1.default.String({
modelKey: 'type',
}),
minutesBeforeEvent: attributes_1.default.Number({
modelKey: 'minutesBeforeEvent',
jsonKey: 'minutes_before_event',
}),
url: attributes_1.default.String({
modelKey: 'url',
}),
payload: attributes_1.default.String({
modelKey: 'payload',
}),
subject: attributes_1.default.String({
modelKey: 'subject',
}),
body: attributes_1.default.String({
modelKey: 'body',
}),
message: attributes_1.default.String({
modelKey: 'message',
}),
};

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

import { Attribute } from './attributes';
import Model from './model';

@@ -5,2 +6,4 @@ export declare type EventParticipantProperties = {

name?: string;
comment?: string;
phoneNumber?: string;
status?: string;

@@ -11,5 +14,8 @@ };

name?: string;
comment?: string;
phoneNumber?: string;
status?: string;
static attributes: Record<string, Attribute>;
constructor(props?: EventParticipantProperties);
toJSON(enforceReadOnly?: boolean): Record<string, string>;
}

@@ -36,16 +36,23 @@ "use strict";

};
EventParticipant.attributes = {
name: attributes_1.default.String({
modelKey: 'name',
}),
email: attributes_1.default.String({
modelKey: 'email',
}),
comment: attributes_1.default.String({
modelKey: 'comment',
}),
phoneNumber: attributes_1.default.String({
modelKey: 'phoneNumber',
jsonKey: 'phone_number',
}),
status: attributes_1.default.String({
modelKey: 'status',
readOnly: true,
}),
};
return EventParticipant;
}(model_1.default));
exports.default = EventParticipant;
EventParticipant.attributes = {
name: attributes_1.default.String({
modelKey: 'name',
}),
email: attributes_1.default.String({
modelKey: 'email',
}),
status: attributes_1.default.String({
modelKey: 'status',
readOnly: true,
}),
};
import RestfulModel, { SaveCallback } from './restful-model';
import { Attribute } from './attributes';
import EventParticipant, { EventParticipantProperties } from './event-participant';

@@ -7,2 +8,15 @@ import EventConferencing, { EventConferencingProperties } from './event-conferencing';

import EventNotification, { EventNotificationProperties } from './event-notification';
export declare enum ICSMethod {
Request = "request",
Publish = "publish",
Reply = "reply",
Add = "add",
Cancel = "cancel",
Refresh = "refresh"
}
export declare type ICSOptions = {
iCalUID?: string;
prodId?: string;
method?: ICSMethod;
};
export declare type EventProperties = {

@@ -55,2 +69,4 @@ calendarId: string;

jobStatusId?: string;
static collectionName: string;
static attributes: Record<string, Attribute>;
constructor(connection: NylasConnection, props?: EventProperties);

@@ -65,2 +81,3 @@ get start(): string | number | undefined;

rsvp(status: string, comment: string, callback?: (error: Error | null, data?: Event) => void): Promise<Event>;
generateICS(options?: ICSOptions): Promise<string>;
}

@@ -36,2 +36,11 @@ "use strict";

var event_notification_1 = __importDefault(require("./event-notification"));
var ICSMethod;
(function (ICSMethod) {
ICSMethod["Request"] = "request";
ICSMethod["Publish"] = "publish";
ICSMethod["Reply"] = "reply";
ICSMethod["Add"] = "add";
ICSMethod["Cancel"] = "cancel";
ICSMethod["Refresh"] = "refresh";
})(ICSMethod = exports.ICSMethod || (exports.ICSMethod = {}));
var Event = /** @class */ (function (_super) {

@@ -139,5 +148,2 @@ __extends(Event, _super);

var json = _super.prototype.saveRequestBody.call(this);
if (json.when && json.when.object) {
delete json.when.object;
}
if (!this.notifications) {

@@ -170,62 +176,87 @@ delete json.notifications;

};
Event.prototype.generateICS = function (options) {
if (this.calendarId == '' || !this.when.isSet()) {
throw new Error('Cannot generate an ICS file for an event without a Calendar ID or when set');
}
var optionsPayload = {};
if (options) {
optionsPayload = {
ical_uid: options.iCalUID,
prodid: options.prodId,
method: options.method,
};
}
return this.connection
.request({
method: 'POST',
body: __assign(__assign({}, this.saveRequestBody()), { ics_options: optionsPayload }),
path: '/events/to-ics',
})
.then(function (response) {
if (!response.ics) {
throw new Error("Unexpected response from the API server. Returned 200 but no 'ics' string found.");
}
return response.ics;
});
};
Event.collectionName = 'events';
Event.attributes = __assign(__assign({}, restful_model_1.default.attributes), { calendarId: attributes_1.default.String({
modelKey: 'calendarId',
jsonKey: 'calendar_id',
}), iCalUID: attributes_1.default.String({
modelKey: 'iCalUID',
jsonKey: 'ical_uid',
readOnly: true,
}), messageId: attributes_1.default.String({
modelKey: 'messageId',
jsonKey: 'message_id',
readOnly: true,
}), title: attributes_1.default.String({
modelKey: 'title',
}), description: attributes_1.default.String({
modelKey: 'description',
}), owner: attributes_1.default.String({
modelKey: 'owner',
readOnly: true,
}), participants: attributes_1.default.Collection({
modelKey: 'participants',
itemClass: event_participant_1.default,
}), readOnly: attributes_1.default.Boolean({
modelKey: 'readOnly',
jsonKey: 'read_only',
}), location: attributes_1.default.String({
modelKey: 'location',
}), when: attributes_1.default.Object({
modelKey: 'when',
itemClass: when_1.default,
}), busy: attributes_1.default.Boolean({
modelKey: 'busy',
}), status: attributes_1.default.String({
modelKey: 'status',
readOnly: true,
}), recurrence: attributes_1.default.Object({
modelKey: 'recurrence',
}), masterEventId: attributes_1.default.String({
modelKey: 'masterEventId',
jsonKey: 'master_event_id',
readOnly: true,
}), originalStartTime: attributes_1.default.DateTime({
modelKey: 'originalStartTime',
jsonKey: 'original_start_time',
readOnly: true,
}), conferencing: attributes_1.default.Object({
modelKey: 'conferencing',
itemClass: event_conferencing_1.default,
}), notifications: attributes_1.default.Collection({
modelKey: 'notifications',
itemClass: event_notification_1.default,
}), metadata: attributes_1.default.Object({
modelKey: 'metadata',
}), jobStatusId: attributes_1.default.String({
modelKey: 'jobStatusId',
jsonKey: 'job_status_id',
readOnly: true,
}) });
return Event;
}(restful_model_1.default));
exports.default = Event;
Event.collectionName = 'events';
Event.attributes = __assign(__assign({}, restful_model_1.default.attributes), { calendarId: attributes_1.default.String({
modelKey: 'calendarId',
jsonKey: 'calendar_id',
}), iCalUID: attributes_1.default.String({
modelKey: 'iCalUID',
jsonKey: 'ical_uid',
readOnly: true,
}), messageId: attributes_1.default.String({
modelKey: 'messageId',
jsonKey: 'message_id',
readOnly: true,
}), title: attributes_1.default.String({
modelKey: 'title',
}), description: attributes_1.default.String({
modelKey: 'description',
}), owner: attributes_1.default.String({
modelKey: 'owner',
readOnly: true,
}), participants: attributes_1.default.Collection({
modelKey: 'participants',
itemClass: event_participant_1.default,
}), readOnly: attributes_1.default.Boolean({
modelKey: 'readOnly',
jsonKey: 'read_only',
}), location: attributes_1.default.String({
modelKey: 'location',
}), when: attributes_1.default.Object({
modelKey: 'when',
itemClass: when_1.default,
}), busy: attributes_1.default.Boolean({
modelKey: 'busy',
}), status: attributes_1.default.String({
modelKey: 'status',
readOnly: true,
}), recurrence: attributes_1.default.Object({
modelKey: 'recurrence',
}), masterEventId: attributes_1.default.String({
modelKey: 'masterEventId',
jsonKey: 'master_event_id',
readOnly: true,
}), originalStartTime: attributes_1.default.DateTime({
modelKey: 'originalStartTime',
jsonKey: 'original_start_time',
readOnly: true,
}), conferencing: attributes_1.default.Object({
modelKey: 'conferencing',
itemClass: event_conferencing_1.default,
}), notifications: attributes_1.default.Collection({
modelKey: 'notifications',
itemClass: event_notification_1.default,
}), metadata: attributes_1.default.Object({
modelKey: 'metadata',
}), jobStatusId: attributes_1.default.String({
modelKey: 'jobStatusId',
jsonKey: 'job_status_id',
readOnly: true,
}) });

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

import { Attribute } from './attributes';
import RestfulModel from './restful-model';

@@ -20,2 +21,4 @@ import NylasConnection from '../nylas-connection';

data?: unknown;
static collectionName: string;
static attributes: Record<string, Attribute>;
constructor(connection: NylasConnection, props?: FileProperties);

@@ -22,0 +25,0 @@ upload(callback?: (error: Error | null, model?: File) => void): Promise<File>;

@@ -113,25 +113,25 @@ "use strict";

};
File.collectionName = 'files';
File.attributes = __assign(__assign({}, restful_model_1.default.attributes), { contentType: attributes_1.default.String({
modelKey: 'contentType',
jsonKey: 'content_type',
}), size: attributes_1.default.Number({
modelKey: 'size',
}), filename: attributes_1.default.String({
modelKey: 'filename',
}), messageIds: attributes_1.default.StringList({
modelKey: 'messageIds',
jsonKey: 'message_ids',
}), contentId: attributes_1.default.String({
modelKey: 'contentId',
jsonKey: 'content_id',
}), contentDisposition: attributes_1.default.String({
modelKey: 'contentDisposition',
jsonKey: 'content_disposition',
}), data: attributes_1.default.Object({
modelKey: 'data',
readOnly: true,
}) });
return File;
}(restful_model_1.default));
exports.default = File;
File.collectionName = 'files';
File.attributes = __assign(__assign({}, restful_model_1.default.attributes), { contentType: attributes_1.default.String({
modelKey: 'contentType',
jsonKey: 'content_type',
}), size: attributes_1.default.Number({
modelKey: 'size',
}), filename: attributes_1.default.String({
modelKey: 'filename',
}), messageIds: attributes_1.default.StringList({
modelKey: 'messageIds',
jsonKey: 'message_ids',
}), contentId: attributes_1.default.String({
modelKey: 'contentId',
jsonKey: 'content_id',
}), contentDisposition: attributes_1.default.String({
modelKey: 'contentDisposition',
jsonKey: 'content_disposition',
}), data: attributes_1.default.Object({
modelKey: 'data',
readOnly: true,
}) });
import RestfulModel, { SaveCallback } from './restful-model';
import { Attribute } from './attributes';
import NylasConnection from '../nylas-connection';

@@ -11,2 +12,4 @@ export declare type FolderProperties = {

jobStatusId?: string;
static collectionName: string;
static attributes: Record<string, Attribute>;
constructor(connection: NylasConnection, props?: FolderProperties);

@@ -16,4 +19,5 @@ save(params?: {} | SaveCallback, callback?: SaveCallback): Promise<this>;

export declare class Label extends Folder {
static collectionName: string;
constructor(connection: NylasConnection, props?: FolderProperties);
saveRequestBody(): Record<string, any>;
}

@@ -43,17 +43,17 @@ "use strict";

};
Folder.collectionName = 'folders';
Folder.attributes = __assign(__assign({}, restful_model_1.default.attributes), { name: attributes_1.default.String({
modelKey: 'name',
jsonKey: 'name',
}), displayName: attributes_1.default.String({
modelKey: 'displayName',
jsonKey: 'display_name',
}), jobStatusId: attributes_1.default.String({
modelKey: 'jobStatusId',
jsonKey: 'job_status_id',
readOnly: true,
}) });
return Folder;
}(restful_model_1.default));
exports.default = Folder;
Folder.collectionName = 'folders';
Folder.attributes = __assign(__assign({}, restful_model_1.default.attributes), { name: attributes_1.default.String({
modelKey: 'name',
jsonKey: 'name',
}), displayName: attributes_1.default.String({
modelKey: 'displayName',
jsonKey: 'display_name',
}), jobStatusId: attributes_1.default.String({
modelKey: 'jobStatusId',
jsonKey: 'job_status_id',
readOnly: true,
}) });
var Label = /** @class */ (function (_super) {

@@ -67,5 +67,5 @@ __extends(Label, _super);

};
Label.collectionName = 'labels';
return Label;
}(Folder));
exports.Label = Label;
Label.collectionName = 'labels';
import Model from './model';
import { Attribute } from './attributes';
export declare type FreeBusyQuery = {
startTime: number;
endTime: number;
emails: string[];
emails?: string[];
calendars?: FreeBusyCalendarProperties[];
};
export declare type FreeBusyCalendarProperties = {
accountId: string;
calendarIds: string[];
};
export declare class FreeBusyCalendar extends Model implements FreeBusyCalendarProperties {
accountId: string;
calendarIds: string[];
static attributes: Record<string, Attribute>;
constructor(props?: FreeBusyCalendarProperties);
}
export declare type TimeSlotProperties = {

@@ -17,2 +29,3 @@ status: string;

endTime: number;
static attributes: Record<string, Attribute>;
constructor(props?: TimeSlotProperties);

@@ -28,3 +41,4 @@ }

timeSlots: TimeSlot[];
static attributes: Record<string, Attribute>;
constructor(props?: FreeBusyProperties);
}

@@ -21,2 +21,24 @@ "use strict";

var attributes_1 = __importDefault(require("./attributes"));
var FreeBusyCalendar = /** @class */ (function (_super) {
__extends(FreeBusyCalendar, _super);
function FreeBusyCalendar(props) {
var _this = _super.call(this) || this;
_this.accountId = '';
_this.calendarIds = [];
_this.initAttributes(props);
return _this;
}
FreeBusyCalendar.attributes = {
accountId: attributes_1.default.String({
modelKey: 'accountId',
jsonKey: 'account_id',
}),
calendarIds: attributes_1.default.StringList({
modelKey: 'calendarIds',
jsonKey: 'calendar_ids',
}),
};
return FreeBusyCalendar;
}(model_1.default));
exports.FreeBusyCalendar = FreeBusyCalendar;
var TimeSlot = /** @class */ (function (_super) {

@@ -33,21 +55,21 @@ __extends(TimeSlot, _super);

}
TimeSlot.attributes = {
object: attributes_1.default.String({
modelKey: 'object',
}),
status: attributes_1.default.String({
modelKey: 'status',
}),
startTime: attributes_1.default.Number({
modelKey: 'startTime',
jsonKey: 'start_time',
}),
endTime: attributes_1.default.Number({
modelKey: 'endTime',
jsonKey: 'end_time',
}),
};
return TimeSlot;
}(model_1.default));
exports.TimeSlot = TimeSlot;
TimeSlot.attributes = {
object: attributes_1.default.String({
modelKey: 'object',
}),
status: attributes_1.default.String({
modelKey: 'status',
}),
startTime: attributes_1.default.Number({
modelKey: 'startTime',
jsonKey: 'start_time',
}),
endTime: attributes_1.default.Number({
modelKey: 'endTime',
jsonKey: 'end_time',
}),
};
var FreeBusy = /** @class */ (function (_super) {

@@ -63,17 +85,17 @@ __extends(FreeBusy, _super);

}
FreeBusy.attributes = {
object: attributes_1.default.String({
modelKey: 'object',
}),
email: attributes_1.default.String({
modelKey: 'email',
}),
timeSlots: attributes_1.default.Collection({
modelKey: 'timeSlots',
jsonKey: 'time_slots',
itemClass: TimeSlot,
}),
};
return FreeBusy;
}(model_1.default));
exports.default = FreeBusy;
FreeBusy.attributes = {
object: attributes_1.default.String({
modelKey: 'object',
}),
email: attributes_1.default.String({
modelKey: 'email',
}),
timeSlots: attributes_1.default.Collection({
modelKey: 'timeSlots',
jsonKey: 'time_slots',
itemClass: TimeSlot,
}),
};
import RestfulModel from './restful-model';
import { Attribute } from './attributes';
import NylasConnection from '../nylas-connection';

@@ -17,4 +18,6 @@ import Message from './message';

originalData?: Message;
static collectionName: string;
static attributes: Record<string, Attribute>;
constructor(connection: NylasConnection, props?: JobStatusProperties);
isSuccessful(): boolean;
}

@@ -43,24 +43,24 @@ "use strict";

};
JobStatus.collectionName = 'job-statuses';
JobStatus.attributes = __assign(__assign({}, restful_model_1.default.attributes), { action: attributes_1.default.String({
modelKey: 'action',
readOnly: true,
}), createdAt: attributes_1.default.DateTime({
modelKey: 'createdAt',
jsonKey: 'created_at',
readOnly: true,
}), jobStatusId: attributes_1.default.String({
modelKey: 'jobStatusId',
jsonKey: 'job_status_id',
readOnly: true,
}), status: attributes_1.default.String({
modelKey: 'status',
readOnly: true,
}), originalData: attributes_1.default.Object({
modelKey: 'originalData',
jsonKey: 'original_data',
readOnly: true,
}) });
return JobStatus;
}(restful_model_1.default));
exports.default = JobStatus;
JobStatus.collectionName = 'job-statuses';
JobStatus.attributes = __assign(__assign({}, restful_model_1.default.attributes), { action: attributes_1.default.String({
modelKey: 'action',
readOnly: true,
}), createdAt: attributes_1.default.DateTime({
modelKey: 'createdAt',
jsonKey: 'created_at',
readOnly: true,
}), jobStatusId: attributes_1.default.String({
modelKey: 'jobStatusId',
jsonKey: 'job_status_id',
readOnly: true,
}), status: attributes_1.default.String({
modelKey: 'status',
readOnly: true,
}), originalData: attributes_1.default.Object({
modelKey: 'originalData',
jsonKey: 'original_data',
readOnly: true,
}) });
import ManagementModel from './management-model';
import { Attribute } from './attributes';
import NylasConnection from '../nylas-connection';

@@ -12,2 +13,3 @@ import Model from './model';

updatedAt: number;
static attributes: Record<string, Attribute>;
constructor(props?: ApplicationIPAddressesProperties);

@@ -26,2 +28,3 @@ }

updatedAt: number;
static attributes: Record<string, Attribute>;
constructor(props?: AccountTokenInfoProperties);

@@ -49,2 +52,4 @@ }

metadata?: object;
static collectionName: string;
static attributes: Record<string, Attribute>;
constructor(connection: NylasConnection, clientId: string, props: ManagementAccountProperties);

@@ -51,0 +56,0 @@ upgrade(): Promise<AccountOperationResponse>;

@@ -42,15 +42,15 @@ "use strict";

}
ApplicationIPAddresses.attributes = {
ipAddresses: attributes_1.default.StringList({
modelKey: 'ipAddresses',
jsonKey: 'ip_addresses',
}),
updatedAt: attributes_1.default.Number({
modelKey: 'updatedAt',
jsonKey: 'updated_at',
}),
};
return ApplicationIPAddresses;
}(model_1.default));
exports.ApplicationIPAddresses = ApplicationIPAddresses;
ApplicationIPAddresses.attributes = {
ipAddresses: attributes_1.default.StringList({
modelKey: 'ipAddresses',
jsonKey: 'ip_addresses',
}),
updatedAt: attributes_1.default.Number({
modelKey: 'updatedAt',
jsonKey: 'updated_at',
}),
};
var AccountTokenInfo = /** @class */ (function (_super) {

@@ -67,21 +67,21 @@ __extends(AccountTokenInfo, _super);

}
AccountTokenInfo.attributes = {
scopes: attributes_1.default.String({
modelKey: 'scopes',
}),
state: attributes_1.default.String({
modelKey: 'state',
}),
createdAt: attributes_1.default.Number({
modelKey: 'createdAt',
jsonKey: 'created_at',
}),
updatedAt: attributes_1.default.Number({
modelKey: 'updatedAt',
jsonKey: 'updated_at',
}),
};
return AccountTokenInfo;
}(model_1.default));
exports.AccountTokenInfo = AccountTokenInfo;
AccountTokenInfo.attributes = {
scopes: attributes_1.default.String({
modelKey: 'scopes',
}),
state: attributes_1.default.String({
modelKey: 'state',
}),
createdAt: attributes_1.default.Number({
modelKey: 'createdAt',
jsonKey: 'created_at',
}),
updatedAt: attributes_1.default.Number({
modelKey: 'updatedAt',
jsonKey: 'updated_at',
}),
};
var ManagementAccount = /** @class */ (function (_super) {

@@ -163,24 +163,24 @@ __extends(ManagementAccount, _super);

};
ManagementAccount.collectionName = 'accounts';
ManagementAccount.attributes = __assign(__assign({}, management_model_1.default.attributes), { billingState: attributes_1.default.String({
modelKey: 'billingState',
jsonKey: 'billing_state',
}), emailAddress: attributes_1.default.String({
modelKey: 'emailAddress',
jsonKey: 'email',
}), namespaceId: attributes_1.default.String({
modelKey: 'namespaceId',
jsonKey: 'namespace_id',
}), provider: attributes_1.default.String({
modelKey: 'provider',
}), syncState: attributes_1.default.String({
modelKey: 'syncState',
jsonKey: 'sync_state',
}), trial: attributes_1.default.Boolean({
modelKey: 'trial',
}), metadata: attributes_1.default.Object({
modelKey: 'metadata',
}) });
return ManagementAccount;
}(management_model_1.default));
exports.default = ManagementAccount;
ManagementAccount.collectionName = 'accounts';
ManagementAccount.attributes = __assign(__assign({}, management_model_1.default.attributes), { billingState: attributes_1.default.String({
modelKey: 'billingState',
jsonKey: 'billing_state',
}), emailAddress: attributes_1.default.String({
modelKey: 'emailAddress',
jsonKey: 'email',
}), namespaceId: attributes_1.default.String({
modelKey: 'namespaceId',
jsonKey: 'namespace_id',
}), provider: attributes_1.default.String({
modelKey: 'provider',
}), syncState: attributes_1.default.String({
modelKey: 'syncState',
jsonKey: 'sync_state',
}), trial: attributes_1.default.Boolean({
modelKey: 'trial',
}), metadata: attributes_1.default.Object({
modelKey: 'metadata',
}) });
import RestfulModel from './restful-model';
import { Attribute } from './attributes';
import File, { FileProperties } from './file';

@@ -48,2 +49,4 @@ import Event, { EventProperties } from './event';

jobStatusId?: string;
static collectionName: string;
static attributes: Record<string, Attribute>;
constructor(connection: NylasConnection, props?: MessageProperties);

@@ -50,0 +53,0 @@ participants(): EmailParticipant[];

@@ -109,58 +109,58 @@ "use strict";

};
Message.collectionName = 'messages';
Message.attributes = __assign(__assign({}, restful_model_1.default.attributes), { subject: attributes_1.default.String({
modelKey: 'subject',
}), from: attributes_1.default.Collection({
modelKey: 'from',
itemClass: email_participant_1.default,
}), replyTo: attributes_1.default.Collection({
modelKey: 'replyTo',
jsonKey: 'reply_to',
itemClass: email_participant_1.default,
}), to: attributes_1.default.Collection({
modelKey: 'to',
itemClass: email_participant_1.default,
}), cc: attributes_1.default.Collection({
modelKey: 'cc',
itemClass: email_participant_1.default,
}), bcc: attributes_1.default.Collection({
modelKey: 'bcc',
itemClass: email_participant_1.default,
}), date: attributes_1.default.DateTime({
modelKey: 'date',
}), threadId: attributes_1.default.String({
modelKey: 'threadId',
jsonKey: 'thread_id',
}), snippet: attributes_1.default.String({
modelKey: 'snippet',
}), body: attributes_1.default.String({
modelKey: 'body',
}), unread: attributes_1.default.Boolean({
modelKey: 'unread',
}), starred: attributes_1.default.Boolean({
modelKey: 'starred',
}), files: attributes_1.default.Collection({
modelKey: 'files',
itemClass: file_1.default,
readOnly: true,
}), events: attributes_1.default.Collection({
modelKey: 'events',
itemClass: event_1.default,
}), folder: attributes_1.default.Object({
modelKey: 'folder',
itemClass: folder_1.default,
}), labels: attributes_1.default.Collection({
modelKey: 'labels',
itemClass: folder_1.Label,
}), metadata: attributes_1.default.Object({
modelKey: 'metadata',
}), headers: attributes_1.default.Object({
modelKey: 'headers',
}), jobStatusId: attributes_1.default.String({
modelKey: 'jobStatusId',
jsonKey: 'job_status_id',
readOnly: true,
}) });
return Message;
}(restful_model_1.default));
exports.default = Message;
Message.collectionName = 'messages';
Message.attributes = __assign(__assign({}, restful_model_1.default.attributes), { subject: attributes_1.default.String({
modelKey: 'subject',
}), from: attributes_1.default.Collection({
modelKey: 'from',
itemClass: email_participant_1.default,
}), replyTo: attributes_1.default.Collection({
modelKey: 'replyTo',
jsonKey: 'reply_to',
itemClass: email_participant_1.default,
}), to: attributes_1.default.Collection({
modelKey: 'to',
itemClass: email_participant_1.default,
}), cc: attributes_1.default.Collection({
modelKey: 'cc',
itemClass: email_participant_1.default,
}), bcc: attributes_1.default.Collection({
modelKey: 'bcc',
itemClass: email_participant_1.default,
}), date: attributes_1.default.DateTime({
modelKey: 'date',
}), threadId: attributes_1.default.String({
modelKey: 'threadId',
jsonKey: 'thread_id',
}), snippet: attributes_1.default.String({
modelKey: 'snippet',
}), body: attributes_1.default.String({
modelKey: 'body',
}), unread: attributes_1.default.Boolean({
modelKey: 'unread',
}), starred: attributes_1.default.Boolean({
modelKey: 'starred',
}), files: attributes_1.default.Collection({
modelKey: 'files',
itemClass: file_1.default,
readOnly: true,
}), events: attributes_1.default.Collection({
modelKey: 'events',
itemClass: event_1.default,
}), folder: attributes_1.default.Object({
modelKey: 'folder',
itemClass: folder_1.default,
}), labels: attributes_1.default.Collection({
modelKey: 'labels',
itemClass: folder_1.Label,
}), metadata: attributes_1.default.Object({
modelKey: 'metadata',
}), headers: attributes_1.default.Object({
modelKey: 'headers',
}), jobStatusId: attributes_1.default.String({
modelKey: 'jobStatusId',
jsonKey: 'job_status_id',
readOnly: true,
}) });

@@ -10,3 +10,4 @@ import { Attribute } from './attributes';

toJSON(enforceReadOnly?: boolean): Record<string, unknown>;
saveRequestBody(): Record<string, unknown>;
toString(): string;
}

@@ -54,2 +54,7 @@ "use strict";

};
// saveRequestBody is used by save(). It returns a JSON dict containing only the
// fields the API allows updating. Subclasses should override this method.
Model.prototype.saveRequestBody = function () {
return this.toJSON(true);
};
Model.prototype.toString = function () {

@@ -56,0 +61,0 @@ return JSON.stringify(this.toJSON());

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

import { Attribute } from './attributes';
import Message, { MessageProperties } from './message';

@@ -15,2 +16,3 @@ import Model from './model';

subcategories: string[];
static attributes: Record<string, Attribute>;
constructor(props?: CategorizeProperties);

@@ -23,4 +25,6 @@ }

categorizer: Categorize;
static collectionName: string;
static attributes: Record<string, Attribute>;
constructor(connection: NylasConnection, props?: NeuralCategorizerProperties);
reCategorize(category: string): Promise<NeuralCategorizer>;
}

@@ -80,21 +80,21 @@ "use strict";

}
Categorize.attributes = {
category: attributes_1.default.String({
modelKey: 'category',
}),
categorizedAt: attributes_1.default.DateTime({
modelKey: 'categorizedAt',
jsonKey: 'categorized_at',
}),
modelVersion: attributes_1.default.String({
modelKey: 'modelVersion',
jsonKey: 'model_version',
}),
subcategories: attributes_1.default.StringList({
modelKey: 'subcategories',
}),
};
return Categorize;
}(model_1.default));
exports.Categorize = Categorize;
Categorize.attributes = {
category: attributes_1.default.String({
modelKey: 'category',
}),
categorizedAt: attributes_1.default.DateTime({
modelKey: 'categorizedAt',
jsonKey: 'categorized_at',
}),
modelVersion: attributes_1.default.String({
modelKey: 'modelVersion',
jsonKey: 'model_version',
}),
subcategories: attributes_1.default.StringList({
modelKey: 'subcategories',
}),
};
var NeuralCategorizer = /** @class */ (function (_super) {

@@ -133,9 +133,9 @@ __extends(NeuralCategorizer, _super);

};
NeuralCategorizer.collectionName = 'categorizer';
NeuralCategorizer.attributes = __assign(__assign({}, message_1.default.attributes), { categorizer: attributes_1.default.Object({
modelKey: 'categorizer',
itemClass: Categorize,
}) });
return NeuralCategorizer;
}(message_1.default));
exports.default = NeuralCategorizer;
NeuralCategorizer.collectionName = 'categorizer';
NeuralCategorizer.attributes = __assign(__assign({}, message_1.default.attributes), { categorizer: attributes_1.default.Object({
modelKey: 'categorizer',
itemClass: Categorize,
}) });
import Message, { MessageProperties } from './message';
import { Attribute } from './attributes';
import File from './file';

@@ -11,4 +12,6 @@ import NylasConnection from '../nylas-connection';

modelVersion: string;
static collectionName: string;
static attributes: Record<string, Attribute>;
constructor(connection: NylasConnection, props?: NeuralCleanConversationProperties);
extractImages(): Promise<File[]>;
}

@@ -105,11 +105,11 @@ "use strict";

};
NeuralCleanConversation.collectionName = 'conversation';
NeuralCleanConversation.attributes = __assign(__assign({}, message_1.default.attributes), { conversation: attributes_1.default.String({
modelKey: 'conversation',
}), modelVersion: attributes_1.default.String({
modelKey: 'modelVersion',
jsonKey: 'model_version',
}) });
return NeuralCleanConversation;
}(message_1.default));
exports.default = NeuralCleanConversation;
NeuralCleanConversation.collectionName = 'conversation';
NeuralCleanConversation.attributes = __assign(__assign({}, message_1.default.attributes), { conversation: attributes_1.default.String({
modelKey: 'conversation',
}), modelVersion: attributes_1.default.String({
modelKey: 'modelVersion',
jsonKey: 'model_version',
}) });

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

import { Attribute } from './attributes';
import File, { FileProperties } from './file';

@@ -10,3 +11,5 @@ import NylasConnection from '../nylas-connection';

processedPages: number;
static collectionName: string;
static attributes: Record<string, Attribute>;
constructor(connection: NylasConnection, props?: NeuralOcrProperties);
}

@@ -41,11 +41,11 @@ "use strict";

}
NeuralOcr.collectionName = 'ocr';
NeuralOcr.attributes = __assign(__assign({}, file_1.default.attributes), { ocr: attributes_1.default.StringList({
modelKey: 'ocr',
}), processedPages: attributes_1.default.Number({
modelKey: 'processedPages',
jsonKey: 'processed_pages',
}) });
return NeuralOcr;
}(file_1.default));
exports.default = NeuralOcr;
NeuralOcr.collectionName = 'ocr';
NeuralOcr.attributes = __assign(__assign({}, file_1.default.attributes), { ocr: attributes_1.default.StringList({
modelKey: 'ocr',
}), processedPages: attributes_1.default.Number({
modelKey: 'processedPages',
jsonKey: 'processed_pages',
}) });

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

import { Attribute } from './attributes';
import RestfulModel from './restful-model';

@@ -16,3 +17,5 @@ import NylasConnection from '../nylas-connection';

text: string;
static collectionName: string;
static attributes: Record<string, Attribute>;
constructor(connection: NylasConnection, props?: NeuralSentimentAnalysisProperties);
}

@@ -33,25 +33,25 @@ "use strict";

}
NeuralSentimentAnalysis.collectionName = 'sentiment';
NeuralSentimentAnalysis.attributes = {
accountId: attributes_1.default.String({
modelKey: 'accountId',
jsonKey: 'account_id',
}),
sentiment: attributes_1.default.String({
modelKey: 'sentiment',
}),
sentimentScore: attributes_1.default.Number({
modelKey: 'sentimentScore',
jsonKey: 'sentiment_score',
}),
processedLength: attributes_1.default.Number({
modelKey: 'processedLength',
jsonKey: 'processed_length',
}),
text: attributes_1.default.String({
modelKey: 'text',
}),
};
return NeuralSentimentAnalysis;
}(restful_model_1.default));
exports.default = NeuralSentimentAnalysis;
NeuralSentimentAnalysis.collectionName = 'sentiment';
NeuralSentimentAnalysis.attributes = {
accountId: attributes_1.default.String({
modelKey: 'accountId',
jsonKey: 'account_id',
}),
sentiment: attributes_1.default.String({
modelKey: 'sentiment',
}),
sentimentScore: attributes_1.default.Number({
modelKey: 'sentimentScore',
jsonKey: 'sentiment_score',
}),
processedLength: attributes_1.default.Number({
modelKey: 'processedLength',
jsonKey: 'processed_length',
}),
text: attributes_1.default.String({
modelKey: 'text',
}),
};

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

import { Attribute } from './attributes';
import Contact from './contact';

@@ -11,2 +12,3 @@ import Model from './model';

url: string;
static attributes: Record<string, Attribute>;
constructor(props?: LinkProperties);

@@ -21,2 +23,3 @@ }

lastName: string;
static attributes: Record<string, Attribute>;
constructor(props?: NameProperties);

@@ -37,2 +40,3 @@ }

names?: Name[];
static attributes: Record<string, Attribute>;
constructor(props?: NeuralSignatureContactProperties);

@@ -39,0 +43,0 @@ toJSON(): Record<string, unknown>;

@@ -38,12 +38,12 @@ "use strict";

}
Link.attributes = {
description: attributes_1.default.String({
modelKey: 'description',
}),
url: attributes_1.default.String({
modelKey: 'url',
}),
};
return Link;
}(model_1.default));
Link.attributes = {
description: attributes_1.default.String({
modelKey: 'description',
}),
url: attributes_1.default.String({
modelKey: 'url',
}),
};
var Name = /** @class */ (function (_super) {

@@ -58,14 +58,14 @@ __extends(Name, _super);

}
Name.attributes = {
firstName: attributes_1.default.String({
modelKey: 'firstName',
jsonKey: 'first_name',
}),
lastName: attributes_1.default.String({
modelKey: 'lastName',
jsonKey: 'last_name',
}),
};
return Name;
}(model_1.default));
Name.attributes = {
firstName: attributes_1.default.String({
modelKey: 'firstName',
jsonKey: 'first_name',
}),
lastName: attributes_1.default.String({
modelKey: 'lastName',
jsonKey: 'last_name',
}),
};
var NeuralSignatureContact = /** @class */ (function (_super) {

@@ -121,25 +121,25 @@ __extends(NeuralSignatureContact, _super);

};
NeuralSignatureContact.attributes = {
jobTitles: attributes_1.default.StringList({
modelKey: 'jobTitles',
jsonKey: 'job_titles',
}),
links: attributes_1.default.Collection({
modelKey: 'links',
itemClass: Link,
}),
phoneNumbers: attributes_1.default.StringList({
modelKey: 'phoneNumbers',
jsonKey: 'phone_numbers',
}),
emails: attributes_1.default.StringList({
modelKey: 'emails',
}),
names: attributes_1.default.Collection({
modelKey: 'names',
itemClass: Name,
}),
};
return NeuralSignatureContact;
}(model_1.default));
exports.default = NeuralSignatureContact;
NeuralSignatureContact.attributes = {
jobTitles: attributes_1.default.StringList({
modelKey: 'jobTitles',
jsonKey: 'job_titles',
}),
links: attributes_1.default.Collection({
modelKey: 'links',
itemClass: Link,
}),
phoneNumbers: attributes_1.default.StringList({
modelKey: 'phoneNumbers',
jsonKey: 'phone_numbers',
}),
emails: attributes_1.default.StringList({
modelKey: 'emails',
}),
names: attributes_1.default.Collection({
modelKey: 'names',
itemClass: Name,
}),
};
import NeuralSignatureContact from './neural-signature-contact';
import { Attribute } from './attributes';
import Message, { MessageProperties } from './message';

@@ -13,3 +14,5 @@ import NylasConnection from '../nylas-connection';

contacts?: NeuralSignatureContact;
static collectionName: string;
static attributes: Record<string, Attribute>;
constructor(connection: NylasConnection, props?: NeuralSignatureExtractionProperties);
}

@@ -42,14 +42,14 @@ "use strict";

}
NeuralSignatureExtraction.collectionName = 'signature';
NeuralSignatureExtraction.attributes = __assign(__assign({}, message_1.default.attributes), { signature: attributes_1.default.String({
modelKey: 'signature',
}), modelVersion: attributes_1.default.String({
modelKey: 'modelVersion',
jsonKey: 'model_version',
}), contacts: attributes_1.default.Object({
modelKey: 'contacts',
itemClass: neural_signature_contact_1.default,
}) });
return NeuralSignatureExtraction;
}(message_1.default));
exports.default = NeuralSignatureExtraction;
NeuralSignatureExtraction.collectionName = 'signature';
NeuralSignatureExtraction.attributes = __assign(__assign({}, message_1.default.attributes), { signature: attributes_1.default.String({
modelKey: 'signature',
}), modelVersion: attributes_1.default.String({
modelKey: 'modelVersion',
jsonKey: 'model_version',
}), contacts: attributes_1.default.Object({
modelKey: 'contacts',
itemClass: neural_signature_contact_1.default,
}) });

@@ -8,2 +8,3 @@ import RestfulModel from './restful-model';

import Model from './model';
import { Attribute } from './attributes';
export declare type NeuralMessageOptionsProperties = {

@@ -24,2 +25,3 @@ ignoreLinks?: boolean;

parseContacts?: boolean;
static attributes: Record<string, Attribute>;
constructor(props?: NeuralMessageOptionsProperties);

@@ -26,0 +28,0 @@ toJSON(writeParseContact?: boolean): Record<string, boolean>;

@@ -52,31 +52,31 @@ "use strict";

};
NeuralMessageOptions.attributes = {
ignoreLinks: attributes_1.default.Boolean({
modelKey: 'ignoreLinks',
jsonKey: 'ignore_links',
}),
ignoreImages: attributes_1.default.Boolean({
modelKey: 'ignoreImages',
jsonKey: 'ignore_images',
}),
ignoreTables: attributes_1.default.Boolean({
modelKey: 'ignoreTables',
jsonKey: 'ignore_tables',
}),
removeConclusionPhrases: attributes_1.default.Boolean({
modelKey: 'removeConclusionPhrases',
jsonKey: 'remove_conclusion_phrases',
}),
imagesAsMarkdown: attributes_1.default.Boolean({
modelKey: 'imagesAsMarkdown',
jsonKey: 'images_as_markdown',
}),
parseContacts: attributes_1.default.Boolean({
modelKey: 'parseContacts',
jsonKey: 'parse_contacts',
}),
};
return NeuralMessageOptions;
}(model_1.default));
exports.NeuralMessageOptions = NeuralMessageOptions;
NeuralMessageOptions.attributes = {
ignoreLinks: attributes_1.default.Boolean({
modelKey: 'ignoreLinks',
jsonKey: 'ignore_links',
}),
ignoreImages: attributes_1.default.Boolean({
modelKey: 'ignoreImages',
jsonKey: 'ignore_images',
}),
ignoreTables: attributes_1.default.Boolean({
modelKey: 'ignoreTables',
jsonKey: 'ignore_tables',
}),
removeConclusionPhrases: attributes_1.default.Boolean({
modelKey: 'removeConclusionPhrases',
jsonKey: 'remove_conclusion_phrases',
}),
imagesAsMarkdown: attributes_1.default.Boolean({
modelKey: 'imagesAsMarkdown',
jsonKey: 'images_as_markdown',
}),
parseContacts: attributes_1.default.Boolean({
modelKey: 'parseContacts',
jsonKey: 'parse_contacts',
}),
};
var Neural = /** @class */ (function (_super) {

@@ -83,0 +83,0 @@ __extends(Neural, _super);

import RestfulModel from './restful-model';
import { Attribute } from './attributes';
import NylasConnection from '../nylas-connection';

@@ -18,3 +19,5 @@ export declare type ResourceProperties = {

floorName?: string;
static collectionName: string;
static attributes: Record<string, Attribute>;
constructor(connection: NylasConnection, props?: ResourceProperties);
}

@@ -33,35 +33,35 @@ "use strict";

}
Resource.collectionName = 'resources';
Resource.attributes = {
object: attributes_1.default.String({
modelKey: 'object',
readOnly: true,
}),
email: attributes_1.default.String({
modelKey: 'email',
}),
name: attributes_1.default.String({
modelKey: 'name',
}),
capacity: attributes_1.default.String({
modelKey: 'capacity',
readOnly: true,
}),
building: attributes_1.default.String({
modelKey: 'building',
readOnly: true,
}),
floorName: attributes_1.default.String({
modelKey: 'floorName',
jsonKey: 'floor_name',
readOnly: true,
}),
floorNumber: attributes_1.default.String({
modelKey: 'floorNumber',
jsonKey: 'floor_number',
readOnly: true,
}),
};
return Resource;
}(restful_model_1.default));
exports.default = Resource;
Resource.collectionName = 'resources';
Resource.attributes = {
object: attributes_1.default.String({
modelKey: 'object',
readOnly: true,
}),
email: attributes_1.default.String({
modelKey: 'email',
}),
name: attributes_1.default.String({
modelKey: 'name',
}),
capacity: attributes_1.default.String({
modelKey: 'capacity',
readOnly: true,
}),
building: attributes_1.default.String({
modelKey: 'building',
readOnly: true,
}),
floorName: attributes_1.default.String({
modelKey: 'floorName',
jsonKey: 'floor_name',
readOnly: true,
}),
floorNumber: attributes_1.default.String({
modelKey: 'floorNumber',
jsonKey: 'floor_number',
readOnly: true,
}),
};

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

import { Attribute } from './attributes';
import NylasConnection from '../nylas-connection';

@@ -22,2 +23,3 @@ import Model from './model';

baseUrl?: string;
static attributes: Record<string, Attribute>;
constructor(connection: NylasConnection, props?: Partial<RestfulModelJSON>);

@@ -29,3 +31,2 @@ static propsFromJSON(json: Partial<RestfulModelJSON> | undefined, parent: unknown): Partial<RestfulModelJSON>;

saveEndpoint(): string;
saveRequestBody(): Record<string, unknown>;
deleteRequestQueryString(_params: Record<string, unknown>): Record<string, unknown>;

@@ -32,0 +33,0 @@ deleteRequestBody(_params: Record<string, unknown>): Record<string, unknown>;

@@ -54,7 +54,2 @@ "use strict";

};
// saveRequestBody is used by save(). It returns a JSON dict containing only the
// fields the API allows updating. Subclasses should override this method.
RestfulModel.prototype.saveRequestBody = function () {
return this.toJSON(true);
};
// deleteRequestQueryString is used by delete(). Subclasses should override this method.

@@ -135,19 +130,19 @@ RestfulModel.prototype.deleteRequestQueryString = function (_params) {

RestfulModel.collectionName = ''; // overrridden in subclasses
RestfulModel.attributes = {
id: attributes_1.default.String({
modelKey: 'id',
readOnly: true,
}),
object: attributes_1.default.String({
modelKey: 'object',
readOnly: true,
}),
accountId: attributes_1.default.String({
modelKey: 'accountId',
jsonKey: 'account_id',
readOnly: true,
}),
};
return RestfulModel;
}(model_1.default));
exports.default = RestfulModel;
RestfulModel.attributes = {
id: attributes_1.default.String({
modelKey: 'id',
readOnly: true,
}),
object: attributes_1.default.String({
modelKey: 'object',
readOnly: true,
}),
accountId: attributes_1.default.String({
modelKey: 'accountId',
jsonKey: 'account_id',
readOnly: true,
}),
};

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

import { Attribute } from './attributes';
import SchedulerTimeSlot from './scheduler-time-slot';

@@ -36,2 +37,3 @@ import Model from './model';

title?: string;
static attributes: Record<string, Attribute>;
constructor(props?: SchedulerBookingConfirmationProperties);

@@ -60,4 +62,5 @@ }

timezone?: string;
static attributes: Record<string, Attribute>;
constructor(props?: SchedulerBookingRequestProperties);
toJSON(enforceReadOnly?: boolean): Record<string, any>;
}

@@ -29,64 +29,64 @@ "use strict";

}
SchedulerBookingConfirmation.attributes = {
id: attributes_1.default.Number({
modelKey: 'id',
}),
accountId: attributes_1.default.String({
modelKey: 'accountId',
jsonKey: 'account_id',
}),
additionalFieldValues: attributes_1.default.Object({
modelKey: 'additionalFieldValues',
jsonKey: 'additional_field_values',
}),
calendarEventId: attributes_1.default.String({
modelKey: 'calendarEventId',
jsonKey: 'calendar_event_id',
}),
calendarId: attributes_1.default.String({
modelKey: 'calendarId',
jsonKey: 'calendar_id',
}),
editHash: attributes_1.default.String({
modelKey: 'editHash',
jsonKey: 'edit_hash',
}),
startTime: attributes_1.default.DateTime({
modelKey: 'startTime',
jsonKey: 'start_time',
}),
endTime: attributes_1.default.DateTime({
modelKey: 'endTime',
jsonKey: 'end_time',
}),
isConfirmed: attributes_1.default.Boolean({
modelKey: 'isConfirmed',
jsonKey: 'is_confirmed',
}),
location: attributes_1.default.String({
modelKey: 'location',
}),
recipientEmail: attributes_1.default.String({
modelKey: 'recipientEmail',
jsonKey: 'recipient_email',
}),
recipientLocale: attributes_1.default.String({
modelKey: 'recipientLocale',
jsonKey: 'recipient_locale',
}),
recipientName: attributes_1.default.String({
modelKey: 'recipientName',
jsonKey: 'recipient_name',
}),
recipientTz: attributes_1.default.String({
modelKey: 'recipientTz',
jsonKey: 'recipient_tz',
}),
title: attributes_1.default.String({
modelKey: 'title',
}),
};
return SchedulerBookingConfirmation;
}(model_1.default));
exports.SchedulerBookingConfirmation = SchedulerBookingConfirmation;
SchedulerBookingConfirmation.attributes = {
id: attributes_1.default.Number({
modelKey: 'id',
}),
accountId: attributes_1.default.String({
modelKey: 'accountId',
jsonKey: 'account_id',
}),
additionalFieldValues: attributes_1.default.Object({
modelKey: 'additionalFieldValues',
jsonKey: 'additional_field_values',
}),
calendarEventId: attributes_1.default.String({
modelKey: 'calendarEventId',
jsonKey: 'calendar_event_id',
}),
calendarId: attributes_1.default.String({
modelKey: 'calendarId',
jsonKey: 'calendar_id',
}),
editHash: attributes_1.default.String({
modelKey: 'editHash',
jsonKey: 'edit_hash',
}),
startTime: attributes_1.default.DateTime({
modelKey: 'startTime',
jsonKey: 'start_time',
}),
endTime: attributes_1.default.DateTime({
modelKey: 'endTime',
jsonKey: 'end_time',
}),
isConfirmed: attributes_1.default.Boolean({
modelKey: 'isConfirmed',
jsonKey: 'is_confirmed',
}),
location: attributes_1.default.String({
modelKey: 'location',
}),
recipientEmail: attributes_1.default.String({
modelKey: 'recipientEmail',
jsonKey: 'recipient_email',
}),
recipientLocale: attributes_1.default.String({
modelKey: 'recipientLocale',
jsonKey: 'recipient_locale',
}),
recipientName: attributes_1.default.String({
modelKey: 'recipientName',
jsonKey: 'recipient_name',
}),
recipientTz: attributes_1.default.String({
modelKey: 'recipientTz',
jsonKey: 'recipient_tz',
}),
title: attributes_1.default.String({
modelKey: 'title',
}),
};
var SchedulerBookingRequest = /** @class */ (function (_super) {

@@ -113,38 +113,38 @@ __extends(SchedulerBookingRequest, _super);

};
SchedulerBookingRequest.attributes = {
additionalEmails: attributes_1.default.StringList({
modelKey: 'additionalEmails',
jsonKey: 'additional_emails',
}),
additionalValues: attributes_1.default.Object({
modelKey: 'additionalValues',
jsonKey: 'additional_values',
}),
email: attributes_1.default.String({
modelKey: 'email',
}),
locale: attributes_1.default.String({
modelKey: 'locale',
}),
name: attributes_1.default.String({
modelKey: 'name',
}),
pageHostname: attributes_1.default.String({
modelKey: 'pageHostname',
jsonKey: 'page_hostname',
}),
replacesBookingHash: attributes_1.default.String({
modelKey: 'replacesBookingHash',
jsonKey: 'replaces_booking_hash',
}),
slot: attributes_1.default.Object({
modelKey: 'slot',
itemClass: scheduler_time_slot_1.default,
}),
timezone: attributes_1.default.String({
modelKey: 'timezone',
}),
};
return SchedulerBookingRequest;
}(model_1.default));
exports.default = SchedulerBookingRequest;
SchedulerBookingRequest.attributes = {
additionalEmails: attributes_1.default.StringList({
modelKey: 'additionalEmails',
jsonKey: 'additional_emails',
}),
additionalValues: attributes_1.default.Object({
modelKey: 'additionalValues',
jsonKey: 'additional_values',
}),
email: attributes_1.default.String({
modelKey: 'email',
}),
locale: attributes_1.default.String({
modelKey: 'locale',
}),
name: attributes_1.default.String({
modelKey: 'name',
}),
pageHostname: attributes_1.default.String({
modelKey: 'pageHostname',
jsonKey: 'page_hostname',
}),
replacesBookingHash: attributes_1.default.String({
modelKey: 'replacesBookingHash',
jsonKey: 'replaces_booking_hash',
}),
slot: attributes_1.default.Object({
modelKey: 'slot',
itemClass: scheduler_time_slot_1.default,
}),
timezone: attributes_1.default.String({
modelKey: 'timezone',
}),
};

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

import { Attribute } from './attributes';
import Model from './model';

@@ -17,3 +18,4 @@ export declare type SchedulerTimeSlotProperties = {

end?: Date;
static attributes: Record<string, Attribute>;
constructor(props?: SchedulerTimeSlotProperties);
}

@@ -28,27 +28,27 @@ "use strict";

}
SchedulerTimeSlot.attributes = {
accountId: attributes_1.default.String({
modelKey: 'accountId',
jsonKey: 'account_id',
}),
calendarId: attributes_1.default.String({
modelKey: 'calendarId',
jsonKey: 'calendar_id',
}),
hostName: attributes_1.default.String({
modelKey: 'hostName',
jsonKey: 'host_name',
}),
emails: attributes_1.default.StringList({
modelKey: 'emails',
}),
start: attributes_1.default.DateTime({
modelKey: 'start',
}),
end: attributes_1.default.DateTime({
modelKey: 'end',
}),
};
return SchedulerTimeSlot;
}(model_1.default));
exports.default = SchedulerTimeSlot;
SchedulerTimeSlot.attributes = {
accountId: attributes_1.default.String({
modelKey: 'accountId',
jsonKey: 'account_id',
}),
calendarId: attributes_1.default.String({
modelKey: 'calendarId',
jsonKey: 'calendar_id',
}),
hostName: attributes_1.default.String({
modelKey: 'hostName',
jsonKey: 'host_name',
}),
emails: attributes_1.default.StringList({
modelKey: 'emails',
}),
start: attributes_1.default.DateTime({
modelKey: 'start',
}),
end: attributes_1.default.DateTime({
modelKey: 'end',
}),
};
import RestfulModel, { SaveCallback } from './restful-model';
import { Attribute } from './attributes';
import NylasConnection from '../nylas-connection';

@@ -22,2 +23,3 @@ import Model from './model';

calendars: Calendar[];
static attributes: Record<string, Attribute>;
private _connection?;

@@ -53,2 +55,3 @@ constructor(props?: SchedulerAvailableCalendarsProperties);

thankYouTextSecondary?: string;
static attributes: Record<string, Attribute>;
constructor(props?: SchedulerAppearanceProperties);

@@ -75,2 +78,3 @@ }

type?: string;
static attributes: Record<string, Attribute>;
constructor(props?: SchedulerBookingAdditionalFieldsProperties);

@@ -89,2 +93,3 @@ }

start?: string;
static attributes: Record<string, Attribute>;
constructor(props?: SchedulerBookingOpeningHoursProperties);

@@ -121,2 +126,3 @@ }

schedulingMethod?: string;
static attributes: Record<string, Attribute>;
constructor(props?: SchedulerBookingProperties);

@@ -137,2 +143,3 @@ }

webhookUrl?: string;
static attributes: Record<string, Attribute>;
constructor(props?: SchedulerRemindersProperties);

@@ -185,2 +192,3 @@ }

timezone?: string;
static attributes: Record<string, Attribute>;
constructor(props?: SchedulerConfigProperties);

@@ -209,2 +217,4 @@ }

modifiedAt?: Date;
static collectionName: string;
static attributes: Record<string, Attribute>;
constructor(connection: NylasConnection, props?: SchedulerProperties);

@@ -211,0 +221,0 @@ save(params?: {} | SaveCallback, callback?: SaveCallback): Promise<this>;

@@ -59,20 +59,20 @@ "use strict";

};
SchedulerAvailableCalendars.attributes = {
calendars: attributes_1.default.Collection({
modelKey: 'calendars',
itemClass: calendar_1.default,
}),
email: attributes_1.default.String({
modelKey: 'email',
}),
id: attributes_1.default.String({
modelKey: 'id',
}),
name: attributes_1.default.String({
modelKey: 'name',
}),
};
return SchedulerAvailableCalendars;
}(model_1.default));
exports.SchedulerAvailableCalendars = SchedulerAvailableCalendars;
SchedulerAvailableCalendars.attributes = {
calendars: attributes_1.default.Collection({
modelKey: 'calendars',
itemClass: calendar_1.default,
}),
email: attributes_1.default.String({
modelKey: 'email',
}),
id: attributes_1.default.String({
modelKey: 'id',
}),
name: attributes_1.default.String({
modelKey: 'name',
}),
};
var SchedulerAppearance = /** @class */ (function (_super) {

@@ -85,49 +85,49 @@ __extends(SchedulerAppearance, _super);

}
SchedulerAppearance.attributes = {
color: attributes_1.default.String({
modelKey: 'color',
}),
companyName: attributes_1.default.String({
modelKey: 'companyName',
jsonKey: 'company_name',
}),
logo: attributes_1.default.String({
modelKey: 'logo',
}),
privacyPolicyRedirect: attributes_1.default.String({
modelKey: 'privacyPolicyRedirect',
jsonKey: 'privacy_policy_redirect',
}),
showAutoschedule: attributes_1.default.Boolean({
modelKey: 'showAutoschedule',
jsonKey: 'show_autoschedule',
}),
showNylasBranding: attributes_1.default.Boolean({
modelKey: 'showNylasBranding',
jsonKey: 'show_nylas_branding',
}),
showTimezoneOptions: attributes_1.default.Boolean({
modelKey: 'showTimezoneOptions',
jsonKey: 'show_timezone_options',
}),
submitText: attributes_1.default.String({
modelKey: 'submitText',
jsonKey: 'submit_text',
}),
thankYouRedirect: attributes_1.default.String({
modelKey: 'thankYouRedirect',
jsonKey: 'thank_you_redirect',
}),
thankYouText: attributes_1.default.String({
modelKey: 'thankYouText',
jsonKey: 'thank_you_text',
}),
thankYouTextSecondary: attributes_1.default.String({
modelKey: 'thankYouTextSecondary',
jsonKey: 'thank_you_text_secondary',
}),
};
return SchedulerAppearance;
}(model_1.default));
exports.SchedulerAppearance = SchedulerAppearance;
SchedulerAppearance.attributes = {
color: attributes_1.default.String({
modelKey: 'color',
}),
companyName: attributes_1.default.String({
modelKey: 'companyName',
jsonKey: 'company_name',
}),
logo: attributes_1.default.String({
modelKey: 'logo',
}),
privacyPolicyRedirect: attributes_1.default.String({
modelKey: 'privacyPolicyRedirect',
jsonKey: 'privacy_policy_redirect',
}),
showAutoschedule: attributes_1.default.Boolean({
modelKey: 'showAutoschedule',
jsonKey: 'show_autoschedule',
}),
showNylasBranding: attributes_1.default.Boolean({
modelKey: 'showNylasBranding',
jsonKey: 'show_nylas_branding',
}),
showTimezoneOptions: attributes_1.default.Boolean({
modelKey: 'showTimezoneOptions',
jsonKey: 'show_timezone_options',
}),
submitText: attributes_1.default.String({
modelKey: 'submitText',
jsonKey: 'submit_text',
}),
thankYouRedirect: attributes_1.default.String({
modelKey: 'thankYouRedirect',
jsonKey: 'thank_you_redirect',
}),
thankYouText: attributes_1.default.String({
modelKey: 'thankYouText',
jsonKey: 'thank_you_text',
}),
thankYouTextSecondary: attributes_1.default.String({
modelKey: 'thankYouTextSecondary',
jsonKey: 'thank_you_text_secondary',
}),
};
var SchedulerBookingAdditionalFields = /** @class */ (function (_super) {

@@ -140,33 +140,33 @@ __extends(SchedulerBookingAdditionalFields, _super);

}
SchedulerBookingAdditionalFields.attributes = {
dropdownOptions: attributes_1.default.StringList({
modelKey: 'dropdownOptions',
jsonKey: 'dropdown_options',
}),
label: attributes_1.default.String({
modelKey: 'label',
}),
multiSelectOptions: attributes_1.default.StringList({
modelKey: 'multiSelectOptions',
jsonKey: 'multi_select_options',
}),
name: attributes_1.default.String({
modelKey: 'name',
}),
order: attributes_1.default.Number({
modelKey: 'order',
}),
pattern: attributes_1.default.String({
modelKey: 'pattern',
}),
required: attributes_1.default.Boolean({
modelKey: 'required',
}),
type: attributes_1.default.String({
modelKey: 'type',
}),
};
return SchedulerBookingAdditionalFields;
}(model_1.default));
exports.SchedulerBookingAdditionalFields = SchedulerBookingAdditionalFields;
SchedulerBookingAdditionalFields.attributes = {
dropdownOptions: attributes_1.default.StringList({
modelKey: 'dropdownOptions',
jsonKey: 'dropdown_options',
}),
label: attributes_1.default.String({
modelKey: 'label',
}),
multiSelectOptions: attributes_1.default.StringList({
modelKey: 'multiSelectOptions',
jsonKey: 'multi_select_options',
}),
name: attributes_1.default.String({
modelKey: 'name',
}),
order: attributes_1.default.Number({
modelKey: 'order',
}),
pattern: attributes_1.default.String({
modelKey: 'pattern',
}),
required: attributes_1.default.Boolean({
modelKey: 'required',
}),
type: attributes_1.default.String({
modelKey: 'type',
}),
};
var SchedulerBookingOpeningHours = /** @class */ (function (_super) {

@@ -179,20 +179,20 @@ __extends(SchedulerBookingOpeningHours, _super);

}
SchedulerBookingOpeningHours.attributes = {
dropdownOptions: attributes_1.default.String({
modelKey: 'accountId',
jsonKey: 'account_id',
}),
days: attributes_1.default.String({
modelKey: 'days',
}),
end: attributes_1.default.String({
modelKey: 'end',
}),
start: attributes_1.default.String({
modelKey: 'start',
}),
};
return SchedulerBookingOpeningHours;
}(model_1.default));
exports.SchedulerBookingOpeningHours = SchedulerBookingOpeningHours;
SchedulerBookingOpeningHours.attributes = {
dropdownOptions: attributes_1.default.String({
modelKey: 'accountId',
jsonKey: 'account_id',
}),
days: attributes_1.default.String({
modelKey: 'days',
}),
end: attributes_1.default.String({
modelKey: 'end',
}),
start: attributes_1.default.String({
modelKey: 'start',
}),
};
var SchedulerBooking = /** @class */ (function (_super) {

@@ -205,61 +205,61 @@ __extends(SchedulerBooking, _super);

}
SchedulerBooking.attributes = {
additionalFields: attributes_1.default.Collection({
modelKey: 'additionalFields',
jsonKey: 'additional_fields',
itemClass: SchedulerBookingAdditionalFields,
}),
availableDaysInFuture: attributes_1.default.Number({
modelKey: 'availableDaysInFuture',
jsonKey: 'available_days_in_future',
}),
calendarInviteToGuests: attributes_1.default.Boolean({
modelKey: 'calendarInviteToGuests',
jsonKey: 'calendar_invites_to_guests',
}),
cancellationPolicy: attributes_1.default.String({
modelKey: 'cancellationPolicy',
jsonKey: 'cancellation_policy',
}),
confirmationEmailsToGuests: attributes_1.default.Boolean({
modelKey: 'confirmationEmailsToGuests',
jsonKey: 'confirmation_emails_to_guests',
}),
confirmationEmailToHost: attributes_1.default.Boolean({
modelKey: 'confirmationEmailToHost',
jsonKey: 'confirmation_email_to_host',
}),
confirmationMethod: attributes_1.default.String({
modelKey: 'confirmationMethod',
jsonKey: 'confirmation_method',
}),
minBookingNotice: attributes_1.default.Number({
modelKey: 'minBookingNotice',
jsonKey: 'min_booking_notice',
}),
minBuffer: attributes_1.default.Number({
modelKey: 'minBuffer',
jsonKey: 'min_buffer',
}),
minCancellationNotice: attributes_1.default.Number({
modelKey: 'minCancellationNotice',
jsonKey: 'min_cancellation_notice',
}),
nameFieldHidden: attributes_1.default.Boolean({
modelKey: 'nameFieldHidden',
jsonKey: 'name_field_hidden',
}),
openingHours: attributes_1.default.Collection({
modelKey: 'openingHours',
jsonKey: 'opening_hours',
itemClass: SchedulerBookingOpeningHours,
}),
schedulingMethod: attributes_1.default.String({
modelKey: 'schedulingMethod',
jsonKey: 'scheduling_method',
}),
};
return SchedulerBooking;
}(model_1.default));
exports.SchedulerBooking = SchedulerBooking;
SchedulerBooking.attributes = {
additionalFields: attributes_1.default.Collection({
modelKey: 'additionalFields',
jsonKey: 'additional_fields',
itemClass: SchedulerBookingAdditionalFields,
}),
availableDaysInFuture: attributes_1.default.Number({
modelKey: 'availableDaysInFuture',
jsonKey: 'available_days_in_future',
}),
calendarInviteToGuests: attributes_1.default.Boolean({
modelKey: 'calendarInviteToGuests',
jsonKey: 'calendar_invites_to_guests',
}),
cancellationPolicy: attributes_1.default.String({
modelKey: 'cancellationPolicy',
jsonKey: 'cancellation_policy',
}),
confirmationEmailsToGuests: attributes_1.default.Boolean({
modelKey: 'confirmationEmailsToGuests',
jsonKey: 'confirmation_emails_to_guests',
}),
confirmationEmailToHost: attributes_1.default.Boolean({
modelKey: 'confirmationEmailToHost',
jsonKey: 'confirmation_email_to_host',
}),
confirmationMethod: attributes_1.default.String({
modelKey: 'confirmationMethod',
jsonKey: 'confirmation_method',
}),
minBookingNotice: attributes_1.default.Number({
modelKey: 'minBookingNotice',
jsonKey: 'min_booking_notice',
}),
minBuffer: attributes_1.default.Number({
modelKey: 'minBuffer',
jsonKey: 'min_buffer',
}),
minCancellationNotice: attributes_1.default.Number({
modelKey: 'minCancellationNotice',
jsonKey: 'min_cancellation_notice',
}),
nameFieldHidden: attributes_1.default.Boolean({
modelKey: 'nameFieldHidden',
jsonKey: 'name_field_hidden',
}),
openingHours: attributes_1.default.Collection({
modelKey: 'openingHours',
jsonKey: 'opening_hours',
itemClass: SchedulerBookingOpeningHours,
}),
schedulingMethod: attributes_1.default.String({
modelKey: 'schedulingMethod',
jsonKey: 'scheduling_method',
}),
};
var SchedulerReminders = /** @class */ (function (_super) {

@@ -272,27 +272,27 @@ __extends(SchedulerReminders, _super);

}
SchedulerReminders.attributes = {
deliveryMethod: attributes_1.default.String({
modelKey: 'deliveryMethod',
jsonKey: 'delivery_method',
}),
deliveryRecipient: attributes_1.default.String({
modelKey: 'deliveryRecipient',
jsonKey: 'delivery_recipient',
}),
emailSubject: attributes_1.default.String({
modelKey: 'emailSubject',
jsonKey: 'email_subject',
}),
timeBeforeEvent: attributes_1.default.Number({
modelKey: 'timeBeforeEvent',
jsonKey: 'time_before_event',
}),
webhookUrl: attributes_1.default.String({
modelKey: 'webhookUrl',
jsonKey: 'webhook_url',
}),
};
return SchedulerReminders;
}(model_1.default));
exports.SchedulerReminders = SchedulerReminders;
SchedulerReminders.attributes = {
deliveryMethod: attributes_1.default.String({
modelKey: 'deliveryMethod',
jsonKey: 'delivery_method',
}),
deliveryRecipient: attributes_1.default.String({
modelKey: 'deliveryRecipient',
jsonKey: 'delivery_recipient',
}),
emailSubject: attributes_1.default.String({
modelKey: 'emailSubject',
jsonKey: 'email_subject',
}),
timeBeforeEvent: attributes_1.default.Number({
modelKey: 'timeBeforeEvent',
jsonKey: 'time_before_event',
}),
webhookUrl: attributes_1.default.String({
modelKey: 'webhookUrl',
jsonKey: 'webhook_url',
}),
};
var SchedulerConfig = /** @class */ (function (_super) {

@@ -305,40 +305,40 @@ __extends(SchedulerConfig, _super);

}
SchedulerConfig.attributes = {
appearance: attributes_1.default.Object({
modelKey: 'appearance',
itemClass: SchedulerAppearance,
}),
booking: attributes_1.default.Object({
modelKey: 'booking',
itemClass: SchedulerBooking,
}),
calendarIds: attributes_1.default.Object({
modelKey: 'calendarIds',
jsonKey: 'calendar_ids',
}),
event: attributes_1.default.Object({
modelKey: 'event',
}),
expireAfter: attributes_1.default.Object({
modelKey: 'expireAfter',
jsonKey: 'expire_after',
}),
locale: attributes_1.default.String({
modelKey: 'locale',
}),
localeForGuests: attributes_1.default.String({
modelKey: 'localeForGuests',
jsonKey: 'locale_for_guests',
}),
reminders: attributes_1.default.Collection({
modelKey: 'reminders',
itemClass: SchedulerReminders,
}),
timezone: attributes_1.default.String({
modelKey: 'timezone',
}),
};
return SchedulerConfig;
}(model_1.default));
exports.SchedulerConfig = SchedulerConfig;
SchedulerConfig.attributes = {
appearance: attributes_1.default.Object({
modelKey: 'appearance',
itemClass: SchedulerAppearance,
}),
booking: attributes_1.default.Object({
modelKey: 'booking',
itemClass: SchedulerBooking,
}),
calendarIds: attributes_1.default.Object({
modelKey: 'calendarIds',
jsonKey: 'calendar_ids',
}),
event: attributes_1.default.Object({
modelKey: 'event',
}),
expireAfter: attributes_1.default.Object({
modelKey: 'expireAfter',
jsonKey: 'expire_after',
}),
locale: attributes_1.default.String({
modelKey: 'locale',
}),
localeForGuests: attributes_1.default.String({
modelKey: 'localeForGuests',
jsonKey: 'locale_for_guests',
}),
reminders: attributes_1.default.Collection({
modelKey: 'reminders',
itemClass: SchedulerReminders,
}),
timezone: attributes_1.default.String({
modelKey: 'timezone',
}),
};
var Scheduler = /** @class */ (function (_super) {

@@ -394,36 +394,36 @@ __extends(Scheduler, _super);

};
Scheduler.collectionName = 'manage/pages';
Scheduler.attributes = __assign(__assign({}, restful_model_1.default.attributes), { accessTokens: attributes_1.default.StringList({
modelKey: 'accessTokens',
jsonKey: 'access_tokens',
}), appClientId: attributes_1.default.String({
modelKey: 'appClientId',
jsonKey: 'app_client_id',
readOnly: true,
}), appOrganizationId: attributes_1.default.Number({
modelKey: 'appOrganizationId',
jsonKey: 'app_organization_id',
readOnly: true,
}), config: attributes_1.default.Object({
modelKey: 'config',
itemClass: SchedulerConfig,
}), editToken: attributes_1.default.String({
modelKey: 'editToken',
jsonKey: 'edit_token',
readOnly: true,
}), name: attributes_1.default.String({
modelKey: 'name',
}), slug: attributes_1.default.String({
modelKey: 'slug',
}), createdAt: attributes_1.default.Date({
modelKey: 'createdAt',
jsonKey: 'created_at',
readOnly: true,
}), modifiedAt: attributes_1.default.Date({
modelKey: 'modifiedAt',
jsonKey: 'modified_at',
readOnly: true,
}) });
return Scheduler;
}(restful_model_1.default));
exports.default = Scheduler;
Scheduler.collectionName = 'manage/pages';
Scheduler.attributes = __assign(__assign({}, restful_model_1.default.attributes), { accessTokens: attributes_1.default.StringList({
modelKey: 'accessTokens',
jsonKey: 'access_tokens',
}), appClientId: attributes_1.default.String({
modelKey: 'appClientId',
jsonKey: 'app_client_id',
readOnly: true,
}), appOrganizationId: attributes_1.default.Number({
modelKey: 'appOrganizationId',
jsonKey: 'app_organization_id',
readOnly: true,
}), config: attributes_1.default.Object({
modelKey: 'config',
itemClass: SchedulerConfig,
}), editToken: attributes_1.default.String({
modelKey: 'editToken',
jsonKey: 'edit_token',
readOnly: true,
}), name: attributes_1.default.String({
modelKey: 'name',
}), slug: attributes_1.default.String({
modelKey: 'slug',
}), createdAt: attributes_1.default.Date({
modelKey: 'createdAt',
jsonKey: 'created_at',
readOnly: true,
}), modifiedAt: attributes_1.default.Date({
modelKey: 'modifiedAt',
jsonKey: 'modified_at',
readOnly: true,
}) });
import Message, { MessageProperties } from './message';
import RestfulModel, { SaveCallback } from './restful-model';
import { Attribute } from './attributes';
import EmailParticipant, { EmailParticipantProperties } from './email-participant';

@@ -43,2 +44,4 @@ import Folder, { Label, FolderProperties } from './folder';

drafts?: Message[];
static collectionName: string;
static attributes: Record<string, Attribute>;
constructor(connection: NylasConnection, props?: ThreadProperties);

@@ -45,0 +48,0 @@ saveRequestBody(): Record<string, unknown>;

@@ -75,54 +75,54 @@ "use strict";

};
Thread.collectionName = 'threads';
Thread.attributes = __assign(__assign({}, restful_model_1.default.attributes), { subject: attributes_1.default.String({
modelKey: 'subject',
}), participants: attributes_1.default.Collection({
modelKey: 'participants',
itemClass: email_participant_1.default,
}), lastMessageTimestamp: attributes_1.default.DateTime({
modelKey: 'lastMessageTimestamp',
jsonKey: 'last_message_timestamp',
}), lastMessageReceivedTimestamp: attributes_1.default.DateTime({
modelKey: 'lastMessageReceivedTimestamp',
jsonKey: 'last_message_received_timestamp',
}), lastMessageSentTimestamp: attributes_1.default.DateTime({
modelKey: 'lastMessageSentTimestamp',
jsonKey: 'last_message_sent_timestamp',
}), firstMessageTimestamp: attributes_1.default.DateTime({
modelKey: 'firstMessageTimestamp',
jsonKey: 'first_message_timestamp',
}), snippet: attributes_1.default.String({
modelKey: 'snippet',
}), unread: attributes_1.default.Boolean({
modelKey: 'unread',
}), starred: attributes_1.default.Boolean({
modelKey: 'starred',
}), hasAttachments: attributes_1.default.Boolean({
modelKey: 'has_attachments',
}), version: attributes_1.default.String({
modelKey: 'version',
jsonKey: 'version',
}), folders: attributes_1.default.Collection({
modelKey: 'folders',
itemClass: folder_1.default,
jsonKey: 'folders',
}), labels: attributes_1.default.Collection({
modelKey: 'labels',
itemClass: folder_1.Label,
jsonKey: 'labels',
}), messageIds: attributes_1.default.StringList({
modelKey: 'messageIds',
jsonKey: 'message_ids',
}), draftIds: attributes_1.default.StringList({
modelKey: 'draftIds',
jsonKey: 'draft_ids',
}), messages: attributes_1.default.Collection({
modelKey: 'messages',
itemClass: message_1.default,
}), drafts: attributes_1.default.Collection({
modelKey: 'drafts',
itemClass: message_1.default,
}) });
return Thread;
}(restful_model_1.default));
exports.default = Thread;
Thread.collectionName = 'threads';
Thread.attributes = __assign(__assign({}, restful_model_1.default.attributes), { subject: attributes_1.default.String({
modelKey: 'subject',
}), participants: attributes_1.default.Collection({
modelKey: 'participants',
itemClass: email_participant_1.default,
}), lastMessageTimestamp: attributes_1.default.DateTime({
modelKey: 'lastMessageTimestamp',
jsonKey: 'last_message_timestamp',
}), lastMessageReceivedTimestamp: attributes_1.default.DateTime({
modelKey: 'lastMessageReceivedTimestamp',
jsonKey: 'last_message_received_timestamp',
}), lastMessageSentTimestamp: attributes_1.default.DateTime({
modelKey: 'lastMessageSentTimestamp',
jsonKey: 'last_message_sent_timestamp',
}), firstMessageTimestamp: attributes_1.default.DateTime({
modelKey: 'firstMessageTimestamp',
jsonKey: 'first_message_timestamp',
}), snippet: attributes_1.default.String({
modelKey: 'snippet',
}), unread: attributes_1.default.Boolean({
modelKey: 'unread',
}), starred: attributes_1.default.Boolean({
modelKey: 'starred',
}), hasAttachments: attributes_1.default.Boolean({
modelKey: 'has_attachments',
}), version: attributes_1.default.String({
modelKey: 'version',
jsonKey: 'version',
}), folders: attributes_1.default.Collection({
modelKey: 'folders',
itemClass: folder_1.default,
jsonKey: 'folders',
}), labels: attributes_1.default.Collection({
modelKey: 'labels',
itemClass: folder_1.Label,
jsonKey: 'labels',
}), messageIds: attributes_1.default.StringList({
modelKey: 'messageIds',
jsonKey: 'message_ids',
}), draftIds: attributes_1.default.StringList({
modelKey: 'draftIds',
jsonKey: 'draft_ids',
}), messages: attributes_1.default.Collection({
modelKey: 'messages',
itemClass: message_1.default,
}), drafts: attributes_1.default.Collection({
modelKey: 'drafts',
itemClass: message_1.default,
}) });
import ManagementModel from './management-model';
import { Attribute } from './attributes';
import { SaveCallback } from './restful-model';

@@ -19,2 +20,4 @@ import NylasConnection from '../nylas-connection';

version?: string;
static collectionName: string;
static attributes: Record<string, Attribute>;
constructor(connection: NylasConnection, clientId: string, props: WebhookProperties);

@@ -21,0 +24,0 @@ pathPrefix(): string;

@@ -51,27 +51,27 @@ "use strict";

};
Webhook.collectionName = 'webhooks';
Webhook.attributes = {
id: attributes_1.default.String({
modelKey: 'id',
}),
applicationId: attributes_1.default.String({
modelKey: 'applicationId',
jsonKey: 'application_id',
}),
callbackUrl: attributes_1.default.String({
modelKey: 'callbackUrl',
jsonKey: 'callback_url',
}),
state: attributes_1.default.String({
modelKey: 'state',
}),
triggers: attributes_1.default.StringList({
modelKey: 'triggers',
}),
version: attributes_1.default.String({
modelKey: 'version',
}),
};
return Webhook;
}(management_model_1.default));
exports.default = Webhook;
Webhook.collectionName = 'webhooks';
Webhook.attributes = {
id: attributes_1.default.String({
modelKey: 'id',
}),
applicationId: attributes_1.default.String({
modelKey: 'applicationId',
jsonKey: 'application_id',
}),
callbackUrl: attributes_1.default.String({
modelKey: 'callbackUrl',
jsonKey: 'callback_url',
}),
state: attributes_1.default.String({
modelKey: 'state',
}),
triggers: attributes_1.default.StringList({
modelKey: 'triggers',
}),
version: attributes_1.default.String({
modelKey: 'version',
}),
};
import Model from './model';
import { Attribute } from './attributes';
export declare type WhenProperties = {

@@ -19,3 +20,5 @@ startTime?: number;

object?: string;
static attributes: Record<string, Attribute>;
constructor(props?: WhenProperties);
isSet(): boolean;
}

@@ -28,31 +28,39 @@ "use strict";

}
// Helper method to check if the When object is actually set properly or not
When.prototype.isSet = function () {
return ((this.startTime != undefined && this.endTime != undefined) ||
this.time != undefined ||
(this.startDate != undefined && this.endDate != undefined) ||
this.date != undefined);
};
When.attributes = {
startTime: attributes_1.default.Number({
modelKey: 'startTime',
jsonKey: 'start_time',
}),
endTime: attributes_1.default.Number({
modelKey: 'endTime',
jsonKey: 'end_time',
}),
time: attributes_1.default.Number({
modelKey: 'time',
}),
startDate: attributes_1.default.String({
modelKey: 'startDate',
jsonKey: 'start_date',
}),
endDate: attributes_1.default.String({
modelKey: 'endDate',
jsonKey: 'end_date',
}),
date: attributes_1.default.String({
modelKey: 'date',
}),
object: attributes_1.default.String({
modelKey: 'object',
readOnly: true,
}),
};
return When;
}(model_1.default));
exports.default = When;
When.attributes = {
startTime: attributes_1.default.Number({
modelKey: 'startTime',
jsonKey: 'start_time',
}),
endTime: attributes_1.default.Number({
modelKey: 'endTime',
jsonKey: 'end_time',
}),
time: attributes_1.default.Number({
modelKey: 'time',
}),
startDate: attributes_1.default.String({
modelKey: 'startDate',
jsonKey: 'start_date',
}),
endDate: attributes_1.default.String({
modelKey: 'endDate',
jsonKey: 'end_date',
}),
date: attributes_1.default.String({
modelKey: 'date',
}),
object: attributes_1.default.String({
modelKey: 'object',
}),
};
{
"name": "nylas",
"version": "6.0.0",
"version": "6.1.0",
"description": "A NodeJS wrapper for the Nylas REST API for email, contacts, and calendar.",

@@ -5,0 +5,0 @@ "main": "lib/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