@roarkanalytics/sdk 6.1.0 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/client.d.mts +9 -0
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +9 -0
  5. package/client.d.ts.map +1 -1
  6. package/client.js +9 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +9 -0
  9. package/client.mjs.map +1 -1
  10. package/lib/config.d.mts +12 -0
  11. package/lib/config.d.mts.map +1 -1
  12. package/lib/config.d.ts +12 -0
  13. package/lib/config.d.ts.map +1 -1
  14. package/lib/config.js +11 -1
  15. package/lib/config.js.map +1 -1
  16. package/lib/config.mjs +9 -0
  17. package/lib/config.mjs.map +1 -1
  18. package/package.json +1 -1
  19. package/resources/calendar-connection.d.mts +897 -0
  20. package/resources/calendar-connection.d.mts.map +1 -0
  21. package/resources/calendar-connection.d.ts +897 -0
  22. package/resources/calendar-connection.d.ts.map +1 -0
  23. package/resources/calendar-connection.js +143 -0
  24. package/resources/calendar-connection.js.map +1 -0
  25. package/resources/calendar-connection.mjs +139 -0
  26. package/resources/calendar-connection.mjs.map +1 -0
  27. package/resources/call.d.mts +2 -0
  28. package/resources/call.d.mts.map +1 -1
  29. package/resources/call.d.ts +2 -0
  30. package/resources/call.d.ts.map +1 -1
  31. package/resources/config.d.mts +506 -26
  32. package/resources/config.d.mts.map +1 -1
  33. package/resources/config.d.ts +506 -26
  34. package/resources/config.d.ts.map +1 -1
  35. package/resources/http-request-definition.d.mts +4 -4
  36. package/resources/http-request-definition.d.mts.map +1 -1
  37. package/resources/http-request-definition.d.ts +4 -4
  38. package/resources/http-request-definition.d.ts.map +1 -1
  39. package/resources/index.d.mts +3 -0
  40. package/resources/index.d.mts.map +1 -1
  41. package/resources/index.d.ts +3 -0
  42. package/resources/index.d.ts.map +1 -1
  43. package/resources/index.js +7 -1
  44. package/resources/index.js.map +1 -1
  45. package/resources/index.mjs +3 -0
  46. package/resources/index.mjs.map +1 -1
  47. package/resources/live-report.d.mts +1830 -0
  48. package/resources/live-report.d.mts.map +1 -0
  49. package/resources/live-report.d.ts +1830 -0
  50. package/resources/live-report.d.ts.map +1 -0
  51. package/resources/live-report.js +131 -0
  52. package/resources/live-report.js.map +1 -0
  53. package/resources/live-report.mjs +127 -0
  54. package/resources/live-report.mjs.map +1 -0
  55. package/resources/metric-variant.d.mts +5 -0
  56. package/resources/metric-variant.d.mts.map +1 -1
  57. package/resources/metric-variant.d.ts +5 -0
  58. package/resources/metric-variant.d.ts.map +1 -1
  59. package/resources/metric.d.mts +90 -0
  60. package/resources/metric.d.mts.map +1 -1
  61. package/resources/metric.d.ts +90 -0
  62. package/resources/metric.d.ts.map +1 -1
  63. package/resources/tool.d.mts +671 -0
  64. package/resources/tool.d.mts.map +1 -0
  65. package/resources/tool.d.ts +671 -0
  66. package/resources/tool.d.ts.map +1 -0
  67. package/resources/tool.js +83 -0
  68. package/resources/tool.js.map +1 -0
  69. package/resources/tool.mjs +79 -0
  70. package/resources/tool.mjs.map +1 -0
  71. package/src/client.ts +95 -0
  72. package/src/lib/config.ts +22 -0
  73. package/src/resources/calendar-connection.ts +1103 -0
  74. package/src/resources/call.ts +4 -0
  75. package/src/resources/config.ts +937 -23
  76. package/src/resources/http-request-definition.ts +4 -4
  77. package/src/resources/index.ts +43 -0
  78. package/src/resources/live-report.ts +3036 -0
  79. package/src/resources/metric-variant.ts +6 -0
  80. package/src/resources/metric.ts +108 -0
  81. package/src/resources/tool.ts +884 -0
  82. package/src/version.ts +1 -1
  83. package/version.d.mts +1 -1
  84. package/version.d.ts +1 -1
  85. package/version.js +1 -1
  86. package/version.mjs +1 -1
