mirror of
https://github.com/ONLYOFFICE/document-server-integration.git
synced 2026-02-10 18:05:10 +08:00
nodejs: added module document-formats
This commit is contained in:
4
.gitmodules
vendored
4
.gitmodules
vendored
@ -30,3 +30,7 @@
|
||||
path = web/documentserver-example/nodejs/public/assets/document-templates
|
||||
url = https://github.com/ONLYOFFICE/document-templates
|
||||
branch = main/en
|
||||
[submodule "web/documentserver-example/nodejs/public/assets/document-formats"]
|
||||
path = web/documentserver-example/nodejs/public/assets/document-formats
|
||||
url = https://github.com/ONLYOFFICE/document-formats
|
||||
branch = master
|
||||
|
||||
@ -1,401 +0,0 @@
|
||||
[
|
||||
{
|
||||
"name": "djvu",
|
||||
"type": "word",
|
||||
"actions": ["view"],
|
||||
"convert": [],
|
||||
"mime": "image/vnd.djvu"
|
||||
},
|
||||
{
|
||||
"name": "doc",
|
||||
"type": "word",
|
||||
"actions": ["view", "edit"],
|
||||
"convert": ["docx", "docxf", "docm", "dotx", "dotm", "epub", "fb2", "html", "odt", "ott", "pdf", "pdfa", "rtf", "txt"],
|
||||
"mime": "application/vnd.ms-word"
|
||||
},
|
||||
{
|
||||
"name": "docm",
|
||||
"type": "word",
|
||||
"actions": ["view", "edit"],
|
||||
"convert": ["docx", "docxf", "dotx", "dotm", "epub", "fb2", "html", "odt", "ott", "pdf", "pdfa", "rtf", "txt"],
|
||||
"mime": "application/vnd.ms-word.document.macroEnabled.12"
|
||||
},
|
||||
{
|
||||
"name": "docx",
|
||||
"type": "word",
|
||||
"actions": ["view", "edit", "fill"],
|
||||
"convert": ["docxf", "docm", "dotx", "dotm", "epub", "fb2", "html", "odt", "ott", "pdf", "pdfa", "rtf", "txt"],
|
||||
"mime": "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
|
||||
},
|
||||
{
|
||||
"name": "docxf",
|
||||
"type": "word",
|
||||
"actions": ["view", "edit"],
|
||||
"convert": ["docx", "oform", "docm", "dotx", "dotm", "epub", "fb2", "html", "odt", "ott", "pdf", "pdfa", "rtf", "txt"],
|
||||
"mime": "application/vnd.openxmlformats-officedocument.wordprocessingml.document.docxf"
|
||||
},
|
||||
{
|
||||
"name": "oform",
|
||||
"type": "word",
|
||||
"actions": ["view", "fill"],
|
||||
"convert": ["pdf"],
|
||||
"mime": "application/vnd.openxmlformats-officedocument.wordprocessingml.document.oform"
|
||||
},
|
||||
{
|
||||
"name": "dot",
|
||||
"type": "word",
|
||||
"actions": ["view", "edit"],
|
||||
"convert": ["docx", "docxf", "docm", "dotx", "dotm", "epub", "fb2", "html", "odt", "ott", "pdf", "pdfa", "rtf", "txt"],
|
||||
"mime": "application/msword"
|
||||
},
|
||||
{
|
||||
"name": "dotm",
|
||||
"type": "word",
|
||||
"actions": ["view", "edit"],
|
||||
"convert": ["docx", "docxf", "docm", "dotx", "epub", "fb2", "html", "odt", "ott", "pdf", "pdfa", "rtf", "txt"],
|
||||
"mime": "application/vnd.ms-word.template.macroEnabled.12"
|
||||
},
|
||||
{
|
||||
"name": "dotx",
|
||||
"type": "word",
|
||||
"actions": ["view", "edit"],
|
||||
"convert": ["docx", "docxf", "docm", "dotm", "epub", "fb2", "html", "odt", "ott", "pdf", "pdfa", "rtf", "txt"],
|
||||
"mime": "application/vnd.openxmlformats-officedocument.wordprocessingml.template"
|
||||
},
|
||||
{
|
||||
"name": "epub",
|
||||
"type": "word",
|
||||
"actions": ["view", "lossy-edit"],
|
||||
"convert": ["docx", "docxf", "docm", "dotx", "dotm", "fb2", "html", "odt", "ott", "pdf", "pdfa", "rtf", "txt"],
|
||||
"mime": "application/epub+zip"
|
||||
},
|
||||
{
|
||||
"name": "fb2",
|
||||
"type": "word",
|
||||
"actions": ["view", "lossy-edit"],
|
||||
"convert": ["docx", "docxf", "docm", "dotx", "dotm", "epub", "html", "odt", "ott", "pdf", "pdfa", "rtf", "txt"],
|
||||
"mime": "text/fb2+xml"
|
||||
},
|
||||
{
|
||||
"name": "fodt",
|
||||
"type": "word",
|
||||
"actions": ["view", "edit"],
|
||||
"convert": ["docx", "docxf", "docm", "dotx", "dotm", "epub", "fb2", "html", "odt", "ott", "pdf", "pdfa", "rtf", "txt"],
|
||||
"mime": "application/vnd.oasis.opendocument.text"
|
||||
},
|
||||
{
|
||||
"name": "htm",
|
||||
"type": "word",
|
||||
"actions": ["view", "edit"],
|
||||
"convert": [],
|
||||
"mime": null
|
||||
},
|
||||
{
|
||||
"name": "html",
|
||||
"type": "word",
|
||||
"actions": ["view", "lossy-edit"],
|
||||
"convert": ["docx", "docxf", "docm", "dotx", "dotm", "epub", "fb2", "odt", "ott", "pdf", "pdfa", "rtf", "txt"],
|
||||
"mime": "text/html"
|
||||
},
|
||||
{
|
||||
"name": "mht",
|
||||
"type": "word",
|
||||
"actions": ["view", "edit"],
|
||||
"convert": [],
|
||||
"mime": null
|
||||
},
|
||||
{
|
||||
"name": "mhtml",
|
||||
"type": "word",
|
||||
"actions": ["view", "edit"],
|
||||
"convert": [],
|
||||
"mime": null
|
||||
},
|
||||
{
|
||||
"name": "odt",
|
||||
"type": "word",
|
||||
"actions": ["view", "lossy-edit"],
|
||||
"convert": ["docx", "docxf", "docm", "dotx", "dotm", "epub", "fb2", "html", "ott", "pdf", "pdfa", "rtf", "txt"],
|
||||
"mime": "application/vnd.oasis.opendocument.text"
|
||||
},
|
||||
{
|
||||
"name": "ott",
|
||||
"type": "word",
|
||||
"actions": ["view", "lossy-edit"],
|
||||
"convert": ["docx", "docxf", "docm", "dotx", "dotm", "epub", "fb2", "html", "odt", "pdf", "pdfa", "rtf", "txt"],
|
||||
"mime": "application/vnd.oasis.opendocument.text-template"
|
||||
},
|
||||
{
|
||||
"name": "oxps",
|
||||
"type": "word",
|
||||
"actions": ["view"],
|
||||
"convert": ["pdf", "pdfa"],
|
||||
"mime": "application/oxps"
|
||||
},
|
||||
{
|
||||
"name": "pdf",
|
||||
"type": "word",
|
||||
"actions": ["view"],
|
||||
"convert": [],
|
||||
"mime": "application/pdf"
|
||||
},
|
||||
{
|
||||
"name": "rtf",
|
||||
"type": "word",
|
||||
"actions": ["view", "lossy-edit"],
|
||||
"convert": ["docx", "docxf", "docm", "dotx", "dotm", "epub", "fb2", "html", "odt", "ott", "pdf", "pdfa", "txt"],
|
||||
"mime": "text/rtf"
|
||||
},
|
||||
{
|
||||
"name": "stw",
|
||||
"type": "word",
|
||||
"actions": ["view", "edit"],
|
||||
"convert": [],
|
||||
"mime": null
|
||||
},
|
||||
{
|
||||
"name": "sxw",
|
||||
"type": "word",
|
||||
"actions": ["view", "edit"],
|
||||
"convert": [],
|
||||
"mime": null
|
||||
},
|
||||
{
|
||||
"name": "txt",
|
||||
"type": "word",
|
||||
"actions": ["view", "lossy-edit"],
|
||||
"convert": [],
|
||||
"mime": "text/plain"
|
||||
},
|
||||
{
|
||||
"name": "wps",
|
||||
"type": "word",
|
||||
"actions": ["view", "edit"],
|
||||
"convert": [],
|
||||
"mime": null
|
||||
},
|
||||
{
|
||||
"name": "wpt",
|
||||
"type": "word",
|
||||
"actions": ["view", "edit"],
|
||||
"convert": [],
|
||||
"mime": null
|
||||
},
|
||||
{
|
||||
"name": "xps",
|
||||
"type": "word",
|
||||
"actions": ["view"],
|
||||
"convert": ["pdf", "pdfa"],
|
||||
"mime": "application/vnd.ms-xpsdocument"
|
||||
},
|
||||
{
|
||||
"name": "xml",
|
||||
"type": "word",
|
||||
"actions": ["view", "edit"],
|
||||
"convert": ["docx", "docxf", "docm", "dotx", "dotm", "epub", "fb2", "html", "odt", "ott", "pdf", "pdfa", "rtf", "txt"],
|
||||
"mime": "application/xml"
|
||||
},
|
||||
{
|
||||
"name": "csv",
|
||||
"type": "cell",
|
||||
"actions": ["view", "lossy-edit"],
|
||||
"convert": [],
|
||||
"mime": "text/csv"
|
||||
},
|
||||
{
|
||||
"name": "et",
|
||||
"type": "cell",
|
||||
"actions": ["view", "edit"],
|
||||
"convert": [],
|
||||
"mime": null
|
||||
},
|
||||
{
|
||||
"name": "ett",
|
||||
"type": "cell",
|
||||
"actions": ["view", "edit"],
|
||||
"convert": [],
|
||||
"mime": null
|
||||
},
|
||||
{
|
||||
"name": "fods",
|
||||
"type": "cell",
|
||||
"actions": ["view", "edit"],
|
||||
"convert": ["xlsx", "csv", "ods", "ots", "pdf", "pdfa", "xltx", "xlsm", "xltm"],
|
||||
"mime": "application/vnd.oasis.opendocument.spreadsheet"
|
||||
},
|
||||
{
|
||||
"name": "ods",
|
||||
"type": "cell",
|
||||
"actions": ["view", "lossy-edit"],
|
||||
"convert": ["xlsx", "csv", "ots", "pdf", "pdfa", "xltx", "xlsm", "xltm"],
|
||||
"mime": "application/vnd.oasis.opendocument.spreadsheet"
|
||||
},
|
||||
{
|
||||
"name": "ots",
|
||||
"type": "cell",
|
||||
"actions": ["view", "lossy-edit"],
|
||||
"convert": ["xlsx", "csv", "ods", "pdf", "pdfa", "xltx", "xlsm", "xltm"],
|
||||
"mime": "application/vnd.oasis.opendocument.spreadsheet-template"
|
||||
},
|
||||
{
|
||||
"name": "sxc",
|
||||
"type": "cell",
|
||||
"actions": ["view", "edit"],
|
||||
"convert": [],
|
||||
"mime": null
|
||||
},
|
||||
{
|
||||
"name": "xls",
|
||||
"type": "cell",
|
||||
"actions": ["view", "edit"],
|
||||
"convert": ["xlsx", "csv", "ods", "ots", "pdf", "pdfa", "xltx", "xlsm", "xltm"],
|
||||
"mime": "application/vnd.ms-excel"
|
||||
},
|
||||
{
|
||||
"name": "xlsb",
|
||||
"type": "cell",
|
||||
"actions": ["view", "edit"],
|
||||
"convert": [],
|
||||
"mime": null
|
||||
},
|
||||
{
|
||||
"name": "xlsm",
|
||||
"type": "cell",
|
||||
"actions": ["view", "edit"],
|
||||
"convert": ["xlsx", "csv", "ods", "ots", "pdf", "pdfa", "xltx", "xltm"],
|
||||
"mime": "application/vnd.ms-excel.sheet.macroEnabled.12"
|
||||
},
|
||||
{
|
||||
"name": "xlsx",
|
||||
"type": "cell",
|
||||
"actions": ["view", "edit"],
|
||||
"convert": ["csv", "ods", "ots", "pdf", "pdfa", "xltx", "xlsm", "xltm"],
|
||||
"mime": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
||||
},
|
||||
{
|
||||
"name": "xlt",
|
||||
"type": "cell",
|
||||
"actions": ["view", "edit"],
|
||||
"convert": ["xlsx", "csv", "ods", "ots", "pdf", "pdfa", "xltx", "xlsm", "xltm"],
|
||||
"mime": "application/vnd.ms-excel"
|
||||
},
|
||||
{
|
||||
"name": "xltm",
|
||||
"type": "cell",
|
||||
"actions": ["view", "edit"],
|
||||
"convert": ["xlsx", "csv", "ods", "ots", "pdf", "pdfa", "xltx", "xlsm"],
|
||||
"mime": "application/vnd.ms-excel.template.macroenabled.12"
|
||||
},
|
||||
{
|
||||
"name": "xltx",
|
||||
"type": "cell",
|
||||
"actions": ["view", "edit"],
|
||||
"convert": [],
|
||||
"mime": null
|
||||
},
|
||||
{
|
||||
"name": "dps",
|
||||
"type": "slide",
|
||||
"actions": ["view", "edit"],
|
||||
"convert": [],
|
||||
"mime": null
|
||||
},
|
||||
{
|
||||
"name": "dpt",
|
||||
"type": "slide",
|
||||
"actions": ["view", "edit"],
|
||||
"convert": [],
|
||||
"mime": null
|
||||
},
|
||||
{
|
||||
"name": "fodp",
|
||||
"type": "slide",
|
||||
"actions": ["view", "edit"],
|
||||
"convert": ["pptx", "odp", "otp", "pdf", "pdfa", "potx", "pptm", "potm"],
|
||||
"mime": "application/vnd.oasis.opendocument.presentation"
|
||||
},
|
||||
{
|
||||
"name": "odp",
|
||||
"type": "slide",
|
||||
"actions": ["view", "lossy-edit"],
|
||||
"convert": ["pptx", "otp", "pdf", "pdfa", "potx", "pptm", "potm"],
|
||||
"mime": "application/vnd.oasis.opendocument.presentation"
|
||||
},
|
||||
{
|
||||
"name": "otp",
|
||||
"type": "slide",
|
||||
"actions": ["view", "lossy-edit"],
|
||||
"convert": ["pptx", "odp", "pdf", "pdfa", "potx", "pptm", "potm"],
|
||||
"mime": "application/vnd.oasis.opendocument.presentation-template"
|
||||
},
|
||||
{
|
||||
"name": "pot",
|
||||
"type": "slide",
|
||||
"actions": ["view", "edit"],
|
||||
"convert": ["pptx", "odp", "otp", "pdf", "pdfa", "potx", "pptm", "potm"],
|
||||
"mime": "application/vnd.ms-powerpoint"
|
||||
},
|
||||
{
|
||||
"name": "potm",
|
||||
"type": "slide",
|
||||
"actions": ["view", "edit"],
|
||||
"convert": ["pptx", "odp", "otp", "pdf", "pdfa", "potx", "pptm"],
|
||||
"mime": "application/vnd.ms-powerpoint.template.macroEnabled.12"
|
||||
},
|
||||
{
|
||||
"name": "potx",
|
||||
"type": "slide",
|
||||
"actions": ["view", "edit"],
|
||||
"convert": ["pptx", "odp", "otp", "pdf", "pdfa", "pptm", "potm"],
|
||||
"mime": "application/vnd.openxmlformats-officedocument.presentationml.template"
|
||||
},
|
||||
{
|
||||
"name": "pps",
|
||||
"type": "slide",
|
||||
"actions": ["view", "edit"],
|
||||
"convert": ["pptx", "odp", "otp", "pdf", "pdfa", "potx", "pptm", "potm"],
|
||||
"mime": "application/vnd.ms-powerpoint"
|
||||
},
|
||||
{
|
||||
"name": "ppsm",
|
||||
"type": "slide",
|
||||
"actions": ["view", "edit"],
|
||||
"convert": ["pptx", "odp", "otp", "pdf", "pdfa", "potx", "pptm", "potm"],
|
||||
"mime": "application/vnd.ms-powerpoint.slideshow.macroenabled.12"
|
||||
},
|
||||
{
|
||||
"name": "ppsx",
|
||||
"type": "slide",
|
||||
"actions": ["view", "edit"],
|
||||
"convert": ["pptx", "odp", "otp", "pdf", "pdfa", "potx", "pptm", "potm"],
|
||||
"mime": "application/vnd.openxmlformats-officedocument.presentationml.slideshow"
|
||||
},
|
||||
{
|
||||
"name": "ppt",
|
||||
"type": "slide",
|
||||
"actions": ["view", "edit"],
|
||||
"convert": ["pptx", "odp", "otp", "pdf", "pdfa", "potx", "pptm", "potm"],
|
||||
"mime": "application/vnd.ms-powerpoint"
|
||||
},
|
||||
{
|
||||
"name": "pptm",
|
||||
"type": "slide",
|
||||
"actions": ["view", "edit"],
|
||||
"convert": ["pptx", "odp", "otp", "pdf", "pdfa", "potx", "potm"],
|
||||
"mime": "application/vnd.ms-powerpoint.presentation.macroenabled.12"
|
||||
},
|
||||
{
|
||||
"name": "pptx",
|
||||
"type": "slide",
|
||||
"actions": ["view", "edit"],
|
||||
"convert": ["odp", "otp", "pdf", "pdfa", "potx", "pptm", "potm"],
|
||||
"mime": "application/vnd.openxmlformats-officedocument.presentationml.presentation"
|
||||
},
|
||||
{
|
||||
"name": "sxi",
|
||||
"type": "slide",
|
||||
"actions": ["view", "edit"],
|
||||
"convert": [],
|
||||
"mime": null
|
||||
}
|
||||
]
|
||||
@ -16,7 +16,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
const supportedFormats = require("../config/onlyoffice-docs-formats.json")
|
||||
const supportedFormats = require("../public/assets/document-formats/onlyoffice-docs-formats.json")
|
||||
const fileUtility = {};
|
||||
|
||||
// get file name from the given url
|
||||
|
||||
Reference in New Issue
Block a user