Comparing version 7.0.0-beta.3 to 7.0.0-beta.4
@@ -49,2 +49,43 @@ "use strict"; | ||
} | ||
async sendRequest(options) { | ||
const req = this.newRequest(options); | ||
const controller = new AbortController(); | ||
const timeout = setTimeout(() => { | ||
controller.abort(); | ||
throw new error_js_1.NylasSdkTimeoutError(req.url, this.timeout); | ||
}, this.timeout); | ||
try { | ||
const response = await (0, node_fetch_1.default)(req, { signal: controller.signal }); | ||
clearTimeout(timeout); | ||
if (typeof response === 'undefined') { | ||
throw new Error('Failed to fetch response'); | ||
} | ||
if (response.status > 299) { | ||
const text = await response.text(); | ||
let error; | ||
try { | ||
const parsedError = JSON.parse(text); | ||
const camelCaseError = (0, utils_js_1.objKeysToCamelCase)(parsedError); | ||
// Check if the request is an authentication request | ||
const isAuthRequest = options.path.includes('connect/token') || | ||
options.path.includes('connect/revoke'); | ||
if (isAuthRequest) { | ||
error = new error_js_1.NylasOAuthError(camelCaseError, response.status); | ||
} | ||
else { | ||
error = new error_js_1.NylasApiError(camelCaseError, response.status); | ||
} | ||
} | ||
catch (e) { | ||
throw new Error(`Received an error but could not parse response from the server: ${text}`); | ||
} | ||
throw error; | ||
} | ||
return response; | ||
} | ||
catch (error) { | ||
clearTimeout(timeout); | ||
throw error; | ||
} | ||
} | ||
requestOptions(optionParams) { | ||
@@ -87,37 +128,14 @@ const requestOptions = {}; | ||
async request(options) { | ||
const req = this.newRequest(options); | ||
const controller = new AbortController(); | ||
const timeout = setTimeout(() => { | ||
controller.abort(); | ||
throw new error_js_1.NylasSdkTimeoutError(req.url, this.timeout); | ||
}, this.timeout); | ||
const response = await (0, node_fetch_1.default)(req, { signal: controller.signal }); | ||
clearTimeout(timeout); | ||
if (typeof response === 'undefined') { | ||
throw new Error('Failed to fetch response'); | ||
} | ||
// handle error response | ||
if (response.status > 299) { | ||
const authErrorResponse = options.path.includes('connect/token') || | ||
options.path.includes('connect/revoke'); | ||
const text = await response.text(); | ||
let error; | ||
try { | ||
const parsedError = JSON.parse(text); | ||
const camelCaseError = (0, utils_js_1.objKeysToCamelCase)(parsedError); | ||
if (authErrorResponse) { | ||
error = new error_js_1.NylasOAuthError(camelCaseError, response.status); | ||
} | ||
else { | ||
error = new error_js_1.NylasApiError(camelCaseError, response.status); | ||
} | ||
} | ||
catch (e) { | ||
throw new Error(`Received an error but could not parse response from the server: ${text}`); | ||
} | ||
throw error; | ||
} | ||
const response = await this.sendRequest(options); | ||
return this.requestWithResponse(response); | ||
} | ||
async requestRaw(options) { | ||
const response = await this.sendRequest(options); | ||
return response.buffer(); | ||
} | ||
async requestStream(options) { | ||
const response = await this.sendRequest(options); | ||
return response.body; | ||
} | ||
} | ||
exports.default = APIClient; |
@@ -14,2 +14,6 @@ "use strict"; | ||
const connectors_js_1 = require("./resources/connectors.js"); | ||
const folders_js_1 = require("./resources/folders.js"); | ||
const grants_js_1 = require("./resources/grants.js"); | ||
const contacts_js_1 = require("./resources/contacts.js"); | ||
const attachments_js_1 = require("./resources/attachments.js"); | ||
/** | ||
@@ -37,5 +41,9 @@ * The entry point to the Node SDK | ||
this.events = new events_js_1.Events(this.apiClient); | ||
this.grants = new grants_js_1.Grants(this.apiClient); | ||
this.messages = new messages_js_1.Messages(this.apiClient); | ||
this.threads = new threads_js_1.Threads(this.apiClient); | ||
this.webhooks = new webhooks_js_1.Webhooks(this.apiClient); | ||
this.folders = new folders_js_1.Folders(this.apiClient); | ||
this.contacts = new contacts_js_1.Contacts(this.apiClient); | ||
this.attachments = new attachments_js_1.Attachments(this.apiClient); | ||
return this; | ||
@@ -42,0 +50,0 @@ } |
@@ -7,3 +7,2 @@ "use strict"; | ||
const resource_js_1 = require("./resource.js"); | ||
const grants_js_1 = require("./grants.js"); | ||
/** | ||
@@ -17,10 +16,2 @@ * A collection of authentication related API endpoints | ||
/** | ||
* @param apiClient The configured Nylas API client | ||
*/ | ||
constructor(apiClient) { | ||
super(apiClient); | ||
this.apiClient = apiClient; | ||
this.grants = new grants_js_1.Grants(apiClient); | ||
} | ||
/** | ||
* Build the URL for authenticating users to your application with OAuth 2.0 | ||
@@ -96,2 +87,14 @@ * @param config The configuration for building the URL | ||
/** | ||
* Create a grant via Custom Authentication | ||
* @return The created grant | ||
*/ | ||
customAuthentication({ requestBody, overrides, }) { | ||
return this.apiClient.request({ | ||
method: 'POST', | ||
path: `/v3/connect/custom`, | ||
body: requestBody, | ||
overrides, | ||
}); | ||
} | ||
/** | ||
* Revoke a token (and the grant attached to the token) | ||
@@ -119,3 +122,3 @@ * @param token The token to revoke | ||
method: 'POST', | ||
path: `/v3/grants/providers/detect`, | ||
path: `/v3/providers/detect`, | ||
queryParams: params, | ||
@@ -122,0 +125,0 @@ }); |
@@ -68,3 +68,17 @@ "use strict"; | ||
} | ||
/** | ||
* Send RSVP. Allows users to respond to events they have been added to as an attendee. | ||
* You cannot send RSVP as an event owner/organizer. | ||
* You cannot directly update events as an invitee, since you are not the owner/organizer. | ||
* @return The send-rsvp response | ||
*/ | ||
sendRsvp({ identifier, eventId, requestBody, queryParams, overrides, }) { | ||
return super._create({ | ||
path: `/v3/grants/${identifier}/events/${eventId}/send-rsvp`, | ||
queryParams, | ||
requestBody, | ||
overrides, | ||
}); | ||
} | ||
} | ||
exports.Events = Events; |
@@ -33,13 +33,2 @@ "use strict"; | ||
/** | ||
* Create a Grant via Custom Authentication | ||
* @return The created Grant | ||
*/ | ||
create({ requestBody, overrides, }) { | ||
return super._create({ | ||
path: `/v3/connect/custom`, | ||
requestBody, | ||
overrides, | ||
}); | ||
} | ||
/** | ||
* Update a Grant | ||
@@ -46,0 +35,0 @@ * @return The updated Grant |
@@ -104,3 +104,10 @@ "use strict"; | ||
static _buildFormRequest(requestBody) { | ||
const form = new FormData(); | ||
let form; | ||
// FormData imports are funky, cjs needs to use .default, es6 doesn't | ||
if (typeof FormData.default !== 'undefined') { | ||
form = new FormData.default(); | ||
} | ||
else { | ||
form = new FormData(); | ||
} | ||
// Split out the message payload from the attachments | ||
@@ -107,0 +114,0 @@ const messagePayload = { |
@@ -110,3 +110,19 @@ "use strict"; | ||
} | ||
_getRaw({ path, queryParams, overrides, }) { | ||
return this.apiClient.requestRaw({ | ||
method: 'GET', | ||
path, | ||
queryParams, | ||
overrides, | ||
}); | ||
} | ||
_getStream({ path, queryParams, overrides, }) { | ||
return this.apiClient.requestStream({ | ||
method: 'GET', | ||
path, | ||
queryParams, | ||
overrides, | ||
}); | ||
} | ||
} | ||
exports.Resource = Resource; |
@@ -5,2 +5,2 @@ "use strict"; | ||
// This file is generated by scripts/exportVersion.js | ||
exports.SDK_VERSION = '7.0.0-beta.3'; | ||
exports.SDK_VERSION = '7.0.0-beta.4'; |
@@ -47,2 +47,43 @@ import fetch, { Request } from 'node-fetch'; | ||
} | ||
async sendRequest(options) { | ||
const req = this.newRequest(options); | ||
const controller = new AbortController(); | ||
const timeout = setTimeout(() => { | ||
controller.abort(); | ||
throw new NylasSdkTimeoutError(req.url, this.timeout); | ||
}, this.timeout); | ||
try { | ||
const response = await fetch(req, { signal: controller.signal }); | ||
clearTimeout(timeout); | ||
if (typeof response === 'undefined') { | ||
throw new Error('Failed to fetch response'); | ||
} | ||
if (response.status > 299) { | ||
const text = await response.text(); | ||
let error; | ||
try { | ||
const parsedError = JSON.parse(text); | ||
const camelCaseError = objKeysToCamelCase(parsedError); | ||
// Check if the request is an authentication request | ||
const isAuthRequest = options.path.includes('connect/token') || | ||
options.path.includes('connect/revoke'); | ||
if (isAuthRequest) { | ||
error = new NylasOAuthError(camelCaseError, response.status); | ||
} | ||
else { | ||
error = new NylasApiError(camelCaseError, response.status); | ||
} | ||
} | ||
catch (e) { | ||
throw new Error(`Received an error but could not parse response from the server: ${text}`); | ||
} | ||
throw error; | ||
} | ||
return response; | ||
} | ||
catch (error) { | ||
clearTimeout(timeout); | ||
throw error; | ||
} | ||
} | ||
requestOptions(optionParams) { | ||
@@ -85,36 +126,13 @@ const requestOptions = {}; | ||
async request(options) { | ||
const req = this.newRequest(options); | ||
const controller = new AbortController(); | ||
const timeout = setTimeout(() => { | ||
controller.abort(); | ||
throw new NylasSdkTimeoutError(req.url, this.timeout); | ||
}, this.timeout); | ||
const response = await fetch(req, { signal: controller.signal }); | ||
clearTimeout(timeout); | ||
if (typeof response === 'undefined') { | ||
throw new Error('Failed to fetch response'); | ||
} | ||
// handle error response | ||
if (response.status > 299) { | ||
const authErrorResponse = options.path.includes('connect/token') || | ||
options.path.includes('connect/revoke'); | ||
const text = await response.text(); | ||
let error; | ||
try { | ||
const parsedError = JSON.parse(text); | ||
const camelCaseError = objKeysToCamelCase(parsedError); | ||
if (authErrorResponse) { | ||
error = new NylasOAuthError(camelCaseError, response.status); | ||
} | ||
else { | ||
error = new NylasApiError(camelCaseError, response.status); | ||
} | ||
} | ||
catch (e) { | ||
throw new Error(`Received an error but could not parse response from the server: ${text}`); | ||
} | ||
throw error; | ||
} | ||
const response = await this.sendRequest(options); | ||
return this.requestWithResponse(response); | ||
} | ||
async requestRaw(options) { | ||
const response = await this.sendRequest(options); | ||
return response.buffer(); | ||
} | ||
async requestStream(options) { | ||
const response = await this.sendRequest(options); | ||
return response.body; | ||
} | ||
} |
@@ -12,2 +12,6 @@ import APIClient from './apiClient.js'; | ||
import { Connectors } from './resources/connectors.js'; | ||
import { Folders } from './resources/folders.js'; | ||
import { Grants } from './resources/grants.js'; | ||
import { Contacts } from './resources/contacts.js'; | ||
import { Attachments } from './resources/attachments.js'; | ||
/** | ||
@@ -35,7 +39,11 @@ * The entry point to the Node SDK | ||
this.events = new Events(this.apiClient); | ||
this.grants = new Grants(this.apiClient); | ||
this.messages = new Messages(this.apiClient); | ||
this.threads = new Threads(this.apiClient); | ||
this.webhooks = new Webhooks(this.apiClient); | ||
this.folders = new Folders(this.apiClient); | ||
this.contacts = new Contacts(this.apiClient); | ||
this.attachments = new Attachments(this.apiClient); | ||
return this; | ||
} | ||
} |
import { v4 as uuid } from 'uuid'; | ||
import { createHash } from 'node:crypto'; | ||
import { Resource } from './resource.js'; | ||
import { Grants } from './grants.js'; | ||
/** | ||
@@ -13,10 +12,2 @@ * A collection of authentication related API endpoints | ||
/** | ||
* @param apiClient The configured Nylas API client | ||
*/ | ||
constructor(apiClient) { | ||
super(apiClient); | ||
this.apiClient = apiClient; | ||
this.grants = new Grants(apiClient); | ||
} | ||
/** | ||
* Build the URL for authenticating users to your application with OAuth 2.0 | ||
@@ -92,2 +83,14 @@ * @param config The configuration for building the URL | ||
/** | ||
* Create a grant via Custom Authentication | ||
* @return The created grant | ||
*/ | ||
customAuthentication({ requestBody, overrides, }) { | ||
return this.apiClient.request({ | ||
method: 'POST', | ||
path: `/v3/connect/custom`, | ||
body: requestBody, | ||
overrides, | ||
}); | ||
} | ||
/** | ||
* Revoke a token (and the grant attached to the token) | ||
@@ -115,3 +118,3 @@ * @param token The token to revoke | ||
method: 'POST', | ||
path: `/v3/grants/providers/detect`, | ||
path: `/v3/providers/detect`, | ||
queryParams: params, | ||
@@ -118,0 +121,0 @@ }); |
@@ -65,2 +65,16 @@ import { Resource } from './resource.js'; | ||
} | ||
/** | ||
* Send RSVP. Allows users to respond to events they have been added to as an attendee. | ||
* You cannot send RSVP as an event owner/organizer. | ||
* You cannot directly update events as an invitee, since you are not the owner/organizer. | ||
* @return The send-rsvp response | ||
*/ | ||
sendRsvp({ identifier, eventId, requestBody, queryParams, overrides, }) { | ||
return super._create({ | ||
path: `/v3/grants/${identifier}/events/${eventId}/send-rsvp`, | ||
queryParams, | ||
requestBody, | ||
overrides, | ||
}); | ||
} | ||
} |
@@ -30,13 +30,2 @@ import { Resource } from './resource.js'; | ||
/** | ||
* Create a Grant via Custom Authentication | ||
* @return The created Grant | ||
*/ | ||
create({ requestBody, overrides, }) { | ||
return super._create({ | ||
path: `/v3/connect/custom`, | ||
requestBody, | ||
overrides, | ||
}); | ||
} | ||
/** | ||
* Update a Grant | ||
@@ -43,0 +32,0 @@ * @return The updated Grant |
@@ -101,3 +101,10 @@ import { Resource } from './resource.js'; | ||
static _buildFormRequest(requestBody) { | ||
const form = new FormData(); | ||
let form; | ||
// FormData imports are funky, cjs needs to use .default, es6 doesn't | ||
if (typeof FormData.default !== 'undefined') { | ||
form = new FormData.default(); | ||
} | ||
else { | ||
form = new FormData(); | ||
} | ||
// Split out the message payload from the attachments | ||
@@ -104,0 +111,0 @@ const messagePayload = { |
@@ -107,2 +107,18 @@ /** | ||
} | ||
_getRaw({ path, queryParams, overrides, }) { | ||
return this.apiClient.requestRaw({ | ||
method: 'GET', | ||
path, | ||
queryParams, | ||
overrides, | ||
}); | ||
} | ||
_getStream({ path, queryParams, overrides, }) { | ||
return this.apiClient.requestStream({ | ||
method: 'GET', | ||
path, | ||
queryParams, | ||
overrides, | ||
}); | ||
} | ||
} |
// This file is generated by scripts/exportVersion.js | ||
export const SDK_VERSION = '7.0.0-beta.3'; | ||
export const SDK_VERSION = '7.0.0-beta.4'; |
@@ -0,1 +1,3 @@ | ||
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
import { Request, Response } from 'node-fetch'; | ||
@@ -62,2 +64,3 @@ import { NylasConfig, OverridableNylasConfig } from './config.js'; | ||
private setRequestHeaders; | ||
private sendRequest; | ||
requestOptions(optionParams: RequestOptionsParams): RequestOptions; | ||
@@ -67,3 +70,5 @@ newRequest(options: RequestOptionsParams): Request; | ||
request<T>(options: RequestOptionsParams): Promise<T>; | ||
requestRaw(options: RequestOptionsParams): Promise<Buffer>; | ||
requestStream(options: RequestOptionsParams): Promise<NodeJS.ReadableStream>; | ||
} | ||
export {}; |
@@ -138,2 +138,6 @@ /** | ||
/** | ||
* Email address of the grant that is created. | ||
*/ | ||
email: string; | ||
/** | ||
* The remaining lifetime of the access token in seconds. | ||
@@ -140,0 +144,0 @@ */ |
@@ -8,6 +8,2 @@ import { Provider } from './auth.js'; | ||
/** | ||
* Custom name of the connector | ||
*/ | ||
name: string; | ||
/** | ||
* The provider type | ||
@@ -14,0 +10,0 @@ */ |
@@ -48,5 +48,5 @@ import { BaseMessage, BaseCreateMessage } from './messages.js'; | ||
label?: string; | ||
links?: string; | ||
opens?: string; | ||
threadReplies?: string; | ||
links?: boolean; | ||
opens?: boolean; | ||
threadReplies?: boolean; | ||
} | ||
@@ -53,0 +53,0 @@ /** |
@@ -195,2 +195,8 @@ import { ListQueryParams } from './listQueryParams.js'; | ||
/** | ||
* Interface representing a request to send RSVP to an event. | ||
*/ | ||
export type SendRsvpRequest = { | ||
status: RsvpStatus; | ||
}; | ||
/** | ||
* Interface representing the query parameters for listing events. | ||
@@ -295,2 +301,6 @@ */ | ||
/** | ||
* Interface representing of the query parameters for sending RSVP to an event. | ||
*/ | ||
export type SendRsvpQueryParams = FindEventQueryParams; | ||
/** | ||
* Enum representing the status of an event. | ||
@@ -300,2 +310,6 @@ */ | ||
/** | ||
* Enum representing the status of an RSVP response. | ||
*/ | ||
type RsvpStatus = 'yes' | 'no' | 'maybe'; | ||
/** | ||
* Enum representing the visibility of an event. | ||
@@ -302,0 +316,0 @@ */ |
/** | ||
* Interface representing a base response to a request. | ||
*/ | ||
export interface NylasBaseResponse { | ||
requestId: string; | ||
} | ||
/** | ||
* Interface representation of a Nylas response object | ||
@@ -32,10 +38,4 @@ */ | ||
/** | ||
* Interface representing a response to a delete request. | ||
*/ | ||
export interface NylasDeleteResponse { | ||
requestId: string; | ||
} | ||
/** | ||
* Helper type for pagination | ||
*/ | ||
export type ListResponseInnerType<T> = T extends NylasListResponse<infer R> ? R : never; |
@@ -12,2 +12,6 @@ import APIClient from './apiClient.js'; | ||
import { Connectors } from './resources/connectors.js'; | ||
import { Folders } from './resources/folders.js'; | ||
import { Grants } from './resources/grants.js'; | ||
import { Contacts } from './resources/contacts.js'; | ||
import { Attachments } from './resources/attachments.js'; | ||
/** | ||
@@ -25,2 +29,6 @@ * The entry point to the Node SDK | ||
/** | ||
* Access the Attachments API | ||
*/ | ||
attachments: Attachments; | ||
/** | ||
* Access the Auth API | ||
@@ -38,2 +46,6 @@ */ | ||
/** | ||
* Access the Contacts API | ||
*/ | ||
contacts: Contacts; | ||
/** | ||
* Access the Drafts API | ||
@@ -47,2 +59,6 @@ */ | ||
/** | ||
* Access the Grants API | ||
*/ | ||
grants: Grants; | ||
/** | ||
* Access the Messages API | ||
@@ -60,2 +76,6 @@ */ | ||
/** | ||
* Access the Folders API | ||
*/ | ||
folders: Folders; | ||
/** | ||
* The configured API client | ||
@@ -62,0 +82,0 @@ * @ignore Not for public use |
@@ -1,6 +0,13 @@ | ||
import APIClient from '../apiClient.js'; | ||
import { Resource } from './resource.js'; | ||
import { Grants } from './grants.js'; | ||
import { URLForAdminConsentConfig, URLForAuthenticationConfig, CodeExchangeRequest, PKCEAuthURL, TokenExchangeRequest, CodeExchangeResponse, ProviderDetectParams, ProviderDetectResponse } from '../models/auth.js'; | ||
import { Overrides } from '../config.js'; | ||
import { NylasResponse } from '../models/response.js'; | ||
import { CreateGrantRequest, Grant } from '../models/grants.js'; | ||
/** | ||
* @property requestBody The values to create the Grant with. | ||
*/ | ||
interface CreateGrantParams { | ||
requestBody: CreateGrantRequest; | ||
} | ||
/** | ||
* A collection of authentication related API endpoints | ||
@@ -13,11 +20,2 @@ * | ||
/** | ||
* Access the Grants API | ||
*/ | ||
grants: Grants; | ||
apiClient: APIClient; | ||
/** | ||
* @param apiClient The configured Nylas API client | ||
*/ | ||
constructor(apiClient: APIClient); | ||
/** | ||
* Build the URL for authenticating users to your application with OAuth 2.0 | ||
@@ -54,2 +52,7 @@ * @param config The configuration for building the URL | ||
/** | ||
* Create a grant via Custom Authentication | ||
* @return The created grant | ||
*/ | ||
customAuthentication({ requestBody, overrides, }: CreateGrantParams & Overrides): Promise<NylasResponse<Grant>>; | ||
/** | ||
* Revoke a token (and the grant attached to the token) | ||
@@ -69,1 +72,2 @@ * @param token The token to revoke | ||
} | ||
export {}; |
import { Overrides } from '../config.js'; | ||
import { Calendar, CreateCalenderRequest, ListCalendersQueryParams, UpdateCalenderRequest } from '../models/calendars.js'; | ||
import { NylasDeleteResponse, NylasResponse, NylasListResponse } from '../models/response.js'; | ||
import { NylasBaseResponse, NylasResponse, NylasListResponse } from '../models/response.js'; | ||
import { Resource, AsyncListResponse } from './resource.js'; | ||
@@ -100,3 +100,3 @@ import { GetAvailabilityRequest, GetAvailabilityResponse } from '../models/availability.js'; | ||
*/ | ||
destroy({ identifier, calendarId, overrides, }: DestroyCalendarParams & Overrides): Promise<NylasDeleteResponse>; | ||
destroy({ identifier, calendarId, overrides, }: DestroyCalendarParams & Overrides): Promise<NylasBaseResponse>; | ||
/** | ||
@@ -103,0 +103,0 @@ * Get Availability for a given account / accounts |
import { AsyncListResponse, Resource } from './resource.js'; | ||
import { Connector, CreateConnectorRequest, ListConnectorsQueryParams, UpdateConnectorRequest } from '../models/connectors.js'; | ||
import { Overrides } from '../config.js'; | ||
import { NylasDeleteResponse, NylasListResponse, NylasResponse } from '../models/response.js'; | ||
import { NylasBaseResponse, NylasListResponse, NylasResponse } from '../models/response.js'; | ||
import { Provider } from '../models/auth.js'; | ||
@@ -78,4 +78,4 @@ import { Credentials } from './credentials.js'; | ||
*/ | ||
destroy({ provider, overrides, }: DestroyConnectorParams & Overrides): Promise<NylasDeleteResponse>; | ||
destroy({ provider, overrides, }: DestroyConnectorParams & Overrides): Promise<NylasBaseResponse>; | ||
} | ||
export {}; |
import { AsyncListResponse, Resource } from './resource.js'; | ||
import { Credential, CreateCredentialRequest, ListCredentialsQueryParams, UpdateCredentialRequest } from '../models/credentials.js'; | ||
import { Overrides } from '../config.js'; | ||
import { NylasDeleteResponse, NylasListResponse, NylasResponse } from '../models/response.js'; | ||
import { NylasBaseResponse, NylasListResponse, NylasResponse } from '../models/response.js'; | ||
import { Provider } from '../models/auth.js'; | ||
@@ -78,4 +78,4 @@ /** | ||
*/ | ||
destroy({ provider, credentialsId, overrides, }: DestroyCredentialParams & Overrides): Promise<NylasDeleteResponse>; | ||
destroy({ provider, credentialsId, overrides, }: DestroyCredentialParams & Overrides): Promise<NylasBaseResponse>; | ||
} | ||
export {}; |
import { AsyncListResponse, Resource } from './resource.js'; | ||
import { CreateDraftRequest, Draft, ListDraftsQueryParams, UpdateDraftRequest } from '../models/drafts.js'; | ||
import { Overrides } from '../config.js'; | ||
import { NylasDeleteResponse, NylasListResponse, NylasResponse } from '../models/response.js'; | ||
import { NylasBaseResponse, NylasListResponse, NylasResponse } from '../models/response.js'; | ||
/** | ||
@@ -81,3 +81,3 @@ * The parameters for the {@link Drafts.list} method | ||
*/ | ||
destroy({ identifier, draftId, overrides, }: DestroyDraftParams & Overrides): Promise<NylasDeleteResponse>; | ||
destroy({ identifier, draftId, overrides, }: DestroyDraftParams & Overrides): Promise<NylasBaseResponse>; | ||
/** | ||
@@ -84,0 +84,0 @@ * Send a Draft |
import { Overrides } from '../config.js'; | ||
import { CreateEventQueryParams, CreateEventRequest, DestroyEventQueryParams, Event, FindEventQueryParams, ListEventQueryParams, UpdateEventQueryParams, UpdateEventRequest } from '../models/events.js'; | ||
import { NylasDeleteResponse, NylasResponse, NylasListResponse } from '../models/response.js'; | ||
import { CreateEventQueryParams, CreateEventRequest, DestroyEventQueryParams, Event, FindEventQueryParams, ListEventQueryParams, SendRsvpQueryParams, SendRsvpRequest, UpdateEventQueryParams, UpdateEventRequest } from '../models/events.js'; | ||
import { NylasBaseResponse, NylasResponse, NylasListResponse } from '../models/response.js'; | ||
import { AsyncListResponse, Resource } from './resource.js'; | ||
@@ -56,2 +56,14 @@ /** | ||
/** | ||
* @property identifier The identifier of the grant to act upon | ||
* @property eventId The id of the Event to update. | ||
* @property queryParams The query parameters to include in the request | ||
* @property requestBody The values to send the RSVP with | ||
*/ | ||
interface SendRsvpParams { | ||
identifier: string; | ||
eventId: string; | ||
queryParams: SendRsvpQueryParams; | ||
requestBody: SendRsvpRequest; | ||
} | ||
/** | ||
* Nylas Events API | ||
@@ -86,4 +98,11 @@ * | ||
*/ | ||
destroy({ identifier, eventId, queryParams, overrides, }: DestroyEventParams & Overrides): Promise<NylasDeleteResponse>; | ||
destroy({ identifier, eventId, queryParams, overrides, }: DestroyEventParams & Overrides): Promise<NylasBaseResponse>; | ||
/** | ||
* Send RSVP. Allows users to respond to events they have been added to as an attendee. | ||
* You cannot send RSVP as an event owner/organizer. | ||
* You cannot directly update events as an invitee, since you are not the owner/organizer. | ||
* @return The send-rsvp response | ||
*/ | ||
sendRsvp({ identifier, eventId, requestBody, queryParams, overrides, }: SendRsvpParams & Overrides): Promise<NylasBaseResponse>; | ||
} | ||
export {}; |
import { Resource } from './resource.js'; | ||
import { Overrides } from '../config.js'; | ||
import { NylasDeleteResponse, NylasResponse, NylasListResponse } from '../models/response.js'; | ||
import { CreateGrantRequest, Grant, ListGrantsQueryParams, UpdateGrantRequest } from '../models/grants.js'; | ||
import { NylasBaseResponse, NylasResponse, NylasListResponse } from '../models/response.js'; | ||
import { Grant, ListGrantsQueryParams, UpdateGrantRequest } from '../models/grants.js'; | ||
/** | ||
@@ -12,8 +12,2 @@ * @property grantId The id of the Grant to retrieve. | ||
/** | ||
* @property requestBody The values to create the Grant with. | ||
*/ | ||
interface CreateGrantParams { | ||
requestBody: CreateGrantRequest; | ||
} | ||
/** | ||
* @property grantId The id of the Grant to update. | ||
@@ -49,7 +43,2 @@ * @property requestBody The values to update the Grant with. | ||
/** | ||
* Create a Grant via Custom Authentication | ||
* @return The created Grant | ||
*/ | ||
create({ requestBody, overrides, }: CreateGrantParams & Overrides): Promise<NylasResponse<Grant>>; | ||
/** | ||
* Update a Grant | ||
@@ -63,4 +52,4 @@ * @return The updated Grant | ||
*/ | ||
destroy({ grantId, overrides, }: DestroyGrantParams & Overrides): Promise<NylasDeleteResponse>; | ||
destroy({ grantId, overrides, }: DestroyGrantParams & Overrides): Promise<NylasBaseResponse>; | ||
} | ||
export {}; |
import { AsyncListResponse, Resource } from './resource.js'; | ||
import { BaseCreateMessage, FindMessageQueryParams, ListMessagesQueryParams, Message, ScheduledMessage, ScheduledMessagesList, StopScheduledMessageResponse, UpdateMessageRequest } from '../models/messages.js'; | ||
import { Overrides } from '../config.js'; | ||
import { NylasDeleteResponse, NylasListResponse, NylasResponse } from '../models/response.js'; | ||
import { NylasBaseResponse, NylasListResponse, NylasResponse } from '../models/response.js'; | ||
import { SendMessageRequest, UpdateDraftRequest } from '../models/drafts.js'; | ||
@@ -107,3 +107,3 @@ import * as FormData from 'form-data'; | ||
*/ | ||
destroy({ identifier, messageId, overrides, }: DestroyMessageParams & Overrides): Promise<NylasDeleteResponse>; | ||
destroy({ identifier, messageId, overrides, }: DestroyMessageParams & Overrides): Promise<NylasBaseResponse>; | ||
/** | ||
@@ -110,0 +110,0 @@ * Send an email |
import { AsyncListResponse, Resource } from './resource.js'; | ||
import { NylasDeleteResponse, NylasResponse, NylasListResponse } from '../models/response.js'; | ||
import { NylasBaseResponse, NylasResponse, NylasListResponse } from '../models/response.js'; | ||
import { CreateRedirectUriRequest, RedirectUri, UpdateRedirectUriRequest } from '../models/redirectUri.js'; | ||
@@ -61,4 +61,4 @@ import { Overrides } from '../config.js'; | ||
*/ | ||
destroy({ redirectUriId, overrides, }: DestroyRedirectUrisParams & Overrides): Promise<NylasResponse<NylasDeleteResponse>>; | ||
destroy({ redirectUriId, overrides, }: DestroyRedirectUrisParams & Overrides): Promise<NylasResponse<NylasBaseResponse>>; | ||
} | ||
export {}; |
@@ -0,1 +1,3 @@ | ||
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
import APIClient from '../apiClient.js'; | ||
@@ -48,2 +50,4 @@ import { OverridableNylasConfig } from '../config.js'; | ||
protected _destroy<T>({ path, queryParams, overrides, }: DestroyParams): Promise<T>; | ||
protected _getRaw({ path, queryParams, overrides, }: FindParams<void>): Promise<Buffer>; | ||
protected _getStream({ path, queryParams, overrides, }: FindParams<void>): Promise<NodeJS.ReadableStream>; | ||
} | ||
@@ -50,0 +54,0 @@ type ListYieldReturn<T> = T & { |
import { ListThreadsQueryParams, Thread, UpdateThreadRequest } from '../models/threads.js'; | ||
import { AsyncListResponse, Resource } from './resource.js'; | ||
import { Overrides } from '../config.js'; | ||
import { NylasDeleteResponse, NylasListResponse, NylasResponse } from '../models/response.js'; | ||
import { NylasBaseResponse, NylasListResponse, NylasResponse } from '../models/response.js'; | ||
/** | ||
@@ -69,3 +69,3 @@ * The parameters for the {@link Threads.list} method | ||
*/ | ||
destroy({ identifier, threadId, overrides, }: DestroyThreadParams & Overrides): Promise<NylasDeleteResponse>; | ||
destroy({ identifier, threadId, overrides, }: DestroyThreadParams & Overrides): Promise<NylasBaseResponse>; | ||
} |
@@ -1,1 +0,1 @@ | ||
export declare const SDK_VERSION = "7.0.0-beta.3"; | ||
export declare const SDK_VERSION = "7.0.0-beta.4"; |
{ | ||
"name": "nylas", | ||
"version": "7.0.0-beta.3", | ||
"version": "7.0.0-beta.4", | ||
"description": "A NodeJS wrapper for the Nylas REST API for email, contacts, and calendar.", | ||
@@ -5,0 +5,0 @@ "main": "lib/cjs/nylas.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
243299
137
7695