@proveanything/smartlinks 3.0.0-alpha.1 → 3.0.0-alpha.2

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 (145) hide show
  1. package/README.md +7 -7
  2. package/dist/api/analytics.d.ts +5 -4
  3. package/dist/api/analytics.js +5 -4
  4. package/dist/api/appConfiguration.d.ts +23 -18
  5. package/dist/api/appConfiguration.js +24 -18
  6. package/dist/api/appObjects.d.ts +54 -10
  7. package/dist/api/appObjects.js +75 -40
  8. package/dist/api/asset.d.ts +28 -22
  9. package/dist/api/asset.js +45 -56
  10. package/dist/api/attestation.d.ts +11 -3
  11. package/dist/api/attestation.js +12 -3
  12. package/dist/api/attestations.d.ts +12 -8
  13. package/dist/api/attestations.js +18 -21
  14. package/dist/api/authKit.d.ts +15 -10
  15. package/dist/api/authKit.js +17 -11
  16. package/dist/api/batch.d.ts +36 -25
  17. package/dist/api/batch.js +46 -39
  18. package/dist/api/bookings.d.ts +18 -9
  19. package/dist/api/bookings.js +23 -13
  20. package/dist/api/broadcasts.js +3 -17
  21. package/dist/api/claimSet.d.ts +26 -12
  22. package/dist/api/claimSet.js +32 -24
  23. package/dist/api/collection.d.ts +15 -10
  24. package/dist/api/collection.js +17 -11
  25. package/dist/api/comms.d.ts +12 -6
  26. package/dist/api/comms.js +12 -6
  27. package/dist/api/conditions.d.ts +7 -6
  28. package/dist/api/conditions.js +8 -6
  29. package/dist/api/contact.d.ts +6 -2
  30. package/dist/api/contact.js +25 -60
  31. package/dist/api/containers.d.ts +14 -10
  32. package/dist/api/containers.js +19 -14
  33. package/dist/api/crate.js +7 -9
  34. package/dist/api/dpp.d.ts +20 -13
  35. package/dist/api/dpp.js +23 -15
  36. package/dist/api/facets.d.ts +38 -13
  37. package/dist/api/facets.js +40 -15
  38. package/dist/api/files.d.ts +5 -2
  39. package/dist/api/files.js +7 -4
  40. package/dist/api/form.d.ts +8 -5
  41. package/dist/api/form.js +9 -5
  42. package/dist/api/index.d.ts +0 -1
  43. package/dist/api/index.js +0 -1
  44. package/dist/api/integrations.d.ts +29 -17
  45. package/dist/api/integrations.js +32 -25
  46. package/dist/api/interactions.d.ts +11 -6
  47. package/dist/api/interactions.js +14 -23
  48. package/dist/api/jobs.d.ts +16 -6
  49. package/dist/api/jobs.js +30 -20
  50. package/dist/api/journeys.js +2 -14
  51. package/dist/api/journeysAnalytics.d.ts +8 -5
  52. package/dist/api/journeysAnalytics.js +8 -5
  53. package/dist/api/knowledge.d.ts +20 -14
  54. package/dist/api/knowledge.js +22 -15
  55. package/dist/api/location.d.ts +6 -3
  56. package/dist/api/location.js +8 -22
  57. package/dist/api/lots.d.ts +9 -5
  58. package/dist/api/lots.js +22 -26
  59. package/dist/api/loyalty.d.ts +25 -16
  60. package/dist/api/loyalty.js +33 -32
  61. package/dist/api/nfc.d.ts +3 -1
  62. package/dist/api/nfc.js +3 -1
  63. package/dist/api/order.d.ts +45 -39
  64. package/dist/api/order.js +48 -65
  65. package/dist/api/partner.d.ts +17 -14
  66. package/dist/api/partner.js +21 -22
  67. package/dist/api/products.d.ts +35 -12
  68. package/dist/api/products.js +36 -13
  69. package/dist/api/proof.d.ts +41 -19
  70. package/dist/api/proof.js +44 -23
  71. package/dist/api/segments.js +3 -15
  72. package/dist/api/serviceAccounts.d.ts +8 -5
  73. package/dist/api/serviceAccounts.js +9 -6
  74. package/dist/api/shop.d.ts +7 -5
  75. package/dist/api/shop.js +13 -19
  76. package/dist/api/subscriptions.d.ts +12 -10
  77. package/dist/api/subscriptions.js +17 -25
  78. package/dist/api/tags.d.ts +23 -20
  79. package/dist/api/tags.js +40 -52
  80. package/dist/api/template.d.ts +16 -11
  81. package/dist/api/template.js +19 -13
  82. package/dist/api/translations.js +2 -12
  83. package/dist/api/userGroups.d.ts +26 -16
  84. package/dist/api/userGroups.js +43 -30
  85. package/dist/api/variant.d.ts +10 -7
  86. package/dist/api/variant.js +11 -7
  87. package/dist/api/wallet.d.ts +14 -11
  88. package/dist/api/wallet.js +15 -12
  89. package/dist/docs/API_SUMMARY.md +289 -483
  90. package/dist/docs/ai.md +15 -15
  91. package/dist/docs/analytics.md +1 -1
  92. package/dist/docs/app-objects.md +4 -4
  93. package/dist/docs/attestations.md +8 -8
  94. package/dist/docs/contact-search.md +2 -3
  95. package/dist/docs/knowledge.md +3 -3
  96. package/dist/docs/lists.md +58 -15
  97. package/dist/docs/upgrading-to-3.md +238 -136
  98. package/dist/list.d.ts +12 -0
  99. package/dist/list.js +59 -0
  100. package/dist/openapi.yaml +301 -662
  101. package/dist/types/analytics.d.ts +7 -3
  102. package/dist/types/appObjects.d.ts +27 -12
  103. package/dist/types/appOptions.d.ts +2 -2
  104. package/dist/types/asset.d.ts +5 -6
  105. package/dist/types/attestations.d.ts +7 -9
  106. package/dist/types/batch.d.ts +5 -5
  107. package/dist/types/bookings.d.ts +10 -5
  108. package/dist/types/comms.d.ts +9 -5
  109. package/dist/types/contact.d.ts +7 -4
  110. package/dist/types/containers.d.ts +2 -1
  111. package/dist/types/facets.d.ts +14 -2
  112. package/dist/types/files.d.ts +3 -2
  113. package/dist/types/integrations.d.ts +2 -1
  114. package/dist/types/interaction.d.ts +15 -7
  115. package/dist/types/jobs.d.ts +1 -1
  116. package/dist/types/journeysAnalytics.d.ts +3 -2
  117. package/dist/types/knowledge.d.ts +6 -3
  118. package/dist/types/knowledge.js +0 -1
  119. package/dist/types/list.d.ts +30 -2
  120. package/dist/types/location.d.ts +7 -2
  121. package/dist/types/location.js +0 -1
  122. package/dist/types/lots.d.ts +5 -2
  123. package/dist/types/lots.js +0 -6
  124. package/dist/types/order.d.ts +22 -20
  125. package/dist/types/product.d.ts +28 -11
  126. package/dist/types/proof.d.ts +7 -8
  127. package/dist/types/tags.d.ts +5 -3
  128. package/dist/types/userGroups.d.ts +3 -3
  129. package/dist/types/userGroups.js +0 -4
  130. package/dist/version.d.ts +1 -1
  131. package/dist/version.js +1 -1
  132. package/docs/API_SUMMARY.md +289 -483
  133. package/docs/ai.md +15 -15
  134. package/docs/analytics.md +1 -1
  135. package/docs/app-objects.md +4 -4
  136. package/docs/attestations.md +8 -8
  137. package/docs/contact-search.md +2 -3
  138. package/docs/knowledge.md +3 -3
  139. package/docs/lists.md +58 -15
  140. package/docs/upgrading-to-3.md +238 -136
  141. package/openapi.yaml +301 -662
  142. package/package.json +1 -1
  143. package/scripts/lib/upgrade.mjs +216 -60
  144. package/scripts/upgrade.mjs +33 -10
  145. package/upgrade/3.json +2731 -2213
