@proveanything/smartlinks 3.0.0-alpha.1 → 3.0.0-alpha.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 (272) hide show
  1. package/README.md +741 -741
  2. package/dist/README.md +573 -573
  3. package/dist/adminCardsView.js +55 -55
  4. package/dist/api/analytics.d.ts +5 -4
  5. package/dist/api/analytics.js +5 -4
  6. package/dist/api/appConfiguration.d.ts +23 -18
  7. package/dist/api/appConfiguration.js +24 -18
  8. package/dist/api/appObjects.d.ts +54 -10
  9. package/dist/api/appObjects.js +75 -40
  10. package/dist/api/asset.d.ts +28 -22
  11. package/dist/api/asset.js +45 -56
  12. package/dist/api/attestation.d.ts +11 -3
  13. package/dist/api/attestation.js +12 -3
  14. package/dist/api/attestations.d.ts +12 -8
  15. package/dist/api/attestations.js +18 -21
  16. package/dist/api/authKit.d.ts +15 -10
  17. package/dist/api/authKit.js +17 -11
  18. package/dist/api/batch.d.ts +36 -25
  19. package/dist/api/batch.js +46 -39
  20. package/dist/api/bookings.d.ts +67 -11
  21. package/dist/api/bookings.js +82 -15
  22. package/dist/api/broadcasts.js +3 -17
  23. package/dist/api/claimSet.d.ts +26 -12
  24. package/dist/api/claimSet.js +32 -24
  25. package/dist/api/collection.d.ts +15 -10
  26. package/dist/api/collection.js +17 -11
  27. package/dist/api/comms.d.ts +12 -6
  28. package/dist/api/comms.js +12 -6
  29. package/dist/api/conditions.d.ts +7 -6
  30. package/dist/api/conditions.js +8 -6
  31. package/dist/api/contact.d.ts +6 -2
  32. package/dist/api/contact.js +25 -60
  33. package/dist/api/containers.d.ts +14 -10
  34. package/dist/api/containers.js +19 -14
  35. package/dist/api/crate.js +7 -9
  36. package/dist/api/dpp.d.ts +20 -13
  37. package/dist/api/dpp.js +23 -15
  38. package/dist/api/facets.d.ts +38 -13
  39. package/dist/api/facets.js +40 -15
  40. package/dist/api/files.d.ts +5 -2
  41. package/dist/api/files.js +7 -4
  42. package/dist/api/form.d.ts +8 -5
  43. package/dist/api/form.js +9 -5
  44. package/dist/api/index.d.ts +1 -1
  45. package/dist/api/index.js +1 -1
  46. package/dist/api/integrations.d.ts +29 -17
  47. package/dist/api/integrations.js +32 -25
  48. package/dist/api/interactions.d.ts +11 -6
  49. package/dist/api/interactions.js +14 -23
  50. package/dist/api/jobs.d.ts +16 -6
  51. package/dist/api/jobs.js +30 -20
  52. package/dist/api/journeys.js +2 -14
  53. package/dist/api/journeysAnalytics.d.ts +8 -5
  54. package/dist/api/journeysAnalytics.js +8 -5
  55. package/dist/api/knowledge.d.ts +20 -14
  56. package/dist/api/knowledge.js +22 -15
  57. package/dist/api/location.d.ts +6 -3
  58. package/dist/api/location.js +8 -22
  59. package/dist/api/lots.d.ts +9 -5
  60. package/dist/api/lots.js +22 -26
  61. package/dist/api/loyalty.d.ts +25 -16
  62. package/dist/api/loyalty.js +33 -32
  63. package/dist/api/nfc.d.ts +3 -1
  64. package/dist/api/nfc.js +3 -1
  65. package/dist/api/order.d.ts +45 -39
  66. package/dist/api/order.js +48 -65
  67. package/dist/api/partner.d.ts +17 -14
  68. package/dist/api/partner.js +21 -22
  69. package/dist/api/payments.d.ts +60 -0
  70. package/dist/api/payments.js +94 -0
  71. package/dist/api/products.d.ts +35 -12
  72. package/dist/api/products.js +36 -13
  73. package/dist/api/proof.d.ts +41 -19
  74. package/dist/api/proof.js +44 -23
  75. package/dist/api/realtime.d.ts +3 -0
  76. package/dist/api/realtime.js +10 -2
  77. package/dist/api/segments.js +3 -15
  78. package/dist/api/serviceAccounts.d.ts +8 -5
  79. package/dist/api/serviceAccounts.js +9 -6
  80. package/dist/api/shop.d.ts +7 -5
  81. package/dist/api/shop.js +13 -19
  82. package/dist/api/subscriptions.d.ts +12 -10
  83. package/dist/api/subscriptions.js +17 -25
  84. package/dist/api/tags.d.ts +23 -20
  85. package/dist/api/tags.js +40 -52
  86. package/dist/api/template.d.ts +16 -11
  87. package/dist/api/template.js +19 -13
  88. package/dist/api/translations.js +2 -12
  89. package/dist/api/userGroups.d.ts +26 -16
  90. package/dist/api/userGroups.js +43 -30
  91. package/dist/api/variant.d.ts +10 -7
  92. package/dist/api/variant.js +11 -7
  93. package/dist/api/wallet.d.ts +14 -11
  94. package/dist/api/wallet.js +15 -12
  95. package/dist/baseline.css +194 -194
  96. package/dist/dataChanged.d.ts +74 -0
  97. package/dist/dataChanged.js +162 -0
  98. package/dist/docs/API_SUMMARY.md +1443 -1409
  99. package/dist/docs/admin-cards.md +189 -189
  100. package/dist/docs/agent-tools.md +156 -156
  101. package/dist/docs/ai-tools-and-skills.md +180 -180
  102. package/dist/docs/ai.md +1721 -1721
  103. package/dist/docs/analytics.md +1 -1
  104. package/dist/docs/api-versions.md +85 -85
  105. package/dist/docs/app-data-storage.md +277 -277
  106. package/dist/docs/app-docs.md +73 -73
  107. package/dist/docs/app-manifest.md +852 -852
  108. package/dist/docs/app-objects.md +4 -4
  109. package/dist/docs/app-records-pattern.md +388 -388
  110. package/dist/docs/appConfig.md +550 -550
  111. package/dist/docs/assistant-apps.md +172 -172
  112. package/dist/docs/assistant-context.md +119 -119
  113. package/dist/docs/attestations.md +8 -8
  114. package/dist/docs/bookings.md +105 -8
  115. package/dist/docs/caching.md +32 -3
  116. package/dist/docs/comms.md +689 -689
  117. package/dist/docs/connectors.md +340 -340
  118. package/dist/docs/contact-search.md +2 -3
  119. package/dist/docs/css-baseline.md +133 -133
  120. package/dist/docs/customer-guide.md +70 -70
  121. package/dist/docs/data-changed.md +91 -0
  122. package/dist/docs/deploying-apps.md +340 -340
  123. package/dist/docs/dpp.md +115 -115
  124. package/dist/docs/entitlements.md +90 -90
  125. package/dist/docs/files.md +69 -69
  126. package/dist/docs/host-dependency-contract.md +252 -252
  127. package/dist/docs/iframe-responder.md +11 -0
  128. package/dist/docs/integrations.md +322 -322
  129. package/dist/docs/interactions.md +544 -544
  130. package/dist/docs/item-context.md +181 -181
  131. package/dist/docs/knowledge.md +105 -105
  132. package/dist/docs/lists.md +157 -114
  133. package/dist/docs/lots.md +112 -112
  134. package/dist/docs/loyalty.md +348 -348
  135. package/dist/docs/members.md +183 -183
  136. package/dist/docs/memberships.md +150 -150
  137. package/dist/docs/mobile-admin-container.md +693 -693
  138. package/dist/docs/operations.md +281 -281
  139. package/dist/docs/overview.md +487 -485
  140. package/dist/docs/payments.md +94 -0
  141. package/dist/docs/proof-comms-triggers.md +142 -142
  142. package/dist/docs/proof-ownership-transfer.md +155 -155
  143. package/dist/docs/proof-product-data-scoping.md +462 -462
  144. package/dist/docs/proof-share-grants.md +305 -305
  145. package/dist/docs/realtime.md +149 -139
  146. package/dist/docs/records-admin-pattern.md +304 -304
  147. package/dist/docs/service-accounts.md +64 -64
  148. package/dist/docs/standard-query.md +196 -187
  149. package/dist/docs/tag-codes.md +97 -97
  150. package/dist/docs/tag-ranges.md +106 -106
  151. package/dist/docs/theme-tokens.md +252 -252
  152. package/dist/docs/upgrading-to-3.md +550 -430
  153. package/dist/docs/wallet-passes.md +107 -107
  154. package/dist/docs/websites.md +123 -123
  155. package/dist/http.d.ts +6 -3
  156. package/dist/http.js +48 -19
  157. package/dist/iframeResponder.d.ts +7 -0
  158. package/dist/iframeResponder.js +10 -0
  159. package/dist/index.d.ts +2 -0
  160. package/dist/index.js +2 -0
  161. package/dist/list.d.ts +12 -0
  162. package/dist/list.js +59 -0
  163. package/dist/openapi.yaml +722 -660
  164. package/dist/testing/bookingsMemory.d.ts +29 -1
  165. package/dist/testing/bookingsMemory.js +89 -1
  166. package/dist/testing/index.js +4 -1
  167. package/dist/theme-boot.js +82 -82
  168. package/dist/theme.css +75 -75
  169. package/dist/types/analytics.d.ts +7 -3
  170. package/dist/types/appManifest.d.ts +26 -4
  171. package/dist/types/appObjects.d.ts +27 -12
  172. package/dist/types/appOptions.d.ts +2 -2
  173. package/dist/types/asset.d.ts +5 -6
  174. package/dist/types/attestations.d.ts +7 -9
  175. package/dist/types/batch.d.ts +5 -5
  176. package/dist/types/bookings.d.ts +109 -6
  177. package/dist/types/comms.d.ts +9 -5
  178. package/dist/types/contact.d.ts +7 -4
  179. package/dist/types/containers.d.ts +2 -1
  180. package/dist/types/facets.d.ts +14 -2
  181. package/dist/types/files.d.ts +3 -2
  182. package/dist/types/index.d.ts +1 -0
  183. package/dist/types/index.js +1 -0
  184. package/dist/types/integrations.d.ts +2 -1
  185. package/dist/types/interaction.d.ts +15 -7
  186. package/dist/types/jobs.d.ts +1 -1
  187. package/dist/types/journeysAnalytics.d.ts +3 -2
  188. package/dist/types/knowledge.d.ts +6 -3
  189. package/dist/types/knowledge.js +0 -1
  190. package/dist/types/list.d.ts +30 -2
  191. package/dist/types/location.d.ts +7 -2
  192. package/dist/types/location.js +0 -1
  193. package/dist/types/lots.d.ts +5 -2
  194. package/dist/types/lots.js +0 -6
  195. package/dist/types/order.d.ts +22 -20
  196. package/dist/types/payments.d.ts +101 -0
  197. package/dist/types/payments.js +5 -0
  198. package/dist/types/product.d.ts +28 -11
  199. package/dist/types/proof.d.ts +7 -8
  200. package/dist/types/realtime.d.ts +5 -1
  201. package/dist/types/tags.d.ts +5 -3
  202. package/dist/types/userGroups.d.ts +3 -3
  203. package/dist/types/userGroups.js +0 -4
  204. package/dist/version.d.ts +1 -1
  205. package/dist/version.js +1 -1
  206. package/docs/API_SUMMARY.md +1443 -1409
  207. package/docs/admin-cards.md +189 -189
  208. package/docs/agent-tools.md +156 -156
  209. package/docs/ai-tools-and-skills.md +180 -180
  210. package/docs/ai.md +1721 -1721
  211. package/docs/analytics.md +1 -1
  212. package/docs/api-versions.md +85 -85
  213. package/docs/app-data-storage.md +277 -277
  214. package/docs/app-docs.md +73 -73
  215. package/docs/app-manifest.md +852 -852
  216. package/docs/app-objects.md +4 -4
  217. package/docs/app-records-pattern.md +388 -388
  218. package/docs/appConfig.md +550 -550
  219. package/docs/assistant-apps.md +172 -172
  220. package/docs/assistant-context.md +119 -119
  221. package/docs/attestations.md +8 -8
  222. package/docs/bookings.md +105 -8
  223. package/docs/caching.md +32 -3
  224. package/docs/comms.md +689 -689
  225. package/docs/connectors.md +340 -340
  226. package/docs/contact-search.md +2 -3
  227. package/docs/css-baseline.md +133 -133
  228. package/docs/customer-guide.md +70 -70
  229. package/docs/data-changed.md +91 -0
  230. package/docs/deploying-apps.md +340 -340
  231. package/docs/dpp.md +115 -115
  232. package/docs/entitlements.md +90 -90
  233. package/docs/files.md +69 -69
  234. package/docs/host-dependency-contract.md +252 -252
  235. package/docs/iframe-responder.md +11 -0
  236. package/docs/integrations.md +322 -322
  237. package/docs/interactions.md +544 -544
  238. package/docs/item-context.md +181 -181
  239. package/docs/knowledge.md +105 -105
  240. package/docs/lists.md +157 -114
  241. package/docs/lots.md +112 -112
  242. package/docs/loyalty.md +348 -348
  243. package/docs/members.md +183 -183
  244. package/docs/memberships.md +150 -150
  245. package/docs/mobile-admin-container.md +693 -693
  246. package/docs/operations.md +281 -281
  247. package/docs/overview.md +487 -485
  248. package/docs/payments.md +94 -0
  249. package/docs/proof-comms-triggers.md +142 -142
  250. package/docs/proof-ownership-transfer.md +155 -155
  251. package/docs/proof-product-data-scoping.md +462 -462
  252. package/docs/proof-share-grants.md +305 -305
  253. package/docs/realtime.md +149 -139
  254. package/docs/service-accounts.md +64 -64
  255. package/docs/standard-query.md +196 -187
  256. package/docs/tag-codes.md +97 -97
  257. package/docs/tag-ranges.md +106 -106
  258. package/docs/theme-lookbook.v1.json +120 -120
  259. package/docs/theme-tokens.md +252 -252
  260. package/docs/upgrading-to-3.md +550 -430
  261. package/docs/wallet-passes.md +107 -107
  262. package/docs/websites.md +123 -123
  263. package/openapi.yaml +722 -660
  264. package/package.json +91 -91
  265. package/scripts/headless-check.mjs +87 -87
  266. package/scripts/lib/bare-imports.mjs +57 -57
  267. package/scripts/lib/keyed-app-data.mjs +21 -21
  268. package/scripts/lib/upgrade.mjs +708 -512
  269. package/scripts/publish.mjs +272 -272
  270. package/scripts/register-release.mjs +91 -91
  271. package/scripts/upgrade.mjs +79 -56
  272. package/upgrade/3.json +2731 -2213
