@vendasta/meetings 0.99.1 → 0.99.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/esm2020/lib/_internal/google-meet.api.service.mjs +7 -2
  2. package/esm2020/lib/_internal/index.mjs +1 -2
  3. package/esm2020/lib/_internal/interfaces/google-meet.interface.mjs +1 -1
  4. package/esm2020/lib/_internal/interfaces/index.mjs +1 -1
  5. package/esm2020/lib/_internal/interfaces/meeting-guest.interface.mjs +1 -1
  6. package/esm2020/lib/_internal/interfaces/meeting-type.interface.mjs +1 -1
  7. package/esm2020/lib/_internal/interfaces/shared.interface.mjs +1 -1
  8. package/esm2020/lib/_internal/objects/google-meet.mjs +109 -1
  9. package/esm2020/lib/_internal/objects/index.mjs +3 -4
  10. package/esm2020/lib/_internal/objects/meeting-guest.mjs +33 -1
  11. package/esm2020/lib/_internal/objects/meeting-type.mjs +16 -1
  12. package/esm2020/lib/_internal/objects/shared.mjs +4 -1
  13. package/esm2020/lib/guest/guest.service.mjs +1 -1
  14. package/esm2020/lib/index.mjs +1 -2
  15. package/esm2020/lib/shared/host-user.mjs +3 -2
  16. package/esm2020/lib/shared/meeting-type.mjs +8 -2
  17. package/fesm2015/vendasta-meetings.mjs +499 -411
  18. package/fesm2015/vendasta-meetings.mjs.map +1 -1
  19. package/fesm2020/vendasta-meetings.mjs +211 -123
  20. package/fesm2020/vendasta-meetings.mjs.map +1 -1
  21. package/lib/_internal/google-meet.api.service.d.ts +3 -2
  22. package/lib/_internal/index.d.ts +0 -1
  23. package/lib/_internal/interfaces/google-meet.interface.d.ts +20 -0
  24. package/lib/_internal/interfaces/index.d.ts +2 -3
  25. package/lib/_internal/interfaces/meeting-guest.interface.d.ts +6 -0
  26. package/lib/_internal/interfaces/meeting-type.interface.d.ts +3 -0
  27. package/lib/_internal/interfaces/shared.interface.d.ts +1 -0
  28. package/lib/_internal/objects/google-meet.d.ts +29 -0
  29. package/lib/_internal/objects/index.d.ts +2 -3
  30. package/lib/_internal/objects/meeting-guest.d.ts +9 -0
  31. package/lib/_internal/objects/meeting-type.d.ts +3 -0
  32. package/lib/_internal/objects/shared.d.ts +1 -0
  33. package/lib/index.d.ts +0 -1
  34. package/lib/shared/host-user.d.ts +1 -0
  35. package/lib/shared/meeting-type.d.ts +3 -0
  36. package/package.json +1 -1
  37. package/esm2020/lib/_internal/interfaces/meeting-bot.interface.mjs +0 -8
  38. package/esm2020/lib/_internal/meeting-bot-api.api.service.mjs +0 -38
  39. package/esm2020/lib/_internal/objects/meeting-bot.mjs +0 -36
  40. package/esm2020/lib/meeting-bot.service.mjs +0 -24
  41. package/lib/_internal/interfaces/meeting-bot.interface.d.ts +0 -5
  42. package/lib/_internal/meeting-bot-api.api.service.d.ts +0 -14
  43. package/lib/_internal/objects/meeting-bot.d.ts +0 -10
  44. package/lib/meeting-bot.service.d.ts +0 -10
@@ -178,7 +178,7 @@ var DayOfWeek;
178
178
 
179
179
  // *********************************
180
180
 
