MemoryBinaryFile
Class: MemoryBinaryFile
Defined in: packages/core/src/services/binary.service.ts:282
BinaryFile backed by an in-memory Buffer
Extends
Constructors
Constructor
new MemoryBinaryFile(
buffer,info?):MemoryBinaryFile
Defined in: packages/core/src/services/binary.service.ts:293
Create a new MemoryBinaryFile
Parameters
buffer
string | Buffer<ArrayBufferLike>
the binary content
info?
Partial<BinaryFileInfo> = {}
optional file information
Returns
MemoryBinaryFile
Overrides
Properties
buffer
buffer:
Buffer
Defined in: packages/core/src/services/binary.service.ts:287
Content
challenge?
optionalchallenge?:string
Defined in: packages/core/src/services/binary.service.ts:164
Proof of possession of the content: hash of the content prefixed by 'WEBDA', computed by the client of the challenge and by the service on upload. Never persisted on a model nor sent to clients: it is not part of the schema of a binary attribute
Schema Ignore
Inherited from
hash?
optionalhash?:string
Defined in: packages/core/src/services/binary.service.ts:170
Will be computed by the service
hash of the content
Inherited from
metadata?
optionalmetadata?:object
Defined in: packages/core/src/services/binary.service.ts:174
Metadatas stored along with the binary
Inherited from
mimetype
mimetype:
string
Defined in: packages/core/src/services/binary.service.ts:157
Mimetype of the binary
Inherited from
name
name:
string
Defined in: packages/core/src/services/binary.service.ts:145
Current name
Inherited from
originalname?
optionaloriginalname?:string
Defined in: packages/core/src/services/binary.service.ts:149
Original name
Inherited from
size
size:
number
Defined in: packages/core/src/services/binary.service.ts:153
Size of the binary
Inherited from
Methods
computeHashes()
computeHashes():
Promise<{challenge:string;hash:string; }>
Defined in: packages/core/src/services/binary.service.ts:220
Compute the hashes from the content, whatever hash or challenge is already set
The hash is the md5 of the bytes, the challenge the md5 of "WEBDA" followed by the bytes
Returns
Promise<{ challenge: string; hash: string; }>
the computed hash and challenge
Inherited from
get()
get():
Promise<Readable>
Defined in: packages/core/src/services/binary.service.ts:306
Returns
Promise<Readable>
Overrides
getHashes()
getHashes():
Promise<{challenge:string;hash:string; }>
Defined in: packages/core/src/services/binary.service.ts:241
Create hashes, computed from the content unless a hash is already set
Returns
Promise<{ challenge: string; hash: string; }>
the result
Inherited from
set()
set(
info):void
Defined in: packages/core/src/services/binary.service.ts:187
Set the information
Parameters
info
BinaryFileInfo<{ }>
the information object
Returns
void
Inherited from
toBinaryFileInfo()
toBinaryFileInfo():
BinaryFileInfo<{ }>
Defined in: packages/core/src/services/binary.service.ts:200
Retrieve a plain BinaryFileInfo object
Returns
BinaryFileInfo<{ }>
the result