nylas 6.4.1 → 6.4.2

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.
@@ -67,6 +67,7 @@ export default class Event extends RestfulModel {
67
67
  originalStartTime?: number;
68
68
  capacity?: number;
69
69
  conferencing?: EventConferencing;
70
+ reminderMinutes?: string;
70
71
  notifications?: EventNotification[];
71
72
  roundRobinOrder?: string[];
72
73
  metadata?: object;
@@ -258,6 +258,9 @@ var Event = /** @class */ (function (_super) {
258
258
  }), conferencing: attributes_1.default.Object({
259
259
  modelKey: 'conferencing',
260
260
  itemClass: event_conferencing_1.default,
261
+ }), reminderMinutes: attributes_1.default.String({
262
+ modelKey: 'reminderMinutes',
263
+ jsonKey: 'reminder_minutes',
261
264
  }), notifications: attributes_1.default.Collection({
262
265
  modelKey: 'notifications',
263
266
  itemClass: event_notification_1.default,
@@ -1,4 +1,4 @@
1
- import RestfulModel from './restful-model';
1
+ import RestfulModel, { SaveCallback } from './restful-model';
2
2
  import { Attribute } from './attributes';
3
3
  import File, { FileProperties } from './file';
4
4
  import Event, { EventProperties } from './event';
@@ -53,4 +53,5 @@ export default class Message extends RestfulModel implements MessageProperties {
53
53
  fileIds(): (string | undefined)[];
54
54
  getRaw(): Promise<string>;
55
55
  saveRequestBody(): Record<string, unknown>;
56
+ save(params?: {} | SaveCallback, callback?: SaveCallback): Promise<this>;
56
57
  }
@@ -106,6 +106,14 @@ var Message = /** @class */ (function (_super) {
106
106
  json['metadata'] = this.metadata;
107
107
  return json;
108
108
  };
109
+ Message.prototype.save = function (params, callback) {
110
+ if (params === void 0) { params = {}; }
111
+ // A Message can only be updated
112
+ if (this.constructor.name === 'Message' && !this.id) {
113
+ throw new Error('Cannot create a message. Please create and send a draft instead.');
114
+ }
115
+ return _super.prototype.save.call(this, params, callback);
116
+ };
109
117
  Message.collectionName = 'messages';
110
118
  Message.attributes = __assign(__assign({}, restful_model_1.default.attributes), { subject: attributes_1.default.String({
111
119
  modelKey: 'subject',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nylas",
3
- "version": "6.4.1",
3
+ "version": "6.4.2",
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",