nylas 5.10.2 → 5.10.3

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.
@@ -79,6 +79,7 @@ Calendar.attributes = __assign(__assign({}, restful_model_1.default.attributes),
79
79
  }), jobStatusId: attributes_1.default.String({
80
80
  modelKey: 'jobStatusId',
81
81
  jsonKey: 'job_status_id',
82
+ readOnly: true,
82
83
  }), metadata: attributes_1.default.Object({
83
84
  modelKey: 'metadata',
84
85
  }) });
@@ -67,6 +67,7 @@ export declare class Contact extends RestfulModel {
67
67
  webPages?: WebPage[];
68
68
  groups?: Group[];
69
69
  source?: string;
70
+ jobStatusId?: string;
70
71
  save(params?: {} | SaveCallback, callback?: SaveCallback): Promise<this>;
71
72
  getPicture(params?: {
72
73
  [key: string]: any;
@@ -242,4 +242,8 @@ Contact.attributes = __assign(__assign({}, restful_model_1.default.attributes),
242
242
  itemClass: Group,
243
243
  }), source: attributes_1.default.String({
244
244
  modelKey: 'source',
245
+ }), jobStatusId: attributes_1.default.String({
246
+ modelKey: 'jobStatusId',
247
+ jsonKey: 'job_status_id',
248
+ readOnly: true,
245
249
  }) });
@@ -2,6 +2,7 @@ import RestfulModel, { SaveCallback } from './restful-model';
2
2
  export declare class Folder extends RestfulModel {
3
3
  displayName?: string;
4
4
  name?: string;
5
+ jobStatusId?: string;
5
6
  saveRequestBody(): {
6
7
  [key: string]: any;
7
8
  };
@@ -55,6 +55,10 @@ Folder.attributes = __assign(__assign({}, restful_model_1.default.attributes), {
55
55
  }), displayName: attributes_1.default.String({
56
56
  modelKey: 'displayName',
57
57
  jsonKey: 'display_name',
58
+ }), jobStatusId: attributes_1.default.String({
59
+ modelKey: 'jobStatusId',
60
+ jsonKey: 'job_status_id',
61
+ readOnly: true,
58
62
  }) });
59
63
  var Label = /** @class */ (function (_super) {
60
64
  __extends(Label, _super);
@@ -1,7 +1,10 @@
1
1
  import RestfulModel from './restful-model';
2
+ import Message from './message';
2
3
  export default class JobStatus extends RestfulModel {
3
4
  action?: string;
4
5
  createdAt?: Date;
5
6
  jobStatusId?: string;
6
7
  status?: string;
8
+ originalData?: Message;
9
+ isSuccessful(): boolean;
7
10
  }
@@ -34,18 +34,30 @@ var JobStatus = /** @class */ (function (_super) {
34
34
  function JobStatus() {
35
35
  return _super !== null && _super.apply(this, arguments) || this;
36
36
  }
37
+ // Returns the status of a job as a boolean
38
+ JobStatus.prototype.isSuccessful = function () {
39
+ return this.status === 'successful';
40
+ };
37
41
  return JobStatus;
38
42
  }(restful_model_1.default));
39
43
  exports.default = JobStatus;
40
44
  JobStatus.collectionName = 'job-statuses';
41
45
  JobStatus.attributes = __assign(__assign({}, restful_model_1.default.attributes), { action: attributes_1.default.String({
42
46
  modelKey: 'action',
47
+ readOnly: true,
43
48
  }), createdAt: attributes_1.default.DateTime({
44
49
  modelKey: 'createdAt',
45
50
  jsonKey: 'created_at',
51
+ readOnly: true,
46
52
  }), jobStatusId: attributes_1.default.String({
47
53
  modelKey: 'jobStatusId',
48
54
  jsonKey: 'job_status_id',
55
+ readOnly: true,
49
56
  }), status: attributes_1.default.String({
50
57
  modelKey: 'status',
58
+ readOnly: true,
59
+ }), originalData: attributes_1.default.Object({
60
+ modelKey: 'originalData',
61
+ jsonKey: 'original_data',
62
+ readOnly: true,
51
63
  }) });
@@ -25,6 +25,7 @@ export default class Message extends RestfulModel {
25
25
  [key: string]: string;
26
26
  };
27
27
  failures?: any;
28
+ jobStatusId?: string;
28
29
  participants(): EmailParticipant[];
29
30
  fileIds(): (string | undefined)[];
30
31
  getRaw(): Promise<any>;
@@ -154,4 +154,8 @@ Message.attributes = __assign(__assign({}, restful_model_1.default.attributes),
154
154
  modelKey: 'metadata',
155
155
  }), headers: attributes_1.default.Object({
156
156
  modelKey: 'headers',
157
+ }), jobStatusId: attributes_1.default.String({
158
+ modelKey: 'jobStatusId',
159
+ jsonKey: 'job_status_id',
160
+ readOnly: true,
157
161
  }) });
package/lib/nylas.d.ts CHANGED
@@ -32,6 +32,7 @@ declare class Nylas {
32
32
  redirectURI?: string;
33
33
  loginHint?: string;
34
34
  state?: string;
35
+ provider?: string;
35
36
  scopes?: string[];
36
37
  }): string;
37
38
  }
package/lib/nylas.js CHANGED
@@ -170,6 +170,9 @@ var Nylas = /** @class */ (function () {
170
170
  if (options.scopes != null) {
171
171
  url += "&scopes=" + options.scopes.join(',');
172
172
  }
173
+ if (options.provider != null) {
174
+ url += "&provider=" + options.provider;
175
+ }
173
176
  return url;
174
177
  };
175
178
  Nylas.clientId = '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nylas",
3
- "version": "5.10.2",
3
+ "version": "5.10.3",
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",