feat: register AuthApi

This commit is contained in:
Michal Dobkiewicz
2022-05-24 14:27:42 +02:00
parent f8b8251e02
commit 56dc303117
2 changed files with 39 additions and 1 deletions

View File

@@ -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 { }

View File

@@ -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);
}
}