nylas 6.4.2 → 6.5.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.
@@ -37,7 +37,7 @@ export declare type EventProperties = {
37
37
  timezone: string;
38
38
  };
39
39
  masterEventId?: string;
40
- originalStartTime?: number;
40
+ originalStartTime?: Date;
41
41
  capacity?: number;
42
42
  conferencing?: EventConferencingProperties;
43
43
  notifications?: EventNotificationProperties[];
@@ -64,7 +64,7 @@ export default class Event extends RestfulModel {
64
64
  timezone: string;
65
65
  };
66
66
  masterEventId?: string;
67
- originalStartTime?: number;
67
+ originalStartTime?: Date;
68
68
  capacity?: number;
69
69
  conferencing?: EventConferencing;
70
70
  reminderMinutes?: string;
@@ -8,6 +8,7 @@ export declare type JobStatusProperties = {
8
8
  jobStatusId?: string;
9
9
  status?: string;
10
10
  originalData?: Message;
11
+ metadata?: object;
11
12
  };
12
13
  export default class JobStatus extends RestfulModel implements JobStatusProperties {
13
14
  action?: string;
@@ -15,6 +16,7 @@ export default class JobStatus extends RestfulModel implements JobStatusProperti
15
16
  jobStatusId?: string;
16
17
  status?: string;
17
18
  originalData?: Message;
19
+ metadata?: object;
18
20
  static collectionName: string;
19
21
  static attributes: Record<string, Attribute>;
20
22
  constructor(connection: NylasConnection, props?: JobStatusProperties);
@@ -59,6 +59,9 @@ var JobStatus = /** @class */ (function (_super) {
59
59
  modelKey: 'originalData',
60
60
  jsonKey: 'original_data',
61
61
  readOnly: true,
62
+ }), metadata: attributes_1.default.Object({
63
+ modelKey: 'metadata',
64
+ readOnly: true,
62
65
  }) });
63
66
  return JobStatus;
64
67
  }(restful_model_1.default));
@@ -104,6 +104,7 @@ export declare type SchedulerBookingProperties = {
104
104
  minBookingNotice?: number;
105
105
  minBuffer?: number;
106
106
  minCancellationNotice?: number;
107
+ intervalMinutes?: number;
107
108
  nameFieldHidden?: boolean;
108
109
  openingHours?: SchedulerBookingOpeningHoursProperties[];
109
110
  schedulingMethod?: string;
@@ -120,6 +121,7 @@ export declare class SchedulerBooking extends Model implements SchedulerBookingP
120
121
  minBookingNotice?: number;
121
122
  minBuffer?: number;
122
123
  minCancellationNotice?: number;
124
+ intervalMinutes?: number;
123
125
  nameFieldHidden?: boolean;
124
126
  openingHours?: SchedulerBookingOpeningHours[];
125
127
  schedulingMethod?: string;
@@ -220,4 +222,5 @@ export default class Scheduler extends RestfulModel implements SchedulerProperti
220
222
  save(params?: {} | SaveCallback, callback?: SaveCallback): Promise<this>;
221
223
  getAvailableCalendars(): Promise<SchedulerAvailableCalendars[]>;
222
224
  uploadImage(contentType: string, objectName: string): Promise<SchedulerUploadImageResponse>;
225
+ private validate;
223
226
  }
@@ -178,7 +178,7 @@ var SchedulerBookingOpeningHours = /** @class */ (function (_super) {
178
178
  return _this;
179
179
  }
180
180
  SchedulerBookingOpeningHours.attributes = {
181
- dropdownOptions: attributes_1.default.String({
181
+ accountId: attributes_1.default.String({
182
182
  modelKey: 'accountId',
183
183
  jsonKey: 'account_id',
184
184
  }),
@@ -230,7 +230,7 @@ var SchedulerBooking = /** @class */ (function (_super) {
230
230
  }),
231
231
  confirmationEmailToHost: attributes_1.default.Boolean({
232
232
  modelKey: 'confirmationEmailToHost',
233
- jsonKey: 'confirmation_email_to_host',
233
+ jsonKey: 'confirmation_emails_to_host',
234
234
  }),
235
235
  confirmationMethod: attributes_1.default.String({
236
236
  modelKey: 'confirmationMethod',
@@ -248,6 +248,10 @@ var SchedulerBooking = /** @class */ (function (_super) {
248
248
  modelKey: 'minCancellationNotice',
249
249
  jsonKey: 'min_cancellation_notice',
250
250
  }),
251
+ intervalMinutes: attributes_1.default.Number({
252
+ modelKey: 'intervalMinutes',
253
+ jsonKey: 'interval_minutes',
254
+ }),
251
255
  nameFieldHidden: attributes_1.default.Boolean({
252
256
  modelKey: 'nameFieldHidden',
253
257
  jsonKey: 'name_field_hidden',
@@ -356,6 +360,7 @@ var Scheduler = /** @class */ (function (_super) {
356
360
  }
357
361
  Scheduler.prototype.save = function (params, callback) {
358
362
  if (params === void 0) { params = {}; }
363
+ this.validate();
359
364
  return _super.prototype.save.call(this, params, callback);
360
365
  };
361
366
  Scheduler.prototype.getAvailableCalendars = function () {
@@ -396,6 +401,14 @@ var Scheduler = /** @class */ (function (_super) {
396
401
  baseUrl: this.baseUrl,
397
402
  });
398
403
  };
404
+ Scheduler.prototype.validate = function () {
405
+ var _a, _b;
406
+ var bookingIntervalMinutes = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.booking) === null || _b === void 0 ? void 0 : _b.intervalMinutes;
407
+ if (bookingIntervalMinutes !== undefined &&
408
+ (bookingIntervalMinutes <= 0 || bookingIntervalMinutes % 5 != 0)) {
409
+ throw new Error('SchedulerBooking.intervalMinutes must be a non-zero positive integer, divisible by 5.');
410
+ }
411
+ };
399
412
  Scheduler.collectionName = 'manage/pages';
400
413
  Scheduler.attributes = __assign(__assign({}, restful_model_1.default.attributes), { accessTokens: attributes_1.default.StringList({
401
414
  modelKey: 'accessTokens',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nylas",
3
- "version": "6.4.2",
3
+ "version": "6.5.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",