nylas 6.7.0 → 6.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/config.d.ts +30 -0
- package/lib/config.js +30 -0
- package/lib/models/event.d.ts +2 -0
- package/lib/models/event.js +3 -0
- package/lib/models/nylas-api-error.js +1 -0
- package/lib/models/restful-model-collection.d.ts +1 -1
- package/lib/models/webhook.d.ts +1 -0
- package/lib/models/webhook.js +1 -0
- package/lib/models/when.d.ts +6 -0
- package/lib/models/when.js +11 -0
- package/lib/nylas-connection.js +21 -4
- package/lib/nylas.d.ts +2 -0
- package/lib/nylas.js +12 -0
- package/lib/services/tunnel.d.ts +28 -0
- package/lib/services/tunnel.js +89 -0
- package/package.json +6 -2
package/lib/config.d.ts
CHANGED
|
@@ -1,11 +1,19 @@
|
|
|
1
|
+
import { WebhookTriggers } from './models/webhook';
|
|
1
2
|
export declare let apiServer: string | null;
|
|
2
3
|
export declare function setApiServer(newApiServer: string | null): void;
|
|
3
4
|
export declare let clientSecret: string;
|
|
4
5
|
export declare function setClientSecret(newClientSecret: string): void;
|
|
6
|
+
export declare let timeout: number;
|
|
7
|
+
export declare function setTimeout(newTimeout: number): void;
|
|
5
8
|
export declare type NylasConfig = {
|
|
9
|
+
/** Nylas application client ID */
|
|
6
10
|
clientId: string;
|
|
11
|
+
/** Nylas application client secret */
|
|
7
12
|
clientSecret: string;
|
|
13
|
+
/** API Server base URL */
|
|
8
14
|
apiServer?: string;
|
|
15
|
+
/** Timeout for outgoing API calls, in milliseconds */
|
|
16
|
+
timeout?: number;
|
|
9
17
|
};
|
|
10
18
|
export declare enum ResponseType {
|
|
11
19
|
CODE = "code",
|
|
@@ -20,3 +28,25 @@ export declare type AuthenticateUrlConfig = {
|
|
|
20
28
|
scopes?: string[];
|
|
21
29
|
responseType?: ResponseType;
|
|
22
30
|
};
|
|
31
|
+
export declare enum Region {
|
|
32
|
+
Us = "us",
|
|
33
|
+
Ireland = "ireland"
|
|
34
|
+
}
|
|
35
|
+
export declare const DEFAULT_REGION = Region.Us;
|
|
36
|
+
export declare const regionConfig: {
|
|
37
|
+
us: {
|
|
38
|
+
nylasAPIUrl: string;
|
|
39
|
+
dashboardApiUrl: string;
|
|
40
|
+
callbackDomain: string;
|
|
41
|
+
websocketDomain: string;
|
|
42
|
+
telemetryApiUrl: string;
|
|
43
|
+
};
|
|
44
|
+
ireland: {
|
|
45
|
+
nylasAPIUrl: string;
|
|
46
|
+
dashboardApiUrl: string;
|
|
47
|
+
callbackDomain: string;
|
|
48
|
+
websocketDomain: string;
|
|
49
|
+
telemetryApiUrl: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
export declare const DEFAULT_WEBHOOK_TRIGGERS: WebhookTriggers[];
|
package/lib/config.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var _a;
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
var webhook_1 = require("./models/webhook");
|
|
3
5
|
exports.apiServer = null;
|
|
4
6
|
function setApiServer(newApiServer) {
|
|
5
7
|
exports.apiServer = newApiServer;
|
|
@@ -10,8 +12,36 @@ function setClientSecret(newClientSecret) {
|
|
|
10
12
|
exports.clientSecret = newClientSecret;
|
|
11
13
|
}
|
|
12
14
|
exports.setClientSecret = setClientSecret;
|
|
15
|
+
exports.timeout = 0;
|
|
16
|
+
function setTimeout(newTimeout) {
|
|
17
|
+
exports.timeout = newTimeout;
|
|
18
|
+
}
|
|
19
|
+
exports.setTimeout = setTimeout;
|
|
13
20
|
var ResponseType;
|
|
14
21
|
(function (ResponseType) {
|
|
15
22
|
ResponseType["CODE"] = "code";
|
|
16
23
|
ResponseType["TOKEN"] = "token";
|
|
17
24
|
})(ResponseType = exports.ResponseType || (exports.ResponseType = {}));
|
|
25
|
+
var Region;
|
|
26
|
+
(function (Region) {
|
|
27
|
+
Region["Us"] = "us";
|
|
28
|
+
Region["Ireland"] = "ireland";
|
|
29
|
+
})(Region = exports.Region || (exports.Region = {}));
|
|
30
|
+
exports.DEFAULT_REGION = Region.Us;
|
|
31
|
+
exports.regionConfig = (_a = {},
|
|
32
|
+
_a[Region.Us] = {
|
|
33
|
+
nylasAPIUrl: 'https://api.nylas.com',
|
|
34
|
+
dashboardApiUrl: 'https://dashboard-api.nylas.com',
|
|
35
|
+
callbackDomain: 'cb.nylas.com',
|
|
36
|
+
websocketDomain: 'tunnel.nylas.com',
|
|
37
|
+
telemetryApiUrl: 'https://cli.nylas.com',
|
|
38
|
+
},
|
|
39
|
+
_a[Region.Ireland] = {
|
|
40
|
+
nylasAPIUrl: 'https://ireland.api.nylas.com',
|
|
41
|
+
dashboardApiUrl: 'https://ireland.dashboard.nylas.com',
|
|
42
|
+
callbackDomain: 'cb.nylas.com',
|
|
43
|
+
websocketDomain: 'tunnel.nylas.com',
|
|
44
|
+
telemetryApiUrl: 'https://cli.nylas.com',
|
|
45
|
+
},
|
|
46
|
+
_a);
|
|
47
|
+
exports.DEFAULT_WEBHOOK_TRIGGERS = Object.values(webhook_1.WebhookTriggers);
|
package/lib/models/event.d.ts
CHANGED
|
@@ -47,6 +47,7 @@ export declare type EventProperties = {
|
|
|
47
47
|
jobStatusId?: string;
|
|
48
48
|
organizerEmail?: string;
|
|
49
49
|
organizerName?: string;
|
|
50
|
+
hideParticipants?: boolean;
|
|
50
51
|
visibility?: string;
|
|
51
52
|
customerEventId?: string;
|
|
52
53
|
reminderMinutes?: string;
|
|
@@ -84,6 +85,7 @@ export default class Event extends RestfulModel {
|
|
|
84
85
|
jobStatusId?: string;
|
|
85
86
|
organizerEmail?: string;
|
|
86
87
|
organizerName?: string;
|
|
88
|
+
hideParticipants?: boolean;
|
|
87
89
|
visibility?: string;
|
|
88
90
|
customerEventId?: string;
|
|
89
91
|
static collectionName: string;
|
package/lib/models/event.js
CHANGED
|
@@ -294,6 +294,9 @@ var Event = /** @class */ (function (_super) {
|
|
|
294
294
|
modelKey: 'organizerName',
|
|
295
295
|
jsonKey: 'organizer_name',
|
|
296
296
|
readOnly: true,
|
|
297
|
+
}), hideParticipants: attributes_1.default.Boolean({
|
|
298
|
+
modelKey: 'hideParticipants',
|
|
299
|
+
jsonKey: 'hide_participants',
|
|
297
300
|
}), visibility: attributes_1.default.String({
|
|
298
301
|
modelKey: 'visibility',
|
|
299
302
|
}), customerEventId: attributes_1.default.String({
|
|
@@ -2,7 +2,7 @@ import NylasConnection from '../nylas-connection';
|
|
|
2
2
|
import RestfulModel from './restful-model';
|
|
3
3
|
import ModelCollection from './model-collection';
|
|
4
4
|
export declare type GetCallback = (error: Error | null, result?: RestfulModel) => void;
|
|
5
|
-
export default class RestfulModelCollection<T extends RestfulModel> extends ModelCollection<
|
|
5
|
+
export default class RestfulModelCollection<T extends RestfulModel> extends ModelCollection<T> {
|
|
6
6
|
modelClass: typeof RestfulModel;
|
|
7
7
|
constructor(modelClass: typeof RestfulModel, connection: NylasConnection);
|
|
8
8
|
count(params?: Record<string, unknown>, callback?: (err: Error | null, num?: number) => void): Promise<number>;
|
package/lib/models/webhook.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export declare enum WebhookTriggers {
|
|
|
8
8
|
AccountStopped = "account.stopped",
|
|
9
9
|
AccountInvalid = "account.invalid",
|
|
10
10
|
AccountSyncError = "account.sync_error",
|
|
11
|
+
MessageBounced = "message.bounced",
|
|
11
12
|
MessageCreated = "message.created",
|
|
12
13
|
MessageOpened = "message.opened",
|
|
13
14
|
MessageUpdated = "message.updated",
|
package/lib/models/webhook.js
CHANGED
|
@@ -25,6 +25,7 @@ var WebhookTriggers;
|
|
|
25
25
|
WebhookTriggers["AccountStopped"] = "account.stopped";
|
|
26
26
|
WebhookTriggers["AccountInvalid"] = "account.invalid";
|
|
27
27
|
WebhookTriggers["AccountSyncError"] = "account.sync_error";
|
|
28
|
+
WebhookTriggers["MessageBounced"] = "message.bounced";
|
|
28
29
|
WebhookTriggers["MessageCreated"] = "message.created";
|
|
29
30
|
WebhookTriggers["MessageOpened"] = "message.opened";
|
|
30
31
|
WebhookTriggers["MessageUpdated"] = "message.updated";
|
package/lib/models/when.d.ts
CHANGED
|
@@ -3,7 +3,10 @@ import { Attribute } from './attributes';
|
|
|
3
3
|
export declare type WhenProperties = {
|
|
4
4
|
startTime?: number;
|
|
5
5
|
endTime?: number;
|
|
6
|
+
startTimezone?: string;
|
|
7
|
+
endTimezone?: string;
|
|
6
8
|
time?: number;
|
|
9
|
+
timezone?: string;
|
|
7
10
|
startDate?: string;
|
|
8
11
|
endDate?: string;
|
|
9
12
|
date?: string;
|
|
@@ -12,7 +15,10 @@ export declare type WhenProperties = {
|
|
|
12
15
|
export default class When extends Model implements WhenProperties {
|
|
13
16
|
startTime?: number;
|
|
14
17
|
endTime?: number;
|
|
18
|
+
startTimezone?: string;
|
|
19
|
+
endTimezone?: string;
|
|
15
20
|
time?: number;
|
|
21
|
+
timezone?: string;
|
|
16
22
|
startDate?: string;
|
|
17
23
|
endDate?: string;
|
|
18
24
|
date?: string;
|
package/lib/models/when.js
CHANGED
|
@@ -41,9 +41,20 @@ var When = /** @class */ (function (_super) {
|
|
|
41
41
|
modelKey: 'endTime',
|
|
42
42
|
jsonKey: 'end_time',
|
|
43
43
|
}),
|
|
44
|
+
startTimezone: attributes_1.default.String({
|
|
45
|
+
modelKey: 'startTimezone',
|
|
46
|
+
jsonKey: 'start_timezone',
|
|
47
|
+
}),
|
|
48
|
+
endTimezone: attributes_1.default.String({
|
|
49
|
+
modelKey: 'endTimezone',
|
|
50
|
+
jsonKey: 'end_timezone',
|
|
51
|
+
}),
|
|
44
52
|
time: attributes_1.default.Number({
|
|
45
53
|
modelKey: 'time',
|
|
46
54
|
}),
|
|
55
|
+
timezone: attributes_1.default.String({
|
|
56
|
+
modelKey: 'timezone',
|
|
57
|
+
}),
|
|
47
58
|
startDate: attributes_1.default.String({
|
|
48
59
|
modelKey: 'startDate',
|
|
49
60
|
jsonKey: 'start_date',
|
package/lib/nylas-connection.js
CHANGED
|
@@ -10,6 +10,9 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
13
16
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
14
17
|
if (mod && mod.__esModule) return mod;
|
|
15
18
|
var result = {};
|
|
@@ -17,12 +20,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
17
20
|
result["default"] = mod;
|
|
18
21
|
return result;
|
|
19
22
|
};
|
|
20
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
21
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
22
|
-
};
|
|
23
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
24
|
// TODO since node 10 URL is global
|
|
25
25
|
var url_1 = require("url");
|
|
26
|
+
// TODO since node 15 AbortController is global
|
|
27
|
+
var abort_controller_1 = __importDefault(require("abort-controller"));
|
|
26
28
|
var node_fetch_1 = __importStar(require("node-fetch"));
|
|
27
29
|
var config = __importStar(require("./config"));
|
|
28
30
|
var restful_model_collection_1 = __importDefault(require("./models/restful-model-collection"));
|
|
@@ -181,8 +183,16 @@ var NylasConnection = /** @class */ (function () {
|
|
|
181
183
|
NylasConnection.prototype.request = function (options) {
|
|
182
184
|
var _this = this;
|
|
183
185
|
var req = this.newRequest(options);
|
|
186
|
+
var controller;
|
|
187
|
+
var timeout;
|
|
188
|
+
if (config.timeout && config.timeout !== 0) {
|
|
189
|
+
controller = new abort_controller_1.default();
|
|
190
|
+
timeout = setTimeout(function () {
|
|
191
|
+
controller.abort();
|
|
192
|
+
}, 150);
|
|
193
|
+
}
|
|
184
194
|
return new Promise(function (resolve, reject) {
|
|
185
|
-
return node_fetch_1.default(req)
|
|
195
|
+
return node_fetch_1.default(req, { signal: controller === null || controller === void 0 ? void 0 : controller.signal })
|
|
186
196
|
.then(function (response) {
|
|
187
197
|
if (typeof response === 'undefined') {
|
|
188
198
|
return reject(new Error('No response'));
|
|
@@ -255,8 +265,15 @@ var NylasConnection = /** @class */ (function () {
|
|
|
255
265
|
}
|
|
256
266
|
})
|
|
257
267
|
.catch(function (err) {
|
|
268
|
+
if (err && err.name && err.name === 'AbortError') {
|
|
269
|
+
console.warn('Request timed out');
|
|
270
|
+
return reject(err);
|
|
271
|
+
}
|
|
258
272
|
console.error("Error encountered during request:\n" + err.stack);
|
|
259
273
|
return reject(err);
|
|
274
|
+
})
|
|
275
|
+
.then(function () {
|
|
276
|
+
clearTimeout(timeout);
|
|
260
277
|
});
|
|
261
278
|
});
|
|
262
279
|
};
|
package/lib/nylas.d.ts
CHANGED
|
@@ -14,6 +14,8 @@ declare class Nylas {
|
|
|
14
14
|
static set clientSecret(newClientSecret: string);
|
|
15
15
|
static get apiServer(): string | null;
|
|
16
16
|
static set apiServer(newApiServer: string | null);
|
|
17
|
+
static get timeout(): number;
|
|
18
|
+
static set timeout(timeout: number);
|
|
17
19
|
static accounts: ManagementModelCollection<ManagementAccount> | RestfulModelCollection<Account>;
|
|
18
20
|
static connect: Connect;
|
|
19
21
|
static webhooks: ManagementModelCollection<Webhook>;
|
package/lib/nylas.js
CHANGED
|
@@ -46,6 +46,17 @@ var Nylas = /** @class */ (function () {
|
|
|
46
46
|
enumerable: true,
|
|
47
47
|
configurable: true
|
|
48
48
|
});
|
|
49
|
+
Object.defineProperty(Nylas, "timeout", {
|
|
50
|
+
get: function () {
|
|
51
|
+
return config.timeout;
|
|
52
|
+
},
|
|
53
|
+
// Timeout for outgoing API calls, in milliseconds
|
|
54
|
+
set: function (timeout) {
|
|
55
|
+
config.setTimeout(timeout);
|
|
56
|
+
},
|
|
57
|
+
enumerable: true,
|
|
58
|
+
configurable: true
|
|
59
|
+
});
|
|
49
60
|
Nylas.config = function (config) {
|
|
50
61
|
if (config.apiServer && config.apiServer.indexOf('://') === -1) {
|
|
51
62
|
throw new Error('Please specify a fully qualified URL for the API Server.');
|
|
@@ -62,6 +73,7 @@ var Nylas = /** @class */ (function () {
|
|
|
62
73
|
else {
|
|
63
74
|
this.apiServer = 'https://api.nylas.com';
|
|
64
75
|
}
|
|
76
|
+
this.timeout = config.timeout || 0;
|
|
65
77
|
var conn = new nylas_connection_1.default(this.clientSecret, {
|
|
66
78
|
clientId: this.clientId,
|
|
67
79
|
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { client as WebSocketClient } from 'websocket';
|
|
2
|
+
import { Region } from '../config';
|
|
3
|
+
import Webhook, { WebhookTriggers } from '../models/webhook';
|
|
4
|
+
import { WebhookDelta } from '../models/webhook-notification';
|
|
5
|
+
export interface OpenWebhookTunnelOptions {
|
|
6
|
+
onMessage: (msg: WebhookDelta) => void;
|
|
7
|
+
onConnectFail?: (error: Error) => void;
|
|
8
|
+
onError?: (error: Error) => void;
|
|
9
|
+
onClose?: (wsClient: WebSocketClient) => void;
|
|
10
|
+
onConnect?: (wsClient: WebSocketClient) => void;
|
|
11
|
+
region?: Region;
|
|
12
|
+
triggers?: WebhookTriggers[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Open a webhook tunnel and register it with the Nylas API
|
|
16
|
+
* 1. Creates a UUID
|
|
17
|
+
* 2. Opens a websocket connection to Nylas' webhook forwarding service,
|
|
18
|
+
* with the UUID as a header
|
|
19
|
+
* 3. Creates a new webhook pointed at the forwarding service with the UUID as the path
|
|
20
|
+
*
|
|
21
|
+
* When an event is received by the forwarding service, it will push directly to this websocket
|
|
22
|
+
* connection
|
|
23
|
+
*
|
|
24
|
+
* @param config Configuration for the webhook tunnel, including callback functions,
|
|
25
|
+
* region, and events to subscribe to
|
|
26
|
+
* @return The webhook details response from the API
|
|
27
|
+
*/
|
|
28
|
+
export declare const openWebhookTunnel: (config: OpenWebhookTunnelOptions) => Promise<Webhook>;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var websocket_1 = require("websocket");
|
|
7
|
+
var uuid_1 = require("uuid");
|
|
8
|
+
var config_1 = require("../config");
|
|
9
|
+
var nylas_1 = __importDefault(require("../nylas"));
|
|
10
|
+
var webhook_notification_1 = require("../models/webhook-notification");
|
|
11
|
+
/**
|
|
12
|
+
* Create a webhook to the Nylas forwarding service which will pass messages to our websocket
|
|
13
|
+
* @param callbackDomain The domain name of the callback
|
|
14
|
+
* @param tunnelPath The path to the tunnel
|
|
15
|
+
* @param triggers The list of triggers to subscribe to
|
|
16
|
+
* @return The webhook details response from the API
|
|
17
|
+
*/
|
|
18
|
+
var buildTunnelWebhook = function (callbackDomain, tunnelPath, triggers) {
|
|
19
|
+
var callbackUrl = "https://" + callbackDomain + "/" + tunnelPath;
|
|
20
|
+
return nylas_1.default.webhooks
|
|
21
|
+
.build({
|
|
22
|
+
callbackUrl: callbackUrl,
|
|
23
|
+
state: 'active',
|
|
24
|
+
test: true,
|
|
25
|
+
triggers: triggers,
|
|
26
|
+
})
|
|
27
|
+
.save();
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Open a webhook tunnel and register it with the Nylas API
|
|
31
|
+
* 1. Creates a UUID
|
|
32
|
+
* 2. Opens a websocket connection to Nylas' webhook forwarding service,
|
|
33
|
+
* with the UUID as a header
|
|
34
|
+
* 3. Creates a new webhook pointed at the forwarding service with the UUID as the path
|
|
35
|
+
*
|
|
36
|
+
* When an event is received by the forwarding service, it will push directly to this websocket
|
|
37
|
+
* connection
|
|
38
|
+
*
|
|
39
|
+
* @param config Configuration for the webhook tunnel, including callback functions,
|
|
40
|
+
* region, and events to subscribe to
|
|
41
|
+
* @return The webhook details response from the API
|
|
42
|
+
*/
|
|
43
|
+
exports.openWebhookTunnel = function (config) {
|
|
44
|
+
var triggers = config.triggers || config_1.DEFAULT_WEBHOOK_TRIGGERS;
|
|
45
|
+
var region = config.region || config_1.DEFAULT_REGION;
|
|
46
|
+
var _a = config_1.regionConfig[region], websocketDomain = _a.websocketDomain, callbackDomain = _a.callbackDomain;
|
|
47
|
+
// This UUID will map our websocket to a webhook in the forwarding server
|
|
48
|
+
var tunnelId = uuid_1.v4();
|
|
49
|
+
var client = new websocket_1.client({ closeTimeout: 60000 });
|
|
50
|
+
client.on('connectFailed', function (error) {
|
|
51
|
+
config.onConnectFail && config.onConnectFail(error);
|
|
52
|
+
});
|
|
53
|
+
client.on('connect', function (connection) {
|
|
54
|
+
config.onConnect && config.onConnect(client);
|
|
55
|
+
connection.on('error', function (error) {
|
|
56
|
+
config.onError && config.onError(error);
|
|
57
|
+
});
|
|
58
|
+
connection.on('close', function () {
|
|
59
|
+
config.onClose && config.onClose(client);
|
|
60
|
+
});
|
|
61
|
+
connection.on('message', function (message) {
|
|
62
|
+
// This shouldn't happen. If any of these are seen, open an issue
|
|
63
|
+
if (message.type === 'binary') {
|
|
64
|
+
config.onError &&
|
|
65
|
+
config.onError(new Error('Unknown binary message received'));
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
try {
|
|
69
|
+
var req = JSON.parse(message.utf8Data);
|
|
70
|
+
var deltas = JSON.parse(req.body).deltas;
|
|
71
|
+
deltas.forEach(function (delta) {
|
|
72
|
+
return config.onMessage(new webhook_notification_1.WebhookDelta().fromJSON(delta));
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
catch (e) {
|
|
76
|
+
config.onError &&
|
|
77
|
+
config.onError(new Error("Error converting Nylas websocket event to JSON: " + (e &&
|
|
78
|
+
e.message)));
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
client.connect("wss://" + websocketDomain, undefined, undefined, {
|
|
83
|
+
'Client-Id': nylas_1.default.clientId,
|
|
84
|
+
'Client-Secret': nylas_1.default.clientSecret,
|
|
85
|
+
'Tunnel-Id': tunnelId,
|
|
86
|
+
Region: region,
|
|
87
|
+
});
|
|
88
|
+
return buildTunnelWebhook(callbackDomain, tunnelId, triggers);
|
|
89
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nylas",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.9.0",
|
|
4
4
|
"description": "A NodeJS wrapper for the Nylas REST API for email, contacts, and calendar.",
|
|
5
5
|
"main": "lib/nylas.js",
|
|
6
6
|
"types": "lib/nylas.d.ts",
|
|
@@ -47,7 +47,9 @@
|
|
|
47
47
|
"backoff": "^2.5.0",
|
|
48
48
|
"form-data": "^4.0.0",
|
|
49
49
|
"JSONStream": "^1.3.5",
|
|
50
|
-
"node-fetch": "^2.6.1"
|
|
50
|
+
"node-fetch": "^2.6.1",
|
|
51
|
+
"uuid": "^8.3.2",
|
|
52
|
+
"websocket": "^1.0.34"
|
|
51
53
|
},
|
|
52
54
|
"devDependencies": {
|
|
53
55
|
"@babel/cli": "^7.13.16",
|
|
@@ -57,6 +59,8 @@
|
|
|
57
59
|
"@types/backoff": "^2.5.1",
|
|
58
60
|
"@types/jest": "^25.1.4",
|
|
59
61
|
"@types/node-fetch": "^2.5.8",
|
|
62
|
+
"@types/uuid": "^8.3.4",
|
|
63
|
+
"@types/websocket": "^1.0.5",
|
|
60
64
|
"@typescript-eslint/eslint-plugin": "^2.25.0",
|
|
61
65
|
"@typescript-eslint/parser": "^2.25.0",
|
|
62
66
|
"babel-eslint": "^10.0.1",
|