@alfresco/adf-core
Version:
122 lines (121 loc) • 4.19 kB
TypeScript
/*!
* @license
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* 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 { HttpClient } from '@angular/common/http';
import { Observable, ReplaySubject } from 'rxjs';
import { ExtensionConfig, ExtensionService } from '@alfresco/adf-extensions';
import { OpenidConfiguration } from '../auth/interfaces/openid-configuration.interface';
import { OauthConfigModel } from '../auth/models/oauth-config.model';
import * as i0 from "@angular/core";
export declare enum AppConfigValues {
APP_CONFIG_LANGUAGES_KEY = "languages",
PROVIDERS = "providers",
OAUTHCONFIG = "oauth2",
ECMHOST = "ecmHost",
BASESHAREURL = "baseShareUrl",
OOI_CONNECTOR_URL = "ooiServiceUrl",
BPMHOST = "bpmHost",
IDENTITY_HOST = "identityHost",
AUTHTYPE = "authType",
CONTEXTROOTECM = "contextRootEcm",
CONTEXTROOTBPM = "contextRootBpm",
ALFRESCO_REPOSITORY_NAME = "alfrescoRepositoryName",
LOG_LEVEL = "logLevel",
LOGIN_ROUTE = "loginRoute",
DISABLECSRF = "disableCSRF",
AUTH_WITH_CREDENTIALS = "auth.withCredentials",
APPLICATION = "application",
STORAGE_PREFIX = "application.storagePrefix",
NOTIFY_DURATION = "notificationDefaultDuration",
CONTENT_TICKET_STORAGE_LABEL = "ticket-ECM",
PROCESS_TICKET_STORAGE_LABEL = "ticket-BPM",
UNSAVED_CHANGES_MODAL_HIDDEN = "unsaved_changes__modal_hidden"
}
export declare enum Status {
INIT = "init",
LOADING = "loading",
LOADED = "loaded"
}
export declare class AppConfigService {
protected http: HttpClient;
protected extensionService: ExtensionService;
config: any;
status: Status;
protected onLoadSubject: ReplaySubject<any>;
onLoad: Observable<any>;
get isLoaded(): boolean;
constructor();
/**
* Requests notification of a property value when it is loaded.
*
* @param property The desired property value
* @returns Property value, when loaded
*/
select(property: string): Observable<any>;
/**
* Gets the value of a named property.
*
* @param key Name of the property
* @param defaultValue Value to return if the key is not found
* @returns Value of the property
*/
get<T>(key: string, defaultValue?: T): T;
/**
* Gets the location.protocol value.
*
* @returns The location.protocol string
*/
getLocationProtocol(): string;
/**
* Gets the location.hostname property.
*
* @returns Value of the property
*/
getLocationHostname(): string;
/**
* Gets the location.port property.
*
* @param prefix Text added before port value
* @returns Port with prefix
*/
getLocationPort(prefix?: string): string;
protected onLoaded(): void;
protected onDataLoaded(): void;
protected onExtensionsLoaded(config: ExtensionConfig): void;
/**
* Loads the config file.
*
* @param callback an optional callback to execute when configuration is loaded
* @returns Notification when loading is complete
*/
load(callback?: (...args: any[]) => any): Promise<any>;
/**
* Call the discovery API to fetch configuration
*
* @param hostIdp host address
* @returns Discovery configuration
*/
loadWellKnown(hostIdp: string): Promise<OpenidConfiguration>;
/**
* OAuth2 configuration
*
* @returns auth config model
*/
get oauth2(): OauthConfigModel;
private formatString;
static ɵfac: i0.ɵɵFactoryDeclaration<AppConfigService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<AppConfigService>;
}