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.
Files changed (204) hide show
  1. package/README.md +27 -19
  2. package/lib/cjs/apiClient.js +114 -0
  3. package/lib/cjs/config.js +32 -0
  4. package/lib/cjs/models/applicationDetails.js +2 -0
  5. package/lib/cjs/models/auth.js +2 -0
  6. package/lib/cjs/models/availability.js +11 -0
  7. package/lib/cjs/models/calendars.js +2 -0
  8. package/lib/cjs/models/error.js +53 -0
  9. package/lib/cjs/models/events.js +2 -0
  10. package/lib/cjs/models/grants.js +2 -0
  11. package/lib/cjs/models/listQueryParams.js +2 -0
  12. package/lib/cjs/models/redirectUri.js +2 -0
  13. package/lib/cjs/models/response.js +2 -0
  14. package/lib/cjs/models/webhooks.js +18 -0
  15. package/lib/cjs/nylas.js +34 -0
  16. package/lib/cjs/package.json +3 -0
  17. package/lib/cjs/resources/applications.js +30 -0
  18. package/lib/cjs/resources/auth.js +153 -0
  19. package/lib/cjs/resources/calendars.js +78 -0
  20. package/lib/cjs/resources/events.js +69 -0
  21. package/lib/cjs/resources/grants.js +65 -0
  22. package/lib/cjs/resources/redirectUris.js +64 -0
  23. package/lib/cjs/resources/resource.js +111 -0
  24. package/lib/cjs/resources/webhooks.js +98 -0
  25. package/lib/cjs/utils.js +58 -0
  26. package/lib/cjs/version.js +5 -0
  27. package/lib/esm/apiClient.js +111 -0
  28. package/lib/esm/config.js +29 -0
  29. package/lib/esm/models/applicationDetails.js +1 -0
  30. package/lib/esm/models/auth.js +1 -0
  31. package/lib/esm/models/availability.js +8 -0
  32. package/lib/esm/models/calendars.js +1 -0
  33. package/lib/esm/models/error.js +45 -0
  34. package/lib/esm/models/events.js +1 -0
  35. package/lib/esm/models/grants.js +1 -0
  36. package/lib/esm/models/listQueryParams.js +1 -0
  37. package/lib/esm/models/redirectUri.js +1 -0
  38. package/lib/esm/models/response.js +1 -0
  39. package/lib/esm/models/webhooks.js +15 -0
  40. package/lib/esm/nylas.js +31 -0
  41. package/lib/esm/package.json +3 -0
  42. package/lib/esm/resources/applications.js +26 -0
  43. package/lib/esm/resources/auth.js +149 -0
  44. package/lib/esm/resources/calendars.js +74 -0
  45. package/lib/esm/resources/events.js +65 -0
  46. package/lib/esm/resources/grants.js +61 -0
  47. package/lib/esm/resources/redirectUris.js +60 -0
  48. package/lib/esm/resources/resource.js +107 -0
  49. package/lib/esm/resources/webhooks.js +94 -0
  50. package/lib/esm/utils.js +53 -0
  51. package/lib/esm/version.js +2 -0
  52. package/lib/types/apiClient.d.ts +65 -0
  53. package/lib/types/config.d.ts +50 -0
  54. package/lib/types/models/applicationDetails.d.ts +93 -0
  55. package/lib/types/models/auth.d.ts +196 -0
  56. package/lib/types/models/availability.d.ts +159 -0
  57. package/lib/types/models/calendars.d.ts +121 -0
  58. package/lib/types/models/error.d.ts +104 -0
  59. package/lib/types/models/events.d.ts +494 -0
  60. package/lib/types/models/grants.d.ts +134 -0
  61. package/lib/types/models/listQueryParams.d.ts +4 -0
  62. package/lib/types/models/redirectUri.d.ts +71 -0
  63. package/lib/types/models/response.d.ts +40 -0
  64. package/lib/types/models/webhooks.d.ts +45 -0
  65. package/lib/types/nylas.d.ts +44 -0
  66. package/lib/types/resources/applications.d.ts +26 -0
  67. package/lib/types/resources/auth.d.ts +66 -0
  68. package/lib/types/resources/calendars.d.ts +97 -0
  69. package/lib/types/resources/events.d.ts +87 -0
  70. package/lib/types/resources/grants.d.ts +63 -0
  71. package/lib/types/resources/redirectUris.d.ts +63 -0
  72. package/lib/types/resources/resource.d.ts +55 -0
  73. package/lib/types/resources/webhooks.d.ts +79 -0
  74. package/lib/types/utils.d.ts +22 -0
  75. package/lib/types/version.d.ts +1 -0
  76. package/package.json +33 -42
  77. package/lib/config.d.ts +0 -70
  78. package/lib/config.js +0 -68
  79. package/lib/models/access-token.d.ts +0 -18
  80. package/lib/models/access-token.js +0 -56
  81. package/lib/models/account.d.ts +0 -27
  82. package/lib/models/account.js +0 -73
  83. package/lib/models/application-details.d.ts +0 -14
  84. package/lib/models/application-details.js +0 -47
  85. package/lib/models/attributes.d.ts +0 -151
  86. package/lib/models/attributes.js +0 -382
  87. package/lib/models/calendar-availability.d.ts +0 -76
  88. package/lib/models/calendar-availability.js +0 -121
  89. package/lib/models/calendar-restful-model-collection.d.ts +0 -17
  90. package/lib/models/calendar-restful-model-collection.js +0 -181
  91. package/lib/models/calendar.d.ts +0 -31
  92. package/lib/models/calendar.js +0 -93
  93. package/lib/models/component-restful-model-collection.d.ts +0 -9
  94. package/lib/models/component-restful-model-collection.js +0 -34
  95. package/lib/models/component.d.ts +0 -37
  96. package/lib/models/component.js +0 -91
  97. package/lib/models/connect.d.ts +0 -73
  98. package/lib/models/connect.js +0 -193
  99. package/lib/models/contact-restful-model-collection.d.ts +0 -9
  100. package/lib/models/contact-restful-model-collection.js +0 -60
  101. package/lib/models/contact.d.ts +0 -129
  102. package/lib/models/contact.js +0 -289
  103. package/lib/models/delta-collection.d.ts +0 -17
  104. package/lib/models/delta-collection.js +0 -139
  105. package/lib/models/delta-stream.d.ts +0 -32
  106. package/lib/models/delta-stream.js +0 -250
  107. package/lib/models/delta.d.ts +0 -28
  108. package/lib/models/delta.js +0 -88
  109. package/lib/models/deltas.d.ts +0 -17
  110. package/lib/models/deltas.js +0 -49
  111. package/lib/models/draft.d.ts +0 -27
  112. package/lib/models/draft.js +0 -156
  113. package/lib/models/email-participant.d.ts +0 -13
  114. package/lib/models/email-participant.js +0 -46
  115. package/lib/models/event-conferencing.d.ts +0 -34
  116. package/lib/models/event-conferencing.js +0 -71
  117. package/lib/models/event-notification.d.ts +0 -27
  118. package/lib/models/event-notification.js +0 -62
  119. package/lib/models/event-participant.d.ts +0 -19
  120. package/lib/models/event-participant.js +0 -56
  121. package/lib/models/event.d.ts +0 -96
  122. package/lib/models/event.js +0 -297
  123. package/lib/models/file.d.ts +0 -29
  124. package/lib/models/file.js +0 -136
  125. package/lib/models/folder.d.ts +0 -21
  126. package/lib/models/folder.js +0 -69
  127. package/lib/models/free-busy.d.ts +0 -58
  128. package/lib/models/free-busy.js +0 -132
  129. package/lib/models/job-status-restful-model-collection.d.ts +0 -9
  130. package/lib/models/job-status-restful-model-collection.js +0 -38
  131. package/lib/models/job-status.d.ts +0 -24
  132. package/lib/models/job-status.js +0 -68
  133. package/lib/models/management-account.d.ts +0 -63
  134. package/lib/models/management-account.js +0 -187
  135. package/lib/models/management-model-collection.d.ts +0 -10
  136. package/lib/models/management-model-collection.js +0 -39
  137. package/lib/models/management-model.d.ts +0 -6
  138. package/lib/models/management-model.js +0 -29
  139. package/lib/models/message-restful-model-collection.d.ts +0 -26
  140. package/lib/models/message-restful-model-collection.js +0 -80
  141. package/lib/models/message.d.ts +0 -57
  142. package/lib/models/message.js +0 -173
  143. package/lib/models/model-collection.d.ts +0 -25
  144. package/lib/models/model-collection.js +0 -201
  145. package/lib/models/model.d.ts +0 -12
  146. package/lib/models/model.js +0 -64
  147. package/lib/models/neural-categorizer.d.ts +0 -28
  148. package/lib/models/neural-categorizer.js +0 -139
  149. package/lib/models/neural-clean-conversation.d.ts +0 -16
  150. package/lib/models/neural-clean-conversation.js +0 -114
  151. package/lib/models/neural-ocr.d.ts +0 -14
  152. package/lib/models/neural-ocr.js +0 -50
  153. package/lib/models/neural-sentiment-analysis.d.ts +0 -20
  154. package/lib/models/neural-sentiment-analysis.js +0 -56
  155. package/lib/models/neural-signature-contact.d.ts +0 -43
  156. package/lib/models/neural-signature-contact.js +0 -142
  157. package/lib/models/neural-signature-extraction.d.ts +0 -17
  158. package/lib/models/neural-signature-extraction.js +0 -54
  159. package/lib/models/neural.d.ts +0 -36
  160. package/lib/models/neural.js +0 -163
  161. package/lib/models/nylas-api-error.d.ts +0 -26
  162. package/lib/models/nylas-api-error.js +0 -61
  163. package/lib/models/outbox-job-status.d.ts +0 -20
  164. package/lib/models/outbox-job-status.js +0 -64
  165. package/lib/models/outbox-message.d.ts +0 -16
  166. package/lib/models/outbox-message.js +0 -54
  167. package/lib/models/outbox.d.ts +0 -35
  168. package/lib/models/outbox.js +0 -158
  169. package/lib/models/resource.d.ts +0 -22
  170. package/lib/models/resource.js +0 -66
  171. package/lib/models/restful-model-collection.d.ts +0 -15
  172. package/lib/models/restful-model-collection.js +0 -169
  173. package/lib/models/restful-model-instance.d.ts +0 -9
  174. package/lib/models/restful-model-instance.js +0 -37
  175. package/lib/models/restful-model.d.ts +0 -36
  176. package/lib/models/restful-model.js +0 -146
  177. package/lib/models/scheduler-booking-request.d.ts +0 -64
  178. package/lib/models/scheduler-booking-request.js +0 -148
  179. package/lib/models/scheduler-restful-model-collection.d.ts +0 -26
  180. package/lib/models/scheduler-restful-model-collection.js +0 -133
  181. package/lib/models/scheduler-time-slot.d.ts +0 -20
  182. package/lib/models/scheduler-time-slot.js +0 -53
  183. package/lib/models/scheduler.d.ts +0 -226
  184. package/lib/models/scheduler.js +0 -446
  185. package/lib/models/thread.d.ts +0 -49
  186. package/lib/models/thread.js +0 -127
  187. package/lib/models/webhook-notification.d.ts +0 -108
  188. package/lib/models/webhook-notification.js +0 -239
  189. package/lib/models/webhook.d.ts +0 -50
  190. package/lib/models/webhook.js +0 -101
  191. package/lib/models/when.d.ts +0 -23
  192. package/lib/models/when.js +0 -65
  193. package/lib/nylas-connection.d.ts +0 -71
  194. package/lib/nylas-connection.js +0 -258
  195. package/lib/nylas.d.ts +0 -57
  196. package/lib/nylas.js +0 -210
  197. package/lib/server-bindings/express-binding.d.ts +0 -18
  198. package/lib/server-bindings/express-binding.js +0 -163
  199. package/lib/server-bindings/server-binding.d.ts +0 -65
  200. package/lib/server-bindings/server-binding.js +0 -87
  201. package/lib/services/routes.d.ts +0 -26
  202. package/lib/services/routes.js +0 -95
  203. package/lib/services/tunnel.d.ts +0 -29
  204. package/lib/services/tunnel.js +0 -112
