IFileModuleService
The main service interface for the File Module.
Methods
create
**create**(data, sharedContext?): Promise<[FileDTO](types.FileTypes.FileDTO.mdx)[]>
This method uploads files to the designated file storage system.
Example
Parameters
The files to be created.
Returns
The created files.
**create**(data, sharedContext?): Promise<[FileDTO](types.FileTypes.FileDTO.mdx)>
This method uploads a file to the designated file storage system.
Example
Parameters
The file to be created.
Returns
The created file.
delete
**delete**(ids, sharedContext?): Promise<void>
This method deletes files by their IDs.
Example
Parameters
ids
string[]RequiredReturns
Promise
Promise<void>Required**delete**(id, sharedContext?): Promise<void>
This method deletes a file by its ID.
Example
Parameters
id
stringRequiredReturns
Promise
Promise<void>Requiredretrieve
This method retrieves a file with a downloadable URL by its ID.
Example
Parameters
id
stringRequiredconfig
FindConfig<FileDTO>The configurations determining how the file is retrieved. Its properties, such as select
or relations
, accept the
attributes or relations associated with a file.
config
FindConfig<FileDTO>select
or relations
, accept the
attributes or relations associated with a file.Returns
The retrieved file.
list
This method is used to retrieve a file by ID, similarly to retrieve
. Enumeration of files is not supported, but the list method is in order to support remote queries
Parameters
filters
FilterableFilePropsThe filters to apply on the retrieved files.
filters
FilterableFilePropsconfig
FindConfig<FileDTO>The configurations determining how the files are retrieved. Its properties, such as select
or relations
, accept the
attributes or relations associated with a file.
config
FindConfig<FileDTO>select
or relations
, accept the
attributes or relations associated with a file.Returns
The list of files. In this particular case, it will either be at most one file.
listAndCount
This method is used to retrieve a file by ID, similarly to retrieve
. Enumeration of files is not supported, but the listAndCount method is in order to support remote queries
Parameters
filters
FilterableFilePropsThe filters to apply on the retrieved files.
filters
FilterableFilePropsconfig
FindConfig<FileDTO>The configurations determining how the files are retrieved. Its properties, such as select
or relations
, accept the
attributes or relations associated with a file.
config
FindConfig<FileDTO>select
or relations
, accept the
attributes or relations associated with a file.