@torrow/sdk-client 0.9.0 → 0.10.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/README.md +26 -0
- package/dist/index.d.ts +551 -35
- package/dist/index.js +3475 -660
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -42,6 +42,12 @@ Show an access-denied screen for reads; preserve unsaved input for denied writes
|
|
|
42
42
|
|
|
43
43
|
See [the guide and runnable examples](https://github.com/torrowtechnologies/torrow-sdk-ts/blob/main/docs/item-access-errors.md).
|
|
44
44
|
|
|
45
|
+
## Service updates and personal metadata
|
|
46
|
+
|
|
47
|
+
Full `client.services.update` can change `personalInfo.meta` even when only the service name changes. The server updates participants' personal links after saving the service; `isNeedAnnouncement: false` only disables announcement creation. Service `meta` and personal-link `personalInfo.meta` have independent versions and modification times. Use the service version for its CAS contract; do not restore old personal-link metadata to remove the diff.
|
|
48
|
+
|
|
49
|
+
See [the service update explanation and illustrative diff](https://github.com/torrowtechnologies/torrow-sdk-ts/blob/main/src/resources/services/README.md#обновление-услуги-и-personalinfometa), including the current write-type limitation for `meta`. This observation covers full Service update; other types/endpoints and atomicity of the whole server chain are not confirmed.
|
|
50
|
+
|
|
45
51
|
## Field docs package
|
|
46
52
|
|
|
47
53
|
MCP and LLM field catalogs live in `@torrow/sdk-docs`.
|
|
@@ -53,3 +59,23 @@ Network failures use `TorrowSdkError`: `category` is independent of the outcome
|
|
|
53
59
|
`message`, `toJSON()`, spread and standard console output contain safe diagnostics. Original `cause`, response `body`, full `url` and optional OTP `cleanup` are available explicitly through `getSensitiveDetails()`; do not log that object. Known API names are allowlisted; arbitrary server messages stay private.
|
|
54
60
|
|
|
55
61
|
Selected composite methods provide optional `detail`, `operation`, `failureAt` and immutable `effects`. Missing `effects` means no description is supplied. Local builder/ID/constructor errors retain their existing exception types. Errors do not authorize automatic retry.
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
## Частичное обновление item
|
|
65
|
+
|
|
66
|
+
`client.contexts.patch`, `contacts.patch`, `notes.patch`, `calendars.patch`, `services.patch`, `resourceItems.patch`, `cases.patch` и `loyaltySystems.patch` принимают ID, собственный тип `*ItemPatch` и `{ versionToCheck?, signal? }`. SDK читает полный элемент, сохраняет пропущенные поля и отправляет максимум один полный PUT с обязательной проверкой версии. Объекты и массивы заменяются целиком; способы очистки зависят от поля. Unknown/system поля, пустой patch и explicit undefined запрещены до HTTP.
|
|
67
|
+
|
|
68
|
+
```ts
|
|
69
|
+
import type { ContextItemPatch } from "@torrow/sdk-client";
|
|
70
|
+
|
|
71
|
+
const fields: ContextItemPatch = { name: "Обновлённый контекст", description: null };
|
|
72
|
+
// itemId — ID редактируемого контекста; client получает auth от приложения.
|
|
73
|
+
const result = await client.contexts.patch(itemId, fields);
|
|
74
|
+
console.log(result.changed, result.item.meta?.version);
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
`versionToCheck` задаёт внешнюю ожидаемую версию; без него используется версия внутреннего GET. Результат `{itemId,item,changed}` содержит GET при no-op или фактический ответ сервера после PUT. Нет автоматических retry/readback/rollback. `TorrowSdkError` с `detail.domain=ItemPatch` отделяет причину от эффекта целевого Write: `NotApplied`, `Unknown`, `Applied`. После `Unknown` приложение отдельно читает состояние перед решением о новой записи.
|
|
78
|
+
|
|
79
|
+
Цена Service/Resource/Case: передавать только один из `priceInfo` (вся область) и `priceProperties` (первая цена с сохранением расписания и остальных настроек). `priceInfo:null` очищает всю область, `priceProperties:null` только первую цену. SDK ничего не рассчитывает.
|
|
80
|
+
|
|
81
|
+
Изменения контракта: `PackingStrategyProperties` исключено из SDK; `numeratorInfo` Service/LoyaltySystem доступно только create/read и исключается из update/patch. Ответы root PUT этих доменов преобразуют только объявленные OpenAPI даты; название в формате ISO остаётся строкой. `loyaltyCards.patch` отложен до исправления серверного удаления изображений подписок. Примеры и полевые карты находятся в репозитории в `examples/node/` и `docs/research/item-patches/`.
|