@proveanything/smartlinks 2.2.0 → 3.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (328) hide show
  1. package/README.md +741 -754
  2. package/dist/README.md +573 -573
  3. package/dist/adminCardsView.js +55 -55
  4. package/dist/api/adminCards.d.ts +8 -0
  5. package/dist/api/adminCards.js +9 -1
  6. package/dist/api/ai.d.ts +22 -11
  7. package/dist/api/ai.js +18 -14
  8. package/dist/api/analytics.d.ts +13 -0
  9. package/dist/api/analytics.js +13 -0
  10. package/dist/api/appConfiguration.d.ts +17 -14
  11. package/dist/api/appConfiguration.js +14 -12
  12. package/dist/api/appObjects.d.ts +80 -16
  13. package/dist/api/appObjects.js +74 -11
  14. package/dist/api/asset.d.ts +55 -19
  15. package/dist/api/asset.js +52 -32
  16. package/dist/api/attestation.d.ts +3 -2
  17. package/dist/api/attestation.js +1 -1
  18. package/dist/api/attestations.d.ts +22 -7
  19. package/dist/api/attestations.js +22 -7
  20. package/dist/api/authKit.d.ts +22 -5
  21. package/dist/api/authKit.js +21 -4
  22. package/dist/api/batch.d.ts +23 -16
  23. package/dist/api/batch.js +19 -13
  24. package/dist/api/bookings.d.ts +45 -9
  25. package/dist/api/bookings.js +39 -3
  26. package/dist/api/broadcasts.d.ts +26 -6
  27. package/dist/api/broadcasts.js +22 -2
  28. package/dist/api/claimSet.d.ts +48 -13
  29. package/dist/api/claimSet.js +43 -7
  30. package/dist/api/collection.d.ts +20 -6
  31. package/dist/api/collection.js +19 -8
  32. package/dist/api/comms.d.ts +43 -12
  33. package/dist/api/comms.js +43 -13
  34. package/dist/api/conditions.d.ts +12 -2
  35. package/dist/api/conditions.js +10 -1
  36. package/dist/api/config.d.ts +15 -2
  37. package/dist/api/config.js +12 -0
  38. package/dist/api/contact.d.ts +34 -13
  39. package/dist/api/contact.js +35 -10
  40. package/dist/api/containers.d.ts +41 -23
  41. package/dist/api/containers.js +37 -21
  42. package/dist/api/crate.d.ts +9 -8
  43. package/dist/api/crate.js +8 -8
  44. package/dist/api/dpp.d.ts +58 -10
  45. package/dist/api/dpp.js +57 -15
  46. package/dist/api/facets.d.ts +71 -0
  47. package/dist/api/facets.js +71 -0
  48. package/dist/api/files.d.ts +11 -5
  49. package/dist/api/files.js +9 -1
  50. package/dist/api/form.d.ts +9 -2
  51. package/dist/api/form.js +7 -1
  52. package/dist/api/index.d.ts +0 -1
  53. package/dist/api/index.js +0 -1
  54. package/dist/api/integrations.d.ts +82 -27
  55. package/dist/api/integrations.js +63 -7
  56. package/dist/api/interactions.d.ts +42 -6
  57. package/dist/api/interactions.js +41 -5
  58. package/dist/api/jobs.d.ts +9 -2
  59. package/dist/api/jobs.js +6 -0
  60. package/dist/api/journeys.d.ts +13 -2
  61. package/dist/api/journeys.js +10 -1
  62. package/dist/api/journeysAnalytics.d.ts +12 -3
  63. package/dist/api/journeysAnalytics.js +9 -1
  64. package/dist/api/knowledge.d.ts +43 -10
  65. package/dist/api/knowledge.js +37 -5
  66. package/dist/api/location.d.ts +10 -3
  67. package/dist/api/location.js +7 -1
  68. package/dist/api/lots.d.ts +40 -13
  69. package/dist/api/lots.js +38 -8
  70. package/dist/api/loyalty.d.ts +70 -12
  71. package/dist/api/loyalty.js +60 -3
  72. package/dist/api/nfc.d.ts +8 -2
  73. package/dist/api/nfc.js +6 -1
  74. package/dist/api/order.d.ts +51 -160
  75. package/dist/api/order.js +46 -208
  76. package/dist/api/partner.d.ts +41 -8
  77. package/dist/api/partner.js +36 -4
  78. package/dist/api/products.d.ts +41 -8
  79. package/dist/api/products.js +33 -4
  80. package/dist/api/proof.d.ts +50 -13
  81. package/dist/api/proof.js +43 -7
  82. package/dist/api/realtime.d.ts +1 -11
  83. package/dist/api/realtime.js +1 -22
  84. package/dist/api/secrets.d.ts +25 -5
  85. package/dist/api/secrets.js +21 -2
  86. package/dist/api/segments.d.ts +26 -6
  87. package/dist/api/segments.js +22 -2
  88. package/dist/api/serviceAccounts.d.ts +8 -1
  89. package/dist/api/serviceAccounts.js +8 -1
  90. package/dist/api/shop.d.ts +41 -13
  91. package/dist/api/shop.js +35 -4
  92. package/dist/api/subscriptions.d.ts +47 -12
  93. package/dist/api/subscriptions.js +40 -4
  94. package/dist/api/tags.d.ts +40 -19
  95. package/dist/api/tags.js +38 -18
  96. package/dist/api/template.d.ts +31 -3
  97. package/dist/api/template.js +27 -0
  98. package/dist/api/translations.d.ts +17 -2
  99. package/dist/api/translations.js +14 -0
  100. package/dist/api/userGroups.d.ts +35 -9
  101. package/dist/api/userGroups.js +30 -5
  102. package/dist/api/variant.d.ts +11 -3
  103. package/dist/api/variant.js +9 -2
  104. package/dist/api/wallet.d.ts +23 -10
  105. package/dist/api/wallet.js +20 -2
  106. package/dist/apiVersion.d.ts +1 -1
  107. package/dist/apiVersion.js +1 -1
  108. package/dist/baseline.css +194 -194
  109. package/dist/docs/API_SUMMARY.md +1389 -2298
  110. package/dist/docs/PRODUCT_FACETS_SDK.md +10 -15
  111. package/dist/docs/admin-cards.md +189 -189
  112. package/dist/docs/admin-lists-and-pickers.md +1 -1
  113. package/dist/docs/agent-tools.md +156 -156
  114. package/dist/docs/ai-tools-and-skills.md +180 -180
  115. package/dist/docs/ai.md +1721 -1721
  116. package/dist/docs/analytics.md +3 -2
  117. package/dist/docs/api-versions.md +85 -76
  118. package/dist/docs/app-data-storage.md +277 -277
  119. package/dist/docs/app-docs.md +73 -73
  120. package/dist/docs/app-manifest.md +852 -852
  121. package/dist/docs/app-objects.md +38 -50
  122. package/dist/docs/app-records-pattern.md +388 -388
  123. package/dist/docs/appConfig.md +550 -550
  124. package/dist/docs/assets.md +17 -3
  125. package/dist/docs/assistant-apps.md +172 -172
  126. package/dist/docs/assistant-context.md +119 -119
  127. package/dist/docs/attestations.md +5 -4
  128. package/dist/docs/auth-kit.md +1 -1
  129. package/dist/docs/bookings.md +442 -442
  130. package/dist/docs/comms.md +689 -686
  131. package/dist/docs/connectors.md +340 -340
  132. package/dist/docs/contact-search.md +4 -3
  133. package/dist/docs/container-tracking.md +7 -7
  134. package/dist/docs/css-baseline.md +133 -133
  135. package/dist/docs/customer-guide.md +70 -70
  136. package/dist/docs/deploying-apps.md +340 -340
  137. package/dist/docs/dpp.md +115 -115
  138. package/dist/docs/entitlements.md +90 -90
  139. package/dist/docs/executor.md +1 -1
  140. package/dist/docs/files.md +69 -69
  141. package/dist/docs/forms.md +1 -1
  142. package/dist/docs/headless-providers.md +3 -3
  143. package/dist/docs/host-dependency-contract.md +252 -210
  144. package/dist/docs/i18n.md +9 -9
  145. package/dist/docs/integrations.md +322 -322
  146. package/dist/docs/interactions.md +544 -545
  147. package/dist/docs/item-context.md +181 -181
  148. package/dist/docs/knowledge.md +105 -102
  149. package/dist/docs/lists.md +114 -0
  150. package/dist/docs/lots.md +112 -111
  151. package/dist/docs/loyalty.md +348 -352
  152. package/dist/docs/members.md +183 -183
  153. package/dist/docs/memberships.md +150 -149
  154. package/dist/docs/mobile-admin-container.md +693 -693
  155. package/dist/docs/operations.md +281 -281
  156. package/dist/docs/overview.md +485 -485
  157. package/dist/docs/proof-claiming-methods.md +6 -6
  158. package/dist/docs/proof-comms-triggers.md +142 -142
  159. package/dist/docs/proof-ownership-transfer.md +155 -155
  160. package/dist/docs/proof-product-data-scoping.md +462 -462
  161. package/dist/docs/proof-share-grants.md +305 -305
  162. package/dist/docs/realtime.md +139 -138
  163. package/dist/docs/records-admin-pattern.md +304 -304
  164. package/dist/docs/server-functions.md +2 -2
  165. package/dist/docs/service-accounts.md +64 -64
  166. package/dist/docs/shop.md +4 -2
  167. package/dist/docs/site-seo.md +2 -1
  168. package/dist/docs/standard-query.md +187 -187
  169. package/dist/docs/tag-codes.md +97 -97
  170. package/dist/docs/tag-ranges.md +106 -106
  171. package/dist/docs/theme-tokens.md +252 -252
  172. package/dist/docs/translations.md +6 -1
  173. package/dist/docs/upgrading-to-3.md +430 -0
  174. package/dist/docs/user-groups.md +4 -4
  175. package/dist/docs/utils.md +1 -1
  176. package/dist/docs/wallet-passes.md +107 -107
  177. package/dist/docs/websites.md +123 -123
  178. package/dist/headless.d.ts +1 -1
  179. package/dist/headless.js +2 -2
  180. package/dist/http.d.ts +15 -2
  181. package/dist/http.js +60 -2
  182. package/dist/index.d.ts +7 -8
  183. package/dist/index.js +2 -0
  184. package/dist/list.d.ts +24 -0
  185. package/dist/list.js +80 -0
  186. package/dist/mobile-admin/types.d.ts +0 -16
  187. package/dist/openapi.yaml +290 -2723
  188. package/dist/shared-dependencies.d.ts +3 -3
  189. package/dist/shared-dependencies.js +13 -5
  190. package/dist/site.d.ts +1 -7
  191. package/dist/site.js +1 -14
  192. package/dist/theme-boot.js +82 -82
  193. package/dist/theme.css +75 -75
  194. package/dist/types/adminCards.d.ts +6 -3
  195. package/dist/types/ai.d.ts +0 -6
  196. package/dist/types/analytics.d.ts +5 -8
  197. package/dist/types/appManifest.d.ts +4 -5
  198. package/dist/types/appObjects.d.ts +14 -18
  199. package/dist/types/appObjects.js +0 -1
  200. package/dist/types/appOptions.d.ts +18 -0
  201. package/dist/types/asset.d.ts +3 -22
  202. package/dist/types/attestations.d.ts +7 -10
  203. package/dist/types/batch.d.ts +6 -14
  204. package/dist/types/bookings.d.ts +22 -4
  205. package/dist/types/broadcasts.d.ts +5 -13
  206. package/dist/types/broadcasts.js +0 -1
  207. package/dist/types/claimSet.d.ts +0 -5
  208. package/dist/types/comms.d.ts +11 -9
  209. package/dist/types/contact.d.ts +5 -29
  210. package/dist/types/contact.js +0 -13
  211. package/dist/types/containers.d.ts +15 -26
  212. package/dist/types/crate.d.ts +4 -12
  213. package/dist/types/dpp.d.ts +3 -3
  214. package/dist/types/dpp.js +0 -1
  215. package/dist/types/error.d.ts +8 -5
  216. package/dist/types/error.js +12 -5
  217. package/dist/types/facets.d.ts +15 -15
  218. package/dist/types/index.d.ts +1 -0
  219. package/dist/types/index.js +1 -0
  220. package/dist/types/integrations.d.ts +3 -28
  221. package/dist/types/interaction.d.ts +3 -9
  222. package/dist/types/jobs.d.ts +3 -8
  223. package/dist/types/jobs.js +0 -1
  224. package/dist/types/journeys.d.ts +3 -8
  225. package/dist/types/journeys.js +0 -1
  226. package/dist/types/journeysAnalytics.d.ts +0 -1
  227. package/dist/types/list.d.ts +24 -0
  228. package/dist/types/list.js +2 -0
  229. package/dist/types/location.d.ts +0 -4
  230. package/dist/types/lots.d.ts +0 -9
  231. package/dist/types/loyalty.d.ts +0 -9
  232. package/dist/types/order.d.ts +7 -134
  233. package/dist/types/product.d.ts +11 -24
  234. package/dist/types/proof.d.ts +16 -0
  235. package/dist/types/realtime.d.ts +0 -29
  236. package/dist/types/segments.d.ts +5 -13
  237. package/dist/types/segments.js +0 -1
  238. package/dist/types/serviceAccounts.d.ts +3 -2
  239. package/dist/types/serviceAccounts.js +0 -1
  240. package/dist/types/shop.d.ts +5 -12
  241. package/dist/types/shop.js +0 -4
  242. package/dist/types/subscriptions.d.ts +18 -0
  243. package/dist/types/subscriptions.js +0 -8
  244. package/dist/types/tags.d.ts +6 -16
  245. package/dist/types/tags.js +0 -7
  246. package/dist/types/translations.d.ts +3 -9
  247. package/dist/types/variant.d.ts +0 -2
  248. package/dist/version.d.ts +1 -1
  249. package/dist/version.js +1 -1
  250. package/docs/API_SUMMARY.md +1389 -2298
  251. package/docs/PRODUCT_FACETS_SDK.md +10 -15
  252. package/docs/admin-cards.md +189 -189
  253. package/docs/admin-lists-and-pickers.md +1 -1
  254. package/docs/agent-tools.md +156 -156
  255. package/docs/ai-tools-and-skills.md +180 -180
  256. package/docs/ai.md +1721 -1721
  257. package/docs/analytics.md +3 -2
  258. package/docs/api-versions.md +85 -76
  259. package/docs/app-data-storage.md +277 -277
  260. package/docs/app-docs.md +73 -73
  261. package/docs/app-manifest.md +852 -852
  262. package/docs/app-objects.md +38 -50
  263. package/docs/app-records-pattern.md +388 -388
  264. package/docs/appConfig.md +550 -550
  265. package/docs/assets.md +17 -3
  266. package/docs/assistant-apps.md +172 -172
  267. package/docs/assistant-context.md +119 -119
  268. package/docs/attestations.md +5 -4
  269. package/docs/auth-kit.md +1 -1
  270. package/docs/bookings.md +442 -442
  271. package/docs/comms.md +689 -686
  272. package/docs/connectors.md +340 -340
  273. package/docs/contact-search.md +4 -3
  274. package/docs/container-tracking.md +7 -7
  275. package/docs/css-baseline.md +133 -133
  276. package/docs/customer-guide.md +70 -70
  277. package/docs/deploying-apps.md +340 -340
  278. package/docs/dpp.md +115 -115
  279. package/docs/entitlements.md +90 -90
  280. package/docs/executor.md +1 -1
  281. package/docs/files.md +69 -69
  282. package/docs/forms.md +1 -1
  283. package/docs/headless-providers.md +3 -3
  284. package/docs/host-dependency-contract.md +252 -210
  285. package/docs/i18n.md +9 -9
  286. package/docs/integrations.md +322 -322
  287. package/docs/interactions.md +544 -545
  288. package/docs/item-context.md +181 -181
  289. package/docs/knowledge.md +105 -102
  290. package/docs/lists.md +114 -0
  291. package/docs/lots.md +112 -111
  292. package/docs/loyalty.md +348 -352
  293. package/docs/members.md +183 -183
  294. package/docs/memberships.md +150 -149
  295. package/docs/mobile-admin-container.md +693 -693
  296. package/docs/operations.md +281 -281
  297. package/docs/overview.md +485 -485
  298. package/docs/proof-claiming-methods.md +6 -6
  299. package/docs/proof-comms-triggers.md +142 -142
  300. package/docs/proof-ownership-transfer.md +155 -155
  301. package/docs/proof-product-data-scoping.md +462 -462
  302. package/docs/proof-share-grants.md +305 -305
  303. package/docs/realtime.md +139 -138
  304. package/docs/server-functions.md +2 -2
  305. package/docs/service-accounts.md +64 -64
  306. package/docs/shop.md +4 -2
  307. package/docs/site-seo.md +2 -1
  308. package/docs/standard-query.md +187 -187
  309. package/docs/tag-codes.md +97 -97
  310. package/docs/tag-ranges.md +106 -106
  311. package/docs/theme-lookbook.v1.json +120 -120
  312. package/docs/theme-tokens.md +252 -252
  313. package/docs/translations.md +6 -1
  314. package/docs/upgrading-to-3.md +430 -0
  315. package/docs/user-groups.md +4 -4
  316. package/docs/utils.md +1 -1
  317. package/docs/wallet-passes.md +107 -107
  318. package/docs/websites.md +123 -123
  319. package/openapi.yaml +290 -2723
  320. package/package.json +91 -87
  321. package/scripts/headless-check.mjs +87 -87
  322. package/scripts/lib/bare-imports.mjs +57 -57
  323. package/scripts/lib/keyed-app-data.mjs +21 -21
  324. package/scripts/lib/upgrade.mjs +512 -0
  325. package/scripts/publish.mjs +272 -272
  326. package/scripts/register-release.mjs +91 -91
  327. package/scripts/upgrade.mjs +56 -0
  328. package/upgrade/3.json +2213 -0
