@prismatic-io/components-calendly 0.0.0-stage → 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,4104 @@
1
+ let _prismatic_io_spectral = require("@prismatic-io/spectral");
2
+ let _prismatic_io_spectral_http = require("@prismatic-io/spectral/http");
3
+ //#region src/outputSchemas/events.ts
4
+ const eventResource = {
5
+ type: "object",
6
+ properties: {
7
+ uri: { type: "string" },
8
+ name: { type: ["string", "null"] },
9
+ meeting_notes_plain: { type: ["string", "null"] },
10
+ meeting_notes_html: { type: ["string", "null"] },
11
+ status: {
12
+ type: "string",
13
+ enum: ["active", "canceled"]
14
+ },
15
+ booking_method: { type: ["string", "null"] },
16
+ start_time: {
17
+ type: "string",
18
+ format: "date-time"
19
+ },
20
+ end_time: {
21
+ type: "string",
22
+ format: "date-time"
23
+ },
24
+ event_type: { type: "string" },
25
+ location: {
26
+ type: ["object", "null"],
27
+ properties: {
28
+ type: { type: "string" },
29
+ location: { type: ["string", "null"] },
30
+ additional_info: { type: ["string", "null"] },
31
+ join_url: { type: ["string", "null"] },
32
+ status: { type: ["string", "null"] },
33
+ data: { type: "object" }
34
+ }
35
+ },
36
+ invitees_counter: {
37
+ type: "object",
38
+ properties: {
39
+ total: { type: "number" },
40
+ active: { type: "number" },
41
+ limit: { type: "number" }
42
+ }
43
+ },
44
+ created_at: {
45
+ type: "string",
46
+ format: "date-time"
47
+ },
48
+ updated_at: {
49
+ type: "string",
50
+ format: "date-time"
51
+ },
52
+ event_memberships: {
53
+ type: "array",
54
+ items: {
55
+ type: "object",
56
+ properties: {
57
+ user: { type: "string" },
58
+ user_email: { type: "string" },
59
+ user_name: { type: ["string", "null"] }
60
+ }
61
+ }
62
+ },
63
+ event_guests: {
64
+ type: "array",
65
+ items: {
66
+ type: "object",
67
+ properties: {
68
+ email: { type: "string" },
69
+ created_at: {
70
+ type: "string",
71
+ format: "date-time"
72
+ },
73
+ updated_at: {
74
+ type: "string",
75
+ format: "date-time"
76
+ }
77
+ }
78
+ }
79
+ },
80
+ calendar_event: {
81
+ type: ["object", "null"],
82
+ properties: {
83
+ kind: { type: "string" },
84
+ external_id: { type: "string" }
85
+ }
86
+ },
87
+ cancellation: {
88
+ type: ["object", "null"],
89
+ properties: {
90
+ canceled_by: { type: "string" },
91
+ reason: { type: ["string", "null"] },
92
+ canceler_type: { type: "string" },
93
+ created_at: {
94
+ type: "string",
95
+ format: "date-time"
96
+ }
97
+ }
98
+ }
99
+ },
100
+ required: [
101
+ "uri",
102
+ "status",
103
+ "start_time",
104
+ "end_time",
105
+ "event_type",
106
+ "created_at",
107
+ "updated_at"
108
+ ]
109
+ };
110
+ const getEventOutputSchema = {
111
+ type: "object",
112
+ properties: { resource: eventResource },
113
+ required: ["resource"]
114
+ };
115
+ const listEventsOutputSchema = {
116
+ type: "array",
117
+ items: eventResource
118
+ };
119
+ const cancelEventOutputSchema = {
120
+ type: "object",
121
+ properties: { resource: {
122
+ type: "object",
123
+ properties: {
124
+ canceled_by: { type: "string" },
125
+ reason: { type: ["string", "null"] },
126
+ canceler_type: { type: "string" },
127
+ created_at: {
128
+ type: "string",
129
+ format: "date-time"
130
+ }
131
+ },
132
+ required: [
133
+ "canceled_by",
134
+ "canceler_type",
135
+ "created_at"
136
+ ]
137
+ } },
138
+ required: ["resource"]
139
+ };
140
+ const deleteScheduledEventDataOutputSchema = {
141
+ type: "object",
142
+ properties: {}
143
+ };
144
+ //#endregion
145
+ //#region src/outputSchemas/invitees.ts
146
+ const inviteeResource = {
147
+ type: "object",
148
+ properties: {
149
+ cancel_url: { type: "string" },
150
+ created_at: {
151
+ type: "string",
152
+ format: "date-time"
153
+ },
154
+ email: { type: "string" },
155
+ event: { type: "string" },
156
+ name: { type: "string" },
157
+ first_name: { type: ["string", "null"] },
158
+ last_name: { type: ["string", "null"] },
159
+ new_invitee: { type: ["string", "null"] },
160
+ old_invitee: { type: ["string", "null"] },
161
+ questions_and_answers: {
162
+ type: "array",
163
+ items: {
164
+ type: "object",
165
+ properties: {
166
+ answer: { type: "string" },
167
+ position: { type: "number" },
168
+ question: { type: "string" }
169
+ }
170
+ }
171
+ },
172
+ reschedule_url: { type: "string" },
173
+ rescheduled: { type: "boolean" },
174
+ status: { type: "string" },
175
+ text_reminder_number: { type: ["string", "null"] },
176
+ timezone: { type: ["string", "null"] },
177
+ tracking: {
178
+ type: ["object", "null"],
179
+ properties: {
180
+ utm_campaign: { type: ["string", "null"] },
181
+ utm_source: { type: ["string", "null"] },
182
+ utm_medium: { type: ["string", "null"] },
183
+ utm_content: { type: ["string", "null"] },
184
+ utm_term: { type: ["string", "null"] },
185
+ salesforce_uuid: { type: ["string", "null"] }
186
+ }
187
+ },
188
+ updated_at: {
189
+ type: "string",
190
+ format: "date-time"
191
+ },
192
+ uri: { type: "string" },
193
+ routing_form_submission: { type: ["string", "null"] },
194
+ payment: {
195
+ type: ["object", "null"],
196
+ properties: {
197
+ external_id: { type: "string" },
198
+ provider: { type: "string" },
199
+ amount: { type: "number" },
200
+ currency: { type: "string" },
201
+ terms: { type: ["string", "null"] },
202
+ successful: { type: "boolean" }
203
+ }
204
+ },
205
+ no_show: {
206
+ type: ["object", "null"],
207
+ properties: {
208
+ uri: { type: "string" },
209
+ created_at: {
210
+ type: "string",
211
+ format: "date-time"
212
+ }
213
+ }
214
+ },
215
+ reconfirmation: {
216
+ type: ["object", "null"],
217
+ properties: {
218
+ created_at: {
219
+ type: "string",
220
+ format: "date-time"
221
+ },
222
+ confirmed_at: {
223
+ type: ["string", "null"],
224
+ format: "date-time"
225
+ }
226
+ }
227
+ },
228
+ scheduling_method: { type: ["string", "null"] },
229
+ invitee_scheduled_by: { type: ["string", "null"] }
230
+ },
231
+ required: [
232
+ "uri",
233
+ "email",
234
+ "event",
235
+ "status",
236
+ "created_at",
237
+ "updated_at"
238
+ ]
239
+ };
240
+ const getEventInviteeOutputSchema = {
241
+ type: "object",
242
+ properties: { resource: inviteeResource },
243
+ required: ["resource"]
244
+ };
245
+ const listEventInviteesOutputSchema = {
246
+ type: "array",
247
+ items: inviteeResource
248
+ };
249
+ const deleteInviteeDataOutputSchema = {
250
+ type: "object",
251
+ properties: {}
252
+ };
253
+ //#endregion
254
+ //#region src/outputSchemas/users.ts
255
+ const userResource = {
256
+ type: "object",
257
+ properties: {
258
+ uri: { type: "string" },
259
+ name: { type: "string" },
260
+ slug: { type: "string" },
261
+ email: { type: "string" },
262
+ scheduling_url: { type: "string" },
263
+ timezone: { type: "string" },
264
+ avatar_url: { type: ["string", "null"] },
265
+ created_at: {
266
+ type: "string",
267
+ format: "date-time"
268
+ },
269
+ updated_at: {
270
+ type: "string",
271
+ format: "date-time"
272
+ },
273
+ current_organization: { type: "string" },
274
+ resource_type: { type: "string" }
275
+ },
276
+ required: [
277
+ "uri",
278
+ "name",
279
+ "email",
280
+ "scheduling_url",
281
+ "timezone",
282
+ "created_at",
283
+ "updated_at"
284
+ ]
285
+ };
286
+ const getUserOutputSchema = {
287
+ type: "object",
288
+ properties: { resource: userResource },
289
+ required: ["resource"]
290
+ };
291
+ const getCurrentUserOutputSchema = {
292
+ type: "object",
293
+ properties: { resource: userResource },
294
+ required: ["resource"]
295
+ };
296
+ //#endregion
297
+ //#region src/outputSchemas/eventTypes.ts
298
+ const eventTypeResource = {
299
+ type: "object",
300
+ properties: {
301
+ uri: { type: "string" },
302
+ name: { type: ["string", "null"] },
303
+ active: { type: "boolean" },
304
+ booking_method: { type: ["string", "null"] },
305
+ slug: { type: ["string", "null"] },
306
+ scheduling_url: { type: "string" },
307
+ duration: { type: "number" },
308
+ kind: { type: "string" },
309
+ pooling_type: { type: ["string", "null"] },
310
+ type: { type: "string" },
311
+ color: { type: "string" },
312
+ created_at: {
313
+ type: "string",
314
+ format: "date-time"
315
+ },
316
+ updated_at: {
317
+ type: "string",
318
+ format: "date-time"
319
+ },
320
+ internal_note: { type: ["string", "null"] },
321
+ description_plain: { type: ["string", "null"] },
322
+ description_html: { type: ["string", "null"] },
323
+ profile: {
324
+ type: ["object", "null"],
325
+ properties: {
326
+ type: { type: "string" },
327
+ name: { type: "string" },
328
+ owner: { type: "string" }
329
+ }
330
+ },
331
+ secret: { type: "boolean" },
332
+ deleted_at: { type: ["string", "null"] },
333
+ admin_managed: { type: "boolean" },
334
+ custom_questions: {
335
+ type: "array",
336
+ items: {
337
+ type: "object",
338
+ properties: {
339
+ name: { type: "string" },
340
+ type: { type: "string" },
341
+ position: { type: "number" },
342
+ enabled: { type: "boolean" },
343
+ required: { type: "boolean" },
344
+ answer_choices: {
345
+ type: "array",
346
+ items: { type: "string" }
347
+ },
348
+ include_other: { type: "boolean" }
349
+ }
350
+ }
351
+ }
352
+ },
353
+ required: [
354
+ "uri",
355
+ "active",
356
+ "scheduling_url",
357
+ "duration",
358
+ "kind",
359
+ "type",
360
+ "created_at",
361
+ "updated_at"
362
+ ]
363
+ };
364
+ const getEventTypeOutputSchema = {
365
+ type: "object",
366
+ properties: { resource: eventTypeResource },
367
+ required: ["resource"]
368
+ };
369
+ const listUserEventTypesOutputSchema = {
370
+ type: "array",
371
+ items: eventTypeResource
372
+ };
373
+ const listEventTypeAvailableTimesOutputSchema = {
374
+ type: "object",
375
+ properties: { collection: {
376
+ type: "array",
377
+ items: {
378
+ type: "object",
379
+ properties: {
380
+ status: { type: "string" },
381
+ invitees_remaining: { type: "number" },
382
+ start_time: {
383
+ type: "string",
384
+ format: "date-time"
385
+ },
386
+ scheduling_url: { type: "string" }
387
+ },
388
+ required: [
389
+ "status",
390
+ "start_time",
391
+ "scheduling_url"
392
+ ]
393
+ }
394
+ } },
395
+ required: ["collection"]
396
+ };
397
+ //#endregion
398
+ //#region src/outputSchemas/webhooks.ts
399
+ const webhookSubscriptionResource = {
400
+ type: "object",
401
+ properties: {
402
+ uri: { type: "string" },
403
+ callback_url: { type: "string" },
404
+ created_at: {
405
+ type: "string",
406
+ format: "date-time"
407
+ },
408
+ updated_at: {
409
+ type: "string",
410
+ format: "date-time"
411
+ },
412
+ retry_started_at: {
413
+ type: ["string", "null"],
414
+ format: "date-time"
415
+ },
416
+ state: { type: "string" },
417
+ events: {
418
+ type: "array",
419
+ items: { type: "string" }
420
+ },
421
+ scope: { type: "string" },
422
+ organization: { type: "string" },
423
+ user: { type: ["string", "null"] },
424
+ creator: { type: ["string", "null"] }
425
+ },
426
+ required: [
427
+ "uri",
428
+ "callback_url",
429
+ "created_at",
430
+ "updated_at",
431
+ "state",
432
+ "events",
433
+ "scope",
434
+ "organization"
435
+ ]
436
+ };
437
+ const createWebhookSubscriptionOutputSchema = {
438
+ type: "object",
439
+ properties: { resource: webhookSubscriptionResource },
440
+ required: ["resource"]
441
+ };
442
+ const getWebhookSubscriptionOutputSchema = {
443
+ type: "object",
444
+ properties: { resource: webhookSubscriptionResource },
445
+ required: ["resource"]
446
+ };
447
+ const listWebhookSubscriptionOutputSchema = {
448
+ type: "array",
449
+ items: webhookSubscriptionResource
450
+ };
451
+ const deleteWebhookSubscriptionOutputSchema = {
452
+ type: "object",
453
+ properties: {}
454
+ };
455
+ const deleteInstancedWebhooksOutputSchema = {
456
+ type: "object",
457
+ properties: {}
458
+ };
459
+ //#endregion
460
+ //#region src/outputSchemas/organizations.ts
461
+ const organizationInvitationResource = {
462
+ type: "object",
463
+ properties: {
464
+ uri: { type: "string" },
465
+ organization: { type: "string" },
466
+ email: { type: "string" },
467
+ status: { type: "string" },
468
+ created_at: {
469
+ type: "string",
470
+ format: "date-time"
471
+ },
472
+ updated_at: {
473
+ type: "string",
474
+ format: "date-time"
475
+ },
476
+ last_sent_at: {
477
+ type: ["string", "null"],
478
+ format: "date-time"
479
+ },
480
+ user: { type: ["string", "null"] }
481
+ },
482
+ required: [
483
+ "uri",
484
+ "organization",
485
+ "email",
486
+ "status",
487
+ "created_at",
488
+ "updated_at"
489
+ ]
490
+ };
491
+ const getOrganizationInvitationOutputSchema = {
492
+ type: "object",
493
+ properties: { resource: organizationInvitationResource },
494
+ required: ["resource"]
495
+ };
496
+ const inviteUserToOrganizationOutputSchema = {
497
+ type: "object",
498
+ properties: { resource: organizationInvitationResource },
499
+ required: ["resource"]
500
+ };
501
+ const listOrganizationInvitationsOutputSchema = {
502
+ type: "array",
503
+ items: organizationInvitationResource
504
+ };
505
+ const organizationMembershipResource = {
506
+ type: "object",
507
+ properties: {
508
+ uri: { type: "string" },
509
+ role: { type: "string" },
510
+ user: {
511
+ type: "object",
512
+ properties: {
513
+ uri: { type: "string" },
514
+ name: { type: "string" },
515
+ slug: { type: "string" },
516
+ email: { type: "string" },
517
+ scheduling_url: { type: "string" },
518
+ timezone: { type: "string" },
519
+ avatar_url: { type: ["string", "null"] },
520
+ created_at: {
521
+ type: "string",
522
+ format: "date-time"
523
+ },
524
+ updated_at: {
525
+ type: "string",
526
+ format: "date-time"
527
+ }
528
+ }
529
+ },
530
+ organization: { type: "string" },
531
+ updated_at: {
532
+ type: "string",
533
+ format: "date-time"
534
+ },
535
+ created_at: {
536
+ type: "string",
537
+ format: "date-time"
538
+ }
539
+ },
540
+ required: [
541
+ "uri",
542
+ "role",
543
+ "user",
544
+ "organization",
545
+ "created_at",
546
+ "updated_at"
547
+ ]
548
+ };
549
+ const getOrganizationMembershipOutputSchema = {
550
+ type: "object",
551
+ properties: { resource: organizationMembershipResource },
552
+ required: ["resource"]
553
+ };
554
+ const listOrganizationMembershipsOutputSchema = {
555
+ type: "array",
556
+ items: organizationMembershipResource
557
+ };
558
+ const listActivityLogEntriesOutputSchema = {
559
+ type: "array",
560
+ items: {
561
+ type: "object",
562
+ properties: {
563
+ occurred_at: {
564
+ type: "string",
565
+ format: "date-time"
566
+ },
567
+ uri: { type: "string" },
568
+ namespace: { type: "string" },
569
+ action: { type: "string" },
570
+ actor: {
571
+ type: ["object", "null"],
572
+ properties: {
573
+ uri: { type: ["string", "null"] },
574
+ type: { type: "string" },
575
+ organization: {
576
+ type: ["object", "null"],
577
+ properties: {
578
+ uri: { type: "string" },
579
+ role: { type: "string" }
580
+ }
581
+ },
582
+ group: {
583
+ type: ["object", "null"],
584
+ properties: {
585
+ uri: { type: "string" },
586
+ name: { type: "string" },
587
+ role: { type: "string" }
588
+ }
589
+ },
590
+ display_name: { type: "string" },
591
+ alternative_identifier: { type: ["string", "null"] }
592
+ }
593
+ },
594
+ fully_qualified_name: { type: "string" },
595
+ details: { type: "object" },
596
+ organization: { type: "string" }
597
+ },
598
+ required: [
599
+ "uri",
600
+ "occurred_at",
601
+ "namespace",
602
+ "action",
603
+ "fully_qualified_name",
604
+ "organization"
605
+ ]
606
+ }
607
+ };
608
+ const removeUserFromOrganizationOutputSchema = {
609
+ type: "object",
610
+ properties: {}
611
+ };
612
+ const revokeUserOrganizationInvitationOutputSchema = {
613
+ type: "object",
614
+ properties: {}
615
+ };
616
+ //#endregion
617
+ //#region src/outputSchemas/routingForms.ts
618
+ const routingFormResource = {
619
+ type: "object",
620
+ properties: {
621
+ uri: { type: "string" },
622
+ organization: { type: "string" },
623
+ name: { type: ["string", "null"] },
624
+ status: { type: "string" },
625
+ questions: {
626
+ type: "array",
627
+ items: {
628
+ type: "object",
629
+ properties: {
630
+ uuid: { type: "string" },
631
+ name: { type: "string" },
632
+ type: { type: "string" },
633
+ required: { type: "boolean" },
634
+ answer_choices: {
635
+ type: ["array", "null"],
636
+ items: { type: "string" }
637
+ }
638
+ }
639
+ }
640
+ },
641
+ created_at: {
642
+ type: "string",
643
+ format: "date-time"
644
+ },
645
+ updated_at: {
646
+ type: "string",
647
+ format: "date-time"
648
+ }
649
+ },
650
+ required: [
651
+ "uri",
652
+ "organization",
653
+ "status",
654
+ "created_at",
655
+ "updated_at"
656
+ ]
657
+ };
658
+ const getRoutingFormOutputSchema = {
659
+ type: "object",
660
+ properties: { resource: routingFormResource },
661
+ required: ["resource"]
662
+ };
663
+ const listRoutingFormsOutputSchema = {
664
+ type: "array",
665
+ items: routingFormResource
666
+ };
667
+ const routingFormSubmissionResource = {
668
+ type: "object",
669
+ properties: {
670
+ uri: { type: "string" },
671
+ routing_form: { type: "string" },
672
+ questions_and_answers: {
673
+ type: "array",
674
+ items: {
675
+ type: "object",
676
+ properties: {
677
+ question_uuid: { type: "string" },
678
+ question: { type: "string" },
679
+ answer: { type: ["string", "null"] }
680
+ }
681
+ }
682
+ },
683
+ tracking: {
684
+ type: ["object", "null"],
685
+ properties: {
686
+ utm_campaign: { type: ["string", "null"] },
687
+ utm_source: { type: ["string", "null"] },
688
+ utm_medium: { type: ["string", "null"] },
689
+ utm_content: { type: ["string", "null"] },
690
+ utm_term: { type: ["string", "null"] },
691
+ salesforce_uuid: { type: ["string", "null"] }
692
+ }
693
+ },
694
+ result: {
695
+ type: ["object", "null"],
696
+ properties: {
697
+ type: { type: "string" },
698
+ value: { type: "string" }
699
+ }
700
+ },
701
+ submitter: { type: ["string", "null"] },
702
+ submitter_type: { type: ["string", "null"] },
703
+ created_at: {
704
+ type: "string",
705
+ format: "date-time"
706
+ },
707
+ updated_at: {
708
+ type: "string",
709
+ format: "date-time"
710
+ }
711
+ },
712
+ required: [
713
+ "uri",
714
+ "routing_form",
715
+ "created_at",
716
+ "updated_at"
717
+ ]
718
+ };
719
+ const getRoutingFormSubmissionOutputSchema = {
720
+ type: "object",
721
+ properties: { resource: routingFormSubmissionResource },
722
+ required: ["resource"]
723
+ };
724
+ const listRoutingFormSubmissionsOutputSchema = {
725
+ type: "array",
726
+ items: routingFormSubmissionResource
727
+ };
728
+ //#endregion
729
+ //#region src/outputSchemas/availability.ts
730
+ const availabilityScheduleResource = {
731
+ type: "object",
732
+ properties: {
733
+ uri: { type: "string" },
734
+ default: { type: "boolean" },
735
+ name: { type: ["string", "null"] },
736
+ user: { type: "string" },
737
+ timezone: { type: "string" },
738
+ rules: {
739
+ type: "array",
740
+ items: {
741
+ type: "object",
742
+ properties: {
743
+ type: { type: "string" },
744
+ intervals: {
745
+ type: "array",
746
+ items: {
747
+ type: "object",
748
+ properties: {
749
+ from: { type: "string" },
750
+ to: { type: "string" }
751
+ }
752
+ }
753
+ },
754
+ wday: { type: "string" },
755
+ date: { type: "string" }
756
+ }
757
+ }
758
+ }
759
+ },
760
+ required: [
761
+ "uri",
762
+ "default",
763
+ "user",
764
+ "timezone",
765
+ "rules"
766
+ ]
767
+ };
768
+ const getUserAvailabilityScheduleOutputSchema = {
769
+ type: "object",
770
+ properties: { resource: availabilityScheduleResource },
771
+ required: ["resource"]
772
+ };
773
+ const listUserAvailabilitySchedulesOutputSchema = {
774
+ type: "object",
775
+ properties: { collection: {
776
+ type: "array",
777
+ items: availabilityScheduleResource
778
+ } },
779
+ required: ["collection"]
780
+ };
781
+ const listUserBusyTimesOutputSchema = {
782
+ type: "object",
783
+ properties: { collection: {
784
+ type: "array",
785
+ items: {
786
+ type: "object",
787
+ properties: {
788
+ type: { type: "string" },
789
+ start_time: {
790
+ type: "string",
791
+ format: "date-time"
792
+ },
793
+ end_time: {
794
+ type: "string",
795
+ format: "date-time"
796
+ },
797
+ buffered_start_time: {
798
+ type: ["string", "null"],
799
+ format: "date-time"
800
+ },
801
+ buffered_end_time: {
802
+ type: ["string", "null"],
803
+ format: "date-time"
804
+ },
805
+ event: {
806
+ type: ["object", "null"],
807
+ properties: { uri: { type: "string" } }
808
+ }
809
+ },
810
+ required: [
811
+ "type",
812
+ "start_time",
813
+ "end_time"
814
+ ]
815
+ }
816
+ } },
817
+ required: ["collection"]
818
+ };
819
+ //#endregion
820
+ //#region src/outputSchemas/misc.ts
821
+ const createSingleUseSchedulingLinkOutputSchema = {
822
+ type: "object",
823
+ properties: { resource: {
824
+ type: "object",
825
+ properties: {
826
+ booking_url: { type: "string" },
827
+ owner: { type: "string" },
828
+ owner_type: { type: "string" }
829
+ },
830
+ required: [
831
+ "booking_url",
832
+ "owner",
833
+ "owner_type"
834
+ ]
835
+ } },
836
+ required: ["resource"]
837
+ };
838
+ const createShareOutputSchema = {
839
+ type: "object",
840
+ properties: { resource: {
841
+ type: "object",
842
+ properties: {
843
+ scheduling_links: {
844
+ type: "array",
845
+ items: {
846
+ type: "object",
847
+ properties: {
848
+ booking_url: { type: "string" },
849
+ owner: { type: "string" },
850
+ owner_type: { type: "string" }
851
+ }
852
+ }
853
+ },
854
+ share_override: {
855
+ type: ["object", "null"],
856
+ properties: {
857
+ name: { type: ["string", "null"] },
858
+ duration: { type: ["number", "null"] },
859
+ period_type: { type: ["string", "null"] },
860
+ start_date: { type: ["string", "null"] },
861
+ end_date: { type: ["string", "null"] },
862
+ max_booking_time: { type: ["number", "null"] },
863
+ hide_location: { type: ["boolean", "null"] },
864
+ location_configurations: {
865
+ type: ["array", "null"],
866
+ items: {
867
+ type: "object",
868
+ properties: {
869
+ location: { type: ["string", "null"] },
870
+ additional_info: { type: ["string", "null"] },
871
+ phone_number: { type: ["string", "null"] },
872
+ position: { type: "number" },
873
+ kind: { type: "string" }
874
+ }
875
+ }
876
+ },
877
+ availability_rule: {
878
+ type: ["object", "null"],
879
+ properties: {
880
+ rules: {
881
+ type: "array",
882
+ items: {
883
+ type: "object",
884
+ properties: {
885
+ type: { type: "string" },
886
+ wday: { type: "string" },
887
+ date: { type: "string" },
888
+ intervals: {
889
+ type: "array",
890
+ items: {
891
+ type: "object",
892
+ properties: {
893
+ from: { type: "string" },
894
+ to: { type: "string" }
895
+ }
896
+ }
897
+ }
898
+ }
899
+ }
900
+ },
901
+ timezone: { type: "string" }
902
+ }
903
+ }
904
+ }
905
+ }
906
+ },
907
+ required: ["scheduling_links"]
908
+ } },
909
+ required: ["resource"]
910
+ };
911
+ //#endregion
912
+ //#region src/constants.ts
913
+ const LIVE_API_URL = "https://api.calendly.com";
914
+ const MOCK_API_URL = "https://stoplight.io/mocks/calendly/api-docs/395";
915
+ const LIVE_AUTH_URL = "https://auth.calendly.com";
916
+ const WEBHOOK_SUBSCRIPTIONS_URL = `${LIVE_API_URL}/webhook_subscriptions/`;
917
+ //#endregion
918
+ //#region src/connections/calendlyOauth2Connection.ts
919
+ const calendlyOauth2Connection = (0, _prismatic_io_spectral.oauth2Connection)({
920
+ key: "calendlyOauth2Connection",
921
+ display: {
922
+ description: "Authenticate using OAuth 2.0.",
923
+ label: "OAuth 2.0"
924
+ },
925
+ oauth2Type: _prismatic_io_spectral.OAuth2Type.AuthorizationCode,
926
+ inputs: {
927
+ authorizeUrl: {
928
+ label: "Authorize URL",
929
+ placeholder: "Enter authorize URL",
930
+ type: "string",
931
+ default: `${LIVE_AUTH_URL}/oauth/authorize`,
932
+ required: true,
933
+ shown: true,
934
+ comments: "The OAuth 2.0 Authorization URL for the Calendly API. See [Calendly API docs](https://developer.calendly.com/api-docs) for details."
935
+ },
936
+ tokenUrl: {
937
+ label: "Token URL",
938
+ placeholder: "Enter token URL",
939
+ type: "string",
940
+ default: `${LIVE_AUTH_URL}/oauth/token`,
941
+ required: true,
942
+ shown: true,
943
+ comments: "The OAuth 2.0 Token URL for the Calendly API. See [Calendly API docs](https://developer.calendly.com/api-docs) for details."
944
+ },
945
+ scopes: {
946
+ label: "Scopes",
947
+ placeholder: "Enter OAuth scopes",
948
+ type: "string",
949
+ required: false,
950
+ shown: true,
951
+ example: "activity_log:read availability:read data_compliance:write event_types:read organizations:read organizations:write routing_forms:read scheduled_events:read scheduled_events:write scheduling_links:write shares:write users:read webhooks:read webhooks:write",
952
+ default: "activity_log:read availability:read data_compliance:write event_types:read organizations:read organizations:write routing_forms:read scheduled_events:read scheduled_events:write scheduling_links:write shares:write users:read webhooks:read webhooks:write",
953
+ comments: "Space-separated list of OAuth permission scopes. The default includes all scopes required by this component's actions, triggers, and datasources. See [Calendly scopes](https://developer.calendly.com/docs/authentication/scopes) for available scopes."
954
+ },
955
+ clientId: {
956
+ label: "Client ID",
957
+ placeholder: "Enter client ID",
958
+ type: "string",
959
+ required: true,
960
+ shown: true,
961
+ comments: "The Client ID from the Calendly OAuth application. See [Calendly API docs](https://developer.calendly.com/api-docs) for setup instructions."
962
+ },
963
+ clientSecret: {
964
+ label: "Client Secret",
965
+ placeholder: "Enter client secret",
966
+ type: "password",
967
+ required: true,
968
+ shown: true,
969
+ comments: "The Client Secret from the Calendly OAuth application. See [Calendly API docs](https://developer.calendly.com/api-docs) for setup instructions."
970
+ },
971
+ useLiveServer: {
972
+ label: "Use Live Server",
973
+ type: "boolean",
974
+ required: true,
975
+ comments: "When true, uses the live server. When false, uses the mock server."
976
+ }
977
+ }
978
+ });
979
+ //#endregion
980
+ //#region src/connections/index.ts
981
+ var connections_default = [calendlyOauth2Connection];
982
+ //#endregion
983
+ //#region src/client.ts
984
+ const validateConnection = (connection) => {
985
+ if (connection.key !== calendlyOauth2Connection.key) throw new _prismatic_io_spectral.ConnectionError(connection, "Calendly connection not found");
986
+ };
987
+ const getCalendlyClient = (connection, debug) => {
988
+ validateConnection(connection);
989
+ return (0, _prismatic_io_spectral_http.createClient)({
990
+ baseUrl: _prismatic_io_spectral.util.types.toBool(connection.fields.useLiveServer) ? LIVE_API_URL : MOCK_API_URL,
991
+ headers: {
992
+ authorization: `Bearer ${_prismatic_io_spectral.util.types.toString(connection.token?.access_token)}`,
993
+ "Content-Type": "application/json"
994
+ },
995
+ debug
996
+ });
997
+ };
998
+ //#endregion
999
+ //#region src/util/clean.ts
1000
+ const cleanString = (value) => {
1001
+ const str = _prismatic_io_spectral.util.types.toString(value);
1002
+ return str ? str : void 0;
1003
+ };
1004
+ const cleanOrganizationInput = (value) => {
1005
+ const organizationsBasePath = `${LIVE_API_URL}/organizations/`;
1006
+ if (typeof value === "string") {
1007
+ if (!value.includes(organizationsBasePath)) return `${organizationsBasePath}${value}`;
1008
+ }
1009
+ return _prismatic_io_spectral.util.types.toString(value);
1010
+ };
1011
+ //#endregion
1012
+ //#region src/util/common.ts
1013
+ const paginator = async (client, url, params) => {
1014
+ const allData = [];
1015
+ do {
1016
+ const { data } = await client.get(url, { params });
1017
+ if (data.pagination.next_page_token) params.page_token = data.pagination.next_page_token;
1018
+ else params.page_token = void 0;
1019
+ if (data.collection) allData.push(...data.collection);
1020
+ } while (params.page_token);
1021
+ return allData;
1022
+ };
1023
+ const extractUuidFromUri = (uri) => {
1024
+ const parts = uri.split("/");
1025
+ return parts[parts.length - 1];
1026
+ };
1027
+ //#endregion
1028
+ //#region src/util/events.ts
1029
+ const getEvents = async (client, inviteeEmail, maxStartTime, minStartTime, organization, sort, status, user) => {
1030
+ return await paginator(client, "/scheduled_events", {
1031
+ invitee_email: inviteeEmail,
1032
+ max_start_time: maxStartTime,
1033
+ min_start_time: minStartTime,
1034
+ organization,
1035
+ sort,
1036
+ status,
1037
+ user
1038
+ });
1039
+ };
1040
+ const classifyEventsByPollDate = (events, lastPolledAt) => {
1041
+ const lastPolledAtMs = new Date(lastPolledAt).getTime();
1042
+ const created = [];
1043
+ const updated = [];
1044
+ for (const event of events) {
1045
+ const createdMs = event.created_at ? new Date(event.created_at).getTime() : NaN;
1046
+ const updatedMs = event.updated_at ? new Date(event.updated_at).getTime() : NaN;
1047
+ const isNew = !Number.isNaN(createdMs) && createdMs > lastPolledAtMs;
1048
+ const isUpdated = !isNew && !Number.isNaN(updatedMs) && updatedMs > lastPolledAtMs;
1049
+ if (isNew) created.push(event);
1050
+ else if (isUpdated) updated.push(event);
1051
+ }
1052
+ return {
1053
+ created,
1054
+ updated
1055
+ };
1056
+ };
1057
+ const resolvePollingRecordChanges = (data) => {
1058
+ const changesObject = data ?? {};
1059
+ return [...(changesObject.created ?? []).map((record) => ({
1060
+ changeType: "created",
1061
+ record
1062
+ })), ...(changesObject.updated ?? []).map((record) => ({
1063
+ changeType: "updated",
1064
+ record
1065
+ }))];
1066
+ };
1067
+ //#endregion
1068
+ //#region src/util/eventTypes.ts
1069
+ const getEventTypes = async (client, adminManaged, organization, user, userAvailabilitySchedule, active, sort) => {
1070
+ return await paginator(client, "/event_types", {
1071
+ admin_managed: adminManaged,
1072
+ organization,
1073
+ user,
1074
+ user_availability_schedule: userAvailabilitySchedule,
1075
+ active,
1076
+ sort
1077
+ });
1078
+ };
1079
+ //#endregion
1080
+ //#region src/util/organizations.ts
1081
+ const getOrganizationMemberships = async (client, email, organization, user) => {
1082
+ return await paginator(client, "/organization_memberships", {
1083
+ email,
1084
+ organization,
1085
+ user
1086
+ });
1087
+ };
1088
+ //#endregion
1089
+ //#region src/util/routingForms.ts
1090
+ const getRoutingForms = async (client, organization, sort) => {
1091
+ return await paginator(client, "/routing_forms", {
1092
+ organization,
1093
+ sort
1094
+ });
1095
+ };
1096
+ //#endregion
1097
+ //#region src/util/webhooks.ts
1098
+ const getUuidFromUri = (url) => url.replace(WEBHOOK_SUBSCRIPTIONS_URL, "");
1099
+ const postWebhookSubscription = async (client, url, events, organization, user, scope, signingKey) => {
1100
+ const body = {
1101
+ url,
1102
+ events,
1103
+ organization,
1104
+ user,
1105
+ scope,
1106
+ signing_key: signingKey
1107
+ };
1108
+ const { data } = await client.post("/webhook_subscriptions", body);
1109
+ return data;
1110
+ };
1111
+ const getWebhookSubscriptions = async (client, organization, scope, count, pageToken, sort, user) => {
1112
+ const { data } = await client.get("/webhook_subscriptions", { params: {
1113
+ organization,
1114
+ scope,
1115
+ count,
1116
+ page_token: pageToken,
1117
+ sort,
1118
+ user
1119
+ } });
1120
+ return data;
1121
+ };
1122
+ const findWebhook = async (client, url, organization, user, scope) => {
1123
+ let nextPageToken;
1124
+ let foundWebhook;
1125
+ do {
1126
+ const data = await getWebhookSubscriptions(client, organization, scope, "20", nextPageToken, void 0, user);
1127
+ foundWebhook = data.collection.find((webhook) => webhook.callback_url === url);
1128
+ if (!foundWebhook) nextPageToken = data.pagination.next_page_token ?? void 0;
1129
+ } while (!foundWebhook && nextPageToken);
1130
+ return foundWebhook;
1131
+ };
1132
+ const deleteWebhook = async (client, webhookUuid) => {
1133
+ const { data } = await client.delete(`/webhook_subscriptions/${webhookUuid}`);
1134
+ return data;
1135
+ };
1136
+ const deleteWebhookInstance = async (client, endpoint, organization, user, scope) => {
1137
+ const foundWebhook = await findWebhook(client, endpoint, organization, user, scope);
1138
+ if (foundWebhook) return await deleteWebhook(client, getUuidFromUri(foundWebhook.uri));
1139
+ throw new Error("Webhook not found");
1140
+ };
1141
+ //#endregion
1142
+ //#region src/inputs/common.ts
1143
+ const connection = (0, _prismatic_io_spectral.input)({
1144
+ label: "Connection",
1145
+ type: "connection",
1146
+ required: true,
1147
+ comments: "The Calendly connection to use."
1148
+ });
1149
+ const uuid = (0, _prismatic_io_spectral.input)({
1150
+ label: "UUID",
1151
+ type: "string",
1152
+ required: true,
1153
+ comments: "The unique identifier in UUID format.",
1154
+ example: "9f53ccd3-88e6-4c62-ad9e-91ea57d2187d",
1155
+ placeholder: "Enter UUID",
1156
+ clean: _prismatic_io_spectral.util.types.toString
1157
+ });
1158
+ (0, _prismatic_io_spectral.input)({
1159
+ label: "Count",
1160
+ type: "string",
1161
+ comments: "The number of rows to return.",
1162
+ required: false,
1163
+ placeholder: "Enter count",
1164
+ clean: _prismatic_io_spectral.util.types.toNumber
1165
+ });
1166
+ const email = (0, _prismatic_io_spectral.input)({
1167
+ label: "Email",
1168
+ type: "string",
1169
+ comments: "Indicates if the results should be filtered by email address.",
1170
+ example: "bob@example.com",
1171
+ placeholder: "Enter email address",
1172
+ required: false,
1173
+ clean: cleanString
1174
+ });
1175
+ (0, _prismatic_io_spectral.input)({
1176
+ label: "Page Token",
1177
+ type: "string",
1178
+ comments: "The token to pass to get the next or previous portion of the collection.",
1179
+ required: false,
1180
+ placeholder: "Enter page token",
1181
+ clean: cleanString
1182
+ });
1183
+ const sort = (0, _prismatic_io_spectral.input)({
1184
+ label: "Sort",
1185
+ type: "string",
1186
+ comments: "Order results by the created_at field and direction specified: ascending ('asc') or descending ('desc').",
1187
+ required: false,
1188
+ placeholder: "Enter sort expression",
1189
+ clean: cleanString
1190
+ });
1191
+ const status = (0, _prismatic_io_spectral.input)({
1192
+ label: "Status",
1193
+ type: "string",
1194
+ comments: "Indicates if the invitee 'canceled' or still 'active'.",
1195
+ required: false,
1196
+ example: "active",
1197
+ placeholder: "Enter status",
1198
+ clean: cleanString
1199
+ });
1200
+ const inviteeEmail = (0, _prismatic_io_spectral.input)({
1201
+ label: "Invitee Email",
1202
+ type: "string",
1203
+ comments: "Return events scheduled with the invitee associated with this email address.",
1204
+ example: "alice@example.com",
1205
+ placeholder: "Enter invitee email address",
1206
+ required: false,
1207
+ clean: cleanString
1208
+ });
1209
+ const maxStartTime = (0, _prismatic_io_spectral.input)({
1210
+ label: "Max Start Time",
1211
+ type: "string",
1212
+ comments: "Include events with start times prior to this time. Format: ISO 8601 datetime.",
1213
+ example: "2020-01-02T12:30:00.000000Z",
1214
+ placeholder: "Enter max start time (ISO 8601)",
1215
+ required: false,
1216
+ clean: cleanString
1217
+ });
1218
+ const minStartTime = (0, _prismatic_io_spectral.input)({
1219
+ label: "Min Start Time",
1220
+ type: "string",
1221
+ comments: "Include events with start times after this time. Format: ISO 8601 datetime.",
1222
+ example: "2020-01-02T12:30:00.000000Z",
1223
+ placeholder: "Enter min start time (ISO 8601)",
1224
+ required: false,
1225
+ clean: cleanString
1226
+ });
1227
+ const organization = (0, _prismatic_io_spectral.input)({
1228
+ label: "Organization",
1229
+ type: "string",
1230
+ comments: "Return events scheduled with the organization associated with this URI.",
1231
+ example: "https://api.calendly.com/organizations/EBHAAFHDCAEQTSEZ",
1232
+ placeholder: "Enter organization URI",
1233
+ required: false,
1234
+ clean: cleanOrganizationInput
1235
+ });
1236
+ const user = (0, _prismatic_io_spectral.input)({
1237
+ label: "User",
1238
+ type: "string",
1239
+ comments: "Return events scheduled with the user associated with this URI.",
1240
+ example: "https://api.calendly.com/users/EBHAAFHDCAEQTSEZ",
1241
+ placeholder: "Enter user URI",
1242
+ required: false,
1243
+ clean: cleanString
1244
+ });
1245
+ const startTime = (0, _prismatic_io_spectral.input)({
1246
+ label: "Start Time",
1247
+ type: "string",
1248
+ comments: "The scheduled events UTC timestamp at which data deletion should begin. Format: ISO 8601 datetime.",
1249
+ required: true,
1250
+ example: "2019-01-02T03:04:05.678123Z",
1251
+ placeholder: "Enter start time (ISO 8601)",
1252
+ clean: _prismatic_io_spectral.util.types.toString
1253
+ });
1254
+ const endTime = (0, _prismatic_io_spectral.input)({
1255
+ label: "End Time",
1256
+ type: "string",
1257
+ comments: "The scheduled events UTC timestamp at which data deletion should end. Format: ISO 8601 datetime.",
1258
+ required: true,
1259
+ example: "2021-01-01T02:04:05.678123Z",
1260
+ placeholder: "Enter end time (ISO 8601)",
1261
+ clean: _prismatic_io_spectral.util.types.toString
1262
+ });
1263
+ const adminManaged = (0, _prismatic_io_spectral.input)({
1264
+ label: "Admin Managed",
1265
+ type: "boolean",
1266
+ comments: "When true, returns only admin managed event types. When false, excludes admin managed event types.",
1267
+ required: false,
1268
+ clean: _prismatic_io_spectral.util.types.toBool
1269
+ });
1270
+ const userAvailabilitySchedule = (0, _prismatic_io_spectral.input)({
1271
+ label: "User Availability Schedule",
1272
+ type: "string",
1273
+ comments: "Used in conjunction with user parameter, returns a filtered list of Event Types that use the given primary availability schedule.",
1274
+ required: false,
1275
+ placeholder: "Enter user availability schedule",
1276
+ clean: cleanString
1277
+ });
1278
+ const active = (0, _prismatic_io_spectral.input)({
1279
+ label: "Active",
1280
+ type: "boolean",
1281
+ comments: "When true, returns only active event types. When false, returns only inactive event types.",
1282
+ required: false,
1283
+ clean: _prismatic_io_spectral.util.types.toBool
1284
+ });
1285
+ const eventType = (0, _prismatic_io_spectral.input)({
1286
+ label: "Event Type",
1287
+ type: "string",
1288
+ comments: "The URI associated with the event type.",
1289
+ required: true,
1290
+ placeholder: "Enter event type URI",
1291
+ dataSource: "eventTypes",
1292
+ clean: _prismatic_io_spectral.util.types.toString
1293
+ });
1294
+ const form = (0, _prismatic_io_spectral.input)({
1295
+ label: "Form",
1296
+ type: "string",
1297
+ comments: "View routing form submissions associated with the routing form's URI.",
1298
+ example: "https://api.calendly.com/routing_forms/AAAAAAAAAAAAAAAA",
1299
+ placeholder: "Enter routing form URI",
1300
+ required: true,
1301
+ dataSource: "routingForms",
1302
+ clean: _prismatic_io_spectral.util.types.toString
1303
+ });
1304
+ const scope = (0, _prismatic_io_spectral.input)({
1305
+ label: "Scope",
1306
+ type: "string",
1307
+ comments: "Indicates if the webhook subscription scope will be 'organization' or 'user'.",
1308
+ required: true,
1309
+ model: [{
1310
+ label: "Organization",
1311
+ value: "organization"
1312
+ }, {
1313
+ label: "User",
1314
+ value: "user"
1315
+ }],
1316
+ clean: _prismatic_io_spectral.util.types.toString
1317
+ });
1318
+ const signingKey = (0, _prismatic_io_spectral.input)({
1319
+ label: "Signing Key",
1320
+ type: "password",
1321
+ comments: "Optional secret key shared between your application and Calendly. See [Calendly API documentation](https://developer.calendly.com/api-docs/ZG9jOjM2MzE2MDM4-webhook-signatures) for additional information.",
1322
+ required: false,
1323
+ placeholder: "Enter signing key",
1324
+ clean: cleanString
1325
+ });
1326
+ const returnUuidOnly = (0, _prismatic_io_spectral.input)({
1327
+ label: "Return UUID Only",
1328
+ type: "boolean",
1329
+ comments: "When enabled, returns only the UUID from the URI instead of the full URI.",
1330
+ required: false,
1331
+ default: "false",
1332
+ clean: _prismatic_io_spectral.util.types.toBool
1333
+ });
1334
+ (0, _prismatic_io_spectral.input)({
1335
+ label: "Invitee Created",
1336
+ type: "boolean",
1337
+ comments: "When true, triggers when an invitee is created.",
1338
+ required: false,
1339
+ clean: _prismatic_io_spectral.util.types.toBool
1340
+ });
1341
+ (0, _prismatic_io_spectral.input)({
1342
+ label: "Invitee Canceled",
1343
+ type: "boolean",
1344
+ comments: "When true, triggers when an invitee is canceled.",
1345
+ required: false,
1346
+ clean: _prismatic_io_spectral.util.types.toBool
1347
+ });
1348
+ (0, _prismatic_io_spectral.input)({
1349
+ label: "Invitee No Show Created",
1350
+ type: "boolean",
1351
+ comments: "When true, triggers when an invitee no show is created.",
1352
+ required: false,
1353
+ clean: _prismatic_io_spectral.util.types.toBool
1354
+ });
1355
+ (0, _prismatic_io_spectral.input)({
1356
+ label: "Routing Form Submission Created",
1357
+ type: "boolean",
1358
+ comments: "When true, triggers when a routing form submission is created. Important: this event only works with the 'organization' scope.",
1359
+ required: false,
1360
+ clean: _prismatic_io_spectral.util.types.toBool
1361
+ });
1362
+ const eventNamesInput = (0, _prismatic_io_spectral.input)({
1363
+ label: "Webhook Event Name",
1364
+ type: "string",
1365
+ collection: "valuelist",
1366
+ comments: "The webhook event types to subscribe to.",
1367
+ model: [
1368
+ {
1369
+ label: "Invitee Created",
1370
+ value: "invitee.created"
1371
+ },
1372
+ {
1373
+ label: "Invitee Canceled",
1374
+ value: "invitee.canceled"
1375
+ },
1376
+ {
1377
+ label: "Invitee No Show Created",
1378
+ value: "invitee_no_show.created"
1379
+ },
1380
+ {
1381
+ label: "Routing Form Submission Created",
1382
+ value: "routing_form_submission.created"
1383
+ }
1384
+ ],
1385
+ required: true,
1386
+ clean: (events) => Array.isArray(events) ? events.map((event) => _prismatic_io_spectral.util.types.toString(event)) : []
1387
+ });
1388
+ const lookBackDate = (0, _prismatic_io_spectral.input)({
1389
+ label: "Look-Back Date",
1390
+ type: "string",
1391
+ required: false,
1392
+ comments: "The date the initial sync starts from, in YYYY-MM-DD format. Cannot be a future date. Leave empty to start from the first recurrence with no backfill. When set, the initial sync seeds each event modified on or after this date once, ignoring the visibility filters.",
1393
+ example: "2026-01-01",
1394
+ placeholder: "Enter look-back date (YYYY-MM-DD)",
1395
+ clean: cleanString
1396
+ });
1397
+ const showNewRecords = (0, _prismatic_io_spectral.input)({
1398
+ label: "Show New Records",
1399
+ type: "boolean",
1400
+ required: false,
1401
+ default: "true",
1402
+ comments: "When true, events created since the last poll are included in the trigger output.",
1403
+ clean: _prismatic_io_spectral.util.types.toBool
1404
+ });
1405
+ const showUpdatedRecords = (0, _prismatic_io_spectral.input)({
1406
+ label: "Show Updated Records",
1407
+ type: "boolean",
1408
+ required: false,
1409
+ default: "true",
1410
+ comments: "When true, events updated since the last poll are included in the trigger output.",
1411
+ clean: _prismatic_io_spectral.util.types.toBool
1412
+ });
1413
+ //#endregion
1414
+ //#region src/inputs/events.ts
1415
+ const eventUuid = (0, _prismatic_io_spectral.input)({
1416
+ label: "Event UUID",
1417
+ type: "string",
1418
+ comments: "The event's unique identifier.",
1419
+ required: true,
1420
+ placeholder: "Enter event UUID",
1421
+ dataSource: "events",
1422
+ clean: _prismatic_io_spectral.util.types.toString
1423
+ });
1424
+ const inviteeUuid = (0, _prismatic_io_spectral.input)({
1425
+ label: "Invitee UUID",
1426
+ type: "string",
1427
+ comments: "The invitee's unique identifier.",
1428
+ required: true,
1429
+ placeholder: "Enter invitee UUID",
1430
+ clean: _prismatic_io_spectral.util.types.toString,
1431
+ dataSource: "selectEventInvitee"
1432
+ });
1433
+ const reason = (0, _prismatic_io_spectral.input)({
1434
+ label: "Reason",
1435
+ type: "string",
1436
+ comments: "The reason for canceling the event.",
1437
+ required: false,
1438
+ placeholder: "Enter cancellation reason",
1439
+ clean: cleanString
1440
+ });
1441
+ const cancelEventInputs = {
1442
+ connection,
1443
+ organization: {
1444
+ ...organization,
1445
+ dataSource: "organizations"
1446
+ },
1447
+ uuid: {
1448
+ ...uuid,
1449
+ dataSource: "events"
1450
+ },
1451
+ reason
1452
+ };
1453
+ const deleteScheduledEventDataInputs = {
1454
+ connection,
1455
+ startTime,
1456
+ endTime
1457
+ };
1458
+ const getEventInputs = {
1459
+ connection,
1460
+ organization: {
1461
+ ...organization,
1462
+ dataSource: "organizations"
1463
+ },
1464
+ uuid: {
1465
+ ...uuid,
1466
+ dataSource: "events"
1467
+ }
1468
+ };
1469
+ const getEventInviteeInputs = {
1470
+ connection,
1471
+ organization: {
1472
+ ...organization,
1473
+ dataSource: "organizations"
1474
+ },
1475
+ eventUuid,
1476
+ inviteeUuid
1477
+ };
1478
+ const listEventInviteesInputs = {
1479
+ connection,
1480
+ organization: {
1481
+ ...organization,
1482
+ dataSource: "organizations"
1483
+ },
1484
+ uuid: {
1485
+ ...uuid,
1486
+ dataSource: "events"
1487
+ },
1488
+ email,
1489
+ sort,
1490
+ status
1491
+ };
1492
+ const listEventsInputs = {
1493
+ connection,
1494
+ inviteeEmail,
1495
+ maxStartTime,
1496
+ minStartTime,
1497
+ organization: {
1498
+ ...organization,
1499
+ dataSource: "organizations"
1500
+ },
1501
+ sort,
1502
+ status,
1503
+ user
1504
+ };
1505
+ const deleteInviteeDataInputs = {
1506
+ connection,
1507
+ emails: (0, _prismatic_io_spectral.input)({
1508
+ label: "Email",
1509
+ type: "string",
1510
+ collection: "valuelist",
1511
+ comments: "Invitee email to delete.",
1512
+ required: true,
1513
+ placeholder: "Enter email addresses",
1514
+ clean: (value) => value
1515
+ })
1516
+ };
1517
+ const getCurrentUserInputs = { connection };
1518
+ const getUserInputs = {
1519
+ connection,
1520
+ uuid
1521
+ };
1522
+ const getUserAvailabilityScheduleInputs = {
1523
+ connection,
1524
+ uuid: {
1525
+ ...uuid,
1526
+ comments: "The UUID of the availability schedule."
1527
+ }
1528
+ };
1529
+ const listUserAvailabilitySchedulesInputs = {
1530
+ connection,
1531
+ user: {
1532
+ ...user,
1533
+ required: true,
1534
+ comments: "A URI reference to a user"
1535
+ }
1536
+ };
1537
+ const listUserBusyTimesInputs = {
1538
+ connection,
1539
+ user: {
1540
+ ...user,
1541
+ required: true,
1542
+ comments: "The uri associated with the user"
1543
+ },
1544
+ endTime: {
1545
+ ...endTime,
1546
+ comments: "End time of the requested availability range"
1547
+ },
1548
+ startTime: {
1549
+ ...startTime,
1550
+ comments: "Start time of the requested availability range"
1551
+ }
1552
+ };
1553
+ const listUserEventTypesInputs = {
1554
+ connection,
1555
+ adminManaged,
1556
+ userAvailabilitySchedule,
1557
+ active,
1558
+ organization: {
1559
+ ...organization,
1560
+ dataSource: "organizations",
1561
+ comments: "View available personal, team, and organization event types associated with the organization's URI."
1562
+ },
1563
+ user: {
1564
+ ...user,
1565
+ comments: "View available personal, team, and organization event types associated with the user's URI."
1566
+ },
1567
+ sort: {
1568
+ ...sort,
1569
+ comments: "Order results by the specified field and direction. Accepts comma-separated list of {field}:{direction} values. Supported fields are: name. Sort direction is specified as: asc, desc.",
1570
+ default: "name:asc"
1571
+ }
1572
+ };
1573
+ //#endregion
1574
+ //#region src/inputs/organizations.ts
1575
+ const orgUuid = (0, _prismatic_io_spectral.input)({
1576
+ label: "Organization UUID",
1577
+ type: "string",
1578
+ comments: "The organization's unique identifier.",
1579
+ required: true,
1580
+ placeholder: "Enter organization UUID",
1581
+ clean: _prismatic_io_spectral.util.types.toString
1582
+ });
1583
+ const actionInput = (0, _prismatic_io_spectral.input)({
1584
+ label: "Action",
1585
+ type: "string",
1586
+ collection: "valuelist",
1587
+ comments: "The action associated with the entries.",
1588
+ required: false,
1589
+ clean: (value) => value
1590
+ });
1591
+ const actor = (0, _prismatic_io_spectral.input)({
1592
+ label: "Actor",
1593
+ type: "string",
1594
+ collection: "valuelist",
1595
+ comments: "Return entries from the user associated with the provided URI.",
1596
+ required: false,
1597
+ clean: (value) => value
1598
+ });
1599
+ const maxOccurredAt = (0, _prismatic_io_spectral.input)({
1600
+ label: "Max Occurred At",
1601
+ type: "string",
1602
+ comments: "Include entries that occurred prior to this time. This time should use the UTC timezone. Format: ISO 8601 datetime.",
1603
+ required: false,
1604
+ placeholder: "Enter max occurred at (ISO 8601)",
1605
+ example: "2020-01-02T03:04:05.678Z",
1606
+ clean: cleanString
1607
+ });
1608
+ const minOccurredAt = (0, _prismatic_io_spectral.input)({
1609
+ label: "Min Occurred At",
1610
+ type: "string",
1611
+ comments: "Include entries that occurred after this time. This time should use the UTC timezone. Format: ISO 8601 datetime.",
1612
+ required: false,
1613
+ placeholder: "Enter min occurred at (ISO 8601)",
1614
+ example: "2020-01-02T03:04:05.678Z",
1615
+ clean: cleanString
1616
+ });
1617
+ const namespace = (0, _prismatic_io_spectral.input)({
1618
+ label: "Namespace",
1619
+ type: "string",
1620
+ collection: "valuelist",
1621
+ comments: "The category of the entry.",
1622
+ required: false,
1623
+ clean: (value) => value
1624
+ });
1625
+ const searchTerm = (0, _prismatic_io_spectral.input)({
1626
+ label: "Search Term",
1627
+ type: "string",
1628
+ comments: "Filters entries based on the search term.",
1629
+ required: false,
1630
+ example: "compliance",
1631
+ placeholder: "Enter search term",
1632
+ clean: cleanString
1633
+ });
1634
+ const sortList = (0, _prismatic_io_spectral.input)({
1635
+ label: "Sort",
1636
+ type: "string",
1637
+ collection: "valuelist",
1638
+ comments: "Order results by the specified field and direction. {field}:{direction} value.",
1639
+ required: false,
1640
+ model: [
1641
+ {
1642
+ label: "Action Ascending",
1643
+ value: "action:asc"
1644
+ },
1645
+ {
1646
+ label: "Action Descending",
1647
+ value: "action:desc"
1648
+ },
1649
+ {
1650
+ label: "Actor Display Name Ascending",
1651
+ value: "actor.display_name:asc"
1652
+ },
1653
+ {
1654
+ label: "Actor Display Name Descending",
1655
+ value: "actor.display_name:desc"
1656
+ },
1657
+ {
1658
+ label: "Actor URI Ascending",
1659
+ value: "actor.uri:asc"
1660
+ },
1661
+ {
1662
+ label: "Actor URI Descending",
1663
+ value: "actor.uri:desc"
1664
+ },
1665
+ {
1666
+ label: "Namespace Ascending",
1667
+ value: "namespace:asc"
1668
+ },
1669
+ {
1670
+ label: "Namespace Descending",
1671
+ value: "namespace:desc"
1672
+ },
1673
+ {
1674
+ label: "Occurred At Ascending",
1675
+ value: "occurred_at:asc"
1676
+ },
1677
+ {
1678
+ label: "Occurred At Descending",
1679
+ value: "occurred_at:desc"
1680
+ }
1681
+ ],
1682
+ clean: (value) => value
1683
+ });
1684
+ const getOrganizationInvitationInputs = {
1685
+ connection,
1686
+ uuid: {
1687
+ ...uuid,
1688
+ comments: "The organization invitation's unique identifier."
1689
+ },
1690
+ orgUuid
1691
+ };
1692
+ const getOrganizationMembershipInputs = {
1693
+ connection,
1694
+ uuid: {
1695
+ ...uuid,
1696
+ comments: "The organization membership's unique identifier."
1697
+ }
1698
+ };
1699
+ const inviteUserToOrganizationInputs = {
1700
+ connection,
1701
+ uuid: {
1702
+ ...uuid,
1703
+ comments: "The UUID of the organization."
1704
+ },
1705
+ email: {
1706
+ ...email,
1707
+ required: true,
1708
+ comments: "The email address of the user to invite."
1709
+ }
1710
+ };
1711
+ const listActivityLogEntriesInputs = {
1712
+ connection,
1713
+ organization: {
1714
+ ...organization,
1715
+ required: true,
1716
+ dataSource: "organizations",
1717
+ comments: "Return activity log entries from the organization associated with this URI"
1718
+ },
1719
+ actionInput,
1720
+ actor,
1721
+ maxOccurredAt,
1722
+ minOccurredAt,
1723
+ namespace,
1724
+ searchTerm,
1725
+ sortList
1726
+ };
1727
+ const listOrganizationInvitationsInputs = {
1728
+ connection,
1729
+ uuid,
1730
+ email: {
1731
+ ...email,
1732
+ required: false,
1733
+ comments: "Indicates if the results should be filtered by email address"
1734
+ },
1735
+ sort,
1736
+ status: {
1737
+ ...status,
1738
+ required: false,
1739
+ comments: "Indicates if the results should be filtered by status (\"pending\", \"accepted\", or \"declined\")",
1740
+ model: [
1741
+ {
1742
+ value: "",
1743
+ label: ""
1744
+ },
1745
+ {
1746
+ value: "pending",
1747
+ label: "Pending"
1748
+ },
1749
+ {
1750
+ value: "accepted",
1751
+ label: "Accepted"
1752
+ },
1753
+ {
1754
+ value: "declined",
1755
+ label: "Declined"
1756
+ }
1757
+ ]
1758
+ }
1759
+ };
1760
+ const listOrganizationMembershipsInputs = {
1761
+ connection,
1762
+ email: {
1763
+ ...email,
1764
+ comments: "Indicates if the results should be filtered by email address",
1765
+ example: "user@example.com"
1766
+ },
1767
+ organization: {
1768
+ ...organization,
1769
+ dataSource: "organizations",
1770
+ comments: "Indicates if the results should be filtered by organization"
1771
+ },
1772
+ user: {
1773
+ ...user,
1774
+ comments: "Indicates if the results should be filtered by user",
1775
+ example: "https://api.calendly.com/users/UR1234567890"
1776
+ }
1777
+ };
1778
+ const removeUserFromOrganizationInputs = {
1779
+ connection,
1780
+ organization: {
1781
+ ...organization,
1782
+ dataSource: "organizations"
1783
+ },
1784
+ uuid: {
1785
+ ...uuid,
1786
+ comments: "The organization membership's unique identifier",
1787
+ dataSource: "organizationMemberships"
1788
+ }
1789
+ };
1790
+ const revokeUserOrganizationInvitationInputs = {
1791
+ connection,
1792
+ uuid: {
1793
+ ...uuid,
1794
+ comments: "The organization invitation's unique identifier."
1795
+ },
1796
+ orgUuid
1797
+ };
1798
+ //#endregion
1799
+ //#region src/inputs/webhooks.ts
1800
+ const url = (0, _prismatic_io_spectral.input)({
1801
+ label: "URL",
1802
+ type: "string",
1803
+ comments: "The URL to receive POST requests for subscribed events.",
1804
+ required: true,
1805
+ placeholder: "Enter webhook URL",
1806
+ clean: _prismatic_io_spectral.util.types.toString
1807
+ });
1808
+ const event = (0, _prismatic_io_spectral.input)({
1809
+ label: "Event",
1810
+ type: "string",
1811
+ collection: "valuelist",
1812
+ comments: "Event to subscribe to.",
1813
+ required: true,
1814
+ example: [
1815
+ "invitee.canceled",
1816
+ "invitee.created",
1817
+ "invitee_no_show.created",
1818
+ "routing_form_submission.created"
1819
+ ].join(", "),
1820
+ clean: (value) => value
1821
+ });
1822
+ const webhookUuid = (0, _prismatic_io_spectral.input)({
1823
+ label: "Webhook UUID",
1824
+ type: "string",
1825
+ required: true,
1826
+ comments: "The webhook's unique identifier.",
1827
+ placeholder: "Enter webhook UUID",
1828
+ clean: _prismatic_io_spectral.util.types.toString
1829
+ });
1830
+ const createWebhookSubscriptionInputs = {
1831
+ connection,
1832
+ organization: {
1833
+ ...organization,
1834
+ required: true,
1835
+ dataSource: "organizations",
1836
+ comments: "The unique reference to the organization that the webhook will be tied to."
1837
+ },
1838
+ user: {
1839
+ ...user,
1840
+ required: false,
1841
+ comments: "The unique reference to the user that the webhook will be tied to."
1842
+ },
1843
+ url,
1844
+ event,
1845
+ scope,
1846
+ signingKey
1847
+ };
1848
+ const deleteInstancedWebhooksInputs = {
1849
+ connection,
1850
+ organization: {
1851
+ ...organization,
1852
+ required: true,
1853
+ dataSource: "organizations",
1854
+ comments: "Organization to delete webhooks from"
1855
+ },
1856
+ scope: {
1857
+ ...scope,
1858
+ required: true,
1859
+ comments: "Organization or user webhooks to delete"
1860
+ },
1861
+ user: {
1862
+ ...user,
1863
+ comments: "User to delete webhooks from. Required if scope is set to user."
1864
+ }
1865
+ };
1866
+ const deleteWebhookSubscriptionInputs = {
1867
+ connection,
1868
+ webhookUuid
1869
+ };
1870
+ const getWebhookSubscriptionInputs = {
1871
+ connection,
1872
+ webhookUuid
1873
+ };
1874
+ const listWebhookSubscriptionInputs = {
1875
+ connection,
1876
+ organization: {
1877
+ ...organization,
1878
+ required: true,
1879
+ dataSource: "organizations",
1880
+ comments: "Indicates if the results should be filtered by organization"
1881
+ },
1882
+ scope: {
1883
+ ...scope,
1884
+ required: true,
1885
+ comments: "Filter the list by organization or user"
1886
+ },
1887
+ sort: {
1888
+ ...sort,
1889
+ default: void 0,
1890
+ comments: "Order results by the specified field and direction. Accepts comma-separated list of {field}:{direction} values. Supported fields are: created_at. Sort direction is specified as: asc, desc."
1891
+ },
1892
+ user: {
1893
+ ...user,
1894
+ comments: "Indicates if the results should be filtered by user. This parameter is only required if the scope parameter is set to user."
1895
+ }
1896
+ };
1897
+ //#endregion
1898
+ //#region src/inputs/routingForms.ts
1899
+ const getRoutingFormInputs = {
1900
+ connection,
1901
+ organization: {
1902
+ ...organization,
1903
+ dataSource: "organizations"
1904
+ },
1905
+ uuid: {
1906
+ ...uuid,
1907
+ dataSource: "routingForms"
1908
+ }
1909
+ };
1910
+ const getRoutingFormSubmissionInputs = {
1911
+ connection,
1912
+ uuid
1913
+ };
1914
+ const listRoutingFormSubmissionsInputs = {
1915
+ connection,
1916
+ organization: {
1917
+ ...organization,
1918
+ dataSource: "organizations"
1919
+ },
1920
+ form,
1921
+ sort: {
1922
+ ...sort,
1923
+ model: [
1924
+ {
1925
+ label: "",
1926
+ value: ""
1927
+ },
1928
+ {
1929
+ label: "Created At (Ascending)",
1930
+ value: "created_at:asc"
1931
+ },
1932
+ {
1933
+ label: "Created At (Descending)",
1934
+ value: "created_at:desc"
1935
+ }
1936
+ ],
1937
+ comments: "Order results by the specified field and direction. Supported fields are: created_at. Sort direction is specified as: asc, desc."
1938
+ }
1939
+ };
1940
+ const listRoutingFormsInputs = {
1941
+ connection,
1942
+ organization: {
1943
+ ...organization,
1944
+ required: true,
1945
+ dataSource: "organizations",
1946
+ comments: "View organization routing forms associated with the organization's URI."
1947
+ },
1948
+ sort: {
1949
+ ...sort,
1950
+ comments: "Order results by the specified field and direction. Accepts comma-separated list of {field}:{direction} values. Supported fields are: created_at. Sort direction is specified as: asc, desc.",
1951
+ example: "created_at:desc"
1952
+ }
1953
+ };
1954
+ //#endregion
1955
+ //#region src/inputs/misc.ts
1956
+ const maxEventCount = (0, _prismatic_io_spectral.input)({
1957
+ label: "Max Event Count",
1958
+ type: "string",
1959
+ comments: "The max number of events that can be scheduled using this scheduling link.",
1960
+ required: true,
1961
+ example: "1",
1962
+ placeholder: "Enter max event count",
1963
+ clean: _prismatic_io_spectral.util.types.toNumber
1964
+ });
1965
+ const owner = (0, _prismatic_io_spectral.input)({
1966
+ label: "Owner",
1967
+ type: "string",
1968
+ comments: "A link to the resource that owns this Scheduling Link (currently, this is always an Event Type).",
1969
+ required: true,
1970
+ example: "https://api.calendly.com/event_types/012345678901234567890",
1971
+ placeholder: "Enter owner URI",
1972
+ clean: _prismatic_io_spectral.util.types.toString
1973
+ });
1974
+ const ownerType = (0, _prismatic_io_spectral.input)({
1975
+ label: "Owner Type",
1976
+ type: "string",
1977
+ comments: "Resource type (currently, this is always EventType).",
1978
+ required: true,
1979
+ example: "EventType",
1980
+ placeholder: "Enter owner type",
1981
+ clean: _prismatic_io_spectral.util.types.toString
1982
+ });
1983
+ const name = (0, _prismatic_io_spectral.input)({
1984
+ label: "Name",
1985
+ type: "string",
1986
+ required: false,
1987
+ comments: "The name of the resource.",
1988
+ placeholder: "Enter name",
1989
+ clean: cleanString,
1990
+ example: "15 Minute Meeting"
1991
+ });
1992
+ const duration = (0, _prismatic_io_spectral.input)({
1993
+ label: "Duration",
1994
+ type: "string",
1995
+ required: false,
1996
+ comments: "The duration of the event in minutes.",
1997
+ placeholder: "Enter duration in minutes",
1998
+ clean: cleanString,
1999
+ example: "60"
2000
+ });
2001
+ const periodType = (0, _prismatic_io_spectral.input)({
2002
+ label: "Period Type",
2003
+ type: "string",
2004
+ required: false,
2005
+ comments: "The type of scheduling period for the event type.",
2006
+ model: [
2007
+ {
2008
+ label: "",
2009
+ value: ""
2010
+ },
2011
+ {
2012
+ label: "Available Moving",
2013
+ value: "available_moving"
2014
+ },
2015
+ {
2016
+ label: "Moving",
2017
+ value: "moving"
2018
+ },
2019
+ {
2020
+ label: "Fixed",
2021
+ value: "fixed"
2022
+ },
2023
+ {
2024
+ label: "Unlimited",
2025
+ value: "unlimited"
2026
+ }
2027
+ ],
2028
+ clean: cleanString
2029
+ });
2030
+ const startDate = (0, _prismatic_io_spectral.input)({
2031
+ label: "Start Date",
2032
+ type: "string",
2033
+ comments: "Required when period_type is 'fixed'. Format: YYYY-MM-DD.",
2034
+ required: false,
2035
+ placeholder: "Enter start date (YYYY-MM-DD)",
2036
+ clean: cleanString,
2037
+ example: "2019-01-02"
2038
+ });
2039
+ const endDate = (0, _prismatic_io_spectral.input)({
2040
+ label: "End Date",
2041
+ type: "string",
2042
+ comments: "Required when period_type is 'fixed'. Format: YYYY-MM-DD.",
2043
+ required: false,
2044
+ placeholder: "Enter end date (YYYY-MM-DD)",
2045
+ clean: cleanString,
2046
+ example: "2019-01-03"
2047
+ });
2048
+ const maxBookingTime = (0, _prismatic_io_spectral.input)({
2049
+ label: "Max Booking Time",
2050
+ type: "string",
2051
+ comments: "Required when period_type is 'moving' or 'available_moving'.",
2052
+ required: false,
2053
+ placeholder: "Enter max booking time",
2054
+ clean: cleanString,
2055
+ example: "300"
2056
+ });
2057
+ const hideLocation = (0, _prismatic_io_spectral.input)({
2058
+ label: "Hide Location",
2059
+ type: "boolean",
2060
+ comments: "When true, the location is hidden until the invitee books a spot. Only respected when there is a single custom location configured.",
2061
+ required: false,
2062
+ clean: _prismatic_io_spectral.util.types.toBool
2063
+ });
2064
+ const locationConfigurations = (0, _prismatic_io_spectral.input)({
2065
+ label: "Location Configurations",
2066
+ type: "code",
2067
+ language: "json",
2068
+ comments: "Array of location configurations for the event type.",
2069
+ default: JSON.stringify([{
2070
+ location: "123 Abc St.",
2071
+ additional_info: "Example additional info",
2072
+ phone_number: "+1 888-888-8888",
2073
+ position: 0,
2074
+ kind: "physical"
2075
+ }]),
2076
+ required: false,
2077
+ clean: _prismatic_io_spectral.util.types.toObject
2078
+ });
2079
+ const availabilityRule = (0, _prismatic_io_spectral.input)({
2080
+ label: "Availability Rule",
2081
+ type: "code",
2082
+ language: "json",
2083
+ comments: "Availability rules defining when the event type can be scheduled.",
2084
+ default: JSON.stringify({
2085
+ rules: [{
2086
+ type: "wday",
2087
+ wday: "friday",
2088
+ date: "2019-01-02",
2089
+ intervals: [{
2090
+ from: "07:00",
2091
+ to: "11:00"
2092
+ }]
2093
+ }],
2094
+ timezone: "America/New_York"
2095
+ }),
2096
+ required: false,
2097
+ clean: _prismatic_io_spectral.util.types.toObject
2098
+ });
2099
+ const createShareInputs = {
2100
+ connection,
2101
+ organization: {
2102
+ ...organization,
2103
+ dataSource: "organizations"
2104
+ },
2105
+ eventType,
2106
+ name,
2107
+ duration,
2108
+ periodType,
2109
+ startDate,
2110
+ endDate,
2111
+ maxBookingTime,
2112
+ hideLocation,
2113
+ locationConfigurations,
2114
+ availabilityRule
2115
+ };
2116
+ const createSingleUseSchedulingLinkInputs = {
2117
+ connection,
2118
+ maxEventCount,
2119
+ owner,
2120
+ ownerType
2121
+ };
2122
+ const getEventTypeInputs = {
2123
+ connection,
2124
+ organization: {
2125
+ ...organization,
2126
+ dataSource: "organizations"
2127
+ },
2128
+ uuid: {
2129
+ ...uuid,
2130
+ dataSource: "eventTypes"
2131
+ }
2132
+ };
2133
+ const listEventTypeAvailableTimesInputs = {
2134
+ connection,
2135
+ organization: {
2136
+ ...organization,
2137
+ dataSource: "organizations"
2138
+ },
2139
+ endTime: {
2140
+ ...endTime,
2141
+ required: true,
2142
+ comments: "End time of the requested availability range."
2143
+ },
2144
+ eventType,
2145
+ startTime: {
2146
+ ...startTime,
2147
+ required: true,
2148
+ comments: "Start time of the requested availability range."
2149
+ }
2150
+ };
2151
+ const { debugRequest: _, ...httpRawInputs } = _prismatic_io_spectral_http.inputs;
2152
+ const rawRequestInputs = {
2153
+ connection,
2154
+ ...httpRawInputs,
2155
+ url: {
2156
+ ...httpRawInputs.url,
2157
+ comments: `Input the path only (/users/me), The base URL is already included (${LIVE_API_URL}). For example, to connect to ${LIVE_API_URL}/users/me, only /users/me is entered in this field.`,
2158
+ example: "/users/me"
2159
+ }
2160
+ };
2161
+ //#endregion
2162
+ //#region src/inputs/dataSources.ts
2163
+ const selectEventInviteeInputs = {
2164
+ connection,
2165
+ uuid,
2166
+ returnUuidOnly
2167
+ };
2168
+ const eventTypesInputs = {
2169
+ connection,
2170
+ user: {
2171
+ ...user,
2172
+ comments: "View available personal, team, and organization event types associated with the user's URI."
2173
+ },
2174
+ adminManaged,
2175
+ organization: {
2176
+ ...organization,
2177
+ comments: "View available personal, team, and organization event types associated with the organization's URI."
2178
+ },
2179
+ userAvailabilitySchedule,
2180
+ active,
2181
+ sort: {
2182
+ ...sort,
2183
+ comments: "Order results by the specified field and direction. Accepts comma-separated list of {field}:{direction} values. Supported fields are: name. Sort direction is specified as: asc, desc.",
2184
+ default: "name:asc"
2185
+ },
2186
+ returnUuidOnly
2187
+ };
2188
+ const eventsInputs = {
2189
+ connection,
2190
+ inviteeEmail,
2191
+ maxStartTime,
2192
+ minStartTime,
2193
+ organization,
2194
+ returnUuidOnly,
2195
+ sort,
2196
+ status,
2197
+ user
2198
+ };
2199
+ const organizationMembershipsInputs = {
2200
+ connection,
2201
+ email: {
2202
+ ...email,
2203
+ comments: "Indicates if the results should be filtered by email address",
2204
+ example: "user@example.com"
2205
+ },
2206
+ organization: {
2207
+ ...organization,
2208
+ comments: "Indicates if the results should be filtered by organization"
2209
+ },
2210
+ user: {
2211
+ ...user,
2212
+ comments: "Indicates if the results should be filtered by user",
2213
+ example: "https://api.calendly.com/users/UR1234567890"
2214
+ },
2215
+ returnUuidOnly
2216
+ };
2217
+ const organizationsInputs = { connection };
2218
+ const routingFormsInputs = {
2219
+ connection,
2220
+ organization: {
2221
+ ...organization,
2222
+ required: true,
2223
+ comments: "View organization routing forms associated with the organization's URI."
2224
+ },
2225
+ sort: {
2226
+ ...sort,
2227
+ comments: "Order results by the specified field and direction. Accepts comma-separated list of {field}:{direction} values. Supported fields are: created_at. Sort direction is specified as: asc, desc.",
2228
+ example: "created_at:desc"
2229
+ },
2230
+ returnUuidOnly
2231
+ };
2232
+ //#endregion
2233
+ //#region src/inputs/triggers.ts
2234
+ const calendlyTriggerInputs = {
2235
+ connection,
2236
+ organization: {
2237
+ ...organization,
2238
+ required: true,
2239
+ comments: "The unique reference to the organization that the webhook will be tied to."
2240
+ },
2241
+ user: {
2242
+ ...user,
2243
+ required: false,
2244
+ comments: "The unique reference to the user that the webhook will be tied to."
2245
+ },
2246
+ eventNamesInput,
2247
+ scope,
2248
+ signingKey
2249
+ };
2250
+ const pollChangesTriggerInputs = {
2251
+ connection,
2252
+ organization: {
2253
+ ...organization,
2254
+ required: true,
2255
+ dataSource: "organizations",
2256
+ comments: "Poll events scheduled with the organization at this URI."
2257
+ },
2258
+ user,
2259
+ lookBackDate,
2260
+ showNewRecords,
2261
+ showUpdatedRecords
2262
+ };
2263
+ //#endregion
2264
+ //#region src/examplePayloads.ts
2265
+ const listEventInviteesExamplePayload = { data: [{
2266
+ cancel_url: "https://calendly.com/cancellations/AAAAAAAAAAAAAAAA",
2267
+ created_at: "2020-11-23T17:51:18.327602Z",
2268
+ email: "test@example.com",
2269
+ event: "https://api.calendly.com/scheduled_events/AAAAAAAAAAAAAAAA",
2270
+ name: "John Doe",
2271
+ first_name: "John",
2272
+ last_name: "Doe",
2273
+ new_invitee: null,
2274
+ old_invitee: null,
2275
+ questions_and_answers: [
2276
+ {
2277
+ answer: "radio button answer",
2278
+ position: 0,
2279
+ question: "Question with Radio Buttons answer type"
2280
+ },
2281
+ {
2282
+ answer: "Multiple line\nAnswer",
2283
+ position: 1,
2284
+ question: "Question with Multiple Lines answer type"
2285
+ },
2286
+ {
2287
+ answer: "Answer 1\nAnswer 2\nAnswer 3",
2288
+ position: 2,
2289
+ question: "Question with Checkboxes answer type"
2290
+ }
2291
+ ],
2292
+ reschedule_url: "https://calendly.com/reschedulings/AAAAAAAAAAAAAAAA",
2293
+ rescheduled: false,
2294
+ status: "active",
2295
+ text_reminder_number: null,
2296
+ timezone: "America/New_York",
2297
+ tracking: {
2298
+ utm_campaign: null,
2299
+ utm_source: null,
2300
+ utm_medium: null,
2301
+ utm_content: null,
2302
+ utm_term: null,
2303
+ salesforce_uuid: null
2304
+ },
2305
+ updated_at: "2020-11-23T17:51:18.341657Z",
2306
+ uri: "https://api.calendly.com/scheduled_events/AAAAAAAAAAAAAAAA/invitees/AAAAAAAAAAAAAAAA",
2307
+ routing_form_submission: "https://api.calendly.com/routing_form_submissions/AAAAAAAAAAAAAAAA",
2308
+ payment: {
2309
+ external_id: "ch_AAAAAAAAAAAAAAAAAAAAAAAA",
2310
+ provider: "stripe",
2311
+ amount: 1234.56,
2312
+ currency: "USD",
2313
+ terms: "sample terms of payment (up to 1,024 characters)",
2314
+ successful: true
2315
+ },
2316
+ no_show: null,
2317
+ reconfirmation: {
2318
+ created_at: "2020-11-23T17:51:18.341657Z",
2319
+ confirmed_at: "2020-11-23T20:01:18.341657Z"
2320
+ },
2321
+ scheduling_method: null,
2322
+ invitee_scheduled_by: null
2323
+ }] };
2324
+ const listEventsExamplePayload = { data: [{
2325
+ uri: "https://api.calendly.com/scheduled_events/GBGBDCAADAEDCRZ2",
2326
+ name: "15 Minute Meeting",
2327
+ status: "active",
2328
+ start_time: "2019-08-24T14:15:22.123456Z",
2329
+ end_time: "2019-08-24T14:15:22.123456Z",
2330
+ event_type: "https://api.calendly.com/event_types/GBGBDCAADAEDCRZ2",
2331
+ location: {
2332
+ type: "physical",
2333
+ location: "Calendly Office"
2334
+ },
2335
+ invitees_counter: {
2336
+ total: 0,
2337
+ active: 0,
2338
+ limit: 0
2339
+ },
2340
+ created_at: "2019-01-02T03:04:05.092125Z",
2341
+ updated_at: "2019-01-02T03:04:05.092125Z",
2342
+ event_memberships: [{
2343
+ user: "https://api.calendly.com/users/GBGBDCAADAEDCRZ2",
2344
+ user_email: "user@example.com"
2345
+ }],
2346
+ event_guests: [{
2347
+ email: "user@example.com",
2348
+ created_at: "2022-04-21T17:10:48.484945Z",
2349
+ updated_at: "2022-04-21T17:11:01.758636Z"
2350
+ }],
2351
+ calendar_event: {
2352
+ kind: "google",
2353
+ external_id: "8suu9k3hj00mni03ss12ba0ce0"
2354
+ }
2355
+ }] };
2356
+ const calendlyTriggerExamplePayload = { payload: {
2357
+ body: { data: {
2358
+ event: "invitee.created",
2359
+ created_at: "2024-03-15T14:30:00.000000Z",
2360
+ created_by: "https://api.calendly.com/users/AAAAAAAAAAAAAAAA",
2361
+ payload: {
2362
+ cancel_url: "https://calendly.com/cancellations/AAAAAAAAAAAAAAAA",
2363
+ created_at: "2024-03-15T14:30:00.000000Z",
2364
+ email: "invitee@example.com",
2365
+ event: "https://api.calendly.com/scheduled_events/AAAAAAAAAAAAAAAA",
2366
+ name: "Jane Doe",
2367
+ new_invitee: null,
2368
+ old_invitee: null,
2369
+ reschedule_url: "https://calendly.com/reschedulings/AAAAAAAAAAAAAAAA",
2370
+ status: "active",
2371
+ uri: "https://api.calendly.com/scheduled_events/AAAAAAAAAAAAAAAA/invitees/AAAAAAAAAAAAAAAA",
2372
+ updated_at: "2024-03-15T14:30:00.000000Z"
2373
+ }
2374
+ } },
2375
+ headers: {},
2376
+ queryParameters: {},
2377
+ rawBody: {
2378
+ data: void 0,
2379
+ contentType: void 0
2380
+ },
2381
+ pathFragment: "",
2382
+ webhookUrls: {},
2383
+ webhookApiKeys: {},
2384
+ invokeUrl: "",
2385
+ executionId: "",
2386
+ customer: {
2387
+ id: "Q3VzdG9tZXI6MTIzNDU2NzgtMTIzNC00NTY3LTg5YWItY2RlZjAxMjM0NTY3",
2388
+ name: "Example Customer",
2389
+ externalId: "ext-cust-001"
2390
+ },
2391
+ instance: {
2392
+ id: "SW5zdGFuY2U6MTIzNDU2NzgtMTIzNC00NTY3LTg5YWItY2RlZjAxMjM0NTY3",
2393
+ name: "Calendly - Production"
2394
+ },
2395
+ user: {
2396
+ id: "VXNlcjoxMjM0NTY3OC0xMjM0LTQ1NjctODlhYi1jZGVmMDEyMzQ1Njc=",
2397
+ email: "user@example.com",
2398
+ name: "Example User",
2399
+ externalId: "ext-user-001"
2400
+ },
2401
+ integration: {
2402
+ id: "SW50ZWdyYXRpb246MTIzNDU2NzgtMTIzNC00NTY3LTg5YWItY2RlZjAxMjM0NTY3",
2403
+ name: "Calendly - Webhook Integration",
2404
+ versionSequenceId: "VmVyc2lvbjoxMjM0NTY3OC0xMjM0LTQ1Njc=",
2405
+ externalVersion: "1.0.0"
2406
+ },
2407
+ flow: {
2408
+ id: "Rmxvdzo4NzY1NDMyMS0xMjM0LTQ1NjctODlhYi1jZGVmMDEyMzQ1Njc=",
2409
+ name: "New and Updated Events",
2410
+ stableId: ""
2411
+ },
2412
+ startedAt: "",
2413
+ globalDebug: false
2414
+ } };
2415
+ const pollChangesTriggerExamplePayload = { payload: {
2416
+ body: { data: {
2417
+ created: listEventsExamplePayload.data,
2418
+ updated: []
2419
+ } },
2420
+ headers: {},
2421
+ queryParameters: {},
2422
+ rawBody: {
2423
+ data: void 0,
2424
+ contentType: void 0
2425
+ },
2426
+ pathFragment: "",
2427
+ webhookUrls: {},
2428
+ webhookApiKeys: {},
2429
+ invokeUrl: "",
2430
+ executionId: "",
2431
+ customer: {
2432
+ id: "Q3VzdG9tZXI6MTIzNDU2NzgtMTIzNC00NTY3LTg5YWItY2RlZjAxMjM0NTY3",
2433
+ name: "Example Customer",
2434
+ externalId: "ext-cust-001"
2435
+ },
2436
+ instance: {
2437
+ id: "SW5zdGFuY2U6MTIzNDU2NzgtMTIzNC00NTY3LTg5YWItY2RlZjAxMjM0NTY3",
2438
+ name: "Calendly - Production"
2439
+ },
2440
+ user: {
2441
+ id: "VXNlcjoxMjM0NTY3OC0xMjM0LTQ1NjctODlhYi1jZGVmMDEyMzQ1Njc=",
2442
+ email: "user@example.com",
2443
+ name: "Example User",
2444
+ externalId: "ext-user-001"
2445
+ },
2446
+ integration: {
2447
+ id: "SW50ZWdyYXRpb246MTIzNDU2NzgtMTIzNC00NTY3LTg5YWItY2RlZjAxMjM0NTY3",
2448
+ name: "Calendly - Webhook Integration",
2449
+ versionSequenceId: "VmVyc2lvbjoxMjM0NTY3OC0xMjM0LTQ1Njc=",
2450
+ externalVersion: "1.0.0"
2451
+ },
2452
+ flow: {
2453
+ id: "Rmxvdzo4NzY1NDMyMS0xMjM0LTQ1NjctODlhYi1jZGVmMDEyMzQ1Njc=",
2454
+ name: "New and Updated Events",
2455
+ stableId: ""
2456
+ },
2457
+ startedAt: "",
2458
+ globalDebug: false
2459
+ } };
2460
+ const getEventInviteeExamplePayload = { data: { resource: {
2461
+ cancel_url: "https://calendly.com/cancellations/AAAAAAAAAAAAAAAA",
2462
+ created_at: "2022-04-21T17:11:43.092010Z",
2463
+ email: "email@example.com",
2464
+ rescheduled: false,
2465
+ reschedule_url: "https://calendly.com/reschedulings/AAAAAAAAAAAAAAAA",
2466
+ event: "https://api.calendly.com/scheduled_events/ABCDABCDABCDABCD",
2467
+ name: "John Doe",
2468
+ first_name: null,
2469
+ last_name: null,
2470
+ new_invitee: null,
2471
+ old_invitee: null,
2472
+ status: "active",
2473
+ text_reminder_number: null,
2474
+ timezone: "America/New_York",
2475
+ tracking: {
2476
+ utm_campaign: null,
2477
+ utm_source: null,
2478
+ utm_medium: null,
2479
+ utm_content: null,
2480
+ utm_term: null,
2481
+ salesforce_uuid: null
2482
+ },
2483
+ updated_at: "2020-01-01T20:30:00.000000Z",
2484
+ uri: "https://api.calendly.com/api/v2/scheduled_events/ABCDABCDABCDABCD/invitees/ABCDABCDABCDABCD",
2485
+ questions_and_answers: [
2486
+ {
2487
+ answer: "radio button answer",
2488
+ position: 0,
2489
+ question: "Question with Radio Buttons answer type"
2490
+ },
2491
+ {
2492
+ answer: "Multiple line\nAnswer",
2493
+ position: 1,
2494
+ question: "Question with Multiple Lines answer type"
2495
+ },
2496
+ {
2497
+ answer: "Answer 1\nAnswer 2\nAnswer 3",
2498
+ position: 2,
2499
+ question: "Question with Checkboxes answer type"
2500
+ }
2501
+ ],
2502
+ routing_form_submission: "https://api.calendly.com/routing_form_submissions/AAAAAAAAAAAAAAAA",
2503
+ payment: {
2504
+ external_id: "ch_AAAAAAAAAAAAAAAAAAAAAAAA",
2505
+ provider: "stripe",
2506
+ amount: 1234.56,
2507
+ currency: "USD",
2508
+ terms: "sample terms of payment (up to 1,024 characters)",
2509
+ successful: true
2510
+ },
2511
+ no_show: null,
2512
+ reconfirmation: {
2513
+ created_at: "2020-11-23T17:51:18.341657Z",
2514
+ confirmed_at: "2020-11-23T20:01:18.341657Z"
2515
+ },
2516
+ scheduling_method: null,
2517
+ invitee_scheduled_by: null
2518
+ } } };
2519
+ const getEventExamplePayload = { data: { resource: {
2520
+ uri: "https://api.calendly.com/scheduled_events/GBGBDCAADAEDCRZ2",
2521
+ name: "15 Minute Meeting",
2522
+ status: "active",
2523
+ booking_method: "instant",
2524
+ start_time: "2019-08-24T14:15:22.000000Z",
2525
+ end_time: "2019-08-24T14:15:22.000000Z",
2526
+ event_type: "https://api.calendly.com/event_types/GBGBDCAADAEDCRZ2",
2527
+ location: {
2528
+ type: "physical",
2529
+ location: "Calendly Office"
2530
+ },
2531
+ invitees_counter: {
2532
+ total: 0,
2533
+ active: 0,
2534
+ limit: 0
2535
+ },
2536
+ created_at: "2019-01-02T03:04:05.678123Z",
2537
+ updated_at: "2019-01-02T03:04:05.678123Z",
2538
+ event_memberships: [{
2539
+ user: "https://api.calendly.com/users/GBGBDCAADAEDCRZ2",
2540
+ user_email: "user@example.com"
2541
+ }],
2542
+ event_guests: [{
2543
+ email: "user@example.com",
2544
+ created_at: "2019-08-24T14:15:22.123456Z",
2545
+ updated_at: "2019-08-24T14:15:22.123456Z"
2546
+ }],
2547
+ calendar_event: {
2548
+ kind: "google",
2549
+ external_id: "8suu9k3hj00mni03ss12ba0ce0"
2550
+ }
2551
+ } } };
2552
+ const cancelEventExamplePayload = { data: { resource: {
2553
+ canceled_by: "John Doe",
2554
+ reason: "Scheduling conflict",
2555
+ canceler_type: "host",
2556
+ created_at: "2019-01-02T03:04:05.678123Z"
2557
+ } } };
2558
+ const createSingleUseSchedulingLinkExamplePayload = { data: { resource: {
2559
+ booking_url: "https://calendly.com/d/abcd-brv8/15-minute-meeting",
2560
+ owner: "https://api.calendly.com/event_types/GBGBDCAADAEDCRZ2",
2561
+ owner_type: "EventType"
2562
+ } } };
2563
+ const deleteInviteeDataExamplePayload = { data: {} };
2564
+ const deleteScheduledEventDataExamplePayload = { data: {} };
2565
+ const deleteWebhookSubscriptionExamplePayload = { data: {} };
2566
+ const deleteInstancedWebhooksExamplePayload = { data: {} };
2567
+ const removeUserFromOrganizationExamplePayload = { data: {} };
2568
+ const revokeUserOrganizationInvitationExamplePayload = { data: {} };
2569
+ const listUserEventTypesExamplePayload = { data: [{
2570
+ uri: "https://api.calendly.com/event_types/AAAAAAAAAAAAAAAA",
2571
+ name: "15 Minute Meeting",
2572
+ active: true,
2573
+ booking_method: "instant",
2574
+ slug: "acmesales",
2575
+ scheduling_url: "https://calendly.com/acmesales",
2576
+ duration: 30,
2577
+ kind: "solo",
2578
+ pooling_type: "round_robin",
2579
+ type: "StandardEventType",
2580
+ color: "#fff200",
2581
+ created_at: "2019-01-02T03:04:05.678123Z",
2582
+ updated_at: "2019-08-07T06:05:04.321123Z",
2583
+ internal_note: "Internal note",
2584
+ description_plain: "15 Minute Meeting",
2585
+ description_html: "<p>15 Minute Meeting</p>",
2586
+ profile: {
2587
+ type: "User",
2588
+ name: "Tamara Jones",
2589
+ owner: "https://api.calendly.com/users/AAAAAAAAAAAAAAAA"
2590
+ },
2591
+ secret: true,
2592
+ deleted_at: null,
2593
+ admin_managed: false,
2594
+ custom_questions: [
2595
+ {
2596
+ name: "Company Name",
2597
+ type: "string",
2598
+ position: 0,
2599
+ enabled: true,
2600
+ required: true,
2601
+ answer_choices: [],
2602
+ include_other: false
2603
+ },
2604
+ {
2605
+ name: "What would you like to discuss?",
2606
+ type: "text",
2607
+ position: 0,
2608
+ enabled: true,
2609
+ required: true,
2610
+ answer_choices: [],
2611
+ include_other: false
2612
+ },
2613
+ {
2614
+ name: "Number of employees",
2615
+ answer_choices: [
2616
+ "1",
2617
+ "2-10",
2618
+ "11-20",
2619
+ "20+"
2620
+ ],
2621
+ enabled: true,
2622
+ include_other: true,
2623
+ position: 2,
2624
+ required: false,
2625
+ type: "single_select"
2626
+ },
2627
+ {
2628
+ name: "Multi-Select Question",
2629
+ answer_choices: [
2630
+ "Answer 1",
2631
+ "Answer 2",
2632
+ "Answer 3",
2633
+ "Answer 4"
2634
+ ],
2635
+ enabled: true,
2636
+ include_other: true,
2637
+ position: 2,
2638
+ required: false,
2639
+ type: "multi_select"
2640
+ },
2641
+ {
2642
+ name: "Phone Number",
2643
+ type: "phone_number",
2644
+ position: 0,
2645
+ enabled: true,
2646
+ required: true,
2647
+ answer_choices: [],
2648
+ include_other: false
2649
+ }
2650
+ ]
2651
+ }] };
2652
+ const getEventTypeExamplePayload = { data: { resource: {
2653
+ uri: "https://api.calendly.com/event_types/AAAAAAAAAAAAAAAA",
2654
+ name: "15 Minute Meeting",
2655
+ active: true,
2656
+ booking_method: "instant",
2657
+ slug: "acmesales",
2658
+ scheduling_url: "https://calendly.com/acmesales",
2659
+ duration: 30,
2660
+ kind: "solo",
2661
+ pooling_type: "round_robin",
2662
+ type: "StandardEventType",
2663
+ color: "#fff200",
2664
+ created_at: "2019-01-02T03:04:05.678123Z",
2665
+ updated_at: "2019-08-07T06:05:04.321123Z",
2666
+ internal_note: "Internal note",
2667
+ description_plain: "15 Minute Meeting",
2668
+ description_html: "<p>15 Minute Meeting</p>",
2669
+ profile: {
2670
+ type: "User",
2671
+ name: "Tamara Jones",
2672
+ owner: "https://api.calendly.com/users/AAAAAAAAAAAAAAAA"
2673
+ },
2674
+ secret: true,
2675
+ deleted_at: null,
2676
+ admin_managed: false,
2677
+ custom_questions: [
2678
+ {
2679
+ name: "Company Name",
2680
+ type: "string",
2681
+ position: 0,
2682
+ enabled: true,
2683
+ required: true,
2684
+ answer_choices: [],
2685
+ include_other: false
2686
+ },
2687
+ {
2688
+ name: "What would you like to discuss?",
2689
+ type: "text",
2690
+ position: 0,
2691
+ enabled: true,
2692
+ required: true,
2693
+ answer_choices: [],
2694
+ include_other: false
2695
+ },
2696
+ {
2697
+ name: "Number of employees",
2698
+ answer_choices: [
2699
+ "1",
2700
+ "2-10",
2701
+ "11-20",
2702
+ "20+"
2703
+ ],
2704
+ enabled: true,
2705
+ include_other: true,
2706
+ position: 2,
2707
+ required: false,
2708
+ type: "single_select"
2709
+ },
2710
+ {
2711
+ name: "Multi-Select Question",
2712
+ answer_choices: [
2713
+ "Answer 1",
2714
+ "Answer 2",
2715
+ "Answer 3",
2716
+ "Answer 4"
2717
+ ],
2718
+ enabled: true,
2719
+ include_other: true,
2720
+ position: 2,
2721
+ required: false,
2722
+ type: "multi_select"
2723
+ },
2724
+ {
2725
+ name: "Phone Number",
2726
+ type: "phone_number",
2727
+ position: 0,
2728
+ enabled: true,
2729
+ required: true,
2730
+ answer_choices: [],
2731
+ include_other: false
2732
+ }
2733
+ ]
2734
+ } } };
2735
+ const listEventTypeAvailableTimesExamplePayload = { data: { collection: [
2736
+ {
2737
+ status: "available",
2738
+ invitees_remaining: 2,
2739
+ start_time: "2020-01-02T20:00:00.000000Z",
2740
+ scheduling_url: "https://calendly.com/acmesales/discovery-call/2020-01-02T20:00:00Z?month=2020-01&date=2020-01-02"
2741
+ },
2742
+ {
2743
+ status: "available",
2744
+ invitees_remaining: 1,
2745
+ start_time: "2020-01-03T15:00:00.000000Z",
2746
+ scheduling_url: "https://calendly.com/acmesales/discovery-call/2020-01-03T15:00:00Z?month=2020-01&date=2020-01-03"
2747
+ },
2748
+ {
2749
+ status: "available",
2750
+ invitees_remaining: 3,
2751
+ start_time: "2020-01-07T23:00:00.000000Z",
2752
+ scheduling_url: "https://calendly.com/acmesales/discovery-call/2020-01-07T23:00:00Z?month=2020-01&date=2020-01-07"
2753
+ }
2754
+ ] } };
2755
+ const getUserExamplePayload = { data: { resource: {
2756
+ uri: "https://api.calendly.com/users/AAAAAAAAAAAAAAAA",
2757
+ name: "John Doe",
2758
+ slug: "acmesales",
2759
+ email: "test@example.com",
2760
+ scheduling_url: "https://calendly.com/acmesales",
2761
+ timezone: "America/New York",
2762
+ avatar_url: "https://01234567890.cloudfront.net/uploads/user/avatar/0123456/a1b2c3d4.png",
2763
+ created_at: "2019-01-02T03:04:05.678123Z",
2764
+ updated_at: "2019-08-07T06:05:04.321123Z",
2765
+ current_organization: "https://api.calendly.com/organizations/AAAAAAAAAAAAAAAA",
2766
+ resource_type: "User"
2767
+ } } };
2768
+ const getCurrentUserExamplePayload = { data: { resource: {
2769
+ uri: "https://api.calendly.com/users/AAAAAAAAAAAAAAAA",
2770
+ name: "John Doe",
2771
+ slug: "acmesales",
2772
+ email: "user@example.com",
2773
+ scheduling_url: "https://calendly.com/acmesales",
2774
+ timezone: "America/New York",
2775
+ avatar_url: "https://01234567890.cloudfront.net/uploads/user/avatar/0123456/a1b2c3d4.png",
2776
+ created_at: "2019-01-02T03:04:05.678123Z",
2777
+ updated_at: "2019-08-07T06:05:04.321123Z",
2778
+ current_organization: "https://api.calendly.com/organizations/AAAAAAAAAAAAAAAA",
2779
+ resource_type: "User"
2780
+ } } };
2781
+ const createShareExamplePayload = { data: { resource: {
2782
+ scheduling_links: [{
2783
+ booking_url: "https://calendly.com/d/abcd-brv8/15-minute-meeting",
2784
+ owner: "https://api.calendly.com/event_types/AAAAAAAAAAAAAAAA",
2785
+ owner_type: "EventType"
2786
+ }],
2787
+ share_override: {
2788
+ name: "15 Minute Meeting",
2789
+ duration: 60,
2790
+ period_type: "fixed",
2791
+ start_date: "2019-01-02",
2792
+ end_date: "2019-01-03",
2793
+ max_booking_time: 300,
2794
+ hide_location: true,
2795
+ location_configurations: [{
2796
+ location: "123 Abc St.",
2797
+ additional_info: "Example additional info",
2798
+ phone_number: "+1 888-888-8888",
2799
+ position: 0,
2800
+ kind: "physical"
2801
+ }],
2802
+ availability_rule: {
2803
+ rules: [{
2804
+ type: "wday",
2805
+ wday: "friday",
2806
+ date: "2019-01-02",
2807
+ intervals: [{
2808
+ from: "07:00",
2809
+ to: "11:00"
2810
+ }]
2811
+ }],
2812
+ timezone: "America/New_York"
2813
+ }
2814
+ }
2815
+ } } };
2816
+ const createWebhookSubscriptionExamplePayload = { data: { resource: {
2817
+ uri: "https://api.calendly.com/webhook_subscriptions/AAAAAAAAAAAAAAAA",
2818
+ callback_url: "https://blah.foo/bar",
2819
+ created_at: "2019-08-24T14:15:22.123456Z",
2820
+ updated_at: "2019-08-24T14:15:22.123456Z",
2821
+ retry_started_at: "2019-08-24T14:15:22.123456Z",
2822
+ state: "active",
2823
+ events: ["invitee.created"],
2824
+ scope: "user",
2825
+ organization: "https://api.calendly.com/organizations/AAAAAAAAAAAAAAAA",
2826
+ user: "https://api.calendly.com/users/AAAAAAAAAAAAAAAA",
2827
+ creator: "https://api.calendly.com/users/AAAAAAAAAAAAAAAA"
2828
+ } } };
2829
+ const listWebhookSubscriptionExamplePayload = { data: [{
2830
+ uri: "https://api.calendly.com/webhook_subscriptions/AAAAAAAAAAAAAAAA",
2831
+ callback_url: "https://blah.foo/bar",
2832
+ created_at: "2019-08-24T14:15:22.123456Z",
2833
+ updated_at: "2019-08-24T14:15:22.123456Z",
2834
+ retry_started_at: "2019-08-24T14:15:22.123456Z",
2835
+ state: "active",
2836
+ events: ["invitee.created"],
2837
+ scope: "user",
2838
+ organization: "https://api.calendly.com/organizations/AAAAAAAAAAAAAAAA",
2839
+ user: "https://api.calendly.com/users/AAAAAAAAAAAAAAAA",
2840
+ creator: "https://api.calendly.com/users/AAAAAAAAAAAAAAAA"
2841
+ }] };
2842
+ const getWebhookSubscriptionExamplePayload = { data: { resource: {
2843
+ uri: "https://api.calendly.com/webhook_subscriptions/AAAAAAAAAAAAAAAA",
2844
+ callback_url: "https://blah.foo/bar",
2845
+ created_at: "2019-08-24T14:15:22.123456Z",
2846
+ updated_at: "2019-08-24T14:15:22.123456Z",
2847
+ retry_started_at: "2019-08-24T14:15:22.123456Z",
2848
+ state: "active",
2849
+ events: ["invitee.created"],
2850
+ scope: "user",
2851
+ organization: "https://api.calendly.com/organizations/AAAAAAAAAAAAAAAA",
2852
+ user: "https://api.calendly.com/users/AAAAAAAAAAAAAAAA",
2853
+ creator: "https://api.calendly.com/users/AAAAAAAAAAAAAAAA"
2854
+ } } };
2855
+ const listOrganizationInvitationsExamplePayload = { data: [{
2856
+ uri: "https://api.calendly.com/organizations/AAAAAAAAAAAAAAAA/invitations/BBBBBBBBBBBBBBBB",
2857
+ organization: "https://api.calendly.com/organizations/AAAAAAAAAAAAAAAA",
2858
+ email: "test@example.com",
2859
+ status: "accepted",
2860
+ created_at: "2019-08-07T06:05:04.321123Z",
2861
+ updated_at: "2019-01-02T03:04:05.678123Z",
2862
+ last_sent_at: "2019-01-02T03:04:05.678123Z",
2863
+ user: "https://api.calendly.com/users/AAAAAAAAAAAAAAAA"
2864
+ }] };
2865
+ const inviteUserToOrganizationExamplePayload = { data: { resource: {
2866
+ created_at: "2020-01-01T20:30:00.000000Z",
2867
+ email: "email@example.com",
2868
+ last_sent_at: "2020-01-01T20:30:00.123456Z",
2869
+ organization: "https://api.calendly.com/organizations/ABCDABCDABCDABCD",
2870
+ status: "pending",
2871
+ updated_at: "2020-01-01T20:30:00.000000Z",
2872
+ uri: "https://api.calendly.com/organizations/ABCDABCDABCDABCD/invitations/DCBADCBADCBADCBA"
2873
+ } } };
2874
+ const getOrganizationInvitationExamplePayload = { data: { resource: {
2875
+ uri: "https://api.calendly.com/organizations/AAAAAAAAAAAAAAAA/invitations/BBBBBBBBBBBBBBBB",
2876
+ organization: "https://api.calendly.com/organizations/AAAAAAAAAAAAAAAA",
2877
+ email: "test@example.com",
2878
+ status: "accepted",
2879
+ created_at: "2019-08-07T06:05:04.321123Z",
2880
+ updated_at: "2019-01-02T03:04:05.678123Z",
2881
+ last_sent_at: "2019-01-02T03:04:05.678123Z",
2882
+ user: "https://api.calendly.com/users/AAAAAAAAAAAAAAAA"
2883
+ } } };
2884
+ const getOrganizationMembershipExamplePayload = { data: { resource: {
2885
+ uri: "https://api.calendly.com/organization_memberships/AAAAAAAAAAAAAAAA",
2886
+ role: "admin",
2887
+ user: {
2888
+ uri: "https://api.calendly.com/users/AAAAAAAAAAAAAAAA",
2889
+ name: "John Doe",
2890
+ slug: "acmesales",
2891
+ email: "test@example.com",
2892
+ scheduling_url: "https://calendly.com/acmesales",
2893
+ timezone: "America/New York",
2894
+ avatar_url: "https://01234567890.cloudfront.net/uploads/user/avatar/0123456/a1b2c3d4.png",
2895
+ created_at: "2019-01-02T03:04:05.678123Z",
2896
+ updated_at: "2019-08-07T06:05:04.321123Z"
2897
+ },
2898
+ organization: "https://api.calendly.com/organizations/AAAAAAAAAAAAAAAA",
2899
+ updated_at: "2019-08-07T06:05:04.321123Z",
2900
+ created_at: "2019-01-02T03:04:05.678123Z"
2901
+ } } };
2902
+ const listOrganizationMembershipsExamplePayload = { data: [{
2903
+ uri: "https://api.calendly.com/organization_memberships/AAAAAAAAAAAAAAAA",
2904
+ role: "admin",
2905
+ user: {
2906
+ uri: "https://api.calendly.com/users/AAAAAAAAAAAAAAAA",
2907
+ name: "John Doe",
2908
+ slug: "acmesales",
2909
+ email: "test@example.com",
2910
+ scheduling_url: "https://calendly.com/acmesales",
2911
+ timezone: "America/New York",
2912
+ avatar_url: "https://01234567890.cloudfront.net/uploads/user/avatar/0123456/a1b2c3d4.png",
2913
+ created_at: "2019-01-02T03:04:05.678123Z",
2914
+ updated_at: "2019-08-07T06:05:04.321123Z"
2915
+ },
2916
+ organization: "https://api.calendly.com/organizations/AAAAAAAAAAAAAAAA",
2917
+ updated_at: "2019-08-07T06:05:04.321123Z",
2918
+ created_at: "2019-01-02T03:04:05.678123Z"
2919
+ }] };
2920
+ const listUserBusyTimesExamplePayload = { data: { collection: [
2921
+ {
2922
+ type: "calendly",
2923
+ start_time: "2020-01-02T20:00:00.000000Z",
2924
+ end_time: "2020-01-02T20:30:00.000000Z",
2925
+ buffered_start_time: "2020-01-02T19:30:00.000000Z",
2926
+ buffered_end_time: "2020-01-02T21:00:00.000000Z",
2927
+ event: { uri: "https://api.calendly.com/scheduled_events/abc123" }
2928
+ },
2929
+ {
2930
+ type: "calendly",
2931
+ start_time: "2020-01-05T20:00:00.000000Z",
2932
+ end_time: "2020-01-05T20:30:00.000000Z",
2933
+ buffered_start_time: "2020-01-05T19:30:00.000000Z",
2934
+ buffered_end_time: "2020-01-05T21:00:00.000000Z",
2935
+ event: { uri: "https://api.calendly.com/scheduled_events/abc12345" }
2936
+ },
2937
+ {
2938
+ type: "external",
2939
+ start_time: "2020-01-07T20:00:00.000000Z",
2940
+ end_time: "2020-01-07T20:30:00.000000Z"
2941
+ }
2942
+ ] } };
2943
+ const listUserAvailabilitySchedulesExamplePayload = { data: { collection: [{
2944
+ uri: "https://api.calendly.com/user_availability_schedule/abc123",
2945
+ default: true,
2946
+ name: "Working Hours",
2947
+ user: "https://api.calendly.com/users/abc123",
2948
+ timezone: "America/New_York",
2949
+ rules: [{
2950
+ type: "wday",
2951
+ intervals: [{
2952
+ from: "08:30",
2953
+ to: "09:30"
2954
+ }],
2955
+ wday: "sunday",
2956
+ date: "2022-12-31"
2957
+ }]
2958
+ }, {
2959
+ uri: "https://api.calendly.com/user_availability_schedule/abc456",
2960
+ default: false,
2961
+ name: "Evening Hours",
2962
+ user: "https://api.calendly.com/users/abc123",
2963
+ timezone: "America/New_York",
2964
+ rules: [
2965
+ {
2966
+ type: "wday",
2967
+ intervals: [{
2968
+ from: "08:30",
2969
+ to: "17:00"
2970
+ }],
2971
+ wday: "monday"
2972
+ },
2973
+ {
2974
+ type: "wday",
2975
+ intervals: [{
2976
+ from: "08:30",
2977
+ to: "17:00"
2978
+ }],
2979
+ wday: "tuesday"
2980
+ },
2981
+ {
2982
+ type: "wday",
2983
+ intervals: [],
2984
+ wday: "wednesday"
2985
+ },
2986
+ {
2987
+ type: "wday",
2988
+ intervals: [{
2989
+ from: "08:30",
2990
+ to: "17:00"
2991
+ }],
2992
+ wday: "thursday"
2993
+ },
2994
+ {
2995
+ type: "wday",
2996
+ intervals: [{
2997
+ from: "08:30",
2998
+ to: "17:00"
2999
+ }],
3000
+ wday: "friday"
3001
+ },
3002
+ {
3003
+ type: "wday",
3004
+ intervals: [],
3005
+ wday: "saturday"
3006
+ },
3007
+ {
3008
+ type: "date",
3009
+ intervals: [{
3010
+ from: "08:30",
3011
+ to: "09:30"
3012
+ }],
3013
+ date: "2028-12-31"
3014
+ }
3015
+ ]
3016
+ }] } };
3017
+ const getUserAvailabilityScheduleExamplePayload = { data: { resource: {
3018
+ uri: "https://api.calendly.com/user_availability_schedule/abc123",
3019
+ default: true,
3020
+ name: "Working Hours",
3021
+ user: "https://api.calendly.com/users/abc123",
3022
+ timezone: "America/New_York",
3023
+ rules: [{
3024
+ type: "wday",
3025
+ intervals: [{
3026
+ from: "08:30",
3027
+ to: "09:30"
3028
+ }],
3029
+ wday: "sunday",
3030
+ date: "2022-12-31"
3031
+ }]
3032
+ } } };
3033
+ const listActivityLogEntriesExamplePayload = { data: [{
3034
+ occurred_at: "2020-01-02T03:04:05.678Z",
3035
+ uri: "https://api.calendly.com/activity_log_entries/ALFKJELNCLKSJDLKFJGELKJ",
3036
+ namespace: "User",
3037
+ action: "Add",
3038
+ actor: {
3039
+ uri: "https://api.calendly.com/users/SDLKJENFJKD123",
3040
+ type: "User",
3041
+ organization: {
3042
+ uri: "https://api.calendly.com/organizations/LKJENFLKE293847",
3043
+ role: "Owner"
3044
+ },
3045
+ group: {
3046
+ uri: "https://api.calendly.com/groups/123987DJLKJEF",
3047
+ name: "Development",
3048
+ role: "Admin"
3049
+ },
3050
+ display_name: "Test User",
3051
+ alternative_identifier: "testuser@example.com"
3052
+ },
3053
+ fully_qualified_name: "User.Add",
3054
+ details: {},
3055
+ organization: "https://api.calendly.com/organizations/AAAAAAAAAAAAAAA"
3056
+ }] };
3057
+ const listRoutingFormsExamplePayload = { data: [{
3058
+ uri: "https://api.calendly.com/routing_forms/AAAAAAAAAAAAAAAA",
3059
+ organization: "https://api.calendly.com/organizations/AAAAAAAAAAAAAAAA",
3060
+ name: "ACME Demo",
3061
+ status: "published",
3062
+ questions: [{
3063
+ uuid: "123e4567-e89b-12d3-a456-426614174000",
3064
+ name: "What is your industry?",
3065
+ type: "select",
3066
+ required: true,
3067
+ answer_choices: [
3068
+ "IT & Software",
3069
+ "Financial Services",
3070
+ "Entertainment"
3071
+ ]
3072
+ }, {
3073
+ uuid: "1213f8f1-57fd-45ee-88e9-1978d35b5cad",
3074
+ name: "Email",
3075
+ type: "email",
3076
+ required: true,
3077
+ answer_choices: null
3078
+ }],
3079
+ created_at: "2022-05-15T03:04:05.678Z",
3080
+ updated_at: "2022-05-15T06:05:04.321Z"
3081
+ }] };
3082
+ const getRoutingFormExamplePayload = { data: { resource: {
3083
+ uri: "https://api.calendly.com/routing_forms/AAAAAAAAAAAAAAAA",
3084
+ organization: "https://api.calendly.com/organizations/AAAAAAAAAAAAAAAA",
3085
+ name: "ACME Demo",
3086
+ status: "published",
3087
+ questions: [{
3088
+ uuid: "123e4567-e89b-12d3-a456-426614174000",
3089
+ name: "What is your industry?",
3090
+ type: "select",
3091
+ required: true,
3092
+ answer_choices: [
3093
+ "IT & Software",
3094
+ "Financial Services",
3095
+ "Entertainment"
3096
+ ]
3097
+ }, {
3098
+ uuid: "1213f8f1-57fd-45ee-88e9-1978d35b5cad",
3099
+ name: "Email",
3100
+ type: "email",
3101
+ required: true,
3102
+ answer_choices: null
3103
+ }],
3104
+ created_at: "2022-05-15T03:04:05.678Z",
3105
+ updated_at: "2022-05-15T06:05:04.321Z"
3106
+ } } };
3107
+ const listRoutingFormSubmissionsExamplePayload = { data: [{
3108
+ uri: "https://api.calendly.com/routing_form_submissions/AAAAAAAAAAAAAAAA",
3109
+ routing_form: "https://api.calendly.com/routing_forms/AAAAAAAAAAAAAAAA",
3110
+ questions_and_answers: [{
3111
+ question_uuid: "123e4567-e89b-12d3-a456-426614174000",
3112
+ question: "What is your industry?",
3113
+ answer: "IT & Software"
3114
+ }],
3115
+ tracking: {
3116
+ utm_campaign: null,
3117
+ utm_source: null,
3118
+ utm_medium: null,
3119
+ utm_content: null,
3120
+ utm_term: null,
3121
+ salesforce_uuid: null
3122
+ },
3123
+ result: {
3124
+ type: "event_type",
3125
+ value: "https://api.calendly.com/event_types/GBGBDCAADAEDCRZ2"
3126
+ },
3127
+ submitter: "https://calendly.com/scheduled_events/AAAAAAAAAAAAAAAA/invitees/AAAAAAAAAAAAAAAA",
3128
+ submitter_type: "Invitee",
3129
+ created_at: "2022-05-15T03:04:05.678Z",
3130
+ updated_at: "2022-05-15T06:05:04.321Z"
3131
+ }] };
3132
+ const getRoutingFormSubmissionExamplePayload = { data: { resource: {
3133
+ uri: "https://api.calendly.com/routing_form_submissions/AAAAAAAAAAAAAAAA",
3134
+ routing_form: "https://api.calendly.com/routing_forms/AAAAAAAAAAAAAAAA",
3135
+ questions_and_answers: [{
3136
+ question_uuid: "123e4567-e89b-12d3-a456-426614174000",
3137
+ question: "What is your industry?",
3138
+ answer: "IT & Software"
3139
+ }],
3140
+ tracking: {
3141
+ utm_campaign: null,
3142
+ utm_source: null,
3143
+ utm_medium: null,
3144
+ utm_content: null,
3145
+ utm_term: null,
3146
+ salesforce_uuid: null
3147
+ },
3148
+ result: {
3149
+ type: "event_type",
3150
+ value: "https://api.calendly.com/event_types/GBGBDCAADAEDCRZ2"
3151
+ },
3152
+ submitter: "https://calendly.com/scheduled_events/AAAAAAAAAAAAAAAA/invitees/AAAAAAAAAAAAAAAA",
3153
+ submitter_type: "Invitee",
3154
+ created_at: "2022-05-15T03:04:05.678Z",
3155
+ updated_at: "2022-05-15T06:05:04.321Z"
3156
+ } } };
3157
+ //#endregion
3158
+ //#region src/actions/events/cancelEvent.ts
3159
+ const cancelEvent = (0, _prismatic_io_spectral.action)({
3160
+ display: {
3161
+ label: "Cancel Event",
3162
+ description: "Cancels specified event."
3163
+ },
3164
+ performSafety: "notAllowed",
3165
+ perform: async (context, { connection, uuid, reason }) => {
3166
+ const client = getCalendlyClient(connection, context.debug.enabled);
3167
+ const body = {};
3168
+ if (reason) body.reason = reason;
3169
+ const { data } = await client.post(`/scheduled_events/${uuid}/cancellation`, body);
3170
+ return { data };
3171
+ },
3172
+ examplePerform: async () => ({ data: cancelEventExamplePayload.data }),
3173
+ inputs: cancelEventInputs,
3174
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3175
+ type: "actionOutput",
3176
+ schema: cancelEventOutputSchema
3177
+ }),
3178
+ examplePayload: cancelEventExamplePayload
3179
+ });
3180
+ //#endregion
3181
+ //#region src/actions/events/getEvent.ts
3182
+ const getEvent = (0, _prismatic_io_spectral.action)({
3183
+ display: {
3184
+ label: "Get Event",
3185
+ description: "Returns information about a specified Event."
3186
+ },
3187
+ performSafety: "safe",
3188
+ perform: async (context, { connection, uuid }) => {
3189
+ const { data } = await getCalendlyClient(connection, context.debug.enabled).get(`/scheduled_events/${uuid}`);
3190
+ return { data };
3191
+ },
3192
+ inputs: getEventInputs,
3193
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3194
+ type: "actionOutput",
3195
+ schema: getEventOutputSchema
3196
+ }),
3197
+ examplePayload: getEventExamplePayload
3198
+ });
3199
+ //#endregion
3200
+ //#region src/actions/events/getEventInvitee.ts
3201
+ const getEventInvitee = (0, _prismatic_io_spectral.action)({
3202
+ display: {
3203
+ label: "Get Event Invitee",
3204
+ description: "Returns information about a specified Invitee (person invited to an event)."
3205
+ },
3206
+ performSafety: "safe",
3207
+ perform: async (context, { connection, eventUuid, inviteeUuid }) => {
3208
+ const { data } = await getCalendlyClient(connection, context.debug.enabled).get(`/scheduled_events/${eventUuid}/invitees/${inviteeUuid}`);
3209
+ return { data };
3210
+ },
3211
+ inputs: getEventInviteeInputs,
3212
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3213
+ type: "actionOutput",
3214
+ schema: getEventInviteeOutputSchema
3215
+ }),
3216
+ examplePayload: getEventInviteeExamplePayload
3217
+ });
3218
+ //#endregion
3219
+ //#region src/actions/events/listEventInvitees.ts
3220
+ const listEventInvitees = (0, _prismatic_io_spectral.action)({
3221
+ display: {
3222
+ label: "List Event Invitees",
3223
+ description: "Returns a list of Invitees for an event."
3224
+ },
3225
+ performSafety: "notAllowed",
3226
+ perform: async (context, { connection, uuid, email, sort, status }) => {
3227
+ return { data: await paginator(getCalendlyClient(connection, context.debug.enabled), `/scheduled_events/${uuid}/invitees`, {
3228
+ email,
3229
+ sort,
3230
+ status
3231
+ }) };
3232
+ },
3233
+ examplePerform: async () => ({ data: listEventInviteesExamplePayload.data }),
3234
+ inputs: listEventInviteesInputs,
3235
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3236
+ type: "actionOutput",
3237
+ schema: listEventInviteesOutputSchema
3238
+ }),
3239
+ examplePayload: listEventInviteesExamplePayload
3240
+ });
3241
+ //#endregion
3242
+ //#region src/actions/events/listEvents.ts
3243
+ const listEvents = (0, _prismatic_io_spectral.action)({
3244
+ display: {
3245
+ label: "List Events",
3246
+ description: "Returns a list of Events."
3247
+ },
3248
+ performSafety: "notAllowed",
3249
+ perform: async (context, { connection, inviteeEmail, maxStartTime, minStartTime, organization, sort, status, user }) => {
3250
+ return { data: await getEvents(getCalendlyClient(connection, context.debug.enabled), inviteeEmail, maxStartTime, minStartTime, organization, sort, status, user) };
3251
+ },
3252
+ examplePerform: async () => ({ data: listEventsExamplePayload.data }),
3253
+ inputs: listEventsInputs,
3254
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3255
+ type: "actionOutput",
3256
+ schema: listEventsOutputSchema
3257
+ }),
3258
+ examplePayload: listEventsExamplePayload
3259
+ });
3260
+ //#endregion
3261
+ //#region src/actions/events/deleteScheduledEventData.ts
3262
+ const deleteScheduledEventData = (0, _prismatic_io_spectral.action)({
3263
+ display: {
3264
+ label: "Delete Scheduled Event Data",
3265
+ description: "Submits a request to remove scheduled events data within a time range for the organization."
3266
+ },
3267
+ performSafety: "notAllowed",
3268
+ perform: async (context, { connection, startTime, endTime }) => {
3269
+ const { data } = await getCalendlyClient(connection, context.debug.enabled).post("/data_compliance/deletion/events", {
3270
+ start_time: startTime,
3271
+ end_time: endTime
3272
+ });
3273
+ return { data };
3274
+ },
3275
+ examplePerform: async () => ({ data: deleteScheduledEventDataExamplePayload.data }),
3276
+ inputs: deleteScheduledEventDataInputs,
3277
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3278
+ type: "actionOutput",
3279
+ schema: deleteScheduledEventDataOutputSchema
3280
+ }),
3281
+ examplePayload: deleteScheduledEventDataExamplePayload
3282
+ });
3283
+ //#endregion
3284
+ //#region src/actions/users/getCurrentUser.ts
3285
+ const getCurrentUser = (0, _prismatic_io_spectral.action)({
3286
+ display: {
3287
+ label: "Get Current User",
3288
+ description: "Returns basic information about the authenticated user account."
3289
+ },
3290
+ performSafety: "safe",
3291
+ perform: async (context, { connection }) => {
3292
+ const { data } = await getCalendlyClient(connection, context.debug.enabled).get("/users/me");
3293
+ return { data };
3294
+ },
3295
+ inputs: getCurrentUserInputs,
3296
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3297
+ type: "actionOutput",
3298
+ schema: getCurrentUserOutputSchema
3299
+ }),
3300
+ examplePayload: getCurrentUserExamplePayload
3301
+ });
3302
+ //#endregion
3303
+ //#region src/actions/users/getUser.ts
3304
+ const getUser = (0, _prismatic_io_spectral.action)({
3305
+ display: {
3306
+ label: "Get User",
3307
+ description: "Returns information about a specified User."
3308
+ },
3309
+ performSafety: "safe",
3310
+ perform: async (context, { connection, uuid }) => {
3311
+ const { data } = await getCalendlyClient(connection, context.debug.enabled).get(`/users/${uuid}`);
3312
+ return { data };
3313
+ },
3314
+ inputs: getUserInputs,
3315
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3316
+ type: "actionOutput",
3317
+ schema: getUserOutputSchema
3318
+ }),
3319
+ examplePayload: getUserExamplePayload
3320
+ });
3321
+ //#endregion
3322
+ //#region src/actions/users/getUserAvailabilitySchedule.ts
3323
+ const getUserAvailabilitySchedule = (0, _prismatic_io_spectral.action)({
3324
+ display: {
3325
+ label: "Get User Availability Schedule",
3326
+ description: "Returns the availability schedule of the given UUID."
3327
+ },
3328
+ performSafety: "safe",
3329
+ perform: async (context, { connection, uuid }) => {
3330
+ const { data } = await getCalendlyClient(connection, context.debug.enabled).get(`/user_availability_schedules/${uuid}`);
3331
+ return { data };
3332
+ },
3333
+ inputs: getUserAvailabilityScheduleInputs,
3334
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3335
+ type: "actionOutput",
3336
+ schema: getUserAvailabilityScheduleOutputSchema
3337
+ }),
3338
+ examplePayload: getUserAvailabilityScheduleExamplePayload
3339
+ });
3340
+ //#endregion
3341
+ //#region src/actions/users/listUserAvailabilitySchedules.ts
3342
+ const listUserAvailabilitySchedules = (0, _prismatic_io_spectral.action)({
3343
+ display: {
3344
+ label: "List User Availability Schedules",
3345
+ description: "Returns the availability schedules of the given user."
3346
+ },
3347
+ performSafety: "safe",
3348
+ perform: async (context, { connection, user }) => {
3349
+ const { data } = await getCalendlyClient(connection, context.debug.enabled).get("/user_availability_schedules", { params: { user } });
3350
+ return { data };
3351
+ },
3352
+ inputs: listUserAvailabilitySchedulesInputs,
3353
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3354
+ type: "actionOutput",
3355
+ schema: listUserAvailabilitySchedulesOutputSchema
3356
+ }),
3357
+ examplePayload: listUserAvailabilitySchedulesExamplePayload
3358
+ });
3359
+ //#endregion
3360
+ //#region src/actions/users/listUserBusyTimes.ts
3361
+ const listUserBusyTimes = (0, _prismatic_io_spectral.action)({
3362
+ display: {
3363
+ label: "List User Busy Times",
3364
+ description: "Returns an ascending list of user internal and external scheduled events within a specified date range."
3365
+ },
3366
+ performSafety: "safe",
3367
+ perform: async (context, { connection, endTime, startTime, user }) => {
3368
+ const { data } = await getCalendlyClient(connection, context.debug.enabled).get("/user_busy_times", { params: {
3369
+ endTime,
3370
+ startTime,
3371
+ user
3372
+ } });
3373
+ return { data };
3374
+ },
3375
+ inputs: listUserBusyTimesInputs,
3376
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3377
+ type: "actionOutput",
3378
+ schema: listUserBusyTimesOutputSchema
3379
+ }),
3380
+ examplePayload: listUserBusyTimesExamplePayload
3381
+ });
3382
+ //#endregion
3383
+ //#region src/actions/users/listUserEventTypes.ts
3384
+ const listUserEventTypes = (0, _prismatic_io_spectral.action)({
3385
+ display: {
3386
+ label: "List User's Event Types",
3387
+ description: "Returns all Event Types associated with a specified User."
3388
+ },
3389
+ performSafety: "notAllowed",
3390
+ perform: async (context, { connection, adminManaged, organization, user, userAvailabilitySchedule, active, sort }) => {
3391
+ return { data: await getEventTypes(getCalendlyClient(connection, context.debug.enabled), adminManaged, organization, user, userAvailabilitySchedule, active, sort) };
3392
+ },
3393
+ examplePerform: async () => ({ data: listUserEventTypesExamplePayload.data }),
3394
+ inputs: listUserEventTypesInputs,
3395
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3396
+ type: "actionOutput",
3397
+ schema: listUserEventTypesOutputSchema
3398
+ }),
3399
+ examplePayload: listUserEventTypesExamplePayload
3400
+ });
3401
+ //#endregion
3402
+ //#region src/actions/users/deleteInviteeData.ts
3403
+ const deleteInviteeData = (0, _prismatic_io_spectral.action)({
3404
+ display: {
3405
+ label: "Delete Invitee Data",
3406
+ description: "Submits a request to remove invitee data from all previously booked events in the organization."
3407
+ },
3408
+ performSafety: "notAllowed",
3409
+ perform: async (context, { connection, emails }) => {
3410
+ const { data } = await getCalendlyClient(connection, context.debug.enabled).post("/data_compliance/deletion/invitees", { emails });
3411
+ return { data };
3412
+ },
3413
+ examplePerform: async () => ({ data: deleteInviteeDataExamplePayload.data }),
3414
+ inputs: deleteInviteeDataInputs,
3415
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3416
+ type: "actionOutput",
3417
+ schema: deleteInviteeDataOutputSchema
3418
+ }),
3419
+ examplePayload: deleteInviteeDataExamplePayload
3420
+ });
3421
+ //#endregion
3422
+ //#region src/actions/webhooks/createWebhookSubscription.ts
3423
+ const createWebhookSubscription = (0, _prismatic_io_spectral.action)({
3424
+ display: {
3425
+ label: "Create Webhook Subscription",
3426
+ description: "Create a Webhook Subscription for an Organization or User."
3427
+ },
3428
+ performSafety: "notAllowed",
3429
+ perform: async (context, { connection, url, event, organization, user, scope, signingKey }) => {
3430
+ return { data: await postWebhookSubscription(getCalendlyClient(connection, context.debug.enabled), url, event, organization, user, scope, signingKey) };
3431
+ },
3432
+ examplePerform: async () => ({ data: createWebhookSubscriptionExamplePayload.data }),
3433
+ inputs: createWebhookSubscriptionInputs,
3434
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3435
+ type: "actionOutput",
3436
+ schema: createWebhookSubscriptionOutputSchema
3437
+ }),
3438
+ examplePayload: createWebhookSubscriptionExamplePayload
3439
+ });
3440
+ //#endregion
3441
+ //#region src/actions/webhooks/deleteInstancedWebhooks.ts
3442
+ const deleteInstancedWebhooks = (0, _prismatic_io_spectral.action)({
3443
+ display: {
3444
+ label: "Delete Instanced Webhooks",
3445
+ description: "Delete all webhooks that point to a flow in this instance."
3446
+ },
3447
+ performSafety: "notAllowed",
3448
+ perform: async (context, { connection, organization, scope, user }) => {
3449
+ const client = getCalendlyClient(connection, context.debug.enabled);
3450
+ const endpoint = context.webhookUrls[context.flow.name];
3451
+ return { data: await deleteWebhookInstance(client, endpoint, organization, user, scope) };
3452
+ },
3453
+ examplePerform: async () => ({ data: deleteInstancedWebhooksExamplePayload.data }),
3454
+ inputs: deleteInstancedWebhooksInputs,
3455
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3456
+ type: "actionOutput",
3457
+ schema: deleteInstancedWebhooksOutputSchema
3458
+ }),
3459
+ examplePayload: deleteInstancedWebhooksExamplePayload
3460
+ });
3461
+ //#endregion
3462
+ //#region src/actions/webhooks/deleteWebhookSubscription.ts
3463
+ const deleteWebhookSubscription = (0, _prismatic_io_spectral.action)({
3464
+ display: {
3465
+ label: "Delete Webhook Subscription",
3466
+ description: "Delete a Webhook Subscription."
3467
+ },
3468
+ performSafety: "notAllowed",
3469
+ perform: async (context, { connection, webhookUuid }) => {
3470
+ return { data: await deleteWebhook(getCalendlyClient(connection, context.debug.enabled), webhookUuid) };
3471
+ },
3472
+ examplePerform: async () => ({ data: deleteWebhookSubscriptionExamplePayload.data }),
3473
+ inputs: deleteWebhookSubscriptionInputs,
3474
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3475
+ type: "actionOutput",
3476
+ schema: deleteWebhookSubscriptionOutputSchema
3477
+ }),
3478
+ examplePayload: deleteWebhookSubscriptionExamplePayload
3479
+ });
3480
+ //#endregion
3481
+ //#region src/actions/webhooks/getWebhookSubscription.ts
3482
+ const getWebhookSubscription = (0, _prismatic_io_spectral.action)({
3483
+ display: {
3484
+ label: "Get Webhook Subscription",
3485
+ description: "Get a specified Webhook Subscription."
3486
+ },
3487
+ performSafety: "safe",
3488
+ perform: async (context, { connection, webhookUuid }) => {
3489
+ const { data } = await getCalendlyClient(connection, context.debug.enabled).get(`/webhook_subscriptions/${webhookUuid}`);
3490
+ return { data };
3491
+ },
3492
+ inputs: getWebhookSubscriptionInputs,
3493
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3494
+ type: "actionOutput",
3495
+ schema: getWebhookSubscriptionOutputSchema
3496
+ }),
3497
+ examplePayload: getWebhookSubscriptionExamplePayload
3498
+ });
3499
+ //#endregion
3500
+ //#region src/actions/webhooks/listWebhookSubscription.ts
3501
+ const listWebhookSubscription = (0, _prismatic_io_spectral.action)({
3502
+ display: {
3503
+ label: "List Webhook Subscription",
3504
+ description: "Get a list of Webhook Subscriptions for a specified Organization or User."
3505
+ },
3506
+ performSafety: "notAllowed",
3507
+ perform: async (context, { connection, organization, scope, sort, user }) => {
3508
+ return { data: await paginator(getCalendlyClient(connection, context.debug.enabled), "/webhook_subscriptions", {
3509
+ organization,
3510
+ scope,
3511
+ sort,
3512
+ user
3513
+ }) };
3514
+ },
3515
+ examplePerform: async () => ({ data: listWebhookSubscriptionExamplePayload.data }),
3516
+ inputs: listWebhookSubscriptionInputs,
3517
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3518
+ type: "actionOutput",
3519
+ schema: listWebhookSubscriptionOutputSchema
3520
+ }),
3521
+ examplePayload: listWebhookSubscriptionExamplePayload
3522
+ });
3523
+ //#endregion
3524
+ //#region src/actions/organizations/getOrganizationInvitation.ts
3525
+ const getOrganizationInvitation = (0, _prismatic_io_spectral.action)({
3526
+ display: {
3527
+ label: "Get Organization Invitation",
3528
+ description: "Returns an Organization Invitation that was sent to the organization's members."
3529
+ },
3530
+ performSafety: "safe",
3531
+ perform: async (context, { connection, uuid, orgUuid }) => {
3532
+ const { data } = await getCalendlyClient(connection, context.debug.enabled).get(`/organizations/${orgUuid}/invitations/${uuid}`);
3533
+ return { data };
3534
+ },
3535
+ inputs: getOrganizationInvitationInputs,
3536
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3537
+ type: "actionOutput",
3538
+ schema: getOrganizationInvitationOutputSchema
3539
+ }),
3540
+ examplePayload: getOrganizationInvitationExamplePayload
3541
+ });
3542
+ //#endregion
3543
+ //#region src/actions/organizations/getOrganizationMembership.ts
3544
+ const getOrganizationMembership = (0, _prismatic_io_spectral.action)({
3545
+ display: {
3546
+ label: "Get Organization Membership",
3547
+ description: "Returns information about a user's Organization Membership."
3548
+ },
3549
+ performSafety: "safe",
3550
+ perform: async (context, { connection, uuid }) => {
3551
+ const { data } = await getCalendlyClient(connection, context.debug.enabled).get(`/organization_memberships/${uuid}`);
3552
+ return { data };
3553
+ },
3554
+ inputs: getOrganizationMembershipInputs,
3555
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3556
+ type: "actionOutput",
3557
+ schema: getOrganizationMembershipOutputSchema
3558
+ }),
3559
+ examplePayload: getOrganizationMembershipExamplePayload
3560
+ });
3561
+ //#endregion
3562
+ //#region src/actions/organizations/inviteUserToOrganization.ts
3563
+ const inviteUserToOrganization = (0, _prismatic_io_spectral.action)({
3564
+ display: {
3565
+ label: "Invite User to Organization",
3566
+ description: "Invites a user to an organization."
3567
+ },
3568
+ performSafety: "notAllowed",
3569
+ perform: async (context, { connection, uuid }) => {
3570
+ const { data } = await getCalendlyClient(connection, context.debug.enabled).post(`/organizations/${uuid}/invitations`);
3571
+ return { data };
3572
+ },
3573
+ examplePerform: async () => ({ data: inviteUserToOrganizationExamplePayload.data }),
3574
+ inputs: inviteUserToOrganizationInputs,
3575
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3576
+ type: "actionOutput",
3577
+ schema: inviteUserToOrganizationOutputSchema
3578
+ }),
3579
+ examplePayload: inviteUserToOrganizationExamplePayload
3580
+ });
3581
+ //#endregion
3582
+ //#region src/actions/organizations/listActivityLogEntries.ts
3583
+ const listActivityLogEntries = (0, _prismatic_io_spectral.action)({
3584
+ display: {
3585
+ label: "List Activity Log Entries",
3586
+ description: "Returns a list of activity log entries."
3587
+ },
3588
+ performSafety: "notAllowed",
3589
+ perform: async (context, { connection, organization, actionInput, actor, maxOccurredAt, minOccurredAt, namespace, searchTerm, sortList }) => {
3590
+ return { data: await paginator(getCalendlyClient(connection, context.debug.enabled), "/activity_log_entries", {
3591
+ organization,
3592
+ action: actionInput.length ? actionInput : void 0,
3593
+ actor: actor.length ? actor : void 0,
3594
+ max_occurred_at: maxOccurredAt,
3595
+ min_occurred_at: minOccurredAt,
3596
+ namespace: namespace.length ? namespace : void 0,
3597
+ search_term: searchTerm,
3598
+ sort: sortList.length ? sortList : void 0
3599
+ }) };
3600
+ },
3601
+ examplePerform: async () => ({ data: listActivityLogEntriesExamplePayload.data }),
3602
+ inputs: listActivityLogEntriesInputs,
3603
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3604
+ type: "actionOutput",
3605
+ schema: listActivityLogEntriesOutputSchema
3606
+ }),
3607
+ examplePayload: listActivityLogEntriesExamplePayload
3608
+ });
3609
+ //#endregion
3610
+ //#region src/actions/organizations/listOrganizationInvitations.ts
3611
+ const listOrganizationInvitations = (0, _prismatic_io_spectral.action)({
3612
+ display: {
3613
+ label: "List Organization Invitations",
3614
+ description: "Returns a list of Organization Invitations that were sent to the organization's members."
3615
+ },
3616
+ performSafety: "notAllowed",
3617
+ perform: async (context, { connection, uuid, email, sort, status }) => {
3618
+ return { data: await paginator(getCalendlyClient(connection, context.debug.enabled), `/organizations/${uuid}/invitations`, {
3619
+ email,
3620
+ sort,
3621
+ status
3622
+ }) };
3623
+ },
3624
+ examplePerform: async () => ({ data: listOrganizationInvitationsExamplePayload.data }),
3625
+ inputs: listOrganizationInvitationsInputs,
3626
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3627
+ type: "actionOutput",
3628
+ schema: listOrganizationInvitationsOutputSchema
3629
+ }),
3630
+ examplePayload: listOrganizationInvitationsExamplePayload
3631
+ });
3632
+ //#endregion
3633
+ //#region src/actions/organizations/listOrganizationMemberships.ts
3634
+ const listOrganizationMemberships = (0, _prismatic_io_spectral.action)({
3635
+ display: {
3636
+ label: "List Organization Memberships",
3637
+ description: "Lists the Organization Memberships for all users belonging to an organization."
3638
+ },
3639
+ performSafety: "notAllowed",
3640
+ perform: async (context, { connection, email, organization, user }) => {
3641
+ return { data: await getOrganizationMemberships(getCalendlyClient(connection, context.debug.enabled), email, organization, user) };
3642
+ },
3643
+ examplePerform: async () => ({ data: listOrganizationMembershipsExamplePayload.data }),
3644
+ inputs: listOrganizationMembershipsInputs,
3645
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3646
+ type: "actionOutput",
3647
+ schema: listOrganizationMembershipsOutputSchema
3648
+ }),
3649
+ examplePayload: listOrganizationMembershipsExamplePayload
3650
+ });
3651
+ //#endregion
3652
+ //#region src/actions/organizations/removeUserFromOrganization.ts
3653
+ const removeUserFromOrganization = (0, _prismatic_io_spectral.action)({
3654
+ display: {
3655
+ label: "Remove User from Organization",
3656
+ description: "Removes a user from an organization."
3657
+ },
3658
+ performSafety: "notAllowed",
3659
+ perform: async (context, { connection, uuid }) => {
3660
+ const { data } = await getCalendlyClient(connection, context.debug.enabled).delete(`/organization_memberships/${uuid}`);
3661
+ return { data };
3662
+ },
3663
+ examplePerform: async () => ({ data: removeUserFromOrganizationExamplePayload.data }),
3664
+ inputs: removeUserFromOrganizationInputs,
3665
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3666
+ type: "actionOutput",
3667
+ schema: removeUserFromOrganizationOutputSchema
3668
+ }),
3669
+ examplePayload: removeUserFromOrganizationExamplePayload
3670
+ });
3671
+ //#endregion
3672
+ //#region src/actions/organizations/revokeUserOrganizationInvitation.ts
3673
+ const revokeUserOrganizationInvitation = (0, _prismatic_io_spectral.action)({
3674
+ display: {
3675
+ label: "Revoke User's Organization Invitation",
3676
+ description: "Revokes an Organization Invitation to an organization."
3677
+ },
3678
+ performSafety: "notAllowed",
3679
+ perform: async (context, { connection, uuid, orgUuid }) => {
3680
+ const { data } = await getCalendlyClient(connection, context.debug.enabled).delete(`/organizations/${orgUuid}/invitations/${uuid}`);
3681
+ return { data };
3682
+ },
3683
+ examplePerform: async () => ({ data: revokeUserOrganizationInvitationExamplePayload.data }),
3684
+ inputs: revokeUserOrganizationInvitationInputs,
3685
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3686
+ type: "actionOutput",
3687
+ schema: revokeUserOrganizationInvitationOutputSchema
3688
+ }),
3689
+ examplePayload: revokeUserOrganizationInvitationExamplePayload
3690
+ });
3691
+ //#endregion
3692
+ //#region src/actions/routingForms/getRoutingForm.ts
3693
+ const getRoutingForm = (0, _prismatic_io_spectral.action)({
3694
+ display: {
3695
+ label: "Get Routing Form",
3696
+ description: "Get a specified Routing Form."
3697
+ },
3698
+ performSafety: "safe",
3699
+ perform: async (context, { connection, uuid }) => {
3700
+ const { data } = await getCalendlyClient(connection, context.debug.enabled).get(`/routing_forms/${uuid}`);
3701
+ return { data };
3702
+ },
3703
+ inputs: getRoutingFormInputs,
3704
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3705
+ type: "actionOutput",
3706
+ schema: getRoutingFormOutputSchema
3707
+ }),
3708
+ examplePayload: getRoutingFormExamplePayload
3709
+ });
3710
+ //#endregion
3711
+ //#region src/actions/routingForms/getRoutingFormSubmission.ts
3712
+ const getRoutingFormSubmission = (0, _prismatic_io_spectral.action)({
3713
+ display: {
3714
+ label: "Get Routing Form Submission",
3715
+ description: "Get a specified Routing Form Submission."
3716
+ },
3717
+ performSafety: "safe",
3718
+ perform: async (context, { connection, uuid }) => {
3719
+ const { data } = await getCalendlyClient(connection, context.debug.enabled).get(`/routing_form_submissions/${uuid}`);
3720
+ return { data };
3721
+ },
3722
+ inputs: getRoutingFormSubmissionInputs,
3723
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3724
+ type: "actionOutput",
3725
+ schema: getRoutingFormSubmissionOutputSchema
3726
+ }),
3727
+ examplePayload: getRoutingFormSubmissionExamplePayload
3728
+ });
3729
+ //#endregion
3730
+ //#region src/actions/routingForms/listRoutingFormSubmissions.ts
3731
+ const listRoutingFormSubmissions = (0, _prismatic_io_spectral.action)({
3732
+ display: {
3733
+ label: "List Routing Form Submissions",
3734
+ description: "Get a list of Routing Form Submissions for a specified Routing Form."
3735
+ },
3736
+ performSafety: "notAllowed",
3737
+ perform: async (context, { connection, form, sort }) => {
3738
+ return { data: await paginator(getCalendlyClient(connection, context.debug.enabled), "/routing_form_submissions", {
3739
+ form,
3740
+ sort
3741
+ }) };
3742
+ },
3743
+ examplePerform: async () => ({ data: listRoutingFormSubmissionsExamplePayload.data }),
3744
+ inputs: listRoutingFormSubmissionsInputs,
3745
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3746
+ type: "actionOutput",
3747
+ schema: listRoutingFormSubmissionsOutputSchema
3748
+ }),
3749
+ examplePayload: listRoutingFormSubmissionsExamplePayload
3750
+ });
3751
+ //#endregion
3752
+ //#region src/actions/index.ts
3753
+ var actions_default = {
3754
+ listEventInvitees,
3755
+ listEvents,
3756
+ getEventInvitee,
3757
+ getEvent,
3758
+ cancelEvent,
3759
+ deleteScheduledEventData,
3760
+ getUser,
3761
+ getCurrentUser,
3762
+ getUserAvailabilitySchedule,
3763
+ listUserAvailabilitySchedules,
3764
+ listUserBusyTimes,
3765
+ listUserEventTypes,
3766
+ deleteInviteeData,
3767
+ createWebhookSubscription,
3768
+ listWebhookSubscription,
3769
+ getWebhookSubscription,
3770
+ deleteWebhookSubscription,
3771
+ deleteInstancedWebhooks,
3772
+ getOrganizationInvitation,
3773
+ getOrganizationMembership,
3774
+ inviteUserToOrganization,
3775
+ listActivityLogEntries,
3776
+ listOrganizationInvitations,
3777
+ listOrganizationMemberships,
3778
+ removeUserFromOrganization,
3779
+ revokeUserOrganizationInvitation,
3780
+ listRoutingForms: (0, _prismatic_io_spectral.action)({
3781
+ display: {
3782
+ label: "List Routing Forms",
3783
+ description: "Get a list of Routing Forms for a specified Organization."
3784
+ },
3785
+ performSafety: "notAllowed",
3786
+ perform: async (context, { connection, organization, sort }) => {
3787
+ return { data: await getRoutingForms(getCalendlyClient(connection, context.debug.enabled), organization, sort) };
3788
+ },
3789
+ examplePerform: async () => ({ data: listRoutingFormsExamplePayload.data }),
3790
+ inputs: listRoutingFormsInputs,
3791
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3792
+ type: "actionOutput",
3793
+ schema: listRoutingFormsOutputSchema
3794
+ }),
3795
+ examplePayload: listRoutingFormsExamplePayload
3796
+ }),
3797
+ getRoutingForm,
3798
+ listRoutingFormSubmissions,
3799
+ getRoutingFormSubmission,
3800
+ createShare: (0, _prismatic_io_spectral.action)({
3801
+ display: {
3802
+ label: "Create Share",
3803
+ description: "Creates an endpoint for the Customize Once and Share feature."
3804
+ },
3805
+ performSafety: "notAllowed",
3806
+ perform: async (context, { connection, eventType, name, duration, periodType, startDate, endDate, maxBookingTime, hideLocation, locationConfigurations, availabilityRule }) => {
3807
+ const client = getCalendlyClient(connection, context.debug.enabled);
3808
+ const body = {
3809
+ event_type: eventType,
3810
+ name,
3811
+ duration: duration ? _prismatic_io_spectral.util.types.toInt(duration) : void 0,
3812
+ period_type: periodType,
3813
+ start_date: startDate,
3814
+ end_date: endDate,
3815
+ max_booking_time: maxBookingTime ? _prismatic_io_spectral.util.types.toInt(maxBookingTime) : void 0,
3816
+ hide_location: hideLocation,
3817
+ location_configurations: locationConfigurations || void 0,
3818
+ availability_rule: availabilityRule || void 0
3819
+ };
3820
+ const { data } = await client.post("/shares", body);
3821
+ return { data };
3822
+ },
3823
+ examplePerform: async () => ({ data: createShareExamplePayload.data }),
3824
+ inputs: createShareInputs,
3825
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3826
+ type: "actionOutput",
3827
+ schema: createShareOutputSchema
3828
+ }),
3829
+ examplePayload: createShareExamplePayload
3830
+ }),
3831
+ createSingleUseSchedulingLink: (0, _prismatic_io_spectral.action)({
3832
+ display: {
3833
+ label: "Create Single-Use Scheduling Link",
3834
+ description: "Creates a single-use scheduling link."
3835
+ },
3836
+ performSafety: "notAllowed",
3837
+ perform: async (context, { connection, maxEventCount, owner, ownerType }) => {
3838
+ const { data } = await getCalendlyClient(connection, context.debug.enabled).post("/scheduling_links", {
3839
+ max_event_count: maxEventCount,
3840
+ owner,
3841
+ owner_type: ownerType
3842
+ });
3843
+ return { data };
3844
+ },
3845
+ examplePerform: async () => ({ data: createSingleUseSchedulingLinkExamplePayload.data }),
3846
+ inputs: createSingleUseSchedulingLinkInputs,
3847
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3848
+ type: "actionOutput",
3849
+ schema: createSingleUseSchedulingLinkOutputSchema
3850
+ }),
3851
+ examplePayload: createSingleUseSchedulingLinkExamplePayload
3852
+ }),
3853
+ getEventType: (0, _prismatic_io_spectral.action)({
3854
+ display: {
3855
+ label: "Get Event Type",
3856
+ description: "Returns information about a specified Event Type."
3857
+ },
3858
+ performSafety: "safe",
3859
+ perform: async (context, { connection, uuid }) => {
3860
+ const { data } = await getCalendlyClient(connection, context.debug.enabled).get(`/event_types/${uuid}`);
3861
+ return { data };
3862
+ },
3863
+ inputs: getEventTypeInputs,
3864
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3865
+ type: "actionOutput",
3866
+ schema: getEventTypeOutputSchema
3867
+ }),
3868
+ examplePayload: getEventTypeExamplePayload
3869
+ }),
3870
+ listEventTypeAvailableTimes: (0, _prismatic_io_spectral.action)({
3871
+ display: {
3872
+ label: "List Event Type Available Times",
3873
+ description: "Returns a list of available times for an event type within a specified date range."
3874
+ },
3875
+ performSafety: "safe",
3876
+ perform: async (context, { connection, endTime, eventType, startTime }) => {
3877
+ const { data } = await getCalendlyClient(connection, context.debug.enabled).get("/event_type_available_times", { params: {
3878
+ end_time: endTime,
3879
+ event_type: eventType,
3880
+ start_time: startTime
3881
+ } });
3882
+ return { data };
3883
+ },
3884
+ inputs: listEventTypeAvailableTimesInputs,
3885
+ outputSchema: (0, _prismatic_io_spectral.outputSchema)({
3886
+ type: "actionOutput",
3887
+ schema: listEventTypeAvailableTimesOutputSchema
3888
+ }),
3889
+ examplePayload: listEventTypeAvailableTimesExamplePayload
3890
+ }),
3891
+ rawRequest: (0, _prismatic_io_spectral.action)({
3892
+ display: {
3893
+ label: "Raw Request",
3894
+ description: "Send raw HTTP request to Calendly."
3895
+ },
3896
+ inputs: rawRequestInputs,
3897
+ performSafety: "notAllowed",
3898
+ perform: async (context, { connection, ...rawRequestInputs }) => {
3899
+ const { data } = await (0, _prismatic_io_spectral_http.sendRawRequest)(_prismatic_io_spectral.util.types.toBool(connection.fields.useLiveServer) ? LIVE_API_URL : MOCK_API_URL, {
3900
+ ...rawRequestInputs,
3901
+ debugRequest: context.debug.enabled
3902
+ }, { Authorization: `Bearer ${connection.token?.access_token}` });
3903
+ return { data };
3904
+ }
3905
+ })
3906
+ };
3907
+ //#endregion
3908
+ //#region src/triggers/calendlyTrigger.ts
3909
+ const performFunction = async (context, payload) => Promise.resolve({
3910
+ payload,
3911
+ response: { statusCode: 200 }
3912
+ });
3913
+ //#endregion
3914
+ //#region src/triggers/index.ts
3915
+ var triggers_default = {
3916
+ calendlyTrigger: (0, _prismatic_io_spectral.trigger)({
3917
+ display: {
3918
+ label: "Scheduled Event",
3919
+ description: "Receive data from scheduled events in real time with webhook subscriptions."
3920
+ },
3921
+ examplePayload: calendlyTriggerExamplePayload,
3922
+ allowsBranching: false,
3923
+ inputs: calendlyTriggerInputs,
3924
+ synchronousResponseSupport: "invalid",
3925
+ scheduleSupport: "invalid",
3926
+ perform: performFunction,
3927
+ webhookLifecycleHandlers: {
3928
+ create: async (context, { connection, organization, user, scope, signingKey, eventNamesInput }) => {
3929
+ const endpoint = context.webhookUrls[context.flow.name];
3930
+ await postWebhookSubscription(getCalendlyClient(connection, context.debug.enabled), endpoint, eventNamesInput, organization, user, scope, signingKey);
3931
+ },
3932
+ delete: async (context, { connection, organization, user, scope }) => {
3933
+ const client = getCalendlyClient(connection, context.debug.enabled);
3934
+ const endpoint = context.webhookUrls[context.flow.name];
3935
+ await deleteWebhookInstance(client, endpoint, organization, user, scope);
3936
+ }
3937
+ }
3938
+ }),
3939
+ pollChangesTrigger: (0, _prismatic_io_spectral.pollingTrigger)({
3940
+ display: {
3941
+ label: "New and Updated Events",
3942
+ description: "Checks for new and updated Events in Calendly on a configured schedule."
3943
+ },
3944
+ examplePayload: pollChangesTriggerExamplePayload,
3945
+ inputs: pollChangesTriggerInputs,
3946
+ triggerResolverSupport: "valid",
3947
+ batchConfig: { batchSize: 50 },
3948
+ triggerResolver: { resolveItems: (_context, { payload }) => resolvePollingRecordChanges(payload.body.data) },
3949
+ perform: async (context, payload, params) => {
3950
+ const pollState = context.polling.getState();
3951
+ const isBackfill = !pollState?.lastPolledAt && Boolean(params.lookBackDate);
3952
+ const now = (/* @__PURE__ */ new Date()).toISOString();
3953
+ if (!pollState?.lastPolledAt) {
3954
+ const seedDate = params.lookBackDate || now;
3955
+ context.polling.setState({ lastPolledAt: seedDate });
3956
+ if (!params.lookBackDate) return {
3957
+ payload: {
3958
+ ...payload,
3959
+ body: { data: {
3960
+ created: [],
3961
+ updated: []
3962
+ } }
3963
+ },
3964
+ polledNoChanges: true
3965
+ };
3966
+ }
3967
+ const lastPolledAt = pollState?.lastPolledAt ?? params.lookBackDate ?? now;
3968
+ const events = await getEvents(getCalendlyClient(params.connection, context.debug.enabled), void 0, void 0, void 0, params.organization, void 0, void 0, params.user);
3969
+ const { created, updated } = classifyEventsByPollDate(events, lastPolledAt);
3970
+ const emittedCreated = isBackfill || params.showNewRecords ? created : [];
3971
+ const emittedUpdated = isBackfill || params.showUpdatedRecords ? updated : [];
3972
+ const totalMatched = emittedCreated.length + emittedUpdated.length;
3973
+ context.polling.setState({ lastPolledAt: now });
3974
+ if (context.debug.enabled) context.logger.debug(`Polled Calendly events: ${events.length} fetched, ${emittedCreated.length} created, ${emittedUpdated.length} updated`);
3975
+ return {
3976
+ payload: {
3977
+ ...payload,
3978
+ body: { data: {
3979
+ created: emittedCreated,
3980
+ updated: emittedUpdated
3981
+ } }
3982
+ },
3983
+ polledNoChanges: totalMatched === 0
3984
+ };
3985
+ }
3986
+ })
3987
+ };
3988
+ //#endregion
3989
+ //#region src/dataSources/events.ts
3990
+ const events = (0, _prismatic_io_spectral.dataSource)({
3991
+ display: {
3992
+ label: "Select Event",
3993
+ description: "Select an Event."
3994
+ },
3995
+ inputs: eventsInputs,
3996
+ perform: async (context, { connection, inviteeEmail, maxStartTime, minStartTime, organization, returnUuidOnly, sort, status, user }) => {
3997
+ return { result: (await getEvents(getCalendlyClient(connection, false), inviteeEmail, maxStartTime, minStartTime, organization, sort, status, user)).map((event) => ({
3998
+ key: returnUuidOnly ? extractUuidFromUri(event.uri) : event.uri,
3999
+ label: event.name
4000
+ })) };
4001
+ },
4002
+ dataSourceType: "picklist"
4003
+ });
4004
+ //#endregion
4005
+ //#region src/dataSources/index.ts
4006
+ var dataSources_default = {
4007
+ eventTypes: (0, _prismatic_io_spectral.dataSource)({
4008
+ display: {
4009
+ label: "Select Event Type",
4010
+ description: "Select an Event Type associated with a specified User. Either organization or user are required."
4011
+ },
4012
+ inputs: eventTypesInputs,
4013
+ perform: async (context, { connection, user, adminManaged, organization, userAvailabilitySchedule, active, sort, returnUuidOnly }) => {
4014
+ return { result: (await getEventTypes(getCalendlyClient(connection, false), adminManaged, organization, user, userAvailabilitySchedule, active, sort)).map((eventType) => ({
4015
+ key: returnUuidOnly ? extractUuidFromUri(eventType.uri) : eventType.uri,
4016
+ label: eventType.name
4017
+ })) };
4018
+ },
4019
+ dataSourceType: "picklist"
4020
+ }),
4021
+ organizationMemberships: (0, _prismatic_io_spectral.dataSource)({
4022
+ display: {
4023
+ label: "Select Organization Membership",
4024
+ description: "Select an Organization Membership."
4025
+ },
4026
+ inputs: organizationMembershipsInputs,
4027
+ perform: async (context, { connection, email, organization, user, returnUuidOnly }) => {
4028
+ return { result: (await getOrganizationMemberships(getCalendlyClient(connection, false), email, organization, user)).map((membership) => ({
4029
+ key: returnUuidOnly ? extractUuidFromUri(membership.user.uri) : membership.user.uri,
4030
+ label: membership.user.name
4031
+ })) };
4032
+ },
4033
+ dataSourceType: "picklist"
4034
+ }),
4035
+ organizations: (0, _prismatic_io_spectral.dataSource)({
4036
+ display: {
4037
+ label: "Select Organization",
4038
+ description: "Returns the current user's organization for use in other inputs."
4039
+ },
4040
+ inputs: organizationsInputs,
4041
+ perform: async (context, { connection }) => {
4042
+ const { data } = await getCalendlyClient(connection, false).get("/users/me");
4043
+ const orgUri = data?.resource?.current_organization;
4044
+ if (!orgUri) return { result: [] };
4045
+ return { result: [{
4046
+ key: orgUri,
4047
+ label: `Organization (${extractUuidFromUri(orgUri)})`
4048
+ }] };
4049
+ },
4050
+ dataSourceType: "picklist"
4051
+ }),
4052
+ events,
4053
+ routingForms: (0, _prismatic_io_spectral.dataSource)({
4054
+ display: {
4055
+ label: "Select Routing Form",
4056
+ description: "Select a Routing Form from a specified Organization."
4057
+ },
4058
+ inputs: routingFormsInputs,
4059
+ perform: async (context, { connection, organization, sort, returnUuidOnly }) => {
4060
+ return { result: (await getRoutingForms(getCalendlyClient(connection, false), organization, sort)).map((form) => ({
4061
+ key: returnUuidOnly ? extractUuidFromUri(form.uri) : form.uri,
4062
+ label: form.name
4063
+ })) };
4064
+ },
4065
+ dataSourceType: "picklist"
4066
+ }),
4067
+ selectEventInvitee: (0, _prismatic_io_spectral.dataSource)({
4068
+ display: {
4069
+ label: "Select Event Invitee",
4070
+ description: "Select an Event Invitee."
4071
+ },
4072
+ inputs: selectEventInviteeInputs,
4073
+ perform: async (context, { connection, uuid, returnUuidOnly }) => {
4074
+ return { result: (await paginator(getCalendlyClient(connection, false), `/scheduled_events/${uuid}/invitees`, {})).map((invitee) => ({
4075
+ key: returnUuidOnly ? extractUuidFromUri(invitee.uri) : invitee.uri,
4076
+ label: `${invitee.name} <${invitee.email}>`
4077
+ })) };
4078
+ },
4079
+ dataSourceType: "picklist"
4080
+ })
4081
+ };
4082
+ //#endregion
4083
+ //#region src/index.ts
4084
+ var src_default = (0, _prismatic_io_spectral.component)({
4085
+ key: "calendly",
4086
+ public: true,
4087
+ documentationUrl: "https://prismatic.io/docs/components/calendly/",
4088
+ display: {
4089
+ category: "Application Connectors",
4090
+ label: "Calendly",
4091
+ description: "Manage the scheduling of events, attendee availability, and retrieve data on users and attendees.",
4092
+ iconPath: "icon.png"
4093
+ },
4094
+ actions: actions_default,
4095
+ triggers: triggers_default,
4096
+ connections: connections_default,
4097
+ dataSources: dataSources_default,
4098
+ hooks: { error: _prismatic_io_spectral_http.handleErrors }
4099
+ });
4100
+ //#endregion
4101
+ //#region npm-dist/.entry.ts
4102
+ var _entry_default = (0, _prismatic_io_spectral.callableComponent)(src_default);
4103
+ //#endregion
4104
+ module.exports = _entry_default;