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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/README.md +7 -7
  2. package/dist/api/analytics.d.ts +5 -4
  3. package/dist/api/analytics.js +5 -4
  4. package/dist/api/appConfiguration.d.ts +23 -18
  5. package/dist/api/appConfiguration.js +24 -18
  6. package/dist/api/appObjects.d.ts +54 -10
  7. package/dist/api/appObjects.js +75 -40
  8. package/dist/api/asset.d.ts +28 -22
  9. package/dist/api/asset.js +45 -56
  10. package/dist/api/attestation.d.ts +11 -3
  11. package/dist/api/attestation.js +12 -3
  12. package/dist/api/attestations.d.ts +12 -8
  13. package/dist/api/attestations.js +18 -21
  14. package/dist/api/authKit.d.ts +15 -10
  15. package/dist/api/authKit.js +17 -11
  16. package/dist/api/batch.d.ts +36 -25
  17. package/dist/api/batch.js +46 -39
  18. package/dist/api/bookings.d.ts +18 -9
  19. package/dist/api/bookings.js +23 -13
  20. package/dist/api/broadcasts.js +3 -17
  21. package/dist/api/claimSet.d.ts +26 -12
  22. package/dist/api/claimSet.js +32 -24
  23. package/dist/api/collection.d.ts +15 -10
  24. package/dist/api/collection.js +17 -11
  25. package/dist/api/comms.d.ts +12 -6
  26. package/dist/api/comms.js +12 -6
  27. package/dist/api/conditions.d.ts +7 -6
  28. package/dist/api/conditions.js +8 -6
  29. package/dist/api/contact.d.ts +6 -2
  30. package/dist/api/contact.js +25 -60
  31. package/dist/api/containers.d.ts +14 -10
  32. package/dist/api/containers.js +19 -14
  33. package/dist/api/crate.js +7 -9
  34. package/dist/api/dpp.d.ts +20 -13
  35. package/dist/api/dpp.js +23 -15
  36. package/dist/api/facets.d.ts +38 -13
  37. package/dist/api/facets.js +40 -15
  38. package/dist/api/files.d.ts +5 -2
  39. package/dist/api/files.js +7 -4
  40. package/dist/api/form.d.ts +8 -5
  41. package/dist/api/form.js +9 -5
  42. package/dist/api/index.d.ts +0 -1
  43. package/dist/api/index.js +0 -1
  44. package/dist/api/integrations.d.ts +29 -17
  45. package/dist/api/integrations.js +32 -25
  46. package/dist/api/interactions.d.ts +11 -6
  47. package/dist/api/interactions.js +14 -23
  48. package/dist/api/jobs.d.ts +16 -6
  49. package/dist/api/jobs.js +30 -20
  50. package/dist/api/journeys.js +2 -14
  51. package/dist/api/journeysAnalytics.d.ts +8 -5
  52. package/dist/api/journeysAnalytics.js +8 -5
  53. package/dist/api/knowledge.d.ts +20 -14
  54. package/dist/api/knowledge.js +22 -15
  55. package/dist/api/location.d.ts +6 -3
  56. package/dist/api/location.js +8 -22
  57. package/dist/api/lots.d.ts +9 -5
  58. package/dist/api/lots.js +22 -26
  59. package/dist/api/loyalty.d.ts +25 -16
  60. package/dist/api/loyalty.js +33 -32
  61. package/dist/api/nfc.d.ts +3 -1
  62. package/dist/api/nfc.js +3 -1
  63. package/dist/api/order.d.ts +45 -39
  64. package/dist/api/order.js +48 -65
  65. package/dist/api/partner.d.ts +17 -14
  66. package/dist/api/partner.js +21 -22
  67. package/dist/api/products.d.ts +35 -12
  68. package/dist/api/products.js +36 -13
  69. package/dist/api/proof.d.ts +41 -19
  70. package/dist/api/proof.js +44 -23
  71. package/dist/api/segments.js +3 -15
  72. package/dist/api/serviceAccounts.d.ts +8 -5
  73. package/dist/api/serviceAccounts.js +9 -6
  74. package/dist/api/shop.d.ts +7 -5
  75. package/dist/api/shop.js +13 -19
  76. package/dist/api/subscriptions.d.ts +12 -10
  77. package/dist/api/subscriptions.js +17 -25
  78. package/dist/api/tags.d.ts +23 -20
  79. package/dist/api/tags.js +40 -52
  80. package/dist/api/template.d.ts +16 -11
  81. package/dist/api/template.js +19 -13
  82. package/dist/api/translations.js +2 -12
  83. package/dist/api/userGroups.d.ts +26 -16
  84. package/dist/api/userGroups.js +43 -30
  85. package/dist/api/variant.d.ts +10 -7
  86. package/dist/api/variant.js +11 -7
  87. package/dist/api/wallet.d.ts +14 -11
  88. package/dist/api/wallet.js +15 -12
  89. package/dist/docs/API_SUMMARY.md +289 -483
  90. package/dist/docs/ai.md +15 -15
  91. package/dist/docs/analytics.md +1 -1
  92. package/dist/docs/app-objects.md +4 -4
  93. package/dist/docs/attestations.md +8 -8
  94. package/dist/docs/contact-search.md +2 -3
  95. package/dist/docs/knowledge.md +3 -3
  96. package/dist/docs/lists.md +58 -15
  97. package/dist/docs/upgrading-to-3.md +238 -136
  98. package/dist/list.d.ts +12 -0
  99. package/dist/list.js +59 -0
  100. package/dist/openapi.yaml +301 -662
  101. package/dist/types/analytics.d.ts +7 -3
  102. package/dist/types/appObjects.d.ts +27 -12
  103. package/dist/types/appOptions.d.ts +2 -2
  104. package/dist/types/asset.d.ts +5 -6
  105. package/dist/types/attestations.d.ts +7 -9
  106. package/dist/types/batch.d.ts +5 -5
  107. package/dist/types/bookings.d.ts +10 -5
  108. package/dist/types/comms.d.ts +9 -5
  109. package/dist/types/contact.d.ts +7 -4
  110. package/dist/types/containers.d.ts +2 -1
  111. package/dist/types/facets.d.ts +14 -2
  112. package/dist/types/files.d.ts +3 -2
  113. package/dist/types/integrations.d.ts +2 -1
  114. package/dist/types/interaction.d.ts +15 -7
  115. package/dist/types/jobs.d.ts +1 -1
  116. package/dist/types/journeysAnalytics.d.ts +3 -2
  117. package/dist/types/knowledge.d.ts +6 -3
  118. package/dist/types/knowledge.js +0 -1
  119. package/dist/types/list.d.ts +30 -2
  120. package/dist/types/location.d.ts +7 -2
  121. package/dist/types/location.js +0 -1
  122. package/dist/types/lots.d.ts +5 -2
  123. package/dist/types/lots.js +0 -6
  124. package/dist/types/order.d.ts +22 -20
  125. package/dist/types/product.d.ts +28 -11
  126. package/dist/types/proof.d.ts +7 -8
  127. package/dist/types/tags.d.ts +5 -3
  128. package/dist/types/userGroups.d.ts +3 -3
  129. package/dist/types/userGroups.js +0 -4
  130. package/dist/version.d.ts +1 -1
  131. package/dist/version.js +1 -1
  132. package/docs/API_SUMMARY.md +289 -483
  133. package/docs/ai.md +15 -15
  134. package/docs/analytics.md +1 -1
  135. package/docs/app-objects.md +4 -4
  136. package/docs/attestations.md +8 -8
  137. package/docs/contact-search.md +2 -3
  138. package/docs/knowledge.md +3 -3
  139. package/docs/lists.md +58 -15
  140. package/docs/upgrading-to-3.md +238 -136
  141. package/openapi.yaml +301 -662
  142. package/package.json +1 -1
  143. package/scripts/lib/upgrade.mjs +216 -60
  144. package/scripts/upgrade.mjs +33 -10
  145. package/upgrade/3.json +2731 -2213
