wechaty-web-panel 1.6.88 → 1.6.90

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.
@@ -124,6 +124,7 @@ class DifyClient {
124
124
  const errorText = await this.streamToString(e.response.data);
125
125
  return Promise.reject(errorText);
126
126
  }
127
+ console.log('error', e.response.data);
127
128
  return Promise.reject(e);
128
129
  }
129
130
  }
@@ -71,7 +71,7 @@ async function onRecordMessage(msg) {
71
71
  baseMsg.type = '自定义表情';
72
72
  const emoticonFileBox = await msg.toFileBox();
73
73
  const emoticonBuffer = await emoticonFileBox.toBuffer();
74
- const emoticonUrl = await (0, oss_js_1.uploadOssFile)(`${conversationRecord?.ossConfig?.custom_path || ''}${(0, dayjs_1.default)().unix()}_${emoticonFileBox.name}`, emoticonBuffer);
74
+ const emoticonUrl = await (0, oss_js_1.uploadOssFile)(`${conversationRecord?.ossConfig?.custom_path || ''}${(0, dayjs_1.default)().valueOf()}_${emoticonFileBox.name}`, emoticonBuffer);
75
75
  baseMsg.url = emoticonUrl;
76
76
  break;
77
77
  case this.Message.Type.Text:
@@ -110,14 +110,14 @@ async function onRecordMessage(msg) {
110
110
  const isImage = fileExtname.includes('.png') || fileExtname.includes('.jpg') || fileExtname.includes('.jpeg') || fileExtname.includes('.gif');
111
111
  baseMsg.type = isImage ? '图片' : '文件';
112
112
  const buffer = await attachFileBox.toBuffer();
113
- const url = await (0, oss_js_1.uploadOssFile)(`${conversationRecord?.ossConfig?.custom_path || ''}${(0, dayjs_1.default)().unix()}_${attachFileBox.name}`, buffer);
113
+ const url = await (0, oss_js_1.uploadOssFile)(`${conversationRecord?.ossConfig?.custom_path || ''}${(0, dayjs_1.default)().valueOf()}_${attachFileBox.name}`, buffer);
114
114
  baseMsg.url = url;
115
115
  break;
116
116
  case this.Message.Type.Audio:
117
117
  baseMsg.type = '语音';
118
118
  const audioFileBox = await msg.toFileBox();
119
119
  const audioBuffer = await audioFileBox.toBuffer();
120
- const audioUrl = await (0, oss_js_1.uploadOssFile)(`${conversationRecord?.ossConfig?.custom_path || ''}${(0, dayjs_1.default)().unix()}_${audioFileBox.name}`, audioBuffer);
120
+ const audioUrl = await (0, oss_js_1.uploadOssFile)(`${conversationRecord?.ossConfig?.custom_path || ''}${(0, dayjs_1.default)().valueOf()}_${audioFileBox.name}`, audioBuffer);
121
121
  baseMsg.url = audioUrl;
122
122
  break;
123
123
  default:
@@ -178,7 +178,7 @@ async function dispatchFriendFilterByMsgType(that, msg) {
178
178
  const fileExtname = path_1.default.extname(attachFileBox.name);
179
179
  const fileType = '图片';
180
180
  const buffer = await attachFileBox.toBuffer();
181
- const url = await (0, oss_js_1.uploadGlobalOssFile)(`${uploadFileConfig?.ossConfig?.custom_path || ''}${(0, dayjs_1.default)().unix()}_${attachFileBox.name}`, buffer);
181
+ const url = await (0, oss_js_1.uploadGlobalOssFile)(`${uploadFileConfig?.ossConfig?.custom_path || ''}${(0, dayjs_1.default)().valueOf()}_${attachFileBox.name}`, buffer);
182
182
  const fileUrl = url;
183
183
  const fileReplys = await (0, reply_js_1.getFileReply)({
184
184
  that,
@@ -228,7 +228,7 @@ async function dispatchFriendFilterByMsgType(that, msg) {
228
228
  const fileExtname = path_1.default.extname(attachFileBox.name);
229
229
  const fileType = '文件';
230
230
  const buffer = await attachFileBox.toBuffer();
231
- const url = await (0, oss_js_1.uploadGlobalOssFile)(`${uploadFileConfig?.ossConfig?.custom_path || ''}${(0, dayjs_1.default)().unix()}_${attachFileBox.name}`, buffer);
231
+ const url = await (0, oss_js_1.uploadGlobalOssFile)(`${uploadFileConfig?.ossConfig?.custom_path || ''}${(0, dayjs_1.default)().valueOf()}_${attachFileBox.name}`, buffer);
232
232
  const fileUrl = url;
233
233
  const fileReplys = await (0, reply_js_1.getFileReply)({
234
234
  that,
@@ -394,7 +394,7 @@ async function dispatchRoomFilterByMsgType(that, room, msg) {
394
394
  const fileExtname = path_1.default.extname(attachFileBox.name);
395
395
  const fileType = '图片';
396
396
  const buffer = await attachFileBox.toBuffer();
397
- const url = await (0, oss_js_1.uploadGlobalOssFile)(`${uploadFileConfig?.ossConfig?.custom_path || ''}${(0, dayjs_1.default)().unix()}_${attachFileBox.name}`, buffer);
397
+ const url = await (0, oss_js_1.uploadGlobalOssFile)(`${uploadFileConfig?.ossConfig?.custom_path || ''}${(0, dayjs_1.default)().valueOf()}_${attachFileBox.name}`, buffer);
398
398
  const fileUrl = url;
399
399
  const fileReplys = await (0, reply_js_1.getFileReply)({
400
400
  that,
@@ -444,7 +444,7 @@ async function dispatchRoomFilterByMsgType(that, room, msg) {
444
444
  const fileExtname = path_1.default.extname(attachFileBox.name);
445
445
  const fileType = '文件';
446
446
  const buffer = await attachFileBox.toBuffer();
447
- const url = await (0, oss_js_1.uploadGlobalOssFile)(`${uploadFileConfig?.ossConfig?.custom_path || ''}${(0, dayjs_1.default)().unix()}_${attachFileBox.name}`, buffer);
447
+ const url = await (0, oss_js_1.uploadGlobalOssFile)(`${uploadFileConfig?.ossConfig?.custom_path || ''}${(0, dayjs_1.default)().valueOf()}_${attachFileBox.name}`, buffer);
448
448
  const fileUrl = url;
449
449
  const fileReplys = await (0, reply_js_1.getFileReply)({
450
450
  that,
@@ -6,7 +6,7 @@ exports.packageJson = void 0;
6
6
  */
7
7
  exports.packageJson = {
8
8
  "name": "wechaty-web-panel",
9
- "version": "1.6.88",
9
+ "version": "1.6.90",
10
10
  "exports": {
11
11
  ".": {
12
12
  "import": "./dist/esm/src/index.js",
@@ -118,6 +118,7 @@ export class DifyClient {
118
118
  const errorText = await this.streamToString(e.response.data);
119
119
  return Promise.reject(errorText);
120
120
  }
121
+ console.log('error', e.response.data);
121
122
  return Promise.reject(e);
122
123
  }
123
124
  }
@@ -66,7 +66,7 @@ async function onRecordMessage(msg) {
66
66
  baseMsg.type = '自定义表情';
67
67
  const emoticonFileBox = await msg.toFileBox();
68
68
  const emoticonBuffer = await emoticonFileBox.toBuffer();
69
- const emoticonUrl = await uploadOssFile(`${conversationRecord?.ossConfig?.custom_path || ''}${dayjs().unix()}_${emoticonFileBox.name}`, emoticonBuffer);
69
+ const emoticonUrl = await uploadOssFile(`${conversationRecord?.ossConfig?.custom_path || ''}${dayjs().valueOf()}_${emoticonFileBox.name}`, emoticonBuffer);
70
70
  baseMsg.url = emoticonUrl;
71
71
  break;
72
72
  case this.Message.Type.Text:
@@ -105,14 +105,14 @@ async function onRecordMessage(msg) {
105
105
  const isImage = fileExtname.includes('.png') || fileExtname.includes('.jpg') || fileExtname.includes('.jpeg') || fileExtname.includes('.gif');
106
106
  baseMsg.type = isImage ? '图片' : '文件';
107
107
  const buffer = await attachFileBox.toBuffer();
108
- const url = await uploadOssFile(`${conversationRecord?.ossConfig?.custom_path || ''}${dayjs().unix()}_${attachFileBox.name}`, buffer);
108
+ const url = await uploadOssFile(`${conversationRecord?.ossConfig?.custom_path || ''}${dayjs().valueOf()}_${attachFileBox.name}`, buffer);
109
109
  baseMsg.url = url;
110
110
  break;
111
111
  case this.Message.Type.Audio:
112
112
  baseMsg.type = '语音';
113
113
  const audioFileBox = await msg.toFileBox();
114
114
  const audioBuffer = await audioFileBox.toBuffer();
115
- const audioUrl = await uploadOssFile(`${conversationRecord?.ossConfig?.custom_path || ''}${dayjs().unix()}_${audioFileBox.name}`, audioBuffer);
115
+ const audioUrl = await uploadOssFile(`${conversationRecord?.ossConfig?.custom_path || ''}${dayjs().valueOf()}_${audioFileBox.name}`, audioBuffer);
116
116
  baseMsg.url = audioUrl;
117
117
  break;
118
118
  default:
@@ -173,7 +173,7 @@ async function dispatchFriendFilterByMsgType(that, msg) {
173
173
  const fileExtname = path.extname(attachFileBox.name);
174
174
  const fileType = '图片';
175
175
  const buffer = await attachFileBox.toBuffer();
176
- const url = await uploadGlobalOssFile(`${uploadFileConfig?.ossConfig?.custom_path || ''}${dayjs().unix()}_${attachFileBox.name}`, buffer);
176
+ const url = await uploadGlobalOssFile(`${uploadFileConfig?.ossConfig?.custom_path || ''}${dayjs().valueOf()}_${attachFileBox.name}`, buffer);
177
177
  const fileUrl = url;
178
178
  const fileReplys = await getFileReply({
179
179
  that,
@@ -223,7 +223,7 @@ async function dispatchFriendFilterByMsgType(that, msg) {
223
223
  const fileExtname = path.extname(attachFileBox.name);
224
224
  const fileType = '文件';
225
225
  const buffer = await attachFileBox.toBuffer();
226
- const url = await uploadGlobalOssFile(`${uploadFileConfig?.ossConfig?.custom_path || ''}${dayjs().unix()}_${attachFileBox.name}`, buffer);
226
+ const url = await uploadGlobalOssFile(`${uploadFileConfig?.ossConfig?.custom_path || ''}${dayjs().valueOf()}_${attachFileBox.name}`, buffer);
227
227
  const fileUrl = url;
228
228
  const fileReplys = await getFileReply({
229
229
  that,
@@ -389,7 +389,7 @@ async function dispatchRoomFilterByMsgType(that, room, msg) {
389
389
  const fileExtname = path.extname(attachFileBox.name);
390
390
  const fileType = '图片';
391
391
  const buffer = await attachFileBox.toBuffer();
392
- const url = await uploadGlobalOssFile(`${uploadFileConfig?.ossConfig?.custom_path || ''}${dayjs().unix()}_${attachFileBox.name}`, buffer);
392
+ const url = await uploadGlobalOssFile(`${uploadFileConfig?.ossConfig?.custom_path || ''}${dayjs().valueOf()}_${attachFileBox.name}`, buffer);
393
393
  const fileUrl = url;
394
394
  const fileReplys = await getFileReply({
395
395
  that,
@@ -439,7 +439,7 @@ async function dispatchRoomFilterByMsgType(that, room, msg) {
439
439
  const fileExtname = path.extname(attachFileBox.name);
440
440
  const fileType = '文件';
441
441
  const buffer = await attachFileBox.toBuffer();
442
- const url = await uploadGlobalOssFile(`${uploadFileConfig?.ossConfig?.custom_path || ''}${dayjs().unix()}_${attachFileBox.name}`, buffer);
442
+ const url = await uploadGlobalOssFile(`${uploadFileConfig?.ossConfig?.custom_path || ''}${dayjs().valueOf()}_${attachFileBox.name}`, buffer);
443
443
  const fileUrl = url;
444
444
  const fileReplys = await getFileReply({
445
445
  that,
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export const packageJson = {
5
5
  "name": "wechaty-web-panel",
6
- "version": "1.6.88",
6
+ "version": "1.6.90",
7
7
  "exports": {
8
8
  ".": {
9
9
  "import": "./dist/esm/src/index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wechaty-web-panel",
3
- "version": "1.6.88",
3
+ "version": "1.6.90",
4
4
  "exports": {
5
5
  ".": {
6
6
  "import": "./dist/esm/src/index.js",
@@ -125,7 +125,8 @@ export class DifyClient {
125
125
  if(stream && e.response) {
126
126
  const errorText = await this.streamToString(e.response.data);
127
127
  return Promise.reject(errorText)
128
- }
128
+ }
129
+ console.log('error', e.response.data);
129
130
  return Promise.reject(e)
130
131
  }
131
132
  }
@@ -66,7 +66,7 @@ async function onRecordMessage(msg) {
66
66
  baseMsg.type = '自定义表情'
67
67
  const emoticonFileBox = await msg.toFileBox();
68
68
  const emoticonBuffer = await emoticonFileBox.toBuffer()
69
- const emoticonUrl = await uploadOssFile(`${conversationRecord?.ossConfig?.custom_path || ''}${dayjs().unix()}_${emoticonFileBox.name}`, emoticonBuffer)
69
+ const emoticonUrl = await uploadOssFile(`${conversationRecord?.ossConfig?.custom_path || ''}${dayjs().valueOf()}_${emoticonFileBox.name}`, emoticonBuffer)
70
70
  baseMsg.url = emoticonUrl
71
71
  break;
72
72
  case this.Message.Type.Text:
@@ -105,14 +105,14 @@ async function onRecordMessage(msg) {
105
105
  const isImage = fileExtname.includes('.png') || fileExtname.includes('.jpg') || fileExtname.includes('.jpeg') || fileExtname.includes('.gif')
106
106
  baseMsg.type = isImage ? '图片' : '文件'
107
107
  const buffer = await attachFileBox.toBuffer()
108
- const url = await uploadOssFile(`${conversationRecord?.ossConfig?.custom_path || ''}${dayjs().unix()}_${attachFileBox.name}`, buffer)
108
+ const url = await uploadOssFile(`${conversationRecord?.ossConfig?.custom_path || ''}${dayjs().valueOf()}_${attachFileBox.name}`, buffer)
109
109
  baseMsg.url = url
110
110
  break
111
111
  case this.Message.Type.Audio:
112
112
  baseMsg.type = '语音'
113
113
  const audioFileBox = await msg.toFileBox()
114
114
  const audioBuffer = await audioFileBox.toBuffer()
115
- const audioUrl = await uploadOssFile(`${conversationRecord?.ossConfig?.custom_path || ''}${dayjs().unix()}_${audioFileBox.name}`, audioBuffer)
115
+ const audioUrl = await uploadOssFile(`${conversationRecord?.ossConfig?.custom_path || ''}${dayjs().valueOf()}_${audioFileBox.name}`, audioBuffer)
116
116
  baseMsg.url = audioUrl
117
117
  break
118
118
  default:
@@ -172,7 +172,7 @@ async function dispatchFriendFilterByMsgType(that, msg) {
172
172
  const fileExtname = path.extname(attachFileBox.name)
173
173
  const fileType = '图片'
174
174
  const buffer = await attachFileBox.toBuffer()
175
- const url = await uploadGlobalOssFile(`${uploadFileConfig?.ossConfig?.custom_path || ''}${dayjs().unix()}_${attachFileBox.name}`, buffer)
175
+ const url = await uploadGlobalOssFile(`${uploadFileConfig?.ossConfig?.custom_path || ''}${dayjs().valueOf()}_${attachFileBox.name}`, buffer)
176
176
  const fileUrl = url
177
177
  const fileReplys = await getFileReply({
178
178
  that,
@@ -224,7 +224,7 @@ async function dispatchFriendFilterByMsgType(that, msg) {
224
224
  const fileExtname = path.extname(attachFileBox.name)
225
225
  const fileType = '文件'
226
226
  const buffer = await attachFileBox.toBuffer()
227
- const url = await uploadGlobalOssFile(`${uploadFileConfig?.ossConfig?.custom_path || ''}${dayjs().unix()}_${attachFileBox.name}`, buffer)
227
+ const url = await uploadGlobalOssFile(`${uploadFileConfig?.ossConfig?.custom_path || ''}${dayjs().valueOf()}_${attachFileBox.name}`, buffer)
228
228
  const fileUrl = url
229
229
  const fileReplys = await getFileReply({
230
230
  that,
@@ -391,7 +391,7 @@ async function dispatchRoomFilterByMsgType(that, room, msg) {
391
391
  const fileExtname = path.extname(attachFileBox.name)
392
392
  const fileType = '图片'
393
393
  const buffer = await attachFileBox.toBuffer()
394
- const url = await uploadGlobalOssFile(`${uploadFileConfig?.ossConfig?.custom_path || ''}${dayjs().unix()}_${attachFileBox.name}`, buffer)
394
+ const url = await uploadGlobalOssFile(`${uploadFileConfig?.ossConfig?.custom_path || ''}${dayjs().valueOf()}_${attachFileBox.name}`, buffer)
395
395
  const fileUrl = url
396
396
  const fileReplys = await getFileReply({
397
397
  that,
@@ -444,7 +444,7 @@ async function dispatchRoomFilterByMsgType(that, room, msg) {
444
444
  const fileExtname = path.extname(attachFileBox.name)
445
445
  const fileType = '文件'
446
446
  const buffer = await attachFileBox.toBuffer()
447
- const url = await uploadGlobalOssFile(`${uploadFileConfig?.ossConfig?.custom_path || ''}${dayjs().unix()}_${attachFileBox.name}`, buffer)
447
+ const url = await uploadGlobalOssFile(`${uploadFileConfig?.ossConfig?.custom_path || ''}${dayjs().valueOf()}_${attachFileBox.name}`, buffer)
448
448
  const fileUrl = url
449
449
  const fileReplys = await getFileReply({
450
450
  that,
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export const packageJson = {
5
5
  "name": "wechaty-web-panel",
6
- "version": "1.6.88",
6
+ "version": "1.6.90",
7
7
  "exports": {
8
8
  ".": {
9
9
  "import": "./dist/esm/src/index.js",