@proveanything/smartlinks 3.0.0-alpha.2 → 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 (151) 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/bookings.d.ts +49 -2
  5. package/dist/api/bookings.js +59 -2
  6. package/dist/api/index.d.ts +1 -0
  7. package/dist/api/index.js +1 -0
  8. package/dist/api/payments.d.ts +60 -0
  9. package/dist/api/payments.js +94 -0
  10. package/dist/api/realtime.d.ts +3 -0
  11. package/dist/api/realtime.js +10 -2
  12. package/dist/baseline.css +194 -194
  13. package/dist/dataChanged.d.ts +74 -0
  14. package/dist/dataChanged.js +162 -0
  15. package/dist/docs/API_SUMMARY.md +1086 -858
  16. package/dist/docs/admin-cards.md +189 -189
  17. package/dist/docs/agent-tools.md +156 -156
  18. package/dist/docs/ai-tools-and-skills.md +180 -180
  19. package/dist/docs/ai.md +1721 -1721
  20. package/dist/docs/api-versions.md +85 -85
  21. package/dist/docs/app-data-storage.md +277 -277
  22. package/dist/docs/app-docs.md +73 -73
  23. package/dist/docs/app-manifest.md +852 -852
  24. package/dist/docs/app-records-pattern.md +388 -388
  25. package/dist/docs/appConfig.md +550 -550
  26. package/dist/docs/assistant-apps.md +172 -172
  27. package/dist/docs/assistant-context.md +119 -119
  28. package/dist/docs/bookings.md +105 -8
  29. package/dist/docs/caching.md +32 -3
  30. package/dist/docs/comms.md +689 -689
  31. package/dist/docs/connectors.md +340 -340
  32. package/dist/docs/css-baseline.md +133 -133
  33. package/dist/docs/customer-guide.md +70 -70
  34. package/dist/docs/data-changed.md +91 -0
  35. package/dist/docs/deploying-apps.md +340 -340
  36. package/dist/docs/dpp.md +115 -115
  37. package/dist/docs/entitlements.md +90 -90
  38. package/dist/docs/files.md +69 -69
  39. package/dist/docs/host-dependency-contract.md +252 -252
  40. package/dist/docs/iframe-responder.md +11 -0
  41. package/dist/docs/integrations.md +322 -322
  42. package/dist/docs/interactions.md +544 -544
  43. package/dist/docs/item-context.md +181 -181
  44. package/dist/docs/knowledge.md +105 -105
  45. package/dist/docs/lists.md +157 -157
  46. package/dist/docs/lots.md +112 -112
  47. package/dist/docs/loyalty.md +348 -348
  48. package/dist/docs/members.md +183 -183
  49. package/dist/docs/memberships.md +150 -150
  50. package/dist/docs/mobile-admin-container.md +693 -693
  51. package/dist/docs/operations.md +281 -281
  52. package/dist/docs/overview.md +487 -485
  53. package/dist/docs/payments.md +94 -0
  54. package/dist/docs/proof-comms-triggers.md +142 -142
  55. package/dist/docs/proof-ownership-transfer.md +155 -155
  56. package/dist/docs/proof-product-data-scoping.md +462 -462
  57. package/dist/docs/proof-share-grants.md +305 -305
  58. package/dist/docs/realtime.md +149 -139
  59. package/dist/docs/records-admin-pattern.md +304 -304
  60. package/dist/docs/service-accounts.md +64 -64
  61. package/dist/docs/standard-query.md +196 -187
  62. package/dist/docs/tag-codes.md +97 -97
  63. package/dist/docs/tag-ranges.md +106 -106
  64. package/dist/docs/theme-tokens.md +252 -252
  65. package/dist/docs/upgrading-to-3.md +550 -532
  66. package/dist/docs/wallet-passes.md +107 -107
  67. package/dist/docs/websites.md +123 -123
  68. package/dist/http.d.ts +6 -3
  69. package/dist/http.js +48 -19
  70. package/dist/iframeResponder.d.ts +7 -0
  71. package/dist/iframeResponder.js +10 -0
  72. package/dist/index.d.ts +2 -0
  73. package/dist/index.js +2 -0
  74. package/dist/openapi.yaml +426 -3
  75. package/dist/testing/bookingsMemory.d.ts +29 -1
  76. package/dist/testing/bookingsMemory.js +89 -1
  77. package/dist/testing/index.js +4 -1
  78. package/dist/theme-boot.js +82 -82
  79. package/dist/theme.css +75 -75
  80. package/dist/types/appManifest.d.ts +26 -4
  81. package/dist/types/bookings.d.ts +99 -1
  82. package/dist/types/index.d.ts +1 -0
  83. package/dist/types/index.js +1 -0
  84. package/dist/types/payments.d.ts +101 -0
  85. package/dist/types/payments.js +5 -0
  86. package/dist/types/realtime.d.ts +5 -1
  87. package/dist/version.d.ts +1 -1
  88. package/dist/version.js +1 -1
  89. package/docs/API_SUMMARY.md +1086 -858
  90. package/docs/admin-cards.md +189 -189
  91. package/docs/agent-tools.md +156 -156
  92. package/docs/ai-tools-and-skills.md +180 -180
  93. package/docs/ai.md +1721 -1721
  94. package/docs/api-versions.md +85 -85
  95. package/docs/app-data-storage.md +277 -277
  96. package/docs/app-docs.md +73 -73
  97. package/docs/app-manifest.md +852 -852
  98. package/docs/app-records-pattern.md +388 -388
  99. package/docs/appConfig.md +550 -550
  100. package/docs/assistant-apps.md +172 -172
  101. package/docs/assistant-context.md +119 -119
  102. package/docs/bookings.md +105 -8
  103. package/docs/caching.md +32 -3
  104. package/docs/comms.md +689 -689
  105. package/docs/connectors.md +340 -340
  106. package/docs/css-baseline.md +133 -133
  107. package/docs/customer-guide.md +70 -70
  108. package/docs/data-changed.md +91 -0
  109. package/docs/deploying-apps.md +340 -340
  110. package/docs/dpp.md +115 -115
  111. package/docs/entitlements.md +90 -90
  112. package/docs/files.md +69 -69
  113. package/docs/host-dependency-contract.md +252 -252
  114. package/docs/iframe-responder.md +11 -0
  115. package/docs/integrations.md +322 -322
  116. package/docs/interactions.md +544 -544
  117. package/docs/item-context.md +181 -181
  118. package/docs/knowledge.md +105 -105
  119. package/docs/lists.md +157 -157
  120. package/docs/lots.md +112 -112
  121. package/docs/loyalty.md +348 -348
  122. package/docs/members.md +183 -183
  123. package/docs/memberships.md +150 -150
  124. package/docs/mobile-admin-container.md +693 -693
  125. package/docs/operations.md +281 -281
  126. package/docs/overview.md +487 -485
  127. package/docs/payments.md +94 -0
  128. package/docs/proof-comms-triggers.md +142 -142
  129. package/docs/proof-ownership-transfer.md +155 -155
  130. package/docs/proof-product-data-scoping.md +462 -462
  131. package/docs/proof-share-grants.md +305 -305
  132. package/docs/realtime.md +149 -139
  133. package/docs/service-accounts.md +64 -64
  134. package/docs/standard-query.md +196 -187
  135. package/docs/tag-codes.md +97 -97
  136. package/docs/tag-ranges.md +106 -106
  137. package/docs/theme-lookbook.v1.json +120 -120
  138. package/docs/theme-tokens.md +252 -252
  139. package/docs/upgrading-to-3.md +550 -532
  140. package/docs/wallet-passes.md +107 -107
  141. package/docs/websites.md +123 -123
  142. package/openapi.yaml +426 -3
  143. package/package.json +91 -91
  144. package/scripts/headless-check.mjs +87 -87
  145. package/scripts/lib/bare-imports.mjs +57 -57
  146. package/scripts/lib/keyed-app-data.mjs +21 -21
  147. package/scripts/lib/upgrade.mjs +708 -668
  148. package/scripts/publish.mjs +272 -272
  149. package/scripts/register-release.mjs +91 -91
  150. package/scripts/upgrade.mjs +79 -79
  151. package/upgrade/3.json +2 -2
