diff --git a/ts/.changeset/commerce-exchangeable-items.md b/ts/.changeset/commerce-exchangeable-items.md deleted file mode 100644 index 7c10df3d..00000000 --- a/ts/.changeset/commerce-exchangeable-items.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -"@channel.io/app-sdk-core": minor ---- - -Replace the `getExchangeableItems` output with `exchangeableItems`, which carries the variants an -order item can be exchanged for. The previous `items` only listed which order items were -exchangeable, so there was no way to learn the `variantId` that `requestExchangeOrder`'s -`afterExchangeItems` requires — the exchange flow could not be implemented from the contract alone. -Each variant carries its `additionalAmount`, human-readable `options`, and stock: `stockQuantity` is -left unset when a variant does not track inventory, so `0` (sold out) stays distinguishable from -unlimited, with `useInventory` telling the two apart. - -`items` is removed rather than kept alongside: no app implements commerce `getExchangeableItems` in -either production or exp, and no task calls it, so nothing consumes the field today. - -`OrderClaimability` gains four reason fields — `nonCancelableReason`, `nonReturnableReason`, -`nonExchangeableReason`, `nonShippingAddressChangeableReason`. The booleans alone cannot explain -_why_ a claim is unavailable, which malls do report and tasks need in order to tell the customer. -Commerce and order extensions share the type, so both `getOrders` outputs carry them. diff --git a/ts/.changeset/commerce-order-fields.md b/ts/.changeset/commerce-order-fields.md deleted file mode 100644 index 2a292c1a..00000000 --- a/ts/.changeset/commerce-order-fields.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -"@channel.io/app-sdk-core": minor ---- - -Widen the commerce order contract with fields malls already return but the contract could not -carry — `payment.taxAmount`, item `sku`/`taxLines`/`unfulfilledQuantity`/`requiresShipping`/selling -plan, and order `adminUrl`/`note`/display statuses/`billingAddress`/`shippingLines`/`transactions`/ -`metafields`/`customAttributes`. `OrderTransaction` exists so cash-on-delivery and deferred payment -can be told apart, which `payment.methods` alone cannot express. - -`OrderClaimability`'s four booleans now carry explicit presence. A proto3 plain bool cannot tell -`false` from unset, so JSON serialization dropped every `false` and an item that allowed no claim -at all was emitted as `claimability: {}`, contradicting the schema that advertises those fields as -required. Generated field types change from `bool` to an optional boolean, so code that builds -`OrderClaimability` through struct literals needs updating; accessors are unchanged. diff --git a/ts/.changeset/commerce-required-presence.md b/ts/.changeset/commerce-required-presence.md deleted file mode 100644 index a37e0edd..00000000 --- a/ts/.changeset/commerce-required-presence.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -"@channel.io/app-sdk-core": minor ---- - -Stop dropping order-contract fields whose zero value is a real value. protojson omits a field -without presence when it holds the zero value, so fields the contract declares as required went -missing in common situations — `claims` on an order with no claims, `shippingAmount` on free -shipping, `success: false` on a failed action. The declaration and the wire format disagreed, and -consumers read `undefined` where the contract promised a value. - -**Given presence so the value is emitted** (still required) — zero and `false` are real values here: - -- `CommerceResultBody.success` -- `OrderPayment.totalAmount` / `itemsAmount` / `shippingAmount` / `discountAmount` / - `requireRefundBankAccount` -- `CommerceOrderItem.amount` -- `CommerceExchangeableVariant.additionalAmount` - -The Go types change from `float64`/`bool` to `*float64`/`*bool`, so an app that fills these must -set them through a pointer. Leaving one unset omits the key exactly as before. - -**Dropped from required** — these are repeated fields, and protobuf does not allow `optional` on -them, so an empty list is indistinguishable from an absent one: - -- `Order.claims` / `Order.fulfillments` -- `OrderPayment.methods` -- `OperationOptions.required` / `OperationOptions.optional` - -The last two are shared by the `order` and `commerce` extensions, so both contracts change. diff --git a/ts/.changeset/commerce-value-type-aliases.md b/ts/.changeset/commerce-value-type-aliases.md deleted file mode 100644 index 4319d412..00000000 --- a/ts/.changeset/commerce-value-type-aliases.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -"@channel.io/app-sdk-core": patch ---- - -Export Go aliases for the commerce order value types added alongside the widened order contract — -`TaxLine`, `Attribute`, `ShippingLine`, `Transaction`, and `Metafield`. Their generated code lives -under an internal package, so without an alias an app could see the fields in the schema but had no -way to construct the values. - -A test walks the proto descriptors reachable from the order contract and fails when one of those -messages has no alias in the commerce package, so adding a message without exporting it is caught -rather than discovered by the first app that needs the value. diff --git a/ts/.changeset/messaging-send-result-error-code.md b/ts/.changeset/messaging-send-result-error-code.md deleted file mode 100644 index 036eecd8..00000000 --- a/ts/.changeset/messaging-send-result-error-code.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"@channel.io/app-sdk-core": patch ---- - -Add the optional numeric `errorCode` field to `MessagingSendResult` so messaging apps can return a -stable failure reason from `onMediumMessageCreated`. The runtime can persist the code on the failed -Channel message and pass it to `getMediumMessageErrorReason` for a safe user-facing explanation. diff --git a/ts/examples/basic/apps/server/CHANGELOG.md b/ts/examples/basic/apps/server/CHANGELOG.md index c8e8b9fc..153a4f3b 100644 --- a/ts/examples/basic/apps/server/CHANGELOG.md +++ b/ts/examples/basic/apps/server/CHANGELOG.md @@ -1,5 +1,17 @@ # @basic-example/server +## 0.0.16 + +### Patch Changes + +- Updated dependencies [494c902] +- Updated dependencies [3e4e4b1] +- Updated dependencies [65d4196] +- Updated dependencies [0ff5a85] +- Updated dependencies [2862b3d] + - @channel.io/app-sdk-core@0.24.0 + - @channel.io/app-sdk-server@0.24.0 + ## 0.0.15 ### Patch Changes diff --git a/ts/examples/basic/apps/server/package.json b/ts/examples/basic/apps/server/package.json index 76426dc1..6242e7bf 100644 --- a/ts/examples/basic/apps/server/package.json +++ b/ts/examples/basic/apps/server/package.json @@ -1,6 +1,6 @@ { "name": "@basic-example/server", - "version": "0.0.15", + "version": "0.0.16", "private": true, "type": "module", "scripts": { diff --git a/ts/examples/basic/apps/wam/CHANGELOG.md b/ts/examples/basic/apps/wam/CHANGELOG.md index a8e645f2..ac87705e 100644 --- a/ts/examples/basic/apps/wam/CHANGELOG.md +++ b/ts/examples/basic/apps/wam/CHANGELOG.md @@ -1,5 +1,11 @@ # @basic-example/wam +## 0.0.16 + +### Patch Changes + +- @channel.io/app-sdk-wam@0.24.0 + ## 0.0.15 ### Patch Changes diff --git a/ts/examples/basic/apps/wam/package.json b/ts/examples/basic/apps/wam/package.json index 19ee712a..98896a45 100644 --- a/ts/examples/basic/apps/wam/package.json +++ b/ts/examples/basic/apps/wam/package.json @@ -1,6 +1,6 @@ { "name": "@basic-example/wam", - "version": "0.0.15", + "version": "0.0.16", "private": true, "type": "module", "scripts": { diff --git a/ts/examples/calendar/apps/server/CHANGELOG.md b/ts/examples/calendar/apps/server/CHANGELOG.md index 0150b78d..a363736c 100644 --- a/ts/examples/calendar/apps/server/CHANGELOG.md +++ b/ts/examples/calendar/apps/server/CHANGELOG.md @@ -1,5 +1,17 @@ # @calendar-example/server +## 0.0.16 + +### Patch Changes + +- Updated dependencies [494c902] +- Updated dependencies [3e4e4b1] +- Updated dependencies [65d4196] +- Updated dependencies [0ff5a85] +- Updated dependencies [2862b3d] + - @channel.io/app-sdk-core@0.24.0 + - @channel.io/app-sdk-server@0.24.0 + ## 0.0.15 ### Patch Changes diff --git a/ts/examples/calendar/apps/server/package.json b/ts/examples/calendar/apps/server/package.json index c404b3b2..c379bb46 100644 --- a/ts/examples/calendar/apps/server/package.json +++ b/ts/examples/calendar/apps/server/package.json @@ -1,6 +1,6 @@ { "name": "@calendar-example/server", - "version": "0.0.15", + "version": "0.0.16", "private": true, "type": "module", "scripts": { diff --git a/ts/examples/calendar/apps/wam/CHANGELOG.md b/ts/examples/calendar/apps/wam/CHANGELOG.md index 6e51856a..4e1a6cc2 100644 --- a/ts/examples/calendar/apps/wam/CHANGELOG.md +++ b/ts/examples/calendar/apps/wam/CHANGELOG.md @@ -1,5 +1,11 @@ # @calendar-example/wam +## 0.0.16 + +### Patch Changes + +- @channel.io/app-sdk-wam@0.24.0 + ## 0.0.15 ### Patch Changes diff --git a/ts/examples/calendar/apps/wam/package.json b/ts/examples/calendar/apps/wam/package.json index 7fa19308..c986a99b 100644 --- a/ts/examples/calendar/apps/wam/package.json +++ b/ts/examples/calendar/apps/wam/package.json @@ -1,6 +1,6 @@ { "name": "@calendar-example/wam", - "version": "0.0.15", + "version": "0.0.16", "private": true, "type": "module", "scripts": { diff --git a/ts/examples/tutorial/apps/server/CHANGELOG.md b/ts/examples/tutorial/apps/server/CHANGELOG.md index af663b0c..f7a42d34 100644 --- a/ts/examples/tutorial/apps/server/CHANGELOG.md +++ b/ts/examples/tutorial/apps/server/CHANGELOG.md @@ -1,5 +1,17 @@ # @tutorial-example/server +## 0.0.14 + +### Patch Changes + +- Updated dependencies [494c902] +- Updated dependencies [3e4e4b1] +- Updated dependencies [65d4196] +- Updated dependencies [0ff5a85] +- Updated dependencies [2862b3d] + - @channel.io/app-sdk-core@0.24.0 + - @channel.io/app-sdk-server@0.24.0 + ## 0.0.13 ### Patch Changes diff --git a/ts/examples/tutorial/apps/server/package.json b/ts/examples/tutorial/apps/server/package.json index d7e2bfec..2a09deec 100644 --- a/ts/examples/tutorial/apps/server/package.json +++ b/ts/examples/tutorial/apps/server/package.json @@ -1,6 +1,6 @@ { "name": "@tutorial-example/server", - "version": "0.0.13", + "version": "0.0.14", "private": true, "type": "module", "scripts": { diff --git a/ts/examples/tutorial/apps/wam/CHANGELOG.md b/ts/examples/tutorial/apps/wam/CHANGELOG.md index bb5c0d24..64abe216 100644 --- a/ts/examples/tutorial/apps/wam/CHANGELOG.md +++ b/ts/examples/tutorial/apps/wam/CHANGELOG.md @@ -1,5 +1,11 @@ # @tutorial-example/wam +## 0.0.14 + +### Patch Changes + +- @channel.io/app-sdk-wam@0.24.0 + ## 0.0.13 ### Patch Changes diff --git a/ts/examples/tutorial/apps/wam/package.json b/ts/examples/tutorial/apps/wam/package.json index 8069418a..9d6f484b 100644 --- a/ts/examples/tutorial/apps/wam/package.json +++ b/ts/examples/tutorial/apps/wam/package.json @@ -1,6 +1,6 @@ { "name": "@tutorial-example/wam", - "version": "0.0.13", + "version": "0.0.14", "private": true, "type": "module", "scripts": { diff --git a/ts/packages/cli/CHANGELOG.md b/ts/packages/cli/CHANGELOG.md index e57dfeb8..5beb800d 100644 --- a/ts/packages/cli/CHANGELOG.md +++ b/ts/packages/cli/CHANGELOG.md @@ -1,5 +1,18 @@ # @channel.io/app-sdk +## 0.24.0 + +### Patch Changes + +- Updated dependencies [494c902] +- Updated dependencies [3e4e4b1] +- Updated dependencies [65d4196] +- Updated dependencies [0ff5a85] +- Updated dependencies [2862b3d] + - @channel.io/app-sdk-core@0.24.0 + - @channel.io/app-sdk-server@0.24.0 + - @channel.io/app-sdk-wam@0.24.0 + ## 0.23.1 ### Patch Changes diff --git a/ts/packages/cli/package.json b/ts/packages/cli/package.json index aaef94ca..25e89fb8 100644 --- a/ts/packages/cli/package.json +++ b/ts/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@channel.io/app-sdk", - "version": "0.23.1", + "version": "0.24.0", "description": "CLI and main entry for Channel.io App SDK", "type": "module", "main": "./dist/index.js", diff --git a/ts/packages/core/CHANGELOG.md b/ts/packages/core/CHANGELOG.md index 09e29146..ef4cb482 100644 --- a/ts/packages/core/CHANGELOG.md +++ b/ts/packages/core/CHANGELOG.md @@ -1,5 +1,78 @@ # @channel.io/app-sdk-core +## 0.24.0 + +### Minor Changes + +- 494c902: Replace the `getExchangeableItems` output with `exchangeableItems`, which carries the variants an + order item can be exchanged for. The previous `items` only listed which order items were + exchangeable, so there was no way to learn the `variantId` that `requestExchangeOrder`'s + `afterExchangeItems` requires — the exchange flow could not be implemented from the contract alone. + Each variant carries its `additionalAmount`, human-readable `options`, and stock: `stockQuantity` is + left unset when a variant does not track inventory, so `0` (sold out) stays distinguishable from + unlimited, with `useInventory` telling the two apart. + + `items` is removed rather than kept alongside: no app implements commerce `getExchangeableItems` in + either production or exp, and no task calls it, so nothing consumes the field today. + + `OrderClaimability` gains four reason fields — `nonCancelableReason`, `nonReturnableReason`, + `nonExchangeableReason`, `nonShippingAddressChangeableReason`. The booleans alone cannot explain + _why_ a claim is unavailable, which malls do report and tasks need in order to tell the customer. + Commerce and order extensions share the type, so both `getOrders` outputs carry them. + +- 3e4e4b1: Widen the commerce order contract with fields malls already return but the contract could not + carry — `payment.taxAmount`, item `sku`/`taxLines`/`unfulfilledQuantity`/`requiresShipping`/selling + plan, and order `adminUrl`/`note`/display statuses/`billingAddress`/`shippingLines`/`transactions`/ + `metafields`/`customAttributes`. `OrderTransaction` exists so cash-on-delivery and deferred payment + can be told apart, which `payment.methods` alone cannot express. + + `OrderClaimability`'s four booleans now carry explicit presence. A proto3 plain bool cannot tell + `false` from unset, so JSON serialization dropped every `false` and an item that allowed no claim + at all was emitted as `claimability: {}`, contradicting the schema that advertises those fields as + required. Generated field types change from `bool` to an optional boolean, so code that builds + `OrderClaimability` through struct literals needs updating; accessors are unchanged. + +- 65d4196: Stop dropping order-contract fields whose zero value is a real value. protojson omits a field + without presence when it holds the zero value, so fields the contract declares as required went + missing in common situations — `claims` on an order with no claims, `shippingAmount` on free + shipping, `success: false` on a failed action. The declaration and the wire format disagreed, and + consumers read `undefined` where the contract promised a value. + + **Given presence so the value is emitted** (still required) — zero and `false` are real values here: + + - `CommerceResultBody.success` + - `OrderPayment.totalAmount` / `itemsAmount` / `shippingAmount` / `discountAmount` / + `requireRefundBankAccount` + - `CommerceOrderItem.amount` + - `CommerceExchangeableVariant.additionalAmount` + + The Go types change from `float64`/`bool` to `*float64`/`*bool`, so an app that fills these must + set them through a pointer. Leaving one unset omits the key exactly as before. + + **Dropped from required** — these are repeated fields, and protobuf does not allow `optional` on + them, so an empty list is indistinguishable from an absent one: + + - `Order.claims` / `Order.fulfillments` + - `OrderPayment.methods` + - `OperationOptions.required` / `OperationOptions.optional` + + The last two are shared by the `order` and `commerce` extensions, so both contracts change. + +### Patch Changes + +- 0ff5a85: Export Go aliases for the commerce order value types added alongside the widened order contract — + `TaxLine`, `Attribute`, `ShippingLine`, `Transaction`, and `Metafield`. Their generated code lives + under an internal package, so without an alias an app could see the fields in the schema but had no + way to construct the values. + + A test walks the proto descriptors reachable from the order contract and fails when one of those + messages has no alias in the commerce package, so adding a message without exporting it is caught + rather than discovered by the first app that needs the value. + +- 2862b3d: Add the optional numeric `errorCode` field to `MessagingSendResult` so messaging apps can return a + stable failure reason from `onMediumMessageCreated`. The runtime can persist the code on the failed + Channel message and pass it to `getMediumMessageErrorReason` for a safe user-facing explanation. + ## 0.23.1 ### Patch Changes diff --git a/ts/packages/core/package.json b/ts/packages/core/package.json index 37c97d2b..a79ac252 100644 --- a/ts/packages/core/package.json +++ b/ts/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@channel.io/app-sdk-core", - "version": "0.23.1", + "version": "0.24.0", "description": "Core types and utilities for Channel.io App SDK", "type": "module", "main": "./dist/index.js", diff --git a/ts/packages/server/CHANGELOG.md b/ts/packages/server/CHANGELOG.md index 5cbd71a4..6e15ade5 100644 --- a/ts/packages/server/CHANGELOG.md +++ b/ts/packages/server/CHANGELOG.md @@ -1,5 +1,16 @@ # @channel.io/app-sdk-server +## 0.24.0 + +### Patch Changes + +- Updated dependencies [494c902] +- Updated dependencies [3e4e4b1] +- Updated dependencies [65d4196] +- Updated dependencies [0ff5a85] +- Updated dependencies [2862b3d] + - @channel.io/app-sdk-core@0.24.0 + ## 0.23.1 ### Patch Changes diff --git a/ts/packages/server/package.json b/ts/packages/server/package.json index b17359c1..e5404bd4 100644 --- a/ts/packages/server/package.json +++ b/ts/packages/server/package.json @@ -1,6 +1,6 @@ { "name": "@channel.io/app-sdk-server", - "version": "0.23.1", + "version": "0.24.0", "description": "NestJS server SDK for Channel.io apps", "type": "module", "main": "./dist/index.js", diff --git a/ts/packages/wam/CHANGELOG.md b/ts/packages/wam/CHANGELOG.md index 3fcc2aad..a557a03d 100644 --- a/ts/packages/wam/CHANGELOG.md +++ b/ts/packages/wam/CHANGELOG.md @@ -1,5 +1,16 @@ # @channel.io/app-sdk-wam +## 0.24.0 + +### Patch Changes + +- Updated dependencies [494c902] +- Updated dependencies [3e4e4b1] +- Updated dependencies [65d4196] +- Updated dependencies [0ff5a85] +- Updated dependencies [2862b3d] + - @channel.io/app-sdk-core@0.24.0 + ## 0.23.1 ### Patch Changes diff --git a/ts/packages/wam/package.json b/ts/packages/wam/package.json index 7b7229d2..8c18d91a 100644 --- a/ts/packages/wam/package.json +++ b/ts/packages/wam/package.json @@ -1,6 +1,6 @@ { "name": "@channel.io/app-sdk-wam", - "version": "0.23.1", + "version": "0.24.0", "description": "React SDK for Channel.io WAM (Web App Module)", "type": "module", "main": "./dist/index.js",