@01.software/sdk 0.40.0 → 0.41.1

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 (50) hide show
  1. package/CHANGELOG.md +506 -0
  2. package/MIGRATION.md +183 -0
  3. package/README.md +12 -1
  4. package/dist/analytics/react.cjs.map +1 -1
  5. package/dist/analytics/react.js.map +1 -1
  6. package/dist/analytics.cjs.map +1 -1
  7. package/dist/analytics.js.map +1 -1
  8. package/dist/client.cjs +4 -1
  9. package/dist/client.cjs.map +1 -1
  10. package/dist/client.d.cts +6 -6
  11. package/dist/client.d.ts +6 -6
  12. package/dist/client.js +4 -1
  13. package/dist/client.js.map +1 -1
  14. package/dist/{collection-client-CKFa99C6.d.ts → collection-client-BdcxkW7l.d.ts} +5 -5
  15. package/dist/{collection-client-VYwYi6u6.d.cts → collection-client-Bk--pNzW.d.cts} +5 -5
  16. package/dist/{const-ymprfiPf.d.ts → const-HwdntWtG.d.ts} +1 -1
  17. package/dist/{const-4BUtUdGU.d.cts → const-qGGI7Uii.d.cts} +1 -1
  18. package/dist/{index-w36lpSkU.d.ts → index-B1oW50RY.d.ts} +3 -3
  19. package/dist/{index-Dquv4xTL.d.cts → index-DiXtjVab.d.cts} +3 -3
  20. package/dist/index.cjs +18 -5
  21. package/dist/index.cjs.map +1 -1
  22. package/dist/index.d.cts +7 -7
  23. package/dist/index.d.ts +7 -7
  24. package/dist/index.js +18 -5
  25. package/dist/index.js.map +1 -1
  26. package/dist/{payload-types-DC0xzR9i.d.cts → payload-types-CqJOgON7.d.cts} +0 -3
  27. package/dist/{payload-types-DC0xzR9i.d.ts → payload-types-CqJOgON7.d.ts} +0 -3
  28. package/dist/query.d.cts +5 -5
  29. package/dist/query.d.ts +5 -5
  30. package/dist/realtime.cjs.map +1 -1
  31. package/dist/realtime.d.cts +2 -2
  32. package/dist/realtime.d.ts +2 -2
  33. package/dist/realtime.js.map +1 -1
  34. package/dist/server.cjs +10 -5
  35. package/dist/server.cjs.map +1 -1
  36. package/dist/server.d.cts +7 -7
  37. package/dist/server.d.ts +7 -7
  38. package/dist/server.js +10 -5
  39. package/dist/server.js.map +1 -1
  40. package/dist/{types-Umd-YTjM.d.ts → types-BKa9z9s2.d.cts} +36 -5
  41. package/dist/{types-Bh2p-EMc.d.ts → types-BMI3M0nb.d.ts} +1 -1
  42. package/dist/{types-BvpjooU-.d.cts → types-ByLSG-O3.d.cts} +1 -1
  43. package/dist/{types-D5uHrPLr.d.cts → types-DgfXb7iV.d.ts} +36 -5
  44. package/dist/ui/form.d.cts +1 -1
  45. package/dist/ui/form.d.ts +1 -1
  46. package/dist/ui/video.d.cts +1 -1
  47. package/dist/ui/video.d.ts +1 -1
  48. package/dist/webhook.d.cts +4 -4
  49. package/dist/webhook.d.ts +4 -4
  50. package/package.json +4 -2
