@01.software/sdk 0.44.0 → 0.45.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 (80) hide show
  1. package/CHANGELOG.md +358 -2
  2. package/MIGRATION.md +89 -10
  3. package/README.md +441 -98
  4. package/dist/{server-nXOezi4b.d.cts → catalog-mappers-sIshKNb3.d.cts} +14 -3
  5. package/dist/{server-nXOezi4b.d.ts → catalog-mappers-sIshKNb3.d.ts} +14 -3
  6. package/dist/client.cjs +2680 -345
  7. package/dist/client.cjs.map +1 -1
  8. package/dist/client.d.cts +10 -7
  9. package/dist/client.d.ts +10 -7
  10. package/dist/client.js +2680 -345
  11. package/dist/client.js.map +1 -1
  12. package/dist/{collection-client-Dyl-CDcj.d.cts → collection-client-BSo7VXQE.d.cts} +8 -5
  13. package/dist/{collection-client-DWooaiTr.d.ts → collection-client-Ckfusuee.d.ts} +8 -5
  14. package/dist/{const-pGDnsy0o.d.ts → const-BAG0MH0u.d.cts} +13 -10
  15. package/dist/{const-1vleZ6ov.d.cts → const-CaPq2AE4.d.ts} +13 -10
  16. package/dist/errors.cjs +74 -1
  17. package/dist/errors.cjs.map +1 -1
  18. package/dist/errors.d.cts +38 -1
  19. package/dist/errors.d.ts +38 -1
  20. package/dist/errors.js +74 -1
  21. package/dist/errors.js.map +1 -1
  22. package/dist/{index-DUNySyxV.d.ts → index-BNICJxBL.d.ts} +4 -4
  23. package/dist/{index-a6g7vqAD.d.cts → index-YGrZrxNn.d.cts} +4 -4
  24. package/dist/index.cjs +2741 -368
  25. package/dist/index.cjs.map +1 -1
  26. package/dist/index.d.cts +18 -19
  27. package/dist/index.d.ts +18 -19
  28. package/dist/index.js +2741 -368
  29. package/dist/index.js.map +1 -1
  30. package/dist/{payload-types-CDsuOEfM.d.cts → payload-types-CJZuXcgF.d.cts} +6671 -4001
  31. package/dist/{payload-types-CDsuOEfM.d.ts → payload-types-CJZuXcgF.d.ts} +6671 -4001
  32. package/dist/query.cjs +550 -101
  33. package/dist/query.cjs.map +1 -1
  34. package/dist/query.d.cts +43 -45
  35. package/dist/query.d.ts +43 -45
  36. package/dist/query.js +550 -101
  37. package/dist/query.js.map +1 -1
  38. package/dist/realtime.cjs.map +1 -1
  39. package/dist/realtime.d.cts +2 -2
  40. package/dist/realtime.d.ts +2 -2
  41. package/dist/realtime.js.map +1 -1
  42. package/dist/server.cjs +2252 -444
  43. package/dist/server.cjs.map +1 -1
  44. package/dist/server.d.cts +11 -10
  45. package/dist/server.d.ts +11 -10
  46. package/dist/server.js +2252 -444
  47. package/dist/server.js.map +1 -1
  48. package/dist/storefront-cache.cjs +65 -1
  49. package/dist/storefront-cache.cjs.map +1 -1
  50. package/dist/storefront-cache.js +65 -1
  51. package/dist/storefront-cache.js.map +1 -1
  52. package/dist/types-BC6rVmJa.d.ts +47 -0
  53. package/dist/{types-CDND3hzq.d.cts → types-BlOvjoTX.d.ts} +1095 -509
  54. package/dist/{types-Dt9FJisi.d.ts → types-C4WuJfw7.d.cts} +1095 -509
  55. package/dist/types-D5p7-m1l.d.cts +47 -0
  56. package/dist/ui/canvas/server.cjs +244 -2
  57. package/dist/ui/canvas/server.cjs.map +1 -1
  58. package/dist/ui/canvas/server.d.cts +27 -1
  59. package/dist/ui/canvas/server.d.ts +27 -1
  60. package/dist/ui/canvas/server.js +244 -2
  61. package/dist/ui/canvas/server.js.map +1 -1
  62. package/dist/ui/canvas.cjs +419 -103
  63. package/dist/ui/canvas.cjs.map +1 -1
  64. package/dist/ui/canvas.d.cts +19 -7
  65. package/dist/ui/canvas.d.ts +19 -7
  66. package/dist/ui/canvas.js +419 -103
  67. package/dist/ui/canvas.js.map +1 -1
  68. package/dist/ui/form.d.cts +1 -1
  69. package/dist/ui/form.d.ts +1 -1
  70. package/dist/ui/video.d.cts +1 -1
  71. package/dist/ui/video.d.ts +1 -1
  72. package/dist/webhook.cjs +2 -1
  73. package/dist/webhook.cjs.map +1 -1
  74. package/dist/webhook.d.cts +4 -4
  75. package/dist/webhook.d.ts +4 -4
  76. package/dist/webhook.js +2 -1
  77. package/dist/webhook.js.map +1 -1
  78. package/package.json +12 -11
  79. package/dist/types-SoXsbKhj.d.cts +0 -33
  80. package/dist/types-oiae_LMm.d.ts +0 -33
