diff --git a/lib/core/api/clients/alfresco-js-clients.module.ts b/lib/core/api/clients/alfresco-js-clients.module.ts index e9eb361372..f1fca6e9fa 100644 --- a/lib/core/api/clients/alfresco-js-clients.module.ts +++ b/lib/core/api/clients/alfresco-js-clients.module.ts @@ -17,6 +17,7 @@ import { NgModule } from '@angular/core'; import { ActivitiClientModule } from './activiti/activiti-client.module'; +import { AuthClientModule } from './auth/auth-client.module'; import { DiscoveryClientModule } from './discovery/discovery-client.module'; import { SearchClientModule } from './search/search-client.module'; @@ -24,7 +25,8 @@ import { SearchClientModule } from './search/search-client.module'; imports: [ ActivitiClientModule, DiscoveryClientModule, - SearchClientModule + SearchClientModule, + AuthClientModule ] }) export class AlfrescoJsClientsModule { } diff --git a/lib/core/api/clients/auth/auth-client.module.ts b/lib/core/api/clients/auth/auth-client.module.ts new file mode 100644 index 0000000000..9217bf3429 --- /dev/null +++ b/lib/core/api/clients/auth/auth-client.module.ts @@ -0,0 +1,36 @@ +/*! + * @license + * Copyright 2019 Alfresco Software, Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AuthenticationApi } from '@alfresco/js-api'; +import { NgModule } from '@angular/core'; +import { ApiClientsService } from '../../api-clients.service'; + +declare global { + // eslint-disable-next-line @typescript-eslint/no-namespace + namespace Api { + interface ApiRegistry { + ['AuthClient.authentication']: AuthenticationApi; + } + } +} + +@NgModule() +export class AuthClientModule { + constructor(private apiClientsService: ApiClientsService) { + this.apiClientsService.register('AuthClient.authentication', AuthenticationApi); + } +}