@proveanything/smartlinks 2.2.9 → 2.2.10

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.
@@ -1,6 +1,6 @@
1
1
  # Smartlinks API Summary
2
2
 
3
- Version: 2.2.9 | Generated: 2026-12-04T20:26:14.685Z
3
+ Version: 2.2.10 | Generated: 2026-12-04T20:36:14.716Z
4
4
 
5
5
  This is a concise summary of all available API functions and types.
6
6
 
@@ -2797,8 +2797,10 @@ interface ServerFunctionBookings {
2797
2797
  query(params?: BookingListQueryParams): Promise<PaginatedResponse<Booking>>;
2798
2798
  mine(params?: BookingListQueryParams): Promise<PaginatedResponse<Booking>>;
2799
2799
  update(bookingId: string, fields: UpdateBookingInput): Promise<Booking>;
2800
- confirm(bookingId: string): Promise<Booking>;
2801
- cancel(bookingId: string, opts?: { reason?: string }): Promise<Booking>;
2800
+ confirm(bookingId: string, opts?: { payment?: 'waive' }): Promise<Booking>;
2801
+ cancel(bookingId: string, opts?: { reason?: string; refund?: 'full' | 'none' | number }): Promise<Booking>;
2802
+ checkout(input: BookingCheckoutInput): Promise<Omit<BookingCheckoutResult, 'editToken'> & { replayed?: boolean }>;
2803
+ refund(bookingId: string, opts?: { amount?: number; reason?: string }): Promise<{ booking: Booking; refunded: number; pending: boolean }>;
2802
2804
  move(bookingId: string, input: MoveBookingInput): Promise<Booking>;
2803
2805
  extendHold(bookingId: string, holdMinutes: number): Promise<Booking>;
2804
2806
  complete(bookingId: string): Promise<Booking>;
@@ -5600,6 +5602,7 @@ interface Booking {
5600
5602
  admin?: Record<string, any>
5601
5603
  allocations: BookingAllocation[]
5602
5604
  editToken?: string
5605
+ payment?: BookingPayment
5603
5606
  }
5604
5607
  ```
5605
5608
 
@@ -5874,6 +5877,87 @@ interface StandardSchedule {
5874
5877
  }
5875
5878
  ```
5876
5879
 
5880
+ **BookingPaymentLine** (interface)
5881
+ ```typescript
5882
+ interface BookingPaymentLine {
5883
+ priceId: string
5884
+ label: string
5885
+ unitAmount: number
5886
+ quantity: number
5887
+ }
5888
+ ```
5889
+
5890
+ **BookingPayment** (interface)
5891
+ ```typescript
5892
+ interface BookingPayment {
5893
+ status: 'awaiting' | 'paid' | 'partially_refunded' | 'refunded' | 'waived'
5894
+ total: number
5895
+ currency: string
5896
+ refunded: number
5897
+ lines: BookingPaymentLine[]
5898
+ paidAt?: string
5899
+ payBy?: string
5900
+ requested?: boolean
5901
+ link?: string
5902
+ }
5903
+ ```
5904
+
5905
+ **BookingPrice** (interface)
5906
+ ```typescript
5907
+ interface BookingPrice {
5908
+ id: string
5909
+ label: string
5910
+ amount: number
5911
+ durationMinutes?: number
5912
+ resourceIds?: string[]
5913
+ }
5914
+ ```
5915
+
5916
+ **BookingPaymentsConfig** (interface)
5917
+ ```typescript
5918
+ interface BookingPaymentsConfig {
5919
+ required?: boolean
5920
+ currency?: string
5921
+ prices?: BookingPrice[]
5922
+ sessionMinutes?: number
5923
+ ownerCancelRefund?: 'full' | 'none'
5924
+ payWithinHours?: number
5925
+ successUrl?: string
5926
+ cancelUrl?: string
5927
+ allowedHosts?: string[]
5928
+ }
5929
+ ```
5930
+
5931
+ **BookingPriceLine** (interface)
5932
+ ```typescript
5933
+ interface BookingPriceLine {
5934
+ priceId: string
5935
+ quantity?: number
5936
+ }
5937
+ ```
5938
+
5939
+ **BookingCheckoutResult** (interface)
5940
+ ```typescript
5941
+ interface BookingCheckoutResult {
5942
+ booking: Booking
5943
+ editToken?: string
5944
+ checkoutUrl: string | null
5945
+ expiresAt: string | null
5946
+ total: number
5947
+ currency: string | null
5948
+ request?: boolean
5949
+ }
5950
+ ```
5951
+
5952
+ **BookingPayLinkResult** (interface)
5953
+ ```typescript
5954
+ interface BookingPayLinkResult {
5955
+ checkoutUrl?: string
5956
+ done?: 'paid' | 'closed'
5957
+ url?: string | null
5958
+ }
5959
+ ```
5960
+
5877
5961
  **BookingStatus** = ``
5878
5962
 
5879
5963
  **BookingVisibility** = `'public' | 'owner' | 'admin'`
@@ -5897,6 +5981,8 @@ type BookingResourceRef = { type: string; id: string }
5897
5981
 
5898
5982
  **ScheduleDay** = `'mon' | 'tue' | 'wed' | 'thu' | 'fri' | 'sat' | 'sun'`
5899
5983
 
5984
+ **BookingRefundResult** = `Booking & { refunded: number`
5985
+
5900
5986
  ### broadcasts
5901
5987
 
5902
5988
  **ListBroadcastsQuery** (interface)
@@ -14945,11 +15031,23 @@ Get one booking. Public: the signed-in booker, or a guest passing `{ editToken }
14945
15031
  **update**(collectionId: string, appId: string, bookingId: string, input: UpdateBookingInput, admin: boolean = true) → `Promise<Booking>`
14946
15032
  Update zones and descriptive fields (admin). PATCH /bookings/:bookingId
14947
15033
 
14948
- **confirm**(collectionId: string, appId: string, bookingId: string, admin: boolean = false, opts?: BookingAccessOptions) → `Promise<Booking>`
14949
- held / pending / waitlisted → confirmed (idempotent). A held booking whose hold has run out fails with HOLD_EXPIRED. Public: only the booker's own hold, when `ownerActions.bookings.confirm` allows. POST /bookings/:bookingId/confirm
15034
+ **confirm**(collectionId: string, appId: string, bookingId: string, admin: boolean = false, opts?: BookingAccessOptions & { payment?: 'waive' }) → `Promise<Booking>`
15035
+ held / pending / waitlisted → confirmed (idempotent). A held booking whose hold has run out fails with HOLD_EXPIRED. Public: only the booker's own hold, when `ownerActions.bookings.confirm` allows. Paid bookings: a booking waiting for its payment is confirmed by the payment (PAYMENT_REQUIRED otherwise). Admin confirming a REQUEST that has a price turns it into a hold with a pay link for the booker (`payment.link`, emailed through `booking.payment_requested`); `{ payment: 'waive' }` confirms without payment (paid in cash, a free place). POST /bookings/:bookingId/confirm
15036
+
15037
+ **cancel**(collectionId: string, appId: string, bookingId: string, admin: boolean = false, opts?: BookingAccessOptions & { reason?: string; refund?: 'full' | 'none' | number }) → `Promise<Booking>`
15038
+ Cancel and give the places back (idempotent). Public: per `ownerActions.bookings.cancel` and its cutoff. `reason` is admin-only (public cancels record 'owner'). Paid bookings are refunded: the booker's cancel follows the app's `bookingPayments.ownerCancelRefund` (full by default); staff choose with `refund`: 'full' (default) | 'none' | an amount in minor units. POST /bookings/:bookingId/cancel
15039
+
15040
+ **checkout**(collectionId: string, appId: string, input: BookingCheckoutInput) → `Promise<BookingCheckoutResult>`
15041
+ Book and pay. The same rules as `create` (public), then the app's `bookingPayments` decide: - pay now (the rules book as held / confirmed): the booking is held while the person pays on Stripe's page → go to `checkoutUrl`; Stripe's webhook confirms it. - a request (the rules book as pending): priced, nothing paid, `checkoutUrl: null`; staff approving it sends the booker a pay link. - free (no prices): booked the normal way, `checkoutUrl: null`. Name prices by id (`lines` for ticket types on a slot, `priceId` for an appointment's service); the server sets every amount. POST /bookings/checkout
15042
+
15043
+ **bySession**(collectionId: string, appId: string, sessionId: string) → `Promise<Booking &`
15044
+ The thank-you page: the booking a Checkout Session paid for (`session_id` in the success address). `confirming: true` while Stripe's webhook is still on its way: show "confirming your payment…" and read again in a moment. GET /bookings/by-session/:sessionId
15045
+
15046
+ **pay**(collectionId: string, appId: string, bookingId: string, token: string) → `Promise<BookingPayLinkResult>`
15047
+ An approved request's pay link, for an app with its own pay page (the link in the email goes straight to Stripe). `token` is the `t` of `payment.link`. → `{ checkoutUrl }`, or `{ done: 'paid' | 'closed', url }`. POST /bookings/:bookingId/pay
14950
15048
 
14951
- **cancel**(collectionId: string, appId: string, bookingId: string, admin: boolean = false, opts?: BookingAccessOptions & { reason?: string }) → `Promise<Booking>`
14952
- Cancel and give the places back (idempotent). Public: per `ownerActions.bookings.cancel` and its cutoff. `reason` is admin-only (public cancels record 'owner'). POST /bookings/:bookingId/cancel
15049
+ **refund**(collectionId: string, appId: string, bookingId: string, opts?: { amount?: number; reason?: string }) → `Promise<BookingRefundResult>`
15050
+ Refund a paid booking without cancelling it (admin): all that's left, or `amount` (minor units). A refund Stripe can't take now is retried by the platform (`refundPending: true`). POST /bookings/:bookingId/refund
14953
15051
 
14954
15052
  **move**(collectionId: string, appId: string, bookingId: string, input: MoveBookingInput, admin: boolean = false, opts?: BookingAccessOptions) → `Promise<Booking>`
14955
15053
  Move to a new slot / time, all-or-nothing (a failed move leaves the booking as it was). Public: per `ownerActions.bookings.move`; the create rules are re-checked for the new time. POST /bookings/:bookingId/move