@kyan-du/agent-wechat-cli 0.14.0 → 0.14.2

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/dist/cli.js CHANGED
@@ -7627,6 +7627,14 @@ var openChatResultSchema = external_exports.object({
7627
7627
  errorCode: external_exports.string().optional(),
7628
7628
  error: external_exports.string().optional()
7629
7629
  });
7630
+ var downloadFileParamsSchema = external_exports.object({
7631
+ chatId: external_exports.string().min(1),
7632
+ filename: external_exports.string().min(1).optional(),
7633
+ executionTimeoutMs: external_exports.number().int().positive().optional()
7634
+ });
7635
+ var downloadFileResultSchema = openChatResultSchema.extend({
7636
+ clicked: external_exports.boolean().optional()
7637
+ });
7630
7638
  var idempotencyKeySchema = external_exports.string().min(1).max(128).regex(/^[A-Za-z0-9._:-]+$/);
7631
7639
  var forwardedMessageNodeSchema = external_exports.lazy(() => external_exports.object({
7632
7640
  sender: external_exports.string().optional(),
@@ -7813,11 +7821,12 @@ var WeChatClient = class {
7813
7821
  await throwHttpError(res);
7814
7822
  return res.json();
7815
7823
  }
7816
- async post(path6, body) {
7824
+ async post(path6, body, signal) {
7817
7825
  const res = await fetch(`${this.base}${path6}`, {
7818
7826
  method: "POST",
7819
7827
  headers: this.headers,
7820
- body: body != null ? JSON.stringify(body) : void 0
7828
+ body: body != null ? JSON.stringify(body) : void 0,
7829
+ signal
7821
7830
  });
7822
7831
  if (!res.ok)
7823
7832
  await throwHttpError(res);
@@ -7862,8 +7871,11 @@ var WeChatClient = class {
7862
7871
  async markChatRead(chatId) {
7863
7872
  return this.post(`/api/chats/${encodeURIComponent(chatId)}/mark-read`);
7864
7873
  }
7865
- async openChat(chatId, clearUnreads) {
7866
- return this.post(`/api/chats/${encodeURIComponent(chatId)}/open${qs({ clearUnreads })}`);
7874
+ async openChat(chatId, clearUnreads, signal, executionTimeoutMs) {
7875
+ return this.post(`/api/chats/${encodeURIComponent(chatId)}/open${qs({ clearUnreads, executionTimeoutMs })}`, void 0, signal);
7876
+ }
7877
+ async downloadFile(chatId, filename, signal, executionTimeoutMs) {
7878
+ return this.post(`/api/chats/${encodeURIComponent(chatId)}/download-file${qs({ filename, executionTimeoutMs })}`, void 0, signal);
7867
7879
  }
7868
7880
  async listGroupMembersPage(groupId, limit, cursor) {
7869
7881
  const page = groupMembersPageSchema.parse(await this.get(`/api/groups/${encodeURIComponent(groupId)}/members${qs({ limit, cursor })}`));
@@ -9736,7 +9748,7 @@ function checkCliUpgrade(currentVersion, readLatest = () => execFileSync2("npm",
9736
9748
  }
9737
9749
 
9738
9750
  // src/cli.ts
9739
- var VERSION = false ? "0.0.0-test" : "0.14.0";
9751
+ var VERSION = false ? "0.0.0-test" : "0.14.2";
9740
9752
  var MAX_UPLOAD_BYTES = 50 * 1024 * 1024;
9741
9753
  function readToken() {
9742
9754
  try {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "cliVersion": "0.14.0",
3
+ "cliVersion": "0.14.2",
4
4
  "repository": "ghcr.io/kyan-du/agent-wechat",
5
5
  "apiVersion": 1,
6
6
  "allowedReferences": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kyan-du/agent-wechat-cli",
3
- "version": "0.14.0",
3
+ "version": "0.14.2",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "wx": "./dist/cli.js"