@proveanything/smartlinks 2.2.0 → 3.0.0-alpha.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.
Files changed (328) hide show
  1. package/README.md +741 -754
  2. package/dist/README.md +573 -573
  3. package/dist/adminCardsView.js +55 -55
  4. package/dist/api/adminCards.d.ts +8 -0
  5. package/dist/api/adminCards.js +9 -1
  6. package/dist/api/ai.d.ts +22 -11
  7. package/dist/api/ai.js +18 -14
  8. package/dist/api/analytics.d.ts +13 -0
  9. package/dist/api/analytics.js +13 -0
  10. package/dist/api/appConfiguration.d.ts +17 -14
  11. package/dist/api/appConfiguration.js +14 -12
  12. package/dist/api/appObjects.d.ts +80 -16
  13. package/dist/api/appObjects.js +74 -11
  14. package/dist/api/asset.d.ts +55 -19
  15. package/dist/api/asset.js +52 -32
  16. package/dist/api/attestation.d.ts +3 -2
  17. package/dist/api/attestation.js +1 -1
  18. package/dist/api/attestations.d.ts +22 -7
  19. package/dist/api/attestations.js +22 -7
  20. package/dist/api/authKit.d.ts +22 -5
  21. package/dist/api/authKit.js +21 -4
  22. package/dist/api/batch.d.ts +23 -16
  23. package/dist/api/batch.js +19 -13
  24. package/dist/api/bookings.d.ts +45 -9
  25. package/dist/api/bookings.js +39 -3
  26. package/dist/api/broadcasts.d.ts +26 -6
  27. package/dist/api/broadcasts.js +22 -2
  28. package/dist/api/claimSet.d.ts +48 -13
  29. package/dist/api/claimSet.js +43 -7
  30. package/dist/api/collection.d.ts +20 -6
  31. package/dist/api/collection.js +19 -8
  32. package/dist/api/comms.d.ts +43 -12
  33. package/dist/api/comms.js +43 -13
  34. package/dist/api/conditions.d.ts +12 -2
  35. package/dist/api/conditions.js +10 -1
  36. package/dist/api/config.d.ts +15 -2
  37. package/dist/api/config.js +12 -0
  38. package/dist/api/contact.d.ts +34 -13
  39. package/dist/api/contact.js +35 -10
  40. package/dist/api/containers.d.ts +41 -23
  41. package/dist/api/containers.js +37 -21
  42. package/dist/api/crate.d.ts +9 -8
  43. package/dist/api/crate.js +8 -8
  44. package/dist/api/dpp.d.ts +58 -10
  45. package/dist/api/dpp.js +57 -15
  46. package/dist/api/facets.d.ts +71 -0
  47. package/dist/api/facets.js +71 -0
  48. package/dist/api/files.d.ts +11 -5
  49. package/dist/api/files.js +9 -1
  50. package/dist/api/form.d.ts +9 -2
  51. package/dist/api/form.js +7 -1
  52. package/dist/api/index.d.ts +0 -1
  53. package/dist/api/index.js +0 -1
  54. package/dist/api/integrations.d.ts +82 -27
  55. package/dist/api/integrations.js +63 -7
  56. package/dist/api/interactions.d.ts +42 -6
  57. package/dist/api/interactions.js +41 -5
  58. package/dist/api/jobs.d.ts +9 -2
  59. package/dist/api/jobs.js +6 -0
  60. package/dist/api/journeys.d.ts +13 -2
  61. package/dist/api/journeys.js +10 -1
  62. package/dist/api/journeysAnalytics.d.ts +12 -3
  63. package/dist/api/journeysAnalytics.js +9 -1
  64. package/dist/api/knowledge.d.ts +43 -10
  65. package/dist/api/knowledge.js +37 -5
  66. package/dist/api/location.d.ts +10 -3
  67. package/dist/api/location.js +7 -1
  68. package/dist/api/lots.d.ts +40 -13
  69. package/dist/api/lots.js +38 -8
  70. package/dist/api/loyalty.d.ts +70 -12
  71. package/dist/api/loyalty.js +60 -3
  72. package/dist/api/nfc.d.ts +8 -2
  73. package/dist/api/nfc.js +6 -1
  74. package/dist/api/order.d.ts +51 -160
  75. package/dist/api/order.js +46 -208
  76. package/dist/api/partner.d.ts +41 -8
  77. package/dist/api/partner.js +36 -4
  78. package/dist/api/products.d.ts +41 -8
  79. package/dist/api/products.js +33 -4
  80. package/dist/api/proof.d.ts +50 -13
  81. package/dist/api/proof.js +43 -7
  82. package/dist/api/realtime.d.ts +1 -11
  83. package/dist/api/realtime.js +1 -22
  84. package/dist/api/secrets.d.ts +25 -5
  85. package/dist/api/secrets.js +21 -2
  86. package/dist/api/segments.d.ts +26 -6
  87. package/dist/api/segments.js +22 -2
  88. package/dist/api/serviceAccounts.d.ts +8 -1
  89. package/dist/api/serviceAccounts.js +8 -1
  90. package/dist/api/shop.d.ts +41 -13
  91. package/dist/api/shop.js +35 -4
  92. package/dist/api/subscriptions.d.ts +47 -12
  93. package/dist/api/subscriptions.js +40 -4
  94. package/dist/api/tags.d.ts +40 -19
  95. package/dist/api/tags.js +38 -18
  96. package/dist/api/template.d.ts +31 -3
  97. package/dist/api/template.js +27 -0
  98. package/dist/api/translations.d.ts +17 -2
  99. package/dist/api/translations.js +14 -0
  100. package/dist/api/userGroups.d.ts +35 -9
  101. package/dist/api/userGroups.js +30 -5
  102. package/dist/api/variant.d.ts +11 -3
  103. package/dist/api/variant.js +9 -2
  104. package/dist/api/wallet.d.ts +23 -10
  105. package/dist/api/wallet.js +20 -2
  106. package/dist/apiVersion.d.ts +1 -1
  107. package/dist/apiVersion.js +1 -1
  108. package/dist/baseline.css +194 -194
  109. package/dist/docs/API_SUMMARY.md +1389 -2298
  110. package/dist/docs/PRODUCT_FACETS_SDK.md +10 -15
  111. package/dist/docs/admin-cards.md +189 -189
  112. package/dist/docs/admin-lists-and-pickers.md +1 -1
  113. package/dist/docs/agent-tools.md +156 -156
  114. package/dist/docs/ai-tools-and-skills.md +180 -180
  115. package/dist/docs/ai.md +1721 -1721
  116. package/dist/docs/analytics.md +3 -2
  117. package/dist/docs/api-versions.md +85 -76
  118. package/dist/docs/app-data-storage.md +277 -277
  119. package/dist/docs/app-docs.md +73 -73
  120. package/dist/docs/app-manifest.md +852 -852
  121. package/dist/docs/app-objects.md +38 -50
  122. package/dist/docs/app-records-pattern.md +388 -388
  123. package/dist/docs/appConfig.md +550 -550
  124. package/dist/docs/assets.md +17 -3
  125. package/dist/docs/assistant-apps.md +172 -172
  126. package/dist/docs/assistant-context.md +119 -119
  127. package/dist/docs/attestations.md +5 -4
  128. package/dist/docs/auth-kit.md +1 -1
  129. package/dist/docs/bookings.md +442 -442
  130. package/dist/docs/comms.md +689 -686
  131. package/dist/docs/connectors.md +340 -340
  132. package/dist/docs/contact-search.md +4 -3
  133. package/dist/docs/container-tracking.md +7 -7
  134. package/dist/docs/css-baseline.md +133 -133
  135. package/dist/docs/customer-guide.md +70 -70
  136. package/dist/docs/deploying-apps.md +340 -340
  137. package/dist/docs/dpp.md +115 -115
  138. package/dist/docs/entitlements.md +90 -90
  139. package/dist/docs/executor.md +1 -1
  140. package/dist/docs/files.md +69 -69
  141. package/dist/docs/forms.md +1 -1
  142. package/dist/docs/headless-providers.md +3 -3
  143. package/dist/docs/host-dependency-contract.md +252 -210
  144. package/dist/docs/i18n.md +9 -9
  145. package/dist/docs/integrations.md +322 -322
  146. package/dist/docs/interactions.md +544 -545
  147. package/dist/docs/item-context.md +181 -181
  148. package/dist/docs/knowledge.md +105 -102
  149. package/dist/docs/lists.md +114 -0
  150. package/dist/docs/lots.md +112 -111
  151. package/dist/docs/loyalty.md +348 -352
  152. package/dist/docs/members.md +183 -183
  153. package/dist/docs/memberships.md +150 -149
  154. package/dist/docs/mobile-admin-container.md +693 -693
  155. package/dist/docs/operations.md +281 -281
  156. package/dist/docs/overview.md +485 -485
  157. package/dist/docs/proof-claiming-methods.md +6 -6
  158. package/dist/docs/proof-comms-triggers.md +142 -142
  159. package/dist/docs/proof-ownership-transfer.md +155 -155
  160. package/dist/docs/proof-product-data-scoping.md +462 -462
  161. package/dist/docs/proof-share-grants.md +305 -305
  162. package/dist/docs/realtime.md +139 -138
  163. package/dist/docs/records-admin-pattern.md +304 -304
  164. package/dist/docs/server-functions.md +2 -2
  165. package/dist/docs/service-accounts.md +64 -64
  166. package/dist/docs/shop.md +4 -2
  167. package/dist/docs/site-seo.md +2 -1
  168. package/dist/docs/standard-query.md +187 -187
  169. package/dist/docs/tag-codes.md +97 -97
  170. package/dist/docs/tag-ranges.md +106 -106
  171. package/dist/docs/theme-tokens.md +252 -252
  172. package/dist/docs/translations.md +6 -1
  173. package/dist/docs/upgrading-to-3.md +430 -0
  174. package/dist/docs/user-groups.md +4 -4
  175. package/dist/docs/utils.md +1 -1
  176. package/dist/docs/wallet-passes.md +107 -107
  177. package/dist/docs/websites.md +123 -123
  178. package/dist/headless.d.ts +1 -1
  179. package/dist/headless.js +2 -2
  180. package/dist/http.d.ts +15 -2
  181. package/dist/http.js +60 -2
  182. package/dist/index.d.ts +7 -8
  183. package/dist/index.js +2 -0
  184. package/dist/list.d.ts +24 -0
  185. package/dist/list.js +80 -0
  186. package/dist/mobile-admin/types.d.ts +0 -16
  187. package/dist/openapi.yaml +290 -2723
  188. package/dist/shared-dependencies.d.ts +3 -3
  189. package/dist/shared-dependencies.js +13 -5
  190. package/dist/site.d.ts +1 -7
  191. package/dist/site.js +1 -14
  192. package/dist/theme-boot.js +82 -82
  193. package/dist/theme.css +75 -75
  194. package/dist/types/adminCards.d.ts +6 -3
  195. package/dist/types/ai.d.ts +0 -6
  196. package/dist/types/analytics.d.ts +5 -8
  197. package/dist/types/appManifest.d.ts +4 -5
  198. package/dist/types/appObjects.d.ts +14 -18
  199. package/dist/types/appObjects.js +0 -1
  200. package/dist/types/appOptions.d.ts +18 -0
  201. package/dist/types/asset.d.ts +3 -22
  202. package/dist/types/attestations.d.ts +7 -10
  203. package/dist/types/batch.d.ts +6 -14
  204. package/dist/types/bookings.d.ts +22 -4
  205. package/dist/types/broadcasts.d.ts +5 -13
  206. package/dist/types/broadcasts.js +0 -1
  207. package/dist/types/claimSet.d.ts +0 -5
  208. package/dist/types/comms.d.ts +11 -9
  209. package/dist/types/contact.d.ts +5 -29
  210. package/dist/types/contact.js +0 -13
  211. package/dist/types/containers.d.ts +15 -26
  212. package/dist/types/crate.d.ts +4 -12
  213. package/dist/types/dpp.d.ts +3 -3
  214. package/dist/types/dpp.js +0 -1
  215. package/dist/types/error.d.ts +8 -5
  216. package/dist/types/error.js +12 -5
  217. package/dist/types/facets.d.ts +15 -15
  218. package/dist/types/index.d.ts +1 -0
  219. package/dist/types/index.js +1 -0
  220. package/dist/types/integrations.d.ts +3 -28
  221. package/dist/types/interaction.d.ts +3 -9
  222. package/dist/types/jobs.d.ts +3 -8
  223. package/dist/types/jobs.js +0 -1
  224. package/dist/types/journeys.d.ts +3 -8
  225. package/dist/types/journeys.js +0 -1
  226. package/dist/types/journeysAnalytics.d.ts +0 -1
  227. package/dist/types/list.d.ts +24 -0
  228. package/dist/types/list.js +2 -0
  229. package/dist/types/location.d.ts +0 -4
  230. package/dist/types/lots.d.ts +0 -9
  231. package/dist/types/loyalty.d.ts +0 -9
  232. package/dist/types/order.d.ts +7 -134
  233. package/dist/types/product.d.ts +11 -24
  234. package/dist/types/proof.d.ts +16 -0
  235. package/dist/types/realtime.d.ts +0 -29
  236. package/dist/types/segments.d.ts +5 -13
  237. package/dist/types/segments.js +0 -1
  238. package/dist/types/serviceAccounts.d.ts +3 -2
  239. package/dist/types/serviceAccounts.js +0 -1
  240. package/dist/types/shop.d.ts +5 -12
  241. package/dist/types/shop.js +0 -4
  242. package/dist/types/subscriptions.d.ts +18 -0
  243. package/dist/types/subscriptions.js +0 -8
  244. package/dist/types/tags.d.ts +6 -16
  245. package/dist/types/tags.js +0 -7
  246. package/dist/types/translations.d.ts +3 -9
  247. package/dist/types/variant.d.ts +0 -2
  248. package/dist/version.d.ts +1 -1
  249. package/dist/version.js +1 -1
  250. package/docs/API_SUMMARY.md +1389 -2298
  251. package/docs/PRODUCT_FACETS_SDK.md +10 -15
  252. package/docs/admin-cards.md +189 -189
  253. package/docs/admin-lists-and-pickers.md +1 -1
  254. package/docs/agent-tools.md +156 -156
  255. package/docs/ai-tools-and-skills.md +180 -180
  256. package/docs/ai.md +1721 -1721
  257. package/docs/analytics.md +3 -2
  258. package/docs/api-versions.md +85 -76
  259. package/docs/app-data-storage.md +277 -277
  260. package/docs/app-docs.md +73 -73
  261. package/docs/app-manifest.md +852 -852
  262. package/docs/app-objects.md +38 -50
  263. package/docs/app-records-pattern.md +388 -388
  264. package/docs/appConfig.md +550 -550
  265. package/docs/assets.md +17 -3
  266. package/docs/assistant-apps.md +172 -172
  267. package/docs/assistant-context.md +119 -119
  268. package/docs/attestations.md +5 -4
  269. package/docs/auth-kit.md +1 -1
  270. package/docs/bookings.md +442 -442
  271. package/docs/comms.md +689 -686
  272. package/docs/connectors.md +340 -340
  273. package/docs/contact-search.md +4 -3
  274. package/docs/container-tracking.md +7 -7
  275. package/docs/css-baseline.md +133 -133
  276. package/docs/customer-guide.md +70 -70
  277. package/docs/deploying-apps.md +340 -340
  278. package/docs/dpp.md +115 -115
  279. package/docs/entitlements.md +90 -90
  280. package/docs/executor.md +1 -1
  281. package/docs/files.md +69 -69
  282. package/docs/forms.md +1 -1
  283. package/docs/headless-providers.md +3 -3
  284. package/docs/host-dependency-contract.md +252 -210
  285. package/docs/i18n.md +9 -9
  286. package/docs/integrations.md +322 -322
  287. package/docs/interactions.md +544 -545
  288. package/docs/item-context.md +181 -181
  289. package/docs/knowledge.md +105 -102
  290. package/docs/lists.md +114 -0
  291. package/docs/lots.md +112 -111
  292. package/docs/loyalty.md +348 -352
  293. package/docs/members.md +183 -183
  294. package/docs/memberships.md +150 -149
  295. package/docs/mobile-admin-container.md +693 -693
  296. package/docs/operations.md +281 -281
  297. package/docs/overview.md +485 -485
  298. package/docs/proof-claiming-methods.md +6 -6
  299. package/docs/proof-comms-triggers.md +142 -142
  300. package/docs/proof-ownership-transfer.md +155 -155
  301. package/docs/proof-product-data-scoping.md +462 -462
  302. package/docs/proof-share-grants.md +305 -305
  303. package/docs/realtime.md +139 -138
  304. package/docs/server-functions.md +2 -2
  305. package/docs/service-accounts.md +64 -64
  306. package/docs/shop.md +4 -2
  307. package/docs/site-seo.md +2 -1
  308. package/docs/standard-query.md +187 -187
  309. package/docs/tag-codes.md +97 -97
  310. package/docs/tag-ranges.md +106 -106
  311. package/docs/theme-lookbook.v1.json +120 -120
  312. package/docs/theme-tokens.md +252 -252
  313. package/docs/translations.md +6 -1
  314. package/docs/upgrading-to-3.md +430 -0
  315. package/docs/user-groups.md +4 -4
  316. package/docs/utils.md +1 -1
  317. package/docs/wallet-passes.md +107 -107
  318. package/docs/websites.md +123 -123
  319. package/openapi.yaml +290 -2723
  320. package/package.json +91 -87
  321. package/scripts/headless-check.mjs +87 -87
  322. package/scripts/lib/bare-imports.mjs +57 -57
  323. package/scripts/lib/keyed-app-data.mjs +21 -21
  324. package/scripts/lib/upgrade.mjs +512 -0
  325. package/scripts/publish.mjs +272 -272
  326. package/scripts/register-release.mjs +91 -91
  327. package/scripts/upgrade.mjs +56 -0
  328. package/upgrade/3.json +2213 -0
