fix libs location in test-run,add jpeg png support

This commit is contained in:
Sorawit Bholsithi 2023-10-10 00:23:42 +07:00
parent 8c3790bead
commit e43fabb216
14 changed files with 68 additions and 10 deletions

View file

@ -51,9 +51,14 @@ import { LibreOfficeFileConverter } from 'libreoffice-file-converter';
* schema:
* type: string
* format: binary
* text/html:
* image/png:
* schema:
* type: string
* format: binary
* image/jpeg:
* schema:
* type: string
* format: binary
* 500:
* description: Server error
*

View file

@ -50,8 +50,6 @@ export async function docxTemplateX(base: string=".", tdata: templateData, outpu
}
/** javascript-obfuscator:disable
* @swagger
* /api/v1/report-template/docx:
@ -117,6 +115,14 @@ docxTemplateRoute.get("/", async function (req, res) {
* schema:
* type: string
* format: binary
* image/png:
* schema:
* type: string
* format: binary
* image/jpeg:
* schema:
* type: string
* format: binary
* 500:
* description: Server error
*

View file

@ -23,7 +23,9 @@ export function mimeToExtension(mime: string): string {
"text/csv": "csv",
"text/markdown": "md",
"text/plain": "txt",
"application/rtf": "rtf"
"application/rtf": "rtf",
"image/png": "png",
"image/jpeg": "jpeg",
}
if (mimeList[mime]) {
return mimeList[mime]

View file

@ -85,6 +85,18 @@
"schema": {
"type": "string"
}
},
"image/png": {
"schema": {
"type": "string",
"format": "binary"
}
},
"image/jpeg": {
"schema": {
"type": "string",
"format": "binary"
}
}
}
},
@ -185,6 +197,18 @@
"type": "string",
"format": "binary"
}
},
"image/png": {
"schema": {
"type": "string",
"format": "binary"
}
},
"image/jpeg": {
"schema": {
"type": "string",
"format": "binary"
}
}
}
},
@ -301,6 +325,18 @@
"type": "string",
"format": "binary"
}
},
"image/png": {
"schema": {
"type": "string",
"format": "binary"
}
},
"image/jpeg": {
"schema": {
"type": "string",
"format": "binary"
}
}
}
},

View file

@ -104,6 +104,14 @@ xlsxTemplateRoute.get("/", async function (req, res) {
* schema:
* type: string
* format: binary
* image/png:
* schema:
* type: string
* format: binary
* image/jpeg:
* schema:
* type: string
* format: binary
* 500:
* description: Server error
*