@@ -1,532 +1,550 @@
1
- ---
2
- title: Upgrading to SDK 3
3
- description: What changed between SDK 2 and SDK 3, and how to move each call. The same changes are in upgrade/3.json as data.
4
- category: Platform
5
- ---
6
-
7
- # Upgrading to SDK 3
8
-
9
- SDK 3 is SDK 2 with three things made the same everywhere:
10
-
11
- 1. **Every list returns one shape and pages one way.** `{ items, nextCursor, count? }`, with `limit` and
12
- `cursor`. SDK 2 had nine list shapes and six ways to page.
13
- 2. **Every error has one shape**, with one style of code.
14
- 3. **What was marked deprecated in SDK 2 is gone.**
15
-
16
- Nothing is renamed for its own sake. A call that isn't a list and wasn't deprecated is the same call.
17
-
18
- SDK 3 asks the API for version `2027-01` ([API versions](api-versions.md)). **SDK 2 keeps working**: it
19
- asks for `2026-11`, and the API keeps answering it as it always has. Move when you're ready, one app at a
20
- time.
21
-
22
- The changes below are also in `upgrade/3.json` in this package, as data: one entry for each renamed or
23
- removed name, each list whose shape changed and each option that went. Scripts and AI agents should read
24
- that file; this page explains it.
25
-
26
- ## How to move an app
27
-
28
- Set the dependency to `^3` and install. Update `@proveanything/smartlinks-utils-ui` and
29
- `@proveanything/smartlinks-auth-ui` to their SDK 3 versions if the app uses them. Then run
30
- `npx smartlinks-upgrade`: it shows the move as five passes, with every place left in each.
31
-
32
- **Do the passes in order, one at a time. A pass is finished when its check passes, not when it looks
33
- finished.** Different kinds of change fail in different ways, and the ones nothing complains about are
34
- the ones that get missed when everything is done in one go.
35
-
36
- | | Pass | What it is | Finished when |
37
- |---|---|---|---|
38
- | 1 | `automatic` | The renames and dropped arguments the script makes itself | `npx smartlinks-upgrade --write` has run |
39
- | 2 | `replace` | Calls that no longer exist, and options that went. Each needs a decision | `npx smartlinks-upgrade --check replace` finds nothing |
40
- | 3 | `lists` | Every list returns `{ items, nextCursor, count? }` and takes the standard words | the app type-checks, and `--check lists` finds nothing |
41
- | 4 | `pages` | A list that used to return everything now returns one page: all of them, or a page? | `--check pages` finds nothing |
42
- | 5 | `errors` | Error codes compared as text, the SDK read from `window` | `--check errors` finds nothing |
43
-
44
- Then build, run `npx smartlinks-doctor`, run the app's own tests, and try each screen that lists
45
- something.
46
-
47
- `--check` exits 0 when nothing is left and 2 when something is, so a script or an agent can use it as a
48
- gate. `--check pages` (or any pass) prints only that pass's places.
49
-
50
- **Pass 4 is the one to take slowly.** Nothing else catches it: code that reads `.items` from a list that
51
- used to return everything compiles, runs, and is wrong once there are more than 50. The script counts a
52
- call as decided when it says how many it wants (`limit`), follows the pages (`cursor`, or it sits inside
53
- `all()` / `each()`), or carries a note from a person:
54
-
55
- ```typescript
56
- // sl-upgrade: ok the picker shows the first few on purpose
57
- const { items } = await lots.list(collectionId)
58
- ```
59
-
60
- The same note settles a place in pass 5 that is right as it is. It never excuses a call that no longer
61
- exists.
62
-
63
- Apps built in Forge move with the **Move to SDK 3** upgrade step, which goes through these passes.
64
-
65
- ### What `smartlinks-upgrade` does
66
-
67
- It reads `upgrade/3.json` and your source, and finds SDK calls by what a name is bound to, not by how
68
- it's spelled: `product.get(…)` only counts where `product` is the SDK's (an import, `SL.product`, or a
69
- name taken from one of those). A variable of your own called `product` is never touched.
70
-
71
- | It changes (with `--write`) | It lists for you, by pass |
72
- |---|---|
73
- | Calls that only changed name: `product.get` → `products.get`, `jobs.listJobs` → `jobs.list`, with the import | Every removed call, with what replaces it, and options that went |
74
- | Renamed types, with their imports | Every call to a list whose result changed, and any option it passes that is gone |
75
- | The argument that went from `collection.list` and `authKit.list` | Every call to a list that used to return everything, until it is decided |
76
- | `sharedDependencies` in the manifest, to `v8` | Error codes compared with a dotted or camel-case string |
77
- | | Old `attestation` writes, to leave alone |
78
-
79
- Where the new name is already a variable in a file (`const products = await product.list(…)` is
80
- common), it imports the SDK's under another name: `products as productsApi`. Running it twice changes
81
- nothing the second time. It never installs, builds, commits or releases.
82
-
83
- ## Lists
84
-
85
- Every function that lists returns a `ListResult<T>`:
86
-
87
- ```typescript
88
- // SDK 2: each list had its own shape
89
- const tagList = await tags.list(collectionId) // { tags, limit, offset }
90
- const { orders } = await order.list(collectionId, { offset: 50 }) // { orders, limit, offset }
91
- const all = await products.list(collectionId) // [...]
92
- const page = await app.records.list(collectionId, appId) // { data, pagination: { total, hasMore, … } }
93
-
94
- // SDK 3: one shape
95
- const { items } = await tags.list(collectionId)
96
- const { items, nextCursor } = await order.list(collectionId, { limit: 50 })
97
- const { items, nextCursor } = await products.list(collectionId) // the first 50, not all of them
98
- const { items, count } = await app.records.list(collectionId, appId)
99
- ```
100
-
101
- What to change at each call:
102
-
103
- | SDK 2 | SDK 3 |
104
- |---|---|
105
- | The list itself (`const xs = await x.list()`), or under its own name (`.tags`, `.orders`, `.data`, `.results`, …) | `.items` |
106
- | `total`, `pagination.total`, `page.total` | `count` (the total; absent where the server doesn't know it) |
107
- | `hasMore`, `pagination.hasMore`, `more` | `nextCursor !== null` |
108
- | `offset`, `page`, `startAfter`, `lastId`, `from` used as a place to carry on | `cursor`: pass the last page's `nextCursor` |
109
- | `pageSize`, `perPage` | `limit` |
110
- | `limit` and `offset` echoed back in the answer | gone: you already know what you asked for |
111
- | Other fields beside the list (`meta`, `mode`, `scanned`, …) | still there, beside `items` |
112
-
113
- Paging by offset is gone, so "jump to page 7" is gone with it. Page forward with the cursor; for a
114
- numbered pager, use the [standard query](standard-query.md), which counts and sorts.
115
-
116
- To fetch everything, don't loop by hand:
117
-
118
- ```typescript
119
- import { all, each, tags } from '@proveanything/smartlinks'
120
-
121
- const everyTag = await all((cursor) => tags.list(collectionId, { cursor }))
122
- for await (const t of each((cursor) => tags.list(collectionId, { cursor }))) { /* … */ }
123
- ```
124
-
125
- ### A list is one page now, even where it used to be everything
126
-
127
- This is the change most likely to break an app quietly. In SDK 2 many lists returned everything in one
128
- answer: products, variants, batches, the proofs of a product, forms, templates, lots, claim sets, the
129
- members of a group, an app's config items. In SDK 3 every list returns **50 items unless you pass
130
- `limit`**, and `nextCursor` says whether there are more.
131
-
132
- ```typescript
133
- // SDK 2: every variant of the product
134
- const variants = await variant.list(collectionId, productId)
135
-
136
- // SDK 3, when you need them all (to filter, count, look one up, fill a picker)
137
- const variants = await all((cursor) => variant.list(collectionId, productId, { limit: 200, cursor }))
138
-
139
- // SDK 3, when you show a page
140
- const { items, nextCursor } = await variant.list(collectionId, productId, { limit: 20 })
141
- ```
142
-
143
- The upgrade report marks every such call **"used to return everything"**, and the table at the end of
144
- this guide marks them "one page now". Code that only reads `.items` compiles and runs, and is wrong
145
- once there are more than 50.
146
-
147
- The exception is a small fixed set: a page's widgets, the facet definitions, config fields, the
148
- connectors that exist, a look-up by ids. Those always come back whole, with `nextCursor: null`, and
149
- their functions take no `limit` or `cursor` (the API refuses them). More in [Lists](lists.md).
150
-
151
- ### One word for search, sort, dates and related things
152
-
153
- Where a list can do one of these, it now says it the same way as every other list. The older spelling
154
- is gone from the types, and the API refuses it by name (`This list has no "search" parameter. Use "q".`).
155
-
156
- | To | SDK 2 (varied by list) | SDK 3 |
157
- |---|---|---|
158
- | Search | `search`, `query`, `query.search` | `q` |
159
- | Sort | `sort: 'createdAt:desc'`, `sort` + `order`, `sortBy` + `sortOrder`, `order: 'ASC'` | `orderBy: [{ createdAt: 'desc' }]` |
160
- | Filter on a date field | `createdFrom` / `createdTo`, `recordedAfter` / `recordedBefore`, `query.createdAfter` / `Before`, `createdAt: 'gte:…'` | `createdAt: { gte, lte }` (the field's own name) |
161
- | Bring related things along | `includeItems: true`, `expandFacets`, `includes: ['assets']`, `include` | `expand: ['items']` |
162
- | Time window of a log or schedule | `from` / `to` (`since` on the error log) | `from` / `to` |
163
-
164
- ```typescript
165
- // SDK 2
166
- await app.cases.list(c, appId, { sort: '-createdAt', createdAt: 'gte:2026-11-01' })
167
- await products.query(c, { query: { search: 'oak', updatedAfter: since }, sort: [{ field: 'name', direction: 'asc' }] })
168
- await order.list(c, { includeItems: true })
169
- await knowledge.publicSearch(c, { query: 'descale', k: 3 })
170
-
171
- // SDK 3
172
- await app.cases.list(c, appId, { orderBy: [{ createdAt: 'desc' }], createdAt: { gte: '2026-11-01T00:00:00Z' } })
173
- await products.query(c, { q: 'oak', updatedAt: { gte: since }, orderBy: [{ name: 'asc' }] })
174
- await order.list(c, { expand: ['items'] })
175
- await knowledge.publicSearch(c, { q: 'descale', limit: 3 })
176
- ```
177
-
178
- Three things to watch:
179
-
180
- - **A bare sort field used to mean descending** on app records, cases, threads and bookings
181
- (`sort: 'createdAt'` was newest first). `orderBy` always says the direction.
182
- - **A date is a full date and time.** A plain date, a `gte:` prefix or an operator the list doesn't have
183
- used to be ignored without a word; now it is refused. `gte` and `lte` include the moment you give.
184
- - **A list sorts by the fields it names** and brings along the things it names; anything else is refused,
185
- with the ones it has. The option types list them.
186
-
187
- **A common pattern to fix while you're here:** fetching a whole list and filtering or counting it in the
188
- browser. That worked on small collections and falls over on large ones. Ask the server instead, with the
189
- [standard query](standard-query.md).
190
-
191
- ## Renamed and removed
192
-
193
- Everything marked `@deprecated` in SDK 2 is removed, except the old `attestation` namespace (see
194
- [What hasn't changed](#what-hasnt-changed)).
195
-
196
- <!-- upgrade-table:names:start -->
197
- **Renamed** (the same call under a new name):
198
-
199
- | SDK 2 | SDK 3 | Note |
200
- |---|---|---|
201
- | `ContactSchema` | `ContactSchemaResponse` | |
202
- | `MobileAdminBundleManifest` | `AdminMobileBundleManifest` | |
203
- | `MobileAdminComponentManifest` | `AdminMobileComponentManifest` | |
204
- | `product.clone` | `products.clone` | |
205
- | `product.create` | `products.create` | |
206
- | `product.createClaimWindow` | `products.createClaimWindow` | |
207
- | `product.get` | `products.get` | The whole `product` namespace (singular) is gone: use `products`. |
208
- | `product.getSN` | `products.getSN` | |
209
- | `product.list` | `products.list` | Then treat it as a list: `products.list` returns ListResult<ProductResponse>. |
210
- | `product.listAssets` | `products.listAssets` | Then treat it as a list: `products.listAssets` returns ListResult<AssetResponse>. |
211
- | `product.lookupSN` | `products.lookupSN` | |
212
- | `product.publicCreateClaim` | `products.publicCreateClaim` | |
213
- | `product.publicLookupClaim` | `products.publicLookupClaim` | |
214
- | `product.refresh` | `products.refresh` | |
215
- | `product.remove` | `products.remove` | |
216
- | `product.update` | `products.update` | |
217
- | `product.updateClaimWindow` | `products.updateClaimWindow` | |
218
- | `ScannerEventSubscriber` | `AdminMobileEventCallback` | |
219
- | `async.enqueueAsyncJob` | `jobs.enqueue` | The `async` namespace is gone: starting and following a job live in `jobs` with listing them. |
220
- | `async.getAsyncJobStatus` | `jobs.status` | |
221
- | `jobs.listJobs` | `jobs.list` | Then treat it as a list: `jobs.list` returns ListResult<Job>. |
222
- | `jobs.getJob` | `jobs.get` | |
223
-
224
- **Removed** (no like-for-like call):
225
-
226
- | SDK 2 | Do this instead |
227
- |---|---|
228
- | `ai.generateContent` | Use `ai.chat.completions.create`. A different call: it takes chat messages, not `contents`, and answers in the chat-completions shape (`choices[0].message.content`). `ai.chat.completions.create(collectionId, { messages: [{ role: "user", content }] })`. |
229
- | `Asset.thumbnails` | Use `Asset.thumbnail`. One thumbnail address (`string \| null`), not a map of sizes. |
230
- | `asset.uploadAsset` | Use `asset.upload`. Takes one options object: `asset.upload({ file, scope, … })` (type UploadAssetOptions). |
231
- | `BatchCreateRequest.id` | The server generates the batch id. Don't send one. |
232
- | `comms.queryRecipientsWithAction` | Use `comms.queryRecipientsWithInteraction`. It posted to an address the API never had, so it never worked. The real call takes `interactionId` (not `actionId`) and returns a list of ids, or of `{ id, outcome }` with `includeOutcome: true`. |
233
- | `comms.queryRecipientsWithoutAction` | Use `comms.queryRecipientsWithoutInteraction`. It posted to an address the API never had, so it never worked. The real call takes `interactionId` (not `actionId`) and returns a list of ids. |
234
- | `CommsRecipientsWithActionQuery` | Use `CommsRecipientsWithInteractionQuery`. `actionId` is `interactionId`. |
235
- | `CommsRecipientsWithoutActionQuery` | Use `CommsRecipientsWithoutInteractionQuery`. `actionId` is `interactionId`. |
236
- | `evaluateCondition` | Use `evaluateConditions`. Takes the field's whole condition list: `evaluateConditions(property.conditions, property.showWhen, values)`. |
237
- | `FirebaseTimestamp` | Dates are ISO 8601 strings or a Date: `BatchCreateRequest.expiryDate` and `BatchUpdateRequest.expiryDate` are `string \| Date`. |
238
- | `order.findByProduct` | Use `order.query`. The API never had this address, so the call could only fail. Use `order.query(collectionId, { query: { productId } })`. |
239
- | `order.findItemsByProduct` | Use `order.query`. The API never had this address, so the call could only fail. Use `order.query(collectionId, { query: { productId }, includeItems: true })` and read each order's items. |
240
- | `order.findOrdersByProduct` | Use `order.query`. The API never had this address, so the call could only fail. Use `order.query(collectionId, { query: { productId } })`. |
241
- | `order.getOrderIdsByAttribute` | Use `order.query`. The API never had this address, so the call could only fail. Use `order.query` with `productId`, `batchId` or `variantId` in `query`, and read the ids from `items`. |
242
- | `order.lookup` | Use `order.query`. The API never had this address, so the call could only fail. Find the orders that hold items with `order.query(collectionId, { query: { items: [{ itemType, itemId }] } })`. |
243
- | `product.find` | Use `products.query`. A different body (type ProductQueryRequest). Returns a list and pages with `limit` + `cursor`. |
244
- | `product.publicFind` | Use `products.get` when you know the id, `products.query` to search. The server retired this route some time ago. |
245
- | `realtime.getAdminToken` | Use `realtime.onMine`. The SDK gets its own tokens. Subscribe with `realtime.onMine(scope, onMessage)`. |
246
- | `realtime.getPublicToken` | The SDK gets its own tokens. Subscribe with `realtime.channel(scope, name)` or `realtime.onChange(scope, filter, onChange)`. |
247
- | `site.ready` | Sites are server-rendered and nothing waits for the signal. Delete the call. |
248
- | `VariantCreateRequest.id` | The server generates the variant id. Don't send one. |
249
-
250
- <!-- upgrade-table:names:end -->
251
-
252
- ## Options that went
253
-
254
- These options were accepted by SDK 2 and did nothing, or only worked for an admin. SDK 3's types no
255
- longer have them.
256
-
257
- <!-- upgrade-table:options:start -->
258
- | Function | Option | Why, and what to do |
259
- |---|---|---|
260
- | `asset.list` | `mimeTypePrefix` | No asset list ever read it, so it never filtered anything. Filter the items you get back (`a.mimeType?.startsWith('image/')`), or as an admin use `asset.listAdmin` with `assetType`. |
261
- | `authKit.list` | `admin (the argument)` | There is no public list of AuthKit configs, so the call without `true` always failed. Call `authKit.list(collectionId)`. |
262
- | `bookings.mine` | `contactId` | `mine` is always the caller's own bookings. To list a contact's bookings as an admin use `bookings.list`. |
263
- | `collection.list` | `admin (the argument)` | There is no public list of collections, so `collection.list(false)` always failed. Call `collection.list()`: it lists the collections the signed-in user can work on. |
264
- | `comms.queryRecipientIds` | `journeyStepId` | The server never read it. For one journey step's recipients use `journeysAnalytics.recipients`. |
265
- | `containers.publicList` | `status` | The public list is always the active containers. |
266
- | `containers.publicList` | `ref` | The public list never filtered by ref. |
267
- | `facets.list` | `includeValues` | The list never read it: a facet list has no values. Read one facet with `facets.get(…, { includeValues: true })`, or its values with `facets.listValues`. |
268
- | `facets.publicList` | `includeValues` | The list never read it. Read a facet's values with `facets.publicListValues`. |
269
- | `interactions.publicMyInteractions` | `scope` | The server never read it. |
270
- | `lots.publicList` | `includeDeleted` | Admin only: use `lots.list`. |
271
- | `attestations.summary` | `recordedAfter` | Now `recordedAt: { gte: … }`, the same range the attestation lists take. |
272
- | `attestations.summary` | `recordedBefore` | Now `recordedAt: { lte: … }`, the same range the attestation lists take. |
273
- | `attestations.publicSummary` | `recordedAfter` | Now `recordedAt: { gte: … }`, the same range the attestation lists take. |
274
- | `attestations.publicSummary` | `recordedBefore` | Now `recordedAt: { lte: … }`, the same range the attestation lists take. |
275
- | `attestations.treeSummary` | `recordedAfter` | Now `recordedAt: { gte: … }`, the same range the attestation lists take. |
276
- | `attestations.treeSummary` | `recordedBefore` | Now `recordedAt: { lte: … }`, the same range the attestation lists take. |
277
- | `attestations.publicTreeSummary` | `recordedAfter` | Now `recordedAt: { gte: … }`, the same range the attestation lists take. |
278
- | `attestations.publicTreeSummary` | `recordedBefore` | Now `recordedAt: { lte: … }`, the same range the attestation lists take. |
279
- | `attestations.publicContainerSummary` | `recordedAfter` | Now `recordedAt: { gte: … }`, the same range the attestation lists take. |
280
- | `attestations.publicContainerSummary` | `recordedBefore` | Now `recordedAt: { lte: … }`, the same range the attestation lists take. |
281
- | `attestations.publicContainerTreeSummary` | `recordedAfter` | Now `recordedAt: { gte: … }`, the same range the attestation lists take. |
282
- | `attestations.publicContainerTreeSummary` | `recordedBefore` | Now `recordedAt: { lte: … }`, the same range the attestation lists take. |
283
- <!-- upgrade-table:options:end -->
284
-
285
- ## Errors
286
-
287
- Every error from the API is now `{ error: { code, message, details, requestId } }`. The SDK still throws
288
- `SmartlinksApiError`, so `try`/`catch` code keeps its structure. What changes is what's inside:
289
-
290
- ```typescript
291
- try {
292
- await products.get(collectionId, productId)
293
- } catch (e) {
294
- if (e instanceof SmartlinksApiError) {
295
- e.statusCode // 404
296
- e.errorCode // 'NOT_FOUND' ← check this in code
297
- e.message // for people; may change
298
- e.details // extra facts, e.g. { unknown: ['serach'], allowed: [...] }
299
- e.requestId // quote this when reporting a problem
300
- }
301
- }
302
- ```
303
-
304
- - **Codes are all `UPPER_SNAKE`.** A code that was dotted or camel-case in SDK 2 changes spelling:
305
- `segments.list.failed` is `SEGMENTS_LIST_FAILED`. Search your app for string comparisons against
306
- `errorCode`, `details.errorCode` and `details.error`.
307
- - **Two statuses are corrected.** "Not signed in" used to arrive from some routes as `400`; it is `401`.
308
- "Signed in but not allowed" used to arrive from some routes as `401`; it is `403`. `isAuthError()`
309
- covers both.
310
- - **Don't match on message text.** Messages are for people and are being rewritten. Use `errorCode`.
311
- - **An address that doesn't exist** answers `404 ROUTE_NOT_FOUND` with what was wrong and the nearest
312
- real addresses.
313
- - **A `429`** carries `Retry-After` when the server knows when to try again.
314
-
315
- Not changed: answers from an app's own server functions, and the OpenAI-compatible AI routes, which keep
316
- their own error shapes.
317
-
318
- ## A list refuses options it doesn't read
319
-
320
- In SDK 2 a mistyped or unsupported query option was silently ignored. Now a list answers
321
- `400 UNKNOWN_PARAMETER`, naming the options it does read. Two things this catches in existing apps:
322
-
323
- - one options object shared between an admin call and a public call, carrying an admin-only option
324
- (`includeDeleted`, `status` on public app records, `contactId`, `assignedTo`);
325
- - an option that never existed on that list.
326
-
327
- Pass each list only the options its type has. The types now say which are admin-only.
328
-
329
- ## API version
330
-
331
- `initializeApi({ apiVersion })` can ask for a **newer** version than the SDK was built for. An older one
332
- is ignored: SDK 3's functions return `2027-01` shapes. To stay on `2026-11`, stay on SDK 2.
333
-
334
- ## Apps that run inside the Portal or Hub
335
-
336
- A component doesn't bundle the SDK: it uses the host's copy. So that SDK 2 apps and SDK 3 apps can run
337
- side by side, the shared-dependency contract goes to **v8** with SDK 3
338
- ([host-dependency-contract.md](host-dependency-contract.md)):
339
-
340
- - Build with `SHARED_DEPENDENCY_SPECIFIERS` from SDK 3 as your externals, as before. Your manifest then
341
- says `sharedDependencies: "v8"` and the host gives you SDK 3.
342
- - An older build of your app, and other apps still on SDK 2, keep getting SDK 2. Nothing changes for them.
343
- - The `SL` prop the host hands your component is SDK 3 too. If you read the SDK from the window
344
- global rather than an import, it is `window.SL3` (`window.SL` stays SDK 2).
345
- - Keep building both formats (`moduleFormat: "dual"`). For now the host loads the UMD build of an app
346
- on SDK 3.
347
- - The sign-in UI (`@proveanything/smartlinks-auth-ui`) is the host's one copy, as before.
348
- - `@proveanything/smartlinks-utils-ui` is bundled into your app and calls the SDK itself, so it must be
349
- a version that works on SDK 3.
350
-
351
- ## What the compiler won't catch
352
-
353
- Search for these by hand (or let the Forge step do it):
354
-
355
- - `errorCode` compared with a dotted or camel-case string, and any test on error message text.
356
- - A list result typed `any` (JavaScript files, `as any`, untyped hooks): `.length`, `.map`, `.filter`
357
- on the result itself instead of on `.items`.
358
- - React Query (or other) caches keyed on `offset` or `page`: key on the cursor.
359
- - A list that used to return everything, read as if it still does (`const { items } = await x.list(…)`
360
- with no `limit`, `cursor` or `all`). It compiles. The upgrade report marks each one.
361
- - An options object passed to both the admin and the public form of a list.
362
- - `window.SL` used directly in a v8 build.
363
-
364
- ## What hasn't changed
365
-
366
- - **The old `attestation` namespace** (singular) is still there, still deprecated. Its data hasn't been
367
- moved to the new `attestations` yet, so apps that write with it can't move yet. It goes in a later
368
- release, once the data has moved.
369
- - **Server functions.** `ctx.sl.*` inside an app's server function runs on the server, not through the
370
- SDK, and keeps the shapes it has.
371
- - **The standard query** (`proof.query`, `contact.query`, `products.standardQuery`, `app.records.query`)
372
- already returned `{ items, nextCursor, count? }`.
373
- - **Everything that isn't a list**: get, create, update, delete, actions.
374
-
375
- ## Every list that changed
376
-
377
- <!-- upgrade-table:lists:start -->
378
- 150 functions. `ListResult<T>` is `{ items: T[], nextCursor, count? }`.
379
-
380
- | Function | SDK 2 returned | SDK 3 returns | Options |
381
- |---|---|---|---|
382
- | `adminCards.list` | `{ cards, hidden, layout }` | `ListResult<AdminCard> & { hidden, layout }` | always whole |
383
- | `ai.agent.listTools` | `AgentToolsResponse { tools }` | `ListResult<AgentToolDefinition>` | always whole |
384
- | `ai.skills.list` | `SkillsListResponse { skills }` | `ListResult<SkillDescriptor>` | always whole |
385
- | `analytics.admin.events` | `{ source, limit, offset, sort, count, rows }` | `ListResult<Record<string, any>> & { source, sort }` | no `offset`, `sort`; now `cursor`, `orderBy` |
386
- | `app.cases.list` | `{ data, pagination: { total, limit, offset, hasMore } }` | `ListResult<AppCase>` | no `offset`, `sort`; now `cursor`, `orderBy` |
387
- | `app.options.get` | `{ items, version, mode, total? } | { unchanged: true, version }` | `(ListResult<AppOption> & { version, mode }) | { unchanged: true, version }` | now `limit`, `cursor`; **one page now** |
388
- | `app.records.list` | `{ data, pagination: { total, limit, offset, hasMore } }` | `ListResult<AppRecord>` | no `offset`, `sort`; now `cursor`, `orderBy` |
389
- | `app.records.match` | `{ data, total, strategy }` | `ListResult<MatchEntry> & { strategy }` | now `cursor`, `limit` |
390
- | `app.records.resolveAll` | `{ records, total, context, truncated }` | `ListResult<ResolveAllEntry> & { context, truncated }` | now `cursor`, `limit` |
391
- | `app.threads.list` | `{ data, pagination: { total, limit, offset, hasMore } }` | `ListResult<AppThread>` | no `offset`, `sort`; now `cursor`, `orderBy` |
392
- | `appConfiguration.getData` | `any[]` | `ListResult<any>` | now `limit`, `cursor`; **one page now** |
393
- | `appConfiguration.getWidgets` | `{ apps }` | `ListResult<CollectionAppWidget>` | always whole |
394
- | `asset.list` | `Asset[]` | `ListResult<Asset>` | no `offset`; now `cursor`, `limit`; **one page now** |
395
- | `asset.listAdmin` | `AdminListAssetsResponse { data, total, limit, offset }` | `ListResult<Asset>` | no `offset`, `sort`, `order`; now `cursor`, `orderBy` |
396
- | `asset.listForCollection` | `Asset[]` | `ListResult<Asset>` | now `limit`, `cursor`; **one page now** |
397
- | `asset.listForProduct` | `Asset[]` | `ListResult<Asset>` | now `limit`, `cursor`; **one page now** |
398
- | `asset.listForProof` | `Asset[]` | `ListResult<Asset>` | now `limit`, `cursor`; **one page now** |
399
- | `attestation.list` | `AttestationResponse[]` | `ListResult<AttestationResponse>` | now `limit`, `cursor`; **one page now** |
400
- | `attestations.list` | `{ attestations }` | `ListResult<Attestation>` | no `offset`, `recordedAfter`, `recordedBefore`; now `cursor`, `recordedAt` |
401
- | `attestations.publicContainerList` | `{ attestations, audience }` | `ListResult<Attestation> & { audience }` | no `offset`, `recordedAfter`, `recordedBefore`; now `cursor`, `recordedAt` |
402
- | `attestations.publicList` | `{ attestations, audience }` | `ListResult<Attestation> & { audience }` | no `offset`, `recordedAfter`, `recordedBefore`; now `cursor`, `recordedAt` |
403
- | `authKit.list` | `AuthKitConfig[]` | `ListResult<AuthKitConfig>` | now `limit`, `cursor`; **one page now** |
404
- | `authKit.listTrustedDevices` | `{ devices: TrustedDevice[] }` | `ListResult<TrustedDevice>` | now `limit`, `cursor`; **one page now** |
405
- | `batch.getBatchTags` | `BatchTag[]` | `ListResult<BatchTag>` | now `limit`, `cursor`; **one page now** |
406
- | `batch.list` | `BatchResponse[]` | `ListResult<BatchResponse>` | now `limit`, `cursor`; **one page now** |
407
- | `batch.searchInCollection` | `BatchResponse[]` | `ListResult<BatchResponse>` | no `search`; now `q`, `cursor`, `limit` |
408
- | `bookings.blocks.list` | `PaginatedResponse<BookingAllocation>` | `ListResult<BookingAllocation> (with count)` | no `offset`; now `cursor` |
409
- | `bookings.list` | `PaginatedResponse<Booking> = { data, pagination: { total, limit, offset, hasMore } }` | `ListResult<Booking> (with count)` | no `offset`, `sort`; now `cursor`, `orderBy` |
410
- | `bookings.mine` | `PaginatedResponse<Booking>` | `ListResult<Booking> (with count)` | no `offset`, `sort`; now `cursor`, `orderBy` |
411
- | `bookings.slots.list` | `PaginatedResponse<BookingSlot>` | `ListResult<BookingSlot> (with count)` | no `offset`, `sort`; now `cursor`, `orderBy` |
412
- | `broadcasts.list` | `BroadcastList = { items, limit, offset }` | `ListResult<BroadcastRecord>` | no `offset`; now `cursor` |
413
- | `broadcasts.recipients` | `{ items, total, limit, offset, note? }` | `ListResult<Recipient> & { note?: string } (with count)` | no `offset`; now `cursor` |
414
- | `claimSet.getAll` | `any[]` | `ListResult<any>` | now `limit`, `cursor`; **one page now** |
415
- | `claimSet.getAssignedTags` | `any (the claim set with its tags in tags)` | `ListResult<any> & Record<string, any>` | now `limit`, `cursor`; **one page now** |
416
- | `claimSet.ranges.list` | `ClaimSetRange[]` | `ListResult<ClaimSetRange>` | now `limit`, `cursor`; **one page now** |
417
- | `claimSet.ranges.tags` | `ClaimSetRangeTagsPage { tags, next }` | `ListResult<ClaimSetRangeTag>` | no `from`; now `cursor` |
418
- | `collection.getUsers` | `CollectionUser[]` | `ListResult<CollectionUser>` | now `limit`, `cursor`; **one page now** |
419
- | `collection.list` | `CollectionResponse[]` | `ListResult<CollectionResponse>` | now `limit`, `cursor`; **one page now** |
420
- | `comms.listMethods` | `{ ok: true, methods: CommMethod[] }` | `ListResult<CommMethod>` | always whole |
421
- | `comms.queryByUser` | `CommunicationEvent[]` | `ListResult<CommunicationEvent>` | now `cursor`, `limit` |
422
- | `comms.queryRecipientIds` | `RecipientId[]` | `ListResult<RecipientId>` | now `cursor`, `limit` |
423
- | `conditions.list` | `SavedCondition[]` | `ListResult<SavedCondition>` | now `limit`, `cursor`; **one page now** |
424
- | `config.getFields` | `FieldDefinition[]` | `ListResult<FieldDefinition>` | always whole |
425
- | `config.getProofTypes` | `ProofTypeDefinition[]` | `ListResult<ProofTypeDefinition>` | always whole |
426
- | `contact.findDuplicates` | `{ pairs, scanned, more }` | `ListResult<ContactDuplicatePair> & { scanned: number }` | no `offset`; now `cursor` |
427
- | `contact.list` | `ContactListResponse = { items, limit, offset }` | `ListResult<Contact>` | no `offset`; now `cursor` |
428
- | `contact.search` | `ContactSearchResponse = { items, limit, offset }` | `ListResult<Contact>` | no `offset`, `createdFrom`, `createdTo`; now `cursor`, `createdAt` |
429
- | `containers.findForItem` | `{ items: ContainerItem[], containers: Container[] }` | `ListResult<ContainerItem> & { containers: Container[] }` | now `limit`, `cursor`; **one page now** |
430
- | `containers.list` | `ListContainersResponse = { containers, limit, offset }` | `ListResult<Container>` | no `offset`; now `cursor` |
431
- | `containers.listItems` | `ContainerItemsResponse = { items, limit, offset }` | `ListResult<ContainerItem>` | no `offset`; now `cursor` |
432
- | `containers.publicList` | `PublicListContainersResponse = { containers }` | `ListResult<Container>` | no `offset`; now `cursor` |
433
- | `containers.publicListItems` | `ContainerItemsResponse = { items, limit, offset }` | `ListResult<ContainerItem>` | no `limit`, `offset`; now `limit`, `cursor`; **one page now** |
434
- | `crate.list` | `ListCratesResponse = { items, hasMore, lastId }` | `ListResult<Crate>` | no `startAfter`; now `cursor` |
435
- | `dpp.groups` | `DppGroup[] (the function unwrapped { groups })` | `ListResult<DppGroup>` | always whole |
436
- | `dpp.passports.list` | `DppPassport[] (unwrapped { passports })` | `ListResult<DppPassport>` | no `offset`; now `cursor` |
437
- | `dpp.passports.versions` | `DppPassportVersion[] (unwrapped { versions })` | `ListResult<DppPassportVersion>` | now `limit`, `cursor`; **one page now** |
438
- | `dpp.registry.list` | `DppRegistry[] (unwrapped { registries })` | `ListResult<DppRegistry>` | always whole |
439
- | `dpp.tasks.list` | `DppTask[] (unwrapped { tasks })` | `ListResult<DppTask>` | now `limit`, `cursor`; **one page now** |
440
- | `facets.list` | `FacetListResponse = { items }` | `ListResult<FacetDefinition>` | always whole |
441
- | `facets.listValues` | `FacetValueListResponse = { facet, items }` | `ListResult<FacetValue> & { facet: FacetDefinition }` | now `limit`, `cursor`; **one page now** |
442
- | `facets.namespaces` | `FacetNamespaceListResponse = { namespaces: string[] }` | `ListResult<string>` | always whole |
443
- | `facets.publicList` | `FacetListResponse = { items }` | `ListResult<FacetDefinition>` | always whole |
444
- | `facets.publicListValues` | `FacetValueListResponse = { facet, items }` | `ListResult<FacetValue> & { facet: FacetDefinition }` | now `limit`, `cursor`; **one page now** |
445
- | `facets.publicNamespaces` | `FacetNamespaceListResponse = { namespaces: string[] }` | `ListResult<string>` | always whole |
446
- | `facets.publicQuery` | `FacetQueryResponse = { items, buckets, meta? }` | `ListResult<{ facet, values }> & { buckets: FacetBucket[], meta? }` | no `query.search`, `query.createdAfter`, `query.createdBefore`, `query.updatedAfter`, `query.updatedBefore`; now `q`, `createdAt`, `updatedAt`; always whole |
447
- | `facets.query` | `FacetQueryResponse = { items, buckets, meta? }` | `ListResult<{ facet, values }> & { buckets: FacetBucket[], meta? }` | no `query.search`, `query.createdAfter`, `query.createdBefore`, `query.updatedAfter`, `query.updatedBefore`; now `q`, `createdAt`, `updatedAt`; always whole |
448
- | `files.list` | `{ ok: true, files: FileRecord[] }` | `ListResult<FileRecord>` | now `cursor`, `limit` |
449
- | `form.list` | `any[]` | `ListResult<any>` | now `limit`, `cursor`; **one page now** |
450
- | `integrations.listConnectorActions` | `{ actions }` | `ListResult<{ name, title, description?, visibility, input?, output? }>` | always whole |
451
- | `integrations.listConnectors` | `{ connectors }` | `ListResult<InstalledConnector>` | always whole |
452
- | `integrations.listEntityRuns` | `{ runs, nextCursor? }` | `ListResult<FlowRun>` | now `cursor`, `limit` |
453
- | `integrations.listFailed` | `{ direction, items, nextCursor }` | `ListResult<FailedRecord> & { direction: FlowDirection }` | |
454
- | `integrations.listFlows` | `{ flows }` | `ListResult<IntegrationFlow>` | now `limit`, `cursor`; **one page now** |
455
- | `integrations.listRecordTypes` | `{ recordTypes }` | `ListResult<RecordTypeInfo>` | always whole |
456
- | `integrations.listRunItems` | `{ items, nextCursor? }` | `ListResult<FlowRunItem>` | |
457
- | `integrations.listRuns` | `{ runs, nextCursor? }` | `ListResult<FlowRun>` | |
458
- | `interactions.list` | `{ items, limit, offset }` | `ListResult<InteractionTypeRecord>` | no `offset`; now `cursor` |
459
- | `interactions.publicList` | `{ items, limit, offset }` | `ListResult<InteractionTypeRecord>` | no `offset`; now `cursor` |
460
- | `interactions.publicMyInteractions` | `InteractionEventRow[]` | `ListResult<InteractionEventRow>` | now `cursor`, `limit` |
461
- | `interactions.query` | `InteractionEventRow[]` | `ListResult<InteractionEventRow>` | no `order`, `include`; now `cursor`, `orderBy`, `expand`, `limit` |
462
- | `jobs.list` | `{ items, limit, offset }` | `ListResult<Job>` | no `offset`; now `cursor` |
463
- | `journeys.list` | `{ items, limit, offset }` | `ListResult<JourneyRecord>` | no `offset`; now `cursor` |
464
- | `journeysAnalytics.recipients` | `string[]` | `ListResult<string>` | now `cursor`, `limit` |
465
- | `knowledge.listSets` | `KnowledgeSet[]` | `ListResult<KnowledgeSet>` | now `limit`, `cursor`; **one page now** |
466
- | `knowledge.listSources` | `KnowledgeSource[]` | `ListResult<KnowledgeSource>` | now `limit`, `cursor`; **one page now** |
467
- | `knowledge.publicSearch` | `KnowledgeSearchResponse { query, results, mode }` | `ListResult<KnowledgeSearchResult> & Pick<KnowledgeSearchResponse, 'query' | 'mode'>` | no `query`, `k`; now `q`, `limit`, `cursor` |
468
- | `knowledge.search` | `{ query, results, mode }` | `ListResult<KnowledgeSearchResult> & { query, mode }` | no `query`, `k`; now `q`, `limit`, `cursor` |
469
- | `location.search` | `{ items, count }` | `ListResult<Location>` | no `sort`; now `cursor`, `orderBy`, `limit` |
470
- | `lots.list` | `Lot[] (the SDK unwrapped { lots })` | `ListResult<Lot>` | no `search`; now `limit`, `cursor`, `q`; **one page now** |
471
- | `lots.listProducts` | `{ products, total, page, limit }` | `ListResult<LotProductSummary>` | no `page`; now `cursor` |
472
- | `lots.publicList` | `Lot[] (the SDK unwrapped { lots })` | `ListResult<Lot>` | no `search`; now `limit`, `cursor`, `q`; **one page now** |
473
- | `lots.publicListProducts` | `{ products, total, page, limit }` | `ListResult<LotProductSummary>` | no `page`; now `cursor` |
474
- | `loyalty.getMemberHistory` | `{ items, limit, offset }` | `ListResult<LoyaltyTransaction>` | no `offset`; now `cursor` |
475
- | `loyalty.list` | `LoyaltyScheme[]` | `ListResult<LoyaltyScheme>` | now `limit`, `cursor`; **one page now** |
476
- | `loyalty.listEarningRules` | `LoyaltyEarningRule[]` | `ListResult<LoyaltyEarningRule>` | now `limit`, `cursor`; **one page now** |
477
- | `loyalty.listMembers` | `{ items, limit, offset }` | `ListResult<LoyaltyMember>` | no `offset`; now `cursor` |
478
- | `loyalty.publicGetMe` | `LoyaltySchemeWithMembership[]` | `ListResult<LoyaltySchemeWithMembership>` | now `limit`, `cursor`; **one page now** |
479
- | `loyalty.publicGetMineHistory` | `{ items, limit, offset }` | `ListResult<LoyaltyTransaction>` | no `offset`; now `cursor` |
480
- | `loyalty.publicList` | `LoyaltyScheme[]` | `ListResult<LoyaltyScheme>` | now `limit`, `cursor`; **one page now** |
481
- | `loyalty.publicListEarningRules` | `LoyaltyEarningRule[]` | `ListResult<LoyaltyEarningRule>` | now `limit`, `cursor`; **one page now** |
482
- | `nfc.lookupTag` | `NfcTagInfo[]` | `ListResult<NfcTagInfo>` | always whole |
483
- | `order.getItems` | `{ items, limit, offset }` | `ListResult<OrderItem>` | no `offset`; now `cursor` |
484
- | `order.getLocationHistory` | `{ orderRef, orderId, locations, count }` | `ListResult<LocationScan> & { orderRef: string; orderId: string }` | now `cursor`, `limit` |
485
- | `order.getTimeline` | `{ orderRef, orderId, timeline, count }` | `ListResult<TagScanEvent> & { orderRef: string; orderId: string }` | now `cursor`, `limit` |
486
- | `order.list` | `{ orders, limit, offset }` | `ListResult<Order>` | no `offset`, `includeItems`; now `cursor`, `expand` |
487
- | `order.query` | `{ orders, limit, offset }` | `ListResult<Order>` | no `offset`, `query.sortBy`, `query.sortOrder`, `query.createdAfter`, `query.createdBefore`, `query.updatedAfter`, `query.updatedBefore`, `includeItems`; now `cursor`, `orderBy`, `createdAt`, `updatedAt`, `expand` |
488
- | `partner.claimSets` | `PartnerClaimSet[]` | `ListResult<PartnerClaimSet>` | now `limit`, `cursor`; **one page now** |
489
- | `partner.list` | `Partner[]` | `ListResult<Partner>` | now `limit`, `cursor`; **one page now** |
490
- | `partner.lookupTags` | `PartnerTagHit[]` | `ListResult<PartnerTagHit>` | always whole |
491
- | `partner.tagAttempts` | `ClientErrorEvent[]` | `ListResult<ClientErrorEvent>` | now `limit`, `cursor` |
492
- | `products.list` | `ProductResponse[]` | `ListResult<ProductResponse>` | now `limit`, `cursor`, `expand`; **one page now** |
493
- | `products.listAssets` | `unknown` | `ListResult<AssetResponse>` | now `limit`, `cursor`; **one page now** |
494
- | `products.query` | `{ items, page: { limit, offset, returned, total, hasMore, nextCursor }, meta }` | `ListResult<ProductResponse> & { meta?: ProductQueryMeta }` | no `page.limit`, `page.offset`, `page.cursor`, `query.search`, `sort`, `query.createdAfter`, `query.createdBefore`, `query.updatedAfter`, `query.updatedBefore`; now `limit`, `cursor`, `q`, `orderBy`, `createdAt`, `updatedAt`, `expand` |
495
- | `proof.findByProduct` | `ProofResponse[]` | `ListResult<ProofResponse>` | no `lastCursor`, `page`, `perPage`, `includes`; now `limit`, `cursor`, `expand` |
496
- | `proof.getByBatch` | `ProofResponse[]` | `ListResult<ProofResponse>` | now `limit`, `cursor`; **one page now** |
497
- | `proof.getByProduct` | `ProofResponse[]` | `ListResult<ProofResponse>` | now `limit`, `cursor`; **one page now** |
498
- | `proof.getByUser` | `ProofResponse[]` | `ListResult<ProofResponse>` | now `limit`, `cursor`; **one page now** |
499
- | `proof.list` | `ProofResponse[]` | `ListResult<ProofResponse>` | no `include`; now `limit`, `cursor`, `expand`; **one page now** |
500
- | `proof.listGrants` | `ProofGrant[]` | `ListResult<ProofGrant>` | now `limit`, `cursor`; **one page now** |
501
- | `secrets.list` | `SecretList { secrets }` | `ListResult<SecretMeta>` | always whole |
502
- | `secrets.listOwn` | `SecretList { secrets }` | `ListResult<SecretMeta>` | always whole |
503
- | `segments.list` | `{ items, limit, offset }` | `ListResult<SegmentRecord>` | no `offset`; now `cursor` |
504
- | `segments.recipients` | `{ items, limit, offset, total, note? }` | `ListResult<Recipient> & { note?: string }` | no `offset`; now `cursor` |
505
- | `serviceAccounts.list` | `{ serviceAccounts, access }` | `ListResult<ServiceAccount> & { access: ServiceAccountAccess[] }` | now `limit`, `cursor`; **one page now** |
506
- | `shop.admin.listOrders` | `{ items, total, limit, offset }` | `ListResult<ShopAdminOrder>` | no `offset`; now `cursor` |
507
- | `shop.admin.listPrices` | `{ items, total, limit, offset }` | `ListResult<ShopPrice>` | no `offset`; now `cursor` |
508
- | `shop.myOrders` | `{ items, total, limit, offset }` | `ListResult<ShopBuyerOrder>` | no `offset`; now `cursor` |
509
- | `shop.products` | `{ currency, items }` | `ListResult<ShopProduct> & { currency: string }` | now `limit`, `cursor`; **one page now** |
510
- | `subscriptions.admin.list` | `{ items, total, limit, offset }` | `ListResult<Membership>` | no `offset`; now `cursor` |
511
- | `subscriptions.admin.listPlans` | `{ items, total, limit, offset }` | `ListResult<PlanWithPrices>` | no `offset`; now `cursor` |
512
- | `subscriptions.mine` | `MySubscription[]` | `ListResult<MySubscription>` | now `limit`, `cursor`; **one page now** |
513
- | `subscriptions.plans` | `PublicPlan[]` | `ListResult<PublicPlan>` | now `limit`, `cursor`; **one page now** |
514
- | `tags.byRef` | `{ tags }` | `ListResult<Tag>` | now `limit`, `cursor`; **one page now** |
515
- | `tags.list` | `{ tags, limit, offset }` | `ListResult<Tag>` | no `offset`; now `cursor` |
516
- | `tags.lookupTags` | `{ count, tags, embedded }` | `ListResult<Tag> & { count: number; embedded: TagEmbedded }` | always whole |
517
- | `tags.lookupTagsQuery` | `{ count, tags, embedded }` | `ListResult<Tag> & { count: number; embedded: TagEmbedded }` | always whole |
518
- | `tags.publicByRef` | `{ tags, embedded }` | `ListResult<Tag> & { embedded: TagEmbedded }` | now `limit`, `cursor`; **one page now** |
519
- | `tags.publicByRefPost` | `{ tags, embedded }` | `ListResult<Tag> & { embedded: TagEmbedded }` | now `limit`, `cursor`; **one page now** |
520
- | `template.getAll` | `Template[]` | `ListResult<Template>` | now `limit`, `cursor`; **one page now** |
521
- | `template.getAllowed` | `TemplatePublic[]` | `ListResult<TemplatePublic>` | now `limit`, `cursor`; **one page now** |
522
- | `template.getAllowedGlobal` | `TemplatePublic[]` | `ListResult<TemplatePublic>` | now `limit`, `cursor`; **one page now** |
523
- | `translations.list` | `{ items, total?, limit?, offset? }` | `ListResult<TranslationRecord>` | no `offset`; now `cursor` |
524
- | `userAppData.list` | `any[]` | `ListResult<any>` | now `limit`, `cursor`; **one page now** |
525
- | `userGroups.history` | `UserGroupChange[]` | `ListResult<UserGroupChange>` | now `cursor`, `limit` |
526
- | `userGroups.list` | `UserGroup[]` | `ListResult<UserGroup>` | now `limit`, `cursor`; **one page now** |
527
- | `userGroups.members` | `UserGroupMember[]` | `ListResult<UserGroupMember>` | now `limit`, `cursor`; **one page now** |
528
- | `userGroups.ofUser` | `UserGroupRef[]` | `ListResult<UserGroupRef>` | now `limit`, `cursor`; **one page now** |
529
- | `variant.list` | `VariantResponse[]` | `ListResult<VariantResponse>` | now `limit`, `cursor`; **one page now** |
530
- | `wallet.list` | `{ ok: true, passes }` | `ListResult<WalletPass>` | now `limit`, `cursor`; **one page now** |
531
- | `wallet.mine` | `{ ok: true, passes }` | `ListResult<WalletPassSummary>` | now `limit`, `cursor`; **one page now** |
532
- <!-- upgrade-table:lists:end -->
1
+ ---
2
+ title: Upgrading to SDK 3
3
+ description: What changed between SDK 2 and SDK 3, and how to move each call. The same changes are in upgrade/3.json as data.
4
+ category: Platform
5
+ ---
6
+
7
+ # Upgrading to SDK 3
8
+
9
+ SDK 3 is SDK 2 with three things made the same everywhere:
10
+
11
+ 1. **Every list returns one shape and pages one way.** `{ items, nextCursor, count? }`, with `limit` and
12
+ `cursor`. SDK 2 had nine list shapes and six ways to page.
13
+ 2. **Every error has one shape**, with one style of code.
14
+ 3. **What was marked deprecated in SDK 2 is gone.**
15
+
16
+ Nothing is renamed for its own sake. A call that isn't a list and wasn't deprecated is the same call.
17
+
18
+ SDK 3 asks the API for version `2027-01` ([API versions](api-versions.md)). **SDK 2 keeps working**: it
19
+ asks for `2026-11`, and the API keeps answering it as it always has. Move when you're ready, one app at a
20
+ time.
21
+
22
+ The changes below are also in `upgrade/3.json` in this package, as data: one entry for each renamed or
23
+ removed name, each list whose shape changed and each option that went. Scripts and AI agents should read
24
+ that file; this page explains it.
25
+
26
+ ## How to move an app
27
+
28
+ Set the dependency to `^3` and install. Update `@proveanything/smartlinks-utils-ui` and
29
+ `@proveanything/smartlinks-auth-ui` to their SDK 3 versions if the app uses them. Then run
30
+ `npx smartlinks-upgrade`: it shows the move as five passes, with every place left in each.
31
+
32
+ **Do the passes in order, one at a time. A pass is finished when its check passes, not when it looks
33
+ finished.** Different kinds of change fail in different ways, and the ones nothing complains about are
34
+ the ones that get missed when everything is done in one go.
35
+
36
+ | | Pass | What it is | Finished when |
37
+ |---|---|---|---|
38
+ | 1 | `automatic` | The renames and dropped arguments the script makes itself | `npx smartlinks-upgrade --write` has run |
39
+ | 2 | `replace` | Calls that no longer exist, and options that went. Each needs a decision | `npx smartlinks-upgrade --check replace` finds nothing |
40
+ | 3 | `lists` | Every list returns `{ items, nextCursor, count? }` and takes the standard words | the app type-checks, and `--check lists` finds nothing |
41
+ | 4 | `pages` | A list that used to return everything now returns one page: all of them, or a page? | `--check pages` finds nothing |
42
+ | 5 | `errors` | Error codes compared as text, the SDK read from `window` | `--check errors` finds nothing |
43
+
44
+ Then build, run `npx smartlinks-doctor`, run the app's own tests, and try each screen that lists
45
+ something.
46
+
47
+ `--check` exits 0 when nothing is left and 2 when something is, so a script or an agent can use it as a
48
+ gate. `--check pages` (or any pass) prints only that pass's places.
49
+
50
+ **In pass 3, `any` hides a call from the type-check.** `(SL as any).batch.list(…)` or
51
+ `const res: any = await x.list()` compiles whatever it does with the answer, so the type-check passes
52
+ without having looked at it. On the first real app moved, 11 of its 17 list calls were like this. The
53
+ script marks each one **typed `any`** and the pass is not finished while any is left: take the `any`
54
+ away so the type-check can do the work, or go through the call and note it (`// sl-upgrade: ok <why>`).
55
+
56
+ **Pass 4 is the one to take slowly.** Nothing else catches it: code that reads `.items` from a list that
57
+ used to return everything compiles, runs, and is wrong once there are more than 50. The script counts a
58
+ call as decided when it says how many it wants (`limit`), follows the pages (`cursor`, or it sits inside
59
+ `all()` / `each()`), or carries a note from a person:
60
+
61
+ ```typescript
62
+ // sl-upgrade: ok the picker shows the first few on purpose
63
+ const { items } = await lots.list(collectionId)
64
+ ```
65
+
66
+ The same note settles a place in pass 5 that is right as it is. It never excuses a call that no longer
67
+ exists.
68
+
69
+ Apps built in Forge move with the **Move to SDK 3** upgrade step, which goes through these passes.
70
+
71
+ ### An app that embeds other apps
72
+
73
+ A few apps load other apps' widgets themselves, with a loader of their own, instead of the host's
74
+ `EmbeddedWidget` prop. **Such an app should not move to SDK 3 until it uses the host's `EmbeddedWidget`.**
75
+ Its loader hands its own SDK to whatever it embeds, and puts it on `window.SL`. On SDK 3 that gives SDK 3
76
+ to every embedded app built for SDK 2, and replaces the page's SDK 2 for every other older app on the
77
+ page. The host's `EmbeddedWidget` chooses the SDK each embedded app was built for.
78
+
79
+ The script flags this in pass 5 (a loader that names the SDK's global, or that puts things on `window`),
80
+ and `smartlinks-doctor` warns about a hand-rolled loader on any SDK. The rule behind it: `window.SL` is the
81
+ host's, and is SDK 2. An app on SDK 3 never writes to it.
82
+
83
+ ### What `smartlinks-upgrade` does
84
+
85
+ It reads `upgrade/3.json` and your source, and finds SDK calls by what a name is bound to, not by how
86
+ it's spelled: `product.get(…)` only counts where `product` is the SDK's (an import, `SL.product`, or a
87
+ name taken from one of those). A variable of your own called `product` is never touched.
88
+
89
+ | It changes (with `--write`) | It lists for you, by pass |
90
+ |---|---|
91
+ | Calls that only changed name: `product.get` → `products.get`, `jobs.listJobs` → `jobs.list`, with the import | Every removed call, with what replaces it, and options that went |
92
+ | Renamed types, with their imports | Every call to a list whose result changed, and any option it passes that is gone |
93
+ | The argument that went from `collection.list` and `authKit.list` | Every call to a list that used to return everything, until it is decided |
94
+ | `sharedDependencies` in the manifest, to `v8` | Error codes compared with a dotted or camel-case string |
95
+ | | Old `attestation` writes, to leave alone |
96
+
97
+ Where the new name is already a variable in a file (`const products = await product.list(…)` is
98
+ common), it imports the SDK's under another name: `products as productsApi`. Running it twice changes
99
+ nothing the second time. It never installs, builds, commits or releases.
100
+
101
+ ## Lists
102
+
103
+ Every function that lists returns a `ListResult<T>`:
104
+
105
+ ```typescript
106
+ // SDK 2: each list had its own shape
107
+ const tagList = await tags.list(collectionId) // { tags, limit, offset }
108
+ const { orders } = await order.list(collectionId, { offset: 50 }) // { orders, limit, offset }
109
+ const all = await products.list(collectionId) // [...]
110
+ const page = await app.records.list(collectionId, appId) // { data, pagination: { total, hasMore, … } }
111
+
112
+ // SDK 3: one shape
113
+ const { items } = await tags.list(collectionId)
114
+ const { items, nextCursor } = await order.list(collectionId, { limit: 50 })
115
+ const { items, nextCursor } = await products.list(collectionId) // the first 50, not all of them
116
+ const { items, count } = await app.records.list(collectionId, appId)
117
+ ```
118
+
119
+ What to change at each call:
120
+
121
+ | SDK 2 | SDK 3 |
122
+ |---|---|
123
+ | The list itself (`const xs = await x.list()`), or under its own name (`.tags`, `.orders`, `.data`, `.results`, …) | `.items` |
124
+ | `total`, `pagination.total`, `page.total` | `count` (the total; absent where the server doesn't know it) |
125
+ | `hasMore`, `pagination.hasMore`, `more` | `nextCursor !== null` |
126
+ | `offset`, `page`, `startAfter`, `lastId`, `from` used as a place to carry on | `cursor`: pass the last page's `nextCursor` |
127
+ | `pageSize`, `perPage` | `limit` |
128
+ | `limit` and `offset` echoed back in the answer | gone: you already know what you asked for |
129
+ | Other fields beside the list (`meta`, `mode`, `scanned`, …) | still there, beside `items` |
130
+
131
+ Paging by offset is gone, so "jump to page 7" is gone with it. Page forward with the cursor; for a
132
+ numbered pager, use the [standard query](standard-query.md), which counts and sorts.
133
+
134
+ To fetch everything, don't loop by hand:
135
+
136
+ ```typescript
137
+ import { all, each, tags } from '@proveanything/smartlinks'
138
+
139
+ const everyTag = await all((cursor) => tags.list(collectionId, { cursor }))
140
+ for await (const t of each((cursor) => tags.list(collectionId, { cursor }))) { /* … */ }
141
+ ```
142
+
143
+ ### A list is one page now, even where it used to be everything
144
+
145
+ This is the change most likely to break an app quietly. In SDK 2 many lists returned everything in one
146
+ answer: products, variants, batches, the proofs of a product, forms, templates, lots, claim sets, the
147
+ members of a group, an app's config items. In SDK 3 every list returns **50 items unless you pass
148
+ `limit`**, and `nextCursor` says whether there are more.
149
+
150
+ ```typescript
151
+ // SDK 2: every variant of the product
152
+ const variants = await variant.list(collectionId, productId)
153
+
154
+ // SDK 3, when you need them all (to filter, count, look one up, fill a picker)
155
+ const variants = await all((cursor) => variant.list(collectionId, productId, { limit: 200, cursor }))
156
+
157
+ // SDK 3, when you show a page
158
+ const { items, nextCursor } = await variant.list(collectionId, productId, { limit: 20 })
159
+ ```
160
+
161
+ The upgrade report marks every such call **"used to return everything"**, and the table at the end of
162
+ this guide marks them "one page now". Code that only reads `.items` compiles and runs, and is wrong
163
+ once there are more than 50.
164
+
165
+ The exception is a small fixed set: a page's widgets, the facet definitions, config fields, the
166
+ connectors that exist, a look-up by ids. Those always come back whole, with `nextCursor: null`, and
167
+ their functions take no `limit` or `cursor` (the API refuses them). More in [Lists](lists.md).
168
+
169
+ ### One word for search, sort, dates and related things
170
+
171
+ Where a list can do one of these, it now says it the same way as every other list. The older spelling
172
+ is gone from the types, and the API refuses it by name (`This list has no "search" parameter. Use "q".`).
173
+
174
+ | To | SDK 2 (varied by list) | SDK 3 |
175
+ |---|---|---|
176
+ | Search | `search`, `query`, `query.search` | `q` |
177
+ | Sort | `sort: 'createdAt:desc'`, `sort` + `order`, `sortBy` + `sortOrder`, `order: 'ASC'` | `orderBy: [{ createdAt: 'desc' }]` |
178
+ | Filter on a date field | `createdFrom` / `createdTo`, `recordedAfter` / `recordedBefore`, `query.createdAfter` / `Before`, `createdAt: 'gte:…'` | `createdAt: { gte, lte }` (the field's own name) |
179
+ | Bring related things along | `includeItems: true`, `expandFacets`, `includes: ['assets']`, `include` | `expand: ['items']` |
180
+ | Time window of a log or schedule | `from` / `to` (`since` on the error log) | `from` / `to` |
181
+
182
+ ```typescript
183
+ // SDK 2
184
+ await app.cases.list(c, appId, { sort: '-createdAt', createdAt: 'gte:2026-11-01' })
185
+ await products.query(c, { query: { search: 'oak', updatedAfter: since }, sort: [{ field: 'name', direction: 'asc' }] })
186
+ await order.list(c, { includeItems: true })
187
+ await knowledge.publicSearch(c, { query: 'descale', k: 3 })
188
+
189
+ // SDK 3
190
+ await app.cases.list(c, appId, { orderBy: [{ createdAt: 'desc' }], createdAt: { gte: '2026-11-01T00:00:00Z' } })
191
+ await products.query(c, { q: 'oak', updatedAt: { gte: since }, orderBy: [{ name: 'asc' }] })
192
+ await order.list(c, { expand: ['items'] })
193
+ await knowledge.publicSearch(c, { q: 'descale', limit: 3 })
194
+ ```
195
+
196
+ Three things to watch:
197
+
198
+ - **A bare sort field used to mean descending** on app records, cases, threads and bookings
199
+ (`sort: 'createdAt'` was newest first). `orderBy` always says the direction.
200
+ - **A date is a full date and time.** A plain date, a `gte:` prefix or an operator the list doesn't have
201
+ used to be ignored without a word; now it is refused. `gte` and `lte` include the moment you give.
202
+ - **A list sorts by the fields it names** and brings along the things it names; anything else is refused,
203
+ with the ones it has. The option types list them.
204
+
205
+ **A common pattern to fix while you're here:** fetching a whole list and filtering or counting it in the
206
+ browser. That worked on small collections and falls over on large ones. Ask the server instead, with the
207
+ [standard query](standard-query.md).
208
+
209
+ ## Renamed and removed
210
+
211
+ Everything marked `@deprecated` in SDK 2 is removed, except the old `attestation` namespace (see
212
+ [What hasn't changed](#what-hasnt-changed)).
213
+
214
+ <!-- upgrade-table:names:start -->
215
+ **Renamed** (the same call under a new name):
216
+
217
+ | SDK 2 | SDK 3 | Note |
218
+ |---|---|---|
219
+ | `ContactSchema` | `ContactSchemaResponse` | |
220
+ | `MobileAdminBundleManifest` | `AdminMobileBundleManifest` | |
221
+ | `MobileAdminComponentManifest` | `AdminMobileComponentManifest` | |
222
+ | `product.clone` | `products.clone` | |
223
+ | `product.create` | `products.create` | |
224
+ | `product.createClaimWindow` | `products.createClaimWindow` | |
225
+ | `product.get` | `products.get` | The whole `product` namespace (singular) is gone: use `products`. |
226
+ | `product.getSN` | `products.getSN` | |
227
+ | `product.list` | `products.list` | Then treat it as a list: `products.list` returns ListResult<ProductResponse>. |
228
+ | `product.listAssets` | `products.listAssets` | Then treat it as a list: `products.listAssets` returns ListResult<AssetResponse>. |
229
+ | `product.lookupSN` | `products.lookupSN` | |
230
+ | `product.publicCreateClaim` | `products.publicCreateClaim` | |
231
+ | `product.publicLookupClaim` | `products.publicLookupClaim` | |
232
+ | `product.refresh` | `products.refresh` | |
233
+ | `product.remove` | `products.remove` | |
234
+ | `product.update` | `products.update` | |
235
+ | `product.updateClaimWindow` | `products.updateClaimWindow` | |
236
+ | `ScannerEventSubscriber` | `AdminMobileEventCallback` | |
237
+ | `async.enqueueAsyncJob` | `jobs.enqueue` | The `async` namespace is gone: starting and following a job live in `jobs` with listing them. |
238
+ | `async.getAsyncJobStatus` | `jobs.status` | |
239
+ | `jobs.listJobs` | `jobs.list` | Then treat it as a list: `jobs.list` returns ListResult<Job>. |
240
+ | `jobs.getJob` | `jobs.get` | |
241
+
242
+ **Removed** (no like-for-like call):
243
+
244
+ | SDK 2 | Do this instead |
245
+ |---|---|
246
+ | `ai.generateContent` | Use `ai.chat.completions.create`. A different call: it takes chat messages, not `contents`, and answers in the chat-completions shape (`choices[0].message.content`). `ai.chat.completions.create(collectionId, { messages: [{ role: "user", content }] })`. |
247
+ | `Asset.thumbnails` | Use `Asset.thumbnail`. One thumbnail address (`string \| null`), not a map of sizes. |
248
+ | `asset.uploadAsset` | Use `asset.upload`. Takes one options object: `asset.upload({ file, scope, … })` (type UploadAssetOptions). |
249
+ | `BatchCreateRequest.id` | The server generates the batch id. Don't send one. |
250
+ | `comms.queryRecipientsWithAction` | Use `comms.queryRecipientsWithInteraction`. It posted to an address the API never had, so it never worked. The real call takes `interactionId` (not `actionId`) and returns a list of ids, or of `{ id, outcome }` with `includeOutcome: true`. |
251
+ | `comms.queryRecipientsWithoutAction` | Use `comms.queryRecipientsWithoutInteraction`. It posted to an address the API never had, so it never worked. The real call takes `interactionId` (not `actionId`) and returns a list of ids. |
252
+ | `CommsRecipientsWithActionQuery` | Use `CommsRecipientsWithInteractionQuery`. `actionId` is `interactionId`. |
253
+ | `CommsRecipientsWithoutActionQuery` | Use `CommsRecipientsWithoutInteractionQuery`. `actionId` is `interactionId`. |
254
+ | `evaluateCondition` | Use `evaluateConditions`. Takes the field's whole condition list: `evaluateConditions(property.conditions, property.showWhen, values)`. |
255
+ | `FirebaseTimestamp` | Dates are ISO 8601 strings or a Date: `BatchCreateRequest.expiryDate` and `BatchUpdateRequest.expiryDate` are `string \| Date`. |
256
+ | `order.findByProduct` | Use `order.query`. The API never had this address, so the call could only fail. Use `order.query(collectionId, { query: { productId } })`. |
257
+ | `order.findItemsByProduct` | Use `order.query`. The API never had this address, so the call could only fail. Use `order.query(collectionId, { query: { productId }, includeItems: true })` and read each order's items. |
258
+ | `order.findOrdersByProduct` | Use `order.query`. The API never had this address, so the call could only fail. Use `order.query(collectionId, { query: { productId } })`. |
259
+ | `order.getOrderIdsByAttribute` | Use `order.query`. The API never had this address, so the call could only fail. Use `order.query` with `productId`, `batchId` or `variantId` in `query`, and read the ids from `items`. |
260
+ | `order.lookup` | Use `order.query`. The API never had this address, so the call could only fail. Find the orders that hold items with `order.query(collectionId, { query: { items: [{ itemType, itemId }] } })`. |
261
+ | `product.find` | Use `products.query`. A different body (type ProductQueryRequest). Returns a list and pages with `limit` + `cursor`. |
262
+ | `product.publicFind` | Use `products.get` when you know the id, `products.query` to search. The server retired this route some time ago. |
263
+ | `realtime.getAdminToken` | Use `realtime.onMine`. The SDK gets its own tokens. Subscribe with `realtime.onMine(scope, onMessage)`. |
264
+ | `realtime.getPublicToken` | The SDK gets its own tokens. Subscribe with `realtime.channel(scope, name)` or `realtime.onChange(scope, filter, onChange)`. |
265
+ | `site.ready` | Sites are server-rendered and nothing waits for the signal. Delete the call. |
266
+ | `VariantCreateRequest.id` | The server generates the variant id. Don't send one. |
267
+
268
+ <!-- upgrade-table:names:end -->
269
+
270
+ ## Options that went
271
+
272
+ These options were accepted by SDK 2 and did nothing, or only worked for an admin. SDK 3's types no
273
+ longer have them.
274
+
275
+ <!-- upgrade-table:options:start -->
276
+ | Function | Option | Why, and what to do |
277
+ |---|---|---|
278
+ | `asset.list` | `mimeTypePrefix` | No asset list ever read it, so it never filtered anything. Filter the items you get back (`a.mimeType?.startsWith('image/')`), or as an admin use `asset.listAdmin` with `assetType`. |
279
+ | `authKit.list` | `admin (the argument)` | There is no public list of AuthKit configs, so the call without `true` always failed. Call `authKit.list(collectionId)`. |
280
+ | `bookings.mine` | `contactId` | `mine` is always the caller's own bookings. To list a contact's bookings as an admin use `bookings.list`. |
281
+ | `collection.list` | `admin (the argument)` | There is no public list of collections, so `collection.list(false)` always failed. Call `collection.list()`: it lists the collections the signed-in user can work on. |
282
+ | `comms.queryRecipientIds` | `journeyStepId` | The server never read it. For one journey step's recipients use `journeysAnalytics.recipients`. |
283
+ | `containers.publicList` | `status` | The public list is always the active containers. |
284
+ | `containers.publicList` | `ref` | The public list never filtered by ref. |
285
+ | `facets.list` | `includeValues` | The list never read it, and never needed it: every facet in the list already comes with its `values`. Remove the option. |
286
+ | `facets.publicList` | `includeValues` | The list never read it, and never needed it: every facet in the list already comes with its `values`. Remove the option. |
287
+ | `interactions.publicMyInteractions` | `scope` | The server never read it. |
288
+ | `lots.publicList` | `includeDeleted` | Admin only: use `lots.list`. |
289
+ | `attestations.summary` | `recordedAfter` | Now `recordedAt: { gte: … }`, the same range the attestation lists take. |
290
+ | `attestations.summary` | `recordedBefore` | Now `recordedAt: { lte: … }`, the same range the attestation lists take. |
291
+ | `attestations.publicSummary` | `recordedAfter` | Now `recordedAt: { gte: … }`, the same range the attestation lists take. |
292
+ | `attestations.publicSummary` | `recordedBefore` | Now `recordedAt: { lte: … }`, the same range the attestation lists take. |
293
+ | `attestations.treeSummary` | `recordedAfter` | Now `recordedAt: { gte: … }`, the same range the attestation lists take. |
294
+ | `attestations.treeSummary` | `recordedBefore` | Now `recordedAt: { lte: … }`, the same range the attestation lists take. |
295
+ | `attestations.publicTreeSummary` | `recordedAfter` | Now `recordedAt: { gte: … }`, the same range the attestation lists take. |
296
+ | `attestations.publicTreeSummary` | `recordedBefore` | Now `recordedAt: { lte: … }`, the same range the attestation lists take. |
297
+ | `attestations.publicContainerSummary` | `recordedAfter` | Now `recordedAt: { gte: … }`, the same range the attestation lists take. |
298
+ | `attestations.publicContainerSummary` | `recordedBefore` | Now `recordedAt: { lte: … }`, the same range the attestation lists take. |
299
+ | `attestations.publicContainerTreeSummary` | `recordedAfter` | Now `recordedAt: { gte: … }`, the same range the attestation lists take. |
300
+ | `attestations.publicContainerTreeSummary` | `recordedBefore` | Now `recordedAt: { lte: … }`, the same range the attestation lists take. |
301
+ <!-- upgrade-table:options:end -->
302
+
303
+ ## Errors
304
+
305
+ Every error from the API is now `{ error: { code, message, details, requestId } }`. The SDK still throws
306
+ `SmartlinksApiError`, so `try`/`catch` code keeps its structure. What changes is what's inside:
307
+
308
+ ```typescript
309
+ try {
310
+ await products.get(collectionId, productId)
311
+ } catch (e) {
312
+ if (e instanceof SmartlinksApiError) {
313
+ e.statusCode // 404
314
+ e.errorCode // 'NOT_FOUND' ← check this in code
315
+ e.message // for people; may change
316
+ e.details // extra facts, e.g. { unknown: ['serach'], allowed: [...] }
317
+ e.requestId // quote this when reporting a problem
318
+ }
319
+ }
320
+ ```
321
+
322
+ - **Codes are all `UPPER_SNAKE`.** A code that was dotted or camel-case in SDK 2 changes spelling:
323
+ `segments.list.failed` is `SEGMENTS_LIST_FAILED`. Search your app for string comparisons against
324
+ `errorCode`, `details.errorCode` and `details.error`.
325
+ - **Two statuses are corrected.** "Not signed in" used to arrive from some routes as `400`; it is `401`.
326
+ "Signed in but not allowed" used to arrive from some routes as `401`; it is `403`. `isAuthError()`
327
+ covers both.
328
+ - **Don't match on message text.** Messages are for people and are being rewritten. Use `errorCode`.
329
+ - **An address that doesn't exist** answers `404 ROUTE_NOT_FOUND` with what was wrong and the nearest
330
+ real addresses.
331
+ - **A `429`** carries `Retry-After` when the server knows when to try again.
332
+
333
+ Not changed: answers from an app's own server functions, and the OpenAI-compatible AI routes, which keep
334
+ their own error shapes.
335
+
336
+ ## A list refuses options it doesn't read
337
+
338
+ In SDK 2 a mistyped or unsupported query option was silently ignored. Now a list answers
339
+ `400 UNKNOWN_PARAMETER`, naming the options it does read. Two things this catches in existing apps:
340
+
341
+ - one options object shared between an admin call and a public call, carrying an admin-only option
342
+ (`includeDeleted`, `status` on public app records, `contactId`, `assignedTo`);
343
+ - an option that never existed on that list.
344
+
345
+ Pass each list only the options its type has. The types now say which are admin-only.
346
+
347
+ ## API version
348
+
349
+ `initializeApi({ apiVersion })` can ask for a **newer** version than the SDK was built for. An older one
350
+ is ignored: SDK 3's functions return `2027-01` shapes. To stay on `2026-11`, stay on SDK 2.
351
+
352
+ ## Apps that run inside the Portal or Hub
353
+
354
+ A component doesn't bundle the SDK: it uses the host's copy. So that SDK 2 apps and SDK 3 apps can run
355
+ side by side, the shared-dependency contract goes to **v8** with SDK 3
356
+ ([host-dependency-contract.md](host-dependency-contract.md)):
357
+
358
+ - Build with `SHARED_DEPENDENCY_SPECIFIERS` from SDK 3 as your externals, as before. Your manifest then
359
+ says `sharedDependencies: "v8"` and the host gives you SDK 3.
360
+ - An older build of your app, and other apps still on SDK 2, keep getting SDK 2. Nothing changes for them.
361
+ - The `SL` prop the host hands your component is SDK 3 too. If you read the SDK from the window
362
+ global rather than an import, it is `window.SL3` (`window.SL` stays SDK 2).
363
+ - Keep building both formats (`moduleFormat: "dual"`). For now the host loads the UMD build of an app
364
+ on SDK 3.
365
+ - The sign-in UI (`@proveanything/smartlinks-auth-ui`) is the host's one copy, as before.
366
+ - `@proveanything/smartlinks-utils-ui` is bundled into your app and calls the SDK itself, so it must be
367
+ a version that works on SDK 3.
368
+
369
+ ## What the compiler won't catch
370
+
371
+ Search for these by hand (or let the Forge step do it):
372
+
373
+ - `errorCode` compared with a dotted or camel-case string, and any test on error message text.
374
+ - A list result typed `any` (JavaScript files, `as any`, untyped hooks): `.length`, `.map`, `.filter`
375
+ on the result itself instead of on `.items`.
376
+ - React Query (or other) caches keyed on `offset` or `page`: key on the cursor.
377
+ - A list that used to return everything, read as if it still does (`const { items } = await x.list(…)`
378
+ with no `limit`, `cursor` or `all`). It compiles. The upgrade report marks each one.
379
+ - An options object passed to both the admin and the public form of a list.
380
+ - `window.SL` used directly in a v8 build.
381
+
382
+ ## What hasn't changed
383
+
384
+ - **The old `attestation` namespace** (singular) is still there, still deprecated. Its data hasn't been
385
+ moved to the new `attestations` yet, so apps that write with it can't move yet. It goes in a later
386
+ release, once the data has moved.
387
+ - **Server functions.** `ctx.sl.*` inside an app's server function runs on the server, not through the
388
+ SDK, and keeps the shapes it has.
389
+ - **The standard query** (`proof.query`, `contact.query`, `products.standardQuery`, `app.records.query`)
390
+ already returned `{ items, nextCursor, count? }`.
391
+ - **Everything that isn't a list**: get, create, update, delete, actions.
392
+
393
+ ## Every list that changed
394
+
395
+ <!-- upgrade-table:lists:start -->
396
+ 150 functions. `ListResult<T>` is `{ items: T[], nextCursor, count? }`.
397
+
398
+ | Function | SDK 2 returned | SDK 3 returns | Options |
399
+ |---|---|---|---|
400
+ | `adminCards.list` | `{ cards, hidden, layout }` | `ListResult<AdminCard> & { hidden, layout }` | always whole |
401
+ | `ai.agent.listTools` | `AgentToolsResponse { tools }` | `ListResult<AgentToolDefinition>` | always whole |
402
+ | `ai.skills.list` | `SkillsListResponse { skills }` | `ListResult<SkillDescriptor>` | always whole |
403
+ | `analytics.admin.events` | `{ source, limit, offset, sort, count, rows }` | `ListResult<Record<string, any>> & { source, sort }` | no `offset`, `sort`; now `cursor`, `orderBy` |
404
+ | `app.cases.list` | `{ data, pagination: { total, limit, offset, hasMore } }` | `ListResult<AppCase>` | no `offset`, `sort`; now `cursor`, `orderBy` |
405
+ | `app.options.get` | `{ items, version, mode, total? } | { unchanged: true, version }` | `(ListResult<AppOption> & { version, mode }) | { unchanged: true, version }` | now `limit`, `cursor`; **one page now** |
406
+ | `app.records.list` | `{ data, pagination: { total, limit, offset, hasMore } }` | `ListResult<AppRecord>` | no `offset`, `sort`; now `cursor`, `orderBy` |
407
+ | `app.records.match` | `{ data, total, strategy }` | `ListResult<MatchEntry> & { strategy }` | now `cursor`, `limit` |
408
+ | `app.records.resolveAll` | `{ records, total, context, truncated }` | `ListResult<ResolveAllEntry> & { context, truncated }` | now `cursor`, `limit` |
409
+ | `app.threads.list` | `{ data, pagination: { total, limit, offset, hasMore } }` | `ListResult<AppThread>` | no `offset`, `sort`; now `cursor`, `orderBy` |
410
+ | `appConfiguration.getData` | `any[]` | `ListResult<any>` | now `limit`, `cursor`; **one page now** |
411
+ | `appConfiguration.getWidgets` | `{ apps }` | `ListResult<CollectionAppWidget>` | always whole |
412
+ | `asset.list` | `Asset[]` | `ListResult<Asset>` | no `offset`; now `cursor`, `limit`; **one page now** |
413
+ | `asset.listAdmin` | `AdminListAssetsResponse { data, total, limit, offset }` | `ListResult<Asset>` | no `offset`, `sort`, `order`; now `cursor`, `orderBy` |
414
+ | `asset.listForCollection` | `Asset[]` | `ListResult<Asset>` | now `limit`, `cursor`; **one page now** |
415
+ | `asset.listForProduct` | `Asset[]` | `ListResult<Asset>` | now `limit`, `cursor`; **one page now** |
416
+ | `asset.listForProof` | `Asset[]` | `ListResult<Asset>` | now `limit`, `cursor`; **one page now** |
417
+ | `attestation.list` | `AttestationResponse[]` | `ListResult<AttestationResponse>` | now `limit`, `cursor`; **one page now** |
418
+ | `attestations.list` | `{ attestations }` | `ListResult<Attestation>` | no `offset`, `recordedAfter`, `recordedBefore`; now `cursor`, `recordedAt` |
419
+ | `attestations.publicContainerList` | `{ attestations, audience }` | `ListResult<Attestation> & { audience }` | no `offset`, `recordedAfter`, `recordedBefore`; now `cursor`, `recordedAt` |
420
+ | `attestations.publicList` | `{ attestations, audience }` | `ListResult<Attestation> & { audience }` | no `offset`, `recordedAfter`, `recordedBefore`; now `cursor`, `recordedAt` |
421
+ | `authKit.list` | `AuthKitConfig[]` | `ListResult<AuthKitConfig>` | now `limit`, `cursor`; **one page now** |
422
+ | `authKit.listTrustedDevices` | `{ devices: TrustedDevice[] }` | `ListResult<TrustedDevice>` | now `limit`, `cursor`; **one page now** |
423
+ | `batch.getBatchTags` | `BatchTag[]` | `ListResult<BatchTag>` | now `limit`, `cursor`; **one page now** |
424
+ | `batch.list` | `BatchResponse[]` | `ListResult<BatchResponse>` | now `limit`, `cursor`; **one page now** |
425
+ | `batch.searchInCollection` | `BatchResponse[]` | `ListResult<BatchResponse>` | no `search`; now `q`, `cursor`, `limit` |
426
+ | `bookings.blocks.list` | `PaginatedResponse<BookingAllocation>` | `ListResult<BookingAllocation> (with count)` | no `offset`; now `cursor` |
427
+ | `bookings.list` | `PaginatedResponse<Booking> = { data, pagination: { total, limit, offset, hasMore } }` | `ListResult<Booking> (with count)` | no `offset`, `sort`; now `cursor`, `orderBy` |
428
+ | `bookings.mine` | `PaginatedResponse<Booking>` | `ListResult<Booking> (with count)` | no `offset`, `sort`; now `cursor`, `orderBy` |
429
+ | `bookings.slots.list` | `PaginatedResponse<BookingSlot>` | `ListResult<BookingSlot> (with count)` | no `offset`, `sort`; now `cursor`, `orderBy` |
430
+ | `broadcasts.list` | `BroadcastList = { items, limit, offset }` | `ListResult<BroadcastRecord>` | no `offset`; now `cursor` |
431
+ | `broadcasts.recipients` | `{ items, total, limit, offset, note? }` | `ListResult<Recipient> & { note?: string } (with count)` | no `offset`; now `cursor` |
432
+ | `claimSet.getAll` | `any[]` | `ListResult<any>` | now `limit`, `cursor`; **one page now** |
433
+ | `claimSet.getAssignedTags` | `any (the claim set with its tags in tags)` | `ListResult<any> & Record<string, any>` | now `limit`, `cursor`; **one page now** |
434
+ | `claimSet.ranges.list` | `ClaimSetRange[]` | `ListResult<ClaimSetRange>` | now `limit`, `cursor`; **one page now** |
435
+ | `claimSet.ranges.tags` | `ClaimSetRangeTagsPage { tags, next }` | `ListResult<ClaimSetRangeTag>` | no `from`; now `cursor` |
436
+ | `collection.getUsers` | `CollectionUser[]` | `ListResult<CollectionUser>` | now `limit`, `cursor`; **one page now** |
437
+ | `collection.list` | `CollectionResponse[]` | `ListResult<CollectionResponse>` | now `limit`, `cursor`; **one page now** |
438
+ | `comms.listMethods` | `{ ok: true, methods: CommMethod[] }` | `ListResult<CommMethod>` | always whole |
439
+ | `comms.queryByUser` | `CommunicationEvent[]` | `ListResult<CommunicationEvent>` | now `cursor`, `limit` |
440
+ | `comms.queryRecipientIds` | `RecipientId[]` | `ListResult<RecipientId>` | now `cursor`, `limit` |
441
+ | `conditions.list` | `SavedCondition[]` | `ListResult<SavedCondition>` | now `limit`, `cursor`; **one page now** |
442
+ | `config.getFields` | `FieldDefinition[]` | `ListResult<FieldDefinition>` | always whole |
443
+ | `config.getProofTypes` | `ProofTypeDefinition[]` | `ListResult<ProofTypeDefinition>` | always whole |
444
+ | `contact.findDuplicates` | `{ pairs, scanned, more }` | `ListResult<ContactDuplicatePair> & { scanned: number }` | no `offset`; now `cursor` |
445
+ | `contact.list` | `ContactListResponse = { items, limit, offset }` | `ListResult<Contact>` | no `offset`; now `cursor` |
446
+ | `contact.search` | `ContactSearchResponse = { items, limit, offset }` | `ListResult<Contact>` | no `offset`, `createdFrom`, `createdTo`; now `cursor`, `createdAt` |
447
+ | `containers.findForItem` | `{ items: ContainerItem[], containers: Container[] }` | `ListResult<ContainerItem> & { containers: Container[] }` | now `limit`, `cursor`; **one page now** |
448
+ | `containers.list` | `ListContainersResponse = { containers, limit, offset }` | `ListResult<Container>` | no `offset`; now `cursor` |
449
+ | `containers.listItems` | `ContainerItemsResponse = { items, limit, offset }` | `ListResult<ContainerItem>` | no `offset`; now `cursor` |
450
+ | `containers.publicList` | `PublicListContainersResponse = { containers }` | `ListResult<Container>` | no `offset`; now `cursor` |
451
+ | `containers.publicListItems` | `ContainerItemsResponse = { items, limit, offset }` | `ListResult<ContainerItem>` | no `limit`, `offset`; now `limit`, `cursor`; **one page now** |
452
+ | `crate.list` | `ListCratesResponse = { items, hasMore, lastId }` | `ListResult<Crate>` | no `startAfter`; now `cursor` |
453
+ | `dpp.groups` | `DppGroup[] (the function unwrapped { groups })` | `ListResult<DppGroup>` | always whole |
454
+ | `dpp.passports.list` | `DppPassport[] (unwrapped { passports })` | `ListResult<DppPassport>` | no `offset`; now `cursor` |
455
+ | `dpp.passports.versions` | `DppPassportVersion[] (unwrapped { versions })` | `ListResult<DppPassportVersion>` | now `limit`, `cursor`; **one page now** |
456
+ | `dpp.registry.list` | `DppRegistry[] (unwrapped { registries })` | `ListResult<DppRegistry>` | always whole |
457
+ | `dpp.tasks.list` | `DppTask[] (unwrapped { tasks })` | `ListResult<DppTask>` | now `limit`, `cursor`; **one page now** |
458
+ | `facets.list` | `FacetListResponse = { items }` | `ListResult<FacetDefinition>` | always whole |
459
+ | `facets.listValues` | `FacetValueListResponse = { facet, items }` | `ListResult<FacetValue> & { facet: FacetDefinition }` | now `limit`, `cursor`; **one page now** |
460
+ | `facets.namespaces` | `FacetNamespaceListResponse = { namespaces: string[] }` | `ListResult<string>` | always whole |
461
+ | `facets.publicList` | `FacetListResponse = { items }` | `ListResult<FacetDefinition>` | always whole |
462
+ | `facets.publicListValues` | `FacetValueListResponse = { facet, items }` | `ListResult<FacetValue> & { facet: FacetDefinition }` | now `limit`, `cursor`; **one page now** |
463
+ | `facets.publicNamespaces` | `FacetNamespaceListResponse = { namespaces: string[] }` | `ListResult<string>` | always whole |
464
+ | `facets.publicQuery` | `FacetQueryResponse = { items, buckets, meta? }` | `ListResult<{ facet, values }> & { buckets: FacetBucket[], meta? }` | no `query.search`, `query.createdAfter`, `query.createdBefore`, `query.updatedAfter`, `query.updatedBefore`; now `q`, `createdAt`, `updatedAt`; always whole |
465
+ | `facets.query` | `FacetQueryResponse = { items, buckets, meta? }` | `ListResult<{ facet, values }> & { buckets: FacetBucket[], meta? }` | no `query.search`, `query.createdAfter`, `query.createdBefore`, `query.updatedAfter`, `query.updatedBefore`; now `q`, `createdAt`, `updatedAt`; always whole |
466
+ | `files.list` | `{ ok: true, files: FileRecord[] }` | `ListResult<FileRecord>` | now `cursor`, `limit` |
467
+ | `form.list` | `any[]` | `ListResult<any>` | now `limit`, `cursor`; **one page now** |
468
+ | `integrations.listConnectorActions` | `{ actions }` | `ListResult<{ name, title, description?, visibility, input?, output? }>` | always whole |
469
+ | `integrations.listConnectors` | `{ connectors }` | `ListResult<InstalledConnector>` | always whole |
470
+ | `integrations.listEntityRuns` | `{ runs, nextCursor? }` | `ListResult<FlowRun>` | now `cursor`, `limit` |
471
+ | `integrations.listFailed` | `{ direction, items, nextCursor }` | `ListResult<FailedRecord> & { direction: FlowDirection }` | |
472
+ | `integrations.listFlows` | `{ flows }` | `ListResult<IntegrationFlow>` | now `limit`, `cursor`; **one page now** |
473
+ | `integrations.listRecordTypes` | `{ recordTypes }` | `ListResult<RecordTypeInfo>` | always whole |
474
+ | `integrations.listRunItems` | `{ items, nextCursor? }` | `ListResult<FlowRunItem>` | |
475
+ | `integrations.listRuns` | `{ runs, nextCursor? }` | `ListResult<FlowRun>` | |
476
+ | `interactions.list` | `{ items, limit, offset }` | `ListResult<InteractionTypeRecord>` | no `offset`; now `cursor` |
477
+ | `interactions.publicList` | `{ items, limit, offset }` | `ListResult<InteractionTypeRecord>` | no `offset`; now `cursor` |
478
+ | `interactions.publicMyInteractions` | `InteractionEventRow[]` | `ListResult<InteractionEventRow>` | now `cursor`, `limit` |
479
+ | `interactions.query` | `InteractionEventRow[]` | `ListResult<InteractionEventRow>` | no `order`, `include`; now `cursor`, `orderBy`, `expand`, `limit` |
480
+ | `jobs.list` | `{ items, limit, offset }` | `ListResult<Job>` | no `offset`; now `cursor` |
481
+ | `journeys.list` | `{ items, limit, offset }` | `ListResult<JourneyRecord>` | no `offset`; now `cursor` |
482
+ | `journeysAnalytics.recipients` | `string[]` | `ListResult<string>` | now `cursor`, `limit` |
483
+ | `knowledge.listSets` | `KnowledgeSet[]` | `ListResult<KnowledgeSet>` | now `limit`, `cursor`; **one page now** |
484
+ | `knowledge.listSources` | `KnowledgeSource[]` | `ListResult<KnowledgeSource>` | now `limit`, `cursor`; **one page now** |
485
+ | `knowledge.publicSearch` | `KnowledgeSearchResponse { query, results, mode }` | `ListResult<KnowledgeSearchResult> & Pick<KnowledgeSearchResponse, 'query' | 'mode'>` | no `query`, `k`; now `q`, `limit`, `cursor` |
486
+ | `knowledge.search` | `{ query, results, mode }` | `ListResult<KnowledgeSearchResult> & { query, mode }` | no `query`, `k`; now `q`, `limit`, `cursor` |
487
+ | `location.search` | `{ items, count }` | `ListResult<Location>` | no `sort`; now `cursor`, `orderBy`, `limit` |
488
+ | `lots.list` | `Lot[] (the SDK unwrapped { lots })` | `ListResult<Lot>` | no `search`; now `limit`, `cursor`, `q`; **one page now** |
489
+ | `lots.listProducts` | `{ products, total, page, limit }` | `ListResult<LotProductSummary>` | no `page`; now `cursor` |
490
+ | `lots.publicList` | `Lot[] (the SDK unwrapped { lots })` | `ListResult<Lot>` | no `search`; now `limit`, `cursor`, `q`; **one page now** |
491
+ | `lots.publicListProducts` | `{ products, total, page, limit }` | `ListResult<LotProductSummary>` | no `page`; now `cursor` |
492
+ | `loyalty.getMemberHistory` | `{ items, limit, offset }` | `ListResult<LoyaltyTransaction>` | no `offset`; now `cursor` |
493
+ | `loyalty.list` | `LoyaltyScheme[]` | `ListResult<LoyaltyScheme>` | now `limit`, `cursor`; **one page now** |
494
+ | `loyalty.listEarningRules` | `LoyaltyEarningRule[]` | `ListResult<LoyaltyEarningRule>` | now `limit`, `cursor`; **one page now** |
495
+ | `loyalty.listMembers` | `{ items, limit, offset }` | `ListResult<LoyaltyMember>` | no `offset`; now `cursor` |
496
+ | `loyalty.publicGetMe` | `LoyaltySchemeWithMembership[]` | `ListResult<LoyaltySchemeWithMembership>` | now `limit`, `cursor`; **one page now** |
497
+ | `loyalty.publicGetMineHistory` | `{ items, limit, offset }` | `ListResult<LoyaltyTransaction>` | no `offset`; now `cursor` |
498
+ | `loyalty.publicList` | `LoyaltyScheme[]` | `ListResult<LoyaltyScheme>` | now `limit`, `cursor`; **one page now** |
499
+ | `loyalty.publicListEarningRules` | `LoyaltyEarningRule[]` | `ListResult<LoyaltyEarningRule>` | now `limit`, `cursor`; **one page now** |
500
+ | `nfc.lookupTag` | `NfcTagInfo[]` | `ListResult<NfcTagInfo>` | always whole |
501
+ | `order.getItems` | `{ items, limit, offset }` | `ListResult<OrderItem>` | no `offset`; now `cursor` |
502
+ | `order.getLocationHistory` | `{ orderRef, orderId, locations, count }` | `ListResult<LocationScan> & { orderRef: string; orderId: string }` | now `cursor`, `limit` |
503
+ | `order.getTimeline` | `{ orderRef, orderId, timeline, count }` | `ListResult<TagScanEvent> & { orderRef: string; orderId: string }` | now `cursor`, `limit` |
504
+ | `order.list` | `{ orders, limit, offset }` | `ListResult<Order>` | no `offset`, `includeItems`; now `cursor`, `expand` |
505
+ | `order.query` | `{ orders, limit, offset }` | `ListResult<Order>` | no `offset`, `query.sortBy`, `query.sortOrder`, `query.createdAfter`, `query.createdBefore`, `query.updatedAfter`, `query.updatedBefore`, `includeItems`; now `cursor`, `orderBy`, `createdAt`, `updatedAt`, `expand` |
506
+ | `partner.claimSets` | `PartnerClaimSet[]` | `ListResult<PartnerClaimSet>` | now `limit`, `cursor`; **one page now** |
507
+ | `partner.list` | `Partner[]` | `ListResult<Partner>` | now `limit`, `cursor`; **one page now** |
508
+ | `partner.lookupTags` | `PartnerTagHit[]` | `ListResult<PartnerTagHit>` | always whole |
509
+ | `partner.tagAttempts` | `ClientErrorEvent[]` | `ListResult<ClientErrorEvent>` | now `limit`, `cursor` |
510
+ | `products.list` | `ProductResponse[]` | `ListResult<ProductResponse>` | now `limit`, `cursor`, `expand`; **one page now** |
511
+ | `products.listAssets` | `unknown` | `ListResult<AssetResponse>` | now `limit`, `cursor`; **one page now** |
512
+ | `products.query` | `{ items, page: { limit, offset, returned, total, hasMore, nextCursor }, meta }` | `ListResult<ProductResponse> & { meta?: ProductQueryMeta }` | no `page.limit`, `page.offset`, `page.cursor`, `query.search`, `sort`, `query.createdAfter`, `query.createdBefore`, `query.updatedAfter`, `query.updatedBefore`; now `limit`, `cursor`, `q`, `orderBy`, `createdAt`, `updatedAt`, `expand` |
513
+ | `proof.findByProduct` | `ProofResponse[]` | `ListResult<ProofResponse>` | no `lastCursor`, `page`, `perPage`, `includes`; now `limit`, `cursor`, `expand` |
514
+ | `proof.getByBatch` | `ProofResponse[]` | `ListResult<ProofResponse>` | now `limit`, `cursor`; **one page now** |
515
+ | `proof.getByProduct` | `ProofResponse[]` | `ListResult<ProofResponse>` | now `limit`, `cursor`; **one page now** |
516
+ | `proof.getByUser` | `ProofResponse[]` | `ListResult<ProofResponse>` | now `limit`, `cursor`; **one page now** |
517
+ | `proof.list` | `ProofResponse[]` | `ListResult<ProofResponse>` | no `include`; now `limit`, `cursor`, `expand`; **one page now** |
518
+ | `proof.listGrants` | `ProofGrant[]` | `ListResult<ProofGrant>` | now `limit`, `cursor`; **one page now** |
519
+ | `secrets.list` | `SecretList { secrets }` | `ListResult<SecretMeta>` | always whole |
520
+ | `secrets.listOwn` | `SecretList { secrets }` | `ListResult<SecretMeta>` | always whole |
521
+ | `segments.list` | `{ items, limit, offset }` | `ListResult<SegmentRecord>` | no `offset`; now `cursor` |
522
+ | `segments.recipients` | `{ items, limit, offset, total, note? }` | `ListResult<Recipient> & { note?: string }` | no `offset`; now `cursor` |
523
+ | `serviceAccounts.list` | `{ serviceAccounts, access }` | `ListResult<ServiceAccount> & { access: ServiceAccountAccess[] }` | now `limit`, `cursor`; **one page now** |
524
+ | `shop.admin.listOrders` | `{ items, total, limit, offset }` | `ListResult<ShopAdminOrder>` | no `offset`; now `cursor` |
525
+ | `shop.admin.listPrices` | `{ items, total, limit, offset }` | `ListResult<ShopPrice>` | no `offset`; now `cursor` |
526
+ | `shop.myOrders` | `{ items, total, limit, offset }` | `ListResult<ShopBuyerOrder>` | no `offset`; now `cursor` |
527
+ | `shop.products` | `{ currency, items }` | `ListResult<ShopProduct> & { currency: string }` | now `limit`, `cursor`; **one page now** |
528
+ | `subscriptions.admin.list` | `{ items, total, limit, offset }` | `ListResult<Membership>` | no `offset`; now `cursor` |
529
+ | `subscriptions.admin.listPlans` | `{ items, total, limit, offset }` | `ListResult<PlanWithPrices>` | no `offset`; now `cursor` |
530
+ | `subscriptions.mine` | `MySubscription[]` | `ListResult<MySubscription>` | now `limit`, `cursor`; **one page now** |
531
+ | `subscriptions.plans` | `PublicPlan[]` | `ListResult<PublicPlan>` | now `limit`, `cursor`; **one page now** |
532
+ | `tags.byRef` | `{ tags }` | `ListResult<Tag>` | now `limit`, `cursor`; **one page now** |
533
+ | `tags.list` | `{ tags, limit, offset }` | `ListResult<Tag>` | no `offset`; now `cursor` |
534
+ | `tags.lookupTags` | `{ count, tags, embedded }` | `ListResult<Tag> & { count: number; embedded: TagEmbedded }` | always whole |
535
+ | `tags.lookupTagsQuery` | `{ count, tags, embedded }` | `ListResult<Tag> & { count: number; embedded: TagEmbedded }` | always whole |
536
+ | `tags.publicByRef` | `{ tags, embedded }` | `ListResult<Tag> & { embedded: TagEmbedded }` | now `limit`, `cursor`; **one page now** |
537
+ | `tags.publicByRefPost` | `{ tags, embedded }` | `ListResult<Tag> & { embedded: TagEmbedded }` | now `limit`, `cursor`; **one page now** |
538
+ | `template.getAll` | `Template[]` | `ListResult<Template>` | now `limit`, `cursor`; **one page now** |
539
+ | `template.getAllowed` | `TemplatePublic[]` | `ListResult<TemplatePublic>` | now `limit`, `cursor`; **one page now** |
540
+ | `template.getAllowedGlobal` | `TemplatePublic[]` | `ListResult<TemplatePublic>` | now `limit`, `cursor`; **one page now** |
541
+ | `translations.list` | `{ items, total?, limit?, offset? }` | `ListResult<TranslationRecord>` | no `offset`; now `cursor` |
542
+ | `userAppData.list` | `any[]` | `ListResult<any>` | now `limit`, `cursor`; **one page now** |
543
+ | `userGroups.history` | `UserGroupChange[]` | `ListResult<UserGroupChange>` | now `cursor`, `limit` |
544
+ | `userGroups.list` | `UserGroup[]` | `ListResult<UserGroup>` | now `limit`, `cursor`; **one page now** |
545
+ | `userGroups.members` | `UserGroupMember[]` | `ListResult<UserGroupMember>` | now `limit`, `cursor`; **one page now** |
546
+ | `userGroups.ofUser` | `UserGroupRef[]` | `ListResult<UserGroupRef>` | now `limit`, `cursor`; **one page now** |
547
+ | `variant.list` | `VariantResponse[]` | `ListResult<VariantResponse>` | now `limit`, `cursor`; **one page now** |
548
+ | `wallet.list` | `{ ok: true, passes }` | `ListResult<WalletPass>` | now `limit`, `cursor`; **one page now** |
549
+ | `wallet.mine` | `{ ok: true, passes }` | `ListResult<WalletPassSummary>` | now `limit`, `cursor`; **one page now** |
550
+ <!-- upgrade-table:lists:end -->