package/CHANGELOG.md CHANGED
@@ -1,5 +1,361 @@
1
1
  # @01.software/sdk
2
2
 
3
+ ## 0.45.0
4
+
5
+ ### Minor Changes
6
+
7
+ - f5837fb: Add cart discount-code list APIs and public cart discount-code types so storefront clients can manage multiple discount codes on a cart.
8
+ - 4b99c7b: BREAKING (0.x minor): replace the singular Cart line `admission` input and
9
+ snapshot with the canonical `admissions[]` bundle. Existing callers must wrap
10
+ their admission tuple in an array and read the corresponding bundled response.
11
+
12
+ Also add Cart revision and public attribute support, tenant-scoped client
13
+ references, and the Cart attribute replacement API to the commerce SDK.
14
+ Cart responses now expose only the required canonical minor-unit shape;
15
+ creation returns `{ cart, cartToken, warnings }`, every mutation including
16
+ `clear` returns `{ cart, warnings }`, and the legacy `applyDiscount` /
17
+ `removeDiscount` helpers and routes are removed.
18
+
19
+ The CLI now accepts canonical admission bundles, validates Cart mutations
20
+ locally for both dry-run and execution, and uses the plural discount-code
21
+ replacement command.
22
+
23
+ - f66c5c7: Add customer refresh-token storage and refresh request support so SDK clients can
24
+ use rotating customer refresh-token sessions while preserving legacy bearer
25
+ refresh compatibility.
26
+ - a48daf0: BREAKING (0.x minor): Remove structurally dead ecommerce fields from generated
27
+ Payload types (#1901): `Order.completedAt`, `Order.cartToken`,
28
+ `InventoryAdjustment.metadata`, `PaymentSession.metadata`, and the denormalized
29
+ `DraftOrderItem.productTitle` / `variantTitle` / `sku` fields. These columns had
30
+ no writer and are dropped from the Console schema by migration.
31
+ - ad068d7: BREAKING (0.x minor): Remove the dead `Discount.discountMode` field from the generated collection types; the `code | automatic` toggle was never implemented and is no longer part of the Discounts schema (#1427).
32
+ - 6a546de: Add event admission availability DTOs and a public `events.getAdmissionAvailability` helper.
33
+ - c54f927: Add hosted customer OAuth helpers under `client.customer.oauth` for PKCE
34
+ authorization URLs, code exchange, refresh rotation, and hosted logout.
35
+ - 4abb974: BREAKING (0.x minor): browser product detail reads now return the public-safe
36
+ catalog detail shape, including per-variant `availableForSale` and resolved
37
+ market price metadata while omitting private inventory fields such as `stock`
38
+ and `reservedStock`. Product selection helpers accept catalog details without
39
+ re-exposing private stock fields; trusted server detail reads continue to
40
+ preserve full variant inventory fields.
41
+ - 45bf6b3: Add a `client.markets` / `server.markets` discovery namespace (`list()` for active markets and `default()` for the primary market) plus the client-safe `MarketDTO` type, so storefronts can discover Shopify-like markets and resolve market context without receiving server-only FX, pricing, or provider fields.
42
+ - 288c6cd: Add SDK client market defaults for market-aware commerce helpers. Browser and
43
+ server clients now accept `market`, expose `withMarket(market)`, and apply that
44
+ default to supported product and cart calls unless the individual request
45
+ provides its own market.
46
+ - f441af9: BREAKING (0.x minor): the generated `Market` type replaces the `roundingIncrement`
47
+ number field with a `roundingRule { increment, ending }` group (Shopify-style price
48
+ endings). `roundingRule` stays server-only and is omitted from the public
49
+ `MarketDTO`; storefront discovery is unaffected.
50
+ - 085c121: Expose editable market target countries and widened market country/currency types.
51
+ - 846ba1f: Allow successful cancel-refund resolution responses to keep `transactionStatus:
52
+ "paid"` when an occurrence-scoped partial refund does not fully refund the
53
+ captured payment transaction.
54
+ - 91d7502: Add Product read locale options for detail, listing groups, listing pages, React
55
+ query hooks, and query keys. Storefronts can request `locale: 'ko' | 'en' |
56
+ 'all'` with optional fallback disabling, and `locale: 'all'` response types now
57
+ model localized Product copy objects.
58
+ - a911751: Accept `markets` on `commerce.product.upsert` product fields. The canonical
59
+ upsert contract previously had no `markets` key, so passing one failed with an
60
+ `unknown_field` error and every product created through the upsert path landed
61
+ with an empty market list — silently excluded from market-aware catalogs.
62
+ Products created without an explicit market now inherit the tenant's primary
63
+ active market server-side; the update path is unchanged, so clearing markets
64
+ stays an explicit operator choice.
65
+ - 8fbe821: BREAKING (0.x minor): Remove the dead `EventOccurrence.checkInWindow` (`opensAt`/`closesAt`) field group from the generated collection types; check-in never read or enforced the window, so it is no longer part of the event-occurrences schema (#1892).
66
+ - 3e24e53: Align the return surface with the Shopify Return model (#1857): `ReturnReason`
67
+ gains Shopify granularity (`size_too_large`, `size_too_small`, `color`, `style`,
68
+ `not_as_described`, `wrong_item`, `unknown`) and `updateReturn` accepts the new
69
+ terminal `canceled` status. Both are additive; existing reason codes and
70
+ statuses are unchanged.
71
+ - d29ca1b: BREAKING (0.x minor): replace the legacy provider-paid Order flow with the
72
+ canonical Cart -> Checkout -> PaymentSession -> Order resource model.
73
+ - Rename `commerce.cart.*` to `commerce.carts.*`, rename `get` to `retrieve`,
74
+ require canonical `admissions[]`, and add replace-style Cart attributes and
75
+ discount-code mutations.
76
+ - Add browser/server `commerce.checkouts` and Toss-only
77
+ `commerce.paymentSessions` APIs with required idempotency keys, strict
78
+ responses, capability-safe create results, and typed commerce errors.
79
+ Unavailable providers remain quarantined pending their conformance evidence.
80
+ - Split all trusted Cart, Checkout, and PaymentSession writes onto
81
+ resource-owned `/server/` transport paths so every OpenAPI operation has one
82
+ exact credential policy even when public and server bodies match.
83
+ - Require durable idempotency for every Cart mutation and optimistic
84
+ `expectedRevision` preconditions for token-keyed writes; expose the stable
85
+ `cart_revision_conflict` reason for refetch flows.
86
+ - Replace the legacy public Order projection with required minor-unit money,
87
+ immutable line snapshots, and independent financial, fulfillment, return,
88
+ confirmation, and derived primary-display status axes. Snapshot-only custom
89
+ Order lines expose `product: null` and `variant: null`.
90
+ - Remove provider-paid `orders.create`, `orders.confirmPayment`, and ordinary
91
+ `orders.updateTransaction` SDK/CLI/MCP surfaces.
92
+ - Remove raw Payload commerce documents from the SDK root and remove the
93
+ deprecated inline provider-refund cancel response; public reads use canonical
94
+ DTOs and refund completion stays on its dedicated resolution flow.
95
+ - Remove the specialized `01 order get` raw-document command. Customer Order
96
+ reads use the canonical Order projection; explicit server collection tooling
97
+ remains the trusted operational escape hatch.
98
+ - Migrate generated ecommerce/events starters, CLI commands, documentation,
99
+ migration guidance, and direct-HTTP OpenAPI examples to the canonical flow.
100
+
101
+ - 5344d84: Add optional `market` parameters to product detail, catalog detail, listing
102
+ groups, and listing page helpers so storefronts can request server-resolved
103
+ market catalog prices. Market-aware listing page helpers now reject price
104
+ filters and sorts client-side because market catalog prices are resolved on the
105
+ server instead of from base product projections.
106
+
107
+ Product upsert inputs now accept `variant.marketPrices` fixed market overrides,
108
+ and discount validation accepts `currency`, `market`, and item context so
109
+ absolute-money discount rules fail closed outside explicit base-price or market
110
+ catalog contexts. This includes fixed amount discounts, min order thresholds,
111
+ max discount caps, and fixed/tiered tier thresholds.
112
+
113
+ Catalog product variants now include optional `resolvedPrice` metadata
114
+ (`amount`, `compareAtPrice`, `currency`, `marketId`, and `source`) with the
115
+ resolved market catalog price, while catalog variants continue to expose
116
+ `inventoryPolicy` for availability decisions. Cart create/add-item APIs also
117
+ accept optional `market`; the Console locks the cart market, stores the resolved
118
+ market unit price, and carries the market currency through checkout. Provider
119
+ payment checkout remains constrained to supported KRW flows, and shippable
120
+ non-KRW carts fail closed until non-KRW shipping/payment support is added.
121
+
122
+ BREAKING (0.x minor): Browser `commerce.product.detail()` now returns the
123
+ public-safe catalog detail shape through the same path as `detailCatalog()`.
124
+ Full product detail remains available only through the trusted
125
+ `createServerClient().commerce.product.detail()` read surface because it includes
126
+ operational inventory fields; storefronts that previously read `totalInventory`,
127
+ `stock`, or `reservedStock` from browser detail responses must move those
128
+ overlays to `stockSnapshot()` / `stockCheck()` or a server-credential detail
129
+ read.
130
+
131
+ BREAKING (0.x minor): Root exported `Product`, `ProductVariant`, and `Market`
132
+ types now point at the sanitized public SDK aliases instead of generated Payload
133
+ types. Consumers that imported those root types for package-internal fields such
134
+ as variant `marketPrices` or the raw variant `product` relation should use the
135
+ server client or package-internal generated types instead.
136
+
137
+ - 2dd156a: BREAKING (0.x minor): Update membership subscribe params to match the delegated
138
+ subscribe contract: `customerId` and `customerRef` are required, while
139
+ `pgPaymentId` is optional for trial starts and other non-immediate-charge flows.
140
+ The server membership client exposes secret-key lifecycle methods
141
+ (`subscribe`, `cancel`); the customer-owned `me` view and self-service
142
+ `cancel` method are exposed on the browser/client customer-JWT surface.
143
+ - b440043: Add public `returnCanceled` commerce notification webhook guard and typed
144
+ handler support.
145
+ - ff95684: BREAKING (0.x minor): align ecommerce order and transaction status types with
146
+ Shopify semantics. SDK transaction payload types now expose required
147
+ Shopify-style `kind` values (`authorization`, `sale`, `capture`, `void`,
148
+ `refund`) separately from the local payment/refund `type`. Transaction update
149
+ helpers no longer advertise server-derived `success` writes; legacy-compatible
150
+ `canceled` and `refunded` inputs remain typed for existing callers but are
151
+ server-derived in normal public update flows. Use provider-confirmed `paid` or
152
+ failure-like `failed`/`error` states for public transaction updates.
153
+ - 4bf05e9: Add typed locale and fallbackLocale options for raw collection reads.
154
+ - f4e4fea: Add server-only `tenant.context()` introspection for resolved tenant features, collection availability, field configuration, and optional document counts.
155
+ - 893e5b3: Expose tenant custom-field definition and customData payload types.
156
+ - 402e815: Add `residualCounts` to the `TenantPurgeJob` type. The purge job now records how
157
+ many rows remain per collection after a sweep, including trashed rows, so a run
158
+ that fails to drain a collection is visible rather than reported as complete.
159
+
160
+ Additive and optional; existing readers are unaffected.
161
+
162
+ - 28c232b: Add the `senderIdentity` group to the `Tenant` type. Workspace sender identity
163
+ (display name, reply-to, sending domain and its verification state) now has its
164
+ own canonical group, separate from the commerce-era `commerceNotifications.sender*`
165
+ fields.
166
+
167
+ Additive and optional. The `commerceNotifications` fields are retained and
168
+ dual-written during the expand phase of the rename, so existing readers of either
169
+ group are unaffected; the two carry the same effective sender.
170
+
171
+ ### Patch Changes
172
+
173
+ - 2eee2ef: Allow `discounts.code` to be nullable for code-less automatic discount
174
+ candidates, and add server-derived `appliedDiscount` provenance to carts,
175
+ checkouts, and orders. Cart discount evaluation keeps `discountCodes[]` as
176
+ customer-entered intent: the first applicable entered code wins, otherwise the
177
+ server applies the best eligible automatic candidate.
178
+ - f2314fb: Preserve authored canvas image alt text, localize public renderer ARIA labels,
179
+ and disable focus transitions when the user prefers reduced motion.
180
+ - c66cb8d: Cull offscreen CanvasRenderer nodes by default, memoize node renderers, and set
181
+ explicit canvas query cache lifetimes to reduce repeated template execution.
182
+ - 22a516f: Add reserved Canvas `shape` node types and first-party SVG renderers for terminator, process, decision, input/output, and subprocess geometry.
183
+ - 9cb1f40: Validate every canvas template `srcset` candidate and SVG URL attribute before materializing React elements.
184
+ - 62bbfc0: Share the Canvas template element and prop security policy with server-side save validation.
185
+ - b5c025c: Harden Cart and Checkout capability storage by replacing raw token fields with
186
+ digest and encrypted-recovery metadata in the generated Payload types.
187
+ - d8fbb4e: Expose generated cart, checkout, and order market snapshot fields in SDK types and allow public checkout responses to include the resolved market reference.
188
+ - 84c6b9f: Expose `Checkout.customerNote` in generated SDK Payload types so checkout
189
+ recovery and order placement note snapshots match the public commerce contract.
190
+ - 9a2bedd: Expose generated Checkout payment-slot ownership and PaymentSession provider,
191
+ finalization, and slot recovery axes in SDK Payload types.
192
+ - 4b3e1a7: Regenerate `payload-types` after moving Customer and Product custom fields into
193
+ the standard editor tab layout. The `Customer` and `Product` interface property
194
+ order changes to match the Console field declaration order; the type shape is
195
+ unchanged, so this is a structural no-op for consumers.
196
+ - 3d9cd63: Convert `custom-field-definitions` ordering from a manual `order` number field to
197
+ Payload native `orderable: true` (`_order` fractional index). The manual `order`
198
+ defaulted to `0`, so every new definition tied and display order was
199
+ non-deterministic. Generated Payload types drop `CustomFieldDefinition.order` and
200
+ add `_order`; the collection now supports deterministic, drag-based reordering in
201
+ the Admin Panel and consumers sort by `_order` (#1959).
202
+ - fbaff3a: Clarify that customer `retainUntil` is a retention-review reference rather than
203
+ authority for hard deletion, and distinguish self-withdrawal from operator
204
+ privacy redaction in generated customer type documentation.
205
+ - b988e2c: Sync generated Payload types for the internal customer OAuth client registry
206
+ collection.
207
+ - 509fe4d: Sync generated Payload types for hosted customer OIDC login registry comments.
208
+ - fde4e27: Expose tenant customer password-reset delivery settings in generated SDK
209
+ Payload types and document platform-managed email delivery for direct local
210
+ customer auth.
211
+ - 4973fa9: Expose generated customer OAuth client social-provider fields in SDK Payload
212
+ types for hosted social login support.
213
+ - db73ada: Document that provider-payment order starts should use checkout pre-placement
214
+ plus provider-verified confirmation. Direct create-order inputs with
215
+ `pgPaymentId` are deprecated and return `direct_order_payment_deprecated`.
216
+ - da9da4e: Add generated `objectCleanupVerifiedAt` / `lateObjectDetectedAt` fields to the internal `DirectUploadSession` type from the bounded temporary-object cleanup work (#2177). Additive, non-breaking.
217
+ - 8125cbf: Add the `reconciliation_required` direct-upload session status to the durable
218
+ cleanup lifecycle (#2180). Direct-upload cleanup now deletes the temporary
219
+ object before releasing storage quota: only a proven-absent object (delete
220
+ success or not-found) releases the reservation and terminalizes the session in a
221
+ single PostgreSQL transaction; a transient object-store fault stays retryable and
222
+ a permanent auth/config fault routes the session to `reconciliation_required`
223
+ with its reservation left open for repair. The generated `DirectUploadSession`
224
+ status union gains the new value.
225
+ - ea448c9: Expose the `discount_allocation_method_unsupported` validation reason for
226
+ discounts that use the not-yet-supported each-line allocation mode, and publish
227
+ the additive Payload type fields for stacked checkout/order discount snapshots
228
+ and item-level discount allocation provenance.
229
+ - 6d07364: Sync generated payload type doc comments to match current collection
230
+ descriptions (markets, event-admission-types, custom-field-definitions,
231
+ draft-orders). Documentation-only regeneration; no type-structure or API change.
232
+ - 0f8d95e: Add generated SDK payload types for draft order completion fields and custom manual order lines.
233
+ - c256e29: Classify the new `draft-orders` and `draft-order-items` collections as
234
+ server-only in the collection registry. They back the Console merchant
235
+ draft/manual order workflow (#1037) and are not part of the browser-public SDK
236
+ surface.
237
+ - 54d4430: Classify durable commerce idempotency records as SDK-internal and synchronize
238
+ the generated Checkout ownership fields used by atomic replay recovery.
239
+ - 2dfc0b4: Refine event admission availability rows so admission type occurrence IDs are always the requested occurrence ID.
240
+ - a378d92: Add optional event admission metadata to cart add-item requests so storefronts can keep admission-priced cart lines distinct through checkout.
241
+ - 2b80fc4: Clarify generated `EventAdmissionType` documentation for optional price
242
+ references and current per-occurrence admission limits. This is a
243
+ documentation and readiness-copy update only; SDK runtime behavior and public
244
+ API or contract shapes are unchanged.
245
+ - 6a0d2e9: Classify the new event-domain `event-admission-types` collection as SDK-internal/operator-only, not publishable-key public, and regenerate types to include it. Schema-only follow-up of ADR 0043 paid event admission; no public collection surface changes.
246
+ - 726fa7d: Sync generated Payload types for platform-owned event attendee notification
247
+ events so SDK consumers can recognize `eventRegistrationConfirmed` and
248
+ `eventOccurrenceCanceled` email log and notification intent values.
249
+ - 3dc115a: Expose admission identity on public cart items so event storefronts can resolve
250
+ live cart and checkout line labels.
251
+ - 52f8996: Add the server-derived `parentPublic` field to the `event-occurrences` generated
252
+ type. It mirrors whether the parent event is exposed to public reads (published,
253
+ public/unlisted, not trashed) so occurrence reads can filter on it directly
254
+ instead of resolving parent events per request. The field is server-managed and
255
+ hidden from publishable-key reads, so storefront responses are unchanged.
256
+ - e62b6a9: Clarify generated event registration quantity documentation so it describes
257
+ attendee and capacity calculations without implying a ticketing or payment
258
+ model.
259
+ - 6e9f6c9: Sync generated Return type documentation so SDK consumers can see exchange
260
+ return fields are reserved until provider-verified exchange settlement exists.
261
+ - 8632657: Align Cart capability retrieve and add-item requests with the hosted Console contract.
262
+ - 326fc60: Fix Checkout SDK calls to use the registered Console routes, including
263
+ tenant-scoped server checkout detail reads.
264
+ - 0f5049d: Accept numeric fulfillment relationship IDs in server commerce mutation inputs
265
+ and guard fulfillment request and shaped response types against contract drift.
266
+ - 33ca27c: Add the internal `fulfillment-events` append-only collection to the generated SDK payload types and internal collection registry. Fulfillment events are server-only/internal; no public SDK surface changes.
267
+ - 4b6d7d7: Make commerce request method and path atomic by routing Console registration
268
+ and SDK operation-only transports through one shared HTTP contract manifest.
269
+ - 2f8db83: Refresh generated SDK Payload types after merging market currency capability gates from dev.
270
+ - 9bf9efd: Expose generated SDK Payload types for market-aware custom payment provider currency support.
271
+ - b2fe177: Let operators edit membership price options directly from the plan edit view.
272
+ Add a read-only `prices` join field to `membership-plans` (`on: plan`,
273
+ orderable) so billing-cycle/amount options are listed, created, and reordered
274
+ inline on the plan instead of a separate collection with a re-picked parent.
275
+ The join read is operator-only (denies publishable-key and customer reads), so
276
+ the public storefront plan shape is unchanged; generated Console/SDK types gain
277
+ the additive `MembershipPlan.prices` join field.
278
+ Includes the Postgres migration for Payload's join-order column on
279
+ `membership_plan_prices` so migrated environments can persist the inline
280
+ drag-sort order.
281
+ - 9f5f31f: Add the generated operator-only membership plan active-price count used by the
282
+ Console sellability indicator.
283
+ - aa6d933: Update membership SDK payload and endpoint types for membership plan price options. Subscribe calls now reference a `priceId`, and customer membership views expose the selected price cadence snapshot.
284
+ - 6a9be68: Sync generated CustomerMembership type documentation for membership termination
285
+ fields. Documentation-only regeneration; no type-structure or API change.
286
+ - 3432140: Expose the generated `ApiUsage.notificationEmailCount` field in SDK Payload
287
+ types so server integrations can read complete monthly billing usage snapshots.
288
+ - a4df48e: Add generated SDK payload types for order edit sessions and staged changes, and classify both collections as server-only.
289
+ - 598418d: Add create-order segment fields to the SDK request type: optional `source`,
290
+ `test`, and `tags` values for server-auth order creation workflows.
291
+ - 10ecc9c: Move draft orders out of the primary Console nav and create/review them from
292
+ the orders list via a new launcher (create button + open-draft count). Draft
293
+ orders drop to a backing-tier surface (still reachable by URL, like
294
+ returns/fulfillments); the SDK payload types are only regenerated to drop the
295
+ removed draft-orders admin description comment — no public SDK API change.
296
+ - 1ab3dee: Expose generated order item paid-admission snapshot fields in SDK types so
297
+ storefront/server integrations can read checkout item, admission type,
298
+ occurrence, and hold references on promoted order lines.
299
+ - 574023a: Synchronize generated internal payment types with credential lifecycle states,
300
+ credential generations, bounded eligibility, and provider outcome evidence.
301
+ - 7e60f73: Add the internal payment-kernel terminal-attempt relationship to generated
302
+ Payload types. This remains an internal-only schema type update and does not
303
+ add a public runtime surface.
304
+ - 9f8167e: Keep generated Payload schema inputs synchronized for Console-only payment
305
+ kernel persistence while public `Collection` and `CollectionType` declarations
306
+ reject all seven internal slugs and shapes.
307
+ - ddac441: Expose generated payment reconciliation, capture-role, payment-session, and
308
+ provider event inbox fields in SDK Payload types, including order-less
309
+ unattributed capture evidence, while keeping the inbox collection internal.
310
+ - 03024ab: Classify the new ecommerce `payment-sessions` collection as SDK-internal (not publishable-key or secret-key public) and regenerate types to include it. Server-owned custom payment session state for checkout capture idempotency; raw create/update/delete access is closed, so there is no public collection surface change.
311
+ - 6a4bb5f: Run package verification and prepublish pnpm commands through the workspace-pinned Corepack version so release checks use the supported pnpm 11 toolchain consistently.
312
+ - 26ab105: Synchronize generated Payload types for the SDK-hidden payment interaction
313
+ recovery collection and private PaymentSession capture evidence.
314
+ - 048d0b2: Preserve pre-12.11 Canvas selection behavior by disabling selection-edge auto-pan in `CanvasRenderer`.
315
+ - a7175e8: Regenerate `payload-types` after reordering Console product editor fields
316
+ (제목→설명→본문→미디어→가격·품목 흐름 및 조직·판매 탭 성격별 정렬). The
317
+ `Product` interface property order changes to match the new field declaration
318
+ order; the type shape (fields and their types) is unchanged, so this is a
319
+ structural no-op for consumers.
320
+ - 4e072c5: Synchronize the internal, SDK-hidden commerce payment account types with
321
+ provider-neutral configuration branches; this does not expose a public payment
322
+ API.
323
+ - d5036a2: Document the publishable-key raw-read row cap on `limit` and `pagination`, and
324
+ bound the SDK Canvas node/edge type loaders. Browser (publishable-key) raw
325
+ collection reads must request a bounded `limit` in [1, 100]: `limit: 0`, a
326
+ `limit` above 100, and `pagination: false` are rejected with 400 rather than
327
+ returning an entire collection. Server credentials remain uncapped. The Canvas
328
+ type-definition loaders now request `limit: 100` instead of `limit: 0`.
329
+ - 06dcb23: Expose the generated `Refund` and `RefundLineItem` collection types and classify both as server-only collections.
330
+ - 41d7518: Keep the published SDK runtime unchanged while making the test coverage provider
331
+ explicit and removing an unused development-only UI scaffold dependency.
332
+ - 2b8fb80: Document the tenant `shopCurrency` revaluation risk in generated SDK types: changing it re-denominates stored catalog and order amounts in place, and the change is now refused while live variants or unsettled orders exist.
333
+ - f0e5806: Expose stateful per-channel marketing consent metadata on customer types while
334
+ preserving legacy boolean write compatibility.
335
+ - cfe8ef1: Expose generated subscription discount and billing-history discount snapshot
336
+ fields in SDK payload types for internal billing integrations.
337
+ - 3c4eee7: Expose tenant content locale policy fields in generated SDK Payload types.
338
+ - ec6f604: Update repository metadata for the grouped monorepo package layout. Runtime
339
+ APIs and package import paths are unchanged.
340
+ - 81aa87c: Harden the shipping calculation transport contract and add destination country
341
+ and region forwarding to the CLI command.
342
+ - cff1cc1: Synchronize generated internal types and collection classification for durable Toss refund attempts.
343
+ - fe90ba1: Synchronize generated internal types for registered commerce payment accounts,
344
+ provider customer aliases, and account-bound Toss PaymentSession state.
345
+ - 37acdc2: Expose the generated `Transaction.parentTransaction` relationship type for transaction parent linkage.
346
+ - f90c772: Sync generated Payload types for internal usage billing collections, including
347
+ usage rate cards, usage invoices, and subscription billing model fields.
348
+ - f6fcd0a: Sync generated Payload types for finalized usage invoices, including nullable
349
+ charge timestamps and usage invoice line item allowance fields.
350
+ - 79eadf8: Expose the generated `BillingHistory.status` `pending` value for durable usage
351
+ refund attempt rows.
352
+ - c453fec: Deliver collection webhooks from a transactional Postgres outbox: one internal
353
+ `webhook-outbox-deliveries` row per event-time recipient persists the exact body
354
+ and URL in the source mutation transaction, its UUID remains stable across
355
+ retry/DLQ redrive, and a leased worker signs with the endpoint's nullable live
356
+ secret. The internal collection is excluded from SDK/MCP access; webhook payload
357
+ shapes and the public `webhooks` configuration surface are unchanged.
358
+
3
359
  ## 0.44.0
4
360
 
5
361
  ### Minor Changes
@@ -326,7 +682,7 @@ displayStatus` JSDoc comment from `Order.status`. The Console removed that
326
682
  - `ProductUpsertResponse` staleness hint renamed `listingProjectionStale` →
327
683
  `productProjectionStale`.
328
684
 
329
- See `packages/sdk/MIGRATION.md` (“Shopify-shaped product listing fields (#1207)”)
685
+ See `packages/published/sdk/MIGRATION.md` (“Shopify-shaped product listing fields (#1207)”)
330
686
  for the full consumer migration path.
331
687
 
332
688
  - 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.
@@ -516,7 +872,7 @@ displayStatus` JSDoc comment from `Order.status`. The Console removed that
516
872
  `ListingGroupingEmptyReason`. Swatch groups derive from the first product option
517
873
  by `_order`. `buildProductListingCard` uses persisted min/max when both are present
518
874
  and merges compare-at from groups when compare-at keys are absent. See
519
- `packages/sdk/MIGRATION.md`.
875
+ `packages/published/sdk/MIGRATION.md`.
520
876
 
521
877
  ## 0.35.0
522
878
 
package/MIGRATION.md CHANGED
@@ -1,5 +1,84 @@
1
1
  # @01.software/sdk Migration Notes
2
2
 
3
+ ## SDK 0.45 canonical commerce surface (#2375)
4
+
5
+ Target release: `0.45.0`. This is a `BREAKING (0.x minor)` release.
6
+
7
+ The provider-payment flow is now Cart → Checkout → PaymentSession → Order. The
8
+ SDK no longer lets callers create a provider-paid Order or assert generic
9
+ provider truth.
10
+
11
+ | Before 0.45 | 0.45 replacement |
12
+ | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
13
+ | `commerce.cart.*` | `commerce.carts.*` |
14
+ | `cart.get(cartToken)` | `carts.retrieve({ cartToken })` |
15
+ | `cart.applyDiscount` / `cart.removeDiscount` | `carts.updateDiscountCodes` (replace the complete list; `[]` clears) |
16
+ | singular `admission` | `admissions[]` (non-empty when supplied; maximum 32) |
17
+ | `commerce.orders.checkout` | `commerce.checkouts.create` |
18
+ | `commerce.checkouts.detail` | `commerce.checkouts.retrieve` |
19
+ | custom PaymentSession create/confirm payloads | provider-discriminated `paymentSessions.create`, one canonical retrieve/cancel lifecycle, and typed server adapter confirmation |
20
+ | provider-paid `orders.create` | removed; create a Checkout from a Cart |
21
+ | `orders.confirmPayment` | removed; use the registered PaymentSession adapter action |
22
+ | ordinary `orders.updateTransaction` | removed; provider state belongs to PaymentSession reconciliation |
23
+ | root `Order` / `Transaction` / `Cart` / `CartItem` Payload types | removed; use canonical `PublicOrder` / `PublicCart` DTOs or explicit server collection types |
24
+ | inline provider-refund `cancelOrder` response | removed; cancellation returns the local `refundPending` receipt and refund completion uses the dedicated resolution flow |
25
+ | CLI `01 order get` raw Order output | removed; use canonical customer Order reads or explicit trusted server collection tooling |
26
+
27
+ ```ts
28
+ const { cart, cartToken } = await client.commerce.carts.create({ market: 'kr' })
29
+ await client.commerce.carts.addItem({
30
+ cartToken,
31
+ productId,
32
+ variantId,
33
+ quantity: 1,
34
+ admissions: [{ eventId, occurrenceId, admissionTypeId }],
35
+ expectedRevision: cart.revision,
36
+ idempotencyKey: crypto.randomUUID(),
37
+ })
38
+
39
+ const { checkout, checkoutToken } = await client.commerce.checkouts.create({
40
+ cartToken,
41
+ customer: { email: 'buyer@example.com' },
42
+ idempotencyKey: crypto.randomUUID(),
43
+ })
44
+ const session = await client.commerce.paymentSessions.create({
45
+ checkoutToken,
46
+ provider: 'toss',
47
+ providerOptions: { profile: 'widget_v2' },
48
+ idempotencyKey: crypto.randomUUID(),
49
+ })
50
+ ```
51
+
52
+ Checkout and PaymentSession results are discriminated unions with required
53
+ cores. Narrow `status`, `providerStatus`,
54
+ `presentationStatus`, or `finalizationStatus` before reading state-specific
55
+ fields. Public money uses integer minor units and uppercase currency.
56
+ `PublicOrderItem.product` and `.variant` are nullable only for snapshot-only
57
+ custom lines created through completed Draft Orders; catalog-backed lines keep
58
+ both references.
59
+
60
+ Browser cart `mine()` and `merge()` derive customer identity from the customer
61
+ JWT. Server equivalents require `{ customerToken }`; server merge requires both
62
+ `guestCartToken` and `customerToken`. Checkout query is server-only and returns
63
+ cursor pagination without capability tokens.
64
+
65
+ Server commerce writes no longer share browser transport paths. The server SDK
66
+ uses `/api/carts/server/*`,
67
+ `/api/orders/checkout`, `/api/checkouts/detail`, and `/api/checkouts/query`, and
68
+ `/api/payment-sessions/server/{create,retrieve,cancel,confirm}`. Public paths
69
+ accept only the public capability/customer body and never advertise the server
70
+ credential, even when a server request body happens to be identical.
71
+
72
+ All Cart mutations except create/retrieve/mine now require an
73
+ `idempotencyKey`. Token-keyed mutations also require `expectedRevision`; on
74
+ `cart_revision_conflict`, retrieve the current Cart and begin a new logical
75
+ mutation with a new key. Merge requires only the key because it resolves and
76
+ locks both current Cart states.
77
+
78
+ See the
79
+ [complete SDK 0.45 migration matrix](https://github.com/01-office/01-software/blob/dev/docs/packages/sdk-0.45-migration.md)
80
+ in the repository documentation.
81
+
3
82
  ## Shopify-shaped product listing fields (#1207)
4
83
 
5
84
  Next minor release as a semver minor for the pre-1.0 SDK. This release removes
@@ -17,16 +96,16 @@ be called out in release notes as `BREAKING (0.x minor)`.
17
96
  `ProductDetail` and `ProductDetailCatalog` no longer include the `listing`
18
97
  group. Replace each field as follows:
19
98
 
20
- | Removed | New |
21
- | ---------------------------------- | --------------------------------------------------------- |
22
- | `listing.primaryImage` | `featuredImage` |
23
- | `listing.minPrice` | `priceRange.minVariantPrice.amount` |
24
- | `listing.maxPrice` | `priceRange.maxVariantPrice.amount` |
25
- | `listing.isPriceRange` | `priceRange.isPriceRange` |
26
- | `listing.minCompareAtPrice` | `compareAtPriceRange.minVariantPrice.amount` |
27
- | `listing.maxCompareAtPrice` | `compareAtPriceRange.maxVariantPrice.amount` |
28
- | `listing.availableForSale` | `availableForSale` |
29
- | `listing.selectionHintVariant` | `selectedOrFirstAvailableVariant` |
99
+ | Removed | New |
100
+ | ------------------------------ | -------------------------------------------- |
101
+ | `listing.primaryImage` | `featuredImage` |
102
+ | `listing.minPrice` | `priceRange.minVariantPrice.amount` |
103
+ | `listing.maxPrice` | `priceRange.maxVariantPrice.amount` |
104
+ | `listing.isPriceRange` | `priceRange.isPriceRange` |
105
+ | `listing.minCompareAtPrice` | `compareAtPriceRange.minVariantPrice.amount` |
106
+ | `listing.maxCompareAtPrice` | `compareAtPriceRange.maxVariantPrice.amount` |
107
+ | `listing.availableForSale` | `availableForSale` |
108
+ | `listing.selectionHintVariant` | `selectedOrFirstAvailableVariant` |
30
109
 
31
110
  The new range types are exported as `ProductPriceRange` (price range, with
32
111
  `isPriceRange`) and `ProductMoneyRange` (compare-at range).