package/CHANGELOG.md ADDED
@@ -0,0 +1,506 @@
1
+ # @01.software/sdk
2
+
3
+ ## 0.41.1
4
+
5
+ ### Patch Changes
6
+
7
+ - ecc7fde: Allow collection delete helpers to pass the `trash` query option, so callers can
8
+ explicitly target trashed documents during cleanup flows without hand-building
9
+ request URLs.
10
+ - 1f44b5d: Regenerate `payload-types.ts`: drop the `Deprecated: compatibility alias for
11
+ displayStatus` JSDoc comment from `Order.status`. The Console removed that
12
+ operator-facing `admin.description` copy and hid the deprecated `status` alias
13
+ from the order detail form, so the generated SDK type loses the comment. The
14
+ `Order.status` type shape (union, required) is unchanged — generated-types sync
15
+ only, no API or behavior change.
16
+
17
+ ## 0.41.0
18
+
19
+ ### Minor Changes
20
+
21
+ - 02d271b: Add `projectProductToListingShape(product)` — a pure, non-lossy adapter that
22
+ turns a product read from the raw `collections.from('products').find()` escape
23
+ hatch into the listing shape the SDK builders consume. A raw/public product
24
+ already carries `priceRange`, `availableForSale`, and
25
+ `selectedOrFirstAvailableVariant` but has no `featuredImage`; the adapter fills
26
+ it from the first gallery image so SSG/sitemap consumers can feed
27
+ `buildProductListingGroupsByOption` / `buildProductListingCard` without
28
+ hand-rolling the projection.
29
+ - eb6a4aa: Add `getVariantAvailableForSale(variant)` and `getVariantAvailableStock(variant)`
30
+ pure helpers to the root entry. They expose the SDK's server-equivalent variant
31
+ sellability rule (`isActive && (isUnlimited || stock - reservedStock > 0)`) and a
32
+ Shopify-style `quantityAvailable` number (`max(0, stock - reservedStock)`, or
33
+ `null` when unlimited), so storefronts can compute `availableForSale` without
34
+ re-implementing the check or shipping raw `stock`/`reservedStock` to the browser.
35
+
36
+ ### Patch Changes
37
+
38
+ - 1c93448: Ship `MIGRATION.md` and `CHANGELOG.md` in the published npm tarball. The
39
+ `files` field previously included only `dist`, so the migration docs referenced
40
+ by the release notes were absent from the installed package. The README
41
+ changelog section now points at the shipped `CHANGELOG.md` / `MIGRATION.md`.
42
+
43
+ ## 0.40.0
44
+
45
+ ### Minor Changes
46
+
47
+ - 85abdd1: BREAKING (0.x minor): Remove legacy `CustomerAddress.isDefault` from generated SDK Payload types. Customer default shipping and billing addresses are now represented only by `Customer.defaultShippingAddress` and `Customer.defaultBillingAddress`.
48
+ - 3c3cb1f: **BREAKING (0.x minor)** — expose Shopify-shaped product listing fields (#1207).
49
+
50
+ The internal `listing` projection has been replaced by Shopify-aligned top-level
51
+ fields on `ProductDetail` and `ProductDetailCatalog`:
52
+ - Removed public exports: `ProductDetailListing`, `ProductDetailCatalogListing`,
53
+ `ProductListingGroupsCatalogListing`.
54
+ - Removed the `listing` field from `ProductDetail` / `ProductDetailCatalog`.
55
+ - Added `featuredImage`, `priceRange` (`ProductPriceRange`), `compareAtPriceRange`
56
+ (`ProductMoneyRange`), `availableForSale`, and `selectedOrFirstAvailableVariant`.
57
+ - `ProductDetailDisplayMediaSource` member `'listing_primary'` renamed to
58
+ `'featured_image'`.
59
+ - `ProductListingPageSort` literals renamed (`'listing.minPrice'` →
60
+ `'priceRange.minVariantPrice.amount'`, etc.).
61
+ - Private-contract helper `resolveListingPrimaryImagePointer` renamed to
62
+ `resolveFeaturedImagePointer`.
63
+ - `ProductUpsertResponse` staleness hint renamed `listingProjectionStale` →
64
+ `productProjectionStale`.
65
+
66
+ See `packages/sdk/MIGRATION.md` (“Shopify-shaped product listing fields (#1207)”)
67
+ for the full consumer migration path.
68
+
69
+ - 31ff635: BREAKING (0.x minor): align product media with Shopify-style gallery ordering. Product listing/detail helpers no longer expose product-level `primaryMediaItemId` or `thumbnail` as canonical inputs; use `images[0]` / `featuredImage` instead.
70
+ - 7b1cfa3: BREAKING (0.x minor): Events range responses now expose the tenant-global calendar as `calendar` instead of `calendars`, and embedded range events use `event.calendar` instead of `event.calendars`. Calendar range filters now accept one `calendar` or `calendarSlug` value to match the singleton event calendar model.
71
+
72
+ ### Patch Changes
73
+
74
+ - 4f1f970: Move `canvas-nodes` and `canvas-edges` out of browser-public collection discovery while keeping them available to server-auth SDK clients.
75
+ - a55bbb2: Checkout/order separation (#1285): when the platform flag
76
+ `CHECKOUT_ORDER_SEPARATION` is on, `checkout()` resolves to a Checkout that is
77
+ promoted to an Order at payment. The public response stays `PublicOrder`-shaped
78
+ via the `projectCheckoutAsOrder` shim. `orderNumber` remains the stable
79
+ cross-window correlation key; pre-payment `id` is checkout-backed until
80
+ promotion, and `status` is projected to the legacy-compatible `pending` value for
81
+ open checkouts. No breaking change; the distinct `PublicCheckout` surface
82
+ remains a deferred follow-up.
83
+ - b4ceb12: Add `placedAt` to the public `Order` type. This write-once timestamp marks when an order was first placed (the first paid transition) and is the placed-date basis for sales reporting. The field is additive and optional, so existing consumers are unaffected.
84
+ - 67f35a7: Expose `returnStatus` on public order responses and document `status` /
85
+ `displayStatus` as deprecated compatibility aliases.
86
+ - 3ce85af: Clarify generated order shipment field descriptions for tenant administrators.
87
+ - 5b7daed: Expose product `storefrontVisibility` in generated SDK Payload types.
88
+ - 645d7d4: Expose `customer-profile-stats` as a browser-readable public collection and type its public profile stats shape.
89
+ - 60063b7: Expose the `refunded` transaction status across SDK and CLI transaction update contracts.
90
+ - 30333d3: Move tenant commerce config into the SDK internal collection registry while keeping storefront collection discovery unchanged.
91
+
92
+ ## 0.39.0
93
+
94
+ ### Minor Changes
95
+
96
+ - 07d3d00: BREAKING (0.x minor): browser publishable-key raw collection reads now reject
97
+ relationship-expanded `depth`, `joins`, or `populate` options before making a
98
+ request. Direct HTTP raw reads with publishable keys return `400` for the same
99
+ contract violation instead of a not-found response.
100
+
101
+ Browser commerce listing-group helpers are catalog-only: `listingPage()` and
102
+ `listingGroups()` use public-safe catalog endpoints, and full listing-group
103
+ responses require server credentials.
104
+
105
+ - 07d3d00: Add `commerce.product.listingPage()` and the matching React Query helper
106
+ surface, including `useProductListingPage()`, for greenfield product listing
107
+ pages.
108
+ - 77eb02f: Add a storefront cache resource helper subpath for product listing/detail SSG and ISR invalidation tags.
109
+
110
+ ### Patch Changes
111
+
112
+ - 52f947a: Add browser-safe storefront content helpers for links and gallery items.
113
+
114
+ ## 0.38.0
115
+
116
+ ### Minor Changes
117
+
118
+ - f6263df: Sanitize public SDK response surfaces and split browser-public collection
119
+ discovery from server-auth collection access.
120
+
121
+ The SDK now routes community post/comment reads through projected public
122
+ endpoints, exposes projected community response types, and removes raw
123
+ customer/order/cart/media/community slugs from browser-public `COLLECTIONS`.
124
+ Server-auth clients continue to address those slugs through
125
+ `SERVER_COLLECTIONS`.
126
+
127
+ The CLI now validates and discovers server-auth collections for authenticated
128
+ agent and CRUD workflows.
129
+
130
+ BREAKING (0.x minor): browser `COLLECTIONS` no longer includes raw
131
+ customer/order/cart/media/community slugs; use `SERVER_COLLECTIONS` or
132
+ `@01.software/sdk/server` for raw server-auth access. Browser publishable-key raw
133
+ collection reads now default SDK calls to `depth=0&joins=false`, and raw
134
+ publishable-key reads require those relationship-expansion defaults. Use shaped
135
+ helpers such as `commerce.product.detail()`, `commerce.cart.*`, community
136
+ helpers, and customer order helpers for populated customer-facing DTOs. Cart and
137
+ customer order methods now return sanitized public DTOs instead of raw Payload
138
+ documents.
139
+
140
+ ### Patch Changes
141
+
142
+ - 0af07b3: Add generated Payload type documentation for Admin collection descriptions.
143
+ - 7ca5b46: Refresh generated Payload SDK types after removing descriptions for retired Console-only collections.
144
+ - 992bf72: Update generated event visibility documentation in SDK payload types to match the hardened public event API contract.
145
+ - b2ce208: Expose structured event recurrence fields in generated SDK event collection types.
146
+ - 1ba77f6: Drop the unreachable order-level `failed` status from the public order types.
147
+
148
+ Order-level payment failure is recorded as `Transaction.status = failed` while
149
+ the order stays `pending`; permanent abandonment uses cancellation. Generated
150
+ SDK Payload types and the public `CancelOrderStatus` union no longer include
151
+ order-level `failed` (transaction, fulfillment, and shipment `failed` are
152
+ unchanged). The MCP `cancel-order` guidance no longer lists order-level `failed`
153
+ as a local cancel-from state.
154
+
155
+ - 3cbf9b6: Generated Payload types: `inventory-reservations` gains a `pending` (pre-payment
156
+ checkout hold) status alongside `held`/`released`/`consumed`, plus an optional
157
+ `expiresAt` TTL field. Additive and backward-compatible — part of the
158
+ checkout-time inventory reservation that prevents payment-window oversell (#1033).
159
+ - 1034772: Classify the new `inventory-adjustments` collection as SDK-internal and sync
160
+ generated Payload types. The collection is the Console-side append-only
161
+ finite-stock movement ledger (#1038); it is hidden from SDK/MCP collection
162
+ discovery.
163
+
164
+ Behavior note for direct `product-variants` updates: changing tracked `stock`
165
+ via the collection API now requires the write-only `stockAdjustmentReason`
166
+ field (`received | correction | damage | loss | cycle_count | other`) unless
167
+ the write comes from an instrumented server flow. Updates without it are
168
+ rejected with `400 stock_adjustment_reason_required`.
169
+
170
+ - 2313263: Align confirm-payment and public catalog contracts with server behavior.
171
+
172
+ The CLI `transaction confirm-payment` command now supports an explicit
173
+ `--idempotency-key`, rejects malformed amount tokens without truncation, and
174
+ accepts zero amounts per the confirm-payment contract. The SDK now exposes
175
+ `paymentKey` on confirm-payment params and stock-stripped catalog listing
176
+ response types.
177
+
178
+ - 188f052: Register the `order-export-profiles` collection in the SDK collection set
179
+ (server-only) and generate its Payload type. The collection stores reusable,
180
+ schema-validated order export layouts consumed by the Console export mapping
181
+ engine; it is not exposed on the public storefront/query surface.
182
+ - 9275bee: Clarify generated order display status field descriptions for the orders composite status UX.
183
+ - 2c98b63: `CreateOrderItem.product` and `.option` are now optional: the create-order
184
+ endpoint derives the line's product from the variant's parent server-side,
185
+ so storefront items may send `variant` + `quantity` only.
186
+ - 75f57f8: Order reads now include Shopify-style display axes in the generated SDK Payload
187
+ types: `displayFinancialStatus`, `displayFulfillmentStatus`, and non-null
188
+ `returnStatus`, while preserving the legacy compatibility status fields.
189
+ - 62a2966: Expose the generated `billing_key_update` billing-history type in the public SDK
190
+ Payload types.
191
+
192
+ ## 0.37.0
193
+
194
+ ### Minor Changes
195
+
196
+ - b6ce22b: Analytics: skip event sends on local hosts by default.
197
+
198
+ `createAnalytics()` and `<Analytics />` gain a `mode` option
199
+ (`'auto' | 'production' | 'development'`, default `'auto'`). In `'auto'` mode no
200
+ events are sent when the page runs on `localhost` / `127.0.0.1` / `*.local`;
201
+ validation and dev warnings still run and a one-time console notice is emitted.
202
+ Pass `mode: 'production'` to send while developing, or `mode: 'development'` to
203
+ force-disable on any host. The hosted analytics snippet gains an equivalent
204
+ `captureOnLocalhost` opt-in (`window.__01_analytics__.captureOnLocalhost` or
205
+ `data-capture-localhost="true"`). This is observable behavior INVARIANT 9.
206
+
207
+ - 3068b31: Add `createCommerceNotificationWebhookHandler` and related commerce notification webhook types on the public webhook subpath. `createCommerceEmailWebhookHandler` remains a compatibility alias. Update MCP webhook guidance shipped in the CLI MCP stdio artifact.
208
+ - 1b00174: BREAKING: Tighten product upsert swatch input types so color swatches require `color` and media swatches require `mediaItemId`.
209
+ - 5072a76: Add `PRODUCT_PLP_FIND_OPTIONS` for join-safe raw `products.find()` PLP queries and document `listingGroupsCatalog()` as the preferred listing path. MCP query-builder docs now explain Payload join-field default limits.
210
+ - 79e52c8: Add tenant-configurable initial order shipping refund policy on returns. SDK create-return and return-with-refund clients accept `initialShippingRefundAmount` and override note fields; CLI `return create` and `return refund` expose matching flags.
211
+ - 030e030: Improve SDK relation and order input ergonomics.
212
+
213
+ `resolveRelation<T>()` now accepts unknown relation values, and create-order
214
+ inputs accept `items` as a storefront-facing alias that serializes to the
215
+ existing `orderItems` endpoint field. The CLI order create path stays aligned
216
+ with the SDK order input contract.
217
+
218
+ - d661646: Add Shopify-like fulfillment preparation and shipment APIs. Fulfillment creation can start shipment without carrier/tracking, and fulfillment updates can add or correct tracking information later.
219
+
220
+ ### Patch Changes
221
+
222
+ - e6c6f59: Normalize community create/update helper responses that return Payload `{ doc }` wrappers so SDK callers receive the created or updated resource directly.
223
+ - bb22a83: Fix `IMAGE_SIZES` to match platform upload tiers `[200, 400, 800, 1200, 1600]` so `getImageUrl` and `getImageSrcSet` select real renditions instead of silently falling back to originals. Legacy numeric size keys (e.g. `1536`) remain supported at runtime.
224
+ - 02e41c8: Expose the operator-voided `Fulfillment.status = 'canceled'` value in generated SDK Payload types.
225
+ - ca495fc: Expose optional `ProductTag.color` metadata in generated SDK Payload types.
226
+
227
+ ## 0.36.0
228
+
229
+ ### Minor Changes
230
+
231
+ - c4956b2: Paid order cancel responses now include `refundPending: true` when a captured
232
+ payment still awaits storefront PG refund after local cancellation. Legacy
233
+ `reconciliationRequired` responses remain for older inline-PG-cancel rows.
234
+ MCP order-flow guidance reflects local-only cancel ownership.
235
+
236
+ **Consumer migration:** `providerRefunded` is no longer `true` on new cancels.
237
+ Paid local cancel responses now always have `refundedAmount: 0` and
238
+ `refundPending: true` instead of a positive `refundedAmount` and
239
+ `providerRefunded: true`.
240
+
241
+ - 06e061a: Add `POST /api/orders/resolve-cancel-refund` and
242
+ `client.commerce.orders.resolveCancelRefund(...)` so storefront/BFF code can
243
+ report PG cancel-refund success or failure back to the platform idempotently.
244
+ The existing `alreadyCanceled + refundPending` cancel-order response remains
245
+ backward-compatible and continues to accept any nonnegative `refundedAmount`;
246
+ new paid local-cancel responses still emit `refundedAmount: 0` while PG refund
247
+ settlement is pending by design (#826).
248
+ - b97d35e: BREAKING (0.x minor): Simplify listing projection — remove persisted listing
249
+ grouping and `listingPrimaryOption` across console, contracts, and SDK surfaces.
250
+ `ProductListingGroupsItem` drops `primaryOptionId`, `listingGroupingState`, and
251
+ `listingGroupingEmptyReason`; generated `Product` types drop `listingPrimaryOption`
252
+ and `listing.grouping*` fields; SDK no longer exports `ListingGroupingState` /
253
+ `ListingGroupingEmptyReason`. Swatch groups derive from the first product option
254
+ by `_order`. `buildProductListingCard` uses persisted min/max when both are present
255
+ and merges compare-at from groups when compare-at keys are absent. See
256
+ `packages/sdk/MIGRATION.md`.
257
+
258
+ ## 0.35.0
259
+
260
+ ### Minor Changes
261
+
262
+ - 10fff1d: Add the `@01.software/sdk/errors` public subpath for SDK error classes, type
263
+ guards, and factory helpers. The entrypoint re-exports the same surface already
264
+ available from the root package without pulling React, Next.js, or internal SDK
265
+ modules. ESM and CJS builds are included in the published artifact.
266
+
267
+ ## 0.34.0
268
+
269
+ ### Minor Changes
270
+
271
+ - BREAKING (0.x minor): Simplify listing projection — remove persisted listing
272
+ grouping and `listingPrimaryOption` across console, contracts, and SDK surfaces.
273
+ `ProductListingGroupsItem` drops `primaryOptionId`, `listingGroupingState`, and
274
+ `listingGroupingEmptyReason`; generated `Product` / `ProductsSelect` drop
275
+ `listingPrimaryOption` and `listing.grouping*` fields; SDK no longer exports
276
+ `ListingGroupingState` / `ListingGroupingEmptyReason`. Swatch groups derive from
277
+ the first product option by `_order` (migration reorders legacy primaries).
278
+ `buildProductListingCard` uses persisted min/max when both are present and
279
+ merges compare-at from groups when compare-at keys are absent.
280
+ See `MIGRATION.md` (Listing projection simplification).
281
+ - 0c12c2b: BREAKING (0.x minor): Remove the Canvas `BUILT_IN_NODE_TYPES` and
282
+ `BUILT_IN_EDGE_TYPES` exports. Canvas node and edge definitions now come from the
283
+ tenant database catalog. Optional starter rows are imported through explicit
284
+ migrate or seed commands; `useCanvasData()` defaults `nodeTypeDefs` and
285
+ `edgeTypeDefs` to empty arrays unless callers pass catalog data.
286
+ - bafcf2d: Add catalog/stock split commerce reads: `detailCatalog()`, `listingGroupsCatalog()`, `stockSnapshot()`, and `mergeProductDetailWithStock()` for edge-cached catalog shells with live inventory snapshots. Existing `detail()` and POST endpoints remain unchanged.
287
+ - 7990112: Product admin save splits Payload document writes from graph upsert; SDK mirrors upsert graph conflict and revision-required error bodies without depending on private contracts. CLI aligns with vitest 4 catalog for dependency health.
288
+ - 2bf6ddc: Add `ProductSelectionCodecOptions.fillDefaults` and exported `selectNext()` for product selection. Opt-in `fillDefaults` on `resolveProductSelection()` fills unselected options to a concrete variant using available-by-order rules aligned with listing `selectionHintVariant`. `selectNext()` applies slug-based option-click transitions, keeps compatible prior selections, and re-defaults incompatible ones. Default `fillDefaults` remains `false` for backward compatibility.
289
+ - a56c69a: Add optional `idempotencyKey` to retry-sensitive `server.commerce.orders`
290
+ mutations (`create`, `checkout`, `createFulfillment`, `createReturn`,
291
+ `returnWithRefund`, `confirmPayment`, `cancelOrder`). The SDK sends
292
+ `X-Idempotency-Key` and omits the key from JSON bodies. For `confirmPayment`,
293
+ `idempotencyKey` overrides `providerEventId` when both are set.
294
+
295
+ Expose the provider-verified `server.commerce.orders.cancelOrder()` method and
296
+ public cancel types. `CancelOrderResponse` is now a mutually exclusive union for
297
+ committed, `alreadyCanceled`, and `reconciliationRequired` outcomes, and the SDK
298
+ only sends the explicit cancel request body fields.
299
+
300
+ Add `orderCanceled` to the semantic commerce notification/webhook helper
301
+ surface. Operators should treat `alreadyCanceled` as idempotent success and
302
+ `reconciliationRequired` as the durable handoff signal after a provider refund
303
+ when local cancellation could not safely commit.
304
+
305
+ The matching private contracts package is ignored by changeset policy.
306
+
307
+ - fa4ce7d: Default `commerce.product.detail()` and `listingGroups()` to GET query transport for Edge CDN caching. Console POST endpoints remain supported for backward compatibility and large listing-groups batches.
308
+ - 09e9422: Default product selection URL stringify and `buildProductHref()` partial output to slug-compat params (`opt.color=ivory`) instead of canonical ID params. Adds `ProductListingGroup.optionSlug` in SDK and `@01.software/contracts` for listing href generation. Listing hint `variant=` links require `preferCompleteVariantFromHint: true`. Parse behavior unchanged. Opt out with `emit: 'canonical-id'`.
309
+
310
+ ## 0.33.0
311
+
312
+ ### Minor Changes
313
+
314
+ - 906577e: Add headless commerce email webhook helpers for routing commerce notification events, deriving idempotency keys, and typing tenant email configuration manifests.
315
+ - ecba235: BREAKING (0.x minor): Replace the product-detail `totalInventory` unlimited sentinel with explicit inventory rollups. `commerce.product.detail()` successful payloads now expose `product.hasUnlimitedVariant`; `product.totalInventory` is the tracked stock sum across non-unlimited variants and can be `null` when no variants are tracked.
316
+ - 156ff73: BREAKING (0.x minor): Change `commerce.product.detail()` to return a `ProductDetailResult`
317
+ discriminated union instead of `ProductDetail | null`. Successful responses now
318
+ return `{ found: true, product }`; product-detail 404 responses return
319
+ `{ found: false, reason }` with `not_found`, `not_published`, or
320
+ `feature_disabled`. Permission/auth responses, including 403 tenant mismatch,
321
+ continue to throw typed SDK errors. Any product-detail 404 without an
322
+ allowlisted code/reason also throws instead of being collapsed, so unexpected
323
+ backend absence states remain visible during integration.
324
+ - ef4abdf: Expose commerce notification webhook constants, public types, and a semantic event guard from the SDK webhook entrypoint.
325
+
326
+ ## 0.32.0
327
+
328
+ ### Minor Changes
329
+
330
+ - 4fea701: Add generic order payment confirmation support through `commerce.orders.confirmPayment()`.
331
+ Order creation item IDs now accept string or numeric entity identifiers while
332
+ legacy caller-supplied line prices remain compatibility-only inputs.
333
+ - 6407210: Add the server-only SDK tenant introspection API and route CLI schema and
334
+ feature-progress discovery through the SDK instead of command-local fetches.
335
+
336
+ ### Patch Changes
337
+
338
+ - 11c1878: Remove retired marker wording from order creation compatibility fields.
339
+ - bc94da6: Route customer auth requests through the shared SDK transport so request IDs,
340
+ usage-limit errors, API reason mapping, origin suggestions, and timeout/network
341
+ errors match the rest of the SDK while keeping customer auth endpoint retries
342
+ disabled. Customer auth failures now surface the same SDK-specific error classes
343
+ as other SDK requests instead of the previous generic API error shape.
344
+
345
+ ## Unreleased
346
+
347
+ ### Minor Changes
348
+
349
+ - BREAKING (0.x minor): `resolveProductSelectionMedia()` no longer returns
350
+ `product_primary` or `product_pool`; use `resolveProductDisplayMedia()` or
351
+ `resolveProductSelection()` display fallback when strict selection is `none`.
352
+ Option swatch selection returns the swatch image only, not the full product pool.
353
+ Listing primary display fallback is pool-only (`products.images[]`).
354
+
355
+ - Add `EventsClient` and `client.events` / `server.events` helpers for public
356
+ event occurrence range reads, event registration, guest registration lookup,
357
+ and guest self-cancel flows. These helpers require `X-Publishable-Key`, keep
358
+ `server.events` on the public event-helper credential boundary without
359
+ forwarding `secretKey`, and derive registration `customer` identity from
360
+ customer auth rather than public request body input. **Breaking:** **`POST
361
+ /api/event-registrations/register` rejects `body.customer` with `400
362
+ bad_request`;** bind customers with `Authorization: Bearer` only. See
363
+ `docs/events/public-api-contract.md` for migration. Guest-token lookup/cancel
364
+ helpers send tokens in POST bodies. Range helpers support calendar, category,
365
+ and tag filters aligned with the Console public range endpoint. Exported
366
+ structural `RootClient` / `RootServerClient` keep `events` optional for
367
+ object-literal mocks; `createClient()` / `createServerClient()` return
368
+ `RootClientWithEvents` / `RootServerClientWithEvents` with required `events`.
369
+
370
+ - **BREAKING (0.x minor):** Remove flat `swatchColor` from product-detail option
371
+ values, SDK matrix/selection shapes, and listing projections that mirrored the
372
+ removed Payload field. Use nested `swatch: { type, color, mediaItemId }` (or
373
+ selection `swatch.color` / `swatch.image`). `ProductApi.upsert()` and Console
374
+ HTTP upsert reject unknown `swatchColor` on option-value input; send
375
+ `swatch: { type: 'color', color: '#...' }` instead. MCP `product-upsert` no
376
+ longer documents `swatchColor` in the tool schema.
377
+
378
+ - Add handoff-aligned fields on `ProductSelectionAvailableValue`: `exists` (alias
379
+ of `available`), `label` (same source as `value`), and Shopify-shaped
380
+ `swatch: { color, image }` via exported `ProductSelectionAvailableSwatch`.
381
+ Flat `thumbnail` and `images` on selection values are unchanged. Document
382
+ selection-hint vs `fillDefaults` behavior in SDK README and `AGENTS.md`.
383
+
384
+ - Add `ProductSelectionCodecOptions.fillDefaults` and `selectNext()` for product
385
+ selection. Opt-in `fillDefaults` resolves partial selections to a concrete
386
+ variant using the same available-by-order rules as listing
387
+ `selectionHintVariant`. `selectNext()` applies option-click transitions while
388
+ keeping compatible prior values and re-defaulting incompatible ones.
389
+
390
+ - **BREAKING (0.x minor):** Align `CreateOrderItem` with the create-order API
391
+ request contract. `product`, `variant`, and `option` are required scalar IDs.
392
+ The create-order endpoint still accepts `unitPrice` and `totalPrice` as
393
+ optional compatibility inputs, but the server derives authoritative line money
394
+ values from product variants.
395
+
396
+ - **BREAKING (0.x minor):** Remove legacy product media fields from detail and
397
+ listing contracts. Selection media now resolves through
398
+ `resolveProductSelectionMedia` pointer/pool rules; direct
399
+ `variant.thumbnail`, option-value `thumbnail`/`images`, product `thumbnail`,
400
+ and `mediaSets` gallery fallback fields are no longer authoritative SDK
401
+ resolver inputs. Empty `mediaSets` intentionally falls through to selection
402
+ media. Deprecated one-release `resolveProductMedia` and
403
+ `resolveProductGallery` shims remain for migration, but legacy direct-media
404
+ fallback precedence is removed.
405
+
406
+ - Deprecate `resolveProductGallery`, `utils/product-gallery`, and related
407
+ `ProductMediaSetInput` / `ProductGallerySource` names as one-release shims
408
+ that forward or fall through to `resolveProductSelectionMedia`. Product detail
409
+ `mediaSets` and variant `gallerySource` fields are removed rather than
410
+ deprecated; only the gallery helper names remain as temporary shims.
411
+
412
+ ## 0.31.0
413
+
414
+ ### Minor Changes
415
+
416
+ - 6cadf1e: Remove the generated `parent` field from default tag collection types. Tags are
417
+ now flat by default across content, media, events, canvas, and ecommerce
418
+ taxonomy collections; category collections continue to expose `parent` for
419
+ hierarchy.
420
+ - 6cadf1e: Add `server.preview.detail()` for generic saved-record preview lookups and route
421
+ product `previewDetail()` through the generic preview detail endpoint.
422
+
423
+ Preview redirects now use `/api/preview/start?collection=<slug>&id=<id>` and
424
+ send tenant frontends to `<origin><draftPath>?token=...&collection=<slug>&id=...`.
425
+ Tenant preview configuration has moved to `tenants.previewDestinations` with
426
+ `draftPath` defaulting to `/api/01software/draft`; migrate old product-only
427
+ draft routes and `/api/products/*/preview` integrations to the generic
428
+ collection/id contract.
429
+
430
+ ## 0.30.1
431
+
432
+ ### Patch Changes
433
+
434
+ - auto release 5d91b13ba2
435
+
436
+ ## 0.30.0
437
+
438
+ ### Minor Changes
439
+
440
+ - 51a6399: **BREAKING (0.x minor):** Split feature-specific SDK surfaces out of the root entry so `createClient`
441
+ consumers do not need React Query, Next.js, Payload, rich text, canvas, or code
442
+ highlighting peers. The root entry is now the browser-safe core surface;
443
+ server-only code must import `createServerClient` from `@01.software/sdk/server`,
444
+ and React Query hooks/helpers must import from `@01.software/sdk/query`.
445
+
446
+ Migration notes:
447
+ - `createClient` remains available from `@01.software/sdk` and
448
+ `@01.software/sdk/client`.
449
+ - `createServerClient` must move to `@01.software/sdk/server`; it is no longer
450
+ exported from the root browser-safe entry.
451
+ - React Query hooks and cache helpers must move to `@01.software/sdk/query`.
452
+ - UI components live under explicit `@01.software/sdk/ui/*` sub-paths. Install
453
+ only the optional peers listed for the sub-paths you import.
454
+
455
+ - 51a6399: Add stable product-detail selection helpers for ecommerce storefronts.
456
+
457
+ Product detail responses now expose option and option-value compatibility slugs,
458
+ and the SDK adds helpers for building option matrices from detail responses,
459
+ parsing and stringifying selection URLs, and resolving selected/partial variant
460
+ state. New selection URLs use stable variant/option/value IDs; slug URLs remain
461
+ read-only compatibility input for older storefront links.
462
+
463
+ - 51a6399: Improve tenant-admin consumer ergonomics.
464
+
465
+ Server React Query helpers can now address server-only SDK collections such as
466
+ customer groups, reports, and community bans. SDK clients also accept an
467
+ explicit `apiUrl` override for staging, preview, self-hosted, and proxy
468
+ deployments. README examples now steer product catalog writes through the
469
+ transactional `server.commerce.product.upsert()` helper and clarify the current
470
+ local-only customer auth method boundary.
471
+
472
+ ### Patch Changes
473
+
474
+ - 51a6399: Strengthen packaged SDK boundary checks and document that Console-shared
475
+ contracts stay private.
476
+ - 51a6399: Fix product listing group detail links so grouped option-value selections emit
477
+ partial ID-based selection URLs before falling back to listing hint variants.
478
+
479
+ ## 0.29.0
480
+
481
+ ### Minor Changes
482
+
483
+ - 3061394: Add slug-based product detail selection helpers for ecommerce storefronts.
484
+
485
+ Product detail responses now expose option and option-value slugs, and the SDK
486
+ adds helpers for building option matrices from detail responses, parsing and
487
+ stringifying selection URLs, and resolving selected/partial variant state.
488
+
489
+ ## 0.28.0
490
+
491
+ ### Minor Changes
492
+
493
+ - 75b7b1c: Remove unused playlist and track fields from generated Payload types:
494
+ `playlists.coverArt`, `playlists.isCollaborative`, `playlists.videos`,
495
+ `tracks.content`, `tracks.isFeatured`, `tracks.publishedAt`, and
496
+ `tracks.isEmbeddable`.
497
+
498
+ ## 0.27.0
499
+
500
+ ### Minor Changes
501
+
502
+ - Relax generated collection types for title and event default fields that can
503
+ now be absent or null in tenant content responses.
504
+
505
+ - Add package repository metadata and align release scripts with the Changesets
506
+ and npm trusted publishing workflow.