@trayio/commons
Advanced tools
Comparing version 4.44.0 to 4.45.0
@@ -56,3 +56,3 @@ "use strict"; | ||
key, | ||
metadata: { name: key }, | ||
metadata: {}, | ||
content: stream_1.Readable.from(''), | ||
@@ -59,0 +59,0 @@ }), (error) => new Error(error))), TE.map(() => undefined)); |
@@ -8,3 +8,2 @@ /// <reference types="node" /> | ||
export type FileMetadata = { | ||
name: string; | ||
size?: number; | ||
@@ -11,0 +10,0 @@ contentType?: string; |
@@ -28,10 +28,5 @@ "use strict"; | ||
const t = __importStar(require("io-ts")); | ||
exports.fileMetadataDescriptor = t.intersection([ | ||
t.type({ | ||
name: t.string, | ||
}), | ||
t.partial({ | ||
size: t.number, | ||
contentType: t.string, | ||
}), | ||
], 'FileMetadata'); | ||
exports.fileMetadataDescriptor = t.partial({ | ||
size: t.number, | ||
contentType: t.string, | ||
}); |
@@ -48,5 +48,3 @@ "use strict"; | ||
key: fileName, | ||
metadata: { | ||
name: fileName, | ||
}, | ||
metadata: {}, | ||
content: readableStream, | ||
@@ -53,0 +51,0 @@ }; |
@@ -11,3 +11,3 @@ /// <reference types="node" /> | ||
write(file: File, writeOptions?: O.Option<DynamicObject>): TE.TaskEither<Error, File>; | ||
read(key: string, name?: string): TE.TaskEither<Error, File>; | ||
read(key: string): TE.TaskEither<Error, File>; | ||
getSharedUrl(key: string): TE.TaskEither<Error, SharedUrl>; | ||
@@ -14,0 +14,0 @@ delete(key: string): TE.TaskEither<Error, undefined>; |
@@ -46,5 +46,3 @@ "use strict"; | ||
key: fileName, | ||
metadata: { | ||
name: fileName, | ||
}, | ||
metadata: {}, | ||
content: readableStream, | ||
@@ -63,5 +61,3 @@ }; | ||
key: fileName, | ||
metadata: { | ||
name: fileName, | ||
}, | ||
metadata: {}, | ||
content: appendReadableStream, | ||
@@ -68,0 +64,0 @@ }; |
@@ -44,3 +44,3 @@ "use strict"; | ||
} | ||
read(key, name = key) { | ||
read(key) { | ||
const filePath = `${this.basePath}/${key}`; | ||
@@ -52,3 +52,2 @@ return TE.tryCatch(async () => { | ||
const metadata = { | ||
name, | ||
size: stat.size, | ||
@@ -55,0 +54,0 @@ }; |
@@ -50,3 +50,4 @@ /// <reference types="node" /> | ||
UserAgent = "User-Agent", | ||
ContentLength = "Content-Length" | ||
ContentLength = "Content-Length", | ||
ContentDisposition = "Content-Disposition" | ||
} | ||
@@ -53,0 +54,0 @@ export interface HttpHeadersInterface { |
@@ -62,2 +62,3 @@ "use strict"; | ||
HttpHeader["ContentLength"] = "Content-Length"; | ||
HttpHeader["ContentDisposition"] = "Content-Disposition"; | ||
})(HttpHeader || (exports.HttpHeader = HttpHeader = {})); | ||
@@ -64,0 +65,0 @@ exports.HttpHeaders = { |
@@ -133,3 +133,2 @@ "use strict"; | ||
metadata: { | ||
name: file.originalFilename ?? '', | ||
size: file.size, | ||
@@ -235,5 +234,3 @@ }, | ||
key: 'file1', | ||
metadata: { | ||
name: 'file1', | ||
}, | ||
metadata: {}, | ||
content: stream_1.Readable.from('file 1 content'), | ||
@@ -243,5 +240,3 @@ })(); | ||
key: 'file2', | ||
metadata: { | ||
name: 'file2', | ||
}, | ||
metadata: {}, | ||
content: stream_1.Readable.from('file 2 content'), | ||
@@ -263,5 +258,3 @@ })(); | ||
key: 'file1', | ||
metadata: { | ||
name: 'file1', | ||
}, | ||
metadata: {}, | ||
content: stream_1.Readable.from('Hello world'), | ||
@@ -271,5 +264,3 @@ }, | ||
key: 'file2', | ||
metadata: { | ||
name: 'file2', | ||
}, | ||
metadata: {}, | ||
content: stream_1.Readable.from('Hello world'), | ||
@@ -295,11 +286,7 @@ }, | ||
key: expect.any(String), | ||
metadata: expect.objectContaining({ | ||
name: 'file1', | ||
}), | ||
metadata: expect.objectContaining({}), | ||
}), | ||
file2: expect.objectContaining({ | ||
key: expect.any(String), | ||
metadata: expect.objectContaining({ | ||
name: 'file2', | ||
}), | ||
metadata: expect.objectContaining({}), | ||
}), | ||
@@ -306,0 +293,0 @@ }), |
{ | ||
"name": "@trayio/commons", | ||
"version": "4.44.0", | ||
"version": "4.45.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
Sorry, the diff of this file is not supported yet
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
201243
4147