Repository navigation
services filesRouteService
Baasic Files Route Service provides Baasic route templates which can be expanded to Baasic REST URIs. Various services can use Baasic Files Route Service to obtain needed routes while other routes will be obtained through HAL. By convention, all route services use the same function names as their corresponding services.
Parses find route which can be expanded with additional options. Supported items are:
-
searchQuery- A string referencing file properties using the phrase search. -
page- A value used to set the page number, i.e. to retrieve certain file subset from the storage. -
rpp- A value used to limit the size of result set per page. -
sort- A string used to set the file property to sort the result collection by. -
embed- Comma separated list of resources to be contained within the current representation.
Example:
baasicFilesRouteService.find.expand(
{searchQuery: '<search-phrase>'}
); Parses get route; this route should be expanded with the Id of the file resource.
Example:
baasicFilesRouteService.get.expand(
{id: '<file-id>'}
); Parses link route; this URI template does not expose any additional options.
Example:
baasicFilesRouteService.link.expand({}); Parses get route; this route should be expanded with id or path of desired file stream. Additional supported items are:
-
width- width of desired derived image. -
height- height of desired derived image.
Example:
baasicFilesRouteService.streams.get.expand(
{id: '<path>'}
); Parses create route; this route should be expanded with the path which indicates where the stream will be saved.
Example:
baasicFilesRouteService.streams.create.expand(
{path: '<path>'}
); Parses update route; this route should be expanded with the id or path of the previously saved resource. Additional supported items are:
-
width- width of derived image to update. -
height- height of derived image to update.
Example:
baasicFilesRouteService.streams.update.expand(
{id: '<path>'}
); Parses unlink route; this URI template does not expose any additional options.
Example:
baasicFilesRouteService.batch.unlink.expand({}); Parses update route; this URI template does not expose any additional options.
Example:
baasicFilesRouteService.batch.update.expand({}); Parses update route; this URI template does not expose any additional options.
Example:
baasicFilesRouteService.batch.link.expand({}); Parses get acl route; this URI template should be expanded with the Id of the file resource.
Example:
baasicFilesRouteService.acl.get.expand(
{id: '<file-id>'}
);Parses update acl route; this URI template should be expanded with the Id of the file resource.
Example:
baasicFilesRouteService.acl.update.expand(
{id: '<file-id>'}
);Parses deleteByUser acl route which can be expanded with additional options. Supported items are:
-
id- File id which uniquely identifies file resource whose security privileges need to be retrieved and updated. -
accessAction- Action abbreviation which identifies ACL policy assigned to the specified user and file resource. -
user- A value which uniquely identifies user for which ACL policy needs to be removed.
Example:
baasicFilesRouteService.acl.deleteByUser.expand({
id: '<file-id>',
accessAction: '<access-action>',
user: '<username>'
});Parses deleteByUser acl route which can be expanded with additional options. Supported items are:
-
id- File id which uniquely identifies file resource whose security privileges need to be retrieved and updated. -
accessAction- Action abbreviation which identifies ACL policy assigned to the specified role and file resource. -
role- A value which uniquely identifies role for which ACL policy needs to be removed.
Example:
baasicFilesRouteService.acl.deleteByRole.expand({
id: '<file-id>',
accessAction: '<access-action>',
role: '<role-name>'
});Parses and expands URI templates based on RFC6570 specifications. For more information please visit the project GitHub page.
Example:
baasicFilesRouteService.parse(
'<route>/{?embed,fields,options}'
).expand(
{embed: '<embedded-resource>'}
);Notes:
- Refer to the REST API documentation for detailed information about available Baasic REST API end-points.
- URI Template syntax enables expanding the Baasic route templates to Baasic REST URIs providing it with an object that contains URI parameters.
- All end-point objects are transformed by the associated route service.
(c) 2017 Mono Ltd.
Version: 1.0.0
Author: Mono Ltd.
License: MIT
Baasic Files Navigation