@trayio/commons
Advanced tools
Comparing version 4.51.0 to 4.52.0
@@ -7,6 +7,34 @@ /// <reference types="node" /> | ||
import { DynamicObject } from '../dynamictype/DynamicType'; | ||
export declare enum FileContentType { | ||
Text = "text/plain", | ||
Html = "text/html", | ||
Css = "text/css", | ||
Javascript = "application/javascript", | ||
Xml = "application/xml", | ||
Pdf = "application/pdf", | ||
Zip = "application/zip", | ||
Gif = "image/gif", | ||
Jpeg = "image/jpeg", | ||
Jpg = "image/jpg", | ||
Png = "image/png", | ||
Svg = "image/svg+xml", | ||
Bmp = "image/bmp", | ||
Webp = "image/webp", | ||
Ico = "image/x-icon", | ||
Tiff = "image/tiff", | ||
Heic = "image/heic", | ||
Heif = "image/heif", | ||
AudioMidi = "audio/midi", | ||
AudioMpeg = "audio/mpeg", | ||
AudioWebm = "audio/webm", | ||
AudioOgg = "audio/ogg", | ||
AudioWav = "audio/wav", | ||
VideoWebm = "video/webm", | ||
VideoOgg = "video/ogg", | ||
VideoMp4 = "video/mp4" | ||
} | ||
export type FileMetadata = { | ||
name: string; | ||
size?: number; | ||
contentType?: string; | ||
contentType?: FileContentType; | ||
}; | ||
@@ -13,0 +41,0 @@ export declare const fileMetadataDescriptor: t.Type<FileMetadata, unknown>; |
@@ -26,4 +26,64 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.FileDescriptor = exports.fileDescriptorDescriptor = exports.fileMetadataDescriptor = void 0; | ||
exports.FileDescriptor = exports.fileDescriptorDescriptor = exports.fileMetadataDescriptor = exports.FileContentType = void 0; | ||
const t = __importStar(require("io-ts")); | ||
var FileContentType; | ||
(function (FileContentType) { | ||
FileContentType["Text"] = "text/plain"; | ||
FileContentType["Html"] = "text/html"; | ||
FileContentType["Css"] = "text/css"; | ||
FileContentType["Javascript"] = "application/javascript"; | ||
FileContentType["Xml"] = "application/xml"; | ||
FileContentType["Pdf"] = "application/pdf"; | ||
FileContentType["Zip"] = "application/zip"; | ||
// Image types | ||
FileContentType["Gif"] = "image/gif"; | ||
FileContentType["Jpeg"] = "image/jpeg"; | ||
FileContentType["Jpg"] = "image/jpg"; | ||
FileContentType["Png"] = "image/png"; | ||
FileContentType["Svg"] = "image/svg+xml"; | ||
FileContentType["Bmp"] = "image/bmp"; | ||
FileContentType["Webp"] = "image/webp"; | ||
FileContentType["Ico"] = "image/x-icon"; | ||
FileContentType["Tiff"] = "image/tiff"; | ||
FileContentType["Heic"] = "image/heic"; | ||
FileContentType["Heif"] = "image/heif"; | ||
// Audio types | ||
FileContentType["AudioMidi"] = "audio/midi"; | ||
FileContentType["AudioMpeg"] = "audio/mpeg"; | ||
FileContentType["AudioWebm"] = "audio/webm"; | ||
FileContentType["AudioOgg"] = "audio/ogg"; | ||
FileContentType["AudioWav"] = "audio/wav"; | ||
// Video types | ||
FileContentType["VideoWebm"] = "video/webm"; | ||
FileContentType["VideoOgg"] = "video/ogg"; | ||
FileContentType["VideoMp4"] = "video/mp4"; | ||
})(FileContentType || (exports.FileContentType = FileContentType = {})); | ||
const contentTypeDescriptor = t.union([ | ||
t.literal(FileContentType.Text), | ||
t.literal(FileContentType.Html), | ||
t.literal(FileContentType.Css), | ||
t.literal(FileContentType.Javascript), | ||
t.literal(FileContentType.Xml), | ||
t.literal(FileContentType.Gif), | ||
t.literal(FileContentType.Jpeg), | ||
t.literal(FileContentType.Jpg), | ||
t.literal(FileContentType.Png), | ||
t.literal(FileContentType.Svg), | ||
t.literal(FileContentType.Pdf), | ||
t.literal(FileContentType.Zip), | ||
t.literal(FileContentType.Bmp), | ||
t.literal(FileContentType.Webp), | ||
t.literal(FileContentType.Ico), | ||
t.literal(FileContentType.Tiff), | ||
t.literal(FileContentType.Heic), | ||
t.literal(FileContentType.Heif), | ||
t.literal(FileContentType.AudioMidi), | ||
t.literal(FileContentType.AudioMpeg), | ||
t.literal(FileContentType.AudioWebm), | ||
t.literal(FileContentType.AudioOgg), | ||
t.literal(FileContentType.AudioWav), | ||
t.literal(FileContentType.VideoWebm), | ||
t.literal(FileContentType.VideoOgg), | ||
t.literal(FileContentType.VideoMp4), | ||
]); | ||
exports.fileMetadataDescriptor = t.intersection([ | ||
@@ -35,3 +95,3 @@ t.type({ | ||
size: t.number, | ||
contentType: t.string, | ||
contentType: contentTypeDescriptor, | ||
}), | ||
@@ -38,0 +98,0 @@ ]); |
@@ -58,3 +58,13 @@ /// <reference types="node" /> | ||
MultipartRequestBody = "multipart/form-data", | ||
Text = "text/plain" | ||
Text = "text/plain", | ||
Html = "text/html", | ||
Css = "text/css", | ||
Javascript = "application/javascript", | ||
Xml = "application/xml", | ||
Gif = "image/gif", | ||
Jpeg = "image/jpeg", | ||
Png = "image/png", | ||
Svg = "image/svg+xml", | ||
Pdf = "application/pdf", | ||
Zip = "application/zip" | ||
} | ||
@@ -61,0 +71,0 @@ export declare enum HttpHeader { |
@@ -85,2 +85,12 @@ "use strict"; | ||
HttpContentType["Text"] = "text/plain"; | ||
HttpContentType["Html"] = "text/html"; | ||
HttpContentType["Css"] = "text/css"; | ||
HttpContentType["Javascript"] = "application/javascript"; | ||
HttpContentType["Xml"] = "application/xml"; | ||
HttpContentType["Gif"] = "image/gif"; | ||
HttpContentType["Jpeg"] = "image/jpeg"; | ||
HttpContentType["Png"] = "image/png"; | ||
HttpContentType["Svg"] = "image/svg+xml"; | ||
HttpContentType["Pdf"] = "application/pdf"; | ||
HttpContentType["Zip"] = "application/zip"; | ||
})(HttpContentType || (exports.HttpContentType = HttpContentType = {})); | ||
@@ -87,0 +97,0 @@ var HttpHeader; |
{ | ||
"name": "@trayio/commons", | ||
"version": "4.51.0", | ||
"version": "4.52.0", | ||
"description": "Extensions to the standard/core libraries and basic features", | ||
@@ -5,0 +5,0 @@ "exports": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
227816
4715