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