@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,5 +1,6 @@
1
1
  import type { StandardQuery, QueryResult, QueryDescription } from "../types/query.js";
2
- import type { AppCase, CreateCaseInput, UpdateCaseInput, AppendHistoryInput, CaseSummaryRequest, CaseSummaryResponse, CaseListQueryParams, AppThread, CreateThreadInput, UpdateThreadInput, ReplyInput, ThreadListQueryParams, AppRecord, CreateRecordInput, CreateRecordResponse, UpdateRecordInput, UpsertRecordInput, UpsertRecordResponse, MatchRecordsInput, MatchResult, BulkUpsertItem, BulkUpsertResult, BulkDeleteResult, BulkDeleteInput, RecordListQueryParams, ResolveAllParams, ResolveAllResult, PreviewRuleParams, PreviewRuleResult, PaginatedResponse, AggregateRequest, AggregateResponse, RelatedResponse } from '../types/appObjects.js';
2
+ import type { ListResult } from "../types/list.js";
3
+ import type { AppCase, CreateCaseInput, UpdateCaseInput, AppendHistoryInput, CaseSummaryRequest, CaseSummaryResponse, CaseListQueryParams, AppThread, CreateThreadInput, UpdateThreadInput, ReplyInput, ThreadListQueryParams, AppRecord, CreateRecordInput, CreateRecordResponse, UpdateRecordInput, UpsertRecordInput, UpsertRecordResponse, MatchRecordsInput, MatchResult, BulkUpsertItem, BulkUpsertResult, BulkDeleteResult, BulkDeleteInput, RecordListQueryParams, ResolveAllParams, ResolveAllResult, PreviewRuleParams, PreviewRuleResult, AggregateRequest, AggregateResponse, RelatedResponse } from '../types/appObjects.js';
3
4
  export declare namespace app {
4
5
  /**
5
6
  * Pickers: the small, cached list behind "pick a machine" or "pick a hold reason".
@@ -10,12 +11,21 @@ export declare namespace app {
10
11
  * `source` = `type:<record type or declared type id>` | `list:<list id>`. Admins (`admin: true`)
11
12
  * see every entry; the public API lists public records and lists the app declares public. Hold on
12
13
  * to `version` and pass it back to get `{ unchanged: true }` when nothing changed.
14
+ *
15
+ * Returns `{ items, nextCursor, count?, version, mode }`: the entries are in `items`, already sorted.
16
+ * A picker is not paged, so `nextCursor` is always `null`.
17
+ *
18
+ * @example
19
+ * ```typescript
20
+ * const res = await app.options.get(collectionId, appId, 'type:machine', { admin: true })
21
+ * if (!res.unchanged) { options = res.items; version = res.version }
22
+ * ```
13
23
  */
14
24
  function get(collectionId: string, appId: string, source: string, opts?: {
15
25
  q?: string;
16
26
  version?: string;
17
27
  admin?: boolean;
18
- }): Promise<import('../types/appOptions.js').AppOptionsResponse>;
28
+ }): Promise<import('../types/appOptions.js').AppOptionsList>;
19
29
  /**
20
30
  * Save a value list's values, in order (admins). Codes never change and are never lost: a value left
21
31
  * out stays, switched off, at the end. → the list as saved.
@@ -31,8 +41,22 @@ export declare namespace app {
31
41
  /**
32
42
  * List cases with optional query parameters
33
43
  * GET /cases
44
+ *
45
+ * Returns `{ items, nextCursor, count }`: the cases are in `items`, `count` is how many match in
46
+ * all, and `nextCursor` is `null` on the last page. Page with `limit` and `cursor`.
47
+ * `includeDeleted`, `contactId` and `assignedTo` are for admin calls (`admin = true`) only: the
48
+ * public list refuses a parameter it does not read.
49
+ *
50
+ * @example
51
+ * ```typescript
52
+ * let page = await app.cases.list(collectionId, appId, { status: 'open', limit: 50 })
53
+ * console.log(page.items, page.count)
54
+ * while (page.nextCursor) {
55
+ * page = await app.cases.list(collectionId, appId, { status: 'open', limit: 50, cursor: page.nextCursor })
56
+ * }
57
+ * ```
34
58
  */
