@01.software/sdk 0.73.1 → 0.75.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 +75 -0
- package/README.md +109 -4
- package/dist/client.cjs +59 -14
- 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 +59 -14
- package/dist/client.js.map +1 -1
- package/dist/{collection-client-BH4dIZ6c.d.cts → collection-client-BNC6tUdK.d.cts} +3 -4
- package/dist/{collection-client-lLAl3xCZ.d.ts → collection-client-CNkBMUHj.d.ts} +3 -4
- package/dist/collection-documents-Bl0AF0m0.d.cts +5486 -0
- package/dist/collection-documents-Bl0AF0m0.d.ts +5486 -0
- package/dist/{const-CCvoknRY.d.ts → const-CcOT0taO.d.cts} +1 -3
- package/dist/{const-BS2EaIp4.d.cts → const-CcOT0taO.d.ts} +1 -3
- package/dist/{index-DVqNpmsc.d.ts → index-CQsJvMCN.d.ts} +2 -3
- package/dist/{index-CHdrzJ8-.d.cts → index-CfxkqaY9.d.cts} +2 -3
- package/dist/index.cjs +60 -14
- 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 +60 -14
- package/dist/index.js.map +1 -1
- package/dist/query.cjs +16 -1
- 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 +16 -1
- package/dist/query.js.map +1 -1
- package/dist/realtime.d.cts +1 -2
- package/dist/realtime.d.ts +1 -2
- package/dist/server.cjs +50 -11
- 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 +50 -11
- package/dist/server.js.map +1 -1
- package/dist/{types-lbzbJSZh.d.ts → types-Btxz6NVi.d.ts} +161 -31
- package/dist/types-CQw4HXky.d.ts +151 -0
- package/dist/{types-Chwgg4CQ.d.cts → types-DMwRdJ-4.d.cts} +161 -31
- package/dist/types-Jr4xTiGs.d.cts +151 -0
- package/dist/ui/form.cjs.map +1 -1
- package/dist/ui/form.d.cts +1 -1
- package/dist/ui/form.d.ts +1 -1
- package/dist/ui/form.js.map +1 -1
- package/dist/ui/video.cjs.map +1 -1
- package/dist/ui/video.d.cts +1 -1
- package/dist/ui/video.d.ts +1 -1
- package/dist/ui/video.js.map +1 -1
- package/dist/webhook.d.cts +7 -5
- package/dist/webhook.d.ts +7 -5
- package/package.json +1 -1
- package/dist/payload-types-PXkmefhZ.d.cts +0 -14027
- package/dist/payload-types-PXkmefhZ.d.ts +0 -14027
- package/dist/types-CQRsG6sA.d.ts +0 -53
- package/dist/types-CyMz0Kzc.d.cts +0 -53
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,80 @@
|
|
|
1
1
|
# @01.software/sdk
|
|
2
2
|
|
|
3
|
+
## 0.75.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 3ab46a5: Allow `returnWithRefund` to complete an existing approved Return with `existingReturnId`, preserving the server-owned approval and idempotent replay. Clarify that the initial shipping refund is added separately to the line refund amount.
|
|
8
|
+
|
|
9
|
+
BREAKING (0.x minor): `returnWithRefund` now returns `ReturnWithRefundResponse`, matching the actual bounded completion receipt instead of full Return/Transaction documents. Use `refundSeq` and optional `notificationWarning`; read full documents separately when additional fields are needed. Completions without a provider transaction have both `transaction` and `refundSeq` set to null.
|
|
10
|
+
|
|
11
|
+
- 2a3cdbe: BREAKING (0.x minor): isolate SDK collection declarations from Console Config and Payload global type augmentation. Internal collection slugs no longer resolve to generated documents through `CollectionType`; existing browser/server buckets and runtime access checks are unchanged. Use documented operation DTOs where provided; code managing internal collections must use its application-owned Payload types.
|
|
12
|
+
|
|
13
|
+
Remove two unavailable internal relations from populated admission-hold types, including nested order/refund graphs. Preserve the other raw document fields and existing named compatibility types, including `WebhookWithoutSecret`. Consumer Payload applications retain ownership of their own `GeneratedTypes` augmentation. Compatibility disposition follows ADR 0138 and #8960.
|
|
14
|
+
|
|
15
|
+
- 78bd724: Add opt-in event registration email verification and its typed SDK helper on
|
|
16
|
+
`client.events` and `server.events`. The Events starter guides new deployments to
|
|
17
|
+
enable the event email-verification setting and shows an email code step for those
|
|
18
|
+
events; opt-out events keep immediate registration. Sandbox does not deliver
|
|
19
|
+
verification codes yet, so test registration there with an opt-out event.
|
|
20
|
+
Confirmation emails now have a tenant/recipient rolling-hour cap without changing
|
|
21
|
+
successful registration.
|
|
22
|
+
- 7aa55a1: BREAKING (0.x minor): createFulfillment and updateFulfillment now return FulfillmentMutationResponse instead of the raw Fulfillment document. Shipment mutation receipts retain shipment state, tracking and timestamps while excluding expanded relations and document extensions.
|
|
23
|
+
|
|
24
|
+
Migration: tenant, order and fulfillmentOrder are IDs rather than populated documents; fulfillmentOrder is null for legacy unlinked shipments. Branch on null before using that relationship. The receipt no longer includes items, adminNotes, metadata, method or deletedAt. Replace shipment.items?.docs and other document-only reads with an authorized server.collections.from('fulfillments').findById(receipt.id, { joins: { items: { limit: 100 } } }) read. Use the returned order or fulfillmentOrder ID with an authorized read of its owning collection when related details are needed. Remove dependencies on internal method values and populated tenant internals. Authorized collection reads retain their normal field access rules.
|
|
25
|
+
|
|
26
|
+
- 65f2725: Add `customer.auth.requestWithdrawalCode()` and `withdraw({ emailCode })` for purpose-limited withdrawal reauthentication on accounts without a local password. Existing `withdraw(password)` calls remain supported. Submit the code using the same refresh-family session (preserved across access-token refresh); successful withdrawal clears local credentials. Code-specific reauthentication reasons have a public type.
|
|
27
|
+
|
|
28
|
+
### Patch Changes
|
|
29
|
+
|
|
30
|
+
- ed5deda: Classify workspace social provider configuration as internal and synchronize the generated document types without exposing a public collection API.
|
|
31
|
+
- 86ba927: Clarify that prepareFulfillmentOrder must precede createFulfillment because shipment creation requires an in-progress fulfillment order.
|
|
32
|
+
- f8ec410: Update the generated EventOccurrence field documentation to match the Console copy: describe parentPublic as the parent event's public status, separate from sales conditions, and drop the capacity and registrations editing hints. The type structure is unchanged.
|
|
33
|
+
- 79a9e72: Regenerate the `Tenant.tenantPurpose` field documentation in the raw collection document types to match the Console copy: TEST creation has ended and the purpose of retained records is immutable. The type structure is unchanged.
|
|
34
|
+
- c5470fd: Expose the server-only Membership billing anchor day and its source in generated collection types.
|
|
35
|
+
- e0c7231: Refresh the generated Tenant purpose documentation after TEST creation retirement.
|
|
36
|
+
The SDK type structure and wire format remain unchanged.
|
|
37
|
+
- 287a638: Synchronize generated tenant notification settings and notification event types for occurrence time and venue change notices.
|
|
38
|
+
|
|
39
|
+
## 0.74.0
|
|
40
|
+
|
|
41
|
+
### Minor Changes
|
|
42
|
+
|
|
43
|
+
- a5ac520: **Additive response arm (0.x minor).** `cancelOrder()` already returned this body for an order paid entirely with customer credit; `CancelOrderResponse` now types it as `CancelOrderCreditOnlyCommittedResponse` (exported from `@01.software/sdk`): `cancelCommitted: true`, the restored purchase total as `refundedAmount`, `providerRefunded: false`, and no `transactionId` or `refundPending`. There is no PG refund to run. Runtime behavior is unchanged. Code that assumed a committed response without `transactionId` has `refundedAmount: 0`, or an exhaustive check over `CancelOrderResponse`, needs the new arm.
|
|
44
|
+
- b01549e: Feature progress now supports `customers` and `community` in addition to `ecommerce`. `createServerClient().tenant.featureProgress({ feature })` returns the response for the requested feature (`TenantFeatureProgressResponseFor<F>`): the `ecommerce` response keeps `config.fulfillmentMode`, while `customers` and `community` responses have no `config`. `TenantFeatureProgressResponse` still names the ecommerce response and `TenantFeatureProgressInput` still defaults to `feature: 'ecommerce'`, so existing wrappers keep their types; use `TenantFeatureProgressInput<TenantFeatureProgressFeature>` and `TenantFeatureProgressResponseUnion` to handle every supported feature. `01 feature check customers|community` reports hosted customer sign-in and first public comment setup. Manual items still require an end-to-end check in the app.
|
|
45
|
+
|
|
46
|
+
BREAKING (0.x minor): `TenantFeatureProgressFeature` now also includes `'customers'` and `'community'`, so exhaustive handling of that type needs the new cases, and a hand-written `TenantIntrospectionClient` implementation must type `featureProgress` as generic over the requested feature.
|
|
47
|
+
|
|
48
|
+
- 6b8a188: Feature progress now supports `events`. `createServerClient().tenant.featureProgress({ feature: 'events' })` and `01 feature check events` report whether the workspace event calendar is public and whether a scheduled, not-yet-ended occurrence accepts a free RSVP, plus a manual register, lookup, and cancel check. The check is read-only and does not evaluate remaining capacity or paid admission. The response has no `config`.
|
|
49
|
+
|
|
50
|
+
BREAKING (0.x minor): `TenantFeatureProgressFeature` now also includes `'events'`, so exhaustive handling of that type needs the new case.
|
|
51
|
+
|
|
52
|
+
- f433dee: Feature progress now supports `membership`. `createServerClient().tenant.featureProgress({ feature: 'membership' })` and `01 feature check membership` report whether an active plan has an active price for new sign-ups, plus a manual sign-up, charge, renewal, and cancellation check. Apps that only read or cancel existing memberships can treat the sellable-plan item as optional. The response has no `config`, like `customers` and `community`.
|
|
53
|
+
|
|
54
|
+
BREAKING (0.x minor): `TenantFeatureProgressFeature` now also includes `'membership'`, so exhaustive handling of that type needs the new case.
|
|
55
|
+
|
|
56
|
+
### Patch Changes
|
|
57
|
+
|
|
58
|
+
- 6814052: Clarify generated Event location JSDoc about the public read visibility of stored online URLs and notes and the privacy of internal notes. Persisted location paths and public read behavior remain unchanged.
|
|
59
|
+
- 65ed375: `Tenant` 생성 타입의 `defaultContentLocale` 설명 주석에 고객 메일도 이 언어로 발송한다는 내용이 추가됩니다. 타입 구조는 변경하지 않습니다.
|
|
60
|
+
- eb457be: Regenerate Payload type documentation after clarifying guest-link expiry guidance in the Console Admin Panel. Only JSDoc changes; field types and API response shapes are unchanged.
|
|
61
|
+
- e1c8158: Order variants by their fractional-indexing `_order` key (code-unit order, keyed before unkeyed; equal to the Admin Panel order for current-format `[0-9a-z]` keys) instead of a `Number()` conversion that turned every key into `NaN`, so listing-group representative variants and `fillDefaults` selections follow the Admin Panel variant order.
|
|
62
|
+
- e0fcb45: Type `createServerClient().video` as non-optional so the documented `createServerClient(...).video.playback(id)` compiles under strict TypeScript without `?.` or `!`. The server client always sets `video` at runtime; `RootServerClient.video` stays optional for structural mocks. A hand-written mock typed as `RootServerClientWithEvents` (or a `withMarket()` stub returning it) now needs a `video` member.
|
|
63
|
+
- 58f915b: `Customer`·`Product` 생성 타입에서 `customData` 속성의 선언 순서만 바뀝니다. 타입 구조는 변경하지 않습니다.
|
|
64
|
+
- 0e826e1: Remove collection-level descriptions from the generated payload types; Console list screens no longer show collection descriptions.
|
|
65
|
+
- 6dea486: Shorten or remove commerce field descriptions in the generated payload types to match the trimmed Console copy.
|
|
66
|
+
- 8530c76: Align event and registration descriptions in the generated payload types with the Console public read terminology and clarify guest-token PII visibility under retention policies. Types and response shapes are unchanged.
|
|
67
|
+
- 9c0c1d5: Point the generated `users.tenants` description at the renamed Settings > Workspace > Project destination.
|
|
68
|
+
- 16b3229: Shorten or remove shared field descriptions (SEO, subtitle, summary, taxonomy, videos) in the generated payload types to match the trimmed Console copy.
|
|
69
|
+
- a26270c: Keep internal profile record creation evidence out of public profile and profile-statistics types while synchronizing the generated storage schema. Ordinary API and GraphQL surfaces do not expose `recordCreatedAt`.
|
|
70
|
+
- 1d52b00: Shorten or remove customer and membership field descriptions in the generated payload types to match the trimmed Console copy.
|
|
71
|
+
- a16f609: Shorten or remove content, community and event field descriptions in the generated payload types to match the trimmed Console copy.
|
|
72
|
+
- 4165ada: Add `voided` to the generated `MembershipUnappliedPaidEvidence.reason` values for late paid evidence on expired setup charges.
|
|
73
|
+
- 27f0891: Shorten or remove workspace, settings and system field descriptions in the generated payload types to match the trimmed Console copy.
|
|
74
|
+
- 5376b13: Fix product listing-page search requests to query title and slug only, avoiding HTTP 400 errors caused by querying the nonexistent Products handle field.
|
|
75
|
+
- fb854bc: 생성 타입에서 입장 유형 `priceReference` 필드 설명 주석을 갱신한다. 런타임과 타입 시그니처 변경은 없다.
|
|
76
|
+
- 809b7db: Clarify the generated Video viewCount documentation to reflect that views are not currently collected automatically. The type structure is unchanged.
|
|
77
|
+
|
|
3
78
|
## 0.73.1
|
|
4
79
|
|
|
5
80
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -472,6 +472,8 @@ addendum in `docs/decisions/0012-sdk-public-commerce-contract.md`.
|
|
|
472
472
|
|
|
473
473
|
### Product Listing Pages (PLP) — join-safe queries
|
|
474
474
|
|
|
475
|
+
`search` trims surrounding whitespace and matches product `title` or `slug`.
|
|
476
|
+
|
|
475
477
|
**Recommended path:** Use `commerce.product.listingPage()` (or
|
|
476
478
|
`createQueryHooks(client).useProductListingPage()`) for greenfield storefront
|
|
477
479
|
PLPs. It wraps the cacheable listing-groups query endpoint, keeps the raw
|
|
@@ -977,6 +979,12 @@ const client = createClient({ publishableKey: '...' })
|
|
|
977
979
|
const query = createQueryHooks(client, getStorefrontQueryClient())
|
|
978
980
|
```
|
|
979
981
|
|
|
982
|
+
SDK document declarations are independent of your application's Payload
|
|
983
|
+
`GeneratedTypes`: importing the SDK does not register the Console schema in
|
|
984
|
+
Payload. `CollectionType<T>` resolves browser-public and server-only raw
|
|
985
|
+
collection documents; internal slugs remain classification vocabulary only.
|
|
986
|
+
Existing named raw exports, including `Tenant`, keep their compatibility shapes.
|
|
987
|
+
|
|
980
988
|
## Advanced: direct Payload queries (escape hatch)
|
|
981
989
|
|
|
982
990
|
Most consumers should use the helper APIs above (`commerce.product.detail`, etc.). The query builder below is the escape hatch for advanced cases the helpers do not cover: bulk operations, custom filter combinations, or fields the helper response does not expose.
|
|
@@ -1567,12 +1575,36 @@ erase personal data or free the email for a new registration.
|
|
|
1567
1575
|
Branch on `SDKError.apiReason`: `active_membership_exists` (409) requires the
|
|
1568
1576
|
membership to end first, including scheduled cancellations still in an active
|
|
1569
1577
|
status; `reauthentication_unavailable` (409) means no local password is set and
|
|
1570
|
-
the customer
|
|
1578
|
+
the customer must request a withdrawal-only email code. Incorrect passwords use
|
|
1571
1579
|
the shared login attempt counter and temporary lock (`account_locked`, 423).
|
|
1572
1580
|
Refusal leaves the SDK credentials intact. Server keys cannot withdraw on a
|
|
1573
1581
|
customer's behalf. Operator restore continues to follow the existing archive
|
|
1574
1582
|
rules; the withdrawal timestamp is retained.
|
|
1575
1583
|
|
|
1584
|
+
Customers without local password material, including social-only accounts, use
|
|
1585
|
+
withdrawal-only email reauthentication:
|
|
1586
|
+
|
|
1587
|
+
```ts
|
|
1588
|
+
await client.customer.auth.requestWithdrawalCode()
|
|
1589
|
+
// Collect the code sent to the stored email, keeping the same refresh-family session.
|
|
1590
|
+
const { withdrawnAt } = await client.customer.auth.withdraw({ emailCode })
|
|
1591
|
+
```
|
|
1592
|
+
|
|
1593
|
+
The six-digit code expires after 10 minutes, is single-use and cannot sign in.
|
|
1594
|
+
Ten invalid proofs block code verification for 15 minutes. Reissuing does not
|
|
1595
|
+
reset that budget. Refresh within the same family preserves the proof; a new
|
|
1596
|
+
login/family needs a new code. Issuance accepts JSON `{}` and is limited to
|
|
1597
|
+
5 requests per minute and 10 per hour per tenant/customer.
|
|
1598
|
+
`password_reauthentication_required` (409) means this account must use its local
|
|
1599
|
+
password. `withdrawal_session_refresh_required` (409) means its access token
|
|
1600
|
+
predates the stable session claim: refresh the existing direct session with
|
|
1601
|
+
`customer.auth.refreshToken()`, or the hosted session with `customer.oauth.refresh()`,
|
|
1602
|
+
store the returned pair, and retry code issuance. These code-specific 409 values
|
|
1603
|
+
are typed by `CustomerWithdrawalCodeReauthenticationReason`; common HTTP/auth
|
|
1604
|
+
reasons still apply. No code is issued before this refresh.
|
|
1605
|
+
No terms acknowledgement or new login session is required. `invalid_code` (401)
|
|
1606
|
+
requires a valid new proof; `service_unavailable` (503) keeps withdrawal denied.
|
|
1607
|
+
|
|
1576
1608
|
### Market discovery
|
|
1577
1609
|
|
|
1578
1610
|
Discover a tenant's active buyer markets and resolve the default market. These
|
|
@@ -1660,9 +1692,24 @@ customer already owns returns `resolution: 'unchanged'` and writes nothing, so
|
|
|
1660
1692
|
the revision you last observed stays valid for the next mutation. Because it
|
|
1661
1693
|
writes nothing, such a merge does not count as Cart activity for stale-Cart
|
|
1662
1694
|
cleanup.
|
|
1695
|
+
`carts.merge` rejects an unknown or wrong `guestCartToken`, or a Cart belonging to another
|
|
1696
|
+
customer or tenant, with the same `404/not_found` envelope without writes.
|
|
1697
|
+
The response does not reveal which case occurred. Branch on
|
|
1698
|
+
`reason`, and use `requestId` for support correlation rather than comparing error text.
|
|
1663
1699
|
Treat a replayed Cart result as an operation receipt: never replace a newer
|
|
1664
1700
|
cached Cart with a lower `revision`; retrieve when response ordering is unclear.
|
|
1665
1701
|
|
|
1702
|
+
A customer can have more than one active Cart, because `carts.create` always
|
|
1703
|
+
creates a new Cart. `carts.mine` returns the active Cart with the latest
|
|
1704
|
+
`createdAt`, and `carts.merge` merges a guest Cart into that same Cart. When
|
|
1705
|
+
`createdAt` is equal, the Cart with the higher `id` is chosen. Merging an active
|
|
1706
|
+
Cart the customer already owns returns that Cart `unchanged`, even when it is an
|
|
1707
|
+
older Cart.
|
|
1708
|
+
|
|
1709
|
+
If the guest Cart's market differs from that chosen Cart, `carts.merge` returns
|
|
1710
|
+
`409 cart_market_mismatch`. It does not merge into an older Cart in the guest
|
|
1711
|
+
Cart's market instead.
|
|
1712
|
+
|
|
1666
1713
|
Shipping Checkout creation requires a request `shippingAddress` or a valid
|
|
1667
1714
|
stored Cart address whenever any line has `requiresShipping !== false`.
|
|
1668
1715
|
`recipientName`, `phone`, `postalCode`, `address`, and `detailAddress` must be nonblank after trimming. Otherwise,
|
|
@@ -1957,9 +2004,12 @@ Customer order reads remain available through
|
|
|
1957
2004
|
The SDK root no longer exports raw generated `Order`, `Transaction`, `Cart`, or
|
|
1958
2005
|
`CartItem` Payload documents. Use the canonical `PublicOrder` / `PublicCart`
|
|
1959
2006
|
DTOs for storefront code and explicit server collection types only inside
|
|
1960
|
-
trusted operational code.
|
|
1961
|
-
|
|
1962
|
-
|
|
2007
|
+
trusted operational code. SDK types no longer include the retired inline
|
|
2008
|
+
provider-refund flow. An order whose cancellation started through that flow can
|
|
2009
|
+
still return `providerRefunded: true` with `refundSeq`, or an uncommitted body
|
|
2010
|
+
with `reconciliationRequired: true`. These bounded legacy bodies remain outside
|
|
2011
|
+
`CancelOrderResponse`. `refundPending` is a local financial marker, not authority
|
|
2012
|
+
for caller provider I/O:
|
|
1963
2013
|
|
|
1964
2014
|
| Captured payment lane | Provider refund owner | `resolveCancelRefund` |
|
|
1965
2015
|
| ------------------------------------------------------- | ---------------------------- | ----------------------------------------------------------------------------------- |
|
|
@@ -1982,6 +2032,13 @@ as a committed cancellation and never start a provider refund from your
|
|
|
1982
2032
|
storefront or BFF. A retry reads or resumes the same Console refund. Registered
|
|
1983
2033
|
PortOne and credit-funded managed orders still return the pending marker.
|
|
1984
2034
|
|
|
2035
|
+
For an order paid entirely with customer credit, `cancelOrder()` restores credit
|
|
2036
|
+
inside the cancel commit and returns `CancelOrderCreditOnlyCommittedResponse`:
|
|
2037
|
+
`cancelCommitted: true`, the positive restored purchase total as
|
|
2038
|
+
`refundedAmount`, and `providerRefunded: false`, with neither `transactionId`
|
|
2039
|
+
nor `refundPending`. There is no PG refund to run. A later domain retry uses the
|
|
2040
|
+
ordinary `alreadyCanceled` arm with the same `refundedAmount`.
|
|
2041
|
+
|
|
1985
2042
|
Managed ownership follows the captured Transaction's exact tenant-bound
|
|
1986
2043
|
PaymentSession and historical registered account. Order/provider/environment
|
|
1987
2044
|
drift remains Console-owned corruption. Unresolved or cross-tenant identity
|
|
@@ -2022,6 +2079,7 @@ await server.commerce.orders.createReturn({
|
|
|
2022
2079
|
await server.commerce.orders.updateReturn({ returnId, status })
|
|
2023
2080
|
await server.commerce.orders.returnWithRefund({
|
|
2024
2081
|
orderNumber,
|
|
2082
|
+
existingReturnId?,
|
|
2025
2083
|
returnItems: [{ orderItem, quantity, restockingFee? }],
|
|
2026
2084
|
refundAmount,
|
|
2027
2085
|
returnShippingFee?,
|
|
@@ -2031,6 +2089,26 @@ await server.commerce.orders.returnWithRefund({
|
|
|
2031
2089
|
})
|
|
2032
2090
|
```
|
|
2033
2091
|
|
|
2092
|
+
**BREAKING (0.x minor):** `createFulfillment` and `updateFulfillment` return `FulfillmentMutationResponse` instead of a raw `Fulfillment` document. Shipment state, tracking and timestamps remain in the receipt.
|
|
2093
|
+
|
|
2094
|
+
- `tenant`, `order` and `fulfillmentOrder` contain IDs instead of populated documents. Legacy unlinked shipments return `fulfillmentOrder: null`; check for null before reading the related work order.
|
|
2095
|
+
- `items`, `adminNotes`, `metadata`, `method` and `deletedAt` are absent from the receipt. Replace `shipment.items?.docs` and other document-only reads with `server.collections.from('fulfillments').findById(receipt.id, { joins: { items: { limit: 100 } } })` under authorized server credentials. Read related details from their owning collection using the returned ID. Remove dependencies on internal `method` values and populated tenant internals; collection reads retain their normal field access rules.
|
|
2096
|
+
|
|
2097
|
+
`returnWithRefund` can complete an existing approved Return by passing
|
|
2098
|
+
`existingReturnId` with its `orderNumber`. The server uses the persisted approval's
|
|
2099
|
+
items, amounts, fees and reason; caller values cannot widen it. Keep the required
|
|
2100
|
+
`returnItems` and positive `refundAmount` in the request. The line refund is after
|
|
2101
|
+
return shipping/restocking fees; the initial shipping refund is added separately.
|
|
2102
|
+
Repeat the same request and `idempotencyKey` after response loss.
|
|
2103
|
+
|
|
2104
|
+
The result is a bounded completion receipt: `return` includes only `id`,
|
|
2105
|
+
`status`, `refundAmount`, `returnShippingFee`, `initialShippingRefundAmount` and
|
|
2106
|
+
`completedAt`. A provider refund includes `transaction` (`id`, `type`, `kind`,
|
|
2107
|
+
`status`, `amount`, `providerEventId`) and numeric `refundSeq`; a completion
|
|
2108
|
+
without a provider transaction has `transaction: null` and `refundSeq: null`.
|
|
2109
|
+
`notificationWarning` may report a post-commit display/notification problem;
|
|
2110
|
+
the refund has completed. Read full documents separately if needed.
|
|
2111
|
+
|
|
2034
2112
|
### Commerce Discounts / Shipping
|
|
2035
2113
|
|
|
2036
2114
|
Available on both Client (customer JWT) and ServerClient (secretKey).
|
|
@@ -2354,6 +2432,12 @@ replacement API. Pass an empty list to clear codes. Singular `admission`,
|
|
|
2354
2432
|
Browser `mine()`/`merge({ guestCartToken })` derive customer identity from the
|
|
2355
2433
|
JWT; server calls require an explicit `customerToken`.
|
|
2356
2434
|
|
|
2435
|
+
### Event discovery and unlisted links
|
|
2436
|
+
|
|
2437
|
+
`client.events.getRange()` lists published events with `visibility=public`. Its pages and totals exclude `unlisted` events, as do Publishable Key raw event and occurrence lists and counts. For an unlisted link, retain the event and occurrence IDs and read each with `client.collections.from('events').findById(eventId)` and `client.collections.from('event-occurrences').findById(occurrenceId)`. Registration remains available when the event and occurrence meet the registration rules.
|
|
2438
|
+
|
|
2439
|
+
An id or slug filter on a raw list still follows listing visibility. To make an event discoverable, select `visibility=public`. Refresh cached lists and totals when the server's listing behavior changes.
|
|
2440
|
+
|
|
2357
2441
|
### Event admission availability
|
|
2358
2442
|
|
|
2359
2443
|
For paid admission choices, call
|
|
@@ -2962,3 +3046,24 @@ zero provider amount and restores credit only. A full-credit Order rejects any
|
|
|
2962
3046
|
`pgPaymentId` or `paymentKey`; never invent an identifier. Explicit blank values
|
|
2963
3047
|
remain invalid. Orders without credit funding retain `400/validation_failed`
|
|
2964
3048
|
when `pgPaymentId` is omitted. Refund amount, credential, tenant and ecommerce authority remain unchanged.
|
|
3049
|
+
|
|
3050
|
+
### Event registration email verification
|
|
3051
|
+
|
|
3052
|
+
For an event with **Verify registration email** enabled, call
|
|
3053
|
+
`client.events.requestRegistrationEmailVerification(input)` before registering.
|
|
3054
|
+
When `verificationRequired` is true, collect the emailed eight-digit code, then
|
|
3055
|
+
pass the same input plus `emailVerification: { requestId, code }` to
|
|
3056
|
+
`client.events.register`. The code expires after 15 minutes and five attempts.
|
|
3057
|
+
No registration or seats exist until successful verification and a fresh capacity
|
|
3058
|
+
check. Opt-out events retain the existing register result and immediate behavior.
|
|
3059
|
+
Confirmation mail has a ten-per-hour tenant/recipient cap; suppression does not
|
|
3060
|
+
cancel registration. Event-cancellation notices are exempt. Verification mail has
|
|
3061
|
+
its own three-per-hour cap and a 60-second resend interval, plus ordinary email quota.
|
|
3062
|
+
|
|
3063
|
+
The request returns a processing receipt before delivery in Live and Sandbox.
|
|
3064
|
+
Recipient limits suppress background delivery behind that same receipt; the
|
|
3065
|
+
recipient-independent tenant admission limit still returns synchronous 429.
|
|
3066
|
+
Only an active member of the exact Sandbox with a verified current email receives
|
|
3067
|
+
the code, using platform From, a `[Sandbox]` subject and no Reply-To. Other
|
|
3068
|
+
recipients and ordinary event mail are captured. Sandbox keeps its shared
|
|
3069
|
+
100/month non-billable email ceiling. A receipt confirms neither delivery nor seats.
|
package/dist/client.cjs
CHANGED
|
@@ -1379,16 +1379,28 @@ var CUSTOMER_AUTH_ENDPOINT_OPERATIONS = {
|
|
|
1379
1379
|
resetPassword: operation("customers", "post", "/reset-password"),
|
|
1380
1380
|
changePassword: operation("customers", "post", "/change-password"),
|
|
1381
1381
|
revokeRefresh: operation("customers", "post", "/revoke-refresh"),
|
|
1382
|
-
withdraw: operation("customers", "post", "/withdraw")
|
|
1382
|
+
withdraw: operation("customers", "post", "/withdraw"),
|
|
1383
|
+
requestWithdrawalCode: operation("customers", "post", "/withdraw/email-code")
|
|
1383
1384
|
};
|
|
1384
1385
|
var EMBEDDED_ADMIN_ENDPOINT_OPERATIONS = {
|
|
1385
1386
|
show: operation("tenants", "get", "/embedded-admin-app"),
|
|
1386
1387
|
configure: operation("tenants", "patch", "/embedded-admin-app"),
|
|
1387
1388
|
disable: operation("tenants", "delete", "/embedded-admin-app")
|
|
1388
1389
|
};
|
|
1390
|
+
var FIELD_CONFIG_ENDPOINT_OPERATIONS = {
|
|
1391
|
+
list: operation("field-configs", "get", "/list"),
|
|
1392
|
+
save: operation("field-configs", "post", "/save")
|
|
1393
|
+
};
|
|
1389
1394
|
var EVENTS_ENDPOINT_OPERATIONS = {
|
|
1390
1395
|
registrations: {
|
|
1391
1396
|
register: operation("event-registrations", "post", "/register"),
|
|
1397
|
+
requestEmailVerification: operation(
|
|
1398
|
+
"event-registrations",
|
|
1399
|
+
"post",
|
|
1400
|
+
"/request-email-verification"
|
|
1401
|
+
),
|
|
1402
|
+
emailCancelPage: operation("event-registrations", "get", "/email-cancel"),
|
|
1403
|
+
emailCancel: operation("event-registrations", "post", "/email-cancel"),
|
|
1392
1404
|
guestLookup: operation("event-registrations", "post", "/guest/lookup"),
|
|
1393
1405
|
guestLookupByUrl: operation("event-registrations", "get", "/guest/:token"),
|
|
1394
1406
|
guestCancel: operation("event-registrations", "post", "/guest/cancel"),
|
|
@@ -1427,6 +1439,9 @@ var VIDEO_ENDPOINT_OPERATIONS = {
|
|
|
1427
1439
|
function resolveOperationTemplate(descriptor) {
|
|
1428
1440
|
return descriptor.collection ? `/api/${descriptor.collection}${descriptor.path}` : `/api${descriptor.path}`;
|
|
1429
1441
|
}
|
|
1442
|
+
var PAYMENT_DIAGNOSTIC_ENDPOINT_OPERATIONS = {
|
|
1443
|
+
diagnose: operation("tenants", "get", "/payment-diagnostics")
|
|
1444
|
+
};
|
|
1430
1445
|
function resolveOperationPath(descriptor, options) {
|
|
1431
1446
|
const path = resolveOperationTemplate(descriptor).replace(
|
|
1432
1447
|
/:([A-Za-z][A-Za-z0-9_]*)/g,
|
|
@@ -4801,8 +4816,25 @@ var CustomerAuth = class {
|
|
|
4801
4816
|
body: JSON.stringify({ refreshToken })
|
|
4802
4817
|
});
|
|
4803
4818
|
}
|
|
4804
|
-
/**
|
|
4805
|
-
async
|
|
4819
|
+
/** Send a withdrawal-only code to the current passwordless customer's stored email. */
|
|
4820
|
+
async requestWithdrawalCode() {
|
|
4821
|
+
const token = this.getToken();
|
|
4822
|
+
if (!token) throw new ApiError("Not authenticated", 401);
|
|
4823
|
+
const operation2 = CUSTOMER_AUTH_ENDPOINT_OPERATIONS.requestWithdrawalCode;
|
|
4824
|
+
const result = await this.requestJson(
|
|
4825
|
+
resolveOperationPath(operation2),
|
|
4826
|
+
{
|
|
4827
|
+
method: resolveOperationMethod(operation2),
|
|
4828
|
+
headers: { Authorization: `Bearer ${token}` },
|
|
4829
|
+
body: JSON.stringify({})
|
|
4830
|
+
}
|
|
4831
|
+
);
|
|
4832
|
+
if (!result || typeof result.message !== "string")
|
|
4833
|
+
throw new ApiError("Invalid withdrawal code response", 502);
|
|
4834
|
+
return result;
|
|
4835
|
+
}
|
|
4836
|
+
/** Archive the current account and clear this client's credentials on success. */
|
|
4837
|
+
async withdraw(proof) {
|
|
4806
4838
|
const token = this.getToken();
|
|
4807
4839
|
if (!token) throw new ApiError("Not authenticated", 401);
|
|
4808
4840
|
const operation2 = CUSTOMER_AUTH_ENDPOINT_OPERATIONS.withdraw;
|
|
@@ -4811,7 +4843,9 @@ var CustomerAuth = class {
|
|
|
4811
4843
|
{
|
|
4812
4844
|
method: resolveOperationMethod(operation2),
|
|
4813
4845
|
headers: { Authorization: `Bearer ${token}` },
|
|
4814
|
-
body: JSON.stringify(
|
|
4846
|
+
body: JSON.stringify(
|
|
4847
|
+
typeof proof === "string" ? { currentPassword: proof } : proof
|
|
4848
|
+
)
|
|
4815
4849
|
}
|
|
4816
4850
|
);
|
|
4817
4851
|
if (!result || typeof result.withdrawnAt !== "string" || !Number.isFinite(Date.parse(result.withdrawnAt)))
|
|
@@ -6223,10 +6257,13 @@ function buildProductHref(product, group, options = {}) {
|
|
|
6223
6257
|
return params.size > 0 ? `${path}?${params.toString()}` : path;
|
|
6224
6258
|
}
|
|
6225
6259
|
function compareVariantOrder(a, b) {
|
|
6226
|
-
const aOrder =
|
|
6227
|
-
const bOrder =
|
|
6228
|
-
if (
|
|
6229
|
-
|
|
6260
|
+
const aOrder = a._order || null;
|
|
6261
|
+
const bOrder = b._order || null;
|
|
6262
|
+
if (aOrder !== bOrder) {
|
|
6263
|
+
if (aOrder === null) return 1;
|
|
6264
|
+
if (bOrder === null) return -1;
|
|
6265
|
+
const byOrder = compareOrdinal(aOrder, bOrder);
|
|
6266
|
+
if (byOrder !== 0) return byOrder;
|
|
6230
6267
|
}
|
|
6231
6268
|
const aId = String(getRelationID(a.id) ?? "");
|
|
6232
6269
|
const bId = String(getRelationID(b.id) ?? "");
|
|
@@ -6477,11 +6514,7 @@ function buildProductListingPageWhere(params) {
|
|
|
6477
6514
|
const search = params.search?.trim();
|
|
6478
6515
|
if (search) {
|
|
6479
6516
|
clauses.push({
|
|
6480
|
-
or: [
|
|
6481
|
-
{ title: { like: search } },
|
|
6482
|
-
{ slug: { like: search } },
|
|
6483
|
-
{ handle: { like: search } }
|
|
6484
|
-
]
|
|
6517
|
+
or: [{ title: { like: search } }, { slug: { like: search } }]
|
|
6485
6518
|
});
|
|
6486
6519
|
}
|
|
6487
6520
|
const filters = params.filters;
|
|
@@ -6751,6 +6784,15 @@ var EventsClient = class {
|
|
|
6751
6784
|
{ useCustomerAuth: true }
|
|
6752
6785
|
);
|
|
6753
6786
|
}
|
|
6787
|
+
requestRegistrationEmailVerification(params) {
|
|
6788
|
+
const operation2 = EVENTS_ENDPOINT_OPERATIONS.registrations.requestEmailVerification;
|
|
6789
|
+
return this.execute(
|
|
6790
|
+
resolveOperationPath(operation2),
|
|
6791
|
+
resolveOperationMethod(operation2),
|
|
6792
|
+
buildRegistrationRequestBody(params),
|
|
6793
|
+
{ useCustomerAuth: true, noStore: true }
|
|
6794
|
+
);
|
|
6795
|
+
}
|
|
6754
6796
|
getGuestRegistration(token) {
|
|
6755
6797
|
return this.execute(
|
|
6756
6798
|
resolveOperationPath(
|
|
@@ -6803,7 +6845,10 @@ function buildRegistrationRequestBody(params) {
|
|
|
6803
6845
|
occurrence: params.occurrence,
|
|
6804
6846
|
...params.quantity !== void 0 && { quantity: params.quantity },
|
|
6805
6847
|
...params.attendee !== void 0 && { attendee: params.attendee },
|
|
6806
|
-
...params.answers !== void 0 && { answers: params.answers }
|
|
6848
|
+
...params.answers !== void 0 && { answers: params.answers },
|
|
6849
|
+
...params.emailVerification !== void 0 && {
|
|
6850
|
+
emailVerification: params.emailVerification
|
|
6851
|
+
}
|
|
6807
6852
|
};
|
|
6808
6853
|
}
|
|
6809
6854
|
function buildGuestCancelRequestBody(token, params) {
|