baasic-sdk-javascript
Version:
JavaScript SDK provides core functionality for building web and mobile applications on [Baasic](http://www.baasic.com/).
174 lines (173 loc) • 9.46 kB
JavaScript
"use strict";
/* globals module */
/**
* @module articleCommentRepliesRoute
* @description Baasic Article Comment Replies Route Definition provides Baasic route templates which can be expanded to Baasic REST URIs. Various services can use Baasic Article Comment Replies 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.
*/
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var inversify_1 = require("inversify");
var common_1 = require("../../common");
;
var contracts_1 = require("../../core/contracts");
var ArticleCommentRepliesRoute = /** @class */ (function (_super) {
tslib_1.__extends(ArticleCommentRepliesRoute, _super);
function ArticleCommentRepliesRoute(appOptions) {
var _this = _super.call(this, appOptions) || this;
_this.appOptions = appOptions;
_this.findRoute = 'article-comment-replies/{?searchQuery,statuses,page,rpp,sort,embed,fields}';
_this.getRoute = 'article-comment-replies/{id}/{?embed,fields}';
_this.createRoute = 'article-comment-replies';
_this.updateRoute = 'article-comment-replies/{id}';
_this.deleteRoute = 'article-comment-replies/{id}';
_this.approveRoute = 'article-comment-replies/{id}/approve';
_this.unapproveRoute = 'article-comment-replies/{id}/unapprove';
_this.flagRoute = 'article-comment-replies/{id}/flag';
_this.unflagRoute = 'article-comment-replies/{id}/unflag';
_this.reportRoute = 'article-comment-replies/{id}/report';
_this.unreportRoute = 'article-comment-replies/{id}/unreport';
_this.spamRoute = 'article-comment-replies/{id}/spam';
_this.unspamRoute = 'article-comment-replies/{id}/unspam';
return _this;
}
/**
* Parses find route which can be expanded with additional options. Supported items are:
* - `searchQuery` - A string value used to identify article comment reply resources using the phrase search.
* - `page` - A value used to set the page number, i.e. to retrieve certain article comment reply subset from the storage.
* - `rpp` - A value used to limit the size of result set per page.
* - `sort` - A string used to set the article comment reply property to sort the result collection by.
* - `embed` - Comma separated list of resources to be contained within the current representation.
* - `statuses` - Comma separated list of article comment reply states that specify where search should be done (Allowed states: Approved, Spam, Reported, Flagged and UnApproved).
* @method
* @param options Query resource options object.
* @example articleCommentRepliesRoute.find({ searchQuery: '<search-phrase>' });
**/
ArticleCommentRepliesRoute.prototype.find = function (options) {
return _super.prototype.baseFind.call(this, this.findRoute, options);
};
/**
* Parses get route which can be expanded with additional options. Supported items are:
* - `id` - Id which uniquely identifies article comment reply resource that needs to be retrieved.
* - `embed` - Comma separated list of resources to be contained within the current representation.
* @method
* @param id Id which uniquely identifies article comment reply resource that needs to be retrieved.
* @param options Options object that contains embed data.
* @example articleCommentRepliesRoute.get({ id: '<comment-reply-id>' });
**/
ArticleCommentRepliesRoute.prototype.get = function (id, options) {
return _super.prototype.baseGet.call(this, this.getRoute, id, options);
};
/**
* Parses create article comment reply route; this URI template does not support any additional items.
* @method
* @param data An article comment reply object that needs to be inserted into the system.
* @example articleCommentRepliesRoute.create(data);
**/
ArticleCommentRepliesRoute.prototype.create = function (data) {
return _super.prototype.baseCreate.call(this, this.createRoute, data);
};
/**
* Parses update article comment reply route; this URI template does not support any additional items.
* @method
* @param data An Article Comments Reply object used to update specified article comment reply resource.
* @example articleCommentRepliesRoute.update(data);
**/
ArticleCommentRepliesRoute.prototype.update = function (data) {
return _super.prototype.baseUpdate.call(this, this.updateRoute, data);
};
/**
* Parses delete article comment reply route; this URI template does not support any additional items.
* @method
* @param data Article Comment Reply object.
* @example articleCommentRepliesRoute.delete(data);
**/
ArticleCommentRepliesRoute.prototype.delete = function (data) {
return _super.prototype.baseDelete.call(this, this.deleteRoute, data);
};
/**
* Parses approve article comment reply route; this URI template does not support any additional items.
* @method
* @param data Article Comment Reply object.
* @example articleCommentRepliesRoute.approve(data);
**/
ArticleCommentRepliesRoute.prototype.approve = function (data) {
return _super.prototype.baseUpdate.call(this, this.approveRoute, data, undefined, 'comment-approve');
};
/**
* Parses unapprove article comment reply route; this URI template does not support any additional items.
* @method
* @param data Article Comment Reply object.
* @example articleCommentRepliesRoute.unapprove(data);
**/
ArticleCommentRepliesRoute.prototype.unapprove = function (data) {
return _super.prototype.baseUpdate.call(this, this.unapproveRoute, data, undefined, 'comment-unapprove');
};
/**
* Parses flag article comment reply route; this URI template does not support any additional items.
* @method
* @param data Article Comment Reply object.
* @example articleCommentRepliesRoute.flag(data);
**/
ArticleCommentRepliesRoute.prototype.flag = function (data) {
return _super.prototype.baseUpdate.call(this, this.flagRoute, data, undefined, 'comment-flag');
};
/**
* Parses unflag article comment reply route; this URI template does not support any additional items.
* @method
* @param data Article Comment Reply object.
* @example articleCommentRepliesRoute.unflag(data);
**/
ArticleCommentRepliesRoute.prototype.unflag = function (data) {
return _super.prototype.baseUpdate.call(this, this.unflagRoute, data, undefined, 'comment-unflag');
};
/**
* Parses report article comment reply route; this URI template does not support any additional items.
* @method
* @param data Article Comment Reply object.
* @example articleCommentRepliesRoute.report(data);
**/
ArticleCommentRepliesRoute.prototype.report = function (data) {
return _super.prototype.baseUpdate.call(this, this.reportRoute, data, undefined, 'comment-report');
};
/**
* Parses unreport article comment reply route; this URI template does not support any additional items.
* @method
* @param data Article Comment Reply object.
* @example articleCommentRepliesRoute.unreport(data);
**/
ArticleCommentRepliesRoute.prototype.unreport = function (data) {
return _super.prototype.baseUpdate.call(this, this.unreportRoute, data, undefined, 'comment-unreport');
};
/**
* Parses spam article comment reply route; this URI template does not support any additional items.
* @method
* @param data Article Comment Reply object.
* @example articleCommentRepliesRoute.spam(data);
**/
ArticleCommentRepliesRoute.prototype.spam = function (data) {
return _super.prototype.baseUpdate.call(this, this.spamRoute, data, undefined, 'comment-spam');
};
/**
* Parses unspam article comment reply route; this URI template does not support any additional items.
* @method
* @param data Article Comment Reply object.
* @example articleCommentRepliesRoute.unspam(data);
**/
ArticleCommentRepliesRoute.prototype.unspam = function (data) {
return _super.prototype.baseUpdate.call(this, this.unspamRoute, data, undefined, 'comment-unspam');
};
ArticleCommentRepliesRoute = tslib_1.__decorate([
inversify_1.injectable(),
tslib_1.__param(0, inversify_1.inject(contracts_1.TYPES.IAppOptions)),
tslib_1.__metadata("design:paramtypes", [Object])
], ArticleCommentRepliesRoute);
return ArticleCommentRepliesRoute;
}(common_1.BaseRoute));
exports.ArticleCommentRepliesRoute = ArticleCommentRepliesRoute;
/**
* @overview
***Notes:**
- Refer to the [REST API documentation](https://github.com/Baasic/baasic-rest-api/wiki) 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 service.
*/