181
- function enumStringToValue$c(enumRef, value) {
181
+ function enumStringToValue$b(enumRef, value) {
182
182
  if (typeof value === 'number') {
183
183
  return value;
184
184
  }
@@ -189,7 +189,7 @@ class CreateZoomMeetingRequest {
189
189
  let m = new CreateZoomMeetingRequest();
190
190
  m = Object.assign(m, proto);
191
191
  if (proto.type) {
192
- m.type = enumStringToValue$c(ZoomMeetingType, proto.type);
192
+ m.type = enumStringToValue$b(ZoomMeetingType, proto.type);
193
193
  }
194
194
  if (proto.duration) {
195
195
  m.duration = parseInt(proto.duration, 10);
@@ -257,7 +257,7 @@ class CreateZoomMeetingResponse {
257
257
  m.meetingId = parseInt(proto.meetingId, 10);
258
258
  }
259
259
  if (proto.type) {
260
- m.type = enumStringToValue$c(ZoomMeetingType, proto.type);
260
+ m.type = enumStringToValue$b(ZoomMeetingType, proto.type);
261
261
  }
262
262
  if (proto.duration) {
263
263
  m.duration = parseInt(proto.duration, 10);
@@ -349,7 +349,7 @@ class ZoomMeetingRecurrence {
349
349
  let m = new ZoomMeetingRecurrence();
350
350
  m = Object.assign(m, proto);
351
351
  if (proto.type) {
352
- m.type = enumStringToValue$c(ZoomMeetingRecurrenceType, proto.type);
352
+ m.type = enumStringToValue$b(ZoomMeetingRecurrenceType, proto.type);
353
353
  }
354
354
  if (proto.repeatInterval) {
355
355
  m.repeatInterval = parseInt(proto.repeatInterval, 10);
@@ -358,10 +358,10 @@ class ZoomMeetingRecurrence {
358
358
  m.monthlyDay = parseInt(proto.monthlyDay, 10);
359
359
  }
360
360
  if (proto.monthlyWeek) {
361
- m.monthlyWeek = enumStringToValue$c(ZoomMonthlyWeek, proto.monthlyWeek);
361
+ m.monthlyWeek = enumStringToValue$b(ZoomMonthlyWeek, proto.monthlyWeek);
362
362
  }
363
363
  if (proto.monthlyWeekDay) {
364
- m.monthlyWeekDay = enumStringToValue$c(ZoomMonthlyWeekDay, proto.monthlyWeekDay);
364
+ m.monthlyWeekDay = enumStringToValue$b(ZoomMonthlyWeekDay, proto.monthlyWeekDay);
365
365
  }
366
366
  if (proto.endTimes) {
367
367
  m.endTimes = parseInt(proto.endTimes, 10);
@@ -408,10 +408,10 @@ class ZoomMeetingSettings {
408
408
  let m = new ZoomMeetingSettings();
409
409
  m = Object.assign(m, proto);
410
410
  if (proto.approvalType) {
411
- m.approvalType = enumStringToValue$c(ZoomApprovalType, proto.approvalType);
411
+ m.approvalType = enumStringToValue$b(ZoomApprovalType, proto.approvalType);
412
412
  }
413
413
  if (proto.registrationType) {
414
- m.registrationType = enumStringToValue$c(ZoomRegistrationType, proto.registrationType);
414
+ m.registrationType = enumStringToValue$b(ZoomRegistrationType, proto.registrationType);
415
415
  }
416
416
  return m;
417
417
  }
@@ -554,7 +554,7 @@ class ZoomOccurrence {
554
554
  }
555
555
  }
556
556
 
557
- function enumStringToValue$b(enumRef, value) {
557
+ function enumStringToValue$a(enumRef, value) {
558
558
  if (typeof value === 'number') {
559
559
  return value;
560
560
  }
@@ -807,6 +807,79 @@ class GoogleMeetEntryPoint {
807
807
  return toReturn;
808
808
  }
809
809
  }
810
+ class GoogleMeetListMeetingsRequest {
811
+ static fromProto(proto) {
812
+ let m = new GoogleMeetListMeetingsRequest();
813
+ m = Object.assign(m, proto);
814
+ if (proto.pageSize) {
815
+ m.pageSize = parseInt(proto.pageSize, 10);
816
+ }
817
+ if (proto.timeMin) {
818
+ m.timeMin = new Date(proto.timeMin);
819
+ }
820
+ if (proto.timeMax) {
821
+ m.timeMax = new Date(proto.timeMax);
822
+ }
823
+ return m;
824
+ }
825
+ constructor(kwargs) {
826
+ if (!kwargs) {
827
+ return;
828
+ }
829
+ Object.assign(this, kwargs);
830
+ }
831
+ toApiJson() {
832
+ const toReturn = {};
833
+ if (typeof this.userId !== 'undefined') {
834
+ toReturn['userId'] = this.userId;
835
+ }
836
+ if (typeof this.pageSize !== 'undefined') {
837
+ toReturn['pageSize'] = this.pageSize;
838
+ }
839
+ if (typeof this.pageToken !== 'undefined') {
840
+ toReturn['pageToken'] = this.pageToken;
841
+ }
842
+ if (typeof this.syncToken !== 'undefined') {
843
+ toReturn['syncToken'] = this.syncToken;
844
+ }
845
+ if (typeof this.timeMin !== 'undefined' && this.timeMin !== null) {
846
+ toReturn['timeMin'] = 'toApiJson' in this.timeMin ? this.timeMin.toApiJson() : this.timeMin;
847
+ }
848
+ if (typeof this.timeMax !== 'undefined' && this.timeMax !== null) {
849
+ toReturn['timeMax'] = 'toApiJson' in this.timeMax ? this.timeMax.toApiJson() : this.timeMax;
850
+ }
851
+ return toReturn;
852
+ }
853
+ }
854
+ class GoogleMeetListMeetingsResponse {
855
+ static fromProto(proto) {
856
+ let m = new GoogleMeetListMeetingsResponse();
857
+ m = Object.assign(m, proto);
858
+ if (proto.meetings) {
859
+ m.meetings = proto.meetings.map(GoogleMeetMeeting.fromProto);
860
+ }
861
+ return m;
862
+ }
863
+ constructor(kwargs) {
864
+ if (!kwargs) {
865
+ return;
866
+ }
867
+ Object.assign(this, kwargs);
868
+ }
869
+ toApiJson() {
870
+ const toReturn = {};
871
+ if (typeof this.meetings !== 'undefined' && this.meetings !== null) {
872
+ toReturn['meetings'] = 'toApiJson' in this.meetings ? this.meetings.toApiJson() : this.meetings;
873
+ }
874
+ if (typeof this.nextPageToken !== 'undefined') {
875
+ toReturn['nextPageToken'] = this.nextPageToken;
876
+ }
877
+ if (typeof this.nextSyncToken !== 'undefined') {
878
+ toReturn['nextSyncToken'] = this.nextSyncToken;
879
+ }
880
+ return toReturn;
881
+ }
882
+ }
810
883
  class GoogleMeetMeeting {
811
884
  static fromProto(proto) {
812
885
  let m = new GoogleMeetMeeting();
@@ -835,6 +908,9 @@ class GoogleMeetMeeting {
835
908
  if (proto.creator) {
836
909
  m.creator = GoogleMeetMeetingCreator.fromProto(proto.creator);
837
910
  }
911
+ if (proto.organizer) {
912
+ m.organizer = GoogleMeetMeetingOrganizer.fromProto(proto.organizer);
913
+ }
838
914
  return m;
839
915
  }
840
916
  constructor(kwargs) {
@@ -932,6 +1008,9 @@ class GoogleMeetMeeting {
932
1008
  if (typeof this.updated !== 'undefined') {
933
1009
  toReturn['updated'] = this.updated;
934
1010
  }
1011
+ if (typeof this.organizer !== 'undefined' && this.organizer !== null) {
1012
+ toReturn['organizer'] = 'toApiJson' in this.organizer ? this.organizer.toApiJson() : this.organizer;
1013
+ }
935
1014
  return toReturn;
936
1015
  }
937
1016
  }
@@ -1040,6 +1119,35 @@ class GoogleMeetMeetingDateTime {
1040
1119
  return toReturn;
1041
1120
  }
1042
1121
  }
1122
+ class GoogleMeetMeetingOrganizer {
1123
+ static fromProto(proto) {
1124
+ let m = new GoogleMeetMeetingOrganizer();
1125
+ m = Object.assign(m, proto);
1126
+ return m;
1127
+ }
1128
+ constructor(kwargs) {
1129
+ if (!kwargs) {
1130
+ return;
1131
+ }
1132
+ Object.assign(this, kwargs);
1133
+ }
1134
+ toApiJson() {
1135
+ const toReturn = {};
1136
+ if (typeof this.displayName !== 'undefined') {
1137
+ toReturn['displayName'] = this.displayName;
1138
+ }
1139
+ if (typeof this.email !== 'undefined') {
1140
+ toReturn['email'] = this.email;
1141
+ }
1142
+ if (typeof this.id !== 'undefined') {
1143
+ toReturn['id'] = this.id;
1144
+ }
1145
+ if (typeof this.self !== 'undefined') {
1146
+ toReturn['self'] = this.self;
1147
+ }
1148
+ return toReturn;
1149
+ }
1150
+ }
1043
1151
  class GoogleMeetMeetingReminder {
1044
1152
  static fromProto(proto) {
1045
1153
  let m = new GoogleMeetMeetingReminder();
@@ -1093,7 +1201,7 @@ class GoogleMeetMeetingReminders {
1093
1201
  }
1094
1202
  }
1095
1203
 
1096
- function enumStringToValue$a(enumRef, value) {
1204
+ function enumStringToValue$9(enumRef, value) {
1097
1205
  if (typeof value === 'number') {
1098
1206
  return value;
1099
1207
  }
@@ -1104,10 +1212,10 @@ class MeetingSourceInfo {
1104
1212
  let m = new MeetingSourceInfo();
1105
1213
  m = Object.assign(m, proto);
1106
1214
  if (proto.source) {
1107
- m.source = enumStringToValue$a(MeetingSource, proto.source);
1215
+ m.source = enumStringToValue$9(MeetingSource, proto.source);
1108
1216
  }
1109
1217
  if (proto.status) {
1110
- m.status = enumStringToValue$a(MeetingSourceStatus, proto.status);
1218
+ m.status = enumStringToValue$9(MeetingSourceStatus, proto.status);
1111
1219
  }
1112
1220
  return m;
1113
1221
  }
@@ -1197,7 +1305,7 @@ class MeetingSourceQuery {
1197
1305
  let m = new MeetingSourceQuery();
1198
1306
  m = Object.assign(m, proto);
1199
1307
  if (proto.source) {
1200
- m.source = enumStringToValue$a(MeetingSource, proto.source);
1308
+ m.source = enumStringToValue$9(MeetingSource, proto.source);
1201
1309
  }
1202
1310
  return m;
1203
1311
  }
@@ -1222,7 +1330,7 @@ class MeetingSourceQuery {
1222
1330
  }
1223
1331
  }
1224
1332
 
1225
- function enumStringToValue$9(enumRef, value) {
1333
+ function enumStringToValue$8(enumRef, value) {
1226
1334
  if (typeof value === 'number') {
1227
1335
  return value;
1228
1336
  }
@@ -1233,7 +1341,7 @@ class Answer {
1233
1341
  let m = new Answer();
1234
1342
  m = Object.assign(m, proto);
1235
1343
  if (proto.type) {
1236
- m.type = enumStringToValue$9(FormFieldType, proto.type);
1344
+ m.type = enumStringToValue$8(FormFieldType, proto.type);
1237
1345
  }
1238
1346
  return m;
1239
1347
  }
@@ -1375,7 +1483,7 @@ class Calendar {
1375
1483
  m.applicationContext = Object.keys(proto.applicationContext).reduce((obj, k) => { obj[k] = proto.applicationContext[k]; return obj; }, {});
1376
1484
  }
1377
1485
  if (proto.calendarType) {
1378
- m.calendarType = enumStringToValue$9(CalendarType, proto.calendarType);
1486
+ m.calendarType = enumStringToValue$8(CalendarType, proto.calendarType);
1379
1487
  }
1380
1488
  return m;
1381
1489
  }
@@ -1516,6 +1624,9 @@ class HostUser {
1516
1624
  if (typeof this.isConfigured !== 'undefined') {
1517
1625
  toReturn['isConfigured'] = this.isConfigured;
1518
1626
  }
1627
+ if (typeof this.isConnected !== 'undefined') {
1628
+ toReturn['isConnected'] = this.isConnected;
1629
+ }
1519
1630
  return toReturn;
1520
1631
  }
1521
1632
  }
@@ -1576,7 +1687,7 @@ class Preferences {
1576
1687
  m.timezone = TimeZone.fromProto(proto.timezone);
1577
1688
  }
1578
1689
  if (proto.meetingIntegration) {
1579
- m.meetingIntegration = enumStringToValue$9(MeetingSource, proto.meetingIntegration);
1690
+ m.meetingIntegration = enumStringToValue$8(MeetingSource, proto.meetingIntegration);
1580
1691
  }
1581
1692
  if (proto.availabilityIncrement) {
1582
1693
  m.availabilityIncrement = parseInt(proto.availabilityIncrement, 10);
@@ -1591,10 +1702,10 @@ class Preferences {
1591
1702
  m.bufferDurationBeforeMeeting = parseInt(proto.bufferDurationBeforeMeeting, 10);
1592
1703
  }
1593
1704
  if (proto.calendarIntegration) {
1594
- m.calendarIntegration = enumStringToValue$9(CalendarSource, proto.calendarIntegration);
1705
+ m.calendarIntegration = enumStringToValue$8(CalendarSource, proto.calendarIntegration);
1595
1706
  }
1596
1707
  if (proto.onBoardingState) {
1597
- m.onBoardingState = enumStringToValue$9(OnBoardingState, proto.onBoardingState);
1708
+ m.onBoardingState = enumStringToValue$8(OnBoardingState, proto.onBoardingState);
1598
1709
  }
1599
1710
  return m;
1600
1711
  }
@@ -1666,7 +1777,7 @@ class TimeRange {
1666
1777
  }
1667
1778
  }
1668
1779
 
1669
- function enumStringToValue$8(enumRef, value) {
1780
+ function enumStringToValue$7(enumRef, value) {
1670
1781
  if (typeof value === 'number') {
1671
1782
  return value;
1672
1783
  }
@@ -1702,7 +1813,7 @@ class DateRange {
1702
1813
  }
1703
1814
  }
1704
1815
 
1705
- function enumStringToValue$7(enumRef, value) {
1816
+ function enumStringToValue$6(enumRef, value) {
1706
1817
  if (typeof value === 'number') {
1707
1818
  return value;
1708
1819
  }
@@ -1713,7 +1824,7 @@ class EventTypeDateRange {
1713
1824
  let m = new EventTypeDateRange();
1714
1825
  m = Object.assign(m, proto);
1715
1826
  if (proto.dateRangeType) {
1716
- m.dateRangeType = enumStringToValue$7(DateRangeType, proto.dateRangeType);
1827
+ m.dateRangeType = enumStringToValue$6(DateRangeType, proto.dateRangeType);
1717
1828
  }
1718
1829
  if (proto.customDateRange) {
1719
1830
  m.customDateRange = DateRange.fromProto(proto.customDateRange);
@@ -1748,7 +1859,7 @@ class Field {
1748
1859
  let m = new Field();
1749
1860
  m = Object.assign(m, proto);
1750
1861
  if (proto.type) {
1751
- m.type = enumStringToValue$7(FormFieldType, proto.type);
1862
+ m.type = enumStringToValue$6(FormFieldType, proto.type);
1752
1863
  }
1753
1864
  return m;
1754
1865
  }
@@ -1815,7 +1926,7 @@ class MeetingType {
1815
1926
  m.noticeTime = parseInt(proto.noticeTime, 10);
1816
1927
  }
1817
1928
  if (proto.locationType) {
1818
- m.locationType = enumStringToValue$7(MeetingLocationType, proto.locationType);
1929
+ m.locationType = enumStringToValue$6(MeetingLocationType, proto.locationType);
1819
1930
  }
1820
1931
  if (proto.hostUsers) {
1821
1932
  m.hostUsers = proto.hostUsers.map(HostUser.fromProto);
@@ -1827,7 +1938,13 @@ class MeetingType {
1827
1938
  m.dateRange = EventTypeDateRange.fromProto(proto.dateRange);
1828
1939
  }
1829
1940
  if (proto.meetingType) {
1830
- m.meetingType = enumStringToValue$7(TeamEventMeetingType, proto.meetingType);
1941
+ m.meetingType = enumStringToValue$6(TeamEventMeetingType, proto.meetingType);
1942
+ }
1943
+ if (proto.attendeeCount) {
1944
+ m.attendeeCount = parseInt(proto.attendeeCount, 10);
1945
+ }
1946
+ if (proto.registrationCutoff) {
1947
+ m.registrationCutoff = parseInt(proto.registrationCutoff, 10);
1831
1948
  }
1832
1949
  return m;
1833
1950
  }
@@ -1923,6 +2040,15 @@ class MeetingType {
1923
2040
  if (typeof this.meetingType !== 'undefined') {
1924
2041
  toReturn['meetingType'] = this.meetingType;
1925
2042
  }
2043
+ if (typeof this.attendeeCount !== 'undefined') {
2044
+ toReturn['attendeeCount'] = this.attendeeCount;
2045
+ }
2046
+ if (typeof this.registrationCutoff !== 'undefined') {
2047
+ toReturn['registrationCutoff'] = this.registrationCutoff;
2048
+ }
2049
+ if (typeof this.sessionTitle !== 'undefined') {
2050
+ toReturn['sessionTitle'] = this.sessionTitle;
2051
+ }
1926
2052
  return toReturn;
1927
2053
  }
1928
2054
  }
@@ -1931,7 +2057,7 @@ class RelativeDateRange {
1931
2057
  let m = new RelativeDateRange();
1932
2058
  m = Object.assign(m, proto);
1933
2059
  if (proto.unit) {
1934
- m.unit = enumStringToValue$7(RelativeTimeUnit, proto.unit);
2060
+ m.unit = enumStringToValue$6(RelativeTimeUnit, proto.unit);
1935
2061
  }
1936
2062
  if (proto.value) {
1937
2063
  m.value = parseInt(proto.value, 10);
@@ -1956,7 +2082,7 @@ class RelativeDateRange {
1956
2082
  }
1957
2083
  }
1958
2084
 
1959
- function enumStringToValue$6(enumRef, value) {
2085
+ function enumStringToValue$5(enumRef, value) {
1960
2086
  if (typeof value === 'number') {
1961
2087
  return value;
1962
2088
  }
@@ -2101,7 +2227,7 @@ class Service {
2101
2227
  }
2102
2228
  }
2103
2229
 
2104
- function enumStringToValue$5(enumRef, value) {
2230
+ function enumStringToValue$4(enumRef, value) {
2105
2231
  if (typeof value === 'number') {
2106
2232
  return value;
2107
2233
  }
@@ -2494,10 +2620,10 @@ class GuestGetBookedMeetingResponse {
2494
2620
  m.timeZone = TimeZone.fromProto(proto.timeZone);
2495
2621
  }
2496
2622
  if (proto.locationType) {
2497
- m.locationType = enumStringToValue$5(MeetingLocationType, proto.locationType);
2623
+ m.locationType = enumStringToValue$4(MeetingLocationType, proto.locationType);
2498
2624
  }
2499
2625
  if (proto.meetingType) {
2500
- m.meetingType = enumStringToValue$5(TeamEventMeetingType, proto.meetingType);
2626
+ m.meetingType = enumStringToValue$4(TeamEventMeetingType, proto.meetingType);
2501
2627
  }
2502
2628
  return m;
2503
2629
  }
@@ -2620,6 +2746,29 @@ class GuestRescheduleMeetingRequest {
2620
2746
  return toReturn;
2621
2747
  }
2622
2748
  }
2749
+ class IsoDateTimeRange {
2750
+ static fromProto(proto) {
2751
+ let m = new IsoDateTimeRange();
2752
+ m = Object.assign(m, proto);
2753
+ return m;
2754
+ }
2755
+ constructor(kwargs) {
2756
+ if (!kwargs) {
2757
+ return;
2758
+ }
2759
+ Object.assign(this, kwargs);
2760
+ }
2761
+ toApiJson() {
2762
+ const toReturn = {};
2763
+ if (typeof this.start !== 'undefined') {
2764
+ toReturn['start'] = this.start;
2765
+ }
2766
+ if (typeof this.end !== 'undefined') {
2767
+ toReturn['end'] = this.end;
2768
+ }
2769
+ return toReturn;
2770
+ }
2771
+ }
2623
2772
  class ListAvailableTimeSlotsRequest {
2624
2773
  static fromProto(proto) {
2625
2774
  let m = new ListAvailableTimeSlotsRequest();
@@ -2655,6 +2804,9 @@ class ListAvailableTimeSlotsRequest {
2655
2804
  if (typeof this.userId !== 'undefined') {
2656
2805
  toReturn['userId'] = this.userId;
2657
2806
  }
2807
+ if (typeof this.useIsoDates !== 'undefined') {
2808
+ toReturn['useIsoDates'] = this.useIsoDates;
2809
+ }
2658
2810
  return toReturn;
2659
2811
  }
2660
2812
  }
@@ -2665,6 +2817,9 @@ class ListAvailableTimeSlotsResponse {
2665
2817
  if (proto.timeSlots) {
2666
2818
  m.timeSlots = proto.timeSlots.map(DateRange.fromProto);
2667
2819
  }
2820
+ if (proto.isoTimeSlots) {
2821
+ m.isoTimeSlots = proto.isoTimeSlots.map(IsoDateTimeRange.fromProto);
2822
+ }
2668
2823
  return m;
2669
2824
  }
2670
2825
  constructor(kwargs) {
@@ -2678,6 +2833,9 @@ class ListAvailableTimeSlotsResponse {
2678
2833
  if (typeof this.timeSlots !== 'undefined' && this.timeSlots !== null) {
2679
2834
  toReturn['timeSlots'] = 'toApiJson' in this.timeSlots ? this.timeSlots.toApiJson() : this.timeSlots;
2680
2835
  }
2836
+ if (typeof this.isoTimeSlots !== 'undefined' && this.isoTimeSlots !== null) {
2837
+ toReturn['isoTimeSlots'] = 'toApiJson' in this.isoTimeSlots ? this.isoTimeSlots.toApiJson() : this.isoTimeSlots;
2838
+ }
2681
2839
  return toReturn;
2682
2840
  }
2683
2841
  }
@@ -2748,7 +2906,7 @@ class BookMeetingRequestMetadataEntry {
2748
2906
  }
2749
2907
  }
2750
2908
 
2751
- function enumStringToValue$4(enumRef, value) {
2909
+ function enumStringToValue$3(enumRef, value) {
2752
2910
  if (typeof value === 'number') {
2753
2911
  return value;
2754
2912
  }
@@ -2775,7 +2933,7 @@ class FieldMask {
2775
2933
  }
2776
2934
  }
2777
2935
 
2778
- function enumStringToValue$3(enumRef, value) {
2936
+ function enumStringToValue$2(enumRef, value) {
2779
2937
  if (typeof value === 'number') {
2780
2938
  return value;
2781
2939
  }
@@ -2855,7 +3013,7 @@ class AvailabilityRule {
2855
3013
  let m = new AvailabilityRule();
2856
3014
  m = Object.assign(m, proto);
2857
3015
  if (proto.day) {
2858
- m.day = enumStringToValue$3(DayOfWeek, proto.day);
3016
+ m.day = enumStringToValue$2(DayOfWeek, proto.day);
2859
3017
  }
2860
3018
  if (proto.timeSlot) {
2861
3019
  m.timeSlot = TimeRange.fromProto(proto.timeSlot);
@@ -3824,7 +3982,7 @@ class HostBookMeetingRequest {
3824
3982
  let m = new HostBookMeetingRequest();
3825
3983
  m = Object.assign(m, proto);
3826
3984
  if (proto.meetingSource) {
3827
- m.meetingSource = enumStringToValue$3(MeetingSource, proto.meetingSource);
3985
+ m.meetingSource = enumStringToValue$2(MeetingSource, proto.meetingSource);
3828
3986
  }
3829
3987
  if (proto.timeSlot) {
3830
3988
  m.timeSlot = DateRange.fromProto(proto.timeSlot);
@@ -4141,7 +4299,7 @@ class IsHostConfiguredResponse {
4141
4299
  let m = new IsHostConfiguredResponse();
4142
4300
  m = Object.assign(m, proto);
4143
4301
  if (proto.onBoardingState) {
4144
- m.onBoardingState = enumStringToValue$3(OnBoardingState, proto.onBoardingState);
4302
+ m.onBoardingState = enumStringToValue$2(OnBoardingState, proto.onBoardingState);
4145
4303
  }
4146
4304
  return m;
4147
4305
  }
@@ -4408,7 +4566,7 @@ class Meeting {
4408
4566
  m.hostDetails = proto.hostDetails.map(HostDetails.fromProto);
4409
4567
  }
4410
4568
  if (proto.meetingType) {
4411
- m.meetingType = enumStringToValue$3(TeamEventMeetingType, proto.meetingType);
4569
+ m.meetingType = enumStringToValue$2(TeamEventMeetingType, proto.meetingType);
4412
4570
  }
4413
4571
  return m;
4414
4572
  }
@@ -4603,7 +4761,7 @@ class SetGeneralAvailabilityRequest {
4603
4761
  let m = new SetGeneralAvailabilityRequest();
4604
4762
  m = Object.assign(m, proto);
4605
4763
  if (proto.days) {
4606
- m.days = proto.days.map((v) => enumStringToValue$3(DayOfWeek, v));
4764
+ m.days = proto.days.map((v) => enumStringToValue$2(DayOfWeek, v));
4607
4765
  }
4608
4766
  if (proto.timeSlot) {
4609
4767
  m.timeSlot = TimeRange.fromProto(proto.timeSlot);
@@ -4862,7 +5020,7 @@ class WeekdayAvailability {
4862
5020
  let m = new WeekdayAvailability();
4863
5021
  m = Object.assign(m, proto);
4864
5022
  if (proto.day) {
4865
- m.day = enumStringToValue$3(DayOfWeek, proto.day);
5023
+ m.day = enumStringToValue$2(DayOfWeek, proto.day);
4866
5024
  }
4867
5025
  if (proto.timeSlots) {
4868
5026
  m.timeSlots = proto.timeSlots.map(TimeRange.fromProto);
@@ -4887,42 +5045,6 @@ class WeekdayAvailability {
4887
5045
  }
4888
5046
  }
4889
5047
 
4890
- function enumStringToValue$2(enumRef, value) {
4891
- if (typeof value === 'number') {
4892
- return value;
4893
- }
4894
- return enumRef[value];
4895
- }
4896
- class ScheduleBotRequest {
4897
- static fromProto(proto) {
4898
- let m = new ScheduleBotRequest();
4899
- m = Object.assign(m, proto);
4900
- if (proto.startTime) {
4901
- m.startTime = new Date(proto.startTime);
4902
- }
4903
- return m;
4904
- }
4905
- constructor(kwargs) {
4906
- if (!kwargs) {
4907
- return;
4908
- }
4909
- Object.assign(this, kwargs);
4910
- }
4911
- toApiJson() {
4912
- const toReturn = {};
4913
- if (typeof this.namespace !== 'undefined') {
4914
- toReturn['namespace'] = this.namespace;
4915
- }
4916
- if (typeof this.meetingUrl !== 'undefined') {
4917
- toReturn['meetingUrl'] = this.meetingUrl;
4918
- }
4919
- if (typeof this.startTime !== 'undefined' && this.startTime !== null) {
4920
- toReturn['startTime'] = 'toApiJson' in this.startTime ? this.startTime.toApiJson() : this.startTime;
4921
- }
4922
- return toReturn;
4923
- }
4924
- }
4925
-
4926
5048
  function enumStringToValue$1(enumRef, value) {
4927
5049
  if (typeof value === 'number') {
4928
5050
  return value;
@@ -5138,6 +5260,11 @@ class GoogleMeetApiService {
5138
5260
  return this.http.post(this._host + "/meetings.v1.GoogleMeet/CreateMeeting", request.toApiJson(), this.apiOptions())
5139
5261
  .pipe(map(resp => GoogleMeetCreateMeetingResponse.fromProto(resp)));
5140
5262
  }
5263
+ listMeetings(r) {
5264
+ const request = (r.toApiJson) ? r : new GoogleMeetListMeetingsRequest(r);
5265
+ return this.http.post(this._host + "/meetings.v1.GoogleMeet/ListMeetings", request.toApiJson(), this.apiOptions())
5266
+ .pipe(map(resp => GoogleMeetListMeetingsResponse.fromProto(resp)));
5267
+ }
5141
5268
  }
5142
5269
  GoogleMeetApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: GoogleMeetApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
5143
5270
  GoogleMeetApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: GoogleMeetApiService, providedIn: 'root' });
@@ -5304,65 +5431,307 @@ function createMeetInstantMeetingRequest(meetingTitle, startDateTime, attendees)
5304
5431
  return new GoogleMeetCreateMeetingRequest(req);
5305
5432
  }
5306
5433
 
5307
- // *********************************
5308
- class MeetingBotAPIApiService {
5309
- constructor() {
5310
- this.hostService = inject(HostService$1);
5311
- this.http = inject(HttpClient);
5312
- this._host = this.hostService.hostWithScheme;
5313
- }
5314
- apiOptions() {
5315
- return {
5316
- headers: new HttpHeaders({
5317
- 'Content-Type': 'application/json'
5318
- }),
5319
- withCredentials: true
5320
- };
5321
- }
5322
- scheduleBot(r) {
5323
- const request = (r.toApiJson) ? r : new ScheduleBotRequest(r);
5324
- return this.http.post(this._host + "/meetings.v1.MeetingBotAPI/ScheduleBot", request.toApiJson(), Object.assign(Object.assign({}, this.apiOptions()), { observe: 'response' }));
5325
- }
5434
+ function TimeSpanFromApi(tsAPI) {
5435
+ return {
5436
+ start: tsAPI.start,
5437
+ end: tsAPI.end
5438
+ };
5326
5439
  }
5327
- MeetingBotAPIApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: MeetingBotAPIApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
5328
- MeetingBotAPIApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: MeetingBotAPIApiService, providedIn: 'root' });
5329
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: MeetingBotAPIApiService, decorators: [{
5330
- type: Injectable,
5331
- args: [{ providedIn: 'root' }]
5332
- }] });
5333
5440
 
5334
- // *********************************
5335
- class MeetingGuestApiService {
5336
- constructor() {
5337
- this.hostService = inject(HostService$1);
5338
- this.http = inject(HttpClient);
5339
- this._host = this.hostService.hostWithScheme;
5340
- }
5341
- apiOptions() {
5342
- return {
5343
- headers: new HttpHeaders({
5344
- 'Content-Type': 'application/json'
5345
- }),
5346
- withCredentials: true
5347
- };
5441
+ function HostFromApi(hostAPI) {
5442
+ return {
5443
+ displayName: hostAPI.displayName,
5444
+ displayProfileUrl: hostAPI.displayProfileUrl,
5445
+ displayLogoUrl: hostAPI.displayLogoUrl,
5446
+ };
5447
+ }
5448
+
5449
+ // Copied from core
5450
+ var Environment;
5451
+ (function (Environment) {
5452
+ Environment[Environment["LOCAL"] = 0] = "LOCAL";
5453
+ Environment[Environment["TEST"] = 1] = "TEST";
5454
+ Environment[Environment["DEMO"] = 2] = "DEMO";
5455
+ Environment[Environment["PROD"] = 3] = "PROD";
5456
+ })(Environment || (Environment = {}));
5457
+ function onProduction(env) {
5458
+ return env === Environment.PROD || env === 'prod';
5459
+ }
5460
+ function onProductionGlobal() {
5461
+ // environment expected to be set in the app in globals.ts
5462
+ // eslint-disable-next-line
5463
+ return typeof window !== 'undefined' && window.environment === 'prod';
5464
+ }
5465
+
5466
+ // A temporary method for building the url for a host, eventTypeId, and metadata
5467
+ function getBookingUrlImplementation(req) {
5468
+ const domain = getDomainFromEnvironment(req.environment);
5469
+ const meetingType = req.meetingTypeSlug || req.meetingTypeId || '30-minutes';
5470
+ const calendarSlug = req.calendarSlug || req.calendarId;
5471
+ let url = `https://${domain}/book/${calendarSlug}/${meetingType}`;
5472
+ if (calendarSlug.startsWith("GRP-")) {
5473
+ url = `https://${domain}/group/${calendarSlug}/${meetingType}`;
5348
5474
  }
5349
- listMeetingTypes(r) {
5350
- const request = (r.toApiJson) ? r : new ListMeetingTypesRequest(r);
5351
- return this.http.post(this._host + "/meetings.v1.MeetingGuest/ListMeetingTypes", request.toApiJson(), this.apiOptions())
5352
- .pipe(map(resp => ListMeetingTypesResponse.fromProto(resp)));
5475
+ if (calendarSlug.startsWith("SVS-")) {
5476
+ url = `https://${domain}/service/${calendarSlug}/${meetingType}`;
5353
5477
  }
5354
- getMeetingType(r) {
5355
- const request = (r.toApiJson) ? r : new GetMeetingTypeRequest(r);
5356
- return this.http.post(this._host + "/meetings.v1.MeetingGuest/GetMeetingType", request.toApiJson(), this.apiOptions())
5357
- .pipe(map(resp => GetMeetingTypeResponse.fromProto(resp)));
5478
+ if (!req.metadata) {
5479
+ return url;
5358
5480
  }
5359
- listAvailableTimeSlots(r) {
5360
- const request = (r.toApiJson) ? r : new ListAvailableTimeSlotsRequest(r);
5361
- return this.http.post(this._host + "/meetings.v1.MeetingGuest/ListAvailableTimeSlots", request.toApiJson(), this.apiOptions())
5362
- .pipe(map(resp => ListAvailableTimeSlotsResponse.fromProto(resp)));
5481
+ return addMetadataToBookingLink({ link: url, metadata: req.metadata });
5482
+ }
5483
+ function getGeneralBookingUrlImplementation(req) {
5484
+ const url = `https://${getDomainFromEnvironment(req.environment)}/${req.calendarSlug || req.calendarId}`;
5485
+ return req.metadata ? addMetadataToBookingLink({ link: url, metadata: req.metadata }) : url;
5486
+ }
5487
+ function getDomainFromEnvironment(env) {
5488
+ if (env === Environment.PROD) {
5489
+ return 'bookmenow.info';
5363
5490
  }
5364
- bookMeeting(r) {
5365
- const request = (r.toApiJson) ? r : new BookMeetingRequest(r);
5491
+ return 'meetings-demo.apigateway.co';
5492
+ }
5493
+ function addMetadataToBookingLink(req) {
5494
+ if (!req.metadata) {
5495
+ return req.link;
5496
+ }
5497
+ const m = req.metadata;
5498
+ const queryParams = Object.keys(m).reduce((params, key) => {
5499
+ if (!params) {
5500
+ if (req.link.indexOf('?') >= 0) {
5501
+ return `&${key}=${m[key]}`;
5502
+ }
5503
+ return `?${key}=${m[key]}`;
5504
+ }
5505
+ return `${params}&${key}=${m[key]}`;
5506
+ }, '');
5507
+ return `${req.link}${queryParams}`;
5508
+ }
5509
+
5510
+ function MeetingTypeFromApi(req) {
5511
+ var _a;
5512
+ let bookingUrl = ((_a = req === null || req === void 0 ? void 0 : req.meetingTypeApi) === null || _a === void 0 ? void 0 : _a.bookingUrl) || '';
5513
+ if (bookingUrl === '') {
5514
+ bookingUrl = getBookingUrlImplementation({
5515
+ environment: req.environment,
5516
+ calendarId: req.calendarId,
5517
+ meetingTypeSlug: req.meetingTypeApi.meetingTypeSlug || req.meetingTypeApi.id || '',
5518
+ metadata: req.metadata,
5519
+ calendarSlug: req.calendarSlug,
5520
+ });
5521
+ }
5522
+ else {
5523
+ bookingUrl = addMetadataToBookingLink({ link: bookingUrl, metadata: req.metadata || {} });
5524
+ }
5525
+ const form = Object.assign(Object.assign({}, (req.meetingTypeApi.form || { fields: [] })), { fields: (req.meetingTypeApi.form && req.meetingTypeApi.form.fields ? req.meetingTypeApi.form.fields : []).map(field => {
5526
+ return Object.assign(Object.assign({}, field), { id: field.id || '', label: field.label || '', type: field.type || FormFieldType.FORM_FIELD_TYPE_INVALID, required: field.required || false });
5527
+ }) });
5528
+ return {
5529
+ id: req.meetingTypeApi.id || '',
5530
+ calendarId: req.meetingTypeApi.calendarId || '',
5531
+ name: req.meetingTypeApi.name || '',
5532
+ duration: req.meetingTypeApi.duration || '',
5533
+ bookingUrl: bookingUrl,
5534
+ bookingLink: req.meetingTypeApi.meetingTypeSlug || '',
5535
+ meetingTypeSlug: req.meetingTypeApi.meetingTypeSlug || '',
5536
+ description: req.meetingTypeApi.description || '',
5537
+ hexColor: req.meetingTypeApi.hexColor || '',
5538
+ form: form,
5539
+ hostUserIds: req.meetingTypeApi.hostUserIds || [],
5540
+ availabilityIncrement: req.meetingTypeApi.availabilityIncrement || -1,
5541
+ bufferDurationAfterMeeting: req.meetingTypeApi.bufferDurationAfterMeeting || 0,
5542
+ bufferDurationBeforeMeeting: req.meetingTypeApi.bufferDurationBeforeMeeting || 0,
5543
+ noticeTime: req.meetingTypeApi.noticeTime || 0,
5544
+ location: req.meetingTypeApi.location || '',
5545
+ locationGuidelines: req.meetingTypeApi.locationGuidelines || '',
5546
+ emailSubject: req.meetingTypeApi.emailSubject || '',
5547
+ emailDescription: req.meetingTypeApi.emailDescription || '',
5548
+ isPinned: req.meetingTypeApi.isPinned || false,
5549
+ CalendarType: req.meetingTypeApi.calendarType || '',
5550
+ hostUsers: req.meetingTypeApi.hostUsers || [],
5551
+ teamName: req.meetingTypeApi.teamName || '',
5552
+ isVideoLinkDisabled: req.meetingTypeApi.isVideoLinkDisabled || false,
5553
+ locationType: req.meetingTypeApi.locationType || MeetingLocationType.VIDEO,
5554
+ meetingType: req.meetingTypeApi.meetingType || TeamEventMeetingType.ROUND_ROBIN,
5555
+ dateRange: req.meetingTypeApi.dateRange || {},
5556
+ attendeeCount: req.meetingTypeApi.attendeeCount || 0,
5557
+ registrationCutoff: req.meetingTypeApi.registrationCutoff || 0,
5558
+ sessionTitle: req.meetingTypeApi.sessionTitle || '',
5559
+ };
5560
+ }
5561
+ function MeetingTypeToApi(req) {
5562
+ const m = req.meetingType;
5563
+ if (!m) {
5564
+ return {};
5565
+ }
5566
+ return {
5567
+ id: m.id || undefined,
5568
+ name: m.name || undefined,
5569
+ hexColor: m.hexColor || undefined,
5570
+ meetingTypeSlug: m.meetingTypeSlug || m.bookingLink || undefined,
5571
+ calendarId: m.calendarId || undefined,
5572
+ description: m.description || undefined,
5573
+ duration: m.duration ? m.duration : undefined,
5574
+ form: m.form || undefined,
5575
+ hostUserIds: m.hostUserIds || undefined,
5576
+ availabilityIncrement: m.availabilityIncrement || undefined,
5577
+ bufferDurationAfterMeeting: m.bufferDurationAfterMeeting || 0,
5578
+ noticeTime: m.noticeTime || 0,
5579
+ location: m.location || undefined,
5580
+ locationGuidelines: m.locationGuidelines || undefined,
5581
+ emailSubject: m.emailSubject || undefined,
5582
+ emailDescription: m.emailDescription || undefined,
5583
+ isPinned: m.isPinned || undefined,
5584
+ calendarType: m.CalendarType || undefined,
5585
+ hostUsers: m.hostUsers || undefined,
5586
+ teamName: m.teamName || undefined,
5587
+ isVideoLinkDisabled: m.isVideoLinkDisabled || false,
5588
+ locationType: m.locationType || MeetingLocationType.VIDEO,
5589
+ bufferDurationBeforeMeeting: m.bufferDurationBeforeMeeting || 0,
5590
+ meetingType: m.meetingType || TeamEventMeetingType.ROUND_ROBIN,
5591
+ dateRange: m.dateRange || undefined,
5592
+ attendeeCount: m.attendeeCount || 0,
5593
+ registrationCutoff: m.registrationCutoff || 0,
5594
+ sessionTitle: m.sessionTitle || undefined
5595
+ };
5596
+ }
5597
+
5598
+ // These represent well-known metadata keys used for more than just tracking
5599
+ var WellKnownMeetingMetadataKeys;
5600
+ (function (WellKnownMeetingMetadataKeys) {
5601
+ // This is the business (AG) attached to a meeting. This is attached via sending msm_business as a query param during booking
5602
+ WellKnownMeetingMetadataKeys["BUSINESS"] = "msm_business";
5603
+ })(WellKnownMeetingMetadataKeys || (WellKnownMeetingMetadataKeys = {}));
5604
+ // These are part of the standard Meeting Scheduler form.
5605
+ // If you are trying to pre-fill these fields use the helper formFieldIdToMetadataParam
5606
+ var WellKnownFormFieldIds;
5607
+ (function (WellKnownFormFieldIds) {
5608
+ WellKnownFormFieldIds["FIRST_NAME"] = "firstName";
5609
+ WellKnownFormFieldIds["LAST_NAME"] = "lastName";
5610
+ WellKnownFormFieldIds["EMAIL"] = "email";
5611
+ WellKnownFormFieldIds["PHONE_NUMBER"] = "phoneNumber";
5612
+ WellKnownFormFieldIds["COMMENT"] = "comment";
5613
+ WellKnownFormFieldIds["INVITEE_EMAILS"] = "inviteeEmail";
5614
+ })(WellKnownFormFieldIds || (WellKnownFormFieldIds = {}));
5615
+ // Converts the given id into a metadata key that can be sent on the url.
5616
+ // This means the key will be used to pre-fill those form fields.
5617
+ // This can also be used on fields that are not metadata to ensure they will come across in metadata.
5618
+ function meetingSchedulerIdToMetadataKey(id) {
5619
+ if (!id) {
5620
+ return '';
5621
+ }
5622
+ return id.startsWith('msm_') || id.startsWith('utm_') ? id : `msm_${id}`;
5623
+ }
5624
+ function meetingFromApi(meetingApi) {
5625
+ return {
5626
+ id: meetingApi.id,
5627
+ eventTypeId: meetingApi.eventTypeId,
5628
+ hostId: meetingApi.hostId,
5629
+ start: meetingApi.start,
5630
+ end: meetingApi.end,
5631
+ description: meetingApi.description || '',
5632
+ joinMeetingUrl: meetingApi.joinMeetingUrl || '',
5633
+ attendees: meetingApi.attendees ? meetingApi.attendees.map(a => ({
5634
+ firstName: a.firstName,
5635
+ lastName: a.lastName,
5636
+ email: a.email,
5637
+ phoneNumber: a.phoneNumber,
5638
+ timeZone: a.timeZone,
5639
+ isPrimary: a.isPrimary || false,
5640
+ })) : [],
5641
+ created: meetingApi.created,
5642
+ updated: meetingApi.updated,
5643
+ topic: meetingApi.topic,
5644
+ formAnswers: answersFromAPI(meetingApi.formAnswers),
5645
+ metadata: meetingApi.metadata || {},
5646
+ attachments: (meetingApi.attachments || []).map(a => {
5647
+ return {
5648
+ fileTitle: a.fileTitle || '',
5649
+ fileUrl: a.fileUrl || '',
5650
+ fileType: a.fileType || '',
5651
+ };
5652
+ }),
5653
+ location: meetingApi.location || '',
5654
+ calendarId: meetingApi.calendarId || '',
5655
+ hostDetails: (meetingApi.hostDetails || []).map(h => {
5656
+ return {
5657
+ hostID: h.hostId || '',
5658
+ name: h.name || '',
5659
+ };
5660
+ }),
5661
+ meetingType: meetingApi.meetingType,
5662
+ };
5663
+ }
5664
+ function answersFromAPI(formAnswers) {
5665
+ if (!formAnswers) {
5666
+ return { formAnswers: [] };
5667
+ }
5668
+ return {
5669
+ formAnswers: (formAnswers.formAnswers ? formAnswers.formAnswers : []).map(a => {
5670
+ return {
5671
+ id: a.id || '',
5672
+ label: a.label || '',
5673
+ type: a.type || FormFieldType.FORM_FIELD_TYPE_INVALID,
5674
+ answer: a.answer || [],
5675
+ };
5676
+ })
5677
+ };
5678
+ }
5679
+ function answersToAPI(formAnswers) {
5680
+ if (!formAnswers) {
5681
+ return { formAnswers: [] };
5682
+ }
5683
+ return {
5684
+ formAnswers: (formAnswers.formAnswers || []).map(a => {
5685
+ return {
5686
+ id: a.id || undefined,
5687
+ label: a.label || undefined,
5688
+ type: a.type,
5689
+ answer: a.answer || undefined,
5690
+ };
5691
+ })
5692
+ };
5693
+ }
5694
+
5695
+ class PagedResponse {
5696
+ constructor(results, nextCursor, hasMore) {
5697
+ this.results = results;
5698
+ this.nextCursor = nextCursor;
5699
+ this.hasMore = hasMore;
5700
+ }
5701
+ }
5702
+
5703
+ // *********************************
5704
+ class MeetingGuestApiService {
5705
+ constructor() {
5706
+ this.hostService = inject(HostService$1);
5707
+ this.http = inject(HttpClient);
5708
+ this._host = this.hostService.hostWithScheme;
5709
+ }
5710
+ apiOptions() {
5711
+ return {
5712
+ headers: new HttpHeaders({
5713
+ 'Content-Type': 'application/json'
5714
+ }),
5715
+ withCredentials: true
5716
+ };
5717
+ }
5718
+ listMeetingTypes(r) {
5719
+ const request = (r.toApiJson) ? r : new ListMeetingTypesRequest(r);
5720
+ return this.http.post(this._host + "/meetings.v1.MeetingGuest/ListMeetingTypes", request.toApiJson(), this.apiOptions())
5721
+ .pipe(map(resp => ListMeetingTypesResponse.fromProto(resp)));
5722
+ }
5723
+ getMeetingType(r) {
5724
+ const request = (r.toApiJson) ? r : new GetMeetingTypeRequest(r);
5725
+ return this.http.post(this._host + "/meetings.v1.MeetingGuest/GetMeetingType", request.toApiJson(), this.apiOptions())
5726
+ .pipe(map(resp => GetMeetingTypeResponse.fromProto(resp)));
5727
+ }
5728
+ listAvailableTimeSlots(r) {
5729
+ const request = (r.toApiJson) ? r : new ListAvailableTimeSlotsRequest(r);
5730
+ return this.http.post(this._host + "/meetings.v1.MeetingGuest/ListAvailableTimeSlots", request.toApiJson(), this.apiOptions())
5731
+ .pipe(map(resp => ListAvailableTimeSlotsResponse.fromProto(resp)));
5732
+ }
5733
+ bookMeeting(r) {
5734
+ const request = (r.toApiJson) ? r : new BookMeetingRequest(r);
5366
5735
  return this.http.post(this._host + "/meetings.v1.MeetingGuest/BookMeeting", request.toApiJson(), this.apiOptions())
5367
5736
  .pipe(map(resp => BookMeetingResponse.fromProto(resp)));
5368
5737
  }
@@ -5645,288 +6014,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImpor
5645
6014
 
5646
6015
  // *********************************
5647
6016
 
5648
- class MeetingBotService {
5649
- constructor(_api) {
5650
- this._api = _api;
5651
- }
5652
- scheduleBot(namespace, meetingUrl, startTime) {
5653
- return this._api.scheduleBot({
5654
- namespace: namespace,
5655
- meetingUrl: meetingUrl,
5656
- startTime: startTime
5657
- }).pipe(map(() => true));
5658
- }
5659
- }
5660
- MeetingBotService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: MeetingBotService, deps: [{ token: MeetingBotAPIApiService }], target: i0.ɵɵFactoryTarget.Injectable });
5661
- MeetingBotService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: MeetingBotService, providedIn: 'root' });
5662
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: MeetingBotService, decorators: [{
5663
- type: Injectable,
5664
- args: [{ providedIn: 'root' }]
5665
- }], ctorParameters: function () { return [{ type: MeetingBotAPIApiService }]; } });
5666
-
5667
- function TimeSpanFromApi(tsAPI) {
5668
- return {
5669
- start: tsAPI.start,
5670
- end: tsAPI.end
5671
- };
5672
- }
5673
-
5674
- function HostFromApi(hostAPI) {
5675
- return {
5676
- displayName: hostAPI.displayName,
5677
- displayProfileUrl: hostAPI.displayProfileUrl,
5678
- displayLogoUrl: hostAPI.displayLogoUrl,
5679
- };
5680
- }
5681
-
5682
- // Copied from core
5683
- var Environment;
5684
- (function (Environment) {
5685
- Environment[Environment["LOCAL"] = 0] = "LOCAL";
5686
- Environment[Environment["TEST"] = 1] = "TEST";
5687
- Environment[Environment["DEMO"] = 2] = "DEMO";
5688
- Environment[Environment["PROD"] = 3] = "PROD";
5689
- })(Environment || (Environment = {}));
5690
- function onProduction(env) {
5691
- return env === Environment.PROD || env === 'prod';
5692
- }
5693
- function onProductionGlobal() {
5694
- // environment expected to be set in the app in globals.ts
5695
- // eslint-disable-next-line
5696
- return typeof window !== 'undefined' && window.environment === 'prod';
5697
- }
5698
-
5699
- // A temporary method for building the url for a host, eventTypeId, and metadata
5700
- function getBookingUrlImplementation(req) {
5701
- const domain = getDomainFromEnvironment(req.environment);
5702
- const meetingType = req.meetingTypeSlug || req.meetingTypeId || '30-minutes';
5703
- const calendarSlug = req.calendarSlug || req.calendarId;
5704
- let url = `https://${domain}/book/${calendarSlug}/${meetingType}`;
5705
- if (calendarSlug.startsWith("GRP-")) {
5706
- url = `https://${domain}/group/${calendarSlug}/${meetingType}`;
5707
- }
5708
- if (calendarSlug.startsWith("SVS-")) {
5709
- url = `https://${domain}/service/${calendarSlug}/${meetingType}`;
5710
- }
5711
- if (!req.metadata) {
5712
- return url;
5713
- }
5714
- return addMetadataToBookingLink({ link: url, metadata: req.metadata });
5715
- }
5716
- function getGeneralBookingUrlImplementation(req) {
5717
- const url = `https://${getDomainFromEnvironment(req.environment)}/${req.calendarSlug || req.calendarId}`;
5718
- return req.metadata ? addMetadataToBookingLink({ link: url, metadata: req.metadata }) : url;
5719
- }
5720
- function getDomainFromEnvironment(env) {
5721
- if (env === Environment.PROD) {
5722
- return 'bookmenow.info';
5723
- }
5724
- return 'meetings-demo.apigateway.co';
5725
- }
5726
- function addMetadataToBookingLink(req) {
5727
- if (!req.metadata) {
5728
- return req.link;
5729
- }
5730
- const m = req.metadata;
5731
- const queryParams = Object.keys(m).reduce((params, key) => {
5732
- if (!params) {
5733
- if (req.link.indexOf('?') >= 0) {
5734
- return `&${key}=${m[key]}`;
5735
- }
5736
- return `?${key}=${m[key]}`;
5737
- }
5738
- return `${params}&${key}=${m[key]}`;
5739
- }, '');
5740
- return `${req.link}${queryParams}`;
5741
- }
5742
-
5743
- function MeetingTypeFromApi(req) {
5744
- var _a;
5745
- let bookingUrl = ((_a = req === null || req === void 0 ? void 0 : req.meetingTypeApi) === null || _a === void 0 ? void 0 : _a.bookingUrl) || '';
5746
- if (bookingUrl === '') {
5747
- bookingUrl = getBookingUrlImplementation({
5748
- environment: req.environment,
5749
- calendarId: req.calendarId,
5750
- meetingTypeSlug: req.meetingTypeApi.meetingTypeSlug || req.meetingTypeApi.id || '',
5751
- metadata: req.metadata,
5752
- calendarSlug: req.calendarSlug,
5753
- });
5754
- }
5755
- else {
5756
- bookingUrl = addMetadataToBookingLink({ link: bookingUrl, metadata: req.metadata || {} });
5757
- }
5758
- const form = Object.assign(Object.assign({}, (req.meetingTypeApi.form || { fields: [] })), { fields: (req.meetingTypeApi.form && req.meetingTypeApi.form.fields ? req.meetingTypeApi.form.fields : []).map(field => {
5759
- return Object.assign(Object.assign({}, field), { id: field.id || '', label: field.label || '', type: field.type || FormFieldType.FORM_FIELD_TYPE_INVALID, required: field.required || false });
5760
- }) });
5761
- return {
5762
- id: req.meetingTypeApi.id || '',
5763
- calendarId: req.meetingTypeApi.calendarId || '',
5764
- name: req.meetingTypeApi.name || '',
5765
- duration: req.meetingTypeApi.duration || '',
5766
- bookingUrl: bookingUrl,
5767
- bookingLink: req.meetingTypeApi.meetingTypeSlug || '',
5768
- meetingTypeSlug: req.meetingTypeApi.meetingTypeSlug || '',
5769
- description: req.meetingTypeApi.description || '',
5770
- hexColor: req.meetingTypeApi.hexColor || '',
5771
- form: form,
5772
- hostUserIds: req.meetingTypeApi.hostUserIds || [],
5773
- availabilityIncrement: req.meetingTypeApi.availabilityIncrement || -1,
5774
- bufferDurationAfterMeeting: req.meetingTypeApi.bufferDurationAfterMeeting || 0,
5775
- bufferDurationBeforeMeeting: req.meetingTypeApi.bufferDurationBeforeMeeting || 0,
5776
- noticeTime: req.meetingTypeApi.noticeTime || 0,
5777
- location: req.meetingTypeApi.location || '',
5778
- locationGuidelines: req.meetingTypeApi.locationGuidelines || '',
5779
- emailSubject: req.meetingTypeApi.emailSubject || '',
5780
- emailDescription: req.meetingTypeApi.emailDescription || '',
5781
- isPinned: req.meetingTypeApi.isPinned || false,
5782
- CalendarType: req.meetingTypeApi.calendarType || '',
5783
- hostUsers: req.meetingTypeApi.hostUsers || [],
5784
- teamName: req.meetingTypeApi.teamName || '',
5785
- isVideoLinkDisabled: req.meetingTypeApi.isVideoLinkDisabled || false,
5786
- locationType: req.meetingTypeApi.locationType || MeetingLocationType.VIDEO,
5787
- meetingType: req.meetingTypeApi.meetingType || TeamEventMeetingType.ROUND_ROBIN,
5788
- dateRange: req.meetingTypeApi.dateRange || {},
5789
- };
5790
- }
5791
- function MeetingTypeToApi(req) {
5792
- const m = req.meetingType;
5793
- if (!m) {
5794
- return {};
5795
- }
5796
- return {
5797
- id: m.id || undefined,
5798
- name: m.name || undefined,
5799
- hexColor: m.hexColor || undefined,
5800
- meetingTypeSlug: m.meetingTypeSlug || m.bookingLink || undefined,
5801
- calendarId: m.calendarId || undefined,
5802
- description: m.description || undefined,
5803
- duration: m.duration ? m.duration : undefined,
5804
- form: m.form || undefined,
5805
- hostUserIds: m.hostUserIds || undefined,
5806
- availabilityIncrement: m.availabilityIncrement || undefined,
5807
- bufferDurationAfterMeeting: m.bufferDurationAfterMeeting || 0,
5808
- noticeTime: m.noticeTime || 0,
5809
- location: m.location || undefined,
5810
- locationGuidelines: m.locationGuidelines || undefined,
5811
- emailSubject: m.emailSubject || undefined,
5812
- emailDescription: m.emailDescription || undefined,
5813
- isPinned: m.isPinned || undefined,
5814
- calendarType: m.CalendarType || undefined,
5815
- hostUsers: m.hostUsers || undefined,
5816
- teamName: m.teamName || undefined,
5817
- isVideoLinkDisabled: m.isVideoLinkDisabled || false,
5818
- locationType: m.locationType || MeetingLocationType.VIDEO,
5819
- bufferDurationBeforeMeeting: m.bufferDurationBeforeMeeting || 0,
5820
- meetingType: m.meetingType || TeamEventMeetingType.ROUND_ROBIN,
5821
- dateRange: m.dateRange || undefined
5822
- };
5823
- }
5824
-
5825
- // These represent well-known metadata keys used for more than just tracking
5826
- var WellKnownMeetingMetadataKeys;
5827
- (function (WellKnownMeetingMetadataKeys) {
5828
- // This is the business (AG) attached to a meeting. This is attached via sending msm_business as a query param during booking
5829
- WellKnownMeetingMetadataKeys["BUSINESS"] = "msm_business";
5830
- })(WellKnownMeetingMetadataKeys || (WellKnownMeetingMetadataKeys = {}));
5831
- // These are part of the standard Meeting Scheduler form.
5832
- // If you are trying to pre-fill these fields use the helper formFieldIdToMetadataParam
5833
- var WellKnownFormFieldIds;
5834
- (function (WellKnownFormFieldIds) {
5835
- WellKnownFormFieldIds["FIRST_NAME"] = "firstName";
5836
- WellKnownFormFieldIds["LAST_NAME"] = "lastName";
5837
- WellKnownFormFieldIds["EMAIL"] = "email";
5838
- WellKnownFormFieldIds["PHONE_NUMBER"] = "phoneNumber";
5839
- WellKnownFormFieldIds["COMMENT"] = "comment";
5840
- WellKnownFormFieldIds["INVITEE_EMAILS"] = "inviteeEmail";
5841
- })(WellKnownFormFieldIds || (WellKnownFormFieldIds = {}));
5842
- // Converts the given id into a metadata key that can be sent on the url.
5843
- // This means the key will be used to pre-fill those form fields.
5844
- // This can also be used on fields that are not metadata to ensure they will come across in metadata.
5845
- function meetingSchedulerIdToMetadataKey(id) {
5846
- if (!id) {
5847
- return '';
5848
- }
5849
- return id.startsWith('msm_') || id.startsWith('utm_') ? id : `msm_${id}`;
5850
- }
5851
- function meetingFromApi(meetingApi) {
5852
- return {
5853
- id: meetingApi.id,
5854
- eventTypeId: meetingApi.eventTypeId,
5855
- hostId: meetingApi.hostId,
5856
- start: meetingApi.start,
5857
- end: meetingApi.end,
5858
- description: meetingApi.description || '',
5859
- joinMeetingUrl: meetingApi.joinMeetingUrl || '',
5860
- attendees: meetingApi.attendees ? meetingApi.attendees.map(a => ({
5861
- firstName: a.firstName,
5862
- lastName: a.lastName,
5863
- email: a.email,
5864
- phoneNumber: a.phoneNumber,
5865
- timeZone: a.timeZone,
5866
- isPrimary: a.isPrimary || false,
5867
- })) : [],
5868
- created: meetingApi.created,
5869
- updated: meetingApi.updated,
5870
- topic: meetingApi.topic,
5871
- formAnswers: answersFromAPI(meetingApi.formAnswers),
5872
- metadata: meetingApi.metadata || {},
5873
- attachments: (meetingApi.attachments || []).map(a => {
5874
- return {
5875
- fileTitle: a.fileTitle || '',
5876
- fileUrl: a.fileUrl || '',
5877
- fileType: a.fileType || '',
5878
- };
5879
- }),
5880
- location: meetingApi.location || '',
5881
- calendarId: meetingApi.calendarId || '',
5882
- hostDetails: (meetingApi.hostDetails || []).map(h => {
5883
- return {
5884
- hostID: h.hostId || '',
5885
- name: h.name || '',
5886
- };
5887
- }),
5888
- meetingType: meetingApi.meetingType,
5889
- };
5890
- }
5891
- function answersFromAPI(formAnswers) {
5892
- if (!formAnswers) {
5893
- return { formAnswers: [] };
5894
- }
5895
- return {
5896
- formAnswers: (formAnswers.formAnswers ? formAnswers.formAnswers : []).map(a => {
5897
- return {
5898
- id: a.id || '',
5899
- label: a.label || '',
5900
- type: a.type || FormFieldType.FORM_FIELD_TYPE_INVALID,
5901
- answer: a.answer || [],
5902
- };
5903
- })
5904
- };
5905
- }
5906
- function answersToAPI(formAnswers) {
5907
- if (!formAnswers) {
5908
- return { formAnswers: [] };
5909
- }
5910
- return {
5911
- formAnswers: (formAnswers.formAnswers || []).map(a => {
5912
- return {
5913
- id: a.id || undefined,
5914
- label: a.label || undefined,
5915
- type: a.type,
5916
- answer: a.answer || undefined,
5917
- };
5918
- })
5919
- };
5920
- }
5921
-
5922
- class PagedResponse {
5923
- constructor(results, nextCursor, hasMore) {
5924
- this.results = results;
5925
- this.nextCursor = nextCursor;
5926
- this.hasMore = hasMore;
5927
- }
5928
- }
5929
-
5930
6017
  function CalendarFromApi(calendarAPI) {
5931
6018
  return {
5932
6019
  id: calendarAPI.id || '',
@@ -6040,7 +6127,8 @@ function hostUserFromApi(hostUser) {
6040
6127
  return {
6041
6128
  userId: hostUser.userId || '',
6042
6129
  displayName: hostUser.displayName || '',
6043
- isConfigured: hostUser.isConfigured || false
6130
+ isConfigured: hostUser.isConfigured || false,
6131
+ isConnected: hostUser.isConnected || false,
6044
6132
  };
6045
6133
  }
6046
6134
 
@@ -6723,5 +6811,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.3", ngImpor
6723
6811
  * Generated bundle index. Do not edit.
6724
6812
  */
6725
6813
 
6726
- export { CalendarSource, CalendarType, Contact, CreateCalendarRequest, CreateCalendarResponse, DateRangeType, DayOfWeek, FormFieldType, GuestService, HostService, KnownCalendarApplicationContextKeys, KnownCalendarExternalIntegrations, MeetingBotService, MeetingLocationType, MeetingSource, MeetingSourceInfo, MeetingSourceListResponse, MeetingSourceOrigin, MeetingSourceQuery, MeetingSourceStatus, MeetingsService, OnBoardingState, PagedResponse, RelativeTimeUnit, TeamEventMeetingType, WeekdayAvailability, WellKnownFormFieldIds, WellKnownMeetingMetadataKeys, addMetadataToBookingLink, durationFromString, durationStringToMinutes, durationToString, meetingSchedulerIdToMetadataKey, newBusinessCenterApplicationContextProperties, newPartnerCenterApplicationContextProperties, newSalesCenterApplicationContextProperties };
6814
+ export { CalendarSource, CalendarType, Contact, CreateCalendarRequest, CreateCalendarResponse, DateRangeType, DayOfWeek, FormFieldType, GuestService, HostService, KnownCalendarApplicationContextKeys, KnownCalendarExternalIntegrations, MeetingLocationType, MeetingSource, MeetingSourceInfo, MeetingSourceListResponse, MeetingSourceOrigin, MeetingSourceQuery, MeetingSourceStatus, MeetingsService, OnBoardingState, PagedResponse, RelativeTimeUnit, TeamEventMeetingType, WeekdayAvailability, WellKnownFormFieldIds, WellKnownMeetingMetadataKeys, addMetadataToBookingLink, durationFromString, durationStringToMinutes, durationToString, meetingSchedulerIdToMetadataKey, newBusinessCenterApplicationContextProperties, newPartnerCenterApplicationContextProperties, newSalesCenterApplicationContextProperties };
6727
6815
  //# sourceMappingURL=vendasta-meetings.mjs.map