@@ -0,0 +1,121 @@
1
+ import { ListQueryParams } from './listQueryParams.js';
2
+ /**
3
+ * Interface of the query parameters for listing calendars.
4
+ */
5
+ export interface ListCalendersQueryParams extends ListQueryParams {
6
+ /**
7
+ * The maximum number of objects to return.
8
+ * This field defaults to 50. The maximum allowed value is 200.
9
+ */
10
+ limit?: number;
11
+ /**
12
+ * An identifier that specifies which page of data to return.
13
+ * This value should be taken from the [ListResponse.nextCursor] response field.
14
+ */
15
+ pageToken?: string;
16
+ /**
17
+ * Pass in your metadata key and value pair to search for metadata.
18
+ */
19
+ metadataPair?: Record<string, string>;
20
+ }
21
+ /**
22
+ * Interface of a Nylas create calendar request
23
+ */
24
+ export interface CreateCalenderRequest {
25
+ /**
26
+ * Name of the Calendar.
27
+ */
28
+ name: string;
29
+ /**
30
+ * Description of the calendar.
31
+ */
32
+ description?: string;
33
+ /**
34
+ * Geographic location of the calendar as free-form text.
35
+ */
36
+ location?: string;
37
+ /**
38
+ * IANA time zone database formatted string (e.g. America/New_York).
39
+ * @see <a href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones">List of tz database time zones</a>
40
+ */
41
+ timezone?: string;
42
+ /**
43
+ * A list of key-value pairs storing additional data.
44
+ */
45
+ metadata?: Record<string, string>;
46
+ }
47
+ /**
48
+ * Interface of a Nylas update calendar request
49
+ */
50
+ export interface UpdateCalenderRequest extends CreateCalenderRequest {
51
+ /**
52
+ * The background color of the calendar in the hexadecimal format (e.g. #0099EE).
53
+ * Empty indicates default color.
54
+ */
55
+ hexColor?: string;
56
+ /**
57
+ * The background color of the calendar in the hexadecimal format (e.g. #0099EE).
58
+ * Empty indicates default color. (Google only)
59
+ */
60
+ hexForegroundColor?: string;
61
+ }
62
+ /**
63
+ * Interface of a Nylas calendar object
64
+ */
65
+ export interface Calendar {
66
+ /**
67
+ * Globally unique object identifier.
68
+ */
69
+ id: string;
70
+ /**
71
+ * Grant ID of the Nylas account.
72
+ */
73
+ grantId: string;
74
+ /**
75
+ * Name of the Calendar.
76
+ */
77
+ name: string;
78
+ /**
79
+ * The type of object.
80
+ */
81
+ object: string;
82
+ /**
83
+ * IANA time zone database formatted string (e.g. America/New_York).
84
+ * @see <a href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones">List of tz database time zones</a>
85
+ */
86
+ timezone: string;
87
+ /**
88
+ * If the event participants are able to edit the event.
89
+ */
90
+ readOnly: boolean;
91
+ /**
92
+ * If the calendar is owned by the user account.
93
+ */
94
+ isOwnedByUser: boolean;
95
+ /**
96
+ * Description of the calendar.
97
+ */
98
+ description?: string;
99
+ /**
100
+ * Geographic location of the calendar as free-form text.
101
+ */
102
+ location?: string;
103
+ /**
104
+ * The background color of the calendar in the hexadecimal format (e.g. #0099EE).
105
+ * Empty indicates default color.
106
+ */
107
+ hexColor?: string;
108
+ /**
109
+ * The background color of the calendar in the hexadecimal format (e.g. #0099EE).
110
+ * Empty indicates default color. (Google only)
111
+ */
112
+ hexForegroundColor?: string;
113
+ /**
114
+ * If the calendar is the primary calendar.
115
+ */
116
+ isPrimary?: boolean;
117
+ /**
118
+ * A list of key-value pairs storing additional data.
119
+ */
120
+ metadata?: Record<string, unknown>;
121
+ }
@@ -0,0 +1,104 @@
1
+ /**
2
+ * Base class for all Nylas API errors.
3
+ */
4
+ export declare abstract class AbstractNylasApiError extends Error {
5
+ /**
6
+ * The unique identifier of the request.
7
+ */
8
+ requestId?: string;
9
+ /**
10
+ * The HTTP status code of the error response.
11
+ */
12
+ statusCode?: number;
13
+ }
14
+ /**
15
+ * Base class for all Nylas SDK errors.
16
+ */
17
+ export declare abstract class AbstractNylasSdkError extends Error {
18
+ }
19
+ /**
20
+ * Class representation of a general Nylas API error.
21
+ */
22
+ export declare class NylasApiError extends AbstractNylasApiError implements NylasApiErrorResponseData {
23
+ /**
24
+ * Error type.
25
+ */
26
+ type: string;
27
+ /**
28
+ * Provider Error.
29
+ */
30
+ providerError: any;
31
+ constructor(apiError: NylasApiErrorResponse, statusCode?: number);
32
+ }
33
+ /**
34
+ * Class representing an OAuth error returned by the Nylas API.
35
+ */
36
+ export declare class NylasOAuthError extends AbstractNylasApiError implements NylasOAuthErrorResponse {
37
+ /**
38
+ * Error type.
39
+ */
40
+ error: string;
41
+ /**
42
+ * Error code used for referencing the docs, logs, and data stream.
43
+ */
44
+ errorCode: number;
45
+ /**
46
+ * Human readable error description.
47
+ */
48
+ errorDescription: string;
49
+ /**
50
+ * URL to the related documentation and troubleshooting regarding this error.
51
+ */
52
+ errorUri: string;
53
+ constructor(apiError: NylasOAuthErrorResponse, statusCode?: number);
54
+ }
55
+ /**
56
+ * Error thrown when the Nylas SDK times out before receiving a response from the server
57
+ */
58
+ export declare class NylasSdkTimeoutError extends AbstractNylasSdkError {
59
+ /**
60
+ * The URL that timed out
61
+ */
62
+ url: string;
63
+ /**
64
+ * The timeout value set in the Nylas SDK, in seconds
65
+ */
66
+ timeout: number;
67
+ constructor(url: string, timeout: number);
68
+ }
69
+ /**
70
+ * Interface representing the error response from the Nylas API.
71
+ */
72
+ export interface NylasApiErrorResponse {
73
+ requestId: string;
74
+ error: NylasApiErrorResponseData;
75
+ }
76
+ /**
77
+ * Interface representing the error data within the response object.
78
+ */
79
+ export interface NylasApiErrorResponseData {
80
+ type: string;
81
+ message: string;
82
+ providerError?: any;
83
+ }
84
+ /**
85
+ * Interface representing an OAuth error returned by the Nylas API.
86
+ */
87
+ export interface NylasOAuthErrorResponse {
88
+ /**
89
+ * Error type.
90
+ */
91
+ error: string;
92
+ /**
93
+ * Error code used for referencing the docs, logs, and data stream.
94
+ */
95
+ errorCode: number;
96
+ /**
97
+ * Human readable error description.
98
+ */
99
+ errorDescription: string;
100
+ /**
101
+ * URL to the related documentation and troubleshooting regarding this error.
102
+ */
103
+ errorUri: string;
104
+ }
@@ -0,0 +1,494 @@
1
+ import { ListQueryParams } from './listQueryParams.js';
2
+ import { Subset } from '../utils.js';
3
+ /**
4
+ * Interface representing a Nylas Event object.
5
+ */
6
+ export interface Event {
7
+ /**
8
+ * Globally unique object identifier.
9
+ */
10
+ id: string;
11
+ /**
12
+ * Grant ID of the Nylas account.
13
+ */
14
+ grantId: string;
15
+ /**
16
+ * The type of object.
17
+ */
18
+ object: 'event';
19
+ /**
20
+ * Calendar ID of the event.
21
+ */
22
+ calendarId: string;
23
+ /**
24
+ * This value determines whether to show this event's time block as available on shared or public calendars.
25
+ */
26
+ busy: boolean;
27
+ /**
28
+ * If the event participants are able to edit the event.
29
+ */
30
+ readOnly: boolean;
31
+ /**
32
+ * Unix timestamp when the event was created.
33
+ */
34
+ createdAt: number;
35
+ /**
36
+ * Unix timestamp when the event was last updated.
37
+ */
38
+ updatedAt: number;
39
+ /**
40
+ * List of participants invited to the event. Participants may also be rooms or resources.
41
+ */
42
+ participants: Participant[];
43
+ /**
44
+ * Representation of time and duration for events. When object can be in one of four formats (sub-objects):
45
+ * - {@link Date}
46
+ * - {@link Datespan}
47
+ * - {@link Time}
48
+ * - {@link Timespan}
49
+ */
50
+ when: When;
51
+ /**
52
+ * Representation of conferencing details for events. Conferencing object can be in one of two formats (sub-objects):
53
+ * - {@link Autocreate}
54
+ * - {@link Details}
55
+ */
56
+ conferencing: Conferencing;
57
+ /**
58
+ * Description of the event.
59
+ */
60
+ description?: string;
61
+ /**
62
+ * Location of the event, such as a physical address or meeting room name.
63
+ */
64
+ location?: string;
65
+ /**
66
+ * Unique id for iCalendar standard, for identifying events across calendaring systems.
67
+ * Recurring events may share the same value. Can be null for events synced before the year 2020.
68
+ */
69
+ icalUid?: string;
70
+ /**
71
+ * Title of the event.
72
+ */
73
+ title?: string;
74
+ /**
75
+ * A link to this event in the provider's UI
76
+ */
77
+ htmlLink?: string;
78
+ /**
79
+ * Whether participants of the event should be hidden.
80
+ */
81
+ hideParticipants?: boolean;
82
+ /**
83
+ * List of key-value pairs storing additional data.
84
+ */
85
+ metadata?: Record<string, string>;
86
+ /**
87
+ * User who created the event.
88
+ * Not supported for all providers.
89
+ */
90
+ creator?: EmailName;
91
+ /**
92
+ * Organizer of the event.
93
+ */
94
+ organizer: EmailName;
95
+ /**
96
+ * An list of RRULE and EXDATE strings.
97
+ * @see <a href="https://datatracker.ietf.org/doc/html/rfc5545#section-3.8.5">RFC-5545</a>
98
+ */
99
+ recurrence?: string[];
100
+ /**
101
+ * List of reminders for the event.
102
+ */
103
+ reminders?: Reminder[];
104
+ /**
105
+ * Status of the event.
106
+ */
107
+ status?: Status;
108
+ /**
109
+ * Visibility of the event, if the event is private or public.
110
+ */
111
+ visibility?: Visibility;
112
+ }
113
+ /**
114
+ * Interface representing a request to create an event.
115
+ */
116
+ export interface CreateEventRequest {
117
+ /**
118
+ * Representation of time and duration for events. When object can be in one of four formats (sub-objects):
119
+ * - {@link Date}
120
+ * - {@link Datespan}
121
+ * - {@link Time}
122
+ * - {@link Timespan}
123
+ */
124
+ when: When;
125
+ /**
126
+ * Title of the event.
127
+ */
128
+ title?: string;
129
+ /**
130
+ * This value determines whether to show this event's time block as available on shared or public calendars.
131
+ */
132
+ busy?: boolean;
133
+ /**
134
+ * Description of the event.
135
+ */
136
+ description?: string;
137
+ /**
138
+ * Location of the event, such as a physical address or meeting room name.
139
+ */
140
+ location?: string;
141
+ /**
142
+ * Representation of conferencing details for events. Conferencing object can be in one of two formats (sub-objects):
143
+ * - {@link Autocreate}
144
+ * - {@link Details}
145
+ */
146
+ conferencing?: Conferencing;
147
+ /**
148
+ * The number of minutes before the event start time when a user wants a reminder for this event.
149
+ * Reminder minutes need to be entered in the following format: "[20]".
150
+ */
151
+ reminderMinutes?: string;
152
+ /**
153
+ * Method to remind the user about the event. (Google only).
154
+ */
155
+ reminderMethod?: string;
156
+ /**
157
+ * A list of key-value pairs storing additional data.
158
+ */
159
+ metadata?: Record<string, unknown>;
160
+ /**
161
+ * List of participants invited to the event. Participants may also be rooms or resources.
162
+ */
163
+ participants?: Participant[];
164
+ /**
165
+ * An list of RRULE and EXDATE strings.
166
+ * @see <a href="https://datatracker.ietf.org/doc/html/rfc5545#section-3.8.5">RFC-5545</a>
167
+ */
168
+ recurrence?: string[];
169
+ /**
170
+ * Calendar ID of the event.
171
+ */
172
+ calendarId?: string;
173
+ /**
174
+ * If the event participants are able to edit the event.
175
+ */
176
+ readOnly?: boolean;
177
+ /**
178
+ * Visibility of the event, if the event is private or public.
179
+ */
180
+ visibility?: 'public' | 'private';
181
+ /**
182
+ * The maximum number of participants that may attend the event.
183
+ */
184
+ capacity?: number;
185
+ /**
186
+ * Whether participants of the event should be hidden.
187
+ */
188
+ hideParticipants?: boolean;
189
+ }
190
+ /**
191
+ * Interface representing a request to update an event.
192
+ */
193
+ export type UpdateEventRequest = Subset<CreateEventRequest>;
194
+ /**
195
+ * Interface representing the query parameters for listing events.
196
+ */
197
+ export interface ListEventQueryParams extends ListQueryParams {
198
+ /**
199
+ * Return events that have a status of cancelled.
200
+ * If an event is recurring, then it returns no matter the value set.
201
+ * Different providers have different semantics for cancelled events.
202
+ */
203
+ showCancelled?: boolean;
204
+ eventId?: string;
205
+ /**
206
+ * Specify calendar ID of the event. "primary" is a supported value indicating the user's primary calendar.
207
+ */
208
+ calendarId: string;
209
+ /**
210
+ * Return events matching the specified title.
211
+ */
212
+ title?: string;
213
+ /**
214
+ * Return events matching the specified description.
215
+ * Graph: NOT supported
216
+ */
217
+ description?: string;
218
+ /**
219
+ * Return events matching the specified location.
220
+ */
221
+ location?: string;
222
+ /**
223
+ * Return events ending before the specified unix timestamp.
224
+ * Defaults to a month from now. Not respected by metadata filtering.
225
+ */
226
+ end?: string;
227
+ /**
228
+ * Return events starting after the specified unix timestamp.
229
+ * Defaults to the current timestamp. Not respected by metadata filtering.
230
+ */
231
+ start?: string;
232
+ /**
233
+ * Pass in your metadata key and value pair to search for metadata.
234
+ */
235
+ metadataPair?: Record<string, unknown>;
236
+ /**
237
+ * If true, the response will include an event for each occurrence of a recurring event within the requested time range.
238
+ * If false, only a single primary event will be returned for each recurring event.
239
+ * Cannot be used when filtering on metadata.
240
+ * Defaults to false.
241
+ */
242
+ expandRecurring?: boolean;
243
+ /**
244
+ * Returns events with a busy status of true.
245
+ */
246
+ busy?: boolean;
247
+ /**
248
+ * Order results by the specified field.
249
+ * Currently only start is supported.
250
+ */
251
+ orderBy?: string;
252
+ /**
253
+ * The maximum number of objects to return.
254
+ * This field defaults to 50. The maximum allowed value is 200.
255
+ */
256
+ limit?: number;
257
+ /**
258
+ * An identifier that specifies which page of data to return.
259
+ * This value should be taken from the {@link NylasListResponse.nextCursor} response field.
260
+ */
261
+ pageToken?: string;
262
+ }
263
+ /**
264
+ * Interface representing of the query parameters for creating an event.
265
+ */
266
+ export interface CreateEventQueryParams {
267
+ /**
268
+ * The ID of the calendar to create the event in.
269
+ */
270
+ calendarId: string;
271
+ /**
272
+ * Email notifications containing the calendar event is sent to all event participants.
273
+ */
274
+ notifyParticipants?: boolean;
275
+ }
276
+ /**
277
+ * Interface representing of the query parameters for finding an event.
278
+ */
279
+ export interface FindEventQueryParams {
280
+ /**
281
+ * Calendar ID to find the event in. "primary" is a supported value indicating the user's primary calendar.
282
+ */
283
+ calendarId: string;
284
+ }
285
+ /**
286
+ * Interface representing of the query parameters for updating events.
287
+ */
288
+ export type UpdateEventQueryParams = CreateEventQueryParams;
289
+ /**
290
+ * Interface representing of the query parameters for destroying events.
291
+ */
292
+ export type DestroyEventQueryParams = CreateEventQueryParams;
293
+ /**
294
+ * Enum representing the status of an event.
295
+ */
296
+ type Status = 'confirmed' | 'tentative' | 'cancelled';
297
+ /**
298
+ * Enum representing the visibility of an event.
299
+ */
300
+ type Visibility = 'public' | 'private';
301
+ /**
302
+ * Enum representing the supported conferencing providers.
303
+ */
304
+ type ConferencingProvider = 'Google Meet' | 'Zoom Meeting' | 'Microsoft Teams' | 'GoToMeeting' | 'WebEx';
305
+ /**
306
+ * Enum representing the status of an event participant.
307
+ */
308
+ type ParticipantStatus = 'noreply' | 'yes' | 'no' | 'maybe';
309
+ /**
310
+ * Enum representing the different types of reminders.
311
+ */
312
+ type ReminderMethod = 'email' | 'popup' | 'sound' | 'display';
313
+ /**
314
+ * Type representing the different conferencing objects.
315
+ */
316
+ type Conferencing = Details | Autocreate;
317
+ /**
318
+ * Type representing the different objects representing time and duration for events.
319
+ */
320
+ type When = Time | Timespan | Date | Datespan;
321
+ /**
322
+ * Interface of a conferencing details object
323
+ */
324
+ export interface Details {
325
+ /**
326
+ * The conferencing provider
327
+ */
328
+ provider: ConferencingProvider;
329
+ /**
330
+ * The conferencing details
331
+ */
332
+ details: DetailsConfig;
333
+ }
334
+ /**
335
+ * Interface of a the configuration for a conferencing object
336
+ */
337
+ export interface DetailsConfig {
338
+ /**
339
+ * The conferencing meeting code. Used for Zoom.
340
+ */
341
+ meetingCode?: string;
342
+ /**
343
+ * The conferencing meeting password. Used for Zoom.
344
+ */
345
+ password?: string;
346
+ /**
347
+ * The conferencing meeting url.
348
+ */
349
+ url?: string;
350
+ /**
351
+ * The conferencing meeting pin. Used for Google Meet.
352
+ */
353
+ pin?: string;
354
+ /**
355
+ * The conferencing meeting phone numbers. Used for Google Meet.
356
+ */
357
+ phone?: string[];
358
+ }
359
+ /**
360
+ * Class representation of a conferencing autocreate object
361
+ */
362
+ export interface Autocreate {
363
+ /**
364
+ * The conferencing provider
365
+ */
366
+ provider: ConferencingProvider;
367
+ /**
368
+ * Empty dict to indicate an intention to autocreate a video link.
369
+ * Additional provider settings may be included in autocreate.settings, but Nylas does not validate these.
370
+ */
371
+ autocreate: Record<string, unknown>;
372
+ }
373
+ /**
374
+ * Class representation of a specific point in time.
375
+ * A meeting at 2pm would be represented as a time subobject.
376
+ */
377
+ export interface Time {
378
+ /**
379
+ * A UNIX timestamp representing the time of occurrence.
380
+ */
381
+ time: number;
382
+ /**
383
+ * If timezone is present, then the value for time will be read with timezone.
384
+ * Timezone using IANA formatted string. (e.g. "America/New_York")
385
+ * @see <a href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones">List of tz database time zones</a>
386
+ */
387
+ timezone: string;
388
+ }
389
+ /**
390
+ * Class representation of a time span with start and end times.
391
+ * An hour lunch meeting would be represented as timespan subobjects.
392
+ */
393
+ export interface Timespan {
394
+ /**
395
+ * The start time of the event.
396
+ */
397
+ startTime: number;
398
+ /**
399
+ * The end time of the event.
400
+ */
401
+ endTime: number;
402
+ /**
403
+ * The timezone of the start time.
404
+ * Timezone using IANA formatted string. (e.g. "America/New_York")
405
+ * @see <a href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones">List of tz database time zones</a>
406
+ */
407
+ startTimezone?: string;
408
+ /**
409
+ * The timezone of the end time.
410
+ * Timezone using IANA formatted string. (e.g. "America/New_York")
411
+ * @see <a href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones">List of tz database time zones</a>
412
+ */
413
+ endTimezone?: string;
414
+ }
415
+ /**
416
+ * Class representation of an entire day spans without specific times.
417
+ * Your birthday and holidays would be represented as date subobjects.
418
+ */
419
+ export interface Date {
420
+ /**
421
+ * Date of occurrence in ISO 8601 format.
422
+ * @see <a href="https://en.wikipedia.org/wiki/ISO_8601#Calendar_dates">ISO 8601</a>
423
+ */
424
+ date: string;
425
+ }
426
+ /**
427
+ * Class representation of a specific dates without clock-based start or end times.
428
+ * A business quarter or academic semester would be represented as datespan subobjects.
429
+ */
430
+ export interface Datespan {
431
+ /**
432
+ * The start date in ISO 8601 format.
433
+ * @see <a href="https://en.wikipedia.org/wiki/ISO_8601#Calendar_dates">ISO 8601</a>
434
+ */
435
+ startDate: string;
436
+ /**
437
+ * The end date in ISO 8601 format.
438
+ * @see <a href="https://en.wikipedia.org/wiki/ISO_8601#Calendar_dates">ISO 8601</a>
439
+ */
440
+ endDate: string;
441
+ }
442
+ /**
443
+ * Interface representing an Event participant.
444
+ */
445
+ export interface Participant {
446
+ /**
447
+ * Participant's email address.
448
+ */
449
+ email: string;
450
+ /**
451
+ * Participant's name.
452
+ */
453
+ name?: string;
454
+ /**
455
+ * Participant's status.
456
+ */
457
+ status: ParticipantStatus;
458
+ /**
459
+ * Comment by the participant.
460
+ */
461
+ comment?: string;
462
+ /**
463
+ * Participant's phone number.
464
+ */
465
+ phoneNumber?: string;
466
+ }
467
+ /**
468
+ * Interface representing the reminders field of an event.
469
+ */
470
+ export interface Reminder {
471
+ /**
472
+ * The number of minutes before the event start time when a user wants a reminder for this event.
473
+ * Reminder minutes are in the following format: "[20]".
474
+ */
475
+ reminderMinutes: string;
476
+ /**
477
+ * Method to remind the user about the event. (Google only).
478
+ */
479
+ reminderMethod: ReminderMethod;
480
+ }
481
+ /**
482
+ * Interface representing an email address and optional name.
483
+ */
484
+ export interface EmailName {
485
+ /**
486
+ * Email address.
487
+ */
488
+ email: string;
489
+ /**
490
+ * Full name.
491
+ */
492
+ name?: string;
493
+ }
494
+ export {};