@practicalworks/rc-client 0.0.0-stage → 0.1.1
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/LICENSE +21 -0
- package/README.md +49 -2
- package/dist/client.d.ts +249 -0
- package/dist/client.js +487 -0
- package/dist/deadline.d.ts +12 -0
- package/dist/deadline.js +31 -0
- package/dist/errors.d.ts +50 -0
- package/dist/errors.js +66 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +7 -0
- package/dist/payload.d.ts +63 -0
- package/dist/payload.js +112 -0
- package/dist/rate.d.ts +13 -0
- package/dist/rate.js +29 -0
- package/dist/split.d.ts +25 -0
- package/dist/split.js +78 -0
- package/dist/targets.d.ts +22 -0
- package/dist/targets.js +31 -0
- package/package.json +44 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Practical Works
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,50 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @practicalworks/rc-client
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A typed client for [Rocket.Chat](https://www.rocket.chat)'s REST API, with no runtime dependencies. One `RocketChatClient` covers posting by name, by room and into a thread, replies that degrade instead of failing, reactions, room type, file uploads and an auth probe. Every post is split to fit Rocket.Chat's message size limit.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { RocketChatClient } from "@practicalworks/rc-client";
|
|
7
|
+
|
|
8
|
+
const rc = new RocketChatClient({
|
|
9
|
+
baseUrl: "https://chat.example.com",
|
|
10
|
+
userId: process.env.RC_USER_ID!,
|
|
11
|
+
authToken: process.env.RC_AUTH_TOKEN!,
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
await rc.postToChannel("#general", "Deploy finished.");
|
|
15
|
+
await rc.postToChannel("@sam", "Your report is ready.");
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
The base URL and the bot's credentials are injected by the caller, never stored or logged here. Node 20 or later (global `fetch`, `FormData`, `Blob`); pass your own `fetch` as the second constructor argument to test or proxy.
|
|
19
|
+
|
|
20
|
+
## Two registers
|
|
21
|
+
|
|
22
|
+
**Delivering**: as the bot, and **throws** on failure. For a scheduled job or a tool call, a message that silently vanished is worse than an error.
|
|
23
|
+
|
|
24
|
+
- `postToChannel(target, text, voice?)`: `#name` or a bare name is a channel, `@name` a DM (Rocket.Chat opens the DM room if needed). A discussion that does not answer to its generated name is found by its display name among the rooms the bot has joined; two rooms with the same display name refuse rather than guess. Only a failure Rocket.Chat itself classified as an unknown room triggers that lookup.
|
|
25
|
+
- `postToRoom(roomId, text, tmid?, voice?)`: into a room by id, optionally inside a thread.
|
|
26
|
+
- `postAsMember(roomId, text, { tmid?, voice? })`: `chat.sendMessage`; on `error-not-allowed` it joins the channel and retries, then falls back to `chat.postMessage`.
|
|
27
|
+
- `uploadToRoom(roomId, { name, bytes, contentType }, caption?)`: `rooms.media` then `rooms.mediaConfirm` (Rocket.Chat 7.0 removed `rooms.upload`).
|
|
28
|
+
- `getMessage(id)`: null when the message is missing or not visible to the bot.
|
|
29
|
+
|
|
30
|
+
Failures are typed: `RocketChatApiError` carries `status`, `endpoint` and Rocket.Chat's `rcError`; `RocketChatPostError` adds `unknownRoom`; a timeout is a `DeadlineError`.
|
|
31
|
+
|
|
32
|
+
**Replying**: as the room's identity, and **never throws**. For a live conversation, a failed post is logged and the conversation carries on.
|
|
33
|
+
|
|
34
|
+
- `postReply(roomId, text, tmid?, { uncapped? })`: returns the first part's id, or undefined. With `threadShow` it sends a threaded reply to the channel too (`chat.sendMessage` with `tshow`), and falls back to plain `chat.postMessage` if that is refused. `postCap` bounds posts per thread inside a window; `uncapped` exempts a control reply. `outbound` rewrites the text and picks a voice before the split.
|
|
35
|
+
- `applyReactions(roomId, messageId, [{ emoji, shouldReact }])`: sets or clears each reaction, always stating `shouldReact`.
|
|
36
|
+
- `post(endpoint, body, roomId?)`: a raw JSON POST as the room's identity, resolving `{ ok, id?, detail? }`.
|
|
37
|
+
|
|
38
|
+
`identityForRoom(roomId)` returns the headers to speak as in a room (another user's token, say), or undefined for the bot's own; `headersForRoom` exposes the result, and `get(url, headers, label)` makes a GET with the client's deadline.
|
|
39
|
+
|
|
40
|
+
**Both**: `authStatus()` probes `/api/v1/me` and reports `{ ok, status, error? }` without throwing. `isDirectMessage(roomId)` reads the room type from `rooms.info` and caches it (`cachedRoomType`); when `rooms.info` refuses, `isDirectMessageFallback` is asked. `react(messageId, emoji, shouldReact?)` reacts as the bot and toggles when `shouldReact` is omitted. `joinRoom(roomId)` returns whether a public channel join worked.
|
|
41
|
+
|
|
42
|
+
## Helpers
|
|
43
|
+
|
|
44
|
+
- `splitForRc(text, max?, maxParts?)`: splits on line boundaries, closes and reopens a ``` fence across a split, and ends a runaway text with a truncation notice. `RC_MAX_MESSAGE_CHARS` (4000) and `RC_MAX_PARTS` (5) are the defaults.
|
|
45
|
+
- `postCall`, `fallbackCall`, `reactCall` build the exact bodies Rocket.Chat accepts; `illegalPostKeys`, `illegalSendMessageKeys` and `illegalReactKeys` check a body against the endpoint's schema. `chat.postMessage` rejects any extra key.
|
|
46
|
+
- `normalizeChannel`, `isDirectTarget` and `normalizeTargets` fold targets for an allowlist. An empty list is an empty set: treat it as "posting is off".
|
|
47
|
+
- `withinRate` is the sliding-window counter behind `postCap`; `DEFAULT_MAX_POSTS_PER_THREAD` and `DEFAULT_LOOP_WINDOW_MS` are a starting point.
|
|
48
|
+
- `fetchWithTimeout` and `DeadlineError` are the deadline every call runs under.
|
|
49
|
+
|
|
50
|
+
MIT licensed.
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import { type PostVoice } from "./payload.js";
|
|
2
|
+
/** Request headers, as plain strings. */
|
|
3
|
+
export type RcHeaders = Record<string, string>;
|
|
4
|
+
/** Where diagnostics go. Never handed a credential. */
|
|
5
|
+
export type RcLog = (...args: unknown[]) => void;
|
|
6
|
+
/** A Rocket.Chat bot identity and how this client posts with it. */
|
|
7
|
+
export interface RocketChatConfig {
|
|
8
|
+
baseUrl: string;
|
|
9
|
+
userId: string;
|
|
10
|
+
authToken: string;
|
|
11
|
+
/** Hard deadline per request; Rocket.Chat's REST API answers in seconds. Default 15s. */
|
|
12
|
+
timeoutMs?: number;
|
|
13
|
+
/** Ceiling per message before a text is split. Default `RC_MAX_MESSAGE_CHARS`. */
|
|
14
|
+
maxMessageChars?: number;
|
|
15
|
+
/** `postReply` only: send a threaded reply to the channel too ("also send to
|
|
16
|
+
* channel", `tshow`). Default off. */
|
|
17
|
+
threadShow?: boolean;
|
|
18
|
+
/** `postReply` only: the post cap. `rate` holds per-thread timestamps and is
|
|
19
|
+
* owned by the caller, so it can outlive the client. Absent, nothing is capped. */
|
|
20
|
+
postCap?: {
|
|
21
|
+
rate: Map<string, number[]>;
|
|
22
|
+
maxPosts: number;
|
|
23
|
+
windowMs: number;
|
|
24
|
+
};
|
|
25
|
+
/** Diagnostics from the best-effort paths. Default: dropped. */
|
|
26
|
+
log?: RcLog;
|
|
27
|
+
/** Headers to speak AS in this room, or undefined for the bot's own. Used by
|
|
28
|
+
* `postReply`, `post`, `applyReactions` and `headersForRoom`. */
|
|
29
|
+
identityForRoom?: (roomId: string) => Promise<RcHeaders | undefined>;
|
|
30
|
+
/** Asked when `rooms.info` refuses: is this room nonetheless a DM? A yes is cached. */
|
|
31
|
+
isDirectMessageFallback?: (roomId: string) => Promise<boolean>;
|
|
32
|
+
/** Rewrites a reply before it is split (strip markers, pick a voice). `postReply` only. */
|
|
33
|
+
outbound?: (text: string) => {
|
|
34
|
+
text: string;
|
|
35
|
+
voice?: PostVoice;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export interface RocketChatAuthStatus {
|
|
39
|
+
ok: boolean;
|
|
40
|
+
status: number;
|
|
41
|
+
error?: string;
|
|
42
|
+
}
|
|
43
|
+
/** A posted message, enough to cite it back to a human. */
|
|
44
|
+
export interface PostedMessage {
|
|
45
|
+
messageId: string;
|
|
46
|
+
channel: string;
|
|
47
|
+
/** Returned by Rocket.Chat for posts addressed by name, so a later post can
|
|
48
|
+
* reach the same room without resolving its opaque id. */
|
|
49
|
+
roomId?: string;
|
|
50
|
+
}
|
|
51
|
+
/** The fields of a Rocket.Chat message a caller reads (`chat.getMessage`). */
|
|
52
|
+
export interface RocketChatMessage {
|
|
53
|
+
_id: string;
|
|
54
|
+
rid: string;
|
|
55
|
+
msg?: string;
|
|
56
|
+
/** Thread root id; present only on a thread reply. */
|
|
57
|
+
tmid?: string;
|
|
58
|
+
/** ISO string from the REST API; `{ $date }` from some older servers. */
|
|
59
|
+
ts: string | {
|
|
60
|
+
$date: number;
|
|
61
|
+
};
|
|
62
|
+
u: {
|
|
63
|
+
_id: string;
|
|
64
|
+
username: string;
|
|
65
|
+
name?: string;
|
|
66
|
+
};
|
|
67
|
+
/** Set on messages posted by bots and integrations. */
|
|
68
|
+
bot?: unknown;
|
|
69
|
+
}
|
|
70
|
+
/** A file for `uploadToRoom`, already decoded and validated by the caller. */
|
|
71
|
+
export interface RoomFile {
|
|
72
|
+
name: string;
|
|
73
|
+
bytes: Uint8Array<ArrayBuffer>;
|
|
74
|
+
contentType: string;
|
|
75
|
+
}
|
|
76
|
+
/** One reaction to set or clear. */
|
|
77
|
+
export interface ReactionChange {
|
|
78
|
+
emoji: string;
|
|
79
|
+
shouldReact: boolean;
|
|
80
|
+
}
|
|
81
|
+
/** The result of a raw `post`: never thrown, so a best-effort caller can log it. */
|
|
82
|
+
export interface RawPostResult {
|
|
83
|
+
ok: boolean;
|
|
84
|
+
id?: string;
|
|
85
|
+
detail?: string;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* One Rocket.Chat REST client, in two registers:
|
|
89
|
+
*
|
|
90
|
+
* - **Delivering** (`postToChannel`, `postToRoom`, `postAsMember`, `uploadToRoom`,
|
|
91
|
+
* `getMessage`): posts as the bot and THROWS on failure. For a scheduled job or
|
|
92
|
+
* a tool call, a message that silently vanished is worse than an error.
|
|
93
|
+
* - **Replying** (`postReply`, `applyReactions`, `post`): posts as the room's
|
|
94
|
+
* identity and NEVER throws. For a live conversation, a failed post is logged
|
|
95
|
+
* and the conversation carries on.
|
|
96
|
+
*
|
|
97
|
+
* Room type (`isDirectMessage`), auth status and the reaction toggle (`react`)
|
|
98
|
+
* serve both.
|
|
99
|
+
*/
|
|
100
|
+
export declare class RocketChatClient {
|
|
101
|
+
private readonly baseUrl;
|
|
102
|
+
private readonly userId;
|
|
103
|
+
private readonly authToken;
|
|
104
|
+
private readonly timeoutMs;
|
|
105
|
+
private readonly maxMessageChars;
|
|
106
|
+
private readonly config;
|
|
107
|
+
private readonly fetchImpl;
|
|
108
|
+
private readonly log;
|
|
109
|
+
private readonly roomTypes;
|
|
110
|
+
/** `fetchImpl` is injectable for tests. */
|
|
111
|
+
constructor(config: RocketChatConfig, fetchImpl?: typeof fetch);
|
|
112
|
+
/** The bot's own user id, so a caller can tell its posts from a human's. */
|
|
113
|
+
get botUserId(): string;
|
|
114
|
+
/** The bot's own auth headers; `json` adds the content-type a POST needs. The
|
|
115
|
+
* one place the credentials become headers. */
|
|
116
|
+
botHeaders(json?: boolean): RcHeaders;
|
|
117
|
+
/** Auth for one call into a room. The identity is a property of the ROOM, not
|
|
118
|
+
* the call site, so an acknowledgement, the answer and a follow-up minutes later
|
|
119
|
+
* share one voice. Falls back to the bot's own credentials. */
|
|
120
|
+
headersForRoom(roomId: string | undefined): Promise<RcHeaders>;
|
|
121
|
+
/** A GET with this client's deadline, for reads the client has no method for
|
|
122
|
+
* (an attachment, a history page). The caller picks the headers. */
|
|
123
|
+
get(url: string, headers: RcHeaders, label: string): Promise<Response>;
|
|
124
|
+
/** Check the bot credential (`/api/v1/me`) without exposing it. Never throws. */
|
|
125
|
+
authStatus(): Promise<RocketChatAuthStatus>;
|
|
126
|
+
/**
|
|
127
|
+
* Post BY NAME, so a caller never has to resolve an opaque room id first.
|
|
128
|
+
* Rocket.Chat's `channel` field takes `#name` for a channel and `@name` for a
|
|
129
|
+
* direct message, and opens the DM room if it does not exist yet, which is what
|
|
130
|
+
* lets an unattended job reach a person who is not watching a channel.
|
|
131
|
+
*
|
|
132
|
+
* Over the size limit the text goes as several posts: the first finds the room,
|
|
133
|
+
* the rest follow it there by id, in order.
|
|
134
|
+
*/
|
|
135
|
+
postToChannel(channel: string, text: string, voice?: PostVoice): Promise<PostedMessage>;
|
|
136
|
+
/**
|
|
137
|
+
* Find a room by its DISPLAY name, because a Rocket.Chat discussion does not
|
|
138
|
+
* answer to the name a human knows it by.
|
|
139
|
+
*
|
|
140
|
+
* A discussion's `name` is generated (a random mixed-case id), and the title
|
|
141
|
+
* everyone reads lives in `fname`. `chat.postMessage` resolves its `channel`
|
|
142
|
+
* field against `name` and never against `fname`, so a post to a discussion by
|
|
143
|
+
* its title fails with `[invalid-channel]` while the room is plainly visible.
|
|
144
|
+
* Matching on `fname` lets callers keep using the only spelling a human knows,
|
|
145
|
+
* even after case-folding.
|
|
146
|
+
*
|
|
147
|
+
* `rooms.get` returns the rooms this bot is SUBSCRIBED to, which needs no admin
|
|
148
|
+
* permission and includes discussions. That is also the honest limit: a room the
|
|
149
|
+
* bot has not joined is invisible here, and the caller gets the original
|
|
150
|
+
* `[invalid-channel]`, because "not a member" is what actually needs fixing.
|
|
151
|
+
*
|
|
152
|
+
* Not cached: this path only runs after a post has already failed, so it is
|
|
153
|
+
* rare, and a stale cached id would fail in a way that looks nothing like its
|
|
154
|
+
* cause.
|
|
155
|
+
*/
|
|
156
|
+
private resolveByDisplayName;
|
|
157
|
+
/**
|
|
158
|
+
* Post into a specific room, and optionally INSIDE a thread.
|
|
159
|
+
*
|
|
160
|
+
* `postToChannel` cannot do this: `channel` addresses a room by name, and a
|
|
161
|
+
* thread is not a name. It is the id of the message the thread hangs off, which
|
|
162
|
+
* only rides alongside a `roomId`. A missing `tmid` posts to the room root.
|
|
163
|
+
* Every part of an oversized text lands in the same room and thread.
|
|
164
|
+
*/
|
|
165
|
+
postToRoom(roomId: string, text: string, tmid?: string, voice?: PostVoice): Promise<PostedMessage>;
|
|
166
|
+
/**
|
|
167
|
+
* Post as a subscribed member (`chat.sendMessage`). When Rocket.Chat answers
|
|
168
|
+
* `error-not-allowed` (a public channel the bot never joined), join it and try
|
|
169
|
+
* again, and if that is still refused, fall back to `chat.postMessage`, which
|
|
170
|
+
* needs no subscription.
|
|
171
|
+
*/
|
|
172
|
+
postAsMember(roomId: string, text: string, opts?: {
|
|
173
|
+
tmid?: string;
|
|
174
|
+
voice?: PostVoice;
|
|
175
|
+
}): Promise<PostedMessage>;
|
|
176
|
+
/**
|
|
177
|
+
* Upload a file into a room as its own message, with `caption` as its text.
|
|
178
|
+
* `rooms.upload` was removed in Rocket.Chat 7.0, so it is two calls:
|
|
179
|
+
* `rooms.media` stores the file, `rooms.mediaConfirm` posts it. Both take a
|
|
180
|
+
* room id.
|
|
181
|
+
*/
|
|
182
|
+
uploadToRoom(roomId: string, file: RoomFile, caption?: string): Promise<PostedMessage>;
|
|
183
|
+
/**
|
|
184
|
+
* Read one message by id (`chat.getMessage`). Returns null when Rocket.Chat says
|
|
185
|
+
* the message does not exist or is not visible to the bot, so a caller can
|
|
186
|
+
* refuse with a named reason instead of catching. Other errors throw.
|
|
187
|
+
*/
|
|
188
|
+
getMessage(msgId: string): Promise<RocketChatMessage | null>;
|
|
189
|
+
/**
|
|
190
|
+
* Add or remove a reaction as the bot. `chat.react` toggles when `shouldReact`
|
|
191
|
+
* is omitted; pass it to force add or remove. Never throws: the message already
|
|
192
|
+
* landed, and a missing reaction is visible, not silent.
|
|
193
|
+
*/
|
|
194
|
+
react(messageId: string, emoji: string, shouldReact?: boolean): Promise<void>;
|
|
195
|
+
/** Join a public channel by room id. True on success, false when Rocket.Chat
|
|
196
|
+
* refuses (a private group or a DM, where `channels.join` does not apply).
|
|
197
|
+
* Never throws. */
|
|
198
|
+
joinRoom(roomId: string): Promise<boolean>;
|
|
199
|
+
/** POST a JSON body as the room's identity and pull the new message id out.
|
|
200
|
+
* `roomId` is for bodies that name no room (`chat.react`). Resolves with
|
|
201
|
+
* `ok: false` on a refusal; throws only on transport errors and the deadline. */
|
|
202
|
+
post(endpoint: string, body: unknown, roomId?: string): Promise<RawPostResult>;
|
|
203
|
+
/**
|
|
204
|
+
* Post one message that already fits. Never throws.
|
|
205
|
+
*
|
|
206
|
+
* Two endpoints, in this order: `tshow` is a field of chat.sendMessage's message
|
|
207
|
+
* object, and chat.postMessage 400s on it. So try chat.sendMessage when `tshow`
|
|
208
|
+
* is wanted and ALWAYS fall back to plain chat.postMessage: losing `tshow` is
|
|
209
|
+
* cosmetic, losing the reply is not. The payload shapes live in payload.ts.
|
|
210
|
+
*/
|
|
211
|
+
private postOne;
|
|
212
|
+
/**
|
|
213
|
+
* Post a reply, split to fit the size limit. Parts go out in order into the
|
|
214
|
+
* same thread; returns the FIRST part's id, or undefined when it did not post.
|
|
215
|
+
* Never throws.
|
|
216
|
+
*
|
|
217
|
+
* The post cap sits here so no path can forget it. `uncapped` is for control
|
|
218
|
+
* replies only, so the cap can never take away the command that stops a loop.
|
|
219
|
+
* `outbound` runs BEFORE the split, so a voice applies to every part.
|
|
220
|
+
*/
|
|
221
|
+
postReply(roomId: string, text: string, tmid?: string, opts?: {
|
|
222
|
+
uncapped?: boolean;
|
|
223
|
+
}): Promise<string | undefined>;
|
|
224
|
+
/** Set or clear reactions as the room's identity, always stating
|
|
225
|
+
* `shouldReact`. Never throws: a reaction is a courtesy and must never cost the
|
|
226
|
+
* conversation it decorates. */
|
|
227
|
+
applyReactions(roomId: string, messageId: string, changes: ReadonlyArray<ReactionChange>): Promise<void>;
|
|
228
|
+
/**
|
|
229
|
+
* Is this room a direct message? Room ids are opaque, so the type comes from
|
|
230
|
+
* `rooms.info`, cached because a room's type is stable. A refusal is not an
|
|
231
|
+
* error: a DM the bot is not a member of refuses, so `isDirectMessageFallback`
|
|
232
|
+
* is asked. When the answer is uncertain this returns false and caches nothing,
|
|
233
|
+
* so the next call asks again.
|
|
234
|
+
*/
|
|
235
|
+
isDirectMessage(roomId: string): Promise<boolean>;
|
|
236
|
+
/** The type `isDirectMessage` learned (`c`, `p`, `d`, …); never a call of its own. */
|
|
237
|
+
cachedRoomType(roomId: string): string | undefined;
|
|
238
|
+
/** A GET to the REST API that throws a typed error on a non-2xx. */
|
|
239
|
+
private getJson;
|
|
240
|
+
/** A POST to the REST API as the bot that throws on a non-2xx and on
|
|
241
|
+
* Rocket.Chat's `success: false`. */
|
|
242
|
+
private call;
|
|
243
|
+
/**
|
|
244
|
+
* The delivering `chat.postMessage`, and every way it can fail to deliver.
|
|
245
|
+
* `label` names the target back to a caller who has to fix it; it never appears
|
|
246
|
+
* in the request.
|
|
247
|
+
*/
|
|
248
|
+
private send;
|
|
249
|
+
}
|