nylas 7.0.0-beta.0 → 7.0.0-beta.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.
- package/README.md +27 -19
- package/lib/cjs/apiClient.js +114 -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/package.json +3 -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/cjs/version.js +5 -0
- package/lib/esm/apiClient.js +111 -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/package.json +3 -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/esm/version.js +2 -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/lib/types/version.d.ts +1 -0
- package/package.json +33 -42
- package/lib/config.d.ts +0 -70
- package/lib/config.js +0 -68
- 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 -31
- package/lib/models/calendar.js +0 -93
- 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.d.ts +0 -96
- package/lib/models/event.js +0 -297
- 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 -61
- 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/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 -108
- package/lib/models/webhook-notification.js +0 -239
- package/lib/models/webhook.d.ts +0 -50
- package/lib/models/webhook.js +0 -101
- package/lib/models/when.d.ts +0 -23
- package/lib/models/when.js +0 -65
- package/lib/nylas-connection.d.ts +0 -71
- package/lib/nylas-connection.js +0 -258
- package/lib/nylas.d.ts +0 -57
- package/lib/nylas.js +0 -210
- package/lib/server-bindings/express-binding.d.ts +0 -18
- package/lib/server-bindings/express-binding.js +0 -163
- package/lib/server-bindings/server-binding.d.ts +0 -65
- package/lib/server-bindings/server-binding.js +0 -87
- package/lib/services/routes.d.ts +0 -26
- package/lib/services/routes.js +0 -95
- package/lib/services/tunnel.d.ts +0 -29
- package/lib/services/tunnel.js +0 -112
|
@@ -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
|
-
confirmationEmailsToHost?: 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
|
-
confirmationEmailsToHost?: 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
|
-
}
|
package/lib/models/scheduler.js
DELETED
|
@@ -1,446 +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 __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 model_1 = __importDefault(require("./model"));
|
|
33
|
-
var calendar_1 = __importDefault(require("./calendar"));
|
|
34
|
-
var SchedulerAvailableCalendars = /** @class */ (function (_super) {
|
|
35
|
-
__extends(SchedulerAvailableCalendars, _super);
|
|
36
|
-
function SchedulerAvailableCalendars(props) {
|
|
37
|
-
var _this = _super.call(this) || this;
|
|
38
|
-
_this.id = '';
|
|
39
|
-
_this.name = '';
|
|
40
|
-
_this.email = '';
|
|
41
|
-
_this.calendars = [];
|
|
42
|
-
_this.initAttributes(props);
|
|
43
|
-
return _this;
|
|
44
|
-
}
|
|
45
|
-
Object.defineProperty(SchedulerAvailableCalendars.prototype, "connection", {
|
|
46
|
-
get: function () {
|
|
47
|
-
return this._connection;
|
|
48
|
-
},
|
|
49
|
-
enumerable: true,
|
|
50
|
-
configurable: true
|
|
51
|
-
});
|
|
52
|
-
SchedulerAvailableCalendars.prototype.fromJSON = function (json, connection) {
|
|
53
|
-
// Allow a connection object to be passed in to instantiate a Calendar sub object
|
|
54
|
-
if (connection) {
|
|
55
|
-
this._connection = connection;
|
|
56
|
-
}
|
|
57
|
-
return _super.prototype.fromJSON.call(this, json);
|
|
58
|
-
};
|
|
59
|
-
SchedulerAvailableCalendars.attributes = {
|
|
60
|
-
calendars: attributes_1.default.Collection({
|
|
61
|
-
modelKey: 'calendars',
|
|
62
|
-
itemClass: calendar_1.default,
|
|
63
|
-
}),
|
|
64
|
-
email: attributes_1.default.String({
|
|
65
|
-
modelKey: 'email',
|
|
66
|
-
}),
|
|
67
|
-
id: attributes_1.default.String({
|
|
68
|
-
modelKey: 'id',
|
|
69
|
-
}),
|
|
70
|
-
name: attributes_1.default.String({
|
|
71
|
-
modelKey: 'name',
|
|
72
|
-
}),
|
|
73
|
-
};
|
|
74
|
-
return SchedulerAvailableCalendars;
|
|
75
|
-
}(model_1.default));
|
|
76
|
-
exports.SchedulerAvailableCalendars = SchedulerAvailableCalendars;
|
|
77
|
-
var SchedulerAppearance = /** @class */ (function (_super) {
|
|
78
|
-
__extends(SchedulerAppearance, _super);
|
|
79
|
-
function SchedulerAppearance(props) {
|
|
80
|
-
var _this = _super.call(this) || this;
|
|
81
|
-
_this.initAttributes(props);
|
|
82
|
-
return _this;
|
|
83
|
-
}
|
|
84
|
-
SchedulerAppearance.attributes = {
|
|
85
|
-
color: attributes_1.default.String({
|
|
86
|
-
modelKey: 'color',
|
|
87
|
-
}),
|
|
88
|
-
companyName: attributes_1.default.String({
|
|
89
|
-
modelKey: 'companyName',
|
|
90
|
-
jsonKey: 'company_name',
|
|
91
|
-
}),
|
|
92
|
-
logo: attributes_1.default.String({
|
|
93
|
-
modelKey: 'logo',
|
|
94
|
-
}),
|
|
95
|
-
privacyPolicyRedirect: attributes_1.default.String({
|
|
96
|
-
modelKey: 'privacyPolicyRedirect',
|
|
97
|
-
jsonKey: 'privacy_policy_redirect',
|
|
98
|
-
}),
|
|
99
|
-
showAutoschedule: attributes_1.default.Boolean({
|
|
100
|
-
modelKey: 'showAutoschedule',
|
|
101
|
-
jsonKey: 'show_autoschedule',
|
|
102
|
-
}),
|
|
103
|
-
showNylasBranding: attributes_1.default.Boolean({
|
|
104
|
-
modelKey: 'showNylasBranding',
|
|
105
|
-
jsonKey: 'show_nylas_branding',
|
|
106
|
-
}),
|
|
107
|
-
showTimezoneOptions: attributes_1.default.Boolean({
|
|
108
|
-
modelKey: 'showTimezoneOptions',
|
|
109
|
-
jsonKey: 'show_timezone_options',
|
|
110
|
-
}),
|
|
111
|
-
showWeekView: attributes_1.default.Boolean({
|
|
112
|
-
modelKey: 'showWeekView',
|
|
113
|
-
jsonKey: 'show_week_view',
|
|
114
|
-
}),
|
|
115
|
-
submitText: attributes_1.default.String({
|
|
116
|
-
modelKey: 'submitText',
|
|
117
|
-
jsonKey: 'submit_text',
|
|
118
|
-
}),
|
|
119
|
-
thankYouRedirect: attributes_1.default.String({
|
|
120
|
-
modelKey: 'thankYouRedirect',
|
|
121
|
-
jsonKey: 'thank_you_redirect',
|
|
122
|
-
}),
|
|
123
|
-
thankYouText: attributes_1.default.String({
|
|
124
|
-
modelKey: 'thankYouText',
|
|
125
|
-
jsonKey: 'thank_you_text',
|
|
126
|
-
}),
|
|
127
|
-
thankYouTextSecondary: attributes_1.default.String({
|
|
128
|
-
modelKey: 'thankYouTextSecondary',
|
|
129
|
-
jsonKey: 'thank_you_text_secondary',
|
|
130
|
-
}),
|
|
131
|
-
};
|
|
132
|
-
return SchedulerAppearance;
|
|
133
|
-
}(model_1.default));
|
|
134
|
-
exports.SchedulerAppearance = SchedulerAppearance;
|
|
135
|
-
var SchedulerBookingAdditionalFields = /** @class */ (function (_super) {
|
|
136
|
-
__extends(SchedulerBookingAdditionalFields, _super);
|
|
137
|
-
function SchedulerBookingAdditionalFields(props) {
|
|
138
|
-
var _this = _super.call(this) || this;
|
|
139
|
-
_this.initAttributes(props);
|
|
140
|
-
return _this;
|
|
141
|
-
}
|
|
142
|
-
SchedulerBookingAdditionalFields.attributes = {
|
|
143
|
-
dropdownOptions: attributes_1.default.StringList({
|
|
144
|
-
modelKey: 'dropdownOptions',
|
|
145
|
-
jsonKey: 'dropdown_options',
|
|
146
|
-
}),
|
|
147
|
-
label: attributes_1.default.String({
|
|
148
|
-
modelKey: 'label',
|
|
149
|
-
}),
|
|
150
|
-
multiSelectOptions: attributes_1.default.StringList({
|
|
151
|
-
modelKey: 'multiSelectOptions',
|
|
152
|
-
jsonKey: 'multi_select_options',
|
|
153
|
-
}),
|
|
154
|
-
name: attributes_1.default.String({
|
|
155
|
-
modelKey: 'name',
|
|
156
|
-
}),
|
|
157
|
-
order: attributes_1.default.Number({
|
|
158
|
-
modelKey: 'order',
|
|
159
|
-
}),
|
|
160
|
-
pattern: attributes_1.default.String({
|
|
161
|
-
modelKey: 'pattern',
|
|
162
|
-
}),
|
|
163
|
-
required: attributes_1.default.Boolean({
|
|
164
|
-
modelKey: 'required',
|
|
165
|
-
}),
|
|
166
|
-
type: attributes_1.default.String({
|
|
167
|
-
modelKey: 'type',
|
|
168
|
-
}),
|
|
169
|
-
};
|
|
170
|
-
return SchedulerBookingAdditionalFields;
|
|
171
|
-
}(model_1.default));
|
|
172
|
-
exports.SchedulerBookingAdditionalFields = SchedulerBookingAdditionalFields;
|
|
173
|
-
var SchedulerBookingOpeningHours = /** @class */ (function (_super) {
|
|
174
|
-
__extends(SchedulerBookingOpeningHours, _super);
|
|
175
|
-
function SchedulerBookingOpeningHours(props) {
|
|
176
|
-
var _this = _super.call(this) || this;
|
|
177
|
-
_this.initAttributes(props);
|
|
178
|
-
return _this;
|
|
179
|
-
}
|
|
180
|
-
SchedulerBookingOpeningHours.attributes = {
|
|
181
|
-
accountId: attributes_1.default.String({
|
|
182
|
-
modelKey: 'accountId',
|
|
183
|
-
jsonKey: 'account_id',
|
|
184
|
-
}),
|
|
185
|
-
days: attributes_1.default.StringList({
|
|
186
|
-
modelKey: 'days',
|
|
187
|
-
}),
|
|
188
|
-
end: attributes_1.default.String({
|
|
189
|
-
modelKey: 'end',
|
|
190
|
-
}),
|
|
191
|
-
start: attributes_1.default.String({
|
|
192
|
-
modelKey: 'start',
|
|
193
|
-
}),
|
|
194
|
-
};
|
|
195
|
-
return SchedulerBookingOpeningHours;
|
|
196
|
-
}(model_1.default));
|
|
197
|
-
exports.SchedulerBookingOpeningHours = SchedulerBookingOpeningHours;
|
|
198
|
-
var SchedulerBooking = /** @class */ (function (_super) {
|
|
199
|
-
__extends(SchedulerBooking, _super);
|
|
200
|
-
function SchedulerBooking(props) {
|
|
201
|
-
var _this = _super.call(this) || this;
|
|
202
|
-
_this.initAttributes(props);
|
|
203
|
-
return _this;
|
|
204
|
-
}
|
|
205
|
-
SchedulerBooking.attributes = {
|
|
206
|
-
additionalFields: attributes_1.default.Collection({
|
|
207
|
-
modelKey: 'additionalFields',
|
|
208
|
-
jsonKey: 'additional_fields',
|
|
209
|
-
itemClass: SchedulerBookingAdditionalFields,
|
|
210
|
-
}),
|
|
211
|
-
additionalGuestsHidden: attributes_1.default.Boolean({
|
|
212
|
-
modelKey: 'additionalGuestsHidden',
|
|
213
|
-
jsonKey: 'additional_guests_hidden',
|
|
214
|
-
}),
|
|
215
|
-
availableDaysInFuture: attributes_1.default.Number({
|
|
216
|
-
modelKey: 'availableDaysInFuture',
|
|
217
|
-
jsonKey: 'available_days_in_future',
|
|
218
|
-
}),
|
|
219
|
-
calendarInviteToGuests: attributes_1.default.Boolean({
|
|
220
|
-
modelKey: 'calendarInviteToGuests',
|
|
221
|
-
jsonKey: 'calendar_invites_to_guests',
|
|
222
|
-
}),
|
|
223
|
-
cancellationPolicy: attributes_1.default.String({
|
|
224
|
-
modelKey: 'cancellationPolicy',
|
|
225
|
-
jsonKey: 'cancellation_policy',
|
|
226
|
-
}),
|
|
227
|
-
confirmationEmailsToGuests: attributes_1.default.Boolean({
|
|
228
|
-
modelKey: 'confirmationEmailsToGuests',
|
|
229
|
-
jsonKey: 'confirmation_emails_to_guests',
|
|
230
|
-
}),
|
|
231
|
-
confirmationEmailsToHost: attributes_1.default.Boolean({
|
|
232
|
-
modelKey: 'confirmationEmailsToHost',
|
|
233
|
-
jsonKey: 'confirmation_emails_to_host',
|
|
234
|
-
}),
|
|
235
|
-
confirmationMethod: attributes_1.default.String({
|
|
236
|
-
modelKey: 'confirmationMethod',
|
|
237
|
-
jsonKey: 'confirmation_method',
|
|
238
|
-
}),
|
|
239
|
-
minBookingNotice: attributes_1.default.Number({
|
|
240
|
-
modelKey: 'minBookingNotice',
|
|
241
|
-
jsonKey: 'min_booking_notice',
|
|
242
|
-
}),
|
|
243
|
-
minBuffer: attributes_1.default.Number({
|
|
244
|
-
modelKey: 'minBuffer',
|
|
245
|
-
jsonKey: 'min_buffer',
|
|
246
|
-
}),
|
|
247
|
-
minCancellationNotice: attributes_1.default.Number({
|
|
248
|
-
modelKey: 'minCancellationNotice',
|
|
249
|
-
jsonKey: 'min_cancellation_notice',
|
|
250
|
-
}),
|
|
251
|
-
intervalMinutes: attributes_1.default.Number({
|
|
252
|
-
modelKey: 'intervalMinutes',
|
|
253
|
-
jsonKey: 'interval_minutes',
|
|
254
|
-
}),
|
|
255
|
-
nameFieldHidden: attributes_1.default.Boolean({
|
|
256
|
-
modelKey: 'nameFieldHidden',
|
|
257
|
-
jsonKey: 'name_field_hidden',
|
|
258
|
-
}),
|
|
259
|
-
openingHours: attributes_1.default.Collection({
|
|
260
|
-
modelKey: 'openingHours',
|
|
261
|
-
jsonKey: 'opening_hours',
|
|
262
|
-
itemClass: SchedulerBookingOpeningHours,
|
|
263
|
-
}),
|
|
264
|
-
schedulingMethod: attributes_1.default.String({
|
|
265
|
-
modelKey: 'schedulingMethod',
|
|
266
|
-
jsonKey: 'scheduling_method',
|
|
267
|
-
}),
|
|
268
|
-
};
|
|
269
|
-
return SchedulerBooking;
|
|
270
|
-
}(model_1.default));
|
|
271
|
-
exports.SchedulerBooking = SchedulerBooking;
|
|
272
|
-
var SchedulerReminders = /** @class */ (function (_super) {
|
|
273
|
-
__extends(SchedulerReminders, _super);
|
|
274
|
-
function SchedulerReminders(props) {
|
|
275
|
-
var _this = _super.call(this) || this;
|
|
276
|
-
_this.initAttributes(props);
|
|
277
|
-
return _this;
|
|
278
|
-
}
|
|
279
|
-
SchedulerReminders.attributes = {
|
|
280
|
-
deliveryMethod: attributes_1.default.String({
|
|
281
|
-
modelKey: 'deliveryMethod',
|
|
282
|
-
jsonKey: 'delivery_method',
|
|
283
|
-
}),
|
|
284
|
-
deliveryRecipient: attributes_1.default.String({
|
|
285
|
-
modelKey: 'deliveryRecipient',
|
|
286
|
-
jsonKey: 'delivery_recipient',
|
|
287
|
-
}),
|
|
288
|
-
emailSubject: attributes_1.default.String({
|
|
289
|
-
modelKey: 'emailSubject',
|
|
290
|
-
jsonKey: 'email_subject',
|
|
291
|
-
}),
|
|
292
|
-
timeBeforeEvent: attributes_1.default.Number({
|
|
293
|
-
modelKey: 'timeBeforeEvent',
|
|
294
|
-
jsonKey: 'time_before_event',
|
|
295
|
-
}),
|
|
296
|
-
webhookUrl: attributes_1.default.String({
|
|
297
|
-
modelKey: 'webhookUrl',
|
|
298
|
-
jsonKey: 'webhook_url',
|
|
299
|
-
}),
|
|
300
|
-
};
|
|
301
|
-
return SchedulerReminders;
|
|
302
|
-
}(model_1.default));
|
|
303
|
-
exports.SchedulerReminders = SchedulerReminders;
|
|
304
|
-
var SchedulerConfig = /** @class */ (function (_super) {
|
|
305
|
-
__extends(SchedulerConfig, _super);
|
|
306
|
-
function SchedulerConfig(props) {
|
|
307
|
-
var _this = _super.call(this) || this;
|
|
308
|
-
_this.initAttributes(props);
|
|
309
|
-
return _this;
|
|
310
|
-
}
|
|
311
|
-
SchedulerConfig.attributes = {
|
|
312
|
-
appearance: attributes_1.default.Object({
|
|
313
|
-
modelKey: 'appearance',
|
|
314
|
-
itemClass: SchedulerAppearance,
|
|
315
|
-
}),
|
|
316
|
-
booking: attributes_1.default.Object({
|
|
317
|
-
modelKey: 'booking',
|
|
318
|
-
itemClass: SchedulerBooking,
|
|
319
|
-
}),
|
|
320
|
-
calendarIds: attributes_1.default.Object({
|
|
321
|
-
modelKey: 'calendarIds',
|
|
322
|
-
jsonKey: 'calendar_ids',
|
|
323
|
-
}),
|
|
324
|
-
event: attributes_1.default.Object({
|
|
325
|
-
modelKey: 'event',
|
|
326
|
-
}),
|
|
327
|
-
expireAfter: attributes_1.default.Object({
|
|
328
|
-
modelKey: 'expireAfter',
|
|
329
|
-
jsonKey: 'expire_after',
|
|
330
|
-
}),
|
|
331
|
-
disableEmails: attributes_1.default.Boolean({
|
|
332
|
-
modelKey: 'disableEmails',
|
|
333
|
-
jsonKey: 'disable_emails',
|
|
334
|
-
}),
|
|
335
|
-
locale: attributes_1.default.String({
|
|
336
|
-
modelKey: 'locale',
|
|
337
|
-
}),
|
|
338
|
-
localeForGuests: attributes_1.default.String({
|
|
339
|
-
modelKey: 'localeForGuests',
|
|
340
|
-
jsonKey: 'locale_for_guests',
|
|
341
|
-
}),
|
|
342
|
-
reminders: attributes_1.default.Collection({
|
|
343
|
-
modelKey: 'reminders',
|
|
344
|
-
itemClass: SchedulerReminders,
|
|
345
|
-
}),
|
|
346
|
-
timezone: attributes_1.default.String({
|
|
347
|
-
modelKey: 'timezone',
|
|
348
|
-
}),
|
|
349
|
-
};
|
|
350
|
-
return SchedulerConfig;
|
|
351
|
-
}(model_1.default));
|
|
352
|
-
exports.SchedulerConfig = SchedulerConfig;
|
|
353
|
-
var Scheduler = /** @class */ (function (_super) {
|
|
354
|
-
__extends(Scheduler, _super);
|
|
355
|
-
function Scheduler(connection, props) {
|
|
356
|
-
var _this = _super.call(this, connection, props) || this;
|
|
357
|
-
_this.initAttributes(props);
|
|
358
|
-
_this.baseUrl = 'https://api.schedule.nylas.com';
|
|
359
|
-
return _this;
|
|
360
|
-
}
|
|
361
|
-
Scheduler.prototype.save = function (params, callback) {
|
|
362
|
-
if (params === void 0) { params = {}; }
|
|
363
|
-
this.validate();
|
|
364
|
-
return _super.prototype.save.call(this, params, callback);
|
|
365
|
-
};
|
|
366
|
-
Scheduler.prototype.getAvailableCalendars = function () {
|
|
367
|
-
var _this = this;
|
|
368
|
-
if (!this.id) {
|
|
369
|
-
throw new Error('Cannot get calendars for a page without an ID.');
|
|
370
|
-
}
|
|
371
|
-
return this.connection
|
|
372
|
-
.request({
|
|
373
|
-
method: 'GET',
|
|
374
|
-
path: "/manage/pages/" + this.id + "/calendars",
|
|
375
|
-
headers: {
|
|
376
|
-
'Content-Type': 'application/json',
|
|
377
|
-
},
|
|
378
|
-
baseUrl: this.baseUrl,
|
|
379
|
-
})
|
|
380
|
-
.then(function (json) {
|
|
381
|
-
var calendars = json.map(function (cal) {
|
|
382
|
-
return new SchedulerAvailableCalendars().fromJSON(cal, _this.connection);
|
|
383
|
-
});
|
|
384
|
-
return Promise.resolve(calendars);
|
|
385
|
-
});
|
|
386
|
-
};
|
|
387
|
-
Scheduler.prototype.uploadImage = function (contentType, objectName) {
|
|
388
|
-
if (!this.id) {
|
|
389
|
-
throw new Error('Cannot upload an image to a page without an ID.');
|
|
390
|
-
}
|
|
391
|
-
return this.connection.request({
|
|
392
|
-
method: 'PUT',
|
|
393
|
-
path: "/manage/pages/" + this.id + "/upload-image",
|
|
394
|
-
headers: {
|
|
395
|
-
'Content-Type': 'application/json',
|
|
396
|
-
},
|
|
397
|
-
body: {
|
|
398
|
-
contentType: contentType,
|
|
399
|
-
objectName: objectName,
|
|
400
|
-
},
|
|
401
|
-
baseUrl: this.baseUrl,
|
|
402
|
-
});
|
|
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
|
-
};
|
|
412
|
-
Scheduler.collectionName = 'manage/pages';
|
|
413
|
-
Scheduler.attributes = __assign(__assign({}, restful_model_1.default.attributes), { accessTokens: attributes_1.default.StringList({
|
|
414
|
-
modelKey: 'accessTokens',
|
|
415
|
-
jsonKey: 'access_tokens',
|
|
416
|
-
}), appClientId: attributes_1.default.String({
|
|
417
|
-
modelKey: 'appClientId',
|
|
418
|
-
jsonKey: 'app_client_id',
|
|
419
|
-
readOnly: true,
|
|
420
|
-
}), appOrganizationId: attributes_1.default.Number({
|
|
421
|
-
modelKey: 'appOrganizationId',
|
|
422
|
-
jsonKey: 'app_organization_id',
|
|
423
|
-
readOnly: true,
|
|
424
|
-
}), config: attributes_1.default.Object({
|
|
425
|
-
modelKey: 'config',
|
|
426
|
-
itemClass: SchedulerConfig,
|
|
427
|
-
}), editToken: attributes_1.default.String({
|
|
428
|
-
modelKey: 'editToken',
|
|
429
|
-
jsonKey: 'edit_token',
|
|
430
|
-
readOnly: true,
|
|
431
|
-
}), name: attributes_1.default.String({
|
|
432
|
-
modelKey: 'name',
|
|
433
|
-
}), slug: attributes_1.default.String({
|
|
434
|
-
modelKey: 'slug',
|
|
435
|
-
}), createdAt: attributes_1.default.Date({
|
|
436
|
-
modelKey: 'createdAt',
|
|
437
|
-
jsonKey: 'created_at',
|
|
438
|
-
readOnly: true,
|
|
439
|
-
}), modifiedAt: attributes_1.default.Date({
|
|
440
|
-
modelKey: 'modifiedAt',
|
|
441
|
-
jsonKey: 'modified_at',
|
|
442
|
-
readOnly: true,
|
|
443
|
-
}) });
|
|
444
|
-
return Scheduler;
|
|
445
|
-
}(restful_model_1.default));
|
|
446
|
-
exports.default = Scheduler;
|