@vendasta/meetings 1.9.1 → 1.10.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.
Files changed (52) hide show
  1. package/esm2020/lib/_internal/interfaces/index.mjs +1 -1
  2. package/esm2020/lib/_internal/interfaces/meeting-external.interface.mjs +1 -1
  3. package/esm2020/lib/_internal/interfaces/meeting-guest.interface.mjs +1 -1
  4. package/esm2020/lib/_internal/interfaces/meeting-host.interface.mjs +1 -1
  5. package/esm2020/lib/_internal/interfaces/shared.interface.mjs +1 -1
  6. package/esm2020/lib/_internal/meeting-host.api.service.mjs +7 -2
  7. package/esm2020/lib/_internal/objects/annotations.mjs +1 -1
  8. package/esm2020/lib/_internal/objects/date-range.mjs +1 -1
  9. package/esm2020/lib/_internal/objects/field-mask.mjs +1 -1
  10. package/esm2020/lib/_internal/objects/google-meet.mjs +1 -1
  11. package/esm2020/lib/_internal/objects/groups-and-services.mjs +1 -1
  12. package/esm2020/lib/_internal/objects/index.mjs +3 -3
  13. package/esm2020/lib/_internal/objects/meeting-external.mjs +2 -2
  14. package/esm2020/lib/_internal/objects/meeting-guest.mjs +2 -2
  15. package/esm2020/lib/_internal/objects/meeting-host.mjs +169 -25
  16. package/esm2020/lib/_internal/objects/meeting-source.mjs +1 -1
  17. package/esm2020/lib/_internal/objects/meeting-type.mjs +1 -1
  18. package/esm2020/lib/_internal/objects/openapiv2.mjs +1 -1
  19. package/esm2020/lib/_internal/objects/shared.mjs +1 -1
  20. package/esm2020/lib/_internal/objects/zoom.mjs +1 -1
  21. package/esm2020/lib/host/host.service.mjs +14 -2
  22. package/esm2020/lib/index.mjs +1 -1
  23. package/esm2020/lib/shared/index.mjs +2 -1
  24. package/esm2020/lib/shared/meeting-stats.mjs +17 -0
  25. package/fesm2015/vendasta-meetings.mjs +201 -23
  26. package/fesm2015/vendasta-meetings.mjs.map +1 -1
  27. package/fesm2020/vendasta-meetings.mjs +201 -23
  28. package/fesm2020/vendasta-meetings.mjs.map +1 -1
  29. package/lib/_internal/interfaces/index.d.ts +2 -2
  30. package/lib/_internal/interfaces/meeting-external.interface.d.ts +1 -1
  31. package/lib/_internal/interfaces/meeting-guest.interface.d.ts +1 -1
  32. package/lib/_internal/interfaces/meeting-host.interface.d.ts +30 -8
  33. package/lib/_internal/meeting-host.api.service.d.ts +3 -2
  34. package/lib/_internal/objects/annotations.d.ts +1 -1
  35. package/lib/_internal/objects/date-range.d.ts +1 -1
  36. package/lib/_internal/objects/field-mask.d.ts +1 -1
  37. package/lib/_internal/objects/google-meet.d.ts +1 -1
  38. package/lib/_internal/objects/groups-and-services.d.ts +1 -1
  39. package/lib/_internal/objects/index.d.ts +2 -2
  40. package/lib/_internal/objects/meeting-external.d.ts +2 -2
  41. package/lib/_internal/objects/meeting-guest.d.ts +2 -2
  42. package/lib/_internal/objects/meeting-host.d.ts +47 -16
  43. package/lib/_internal/objects/meeting-source.d.ts +1 -1
  44. package/lib/_internal/objects/meeting-type.d.ts +1 -1
  45. package/lib/_internal/objects/openapiv2.d.ts +1 -1
  46. package/lib/_internal/objects/shared.d.ts +1 -1
  47. package/lib/_internal/objects/zoom.d.ts +1 -1
  48. package/lib/host/host.service.d.ts +6 -1
  49. package/lib/index.d.ts +1 -1
  50. package/lib/shared/index.d.ts +1 -0
  51. package/lib/shared/meeting-stats.d.ts +17 -0
  52. package/package.json +1 -1