@@ -140,15 +140,15 @@ export declare namespace tags {
140
140
  * No embed support on the admin side.
141
141
  *
142
142
  * @param collectionId - Collection context
143
- * @param params - `refType` and `refId` are required
144
- * @returns `{ items: Tag[], nextCursor: null }`: every linked tag in one answer
143
+ * @param params - `refType` and `refId` are required; plus `limit` (default 50) and `cursor`
144
+ * @returns `{ items: Tag[], nextCursor: string | null }`: the linked tags, a page at a time
145
145
  *
146
146
  * @example
147
147
  * ```typescript
148
- * const { items: linked } = await tags.byRef('coll_123', {
149
- * refType: 'container',
150
- * refId: 'container-uuid',
151
- * })
148
+ * let page = await tags.byRef('coll_123', { refType: 'container', refId: 'container-uuid', limit: 50 })
149
+ * while (page.nextCursor) {
150
+ * page = await tags.byRef('coll_123', { refType: 'container', refId: 'container-uuid', limit: 50, cursor: page.nextCursor })
151
+ * }
152
152
  * ```
153
153
  */
154
154
  function byRef(collectionId: string, params: ReverseTagLookupParams): Promise<ListResult<Tag>>;
@@ -209,15 +209,15 @@ export declare namespace tags {
209
209
  * Returns deduplicated embedded objects alongside the tag array.
210
210
  *
211
211
  * @param collectionId - Collection context
212
- * @param data - `{ tagIds: string[], embed?: string }`
213
- * @returns `{ items: Tag[], nextCursor: null, count: number, embedded: TagEmbedded }`
212
+ * @param data - `{ tagIds: string[], embed?: string }`, plus `limit` (default 50) and `cursor`
213
+ * @returns `{ items: Tag[], nextCursor: string | null, count: number, embedded: TagEmbedded }`:
214
+ * the tags found, a page at a time
214
215
  *
215
216
  * @example
216
217
  * ```typescript
217
- * const { items, count, embedded } = await tags.lookupTags('coll_123', {
218
- * tagIds: ['NFC-001', 'NFC-002', 'NFC-003'],
219
- * embed: 'product,proof',
220
- * })
218
+ * const tagIds = ['NFC-001', 'NFC-002', 'NFC-003']
219
+ * // Every tag found comes back in the one answer: a look-up is never paged.
220
+ * const { items, embedded } = await tags.lookupTags('coll_123', { tagIds, embed: 'product,proof' })
221
221
  * ```
222
222
  */
223
223
  function lookupTags(collectionId: string, data: LookupTagsRequest): Promise<TagLookupResponse>;
@@ -227,8 +227,9 @@ export declare namespace tags {
227
227
  * `GET /public/collection/:collectionId/tags/lookup?tagIds=NFC-001,NFC-002&embed=product`
228
228
  *
229
229
  * @param collectionId - Collection context
230
- * @param params - `tagIds` is comma-separated; `embed` is optional
231
- * @returns `{ items: Tag[], nextCursor: null, count: number, embedded: TagEmbedded }`
230
+ * @param params - `tagIds` is comma-separated; `embed` is optional; plus `limit` (default 50) and `cursor`
231
+ * @returns `{ items: Tag[], nextCursor: string | null, count: number, embedded: TagEmbedded }`:
232
+ * the tags found, a page at a time
232
233
  *
233
234
  * @example
234
235
  * ```typescript
@@ -245,15 +246,16 @@ export declare namespace tags {
245
246
  * `GET /public/collection/:collectionId/tags/by-ref?refType=container&refId=<uuid>&embed=ref`
246
247
  *
247
248
  * @param collectionId - Collection context
248
- * @param params - `refType` and `refId` are required; `embed` is optional
249
- * @returns `{ items: Tag[], nextCursor: null, embedded: TagEmbedded }`
249
+ * @param params - `refType` and `refId` are required; `embed` is optional; plus `limit` (default 50) and `cursor`
250
+ * @returns `{ items: Tag[], nextCursor: string | null, embedded: TagEmbedded }`: the linked tags, a page at a time
250
251
  *
251
252
  * @example
252
253
  * ```typescript
253
- * const { items: linked, embedded } = await tags.publicByRef('coll_123', {
254
+ * const { items: linked, embedded, nextCursor } = await tags.publicByRef('coll_123', {
254
255
  * refType: 'container',
255
256
  * refId: 'container-uuid',
256
257
  * embed: 'container',
258
+ * limit: 50,
257
259
  * })
258
260
  * const container = embedded.containers?.[containerId]
259
261
  * ```
@@ -265,15 +267,16 @@ export declare namespace tags {
265
267
  * `POST /public/collection/:collectionId/tags/by-ref`
266
268
  *
267
269
  * @param collectionId - Collection context
268
- * @param data - `{ refType, refId, embed? }`
269
- * @returns `{ items: Tag[], nextCursor: null, embedded: TagEmbedded }`
270
+ * @param data - `{ refType, refId, embed? }`, plus `limit` (default 50) and `cursor`
271
+ * @returns `{ items: Tag[], nextCursor: string | null, embedded: TagEmbedded }`: the linked tags, a page at a time
270
272
  *
271
273
  * @example
272
274
  * ```typescript
273
- * const { items: linked, embedded } = await tags.publicByRefPost('coll_123', {
275
+ * const { items: linked, embedded, nextCursor } = await tags.publicByRefPost('coll_123', {
274
276
  * refType: 'container',
275
277
  * refId: 'container-uuid',
276
278
  * embed: 'container',
279
+ * limit: 50,
277
280
  * })
278
281
  * ```
279
282
  */
package/dist/api/tags.js CHANGED
@@ -1,5 +1,6 @@
1
1
  // src/api/tags.ts
2
2
  import { request, post, put, del } from "../http.js";
3
+ import { listQuery } from "../list.js";
3
4
  /**
4
5
  * Tag Management API
5
6
  *
@@ -157,23 +158,16 @@ export var tags;
157
158
  * ```
158
159
  */
159
160
  async function list(collectionId, params) {
160
- const q = new URLSearchParams();
161
- if (params === null || params === void 0 ? void 0 : params.limit)
162
- q.append('limit', params.limit.toString());
163
- if (params === null || params === void 0 ? void 0 : params.cursor)
164
- q.append('cursor', params.cursor);
165
- if (params === null || params === void 0 ? void 0 : params.productId)
166
- q.append('productId', params.productId);
167
- if (params === null || params === void 0 ? void 0 : params.variantId)
168
- q.append('variantId', params.variantId);
169
- if (params === null || params === void 0 ? void 0 : params.batchId)
170
- q.append('batchId', params.batchId);
171
- if (params === null || params === void 0 ? void 0 : params.refType)
172
- q.append('refType', params.refType);
173
- if (params === null || params === void 0 ? void 0 : params.refId)
174
- q.append('refId', params.refId);
175
- const qs = q.toString();
176
- const path = `/admin/collection/${encodeURIComponent(collectionId)}/tags${qs ? `?${qs}` : ''}`;
161
+ const qs = listQuery({
162
+ limit: (params === null || params === void 0 ? void 0 : params.limit) || undefined,
163
+ cursor: params === null || params === void 0 ? void 0 : params.cursor,
164
+ productId: params === null || params === void 0 ? void 0 : params.productId,
165
+ variantId: params === null || params === void 0 ? void 0 : params.variantId,
166
+ batchId: params === null || params === void 0 ? void 0 : params.batchId,
167
+ refType: params === null || params === void 0 ? void 0 : params.refType,
168
+ refId: params === null || params === void 0 ? void 0 : params.refId,
169
+ });
170
+ const path = `/admin/collection/${encodeURIComponent(collectionId)}/tags${qs}`;
177
171
  return request(path);
178
172
  }
179
173
  tags.list = list;
@@ -184,22 +178,20 @@ export var tags;
184
178
  * No embed support on the admin side.
185
179
  *
186
180
  * @param collectionId - Collection context
187
- * @param params - `refType` and `refId` are required
188
- * @returns `{ items: Tag[], nextCursor: null }`: every linked tag in one answer
181
+ * @param params - `refType` and `refId` are required; plus `limit` (default 50) and `cursor`
182
+ * @returns `{ items: Tag[], nextCursor: string | null }`: the linked tags, a page at a time
189
183
  *
190
184
  * @example
191
185
  * ```typescript
192
- * const { items: linked } = await tags.byRef('coll_123', {
193
- * refType: 'container',
194
- * refId: 'container-uuid',
195
- * })
186
+ * let page = await tags.byRef('coll_123', { refType: 'container', refId: 'container-uuid', limit: 50 })
187
+ * while (page.nextCursor) {
188
+ * page = await tags.byRef('coll_123', { refType: 'container', refId: 'container-uuid', limit: 50, cursor: page.nextCursor })
189
+ * }
196
190
  * ```
197
191
  */
198
192
  async function byRef(collectionId, params) {
199
- const q = new URLSearchParams();
200
- q.append('refType', params.refType);
201
- q.append('refId', params.refId);
202
- const path = `/admin/collection/${encodeURIComponent(collectionId)}/tags/by-ref?${q.toString()}`;
193
+ const qs = listQuery({ refType: params.refType, refId: params.refId, limit: params.limit, cursor: params.cursor });
194
+ const path = `/admin/collection/${encodeURIComponent(collectionId)}/tags/by-ref${qs}`;
203
195
  return request(path);
204
196
  }
205
197
  tags.byRef = byRef;
@@ -278,15 +270,15 @@ export var tags;
278
270
  * Returns deduplicated embedded objects alongside the tag array.
279
271
  *
280
272
  * @param collectionId - Collection context
281
- * @param data - `{ tagIds: string[], embed?: string }`
282
- * @returns `{ items: Tag[], nextCursor: null, count: number, embedded: TagEmbedded }`
273
+ * @param data - `{ tagIds: string[], embed?: string }`, plus `limit` (default 50) and `cursor`
274
+ * @returns `{ items: Tag[], nextCursor: string | null, count: number, embedded: TagEmbedded }`:
275
+ * the tags found, a page at a time
283
276
  *
284
277
  * @example
285
278
  * ```typescript
286
- * const { items, count, embedded } = await tags.lookupTags('coll_123', {
287
- * tagIds: ['NFC-001', 'NFC-002', 'NFC-003'],
288
- * embed: 'product,proof',
289
- * })
279
+ * const tagIds = ['NFC-001', 'NFC-002', 'NFC-003']
280
+ * // Every tag found comes back in the one answer: a look-up is never paged.
281
+ * const { items, embedded } = await tags.lookupTags('coll_123', { tagIds, embed: 'product,proof' })
290
282
  * ```
291
283
  */
292
284
  async function lookupTags(collectionId, data) {
@@ -300,8 +292,9 @@ export var tags;
300
292
  * `GET /public/collection/:collectionId/tags/lookup?tagIds=NFC-001,NFC-002&embed=product`
301
293
  *
302
294
  * @param collectionId - Collection context
303
- * @param params - `tagIds` is comma-separated; `embed` is optional
304
- * @returns `{ items: Tag[], nextCursor: null, count: number, embedded: TagEmbedded }`
295
+ * @param params - `tagIds` is comma-separated; `embed` is optional; plus `limit` (default 50) and `cursor`
296
+ * @returns `{ items: Tag[], nextCursor: string | null, count: number, embedded: TagEmbedded }`:
297
+ * the tags found, a page at a time
305
298
  *
306
299
  * @example
307
300
  * ```typescript
@@ -312,11 +305,8 @@ export var tags;
312
305
  * ```
313
306
  */
314
307
  async function lookupTagsQuery(collectionId, params) {
315
- const q = new URLSearchParams();
316
- q.append('tagIds', params.tagIds);
317
- if (params.embed)
318
- q.append('embed', params.embed);
319
- const path = `/public/collection/${encodeURIComponent(collectionId)}/tags/lookup?${q.toString()}`;
308
+ const qs = listQuery({ tagIds: String(params.tagIds), embed: params.embed });
309
+ const path = `/public/collection/${encodeURIComponent(collectionId)}/tags/lookup${qs}`;
320
310
  return request(path);
321
311
  }
322
312
  tags.lookupTagsQuery = lookupTagsQuery;
@@ -326,26 +316,23 @@ export var tags;
326
316
  * `GET /public/collection/:collectionId/tags/by-ref?refType=container&refId=<uuid>&embed=ref`
327
317
  *
328
318
  * @param collectionId - Collection context
329
- * @param params - `refType` and `refId` are required; `embed` is optional
330
- * @returns `{ items: Tag[], nextCursor: null, embedded: TagEmbedded }`
319
+ * @param params - `refType` and `refId` are required; `embed` is optional; plus `limit` (default 50) and `cursor`
320
+ * @returns `{ items: Tag[], nextCursor: string | null, embedded: TagEmbedded }`: the linked tags, a page at a time
331
321
  *
332
322
  * @example
333
323
  * ```typescript
334
- * const { items: linked, embedded } = await tags.publicByRef('coll_123', {
324
+ * const { items: linked, embedded, nextCursor } = await tags.publicByRef('coll_123', {
335
325
  * refType: 'container',
336
326
  * refId: 'container-uuid',
337
327
  * embed: 'container',
328
+ * limit: 50,
338
329
  * })
339
330
  * const container = embedded.containers?.[containerId]
340
331
  * ```
341
332
  */
342
333
  async function publicByRef(collectionId, params) {
343
- const q = new URLSearchParams();
344
- q.append('refType', params.refType);
345
- q.append('refId', params.refId);
346
- if (params.embed)
347
- q.append('embed', params.embed);
348
- const path = `/public/collection/${encodeURIComponent(collectionId)}/tags/by-ref?${q.toString()}`;
334
+ const qs = listQuery({ refType: params.refType, refId: params.refId, embed: params.embed, limit: params.limit, cursor: params.cursor });
335
+ const path = `/public/collection/${encodeURIComponent(collectionId)}/tags/by-ref${qs}`;
349
336
  return request(path);
350
337
  }
351
338
  tags.publicByRef = publicByRef;
@@ -355,15 +342,16 @@ export var tags;
355
342
  * `POST /public/collection/:collectionId/tags/by-ref`
356
343
  *
357
344
  * @param collectionId - Collection context
358
- * @param data - `{ refType, refId, embed? }`
359
- * @returns `{ items: Tag[], nextCursor: null, embedded: TagEmbedded }`
345
+ * @param data - `{ refType, refId, embed? }`, plus `limit` (default 50) and `cursor`
346
+ * @returns `{ items: Tag[], nextCursor: string | null, embedded: TagEmbedded }`: the linked tags, a page at a time
360
347
  *
361
348
  * @example
362
349
  * ```typescript
363
- * const { items: linked, embedded } = await tags.publicByRefPost('coll_123', {
350
+ * const { items: linked, embedded, nextCursor } = await tags.publicByRefPost('coll_123', {
364
351
  * refType: 'container',
365
352
  * refId: 'container-uuid',
366
353
  * embed: 'container',
354
+ * limit: 50,
367
355
  * })
368
356
  * ```
369
357
  */
@@ -1,16 +1,18 @@
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
+ import type { ListResult, ListOptions } from "../types/list.js";
3
3
  export declare namespace template {
4
4
  /**
5
- * Every template in the collection (admin), in one answer: `nextCursor` is always null.
5
+ * The templates in the collection (admin), 50 at a time unless you give a `limit` (at most 1000).
6
+ * Pass `nextCursor` back as `cursor` for the next page; `null` means that was the last one.
6
7
  *
7
8
  * @example
8
9
  * ```typescript
9
- * const { items } = await template.getAll('coll_123')
10
- * items // Template[]
10
+ * let page = await template.getAll('coll_123', { limit: 100 })
11
+ * page.items // Template[]
12
+ * while (page.nextCursor) page = await template.getAll('coll_123', { limit: 100, cursor: page.nextCursor })
11
13
  * ```
12
14
  */
13
- function getAll(collectionId: string): Promise<ListResult<Template>>;
15
+ function getAll(collectionId: string, options?: ListOptions): Promise<ListResult<Template>>;
14
16
  function get(collectionId: string, templateId: string): Promise<Template>;
15
17
  function create(collectionId: string, data: TemplateInput): Promise<Template>;
16
18
  function update(collectionId: string, templateId: string, data: TemplateUpdate): Promise<Template>;
@@ -19,27 +21,30 @@ export declare namespace template {
19
21
  url: string;
20
22
  }>;
21
23
  /**
22
- * The collection's templates that may be used publicly, in one answer: `nextCursor` is always null.
24
+ * The collection's templates that may be used publicly, 50 at a time unless you give a `limit`
25
+ * (at most 1000). Pass `nextCursor` back as `cursor` for the next page; `null` means that was the
26
+ * last one.
23
27
  *
24
28
  * @example
25
29
  * ```typescript
26
- * const { items } = await template.getAllowed('coll_123')
30
+ * const { items, nextCursor } = await template.getAllowed('coll_123', { limit: 100 })
27
31
  * items // TemplatePublic[]
28
32
  * ```
29
33
  */
30
- function getAllowed(collectionId: string): Promise<ListResult<TemplatePublic>>;
34
+ function getAllowed(collectionId: string, options?: ListOptions): Promise<ListResult<TemplatePublic>>;
31
35
  function getPublic(collectionId: string, templateId: string): Promise<TemplatePublic>;
32
36
  function getGlobal(templateId: string): Promise<TemplatePublic>;
33
37
  /**
34
- * The global templates this collection may use, in one answer: `nextCursor` is always null.
38
+ * The global templates this collection may use, 50 at a time unless you give a `limit` (at most
39
+ * 1000). Pass `nextCursor` back as `cursor` for the next page; `null` means that was the last one.
35
40
  *
36
41
  * @example
37
42
  * ```typescript
38
- * const { items } = await template.getAllowedGlobal('coll_123')
43
+ * const { items, nextCursor } = await template.getAllowedGlobal('coll_123', { limit: 100 })
39
44
  * items // TemplatePublic[]
40
45
  * ```
41
46
  */
42
- function getAllowedGlobal(collectionId: string): Promise<ListResult<TemplatePublic>>;
47
+ function getAllowedGlobal(collectionId: string, options?: ListOptions): Promise<ListResult<TemplatePublic>>;
43
48
  function render(collectionId: string, templateId: string, body: TemplateRenderRequest): Promise<TemplateRenderResponse>;
44
49
  function renderSource(collectionId: string, body: TemplateRenderSourceRequest): Promise<TemplateRenderSourceResponse>;
45
50
  }
@@ -1,18 +1,21 @@
1
1
  import { request, post, put, del as httpDel } from "../http.js";
2
+ import { listQuery } from "../list.js";
2
3
  export var template;
3
4
  (function (template) {
4
5
  // Admin APIs
5
6
  /**
6
- * Every template in the collection (admin), in one answer: `nextCursor` is always null.
7
+ * The templates in the collection (admin), 50 at a time unless you give a `limit` (at most 1000).
8
+ * Pass `nextCursor` back as `cursor` for the next page; `null` means that was the last one.
7
9
  *
8
10
  * @example
9
11
  * ```typescript
10
- * const { items } = await template.getAll('coll_123')
11
- * items // Template[]
12
+ * let page = await template.getAll('coll_123', { limit: 100 })
13
+ * page.items // Template[]
14
+ * while (page.nextCursor) page = await template.getAll('coll_123', { limit: 100, cursor: page.nextCursor })
12
15
  * ```
13
16
  */
14
- async function getAll(collectionId) {
15
- const path = `/admin/collection/${encodeURIComponent(collectionId)}/template`;
17
+ async function getAll(collectionId, options = {}) {
18
+ const path = `/admin/collection/${encodeURIComponent(collectionId)}/template${listQuery({ limit: options.limit, cursor: options.cursor })}`;
16
19
  return request(path);
17
20
  }
18
21
  template.getAll = getAll;
@@ -46,16 +49,18 @@ export var template;
46
49
  template.uploadAsset = uploadAsset;
47
50
  // Public APIs
48
51
  /**
49
- * The collection's templates that may be used publicly, in one answer: `nextCursor` is always null.
52
+ * The collection's templates that may be used publicly, 50 at a time unless you give a `limit`
53
+ * (at most 1000). Pass `nextCursor` back as `cursor` for the next page; `null` means that was the
54
+ * last one.
50
55
  *
51
56
  * @example
52
57
  * ```typescript
53
- * const { items } = await template.getAllowed('coll_123')
58
+ * const { items, nextCursor } = await template.getAllowed('coll_123', { limit: 100 })
54
59
  * items // TemplatePublic[]
55
60
  * ```
56
61
  */
57
- async function getAllowed(collectionId) {
58
- const path = `/public/collection/${encodeURIComponent(collectionId)}/template/getAllowed`;
62
+ async function getAllowed(collectionId, options = {}) {
63
+ const path = `/public/collection/${encodeURIComponent(collectionId)}/template/getAllowed${listQuery({ limit: options.limit, cursor: options.cursor })}`;
59
64
  return request(path);
60
65
  }
61
66
  template.getAllowed = getAllowed;
@@ -70,16 +75,17 @@ export var template;
70
75
  }
71
76
  template.getGlobal = getGlobal;
72
77
  /**
73
- * The global templates this collection may use, in one answer: `nextCursor` is always null.
78
+ * The global templates this collection may use, 50 at a time unless you give a `limit` (at most
79
+ * 1000). Pass `nextCursor` back as `cursor` for the next page; `null` means that was the last one.
74
80
  *
75
81
  * @example
76
82
  * ```typescript
77
- * const { items } = await template.getAllowedGlobal('coll_123')
83
+ * const { items, nextCursor } = await template.getAllowedGlobal('coll_123', { limit: 100 })
78
84
  * items // TemplatePublic[]
79
85
  * ```
80
86
  */
81
- async function getAllowedGlobal(collectionId) {
82
- const path = `/public/template/getAllowed/${encodeURIComponent(collectionId)}`;
87
+ async function getAllowedGlobal(collectionId, options = {}) {
88
+ const path = `/public/template/getAllowed/${encodeURIComponent(collectionId)}${listQuery({ limit: options.limit, cursor: options.cursor })}`;
83
89
  return request(path);
84
90
  }
85
91
  template.getAllowedGlobal = getAllowedGlobal;
@@ -1,6 +1,7 @@
1
1
  import { isProxyEnabled, patch, post, put, request } from '../http.js';
2
2
  import { clearCachedTranslations, deriveTranslationContextKey, getCachedTranslations, getDefaultTranslationCacheTtlMs, hashTranslationText, normalizeTranslationText, setCachedTranslations, } from '../translationCache.js';
3
3
  import { trackTranslation, onActivity as onTranslationActivity, activity as translationActivity, translatingMessage as translatingLine } from '../translationActivity.js';
4
+ import { listQuery } from '../list.js';
4
5
  function normalizeLookupRequest(body) {
5
6
  var _a, _b, _c;
6
7
  const texts = Array.isArray(body.texts)
@@ -32,16 +33,6 @@ function normalizeLookupRequest(body) {
32
33
  texts,
33
34
  };
34
35
  }
35
- function buildTranslationListQuery(params = {}) {
36
- const query = new URLSearchParams();
37
- for (const [key, value] of Object.entries(params)) {
38
- if (value === undefined || value === null)
39
- continue;
40
- query.append(key, String(value));
41
- }
42
- const queryString = query.toString();
43
- return queryString ? `?${queryString}` : '';
44
- }
45
36
  function sameLanguage(left, right) {
46
37
  return left.trim().toLowerCase() === right.trim().toLowerCase();
47
38
  }
@@ -289,8 +280,7 @@ export var translations;
289
280
  * ```
290
281
  */
291
282
  async function list(collectionId, params) {
292
- const query = buildTranslationListQuery(params);
293
- const path = `/admin/collection/${encodeURIComponent(collectionId)}/translations${query}`;
283
+ const path = `/admin/collection/${encodeURIComponent(collectionId)}/translations${listQuery(params)}`;
294
284
  return request(path);
295
285
  }
296
286
  translations.list = list;
@@ -1,5 +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
+ import type { ListResult, ListOptions } from "../types/list.js";
3
3
  /**
4
4
  * User groups: named lists of people in a collection, used to say who may do what.
5
5
  *
@@ -23,15 +23,17 @@ export declare namespace userGroups {
23
23
  */
24
24
  function mine(collectionId: string): Promise<MyUserGroups>;
25
25
  /**
26
- * Every user group in the collection (admin), in one answer: `nextCursor` is always null.
26
+ * The collection's user groups (admin), a page at a time. Page with `limit` (50 unless you say)
27
+ * and `cursor`.
27
28
  *
28
29
  * @example
29
30
  * ```typescript
30
- * const { items } = await userGroups.list('coll_123')
31
- * items.map((g) => g.name)
31
+ * let page = await userGroups.list('coll_123', { limit: 50 })
32
+ * page.items.map((g) => g.name)
33
+ * while (page.nextCursor) page = await userGroups.list('coll_123', { limit: 50, cursor: page.nextCursor })
32
34
  * ```
33
35
  */
34
- function list(collectionId: string): Promise<ListResult<UserGroup>>;
36
+ function list(collectionId: string, options?: ListOptions): Promise<ListResult<UserGroup>>;
35
37
  /** One user group (admin). */
36
38
  function get(collectionId: string, userGroupId: string): Promise<UserGroup>;
37
39
  /**
@@ -56,15 +58,17 @@ export declare namespace userGroups {
56
58
  /** Delete a user group (admin). Its members lose whatever it allowed. */
57
59
  function remove(collectionId: string, userGroupId: string): Promise<UserGroup>;
58
60
  /**
59
- * The people in a user group, with name and email (admin), in one answer: `nextCursor` is always null.
61
+ * The people in a user group, with name and email (admin), a page at a time. Page with `limit`
62
+ * (50 unless you say) and `cursor`.
60
63
  *
61
64
  * @example
62
65
  * ```typescript
63
- * const { items } = await userGroups.members('coll_123', qc.id)
64
- * items // [{ uid, name, email }]
66
+ * let page = await userGroups.members('coll_123', qc.id, { limit: 50 })
67
+ * page.items // [{ uid, name, email }]
68
+ * while (page.nextCursor) page = await userGroups.members('coll_123', qc.id, { limit: 50, cursor: page.nextCursor })
65
69
  * ```
66
70
  */
67
- function members(collectionId: string, userGroupId: string): Promise<ListResult<UserGroupMember>>;
71
+ function members(collectionId: string, userGroupId: string, options?: ListOptions): Promise<ListResult<UserGroupMember>>;
68
72
  /**
69
73
  * Add one person (admin), by user id or by email. By email, the person is found in the collection's
70
74
  * logins or added to them (no welcome email is sent). Adding someone who is already in changes nothing.
@@ -82,23 +86,29 @@ export declare namespace userGroups {
82
86
  * or removed, each with the admin who did it (`actorId`) and when (`at`). Give `userGroupId` for one
83
87
  * user group, `userId` for everything about one person, or neither for the whole collection.
84
88
  * 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.
89
+ * A page at a time: `limit` says how many (default 100, at most 1000); pass `nextCursor` back as
90
+ * `cursor` for the next page.
86
91
  *
87
92
  * @example
88
93
  * ```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', … } }]
94
+ * let page = await userGroups.history('coll_123', { userId: 'uid_1', from: '2026-11-01T00:00:00Z' })
95
+ * // page.items: [{ at, type: 'usergroup.member-added', actorId: 'uid_admin', data: { key: 'qc-controllers', userId: 'uid_1', … } }]
96
+ * while (page.nextCursor) {
97
+ * page = await userGroups.history('coll_123', { userId: 'uid_1', from: '2026-11-01T00:00:00Z', cursor: page.nextCursor })
98
+ * }
91
99
  * ```
92
100
  */
93
101
  function history(collectionId: string, params?: UserGroupHistoryParams): Promise<ListResult<UserGroupChange>>;
94
102
  /**
95
- * The user groups one person is in (admin), in one answer: `nextCursor` is always null.
103
+ * The user groups one person is in (admin), a page at a time. Page with `limit` (50 unless you
104
+ * say) and `cursor`.
96
105
  *
97
106
  * @example
98
107
  * ```typescript
99
- * const { items } = await userGroups.ofUser('coll_123', 'uid_1')
100
- * items // [{ id, key, name }]
108
+ * let page = await userGroups.ofUser('coll_123', 'uid_1')
109
+ * page.items // [{ id, key, name }]
110
+ * while (page.nextCursor) page = await userGroups.ofUser('coll_123', 'uid_1', { cursor: page.nextCursor })
101
111
  * ```
102
112
  */
103
- function ofUser(collectionId: string, userId: string): Promise<ListResult<UserGroupRef>>;
113
+ function ofUser(collectionId: string, userId: string, options?: ListOptions): Promise<ListResult<UserGroupRef>>;
104
114
  }