@@ -0,0 +1,897 @@
1
+ import { APIResource } from "../core/resource.js";
2
+ import { APIPromise } from "../core/api-promise.js";
3
+ import { RequestOptions } from "../internal/request-options.js";
4
+ export declare class CalendarConnection extends APIResource {
5
+ /**
6
+ * Verifies the credential against the provider and, only if it works, stores it
7
+ * encrypted. A credential the provider rejects is a 400 and no connection is
8
+ * created: a connection that has never worked would next be exercised by an
9
+ * inbound call at 2am, with nobody there to fix it.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const calendarConnection =
14
+ * await client.calendarConnection.create({
15
+ * apiKey: 'x',
16
+ * label: 'x',
17
+ * provider: 'CAL_COM',
18
+ * });
19
+ * ```
20
+ */
21
+ create(body: CalendarConnectionCreateParams, options?: RequestOptions): APIPromise<CalendarConnectionCreateResponse>;
22
+ /**
23
+ * Renames a connection, changes the timezone slots are offered in, or rotates the
24
+ * credential. A rotated credential is verified first, and a verified credential
25
+ * returns the connection to ACTIVE.
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * const calendarConnection =
30
+ * await client.calendarConnection.update('connectionId');
31
+ * ```
32
+ */
33
+ update(connectionID: string, body?: CalendarConnectionUpdateParams | null | undefined, options?: RequestOptions): APIPromise<CalendarConnectionUpdateResponse>;
34
+ /**
35
+ * Returns every calendar connection in the authenticated project, by label. A
36
+ * project has a handful of these, so the list is not paginated:
37
+ * `pagination.hasMore` is always false.
38
+ *
39
+ * @example
40
+ * ```ts
41
+ * const calendarConnections =
42
+ * await client.calendarConnection.list();
43
+ * ```
44
+ */
45
+ list(query?: CalendarConnectionListParams | null | undefined, options?: RequestOptions): APIPromise<CalendarConnectionListResponse>;
46
+ /**
47
+ * Disconnects the calendar and destroys the stored credential. A credential the
48
+ * customer deleted should stop existing, so this is not an archive. Appointments
49
+ * already recorded against the connection are kept, so a booking stays explainable
50
+ * after the calendar is disconnected. Refused with a 409 while a calendar tool is
51
+ * still bound to the connection, naming the tools: point them at another calendar,
52
+ * or delete them, first. A dangling binding would otherwise be found by whoever
53
+ * next tried to ship the agent, who is not the person who disconnected the
54
+ * calendar.
55
+ *
56
+ * @example
57
+ * ```ts
58
+ * const calendarConnection =
59
+ * await client.calendarConnection.delete('connectionId');
60
+ * ```
61
+ */
62
+ delete(connectionID: string, options?: RequestOptions): APIPromise<CalendarConnectionDeleteResponse>;
63
+ /**
64
+ * Re-verifies the stored credential against the provider and records the result on
65
+ * the connection. A credential the provider rejects sets `status` to
66
+ * INVALID_CREDENTIALS. A provider outage is a 500 and leaves the status untouched:
67
+ * being unable to reach the provider is not evidence that the customer’s
68
+ * credential is bad.
69
+ *
70
+ * @example
71
+ * ```ts
72
+ * const response =
73
+ * await client.calendarConnection.check('connectionId');
74
+ * ```
75
+ */
76
+ check(connectionID: string, options?: RequestOptions): APIPromise<CalendarConnectionCheckResponse>;
77
+ /**
78
+ * Returns one calendar connection. The stored credential is never included.
79
+ *
80
+ * @example
81
+ * ```ts
82
+ * const response =
83
+ * await client.calendarConnection.getByID('connectionId');
84
+ * ```
85
+ */
86
+ getByID(connectionID: string, options?: RequestOptions): APIPromise<CalendarConnectionGetByIDResponse>;
87
+ /**
88
+ * The same entry as the list, plus what it demands of a booker.
89
+ * `requiresAttendeeEmail` is the field that decides an agent’s design: the
90
+ * attendee object itself needs only a name and a timezone, but an event type can
91
+ * declare email required, and an agent that cannot collect one simply cannot book
92
+ * on it. Read this when configuring a calendar tool, not after a caller is already
93
+ * waiting. Costs one provider call more than the list, which is why the list does
94
+ * not fold it in.
95
+ *
96
+ * @example
97
+ * ```ts
98
+ * const response = await client.calendarConnection.getTarget(
99
+ * 'targetId',
100
+ * { connectionId: 'connectionId' },
101
+ * );
102
+ * ```
103
+ */
104
+ getTarget(targetID: string, params: CalendarConnectionGetTargetParams, options?: RequestOptions): APIPromise<CalendarConnectionGetTargetResponse>;
105
+ /**
106
+ * What an agent can be pointed at on this connection: Cal.com event types today,
107
+ * Google calendars when that lands. Read live from the provider, so an event type
108
+ * added since you connected is here without reconnecting. Each entry carries a
109
+ * `target` ready to put on a calendar tool, so nothing has to assemble one by
110
+ * hand.
111
+ *
112
+ * @example
113
+ * ```ts
114
+ * const response =
115
+ * await client.calendarConnection.listTargets(
116
+ * 'connectionId',
117
+ * );
118
+ * ```
119
+ */
120
+ listTargets(connectionID: string, options?: RequestOptions): APIPromise<CalendarConnectionListTargetsResponse>;
121
+ }
122
+ export interface CalendarConnectionCreateResponse {
123
+ /**
124
+ * A project’s credential for one calendar account, the thing a calendar tool books
125
+ * against. The credential itself is never returned.
126
+ */
127
+ data: CalendarConnectionCreateResponse.Data;
128
+ }
129
+ export declare namespace CalendarConnectionCreateResponse {
130
+ /**
131
+ * A project’s credential for one calendar account, the thing a calendar tool books
132
+ * against. The credential itself is never returned.
133
+ */
134
+ interface Data {
135
+ /**
136
+ * Unique identifier of the calendar connection.
137
+ */
138
+ id: string;
139
+ /**
140
+ * How the provider names the connected account (a Cal.com email). Read-only.
141
+ */
142
+ accountLabel: string | null;
143
+ /**
144
+ * What a calendar provider can actually do. Read this before configuring a
145
+ * calendar tool.
146
+ */
147
+ capabilities: Data.Capabilities;
148
+ /**
149
+ * Creation timestamp in ISO 8601 format.
150
+ */
151
+ createdAt: string;
152
+ /**
153
+ * When the credential expires, ISO 8601. Null when it does not expire.
154
+ */
155
+ credentialExpiresAt: string | null;
156
+ /**
157
+ * Customer-supplied name for this account. Unique within the project.
158
+ */
159
+ label: string;
160
+ /**
161
+ * When the credential was last verified against the provider, ISO 8601.
162
+ */
163
+ lastCheckedAt: string | null;
164
+ /**
165
+ * Who holds the calendar. CAL_COM is the only provider that can be connected
166
+ * today; GOOGLE and CALENDLY are described by `capabilities` but not yet
167
+ * connectable.
168
+ */
169
+ provider: 'CAL_COM' | 'GOOGLE' | 'CALENDLY';
170
+ /**
171
+ * Scopes the credential carries, when the provider issues scoped credentials. Null
172
+ * for an API key.
173
+ */
174
+ scopes: Array<string> | null;
175
+ /**
176
+ * Whether the stored credential still works, as of `lastCheckedAt`.
177
+ * INVALID_CREDENTIALS means the provider rejected it and the connection needs a
178
+ * new one. A provider outage never changes this.
179
+ */
180
+ status: 'ACTIVE' | 'INVALID_CREDENTIALS' | 'ERROR';
181
+ /**
182
+ * Why the status is not ACTIVE, in the provider’s words. Null when ACTIVE.
183
+ */
184
+ statusMessage: string | null;
185
+ /**
186
+ * The IANA timezone slots are offered in: the business’s, not the caller’s. A
187
+ * clinic’s 3pm is 3pm whoever dials it.
188
+ */
189
+ timezone: string;
190
+ /**
191
+ * Last update timestamp in ISO 8601 format.
192
+ */
193
+ updatedAt: string;
194
+ }
195
+ namespace Data {
196
+ /**
197
+ * What a calendar provider can actually do. Read this before configuring a
198
+ * calendar tool.
199
+ */
200
+ interface Capabilities {
201
+ /**
202
+ * How this provider is authenticated.
203
+ */
204
+ auth: 'API_KEY' | 'OAUTH';
205
+ /**
206
+ * Hard cap on the width of one availability query, in days, when the provider has
207
+ * one.
208
+ */
209
+ availabilityWindowDays: number | null;
210
+ /**
211
+ * The operations this provider supports. An operation that is absent is never
212
+ * registered as a tool, so the agent cannot promise it: Calendly, for example, has
213
+ * no reschedule API, and callers wanting to move an appointment must cancel and
214
+ * rebook.
215
+ */
216
+ operations: Array<'CHECK_AVAILABILITY' | 'BOOK' | 'LOOKUP_BOOKING' | 'RESCHEDULE' | 'CANCEL' | 'LIST_BOOKINGS'>;
217
+ /**
218
+ * Whether a booking cannot be created without an attendee email address. True for
219
+ * every scheduling system, which decides how an agent has to identify the caller.
220
+ */
221
+ requiresAttendeeEmail: boolean;
222
+ /**
223
+ * True for a raw calendar, which exposes only events and free/busy. Roark then
224
+ * owns bookable hours, duration, buffers, lead time and horizon, because the
225
+ * provider has no notion of them.
226
+ */
227
+ roarkOwnsBookingPolicy: boolean;
228
+ /**
229
+ * Whether a slot can be held before committing. RESERVATION blocks other bookers
230
+ * in the provider’s own UI but is not consumed by the booking that follows, so it
231
+ * is a courtesy and not a guarantee.
232
+ */
233
+ slotHold: 'RESERVATION' | 'NONE';
234
+ }
235
+ }
236
+ }
237
+ export interface CalendarConnectionUpdateResponse {
238
+ /**
239
+ * A project’s credential for one calendar account, the thing a calendar tool books
240
+ * against. The credential itself is never returned.
241
+ */
242
+ data: CalendarConnectionUpdateResponse.Data;
243
+ }
244
+ export declare namespace CalendarConnectionUpdateResponse {
245
+ /**
246
+ * A project’s credential for one calendar account, the thing a calendar tool books
247
+ * against. The credential itself is never returned.
248
+ */
249
+ interface Data {
250
+ /**
251
+ * Unique identifier of the calendar connection.
252
+ */
253
+ id: string;
254
+ /**
255
+ * How the provider names the connected account (a Cal.com email). Read-only.
256
+ */
257
+ accountLabel: string | null;
258
+ /**
259
+ * What a calendar provider can actually do. Read this before configuring a
260
+ * calendar tool.
261
+ */
262
+ capabilities: Data.Capabilities;
263
+ /**
264
+ * Creation timestamp in ISO 8601 format.
265
+ */
266
+ createdAt: string;
267
+ /**
268
+ * When the credential expires, ISO 8601. Null when it does not expire.
269
+ */
270
+ credentialExpiresAt: string | null;
271
+ /**
272
+ * Customer-supplied name for this account. Unique within the project.
273
+ */
274
+ label: string;
275
+ /**
276
+ * When the credential was last verified against the provider, ISO 8601.
277
+ */
278
+ lastCheckedAt: string | null;
279
+ /**
280
+ * Who holds the calendar. CAL_COM is the only provider that can be connected
281
+ * today; GOOGLE and CALENDLY are described by `capabilities` but not yet
282
+ * connectable.
283
+ */
284
+ provider: 'CAL_COM' | 'GOOGLE' | 'CALENDLY';
285
+ /**
286
+ * Scopes the credential carries, when the provider issues scoped credentials. Null
287
+ * for an API key.
288
+ */
289
+ scopes: Array<string> | null;
290
+ /**
291
+ * Whether the stored credential still works, as of `lastCheckedAt`.
292
+ * INVALID_CREDENTIALS means the provider rejected it and the connection needs a
293
+ * new one. A provider outage never changes this.
294
+ */
295
+ status: 'ACTIVE' | 'INVALID_CREDENTIALS' | 'ERROR';
296
+ /**
297
+ * Why the status is not ACTIVE, in the provider’s words. Null when ACTIVE.
298
+ */
299
+ statusMessage: string | null;
300
+ /**
301
+ * The IANA timezone slots are offered in: the business’s, not the caller’s. A
302
+ * clinic’s 3pm is 3pm whoever dials it.
303
+ */
304
+ timezone: string;
305
+ /**
306
+ * Last update timestamp in ISO 8601 format.
307
+ */
308
+ updatedAt: string;
309
+ }
310
+ namespace Data {
311
+ /**
312
+ * What a calendar provider can actually do. Read this before configuring a
313
+ * calendar tool.
314
+ */
315
+ interface Capabilities {
316
+ /**
317
+ * How this provider is authenticated.
318
+ */
319
+ auth: 'API_KEY' | 'OAUTH';
320
+ /**
321
+ * Hard cap on the width of one availability query, in days, when the provider has
322
+ * one.
323
+ */
324
+ availabilityWindowDays: number | null;
325
+ /**
326
+ * The operations this provider supports. An operation that is absent is never
327
+ * registered as a tool, so the agent cannot promise it: Calendly, for example, has
328
+ * no reschedule API, and callers wanting to move an appointment must cancel and
329
+ * rebook.
330
+ */
331
+ operations: Array<'CHECK_AVAILABILITY' | 'BOOK' | 'LOOKUP_BOOKING' | 'RESCHEDULE' | 'CANCEL' | 'LIST_BOOKINGS'>;
332
+ /**
333
+ * Whether a booking cannot be created without an attendee email address. True for
334
+ * every scheduling system, which decides how an agent has to identify the caller.
335
+ */
336
+ requiresAttendeeEmail: boolean;
337
+ /**
338
+ * True for a raw calendar, which exposes only events and free/busy. Roark then
339
+ * owns bookable hours, duration, buffers, lead time and horizon, because the
340
+ * provider has no notion of them.
341
+ */
342
+ roarkOwnsBookingPolicy: boolean;
343
+ /**
344
+ * Whether a slot can be held before committing. RESERVATION blocks other bookers
345
+ * in the provider’s own UI but is not consumed by the booking that follows, so it
346
+ * is a courtesy and not a guarantee.
347
+ */
348
+ slotHold: 'RESERVATION' | 'NONE';
349
+ }
350
+ }
351
+ }
352
+ export interface CalendarConnectionListResponse {
353
+ data: Array<CalendarConnectionListResponse.Data>;
354
+ pagination: CalendarConnectionListResponse.Pagination;
355
+ }
356
+ export declare namespace CalendarConnectionListResponse {
357
+ /**
358
+ * A project’s credential for one calendar account, the thing a calendar tool books
359
+ * against. The credential itself is never returned.
360
+ */
361
+ interface Data {
362
+ /**
363
+ * Unique identifier of the calendar connection.
364
+ */
365
+ id: string;
366
+ /**
367
+ * How the provider names the connected account (a Cal.com email). Read-only.
368
+ */
369
+ accountLabel: string | null;
370
+ /**
371
+ * What a calendar provider can actually do. Read this before configuring a
372
+ * calendar tool.
373
+ */
374
+ capabilities: Data.Capabilities;
375
+ /**
376
+ * Creation timestamp in ISO 8601 format.
377
+ */
378
+ createdAt: string;
379
+ /**
380
+ * When the credential expires, ISO 8601. Null when it does not expire.
381
+ */
382
+ credentialExpiresAt: string | null;
383
+ /**
384
+ * Customer-supplied name for this account. Unique within the project.
385
+ */
386
+ label: string;
387
+ /**
388
+ * When the credential was last verified against the provider, ISO 8601.
389
+ */
390
+ lastCheckedAt: string | null;
391
+ /**
392
+ * Who holds the calendar. CAL_COM is the only provider that can be connected
393
+ * today; GOOGLE and CALENDLY are described by `capabilities` but not yet
394
+ * connectable.
395
+ */
396
+ provider: 'CAL_COM' | 'GOOGLE' | 'CALENDLY';
397
+ /**
398
+ * Scopes the credential carries, when the provider issues scoped credentials. Null
399
+ * for an API key.
400
+ */
401
+ scopes: Array<string> | null;
402
+ /**
403
+ * Whether the stored credential still works, as of `lastCheckedAt`.
404
+ * INVALID_CREDENTIALS means the provider rejected it and the connection needs a
405
+ * new one. A provider outage never changes this.
406
+ */
407
+ status: 'ACTIVE' | 'INVALID_CREDENTIALS' | 'ERROR';
408
+ /**
409
+ * Why the status is not ACTIVE, in the provider’s words. Null when ACTIVE.
410
+ */
411
+ statusMessage: string | null;
412
+ /**
413
+ * The IANA timezone slots are offered in: the business’s, not the caller’s. A
414
+ * clinic’s 3pm is 3pm whoever dials it.
415
+ */
416
+ timezone: string;
417
+ /**
418
+ * Last update timestamp in ISO 8601 format.
419
+ */
420
+ updatedAt: string;
421
+ }
422
+ namespace Data {
423
+ /**
424
+ * What a calendar provider can actually do. Read this before configuring a
425
+ * calendar tool.
426
+ */
427
+ interface Capabilities {
428
+ /**
429
+ * How this provider is authenticated.
430
+ */
431
+ auth: 'API_KEY' | 'OAUTH';
432
+ /**
433
+ * Hard cap on the width of one availability query, in days, when the provider has
434
+ * one.
435
+ */
436
+ availabilityWindowDays: number | null;
437
+ /**
438
+ * The operations this provider supports. An operation that is absent is never
439
+ * registered as a tool, so the agent cannot promise it: Calendly, for example, has
440
+ * no reschedule API, and callers wanting to move an appointment must cancel and
441
+ * rebook.
442
+ */
443
+ operations: Array<'CHECK_AVAILABILITY' | 'BOOK' | 'LOOKUP_BOOKING' | 'RESCHEDULE' | 'CANCEL' | 'LIST_BOOKINGS'>;
444
+ /**
445
+ * Whether a booking cannot be created without an attendee email address. True for
446
+ * every scheduling system, which decides how an agent has to identify the caller.
447
+ */
448
+ requiresAttendeeEmail: boolean;
449
+ /**
450
+ * True for a raw calendar, which exposes only events and free/busy. Roark then
451
+ * owns bookable hours, duration, buffers, lead time and horizon, because the
452
+ * provider has no notion of them.
453
+ */
454
+ roarkOwnsBookingPolicy: boolean;
455
+ /**
456
+ * Whether a slot can be held before committing. RESERVATION blocks other bookers
457
+ * in the provider’s own UI but is not consumed by the booking that follows, so it
458
+ * is a courtesy and not a guarantee.
459
+ */
460
+ slotHold: 'RESERVATION' | 'NONE';
461
+ }
462
+ }
463
+ interface Pagination {
464
+ /**
465
+ * Whether there are more items to fetch
466
+ */
467
+ hasMore: boolean;
468
+ /**
469
+ * Cursor for the next page of items
470
+ */
471
+ nextCursor: string | null;
472
+ /**
473
+ * Total number of items
474
+ */
475
+ total: number;
476
+ }
477
+ }
478
+ export interface CalendarConnectionDeleteResponse {
479
+ data: CalendarConnectionDeleteResponse.Data;
480
+ }
481
+ export declare namespace CalendarConnectionDeleteResponse {
482
+ interface Data {
483
+ /**
484
+ * Identifier of the deleted connection.
485
+ */
486
+ id: string;
487
+ /**
488
+ * Always true. The credential is hard-deleted, not archived.
489
+ */
490
+ deleted: true;
491
+ }
492
+ }
493
+ export interface CalendarConnectionCheckResponse {
494
+ /**
495
+ * A project’s credential for one calendar account, the thing a calendar tool books
496
+ * against. The credential itself is never returned.
497
+ */
498
+ data: CalendarConnectionCheckResponse.Data;
499
+ }
500
+ export declare namespace CalendarConnectionCheckResponse {
501
+ /**
502
+ * A project’s credential for one calendar account, the thing a calendar tool books
503
+ * against. The credential itself is never returned.
504
+ */
505
+ interface Data {
506
+ /**
507
+ * Unique identifier of the calendar connection.
508
+ */
509
+ id: string;
510
+ /**
511
+ * How the provider names the connected account (a Cal.com email). Read-only.
512
+ */
513
+ accountLabel: string | null;
514
+ /**
515
+ * What a calendar provider can actually do. Read this before configuring a
516
+ * calendar tool.
517
+ */
518
+ capabilities: Data.Capabilities;
519
+ /**
520
+ * Creation timestamp in ISO 8601 format.
521
+ */
522
+ createdAt: string;
523
+ /**
524
+ * When the credential expires, ISO 8601. Null when it does not expire.
525
+ */
526
+ credentialExpiresAt: string | null;
527
+ /**
528
+ * Customer-supplied name for this account. Unique within the project.
529
+ */
530
+ label: string;
531
+ /**
532
+ * When the credential was last verified against the provider, ISO 8601.
533
+ */
534
+ lastCheckedAt: string | null;
535
+ /**
536
+ * Who holds the calendar. CAL_COM is the only provider that can be connected
537
+ * today; GOOGLE and CALENDLY are described by `capabilities` but not yet
538
+ * connectable.
539
+ */
540
+ provider: 'CAL_COM' | 'GOOGLE' | 'CALENDLY';
541
+ /**
542
+ * Scopes the credential carries, when the provider issues scoped credentials. Null
543
+ * for an API key.
544
+ */
545
+ scopes: Array<string> | null;
546
+ /**
547
+ * Whether the stored credential still works, as of `lastCheckedAt`.
548
+ * INVALID_CREDENTIALS means the provider rejected it and the connection needs a
549
+ * new one. A provider outage never changes this.
550
+ */
551
+ status: 'ACTIVE' | 'INVALID_CREDENTIALS' | 'ERROR';
552
+ /**
553
+ * Why the status is not ACTIVE, in the provider’s words. Null when ACTIVE.
554
+ */
555
+ statusMessage: string | null;
556
+ /**
557
+ * The IANA timezone slots are offered in: the business’s, not the caller’s. A
558
+ * clinic’s 3pm is 3pm whoever dials it.
559
+ */
560
+ timezone: string;
561
+ /**
562
+ * Last update timestamp in ISO 8601 format.
563
+ */
564
+ updatedAt: string;
565
+ }
566
+ namespace Data {
567
+ /**
568
+ * What a calendar provider can actually do. Read this before configuring a
569
+ * calendar tool.
570
+ */
571
+ interface Capabilities {
572
+ /**
573
+ * How this provider is authenticated.
574
+ */
575
+ auth: 'API_KEY' | 'OAUTH';
576
+ /**
577
+ * Hard cap on the width of one availability query, in days, when the provider has
578
+ * one.
579
+ */
580
+ availabilityWindowDays: number | null;
581
+ /**
582
+ * The operations this provider supports. An operation that is absent is never
583
+ * registered as a tool, so the agent cannot promise it: Calendly, for example, has
584
+ * no reschedule API, and callers wanting to move an appointment must cancel and
585
+ * rebook.
586
+ */
587
+ operations: Array<'CHECK_AVAILABILITY' | 'BOOK' | 'LOOKUP_BOOKING' | 'RESCHEDULE' | 'CANCEL' | 'LIST_BOOKINGS'>;
588
+ /**
589
+ * Whether a booking cannot be created without an attendee email address. True for
590
+ * every scheduling system, which decides how an agent has to identify the caller.
591
+ */
592
+ requiresAttendeeEmail: boolean;
593
+ /**
594
+ * True for a raw calendar, which exposes only events and free/busy. Roark then
595
+ * owns bookable hours, duration, buffers, lead time and horizon, because the
596
+ * provider has no notion of them.
597
+ */
598
+ roarkOwnsBookingPolicy: boolean;
599
+ /**
600
+ * Whether a slot can be held before committing. RESERVATION blocks other bookers
601
+ * in the provider’s own UI but is not consumed by the booking that follows, so it
602
+ * is a courtesy and not a guarantee.
603
+ */
604
+ slotHold: 'RESERVATION' | 'NONE';
605
+ }
606
+ }
607
+ }
608
+ export interface CalendarConnectionGetByIDResponse {
609
+ /**
610
+ * A project’s credential for one calendar account, the thing a calendar tool books
611
+ * against. The credential itself is never returned.
612
+ */
613
+ data: CalendarConnectionGetByIDResponse.Data;
614
+ }
615
+ export declare namespace CalendarConnectionGetByIDResponse {
616
+ /**
617
+ * A project’s credential for one calendar account, the thing a calendar tool books
618
+ * against. The credential itself is never returned.
619
+ */
620
+ interface Data {
621
+ /**
622
+ * Unique identifier of the calendar connection.
623
+ */
624
+ id: string;
625
+ /**
626
+ * How the provider names the connected account (a Cal.com email). Read-only.
627
+ */
628
+ accountLabel: string | null;
629
+ /**
630
+ * What a calendar provider can actually do. Read this before configuring a
631
+ * calendar tool.
632
+ */
633
+ capabilities: Data.Capabilities;
634
+ /**
635
+ * Creation timestamp in ISO 8601 format.
636
+ */
637
+ createdAt: string;
638
+ /**
639
+ * When the credential expires, ISO 8601. Null when it does not expire.
640
+ */
641
+ credentialExpiresAt: string | null;
642
+ /**
643
+ * Customer-supplied name for this account. Unique within the project.
644
+ */
645
+ label: string;
646
+ /**
647
+ * When the credential was last verified against the provider, ISO 8601.
648
+ */
649
+ lastCheckedAt: string | null;
650
+ /**
651
+ * Who holds the calendar. CAL_COM is the only provider that can be connected
652
+ * today; GOOGLE and CALENDLY are described by `capabilities` but not yet
653
+ * connectable.
654
+ */
655
+ provider: 'CAL_COM' | 'GOOGLE' | 'CALENDLY';
656
+ /**
657
+ * Scopes the credential carries, when the provider issues scoped credentials. Null
658
+ * for an API key.
659
+ */
660
+ scopes: Array<string> | null;
661
+ /**
662
+ * Whether the stored credential still works, as of `lastCheckedAt`.
663
+ * INVALID_CREDENTIALS means the provider rejected it and the connection needs a
664
+ * new one. A provider outage never changes this.
665
+ */
666
+ status: 'ACTIVE' | 'INVALID_CREDENTIALS' | 'ERROR';
667
+ /**
668
+ * Why the status is not ACTIVE, in the provider’s words. Null when ACTIVE.
669
+ */
670
+ statusMessage: string | null;
671
+ /**
672
+ * The IANA timezone slots are offered in: the business’s, not the caller’s. A
673
+ * clinic’s 3pm is 3pm whoever dials it.
674
+ */
675
+ timezone: string;
676
+ /**
677
+ * Last update timestamp in ISO 8601 format.
678
+ */
679
+ updatedAt: string;
680
+ }
681
+ namespace Data {
682
+ /**
683
+ * What a calendar provider can actually do. Read this before configuring a
684
+ * calendar tool.
685
+ */
686
+ interface Capabilities {
687
+ /**
688
+ * How this provider is authenticated.
689
+ */
690
+ auth: 'API_KEY' | 'OAUTH';
691
+ /**
692
+ * Hard cap on the width of one availability query, in days, when the provider has
693
+ * one.
694
+ */
695
+ availabilityWindowDays: number | null;
696
+ /**
697
+ * The operations this provider supports. An operation that is absent is never
698
+ * registered as a tool, so the agent cannot promise it: Calendly, for example, has
699
+ * no reschedule API, and callers wanting to move an appointment must cancel and
700
+ * rebook.
701
+ */
702
+ operations: Array<'CHECK_AVAILABILITY' | 'BOOK' | 'LOOKUP_BOOKING' | 'RESCHEDULE' | 'CANCEL' | 'LIST_BOOKINGS'>;
703
+ /**
704
+ * Whether a booking cannot be created without an attendee email address. True for
705
+ * every scheduling system, which decides how an agent has to identify the caller.
706
+ */
707
+ requiresAttendeeEmail: boolean;
708
+ /**
709
+ * True for a raw calendar, which exposes only events and free/busy. Roark then
710
+ * owns bookable hours, duration, buffers, lead time and horizon, because the
711
+ * provider has no notion of them.
712
+ */
713
+ roarkOwnsBookingPolicy: boolean;
714
+ /**
715
+ * Whether a slot can be held before committing. RESERVATION blocks other bookers
716
+ * in the provider’s own UI but is not consumed by the booking that follows, so it
717
+ * is a courtesy and not a guarantee.
718
+ */
719
+ slotHold: 'RESERVATION' | 'NONE';
720
+ }
721
+ }
722
+ }
723
+ export interface CalendarConnectionGetTargetResponse {
724
+ /**
725
+ * Something on a connected account an agent can be pointed at: a Cal.com event
726
+ * type today, a Google calendar when that lands.
727
+ */
728
+ data: CalendarConnectionGetTargetResponse.Data;
729
+ }
730
+ export declare namespace CalendarConnectionGetTargetResponse {
731
+ /**
732
+ * Something on a connected account an agent can be pointed at: a Cal.com event
733
+ * type today, a Google calendar when that lands.
734
+ */
735
+ interface Data {
736
+ /**
737
+ * Identifier within this connection. Pass it back to read one target in detail.
738
+ */
739
+ id: string;
740
+ /**
741
+ * How long an appointment runs, when the provider fixes one length.
742
+ */
743
+ durationMinutes: number | null;
744
+ /**
745
+ * Other lengths this target offers, when it offers a choice. A calendar tool pins
746
+ * one of these with `durationMinutes`; an empty list means the length is not the
747
+ * customer’s to choose.
748
+ */
749
+ durationOptions: Array<number>;
750
+ /**
751
+ * Hidden on the provider’s own booking page. Still bookable through this API.
752
+ */
753
+ isHidden: boolean;
754
+ /**
755
+ * What the customer called it on the provider.
756
+ */
757
+ label: string;
758
+ /**
759
+ * Slugs a booking is refused without, as the provider names them (`email`,
760
+ * `name`). The attendee object itself needs only a name and a timezone, so this is
761
+ * the only place that says whether an agent has to collect an email.
762
+ */
763
+ requiredBookingFields: Array<string>;
764
+ /**
765
+ * The common case of the above, lifted out because it decides the agent’s design:
766
+ * an agent that cannot collect an email cannot book on a target that demands one.
767
+ */
768
+ requiresAttendeeEmail: boolean;
769
+ /**
770
+ * A human has to accept before it is an appointment. An agent booking one of these
771
+ * must say "requested", never "confirmed".
772
+ */
773
+ requiresConfirmation: boolean;
774
+ /**
775
+ * Ready to put on a calendar tool, so nothing has to assemble one by hand.
776
+ */
777
+ target: Data.Target;
778
+ }
779
+ namespace Data {
780
+ /**
781
+ * Ready to put on a calendar tool, so nothing has to assemble one by hand.
782
+ */
783
+ interface Target {
784
+ eventTypeId: number;
785
+ provider: 'CAL_COM';
786
+ }
787
+ }
788
+ }
789
+ export interface CalendarConnectionListTargetsResponse {
790
+ data: Array<CalendarConnectionListTargetsResponse.Data>;
791
+ }
792
+ export declare namespace CalendarConnectionListTargetsResponse {
793
+ /**
794
+ * Something on a connected account an agent can be pointed at: a Cal.com event
795
+ * type today, a Google calendar when that lands.
796
+ */
797
+ interface Data {
798
+ /**
799
+ * Identifier within this connection. Pass it back to read one target in detail.
800
+ */
801
+ id: string;
802
+ /**
803
+ * How long an appointment runs, when the provider fixes one length.
804
+ */
805
+ durationMinutes: number | null;
806
+ /**
807
+ * Other lengths this target offers, when it offers a choice. A calendar tool pins
808
+ * one of these with `durationMinutes`; an empty list means the length is not the
809
+ * customer’s to choose.
810
+ */
811
+ durationOptions: Array<number>;
812
+ /**
813
+ * Hidden on the provider’s own booking page. Still bookable through this API.
814
+ */
815
+ isHidden: boolean;
816
+ /**
817
+ * What the customer called it on the provider.
818
+ */
819
+ label: string;
820
+ /**
821
+ * A human has to accept before it is an appointment. An agent booking one of these
822
+ * must say "requested", never "confirmed".
823
+ */
824
+ requiresConfirmation: boolean;
825
+ /**
826
+ * Ready to put on a calendar tool, so nothing has to assemble one by hand.
827
+ */
828
+ target: Data.Target;
829
+ }
830
+ namespace Data {
831
+ /**
832
+ * Ready to put on a calendar tool, so nothing has to assemble one by hand.
833
+ */
834
+ interface Target {
835
+ eventTypeId: number;
836
+ provider: 'CAL_COM';
837
+ }
838
+ }
839
+ }
840
+ export interface CalendarConnectionCreateParams {
841
+ /**
842
+ * For CAL*COM: a Cal.com API key (starts with `cal*`). It is verified against
843
+ * Cal.com before anything is stored, so an invalid key is a 400 and no connection
844
+ * is created. Stored encrypted and never returned.
845
+ */
846
+ apiKey: string;
847
+ /**
848
+ * Customer-facing name for this account, unique within the project. Required.
849
+ */
850
+ label: string;
851
+ /**
852
+ * Who holds the calendar. CAL_COM is the only provider that can be connected
853
+ * today; GOOGLE and CALENDLY are described by `capabilities` but not yet
854
+ * connectable.
855
+ */
856
+ provider: 'CAL_COM' | 'GOOGLE' | 'CALENDLY';
857
+ /**
858
+ * The named IANA timezone to offer slots in, for example `America/Los_Angeles`.
859
+ * Omit to adopt the provider account’s own timezone. A fixed offset such as
860
+ * `-08:00` is rejected: it does not observe DST.
861
+ */
862
+ timezone?: string | null;
863
+ }
864
+ export interface CalendarConnectionUpdateParams {
865
+ /**
866
+ * Rotate the credential. The new key is verified before it is stored, and a
867
+ * verified key returns the connection to ACTIVE, which is how a connection
868
+ * recovers from INVALID_CREDENTIALS.
869
+ */
870
+ apiKey?: string | null;
871
+ /**
872
+ * Rename the connection.
873
+ */
874
+ label?: string | null;
875
+ /**
876
+ * Change the named IANA timezone slots are offered in.
877
+ */
878
+ timezone?: string | null;
879
+ }
880
+ export interface CalendarConnectionListParams {
881
+ /**
882
+ * Who holds the calendar. CAL_COM is the only provider that can be connected
883
+ * today; GOOGLE and CALENDLY are described by `capabilities` but not yet
884
+ * connectable.
885
+ */
886
+ provider?: 'CAL_COM' | 'GOOGLE' | 'CALENDLY';
887
+ }
888
+ export interface CalendarConnectionGetTargetParams {
889
+ /**
890
+ * Calendar connection ID
891
+ */
892
+ connectionId: string;
893
+ }
894
+ export declare namespace CalendarConnection {
895
+ export { type CalendarConnectionCreateResponse as CalendarConnectionCreateResponse, type CalendarConnectionUpdateResponse as CalendarConnectionUpdateResponse, type CalendarConnectionListResponse as CalendarConnectionListResponse, type CalendarConnectionDeleteResponse as CalendarConnectionDeleteResponse, type CalendarConnectionCheckResponse as CalendarConnectionCheckResponse, type CalendarConnectionGetByIDResponse as CalendarConnectionGetByIDResponse, type CalendarConnectionGetTargetResponse as CalendarConnectionGetTargetResponse, type CalendarConnectionListTargetsResponse as CalendarConnectionListTargetsResponse, type CalendarConnectionCreateParams as CalendarConnectionCreateParams, type CalendarConnectionUpdateParams as CalendarConnectionUpdateParams, type CalendarConnectionListParams as CalendarConnectionListParams, type CalendarConnectionGetTargetParams as CalendarConnectionGetTargetParams, };
896
+ }
897
+ //# sourceMappingURL=calendar-connection.d.ts.map