@@ -1,3 +1,4 @@
1
+ import type { ListOptions } from './list.js';
1
2
  /**
2
3
  * Slim reference to an asset embedded inside product and collection documents.
3
4
  * Use `asset.get()` with the `id` to retrieve the full `Asset` record.
@@ -114,15 +115,6 @@ export interface Asset {
114
115
  createdAt: string;
115
116
  updatedAt: string;
116
117
  deletedAt: string | null;
117
- /**
118
- * @deprecated Use `thumbnail` instead. Legacy multi-size thumbnail map.
119
- */
120
- thumbnails?: {
121
- x100?: string;
122
- x200?: string;
123
- x512?: string;
124
- [key: string]: string | undefined;
125
- };
126
118
  }
127
119
  export type AssetResponse = Asset;
128
120
  export interface UploadAssetOptions {
@@ -201,11 +193,8 @@ export interface ListAssetsOptions {
201
193
  };
202
194
  /** Filter by app ID */
203
195
  appId?: string;
204
- /** Filter by MIME type prefix (e.g., 'image/', 'video/') */
205
- mimeTypePrefix?: string;
206
- /** Pagination */
196
+ /** How many to return. These lists are not paged: there is no cursor, and `nextCursor` is always `null`. */
207
197
  limit?: number;
208
- offset?: number;
209
198
  }
