@01.software/sdk 0.71.0 → 0.72.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 +84 -0
- package/README.md +31 -1
- package/dist/client.cjs +74 -7
- 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 +74 -7
- package/dist/client.js.map +1 -1
- package/dist/{collection-client-D18xyUq_.d.cts → collection-client-B3CnqMDQ.d.cts} +4 -4
- package/dist/{collection-client-CUGJcTpl.d.ts → collection-client-uOgS_1bC.d.ts} +4 -4
- package/dist/{const-Dlu0mXmj.d.ts → const-BJBK7jBl.d.ts} +1 -1
- package/dist/{const-oGEoxCXZ.d.cts → const-_ZfJjRQG.d.cts} +1 -1
- package/dist/{index-Ccd4NYTL.d.ts → index-CBaP4q8r.d.ts} +3 -3
- package/dist/{index-HHVtIKXs.d.cts → index-CI_LFWiG.d.cts} +3 -3
- package/dist/index.cjs +74 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +74 -7
- package/dist/index.js.map +1 -1
- package/dist/{payload-types-BgOEk6Y9.d.cts → payload-types-BRg8Yary.d.cts} +191 -166
- package/dist/{payload-types-BgOEk6Y9.d.ts → payload-types-BRg8Yary.d.ts} +191 -166
- package/dist/query.d.cts +5 -5
- package/dist/query.d.ts +5 -5
- package/dist/realtime.d.cts +2 -2
- package/dist/realtime.d.ts +2 -2
- package/dist/server.cjs +74 -7
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +7 -7
- package/dist/server.d.ts +7 -7
- package/dist/server.js +74 -7
- package/dist/server.js.map +1 -1
- package/dist/{types-nyOvcO0K.d.ts → types-Cmnxxvuv.d.ts} +46 -7
- package/dist/{types-DLHEIsAx.d.cts → types-CnkJQUez.d.cts} +46 -7
- package/dist/{types-CSvp2fJ_.d.ts → types-DLjSqL0P.d.ts} +2 -2
- package/dist/{types-BzG3NO7R.d.cts → types-FyklqLAk.d.cts} +2 -2
- 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.d.cts +5 -5
- package/dist/webhook.d.ts +5 -5
- package/package.json +2 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,89 @@
|
|
|
1
1
|
# @01.software/sdk
|
|
2
2
|
|
|
3
|
+
## 0.72.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- bbcdc03: Clarify generated event occurrence identity and community comment-setting descriptions in operator-facing wording. Types, field access, and response shapes are unchanged.
|
|
8
|
+
- 327779c: Clarify generated JSDoc for event admission sale windows and usage rate card effective windows after adding date and time pickers in the Admin Panel. Stored instants, SDK runtime behavior, and public API shape remain unchanged.
|
|
9
|
+
- 2075d27: Clarify the generated event registration-list description with operator-facing wording. Types, field access, and response shapes are unchanged.
|
|
10
|
+
- 2990468: Correct the generated event `externalSource` description comment: provider, source ID, and URL can all appear in public read responses. Field access and response shapes are unchanged.
|
|
11
|
+
- 055671d: Clarify generated commerce field descriptions in operator-facing wording. Types, field access, and response shapes are unchanged.
|
|
12
|
+
- 5581c60: Clarify generated event field descriptions for admission quantity limits, attendee privacy, and public API visibility.
|
|
13
|
+
- 5138b42: Clarify generated customer and membership field descriptions without changing field keys or types.
|
|
14
|
+
- 269db8b: Refresh generated Payload type descriptions for workspace and platform operator guidance.
|
|
15
|
+
- 9ec8504: Update generated type description comments without changing request or response shapes. The server applies the calendar timezone when a non-duplicate event create omits timezone.
|
|
16
|
+
- 15e5dc6: Restore privacy, entitlement lifecycle and validation, usage aggregation, and webhook idempotency details in generated field descriptions.
|
|
17
|
+
- 1c23d29: Document the membership delegated billing connection in generated payment credential types.
|
|
18
|
+
- 3b47cff: Clarify generated Product `markets` JSDoc: new products without markets receive the active default market if one exists, and removing every market from an existing product excludes it from market catalogs. Runtime behavior and public API shape remain unchanged.
|
|
19
|
+
|
|
20
|
+
## 0.72.0
|
|
21
|
+
|
|
22
|
+
### Minor Changes
|
|
23
|
+
|
|
24
|
+
- 756ca0b: Document the owner-approved multi-currency reporting correction for server-only
|
|
25
|
+
customer `lifetimeValue`: retain `number | null`, sum only a verified single
|
|
26
|
+
currency, and return `null` for mixed or unavailable currencies (zero orders
|
|
27
|
+
remain `0`). No new SDK field or webhook envelope is introduced and persisted
|
|
28
|
+
webhook bytes are unchanged. This minor records the public behavior correction
|
|
29
|
+
under [the #7859 owner decision](https://github.com/01-office/01-software/issues/7859#issuecomment-6540676116),
|
|
30
|
+
even though the generated property type is unchanged.
|
|
31
|
+
- 181d5ee: **Additive response arms (0.x minor).** `server.commerce.cancelOrder()` can now
|
|
32
|
+
return the registered managed Toss outcome (ADR 0073). When the paid order was
|
|
33
|
+
captured through a Console payment connection, Console refunds it after the
|
|
34
|
+
local cancel commits and the response carries
|
|
35
|
+
`managedRefund: { outcome: 'completed' | 'convergence_pending' | 'operator_required' }`
|
|
36
|
+
with `providerRefunded` and the refunded amount, never `refundPending`. Do not
|
|
37
|
+
run a storefront or BFF provider refund for these responses: retries read or
|
|
38
|
+
resume the same Console refund. An exhaustive check over `CancelOrderResponse`
|
|
39
|
+
needs the two new arms (`CancelOrderManagedCommittedResponse`,
|
|
40
|
+
`CancelOrderManagedAlreadyCanceledResponse`).
|
|
41
|
+
|
|
42
|
+
Import both response arms and `ManagedCancelRefundOutcome` as types from
|
|
43
|
+
`@01.software/sdk`, alongside `CancelOrderResponse`.
|
|
44
|
+
|
|
45
|
+
Custom bridge, legacy, PortOne, and credit-funded orders keep the existing
|
|
46
|
+
`refundPending` handoff unchanged.
|
|
47
|
+
|
|
48
|
+
- cf8e6d5: **BREAKING (0.x minor).** Prepare strict readers for the reserved `'stripe'`
|
|
49
|
+
managed provider before the server can emit it.
|
|
50
|
+
`CheckoutPaymentSessionRef['provider']` widens to
|
|
51
|
+
`'toss' | 'portone' | 'stripe'`, so an exhaustive `switch` over it needs a
|
|
52
|
+
`'stripe'` case. Earlier SDK versions reject a `'stripe'` reference as an
|
|
53
|
+
invalid canonical response; upgrade every consumer that reads Checkouts before
|
|
54
|
+
Stripe becomes available.
|
|
55
|
+
|
|
56
|
+
Checkout references accept `provider: 'stripe'`. PaymentSession methods
|
|
57
|
+
(`create`, `createPortOne`, `retrieve`, `retrievePortOne`, `cancel`,
|
|
58
|
+
`cancelPortOne` and server `confirm`) reject a Stripe session after validating
|
|
59
|
+
it completely, including the strict Stripe Payment Element action
|
|
60
|
+
(`stripe_payment_element` with `clientSecret`, `publishableKey` and a
|
|
61
|
+
credential-free HTTPS or loopback `returnUrl`), and report a generic invalid response with
|
|
62
|
+
`details.expected` and `details.actual`. Partial or unknown action fields are
|
|
63
|
+
rejected. Stripe is not available yet and the SDK adds no Stripe PaymentSession
|
|
64
|
+
method. Toss, PortOne and custom bridge behavior, including custom provider
|
|
65
|
+
names, is unchanged.
|
|
66
|
+
|
|
67
|
+
### Patch Changes
|
|
68
|
+
|
|
69
|
+
- 88bee51: Clarify the generated admission type price-reference guidance: the reference is optional when saving and required for sales. The generated field type and public API behavior are unchanged.
|
|
70
|
+
- 9f326b5: Synchronize generated collection and calendar field descriptions with neutral Console copy for workspace menu display names. Type shapes, runtime behavior, and API titles are unchanged.
|
|
71
|
+
- 1d03497: Clarify the generated documentation for membership payment results that were not applied at the time they were received.
|
|
72
|
+
- 931d8a0: Clarify generated Discount type descriptions for code usage counts, pending checkout reservations, and unsupported allocation repair guidance.
|
|
73
|
+
- 1a6e310: Restore the read-only note in the generated Discount `usesCount` type description.
|
|
74
|
+
- 2f4989e: Synchronize generated EventRegistration types with the reordered registration fields (status, attendance, and quantity now come first). Only property order changes; SDK runtime behavior, collection buckets, request inputs, and public responses remain unchanged. Separately, Console now reads `event-occurrences` newest `startsAt` first when a request omits `sort`; pass `sort` explicitly if you depend on a specific order.
|
|
75
|
+
- 4db606a: Clarify the generated membership plan description comment to reflect its inclusion in public query responses for active plans. Field access and response shapes are unchanged.
|
|
76
|
+
- b43cb9c: Synchronize generated Order and Checkout types with the internal Checkout `source` field and the internal `in_person` Order source value. SDK runtime behavior, collection buckets, request inputs, and public responses remain unchanged.
|
|
77
|
+
- ba3ffc2: Synchronize generated FulfillmentOrder and Fulfillment types with the internal, access-closed `method` field. SDK runtime behavior, collection buckets, request inputs, and public responses remain unchanged.
|
|
78
|
+
- c246a93: Clarify generated Customer field descriptions for linked sign-in providers and password change times. Types and runtime behavior are unchanged.
|
|
79
|
+
- 6b9d1ab: Use neutral short-summary comments in generated Payload types without prescribing where tenant apps display descriptions.
|
|
80
|
+
- 8ae95f0: Give the SDK declaration build a bounded 4 GiB heap so release preparation can complete on hosted runners.
|
|
81
|
+
- 2be5e90: Remove unused package-local prerelease publishing commands. Package publication continues through the owner-dispatched trusted publishing workflow.
|
|
82
|
+
- f776ca2: Clarify the generated Return field descriptions for return details, cancellation actors, refund receipts, and original shipping refunds.
|
|
83
|
+
- e1ba296: Synchronize generated PaymentSession types with the private, nullable Standard long-tail detection history field. SDK runtime behavior, collection buckets, and public projections remain unchanged.
|
|
84
|
+
- 9159e72: Clarify the generated customer type documentation for server-recorded hosted consent history. Runtime behavior and public type shapes are unchanged.
|
|
85
|
+
- 9a92a2d: Update generated collection descriptions to match the Console coupon navigation and explain checkout discounts and redemption coupon definitions. Public types and runtime behavior are unchanged.
|
|
86
|
+
|
|
3
87
|
## 0.71.0
|
|
4
88
|
|
|
5
89
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -959,6 +959,12 @@ Refund and refund-line-item collection reads remain server-only. Their public
|
|
|
959
959
|
types and native reads omit private funding fields, including populated refund
|
|
960
960
|
relationships. Generated storage types do not grant access to those fields.
|
|
961
961
|
|
|
962
|
+
Server-only customer documents and customer-update webhooks retain
|
|
963
|
+
`lifetimeValue?: number | null`. The scalar sums original order totals only
|
|
964
|
+
for one verified registry currency with a numeric exponent; mixed or unavailable
|
|
965
|
+
currencies yield `null`, and no contributing orders yield `0`. Currency bucket
|
|
966
|
+
fields are not added. Existing webhook bodies and replay bytes stay unchanged.
|
|
967
|
+
|
|
962
968
|
### `depth` — how deep to populate relationship fields
|
|
963
969
|
|
|
964
970
|
`depth` is the primary control for populating relationships like `category`, `images`, `brand`. Browser publishable-key raw collection reads are constrained to `depth: 0` with `joins: false` and no `populate`; relationship-rich storefront reads should use shaped helpers such as `commerce.product.detail()` / `listingPage()`, or a `createServerClient()` raw query when server credentials are appropriate. Browser SDK raw reads add those safe defaults automatically and reject relationship-expanded raw read options before making a request.
|
|
@@ -1623,7 +1629,11 @@ Cart add/update/remove/clear/discount/attribute mutations additionally require
|
|
|
1623
1629
|
the last observed `cart.revision` as `expectedRevision`. A
|
|
1624
1630
|
`cart_revision_conflict` means refetch the Cart and start a new logical mutation
|
|
1625
1631
|
with a new idempotency key. Cart merge requires the key but not a single revision
|
|
1626
|
-
because it atomically resolves two current Cart states.
|
|
1632
|
+
because it atomically resolves two current Cart states. Merging a Cart the
|
|
1633
|
+
customer already owns returns `resolution: 'unchanged'` and writes nothing, so
|
|
1634
|
+
the revision you last observed stays valid for the next mutation. Because it
|
|
1635
|
+
writes nothing, such a merge does not count as Cart activity for stale-Cart
|
|
1636
|
+
cleanup.
|
|
1627
1637
|
Treat a replayed Cart result as an operation receipt: never replace a newer
|
|
1628
1638
|
cached Cart with a lower `revision`; retrieve when response ordering is unclear.
|
|
1629
1639
|
|
|
@@ -1779,6 +1789,16 @@ authoritative API response or signed webhook, then report the exact captured
|
|
|
1779
1789
|
identity and Money. The create response is intentionally limited to
|
|
1780
1790
|
`{ id, provider, providerSessionId, money }`.
|
|
1781
1791
|
|
|
1792
|
+
The closed managed provider vocabulary is `'toss' | 'portone' | 'stripe'`.
|
|
1793
|
+
`'stripe'` is reserved so that consumers upgrade before the server can emit it:
|
|
1794
|
+
Checkout references accept `provider: 'stripe'`, while the PaymentSession
|
|
1795
|
+
methods (`create`, `createPortOne`, `retrieve`, `retrievePortOne`, `cancel`,
|
|
1796
|
+
`cancelPortOne`, and server `confirm`) reject a Stripe session after validating
|
|
1797
|
+
it completely, with a generic invalid-response error carrying
|
|
1798
|
+
`details.expected` and `details.actual`. Stripe is not available yet, and the
|
|
1799
|
+
SDK has no Stripe PaymentSession method. Custom bridge provider names are a
|
|
1800
|
+
separate namespace and are unaffected.
|
|
1801
|
+
|
|
1782
1802
|
Custom bridge sessions intentionally remain `null` in
|
|
1783
1803
|
`checkout.paymentState.activePaymentSession`: Checkout exposes only managed
|
|
1784
1804
|
adapters from its closed provider vocabulary. Persist the `providerSessionId`
|
|
@@ -1926,6 +1946,16 @@ Do not infer the external lane from a defaulted `sessionOrigin`, an
|
|
|
1926
1946
|
captures must use Console's refund operation; `resolveCancelRefund` remains
|
|
1927
1947
|
only for the two external-drain rows above.
|
|
1928
1948
|
|
|
1949
|
+
For a registered managed Toss capture without customer credit, `cancelOrder()`
|
|
1950
|
+
no longer returns `refundPending`: Console refunds the payment after the local
|
|
1951
|
+
cancel commits and returns `managedRefund.outcome`. `completed` means the
|
|
1952
|
+
provider refund and the cancel refund ledger are committed;
|
|
1953
|
+
`convergence_pending` means Console still owns the refund and continues it;
|
|
1954
|
+
`operator_required` means it needs operator review in Console. Treat all three
|
|
1955
|
+
as a committed cancellation and never start a provider refund from your
|
|
1956
|
+
storefront or BFF. A retry reads or resumes the same Console refund. Registered
|
|
1957
|
+
PortOne and credit-funded managed orders still return the pending marker.
|
|
1958
|
+
|
|
1929
1959
|
Managed ownership follows the captured Transaction's exact tenant-bound
|
|
1930
1960
|
PaymentSession and historical registered account. Order/provider/environment
|
|
1931
1961
|
drift remains Console-owned corruption. Unresolved or cross-tenant identity
|
package/dist/client.cjs
CHANGED
|
@@ -2613,7 +2613,18 @@ var ABANDONED_REASONS = ["expired", "customer", "operator"];
|
|
|
2613
2613
|
function managedPaymentProviders(providers) {
|
|
2614
2614
|
return providers;
|
|
2615
2615
|
}
|
|
2616
|
-
var PAYMENT_PROVIDERS = managedPaymentProviders([
|
|
2616
|
+
var PAYMENT_PROVIDERS = managedPaymentProviders([
|
|
2617
|
+
"toss",
|
|
2618
|
+
"portone",
|
|
2619
|
+
"stripe"
|
|
2620
|
+
]);
|
|
2621
|
+
var CANCEL_RECOVERY_METHODS = {
|
|
2622
|
+
toss: "cancel()",
|
|
2623
|
+
portone: "cancelPortOne()",
|
|
2624
|
+
stripe: null
|
|
2625
|
+
};
|
|
2626
|
+
var STRIPE_RETURN_URL_RAW_CHARACTERS = /^[^\s\u0000-\u001F\u007F\\]+$/;
|
|
2627
|
+
var STRIPE_RETURN_URL_AUTHORITY = /^[A-Za-z][A-Za-z0-9+.-]*:\/\/[^/?#@]+(?:[/?#]|$)/;
|
|
2617
2628
|
var PAYMENT_PROVIDER_STATUSES = [
|
|
2618
2629
|
"requires_payment_method",
|
|
2619
2630
|
"requires_action",
|
|
@@ -2662,11 +2673,8 @@ function fail(resource, path, expected) {
|
|
|
2662
2673
|
invalidCanonicalResponse(resource, { path, expected });
|
|
2663
2674
|
}
|
|
2664
2675
|
function providerMismatch(resource, expected, actual, operation2) {
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
toss: "cancel()",
|
|
2668
|
-
portone: "cancelPortOne()"
|
|
2669
|
-
}[actual];
|
|
2676
|
+
const method = CANCEL_RECOVERY_METHODS[actual];
|
|
2677
|
+
if (operation2 === "cancel" && method !== null) {
|
|
2670
2678
|
throw createApiError(
|
|
2671
2679
|
`Canonical ${resource} response provider mismatch: expected ${expected}, received ${actual}.`,
|
|
2672
2680
|
502,
|
|
@@ -3910,6 +3918,65 @@ function validateRequiredReconciliation(value, allowed, resource, path) {
|
|
|
3910
3918
|
}
|
|
3911
3919
|
function validateNextAction(value, provider, resource, path) {
|
|
3912
3920
|
const action = record(value, resource, path);
|
|
3921
|
+
if (provider === "stripe") {
|
|
3922
|
+
exact(
|
|
3923
|
+
action,
|
|
3924
|
+
["type", "clientSecret", "publishableKey", "returnUrl"],
|
|
3925
|
+
[],
|
|
3926
|
+
resource,
|
|
3927
|
+
path
|
|
3928
|
+
);
|
|
3929
|
+
if (action.type !== "stripe_payment_element")
|
|
3930
|
+
fail(resource, `${path}.type`, "stripe_payment_element");
|
|
3931
|
+
const clientSecret = boundedString(
|
|
3932
|
+
action.clientSecret,
|
|
3933
|
+
255,
|
|
3934
|
+
resource,
|
|
3935
|
+
`${path}.clientSecret`
|
|
3936
|
+
);
|
|
3937
|
+
if (!/^pi_[A-Za-z0-9]+_secret_[A-Za-z0-9]+$/.test(clientSecret)) {
|
|
3938
|
+
fail(
|
|
3939
|
+
resource,
|
|
3940
|
+
`${path}.clientSecret`,
|
|
3941
|
+
"Stripe PaymentIntent client secret"
|
|
3942
|
+
);
|
|
3943
|
+
}
|
|
3944
|
+
const publishableKey = boundedString(
|
|
3945
|
+
action.publishableKey,
|
|
3946
|
+
255,
|
|
3947
|
+
resource,
|
|
3948
|
+
`${path}.publishableKey`
|
|
3949
|
+
);
|
|
3950
|
+
if (!/^pk_(?:test|live)_[A-Za-z0-9]+$/.test(publishableKey)) {
|
|
3951
|
+
fail(resource, `${path}.publishableKey`, "Stripe publishable key");
|
|
3952
|
+
}
|
|
3953
|
+
const returnUrl = boundedString(
|
|
3954
|
+
action.returnUrl,
|
|
3955
|
+
2048,
|
|
3956
|
+
resource,
|
|
3957
|
+
`${path}.returnUrl`
|
|
3958
|
+
);
|
|
3959
|
+
if (!STRIPE_RETURN_URL_RAW_CHARACTERS.test(returnUrl) || !STRIPE_RETURN_URL_AUTHORITY.test(returnUrl)) {
|
|
3960
|
+
fail(
|
|
3961
|
+
resource,
|
|
3962
|
+
`${path}.returnUrl`,
|
|
3963
|
+
"HTTPS or loopback URL without embedded credentials"
|
|
3964
|
+
);
|
|
3965
|
+
}
|
|
3966
|
+
try {
|
|
3967
|
+
const parsed = new URL(returnUrl);
|
|
3968
|
+
const loopback = parsed.protocol === "http:" && (parsed.hostname === "localhost" || parsed.hostname === "127.0.0.1");
|
|
3969
|
+
if (!loopback && parsed.protocol !== "https:" || parsed.username || parsed.password)
|
|
3970
|
+
throw new Error("unsafe return URL");
|
|
3971
|
+
} catch {
|
|
3972
|
+
fail(
|
|
3973
|
+
resource,
|
|
3974
|
+
`${path}.returnUrl`,
|
|
3975
|
+
"HTTPS or loopback URL without embedded credentials"
|
|
3976
|
+
);
|
|
3977
|
+
}
|
|
3978
|
+
return;
|
|
3979
|
+
}
|
|
3913
3980
|
if (provider === "portone") {
|
|
3914
3981
|
if (action.type === "portone_sdk") {
|
|
3915
3982
|
const hasCancelable = "cancelable" in action;
|
|
@@ -4285,7 +4352,7 @@ function validatePublicPaymentSession(value, expectedProvider, operation2) {
|
|
|
4285
4352
|
);
|
|
4286
4353
|
}
|
|
4287
4354
|
if (expectedProvider !== void 0 && provider !== expectedProvider) {
|
|
4288
|
-
if (operation2 === "cancel" && status !== "canceling" && status !== "canceled") {
|
|
4355
|
+
if (operation2 === "cancel" && CANCEL_RECOVERY_METHODS[provider] !== null && status !== "canceling" && status !== "canceled") {
|
|
4289
4356
|
fail(
|
|
4290
4357
|
resource,
|
|
4291
4358
|
"$.providerStatus",
|