@warmhub/sdk-ts 0.159.0

Removed

The legacy-wrefs client flag

What it was. With clientFlags: ['legacy-wrefs'] the SDK refused every call with LEGACY_WREFS_REFUSAL (details.reason: 'legacy-wrefs-sdk'), and the server could refuse a write with details.reason: 'legacy-wrefs-window-ended'.

What it is now. The server no longer serves the old wire format, so the flag has no meaning. The SDK no longer exports LEGACY_WREFS_REFUSAL, OperationStreamClient no longer has a clientFlags field, and neither details.reason value is produced. A legacy-wrefs entry in clientFlags is sent like any other unknown flag and is not honored.

Migration. Remove 'legacy-wrefs' from clientFlags, and any code that compares against LEGACY_WREFS_REFUSAL or either reason value. Write operations use name and shapes, as they have since that form was introduced.

Old-format operations get the ordinary error

What it was. An operation in the old format (kind, about, collection type/members, no operation) was refused with a message naming the old format and showing a suggested new form. A revise carrying active was refused with a message suggesting a retract.

What it is now. No operation is recognized as the old format. Each one is checked like any other, and gets the ordinary error of the check it fails: an add with no shapes is refused because it states no Shapes, and one with no operation because operation must be one of the verbs. Any key an operation does not take (kind, shape, active, or any other) is refused locally with unknown key "<key>" on a <verb> operation, as the server's strict operation objects would refuse it, so a chunked submission never commits earlier chunks before that refusal.

Migration. Code that matched on "v1 write form" or "no longer supports 'active'" should match on the ordinary error, or check the operation before sending it.

token.create entry-level restrictions are typed never

What it was. TokenCreateInput scope entries typed allowedMatches and allowedShapes as unknown, and the server refused them with a message pointing to grants.

What it is now. Both are typed never, so passing either is a compile error. Sent anyway, the server refuses the entry as invalid input. Restrictions go in grants pairs, as before.

Migration. Move any entry-level allowedMatches or allowedShapes into grants: [{ allowedMatches, allowedShapes }].

Changed

Live helpers reconnect on their own, and stop when access is lost

What it was. live.subscribe, live.thingHead, live.thingHistory and live.subscriptionLog opened one stream. handle.closed resolved when that stream ended, and the caller had to reconnect.

What it is now. The server ends every stream when its ticket expires (5 minutes), so access is decided again on each reconnect. The helpers reconnect by themselves: they ask for a new ticket and reopen after 2 seconds, whether the stream ended or failed with a retryable error. The query helpers refresh once after each reconnect. handle.closed resolves when you call close() or abort the signal. It rejects when the loop stops on an error it does not retry: a refused ticket (NOT_FOUND, UNAUTHENTICATED, FORBIDDEN), or an error thrown by your callback.

Migration. Remove your own reconnect loop around these helpers and treat a rejected handle.closed as final. Older SDK versions keep working, but their streams now end every 5 minutes, so they must reconnect as before.