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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (272) hide show
  1. package/README.md +741 -741
  2. package/dist/README.md +573 -573
  3. package/dist/adminCardsView.js +55 -55
  4. package/dist/api/analytics.d.ts +5 -4
  5. package/dist/api/analytics.js +5 -4
  6. package/dist/api/appConfiguration.d.ts +23 -18
  7. package/dist/api/appConfiguration.js +24 -18
  8. package/dist/api/appObjects.d.ts +54 -10
  9. package/dist/api/appObjects.js +75 -40
  10. package/dist/api/asset.d.ts +28 -22
  11. package/dist/api/asset.js +45 -56
  12. package/dist/api/attestation.d.ts +11 -3
  13. package/dist/api/attestation.js +12 -3
  14. package/dist/api/attestations.d.ts +12 -8
  15. package/dist/api/attestations.js +18 -21
  16. package/dist/api/authKit.d.ts +15 -10
  17. package/dist/api/authKit.js +17 -11
  18. package/dist/api/batch.d.ts +36 -25
  19. package/dist/api/batch.js +46 -39
  20. package/dist/api/bookings.d.ts +67 -11
  21. package/dist/api/bookings.js +82 -15
  22. package/dist/api/broadcasts.js +3 -17
  23. package/dist/api/claimSet.d.ts +26 -12
  24. package/dist/api/claimSet.js +32 -24
  25. package/dist/api/collection.d.ts +15 -10
  26. package/dist/api/collection.js +17 -11
  27. package/dist/api/comms.d.ts +12 -6
  28. package/dist/api/comms.js +12 -6
  29. package/dist/api/conditions.d.ts +7 -6
  30. package/dist/api/conditions.js +8 -6
  31. package/dist/api/contact.d.ts +6 -2
  32. package/dist/api/contact.js +25 -60
  33. package/dist/api/containers.d.ts +14 -10
  34. package/dist/api/containers.js +19 -14
  35. package/dist/api/crate.js +7 -9
  36. package/dist/api/dpp.d.ts +20 -13
  37. package/dist/api/dpp.js +23 -15
  38. package/dist/api/facets.d.ts +38 -13
  39. package/dist/api/facets.js +40 -15
  40. package/dist/api/files.d.ts +5 -2
  41. package/dist/api/files.js +7 -4
  42. package/dist/api/form.d.ts +8 -5
  43. package/dist/api/form.js +9 -5
  44. package/dist/api/index.d.ts +1 -1
  45. package/dist/api/index.js +1 -1
  46. package/dist/api/integrations.d.ts +29 -17
  47. package/dist/api/integrations.js +32 -25
  48. package/dist/api/interactions.d.ts +11 -6
  49. package/dist/api/interactions.js +14 -23
  50. package/dist/api/jobs.d.ts +16 -6
  51. package/dist/api/jobs.js +30 -20
  52. package/dist/api/journeys.js +2 -14
  53. package/dist/api/journeysAnalytics.d.ts +8 -5
  54. package/dist/api/journeysAnalytics.js +8 -5
  55. package/dist/api/knowledge.d.ts +20 -14
  56. package/dist/api/knowledge.js +22 -15
  57. package/dist/api/location.d.ts +6 -3
  58. package/dist/api/location.js +8 -22
  59. package/dist/api/lots.d.ts +9 -5
  60. package/dist/api/lots.js +22 -26
  61. package/dist/api/loyalty.d.ts +25 -16
  62. package/dist/api/loyalty.js +33 -32
  63. package/dist/api/nfc.d.ts +3 -1
  64. package/dist/api/nfc.js +3 -1
  65. package/dist/api/order.d.ts +45 -39
  66. package/dist/api/order.js +48 -65
  67. package/dist/api/partner.d.ts +17 -14
  68. package/dist/api/partner.js +21 -22
  69. package/dist/api/payments.d.ts +60 -0
  70. package/dist/api/payments.js +94 -0
  71. package/dist/api/products.d.ts +35 -12
  72. package/dist/api/products.js +36 -13
  73. package/dist/api/proof.d.ts +41 -19
  74. package/dist/api/proof.js +44 -23
  75. package/dist/api/realtime.d.ts +3 -0
  76. package/dist/api/realtime.js +10 -2
  77. package/dist/api/segments.js +3 -15
  78. package/dist/api/serviceAccounts.d.ts +8 -5
  79. package/dist/api/serviceAccounts.js +9 -6
  80. package/dist/api/shop.d.ts +7 -5
  81. package/dist/api/shop.js +13 -19
  82. package/dist/api/subscriptions.d.ts +12 -10
  83. package/dist/api/subscriptions.js +17 -25
  84. package/dist/api/tags.d.ts +23 -20
  85. package/dist/api/tags.js +40 -52
  86. package/dist/api/template.d.ts +16 -11
  87. package/dist/api/template.js +19 -13
  88. package/dist/api/translations.js +2 -12
  89. package/dist/api/userGroups.d.ts +26 -16
  90. package/dist/api/userGroups.js +43 -30
  91. package/dist/api/variant.d.ts +10 -7
  92. package/dist/api/variant.js +11 -7
  93. package/dist/api/wallet.d.ts +14 -11
  94. package/dist/api/wallet.js +15 -12
  95. package/dist/baseline.css +194 -194
  96. package/dist/dataChanged.d.ts +74 -0
  97. package/dist/dataChanged.js +162 -0
  98. package/dist/docs/API_SUMMARY.md +1443 -1409
  99. package/dist/docs/admin-cards.md +189 -189
  100. package/dist/docs/agent-tools.md +156 -156
  101. package/dist/docs/ai-tools-and-skills.md +180 -180
  102. package/dist/docs/ai.md +1721 -1721
  103. package/dist/docs/analytics.md +1 -1
  104. package/dist/docs/api-versions.md +85 -85
  105. package/dist/docs/app-data-storage.md +277 -277
  106. package/dist/docs/app-docs.md +73 -73
  107. package/dist/docs/app-manifest.md +852 -852
  108. package/dist/docs/app-objects.md +4 -4
  109. package/dist/docs/app-records-pattern.md +388 -388
  110. package/dist/docs/appConfig.md +550 -550
  111. package/dist/docs/assistant-apps.md +172 -172
  112. package/dist/docs/assistant-context.md +119 -119
  113. package/dist/docs/attestations.md +8 -8
  114. package/dist/docs/bookings.md +105 -8
  115. package/dist/docs/caching.md +32 -3
  116. package/dist/docs/comms.md +689 -689
  117. package/dist/docs/connectors.md +340 -340
  118. package/dist/docs/contact-search.md +2 -3
  119. package/dist/docs/css-baseline.md +133 -133
  120. package/dist/docs/customer-guide.md +70 -70
  121. package/dist/docs/data-changed.md +91 -0
  122. package/dist/docs/deploying-apps.md +340 -340
  123. package/dist/docs/dpp.md +115 -115
  124. package/dist/docs/entitlements.md +90 -90
  125. package/dist/docs/files.md +69 -69
  126. package/dist/docs/host-dependency-contract.md +252 -252
  127. package/dist/docs/iframe-responder.md +11 -0
  128. package/dist/docs/integrations.md +322 -322
  129. package/dist/docs/interactions.md +544 -544
  130. package/dist/docs/item-context.md +181 -181
  131. package/dist/docs/knowledge.md +105 -105
  132. package/dist/docs/lists.md +157 -114
  133. package/dist/docs/lots.md +112 -112
  134. package/dist/docs/loyalty.md +348 -348
  135. package/dist/docs/members.md +183 -183
  136. package/dist/docs/memberships.md +150 -150
  137. package/dist/docs/mobile-admin-container.md +693 -693
  138. package/dist/docs/operations.md +281 -281
  139. package/dist/docs/overview.md +487 -485
  140. package/dist/docs/payments.md +94 -0
  141. package/dist/docs/proof-comms-triggers.md +142 -142
  142. package/dist/docs/proof-ownership-transfer.md +155 -155
  143. package/dist/docs/proof-product-data-scoping.md +462 -462
  144. package/dist/docs/proof-share-grants.md +305 -305
  145. package/dist/docs/realtime.md +149 -139
  146. package/dist/docs/records-admin-pattern.md +304 -304
  147. package/dist/docs/service-accounts.md +64 -64
  148. package/dist/docs/standard-query.md +196 -187
  149. package/dist/docs/tag-codes.md +97 -97
  150. package/dist/docs/tag-ranges.md +106 -106
  151. package/dist/docs/theme-tokens.md +252 -252
  152. package/dist/docs/upgrading-to-3.md +550 -430
  153. package/dist/docs/wallet-passes.md +107 -107
  154. package/dist/docs/websites.md +123 -123
  155. package/dist/http.d.ts +6 -3
  156. package/dist/http.js +48 -19
  157. package/dist/iframeResponder.d.ts +7 -0
  158. package/dist/iframeResponder.js +10 -0
  159. package/dist/index.d.ts +2 -0
  160. package/dist/index.js +2 -0
  161. package/dist/list.d.ts +12 -0
  162. package/dist/list.js +59 -0
  163. package/dist/openapi.yaml +722 -660
  164. package/dist/testing/bookingsMemory.d.ts +29 -1
  165. package/dist/testing/bookingsMemory.js +89 -1
  166. package/dist/testing/index.js +4 -1
  167. package/dist/theme-boot.js +82 -82
  168. package/dist/theme.css +75 -75
  169. package/dist/types/analytics.d.ts +7 -3
  170. package/dist/types/appManifest.d.ts +26 -4
  171. package/dist/types/appObjects.d.ts +27 -12
  172. package/dist/types/appOptions.d.ts +2 -2
  173. package/dist/types/asset.d.ts +5 -6
  174. package/dist/types/attestations.d.ts +7 -9
  175. package/dist/types/batch.d.ts +5 -5
  176. package/dist/types/bookings.d.ts +109 -6
  177. package/dist/types/comms.d.ts +9 -5
  178. package/dist/types/contact.d.ts +7 -4
  179. package/dist/types/containers.d.ts +2 -1
  180. package/dist/types/facets.d.ts +14 -2
  181. package/dist/types/files.d.ts +3 -2
  182. package/dist/types/index.d.ts +1 -0
  183. package/dist/types/index.js +1 -0
  184. package/dist/types/integrations.d.ts +2 -1
  185. package/dist/types/interaction.d.ts +15 -7
  186. package/dist/types/jobs.d.ts +1 -1
  187. package/dist/types/journeysAnalytics.d.ts +3 -2
  188. package/dist/types/knowledge.d.ts +6 -3
  189. package/dist/types/knowledge.js +0 -1
  190. package/dist/types/list.d.ts +30 -2
  191. package/dist/types/location.d.ts +7 -2
  192. package/dist/types/location.js +0 -1
  193. package/dist/types/lots.d.ts +5 -2
  194. package/dist/types/lots.js +0 -6
  195. package/dist/types/order.d.ts +22 -20
  196. package/dist/types/payments.d.ts +101 -0
  197. package/dist/types/payments.js +5 -0
  198. package/dist/types/product.d.ts +28 -11
  199. package/dist/types/proof.d.ts +7 -8
  200. package/dist/types/realtime.d.ts +5 -1
  201. package/dist/types/tags.d.ts +5 -3
  202. package/dist/types/userGroups.d.ts +3 -3
  203. package/dist/types/userGroups.js +0 -4
  204. package/dist/version.d.ts +1 -1
  205. package/dist/version.js +1 -1
  206. package/docs/API_SUMMARY.md +1443 -1409
  207. package/docs/admin-cards.md +189 -189
  208. package/docs/agent-tools.md +156 -156
  209. package/docs/ai-tools-and-skills.md +180 -180
  210. package/docs/ai.md +1721 -1721
  211. package/docs/analytics.md +1 -1
  212. package/docs/api-versions.md +85 -85
  213. package/docs/app-data-storage.md +277 -277
  214. package/docs/app-docs.md +73 -73
  215. package/docs/app-manifest.md +852 -852
  216. package/docs/app-objects.md +4 -4
  217. package/docs/app-records-pattern.md +388 -388
  218. package/docs/appConfig.md +550 -550
  219. package/docs/assistant-apps.md +172 -172
  220. package/docs/assistant-context.md +119 -119
  221. package/docs/attestations.md +8 -8
  222. package/docs/bookings.md +105 -8
  223. package/docs/caching.md +32 -3
  224. package/docs/comms.md +689 -689
  225. package/docs/connectors.md +340 -340
  226. package/docs/contact-search.md +2 -3
  227. package/docs/css-baseline.md +133 -133
  228. package/docs/customer-guide.md +70 -70
  229. package/docs/data-changed.md +91 -0
  230. package/docs/deploying-apps.md +340 -340
  231. package/docs/dpp.md +115 -115
  232. package/docs/entitlements.md +90 -90
  233. package/docs/files.md +69 -69
  234. package/docs/host-dependency-contract.md +252 -252
  235. package/docs/iframe-responder.md +11 -0
  236. package/docs/integrations.md +322 -322
  237. package/docs/interactions.md +544 -544
  238. package/docs/item-context.md +181 -181
  239. package/docs/knowledge.md +105 -105
  240. package/docs/lists.md +157 -114
  241. package/docs/lots.md +112 -112
  242. package/docs/loyalty.md +348 -348
  243. package/docs/members.md +183 -183
  244. package/docs/memberships.md +150 -150
  245. package/docs/mobile-admin-container.md +693 -693
  246. package/docs/operations.md +281 -281
  247. package/docs/overview.md +487 -485
  248. package/docs/payments.md +94 -0
  249. package/docs/proof-comms-triggers.md +142 -142
  250. package/docs/proof-ownership-transfer.md +155 -155
  251. package/docs/proof-product-data-scoping.md +462 -462
  252. package/docs/proof-share-grants.md +305 -305
  253. package/docs/realtime.md +149 -139
  254. package/docs/service-accounts.md +64 -64
  255. package/docs/standard-query.md +196 -187
  256. package/docs/tag-codes.md +97 -97
  257. package/docs/tag-ranges.md +106 -106
  258. package/docs/theme-lookbook.v1.json +120 -120
  259. package/docs/theme-tokens.md +252 -252
  260. package/docs/upgrading-to-3.md +550 -430
  261. package/docs/wallet-passes.md +107 -107
  262. package/docs/websites.md +123 -123
  263. package/openapi.yaml +722 -660
  264. package/package.json +91 -91
  265. package/scripts/headless-check.mjs +87 -87
  266. package/scripts/lib/bare-imports.mjs +57 -57
  267. package/scripts/lib/keyed-app-data.mjs +21 -21
  268. package/scripts/lib/upgrade.mjs +708 -512
  269. package/scripts/publish.mjs +272 -272
  270. package/scripts/register-release.mjs +91 -91
  271. package/scripts/upgrade.mjs +79 -56
  272. package/upgrade/3.json +2731 -2213
