@01.software/sdk 0.49.0 → 0.56.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.
- package/CHANGELOG.md +257 -1
- package/MIGRATION.md +56 -0
- package/README.md +269 -56
- package/dist/client.cjs +608 -190
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +6 -6
- package/dist/client.d.ts +6 -6
- package/dist/client.js +608 -190
- package/dist/client.js.map +1 -1
- package/dist/{collection-client-DnDt6EQz.d.ts → collection-client-Bmr53saa.d.ts} +6 -4
- package/dist/{collection-client-XfGLPuTf.d.cts → collection-client-DxuBDso_.d.cts} +6 -4
- package/dist/{const-CBba4lDo.d.cts → const-BKUqg96Q.d.ts} +5 -5
- package/dist/{const-DCNV5Kq7.d.ts → const-Cv1DCsp6.d.cts} +5 -5
- package/dist/embedded-admin/server.cjs +306 -0
- package/dist/embedded-admin/server.cjs.map +1 -0
- package/dist/embedded-admin/server.d.cts +33 -0
- package/dist/embedded-admin/server.d.ts +33 -0
- package/dist/embedded-admin/server.js +288 -0
- package/dist/embedded-admin/server.js.map +1 -0
- package/dist/embedded-admin.cjs +400 -0
- package/dist/embedded-admin.cjs.map +1 -0
- package/dist/embedded-admin.d.cts +61 -0
- package/dist/embedded-admin.d.ts +61 -0
- package/dist/embedded-admin.js +377 -0
- package/dist/embedded-admin.js.map +1 -0
- package/dist/errors.cjs +1 -0
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.cts +3 -3
- package/dist/errors.d.ts +3 -3
- package/dist/errors.js +1 -0
- package/dist/errors.js.map +1 -1
- package/dist/{index-DUuIqUS8.d.ts → index-CGsT4AQ8.d.cts} +89 -10
- package/dist/{index-CbKyoEzy.d.cts → index-DFHLLqYu.d.ts} +89 -10
- package/dist/index.cjs +752 -436
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -69
- package/dist/index.d.ts +12 -69
- package/dist/index.js +752 -436
- package/dist/index.js.map +1 -1
- package/dist/{payload-types-MKbx5MuJ.d.cts → payload-types-Bk-duc5k.d.cts} +545 -141
- package/dist/{payload-types-MKbx5MuJ.d.ts → payload-types-Bk-duc5k.d.ts} +545 -141
- package/dist/query.cjs +108 -71
- package/dist/query.cjs.map +1 -1
- package/dist/query.d.cts +5 -5
- package/dist/query.d.ts +5 -5
- package/dist/query.js +108 -71
- package/dist/query.js.map +1 -1
- package/dist/realtime.d.cts +2 -2
- package/dist/realtime.d.ts +2 -2
- package/dist/server.cjs +502 -175
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +9 -8
- package/dist/server.d.ts +9 -8
- package/dist/server.js +502 -175
- package/dist/server.js.map +1 -1
- package/dist/storefront-cache.cjs +1 -0
- package/dist/storefront-cache.cjs.map +1 -1
- package/dist/storefront-cache.js +1 -0
- package/dist/storefront-cache.js.map +1 -1
- package/dist/{types-1UeOk1Uy.d.cts → types-CEK8uTvU.d.ts} +287 -30
- package/dist/{types-BKr_2avj.d.cts → types-CNdpj2fI.d.cts} +2 -2
- package/dist/{types-L_nh-ED7.d.ts → types-D4mjGFj4.d.ts} +2 -2
- package/dist/{types-Du4s5anw.d.ts → types-Dhk5NX7Z.d.cts} +287 -30
- package/dist/ui/form.d.cts +1 -1
- package/dist/ui/form.d.ts +1 -1
- package/dist/ui/video.d.cts +1 -1
- package/dist/ui/video.d.ts +1 -1
- package/dist/webhook.cjs +135 -80
- package/dist/webhook.cjs.map +1 -1
- package/dist/webhook.d.cts +21 -5
- package/dist/webhook.d.ts +21 -5
- package/dist/webhook.js +135 -80
- package/dist/webhook.js.map +1 -1
- package/package.json +28 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,261 @@
|
|
|
1
1
|
# @01.software/sdk
|
|
2
2
|
|
|
3
|
+
## 0.56.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- d7ac700: Sync the shipping policy free-shipping field description from Console schemas.
|
|
8
|
+
- e15348a: The generated `Article` type now documents `slug` as the URL slug that stays fixed once an article is created.
|
|
9
|
+
- c3ab3b9: Sync the product slug field description, which now notes that the slug is fixed after creation.
|
|
10
|
+
|
|
11
|
+
## 0.56.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- bab54b6: BREAKING (0.x minor): Make paid membership subscribe return a first-charge prepare instruction instead of accepting a caller payment identifier. Tenant billing now uses the returned idempotency key and the existing signed charge-result flow.
|
|
16
|
+
|
|
17
|
+
## 0.55.1
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- 9ee5438: Synchronize generated Payload event hold and internal TicketPurchase draft types
|
|
22
|
+
with the Console schema.
|
|
23
|
+
|
|
24
|
+
## 0.55.0
|
|
25
|
+
|
|
26
|
+
### Minor Changes
|
|
27
|
+
|
|
28
|
+
- 3ddc653: BREAKING (0.x minor): Generated Membership payment method and credential types
|
|
29
|
+
now expose delegated-only fields. Legacy connect and backend-charge metadata is
|
|
30
|
+
removed from the SDK type surface; stored database columns remain intact.
|
|
31
|
+
|
|
32
|
+
### Patch Changes
|
|
33
|
+
|
|
34
|
+
- 4732259: Sync event registration provenance fields from Console schemas.
|
|
35
|
+
- 313ed5b: Synchronize generated Payload membership-charge types with normalized terminal
|
|
36
|
+
decline evidence fields.
|
|
37
|
+
|
|
38
|
+
## 0.54.2
|
|
39
|
+
|
|
40
|
+
### Patch Changes
|
|
41
|
+
|
|
42
|
+
- c040018: Add typed webhook support for thin membership lifecycle notifications.
|
|
43
|
+
|
|
44
|
+
## 0.54.1
|
|
45
|
+
|
|
46
|
+
### Patch Changes
|
|
47
|
+
|
|
48
|
+
- d09060b: Add generated internal usage-attribution fields for Project environment billing evidence.
|
|
49
|
+
|
|
50
|
+
## 0.54.0
|
|
51
|
+
|
|
52
|
+
### Minor Changes
|
|
53
|
+
|
|
54
|
+
- 1e2f5ce: Add server-only source-aware Customer Group member listing, grant, and revoke helpers.
|
|
55
|
+
|
|
56
|
+
### Patch Changes
|
|
57
|
+
|
|
58
|
+
- 5d183fd: Add optional Checkout and Order discount snapshot fields for canonical
|
|
59
|
+
condition digests and private customer-eligibility evidence.
|
|
60
|
+
|
|
61
|
+
## 0.53.0
|
|
62
|
+
|
|
63
|
+
### Minor Changes
|
|
64
|
+
|
|
65
|
+
- b3b3878: Synchronize generated Payload types for Project-scoped subscription authority.
|
|
66
|
+
`Project.authorityMode` now includes `project-billing`, and `Subscription` gains
|
|
67
|
+
an optional `project` relationship while retaining its required Live tenant
|
|
68
|
+
anchor.
|
|
69
|
+
|
|
70
|
+
This is additive only: no collection becomes publicly addressable, existing
|
|
71
|
+
tenant identifiers keep their meaning, and tenant-scoped SDK behavior is
|
|
72
|
+
unchanged.
|
|
73
|
+
|
|
74
|
+
## 0.52.2
|
|
75
|
+
|
|
76
|
+
### Patch Changes
|
|
77
|
+
|
|
78
|
+
- e808fb7: Improve PaymentSession provider-mismatch cancellation recovery guidance after
|
|
79
|
+
validating the complete actual-provider response and cancellation state.
|
|
80
|
+
|
|
81
|
+
**BREAKING (0.x minor):** `01 payment-session retrieve` and `01 payment-session cancel` now require `--provider toss` or `--provider portone`; the CLI no longer assumes Toss when it is omitted.
|
|
82
|
+
|
|
83
|
+
## 0.52.1
|
|
84
|
+
|
|
85
|
+
### Patch Changes
|
|
86
|
+
|
|
87
|
+
- 1f62cb3: Keep managed payment-provider response validation aligned with the SDK's public checkout provider type.
|
|
88
|
+
- 2848ab8: Remove retired stg smoke reconciliation wording from the generated PAT type mirror.
|
|
89
|
+
|
|
90
|
+
## 0.52.0
|
|
91
|
+
|
|
92
|
+
### Minor Changes
|
|
93
|
+
|
|
94
|
+
- ebd2544: Synchronize generated types for the Project environment expand phase (ADR 0056). A `Project` interface is added, and `Tenant` gains five optional, nullable fields describing its Project/environment binding: `project`, `environmentKind`, `environmentGeneration`, `environmentState`, and `environmentIsCurrent`.
|
|
95
|
+
|
|
96
|
+
Additive only. Every new field is optional, no existing field becomes nullable, and `tenantId` keeps its exact meaning. The `projects` slug is deliberately absent from `COLLECTIONS`, `SERVER_ONLY_COLLECTIONS`, and `INTERNAL_COLLECTIONS`, so no collection is newly addressable and no runtime behavior changes; the additive public client context is owned by a later issue.
|
|
97
|
+
|
|
98
|
+
### Patch Changes
|
|
99
|
+
|
|
100
|
+
- 9620154: Keep generated SDK collection metadata and Payload types aligned with the Console customer-group grant authority.
|
|
101
|
+
|
|
102
|
+
## 0.51.2
|
|
103
|
+
|
|
104
|
+
### Patch Changes
|
|
105
|
+
|
|
106
|
+
- 6f08721: Align the generated Order field order with the Admin Panel order information tab.
|
|
107
|
+
- 18c9eb7: Synchronize the generated Payload types after the Console `customers`
|
|
108
|
+
collection declares `email` before `name`: `Customer` and `CustomersSelect`
|
|
109
|
+
change property order only. This does not add, remove, or retype any SDK
|
|
110
|
+
surface.
|
|
111
|
+
- 6d2e6ac: Update the audited Next runtime dependencies used by SDK verification and the
|
|
112
|
+
published app templates.
|
|
113
|
+
- 7eb25b2: Payload CMS 3.89.0 선행 업그레이드에 맞춰 SDK 검증용 개발 의존성을 갱신하고,
|
|
114
|
+
upstream 실제 수정 전까지 보상 통제를 유지합니다.
|
|
115
|
+
|
|
116
|
+
## 0.51.1
|
|
117
|
+
|
|
118
|
+
### Patch Changes
|
|
119
|
+
|
|
120
|
+
- ff7a716: Serialize persisted `CustomerAuth` refresh rotation across browser contexts and make the persisted session atomic.
|
|
121
|
+
|
|
122
|
+
The canonical session now lives in a single versioned JSON record at `<key>:session` holding the access/refresh pair plus a monotonic revision. Writing the pair in one store operation removes the torn write that could publish a new access token beside an already-consumed refresh token, and every write re-reads the record first and carries forward the field it does not change, which keeps a stale instance from carrying its own outdated counterpart into the write. That merge is best-effort, not a compare-and-swap.
|
|
123
|
+
|
|
124
|
+
Refresh-token rotation — and only rotation — is serialized through a Web Locks lease keyed by the storage key plus the canonical API/tenant identity (equivalent URL spellings share one namespace; token material never appears in a lease name). Inside the lease the rotation re-reads canonical state and classifies it on the credential it will present, so it never replays a credential the record already replaced, never strands the successor it already paid for, and preserves an access token another context deliberately replaced while committing the successor refresh in the same write. `getToken()` / `getRefreshToken()` re-read canonical state before use, so another tab's rotation or logout is observed before the next credential use.
|
|
125
|
+
|
|
126
|
+
Limits, stated rather than implied: Web Storage has no compare-and-swap, so the read preceding a write is not atomic with it, and the synchronous mutators (`logout`, `setToken`, `setRefreshToken`) cannot await the lease. A commit landing inside that window is lost by ordering — including a counterpart the merge just read, which is then republished stale. Those interleavings are last-writer-wins; server-side single-use rotation and refresh-family reuse detection remain the only authority. Browsers without Web Locks, a throwing `navigator.locks` accessor, a failed acquisition, an expired bounded wait, or storage that denies access all degrade to a per-instance or memory-only session while still presenting the canonical credential.
|
|
127
|
+
|
|
128
|
+
Storage compatibility: `<key>` still holds the current access token as a single-value publication for code that reads it directly, and an existing pair under the older `<key>` / `<key>:refresh` layout is migrated on first read — but only while `<key>:session` is absent. `logout()` writes a cleared record even against empty storage, so an ended session cannot be migrated back out of the older keys. The older refresh entry is retired before any newer access token is mirrored, so those two are never published together, and if that retirement fails the newer access token is not mirrored beside it; such a reader falls back to the bearer refresh path, and server-side reuse detection resolves an older pair it may still hold. A record this version cannot interpret fails closed to a memory-only session rather than being reinterpreted through the older keys. A context running an SDK version that predates the record is outside the coordination guarantee. `persist: false` and SSR behavior are unchanged.
|
|
129
|
+
|
|
130
|
+
## 0.51.0
|
|
131
|
+
|
|
132
|
+
### Minor Changes
|
|
133
|
+
|
|
134
|
+
- 8dd8ef7: BREAKING (0.x minor): reclassify `discounts` from the browser-public
|
|
135
|
+
`COLLECTIONS` bucket to `SERVER_ONLY_COLLECTIONS`. This is the
|
|
136
|
+
`PLAT-API-002` security/implementation-boundary correction: raw discount
|
|
137
|
+
definitions require a server credential, so a publishable-key-only raw read
|
|
138
|
+
never succeeded. Browser discount validation remains available through the
|
|
139
|
+
existing shaped `POST /api/discounts/validate` operation.
|
|
140
|
+
|
|
141
|
+
`SERVER_COLLECTIONS` continues to include `discounts` for secret-key/PAT SDK
|
|
142
|
+
clients. The browser `PublicCollection` union no longer accepts `discounts`,
|
|
143
|
+
and the raw REST route now rejects its publishable-key-only reads at the
|
|
144
|
+
server-only guard (404) rather than at collection access (403). Contract v1.23.0
|
|
145
|
+
is a compatible correction of that false callable-surface claim; this SDK
|
|
146
|
+
package change is still a pre-1.0 breaking minor under `docs/packages/release.md`.
|
|
147
|
+
|
|
148
|
+
- b08250c: Add a redacted `01 doctor` app-integration diagnostic with structured Agent CLI output.
|
|
149
|
+
Its explicit app environment input is the Node-runtime-safe `--app-env-file`.
|
|
150
|
+
|
|
151
|
+
Export the canonical tenant-context path on the SDK server entry for the
|
|
152
|
+
diagnostic-only, uncredentialed CORS probe.
|
|
153
|
+
|
|
154
|
+
Print the redacted app-integration diagnostic as the next setup step only for
|
|
155
|
+
Next.js and Node targets that receive its required app credential pair.
|
|
156
|
+
|
|
157
|
+
- bf6df96: BREAKING (0.x minor): Make signed webhook receivers fail closed when their
|
|
158
|
+
signing secret is missing, empty, or blank. Use `handleSignedWebhook()` for the
|
|
159
|
+
default signed path and `handleUnsignedWebhook()` only for an intentionally
|
|
160
|
+
unsigned endpoint; both new names and `SignedWebhookOptions` are exported from
|
|
161
|
+
`@01.software/sdk/webhook`, not the SDK root. The deprecated `handleWebhook()`
|
|
162
|
+
and `WebhookOptions` compatibility exports remain available at their existing
|
|
163
|
+
root and webhook-subpath locations, require signed options, and follow the same
|
|
164
|
+
fail-closed runtime behavior.
|
|
165
|
+
|
|
166
|
+
`toleranceSeconds` is now validated. It keeps its 300-second default for an
|
|
167
|
+
absent or null value, but a present value must be a number within an inclusive
|
|
168
|
+
0-86400-second range; anything else (including `Infinity`, `NaN`, a negative
|
|
169
|
+
number, a non-number, or a week-long window) is a configuration error that
|
|
170
|
+
returns 500 with a distinct tolerance message before the body is consumed.
|
|
171
|
+
|
|
172
|
+
- 2ce3aa9: Add explicit embedded-admin browser and server SDK entrypoints for the receiver
|
|
173
|
+
handshake and strict assertion verification. Add the PAT-only Human CLI
|
|
174
|
+
`embedded-app show`, `configure`, and `disable` commands for single-binding
|
|
175
|
+
management.
|
|
176
|
+
|
|
177
|
+
### Patch Changes
|
|
178
|
+
|
|
179
|
+
- 48372ad: Synchronize the optional tenant embedded-admin binding in generated Payload
|
|
180
|
+
types. This does not add an SDK method or expose embedded session credentials.
|
|
181
|
+
- 3fb53f0: Clarify PAT revocation audit metadata for trusted machine reconciliation.
|
|
182
|
+
- eea3ea8: Align canonical Order and Checkout response validation with the authoritative non-empty nullable item fields.
|
|
183
|
+
- 46c32e6: Ensure the packed SDK runtime declares its `jose` dependency with the portable
|
|
184
|
+
npm range used by standalone consumers.
|
|
185
|
+
- a1567cc: Validate SDK release tarballs with patched package-analysis dependencies.
|
|
186
|
+
- 9fecd85: Register the internal `commerce-payment-webhook-routes` collection so the SDK
|
|
187
|
+
collection registry stays in lockstep with Console. The collection is
|
|
188
|
+
Console-internal PortOne webhook routing state: it adds no SDK method, appears
|
|
189
|
+
in no public or server-only bucket, and exposes no credential.
|
|
190
|
+
- 41fbcb6: Synchronize required customer, period-end, and idempotency-key fields for the
|
|
191
|
+
SDK-hidden `membership-charges` generated type. The collection remains
|
|
192
|
+
server-only and gains no public write method.
|
|
193
|
+
|
|
194
|
+
## 0.50.0
|
|
195
|
+
|
|
196
|
+
### Minor Changes
|
|
197
|
+
|
|
198
|
+
- 0e0ab60: Add server-only full-tuple PortOne payment find and durable reconciliation methods, including atomic domain-and-receipt completion for crash-safe same-key replay.
|
|
199
|
+
- 743b895: Add optional canonical `allDayStartDate` and exclusive
|
|
200
|
+
`allDayEndDateExclusive` fields to public event-range DTOs while retaining
|
|
201
|
+
instant compatibility shadows and existing TypeScript object-literal source
|
|
202
|
+
compatibility. Generated Event types also add optional canonical
|
|
203
|
+
`recurrence.untilDate` for all-day structured recurrence; existing object
|
|
204
|
+
literals that omit it remain valid.
|
|
205
|
+
- 743b895: Expose `managed_refund_attestation_forbidden` as the typed commerce error for registered managed captures while preserving existing cancel-refund errors and detail placement.
|
|
206
|
+
- 6b584bc: Expose the PortOne Standard V2 action's permanent non-cancelability and exact-action-only retry policy through an exact negotiated create/retrieve projection, while normalizing released Console responses for bidirectional non-lockstep compatibility. Console may deploy first because unnegotiated responses retain the released exact shape; the SDK may deploy first because it accepts and normalizes that old-server shape. Hosted create and all cancel operations remain unnegotiated. Package publication remains a separate post-merge release action.
|
|
207
|
+
- 743b895: BREAKING (0.x minor): Retire the expired ADR 0025 product media compatibility
|
|
208
|
+
shims. `resolveProductMedia()` and `resolveProductGallery()` — plus their
|
|
209
|
+
compatibility-only types `MediaPointerSource`, `ResolveProductMediaInput`,
|
|
210
|
+
`ResolveProductMediaResult`, `ProductMediaSetMatchType`, `ProductMediaSetInput`,
|
|
211
|
+
`ProductGallerySource`, `ResolveProductGalleryInput`, and
|
|
212
|
+
`ResolveProductGalleryResult` — are no longer exported from the package root or
|
|
213
|
+
`utils`.
|
|
214
|
+
|
|
215
|
+
These shipped in 0.34.0 as a one-release migration aid and forwarded to the
|
|
216
|
+
canonical resolvers. Replace `resolveProductMedia()` and
|
|
217
|
+
`resolveProductGallery()` with `resolveProductSelectionMedia()` for
|
|
218
|
+
variant/option selection media and `resolveProductDisplayMedia()` for listing
|
|
219
|
+
and PDP display fallback. Pre-ADR-0025 `mediaSets` inputs have no replacement:
|
|
220
|
+
variant `images[]` subsets and `product-option-values.swatch.mediaItemId` are
|
|
221
|
+
the canonical selection sources.
|
|
222
|
+
|
|
223
|
+
Canonical selection and display precedence, result shapes, and edge-case
|
|
224
|
+
behavior are unchanged. See `packages/published/sdk/MIGRATION.md`.
|
|
225
|
+
|
|
226
|
+
- bca928f: Add provider-neutral `paymentReconciliationRequired` and
|
|
227
|
+
`paymentRefundRequiresAttention` commerce notification webhook types, handlers,
|
|
228
|
+
and runtime validation.
|
|
229
|
+
|
|
230
|
+
### Patch Changes
|
|
231
|
+
|
|
232
|
+
- 743b895: Expose the nullable ownership scope on the generated server-only inbound
|
|
233
|
+
webhook ledger document type.
|
|
234
|
+
- 743b895: Align commerce endpoint descriptors with the shared HTTP contract manifest without changing endpoint methods, paths, or error families.
|
|
235
|
+
- 743b895: Expose the additive Toss capture-evidence variants in generated private
|
|
236
|
+
PaymentSession types while preserving the existing public payment API.
|
|
237
|
+
- 743b895: Expose the additive durable Return-refund canonical envelope and stable
|
|
238
|
+
post-commit replay outcome in generated Payload types. Refund execution now
|
|
239
|
+
rejects changed payment identity and cross-tenant explicit-key reuse before
|
|
240
|
+
provider I/O while preserving identical cache-loss replay payloads.
|
|
241
|
+
- 0c4c5fd: Synchronize generated ProviderConnection configuration-attestation fields for
|
|
242
|
+
the SDK-hidden `commerce-payment-accounts` collection. The operator-only REST
|
|
243
|
+
actions remain internal to Console and add no public SDK transport method.
|
|
244
|
+
- 743b895: Standardize customer-facing Console terminology in initialization guidance and
|
|
245
|
+
generated SDK descriptions without changing runtime behavior or API contracts.
|
|
246
|
+
- 743b895: Remove the unsupported minor and guardian-consent fields from generated
|
|
247
|
+
server-only Customer document types as a privacy correction. Shaped customer
|
|
248
|
+
registration and `/me` response types are unchanged.
|
|
249
|
+
- 743b895: Clarify the generated webhook subscription descriptions: an empty subscription
|
|
250
|
+
list is a wildcard for ordinary collection create/update events only, and
|
|
251
|
+
commerce notifications require an explicit row for their source collection.
|
|
252
|
+
Descriptions only — no schema, runtime, or API contract change.
|
|
253
|
+
- 743b895: Add optional sanitized commerce notification diagnostics fields (`eventType`,
|
|
254
|
+
`notificationEvent`, `notificationIntentId`, `notificationDedupeKey`,
|
|
255
|
+
`sourceId`) to the generated internal `WebhookDelivery` document type. The
|
|
256
|
+
collection stays internal and is not exposed through the SDK surface;
|
|
257
|
+
existing object literals remain valid because every field is optional.
|
|
258
|
+
|
|
3
259
|
## 0.49.0
|
|
4
260
|
|
|
5
261
|
### Minor Changes
|
|
@@ -1070,7 +1326,7 @@ displayStatus` JSDoc comment from `Order.status`. The Console removed that
|
|
|
1070
1326
|
disabled. Customer auth failures now surface the same SDK-specific error classes
|
|
1071
1327
|
as other SDK requests instead of the previous generic API error shape.
|
|
1072
1328
|
|
|
1073
|
-
##
|
|
1329
|
+
## Historical 0.34.0 migration notes
|
|
1074
1330
|
|
|
1075
1331
|
### Minor Changes
|
|
1076
1332
|
|
package/MIGRATION.md
CHANGED
|
@@ -1,5 +1,61 @@
|
|
|
1
1
|
# @01.software/sdk Migration Notes
|
|
2
2
|
|
|
3
|
+
## Product media compatibility shim retirement (#721)
|
|
4
|
+
|
|
5
|
+
This is a `BREAKING (0.x minor)` change. The ADR 0025 one-release compatibility
|
|
6
|
+
shims first published in `0.34.0` are removed from the package root and
|
|
7
|
+
`utils`.
|
|
8
|
+
|
|
9
|
+
| Removed | Replacement |
|
|
10
|
+
| ----------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
|
|
11
|
+
| `resolveProductMedia(input)` | `resolveProductSelectionMedia(input)`, then `resolveProductDisplayMedia(input)` fallback |
|
|
12
|
+
| `resolveProductGallery(input)` | `resolveProductSelectionMedia(input)`, then `resolveProductDisplayMedia(input)` fallback |
|
|
13
|
+
| `ResolveProductMediaInput` / `ResolveProductGalleryInput` | `ResolveProductSelectionMediaInput` |
|
|
14
|
+
| `ResolveProductMediaResult` / `ResolveProductGalleryResult` | `ResolveProductSelectionMediaResult` |
|
|
15
|
+
| `MediaPointerSource` / `ProductGallerySource` | `ProductSelectionMediaSource` / `ProductDisplayMediaSource` |
|
|
16
|
+
| `ProductMediaSetInput` / `ProductMediaSetMatchType` | none; use variant `images[]` and `swatch.mediaItemId` |
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
// Before
|
|
20
|
+
const gallery = resolveProductGallery({
|
|
21
|
+
pool: product.images,
|
|
22
|
+
selectedVariantId: variant.id,
|
|
23
|
+
selectedOptionValueIds: valueIds,
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
// After
|
|
27
|
+
const selection = resolveProductSelectionMedia({
|
|
28
|
+
productMediaPool: product.images,
|
|
29
|
+
selectedVariant: variant,
|
|
30
|
+
selectedOptionValues: optionValues,
|
|
31
|
+
})
|
|
32
|
+
const media =
|
|
33
|
+
selection.source === 'none'
|
|
34
|
+
? resolveProductDisplayMedia({
|
|
35
|
+
productMediaPool: product.images,
|
|
36
|
+
featuredImage: product.featuredImage,
|
|
37
|
+
})
|
|
38
|
+
: selection
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Use this two-step sequence when replacing either shim. Stopping after a
|
|
42
|
+
selection result with `source === 'none'` would drop the previous
|
|
43
|
+
featured-image/product-pool display fallback.
|
|
44
|
+
|
|
45
|
+
The shims already forwarded to these resolvers, so canonical selection and
|
|
46
|
+
display precedence, result shapes, and edge-case behavior are unchanged. The
|
|
47
|
+
legacy-only inputs they accepted have no replacement:
|
|
48
|
+
`variantFeaturedMediaItemId` and `selectedOptionValueMediaItemIds` become
|
|
49
|
+
`selectedVariant.images[]` and `selectedOptionValues[].swatch`, the `legacy`
|
|
50
|
+
direct-media object was already ignored, and `mediaSets` was removed from the
|
|
51
|
+
product schema before the shims expired.
|
|
52
|
+
|
|
53
|
+
`source` values also narrow: the shim-only `'variant_featured'`,
|
|
54
|
+
`'exact_variant_set'`, `'option_value_set'`, and `'default_set'` values are gone.
|
|
55
|
+
Selection media reports `'variant_media_selected'`, `'variant_media_matching'`,
|
|
56
|
+
`'option_swatch'`, or `'none'`; display media reports `'featured_image'`,
|
|
57
|
+
`'product_pool'`, or `'none'`.
|
|
58
|
+
|
|
3
59
|
## SDK 0.46 server-only custom-provider bridge (#3485)
|
|
4
60
|
|
|
5
61
|
SDK 0.46 adds
|