35
- function list(collectionId: string, appId: string, params?: CaseListQueryParams, admin?: boolean): Promise<PaginatedResponse<AppCase>>;
59
+ function list(collectionId: string, appId: string, params?: CaseListQueryParams, admin?: boolean): Promise<ListResult<AppCase>>;
36
60
  /**
37
61
  * Get a single case by ID
38
62
  * GET /cases/:caseId
@@ -81,8 +105,22 @@ export declare namespace app {
81
105
  /**
82
106
  * List threads with optional query parameters
83
107
  * GET /threads
108
+ *
109
+ * Returns `{ items, nextCursor, count }`: the threads are in `items`, `count` is how many match in
110
+ * all, and `nextCursor` is `null` on the last page. Page with `limit` and `cursor`.
111
+ * `includeDeleted` and `contactId` are for admin calls (`admin = true`) only: the public list
112
+ * refuses a parameter it does not read.
113
+ *
114
+ * @example
115
+ * ```typescript
116
+ * let page = await app.threads.list(collectionId, appId, { parentType: 'case', parentId: caseId, limit: 50 })
117
+ * console.log(page.items, page.count)
118
+ * while (page.nextCursor) {
119
+ * page = await app.threads.list(collectionId, appId, { parentType: 'case', parentId: caseId, limit: 50, cursor: page.nextCursor })
120
+ * }
121
+ * ```
84
122
  */
85
- function list(collectionId: string, appId: string, params?: ThreadListQueryParams, admin?: boolean): Promise<PaginatedResponse<AppThread>>;
123
+ function list(collectionId: string, appId: string, params?: ThreadListQueryParams, admin?: boolean): Promise<ListResult<AppThread>>;
86
124
  /**
87
125
  * Get a single thread by ID
88
126
  * GET /threads/:threadId
@@ -160,11 +198,25 @@ export declare namespace app {
160
198
  /**
161
199
  * List records with optional query parameters
162
200
  * GET /records
163
- *
164
- * Public/owner callers only receive records with `status: "active"`.
165
- * Admin callers can query all statuses (for example `draft`/`archived`).
201
+ *
202
+ * Returns `{ items, nextCursor, count }`: the records are in `items`, `count` is how many match in
203
+ * all, and `nextCursor` is `null` on the last page. Page with `limit` and `cursor`.
204
+ *
205
+ * Public/owner callers only receive records with `status: "active"`.
206
+ * Admin callers can query all statuses (for example `draft`/`archived`).
207
+ * `qFields`, `dataFilter`, `contactId` and `includeDeleted` are for admin calls (`admin = true`)
208
+ * only: the public list refuses a parameter it does not read.
209
+ *
210
+ * @example
211
+ * ```typescript
212
+ * let page = await app.records.list(collectionId, appId, { recordType: 'tip', limit: 100 })
213
+ * console.log(page.items, page.count)
214
+ * while (page.nextCursor) {
215
+ * page = await app.records.list(collectionId, appId, { recordType: 'tip', limit: 100, cursor: page.nextCursor })
216
+ * }
217
+ * ```
166
218
  */
167
- function list(collectionId: string, appId: string, params?: RecordListQueryParams, admin?: boolean): Promise<PaginatedResponse<AppRecord>>;
219
+ function list(collectionId: string, appId: string, params?: RecordListQueryParams, admin?: boolean): Promise<ListResult<AppRecord>>;
168
220
  /**
169
221
  * Get a single record by ID
170
222
  * GET /records/:recordId
@@ -248,20 +300,21 @@ export declare namespace app {
248
300
  function upsert(collectionId: string, appId: string, input: UpsertRecordInput): Promise<UpsertRecordResponse>;
249
301
  /**
250
302
  * Match records against a runtime target scope.
251
- * Returns records whose scope is satisfied by the target,
252
- * ordered by specificity descending (most specific first).
303
+ * Returns `{ items, nextCursor, count, strategy }`: `items` are the records whose scope is satisfied
304
+ * by the target, most specific first, and `count` is how many matched. It is not paged
305
+ * (`nextCursor` is always `null`); cap the answer with `limit`.
253
306
  * POST /records/match
254
307
  *
255
- * @param admin - false for public endpoint (visibility-filtered, active-only), true for admin
308
+ * @param admin - false for public endpoint (visibility-filtered, active-only), true for admin
256
309
  *
257
310
  * @example
258
311
  * ```ts
259
- * const { records, best } = await app.records.match(collectionId, appId, {
312
+ * const { items } = await app.records.match(collectionId, appId, {
260
313
  * target: { productId: 'prod_abc', facets: { tier: ['gold'] } },
261
314
  * strategy: 'best',
262
315
  * recordType: 'nutrition',
263
316
  * }, true);
264
- * // best.nutrition → the single highest-specificity nutrition record
317
+ * const best = items[0] // the single highest-specificity nutrition record
265
318
  * ```
266
319
  */
