@searchfe/openclaw-baiduapp 0.1.7-beta.5 → 0.1.7-beta.6
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/index.js +3 -32
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5987,30 +5987,6 @@ var meta = {
|
|
|
5987
5987
|
order: 85
|
|
5988
5988
|
};
|
|
5989
5989
|
var unregisterHooks = /* @__PURE__ */ new Map();
|
|
5990
|
-
var BAIDU_FILE_TYPE_BY_EXTENSION = {
|
|
5991
|
-
".amr": "audio/amr",
|
|
5992
|
-
".csv": "text/csv",
|
|
5993
|
-
".doc": "application/msword",
|
|
5994
|
-
".docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
5995
|
-
".gif": "image/gif",
|
|
5996
|
-
".jpeg": "image/jpeg",
|
|
5997
|
-
".jpg": "image/jpeg",
|
|
5998
|
-
".json": "application/json",
|
|
5999
|
-
".md": "text/markdown",
|
|
6000
|
-
".mov": "video/quicktime",
|
|
6001
|
-
".mp3": "audio/mpeg",
|
|
6002
|
-
".mp4": "video/mp4",
|
|
6003
|
-
".pdf": "application/pdf",
|
|
6004
|
-
".png": "image/png",
|
|
6005
|
-
".ppt": "application/vnd.ms-powerpoint",
|
|
6006
|
-
".pptx": "application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
6007
|
-
".svg": "image/svg+xml",
|
|
6008
|
-
".txt": "text/plain",
|
|
6009
|
-
".wav": "audio/wav",
|
|
6010
|
-
".xls": "application/vnd.ms-excel",
|
|
6011
|
-
".xlsx": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
6012
|
-
".zip": "application/zip"
|
|
6013
|
-
};
|
|
6014
5990
|
function resolveOutboundLocalMediaPath(mediaUrl) {
|
|
6015
5991
|
const trimmed = mediaUrl?.trim();
|
|
6016
5992
|
if (!trimmed) {
|
|
@@ -6031,12 +6007,8 @@ function resolveOutboundLocalMediaPath(mediaUrl) {
|
|
|
6031
6007
|
return trimmed;
|
|
6032
6008
|
}
|
|
6033
6009
|
function inferBaiduOutboundFileType(params) {
|
|
6034
|
-
const
|
|
6035
|
-
|
|
6036
|
-
return normalizedMimeType;
|
|
6037
|
-
}
|
|
6038
|
-
const extension = path2.extname(params.mediaPath).toLowerCase();
|
|
6039
|
-
return BAIDU_FILE_TYPE_BY_EXTENSION[extension] ?? "application/octet-stream";
|
|
6010
|
+
const ext = path2.extname(params.mediaPath).toLowerCase();
|
|
6011
|
+
return ext.startsWith(".") ? ext.slice(1) : ext || "bin";
|
|
6040
6012
|
}
|
|
6041
6013
|
function buildOutboundMediaPayload(params) {
|
|
6042
6014
|
const caption = params.caption?.trim();
|
|
@@ -6325,8 +6297,7 @@ var baiduAppPlugin = {
|
|
|
6325
6297
|
caption: params.text,
|
|
6326
6298
|
uploadedUrl: uploaded.url,
|
|
6327
6299
|
fileType: inferBaiduOutboundFileType({
|
|
6328
|
-
mediaPath: uploaded.fileName || localMediaPath
|
|
6329
|
-
mimeType: params.mimeType
|
|
6300
|
+
mediaPath: uploaded.fileName || localMediaPath
|
|
6330
6301
|
})
|
|
6331
6302
|
})
|
|
6332
6303
|
);
|