baasic-sdk-javascript
Version:
JavaScript SDK provides core functionality for building web and mobile applications on [Baasic](http://www.baasic.com/).
59 lines (58 loc) • 3.62 kB
TypeScript
/**
* @module dynamicResourceRoute
* @description Baasic Dynamic Resource Route Definition provides Baasic route templates which can be expanded to Baasic REST URIs. Various services can use Baasic Dynamic Resource Route Definition 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.
*/
import { BaseRoute } from '../../common';
import { IGetRequestOptions, IOptions, IQueryOptions } from '../../common/contracts';
import { DynamicResourceACLRoute, DynamicSchemaRoute } from './';
import { IAppOptions } from '../../core/contracts';
export declare class DynamicResourceRoute extends BaseRoute {
protected appOptions: IAppOptions;
protected dynamicResourceACLRoute: DynamicResourceACLRoute;
protected dynamicSchemaRoute: DynamicSchemaRoute;
readonly findRoute: string;
readonly getRoute: string;
readonly createRoute: string;
readonly updateRoute: string;
readonly patchRoute: string;
readonly deleteRoute: string;
readonly purgeRoute: string;
readonly acl: DynamicResourceACLRoute;
readonly dynamicSchema: DynamicSchemaRoute;
constructor(appOptions: IAppOptions, dynamicResourceACLRoute: DynamicResourceACLRoute, dynamicSchemaRoute: DynamicSchemaRoute);
/**
* Parses find route which can be expanded with additional options. Supported items are:
* - `schemaName` - Name of the dynamic resource schema.
* - `searchQuery` - A string referencing dynamic resource properties using the phrase or BQL (Baasic Query Language) search.
* - `page` - A value used to set the page number, i.e. to retrieve certain dynamic resource subset from the storage.
* - `rpp` - A value used to limit the size of result set per page.
* - `sort` - A string used to set the dynamic resource property to sort the result collection by.
* - `embed` - Comma separated list of resources to be contained within the current representation.
* @method
* @param options query resource options object
* @example dynamicResourceRoute.find(options);
**/
find(schemaName: string, options: IOptions): any;
/**
* Parses get route which must be expanded with the name of the previously created dynamic resource schema in the system and the Id of the previously created dynamic resource. Additional expand supported items are:
* - `embed` - Comma separated list of resources to be contained within the current representation.
* @method
* @param id Unique identifier of dynamic resources
* @param schemaName schema name
* @param options query resource options object
* @example dynamicResourceRoute.get(id, schemaName, options);
**/
get(id: string, schemaName: string, options?: IGetRequestOptions): any;
create(schemaName: string): any;
update(schemaName: string, data: any, options?: IQueryOptions): any;
patch(schemaName: string, data: any, options?: any): any;
delete(schemaName: string, data: any, options?: any): any;
purge(schemaName: string): any;
}
/**
* @overview
***Notes:**
- Refer to the [Baasic REST API](http://dev.baasic.com/api/reference/home) for detailed information about available Baasic REST API end-points.
- [URI Template](https://github.com/Baasic/uritemplate-js) 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 definition.
*/