@solace-community/angular-solace-message-client
Advanced tools
Comparing version 18.0.0 to 19.0.0
import { Observable } from 'rxjs'; | ||
/** | ||
* Provides "solclientjs" continuously with a valid "OAuth 2.0 Access Token". | ||
* | ||
* OAuth 2.0 enables secure login to the broker while protecting user credentials. | ||
* | ||
* This class provides an Observable that emits the user's access token upon subscription, and then continuously emits it when the token is renewed. | ||
* The Observable should never complete, enabling the connection to the broker to be re-established in the event of a network interruption. | ||
* | ||
* Register this class in {@link SolaceMessageClientConfig#accessToken} and enable OAuth 2.0 authentication scheme in {@link SolaceMessageClientConfig#authenticationScheme}. | ||
* | ||
* **Example of an `OAuthAccessTokenProvider`** | ||
* | ||
* ```ts | ||
* @Injectable({providedIn: 'root'}) | ||
* export class YourAccessTokenProvider implements OAuthAccessTokenProvider { | ||
* | ||
* constructor(private authService: YourAuthService) { | ||
* } | ||
* | ||
* public provide$(): Observable<string> { | ||
* return this.authService.accessToken$; | ||
* } | ||
* } | ||
* ``` | ||
* | ||
* **Example for configuring Solace Message Client** | ||
* | ||
* ```ts | ||
* import {bootstrapApplication} from '@angular/platform-browser'; | ||
* import {provideSolaceMessageClient} from '@solace-community/angular-solace-message-client'; | ||
* import {AuthenticationScheme} from 'solclientjs'; | ||
* | ||
* bootstrapApplication(AppComponent, { | ||
* providers: [ | ||
* provideSolaceMessageClient({ | ||
* url: 'wss://YOUR-SOLACE-BROKER-URL:443', | ||
* vpnName: 'YOUR VPN', | ||
* authenticationScheme: AuthenticationScheme.OAUTH2, // enables OAUTH | ||
* accessToken: YourAccessTokenProvider, sets your access token provider | ||
* }), | ||
* ], | ||
* }); | ||
* ``` | ||
* @deprecated since version 17.1.0; Use `OAuthAccessTokenFn` instead; API will be removed in a future release. | ||
* @see {@link OAuthAccessTokenFn} | ||
*/ | ||
export interface OAuthAccessTokenProvider { | ||
/** | ||
* Provides an Observable that emits the user's access token upon subscription, and then continuously emits it when the token is renewed. It never completes. | ||
*/ | ||
provide$(): Observable<string>; | ||
} | ||
/** | ||
* Signature of a function to provide "solclientjs" continuously with a valid "OAuth 2.0 Access Token". | ||
@@ -56,0 +4,0 @@ * |
import { OnDestroy } from '@angular/core'; | ||
import { Observable } from 'rxjs'; | ||
import { BrowseOptions, ConsumeOptions, Data, MessageEnvelope, ObserveOptions, PublishOptions, RequestOptions, SolaceMessageClient } from './solace-message-client'; | ||
import { ConsumeOptions, Data, MessageEnvelope, ObserveOptions, PublishOptions, RequestOptions, SolaceMessageClient } from './solace-message-client'; | ||
import { SolaceMessageClientConfig, SolaceMessageClientConfigFn } from './solace-message-client.config'; | ||
@@ -40,3 +40,3 @@ import { Destination, Message, MessageConsumerProperties, QueueBrowserProperties, Session } from 'solclientjs'; | ||
private createMessageConsumer$; | ||
browse$(queueOrDescriptor: string | (QueueBrowserProperties & BrowseOptions)): Observable<MessageEnvelope>; | ||
browse$(queueOrDescriptor: string | QueueBrowserProperties): Observable<MessageEnvelope>; | ||
private createQueueBrowser$; | ||
@@ -43,0 +43,0 @@ publish(destination: string | Destination, data?: Data | Message, options?: PublishOptions): Promise<void>; |
import { SessionProperties } from 'solclientjs'; | ||
import { InjectionToken, Type } from '@angular/core'; | ||
import { OAuthAccessTokenFn, OAuthAccessTokenProvider } from './oauth-access-token-provider'; | ||
import { InjectionToken } from '@angular/core'; | ||
import { OAuthAccessTokenFn } from './oauth-access-token-provider'; | ||
import { Observable } from 'rxjs'; | ||
@@ -20,3 +20,3 @@ /** | ||
*/ | ||
accessToken?: string | Type<OAuthAccessTokenProvider> | OAuthAccessTokenFn; | ||
accessToken?: string | OAuthAccessTokenFn; | ||
} | ||
@@ -23,0 +23,0 @@ /** |
@@ -156,3 +156,3 @@ import { BehaviorSubject, Observable, OperatorFunction } from 'rxjs'; | ||
*/ | ||
abstract browse$(queueOrDescriptor: string | (QueueBrowserProperties & BrowseOptions)): Observable<MessageEnvelope>; | ||
abstract browse$(queueOrDescriptor: string | QueueBrowserProperties): Observable<MessageEnvelope>; | ||
/** | ||
@@ -265,3 +265,3 @@ * Publishes a message to the given topic or queue destination. | ||
consume$(topicOrDescriptor: string | (MessageConsumerProperties & ConsumeOptions)): Observable<MessageEnvelope>; | ||
browse$(queueOrDescriptor: string | (QueueBrowserProperties & BrowseOptions)): Observable<MessageEnvelope>; | ||
browse$(queueOrDescriptor: string | QueueBrowserProperties): Observable<MessageEnvelope>; | ||
publish(destination: string | Destination, data?: ArrayBufferLike | DataView | string | SDTField | Message, options?: PublishOptions): Promise<void>; | ||
@@ -286,10 +286,2 @@ request$(destination: string | Destination, data?: Data | Message, options?: RequestOptions): Observable<MessageEnvelope>; | ||
/** | ||
* Controls if to emit received messages inside or outside the Angular zone. | ||
* | ||
* By default, if not specified, emits in the zone in which subscribed to the Observable. | ||
* | ||
* @deprecated since version 17.1.0; Messages are received in the zone in which subscribed to the Observable. To receive messages outside the Angular zone, subscribe to the Observable outside the Angular zone, otherwise inside the Angular zone; API will be removed in a future release. | ||
*/ | ||
emitOutsideAngularZone?: boolean; | ||
/** | ||
* A lifecycle hook that is called when subscribed to a destination. | ||
@@ -307,10 +299,2 @@ * | ||
/** | ||
* Controls if to emit received messages inside or outside the Angular zone. | ||
* | ||
* By default, if not specified, emits in the zone in which subscribed to the Observable. | ||
* | ||
* @deprecated since version 17.1.0; Messages are received in the zone in which subscribed to the Observable. To receive messages outside the Angular zone, subscribe to the Observable outside the Angular zone, otherwise inside the Angular zone; API will be removed in a future release. | ||
*/ | ||
emitOutsideAngularZone?: boolean; | ||
/** | ||
* A lifecycle hook that is called when subscribed to a destination. | ||
@@ -329,15 +313,2 @@ * | ||
/** | ||
* Control how to browse a queue. | ||
*/ | ||
export interface BrowseOptions { | ||
/** | ||
* Controls if to emit received messages inside or outside the Angular zone. | ||
* | ||
* By default, if not specified, emits in the zone in which subscribed to the Observable. | ||
* | ||
* @deprecated since version 17.1.0; Messages are received in the zone in which subscribed to the Observable. To receive messages outside the Angular zone, subscribe to the Observable outside the Angular zone, otherwise inside the Angular zone; API will be removed in a future release. | ||
*/ | ||
emitOutsideAngularZone?: boolean; | ||
} | ||
/** | ||
* Control how to publish a message. | ||
@@ -473,10 +444,2 @@ */ | ||
requestTimeout?: number; | ||
/** | ||
* Controls if to emit received replies inside or outside the Angular zone. | ||
* | ||
* By default, if not specified, emits in the zone in which subscribed to the Observable. | ||
* | ||
* @deprecated since version 17.1.0; Replies are received in the zone in which subscribed to the Observable. To receive replies outside the Angular zone, subscribe to the Observable outside the Angular zone, otherwise inside the Angular zone; API will be removed in a future release. | ||
*/ | ||
emitOutsideAngularZone?: boolean; | ||
} | ||
@@ -483,0 +446,0 @@ /** |
{ | ||
"name": "@solace-community/angular-solace-message-client", | ||
"version": "18.0.0", | ||
"version": "19.0.0", | ||
"description": "Message client to communicate with a Solace messaging broker for sending and receiving messages using the native SMF protocol (Solace Message Format) over web socket. The library is designed to be used in Angular applications.", | ||
@@ -18,7 +18,7 @@ "license": "MIT", | ||
"peerDependencies": { | ||
"@angular/common": "^18.0.0", | ||
"@angular/core": "^18.0.0", | ||
"@angular/common": "^19.0.0", | ||
"@angular/core": "^19.0.0", | ||
"@scion/toolkit": "^1.0.0", | ||
"rxjs": "^7.8.0", | ||
"solclientjs": "^10.16.0" | ||
"solclientjs": "^10.17.1" | ||
}, | ||
@@ -50,4 +50,2 @@ "dependencies": { | ||
"types": "./index.d.ts", | ||
"esm2022": "./esm2022/solace-community-angular-solace-message-client.mjs", | ||
"esm": "./esm2022/solace-community-angular-solace-message-client.mjs", | ||
"default": "./fesm2022/solace-community-angular-solace-message-client.mjs" | ||
@@ -54,0 +52,0 @@ } |
@@ -1,6 +0,5 @@ | ||
export { SolaceMessageClientModule } from './lib/solace-message-client.module'; | ||
export { SolaceMessageClientConfig, SolaceMessageClientConfigFn } from './lib/solace-message-client.config'; | ||
export { OAuthAccessTokenProvider, OAuthAccessTokenFn } from './lib/oauth-access-token-provider'; | ||
export { OAuthAccessTokenFn } from './lib/oauth-access-token-provider'; | ||
export { SolaceSessionProvider } from './lib/solace-session-provider'; | ||
export { provideSolaceMessageClient, provideNullSolaceMessageClient } from './lib/solace-message-client.provider'; | ||
export { MessageEnvelope, Params, SolaceMessageClient, mapToText, mapToBinary, ObserveOptions, ConsumeOptions, BrowseOptions, PublishOptions, NullSolaceMessageClient, Data, RequestOptions } from './lib/solace-message-client'; | ||
export { MessageEnvelope, Params, SolaceMessageClient, mapToText, mapToBinary, ObserveOptions, ConsumeOptions, PublishOptions, NullSolaceMessageClient, Data, RequestOptions } from './lib/solace-message-client'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
228814
16
2036