feat(sdk): add media sends, quoted replies, and event waits
Add local media upload-and-send helpers with an optional Node file source and stage-aware errors. Add explicit quoted replies and cancellable event waits while preserving existing methods and handler contracts. Propagate group-file publication failures instead of reporting success. Cover cancellation, cleanup, signed message IDs, package exports, consumer types, and real HTTP/WebSocket upload-to-send integration. Validation: pnpm run ci (6231 tests passed, 9 skipped); SDK package contents verified with npm pack --dry-run --ignore-scripts.
This commit is contained in:
28 files changed
+1798
-37
No files matched your search
@@ -400,14 +400,11 @@ export class GroupFileApi {
|
||||
try {
|
||||
await this.publish(groupId, fileId);
|
||||
} catch (err) {
|
||||
// The bytes are already on the server and the fileId is valid —
|
||||
// fail loud but don't lose the upload result the action handler
|
||||
// committed to returning. Callers can still resolve the file by
|
||||
// id; they'll just have to re-publish it themselves.
|
||||
log.warn(
|
||||
'group file uploaded (fileId=%s) but chat post failed: %s',
|
||||
fileId,
|
||||
err instanceof Error ? err.message : String(err),
|
||||
// Keep the completed upload identifiable, but a requested chat
|
||||
// publication must not be reported as a successful send.
|
||||
throw new Error(
|
||||
`group file uploaded (fileId=${fileId}) but chat post failed: ${err instanceof Error ? err.message : String(err)}`,
|
||||
{ cause: err },
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user