baasic-sdk-angular
Version:
Angular (v5+) SDK provides core functionality for building web and mobile applications on [Baasic](http://www.baasic.com/).
94 lines (93 loc) • 6.01 kB
TypeScript
import { BaasicAppService } from '../index';
import { IBaasicQueryModel, IGetRequestOptions, IHttpResponse, IOptions } from '../../infrastructure/common/contracts';
import { IMediaEntry, IMediaVaultBatchService, IMediaVaultProcessingProviderSettingsService, IMediaVaultSettingsService, IMediaVaultStreamsService } from './contracts';
export declare class MediaVaultService {
private baasicApp;
constructor(baasicApp: BaasicAppService);
/**
* Returns a promise that is resolved once the find action has been performed. Success response returns a list of media vault resources matching the given criteria.
* @method
* @param options Query resource options object.
* @returns A promise that is resolved once the find action has been performed.
* @example MediaVaultService.find({
pageNumber : 1,
pageSize : 10,
orderBy : '<field>',
orderDirection : '<asc|desc>',
search : '<search-phrase>'
})
.then(function (collection) {
// perform success action here
},
function (response, status, headers, config) {
// perform error handling here
});
**/
find(options?: IOptions): PromiseLike<IHttpResponse<IBaasicQueryModel<IMediaEntry>>>;
/**
* Returns a promise that is resolved once the get action has been performed. Success response returns requested media vault resource.
* @method
* @param id Media vault id which uniquely identifies media vault resource that needs to be retrieved.
* @param options Query resource options object.
* @returns A promise that is resolved once the get action has been performed.
* @example MediaVaultService.get('<media-vault-id>')
.then(function (data) {
// perform success action here
},
function (response, status, headers, config) {
// perform error handling here
});
**/
get(id: string, options?: IGetRequestOptions): PromiseLike<IHttpResponse<IMediaEntry>>;
/**
* Returns a promise that is resolved once the update media vault action has been performed; this action will update a media vault resource if successfully completed. This route uses HAL enabled objects to obtain routes and therefore it doesn't apply `baasicMediaVaultRouteDefinition` route template. Here is an example of how a route can be obtained from HAL enabled objects:
* ```
* let params = modelMapper.updateParams(mediaVaultEntry);
* let uri = params['model'].links('put').href;
* ```
* @method
* @param data A media vault object used to update specified media vault resource.
* @returns A promise that is resolved once the update media vault action has been performed.
* @example // mediaVaultEntry is a media vault resource previously fetched using get action.
mediaVaultEntry.description = '<description>';
MediaVaultService.update(mediaVaultEntry)
.then(function (data) {
// perform success action here
},
function (response, status, headers, config) {
// perform error handling here
});
**/
update(data: IMediaEntry): PromiseLike<IHttpResponse<void>>;
/**
* Returns a promise that is resolved once the remove action has been performed. This action will remove one or many media vault resources from the system if successfully completed. If derived resource's format is passed, such as `width` and `height` for the image type of media vault resource, the operation will remove just derived resource. Otherwise, specified media vault and all its accompanying derived resources will be removed from the system. This route uses HAL enabled objects to obtain routes and therefore it doesn't apply baasicMediaVaultRouteService route template. Here is an example of how a route can be obtained from HAL enabled objects:
* ```
* let params = modelMapper.removeParams(mediaVaultEntry);
* let uri = params['model'].links('delete').href;
* ```
* @method
* @param data Media vault object used to delete specific Media vault resource from the system.
* @param options Options object.
* @example // mediaVaultEntry is a media vault resource previously fetched using get action. The following action will remove the original media vault resource and all accompanying derived media vault resources.
MediaVaultService.remove(mediaVaultEntry)
.then(function (data) {
// perform success action here
},
function (response, status, headers, config) {
// perform error handling here
});
// mediaVaultEntry is a media vault resource previously fetched using get action. The following action will remove derived media vault resource only.
MediaVaultService.remove(mediaVaultEntry, {width: <width>, height: <height>})
.then(function (data) {
// perform success action here
},
function (response, status, headers, config) {
// perform error handling here
});
**/
remove(data: IMediaEntry, options: Object): PromiseLike<IHttpResponse<void>>;
readonly batch: IMediaVaultBatchService;
readonly streams: IMediaVaultStreamsService;
readonly settings: IMediaVaultSettingsService;
readonly processingProviderSettings: IMediaVaultProcessingProviderSettingsService;
}