@vendasta/meetings 0.91.0 → 0.92.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.
@@ -1804,6 +1804,145 @@ function enumStringToValue$5(enumRef, value) {
1804
1804
  }
1805
1805
  return enumRef[value];
1806
1806
  }
1807
+ class EventGroupAndServiceAssociations {
1808
+ static fromProto(proto) {
1809
+ let m = new EventGroupAndServiceAssociations();
1810
+ m = Object.assign(m, proto);
1811
+ return m;
1812
+ }
1813
+ constructor(kwargs) {
1814
+ if (!kwargs) {
1815
+ return;
1816
+ }
1817
+ Object.assign(this, kwargs);
1818
+ }
1819
+ toApiJson() {
1820
+ const toReturn = {};
1821
+ if (typeof this.id !== 'undefined') {
1822
+ toReturn['id'] = this.id;
1823
+ }
1824
+ if (typeof this.name !== 'undefined') {
1825
+ toReturn['name'] = this.name;
1826
+ }
1827
+ if (typeof this.eventType !== 'undefined') {
1828
+ toReturn['eventType'] = this.eventType;
1829
+ }
1830
+ if (typeof this.identifier !== 'undefined') {
1831
+ toReturn['identifier'] = this.identifier;
1832
+ }
1833
+ if (typeof this.isEditable !== 'undefined') {
1834
+ toReturn['isEditable'] = this.isEditable;
1835
+ }
1836
+ if (typeof this.creatorUserName !== 'undefined') {
1837
+ toReturn['creatorUserName'] = this.creatorUserName;
1838
+ }
1839
+ if (typeof this.calendarId !== 'undefined') {
1840
+ toReturn['calendarId'] = this.calendarId;
1841
+ }
1842
+ if (typeof this.hexColor !== 'undefined') {
1843
+ toReturn['hexColor'] = this.hexColor;
1844
+ }
1845
+ if (typeof this.duration !== 'undefined') {
1846
+ toReturn['duration'] = this.duration;
1847
+ }
1848
+ return toReturn;
1849
+ }
1850
+ }
1851
+ class Group {
1852
+ static fromProto(proto) {
1853
+ let m = new Group();
1854
+ m = Object.assign(m, proto);
1855
+ if (proto.associations) {
1856
+ m.associations = proto.associations.map(EventGroupAndServiceAssociations.fromProto);
1857
+ }
1858
+ return m;
1859
+ }
1860
+ constructor(kwargs) {
1861
+ if (!kwargs) {
1862
+ return;
1863
+ }
1864
+ Object.assign(this, kwargs);
1865
+ }
1866
+ toApiJson() {
1867
+ const toReturn = {};
1868
+ if (typeof this.id !== 'undefined') {
1869
+ toReturn['id'] = this.id;
1870
+ }
1871
+ if (typeof this.name !== 'undefined') {
1872
+ toReturn['name'] = this.name;
1873
+ }
1874
+ if (typeof this.description !== 'undefined') {
1875
+ toReturn['description'] = this.description;
1876
+ }
1877
+ if (typeof this.slug !== 'undefined') {
1878
+ toReturn['slug'] = this.slug;
1879
+ }
1880
+ if (typeof this.isPinned !== 'undefined') {
1881
+ toReturn['isPinned'] = this.isPinned;
1882
+ }
1883
+ if (typeof this.associations !== 'undefined' && this.associations !== null) {
1884
+ toReturn['associations'] = 'toApiJson' in this.associations ? this.associations.toApiJson() : this.associations;
1885
+ }
1886
+ if (typeof this.hexColor !== 'undefined') {
1887
+ toReturn['hexColor'] = this.hexColor;
1888
+ }
1889
+ if (typeof this.bookingUrl !== 'undefined') {
1890
+ toReturn['bookingUrl'] = this.bookingUrl;
1891
+ }
1892
+ return toReturn;
1893
+ }
1894
+ }
1895
+ class Service {
1896
+ static fromProto(proto) {
1897
+ let m = new Service();
1898
+ m = Object.assign(m, proto);
1899
+ if (proto.associations) {
1900
+ m.associations = proto.associations.map(EventGroupAndServiceAssociations.fromProto);
1901
+ }
1902
+ return m;
1903
+ }
1904
+ constructor(kwargs) {
1905
+ if (!kwargs) {
1906
+ return;
1907
+ }
1908
+ Object.assign(this, kwargs);
1909
+ }
1910
+ toApiJson() {
1911
+ const toReturn = {};
1912
+ if (typeof this.id !== 'undefined') {
1913
+ toReturn['id'] = this.id;
1914
+ }
1915
+ if (typeof this.name !== 'undefined') {
1916
+ toReturn['name'] = this.name;
1917
+ }
1918
+ if (typeof this.description !== 'undefined') {
1919
+ toReturn['description'] = this.description;
1920
+ }
1921
+ if (typeof this.slug !== 'undefined') {
1922
+ toReturn['slug'] = this.slug;
1923
+ }
1924
+ if (typeof this.isPinned !== 'undefined') {
1925
+ toReturn['isPinned'] = this.isPinned;
1926
+ }
1927
+ if (typeof this.associations !== 'undefined' && this.associations !== null) {
1928
+ toReturn['associations'] = 'toApiJson' in this.associations ? this.associations.toApiJson() : this.associations;
1929
+ }
1930
+ if (typeof this.hexColor !== 'undefined') {
1931
+ toReturn['hexColor'] = this.hexColor;
1932
+ }
1933
+ if (typeof this.bookingUrl !== 'undefined') {
1934
+ toReturn['bookingUrl'] = this.bookingUrl;
1935
+ }
1936
+ return toReturn;
1937
+ }
1938
+ }
1939
+
1940
+ function enumStringToValue$4(enumRef, value) {
1941
+ if (typeof value === 'number') {
1942
+ return value;
1943
+ }
1944
+ return enumRef[value];
1945
+ }
1807
1946
  class BookMeetingRequest {
1808
1947
  static fromProto(proto) {
1809
1948
  let m = new BookMeetingRequest();
@@ -1935,6 +2074,52 @@ class GetCalendarResponse {
1935
2074
  return toReturn;
1936
2075
  }
1937
2076
  }
2077
+ class GetGroupRequest {
2078
+ static fromProto(proto) {
2079
+ let m = new GetGroupRequest();
2080
+ m = Object.assign(m, proto);
2081
+ return m;
2082
+ }
2083
+ constructor(kwargs) {
2084
+ if (!kwargs) {
2085
+ return;
2086
+ }
2087
+ Object.assign(this, kwargs);
2088
+ }
2089
+ toApiJson() {
2090
+ const toReturn = {};
2091
+ if (typeof this.groupId !== 'undefined') {
2092
+ toReturn['groupId'] = this.groupId;
2093
+ }
2094
+ if (typeof this.slug !== 'undefined') {
2095
+ toReturn['slug'] = this.slug;
2096
+ }
2097
+ return toReturn;
2098
+ }
2099
+ }
2100
+ class GetGroupResponse {
2101
+ static fromProto(proto) {
2102
+ let m = new GetGroupResponse();
2103
+ m = Object.assign(m, proto);
2104
+ if (proto.group) {
2105
+ m.group = Group.fromProto(proto.group);
2106
+ }
2107
+ return m;
2108
+ }
2109
+ constructor(kwargs) {
2110
+ if (!kwargs) {
2111
+ return;
2112
+ }
2113
+ Object.assign(this, kwargs);
2114
+ }
2115
+ toApiJson() {
2116
+ const toReturn = {};
2117
+ if (typeof this.group !== 'undefined' && this.group !== null) {
2118
+ toReturn['group'] = 'toApiJson' in this.group ? this.group.toApiJson() : this.group;
2119
+ }
2120
+ return toReturn;
2121
+ }
2122
+ }
1938
2123
  class GetHostRequest {
1939
2124
  static fromProto(proto) {
1940
2125
  let m = new GetHostRequest();
@@ -2314,7 +2499,7 @@ class BookMeetingRequestMetadataEntry {
2314
2499
  }
2315
2500
  }
2316
2501
 
2317
- function enumStringToValue$4(enumRef, value) {
2502
+ function enumStringToValue$3(enumRef, value) {
2318
2503
  if (typeof value === 'number') {
2319
2504
  return value;
2320
2505
  }
@@ -2341,136 +2526,6 @@ class FieldMask {
2341
2526
  }
2342
2527
  }
2343
2528
 
2344
- function enumStringToValue$3(enumRef, value) {
2345
- if (typeof value === 'number') {
2346
- return value;
2347
- }
2348
- return enumRef[value];
2349
- }
2350
- class EventGroupAndServiceAssociations {
2351
- static fromProto(proto) {
2352
- let m = new EventGroupAndServiceAssociations();
2353
- m = Object.assign(m, proto);
2354
- return m;
2355
- }
2356
- constructor(kwargs) {
2357
- if (!kwargs) {
2358
- return;
2359
- }
2360
- Object.assign(this, kwargs);
2361
- }
2362
- toApiJson() {
2363
- const toReturn = {};
2364
- if (typeof this.id !== 'undefined') {
2365
- toReturn['id'] = this.id;
2366
- }
2367
- if (typeof this.name !== 'undefined') {
2368
- toReturn['name'] = this.name;
2369
- }
2370
- if (typeof this.eventType !== 'undefined') {
2371
- toReturn['eventType'] = this.eventType;
2372
- }
2373
- if (typeof this.identifier !== 'undefined') {
2374
- toReturn['identifier'] = this.identifier;
2375
- }
2376
- if (typeof this.isEditable !== 'undefined') {
2377
- toReturn['isEditable'] = this.isEditable;
2378
- }
2379
- if (typeof this.creatorUserName !== 'undefined') {
2380
- toReturn['creatorUserName'] = this.creatorUserName;
2381
- }
2382
- return toReturn;
2383
- }
2384
- }
2385
- class Group {
2386
- static fromProto(proto) {
2387
- let m = new Group();
2388
- m = Object.assign(m, proto);
2389
- if (proto.associations) {
2390
- m.associations = proto.associations.map(EventGroupAndServiceAssociations.fromProto);
2391
- }
2392
- return m;
2393
- }
2394
- constructor(kwargs) {
2395
- if (!kwargs) {
2396
- return;
2397
- }
2398
- Object.assign(this, kwargs);
2399
- }
2400
- toApiJson() {
2401
- const toReturn = {};
2402
- if (typeof this.id !== 'undefined') {
2403
- toReturn['id'] = this.id;
2404
- }
2405
- if (typeof this.name !== 'undefined') {
2406
- toReturn['name'] = this.name;
2407
- }
2408
- if (typeof this.description !== 'undefined') {
2409
- toReturn['description'] = this.description;
2410
- }
2411
- if (typeof this.slug !== 'undefined') {
2412
- toReturn['slug'] = this.slug;
2413
- }
2414
- if (typeof this.isPinned !== 'undefined') {
2415
- toReturn['isPinned'] = this.isPinned;
2416
- }
2417
- if (typeof this.associations !== 'undefined' && this.associations !== null) {
2418
- toReturn['associations'] = 'toApiJson' in this.associations ? this.associations.toApiJson() : this.associations;
2419
- }
2420
- if (typeof this.hexColor !== 'undefined') {
2421
- toReturn['hexColor'] = this.hexColor;
2422
- }
2423
- if (typeof this.bookingUrl !== 'undefined') {
2424
- toReturn['bookingUrl'] = this.bookingUrl;
2425
- }
2426
- return toReturn;
2427
- }
2428
- }
2429
- class Service {
2430
- static fromProto(proto) {
2431
- let m = new Service();
2432
- m = Object.assign(m, proto);
2433
- if (proto.associations) {
2434
- m.associations = proto.associations.map(EventGroupAndServiceAssociations.fromProto);
2435
- }
2436
- return m;
2437
- }
2438
- constructor(kwargs) {
2439
- if (!kwargs) {
2440
- return;
2441
- }
2442
- Object.assign(this, kwargs);
2443
- }
2444
- toApiJson() {
2445
- const toReturn = {};
2446
- if (typeof this.id !== 'undefined') {
2447
- toReturn['id'] = this.id;
2448
- }
2449
- if (typeof this.name !== 'undefined') {
2450
- toReturn['name'] = this.name;
2451
- }
2452
- if (typeof this.description !== 'undefined') {
2453
- toReturn['description'] = this.description;
2454
- }
2455
- if (typeof this.slug !== 'undefined') {
2456
- toReturn['slug'] = this.slug;
2457
- }
2458
- if (typeof this.isPinned !== 'undefined') {
2459
- toReturn['isPinned'] = this.isPinned;
2460
- }
2461
- if (typeof this.associations !== 'undefined' && this.associations !== null) {
2462
- toReturn['associations'] = 'toApiJson' in this.associations ? this.associations.toApiJson() : this.associations;
2463
- }
2464
- if (typeof this.hexColor !== 'undefined') {
2465
- toReturn['hexColor'] = this.hexColor;
2466
- }
2467
- if (typeof this.bookingUrl !== 'undefined') {
2468
- toReturn['bookingUrl'] = this.bookingUrl;
2469
- }
2470
- return toReturn;
2471
- }
2472
- }
2473
-
2474
2529
  function enumStringToValue$2(enumRef, value) {
2475
2530
  if (typeof value === 'number') {
2476
2531
  return value;
@@ -4808,6 +4863,11 @@ class MeetingGuestApiService {
4808
4863
  return this.http.post(this._host + "/meetings.v1.MeetingGuest/GetHost", request.toApiJson(), this.apiOptions())
4809
4864
  .pipe(map(resp => GetHostResponse.fromProto(resp)));
4810
4865
  }
4866
+ getGroup(r) {
4867
+ const request = (r.toApiJson) ? r : new GetGroupRequest(r);
4868
+ return this.http.post(this._host + "/meetings.v1.MeetingGuest/GetGroup", request.toApiJson(), this.apiOptions())
4869
+ .pipe(map(resp => GetGroupResponse.fromProto(resp)));
4870
+ }
4811
4871
  isHostConfigured(r) {
4812
4872
  const request = (r.toApiJson) ? r : new GuestIsHostConfiguredRequest(r);
4813
4873
  return this.http.post(this._host + "/meetings.v1.MeetingGuest/IsHostConfigured", request.toApiJson(), this.apiOptions())
@@ -5062,7 +5122,13 @@ function getBookingUrlImplementation(req) {
5062
5122
  const domain = getDomainFromEnvironment(req.environment);
5063
5123
  const meetingType = req.meetingTypeSlug || req.meetingTypeId || '30-minutes';
5064
5124
  const calendarSlug = req.calendarSlug || req.calendarId;
5065
- const url = `https://${domain}/book/${calendarSlug}/${meetingType}`;
5125
+ let url = `https://${domain}/book/${calendarSlug}/${meetingType}`;
5126
+ if (calendarSlug.startsWith("GRP-")) {
5127
+ url = `https://${domain}/group/${calendarSlug}/${meetingType}`;
5128
+ }
5129
+ if (calendarSlug.startsWith("SVS-")) {
5130
+ url = `https://${domain}/service/${calendarSlug}/${meetingType}`;
5131
+ }
5066
5132
  if (!req.metadata) {
5067
5133
  return url;
5068
5134
  }
@@ -5442,7 +5508,7 @@ function AssociationFromApi(associationApi) {
5442
5508
  function GroupFromApi(req) {
5443
5509
  const groupId = req.groupApi.id || '';
5444
5510
  const groupSlug = req.groupApi.slug || '';
5445
- const bookingUrl = req?.groupApi?.bookingUrl || getBookingURL(req.environment, groupSlug, groupId, "group");
5511
+ const bookingUrl = req?.groupApi?.bookingUrl || getBookingURL(req.environment, groupSlug, groupId);
5446
5512
  return {
5447
5513
  id: groupId,
5448
5514
  name: req.groupApi.name || '',
@@ -5454,13 +5520,13 @@ function GroupFromApi(req) {
5454
5520
  bookingUrl: bookingUrl
5455
5521
  };
5456
5522
  }
5457
- function getBookingURL(environment, slug, id, calendarId) {
5523
+ function getBookingURL(environment, slug, calendarId) {
5458
5524
  let bookingUrl = '';
5459
- if (slug != '' || id != '') {
5525
+ if (slug != '') {
5460
5526
  bookingUrl = getBookingUrlImplementation({
5461
5527
  environment: environment,
5462
5528
  calendarId: calendarId,
5463
- meetingTypeSlug: slug || id,
5529
+ meetingTypeSlug: slug,
5464
5530
  });
5465
5531
  }
5466
5532
  return bookingUrl;
@@ -5468,7 +5534,7 @@ function getBookingURL(environment, slug, id, calendarId) {
5468
5534
  function ServiceFromApi(req) {
5469
5535
  const serviceId = req.serviceApi.id || '';
5470
5536
  const serviceSlug = req.serviceApi.slug || '';
5471
- const bookingUrl = req?.serviceApi?.bookingUrl || getBookingURL(req.environment, serviceSlug, serviceId, "service");
5537
+ const bookingUrl = req?.serviceApi?.bookingUrl || getBookingURL(req.environment, serviceSlug, serviceId);
5472
5538
  return {
5473
5539
  id: req.serviceApi.id || '',
5474
5540
  name: req.serviceApi.name || '',
@@ -5552,6 +5618,9 @@ class GuestService {
5552
5618
  isHostConfigured(req) {
5553
5619
  return this.guestAPIService.isHostConfigured(req).pipe(map((resp) => resp.isConfigured));
5554
5620
  }
5621
+ getGroup(req) {
5622
+ return this.guestAPIService.getGroup(req);
5623
+ }
5555
5624
  }
5556
5625
  GuestService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: GuestService, deps: [{ token: MeetingGuestApiService }], target: i0.ɵɵFactoryTarget.Injectable });
5557
5626
  GuestService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.3", ngImport: i0, type: GuestService, providedIn: 'root' });
@@ -5889,7 +5958,7 @@ class HostService {
5889
5958
  }).pipe(mapTo(undefined));
5890
5959
  }
5891
5960
  deleteService(req) {
5892
- return this.hostAPIService.deleteService({ id: req.id }).pipe(mapTo(undefined));
5961
+ return this.hostAPIService.deleteService({ id: req.id, hostId: req.hostId }).pipe(mapTo(undefined));
5893
5962
  }
5894
5963
  listServices(req) {
5895
5964
  return this.hostAPIService.listServices({ hostId: req.hostId }).pipe(map(res => {
@@ -5923,7 +5992,7 @@ class HostService {
5923
5992
  }).pipe(mapTo(undefined));
5924
5993
  }
5925
5994
  deleteGroup(req) {
5926
- return this.hostAPIService.deleteGroup({ id: req.id }).pipe(mapTo(undefined));
5995
+ return this.hostAPIService.deleteGroup({ id: req.id, hostId: req.hostId }).pipe(mapTo(undefined));
5927
5996
  }
5928
5997
  listGroups(req) {
5929
5998
  return this.hostAPIService.listGroups({ hostId: req.hostId }).pipe(map(res => {