@theokit/gateway 0.14.0 → 0.15.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 CHANGED
@@ -1,5 +1,56 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.15.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 00af16f: `BasePlatformAdapter` gains `react(channelId, messageId, emoji)`, which adds an emoji reaction to an inbound message. The default resolves `react_unsupported`; the Discord, Slack, Telegram and Matrix adapters implement it.
8
+ - db894a4: Make `raft` a first-party platform.
9
+
10
+ `@theokit/gateway` gains the `raft` key in `PlatformEventRegistry`, the `RaftMessageEvent` type
11
+ and a `channelRendering` row (`plain`, markers removed). `PlatformName` grows by one member. Code
12
+ that lists every platform in a `Record<PlatformName, …>` or in a switch with a `never` default must
13
+ add it.
14
+
15
+ - 3efe7e7: Make `wechat` a first-party platform.
16
+
17
+ `@theokit/gateway` gains the `wechat` key in `PlatformEventRegistry`, the `WeChatMessageEvent` type
18
+ and a `channelRendering` row (`plain`, markers removed). `PlatformName` grows by one member. Code
19
+ that lists every platform in a `Record<PlatformName, …>` or in a switch with a `never` default must
20
+ add it.
21
+
22
+ - 5980e00: Make `wecom` a first-party platform.
23
+
24
+ `@theokit/gateway` gains the `wecom` key in `PlatformEventRegistry`, the `WeComMessageEvent` type
25
+ and a `channelRendering` row (`plain`, markers removed). `PlatformName` grows by one member. Code
26
+ that lists every platform in a `Record<PlatformName, …>` or in a switch with a `never` default must
27
+ add it.
28
+
29
+ - d7ed3ab: Make `yuanbao` a first-party platform.
30
+
31
+ `@theokit/gateway` gains the `yuanbao` key in `PlatformEventRegistry`, the `YuanbaoMessageEvent`
32
+ type and a `channelRendering` row (`plain`, markers removed). `PlatformName` grows by one member.
33
+ Code that lists every platform in a `Record<PlatformName, …>` or in a switch with a `never`
34
+ default must add it.
35
+
36
+ - 6555723: Make `zalo` a first-party platform.
37
+
38
+ `@theokit/gateway` gains the `zalo` key in `PlatformEventRegistry`, the `ZaloMessageEvent` type and
39
+ a `channelRendering` row (`plain`, markers removed). `PlatformName` grows by one member. Code that
40
+ lists every platform in a `Record<PlatformName, …>` or in a switch with a `never` default must add
41
+ it.
42
+
43
+ - 00733b8: `@theokit/gateway` exports `WeixinAdapterBase` and `parseFlatXml`: the token, send and dispatch flow and the XML reader that the WeChat and WeCom adapters used to carry a copy each. The WeChat and WeCom adapters now extend the base.
44
+
45
+ ### Patch Changes
46
+
47
+ - bac158b: Keep the outbound checks and the inbound handler wiring in `BasePlatformAdapter`.
48
+
49
+ `BasePlatformAdapter` gains protected `refuseUnsendable`, `outboundText`, `subscribe`, `deliverInbound`
50
+ and `dispatchOnce`, so the `empty_text`, `not_connected` and `invalid_channel` checks, the
51
+ markdown translation, the handler slot and the dedup-then-dispatch step exist once instead of in
52
+ the adapters. Every adapter answers the same codes and messages as before.
53
+
3
54
  ## 0.14.0
4
55
 
5
56
  ### Minor Changes
package/README.md CHANGED
@@ -302,6 +302,12 @@ for (const { platform, reason } of failed) console.error(`${platform} did not co
302
302
  configuration error thrown by `create` the same way. Any other error propagates. It performs no
303
303
  network call.
304
304
  - `createChannels` also returns `channels`: each built adapter paired with the descriptor that built it, in the order of `adapters`.
305
+ - `reconnect: { initialDelayMs, maxDelayMs, factor, maxAttempts }` retries an adapter whose
306
+ `connect()` threw a transient error (refused connection, DNS, 5xx) with exponential backoff and a
307
+ stderr line per attempt. It is off unless set, and takes effect only with
308
+ `connectFailure: "isolate"` (under `"rollback"` the start still rejects). A `connect()` that
309
+ returns `false`, or throws a 401/403 credential error, is reported once and never retried.
310
+ `start()` called again afterwards returns the updated `connected` and `failed`.
305
311
  - `connectFailure` defaults to `"rollback"`: one failed connect disconnects the adapters that did
306
312
  connect and rejects `start()`, as before. Under `"isolate"`, `start()` resolves even when every
307
313
  adapter failed, so check `connected` before you rely on the runner.