@@ -7330,6 +7330,12 @@ class EventTypeSummary {
7330
7330
  if (proto.dateRange) {
7331
7331
  m.dateRange = EventTypeDateRange.fromProto(proto.dateRange);
7332
7332
  }
7333
+ if (proto.bufferDurationBeforeMeeting) {
7334
+ m.bufferDurationBeforeMeeting = parseInt(proto.bufferDurationBeforeMeeting, 10);
7335
+ }
7336
+ if (proto.bufferDurationAfterMeeting) {
7337
+ m.bufferDurationAfterMeeting = parseInt(proto.bufferDurationAfterMeeting, 10);
7338
+ }
7333
7339
  return m;
7334
7340
  }
7335
7341
  constructor(kwargs) {
@@ -7388,13 +7394,22 @@ class EventTypeSummary {
7388
7394
  if (typeof this.description !== 'undefined') {
7389
7395
  toReturn['description'] = this.description;
7390
7396
  }
7397
+ if (typeof this.bufferDurationBeforeMeeting !== 'undefined') {
7398
+ toReturn['bufferDurationBeforeMeeting'] = this.bufferDurationBeforeMeeting;
7399
+ }
7400
+ if (typeof this.bufferDurationAfterMeeting !== 'undefined') {
7401
+ toReturn['bufferDurationAfterMeeting'] = this.bufferDurationAfterMeeting;
7402
+ }
7391
7403
  return toReturn;
7392
7404
  }
7393
7405
  }