210
199
  export interface GetAssetOptions {
211
200
  assetId: string;
@@ -239,7 +228,7 @@ export interface RemoveAssetOptions {
239
228
  proofId: string;
240
229
  };
241
230
  }
242
- export interface AdminListAssetsOptions {
231
+ export interface AdminListAssetsOptions extends ListOptions {
243
232
  collectionId: string;
244
233
  productId?: string;
245
234
  proofId?: string;
@@ -249,20 +238,12 @@ export interface AdminListAssetsOptions {
249
238
  labels?: string;
250
239
  sort?: 'createdAt' | 'name' | 'size' | 'assetType';
251
240
  order?: 'asc' | 'desc';
252
- limit?: number;
253
- offset?: number;
254
241
  /**
255
242
  * Also list files that are normally left out: `temporary` (not kept yet) and `derived` (text, Markdown or fields
256
243
  * extracted from another file). Lists show only what people put there unless asked.
257
244
  */
258
245
  include?: Array<'temporary' | 'derived'>;
259
246
  }
260
- export interface AdminListAssetsResponse {
261
- data: Asset[];
262
- total: number;
263
- limit: number;
264
- offset: number;
265
- }
266
247
  export interface UpdateAssetOptions {
267
248
  collectionId: string;
268
249
  assetId: string;
@@ -8,6 +8,7 @@
8
8
  *
9
9
  * @see docs/attestations.md
10
10
  */
11
+ import type { ListResult, ListOptions } from './list.js';
11
12
  /** Types of entities that can be the subject of an attestation. */
12
13
  export type AttestationSubjectType = 'container' | 'proof' | 'product' | 'tag' | 'serial' | 'order_item' | string;
13
14
  /**
@@ -188,14 +189,13 @@ export interface ModerateAttestationInput {
188
189
  export interface ModerateAttestationResponse {
189
190
  attestation: Attestation;
190
191
  }
191
- export interface ListAttestationsResponse {
192
- attestations: Attestation[];
193
- }
192
+ /** What `attestations.list` returns: `{ items, nextCursor }`. */
193
+ export type ListAttestationsResponse = ListResult<Attestation>;
194
194
  export interface CreateOwnerAttestationResponse {
195
195
  attestation: Attestation;
196
196
  }
197
- export interface PublicListAttestationsResponse {
198
- attestations: Attestation[];
197
+ /** What `attestations.publicList` and `publicContainerList` return: `{ items, nextCursor, audience }`. */
198
+ export interface PublicListAttestationsResponse extends ListResult<Attestation> {
199
199
  /** Resolved audience tier; governs which data zones are populated */
200
200
  audience: AttestationAudience;
201
201
  }
@@ -232,7 +232,8 @@ export interface PublicAttestationTreeLatestResponse {
232
232
  audience: 'public';
233
233
  subjectCount: number;
234
234
  }
235
- export interface ListAttestationsParams {
235
+ /** Paging is `limit` (default 100) and `cursor`: pass the previous page's `nextCursor`. */
236
+ export interface ListAttestationsParams extends ListOptions {
236
237
  /** Required */
237
238
  subjectType: AttestationSubjectType;
238
239
  /** Required */
@@ -248,10 +249,6 @@ export interface ListAttestationsParams {
248
249
  recordedAfter?: string;
249
250
  /** ISO 8601 upper bound (inclusive) */
250
251
  recordedBefore?: string;
251
- /** Default 100 */
252
- limit?: number;
253
- /** Default 0 */
254
- offset?: number;
255
252
  }
256
253
  export interface AttestationSummaryParams {
257
254
  /** Required */
@@ -1,11 +1,3 @@
1
- /**
2
- * @deprecated Batches moved to Postgres — dates now come back as ISO 8601 strings, never
3
- * Firestore Timestamp objects. Kept only so request bodies can still pass a legacy value.
4
- */
5
- export interface FirebaseTimestamp {
6
- seconds: number;
7
- nanoseconds?: number;
8
- }
9
1
  /**
10
2
  * Represents a Batch object. Dates are **ISO 8601 strings**.
11
3
  */
@@ -29,11 +21,9 @@ export interface BatchResponse {
29
21
  * Request payload for creating a new batch.
30
22
  */
31
23
  export interface BatchCreateRequest {
32
- /** @deprecated Ignored — the server generates the batch id. */
33
- id?: string;
34
24
  name?: string;
35
- /** A `Date`, ISO 8601 string, or legacy Firebase Timestamp — all accepted. */
36
- expiryDate?: FirebaseTimestamp | string | Date;
25
+ /** A `Date` or an ISO 8601 string. */
26
+ expiryDate?: string | Date;
37
27
  [key: string]: any;
38
28
  }
39
29
  /**
@@ -41,11 +31,13 @@ export interface BatchCreateRequest {
41
31
  */
42
32
  export interface BatchUpdateRequest {
43
33
  name?: string;
44
- expiryDate?: FirebaseTimestamp | string | Date;
34
+ /** A `Date` or an ISO 8601 string. */
35
+ expiryDate?: string | Date;
45
36
  [key: string]: any;
46
37
  }
47
38
  /**
48
- * Query parameters for searching batches in a collection.
39
+ * Options for `batch.searchInCollection`. The search answers in one page (it has no cursor):
40
+ * `limit` is the most it returns.
49
41
  */
50
42
  export interface SearchBatchesRequest {
51
43
  search?: string;
@@ -1,4 +1,4 @@
1
- import type { PaginatedResponse } from './appObjects.js';
1
+ import type { ListResult, ListOptions } from './list.js';
2
2
  export type BookingStatus = 'held' | 'pending' | 'confirmed' | 'completed' | 'cancelled' | 'no_show' | 'waitlisted';
3
3
  export type BookingVisibility = 'public' | 'owner' | 'admin';
4
4
  /** A claim on a resource's time: seats on a slot (`capacity`) or exclusive time (`exclusive`). */
@@ -169,6 +169,10 @@ export interface MoveBookingInput {
169
169
  bufferBefore?: number;
170
170
  bufferAfter?: number;
171
171
  }
172
+ /**
173
+ * The filters and paging of `ctx.sl.bookings.query` / `mine` in a server function (which pages with
174
+ * `limit` + `offset`). The SDK's `bookings.list` / `bookings.mine` take {@link BookingListOptions}.
175
+ */
172
176
  export interface BookingListQueryParams {
173
177
  status?: string;
174
178
  contactId?: string;
@@ -188,6 +192,9 @@ export interface BookingListQueryParams {
188
192
  limit?: number;
189
193
  offset?: number;
190
194
  }
195
+ /** `bookings.list` / `bookings.mine` options: the filters, plus `limit` and `cursor`. */
196
+ export interface BookingListOptions extends Omit<BookingListQueryParams, 'offset'>, ListOptions {
197
+ }
191
198
  export interface CreateSlotInput {
192
199
  startsAt: string | Date;
193
200
  endsAt: string | Date;
@@ -211,6 +218,7 @@ export interface CreateSlotInput {
211
218
  admin?: Record<string, any>;
212
219
  }
213
220
  export type UpdateSlotInput = Partial<Omit<CreateSlotInput, 'blockResource' | 'seriesId' | 'resourceType' | 'resourceId'>>;
221
+ /** `ctx.sl.bookings.slots.query` in a server function (`limit` + `offset`). The SDK's `bookings.slots.list` takes {@link SlotListOptions}. */
214
222
  export interface SlotListQueryParams {
215
223
  status?: string;
216
224
  /** Only slots with places left. */
@@ -227,6 +235,9 @@ export interface SlotListQueryParams {
227
235
  limit?: number;
228
236
  offset?: number;
229
237
  }
238
+ /** `bookings.slots.list` options: the filters, plus `limit` and `cursor`. */
239
+ export interface SlotListOptions extends Omit<SlotListQueryParams, 'offset'>, ListOptions {
240
+ }
230
241
  export interface CreateBlockInput {
231
242
  resourceType: string;
232
243
  resourceId: string;
@@ -235,6 +246,7 @@ export interface CreateBlockInput {
235
246
  sourceSystem?: string;
236
247
  data?: Record<string, any>;
237
248
  }
249
+ /** `ctx.sl.bookings.blocks.query` in a server function (`limit` + `offset`). The SDK's `bookings.blocks.list` takes {@link BlockListOptions}. */
238
250
  export interface BlockListQueryParams {
239
251
  resourceType?: string;
240
252
  resourceId?: string;
@@ -243,6 +255,9 @@ export interface BlockListQueryParams {
243
255
  limit?: number;
244
256
  offset?: number;
245
257
  }
258
+ /** `bookings.blocks.list` options: the filters, plus `limit` and `cursor`. */
259
+ export interface BlockListOptions extends Omit<BlockListQueryParams, 'offset'>, ListOptions {
260
+ }
246
261
  /** A resource reference: `{ type, id }` or the string form `'record:staff-1'`. */
247
262
  export type BookingResourceRef = {
248
263
  type: string;
@@ -303,9 +318,12 @@ export interface MessageBookersResult {
303
318
  export interface BookingAccessOptions {
304
319
  editToken?: string;
305
320
  }
306
- export type BookingList = PaginatedResponse<Booking>;
307
- export type SlotList = PaginatedResponse<BookingSlot>;
308
- export type BlockList = PaginatedResponse<BookingAllocation>;
321
+ /** What `bookings.list` / `bookings.mine` return: a page of bookings, `nextCursor`, and `count` (how many in all). */
322
+ export type BookingList = ListResult<Booking>;
323
+ /** What `bookings.slots.list` returns. */
324
+ export type SlotList = ListResult<BookingSlot>;
325
+ /** What `bookings.blocks.list` returns. */
326
+ export type BlockList = ListResult<BookingAllocation>;
309
327
  /** Error codes a booking call can fail with (HTTP 409 unless noted). */
310
328
  export type BookingErrorCode = 'SLOT_FULL' | 'SLOT_CLOSED' | 'RESOURCE_TAKEN' | 'PER_CONTACT_LIMIT' | 'QUANTITY_LIMIT' | 'HOLD_EXPIRED' | 'INVALID_STATE' | 'SLOT_OVERBOOKED' | 'SLOT_HAS_BOOKINGS' | 'TOO_SOON' | 'TOO_FAR_AHEAD' | 'IN_THE_PAST' | 'DURATION_NOT_ALLOWED' | 'OUTSIDE_SCHEDULE' | 'NO_SCHEDULE' | 'SCHEDULE_INVALID' | 'CUTOFF_PASSED' | 'FORBIDDEN' | 'NOT_FOUND' | 'BAD_REQUEST';
311
329
  export interface ScheduleHours {
@@ -1,6 +1,6 @@
1
- export interface ListBroadcastsQuery {
2
- limit?: number;
3
- offset?: number;
1
+ import type { ListResult, ListOptions } from './list.js';
2
+ /** `broadcasts.list` options: the app that owns them, plus `limit` and `cursor`. */
3
+ export interface ListBroadcastsQuery extends ListOptions {
4
4
  appId?: string;
5
5
  }
6
6
  /** Broadcast channels. Wallet is not one: wallet passes are messaged one-to-one (`comms.send` with `channel: 'wallet'`). */
@@ -43,16 +43,8 @@ export interface BroadcastRecord {
43
43
  };
44
44
  createdAt: string;
45
45
  }
46
- export interface BroadcastList {
47
- items: BroadcastRecord[];
48
- limit: number;
49
- offset: number;
50
- }
51
- export interface BroadcastRecipientsResponse {
52
- items: import('./comms.js').Recipient[];
53
- total: number;
54
- limit: number;
55
- offset: number;
46
+ /** What `broadcasts.recipients` returns: a page of contacts (`count` = how many in all), and sometimes a note. */
47
+ export interface BroadcastRecipientsResponse extends ListResult<import('./comms.js').Recipient> {
56
48
  note?: string;
57
49
  }
58
50
  export interface BroadcastPreviewRequest {
@@ -1,2 +1 @@
1
- // src/types/broadcasts.ts
2
1
  export {};
@@ -214,11 +214,6 @@ export interface ClaimSetRangeTag {
214
214
  programmedAt: string | null;
215
215
  scans: number;
216
216
  }
217
- export interface ClaimSetRangeTagsPage {
218
- tags: ClaimSetRangeTag[];
219
- /** The index to pass as `from` for the next page, or null */
220
- next: number | null;
221
- }
222
217
  /** The next tag to program on a phone, with what to write. */
223
218
  export interface ClaimSetRangeNextTag extends ClaimSetRangeTag {
224
219
  url: string;
@@ -1,5 +1,6 @@
1
1
  import type { IdField } from './common.js';
2
2
  import type { BroadcastChannel } from './broadcasts.js';
3
+ import type { ListResult } from './list.js';
3
4
  /**
4
5
  * Target subject for notifications (product, collection, etc.)
5
6
  */
@@ -37,26 +38,29 @@ export interface RecipientWithOutcome {
37
38
  export interface CommsRecipientIdsQuery {
38
39
  broadcastId?: string;
39
40
  journeyId?: string;
40
- journeyStepId?: string;
41
41
  idField?: IdField;
42
42
  from?: string;
43
43
  to?: string;
44
44
  limit?: number;
45
45
  }
46
- export interface CommsRecipientsWithoutActionQuery {
46
+ /** Who a broadcast or journey reached that did NOT then do an interaction. */
47
+ export interface CommsRecipientsWithoutInteractionQuery {
47
48
  broadcastId?: string;
48
49
  journeyId?: string;
49
- actionId?: string;
50
+ /** The interaction to look for (its id). */
51
+ interactionId?: string;
50
52
  appId?: string;
51
53
  idField?: IdField;
52
54
  from?: string;
53
55
  to?: string;
54
56
  limit?: number;
55
57
  }
56
- export interface CommsRecipientsWithActionQuery {
58
+ /** Who a broadcast or journey reached that then did an interaction. */
59
+ export interface CommsRecipientsWithInteractionQuery {
57
60
  broadcastId?: string;
58
61
  journeyId?: string;
59
- actionId?: string;
62
+ /** The interaction to look for (its id). */
63
+ interactionId?: string;
60
64
  appId?: string;
61
65
  outcome?: string;
62
66
  idField?: IdField;
@@ -266,10 +270,8 @@ export interface CommsListMethodsQuery {
266
270
  contactId?: string;
267
271
  type?: BroadcastChannel;
268
272
  }
269
- export interface CommsListMethodsResponse {
270
- ok: true;
271
- methods: import('./contact.js').CommMethod[];
272
- }
273
+ /** What `comms.listMethods` returns: the contact's registered methods in `items` (all of them; `nextCursor` is always null). */
274
+ export type CommsListMethodsResponse = ListResult<import('./contact.js').CommMethod>;
273
275
  export interface RegisterEmailMethodRequest {
274
276
  contactId?: string;
275
277
  email?: string;
@@ -1,3 +1,4 @@
1
+ import type { ListResult, ListOptions } from "./list.js";
1
2
  export type ContactCustomFields = Record<string, any>;
2
3
  export interface Contact {
3
4
  contactId: string;
@@ -29,11 +30,6 @@ export interface Contact {
29
30
  export type ContactResponse = Contact;
30
31
  export type ContactCreateRequest = Omit<Contact, "contactId" | "orgId" | "createdAt" | "updatedAt" | "deletedAt" | "erasedAt">;
31
32
  export type ContactUpdateRequest = Partial<ContactCreateRequest>;
32
- export interface ContactListResponse {
33
- items: Contact[];
34
- limit: number;
35
- offset: number;
36
- }
37
33
  /**
38
34
  * Two contacts that look like one person (`contact.findDuplicates`): `keep` has a sign-in but no email
39
35
  * (or phone); `merge` has no sign-in and holds that sign-in's verified email (or phone).
@@ -46,12 +42,10 @@ export interface ContactDuplicatePair {
46
42
  /** What ties them together. */
47
43
  matchedOn: "email" | "phone";
48
44
  }
49
- export interface ContactDuplicatesResponse {
50
- pairs: ContactDuplicatePair[];
45
+ /** What `contact.findDuplicates` returns: the pairs found in this call (`items`), and how far it looked. */
46
+ export interface ContactDuplicatesResponse extends ListResult<ContactDuplicatePair> {
51
47
  /** How many contacts with a sign-in were checked in this call. */
52
48
  scanned: number;
53
- /** More contacts remain beyond this window: call again with `offset` + `scanned`. */
54
- more: boolean;
55
49
  }
56
50
  /** What `contact.merge` did. */
57
51
  export interface ContactMergeResponse {
@@ -89,7 +83,8 @@ export interface ContactLinkLoginResponse {
89
83
  }
90
84
  /** `error` codes `contact.merge` can refuse with. */
91
85
  export type ContactMergeErrorCode = "INVALID_CONTACT" | "SAME_CONTACT" | "NOT_FOUND" | "KEEP_DELETED" | "LOGIN_CONFLICT" | "LOYALTY_CONFLICT";
92
- export interface ContactSearchParams {
86
+ /** `contact.search` options: the collection, the filters, plus `limit` and `cursor`. */
87
+ export interface ContactSearchParams extends ListOptions {
93
88
  collectionId: string;
94
89
  q?: string;
95
90
  typeahead?: boolean;
@@ -107,13 +102,6 @@ export interface ContactSearchParams {
107
102
  externalIdValue?: string;
108
103
  customFieldKey?: string;
109
104
  customFieldValue?: string;
110
- limit?: number;
111
- offset?: number;
112
- }
113
- export interface ContactSearchResponse {
114
- items: Contact[];
115
- limit: number;
116
- offset: number;
117
105
  }
118
106
  export type PublicContactUpsertRequest = Partial<Pick<Contact, "email" | "phone" | "userId" | "firstName" | "lastName" | "displayName" | "company" | "tags" | "source" | "notes" | "avatarUrl" | "locale" | "timezone" | "externalIds">> & {
119
107
  customFields?: ContactCustomFields;
@@ -309,8 +297,6 @@ export interface ContactSchemaResponse {
309
297
  /** Pass-through of the collection's SchemaFormConfig styling block */
310
298
  styling: Record<string, unknown>;
311
299
  }
312
- /** @deprecated Use ContactSchemaResponse instead */
313
- export type ContactSchema = ContactSchemaResponse;
314
300
  /**
315
301
  * Evaluate whether a field's conditions are satisfied given the current form values.
316
302
  * Returns `true` if the field should be visible.
@@ -326,13 +312,3 @@ export type ContactSchema = ContactSchemaResponse;
326
312
  * ```
327
313
  */
328
314
  export declare function evaluateConditions(conditions: FieldCondition[] | undefined, showWhen: 'all' | 'any' | undefined, fieldValues: Record<string, unknown>): boolean;
329
- /**
330
- * @deprecated Use evaluateConditions (plural) instead.
331
- * Shim for code using the old single-condition API.
332
- */
333
- export declare function evaluateCondition(condition: {
334
- dependsOn?: string;
335
- targetFieldId?: string;
336
- operator: string;
337
- value?: unknown;
338
- } | undefined, fieldValues: Record<string, unknown>): boolean;
@@ -54,16 +54,3 @@ export function evaluateConditions(conditions, showWhen, fieldValues) {
54
54
  ? results.some(Boolean)
55
55
  : results.every(Boolean);
56
56
  }
57
- /**
58
- * @deprecated Use evaluateConditions (plural) instead.
59
- * Shim for code using the old single-condition API.
60
- */
61
- export function evaluateCondition(condition, fieldValues) {
62
- var _a;
63
- if (!condition)
64
- return true;
65
- const targetFieldId = (_a = condition.dependsOn) !== null && _a !== void 0 ? _a : condition.targetFieldId;
66
- if (!targetFieldId)
67
- return true;
68
- return evaluateConditions([{ targetFieldId, operator: condition.operator, value: condition.value }], 'all', fieldValues);
69
- }
@@ -7,6 +7,7 @@
7
7
  *
8
8
  * @see docs/container-tracking.md
9
9
  */
10
+ import type { ListResult, ListOptions } from './list.js';
10
11
  /** Lifecycle status of a container. Custom strings are permitted. */
11
12
  export type ContainerStatus = 'active' | 'archived' | string;
12
13
  /**
@@ -134,24 +135,13 @@ export interface RemoveContainerItemsInput {
134
135
  /** `ContainerItem` UUIDs to mark as removed */
135
136
  ids: string[];
136
137
  }
137
- export interface ListContainersResponse {
138
- containers: Container[];
139
- limit: number;
140
- offset: number;
141
- }
142
- export interface PublicListContainersResponse {
143
- containers: Container[];
144
- }
145
- /** What findForItem answers: the item's current membership rows (each has `containerId`) and those containers. */
146
- export interface FindContainersForItemResponse {
147
- items: ContainerItem[];
138
+ /**
139
+ * What findForItem answers: the item's current membership rows in `items` (each has `containerId`) and
140
+ * those containers. All of them in one answer: `nextCursor` is always null.
141
+ */
142
+ export interface FindContainersForItemResponse extends ListResult<ContainerItem> {
148
143
  containers: Container[];
149
144
  }
150
- export interface ContainerItemsResponse {
151
- items: ContainerItem[];
152
- limit: number;
153
- offset: number;
154
- }
155
145
  export interface AddContainerItemsResponse {
156
146
  items: ContainerItem[];
157
147
  }
@@ -159,7 +149,8 @@ export interface RemoveContainerItemsResponse {
159
149
  success: true;
160
150
  removedCount: number;
161
151
  }
162
- export interface ListContainersParams {
152
+ /** `containers.list` / `containers.publicList` options: the filters, plus `limit` (default 100) and `cursor`. */
153
+ export interface ListContainersParams extends ListOptions {
163
154
  /** Filter by container type label */
164
155
  containerType?: string;
165
156
  /** Filter by status */
@@ -170,11 +161,9 @@ export interface ListContainersParams {
170
161
  parentContainerId?: string;
171
162
  /** When `true`, return only top-level containers (no `parentContainerId`) */
172
163
  topLevel?: boolean;
173
- /** Default 100 */
174
- limit?: number;
175
- /** Default 0 */
176
- offset?: number;
177
164
  }
165
+ /** What `containers.publicList` takes: the public list is always the active containers, so it has no `status` or `ref`. */
166
+ export type PublicListContainersParams = Omit<ListContainersParams, 'status' | 'ref'>;
178
167
  export interface GetContainerParams {
179
168
  /** When `true`, recursively embed child containers up to `treeDepth` levels */
180
169
  tree?: boolean;
@@ -183,13 +172,13 @@ export interface GetContainerParams {
183
172
  /** When `true`, embed the current `items` array */
184
173
  includeContents?: boolean;
185
174
  }
186
- export interface ListContainerItemsParams {
175
+ /**
176
+ * `containers.listItems` options. `limit` (default 200) and `cursor` page the membership log
177
+ * (`history: true`); the current contents come back whole.
178
+ */
179
+ export interface ListContainerItemsParams extends ListOptions {
187
180
  /** When `true`, include removed items (full membership log); default `false` */
188
181
  history?: boolean;
189
- /** Default 100 */
190
- limit?: number;
191
- /** Default 0 */
192
- offset?: number;
193
182
  }
194
183
  export interface FindContainersForItemParams {
195
184
  /** Required */
@@ -3,6 +3,7 @@
3
3
  *
4
4
  * Types for managing crates (containers for tags/products).
5
5
  */
6
+ import type { ListOptions } from './list.js';
6
7
  /**
7
8
  * Item within a crate.
8
9
  */
@@ -27,21 +28,12 @@ export interface Crate {
27
28
  deletedAt?: string | null;
28
29
  }
29
30
  /**
30
- * Query parameters for listing crates.
31
+ * `crate.list` options: `limit` (default 100, max 100) and `cursor`, plus whether to include
32
+ * soft-deleted crates.
31
33
  */
32
- export interface ListCratesRequest {
33
- limit?: number;
34
- startAfter?: string;
34
+ export interface ListCratesRequest extends ListOptions {
35
35
  includeDeleted?: boolean;
36
36
  }
37
- /**
38
- * Response from listing crates.
39
- */
40
- export interface ListCratesResponse {
41
- items: Crate[];
42
- hasMore: boolean;
43
- lastId: string | null;
44
- }
45
37
  /**
46
38
  * Response from getting a single crate.
47
39
  */
@@ -1,3 +1,4 @@
1
+ import type { ListOptions } from "./list.js";
1
2
  /**
2
3
  * The registry environments: `acc` = the EU test registry, `prod` = the live EU registry, `practice` = the SmartLinks
3
4
  * practice registry (never the EU — for trying the whole flow before a brand is verified with the EU), `local` = a
@@ -198,13 +199,12 @@ export interface DppPassportVersion {
198
199
  savedAt: string;
199
200
  savedBy: string | null;
200
201
  }
201
- export interface DppPassportListQuery {
202
+ /** `dpp.passports.list` options: the filters, plus `limit` and `cursor`. */
203
+ export interface DppPassportListQuery extends ListOptions {
202
204
  productId?: string;
203
205
  batchId?: string;
204
206
  proofId?: string;
205
207
  status?: "active" | "withdrawn";
206
- limit?: number;
207
- offset?: number;
208
208
  }
209
209
  export interface DppRegisterResult {
210
210
  /** One registry request per product group (and kind), up to 100 passports each. */
package/dist/types/dpp.js CHANGED
@@ -1,2 +1 @@
1
- // src/types/dpp.ts — EU Digital Product Passports hosted by SmartLinks, and the brand's EU registry connection (dpp.*)
2
1
  export {};
@@ -33,14 +33,12 @@ export declare class SmartlinksApiError extends Error {
33
33
  * Returns the numeric error code from the server response, if available.
34
34
  * This is typically the HTTP status code (400, 401, 500, etc.).
35
35
  *
36
- * For server-defined string error codes like "NOT_AUTHORIZED" or "broadcasts.topic.invalid",
37
- * use: `error.details?.errorCode || error.details?.error`
36
+ * For the server's own code (a string such as "NOT_FOUND" or "UNKNOWN_PARAMETER"), use `error.errorCode`.
38
37
  */
39
38
  get code(): number | undefined;
40
39
  /**
41
- * Returns the server-specific error code string.
42
- * This is distinct from the HTTP status code (e.g., "NOT_AUTHORIZED", "broadcasts.topic.invalid").
43
- * This is the primary identifier to check for programmatic error handling.
40
+ * The server's code for what went wrong, in UPPER_SNAKE: "NOT_FOUND", "UNKNOWN_PARAMETER",
41
+ * "INVALID_QUERY". This is what to check in code; the message is for people and may change.
44
42
  */
45
43
  get errorCode(): string | undefined;
46
44
  /**
@@ -48,6 +46,11 @@ export declare class SmartlinksApiError extends Error {
48
46
  * This object contains various server-specific fields that may vary by endpoint.
49
47
  */
50
48
  get details(): Record<string, any> | undefined;
49
+ /**
50
+ * The id of the request on the server, when the answer carried one. Quote it when reporting a problem:
51
+ * it finds the request in the logs.
52
+ */
53
+ get requestId(): string | undefined;
51
54
  /**
52
55
  * Check if this is a client error (4xx status code).
53
56
  */
@@ -27,17 +27,15 @@ export class SmartlinksApiError extends Error {
27
27
  * Returns the numeric error code from the server response, if available.
28
28
  * This is typically the HTTP status code (400, 401, 500, etc.).
29
29
  *
30
- * For server-defined string error codes like "NOT_AUTHORIZED" or "broadcasts.topic.invalid",
31
- * use: `error.details?.errorCode || error.details?.error`
30
+ * For the server's own code (a string such as "NOT_FOUND" or "UNKNOWN_PARAMETER"), use `error.errorCode`.
32
31
  */
33
32
  get code() {
34
33
  var _a;
35
34
  return (_a = this.errorResponse) === null || _a === void 0 ? void 0 : _a.code;
36
35
  }
37
36
  /**
38
- * Returns the server-specific error code string.
39
- * This is distinct from the HTTP status code (e.g., "NOT_AUTHORIZED", "broadcasts.topic.invalid").
40
- * This is the primary identifier to check for programmatic error handling.
37
+ * The server's code for what went wrong, in UPPER_SNAKE: "NOT_FOUND", "UNKNOWN_PARAMETER",
38
+ * "INVALID_QUERY". This is what to check in code; the message is for people and may change.
41
39
  */
42
40
  get errorCode() {
43
41
  var _a;
@@ -51,6 +49,15 @@ export class SmartlinksApiError extends Error {
51
49
  var _a;
52
50
  return (_a = this.errorResponse) === null || _a === void 0 ? void 0 : _a.details;
53
51
  }
52
+ /**
53
+ * The id of the request on the server, when the answer carried one. Quote it when reporting a problem:
54
+ * it finds the request in the logs.
55
+ */
56
+ get requestId() {
57
+ var _a, _b;
58
+ const id = (_b = (_a = this.errorResponse) === null || _a === void 0 ? void 0 : _a.details) === null || _b === void 0 ? void 0 : _b.requestId;
59
+ return typeof id === 'string' ? id : undefined;
60
+ }
54
61
  /**
55
62
  * Check if this is a client error (4xx status code).
56
63
  */