@alemonjs/bubble 2.1.0-alpha.3 → 2.1.0-alpha.5

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/lib/sdk/api.d.ts CHANGED
@@ -24,6 +24,8 @@ export declare class BubbleAPI {
24
24
  channelId?: string | number;
25
25
  threadId?: string | number;
26
26
  messageId?: string | number;
27
- }): Promise<FileUploadResponse>;
27
+ }): Promise<{
28
+ data: FileUploadResponse;
29
+ }>;
28
30
  filesQuota(): Promise<FileQuota>;
29
31
  }
package/lib/sdk/api.js CHANGED
@@ -71,9 +71,6 @@ class BubbleAPI {
71
71
  if (extra.threadId) {
72
72
  form.append('threadId', String(extra.threadId));
73
73
  }
74
- if (extra.messageId) {
75
- form.append('messageId', String(extra.messageId));
76
- }
77
74
  const value = getBubbleConfig();
78
75
  const token = value.token;
79
76
  const requestConfig = value.request_config ?? {};
package/lib/send.js CHANGED
@@ -70,9 +70,9 @@ const sendToRoom = async (client, param, val) => {
70
70
  }
71
71
  }
72
72
  const uploadRes = await client.uploadFile(bufferData, undefined, { channelId, threadId, messageId: messageId });
73
- const fileAttachment = uploadRes?.file;
73
+ const fileAttachment = uploadRes?.data?.file;
74
74
  if (!fileAttachment) {
75
- throw new Error('文件上传失败:未返回文件信息');
75
+ return [createResult(ResultCode.Ok, '文件上传失败:未返回文件信息', uploadRes)];
76
76
  }
77
77
  if (channelId) {
78
78
  const res = await client.sendMessage(channelId, {
@@ -143,7 +143,7 @@ const sendToRoom = async (client, param, val) => {
143
143
  }
144
144
  });
145
145
  }
146
- if ((content && content.length > 0 || contentMd && contentMd.length > 0)) {
146
+ if ((content && content.length > 0) || (contentMd && contentMd.length > 0)) {
147
147
  if (channelId) {
148
148
  const res = await client.sendMessage(channelId, { content: content ?? contentMd, type: 'text' });
149
149
  return [createResult(ResultCode.Ok, '完成', res)];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alemonjs/bubble",
3
- "version": "2.1.0-alpha.3",
3
+ "version": "2.1.0-alpha.5",
4
4
  "description": "bubble platform",
5
5
  "author": "lemonade",
6
6
  "license": "MIT",