nylas 6.10.0 → 7.0.0-beta.1
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 +26 -14
- package/lib/cjs/apiClient.js +115 -0
- package/lib/cjs/config.js +32 -0
- package/lib/cjs/models/applicationDetails.js +2 -0
- package/lib/cjs/models/auth.js +2 -0
- package/lib/cjs/models/availability.js +11 -0
- package/lib/cjs/models/calendars.js +2 -0
- package/lib/cjs/models/error.js +53 -0
- package/lib/cjs/models/events.js +2 -0
- package/lib/cjs/models/grants.js +2 -0
- package/lib/cjs/models/listQueryParams.js +2 -0
- package/lib/cjs/models/redirectUri.js +2 -0
- package/lib/cjs/models/response.js +2 -0
- package/lib/cjs/models/webhooks.js +18 -0
- package/lib/cjs/nylas.js +34 -0
- package/lib/cjs/resources/applications.js +30 -0
- package/lib/cjs/resources/auth.js +153 -0
- package/lib/cjs/resources/calendars.js +78 -0
- package/lib/cjs/resources/events.js +69 -0
- package/lib/cjs/resources/grants.js +65 -0
- package/lib/cjs/resources/redirectUris.js +64 -0
- package/lib/cjs/resources/resource.js +111 -0
- package/lib/cjs/resources/webhooks.js +98 -0
- package/lib/cjs/utils.js +58 -0
- package/lib/esm/apiClient.js +112 -0
- package/lib/esm/config.js +29 -0
- package/lib/esm/models/applicationDetails.js +1 -0
- package/lib/esm/models/auth.js +1 -0
- package/lib/esm/models/availability.js +8 -0
- package/lib/esm/models/calendars.js +1 -0
- package/lib/esm/models/error.js +45 -0
- package/lib/esm/models/events.js +1 -0
- package/lib/esm/models/grants.js +1 -0
- package/lib/esm/models/listQueryParams.js +1 -0
- package/lib/esm/models/redirectUri.js +1 -0
- package/lib/esm/models/response.js +1 -0
- package/lib/esm/models/webhooks.js +15 -0
- package/lib/esm/nylas.js +31 -0
- package/lib/esm/resources/applications.js +26 -0
- package/lib/esm/resources/auth.js +149 -0
- package/lib/esm/resources/calendars.js +74 -0
- package/lib/esm/resources/events.js +65 -0
- package/lib/esm/resources/grants.js +61 -0
- package/lib/esm/resources/redirectUris.js +60 -0
- package/lib/esm/resources/resource.js +107 -0
- package/lib/esm/resources/webhooks.js +94 -0
- package/lib/esm/utils.js +53 -0
- package/lib/types/apiClient.d.ts +65 -0
- package/lib/types/config.d.ts +50 -0
- package/lib/types/models/applicationDetails.d.ts +93 -0
- package/lib/types/models/auth.d.ts +196 -0
- package/lib/types/models/availability.d.ts +159 -0
- package/lib/types/models/calendars.d.ts +121 -0
- package/lib/types/models/error.d.ts +104 -0
- package/lib/types/models/events.d.ts +494 -0
- package/lib/types/models/grants.d.ts +134 -0
- package/lib/types/models/listQueryParams.d.ts +4 -0
- package/lib/types/models/redirectUri.d.ts +71 -0
- package/lib/types/models/response.d.ts +40 -0
- package/lib/types/models/webhooks.d.ts +45 -0
- package/lib/types/nylas.d.ts +44 -0
- package/lib/types/resources/applications.d.ts +26 -0
- package/lib/types/resources/auth.d.ts +66 -0
- package/lib/types/resources/calendars.d.ts +97 -0
- package/lib/types/resources/events.d.ts +87 -0
- package/lib/types/resources/grants.d.ts +63 -0
- package/lib/types/resources/redirectUris.d.ts +63 -0
- package/lib/types/resources/resource.d.ts +55 -0
- package/lib/types/resources/webhooks.d.ts +79 -0
- package/lib/types/utils.d.ts +22 -0
- package/package.json +28 -39
- package/lib/config.d.ts +0 -52
- package/lib/config.js +0 -47
- package/lib/models/access-token.d.ts +0 -18
- package/lib/models/access-token.js +0 -56
- package/lib/models/account.d.ts +0 -27
- package/lib/models/account.js +0 -73
- package/lib/models/application-details.d.ts +0 -14
- package/lib/models/application-details.js +0 -47
- package/lib/models/attributes.d.ts +0 -151
- package/lib/models/attributes.js +0 -382
- package/lib/models/calendar-availability.d.ts +0 -76
- package/lib/models/calendar-availability.js +0 -121
- package/lib/models/calendar-restful-model-collection.d.ts +0 -17
- package/lib/models/calendar-restful-model-collection.js +0 -181
- package/lib/models/calendar.d.ts +0 -33
- package/lib/models/calendar.js +0 -97
- package/lib/models/component-restful-model-collection.d.ts +0 -9
- package/lib/models/component-restful-model-collection.js +0 -34
- package/lib/models/component.d.ts +0 -37
- package/lib/models/component.js +0 -91
- package/lib/models/connect.d.ts +0 -73
- package/lib/models/connect.js +0 -193
- package/lib/models/contact-restful-model-collection.d.ts +0 -9
- package/lib/models/contact-restful-model-collection.js +0 -60
- package/lib/models/contact.d.ts +0 -129
- package/lib/models/contact.js +0 -289
- package/lib/models/delta-collection.d.ts +0 -17
- package/lib/models/delta-collection.js +0 -139
- package/lib/models/delta-stream.d.ts +0 -32
- package/lib/models/delta-stream.js +0 -250
- package/lib/models/delta.d.ts +0 -28
- package/lib/models/delta.js +0 -88
- package/lib/models/deltas.d.ts +0 -17
- package/lib/models/deltas.js +0 -49
- package/lib/models/draft.d.ts +0 -27
- package/lib/models/draft.js +0 -156
- package/lib/models/email-participant.d.ts +0 -13
- package/lib/models/email-participant.js +0 -46
- package/lib/models/event-conferencing.d.ts +0 -34
- package/lib/models/event-conferencing.js +0 -71
- package/lib/models/event-notification.d.ts +0 -27
- package/lib/models/event-notification.js +0 -62
- package/lib/models/event-participant.d.ts +0 -19
- package/lib/models/event-participant.js +0 -56
- package/lib/models/event-reminder-method.d.ts +0 -18
- package/lib/models/event-reminder-method.js +0 -47
- package/lib/models/event.d.ts +0 -104
- package/lib/models/event.js +0 -308
- package/lib/models/file.d.ts +0 -29
- package/lib/models/file.js +0 -136
- package/lib/models/folder.d.ts +0 -21
- package/lib/models/folder.js +0 -69
- package/lib/models/free-busy.d.ts +0 -58
- package/lib/models/free-busy.js +0 -132
- package/lib/models/job-status-restful-model-collection.d.ts +0 -9
- package/lib/models/job-status-restful-model-collection.js +0 -38
- package/lib/models/job-status.d.ts +0 -24
- package/lib/models/job-status.js +0 -68
- package/lib/models/management-account.d.ts +0 -63
- package/lib/models/management-account.js +0 -187
- package/lib/models/management-model-collection.d.ts +0 -10
- package/lib/models/management-model-collection.js +0 -39
- package/lib/models/management-model.d.ts +0 -6
- package/lib/models/management-model.js +0 -29
- package/lib/models/message-restful-model-collection.d.ts +0 -26
- package/lib/models/message-restful-model-collection.js +0 -80
- package/lib/models/message.d.ts +0 -57
- package/lib/models/message.js +0 -173
- package/lib/models/model-collection.d.ts +0 -25
- package/lib/models/model-collection.js +0 -201
- package/lib/models/model.d.ts +0 -12
- package/lib/models/model.js +0 -64
- package/lib/models/neural-categorizer.d.ts +0 -28
- package/lib/models/neural-categorizer.js +0 -139
- package/lib/models/neural-clean-conversation.d.ts +0 -16
- package/lib/models/neural-clean-conversation.js +0 -114
- package/lib/models/neural-ocr.d.ts +0 -14
- package/lib/models/neural-ocr.js +0 -50
- package/lib/models/neural-sentiment-analysis.d.ts +0 -20
- package/lib/models/neural-sentiment-analysis.js +0 -56
- package/lib/models/neural-signature-contact.d.ts +0 -43
- package/lib/models/neural-signature-contact.js +0 -142
- package/lib/models/neural-signature-extraction.d.ts +0 -17
- package/lib/models/neural-signature-extraction.js +0 -54
- package/lib/models/neural.d.ts +0 -36
- package/lib/models/neural.js +0 -163
- package/lib/models/nylas-api-error.d.ts +0 -26
- package/lib/models/nylas-api-error.js +0 -62
- package/lib/models/outbox-job-status.d.ts +0 -20
- package/lib/models/outbox-job-status.js +0 -64
- package/lib/models/outbox-message.d.ts +0 -16
- package/lib/models/outbox-message.js +0 -54
- package/lib/models/outbox.d.ts +0 -35
- package/lib/models/outbox.js +0 -158
- package/lib/models/rate-limit-error.d.ts +0 -26
- package/lib/models/rate-limit-error.js +0 -47
- package/lib/models/resource.d.ts +0 -22
- package/lib/models/resource.js +0 -66
- package/lib/models/restful-model-collection.d.ts +0 -15
- package/lib/models/restful-model-collection.js +0 -169
- package/lib/models/restful-model-instance.d.ts +0 -9
- package/lib/models/restful-model-instance.js +0 -37
- package/lib/models/restful-model.d.ts +0 -36
- package/lib/models/restful-model.js +0 -146
- package/lib/models/scheduler-booking-request.d.ts +0 -64
- package/lib/models/scheduler-booking-request.js +0 -148
- package/lib/models/scheduler-restful-model-collection.d.ts +0 -26
- package/lib/models/scheduler-restful-model-collection.js +0 -133
- package/lib/models/scheduler-time-slot.d.ts +0 -20
- package/lib/models/scheduler-time-slot.js +0 -53
- package/lib/models/scheduler.d.ts +0 -226
- package/lib/models/scheduler.js +0 -446
- package/lib/models/thread.d.ts +0 -49
- package/lib/models/thread.js +0 -127
- package/lib/models/webhook-notification.d.ts +0 -133
- package/lib/models/webhook-notification.js +0 -314
- package/lib/models/webhook.d.ts +0 -50
- package/lib/models/webhook.js +0 -101
- package/lib/models/when.d.ts +0 -29
- package/lib/models/when.js +0 -76
- package/lib/nylas-connection.d.ts +0 -71
- package/lib/nylas-connection.js +0 -282
- package/lib/nylas.d.ts +0 -34
- package/lib/nylas.js +0 -199
- package/lib/services/tunnel.d.ts +0 -28
- package/lib/services/tunnel.js +0 -89
|
@@ -1,148 +0,0 @@
|
|
|
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 attributes_1 = __importDefault(require("./attributes"));
|
|
20
|
-
var scheduler_time_slot_1 = __importDefault(require("./scheduler-time-slot"));
|
|
21
|
-
var model_1 = __importDefault(require("./model"));
|
|
22
|
-
var SchedulerBookingConfirmation = /** @class */ (function (_super) {
|
|
23
|
-
__extends(SchedulerBookingConfirmation, _super);
|
|
24
|
-
function SchedulerBookingConfirmation(props) {
|
|
25
|
-
var _this = _super.call(this) || this;
|
|
26
|
-
_this.initAttributes(props);
|
|
27
|
-
return _this;
|
|
28
|
-
}
|
|
29
|
-
SchedulerBookingConfirmation.attributes = {
|
|
30
|
-
id: attributes_1.default.Number({
|
|
31
|
-
modelKey: 'id',
|
|
32
|
-
}),
|
|
33
|
-
accountId: attributes_1.default.String({
|
|
34
|
-
modelKey: 'accountId',
|
|
35
|
-
jsonKey: 'account_id',
|
|
36
|
-
}),
|
|
37
|
-
additionalFieldValues: attributes_1.default.Object({
|
|
38
|
-
modelKey: 'additionalFieldValues',
|
|
39
|
-
jsonKey: 'additional_field_values',
|
|
40
|
-
}),
|
|
41
|
-
calendarEventId: attributes_1.default.String({
|
|
42
|
-
modelKey: 'calendarEventId',
|
|
43
|
-
jsonKey: 'calendar_event_id',
|
|
44
|
-
}),
|
|
45
|
-
calendarId: attributes_1.default.String({
|
|
46
|
-
modelKey: 'calendarId',
|
|
47
|
-
jsonKey: 'calendar_id',
|
|
48
|
-
}),
|
|
49
|
-
editHash: attributes_1.default.String({
|
|
50
|
-
modelKey: 'editHash',
|
|
51
|
-
jsonKey: 'edit_hash',
|
|
52
|
-
}),
|
|
53
|
-
startTime: attributes_1.default.DateTime({
|
|
54
|
-
modelKey: 'startTime',
|
|
55
|
-
jsonKey: 'start_time',
|
|
56
|
-
}),
|
|
57
|
-
endTime: attributes_1.default.DateTime({
|
|
58
|
-
modelKey: 'endTime',
|
|
59
|
-
jsonKey: 'end_time',
|
|
60
|
-
}),
|
|
61
|
-
isConfirmed: attributes_1.default.Boolean({
|
|
62
|
-
modelKey: 'isConfirmed',
|
|
63
|
-
jsonKey: 'is_confirmed',
|
|
64
|
-
}),
|
|
65
|
-
location: attributes_1.default.String({
|
|
66
|
-
modelKey: 'location',
|
|
67
|
-
}),
|
|
68
|
-
recipientEmail: attributes_1.default.String({
|
|
69
|
-
modelKey: 'recipientEmail',
|
|
70
|
-
jsonKey: 'recipient_email',
|
|
71
|
-
}),
|
|
72
|
-
recipientLocale: attributes_1.default.String({
|
|
73
|
-
modelKey: 'recipientLocale',
|
|
74
|
-
jsonKey: 'recipient_locale',
|
|
75
|
-
}),
|
|
76
|
-
recipientName: attributes_1.default.String({
|
|
77
|
-
modelKey: 'recipientName',
|
|
78
|
-
jsonKey: 'recipient_name',
|
|
79
|
-
}),
|
|
80
|
-
recipientTz: attributes_1.default.String({
|
|
81
|
-
modelKey: 'recipientTz',
|
|
82
|
-
jsonKey: 'recipient_tz',
|
|
83
|
-
}),
|
|
84
|
-
title: attributes_1.default.String({
|
|
85
|
-
modelKey: 'title',
|
|
86
|
-
}),
|
|
87
|
-
};
|
|
88
|
-
return SchedulerBookingConfirmation;
|
|
89
|
-
}(model_1.default));
|
|
90
|
-
exports.SchedulerBookingConfirmation = SchedulerBookingConfirmation;
|
|
91
|
-
var SchedulerBookingRequest = /** @class */ (function (_super) {
|
|
92
|
-
__extends(SchedulerBookingRequest, _super);
|
|
93
|
-
function SchedulerBookingRequest(props) {
|
|
94
|
-
var _this = _super.call(this) || this;
|
|
95
|
-
_this.initAttributes(props);
|
|
96
|
-
return _this;
|
|
97
|
-
}
|
|
98
|
-
/*
|
|
99
|
-
* The booking endpoint requires additional_values and additional_emails
|
|
100
|
-
to exist regardless if they are empty or not
|
|
101
|
-
*/
|
|
102
|
-
SchedulerBookingRequest.prototype.toJSON = function (enforceReadOnly) {
|
|
103
|
-
var json = _super.prototype.toJSON.call(this, enforceReadOnly);
|
|
104
|
-
if (!this.additionalEmails) {
|
|
105
|
-
json['additional_emails'] = [];
|
|
106
|
-
}
|
|
107
|
-
if (!this.additionalValues) {
|
|
108
|
-
json['additional_values'] = {};
|
|
109
|
-
}
|
|
110
|
-
return json;
|
|
111
|
-
};
|
|
112
|
-
SchedulerBookingRequest.attributes = {
|
|
113
|
-
additionalEmails: attributes_1.default.StringList({
|
|
114
|
-
modelKey: 'additionalEmails',
|
|
115
|
-
jsonKey: 'additional_emails',
|
|
116
|
-
}),
|
|
117
|
-
additionalValues: attributes_1.default.Object({
|
|
118
|
-
modelKey: 'additionalValues',
|
|
119
|
-
jsonKey: 'additional_values',
|
|
120
|
-
}),
|
|
121
|
-
email: attributes_1.default.String({
|
|
122
|
-
modelKey: 'email',
|
|
123
|
-
}),
|
|
124
|
-
locale: attributes_1.default.String({
|
|
125
|
-
modelKey: 'locale',
|
|
126
|
-
}),
|
|
127
|
-
name: attributes_1.default.String({
|
|
128
|
-
modelKey: 'name',
|
|
129
|
-
}),
|
|
130
|
-
pageHostname: attributes_1.default.String({
|
|
131
|
-
modelKey: 'pageHostname',
|
|
132
|
-
jsonKey: 'page_hostname',
|
|
133
|
-
}),
|
|
134
|
-
replacesBookingHash: attributes_1.default.String({
|
|
135
|
-
modelKey: 'replacesBookingHash',
|
|
136
|
-
jsonKey: 'replaces_booking_hash',
|
|
137
|
-
}),
|
|
138
|
-
slot: attributes_1.default.Object({
|
|
139
|
-
modelKey: 'slot',
|
|
140
|
-
itemClass: scheduler_time_slot_1.default,
|
|
141
|
-
}),
|
|
142
|
-
timezone: attributes_1.default.String({
|
|
143
|
-
modelKey: 'timezone',
|
|
144
|
-
}),
|
|
145
|
-
};
|
|
146
|
-
return SchedulerBookingRequest;
|
|
147
|
-
}(model_1.default));
|
|
148
|
-
exports.default = SchedulerBookingRequest;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import RestfulModelCollection from './restful-model-collection';
|
|
2
|
-
import NylasConnection from '../nylas-connection';
|
|
3
|
-
import Scheduler from './scheduler';
|
|
4
|
-
import SchedulerTimeSlot from './scheduler-time-slot';
|
|
5
|
-
import SchedulerBookingRequest, { SchedulerBookingConfirmation } from './scheduler-booking-request';
|
|
6
|
-
export declare type ProviderAvailability = {
|
|
7
|
-
busy: [{
|
|
8
|
-
end: number;
|
|
9
|
-
start: number;
|
|
10
|
-
}];
|
|
11
|
-
email: string;
|
|
12
|
-
name: string;
|
|
13
|
-
};
|
|
14
|
-
export default class SchedulerRestfulModelCollection extends RestfulModelCollection<Scheduler> {
|
|
15
|
-
connection: NylasConnection;
|
|
16
|
-
modelClass: typeof Scheduler;
|
|
17
|
-
baseUrl: string;
|
|
18
|
-
constructor(connection: NylasConnection);
|
|
19
|
-
getGoogleAvailability(): Promise<ProviderAvailability>;
|
|
20
|
-
getOffice365Availability(): Promise<ProviderAvailability>;
|
|
21
|
-
getPageBySlug(slug: string): Promise<Scheduler>;
|
|
22
|
-
getAvailableTimeSlots(slug: string): Promise<SchedulerTimeSlot[]>;
|
|
23
|
-
bookTimeSlot(slug: string, bookingRequest: SchedulerBookingRequest): Promise<SchedulerBookingConfirmation>;
|
|
24
|
-
cancelBooking(slug: string, editHash: string, reason: string): Record<string, any>;
|
|
25
|
-
confirmBooking(slug: string, editHash: string): Promise<SchedulerBookingConfirmation>;
|
|
26
|
-
}
|
|
@@ -1,133 +0,0 @@
|
|
|
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 scheduler_1 = __importDefault(require("./scheduler"));
|
|
21
|
-
var scheduler_time_slot_1 = __importDefault(require("./scheduler-time-slot"));
|
|
22
|
-
var scheduler_booking_request_1 = require("./scheduler-booking-request");
|
|
23
|
-
var SchedulerRestfulModelCollection = /** @class */ (function (_super) {
|
|
24
|
-
__extends(SchedulerRestfulModelCollection, _super);
|
|
25
|
-
function SchedulerRestfulModelCollection(connection) {
|
|
26
|
-
var _this = _super.call(this, scheduler_1.default, connection) || this;
|
|
27
|
-
_this.baseUrl = 'https://api.schedule.nylas.com';
|
|
28
|
-
_this.connection = connection;
|
|
29
|
-
_this.modelClass = scheduler_1.default;
|
|
30
|
-
return _this;
|
|
31
|
-
}
|
|
32
|
-
SchedulerRestfulModelCollection.prototype.getGoogleAvailability = function () {
|
|
33
|
-
return this.connection.request({
|
|
34
|
-
method: 'GET',
|
|
35
|
-
path: '/schedule/availability/google',
|
|
36
|
-
headers: {
|
|
37
|
-
'Content-Type': 'application/json',
|
|
38
|
-
},
|
|
39
|
-
baseUrl: this.baseUrl,
|
|
40
|
-
});
|
|
41
|
-
};
|
|
42
|
-
SchedulerRestfulModelCollection.prototype.getOffice365Availability = function () {
|
|
43
|
-
return this.connection.request({
|
|
44
|
-
method: 'GET',
|
|
45
|
-
path: '/schedule/availability/o365',
|
|
46
|
-
headers: {
|
|
47
|
-
'Content-Type': 'application/json',
|
|
48
|
-
},
|
|
49
|
-
baseUrl: this.baseUrl,
|
|
50
|
-
});
|
|
51
|
-
};
|
|
52
|
-
SchedulerRestfulModelCollection.prototype.getPageBySlug = function (slug) {
|
|
53
|
-
var _this = this;
|
|
54
|
-
return this.connection
|
|
55
|
-
.request({
|
|
56
|
-
method: 'GET',
|
|
57
|
-
path: "/schedule/" + slug + "/info",
|
|
58
|
-
headers: {
|
|
59
|
-
'Content-Type': 'application/json',
|
|
60
|
-
},
|
|
61
|
-
baseUrl: this.baseUrl,
|
|
62
|
-
})
|
|
63
|
-
.then(function (json) {
|
|
64
|
-
return Promise.resolve(new scheduler_1.default(_this.connection).fromJSON(json));
|
|
65
|
-
});
|
|
66
|
-
};
|
|
67
|
-
SchedulerRestfulModelCollection.prototype.getAvailableTimeSlots = function (slug) {
|
|
68
|
-
return this.connection
|
|
69
|
-
.request({
|
|
70
|
-
method: 'GET',
|
|
71
|
-
path: "/schedule/" + slug + "/timeslots",
|
|
72
|
-
headers: {
|
|
73
|
-
'Content-Type': 'application/json',
|
|
74
|
-
},
|
|
75
|
-
baseUrl: this.baseUrl,
|
|
76
|
-
})
|
|
77
|
-
.then(function (json) {
|
|
78
|
-
var timeslots = json.map(function (timeslot) {
|
|
79
|
-
return new scheduler_time_slot_1.default().fromJSON(timeslot);
|
|
80
|
-
});
|
|
81
|
-
return Promise.resolve(timeslots);
|
|
82
|
-
});
|
|
83
|
-
};
|
|
84
|
-
SchedulerRestfulModelCollection.prototype.bookTimeSlot = function (slug, bookingRequest) {
|
|
85
|
-
return this.connection
|
|
86
|
-
.request({
|
|
87
|
-
method: 'POST',
|
|
88
|
-
path: "/schedule/" + slug + "/timeslots",
|
|
89
|
-
headers: {
|
|
90
|
-
'Content-Type': 'application/json',
|
|
91
|
-
},
|
|
92
|
-
body: bookingRequest.toJSON(),
|
|
93
|
-
baseUrl: this.baseUrl,
|
|
94
|
-
})
|
|
95
|
-
.then(function (json) {
|
|
96
|
-
return Promise.resolve(new scheduler_booking_request_1.SchedulerBookingConfirmation().fromJSON(json));
|
|
97
|
-
});
|
|
98
|
-
};
|
|
99
|
-
SchedulerRestfulModelCollection.prototype.cancelBooking = function (slug, editHash, reason) {
|
|
100
|
-
return this.connection
|
|
101
|
-
.request({
|
|
102
|
-
method: 'POST',
|
|
103
|
-
path: "/schedule/" + slug + "/" + editHash + "/cancel",
|
|
104
|
-
headers: {
|
|
105
|
-
'Content-Type': 'application/json',
|
|
106
|
-
},
|
|
107
|
-
body: {
|
|
108
|
-
reason: reason,
|
|
109
|
-
},
|
|
110
|
-
baseUrl: this.baseUrl,
|
|
111
|
-
})
|
|
112
|
-
.then(function (json) {
|
|
113
|
-
return Promise.resolve(json);
|
|
114
|
-
});
|
|
115
|
-
};
|
|
116
|
-
SchedulerRestfulModelCollection.prototype.confirmBooking = function (slug, editHash) {
|
|
117
|
-
return this.connection
|
|
118
|
-
.request({
|
|
119
|
-
method: 'POST',
|
|
120
|
-
path: "/schedule/" + slug + "/" + editHash + "/confirm",
|
|
121
|
-
headers: {
|
|
122
|
-
'Content-Type': 'application/json',
|
|
123
|
-
},
|
|
124
|
-
body: {},
|
|
125
|
-
baseUrl: this.baseUrl,
|
|
126
|
-
})
|
|
127
|
-
.then(function (json) {
|
|
128
|
-
return Promise.resolve(new scheduler_booking_request_1.SchedulerBookingConfirmation().fromJSON(json));
|
|
129
|
-
});
|
|
130
|
-
};
|
|
131
|
-
return SchedulerRestfulModelCollection;
|
|
132
|
-
}(restful_model_collection_1.default));
|
|
133
|
-
exports.default = SchedulerRestfulModelCollection;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Attribute } from './attributes';
|
|
2
|
-
import Model from './model';
|
|
3
|
-
export declare type SchedulerTimeSlotProperties = {
|
|
4
|
-
accountId?: string;
|
|
5
|
-
calendarId?: string;
|
|
6
|
-
hostName?: string;
|
|
7
|
-
emails?: string[];
|
|
8
|
-
start?: Date;
|
|
9
|
-
end?: Date;
|
|
10
|
-
};
|
|
11
|
-
export default class SchedulerTimeSlot extends Model implements SchedulerTimeSlotProperties {
|
|
12
|
-
accountId?: string;
|
|
13
|
-
calendarId?: string;
|
|
14
|
-
hostName?: string;
|
|
15
|
-
emails?: string[];
|
|
16
|
-
start?: Date;
|
|
17
|
-
end?: Date;
|
|
18
|
-
static attributes: Record<string, Attribute>;
|
|
19
|
-
constructor(props?: SchedulerTimeSlotProperties);
|
|
20
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
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 attributes_1 = __importDefault(require("./attributes"));
|
|
20
|
-
var model_1 = __importDefault(require("./model"));
|
|
21
|
-
var SchedulerTimeSlot = /** @class */ (function (_super) {
|
|
22
|
-
__extends(SchedulerTimeSlot, _super);
|
|
23
|
-
function SchedulerTimeSlot(props) {
|
|
24
|
-
var _this = _super.call(this) || this;
|
|
25
|
-
_this.initAttributes(props);
|
|
26
|
-
return _this;
|
|
27
|
-
}
|
|
28
|
-
SchedulerTimeSlot.attributes = {
|
|
29
|
-
accountId: attributes_1.default.String({
|
|
30
|
-
modelKey: 'accountId',
|
|
31
|
-
jsonKey: 'account_id',
|
|
32
|
-
}),
|
|
33
|
-
calendarId: attributes_1.default.String({
|
|
34
|
-
modelKey: 'calendarId',
|
|
35
|
-
jsonKey: 'calendar_id',
|
|
36
|
-
}),
|
|
37
|
-
hostName: attributes_1.default.String({
|
|
38
|
-
modelKey: 'hostName',
|
|
39
|
-
jsonKey: 'host_name',
|
|
40
|
-
}),
|
|
41
|
-
emails: attributes_1.default.StringList({
|
|
42
|
-
modelKey: 'emails',
|
|
43
|
-
}),
|
|
44
|
-
start: attributes_1.default.DateTime({
|
|
45
|
-
modelKey: 'start',
|
|
46
|
-
}),
|
|
47
|
-
end: attributes_1.default.DateTime({
|
|
48
|
-
modelKey: 'end',
|
|
49
|
-
}),
|
|
50
|
-
};
|
|
51
|
-
return SchedulerTimeSlot;
|
|
52
|
-
}(model_1.default));
|
|
53
|
-
exports.default = SchedulerTimeSlot;
|
|
@@ -1,226 +0,0 @@
|
|
|
1
|
-
import RestfulModel, { SaveCallback } from './restful-model';
|
|
2
|
-
import { Attribute } from './attributes';
|
|
3
|
-
import NylasConnection from '../nylas-connection';
|
|
4
|
-
import Model from './model';
|
|
5
|
-
import Calendar from './calendar';
|
|
6
|
-
export declare type SchedulerUploadImageResponse = {
|
|
7
|
-
filename: string;
|
|
8
|
-
originalFilename: string;
|
|
9
|
-
publicUrl: string;
|
|
10
|
-
signedUrl: string;
|
|
11
|
-
};
|
|
12
|
-
export declare type SchedulerAvailableCalendarsProperties = {
|
|
13
|
-
id: string;
|
|
14
|
-
name: string;
|
|
15
|
-
email: string;
|
|
16
|
-
calendars: Calendar[];
|
|
17
|
-
};
|
|
18
|
-
export declare class SchedulerAvailableCalendars extends Model implements SchedulerAvailableCalendarsProperties {
|
|
19
|
-
id: string;
|
|
20
|
-
name: string;
|
|
21
|
-
email: string;
|
|
22
|
-
calendars: Calendar[];
|
|
23
|
-
static attributes: Record<string, Attribute>;
|
|
24
|
-
private _connection?;
|
|
25
|
-
constructor(props?: SchedulerAvailableCalendarsProperties);
|
|
26
|
-
get connection(): NylasConnection | undefined;
|
|
27
|
-
fromJSON(json: Record<string, unknown>, connection?: NylasConnection): this;
|
|
28
|
-
}
|
|
29
|
-
export declare type SchedulerAppearanceProperties = {
|
|
30
|
-
color?: string;
|
|
31
|
-
companyName?: string;
|
|
32
|
-
logo?: string;
|
|
33
|
-
privacyPolicyRedirect?: string;
|
|
34
|
-
showAutoschedule?: boolean;
|
|
35
|
-
showNylasBranding?: boolean;
|
|
36
|
-
showTimezoneOptions?: boolean;
|
|
37
|
-
showWeekView?: boolean;
|
|
38
|
-
submitText?: string;
|
|
39
|
-
thankYouRedirect?: string;
|
|
40
|
-
thankYouText?: string;
|
|
41
|
-
thankYouTextSecondary?: string;
|
|
42
|
-
};
|
|
43
|
-
export declare class SchedulerAppearance extends Model implements SchedulerAppearanceProperties {
|
|
44
|
-
color?: string;
|
|
45
|
-
companyName?: string;
|
|
46
|
-
logo?: string;
|
|
47
|
-
privacyPolicyRedirect?: string;
|
|
48
|
-
showAutoschedule?: boolean;
|
|
49
|
-
showNylasBranding?: boolean;
|
|
50
|
-
showTimezoneOptions?: boolean;
|
|
51
|
-
showWeekView?: boolean;
|
|
52
|
-
submitText?: string;
|
|
53
|
-
thankYouRedirect?: string;
|
|
54
|
-
thankYouText?: string;
|
|
55
|
-
thankYouTextSecondary?: string;
|
|
56
|
-
static attributes: Record<string, Attribute>;
|
|
57
|
-
constructor(props?: SchedulerAppearanceProperties);
|
|
58
|
-
}
|
|
59
|
-
export declare type SchedulerBookingAdditionalFieldsProperties = {
|
|
60
|
-
dropdownOptions?: string[];
|
|
61
|
-
label?: string;
|
|
62
|
-
multiSelectOptions?: string[];
|
|
63
|
-
name?: string;
|
|
64
|
-
order?: number;
|
|
65
|
-
pattern?: string;
|
|
66
|
-
required?: boolean;
|
|
67
|
-
type?: string;
|
|
68
|
-
};
|
|
69
|
-
export declare class SchedulerBookingAdditionalFields extends Model implements SchedulerBookingAdditionalFieldsProperties {
|
|
70
|
-
dropdownOptions?: string[];
|
|
71
|
-
label?: string;
|
|
72
|
-
multiSelectOptions?: string[];
|
|
73
|
-
name?: string;
|
|
74
|
-
order?: number;
|
|
75
|
-
pattern?: string;
|
|
76
|
-
required?: boolean;
|
|
77
|
-
type?: string;
|
|
78
|
-
static attributes: Record<string, Attribute>;
|
|
79
|
-
constructor(props?: SchedulerBookingAdditionalFieldsProperties);
|
|
80
|
-
}
|
|
81
|
-
export declare type SchedulerBookingOpeningHoursProperties = {
|
|
82
|
-
accountId?: string;
|
|
83
|
-
days?: string[];
|
|
84
|
-
end?: string;
|
|
85
|
-
start?: string;
|
|
86
|
-
};
|
|
87
|
-
export declare class SchedulerBookingOpeningHours extends Model implements SchedulerBookingOpeningHoursProperties {
|
|
88
|
-
accountId?: string;
|
|
89
|
-
days?: string[];
|
|
90
|
-
end?: string;
|
|
91
|
-
start?: string;
|
|
92
|
-
static attributes: Record<string, Attribute>;
|
|
93
|
-
constructor(props?: SchedulerBookingOpeningHoursProperties);
|
|
94
|
-
}
|
|
95
|
-
export declare type SchedulerBookingProperties = {
|
|
96
|
-
additionalFields?: SchedulerBookingAdditionalFieldsProperties[];
|
|
97
|
-
additionalGuestsHidden?: boolean;
|
|
98
|
-
availableDaysInFuture?: number;
|
|
99
|
-
calendarInviteToGuests?: boolean;
|
|
100
|
-
cancellationPolicy?: string;
|
|
101
|
-
confirmationEmailsToGuests?: boolean;
|
|
102
|
-
confirmationEmailToHost?: boolean;
|
|
103
|
-
confirmationMethod?: string;
|
|
104
|
-
minBookingNotice?: number;
|
|
105
|
-
minBuffer?: number;
|
|
106
|
-
minCancellationNotice?: number;
|
|
107
|
-
intervalMinutes?: number;
|
|
108
|
-
nameFieldHidden?: boolean;
|
|
109
|
-
openingHours?: SchedulerBookingOpeningHoursProperties[];
|
|
110
|
-
schedulingMethod?: string;
|
|
111
|
-
};
|
|
112
|
-
export declare class SchedulerBooking extends Model implements SchedulerBookingProperties {
|
|
113
|
-
additionalFields?: SchedulerBookingAdditionalFields[];
|
|
114
|
-
additionalGuestsHidden?: boolean;
|
|
115
|
-
availableDaysInFuture?: number;
|
|
116
|
-
calendarInviteToGuests?: boolean;
|
|
117
|
-
cancellationPolicy?: string;
|
|
118
|
-
confirmationEmailsToGuests?: boolean;
|
|
119
|
-
confirmationEmailToHost?: boolean;
|
|
120
|
-
confirmationMethod?: string;
|
|
121
|
-
minBookingNotice?: number;
|
|
122
|
-
minBuffer?: number;
|
|
123
|
-
minCancellationNotice?: number;
|
|
124
|
-
intervalMinutes?: number;
|
|
125
|
-
nameFieldHidden?: boolean;
|
|
126
|
-
openingHours?: SchedulerBookingOpeningHours[];
|
|
127
|
-
schedulingMethod?: string;
|
|
128
|
-
static attributes: Record<string, Attribute>;
|
|
129
|
-
constructor(props?: SchedulerBookingProperties);
|
|
130
|
-
}
|
|
131
|
-
export declare type SchedulerRemindersProperties = {
|
|
132
|
-
deliveryMethod?: string;
|
|
133
|
-
deliveryRecipient?: string;
|
|
134
|
-
emailSubject?: string;
|
|
135
|
-
timeBeforeEvent?: number;
|
|
136
|
-
webhookUrl?: string;
|
|
137
|
-
};
|
|
138
|
-
export declare class SchedulerReminders extends Model implements SchedulerRemindersProperties {
|
|
139
|
-
deliveryMethod?: string;
|
|
140
|
-
deliveryRecipient?: string;
|
|
141
|
-
emailSubject?: string;
|
|
142
|
-
timeBeforeEvent?: number;
|
|
143
|
-
webhookUrl?: string;
|
|
144
|
-
static attributes: Record<string, Attribute>;
|
|
145
|
-
constructor(props?: SchedulerRemindersProperties);
|
|
146
|
-
}
|
|
147
|
-
export declare type SchedulerConfigProperties = {
|
|
148
|
-
appearance?: SchedulerAppearanceProperties;
|
|
149
|
-
booking?: SchedulerBookingProperties;
|
|
150
|
-
calendarIds?: {
|
|
151
|
-
[accountId: string]: {
|
|
152
|
-
availability?: string[];
|
|
153
|
-
booking?: string;
|
|
154
|
-
};
|
|
155
|
-
};
|
|
156
|
-
event?: {
|
|
157
|
-
duration?: number;
|
|
158
|
-
capacity?: number;
|
|
159
|
-
location?: string;
|
|
160
|
-
title?: string;
|
|
161
|
-
};
|
|
162
|
-
expireAfter?: {
|
|
163
|
-
date?: number;
|
|
164
|
-
uses?: number;
|
|
165
|
-
};
|
|
166
|
-
locale?: string;
|
|
167
|
-
localeForGuests?: string;
|
|
168
|
-
reminders?: SchedulerRemindersProperties[];
|
|
169
|
-
timezone?: string;
|
|
170
|
-
};
|
|
171
|
-
export declare class SchedulerConfig extends Model implements SchedulerConfigProperties {
|
|
172
|
-
appearance?: SchedulerAppearanceProperties;
|
|
173
|
-
booking?: SchedulerBookingProperties;
|
|
174
|
-
calendarIds?: {
|
|
175
|
-
[accountId: string]: {
|
|
176
|
-
availability?: string[];
|
|
177
|
-
booking?: string;
|
|
178
|
-
};
|
|
179
|
-
};
|
|
180
|
-
event?: {
|
|
181
|
-
duration?: number;
|
|
182
|
-
capacity?: number;
|
|
183
|
-
location?: string;
|
|
184
|
-
title?: string;
|
|
185
|
-
};
|
|
186
|
-
expireAfter?: {
|
|
187
|
-
date?: number;
|
|
188
|
-
uses?: number;
|
|
189
|
-
};
|
|
190
|
-
disableEmails?: boolean;
|
|
191
|
-
locale?: string;
|
|
192
|
-
localeForGuests?: string;
|
|
193
|
-
reminders?: SchedulerRemindersProperties[];
|
|
194
|
-
timezone?: string;
|
|
195
|
-
static attributes: Record<string, Attribute>;
|
|
196
|
-
constructor(props?: SchedulerConfigProperties);
|
|
197
|
-
}
|
|
198
|
-
export declare type SchedulerProperties = {
|
|
199
|
-
accessTokens?: string[];
|
|
200
|
-
appClientId?: string;
|
|
201
|
-
appOrganizationId?: number;
|
|
202
|
-
config?: SchedulerConfig;
|
|
203
|
-
editToken?: string;
|
|
204
|
-
name?: string;
|
|
205
|
-
slug?: string;
|
|
206
|
-
createdAt?: Date;
|
|
207
|
-
modifiedAt?: Date;
|
|
208
|
-
};
|
|
209
|
-
export default class Scheduler extends RestfulModel implements SchedulerProperties {
|
|
210
|
-
accessTokens?: string[];
|
|
211
|
-
appClientId?: string;
|
|
212
|
-
appOrganizationId?: number;
|
|
213
|
-
config?: SchedulerConfig;
|
|
214
|
-
editToken?: string;
|
|
215
|
-
name?: string;
|
|
216
|
-
slug?: string;
|
|
217
|
-
createdAt?: Date;
|
|
218
|
-
modifiedAt?: Date;
|
|
219
|
-
static collectionName: string;
|
|
220
|
-
static attributes: Record<string, Attribute>;
|
|
221
|
-
constructor(connection: NylasConnection, props?: SchedulerProperties);
|
|
222
|
-
save(params?: {} | SaveCallback, callback?: SaveCallback): Promise<this>;
|
|
223
|
-
getAvailableCalendars(): Promise<SchedulerAvailableCalendars[]>;
|
|
224
|
-
uploadImage(contentType: string, objectName: string): Promise<SchedulerUploadImageResponse>;
|
|
225
|
-
private validate;
|
|
226
|
-
}
|