@@ -1,14 +1,24 @@
1
- import type { PublicPlan, MySubscription, SubscriptionStartInput, SubscriptionStartResult, PlanWithPrices, Plan, PlanInput, PlanUpdate, PlanPrice, PlanPriceInput, Membership, SubscriptionListParams, SubscriptionGrantInput, SubscriptionPage, PlanGrants } from '../types/subscriptions.js';
1
+ import type { PublicPlan, MySubscription, SubscriptionStartInput, SubscriptionStartResult, PlanWithPrices, Plan, PlanInput, PlanUpdate, PlanPrice, PlanPriceInput, Membership, SubscriptionListOptions, SubscriptionGrantInput, PlanGrants } from '../types/subscriptions.js';
2
+ import type { ListResult, ListOptions } from '../types/list.js';
2
3
  export declare namespace subscriptions {
3
- /** Plans open to new members, each with its prices (monthly, yearly, one-off). */
4
- function plans(collectionId: string): Promise<PublicPlan[]>;
4
+ /**
5
+ * Plans open to new members, each with its prices (monthly, yearly, one-off). All of them in one answer:
6
+ * `nextCursor` is always null.
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * const { items: plans } = await subscriptions.plans(collectionId)
11
+ * plans.map((p) => p.prices.map((price) => subscriptions.describePrice(price)))
12
+ * ```
13
+ */
14
+ function plans(collectionId: string): Promise<ListResult<PublicPlan>>;
5
15
  /**
6
16
  * Join a plan: Stripe's checkout page for the chosen price. Send them to `checkoutUrl`. Signed in only (a
7
17
  * membership belongs to an account). The membership exists once Stripe confirms the payment.
8
18
  *
9
19
  * @example
10
20
  * ```typescript
11
- * const plans = await subscriptions.plans(collectionId)
21
+ * const { items: plans } = await subscriptions.plans(collectionId)
12
22
  * const yearly = plans[0].prices.find((p) => p.interval === 'year')
13
23
  * const { checkoutUrl } = await subscriptions.start(collectionId, {
14
24
  * priceId: yearly.id,
@@ -20,8 +30,17 @@ export declare namespace subscriptions {
20
30
  * @throws `SIGN_IN_REQUIRED`, `ALREADY_MEMBER`, `NOT_FOUND` (closed plan or price), `PAYMENTS_NOT_READY`, `INVALID_INPUT`
21
31
  */
22
32
  function start(collectionId: string, input: SubscriptionStartInput): Promise<SubscriptionStartResult>;
23
- /** The signed-in member's memberships, newest first (ended ones too: check `live`). */
24
- function mine(collectionId: string): Promise<MySubscription[]>;
33
+ /**
34
+ * The signed-in member's memberships, newest first (ended ones too: check `live`). All of them in one
35
+ * answer: `nextCursor` is always null.
36
+ *
37
+ * @example
38
+ * ```typescript
39
+ * const { items } = await subscriptions.mine(collectionId)
40
+ * const current = items.find((s) => s.live)
41
+ * ```
42
+ */
43
+ function mine(collectionId: string): Promise<ListResult<MySubscription>>;
25
44
  /**
26
45
  * Cancel: it ends at the end of the paid period, and access stays until then. A one-off plan or a staff
27
46
  * grant ends now. Undo with `resume` before the period ends.
@@ -50,11 +69,18 @@ export declare namespace subscriptions {
50
69
  }, locale?: string): string;
51
70
  /** The business's side: plans, prices and members (collection admins). Payments use the shop's Stripe set-up. */
52
71
  namespace admin {
53
- function listPlans(collectionId: string, params?: {
72
+ /**
73
+ * The collection's plans with their prices, a page at a time. `active: true` for only the ones open to
74
+ * new members.
75
+ *
76
+ * @example
77
+ * ```typescript
78
+ * const { items, nextCursor } = await subscriptions.admin.listPlans(collectionId, { active: true })
79
+ * ```
80
+ */
81
+ function listPlans(collectionId: string, params?: ListOptions & {
54
82
  active?: boolean;
55
- limit?: number;
56
- offset?: number;
57
- }): Promise<SubscriptionPage<PlanWithPrices>>;
83
+ }): Promise<ListResult<PlanWithPrices>>;
58
84
  /** A plan with its prices and how many live members it has. */
59
85
  function getPlan(collectionId: string, planId: string): Promise<PlanWithPrices>;
60
86
  /** @throws `INVALID_INPUT` */
@@ -75,8 +101,17 @@ export declare namespace subscriptions {
75
101
  function removePrice(collectionId: string, priceId: string): Promise<{
76
102
  ok: true;
77
103
  }>;
78
- /** Memberships, newest first, with each one's plan. */
79
- function list(collectionId: string, params?: SubscriptionListParams): Promise<SubscriptionPage<Membership>>;
104
+ /**
105
+ * Memberships, newest first, with each one's plan, a page at a time. `count` is how many match in all.
106
+ *
107
+ * @example
108
+ * ```typescript
109
+ * let page = await subscriptions.admin.list(collectionId, { live: true, limit: 50 })
110
+ * page.items // Membership[]
111
+ * while (page.nextCursor) page = await subscriptions.admin.list(collectionId, { live: true, limit: 50, cursor: page.nextCursor })
112
+ * ```
113
+ */
114
+ function list(collectionId: string, params?: SubscriptionListOptions): Promise<ListResult<Membership>>;
80
115
  function get(collectionId: string, subscriptionId: string): Promise<Membership>;
81
116
  /** Give someone a plan without payment (free, honorary, paid in cash). Its grants apply at once. */
82
117
  function grant(collectionId: string, input: SubscriptionGrantInput): Promise<Membership>;
@@ -20,7 +20,16 @@ function qs(params) {
20
20
  }
21
21
  export var subscriptions;
22
22
  (function (subscriptions) {
23
- /** Plans open to new members, each with its prices (monthly, yearly, one-off). */
23
+ /**
24
+ * Plans open to new members, each with its prices (monthly, yearly, one-off). All of them in one answer:
25
+ * `nextCursor` is always null.
26
+ *
27
+ * @example
28
+ * ```typescript
29
+ * const { items: plans } = await subscriptions.plans(collectionId)
30
+ * plans.map((p) => p.prices.map((price) => subscriptions.describePrice(price)))
31
+ * ```
32
+ */
24
33
  async function plans(collectionId) {
25
34
  return request(`${pub(collectionId)}/plans`);
26
35
  }
@@ -31,7 +40,7 @@ export var subscriptions;
31
40
  *
32
41
  * @example
33
42
  * ```typescript
34
- * const plans = await subscriptions.plans(collectionId)
43
+ * const { items: plans } = await subscriptions.plans(collectionId)
35
44
  * const yearly = plans[0].prices.find((p) => p.interval === 'year')
36
45
  * const { checkoutUrl } = await subscriptions.start(collectionId, {
37
46
  * priceId: yearly.id,
@@ -46,7 +55,16 @@ export var subscriptions;
46
55
  return post(`${pub(collectionId)}/start`, input);
47
56
  }
48
57
  subscriptions.start = start;
49
- /** The signed-in member's memberships, newest first (ended ones too: check `live`). */
58
+ /**
59
+ * The signed-in member's memberships, newest first (ended ones too: check `live`). All of them in one
60
+ * answer: `nextCursor` is always null.
61
+ *
62
+ * @example
63
+ * ```typescript
64
+ * const { items } = await subscriptions.mine(collectionId)
65
+ * const current = items.find((s) => s.live)
66
+ * ```
67
+ */
50
68
  async function mine(collectionId) {
51
69
  return request(`${pub(collectionId)}/mine`);
52
70
  }
@@ -88,6 +106,15 @@ export var subscriptions;
88
106
  /** The business's side: plans, prices and members (collection admins). Payments use the shop's Stripe set-up. */
89
107
  let admin;
90
108
  (function (admin) {
109
+ /**
110
+ * The collection's plans with their prices, a page at a time. `active: true` for only the ones open to
111
+ * new members.
112
+ *
113
+ * @example
114
+ * ```typescript
115
+ * const { items, nextCursor } = await subscriptions.admin.listPlans(collectionId, { active: true })
116
+ * ```
117
+ */
91
118
  async function listPlans(collectionId, params) {
92
119
  return request(`${adm(collectionId)}/plans${qs(params)}`);
93
120
  }
@@ -129,7 +156,16 @@ export var subscriptions;
129
156
  return del(`${adm(collectionId)}/prices/${encodeURIComponent(priceId)}`);
130
157
  }
131
158
  admin.removePrice = removePrice;
132
- /** Memberships, newest first, with each one's plan. */
159
+ /**
160
+ * Memberships, newest first, with each one's plan, a page at a time. `count` is how many match in all.
161
+ *
162
+ * @example
163
+ * ```typescript
164
+ * let page = await subscriptions.admin.list(collectionId, { live: true, limit: 50 })
165
+ * page.items // Membership[]
166
+ * while (page.nextCursor) page = await subscriptions.admin.list(collectionId, { live: true, limit: 50, cursor: page.nextCursor })
167
+ * ```
168
+ */
133
169
  async function list(collectionId, params) {
134
170
  return request(`${adm(collectionId)}/subscriptions${qs(params)}`);
135
171
  }
@@ -1,4 +1,5 @@
1
- import type { TagIndexEntry, CreateTagRequest, CreateTagResponse, BatchCreateTagRequest, BatchCreateResult, UpdateTagRequest, UpdateTagResponse, DeleteTagResponse, GetTagResponse, ListTagsRequest, ListTagsResponse, LookupTagsRequest, LookupTagsQueryRequest, TagLookupResponse, PublicGetTagResponse, ByRefRequest, ByRefResponse, ReverseTagLookupParams, ReverseTagLookupResponse } from "../types/tags.js";
1
+ import type { Tag, TagIndexEntry, CreateTagRequest, CreateTagResponse, BatchCreateTagRequest, BatchCreateResult, UpdateTagRequest, UpdateTagResponse, DeleteTagResponse, GetTagResponse, ListTagsRequest, LookupTagsRequest, LookupTagsQueryRequest, TagLookupResponse, PublicGetTagResponse, ByRefRequest, ByRefResponse, ReverseTagLookupParams } from "../types/tags.js";
2
+ import type { ListResult } from "../types/list.js";
2
3
  /**
3
4
  * Tag Management API
4
5
  *
@@ -110,25 +111,28 @@ export declare namespace tags {
110
111
  */
111
112
  function remove(collectionId: string, tagId: string): Promise<DeleteTagResponse>;
112
113
  /**
113
- * List tags with optional filters and pagination (admin).
114
+ * List tags with optional filters, a page at a time (admin).
114
115
  *
115
116
  * @param collectionId - Collection context
116
- * @param params - Optional filter and pagination params
117
- * @returns `{ tags: Tag[], limit: number, offset: number }`
117
+ * @param params - Optional filters, plus `limit` and `cursor`
118
+ * @returns `{ items: Tag[], nextCursor: string | null }`
118
119
  *
119
120
  * @example
120
121
  * ```typescript
121
- * // All tags for a product
122
- * const { tags: list } = await tags.list('coll_123', { productId: 'prod_456' })
123
- *
124
- * // All tags linked to a container
125
- * const { tags: linked } = await tags.list('coll_123', {
122
+ * // Tags for a product, page by page
123
+ * let page = await tags.list('coll_123', { productId: 'prod_456', limit: 100 })
124
+ * while (page.nextCursor) {
125
+ * page = await tags.list('coll_123', { productId: 'prod_456', limit: 100, cursor: page.nextCursor })
126
+ * }
127
+ *
128
+ * // Tags linked to a container
129
+ * const { items: linked } = await tags.list('coll_123', {
126
130
  * refType: 'container',
127
131
  * refId: 'container-uuid',
128
132
  * })
129
133
  * ```
130
134
  */
131
- function list(collectionId: string, params?: ListTagsRequest): Promise<ListTagsResponse>;
135
+ function list(collectionId: string, params?: ListTagsRequest): Promise<ListResult<Tag>>;
132
136
  /**
133
137
  * Reverse lookup — find all tags linked to a given object (admin).
134
138
  *
@@ -137,17 +141,17 @@ export declare namespace tags {
137
141
  *
138
142
  * @param collectionId - Collection context
139
143
  * @param params - `refType` and `refId` are required
140
- * @returns `{ tags: Tag[] }`
144
+ * @returns `{ items: Tag[], nextCursor: null }`: every linked tag in one answer
141
145
  *
142
146
  * @example
143
147
  * ```typescript
144
- * const { tags: linked } = await tags.byRef('coll_123', {
148
+ * const { items: linked } = await tags.byRef('coll_123', {
145
149
  * refType: 'container',
146
150
  * refId: 'container-uuid',
147
151
  * })
148
152
  * ```
149
153
  */
150
- function byRef(collectionId: string, params: ReverseTagLookupParams): Promise<ReverseTagLookupResponse>;
154
+ function byRef(collectionId: string, params: ReverseTagLookupParams): Promise<ListResult<Tag>>;
151
155
  /**
152
156
  * Global tag resolve — returns `{ tagId, collectionId }` only.
153
157
  *
@@ -206,11 +210,11 @@ export declare namespace tags {
206
210
  *
207
211
  * @param collectionId - Collection context
208
212
  * @param data - `{ tagIds: string[], embed?: string }`
209
- * @returns `{ count: number, tags: Tag[], embedded: TagEmbedded }`
213
+ * @returns `{ items: Tag[], nextCursor: null, count: number, embedded: TagEmbedded }`
210
214
  *
211
215
  * @example
212
216
  * ```typescript
213
- * const { count, tags: list, embedded } = await tags.lookupTags('coll_123', {
217
+ * const { items, count, embedded } = await tags.lookupTags('coll_123', {
214
218
  * tagIds: ['NFC-001', 'NFC-002', 'NFC-003'],
215
219
  * embed: 'product,proof',
216
220
  * })
@@ -224,7 +228,15 @@ export declare namespace tags {
224
228
  *
225
229
  * @param collectionId - Collection context
226
230
  * @param params - `tagIds` is comma-separated; `embed` is optional
227
- * @returns `{ count: number, tags: Tag[], embedded: TagEmbedded }`
231
+ * @returns `{ items: Tag[], nextCursor: null, count: number, embedded: TagEmbedded }`
232
+ *
233
+ * @example
234
+ * ```typescript
235
+ * const { items, embedded } = await tags.lookupTagsQuery('coll_123', {
236
+ * tagIds: 'NFC-001,NFC-002',
237
+ * embed: 'product',
238
+ * })
239
+ * ```
228
240
  */
229
241
  function lookupTagsQuery(collectionId: string, params: LookupTagsQueryRequest): Promise<TagLookupResponse>;
230
242
  /**
@@ -234,11 +246,11 @@ export declare namespace tags {
234
246
  *
235
247
  * @param collectionId - Collection context
236
248
  * @param params - `refType` and `refId` are required; `embed` is optional
237
- * @returns `{ tags: Tag[], embedded: TagEmbedded }`
249
+ * @returns `{ items: Tag[], nextCursor: null, embedded: TagEmbedded }`
238
250
  *
239
251
  * @example
240
252
  * ```typescript
241
- * const { tags: linked, embedded } = await tags.publicByRef('coll_123', {
253
+ * const { items: linked, embedded } = await tags.publicByRef('coll_123', {
242
254
  * refType: 'container',
243
255
  * refId: 'container-uuid',
244
256
  * embed: 'container',
@@ -254,7 +266,16 @@ export declare namespace tags {
254
266
  *
255
267
  * @param collectionId - Collection context
256
268
  * @param data - `{ refType, refId, embed? }`
257
- * @returns `{ tags: Tag[], embedded: TagEmbedded }`
269
+ * @returns `{ items: Tag[], nextCursor: null, embedded: TagEmbedded }`
270
+ *
271
+ * @example
272
+ * ```typescript
273
+ * const { items: linked, embedded } = await tags.publicByRefPost('coll_123', {
274
+ * refType: 'container',
275
+ * refId: 'container-uuid',
276
+ * embed: 'container',
277
+ * })
278
+ * ```
258
279
  */
259
280
  function publicByRefPost(collectionId: string, data: ByRefRequest): Promise<ByRefResponse>;
260
281
  }
package/dist/api/tags.js CHANGED
@@ -135,19 +135,22 @@ export var tags;
135
135
  }
136
136
  tags.remove = remove;
137
137
  /**
138
- * List tags with optional filters and pagination (admin).
138
+ * List tags with optional filters, a page at a time (admin).
139
139
  *
140
140
  * @param collectionId - Collection context
141
- * @param params - Optional filter and pagination params
142
- * @returns `{ tags: Tag[], limit: number, offset: number }`
141
+ * @param params - Optional filters, plus `limit` and `cursor`
142
+ * @returns `{ items: Tag[], nextCursor: string | null }`
143
143
  *
144
144
  * @example
145
145
  * ```typescript
146
- * // All tags for a product
147
- * const { tags: list } = await tags.list('coll_123', { productId: 'prod_456' })
148
- *
149
- * // All tags linked to a container
150
- * const { tags: linked } = await tags.list('coll_123', {
146
+ * // Tags for a product, page by page
147
+ * let page = await tags.list('coll_123', { productId: 'prod_456', limit: 100 })
148
+ * while (page.nextCursor) {
149
+ * page = await tags.list('coll_123', { productId: 'prod_456', limit: 100, cursor: page.nextCursor })
150
+ * }
151
+ *
152
+ * // Tags linked to a container
153
+ * const { items: linked } = await tags.list('coll_123', {
151
154
  * refType: 'container',
152
155
  * refId: 'container-uuid',
153
156
  * })
@@ -157,8 +160,8 @@ export var tags;
157
160
  const q = new URLSearchParams();
158
161
  if (params === null || params === void 0 ? void 0 : params.limit)
159
162
  q.append('limit', params.limit.toString());
160
- if (params === null || params === void 0 ? void 0 : params.offset)
161
- q.append('offset', params.offset.toString());
163
+ if (params === null || params === void 0 ? void 0 : params.cursor)
164
+ q.append('cursor', params.cursor);
162
165
  if (params === null || params === void 0 ? void 0 : params.productId)
163
166
  q.append('productId', params.productId);
164
167
  if (params === null || params === void 0 ? void 0 : params.variantId)
@@ -182,11 +185,11 @@ export var tags;
182
185
  *
183
186
  * @param collectionId - Collection context
184
187
  * @param params - `refType` and `refId` are required
185
- * @returns `{ tags: Tag[] }`
188
+ * @returns `{ items: Tag[], nextCursor: null }`: every linked tag in one answer
186
189
  *
187
190
  * @example
188
191
  * ```typescript
189
- * const { tags: linked } = await tags.byRef('coll_123', {
192
+ * const { items: linked } = await tags.byRef('coll_123', {
190
193
  * refType: 'container',
191
194
  * refId: 'container-uuid',
192
195
  * })
@@ -276,11 +279,11 @@ export var tags;
276
279
  *
277
280
  * @param collectionId - Collection context
278
281
  * @param data - `{ tagIds: string[], embed?: string }`
279
- * @returns `{ count: number, tags: Tag[], embedded: TagEmbedded }`
282
+ * @returns `{ items: Tag[], nextCursor: null, count: number, embedded: TagEmbedded }`
280
283
  *
281
284
  * @example
282
285
  * ```typescript
283
- * const { count, tags: list, embedded } = await tags.lookupTags('coll_123', {
286
+ * const { items, count, embedded } = await tags.lookupTags('coll_123', {
284
287
  * tagIds: ['NFC-001', 'NFC-002', 'NFC-003'],
285
288
  * embed: 'product,proof',
286
289
  * })
@@ -298,7 +301,15 @@ export var tags;
298
301
  *
299
302
  * @param collectionId - Collection context
300
303
  * @param params - `tagIds` is comma-separated; `embed` is optional
301
- * @returns `{ count: number, tags: Tag[], embedded: TagEmbedded }`
304
+ * @returns `{ items: Tag[], nextCursor: null, count: number, embedded: TagEmbedded }`
305
+ *
306
+ * @example
307
+ * ```typescript
308
+ * const { items, embedded } = await tags.lookupTagsQuery('coll_123', {
309
+ * tagIds: 'NFC-001,NFC-002',
310
+ * embed: 'product',
311
+ * })
312
+ * ```
302
313
  */
303
314
  async function lookupTagsQuery(collectionId, params) {
304
315
  const q = new URLSearchParams();
@@ -316,11 +327,11 @@ export var tags;
316
327
  *
317
328
  * @param collectionId - Collection context
318
329
  * @param params - `refType` and `refId` are required; `embed` is optional
319
- * @returns `{ tags: Tag[], embedded: TagEmbedded }`
330
+ * @returns `{ items: Tag[], nextCursor: null, embedded: TagEmbedded }`
320
331
  *
321
332
  * @example
322
333
  * ```typescript
323
- * const { tags: linked, embedded } = await tags.publicByRef('coll_123', {
334
+ * const { items: linked, embedded } = await tags.publicByRef('coll_123', {
324
335
  * refType: 'container',
325
336
  * refId: 'container-uuid',
326
337
  * embed: 'container',
@@ -345,7 +356,16 @@ export var tags;
345
356
  *
346
357
  * @param collectionId - Collection context
347
358
  * @param data - `{ refType, refId, embed? }`
348
- * @returns `{ tags: Tag[], embedded: TagEmbedded }`
359
+ * @returns `{ items: Tag[], nextCursor: null, embedded: TagEmbedded }`
360
+ *
361
+ * @example
362
+ * ```typescript
363
+ * const { items: linked, embedded } = await tags.publicByRefPost('coll_123', {
364
+ * refType: 'container',
365
+ * refId: 'container-uuid',
366
+ * embed: 'container',
367
+ * })
368
+ * ```
349
369
  */
350
370
  async function publicByRefPost(collectionId, data) {
351
371
  const path = `/public/collection/${encodeURIComponent(collectionId)}/tags/by-ref`;
@@ -1,6 +1,16 @@
1
1
  import type { Template, TemplateInput, TemplateUpdate, TemplatePublic, TemplateRenderRequest, TemplateRenderResponse, TemplateRenderSourceRequest, TemplateRenderSourceResponse } from "../types/index.js";
2
+ import type { ListResult } from "../types/list.js";
2
3
  export declare namespace template {
3
- function getAll(collectionId: string): Promise<Template[]>;
4
+ /**
5
+ * Every template in the collection (admin), in one answer: `nextCursor` is always null.
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * const { items } = await template.getAll('coll_123')
10
+ * items // Template[]
11
+ * ```
12
+ */
13
+ function getAll(collectionId: string): Promise<ListResult<Template>>;
4
14
  function get(collectionId: string, templateId: string): Promise<Template>;
5
15
  function create(collectionId: string, data: TemplateInput): Promise<Template>;
6
16
  function update(collectionId: string, templateId: string, data: TemplateUpdate): Promise<Template>;
@@ -8,10 +18,28 @@ export declare namespace template {
8
18
  function uploadAsset(collectionId: string, templateId: string, file: File | Blob): Promise<{
9
19
  url: string;
10
20
  }>;
11
- function getAllowed(collectionId: string): Promise<TemplatePublic[]>;
21
+ /**
22
+ * The collection's templates that may be used publicly, in one answer: `nextCursor` is always null.
23
+ *
24
+ * @example
25
+ * ```typescript
26
+ * const { items } = await template.getAllowed('coll_123')
27
+ * items // TemplatePublic[]
28
+ * ```
29
+ */
30
+ function getAllowed(collectionId: string): Promise<ListResult<TemplatePublic>>;
12
31
  function getPublic(collectionId: string, templateId: string): Promise<TemplatePublic>;
13
32
  function getGlobal(templateId: string): Promise<TemplatePublic>;
14
- function getAllowedGlobal(collectionId: string): Promise<TemplatePublic[]>;
33
+ /**
34
+ * The global templates this collection may use, in one answer: `nextCursor` is always null.
35
+ *
36
+ * @example
37
+ * ```typescript
38
+ * const { items } = await template.getAllowedGlobal('coll_123')
39
+ * items // TemplatePublic[]
40
+ * ```
41
+ */
42
+ function getAllowedGlobal(collectionId: string): Promise<ListResult<TemplatePublic>>;
15
43
  function render(collectionId: string, templateId: string, body: TemplateRenderRequest): Promise<TemplateRenderResponse>;
16
44
  function renderSource(collectionId: string, body: TemplateRenderSourceRequest): Promise<TemplateRenderSourceResponse>;
17
45
  }
@@ -2,6 +2,15 @@ import { request, post, put, del as httpDel } from "../http.js";
2
2
  export var template;
3
3
  (function (template) {
4
4
  // Admin APIs
5
+ /**
6
+ * Every template in the collection (admin), in one answer: `nextCursor` is always null.
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * const { items } = await template.getAll('coll_123')
11
+ * items // Template[]
12
+ * ```
13
+ */
5
14
  async function getAll(collectionId) {
6
15
  const path = `/admin/collection/${encodeURIComponent(collectionId)}/template`;
7
16
  return request(path);
@@ -36,6 +45,15 @@ export var template;
36
45
  }
37
46
  template.uploadAsset = uploadAsset;
38
47
  // Public APIs
48
+ /**
49
+ * The collection's templates that may be used publicly, in one answer: `nextCursor` is always null.
50
+ *
51
+ * @example
52
+ * ```typescript
53
+ * const { items } = await template.getAllowed('coll_123')
54
+ * items // TemplatePublic[]
55
+ * ```
56
+ */
39
57
  async function getAllowed(collectionId) {
40
58
  const path = `/public/collection/${encodeURIComponent(collectionId)}/template/getAllowed`;
41
59
  return request(path);
@@ -51,6 +69,15 @@ export var template;
51
69
  return request(path);
52
70
  }
53
71
  template.getGlobal = getGlobal;
72
+ /**
73
+ * The global templates this collection may use, in one answer: `nextCursor` is always null.
74
+ *
75
+ * @example
76
+ * ```typescript
77
+ * const { items } = await template.getAllowedGlobal('coll_123')
78
+ * items // TemplatePublic[]
79
+ * ```
80
+ */
54
81
  async function getAllowedGlobal(collectionId) {
55
82
  const path = `/public/template/getAllowed/${encodeURIComponent(collectionId)}`;
56
83
  return request(path);
@@ -1,5 +1,6 @@
1
1
  import type { TranslationActivity } from '../translationActivity.js';
2
- import type { ResolvedTranslationResponse, TranslationHashOptions, TranslationListParams, TranslationListResponse, TranslationLookupRequest, TranslationLookupResponse, TranslationRecord, TranslationResolveOptions, TranslationRules, TranslationUpdateRequest } from '../types/translations.js';
2
+ import type { ResolvedTranslationResponse, TranslationHashOptions, TranslationListParams, TranslationLookupRequest, TranslationLookupResponse, TranslationRecord, TranslationResolveOptions, TranslationRules, TranslationUpdateRequest } from '../types/translations.js';
3
+ import type { ListResult } from '../types/list.js';
3
4
  /** @internal tests only */
4
5
  export declare function _resetRevisionChecks(): void;
5
6
  export declare namespace translations {
@@ -22,7 +23,21 @@ export declare namespace translations {
22
23
  /** Whether a first-time translation is under way right now (see onActivity). */
23
24
  function activity(): TranslationActivity;
24
25
  function resolve(collectionId: string, body: TranslationLookupRequest, options?: TranslationResolveOptions): Promise<ResolvedTranslationResponse>;
25
- function list(collectionId: string, params?: TranslationListParams): Promise<TranslationListResponse>;
26
+ /**
27
+ * Admin: the collection's stored translations, a page at a time. Filter by language, content type, where
28
+ * the text appears (`contextKey`), a search (`q`), whether a person edited it (`isOverride`), or whether
29
+ * it misses the site's required wording (`termIssues`). `count` is how many match in all.
30
+ *
31
+ * @example
32
+ * ```typescript
33
+ * let page = await translations.list('coll_123', { targetLanguage: 'de', limit: 50 })
34
+ * page.items // TranslationRecord[]
35
+ * while (page.nextCursor) {
36
+ * page = await translations.list('coll_123', { targetLanguage: 'de', limit: 50, cursor: page.nextCursor })
37
+ * }
38
+ * ```
39
+ */
40
+ function list(collectionId: string, params?: TranslationListParams): Promise<ListResult<TranslationRecord>>;
26
41
  function get(collectionId: string, translationId: string): Promise<TranslationRecord>;
27
42
  function update(collectionId: string, translationId: string, body: TranslationUpdateRequest): Promise<TranslationRecord>;
28
43
  /** Admin: how many translations exist per language, and how many a person has edited. */
@@ -274,6 +274,20 @@ export var translations;
274
274
  };
275
275
  }
276
276
  translations.resolve = resolve;
277
+ /**
278
+ * Admin: the collection's stored translations, a page at a time. Filter by language, content type, where
279
+ * the text appears (`contextKey`), a search (`q`), whether a person edited it (`isOverride`), or whether
280
+ * it misses the site's required wording (`termIssues`). `count` is how many match in all.
281
+ *
282
+ * @example
283
+ * ```typescript
284
+ * let page = await translations.list('coll_123', { targetLanguage: 'de', limit: 50 })
285
+ * page.items // TranslationRecord[]
286
+ * while (page.nextCursor) {
287
+ * page = await translations.list('coll_123', { targetLanguage: 'de', limit: 50, cursor: page.nextCursor })
288
+ * }
289
+ * ```
290
+ */
277
291
  async function list(collectionId, params) {
278
292
  const query = buildTranslationListQuery(params);
279
293
  const path = `/admin/collection/${encodeURIComponent(collectionId)}/translations${query}`;
@@ -1,4 +1,5 @@
1
1
  import type { UserGroup, CreateUserGroupRequest, UpdateUserGroupRequest, UserGroupMember, AddUserGroupMemberRequest, UserGroupRef, MyUserGroups, UserGroupChange, UserGroupHistoryParams } from "../types/userGroups.js";
2
+ import type { ListResult } from "../types/list.js";
2
3
  /**
3
4
  * User groups: named lists of people in a collection, used to say who may do what.
4
5
  *
@@ -21,8 +22,16 @@ export declare namespace userGroups {
21
22
  * ```
22
23
  */
23
24
  function mine(collectionId: string): Promise<MyUserGroups>;
24
- /** Every user group in the collection (admin). */
25
- function list(collectionId: string): Promise<UserGroup[]>;
25
+ /**
26
+ * Every user group in the collection (admin), in one answer: `nextCursor` is always null.
27
+ *
28
+ * @example
29
+ * ```typescript
30
+ * const { items } = await userGroups.list('coll_123')
31
+ * items.map((g) => g.name)
32
+ * ```
33
+ */
34
+ function list(collectionId: string): Promise<ListResult<UserGroup>>;
26
35
  /** One user group (admin). */
27
36
  function get(collectionId: string, userGroupId: string): Promise<UserGroup>;
28
37
  /**
@@ -46,8 +55,16 @@ export declare namespace userGroups {
46
55
  function update(collectionId: string, userGroupId: string, data: UpdateUserGroupRequest): Promise<UserGroup>;
47
56
  /** Delete a user group (admin). Its members lose whatever it allowed. */
48
57
  function remove(collectionId: string, userGroupId: string): Promise<UserGroup>;
49
- /** The people in a user group, with name and email (admin). */
50
- function members(collectionId: string, userGroupId: string): Promise<UserGroupMember[]>;
58
+ /**
59
+ * The people in a user group, with name and email (admin), in one answer: `nextCursor` is always null.
60
+ *
61
+ * @example
62
+ * ```typescript
63
+ * const { items } = await userGroups.members('coll_123', qc.id)
64
+ * items // [{ uid, name, email }]
65
+ * ```
66
+ */
67
+ function members(collectionId: string, userGroupId: string): Promise<ListResult<UserGroupMember>>;
51
68
  /**
52
69
  * Add one person (admin), by user id or by email. By email, the person is found in the collection's
53
70
  * logins or added to them (no welcome email is sent). Adding someone who is already in changes nothing.
@@ -65,14 +82,23 @@ export declare namespace userGroups {
65
82
  * or removed, each with the admin who did it (`actorId`) and when (`at`). Give `userGroupId` for one
66
83
  * user group, `userId` for everything about one person, or neither for the whole collection.
67
84
  * Covers the last 30 days unless you give `from` / `to` (at most 400 days). Takes about a second.
85
+ * It has no further pages (`nextCursor` is always null): ask for more with `limit`, or narrow the dates.
86
+ *
87
+ * @example
88
+ * ```typescript
89
+ * const { items } = await userGroups.history('coll_123', { userId: 'uid_1' })
90
+ * // items: [{ at, type: 'usergroup.member-added', actorId: 'uid_admin', data: { key: 'qc-controllers', userId: 'uid_1', … } }]
91
+ * ```
92
+ */
93
+ function history(collectionId: string, params?: UserGroupHistoryParams): Promise<ListResult<UserGroupChange>>;
94
+ /**
95
+ * The user groups one person is in (admin), in one answer: `nextCursor` is always null.
68
96
  *
69
97
  * @example
70
98
  * ```typescript
71
- * const who = await userGroups.history('coll_123', { userId: 'uid_1' })
72
- * // [{ at, type: 'usergroup.member-added', actorId: 'uid_admin', data: { key: 'qc-controllers', userId: 'uid_1', … } }]
99
+ * const { items } = await userGroups.ofUser('coll_123', 'uid_1')
100
+ * items // [{ id, key, name }]
73
101
  * ```
74
102
  */
75
- function history(collectionId: string, params?: UserGroupHistoryParams): Promise<UserGroupChange[]>;
76
- /** The user groups one person is in (admin). */
77
- function ofUser(collectionId: string, userId: string): Promise<UserGroupRef[]>;
103
+ function ofUser(collectionId: string, userId: string): Promise<ListResult<UserGroupRef>>;
78
104
  }