src/core/services/smart-service-adapter.service.ts
Subscribing to the adapter directly is deprecated. Use stateSignal instead.
A service used to initialize and manage the JSDO Session and to manage JSDO catalogs.
Subscribing directly to this service as an Observable is deprecated. Use stateSignal to reactively read the adapter state instead.
ReplaySubject
Properties |
|
Methods |
|
Accessors |
constructor(smartConfig: SmartConfig, smartHttp: SmartHttpService, injector: Injector, logger: SmartLoggerService, authService: SmartAuthenticationService)
|
||||||||||||||||||
|
Parameters :
|
| Public Async addCatalog | ||||||||
addCatalog(catalog: string)
|
||||||||
|
Attempts to load the given JSDO catalog.
Parameters :
Returns :
Promise<void>
A promise that resolves to the catalog. |
| Public catalogLoaded | ||||||||
catalogLoaded(catalog: string)
|
||||||||
|
Indicates whether a JSDO catalog with the given name has been loaded.
Parameters :
Returns :
boolean
True if the catalog has been loaded, false otherwise. |
| Public checkProductAccess | ||||||
checkProductAccess(productCode?: string)
|
||||||
|
Checks if there is access to the specified product if the property is specified in the config.
Parameters :
Returns :
Promise<literal type>
|
| Public getAuthenticationStrategy |
getAuthenticationStrategy()
|
|
Gets the active authentication strategy instance.
Returns :
ISmartAuthenticationStrategy
|
| Public getCatalog | ||||||||
getCatalog(catalog: string)
|
||||||||
|
Returns the JSDO catalog with the given catalog name, if it has been loaded.
Parameters :
Returns :
any
The catalog. |
| Public login | ||||||||
login(credentials?: ISmartServiceCredentials)
|
||||||||
|
Logs the user in using the given credentials, or the credentials specified in the app configuration if none are provided.
Parameters :
Returns :
Promise<any>
A promise that resolves to the JSDO session. |
| Public logout | ||||||||||
logout(afterLogoutPage: string)
|
||||||||||
|
Logs the user out.
Parameters :
Returns :
Promise<void>
A promise that resolves to void. |
| Public redirectToLoginForDifferentAccount |
redirectToLoginForDifferentAccount()
|
|
Redirects the user into a switch-account login flow when supported by the active strategy.
Returns :
Promise<void>
|
| Public afterLogoutPage |
Type : string
|
| Public appRoutes |
Type : Route[]
|
|
The application's routes |
| Public state |
Type : SmartServiceAdapterState
|
Default value : {
authenticated: false,
jsdoSession: null,
routesSet: true,
catalogs: [],
accessState: 'unknown',
initFinished: false
}
|
|
The current state of the Smart Service Adapter. |
| Public Readonly stateSignal |
Type : Signal<SmartServiceAdapterState>
|
Default value : this._stateSignal.asReadonly()
|
|
Signal holding the current state of the Smart Service Adapter. |
| usesBearerAuth |
getusesBearerAuth()
|
|
Indicates whether the authentication strategy uses bearer tokens instead of cookies. Returns true for Keycloak and Entra ID authentication.
Returns :
boolean
|
| bearerExcludedUrls |
getbearerExcludedUrls()
|
|
Gets the bearer excluded URLs from the authentication configuration.
Returns :
unknown[]
|
| authenticationStrategy |
getauthenticationStrategy()
|
|
Exposes the current authentication strategy (e.g., 'hybridrealm', 'keycloak', 'entraid').
Returns :
string | null
|
| serviceURI |
getserviceURI()
|
|
The serviceURI provided in the application's configuration
Returns :
string
|
| catalogURI |
getcatalogURI()
|
|
The catalogURI or
Returns :
string
|
| templateURI |
gettemplateURI()
|
|
The templateURI or
Returns :
string
|
| imageURI |
getimageURI()
|
|
the imageURI or
Returns :
string
|
| smartRestURI |
getsmartRestURI()
|
|
The smartRestURI or
Returns :
string
|
| jsdoSession |
getjsdoSession()
|
|
Returns the current JSDO session from the authentication provider.
Returns :
progress.data.JSDOSession
|