@01.software/sdk 0.48.0 → 0.51.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.
- package/CHANGELOG.md +157 -1
- package/MIGRATION.md +56 -0
- package/README.md +276 -49
- package/dist/client.cjs +375 -161
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +7 -6
- package/dist/client.d.ts +7 -6
- package/dist/client.js +375 -161
- package/dist/client.js.map +1 -1
- package/dist/{collection-client-CBup9yOx.d.cts → collection-client-CWAeuzV4.d.cts} +6 -4
- package/dist/{collection-client-D3ExJU-7.d.ts → collection-client-hYvVfHIm.d.ts} +6 -4
- package/dist/{const-k9gHylYa.d.ts → const-D8LixhAJ.d.cts} +5 -5
- package/dist/{const-BXEi1Kix.d.cts → const-JD8obaKg.d.ts} +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 +64 -15
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.cts +13 -4
- package/dist/errors.d.ts +13 -4
- package/dist/errors.js +64 -15
- package/dist/errors.js.map +1 -1
- package/dist/{index-BCM9CTL7.d.cts → index-B0Hjh3Ey.d.ts} +72 -10
- package/dist/{index-CHGGkcLj.d.ts → index-Bu0kCc6o.d.cts} +72 -10
- package/dist/index.cjs +470 -429
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -67
- package/dist/index.d.ts +9 -67
- package/dist/index.js +470 -429
- package/dist/index.js.map +1 -1
- package/dist/{payload-types-B6AZQcB7.d.cts → payload-types-BOsckg8B.d.cts} +396 -57
- package/dist/{payload-types-B6AZQcB7.d.ts → payload-types-BOsckg8B.d.ts} +396 -57
- package/dist/query.cjs +115 -70
- 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 +115 -70
- 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 +591 -186
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +8 -7
- package/dist/server.d.ts +8 -7
- package/dist/server.js +591 -186
- package/dist/server.js.map +1 -1
- package/dist/storefront-cache.cjs +22 -0
- package/dist/storefront-cache.cjs.map +1 -1
- package/dist/storefront-cache.js +22 -0
- package/dist/storefront-cache.js.map +1 -1
- package/dist/{types-ByD2zii1.d.ts → types-5ZlcAFuU.d.ts} +2 -2
- package/dist/{types-8us-_C-Q.d.cts → types-B14sEt1z.d.cts} +2 -2
- package/dist/{types-CM2je9Kw.d.cts → types-Bj8j7VHU.d.ts} +107 -26
- package/dist/{types-DbA5V3mt.d.ts → types-CM5qiR2k.d.cts} +107 -26
- 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 +124 -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 +124 -80
- package/dist/webhook.js.map +1 -1
- package/package.json +27 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,161 @@
|
|
|
1
1
|
# @01.software/sdk
|
|
2
2
|
|
|
3
|
+
## 0.51.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 8dd8ef7: BREAKING (0.x minor): reclassify `discounts` from the browser-public
|
|
8
|
+
`COLLECTIONS` bucket to `SERVER_ONLY_COLLECTIONS`. This is the
|
|
9
|
+
`PLAT-API-002` security/implementation-boundary correction: raw discount
|
|
10
|
+
definitions require a server credential, so a publishable-key-only raw read
|
|
11
|
+
never succeeded. Browser discount validation remains available through the
|
|
12
|
+
existing shaped `POST /api/discounts/validate` operation.
|
|
13
|
+
|
|
14
|
+
`SERVER_COLLECTIONS` continues to include `discounts` for secret-key/PAT SDK
|
|
15
|
+
clients. The browser `PublicCollection` union no longer accepts `discounts`,
|
|
16
|
+
and the raw REST route now rejects its publishable-key-only reads at the
|
|
17
|
+
server-only guard (404) rather than at collection access (403). Contract v1.23.0
|
|
18
|
+
is a compatible correction of that false callable-surface claim; this SDK
|
|
19
|
+
package change is still a pre-1.0 breaking minor under `docs/packages/release.md`.
|
|
20
|
+
|
|
21
|
+
- b08250c: Add a redacted `01 doctor` app-integration diagnostic with structured Agent CLI output.
|
|
22
|
+
Its explicit app environment input is the Node-runtime-safe `--app-env-file`.
|
|
23
|
+
|
|
24
|
+
Export the canonical tenant-context path on the SDK server entry for the
|
|
25
|
+
diagnostic-only, uncredentialed CORS probe.
|
|
26
|
+
|
|
27
|
+
Print the redacted app-integration diagnostic as the next setup step only for
|
|
28
|
+
Next.js and Node targets that receive its required app credential pair.
|
|
29
|
+
|
|
30
|
+
- bf6df96: BREAKING (0.x minor): Make signed webhook receivers fail closed when their
|
|
31
|
+
signing secret is missing, empty, or blank. Use `handleSignedWebhook()` for the
|
|
32
|
+
default signed path and `handleUnsignedWebhook()` only for an intentionally
|
|
33
|
+
unsigned endpoint; both new names and `SignedWebhookOptions` are exported from
|
|
34
|
+
`@01.software/sdk/webhook`, not the SDK root. The deprecated `handleWebhook()`
|
|
35
|
+
and `WebhookOptions` compatibility exports remain available at their existing
|
|
36
|
+
root and webhook-subpath locations, require signed options, and follow the same
|
|
37
|
+
fail-closed runtime behavior.
|
|
38
|
+
|
|
39
|
+
`toleranceSeconds` is now validated. It keeps its 300-second default for an
|
|
40
|
+
absent or null value, but a present value must be a number within an inclusive
|
|
41
|
+
0-86400-second range; anything else (including `Infinity`, `NaN`, a negative
|
|
42
|
+
number, a non-number, or a week-long window) is a configuration error that
|
|
43
|
+
returns 500 with a distinct tolerance message before the body is consumed.
|
|
44
|
+
|
|
45
|
+
- 2ce3aa9: Add explicit embedded-admin browser and server SDK entrypoints for the receiver
|
|
46
|
+
handshake and strict assertion verification. Add the PAT-only Human CLI
|
|
47
|
+
`embedded-app show`, `configure`, and `disable` commands for single-binding
|
|
48
|
+
management.
|
|
49
|
+
|
|
50
|
+
### Patch Changes
|
|
51
|
+
|
|
52
|
+
- 48372ad: Synchronize the optional tenant embedded-admin binding in generated Payload
|
|
53
|
+
types. This does not add an SDK method or expose embedded session credentials.
|
|
54
|
+
- 3fb53f0: Clarify PAT revocation audit metadata for trusted machine reconciliation.
|
|
55
|
+
- eea3ea8: Align canonical Order and Checkout response validation with the authoritative non-empty nullable item fields.
|
|
56
|
+
- 46c32e6: Ensure the packed SDK runtime declares its `jose` dependency with the portable
|
|
57
|
+
npm range used by standalone consumers.
|
|
58
|
+
- a1567cc: Validate SDK release tarballs with patched package-analysis dependencies.
|
|
59
|
+
- 9fecd85: Register the internal `commerce-payment-webhook-routes` collection so the SDK
|
|
60
|
+
collection registry stays in lockstep with Console. The collection is
|
|
61
|
+
Console-internal PortOne webhook routing state: it adds no SDK method, appears
|
|
62
|
+
in no public or server-only bucket, and exposes no credential.
|
|
63
|
+
- 41fbcb6: Synchronize required customer, period-end, and idempotency-key fields for the
|
|
64
|
+
SDK-hidden `membership-charges` generated type. The collection remains
|
|
65
|
+
server-only and gains no public write method.
|
|
66
|
+
|
|
67
|
+
## 0.50.0
|
|
68
|
+
|
|
69
|
+
### Minor Changes
|
|
70
|
+
|
|
71
|
+
- 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.
|
|
72
|
+
- 743b895: Add optional canonical `allDayStartDate` and exclusive
|
|
73
|
+
`allDayEndDateExclusive` fields to public event-range DTOs while retaining
|
|
74
|
+
instant compatibility shadows and existing TypeScript object-literal source
|
|
75
|
+
compatibility. Generated Event types also add optional canonical
|
|
76
|
+
`recurrence.untilDate` for all-day structured recurrence; existing object
|
|
77
|
+
literals that omit it remain valid.
|
|
78
|
+
- 743b895: Expose `managed_refund_attestation_forbidden` as the typed commerce error for registered managed captures while preserving existing cancel-refund errors and detail placement.
|
|
79
|
+
- 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.
|
|
80
|
+
- 743b895: BREAKING (0.x minor): Retire the expired ADR 0025 product media compatibility
|
|
81
|
+
shims. `resolveProductMedia()` and `resolveProductGallery()` — plus their
|
|
82
|
+
compatibility-only types `MediaPointerSource`, `ResolveProductMediaInput`,
|
|
83
|
+
`ResolveProductMediaResult`, `ProductMediaSetMatchType`, `ProductMediaSetInput`,
|
|
84
|
+
`ProductGallerySource`, `ResolveProductGalleryInput`, and
|
|
85
|
+
`ResolveProductGalleryResult` — are no longer exported from the package root or
|
|
86
|
+
`utils`.
|
|
87
|
+
|
|
88
|
+
These shipped in 0.34.0 as a one-release migration aid and forwarded to the
|
|
89
|
+
canonical resolvers. Replace `resolveProductMedia()` and
|
|
90
|
+
`resolveProductGallery()` with `resolveProductSelectionMedia()` for
|
|
91
|
+
variant/option selection media and `resolveProductDisplayMedia()` for listing
|
|
92
|
+
and PDP display fallback. Pre-ADR-0025 `mediaSets` inputs have no replacement:
|
|
93
|
+
variant `images[]` subsets and `product-option-values.swatch.mediaItemId` are
|
|
94
|
+
the canonical selection sources.
|
|
95
|
+
|
|
96
|
+
Canonical selection and display precedence, result shapes, and edge-case
|
|
97
|
+
behavior are unchanged. See `packages/published/sdk/MIGRATION.md`.
|
|
98
|
+
|
|
99
|
+
- bca928f: Add provider-neutral `paymentReconciliationRequired` and
|
|
100
|
+
`paymentRefundRequiresAttention` commerce notification webhook types, handlers,
|
|
101
|
+
and runtime validation.
|
|
102
|
+
|
|
103
|
+
### Patch Changes
|
|
104
|
+
|
|
105
|
+
- 743b895: Expose the nullable ownership scope on the generated server-only inbound
|
|
106
|
+
webhook ledger document type.
|
|
107
|
+
- 743b895: Align commerce endpoint descriptors with the shared HTTP contract manifest without changing endpoint methods, paths, or error families.
|
|
108
|
+
- 743b895: Expose the additive Toss capture-evidence variants in generated private
|
|
109
|
+
PaymentSession types while preserving the existing public payment API.
|
|
110
|
+
- 743b895: Expose the additive durable Return-refund canonical envelope and stable
|
|
111
|
+
post-commit replay outcome in generated Payload types. Refund execution now
|
|
112
|
+
rejects changed payment identity and cross-tenant explicit-key reuse before
|
|
113
|
+
provider I/O while preserving identical cache-loss replay payloads.
|
|
114
|
+
- 0c4c5fd: Synchronize generated ProviderConnection configuration-attestation fields for
|
|
115
|
+
the SDK-hidden `commerce-payment-accounts` collection. The operator-only REST
|
|
116
|
+
actions remain internal to Console and add no public SDK transport method.
|
|
117
|
+
- 743b895: Standardize customer-facing Console terminology in initialization guidance and
|
|
118
|
+
generated SDK descriptions without changing runtime behavior or API contracts.
|
|
119
|
+
- 743b895: Remove the unsupported minor and guardian-consent fields from generated
|
|
120
|
+
server-only Customer document types as a privacy correction. Shaped customer
|
|
121
|
+
registration and `/me` response types are unchanged.
|
|
122
|
+
- 743b895: Clarify the generated webhook subscription descriptions: an empty subscription
|
|
123
|
+
list is a wildcard for ordinary collection create/update events only, and
|
|
124
|
+
commerce notifications require an explicit row for their source collection.
|
|
125
|
+
Descriptions only — no schema, runtime, or API contract change.
|
|
126
|
+
- 743b895: Add optional sanitized commerce notification diagnostics fields (`eventType`,
|
|
127
|
+
`notificationEvent`, `notificationIntentId`, `notificationDedupeKey`,
|
|
128
|
+
`sourceId`) to the generated internal `WebhookDelivery` document type. The
|
|
129
|
+
collection stays internal and is not exposed through the SDK surface;
|
|
130
|
+
existing object literals remain valid because every field is optional.
|
|
131
|
+
|
|
132
|
+
## 0.49.0
|
|
133
|
+
|
|
134
|
+
### Minor Changes
|
|
135
|
+
|
|
136
|
+
- aef44ec: Fix SDK error guards across independently bundled entrypoints and expose the guards from the client and server entries.
|
|
137
|
+
- 86f74d3: Expose immutable membership subscribe-admission snapshot fields in the generated SDK types.
|
|
138
|
+
- edc790e: BREAKING (0.x minor): Checkout `paymentState.activePaymentSession.provider` can
|
|
139
|
+
now be `portone`. Consumers using `@01.software/sdk` 0.45.0, 0.46.0, or 0.46.1
|
|
140
|
+
must upgrade to the 0.49.0 release produced by this minor changeset, or later,
|
|
141
|
+
before the server exposes managed PortOne sessions; otherwise
|
|
142
|
+
`checkouts.retrieve` and `checkouts.query` throw during strict response
|
|
143
|
+
validation. SDK 0.48.0's runtime decoder already accepts `portone`, but its
|
|
144
|
+
published TypeScript `CheckoutPaymentSessionRef` remains `provider: 'toss'`, so
|
|
145
|
+
0.48.0 is not the fully compatible public-contract floor. `checkouts.create` is
|
|
146
|
+
not part of this break because the current producer does not return an active
|
|
147
|
+
PortOne session reference.
|
|
148
|
+
|
|
149
|
+
Keep custom bridge recovery on the server-only exact lookup.
|
|
150
|
+
|
|
151
|
+
- fa71a21: Add a fail-closed PortOne Standard V2 Toss Payments CARD browser action with a required redirect, PG-safe payment identity, and durable single-slot retry semantics.
|
|
152
|
+
- 5ea6348: Expose non-commerce API reasons through `SDKError.apiReason` and the family-aware `getSDKErrorReason` accessor while preserving strict commerce error typing.
|
|
153
|
+
|
|
154
|
+
### Patch Changes
|
|
155
|
+
|
|
156
|
+
- cb2a742: Clarify that idempotent commerce mutation response fields do not provide exactly-once side-effect semantics.
|
|
157
|
+
- 15c1024: Synchronize generated Payload types for the internal payment-kernel result and owner-commit records without exposing those collections through a public SDK collection bucket.
|
|
158
|
+
|
|
3
159
|
## 0.48.0
|
|
4
160
|
|
|
5
161
|
### Minor Changes
|
|
@@ -1043,7 +1199,7 @@ displayStatus` JSDoc comment from `Order.status`. The Console removed that
|
|
|
1043
1199
|
disabled. Customer auth failures now surface the same SDK-specific error classes
|
|
1044
1200
|
as other SDK requests instead of the previous generic API error shape.
|
|
1045
1201
|
|
|
1046
|
-
##
|
|
1202
|
+
## Historical 0.34.0 migration notes
|
|
1047
1203
|
|
|
1048
1204
|
### Minor Changes
|
|
1049
1205
|
|
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
|