UNPKG

sss-core-lib

Version:

This package is used to interact with the cloud service.

1,021 lines (988 loc) 30.3 kB
import { NgModule, Injectable, ɵɵdefineInjectable, ɵɵinject } from '@angular/core'; import { CommonModule } from '@angular/common'; import { HttpClientModule, HttpHeaders, HttpClient } from '@angular/common/http'; import { of, Subject } from 'rxjs'; import { catchError, tap } from 'rxjs/operators'; import { CookieService } from 'ngx-cookie-service'; /** * @fileoverview added by tsickle * Generated from: lib/sss-core.module.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ class SssCoreModule { } SssCoreModule.decorators = [ { type: NgModule, args: [{ declarations: [], imports: [ CommonModule, HttpClientModule ] },] } ]; /** * @fileoverview added by tsickle * Generated from: lib/sss-core.service.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ class SssCoreService { constructor() { } /** * @return {?} */ helloSss() { return 'Hello, Sss!'; } } SssCoreService.decorators = [ { type: Injectable, args: [{ providedIn: 'root' },] } ]; /** @nocollapse */ SssCoreService.ctorParameters = () => []; /** @nocollapse */ SssCoreService.ngInjectableDef = ɵɵdefineInjectable({ factory: function SssCoreService_Factory() { return new SssCoreService(); }, token: SssCoreService, providedIn: "root" }); /** * @fileoverview added by tsickle * Generated from: lib/api.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ class Api { /** * @param {?} http * @param {?} authService * @param {?} methodName */ constructor(http, authService, methodName) { this.http = http; this.authService = authService; this.methodName = methodName; this.apiUrl = 'http://xn----7sbbo1akkddft7k.xn--p1ai:49370'; } /** * @template R * @param {?=} path * @return {?} */ get(path) { return (/** @type {?} */ (this.http.get(this.apiUrl + '/' + this.methodName + (path || ''), { headers: this.getHeaders() }) .pipe(catchError((/** * @param {?} err * @return {?} */ (err) => { if (err.status === 401 && this.authService) { this.authService.unauthorized$.next(); } return of(undefined); }))))); } /** * @template R * @param {?} id * @return {?} */ getItem(id) { return this.get('/' + id); } /** * @template T * @param {?} body * @param {?=} path * @return {?} */ post(body, path) { return this.http.post(this.apiUrl + '/' + this.methodName + (path || ''), body, { headers: this.getHeaders() }); } /** * @template T * @param {?} body * @param {?=} path * @return {?} */ put(body, path) { return this.http.put(this.apiUrl + '/' + this.methodName + (path || ''), body, { headers: this.getHeaders() }); } /** * @param {?=} id * @return {?} */ delete(id) { return (/** @type {?} */ (this.http.delete(this.apiUrl + '/' + this.methodName + (id ? '/' + id : ''), { headers: this.getHeaders() }))); } /** * @private * @return {?} */ getHeaders() { /** @type {?} */ const headers = { 'Content-Type': 'application/json', }; if (this.authService) { headers.Authorization = 'Bearer ' + this.authService.getToken(); } return new HttpHeaders(headers); } } if (false) { /** @type {?} */ Api.prototype.apiUrl; /** * @type {?} * @protected */ Api.prototype.http; /** * @type {?} * @protected */ Api.prototype.authService; /** * @type {?} * @private */ Api.prototype.methodName; } /** * @fileoverview added by tsickle * Generated from: lib/auth/auth.service.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ class AuthService extends Api { /** * @param {?} http * @param {?} cookieService */ constructor(http, cookieService) { super(http, undefined, 'auth'); this.cookieService = cookieService; this.cookieTokenName = 'sss-token'; this.cookiePermissionName = 'sss-permissions'; this.unauthorized$ = new Subject(); this.restore(); } /** * @private * @return {?} */ restore() { this.accessToken = this.cookieService.get(this.cookieTokenName); /** @type {?} */ const permissions = this.cookieService.get(this.cookiePermissionName); if (permissions) { this.permissions = JSON.parse(permissions); } } /** * @param {?} username * @param {?} password * @return {?} */ login(username, password) { return this.post({ username, password }, '/login') .pipe(tap((/** * @param {?} res * @return {?} */ (res) => { /** @type {?} */ const accessToken = res.access_token; if (!accessToken || accessToken.length === 0) { throw new Error('Response token is invalid'); } this.accessToken = accessToken; this.permissions = res.permissions; this.cookieService.set(this.cookieTokenName, accessToken, 3600, '/'); this.cookieService.set(this.cookiePermissionName, JSON.stringify(res.permissions), 3600, '/'); }))); } /** * @return {?} */ getToken() { return this.accessToken; } /** * @return {?} */ getPermissions() { return this.permissions; } /** * @param {?} guard * @return {?} */ hasPermission(guard) { return this.permissions.includes(guard); } /** * @return {?} */ logout() { this.accessToken = undefined; this.cookieService.delete(this.cookieTokenName); this.cookieService.delete(this.cookiePermissionName); } } AuthService.decorators = [ { type: Injectable, args: [{ providedIn: 'root' },] } ]; /** @nocollapse */ AuthService.ctorParameters = () => [ { type: HttpClient }, { type: CookieService } ]; /** @nocollapse */ AuthService.ngInjectableDef = ɵɵdefineInjectable({ factory: function AuthService_Factory() { return new AuthService(ɵɵinject(HttpClient), ɵɵinject(CookieService)); }, token: AuthService, providedIn: "root" }); if (false) { /** * @type {?} * @private */ AuthService.prototype.accessToken; /** * @type {?} * @private */ AuthService.prototype.permissions; /** * @type {?} * @private */ AuthService.prototype.cookieTokenName; /** * @type {?} * @private */ AuthService.prototype.cookiePermissionName; /** @type {?} */ AuthService.prototype.unauthorized$; /** * @type {?} * @private */ AuthService.prototype.cookieService; } /** * @fileoverview added by tsickle * Generated from: lib/api.service.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ class ApiService extends Api { /** * @param {?} httpClient * @param {?} authService */ constructor(httpClient, authService) { super(httpClient, authService, ''); } } ApiService.decorators = [ { type: Injectable, args: [{ providedIn: 'root' },] } ]; /** @nocollapse */ ApiService.ctorParameters = () => [ { type: HttpClient }, { type: AuthService } ]; /** @nocollapse */ ApiService.ngInjectableDef = ɵɵdefineInjectable({ factory: function ApiService_Factory() { return new ApiService(ɵɵinject(HttpClient), ɵɵinject(AuthService)); }, token: ApiService, providedIn: "root" }); /** * @fileoverview added by tsickle * Generated from: lib/auth/interfaces/login.interface.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * @record */ function ILogin() { } if (false) { /** @type {?} */ ILogin.prototype.access_token; /** @type {?} */ ILogin.prototype.permissions; } /** * @fileoverview added by tsickle * Generated from: lib/collection/collection.service.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ class CollectionService extends Api { /** * @param {?} http * @param {?} authService */ constructor(http, authService) { super(http, authService, 'collection'); this.http = http; this.authService = authService; } } CollectionService.decorators = [ { type: Injectable, args: [{ providedIn: 'root' },] } ]; /** @nocollapse */ CollectionService.ctorParameters = () => [ { type: HttpClient }, { type: AuthService } ]; /** @nocollapse */ CollectionService.ngInjectableDef = ɵɵdefineInjectable({ factory: function CollectionService_Factory() { return new CollectionService(ɵɵinject(HttpClient), ɵɵinject(AuthService)); }, token: CollectionService, providedIn: "root" }); if (false) { /** @type {?} */ CollectionService.prototype.http; /** @type {?} */ CollectionService.prototype.authService; } /** * @fileoverview added by tsickle * Generated from: lib/collection/interfaces/collection.interface.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * @record */ function ICollection() { } if (false) { /** @type {?} */ ICollection.prototype.name; } /** * @fileoverview added by tsickle * Generated from: lib/collection-list/collection-list.service.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ class CollectionListService extends Api { /** * @param {?} http * @param {?} authService */ constructor(http, authService) { super(http, authService, 'collection'); this.http = http; this.authService = authService; } /** * @template R * @param {?} colName * @return {?} */ get(colName) { return super.get('/' + colName + '/list'); } /** * @template R * @param {?} colName * @param {?=} id * @return {?} */ getItem(colName, id) { return super.get('/' + colName + '/list/' + id); } /** * @template T * @param {?} body * @param {?=} colName * @param {?=} id * @return {?} */ post(body, colName, id) { return super.post(body, '/' + colName + '/list/' + id); } /** * @param {?} colName * @param {?=} id * @return {?} */ delete(colName, id) { return super.delete(colName + '/list/' + id); } /** * @template T * @param {?} body * @param {?=} colName * @return {?} */ put(body, colName) { return super.put(body, '/' + colName + '/list'); } } CollectionListService.decorators = [ { type: Injectable, args: [{ providedIn: 'root' },] } ]; /** @nocollapse */ CollectionListService.ctorParameters = () => [ { type: HttpClient }, { type: AuthService } ]; /** @nocollapse */ CollectionListService.ngInjectableDef = ɵɵdefineInjectable({ factory: function CollectionListService_Factory() { return new CollectionListService(ɵɵinject(HttpClient), ɵɵinject(AuthService)); }, token: CollectionListService, providedIn: "root" }); if (false) { /** @type {?} */ CollectionListService.prototype.http; /** @type {?} */ CollectionListService.prototype.authService; } /** * @fileoverview added by tsickle * Generated from: lib/collection-list/interfaces/collection-list.interface.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * @record */ function ICollectionList() { } if (false) { /** @type {?} */ ICollectionList.prototype.data; } /** * @fileoverview added by tsickle * Generated from: lib/config/config.service.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ class ConfigService extends Api { /** * @param {?} http * @param {?} authService */ constructor(http, authService) { super(http, authService, 'config'); this.http = http; this.authService = authService; } } ConfigService.decorators = [ { type: Injectable, args: [{ providedIn: 'root' },] } ]; /** @nocollapse */ ConfigService.ctorParameters = () => [ { type: HttpClient }, { type: AuthService } ]; /** @nocollapse */ ConfigService.ngInjectableDef = ɵɵdefineInjectable({ factory: function ConfigService_Factory() { return new ConfigService(ɵɵinject(HttpClient), ɵɵinject(AuthService)); }, token: ConfigService, providedIn: "root" }); if (false) { /** @type {?} */ ConfigService.prototype.http; /** @type {?} */ ConfigService.prototype.authService; } /** * @fileoverview added by tsickle * Generated from: lib/config/interfaces/config.interface.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * @record */ function IConfig() { } if (false) { /** @type {?} */ IConfig.prototype.smtp; } /** * @fileoverview added by tsickle * Generated from: lib/group/group.service.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ class GroupService extends Api { /** * @param {?} http * @param {?} authService */ constructor(http, authService) { super(http, authService, 'group'); this.http = http; this.authService = authService; } } GroupService.decorators = [ { type: Injectable, args: [{ providedIn: 'root' },] } ]; /** @nocollapse */ GroupService.ctorParameters = () => [ { type: HttpClient }, { type: AuthService } ]; /** @nocollapse */ GroupService.ngInjectableDef = ɵɵdefineInjectable({ factory: function GroupService_Factory() { return new GroupService(ɵɵinject(HttpClient), ɵɵinject(AuthService)); }, token: GroupService, providedIn: "root" }); if (false) { /** @type {?} */ GroupService.prototype.http; /** @type {?} */ GroupService.prototype.authService; } /** * @fileoverview added by tsickle * Generated from: lib/group/interfaces/group.interface.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * @record */ function IGroup() { } if (false) { /** @type {?} */ IGroup.prototype.name; /** @type {?} */ IGroup.prototype.permissions; } /** * @fileoverview added by tsickle * Generated from: lib/media/media.service.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ class MediaService extends Api { /** * @param {?} http * @param {?} authService */ constructor(http, authService) { super(http, authService, 'media'); this.http = http; this.authService = authService; } /** * @param {?} id * @return {?} */ download(id) { location.href = this.apiUrl + '/media/' + id + '/file'; } /** * @param {?} fileToUpload * @return {?} */ upload(fileToUpload) { /** @type {?} */ const endpoint = this.apiUrl + '/media'; /** @type {?} */ const formData = new FormData(); formData.append('file', fileToUpload, fileToUpload.name); return (/** @type {?} */ (this.http.post(endpoint, formData, { headers: { Authorization: 'Bearer ' + this.authService.getToken() } }))); } } MediaService.decorators = [ { type: Injectable, args: [{ providedIn: 'root' },] } ]; /** @nocollapse */ MediaService.ctorParameters = () => [ { type: HttpClient }, { type: AuthService } ]; /** @nocollapse */ MediaService.ngInjectableDef = ɵɵdefineInjectable({ factory: function MediaService_Factory() { return new MediaService(ɵɵinject(HttpClient), ɵɵinject(AuthService)); }, token: MediaService, providedIn: "root" }); if (false) { /** @type {?} */ MediaService.prototype.http; /** @type {?} */ MediaService.prototype.authService; } /** * @fileoverview added by tsickle * Generated from: lib/media/interfaces/media.interface.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * @record */ function IMedia() { } if (false) { /** @type {?} */ IMedia.prototype.fieldname; /** @type {?} */ IMedia.prototype.originalname; /** @type {?} */ IMedia.prototype.encoding; /** @type {?} */ IMedia.prototype.mimetype; /** @type {?} */ IMedia.prototype.destination; /** @type {?} */ IMedia.prototype.filename; /** @type {?} */ IMedia.prototype.path; /** @type {?} */ IMedia.prototype.size; } /** * @fileoverview added by tsickle * Generated from: lib/notification/notification.service.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ class NotificationService extends Api { /** * @param {?} http * @param {?} authService */ constructor(http, authService) { super(http, authService, 'notification'); this.http = http; this.authService = authService; } /** * @param {?} options * @return {?} */ sendMail(options) { return (/** @type {?} */ (super.post(options, '/email'))); } /** * @return {?} */ history() { return super.get('/history'); } } NotificationService.decorators = [ { type: Injectable, args: [{ providedIn: 'root' },] } ]; /** @nocollapse */ NotificationService.ctorParameters = () => [ { type: HttpClient }, { type: AuthService } ]; /** @nocollapse */ NotificationService.ngInjectableDef = ɵɵdefineInjectable({ factory: function NotificationService_Factory() { return new NotificationService(ɵɵinject(HttpClient), ɵɵinject(AuthService)); }, token: NotificationService, providedIn: "root" }); if (false) { /** @type {?} */ NotificationService.prototype.http; /** @type {?} */ NotificationService.prototype.authService; } /** * @fileoverview added by tsickle * Generated from: lib/notification/interfaces/email-notification.interface.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * @record */ function IEmailNotification() { } if (false) { /** @type {?} */ IEmailNotification.prototype.accepted; /** @type {?} */ IEmailNotification.prototype.rejected; /** @type {?} */ IEmailNotification.prototype.envelopeTime; /** @type {?} */ IEmailNotification.prototype.messageTime; /** @type {?} */ IEmailNotification.prototype.messageSize; /** @type {?} */ IEmailNotification.prototype.response; /** @type {?} */ IEmailNotification.prototype.envelope; /** @type {?} */ IEmailNotification.prototype.messageId; } /** * @fileoverview added by tsickle * Generated from: lib/notification/interfaces/history-notification.interface.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * @record */ function IHistoryNotification() { } if (false) { /** @type {?} */ IHistoryNotification.prototype.type; /** @type {?} */ IHistoryNotification.prototype.result; /** @type {?} */ IHistoryNotification.prototype.options; } /** * @fileoverview added by tsickle * Generated from: lib/notification/interfaces/send-email-notification.interface.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * @record */ function ISendEmailNotification() { } if (false) { /** @type {?} */ ISendEmailNotification.prototype.from; /** @type {?} */ ISendEmailNotification.prototype.to; /** @type {?} */ ISendEmailNotification.prototype.subject; /** @type {?|undefined} */ ISendEmailNotification.prototype.text; /** @type {?|undefined} */ ISendEmailNotification.prototype.html; } /** * @fileoverview added by tsickle * Generated from: lib/user/user.service.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ class UserService extends Api { /** * @param {?} http * @param {?} authService */ constructor(http, authService) { super(http, authService, 'user'); this.http = http; this.authService = authService; } } UserService.decorators = [ { type: Injectable, args: [{ providedIn: 'root' },] } ]; /** @nocollapse */ UserService.ctorParameters = () => [ { type: HttpClient }, { type: AuthService } ]; /** @nocollapse */ UserService.ngInjectableDef = ɵɵdefineInjectable({ factory: function UserService_Factory() { return new UserService(ɵɵinject(HttpClient), ɵɵinject(AuthService)); }, token: UserService, providedIn: "root" }); if (false) { /** @type {?} */ UserService.prototype.http; /** @type {?} */ UserService.prototype.authService; } /** * @fileoverview added by tsickle * Generated from: lib/user/interfaces/user.interface.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * @record */ function IUser() { } if (false) { /** @type {?} */ IUser.prototype.username; /** @type {?} */ IUser.prototype.groupId; /** @type {?} */ IUser.prototype.password; } /** * @fileoverview added by tsickle * Generated from: lib/workspace/workspace.service.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ class WorkspaceService extends Api { /** * @param {?} http * @param {?} authService */ constructor(http, authService) { super(http, authService, 'workspace'); this.http = http; this.authService = authService; } } WorkspaceService.decorators = [ { type: Injectable, args: [{ providedIn: 'root' },] } ]; /** @nocollapse */ WorkspaceService.ctorParameters = () => [ { type: HttpClient }, { type: AuthService } ]; /** @nocollapse */ WorkspaceService.ngInjectableDef = ɵɵdefineInjectable({ factory: function WorkspaceService_Factory() { return new WorkspaceService(ɵɵinject(HttpClient), ɵɵinject(AuthService)); }, token: WorkspaceService, providedIn: "root" }); if (false) { /** @type {?} */ WorkspaceService.prototype.http; /** @type {?} */ WorkspaceService.prototype.authService; } /** * @fileoverview added by tsickle * Generated from: lib/workspace/interfaces/delete-response.interface.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * @record */ function IDeleteResponse() { } if (false) { /** @type {?} */ IDeleteResponse.prototype.n; /** @type {?} */ IDeleteResponse.prototype.ok; /** @type {?} */ IDeleteResponse.prototype.deletedCount; } /** * @fileoverview added by tsickle * Generated from: lib/workspace/interfaces/workspace.interface.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * @record */ function IWorkspace() { } if (false) { /** @type {?} */ IWorkspace.prototype.name; } /** * @fileoverview added by tsickle * Generated from: lib/collection-model/collection-model.service.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ class CollectionModelService extends Api { /** * @param {?} http * @param {?} authService */ constructor(http, authService) { super(http, authService, 'collection-model'); this.http = http; this.authService = authService; } /** * @param {?} name * @return {?} */ findByName(name) { if (!name) { throw new Error('CollectionModelService.findByName() input parameter is empty'); } return this.http.get(this.apiUrl + '/collection-model/name/' + name, { headers: { Authorization: 'Bearer ' + this.authService.getToken() } }); } } CollectionModelService.decorators = [ { type: Injectable, args: [{ providedIn: 'root' },] } ]; /** @nocollapse */ CollectionModelService.ctorParameters = () => [ { type: HttpClient }, { type: AuthService } ]; /** @nocollapse */ CollectionModelService.ngInjectableDef = ɵɵdefineInjectable({ factory: function CollectionModelService_Factory() { return new CollectionModelService(ɵɵinject(HttpClient), ɵɵinject(AuthService)); }, token: CollectionModelService, providedIn: "root" }); if (false) { /** @type {?} */ CollectionModelService.prototype.http; /** @type {?} */ CollectionModelService.prototype.authService; } /** * @fileoverview added by tsickle * Generated from: lib/collection-model/interfaces/collection-model.interface.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * @record */ function ICollectionModel() { } if (false) { /** @type {?} */ ICollectionModel.prototype.name; /** @type {?} */ ICollectionModel.prototype.label; /** @type {?|undefined} */ ICollectionModel.prototype.wordspaceId; /** @type {?} */ ICollectionModel.prototype.structure; } /** * @fileoverview added by tsickle * Generated from: lib/collection-model/interfaces/collection-model-property.interface.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * @record */ function ICollectionModelProperty() { } if (false) { /** @type {?} */ ICollectionModelProperty.prototype.name; /** @type {?} */ ICollectionModelProperty.prototype.type; /** @type {?} */ ICollectionModelProperty.prototype.required; /* Skipping unnamed member: 'link-collection-name'?: string;*/ } /** * @fileoverview added by tsickle * Generated from: lib/password/password.service.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ class PasswordService extends Api { /** * @param {?} http * @param {?} authService */ constructor(http, authService) { super(http, authService, 'password'); this.http = http; this.authService = authService; } /** * Отправляет запрос на восстановления пароль * @param {?} email почта пользователя, который сбрасывает пароль * @return {?} */ forgot(email) { return this.http.post(this.apiUrl + '/password/forgot', { email }); } /** * Отправляет запрос на сброс пароля * @param {?} token токен сессия сброса пароля * @param {?} password новый пароль * @return {?} */ reset(token, password) { return this.http.get(this.apiUrl + '/password/reset', { params: { token, password } }); } } PasswordService.decorators = [ { type: Injectable, args: [{ providedIn: 'root' },] } ]; /** @nocollapse */ PasswordService.ctorParameters = () => [ { type: HttpClient }, { type: AuthService } ]; /** @nocollapse */ PasswordService.ngInjectableDef = ɵɵdefineInjectable({ factory: function PasswordService_Factory() { return new PasswordService(ɵɵinject(HttpClient), ɵɵinject(AuthService)); }, token: PasswordService, providedIn: "root" }); if (false) { /** @type {?} */ PasswordService.prototype.http; /** @type {?} */ PasswordService.prototype.authService; } /** * @fileoverview added by tsickle * Generated from: public-api.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ /** * @fileoverview added by tsickle * Generated from: sss-core-lib.ts * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ export { ApiService, AuthService, CollectionListService, CollectionModelService, CollectionService, ConfigService, GroupService, MediaService, NotificationService, PasswordService, SssCoreModule, SssCoreService, UserService, WorkspaceService, Api as ɵa }; //# sourceMappingURL=sss-core-lib.js.map