diff --git a/package-lock.json b/package-lock.json index d434a34..1d6aed4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@oat-sa/tao-core-sdk", - "version": "1.1.1", + "version": "1.2.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -939,9 +939,9 @@ } }, "acorn": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.2.1.tgz", - "integrity": "sha512-JD0xT5FCRDNyjDda3Lrg/IxFscp9q4tiYtxE1/nOzlKCk7hIRuYjhq1kCNkbPjMRMZuFq20HNQn1I9k8Oj0E+Q==", + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz", + "integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==", "dev": true }, "acorn-jsx": { @@ -1486,13 +1486,6 @@ "integrity": "sha512-mmGt/1pZqYRjMxB1axhTo16/snVZ5krrKkcmMeVKxzECMMXoCgnvTPp10QgHfcbQZw8Dq2jMNG6je4JlWU0gWg==", "dev": true }, - "commander": { - "version": "2.20.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", - "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", - "dev": true, - "optional": true - }, "comment-parser": { "version": "0.5.5", "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-0.5.5.tgz", @@ -2383,9 +2376,9 @@ } }, "https-proxy-agent": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.2.tgz", - "integrity": "sha512-c8Ndjc9Bkpfx/vCJueCPy0jlP4ccCCSNDp8xwCZzPjKJUm+B+u9WX2x98Qx4n1PiMNTWo3D7KK5ifNV/yJyRzg==", + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz", + "integrity": "sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==", "dev": true, "requires": { "agent-base": "^4.3.0", @@ -2725,9 +2718,9 @@ }, "dependencies": { "handlebars": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.4.3.tgz", - "integrity": "sha512-B0W4A2U1ww3q7VVthTKfh+epHx+q4mCt6iK+zEAzbMBpWQAwxCeKxEGpj/1oQTpzPXDNSOG7hmG14TsISH50yw==", + "version": "4.7.3", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.3.tgz", + "integrity": "sha512-SRGwSYuNfx8DwHD/6InAPzD6RgeruWLT+B8e8a7gGs8FWgHzlExpTFMEq2IA6QpAfOClpKHy6+8IqTjeBCu6Kg==", "dev": true, "requires": { "neo-async": "^2.6.0", @@ -2759,14 +2752,23 @@ "dev": true }, "uglify-js": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.2.tgz", - "integrity": "sha512-+gh/xFte41GPrgSMJ/oJVq15zYmqr74pY9VoM69UzMzq9NFk4YDylclb1/bhEzZSaUQjbW5RvniHeq1cdtRYjw==", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.8.0.tgz", + "integrity": "sha512-ugNSTT8ierCsDHso2jkBHXYrU8Y5/fY2ZUprfrJUiD7YpuFvV4jODLFmb3h4btQjqr5Nh4TX4XtgDfCU1WdioQ==", "dev": true, "optional": true, "requires": { - "commander": "2.20.0", + "commander": "~2.20.3", "source-map": "~0.6.1" + }, + "dependencies": { + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true, + "optional": true + } } }, "wordwrap": { diff --git a/package.json b/package.json index 5ea31ae..66706c6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@oat-sa/tao-core-sdk", - "version": "1.1.1", + "version": "1.2.0", "displayName": "TAO Core SDK", "description": "Core libraries of TAO", "homepage": "https://github.com/oat-sa/tao-core-sdk-fe#readme", diff --git a/src/core/mimetype/categories.json b/src/core/mimetype/categories.json index b35f2aa..a7bb725 100644 --- a/src/core/mimetype/categories.json +++ b/src/core/mimetype/categories.json @@ -87,5 +87,15 @@ "generic" : { "category" : "generic", "mimes" : ["application/octet-stream", "application/force-download", "application/x-force-download"] + }, + "cpp" : { + "category": "sources", + "mimes" : ["text/x-c"], + "extensions": ["cpp"] + }, + "pas" : { + "category": "sources", + "mimes" : ["text/pascal"], + "extensions": ["pas"] } } diff --git a/src/core/mimetype/extensions.json b/src/core/mimetype/extensions.json index a13ad20..cbe726b 100644 --- a/src/core/mimetype/extensions.json +++ b/src/core/mimetype/extensions.json @@ -1,56 +1,57 @@ { - "txt" : "text/plain", - "htm" : "text/html", - "html" : "text/html", - "xhtml" : "application/xhtml+xml", - "php" : "text/html", - "css" : "text/css", - "js" : "application/javascript", - "json" : "application/json", - "xml" : "text/xml", - "rdf" : "text/xml", - "swf" : "application/x-shockwave-flash", - "flv" : "video/x-flv", - "csv" : "text/csv", - "rtx" : "text/richtext", - "rtf" : "text/rtf", - "png" : "image/png", - "jpe" : "image/jpeg", - "jpeg" : "image/jpeg", - "jpg" : "image/jpeg", - "gif" : "image/gif", - "bmp" : "image/bmp", - "ico" : "image/vnd.microsoft.icon", - "tiff" : "image/tiff", - "tif" : "image/tiff", - "svg" : "image/svg+xml", - "svgz" : "image/svg+xml", - "zip" : "application/zip", - "rar" : "application/x-rar-compressed", - "exe" : "application/x-msdownload", - "msi" : "application/x-msdownload", - "cab" : "application/vnd.ms-cab-compressed", - "mp3" : "audio/mpeg", - "oga" : "audio/ogg", - "ogg" : "audio/ogg", - "aac" : "audio/aac", - "qt" : "video/quicktime", - "mov" : "video/quicktime", - "mp4" : "video/mp4", - "webm" : "video/webm", - "ogv" : "video/ogg", - "pdf" : "application/pdf", - "psd" : "image/vnd.adobe.photoshop", - "ai" : "application/postscript", - "eps" : "application/postscript", - "ps" : "application/postscript", - "doc" : "application/msword", - "rtf" : "application/rtf", - "xls" : "application/vnd.ms-excel", - "ppt" : "application/vnd.ms-powerpoint", - "odt" : "application/vnd.oasis.opendocument.text", - "ods" : "application/vnd.oasis.opendocument.spreadsheet", - "woff" : "application/x-font-woff", - "eot" : "application/vnd.ms-fontobject", - "ttf" : "application/x-font-ttf" -} \ No newline at end of file + "txt": "text/plain", + "htm": "text/html", + "html": "text/html", + "xhtml": "application/xhtml+xml", + "php": "text/html", + "css": "text/css", + "js": "application/javascript", + "json": "application/json", + "xml": "text/xml", + "rdf": "text/xml", + "swf": "application/x-shockwave-flash", + "flv": "video/x-flv", + "csv": "text/csv", + "rtx": "text/richtext", + "png": "image/png", + "jpe": "image/jpeg", + "jpeg": "image/jpeg", + "jpg": "image/jpeg", + "gif": "image/gif", + "bmp": "image/bmp", + "ico": "image/vnd.microsoft.icon", + "tiff": "image/tiff", + "tif": "image/tiff", + "svg": "image/svg+xml", + "svgz": "image/svg+xml", + "zip": "application/zip", + "rar": "application/x-rar-compressed", + "exe": "application/x-msdownload", + "msi": "application/x-msdownload", + "cab": "application/vnd.ms-cab-compressed", + "mp3": "audio/mpeg", + "oga": "audio/ogg", + "ogg": "audio/ogg", + "aac": "audio/aac", + "qt": "video/quicktime", + "mov": "video/quicktime", + "mp4": "video/mp4", + "webm": "video/webm", + "ogv": "video/ogg", + "pdf": "application/pdf", + "psd": "image/vnd.adobe.photoshop", + "ai": "application/postscript", + "eps": "application/postscript", + "ps": "application/postscript", + "doc": "application/msword", + "rtf": "application/rtf", + "xls": "application/vnd.ms-excel", + "ppt": "application/vnd.ms-powerpoint", + "odt": "application/vnd.oasis.opendocument.text", + "ods": "application/vnd.oasis.opendocument.spreadsheet", + "woff": "application/x-font-woff", + "eot": "application/vnd.ms-fontobject", + "ttf": "application/x-font-ttf", + "cpp": "text/x-c", + "pas": "text/pascal" +} diff --git a/test/core/mimetype/test.js b/test/core/mimetype/test.js index 30287bd..4b324d5 100755 --- a/test/core/mimetype/test.js +++ b/test/core/mimetype/test.js @@ -96,6 +96,34 @@ define(['core/mimetype'], function(mimeType) { mime: 'application/octet-stream', equals: 'application/octet-stream', title: 'application/octet-stream bz2' + }, + { + filename: 'filename.bz2', + mime: 'application/octet-stream', + equals: 'application/octet-stream', + title: 'application/octet-stream bz2' + }, + { + filename: 'filename.odt', + mime: 'application/vnd.oasis.opendocument.text', + equals: 'application/vnd.oasis.opendocument.text', + title: 'application/vnd.oasis.opendocument.text odt' + }, + { + filename: 'filename.ods', + mime: 'application/vnd.oasis.opendocument.spreadsheet', + equals: 'application/vnd.oasis.opendocument.spreadsheet', + title: 'application/vnd.oasis.opendocument.spreadsheet ods' + }, + { + filename: 'filename.cpp', + equals: 'text/x-c', + title: 'text/x-c cpp' + }, + { + filename: 'filename.pas', + equals: 'text/pascal', + title: 'text/pascal pas' } ]) .test('getMimeType', function(data, assert) {