@@ -1,4 +1,4 @@
1
- import type { Booking, BookingSlot, BookingAllocation, CreateBookingInput, UpdateBookingInput, MoveBookingInput, BookingListOptions, CreateSlotInput, UpdateSlotInput, SlotListOptions, CreateBlockInput, BlockListOptions, FreeBusyQuery, FreeBusyResponse, BookingAccessOptions, MessageBookersInput, MessageBookersResult } from '../types/bookings.js';
1
+ import type { Booking, BookingSlot, BookingAllocation, CreateBookingInput, UpdateBookingInput, MoveBookingInput, BookingListOptions, CreateSlotInput, UpdateSlotInput, SlotListOptions, CreateBlockInput, BlockListOptions, FreeBusyQuery, FreeBusyResponse, BookingAccessOptions, MessageBookersInput, MessageBookersResult, BookingCheckoutInput, BookingCheckoutResult, BookingPayLinkResult, BookingRefundResult } from '../types/bookings.js';
2
2
  import type { ListResult } from '../types/list.js';
3
3
  export declare namespace bookings {
4
4
  /**
@@ -13,26 +13,29 @@ export declare namespace bookings {
13
13
  */
14
14
  function create(collectionId: string, appId: string, input: CreateBookingInput, admin?: boolean): Promise<Booking>;
15
15
  /**
16
- * List bookings (admin), a page at a time. `count` is how many match in all. There is no public
17
- * list: a signed-in booker uses {@link mine}. GET /bookings
16
+ * List bookings (admin), a page at a time. `count` is how many match in all. `from` / `to` pick
17
+ * the bookings overlapping that time; `orderBy` sorts (earliest start first unless you say). There
18
+ * is no public list: a signed-in booker uses {@link mine}. GET /bookings
18
19
  *
19
20
  * @example
20
21
  * ```typescript
21
- * let page = await bookings.list(collectionId, appId, { status: 'confirmed', from: new Date(), limit: 50 })
22
+ * const from = new Date()
23
+ * let page = await bookings.list(collectionId, appId, { status: 'confirmed', from, orderBy: [{ startsAt: 'desc' }], limit: 50 })
22
24
  * page.items // Booking[]
23
25
  * page.count // how many match in all
24
26
  * while (page.nextCursor) {
25
- * page = await bookings.list(collectionId, appId, { status: 'confirmed', from: new Date(), limit: 50, cursor: page.nextCursor })
27
+ * page = await bookings.list(collectionId, appId, { status: 'confirmed', from, orderBy: [{ startsAt: 'desc' }], limit: 50, cursor: page.nextCursor })
26
28
  * }
27
29
  * ```
28
30
  */
29
31
  function list(collectionId: string, appId: string, params?: BookingListOptions, admin?: boolean): Promise<ListResult<Booking>>;
30
32
  /**
31
- * The signed-in caller's own bookings (public), a page at a time. GET /bookings/mine
33
+ * The signed-in caller's own bookings (public), a page at a time. Takes the same options as
34
+ * {@link list}, except `contactId`. GET /bookings/mine
32
35
  *
33
36
  * @example
34
37
  * ```typescript
35
- * const { items, nextCursor, count } = await bookings.mine(collectionId, appId, { from: new Date() })
38
+ * const { items, nextCursor, count } = await bookings.mine(collectionId, appId, { from: new Date(), orderBy: [{ startsAt: 'asc' }], limit: 20 })
36
39
  * ```
37
40
  */
38
41
  function mine(collectionId: string, appId: string, params?: Omit<BookingListOptions, 'contactId'>): Promise<ListResult<Booking>>;
@@ -46,17 +49,64 @@ export declare namespace bookings {
46
49
  /**
47
50
  * held / pending / waitlisted → confirmed (idempotent). A held booking whose hold has run out fails
48
51
  * with HOLD_EXPIRED. Public: only the booker's own hold, when `ownerActions.bookings.confirm` allows.
52
+ *
53
+ * Paid bookings: a booking waiting for its payment is confirmed by the payment (PAYMENT_REQUIRED
54
+ * otherwise). Admin confirming a REQUEST that has a price turns it into a hold with a pay link for the
55
+ * booker (`payment.link`, emailed through `booking.payment_requested`); `{ payment: 'waive' }` confirms
56
+ * without payment (paid in cash, a free place).
49
57
  * POST /bookings/:bookingId/confirm
50
58
  */
51
- function confirm(collectionId: string, appId: string, bookingId: string, admin?: boolean, opts?: BookingAccessOptions): Promise<Booking>;
59
+ function confirm(collectionId: string, appId: string, bookingId: string, admin?: boolean, opts?: BookingAccessOptions & {
60
+ payment?: 'waive';
61
+ }): Promise<Booking>;
52
62
  /**
53
63
  * Cancel and give the places back (idempotent). Public: per `ownerActions.bookings.cancel` and its
54
64
  * cutoff. `reason` is admin-only (public cancels record 'owner').
65
+ *
66
+ * Paid bookings are refunded: the booker's cancel follows the app's `bookingPayments.ownerCancelRefund`
67
+ * (full by default); staff choose with `refund`: 'full' (default) | 'none' | an amount in minor units.
55
68
  * POST /bookings/:bookingId/cancel
56
69
  */
57
70
  function cancel(collectionId: string, appId: string, bookingId: string, admin?: boolean, opts?: BookingAccessOptions & {
58
71
  reason?: string;
72
+ refund?: 'full' | 'none' | number;
59
73
  }): Promise<Booking>;
74
+ /**
75
+ * Book and pay. The same rules as `create` (public), then the app's `bookingPayments` decide:
76
+ * - pay now (the rules book as held / confirmed): the booking is held while the person pays on
77
+ * Stripe's page → go to `checkoutUrl`; Stripe's webhook confirms it.
78
+ * - a request (the rules book as pending): priced, nothing paid, `checkoutUrl: null`; staff approving it
79
+ * sends the booker a pay link.
80
+ * - free (no prices): booked the normal way, `checkoutUrl: null`.
81
+ * Name prices by id (`lines` for ticket types on a slot, `priceId` for an appointment's service); the
82
+ * server sets every amount.
83
+ * POST /bookings/checkout
84
+ */
85
+ function checkout(collectionId: string, appId: string, input: BookingCheckoutInput): Promise<BookingCheckoutResult>;
86
+ /**
87
+ * The thank-you page: the booking a Checkout Session paid for (`session_id` in the success address).
88
+ * `confirming: true` while Stripe's webhook is still on its way: show "confirming your payment…" and
89
+ * read again in a moment.
90
+ * GET /bookings/by-session/:sessionId
91
+ */
92
+ function bySession(collectionId: string, appId: string, sessionId: string): Promise<Booking & {
93
+ confirming: boolean;
94
+ }>;
95
+ /**
96
+ * An approved request's pay link, for an app with its own pay page (the link in the email goes straight
97
+ * to Stripe). `token` is the `t` of `payment.link`. → `{ checkoutUrl }`, or `{ done: 'paid' | 'closed', url }`.
98
+ * POST /bookings/:bookingId/pay
99
+ */
100
+ function pay(collectionId: string, appId: string, bookingId: string, token: string): Promise<BookingPayLinkResult>;
101
+ /**
102
+ * Refund a paid booking without cancelling it (admin): all that's left, or `amount` (minor units). A
103
+ * refund Stripe can't take now is retried by the platform (`refundPending: true`).
104
+ * POST /bookings/:bookingId/refund
105
+ */
106
+ function refund(collectionId: string, appId: string, bookingId: string, opts?: {
107
+ amount?: number;
108
+ reason?: string;
109
+ }): Promise<BookingRefundResult>;
60
110
  /**
61
111
  * Move to a new slot / time, all-or-nothing (a failed move leaves the booking as it was).
62
112
  * Public: per `ownerActions.bookings.move`; the create rules are re-checked for the new time.
@@ -92,11 +142,14 @@ export declare namespace bookings {
92
142
  }>;
93
143
  /**
94
144
  * List slots, a page at a time. Public: open, public slots only, each with `remaining`.
145
+ * `from` / `to` pick the slots in that time; `orderBy` sorts them.
95
146
  * GET /bookings/slots
96
147
  *
97
148
  * @example
98
149
  * ```typescript
99
- * const { items, nextCursor, count } = await bookings.slots.list(collectionId, appId, { from, to, available: true })
150
+ * const { items, nextCursor, count } = await bookings.slots.list(collectionId, appId, {
151
+ * from, to, available: true, orderBy: [{ startsAt: 'asc' }], limit: 50,
152
+ * })
100
153
  * ```
101
154
  */
102
155
  function list(collectionId: string, appId: string, params?: SlotListOptions, admin?: boolean): Promise<ListResult<BookingSlot>>;
@@ -116,11 +169,14 @@ export declare namespace bookings {
116
169
  namespace blocks {
117
170
  function create(collectionId: string, appId: string, input: CreateBlockInput): Promise<BookingAllocation>;
118
171
  /**
119
- * The blocks on a resource and/or in a date range, a page at a time. GET /bookings/blocks
172
+ * The blocks on a resource and/or in a date range (`from` / `to`), a page at a time (`limit`,
173
+ * `cursor`). GET /bookings/blocks
120
174
  *
121
175
  * @example
122
176
  * ```typescript
123
- * const { items, nextCursor } = await bookings.blocks.list(collectionId, appId, { resourceType: 'record', resourceId: 'staff-1' })
177
+ * const { items, nextCursor } = await bookings.blocks.list(collectionId, appId, {
178
+ * resourceType: 'record', resourceId: 'staff-1', from: '2026-12-01T00:00:00Z', to: '2027-01-01T00:00:00Z', limit: 50,
179
+ * })
124
180
  * ```
125
181
  */
126
182
  function list(collectionId: string, appId: string, params?: BlockListOptions): Promise<ListResult<BookingAllocation>>;
@@ -7,6 +7,7 @@
7
7
  // as what status, limits, time rules), ownerActions.bookings (cancel / move /
8
8
  // confirm afterwards) and publicRead.bookings.freebusy.
9
9
  import { request, post, patch, del, requestWithOptions } from '../http.js';
10
+ import { listQuery } from '../list.js';
10
11
  function basePath(collectionId, appId, admin) {
11
12
  const zone = admin ? 'admin' : 'public';
12
13
  return `/${zone}/collection/${encodeURIComponent(collectionId)}/app/${encodeURIComponent(appId)}/bookings`;
@@ -46,33 +47,36 @@ export var bookings;
46
47
  }
47
48
  bookings.create = create;
48
49
  /**
49
- * List bookings (admin), a page at a time. `count` is how many match in all. There is no public
50
- * list: a signed-in booker uses {@link mine}. GET /bookings
50
+ * List bookings (admin), a page at a time. `count` is how many match in all. `from` / `to` pick
51
+ * the bookings overlapping that time; `orderBy` sorts (earliest start first unless you say). There
52
+ * is no public list: a signed-in booker uses {@link mine}. GET /bookings
51
53
  *
52
54
  * @example
53
55
  * ```typescript
54
- * let page = await bookings.list(collectionId, appId, { status: 'confirmed', from: new Date(), limit: 50 })
56
+ * const from = new Date()
57
+ * let page = await bookings.list(collectionId, appId, { status: 'confirmed', from, orderBy: [{ startsAt: 'desc' }], limit: 50 })
55
58
  * page.items // Booking[]
56
59
  * page.count // how many match in all
57
60
  * while (page.nextCursor) {
58
- * page = await bookings.list(collectionId, appId, { status: 'confirmed', from: new Date(), limit: 50, cursor: page.nextCursor })
61
+ * page = await bookings.list(collectionId, appId, { status: 'confirmed', from, orderBy: [{ startsAt: 'desc' }], limit: 50, cursor: page.nextCursor })
59
62
  * }
60
63
  * ```
61
64
  */
62
65
  async function list(collectionId, appId, params, admin = true) {
63
- return request(`${basePath(collectionId, appId, admin)}${query(params)}`);
66
+ return request(`${basePath(collectionId, appId, admin)}${listQuery(params)}`);
64
67
  }
65
68
  bookings.list = list;
66
69
  /**
67
- * The signed-in caller's own bookings (public), a page at a time. GET /bookings/mine
70
+ * The signed-in caller's own bookings (public), a page at a time. Takes the same options as
71
+ * {@link list}, except `contactId`. GET /bookings/mine
68
72
  *
69
73
  * @example
70
74
  * ```typescript
71
- * const { items, nextCursor, count } = await bookings.mine(collectionId, appId, { from: new Date() })
75
+ * const { items, nextCursor, count } = await bookings.mine(collectionId, appId, { from: new Date(), orderBy: [{ startsAt: 'asc' }], limit: 20 })
72
76
  * ```
73
77
  */
74
78
  async function mine(collectionId, appId, params) {
75
- return request(`${basePath(collectionId, appId, false)}/mine${query(params)}`);
79
+ return request(`${basePath(collectionId, appId, false)}/mine${listQuery(params)}`);
76
80
  }
77
81
  bookings.mine = mine;
78
82
  /**
@@ -93,21 +97,78 @@ export var bookings;
93
97
  /**
94
98
  * held / pending / waitlisted → confirmed (idempotent). A held booking whose hold has run out fails
95
99
  * with HOLD_EXPIRED. Public: only the booker's own hold, when `ownerActions.bookings.confirm` allows.
100
+ *
101
+ * Paid bookings: a booking waiting for its payment is confirmed by the payment (PAYMENT_REQUIRED
102
+ * otherwise). Admin confirming a REQUEST that has a price turns it into a hold with a pay link for the
103
+ * booker (`payment.link`, emailed through `booking.payment_requested`); `{ payment: 'waive' }` confirms
104
+ * without payment (paid in cash, a free place).
96
105
  * POST /bookings/:bookingId/confirm
97
106
  */
98
107
  async function confirm(collectionId, appId, bookingId, admin = false, opts) {
99
- return post(`${basePath(collectionId, appId, admin)}/${encodeURIComponent(bookingId)}/confirm`, {}, tokenHeaders(opts));
108
+ return post(`${basePath(collectionId, appId, admin)}/${encodeURIComponent(bookingId)}/confirm`, (opts === null || opts === void 0 ? void 0 : opts.payment) ? { payment: opts.payment } : {}, tokenHeaders(opts));
100
109
  }
101
110
  bookings.confirm = confirm;
102
111
  /**
103
112
  * Cancel and give the places back (idempotent). Public: per `ownerActions.bookings.cancel` and its
104
113
  * cutoff. `reason` is admin-only (public cancels record 'owner').
114
+ *
115
+ * Paid bookings are refunded: the booker's cancel follows the app's `bookingPayments.ownerCancelRefund`
116
+ * (full by default); staff choose with `refund`: 'full' (default) | 'none' | an amount in minor units.
105
117
  * POST /bookings/:bookingId/cancel
106
118
  */
107
119
  async function cancel(collectionId, appId, bookingId, admin = false, opts) {
108
- return post(`${basePath(collectionId, appId, admin)}/${encodeURIComponent(bookingId)}/cancel`, (opts === null || opts === void 0 ? void 0 : opts.reason) ? { reason: opts.reason } : {}, tokenHeaders(opts));
120
+ const body = {};
121
+ if (opts === null || opts === void 0 ? void 0 : opts.reason)
122
+ body.reason = opts.reason;
123
+ if ((opts === null || opts === void 0 ? void 0 : opts.refund) !== undefined)
124
+ body.refund = opts.refund;
125
+ return post(`${basePath(collectionId, appId, admin)}/${encodeURIComponent(bookingId)}/cancel`, body, tokenHeaders(opts));
109
126
  }
110
127
  bookings.cancel = cancel;
128
+ // ==================== PAID BOOKINGS (docs/bookings.md, "Paid bookings") ====================
129
+ /**
130
+ * Book and pay. The same rules as `create` (public), then the app's `bookingPayments` decide:
131
+ * - pay now (the rules book as held / confirmed): the booking is held while the person pays on
132
+ * Stripe's page → go to `checkoutUrl`; Stripe's webhook confirms it.
133
+ * - a request (the rules book as pending): priced, nothing paid, `checkoutUrl: null`; staff approving it
134
+ * sends the booker a pay link.
135
+ * - free (no prices): booked the normal way, `checkoutUrl: null`.
136
+ * Name prices by id (`lines` for ticket types on a slot, `priceId` for an appointment's service); the
137
+ * server sets every amount.
138
+ * POST /bookings/checkout
139
+ */
140
+ async function checkout(collectionId, appId, input) {
141
+ return post(`${basePath(collectionId, appId, false)}/checkout`, input);
142
+ }
143
+ bookings.checkout = checkout;
144
+ /**
145
+ * The thank-you page: the booking a Checkout Session paid for (`session_id` in the success address).
146
+ * `confirming: true` while Stripe's webhook is still on its way: show "confirming your payment…" and
147
+ * read again in a moment.
148
+ * GET /bookings/by-session/:sessionId
149
+ */
150
+ async function bySession(collectionId, appId, sessionId) {
151
+ return request(`${basePath(collectionId, appId, false)}/by-session/${encodeURIComponent(sessionId)}`);
152
+ }
153
+ bookings.bySession = bySession;
154
+ /**
155
+ * An approved request's pay link, for an app with its own pay page (the link in the email goes straight
156
+ * to Stripe). `token` is the `t` of `payment.link`. → `{ checkoutUrl }`, or `{ done: 'paid' | 'closed', url }`.
157
+ * POST /bookings/:bookingId/pay
158
+ */
159
+ async function pay(collectionId, appId, bookingId, token) {
160
+ return post(`${basePath(collectionId, appId, false)}/${encodeURIComponent(bookingId)}/pay`, { token });
161
+ }
162
+ bookings.pay = pay;
163
+ /**
164
+ * Refund a paid booking without cancelling it (admin): all that's left, or `amount` (minor units). A
165
+ * refund Stripe can't take now is retried by the platform (`refundPending: true`).
166
+ * POST /bookings/:bookingId/refund
167
+ */
168
+ async function refund(collectionId, appId, bookingId, opts) {
169
+ return post(`${basePath(collectionId, appId, true)}/${encodeURIComponent(bookingId)}/refund`, opts || {});
170
+ }
171
+ bookings.refund = refund;
111
172
  /**
112
173
  * Move to a new slot / time, all-or-nothing (a failed move leaves the booking as it was).
113
174
  * Public: per `ownerActions.bookings.move`; the create rules are re-checked for the new time.
@@ -166,15 +227,18 @@ export var bookings;
166
227
  slots_1.createMany = createMany;
167
228
  /**
168
229
  * List slots, a page at a time. Public: open, public slots only, each with `remaining`.
230
+ * `from` / `to` pick the slots in that time; `orderBy` sorts them.
169
231
  * GET /bookings/slots
170
232
  *
171
233
  * @example
172
234
  * ```typescript
173
- * const { items, nextCursor, count } = await bookings.slots.list(collectionId, appId, { from, to, available: true })
235
+ * const { items, nextCursor, count } = await bookings.slots.list(collectionId, appId, {
236
+ * from, to, available: true, orderBy: [{ startsAt: 'asc' }], limit: 50,
237
+ * })
174
238
  * ```
175
239
  */
176
240
  async function list(collectionId, appId, params, admin = false) {
177
- return request(`${basePath(collectionId, appId, admin)}/slots${query(params)}`);
241
+ return request(`${basePath(collectionId, appId, admin)}/slots${listQuery(params)}`);
178
242
  }
179
243
  slots_1.list = list;
180
244
  /** GET /bookings/slots/:slotId */
@@ -205,15 +269,18 @@ export var bookings;
205
269
  }
206
270
  blocks.create = create;
207
271
  /**
208
- * The blocks on a resource and/or in a date range, a page at a time. GET /bookings/blocks
272
+ * The blocks on a resource and/or in a date range (`from` / `to`), a page at a time (`limit`,
273
+ * `cursor`). GET /bookings/blocks
209
274
  *
210
275
  * @example
211
276
  * ```typescript
212
- * const { items, nextCursor } = await bookings.blocks.list(collectionId, appId, { resourceType: 'record', resourceId: 'staff-1' })
277
+ * const { items, nextCursor } = await bookings.blocks.list(collectionId, appId, {
278
+ * resourceType: 'record', resourceId: 'staff-1', from: '2026-12-01T00:00:00Z', to: '2027-01-01T00:00:00Z', limit: 50,
279
+ * })
213
280
  * ```
214
281
  */
215
282
  async function list(collectionId, appId, params) {
216
- return request(`${basePath(collectionId, appId, true)}/blocks${query(params)}`);
283
+ return request(`${basePath(collectionId, appId, true)}/blocks${listQuery(params)}`);
217
284
  }
218
285
  blocks.list = list;
219
286
  async function remove(collectionId, appId, blockId) {
@@ -1,20 +1,6 @@
1
1
  // src/api/broadcasts.ts
2
2
  import { request, post, patch, del } from "../http.js";
3
- function encodeQuery(params) {
4
- const search = new URLSearchParams();
5
- for (const [key, value] of Object.entries(params)) {
6
- if (value === undefined || value === null || value === "")
7
- continue;
8
- if (typeof value === "boolean") {
9
- search.set(key, value ? "true" : "false");
10
- }
11
- else {
12
- search.set(key, String(value));
13
- }
14
- }
15
- const qs = search.toString();
16
- return qs ? `?${qs}` : "";
17
- }
3
+ import { listQuery } from "../list.js";
18
4
  export var broadcasts;
19
5
  (function (broadcasts) {
20
6
  // CRUD: Create broadcast
@@ -34,7 +20,7 @@ export var broadcasts;
34
20
  * ```
35
21
  */
36
22
  async function list(collectionId, query = {}) {
37
- const path = `/admin/collection/${encodeURIComponent(collectionId)}/broadcasts/${encodeQuery(query)}`;
23
+ const path = `/admin/collection/${encodeURIComponent(collectionId)}/broadcasts/${listQuery(query)}`;
38
24
  return request(path);
39
25
  }
40
26
  broadcasts.list = list;
@@ -69,7 +55,7 @@ export var broadcasts;
69
55
  * ```
70
56
  */
71
57
  async function recipients(collectionId, id, query = {}) {
72
- const qs = encodeQuery(query);
58
+ const qs = listQuery(query);
73
59
  const path = `/admin/collection/${encodeURIComponent(collectionId)}/broadcasts/${encodeURIComponent(id)}/recipients${qs}`;
74
60
  return request(path);
75
61
  }
@@ -2,18 +2,23 @@ import { ClaimSetScope, ClaimSetRange, CreateClaimSetRangeRequest, UpdateClaimSe
2
2
  import type { ListResult, ListOptions } from "../types/list.js";
3
3
  export declare namespace claimSet {
4
4
  /**
5
- * Get all claim sets. Returns `{ items, nextCursor }`: the claim sets are in `items`. The list is not
6
- * paged, so `nextCursor` is always `null`.
5
+ * Get all claim sets, a page at a time. Returns `{ items, nextCursor }`: the claim sets are in `items`;
6
+ * pass `nextCursor` back as `cursor` for the next page (`null` means that was the last one).
7
7
  * When collectionId is provided, returns claim sets for that collection.
8
8
  * When omitted, returns all claim sets owned by the authenticated user.
9
9
  * @param collectionId – Optional collection identifier
10
+ * @param options – `limit` (default 50) and `cursor`
10
11
  *
11
12
  * @example
12
13
  * ```typescript
13
- * const { items } = await claimSet.getAll('coll_123')
14
+ * let page = await claimSet.getAll('coll_123', { limit: 50 })
15
+ * while (page.nextCursor) page = await claimSet.getAll('coll_123', { limit: 50, cursor: page.nextCursor })
16
+ *
17
+ * // Your own claim sets (no collection)
18
+ * const { items } = await claimSet.getAll(undefined, { limit: 50 })
14
19
  * ```
15
20
  */
16
- function getAll(collectionId?: string): Promise<ListResult<any>>;
21
+ function getAll(collectionId?: string, options?: ListOptions): Promise<ListResult<any>>;
17
22
  /**
18
23
  * Get a specific claim set by ID.
19
24
  * @param claimSetId – The claim set identifier
@@ -52,17 +57,22 @@ export declare namespace claimSet {
52
57
  /**
53
58
  * Get assigned tags for a claim set — tags soft-assigned to a collection or product. Returns
54
59
  * `{ items, nextCursor }` with the claim set's own fields (`id`, `name`, …) beside them: the tags are
55
- * in `items`. The list is not paged, so `nextCursor` is always `null`.
60
+ * in `items`, a page at a time. Pass `nextCursor` back as `cursor` for the next page (`null` means that
61
+ * was the last one).
56
62
  * @param claimSetId – The claim set identifier
57
63
  * @param collectionId – Optional collection identifier; omit for user-scoped access
64
+ * @param options – `limit` (default 50) and `cursor`
58
65
  *
59
66
  * @example
60
67
  * ```typescript
61
- * const { items, name } = await claimSet.getAssignedTags('12', 'coll_123')
62
- * console.log(`${items.length} tags of ${name} are assigned`)
68
+ * let page = await claimSet.getAssignedTags('12', 'coll_123', { limit: 50 })
69
+ * console.log(`Assigned tags of ${page.name}:`, page.items)
70
+ * while (page.nextCursor) {
71
+ * page = await claimSet.getAssignedTags('12', 'coll_123', { limit: 50, cursor: page.nextCursor })
72
+ * }
63
73
  * ```
64
74
  */
65
- function getAssignedTags(claimSetId: string, collectionId?: string): Promise<ListResult<any> & Record<string, any>>;
75
+ function getAssignedTags(claimSetId: string, collectionId?: string, options?: ListOptions): Promise<ListResult<any> & Record<string, any>>;
66
76
  /**
67
77
  * Create a single tag inside a claim set.
68
78
  * @param claimSetId – The claim set identifier
@@ -114,15 +124,19 @@ export declare namespace claimSet {
114
124
  function updateClaimData(collectionId: string, data: UpdateClaimDataRequest): Promise<any>;
115
125
  namespace ranges {
116
126
  /**
117
- * The ranges in a set, lowest index first. Returns `{ items, nextCursor }`: the ranges are in `items`.
118
- * The list is not paged, so `nextCursor` is always `null`.
127
+ * The ranges in a set, lowest index first, a page at a time (50 unless you give a `limit`). Returns
128
+ * `{ items, nextCursor }`: the ranges are in `items`; pass `nextCursor` back as `cursor` for the next
129
+ * page (`null` means that was the last one).
119
130
  *
120
131
  * @example
121
132
  * ```typescript
122
- * const { items: ranges } = await claimSet.ranges.list({ collectionId: 'coll_123' }, '12')
133
+ * let page = await claimSet.ranges.list({ collectionId: 'coll_123' }, '12', { limit: 50 })
134
+ * while (page.nextCursor) {
135
+ * page = await claimSet.ranges.list({ collectionId: 'coll_123' }, '12', { limit: 50, cursor: page.nextCursor })
136
+ * }
123
137
  * ```
124
138
  */
125
- function list(scope: ClaimSetScope, claimSetId: string): Promise<ListResult<ClaimSetRange>>;
139
+ function list(scope: ClaimSetScope, claimSetId: string, options?: ListOptions): Promise<ListResult<ClaimSetRange>>;
126
140
  /** Reserve the set's next indexes and mint a code (and, for NTAG 424, a key) for each. */
127
141
  function create(scope: ClaimSetScope, claimSetId: string, params: CreateClaimSetRangeRequest): Promise<ClaimSetRange>;
128
142
  /** One range, with its counts refreshed. */
@@ -1,4 +1,5 @@
1
1
  import { request, post, put, patch, del } from "../http.js";
2
+ import { listQuery } from "../list.js";
2
3
  /**
3
4
  * Returns the base path for claim set endpoints.
4
5
  * When collectionId is provided, routes to the collection-scoped admin API.
@@ -19,19 +20,24 @@ function rangesBase(scope, claimSetId) {
19
20
  export var claimSet;
20
21
  (function (claimSet) {
21
22
  /**
22
- * Get all claim sets. Returns `{ items, nextCursor }`: the claim sets are in `items`. The list is not
23
- * paged, so `nextCursor` is always `null`.
23
+ * Get all claim sets, a page at a time. Returns `{ items, nextCursor }`: the claim sets are in `items`;
24
+ * pass `nextCursor` back as `cursor` for the next page (`null` means that was the last one).
24
25
  * When collectionId is provided, returns claim sets for that collection.
25
26
  * When omitted, returns all claim sets owned by the authenticated user.
26
27
  * @param collectionId – Optional collection identifier
28
+ * @param options – `limit` (default 50) and `cursor`
27
29
  *
28
30
  * @example
29
31
  * ```typescript
30
- * const { items } = await claimSet.getAll('coll_123')
32
+ * let page = await claimSet.getAll('coll_123', { limit: 50 })
33
+ * while (page.nextCursor) page = await claimSet.getAll('coll_123', { limit: 50, cursor: page.nextCursor })
34
+ *
35
+ * // Your own claim sets (no collection)
36
+ * const { items } = await claimSet.getAll(undefined, { limit: 50 })
31
37
  * ```
32
38
  */
33
- async function getAll(collectionId) {
34
- return request(base(collectionId));
39
+ async function getAll(collectionId, options = {}) {
40
+ return request(`${base(collectionId)}${listQuery({ limit: options.limit, cursor: options.cursor })}`);
35
41
  }
36
42
  claimSet.getAll = getAll;
37
43
  /**
@@ -87,18 +93,23 @@ export var claimSet;
87
93
  /**
88
94
  * Get assigned tags for a claim set — tags soft-assigned to a collection or product. Returns
89
95
  * `{ items, nextCursor }` with the claim set's own fields (`id`, `name`, …) beside them: the tags are
90
- * in `items`. The list is not paged, so `nextCursor` is always `null`.
96
+ * in `items`, a page at a time. Pass `nextCursor` back as `cursor` for the next page (`null` means that
97
+ * was the last one).
91
98
  * @param claimSetId – The claim set identifier
92
99
  * @param collectionId – Optional collection identifier; omit for user-scoped access
100
+ * @param options – `limit` (default 50) and `cursor`
93
101
  *
94
102
  * @example
95
103
  * ```typescript
96
- * const { items, name } = await claimSet.getAssignedTags('12', 'coll_123')
97
- * console.log(`${items.length} tags of ${name} are assigned`)
104
+ * let page = await claimSet.getAssignedTags('12', 'coll_123', { limit: 50 })
105
+ * console.log(`Assigned tags of ${page.name}:`, page.items)
106
+ * while (page.nextCursor) {
107
+ * page = await claimSet.getAssignedTags('12', 'coll_123', { limit: 50, cursor: page.nextCursor })
108
+ * }
98
109
  * ```
99
110
  */
100
- async function getAssignedTags(claimSetId, collectionId) {
101
- return request(`${base(collectionId)}/${encodeURIComponent(claimSetId)}/assignedTags`);
111
+ async function getAssignedTags(claimSetId, collectionId, options = {}) {
112
+ return request(`${base(collectionId)}/${encodeURIComponent(claimSetId)}/assignedTags${listQuery({ limit: options.limit, cursor: options.cursor })}`);
102
113
  }
103
114
  claimSet.getAssignedTags = getAssignedTags;
104
115
  /**
@@ -182,16 +193,20 @@ export var claimSet;
182
193
  let ranges;
183
194
  (function (ranges) {
184
195
  /**
185
- * The ranges in a set, lowest index first. Returns `{ items, nextCursor }`: the ranges are in `items`.
186
- * The list is not paged, so `nextCursor` is always `null`.
196
+ * The ranges in a set, lowest index first, a page at a time (50 unless you give a `limit`). Returns
197
+ * `{ items, nextCursor }`: the ranges are in `items`; pass `nextCursor` back as `cursor` for the next
198
+ * page (`null` means that was the last one).
187
199
  *
188
200
  * @example
189
201
  * ```typescript
190
- * const { items: ranges } = await claimSet.ranges.list({ collectionId: 'coll_123' }, '12')
202
+ * let page = await claimSet.ranges.list({ collectionId: 'coll_123' }, '12', { limit: 50 })
203
+ * while (page.nextCursor) {
204
+ * page = await claimSet.ranges.list({ collectionId: 'coll_123' }, '12', { limit: 50, cursor: page.nextCursor })
205
+ * }
191
206
  * ```
192
207
  */
193
- async function list(scope, claimSetId) {
194
- return request(rangesBase(scope, claimSetId));
208
+ async function list(scope, claimSetId, options = {}) {
209
+ return request(`${rangesBase(scope, claimSetId)}${listQuery({ limit: options.limit, cursor: options.cursor })}`);
195
210
  }
196
211
  ranges.list = list;
197
212
  /** Reserve the set's next indexes and mint a code (and, for NTAG 424, a key) for each. */
@@ -243,15 +258,8 @@ export var claimSet;
243
258
  * ```
244
259
  */
245
260
  async function tags(scope, claimSetId, rangeId, options = {}) {
246
- const q = new URLSearchParams();
247
- if (options.limit !== undefined)
248
- q.set('limit', String(options.limit));
249
- if (options.cursor)
250
- q.set('cursor', options.cursor);
251
- if (options.keys)
252
- q.set('keys', '1');
253
- const qs = q.toString();
254
- return request(`${rangesBase(scope, claimSetId)}/${encodeURIComponent(rangeId)}/tags${qs ? `?${qs}` : ''}`);
261
+ const qs = listQuery({ limit: options.limit, cursor: options.cursor, keys: options.keys ? '1' : undefined });
262
+ return request(`${rangesBase(scope, claimSetId)}/${encodeURIComponent(rangeId)}/tags${qs}`);
255
263
  }
256
264
  ranges.tags = tags;
257
265
  /** The next tag to program on a phone (lowest index without a chip), with its URL and key. */
@@ -1,5 +1,5 @@
1
1
  import { CollectionResponse, CollectionCreateRequest, CollectionUpdateRequest, AppsConfigResponse, DomainTarget, HubAvailabilityResponse, CollectionUser, CollectionAccessLevel, InviteUserInput, CollectionReadiness } from "../types/collection.js";
2
- import type { ListResult } from "../types/list.js";
2
+ import type { ListResult, ListOptions } from "../types/list.js";
3
3
  export declare namespace collection {
4
4
  /**
5
5
  * What the collection's installed apps need and whether it's there (sign-in, customers, products,
@@ -17,18 +17,21 @@ export declare namespace collection {
17
17
  */
18
18
  function get(collectionId: string, admin?: boolean): Promise<CollectionResponse>;
19
19
  /**
20
- * The collections the signed-in user can work on (admin). All of them come back in one answer:
21
- * `nextCursor` is always null. There is no public list of collections: read one with `collection.get`.
20
+ * The collections the signed-in user can work on (admin), a page at a time. Page with `limit`
21
+ * (50 unless you say) and `cursor`. There is no public list of collections: read one with
22
+ * `collection.get`.
23
+ * @param options - `limit` and `cursor`
22
24
  * @returns Promise resolving to `{ items, nextCursor }`, where `items` are CollectionResponse objects
23
25
  * @throws ErrorResponse if the request fails
24
26
  *
25
27
  * @example
26
28
  * ```typescript
27
- * const { items } = await collection.list()
28
- * items.forEach(c => console.log(c.id, c.title))
29
+ * let page = await collection.list({ limit: 50 })
30
+ * page.items.forEach(c => console.log(c.id, c.title))
31
+ * while (page.nextCursor) page = await collection.list({ limit: 50, cursor: page.nextCursor })
29
32
  * ```
30
33
  */
31
- function list(): Promise<ListResult<CollectionResponse>>;
34
+ function list(options?: ListOptions): Promise<ListResult<CollectionResponse>>;
32
35
  /**
33
36
  * Retrieve a collection by its shortId (public endpoint).
34
37
  * @param shortId – The short identifier of the collection
@@ -197,18 +200,20 @@ export declare namespace collection {
197
200
  /**
198
201
  * List the users with access to a collection, each with their access level (admin only). Access is
199
202
  * stored in the collection's `roles` map (userId → level); this resolves each to name/email.
200
- * All of them come back in one answer: `nextCursor` is always null.
203
+ * A page at a time: page with `limit` (50 unless you say) and `cursor`.
201
204
  * GET /admin/collection/:collectionId/getUsers
202
205
  * @param collectionId - Identifier of the collection
206
+ * @param options - `limit` and `cursor`
203
207
  * @returns Promise resolving to `{ items, nextCursor }`, where `items` are the collection's users
204
208
  *
205
209
  * @example
206
210
  * ```typescript
207
- * const { items: users } = await collection.getUsers('coll_123')
208
- * users.forEach(u => console.log(u.email, u.access))
211
+ * let page = await collection.getUsers('coll_123', { limit: 50 })
212
+ * page.items.forEach(u => console.log(u.email, u.access))
213
+ * while (page.nextCursor) page = await collection.getUsers('coll_123', { limit: 50, cursor: page.nextCursor })
209
214
  * ```
210
215
  */
211
- function getUsers(collectionId: string): Promise<ListResult<CollectionUser>>;
216
+ function getUsers(collectionId: string, options?: ListOptions): Promise<ListResult<CollectionUser>>;
212
217
  /**
213
218
  * Grant, change, or remove a user's access level on a collection (admin only). Pass `null` or
214
219
  * `'None'` to remove access. The server enforces privilege-escalation rules — you cannot grant an