UNPKG

baasic-sdk-javascript

Version:

JavaScript SDK provides core functionality for building web and mobile applications on [Baasic](http://www.baasic.com/).

187 lines (186 loc) 10.7 kB
"use strict"; /* globals module */ /** * @module calendarEventRsvpAttendeeRoute * @description BaasicCalendarEventRsvpAttendeeRoute Definition provides Baasic route templates which can be expanded to Baasic REST URIs. Various services can use BaasicCalendarEventRsvpAttendeeRoute 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. */ 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 CalendarEventRsvpAttendeeRoute = /** @class */ (function (_super) { tslib_1.__extends(CalendarEventRsvpAttendeeRoute, _super); function CalendarEventRsvpAttendeeRoute(appOptions) { var _this = _super.call(this, appOptions) || this; _this.appOptions = appOptions; _this.findRoute = 'calendar-event-attendees/{?searchQuery,page,rpp,sort,embed,fields,calendarIds,calendarNames,eventIds,invitationTypeIds,attendeeStatusIds,userIds,slotDifference,emails,from,to,ids}'; _this.getRoute = 'calendar-event-attendees/{id}/{?embed,fields}'; _this.createRoute = 'calendar-event-attendees'; _this.updateRoute = 'calendar-event-attendees/{id}'; _this.deleteRoute = 'calendar-event-attendees/{id}'; _this.purgeRoute = 'calendar-event-attendees/{id}/purge'; _this.updateStatusRoute = 'calendar-event-attendees/{id}/status/{attendeeStatusId}'; _this.updateStatusEmailOrFullNameRoute = 'calendar-event-attendees/{id}/user/{emailOrFullName}/status/{attendeeStatusId}'; _this.subscribeRoute = "calendar-event-attendees/{id}/subscribe"; _this.unsubscribeRoute = "calendar-event-attendees/{id}/unsubscribe"; return _this; } /** * Parses find route which can be expanded with additional GetCalendarLookupOptions. Supported items are: * - `searchQuery` - A string referencing CalendarEventAttendee properties using the phrase or BQL (Baasic Query Language) search. * - `page` - A value used to set the page number, i.e. to retrieve certain CalendarEventAttendee subset from the storage. * - `rpp` - A value used to limit the size of result set per page. * - `sort` - A string used to set the CalendarEventAttendee property to sort the result collection by. * - `embed` - Comma separated list of resources to be contained within the current representation. * - `calendarIds` - calendar ids which identify CalendarEventAttendee resources. * - `calendarNames` - calendar names which identify CalendarEventAttendee resources. * - `eventIds` - eventIds which identify CalendarEventAttendee resources. * - `invitationTypeIds` - invitationTypeIds which identify CalendarEventAttendee resources. * - `attendeeStatusIds` - statusIds which identify CalendarEventAttendee resources. * - `userIds` - CalendarEventAttende userIds which identify CalendarEventAttendee resources. * - `slotDifference` - Slot difference. * - `emails` - CalendarEventAttendee emails which identify CalendarEventAttendee resources. * - `from` - Fluent syntax for 'From' date. Used to limit the dataset to only use resources starting from this date. * - `to` - Fluent syntax for 'To' date. Used to limit the dataset to only use resources ending to this date. * - `ids` - CalendarEventAttendee ids which uniquely identify CalendarEventAttendee resources that need to be retrieved. * @method * @param options Query resource GetCalendarLookupOptions object. * @example calendarEventRsvpAttendeeRoute.find({searchQuery: '<search-phrase>'}); */ CalendarEventRsvpAttendeeRoute.prototype.find = function (options) { var opt; if (options) { opt = options; opt.to = this.getToDate(opt); opt.from = this.getFromDate(opt); } else { opt = {}; } return _super.prototype.baseFind.call(this, this.findRoute, opt); }; /** * Parses get route which must be expanded with the id of the previously created CalendarEventAttendee resource in the system. The route can be expanded using additional GetRequestOptions. Supported items are * - `embed` - Comma separated list of resources to be contained within the current representation. * @method * @param id CalendarEventAttendee id which uniquely identifies CalendarEventAttendee resource that needs to be retrieved. * @param options Query resource GetRequestOptions object. * @example calendarEventRsvpAttendeeRoute.get(id); */ CalendarEventRsvpAttendeeRoute.prototype.get = function (id, options) { return _super.prototype.baseGet.call(this, this.getRoute, id, options); }; /** * Parses create route. This URI template does not expose any additional options. * @method * @param data A CalendarEventAttendee object that needs to be inserted into the system. * @example calendarEventRsvpAttendeeRoute.create(data); */ CalendarEventRsvpAttendeeRoute.prototype.create = function (data) { return _super.prototype.baseCreate.call(this, this.createRoute, data); }; /** * Parses update route. This URI template does not expose any additional options. * @method * @param data A CalendarEventAttendee object used to update specified CalendarEventAttendee resource. * @example calendarEventRsvpAttendeeRoute.update(data); */ CalendarEventRsvpAttendeeRoute.prototype.update = function (data) { return _super.prototype.baseUpdate.call(this, this.updateRoute, data); }; /** * Parses update status email or name route. This URI template does not expose any additional options. * @method * @param id A CalendarEventAttendee identifier which uniquely identifies CalendarEventAttendee resource. * @param statusId A calendarEventAttendeeStatus identifier which uniquely identifies CalendarEventAttendee resource. * @example calendarEventRsvpAttendeeRoute.update(id, statusId); */ CalendarEventRsvpAttendeeRoute.prototype.updateStatus = function (id, statusId) { var params = {}; params.id = id; params.attendeeStatusId = statusId; return _super.prototype.baseUpdate.call(this, this.updateStatusRoute, params); }; /** * Parses update status email or name route. This URI template does not expose any additional options. * @method * @param id A CalendarEventAttendee identifier which uniquely identifies CalendarEventAttendee resource. * @param emailOrFullName Email or full name * @param statusId A calendarEventAttendeeStatus identifier which uniquely identifies CalendarEventAttendee resource. * @example calendarEventRsvpAttendeeRoute.update(id, email, statusId); */ CalendarEventRsvpAttendeeRoute.prototype.updateStatusEmailOrFullName = function (id, emailOrFullName, statusId) { var params = {}; params.id = id; params.attendeeStatusId = statusId; params.emailOrFullName = emailOrFullName; return _super.prototype.baseUpdate.call(this, this.updateStatusEmailOrFullNameRoute, params); }; /** * Parses delte route. This URI template does not expose any additional options. * @method * @param data A CalendarEventAttendee object used to delete specified CalendarEventAttendee resource. * @example calendarEventRsvpAttendeeRoute.delete(data); */ CalendarEventRsvpAttendeeRoute.prototype.delete = function (data) { return _super.prototype.baseDelete.call(this, this.deleteRoute, data); }; /** * Parses subscribe route. This URI template does not expose any additional options. * @method * @param id CalendarEventAttendee id which uniquely identifies a CalendarEventAttendee resource. * @example calendarEventRsvpAttendeeRoute.subscribe(attendeeId); */ CalendarEventRsvpAttendeeRoute.prototype.subscribe = function (id) { var params = {}; params.id = id; return _super.prototype.baseCreate.call(this, this.subscribeRoute, params); }; /** * Parses unsubscribe route. This URI template does not expose any additional options. * @method * @param id CalendarEventAttendee id which uniquely identifies a CalendarEventAttendee resource. * @example calendarEventRsvpAttendeeRoute.unsubscribe(attendeeId); */ CalendarEventRsvpAttendeeRoute.prototype.unsubscribe = function (id) { var params = {}; params.id = id; return _super.prototype.baseDelete.call(this, this.unsubscribeRoute, params); }; /** * Parses purge route. This URI template does not expose any additional options. * @method * @example calendarEventRsvpAttendeeRoute.purge(); */ CalendarEventRsvpAttendeeRoute.prototype.purge = function (event) { return _super.prototype.baseDelete.call(this, this.purgeRoute, event); }; CalendarEventRsvpAttendeeRoute.prototype.getToDate = function (options) { if (!this.utility.isUndefined(options.to) && options.to !== null) { return options.to.toISOString(); } return undefined; }; CalendarEventRsvpAttendeeRoute.prototype.getFromDate = function (options) { if (!this.utility.isUndefined(options.from) && options.from !== null) { return options.from.toISOString(); } return undefined; }; CalendarEventRsvpAttendeeRoute = tslib_1.__decorate([ inversify_1.injectable(), tslib_1.__param(0, inversify_1.inject(contracts_1.TYPES.IAppOptions)), tslib_1.__metadata("design:paramtypes", [Object]) ], CalendarEventRsvpAttendeeRoute); return CalendarEventRsvpAttendeeRoute; }(common_1.BaseRoute)); exports.CalendarEventRsvpAttendeeRoute = CalendarEventRsvpAttendeeRoute; /** * @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. */