nylas 5.6.0 → 5.10.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/README.md +7 -7
- package/lib/config.js +1 -0
- package/lib/models/attributes.d.ts +2 -0
- package/lib/models/attributes.js +16 -0
- package/lib/models/calendar-restful-model-collection.d.ts +30 -0
- package/lib/models/calendar-restful-model-collection.js +45 -0
- package/lib/models/calendar.d.ts +2 -0
- package/lib/models/calendar.js +3 -0
- package/lib/models/component-restful-model-collection.d.ts +9 -0
- package/lib/models/component-restful-model-collection.js +34 -0
- package/lib/models/component.d.ts +16 -0
- package/lib/models/component.js +76 -0
- package/lib/models/contact.js +1 -0
- package/lib/models/event-conferencing.d.ts +24 -0
- package/lib/models/event-conferencing.js +84 -0
- package/lib/models/event-notification.d.ts +11 -0
- package/lib/models/event-notification.js +65 -0
- package/lib/models/event.d.ts +7 -0
- package/lib/models/event.js +31 -2
- package/lib/models/folder.js +1 -0
- package/lib/models/management-account.d.ts +7 -0
- package/lib/models/management-account.js +14 -0
- package/lib/models/message.d.ts +1 -0
- package/lib/models/message.js +3 -0
- package/lib/models/neural-categorizer.js +51 -4
- package/lib/models/neural-signature-contact.d.ts +5 -5
- package/lib/models/neural-signature-contact.js +17 -17
- package/lib/models/neural.d.ts +4 -5
- package/lib/models/neural.js +33 -52
- package/lib/models/restful-model-collection.d.ts +1 -0
- package/lib/models/restful-model-collection.js +5 -0
- package/lib/models/restful-model.d.ts +1 -0
- package/lib/models/restful-model.js +3 -1
- package/lib/models/scheduler-booking-request.d.ts +30 -0
- package/lib/models/scheduler-booking-request.js +133 -0
- package/lib/models/scheduler-restful-model-collection.d.ts +25 -0
- package/lib/models/scheduler-restful-model-collection.js +136 -0
- package/lib/models/scheduler-time-slot.d.ts +9 -0
- package/lib/models/scheduler-time-slot.js +52 -0
- package/lib/models/scheduler.d.ts +98 -0
- package/lib/models/scheduler.js +140 -0
- package/lib/nylas-connection.d.ts +5 -0
- package/lib/nylas-connection.js +28 -6
- package/lib/nylas.js +19 -7
- package/package.json +1 -1
- package/CHANGELOG.md +0 -200
package/README.md
CHANGED
|
@@ -2,16 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://travis-ci.org/nylas/nylas-nodejs)
|
|
4
4
|
|
|
5
|
-
This is the GitHub repository for the Nylas Node SDK and this repo is primarily for anyone who wants to make contributions to the SDK or install it from source. If you are looking to use Node to access the Nylas Email, Calendar, or Contacts API you should refer to our official [Node SDK Quickstart Guide](https://
|
|
5
|
+
This is the GitHub repository for the Nylas Node SDK and this repo is primarily for anyone who wants to make contributions to the SDK or install it from source. If you are looking to use Node to access the Nylas Email, Calendar, or Contacts API you should refer to our official [Node SDK Quickstart Guide](https://developer.nylas.com/docs/developer-tools/sdk/node-sdk/).
|
|
6
6
|
|
|
7
|
-
The Nylas Communications Platform provides REST APIs for [Email](https://
|
|
7
|
+
The Nylas Communications Platform provides REST APIs for [Email](https://developer.nylas.com/docs/connectivity/email/), [Calendar](https://developer.nylas.com/docs/connectivity/calendar/), and [Contacts](https://developer.nylas.com/docs/connectivity/contacts/), and the Node SDK is the quickest way to build your integration using JavaScript.
|
|
8
8
|
|
|
9
9
|
Here are some resources to help you get started:
|
|
10
10
|
|
|
11
|
-
- [Nylas SDK Tutorials](https://
|
|
12
|
-
- [
|
|
13
|
-
- [
|
|
14
|
-
- [Nylas API Reference](https://docs.nylas.com/reference)
|
|
11
|
+
- [Nylas SDK Tutorials](https://developer.nylas.com/docs/the-basics/tutorials/nodejs/)
|
|
12
|
+
- [Quickstart](https://developer.nylas.com/docs/the-basics/quickstart/)
|
|
13
|
+
- [Nylas API Reference](https://developer.nylas.com/docs/api/)
|
|
15
14
|
|
|
16
15
|
|
|
17
16
|
# Install
|
|
@@ -30,6 +29,7 @@ git clone https://github.com/nylas/nylas-nodejs.git
|
|
|
30
29
|
cd nylas-nodejs
|
|
31
30
|
npm install
|
|
32
31
|
```
|
|
32
|
+
|
|
33
33
|
# Usage
|
|
34
34
|
|
|
35
35
|
Every resource (i.e., messages, events, contacts) is accessed via an instance of `Nylas`. Before making any requests, be sure to call `config` and initialize the `Nylas` instance with your `clientId` and `clientSecret`. Then, call `with` and pass it your `accessToken`. The `accessToken` allows `Nylas` to make requests for a given account's resources.
|
|
@@ -52,7 +52,7 @@ nylas.threads.list({}).then(threads => {
|
|
|
52
52
|
});
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
-
For more information about how to use the Nylas Node SDK, [take a look at our quickstart guide](https://
|
|
55
|
+
For more information about how to use the Nylas Node SDK, [take a look at our quickstart guide](https://developer.nylas.com/docs/developer-tools/sdk/node-sdk/).
|
|
56
56
|
|
|
57
57
|
# Contributing
|
|
58
58
|
|
package/lib/config.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setClientSecret = exports.clientSecret = exports.setApiServer = exports.apiServer = void 0;
|
|
3
4
|
exports.apiServer = null;
|
|
4
5
|
function setApiServer(newApiServer) {
|
|
5
6
|
exports.apiServer = newApiServer;
|
|
@@ -19,6 +19,8 @@ declare class AttributeObject extends Attribute {
|
|
|
19
19
|
itemClass?: typeof RestfulModel;
|
|
20
20
|
readOnly?: boolean;
|
|
21
21
|
});
|
|
22
|
+
toJSON(val: any): any;
|
|
23
|
+
fromJSON(val: any, _parent: any): any;
|
|
22
24
|
}
|
|
23
25
|
declare class AttributeNumber extends Attribute {
|
|
24
26
|
toJSON(val: any): any;
|
package/lib/models/attributes.js
CHANGED
|
@@ -20,6 +20,7 @@ var __spreadArrays = (this && this.__spreadArrays) || function () {
|
|
|
20
20
|
return r;
|
|
21
21
|
};
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
exports.Attribute = void 0;
|
|
23
24
|
// The Attribute class represents a single model attribute, like 'namespace_id'
|
|
24
25
|
// Subclasses of Attribute like AttributeDateTime know how to covert between
|
|
25
26
|
// the JSON representation of that type and the javascript representation.
|
|
@@ -48,6 +49,21 @@ var AttributeObject = /** @class */ (function (_super) {
|
|
|
48
49
|
_this.itemClass = itemClass;
|
|
49
50
|
return _this;
|
|
50
51
|
}
|
|
52
|
+
AttributeObject.prototype.toJSON = function (val) {
|
|
53
|
+
if (!val) {
|
|
54
|
+
return val;
|
|
55
|
+
}
|
|
56
|
+
if (val.toJSON != null) {
|
|
57
|
+
return val.toJSON();
|
|
58
|
+
}
|
|
59
|
+
return val;
|
|
60
|
+
};
|
|
61
|
+
AttributeObject.prototype.fromJSON = function (val, _parent) {
|
|
62
|
+
if (!val || !this.itemClass) {
|
|
63
|
+
return val;
|
|
64
|
+
}
|
|
65
|
+
return new this.itemClass(_parent.connection, val);
|
|
66
|
+
};
|
|
51
67
|
return AttributeObject;
|
|
52
68
|
}(Attribute));
|
|
53
69
|
var AttributeNumber = /** @class */ (function (_super) {
|
|
@@ -43,4 +43,34 @@ export default class CalendarRestfulModelCollection extends RestfulModelCollecti
|
|
|
43
43
|
}, callback?: (error: Error | null, data?: {
|
|
44
44
|
[key: string]: any;
|
|
45
45
|
}) => void): Promise<any>;
|
|
46
|
+
consecutiveAvailability(options: {
|
|
47
|
+
emails: Array<string[]>;
|
|
48
|
+
duration: number;
|
|
49
|
+
interval: number;
|
|
50
|
+
start_time?: number;
|
|
51
|
+
startTime?: number;
|
|
52
|
+
end_time?: number;
|
|
53
|
+
endTime?: number;
|
|
54
|
+
buffer?: number;
|
|
55
|
+
free_busy?: Array<{
|
|
56
|
+
email: string;
|
|
57
|
+
object: string;
|
|
58
|
+
time_slots: Array<{
|
|
59
|
+
object: string;
|
|
60
|
+
status: string;
|
|
61
|
+
start_time: number;
|
|
62
|
+
end_time: number;
|
|
63
|
+
}>;
|
|
64
|
+
}>;
|
|
65
|
+
open_hours: Array<{
|
|
66
|
+
emails: string[];
|
|
67
|
+
days: number[];
|
|
68
|
+
timezone: string;
|
|
69
|
+
start: string;
|
|
70
|
+
end: string;
|
|
71
|
+
object_type: string;
|
|
72
|
+
}>;
|
|
73
|
+
}, callback?: (error: Error | null, data?: {
|
|
74
|
+
[key: string]: any;
|
|
75
|
+
}) => void): Promise<any>;
|
|
46
76
|
}
|
|
@@ -78,6 +78,51 @@ var CalendarRestfulModelCollection = /** @class */ (function (_super) {
|
|
|
78
78
|
return Promise.reject(err);
|
|
79
79
|
});
|
|
80
80
|
};
|
|
81
|
+
CalendarRestfulModelCollection.prototype.consecutiveAvailability = function (options, callback) {
|
|
82
|
+
var freeBusyEmails = options.free_busy
|
|
83
|
+
? options.free_busy.map(function (freeBusy) { return freeBusy.email; })
|
|
84
|
+
: [];
|
|
85
|
+
for (var _i = 0, _a = options.open_hours; _i < _a.length; _i++) {
|
|
86
|
+
var openHour = _a[_i];
|
|
87
|
+
var _loop_1 = function (email) {
|
|
88
|
+
if (!options.emails.some(function (row) { return row.includes(email); }) &&
|
|
89
|
+
!freeBusyEmails.includes(email)) {
|
|
90
|
+
throw new Error('Open Hours cannot contain an email not present in the main email list or the free busy email list.');
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
for (var _b = 0, _c = openHour.emails; _b < _c.length; _b++) {
|
|
94
|
+
var email = _c[_b];
|
|
95
|
+
_loop_1(email);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return this.connection
|
|
99
|
+
.request({
|
|
100
|
+
method: 'POST',
|
|
101
|
+
path: "/calendars/availability/consecutive",
|
|
102
|
+
body: {
|
|
103
|
+
emails: options.emails,
|
|
104
|
+
duration_minutes: options.duration,
|
|
105
|
+
interval_minutes: options.interval,
|
|
106
|
+
start_time: options.startTime || options.start_time,
|
|
107
|
+
end_time: options.endTime || options.end_time,
|
|
108
|
+
buffer: options.buffer,
|
|
109
|
+
free_busy: options.free_busy || [],
|
|
110
|
+
open_hours: options.open_hours,
|
|
111
|
+
},
|
|
112
|
+
})
|
|
113
|
+
.then(function (json) {
|
|
114
|
+
if (callback) {
|
|
115
|
+
callback(null, json);
|
|
116
|
+
}
|
|
117
|
+
return Promise.resolve(json);
|
|
118
|
+
})
|
|
119
|
+
.catch(function (err) {
|
|
120
|
+
if (callback) {
|
|
121
|
+
callback(err);
|
|
122
|
+
}
|
|
123
|
+
return Promise.reject(err);
|
|
124
|
+
});
|
|
125
|
+
};
|
|
81
126
|
return CalendarRestfulModelCollection;
|
|
82
127
|
}(restful_model_collection_1.default));
|
|
83
128
|
exports.default = CalendarRestfulModelCollection;
|
package/lib/models/calendar.d.ts
CHANGED
|
@@ -8,12 +8,14 @@ export default class Calendar extends RestfulModel {
|
|
|
8
8
|
timezone?: string;
|
|
9
9
|
isPrimary?: boolean;
|
|
10
10
|
jobStatusId?: string;
|
|
11
|
+
metadata?: object;
|
|
11
12
|
save(params?: {} | SaveCallback, callback?: SaveCallback): Promise<this>;
|
|
12
13
|
saveRequestBody(): {
|
|
13
14
|
name: any;
|
|
14
15
|
description: any;
|
|
15
16
|
location: any;
|
|
16
17
|
timezone: any;
|
|
18
|
+
metadata: any;
|
|
17
19
|
};
|
|
18
20
|
getJobStatus(callback?: GetCallback): Promise<import("./job-status").default>;
|
|
19
21
|
}
|
package/lib/models/calendar.js
CHANGED
|
@@ -45,6 +45,7 @@ var Calendar = /** @class */ (function (_super) {
|
|
|
45
45
|
description: calendarJSON.description,
|
|
46
46
|
location: calendarJSON.location,
|
|
47
47
|
timezone: calendarJSON.timezone,
|
|
48
|
+
metadata: calendarJSON.metadata,
|
|
48
49
|
};
|
|
49
50
|
};
|
|
50
51
|
Calendar.prototype.getJobStatus = function (callback) {
|
|
@@ -78,4 +79,6 @@ Calendar.attributes = __assign(__assign({}, restful_model_1.default.attributes),
|
|
|
78
79
|
}), jobStatusId: attributes_1.default.String({
|
|
79
80
|
modelKey: 'jobStatusId',
|
|
80
81
|
jsonKey: 'job_status_id',
|
|
82
|
+
}), metadata: attributes_1.default.Object({
|
|
83
|
+
modelKey: 'metadata',
|
|
81
84
|
}) });
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import RestfulModelCollection from './restful-model-collection';
|
|
2
|
+
import NylasConnection from '../nylas-connection';
|
|
3
|
+
import Component from './component';
|
|
4
|
+
export default class ComponentRestfulModelCollection extends RestfulModelCollection<Component> {
|
|
5
|
+
connection: NylasConnection;
|
|
6
|
+
modelClass: typeof Component;
|
|
7
|
+
constructor(connection: NylasConnection);
|
|
8
|
+
path(): string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
extendStatics(d, b);
|
|
11
|
+
function __() { this.constructor = d; }
|
|
12
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
+
};
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
var restful_model_collection_1 = __importDefault(require("./restful-model-collection"));
|
|
20
|
+
var component_1 = __importDefault(require("./component"));
|
|
21
|
+
var ComponentRestfulModelCollection = /** @class */ (function (_super) {
|
|
22
|
+
__extends(ComponentRestfulModelCollection, _super);
|
|
23
|
+
function ComponentRestfulModelCollection(connection) {
|
|
24
|
+
var _this = _super.call(this, component_1.default, connection) || this;
|
|
25
|
+
_this.connection = connection;
|
|
26
|
+
_this.modelClass = component_1.default;
|
|
27
|
+
return _this;
|
|
28
|
+
}
|
|
29
|
+
ComponentRestfulModelCollection.prototype.path = function () {
|
|
30
|
+
return "/component/" + this.connection.clientId;
|
|
31
|
+
};
|
|
32
|
+
return ComponentRestfulModelCollection;
|
|
33
|
+
}(restful_model_collection_1.default));
|
|
34
|
+
exports.default = ComponentRestfulModelCollection;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import RestfulModel, { SaveCallback } from './restful-model';
|
|
2
|
+
export default class Component extends RestfulModel {
|
|
3
|
+
name?: string;
|
|
4
|
+
type?: string;
|
|
5
|
+
action?: number;
|
|
6
|
+
active?: boolean;
|
|
7
|
+
settings?: object;
|
|
8
|
+
allowedDomains?: string[];
|
|
9
|
+
publicAccountId?: string;
|
|
10
|
+
publicTokenId?: string;
|
|
11
|
+
publicApplicationId?: string;
|
|
12
|
+
createdAt?: Date;
|
|
13
|
+
updatedAt?: Date;
|
|
14
|
+
saveEndpoint(): string;
|
|
15
|
+
save(params?: {} | SaveCallback, callback?: SaveCallback): Promise<this>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
extendStatics(d, b);
|
|
11
|
+
function __() { this.constructor = d; }
|
|
12
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
var __assign = (this && this.__assign) || function () {
|
|
16
|
+
__assign = Object.assign || function(t) {
|
|
17
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
18
|
+
s = arguments[i];
|
|
19
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
20
|
+
t[p] = s[p];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
return __assign.apply(this, arguments);
|
|
25
|
+
};
|
|
26
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
27
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
28
|
+
};
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
var restful_model_1 = __importDefault(require("./restful-model"));
|
|
31
|
+
var attributes_1 = __importDefault(require("./attributes"));
|
|
32
|
+
var Component = /** @class */ (function (_super) {
|
|
33
|
+
__extends(Component, _super);
|
|
34
|
+
function Component() {
|
|
35
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
36
|
+
}
|
|
37
|
+
Component.prototype.saveEndpoint = function () {
|
|
38
|
+
return "/component/" + this.connection.clientId;
|
|
39
|
+
};
|
|
40
|
+
Component.prototype.save = function (params, callback) {
|
|
41
|
+
if (params === void 0) { params = {}; }
|
|
42
|
+
return this._save(params, callback);
|
|
43
|
+
};
|
|
44
|
+
return Component;
|
|
45
|
+
}(restful_model_1.default));
|
|
46
|
+
exports.default = Component;
|
|
47
|
+
Component.collectionName = 'component';
|
|
48
|
+
Component.attributes = __assign(__assign({}, restful_model_1.default.attributes), { name: attributes_1.default.String({
|
|
49
|
+
modelKey: 'name',
|
|
50
|
+
}), type: attributes_1.default.String({
|
|
51
|
+
modelKey: 'type',
|
|
52
|
+
}), action: attributes_1.default.Number({
|
|
53
|
+
modelKey: 'action',
|
|
54
|
+
}), active: attributes_1.default.Boolean({
|
|
55
|
+
modelKey: 'active',
|
|
56
|
+
}), settings: attributes_1.default.Object({
|
|
57
|
+
modelKey: 'settings',
|
|
58
|
+
}), allowedDomains: attributes_1.default.StringList({
|
|
59
|
+
modelKey: 'allowedDomains',
|
|
60
|
+
jsonKey: 'allowed_domains',
|
|
61
|
+
}), publicAccountId: attributes_1.default.String({
|
|
62
|
+
modelKey: 'publicAccountId',
|
|
63
|
+
jsonKey: 'public_account_id',
|
|
64
|
+
}), publicTokenId: attributes_1.default.String({
|
|
65
|
+
modelKey: 'publicTokenId',
|
|
66
|
+
jsonKey: 'public_token_id',
|
|
67
|
+
}), publicApplicationId: attributes_1.default.String({
|
|
68
|
+
modelKey: 'publicApplicationId',
|
|
69
|
+
jsonKey: 'public_application_id',
|
|
70
|
+
}), createdAt: attributes_1.default.Date({
|
|
71
|
+
modelKey: 'createdAt',
|
|
72
|
+
jsonKey: 'created_at',
|
|
73
|
+
}), updatedAt: attributes_1.default.Date({
|
|
74
|
+
modelKey: 'updatedAt',
|
|
75
|
+
jsonKey: 'updated_at',
|
|
76
|
+
}) });
|
package/lib/models/contact.js
CHANGED
|
@@ -27,6 +27,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
28
28
|
};
|
|
29
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.Contact = exports.Group = exports.WebPage = exports.PhoneNumber = exports.EmailAddress = void 0;
|
|
30
31
|
var restful_model_1 = __importDefault(require("./restful-model"));
|
|
31
32
|
var attributes_1 = __importDefault(require("./attributes"));
|
|
32
33
|
var EmailAddress = /** @class */ (function (_super) {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import RestfulModel from './restful-model';
|
|
2
|
+
declare class EventConferencingDetails extends RestfulModel {
|
|
3
|
+
meetingCode?: string;
|
|
4
|
+
phone?: string[];
|
|
5
|
+
password?: string;
|
|
6
|
+
pin?: string;
|
|
7
|
+
url?: string;
|
|
8
|
+
toJSON(): {
|
|
9
|
+
meeting_code: string | undefined;
|
|
10
|
+
phone: string[] | undefined;
|
|
11
|
+
password: string | undefined;
|
|
12
|
+
pin: string | undefined;
|
|
13
|
+
url: string | undefined;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export declare class EventConferencing extends RestfulModel {
|
|
17
|
+
details?: EventConferencingDetails;
|
|
18
|
+
provider?: string;
|
|
19
|
+
autocreate?: {
|
|
20
|
+
settings?: object;
|
|
21
|
+
};
|
|
22
|
+
toJSON(): any;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
extendStatics(d, b);
|
|
11
|
+
function __() { this.constructor = d; }
|
|
12
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
+
};
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.EventConferencing = void 0;
|
|
20
|
+
var restful_model_1 = __importDefault(require("./restful-model"));
|
|
21
|
+
var attributes_1 = __importDefault(require("./attributes"));
|
|
22
|
+
var EventConferencingDetails = /** @class */ (function (_super) {
|
|
23
|
+
__extends(EventConferencingDetails, _super);
|
|
24
|
+
function EventConferencingDetails() {
|
|
25
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
26
|
+
}
|
|
27
|
+
EventConferencingDetails.prototype.toJSON = function () {
|
|
28
|
+
return {
|
|
29
|
+
meeting_code: this.meetingCode,
|
|
30
|
+
phone: this.phone,
|
|
31
|
+
password: this.password,
|
|
32
|
+
pin: this.pin,
|
|
33
|
+
url: this.url,
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
return EventConferencingDetails;
|
|
37
|
+
}(restful_model_1.default));
|
|
38
|
+
EventConferencingDetails.collectionName = 'event_conferencing_details';
|
|
39
|
+
EventConferencingDetails.attributes = {
|
|
40
|
+
meetingCode: attributes_1.default.String({
|
|
41
|
+
modelKey: 'meetingCode',
|
|
42
|
+
jsonKey: 'meeting_code',
|
|
43
|
+
}),
|
|
44
|
+
phone: attributes_1.default.StringList({
|
|
45
|
+
modelKey: 'phone',
|
|
46
|
+
}),
|
|
47
|
+
password: attributes_1.default.String({
|
|
48
|
+
modelKey: 'password',
|
|
49
|
+
}),
|
|
50
|
+
pin: attributes_1.default.String({
|
|
51
|
+
modelKey: 'pin',
|
|
52
|
+
}),
|
|
53
|
+
url: attributes_1.default.String({
|
|
54
|
+
modelKey: 'url',
|
|
55
|
+
}),
|
|
56
|
+
};
|
|
57
|
+
var EventConferencing = /** @class */ (function (_super) {
|
|
58
|
+
__extends(EventConferencing, _super);
|
|
59
|
+
function EventConferencing() {
|
|
60
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
61
|
+
}
|
|
62
|
+
EventConferencing.prototype.toJSON = function () {
|
|
63
|
+
return {
|
|
64
|
+
details: this.details,
|
|
65
|
+
provider: this.provider,
|
|
66
|
+
autocreate: this.autocreate,
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
return EventConferencing;
|
|
70
|
+
}(restful_model_1.default));
|
|
71
|
+
exports.EventConferencing = EventConferencing;
|
|
72
|
+
EventConferencing.collectionName = 'event_conferencing';
|
|
73
|
+
EventConferencing.attributes = {
|
|
74
|
+
details: attributes_1.default.Object({
|
|
75
|
+
modelKey: 'details',
|
|
76
|
+
itemClass: EventConferencingDetails,
|
|
77
|
+
}),
|
|
78
|
+
provider: attributes_1.default.String({
|
|
79
|
+
modelKey: 'provider',
|
|
80
|
+
}),
|
|
81
|
+
autocreate: attributes_1.default.Object({
|
|
82
|
+
modelKey: 'autocreate',
|
|
83
|
+
}),
|
|
84
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import RestfulModel from './restful-model';
|
|
2
|
+
export declare class EventNotification extends RestfulModel {
|
|
3
|
+
type?: string;
|
|
4
|
+
minutesBeforeEvent?: number;
|
|
5
|
+
url?: string;
|
|
6
|
+
payload?: string;
|
|
7
|
+
subject?: string;
|
|
8
|
+
body?: string;
|
|
9
|
+
message?: string;
|
|
10
|
+
toJSON(): any;
|
|
11
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
extendStatics(d, b);
|
|
11
|
+
function __() { this.constructor = d; }
|
|
12
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
+
};
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.EventNotification = void 0;
|
|
20
|
+
var restful_model_1 = __importDefault(require("./restful-model"));
|
|
21
|
+
var attributes_1 = __importDefault(require("./attributes"));
|
|
22
|
+
var EventNotification = /** @class */ (function (_super) {
|
|
23
|
+
__extends(EventNotification, _super);
|
|
24
|
+
function EventNotification() {
|
|
25
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
26
|
+
}
|
|
27
|
+
EventNotification.prototype.toJSON = function () {
|
|
28
|
+
return {
|
|
29
|
+
type: this.type,
|
|
30
|
+
minutes_before_event: this.minutesBeforeEvent,
|
|
31
|
+
url: this.url,
|
|
32
|
+
payload: this.payload,
|
|
33
|
+
subject: this.subject,
|
|
34
|
+
body: this.body,
|
|
35
|
+
message: this.message,
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
return EventNotification;
|
|
39
|
+
}(restful_model_1.default));
|
|
40
|
+
exports.EventNotification = EventNotification;
|
|
41
|
+
EventNotification.collectionName = 'event_notification';
|
|
42
|
+
EventNotification.attributes = {
|
|
43
|
+
type: attributes_1.default.String({
|
|
44
|
+
modelKey: 'type',
|
|
45
|
+
}),
|
|
46
|
+
minutesBeforeEvent: attributes_1.default.Number({
|
|
47
|
+
modelKey: 'minutesBeforeEvent',
|
|
48
|
+
jsonKey: 'minutes_before_event',
|
|
49
|
+
}),
|
|
50
|
+
url: attributes_1.default.String({
|
|
51
|
+
modelKey: 'url',
|
|
52
|
+
}),
|
|
53
|
+
payload: attributes_1.default.String({
|
|
54
|
+
modelKey: 'payload',
|
|
55
|
+
}),
|
|
56
|
+
subject: attributes_1.default.String({
|
|
57
|
+
modelKey: 'subject',
|
|
58
|
+
}),
|
|
59
|
+
body: attributes_1.default.String({
|
|
60
|
+
modelKey: 'body',
|
|
61
|
+
}),
|
|
62
|
+
message: attributes_1.default.String({
|
|
63
|
+
modelKey: 'message',
|
|
64
|
+
}),
|
|
65
|
+
};
|
package/lib/models/event.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import RestfulModel, { SaveCallback } from './restful-model';
|
|
2
2
|
import EventParticipant from './event-participant';
|
|
3
|
+
import { EventConferencing } from './event-conferencing';
|
|
4
|
+
import { EventNotification } from './event-notification';
|
|
3
5
|
export default class Event extends RestfulModel {
|
|
4
6
|
calendarId?: string;
|
|
5
7
|
iCalUID?: string;
|
|
@@ -25,7 +27,12 @@ export default class Event extends RestfulModel {
|
|
|
25
27
|
rrule: string[];
|
|
26
28
|
timezone: string;
|
|
27
29
|
};
|
|
30
|
+
masterEventId?: string;
|
|
31
|
+
originalStartTime?: number;
|
|
32
|
+
conferencing?: EventConferencing;
|
|
33
|
+
notifications?: EventNotification[];
|
|
28
34
|
metadata?: object;
|
|
35
|
+
jobStatusId?: string;
|
|
29
36
|
get start(): string | number | undefined;
|
|
30
37
|
set start(val: string | number | undefined);
|
|
31
38
|
get end(): string | number | undefined;
|
package/lib/models/event.js
CHANGED
|
@@ -30,6 +30,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
30
30
|
var restful_model_1 = __importDefault(require("./restful-model"));
|
|
31
31
|
var attributes_1 = __importDefault(require("./attributes"));
|
|
32
32
|
var event_participant_1 = __importDefault(require("./event-participant"));
|
|
33
|
+
var event_conferencing_1 = require("./event-conferencing");
|
|
34
|
+
var event_notification_1 = require("./event-notification");
|
|
33
35
|
var Event = /** @class */ (function (_super) {
|
|
34
36
|
__extends(Event, _super);
|
|
35
37
|
function Event() {
|
|
@@ -68,7 +70,7 @@ var Event = /** @class */ (function (_super) {
|
|
|
68
70
|
}
|
|
69
71
|
}
|
|
70
72
|
},
|
|
71
|
-
enumerable:
|
|
73
|
+
enumerable: false,
|
|
72
74
|
configurable: true
|
|
73
75
|
});
|
|
74
76
|
Object.defineProperty(Event.prototype, "end", {
|
|
@@ -104,7 +106,7 @@ var Event = /** @class */ (function (_super) {
|
|
|
104
106
|
}
|
|
105
107
|
}
|
|
106
108
|
},
|
|
107
|
-
enumerable:
|
|
109
|
+
enumerable: false,
|
|
108
110
|
configurable: true
|
|
109
111
|
});
|
|
110
112
|
Event.prototype.deleteRequestQueryString = function (params) {
|
|
@@ -117,6 +119,11 @@ var Event = /** @class */ (function (_super) {
|
|
|
117
119
|
};
|
|
118
120
|
Event.prototype.save = function (params, callback) {
|
|
119
121
|
if (params === void 0) { params = {}; }
|
|
122
|
+
if (this.conferencing &&
|
|
123
|
+
this.conferencing.details &&
|
|
124
|
+
this.conferencing.autocreate) {
|
|
125
|
+
return Promise.reject(new Error("Cannot set both 'details' and 'autocreate' in conferencing object."));
|
|
126
|
+
}
|
|
120
127
|
return this._save(params, callback);
|
|
121
128
|
};
|
|
122
129
|
Event.prototype.rsvp = function (status, comment, callback) {
|
|
@@ -151,15 +158,18 @@ Event.attributes = __assign(__assign({}, restful_model_1.default.attributes), {
|
|
|
151
158
|
}), iCalUID: attributes_1.default.String({
|
|
152
159
|
modelKey: 'iCalUID',
|
|
153
160
|
jsonKey: 'ical_uid',
|
|
161
|
+
readOnly: true,
|
|
154
162
|
}), messageId: attributes_1.default.String({
|
|
155
163
|
modelKey: 'messageId',
|
|
156
164
|
jsonKey: 'message_id',
|
|
165
|
+
readOnly: true,
|
|
157
166
|
}), title: attributes_1.default.String({
|
|
158
167
|
modelKey: 'title',
|
|
159
168
|
}), description: attributes_1.default.String({
|
|
160
169
|
modelKey: 'description',
|
|
161
170
|
}), owner: attributes_1.default.String({
|
|
162
171
|
modelKey: 'owner',
|
|
172
|
+
readOnly: true,
|
|
163
173
|
}), participants: attributes_1.default.Collection({
|
|
164
174
|
modelKey: 'participants',
|
|
165
175
|
itemClass: event_participant_1.default,
|
|
@@ -174,8 +184,27 @@ Event.attributes = __assign(__assign({}, restful_model_1.default.attributes), {
|
|
|
174
184
|
modelKey: 'busy',
|
|
175
185
|
}), status: attributes_1.default.String({
|
|
176
186
|
modelKey: 'status',
|
|
187
|
+
readOnly: true,
|
|
177
188
|
}), recurrence: attributes_1.default.Object({
|
|
178
189
|
modelKey: 'recurrence',
|
|
190
|
+
}), masterEventId: attributes_1.default.String({
|
|
191
|
+
modelKey: 'masterEventId',
|
|
192
|
+
jsonKey: 'master_event_id',
|
|
193
|
+
readOnly: true,
|
|
194
|
+
}), originalStartTime: attributes_1.default.DateTime({
|
|
195
|
+
modelKey: 'originalStartTime',
|
|
196
|
+
jsonKey: 'original_start_time',
|
|
197
|
+
readOnly: true,
|
|
198
|
+
}), conferencing: attributes_1.default.Object({
|
|
199
|
+
modelKey: 'conferencing',
|
|
200
|
+
itemClass: event_conferencing_1.EventConferencing,
|
|
201
|
+
}), notifications: attributes_1.default.Collection({
|
|
202
|
+
modelKey: 'notifications',
|
|
203
|
+
itemClass: event_notification_1.EventNotification,
|
|
179
204
|
}), metadata: attributes_1.default.Object({
|
|
180
205
|
modelKey: 'metadata',
|
|
206
|
+
}), jobStatusId: attributes_1.default.String({
|
|
207
|
+
modelKey: 'jobStatusId',
|
|
208
|
+
jsonKey: 'job_status_id',
|
|
209
|
+
readOnly: true,
|
|
181
210
|
}) });
|
package/lib/models/folder.js
CHANGED
|
@@ -27,6 +27,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
27
27
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
28
28
|
};
|
|
29
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.Label = exports.Folder = void 0;
|
|
30
31
|
var restful_model_1 = __importDefault(require("./restful-model"));
|
|
31
32
|
var attributes_1 = __importDefault(require("./attributes"));
|
|
32
33
|
var Folder = /** @class */ (function (_super) {
|