267
320
  function match(collectionId: string, appId: string, input: MatchRecordsInput, admin?: boolean): Promise<MatchResult>;
@@ -297,11 +350,22 @@ export declare namespace app {
297
350
  function bulkDelete(collectionId: string, appId: string, input: BulkDeleteInput): Promise<BulkDeleteResult>;
298
351
  /**
299
352
  * Resolve every applicable record for a product context in one call.
300
- * Returns records across all tiers (proof, batch, variant, product, rule, facet, collection)
301
- * deduplicated and sorted by specificity descending.
353
+ * Returns `{ items, nextCursor, count, context, truncated }`: `items` are the records across all
354
+ * tiers (proof, batch, variant, product, rule, facet, collection), deduplicated and sorted by
355
+ * specificity descending, each as `{ record, matchedAt, specificity }`. It is not paged
356
+ * (`nextCursor` is always `null`); `truncated` says the answer was cut at `limit`.
302
357
  * POST /records/resolve-all
303
358
  *
304
- * @param admin - false for public (visibility-filtered, active-only), true for admin (all statuses)
359
+ * @param admin - false for public (visibility-filtered, active-only), true for admin (all statuses)
360
+ *
361
+ * @example
362
+ * ```ts
363
+ * const { items, truncated } = await app.records.resolveAll(collectionId, appId, {
364
+ * context: { productId: 'prod_abc' },
365
+ * recordType: 'nutrition',
366
+ * })
367
+ * for (const { record, matchedAt } of items) console.log(matchedAt, record.data)
368
+ * ```
305
369
  */
306
370
  function resolveAll(collectionId: string, appId: string, input: ResolveAllParams, admin?: boolean): Promise<ResolveAllResult>;
307
371
  /**
@@ -13,6 +13,15 @@ export var app;
13
13
  * `source` = `type:<record type or declared type id>` | `list:<list id>`. Admins (`admin: true`)
14
14
  * see every entry; the public API lists public records and lists the app declares public. Hold on
15
15
  * to `version` and pass it back to get `{ unchanged: true }` when nothing changed.
16
+ *
17
+ * Returns `{ items, nextCursor, count?, version, mode }`: the entries are in `items`, already sorted.
18
+ * A picker is not paged, so `nextCursor` is always `null`.
19
+ *
20
+ * @example
21
+ * ```typescript
22
+ * const res = await app.options.get(collectionId, appId, 'type:machine', { admin: true })
23
+ * if (!res.unchanged) { options = res.items; version = res.version }
24
+ * ```
16
25
  */
17
26
  async function get(collectionId, appId, source, opts = {}) {
18
27
  const zone = opts.admin ? 'admin' : 'public';
@@ -56,6 +65,20 @@ export var app;
56
65
  /**
57
66
  * List cases with optional query parameters
58
67
  * GET /cases
68
+ *
69
+ * Returns `{ items, nextCursor, count }`: the cases are in `items`, `count` is how many match in
70
+ * all, and `nextCursor` is `null` on the last page. Page with `limit` and `cursor`.
71
+ * `includeDeleted`, `contactId` and `assignedTo` are for admin calls (`admin = true`) only: the
72
+ * public list refuses a parameter it does not read.
73
+ *
74
+ * @example
75
+ * ```typescript
76
+ * let page = await app.cases.list(collectionId, appId, { status: 'open', limit: 50 })
77
+ * console.log(page.items, page.count)
78
+ * while (page.nextCursor) {
79
+ * page = await app.cases.list(collectionId, appId, { status: 'open', limit: 50, cursor: page.nextCursor })
80
+ * }
81
+ * ```
59
82
  */
60
83
  async function list(collectionId, appId, params, admin = false) {
61
84
  const path = basePath(collectionId, appId, admin);
@@ -150,6 +173,20 @@ export var app;
150
173
  /**
151
174
  * List threads with optional query parameters
152
175
  * GET /threads
176
+ *
177
+ * Returns `{ items, nextCursor, count }`: the threads are in `items`, `count` is how many match in
178
+ * all, and `nextCursor` is `null` on the last page. Page with `limit` and `cursor`.
179
+ * `includeDeleted` and `contactId` are for admin calls (`admin = true`) only: the public list
180
+ * refuses a parameter it does not read.
181
+ *
182
+ * @example
183
+ * ```typescript
184
+ * let page = await app.threads.list(collectionId, appId, { parentType: 'case', parentId: caseId, limit: 50 })
185
+ * console.log(page.items, page.count)
186
+ * while (page.nextCursor) {
187
+ * page = await app.threads.list(collectionId, appId, { parentType: 'case', parentId: caseId, limit: 50, cursor: page.nextCursor })
188
+ * }
189
+ * ```
153
190
  */
154
191
  async function list(collectionId, appId, params, admin = false) {
155
192
  const path = basePath(collectionId, appId, admin);
@@ -275,9 +312,23 @@ export var app;
275
312
  /**
276
313
  * List records with optional query parameters
277
314
  * GET /records
278
- *
279
- * Public/owner callers only receive records with `status: "active"`.
280
- * Admin callers can query all statuses (for example `draft`/`archived`).
315
+ *
316
+ * Returns `{ items, nextCursor, count }`: the records are in `items`, `count` is how many match in
317
+ * all, and `nextCursor` is `null` on the last page. Page with `limit` and `cursor`.
318
+ *
319
+ * Public/owner callers only receive records with `status: "active"`.
320
+ * Admin callers can query all statuses (for example `draft`/`archived`).
321
+ * `qFields`, `dataFilter`, `contactId` and `includeDeleted` are for admin calls (`admin = true`)
322
+ * only: the public list refuses a parameter it does not read.
323
+ *
324
+ * @example
325
+ * ```typescript
326
+ * let page = await app.records.list(collectionId, appId, { recordType: 'tip', limit: 100 })
327
+ * console.log(page.items, page.count)
328
+ * while (page.nextCursor) {
329
+ * page = await app.records.list(collectionId, appId, { recordType: 'tip', limit: 100, cursor: page.nextCursor })
330
+ * }
331
+ * ```
281
332
  */
282
333
  async function list(collectionId, appId, params, admin = false) {
283
334
  const path = basePath(collectionId, appId, admin);
@@ -394,20 +445,21 @@ export var app;
394
445
  records_1.upsert = upsert;
395
446
  /**
396
447
  * Match records against a runtime target scope.
397
- * Returns records whose scope is satisfied by the target,
398
- * ordered by specificity descending (most specific first).
448
+ * Returns `{ items, nextCursor, count, strategy }`: `items` are the records whose scope is satisfied
449
+ * by the target, most specific first, and `count` is how many matched. It is not paged
450
+ * (`nextCursor` is always `null`); cap the answer with `limit`.
399
451
  * POST /records/match
400
452
  *
401
- * @param admin - false for public endpoint (visibility-filtered, active-only), true for admin
453
+ * @param admin - false for public endpoint (visibility-filtered, active-only), true for admin
402
454
  *
403
455
  * @example
404
456
  * ```ts
405
- * const { records, best } = await app.records.match(collectionId, appId, {
457
+ * const { items } = await app.records.match(collectionId, appId, {
406
458
  * target: { productId: 'prod_abc', facets: { tier: ['gold'] } },
407
459
  * strategy: 'best',
408
460
  * recordType: 'nutrition',
409
461
  * }, true);
410
- * // best.nutrition → the single highest-specificity nutrition record
462
+ * const best = items[0] // the single highest-specificity nutrition record
411
463
  * ```
412
464
  */
413
465
  async function match(collectionId, appId, input, admin = false) {
@@ -455,11 +507,22 @@ export var app;
455
507
  records_1.bulkDelete = bulkDelete;
456
508
  /**
457
509
  * Resolve every applicable record for a product context in one call.
458
- * Returns records across all tiers (proof, batch, variant, product, rule, facet, collection)
459
- * deduplicated and sorted by specificity descending.
510
+ * Returns `{ items, nextCursor, count, context, truncated }`: `items` are the records across all
511
+ * tiers (proof, batch, variant, product, rule, facet, collection), deduplicated and sorted by
512
+ * specificity descending, each as `{ record, matchedAt, specificity }`. It is not paged
513
+ * (`nextCursor` is always `null`); `truncated` says the answer was cut at `limit`.
460
514
  * POST /records/resolve-all
461
515
  *
462
- * @param admin - false for public (visibility-filtered, active-only), true for admin (all statuses)
516
+ * @param admin - false for public (visibility-filtered, active-only), true for admin (all statuses)
517
+ *
518
+ * @example
519
+ * ```ts
520
+ * const { items, truncated } = await app.records.resolveAll(collectionId, appId, {
521
+ * context: { productId: 'prod_abc' },
522
+ * recordType: 'nutrition',
523
+ * })
524
+ * for (const { record, matchedAt } of items) console.log(matchedAt, record.data)
525
+ * ```
463
526
  */
464
527
  async function resolveAll(collectionId, appId, input, admin = false) {
465
528
  const path = `${basePath(collectionId, appId, admin)}/resolve-all`;
@@ -1,4 +1,5 @@
1
- import { Asset, AssetResponse, UploadAssetOptions, UploadFromUrlOptions, ListAssetsOptions, GetAssetOptions, RemoveAssetOptions, AdminListAssetsOptions, AdminListAssetsResponse, UpdateAssetOptions, ReplaceAssetFileOptions, DeleteAssetOptions, BulkDeleteAssetsOptions, RequestUploadTokenOptions, UploadTokenResponse, PublicTokenUploadOptions, CreateResumableUploadOptions, ResumableUploadHandle } from "../types/asset.js";
1
+ import type { ListResult } from "../types/list.js";
2
+ import { Asset, AssetResponse, UploadAssetOptions, UploadFromUrlOptions, ListAssetsOptions, GetAssetOptions, RemoveAssetOptions, AdminListAssetsOptions, UpdateAssetOptions, ReplaceAssetFileOptions, DeleteAssetOptions, BulkDeleteAssetsOptions, RequestUploadTokenOptions, UploadTokenResponse, PublicTokenUploadOptions, CreateResumableUploadOptions, ResumableUploadHandle } from "../types/asset.js";
2
3
  export declare namespace asset {
3
4
  /**
4
5
  * Error type for asset uploads
@@ -43,28 +44,51 @@ export declare namespace asset {
43
44
  */
44
45
  function uploadFromUrl(options: UploadFromUrlOptions): Promise<Asset>;
45
46
  function getForCollection(collectionId: string, assetId: string): Promise<AssetResponse>;
46
- function listForCollection(collectionId: string): Promise<AssetResponse[]>;
47
+ /**
48
+ * The collection's own assets (public). Returns `{ items, nextCursor }`: the assets are in `items`.
49
+ * The list is not paged, so `nextCursor` is always `null`.
50
+ *
51
+ * @example
52
+ * ```typescript
53
+ * const { items } = await asset.listForCollection('my-collection')
54
+ * ```
55
+ */
56
+ function listForCollection(collectionId: string): Promise<ListResult<AssetResponse>>;
47
57
  function getForProduct(collectionId: string, productId: string, assetId: string): Promise<AssetResponse>;
48
- function listForProduct(collectionId: string, productId: string): Promise<AssetResponse[]>;
58
+ /**
59
+ * A product's assets (public). Returns `{ items, nextCursor }`: the assets are in `items`.
60
+ * The list is not paged, so `nextCursor` is always `null`.
61
+ *
62
+ * @example
63
+ * ```typescript
64
+ * const { items } = await asset.listForProduct('my-collection', 'wine-bottle')
65
+ * ```
66
+ */
67
+ function listForProduct(collectionId: string, productId: string): Promise<ListResult<AssetResponse>>;
49
68
  function getForProof(collectionId: string, productId: string, proofId: string, assetId: string): Promise<AssetResponse>;
50
- function listForProof(collectionId: string, productId: string, proofId: string, appId?: string): Promise<AssetResponse[]>;
51
69
  /**
52
- * Uploads an asset file to a proof, with optional extraData as JSON.
53
- * @deprecated Use `asset.upload(options)` instead.
54
- * Supports progress reporting via onProgress callback (browser only).
55
- * @param collectionId - The collection ID
56
- * @param productId - The product ID
57
- * @param proofId - The proof ID
58
- * @param file - The file to upload
59
- * @param extraData - Arbitrary extra data to include (will be stringified as JSON)
60
- * @param onProgress - Optional callback for upload progress (0-100)
61
- * @returns Promise resolving to an AssetResponse object
70
+ * A proof's assets (public), optionally only one app's. Returns `{ items, nextCursor }`: the assets
71
+ * are in `items`. The list is not paged, so `nextCursor` is always `null`.
72
+ *
73
+ * @example
74
+ * ```typescript
75
+ * const { items } = await asset.listForProof('my-collection', 'wine-bottle', proofId, 'gallery')
76
+ * ```
62
77
  */
63
- function uploadAsset(collectionId: string, productId: string, proofId: string, file: File, extraData?: Record<string, any>, onProgress?: (percent: number) => void): Promise<AssetResponse>;
78
+ function listForProof(collectionId: string, productId: string, proofId: string, appId?: string): Promise<ListResult<AssetResponse>>;
64
79
  /**
65
- * List assets for a given scope
80
+ * List assets for a given scope (a collection, a product or a proof). Returns `{ items, nextCursor }`:
81
+ * the assets are in `items`. These lists are not paged, so `nextCursor` is always `null`.
82
+ *
83
+ * @example
84
+ * ```typescript
85
+ * const { items } = await asset.list({
86
+ * scope: { type: 'product', collectionId: 'my-collection', productId: 'wine-bottle' },
87
+ * appId: 'gallery',
88
+ * })
89
+ * ```
66
90
  */
67
- function list(options: ListAssetsOptions): Promise<Asset[]>;
91
+ function list(options: ListAssetsOptions): Promise<ListResult<Asset>>;
68
92
  /**
69
93
  * Get an asset by id within a scope (public)
70
94
  */
@@ -74,9 +98,21 @@ export declare namespace asset {
74
98
  */
75
99
  function remove(options: RemoveAssetOptions): Promise<void>;
76
100
  /**
77
- * List assets for a collection with full filtering options.
101
+ * List assets for a collection with full filtering options (admin). Returns `{ items, nextCursor }`:
102
+ * the assets are in `items`, 50 at a time unless you give a `limit` (at most 200). Pass `nextCursor`
103
+ * back as `cursor` for the next page; `null` means that was the last one. `count` (how many match in
104
+ * all) is there when you gave a `limit` or a `cursor`.
105
+ *
106
+ * @example
107
+ * ```typescript
108
+ * let page = await asset.listAdmin({ collectionId: 'my-collection', assetType: 'Image', limit: 20 })
109
+ * console.log(`${page.count} images`)
110
+ * while (page.nextCursor) {
111
+ * page = await asset.listAdmin({ collectionId: 'my-collection', assetType: 'Image', limit: 20, cursor: page.nextCursor })
112
+ * }
113
+ * ```
78
114
  */
79
- function listAdmin(options: AdminListAssetsOptions): Promise<AdminListAssetsResponse>;
115
+ function listAdmin(options: AdminListAssetsOptions): Promise<ListResult<Asset>>;
80
116
  /**
81
117
  * Get a single asset by ID (admin).
82
118
  */
package/dist/api/asset.js CHANGED
@@ -208,6 +208,15 @@ export var asset;
208
208
  return request(path);
209
209
  }
210
210
  asset.getForCollection = getForCollection;
211
+ /**
212
+ * The collection's own assets (public). Returns `{ items, nextCursor }`: the assets are in `items`.
213
+ * The list is not paged, so `nextCursor` is always `null`.
214
+ *
215
+ * @example
216
+ * ```typescript
217
+ * const { items } = await asset.listForCollection('my-collection')
218
+ * ```
219
+ */
211
220
  async function listForCollection(collectionId) {
212
221
  const path = `/public/collection/${encodeURIComponent(collectionId)}/asset`;
213
222
  return request(path);
@@ -219,6 +228,15 @@ export var asset;
219
228
  return request(path);
220
229
  }
221
230
  asset.getForProduct = getForProduct;
231
+ /**
232
+ * A product's assets (public). Returns `{ items, nextCursor }`: the assets are in `items`.
233
+ * The list is not paged, so `nextCursor` is always `null`.
234
+ *
235
+ * @example
236
+ * ```typescript
237
+ * const { items } = await asset.listForProduct('my-collection', 'wine-bottle')
238
+ * ```
239
+ */
222
240
  async function listForProduct(collectionId, productId) {
223
241
  const path = `/public/collection/${encodeURIComponent(collectionId)}/product/${encodeURIComponent(productId)}/asset`;
224
242
  return request(path);
@@ -230,6 +248,15 @@ export var asset;
230
248
  return request(path);
231
249
  }
232
250
  asset.getForProof = getForProof;
251
+ /**
252
+ * A proof's assets (public), optionally only one app's. Returns `{ items, nextCursor }`: the assets
253
+ * are in `items`. The list is not paged, so `nextCursor` is always `null`.
254
+ *
255
+ * @example
256
+ * ```typescript
257
+ * const { items } = await asset.listForProof('my-collection', 'wine-bottle', proofId, 'gallery')
258
+ * ```
259
+ */
233
260
  async function listForProof(collectionId, productId, proofId, appId) {
234
261
  let path = `/public/collection/${encodeURIComponent(collectionId)}/product/${encodeURIComponent(productId)}/proof/${encodeURIComponent(proofId)}/asset`;
235
262
  if (appId) {
@@ -239,43 +266,24 @@ export var asset;
239
266
  }
240
267
  asset.listForProof = listForProof;
241
268
  /**
242
- * Uploads an asset file to a proof, with optional extraData as JSON.
243
- * @deprecated Use `asset.upload(options)` instead.
244
- * Supports progress reporting via onProgress callback (browser only).
245
- * @param collectionId - The collection ID
246
- * @param productId - The product ID
247
- * @param proofId - The proof ID
248
- * @param file - The file to upload
249
- * @param extraData - Arbitrary extra data to include (will be stringified as JSON)
250
- * @param onProgress - Optional callback for upload progress (0-100)
251
- * @returns Promise resolving to an AssetResponse object
252
- */
253
- async function uploadAsset(collectionId, productId, proofId, file, extraData, onProgress) {
254
- // Route through new upload API for backward compatibility
255
- const res = await upload({
256
- file,
257
- name: file === null || file === void 0 ? void 0 : file.name,
258
- metadata: extraData,
259
- onProgress,
260
- scope: { type: 'proof', collectionId, productId, proofId },
261
- });
262
- return res;
263
- }
264
- asset.uploadAsset = uploadAsset;
265
- /**
266
- * List assets for a given scope
269
+ * List assets for a given scope (a collection, a product or a proof). Returns `{ items, nextCursor }`:
270
+ * the assets are in `items`. These lists are not paged, so `nextCursor` is always `null`.
271
+ *
272
+ * @example
273
+ * ```typescript
274
+ * const { items } = await asset.list({
275
+ * scope: { type: 'product', collectionId: 'my-collection', productId: 'wine-bottle' },
276
+ * appId: 'gallery',
277
+ * })
278
+ * ```
267
279
  */
268
280
  async function list(options) {
269
281
  const base = buildScopeBase(options.scope);
270
282
  const params = new URLSearchParams();
271
283
  if (options.appId)
272
284
  params.set('appId', options.appId);
273
- if (options.mimeTypePrefix)
274
- params.set('mimeTypePrefix', options.mimeTypePrefix);
275
285
  if (typeof options.limit === 'number')
276
286
  params.set('limit', String(options.limit));
277
- if (typeof options.offset === 'number')
278
- params.set('offset', String(options.offset));
279
287
  const path = `${base}/asset${params.toString() ? `?${params}` : ''}`;
280
288
  return request(path);
281
289
  }
@@ -312,7 +320,19 @@ export var asset;
312
320
  // Base: /api/admin/collection/:collectionId/assets
313
321
  // ---------------------------------------------------------------------------
314
322
  /**
315
- * List assets for a collection with full filtering options.
323
+ * List assets for a collection with full filtering options (admin). Returns `{ items, nextCursor }`:
324
+ * the assets are in `items`, 50 at a time unless you give a `limit` (at most 200). Pass `nextCursor`
325
+ * back as `cursor` for the next page; `null` means that was the last one. `count` (how many match in
326
+ * all) is there when you gave a `limit` or a `cursor`.
327
+ *
328
+ * @example
329
+ * ```typescript
330
+ * let page = await asset.listAdmin({ collectionId: 'my-collection', assetType: 'Image', limit: 20 })
331
+ * console.log(`${page.count} images`)
332
+ * while (page.nextCursor) {
333
+ * page = await asset.listAdmin({ collectionId: 'my-collection', assetType: 'Image', limit: 20, cursor: page.nextCursor })
334
+ * }
335
+ * ```
316
336
  */
317
337
  async function listAdmin(options) {
318
338
  const params = new URLSearchParams();
@@ -332,8 +352,8 @@ export var asset;
332
352
  params.set('order', options.order);
333
353
  if (typeof options.limit === 'number')
334
354
  params.set('limit', String(options.limit));
335
- if (typeof options.offset === 'number')
336
- params.set('offset', String(options.offset));
355
+ if (options.cursor)
356
+ params.set('cursor', options.cursor);
337
357
  if (options.include && options.include.length)
338
358
  params.set('include', options.include.join(','));
339
359
  const qs = params.toString();
@@ -1,4 +1,5 @@
1
1
  import type { AttestationResponse, AttestationCreateRequest, AttestationUpdateRequest } from "../types/attestation.js";
2
+ import type { ListResult } from "../types/list.js";
2
3
  /**
3
4
  * @deprecated Legacy Firestore-backed attestation API.
4
5
  *
@@ -16,10 +17,10 @@ import type { AttestationResponse, AttestationCreateRequest, AttestationUpdateRe
16
17
  */
17
18
  export declare namespace attestation {
18
19
  /**
19
- * List all attestations for a proof.
20
+ * List all attestations for a proof, in one list (no pages): `{ items, nextCursor: null }`.
20
21
  * @deprecated Use `attestations.list()` with `subjectType='proof'` instead.
21
22
  */
22
- function list(collectionId: string, productId: string, proofId: string): Promise<AttestationResponse[]>;
23
+ function list(collectionId: string, productId: string, proofId: string): Promise<ListResult<AttestationResponse>>;
23
24
  /**
24
25
  * Get a single attestation by ID.
25
26
  * @deprecated Use `attestations.list()` with `subjectType='proof'` and filter by ID instead.
@@ -17,7 +17,7 @@ import { request, post, put, del } from "../http.js";
17
17
  export var attestation;
18
18
  (function (attestation) {
19
19
  /**
20
- * List all attestations for a proof.
20
+ * List all attestations for a proof, in one list (no pages): `{ items, nextCursor: null }`.
21
21
  * @deprecated Use `attestations.list()` with `subjectType='proof'` instead.
22
22
  */
23
23
  async function list(collectionId, productId, proofId) {
@@ -70,18 +70,22 @@ export declare namespace attestations {
70
70
  * Returns all three data zones. Supports filtering by type and date range.
71
71
  *
72
72
  * @param collectionId - Collection context
73
- * @param params - Query parameters; `subjectType` and `subjectId` are required
74
- * @returns `{ attestations: Attestation[] }`
73
+ * @param params - Query parameters; `subjectType` and `subjectId` are required. Page with
74
+ * `limit` and `cursor`
75
+ * @returns `{ items: Attestation[], nextCursor }` — `nextCursor` is `null` on the last page
75
76
  *
76
77
  * @example
77
78
  * ```typescript
78
- * const { attestations: records } = await attestations.list('coll_123', {
79
+ * let page = await attestations.list('coll_123', {
79
80
  * subjectType: 'container',
80
81
  * subjectId: 'uuid-of-cask',
81
82
  * attestationType: 'temperature',
82
83
  * recordedAfter: '2025-01-01T00:00:00Z',
83
84
  * limit: 50,
84
85
  * })
86
+ * const records = page.items
87
+ * // next page: pass the cursor back with the same filters
88
+ * if (page.nextCursor) page = await attestations.list('coll_123', { ...filters, limit: 50, cursor: page.nextCursor })
85
89
  * ```
86
90
  */
87
91
  function list(collectionId: string, params: ListAttestationsParams): Promise<ListAttestationsResponse>;
@@ -200,12 +204,14 @@ export declare namespace attestations {
200
204
  * The `audience` field in the response indicates the tier that was served.
201
205
  *
202
206
  * @param collectionId - Collection context
203
- * @param params - Query parameters; `subjectType` and `subjectId` are required
204
- * @returns `{ attestations: Attestation[], audience: AttestationAudience }`
207
+ * @param params - Query parameters; `subjectType` and `subjectId` are required. Page with
208
+ * `limit` and `cursor`
209
+ * @returns `{ items: Attestation[], nextCursor, audience: AttestationAudience }` — `nextCursor` is
210
+ * `null` on the last page
205
211
  *
206
212
  * @example
207
213
  * ```typescript
208
- * const { attestations: records, audience } = await attestations.publicList('coll_123', {
214
+ * const { items: records, nextCursor, audience } = await attestations.publicList('coll_123', {
209
215
  * subjectType: 'proof',
210
216
  * subjectId: 'proof-uuid',
211
217
  * })
@@ -304,7 +310,16 @@ export declare namespace attestations {
304
310
  *
305
311
  * @param collectionId - Collection context
306
312
  * @param containerId - Container UUID
307
- * @param params - Optional filters (attestationType, date range, pagination)
313
+ * @param params - Optional filters (attestationType, date range) and paging (`limit`, `cursor`)
314
+ * @returns `{ items: Attestation[], nextCursor, audience }` — `nextCursor` is `null` on the last page
315
+ *
316
+ * @example
317
+ * ```typescript
318
+ * const { items: records, nextCursor } = await attestations.publicContainerList('coll_123', containerId, {
319
+ * attestationType: 'temperature',
320
+ * limit: 50,
321
+ * })
322
+ * ```
308
323
  */
309
324
  function publicContainerList(collectionId: string, containerId: string, params?: Omit<ListAttestationsParams, 'subjectType' | 'subjectId'>): Promise<PublicListAttestationsResponse>;
310
325
  /**