7394
- class ListAvailabilityRequestFilters {
7406
+ class ListBookedMeetingsRequestFilters {
7395
7407
  static fromProto(proto) {
7396
- let m = new ListAvailabilityRequestFilters();
7408
+ let m = new ListBookedMeetingsRequestFilters();
7397
7409
  m = Object.assign(m, proto);
7410
+ if (proto.timeSpan) {
7411
+ m.timeSpan = DateRange.fromProto(proto.timeSpan);
7412
+ }
7398
7413
  return m;
7399
7414
  }
7400
7415
  constructor(kwargs) {
@@ -7405,22 +7420,25 @@ class ListAvailabilityRequestFilters {
7405
7420
  }
7406
7421
  toApiJson() {
7407
7422
  const toReturn = {};
7423
+ if (typeof this.meetingTypeIds !== 'undefined') {
7424
+ toReturn['meetingTypeIds'] = this.meetingTypeIds;
7425
+ }
7408
7426
  if (typeof this.hostId !== 'undefined') {
7409
7427
  toReturn['hostId'] = this.hostId;
7410
7428
  }
7411
- if (typeof this.meetingTypeId !== 'undefined') {
7412
- toReturn['meetingTypeId'] = this.meetingTypeId;
7429
+ if (typeof this.timeSpan !== 'undefined' && this.timeSpan !== null) {
7430
+ toReturn['timeSpan'] = 'toApiJson' in this.timeSpan ? this.timeSpan.toApiJson() : this.timeSpan;
7431
+ }
7432
+ if (typeof this.userIds !== 'undefined') {
7433
+ toReturn['userIds'] = this.userIds;
7413
7434
  }
7414
7435
  return toReturn;
7415
7436
  }
7416
7437
  }
7417
- class ListBookedMeetingsRequestFilters {
7438
+ class ListAvailabilityRequestFilters {
7418
7439
  static fromProto(proto) {
7419
- let m = new ListBookedMeetingsRequestFilters();
7440
+ let m = new ListAvailabilityRequestFilters();
7420
7441
  m = Object.assign(m, proto);
7421
- if (proto.timeSpan) {
7422
- m.timeSpan = DateRange.fromProto(proto.timeSpan);
7423
- }
7424
7442
  return m;
7425
7443
  }
7426
7444
  constructor(kwargs) {
@@ -7431,17 +7449,11 @@ class ListBookedMeetingsRequestFilters {
7431
7449
  }
7432
7450
  toApiJson() {
7433
7451
  const toReturn = {};
7434
- if (typeof this.meetingTypeIds !== 'undefined') {
7435
- toReturn['meetingTypeIds'] = this.meetingTypeIds;
7436
- }
7437
7452
  if (typeof this.hostId !== 'undefined') {
7438
7453
  toReturn['hostId'] = this.hostId;
7439
7454
  }
7440
- if (typeof this.timeSpan !== 'undefined' && this.timeSpan !== null) {
7441
- toReturn['timeSpan'] = 'toApiJson' in this.timeSpan ? this.timeSpan.toApiJson() : this.timeSpan;
7442
- }
7443
- if (typeof this.userIds !== 'undefined') {
7444
- toReturn['userIds'] = this.userIds;
7455
+ if (typeof this.meetingTypeId !== 'undefined') {
7456
+ toReturn['meetingTypeId'] = this.meetingTypeId;
7445
7457
  }
7446
7458
  return toReturn;
7447
7459
  }
@@ -7673,6 +7685,109 @@ class GetHostsForCalendarResponse {
7673
7685
  return toReturn;
7674
7686
  }
7675
7687
  }
7688
+ class GetMeetingStatsRequest {
7689
+ static fromProto(proto) {
7690
+ let m = new GetMeetingStatsRequest();
7691
+ m = Object.assign(m, proto);
7692
+ if (proto.timeSpan) {
7693
+ m.timeSpan = DateRange.fromProto(proto.timeSpan);
7694
+ }
7695
+ if (proto.timeZone) {
7696
+ m.timeZone = TimeZone.fromProto(proto.timeZone);
7697
+ }
7698
+ return m;
7699
+ }
7700
+ constructor(kwargs) {
7701
+ if (!kwargs) {
7702
+ return;
7703
+ }
7704
+ Object.assign(this, kwargs);
7705
+ }
7706
+ toApiJson() {
7707
+ const toReturn = {};
7708
+ if (typeof this.timeSpan !== 'undefined' && this.timeSpan !== null) {
7709
+ toReturn['timeSpan'] = 'toApiJson' in this.timeSpan ? this.timeSpan.toApiJson() : this.timeSpan;
7710
+ }
7711
+ if (typeof this.timeZone !== 'undefined' && this.timeZone !== null) {
7712
+ toReturn['timeZone'] = 'toApiJson' in this.timeZone ? this.timeZone.toApiJson() : this.timeZone;
7713
+ }
7714
+ if (typeof this.businessId !== 'undefined') {
7715
+ toReturn['businessId'] = this.businessId;
7716
+ }
7717
+ return toReturn;
7718
+ }
7719
+ }
7720
+ class GetMeetingStatsResponse {
7721
+ static fromProto(proto) {
7722
+ let m = new GetMeetingStatsResponse();
7723
+ m = Object.assign(m, proto);
7724
+ if (proto.totalMeetingsScheduled) {
7725
+ m.totalMeetingsScheduled = parseInt(proto.totalMeetingsScheduled, 10);
7726
+ }
7727
+ if (proto.previousTotalMeetingsScheduled) {
7728
+ m.previousTotalMeetingsScheduled = parseInt(proto.previousTotalMeetingsScheduled, 10);
7729
+ }
7730
+ if (proto.dailyMeetingsScheduled) {
7731
+ m.dailyMeetingsScheduled = proto.dailyMeetingsScheduled.map(MeetingStatPoint.fromProto);
7732
+ }
7733
+ if (proto.totalMeetingsCancelled) {
7734
+ m.totalMeetingsCancelled = parseInt(proto.totalMeetingsCancelled, 10);
7735
+ }
7736
+ if (proto.totalMeetingsRescheduled) {
7737
+ m.totalMeetingsRescheduled = parseInt(proto.totalMeetingsRescheduled, 10);
7738
+ }
7739
+ if (proto.totalAbandonedCarts) {
7740
+ m.totalAbandonedCarts = parseInt(proto.totalAbandonedCarts, 10);
7741
+ }
7742
+ if (proto.totalCalendarDisconnected) {
7743
+ m.totalCalendarDisconnected = parseInt(proto.totalCalendarDisconnected, 10);
7744
+ }
7745
+ if (proto.totalBookedByAiChat) {
7746
+ m.totalBookedByAiChat = parseInt(proto.totalBookedByAiChat, 10);
7747
+ }
7748
+ if (proto.totalBookedByAiVoice) {
7749
+ m.totalBookedByAiVoice = parseInt(proto.totalBookedByAiVoice, 10);
7750
+ }
7751
+ return m;
7752
+ }
7753
+ constructor(kwargs) {
7754
+ if (!kwargs) {
7755
+ return;
7756
+ }
7757
+ Object.assign(this, kwargs);
7758
+ }
7759
+ toApiJson() {
7760
+ const toReturn = {};
7761
+ if (typeof this.totalMeetingsScheduled !== 'undefined') {
7762
+ toReturn['totalMeetingsScheduled'] = this.totalMeetingsScheduled;
7763
+ }
7764
+ if (typeof this.previousTotalMeetingsScheduled !== 'undefined') {
7765
+ toReturn['previousTotalMeetingsScheduled'] = this.previousTotalMeetingsScheduled;
7766
+ }
7767
+ if (typeof this.dailyMeetingsScheduled !== 'undefined' && this.dailyMeetingsScheduled !== null) {
7768
+ toReturn['dailyMeetingsScheduled'] = 'toApiJson' in this.dailyMeetingsScheduled ? this.dailyMeetingsScheduled.toApiJson() : this.dailyMeetingsScheduled;
7769
+ }
7770
+ if (typeof this.totalMeetingsCancelled !== 'undefined') {
7771
+ toReturn['totalMeetingsCancelled'] = this.totalMeetingsCancelled;
7772
+ }
7773
+ if (typeof this.totalMeetingsRescheduled !== 'undefined') {
7774
+ toReturn['totalMeetingsRescheduled'] = this.totalMeetingsRescheduled;
7775
+ }
7776
+ if (typeof this.totalAbandonedCarts !== 'undefined') {
7777
+ toReturn['totalAbandonedCarts'] = this.totalAbandonedCarts;
7778
+ }
7779
+ if (typeof this.totalCalendarDisconnected !== 'undefined') {
7780
+ toReturn['totalCalendarDisconnected'] = this.totalCalendarDisconnected;
7781
+ }
7782
+ if (typeof this.totalBookedByAiChat !== 'undefined') {
7783
+ toReturn['totalBookedByAiChat'] = this.totalBookedByAiChat;
7784
+ }
7785
+ if (typeof this.totalBookedByAiVoice !== 'undefined') {
7786
+ toReturn['totalBookedByAiVoice'] = this.totalBookedByAiVoice;
7787
+ }
7788
+ return toReturn;
7789
+ }
7790
+ }
7676
7791
  class GetMeetingTypesForCalendarsRequest {
7677
7792
  static fromProto(proto) {
7678
7793
  let m = new GetMeetingTypesForCalendarsRequest();
@@ -9088,6 +9203,35 @@ class Meeting {
9088
9203
  return toReturn;
9089
9204
  }
9090
9205
  }
9206
+ class MeetingStatPoint {
9207
+ static fromProto(proto) {
9208
+ let m = new MeetingStatPoint();
9209
+ m = Object.assign(m, proto);
9210
+ if (proto.date) {
9211
+ m.date = new Date(proto.date);
9212
+ }
9213
+ if (proto.count) {
9214
+ m.count = parseInt(proto.count, 10);
9215
+ }
9216
+ return m;
9217
+ }
9218
+ constructor(kwargs) {
9219
+ if (!kwargs) {
9220
+ return;
9221
+ }
9222
+ Object.assign(this, kwargs);
9223
+ }
9224
+ toApiJson() {
9225
+ const toReturn = {};
9226
+ if (typeof this.date !== 'undefined' && this.date !== null) {
9227
+ toReturn['date'] = 'toApiJson' in this.date ? this.date.toApiJson() : this.date;
9228
+ }
9229
+ if (typeof this.count !== 'undefined') {
9230
+ toReturn['count'] = this.count;
9231
+ }
9232
+ return toReturn;
9233
+ }
9234
+ }
9091
9235
  class MeetingTypeList {
9092
9236
  static fromProto(proto) {
9093
9237
  let m = new MeetingTypeList();
@@ -9111,9 +9255,9 @@ class MeetingTypeList {
9111
9255
  return toReturn;
9112
9256
  }
9113
9257
  }
9114
- class UpdateMeetingMetadataRequestMetadataEntry {
9258
+ class HostBookBatchMeetingRequestMetadataEntry {
9115
9259
  static fromProto(proto) {
9116
- let m = new UpdateMeetingMetadataRequestMetadataEntry();
9260
+ let m = new HostBookBatchMeetingRequestMetadataEntry();
9117
9261
  m = Object.assign(m, proto);
9118
9262
  return m;
9119
9263
  }
@@ -9134,9 +9278,9 @@ class UpdateMeetingMetadataRequestMetadataEntry {
9134
9278
  return toReturn;
9135
9279
  }
9136
9280
  }
9137
- class HostBookBatchMeetingRequestMetadataEntry {
9281
+ class MeetingMetadataEntry {
9138
9282
  static fromProto(proto) {
9139
- let m = new HostBookBatchMeetingRequestMetadataEntry();
9283
+ let m = new MeetingMetadataEntry();
9140
9284
  m = Object.assign(m, proto);
9141
9285
  return m;
9142
9286
  }
@@ -9157,9 +9301,9 @@ class HostBookBatchMeetingRequestMetadataEntry {
9157
9301
  return toReturn;
9158
9302
  }
9159
9303
  }
9160
- class MeetingMetadataEntry {
9304
+ class UpdateMeetingMetadataRequestMetadataEntry {
9161
9305
  static fromProto(proto) {
9162
- let m = new MeetingMetadataEntry();
9306
+ let m = new UpdateMeetingMetadataRequestMetadataEntry();
9163
9307
  m = Object.assign(m, proto);
9164
9308
  return m;
9165
9309
  }
@@ -10435,6 +10579,11 @@ class MeetingHostApiService {
10435
10579
  return this.http.post(this._host + "/meetings.v1.MeetingHost/ListBookedMeetingsV2", request.toApiJson(), this.apiOptions())
10436
10580
  .pipe(map(resp => ListBookedMeetingsV2Response.fromProto(resp)));
10437
10581
  }
10582
+ getMeetingStats(r) {
10583
+ const request = (r.toApiJson) ? r : new GetMeetingStatsRequest(r);
10584
+ return this.http.post(this._host + "/meetings.v1.MeetingHost/GetMeetingStats", request.toApiJson(), this.apiOptions())
10585
+ .pipe(map(resp => GetMeetingStatsResponse.fromProto(resp)));
10586
+ }
10438
10587
  cancelMeeting(r) {
10439
10588
  const request = (r.toApiJson) ? r : new CancelMeetingRequest(r);
10440
10589
  return this.http.post(this._host + "/meetings.v1.MeetingHost/CancelMeeting", request.toApiJson(), { ...this.apiOptions(), observe: 'response' });
@@ -11187,6 +11336,23 @@ var MeetingSourceOrigin;
11187
11336
  MeetingSourceOrigin["SalesCenter"] = "sales-center";
11188
11337
  })(MeetingSourceOrigin || (MeetingSourceOrigin = {}));
11189
11338
 
11339
+ function meetingStatsFromApi(resp) {
11340
+ return {
11341
+ totalMeetingsScheduled: resp.totalMeetingsScheduled || 0,
11342
+ previousTotalMeetingsScheduled: resp.previousTotalMeetingsScheduled || 0,
11343
+ dailyMeetingsScheduled: (resp.dailyMeetingsScheduled || []).map((point) => ({
11344
+ date: point.date,
11345
+ count: point.count || 0,
11346
+ })),
11347
+ totalMeetingsCancelled: resp.totalMeetingsCancelled || 0,
11348
+ totalMeetingsRescheduled: resp.totalMeetingsRescheduled || 0,
11349
+ totalAbandonedCarts: resp.totalAbandonedCarts || 0,
11350
+ totalCalendarDisconnected: resp.totalCalendarDisconnected || 0,
11351
+ totalBookedByAiChat: resp.totalBookedByAiChat || 0,
11352
+ totalBookedByAiVoice: resp.totalBookedByAiVoice || 0,
11353
+ };
11354
+ }
11355
+
11190
11356
  class GuestService {
11191
11357
  constructor(guestAPIService) {
11192
11358
  this.guestAPIService = guestAPIService;
@@ -11725,6 +11891,18 @@ class HostService {
11725
11891
  hostCancelBatchMeeting(req) {
11726
11892
  return this.hostAPIService.hostCancelBatchMeeting(req).pipe(mapTo(null));
11727
11893
  }
11894
+ // getMeetingStats returns aggregated meeting statistics for the host, backing the
11895
+ // "My Meetings" dashboard card. timeSpan must be expressed in the caller's time zone;
11896
+ // timeZone is used to bucket meetings into days and to align the comparison period.
11897
+ getMeetingStats(req) {
11898
+ return this.hostAPIService
11899
+ .getMeetingStats({
11900
+ timeSpan: req.timeSpan,
11901
+ timeZone: req.timeZone,
11902
+ businessId: req.businessId,
11903
+ })
11904
+ .pipe(map((resp) => meetingStatsFromApi(resp)));
11905
+ }
11728
11906
  // hostListBatchAvailableTimeSlots returns valid chain start times for a
11729
11907
  // multi-service host booking. Each slot is the start of the first meeting
11730
11908
  // in the chain.