@callimacus/thamyr 4.3.4 → 4.3.5
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.core.md +7 -0
- package/CHANGELOG.md +14 -0
- package/MIGRATION.md +15 -15
- package/package.json +2 -2
package/CHANGELOG.core.md
CHANGED
|
@@ -3,6 +3,13 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [4.3.5](https://github.com/callimacus/thamyr-sdk/compare/thamyr-core-v4.3.4...thamyr-core-v4.3.5) (2026-09-29)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **npm:** publish the five packages as @callimacus/* ([#791](https://github.com/callimacus/thamyr-sdk/issues/791)) ([7beae9a](https://github.com/callimacus/thamyr-sdk/commit/7beae9a15f713602aa73d0ddb8ae82d045a725c0))
|
|
12
|
+
|
|
6
13
|
## [4.3.4](https://github.com/solomei-ai/thamyr-sdk/compare/thamyr-core-v4.3.3...thamyr-core-v4.3.4) (2026-09-27)
|
|
7
14
|
|
|
8
15
|
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,20 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [4.3.5](https://github.com/callimacus/thamyr-sdk/compare/thamyr-v4.3.4...thamyr-v4.3.5) (2026-09-29)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **npm:** publish the five packages as @callimacus/* ([#791](https://github.com/callimacus/thamyr-sdk/issues/791)) ([7beae9a](https://github.com/callimacus/thamyr-sdk/commit/7beae9a15f713602aa73d0ddb8ae82d045a725c0))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Dependencies
|
|
15
|
+
|
|
16
|
+
* The following workspace dependencies were updated
|
|
17
|
+
* dependencies
|
|
18
|
+
* @callimacus/thamyr-core bumped from ^4.3.4 to ^4.3.5
|
|
19
|
+
|
|
6
20
|
## [4.3.4](https://github.com/solomei-ai/thamyr-sdk/compare/thamyr-v4.3.3...thamyr-v4.3.4) (2026-09-27)
|
|
7
21
|
|
|
8
22
|
|
package/MIGRATION.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Thamyr SDK migration guide
|
|
2
2
|
|
|
3
|
-
This file ships inside every `@
|
|
3
|
+
This file ships inside every `@solomei-ai/thamyr*` package; the same guide is published at [docs.callimacus.ai/thamyr-sdk/8-migration](https://docs.callimacus.ai/thamyr-sdk/8-migration) (Callimacus account required). It covers every break since 1.x; release-by-release detail is in `CHANGELOG.md` (this package) and, in the framework packages, `CHANGELOG.core.md` (the contract and types — in `@solomei-ai/thamyr-core` that is `CHANGELOG.md` itself).
|
|
4
4
|
|
|
5
5
|
**The wire protocol has not changed since v1.** Any major talks to the same server, so upgrading is an exercise you can schedule: bump, run your type checker, work through the errors. Every signature change is compile-time; three things are not — error handling, retries, and since 4.0.2 the constructor rejecting an empty or relative `endpoint` — so read [Error handling](#error-handling) and [`endpoint` must be an absolute URL](#endpoint-must-be-an-absolute-url-402) before you start.
|
|
6
6
|
|
|
@@ -8,7 +8,7 @@ This file ships inside every `@callimacus/thamyr*` package; the same guide is pu
|
|
|
8
8
|
|
|
9
9
|
Sites still on 1.x (the last 1.x release is 1.8.2) cross three majors at once. Work through the errors in this order:
|
|
10
10
|
|
|
11
|
-
1. **`@
|
|
11
|
+
1. **`@solomei-ai/common` imports.** The package left the dependency tree in v2.0.0; every wire type and enum a client needs is exported by `@solomei-ai/thamyr`. One rewrite — see [`@solomei-ai/common` is no longer a dependency](#solomei-aicommon-is-no-longer-a-dependency). Imports from `@solomei-ai/thamyr-core` keep working (`@solomei-ai/thamyr` re-exports all of it), but declare the package or import from `@solomei-ai/thamyr` instead of relying on hoisting.
|
|
12
12
|
2. **`accessToken` → `clientId`** on the constructor / `useInitThamyr` — see [Initialization](#initialization-accesstoken--clientid).
|
|
13
13
|
3. **Contract methods take one parameters object and resolve `{data, error, response}`; none of them rejects on HTTP status** (only `sitemap.getSitemap()` still does). Read [Error handling](#error-handling) before touching code that caught or retried — a `catch` on `err.status` silently stops running, and a retry-on-500 handler can loop. Signature-by-signature mapping under [New method signatures](#new-method-signatures-on-the-api-namespaces).
|
|
14
14
|
4. **`language` is required** on `content.*` — v1 sent `'en'` when you omitted it. Pass `'en'` to keep behaviour identical, or your real locale to fix it.
|
|
@@ -16,10 +16,10 @@ Sites still on 1.x (the last 1.x release is 1.8.2) cross three majors at once. W
|
|
|
16
16
|
6. **Protocol enums are `as const` objects.** Runtime values are unchanged; `Enum.member` in a type position becomes `typeof Enum.member` — see [Protocol enums](#protocol-enums-are-as-const-objects).
|
|
17
17
|
7. **Salesforce `c_*` attributes and media extras are `unknown`** on `Basket`, on each `ProductItem` and on `Image.properties.cloudinary` — declare your shapes once, see [Custom attributes](#custom-attributes-are-unknown).
|
|
18
18
|
8. **v4:** `skesis.*` takes a parameters object and resolves the envelope; `products.*` is deprecated but stays; `endpoint` must be an absolute URL; `Basket.basketId` is required — see [Migrating to v4](#migrating-to-v4).
|
|
19
|
-
9. **Ride-along:** `@
|
|
19
|
+
9. **Ride-along:** `@solomei-ai/intent` moves to 2.1.2 or later — see [Intent SDK 2.1.2 rides along](#intent-sdk-212-rides-along).
|
|
20
20
|
10. **Deploy:** if your build copies `VITE_*` variables into `.env`, delete those lines — see [`endpoint` must be an absolute URL](#endpoint-must-be-an-absolute-url-402).
|
|
21
21
|
|
|
22
|
-
Dependencies your build scripts only had transitively through `@
|
|
22
|
+
Dependencies your build scripts only had transitively through `@solomei-ai/common` (a `zod` import in a script, for instance) disappear too — declare them yourself.
|
|
23
23
|
|
|
24
24
|
The call sites a storefront on 1.x most often has, v1 → v4 in one hop:
|
|
25
25
|
|
|
@@ -97,11 +97,11 @@ Reading code is unaffected by all of these; hand-written fixtures and mocks type
|
|
|
97
97
|
|
|
98
98
|
## Intent SDK 2.1.2 rides along
|
|
99
99
|
|
|
100
|
-
`@
|
|
100
|
+
`@solomei-ai/thamyr-core` 4 requires `@solomei-ai/intent` 2.1.2 or later, so npm upgrades a 2.0.x lock on the same install. If your site calls the Intent SDK directly, read its changelog entries for 2.1.0 (platform-free core, [#278](https://github.com/solomei-ai/intent-sdk/issues/278)) and 2.1.1 (hrefs that lead nowhere are dropped instead of forwarded, [#289](https://github.com/solomei-ai/intent-sdk/issues/289)), and verify the consent banner on staging: accepting sets the `intent_sid` cookie, revoking clears it. If your site declares its own `@solomei-ai/intent` dependency, bump its range to `^2.1.2` — or drop it and import `initIntent` / `setConsent` from `@solomei-ai/thamyr`, which re-exports the Intent SDK — and check that `npm ls @solomei-ai/intent` shows a single copy.
|
|
101
101
|
|
|
102
102
|
# Migrating to v3: cart becomes a contract namespace
|
|
103
103
|
|
|
104
|
-
v3.0.0 (2026-08-07, [#725](https://github.com/
|
|
104
|
+
v3.0.0 (2026-08-07, [#725](https://github.com/solomei-ai/thamyr-sdk/issues/725)). The `cart` namespace joined the generated contract surface: methods take a flat parameters object and resolve `{data, error, response}` like the other contract namespaces, and the `CartAPI` class export is gone (the `Basket`/`ProductItem` types remain, now generated from Salesforce's own published schema). `useCart()` keeps its method names and positional arguments, but resolves the envelope instead of the bare basket:
|
|
105
105
|
|
|
106
106
|
| v1 / v2 | v3+ |
|
|
107
107
|
| ---------------------------------------------- | ------------------------------------------------------------------ |
|
|
@@ -118,7 +118,7 @@ The `commerce-sdk-isomorphic` dependency left with `CartAPI`; non-SFCC consumers
|
|
|
118
118
|
Salesforce `c_*` attributes on `Basket` **and on each `ProductItem` in `Basket.productItems`**, and extra keys on `Image.properties.cloudinary` (beyond its typed `publicId`, `cloudName` and `secureDistribution`), are typed `[key: string]: unknown` (v1: `any`). Every former `any` access is now TS18046 `'basket.c_x' is of type 'unknown'` (or TS2322 where the value lands in a typed slot) — typically in templates and components far from the SDK call. Declare your project's shapes once and cast at the boundary:
|
|
119
119
|
|
|
120
120
|
```ts
|
|
121
|
-
import type {Basket, ProductItem} from '@
|
|
121
|
+
import type {Basket, ProductItem} from '@solomei-ai/thamyr';
|
|
122
122
|
|
|
123
123
|
type MyItem = ProductItem & {c_image?: string; c_analytics?: {color?: {code: string}}};
|
|
124
124
|
type MyBasket = Basket & {c_productsQuantity: number; productItems?: MyItem[]};
|
|
@@ -133,22 +133,22 @@ The product family is different: on `VariationGroup`, `MasterProduct`, `SetProdu
|
|
|
133
133
|
|
|
134
134
|
v2 aligns the SDK's types and methods exactly with what the platform serves, and every surface deprecated during v1 is gone. The wire protocol is unchanged — a v1 SDK and a v2 SDK speak to the same server identically; everything below is compile-time.
|
|
135
135
|
|
|
136
|
-
## `@
|
|
136
|
+
## `@solomei-ai/common` is no longer a dependency
|
|
137
137
|
|
|
138
|
-
v1 pulled `@
|
|
138
|
+
v1 pulled `@solomei-ai/common` — and its server-side dependency tree (langchain, openai, mysql2, zod, uuid, …) — into every browser bundle, and many sites imported wire types from it directly without declaring it. v2 drops it, so those imports fail with `Cannot find module '@solomei-ai/common'` after the bump. Every type and enum a site takes from it is exported by `@solomei-ai/thamyr` (through `@solomei-ai/thamyr-core`), so the migration is a rename:
|
|
139
139
|
|
|
140
140
|
```sh
|
|
141
141
|
# macOS
|
|
142
|
-
grep -rl '@
|
|
142
|
+
grep -rl '@solomei-ai/common' src | xargs sed -i '' 's#@solomei-ai/common#@solomei-ai/thamyr#g'
|
|
143
143
|
# GNU
|
|
144
|
-
grep -rl '@
|
|
144
|
+
grep -rl '@solomei-ai/common' src | xargs sed -i 's#@solomei-ai/common#@solomei-ai/thamyr#g'
|
|
145
145
|
```
|
|
146
146
|
|
|
147
147
|
Then merge any duplicated import statements and run your type checker: a name it still cannot find was a server-side helper with no client equivalent (`Chapter.fromSLChapter`, `Story.fromSLStory`, `story.getHistoryMessages()`).
|
|
148
148
|
|
|
149
|
-
Do **not** add `@
|
|
149
|
+
Do **not** add `@solomei-ai/common` back as a dependency: its current majors (12.x) are a server-side package (mysql2, winston, openai, langchain) that is not kept in step with the SDK's wire types.
|
|
150
150
|
|
|
151
|
-
The wire types and enums a v1 site imported from `@
|
|
151
|
+
The wire types and enums a v1 site imported from `@solomei-ai/common`, all exported by `@solomei-ai/thamyr` 4.x — types: `Basket`, `BCProduct`, `Block`, `Chapter`, `CustomBlock`, `ErrorMessage`, `Gallery`, `GenericProduct`, `HomePage`, `Image`, `LegacyBlock`, `LocalizedEPArtwork`, `LocalizedEPChapter`, `MasterProduct`, `MasterProductWithVariationGroup`, `OptionItem`, `ProductItem`, `ProductMatch`, `RecommendationsResponse`, `SetProduct`, `SkesisItem`, `SkesisRelatedResponse`, `SkesisSimilarResponse`, `SLDocument`, `SLDocumentSection`, `SLInputEvent`, `Story`, `ThamyrResponse`, `Topic`, `TopicContentsPage`, `TopicSummary`, `Variant`, `VariationAttribute`, `VariationGroup`, `Video`, `WhisperPayload`. Values: `ChapterStatus`, `ClientEvents`, `GalleryMode`, `isCustomBlock`, `isMasterProduct`, `isSetProduct`, `ServerEvents`, `SLInputEventType`, `ThamyrResponseType`.
|
|
152
152
|
|
|
153
153
|
## Initialization: `accessToken` → `clientId`
|
|
154
154
|
|
|
@@ -232,7 +232,7 @@ Two consequences for code written against v1:
|
|
|
232
232
|
- **Anything that keyed off `err.status` in a `catch` stops running** unless the call opts into throwing. Either read `error` and `response?.status` from the envelope, or keep the v1 contract with the option the generated client already has:
|
|
233
233
|
|
|
234
234
|
```ts
|
|
235
|
-
import {ThamyrHttpError} from '@
|
|
235
|
+
import {ThamyrHttpError} from '@solomei-ai/thamyr';
|
|
236
236
|
|
|
237
237
|
const {data: basket} = await thamyr.cart.getCart({throwOnError: true}); // Basket, or rejects
|
|
238
238
|
|
|
@@ -255,7 +255,7 @@ Two consequences for code written against v1:
|
|
|
255
255
|
- `ThamyrResponse` gains the `story-reset` variant, `chapter-deleted` carries the deprecated `roundId` alias, custom blocks carry `name` and `metaJson`, and `ErrorMessage` gains optional `reason`.
|
|
256
256
|
- Protocol enums (`SLInputEventType`, `ThamyrResponseType`, `ChapterStatus`, …) keep their members and values; comparisons and switches are unaffected — but they are `as const` objects now, not TypeScript `enum`s, which changes two idioms: see [below](#protocol-enums-are-as-const-objects).
|
|
257
257
|
- New exports: the `isCustomBlock` block guard, the `CallimacusApi` client class and `createContractClient` (thamyr-core), and the full product family (`BCProduct`, `SetProduct`, `VariationGroup`, …).
|
|
258
|
-
- `@
|
|
258
|
+
- `@solomei-ai/common` is no longer a dependency (nor `uuid`) — see [above](#solomei-aicommon-is-no-longer-a-dependency).
|
|
259
259
|
|
|
260
260
|
## Protocol enums are `as const` objects
|
|
261
261
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@callimacus/thamyr",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "JavaScript package for Thamyr",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"test": "vitest run"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@callimacus/thamyr-core": "^4.3.
|
|
38
|
+
"@callimacus/thamyr-core": "^4.3.5"
|
|
39
39
|
},
|
|
40
40
|
"gitHead": "fafba2c8ca0586f95b1d03c5eede356a53b00886",
|
|
41
41
|
"devDependencies": {
|