package/dist/api/dpp.js CHANGED
@@ -21,6 +21,7 @@
21
21
  //
22
22
  // Endpoints: /admin/collection/:collectionId/dpp/… and /public/dpp/:collectionId/:passportId
23
23
  import { request, post, put } from "../http.js";
24
+ import { listQuery } from "../list.js";
24
25
  function enc(v) { return encodeURIComponent(v); }
25
26
  const base = (collectionId) => `/admin/collection/${enc(collectionId)}/dpp`;
26
27
  function query(q) {
@@ -35,7 +36,8 @@ export var dpp;
35
36
  (function (dpp) {
36
37
  /**
37
38
  * What passports can be made: product groups, their kinds, and each view's fields and required fields.
38
- * All of them in one answer (`nextCursor` is always null). GET /dpp/groups
39
+ * A fixed set: always all of them in one answer (`nextCursor` is always null), so it takes no `limit`
40
+ * or `cursor`. GET /dpp/groups
39
41
  *
40
42
  * @example
41
43
  * ```typescript
@@ -69,8 +71,8 @@ export var dpp;
69
71
  let registry;
70
72
  (function (registry) {
71
73
  /**
72
- * Both environments, each with `nextStep` (what's left to connect). All of them in one answer
73
- * (`nextCursor` is always null). GET /dpp/registry
74
+ * Both environments, each with `nextStep` (what's left to connect). A fixed set: always all of them
75
+ * in one answer (`nextCursor` is always null), so it takes no `limit` or `cursor`. GET /dpp/registry
74
76
  *
75
77
  * @example
76
78
  * ```typescript
@@ -136,7 +138,7 @@ export var dpp;
136
138
  * ```
137
139
  */
138
140
  async function list(collectionId, q = {}) {
139
- return request(`${base(collectionId)}/passports${query(q)}`);
141
+ return request(`${base(collectionId)}/passports${listQuery(q)}`);
140
142
  }
141
143
  passports.list = list;
142
144
  /** One passport, with `check` (what it's still missing) and its `url`. GET /dpp/passports/:id */
@@ -184,17 +186,20 @@ export var dpp;
184
186
  }
185
187
  passports.upsertMany = upsertMany;
186
188
  /**
187
- * Its versions, newest first, all in one answer (`nextCursor` is always null); read one with
188
- * `dpp.read(collectionId, id, { version })`. GET /dpp/passports/:id/versions
189
+ * Its versions, newest first, a page at a time (`limit` and `cursor`; 50 unless you say otherwise).
190
+ * Read one with `dpp.read(collectionId, id, { version })`. GET /dpp/passports/:id/versions
189
191
  *
190
192
  * @example
191
193
  * ```typescript
192
- * const { items } = await dpp.passports.versions(collectionId, passportId)
193
- * const latest = items[0].version
194
+ * let page = await dpp.passports.versions(collectionId, passportId, { limit: 20 })
195
+ * const latest = page.items[0].version
196
+ * while (page.nextCursor) {
197
+ * page = await dpp.passports.versions(collectionId, passportId, { limit: 20, cursor: page.nextCursor })
198
+ * }
194
199
  * ```
195
200
  */
196
- async function versions(collectionId, passportId) {
197
- return request(`${base(collectionId)}/passports/${enc(passportId)}/versions`);
201
+ async function versions(collectionId, passportId, options = {}) {
202
+ return request(`${base(collectionId)}/passports/${enc(passportId)}/versions${listQuery(options)}`);
198
203
  }
199
204
  passports.versions = versions;
200
205
  /** No longer valid: stays at its address, marked invalid (the registry keeps its record). POST /dpp/passports/:id/withdraw */
@@ -214,16 +219,19 @@ export var dpp;
214
219
  let tasks;
215
220
  (function (tasks) {
216
221
  /**
217
- * Requests sent to one environment, newest first, all in one answer (`nextCursor` is always null).
218
- * GET /dpp/registry/:env/tasks
222
+ * Requests sent to one environment, newest first, a page at a time (`limit` and `cursor`; 50 unless
223
+ * you say otherwise). GET /dpp/registry/:env/tasks
219
224
  *
220
225
  * @example
221
226
  * ```typescript
222
- * const { items } = await dpp.tasks.list(collectionId, 'acc')
227
+ * let page = await dpp.tasks.list(collectionId, 'acc', { limit: 20 })
228
+ * while (page.nextCursor) {
229
+ * page = await dpp.tasks.list(collectionId, 'acc', { limit: 20, cursor: page.nextCursor })
230
+ * }
223
231
  * ```
224
232
  */
225
- async function list(collectionId, env) {
226
- return request(`${base(collectionId)}/registry/${enc(env)}/tasks`);
233
+ async function list(collectionId, env, options = {}) {
234
+ return request(`${base(collectionId)}/registry/${enc(env)}/tasks${listQuery(options)}`);
227
235
  }
228
236
  tasks.list = list;
229
237
  /** Ask the registry how a request went and record it on its passports. POST /dpp/registry/:env/tasks/:taskId/refresh */
@@ -1,4 +1,5 @@
1
1
  import type { FacetDefinition, FacetDefinitionWriteInput, FacetGetParams, FacetListParams, FacetListResponse, FacetNamespaceListResponse, FacetQueryRequest, FacetQueryResponse, FacetValueGetParams, FacetValueListParams, FacetValueListResponse, FacetValueResponse, FacetValueWriteInput, PublicFacetListParams } from "../types/facets.js";
2
+ import type { ListOptions } from "../types/list.js";
2
3
  /**
3
4
  * Facet management and aggregation endpoints.
4
5
  *
@@ -8,7 +9,8 @@ import type { FacetDefinition, FacetDefinitionWriteInput, FacetGetParams, FacetL
8
9
  */
9
10
  export declare namespace facets {
10
11
  /**
11
- * The collection's facets (admin). All of them come back in one answer: `nextCursor` is always null.
12
+ * The collection's facets (admin). A small fixed set: all of them come back in one answer, so there is
13
+ * no `limit` or `cursor` and `nextCursor` is always null.
12
14
  *
13
15
  * @example
14
16
  * ```typescript
@@ -22,12 +24,19 @@ export declare namespace facets {
22
24
  function update(collectionId: string, facetKey: string, data: FacetDefinitionWriteInput): Promise<FacetDefinition>;
23
25
  function remove(collectionId: string, facetKey: string): Promise<void>;
24
26
  /**
25
- * One facet and all its values (admin). The values are in `items`; `nextCursor` is always null.
27
+ * One facet and its values (admin), a page at a time. The values are in `items`; pass `nextCursor` back
28
+ * as `cursor` for the next page (null means that was the last one).
29
+ *
30
+ * @param params - `includeDeleted`, plus `limit` (default 50) and `cursor`
26
31
  *
27
32
  * @example
28
33
  * ```typescript
29
- * const { facet, items } = await facets.listValues('coll_123', 'brand')
30
- * items.map(v => v.name)
34
+ * let page = await facets.listValues('coll_123', 'brand', { limit: 50 })
35
+ * const names = page.items.map(v => v.name)
36
+ * while (page.nextCursor) {
37
+ * page = await facets.listValues('coll_123', 'brand', { limit: 50, cursor: page.nextCursor })
38
+ * names.push(...page.items.map(v => v.name))
39
+ * }
31
40
  * ```
32
41
  */
33
42
  function listValues(collectionId: string, facetKey: string, params?: FacetValueListParams): Promise<FacetValueListResponse>;
@@ -37,19 +46,26 @@ export declare namespace facets {
37
46
  function removeValue(collectionId: string, facetKey: string, valueKey: string): Promise<void>;
38
47
  /**
39
48
  * Facet counts for a set of products (admin): each facet with its values in `items`, and the
40
- * count for each value in `buckets`. Everything comes back in one answer: `nextCursor` is always null.
49
+ * count for each value in `buckets`. Everything comes back in one answer, so there is no `limit` or
50
+ * `cursor` and `nextCursor` is always null.
51
+ *
52
+ * Which products are counted: `q` (search text), `createdAt` / `updatedAt` (date ranges) and the
53
+ * filters in `query`, the same as `products.query`.
41
54
  *
42
55
  * @example
43
56
  * ```typescript
44
57
  * const { items, buckets, meta } = await facets.query('coll_123', {
45
58
  * facetKeys: ['brand', 'material'],
59
+ * q: 'oak',
60
+ * createdAt: { gte: '2026-11-01T00:00:00Z' },
46
61
  * query: { facetEquals: { brand: 'acme' } },
47
62
  * })
48
63
  * ```
49
64
  */
50
65
  function query(collectionId: string, body: FacetQueryRequest): Promise<FacetQueryResponse>;
51
66
  /**
52
- * The facet namespaces in use (admin). The names are in `items`; `nextCursor` is always null.
67
+ * The facet namespaces in use (admin). A small fixed set: all the names are in `items`, there is no
68
+ * `limit` or `cursor`, and `nextCursor` is always null.
53
69
  *
54
70
  * @example
55
71
  * ```typescript
@@ -58,7 +74,8 @@ export declare namespace facets {
58
74
  */
59
75
  function namespaces(collectionId: string): Promise<FacetNamespaceListResponse>;
60
76
  /**
61
- * The collection's facets (public). All of them come back in one answer: `nextCursor` is always null.
77
+ * The collection's facets (public). A small fixed set: all of them come back in one answer, so there is
78
+ * no `limit` or `cursor` and `nextCursor` is always null.
62
79
  *
63
80
  * @example
64
81
  * ```typescript
@@ -68,27 +85,35 @@ export declare namespace facets {
68
85
  function publicList(collectionId: string, params?: PublicFacetListParams): Promise<FacetListResponse>;
69
86
  function publicGet(collectionId: string, facetKey: string, params?: PublicFacetListParams): Promise<FacetDefinition>;
70
87
  /**
71
- * One facet and all its values (public). The values are in `items`; `nextCursor` is always null.
88
+ * One facet and its values (public), a page at a time. The values are in `items`; pass `nextCursor`
89
+ * back as `cursor` for the next page (null means that was the last one).
90
+ *
91
+ * @param options - `limit` (default 50) and `cursor`
72
92
  *
73
93
  * @example
74
94
  * ```typescript
75
- * const { facet, items } = await facets.publicListValues('coll_123', 'brand')
95
+ * const { facet, items, nextCursor } = await facets.publicListValues('coll_123', 'brand', { limit: 50 })
76
96
  * ```
77
97
  */
78
- function publicListValues(collectionId: string, facetKey: string): Promise<FacetValueListResponse>;
98
+ function publicListValues(collectionId: string, facetKey: string, options?: ListOptions): Promise<FacetValueListResponse>;
79
99
  function publicGetValue(collectionId: string, facetKey: string, valueKey: string): Promise<FacetValueResponse>;
80
100
  /**
81
101
  * Facet counts for a set of products (public): each facet with its values in `items`, and the
82
- * count for each value in `buckets`. Everything comes back in one answer: `nextCursor` is always null.
102
+ * count for each value in `buckets`. Everything comes back in one answer, so there is no `limit` or
103
+ * `cursor` and `nextCursor` is always null.
104
+ *
105
+ * Which products are counted: `q` (search text), `createdAt` / `updatedAt` (date ranges) and the
106
+ * filters in `query`, the same as `products.query`.
83
107
  *
84
108
  * @example
85
109
  * ```typescript
86
- * const { items, buckets } = await facets.publicQuery('coll_123', { facetKeys: ['brand'] })
110
+ * const { items, buckets } = await facets.publicQuery('coll_123', { facetKeys: ['brand'], q: 'oak' })
87
111
  * ```
88
112
  */
89
113
  function publicQuery(collectionId: string, body: FacetQueryRequest): Promise<FacetQueryResponse>;
90
114
  /**
91
- * The facet namespaces in use (public). The names are in `items`; `nextCursor` is always null.
115
+ * The facet namespaces in use (public). A small fixed set: all the names are in `items`, there is no
116
+ * `limit` or `cursor`, and `nextCursor` is always null.
92
117
  *
93
118
  * @example
94
119
  * ```typescript
@@ -1,4 +1,5 @@
1
1
  import { del, post, put, request } from "../http.js";
2
+ import { listQuery } from "../list.js";
2
3
  function appendSearchParam(searchParams, key, value) {
3
4
  if (value === undefined || value === null)
4
5
  return;
@@ -24,7 +25,8 @@ function buildQueryString(params) {
24
25
  export var facets;
25
26
  (function (facets) {
26
27
  /**
27
- * The collection's facets (admin). All of them come back in one answer: `nextCursor` is always null.
28
+ * The collection's facets (admin). A small fixed set: all of them come back in one answer, so there is
29
+ * no `limit` or `cursor` and `nextCursor` is always null.
28
30
  *
29
31
  * @example
30
32
  * ```typescript
@@ -58,16 +60,23 @@ export var facets;
58
60
  }
59
61
  facets.remove = remove;
60
62
  /**
61
- * One facet and all its values (admin). The values are in `items`; `nextCursor` is always null.
63
+ * One facet and its values (admin), a page at a time. The values are in `items`; pass `nextCursor` back
64
+ * as `cursor` for the next page (null means that was the last one).
65
+ *
66
+ * @param params - `includeDeleted`, plus `limit` (default 50) and `cursor`
62
67
  *
63
68
  * @example
64
69
  * ```typescript
65
- * const { facet, items } = await facets.listValues('coll_123', 'brand')
66
- * items.map(v => v.name)
70
+ * let page = await facets.listValues('coll_123', 'brand', { limit: 50 })
71
+ * const names = page.items.map(v => v.name)
72
+ * while (page.nextCursor) {
73
+ * page = await facets.listValues('coll_123', 'brand', { limit: 50, cursor: page.nextCursor })
74
+ * names.push(...page.items.map(v => v.name))
75
+ * }
67
76
  * ```
68
77
  */
69
78
  async function listValues(collectionId, facetKey, params) {
70
- const path = `/admin/collection/${encodeURIComponent(collectionId)}/facets/${encodeURIComponent(facetKey)}/values${buildQueryString(params)}`;
79
+ const path = `/admin/collection/${encodeURIComponent(collectionId)}/facets/${encodeURIComponent(facetKey)}/values${listQuery(params)}`;
71
80
  return request(path);
72
81
  }
73
82
  facets.listValues = listValues;
@@ -93,12 +102,18 @@ export var facets;
93
102
  facets.removeValue = removeValue;
94
103
  /**
95
104
  * Facet counts for a set of products (admin): each facet with its values in `items`, and the
96
- * count for each value in `buckets`. Everything comes back in one answer: `nextCursor` is always null.
105
+ * count for each value in `buckets`. Everything comes back in one answer, so there is no `limit` or
106
+ * `cursor` and `nextCursor` is always null.
107
+ *
108
+ * Which products are counted: `q` (search text), `createdAt` / `updatedAt` (date ranges) and the
109
+ * filters in `query`, the same as `products.query`.
97
110
  *
98
111
  * @example
99
112
  * ```typescript
100
113
  * const { items, buckets, meta } = await facets.query('coll_123', {
101
114
  * facetKeys: ['brand', 'material'],
115
+ * q: 'oak',
116
+ * createdAt: { gte: '2026-11-01T00:00:00Z' },
102
117
  * query: { facetEquals: { brand: 'acme' } },
103
118
  * })
104
119
  * ```
@@ -109,7 +124,8 @@ export var facets;
109
124
  }
110
125
  facets.query = query;
111
126
  /**
112
- * The facet namespaces in use (admin). The names are in `items`; `nextCursor` is always null.
127
+ * The facet namespaces in use (admin). A small fixed set: all the names are in `items`, there is no
128
+ * `limit` or `cursor`, and `nextCursor` is always null.
113
129
  *
114
130
  * @example
115
131
  * ```typescript
@@ -122,7 +138,8 @@ export var facets;
122
138
  }
123
139
  facets.namespaces = namespaces;
124
140
  /**
125
- * The collection's facets (public). All of them come back in one answer: `nextCursor` is always null.
141
+ * The collection's facets (public). A small fixed set: all of them come back in one answer, so there is
142
+ * no `limit` or `cursor` and `nextCursor` is always null.
126
143
  *
127
144
  * @example
128
145
  * ```typescript
@@ -140,15 +157,18 @@ export var facets;
140
157
  }
141
158
  facets.publicGet = publicGet;
142
159
  /**
143
- * One facet and all its values (public). The values are in `items`; `nextCursor` is always null.
160
+ * One facet and its values (public), a page at a time. The values are in `items`; pass `nextCursor`
161
+ * back as `cursor` for the next page (null means that was the last one).
162
+ *
163
+ * @param options - `limit` (default 50) and `cursor`
144
164
  *
145
165
  * @example
146
166
  * ```typescript
147
- * const { facet, items } = await facets.publicListValues('coll_123', 'brand')
167
+ * const { facet, items, nextCursor } = await facets.publicListValues('coll_123', 'brand', { limit: 50 })
148
168
  * ```
149
169
  */
150
- async function publicListValues(collectionId, facetKey) {
151
- const path = `/public/collection/${encodeURIComponent(collectionId)}/facets/${encodeURIComponent(facetKey)}/values`;
170
+ async function publicListValues(collectionId, facetKey, options = {}) {
171
+ const path = `/public/collection/${encodeURIComponent(collectionId)}/facets/${encodeURIComponent(facetKey)}/values${listQuery({ limit: options.limit, cursor: options.cursor })}`;
152
172
  return request(path);
153
173
  }
154
174
  facets.publicListValues = publicListValues;
@@ -159,11 +179,15 @@ export var facets;
159
179
  facets.publicGetValue = publicGetValue;
160
180
  /**
161
181
  * Facet counts for a set of products (public): each facet with its values in `items`, and the
162
- * count for each value in `buckets`. Everything comes back in one answer: `nextCursor` is always null.
182
+ * count for each value in `buckets`. Everything comes back in one answer, so there is no `limit` or
183
+ * `cursor` and `nextCursor` is always null.
184
+ *
185
+ * Which products are counted: `q` (search text), `createdAt` / `updatedAt` (date ranges) and the
186
+ * filters in `query`, the same as `products.query`.
163
187
  *
164
188
  * @example
165
189
  * ```typescript
166
- * const { items, buckets } = await facets.publicQuery('coll_123', { facetKeys: ['brand'] })
190
+ * const { items, buckets } = await facets.publicQuery('coll_123', { facetKeys: ['brand'], q: 'oak' })
167
191
  * ```
168
192
  */
169
193
  async function publicQuery(collectionId, body) {
@@ -172,7 +196,8 @@ export var facets;
172
196
  }
173
197
  facets.publicQuery = publicQuery;
174
198
  /**
175
- * The facet namespaces in use (public). The names are in `items`; `nextCursor` is always null.
199
+ * The facet namespaces in use (public). A small fixed set: all the names are in `items`, there is no
200
+ * `limit` or `cursor`, and `nextCursor` is always null.
176
201
  *
177
202
  * @example
178
203
  * ```typescript
@@ -25,11 +25,14 @@ import type { ListResult } from "../types/list.js";
25
25
  export declare namespace files {
26
26
  /**
27
27
  * Files on this site that aren't ordinary uploads: temporary, fetched, derived or generated (admin).
28
- * They come back in one answer (`nextCursor` is always null); `limit` is the most it returns.
28
+ * A page at a time: `limit` says how many, `cursor` is the previous page's `nextCursor`.
29
29
  *
30
30
  * @example
31
31
  * ```typescript
32
- * const { items } = await files.list('coll_123', { appId: 'my-app', origin: 'fetched' })
32
+ * let page = await files.list('coll_123', { appId: 'my-app', origin: 'fetched', limit: 50 })
33
+ * while (page.nextCursor) {
34
+ * page = await files.list('coll_123', { appId: 'my-app', origin: 'fetched', limit: 50, cursor: page.nextCursor })
35
+ * }
33
36
  * ```
34
37
  */
35
38
  function list(collectionId: string, query?: ListFilesQuery): Promise<ListResult<FileRecord>>;
package/dist/api/files.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { request, post, del } from "../http.js";
2
+ import { listQuery } from "../list.js";
2
3
  /**
3
4
  * Files: temporary or kept files, web pages and documents fetched by address, and what's extracted from them
4
5
  * (text, Markdown, OCR, typed fields). Files are assets, but private until kept and left out of asset lists, so
@@ -27,16 +28,18 @@ export var files;
27
28
  const one = (collectionId, fileId) => `${adm(collectionId)}/${encodeURIComponent(fileId)}`;
28
29
  /**
29
30
  * Files on this site that aren't ordinary uploads: temporary, fetched, derived or generated (admin).
30
- * They come back in one answer (`nextCursor` is always null); `limit` is the most it returns.
31
+ * A page at a time: `limit` says how many, `cursor` is the previous page's `nextCursor`.
31
32
  *
32
33
  * @example
33
34
  * ```typescript
34
- * const { items } = await files.list('coll_123', { appId: 'my-app', origin: 'fetched' })
35
+ * let page = await files.list('coll_123', { appId: 'my-app', origin: 'fetched', limit: 50 })
36
+ * while (page.nextCursor) {
37
+ * page = await files.list('coll_123', { appId: 'my-app', origin: 'fetched', limit: 50, cursor: page.nextCursor })
38
+ * }
35
39
  * ```
36
40
  */
37
41
  async function list(collectionId, query = {}) {
38
- const qs = new URLSearchParams(Object.entries(query).filter(([, v]) => v != null).map(([k, v]) => [k, String(v)])).toString();
39
- return request(`${adm(collectionId)}${qs ? `?${qs}` : ""}`);
42
+ return request(`${adm(collectionId)}${listQuery(query)}`);
40
43
  }
41
44
  files.list = list;
42
45
  /** A new file from text, base64 or JSON. Temporary (default 1 day) and private. */
@@ -1,4 +1,4 @@
1
- import type { ListResult } from "../types/list.js";
1
+ import type { ListResult, ListOptions } from "../types/list.js";
2
2
  export declare namespace form {
3
3
  /**
4
4
  * Get a single form by ID for a collection.
@@ -8,17 +8,20 @@ export declare namespace form {
8
8
  */
9
9
  function get(collectionId: string, formId: string, admin?: boolean): Promise<any>;
10
10
  /**
11
- * List all forms for a collection. All of them come back in one answer: `nextCursor` is always null.
11
+ * List the forms for a collection, 50 at a time unless you give a `limit` (at most 1000). Pass
12
+ * `nextCursor` back as `cursor` for the next page; `null` means that was the last one.
12
13
  * @param collectionId – The collection identifier
13
14
  * @param admin – If true, use admin endpoint; otherwise, use public
14
- * @returns Promise resolving to `{ items, nextCursor }`, where `items` are the forms
15
+ * @param options – Paging: `limit` and `cursor`
16
+ * @returns Promise resolving to `{ items, nextCursor, count }`, where `items` are the forms
15
17
  *
16
18
  * @example
17
19
  * ```typescript
18
- * const { items: forms } = await form.list(collectionId, true)
20
+ * let page = await form.list(collectionId, true, { limit: 100 })
21
+ * while (page.nextCursor) page = await form.list(collectionId, true, { limit: 100, cursor: page.nextCursor })
19
22
  * ```
20
23
  */
21
- function list(collectionId: string, admin?: boolean): Promise<ListResult<any>>;
24
+ function list(collectionId: string, admin?: boolean, options?: ListOptions): Promise<ListResult<any>>;
22
25
  /**
23
26
  * Create a new form for a collection (admin only).
24
27
  * @param collectionId – The collection identifier
package/dist/api/form.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { request, post, put, del } from "../http.js";
2
+ import { listQuery } from "../list.js";
2
3
  export var form;
3
4
  (function (form) {
4
5
  /**
@@ -14,19 +15,22 @@ export var form;
14
15
  }
15
16
  form.get = get;
16
17
  /**
17
- * List all forms for a collection. All of them come back in one answer: `nextCursor` is always null.
18
+ * List the forms for a collection, 50 at a time unless you give a `limit` (at most 1000). Pass
19
+ * `nextCursor` back as `cursor` for the next page; `null` means that was the last one.
18
20
  * @param collectionId – The collection identifier
19
21
  * @param admin – If true, use admin endpoint; otherwise, use public
20
- * @returns Promise resolving to `{ items, nextCursor }`, where `items` are the forms
22
+ * @param options – Paging: `limit` and `cursor`
23
+ * @returns Promise resolving to `{ items, nextCursor, count }`, where `items` are the forms
21
24
  *
22
25
  * @example
23
26
  * ```typescript
24
- * const { items: forms } = await form.list(collectionId, true)
27
+ * let page = await form.list(collectionId, true, { limit: 100 })
28
+ * while (page.nextCursor) page = await form.list(collectionId, true, { limit: 100, cursor: page.nextCursor })
25
29
  * ```
26
30
  */
27
- async function list(collectionId, admin) {
31
+ async function list(collectionId, admin, options = {}) {
28
32
  const base = admin ? '/admin' : '/public';
29
- const path = `${base}/collection/${encodeURIComponent(collectionId)}/form`;
33
+ const path = `${base}/collection/${encodeURIComponent(collectionId)}/form${listQuery({ limit: options.limit, cursor: options.cursor })}`;
30
34
  return request(path);
31
35
  }
32
36
  form.list = list;
@@ -21,7 +21,6 @@ export { comms } from "./comms.js";
21
21
  export { nfc } from "./nfc.js";
22
22
  export { contact } from "./contact.js";
23
23
  export { broadcasts } from "./broadcasts.js";
24
- export { async } from "./async.js";
25
24
  export { jobs } from "./jobs.js";
26
25
  export { segments } from "./segments.js";
27
26
  export { userGroups } from "./userGroups.js";
@@ -46,6 +45,7 @@ export { order } from "./order.js";
46
45
  export { app } from "./appObjects.js";
47
46
  export { bookings } from "./bookings.js";
48
47
  export { shop } from "./shop.js";
48
+ export { payments } from "./payments.js";
49
49
  export { subscriptions } from "./subscriptions.js";
50
50
  export { attestations } from "./attestations.js";
51
51
  export { containers } from "./containers.js";
package/dist/api/index.js CHANGED
@@ -23,7 +23,6 @@ export { comms } from "./comms.js";
23
23
  export { nfc } from "./nfc.js";
24
24
  export { contact } from "./contact.js";
25
25
  export { broadcasts } from "./broadcasts.js";
26
- export { async } from "./async.js";
27
26
  export { jobs } from "./jobs.js";
28
27
  export { segments } from "./segments.js";
29
28
  export { userGroups } from "./userGroups.js";
@@ -49,6 +48,7 @@ export { order } from "./order.js";
49
48
  export { app } from "./appObjects.js";
50
49
  export { bookings } from "./bookings.js";
51
50
  export { shop } from "./shop.js";
51
+ export { payments } from "./payments.js";
52
52
  export { subscriptions } from "./subscriptions.js";
53
53
  export { attestations } from "./attestations.js";
54
54
  export { containers } from "./containers.js";
@@ -1,18 +1,23 @@
1
1
  import type { IntegrationFlow, CreateFlowInput, UpdateFlowInput, ListFlowsQuery, RunFlowInput, RunFlowResult, RunFlowSummary, RunFlowEnqueued, RecordTypeInfo, FlowRun, FlowRunItem, ListRunsQuery, ListRunItemsQuery, LoggingWindow, SetLoggingInput, InstalledConnector, SaveConnectorInstallationInput, ConnectorConsoleStep, FailedRecord, FlowDirection, FlowHealth, IntegrationHealth, ProductLineage } from "../types/integrations.js";
2
- import type { ListResult } from "../types/list.js";
2
+ import type { ListResult, ListOptions } from "../types/list.js";
3
3
  export declare namespace integrations {
4
4
  /**
5
- * List flows in a collection (all of them: this list has no pages). GET /integrations/flows
5
+ * List flows in a collection, a page at a time (`limit` and `cursor`; 50 unless you say otherwise).
6
+ * GET /integrations/flows
6
7
  *
7
8
  * @example
8
9
  * ```typescript
9
- * const { items } = await integrations.listFlows('coll_123', { direction: 'outbound', status: 'active' })
10
+ * let page = await integrations.listFlows('coll_123', { direction: 'outbound', status: 'active' })
11
+ * while (page.nextCursor) {
12
+ * page = await integrations.listFlows('coll_123', { direction: 'outbound', status: 'active', cursor: page.nextCursor })
13
+ * }
10
14
  * ```
11
15
  */
12
16
  function listFlows(collectionId: string, query?: ListFlowsQuery): Promise<ListResult<IntegrationFlow>>;
13
17
  /**
14
18
  * Discover the app-record types present in a collection + which app owns each
15
- * (introspected), for picking a sub-record source/trigger. One list, no pages.
19
+ * (introspected), for picking a sub-record source/trigger. A fixed set: always all of them in one
20
+ * answer, so it takes no `limit` or `cursor`.
16
21
  * GET /integrations/record-types
17
22
  *
18
23
  * @example
@@ -71,17 +76,19 @@ export declare namespace integrations {
71
76
  */
72
77
  function listRunItems(collectionId: string, flowId: string, runId: string, query?: ListRunItemsQuery): Promise<ListResult<FlowRunItem>>;
73
78
  /**
74
- * Every run touching an entity (e.g. a product), across flows, newest first. One list, no pages:
75
- * `limit` says how many. GET /integrations/runs/entity/:entityId
79
+ * Every run touching an entity (e.g. a product), across flows, newest first. A page at a time:
80
+ * `limit` says how many, `cursor` is the previous page's `nextCursor`.
81
+ * GET /integrations/runs/entity/:entityId
76
82
  *
77
83
  * @example
78
84
  * ```typescript
79
- * const { items } = await integrations.listEntityRuns('coll_123', productId, { limit: 20 })
85
+ * let page = await integrations.listEntityRuns('coll_123', productId, { limit: 20 })
86
+ * while (page.nextCursor) {
87
+ * page = await integrations.listEntityRuns('coll_123', productId, { limit: 20, cursor: page.nextCursor })
88
+ * }
80
89
  * ```
81
90
  */
82
- function listEntityRuns(collectionId: string, entityId: string, query?: {
83
- limit?: number;
84
- }): Promise<ListResult<FlowRun>>;
91
+ function listEntityRuns(collectionId: string, entityId: string, query?: ListOptions): Promise<ListResult<FlowRun>>;
85
92
  /** Is enhanced logging active for a connection? GET /integrations/logging/:connectionId */
86
93
  function getLogging(collectionId: string, connectionId: string): Promise<{
87
94
  window: LoggingWindow | null;
@@ -91,17 +98,20 @@ export declare namespace integrations {
91
98
  window: LoggingWindow;
92
99
  }>;
93
100
  /**
94
- * A flow's failed / dead records, with the flow's `direction` beside the list. GET /integrations/flows/:id/failed
101
+ * A flow's failed / dead records, a page at a time (`limit` and `cursor`), with the flow's
102
+ * `direction` beside the list. GET /integrations/flows/:id/failed
95
103
  *
96
104
  * @example
97
105
  * ```typescript
98
- * const { items, nextCursor, direction } = await integrations.listFailed('coll_123', flowId, { status: 'dead' })
106
+ * let page = await integrations.listFailed('coll_123', flowId, { status: 'dead', limit: 100 })
107
+ * page.direction // 'inbound' | 'outbound'
108
+ * while (page.nextCursor) {
109
+ * page = await integrations.listFailed('coll_123', flowId, { status: 'dead', limit: 100, cursor: page.nextCursor })
110
+ * }
99
111
  * ```
100
112
  */
101
- function listFailed(collectionId: string, flowId: string, query?: {
113
+ function listFailed(collectionId: string, flowId: string, query?: ListOptions & {
102
114
  status?: 'failed' | 'dead';
103
- limit?: number;
104
- cursor?: string;
105
115
  }): Promise<ListResult<FailedRecord> & {
106
116
  direction: FlowDirection;
107
117
  }>;
@@ -131,7 +141,8 @@ export declare namespace integrations {
131
141
  canceled: boolean;
132
142
  }>;
133
143
  /**
134
- * The collection's installed connector apps (all of them: this list has no pages). GET /integrations/connectors
144
+ * The collection's installed connector apps. A fixed set: always all of them in one answer, so it
145
+ * takes no `limit` or `cursor`. GET /integrations/connectors
135
146
  *
136
147
  * @example
137
148
  * ```typescript
@@ -164,7 +175,8 @@ export declare namespace integrations {
164
175
  function runConnectorAction<T = unknown>(collectionId: string, appId: string, action: string, input?: Record<string, unknown>): Promise<T>;
165
176
  /**
166
177
  * PUBLIC (the Hub, a site): the connector actions the caller may invoke — those declared `public`,
167
- * plus `member` ones when signed in. One list, no pages.
178
+ * plus `member` ones when signed in. A fixed set: always all of them in one answer, so it takes no
179
+ * `limit` or `cursor`.
168
180
  * GET /public/collection/:collectionId/connectors/:appId/actions
169
181
  *
170
182
  * @example