@proteos/sdk 0.85.0 → 0.86.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,20 +6,20 @@ import type {
6
6
  Calendar,
7
7
  CalendarConnection,
8
8
  CalendarEvent,
9
- CalendarEventType,
10
9
  CalendarEventsResponse,
10
+ CalendarEventType,
11
+ CancelPublicCalendarEventRequest,
11
12
  CreateAvailabilityConstraintRequest,
12
13
  CreateCalendarConnectionRequest,
13
14
  CreateCalendarEventRequest,
14
15
  CreateSchedulingLinkRequest,
15
- CancelPublicCalendarEventRequest,
16
16
  GetPublicSlotsQuery,
17
17
  GetSlotsRequest,
18
18
  GetSlotsResponse,
19
19
  ListAvailabilityConstraintsQuery,
20
20
  ListCalendarConnectionsQuery,
21
- ListCalendarEventTypesQuery,
22
21
  ListCalendarEventsQuery,
22
+ ListCalendarEventTypesQuery,
23
23
  ListCalendarsQuery,
24
24
  ListResponse,
25
25
  ListSchedulingLinksQuery,
@@ -33,12 +33,12 @@ import type {
33
33
  RespondCalendarEventRequest,
34
34
  SchedulingLink,
35
35
  SchedulingProfile,
36
- UpdateCalendarSyncRequest,
37
36
  UpdateAvailabilityConstraintRequest,
38
37
  UpdateCalendarConnectionRequest,
39
38
  UpdateCalendarEventRequest,
40
39
  UpdateCalendarEventTypeRequest,
41
40
  UpdateCalendarRequest,
41
+ UpdateCalendarSyncRequest,
42
42
  UpdateSchedulingLinkRequest,
43
43
  } from './types.js'
44
44
 
@@ -345,7 +345,11 @@ class CalendarEventTypeServiceImpl implements CalendarEventTypeService {
345
345
  constructor(private readonly client: ProteosClient) {}
346
346
 
347
347
  list(query: ListCalendarEventTypesQuery = {}): Promise<ListResponse<CalendarEventType>> {
348
- return this.client.requestWithQuery('GET', `${SCHEDULING_BASE_PATH}/calendar-event-types`, query)
348
+ return this.client.requestWithQuery(
349
+ 'GET',
350
+ `${SCHEDULING_BASE_PATH}/calendar-event-types`,
351
+ query,
352
+ )
349
353
  }
350
354
 
351
355
  get(key: string): Promise<CalendarEventType> {
@@ -381,7 +385,10 @@ export interface AvailabilityConstraintService {
381
385
  listMine(query?: ListAvailabilityConstraintsQuery): Promise<ListResponse<AvailabilityConstraint>>
382
386
  getMine(id: string): Promise<AvailabilityConstraint>
383
387
  createMine(request: CreateAvailabilityConstraintRequest): Promise<AvailabilityConstraint>
384
- updateMine(id: string, request: UpdateAvailabilityConstraintRequest): Promise<AvailabilityConstraint>
388
+ updateMine(
389
+ id: string,
390
+ request: UpdateAvailabilityConstraintRequest,
391
+ ): Promise<AvailabilityConstraint>
385
392
  deleteMine(id: string): Promise<void>
386
393
  listForUser(
387
394
  userId: string,
@@ -409,7 +416,9 @@ class AvailabilityConstraintServiceImpl implements AvailabilityConstraintService
409
416
  : `${SCHEDULING_BASE_PATH}/me/availability-constraints`
410
417
  }
411
418
 
412
- listMine(query: ListAvailabilityConstraintsQuery = {}): Promise<ListResponse<AvailabilityConstraint>> {
419
+ listMine(
420
+ query: ListAvailabilityConstraintsQuery = {},
421
+ ): Promise<ListResponse<AvailabilityConstraint>> {
413
422
  return this.client.requestWithQuery('GET', this.base(), query)
414
423
  }
415
424
 
@@ -421,7 +430,10 @@ class AvailabilityConstraintServiceImpl implements AvailabilityConstraintService
421
430
  return this.client.request('POST', this.base(), request)
422
431
  }
423
432
 
424
- updateMine(id: string, request: UpdateAvailabilityConstraintRequest): Promise<AvailabilityConstraint> {
433
+ updateMine(
434
+ id: string,
435
+ request: UpdateAvailabilityConstraintRequest,
436
+ ): Promise<AvailabilityConstraint> {
425
437
  return this.client.request('PATCH', `${this.base()}/${encode(id)}`, request)
426
438
  }
427
439
 
@@ -504,7 +516,11 @@ class SchedulingLinkServiceImpl implements SchedulingLinkService {
504
516
  }
505
517
 
506
518
  update(key: string, request: UpdateSchedulingLinkRequest): Promise<SchedulingLink> {
507
- return this.client.request('PATCH', `${SCHEDULING_BASE_PATH}/scheduling-links/${encode(key)}`, request)
519
+ return this.client.request(
520
+ 'PATCH',
521
+ `${SCHEDULING_BASE_PATH}/scheduling-links/${encode(key)}`,
522
+ request,
523
+ )
508
524
  }
509
525
 
510
526
  async delete(key: string): Promise<void> {
@@ -513,15 +529,26 @@ class SchedulingLinkServiceImpl implements SchedulingLinkService {
513
529
 
514
530
  getPage(key: string, contactId?: string): Promise<PublicSchedulingLink> {
515
531
  const suffix = contactId ? `?contact_id=${encode(contactId)}` : ''
516
- return this.client.request('GET', `${SCHEDULING_BASE_PATH}/scheduling-links/${encode(key)}/page${suffix}`)
532
+ return this.client.request(
533
+ 'GET',
534
+ `${SCHEDULING_BASE_PATH}/scheduling-links/${encode(key)}/page${suffix}`,
535
+ )
517
536
  }
518
537
 
519
538
  getSlots(key: string, query: GetPublicSlotsQuery): Promise<GetSlotsResponse> {
520
- return this.client.requestWithQuery('GET', `${SCHEDULING_BASE_PATH}/scheduling-links/${encode(key)}/slots`, query)
539
+ return this.client.requestWithQuery(
540
+ 'GET',
541
+ `${SCHEDULING_BASE_PATH}/scheduling-links/${encode(key)}/slots`,
542
+ query,
543
+ )
521
544
  }
522
545
 
523
546
  book(key: string, request: BookSchedulingLinkRequest): Promise<BookSchedulingLinkResponse> {
524
- return this.client.request('POST', `${SCHEDULING_BASE_PATH}/scheduling-links/${encode(key)}/calendar-events`, request)
547
+ return this.client.request(
548
+ 'POST',
549
+ `${SCHEDULING_BASE_PATH}/scheduling-links/${encode(key)}/calendar-events`,
550
+ request,
551
+ )
525
552
  }
526
553
  }
527
554
 
@@ -533,10 +560,22 @@ class SchedulingLinkServiceImpl implements SchedulingLinkService {
533
560
  export interface PublicSchedulingService {
534
561
  getLink(orgId: string, key: string, contactId?: string): Promise<PublicSchedulingLink>
535
562
  getSlots(orgId: string, key: string, query: GetPublicSlotsQuery): Promise<GetSlotsResponse>
536
- book(orgId: string, key: string, request: BookSchedulingLinkRequest): Promise<PublicBookSchedulingLinkResponse>
563
+ book(
564
+ orgId: string,
565
+ key: string,
566
+ request: BookSchedulingLinkRequest,
567
+ ): Promise<PublicBookSchedulingLinkResponse>
537
568
  getEvent(orgId: string, id: string, token: string): Promise<PublicCalendarEvent>
538
- cancel(orgId: string, id: string, request: CancelPublicCalendarEventRequest): Promise<PublicCalendarEvent>
539
- reschedule(orgId: string, id: string, request: ReschedulePublicCalendarEventRequest): Promise<PublicBookSchedulingLinkResponse>
569
+ cancel(
570
+ orgId: string,
571
+ id: string,
572
+ request: CancelPublicCalendarEventRequest,
573
+ ): Promise<PublicCalendarEvent>
574
+ reschedule(
575
+ orgId: string,
576
+ id: string,
577
+ request: ReschedulePublicCalendarEventRequest,
578
+ ): Promise<PublicBookSchedulingLinkResponse>
540
579
  }
541
580
 
542
581
  class PublicSchedulingServiceImpl implements PublicSchedulingService {
@@ -548,29 +587,71 @@ class PublicSchedulingServiceImpl implements PublicSchedulingService {
548
587
 
549
588
  getLink(orgId: string, key: string, contactId?: string): Promise<PublicSchedulingLink> {
550
589
  const suffix = contactId ? `?contact_id=${encode(contactId)}` : ''
551
- return this.client.request('GET', `${this.base(orgId)}/links/${encode(key)}${suffix}`, undefined, { skipAuth: true })
590
+ return this.client.request(
591
+ 'GET',
592
+ `${this.base(orgId)}/links/${encode(key)}${suffix}`,
593
+ undefined,
594
+ { skipAuth: true },
595
+ )
552
596
  }
553
597
 
554
598
  getSlots(orgId: string, key: string, query: GetPublicSlotsQuery): Promise<GetSlotsResponse> {
555
599
  const params = new URLSearchParams({ from: query.from, to: query.to, timezone: query.timezone })
556
600
  if (query.host_user_id) params.set('host_user_id', query.host_user_id)
557
601
  if (query.type_key) params.set('type_key', query.type_key)
558
- return this.client.request('GET', `${this.base(orgId)}/links/${encode(key)}/slots?${params.toString()}`, undefined, { skipAuth: true })
602
+ return this.client.request(
603
+ 'GET',
604
+ `${this.base(orgId)}/links/${encode(key)}/slots?${params.toString()}`,
605
+ undefined,
606
+ { skipAuth: true },
607
+ )
559
608
  }
560
609
 
561
- book(orgId: string, key: string, request: BookSchedulingLinkRequest): Promise<PublicBookSchedulingLinkResponse> {
562
- return this.client.request('POST', `${this.base(orgId)}/links/${encode(key)}/calendar-events`, request, { skipAuth: true })
610
+ book(
611
+ orgId: string,
612
+ key: string,
613
+ request: BookSchedulingLinkRequest,
614
+ ): Promise<PublicBookSchedulingLinkResponse> {
615
+ return this.client.request(
616
+ 'POST',
617
+ `${this.base(orgId)}/links/${encode(key)}/calendar-events`,
618
+ request,
619
+ { skipAuth: true },
620
+ )
563
621
  }
564
622
 
565
623
  getEvent(orgId: string, id: string, token: string): Promise<PublicCalendarEvent> {
566
- return this.client.request('GET', `${this.base(orgId)}/calendar-events/${encode(id)}?token=${encode(token)}`, undefined, { skipAuth: true })
624
+ return this.client.request(
625
+ 'GET',
626
+ `${this.base(orgId)}/calendar-events/${encode(id)}?token=${encode(token)}`,
627
+ undefined,
628
+ { skipAuth: true },
629
+ )
567
630
  }
568
631
 
569
- cancel(orgId: string, id: string, request: CancelPublicCalendarEventRequest): Promise<PublicCalendarEvent> {
570
- return this.client.request('POST', `${this.base(orgId)}/calendar-events/${encode(id)}/cancel`, request, { skipAuth: true })
632
+ cancel(
633
+ orgId: string,
634
+ id: string,
635
+ request: CancelPublicCalendarEventRequest,
636
+ ): Promise<PublicCalendarEvent> {
637
+ return this.client.request(
638
+ 'POST',
639
+ `${this.base(orgId)}/calendar-events/${encode(id)}/cancel`,
640
+ request,
641
+ { skipAuth: true },
642
+ )
571
643
  }
572
644
 
573
- reschedule(orgId: string, id: string, request: ReschedulePublicCalendarEventRequest): Promise<PublicBookSchedulingLinkResponse> {
574
- return this.client.request('POST', `${this.base(orgId)}/calendar-events/${encode(id)}/reschedule`, request, { skipAuth: true })
645
+ reschedule(
646
+ orgId: string,
647
+ id: string,
648
+ request: ReschedulePublicCalendarEventRequest,
649
+ ): Promise<PublicBookSchedulingLinkResponse> {
650
+ return this.client.request(
651
+ 'POST',
652
+ `${this.base(orgId)}/calendar-events/${encode(id)}/reschedule`,
653
+ request,
654
+ { skipAuth: true },
655
+ )
575
656
  }
576
657
  }
@@ -181,10 +181,7 @@ export class FileServiceImpl implements FileService {
181
181
  // and stops consuming parts at `file` — metadata appended after the file
182
182
  // part would be silently dropped.
183
183
  const formData = new FormData()
184
- formData.append(
185
- 'metadata',
186
- new Blob([JSON.stringify(metadata)], { type: 'application/json' }),
187
- )
184
+ formData.append('metadata', new Blob([JSON.stringify(metadata)], { type: 'application/json' }))
188
185
  if (file) formData.append('file', file, metadata.name ?? file.name)
189
186
  const response = await this.client.requestMultipart<{ data: StorageFile }>(
190
187
  'PATCH',
@@ -168,9 +168,9 @@ export type PropertyType =
168
168
  | 'credentials_select'
169
169
  | 'button'
170
170
  /** Edits a platform attribute list (`Attribute[]`) via the shared attribute schema builder. */
171
- /** Edits a decision-question map (model-decide `questions`) via the questions builder, with a raw-JSON mode. */
171
+ /** Edits a decision-question map (model-decide `questions`) via the questions builder, with a raw-JSON mode. */
172
172
  | 'decision_questions'
173
- | 'attribute_schema'
173
+ | 'attribute_schema'
174
174
  // Wave 2 (editor support lands with Phase 3):
175
175
  | 'resource_locator'
176
176
  | 'resource_mapper'