@@ -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";
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";
@@ -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
@@ -18,35 +18,31 @@ var __rest = (this && this.__rest) || function (s, e) {
18
18
  return t;
19
19
  };
20
20
  import { request, post, put, del } from "../http.js";
21
+ import { listQuery } from "../list.js";
21
22
  function enc(v) { return encodeURIComponent(v); }
22
- function encodeQuery(params = {}) {
23
- const search = new URLSearchParams();
24
- for (const [key, value] of Object.entries(params)) {
25
- if (value === undefined || value === null || value === "")
26
- continue;
27
- search.set(key, typeof value === "boolean" ? (value ? "true" : "false") : String(value));
28
- }
29
- const qs = search.toString();
30
- return qs ? `?${qs}` : "";
31
- }
32
23
  export var integrations;
33
24
  (function (integrations) {
34
25
  const base = (collectionId) => `/admin/collection/${enc(collectionId)}/integrations/flows`;
35
26
  /**
36
- * List flows in a collection (all of them: this list has no pages). GET /integrations/flows
27
+ * List flows in a collection, a page at a time (`limit` and `cursor`; 50 unless you say otherwise).
28
+ * GET /integrations/flows
37
29
  *
38
30
  * @example
39
31
  * ```typescript
40
- * const { items } = await integrations.listFlows('coll_123', { direction: 'outbound', status: 'active' })
32
+ * let page = await integrations.listFlows('coll_123', { direction: 'outbound', status: 'active' })
33
+ * while (page.nextCursor) {
34
+ * page = await integrations.listFlows('coll_123', { direction: 'outbound', status: 'active', cursor: page.nextCursor })
35
+ * }
41
36
  * ```
42
37
  */
43
38
  async function listFlows(collectionId, query = {}) {
44
- return request(`${base(collectionId)}${encodeQuery(query)}`);
39
+ return request(`${base(collectionId)}${listQuery(query)}`);
45
40
  }
46
41
  integrations.listFlows = listFlows;
47
42
  /**
48
43
  * Discover the app-record types present in a collection + which app owns each
49
- * (introspected), for picking a sub-record source/trigger. One list, no pages.
44
+ * (introspected), for picking a sub-record source/trigger. A fixed set: always all of them in one
45
+ * answer, so it takes no `limit` or `cursor`.
50
46
  * GET /integrations/record-types
51
47
  *
52
48
  * @example
@@ -117,7 +113,7 @@ export var integrations;
117
113
  * ```
118
114
  */
119
115
  async function listRuns(collectionId, flowId, query = {}) {
120
- return request(`${base(collectionId)}/${enc(flowId)}/runs${encodeQuery(query)}`);
116
+ return request(`${base(collectionId)}/${enc(flowId)}/runs${listQuery(query)}`);
121
117
  }
122
118
  integrations.listRuns = listRuns;
123
119
  /** Get one run's summary. GET /integrations/flows/:id/runs/:runId */
@@ -136,20 +132,24 @@ export var integrations;
136
132
  * ```
137
133
  */
138
134
  async function listRunItems(collectionId, flowId, runId, query = {}) {
139
- return request(`${base(collectionId)}/${enc(flowId)}/runs/${enc(runId)}/items${encodeQuery(query)}`);
135
+ return request(`${base(collectionId)}/${enc(flowId)}/runs/${enc(runId)}/items${listQuery(query)}`);
140
136
  }
141
137
  integrations.listRunItems = listRunItems;
142
138
  /**
143
- * Every run touching an entity (e.g. a product), across flows, newest first. One list, no pages:
144
- * `limit` says how many. GET /integrations/runs/entity/:entityId
139
+ * Every run touching an entity (e.g. a product), across flows, newest first. A page at a time:
140
+ * `limit` says how many, `cursor` is the previous page's `nextCursor`.
141
+ * GET /integrations/runs/entity/:entityId
145
142
  *
146
143
  * @example
147
144
  * ```typescript
148
- * const { items } = await integrations.listEntityRuns('coll_123', productId, { limit: 20 })
145
+ * let page = await integrations.listEntityRuns('coll_123', productId, { limit: 20 })
146
+ * while (page.nextCursor) {
147
+ * page = await integrations.listEntityRuns('coll_123', productId, { limit: 20, cursor: page.nextCursor })
148
+ * }
149
149
  * ```
150
150
  */
151
151
  async function listEntityRuns(collectionId, entityId, query = {}) {
152
- return request(`/admin/collection/${enc(collectionId)}/integrations/runs/entity/${enc(entityId)}${encodeQuery(query)}`);
152
+ return request(`/admin/collection/${enc(collectionId)}/integrations/runs/entity/${enc(entityId)}${listQuery(query)}`);
153
153
  }
154
154
  integrations.listEntityRuns = listEntityRuns;
155
155
  // --- Enhanced logging window (per connection) ---------------------------
@@ -170,15 +170,20 @@ export var integrations;
170
170
  // A failed record is retried on its own with backoff; a permanent failure, or one out of attempts, is
171
171
  // 'dead' and waits for someone to retry it (or for the record to change).
172
172
  /**
173
- * A flow's failed / dead records, with the flow's `direction` beside the list. GET /integrations/flows/:id/failed
173
+ * A flow's failed / dead records, a page at a time (`limit` and `cursor`), with the flow's
174
+ * `direction` beside the list. GET /integrations/flows/:id/failed
174
175
  *
175
176
  * @example
176
177
  * ```typescript
177
- * const { items, nextCursor, direction } = await integrations.listFailed('coll_123', flowId, { status: 'dead' })
178
+ * let page = await integrations.listFailed('coll_123', flowId, { status: 'dead', limit: 100 })
179
+ * page.direction // 'inbound' | 'outbound'
180
+ * while (page.nextCursor) {
181
+ * page = await integrations.listFailed('coll_123', flowId, { status: 'dead', limit: 100, cursor: page.nextCursor })
182
+ * }
178
183
  * ```
179
184
  */
180
185
  async function listFailed(collectionId, flowId, query = {}) {
181
- return request(`${base(collectionId)}/${enc(flowId)}/failed${encodeQuery(query)}`);
186
+ return request(`${base(collectionId)}/${enc(flowId)}/failed${listQuery(query)}`);
182
187
  }
183
188
  integrations.listFailed = listFailed;
184
189
  /** Retry failed / dead records now (all of them when `ids` is omitted). POST /integrations/flows/:id/failed/retry */
@@ -223,7 +228,8 @@ export var integrations;
223
228
  // `secrets.put(collectionId, name, value, { appId })` for the connector's appId.
224
229
  const connectorsBase = (collectionId) => `/admin/collection/${enc(collectionId)}/integrations/connectors`;
225
230
  /**
226
- * The collection's installed connector apps (all of them: this list has no pages). GET /integrations/connectors
231
+ * The collection's installed connector apps. A fixed set: always all of them in one answer, so it
232
+ * takes no `limit` or `cursor`. GET /integrations/connectors
227
233
  *
228
234
  * @example
229
235
  * ```typescript
@@ -261,7 +267,8 @@ export var integrations;
261
267
  integrations.runConnectorAction = runConnectorAction;
262
268
  /**
263
269
  * PUBLIC (the Hub, a site): the connector actions the caller may invoke — those declared `public`,
264
- * plus `member` ones when signed in. One list, no pages.
270
+ * plus `member` ones when signed in. A fixed set: always all of them in one answer, so it takes no
271
+ * `limit` or `cursor`.
265
272
  * GET /public/collection/:collectionId/connectors/:appId/actions
266
273
  *
267
274
  * @example
@@ -3,12 +3,15 @@ import type { ListResult } from "../types/list.js";
3
3
  export declare namespace interactions {
4
4
  /**
5
5
  * POST /admin/collection/:collectionId/interactions/query
6
- * Flexible query for interaction events with optional includes. One list, no pages: `limit` in the
7
- * body says how many events to return.
6
+ * Flexible query for interaction events, a page at a time (`limit` and `cursor` in the body). The
7
+ * time window is `from` / `to`. Sort with `orderBy: [{ timestamp: 'asc' }]`; bring each event's
8
+ * interaction type along with `expand: ['interaction']`.
8
9
  *
9
10
  * @example
10
11
  * ```typescript
11
- * const { items } = await interactions.query('coll_123', { appId: 'my-app', interactionId: voteTypeId, limit: 500 })
12
+ * const query = { appId: 'my-app', interactionId: voteTypeId, from: '2026-11-01T00:00:00Z', limit: 500 }
13
+ * let page = await interactions.query('coll_123', { ...query, orderBy: [{ timestamp: 'desc' }], expand: ['interaction'] })
14
+ * while (page.nextCursor) page = await interactions.query('coll_123', { ...query, cursor: page.nextCursor })
12
15
  * ```
13
16
  */
14
17
  function query(collectionId: string, body: AdminInteractionsQueryRequest): Promise<ListResult<InteractionEventRow>>;
@@ -83,13 +86,15 @@ export declare namespace interactions {
83
86
  function remove(collectionId: string, id: string): Promise<void>;
84
87
  function publicCountsByOutcome(collectionId: string, body: PublicInteractionsCountsByOutcomeRequest, authToken?: string): Promise<OutcomeCount[]>;
85
88
  /**
86
- * The signed-in person's own interaction events (where the type allows it). One list, no pages:
87
- * `limit` in the body says how many.
89
+ * The signed-in person's own interaction events (where the type allows it), a page at a time
90
+ * (`limit` and `cursor` in the body). The time window is `from` / `to`.
88
91
  * POST /public/collection/:collectionId/interactions/by-user
89
92
  *
90
93
  * @example
91
94
  * ```typescript
92
- * const { items } = await interactions.publicMyInteractions('coll_123', { appId: 'my-app', interactionId: voteTypeId })
95
+ * const query = { appId: 'my-app', interactionId: voteTypeId, limit: 50 }
96
+ * let page = await interactions.publicMyInteractions('coll_123', query)
97
+ * while (page.nextCursor) page = await interactions.publicMyInteractions('coll_123', { ...query, cursor: page.nextCursor })
93
98
  * ```
94
99
  */
95
100
  function publicMyInteractions(collectionId: string, body: PublicInteractionsByUserRequest, authToken?: string): Promise<ListResult<InteractionEventRow>>;
@@ -1,30 +1,19 @@
1
1
  // src/api/interactions.ts
2
2
  import { request, post, patch, del } from "../http.js";
3
- function encodeQuery(params) {
4
- const search = new URLSearchParams();
5
- for (const [key, value] of Object.entries(params)) {
6
- if (value === undefined || value === null || value === "")
7
- continue;
8
- if (typeof value === "boolean") {
9
- search.set(key, value ? "true" : "false");
10
- }
11
- else {
12
- search.set(key, String(value));
13
- }
14
- }
15
- const qs = search.toString();
16
- return qs ? `?${qs}` : "";
17
- }
3
+ import { listQuery } from "../list.js";
18
4
  export var interactions;
19
5
  (function (interactions) {
20
6
  /**
21
7
  * POST /admin/collection/:collectionId/interactions/query
22
- * Flexible query for interaction events with optional includes. One list, no pages: `limit` in the
23
- * body says how many events to return.
8
+ * Flexible query for interaction events, a page at a time (`limit` and `cursor` in the body). The
9
+ * time window is `from` / `to`. Sort with `orderBy: [{ timestamp: 'asc' }]`; bring each event's
10
+ * interaction type along with `expand: ['interaction']`.
24
11
  *
25
12
  * @example
26
13
  * ```typescript
27
- * const { items } = await interactions.query('coll_123', { appId: 'my-app', interactionId: voteTypeId, limit: 500 })
14
+ * const query = { appId: 'my-app', interactionId: voteTypeId, from: '2026-11-01T00:00:00Z', limit: 500 }
15
+ * let page = await interactions.query('coll_123', { ...query, orderBy: [{ timestamp: 'desc' }], expand: ['interaction'] })
16
+ * while (page.nextCursor) page = await interactions.query('coll_123', { ...query, cursor: page.nextCursor })
28
17
  * ```
29
18
  */
30
19
  async function query(collectionId, body) {
@@ -113,7 +102,7 @@ export var interactions;
113
102
  * ```
114
103
  */
115
104
  async function list(collectionId, query = {}) {
116
- const qs = encodeQuery(query);
105
+ const qs = listQuery(query);
117
106
  const path = `/admin/collection/${encodeURIComponent(collectionId)}/interactions/${qs}`;
118
107
  return request(path);
119
108
  }
@@ -173,13 +162,15 @@ export var interactions;
173
162
  }
174
163
  interactions.publicCountsByOutcome = publicCountsByOutcome;
175
164
  /**
176
- * The signed-in person's own interaction events (where the type allows it). One list, no pages:
177
- * `limit` in the body says how many.
165
+ * The signed-in person's own interaction events (where the type allows it), a page at a time
166
+ * (`limit` and `cursor` in the body). The time window is `from` / `to`.
178
167
  * POST /public/collection/:collectionId/interactions/by-user
179
168
  *
180
169
  * @example
181
170
  * ```typescript
182
- * const { items } = await interactions.publicMyInteractions('coll_123', { appId: 'my-app', interactionId: voteTypeId })
171
+ * const query = { appId: 'my-app', interactionId: voteTypeId, limit: 50 }
172
+ * let page = await interactions.publicMyInteractions('coll_123', query)
173
+ * while (page.nextCursor) page = await interactions.publicMyInteractions('coll_123', { ...query, cursor: page.nextCursor })
183
174
  * ```
184
175
  */
185
176
  async function publicMyInteractions(collectionId, body, authToken) {
@@ -198,7 +189,7 @@ export var interactions;
198
189
  * ```
199
190
  */
200
191
  async function publicList(collectionId, query = {}) {
201
- const qs = encodeQuery(query);
192
+ const qs = listQuery(query);
202
193
  const path = `/public/collection/${encodeURIComponent(collectionId)}/interactions/${qs}`;
203
194
  return request(path);
204
195
  }